diff --git a/.github/workflows/harness-sidecar-release-gate.yaml b/.github/workflows/harness-sidecar-release-gate.yaml index 4e44c9ac9..64f690ccc 100644 --- a/.github/workflows/harness-sidecar-release-gate.yaml +++ b/.github/workflows/harness-sidecar-release-gate.yaml @@ -13,6 +13,7 @@ on: - 'tests/cli/test_generated_agent_sidecar_runtime.py' - 'tests/cli/test_generated_agent_mcp.py' - 'tests/cli/test_studio_rbac.py' + - 'tests/cli/test_studio_a2a_deployment.py' - 'tests/cli/test_studio_release.py' - 'tests/cli/test_studio_update.py' - 'tests/cli/test_studio_startup_imports.py' @@ -50,6 +51,7 @@ on: - 'tests/cli/test_generated_agent_sidecar_runtime.py' - 'tests/cli/test_generated_agent_mcp.py' - 'tests/cli/test_studio_rbac.py' + - 'tests/cli/test_studio_a2a_deployment.py' - 'tests/cli/test_studio_release.py' - 'tests/cli/test_studio_update.py' - 'tests/cli/test_studio_startup_imports.py' @@ -134,6 +136,10 @@ jobs: python -m pytest -q \ tests/frontend/server/test_runtime_iam.py \ tests/cli/test_generated_agent_mcp.py \ + tests/cli/test_studio_a2a_deployment.py \ + tests/cli/test_studio_rbac.py::test_mcp_deployment_error_details_are_actionable \ + tests/cli/test_studio_rbac.py::test_managed_sidecar_runtime_envs_reject_invalid_mcp_state \ + tests/cli/test_studio_rbac.py::test_managed_sidecar_runtime_envs_allow_zero_mcp_without_legacy_fallback \ tests/cli/test_generated_agent_backend_codegen_extended.py::test_generated_debug_applies_published_mcp_credential_contract_before_discovery \ tests/cli/test_studio_rbac.py::test_deployment_status_recovers_completed_update_from_fresh_instance \ tests/cli/test_studio_rbac.py::test_new_deployment_creates_requested_instance_range_without_republishing \ diff --git a/frontend/README.md b/frontend/README.md index 65258db5b..bbcd90d68 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -526,7 +526,14 @@ See [deployment and operation](service/studio_release_notifier/README.md). `优化` → `调试` → `环境` → `发布`. On the optimization page, `自定义` appears first and starts with no components, while `运维场景` applies the `ops` component combination. Component checkboxes remain editable and an empty - selection keeps Sidecar disabled. The Environment step can optionally add the + selection keeps Sidecar disabled. BytePlus does not show a default warning; + selecting an unsupported Sidecar option still explains the restriction. + A2A center selections configure discovery on their parent Agent and do not + require a local Agent name. They can be retained or added during a standard + Runtime update without enabling Sidecar or configuring MCP. Source-preserving + updates still require the original Agent structure. Deployment validation + reports Agent, Skill, MCP, and source-image problems separately. + The Environment step can optionally add the official Lark CLI, GitHub CLI, and Pandoc to the cloud runtime. Selecting a tool generates an inspectable provider-specific Dockerfile with pinned releases, amd64/arm64 assets, and SHA-256 verification. Advanced configuration diff --git a/frontend/src/create/CustomCreate.tsx b/frontend/src/create/CustomCreate.tsx index 159951250..8daf7fd11 100644 --- a/frontend/src/create/CustomCreate.tsx +++ b/frontend/src/create/CustomCreate.tsx @@ -3701,13 +3701,11 @@ function DebugComparisonWorkspace({ function HarnessOptimizationWorkspace({ profile, optimizations, - unavailableMessage, onProfileChange, onOptimizationChange, }: { profile: HarnessSidecarProfileId; optimizations: HarnessSidecarOptionId[]; - unavailableMessage?: string | null; onProfileChange: (profile: HarnessSidecarProfileId) => void; onOptimizationChange: ( optionId: HarnessSidecarOptionId, @@ -3721,12 +3719,6 @@ function HarnessOptimizationWorkspace({ aria-label={t("traditional.optimization.ariaLabel")} >
- {unavailableMessage ? ( -
- - {unavailableMessage} -
- ) : null}
{t("traditional.optimization.scenario")} @@ -6604,7 +6596,6 @@ export function CustomCreate({ diff --git a/frontend/tests/harnessSidecarOptions.test.mjs b/frontend/tests/harnessSidecarOptions.test.mjs index 38e6109f7..366772697 100644 --- a/frontend/tests/harnessSidecarOptions.test.mjs +++ b/frontend/tests/harnessSidecarOptions.test.mjs @@ -196,7 +196,7 @@ test("fails fast with a clear BytePlus Sidecar notice without blocking ordinary customCreateSource, /selected && harnessProviderNotice[\s\S]*?setBuildErr\(harnessProviderNotice\)/, ); - assert.match( + assert.doesNotMatch( customCreateSource, /unavailableMessage=\{harnessProviderNotice\}/, ); diff --git a/tests/cli/test_studio_a2a_deployment.py b/tests/cli/test_studio_a2a_deployment.py new file mode 100644 index 000000000..2357911a0 --- /dev/null +++ b/tests/cli/test_studio_a2a_deployment.py @@ -0,0 +1,230 @@ +# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Offline regressions for registry-backed A2A deployment with Sidecar off.""" + +from __future__ import annotations + +import copy +import json +from pathlib import Path +from types import SimpleNamespace +from typing import Any + +import pytest +import yaml +from fastapi.testclient import TestClient + +from tests.cli.test_studio_rbac import ( + _create_studio_app, + _runtime, + _runtime_with_public_endpoint, + _RuntimeJsonResponse, +) +from veadk.cli.generated_agent_codegen import AgentDraft, generate_project_from_draft +from veadk.cli.legacy_runtime_recovery import ( + LegacyRecoveryError, + apply_source_preserving_edits, + build_sidecar_mcp_servers_json, + mcp_editor_draft_without_credentials, + mcp_reuse_supplied_credentials, +) + + +def _registry_entry() -> dict[str, Any]: + # Studio's A2A selector configures discovery on its parent, not a named Agent. + return { + "name": "", + "agentType": "a2a", + "a2aRegistry": {"enabled": True, "registrySpaceId": "offline-space"}, + "mcpTools": [], + } + + +def test_a2a_registry_entries_are_not_mcp_agent_identities() -> None: + draft = {"name": "root_agent", "subAgents": [_registry_entry()]} + assert ( + mcp_reuse_supplied_credentials( + published_draft=draft, + edited_draft=draft, + published_reference_values={}, + reuse_requests=(), + ) + == () + ) + assert ( + json.loads(build_sidecar_mcp_servers_json(draft=draft, secret_values={})) == [] + ) + + +def test_a2a_registry_inactive_mcp_fields_are_still_sanitized() -> None: + entry = _registry_entry() + entry["mcpTools"] = [{"authToken": "offline-inactive-secret"}] + draft = {"name": "root_agent", "subAgents": [entry]} + sanitized = mcp_editor_draft_without_credentials(draft) + assert "offline-inactive-secret" not in json.dumps(sanitized) + assert entry["mcpTools"][0]["authToken"] == "offline-inactive-secret" + + +def test_a2a_registry_does_not_relax_local_agent_identity_or_source_preservation() -> ( + None +): + for child in ({"name": "", "agentType": "llm"}, {"name": "root_agent"}): + with pytest.raises(LegacyRecoveryError, match="agent_identity_invalid"): + mcp_reuse_supplied_credentials( + published_draft={"name": "root_agent"}, + edited_draft={"name": "root_agent", "subAgents": [child]}, + published_reference_values={}, + reuse_requests=(), + ) + with pytest.raises(LegacyRecoveryError): + apply_source_preserving_edits( + {"name": "root_agent"}, + {"name": "root_agent", "subAgents": [_registry_entry()]}, + ) + + +@pytest.mark.parametrize("provider", ["byteplus", "volcengine"]) +@pytest.mark.parametrize("operation", ["create", "add-registry", "retain-registry"]) +def test_a2a_registry_deployment_without_sidecar( + monkeypatch: pytest.MonkeyPatch, + tmp_path: Path, + provider: str, + operation: str, +) -> None: + from agentkit.sdk.runtime.client import AgentkitRuntimeClient + + region = "ap-southeast-1" if provider == "byteplus" else "cn-shanghai" + monkeypatch.setenv("BYTEPLUS_ACCESS_KEY", "test-ak") + monkeypatch.setenv("BYTEPLUS_SECRET_KEY", "test-sk") + monkeypatch.setenv("MODEL_AGENT_API_KEY", "offline-model-key") + monkeypatch.setattr( + "agentkit.utils.template_utils.render_template", lambda _: "offline" + ) + monkeypatch.setattr( + "veadk.auth.veauth.ark_veauth.get_ark_token", lambda **_: "offline-model-key" + ) + monkeypatch.setattr( + "veadk.cli.cli_frontend._sync_volcengine_runtime_tags", lambda **_: None + ) + runtime = _runtime_with_public_endpoint(_runtime("offline-runtime", "developer")) + runtime.current_version_number = 3 + runtime.status = "Ready" + runtime.role_name = "runtime-role" + runtime.artifact_url = "" + runtime.envs = [] + published: dict[str, Any] = { + "name": "root_agent", + "description": "Offline A2A regression", + "instruction": "Use agent discovery.", + "cloudProvider": provider, + "subAgents": [ + {"name": "worker", "instruction": "Help the root.", "subAgents": []} + ], + } + if operation == "retain-registry": + published["subAgents"][0]["subAgents"] = [_registry_entry()] + requested = copy.deepcopy(published) + requested["subAgents"][0]["subAgents"] = [_registry_entry()] + captured: list[dict[str, Any]] = [] + + def get_runtime(_self: Any, request: Any) -> Any: + assert request.runtime_id == runtime.runtime_id + return runtime + + monkeypatch.setattr(AgentkitRuntimeClient, "get_runtime", get_runtime) + + class RuntimeClient: + def __init__(self, **_kwargs: Any) -> None: + pass + + async def __aenter__(self) -> "RuntimeClient": + return self + + async def __aexit__(self, *_args: Any) -> None: + pass + + async def request(self, _method: str, url: str, **_kwargs: Any) -> Any: + if url.endswith("/list-apps"): + return _RuntimeJsonResponse(["root_agent"]) + assert url.endswith("/web/agent-info/root_agent") + return _RuntimeJsonResponse({"name": "root_agent", "draft": published}) + + monkeypatch.setattr("httpx.AsyncClient", RuntimeClient) + + def launch(*, config_file: str, **_kwargs: Any) -> Any: + captured.append(yaml.safe_load(Path(config_file).read_text())) + runtime.current_version_number = 4 + return SimpleNamespace( + success=True, + error=None, + deploy_result=SimpleNamespace( + endpoint_url="https://runtime.example.test", + metadata={ + "runtime_id": runtime.runtime_id, + "runtime_name": runtime.name, + }, + ), + ) + + monkeypatch.setattr("agentkit.toolkit.sdk.launch", launch) + project = generate_project_from_draft(AgentDraft.model_validate(requested)) + python_files = [item.content for item in project.files if item.path.endswith(".py")] + assert any("build_a2a_registry_tools(" in content for content in python_files) + for content in python_files: + compile(content, "generated.py", "exec") + app = _create_studio_app( + monkeypatch, tmp_path, developers="developer", provider=provider + ) + headers = {"X-VeADK-Local-User": "developer"} + payload: dict[str, Any] = { + "name": "root_agent", + "draft": requested, + "files": [item.model_dump() for item in project.files], + "createEvaluationSets": False, + "config": {"region": region}, + "harnessSidecar": {"enabled": False, "componentOverrides": {}}, + } + with TestClient(app) as client: + if operation != "create": + capability = client.get( + "/web/runtime-update-capability", + headers=headers, + params={ + "runtimeId": runtime.runtime_id, + "region": region, + "appName": "root_agent", + }, + ) + assert capability.status_code == 200 + assert capability.json()["canUpdate"] is True + payload.update( + runtimeId=runtime.runtime_id, + appName="root_agent", + editMode="regenerate", + updateEtag=capability.json()["etag"], + baseRuntimeVersion=3, + ) + response = client.post("/web/deploy-agentkit", headers=headers, json=payload) + assert response.status_code == 200, response.text + frames = [ + json.loads(line[6:]) + for line in response.text.splitlines() + if line.startswith("data: ") + ] + assert frames[-1]["success"] is True, frames[-1] + assert len(captured) == 1 + runtime_envs = captured[0]["launch_types"]["cloud"]["runtime_envs"] + assert runtime_envs.get("HARNESS_SIDECAR_ENABLED", "false") == "false" + assert "MCP_SERVERS_JSON" not in runtime_envs diff --git a/tests/cli/test_studio_rbac.py b/tests/cli/test_studio_rbac.py index 99c9ac4bb..82690fca8 100644 --- a/tests/cli/test_studio_rbac.py +++ b/tests/cli/test_studio_rbac.py @@ -114,6 +114,11 @@ def test_runtime_role_lookup_failure_finishes_deployment_and_allows_retry( ("legacy_mcp_credential_missing", "缺少可用凭证"), ("legacy_mcp_reuse_source_missing", "无法沿用原 MCP 凭证"), ("legacy_platform_mcp_read_only", "Skill 或 MCP 配置已变化"), + ("legacy_overlay_agent_identity_invalid", "Agent 名称为空或重复"), + ("legacy_overlay_agent_graph_changed", "不支持修改子 Agent 或 A2A 结构"), + ("legacy_overlay_skill_materialization_invalid", "Skill 文件"), + ("legacy_image_registry_unsupported", "源镜像仓库"), + ("unknown_validation_error", "智能体部署配置校验失败"), ], ) def test_mcp_deployment_error_details_are_actionable( @@ -708,7 +713,8 @@ def test_managed_sidecar_runtime_envs_reject_invalid_mcp_state( {"effectiveComponents": ["mcp_resilience"]}, ) - assert error == "Harness Sidecar MCP 配置无效,请检查名称、地址与认证后重试。" + assert error == "MCP 配置无效,请检查名称、地址与认证后重试。" + assert runtime_envs["MCP_SERVERS_JSON"] == raw_mcp assert "AGENTKIT_HARNESS_RUNTIME_COMMAND" not in runtime_envs diff --git a/tests/test_harness_sidecar_release_gate.py b/tests/test_harness_sidecar_release_gate.py index 4e6fc40bb..257ba3cde 100644 --- a/tests/test_harness_sidecar_release_gate.py +++ b/tests/test_harness_sidecar_release_gate.py @@ -65,6 +65,13 @@ def test_sidecar_release_gate_runs_backend_and_frontend_in_parallel() -> None: in backend_run ) assert "tests/frontend/server/test_runtime_iam.py" in backend_run + assert "tests/cli/test_studio_a2a_deployment.py" in backend_run + assert "test_mcp_deployment_error_details_are_actionable" in backend_run + assert "test_managed_sidecar_runtime_envs_reject_invalid_mcp_state" in backend_run + assert ( + "test_managed_sidecar_runtime_envs_allow_zero_mcp_without_legacy_fallback" + in backend_run + ) assert ( "test_new_deployment_creates_requested_instance_range_without_republishing" in backend_run diff --git a/veadk/cli/cli_frontend.py b/veadk/cli/cli_frontend.py index c561158f7..be5a1a36e 100644 --- a/veadk/cli/cli_frontend.py +++ b/veadk/cli/cli_frontend.py @@ -136,7 +136,25 @@ def _mcp_deployment_error_detail(code: str) -> str: - """Map server-only MCP validation codes to safe, actionable HTTP 409s.""" + """Map deployment validation codes without exposing configuration values.""" + + if code == "legacy_overlay_agent_identity_invalid": + return "Agent 名称为空或重复,请为每个本地 Agent 填写唯一名称后重试。" + if code == "legacy_overlay_agent_graph_changed": + return ( + "当前 Runtime 使用保留源码更新,不支持修改子 Agent 或 A2A 结构。" + "请恢复原结构,或使用完整项目源码重新部署。" + ) + if code.startswith("legacy_overlay_agent_graph_"): + return "Agent 结构无效或超出层级、数量限制,请检查子 Agent 配置后重试。" + if code.startswith( + ("legacy_overlay_skill", "legacy_skill_", "legacy_runtime_skill") + ): + return "Skill 文件或配置无效,请重新选择包含完整文件的 Skill 后重试。" + if code == "legacy_image_registry_unsupported": + return "当前源镜像仓库不支持保留源码更新,请使用完整项目源码重新部署。" + if code.startswith("legacy_image_"): + return "无法确认更新所需的源镜像,请重新打开智能体详情或使用完整项目源码部署。" if code == "legacy_mcp_name_duplicate": return "MCP 名称重复,请为每个 HTTP MCP 服务使用唯一名称。" @@ -157,7 +175,9 @@ def _mcp_deployment_error_detail(code: str) -> str: return "运行版本中的 Skill 或 MCP 配置已变化,请重新打开详情并确认最新配置后再更新。" if code == "legacy_overlay_sidecar_intent_changed": return "Harness Sidecar 组件选择已变化,请重新打开详情并确认后再更新。" - return "Harness Sidecar MCP 配置无效,请检查名称、地址与认证后重试。" + if code.startswith(("legacy_mcp_", "legacy_overlay_mcp")): + return "MCP 配置无效,请检查名称、地址与认证后重试。" + return "智能体部署配置校验失败,请检查配置后重试。" def _capture_process_env(keys: Iterable[str]) -> Callable[[], None]: diff --git a/veadk/cli/legacy_runtime_recovery.py b/veadk/cli/legacy_runtime_recovery.py index 9991a4a67..755ae7baa 100644 --- a/veadk/cli/legacy_runtime_recovery.py +++ b/veadk/cli/legacy_runtime_recovery.py @@ -640,9 +640,22 @@ def merge_mcp_recoveries(*recoveries: McpRecovery) -> McpRecovery: ) +def _is_registry_a2a_entry(node: Mapping[str, Any]) -> bool: + """Registry selectors attach discovery tools to their parent, not an Agent.""" + registry = node.get("a2aRegistry") + return ( + node.get("agentType") == "a2a" + and isinstance(registry, Mapping) + and registry.get("enabled") is True + ) + + def _draft_nodes( - node: Mapping[str, Any], *, depth: int = 0 + node: Mapping[str, Any], *, depth: int = 0, skip_registry_entries: bool = True ) -> Iterable[Mapping[str, Any]]: + # Match code generation: registry entries are leaves and cannot own MCPs. + if skip_registry_entries and _is_registry_a2a_entry(node): + return if depth > 16: raise LegacyRecoveryError("legacy_overlay_agent_graph_too_deep") yield node @@ -652,7 +665,9 @@ def _draft_nodes( raise LegacyRecoveryError("legacy_overlay_agent_graph_too_large") for child in children: if isinstance(child, Mapping): - yield from _draft_nodes(child, depth=depth + 1) + yield from _draft_nodes( + child, depth=depth + 1, skip_registry_entries=skip_registry_entries + ) workflow = node.get("workflow") workflow_nodes = workflow.get("nodes") if isinstance(workflow, Mapping) else None if isinstance(workflow_nodes, list): @@ -661,11 +676,15 @@ def _draft_nodes( for item in workflow_nodes: child = item.get("agent") if isinstance(item, Mapping) else None if isinstance(child, Mapping): - yield from _draft_nodes(child, depth=depth + 1) + yield from _draft_nodes( + child, depth=depth + 1, skip_registry_entries=skip_registry_entries + ) def _draft_node_index( draft: Mapping[str, Any], + *, + skip_registry_entries: bool = False, ) -> dict[str, tuple[tuple[str, ...], Mapping[str, Any]]]: """Index a draft by stable Agent identity and its parent path.""" @@ -674,6 +693,8 @@ def _draft_node_index( def visit( node: Mapping[str, Any], parent_path: tuple[str, ...], depth: int ) -> None: + if skip_registry_entries and _is_registry_a2a_entry(node): + return if depth > 16: raise LegacyRecoveryError("legacy_overlay_agent_graph_too_deep") name = str(node.get("name") or "").strip() @@ -823,7 +844,9 @@ def _mcp_reuse_bindings( str, tuple[tuple[str, str, str], str, tuple[str, ...], int], ] = {} - for agent_name, (parent_path, node) in _draft_node_index(draft).items(): + for agent_name, (parent_path, node) in _draft_node_index( + draft, skip_registry_entries=True + ).items(): raw_tools = node.get("mcpTools") if raw_tools is None: continue @@ -998,7 +1021,9 @@ def canonicalize_source_preserving_mcp_credentials( used_supplied: set[tuple[str, str, str]] = set() resolved: dict[str, str] = {} seen_identities: set[tuple[str, str, str]] = set() - for agent_name, (_path, node) in _draft_node_index(canonical).items(): + for agent_name, (_path, node) in _draft_node_index( + canonical, skip_registry_entries=True + ).items(): tools = node.get("mcpTools") if tools is None: continue @@ -1120,7 +1145,7 @@ def mcp_editor_draft_without_credentials( """Return an editor draft containing references but never secret values.""" sanitized = copy.deepcopy(dict(draft)) - for node in _draft_nodes(sanitized): + for node in _draft_nodes(sanitized, skip_registry_entries=False): raw_tools = node.get("mcpTools") if not isinstance(raw_tools, list): continue @@ -1145,7 +1170,9 @@ def mcp_editor_credential_values( credentials: list[dict[str, str]] = [] seen_references: set[str] = set() - for agent_name, (_path, node) in _draft_node_index(draft).items(): + for agent_name, (_path, node) in _draft_node_index( + draft, skip_registry_entries=True + ).items(): raw_tools = node.get("mcpTools") if raw_tools is None: continue diff --git a/veadk/webui/assets/app/index-CJviP90a.js b/veadk/webui/assets/app/index-BcpSnsFp.js similarity index 66% rename from veadk/webui/assets/app/index-CJviP90a.js rename to veadk/webui/assets/app/index-BcpSnsFp.js index 5b84e53a2..aa692b827 100644 --- a/veadk/webui/assets/app/index-CJviP90a.js +++ b/veadk/webui/assets/app/index-BcpSnsFp.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/mermaid.core-DeGzkuWe.js","assets/chunks/purify.es-BnINGy_Y.js","assets/chunks/MarkdownPromptEditor-CzsU5wfw.js","assets/styles/MarkdownPromptEditor-ZH9qtki0.css","assets/chunks/QuickAgentCreateDialog-DPeLFn25.js","assets/styles/QuickAgentCreateDialog-DGsLIlOX.css"])))=>i.map(i=>d[i]); -var cUe=Object.defineProperty;var HW=e=>{throw TypeError(e)};var uUe=(e,t,n)=>t in e?cUe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Jt=(e,t,n)=>uUe(e,typeof t!="symbol"?t+"":t,n),qW=(e,t,n)=>t.has(e)||HW("Cannot "+n);var rl=(e,t,n)=>(qW(e,t,"read from private field"),n?n.call(e):t.get(e)),WW=(e,t,n)=>t.has(e)?HW("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),$M=(e,t,n,i)=>(qW(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);function dUe(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 xm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _w(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wle={exports:{}},fI={};/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/visualizations/mermaid/mermaid.core-Bi7HkArr.js","assets/chunks/purify.es-BnINGy_Y.js","assets/chunks/MarkdownPromptEditor-B5fLU-G9.js","assets/styles/MarkdownPromptEditor-ZH9qtki0.css","assets/chunks/QuickAgentCreateDialog-6X2BnBqv.js","assets/styles/QuickAgentCreateDialog-DGsLIlOX.css"])))=>i.map(i=>d[i]); +var gUe=Object.defineProperty;var HW=e=>{throw TypeError(e)};var bUe=(e,t,n)=>t in e?gUe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var rn=(e,t,n)=>bUe(e,typeof t!="symbol"?t+"":t,n),qW=(e,t,n)=>t.has(e)||HW("Cannot "+n);var il=(e,t,n)=>(qW(e,t,"read from private field"),n?n.call(e):t.get(e)),WW=(e,t,n)=>t.has(e)?HW("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),FM=(e,t,n,i)=>(qW(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);function yUe(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 wm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _w(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Cle={exports:{}},hI={};/** * @license React * react-jsx-runtime.production.js * @@ -7,8 +7,8 @@ var cUe=Object.defineProperty;var HW=e=>{throw TypeError(e)};var uUe=(e,t,n)=>t * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var fUe=Symbol.for("react.transitional.element"),hUe=Symbol.for("react.fragment");function Ole(e,t,n){var i=null;if(n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:fUe,type:e,key:i,ref:t!==void 0?t:null,props:n}}fI.Fragment=hUe;fI.jsx=Ole;fI.jsxs=Ole;wle.exports=fI;var o=wle.exports;const kle={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}})"},Sle={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."},Ele={cnBeijing:"China North 2 (Beijing)",cnShanghai:"China East 2 (Shanghai)"},Cle={runtimeUnsupported:"This Runtime does not currently support connections. Confirm that the service is running normally."},Tle={autoConfigureFailed:"Failed to configure the Feishu bot automatically"},Ale={actionFailed:"Failed to {{action}}",detail:"Details: {{detail}}",request:"Request: {{request}}"},_le={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: Try again later, and review the Runtime, model, or gateway logs.",modelQuotaHint:"Tip: The model has reached its TPM/RPM quota. Try again later or increase the model quota.",rawResponseLabel:"Raw response: "},jle={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"},Nle={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"},Rle={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",sharedSpaceFailed:"Shared space unavailable",reservedSpaceName:"This name is reserved for a system space; choose another name",reviewSpaceFailed:"The review space is unavailable",submitReviewFailed:"Could not submit the publication request",listReviewsFailed:"Could not load review requests",reviewFilesFailed:"Could not load submitted files",decideReviewFailed:"Review failed, please try again",listVersionsFailed:"Unable to load skill versions",uploadVersionFailed:"Unable to upload the new skill version"},Ile={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}}"},Ple={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."},Dle={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"},Mle={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"},Lle={listFailed:"Failed to load website integrations",createFailed:"Failed to create the website integration",deleteFailed:"Failed to delete the website integration"},$le={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}})"},Fle={invalidName:"Names must contain 1–128 characters, without control or invisible formatting characters, or < >.",renameProjectFailed:"Unable to update the project name",renameVersionFailed:"Unable to update the version name",invalidNameUpdateResponse:"The name update response does not match the request. Refresh and try again.",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."},Ble={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",evaluation:{datasetSaveFailed:"Failed to save evaluation cases",datasetLoadFailed:"Failed to load evaluation cases",statusLoadFailed:"Failed to load evaluation status",resumeFailed:"Failed to continue evaluation",retryFailed:"Failed to retry evaluation",reportLoadFailed:"Failed to load the evaluation report",reportDownloadFailed:"Failed to download the evaluation report"},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",evaluationAsset:"Evaluation asset",evaluation:"Evaluation status",evaluationCapabilities:"Evaluation capabilities",evaluationDimension:"Evaluation dimension",evaluationCase:"Evaluation case",evaluationCriteria:"Evaluation criteria",evaluationMessage:"Evaluation conversation",evaluationDataset:"Evaluation dataset",evaluationDimensionResult:"Evaluation dimension result",evaluationEvidence:"Evaluation evidence",evaluationReport:"Evaluation report",evaluationSummary:"Evaluation summary",evaluationCaseResult:"Evaluation case result",evaluationOutput:"Evaluation output",evaluationLimitations:"Evaluation limitations"}},Ule={status:{ready:"Ready",wakeable:"Asleep",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 agent to wake was not found.",resumeSnapshotFailed:"Unable to wake the agent. Try again later.",deleteSnapshotFailed:"Unable to delete the agent. Try again later.",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."},Qle={invalidSandboxVersion:"Invalid sandbox version response",loadSandboxVersionsFailed:"Failed to check sandbox versions",updateSandboxFailed:"Failed to update sandbox",invalidSandboxUpdate:"Invalid sandbox update response",errorWithDetailAndRawResponse:`{{context}} + */var vUe=Symbol.for("react.transitional.element"),xUe=Symbol.for("react.fragment");function Tle(e,t,n){var i=null;if(n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:vUe,type:e,key:i,ref:t!==void 0?t:null,props:n}}hI.Fragment=xUe;hI.jsx=Tle;hI.jsxs=Tle;Cle.exports=hI;var o=Cle.exports;const Ale={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}})"},_le={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."},jle={cnBeijing:"China North 2 (Beijing)",cnShanghai:"China East 2 (Shanghai)"},Nle={runtimeUnsupported:"This Runtime does not currently support connections. Confirm that the service is running normally."},Rle={autoConfigureFailed:"Failed to configure the Feishu bot automatically"},Ile={actionFailed:"Failed to {{action}}",detail:"Details: {{detail}}",request:"Request: {{request}}"},Ple={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: Try again later, and review the Runtime, model, or gateway logs.",modelQuotaHint:"Tip: The model has reached its TPM/RPM quota. Try again later or increase the model quota.",rawResponseLabel:"Raw response: "},Dle={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"},Mle={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"},Lle={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",sharedSpaceFailed:"Shared space unavailable",reservedSpaceName:"This name is reserved for a system space; choose another name",reviewSpaceFailed:"The review space is unavailable",submitReviewFailed:"Could not submit the publication request",listReviewsFailed:"Could not load review requests",reviewFilesFailed:"Could not load submitted files",decideReviewFailed:"Review failed, please try again",listVersionsFailed:"Unable to load skill versions",uploadVersionFailed:"Unable to upload the new skill version"},$le={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}}"},Fle={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."},Ble={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"},Ule={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"},Qle={listFailed:"Failed to load website integrations",createFailed:"Failed to create the website integration",deleteFailed:"Failed to delete the website integration"},zle={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}})"},Vle={invalidName:"Names must contain 1–128 characters, without control or invisible formatting characters, or < >.",renameProjectFailed:"Unable to update the project name",renameVersionFailed:"Unable to update the version name",invalidNameUpdateResponse:"The name update response does not match the request. Refresh and try again.",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."},Hle={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.",invalidPendingInput:"Analysis questions are not readable",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",loadEventsFailed:"Failed to follow the migration progress stream",invalidEventsResponse:"The migration progress stream returned an invalid frame.",reconnecting:"Connection lost. Reconnecting to the migration progress stream…",startFailed:"Failed to start the migration",submitAnswersFailed:"Failed to submit additional analysis information",submitInputFailed:"Could not submit the analysis answer",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",evaluation:{datasetSaveFailed:"Failed to save evaluation cases",datasetLoadFailed:"Failed to load evaluation cases",statusLoadFailed:"Failed to load evaluation status",resumeFailed:"Failed to continue evaluation",retryFailed:"Failed to retry evaluation",reportLoadFailed:"Failed to load the evaluation report",reportDownloadFailed:"Failed to download the evaluation report"},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",evaluationAsset:"Evaluation asset",evaluation:"Evaluation status",evaluationCapabilities:"Evaluation capabilities",evaluationDimension:"Evaluation dimension",evaluationCase:"Evaluation case",evaluationCriteria:"Evaluation criteria",evaluationMessage:"Evaluation conversation",evaluationDataset:"Evaluation dataset",evaluationDimensionResult:"Evaluation dimension result",evaluationEvidence:"Evaluation evidence",evaluationReport:"Evaluation report",evaluationSummary:"Evaluation summary",evaluationCaseResult:"Evaluation case result",evaluationOutput:"Evaluation output",evaluationLimitations:"Evaluation limitations",pendingInput:"Analysis question",pendingQuestion:"Analysis question item",pendingOption:"Analysis question option"}},qle={status:{ready:"Ready",wakeable:"Asleep",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 agent to wake was not found.",resumeSnapshotFailed:"Unable to wake the agent. Try again later.",deleteSnapshotFailed:"Unable to delete the agent. Try again later.",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."},Wle={invalidSandboxVersion:"Invalid sandbox version response",loadSandboxVersionsFailed:"Failed to check sandbox versions",updateSandboxFailed:"Failed to update sandbox",invalidSandboxUpdate:"Invalid sandbox update response",errorWithDetailAndRawResponse:`{{context}} {{detail}} Response details: {{response}}`,errorWithRawResponse:`{{context}} @@ -16,21 +16,21 @@ Response details: {{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 60 seconds. Try again later, and review the Runtime, model, or gateway logs.",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",loadMcpCredentialsFailed:"Failed to load MCP authentication",invalidMcpCredentials:"Studio returned invalid MCP authentication data",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",errorWithCloudResponse:`{{context}} Cloud API: {{action}} Original cloud response: -{{response}}`,emptyCloudResponse:"(empty response body)"},zle={loadFailed:"Failed to load conversation mode capabilities (HTTP {{status}})",invalidResponse:"The conversation mode capabilities response has an invalid format"},Vle={nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, {{contentType}}){{detail}}"},Hle={busy:"The workspace is busy. Try again shortly",notFound:"Workspace not found",duplicates:"Multiple personal workspace sessions were found. Contact your administrator",timeout:"Workspace recovery timed out. Your projects are retained. Try again",unavailable:"The workspace cannot be restored right now. Your projects are retained. Try again",persistence:"Persistence is not enabled for this Sandbox. Check the workspace configuration",startup:"Workspace startup failed. Check the Sandbox status",exists:"This project already exists. Open it from the project list",directory:"Project directory not found",configuration:"Configure the workspace Sandbox image first",state:"Could not check workspace status. Try again",list:"Could not restore the workspace or load projects. Try again",create:"Project initialization failed. Check that the image is available and try again",open:"Could not restore the workspace or open the project. Try again",connection:"Could not connect to the workspace. Try again",invalidWorkspaceUrl:"The workspace returned an invalid URL",operation:"Project operation failed. Try again",invalidProjectUrl:"The project URL is invalid",listFallback:"Could not load projects",connectionState:"Could not connect to the workspace. Try again"},qle={reporting:"Completing delivery details",packaging:"Preparing artifacts",savingVersion:"Saving version",finishing:"Finishing request",submitResult:"Submit build result",requestFailed:"Task request failed. Please retry.",invalidResponse:"Invalid task state response.",eventGap:"Restoring missing task output.",reconnecting:"Reconnecting. Existing output is preserved.",input:{pending:"Queued",sending:"Confirming delivery",delivered:"Delivered",withdrawn:"Not sent"},plan:"Execution plan",diff:"File changes",preparing:"Preparing task",preparingEnvironment:"Preparing development environment…",connectingEnvironment:"Connecting to development environment…",processing:"Processing request",thinking:"Thinking",read:"Read file · {{target}}",listFiles:"List directory · {{target}}",search:"Search · {{target}}",command:"Run command · {{target}}",editFiles:"Edit files · {{target}}",webSearch:"Search web · {{target}}",processSummary:"Processed {{count}} items",duration:"{{seconds}}s",durationUnits:{milliseconds:"{{value}} ms",hours:"{{value}} h",minutes:"{{value}} min",seconds:"{{value}} s"},failedTools:"{{count}} tools failed",toolFailed:"Failed",toolCalls:"{{count}} tool calls",turnDuration:"Turn elapsed {{duration}}",toolDuration:"Tool time {{duration}}",toolDurationPartial:"Recorded tool time {{duration}}",toolDurationHelp:"Sum of tool durations. Parallel calls can exceed turn elapsed time.",turnStatus:{completed:"Completed",failed:"Failed",interrupted:"Interrupted",cancelled:"Interrupted",unavailable:"Task ended"},notReported:"Not reported",partial:"Recorded",partialHelp:"Usage for this turn may be incomplete.",tokenDetails:"Turn token usage",model:"Turn model",totalTokens:"Total",inputTokens:"Input",cachedInputTokens:"Cached input",uncachedInputTokens:"Uncached input",cacheWriteInputTokens:"Cache write",outputTokens:"Output",reasoningOutputTokens:"Reasoning output",cacheHitRate:"Input cache hit rate",tokenHelp:"Cached input and reasoning output are subsets of input and output. Uncached input = input − cached input."},Wle={common:kle,agentkitCli:Sle,cloudRegion:Ele,connections:Cle,feishuBot:Tle,requestError:Ale,runSse:_le,runtimeLogs:jle,search:Nle,skills:Rle,sse:Ile,identity:Ple,github:Dle,video:Mle,websiteIntegration:Lle,knowledge:$le,intelligentDevelopment:Fle,migrations:Ble,sandbox:Ule,client:Qle,newChatCapabilities:zle,jsonResponse:Vle,workspaceProjects:Hle,developmentRuns:qle},pUe=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:Sle,client:Qle,cloudRegion:Ele,common:kle,connections:Cle,default:Wle,developmentRuns:qle,feishuBot:Tle,github:Dle,identity:Ple,intelligentDevelopment:Fle,jsonResponse:Vle,knowledge:$le,migrations:Ble,newChatCapabilities:zle,requestError:Ale,runSse:_le,runtimeLogs:jle,sandbox:Ule,search:Nle,skills:Rle,sse:Ile,video:Mle,websiteIntegration:Lle,workspaceProjects:Hle},Symbol.toStringTag,{value:"Module"})),Kle="Agent reviews",Gle="Request access for everyone in your organization",Xle="Close",Yle="Refresh",Zle="Status",Jle="Applicant",ece="Submitted",tce="Current version",nce="Model",ice="Returned by",rce="Approved by",sce="Reviewed",oce="Agent description",ace="Application notes",lce="Return reason",cce="Review comment",uce="Return reason (required)",dce="Content changed after submission; return and submit again",fce="Withdraw to edit this Agent, then submit a new request to publish it",hce="Other users will lose access to this Agent. Unpublish it?",pce="Cancel",mce="Confirm",gce="Saving",bce="Unpublish",yce="Withdraw request",vce="Approve",xce="Publish for everyone",wce="Request publication",Oce="Everyone",kce={pending:"Pending",approved:"Approved",returned:"Returned",withdrawn:"Withdrawn"},Sce="Search agents or applicants",Ece="Region",Cce="All statuses",Tce="Agent",Ace="Actions",_ce="Review application",jce="Application details",Nce="No matching applications",Rce="No Agent review requests",Ice="{{count}} / {{limit}} characters",mUe={title:Kle,dialogDescription:Gle,close:Xle,refresh:Yle,statusTitle:Zle,submitter:Jle,submittedAt:ece,version:tce,model:nce,returnedBy:ice,approvedBy:rce,reviewedAt:sce,description:oce,message:ace,reason:lce,comment:cce,reasonRequired:uce,contentChanged:dce,withdrawConfirm:fce,unpublishConfirm:hce,cancel:pce,confirm:mce,saving:gce,unpublish:bce,withdraw:yce,return:"Return",approve:vce,publish:xce,submit:wce,private:"Private",enterprise:Oce,status:kce,search:Sce,region:Ece,all:Cce,agent:Tce,actions:Ace,review:_ce,details:jce,noMatches:Nce,empty:Rce,textCount:Ice},gUe=Object.freeze(Object.defineProperty({__proto__:null,actions:Ace,agent:Tce,all:Cce,approve:vce,approvedBy:rce,cancel:pce,close:Xle,comment:cce,confirm:mce,contentChanged:dce,default:mUe,description:oce,details:jce,dialogDescription:Gle,empty:Rce,enterprise:Oce,message:ace,model:nce,noMatches:Nce,publish:xce,reason:lce,reasonRequired:uce,refresh:Yle,region:Ece,returnedBy:ice,review:_ce,reviewedAt:sce,saving:gce,search:Sce,status:kce,statusTitle:Zle,submit:wce,submittedAt:ece,submitter:Jle,textCount:Ice,title:Kle,unpublish:bce,unpublishConfirm:hce,version:tce,withdraw:yce,withdrawConfirm:fce},Symbol.toStringTag,{value:"Module"})),Pce={backToEvaluationCase:"Back to evaluation case",cancel:"Cancel",copied:"Copied",copy:"Copy",exportConversation:"Export conversation",retry:"Retry"},Dce={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."}},Mce={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"}},Lce={noDescription:"No description",region:"Region",unknownAgent:"Unknown Agent"},$ce={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."},Fce={title:"Configure {{provider}} credentials",prefix:"Agent Workspace requires {{provider}} credentials. Set",and:"and",suffix:"in the runtime environment, then retry."},Bce={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"}},Uce={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."},Qce={like:"Like",removeLike:"Remove like",dislike:"Dislike",removeDislike:"Remove dislike",reportIssue:"Report an issue",traceFlameGraph:"Tracing flame graph"},zce={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"},Vce={agentCapabilities:"Checking Agent capabilities…",session:"Loading session…"},Hce={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."},qce={volcengine:"Volcengine"},Wce={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"},Kce={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}}",codeProjects:"Code projects",reviewCenter:"Review center"},Gce={title:"Create from workspace",description:"Create and manage code projects, then develop and debug in VS Code"},Xce={actions:Pce,addAgent:Dce,approval:Mce,common:Lce,conversation:$ce,credentials:Fce,dialogs:Bce,errors:Uce,feedback:Qce,greetings:zce,loading:Vce,oauth:Hce,providers:qce,sandbox:Wce,titles:Kce,workspaceProjectEntry:Gce},bUe=Object.freeze(Object.defineProperty({__proto__:null,actions:Pce,addAgent:Dce,approval:Mce,common:Lce,conversation:$ce,credentials:Fce,default:Xce,dialogs:Bce,errors:Uce,feedback:Qce,greetings:zce,loading:Vce,oauth:Hce,providers:qce,sandbox:Wce,titles:Kce,workspaceProjectEntry:Gce},Symbol.toStringTag,{value:"Module"})),Yce="Automations",Zce="Connect development tools and extend your Agents with automated workflows",Jce="Search automations",eue="Automation categories",tue={development:"Development",channels:"Messaging channels"},nue="{{category}} automations",iue="Open {{name}}",rue="Available only in local deployments",sue="No matching automations",oue="Try searching for another name",aue="Back to automations",lue={"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"}}},"gitlab-review":{name:"GitLab MR review",description:"Use a GitLab integration to review merge requests in an isolated Sandbox."},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."}},cue={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"}}},uue={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."}},due={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."}},fue={title:Yce,description:Zce,search:Jce,categoriesLabel:eue,categories:tue,resultsLabel:nue,open:iue,localOnly:rue,emptyTitle:sue,emptyDescription:oue,backToAutomations:aue,cards:lue,github:cue,codingAgents:uue,feishu:due},yUe=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:aue,cards:lue,categories:tue,categoriesLabel:eue,codingAgents:uue,default:fue,description:Zce,emptyDescription:oue,emptyTitle:sue,feishu:due,github:cue,localOnly:rue,open:iue,resultsLabel:nue,search:Jce,title:Yce},Symbol.toStringTag,{value:"Module"})),hue={"zh-CN":"简体中文","en-US":"English"},vUe={languageNames:hue},xUe=Object.freeze(Object.defineProperty({__proto__:null,default:vUe,languageNames:hue},Symbol.toStringTag,{value:"Module"})),pue={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"},mue={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}}"},gue={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."},bue={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"},yue={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}}"},vue={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",deployAgent:"Deploy Agent",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"}},xue={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"},wue={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"},Oue={placeholder:"Type a message…",inputAria:"Message",generating:"Generating",send:"Send"},kue={ariaLabel:"Invocation context for this turn",removeSkill:"Remove skill {{name}}",removeAgent:"Remove agent {{name}}"},Sue={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"},Eue={playVideo:"Play video: {{name}}",enlargeImage:"Enlarge image preview: {{name}}",image:"image",enlargeVideo:"Enlarge video",videoPreview:"Video preview",downloadVideo:"Download video",close:"Close"},Cue={annotation:pue,media:mue,runtimeLogs:gue,trace:bue,share:yue,blocks:vue,tokenUsage:xue,addAgentKit:wue,composer:Oue,invocation:kue,visualization:Sue,markdown:Eue},wUe=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:wue,annotation:pue,blocks:vue,composer:Oue,default:Cue,invocation:kue,markdown:Eue,media:mue,runtimeLogs:gue,share:yue,tokenUsage:xue,trace:bue,visualization:Sue},Symbol.toStringTag,{value:"Module"})),Tue={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"},Aue={heading:"VeADK agent structure configuration",importHint:"Reload this file from Import YAML on the Create Agent page."},_ue={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"}},jue={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}}`,emptyCloudResponse:"(empty response body)"},Kle={loadFailed:"Failed to load conversation mode capabilities (HTTP {{status}})",invalidResponse:"The conversation mode capabilities response has an invalid format"},Gle={nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, {{contentType}}){{detail}}"},Xle={busy:"The workspace is busy. Try again shortly",notFound:"Workspace not found",duplicates:"Multiple personal workspace sessions were found. Contact your administrator",timeout:"Workspace recovery timed out. Your projects are retained. Try again",unavailable:"The workspace cannot be restored right now. Your projects are retained. Try again",persistence:"Persistence is not enabled for this Sandbox. Check the workspace configuration",startup:"Workspace startup failed. Check the Sandbox status",exists:"This project already exists. Open it from the project list",directory:"Project directory not found",configuration:"Configure the workspace Sandbox image first",state:"Could not check workspace status. Try again",list:"Could not restore the workspace or load projects. Try again",create:"Project initialization failed. Check that the image is available and try again",open:"Could not restore the workspace or open the project. Try again",connection:"Could not connect to the workspace. Try again",invalidWorkspaceUrl:"The workspace returned an invalid URL",operation:"Project operation failed. Try again",invalidProjectUrl:"The project URL is invalid",listFallback:"Could not load projects",connectionState:"Could not connect to the workspace. Try again"},Yle={reporting:"Completing delivery details",packaging:"Preparing artifacts",savingVersion:"Saving version",finishing:"Finishing request",submitResult:"Submit build result",requestFailed:"Task request failed. Please retry.",invalidResponse:"Invalid task state response.",eventGap:"Restoring missing task output.",reconnecting:"Reconnecting. Existing output is preserved.",input:{pending:"Queued",sending:"Confirming delivery",delivered:"Delivered",withdrawn:"Not sent"},plan:"Execution plan",diff:"File changes",preparing:"Preparing task",preparingEnvironment:"Preparing development environment…",connectingEnvironment:"Connecting to development environment…",processing:"Processing request",thinking:"Thinking",read:"Read file · {{target}}",listFiles:"List directory · {{target}}",search:"Search · {{target}}",command:"Run command · {{target}}",editFiles:"Edit files · {{target}}",webSearch:"Search web · {{target}}",processSummary:"Processed {{count}} items",duration:"{{seconds}}s",durationUnits:{milliseconds:"{{value}} ms",hours:"{{value}} h",minutes:"{{value}} min",seconds:"{{value}} s"},failedTools:"{{count}} tools failed",toolFailed:"Failed",toolCalls:"{{count}} tool calls",turnDuration:"Turn elapsed {{duration}}",toolDuration:"Tool time {{duration}}",toolDurationPartial:"Recorded tool time {{duration}}",toolDurationHelp:"Sum of tool durations. Parallel calls can exceed turn elapsed time.",turnStatus:{completed:"Completed",failed:"Failed",interrupted:"Interrupted",cancelled:"Interrupted",unavailable:"Task ended"},notReported:"Not reported",partial:"Recorded",partialHelp:"Usage for this turn may be incomplete.",tokenDetails:"Turn token usage",model:"Turn model",totalTokens:"Total",inputTokens:"Input",cachedInputTokens:"Cached input",uncachedInputTokens:"Uncached input",cacheWriteInputTokens:"Cache write",outputTokens:"Output",reasoningOutputTokens:"Reasoning output",cacheHitRate:"Input cache hit rate",tokenHelp:"Cached input and reasoning output are subsets of input and output. Uncached input = input − cached input."},Zle={common:Ale,agentkitCli:_le,cloudRegion:jle,connections:Nle,feishuBot:Rle,requestError:Ile,runSse:Ple,runtimeLogs:Dle,search:Mle,skills:Lle,sse:$le,identity:Fle,github:Ble,video:Ule,websiteIntegration:Qle,knowledge:zle,intelligentDevelopment:Vle,migrations:Hle,sandbox:qle,client:Wle,newChatCapabilities:Kle,jsonResponse:Gle,workspaceProjects:Xle,developmentRuns:Yle},wUe=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:_le,client:Wle,cloudRegion:jle,common:Ale,connections:Nle,default:Zle,developmentRuns:Yle,feishuBot:Rle,github:Ble,identity:Fle,intelligentDevelopment:Vle,jsonResponse:Gle,knowledge:zle,migrations:Hle,newChatCapabilities:Kle,requestError:Ile,runSse:Ple,runtimeLogs:Dle,sandbox:qle,search:Mle,skills:Lle,sse:$le,video:Ule,websiteIntegration:Qle,workspaceProjects:Xle},Symbol.toStringTag,{value:"Module"})),Jle="Agent reviews",ece="Request access for everyone in your organization",tce="Close",nce="Refresh",ice="Status",rce="Applicant",sce="Submitted",oce="Current version",ace="Model",lce="Returned by",cce="Approved by",uce="Reviewed",dce="Agent description",fce="Application notes",hce="Return reason",pce="Review comment",mce="Return reason (required)",gce="Content changed after submission; return and submit again",bce="Withdraw to edit this Agent, then submit a new request to publish it",yce="Other users will lose access to this Agent. Unpublish it?",vce="Cancel",xce="Confirm",wce="Saving",Oce="Unpublish",kce="Withdraw request",Sce="Approve",Ece="Publish for everyone",Cce="Request publication",Tce="Everyone",Ace={pending:"Pending",approved:"Approved",returned:"Returned",withdrawn:"Withdrawn"},_ce="Search agents or applicants",jce="Region",Nce="All statuses",Rce="Agent",Ice="Actions",Pce="Review application",Dce="Application details",Mce="No matching applications",Lce="No Agent review requests",$ce="{{count}} / {{limit}} characters",OUe={title:Jle,dialogDescription:ece,close:tce,refresh:nce,statusTitle:ice,submitter:rce,submittedAt:sce,version:oce,model:ace,returnedBy:lce,approvedBy:cce,reviewedAt:uce,description:dce,message:fce,reason:hce,comment:pce,reasonRequired:mce,contentChanged:gce,withdrawConfirm:bce,unpublishConfirm:yce,cancel:vce,confirm:xce,saving:wce,unpublish:Oce,withdraw:kce,return:"Return",approve:Sce,publish:Ece,submit:Cce,private:"Private",enterprise:Tce,status:Ace,search:_ce,region:jce,all:Nce,agent:Rce,actions:Ice,review:Pce,details:Dce,noMatches:Mce,empty:Lce,textCount:$ce},kUe=Object.freeze(Object.defineProperty({__proto__:null,actions:Ice,agent:Rce,all:Nce,approve:Sce,approvedBy:cce,cancel:vce,close:tce,comment:pce,confirm:xce,contentChanged:gce,default:OUe,description:dce,details:Dce,dialogDescription:ece,empty:Lce,enterprise:Tce,message:fce,model:ace,noMatches:Mce,publish:Ece,reason:hce,reasonRequired:mce,refresh:nce,region:jce,returnedBy:lce,review:Pce,reviewedAt:uce,saving:wce,search:_ce,status:Ace,statusTitle:ice,submit:Cce,submittedAt:sce,submitter:rce,textCount:$ce,title:Jle,unpublish:Oce,unpublishConfirm:yce,version:oce,withdraw:kce,withdrawConfirm:bce},Symbol.toStringTag,{value:"Module"})),Fce={backToEvaluationCase:"Back to evaluation case",cancel:"Cancel",copied:"Copied",copy:"Copy",exportConversation:"Export conversation",retry:"Retry"},Bce={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."}},Uce={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"}},Qce={noDescription:"No description",region:"Region",unknownAgent:"Unknown Agent"},zce={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."},Vce={title:"Configure {{provider}} credentials",prefix:"Agent Workspace requires {{provider}} credentials. Set",and:"and",suffix:"in the runtime environment, then retry."},Hce={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"}},qce={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."},Wce={like:"Like",removeLike:"Remove like",dislike:"Dislike",removeDislike:"Remove dislike",reportIssue:"Report an issue",traceFlameGraph:"Tracing flame graph"},Kce={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"},Gce={agentCapabilities:"Checking Agent capabilities…",session:"Loading session…"},Xce={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."},Yce={volcengine:"Volcengine"},Zce={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"},Jce={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}}",codeProjects:"Code projects",reviewCenter:"Review center"},eue={title:"Create from workspace",description:"Create and manage code projects, then develop and debug in VS Code"},tue={actions:Fce,addAgent:Bce,approval:Uce,common:Qce,conversation:zce,credentials:Vce,dialogs:Hce,errors:qce,feedback:Wce,greetings:Kce,loading:Gce,oauth:Xce,providers:Yce,sandbox:Zce,titles:Jce,workspaceProjectEntry:eue},SUe=Object.freeze(Object.defineProperty({__proto__:null,actions:Fce,addAgent:Bce,approval:Uce,common:Qce,conversation:zce,credentials:Vce,default:tue,dialogs:Hce,errors:qce,feedback:Wce,greetings:Kce,loading:Gce,oauth:Xce,providers:Yce,sandbox:Zce,titles:Jce,workspaceProjectEntry:eue},Symbol.toStringTag,{value:"Module"})),nue="Automations",iue="Connect development tools and extend your Agents with automated workflows",rue="Search automations",sue="Automation categories",oue={development:"Development",channels:"Messaging channels"},aue="{{category}} automations",lue="Open {{name}}",cue="Available only in local deployments",uue="No matching automations",due="Try searching for another name",fue="Back to automations",hue={"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"}}},"gitlab-review":{name:"GitLab MR review",description:"Use a GitLab integration to review merge requests in an isolated Sandbox."},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."}},pue={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"}}},mue={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."}},gue={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."}},bue={title:nue,description:iue,search:rue,categoriesLabel:sue,categories:oue,resultsLabel:aue,open:lue,localOnly:cue,emptyTitle:uue,emptyDescription:due,backToAutomations:fue,cards:hue,github:pue,codingAgents:mue,feishu:gue},EUe=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:fue,cards:hue,categories:oue,categoriesLabel:sue,codingAgents:mue,default:bue,description:iue,emptyDescription:due,emptyTitle:uue,feishu:gue,github:pue,localOnly:cue,open:lue,resultsLabel:aue,search:rue,title:nue},Symbol.toStringTag,{value:"Module"})),yue={"zh-CN":"简体中文","en-US":"English"},CUe={languageNames:yue},TUe=Object.freeze(Object.defineProperty({__proto__:null,default:CUe,languageNames:yue},Symbol.toStringTag,{value:"Module"})),vue={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"},xue={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}}"},wue={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."},Oue={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"},kue={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}}"},Sue={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",deployAgent:"Deploy Agent",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"}},Eue={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"},Cue={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"},Tue={placeholder:"Type a message…",inputAria:"Message",generating:"Generating",send:"Send"},Aue={ariaLabel:"Invocation context for this turn",removeSkill:"Remove skill {{name}}",removeAgent:"Remove agent {{name}}"},_ue={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"},jue={playVideo:"Play video: {{name}}",enlargeImage:"Enlarge image preview: {{name}}",image:"image",enlargeVideo:"Enlarge video",videoPreview:"Video preview",downloadVideo:"Download video",close:"Close"},Nue={annotation:vue,media:xue,runtimeLogs:wue,trace:Oue,share:kue,blocks:Sue,tokenUsage:Eue,addAgentKit:Cue,composer:Tue,invocation:Aue,visualization:_ue,markdown:jue},AUe=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:Cue,annotation:vue,blocks:Sue,composer:Tue,default:Nue,invocation:Aue,markdown:jue,media:xue,runtimeLogs:wue,share:kue,tokenUsage:Eue,trace:Oue,visualization:_ue},Symbol.toStringTag,{value:"Module"})),Rue={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"},Iue={heading:"VeADK agent structure configuration",importHint:"Reload this file from Import YAML on the Create Agent page."},Pue={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"}},Due={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.`},Nue={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",fallbackApiKeyLabel:"{{name}} fallback model {{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"}},Rue={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}}"}},Iue={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."}},Pue={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"}},Due={title:"Intelligent build",subtitle:"Describe what you need. Build, debug, and validate your agent.",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."},tasks:{title:"Tasks in progress",hint:"Work continues when you leave. Return to follow progress or add instructions.",refresh:"Refresh tasks",loading:"Loading tasks…",empty:"No tasks in progress",emptyHint:"Once a build starts, you can return to it here.",loadError:"Unable to load tasks. Please retry.",openError:"Unable to open this task. Please retry.",startedAt:"Started {{time}}",open:"Open task",opening:"Connecting…",states:{queued:"Queued",running:"Building",recovering:"Reconnecting",waiting_user:"Awaiting your reply",stopping:"Stopping",succeeded:"Completed",failed:"Incomplete",cancelled:"Stopped"}}},Mue={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",defaultVersionName:"Version · {{time}}",rename:{projectTitle:"Edit project name",versionTitle:"Edit version name",projectLabel:"Project name",versionLabel:"Version name",hint:"Use letters, numbers and common punctuation, up to {{max}} characters.",required:"Enter a name.",tooLong:"Names can contain up to {{max}} characters.",invalidCharacters:"Names cannot contain line breaks, control or invisible formatting characters, or < >.",save:"Save name",saving:"Saving…",updated:"Name updated.",failed:"Unable to save the name. Try again."},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"}},Lue={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"}}},$ue={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"}},Fue={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."}},Bue={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"}},Uue={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",fallbacks:"Fallback models",fallbackPlaceholder:"Fallback model name",addFallback:"Add fallback model",addProviderFallback:"Add other provider",removeFallback:"Remove",fallbackType:"Fallback model type",fallbackSameProvider:"Same provider",fallbackOtherProvider:"Other provider",apiKeyEnv:"API Key environment variable",invalidApiKeyEnv:"Use letters, numbers, and underscores only, and do not start with a number.",fallbackHelp:"Same-provider fallbacks reuse the primary connection. Other providers use separate provider, API base, and API Key settings.",fallbackIgnored:"Empty, duplicate, or primary-model entries will be ignored.",provider:"Provider",invalidApiBase:"Enter a valid http:// or https:// URL.",volcengineArk:"Volcano Ark",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",currentApiKey:"Current API Key",currentConfiguration:"Current configuration",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",apiKeyRequired:"Enter or select the model API Key",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"}},Que={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",mcpDuplicateName:"MCP names must be unique",mcpDuplicateUrl:"Remove the duplicate MCP endpoint before publishing",missingSubagent:"A subagent is required",missingPrompt:"System prompt is required",apiKeyRequired:"Enter or select the model API Key",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",fallbacks:"Fallback models",fallbackPlaceholder:"Fallback model name",addFallback:"Add fallback model",addProviderFallback:"Add other provider",removeFallback:"Remove",fallbackType:"Fallback model type",fallbackSameProvider:"Same provider",fallbackOtherProvider:"Other provider",apiKeyEnv:"API Key environment variable",invalidApiKeyEnv:"Use letters, numbers, and underscores only, and do not start with a number.",fallbackHelp:"Same-provider fallbacks reuse the primary connection. Other providers use separate provider, API base, and API Key settings.",fallbackIgnored:"Empty, duplicate, or primary-model entries will be ignored.",provider:"Provider",invalidApiBase:"Enter a valid http:// or https:// URL.",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 is a gateway root address. Use it only when the root path is the MCP endpoint; otherwise include the complete service path.",tokenPlaceholder:"Bearer token (optional)",showToken:"Show Bearer token",hideToken:"Hide Bearer token",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…"}},zue={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"}},Vue={checkingExpiry:"Checking expiry",waitingRecovery:"Waiting for recovery",listFailed:"Could not load projects",recoveryFailed:"Could not restore the workspace. Try again",operationFailed:"Project operation failed. Try again",title:"Code projects",back:"Back to code projects",restart:"This development environment will restart in {{countdown}}. Save your work regularly",expiresAt:"Expires at {{date}}",exitFullscreen:"Exit full screen",fullscreen:"Full screen",exitFullscreenHint:"Exit full screen (Esc)",recovering:"Restoring your workspace. Your project will reopen automatically",retry:"Retry connection",search:"Search code projects",newTitle:"New code project",new:"New project",readingStats:"Loading project details",createdAt:"Created",opening:"Opening",unknownCreatedAt:"Creation time unknown",open:"Open project",empty:"No matching code projects",close:"Close new project",name:"Project name",placeholder:"e.g. my-agent",nameHelp:"Start with a letter and use letters, numbers, underscores or hyphens, up to 64 characters",cancel:"Cancel",create:"Create project",files_one:"{{count}} file",files_other:"{{count}} files",directories_one:"{{count}} directory",directories_other:"{{count}} directories",separator:", "},Hue={enabled:"Enabled",disabled:"Disabled",unknownStatus:"Unknown status",allPermissions:"All permissions",customPermissions:"Custom permissions",unknownPermissions:"Unknown permissions",unnamed:"Unnamed API Key",search:"Search name, status or permissions",noMatches:"No matching API Keys",noModelPermission:"Not permitted by this API Key",modelAvailable:"Available",permissionState:{Available:"Available for chat",Shutdown:"Shut down",VideoGeneration:"Video generation model",Unsupported:"Not a chat model",NotActivated:"Not activated",Unknown:"Model status unavailable"}},que={common:Tue,yaml:Aue,validation:_ue,defaults:jue,helpers:Nue,intelligentDeployment:Rue,codePackage:Iue,buildCanvas:Pue,intelligent:Due,projectLibrary:Mue,modePicker:Lue,promptEditor:$ue,skills:Fue,workflow:Bue,workbench:Uue,traditional:Que,template:zue,workspace:Vue,modelApiKey:Hue},OUe=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:Pue,codePackage:Iue,common:Tue,default:que,defaults:jue,helpers:Nue,intelligent:Due,intelligentDeployment:Rue,modePicker:Lue,modelApiKey:Hue,projectLibrary:Mue,promptEditor:$ue,skills:Fue,template:zue,traditional:Que,validation:_ue,workbench:Uue,workflow:Bue,workspace:Vue,yaml:Aue},Symbol.toStringTag,{value:"Module"})),Wue={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"},Kue={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?"},Gue={configuration:"Task configuration",nextRun:"Next run",pageLabel:"Scheduled task details",region:"Region",runtime:"Runtime",status:"Task status"},Xue={createTitle:"Create scheduled task",description:"Each trigger creates a separate Session for the Runtime Agent.",editTitle:"Edit scheduled task"},Yue={minutesSeconds:"{{minutes}} min {{seconds}} sec",seconds:"{{count}} sec"},Zue={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"},Jue={all:"All"},ede={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"},tde={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."},nde={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"},ide={cron:"Cron {{cron}}{{zone}}",daily:"Daily at {{time}}{{zone}}",once:"Once · {{date}}{{zone}}",weekly:"{{weekday}} at {{time}}{{zone}}"},rde={daily:"Daily",once:"Once",weekly:"Weekly"},sde={cancelled:"Cancelled",enabled:"Enabled",failed:"Failed",notRun:"Not run yet",paused:"Paused",pending:"Preparing",queued:"Queued",retrying:"Retrying",running:"Running",skipped:"Skipped",success:"Succeeded"},ode={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."},ade={friday:"Friday",monday:"Monday",saturday:"Saturday",sunday:"Sunday",thursday:"Thursday",tuesday:"Tuesday",wednesday:"Wednesday"},kUe={actions:Wue,confirm:Kue,detail:Gue,drawer:Xue,duration:Yue,fields:Zue,filters:Jue,history:ede,notices:tde,page:nde,schedule:ide,scheduleTypes:rde,status:sde,validation:ode,weekdays:ade},SUe=Object.freeze(Object.defineProperty({__proto__:null,actions:Wue,confirm:Kue,default:kUe,detail:Gue,drawer:Xue,duration:Yue,fields:Zue,filters:Jue,history:ede,notices:tde,page:nde,schedule:ide,scheduleTypes:rde,status:sde,validation:ode,weekdays:ade},Symbol.toStringTag,{value:"Module"})),lde="Quick-create Agent",cde="Agent type",ude="Close",dde="Deploy",fde="Preview",hde="Configuration download started",pde="Download failed — try again",mde="Review {{count}} configuration issues",gde="Custom",bde="Custom {{field}}",yde="Enter a custom value",vde="This model declares no reasoning levels; the service settings apply",xde="Add a model to this provider first",wde="Select a provider first",Ode="Select an option",kde="Optional",Sde="Default model, Agent preset and permissions apply to new sessions. The preset must exist in the deployed Harness",Ede="Enter an environment variable name only; supply its secret value at deployment",Cde="read-only allows reading; workspace-write allows workspace edits; danger-full-access allows full access without approval",Tde="allowedModels lists the models sub-agents may select. Enabling selection requires at least one provider/model pair",Ade="Add a custom model service using its endpoint, protocol and model IDs, including compatible Volcengine and BytePlus services",_de="Covers common native settings. Other plugin parameters and preset files are not included yet",jde="Native configuration reference",Nde="Provider {{index}}",Rde="Model {{index}}",Ide="Add provider",Pde="Remove provider {{index}}",Dde="Add model",Mde="Remove model {{index}}",Lde="Add allowed model",$de="Remove allowed model {{index}}",Fde="Remove",Bde="Enter the service’s model ID",Ude={provider:"Provider {{index}}",model:"Model {{index}}"},Qde={defaults:"Session defaults",deepseek:"DeepSeek model service",providers:"Custom model providers",shell:"Command execution",loop:"Tool calls",subagents:"Sub-agent model selection",search:"DeepSeek web search"},zde={id:"Provider ID",displayName:"Display name",baseURL:"Base URL",api:"API protocol",apiKeyEnv:"API key environment variable"},Vde={id:"e.g. company-models",displayName:"Optional; defaults to the provider ID",baseURL:"https://…/v1",api:"Select a protocol",apiKeyEnv:"e.g. MODEL_API_KEY"},Hde={id:"Model ID",name:"Display name",contextWindow:"Context capacity",maxTokens:"Maximum output capacity"},qde={positive:"Enter a number greater than zero",integer:"Enter a valid positive integer",env:"Use letters, digits and underscores; do not start with a digit",url:"Enter an HTTP or HTTPS URL without credentials",option:"Select a supported native option",required:"Complete this field",duplicate:"This ID or model pair already exists",providerId:"Start with a lowercase letter; use lowercase letters, digits, dots, underscores or hyphens; reserved IDs are unavailable",routes:"Add at least one complete provider/model pair",modelPair:"Enter a model ID for this custom provider",unknownProvider:"Add this custom provider first",unknownModel:"Enter a model ID configured for this provider",timer:"Enter a timeout greater than 0 and no more than 2147483647 ms"},Wde={"agent-default-model_provider":"Default provider","agent-default-model_model":"Default model","agent-default-model_reasoningEffort":"Default reasoning effort","agent-presets_default":"Default Agent preset",permission_defaultPreset:"Default permission preset","llm-deepseek_apiKeyEnv":"API key environment variable","llm-deepseek_baseURL":"Base URL","llm-deepseek_thinking":"Thinking mode","llm-deepseek_reasoningEffort":"Reasoning effort","llm-deepseek_maxTokens":"Output limit per request","llm-deepseek_defaultContextWindow":"Default context capacity","llm-deepseek_streamIdleTimeoutMs":"Stream idle timeout (ms)",bash_timeoutMs:"Default execution timeout (ms)",bash_maxTimeoutMs:"Maximum execution timeout (ms)",bash_maxOutputBytes:"Output limit (bytes)","agent-loop_maxParallelToolCalls":"Parallel tool-call limit","subagent-model-selection_enabled":"Enable model selection","web-search-deepseek_apiKeyEnv":"API key environment variable","web-search-deepseek_baseURL":"Search base URL","web-search-deepseek_model":"Search model","web-search-deepseek_apiVersion":"API version","web-search-deepseek_maxTokens":"Search output limit","web-search-deepseek_maxUses":"Maximum search uses"},Kde="Cancel",Gde="Back to creation methods",Xde="DeepSeek Harness configuration",EUe={title:lde,agentType:cde,close:ude,continue:"Continue",deploy:dde,preview:fde,export:"Export configuration",downloaded:hde,downloadFailed:pde,validationSummary:mde,customValue:gde,customField:bde,enterCustomValue:yde,reasoningUnavailable:vde,modelsUnavailable:xde,selectProviderFirst:wde,selectOption:Ode,optional:kde,defaultsHelp:Sde,credentialHelp:Ede,permissionHelp:Cde,routesHelp:Tde,providersHelp:Ade,coverage:_de,source:jde,provider:Nde,model:Rde,addProvider:Ide,removeProvider:Pde,addModel:Dde,removeModel:Mde,addRoute:Lde,removeRoute:$de,remove:Fde,modelIdPlaceholder:Bde,route:Ude,sections:Qde,providerFields:zde,providerPlaceholders:Vde,modelFields:Hde,errors:qde,fields:Wde,cancel:Kde,back:Gde,pageTitle:Xde},CUe=Object.freeze(Object.defineProperty({__proto__:null,addModel:Dde,addProvider:Ide,addRoute:Lde,agentType:cde,back:Gde,cancel:Kde,close:ude,coverage:_de,credentialHelp:Ede,customField:bde,customValue:gde,default:EUe,defaultsHelp:Sde,deploy:dde,downloadFailed:pde,downloaded:hde,enterCustomValue:yde,errors:qde,fields:Wde,model:Rde,modelFields:Hde,modelIdPlaceholder:Bde,modelsUnavailable:xde,optional:kde,pageTitle:Xde,permissionHelp:Cde,preview:fde,provider:Nde,providerFields:zde,providerPlaceholders:Vde,providersHelp:Ade,reasoningUnavailable:vde,remove:Fde,removeModel:Mde,removeProvider:Pde,removeRoute:$de,route:Ude,routesHelp:Tde,sections:Qde,selectOption:Ode,selectProviderFirst:wde,source:jde,title:lde,validationSummary:mde},Symbol.toStringTag,{value:"Module"})),Yde="Report an issue",Zde="Description",Jde="Common issues",efe="Cancel",tfe="Done",nfe="Submit feedback",ife="Submitting…",rfe={title:"Feedback submitted. Thank you.",description:"The AgentKit team will review your report as soon as possible."},sfe={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"}},ofe={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."},TUe={title:Yde,descriptionLabel:Zde,commonIssues:Jde,cancel:efe,done:tfe,submit:nfe,submitting:ife,success:rfe,dialog:sfe,page:ofe},AUe=Object.freeze(Object.defineProperty({__proto__:null,cancel:efe,commonIssues:Jde,default:TUe,descriptionLabel:Zde,dialog:sfe,done:tfe,page:ofe,submit:nfe,submitting:ife,success:rfe,title:Yde},Symbol.toStringTag,{value:"Module"})),afe={back:"Back",close:"Close"},lfe={title:"Optimize migrated project",closeAria:"Close optimization dialog"},cfe={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."},ufe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any (universal migration)"},dfe={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"},ffe={evaluationPending:"Evaluation pending",evaluationRunning:"Evaluating",waitingDataset:"Evaluation cases pending",waitingEnvironment:"Environment variables required",evaluationFailed:"Migrated, evaluation incomplete",evaluationBlocked:"Migrated, evaluation needs attention",evaluationCancelled:"Migrated, evaluation cancelled",resultUnavailable:"Result unavailable",environmentExpired:"Environment expired"},hfe={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."},pfe={passed:"Output verification passed",failed:"Output verification failed",degraded:"Output verification incomplete"},mfe={session:"Create migration environment",upload:"Upload project",analysis:"Analyze project"},gfe={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"},bfe={seconds:"{{seconds}} sec",minutesSeconds:"{{minutes}} min {{seconds}} sec"},yfe={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."},vfe={recommended:"Recommended migration method",scope:"Migration scope",excluded:"Out of scope",viewEvidence:"View analysis evidence",viewAssumptions:"View key assumptions",viewSourceEvidence:"View source evidence"},xfe={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."},wfe={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…"},Ofe={retiring:"Retiring soon",currentDefault:"Current default model",loadError:"Failed to load models",label:"Model",placeholder:"Select a model"},kfe={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:"Upload and analyze",inputAria:"Select a local project ZIP",retention:"The temporary migration environment is retained for 1 hour after creation. Successfully saved source versions are unaffected.",uploading:"Uploading…",sizeHint:"Project ZIP, up to {{size}}"},Sfe={requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}",notReady:"Migration output is not ready yet.",back:"Back to migration results"},Efe={backToAddAgent:"Back to Add Agent",title:"Migrate existing project",newMigration:"New migration",recent:"Recent migrations",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.",backToHome:"Migration home",navigation:"Migration navigation",showMore:"Show more",showLess:"Show less",projectName:"Project name",status:"Status",createdAt:"Created",actions:"Actions",openTask:"Open migration {{name}}",continueTask:"Continue",viewTask:"View"},Cfe={stop:"Stop migration",stopping:"Stopping…",cancel:"Cancel",reload:"Reload",refreshStatus:"Refresh status"},Tfe={unavailable:"Migration is currently unavailable",defaultReason:"Dev Sandbox is currently unavailable. Contact your administrator to check the configuration."},Afe={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."},_fe={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"},jfe={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"},Nfe={setup:{title:"Migration effect evaluation",description:"Evaluation cases run automatically after migration.",on:"On",off:"Off",unavailable:"Migration effect evaluation is unavailable in this environment.",casesTitle:"Evaluation cases",casesDescription:"Add at least one case. Expected outcomes and criteria are optional.",configuredSummary:"{{count}} cases · {{preset}} · {{dimensions}}",incompleteSummary:"{{count}} cases need content · {{preset}} · {{dimensions}}",dimensionSummary:"{{count}} dimensions",editSettings:"Edit settings",viewSettings:"View settings",lockedTitle:"Evaluation cases",lockedDescription:"Cases cannot change after upload starts.",closeAria:"Close evaluation settings",done:"Finish setup",close:"Close"},tabs:{label:"Migration task content",migration:"Migration",evaluation:"Evaluation",waitingMigration:"Waiting for migration",waitingConfiguration:"Setup required",running:"Running",completed:"Completed",issue:"Needs attention"},bulk:{open:"Paste multiple",label:"Enter one case per line",placeholder:`Check the status of today's orders -Summarize the result in three points`,preview:"{{count}} cases will be added",confirm:"Add cases"},case:{title:"Case {{index}}",add:"Add case",moveUp:"Move case {{index}} up",moveDown:"Move case {{index}} down",copy:"Duplicate",delete:"Delete",userInput:"User input",userInputPlaceholder:"For example: Check the status of today's orders",expectedOutcome:"Expected outcome (optional)",expectedOutcomePlaceholder:"Describe what the Agent should accomplish; exact wording is not required",criteria:"Requirements (optional)",addCriterion:"Add requirement",criterionLabel:"Requirement {{index}}",criterionPlaceholder:"For example: Include the order ID and current status",removeCriterion:"Remove requirement {{index}}"},advanced:{title:"Advanced settings",standard:"Standard evaluation",standardDescription:"Uses 3 dimensions by default: semantic fidelity, output constraints, and workflow/tool fidelity.",custom:"Custom dimensions",customDescription:"Select one or more dimensions based on business risk.",lockedDescription:"The evaluation method and dimensions cannot change after upload starts."},dimension:{semantic_fidelity:"Semantic fidelity",output_contract:"Output contract",workflow_tool_fidelity:"Workflow and tool fidelity",context_memory_fidelity:"Context and memory fidelity",boundary_error_fidelity:"Boundary and error fidelity",safety_refusal_fidelity:"Safety and refusal fidelity"},dimensionDescription:{semantic_fidelity:"Checks whether intent, conclusions, and key facts remain consistent.",output_contract:"Checks required fields, structure, language, and formatting constraints.",workflow_tool_fidelity:"Checks observable workflow branches and tool-driven behavior.",context_memory_fidelity:"Checks supported multi-turn context and memory behavior.",boundary_error_fidelity:"Checks invalid input, missing information, and dependency failures.",safety_refusal_fidelity:"Checks existing authorization, refusal, and sensitive-data boundaries."},validation:{caseCount:"Keep between 1 and {{count}} cases.",dimensionRequired:"Select at least one evaluation dimension.",userInputRequired:"Enter case input.",userInputBytes:"A case cannot exceed 32 KiB.",expectedOutcomeBytes:"The expected outcome cannot exceed 16 KiB.",criteriaCount:"A case can contain at most {{count}} requirements.",criterionRequired:"Requirements cannot be empty.",criterionBytes:"One requirement cannot exceed 2 KiB.",datasetBytes:"All evaluation cases cannot exceed 10 MiB."},dataset:{invalidLockResponse:"The service did not confirm that evaluation cases were saved. Try again.",loadingSettings:"Loading evaluation settings…",loadSettingsFailed:"Evaluation settings could not be loaded.",retryLoadSettings:"Reload",missing:"No saved evaluation cases were found. Enter and save them again.",saveWarning:"Evaluation cases were not saved. Migration continues.",retrySave:"Save evaluation cases again",saving:"Saving…"},state:{disabled:"Evaluation is off",waiting_dataset:"Waiting for evaluation cases",pending:"Evaluation starts automatically after migration",preparing:"Preparing the evaluation environment…",waiting_environment:"Runtime environment variables are required",deploying:"Deploying a temporary Runtime…",executing:"Running evaluation cases…",judging:"Running evaluation analysis…",aggregating:"Aggregating evaluation results…",completed:"Evaluation completed",failed:"Evaluation incomplete",blocked:"Evaluation requires attention before it can continue",cancelled:"Evaluation cancelled"},progress:{label:"Migration and migration effect evaluation progress",migration:"Migration",evaluation:"Migration effect evaluation",notStarted:"Not started",inProgress:"In progress",completed:"Complete",waitingConfiguration:"Waiting for setup",issue:"Needs attention"},environment:{description:"Enter the environment variables required by the temporary Runtime.",security:"Used only for this evaluation.",optional:"Optional",submit:"Submit and continue evaluation",submitting:"Submitting…"},execution:{preparing:"Prepare evaluation",preparingDetail:"Validate migration output and {{count}} evaluation cases",deploying:"Start Runtime",deployingDetail:"Prepare {{runtime}}",runtimeFallback:"isolated runtime",executing:"Run cases",executingDetail:"Run {{count}} cases and capture output",judging:"Run evaluation analysis",judgingDetail:"Evaluate {{cases}} cases · {{dimensions}} dimensions",aggregating:"Generate evaluation report",aggregatingDetail:"Aggregate scores and evidence into an HTML report",waiting:"Waiting",running:"Running",failed:"Failed",complete:"Completed"},result:{title:"Execution progress",attempt:"Evaluation attempt {{attempt}}",pending:"Waiting for migration to complete",retry:"Run evaluation again",retrying:"Retrying…",failureStage:"Failed at",errorCode:"Error code",taskId:"Task ID",diagnosticAttempt:"Evaluation attempt",runtime:"Runtime",errorDetails:"Error details",diagnosticField:"{{label}}: {{value}}",diagnosticHeading:"{{label}}:",loadingReport:"Loading the evaluation report…",reportTitle:"HTML evaluation report",reportHtmlDescription:"View or download the HTML report.",viewReport:"View report",reportDrawerDescription:"Scores, differences, and evidence",closeReport:"Close",closeReportAria:"Close evaluation report",reportPreviewTitle:"Migration effect evaluation report preview",reportSummary:"Evaluation summary",reportVersion:"Dataset {{version}} · Prompt v{{prompt}}",downloadReport:"Download full report",downloadingReport:"Downloading…",overallScore:"Overall fidelity",scoreScale:"0–100; N/A when evidence is insufficient",evidenceCoverage:"Evidence coverage",coverageDetail:"{{scored}} of {{total}} dimensions evidenced",executionSuccess:"Execution success",executionDetail:"{{succeeded}} of {{total}} cases completed",naCount:"N/A count",naDescription:"Insufficient evidence; excluded from scores",gapDescription:"Migration gap summary",lowestScoringCases:"Lowest-scoring cases",executionFailures:"Execution issues",criticalEvidence:"Critical evidence",limitations:"Evaluation limitations",viewEvidence:"View results and evidence for {{count}} cases",outputTruncated:"Long output was truncated",executionState:{succeeded:"Execution completed",failed:"Execution issue"},severityLabel:"Severity: {{severity}}",severity:{none:"None",low:"Low",medium:"Medium",high:"High",critical:"Critical",unknown:"Unknown"},evidenceSource:{user_reference:"Expected outcome",user_criteria:"Provided requirements",source_contract:"Source contract",observed_output:"Observed output",runtime_observation:"Raw Runtime data",deterministic_assertion:"Deterministic assertion"},listSeparator:", "}},Rfe={closeAria:"Dismiss error",loadFailed:"Could not load migration data. Try again.",refreshFailed:"Could not refresh the migration status. Try again."},Ife={title:"Stop the current migration?",description:"Stopping ends the current analysis or migration process. Completed steps will not continue."},_Ue={common:afe,optimization:lfe,projects:cfe,framework:ufe,state:dfe,historyStatus:ffe,task:hfe,verification:pfe,transfer:mfe,validation:gfe,duration:bfe,expiry:yfe,analysis:vfe,activity:xfe,artifact:wfe,model:Ofe,upload:kfe,deployment:Sfe,workspace:Efe,actions:Cfe,capability:Tfe,conversation:Afe,questions:_fe,confirmation:jfe,evaluation:Nfe,errors:Rfe,stopDialog:Ife},jUe=Object.freeze(Object.defineProperty({__proto__:null,actions:Cfe,activity:xfe,analysis:vfe,artifact:wfe,capability:Tfe,common:afe,confirmation:jfe,conversation:Afe,default:_Ue,deployment:Sfe,duration:bfe,errors:Rfe,evaluation:Nfe,expiry:yfe,framework:ufe,historyStatus:ffe,model:Ofe,optimization:lfe,projects:cfe,questions:_fe,state:dfe,stopDialog:Ife,task:hfe,transfer:mfe,upload:kfe,validation:gfe,verification:pfe,workspace:Efe},Symbol.toStringTag,{value:"Module"})),Pfe={loading:"Loading…",searchLabel:"Search {{label}}",searchPlaceholder:"Search {{label}}",retry:"Retry",noMatches:"No matches",noOptions:"No options available",selection:"{{label}}: {{value}}"},Dfe={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."}},Mfe={label:"New conversation workspace",agent:"Agent",skill:"Skill customization",video:"Video creation"},Lfe={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"},$fe={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}}",wakingHint:"Waking the agent. This may take some time."},Ffe={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"},Bfe={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"}},Ufe={compactSelect:Pfe,featureNotice:Dfe,workspace:Mfe,mode:Lfe,agentPicker:$fe,skill:Ffe,video:Bfe},NUe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:$fe,compactSelect:Pfe,default:Ufe,featureNotice:Dfe,mode:Lfe,skill:Ffe,video:Bfe,workspace:Mfe},Symbol.toStringTag,{value:"Module"})),Qfe="Review center",zfe="Resource type to review",Vfe="Only administrators can access the review center",Hfe="Search name, submitter or version",qfe="Review status",Wfe="Pending: {{count}}",Kfe="Requests: {{count}}",Gfe={skill:"Skills",agent:"Agents"},Xfe={all:"All statuses",pending:"Pending",approved:"Approved",returned:"Returned",approving:"Publishing"},Yfe={application:"Request",submitter:"Submitter",version:"Version",submittedAt:"Submitted at",status:"Status",actions:"Actions"},Zfe={details:"Details",detailsFor:"View request for {{name}}",approve:"Approve",approveFor:"Approve request for {{name}}",return:"Return",returnFor:"Return request for {{name}}",close:"Close",backToDetails:"Back to details",confirmApprove:"Confirm approval",confirmReturn:"Confirm return",clearFilters:"Clear filters",refresh:"Refresh",cancel:"Cancel",resumeApproval:"Resume publishing"},Jfe={title:"No review requests yet",description:"Submitted review requests will appear here",filteredTitle:"No matching requests",filteredDescription:"Try another search or change the review status"},ehe={title:"Request details",sections:"Request detail sections",overview:"Overview",files:"Submitted files · {{count}}",requestType:"Request type",update:"Version update",firstRelease:"First release",source:"Source",source_skill:"{{name}}’s personal skill space",source_agent:"{{name}}’s development environment",destination:"Publication target",destination_skill:"Shared skill space",destination_agent:"Shared agent",region:"Region",visibility:"Visibility after publication",shared:"Visible to everyone",description:"Description",changes:"Submission notes",example:"Usage example",history:"Review history",submitted:"{{name}} submitted this request",versionFixed:"Reviewing the submitted version only",instructions:"Instructions",filesTab:"Submitted files",filesFailed:"Could not load submitted files",unknownAuthor:"Unknown submitter",reviewer:"Reviewed by",reviewedAt:"Reviewed at",approved:"{{name}} approved the request",returned:"{{name}} returned the request",unknownReviewer:"Unknown reviewer",approvedBy:"Approved by",returnedBy:"Returned by",comment:"Review comment",result:"Review result",noHistory:"This skill has not been submitted for review",pendingHint:"Waiting for an administrator to review",approvingHint:"Approval is confirmed and publishing to the shared space is in progress",approving:"{{name}} confirmed approval; publishing is in progress"},the={failed:"The review space is unavailable",retry:"Retry"},nhe={approveTitle:"Approve request",returnTitle:"Return request",approveDescription:"Approving {{name}} {{version}} makes this version available to everyone in the enterprise shared space",returnDescription:"Return {{name}} {{version}} and explain what the applicant should change",reason:"Return reason",reasonRequired:"Enter a return reason",reasonHelp:"Up to 256 characters, visible to the applicant",saving:"Saving…",failed:"Review failed, please try again",approved:"{{name}} was approved and shared",returned:"{{name}} was returned",comment:"Comment (optional)",commentHelp:"Up to 256 characters, visible to the applicant"},ihe={title:"AI score",points:"{{score}} / 100",insufficient:"Insufficient evidence",status:{unscored:"Not scored",not_requested:"Not scored",queued:"Queued",running:"Scoring",completed:"Scored",failed:"Scoring failed"},loading:"Loading score…",starting:"Submitting for scoring…",loadFailed:"Could not load score",retryFailed:"Could not request scoring",failed:"Scoring failed, ask an administrator to retry",retry:"Score again",start:"Start scoring",reload:"Reload",download:"Download JSON",expand:"Expand",collapse:"Collapse",hint:"Scores apply to this submitted version and inform the administrator’s decision",dimensions:{safety:"Safety",usability:"Usability",completeness:"Completeness",reliability:"Reliability",maintainability:"Maintainability"},risks:"Risk flags",suggestions:"Suggestions",model:"Scoring model",rubric:"Rubric version",time:"Scored at",severity:{low:"Low risk",medium:"Medium risk",high:"High risk",critical:"Critical risk"},coverage:"Review coverage",coverageCount:"Reviewed {{included}} of {{total}} files",coverageIncomplete:"Some content was excluded, so scoring evidence is incomplete",omittedFile:"Not reviewed {{path}}: {{reason}}",truncatedFile:"Partially reviewed {{path}}: {{reason}}",originalError:"Original cloud error"},RUe={title:Qfe,category:zfe,adminOnly:Vfe,search:Hfe,filterStatus:qfe,pendingCount:Wfe,total:Kfe,kind:Gfe,status:Xfe,columns:Yfe,actions:Zfe,empty:Jfe,detail:ehe,space:the,decision:nhe,score:ihe},IUe=Object.freeze(Object.defineProperty({__proto__:null,actions:Zfe,adminOnly:Vfe,category:zfe,columns:Yfe,decision:nhe,default:RUe,detail:ehe,empty:Jfe,filterStatus:qfe,kind:Gfe,pendingCount:Wfe,score:ihe,search:Hfe,space:the,status:Xfe,title:Qfe,total:Kfe},Symbol.toStringTag,{value:"Module"})),rhe={cancel:"Cancel",close:"Close",retry:"Retry",tryAgain:"Try again",closeDialog:"Close {{title}}",agentFallback:"{{agent}} Agent",unknownSource:"Unknown source"},she={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}}"},ohe={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"},ahe={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."}}},lhe={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"},che={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"},uhe={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",stopping:"Confirming stop…",resume:"Resume task",steer:"Add instructions",steerPlaceholder:"Add instructions, or stop the task at any time…"},dhe={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"},fhe={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"}},hhe={back:"Back to Agents",subtitle:"{{agent}} agent 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:"Delete “{{name}}” and its saved data? This cannot be undone.",deleting:"Deleting…",confirmDelete:"Delete",sleepingHint:"This agent is asleep. Waking it before opening may take some time.",wakingHint:"Waking the agent. This may take some time.",agentId:"Agent ID"},phe={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"},mhe={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.`},Mue={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",fallbackApiKeyLabel:"{{name}} fallback model {{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"}},Lue={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}}"}},$ue={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."}},Fue={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"}},Bue={title:"Intelligent build",subtitle:"Describe what you need. Build, debug, and validate your agent.",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."},tasks:{title:"Tasks in progress",hint:"Work continues when you leave. Return to follow progress or add instructions.",refresh:"Refresh tasks",loading:"Loading tasks…",empty:"No tasks in progress",emptyHint:"Once a build starts, you can return to it here.",loadError:"Unable to load tasks. Please retry.",openError:"Unable to open this task. Please retry.",startedAt:"Started {{time}}",open:"Open task",opening:"Connecting…",states:{queued:"Queued",running:"Building",recovering:"Reconnecting",waiting_user:"Awaiting your reply",stopping:"Stopping",succeeded:"Completed",failed:"Incomplete",cancelled:"Stopped"}}},Uue={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",defaultVersionName:"Version · {{time}}",rename:{projectTitle:"Edit project name",versionTitle:"Edit version name",projectLabel:"Project name",versionLabel:"Version name",hint:"Use letters, numbers and common punctuation, up to {{max}} characters.",required:"Enter a name.",tooLong:"Names can contain up to {{max}} characters.",invalidCharacters:"Names cannot contain line breaks, control or invisible formatting characters, or < >.",save:"Save name",saving:"Saving…",updated:"Name updated.",failed:"Unable to save the name. Try again."},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"}},Que={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"}}},zue={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"}},Vue={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."}},Hue={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"}},que={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",fallbacks:"Fallback models",fallbackPlaceholder:"Fallback model name",addFallback:"Add fallback model",addProviderFallback:"Add other provider",removeFallback:"Remove",fallbackType:"Fallback model type",fallbackSameProvider:"Same provider",fallbackOtherProvider:"Other provider",apiKeyEnv:"API Key environment variable",invalidApiKeyEnv:"Use letters, numbers, and underscores only, and do not start with a number.",fallbackHelp:"Same-provider fallbacks reuse the primary connection. Other providers use separate provider, API base, and API Key settings.",fallbackIgnored:"Empty, duplicate, or primary-model entries will be ignored.",provider:"Provider",invalidApiBase:"Enter a valid http:// or https:// URL.",volcengineArk:"Volcano Ark",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",currentApiKey:"Current API Key",currentConfiguration:"Current configuration",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",apiKeyRequired:"Enter or select the model API Key",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"}},Wue={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",mcpDuplicateName:"MCP names must be unique",mcpDuplicateUrl:"Remove the duplicate MCP endpoint before publishing",missingSubagent:"A subagent is required",missingPrompt:"System prompt is required",apiKeyRequired:"Enter or select the model API Key",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",fallbacks:"Fallback models",fallbackPlaceholder:"Fallback model name",addFallback:"Add fallback model",addProviderFallback:"Add other provider",removeFallback:"Remove",fallbackType:"Fallback model type",fallbackSameProvider:"Same provider",fallbackOtherProvider:"Other provider",apiKeyEnv:"API Key environment variable",invalidApiKeyEnv:"Use letters, numbers, and underscores only, and do not start with a number.",fallbackHelp:"Same-provider fallbacks reuse the primary connection. Other providers use separate provider, API base, and API Key settings.",fallbackIgnored:"Empty, duplicate, or primary-model entries will be ignored.",provider:"Provider",invalidApiBase:"Enter a valid http:// or https:// URL.",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 is a gateway root address. Use it only when the root path is the MCP endpoint; otherwise include the complete service path.",tokenPlaceholder:"Bearer token (optional)",showToken:"Show Bearer token",hideToken:"Hide Bearer token",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…"}},Kue={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"}},Gue={checkingExpiry:"Checking expiry",waitingRecovery:"Waiting for recovery",listFailed:"Could not load projects",recoveryFailed:"Could not restore the workspace. Try again",operationFailed:"Project operation failed. Try again",title:"Code projects",back:"Back to code projects",restart:"This development environment will restart in {{countdown}}. Save your work regularly",expiresAt:"Expires at {{date}}",exitFullscreen:"Exit full screen",fullscreen:"Full screen",exitFullscreenHint:"Exit full screen (Esc)",recovering:"Restoring your workspace. Your project will reopen automatically",retry:"Retry connection",search:"Search code projects",newTitle:"New code project",new:"New project",readingStats:"Loading project details",createdAt:"Created",opening:"Opening",unknownCreatedAt:"Creation time unknown",open:"Open project",empty:"No matching code projects",close:"Close new project",name:"Project name",placeholder:"e.g. my-agent",nameHelp:"Start with a letter and use letters, numbers, underscores or hyphens, up to 64 characters",cancel:"Cancel",create:"Create project",files_one:"{{count}} file",files_other:"{{count}} files",directories_one:"{{count}} directory",directories_other:"{{count}} directories",separator:", "},Xue={enabled:"Enabled",disabled:"Disabled",unknownStatus:"Unknown status",allPermissions:"All permissions",customPermissions:"Custom permissions",unknownPermissions:"Unknown permissions",unnamed:"Unnamed API Key",search:"Search name, status or permissions",noMatches:"No matching API Keys",noModelPermission:"Not permitted by this API Key",modelAvailable:"Available",permissionState:{Available:"Available for chat",Shutdown:"Shut down",VideoGeneration:"Video generation model",Unsupported:"Not a chat model",NotActivated:"Not activated",Unknown:"Model status unavailable"}},Yue={common:Rue,yaml:Iue,validation:Pue,defaults:Due,helpers:Mue,intelligentDeployment:Lue,codePackage:$ue,buildCanvas:Fue,intelligent:Bue,projectLibrary:Uue,modePicker:Que,promptEditor:zue,skills:Vue,workflow:Hue,workbench:que,traditional:Wue,template:Kue,workspace:Gue,modelApiKey:Xue},_Ue=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:Fue,codePackage:$ue,common:Rue,default:Yue,defaults:Due,helpers:Mue,intelligent:Bue,intelligentDeployment:Lue,modePicker:Que,modelApiKey:Xue,projectLibrary:Uue,promptEditor:zue,skills:Vue,template:Kue,traditional:Wue,validation:Pue,workbench:que,workflow:Hue,workspace:Gue,yaml:Iue},Symbol.toStringTag,{value:"Module"})),Zue={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"},Jue={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?"},ede={configuration:"Task configuration",nextRun:"Next run",pageLabel:"Scheduled task details",region:"Region",runtime:"Runtime",status:"Task status"},tde={createTitle:"Create scheduled task",description:"Each trigger creates a separate Session for the Runtime Agent.",editTitle:"Edit scheduled task"},nde={minutesSeconds:"{{minutes}} min {{seconds}} sec",seconds:"{{count}} sec"},ide={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"},rde={all:"All"},sde={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"},ode={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."},ade={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"},lde={cron:"Cron {{cron}}{{zone}}",daily:"Daily at {{time}}{{zone}}",once:"Once · {{date}}{{zone}}",weekly:"{{weekday}} at {{time}}{{zone}}"},cde={daily:"Daily",once:"Once",weekly:"Weekly"},ude={cancelled:"Cancelled",enabled:"Enabled",failed:"Failed",notRun:"Not run yet",paused:"Paused",pending:"Preparing",queued:"Queued",retrying:"Retrying",running:"Running",skipped:"Skipped",success:"Succeeded"},dde={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."},fde={friday:"Friday",monday:"Monday",saturday:"Saturday",sunday:"Sunday",thursday:"Thursday",tuesday:"Tuesday",wednesday:"Wednesday"},jUe={actions:Zue,confirm:Jue,detail:ede,drawer:tde,duration:nde,fields:ide,filters:rde,history:sde,notices:ode,page:ade,schedule:lde,scheduleTypes:cde,status:ude,validation:dde,weekdays:fde},NUe=Object.freeze(Object.defineProperty({__proto__:null,actions:Zue,confirm:Jue,default:jUe,detail:ede,drawer:tde,duration:nde,fields:ide,filters:rde,history:sde,notices:ode,page:ade,schedule:lde,scheduleTypes:cde,status:ude,validation:dde,weekdays:fde},Symbol.toStringTag,{value:"Module"})),hde="Quick-create Agent",pde="Agent type",mde="Close",gde="Deploy",bde="Preview",yde="Configuration download started",vde="Download failed — try again",xde="Review {{count}} configuration issues",wde="Custom",Ode="Custom {{field}}",kde="Enter a custom value",Sde="This model declares no reasoning levels; the service settings apply",Ede="Add a model to this provider first",Cde="Select a provider first",Tde="Select an option",Ade="Optional",_de="Default model, Agent preset and permissions apply to new sessions. The preset must exist in the deployed Harness",jde="Enter an environment variable name only; supply its secret value at deployment",Nde="read-only allows reading; workspace-write allows workspace edits; danger-full-access allows full access without approval",Rde="allowedModels lists the models sub-agents may select. Enabling selection requires at least one provider/model pair",Ide="Add a custom model service using its endpoint, protocol and model IDs, including compatible Volcengine and BytePlus services",Pde="Covers common native settings. Other plugin parameters and preset files are not included yet",Dde="Native configuration reference",Mde="Provider {{index}}",Lde="Model {{index}}",$de="Add provider",Fde="Remove provider {{index}}",Bde="Add model",Ude="Remove model {{index}}",Qde="Add allowed model",zde="Remove allowed model {{index}}",Vde="Remove",Hde="Enter the service’s model ID",qde={provider:"Provider {{index}}",model:"Model {{index}}"},Wde={defaults:"Session defaults",deepseek:"DeepSeek model service",providers:"Custom model providers",shell:"Command execution",loop:"Tool calls",subagents:"Sub-agent model selection",search:"DeepSeek web search"},Kde={id:"Provider ID",displayName:"Display name",baseURL:"Base URL",api:"API protocol",apiKeyEnv:"API key environment variable"},Gde={id:"e.g. company-models",displayName:"Optional; defaults to the provider ID",baseURL:"https://…/v1",api:"Select a protocol",apiKeyEnv:"e.g. MODEL_API_KEY"},Xde={id:"Model ID",name:"Display name",contextWindow:"Context capacity",maxTokens:"Maximum output capacity"},Yde={positive:"Enter a number greater than zero",integer:"Enter a valid positive integer",env:"Use letters, digits and underscores; do not start with a digit",url:"Enter an HTTP or HTTPS URL without credentials",option:"Select a supported native option",required:"Complete this field",duplicate:"This ID or model pair already exists",providerId:"Start with a lowercase letter; use lowercase letters, digits, dots, underscores or hyphens; reserved IDs are unavailable",routes:"Add at least one complete provider/model pair",modelPair:"Enter a model ID for this custom provider",unknownProvider:"Add this custom provider first",unknownModel:"Enter a model ID configured for this provider",timer:"Enter a timeout greater than 0 and no more than 2147483647 ms"},Zde={"agent-default-model_provider":"Default provider","agent-default-model_model":"Default model","agent-default-model_reasoningEffort":"Default reasoning effort","agent-presets_default":"Default Agent preset",permission_defaultPreset:"Default permission preset","llm-deepseek_apiKeyEnv":"API key environment variable","llm-deepseek_baseURL":"Base URL","llm-deepseek_thinking":"Thinking mode","llm-deepseek_reasoningEffort":"Reasoning effort","llm-deepseek_maxTokens":"Output limit per request","llm-deepseek_defaultContextWindow":"Default context capacity","llm-deepseek_streamIdleTimeoutMs":"Stream idle timeout (ms)",bash_timeoutMs:"Default execution timeout (ms)",bash_maxTimeoutMs:"Maximum execution timeout (ms)",bash_maxOutputBytes:"Output limit (bytes)","agent-loop_maxParallelToolCalls":"Parallel tool-call limit","subagent-model-selection_enabled":"Enable model selection","web-search-deepseek_apiKeyEnv":"API key environment variable","web-search-deepseek_baseURL":"Search base URL","web-search-deepseek_model":"Search model","web-search-deepseek_apiVersion":"API version","web-search-deepseek_maxTokens":"Search output limit","web-search-deepseek_maxUses":"Maximum search uses"},Jde="Cancel",efe="Back to creation methods",tfe="DeepSeek Harness configuration",RUe={title:hde,agentType:pde,close:mde,continue:"Continue",deploy:gde,preview:bde,export:"Export configuration",downloaded:yde,downloadFailed:vde,validationSummary:xde,customValue:wde,customField:Ode,enterCustomValue:kde,reasoningUnavailable:Sde,modelsUnavailable:Ede,selectProviderFirst:Cde,selectOption:Tde,optional:Ade,defaultsHelp:_de,credentialHelp:jde,permissionHelp:Nde,routesHelp:Rde,providersHelp:Ide,coverage:Pde,source:Dde,provider:Mde,model:Lde,addProvider:$de,removeProvider:Fde,addModel:Bde,removeModel:Ude,addRoute:Qde,removeRoute:zde,remove:Vde,modelIdPlaceholder:Hde,route:qde,sections:Wde,providerFields:Kde,providerPlaceholders:Gde,modelFields:Xde,errors:Yde,fields:Zde,cancel:Jde,back:efe,pageTitle:tfe},IUe=Object.freeze(Object.defineProperty({__proto__:null,addModel:Bde,addProvider:$de,addRoute:Qde,agentType:pde,back:efe,cancel:Jde,close:mde,coverage:Pde,credentialHelp:jde,customField:Ode,customValue:wde,default:RUe,defaultsHelp:_de,deploy:gde,downloadFailed:vde,downloaded:yde,enterCustomValue:kde,errors:Yde,fields:Zde,model:Lde,modelFields:Xde,modelIdPlaceholder:Hde,modelsUnavailable:Ede,optional:Ade,pageTitle:tfe,permissionHelp:Nde,preview:bde,provider:Mde,providerFields:Kde,providerPlaceholders:Gde,providersHelp:Ide,reasoningUnavailable:Sde,remove:Vde,removeModel:Ude,removeProvider:Fde,removeRoute:zde,route:qde,routesHelp:Rde,sections:Wde,selectOption:Tde,selectProviderFirst:Cde,source:Dde,title:hde,validationSummary:xde},Symbol.toStringTag,{value:"Module"})),nfe="Report an issue",ife="Description",rfe="Common issues",sfe="Cancel",ofe="Done",afe="Submit feedback",lfe="Submitting…",cfe={title:"Feedback submitted. Thank you.",description:"The AgentKit team will review your report as soon as possible."},ufe={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"}},dfe={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."},PUe={title:nfe,descriptionLabel:ife,commonIssues:rfe,cancel:sfe,done:ofe,submit:afe,submitting:lfe,success:cfe,dialog:ufe,page:dfe},DUe=Object.freeze(Object.defineProperty({__proto__:null,cancel:sfe,commonIssues:rfe,default:PUe,descriptionLabel:ife,dialog:ufe,done:ofe,page:dfe,submit:afe,submitting:lfe,success:cfe,title:nfe},Symbol.toStringTag,{value:"Module"})),ffe={back:"Back",close:"Close"},hfe={title:"Optimize migrated project",closeAria:"Close optimization dialog"},pfe={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."},mfe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any (universal migration)"},gfe={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"},bfe={evaluationPending:"Evaluation pending",evaluationRunning:"Evaluating",waitingDataset:"Evaluation cases pending",waitingEnvironment:"Environment variables required",evaluationFailed:"Migrated, evaluation incomplete",evaluationBlocked:"Migrated, evaluation needs attention",evaluationCancelled:"Migrated, evaluation cancelled",resultUnavailable:"Result unavailable",environmentExpired:"Environment expired"},yfe={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."},vfe={passed:"Output verification passed",failed:"Output verification failed",degraded:"Output verification incomplete"},xfe={session:"Create migration environment",upload:"Upload project",analysis:"Analyze project"},wfe={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"},Ofe={seconds:"{{seconds}} sec",minutesSeconds:"{{minutes}} min {{seconds}} sec"},kfe={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."},Sfe={recommended:"Recommended migration method",scope:"Migration scope",excluded:"Out of scope",viewEvidence:"View analysis evidence",viewAssumptions:"View key assumptions",viewSourceEvidence:"View source evidence"},Efe={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.",liveAnalyzing:"Analyzing the project",liveMigrating:"Running the migration",liveValidating:"Verifying the migration",livePackaging:"Packaging the migration",liveDelivery:"Reviewing the delivery"},Cfe={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…"},Tfe={retiring:"Retiring soon",currentDefault:"Current default model",loadError:"Failed to load models",label:"Model",placeholder:"Select a model"},Afe={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:"Upload and analyze",inputAria:"Select a local project ZIP",retention:"The temporary migration environment is retained for 1 hour after creation. Successfully saved source versions are unaffected.",uploading:"Uploading…",sizeHint:"Project ZIP, up to {{size}}"},_fe={requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}",notReady:"Migration output is not ready yet.",back:"Back to migration results"},jfe={backToAddAgent:"Back to Add Agent",title:"Migrate existing project",newMigration:"New migration",recent:"Recent migrations",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.",backToHome:"Migration home",navigation:"Migration navigation",showMore:"Show more",showLess:"Show less",projectName:"Project name",status:"Status",createdAt:"Created",actions:"Actions",openTask:"Open migration {{name}}",continueTask:"Continue",viewTask:"View"},Nfe={stop:"Stop migration",stopping:"Stopping…",cancel:"Cancel",reload:"Reload",refreshStatus:"Refresh status"},Rfe={unavailable:"Migration is currently unavailable",defaultReason:"Dev Sandbox is currently unavailable. Contact your administrator to check the configuration."},Ife={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."},Pfe={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"},Dfe={ariaLabel:"Answer the questions the migration needs you to decide",title:"The migration needs your answer",description:"Your answer continues the current step instead of restarting it",other:"Other",otherPlaceholder:"Or type your own answer",submitting:"Submitting your answer…",submit:"Submit answer and continue"},Mfe={ariaLabel:"Confirm migration method",title:"Confirm migration method",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"},Lfe={setup:{title:"Migration effect evaluation",description:"Evaluation cases run automatically after migration.",on:"On",off:"Off",unavailable:"Migration effect evaluation is unavailable in this environment.",casesTitle:"Evaluation cases",casesDescription:"Add at least one case. Expected outcomes and criteria are optional.",configuredSummary:"{{count}} cases · {{preset}} · {{dimensions}}",incompleteSummary:"{{count}} cases need content · {{preset}} · {{dimensions}}",dimensionSummary:"{{count}} dimensions",editSettings:"Edit settings",viewSettings:"View settings",lockedTitle:"Evaluation cases",lockedDescription:"Cases cannot change after upload starts.",closeAria:"Close evaluation settings",done:"Finish setup",close:"Close"},tabs:{label:"Migration task content",migration:"Migration",evaluation:"Evaluation",waitingMigration:"Waiting for migration",waitingConfiguration:"Setup required",running:"Running",completed:"Completed",issue:"Needs attention"},bulk:{open:"Paste multiple",label:"Enter one case per line",placeholder:`Check the status of today's orders +Summarize the result in three points`,preview:"{{count}} cases will be added",confirm:"Add cases"},case:{title:"Case {{index}}",add:"Add case",moveUp:"Move case {{index}} up",moveDown:"Move case {{index}} down",copy:"Duplicate",delete:"Delete",userInput:"User input",userInputPlaceholder:"For example: Check the status of today's orders",expectedOutcome:"Expected outcome (optional)",expectedOutcomePlaceholder:"Describe what the Agent should accomplish; exact wording is not required",criteria:"Requirements (optional)",addCriterion:"Add requirement",criterionLabel:"Requirement {{index}}",criterionPlaceholder:"For example: Include the order ID and current status",removeCriterion:"Remove requirement {{index}}"},advanced:{title:"Advanced settings",standard:"Standard evaluation",standardDescription:"Uses 3 dimensions by default: semantic fidelity, output constraints, and workflow/tool fidelity.",custom:"Custom dimensions",customDescription:"Select one or more dimensions based on business risk.",lockedDescription:"The evaluation method and dimensions cannot change after upload starts."},dimension:{semantic_fidelity:"Semantic fidelity",output_contract:"Output contract",workflow_tool_fidelity:"Workflow and tool fidelity",context_memory_fidelity:"Context and memory fidelity",boundary_error_fidelity:"Boundary and error fidelity",safety_refusal_fidelity:"Safety and refusal fidelity"},dimensionDescription:{semantic_fidelity:"Checks whether intent, conclusions, and key facts remain consistent.",output_contract:"Checks required fields, structure, language, and formatting constraints.",workflow_tool_fidelity:"Checks observable workflow branches and tool-driven behavior.",context_memory_fidelity:"Checks supported multi-turn context and memory behavior.",boundary_error_fidelity:"Checks invalid input, missing information, and dependency failures.",safety_refusal_fidelity:"Checks existing authorization, refusal, and sensitive-data boundaries."},validation:{caseCount:"Keep between 1 and {{count}} cases.",dimensionRequired:"Select at least one evaluation dimension.",userInputRequired:"Enter case input.",userInputBytes:"A case cannot exceed 32 KiB.",expectedOutcomeBytes:"The expected outcome cannot exceed 16 KiB.",criteriaCount:"A case can contain at most {{count}} requirements.",criterionRequired:"Requirements cannot be empty.",criterionBytes:"One requirement cannot exceed 2 KiB.",datasetBytes:"All evaluation cases cannot exceed 10 MiB."},dataset:{invalidLockResponse:"The service did not confirm that evaluation cases were saved. Try again.",loadingSettings:"Loading evaluation settings…",loadSettingsFailed:"Evaluation settings could not be loaded.",retryLoadSettings:"Reload",missing:"No saved evaluation cases were found. Enter and save them again.",saveWarning:"Evaluation cases were not saved. Migration continues.",retrySave:"Save evaluation cases again",saving:"Saving…"},state:{disabled:"Evaluation is off",waiting_dataset:"Waiting for evaluation cases",pending:"Evaluation starts automatically after migration",preparing:"Preparing the evaluation environment…",waiting_environment:"Runtime environment variables are required",deploying:"Deploying a temporary Runtime…",executing:"Running evaluation cases…",judging:"Running evaluation analysis…",aggregating:"Aggregating evaluation results…",completed:"Evaluation completed",failed:"Evaluation incomplete",blocked:"Evaluation requires attention before it can continue",cancelled:"Evaluation cancelled"},progress:{label:"Migration and migration effect evaluation progress",migration:"Migration",evaluation:"Migration effect evaluation",notStarted:"Not started",inProgress:"In progress",completed:"Complete",waitingConfiguration:"Waiting for setup",issue:"Needs attention"},environment:{description:"Enter the environment variables required by the temporary Runtime.",security:"Used only for this evaluation.",optional:"Optional",submit:"Submit and continue evaluation",submitting:"Submitting…"},execution:{preparing:"Prepare evaluation",preparingDetail:"Validate migration output and {{count}} evaluation cases",deploying:"Start Runtime",deployingDetail:"Prepare {{runtime}}",runtimeFallback:"isolated runtime",executing:"Run cases",executingDetail:"Run {{count}} cases and capture output",judging:"Run evaluation analysis",judgingDetail:"Evaluate {{cases}} cases · {{dimensions}} dimensions",aggregating:"Generate evaluation report",aggregatingDetail:"Aggregate scores and evidence into an HTML report",waiting:"Waiting",running:"Running",failed:"Failed",complete:"Completed"},result:{title:"Execution progress",attempt:"Evaluation attempt {{attempt}}",pending:"Waiting for migration to complete",retry:"Run evaluation again",retrying:"Retrying…",failureStage:"Failed at",errorCode:"Error code",taskId:"Task ID",diagnosticAttempt:"Evaluation attempt",runtime:"Runtime",errorDetails:"Error details",diagnosticField:"{{label}}: {{value}}",diagnosticHeading:"{{label}}:",loadingReport:"Loading the evaluation report…",reportTitle:"HTML evaluation report",reportHtmlDescription:"View or download the HTML report.",viewReport:"View report",reportDrawerDescription:"Scores, differences, and evidence",closeReport:"Close",closeReportAria:"Close evaluation report",reportPreviewTitle:"Migration effect evaluation report preview",reportSummary:"Evaluation summary",reportVersion:"Dataset {{version}} · Prompt v{{prompt}}",downloadReport:"Download full report",downloadingReport:"Downloading…",overallScore:"Overall fidelity",scoreScale:"0–100; N/A when evidence is insufficient",evidenceCoverage:"Evidence coverage",coverageDetail:"{{scored}} of {{total}} dimensions evidenced",executionSuccess:"Execution success",executionDetail:"{{succeeded}} of {{total}} cases completed",naCount:"N/A count",naDescription:"Insufficient evidence; excluded from scores",gapDescription:"Migration gap summary",lowestScoringCases:"Lowest-scoring cases",executionFailures:"Execution issues",criticalEvidence:"Critical evidence",limitations:"Evaluation limitations",viewEvidence:"View results and evidence for {{count}} cases",outputTruncated:"Long output was truncated",executionState:{succeeded:"Execution completed",failed:"Execution issue"},severityLabel:"Severity: {{severity}}",severity:{none:"None",low:"Low",medium:"Medium",high:"High",critical:"Critical",unknown:"Unknown"},evidenceSource:{user_reference:"Expected outcome",user_criteria:"Provided requirements",source_contract:"Source contract",observed_output:"Observed output",runtime_observation:"Raw Runtime data",deterministic_assertion:"Deterministic assertion"},listSeparator:", "}},$fe={closeAria:"Dismiss error",loadFailed:"Could not load migration data. Try again.",refreshFailed:"Could not refresh the migration status. Try again."},Ffe={title:"Stop the current migration?",description:"Stopping ends the current analysis or migration process. Completed steps will not continue."},MUe={common:ffe,optimization:hfe,projects:pfe,framework:mfe,state:gfe,historyStatus:bfe,task:yfe,verification:vfe,transfer:xfe,validation:wfe,duration:Ofe,expiry:kfe,analysis:Sfe,activity:Efe,artifact:Cfe,model:Tfe,upload:Afe,deployment:_fe,workspace:jfe,actions:Nfe,capability:Rfe,conversation:Ife,questions:Pfe,pendingInput:Dfe,confirmation:Mfe,evaluation:Lfe,errors:$fe,stopDialog:Ffe},LUe=Object.freeze(Object.defineProperty({__proto__:null,actions:Nfe,activity:Efe,analysis:Sfe,artifact:Cfe,capability:Rfe,common:ffe,confirmation:Mfe,conversation:Ife,default:MUe,deployment:_fe,duration:Ofe,errors:$fe,evaluation:Lfe,expiry:kfe,framework:mfe,historyStatus:bfe,model:Tfe,optimization:hfe,pendingInput:Dfe,projects:pfe,questions:Pfe,state:gfe,stopDialog:Ffe,task:yfe,transfer:xfe,upload:Afe,validation:wfe,verification:vfe,workspace:jfe},Symbol.toStringTag,{value:"Module"})),Bfe={loading:"Loading…",searchLabel:"Search {{label}}",searchPlaceholder:"Search {{label}}",retry:"Retry",noMatches:"No matches",noOptions:"No options available",selection:"{{label}}: {{value}}"},Ufe={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."}},Qfe={label:"New conversation workspace",agent:"Agent",skill:"Skill customization",video:"Video creation"},zfe={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"},Vfe={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}}",wakingHint:"Waking the agent. This may take some time."},Hfe={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"},qfe={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"}},Wfe={compactSelect:Bfe,featureNotice:Ufe,workspace:Qfe,mode:zfe,agentPicker:Vfe,skill:Hfe,video:qfe},$Ue=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:Vfe,compactSelect:Bfe,default:Wfe,featureNotice:Ufe,mode:zfe,skill:Hfe,video:qfe,workspace:Qfe},Symbol.toStringTag,{value:"Module"})),Kfe="Review center",Gfe="Resource type to review",Xfe="Only administrators can access the review center",Yfe="Search name, submitter or version",Zfe="Review status",Jfe="Pending: {{count}}",ehe="Requests: {{count}}",the={skill:"Skills",agent:"Agents"},nhe={all:"All statuses",pending:"Pending",approved:"Approved",returned:"Returned",approving:"Publishing"},ihe={application:"Request",submitter:"Submitter",version:"Version",submittedAt:"Submitted at",status:"Status",actions:"Actions"},rhe={details:"Details",detailsFor:"View request for {{name}}",approve:"Approve",approveFor:"Approve request for {{name}}",return:"Return",returnFor:"Return request for {{name}}",close:"Close",backToDetails:"Back to details",confirmApprove:"Confirm approval",confirmReturn:"Confirm return",clearFilters:"Clear filters",refresh:"Refresh",cancel:"Cancel",resumeApproval:"Resume publishing"},she={title:"No review requests yet",description:"Submitted review requests will appear here",filteredTitle:"No matching requests",filteredDescription:"Try another search or change the review status"},ohe={title:"Request details",sections:"Request detail sections",overview:"Overview",files:"Submitted files · {{count}}",requestType:"Request type",update:"Version update",firstRelease:"First release",source:"Source",source_skill:"{{name}}’s personal skill space",source_agent:"{{name}}’s development environment",destination:"Publication target",destination_skill:"Shared skill space",destination_agent:"Shared agent",region:"Region",visibility:"Visibility after publication",shared:"Visible to everyone",description:"Description",changes:"Submission notes",example:"Usage example",history:"Review history",submitted:"{{name}} submitted this request",versionFixed:"Reviewing the submitted version only",instructions:"Instructions",filesTab:"Submitted files",filesFailed:"Could not load submitted files",unknownAuthor:"Unknown submitter",reviewer:"Reviewed by",reviewedAt:"Reviewed at",approved:"{{name}} approved the request",returned:"{{name}} returned the request",unknownReviewer:"Unknown reviewer",approvedBy:"Approved by",returnedBy:"Returned by",comment:"Review comment",result:"Review result",noHistory:"This skill has not been submitted for review",pendingHint:"Waiting for an administrator to review",approvingHint:"Approval is confirmed and publishing to the shared space is in progress",approving:"{{name}} confirmed approval; publishing is in progress"},ahe={failed:"The review space is unavailable",retry:"Retry"},lhe={approveTitle:"Approve request",returnTitle:"Return request",approveDescription:"Approving {{name}} {{version}} makes this version available to everyone in the enterprise shared space",returnDescription:"Return {{name}} {{version}} and explain what the applicant should change",reason:"Return reason",reasonRequired:"Enter a return reason",reasonHelp:"Up to 256 characters, visible to the applicant",saving:"Saving…",failed:"Review failed, please try again",approved:"{{name}} was approved and shared",returned:"{{name}} was returned",comment:"Comment (optional)",commentHelp:"Up to 256 characters, visible to the applicant"},che={title:"AI score",points:"{{score}} / 100",insufficient:"Insufficient evidence",status:{unscored:"Not scored",not_requested:"Not scored",queued:"Queued",running:"Scoring",completed:"Scored",failed:"Scoring failed"},loading:"Loading score…",starting:"Submitting for scoring…",loadFailed:"Could not load score",retryFailed:"Could not request scoring",failed:"Scoring failed, ask an administrator to retry",retry:"Score again",start:"Start scoring",reload:"Reload",download:"Download JSON",expand:"Expand",collapse:"Collapse",hint:"Scores apply to this submitted version and inform the administrator’s decision",dimensions:{safety:"Safety",usability:"Usability",completeness:"Completeness",reliability:"Reliability",maintainability:"Maintainability"},risks:"Risk flags",suggestions:"Suggestions",model:"Scoring model",rubric:"Rubric version",time:"Scored at",severity:{low:"Low risk",medium:"Medium risk",high:"High risk",critical:"Critical risk"},coverage:"Review coverage",coverageCount:"Reviewed {{included}} of {{total}} files",coverageIncomplete:"Some content was excluded, so scoring evidence is incomplete",omittedFile:"Not reviewed {{path}}: {{reason}}",truncatedFile:"Partially reviewed {{path}}: {{reason}}",originalError:"Original cloud error"},FUe={title:Kfe,category:Gfe,adminOnly:Xfe,search:Yfe,filterStatus:Zfe,pendingCount:Jfe,total:ehe,kind:the,status:nhe,columns:ihe,actions:rhe,empty:she,detail:ohe,space:ahe,decision:lhe,score:che},BUe=Object.freeze(Object.defineProperty({__proto__:null,actions:rhe,adminOnly:Xfe,category:Gfe,columns:ihe,decision:lhe,default:FUe,detail:ohe,empty:she,filterStatus:Zfe,kind:the,pendingCount:Jfe,score:che,search:Yfe,space:ahe,status:nhe,title:Kfe,total:ehe},Symbol.toStringTag,{value:"Module"})),uhe={cancel:"Cancel",close:"Close",retry:"Retry",tryAgain:"Try again",closeDialog:"Close {{title}}",agentFallback:"{{agent}} Agent",unknownSource:"Unknown source"},dhe={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}}"},fhe={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"},hhe={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."}}},phe={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"},mhe={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"},ghe={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",stopping:"Confirming stop…",resume:"Resume task",steer:"Add instructions",steerPlaceholder:"Add instructions, or stop the task at any time…"},bhe={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"},yhe={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"}},vhe={back:"Back to Agents",subtitle:"{{agent}} agent 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:"Delete “{{name}}” and its saved data? This cannot be undone.",deleting:"Deleting…",confirmDelete:"Delete",sleepingHint:"This agent is asleep. Waking it before opening may take some time.",wakingHint:"Waking the agent. This may take some time.",agentId:"Agent ID"},xhe={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"},whe={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"}},ghe={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"}},bhe={label:"Build tasks",queued:"Build queued",running:"Build running in the background",recovering:"Recovering build",waiting_user:"Build needs attention",stopping:"Stopping build",succeeded:"Build completed",cancelled:"Build stopped",failed:"Build could not complete",open:"Return to task",hide:"Hide task notification",reconnecting:"Reconnecting to the task service. Existing tasks are retained."},yhe={common:rhe,tool:she,threads:ohe,permissions:ahe,workspace:lhe,approval:che,composer:uhe,launch:dhe,session:fhe,agentDetails:hhe,agentWorkspace:phe,handoff:mhe,commands:ghe,taskNotice:bhe},PUe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:hhe,agentWorkspace:phe,approval:che,commands:ghe,common:rhe,composer:uhe,default:yhe,handoff:mhe,launch:dhe,permissions:ahe,session:fhe,taskNotice:bhe,threads:ohe,tool:she,workspace:lhe},Symbol.toStringTag,{value:"Module"})),vhe={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."},xhe={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"},whe={breadcrumbs:"Breadcrumbs",selectAgent:"Select Agent",switchAgent:"Switch Agent"},Ohe={cancel:"Cancel",close:"Close confirmation dialog"},DUe={login:vhe,authExpired:xhe,navbar:whe,confirm:Ohe},MUe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:xhe,confirm:Ohe,default:DUe,login:vhe,navbar:whe},Symbol.toStringTag,{value:"Module"})),khe={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",super_admin:"Super administrator"}},She={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",users:"User management",administration:"Administration",reviewCenter:"Review center"},Ehe={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"},LUe={account:khe,navigation:She,history:Ehe},$Ue=Object.freeze(Object.defineProperty({__proto__:null,account:khe,default:LUe,history:Ehe,navigation:She},Symbol.toStringTag,{value:"Module"})),Che={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."},The={unsupportedActivity:"Unsupported Skill conversation activity",ariaLabel:"Skill generation conversation"},Ahe={code:"Error code: {{code}}",type:"Error type: {{type}}",representation:"Exception representation: {{value}}",rawResponse:`Raw server response: -{{value}}`,original:"Original error: {{message}}",details:"Details"},_he={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"},jhe={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)"},Nhe={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."},Rhe={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"},Ihe={configSelect:Che,conversation:The,errorDetails:Ahe,fileTree:_he,management:jhe,generation:Nhe,api:Rhe},FUe=Object.freeze(Object.defineProperty({__proto__:null,api:Rhe,configSelect:Che,conversation:The,default:Ihe,errorDetails:Ahe,fileTree:_he,generation:Nhe,management:jhe},Symbol.toStringTag,{value:"Module"})),Phe={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"},Dhe={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"},Mhe={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"},Lhe={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"}},$he={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."}},Fhe={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},Bhe={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},Uhe={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"},Qhe={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."},zhe={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"},Vhe={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"},Hhe={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."},qhe={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"},Whe={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."}},Khe={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.",codeProjects:"Code projects"},Ghe={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},Xhe={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"}},Yhe={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"},Zhe={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"}},Jhe={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:"Asleep",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:"Asleep",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"},wakingHint:"Waking the agent. This may take some time."},epe={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"},sharedSpace:"Enterprise shared space",sharedDescription:"Skills available to everyone, published and maintained by administrators",sharedVisibility:"Everyone",sharedPreparing:"Preparing shared space",sharedLoadFailed:"Shared space unavailable",sharedEmpty:"No shared skills yet. Skills published by administrators will appear here",requestPublication:"Request publication",reviewSubmitting:"Submitting…",reviewSubmitted:"Submitted",reviewFailed:"Could not submit the publication request",reviewStatusFailed:"Failed to load review status",reviewRetry:"Apply again",reviewPending:"Pending review",reviewApproving:"Publishing",reviewApproved:"Shared",reviewReturned:"Returned",reviewHistory:"Review history",skillDetailSections:"Skill detail sections",versions:{title:"Version management",refresh:"Refresh",uploading:"Uploading…",upload:"Upload new version",close:"Close",hint:"New versions become public after approval and do not replace published versions; the skill name in the ZIP must match the original",loading:"Loading versions…",loadFailed:"Unable to load versions",filesFailed:"Unable to load version files",uploadFailed:"Unable to upload the new version",submitFailed:"Unable to submit for review",retry:"Retry",empty:"No versions yet",current:"Current version",notSubmitted:"Not submitted",submitting:"Submitting…",submit:"Request publication",processing:"Version status: {{status}}",filesLoading:"Loading files…",filesEmpty:"No files",history:"Review history",shared:"Published"},author:"Author",authorName:"Author: {{name}}"},tpe={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"}},BUe={common:Phe,agentKitPromo:Dhe,systemInfo:Mhe,agentWorkspace:Lhe,environmentCenter:$he,deploymentSelect:Fhe,deploymentError:Bhe,studioBuildProgress:Uhe,cloudEnvironment:Qhe,githubCicd:zhe,feishuDeployment:Vhe,deploymentResources:Hhe,studioUpdate:qhe,projectPreview:Whe,workspace:Khe,resourceCollection:Ghe,skillSourcePicker:Xhe,composer:Yhe,agentSelector:Zhe,myAgents:Jhe,skillCenter:epe,knowledge:tpe},UUe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:Dhe,agentSelector:Zhe,agentWorkspace:Lhe,cloudEnvironment:Qhe,common:Phe,composer:Yhe,default:BUe,deploymentError:Bhe,deploymentResources:Hhe,deploymentSelect:Fhe,environmentCenter:$he,feishuDeployment:Vhe,githubCicd:zhe,knowledge:tpe,myAgents:Jhe,projectPreview:Whe,resourceCollection:Ghe,skillCenter:epe,skillSourcePicker:Xhe,studioBuildProgress:Uhe,studioUpdate:qhe,systemInfo:Mhe,workspace:Khe},Symbol.toStringTag,{value:"Module"})),npe="User management",ipe="{{count}} members",rpe="User",spe="Role",ope="Account status",ape="Last sign-in",lpe="Actions",cpe="Change role",upe="Close",dpe="Save role",fpe="Saving…",hpe="Cancel",ppe="Back",mpe="User pool",gpe="Volcengine Identity",bpe="Search name, email or user ID",ype="Search",vpe="Filter by role",xpe="All roles",wpe="Refresh",Ope="Loading users…",kpe="Updated at {{time}}",Spe="{{name}} is now {{role}}",Epe="Retry",Cpe="You",Tpe="Initial super administrator",Ape="The initial super administrator cannot be demoted here",_pe="The new permissions apply when the user refreshes Studio",jpe="Role needs confirmation",Npe="No matching users",Rpe="Try another search or role",Ipe="Users appear here after signing in or joining this user pool",Ppe="{{count}} users",Dpe="Previous",Mpe="Next",Lpe="Not signed in yet",$pe="Not provided",Fpe={super_admin:"Super administrator",admin:"Administrator",developer:"Developer",user:"User"},Bpe={super_admin:"Manage all resources, users and role assignments",admin:"Manage Studio resources",developer:"Develop agents and manage your own resources",user:"Use agents and personal features"},Upe={EXTERNAL_PROVIDER:"Active",CONFIRMED:"Active",NORMAL:"Active",ENABLED:"Active",ACTIVE:"Active",UNCONFIRMED:"Unverified",DISABLED:"Disabled",FORBIDDEN:"Disabled",LOCKED:"Locked",SUSPENDED:"Suspended",FORCE_CHANGE_PASSWORD:"Password change required"},Qpe={request_failed:"The request did not finish. Refresh the list to confirm its current state before retrying",invalid_response:"The user service returned an invalid response. Refresh and try again",identity_unavailable:"Identity is unavailable. Try again later or check service permissions",identity_resource_missing:"The user or user pool no longer exists. Refresh the list",super_administrator_required:"Only super administrators can manage users",sign_in_required:"Sign in and try again",user_not_in_pool:"Your account does not belong to this user pool",user_disabled:"Your account is disabled",protected_administrator:"The initial super administrator cannot be demoted",cannot_demote_self:"You cannot demote your own super administrator role",role_change_conflict:"The role has changed. Close this dialog and refresh the list before retrying",cross_origin_request:"Change roles from the current Studio page"},QUe={title:npe,memberCount:ipe,user:rpe,role:spe,status:ope,lastLogin:ape,actions:lpe,changeRole:cpe,close:upe,save:dpe,saving:fpe,cancel:hpe,back:ppe,pool:mpe,volcengineIdentity:gpe,searchPlaceholder:bpe,search:ype,filterRole:vpe,allRoles:xpe,refresh:wpe,loading:Ope,updatedAt:kpe,saved:Spe,retry:Epe,you:Cpe,initialAdministrator:Tpe,protectedExplanation:Ape,effectiveAfterRefresh:_pe,roleConflict:jpe,noUsers:Npe,tryAnotherSearch:Rpe,poolEmpty:Ipe,resultCount:Ppe,previous:Dpe,next:Mpe,neverLoggedIn:Lpe,unknown:$pe,roles:Fpe,descriptions:Bpe,states:Upe,errors:Qpe},zUe=Object.freeze(Object.defineProperty({__proto__:null,actions:lpe,allRoles:xpe,back:ppe,cancel:hpe,changeRole:cpe,close:upe,default:QUe,descriptions:Bpe,effectiveAfterRefresh:_pe,errors:Qpe,filterRole:vpe,initialAdministrator:Tpe,lastLogin:ape,loading:Ope,memberCount:ipe,neverLoggedIn:Lpe,next:Mpe,noUsers:Npe,pool:mpe,poolEmpty:Ipe,previous:Dpe,protectedExplanation:Ape,refresh:wpe,resultCount:Ppe,retry:Epe,role:spe,roleConflict:jpe,roles:Fpe,save:dpe,saved:Spe,saving:fpe,search:ype,searchPlaceholder:bpe,states:Upe,status:ope,title:npe,tryAnotherSearch:Rpe,unknown:$pe,updatedAt:kpe,user:rpe,volcengineIdentity:gpe,you:Cpe},Symbol.toStringTag,{value:"Module"})),zpe="Website integration",Vpe="Embed an AgentKit Runtime on your website as a floating chat window",Hpe="Back to automations",qpe="Add website",Wpe="Loading Runtime",Kpe="Select Runtime",Gpe="Website domain",Xpe="For example, xxxx.com or localhost:5173",Ype="Generating",Zpe="Generate token",Jpe="Added websites",eme="{{count}} website",tme="{{count}} websites",nme="Loading website integrations",ime="No website integrations yet",rme="Select a Runtime and enter a website domain to generate a token",sme="Embed instructions",ome="Place this code before the closing body tag on your website",ame="Copied",lme="Copy code",cme="Embed code will appear here after you add a website.",ume="Delete the website integration for {{domain}}?",dme={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"},fme={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"},VUe={title:zpe,description:Vpe,backToAutomations:Hpe,addWebsite:qpe,loadingRuntime:Wpe,selectRuntime:Kpe,websiteDomain:Gpe,domainPlaceholder:Xpe,generating:Ype,generateToken:Zpe,addedWebsites:Jpe,websiteCount_one:eme,websiteCount_other:tme,loadingIntegrations:nme,delete:"Delete",emptyTitle:ime,emptyDescription:rme,embedMethod:sme,embedInstructions:ome,copied:ame,copyCode:lme,embedHint:cme,confirmDelete:ume,errors:dme,widget:fme},HUe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:qpe,addedWebsites:Jpe,backToAutomations:Hpe,confirmDelete:ume,copied:ame,copyCode:lme,default:VUe,description:Vpe,domainPlaceholder:Xpe,embedHint:cme,embedInstructions:ome,embedMethod:sme,emptyDescription:rme,emptyTitle:ime,errors:dme,generateToken:Zpe,generating:Ype,loadingIntegrations:nme,loadingRuntime:Wpe,selectRuntime:Kpe,title:zpe,websiteCount_one:eme,websiteCount_other:tme,websiteDomain:Gpe,widget:fme},Symbol.toStringTag,{value:"Module"})),hme={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"}},pme={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},mme={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"},gme={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"},bme={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}}"},yme={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}}"}},vme={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},xme={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)"},wme={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."},Ome={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."},kme={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"},Sme={labels:{coding:"Coding",get_city_weather:"City weather",get_location_weather:"Location weather",web_fetch:"Fetch web content",studio_write_artifact:"Save session artifact"},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"},Eme={artifactLibrary:hme,resourceMetadata:pme,artifactEdit:mme,codeBrowser:gme,search:bme,developerResources:yme,library:vme,manageAgents:xme,agentTopology:wme,sessionEnvironment:Ome,agentKitCli:kme,studioTools:Sme},qUe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:kme,agentTopology:wme,artifactEdit:mme,artifactLibrary:hme,codeBrowser:gme,default:Eme,developerResources:yme,library:vme,manageAgents:xme,resourceMetadata:pme,search:bme,sessionEnvironment:Ome,studioTools:Sme},Symbol.toStringTag,{value:"Module"})),Cme={requestFailed:"请求失败 ({{status}})",unknownError:"未知错误",contentTypeMissing:"Content-Type 缺失",response:"响应:{{response}}",fallbackWithDetail:"{{fallback}}:{{detail}}",fallbackWithHttpStatus:"{{fallback}}(HTTP {{status}})",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应({{contentType}})"},Tme={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 返回了无效的终端地址。"},Ame={cnBeijing:"华北 2(北京)",cnShanghai:"华东 2(上海)"},_me={runtimeUnsupported:"该 Runtime 暂不支持连接,请确认服务已正常运行。"},jme={autoConfigureFailed:"飞书机器人自动配置失败"},Nme={actionFailed:"{{action}}失败",detail:"详细信息:{{detail}}",request:"请求:{{request}}"},Rme={persistentMemoryHint:"提示:会话已不存在。使用 in-memory 或 SQLite 短期记忆时,多实例、进程重启或滚动发布都可能导致会话丢失;建议改用基于数据库的持久化短期记忆存储。",unsupportedRouteHint:"提示:该 Runtime 未提供会话能力运行接口,可能是 Runtime 版本与当前 Studio 不兼容。",toolArgumentHint:"提示:模型生成的工具参数格式不完整,请重新发送一次。",resourceCollectionExpiredHint:"提示:本次资源清单已失效,请重新发送任务;系统会重新收集资源后再创建 Agent。",networkConfigurationHint:"提示:请稍后重试,查看 Runtime、模型或网关日志。",modelQuotaHint:"提示:模型当前触发了 TPM/RPM 配额限制,请稍后重试或提高模型配额。",rawResponseLabel:"原始响应:"},Ime={httpStatus:"HTTP 状态码:{{status}}",errorCode:"错误码:{{code}}",cloudResponseBody:`云端响应正文: -{{body}}`,loadFailedWithDetail:"读取实例日志失败:{{detail}}",invalidFormat:"读取实例日志失败:服务返回格式无效"},Pme={untitledSession:"未命名会话",webUnavailable:"网络搜索接口未就绪(后端未启用 /web/search)。",webFailed:"网络搜索失败:{{message}}",webNotMounted:"当前 Agent 未挂载 web_search 工具。",knowledgeNotMounted:"该 Agent 未挂载知识库。",memoryNotMounted:"该 Agent 未挂载长期记忆。",knowledge:"知识库",longTermMemory:"长期记忆"},Dme={listSpacesFailed:"读取 Skill 空间失败",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",deleteSpaceFailed:"删除 Skill 空间失败",uploadFailed:"上传 Skill 失败",validateFailed:"校验 Skill 失败",deleteFailed:"删除 Skill 失败",listFilesFailed:"读取 Skill 文件失败",downloadFailed:"下载 Skill 失败",sharedSpaceFailed:"共享空间加载失败",reservedSpaceName:"此名称由系统空间保留,请使用其他名称",reviewSpaceFailed:"待审核空间暂不可用",submitReviewFailed:"申请公开失败",listReviewsFailed:"加载审核申请失败",reviewFilesFailed:"加载提交文件失败",decideReviewFailed:"审批失败,请重试",listVersionsFailed:"无法加载技能版本",uploadVersionFailed:"上传技能新版本失败"},Mme={truncatedData:"{{data}}…(已截断,共 {{count}} 个字符)",incompleteEvent:"SSE 流在事件完整返回前已结束。原始数据:{{data}}",invalidEventJson:"无法解析 SSE 事件中的 JSON。原始数据:{{data}}"},Lme={loadConfigNetworkFailed:"无法加载登录配置,请检查网络后重试。",configServiceFailed:"登录配置服务异常(HTTP {{status}}),请稍后重试。",invalidConfigResponse:"登录配置服务返回了无法解析的响应,请稍后重试。",serviceNetworkFailed:"无法连接身份服务,请检查网络后重试。",invalidServiceResponse:"身份服务返回了无法解析的响应,请稍后重试。",serviceFailed:"身份服务异常(HTTP {{status}}),请稍后重试。"},$me={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"},Fme={loadCapabilitiesFailed:"加载视频模型能力失败",uploadAssetFailed:"上传{{fileName}}失败",enhancePromptFailed:"提示词优化失败",createTaskFailed:"创建视频生成任务失败",getTaskFailed:"查询视频生成任务失败",downloadFailed:"下载生成视频失败"},Bme={listFailed:"加载网站集成失败",createFailed:"创建网站集成失败",deleteFailed:"删除网站集成失败"},Ume={loadFailed:"读取知识库失败",htmlHidden:"[HTML 内容已隐藏]",redacted:"[已脱敏]",depthTruncated:"[内容过深,已截断]",circularReference:"[循环引用]",diagnosticsUnavailable:"[诊断信息无法显示]",statusCode:"状态码:{{status}}",errorCode:"错误码:{{code}}",requestId:"请求 ID:{{requestId}}",diagnostics:"诊断:{{diagnostics}}",detail:"详情:{{detail}}",signInRequired:"请先登录后再访问知识库",forbidden:"你没有权限操作这个知识库",notFound:"知识库或知识内容不存在",conflict:"知识库当前状态不允许执行此操作",requestFailed:"知识库请求失败 ({{status}})"},Qme={invalidName:"名称须为 1~128 个字符,不能包含控制字符、不可见格式字符或 < >。",renameProjectFailed:"修改项目名称失败",renameVersionFailed:"修改版本名称失败",invalidNameUpdateResponse:"名称更新响应与请求不一致,请刷新后重试。",invalidSourceSnapshot:"源码快照的响应格式无效。",invalidProjectList:"项目列表的响应格式无效。",invalidProjectVersion:"项目版本的响应格式无效。",loadProjectsFailed:"无法读取已保存项目",loadVersionsFailed:"无法读取项目版本",deleteVersionFailed:"删除项目版本失败",invalidDeleteVersionResponse:"删除项目版本的响应格式无效。",loadProjectSourceFailed:"无法读取项目源码",loadSnapshotFailed:"无法读取源码快照",restoreSnapshotFailed:"无法恢复当前源码快照",downloadSourceFailed:"下载源码失败",downloadNotZip:"源码下载响应不是 ZIP 文件。",downloadSizeMismatch:"源码压缩包大小与发布记录不一致,请重试。"},zme={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:"下载迁移产物失败",evaluation:{datasetSaveFailed:"保存评测用例失败",datasetLoadFailed:"读取评测用例失败",statusLoadFailed:"读取评测状态失败",resumeFailed:"继续评测失败",retryFailed:"重新评测失败",reportLoadFailed:"读取评测报告失败",reportDownloadFailed:"下载评测报告失败"},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:"迁移会话列表",evaluationAsset:"评测资产",evaluation:"评测状态",evaluationCapabilities:"评测能力",evaluationDimension:"评测维度",evaluationCase:"评测用例",evaluationCriteria:"评测标准",evaluationMessage:"评测对话",evaluationDataset:"评测数据集",evaluationDimensionResult:"评测维度结果",evaluationEvidence:"评测证据",evaluationReport:"评测报告",evaluationSummary:"评测汇总",evaluationCaseResult:"评测用例结果",evaluationOutput:"评测输出",evaluationLimitations:"评测限制"}},Vme={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:"未找到要唤醒的智能体。",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}} 返回了不安全的地址。"},Hme={invalidSandboxVersion:"沙箱版本响应格式无效",loadSandboxVersionsFailed:"查询沙箱版本失败",updateSandboxFailed:"更新 Sandbox 失败",invalidSandboxUpdate:"沙箱更新响应格式无效",errorWithDetailAndRawResponse:`{{context}} +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"}},Ohe={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"}},khe={label:"Build tasks",queued:"Build queued",running:"Build running in the background",recovering:"Recovering build",waiting_user:"Build needs attention",stopping:"Stopping build",succeeded:"Build completed",cancelled:"Build stopped",failed:"Build could not complete",open:"Return to task",hide:"Hide task notification",reconnecting:"Reconnecting to the task service. Existing tasks are retained."},She={common:uhe,tool:dhe,threads:fhe,permissions:hhe,workspace:phe,approval:mhe,composer:ghe,launch:bhe,session:yhe,agentDetails:vhe,agentWorkspace:xhe,handoff:whe,commands:Ohe,taskNotice:khe},UUe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:vhe,agentWorkspace:xhe,approval:mhe,commands:Ohe,common:uhe,composer:ghe,default:She,handoff:whe,launch:bhe,permissions:hhe,session:yhe,taskNotice:khe,threads:fhe,tool:dhe,workspace:phe},Symbol.toStringTag,{value:"Module"})),Ehe={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."},Che={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"},The={breadcrumbs:"Breadcrumbs",selectAgent:"Select Agent",switchAgent:"Switch Agent"},Ahe={cancel:"Cancel",close:"Close confirmation dialog"},QUe={login:Ehe,authExpired:Che,navbar:The,confirm:Ahe},zUe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:Che,confirm:Ahe,default:QUe,login:Ehe,navbar:The},Symbol.toStringTag,{value:"Module"})),_he={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",super_admin:"Super administrator"}},jhe={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",users:"User management",administration:"Administration",reviewCenter:"Review center"},Nhe={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"},VUe={account:_he,navigation:jhe,history:Nhe},HUe=Object.freeze(Object.defineProperty({__proto__:null,account:_he,default:VUe,history:Nhe,navigation:jhe},Symbol.toStringTag,{value:"Module"})),Rhe={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."},Ihe={unsupportedActivity:"Unsupported Skill conversation activity",ariaLabel:"Skill generation conversation"},Phe={code:"Error code: {{code}}",type:"Error type: {{type}}",representation:"Exception representation: {{value}}",rawResponse:`Raw server response: +{{value}}`,original:"Original error: {{message}}",details:"Details"},Dhe={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"},Mhe={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)"},Lhe={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."},$he={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"},Fhe={configSelect:Rhe,conversation:Ihe,errorDetails:Phe,fileTree:Dhe,management:Mhe,generation:Lhe,api:$he},qUe=Object.freeze(Object.defineProperty({__proto__:null,api:$he,configSelect:Rhe,conversation:Ihe,default:Fhe,errorDetails:Phe,fileTree:Dhe,generation:Lhe,management:Mhe},Symbol.toStringTag,{value:"Module"})),Bhe={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"},Uhe={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"},Qhe={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"},zhe={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"}},Vhe={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."}},Hhe={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},qhe={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},Whe={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"},Khe={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."},Ghe={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"},Xhe={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"},Yhe={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."},Zhe={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"},Jhe={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."}},epe={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.",codeProjects:"Code projects"},tpe={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},npe={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"}},ipe={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"},rpe={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"}},spe={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:"Asleep",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:"Asleep",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"},wakingHint:"Waking the agent. This may take some time."},ope={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"},sharedSpace:"Enterprise shared space",sharedDescription:"Skills available to everyone, published and maintained by administrators",sharedVisibility:"Everyone",sharedPreparing:"Preparing shared space",sharedLoadFailed:"Shared space unavailable",sharedEmpty:"No shared skills yet. Skills published by administrators will appear here",requestPublication:"Request publication",reviewSubmitting:"Submitting…",reviewSubmitted:"Submitted",reviewFailed:"Could not submit the publication request",reviewStatusFailed:"Failed to load review status",reviewRetry:"Apply again",reviewPending:"Pending review",reviewApproving:"Publishing",reviewApproved:"Shared",reviewReturned:"Returned",reviewHistory:"Review history",skillDetailSections:"Skill detail sections",versions:{title:"Version management",refresh:"Refresh",uploading:"Uploading…",upload:"Upload new version",close:"Close",hint:"New versions become public after approval and do not replace published versions; the skill name in the ZIP must match the original",loading:"Loading versions…",loadFailed:"Unable to load versions",filesFailed:"Unable to load version files",uploadFailed:"Unable to upload the new version",submitFailed:"Unable to submit for review",retry:"Retry",empty:"No versions yet",current:"Current version",notSubmitted:"Not submitted",submitting:"Submitting…",submit:"Request publication",processing:"Version status: {{status}}",filesLoading:"Loading files…",filesEmpty:"No files",history:"Review history",shared:"Published"},author:"Author",authorName:"Author: {{name}}"},ape={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"}},WUe={common:Bhe,agentKitPromo:Uhe,systemInfo:Qhe,agentWorkspace:zhe,environmentCenter:Vhe,deploymentSelect:Hhe,deploymentError:qhe,studioBuildProgress:Whe,cloudEnvironment:Khe,githubCicd:Ghe,feishuDeployment:Xhe,deploymentResources:Yhe,studioUpdate:Zhe,projectPreview:Jhe,workspace:epe,resourceCollection:tpe,skillSourcePicker:npe,composer:ipe,agentSelector:rpe,myAgents:spe,skillCenter:ope,knowledge:ape},KUe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:Uhe,agentSelector:rpe,agentWorkspace:zhe,cloudEnvironment:Khe,common:Bhe,composer:ipe,default:WUe,deploymentError:qhe,deploymentResources:Yhe,deploymentSelect:Hhe,environmentCenter:Vhe,feishuDeployment:Xhe,githubCicd:Ghe,knowledge:ape,myAgents:spe,projectPreview:Jhe,resourceCollection:tpe,skillCenter:ope,skillSourcePicker:npe,studioBuildProgress:Whe,studioUpdate:Zhe,systemInfo:Qhe,workspace:epe},Symbol.toStringTag,{value:"Module"})),lpe="User management",cpe="{{count}} members",upe="User",dpe="Role",fpe="Account status",hpe="Last sign-in",ppe="Actions",mpe="Change role",gpe="Close",bpe="Save role",ype="Saving…",vpe="Cancel",xpe="Back",wpe="User pool",Ope="Volcengine Identity",kpe="Search name, email or user ID",Spe="Search",Epe="Filter by role",Cpe="All roles",Tpe="Refresh",Ape="Loading users…",_pe="Updated at {{time}}",jpe="{{name}} is now {{role}}",Npe="Retry",Rpe="You",Ipe="Initial super administrator",Ppe="The initial super administrator cannot be demoted here",Dpe="The new permissions apply when the user refreshes Studio",Mpe="Role needs confirmation",Lpe="No matching users",$pe="Try another search or role",Fpe="Users appear here after signing in or joining this user pool",Bpe="{{count}} users",Upe="Previous",Qpe="Next",zpe="Not signed in yet",Vpe="Not provided",Hpe={super_admin:"Super administrator",admin:"Administrator",developer:"Developer",user:"User"},qpe={super_admin:"Manage all resources, users and role assignments",admin:"Manage Studio resources",developer:"Develop agents and manage your own resources",user:"Use agents and personal features"},Wpe={EXTERNAL_PROVIDER:"Active",CONFIRMED:"Active",NORMAL:"Active",ENABLED:"Active",ACTIVE:"Active",UNCONFIRMED:"Unverified",DISABLED:"Disabled",FORBIDDEN:"Disabled",LOCKED:"Locked",SUSPENDED:"Suspended",FORCE_CHANGE_PASSWORD:"Password change required"},Kpe={request_failed:"The request did not finish. Refresh the list to confirm its current state before retrying",invalid_response:"The user service returned an invalid response. Refresh and try again",identity_unavailable:"Identity is unavailable. Try again later or check service permissions",identity_resource_missing:"The user or user pool no longer exists. Refresh the list",super_administrator_required:"Only super administrators can manage users",sign_in_required:"Sign in and try again",user_not_in_pool:"Your account does not belong to this user pool",user_disabled:"Your account is disabled",protected_administrator:"The initial super administrator cannot be demoted",cannot_demote_self:"You cannot demote your own super administrator role",role_change_conflict:"The role has changed. Close this dialog and refresh the list before retrying",cross_origin_request:"Change roles from the current Studio page"},GUe={title:lpe,memberCount:cpe,user:upe,role:dpe,status:fpe,lastLogin:hpe,actions:ppe,changeRole:mpe,close:gpe,save:bpe,saving:ype,cancel:vpe,back:xpe,pool:wpe,volcengineIdentity:Ope,searchPlaceholder:kpe,search:Spe,filterRole:Epe,allRoles:Cpe,refresh:Tpe,loading:Ape,updatedAt:_pe,saved:jpe,retry:Npe,you:Rpe,initialAdministrator:Ipe,protectedExplanation:Ppe,effectiveAfterRefresh:Dpe,roleConflict:Mpe,noUsers:Lpe,tryAnotherSearch:$pe,poolEmpty:Fpe,resultCount:Bpe,previous:Upe,next:Qpe,neverLoggedIn:zpe,unknown:Vpe,roles:Hpe,descriptions:qpe,states:Wpe,errors:Kpe},XUe=Object.freeze(Object.defineProperty({__proto__:null,actions:ppe,allRoles:Cpe,back:xpe,cancel:vpe,changeRole:mpe,close:gpe,default:GUe,descriptions:qpe,effectiveAfterRefresh:Dpe,errors:Kpe,filterRole:Epe,initialAdministrator:Ipe,lastLogin:hpe,loading:Ape,memberCount:cpe,neverLoggedIn:zpe,next:Qpe,noUsers:Lpe,pool:wpe,poolEmpty:Fpe,previous:Upe,protectedExplanation:Ppe,refresh:Tpe,resultCount:Bpe,retry:Npe,role:dpe,roleConflict:Mpe,roles:Hpe,save:bpe,saved:jpe,saving:ype,search:Spe,searchPlaceholder:kpe,states:Wpe,status:fpe,title:lpe,tryAnotherSearch:$pe,unknown:Vpe,updatedAt:_pe,user:upe,volcengineIdentity:Ope,you:Rpe},Symbol.toStringTag,{value:"Module"})),Gpe="Website integration",Xpe="Embed an AgentKit Runtime on your website as a floating chat window",Ype="Back to automations",Zpe="Add website",Jpe="Loading Runtime",eme="Select Runtime",tme="Website domain",nme="For example, xxxx.com or localhost:5173",ime="Generating",rme="Generate token",sme="Added websites",ome="{{count}} website",ame="{{count}} websites",lme="Loading website integrations",cme="No website integrations yet",ume="Select a Runtime and enter a website domain to generate a token",dme="Embed instructions",fme="Place this code before the closing body tag on your website",hme="Copied",pme="Copy code",mme="Embed code will appear here after you add a website.",gme="Delete the website integration for {{domain}}?",bme={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"},yme={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"},YUe={title:Gpe,description:Xpe,backToAutomations:Ype,addWebsite:Zpe,loadingRuntime:Jpe,selectRuntime:eme,websiteDomain:tme,domainPlaceholder:nme,generating:ime,generateToken:rme,addedWebsites:sme,websiteCount_one:ome,websiteCount_other:ame,loadingIntegrations:lme,delete:"Delete",emptyTitle:cme,emptyDescription:ume,embedMethod:dme,embedInstructions:fme,copied:hme,copyCode:pme,embedHint:mme,confirmDelete:gme,errors:bme,widget:yme},ZUe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:Zpe,addedWebsites:sme,backToAutomations:Ype,confirmDelete:gme,copied:hme,copyCode:pme,default:YUe,description:Xpe,domainPlaceholder:nme,embedHint:mme,embedInstructions:fme,embedMethod:dme,emptyDescription:ume,emptyTitle:cme,errors:bme,generateToken:rme,generating:ime,loadingIntegrations:lme,loadingRuntime:Jpe,selectRuntime:eme,title:Gpe,websiteCount_one:ome,websiteCount_other:ame,websiteDomain:tme,widget:yme},Symbol.toStringTag,{value:"Module"})),vme={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"}},xme={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},wme={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"},Ome={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"},kme={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}}"},Sme={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}}"}},Eme={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},Cme={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)"},Tme={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."},Ame={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."},_me={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"},jme={labels:{coding:"Coding",get_city_weather:"City weather",get_location_weather:"Location weather",web_fetch:"Fetch web content",studio_write_artifact:"Save session artifact"},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"},Nme={artifactLibrary:vme,resourceMetadata:xme,artifactEdit:wme,codeBrowser:Ome,search:kme,developerResources:Sme,library:Eme,manageAgents:Cme,agentTopology:Tme,sessionEnvironment:Ame,agentKitCli:_me,studioTools:jme},JUe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:_me,agentTopology:Tme,artifactEdit:wme,artifactLibrary:vme,codeBrowser:Ome,default:Nme,developerResources:Sme,library:Eme,manageAgents:Cme,resourceMetadata:xme,search:kme,sessionEnvironment:Ame,studioTools:jme},Symbol.toStringTag,{value:"Module"})),Rme={requestFailed:"请求失败 ({{status}})",unknownError:"未知错误",contentTypeMissing:"Content-Type 缺失",response:"响应:{{response}}",fallbackWithDetail:"{{fallback}}:{{detail}}",fallbackWithHttpStatus:"{{fallback}}(HTTP {{status}})",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应({{contentType}})"},Ime={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 返回了无效的终端地址。"},Pme={cnBeijing:"华北 2(北京)",cnShanghai:"华东 2(上海)"},Dme={runtimeUnsupported:"该 Runtime 暂不支持连接,请确认服务已正常运行。"},Mme={autoConfigureFailed:"飞书机器人自动配置失败"},Lme={actionFailed:"{{action}}失败",detail:"详细信息:{{detail}}",request:"请求:{{request}}"},$me={persistentMemoryHint:"提示:会话已不存在。使用 in-memory 或 SQLite 短期记忆时,多实例、进程重启或滚动发布都可能导致会话丢失;建议改用基于数据库的持久化短期记忆存储。",unsupportedRouteHint:"提示:该 Runtime 未提供会话能力运行接口,可能是 Runtime 版本与当前 Studio 不兼容。",toolArgumentHint:"提示:模型生成的工具参数格式不完整,请重新发送一次。",resourceCollectionExpiredHint:"提示:本次资源清单已失效,请重新发送任务;系统会重新收集资源后再创建 Agent。",networkConfigurationHint:"提示:请稍后重试,查看 Runtime、模型或网关日志。",modelQuotaHint:"提示:模型当前触发了 TPM/RPM 配额限制,请稍后重试或提高模型配额。",rawResponseLabel:"原始响应:"},Fme={httpStatus:"HTTP 状态码:{{status}}",errorCode:"错误码:{{code}}",cloudResponseBody:`云端响应正文: +{{body}}`,loadFailedWithDetail:"读取实例日志失败:{{detail}}",invalidFormat:"读取实例日志失败:服务返回格式无效"},Bme={untitledSession:"未命名会话",webUnavailable:"网络搜索接口未就绪(后端未启用 /web/search)。",webFailed:"网络搜索失败:{{message}}",webNotMounted:"当前 Agent 未挂载 web_search 工具。",knowledgeNotMounted:"该 Agent 未挂载知识库。",memoryNotMounted:"该 Agent 未挂载长期记忆。",knowledge:"知识库",longTermMemory:"长期记忆"},Ume={listSpacesFailed:"读取 Skill 空间失败",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",deleteSpaceFailed:"删除 Skill 空间失败",uploadFailed:"上传 Skill 失败",validateFailed:"校验 Skill 失败",deleteFailed:"删除 Skill 失败",listFilesFailed:"读取 Skill 文件失败",downloadFailed:"下载 Skill 失败",sharedSpaceFailed:"共享空间加载失败",reservedSpaceName:"此名称由系统空间保留,请使用其他名称",reviewSpaceFailed:"待审核空间暂不可用",submitReviewFailed:"申请公开失败",listReviewsFailed:"加载审核申请失败",reviewFilesFailed:"加载提交文件失败",decideReviewFailed:"审批失败,请重试",listVersionsFailed:"无法加载技能版本",uploadVersionFailed:"上传技能新版本失败"},Qme={truncatedData:"{{data}}…(已截断,共 {{count}} 个字符)",incompleteEvent:"SSE 流在事件完整返回前已结束。原始数据:{{data}}",invalidEventJson:"无法解析 SSE 事件中的 JSON。原始数据:{{data}}"},zme={loadConfigNetworkFailed:"无法加载登录配置,请检查网络后重试。",configServiceFailed:"登录配置服务异常(HTTP {{status}}),请稍后重试。",invalidConfigResponse:"登录配置服务返回了无法解析的响应,请稍后重试。",serviceNetworkFailed:"无法连接身份服务,请检查网络后重试。",invalidServiceResponse:"身份服务返回了无法解析的响应,请稍后重试。",serviceFailed:"身份服务异常(HTTP {{status}}),请稍后重试。"},Vme={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"},Hme={loadCapabilitiesFailed:"加载视频模型能力失败",uploadAssetFailed:"上传{{fileName}}失败",enhancePromptFailed:"提示词优化失败",createTaskFailed:"创建视频生成任务失败",getTaskFailed:"查询视频生成任务失败",downloadFailed:"下载生成视频失败"},qme={listFailed:"加载网站集成失败",createFailed:"创建网站集成失败",deleteFailed:"删除网站集成失败"},Wme={loadFailed:"读取知识库失败",htmlHidden:"[HTML 内容已隐藏]",redacted:"[已脱敏]",depthTruncated:"[内容过深,已截断]",circularReference:"[循环引用]",diagnosticsUnavailable:"[诊断信息无法显示]",statusCode:"状态码:{{status}}",errorCode:"错误码:{{code}}",requestId:"请求 ID:{{requestId}}",diagnostics:"诊断:{{diagnostics}}",detail:"详情:{{detail}}",signInRequired:"请先登录后再访问知识库",forbidden:"你没有权限操作这个知识库",notFound:"知识库或知识内容不存在",conflict:"知识库当前状态不允许执行此操作",requestFailed:"知识库请求失败 ({{status}})"},Kme={invalidName:"名称须为 1~128 个字符,不能包含控制字符、不可见格式字符或 < >。",renameProjectFailed:"修改项目名称失败",renameVersionFailed:"修改版本名称失败",invalidNameUpdateResponse:"名称更新响应与请求不一致,请刷新后重试。",invalidSourceSnapshot:"源码快照的响应格式无效。",invalidProjectList:"项目列表的响应格式无效。",invalidProjectVersion:"项目版本的响应格式无效。",loadProjectsFailed:"无法读取已保存项目",loadVersionsFailed:"无法读取项目版本",deleteVersionFailed:"删除项目版本失败",invalidDeleteVersionResponse:"删除项目版本的响应格式无效。",loadProjectSourceFailed:"无法读取项目源码",loadSnapshotFailed:"无法读取源码快照",restoreSnapshotFailed:"无法恢复当前源码快照",downloadSourceFailed:"下载源码失败",downloadNotZip:"源码下载响应不是 ZIP 文件。",downloadSizeMismatch:"源码压缩包大小与发布记录不一致,请重试。"},Gme={invalidFormat:"{{label}}格式错误。",validationSeparator:";",invalidAnalysisResult:"迁移分析结果格式错误。",invalidFrameworkCandidate:"框架候选格式错误。",invalidAnalysisEvidence:"分析证据格式错误。",invalidEntryCandidate:"入口候选格式错误。",invalidQuestion:"待确认问题格式错误。",invalidPendingInput:"分析问题无法读取",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:"读取迁移执行动态失败",loadEventsFailed:"订阅迁移进度流失败",invalidEventsResponse:"迁移进度流返回了非法数据帧。",reconnecting:"连接已断开,正在重新连接迁移进度流…",startFailed:"启动迁移失败",submitAnswersFailed:"提交分析补充信息失败",submitInputFailed:"提交分析回答失败",stopFailed:"终止迁移失败",deleteTaskFailed:"删除迁移会话失败",loadArtifactFailed:"读取迁移产物失败",loadArtifactFileFailed:"读取迁移产物文件失败",downloadArtifactFailed:"下载迁移产物失败",evaluation:{datasetSaveFailed:"保存评测用例失败",datasetLoadFailed:"读取评测用例失败",statusLoadFailed:"读取评测状态失败",resumeFailed:"继续评测失败",retryFailed:"重新评测失败",reportLoadFailed:"读取评测报告失败",reportDownloadFailed:"下载评测报告失败"},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:"迁移会话列表",evaluationAsset:"评测资产",evaluation:"评测状态",evaluationCapabilities:"评测能力",evaluationDimension:"评测维度",evaluationCase:"评测用例",evaluationCriteria:"评测标准",evaluationMessage:"评测对话",evaluationDataset:"评测数据集",evaluationDimensionResult:"评测维度结果",evaluationEvidence:"评测证据",evaluationReport:"评测报告",evaluationSummary:"评测汇总",evaluationCaseResult:"评测用例结果",evaluationOutput:"评测输出",evaluationLimitations:"评测限制",pendingInput:"分析提问",pendingQuestion:"分析问题项",pendingOption:"分析问题选项"}},Xme={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:"未找到要唤醒的智能体。",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}} 返回了不安全的地址。"},Yme={invalidSandboxVersion:"沙箱版本响应格式无效",loadSandboxVersionsFailed:"查询沙箱版本失败",updateSandboxFailed:"更新 Sandbox 失败",invalidSandboxUpdate:"沙箱更新响应格式无效",errorWithDetailAndRawResponse:`{{context}} {{detail}} 响应详情: {{response}}`,errorWithRawResponse:`{{context}} @@ -38,20 +38,20 @@ Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed: {{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:"60 秒内未收到首个 SSE 事件。请稍后重试,或查看 Runtime、模型、网关日志定位原因。",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",loadMcpCredentialsFailed:"读取 MCP 认证信息失败",invalidMcpCredentials:"Studio 返回的 MCP 认证信息格式无效",deleteFailed:"删除失败 ({{status}})",runtimeManageForbidden:"当前账号没有管理该 Runtime 的权限。",runtimeNotFound:"该 Runtime 不存在或已被删除。",runtimeUnavailable:"当前账号无法访问该 Runtime。",checkRuntimeUpdateFailed:"检查 Runtime 更新能力失败(HTTP {{status}}),请稍后重试。",loadRuntimeDetailFailed:"加载 Runtime 详情失败",generateProjectFailed:"生成项目失败",generateAgentConfigFailed:"生成 Agent 配置失败",createDebugRunFailed:"创建调试运行失败",createDebugSessionFailed:"创建调试会话失败",loadDebugTraceFailed:"加载调试调用链路失败",invalidDebugTrace:"加载调试调用链路失败:返回格式无效",debugRunFailed:"调试运行失败",cleanupDebugRunFailed:"清理调试运行失败",errorWithCloudResponse:`{{context}} 云接口:{{action}} 云服务原始响应: -{{response}}`,emptyCloudResponse:"(响应正文为空)"},qme={loadFailed:"读取会话模式能力失败(HTTP {{status}})",invalidResponse:"会话模式能力响应格式错误"},Wme={nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},{{contentType}}){{detail}}"},Kme={busy:"工作区正在处理较多请求,请稍后重试",notFound:"工作区不存在",duplicates:"检测到多个个人工作区会话,请联系管理员处理",timeout:"工作区恢复超时,项目仍保留,请重试",unavailable:"工作区暂时无法恢复,原项目仍保留,请重试",persistence:"当前 Sandbox 未启用持久化快照,请检查工作区配置",startup:"个人工作区启动失败,请检查 Sandbox 状态",exists:"项目名称已存在,请从项目列表打开",directory:"项目目录不存在",configuration:"请先配置工作区 Sandbox 镜像",state:"暂时无法确认工作区状态,请重试",list:"恢复工作区或读取项目列表失败,请重试",create:"项目初始化失败,请确认镜像可用后重试",open:"恢复工作区或打开项目失败,请重试",connection:"工作区暂时无法连接,请重试",invalidWorkspaceUrl:"工作区返回了无效的访问地址",operation:"项目操作失败,请重试",invalidProjectUrl:"项目访问地址无效",listFallback:"读取项目列表失败",connectionState:"暂时无法连接工作区,请重试"},Gme={reporting:"正在补齐交付信息",packaging:"正在整理产物",savingVersion:"正在保存版本",finishing:"正在完成请求",submitResult:"提交构建结果",requestFailed:"任务请求失败,请重试。",invalidResponse:"任务状态响应无效。",eventGap:"正在补齐任务输出。",reconnecting:"连接暂时中断,正在重连。已有输出已保留。",input:{pending:"等待送达",sending:"正在确认送达",delivered:"已送达",withdrawn:"已停止发送"},plan:"执行计划",diff:"文件变更",preparing:"正在准备任务",preparingEnvironment:"正在准备开发环境…",connectingEnvironment:"正在连接开发环境…",processing:"正在处理请求",thinking:"正在思考",read:"读取文件 · {{target}}",listFiles:"查看目录 · {{target}}",search:"搜索 · {{target}}",command:"执行命令 · {{target}}",editFiles:"修改文件 · {{target}}",webSearch:"搜索网页 · {{target}}",processSummary:"已处理 {{count}} 项",duration:"{{seconds}} 秒",durationUnits:{milliseconds:"{{value}} 毫秒",hours:"{{value}} 小时",minutes:"{{value}} 分",seconds:"{{value}} 秒"},failedTools:"{{count}} 项执行失败",toolFailed:"执行失败",toolCalls:"{{count}} 次工具调用",turnDuration:"本轮耗时 {{duration}}",toolDuration:"工具累计耗时 {{duration}}",toolDurationPartial:"已记录工具耗时 {{duration}}",toolDurationHelp:"各工具执行耗时之和;并行调用可能使累计耗时超过本轮耗时。",turnStatus:{completed:"已完成",failed:"未完成",interrupted:"已中断",cancelled:"已中断",unavailable:"任务已结束"},notReported:"未上报",partial:"已记录",partialHelp:"本轮记录可能不完整。",tokenDetails:"本轮 Token 用量",model:"本轮模型",totalTokens:"总量",inputTokens:"输入",cachedInputTokens:"缓存命中输入",uncachedInputTokens:"未命中输入",cacheWriteInputTokens:"缓存写入",outputTokens:"输出",reasoningOutputTokens:"推理输出",cacheHitRate:"输入缓存命中率",tokenHelp:"缓存命中属于输入,推理输出属于输出,不重复计入总量。未命中输入 = 输入 − 缓存命中。"},P9={common:Cme,agentkitCli:Tme,cloudRegion:Ame,connections:_me,feishuBot:jme,requestError:Nme,runSse:Rme,runtimeLogs:Ime,search:Pme,skills:Dme,sse:Mme,identity:Lme,github:$me,video:Fme,websiteIntegration:Bme,knowledge:Ume,intelligentDevelopment:Qme,migrations:zme,sandbox:Vme,client:Hme,newChatCapabilities:qme,jsonResponse:Wme,workspaceProjects:Kme,developmentRuns:Gme},WUe=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:Tme,client:Hme,cloudRegion:Ame,common:Cme,connections:_me,default:P9,developmentRuns:Gme,feishuBot:jme,github:$me,identity:Lme,intelligentDevelopment:Qme,jsonResponse:Wme,knowledge:Ume,migrations:zme,newChatCapabilities:qme,requestError:Nme,runSse:Rme,runtimeLogs:Ime,sandbox:Vme,search:Pme,skills:Dme,sse:Mme,video:Fme,websiteIntegration:Bme,workspaceProjects:Kme},Symbol.toStringTag,{value:"Module"})),Xme="智能体审核",Yme="申请企业内全员使用,审批后生效",Zme="关闭",Jme="刷新",ege="状态",tge="申请人",nge="申请时间",ige="当前版本",rge="模型",sge="退回人",oge="通过人",age="审批时间",lge="智能体描述",cge="申请说明",uge="退回理由",dge="审批意见",fge="退回理由(必填)",hge="提交后内容已变化,请退回并重新申请",pge="撤回后可以修改 Agent,需要公开时重新申请",mge="取消公开后其他用户将无法继续使用,确定取消公开吗?",gge="取消",bge="确认",yge="正在保存",vge="取消公开",xge="撤回申请",wge="通过",Oge="直接公开",kge="申请公开",Sge="全员可见",Ege={pending:"待审核",approved:"已通过",returned:"已退回",withdrawn:"已撤回"},Cge="搜索智能体或申请人",Tge="地域",Age="全部状态",_ge="智能体",jge="操作",Nge="查看并审批",Rge="申请详情",Ige="没有符合条件的申请",Pge="暂无智能体审核申请",Dge="{{count}} / {{limit}} 字",KUe={title:Xme,dialogDescription:Yme,close:Zme,refresh:Jme,statusTitle:ege,submitter:tge,submittedAt:nge,version:ige,model:rge,returnedBy:sge,approvedBy:oge,reviewedAt:age,description:lge,message:cge,reason:uge,comment:dge,reasonRequired:fge,contentChanged:hge,withdrawConfirm:pge,unpublishConfirm:mge,cancel:gge,confirm:bge,saving:yge,unpublish:vge,withdraw:xge,return:"退回",approve:wge,publish:Oge,submit:kge,private:"仅自己可见",enterprise:Sge,status:Ege,search:Cge,region:Tge,all:Age,agent:_ge,actions:jge,review:Nge,details:Rge,noMatches:Ige,empty:Pge,textCount:Dge},GUe=Object.freeze(Object.defineProperty({__proto__:null,actions:jge,agent:_ge,all:Age,approve:wge,approvedBy:oge,cancel:gge,close:Zme,comment:dge,confirm:bge,contentChanged:hge,default:KUe,description:lge,details:Rge,dialogDescription:Yme,empty:Pge,enterprise:Sge,message:cge,model:rge,noMatches:Ige,publish:Oge,reason:uge,reasonRequired:fge,refresh:Jme,region:Tge,returnedBy:sge,review:Nge,reviewedAt:age,saving:yge,search:Cge,status:Ege,statusTitle:ege,submit:kge,submittedAt:nge,submitter:tge,textCount:Dge,title:Xme,unpublish:vge,unpublishConfirm:mge,version:ige,withdraw:xge,withdrawConfirm:pge},Symbol.toStringTag,{value:"Module"})),Mge={backToEvaluationCase:"返回评测案例",cancel:"取消",copied:"已复制",copy:"复制",exportConversation:"导出会话",retry:"重试"},Lge={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。"}},$ge={subject:{file:"文件修改",command:"命令执行"},decision:{accept:"已允许本次{{subject}}",acceptForSession:"已在本会话中允许{{subject}}",decline:"已拒绝{{subject}}",cancel:"已取消{{subject}}审批"},details:{command:"命令",grantRoot:"授权路径",cwd:"执行目录"}},Fge={noDescription:"暂无描述",region:"地域",unknownAgent:"未知 Agent"},Bge={agentTransfer:"智能体移交",annotationHint:"模型回复;选中文字后可添加批注",continueBranch:"继续“{{branch}}”这个方向",emptyResponse:"本次没有返回可显示的内容。",subagentDescription:"正在执行主 Agent 移交的任务。"},Uge={title:"需要配置 {{provider}} AK/SK",prefix:"智能体工作台需要 {{provider}} 凭据才能使用。请在运行环境中设置",and:"与",suffix:"后重试。"},Qge={buildRunning:{title:"当前构建仍在进行",description:"离开将停止本轮构建;当前会话仍会保留,可稍后从历史会话重新进入。",confirm:"停止并离开"},deleteThread:{title:"删除 Codex 历史会话",description:"将删除“{{name}}”,并从历史会话中移除。",confirm:"确认删除"},returnToCreate:{title:"返回创建首页?",description:"返回后当前填写的内容将会丢失,确定要返回吗?",confirm:"确定返回"}},zge={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:"参考素材生视频需要至少添加一项参考图片或参考视频。"},Vge={like:"赞",removeLike:"取消点赞",dislike:"踩",removeDislike:"取消点踩",reportIssue:"问题反馈",traceFlameGraph:"Tracing 火焰图"},Hge={0:"今天想做点什么?",1:"有什么可以帮你的?",2:"需要我帮你查点什么吗?",3:"有问题尽管问我",4:"嗨,我们开始吧",5:"开始一段新对话吧",6:"今天想先解决哪件事?",7:"把你的想法告诉我吧",8:"我们从哪里开始?",9:"有什么任务交给我?",10:"准备好一起推进了吗?",11:"说说你现在最关心的问题",12:"今天也一起把事情做好",13:"我在,随时可以开始",intelligentDevelopment:"让灵感自由生长"},qge={agentCapabilities:"正在检查 Agent 能力…",session:"加载会话…"},Wge={cancelled:"授权已取消。",pasteCallbackUrl:"授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:",popupBlocked:"弹窗被拦截,请允许弹窗后重试。",unsupportedUrl:"授权链接不是 http/https 地址,已阻止打开。"},Kge={volcengine:"火山引擎"},Gge={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:"已更新工作空间"},Xge={addAgent:"添加智能体",addFromPackage:"从代码包添加",agent:"智能体",automations:"自动化",createAgent:"创建智能体",createSkill:"创建技能",cronJobs:"定时任务",issueFeedback:"问题反馈",library:"资源库",migrateAgent:"迁移智能体",newConversation:"新会话",optimizeSkill:"优化 {{name}}",search:"搜索",skill:"技能",skillLibrary:"技能库",systemInfo:"系统信息",updateAgent:"更新 {{name}}",codeProjects:"代码项目",reviewCenter:"审核中心"},Yge={title:"从工作区新建",description:"创建和管理代码项目,在 VS Code 中编写和调试"},Zge={actions:Mge,addAgent:Lge,approval:$ge,common:Fge,conversation:Bge,credentials:Uge,dialogs:Qge,errors:zge,feedback:Vge,greetings:Hge,loading:qge,oauth:Wge,providers:Kge,sandbox:Gge,titles:Xge,workspaceProjectEntry:Yge},XUe=Object.freeze(Object.defineProperty({__proto__:null,actions:Mge,addAgent:Lge,approval:$ge,common:Fge,conversation:Bge,credentials:Uge,default:Zge,dialogs:Qge,errors:zge,feedback:Vge,greetings:Hge,loading:qge,oauth:Wge,providers:Kge,sandbox:Gge,titles:Xge,workspaceProjectEntry:Yge},Symbol.toStringTag,{value:"Module"})),Jge="自动化",ebe="连接研发工具,为智能体扩展自动化工作流",tbe="搜索自动化",nbe="自动化分类",ibe={development:"研发",channels:"消息渠道"},rbe="{{category}}自动化列表",sbe="打开{{name}}",obe="仅本地部署可用",abe="没有匹配的自动化",lbe="请尝试搜索其他名称",cbe="返回自动化列表",ube={"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:"GitHub PR 自动评审",description:"通过 GitHub App 在隔离 Sandbox 中评审 Pull Request。",title:"GitHub 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 地址"}}},"gitlab-review":{name:"GitLab MR 自动评审",description:"通过 GitLab 集成在隔离 Sandbox 中评审 Merge Request。"},feishu:{name:"飞书机器人",badge:"Beta",description:"创建飞书机器人,并将消息直接接入 AgentKit Runtime。"},"website-integration":{name:"网站集成",description:"将 AgentKit Runtime 以悬浮聊天窗口嵌入网站。"}},dbe={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 个字符"}}},fbe={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:"没有可预览的文件。"}},hbe={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:"你是一个通过飞书为用户提供帮助的智能助手。准确理解用户问题,给出简洁、可靠的回答;信息不足时先提问澄清,不要臆造事实。"}},pbe={title:Jge,description:ebe,search:tbe,categoriesLabel:nbe,categories:ibe,resultsLabel:rbe,open:sbe,localOnly:obe,emptyTitle:abe,emptyDescription:lbe,backToAutomations:cbe,cards:ube,github:dbe,codingAgents:fbe,feishu:hbe},YUe=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:cbe,cards:ube,categories:ibe,categoriesLabel:nbe,codingAgents:fbe,default:pbe,description:ebe,emptyDescription:lbe,emptyTitle:abe,feishu:hbe,github:dbe,localOnly:obe,open:sbe,resultsLabel:rbe,search:tbe,title:Jge},Symbol.toStringTag,{value:"Module"})),mbe={"zh-CN":"简体中文","en-US":"English"},ZUe={languageNames:mbe},JUe=Object.freeze(Object.defineProperty({__proto__:null,default:ZUe,languageNames:mbe},Symbol.toStringTag,{value:"Module"})),gbe={selectedExcerptLabel:"选中片段",commentLabel:"批注",commentSeparator:":",successTitle:"已加入 Bad case 评测集",successDescription:"这条批注已关联当前问题和完整模型回复。",done:"完成",ariaLabel:"批注选中的模型回复",title:"添加批注",content:"批注内容",placeholder:"说明问题或期望的修改方式",retryError:"{{error}},请重试。",cancel:"取消",submit:"加入 Bad Case"},bbe={attachment:"附件",image:"图片",preview:"预览 {{name}}",uploading:"上传中",uploadFailed:"上传失败",remove:"移除 {{name}}",previewDialog:"{{name}}预览",download:"下载",close:"关闭",reading:"正在读取文档…",loadFailed:"文档加载失败:{{error}}"},ybe={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}} 行"},vbe={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:"选择左侧的一个调用查看详情"},xbe={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}}"},wbe={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",deployAgent:"部署 Agent",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 执行遇到错误"}},Obe={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 未提供模型信息"},kbe={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:"连接并添加"},Sbe={placeholder:"输入消息…",inputAria:"输入消息",generating:"正在生成",send:"发送"},Ebe={ariaLabel:"本轮调用上下文",removeSkill:"移除技能 {{name}}",removeAgent:"移除 Agent {{name}}"},Cbe={cardAria:"{{label}} 图表",viewAria:"{{label}} 显示方式",preview:"预览",code:"代码",invalidEcharts:"ECharts 配置不是有效且安全的数据对象,请切换到代码检查内容。",renderFailed:"图表暂时无法渲染,请切换到代码检查内容。",echartsAria:"ECharts 图表预览",rendering:"正在渲染图表…",mermaidFailed:"图表暂时无法渲染,请切换到代码查看 Mermaid 内容。",mermaidAria:"Mermaid 图表预览"},Tbe={playVideo:"点击播放视频:{{name}}",enlargeImage:"放大预览:{{name}}",image:"图片",enlargeVideo:"点击放大视频",videoPreview:"视频预览",downloadVideo:"下载视频",close:"关闭"},Abe={annotation:gbe,media:bbe,runtimeLogs:ybe,trace:vbe,share:xbe,blocks:wbe,tokenUsage:Obe,addAgentKit:kbe,composer:Sbe,invocation:Ebe,visualization:Cbe,markdown:Tbe},eQe=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:kbe,annotation:gbe,blocks:wbe,composer:Sbe,default:Abe,invocation:Ebe,markdown:Tbe,media:bbe,runtimeLogs:ybe,share:xbe,tokenUsage:Obe,trace:vbe,visualization:Cbe},Symbol.toStringTag,{value:"Module"})),_be={back:"返回",cancel:"取消",deploy:"部署",delete:"删除",loading:"读取中…",next:"下一步",notSupported:"暂不支持",previous:"上一步",required:"必填",retry:"重试",actions:"操作",value:"值",disabled:"关闭",enabled:"已开启",none:"无",close:"关闭",name:"名称",description:"描述",send:"发送"},jbe={heading:"VeADK Agent 结构配置",importHint:"可在「创建 Agent」页通过「导入 YAML」重新载入。"},Nbe={agentName:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},runtimeName:{required:"Runtime 名称为必填项",characters:"Runtime 名称只能包含英文字母、数字、下划线和连字符",length:"Runtime 名称长度须为 4-64 个字符"}},Rbe={description:"一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",instruction:`你是一个专业、可靠的智能助手。 +{{response}}`,emptyCloudResponse:"(响应正文为空)"},Zme={loadFailed:"读取会话模式能力失败(HTTP {{status}})",invalidResponse:"会话模式能力响应格式错误"},Jme={nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},{{contentType}}){{detail}}"},ege={busy:"工作区正在处理较多请求,请稍后重试",notFound:"工作区不存在",duplicates:"检测到多个个人工作区会话,请联系管理员处理",timeout:"工作区恢复超时,项目仍保留,请重试",unavailable:"工作区暂时无法恢复,原项目仍保留,请重试",persistence:"当前 Sandbox 未启用持久化快照,请检查工作区配置",startup:"个人工作区启动失败,请检查 Sandbox 状态",exists:"项目名称已存在,请从项目列表打开",directory:"项目目录不存在",configuration:"请先配置工作区 Sandbox 镜像",state:"暂时无法确认工作区状态,请重试",list:"恢复工作区或读取项目列表失败,请重试",create:"项目初始化失败,请确认镜像可用后重试",open:"恢复工作区或打开项目失败,请重试",connection:"工作区暂时无法连接,请重试",invalidWorkspaceUrl:"工作区返回了无效的访问地址",operation:"项目操作失败,请重试",invalidProjectUrl:"项目访问地址无效",listFallback:"读取项目列表失败",connectionState:"暂时无法连接工作区,请重试"},tge={reporting:"正在补齐交付信息",packaging:"正在整理产物",savingVersion:"正在保存版本",finishing:"正在完成请求",submitResult:"提交构建结果",requestFailed:"任务请求失败,请重试。",invalidResponse:"任务状态响应无效。",eventGap:"正在补齐任务输出。",reconnecting:"连接暂时中断,正在重连。已有输出已保留。",input:{pending:"等待送达",sending:"正在确认送达",delivered:"已送达",withdrawn:"已停止发送"},plan:"执行计划",diff:"文件变更",preparing:"正在准备任务",preparingEnvironment:"正在准备开发环境…",connectingEnvironment:"正在连接开发环境…",processing:"正在处理请求",thinking:"正在思考",read:"读取文件 · {{target}}",listFiles:"查看目录 · {{target}}",search:"搜索 · {{target}}",command:"执行命令 · {{target}}",editFiles:"修改文件 · {{target}}",webSearch:"搜索网页 · {{target}}",processSummary:"已处理 {{count}} 项",duration:"{{seconds}} 秒",durationUnits:{milliseconds:"{{value}} 毫秒",hours:"{{value}} 小时",minutes:"{{value}} 分",seconds:"{{value}} 秒"},failedTools:"{{count}} 项执行失败",toolFailed:"执行失败",toolCalls:"{{count}} 次工具调用",turnDuration:"本轮耗时 {{duration}}",toolDuration:"工具累计耗时 {{duration}}",toolDurationPartial:"已记录工具耗时 {{duration}}",toolDurationHelp:"各工具执行耗时之和;并行调用可能使累计耗时超过本轮耗时。",turnStatus:{completed:"已完成",failed:"未完成",interrupted:"已中断",cancelled:"已中断",unavailable:"任务已结束"},notReported:"未上报",partial:"已记录",partialHelp:"本轮记录可能不完整。",tokenDetails:"本轮 Token 用量",model:"本轮模型",totalTokens:"总量",inputTokens:"输入",cachedInputTokens:"缓存命中输入",uncachedInputTokens:"未命中输入",cacheWriteInputTokens:"缓存写入",outputTokens:"输出",reasoningOutputTokens:"推理输出",cacheHitRate:"输入缓存命中率",tokenHelp:"缓存命中属于输入,推理输出属于输出,不重复计入总量。未命中输入 = 输入 − 缓存命中。"},P9={common:Rme,agentkitCli:Ime,cloudRegion:Pme,connections:Dme,feishuBot:Mme,requestError:Lme,runSse:$me,runtimeLogs:Fme,search:Bme,skills:Ume,sse:Qme,identity:zme,github:Vme,video:Hme,websiteIntegration:qme,knowledge:Wme,intelligentDevelopment:Kme,migrations:Gme,sandbox:Xme,client:Yme,newChatCapabilities:Zme,jsonResponse:Jme,workspaceProjects:ege,developmentRuns:tge},eQe=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:Ime,client:Yme,cloudRegion:Pme,common:Rme,connections:Dme,default:P9,developmentRuns:tge,feishuBot:Mme,github:Vme,identity:zme,intelligentDevelopment:Kme,jsonResponse:Jme,knowledge:Wme,migrations:Gme,newChatCapabilities:Zme,requestError:Lme,runSse:$me,runtimeLogs:Fme,sandbox:Xme,search:Bme,skills:Ume,sse:Qme,video:Hme,websiteIntegration:qme,workspaceProjects:ege},Symbol.toStringTag,{value:"Module"})),nge="智能体审核",ige="申请企业内全员使用,审批后生效",rge="关闭",sge="刷新",oge="状态",age="申请人",lge="申请时间",cge="当前版本",uge="模型",dge="退回人",fge="通过人",hge="审批时间",pge="智能体描述",mge="申请说明",gge="退回理由",bge="审批意见",yge="退回理由(必填)",vge="提交后内容已变化,请退回并重新申请",xge="撤回后可以修改 Agent,需要公开时重新申请",wge="取消公开后其他用户将无法继续使用,确定取消公开吗?",Oge="取消",kge="确认",Sge="正在保存",Ege="取消公开",Cge="撤回申请",Tge="通过",Age="直接公开",_ge="申请公开",jge="全员可见",Nge={pending:"待审核",approved:"已通过",returned:"已退回",withdrawn:"已撤回"},Rge="搜索智能体或申请人",Ige="地域",Pge="全部状态",Dge="智能体",Mge="操作",Lge="查看并审批",$ge="申请详情",Fge="没有符合条件的申请",Bge="暂无智能体审核申请",Uge="{{count}} / {{limit}} 字",tQe={title:nge,dialogDescription:ige,close:rge,refresh:sge,statusTitle:oge,submitter:age,submittedAt:lge,version:cge,model:uge,returnedBy:dge,approvedBy:fge,reviewedAt:hge,description:pge,message:mge,reason:gge,comment:bge,reasonRequired:yge,contentChanged:vge,withdrawConfirm:xge,unpublishConfirm:wge,cancel:Oge,confirm:kge,saving:Sge,unpublish:Ege,withdraw:Cge,return:"退回",approve:Tge,publish:Age,submit:_ge,private:"仅自己可见",enterprise:jge,status:Nge,search:Rge,region:Ige,all:Pge,agent:Dge,actions:Mge,review:Lge,details:$ge,noMatches:Fge,empty:Bge,textCount:Uge},nQe=Object.freeze(Object.defineProperty({__proto__:null,actions:Mge,agent:Dge,all:Pge,approve:Tge,approvedBy:fge,cancel:Oge,close:rge,comment:bge,confirm:kge,contentChanged:vge,default:tQe,description:pge,details:$ge,dialogDescription:ige,empty:Bge,enterprise:jge,message:mge,model:uge,noMatches:Fge,publish:Age,reason:gge,reasonRequired:yge,refresh:sge,region:Ige,returnedBy:dge,review:Lge,reviewedAt:hge,saving:Sge,search:Rge,status:Nge,statusTitle:oge,submit:_ge,submittedAt:lge,submitter:age,textCount:Uge,title:nge,unpublish:Ege,unpublishConfirm:wge,version:cge,withdraw:Cge,withdrawConfirm:xge},Symbol.toStringTag,{value:"Module"})),Qge={backToEvaluationCase:"返回评测案例",cancel:"取消",copied:"已复制",copy:"复制",exportConversation:"导出会话",retry:"重试"},zge={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。"}},Vge={subject:{file:"文件修改",command:"命令执行"},decision:{accept:"已允许本次{{subject}}",acceptForSession:"已在本会话中允许{{subject}}",decline:"已拒绝{{subject}}",cancel:"已取消{{subject}}审批"},details:{command:"命令",grantRoot:"授权路径",cwd:"执行目录"}},Hge={noDescription:"暂无描述",region:"地域",unknownAgent:"未知 Agent"},qge={agentTransfer:"智能体移交",annotationHint:"模型回复;选中文字后可添加批注",continueBranch:"继续“{{branch}}”这个方向",emptyResponse:"本次没有返回可显示的内容。",subagentDescription:"正在执行主 Agent 移交的任务。"},Wge={title:"需要配置 {{provider}} AK/SK",prefix:"智能体工作台需要 {{provider}} 凭据才能使用。请在运行环境中设置",and:"与",suffix:"后重试。"},Kge={buildRunning:{title:"当前构建仍在进行",description:"离开将停止本轮构建;当前会话仍会保留,可稍后从历史会话重新进入。",confirm:"停止并离开"},deleteThread:{title:"删除 Codex 历史会话",description:"将删除“{{name}}”,并从历史会话中移除。",confirm:"确认删除"},returnToCreate:{title:"返回创建首页?",description:"返回后当前填写的内容将会丢失,确定要返回吗?",confirm:"确定返回"}},Gge={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:"参考素材生视频需要至少添加一项参考图片或参考视频。"},Xge={like:"赞",removeLike:"取消点赞",dislike:"踩",removeDislike:"取消点踩",reportIssue:"问题反馈",traceFlameGraph:"Tracing 火焰图"},Yge={0:"今天想做点什么?",1:"有什么可以帮你的?",2:"需要我帮你查点什么吗?",3:"有问题尽管问我",4:"嗨,我们开始吧",5:"开始一段新对话吧",6:"今天想先解决哪件事?",7:"把你的想法告诉我吧",8:"我们从哪里开始?",9:"有什么任务交给我?",10:"准备好一起推进了吗?",11:"说说你现在最关心的问题",12:"今天也一起把事情做好",13:"我在,随时可以开始",intelligentDevelopment:"让灵感自由生长"},Zge={agentCapabilities:"正在检查 Agent 能力…",session:"加载会话…"},Jge={cancelled:"授权已取消。",pasteCallbackUrl:"授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:",popupBlocked:"弹窗被拦截,请允许弹窗后重试。",unsupportedUrl:"授权链接不是 http/https 地址,已阻止打开。"},ebe={volcengine:"火山引擎"},tbe={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:"已更新工作空间"},nbe={addAgent:"添加智能体",addFromPackage:"从代码包添加",agent:"智能体",automations:"自动化",createAgent:"创建智能体",createSkill:"创建技能",cronJobs:"定时任务",issueFeedback:"问题反馈",library:"资源库",migrateAgent:"迁移智能体",newConversation:"新会话",optimizeSkill:"优化 {{name}}",search:"搜索",skill:"技能",skillLibrary:"技能库",systemInfo:"系统信息",updateAgent:"更新 {{name}}",codeProjects:"代码项目",reviewCenter:"审核中心"},ibe={title:"从工作区新建",description:"创建和管理代码项目,在 VS Code 中编写和调试"},rbe={actions:Qge,addAgent:zge,approval:Vge,common:Hge,conversation:qge,credentials:Wge,dialogs:Kge,errors:Gge,feedback:Xge,greetings:Yge,loading:Zge,oauth:Jge,providers:ebe,sandbox:tbe,titles:nbe,workspaceProjectEntry:ibe},iQe=Object.freeze(Object.defineProperty({__proto__:null,actions:Qge,addAgent:zge,approval:Vge,common:Hge,conversation:qge,credentials:Wge,default:rbe,dialogs:Kge,errors:Gge,feedback:Xge,greetings:Yge,loading:Zge,oauth:Jge,providers:ebe,sandbox:tbe,titles:nbe,workspaceProjectEntry:ibe},Symbol.toStringTag,{value:"Module"})),sbe="自动化",obe="连接研发工具,为智能体扩展自动化工作流",abe="搜索自动化",lbe="自动化分类",cbe={development:"研发",channels:"消息渠道"},ube="{{category}}自动化列表",dbe="打开{{name}}",fbe="仅本地部署可用",hbe="没有匹配的自动化",pbe="请尝试搜索其他名称",mbe="返回自动化列表",gbe={"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:"GitHub PR 自动评审",description:"通过 GitHub App 在隔离 Sandbox 中评审 Pull Request。",title:"GitHub 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 地址"}}},"gitlab-review":{name:"GitLab MR 自动评审",description:"通过 GitLab 集成在隔离 Sandbox 中评审 Merge Request。"},feishu:{name:"飞书机器人",badge:"Beta",description:"创建飞书机器人,并将消息直接接入 AgentKit Runtime。"},"website-integration":{name:"网站集成",description:"将 AgentKit Runtime 以悬浮聊天窗口嵌入网站。"}},bbe={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 个字符"}}},ybe={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:"没有可预览的文件。"}},vbe={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:"你是一个通过飞书为用户提供帮助的智能助手。准确理解用户问题,给出简洁、可靠的回答;信息不足时先提问澄清,不要臆造事实。"}},xbe={title:sbe,description:obe,search:abe,categoriesLabel:lbe,categories:cbe,resultsLabel:ube,open:dbe,localOnly:fbe,emptyTitle:hbe,emptyDescription:pbe,backToAutomations:mbe,cards:gbe,github:bbe,codingAgents:ybe,feishu:vbe},rQe=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:mbe,cards:gbe,categories:cbe,categoriesLabel:lbe,codingAgents:ybe,default:xbe,description:obe,emptyDescription:pbe,emptyTitle:hbe,feishu:vbe,github:bbe,localOnly:fbe,open:dbe,resultsLabel:ube,search:abe,title:sbe},Symbol.toStringTag,{value:"Module"})),wbe={"zh-CN":"简体中文","en-US":"English"},sQe={languageNames:wbe},oQe=Object.freeze(Object.defineProperty({__proto__:null,default:sQe,languageNames:wbe},Symbol.toStringTag,{value:"Module"})),Obe={selectedExcerptLabel:"选中片段",commentLabel:"批注",commentSeparator:":",successTitle:"已加入 Bad case 评测集",successDescription:"这条批注已关联当前问题和完整模型回复。",done:"完成",ariaLabel:"批注选中的模型回复",title:"添加批注",content:"批注内容",placeholder:"说明问题或期望的修改方式",retryError:"{{error}},请重试。",cancel:"取消",submit:"加入 Bad Case"},kbe={attachment:"附件",image:"图片",preview:"预览 {{name}}",uploading:"上传中",uploadFailed:"上传失败",remove:"移除 {{name}}",previewDialog:"{{name}}预览",download:"下载",close:"关闭",reading:"正在读取文档…",loadFailed:"文档加载失败:{{error}}"},Sbe={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}} 行"},Ebe={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:"选择左侧的一个调用查看详情"},Cbe={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}}"},Tbe={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",deployAgent:"部署 Agent",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 执行遇到错误"}},Abe={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 未提供模型信息"},_be={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:"连接并添加"},jbe={placeholder:"输入消息…",inputAria:"输入消息",generating:"正在生成",send:"发送"},Nbe={ariaLabel:"本轮调用上下文",removeSkill:"移除技能 {{name}}",removeAgent:"移除 Agent {{name}}"},Rbe={cardAria:"{{label}} 图表",viewAria:"{{label}} 显示方式",preview:"预览",code:"代码",invalidEcharts:"ECharts 配置不是有效且安全的数据对象,请切换到代码检查内容。",renderFailed:"图表暂时无法渲染,请切换到代码检查内容。",echartsAria:"ECharts 图表预览",rendering:"正在渲染图表…",mermaidFailed:"图表暂时无法渲染,请切换到代码查看 Mermaid 内容。",mermaidAria:"Mermaid 图表预览"},Ibe={playVideo:"点击播放视频:{{name}}",enlargeImage:"放大预览:{{name}}",image:"图片",enlargeVideo:"点击放大视频",videoPreview:"视频预览",downloadVideo:"下载视频",close:"关闭"},Pbe={annotation:Obe,media:kbe,runtimeLogs:Sbe,trace:Ebe,share:Cbe,blocks:Tbe,tokenUsage:Abe,addAgentKit:_be,composer:jbe,invocation:Nbe,visualization:Rbe,markdown:Ibe},aQe=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:_be,annotation:Obe,blocks:Tbe,composer:jbe,default:Pbe,invocation:Nbe,markdown:Ibe,media:kbe,runtimeLogs:Sbe,share:Cbe,tokenUsage:Abe,trace:Ebe,visualization:Rbe},Symbol.toStringTag,{value:"Module"})),Dbe={back:"返回",cancel:"取消",deploy:"部署",delete:"删除",loading:"读取中…",next:"下一步",notSupported:"暂不支持",previous:"上一步",required:"必填",retry:"重试",actions:"操作",value:"值",disabled:"关闭",enabled:"已开启",none:"无",close:"关闭",name:"名称",description:"描述",send:"发送"},Mbe={heading:"VeADK Agent 结构配置",importHint:"可在「创建 Agent」页通过「导入 YAML」重新载入。"},Lbe={agentName:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},runtimeName:{required:"Runtime 名称为必填项",characters:"Runtime 名称只能包含英文字母、数字、下划线和连字符",length:"Runtime 名称长度须为 4-64 个字符"}},$be={description:"一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",instruction:`你是一个专业、可靠的智能助手。 你的目标是准确理解用户的需求,并给出条理清晰、简洁有用的回答。 约束: - 信息不足时主动提问澄清,不要臆造事实。 - 需要时合理调用可用的工具,并说明关键结论。 -- 保持礼貌、专业的语气。`},Ibe={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",fallbackApiKeyLabel:"{{name}} 的备用模型 {{model}} 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 解压后的内容过大"}},Pbe={back:"返回开发会话",runtimeName:"Runtime 名称",runtimeNameExists:"Runtime 名称已存在,请更换后重试",checkingRuntimeName:"正在检查 Runtime 名称",verifiedSource:"已验证源码",deployableSource:"可部署源码",verifiedByCodex:"已通过 Codex 云端验证",entryPoint:"入口",files:"文件",artifact:"构建产物",validationReport:"验证报告",verifiedHint:"源码由服务端从已验证交付物物化,浏览器文件不能替换。",unverifiedHint:"源码已由服务端安全物化,部署前请确认 Runtime 配置。",env:{requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}"}},Dbe={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 中声明已有入口。"}},Mbe={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:"添加到最后"}},Lbe={title:"智能构建",subtitle:"描述需求,完成 Agent 的构建、调试与验证。",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。"},tasks:{title:"进行中的任务",hint:"离开页面后仍会继续,可随时回来查看和补充要求。",refresh:"刷新任务列表",loading:"正在读取任务…",empty:"暂无进行中的任务",emptyHint:"开始构建后,可以从这里回到任务。",loadError:"暂时无法读取任务,请重试。",openError:"暂时无法打开任务,请重试。",startedAt:"开始于 {{time}}",open:"查看任务",opening:"正在连接…",states:{queued:"等待开始",running:"构建中",recovering:"正在重连",waiting_user:"等待你的回复",stopping:"正在停止",succeeded:"已完成",failed:"未完成",cancelled:"已停止"}}},$be={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:"最新版本",defaultVersionName:"版本 · {{time}}",rename:{projectTitle:"修改项目名称",versionTitle:"修改版本名称",projectLabel:"项目名称",versionLabel:"版本名称",hint:"支持中英文、数字和常见标点,最多 {{max}} 个字符。",required:"请输入名称。",tooLong:"名称不能超过 {{max}} 个字符。",invalidCharacters:"名称不能包含换行、控制字符、不可见格式字符或 < >。",save:"保存名称",saving:"保存中…",updated:"名称已更新。",failed:"名称保存失败,请重试。"},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:"删除版本"}},Fbe={title:"选择创建方式",subtitle:"以不同模式构建您的智能体",features:"特性",quick:{title:"快速模式",description:"动态派生子智能体自主完成任务",features:{dynamicSubagents:"动态派生子智能体",autonomousPlanning:"自主规划执行",collaboration:"多智能体协作",summary:"自动汇总结果",skills:"按需调用技能",trace:"任务过程可追踪"}},traditional:{title:"传统模式",description:"高度自定义您的智能体结构",features:{visualConfig:"可视化配置",migration:"存量智能体迁移",debugging:"实时调试",optimization:"可选性能优化",parameters:"精细参数控制"}}},Bbe={placeholder:"输入系统提示词;键入 ## 加空格可创建二级标题…",toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",paragraph:"正文",quote:"引用",heading:"标题 {{level}}",selectBlockType:"选择文本类型",blockType:"文本类型",bold:"加粗",removeBold:"取消加粗",italic:"斜体",removeItalic:"取消斜体",bulletedList:"无序列表",numberedList:"有序列表"}},Ube={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 中心暂无技能。"}},Qbe={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}} 条连线"}},zbe={ariaLabel:"快速模式创建",progress:"快速模式创建进度",steps:{agent:{label:"智能体",title:"基本信息",description:"设置智能体的名称、用途、行为方式与能力"},environment:{label:"执行环境",title:"配置执行环境",description:"选择默认环境或已构建的自定义环境"},deployment:{label:"部署偏好",title:"部署偏好",description:"定义 AgentKit 云上参数"}},model:{label:"模型",source:"模型来源",name:"模型名称",fallbacks:"Fallback 模型",fallbackPlaceholder:"备用模型名称",addFallback:"添加备用模型",addProviderFallback:"添加其他服务商",removeFallback:"移除",fallbackType:"备用模型类型",fallbackSameProvider:"同服务商",fallbackOtherProvider:"其他服务商",apiKeyEnv:"API Key 环境变量",invalidApiKeyEnv:"环境变量名只能包含字母、数字和下划线,且不能以数字开头。",fallbackHelp:"同服务商备用模型复用主模型连接;其他服务商会使用单独的 provider、API Base 和 API Key。",fallbackIgnored:"空值、重复值或与主模型相同的模型会被忽略。",provider:"服务商 Provider",invalidApiBase:"请输入合法的 http:// 或 https:// 链接。",volcengineArk:"火山方舟",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",currentApiKey:"当前 API Key",currentConfiguration:"当前配置",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:"请选择模型",apiKeyRequired:"请先填写或选择模型 API Key",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:"更新并发布"}},Vbe={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:"描述为必填项",mcpDuplicateName:"MCP 名称重复,请为每个服务使用唯一名称",mcpDuplicateUrl:"MCP 地址重复,请删除重复服务后再发布",missingSubagent:"缺少子 Agent",missingPrompt:"系统提示词为必填项",apiKeyRequired:"请先填写或选择模型 API Key",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:"模型名称",fallbacks:"Fallback 模型",fallbackPlaceholder:"备用模型名称",addFallback:"添加备用模型",addProviderFallback:"添加其他服务商",removeFallback:"移除",fallbackType:"备用模型类型",fallbackSameProvider:"同服务商",fallbackOtherProvider:"其他服务商",apiKeyEnv:"API Key 环境变量",invalidApiKeyEnv:"环境变量名只能包含字母、数字和下划线,且不能以数字开头。",fallbackHelp:"同服务商备用模型复用主模型连接;其他服务商会使用单独的 provider、API Base 和 API Key。",fallbackIgnored:"空值、重复值或与主模型相同的模型会被忽略。",provider:"服务商 Provider",invalidApiBase:"请输入合法的 http:// 或 https:// 链接。",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 Endpoint 时可直接使用;否则请补充完整服务路径。",tokenPlaceholder:"Bearer Token(可选)",showToken:"显示 Bearer Token",hideToken:"隐藏 Bearer Token",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 结构并准备部署快照…"}},Hbe={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:"长期"}},qbe={checkingExpiry:"确认有效期中",waitingRecovery:"等待恢复",listFailed:"读取项目列表失败",recoveryFailed:"工作区恢复失败,请重试",operationFailed:"项目操作失败,请重试",title:"代码项目",back:"返回代码项目",restart:"本开发环境将在 {{countdown}} 后重启,请随时保存数据",expiresAt:"有效期至 {{date}}",exitFullscreen:"退出全屏",fullscreen:"全屏",exitFullscreenHint:"退出全屏(Esc)",recovering:"正在恢复工作区,完成后将自动返回项目",retry:"重试连接",search:"搜索代码项目",newTitle:"新建代码项目",new:"新建项目",readingStats:"正在读取项目统计",createdAt:"创建时间",opening:"正在打开",unknownCreatedAt:"创建时间未知",open:"打开项目",empty:"没有匹配的代码项目",close:"关闭新建项目",name:"项目名称",placeholder:"例如 my-agent",nameHelp:"以英文字母开头,可包含字母、数字、下划线和连字符,最多 64 个字符",cancel:"取消",create:"创建项目",files_one:"{{count}} 个文件",files_other:"{{count}} 个文件",directories_one:"{{count}} 个目录",directories_other:"{{count}} 个目录",separator:","},Wbe={enabled:"已启用",disabled:"已禁用",unknownStatus:"状态未知",allPermissions:"全部权限",customPermissions:"自定义权限",unknownPermissions:"权限未知",unnamed:"未命名 API Key",search:"搜索名称、状态或权限",noMatches:"没有匹配的 API Key",noModelPermission:"当前 API Key 无权限",modelAvailable:"可用",permissionState:{Available:"可用于对话",Shutdown:"已下线",VideoGeneration:"视频生成模型",Unsupported:"不支持作为对话模型",NotActivated:"尚未开通",Unknown:"未获取到模型状态"}},Kbe={common:_be,yaml:jbe,validation:Nbe,defaults:Rbe,helpers:Ibe,intelligentDeployment:Pbe,codePackage:Dbe,buildCanvas:Mbe,intelligent:Lbe,projectLibrary:$be,modePicker:Fbe,promptEditor:Bbe,skills:Ube,workflow:Qbe,workbench:zbe,traditional:Vbe,template:Hbe,workspace:qbe,modelApiKey:Wbe},tQe=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:Mbe,codePackage:Dbe,common:_be,default:Kbe,defaults:Rbe,helpers:Ibe,intelligent:Lbe,intelligentDeployment:Pbe,modePicker:Fbe,modelApiKey:Wbe,projectLibrary:$be,promptEditor:Bbe,skills:Ube,template:Hbe,traditional:Vbe,validation:Nbe,workbench:zbe,workflow:Qbe,workspace:qbe,yaml:jbe},Symbol.toStringTag,{value:"Module"})),Gbe={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:"查看详情"},Xbe={cancelDescription:"本次 Session 将被取消,后续计划不会暂停。",cancelTitle:"终止本次执行?",deleteDescription:"“{{name}}”及其全部执行历史将被永久删除。",deleteTitle:"删除定时任务?"},Ybe={configuration:"任务配置",nextRun:"下次执行",pageLabel:"定时任务详情",region:"地域",runtime:"运行时",status:"任务状态"},Zbe={createTitle:"创建定时任务",description:"每次触发都会为 Runtime Agent 创建独立 Session。",editTitle:"编辑定时任务"},Jbe={minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",seconds:"{{count}} 秒"},eye={cronExpression:"Cron 表达式",cronHelp:"依次填写分钟、小时、日期、月份、星期。",dailyTime:"每天执行时间",enableAfterCreate:"创建后启用",enableHelp:"启用后会从下一个计划时间开始执行。",name:"任务名称",namePlaceholder:"例如:每日生成运营摘要",noRuntime:"暂无可用 Runtime",prompt:"执行文本",promptPlaceholder:"输入每次执行时发送给 Agent 的固定文本",runAt:"执行时间",runtimeAgent:"运行时智能体",runtimeHelp:"任务始终跟随该 Runtime 当前生效版本。",runtimePlaceholder:"选择 Runtime Agent",schedule:"执行计划",scheduleType:"执行计划类型",timezone:"时区",weekday:"星期"},tye={all:"全部"},nye={description:"每次运行均使用独立 Session,结果与错误会永久保留。",duration:"耗时 {{duration}}",emptyDescription:"任务触发或立即执行后,记录会显示在这里。",emptyTitle:"暂无执行记录",errorDetails:"错误详情",finalAnswer:"最终回答",loadFailed:"无法加载执行历史",loadFailedDescription:"请检查 Studio 服务后重试。",session:"会话",title:"执行历史"},iye={cancelRequested:"已提交终止请求。",created:"任务已创建。",deleted:"任务及其执行历史已删除。",enabled:"任务已启用。",paused:"任务已暂停。",queued:"任务已排队,将在一分钟内开始执行。",requeued:"任务已重新排队,将在一分钟内开始执行。",updated:"任务已更新。"},rye={filterLabel:"定时任务状态筛选",listLabel:"定时任务列表",loadFailed:"无法加载定时任务",loadFailedDescription:"请检查 Studio 服务后重试。",title:"定时任务"},sye={cron:"Cron {{cron}}{{zone}}",daily:"每天 {{time}}{{zone}}",once:"一次 · {{date}}{{zone}}",weekly:"{{weekday}} {{time}}{{zone}}"},oye={daily:"每天",once:"一次性",weekly:"每周"},aye={cancelled:"已取消",enabled:"已启用",failed:"失败",notRun:"尚未执行",paused:"已暂停",pending:"准备中",queued:"已排队",retrying:"自动重试中",running:"执行中",skipped:"已跳过",success:"成功"},lye={cronFields:"Cron 表达式需要包含 5 个字段,例如 0 9 * * *。",nameRequired:"请输入任务名称。",promptRequired:"请输入每次执行时发送给 Agent 的文本。",runtimeAppMissing:"Runtime Agent 未返回可调用的 appName,请确认 Runtime 已就绪且版本兼容。",runtimeRequired:"请选择可用的 Runtime Agent。",timeRequired:"请选择执行时间。"},cye={friday:"周五",monday:"周一",saturday:"周六",sunday:"周日",thursday:"周四",tuesday:"周二",wednesday:"周三"},nQe={actions:Gbe,confirm:Xbe,detail:Ybe,drawer:Zbe,duration:Jbe,fields:eye,filters:tye,history:nye,notices:iye,page:rye,schedule:sye,scheduleTypes:oye,status:aye,validation:lye,weekdays:cye},iQe=Object.freeze(Object.defineProperty({__proto__:null,actions:Gbe,confirm:Xbe,default:nQe,detail:Ybe,drawer:Zbe,duration:Jbe,fields:eye,filters:tye,history:nye,notices:iye,page:rye,schedule:sye,scheduleTypes:oye,status:aye,validation:lye,weekdays:cye},Symbol.toStringTag,{value:"Module"})),uye="快速创建 Agent",dye="Agent 类型",fye="关闭",hye="部署",pye="预览配置",mye="已发起配置包下载",gye="下载失败,请重试",bye="有 {{count}} 处配置需要修改",yye="自定义",vye="自定义{{field}}",xye="输入自定义值",wye="该模型未声明推理强度,使用服务端设置",Oye="请先为该提供方添加模型",kye="请先选择提供方",Sye="请选择",Eye="可选",Cye="默认模型、Agent 预设和权限用于新会话;预设需要存在于部署的 Harness 中",Tye="仅填写环境变量名称,实际密钥由部署环境提供",Aye="read-only 为只读,workspace-write 可写工作区,danger-full-access 允许完整访问且不请求确认",_ye="allowedModels 是子 Agent 可选择的模型列表,启用后至少填写一组提供方和模型",jye="添加自定义模型服务,填写它的端点、协议和模型 ID,支持火山引擎和 BytePlus 等兼容服务",Nye="当前覆盖常用原生设置,其他插件参数与预设文件尚未接入",Rye="查看原生配置文档",Iye="模型提供方 {{index}}",Pye="模型 {{index}}",Dye="添加模型提供方",Mye="移除提供方 {{index}}",Lye="添加模型",$ye="移除模型 {{index}}",Fye="添加可选模型",Bye="移除可选模型 {{index}}",Uye="移除",Qye="填写服务端的模型 ID",zye={provider:"提供方 {{index}}",model:"模型 {{index}}"},Vye={defaults:"会话默认设置",deepseek:"DeepSeek 模型服务",providers:"自定义模型提供方",shell:"命令执行",loop:"工具调用",subagents:"子 Agent 模型选择",search:"DeepSeek 网络搜索"},Hye={id:"提供方 ID",displayName:"显示名称",baseURL:"服务地址",api:"接口协议",apiKeyEnv:"密钥环境变量"},qye={id:"例如 company-models",displayName:"可选,默认使用提供方 ID",baseURL:"https://…/v1",api:"选择接口协议",apiKeyEnv:"例如 MODEL_API_KEY"},Wye={id:"模型 ID",name:"显示名称",contextWindow:"上下文容量",maxTokens:"最大输出容量"},Kye={positive:"请输入大于 0 的数值",integer:"请输入有效的正整数",env:"请输入环境变量名,只能包含字母、数字和下划线,且不能以数字开头",url:"请输入 HTTP 或 HTTPS 地址,不要在地址中包含凭据",option:"请选择受支持的原生选项",required:"请补全此项",duplicate:"该 ID 或模型组合已存在",providerId:"以小写字母开头,可包含小写字母、数字、点、下划线和连字符,不能使用保留 ID",routes:"请至少填写一组完整的提供方和模型",modelPair:"请填写该自定义提供方下的模型 ID",unknownProvider:"请先添加该自定义模型提供方",unknownModel:"请填写该提供方下已配置的模型 ID",timer:"请输入大于 0 且不超过 2147483647 的毫秒数"},Gye={"agent-default-model_provider":"默认提供方","agent-default-model_model":"默认模型","agent-default-model_reasoningEffort":"默认推理强度","agent-presets_default":"默认 Agent 预设",permission_defaultPreset:"默认权限预设","llm-deepseek_apiKeyEnv":"密钥环境变量","llm-deepseek_baseURL":"服务地址","llm-deepseek_thinking":"思考模式","llm-deepseek_reasoningEffort":"推理强度","llm-deepseek_maxTokens":"每次请求的输出上限","llm-deepseek_defaultContextWindow":"默认上下文容量","llm-deepseek_streamIdleTimeoutMs":"流式空闲超时(毫秒)",bash_timeoutMs:"默认执行超时(毫秒)",bash_maxTimeoutMs:"最大执行超时(毫秒)",bash_maxOutputBytes:"输出上限(字节)","agent-loop_maxParallelToolCalls":"并行工具调用上限","subagent-model-selection_enabled":"启用模型选择","web-search-deepseek_apiKeyEnv":"密钥环境变量","web-search-deepseek_baseURL":"搜索服务地址","web-search-deepseek_model":"搜索模型","web-search-deepseek_apiVersion":"接口版本","web-search-deepseek_maxTokens":"搜索输出上限","web-search-deepseek_maxUses":"搜索次数上限"},Xye="取消",Yye="返回创建方式",Zye="DeepSeek Harness 配置",rQe={title:uye,agentType:dye,close:fye,continue:"继续配置",deploy:hye,preview:pye,export:"导出配置",downloaded:mye,downloadFailed:gye,validationSummary:bye,customValue:yye,customField:vye,enterCustomValue:xye,reasoningUnavailable:wye,modelsUnavailable:Oye,selectProviderFirst:kye,selectOption:Sye,optional:Eye,defaultsHelp:Cye,credentialHelp:Tye,permissionHelp:Aye,routesHelp:_ye,providersHelp:jye,coverage:Nye,source:Rye,provider:Iye,model:Pye,addProvider:Dye,removeProvider:Mye,addModel:Lye,removeModel:$ye,addRoute:Fye,removeRoute:Bye,remove:Uye,modelIdPlaceholder:Qye,route:zye,sections:Vye,providerFields:Hye,providerPlaceholders:qye,modelFields:Wye,errors:Kye,fields:Gye,cancel:Xye,back:Yye,pageTitle:Zye},sQe=Object.freeze(Object.defineProperty({__proto__:null,addModel:Lye,addProvider:Dye,addRoute:Fye,agentType:dye,back:Yye,cancel:Xye,close:fye,coverage:Nye,credentialHelp:Tye,customField:vye,customValue:yye,default:rQe,defaultsHelp:Cye,deploy:hye,downloadFailed:gye,downloaded:mye,enterCustomValue:xye,errors:Kye,fields:Gye,model:Pye,modelFields:Wye,modelIdPlaceholder:Qye,modelsUnavailable:Oye,optional:Eye,pageTitle:Zye,permissionHelp:Aye,preview:pye,provider:Iye,providerFields:Hye,providerPlaceholders:qye,providersHelp:jye,reasoningUnavailable:wye,remove:Uye,removeModel:$ye,removeProvider:Mye,removeRoute:Bye,route:zye,routesHelp:_ye,sections:Vye,selectOption:Sye,selectProviderFirst:kye,source:Rye,title:uye,validationSummary:bye},Symbol.toStringTag,{value:"Module"})),Jye="问题反馈",e0e="问题描述",t0e="常见问题",n0e="取消",i0e="完成",r0e="提交反馈",s0e="正在上报…",o0e={title:"上报成功,感谢您的反馈",description:"AgentKit 团队会尽快查看您提交的问题。"},a0e={close:"关闭问题反馈",intro:"请选择遇到的问题,也可以补充具体表现。",privacy:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。",descriptionPlaceholder:"请描述问题发生时的表现(选填)",issues:{slow:"执行速度慢",crash:"运行崩溃",incorrect:"结果不准确",tool_error:"工具调用失败",other:"其他问题"}},l0e={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 团队,请注意隐私保护。"},oQe={title:Jye,descriptionLabel:e0e,commonIssues:t0e,cancel:n0e,done:i0e,submit:r0e,submitting:s0e,success:o0e,dialog:a0e,page:l0e},aQe=Object.freeze(Object.defineProperty({__proto__:null,cancel:n0e,commonIssues:t0e,default:oQe,descriptionLabel:e0e,dialog:a0e,done:i0e,page:l0e,submit:r0e,submitting:s0e,success:o0e,title:Jye},Symbol.toStringTag,{value:"Module"})),c0e={back:"返回",close:"关闭"},u0e={title:"优化迁移项目",closeAria:"关闭优化窗口"},d0e={title:"已迁移项目",description:"管理迁移后的源码版本,也可以选择任一版本继续优化。",libraryTitle:"项目与版本",libraryDescription:"查看、下载、部署或对比源码版本,也可以基于任一版本继续优化。",emptyTitle:"还没有已迁移的项目",emptyDescription:"迁移完成后,源码会自动保存在这里。"},f0e={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any(通用迁移)"},h0e={awaitingUpload:"待上传",analyzing:"分析中",needsInput:"待补充",analysisReady:"待确认",migrating:"迁移中",validating:"校验中",packaging:"打包中",succeeded:"已完成",succeededWithWarnings:"已完成,有提示",partial:"部分完成",failed:"失败",cancelled:"已终止",expired:"已过期"},p0e={evaluationPending:"待评测",evaluationRunning:"评测中",waitingDataset:"待保存评测用例",waitingEnvironment:"待补充环境变量",evaluationFailed:"迁移完成,评测未完成",evaluationBlocked:"迁移完成,评测待处理",evaluationCancelled:"迁移完成,评测已取消",resultUnavailable:"结果不可用",environmentExpired:"环境已过期"},m0e={partialReady:"迁移产物已生成,但交付不完整,请查看迁移提示。",readyWithWarnings:"迁移产物已生成,请查看迁移提示。",ready:"迁移产物已生成。"},g0e={passed:"产物校验通过",failed:"产物校验未通过",degraded:"产物校验未完成"},b0e={session:"创建迁移环境",upload:"上传项目",analysis:"分析项目"},y0e={agentNameRequired:"请输入 Agent 名称",agentNameInvalid:"Agent 名称必须为 1-63 位,只能包含小写字母、数字和连字符,且必须以字母或数字开头和结尾"},v0e={seconds:"{{seconds}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},x0e={savedUnaffected:"已保存项目不受影响",savingUnaffected:"源码正在保存,完成后不受环境期限影响",activeDetail:"到期后任务记录和临时产物将无法访问",oneHour:"临时迁移环境保留 1 小时",ended:"临时迁移环境已结束",savedAvailable:"已保存项目仍可查看、下载、部署或优化",unavailable:"任务记录和临时产物已无法访问",countdown:"临时迁移环境将在 {{minutes}} 分 {{seconds}} 秒后结束",expiredSavedMessage:"临时迁移环境已结束,已保存项目不受影响。",expiredMessage:"临时迁移环境已结束,任务记录和临时产物无法继续访问。"},w0e={recommended:"建议迁移方式",scope:"迁移范围",excluded:"不在本次范围",viewEvidence:"查看分析证据",viewAssumptions:"查看关键假设",viewSourceEvidence:"查看源码证据"},O0e={ariaLabel:"Codex 执行动态",title:"Codex 执行动态",startingAnalysis:"Codex 正在开始分析…",startingMigration:"Codex 正在开始迁移…",loadError:"暂时无法读取 Codex 执行动态,不影响当前任务。"},k0e={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:"正在读取迁移产物…"},S0e={retiring:"即将下线",currentDefault:"当前默认模型",loadError:"加载模型列表失败",label:"模型",placeholder:"选择模型"},E0e={zipOnly:"请选择 .zip 格式的本地项目文件。",invalidName:"ZIP 文件名无效,请重命名后重新选择。",tooLarge:"项目 ZIP 不能超过 {{size}}。",empty:"项目 ZIP 不能为空。",removeAria:"移除项目 ZIP",reselectPrompt:"重新选择项目 ZIP",selectPrompt:"选择或拖入本地项目 ZIP",reselect:"重新选择",selectZip:"选择 ZIP",continue:"继续上传",start:"上传并分析",inputAria:"选择本地项目 ZIP",retention:"临时迁移环境从创建完成起保留 1 小时;保存成功的源码版本不受影响。",uploading:"上传中…",sizeHint:"支持项目 ZIP,最大 {{size}}"},C0e={requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}",notReady:"迁移产物尚未准备完成。",back:"返回迁移结果"},T0e={backToAddAgent:"返回添加 Agent",title:"从存量迁移",newMigration:"新建迁移",recent:"最近迁移",loadingSessions:"正在读取迁移会话…",noSessions:"暂无迁移会话",heading:"迁移存量 Agent 项目",intro:"上传本地项目 ZIP,Codex 将先进行只读分析,再由你确认迁移方式。",backToHome:"迁移首页",navigation:"迁移导航",showMore:"查看更多",showLess:"收起",projectName:"项目名称",status:"状态",createdAt:"创建时间",actions:"操作",openTask:"查看迁移 {{name}}",continueTask:"继续",viewTask:"查看"},A0e={stop:"终止迁移",stopping:"正在终止…",cancel:"取消",reload:"重新读取",refreshStatus:"刷新状态"},_0e={unavailable:"迁移能力暂不可用",defaultReason:"Dev Sandbox 暂不可用,请联系管理员检查配置。"},j0e={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:"当前迁移已终止。你可以新建迁移并重新上传项目。"},N0e={ariaLabel:"补充项目分析信息",title:"补充分析所需信息",description:"附件保持锁定,提交后仅继续只读分析",submitting:"正在继续分析…",submit:"提交并继续分析"},R0e={ariaLabel:"确认迁移方式",title:"确认迁移方式",description:"确认后才会执行实际迁移",framework:"迁移方式",frameworkPlaceholder:"选择迁移方式",agentName:"Agent 名称",entry:"项目入口",entryPlaceholder:"选择项目入口",entryExample:"例如 agent.py:agent",consent:"点击“确认并开始迁移”即确认上述迁移范围、排除项和关键假设。",starting:"正在启动迁移…",start:"确认并开始迁移"},I0e={setup:{title:"迁移效果评测",description:"迁移完成后自动执行评测用例。",on:"已开启",off:"未开启",unavailable:"当前环境暂不支持迁移效果评测。",casesTitle:"评测用例",casesDescription:"至少添加一个用例。期望结果和评测标准可选。",configuredSummary:"{{count}} 个用例 · {{preset}} · {{dimensions}}",incompleteSummary:"{{count}} 个用例待填写 · {{preset}} · {{dimensions}}",dimensionSummary:"{{count}} 个维度",editSettings:"编辑设置",viewSettings:"查看设置",lockedTitle:"评测用例",lockedDescription:"上传开始后不可修改。",closeAria:"关闭评测设置",done:"完成配置",close:"关闭"},tabs:{label:"迁移任务内容",migration:"迁移",evaluation:"效果评测",waitingMigration:"等待迁移",waitingConfiguration:"待配置",running:"评测中",completed:"已完成",issue:"需处理"},bulk:{open:"批量粘贴",label:"每行输入一个用例",placeholder:`帮我查询今天的订单状态 -把结果整理成三点`,preview:"将添加 {{count}} 个用例",confirm:"添加用例"},case:{title:"用例 {{index}}",add:"添加用例",moveUp:"上移用例 {{index}}",moveDown:"下移用例 {{index}}",copy:"复制",delete:"删除",userInput:"用户输入",userInputPlaceholder:"例如:请帮我查询今天的订单状态",expectedOutcome:"期望结果(可选)",expectedOutcomePlaceholder:"描述希望 Agent 完成什么,不要求逐字一致",criteria:"必须满足的要求(可选)",addCriterion:"添加要求",criterionLabel:"必须满足的要求 {{index}}",criterionPlaceholder:"例如:必须包含订单号和当前状态",removeCriterion:"删除要求 {{index}}"},advanced:{title:"高级设置",standard:"标准评测",standardDescription:"默认包含语义一致性、输出约束、工作流与工具一致性 3 个维度,适合多数迁移。",custom:"自定义维度",customDescription:"按业务风险选择一个或多个评测维度。",lockedDescription:"项目开始上传后,评测方式和维度不再修改。"},dimension:{semantic_fidelity:"语义一致性",output_contract:"输出约束",workflow_tool_fidelity:"工作流与工具一致性",context_memory_fidelity:"上下文与记忆一致性",boundary_error_fidelity:"边界与异常一致性",safety_refusal_fidelity:"安全与拒答一致性"},dimensionDescription:{semantic_fidelity:"检查意图理解、结论和关键事实是否保持一致。",output_contract:"检查字段、结构、语言和格式约束是否保持。",workflow_tool_fidelity:"检查可观察的工作流分支和工具行为是否保持。",context_memory_fidelity:"检查可验证的多轮上下文和记忆行为。",boundary_error_fidelity:"检查无效输入、信息缺失和依赖失败时的行为。",safety_refusal_fidelity:"检查已有授权、拒答和敏感信息边界是否保持。"},validation:{caseCount:"请保留 1–{{count}} 个用例。",dimensionRequired:"请至少选择一个评测维度。",userInputRequired:"请输入用例内容。",userInputBytes:"单个用例不能超过 32 KiB。",expectedOutcomeBytes:"期望结果不能超过 16 KiB。",criteriaCount:"单个用例最多包含 {{count}} 条要求。",criterionRequired:"要求不能为空。",criterionBytes:"单条要求不能超过 2 KiB。",datasetBytes:"全部评测用例不能超过 10 MiB。"},dataset:{invalidLockResponse:"服务未确认评测用例已保存,请重试。",loadingSettings:"正在读取评测设置…",loadSettingsFailed:"评测设置读取失败。",retryLoadSettings:"重新读取",missing:"未找到已保存的评测用例,请重新填写并保存。",saveWarning:"评测用例暂未保存,不影响迁移。",retrySave:"重新保存评测用例",saving:"正在保存…"},state:{disabled:"未开启评测",waiting_dataset:"等待填写评测用例",pending:"迁移完成后自动开始评测",preparing:"正在准备评测环境…",waiting_environment:"需要补充运行所需的环境变量",deploying:"正在部署临时 Runtime…",executing:"正在执行评测用例…",judging:"正在执行评测分析…",aggregating:"正在汇总评测结果…",completed:"评测已完成",failed:"评测未完成",blocked:"评测需要处理后才能继续",cancelled:"评测已取消"},progress:{label:"迁移与迁移效果评测进度",migration:"迁移",evaluation:"迁移效果评测",notStarted:"未开始",inProgress:"进行中",completed:"完成",waitingConfiguration:"等待配置",issue:"有问题"},environment:{description:"填写临时 Runtime 所需的环境变量。",security:"仅用于本次评测。",optional:"可选",submit:"提交并继续评测",submitting:"正在提交…"},execution:{preparing:"准备评测",preparingDetail:"校验迁移产物和 {{count}} 个评测用例",deploying:"启动 Runtime",deployingDetail:"准备 {{runtime}}",runtimeFallback:"隔离运行环境",executing:"执行用例",executingDetail:"执行 {{count}} 个用例并记录输出",judging:"执行评测分析",judgingDetail:"评测 {{cases}} 个用例 · {{dimensions}} 个维度",aggregating:"生成评测报告",aggregatingDetail:"汇总评分与证据,生成 HTML 报告",waiting:"等待中",running:"执行中",failed:"失败",complete:"已完成"},result:{title:"执行进度",attempt:"第 {{attempt}} 次评测",pending:"等待迁移完成",retry:"重新评测",retrying:"正在重试…",failureStage:"失败阶段",errorCode:"错误码",taskId:"任务 ID",diagnosticAttempt:"评测轮次",runtime:"Runtime",errorDetails:"错误详情",diagnosticField:"{{label}}:{{value}}",diagnosticHeading:"{{label}}:",loadingReport:"正在读取评测报告…",reportTitle:"HTML 评测报告",reportHtmlDescription:"查看或下载 HTML 报告。",viewReport:"查看报告",reportDrawerDescription:"评分、差异与证据",closeReport:"关闭",closeReportAria:"关闭评测报告",reportPreviewTitle:"迁移效果评测报告预览",reportSummary:"评测摘要",reportVersion:"评测集 {{version}} · Prompt v{{prompt}}",downloadReport:"下载完整报告",downloadingReport:"正在下载…",overallScore:"综合一致性",scoreScale:"0–100;证据不足时显示 N/A",evidenceCoverage:"证据覆盖率",coverageDetail:"{{scored}} / {{total}} 个维度有证据",executionSuccess:"执行成功率",executionDetail:"{{succeeded}} / {{total}} 个用例完成",naCount:"N/A 数量",naDescription:"证据不足,不计入分数",gapDescription:"迁移差距说明",lowestScoringCases:"低分用例",executionFailures:"执行异常",criticalEvidence:"Critical 证据",limitations:"评测限制",viewEvidence:"查看 {{count}} 个用例的结果与证据",outputTruncated:"输出过长,已截断",executionState:{succeeded:"执行完成",failed:"执行异常"},severityLabel:"严重度:{{severity}}",severity:{none:"无",low:"低",medium:"中",high:"高",critical:"Critical",unknown:"未知"},evidenceSource:{user_reference:"期望结果",user_criteria:"填写的要求",source_contract:"源项目约束",observed_output:"实际输出",runtime_observation:"Runtime 原始数据",deterministic_assertion:"确定性断言"},listSeparator:"、"}},P0e={closeAria:"关闭错误提示",loadFailed:"无法读取迁移数据,请重试。",refreshFailed:"无法刷新迁移状态,请重试。"},D0e={title:"终止当前迁移?",description:"终止后,当前分析或迁移进程将停止,已执行的步骤不会继续。"},lQe={common:c0e,optimization:u0e,projects:d0e,framework:f0e,state:h0e,historyStatus:p0e,task:m0e,verification:g0e,transfer:b0e,validation:y0e,duration:v0e,expiry:x0e,analysis:w0e,activity:O0e,artifact:k0e,model:S0e,upload:E0e,deployment:C0e,workspace:T0e,actions:A0e,capability:_0e,conversation:j0e,questions:N0e,confirmation:R0e,evaluation:I0e,errors:P0e,stopDialog:D0e},cQe=Object.freeze(Object.defineProperty({__proto__:null,actions:A0e,activity:O0e,analysis:w0e,artifact:k0e,capability:_0e,common:c0e,confirmation:R0e,conversation:j0e,default:lQe,deployment:C0e,duration:v0e,errors:P0e,evaluation:I0e,expiry:x0e,framework:f0e,historyStatus:p0e,model:S0e,optimization:u0e,projects:d0e,questions:N0e,state:h0e,stopDialog:D0e,task:m0e,transfer:b0e,upload:E0e,validation:y0e,verification:g0e,workspace:T0e},Symbol.toStringTag,{value:"Module"})),M0e={loading:"加载中…",searchLabel:"搜索{{label}}",searchPlaceholder:"搜索{{label}}",retry:"重试",noMatches:"没有匹配项",noOptions:"暂无可选项",selection:"{{label}}:{{value}}"},L0e={badge:"焕然一新",view:"查看新特性",title:"本次更新",defaultNotes:{multiRegion:"多地域智能体:并行加载北京与上海 Runtime,列表下滑即可继续加载。",switchAgent:"会话内切换:在输入框旁选择智能体,并直接开启一段新会话。",visualCanvas:"可视化执行画布:通过横向画布查看多智能体结构,并支持全屏浏览。"}},$0e={label:"新会话模式",agent:"智能体",skill:"技能定制",video:"视频创作"},F0e={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:"暂不可用"},B0e={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}}",wakingHint:"正在唤醒智能体,可能需要一些时间。"},U0e={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"},Q0e={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}}秒"}},z0e={compactSelect:M0e,featureNotice:L0e,workspace:$0e,mode:F0e,agentPicker:B0e,skill:U0e,video:Q0e},uQe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:B0e,compactSelect:M0e,default:z0e,featureNotice:L0e,mode:F0e,skill:U0e,video:Q0e,workspace:$0e},Symbol.toStringTag,{value:"Module"})),V0e="审核中心",H0e="审核资源类型",q0e="仅管理员可以访问审核中心",W0e="搜索申请名称、提交人或版本",K0e="审核状态",G0e="{{count}} 条待审核",X0e="共 {{count}} 条申请",Y0e={skill:"技能",agent:"智能体"},Z0e={all:"全部状态",pending:"待审核",approved:"已通过",returned:"已退回",approving:"发布中"},J0e={application:"申请名称",submitter:"提交人",version:"版本",submittedAt:"提交时间",status:"状态",actions:"操作"},eve={details:"详情",detailsFor:"查看 {{name}} 的申请详情",approve:"通过",approveFor:"通过 {{name}} 的申请",return:"退回",returnFor:"退回 {{name}} 的申请",close:"关闭",backToDetails:"返回详情",confirmApprove:"确认通过",confirmReturn:"确认退回",clearFilters:"清除筛选",refresh:"刷新",cancel:"取消",resumeApproval:"继续发布"},tve={title:"暂无审核申请",description:"提交的审核申请会显示在这里",filteredTitle:"没有匹配的申请",filteredDescription:"试试其他关键词,或调整审核状态"},nve={title:"申请详情",sections:"申请详情内容",overview:"申请信息",files:"提交文件 · {{count}}",requestType:"申请类型",update:"版本更新",firstRelease:"首次发布",source:"来源",source_skill:"{{name}}的个人技能空间",source_agent:"{{name}}的开发环境",destination:"发布目标",destination_skill:"企业共享技能空间",destination_agent:"全员共享智能体",region:"区域",visibility:"发布后可见范围",shared:"全员可见",description:"功能说明",changes:"本次提交说明",example:"使用示例",history:"审核记录",submitted:"{{name}}提交申请",versionFixed:"仅审核本次提交的版本",instructions:"使用说明",filesTab:"提交文件",filesFailed:"加载提交文件失败",unknownAuthor:"未知申请人",reviewer:"审批人",reviewedAt:"审批时间",approved:"{{name}}通过申请",returned:"{{name}}退回申请",unknownReviewer:"未知审批人",approvedBy:"通过人",returnedBy:"退回人",comment:"审批评论",result:"审批结果",noHistory:"此技能尚未提交审核",pendingHint:"等待管理员审核",approvingHint:"管理员已确认通过,正在发布到企业共享空间",approving:"{{name}}确认通过,等待完成发布"},ive={failed:"待审核空间暂不可用",retry:"重试"},rve={approveTitle:"通过申请",returnTitle:"退回申请",approveDescription:"通过后,{{name}} 的 {{version}} 版本将在企业共享空间中向全员公开",returnDescription:"退回 {{name}} 的 {{version}} 版本,并向申请人说明原因",reason:"退回理由",reasonRequired:"请填写退回理由",reasonHelp:"最多 256 个字符,申请人可以看到此理由",saving:"处理中…",failed:"审批失败,请重试",approved:"{{name}} 已通过并公开",returned:"{{name}} 已退回",comment:"评论(可选)",commentHelp:"最多 256 个字符,申请人可以看到此评论"},sve={title:"AI 评分",points:"{{score}} 分",insufficient:"依据不足",status:{unscored:"尚未评分",not_requested:"尚未评分",queued:"等待评分",running:"评分中",completed:"已评分",failed:"评分失败"},loading:"加载评分…",starting:"正在提交评分…",loadFailed:"加载评分失败",retryFailed:"提交评分失败",failed:"评分未完成,请管理员重试",retry:"重新评分",start:"开始评分",reload:"重新加载",download:"下载 JSON",expand:"展开",collapse:"收起",hint:"评分针对本次提交版本,供人工审批参考",dimensions:{safety:"安全性",usability:"易用性",completeness:"完整性",reliability:"可靠性",maintainability:"可维护性"},risks:"风险提示",suggestions:"改进建议",model:"评分模型",rubric:"评分标准版本",time:"评分时间",severity:{low:"低风险",medium:"中风险",high:"高风险",critical:"严重风险"},coverage:"评审范围",coverageCount:"已评审 {{included}} / {{total}} 个文件",coverageIncomplete:"部分内容未纳入评审,评分依据不完整",omittedFile:"未评审 {{path}}:{{reason}}",truncatedFile:"仅评审部分内容 {{path}}:{{reason}}",originalError:"云端原始错误"},dQe={title:V0e,category:H0e,adminOnly:q0e,search:W0e,filterStatus:K0e,pendingCount:G0e,total:X0e,kind:Y0e,status:Z0e,columns:J0e,actions:eve,empty:tve,detail:nve,space:ive,decision:rve,score:sve},fQe=Object.freeze(Object.defineProperty({__proto__:null,actions:eve,adminOnly:q0e,category:H0e,columns:J0e,decision:rve,default:dQe,detail:nve,empty:tve,filterStatus:K0e,kind:Y0e,pendingCount:G0e,score:sve,search:W0e,space:ive,status:Z0e,title:V0e,total:X0e},Symbol.toStringTag,{value:"Module"})),ove={cancel:"取消",close:"关闭",retry:"重试",tryAgain:"重新尝试",closeDialog:"关闭{{title}}",agentFallback:"{{agent}} 智能体",unknownSource:"未知来源"},ave={terminalTitle:"终端",browserTitle:"沙箱浏览器",terminalSubtitle:"连接当前 AgentKit Session 的交互式终端",browserSubtitle:"在当前 AgentKit Session 中查看与操作浏览器",connecting:"正在连接…",connected:"已连接",notConnected:"尚未连接",opening:"正在打开 {{title}}",connectingSession:"工具正在连接当前 AgentKit Session。",openFailed:"{{title}} 打开失败"},lve={title:"恢复 Codex 对话",subtitle:"选择当前 Sandbox Session 中最近更新的 Thread",loading:"正在读取历史对话",loadFailed:"历史对话读取失败",empty:"暂无可恢复的对话"},cve={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 自动审查流程处理审批请求。"}}},uve={title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",absolutePath:"绝对路径",browse:"浏览",parent:"上一级",empty:"当前目录没有子目录",locked:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。",useDirectory:"使用此目录"},dve={fileTitle:"允许修改文件?",commandTitle:"允许执行命令?",subtitle:"Codex 正在等待你的决定",workingDirectory:"执行目录",decline:"拒绝",acceptOnce:"仅本次允许",acceptSession:"本会话允许"},fve={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:"发送",stopping:"正在确认停止…",resume:"恢复任务",steer:"追加要求",steerPlaceholder:"可继续追加要求,或随时停止任务…"},hve={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:"重新尝试"},pve={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:"推理输出"}},mve={back:"返回智能体列表",subtitle:"{{agent}} 智能体详情",type:"智能体类型",status:"状态",createdBy:"创建人",snapshotStatus:"快照状态",toolType:"工具类型",createdAt:"创建时间",snapshotReason:"快照原因",expiresAt:"过期时间",snapshotId:"快照 ID",sessionId:"会话 ID",sourceSessionId:"来源 Session ID",delete:"删除智能体",waking:"唤醒中…",opening:"打开中…",wake:"唤醒智能体",open:"打开智能体",deleteTitle:"删除智能体?",deleteDescription:"将删除“{{name}}”及其保存的数据,此操作无法撤销。",deleting:"删除中…",confirmDelete:"确认删除",sleepingHint:"该智能体已休眠,进入时需要唤醒,可能需要一些时间。",wakingHint:"正在唤醒智能体,可能需要一些时间。",agentId:"智能体 ID"},gve={back:"返回智能体列表",createdBy:"创建人 {{creator}}",ariaLabel:"智能体工作区",main:"主界面",terminal:"终端",mainTitle:"{{agent}} 主界面",openingTerminal:"正在打开终端…",terminalTitle:"{{agent}} 终端"},bve={prompt:`使用 AgentKit Studio Plugin 端云接力当前会话、项目和任务。请直接执行,不要让我手动打开终端。 +- 保持礼貌、专业的语气。`},Fbe={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",fallbackApiKeyLabel:"{{name}} 的备用模型 {{model}} 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 解压后的内容过大"}},Bbe={back:"返回开发会话",runtimeName:"Runtime 名称",runtimeNameExists:"Runtime 名称已存在,请更换后重试",checkingRuntimeName:"正在检查 Runtime 名称",verifiedSource:"已验证源码",deployableSource:"可部署源码",verifiedByCodex:"已通过 Codex 云端验证",entryPoint:"入口",files:"文件",artifact:"构建产物",validationReport:"验证报告",verifiedHint:"源码由服务端从已验证交付物物化,浏览器文件不能替换。",unverifiedHint:"源码已由服务端安全物化,部署前请确认 Runtime 配置。",env:{requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}"}},Ube={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 中声明已有入口。"}},Qbe={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:"添加到最后"}},zbe={title:"智能构建",subtitle:"描述需求,完成 Agent 的构建、调试与验证。",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。"},tasks:{title:"进行中的任务",hint:"离开页面后仍会继续,可随时回来查看和补充要求。",refresh:"刷新任务列表",loading:"正在读取任务…",empty:"暂无进行中的任务",emptyHint:"开始构建后,可以从这里回到任务。",loadError:"暂时无法读取任务,请重试。",openError:"暂时无法打开任务,请重试。",startedAt:"开始于 {{time}}",open:"查看任务",opening:"正在连接…",states:{queued:"等待开始",running:"构建中",recovering:"正在重连",waiting_user:"等待你的回复",stopping:"正在停止",succeeded:"已完成",failed:"未完成",cancelled:"已停止"}}},Vbe={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:"最新版本",defaultVersionName:"版本 · {{time}}",rename:{projectTitle:"修改项目名称",versionTitle:"修改版本名称",projectLabel:"项目名称",versionLabel:"版本名称",hint:"支持中英文、数字和常见标点,最多 {{max}} 个字符。",required:"请输入名称。",tooLong:"名称不能超过 {{max}} 个字符。",invalidCharacters:"名称不能包含换行、控制字符、不可见格式字符或 < >。",save:"保存名称",saving:"保存中…",updated:"名称已更新。",failed:"名称保存失败,请重试。"},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:"删除版本"}},Hbe={title:"选择创建方式",subtitle:"以不同模式构建您的智能体",features:"特性",quick:{title:"快速模式",description:"动态派生子智能体自主完成任务",features:{dynamicSubagents:"动态派生子智能体",autonomousPlanning:"自主规划执行",collaboration:"多智能体协作",summary:"自动汇总结果",skills:"按需调用技能",trace:"任务过程可追踪"}},traditional:{title:"传统模式",description:"高度自定义您的智能体结构",features:{visualConfig:"可视化配置",migration:"存量智能体迁移",debugging:"实时调试",optimization:"可选性能优化",parameters:"精细参数控制"}}},qbe={placeholder:"输入系统提示词;键入 ## 加空格可创建二级标题…",toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",paragraph:"正文",quote:"引用",heading:"标题 {{level}}",selectBlockType:"选择文本类型",blockType:"文本类型",bold:"加粗",removeBold:"取消加粗",italic:"斜体",removeItalic:"取消斜体",bulletedList:"无序列表",numberedList:"有序列表"}},Wbe={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 中心暂无技能。"}},Kbe={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}} 条连线"}},Gbe={ariaLabel:"快速模式创建",progress:"快速模式创建进度",steps:{agent:{label:"智能体",title:"基本信息",description:"设置智能体的名称、用途、行为方式与能力"},environment:{label:"执行环境",title:"配置执行环境",description:"选择默认环境或已构建的自定义环境"},deployment:{label:"部署偏好",title:"部署偏好",description:"定义 AgentKit 云上参数"}},model:{label:"模型",source:"模型来源",name:"模型名称",fallbacks:"Fallback 模型",fallbackPlaceholder:"备用模型名称",addFallback:"添加备用模型",addProviderFallback:"添加其他服务商",removeFallback:"移除",fallbackType:"备用模型类型",fallbackSameProvider:"同服务商",fallbackOtherProvider:"其他服务商",apiKeyEnv:"API Key 环境变量",invalidApiKeyEnv:"环境变量名只能包含字母、数字和下划线,且不能以数字开头。",fallbackHelp:"同服务商备用模型复用主模型连接;其他服务商会使用单独的 provider、API Base 和 API Key。",fallbackIgnored:"空值、重复值或与主模型相同的模型会被忽略。",provider:"服务商 Provider",invalidApiBase:"请输入合法的 http:// 或 https:// 链接。",volcengineArk:"火山方舟",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",currentApiKey:"当前 API Key",currentConfiguration:"当前配置",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:"请选择模型",apiKeyRequired:"请先填写或选择模型 API Key",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:"更新并发布"}},Xbe={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:"描述为必填项",mcpDuplicateName:"MCP 名称重复,请为每个服务使用唯一名称",mcpDuplicateUrl:"MCP 地址重复,请删除重复服务后再发布",missingSubagent:"缺少子 Agent",missingPrompt:"系统提示词为必填项",apiKeyRequired:"请先填写或选择模型 API Key",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:"模型名称",fallbacks:"Fallback 模型",fallbackPlaceholder:"备用模型名称",addFallback:"添加备用模型",addProviderFallback:"添加其他服务商",removeFallback:"移除",fallbackType:"备用模型类型",fallbackSameProvider:"同服务商",fallbackOtherProvider:"其他服务商",apiKeyEnv:"API Key 环境变量",invalidApiKeyEnv:"环境变量名只能包含字母、数字和下划线,且不能以数字开头。",fallbackHelp:"同服务商备用模型复用主模型连接;其他服务商会使用单独的 provider、API Base 和 API Key。",fallbackIgnored:"空值、重复值或与主模型相同的模型会被忽略。",provider:"服务商 Provider",invalidApiBase:"请输入合法的 http:// 或 https:// 链接。",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 Endpoint 时可直接使用;否则请补充完整服务路径。",tokenPlaceholder:"Bearer Token(可选)",showToken:"显示 Bearer Token",hideToken:"隐藏 Bearer Token",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 结构并准备部署快照…"}},Ybe={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:"长期"}},Zbe={checkingExpiry:"确认有效期中",waitingRecovery:"等待恢复",listFailed:"读取项目列表失败",recoveryFailed:"工作区恢复失败,请重试",operationFailed:"项目操作失败,请重试",title:"代码项目",back:"返回代码项目",restart:"本开发环境将在 {{countdown}} 后重启,请随时保存数据",expiresAt:"有效期至 {{date}}",exitFullscreen:"退出全屏",fullscreen:"全屏",exitFullscreenHint:"退出全屏(Esc)",recovering:"正在恢复工作区,完成后将自动返回项目",retry:"重试连接",search:"搜索代码项目",newTitle:"新建代码项目",new:"新建项目",readingStats:"正在读取项目统计",createdAt:"创建时间",opening:"正在打开",unknownCreatedAt:"创建时间未知",open:"打开项目",empty:"没有匹配的代码项目",close:"关闭新建项目",name:"项目名称",placeholder:"例如 my-agent",nameHelp:"以英文字母开头,可包含字母、数字、下划线和连字符,最多 64 个字符",cancel:"取消",create:"创建项目",files_one:"{{count}} 个文件",files_other:"{{count}} 个文件",directories_one:"{{count}} 个目录",directories_other:"{{count}} 个目录",separator:","},Jbe={enabled:"已启用",disabled:"已禁用",unknownStatus:"状态未知",allPermissions:"全部权限",customPermissions:"自定义权限",unknownPermissions:"权限未知",unnamed:"未命名 API Key",search:"搜索名称、状态或权限",noMatches:"没有匹配的 API Key",noModelPermission:"当前 API Key 无权限",modelAvailable:"可用",permissionState:{Available:"可用于对话",Shutdown:"已下线",VideoGeneration:"视频生成模型",Unsupported:"不支持作为对话模型",NotActivated:"尚未开通",Unknown:"未获取到模型状态"}},eye={common:Dbe,yaml:Mbe,validation:Lbe,defaults:$be,helpers:Fbe,intelligentDeployment:Bbe,codePackage:Ube,buildCanvas:Qbe,intelligent:zbe,projectLibrary:Vbe,modePicker:Hbe,promptEditor:qbe,skills:Wbe,workflow:Kbe,workbench:Gbe,traditional:Xbe,template:Ybe,workspace:Zbe,modelApiKey:Jbe},lQe=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:Qbe,codePackage:Ube,common:Dbe,default:eye,defaults:$be,helpers:Fbe,intelligent:zbe,intelligentDeployment:Bbe,modePicker:Hbe,modelApiKey:Jbe,projectLibrary:Vbe,promptEditor:qbe,skills:Wbe,template:Ybe,traditional:Xbe,validation:Lbe,workbench:Gbe,workflow:Kbe,workspace:Zbe,yaml:Mbe},Symbol.toStringTag,{value:"Module"})),tye={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:"查看详情"},nye={cancelDescription:"本次 Session 将被取消,后续计划不会暂停。",cancelTitle:"终止本次执行?",deleteDescription:"“{{name}}”及其全部执行历史将被永久删除。",deleteTitle:"删除定时任务?"},iye={configuration:"任务配置",nextRun:"下次执行",pageLabel:"定时任务详情",region:"地域",runtime:"运行时",status:"任务状态"},rye={createTitle:"创建定时任务",description:"每次触发都会为 Runtime Agent 创建独立 Session。",editTitle:"编辑定时任务"},sye={minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",seconds:"{{count}} 秒"},oye={cronExpression:"Cron 表达式",cronHelp:"依次填写分钟、小时、日期、月份、星期。",dailyTime:"每天执行时间",enableAfterCreate:"创建后启用",enableHelp:"启用后会从下一个计划时间开始执行。",name:"任务名称",namePlaceholder:"例如:每日生成运营摘要",noRuntime:"暂无可用 Runtime",prompt:"执行文本",promptPlaceholder:"输入每次执行时发送给 Agent 的固定文本",runAt:"执行时间",runtimeAgent:"运行时智能体",runtimeHelp:"任务始终跟随该 Runtime 当前生效版本。",runtimePlaceholder:"选择 Runtime Agent",schedule:"执行计划",scheduleType:"执行计划类型",timezone:"时区",weekday:"星期"},aye={all:"全部"},lye={description:"每次运行均使用独立 Session,结果与错误会永久保留。",duration:"耗时 {{duration}}",emptyDescription:"任务触发或立即执行后,记录会显示在这里。",emptyTitle:"暂无执行记录",errorDetails:"错误详情",finalAnswer:"最终回答",loadFailed:"无法加载执行历史",loadFailedDescription:"请检查 Studio 服务后重试。",session:"会话",title:"执行历史"},cye={cancelRequested:"已提交终止请求。",created:"任务已创建。",deleted:"任务及其执行历史已删除。",enabled:"任务已启用。",paused:"任务已暂停。",queued:"任务已排队,将在一分钟内开始执行。",requeued:"任务已重新排队,将在一分钟内开始执行。",updated:"任务已更新。"},uye={filterLabel:"定时任务状态筛选",listLabel:"定时任务列表",loadFailed:"无法加载定时任务",loadFailedDescription:"请检查 Studio 服务后重试。",title:"定时任务"},dye={cron:"Cron {{cron}}{{zone}}",daily:"每天 {{time}}{{zone}}",once:"一次 · {{date}}{{zone}}",weekly:"{{weekday}} {{time}}{{zone}}"},fye={daily:"每天",once:"一次性",weekly:"每周"},hye={cancelled:"已取消",enabled:"已启用",failed:"失败",notRun:"尚未执行",paused:"已暂停",pending:"准备中",queued:"已排队",retrying:"自动重试中",running:"执行中",skipped:"已跳过",success:"成功"},pye={cronFields:"Cron 表达式需要包含 5 个字段,例如 0 9 * * *。",nameRequired:"请输入任务名称。",promptRequired:"请输入每次执行时发送给 Agent 的文本。",runtimeAppMissing:"Runtime Agent 未返回可调用的 appName,请确认 Runtime 已就绪且版本兼容。",runtimeRequired:"请选择可用的 Runtime Agent。",timeRequired:"请选择执行时间。"},mye={friday:"周五",monday:"周一",saturday:"周六",sunday:"周日",thursday:"周四",tuesday:"周二",wednesday:"周三"},cQe={actions:tye,confirm:nye,detail:iye,drawer:rye,duration:sye,fields:oye,filters:aye,history:lye,notices:cye,page:uye,schedule:dye,scheduleTypes:fye,status:hye,validation:pye,weekdays:mye},uQe=Object.freeze(Object.defineProperty({__proto__:null,actions:tye,confirm:nye,default:cQe,detail:iye,drawer:rye,duration:sye,fields:oye,filters:aye,history:lye,notices:cye,page:uye,schedule:dye,scheduleTypes:fye,status:hye,validation:pye,weekdays:mye},Symbol.toStringTag,{value:"Module"})),gye="快速创建 Agent",bye="Agent 类型",yye="关闭",vye="部署",xye="预览配置",wye="已发起配置包下载",Oye="下载失败,请重试",kye="有 {{count}} 处配置需要修改",Sye="自定义",Eye="自定义{{field}}",Cye="输入自定义值",Tye="该模型未声明推理强度,使用服务端设置",Aye="请先为该提供方添加模型",_ye="请先选择提供方",jye="请选择",Nye="可选",Rye="默认模型、Agent 预设和权限用于新会话;预设需要存在于部署的 Harness 中",Iye="仅填写环境变量名称,实际密钥由部署环境提供",Pye="read-only 为只读,workspace-write 可写工作区,danger-full-access 允许完整访问且不请求确认",Dye="allowedModels 是子 Agent 可选择的模型列表,启用后至少填写一组提供方和模型",Mye="添加自定义模型服务,填写它的端点、协议和模型 ID,支持火山引擎和 BytePlus 等兼容服务",Lye="当前覆盖常用原生设置,其他插件参数与预设文件尚未接入",$ye="查看原生配置文档",Fye="模型提供方 {{index}}",Bye="模型 {{index}}",Uye="添加模型提供方",Qye="移除提供方 {{index}}",zye="添加模型",Vye="移除模型 {{index}}",Hye="添加可选模型",qye="移除可选模型 {{index}}",Wye="移除",Kye="填写服务端的模型 ID",Gye={provider:"提供方 {{index}}",model:"模型 {{index}}"},Xye={defaults:"会话默认设置",deepseek:"DeepSeek 模型服务",providers:"自定义模型提供方",shell:"命令执行",loop:"工具调用",subagents:"子 Agent 模型选择",search:"DeepSeek 网络搜索"},Yye={id:"提供方 ID",displayName:"显示名称",baseURL:"服务地址",api:"接口协议",apiKeyEnv:"密钥环境变量"},Zye={id:"例如 company-models",displayName:"可选,默认使用提供方 ID",baseURL:"https://…/v1",api:"选择接口协议",apiKeyEnv:"例如 MODEL_API_KEY"},Jye={id:"模型 ID",name:"显示名称",contextWindow:"上下文容量",maxTokens:"最大输出容量"},e0e={positive:"请输入大于 0 的数值",integer:"请输入有效的正整数",env:"请输入环境变量名,只能包含字母、数字和下划线,且不能以数字开头",url:"请输入 HTTP 或 HTTPS 地址,不要在地址中包含凭据",option:"请选择受支持的原生选项",required:"请补全此项",duplicate:"该 ID 或模型组合已存在",providerId:"以小写字母开头,可包含小写字母、数字、点、下划线和连字符,不能使用保留 ID",routes:"请至少填写一组完整的提供方和模型",modelPair:"请填写该自定义提供方下的模型 ID",unknownProvider:"请先添加该自定义模型提供方",unknownModel:"请填写该提供方下已配置的模型 ID",timer:"请输入大于 0 且不超过 2147483647 的毫秒数"},t0e={"agent-default-model_provider":"默认提供方","agent-default-model_model":"默认模型","agent-default-model_reasoningEffort":"默认推理强度","agent-presets_default":"默认 Agent 预设",permission_defaultPreset:"默认权限预设","llm-deepseek_apiKeyEnv":"密钥环境变量","llm-deepseek_baseURL":"服务地址","llm-deepseek_thinking":"思考模式","llm-deepseek_reasoningEffort":"推理强度","llm-deepseek_maxTokens":"每次请求的输出上限","llm-deepseek_defaultContextWindow":"默认上下文容量","llm-deepseek_streamIdleTimeoutMs":"流式空闲超时(毫秒)",bash_timeoutMs:"默认执行超时(毫秒)",bash_maxTimeoutMs:"最大执行超时(毫秒)",bash_maxOutputBytes:"输出上限(字节)","agent-loop_maxParallelToolCalls":"并行工具调用上限","subagent-model-selection_enabled":"启用模型选择","web-search-deepseek_apiKeyEnv":"密钥环境变量","web-search-deepseek_baseURL":"搜索服务地址","web-search-deepseek_model":"搜索模型","web-search-deepseek_apiVersion":"接口版本","web-search-deepseek_maxTokens":"搜索输出上限","web-search-deepseek_maxUses":"搜索次数上限"},n0e="取消",i0e="返回创建方式",r0e="DeepSeek Harness 配置",dQe={title:gye,agentType:bye,close:yye,continue:"继续配置",deploy:vye,preview:xye,export:"导出配置",downloaded:wye,downloadFailed:Oye,validationSummary:kye,customValue:Sye,customField:Eye,enterCustomValue:Cye,reasoningUnavailable:Tye,modelsUnavailable:Aye,selectProviderFirst:_ye,selectOption:jye,optional:Nye,defaultsHelp:Rye,credentialHelp:Iye,permissionHelp:Pye,routesHelp:Dye,providersHelp:Mye,coverage:Lye,source:$ye,provider:Fye,model:Bye,addProvider:Uye,removeProvider:Qye,addModel:zye,removeModel:Vye,addRoute:Hye,removeRoute:qye,remove:Wye,modelIdPlaceholder:Kye,route:Gye,sections:Xye,providerFields:Yye,providerPlaceholders:Zye,modelFields:Jye,errors:e0e,fields:t0e,cancel:n0e,back:i0e,pageTitle:r0e},fQe=Object.freeze(Object.defineProperty({__proto__:null,addModel:zye,addProvider:Uye,addRoute:Hye,agentType:bye,back:i0e,cancel:n0e,close:yye,coverage:Lye,credentialHelp:Iye,customField:Eye,customValue:Sye,default:dQe,defaultsHelp:Rye,deploy:vye,downloadFailed:Oye,downloaded:wye,enterCustomValue:Cye,errors:e0e,fields:t0e,model:Bye,modelFields:Jye,modelIdPlaceholder:Kye,modelsUnavailable:Aye,optional:Nye,pageTitle:r0e,permissionHelp:Pye,preview:xye,provider:Fye,providerFields:Yye,providerPlaceholders:Zye,providersHelp:Mye,reasoningUnavailable:Tye,remove:Wye,removeModel:Vye,removeProvider:Qye,removeRoute:qye,route:Gye,routesHelp:Dye,sections:Xye,selectOption:jye,selectProviderFirst:_ye,source:$ye,title:gye,validationSummary:kye},Symbol.toStringTag,{value:"Module"})),s0e="问题反馈",o0e="问题描述",a0e="常见问题",l0e="取消",c0e="完成",u0e="提交反馈",d0e="正在上报…",f0e={title:"上报成功,感谢您的反馈",description:"AgentKit 团队会尽快查看您提交的问题。"},h0e={close:"关闭问题反馈",intro:"请选择遇到的问题,也可以补充具体表现。",privacy:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。",descriptionPlaceholder:"请描述问题发生时的表现(选填)",issues:{slow:"执行速度慢",crash:"运行崩溃",incorrect:"结果不准确",tool_error:"工具调用失败",other:"其他问题"}},p0e={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 团队,请注意隐私保护。"},hQe={title:s0e,descriptionLabel:o0e,commonIssues:a0e,cancel:l0e,done:c0e,submit:u0e,submitting:d0e,success:f0e,dialog:h0e,page:p0e},pQe=Object.freeze(Object.defineProperty({__proto__:null,cancel:l0e,commonIssues:a0e,default:hQe,descriptionLabel:o0e,dialog:h0e,done:c0e,page:p0e,submit:u0e,submitting:d0e,success:f0e,title:s0e},Symbol.toStringTag,{value:"Module"})),m0e={back:"返回",close:"关闭"},g0e={title:"优化迁移项目",closeAria:"关闭优化窗口"},b0e={title:"已迁移项目",description:"管理迁移后的源码版本,也可以选择任一版本继续优化。",libraryTitle:"项目与版本",libraryDescription:"查看、下载、部署或对比源码版本,也可以基于任一版本继续优化。",emptyTitle:"还没有已迁移的项目",emptyDescription:"迁移完成后,源码会自动保存在这里。"},y0e={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any(通用迁移)"},v0e={awaitingUpload:"待上传",analyzing:"分析中",needsInput:"待补充",analysisReady:"待确认",migrating:"迁移中",validating:"校验中",packaging:"打包中",succeeded:"已完成",succeededWithWarnings:"已完成,有提示",partial:"部分完成",failed:"失败",cancelled:"已终止",expired:"已过期"},x0e={evaluationPending:"待评测",evaluationRunning:"评测中",waitingDataset:"待保存评测用例",waitingEnvironment:"待补充环境变量",evaluationFailed:"迁移完成,评测未完成",evaluationBlocked:"迁移完成,评测待处理",evaluationCancelled:"迁移完成,评测已取消",resultUnavailable:"结果不可用",environmentExpired:"环境已过期"},w0e={partialReady:"迁移产物已生成,但交付不完整,请查看迁移提示。",readyWithWarnings:"迁移产物已生成,请查看迁移提示。",ready:"迁移产物已生成。"},O0e={passed:"产物校验通过",failed:"产物校验未通过",degraded:"产物校验未完成"},k0e={session:"创建迁移环境",upload:"上传项目",analysis:"分析项目"},S0e={agentNameRequired:"请输入 Agent 名称",agentNameInvalid:"Agent 名称必须为 1-63 位,只能包含小写字母、数字和连字符,且必须以字母或数字开头和结尾"},E0e={seconds:"{{seconds}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},C0e={savedUnaffected:"已保存项目不受影响",savingUnaffected:"源码正在保存,完成后不受环境期限影响",activeDetail:"到期后任务记录和临时产物将无法访问",oneHour:"临时迁移环境保留 1 小时",ended:"临时迁移环境已结束",savedAvailable:"已保存项目仍可查看、下载、部署或优化",unavailable:"任务记录和临时产物已无法访问",countdown:"临时迁移环境将在 {{minutes}} 分 {{seconds}} 秒后结束",expiredSavedMessage:"临时迁移环境已结束,已保存项目不受影响。",expiredMessage:"临时迁移环境已结束,任务记录和临时产物无法继续访问。"},T0e={recommended:"建议迁移方式",scope:"迁移范围",excluded:"不在本次范围",viewEvidence:"查看分析证据",viewAssumptions:"查看关键假设",viewSourceEvidence:"查看源码证据"},A0e={ariaLabel:"Codex 执行动态",title:"Codex 执行动态",startingAnalysis:"Codex 正在开始分析…",startingMigration:"Codex 正在开始迁移…",loadError:"暂时无法读取 Codex 执行动态,不影响当前任务。",liveAnalyzing:"正在分析项目",liveMigrating:"正在执行迁移",liveValidating:"正在校验迁移结果",livePackaging:"正在整理迁移产物",liveDelivery:"正在核对交付产物"},_0e={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:"正在读取迁移产物…"},j0e={retiring:"即将下线",currentDefault:"当前默认模型",loadError:"加载模型列表失败",label:"模型",placeholder:"选择模型"},N0e={zipOnly:"请选择 .zip 格式的本地项目文件。",invalidName:"ZIP 文件名无效,请重命名后重新选择。",tooLarge:"项目 ZIP 不能超过 {{size}}。",empty:"项目 ZIP 不能为空。",removeAria:"移除项目 ZIP",reselectPrompt:"重新选择项目 ZIP",selectPrompt:"选择或拖入本地项目 ZIP",reselect:"重新选择",selectZip:"选择 ZIP",continue:"继续上传",start:"上传并分析",inputAria:"选择本地项目 ZIP",retention:"临时迁移环境从创建完成起保留 1 小时;保存成功的源码版本不受影响。",uploading:"上传中…",sizeHint:"支持项目 ZIP,最大 {{size}}"},R0e={requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}",notReady:"迁移产物尚未准备完成。",back:"返回迁移结果"},I0e={backToAddAgent:"返回添加 Agent",title:"从存量迁移",newMigration:"新建迁移",recent:"最近迁移",loadingSessions:"正在读取迁移会话…",noSessions:"暂无迁移会话",heading:"迁移存量 Agent 项目",intro:"上传本地项目 ZIP,Codex 将先进行只读分析,再由你确认迁移方式。",backToHome:"迁移首页",navigation:"迁移导航",showMore:"查看更多",showLess:"收起",projectName:"项目名称",status:"状态",createdAt:"创建时间",actions:"操作",openTask:"查看迁移 {{name}}",continueTask:"继续",viewTask:"查看"},P0e={stop:"终止迁移",stopping:"正在终止…",cancel:"取消",reload:"重新读取",refreshStatus:"刷新状态"},D0e={unavailable:"迁移能力暂不可用",defaultReason:"Dev Sandbox 暂不可用,请联系管理员检查配置。"},M0e={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:"当前迁移已终止。你可以新建迁移并重新上传项目。"},L0e={ariaLabel:"补充项目分析信息",title:"补充分析所需信息",description:"附件保持锁定,提交后仅继续只读分析",submitting:"正在继续分析…",submit:"提交并继续分析"},$0e={ariaLabel:"回答迁移需要你决定的问题",title:"迁移需要你的回答",description:"回答后会在当前这一步里继续,不需要重新开始",other:"其他",otherPlaceholder:"也可以直接输入你的答案",submitting:"正在提交回答…",submit:"提交回答并继续"},F0e={ariaLabel:"确认迁移方式",title:"确认迁移方式",framework:"迁移方式",frameworkPlaceholder:"选择迁移方式",agentName:"Agent 名称",entry:"项目入口",entryPlaceholder:"选择项目入口",entryExample:"例如 agent.py:agent",consent:"点击“确认并开始迁移”即确认上述迁移范围、排除项和关键假设。",starting:"正在启动迁移…",start:"确认并开始迁移"},B0e={setup:{title:"迁移效果评测",description:"迁移完成后自动执行评测用例。",on:"已开启",off:"未开启",unavailable:"当前环境暂不支持迁移效果评测。",casesTitle:"评测用例",casesDescription:"至少添加一个用例。期望结果和评测标准可选。",configuredSummary:"{{count}} 个用例 · {{preset}} · {{dimensions}}",incompleteSummary:"{{count}} 个用例待填写 · {{preset}} · {{dimensions}}",dimensionSummary:"{{count}} 个维度",editSettings:"编辑设置",viewSettings:"查看设置",lockedTitle:"评测用例",lockedDescription:"上传开始后不可修改。",closeAria:"关闭评测设置",done:"完成配置",close:"关闭"},tabs:{label:"迁移任务内容",migration:"迁移",evaluation:"效果评测",waitingMigration:"等待迁移",waitingConfiguration:"待配置",running:"评测中",completed:"已完成",issue:"需处理"},bulk:{open:"批量粘贴",label:"每行输入一个用例",placeholder:`帮我查询今天的订单状态 +把结果整理成三点`,preview:"将添加 {{count}} 个用例",confirm:"添加用例"},case:{title:"用例 {{index}}",add:"添加用例",moveUp:"上移用例 {{index}}",moveDown:"下移用例 {{index}}",copy:"复制",delete:"删除",userInput:"用户输入",userInputPlaceholder:"例如:请帮我查询今天的订单状态",expectedOutcome:"期望结果(可选)",expectedOutcomePlaceholder:"描述希望 Agent 完成什么,不要求逐字一致",criteria:"必须满足的要求(可选)",addCriterion:"添加要求",criterionLabel:"必须满足的要求 {{index}}",criterionPlaceholder:"例如:必须包含订单号和当前状态",removeCriterion:"删除要求 {{index}}"},advanced:{title:"高级设置",standard:"标准评测",standardDescription:"默认包含语义一致性、输出约束、工作流与工具一致性 3 个维度,适合多数迁移。",custom:"自定义维度",customDescription:"按业务风险选择一个或多个评测维度。",lockedDescription:"项目开始上传后,评测方式和维度不再修改。"},dimension:{semantic_fidelity:"语义一致性",output_contract:"输出约束",workflow_tool_fidelity:"工作流与工具一致性",context_memory_fidelity:"上下文与记忆一致性",boundary_error_fidelity:"边界与异常一致性",safety_refusal_fidelity:"安全与拒答一致性"},dimensionDescription:{semantic_fidelity:"检查意图理解、结论和关键事实是否保持一致。",output_contract:"检查字段、结构、语言和格式约束是否保持。",workflow_tool_fidelity:"检查可观察的工作流分支和工具行为是否保持。",context_memory_fidelity:"检查可验证的多轮上下文和记忆行为。",boundary_error_fidelity:"检查无效输入、信息缺失和依赖失败时的行为。",safety_refusal_fidelity:"检查已有授权、拒答和敏感信息边界是否保持。"},validation:{caseCount:"请保留 1–{{count}} 个用例。",dimensionRequired:"请至少选择一个评测维度。",userInputRequired:"请输入用例内容。",userInputBytes:"单个用例不能超过 32 KiB。",expectedOutcomeBytes:"期望结果不能超过 16 KiB。",criteriaCount:"单个用例最多包含 {{count}} 条要求。",criterionRequired:"要求不能为空。",criterionBytes:"单条要求不能超过 2 KiB。",datasetBytes:"全部评测用例不能超过 10 MiB。"},dataset:{invalidLockResponse:"服务未确认评测用例已保存,请重试。",loadingSettings:"正在读取评测设置…",loadSettingsFailed:"评测设置读取失败。",retryLoadSettings:"重新读取",missing:"未找到已保存的评测用例,请重新填写并保存。",saveWarning:"评测用例暂未保存,不影响迁移。",retrySave:"重新保存评测用例",saving:"正在保存…"},state:{disabled:"未开启评测",waiting_dataset:"等待填写评测用例",pending:"迁移完成后自动开始评测",preparing:"正在准备评测环境…",waiting_environment:"需要补充运行所需的环境变量",deploying:"正在部署临时 Runtime…",executing:"正在执行评测用例…",judging:"正在执行评测分析…",aggregating:"正在汇总评测结果…",completed:"评测已完成",failed:"评测未完成",blocked:"评测需要处理后才能继续",cancelled:"评测已取消"},progress:{label:"迁移与迁移效果评测进度",migration:"迁移",evaluation:"迁移效果评测",notStarted:"未开始",inProgress:"进行中",completed:"完成",waitingConfiguration:"等待配置",issue:"有问题"},environment:{description:"填写临时 Runtime 所需的环境变量。",security:"仅用于本次评测。",optional:"可选",submit:"提交并继续评测",submitting:"正在提交…"},execution:{preparing:"准备评测",preparingDetail:"校验迁移产物和 {{count}} 个评测用例",deploying:"启动 Runtime",deployingDetail:"准备 {{runtime}}",runtimeFallback:"隔离运行环境",executing:"执行用例",executingDetail:"执行 {{count}} 个用例并记录输出",judging:"执行评测分析",judgingDetail:"评测 {{cases}} 个用例 · {{dimensions}} 个维度",aggregating:"生成评测报告",aggregatingDetail:"汇总评分与证据,生成 HTML 报告",waiting:"等待中",running:"执行中",failed:"失败",complete:"已完成"},result:{title:"执行进度",attempt:"第 {{attempt}} 次评测",pending:"等待迁移完成",retry:"重新评测",retrying:"正在重试…",failureStage:"失败阶段",errorCode:"错误码",taskId:"任务 ID",diagnosticAttempt:"评测轮次",runtime:"Runtime",errorDetails:"错误详情",diagnosticField:"{{label}}:{{value}}",diagnosticHeading:"{{label}}:",loadingReport:"正在读取评测报告…",reportTitle:"HTML 评测报告",reportHtmlDescription:"查看或下载 HTML 报告。",viewReport:"查看报告",reportDrawerDescription:"评分、差异与证据",closeReport:"关闭",closeReportAria:"关闭评测报告",reportPreviewTitle:"迁移效果评测报告预览",reportSummary:"评测摘要",reportVersion:"评测集 {{version}} · Prompt v{{prompt}}",downloadReport:"下载完整报告",downloadingReport:"正在下载…",overallScore:"综合一致性",scoreScale:"0–100;证据不足时显示 N/A",evidenceCoverage:"证据覆盖率",coverageDetail:"{{scored}} / {{total}} 个维度有证据",executionSuccess:"执行成功率",executionDetail:"{{succeeded}} / {{total}} 个用例完成",naCount:"N/A 数量",naDescription:"证据不足,不计入分数",gapDescription:"迁移差距说明",lowestScoringCases:"低分用例",executionFailures:"执行异常",criticalEvidence:"Critical 证据",limitations:"评测限制",viewEvidence:"查看 {{count}} 个用例的结果与证据",outputTruncated:"输出过长,已截断",executionState:{succeeded:"执行完成",failed:"执行异常"},severityLabel:"严重度:{{severity}}",severity:{none:"无",low:"低",medium:"中",high:"高",critical:"Critical",unknown:"未知"},evidenceSource:{user_reference:"期望结果",user_criteria:"填写的要求",source_contract:"源项目约束",observed_output:"实际输出",runtime_observation:"Runtime 原始数据",deterministic_assertion:"确定性断言"},listSeparator:"、"}},U0e={closeAria:"关闭错误提示",loadFailed:"无法读取迁移数据,请重试。",refreshFailed:"无法刷新迁移状态,请重试。"},Q0e={title:"终止当前迁移?",description:"终止后,当前分析或迁移进程将停止,已执行的步骤不会继续。"},mQe={common:m0e,optimization:g0e,projects:b0e,framework:y0e,state:v0e,historyStatus:x0e,task:w0e,verification:O0e,transfer:k0e,validation:S0e,duration:E0e,expiry:C0e,analysis:T0e,activity:A0e,artifact:_0e,model:j0e,upload:N0e,deployment:R0e,workspace:I0e,actions:P0e,capability:D0e,conversation:M0e,questions:L0e,pendingInput:$0e,confirmation:F0e,evaluation:B0e,errors:U0e,stopDialog:Q0e},gQe=Object.freeze(Object.defineProperty({__proto__:null,actions:P0e,activity:A0e,analysis:T0e,artifact:_0e,capability:D0e,common:m0e,confirmation:F0e,conversation:M0e,default:mQe,deployment:R0e,duration:E0e,errors:U0e,evaluation:B0e,expiry:C0e,framework:y0e,historyStatus:x0e,model:j0e,optimization:g0e,pendingInput:$0e,projects:b0e,questions:L0e,state:v0e,stopDialog:Q0e,task:w0e,transfer:k0e,upload:N0e,validation:S0e,verification:O0e,workspace:I0e},Symbol.toStringTag,{value:"Module"})),z0e={loading:"加载中…",searchLabel:"搜索{{label}}",searchPlaceholder:"搜索{{label}}",retry:"重试",noMatches:"没有匹配项",noOptions:"暂无可选项",selection:"{{label}}:{{value}}"},V0e={badge:"焕然一新",view:"查看新特性",title:"本次更新",defaultNotes:{multiRegion:"多地域智能体:并行加载北京与上海 Runtime,列表下滑即可继续加载。",switchAgent:"会话内切换:在输入框旁选择智能体,并直接开启一段新会话。",visualCanvas:"可视化执行画布:通过横向画布查看多智能体结构,并支持全屏浏览。"}},H0e={label:"新会话模式",agent:"智能体",skill:"技能定制",video:"视频创作"},q0e={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:"暂不可用"},W0e={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}}",wakingHint:"正在唤醒智能体,可能需要一些时间。"},K0e={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"},G0e={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}}秒"}},X0e={compactSelect:z0e,featureNotice:V0e,workspace:H0e,mode:q0e,agentPicker:W0e,skill:K0e,video:G0e},bQe=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:W0e,compactSelect:z0e,default:X0e,featureNotice:V0e,mode:q0e,skill:K0e,video:G0e,workspace:H0e},Symbol.toStringTag,{value:"Module"})),Y0e="审核中心",Z0e="审核资源类型",J0e="仅管理员可以访问审核中心",eve="搜索申请名称、提交人或版本",tve="审核状态",nve="{{count}} 条待审核",ive="共 {{count}} 条申请",rve={skill:"技能",agent:"智能体"},sve={all:"全部状态",pending:"待审核",approved:"已通过",returned:"已退回",approving:"发布中"},ove={application:"申请名称",submitter:"提交人",version:"版本",submittedAt:"提交时间",status:"状态",actions:"操作"},ave={details:"详情",detailsFor:"查看 {{name}} 的申请详情",approve:"通过",approveFor:"通过 {{name}} 的申请",return:"退回",returnFor:"退回 {{name}} 的申请",close:"关闭",backToDetails:"返回详情",confirmApprove:"确认通过",confirmReturn:"确认退回",clearFilters:"清除筛选",refresh:"刷新",cancel:"取消",resumeApproval:"继续发布"},lve={title:"暂无审核申请",description:"提交的审核申请会显示在这里",filteredTitle:"没有匹配的申请",filteredDescription:"试试其他关键词,或调整审核状态"},cve={title:"申请详情",sections:"申请详情内容",overview:"申请信息",files:"提交文件 · {{count}}",requestType:"申请类型",update:"版本更新",firstRelease:"首次发布",source:"来源",source_skill:"{{name}}的个人技能空间",source_agent:"{{name}}的开发环境",destination:"发布目标",destination_skill:"企业共享技能空间",destination_agent:"全员共享智能体",region:"区域",visibility:"发布后可见范围",shared:"全员可见",description:"功能说明",changes:"本次提交说明",example:"使用示例",history:"审核记录",submitted:"{{name}}提交申请",versionFixed:"仅审核本次提交的版本",instructions:"使用说明",filesTab:"提交文件",filesFailed:"加载提交文件失败",unknownAuthor:"未知申请人",reviewer:"审批人",reviewedAt:"审批时间",approved:"{{name}}通过申请",returned:"{{name}}退回申请",unknownReviewer:"未知审批人",approvedBy:"通过人",returnedBy:"退回人",comment:"审批评论",result:"审批结果",noHistory:"此技能尚未提交审核",pendingHint:"等待管理员审核",approvingHint:"管理员已确认通过,正在发布到企业共享空间",approving:"{{name}}确认通过,等待完成发布"},uve={failed:"待审核空间暂不可用",retry:"重试"},dve={approveTitle:"通过申请",returnTitle:"退回申请",approveDescription:"通过后,{{name}} 的 {{version}} 版本将在企业共享空间中向全员公开",returnDescription:"退回 {{name}} 的 {{version}} 版本,并向申请人说明原因",reason:"退回理由",reasonRequired:"请填写退回理由",reasonHelp:"最多 256 个字符,申请人可以看到此理由",saving:"处理中…",failed:"审批失败,请重试",approved:"{{name}} 已通过并公开",returned:"{{name}} 已退回",comment:"评论(可选)",commentHelp:"最多 256 个字符,申请人可以看到此评论"},fve={title:"AI 评分",points:"{{score}} 分",insufficient:"依据不足",status:{unscored:"尚未评分",not_requested:"尚未评分",queued:"等待评分",running:"评分中",completed:"已评分",failed:"评分失败"},loading:"加载评分…",starting:"正在提交评分…",loadFailed:"加载评分失败",retryFailed:"提交评分失败",failed:"评分未完成,请管理员重试",retry:"重新评分",start:"开始评分",reload:"重新加载",download:"下载 JSON",expand:"展开",collapse:"收起",hint:"评分针对本次提交版本,供人工审批参考",dimensions:{safety:"安全性",usability:"易用性",completeness:"完整性",reliability:"可靠性",maintainability:"可维护性"},risks:"风险提示",suggestions:"改进建议",model:"评分模型",rubric:"评分标准版本",time:"评分时间",severity:{low:"低风险",medium:"中风险",high:"高风险",critical:"严重风险"},coverage:"评审范围",coverageCount:"已评审 {{included}} / {{total}} 个文件",coverageIncomplete:"部分内容未纳入评审,评分依据不完整",omittedFile:"未评审 {{path}}:{{reason}}",truncatedFile:"仅评审部分内容 {{path}}:{{reason}}",originalError:"云端原始错误"},yQe={title:Y0e,category:Z0e,adminOnly:J0e,search:eve,filterStatus:tve,pendingCount:nve,total:ive,kind:rve,status:sve,columns:ove,actions:ave,empty:lve,detail:cve,space:uve,decision:dve,score:fve},vQe=Object.freeze(Object.defineProperty({__proto__:null,actions:ave,adminOnly:J0e,category:Z0e,columns:ove,decision:dve,default:yQe,detail:cve,empty:lve,filterStatus:tve,kind:rve,pendingCount:nve,score:fve,search:eve,space:uve,status:sve,title:Y0e,total:ive},Symbol.toStringTag,{value:"Module"})),hve={cancel:"取消",close:"关闭",retry:"重试",tryAgain:"重新尝试",closeDialog:"关闭{{title}}",agentFallback:"{{agent}} 智能体",unknownSource:"未知来源"},pve={terminalTitle:"终端",browserTitle:"沙箱浏览器",terminalSubtitle:"连接当前 AgentKit Session 的交互式终端",browserSubtitle:"在当前 AgentKit Session 中查看与操作浏览器",connecting:"正在连接…",connected:"已连接",notConnected:"尚未连接",opening:"正在打开 {{title}}",connectingSession:"工具正在连接当前 AgentKit Session。",openFailed:"{{title}} 打开失败"},mve={title:"恢复 Codex 对话",subtitle:"选择当前 Sandbox Session 中最近更新的 Thread",loading:"正在读取历史对话",loadFailed:"历史对话读取失败",empty:"暂无可恢复的对话"},gve={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 自动审查流程处理审批请求。"}}},bve={title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",absolutePath:"绝对路径",browse:"浏览",parent:"上一级",empty:"当前目录没有子目录",locked:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。",useDirectory:"使用此目录"},yve={fileTitle:"允许修改文件?",commandTitle:"允许执行命令?",subtitle:"Codex 正在等待你的决定",workingDirectory:"执行目录",decline:"拒绝",acceptOnce:"仅本次允许",acceptSession:"本会话允许"},vve={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:"发送",stopping:"正在确认停止…",resume:"恢复任务",steer:"追加要求",steerPlaceholder:"可继续追加要求,或随时停止任务…"},xve={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:"重新尝试"},wve={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:"推理输出"}},Ove={back:"返回智能体列表",subtitle:"{{agent}} 智能体详情",type:"智能体类型",status:"状态",createdBy:"创建人",snapshotStatus:"快照状态",toolType:"工具类型",createdAt:"创建时间",snapshotReason:"快照原因",expiresAt:"过期时间",snapshotId:"快照 ID",sessionId:"会话 ID",sourceSessionId:"来源 Session ID",delete:"删除智能体",waking:"唤醒中…",opening:"打开中…",wake:"唤醒智能体",open:"打开智能体",deleteTitle:"删除智能体?",deleteDescription:"将删除“{{name}}”及其保存的数据,此操作无法撤销。",deleting:"删除中…",confirmDelete:"确认删除",sleepingHint:"该智能体已休眠,进入时需要唤醒,可能需要一些时间。",wakingHint:"正在唤醒智能体,可能需要一些时间。",agentId:"智能体 ID"},kve={back:"返回智能体列表",createdBy:"创建人 {{creator}}",ariaLabel:"智能体工作区",main:"主界面",terminal:"终端",mainTitle:"{{agent}} 主界面",openingTerminal:"正在打开终端…",terminalTitle:"{{agent}} 终端"},Sve={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:"接力失败"}},yve={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 快捷命令"}},vve={label:"智能构建任务",queued:"构建任务已排队",running:"构建任务正在后台运行",recovering:"正在恢复构建任务",waiting_user:"构建任务需要继续处理",stopping:"正在停止构建任务",succeeded:"构建任务已完成",cancelled:"构建任务已停止",failed:"构建任务未完成",open:"返回任务",hide:"隐藏任务通知",reconnecting:"正在重新连接任务服务,已有任务继续保留。"},xve={common:ove,tool:ave,threads:lve,permissions:cve,workspace:uve,approval:dve,composer:fve,launch:hve,session:pve,agentDetails:mve,agentWorkspace:gve,handoff:bve,commands:yve,taskNotice:vve},hQe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:mve,agentWorkspace:gve,approval:dve,commands:yve,common:ove,composer:fve,default:xve,handoff:bve,launch:hve,permissions:cve,session:pve,taskNotice:vve,threads:lve,tool:ave,workspace:uve},Symbol.toStringTag,{value:"Module"})),wve={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。保留所有权利。"},Ove={title:"登录状态已过期",description:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。",waiting:"等待登录完成…",signInAgain:"重新登录"},kve={breadcrumbs:"面包屑",selectAgent:"选择 Agent",switchAgent:"切换智能体"},Sve={cancel:"取消",close:"关闭确认框"},pQe={login:wve,authExpired:Ove,navbar:kve,confirm:Sve},mQe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:Ove,confirm:Sve,default:pQe,login:wve,navbar:kve},Symbol.toStringTag,{value:"Module"})),Eve={defaultUser:"用户",shortcuts:"快捷入口",tryCli:"体验 AgentKit CLI",developerResources:"开发者资源",systemInfo:"系统信息",language:"语言",issueFeedback:"问题反馈",logout:"退出登录",roles:{admin:"管理员",developer:"开发者",user:"普通用户",super_admin:"超级管理员"}},Cve={home:"返回首页",expand:"展开侧边栏",collapse:"收起侧边栏",label:"主导航",newChat:"新会话",agents:"智能体",workspaces:"工作区",library:"资源库",cronjobs:"定时任务",automations:"自动化",users:"用户管理",administration:"管控",reviewCenter:"审核中心"},Tve={title:"历史会话",newConversation:"新会话",create:"新建会话",loading:"正在加载历史会话…",empty:"暂无会话",current:"当前",manage:"管理历史会话:{{title}}",more:"更多",delete:"删除",loadingMore:"加载中…",loadMore:"加载更多",evaluatingTitle:"正在自动评测",evaluating:"评测中",generating:"正在生成"},gQe={account:Eve,navigation:Cve,history:Tve},bQe=Object.freeze(Object.defineProperty({__proto__:null,account:Eve,default:gQe,history:Tve,navigation:Cve},Symbol.toStringTag,{value:"Module"})),Ave={placeholder:"请选择",collapseOptions:"收起模型选项",expandOptions:"展开模型选项",noOptions:"暂无可用选项",noMatches:"没有匹配项,可直接使用当前模型 ID"},_ve={unsupportedActivity:"不支持的 Skill 对话活动",ariaLabel:"Skill 生成对话"},jve={code:"错误码:{{code}}",type:"错误类型:{{type}}",representation:"异常表示:{{value}}",rawResponse:`服务端原始响应: -{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},Nve={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},Rve={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}} 个文件"},Ive={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:"所有方案均创建失败,可分别重试。"},Pve={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 失败"},Dve={configSelect:Ave,conversation:_ve,errorDetails:jve,fileTree:Nve,management:Rve,generation:Ive,api:Pve},yQe=Object.freeze(Object.defineProperty({__proto__:null,api:Pve,configSelect:Ave,conversation:_ve,default:Dve,errorDetails:jve,fileTree:Nve,generation:Ive,management:Rve},Symbol.toStringTag,{value:"Module"})),Mve={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:"无"},Lve={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},$ve={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 未配置用户池"},Fve={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 不匹配"}},Bve={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,不要重复填写镜像仓库路径。"}},Uve={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},Qve={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},zve={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},Vve={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:"当前没有可选择的自定义环境。"},Hve={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:"日志"},qve={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"},Wve={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 名称一致。"},Kve={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:"重新尝试"},Gve={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。"}},Xve={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:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",codeProjects:"代码项目"},Yve={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},Zve={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"}},Jve={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:"查看日志"},exe={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:"已删除"}},txe={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:"未知状态"},wakingHint:"正在唤醒智能体,可能需要一些时间。"},nxe={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:"未知"},sharedSpace:"企业共享空间",sharedDescription:"面向企业全员开放的技能,由管理员统一发布和维护",sharedVisibility:"全员可见",sharedPreparing:"正在准备共享空间",sharedLoadFailed:"共享空间加载失败",sharedEmpty:"暂无共享技能,管理员发布后会显示在这里",requestPublication:"申请公开",reviewSubmitting:"提交中…",reviewSubmitted:"已申请",reviewFailed:"申请公开失败",reviewStatusFailed:"审核状态加载失败",reviewRetry:"重新申请",reviewPending:"待审核",reviewApproving:"发布中",reviewApproved:"已公开",reviewReturned:"已退回",reviewHistory:"审核记录",skillDetailSections:"技能详情内容",versions:{title:"版本管理",refresh:"刷新",uploading:"上传中…",upload:"上传新版本",close:"关闭",hint:"新版本不会替换已公开版本,审核通过后才会公开;ZIP 中的技能名称需与原技能一致",loading:"正在加载版本…",loadFailed:"无法加载版本",filesFailed:"无法加载版本文件",uploadFailed:"上传新版本失败",submitFailed:"提交申请失败",retry:"重试",empty:"暂无版本",current:"当前版本",notSubmitted:"未申请公开",submitting:"提交中…",submit:"申请公开",processing:"版本状态:{{status}}",filesLoading:"正在加载文件…",filesEmpty:"暂无文件",history:"历史审核记录",shared:"已公开"},author:"作者",authorName:"作者:{{name}}"},ixe={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:"删除知识失败"}},vQe={common:Mve,agentKitPromo:Lve,systemInfo:$ve,agentWorkspace:Fve,environmentCenter:Bve,deploymentSelect:Uve,deploymentError:Qve,studioBuildProgress:zve,cloudEnvironment:Vve,githubCicd:Hve,feishuDeployment:qve,deploymentResources:Wve,studioUpdate:Kve,projectPreview:Gve,workspace:Xve,resourceCollection:Yve,skillSourcePicker:Zve,composer:Jve,agentSelector:exe,myAgents:txe,skillCenter:nxe,knowledge:ixe},xQe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:Lve,agentSelector:exe,agentWorkspace:Fve,cloudEnvironment:Vve,common:Mve,composer:Jve,default:vQe,deploymentError:Qve,deploymentResources:Wve,deploymentSelect:Uve,environmentCenter:Bve,feishuDeployment:qve,githubCicd:Hve,knowledge:ixe,myAgents:txe,projectPreview:Gve,resourceCollection:Yve,skillCenter:nxe,skillSourcePicker:Zve,studioBuildProgress:zve,studioUpdate:Kve,systemInfo:$ve,workspace:Xve},Symbol.toStringTag,{value:"Module"})),rxe="用户管理",sxe="{{count}} 位成员",oxe="用户",axe="角色",lxe="账号状态",cxe="最近登录",uxe="操作",dxe="更改角色",fxe="关闭",hxe="保存角色",pxe="正在保存…",mxe="取消",gxe="返回",bxe="用户池",yxe="火山引擎 Identity",vxe="搜索姓名、邮箱或用户 ID",xxe="搜索",wxe="筛选角色",Oxe="全部角色",kxe="刷新",Sxe="正在读取用户…",Exe="更新于 {{time}}",Cxe="已将 {{name}} 设置为{{role}}",Txe="重试",Axe="你",_xe="初始超级管理员",jxe="初始超级管理员受保护,不能在此降级",Nxe="保存后,对方刷新 Studio 即可使用新的权限",Rxe="角色需要重新确认",Ixe="没有匹配的用户",Pxe="尝试其他关键词或角色",Dxe="用户登录或加入当前用户池后会显示在这里",Mxe="共 {{count}} 位用户",Lxe="上一页",$xe="下一页",Fxe="尚未登录",Bxe="未提供",Uxe={super_admin:"超级管理员",admin:"管理员",developer:"开发者",user:"普通用户"},Qxe={super_admin:"管理所有资源,并管理用户和分配角色",admin:"管理 Studio 资源",developer:"开发智能体并管理自己的资源",user:"使用智能体和个人功能"},zxe={EXTERNAL_PROVIDER:"正常",CONFIRMED:"正常",NORMAL:"正常",ENABLED:"正常",ACTIVE:"正常",UNCONFIRMED:"待验证",DISABLED:"已停用",FORBIDDEN:"已禁用",LOCKED:"已锁定",SUSPENDED:"已暂停",FORCE_CHANGE_PASSWORD:"需要修改密码"},Vxe={request_failed:"请求未完成,请刷新列表确认当前状态后重试",invalid_response:"用户服务返回异常,请刷新后重试",identity_unavailable:"暂时无法访问 Identity,请稍后重试或检查服务权限",identity_resource_missing:"用户或用户池已不存在,请刷新列表",super_administrator_required:"只有超级管理员可以管理用户",sign_in_required:"请登录后重试",user_not_in_pool:"当前账号不属于此用户池",user_disabled:"当前账号已停用",protected_administrator:"不能降低初始超级管理员的权限",cannot_demote_self:"不能降低自己的超级管理员权限",role_change_conflict:"角色已发生变化,请关闭弹窗并刷新列表后重试",cross_origin_request:"请在当前 Studio 页面内修改角色"},wQe={title:rxe,memberCount:sxe,user:oxe,role:axe,status:lxe,lastLogin:cxe,actions:uxe,changeRole:dxe,close:fxe,save:hxe,saving:pxe,cancel:mxe,back:gxe,pool:bxe,volcengineIdentity:yxe,searchPlaceholder:vxe,search:xxe,filterRole:wxe,allRoles:Oxe,refresh:kxe,loading:Sxe,updatedAt:Exe,saved:Cxe,retry:Txe,you:Axe,initialAdministrator:_xe,protectedExplanation:jxe,effectiveAfterRefresh:Nxe,roleConflict:Rxe,noUsers:Ixe,tryAnotherSearch:Pxe,poolEmpty:Dxe,resultCount:Mxe,previous:Lxe,next:$xe,neverLoggedIn:Fxe,unknown:Bxe,roles:Uxe,descriptions:Qxe,states:zxe,errors:Vxe},OQe=Object.freeze(Object.defineProperty({__proto__:null,actions:uxe,allRoles:Oxe,back:gxe,cancel:mxe,changeRole:dxe,close:fxe,default:wQe,descriptions:Qxe,effectiveAfterRefresh:Nxe,errors:Vxe,filterRole:wxe,initialAdministrator:_xe,lastLogin:cxe,loading:Sxe,memberCount:sxe,neverLoggedIn:Fxe,next:$xe,noUsers:Ixe,pool:bxe,poolEmpty:Dxe,previous:Lxe,protectedExplanation:jxe,refresh:kxe,resultCount:Mxe,retry:Txe,role:axe,roleConflict:Rxe,roles:Uxe,save:hxe,saved:Cxe,saving:pxe,search:xxe,searchPlaceholder:vxe,states:zxe,status:lxe,title:rxe,tryAnotherSearch:Pxe,unknown:Bxe,updatedAt:Exe,user:oxe,volcengineIdentity:yxe,you:Axe},Symbol.toStringTag,{value:"Module"})),Hxe="网站集成",qxe="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",Wxe="返回自动化列表",Kxe="添加网站",Gxe="正在加载 Runtime",Xxe="选择 Runtime",Yxe="网站域名",Zxe="例如 xxxx.com 或 localhost:5173",Jxe="正在生成",ewe="生成 Token",twe="已添加网站",nwe="{{count}} 个",iwe="{{count}} 个",rwe="正在加载网站集成",swe="还没有网站集成",owe="选择 Runtime 并输入网站域名即可生成 Token",awe="引入方法",lwe="将下面代码放到网页的 body 结束标签前",cwe="已复制",uwe="复制代码",dwe="添加网站后会在这里生成引入代码。",fwe="确定删除 {{domain}} 的网站集成吗?",hwe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},pwe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},kQe={title:Hxe,description:qxe,backToAutomations:Wxe,addWebsite:Kxe,loadingRuntime:Gxe,selectRuntime:Xxe,websiteDomain:Yxe,domainPlaceholder:Zxe,generating:Jxe,generateToken:ewe,addedWebsites:twe,websiteCount_one:nwe,websiteCount_other:iwe,loadingIntegrations:rwe,delete:"删除",emptyTitle:swe,emptyDescription:owe,embedMethod:awe,embedInstructions:lwe,copied:cwe,copyCode:uwe,embedHint:dwe,confirmDelete:fwe,errors:hwe,widget:pwe},SQe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:Kxe,addedWebsites:twe,backToAutomations:Wxe,confirmDelete:fwe,copied:cwe,copyCode:uwe,default:kQe,description:qxe,domainPlaceholder:Zxe,embedHint:dwe,embedInstructions:lwe,embedMethod:awe,emptyDescription:owe,emptyTitle:swe,errors:hwe,generateToken:ewe,generating:Jxe,loadingIntegrations:rwe,loadingRuntime:Gxe,selectRuntime:Xxe,title:Hxe,websiteCount_one:nwe,websiteCount_other:iwe,websiteDomain:Yxe,widget:pwe},Symbol.toStringTag,{value:"Module"})),mwe={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:"下载产物失败"}},gwe={unknownSource:"未知来源",unknownCreator:"未知创建者"},bwe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},ywe={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:"查看和编辑项目源码"},vwe={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}}"},xwe={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}}界面预览"}},wwe={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},Owe={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:"(未命名)"},kwe={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 信息。"},Swe={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 环境。"},Ewe={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 终端"},Cwe={labels:{coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取",studio_write_artifact:"保存会话产物"},closeDialog:"关闭弹窗",title:"添加 Studio 工具",description:"由 Studio BFF 为 {{agentName}} 的当前会话执行,Runtime 无需预装",close:"关闭添加 Studio 工具",searchAria:"搜索 Studio 工具",searchPlaceholder:"搜索名称或工具标识",availableAria:"可用 Studio 工具",loading:"正在读取 Studio 工具…",noMatch:"没有匹配的 Studio 工具",remove:"移除",add:"添加"},Twe={artifactLibrary:mwe,resourceMetadata:gwe,artifactEdit:bwe,codeBrowser:ywe,search:vwe,developerResources:xwe,library:wwe,manageAgents:Owe,agentTopology:kwe,sessionEnvironment:Swe,agentKitCli:Ewe,studioTools:Cwe},EQe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:Ewe,agentTopology:kwe,artifactEdit:bwe,artifactLibrary:mwe,codeBrowser:ywe,default:Twe,developerResources:xwe,library:wwe,manageAgents:Owe,resourceMetadata:gwe,search:vwe,sessionEnvironment:Swe,studioTools:Cwe},Symbol.toStringTag,{value:"Module"})),D9=["zh-CN","en-US"],sC="en-US",Awe="agentkit.studio.locale",CQe={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function oC(e){if(!e)return null;const t=e.trim().replace(/_/g,"-").toLowerCase(),n=D9.find(i=>i.toLowerCase()===t);return n||(t==="zh"||t.startsWith("zh-")?"zh-CN":t==="en"||t.startsWith("en-")?"en-US":null)}function da(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 TQe(){if(typeof window>"u")return null;try{return oC(window.localStorage.getItem(Awe))}catch{return null}}function AQe(){if(typeof window>"u")return[];const e=window.navigator;return e?e.languages.length>0?e.languages:e.language?[e.language]:[]:[]}function _Qe(){const e=TQe();if(e)return e;for(const t of AQe()){const n=oC(t);if(n)return n}return sC}function jQe(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Awe,e)}catch{}}function _we(e){typeof document>"u"||(document.documentElement.lang=e,document.documentElement.dir=CQe[e].dir)}const $n=e=>typeof e=="string",K1=()=>{let e,t;const n=new Promise((i,r)=>{e=i,t=r});return n.resolve=e,n.reject=t,n},FM=e=>e==null?"":String(e),NQe=(e,t,n)=>{e.forEach(i=>{t[i]&&(n[i]=t[i])})},RQe=/###/g,KW=e=>e&&e.includes("###")?e.replace(RQe,"."):e,GW=e=>!e||$n(e),wk=(e,t,n)=>{const i=$n(t)?t.split("."):t;let r=0;for(;r{const{obj:i,k:r}=wk(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=wk(e,a,Object);for(;l.obj===void 0&&a.length;)s=`${a[a.length-1]}.${s}`,a=a.slice(0,a.length-1),l=wk(e,a,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${s}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${s}`]=n},IQe=(e,t,n,i)=>{const{obj:r,k:s}=wk(e,t,Object);r[s]=r[s]||[],r[s].push(n)},Pj=(e,t)=>{const{obj:n,k:i}=wk(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,i))return n[i]},PQe=(e,t,n)=>{const i=Pj(e,n);return i!==void 0?i:Pj(t,n)},jwe=(e,t,n)=>{for(const i in t)i!=="__proto__"&&i!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,i)?$n(e[i])||e[i]instanceof String||$n(t[i])||t[i]instanceof String?n&&(e[i]=t[i]):jwe(e[i],t[i],n):e[i]=t[i]);return e},sh=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),DQe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},MQe=e=>$n(e)?e.replace(/[&<>"'\/]/g,t=>DQe[t]):e;class LQe{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 $Qe=[" ",",","?","!",";"],FQe=new LQe(20),BQe=(e,t,n)=>{t=t||"",n=n||"";const i=$Qe.filter(a=>!t.includes(a)&&!n.includes(a));if(i.length===0)return!0;const r=FQe.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},x6=(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,"-"),UQe={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 Dj{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||UQe,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=>$n(s)?s.replace(/[\r\n\x00-\x1F\x7F]/g," "):s),$n(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Dj(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Dj(this.logger,t)}}var xf=new Dj;class hI{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):$n(i)&&s?l.push(...i.split(s)):l.push(i)));const c=Pj(this.data,l);return!c&&!n&&!i&&t.includes(".")&&(t=l[0],n=l[1],i=l.slice(2).join(".")),c||!a||!$n(i)?c:x6((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),XW(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)($n(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=Pj(this.data,l)||{};a.skipCopy||(i=JSON.parse(JSON.stringify(i))),r?jwe(c,i,s):c={...c,...i},XW(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 Nwe={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 Rwe=Symbol("i18next/PATH_KEY");function QQe(){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===Rwe?e:(e.push(r),n=Proxy.revocable(i,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Kb(e,t){const{[Rwe]:n}=e(QQe()),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 BM=e=>!$n(e)&&typeof e!="boolean"&&typeof e!="number";class Mj extends hI{constructor(t,n={}){super(),NQe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=xf.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=BM(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&&!BQe(t,i,r);if(a&&!l){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:$n(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:$n(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=Kb(t,{...this.options,...r})),Array.isArray(t)||(t=[String(t)]),t=t.map(N=>typeof N=="function"?Kb(N,{...this.options,...r}):String(N));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 m=this.resolve(t,r);let g=m==null?void 0:m.res;const b=(m==null?void 0:m.usedKey)||l,v=(m==null?void 0:m.exactUsedKey)||l,y=["[object Number]","[object Function]","[object RegExp]"],w=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,O=r.count!==void 0&&!$n(r.count),S=Mj.hasDefaultValue(r),k=O?this.pluralResolver.getSuffix(f,r.count,r):"",C=r.ordinal&&O?this.pluralResolver.getSuffix(f,r.count,{ordinal:!1}):"",E=O&&!r.ordinal&&r.count===0,R=E&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${k}`]||r[`defaultValue${C}`]||r.defaultValue;let A=g;x&&!g&&S&&(A=R);const j=BM(A),T=Object.prototype.toString.apply(A);if(x&&A&&j&&!y.includes(T)&&!($n(w)&&Array.isArray(A))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const N=this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,A,{...r,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return s?(m.res=N,m.usedParams=this.getUsedParamsDetails(r),m):N}if(a){const N=Array.isArray(A),_=N?[]:{},D=N?v:b;for(const M in A)if(Object.prototype.hasOwnProperty.call(A,M)){const P=`${D}${a}${M}`;S&&!g?_[M]=this.translate(P,{...r,defaultValue:BM(R)?R[M]:void 0,joinArrays:!1,ns:c}):_[M]=this.translate(P,{...r,joinArrays:!1,ns:c}),_[M]===P&&(_[M]=A[M])}g=_}}else if(x&&$n(w)&&Array.isArray(g))g=g.join(w),g&&(g=this.extendTranslation(g,t,r,i));else{let N=!1,_=!1;!this.isValidLookup(g)&&S&&(N=!0,g=R),this.isValidLookup(g)||(_=!0,g=l);const M=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&_?void 0:g,P=S&&R!==g&&this.options.updateMissing;if(_||N||P){if(this.logger.log(P?"updateKey":"missingKey",f,u,O&&!P?`${l}${this.pluralResolver.getSuffix(f,r.count,r)}`:l,P?R:g),a){const z=this.resolve(l,{...r,keySeparator:!1});z&&z.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 L=[];const B=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&B&&B[0])for(let z=0;z{var H;const q=S&&F!==g?F:M;this.options.missingKeyHandler?this.options.missingKeyHandler(z,u,K,q,P,r):(H=this.backendConnector)!=null&&H.saveMissing&&this.backendConnector.saveMissing(z,u,K,q,P,r),this.emit("missingKey",z,u,K,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?L.forEach(z=>{const K=this.pluralResolver.getSuffixes(z,r);E&&r[`defaultValue${this.options.pluralSeparator}zero`]&&!K.includes(`${this.options.pluralSeparator}zero`)&&K.push(`${this.options.pluralSeparator}zero`),K.forEach(F=>{I([z],l+F,r[`defaultValue${F}`]||R)})}):I(L,l,R))}g=this.extendTranslation(g,t,r,m,i),_&&g===l&&this.options.appendNamespaceToMissingKey&&(g=`${u}${d}${l}`),(_||N)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${l}`:l,N?g:void 0,r))}return s?(m.res=g,m.usedParams=this.getUsedParamsDetails(r),m):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=$n(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 m=t.match(this.interpolator.nestingRegexp);f=m&&m.length}let h=i.replace&&!$n(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 m=t.match(this.interpolator.nestingRegexp),g=m&&m.length;f(s==null?void 0:s[0])===m[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${n[0]}`),null):this.translate(...m,n),i)),i.interpolation&&this.interpolator.reset()}const a=i.postProcess||this.options.postProcess,l=$n(a)?[a]:a;return t!=null&&(l!=null&&l.length)&&i.applyPostProcessor!==!1&&(t=Nwe.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 $n(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(c=>typeof c=="function"?Kb(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&&!$n(n.count),m=h&&!n.ordinal&&n.count===0,g=n.context!==void 0&&($n(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,w;this.isValidLookup(i)||(l=v,!this.checkedLoadedFor[`${b[0]}-${v}`]&&((y=this.utils)!=null&&y.hasLoadedNamespace)&&!((w=this.utils)!=null&&w.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(x=>{var k;if(this.isValidLookup(i))return;a=x;const O=[d];if((k=this.i18nFormat)!=null&&k.addLookupKeys)this.i18nFormat.addLookupKeys(O,d,x,v,n);else{let C;h&&(C=this.pluralResolver.getSuffix(x,n.count,n));const E=`${this.options.pluralSeparator}zero`,R=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(n.ordinal&&C.startsWith(R)&&O.push(d+C.replace(R,this.options.pluralSeparator)),O.push(d+C),m&&O.push(d+E)),g){const A=`${d}${this.options.contextSeparator||"_"}${n.context}`;O.push(A),h&&(n.ordinal&&C.startsWith(R)&&O.push(A+C.replace(R,this.options.pluralSeparator)),O.push(A+C),m&&O.push(A+E))}}let S;for(;S=O.pop();)this.isValidLookup(i)||(s=S,i=this.getResource(x,v,S,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&&!$n(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 ZW{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=xf.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(t){if(t=kS(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=kS(t),!t||!t.includes("-"))return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if($n(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)),$n(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||$n(n),a=n===void 0&&typeof this.options.fallbackLng=="function",l=$n(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 $n(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))):$n(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 JW={zero:0,one:1,two:2,few:3,many:4,other:5},eK={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class zQe{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=xf.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const i=kS(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!"),eK;if(!t.match(/-|_/))return eK;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)=>JW[r]-JW[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 tK=(e,t,n,i=".",r=!0)=>{let s=PQe(e,t,n);return!s&&r&&$n(n)&&(s=x6(e,n,i),s===void 0&&(s=x6(t,n,i))),s},nK=e=>e.replace(/\$/g,"$$$$");class iK{constructor(t={}){var n;this.logger=xf.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:m,nestingSuffix:g,nestingSuffixEscaped:b,nestingOptionsSeparator:v,maxReplaces:y,alwaysFormat:w}=t.interpolation;this.escape=n!==void 0?n:MQe,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=s?sh(s):a||"{{",this.suffix=l?sh(l):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f?sh(f):"-",this.unescapeSuffix=this.unescapePrefix?"":d?sh(d):"",this.nestingPrefix=h?sh(h):m||sh("$t("),this.nestingSuffix=g?sh(g):b||sh(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=y||1e3,this.alwaysFormat=w!==void 0?w:!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 m;let s,a,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const w=tK(n,c,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,i,{...r,...n,interpolationkey:g}):w}const b=g.split(this.formatSeparator),v=b.shift().trim(),y=b.join(this.formatSeparator).trim();return this.format(tK(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=((m=r==null?void 0:r.interpolation)==null?void 0:m.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=$n(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!$n(a)&&!this.useRawValueToEscape&&(a=FM(a));const v=g.safeValue(a);if(t=t.replace(s[0],nK(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(`${sh(d)}[ ]*{`));let h=`{${f[1]}`;c=f[0],h=this.interpolate(h,a);const m=h.match(/'/g),g=h.match(/"/g);(((m==null?void 0:m.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&&!$n(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&&!$n(s))return s;$n(s)||(s=FM(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],nK(FM(s))),this.regexp.lastIndex=0}return t}}const VQe=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}},rK=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(kS(i),r),t[a]=l),l(n)}},HQe=e=>(t,n,i)=>e(kS(n),i)(t);class qQe{constructor(t={}){this.logger=xf.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const i=n.cacheInBuiltFormats?rK:HQe;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()]=rK(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}=VQe(u);if(this.formats[d]){let m=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;m=this.formats[d](c,b,{...f,...r,...g})}catch(g){this.logger.warn(g)}return m}else this.logger.warn(`there was no format function for ${d}`);return c},t)}}const WQe=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class KQe extends hI{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=xf.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=>{IQe(c.loaded,[s],a),WQe(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();$n(t)&&(t=this.languageUtils.toResolveHierarchy(t)),$n(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 m={...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,m):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,m)}!t||!t[0]||this.store.addResource(t[0],n,i,r)}}}const UM=()=>({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]),$n(e[1])&&(t.defaultValue=e[1]),$n(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}),sK=e=>($n(e.ns)&&(e.ns=[e.ns]),$n(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),$n(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),n2=()=>{},GQe=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Ok extends hI{constructor(t={},n){if(super(),this.options=sK(t),this.services={},this.logger=xf,this.modules={external:[]},GQe(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&&($n(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const i=UM();this.options={...i,...this.options,...sK(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?xf.init(r(this.modules.logger),this.options):xf.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=qQe;const d=new ZW(this.options);this.store=new YW(this.options.resources,this.options);const f=this.services;f.logger=xf,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new zQe(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 iK(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new KQe(r(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(h,...m)=>{this.emit(h,...m)}),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 Mj(this.services,this.options),this.translator.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,n||(n=n2),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=K1(),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=n2){var s,a;let i=n;const r=$n(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=K1();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=n2),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"&&Nwe.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=$n(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes($n(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=Kb(d.keyPrefix,h));const m=this.options.keySeparator||".";let g;return d.keyPrefix&&Array.isArray(l)?g=l.map(b=>(typeof b=="function"&&(b=Kb(b,h)),`${d.keyPrefix}${m}${b}`)):(typeof l=="function"&&(l=Kb(l,h)),g=d.keyPrefix?`${d.keyPrefix}${m}${l}`:l),this.t(g,d)};return $n(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=K1();return this.options.ns?($n(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=K1();$n(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 ZW(UM());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 Ok(t,n);return i.createInstance=Ok.createInstance,i}cloneInstance(t={},n=n2){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const r={...this.options,...t,isClone:!0},s=new Ok(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 YW(l,r),s.services.resourceStore=s.store}if(t.interpolation){const c={...UM().interpolation,...this.options.interpolation,...t.interpolation},u={...r,interpolation:c};s.services.interpolator=new iK(u)}return s.translator=new Mj(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 Dl=Ok.createInstance();Dl.createInstance;Dl.dir;Dl.init;Dl.loadResources;Dl.reloadResources;Dl.use;Dl.changeLanguage;Dl.getFixedT;Dl.t;Dl.exists;Dl.setDefaultNamespace;Dl.hasLoadedNamespace;Dl.loadNamespaces;Dl.loadLanguages;var Iwe={exports:{}},di={};/** +安装命令:{{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:"接力失败"}},Eve={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 快捷命令"}},Cve={label:"智能构建任务",queued:"构建任务已排队",running:"构建任务正在后台运行",recovering:"正在恢复构建任务",waiting_user:"构建任务需要继续处理",stopping:"正在停止构建任务",succeeded:"构建任务已完成",cancelled:"构建任务已停止",failed:"构建任务未完成",open:"返回任务",hide:"隐藏任务通知",reconnecting:"正在重新连接任务服务,已有任务继续保留。"},Tve={common:hve,tool:pve,threads:mve,permissions:gve,workspace:bve,approval:yve,composer:vve,launch:xve,session:wve,agentDetails:Ove,agentWorkspace:kve,handoff:Sve,commands:Eve,taskNotice:Cve},xQe=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:Ove,agentWorkspace:kve,approval:yve,commands:Eve,common:hve,composer:vve,default:Tve,handoff:Sve,launch:xve,permissions:gve,session:wve,taskNotice:Cve,threads:mve,tool:pve,workspace:bve},Symbol.toStringTag,{value:"Module"})),Ave={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。保留所有权利。"},_ve={title:"登录状态已过期",description:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。",waiting:"等待登录完成…",signInAgain:"重新登录"},jve={breadcrumbs:"面包屑",selectAgent:"选择 Agent",switchAgent:"切换智能体"},Nve={cancel:"取消",close:"关闭确认框"},wQe={login:Ave,authExpired:_ve,navbar:jve,confirm:Nve},OQe=Object.freeze(Object.defineProperty({__proto__:null,authExpired:_ve,confirm:Nve,default:wQe,login:Ave,navbar:jve},Symbol.toStringTag,{value:"Module"})),Rve={defaultUser:"用户",shortcuts:"快捷入口",tryCli:"体验 AgentKit CLI",developerResources:"开发者资源",systemInfo:"系统信息",language:"语言",issueFeedback:"问题反馈",logout:"退出登录",roles:{admin:"管理员",developer:"开发者",user:"普通用户",super_admin:"超级管理员"}},Ive={home:"返回首页",expand:"展开侧边栏",collapse:"收起侧边栏",label:"主导航",newChat:"新会话",agents:"智能体",workspaces:"工作区",library:"资源库",cronjobs:"定时任务",automations:"自动化",users:"用户管理",administration:"管控",reviewCenter:"审核中心"},Pve={title:"历史会话",newConversation:"新会话",create:"新建会话",loading:"正在加载历史会话…",empty:"暂无会话",current:"当前",manage:"管理历史会话:{{title}}",more:"更多",delete:"删除",loadingMore:"加载中…",loadMore:"加载更多",evaluatingTitle:"正在自动评测",evaluating:"评测中",generating:"正在生成"},kQe={account:Rve,navigation:Ive,history:Pve},SQe=Object.freeze(Object.defineProperty({__proto__:null,account:Rve,default:kQe,history:Pve,navigation:Ive},Symbol.toStringTag,{value:"Module"})),Dve={placeholder:"请选择",collapseOptions:"收起模型选项",expandOptions:"展开模型选项",noOptions:"暂无可用选项",noMatches:"没有匹配项,可直接使用当前模型 ID"},Mve={unsupportedActivity:"不支持的 Skill 对话活动",ariaLabel:"Skill 生成对话"},Lve={code:"错误码:{{code}}",type:"错误类型:{{type}}",representation:"异常表示:{{value}}",rawResponse:`服务端原始响应: +{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},$ve={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},Fve={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}} 个文件"},Bve={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:"所有方案均创建失败,可分别重试。"},Uve={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 失败"},Qve={configSelect:Dve,conversation:Mve,errorDetails:Lve,fileTree:$ve,management:Fve,generation:Bve,api:Uve},EQe=Object.freeze(Object.defineProperty({__proto__:null,api:Uve,configSelect:Dve,conversation:Mve,default:Qve,errorDetails:Lve,fileTree:$ve,generation:Bve,management:Fve},Symbol.toStringTag,{value:"Module"})),zve={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:"无"},Vve={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},Hve={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 未配置用户池"},qve={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 不匹配"}},Wve={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,不要重复填写镜像仓库路径。"}},Kve={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},Gve={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},Xve={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},Yve={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:"当前没有可选择的自定义环境。"},Zve={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:"日志"},Jve={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"},exe={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 名称一致。"},txe={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:"重新尝试"},nxe={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。"}},ixe={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:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",codeProjects:"代码项目"},rxe={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},sxe={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"}},oxe={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:"查看日志"},axe={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:"已删除"}},lxe={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:"未知状态"},wakingHint:"正在唤醒智能体,可能需要一些时间。"},cxe={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:"未知"},sharedSpace:"企业共享空间",sharedDescription:"面向企业全员开放的技能,由管理员统一发布和维护",sharedVisibility:"全员可见",sharedPreparing:"正在准备共享空间",sharedLoadFailed:"共享空间加载失败",sharedEmpty:"暂无共享技能,管理员发布后会显示在这里",requestPublication:"申请公开",reviewSubmitting:"提交中…",reviewSubmitted:"已申请",reviewFailed:"申请公开失败",reviewStatusFailed:"审核状态加载失败",reviewRetry:"重新申请",reviewPending:"待审核",reviewApproving:"发布中",reviewApproved:"已公开",reviewReturned:"已退回",reviewHistory:"审核记录",skillDetailSections:"技能详情内容",versions:{title:"版本管理",refresh:"刷新",uploading:"上传中…",upload:"上传新版本",close:"关闭",hint:"新版本不会替换已公开版本,审核通过后才会公开;ZIP 中的技能名称需与原技能一致",loading:"正在加载版本…",loadFailed:"无法加载版本",filesFailed:"无法加载版本文件",uploadFailed:"上传新版本失败",submitFailed:"提交申请失败",retry:"重试",empty:"暂无版本",current:"当前版本",notSubmitted:"未申请公开",submitting:"提交中…",submit:"申请公开",processing:"版本状态:{{status}}",filesLoading:"正在加载文件…",filesEmpty:"暂无文件",history:"历史审核记录",shared:"已公开"},author:"作者",authorName:"作者:{{name}}"},uxe={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:"删除知识失败"}},CQe={common:zve,agentKitPromo:Vve,systemInfo:Hve,agentWorkspace:qve,environmentCenter:Wve,deploymentSelect:Kve,deploymentError:Gve,studioBuildProgress:Xve,cloudEnvironment:Yve,githubCicd:Zve,feishuDeployment:Jve,deploymentResources:exe,studioUpdate:txe,projectPreview:nxe,workspace:ixe,resourceCollection:rxe,skillSourcePicker:sxe,composer:oxe,agentSelector:axe,myAgents:lxe,skillCenter:cxe,knowledge:uxe},TQe=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:Vve,agentSelector:axe,agentWorkspace:qve,cloudEnvironment:Yve,common:zve,composer:oxe,default:CQe,deploymentError:Gve,deploymentResources:exe,deploymentSelect:Kve,environmentCenter:Wve,feishuDeployment:Jve,githubCicd:Zve,knowledge:uxe,myAgents:lxe,projectPreview:nxe,resourceCollection:rxe,skillCenter:cxe,skillSourcePicker:sxe,studioBuildProgress:Xve,studioUpdate:txe,systemInfo:Hve,workspace:ixe},Symbol.toStringTag,{value:"Module"})),dxe="用户管理",fxe="{{count}} 位成员",hxe="用户",pxe="角色",mxe="账号状态",gxe="最近登录",bxe="操作",yxe="更改角色",vxe="关闭",xxe="保存角色",wxe="正在保存…",Oxe="取消",kxe="返回",Sxe="用户池",Exe="火山引擎 Identity",Cxe="搜索姓名、邮箱或用户 ID",Txe="搜索",Axe="筛选角色",_xe="全部角色",jxe="刷新",Nxe="正在读取用户…",Rxe="更新于 {{time}}",Ixe="已将 {{name}} 设置为{{role}}",Pxe="重试",Dxe="你",Mxe="初始超级管理员",Lxe="初始超级管理员受保护,不能在此降级",$xe="保存后,对方刷新 Studio 即可使用新的权限",Fxe="角色需要重新确认",Bxe="没有匹配的用户",Uxe="尝试其他关键词或角色",Qxe="用户登录或加入当前用户池后会显示在这里",zxe="共 {{count}} 位用户",Vxe="上一页",Hxe="下一页",qxe="尚未登录",Wxe="未提供",Kxe={super_admin:"超级管理员",admin:"管理员",developer:"开发者",user:"普通用户"},Gxe={super_admin:"管理所有资源,并管理用户和分配角色",admin:"管理 Studio 资源",developer:"开发智能体并管理自己的资源",user:"使用智能体和个人功能"},Xxe={EXTERNAL_PROVIDER:"正常",CONFIRMED:"正常",NORMAL:"正常",ENABLED:"正常",ACTIVE:"正常",UNCONFIRMED:"待验证",DISABLED:"已停用",FORBIDDEN:"已禁用",LOCKED:"已锁定",SUSPENDED:"已暂停",FORCE_CHANGE_PASSWORD:"需要修改密码"},Yxe={request_failed:"请求未完成,请刷新列表确认当前状态后重试",invalid_response:"用户服务返回异常,请刷新后重试",identity_unavailable:"暂时无法访问 Identity,请稍后重试或检查服务权限",identity_resource_missing:"用户或用户池已不存在,请刷新列表",super_administrator_required:"只有超级管理员可以管理用户",sign_in_required:"请登录后重试",user_not_in_pool:"当前账号不属于此用户池",user_disabled:"当前账号已停用",protected_administrator:"不能降低初始超级管理员的权限",cannot_demote_self:"不能降低自己的超级管理员权限",role_change_conflict:"角色已发生变化,请关闭弹窗并刷新列表后重试",cross_origin_request:"请在当前 Studio 页面内修改角色"},AQe={title:dxe,memberCount:fxe,user:hxe,role:pxe,status:mxe,lastLogin:gxe,actions:bxe,changeRole:yxe,close:vxe,save:xxe,saving:wxe,cancel:Oxe,back:kxe,pool:Sxe,volcengineIdentity:Exe,searchPlaceholder:Cxe,search:Txe,filterRole:Axe,allRoles:_xe,refresh:jxe,loading:Nxe,updatedAt:Rxe,saved:Ixe,retry:Pxe,you:Dxe,initialAdministrator:Mxe,protectedExplanation:Lxe,effectiveAfterRefresh:$xe,roleConflict:Fxe,noUsers:Bxe,tryAnotherSearch:Uxe,poolEmpty:Qxe,resultCount:zxe,previous:Vxe,next:Hxe,neverLoggedIn:qxe,unknown:Wxe,roles:Kxe,descriptions:Gxe,states:Xxe,errors:Yxe},_Qe=Object.freeze(Object.defineProperty({__proto__:null,actions:bxe,allRoles:_xe,back:kxe,cancel:Oxe,changeRole:yxe,close:vxe,default:AQe,descriptions:Gxe,effectiveAfterRefresh:$xe,errors:Yxe,filterRole:Axe,initialAdministrator:Mxe,lastLogin:gxe,loading:Nxe,memberCount:fxe,neverLoggedIn:qxe,next:Hxe,noUsers:Bxe,pool:Sxe,poolEmpty:Qxe,previous:Vxe,protectedExplanation:Lxe,refresh:jxe,resultCount:zxe,retry:Pxe,role:pxe,roleConflict:Fxe,roles:Kxe,save:xxe,saved:Ixe,saving:wxe,search:Txe,searchPlaceholder:Cxe,states:Xxe,status:mxe,title:dxe,tryAnotherSearch:Uxe,unknown:Wxe,updatedAt:Rxe,user:hxe,volcengineIdentity:Exe,you:Dxe},Symbol.toStringTag,{value:"Module"})),Zxe="网站集成",Jxe="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",ewe="返回自动化列表",twe="添加网站",nwe="正在加载 Runtime",iwe="选择 Runtime",rwe="网站域名",swe="例如 xxxx.com 或 localhost:5173",owe="正在生成",awe="生成 Token",lwe="已添加网站",cwe="{{count}} 个",uwe="{{count}} 个",dwe="正在加载网站集成",fwe="还没有网站集成",hwe="选择 Runtime 并输入网站域名即可生成 Token",pwe="引入方法",mwe="将下面代码放到网页的 body 结束标签前",gwe="已复制",bwe="复制代码",ywe="添加网站后会在这里生成引入代码。",vwe="确定删除 {{domain}} 的网站集成吗?",xwe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},wwe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},jQe={title:Zxe,description:Jxe,backToAutomations:ewe,addWebsite:twe,loadingRuntime:nwe,selectRuntime:iwe,websiteDomain:rwe,domainPlaceholder:swe,generating:owe,generateToken:awe,addedWebsites:lwe,websiteCount_one:cwe,websiteCount_other:uwe,loadingIntegrations:dwe,delete:"删除",emptyTitle:fwe,emptyDescription:hwe,embedMethod:pwe,embedInstructions:mwe,copied:gwe,copyCode:bwe,embedHint:ywe,confirmDelete:vwe,errors:xwe,widget:wwe},NQe=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:twe,addedWebsites:lwe,backToAutomations:ewe,confirmDelete:vwe,copied:gwe,copyCode:bwe,default:jQe,description:Jxe,domainPlaceholder:swe,embedHint:ywe,embedInstructions:mwe,embedMethod:pwe,emptyDescription:hwe,emptyTitle:fwe,errors:xwe,generateToken:awe,generating:owe,loadingIntegrations:dwe,loadingRuntime:nwe,selectRuntime:iwe,title:Zxe,websiteCount_one:cwe,websiteCount_other:uwe,websiteDomain:rwe,widget:wwe},Symbol.toStringTag,{value:"Module"})),Owe={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:"下载产物失败"}},kwe={unknownSource:"未知来源",unknownCreator:"未知创建者"},Swe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},Ewe={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:"查看和编辑项目源码"},Cwe={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}}"},Twe={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}}界面预览"}},Awe={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},_we={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:"(未命名)"},jwe={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 信息。"},Nwe={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 环境。"},Rwe={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 终端"},Iwe={labels:{coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取",studio_write_artifact:"保存会话产物"},closeDialog:"关闭弹窗",title:"添加 Studio 工具",description:"由 Studio BFF 为 {{agentName}} 的当前会话执行,Runtime 无需预装",close:"关闭添加 Studio 工具",searchAria:"搜索 Studio 工具",searchPlaceholder:"搜索名称或工具标识",availableAria:"可用 Studio 工具",loading:"正在读取 Studio 工具…",noMatch:"没有匹配的 Studio 工具",remove:"移除",add:"添加"},Pwe={artifactLibrary:Owe,resourceMetadata:kwe,artifactEdit:Swe,codeBrowser:Ewe,search:Cwe,developerResources:Twe,library:Awe,manageAgents:_we,agentTopology:jwe,sessionEnvironment:Nwe,agentKitCli:Rwe,studioTools:Iwe},RQe=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:Rwe,agentTopology:jwe,artifactEdit:Swe,artifactLibrary:Owe,codeBrowser:Ewe,default:Pwe,developerResources:Twe,library:Awe,manageAgents:_we,resourceMetadata:kwe,search:Cwe,sessionEnvironment:Nwe,studioTools:Iwe},Symbol.toStringTag,{value:"Module"})),D9=["zh-CN","en-US"],sC="en-US",Dwe="agentkit.studio.locale",IQe={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function oC(e){if(!e)return null;const t=e.trim().replace(/_/g,"-").toLowerCase(),n=D9.find(i=>i.toLowerCase()===t);return n||(t==="zh"||t.startsWith("zh-")?"zh-CN":t==="en"||t.startsWith("en-")?"en-US":null)}function ga(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 PQe(){if(typeof window>"u")return null;try{return oC(window.localStorage.getItem(Dwe))}catch{return null}}function DQe(){if(typeof window>"u")return[];const e=window.navigator;return e?e.languages.length>0?e.languages:e.language?[e.language]:[]:[]}function MQe(){const e=PQe();if(e)return e;for(const t of DQe()){const n=oC(t);if(n)return n}return sC}function LQe(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Dwe,e)}catch{}}function Mwe(e){typeof document>"u"||(document.documentElement.lang=e,document.documentElement.dir=IQe[e].dir)}const Un=e=>typeof e=="string",K1=()=>{let e,t;const n=new Promise((i,r)=>{e=i,t=r});return n.resolve=e,n.reject=t,n},BM=e=>e==null?"":String(e),$Qe=(e,t,n)=>{e.forEach(i=>{t[i]&&(n[i]=t[i])})},FQe=/###/g,KW=e=>e&&e.includes("###")?e.replace(FQe,"."):e,GW=e=>!e||Un(e),wk=(e,t,n)=>{const i=Un(t)?t.split("."):t;let r=0;for(;r{const{obj:i,k:r}=wk(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=wk(e,a,Object);for(;l.obj===void 0&&a.length;)s=`${a[a.length-1]}.${s}`,a=a.slice(0,a.length-1),l=wk(e,a,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${s}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${s}`]=n},BQe=(e,t,n,i)=>{const{obj:r,k:s}=wk(e,t,Object);r[s]=r[s]||[],r[s].push(n)},Dj=(e,t)=>{const{obj:n,k:i}=wk(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,i))return n[i]},UQe=(e,t,n)=>{const i=Dj(e,n);return i!==void 0?i:Dj(t,n)},Lwe=(e,t,n)=>{for(const i in t)i!=="__proto__"&&i!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,i)?Un(e[i])||e[i]instanceof String||Un(t[i])||t[i]instanceof String?n&&(e[i]=t[i]):Lwe(e[i],t[i],n):e[i]=t[i]);return e},sh=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),QQe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},zQe=e=>Un(e)?e.replace(/[&<>"'\/]/g,t=>QQe[t]):e;class VQe{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 HQe=[" ",",","?","!",";"],qQe=new VQe(20),WQe=(e,t,n)=>{t=t||"",n=n||"";const i=HQe.filter(a=>!t.includes(a)&&!n.includes(a));if(i.length===0)return!0;const r=qQe.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},x6=(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,"-"),KQe={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 Mj{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||KQe,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=>Un(s)?s.replace(/[\r\n\x00-\x1F\x7F]/g," "):s),Un(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Mj(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Mj(this.logger,t)}}var wf=new Mj;class pI{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):Un(i)&&s?l.push(...i.split(s)):l.push(i)));const c=Dj(this.data,l);return!c&&!n&&!i&&t.includes(".")&&(t=l[0],n=l[1],i=l.slice(2).join(".")),c||!a||!Un(i)?c:x6((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),XW(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)(Un(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=Dj(this.data,l)||{};a.skipCopy||(i=JSON.parse(JSON.stringify(i))),r?Lwe(c,i,s):c={...c,...i},XW(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 $we={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 Fwe=Symbol("i18next/PATH_KEY");function GQe(){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===Fwe?e:(e.push(r),n=Proxy.revocable(i,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Gb(e,t){const{[Fwe]:n}=e(GQe()),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 UM=e=>!Un(e)&&typeof e!="boolean"&&typeof e!="number";class Lj extends pI{constructor(t,n={}){super(),$Qe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=wf.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=UM(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&&!WQe(t,i,r);if(a&&!l){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:Un(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:Un(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=Gb(t,{...this.options,...r})),Array.isArray(t)||(t=[String(t)]),t=t.map(j=>typeof j=="function"?Gb(j,{...this.options,...r}):String(j));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 m=this.resolve(t,r);let g=m==null?void 0:m.res;const b=(m==null?void 0:m.usedKey)||l,v=(m==null?void 0:m.exactUsedKey)||l,y=["[object Number]","[object Function]","[object RegExp]"],w=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,O=r.count!==void 0&&!Un(r.count),S=Lj.hasDefaultValue(r),k=O?this.pluralResolver.getSuffix(f,r.count,r):"",C=r.ordinal&&O?this.pluralResolver.getSuffix(f,r.count,{ordinal:!1}):"",E=O&&!r.ordinal&&r.count===0,R=E&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${k}`]||r[`defaultValue${C}`]||r.defaultValue;let A=g;x&&!g&&S&&(A=R);const N=UM(A),T=Object.prototype.toString.apply(A);if(x&&A&&N&&!y.includes(T)&&!(Un(w)&&Array.isArray(A))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const j=this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,A,{...r,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return s?(m.res=j,m.usedParams=this.getUsedParamsDetails(r),m):j}if(a){const j=Array.isArray(A),_=j?[]:{},I=j?v:b;for(const D in A)if(Object.prototype.hasOwnProperty.call(A,D)){const P=`${I}${a}${D}`;S&&!g?_[D]=this.translate(P,{...r,defaultValue:UM(R)?R[D]:void 0,joinArrays:!1,ns:c}):_[D]=this.translate(P,{...r,joinArrays:!1,ns:c}),_[D]===P&&(_[D]=A[D])}g=_}}else if(x&&Un(w)&&Array.isArray(g))g=g.join(w),g&&(g=this.extendTranslation(g,t,r,i));else{let j=!1,_=!1;!this.isValidLookup(g)&&S&&(j=!0,g=R),this.isValidLookup(g)||(_=!0,g=l);const D=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&_?void 0:g,P=S&&R!==g&&this.options.updateMissing;if(_||j||P){if(this.logger.log(P?"updateKey":"missingKey",f,u,O&&!P?`${l}${this.pluralResolver.getSuffix(f,r.count,r)}`:l,P?R: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 L=[];const B=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&B&&B[0])for(let H=0;H{var Q;const q=S&&F!==g?F:D;this.options.missingKeyHandler?this.options.missingKeyHandler(H,u,K,q,P,r):(Q=this.backendConnector)!=null&&Q.saveMissing&&this.backendConnector.saveMissing(H,u,K,q,P,r),this.emit("missingKey",H,u,K,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?L.forEach(H=>{const K=this.pluralResolver.getSuffixes(H,r);E&&r[`defaultValue${this.options.pluralSeparator}zero`]&&!K.includes(`${this.options.pluralSeparator}zero`)&&K.push(`${this.options.pluralSeparator}zero`),K.forEach(F=>{M([H],l+F,r[`defaultValue${F}`]||R)})}):M(L,l,R))}g=this.extendTranslation(g,t,r,m,i),_&&g===l&&this.options.appendNamespaceToMissingKey&&(g=`${u}${d}${l}`),(_||j)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${l}`:l,j?g:void 0,r))}return s?(m.res=g,m.usedParams=this.getUsedParamsDetails(r),m):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=Un(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 m=t.match(this.interpolator.nestingRegexp);f=m&&m.length}let h=i.replace&&!Un(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 m=t.match(this.interpolator.nestingRegexp),g=m&&m.length;f(s==null?void 0:s[0])===m[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${n[0]}`),null):this.translate(...m,n),i)),i.interpolation&&this.interpolator.reset()}const a=i.postProcess||this.options.postProcess,l=Un(a)?[a]:a;return t!=null&&(l!=null&&l.length)&&i.applyPostProcessor!==!1&&(t=$we.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 Un(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(c=>typeof c=="function"?Gb(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&&!Un(n.count),m=h&&!n.ordinal&&n.count===0,g=n.context!==void 0&&(Un(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,w;this.isValidLookup(i)||(l=v,!this.checkedLoadedFor[`${b[0]}-${v}`]&&((y=this.utils)!=null&&y.hasLoadedNamespace)&&!((w=this.utils)!=null&&w.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(x=>{var k;if(this.isValidLookup(i))return;a=x;const O=[d];if((k=this.i18nFormat)!=null&&k.addLookupKeys)this.i18nFormat.addLookupKeys(O,d,x,v,n);else{let C;h&&(C=this.pluralResolver.getSuffix(x,n.count,n));const E=`${this.options.pluralSeparator}zero`,R=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(n.ordinal&&C.startsWith(R)&&O.push(d+C.replace(R,this.options.pluralSeparator)),O.push(d+C),m&&O.push(d+E)),g){const A=`${d}${this.options.contextSeparator||"_"}${n.context}`;O.push(A),h&&(n.ordinal&&C.startsWith(R)&&O.push(A+C.replace(R,this.options.pluralSeparator)),O.push(A+C),m&&O.push(A+E))}}let S;for(;S=O.pop();)this.isValidLookup(i)||(s=S,i=this.getResource(x,v,S,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&&!Un(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 ZW{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=wf.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(t){if(t=kS(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=kS(t),!t||!t.includes("-"))return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Un(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)),Un(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||Un(n),a=n===void 0&&typeof this.options.fallbackLng=="function",l=Un(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 Un(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))):Un(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 JW={zero:0,one:1,two:2,few:3,many:4,other:5},eK={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class XQe{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=wf.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const i=kS(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!"),eK;if(!t.match(/-|_/))return eK;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)=>JW[r]-JW[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 tK=(e,t,n,i=".",r=!0)=>{let s=UQe(e,t,n);return!s&&r&&Un(n)&&(s=x6(e,n,i),s===void 0&&(s=x6(t,n,i))),s},nK=e=>e.replace(/\$/g,"$$$$");class iK{constructor(t={}){var n;this.logger=wf.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:m,nestingSuffix:g,nestingSuffixEscaped:b,nestingOptionsSeparator:v,maxReplaces:y,alwaysFormat:w}=t.interpolation;this.escape=n!==void 0?n:zQe,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=s?sh(s):a||"{{",this.suffix=l?sh(l):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f?sh(f):"-",this.unescapeSuffix=this.unescapePrefix?"":d?sh(d):"",this.nestingPrefix=h?sh(h):m||sh("$t("),this.nestingSuffix=g?sh(g):b||sh(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=y||1e3,this.alwaysFormat=w!==void 0?w:!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 m;let s,a,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const w=tK(n,c,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,i,{...r,...n,interpolationkey:g}):w}const b=g.split(this.formatSeparator),v=b.shift().trim(),y=b.join(this.formatSeparator).trim();return this.format(tK(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=((m=r==null?void 0:r.interpolation)==null?void 0:m.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=Un(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!Un(a)&&!this.useRawValueToEscape&&(a=BM(a));const v=g.safeValue(a);if(t=t.replace(s[0],nK(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(`${sh(d)}[ ]*{`));let h=`{${f[1]}`;c=f[0],h=this.interpolate(h,a);const m=h.match(/'/g),g=h.match(/"/g);(((m==null?void 0:m.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&&!Un(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&&!Un(s))return s;Un(s)||(s=BM(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],nK(BM(s))),this.regexp.lastIndex=0}return t}}const YQe=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}},rK=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(kS(i),r),t[a]=l),l(n)}},ZQe=e=>(t,n,i)=>e(kS(n),i)(t);class JQe{constructor(t={}){this.logger=wf.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const i=n.cacheInBuiltFormats?rK:ZQe;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()]=rK(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}=YQe(u);if(this.formats[d]){let m=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;m=this.formats[d](c,b,{...f,...r,...g})}catch(g){this.logger.warn(g)}return m}else this.logger.warn(`there was no format function for ${d}`);return c},t)}}const eze=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class tze extends pI{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=wf.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=>{BQe(c.loaded,[s],a),eze(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();Un(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Un(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 m={...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,m):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,m)}!t||!t[0]||this.store.addResource(t[0],n,i,r)}}}const QM=()=>({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]),Un(e[1])&&(t.defaultValue=e[1]),Un(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}),sK=e=>(Un(e.ns)&&(e.ns=[e.ns]),Un(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Un(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),tA=()=>{},nze=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Ok extends pI{constructor(t={},n){if(super(),this.options=sK(t),this.services={},this.logger=wf,this.modules={external:[]},nze(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&&(Un(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0]));const i=QM();this.options={...i,...this.options,...sK(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?wf.init(r(this.modules.logger),this.options):wf.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=JQe;const d=new ZW(this.options);this.store=new YW(this.options.resources,this.options);const f=this.services;f.logger=wf,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new XQe(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 iK(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new tze(r(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(h,...m)=>{this.emit(h,...m)}),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 Lj(this.services,this.options),this.translator.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,n||(n=tA),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=K1(),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=tA){var s,a;let i=n;const r=Un(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=K1();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=tA),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"&&$we.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=Un(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(Un(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=Gb(d.keyPrefix,h));const m=this.options.keySeparator||".";let g;return d.keyPrefix&&Array.isArray(l)?g=l.map(b=>(typeof b=="function"&&(b=Gb(b,h)),`${d.keyPrefix}${m}${b}`)):(typeof l=="function"&&(l=Gb(l,h)),g=d.keyPrefix?`${d.keyPrefix}${m}${l}`:l),this.t(g,d)};return Un(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=K1();return this.options.ns?(Un(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=K1();Un(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 ZW(QM());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 Ok(t,n);return i.createInstance=Ok.createInstance,i}cloneInstance(t={},n=tA){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const r={...this.options,...t,isClone:!0},s=new Ok(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 YW(l,r),s.services.resourceStore=s.store}if(t.interpolation){const c={...QM().interpolation,...this.options.interpolation,...t.interpolation},u={...r,interpolation:c};s.services.interpolator=new iK(u)}return s.translator=new Lj(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 Ll=Ok.createInstance();Ll.createInstance;Ll.dir;Ll.init;Ll.loadResources;Ll.reloadResources;Ll.use;Ll.changeLanguage;Ll.getFixedT;Ll.t;Ll.exists;Ll.setDefaultNamespace;Ll.hasLoadedNamespace;Ll.loadNamespaces;Ll.loadLanguages;var Bwe={exports:{}},ui={};/** * @license React * react.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 M9=Symbol.for("react.transitional.element"),XQe=Symbol.for("react.portal"),YQe=Symbol.for("react.fragment"),ZQe=Symbol.for("react.strict_mode"),JQe=Symbol.for("react.profiler"),eze=Symbol.for("react.consumer"),tze=Symbol.for("react.context"),nze=Symbol.for("react.forward_ref"),ize=Symbol.for("react.suspense"),rze=Symbol.for("react.memo"),Pwe=Symbol.for("react.lazy"),sze=Symbol.for("react.activity"),oK=Symbol.iterator;function oze(e){return e===null||typeof e!="object"?null:(e=oK&&e[oK]||e["@@iterator"],typeof e=="function"?e:null)}var Dwe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Mwe=Object.assign,Lwe={};function jw(e,t,n){this.props=e,this.context=t,this.refs=Lwe,this.updater=n||Dwe}jw.prototype.isReactComponent={};jw.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")};jw.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function $we(){}$we.prototype=jw.prototype;function L9(e,t,n){this.props=e,this.context=t,this.refs=Lwe,this.updater=n||Dwe}var $9=L9.prototype=new $we;$9.constructor=L9;Mwe($9,jw.prototype);$9.isPureReactComponent=!0;var aK=Array.isArray;function w6(){}var ms={H:null,A:null,T:null,S:null},Fwe=Object.prototype.hasOwnProperty;function F9(e,t,n){var i=n.ref;return{$$typeof:M9,type:e,key:t,ref:i!==void 0?i:null,props:n}}function aze(e,t){return F9(e.type,t,e.props)}function B9(e){return typeof e=="object"&&e!==null&&e.$$typeof===M9}function lze(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var lK=/\/+/g;function QM(e,t){return typeof e=="object"&&e!==null&&e.key!=null?lze(""+e.key):t.toString(36)}function cze(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(w6,w6):(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 iv(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 M9:case XQe:a=!0;break;case Pwe:return a=e._init,iv(a(e._payload),t,n,i,r)}}if(a)return r=r(e),a=i===""?"."+QM(e,0):i,aK(r)?(n="",a!=null&&(n=a.replace(lK,"$&/")+"/"),iv(r,t,n,"",function(u){return u})):r!=null&&(B9(r)&&(r=aze(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(lK,"$&/")+"/")+a)),t.push(r)),1;a=0;var l=i===""?".":i+":";if(aK(e))for(var c=0;c<]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function uK(e){const t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(fze[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(hze);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 r2=/|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,pze=/<\/?([^\s]+?)[/\s>]/,mze=/^\s*$/,gze=/^(script|style)$/i,zO="\0",bze=Object.create(null);function Bwe(e){e.forEach(function(t){if(t.type==="text"){t.content=t.content.split(zO).join("<");return}if(t.type==="comment"){t.comment=t.comment.split(zO).join("<");return}for(const n in t.attrs){const i=t.attrs[n];typeof i=="string"&&i.indexOf(zO)>-1&&(t.attrs[n]=i.split(zO).join("<"))}t.children.length&&Bwe(t.children)})}function yze(e,t){const n=t&&t.components||bze,i=t&&t.allowedTags;let r=!1;if(i){const g=typeof i=="function"?i:function(w){return i.indexOf(w)>-1};let b="",v=0;r2.lastIndex=0;let y;for(;y=r2.exec(e);){const w=y[0];b+=e.slice(v,y.index);const x=w.match(pze);w.startsWith("",e}}function xze(e){return e.reduce(function(t,n){return t+Uwe("",n)},"")}var wze={parse:yze,stringify:xze};const p_=(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);cc(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)},dK={},Gv=(e,t,n,i)=>{cc(n)&&dK[n]||(cc(n)&&(dK[n]=new Date),p_(e,t,n,i))},Qwe=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},O6=(e,t,n)=>{e.loadNamespaces(t,Qwe(e,n))},fK=(e,t,n,i)=>{if(cc(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return O6(e,n,i);n.forEach(r=>{e.options.ns.indexOf(r)<0&&e.options.ns.push(r)}),e.loadLanguages(t,Qwe(e,i))},Oze=(e,t,n={})=>!t.languages||!t.languages.length?(Gv(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}}),cc=e=>typeof e=="string",Ph=e=>typeof e=="object"&&e!==null,kze=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Sze={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Eze=e=>Sze[e],zwe=e=>e.replace(kze,Eze);let k6={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:zwe,transDefaultProps:void 0};const Cze=(e={})=>{k6={...k6,...e}},U9=()=>k6;let Vwe;const Tze=e=>{Vwe=e},Q9=()=>Vwe,m_=(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},VO=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?fm(t):t},Aze=e=>Array.isArray(e)&&e.every(p.isValidElement),fm=e=>Array.isArray(e)?e:[e],_ze=(e,t)=>{const n={...t};return n.props={...t.props,...e.props},n},jze=e=>{const t={};if(!e)return t;const n=i=>{fm(i).forEach(s=>{cc(s)||(m_(s)?n(VO(s)):Ph(s)&&!p.isValidElement(s)&&Object.assign(t,s))})};return n(e),t},S6=(e,t,n,i)=>{if(!e)return"";let r="";const s=fm(e),a=t!=null&&t.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((l,c)=>{if(cc(l)){r+=`${l}`;return}if(p.isValidElement(l)){const{props:u,type:d}=l,f=Object.keys(u).length,h=a.indexOf(d)>-1,m=u.children;if(!m&&h&&!f){r+=`<${d}/>`;return}if(!m&&(!h||f)||u.i18nIsDynamicList){r+=`<${c}>`;return}if(h&&f<=1){const b=cc(m)?m:S6(m,t,n,i);r+=`<${d}>${b}`;return}const g=S6(m,t,n,i);r+=`<${c}>${g}`;return}if(l===null){p_(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:i});return}if(Ph(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}p_(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:i,child:l});return}p_(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:i,child:l})}),r},Nze=(e,t,n,i,r,s,a)=>{if(n==="")return[];const l=r.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(l.map(x=>`<${x}`).join("|")).test(n);if(!e&&!t&&!c&&!a)return[n];const u=t??{},d=x=>{fm(x).forEach(S=>{cc(S)||(m_(S)?d(VO(S)):Ph(S)&&!p.isValidElement(S)&&Object.assign(u,S))})};d(e);const f=Object.keys(u),h=x=>/^\d+$/.test(x)||l.indexOf(x)>-1||f.indexOf(x)>-1,m=wze.parse(`<0>${n}`,{allowedTags:h}),g={...u,...s},b=(x,O,S)=>{var E;const k=VO(x),C=y(k,O.children,S);return Aze(k)&&C.length===0||(E=x.props)!=null&&E.i18nIsDynamicList?k:C},v=(x,O,S,k,C)=>{x.dummy?(x.children=O,S.push(p.cloneElement(x,{key:k},C?void 0:O))):S.push(...p.Children.map([x],E=>{var A;if(E.type===p.Fragment||((A=E.props)==null?void 0:A.i18nIsDynamicList)!==void 0){const j={key:k};return E&&E.props&&Object.keys(E.props).forEach(T=>{T==="children"||T==="i18nIsDynamicList"||(j[T]=E.props[T])}),p.createElement(E.type,j,C?null:O)}const R={key:k};return E&&E.props&&Object.keys(E.props).forEach(j=>{j==="ref"||j==="children"||(R[j]=E.props[j])}),p.cloneElement(E,R,C?null:O)}))},y=(x,O,S)=>{const k=fm(x),C=fm(O),E={};return C.reduce((R,A,j)=>{var N,_;const T=((_=(N=A.children)==null?void 0:N[0])==null?void 0:_.content)&&i.services.interpolator.interpolate(A.children[0].content,g,i.language);if(A.type==="tag"){let D=k[parseInt(A.name,10)];!D&&t&&(D=t[A.name]),S.length===1&&!D&&(D=S[0][A.name]),D||(D={});const M={...A.attrs};a&&Object.keys(M).forEach(K=>{const F=M[K];cc(F)&&(M[K]=zwe(F))});const P=Object.keys(M).length!==0?_ze({props:M},D):D,L=p.isValidElement(P),B=L&&m_(A,!0)&&!A.voidElement,I=c&&Ph(P)&&P.dummy&&!L,z=Ph(t)&&Object.hasOwnProperty.call(t,A.name);if(cc(P)){const K=i.services.interpolator.interpolate(P,g,i.language);R.push(K)}else if(m_(P)||B){const K=b(P,A,S);v(P,K,R,j)}else if(I){const K=y(k,A.children,S);v(P,K,R,j)}else if(Number.isNaN(parseFloat(A.name)))if(z){const K=b(P,A,S);v(P,K,R,j,A.voidElement)}else if(r.transSupportBasicHtmlNodes&&l.indexOf(A.name)>-1)if(A.voidElement)R.push(p.createElement(A.name,{key:`${A.name}-${j}`}));else{const K=E[A.name]||0;E[A.name]=K+1;let F,q=0;for(let ne=0;ne`);else{const K=y(k,A.children,S);R.push(`<${A.name}>${K}`)}else if(Ph(P)&&!L){const K=A.children[0]?T:null;K&&R.push(K)}else v(P,T,R,j,A.children.length!==1||!T)}else if(A.type==="text"){const D=r.transWrapTextNodes,M=typeof r.unescape=="function"?r.unescape:U9().unescape,P=a?M(i.services.interpolator.interpolate(A.content,g,i.language)):i.services.interpolator.interpolate(A.content,g,i.language);D?R.push(p.createElement(D,{key:`${A.name}-${j}`},P)):R.push(P)}return R},[])},w=y([{dummy:!0,children:e||[]}],m,fm(e||[]));return VO(w[0])},Hwe=(e,t,n)=>{const i=e.key||t,r=p.cloneElement(e,{key:i});if(!r.props||!r.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return r;function s(){return p.createElement(p.Fragment,null,r)}return p.createElement(s,{key:i})},Rze=(e,t)=>e.map((n,i)=>Hwe(n,i,t)),Ize=(e,t)=>{const n={};return Object.keys(e).forEach(i=>{Object.assign(n,{[i]:Hwe(e[i],i,t)})}),n},Pze=(e,t,n,i)=>e?Array.isArray(e)?Rze(e,t):Ph(e)?Ize(e,t):(Gv(n,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:i}),null):null,Dze=e=>!Ph(e)||Array.isArray(e)?!1:Object.keys(e).reduce((t,n)=>t&&Number.isNaN(Number.parseFloat(n)),!0);function Mze({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,...m}){var I,z,K,F,q,H;const g=d||Q9();if(!g)return Gv(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)||(X=>X),v={...U9(),...(I=g.options)==null?void 0:I.react};let y=u||b.ns||((z=g.options)==null?void 0:z.defaultNS);y=cc(y)?[y]:y||["translation"];const{transDefaultProps:w}=v,x=w!=null&&w.tOptions?{...w.tOptions,...s}:s,O=h??(w==null?void 0:w.shouldUnescape),S=w!=null&&w.values?{...w.values,...a}:a,k=w!=null&&w.components?{...w.components,...c}:c,C=S6(e,v,g,i),E=l||(x==null?void 0:x.defaultValue)||C||v.transEmptyNodeValue||(typeof i=="function"?Kb(i):i),{hashTransKey:R}=v,A=i||(R?R(C||E):C||E);(F=(K=g.options)==null?void 0:K.interpolation)!=null&&F.defaultVariables?a=S&&Object.keys(S).length>0?{...S,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables}:a=S;const j=jze(e);j&&typeof j.count=="number"&&t===void 0&&(t=j.count);const T=a||t!==void 0&&!((H=(q=g.options)==null?void 0:q.interpolation)!=null&&H.alwaysFormat)||!e?x.interpolation:{interpolation:{...x.interpolation,prefix:"#$?",suffix:"?$#"}},N={...x,context:r||x.context,count:t,...a,...T,defaultValue:E,ns:y};let _=A?b(A,N):E;_===A&&E&&(_=E);const D=Pze(k,_,g,i);let M=D||e,P=null;Dze(D)&&(P=D,M=e);const L=Nze(M,P,_,g,v,N,O),B=n??v.defaultTransParent;return B?p.createElement(B,m,L):L}const Lze={type:"3rdParty",init(e){Cze(e.options.react),Tze(e)}},qwe=p.createContext();class $ze{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function Rx({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,...m}){var w;const{i18n:g,defaultNS:b}=p.useContext(qwe)||{},v=d||g||Q9(),y=f||(v==null?void 0:v.t.bind(v));return Mze({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||((w=v==null?void 0:v.options)==null?void 0:w.defaultNS),i18n:v,t:f,shouldUnescape:h,...m})}var Wwe={exports:{}},Kwe={};/** + */var M9=Symbol.for("react.transitional.element"),ize=Symbol.for("react.portal"),rze=Symbol.for("react.fragment"),sze=Symbol.for("react.strict_mode"),oze=Symbol.for("react.profiler"),aze=Symbol.for("react.consumer"),lze=Symbol.for("react.context"),cze=Symbol.for("react.forward_ref"),uze=Symbol.for("react.suspense"),dze=Symbol.for("react.memo"),Uwe=Symbol.for("react.lazy"),fze=Symbol.for("react.activity"),oK=Symbol.iterator;function hze(e){return e===null||typeof e!="object"?null:(e=oK&&e[oK]||e["@@iterator"],typeof e=="function"?e:null)}var Qwe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},zwe=Object.assign,Vwe={};function jw(e,t,n){this.props=e,this.context=t,this.refs=Vwe,this.updater=n||Qwe}jw.prototype.isReactComponent={};jw.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")};jw.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Hwe(){}Hwe.prototype=jw.prototype;function L9(e,t,n){this.props=e,this.context=t,this.refs=Vwe,this.updater=n||Qwe}var $9=L9.prototype=new Hwe;$9.constructor=L9;zwe($9,jw.prototype);$9.isPureReactComponent=!0;var aK=Array.isArray;function w6(){}var ys={H:null,A:null,T:null,S:null},qwe=Object.prototype.hasOwnProperty;function F9(e,t,n){var i=n.ref;return{$$typeof:M9,type:e,key:t,ref:i!==void 0?i:null,props:n}}function pze(e,t){return F9(e.type,t,e.props)}function B9(e){return typeof e=="object"&&e!==null&&e.$$typeof===M9}function mze(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var lK=/\/+/g;function zM(e,t){return typeof e=="object"&&e!==null&&e.key!=null?mze(""+e.key):t.toString(36)}function gze(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(w6,w6):(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 iv(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 M9:case ize:a=!0;break;case Uwe:return a=e._init,iv(a(e._payload),t,n,i,r)}}if(a)return r=r(e),a=i===""?"."+zM(e,0):i,aK(r)?(n="",a!=null&&(n=a.replace(lK,"$&/")+"/"),iv(r,t,n,"",function(u){return u})):r!=null&&(B9(r)&&(r=pze(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(lK,"$&/")+"/")+a)),t.push(r)),1;a=0;var l=i===""?".":i+":";if(aK(e))for(var c=0;c<]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function uK(e){const t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(vze[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(xze);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 iA=/|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,wze=/<\/?([^\s]+?)[/\s>]/,Oze=/^\s*$/,kze=/^(script|style)$/i,VO="\0",Sze=Object.create(null);function Wwe(e){e.forEach(function(t){if(t.type==="text"){t.content=t.content.split(VO).join("<");return}if(t.type==="comment"){t.comment=t.comment.split(VO).join("<");return}for(const n in t.attrs){const i=t.attrs[n];typeof i=="string"&&i.indexOf(VO)>-1&&(t.attrs[n]=i.split(VO).join("<"))}t.children.length&&Wwe(t.children)})}function Eze(e,t){const n=t&&t.components||Sze,i=t&&t.allowedTags;let r=!1;if(i){const g=typeof i=="function"?i:function(w){return i.indexOf(w)>-1};let b="",v=0;iA.lastIndex=0;let y;for(;y=iA.exec(e);){const w=y[0];b+=e.slice(v,y.index);const x=w.match(wze);w.startsWith("",e}}function Tze(e){return e.reduce(function(t,n){return t+Kwe("",n)},"")}var Aze={parse:Eze,stringify:Tze};const h_=(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);uc(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)},dK={},Gv=(e,t,n,i)=>{uc(n)&&dK[n]||(uc(n)&&(dK[n]=new Date),h_(e,t,n,i))},Gwe=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},O6=(e,t,n)=>{e.loadNamespaces(t,Gwe(e,n))},fK=(e,t,n,i)=>{if(uc(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return O6(e,n,i);n.forEach(r=>{e.options.ns.indexOf(r)<0&&e.options.ns.push(r)}),e.loadLanguages(t,Gwe(e,i))},_ze=(e,t,n={})=>!t.languages||!t.languages.length?(Gv(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}}),uc=e=>typeof e=="string",Ph=e=>typeof e=="object"&&e!==null,jze=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Nze={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Rze=e=>Nze[e],Xwe=e=>e.replace(jze,Rze);let k6={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Xwe,transDefaultProps:void 0};const Ize=(e={})=>{k6={...k6,...e}},U9=()=>k6;let Ywe;const Pze=e=>{Ywe=e},Q9=()=>Ywe,p_=(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},HO=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?hm(t):t},Dze=e=>Array.isArray(e)&&e.every(p.isValidElement),hm=e=>Array.isArray(e)?e:[e],Mze=(e,t)=>{const n={...t};return n.props={...t.props,...e.props},n},Lze=e=>{const t={};if(!e)return t;const n=i=>{hm(i).forEach(s=>{uc(s)||(p_(s)?n(HO(s)):Ph(s)&&!p.isValidElement(s)&&Object.assign(t,s))})};return n(e),t},S6=(e,t,n,i)=>{if(!e)return"";let r="";const s=hm(e),a=t!=null&&t.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((l,c)=>{if(uc(l)){r+=`${l}`;return}if(p.isValidElement(l)){const{props:u,type:d}=l,f=Object.keys(u).length,h=a.indexOf(d)>-1,m=u.children;if(!m&&h&&!f){r+=`<${d}/>`;return}if(!m&&(!h||f)||u.i18nIsDynamicList){r+=`<${c}>`;return}if(h&&f<=1){const b=uc(m)?m:S6(m,t,n,i);r+=`<${d}>${b}`;return}const g=S6(m,t,n,i);r+=`<${c}>${g}`;return}if(l===null){h_(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:i});return}if(Ph(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}h_(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:i,child:l});return}h_(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:i,child:l})}),r},$ze=(e,t,n,i,r,s,a)=>{if(n==="")return[];const l=r.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(l.map(x=>`<${x}`).join("|")).test(n);if(!e&&!t&&!c&&!a)return[n];const u=t??{},d=x=>{hm(x).forEach(S=>{uc(S)||(p_(S)?d(HO(S)):Ph(S)&&!p.isValidElement(S)&&Object.assign(u,S))})};d(e);const f=Object.keys(u),h=x=>/^\d+$/.test(x)||l.indexOf(x)>-1||f.indexOf(x)>-1,m=Aze.parse(`<0>${n}`,{allowedTags:h}),g={...u,...s},b=(x,O,S)=>{var E;const k=HO(x),C=y(k,O.children,S);return Dze(k)&&C.length===0||(E=x.props)!=null&&E.i18nIsDynamicList?k:C},v=(x,O,S,k,C)=>{x.dummy?(x.children=O,S.push(p.cloneElement(x,{key:k},C?void 0:O))):S.push(...p.Children.map([x],E=>{var A;if(E.type===p.Fragment||((A=E.props)==null?void 0:A.i18nIsDynamicList)!==void 0){const N={key:k};return E&&E.props&&Object.keys(E.props).forEach(T=>{T==="children"||T==="i18nIsDynamicList"||(N[T]=E.props[T])}),p.createElement(E.type,N,C?null:O)}const R={key:k};return E&&E.props&&Object.keys(E.props).forEach(N=>{N==="ref"||N==="children"||(R[N]=E.props[N])}),p.cloneElement(E,R,C?null:O)}))},y=(x,O,S)=>{const k=hm(x),C=hm(O),E={};return C.reduce((R,A,N)=>{var j,_;const T=((_=(j=A.children)==null?void 0:j[0])==null?void 0:_.content)&&i.services.interpolator.interpolate(A.children[0].content,g,i.language);if(A.type==="tag"){let I=k[parseInt(A.name,10)];!I&&t&&(I=t[A.name]),S.length===1&&!I&&(I=S[0][A.name]),I||(I={});const D={...A.attrs};a&&Object.keys(D).forEach(K=>{const F=D[K];uc(F)&&(D[K]=Xwe(F))});const P=Object.keys(D).length!==0?Mze({props:D},I):I,L=p.isValidElement(P),B=L&&p_(A,!0)&&!A.voidElement,M=c&&Ph(P)&&P.dummy&&!L,H=Ph(t)&&Object.hasOwnProperty.call(t,A.name);if(uc(P)){const K=i.services.interpolator.interpolate(P,g,i.language);R.push(K)}else if(p_(P)||B){const K=b(P,A,S);v(P,K,R,N)}else if(M){const K=y(k,A.children,S);v(P,K,R,N)}else if(Number.isNaN(parseFloat(A.name)))if(H){const K=b(P,A,S);v(P,K,R,N,A.voidElement)}else if(r.transSupportBasicHtmlNodes&&l.indexOf(A.name)>-1)if(A.voidElement)R.push(p.createElement(A.name,{key:`${A.name}-${N}`}));else{const K=E[A.name]||0;E[A.name]=K+1;let F,q=0;for(let ne=0;ne`);else{const K=y(k,A.children,S);R.push(`<${A.name}>${K}`)}else if(Ph(P)&&!L){const K=A.children[0]?T:null;K&&R.push(K)}else v(P,T,R,N,A.children.length!==1||!T)}else if(A.type==="text"){const I=r.transWrapTextNodes,D=typeof r.unescape=="function"?r.unescape:U9().unescape,P=a?D(i.services.interpolator.interpolate(A.content,g,i.language)):i.services.interpolator.interpolate(A.content,g,i.language);I?R.push(p.createElement(I,{key:`${A.name}-${N}`},P)):R.push(P)}return R},[])},w=y([{dummy:!0,children:e||[]}],m,hm(e||[]));return HO(w[0])},Zwe=(e,t,n)=>{const i=e.key||t,r=p.cloneElement(e,{key:i});if(!r.props||!r.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return r;function s(){return p.createElement(p.Fragment,null,r)}return p.createElement(s,{key:i})},Fze=(e,t)=>e.map((n,i)=>Zwe(n,i,t)),Bze=(e,t)=>{const n={};return Object.keys(e).forEach(i=>{Object.assign(n,{[i]:Zwe(e[i],i,t)})}),n},Uze=(e,t,n,i)=>e?Array.isArray(e)?Fze(e,t):Ph(e)?Bze(e,t):(Gv(n,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:i}),null):null,Qze=e=>!Ph(e)||Array.isArray(e)?!1:Object.keys(e).reduce((t,n)=>t&&Number.isNaN(Number.parseFloat(n)),!0);function zze({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,...m}){var M,H,K,F,q,Q;const g=d||Q9();if(!g)return Gv(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)||(X=>X),v={...U9(),...(M=g.options)==null?void 0:M.react};let y=u||b.ns||((H=g.options)==null?void 0:H.defaultNS);y=uc(y)?[y]:y||["translation"];const{transDefaultProps:w}=v,x=w!=null&&w.tOptions?{...w.tOptions,...s}:s,O=h??(w==null?void 0:w.shouldUnescape),S=w!=null&&w.values?{...w.values,...a}:a,k=w!=null&&w.components?{...w.components,...c}:c,C=S6(e,v,g,i),E=l||(x==null?void 0:x.defaultValue)||C||v.transEmptyNodeValue||(typeof i=="function"?Gb(i):i),{hashTransKey:R}=v,A=i||(R?R(C||E):C||E);(F=(K=g.options)==null?void 0:K.interpolation)!=null&&F.defaultVariables?a=S&&Object.keys(S).length>0?{...S,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables}:a=S;const N=Lze(e);N&&typeof N.count=="number"&&t===void 0&&(t=N.count);const T=a||t!==void 0&&!((Q=(q=g.options)==null?void 0:q.interpolation)!=null&&Q.alwaysFormat)||!e?x.interpolation:{interpolation:{...x.interpolation,prefix:"#$?",suffix:"?$#"}},j={...x,context:r||x.context,count:t,...a,...T,defaultValue:E,ns:y};let _=A?b(A,j):E;_===A&&E&&(_=E);const I=Uze(k,_,g,i);let D=I||e,P=null;Qze(I)&&(P=I,D=e);const L=$ze(D,P,_,g,v,j,O),B=n??v.defaultTransParent;return B?p.createElement(B,m,L):L}const Vze={type:"3rdParty",init(e){Ize(e.options.react),Pze(e)}},Jwe=p.createContext();class Hze{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function Rx({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,...m}){var w;const{i18n:g,defaultNS:b}=p.useContext(Jwe)||{},v=d||g||Q9(),y=f||(v==null?void 0:v.t.bind(v));return zze({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||((w=v==null?void 0:v.options)==null?void 0:w.defaultNS),i18n:v,t:f,shouldUnescape:h,...m})}var e1e={exports:{}},t1e={};/** * @license React * use-sync-external-store-shim.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. - */var Ix=p;function Fze(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Bze=typeof Object.is=="function"?Object.is:Fze,Uze=Ix.useState,Qze=Ix.useEffect,zze=Ix.useLayoutEffect,Vze=Ix.useDebugValue;function Hze(e,t){var n=t(),i=Uze({inst:{value:n,getSnapshot:t}}),r=i[0].inst,s=i[1];return zze(function(){r.value=n,r.getSnapshot=t,zM(r)&&s({inst:r})},[e,n,t]),Qze(function(){return zM(r)&&s({inst:r}),e(function(){zM(r)&&s({inst:r})})},[e]),Vze(n),n}function zM(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Bze(e,n)}catch{return!0}}function qze(e,t){return t()}var Wze=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?qze:Hze;Kwe.useSyncExternalStore=Ix.useSyncExternalStore!==void 0?Ix.useSyncExternalStore:Wze;Wwe.exports=Kwe;var pI=Wwe.exports;const Kze=(e,t)=>{if(cc(t))return t;if(Ph(t)&&cc(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},Gze={t:Kze,ready:!1},Xze=()=>()=>{},je=(e,t={})=>{var R,A,j;const{i18n:n}=t,{i18n:i,defaultNS:r}=p.useContext(qwe)||{},s=n||i||Q9();s&&!s.reportNamespaces&&(s.reportNamespaces=new $ze),s||Gv(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=p.useMemo(()=>{var T;return{...U9(),...(T=s==null?void 0:s.options)==null?void 0:T.react,...t}},[s,t]),{useSuspense:l,keyPrefix:c}=a,u=e||r||((R=s==null?void 0:s.options)==null?void 0:R.defaultNS),d=cc(u)?[u]:u||["translation"],f=p.useMemo(()=>d,d);(j=(A=s==null?void 0:s.reportNamespaces)==null?void 0:A.addUsedNamespaces)==null||j.call(A,f);const h=p.useRef(0),m=p.useCallback(T=>{if(!s)return Xze;const{bindI18n:N,bindI18nStore:_}=a,D=()=>{h.current+=1,T()};return N&&s.on(N,D),_&&s.store.on(_,D),()=>{N&&N.split(" ").forEach(M=>s.off(M,D)),_&&_.split(" ").forEach(M=>s.store.off(M,D))}},[s,a]),g=p.useRef(),b=p.useCallback(()=>{if(!s)return Gze;const T=!!(s.isInitialized||s.initializedStoreOnce)&&f.every(L=>Oze(L,s,a)),N=t.lng||s.language,_=h.current,D=g.current;if(D&&D.ready===T&&D.lng===N&&D.keyPrefix===c&&D.revision===_)return D;const P={t:s.getFixedT(N,a.nsMode==="fallback"?f:f[0],c,{scopeNs:f}),ready:T,lng:N,keyPrefix:c,revision:_};return g.current=P,P},[s,f,c,a,t.lng]),[v,y]=p.useState(0),{t:w,ready:x}=pI.useSyncExternalStore(m,b,b);p.useEffect(()=>{if(s&&!x&&!l){const T=()=>y(N=>N+1);t.lng?fK(s,t.lng,f,T):O6(s,f,T)}},[s,t.lng,f,x,l,v]);const O=s||{},S=p.useRef(null),k=p.useRef(),C=T=>{const N=Object.getOwnPropertyDescriptors(T);N.__original&&delete N.__original;const _=Object.create(Object.getPrototypeOf(T),N);if(!Object.prototype.hasOwnProperty.call(_,"__original"))try{Object.defineProperty(_,"__original",{value:T,writable:!1,enumerable:!1,configurable:!1})}catch{}return _},E=p.useMemo(()=>{const T=O,N=T==null?void 0:T.language;let _=T;T&&(S.current&&S.current.__original===T?k.current!==N?(_=C(T),S.current=_,k.current=N):_=S.current:(_=C(T),S.current=_,k.current=N));const D=!x&&!l?(...P)=>(Gv(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."),w(...P)):w,M=[D,_,x];return M.t=D,M.i18n=_,M.ready=x,M},[w,O,x,O.resolvedLanguage,O.language,O.languages]);if(s&&l&&!x){let T=!1;try{T=!1}catch{}throw T&&Gv(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(N=>{const _=()=>N();t.lng?fK(s,t.lng,f,_):O6(s,f,_)})}return E},Gwe=_Qe(),hn=Dl.createInstance();hn.use(Lze).init({resources:{"en-US":{adk:Wle,app:Xce,conversation:Cue},"zh-CN":{adk:P9,app:Zge,conversation:Abe}},lng:Gwe,fallbackLng:sC,supportedLngs:[...D9],defaultNS:"common",interpolation:{escapeValue:!1},initAsync:!1});_we(Gwe);hn.on("languageChanged",e=>{const t=oC(e)??sC;_we(t)});const Yze=Object.assign({"./resources/en-US/adk.json":pUe,"./resources/en-US/agentReviews.json":gUe,"./resources/en-US/app.json":bUe,"./resources/en-US/automations.json":yUe,"./resources/en-US/common.json":xUe,"./resources/en-US/conversation.json":wUe,"./resources/en-US/create.json":OUe,"./resources/en-US/cronjobs.json":SUe,"./resources/en-US/deepseek.json":CUe,"./resources/en-US/feedback.json":AUe,"./resources/en-US/migrations.json":jUe,"./resources/en-US/newChat.json":NUe,"./resources/en-US/reviews.json":IUe,"./resources/en-US/sandbox.json":PUe,"./resources/en-US/shell.json":MUe,"./resources/en-US/sidebar.json":$Ue,"./resources/en-US/skills.json":FUe,"./resources/en-US/ui.json":UUe,"./resources/en-US/users.json":zUe,"./resources/en-US/websiteIntegration.json":HUe,"./resources/en-US/workspaceTools.json":qUe,"./resources/zh-CN/adk.json":WUe,"./resources/zh-CN/agentReviews.json":GUe,"./resources/zh-CN/app.json":XUe,"./resources/zh-CN/automations.json":YUe,"./resources/zh-CN/common.json":JUe,"./resources/zh-CN/conversation.json":eQe,"./resources/zh-CN/create.json":tQe,"./resources/zh-CN/cronjobs.json":iQe,"./resources/zh-CN/deepseek.json":sQe,"./resources/zh-CN/feedback.json":aQe,"./resources/zh-CN/migrations.json":cQe,"./resources/zh-CN/newChat.json":uQe,"./resources/zh-CN/reviews.json":fQe,"./resources/zh-CN/sandbox.json":hQe,"./resources/zh-CN/shell.json":mQe,"./resources/zh-CN/sidebar.json":bQe,"./resources/zh-CN/skills.json":yQe,"./resources/zh-CN/ui.json":xQe,"./resources/zh-CN/users.json":OQe,"./resources/zh-CN/websiteIntegration.json":SQe,"./resources/zh-CN/workspaceTools.json":EQe});function Zze(){const e={};for(const[t,n]of Object.entries(Yze)){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(Zze()))for(const[n,i]of Object.entries(t??{}))hn.addResourceBundle(e,n,i,!0,!0);async function Jze(e){jQe(e),await hn.changeLanguage(e)}var Xwe={exports:{}},mI={},Ywe={exports:{}},Zwe={};/** + */var Ix=p;function qze(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Wze=typeof Object.is=="function"?Object.is:qze,Kze=Ix.useState,Gze=Ix.useEffect,Xze=Ix.useLayoutEffect,Yze=Ix.useDebugValue;function Zze(e,t){var n=t(),i=Kze({inst:{value:n,getSnapshot:t}}),r=i[0].inst,s=i[1];return Xze(function(){r.value=n,r.getSnapshot=t,VM(r)&&s({inst:r})},[e,n,t]),Gze(function(){return VM(r)&&s({inst:r}),e(function(){VM(r)&&s({inst:r})})},[e]),Yze(n),n}function VM(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Wze(e,n)}catch{return!0}}function Jze(e,t){return t()}var eVe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Jze:Zze;t1e.useSyncExternalStore=Ix.useSyncExternalStore!==void 0?Ix.useSyncExternalStore:eVe;e1e.exports=t1e;var mI=e1e.exports;const tVe=(e,t)=>{if(uc(t))return t;if(Ph(t)&&uc(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},nVe={t:tVe,ready:!1},iVe=()=>()=>{},_e=(e,t={})=>{var R,A,N;const{i18n:n}=t,{i18n:i,defaultNS:r}=p.useContext(Jwe)||{},s=n||i||Q9();s&&!s.reportNamespaces&&(s.reportNamespaces=new Hze),s||Gv(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=p.useMemo(()=>{var T;return{...U9(),...(T=s==null?void 0:s.options)==null?void 0:T.react,...t}},[s,t]),{useSuspense:l,keyPrefix:c}=a,u=e||r||((R=s==null?void 0:s.options)==null?void 0:R.defaultNS),d=uc(u)?[u]:u||["translation"],f=p.useMemo(()=>d,d);(N=(A=s==null?void 0:s.reportNamespaces)==null?void 0:A.addUsedNamespaces)==null||N.call(A,f);const h=p.useRef(0),m=p.useCallback(T=>{if(!s)return iVe;const{bindI18n:j,bindI18nStore:_}=a,I=()=>{h.current+=1,T()};return j&&s.on(j,I),_&&s.store.on(_,I),()=>{j&&j.split(" ").forEach(D=>s.off(D,I)),_&&_.split(" ").forEach(D=>s.store.off(D,I))}},[s,a]),g=p.useRef(),b=p.useCallback(()=>{if(!s)return nVe;const T=!!(s.isInitialized||s.initializedStoreOnce)&&f.every(L=>_ze(L,s,a)),j=t.lng||s.language,_=h.current,I=g.current;if(I&&I.ready===T&&I.lng===j&&I.keyPrefix===c&&I.revision===_)return I;const P={t:s.getFixedT(j,a.nsMode==="fallback"?f:f[0],c,{scopeNs:f}),ready:T,lng:j,keyPrefix:c,revision:_};return g.current=P,P},[s,f,c,a,t.lng]),[v,y]=p.useState(0),{t:w,ready:x}=mI.useSyncExternalStore(m,b,b);p.useEffect(()=>{if(s&&!x&&!l){const T=()=>y(j=>j+1);t.lng?fK(s,t.lng,f,T):O6(s,f,T)}},[s,t.lng,f,x,l,v]);const O=s||{},S=p.useRef(null),k=p.useRef(),C=T=>{const j=Object.getOwnPropertyDescriptors(T);j.__original&&delete j.__original;const _=Object.create(Object.getPrototypeOf(T),j);if(!Object.prototype.hasOwnProperty.call(_,"__original"))try{Object.defineProperty(_,"__original",{value:T,writable:!1,enumerable:!1,configurable:!1})}catch{}return _},E=p.useMemo(()=>{const T=O,j=T==null?void 0:T.language;let _=T;T&&(S.current&&S.current.__original===T?k.current!==j?(_=C(T),S.current=_,k.current=j):_=S.current:(_=C(T),S.current=_,k.current=j));const I=!x&&!l?(...P)=>(Gv(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."),w(...P)):w,D=[I,_,x];return D.t=I,D.i18n=_,D.ready=x,D},[w,O,x,O.resolvedLanguage,O.language,O.languages]);if(s&&l&&!x){let T=!1;try{T=!1}catch{}throw T&&Gv(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(j=>{const _=()=>j();t.lng?fK(s,t.lng,f,_):O6(s,f,_)})}return E},n1e=MQe(),mn=Ll.createInstance();mn.use(Vze).init({resources:{"en-US":{adk:Zle,app:tue,conversation:Nue},"zh-CN":{adk:P9,app:rbe,conversation:Pbe}},lng:n1e,fallbackLng:sC,supportedLngs:[...D9],defaultNS:"common",interpolation:{escapeValue:!1},initAsync:!1});Mwe(n1e);mn.on("languageChanged",e=>{const t=oC(e)??sC;Mwe(t)});const rVe=Object.assign({"./resources/en-US/adk.json":wUe,"./resources/en-US/agentReviews.json":kUe,"./resources/en-US/app.json":SUe,"./resources/en-US/automations.json":EUe,"./resources/en-US/common.json":TUe,"./resources/en-US/conversation.json":AUe,"./resources/en-US/create.json":_Ue,"./resources/en-US/cronjobs.json":NUe,"./resources/en-US/deepseek.json":IUe,"./resources/en-US/feedback.json":DUe,"./resources/en-US/migrations.json":LUe,"./resources/en-US/newChat.json":$Ue,"./resources/en-US/reviews.json":BUe,"./resources/en-US/sandbox.json":UUe,"./resources/en-US/shell.json":zUe,"./resources/en-US/sidebar.json":HUe,"./resources/en-US/skills.json":qUe,"./resources/en-US/ui.json":KUe,"./resources/en-US/users.json":XUe,"./resources/en-US/websiteIntegration.json":ZUe,"./resources/en-US/workspaceTools.json":JUe,"./resources/zh-CN/adk.json":eQe,"./resources/zh-CN/agentReviews.json":nQe,"./resources/zh-CN/app.json":iQe,"./resources/zh-CN/automations.json":rQe,"./resources/zh-CN/common.json":oQe,"./resources/zh-CN/conversation.json":aQe,"./resources/zh-CN/create.json":lQe,"./resources/zh-CN/cronjobs.json":uQe,"./resources/zh-CN/deepseek.json":fQe,"./resources/zh-CN/feedback.json":pQe,"./resources/zh-CN/migrations.json":gQe,"./resources/zh-CN/newChat.json":bQe,"./resources/zh-CN/reviews.json":vQe,"./resources/zh-CN/sandbox.json":xQe,"./resources/zh-CN/shell.json":OQe,"./resources/zh-CN/sidebar.json":SQe,"./resources/zh-CN/skills.json":EQe,"./resources/zh-CN/ui.json":TQe,"./resources/zh-CN/users.json":_Qe,"./resources/zh-CN/websiteIntegration.json":NQe,"./resources/zh-CN/workspaceTools.json":RQe});function sVe(){const e={};for(const[t,n]of Object.entries(rVe)){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(sVe()))for(const[n,i]of Object.entries(t??{}))mn.addResourceBundle(e,n,i,!0,!0);async function oVe(e){LQe(e),await mn.changeLanguage(e)}var i1e={exports:{}},gI={},r1e={exports:{}},s1e={};/** * @license React * scheduler.production.js * @@ -75,7 +75,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(M,P){var L=M.length;M.push(P);e:for(;0>>1,I=M[B];if(0>>1;Br(F,L))qr(H,F)?(M[B]=H,M[q]=L,B=q):(M[B]=F,M[K]=L,B=K);else if(qr(H,L))M[B]=H,M[q]=L,B=q;else break e}}return P}function r(M,P){var L=M.sortIndex-P.sortIndex;return L!==0?L:M.id-P.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,m=!1,g=!1,b=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function O(M){for(var P=n(u);P!==null;){if(P.callback===null)i(u);else if(P.startTime<=M)i(u),P.sortIndex=P.expirationTime,t(c,P);else break;P=n(u)}}function S(M){if(b=!1,O(M),!g)if(n(c)!==null)g=!0,k||(k=!0,T());else{var P=n(u);P!==null&&D(S,P.startTime-M)}}var k=!1,C=-1,E=5,R=-1;function A(){return v?!0:!(e.unstable_now()-RM&&A());){var B=f.callback;if(typeof B=="function"){f.callback=null,h=f.priorityLevel;var I=B(f.expirationTime<=M);if(M=e.unstable_now(),typeof I=="function"){f.callback=I,O(M),P=!0;break t}f===n(c)&&i(c),O(M)}else i(c);f=n(c)}if(f!==null)P=!0;else{var z=n(u);z!==null&&D(S,z.startTime-M),P=!1}}break e}finally{f=null,h=L,m=!1}P=void 0}}finally{P?T():k=!1}}}var T;if(typeof x=="function")T=function(){x(j)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,_=N.port2;N.port1.onmessage=j,T=function(){_.postMessage(null)}}else T=function(){y(j,0)};function D(M,P){C=y(function(){M(e.unstable_now())},P)}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(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125B?(M.sortIndex=L,t(u,M),n(c)===null&&M===n(u)&&(b?(w(C),C=-1):b=!0,D(S,L-B))):(M.sortIndex=I,t(c,M),g||m||(g=!0,k||(k=!0,T()))),M},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(M){var P=h;return function(){var L=h;h=P;try{return M.apply(this,arguments)}finally{h=L}}}})(Zwe);Ywe.exports=Zwe;var eVe=Ywe.exports,Jwe={exports:{}},Ml={};/** + */(function(e){function t(D,P){var L=D.length;D.push(P);e:for(;0>>1,M=D[B];if(0>>1;Br(F,L))qr(Q,F)?(D[B]=Q,D[q]=L,B=q):(D[B]=F,D[K]=L,B=K);else if(qr(Q,L))D[B]=Q,D[q]=L,B=q;else break e}}return P}function r(D,P){var L=D.sortIndex-P.sortIndex;return L!==0?L:D.id-P.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,m=!1,g=!1,b=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function O(D){for(var P=n(u);P!==null;){if(P.callback===null)i(u);else if(P.startTime<=D)i(u),P.sortIndex=P.expirationTime,t(c,P);else break;P=n(u)}}function S(D){if(b=!1,O(D),!g)if(n(c)!==null)g=!0,k||(k=!0,T());else{var P=n(u);P!==null&&I(S,P.startTime-D)}}var k=!1,C=-1,E=5,R=-1;function A(){return v?!0:!(e.unstable_now()-RD&&A());){var B=f.callback;if(typeof B=="function"){f.callback=null,h=f.priorityLevel;var M=B(f.expirationTime<=D);if(D=e.unstable_now(),typeof M=="function"){f.callback=M,O(D),P=!0;break t}f===n(c)&&i(c),O(D)}else i(c);f=n(c)}if(f!==null)P=!0;else{var H=n(u);H!==null&&I(S,H.startTime-D),P=!1}}break e}finally{f=null,h=L,m=!1}P=void 0}}finally{P?T():k=!1}}}var T;if(typeof x=="function")T=function(){x(N)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,_=j.port2;j.port1.onmessage=N,T=function(){_.postMessage(null)}}else T=function(){y(N,0)};function I(D,P){C=y(function(){D(e.unstable_now())},P)}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(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125B?(D.sortIndex=L,t(u,D),n(c)===null&&D===n(u)&&(b?(w(C),C=-1):b=!0,I(S,L-B))):(D.sortIndex=M,t(c,D),g||m||(g=!0,k||(k=!0,T()))),D},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(D){var P=h;return function(){var L=h;h=P;try{return D.apply(this,arguments)}finally{h=L}}}})(s1e);r1e.exports=s1e;var aVe=r1e.exports,o1e={exports:{}},$l={};/** * @license React * react-dom.production.js * @@ -83,7 +83,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 tVe=p;function e1e(e){var t="https://react.dev/errors/"+e;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t1e)}catch(e){console.error(e)}}t1e(),Jwe.exports=Ml;var si=Jwe.exports;/** + */var lVe=p;function a1e(e){var t="https://react.dev/errors/"+e;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l1e)}catch(e){console.error(e)}}l1e(),o1e.exports=$l;var ri=o1e.exports;/** * @license React * react-dom-client.production.js * @@ -91,15 +91,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 na=eVe,n1e=p,rVe=si;function xt(e){var t="https://react.dev/errors/"+e;if(1wv||(e.current=j6[wv],j6[wv]=null,wv--)}function ts(e,t){wv++,j6[wv]=e.current,e.current=t}var jf=zf(null),SS=zf(null),Pm=zf(null),Lj=zf(null);function $j(e,t){switch(ts(Pm,t),ts(SS,e),ts(jf,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?xG(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=xG(t),e=Ake(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}xa(jf),ts(jf,e)}function Px(){xa(jf),xa(SS),xa(Pm)}function N6(e){e.memoizedState!==null&&ts(Lj,e);var t=jf.current,n=Ake(t,e.type);t!==n&&(ts(SS,e),ts(jf,n))}function Fj(e){SS.current===e&&(xa(jf),xa(SS)),Lj.current===e&&(xa(Lj),DS._currentValue=Gb)}var VM,mK;function fb(e){if(VM===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);VM=t&&t[1]||"",mK=-1wv||(e.current=j6[wv],j6[wv]=null,wv--)}function ts(e,t){wv++,j6[wv]=e.current,e.current=t}var Nf=Vf(null),SS=Vf(null),Dm=Vf(null),$j=Vf(null);function Fj(e,t){switch(ts(Dm,t),ts(SS,e),ts(Nf,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?xG(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=xG(t),e=Dke(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ea(Nf),ts(Nf,e)}function Px(){Ea(Nf),Ea(SS),Ea(Dm)}function N6(e){e.memoizedState!==null&&ts($j,e);var t=Nf.current,n=Dke(t,e.type);t!==n&&(ts(SS,e),ts(Nf,n))}function Bj(e){SS.current===e&&(Ea(Nf),Ea(SS)),$j.current===e&&(Ea($j),DS._currentValue=Xb)}var HM,mK;function hb(e){if(HM===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);HM=t&&t[1]||"",mK=-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{HM=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?fb(n):""}function cVe(e,t){switch(e.tag){case 26:case 27:case 5:return fb(e.type);case 16:return fb("Lazy");case 13:return e.child!==t&&t!==null?fb("Suspense Fallback"):fb("Suspense");case 19:return fb("SuspenseList");case 0:case 15:return qM(e.type,!1);case 11:return qM(e.type.render,!1);case 1:return qM(e.type,!0);case 31:return fb("Activity");default:return""}}function gK(e){try{var t="",n=null;do t+=cVe(e,n),n=e,e=e.return;while(e);return t}catch(i){return` +`+c[i].replace(" at new "," at ");return e.displayName&&d.includes("")&&(d=d.replace("",e.displayName)),d}while(1<=i&&0<=r);break}}}finally{qM=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?hb(n):""}function gVe(e,t){switch(e.tag){case 26:case 27:case 5:return hb(e.type);case 16:return hb("Lazy");case 13:return e.child!==t&&t!==null?hb("Suspense Fallback"):hb("Suspense");case 19:return hb("SuspenseList");case 0:case 15:return WM(e.type,!1);case 11:return WM(e.type.render,!1);case 1:return WM(e.type,!0);case 31:return hb("Activity");default:return""}}function gK(e){try{var t="",n=null;do t+=gVe(e,n),n=e,e=e.return;while(e);return t}catch(i){return` Error generating stack: `+i.message+` -`+i.stack}}var R6=Object.prototype.hasOwnProperty,H9=na.unstable_scheduleCallback,WM=na.unstable_cancelCallback,uVe=na.unstable_shouldYield,dVe=na.unstable_requestPaint,Zc=na.unstable_now,fVe=na.unstable_getCurrentPriorityLevel,c1e=na.unstable_ImmediatePriority,u1e=na.unstable_UserBlockingPriority,Bj=na.unstable_NormalPriority,hVe=na.unstable_LowPriority,d1e=na.unstable_IdlePriority,pVe=na.log,mVe=na.unstable_setDisableYieldValue,lC=null,Jc=null;function wm(e){if(typeof pVe=="function"&&mVe(e),Jc&&typeof Jc.setStrictMode=="function")try{Jc.setStrictMode(lC,e)}catch{}}var eu=Math.clz32?Math.clz32:yVe,gVe=Math.log,bVe=Math.LN2;function yVe(e){return e>>>=0,e===0?32:31-(gVe(e)/bVe|0)|0}var o2=256,a2=262144,l2=4194304;function hb(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 bI(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=hb(i):(a&=l,a!==0?r=hb(a):n||(n=l&~e,n!==0&&(r=hb(n))))):(l=i&~s,l!==0?r=hb(l):a!==0?r=hb(a):n||(n=i&~e,n!==0&&(r=hb(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 cC(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function vVe(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 f1e(){var e=l2;return l2<<=1,!(l2&62914560)&&(l2=4194304),e}function KM(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function uC(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function xVe(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 CVe=/[\n"\\]/g;function ju(e){return e.replace(CVe,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function D6(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=""+Eu(t)):e.value!==""+Eu(t)&&(e.value=""+Eu(t)):a!=="submit"&&a!=="reset"||e.removeAttribute("value"),t!=null?M6(e,a,Eu(t)):n!=null?M6(e,a,Eu(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=""+Eu(l):e.removeAttribute("name")}function w1e(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)){P6(e);return}n=n!=null?""+Eu(n):"",t=t!=null?""+Eu(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),P6(e)}function M6(e,t,n){t==="number"&&Uj(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Yv(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"),$6=!1;if(np)try{var X1={};Object.defineProperty(X1,"passive",{get:function(){$6=!0}}),window.addEventListener("test",X1,X1),window.removeEventListener("test",X1,X1)}catch{$6=!1}var Om=null,Y9=null,y_=null;function C1e(){if(y_)return y_;var e,t=Y9,n=t.length,i,r="value"in Om?Om.value:Om.textContent,s=r.length;for(e=0;e=Sk),TK=" ",AK=!1;function A1e(e,t){switch(e){case"keyup":return eHe.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _1e(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Sv=!1;function nHe(e,t){switch(e){case"compositionend":return _1e(t);case"keypress":return t.which!==32?null:(AK=!0,TK);case"textInput":return e=t.data,e===TK&&AK?null:e;default:return null}}function iHe(e,t){if(Sv)return e==="compositionend"||!J9&&A1e(e,t)?(e=C1e(),y_=Y9=Om=null,Sv=!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=IK(n)}}function I1e(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?I1e(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function P1e(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Uj(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=Uj(e.document)}return t}function e7(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 dHe=np&&"documentMode"in document&&11>=document.documentMode,Ev=null,F6=null,Ck=null,B6=!1;function DK(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;B6||Ev==null||Ev!==Uj(i)||(i=Ev,"selectionStart"in i&&e7(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}),Ck&&TS(Ck,i)||(Ck=i,i=sN(F6,"onSelect"),0>=a,r-=a,wf=1<<32-eu(t)+r|n<E?(R=C,C=null):R=C.sibling;var A=h(y,C,x[E],O);if(A===null){C===null&&(C=R);break}e&&C&&A.alternate===null&&t(y,C),w=s(A,w,E),k===null?S=A:k.sibling=A,k=A,C=R}if(E===x.length)return n(y,C),Ki&&Eh(y,E),S;if(C===null){for(;EE?(R=C,C=null):R=C.sibling;var j=h(y,C,A.value,O);if(j===null){C===null&&(C=R);break}e&&C&&j.alternate===null&&t(y,C),w=s(j,w,E),k===null?S=j:k.sibling=j,k=j,C=R}if(A.done)return n(y,C),Ki&&Eh(y,E),S;if(C===null){for(;!A.done;E++,A=x.next())A=f(y,A.value,O),A!==null&&(w=s(A,w,E),k===null?S=A:k.sibling=A,k=A);return Ki&&Eh(y,E),S}for(C=i(C);!A.done;E++,A=x.next())A=m(C,y,E,A.value,O),A!==null&&(e&&A.alternate!==null&&C.delete(A.key===null?E:A.key),w=s(A,w,E),k===null?S=A:k.sibling=A,k=A);return e&&C.forEach(function(T){return t(y,T)}),Ki&&Eh(y,E),S}function v(y,w,x,O){if(typeof x=="object"&&x!==null&&x.type===xv&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case s2:e:{for(var S=x.key;w!==null;){if(w.key===S){if(S=x.type,S===xv){if(w.tag===7){n(y,w.sibling),O=r(w,x.props.children),O.return=y,y=O;break e}}else if(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===sm&&pb(S)===w.type){n(y,w.sibling),O=r(w,x.props),Z1(O,x),O.return=y,y=O;break e}n(y,w);break}else t(y,w);w=w.sibling}x.type===xv?(O=Xb(x.props.children,y.mode,O,x.key),O.return=y,y=O):(O=x_(x.type,x.key,x.props,null,y.mode,O),Z1(O,x),O.return=y,y=O)}return a(y);case HO:e:{for(S=x.key;w!==null;){if(w.key===S)if(w.tag===4&&w.stateNode.containerInfo===x.containerInfo&&w.stateNode.implementation===x.implementation){n(y,w.sibling),O=r(w,x.children||[]),O.return=y,y=O;break e}else{n(y,w);break}else t(y,w);w=w.sibling}O=i5(x,y.mode,O),O.return=y,y=O}return a(y);case sm:return x=pb(x),v(y,w,x,O)}if(qO(x))return g(y,w,x,O);if(G1(x)){if(S=G1(x),typeof S!="function")throw Error(xt(150));return x=S.call(x),b(y,w,x,O)}if(typeof x.then=="function")return v(y,w,f2(x),O);if(x.$$typeof===Dh)return v(y,w,d2(y,x),O);h2(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,w!==null&&w.tag===6?(n(y,w.sibling),O=r(w,x),O.return=y,y=O):(n(y,w),O=n5(x,y.mode,O),O.return=y,y=O),a(y)):n(y,w)}return function(y,w,x,O){try{jS=0;var S=v(y,w,x,O);return ex=null,S}catch(C){if(C===Pw||C===kI)throw C;var k=qc(29,C,null,y.mode);return k.lanes=O,k.return=y,k}finally{}}}var fy=G1e(!0),X1e=G1e(!1),om=!1;function c7(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function W6(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 Mm(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Lm(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,ur&2){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=zj(e),U1e(e,null,n),t}return OI(e,i,t,n),zj(e)}function Ak(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,p1e(e,n)}}function s5(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 K6=!1;function _k(){if(K6){var e=Jv;if(e!==null)throw e}}function jk(e,t,n,i){K6=!1;var r=e.updateQueue;om=!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,m=h!==l.lane;if(m?(Qi&h)===h:(i&h)===h){h!==0&&h===Lx&&(K6=!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=bs({},f,h);break e;case 2:om=!0}}h=l.callback,h!==null&&(e.flags|=64,m&&(e.flags|=8192),m=r.callbacks,m===null?r.callbacks=[h]:m.push(h))}else m={lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,a|=h;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;m=l,l=m.next,m.next=null,r.lastBaseUpdate=m,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),tg|=a,e.lanes=a,e.memoizedState=f}}function Y1e(e,t){if(typeof e!="function")throw Error(xt(191,e));e.call(t)}function Z1e(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;es?s:8;var a=zn.T,l={};zn.T=l,O7(e,!1,t,n);try{var c=r(),u=zn.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=xHe(c,i);Nk(e,t,d,tu(e))}else Nk(e,t,i,tu(e))}catch(f){Nk(e,t,{then:function(){},status:"rejected",reason:f},tu())}finally{dr.p=s,a!==null&&l.types!==null&&(a.types=l.types),zn.T=a}}function CHe(){}function J6(e,t,n,i){if(e.tag!==5)throw Error(xt(476));var r=kOe(e).queue;OOe(e,r,t,Gb,n===null?CHe:function(){return SOe(e),n(i)})}function kOe(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Gb,baseState:Gb,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rp,lastRenderedState:Gb},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rp,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function SOe(e){var t=kOe(e);t.next===null&&(t=e.alternate.memoizedState),Nk(e,t.next.queue,{},tu())}function w7(){return Ba(DS)}function EOe(){return vo().memoizedState}function COe(){return vo().memoizedState}function THe(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=tu();e=Mm(n);var i=Lm(t,e,n);i!==null&&(uc(i,t,n),Ak(i,t,n)),t={cache:o7()},e.payload=t;return}t=t.return}}function AHe(e,t,n){var i=tu();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},TI(e)?AOe(t,n):(n=n7(e,t,n,i),n!==null&&(uc(n,e,i),_Oe(n,t,i)))}function TOe(e,t,n){var i=tu();Nk(e,t,n,i)}function Nk(e,t,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(TI(e))AOe(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,lu(l,a))return OI(e,t,r,0),Wr===null&&wI(),!1}catch{}finally{}if(n=n7(e,t,r,i),n!==null)return uc(n,e,i),_Oe(n,t,i),!0}return!1}function O7(e,t,n,i){if(i={lane:2,revertLane:N7(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},TI(e)){if(t)throw Error(xt(479))}else t=n7(e,n,i,2),t!==null&&uc(t,e,2)}function TI(e){var t=e.alternate;return e===gi||t!==null&&t===gi}function AOe(e,t){tx=Gj=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function _Oe(e,t,n){if(n&4194048){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,p1e(e,n)}}var RS={readContext:Ba,use:EI,useCallback:Ks,useContext:Ks,useEffect:Ks,useImperativeHandle:Ks,useLayoutEffect:Ks,useInsertionEffect:Ks,useMemo:Ks,useReducer:Ks,useRef:Ks,useState:Ks,useDebugValue:Ks,useDeferredValue:Ks,useTransition:Ks,useSyncExternalStore:Ks,useId:Ks,useHostTransitionStatus:Ks,useFormState:Ks,useActionState:Ks,useOptimistic:Ks,useMemoCache:Ks,useCacheRefresh:Ks};RS.useEffectEvent=Ks;var jOe={readContext:Ba,use:EI,useCallback:function(e,t){return wl().memoizedState=[e,t===void 0?null:t],e},useContext:Ba,useEffect:XK,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,k_(4194308,4,bOe.bind(null,t,e),n)},useLayoutEffect:function(e,t){return k_(4194308,4,e,t)},useInsertionEffect:function(e,t){k_(4,2,e,t)},useMemo:function(e,t){var n=wl();t=t===void 0?null:t;var i=e();if(hy){wm(!0);try{e()}finally{wm(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=wl();if(n!==void 0){var r=n(t);if(hy){wm(!0);try{n(t)}finally{wm(!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=AHe.bind(null,gi,e),[i.memoizedState,e]},useRef:function(e){var t=wl();return e={current:e},t.memoizedState=e},useState:function(e){e=Y6(e);var t=e.queue,n=TOe.bind(null,gi,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:v7,useDeferredValue:function(e,t){var n=wl();return x7(n,e,t)},useTransition:function(){var e=Y6(!1);return e=OOe.bind(null,gi,e.queue,!0,!1),wl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=gi,r=wl();if(Ki){if(n===void 0)throw Error(xt(407));n=n()}else{if(n=t(),Wr===null)throw Error(xt(349));Qi&127||iOe(i,t,n)}r.memoizedState=n;var s={value:n,getSnapshot:t};return r.queue=s,XK(sOe.bind(null,i,s,e),[e]),i.flags|=2048,Fx(9,{destroy:void 0},rOe.bind(null,i,s,n,t),null),n},useId:function(){var e=wl(),t=Wr.identifierPrefix;if(Ki){var n=Of,i=wf;n=(i&~(1<<32-eu(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Xj++,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[La]=t,s[fc]=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(Ua(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&&ah(t)}}return ls(t),h5(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&ah(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(xt(166));if(e=Pm.current,R0(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,r=$a,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}e[La]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||Tke(e.nodeValue,n)),e||Jm(t,!0)}else e=oN(e).createTextNode(i),e[La]=t,t.stateNode=e}return ls(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=R0(t),n!==null){if(e===null){if(!i)throw Error(xt(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(xt(557));e[La]=t}else uy(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ls(t),e=!1}else n=r5(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Hc(t),t):(Hc(t),null);if(t.flags&128)throw Error(xt(558))}return ls(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=R0(t),i!==null&&i.dehydrated!==null){if(e===null){if(!r)throw Error(xt(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(xt(317));r[La]=t}else uy(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ls(t),r=!1}else r=r5(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Hc(t),t):(Hc(t),null)}return Hc(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),p2(t,t.updateQueue),ls(t),null);case 4:return Px(),e===null&&R7(t.stateNode.containerInfo),ls(t),null;case 10:return Qh(t.type),ls(t),null;case 19:if(xa(go),i=t.memoizedState,i===null)return ls(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)J1(i,!1);else{if(Ys!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Kj(e),s!==null){for(t.flags|=128,J1(i,!1),e=s.updateQueue,t.updateQueue=e,p2(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Q1e(n,e),n=n.sibling;return ts(go,go.current&1|2),Ki&&Eh(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Zc()>eN&&(t.flags|=128,r=!0,J1(i,!1),t.lanes=4194304)}else{if(!r)if(e=Kj(s),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,p2(t,e),J1(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Ki)return ls(t),null}else 2*Zc()-i.renderingStartTime>eN&&n!==536870912&&(t.flags|=128,r=!0,J1(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=Zc(),e.sibling=null,n=go.current,ts(go,r?n&1|2:n&1),Ki&&Eh(t,i.treeForkCount),e):(ls(t),null);case 22:case 23:return Hc(t),u7(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?n&536870912&&!(t.flags&128)&&(ls(t),t.subtreeFlags&6&&(t.flags|=8192)):ls(t),n=t.updateQueue,n!==null&&p2(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&&xa(Yb),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Qh(Po),ls(t),null;case 25:return null;case 30:return null}throw Error(xt(156,t.tag))}function IHe(e,t){switch(s7(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qh(Po),Px(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Fj(t),null;case 31:if(t.memoizedState!==null){if(Hc(t),t.alternate===null)throw Error(xt(340));uy()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Hc(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(xt(340));uy()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xa(go),null;case 4:return Px(),null;case 10:return Qh(t.type),null;case 22:case 23:return Hc(t),u7(),e!==null&&xa(Yb),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qh(Po),null;case 25:return null;default:return null}}function QOe(e,t){switch(s7(t),t.tag){case 3:Qh(Po),Px();break;case 26:case 27:case 5:Fj(t);break;case 4:Px();break;case 31:t.memoizedState!==null&&Hc(t);break;case 13:Hc(t);break;case 19:xa(go);break;case 10:Qh(t.type);break;case 22:case 23:Hc(t),u7(),e!==null&&xa(Yb);break;case 24:Qh(Po)}}function mC(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){Er(t,t.return,l)}}function eg(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){Er(r,c,d)}}}i=i.next}while(i!==s)}}catch(d){Er(t,t.return,d)}}function zOe(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Z1e(t,n)}catch(i){Er(e,e.return,i)}}}function VOe(e,t,n){n.props=py(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){Er(e,t,i)}}function Rk(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){Er(e,t,r)}}function kf(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){Er(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){Er(e,t,r)}else n.current=null}function HOe(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){Er(e,e.return,r)}}function p5(e,t,n){try{var i=e.stateNode;tqe(i,e.type,n,t),i[fc]=t}catch(r){Er(e,e.return,r)}}function qOe(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Tg(e.type)||e.tag===4}function m5(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||qOe(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&&Tg(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 r$(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=Mh));else if(i!==4&&(i===27&&Tg(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(r$(e,t,n),e=e.sibling;e!==null;)r$(e,t,n),e=e.sibling}function Jj(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&&Tg(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Jj(e,t,n),e=e.sibling;e!==null;)Jj(e,t,n),e=e.sibling}function WOe(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Ua(t,i,n),t[La]=e,t[fc]=n}catch(s){Er(e,e.return,s)}}var jh=!1,Io=!1,g5=!1,cG=typeof WeakSet=="function"?WeakSet:Set,fa=null;function PHe(e,t){if(e=e.containerInfo,d$=uN,e=P1e(e),e7(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 m;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),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===r&&(l=a),h===s&&++d===i&&(c=a),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(f$={focusedElem:e,selectionRange:n},uN=!1,fa=t;fa!==null;)if(t=fa,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,fa=e;else for(;fa!==null;){switch(t=fa,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"))),Ua(s,i,n),s[La]=e,pa(s),i=s;break e;case"link":var a=_G("link","href",r).get(i+(n.href||""));if(a){for(var l=0;lv&&(a=v,v=b,b=a);var y=PK(l,b),w=PK(l,v);if(y&&w&&(m.rangeCount!==1||m.anchorNode!==y.node||m.anchorOffset!==y.offset||m.focusNode!==w.node||m.focusOffset!==w.offset)){var x=f.createRange();x.setStart(y.node,y.offset),m.removeAllRanges(),b>v?(m.addRange(x),m.extend(w.node,w.offset)):(x.setEnd(w.node,w.offset),m.addRange(x))}}}}for(f=[],m=l;m=m.parentNode;)m.nodeType===1&&f.push({element:m,left:m.scrollLeft,top:m.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;ln?32:n,zn.T=null,n=a$,a$=null;var s=Fm,a=zh;if(Jo=0,Ux=Fm=null,zh=0,ur&6)throw Error(xt(331));var l=ur;if(ur|=4,rke(s.current),tke(s,s.current,a,n),ur=l,gC(0,!1),Jc&&typeof Jc.onPostCommitFiberRoot=="function")try{Jc.onPostCommitFiberRoot(lC,s)}catch{}return!0}finally{dr.p=r,zn.T=i,vke(e,t)}}function hG(e,t,n){t=Nu(n,t),t=t$(e.stateNode,t,2),e=Lm(e,t,2),e!==null&&(uC(e,2),Vf(e))}function Er(e,t,n){if(e.tag===3)hG(e,e,n);else for(;t!==null;){if(t.tag===3){hG(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&($m===null||!$m.has(i))){e=Nu(n,e),n=DOe(2),i=Lm(t,n,2),i!==null&&(MOe(n,i,t,e),uC(i,2),Vf(i));break}}t=t.return}}function y5(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new LHe;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)||(A7=!0,r.add(n),e=QHe.bind(null,e,t,n),t.then(e,e))}function QHe(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Wr===e&&(Qi&n)===n&&(Ys===4||Ys===3&&(Qi&62914560)===Qi&&300>Zc()-AI?!(ur&2)&&Qx(e,0):_7|=n,Bx===Qi&&(Bx=0)),Vf(e)}function wke(e,t){t===0&&(t=f1e()),e=zy(e,t),e!==null&&(uC(e,t),Vf(e))}function zHe(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),wke(e,n)}function VHe(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(xt(314))}i!==null&&i.delete(t),wke(e,n)}function HHe(e,t){return H9(e,t)}var iN=null,sv=null,c$=!1,rN=!1,v5=!1,Em=0;function Vf(e){e!==sv&&e.next===null&&(sv===null?iN=sv=e:sv=sv.next=e),rN=!0,c$||(c$=!0,WHe())}function gC(e,t){if(!v5&&rN){v5=!0;do for(var n=!1,i=iN;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-eu(42|e)+1)-1,s&=r&~(a&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,pG(i,s))}else s=Qi,s=bI(i,i===Wr?s:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),!(s&3)||cC(i,s)||(n=!0,pG(i,s));i=i.next}while(n);v5=!1}}function qHe(){Oke()}function Oke(){rN=c$=!1;var e=0;Em!==0&&iqe()&&(e=Em);for(var t=Zc(),n=null,i=iN;i!==null;){var r=i.next,s=kke(i,t);s===0?(i.next=null,n===null?iN=r:n.next=r,r===null&&(sv=n)):(n=i,(e!==0||s&3)&&(rN=!0)),i=r}Jo!==0&&Jo!==5||gC(e),Em!==0&&(Em=0)}function kke(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&&vG(f)&&(c=c.responseEnd,a+=d*(c"u"?null:document;function Rke(e,t,n){var i=Mw;if(i&&typeof t=="string"&&t){var r=ju(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),CG.has(r)||(CG.add(r),e={rel:e,crossOrigin:n,href:t},i.querySelector(r)===null&&(t=i.createElement("link"),Ua(t,"link",e),pa(t),i.head.appendChild(t)))}}function fqe(e){Op.D(e),Rke("dns-prefetch",e,null)}function hqe(e,t){Op.C(e,t),Rke("preconnect",e,t)}function pqe(e,t,n){Op.L(e,t,n);var i=Mw;if(i&&e&&t){var r='link[rel="preload"][as="'+ju(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+ju(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+ju(n.imageSizes)+'"]')):r+='[href="'+ju(e)+'"]';var s=r;switch(t){case"style":s=zx(e);break;case"script":s=Lw(e)}Gu.has(s)||(e=bs({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Gu.set(s,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(bC(s))||t==="script"&&i.querySelector(yC(s))||(t=i.createElement("link"),Ua(t,"link",e),pa(t),i.head.appendChild(t)))}}function mqe(e,t){Op.m(e,t);var n=Mw;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+ju(i)+'"][href="'+ju(e)+'"]',s=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Lw(e)}if(!Gu.has(s)&&(e=bs({rel:"modulepreload",href:e},t),Gu.set(s,e),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(yC(s)))return}i=n.createElement("link"),Ua(i,"link",e),pa(i),n.head.appendChild(i)}}}function gqe(e,t,n){Op.S(e,t,n);var i=Mw;if(i&&e){var r=Xv(i).hoistableStyles,s=zx(e);t=t||"default";var a=r.get(s);if(!a){var l={loading:0,preload:null};if(a=i.querySelector(bC(s)))l.loading=5;else{e=bs({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Gu.get(s))&&I7(e,n);var c=a=i.createElement("link");pa(c),Ua(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,T_(a,t,i)}a={type:"stylesheet",instance:a,count:1,state:l},r.set(s,a)}}}function bqe(e,t){Op.X(e,t);var n=Mw;if(n&&e){var i=Xv(n).hoistableScripts,r=Lw(e),s=i.get(r);s||(s=n.querySelector(yC(r)),s||(e=bs({src:e,async:!0},t),(t=Gu.get(r))&&P7(e,t),s=n.createElement("script"),pa(s),Ua(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function yqe(e,t){Op.M(e,t);var n=Mw;if(n&&e){var i=Xv(n).hoistableScripts,r=Lw(e),s=i.get(r);s||(s=n.querySelector(yC(r)),s||(e=bs({src:e,async:!0,type:"module"},t),(t=Gu.get(r))&&P7(e,t),s=n.createElement("script"),pa(s),Ua(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function TG(e,t,n,i){var r=(r=Pm.current)?aN(r):null;if(!r)throw Error(xt(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=zx(n.href),n=Xv(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=zx(n.href);var s=Xv(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(bC(e)))&&!s._p&&(a.instance=s,a.state.loading=5),Gu.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},Gu.set(e,n),s||vqe(r,e,n,a.state))),t&&i===null)throw Error(xt(528,""));return a}if(t&&i!==null)throw Error(xt(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Lw(n),n=Xv(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(xt(444,e))}}function zx(e){return'href="'+ju(e)+'"'}function bC(e){return'link[rel="stylesheet"]['+e+"]"}function Ike(e){return bs({},e,{"data-precedence":e.precedence,precedence:null})}function vqe(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}),Ua(t,"link",n),pa(t),e.head.appendChild(t))}function Lw(e){return'[src="'+ju(e)+'"]'}function yC(e){return"script[async]"+e}function AG(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+ju(n.href)+'"]');if(i)return t.instance=i,pa(i),i;var r=bs({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),pa(i),Ua(i,"style",r),T_(i,n.precedence,e),t.instance=i;case"stylesheet":r=zx(n.href);var s=e.querySelector(bC(r));if(s)return t.state.loading|=4,t.instance=s,pa(s),s;i=Ike(n),(r=Gu.get(r))&&I7(i,r),s=(e.ownerDocument||e).createElement("link"),pa(s);var a=s;return a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),Ua(s,"link",i),t.state.loading|=4,T_(s,n.precedence,e),t.instance=s;case"script":return s=Lw(n.src),(r=e.querySelector(yC(s)))?(t.instance=r,pa(r),r):(i=n,(r=Gu.get(s))&&(i=bs({},n),P7(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),pa(r),Ua(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(xt(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(i=t.instance,t.state.loading|=4,T_(i,n.precedence,e));return t.instance}function T_(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 xqe(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 Pke(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function wqe(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=zx(i.href),s=t.querySelector(bC(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=lN.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,pa(s);return}s=t.ownerDocument||t,i=Ike(i),(r=Gu.get(r))&&I7(i,r),s=s.createElement("link"),pa(s);var a=s;a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),Ua(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=lN.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var E5=0;function Oqe(e,t){return e.stylesheets&&e.count===0&&__(e,e.stylesheets),0E5?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function lN(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)__(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var cN=null;function __(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,cN=new Map,t.forEach(kqe,e),cN=null,lN.call(e))}function kqe(e,t){if(!(t.state.loading&4)){var n=cN.get(e);if(n)var i=n.get(null);else{n=new Map,cN.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(Qke)}catch(e){console.error(e)}}Qke(),Xwe.exports=mI;var Nqe=Xwe.exports;const Rqe=_w(Nqe),F7=p.createContext({});function II(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const PI=p.createContext(null),$S=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class Iqe extends p.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 Pqe({children:e,isPresent:t}){const n=p.useId(),i=p.useRef(null),r=p.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=p.useContext($S);return p.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 R6=Object.prototype.hasOwnProperty,H9=ra.unstable_scheduleCallback,KM=ra.unstable_cancelCallback,bVe=ra.unstable_shouldYield,yVe=ra.unstable_requestPaint,Yc=ra.unstable_now,vVe=ra.unstable_getCurrentPriorityLevel,g1e=ra.unstable_ImmediatePriority,b1e=ra.unstable_UserBlockingPriority,Uj=ra.unstable_NormalPriority,xVe=ra.unstable_LowPriority,y1e=ra.unstable_IdlePriority,wVe=ra.log,OVe=ra.unstable_setDisableYieldValue,lC=null,Zc=null;function Om(e){if(typeof wVe=="function"&&OVe(e),Zc&&typeof Zc.setStrictMode=="function")try{Zc.setStrictMode(lC,e)}catch{}}var Jc=Math.clz32?Math.clz32:EVe,kVe=Math.log,SVe=Math.LN2;function EVe(e){return e>>>=0,e===0?32:31-(kVe(e)/SVe|0)|0}var sA=256,oA=262144,aA=4194304;function pb(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 yI(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=pb(i):(a&=l,a!==0?r=pb(a):n||(n=l&~e,n!==0&&(r=pb(n))))):(l=i&~s,l!==0?r=pb(l):a!==0?r=pb(a):n||(n=i&~e,n!==0&&(r=pb(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 cC(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function CVe(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 v1e(){var e=aA;return aA<<=1,!(aA&62914560)&&(aA=4194304),e}function GM(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function uC(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function TVe(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 IVe=/[\n"\\]/g;function _u(e){return e.replace(IVe,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function D6(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=""+Su(t)):e.value!==""+Su(t)&&(e.value=""+Su(t)):a!=="submit"&&a!=="reset"||e.removeAttribute("value"),t!=null?M6(e,a,Su(t)):n!=null?M6(e,a,Su(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=""+Su(l):e.removeAttribute("name")}function A1e(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)){P6(e);return}n=n!=null?""+Su(n):"",t=t!=null?""+Su(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),P6(e)}function M6(e,t,n){t==="number"&&Qj(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Yv(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"),$6=!1;if(np)try{var X1={};Object.defineProperty(X1,"passive",{get:function(){$6=!0}}),window.addEventListener("test",X1,X1),window.removeEventListener("test",X1,X1)}catch{$6=!1}var km=null,Y9=null,b_=null;function I1e(){if(b_)return b_;var e,t=Y9,n=t.length,i,r="value"in km?km.value:km.textContent,s=r.length;for(e=0;e=Sk),TK=" ",AK=!1;function D1e(e,t){switch(e){case"keyup":return aHe.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function M1e(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Sv=!1;function cHe(e,t){switch(e){case"compositionend":return M1e(t);case"keypress":return t.which!==32?null:(AK=!0,TK);case"textInput":return e=t.data,e===TK&&AK?null:e;default:return null}}function uHe(e,t){if(Sv)return e==="compositionend"||!J9&&D1e(e,t)?(e=I1e(),b_=Y9=km=null,Sv=!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=IK(n)}}function B1e(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?B1e(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function U1e(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Qj(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=Qj(e.document)}return t}function e7(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 yHe=np&&"documentMode"in document&&11>=document.documentMode,Ev=null,F6=null,Ck=null,B6=!1;function DK(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;B6||Ev==null||Ev!==Qj(i)||(i=Ev,"selectionStart"in i&&e7(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}),Ck&&TS(Ck,i)||(Ck=i,i=oN(F6,"onSelect"),0>=a,r-=a,Of=1<<32-Jc(t)+r|n<E?(R=C,C=null):R=C.sibling;var A=h(y,C,x[E],O);if(A===null){C===null&&(C=R);break}e&&C&&A.alternate===null&&t(y,C),w=s(A,w,E),k===null?S=A:k.sibling=A,k=A,C=R}if(E===x.length)return n(y,C),Zi&&Eh(y,E),S;if(C===null){for(;EE?(R=C,C=null):R=C.sibling;var N=h(y,C,A.value,O);if(N===null){C===null&&(C=R);break}e&&C&&N.alternate===null&&t(y,C),w=s(N,w,E),k===null?S=N:k.sibling=N,k=N,C=R}if(A.done)return n(y,C),Zi&&Eh(y,E),S;if(C===null){for(;!A.done;E++,A=x.next())A=f(y,A.value,O),A!==null&&(w=s(A,w,E),k===null?S=A:k.sibling=A,k=A);return Zi&&Eh(y,E),S}for(C=i(C);!A.done;E++,A=x.next())A=m(C,y,E,A.value,O),A!==null&&(e&&A.alternate!==null&&C.delete(A.key===null?E:A.key),w=s(A,w,E),k===null?S=A:k.sibling=A,k=A);return e&&C.forEach(function(T){return t(y,T)}),Zi&&Eh(y,E),S}function v(y,w,x,O){if(typeof x=="object"&&x!==null&&x.type===xv&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case rA:e:{for(var S=x.key;w!==null;){if(w.key===S){if(S=x.type,S===xv){if(w.tag===7){n(y,w.sibling),O=r(w,x.props.children),O.return=y,y=O;break e}}else if(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===om&&mb(S)===w.type){n(y,w.sibling),O=r(w,x.props),Z1(O,x),O.return=y,y=O;break e}n(y,w);break}else t(y,w);w=w.sibling}x.type===xv?(O=Yb(x.props.children,y.mode,O,x.key),O.return=y,y=O):(O=v_(x.type,x.key,x.props,null,y.mode,O),Z1(O,x),O.return=y,y=O)}return a(y);case qO:e:{for(S=x.key;w!==null;){if(w.key===S)if(w.tag===4&&w.stateNode.containerInfo===x.containerInfo&&w.stateNode.implementation===x.implementation){n(y,w.sibling),O=r(w,x.children||[]),O.return=y,y=O;break e}else{n(y,w);break}else t(y,w);w=w.sibling}O=r5(x,y.mode,O),O.return=y,y=O}return a(y);case om:return x=mb(x),v(y,w,x,O)}if(WO(x))return g(y,w,x,O);if(G1(x)){if(S=G1(x),typeof S!="function")throw Error(wt(150));return x=S.call(x),b(y,w,x,O)}if(typeof x.then=="function")return v(y,w,dA(x),O);if(x.$$typeof===Dh)return v(y,w,uA(y,x),O);fA(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,w!==null&&w.tag===6?(n(y,w.sibling),O=r(w,x),O.return=y,y=O):(n(y,w),O=i5(x,y.mode,O),O.return=y,y=O),a(y)):n(y,w)}return function(y,w,x,O){try{jS=0;var S=v(y,w,x,O);return ex=null,S}catch(C){if(C===Pw||C===SI)throw C;var k=Hc(29,C,null,y.mode);return k.lanes=O,k.return=y,k}finally{}}}var hy=nOe(!0),iOe=nOe(!1),am=!1;function c7(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function W6(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 Lm(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function $m(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,gr&2){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=Vj(e),K1e(e,null,n),t}return kI(e,i,t,n),Vj(e)}function Ak(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,w1e(e,n)}}function o5(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 K6=!1;function _k(){if(K6){var e=Jv;if(e!==null)throw e}}function jk(e,t,n,i){K6=!1;var r=e.updateQueue;am=!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,m=h!==l.lane;if(m?(Wi&h)===h:(i&h)===h){h!==0&&h===Lx&&(K6=!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=xs({},f,h);break e;case 2:am=!0}}h=l.callback,h!==null&&(e.flags|=64,m&&(e.flags|=8192),m=r.callbacks,m===null?r.callbacks=[h]:m.push(h))}else m={lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,a|=h;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;m=l,l=m.next,m.next=null,r.lastBaseUpdate=m,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),ng|=a,e.lanes=a,e.memoizedState=f}}function rOe(e,t){if(typeof e!="function")throw Error(wt(191,e));e.call(t)}function sOe(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;es?s:8;var a=Kn.T,l={};Kn.T=l,O7(e,!1,t,n);try{var c=r(),u=Kn.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=THe(c,i);Nk(e,t,d,eu(e))}else Nk(e,t,i,eu(e))}catch(f){Nk(e,t,{then:function(){},status:"rejected",reason:f},eu())}finally{br.p=s,a!==null&&l.types!==null&&(a.types=l.types),Kn.T=a}}function IHe(){}function J6(e,t,n,i){if(e.tag!==5)throw Error(wt(476));var r=jOe(e).queue;_Oe(e,r,t,Xb,n===null?IHe:function(){return NOe(e),n(i)})}function jOe(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Xb,baseState:Xb,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rp,lastRenderedState:Xb},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rp,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function NOe(e){var t=jOe(e);t.next===null&&(t=e.alternate.memoizedState),Nk(e,t.next.queue,{},eu())}function w7(){return za(DS)}function ROe(){return Oo().memoizedState}function IOe(){return Oo().memoizedState}function PHe(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=eu();e=Lm(n);var i=$m(t,e,n);i!==null&&(dc(i,t,n),Ak(i,t,n)),t={cache:o7()},e.payload=t;return}t=t.return}}function DHe(e,t,n){var i=eu();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},AI(e)?DOe(t,n):(n=n7(e,t,n,i),n!==null&&(dc(n,e,i),MOe(n,t,i)))}function POe(e,t,n){var i=eu();Nk(e,t,n,i)}function Nk(e,t,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(AI(e))DOe(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,au(l,a))return kI(e,t,r,0),Wr===null&&OI(),!1}catch{}finally{}if(n=n7(e,t,r,i),n!==null)return dc(n,e,i),MOe(n,t,i),!0}return!1}function O7(e,t,n,i){if(i={lane:2,revertLane:N7(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},AI(e)){if(t)throw Error(wt(479))}else t=n7(e,n,i,2),t!==null&&dc(t,e,2)}function AI(e){var t=e.alternate;return e===mi||t!==null&&t===mi}function DOe(e,t){tx=Xj=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function MOe(e,t,n){if(n&4194048){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,w1e(e,n)}}var RS={readContext:za,use:CI,useCallback:Ys,useContext:Ys,useEffect:Ys,useImperativeHandle:Ys,useLayoutEffect:Ys,useInsertionEffect:Ys,useMemo:Ys,useReducer:Ys,useRef:Ys,useState:Ys,useDebugValue:Ys,useDeferredValue:Ys,useTransition:Ys,useSyncExternalStore:Ys,useId:Ys,useHostTransitionStatus:Ys,useFormState:Ys,useActionState:Ys,useOptimistic:Ys,useMemoCache:Ys,useCacheRefresh:Ys};RS.useEffectEvent=Ys;var LOe={readContext:za,use:CI,useCallback:function(e,t){return kl().memoizedState=[e,t===void 0?null:t],e},useContext:za,useEffect:XK,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,O_(4194308,4,SOe.bind(null,t,e),n)},useLayoutEffect:function(e,t){return O_(4194308,4,e,t)},useInsertionEffect:function(e,t){O_(4,2,e,t)},useMemo:function(e,t){var n=kl();t=t===void 0?null:t;var i=e();if(py){Om(!0);try{e()}finally{Om(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=kl();if(n!==void 0){var r=n(t);if(py){Om(!0);try{n(t)}finally{Om(!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=DHe.bind(null,mi,e),[i.memoizedState,e]},useRef:function(e){var t=kl();return e={current:e},t.memoizedState=e},useState:function(e){e=Y6(e);var t=e.queue,n=POe.bind(null,mi,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:v7,useDeferredValue:function(e,t){var n=kl();return x7(n,e,t)},useTransition:function(){var e=Y6(!1);return e=_Oe.bind(null,mi,e.queue,!0,!1),kl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=mi,r=kl();if(Zi){if(n===void 0)throw Error(wt(407));n=n()}else{if(n=t(),Wr===null)throw Error(wt(349));Wi&127||uOe(i,t,n)}r.memoizedState=n;var s={value:n,getSnapshot:t};return r.queue=s,XK(fOe.bind(null,i,s,e),[e]),i.flags|=2048,Fx(9,{destroy:void 0},dOe.bind(null,i,s,n,t),null),n},useId:function(){var e=kl(),t=Wr.identifierPrefix;if(Zi){var n=kf,i=Of;n=(i&~(1<<32-Jc(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Yj++,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[Ba]=t,s[hc]=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(Va(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&&ah(t)}}return ds(t),p5(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&ah(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(wt(166));if(e=Dm.current,I0(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,r=Ua,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}e[Ba]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||Pke(e.nodeValue,n)),e||eg(t,!0)}else e=aN(e).createTextNode(i),e[Ba]=t,t.stateNode=e}return ds(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=I0(t),n!==null){if(e===null){if(!i)throw Error(wt(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(wt(557));e[Ba]=t}else dy(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ds(t),e=!1}else n=s5(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Vc(t),t):(Vc(t),null);if(t.flags&128)throw Error(wt(558))}return ds(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=I0(t),i!==null&&i.dehydrated!==null){if(e===null){if(!r)throw Error(wt(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(wt(317));r[Ba]=t}else dy(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ds(t),r=!1}else r=s5(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Vc(t),t):(Vc(t),null)}return Vc(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),hA(t,t.updateQueue),ds(t),null);case 4:return Px(),e===null&&R7(t.stateNode.containerInfo),ds(t),null;case 10:return Qh(t.type),ds(t),null;case 19:if(Ea(vo),i=t.memoizedState,i===null)return ds(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)J1(i,!1);else{if(eo!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Gj(e),s!==null){for(t.flags|=128,J1(i,!1),e=s.updateQueue,t.updateQueue=e,hA(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)G1e(n,e),n=n.sibling;return ts(vo,vo.current&1|2),Zi&&Eh(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Yc()>tN&&(t.flags|=128,r=!0,J1(i,!1),t.lanes=4194304)}else{if(!r)if(e=Gj(s),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,hA(t,e),J1(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Zi)return ds(t),null}else 2*Yc()-i.renderingStartTime>tN&&n!==536870912&&(t.flags|=128,r=!0,J1(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=Yc(),e.sibling=null,n=vo.current,ts(vo,r?n&1|2:n&1),Zi&&Eh(t,i.treeForkCount),e):(ds(t),null);case 22:case 23:return Vc(t),u7(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?n&536870912&&!(t.flags&128)&&(ds(t),t.subtreeFlags&6&&(t.flags|=8192)):ds(t),n=t.updateQueue,n!==null&&hA(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&&Ea(Zb),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Qh(Bo),ds(t),null;case 25:return null;case 30:return null}throw Error(wt(156,t.tag))}function BHe(e,t){switch(s7(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qh(Bo),Px(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Bj(t),null;case 31:if(t.memoizedState!==null){if(Vc(t),t.alternate===null)throw Error(wt(340));dy()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Vc(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(wt(340));dy()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ea(vo),null;case 4:return Px(),null;case 10:return Qh(t.type),null;case 22:case 23:return Vc(t),u7(),e!==null&&Ea(Zb),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Qh(Bo),null;case 25:return null;default:return null}}function GOe(e,t){switch(s7(t),t.tag){case 3:Qh(Bo),Px();break;case 26:case 27:case 5:Bj(t);break;case 4:Px();break;case 31:t.memoizedState!==null&&Vc(t);break;case 13:Vc(t);break;case 19:Ea(vo);break;case 10:Qh(t.type);break;case 22:case 23:Vc(t),u7(),e!==null&&Ea(Zb);break;case 24:Qh(Bo)}}function mC(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){jr(t,t.return,l)}}function tg(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){jr(r,c,d)}}}i=i.next}while(i!==s)}}catch(d){jr(t,t.return,d)}}function XOe(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{sOe(t,n)}catch(i){jr(e,e.return,i)}}}function YOe(e,t,n){n.props=my(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){jr(e,t,i)}}function Rk(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){jr(e,t,r)}}function Sf(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){jr(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){jr(e,t,r)}else n.current=null}function ZOe(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){jr(e,e.return,r)}}function m5(e,t,n){try{var i=e.stateNode;lqe(i,e.type,n,t),i[hc]=t}catch(r){jr(e,e.return,r)}}function JOe(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ag(e.type)||e.tag===4}function g5(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||JOe(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&&Ag(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 r$(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=Mh));else if(i!==4&&(i===27&&Ag(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(r$(e,t,n),e=e.sibling;e!==null;)r$(e,t,n),e=e.sibling}function eN(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&&Ag(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(eN(e,t,n),e=e.sibling;e!==null;)eN(e,t,n),e=e.sibling}function eke(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Va(t,i,n),t[Ba]=e,t[hc]=n}catch(s){jr(e,e.return,s)}}var jh=!1,Fo=!1,b5=!1,cG=typeof WeakSet=="function"?WeakSet:Set,ba=null;function UHe(e,t){if(e=e.containerInfo,d$=dN,e=U1e(e),e7(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 m;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),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===r&&(l=a),h===s&&++d===i&&(c=a),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(f$={focusedElem:e,selectionRange:n},dN=!1,ba=t;ba!==null;)if(t=ba,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ba=e;else for(;ba!==null;){switch(t=ba,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"))),Va(s,i,n),s[Ba]=e,va(s),i=s;break e;case"link":var a=_G("link","href",r).get(i+(n.href||""));if(a){for(var l=0;lv&&(a=v,v=b,b=a);var y=PK(l,b),w=PK(l,v);if(y&&w&&(m.rangeCount!==1||m.anchorNode!==y.node||m.anchorOffset!==y.offset||m.focusNode!==w.node||m.focusOffset!==w.offset)){var x=f.createRange();x.setStart(y.node,y.offset),m.removeAllRanges(),b>v?(m.addRange(x),m.extend(w.node,w.offset)):(x.setEnd(w.node,w.offset),m.addRange(x))}}}}for(f=[],m=l;m=m.parentNode;)m.nodeType===1&&f.push({element:m,left:m.scrollLeft,top:m.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;ln?32:n,Kn.T=null,n=a$,a$=null;var s=Bm,a=zh;if(ta=0,Ux=Bm=null,zh=0,gr&6)throw Error(wt(331));var l=gr;if(gr|=4,dke(s.current),lke(s,s.current,a,n),gr=l,gC(0,!1),Zc&&typeof Zc.onPostCommitFiberRoot=="function")try{Zc.onPostCommitFiberRoot(lC,s)}catch{}return!0}finally{br.p=r,Kn.T=i,Cke(e,t)}}function hG(e,t,n){t=ju(n,t),t=t$(e.stateNode,t,2),e=$m(e,t,2),e!==null&&(uC(e,2),Hf(e))}function jr(e,t,n){if(e.tag===3)hG(e,e,n);else for(;t!==null;){if(t.tag===3){hG(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Fm===null||!Fm.has(i))){e=ju(n,e),n=QOe(2),i=$m(t,n,2),i!==null&&(zOe(n,i,t,e),uC(i,2),Hf(i));break}}t=t.return}}function v5(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new VHe;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)||(A7=!0,r.add(n),e=GHe.bind(null,e,t,n),t.then(e,e))}function GHe(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Wr===e&&(Wi&n)===n&&(eo===4||eo===3&&(Wi&62914560)===Wi&&300>Yc()-_I?!(gr&2)&&Qx(e,0):_7|=n,Bx===Wi&&(Bx=0)),Hf(e)}function Ake(e,t){t===0&&(t=v1e()),e=Vy(e,t),e!==null&&(uC(e,t),Hf(e))}function XHe(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ake(e,n)}function YHe(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(wt(314))}i!==null&&i.delete(t),Ake(e,n)}function ZHe(e,t){return H9(e,t)}var rN=null,sv=null,c$=!1,sN=!1,x5=!1,Cm=0;function Hf(e){e!==sv&&e.next===null&&(sv===null?rN=sv=e:sv=sv.next=e),sN=!0,c$||(c$=!0,eqe())}function gC(e,t){if(!x5&&sN){x5=!0;do for(var n=!1,i=rN;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-Jc(42|e)+1)-1,s&=r&~(a&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,pG(i,s))}else s=Wi,s=yI(i,i===Wr?s:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),!(s&3)||cC(i,s)||(n=!0,pG(i,s));i=i.next}while(n);x5=!1}}function JHe(){_ke()}function _ke(){sN=c$=!1;var e=0;Cm!==0&&uqe()&&(e=Cm);for(var t=Yc(),n=null,i=rN;i!==null;){var r=i.next,s=jke(i,t);s===0?(i.next=null,n===null?rN=r:n.next=r,r===null&&(sv=n)):(n=i,(e!==0||s&3)&&(sN=!0)),i=r}ta!==0&&ta!==5||gC(e),Cm!==0&&(Cm=0)}function jke(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&&vG(f)&&(c=c.responseEnd,a+=d*(c"u"?null:document;function Fke(e,t,n){var i=Mw;if(i&&typeof t=="string"&&t){var r=_u(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),CG.has(r)||(CG.add(r),e={rel:e,crossOrigin:n,href:t},i.querySelector(r)===null&&(t=i.createElement("link"),Va(t,"link",e),va(t),i.head.appendChild(t)))}}function vqe(e){Op.D(e),Fke("dns-prefetch",e,null)}function xqe(e,t){Op.C(e,t),Fke("preconnect",e,t)}function wqe(e,t,n){Op.L(e,t,n);var i=Mw;if(i&&e&&t){var r='link[rel="preload"][as="'+_u(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+_u(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+_u(n.imageSizes)+'"]')):r+='[href="'+_u(e)+'"]';var s=r;switch(t){case"style":s=zx(e);break;case"script":s=Lw(e)}Ku.has(s)||(e=xs({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ku.set(s,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(bC(s))||t==="script"&&i.querySelector(yC(s))||(t=i.createElement("link"),Va(t,"link",e),va(t),i.head.appendChild(t)))}}function Oqe(e,t){Op.m(e,t);var n=Mw;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+_u(i)+'"][href="'+_u(e)+'"]',s=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Lw(e)}if(!Ku.has(s)&&(e=xs({rel:"modulepreload",href:e},t),Ku.set(s,e),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(yC(s)))return}i=n.createElement("link"),Va(i,"link",e),va(i),n.head.appendChild(i)}}}function kqe(e,t,n){Op.S(e,t,n);var i=Mw;if(i&&e){var r=Xv(i).hoistableStyles,s=zx(e);t=t||"default";var a=r.get(s);if(!a){var l={loading:0,preload:null};if(a=i.querySelector(bC(s)))l.loading=5;else{e=xs({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ku.get(s))&&I7(e,n);var c=a=i.createElement("link");va(c),Va(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,C_(a,t,i)}a={type:"stylesheet",instance:a,count:1,state:l},r.set(s,a)}}}function Sqe(e,t){Op.X(e,t);var n=Mw;if(n&&e){var i=Xv(n).hoistableScripts,r=Lw(e),s=i.get(r);s||(s=n.querySelector(yC(r)),s||(e=xs({src:e,async:!0},t),(t=Ku.get(r))&&P7(e,t),s=n.createElement("script"),va(s),Va(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function Eqe(e,t){Op.M(e,t);var n=Mw;if(n&&e){var i=Xv(n).hoistableScripts,r=Lw(e),s=i.get(r);s||(s=n.querySelector(yC(r)),s||(e=xs({src:e,async:!0,type:"module"},t),(t=Ku.get(r))&&P7(e,t),s=n.createElement("script"),va(s),Va(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function TG(e,t,n,i){var r=(r=Dm.current)?lN(r):null;if(!r)throw Error(wt(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=zx(n.href),n=Xv(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=zx(n.href);var s=Xv(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(bC(e)))&&!s._p&&(a.instance=s,a.state.loading=5),Ku.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},Ku.set(e,n),s||Cqe(r,e,n,a.state))),t&&i===null)throw Error(wt(528,""));return a}if(t&&i!==null)throw Error(wt(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Lw(n),n=Xv(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(wt(444,e))}}function zx(e){return'href="'+_u(e)+'"'}function bC(e){return'link[rel="stylesheet"]['+e+"]"}function Bke(e){return xs({},e,{"data-precedence":e.precedence,precedence:null})}function Cqe(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}),Va(t,"link",n),va(t),e.head.appendChild(t))}function Lw(e){return'[src="'+_u(e)+'"]'}function yC(e){return"script[async]"+e}function AG(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+_u(n.href)+'"]');if(i)return t.instance=i,va(i),i;var r=xs({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),va(i),Va(i,"style",r),C_(i,n.precedence,e),t.instance=i;case"stylesheet":r=zx(n.href);var s=e.querySelector(bC(r));if(s)return t.state.loading|=4,t.instance=s,va(s),s;i=Bke(n),(r=Ku.get(r))&&I7(i,r),s=(e.ownerDocument||e).createElement("link"),va(s);var a=s;return a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),Va(s,"link",i),t.state.loading|=4,C_(s,n.precedence,e),t.instance=s;case"script":return s=Lw(n.src),(r=e.querySelector(yC(s)))?(t.instance=r,va(r),r):(i=n,(r=Ku.get(s))&&(i=xs({},n),P7(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),va(r),Va(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(wt(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(i=t.instance,t.state.loading|=4,C_(i,n.precedence,e));return t.instance}function C_(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 Tqe(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 Uke(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function Aqe(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=zx(i.href),s=t.querySelector(bC(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=cN.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,va(s);return}s=t.ownerDocument||t,i=Bke(i),(r=Ku.get(r))&&I7(i,r),s=s.createElement("link"),va(s);var a=s;a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),Va(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=cN.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var C5=0;function _qe(e,t){return e.stylesheets&&e.count===0&&A_(e,e.stylesheets),0C5?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function cN(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)A_(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var uN=null;function A_(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,uN=new Map,t.forEach(jqe,e),uN=null,cN.call(e))}function jqe(e,t){if(!(t.state.loading&4)){var n=uN.get(e);if(n)var i=n.get(null);else{n=new Map,uN.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(Gke)}catch(e){console.error(e)}}Gke(),i1e.exports=gI;var $qe=i1e.exports;const Fqe=_w($qe),F7=p.createContext({});function PI(e){const t=p.useRef(null);return t.current===null&&(t.current=e()),t.current}const DI=p.createContext(null),$S=p.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class Bqe extends p.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 Uqe({children:e,isPresent:t}){const n=p.useId(),i=p.useRef(null),r=p.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=p.useContext($S);return p.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; @@ -107,27 +107,27 @@ Error generating stack: `+i.message+` top: ${c}px !important; left: ${u}px !important; } - `),()=>{document.head.removeChild(d)}},[t]),o.jsx(Iqe,{isPresent:t,childRef:i,sizeRef:r,children:p.cloneElement(e,{ref:i})})}const Dqe=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:r,presenceAffectsLayout:s,mode:a})=>{const l=II(Mqe),c=p.useId(),u=p.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;i&&i()},[l,i]),d=p.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 p.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),p.useEffect(()=>{!n&&!l.size&&i&&i()},[n]),a==="popLayout"&&(e=o.jsx(Pqe,{isPresent:n,children:e})),o.jsx(PI.Provider,{value:d,children:e})};function Mqe(){return new Map}function zke(e=!0){const t=p.useContext(PI);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=t,s=p.useId();p.useEffect(()=>{e&&r(s)},[e]);const a=p.useCallback(()=>e&&i&&i(s),[s,i,e]);return!n&&i?[!1,a]:[!0]}const x2=e=>e.key||"";function LG(e){const t=[];return p.Children.forEach(e,n=>{p.isValidElement(n)&&t.push(n)}),t}const B7=typeof window<"u",Vke=B7?p.useLayoutEffect:p.useEffect,Ad=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:s="sync",propagate:a=!1})=>{const[l,c]=zke(a),u=p.useMemo(()=>LG(e),[e]),d=a&&!l?[]:u.map(x2),f=p.useRef(!0),h=p.useRef(u),m=II(()=>new Map),[g,b]=p.useState(u),[v,y]=p.useState(u);Vke(()=>{f.current=!1,h.current=u;for(let O=0;O{const S=x2(O),k=a&&!l?!1:u===v||d.includes(S),C=()=>{if(m.has(S))m.set(S,!0);else return;let E=!0;m.forEach(R=>{R||(E=!1)}),E&&(x==null||x(),y(h.current),a&&(c==null||c()),i&&i())};return o.jsx(Dqe,{isPresent:k,initial:!f.current||n?void 0:!1,custom:k?void 0:t,presenceAffectsLayout:r,mode:s,onExitComplete:k?void 0:C,children:O},S)})})},nu=e=>e;let Hke=nu;const Lqe={useManualTiming:!1};function $qe(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 m=f&&i?t:n;return d&&s.add(u),m.has(u)||m.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 w2=["read","resolveKeyframes","update","preRender","render","postRender"],Fqe=40;function qke(e,t){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,a=w2.reduce((y,w)=>(y[w]=$qe(s),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=a,m=()=>{const y=performance.now();n=!1,r.delta=i?1e3/60:Math.max(Math.min(y-r.timestamp,Fqe),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(m))},g=()=>{n=!0,i=!0,r.isProcessing||e(m)};return{schedule:w2.reduce((y,w)=>{const x=a[w];return y[w]=(O,S=!1,k=!1)=>(n||g(),x.schedule(O,S,k)),y},{}),cancel:y=>{for(let w=0;w$G[e].some(n=>!!t[n])};function Bqe(e){for(const t in e)Hx[t]={...Hx[t],...e[t]}}const Uqe=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 fN(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Uqe.has(e)}let Kke=e=>!fN(e);function Gke(e){e&&(Kke=t=>t.startsWith("on")?!fN(t):e(t))}try{Gke(require("@emotion/is-prop-valid").default)}catch{}function Qqe(e,t,n){const i={};for(const r in e)r==="values"&&typeof e.values=="object"||(Kke(r)||n===!0&&fN(r)||!t&&!fN(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}function zqe({children:e,isValidProp:t,...n}){t&&Gke(t),n={...p.useContext($S),...n},n.isStatic=II(()=>n.isStatic);const i=p.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return o.jsx($S.Provider,{value:i,children:e})}function Vqe(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 DI=p.createContext({});function FS(e){return typeof e=="string"||Array.isArray(e)}function MI(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const U7=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Q7=["initial",...U7];function LI(e){return MI(e.animate)||Q7.some(t=>FS(e[t]))}function Xke(e){return!!(LI(e)||e.variants)}function Hqe(e,t){if(LI(e)){const{initial:n,animate:i}=e;return{initial:n===!1||FS(n)?n:void 0,animate:FS(i)?i:void 0}}return e.inherit!==!1?t:{}}function qqe(e){const{initial:t,animate:n}=Hqe(e,p.useContext(DI));return p.useMemo(()=>({initial:t,animate:n}),[FG(t),FG(n)])}function FG(e){return Array.isArray(e)?e.join(" "):e}const Wqe=Symbol.for("motionComponentSymbol");function Rv(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Kqe(e,t,n){return p.useCallback(i=>{i&&e.onMount&&e.onMount(i),t&&(i?t.mount(i):t.unmount()),n&&(typeof n=="function"?n(i):Rv(n)&&(n.current=i))},[t])}const z7=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Gqe="framerAppearId",Yke="data-"+z7(Gqe),{schedule:V7}=qke(queueMicrotask,!1),Zke=p.createContext({});function Xqe(e,t,n,i,r){var s,a;const{visualElement:l}=p.useContext(DI),c=p.useContext(Wke),u=p.useContext(PI),d=p.useContext($S).reducedMotion,f=p.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,m=p.useContext(Zke);h&&!h.projection&&r&&(h.type==="html"||h.type==="svg")&&Yqe(f.current,n,r,m);const g=p.useRef(!1);p.useInsertionEffect(()=>{h&&g.current&&h.update(n,u)});const b=n[Yke],v=p.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 Vke(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),V7.render(h.render),v.current&&h.animationState&&h.animationState.animateChanges())}),p.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 Yqe(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:Jke(e.parent)),e.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!a||l&&Rv(l),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,layoutScroll:c,layoutRoot:u})}function Jke(e){if(e)return e.options.allowProjection!==!1?e.projection:Jke(e.parent)}function Zqe({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:r}){var s,a;e&&Bqe(e);function l(u,d){let f;const h={...p.useContext($S),...u,layoutId:Jqe(u)},{isStatic:m}=h,g=qqe(u),b=i(u,m);if(!m&&B7){eWe();const v=tWe(h);f=v.MeasureLayout,g.visualElement=Xqe(r,b,h,t,v.ProjectionNode)}return o.jsxs(DI.Provider,{value:g,children:[f&&g.visualElement?o.jsx(f,{visualElement:g.visualElement,...h}):null,n(r,u,Kqe(b,g.visualElement,d),b,m,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=p.forwardRef(l);return c[Wqe]=r,c}function Jqe({layoutId:e}){const t=p.useContext(F7).id;return t&&e!==void 0?t+"-"+e:e}function eWe(e,t){p.useContext(Wke).strict}function tWe(e){const{drag:t,layout:n}=Hx;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 nWe=["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 H7(e){return typeof e!="string"||e.includes("-")?!1:!!(nWe.indexOf(e)>-1||/[A-Z]/u.test(e))}function BG(e){const t=[{},{}];return e==null||e.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function q7(e,t,n,i){if(typeof t=="function"){const[r,s]=BG(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]=BG(i);t=t(n!==void 0?n:e.custom,r,s)}return t}const x$=e=>Array.isArray(e),iWe=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),rWe=e=>x$(e)?e[e.length-1]||0:e,ll=e=>!!(e&&e.getVelocity);function N_(e){const t=ll(e)?e.get():e;return iWe(t)?t.toValue():t}function sWe({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},i,r,s){const a={latestValues:oWe(i,r,s,e),renderState:t()};return n&&(a.onMount=l=>n({props:i,current:l,...a}),a.onUpdate=l=>n(l)),a}const eSe=e=>(t,n)=>{const i=p.useContext(DI),r=p.useContext(PI),s=()=>sWe(e,t,i,r);return n?s():II(s)};function oWe(e,t,n,i){const r={},s=i(e,{});for(const h in s)r[h]=N_(s[h]);let{initial:a,animate:l}=e;const c=LI(e),u=Xke(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"&&!MI(f)){const h=Array.isArray(f)?f:[f];for(let m=0;mt=>typeof t=="string"&&t.startsWith(e),nSe=tSe("--"),aWe=tSe("var(--"),W7=e=>aWe(e)?lWe.test(e.split("/*")[0].trim()):!1,lWe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,iSe=(e,t)=>t&&typeof e=="number"?t.transform(e):e,ap=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},BS={...Fw,transform:e=>ap(0,1,e)},O2={...Fw,default:1},vC=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),tm=vC("deg"),Nf=vC("%"),Mn=vC("px"),cWe=vC("vh"),uWe=vC("vw"),UG={...Nf,parse:e=>Nf.parse(e)/100,transform:e=>Nf.transform(e*100)},dWe={borderWidth:Mn,borderTopWidth:Mn,borderRightWidth:Mn,borderBottomWidth:Mn,borderLeftWidth:Mn,borderRadius:Mn,radius:Mn,borderTopLeftRadius:Mn,borderTopRightRadius:Mn,borderBottomRightRadius:Mn,borderBottomLeftRadius:Mn,width:Mn,maxWidth:Mn,height:Mn,maxHeight:Mn,top:Mn,right:Mn,bottom:Mn,left:Mn,padding:Mn,paddingTop:Mn,paddingRight:Mn,paddingBottom:Mn,paddingLeft:Mn,margin:Mn,marginTop:Mn,marginRight:Mn,marginBottom:Mn,marginLeft:Mn,backgroundPositionX:Mn,backgroundPositionY:Mn},fWe={rotate:tm,rotateX:tm,rotateY:tm,rotateZ:tm,scale:O2,scaleX:O2,scaleY:O2,scaleZ:O2,skew:tm,skewX:tm,skewY:tm,distance:Mn,translateX:Mn,translateY:Mn,translateZ:Mn,x:Mn,y:Mn,z:Mn,perspective:Mn,transformPerspective:Mn,opacity:BS,originX:UG,originY:UG,originZ:Mn},QG={...Fw,transform:Math.round},K7={...dWe,...fWe,zIndex:QG,size:Mn,fillOpacity:BS,strokeOpacity:BS,numOctaves:QG},hWe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},pWe=$w.length;function mWe(e,t,n){let i="",r=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}}),rSe=()=>({...Y7(),attrs:{}}),Z7=e=>typeof e=="string"&&e.toLowerCase()==="svg";function sSe(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 oSe=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 aSe(e,t,n,i){sSe(e,t,void 0,i);for(const r in t.attrs)e.setAttribute(oSe.has(r)?r:z7(r),t.attrs[r])}const hN={};function xWe(e){Object.assign(hN,e)}function lSe(e,{layout:t,layoutId:n}){return Hy.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!hN[e]||e==="opacity")}function J7(e,t,n){var i;const{style:r}=e,s={};for(const a in r)(ll(r[a])||t.style&&ll(t.style[a])||lSe(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 cSe(e,t,n){const i=J7(e,t,n);for(const r in e)if(ll(e[r])||ll(t[r])){const s=$w.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[s]=e[r]}return i}function wWe(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 VG=["x","y","width","height","cx","cy","r"],OWe={useVisualState:eSe({scrapeMotionValuesFromProps:cSe,createRenderState:rSe,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(Hy.has(l)){s=!0;break}}if(!s)return;let a=!t;if(t)for(let l=0;l{wWe(n,i),gs.render(()=>{X7(i,r,Z7(n.tagName),e.transformTemplate),aSe(n,i)})})}})},kWe={useVisualState:eSe({scrapeMotionValuesFromProps:J7,createRenderState:Y7})};function uSe(e,t,n){for(const i in t)!ll(t[i])&&!lSe(i,n)&&(e[i]=t[i])}function SWe({transformTemplate:e},t){return p.useMemo(()=>{const n=Y7();return G7(n,t,e),Object.assign({},n.vars,n.style)},[t])}function EWe(e,t){const n=e.style||{},i={};return uSe(i,n,e),Object.assign(i,SWe(e,t)),i}function CWe(e,t){const n={},i=EWe(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 TWe(e,t,n,i){const r=p.useMemo(()=>{const s=rSe();return X7(s,t,Z7(i),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};uSe(s,e.style,e),r.style={...s,...r.style}}return r}function AWe(e=!1){return(n,i,r,{latestValues:s},a)=>{const c=(H7(n)?TWe:CWe)(i,s,a,n),u=Qqe(i,typeof n=="string",e),d=n!==p.Fragment?{...u,...c,ref:r}:{},{children:f}=i,h=p.useMemo(()=>ll(f)?f.get():f,[f]);return p.createElement(n,{...d,children:h})}}function _We(e,t){return function(i,{forwardMotionProps:r}={forwardMotionProps:!1}){const a={...H7(i)?OWe:kWe,preloadedFeatures:e,useRender:AWe(r),createVisualElement:t,Component:i};return Zqe(a)}}function dSe(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i(R_===void 0&&Rf.set(Ra.isProcessing||Lqe.useManualTiming?Ra.timestamp:performance.now()),R_),set:e=>{R_=e,queueMicrotask(jWe)}};function tU(e,t){e.indexOf(t)===-1&&e.push(t)}function nU(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class iU{constructor(){this.subscriptions=[]}add(t){return tU(this.subscriptions,t),()=>nU(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 RWe{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,r=!0)=>{const s=Rf.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=Rf.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=NWe(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 iU);const i=this.events[t].add(n);return t==="change"?()=>{i(),gs.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=Rf.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>HG)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,HG);return hSe(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 US(e,t){return new RWe(e,t)}function IWe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,US(n))}function PWe(e,t){const n=$I(e,t);let{transitionEnd:i={},transition:r={},...s}=n||{};s={...s,...i};for(const a in s){const l=rWe(s[a]);IWe(e,a,l)}}function DWe(e){return!!(ll(e)&&e.add)}function w$(e,t){const n=e.getValue("willChange");if(DWe(n))return n.add(t)}function pSe(e){return e.props[Yke]}function rU(e){let t;return()=>(t===void 0&&(t=e()),t)}const MWe=rU(()=>window.ScrollTimeline!==void 0);class LWe{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(MWe()&&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 $We extends LWe{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const Vh=e=>e*1e3,Hh=e=>e/1e3;function sU(e){return typeof e=="function"}function qG(e,t){e.timeline=t,e.onfinish=null}const oU=e=>Array.isArray(e)&&typeof e[0]=="number",FWe={linearEasing:void 0};function BWe(e,t){const n=rU(e);return()=>{var i;return(i=FWe[t])!==null&&i!==void 0?i:n()}}const pN=BWe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),qx=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i},mSe=(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})`,O$={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:XO([0,.65,.55,1]),circOut:XO([.55,0,1,.45]),backIn:XO([.31,.01,.66,-.59]),backOut:XO([.33,1.53,.69,.99])};function bSe(e,t){if(e)return typeof e=="function"&&pN()?mSe(e,t):oU(e)?XO(e):Array.isArray(e)?e.map(n=>bSe(n,t)||O$.easeOut):O$[e]}const ySe=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,UWe=1e-7,QWe=12;function zWe(e,t,n,i,r){let s,a,l=0;do a=t+(n-t)/2,s=ySe(a,i,r)-e,s>0?n=a:t=a;while(Math.abs(s)>UWe&&++lzWe(s,0,1,e,n);return s=>s===0||s===1?s:ySe(r(s),t,i)}const vSe=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,xSe=e=>t=>1-e(1-t),wSe=xC(.33,1.53,.69,.99),aU=xSe(wSe),OSe=vSe(aU),kSe=e=>(e*=2)<1?.5*aU(e):.5*(2-Math.pow(2,-10*(e-1))),lU=e=>1-Math.sin(Math.acos(e)),SSe=xSe(lU),ESe=vSe(lU),CSe=e=>/^0[^.\s]+$/u.test(e);function VWe(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||CSe(e):!0}const Lk=e=>Math.round(e*1e5)/1e5,cU=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function HWe(e){return e==null}const qWe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,uU=(e,t)=>n=>!!(typeof n=="string"&&qWe.test(n)&&n.startsWith(e)||t&&!HWe(n)&&Object.prototype.hasOwnProperty.call(n,t)),TSe=(e,t,n)=>i=>{if(typeof i!="string")return i;const[r,s,a,l]=i.match(cU);return{[e]:parseFloat(r),[t]:parseFloat(s),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},WWe=e=>ap(0,255,e),T5={...Fw,transform:e=>Math.round(WWe(e))},Pb={test:uU("rgb","red"),parse:TSe("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+T5.transform(e)+", "+T5.transform(t)+", "+T5.transform(n)+", "+Lk(BS.transform(i))+")"};function KWe(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 k$={test:uU("#"),parse:KWe,transform:Pb.transform},Iv={test:uU("hsl","hue"),parse:TSe("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+Nf.transform(Lk(t))+", "+Nf.transform(Lk(n))+", "+Lk(BS.transform(i))+")"},sl={test:e=>Pb.test(e)||k$.test(e)||Iv.test(e),parse:e=>Pb.test(e)?Pb.parse(e):Iv.test(e)?Iv.parse(e):k$.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Pb.transform(e):Iv.transform(e)},GWe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function XWe(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(cU))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(GWe))===null||n===void 0?void 0:n.length)||0)>0}const ASe="number",_Se="color",YWe="var",ZWe="var(",WG="${}",JWe=/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 QS(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},r=[];let s=0;const l=t.replace(JWe,c=>(sl.test(c)?(i.color.push(s),r.push(_Se),n.push(sl.parse(c))):c.startsWith(ZWe)?(i.var.push(s),r.push(YWe),n.push(c)):(i.number.push(s),r.push(ASe),n.push(parseFloat(c))),++s,WG)).split(WG);return{values:n,split:l,indexes:i,types:r}}function jSe(e){return QS(e).values}function NSe(e){const{split:t,types:n}=QS(e),i=t.length;return r=>{let s="";for(let a=0;atypeof e=="number"?0:e;function tKe(e){const t=jSe(e);return NSe(e)(t.map(eKe))}const ig={test:XWe,parse:jSe,createTransformer:NSe,getAnimatableNone:tKe},nKe=new Set(["brightness","contrast","saturate","opacity"]);function iKe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(cU)||[];if(!i)return e;const r=n.replace(i,"");let s=nKe.has(t)?1:0;return i!==n&&(s*=100),t+"("+s+r+")"}const rKe=/\b([a-z-]*)\(.*?\)/gu,S$={...ig,getAnimatableNone:e=>{const t=e.match(rKe);return t?t.map(iKe).join(" "):e}},sKe={...K7,color:sl,backgroundColor:sl,outlineColor:sl,fill:sl,stroke:sl,borderColor:sl,borderTopColor:sl,borderRightColor:sl,borderBottomColor:sl,borderLeftColor:sl,filter:S$,WebkitFilter:S$},dU=e=>sKe[e];function RSe(e,t){let n=dU(e);return n!==S$&&(n=ig),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const oKe=new Set(["auto","none","0"]);function aKe(e,t,n){let i=0,r;for(;ie===Fw||e===Mn,GG=(e,t)=>parseFloat(e.split(", ")[t]),XG=(e,t)=>(n,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return GG(r[1],t);{const s=i.match(/^matrix\((.+)\)$/u);return s?GG(s[1],e):0}},lKe=new Set(["x","y","z"]),cKe=$w.filter(e=>!lKe.has(e));function uKe(e){const t=[];return cKe.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const Wx={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:XG(4,13),y:XG(5,14)};Wx.translateX=Wx.x;Wx.translateY=Wx.y;const ey=new Set;let E$=!1,C$=!1;function ISe(){if(C$){const e=Array.from(ey).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const r=uKe(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)})}C$=!1,E$=!1,ey.forEach(e=>e.complete()),ey.clear()}function PSe(){ey.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(C$=!0)})}function dKe(){PSe(),ISe()}class fU{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?(ey.add(this),E$||(E$=!0,gs.read(PSe),gs.resolveKeyframes(ISe))):(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),fKe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function hKe(e){const t=fKe.exec(e);if(!t)return[,];const[,n,i,r]=t;return[`--${n??i}`,r]}function MSe(e,t,n=1){const[i,r]=hKe(e);if(!i)return;const s=window.getComputedStyle(t).getPropertyValue(i);if(s){const a=s.trim();return DSe(a)?parseFloat(a):a}return W7(r)?MSe(r,t,n+1):r}const LSe=e=>t=>t.test(e),pKe={test:e=>e==="auto",parse:e=>e},$Se=[Fw,Mn,Nf,tm,uWe,cWe,pKe],YG=e=>$Se.find(LSe(e));class FSe extends fU{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 ZG=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ig.test(e)||e==="0")&&!e.startsWith("url("));function mKe(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function FI(e,{repeat:t,repeatType:n="loop"},i){const r=e.filter(bKe),s=t&&n!=="loop"&&t%2===1?0:r.length-1;return!s||i===void 0?r[s]:i}const yKe=40;class BSe{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=Rf.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>yKe?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&dKe(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Rf.now(),this.hasAttemptedResolve=!0;const{name:i,type:r,velocity:s,delay:a,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!gKe(t,i,r,s))if(a)this.options.duration=0;else{c&&c(FI(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 T$=2e4;function USe(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t=T$?1/0:t}const zs=(e,t,n)=>e+(t-e)*n;function A5(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 vKe({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=A5(c,l,e+1/3),s=A5(c,l,e),a=A5(c,l,e-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:i}}function mN(e,t){return n=>n>0?t:e}const _5=(e,t,n)=>{const i=e*e,r=n*(t*t-i)+i;return r<0?0:Math.sqrt(r)},xKe=[k$,Pb,Iv],wKe=e=>xKe.find(t=>t.test(e));function JG(e){const t=wKe(e);if(!t)return!1;let n=t.parse(e);return t===Iv&&(n=vKe(n)),n}const eX=(e,t)=>{const n=JG(e),i=JG(t);if(!n||!i)return mN(e,t);const r={...n};return s=>(r.red=_5(n.red,i.red,s),r.green=_5(n.green,i.green,s),r.blue=_5(n.blue,i.blue,s),r.alpha=zs(n.alpha,i.alpha,s),Pb.transform(r))},OKe=(e,t)=>n=>t(e(n)),wC=(...e)=>e.reduce(OKe),A$=new Set(["none","hidden"]);function kKe(e,t){return A$.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function SKe(e,t){return n=>zs(e,t,n)}function hU(e){return typeof e=="number"?SKe:typeof e=="string"?W7(e)?mN:sl.test(e)?eX:TKe:Array.isArray(e)?QSe:typeof e=="object"?sl.test(e)?eX:EKe:mN}function QSe(e,t){const n=[...e],i=n.length,r=e.map((s,a)=>hU(s)(s,t[a]));return s=>{for(let a=0;a{for(const s in i)n[s]=i[s](r);return n}}function CKe(e,t){var n;const i=[],r={color:0,var:0,number:0};for(let s=0;s{const n=ig.createTransformer(t),i=QS(e),r=QS(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?A$.has(e)&&!r.values.length||A$.has(t)&&!i.values.length?kKe(e,t):wC(QSe(CKe(i,r),r.values),n):mN(e,t)};function zSe(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?zs(e,t,n):hU(e)(e,t)}const AKe=5;function VSe(e,t,n){const i=Math.max(t-AKe,0);return hSe(n-e(i),t-i)}const Gs={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},j5=.001;function _Ke({duration:e=Gs.duration,bounce:t=Gs.bounce,velocity:n=Gs.velocity,mass:i=Gs.mass}){let r,s,a=1-t;a=ap(Gs.minDamping,Gs.maxDamping,a),e=ap(Gs.minDuration,Gs.maxDuration,Hh(e)),a<1?(r=u=>{const d=u*a,f=d*e,h=d-n,m=_$(u,a),g=Math.exp(-f);return j5-h/m*g},s=u=>{const f=u*a*e,h=f*n+n,m=Math.pow(a,2)*Math.pow(u,2)*e,g=Math.exp(-f),b=_$(Math.pow(u,2),a);return(-r(u)+j5>0?-1:1)*((h-m)*g)/b}):(r=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-j5+d*f},s=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=NKe(r,s,l);if(e=Vh(e),isNaN(c))return{stiffness:Gs.stiffness,damping:Gs.damping,duration:e};{const u=Math.pow(c,2)*i;return{stiffness:u,damping:a*2*Math.sqrt(i*u),duration:e}}}const jKe=12;function NKe(e,t,n){let i=n;for(let r=1;re[n]!==void 0)}function PKe(e){let t={velocity:Gs.velocity,stiffness:Gs.stiffness,damping:Gs.damping,mass:Gs.mass,isResolvedFromDuration:!1,...e};if(!tX(e,IKe)&&tX(e,RKe))if(e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,s=2*ap(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:Gs.mass,stiffness:r,damping:s}}else{const n=_Ke(e);t={...t,...n,mass:Gs.mass},t.isResolvedFromDuration=!0}return t}function HSe(e=Gs.visualDuration,t=Gs.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:m}=PKe({...n,velocity:-Hh(n.velocity||0)}),g=h||0,b=u/(2*Math.sqrt(c*d)),v=a-s,y=Hh(Math.sqrt(c/d)),w=Math.abs(v)<5;i||(i=w?Gs.restSpeed.granular:Gs.restSpeed.default),r||(r=w?Gs.restDelta.granular:Gs.restDelta.default);let x;if(b<1){const S=_$(y,b);x=k=>{const C=Math.exp(-b*y*k);return a-C*((g+b*y*v)/S*Math.sin(S*k)+v*Math.cos(S*k))}}else if(b===1)x=S=>a-Math.exp(-y*S)*(v+(g+y*v)*S);else{const S=y*Math.sqrt(b*b-1);x=k=>{const C=Math.exp(-b*y*k),E=Math.min(S*k,300);return a-C*((g+b*y*v)*Math.sinh(E)+S*v*Math.cosh(E))/S}}const O={calculatedDuration:m&&f||null,next:S=>{const k=x(S);if(m)l.done=S>=f;else{let C=0;b<1&&(C=S===0?Vh(g):VSe(x,S,k));const E=Math.abs(C)<=i,R=Math.abs(a-k)<=r;l.done=E&&R}return l.value=l.done?a:k,l},toString:()=>{const S=Math.min(USe(O),T$),k=mSe(C=>O.next(S*C).value,S,30);return S+"ms "+k}};return O}function nX({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},m=E=>l!==void 0&&Ec,g=E=>l===void 0?c:c===void 0||Math.abs(l-E)-b*Math.exp(-E/i),x=E=>y+w(E),O=E=>{const R=w(E),A=x(E);h.done=Math.abs(R)<=u,h.value=h.done?y:A};let S,k;const C=E=>{m(h.value)&&(S=E,k=HSe({keyframes:[h.value,g(h.value)],velocity:VSe(x,E,h.value),damping:r,stiffness:s,restDelta:u,restSpeed:d}))};return C(0),{calculatedDuration:null,next:E=>{let R=!1;return!k&&S===void 0&&(R=!0,O(E),C(E)),S!==void 0&&E>=S?k.next(E-S):(!R&&O(E),h)}}}const DKe=xC(.42,0,1,1),MKe=xC(0,0,.58,1),qSe=xC(.42,0,.58,1),LKe=e=>Array.isArray(e)&&typeof e[0]!="number",$Ke={linear:nu,easeIn:DKe,easeInOut:qSe,easeOut:MKe,circIn:lU,circInOut:ESe,circOut:SSe,backIn:aU,backInOut:OSe,backOut:wSe,anticipate:kSe},iX=e=>{if(oU(e)){Hke(e.length===4);const[t,n,i,r]=e;return xC(t,n,i,r)}else if(typeof e=="string")return $Ke[e];return e};function FKe(e,t,n){const i=[],r=n||zSe,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=FKe(t,i,r),c=l.length,u=d=>{if(a&&d1)for(;fu(ap(e[0],e[s-1],d)):u}function UKe(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const r=qx(0,t,i);e.push(zs(n,1,r))}}function QKe(e){const t=[0];return UKe(t,e.length-1),t}function zKe(e,t){return e.map(n=>n*t)}function VKe(e,t){return e.map(()=>t||qSe).splice(0,e.length-1)}function gN({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const r=LKe(i)?i.map(iX):iX(i),s={done:!1,value:t[0]},a=zKe(n&&n.length===t.length?n:QKe(t),e),l=BKe(a,t,{ease:Array.isArray(r)?r:VKe(t,r)});return{calculatedDuration:e,next:c=>(s.value=l(c),s.done=c>=e,s)}}const HKe=e=>{const t=({timestamp:n})=>e(n);return{start:()=>gs.update(t,!0),stop:()=>ng(t),now:()=>Ra.isProcessing?Ra.timestamp:Rf.now()}},qKe={decay:nX,inertia:nX,tween:gN,keyframes:gN,spring:HSe},WKe=e=>e/100;class pU extends BSe{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)||fU,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=sU(n)?n:qKe[n]||gN;let c,u;l!==gN&&typeof t[0]!="number"&&(c=wC(WKe,zSe(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=USe(d));const{calculatedDuration:f}=d,h=f+r,m=h*(i+1)-r;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:h,totalDuration:m}}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:E}=this.options;return{done:!0,value:E[E.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:m,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),w=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let x=this.currentTime,O=s;if(m){const E=Math.min(this.currentTime,d)/f;let R=Math.floor(E),A=E%1;!A&&E>=1&&(A=1),A===1&&R--,R=Math.min(R,m+1),!!(R%2)&&(g==="reverse"?(A=1-A,b&&(A-=b/f)):g==="mirror"&&(O=a)),x=ap(0,1,A)*f}const S=w?{done:!1,value:c[0]}:O.next(x);l&&(S.value=l(S.value));let{done:k}=S;!w&&u!==null&&(k=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return C&&r!==void 0&&(S.value=FI(c,this.options,r)),v&&v(S.value),C&&this.finish(),S}get duration(){const{resolved:t}=this;return t?Hh(t.calculatedDuration):0}get time(){return Hh(this.currentTime)}set time(t){t=Vh(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=Hh(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=HKe,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 KKe=new Set(["opacity","clipPath","filter","transform"]);function GKe(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=bSe(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 XKe=rU(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),bN=10,YKe=2e4;function ZKe(e){return sU(e.type)||e.type==="spring"||!gSe(e.ease)}function JKe(e,t){const n=new pU({...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"&&pN()&&eGe(s)&&(s=WSe[s]),ZKe(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:g,...b}=this.options,v=JKe(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=GKe(l.owner.current,c,t,{...this.options,duration:i,times:r,ease:s});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(qG(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(FI(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 Hh(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Hh(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:i}=n;i.currentTime=Vh(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 nu;const{animation:i}=n;qG(i,t)}return nu}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,...m}=this.options,g=new pU({...m,keyframes:i,duration:r,type:s,ease:a,times:l,isGenerator:!0}),b=Vh(this.time);u.setWithVelocity(g.sample(b-bN).value,g.sample(b).value,bN)}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 XKe()&&i&&KKe.has(i)&&!c&&!u&&!r&&s!=="mirror"&&a!==0&&l!=="inertia"}}const tGe={type:"spring",stiffness:500,damping:25,restSpeed:10},nGe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),iGe={type:"keyframes",duration:.8},rGe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},sGe=(e,{keyframes:t})=>t.length>2?iGe:Hy.has(e)?e.startsWith("scale")?nGe(t[1]):tGe:rGe;function oGe({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 mU=(e,t,n,i={},r,s)=>a=>{const l=eU(i,e)||{},c=l.delay||i.delay||0;let{elapsed:u=0}=i;u=u-Vh(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};oGe(l)||(d={...d,...sGe(e,d)}),d.duration&&(d.duration=Vh(d.duration)),d.repeatDelay&&(d.repeatDelay=Vh(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=FI(d.keyframes,l);if(h!==void 0)return gs.update(()=>{d.onUpdate(h),d.onComplete()}),new $We([])}return!s&&rX.supports(d)?new rX(d):new pU(d)};function aGe({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function KSe(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),m=c[f];if(m===void 0||d&&aGe(d,f))continue;const g={delay:n,...eU(a||{},f)};let b=!1;if(window.MotionHandoffAnimation){const y=pSe(e);if(y){const w=window.MotionHandoffAnimation(y,f,gs);w!==null&&(g.startTime=w,b=!0)}}w$(e,f),h.start(mU(f,h,m,e.shouldReduceMotion&&fSe.has(f)?{type:!1}:g,e,b));const v=h.animation;v&&u.push(v)}return l&&Promise.all(u).then(()=>{gs.update(()=>{l&&PWe(e,l)})}),u}function j$(e,t,n={}){var i;const r=$I(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(KSe(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=s;return lGe(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 lGe(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(cGe).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(j$(u,t,{...s,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function cGe(e,t){return e.sortNodePosition(t)}function uGe(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const r=t.map(s=>j$(e,s,n));i=Promise.all(r)}else if(typeof t=="string")i=j$(e,t,n);else{const r=typeof t=="function"?$I(e,t,n.custom):t;i=Promise.all(KSe(e,r,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const dGe=Q7.length;function GSe(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?GSe(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})=>uGe(e,n,i)))}function mGe(e){let t=pGe(e),n=sX(),i=!0;const r=c=>(u,d)=>{var f;const h=$I(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:g,...b}=h;u={...u,...b,...g}}return u};function s(c){t=c(e)}function a(c){const{props:u}=e,d=GSe(e.parent)||{},f=[],h=new Set;let m={},g=1/0;for(let v=0;vg&&O,R=!1;const A=Array.isArray(x)?x:[x];let j=A.reduce(r(y),{});S===!1&&(j={});const{prevResolvedValues:T={}}=w,N={...T,...j},_=P=>{E=!0,h.has(P)&&(R=!0,h.delete(P)),w.needsAnimating[P]=!0;const L=e.getValue(P);L&&(L.liveStyle=!1)};for(const P in N){const L=j[P],B=T[P];if(m.hasOwnProperty(P))continue;let I=!1;x$(L)&&x$(B)?I=!dSe(L,B):I=L!==B,I?L!=null?_(P):h.add(P):L!==void 0&&h.has(P)?_(P):w.protectedKeys[P]=!0}w.prevProp=x,w.prevResolvedValues=j,w.isActive&&(m={...m,...j}),i&&e.blockInitialAnimation&&(E=!1),E&&(!(k&&C)||R)&&f.push(...A.map(P=>({animation:P,options:{type:y}})))}if(h.size){const v={};h.forEach(y=>{const w=e.getBaseTarget(y),x=e.getValue(y);x&&(x.liveStyle=!0),v[y]=w??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 m;return(m=h.animationState)===null||m===void 0?void 0:m.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=sX(),i=!0}}}function gGe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!dSe(t,e):!1}function Jg(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function sX(){return{animate:Jg(!0),whileInView:Jg(),whileHover:Jg(),whileTap:Jg(),whileDrag:Jg(),whileFocus:Jg(),exit:Jg()}}class Ag{constructor(t){this.isMounted=!1,this.node=t}update(){}}class bGe extends Ag{constructor(t){super(t),t.animationState||(t.animationState=mGe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();MI(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 yGe=0;class vGe extends Ag{constructor(){super(...arguments),this.id=yGe++}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 xGe={animation:{Feature:bGe},exit:{Feature:vGe}},md={x:!1,y:!1};function XSe(){return md.x||md.y}function wGe(e){return e==="x"||e==="y"?md[e]?null:(md[e]=!0,()=>{md[e]=!1}):md.x||md.y?null:(md.x=md.y=!0,()=>{md.x=md.y=!1})}const gU=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function zS(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}function OC(e){return{point:{x:e.pageX,y:e.pageY}}}const OGe=e=>t=>gU(t)&&e(t,OC(t));function $k(e,t,n,i){return zS(e,t,OGe(n),i)}const oX=(e,t)=>Math.abs(e-t);function kGe(e,t){const n=oX(e.x,t.x),i=oX(e.y,t.y);return Math.sqrt(n**2+i**2)}class YSe{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=R5(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,m=kGe(f.offset,{x:0,y:0})>=3;if(!h&&!m)return;const{point:g}=f,{timestamp:b}=Ra;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=N5(h,this.transformPagePoint),gs.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=R5(f.type==="pointercancel"?this.lastMoveEventInfo:N5(h,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,v),g&&g(f,v)},!gU(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.contextWindow=r||window;const a=OC(t),l=N5(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=Ra;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,R5(l,this.history)),this.removeListeners=wC($k(this.contextWindow,"pointermove",this.handlePointerMove),$k(this.contextWindow,"pointerup",this.handlePointerUp),$k(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ng(this.updatePoint)}}function N5(e,t){return t?{point:t(e.point)}:e}function aX(e,t){return{x:e.x-t.x,y:e.y-t.y}}function R5({point:e},t){return{point:e,delta:aX(e,ZSe(t)),offset:aX(e,SGe(t)),velocity:EGe(t,.1)}}function SGe(e){return e[0]}function ZSe(e){return e[e.length-1]}function EGe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const r=ZSe(e);for(;n>=0&&(i=e[n],!(r.timestamp-i.timestamp>Vh(t)));)n--;if(!i)return{x:0,y:0};const s=Hh(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 JSe=1e-4,CGe=1-JSe,TGe=1+JSe,eEe=.01,AGe=0-eEe,_Ge=0+eEe;function uu(e){return e.max-e.min}function jGe(e,t,n){return Math.abs(e-t)<=n}function lX(e,t,n,i=.5){e.origin=i,e.originPoint=zs(t.min,t.max,e.origin),e.scale=uu(n)/uu(t),e.translate=zs(n.min,n.max,e.origin)-e.originPoint,(e.scale>=CGe&&e.scale<=TGe||isNaN(e.scale))&&(e.scale=1),(e.translate>=AGe&&e.translate<=_Ge||isNaN(e.translate))&&(e.translate=0)}function Fk(e,t,n,i){lX(e.x,t.x,n.x,i?i.originX:void 0),lX(e.y,t.y,n.y,i?i.originY:void 0)}function cX(e,t,n){e.min=n.min+t.min,e.max=e.min+uu(t)}function NGe(e,t,n){cX(e.x,t.x,n.x),cX(e.y,t.y,n.y)}function uX(e,t,n){e.min=t.min-n.min,e.max=e.min+uu(t)}function Bk(e,t,n){uX(e.x,t.x,n.x),uX(e.y,t.y,n.y)}function RGe(e,{min:t,max:n},i){return t!==void 0&&en&&(e=i?zs(n,e,i.max):Math.min(e,n)),e}function dX(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 IGe(e,{top:t,left:n,bottom:i,right:r}){return{x:dX(e.x,n,r),y:dX(e.y,t,i)}}function fX(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.mini?n=qx(t.min,t.max-i,e.min):i>r&&(n=qx(e.min,e.max-r,t.min)),ap(0,1,n)}function MGe(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 N$=.35;function LGe(e=N$){return e===!1?e=0:e===!0&&(e=N$),{x:hX(e,"left","right"),y:hX(e,"top","bottom")}}function hX(e,t,n){return{min:pX(e,t),max:pX(e,n)}}function pX(e,t){return typeof e=="number"?e:e[t]||0}const mX=()=>({translate:0,scale:1,origin:0,originPoint:0}),Pv=()=>({x:mX(),y:mX()}),gX=()=>({min:0,max:0}),lo=()=>({x:gX(),y:gX()});function ku(e){return[e("x"),e("y")]}function tEe({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function $Ge({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function FGe(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 I5(e){return e===void 0||e===1}function R$({scale:e,scaleX:t,scaleY:n}){return!I5(e)||!I5(t)||!I5(n)}function gb(e){return R$(e)||nEe(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function nEe(e){return bX(e.x)||bX(e.y)}function bX(e){return e&&e!=="0%"}function yN(e,t,n){const i=e-n,r=t*i;return n+r}function yX(e,t,n,i,r){return r!==void 0&&(e=yN(e,r,i)),yN(e,n,i)+t}function I$(e,t=0,n=1,i,r){e.min=yX(e.min,t,n,i,r),e.max=yX(e.max,t,n,i,r)}function iEe(e,{x:t,y:n}){I$(e.x,t.translate,t.scale,t.originPoint),I$(e.y,n.translate,n.scale,n.originPoint)}const vX=.999999999999,xX=1.0000000000001;function BGe(e,t,n,i=!1){const r=n.length;if(!r)return;t.x=t.y=1;let s,a;for(let l=0;lvX&&(t.x=1),t.yvX&&(t.y=1)}function Dv(e,t){e.min=e.min+t,e.max=e.max+t}function wX(e,t,n,i,r=.5){const s=zs(e.min,e.max,r);I$(e,t,n,s,i)}function Mv(e,t){wX(e.x,t.x,t.scaleX,t.scale,t.originX),wX(e.y,t.y,t.scaleY,t.scale,t.originY)}function rEe(e,t){return tEe(FGe(e.getBoundingClientRect(),t))}function UGe(e,t,n){const i=rEe(e,n),{scroll:r}=t;return r&&(Dv(i.x,r.offset.x),Dv(i.y,r.offset.y)),i}const sEe=({current:e})=>e?e.ownerDocument.defaultView:null,QGe=new WeakMap;class zGe{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=lo(),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(OC(d).point)},s=(d,f)=>{const{drag:h,dragPropagation:m,onDragStart:g}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=wGe(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),ku(v=>{let y=this.getAxisMotionValue(v).get()||0;if(Nf.test(y)){const{projection:w}=this.visualElement;if(w&&w.layout){const x=w.layout.layoutBox[v];x&&(y=uu(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),g&&gs.postRender(()=>g(d,f)),w$(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:g,onDrag:b}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=f;if(m&&this.currentDirection===null){this.currentDirection=VGe(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=()=>ku(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 YSe(t,{onSessionStart:r,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:sEe(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&&gs.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||!k2(t,r,this.currentDirection))return;const s=this.getAxisMotionValue(t);let a=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(a=RGe(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&&Rv(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&r?this.constraints=IGe(r.layoutBox,n):this.constraints=!1,this.elastic=LGe(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&ku(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=MGe(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Rv(t))return!1;const i=t.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=UGe(i,r.root,this.visualElement.getTransformPagePoint());let a=PGe(r.layout.layoutBox,s);if(n){const l=n($Ge(a));this.hasMutatedConstraints=!!l,l&&(a=tEe(l))}return a}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=ku(d=>{if(!k2(d,n,this.currentDirection))return;let f=c&&c[d]||{};a&&(f={min:0,max:0});const h=r?200:1e6,m=r?40:1e7,g={type:"inertia",velocity:i?t[d]:0,bounceStiffness:h,bounceDamping:m,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 w$(this.visualElement,t),i.start(mU(t,i,0,n,this.visualElement,!1))}stopAnimation(){ku(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){ku(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){ku(n=>{const{drag:i}=this.getProps();if(!k2(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]-zs(a,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Rv(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};ku(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const c=l.get();r[a]=DGe({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(),ku(a=>{if(!k2(a,t,null))return;const l=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];l.set(zs(c,u,r[a]))})}addListeners(){if(!this.visualElement.current)return;QGe.set(this.visualElement,this);const t=this.visualElement.current,n=$k(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),i=()=>{const{dragConstraints:c}=this.getProps();Rv(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()),gs.read(i);const a=zS(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(ku(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=N$,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:a,dragMomentum:l}}}function k2(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function VGe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class HGe extends Ag{constructor(t){super(t),this.removeGroupControls=nu,this.removeListeners=nu,this.controls=new zGe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||nu}unmount(){this.removeGroupControls(),this.removeListeners()}}const OX=e=>(t,n)=>{e&&gs.postRender(()=>e(t,n))};class qGe extends Ag{constructor(){super(...arguments),this.removePointerDownListener=nu}onPointerDown(t){this.session=new YSe(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:sEe(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:OX(t),onStart:OX(n),onMove:i,onEnd:(s,a)=>{delete this.session,r&&gs.postRender(()=>r(s,a))}}}mount(){this.removePointerDownListener=$k(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 I_={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function kX(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const nO={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Mn.test(e))e=parseFloat(e);else return e;const n=kX(e,t.target.x),i=kX(e,t.target.y);return`${n}% ${i}%`}},WGe={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,r=ig.parse(e);if(r.length>5)return i;const s=ig.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=zs(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 KGe extends p.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=t;xWe(GGe),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()})),I_.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()||gs.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),V7.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 oEe(e){const[t,n]=zke(),i=p.useContext(F7);return o.jsx(KGe,{...e,layoutGroup:i,switchLayoutGroup:p.useContext(Zke),isPresent:t,safeToRemove:n})}const GGe={borderRadius:{...nO,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:nO,borderTopRightRadius:nO,borderBottomLeftRadius:nO,borderBottomRightRadius:nO,boxShadow:WGe};function XGe(e,t,n){const i=ll(e)?e:US(e);return i.start(mU("",i,t,n)),i.animation}function YGe(e){return e instanceof SVGElement&&e.tagName!=="svg"}const ZGe=(e,t)=>e.depth-t.depth;class JGe{constructor(){this.children=[],this.isDirty=!1}add(t){tU(this.children,t),this.isDirty=!0}remove(t){nU(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ZGe),this.isDirty=!1,this.children.forEach(t)}}function eXe(e,t){const n=Rf.now(),i=({timestamp:r})=>{const s=r-n;s>=t&&(ng(i),e(s-t))};return gs.read(i,!0),()=>ng(i)}const aEe=["TopLeft","TopRight","BottomLeft","BottomRight"],tXe=aEe.length,SX=e=>typeof e=="string"?parseFloat(e):e,EX=e=>typeof e=="number"||Mn.test(e);function nXe(e,t,n,i,r,s){r?(e.opacity=zs(0,n.opacity!==void 0?n.opacity:1,iXe(i)),e.opacityExit=zs(t.opacity!==void 0?t.opacity:1,0,rXe(i))):s&&(e.opacity=zs(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,i));for(let a=0;ait?1:n(qx(e,t,i))}function TX(e,t){e.min=t.min,e.max=t.max}function Ou(e,t){TX(e.x,t.x),TX(e.y,t.y)}function AX(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function _X(e,t,n,i,r){return e-=t,e=yN(e,1/n,i),r!==void 0&&(e=yN(e,1/r,i)),e}function sXe(e,t=0,n=1,i=.5,r,s=e,a=e){if(Nf.test(t)&&(t=parseFloat(t),t=zs(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=zs(s.min,s.max,i);e===s&&(l-=t),e.min=_X(e.min,t,n,l,r),e.max=_X(e.max,t,n,l,r)}function jX(e,t,[n,i,r],s,a){sXe(e,t[n],t[i],t[r],t.scale,s,a)}const oXe=["x","scaleX","originX"],aXe=["y","scaleY","originY"];function NX(e,t,n,i){jX(e.x,t,oXe,n?n.x:void 0,i?i.x:void 0),jX(e.y,t,aXe,n?n.y:void 0,i?i.y:void 0)}function RX(e){return e.translate===0&&e.scale===1}function cEe(e){return RX(e.x)&&RX(e.y)}function IX(e,t){return e.min===t.min&&e.max===t.max}function lXe(e,t){return IX(e.x,t.x)&&IX(e.y,t.y)}function PX(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function uEe(e,t){return PX(e.x,t.x)&&PX(e.y,t.y)}function DX(e){return uu(e.x)/uu(e.y)}function MX(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class cXe{constructor(){this.members=[]}add(t){tU(this.members,t),t.scheduleRender()}remove(t){if(nU(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 uXe(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:m,skewY:g}=n;u&&(i=`perspective(${u}px) ${i}`),d&&(i+=`rotate(${d}deg) `),f&&(i+=`rotateX(${f}deg) `),h&&(i+=`rotateY(${h}deg) `),m&&(i+=`skewX(${m}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 bb={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},YO=typeof window<"u"&&window.MotionDebug!==void 0,P5=["","X","Y","Z"],dXe={visibility:"hidden"},LX=1e3;let fXe=0;function D5(e,t,n,i){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function dEe(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=pSe(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",gs,!(r||s))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&dEe(i)}function fEe({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(a={},l=t==null?void 0:t()){this.id=fXe++,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,YO&&(bb.totalNodes=bb.resolvedTargetDeltas=bb.recalculatedProjection=0),this.nodes.forEach(mXe),this.nodes.forEach(xXe),this.nodes.forEach(wXe),this.nodes.forEach(gXe),YO&&window.MotionDebug.record(bb)},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=eXe(h,250),I_.hasAnimatedSinceResize&&(I_.hasAnimatedSinceResize=!1,this.nodes.forEach(FX))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:m,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||d.getDefaultTransition()||CXe,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=d.getProps(),w=!this.targetLayout||!uEe(this.targetLayout,g)||m,x=!h&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,x);const O={...eU(b,"layout"),onPlay:v,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(O.delay=0,O.type=!1),this.startAnimation(O)}else h||FX(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,ng(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(OXe),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&&dEe(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 S=O/1e3;BX(f.x,a.x,S),BX(f.y,a.y,S),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Bk(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),SXe(this.relativeTarget,this.relativeTargetOrigin,h,S),x&&lXe(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=lo()),Ou(x,this.relativeTarget)),b&&(this.animationValues=d,nXe(d,u,this.latestValues,S,w,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},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&&(ng(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=gs.update(()=>{I_.hasAnimatedSinceResize=!0,this.currentAnimation=XGe(0,LX,{...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(LX),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&&hEe(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||lo();const f=uu(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const h=uu(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+h}Ou(l,c),Mv(l,d),Fk(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new cXe),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&&D5("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($X),this.root.sharedNodes.clear()}}}function hXe(e){e.updateLayout()}function pXe(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"?ku(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],m=uu(h);h.min=i[f].min,h.max=h.min+m}):hEe(s,n.layoutBox,i)&&ku(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],m=uu(i[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const l=Pv();Fk(l,i,n.layoutBox);const c=Pv();a?Fk(c,e.applyTransform(r,!0),n.measuredBox):Fk(c,i,n.layoutBox);const u=!cEe(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const g=lo();Bk(g,n.layoutBox,h.layoutBox);const b=lo();Bk(b,i,m.layoutBox),uEe(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 mXe(e){YO&&bb.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 gXe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function bXe(e){e.clearSnapshot()}function $X(e){e.clearMeasurements()}function yXe(e){e.isLayoutDirty=!1}function vXe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function FX(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function xXe(e){e.resolveTargetDelta()}function wXe(e){e.calcProjection()}function OXe(e){e.resetSkewAndRotation()}function kXe(e){e.removeLeadSnapshot()}function BX(e,t,n){e.translate=zs(t.translate,0,n),e.scale=zs(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function UX(e,t,n,i){e.min=zs(t.min,n.min,i),e.max=zs(t.max,n.max,i)}function SXe(e,t,n,i){UX(e.x,t.x,n.x,i),UX(e.y,t.y,n.y,i)}function EXe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const CXe={duration:.45,ease:[.4,0,.1,1]},QX=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),zX=QX("applewebkit/")&&!QX("chrome/")?Math.round:nu;function VX(e){e.min=zX(e.min),e.max=zX(e.max)}function TXe(e){VX(e.x),VX(e.y)}function hEe(e,t,n){return e==="position"||e==="preserve-aspect"&&!jGe(DX(t),DX(n),.2)}function AXe(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const _Xe=fEe({attachResizeListener:(e,t)=>zS(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),M5={current:void 0},pEe=fEe({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!M5.current){const e=new _Xe({});e.mount(window),e.setOptions({layoutScroll:!0}),M5.current=e}return M5.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),jXe={pan:{Feature:qGe},drag:{Feature:HGe,ProjectionNode:pEe,MeasureLayout:oEe}};function NXe(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 mEe(e,t){const n=NXe(e),i=new AbortController,r={passive:!0,...t,signal:i.signal};return[n,r,()=>i.abort()]}function HX(e){return t=>{t.pointerType==="touch"||XSe()||e(t)}}function RXe(e,t,n={}){const[i,r,s]=mEe(e,n),a=HX(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=HX(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,r)});return i.forEach(l=>{l.addEventListener("pointerenter",a,r)}),s}function qX(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&&gs.postRender(()=>s(t,OC(t)))}class IXe extends Ag{mount(){const{current:t}=this.node;t&&(this.unmount=RXe(t,n=>(qX(this.node,n,"Start"),i=>qX(this.node,i,"End"))))}unmount(){}}class PXe extends Ag{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=wC(zS(this.node.current,"focus",()=>this.onFocus()),zS(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const gEe=(e,t)=>t?e===t?!0:gEe(e,t.parentElement):!1,DXe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function MXe(e){return DXe.has(e.tagName)||e.tabIndex!==-1}const ZO=new WeakSet;function WX(e){return t=>{t.key==="Enter"&&e(t)}}function L5(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const LXe=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=WX(()=>{if(ZO.has(n))return;L5(n,"down");const r=WX(()=>{L5(n,"up")}),s=()=>L5(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 KX(e){return gU(e)&&!XSe()}function $Xe(e,t,n={}){const[i,r,s]=mEe(e,n),a=l=>{const c=l.currentTarget;if(!KX(l)||ZO.has(c))return;ZO.add(c);const u=t(l),d=(m,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!KX(m)||!ZO.has(c))&&(ZO.delete(c),typeof u=="function"&&u(m,{success:g}))},f=m=>{d(m,n.useGlobalTarget||gEe(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",h,r)};return i.forEach(l=>{!MXe(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,r),l.addEventListener("focus",u=>LXe(u,r),r)}),s}function GX(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&&gs.postRender(()=>s(t,OC(t)))}class FXe extends Ag{mount(){const{current:t}=this.node;t&&(this.unmount=$Xe(t,n=>(GX(this.node,n,"Start"),(i,{success:r})=>GX(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const P$=new WeakMap,$5=new WeakMap,BXe=e=>{const t=P$.get(e.target);t&&t(e)},UXe=e=>{e.forEach(BXe)};function QXe({root:e,...t}){const n=e||document;$5.has(n)||$5.set(n,{});const i=$5.get(n),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver(UXe,{root:e,...t})),i[r]}function zXe(e,t,n){const i=QXe(t);return P$.set(e,n),i.observe(e),()=>{P$.delete(e),i.unobserve(e)}}const VXe={some:0,all:1};class HXe extends Ag{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:VXe[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 zXe(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(qXe(t,n))&&this.startObserver()}unmount(){}}function qXe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const WXe={inView:{Feature:HXe},tap:{Feature:FXe},focus:{Feature:PXe},hover:{Feature:IXe}},KXe={layout:{ProjectionNode:pEe,MeasureLayout:oEe}},vN={current:null},bU={current:!1};function bEe(){if(bU.current=!0,!!B7)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>vN.current=e.matches;e.addListener(t),t()}else vN.current=!1}const GXe=[...$Se,sl,ig],XXe=e=>GXe.find(LSe(e)),XX=new WeakMap;function YXe(e,t,n){for(const i in t){const r=t[i],s=n[i];if(ll(r))e.addValue(i,r);else if(ll(s))e.addValue(i,US(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,US(a!==void 0?a:r,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const YX=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ZXe{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=fU,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 m=Rf.now();this.renderScheduledAtthis.bindToMotionValue(i,n)),bU.current||bEe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:vN.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){XX.delete(this.current),this.projection&&this.projection.unmount(),ng(this.notifyUpdate),ng(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=Hy.has(t),r=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&gs.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 Hx){const n=Hx[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):lo()}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=US(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"&&(DSe(r)||CSe(r))?r=parseFloat(r):!XXe(r)&&ig.test(n)&&(r=RSe(t,n)),this.setBaseTarget(t,ll(r)?r.get():r)),ll(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=q7(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&&!ll(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 iU),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class yEe extends ZXe{constructor(){super(...arguments),this.KeyframeResolver=FSe}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;ll(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function JXe(e){return window.getComputedStyle(e)}class eYe extends yEe{constructor(){super(...arguments),this.type="html",this.renderInstance=sSe}readValueFromInstance(t,n){if(Hy.has(n)){const i=dU(n);return i&&i.default||0}else{const i=JXe(t),r=(nSe(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return rEe(t,n)}build(t,n,i){G7(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return J7(t,n,i)}}class tYe extends yEe{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=lo}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Hy.has(n)){const i=dU(n);return i&&i.default||0}return n=oSe.has(n)?n:z7(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return cSe(t,n,i)}build(t,n,i){X7(t,n,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,i,r){aSe(t,n,i,r)}mount(t){this.isSVGTag=Z7(t.tagName),super.mount(t)}}const nYe=(e,t)=>H7(e)?new tYe(t):new eYe(t,{allowProjection:e!==p.Fragment}),iYe=_We({...xGe,...WXe,...jXe,...KXe},nYe),cr=Vqe(iYe);function BI(){!bU.current&&bEe();const[e]=p.useState(vN.current);return e}function Yo(){return Yo=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?p.useEffect:p.useLayoutEffect;function ov(e,t,n){var i=p.useRef(t);i.current=t,p.useEffect(function(){function r(s){i.current(s)}return e&&window.addEventListener(e,r,n),function(){e&&window.removeEventListener(e,r)}},[e])}var rYe=["container"];function sYe(e){var t=e.container,n=t===void 0?document.body:t,i=UI(e,rYe);return si.createPortal(yi.createElement("div",Yo({},i)),n)}function oYe(e){return yi.createElement("svg",Yo({width:"44",height:"44",viewBox:"0 0 768 768"},e),yi.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 aYe(e){return yi.createElement("svg",Yo({width:"44",height:"44",viewBox:"0 0 768 768"},e),yi.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 lYe(e){return yi.createElement("svg",Yo({width:"44",height:"44",viewBox:"0 0 768 768"},e),yi.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function cYe(){return p.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function JX(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 am=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 F5(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=am(e,s,n,innerWidth)[0],f=am(t,s,i,innerHeight),h=innerWidth/2,m=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-(m+t))-m+(f[0]?u/2:u),lastCX:a,lastCY:l}}function L$(e,t,n){var i=e%180!=0;return i?[n,t,i]:[t,n,i]}function B5(e,t,n){var i=L$(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 E2(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=p.useRef(e);l.current=e;var c=p.useRef(0),u=p.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=p.useCallback(function(){var h=[].slice.call(arguments),m=Date.now();function g(){c.current=m,d(),l.current.apply(null,h)}var b=c.current,v=m-b;if(b===0&&(i&&g(),c.current=m),r!==void 0){if(v>r)return void g()}else v=1&&s&&s())};d()}function d(){c=requestAnimationFrame(u)}}var dYe={T:0,L:0,W:0,H:0,FIT:void 0},xEe=function(){var e=p.useRef(!1);return p.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},fYe=["className"];function hYe(e){var t=e.className,n=t===void 0?"":t,i=UI(e,fYe);return yi.createElement("div",Yo({className:"PhotoView__Spinner "+n},i),yi.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},yi.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"}),yi.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var pYe=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function mYe(e){var t=e.src,n=e.loaded,i=e.broken,r=e.className,s=e.onPhotoLoad,a=e.loadingElement,l=e.brokenElement,c=UI(e,pYe),u=xEe();return t&&!i?yi.createElement(yi.Fragment,null,yi.createElement("img",Yo({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?yi.createElement("span",{className:"PhotoView__icon"},a):yi.createElement(hYe,{className:"PhotoView__icon"}))):l?yi.createElement("span",{className:"PhotoView__icon"},typeof l=="function"?l({src:t}):l):null}var gYe={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 bYe(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,m=e.className,g=e.style,b=e.loadingElement,v=e.brokenElement,y=e.onPhotoTap,w=e.onMaskTap,x=e.onReachMove,O=e.onReachUp,S=e.onPhotoResize,k=e.isActive,C=e.expose,E=xN(gYe),R=E[0],A=E[1],j=p.useRef(0),T=xEe(),N=R.naturalWidth,_=N===void 0?s:N,D=R.naturalHeight,M=D===void 0?l:D,P=R.width,L=P===void 0?s:P,B=R.height,I=B===void 0?l:B,z=R.loaded,K=z===void 0?!n:z,F=R.broken,q=R.x,H=R.y,X=R.touched,ne=R.stopRaf,Q=R.maskTouched,Z=R.rotate,ce=R.scale,Ee=R.CX,Y=R.CY,G=R.lastX,te=R.lastY,ue=R.lastCX,Ce=R.lastCY,se=R.lastScale,he=R.touchTime,ae=R.touchLength,Ae=R.pause,De=R.reach,ye=ty({onScale:function(Me){return Qe(S2(Me))},onRotate:function(Me){Z!==Me&&(C({rotate:Me}),A(Yo({rotate:Me},B5(_,M,Me))))}});function Qe(Me,bt,jt){ce!==Me&&(C({scale:Me}),A(Yo({scale:Me},F5(q,H,L,I,ce,Me,bt,jt),Me<=1&&{x:0,y:0})))}var we=E2(function(Me,bt,jt){if(jt===void 0&&(jt=0),(X||Q)&&k){var Ct=L$(Z,L,I),sn=Ct[0],We=Ct[1];if(jt===0&&j.current===0){var Le=Math.abs(Me-Ee)<=20,Ge=Math.abs(bt-Y)<=20;if(Le&&Ge)return void A({lastCX:Me,lastCY:bt});j.current=Le?bt>Y?3:2:1}var pt,ot=Me-ue,kt=bt-Ce;if(jt===0){var rt=am(ot+G,ce,sn,innerWidth)[0],qt=am(kt+te,ce,We,innerHeight);pt=function(un,Xe,mt,St){return Xe&&un===1||St==="x"?"x":mt&&un>1||St==="y"?"y":void 0}(j.current,rt,qt[0],De),pt!==void 0&&x(pt,Me,bt,ce)}if(pt==="x"||Q)return void A({reach:"x"});var cn=S2(ce+(jt-ae)/100/2*ce,_/L,.2);C({scale:cn}),A(Yo({touchLength:jt,reach:pt,scale:cn},F5(q,H,L,I,ce,cn,Me,bt,ot,kt)))}},{maxWait:8});function Ne(Me){return!ne&&!X&&(T.current&&A(Yo({},Me,{pause:u})),T.current)}var ie,fe,Se,ke,qe,it,de,ve,Te=(qe=function(Me){return Ne({x:Me})},it=function(Me){return Ne({y:Me})},de=function(Me){return T.current&&(C({scale:Me}),A({scale:Me})),!X&&T.current},ve=ty({X:function(Me){return qe(Me)},Y:function(Me){return it(Me)},S:function(Me){return de(Me)}}),function(Me,bt,jt,Ct,sn,We,Le,Ge,pt,ot,kt){var rt=L$(ot,sn,We),qt=rt[0],cn=rt[1],un=am(Me,Ge,qt,innerWidth),Xe=un[0],mt=un[1],St=am(bt,Ge,cn,innerHeight),on=St[0],zt=St[1],Be=Date.now()-kt;if(Be>=200||Ge!==Le||Math.abs(pt-Le)>1){var at=F5(Me,bt,sn,We,Le,Ge),On=at.x,Je=at.y,yt=Xe?mt:On!==Me?On:null,Bn=on?zt:Je!==bt?Je:null;return yt!==null&&Cb(Me,yt,ve.X),Bn!==null&&Cb(bt,Bn,ve.Y),void(Ge!==Le&&Cb(Le,Ge,ve.S))}var Vt=(Me-jt)/Be,Wn=(bt-Ct)/Be,_n=Math.sqrt(Math.pow(Vt,2)+Math.pow(Wn,2)),ei=!1,Sn=!1;(function(Vn,Cn){var Kn,vr=Vn,xr=0,er=0,He=function(Gn){Kn||(Kn=Gn);var Cr=Gn-Kn,ys=Math.sign(Vn),is=-.001*ys,Tr=Math.sign(-vr)*Math.pow(vr,2)*2e-4,Xn=vr*Cr+(is+Tr)*Math.pow(Cr,2)/2;xr+=Xn,Kn=Gn,ys*(vr+=(is+Tr)*Cr)<=0?tn():Cn(xr)?wt():tn()};function wt(){er=requestAnimationFrame(He)}function tn(){cancelAnimationFrame(er)}wt()})(_n,function(Vn){var Cn=Me+Vn*(Vt/_n),Kn=bt+Vn*(Wn/_n),vr=am(Cn,Le,qt,innerWidth),xr=vr[0],er=vr[1],He=am(Kn,Le,cn,innerHeight),wt=He[0],tn=He[1];if(xr&&!ei&&(ei=!0,Xe?Cb(Cn,er,ve.X):eY(er,Cn+(Cn-er),ve.X)),wt&&!Sn&&(Sn=!0,on?Cb(Kn,tn,ve.Y):eY(tn,Kn+(Kn-tn),ve.Y)),ei&&Sn)return!1;var Gn=ei||ve.X(er),Cr=Sn||ve.Y(tn);return Gn&&Cr})}),Ke=(ie=y,fe=function(Me,bt){De||Qe(ce!==1?1:Math.max(2,_/L),Me,bt)},Se=p.useRef(0),ke=E2(function(){Se.current=0,ie.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var Me=[].slice.call(arguments);Se.current+=1,ke.apply(void 0,Me),Se.current>=2&&(ke.cancel(),Se.current=0,fe.apply(void 0,Me))});function $e(Me,bt){if(j.current=0,(X||Q)&&k){A({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var jt=S2(ce,_/L);if(Te(q,H,G,te,L,I,ce,jt,se,Z,he),O(Me,bt),Ee===Me&&Y===bt){if(X)return void Ke(Me,bt);Q&&w(Me,bt)}}}function At(Me,bt,jt){jt===void 0&&(jt=0),A({touched:!0,CX:Me,CY:bt,lastCX:Me,lastCY:bt,lastX:q,lastY:H,lastScale:ce,touchLength:jt,touchTime:Date.now()})}function Nt(Me){A({maskTouched:!0,CX:Me.clientX,CY:Me.clientY,lastX:q,lastY:H})}ov(mh?void 0:"mousemove",function(Me){Me.preventDefault(),we(Me.clientX,Me.clientY)}),ov(mh?void 0:"mouseup",function(Me){$e(Me.clientX,Me.clientY)}),ov(mh?"touchmove":void 0,function(Me){Me.preventDefault();var bt=JX(Me);we.apply(void 0,bt)},{passive:!1}),ov(mh?"touchend":void 0,function(Me){var bt=Me.changedTouches[0];$e(bt.clientX,bt.clientY)},{passive:!1}),ov("resize",E2(function(){K&&!X&&(A(B5(_,M,Z)),S())},{maxWait:8})),M$(function(){k&&C(Yo({scale:ce,rotate:Z},ye))},[k]);var vt=function(Me,bt,jt,Ct,sn,We,Le,Ge,pt,ot){var kt=function(On,Je,yt,Bn,Vt){var Wn=p.useRef(!1),_n=xN({lead:!0,scale:yt}),ei=_n[0],Sn=ei.lead,Vn=ei.scale,Cn=_n[1],Kn=E2(function(vr){try{return Vt(!0),Cn({lead:!1,scale:vr}),Promise.resolve()}catch(xr){return Promise.reject(xr)}},{wait:Bn});return M$(function(){Wn.current?(Vt(!1),Cn({lead:!0}),Kn(yt)):Wn.current=!0},[yt]),Sn?[On*Vn,Je*Vn,yt/Vn]:[On*yt,Je*yt,1]}(We,Le,Ge,pt,ot),rt=kt[0],qt=kt[1],cn=kt[2],un=function(On,Je,yt,Bn,Vt){var Wn=p.useState(dYe),_n=Wn[0],ei=Wn[1],Sn=p.useState(0),Vn=Sn[0],Cn=Sn[1],Kn=p.useRef(),vr=ty({OK:function(){return On&&Cn(4)}});function xr(er){Vt(!1),Cn(er)}return p.useEffect(function(){if(Kn.current||(Kn.current=Date.now()),yt){if(function(er,He){var wt=er&&er.current;if(wt&&wt.nodeType===1){var tn=wt.getBoundingClientRect();He({T:tn.top,L:tn.left,W:tn.width,H:tn.height,FIT:wt.tagName==="IMG"?getComputedStyle(wt).objectFit:void 0})}}(Je,ei),On)return Date.now()-Kn.current<250?(Cn(1),requestAnimationFrame(function(){Cn(2),requestAnimationFrame(function(){return xr(3)})}),void setTimeout(vr.OK,Bn)):void Cn(4);xr(5)}},[On,yt]),[Vn,_n]}(Me,bt,jt,pt,ot),Xe=un[0],mt=un[1],St=mt.W,on=mt.FIT,zt=innerWidth/2,Be=innerHeight/2,at=Xe<3||Xe>4;return[at?St?mt.L:zt:Ct+(zt-We*Ge/2),at?St?mt.T:Be:sn+(Be-Le*Ge/2),rt,at&&on?rt*(mt.H/St):qt,Xe===0?cn:at?St/(We*Ge)||.01:cn,at?on?1:0:1,Xe,on]}(u,c,K,q,H,L,I,ce,d,function(Me){return A({pause:Me})}),Ot=vt[4],Tt=vt[6],ft="transform "+d+"ms "+f,gt={className:m,onMouseDown:mh?void 0:function(Me){Me.stopPropagation(),Me.button===0&&At(Me.clientX,Me.clientY,0)},onTouchStart:mh?function(Me){Me.stopPropagation(),At.apply(void 0,JX(Me))}:void 0,onWheel:function(Me){if(!De){var bt=S2(ce-Me.deltaY/100/2,_/L);A({stopRaf:!0}),Qe(bt,Me.clientX,Me.clientY)}},style:{width:vt[2]+"px",height:vt[3]+"px",opacity:vt[5],objectFit:Tt===4?void 0:vt[7],transform:Z?"rotate("+Z+"deg)":void 0,transition:Tt>2?ft+", opacity "+d+"ms ease, height "+(Tt<4?d/2:Tt>4?d:0)+"ms "+f:void 0}};return yi.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:g,onMouseDown:!mh&&k?Nt:void 0,onTouchStart:mh&&k?function(Me){return Nt(Me.touches[0])}:void 0},yi.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+Ot+", 0, 0, "+Ot+", "+vt[0]+", "+vt[1]+")",transition:X||Ae?void 0:ft,willChange:k?"transform":void 0}},n?yi.createElement(mYe,Yo({src:n,loaded:K,broken:F},gt,{onPhotoLoad:function(Me){A(Yo({},Me,Me.loaded&&B5(Me.naturalWidth||0,Me.naturalHeight||0,Z)))},loadingElement:b,brokenElement:v})):i&&i({attrs:gt,scale:Ot,rotate:Z})))}var tY={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 yYe(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,m=h===void 0||h,g=e.overlayRender,b=e.toolbarRender,v=e.className,y=e.maskClassName,w=e.photoClassName,x=e.photoWrapClassName,O=e.loadingElement,S=e.brokenElement,k=e.images,C=e.index,E=C===void 0?0:C,R=e.onIndexChange,A=e.visible,j=e.onClose,T=e.afterClose,N=e.portalContainer,_=xN(tY),D=_[0],M=_[1],P=p.useState(0),L=P[0],B=P[1],I=D.x,z=D.touched,K=D.pause,F=D.lastCX,q=D.lastCY,H=D.bg,X=H===void 0?u:H,ne=D.lastBg,Q=D.overlay,Z=D.minimal,ce=D.scale,Ee=D.rotate,Y=D.onScale,G=D.onRotate,te=e.hasOwnProperty("index"),ue=te?E:L,Ce=te?R:B,se=p.useRef(ue),he=k.length,ae=k[ue],Ae=typeof n=="boolean"?n:he>n,De=function(Ot,Tt){var ft=p.useReducer(function(jt){return!jt},!1)[1],gt=p.useRef(0),Me=function(jt){var Ct=p.useRef(jt);function sn(We){Ct.current=We}return p.useMemo(function(){(function(We){Ot?(We(Ot),gt.current=1):gt.current=2})(sn)},[jt]),[Ct.current,sn]}(Ot),bt=Me[1];return[Me[0],gt.current,function(){ft(),gt.current===2&&(bt(!1),Tt&&Tt()),gt.current=0}]}(A,T),ye=De[0],Qe=De[1],we=De[2];M$(function(){if(ye)return M({pause:!0,x:ue*-(innerWidth+P0)}),void(se.current=ue);M(tY)},[ye]);var Ne=ty({close:function(Ot){G&&G(0),M({overlay:!0,lastBg:X}),j(Ot)},changeIndex:function(Ot,Tt){Tt===void 0&&(Tt=!1);var ft=Ae?se.current+(Ot-ue):Ot,gt=he-1,Me=D$(ft,0,gt),bt=Ae?ft:Me,jt=innerWidth+P0;M({touched:!1,lastCX:void 0,lastCY:void 0,x:-jt*bt,pause:Tt}),se.current=bt,Ce&&Ce(Ae?Ot<0?gt:Ot>gt?0:Ot:Me)}}),ie=Ne.close,fe=Ne.changeIndex;function Se(Ot){return Ot?ie():M({overlay:!Q})}function ke(){M({x:-(innerWidth+P0)*ue,lastCX:void 0,lastCY:void 0,pause:!0}),se.current=ue}function qe(Ot,Tt,ft,gt){Ot==="x"?function(Me){if(F!==void 0){var bt=Me-F,jt=bt;!Ae&&(ue===0&&bt>0||ue===he-1&&bt<0)&&(jt=bt/2),M({touched:!0,lastCX:F,x:-(innerWidth+P0)*se.current+jt,pause:!1})}else M({touched:!0,lastCX:Me,x:I,pause:!1})}(Tt):Ot==="y"&&function(Me,bt){if(q!==void 0){var jt=u===null?null:D$(u,.01,u-Math.abs(Me-q)/100/4);M({touched:!0,lastCY:q,bg:bt===1?jt:u,minimal:bt===1})}else M({touched:!0,lastCY:Me,bg:X,minimal:!0})}(ft,gt)}function it(Ot,Tt){var ft=Ot-(F??Ot),gt=Tt-(q??Tt),Me=!1;if(ft<-40)fe(ue+1);else if(ft>40)fe(ue-1);else{var bt=-(innerWidth+P0)*se.current;Math.abs(gt)>100&&Z&&f&&(Me=!0,ie()),M({touched:!1,x:bt,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!Me||Q})}}ov("keydown",function(Ot){if(A)switch(Ot.key){case"ArrowLeft":fe(ue-1,!0);break;case"ArrowRight":fe(ue+1,!0);break;case"Escape":ie()}});var de=function(Ot,Tt,ft){return p.useMemo(function(){var gt=Ot.length;return ft?Ot.concat(Ot).concat(Ot).slice(gt+Tt-1,gt+Tt+2):Ot.slice(Math.max(Tt-1,0),Math.min(Tt+2,gt+1))},[Ot,Tt,ft])}(k,ue,Ae);if(!ye)return null;var ve=Q&&!Qe,Te=A?X:ne,Ke=Y&&G&&{images:k,index:ue,visible:A,onClose:ie,onIndexChange:fe,overlayVisible:ve,overlay:ae&&ae.overlay,scale:ce,rotate:Ee,onScale:Y,onRotate:G},$e=i?i(Qe):400,At=r?r(Qe):ZX,Nt=i?i(3):600,vt=r?r(3):ZX;return yi.createElement(sYe,{className:"PhotoView-Portal"+(ve?"":" PhotoView-Slider__clean")+(A?"":" PhotoView-Slider__willClose")+(v?" "+v:""),role:"dialog",onClick:function(Ot){return Ot.stopPropagation()},container:N},A&&yi.createElement(cYe,null),yi.createElement("div",{className:"PhotoView-Slider__Backdrop"+(y?" "+y:"")+(Qe===1?" PhotoView-Slider__fadeIn":Qe===2?" PhotoView-Slider__fadeOut":""),style:{background:Te?"rgba(0, 0, 0, "+Te+")":void 0,transitionTimingFunction:At,transitionDuration:(z?0:$e)+"ms",animationDuration:$e+"ms"},onAnimationEnd:we}),m&&yi.createElement("div",{className:"PhotoView-Slider__BannerWrap"},yi.createElement("div",{className:"PhotoView-Slider__Counter"},ue+1," / ",he),yi.createElement("div",{className:"PhotoView-Slider__BannerRight"},b&&Ke&&b(Ke),yi.createElement(oYe,{className:"PhotoView-Slider__toolbarIcon",onClick:ie}))),de.map(function(Ot,Tt){var ft=Ae||ue!==0?se.current-1+Tt:ue+Tt;return yi.createElement(bYe,{key:Ae?Ot.key+"/"+Ot.src+"/"+ft:Ot.key,item:Ot,speed:$e,easing:At,visible:A,onReachMove:qe,onReachUp:it,onPhotoTap:function(){return Se(s)},onMaskTap:function(){return Se(l)},wrapClassName:x,className:w,style:{left:(innerWidth+P0)*ft+"px",transform:"translate3d("+I+"px, 0px, 0)",transition:z||K?void 0:"transform "+Nt+"ms "+vt},loadingElement:O,brokenElement:S,onPhotoResize:ke,isActive:se.current===ft,expose:M})}),!mh&&m&&yi.createElement(yi.Fragment,null,(Ae||ue!==0)&&yi.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return fe(ue-1,!0)}},yi.createElement(aYe,null)),(Ae||ue+1-1){var y=u.slice();return y.splice(v,1,b),void l({images:y})}l(function(w){return{images:w.images.concat(b)}})},remove:function(b){l(function(v){var y=v.images.filter(function(w){return w.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)}}),m=ty({close:function(){l({visible:!1}),i&&i(!1,f,a)},changeIndex:function(b){l({index:b}),n&&n(b,a)}}),g=p.useMemo(function(){return Yo({},a,h)},[a,h]);return yi.createElement(vEe.Provider,{value:g},t,yi.createElement(yYe,Yo({images:u,visible:d,index:f,onIndexChange:m.changeIndex,onClose:m.close},r)))}var wEe=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=p.useContext(vEe),h=(t=function(){return f.nextId()},(n=p.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),m=p.useRef(null);p.useImperativeHandle(d==null?void 0:d.ref,function(){return m.current}),p.useEffect(function(){return function(){f.remove(h)}},[]);var g=ty({render:function(v){return r&&r(v)},show:function(v,y){f.show(h),function(w,x){if(d){var O=d.props[w];O&&O(x)}}(v,y)}}),b=p.useMemo(function(){var v={};return u.forEach(function(y){v[y]=g.show.bind(null,y)}),v},[]);return p.useEffect(function(){f.update({key:h,src:i,originRef:m,render:g.render,overlay:s,width:a,height:l})},[i]),d?p.Children.only(p.cloneElement(d,Yo({},b,{ref:m}))):null};function my(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.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),o.jsx("path",{d:"m7.5 9 2.7 2.5L7.5 14M12.7 14h3.8"}),o.jsx("path",{d:"M3.8 7.5h16.4",opacity:".55"})]})}function OEe(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.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),o.jsx("path",{d:"M3.8 8h16.4"}),o.jsx("circle",{cx:"6.5",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"8.8",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),o.jsx("path",{d:"m9 15 2.2-4 1.6 2.4 1.1-1.2L16 15H9Z"})]})}function yU(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:"M12 3.4 19 6v5.3c0 4.3-2.7 7.6-7 9.3-4.3-1.7-7-5-7-9.3V6l7-2.6Z"}),o.jsx("path",{d:"m8.8 12 2 2 4.4-4.4"})]})}function P_(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:"M3.5 7.7h6.1l1.7 2h9.2v7.5a2.3 2.3 0 0 1-2.3 2.3H5.8a2.3 2.3 0 0 1-2.3-2.3V7.7Z"}),o.jsx("path",{d:"M3.8 7.7V6.8a2.3 2.3 0 0 1 2.3-2.3h3l1.8 2h6.9a2.3 2.3 0 0 1 2.3 2.3v.9"}),o.jsx("path",{d:"M12 13v3M10.5 14.5h3"})]})}function OYe(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 5v14M5 12h14"})})}function nY(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 11.5 5.5-5.5 5.5 5.5M12 6v12"})})}function iY(e){return o.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",...e,children:o.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1.75",fill:"currentColor"})})}function kYe(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.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),o.jsx("circle",{cx:"8.5",cy:"9",r:"1.4"}),o.jsx("path",{d:"m5.5 17 4.2-4.2 2.6 2.4 2.1-2.1 4.1 3.9"})]})}function SYe(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.5h7l5 5v12H6z"}),o.jsx("path",{d:"M13 3.5v5h5M9 13h6M9 16h5"})]})}function EYe(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.5",y:"5",width:"13.5",height:"14",rx:"2.5"}),o.jsx("path",{d:"m17 10 3.5-2v8L17 14zM7 8.5h4.5"})]})}function CYe(e){return o.jsx("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:"m12 3 1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM18.5 15.5l.7 2.1 2.1.7-2.1.7-.7 2.1-.7-2.1-2.1-.7 2.1-.7z"})})}function kEe(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function $$(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:"m9 6 6 6-6 6"})})}function TYe(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:"M4.8 8.2A8 8 0 1 1 4 12M4.8 8.2V4.5M4.8 8.2h3.7"}),o.jsx("path",{d:"M12 8v4.5l3 1.8"})]})}function nc(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"M20 12a8 8 0 1 1-2.35-5.65"})})}function AYe(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:"8",y:"8",width:"11",height:"11",rx:"2"}),o.jsx("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"})]})}function SEe(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:"m5 12.5 4.2 4.2L19 7"})})}function V(e,t={}){return hn.t(e,{...t,ns:"adk"})}function Ll(e){const t=new Headers(e);return t.has("Accept-Language")||t.set("Accept-Language",hn.resolvedLanguage||hn.language),t}function F$(){return hn.resolvedLanguage||hn.language}const rY="veadk_auth_qs",_Ye=new Set(["view","source","sessionId","artifactSha256","validationReportSha256","projectId","versionId"]);let iO=null;function jYe(){if(iO!==null)return iO;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&&_Ye.has(a)?n:t).append(a,s)});const r=t.toString();if(r?(sessionStorage.setItem(rY,r),iO=r):iO=sessionStorage.getItem(rY)??"",r){const s=n.toString();window.history.replaceState(null,"",window.location.pathname+(s?`?${s}`:"")+window.location.hash)}return iO}function ta(e){const t=jYe();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}const qa=3e4,hr=12e4,vU=1e4;function Wa(e,t=qa){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const wN="veadk_local_user",ON="veadk_local_user_tab",NYe="X-VeADK-OAuth-Refresh-Retry",RYe=[50,250],IYe=/^[A-Za-z0-9]{1,16}$/;function EEe(){try{const e=sessionStorage.getItem(ON);if(e)return e;const t=localStorage.getItem(wN);return t&&sessionStorage.setItem(ON,t),t}catch{try{return localStorage.getItem(wN)}catch{return null}}}function sY(e){try{sessionStorage.setItem(ON,e)}catch{}try{localStorage.setItem(wN,e)}catch{}}function PYe(){try{sessionStorage.removeItem(ON)}catch{}try{localStorage.removeItem(wN)}catch{}}function pu(e){const t=new Headers(e),n=EEe();return n&&t.set("X-VeADK-Local-User",n),t}async function CEe(){let e;try{e=await fetch("/web/auth-config",{headers:Ll({Accept:"application/json"}),signal:Wa(void 0,vU)})}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 DYe(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function MYe(){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 LYe(){const[e,t]=await Promise.all([B$(),CEe()]);return e.status==="unauthenticated"&&t.length>0}function $Ye(){window.location.assign("/oauth2/logout")}async function FYe(){for(let e=0;;e+=1){let t;try{t=await fetch("/oauth2/userinfo",{headers:Ll({Accept:"application/json"}),signal:Wa(void 0,vU)})}catch(i){throw console.warn("[identity] /oauth2/userinfo is unreachable:",i),new Error(V("identity.serviceNetworkFailed"))}const n=RYe[e];if(t.status!==401||t.headers.get(NYe)!=="1"||n===void 0)return t;await new Promise(i=>window.setTimeout(i,n))}}async function B$(){const e=await FYe();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=EEe();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function BYe(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 UYe(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const U$="veadk:authentication-required";let Uk=null,JO=null;function QYe(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 zYe(e){Uk||(Uk=new Promise(n=>{JO=n}),window.dispatchEvent(new Event(U$)));const t=Uk;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 VYe(){return Uk!==null}function HYe(){JO==null||JO(),JO=null,Uk=null}async function QI(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 qYe=/\brun_sse\s*failed\s*:\s*404\b/i,WYe=/session not found/i,KYe=/(?:^|[::\s])not found\s*$/i,GYe=/Expecting (?:'[^']+'|\w+)(?: delimiter)?: line \d+ column \d+ \(char \d+\)/i,XYe=/Unknown or expired collection_id\s+'[^']+'\.\s*Call collect_resources first\./i,YYe=/(?: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 D0(e,t){return e.includes(t)?e:`${e} + `),()=>{document.head.removeChild(d)}},[t]),o.jsx(Bqe,{isPresent:t,childRef:i,sizeRef:r,children:p.cloneElement(e,{ref:i})})}const Qqe=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:r,presenceAffectsLayout:s,mode:a})=>{const l=PI(zqe),c=p.useId(),u=p.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;i&&i()},[l,i]),d=p.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 p.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),p.useEffect(()=>{!n&&!l.size&&i&&i()},[n]),a==="popLayout"&&(e=o.jsx(Uqe,{isPresent:n,children:e})),o.jsx(DI.Provider,{value:d,children:e})};function zqe(){return new Map}function Xke(e=!0){const t=p.useContext(DI);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=t,s=p.useId();p.useEffect(()=>{e&&r(s)},[e]);const a=p.useCallback(()=>e&&i&&i(s),[s,i,e]);return!n&&i?[!1,a]:[!0]}const vA=e=>e.key||"";function LG(e){const t=[];return p.Children.forEach(e,n=>{p.isValidElement(n)&&t.push(n)}),t}const B7=typeof window<"u",Yke=B7?p.useLayoutEffect:p.useEffect,_d=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:s="sync",propagate:a=!1})=>{const[l,c]=Xke(a),u=p.useMemo(()=>LG(e),[e]),d=a&&!l?[]:u.map(vA),f=p.useRef(!0),h=p.useRef(u),m=PI(()=>new Map),[g,b]=p.useState(u),[v,y]=p.useState(u);Yke(()=>{f.current=!1,h.current=u;for(let O=0;O{const S=vA(O),k=a&&!l?!1:u===v||d.includes(S),C=()=>{if(m.has(S))m.set(S,!0);else return;let E=!0;m.forEach(R=>{R||(E=!1)}),E&&(x==null||x(),y(h.current),a&&(c==null||c()),i&&i())};return o.jsx(Qqe,{isPresent:k,initial:!f.current||n?void 0:!1,custom:k?void 0:t,presenceAffectsLayout:r,mode:s,onExitComplete:k?void 0:C,children:O},S)})})},tu=e=>e;let Zke=tu;const Vqe={useManualTiming:!1};function Hqe(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 m=f&&i?t:n;return d&&s.add(u),m.has(u)||m.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 xA=["read","resolveKeyframes","update","preRender","render","postRender"],qqe=40;function Jke(e,t){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,a=xA.reduce((y,w)=>(y[w]=Hqe(s),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=a,m=()=>{const y=performance.now();n=!1,r.delta=i?1e3/60:Math.max(Math.min(y-r.timestamp,qqe),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(m))},g=()=>{n=!0,i=!0,r.isProcessing||e(m)};return{schedule:xA.reduce((y,w)=>{const x=a[w];return y[w]=(O,S=!1,k=!1)=>(n||g(),x.schedule(O,S,k)),y},{}),cancel:y=>{for(let w=0;w$G[e].some(n=>!!t[n])};function Wqe(e){for(const t in e)Hx[t]={...Hx[t],...e[t]}}const Kqe=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 hN(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Kqe.has(e)}let tSe=e=>!hN(e);function nSe(e){e&&(tSe=t=>t.startsWith("on")?!hN(t):e(t))}try{nSe(require("@emotion/is-prop-valid").default)}catch{}function Gqe(e,t,n){const i={};for(const r in e)r==="values"&&typeof e.values=="object"||(tSe(r)||n===!0&&hN(r)||!t&&!hN(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}function Xqe({children:e,isValidProp:t,...n}){t&&nSe(t),n={...p.useContext($S),...n},n.isStatic=PI(()=>n.isStatic);const i=p.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return o.jsx($S.Provider,{value:i,children:e})}function Yqe(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 MI=p.createContext({});function FS(e){return typeof e=="string"||Array.isArray(e)}function LI(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const U7=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Q7=["initial",...U7];function $I(e){return LI(e.animate)||Q7.some(t=>FS(e[t]))}function iSe(e){return!!($I(e)||e.variants)}function Zqe(e,t){if($I(e)){const{initial:n,animate:i}=e;return{initial:n===!1||FS(n)?n:void 0,animate:FS(i)?i:void 0}}return e.inherit!==!1?t:{}}function Jqe(e){const{initial:t,animate:n}=Zqe(e,p.useContext(MI));return p.useMemo(()=>({initial:t,animate:n}),[FG(t),FG(n)])}function FG(e){return Array.isArray(e)?e.join(" "):e}const eWe=Symbol.for("motionComponentSymbol");function Rv(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function tWe(e,t,n){return p.useCallback(i=>{i&&e.onMount&&e.onMount(i),t&&(i?t.mount(i):t.unmount()),n&&(typeof n=="function"?n(i):Rv(n)&&(n.current=i))},[t])}const z7=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),nWe="framerAppearId",rSe="data-"+z7(nWe),{schedule:V7}=Jke(queueMicrotask,!1),sSe=p.createContext({});function iWe(e,t,n,i,r){var s,a;const{visualElement:l}=p.useContext(MI),c=p.useContext(eSe),u=p.useContext(DI),d=p.useContext($S).reducedMotion,f=p.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,m=p.useContext(sSe);h&&!h.projection&&r&&(h.type==="html"||h.type==="svg")&&rWe(f.current,n,r,m);const g=p.useRef(!1);p.useInsertionEffect(()=>{h&&g.current&&h.update(n,u)});const b=n[rSe],v=p.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 Yke(()=>{h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),V7.render(h.render),v.current&&h.animationState&&h.animationState.animateChanges())}),p.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 rWe(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:oSe(e.parent)),e.projection.setOptions({layoutId:r,layout:s,alwaysMeasureLayout:!!a||l&&Rv(l),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,layoutScroll:c,layoutRoot:u})}function oSe(e){if(e)return e.options.allowProjection!==!1?e.projection:oSe(e.parent)}function sWe({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:r}){var s,a;e&&Wqe(e);function l(u,d){let f;const h={...p.useContext($S),...u,layoutId:oWe(u)},{isStatic:m}=h,g=Jqe(u),b=i(u,m);if(!m&&B7){aWe();const v=lWe(h);f=v.MeasureLayout,g.visualElement=iWe(r,b,h,t,v.ProjectionNode)}return o.jsxs(MI.Provider,{value:g,children:[f&&g.visualElement?o.jsx(f,{visualElement:g.visualElement,...h}):null,n(r,u,tWe(b,g.visualElement,d),b,m,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=p.forwardRef(l);return c[eWe]=r,c}function oWe({layoutId:e}){const t=p.useContext(F7).id;return t&&e!==void 0?t+"-"+e:e}function aWe(e,t){p.useContext(eSe).strict}function lWe(e){const{drag:t,layout:n}=Hx;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 cWe=["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 H7(e){return typeof e!="string"||e.includes("-")?!1:!!(cWe.indexOf(e)>-1||/[A-Z]/u.test(e))}function BG(e){const t=[{},{}];return e==null||e.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function q7(e,t,n,i){if(typeof t=="function"){const[r,s]=BG(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]=BG(i);t=t(n!==void 0?n:e.custom,r,s)}return t}const x$=e=>Array.isArray(e),uWe=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),dWe=e=>x$(e)?e[e.length-1]||0:e,al=e=>!!(e&&e.getVelocity);function j_(e){const t=al(e)?e.get():e;return uWe(t)?t.toValue():t}function fWe({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},i,r,s){const a={latestValues:hWe(i,r,s,e),renderState:t()};return n&&(a.onMount=l=>n({props:i,current:l,...a}),a.onUpdate=l=>n(l)),a}const aSe=e=>(t,n)=>{const i=p.useContext(MI),r=p.useContext(DI),s=()=>fWe(e,t,i,r);return n?s():PI(s)};function hWe(e,t,n,i){const r={},s=i(e,{});for(const h in s)r[h]=j_(s[h]);let{initial:a,animate:l}=e;const c=$I(e),u=iSe(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"&&!LI(f)){const h=Array.isArray(f)?f:[f];for(let m=0;mt=>typeof t=="string"&&t.startsWith(e),cSe=lSe("--"),pWe=lSe("var(--"),W7=e=>pWe(e)?mWe.test(e.split("/*")[0].trim()):!1,mWe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,uSe=(e,t)=>t&&typeof e=="number"?t.transform(e):e,ap=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},BS={...Fw,transform:e=>ap(0,1,e)},wA={...Fw,default:1},vC=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),nm=vC("deg"),Rf=vC("%"),Ln=vC("px"),gWe=vC("vh"),bWe=vC("vw"),UG={...Rf,parse:e=>Rf.parse(e)/100,transform:e=>Rf.transform(e*100)},yWe={borderWidth:Ln,borderTopWidth:Ln,borderRightWidth:Ln,borderBottomWidth:Ln,borderLeftWidth:Ln,borderRadius:Ln,radius:Ln,borderTopLeftRadius:Ln,borderTopRightRadius:Ln,borderBottomRightRadius:Ln,borderBottomLeftRadius:Ln,width:Ln,maxWidth:Ln,height:Ln,maxHeight:Ln,top:Ln,right:Ln,bottom:Ln,left:Ln,padding:Ln,paddingTop:Ln,paddingRight:Ln,paddingBottom:Ln,paddingLeft:Ln,margin:Ln,marginTop:Ln,marginRight:Ln,marginBottom:Ln,marginLeft:Ln,backgroundPositionX:Ln,backgroundPositionY:Ln},vWe={rotate:nm,rotateX:nm,rotateY:nm,rotateZ:nm,scale:wA,scaleX:wA,scaleY:wA,scaleZ:wA,skew:nm,skewX:nm,skewY:nm,distance:Ln,translateX:Ln,translateY:Ln,translateZ:Ln,x:Ln,y:Ln,z:Ln,perspective:Ln,transformPerspective:Ln,opacity:BS,originX:UG,originY:UG,originZ:Ln},QG={...Fw,transform:Math.round},K7={...yWe,...vWe,zIndex:QG,size:Ln,fillOpacity:BS,strokeOpacity:BS,numOctaves:QG},xWe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},wWe=$w.length;function OWe(e,t,n){let i="",r=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}}),dSe=()=>({...Y7(),attrs:{}}),Z7=e=>typeof e=="string"&&e.toLowerCase()==="svg";function fSe(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 hSe=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 pSe(e,t,n,i){fSe(e,t,void 0,i);for(const r in t.attrs)e.setAttribute(hSe.has(r)?r:z7(r),t.attrs[r])}const pN={};function TWe(e){Object.assign(pN,e)}function mSe(e,{layout:t,layoutId:n}){return qy.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!pN[e]||e==="opacity")}function J7(e,t,n){var i;const{style:r}=e,s={};for(const a in r)(al(r[a])||t.style&&al(t.style[a])||mSe(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 gSe(e,t,n){const i=J7(e,t,n);for(const r in e)if(al(e[r])||al(t[r])){const s=$w.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[s]=e[r]}return i}function AWe(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 VG=["x","y","width","height","cx","cy","r"],_We={useVisualState:aSe({scrapeMotionValuesFromProps:gSe,createRenderState:dSe,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(qy.has(l)){s=!0;break}}if(!s)return;let a=!t;if(t)for(let l=0;l{AWe(n,i),vs.render(()=>{X7(i,r,Z7(n.tagName),e.transformTemplate),pSe(n,i)})})}})},jWe={useVisualState:aSe({scrapeMotionValuesFromProps:J7,createRenderState:Y7})};function bSe(e,t,n){for(const i in t)!al(t[i])&&!mSe(i,n)&&(e[i]=t[i])}function NWe({transformTemplate:e},t){return p.useMemo(()=>{const n=Y7();return G7(n,t,e),Object.assign({},n.vars,n.style)},[t])}function RWe(e,t){const n=e.style||{},i={};return bSe(i,n,e),Object.assign(i,NWe(e,t)),i}function IWe(e,t){const n={},i=RWe(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 PWe(e,t,n,i){const r=p.useMemo(()=>{const s=dSe();return X7(s,t,Z7(i),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};bSe(s,e.style,e),r.style={...s,...r.style}}return r}function DWe(e=!1){return(n,i,r,{latestValues:s},a)=>{const c=(H7(n)?PWe:IWe)(i,s,a,n),u=Gqe(i,typeof n=="string",e),d=n!==p.Fragment?{...u,...c,ref:r}:{},{children:f}=i,h=p.useMemo(()=>al(f)?f.get():f,[f]);return p.createElement(n,{...d,children:h})}}function MWe(e,t){return function(i,{forwardMotionProps:r}={forwardMotionProps:!1}){const a={...H7(i)?_We:jWe,preloadedFeatures:e,useRender:DWe(r),createVisualElement:t,Component:i};return sWe(a)}}function ySe(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i(N_===void 0&&If.set(Da.isProcessing||Vqe.useManualTiming?Da.timestamp:performance.now()),N_),set:e=>{N_=e,queueMicrotask(LWe)}};function tU(e,t){e.indexOf(t)===-1&&e.push(t)}function nU(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class iU{constructor(){this.subscriptions=[]}add(t){return tU(this.subscriptions,t),()=>nU(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 FWe{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,r=!0)=>{const s=If.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=If.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=$We(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 iU);const i=this.events[t].add(n);return t==="change"?()=>{i(),vs.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=If.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>HG)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,HG);return xSe(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 US(e,t){return new FWe(e,t)}function BWe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,US(n))}function UWe(e,t){const n=FI(e,t);let{transitionEnd:i={},transition:r={},...s}=n||{};s={...s,...i};for(const a in s){const l=dWe(s[a]);BWe(e,a,l)}}function QWe(e){return!!(al(e)&&e.add)}function w$(e,t){const n=e.getValue("willChange");if(QWe(n))return n.add(t)}function wSe(e){return e.props[rSe]}function rU(e){let t;return()=>(t===void 0&&(t=e()),t)}const zWe=rU(()=>window.ScrollTimeline!==void 0);class VWe{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(zWe()&&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 HWe extends VWe{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const Vh=e=>e*1e3,Hh=e=>e/1e3;function sU(e){return typeof e=="function"}function qG(e,t){e.timeline=t,e.onfinish=null}const oU=e=>Array.isArray(e)&&typeof e[0]=="number",qWe={linearEasing:void 0};function WWe(e,t){const n=rU(e);return()=>{var i;return(i=qWe[t])!==null&&i!==void 0?i:n()}}const mN=WWe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),qx=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i},OSe=(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})`,O$={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:YO([0,.65,.55,1]),circOut:YO([.55,0,1,.45]),backIn:YO([.31,.01,.66,-.59]),backOut:YO([.33,1.53,.69,.99])};function SSe(e,t){if(e)return typeof e=="function"&&mN()?OSe(e,t):oU(e)?YO(e):Array.isArray(e)?e.map(n=>SSe(n,t)||O$.easeOut):O$[e]}const ESe=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,KWe=1e-7,GWe=12;function XWe(e,t,n,i,r){let s,a,l=0;do a=t+(n-t)/2,s=ESe(a,i,r)-e,s>0?n=a:t=a;while(Math.abs(s)>KWe&&++lXWe(s,0,1,e,n);return s=>s===0||s===1?s:ESe(r(s),t,i)}const CSe=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,TSe=e=>t=>1-e(1-t),ASe=xC(.33,1.53,.69,.99),aU=TSe(ASe),_Se=CSe(aU),jSe=e=>(e*=2)<1?.5*aU(e):.5*(2-Math.pow(2,-10*(e-1))),lU=e=>1-Math.sin(Math.acos(e)),NSe=TSe(lU),RSe=CSe(lU),ISe=e=>/^0[^.\s]+$/u.test(e);function YWe(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||ISe(e):!0}const Lk=e=>Math.round(e*1e5)/1e5,cU=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ZWe(e){return e==null}const JWe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,uU=(e,t)=>n=>!!(typeof n=="string"&&JWe.test(n)&&n.startsWith(e)||t&&!ZWe(n)&&Object.prototype.hasOwnProperty.call(n,t)),PSe=(e,t,n)=>i=>{if(typeof i!="string")return i;const[r,s,a,l]=i.match(cU);return{[e]:parseFloat(r),[t]:parseFloat(s),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},eKe=e=>ap(0,255,e),A5={...Fw,transform:e=>Math.round(eKe(e))},Db={test:uU("rgb","red"),parse:PSe("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+A5.transform(e)+", "+A5.transform(t)+", "+A5.transform(n)+", "+Lk(BS.transform(i))+")"};function tKe(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 k$={test:uU("#"),parse:tKe,transform:Db.transform},Iv={test:uU("hsl","hue"),parse:PSe("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+Rf.transform(Lk(t))+", "+Rf.transform(Lk(n))+", "+Lk(BS.transform(i))+")"},rl={test:e=>Db.test(e)||k$.test(e)||Iv.test(e),parse:e=>Db.test(e)?Db.parse(e):Iv.test(e)?Iv.parse(e):k$.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Db.transform(e):Iv.transform(e)},nKe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function iKe(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(cU))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(nKe))===null||n===void 0?void 0:n.length)||0)>0}const DSe="number",MSe="color",rKe="var",sKe="var(",WG="${}",oKe=/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 QS(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},r=[];let s=0;const l=t.replace(oKe,c=>(rl.test(c)?(i.color.push(s),r.push(MSe),n.push(rl.parse(c))):c.startsWith(sKe)?(i.var.push(s),r.push(rKe),n.push(c)):(i.number.push(s),r.push(DSe),n.push(parseFloat(c))),++s,WG)).split(WG);return{values:n,split:l,indexes:i,types:r}}function LSe(e){return QS(e).values}function $Se(e){const{split:t,types:n}=QS(e),i=t.length;return r=>{let s="";for(let a=0;atypeof e=="number"?0:e;function lKe(e){const t=LSe(e);return $Se(e)(t.map(aKe))}const rg={test:iKe,parse:LSe,createTransformer:$Se,getAnimatableNone:lKe},cKe=new Set(["brightness","contrast","saturate","opacity"]);function uKe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(cU)||[];if(!i)return e;const r=n.replace(i,"");let s=cKe.has(t)?1:0;return i!==n&&(s*=100),t+"("+s+r+")"}const dKe=/\b([a-z-]*)\(.*?\)/gu,S$={...rg,getAnimatableNone:e=>{const t=e.match(dKe);return t?t.map(uKe).join(" "):e}},fKe={...K7,color:rl,backgroundColor:rl,outlineColor:rl,fill:rl,stroke:rl,borderColor:rl,borderTopColor:rl,borderRightColor:rl,borderBottomColor:rl,borderLeftColor:rl,filter:S$,WebkitFilter:S$},dU=e=>fKe[e];function FSe(e,t){let n=dU(e);return n!==S$&&(n=rg),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const hKe=new Set(["auto","none","0"]);function pKe(e,t,n){let i=0,r;for(;ie===Fw||e===Ln,GG=(e,t)=>parseFloat(e.split(", ")[t]),XG=(e,t)=>(n,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return GG(r[1],t);{const s=i.match(/^matrix\((.+)\)$/u);return s?GG(s[1],e):0}},mKe=new Set(["x","y","z"]),gKe=$w.filter(e=>!mKe.has(e));function bKe(e){const t=[];return gKe.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const Wx={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:XG(4,13),y:XG(5,14)};Wx.translateX=Wx.x;Wx.translateY=Wx.y;const ty=new Set;let E$=!1,C$=!1;function BSe(){if(C$){const e=Array.from(ty).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const r=bKe(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)})}C$=!1,E$=!1,ty.forEach(e=>e.complete()),ty.clear()}function USe(){ty.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(C$=!0)})}function yKe(){USe(),BSe()}class fU{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?(ty.add(this),E$||(E$=!0,vs.read(USe),vs.resolveKeyframes(BSe))):(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),vKe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function xKe(e){const t=vKe.exec(e);if(!t)return[,];const[,n,i,r]=t;return[`--${n??i}`,r]}function zSe(e,t,n=1){const[i,r]=xKe(e);if(!i)return;const s=window.getComputedStyle(t).getPropertyValue(i);if(s){const a=s.trim();return QSe(a)?parseFloat(a):a}return W7(r)?zSe(r,t,n+1):r}const VSe=e=>t=>t.test(e),wKe={test:e=>e==="auto",parse:e=>e},HSe=[Fw,Ln,Rf,nm,bWe,gWe,wKe],YG=e=>HSe.find(VSe(e));class qSe extends fU{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 ZG=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(rg.test(e)||e==="0")&&!e.startsWith("url("));function OKe(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function BI(e,{repeat:t,repeatType:n="loop"},i){const r=e.filter(SKe),s=t&&n!=="loop"&&t%2===1?0:r.length-1;return!s||i===void 0?r[s]:i}const EKe=40;class WSe{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=If.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>EKe?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&yKe(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=If.now(),this.hasAttemptedResolve=!0;const{name:i,type:r,velocity:s,delay:a,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!kKe(t,i,r,s))if(a)this.options.duration=0;else{c&&c(BI(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 T$=2e4;function KSe(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t=T$?1/0:t}const qs=(e,t,n)=>e+(t-e)*n;function _5(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 CKe({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=_5(c,l,e+1/3),s=_5(c,l,e),a=_5(c,l,e-1/3)}return{red:Math.round(r*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:i}}function gN(e,t){return n=>n>0?t:e}const j5=(e,t,n)=>{const i=e*e,r=n*(t*t-i)+i;return r<0?0:Math.sqrt(r)},TKe=[k$,Db,Iv],AKe=e=>TKe.find(t=>t.test(e));function JG(e){const t=AKe(e);if(!t)return!1;let n=t.parse(e);return t===Iv&&(n=CKe(n)),n}const eX=(e,t)=>{const n=JG(e),i=JG(t);if(!n||!i)return gN(e,t);const r={...n};return s=>(r.red=j5(n.red,i.red,s),r.green=j5(n.green,i.green,s),r.blue=j5(n.blue,i.blue,s),r.alpha=qs(n.alpha,i.alpha,s),Db.transform(r))},_Ke=(e,t)=>n=>t(e(n)),wC=(...e)=>e.reduce(_Ke),A$=new Set(["none","hidden"]);function jKe(e,t){return A$.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function NKe(e,t){return n=>qs(e,t,n)}function hU(e){return typeof e=="number"?NKe:typeof e=="string"?W7(e)?gN:rl.test(e)?eX:PKe:Array.isArray(e)?GSe:typeof e=="object"?rl.test(e)?eX:RKe:gN}function GSe(e,t){const n=[...e],i=n.length,r=e.map((s,a)=>hU(s)(s,t[a]));return s=>{for(let a=0;a{for(const s in i)n[s]=i[s](r);return n}}function IKe(e,t){var n;const i=[],r={color:0,var:0,number:0};for(let s=0;s{const n=rg.createTransformer(t),i=QS(e),r=QS(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?A$.has(e)&&!r.values.length||A$.has(t)&&!i.values.length?jKe(e,t):wC(GSe(IKe(i,r),r.values),n):gN(e,t)};function XSe(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?qs(e,t,n):hU(e)(e,t)}const DKe=5;function YSe(e,t,n){const i=Math.max(t-DKe,0);return xSe(n-e(i),t-i)}const Zs={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},N5=.001;function MKe({duration:e=Zs.duration,bounce:t=Zs.bounce,velocity:n=Zs.velocity,mass:i=Zs.mass}){let r,s,a=1-t;a=ap(Zs.minDamping,Zs.maxDamping,a),e=ap(Zs.minDuration,Zs.maxDuration,Hh(e)),a<1?(r=u=>{const d=u*a,f=d*e,h=d-n,m=_$(u,a),g=Math.exp(-f);return N5-h/m*g},s=u=>{const f=u*a*e,h=f*n+n,m=Math.pow(a,2)*Math.pow(u,2)*e,g=Math.exp(-f),b=_$(Math.pow(u,2),a);return(-r(u)+N5>0?-1:1)*((h-m)*g)/b}):(r=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-N5+d*f},s=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=$Ke(r,s,l);if(e=Vh(e),isNaN(c))return{stiffness:Zs.stiffness,damping:Zs.damping,duration:e};{const u=Math.pow(c,2)*i;return{stiffness:u,damping:a*2*Math.sqrt(i*u),duration:e}}}const LKe=12;function $Ke(e,t,n){let i=n;for(let r=1;re[n]!==void 0)}function UKe(e){let t={velocity:Zs.velocity,stiffness:Zs.stiffness,damping:Zs.damping,mass:Zs.mass,isResolvedFromDuration:!1,...e};if(!tX(e,BKe)&&tX(e,FKe))if(e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,s=2*ap(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:Zs.mass,stiffness:r,damping:s}}else{const n=MKe(e);t={...t,...n,mass:Zs.mass},t.isResolvedFromDuration=!0}return t}function ZSe(e=Zs.visualDuration,t=Zs.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:m}=UKe({...n,velocity:-Hh(n.velocity||0)}),g=h||0,b=u/(2*Math.sqrt(c*d)),v=a-s,y=Hh(Math.sqrt(c/d)),w=Math.abs(v)<5;i||(i=w?Zs.restSpeed.granular:Zs.restSpeed.default),r||(r=w?Zs.restDelta.granular:Zs.restDelta.default);let x;if(b<1){const S=_$(y,b);x=k=>{const C=Math.exp(-b*y*k);return a-C*((g+b*y*v)/S*Math.sin(S*k)+v*Math.cos(S*k))}}else if(b===1)x=S=>a-Math.exp(-y*S)*(v+(g+y*v)*S);else{const S=y*Math.sqrt(b*b-1);x=k=>{const C=Math.exp(-b*y*k),E=Math.min(S*k,300);return a-C*((g+b*y*v)*Math.sinh(E)+S*v*Math.cosh(E))/S}}const O={calculatedDuration:m&&f||null,next:S=>{const k=x(S);if(m)l.done=S>=f;else{let C=0;b<1&&(C=S===0?Vh(g):YSe(x,S,k));const E=Math.abs(C)<=i,R=Math.abs(a-k)<=r;l.done=E&&R}return l.value=l.done?a:k,l},toString:()=>{const S=Math.min(KSe(O),T$),k=OSe(C=>O.next(S*C).value,S,30);return S+"ms "+k}};return O}function nX({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},m=E=>l!==void 0&&Ec,g=E=>l===void 0?c:c===void 0||Math.abs(l-E)-b*Math.exp(-E/i),x=E=>y+w(E),O=E=>{const R=w(E),A=x(E);h.done=Math.abs(R)<=u,h.value=h.done?y:A};let S,k;const C=E=>{m(h.value)&&(S=E,k=ZSe({keyframes:[h.value,g(h.value)],velocity:YSe(x,E,h.value),damping:r,stiffness:s,restDelta:u,restSpeed:d}))};return C(0),{calculatedDuration:null,next:E=>{let R=!1;return!k&&S===void 0&&(R=!0,O(E),C(E)),S!==void 0&&E>=S?k.next(E-S):(!R&&O(E),h)}}}const QKe=xC(.42,0,1,1),zKe=xC(0,0,.58,1),JSe=xC(.42,0,.58,1),VKe=e=>Array.isArray(e)&&typeof e[0]!="number",HKe={linear:tu,easeIn:QKe,easeInOut:JSe,easeOut:zKe,circIn:lU,circInOut:RSe,circOut:NSe,backIn:aU,backInOut:_Se,backOut:ASe,anticipate:jSe},iX=e=>{if(oU(e)){Zke(e.length===4);const[t,n,i,r]=e;return xC(t,n,i,r)}else if(typeof e=="string")return HKe[e];return e};function qKe(e,t,n){const i=[],r=n||XSe,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=qKe(t,i,r),c=l.length,u=d=>{if(a&&d1)for(;fu(ap(e[0],e[s-1],d)):u}function KKe(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const r=qx(0,t,i);e.push(qs(n,1,r))}}function GKe(e){const t=[0];return KKe(t,e.length-1),t}function XKe(e,t){return e.map(n=>n*t)}function YKe(e,t){return e.map(()=>t||JSe).splice(0,e.length-1)}function bN({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const r=VKe(i)?i.map(iX):iX(i),s={done:!1,value:t[0]},a=XKe(n&&n.length===t.length?n:GKe(t),e),l=WKe(a,t,{ease:Array.isArray(r)?r:YKe(t,r)});return{calculatedDuration:e,next:c=>(s.value=l(c),s.done=c>=e,s)}}const ZKe=e=>{const t=({timestamp:n})=>e(n);return{start:()=>vs.update(t,!0),stop:()=>ig(t),now:()=>Da.isProcessing?Da.timestamp:If.now()}},JKe={decay:nX,inertia:nX,tween:bN,keyframes:bN,spring:ZSe},eGe=e=>e/100;class pU extends WSe{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)||fU,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=sU(n)?n:JKe[n]||bN;let c,u;l!==bN&&typeof t[0]!="number"&&(c=wC(eGe,XSe(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=KSe(d));const{calculatedDuration:f}=d,h=f+r,m=h*(i+1)-r;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:h,totalDuration:m}}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:E}=this.options;return{done:!0,value:E[E.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:m,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),w=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let x=this.currentTime,O=s;if(m){const E=Math.min(this.currentTime,d)/f;let R=Math.floor(E),A=E%1;!A&&E>=1&&(A=1),A===1&&R--,R=Math.min(R,m+1),!!(R%2)&&(g==="reverse"?(A=1-A,b&&(A-=b/f)):g==="mirror"&&(O=a)),x=ap(0,1,A)*f}const S=w?{done:!1,value:c[0]}:O.next(x);l&&(S.value=l(S.value));let{done:k}=S;!w&&u!==null&&(k=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return C&&r!==void 0&&(S.value=BI(c,this.options,r)),v&&v(S.value),C&&this.finish(),S}get duration(){const{resolved:t}=this;return t?Hh(t.calculatedDuration):0}get time(){return Hh(this.currentTime)}set time(t){t=Vh(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=Hh(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=ZKe,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 tGe=new Set(["opacity","clipPath","filter","transform"]);function nGe(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=SSe(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 iGe=rU(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),yN=10,rGe=2e4;function sGe(e){return sU(e.type)||e.type==="spring"||!kSe(e.ease)}function oGe(e,t){const n=new pU({...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"&&mN()&&aGe(s)&&(s=eEe[s]),sGe(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:g,...b}=this.options,v=oGe(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=nGe(l.owner.current,c,t,{...this.options,duration:i,times:r,ease:s});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(qG(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(BI(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 Hh(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Hh(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:i}=n;i.currentTime=Vh(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 tu;const{animation:i}=n;qG(i,t)}return tu}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,...m}=this.options,g=new pU({...m,keyframes:i,duration:r,type:s,ease:a,times:l,isGenerator:!0}),b=Vh(this.time);u.setWithVelocity(g.sample(b-yN).value,g.sample(b).value,yN)}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 iGe()&&i&&tGe.has(i)&&!c&&!u&&!r&&s!=="mirror"&&a!==0&&l!=="inertia"}}const lGe={type:"spring",stiffness:500,damping:25,restSpeed:10},cGe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),uGe={type:"keyframes",duration:.8},dGe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},fGe=(e,{keyframes:t})=>t.length>2?uGe:qy.has(e)?e.startsWith("scale")?cGe(t[1]):lGe:dGe;function hGe({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 mU=(e,t,n,i={},r,s)=>a=>{const l=eU(i,e)||{},c=l.delay||i.delay||0;let{elapsed:u=0}=i;u=u-Vh(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};hGe(l)||(d={...d,...fGe(e,d)}),d.duration&&(d.duration=Vh(d.duration)),d.repeatDelay&&(d.repeatDelay=Vh(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=BI(d.keyframes,l);if(h!==void 0)return vs.update(()=>{d.onUpdate(h),d.onComplete()}),new HWe([])}return!s&&rX.supports(d)?new rX(d):new pU(d)};function pGe({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function tEe(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),m=c[f];if(m===void 0||d&&pGe(d,f))continue;const g={delay:n,...eU(a||{},f)};let b=!1;if(window.MotionHandoffAnimation){const y=wSe(e);if(y){const w=window.MotionHandoffAnimation(y,f,vs);w!==null&&(g.startTime=w,b=!0)}}w$(e,f),h.start(mU(f,h,m,e.shouldReduceMotion&&vSe.has(f)?{type:!1}:g,e,b));const v=h.animation;v&&u.push(v)}return l&&Promise.all(u).then(()=>{vs.update(()=>{l&&UWe(e,l)})}),u}function j$(e,t,n={}){var i;const r=FI(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(tEe(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=s;return mGe(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 mGe(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(gGe).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(j$(u,t,{...s,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function gGe(e,t){return e.sortNodePosition(t)}function bGe(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const r=t.map(s=>j$(e,s,n));i=Promise.all(r)}else if(typeof t=="string")i=j$(e,t,n);else{const r=typeof t=="function"?FI(e,t,n.custom):t;i=Promise.all(tEe(e,r,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const yGe=Q7.length;function nEe(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?nEe(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})=>bGe(e,n,i)))}function OGe(e){let t=wGe(e),n=sX(),i=!0;const r=c=>(u,d)=>{var f;const h=FI(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:g,...b}=h;u={...u,...b,...g}}return u};function s(c){t=c(e)}function a(c){const{props:u}=e,d=nEe(e.parent)||{},f=[],h=new Set;let m={},g=1/0;for(let v=0;vg&&O,R=!1;const A=Array.isArray(x)?x:[x];let N=A.reduce(r(y),{});S===!1&&(N={});const{prevResolvedValues:T={}}=w,j={...T,...N},_=P=>{E=!0,h.has(P)&&(R=!0,h.delete(P)),w.needsAnimating[P]=!0;const L=e.getValue(P);L&&(L.liveStyle=!1)};for(const P in j){const L=N[P],B=T[P];if(m.hasOwnProperty(P))continue;let M=!1;x$(L)&&x$(B)?M=!ySe(L,B):M=L!==B,M?L!=null?_(P):h.add(P):L!==void 0&&h.has(P)?_(P):w.protectedKeys[P]=!0}w.prevProp=x,w.prevResolvedValues=N,w.isActive&&(m={...m,...N}),i&&e.blockInitialAnimation&&(E=!1),E&&(!(k&&C)||R)&&f.push(...A.map(P=>({animation:P,options:{type:y}})))}if(h.size){const v={};h.forEach(y=>{const w=e.getBaseTarget(y),x=e.getValue(y);x&&(x.liveStyle=!0),v[y]=w??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 m;return(m=h.animationState)===null||m===void 0?void 0:m.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=sX(),i=!0}}}function kGe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!ySe(t,e):!1}function eb(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function sX(){return{animate:eb(!0),whileInView:eb(),whileHover:eb(),whileTap:eb(),whileDrag:eb(),whileFocus:eb(),exit:eb()}}class _g{constructor(t){this.isMounted=!1,this.node=t}update(){}}class SGe extends _g{constructor(t){super(t),t.animationState||(t.animationState=OGe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();LI(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 EGe=0;class CGe extends _g{constructor(){super(...arguments),this.id=EGe++}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 TGe={animation:{Feature:SGe},exit:{Feature:CGe}},gd={x:!1,y:!1};function iEe(){return gd.x||gd.y}function AGe(e){return e==="x"||e==="y"?gd[e]?null:(gd[e]=!0,()=>{gd[e]=!1}):gd.x||gd.y?null:(gd.x=gd.y=!0,()=>{gd.x=gd.y=!1})}const gU=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function zS(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}function OC(e){return{point:{x:e.pageX,y:e.pageY}}}const _Ge=e=>t=>gU(t)&&e(t,OC(t));function $k(e,t,n,i){return zS(e,t,_Ge(n),i)}const oX=(e,t)=>Math.abs(e-t);function jGe(e,t){const n=oX(e.x,t.x),i=oX(e.y,t.y);return Math.sqrt(n**2+i**2)}class rEe{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=I5(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,m=jGe(f.offset,{x:0,y:0})>=3;if(!h&&!m)return;const{point:g}=f,{timestamp:b}=Da;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=R5(h,this.transformPagePoint),vs.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=I5(f.type==="pointercancel"?this.lastMoveEventInfo:R5(h,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,v),g&&g(f,v)},!gU(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.contextWindow=r||window;const a=OC(t),l=R5(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=Da;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,I5(l,this.history)),this.removeListeners=wC($k(this.contextWindow,"pointermove",this.handlePointerMove),$k(this.contextWindow,"pointerup",this.handlePointerUp),$k(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ig(this.updatePoint)}}function R5(e,t){return t?{point:t(e.point)}:e}function aX(e,t){return{x:e.x-t.x,y:e.y-t.y}}function I5({point:e},t){return{point:e,delta:aX(e,sEe(t)),offset:aX(e,NGe(t)),velocity:RGe(t,.1)}}function NGe(e){return e[0]}function sEe(e){return e[e.length-1]}function RGe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const r=sEe(e);for(;n>=0&&(i=e[n],!(r.timestamp-i.timestamp>Vh(t)));)n--;if(!i)return{x:0,y:0};const s=Hh(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 oEe=1e-4,IGe=1-oEe,PGe=1+oEe,aEe=.01,DGe=0-aEe,MGe=0+aEe;function cu(e){return e.max-e.min}function LGe(e,t,n){return Math.abs(e-t)<=n}function lX(e,t,n,i=.5){e.origin=i,e.originPoint=qs(t.min,t.max,e.origin),e.scale=cu(n)/cu(t),e.translate=qs(n.min,n.max,e.origin)-e.originPoint,(e.scale>=IGe&&e.scale<=PGe||isNaN(e.scale))&&(e.scale=1),(e.translate>=DGe&&e.translate<=MGe||isNaN(e.translate))&&(e.translate=0)}function Fk(e,t,n,i){lX(e.x,t.x,n.x,i?i.originX:void 0),lX(e.y,t.y,n.y,i?i.originY:void 0)}function cX(e,t,n){e.min=n.min+t.min,e.max=e.min+cu(t)}function $Ge(e,t,n){cX(e.x,t.x,n.x),cX(e.y,t.y,n.y)}function uX(e,t,n){e.min=t.min-n.min,e.max=e.min+cu(t)}function Bk(e,t,n){uX(e.x,t.x,n.x),uX(e.y,t.y,n.y)}function FGe(e,{min:t,max:n},i){return t!==void 0&&en&&(e=i?qs(n,e,i.max):Math.min(e,n)),e}function dX(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 BGe(e,{top:t,left:n,bottom:i,right:r}){return{x:dX(e.x,n,r),y:dX(e.y,t,i)}}function fX(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.mini?n=qx(t.min,t.max-i,e.min):i>r&&(n=qx(e.min,e.max-r,t.min)),ap(0,1,n)}function zGe(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 N$=.35;function VGe(e=N$){return e===!1?e=0:e===!0&&(e=N$),{x:hX(e,"left","right"),y:hX(e,"top","bottom")}}function hX(e,t,n){return{min:pX(e,t),max:pX(e,n)}}function pX(e,t){return typeof e=="number"?e:e[t]||0}const mX=()=>({translate:0,scale:1,origin:0,originPoint:0}),Pv=()=>({x:mX(),y:mX()}),gX=()=>({min:0,max:0}),ho=()=>({x:gX(),y:gX()});function Ou(e){return[e("x"),e("y")]}function lEe({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function HGe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function qGe(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 P5(e){return e===void 0||e===1}function R$({scale:e,scaleX:t,scaleY:n}){return!P5(e)||!P5(t)||!P5(n)}function bb(e){return R$(e)||cEe(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function cEe(e){return bX(e.x)||bX(e.y)}function bX(e){return e&&e!=="0%"}function vN(e,t,n){const i=e-n,r=t*i;return n+r}function yX(e,t,n,i,r){return r!==void 0&&(e=vN(e,r,i)),vN(e,n,i)+t}function I$(e,t=0,n=1,i,r){e.min=yX(e.min,t,n,i,r),e.max=yX(e.max,t,n,i,r)}function uEe(e,{x:t,y:n}){I$(e.x,t.translate,t.scale,t.originPoint),I$(e.y,n.translate,n.scale,n.originPoint)}const vX=.999999999999,xX=1.0000000000001;function WGe(e,t,n,i=!1){const r=n.length;if(!r)return;t.x=t.y=1;let s,a;for(let l=0;lvX&&(t.x=1),t.yvX&&(t.y=1)}function Dv(e,t){e.min=e.min+t,e.max=e.max+t}function wX(e,t,n,i,r=.5){const s=qs(e.min,e.max,r);I$(e,t,n,s,i)}function Mv(e,t){wX(e.x,t.x,t.scaleX,t.scale,t.originX),wX(e.y,t.y,t.scaleY,t.scale,t.originY)}function dEe(e,t){return lEe(qGe(e.getBoundingClientRect(),t))}function KGe(e,t,n){const i=dEe(e,n),{scroll:r}=t;return r&&(Dv(i.x,r.offset.x),Dv(i.y,r.offset.y)),i}const fEe=({current:e})=>e?e.ownerDocument.defaultView:null,GGe=new WeakMap;class XGe{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=ho(),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(OC(d).point)},s=(d,f)=>{const{drag:h,dragPropagation:m,onDragStart:g}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=AGe(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),Ou(v=>{let y=this.getAxisMotionValue(v).get()||0;if(Rf.test(y)){const{projection:w}=this.visualElement;if(w&&w.layout){const x=w.layout.layoutBox[v];x&&(y=cu(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),g&&vs.postRender(()=>g(d,f)),w$(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:g,onDrag:b}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=f;if(m&&this.currentDirection===null){this.currentDirection=YGe(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=()=>Ou(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 rEe(t,{onSessionStart:r,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:fEe(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&&vs.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||!OA(t,r,this.currentDirection))return;const s=this.getAxisMotionValue(t);let a=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(a=FGe(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&&Rv(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&r?this.constraints=BGe(r.layoutBox,n):this.constraints=!1,this.elastic=VGe(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ou(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=zGe(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Rv(t))return!1;const i=t.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const s=KGe(i,r.root,this.visualElement.getTransformPagePoint());let a=UGe(r.layout.layoutBox,s);if(n){const l=n(HGe(a));this.hasMutatedConstraints=!!l,l&&(a=lEe(l))}return a}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Ou(d=>{if(!OA(d,n,this.currentDirection))return;let f=c&&c[d]||{};a&&(f={min:0,max:0});const h=r?200:1e6,m=r?40:1e7,g={type:"inertia",velocity:i?t[d]:0,bounceStiffness:h,bounceDamping:m,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 w$(this.visualElement,t),i.start(mU(t,i,0,n,this.visualElement,!1))}stopAnimation(){Ou(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ou(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){Ou(n=>{const{drag:i}=this.getProps();if(!OA(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]-qs(a,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Rv(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Ou(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const c=l.get();r[a]=QGe({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(),Ou(a=>{if(!OA(a,t,null))return;const l=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];l.set(qs(c,u,r[a]))})}addListeners(){if(!this.visualElement.current)return;GGe.set(this.visualElement,this);const t=this.visualElement.current,n=$k(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),i=()=>{const{dragConstraints:c}=this.getProps();Rv(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()),vs.read(i);const a=zS(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ou(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=N$,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:a,dragMomentum:l}}}function OA(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function YGe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class ZGe extends _g{constructor(t){super(t),this.removeGroupControls=tu,this.removeListeners=tu,this.controls=new XGe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||tu}unmount(){this.removeGroupControls(),this.removeListeners()}}const OX=e=>(t,n)=>{e&&vs.postRender(()=>e(t,n))};class JGe extends _g{constructor(){super(...arguments),this.removePointerDownListener=tu}onPointerDown(t){this.session=new rEe(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:fEe(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:OX(t),onStart:OX(n),onMove:i,onEnd:(s,a)=>{delete this.session,r&&vs.postRender(()=>r(s,a))}}}mount(){this.removePointerDownListener=$k(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 R_={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function kX(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const nO={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ln.test(e))e=parseFloat(e);else return e;const n=kX(e,t.target.x),i=kX(e,t.target.y);return`${n}% ${i}%`}},eXe={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,r=rg.parse(e);if(r.length>5)return i;const s=rg.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=qs(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 tXe extends p.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=t;TWe(nXe),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()})),R_.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()||vs.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),V7.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 hEe(e){const[t,n]=Xke(),i=p.useContext(F7);return o.jsx(tXe,{...e,layoutGroup:i,switchLayoutGroup:p.useContext(sSe),isPresent:t,safeToRemove:n})}const nXe={borderRadius:{...nO,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:nO,borderTopRightRadius:nO,borderBottomLeftRadius:nO,borderBottomRightRadius:nO,boxShadow:eXe};function iXe(e,t,n){const i=al(e)?e:US(e);return i.start(mU("",i,t,n)),i.animation}function rXe(e){return e instanceof SVGElement&&e.tagName!=="svg"}const sXe=(e,t)=>e.depth-t.depth;class oXe{constructor(){this.children=[],this.isDirty=!1}add(t){tU(this.children,t),this.isDirty=!0}remove(t){nU(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(sXe),this.isDirty=!1,this.children.forEach(t)}}function aXe(e,t){const n=If.now(),i=({timestamp:r})=>{const s=r-n;s>=t&&(ig(i),e(s-t))};return vs.read(i,!0),()=>ig(i)}const pEe=["TopLeft","TopRight","BottomLeft","BottomRight"],lXe=pEe.length,SX=e=>typeof e=="string"?parseFloat(e):e,EX=e=>typeof e=="number"||Ln.test(e);function cXe(e,t,n,i,r,s){r?(e.opacity=qs(0,n.opacity!==void 0?n.opacity:1,uXe(i)),e.opacityExit=qs(t.opacity!==void 0?t.opacity:1,0,dXe(i))):s&&(e.opacity=qs(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,i));for(let a=0;ait?1:n(qx(e,t,i))}function TX(e,t){e.min=t.min,e.max=t.max}function wu(e,t){TX(e.x,t.x),TX(e.y,t.y)}function AX(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function _X(e,t,n,i,r){return e-=t,e=vN(e,1/n,i),r!==void 0&&(e=vN(e,1/r,i)),e}function fXe(e,t=0,n=1,i=.5,r,s=e,a=e){if(Rf.test(t)&&(t=parseFloat(t),t=qs(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=qs(s.min,s.max,i);e===s&&(l-=t),e.min=_X(e.min,t,n,l,r),e.max=_X(e.max,t,n,l,r)}function jX(e,t,[n,i,r],s,a){fXe(e,t[n],t[i],t[r],t.scale,s,a)}const hXe=["x","scaleX","originX"],pXe=["y","scaleY","originY"];function NX(e,t,n,i){jX(e.x,t,hXe,n?n.x:void 0,i?i.x:void 0),jX(e.y,t,pXe,n?n.y:void 0,i?i.y:void 0)}function RX(e){return e.translate===0&&e.scale===1}function gEe(e){return RX(e.x)&&RX(e.y)}function IX(e,t){return e.min===t.min&&e.max===t.max}function mXe(e,t){return IX(e.x,t.x)&&IX(e.y,t.y)}function PX(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function bEe(e,t){return PX(e.x,t.x)&&PX(e.y,t.y)}function DX(e){return cu(e.x)/cu(e.y)}function MX(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class gXe{constructor(){this.members=[]}add(t){tU(this.members,t),t.scheduleRender()}remove(t){if(nU(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 bXe(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:m,skewY:g}=n;u&&(i=`perspective(${u}px) ${i}`),d&&(i+=`rotate(${d}deg) `),f&&(i+=`rotateX(${f}deg) `),h&&(i+=`rotateY(${h}deg) `),m&&(i+=`skewX(${m}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 yb={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},ZO=typeof window<"u"&&window.MotionDebug!==void 0,D5=["","X","Y","Z"],yXe={visibility:"hidden"},LX=1e3;let vXe=0;function M5(e,t,n,i){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function yEe(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=wSe(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",vs,!(r||s))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&yEe(i)}function vEe({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(a={},l=t==null?void 0:t()){this.id=vXe++,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,ZO&&(yb.totalNodes=yb.resolvedTargetDeltas=yb.recalculatedProjection=0),this.nodes.forEach(OXe),this.nodes.forEach(TXe),this.nodes.forEach(AXe),this.nodes.forEach(kXe),ZO&&window.MotionDebug.record(yb)},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=aXe(h,250),R_.hasAnimatedSinceResize&&(R_.hasAnimatedSinceResize=!1,this.nodes.forEach(FX))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:m,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||d.getDefaultTransition()||IXe,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=d.getProps(),w=!this.targetLayout||!bEe(this.targetLayout,g)||m,x=!h&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||h&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,x);const O={...eU(b,"layout"),onPlay:v,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(O.delay=0,O.type=!1),this.startAnimation(O)}else h||FX(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,ig(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(_Xe),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&&yEe(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 S=O/1e3;BX(f.x,a.x,S),BX(f.y,a.y,S),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Bk(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),NXe(this.relativeTarget,this.relativeTargetOrigin,h,S),x&&mXe(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=ho()),wu(x,this.relativeTarget)),b&&(this.animationValues=d,cXe(d,u,this.latestValues,S,w,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},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&&(ig(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=vs.update(()=>{R_.hasAnimatedSinceResize=!0,this.currentAnimation=iXe(0,LX,{...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(LX),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&&xEe(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||ho();const f=cu(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const h=cu(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+h}wu(l,c),Mv(l,d),Fk(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new gXe),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&&M5("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($X),this.root.sharedNodes.clear()}}}function xXe(e){e.updateLayout()}function wXe(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"?Ou(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],m=cu(h);h.min=i[f].min,h.max=h.min+m}):xEe(s,n.layoutBox,i)&&Ou(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],m=cu(i[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const l=Pv();Fk(l,i,n.layoutBox);const c=Pv();a?Fk(c,e.applyTransform(r,!0),n.measuredBox):Fk(c,i,n.layoutBox);const u=!gEe(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const g=ho();Bk(g,n.layoutBox,h.layoutBox);const b=ho();Bk(b,i,m.layoutBox),bEe(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 OXe(e){ZO&&yb.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 kXe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function SXe(e){e.clearSnapshot()}function $X(e){e.clearMeasurements()}function EXe(e){e.isLayoutDirty=!1}function CXe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function FX(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function TXe(e){e.resolveTargetDelta()}function AXe(e){e.calcProjection()}function _Xe(e){e.resetSkewAndRotation()}function jXe(e){e.removeLeadSnapshot()}function BX(e,t,n){e.translate=qs(t.translate,0,n),e.scale=qs(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function UX(e,t,n,i){e.min=qs(t.min,n.min,i),e.max=qs(t.max,n.max,i)}function NXe(e,t,n,i){UX(e.x,t.x,n.x,i),UX(e.y,t.y,n.y,i)}function RXe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const IXe={duration:.45,ease:[.4,0,.1,1]},QX=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),zX=QX("applewebkit/")&&!QX("chrome/")?Math.round:tu;function VX(e){e.min=zX(e.min),e.max=zX(e.max)}function PXe(e){VX(e.x),VX(e.y)}function xEe(e,t,n){return e==="position"||e==="preserve-aspect"&&!LGe(DX(t),DX(n),.2)}function DXe(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const MXe=vEe({attachResizeListener:(e,t)=>zS(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),L5={current:void 0},wEe=vEe({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!L5.current){const e=new MXe({});e.mount(window),e.setOptions({layoutScroll:!0}),L5.current=e}return L5.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),LXe={pan:{Feature:JGe},drag:{Feature:ZGe,ProjectionNode:wEe,MeasureLayout:hEe}};function $Xe(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 OEe(e,t){const n=$Xe(e),i=new AbortController,r={passive:!0,...t,signal:i.signal};return[n,r,()=>i.abort()]}function HX(e){return t=>{t.pointerType==="touch"||iEe()||e(t)}}function FXe(e,t,n={}){const[i,r,s]=OEe(e,n),a=HX(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=HX(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,r)});return i.forEach(l=>{l.addEventListener("pointerenter",a,r)}),s}function qX(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&&vs.postRender(()=>s(t,OC(t)))}class BXe extends _g{mount(){const{current:t}=this.node;t&&(this.unmount=FXe(t,n=>(qX(this.node,n,"Start"),i=>qX(this.node,i,"End"))))}unmount(){}}class UXe extends _g{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=wC(zS(this.node.current,"focus",()=>this.onFocus()),zS(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const kEe=(e,t)=>t?e===t?!0:kEe(e,t.parentElement):!1,QXe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function zXe(e){return QXe.has(e.tagName)||e.tabIndex!==-1}const JO=new WeakSet;function WX(e){return t=>{t.key==="Enter"&&e(t)}}function $5(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const VXe=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=WX(()=>{if(JO.has(n))return;$5(n,"down");const r=WX(()=>{$5(n,"up")}),s=()=>$5(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 KX(e){return gU(e)&&!iEe()}function HXe(e,t,n={}){const[i,r,s]=OEe(e,n),a=l=>{const c=l.currentTarget;if(!KX(l)||JO.has(c))return;JO.add(c);const u=t(l),d=(m,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!KX(m)||!JO.has(c))&&(JO.delete(c),typeof u=="function"&&u(m,{success:g}))},f=m=>{d(m,n.useGlobalTarget||kEe(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",f,r),window.addEventListener("pointercancel",h,r)};return i.forEach(l=>{!zXe(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,r),l.addEventListener("focus",u=>VXe(u,r),r)}),s}function GX(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&&vs.postRender(()=>s(t,OC(t)))}class qXe extends _g{mount(){const{current:t}=this.node;t&&(this.unmount=HXe(t,n=>(GX(this.node,n,"Start"),(i,{success:r})=>GX(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const P$=new WeakMap,F5=new WeakMap,WXe=e=>{const t=P$.get(e.target);t&&t(e)},KXe=e=>{e.forEach(WXe)};function GXe({root:e,...t}){const n=e||document;F5.has(n)||F5.set(n,{});const i=F5.get(n),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver(KXe,{root:e,...t})),i[r]}function XXe(e,t,n){const i=GXe(t);return P$.set(e,n),i.observe(e),()=>{P$.delete(e),i.unobserve(e)}}const YXe={some:0,all:1};class ZXe extends _g{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:YXe[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 XXe(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(JXe(t,n))&&this.startObserver()}unmount(){}}function JXe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const eYe={inView:{Feature:ZXe},tap:{Feature:qXe},focus:{Feature:UXe},hover:{Feature:BXe}},tYe={layout:{ProjectionNode:wEe,MeasureLayout:hEe}},xN={current:null},bU={current:!1};function SEe(){if(bU.current=!0,!!B7)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>xN.current=e.matches;e.addListener(t),t()}else xN.current=!1}const nYe=[...HSe,rl,rg],iYe=e=>nYe.find(VSe(e)),XX=new WeakMap;function rYe(e,t,n){for(const i in t){const r=t[i],s=n[i];if(al(r))e.addValue(i,r);else if(al(s))e.addValue(i,US(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,US(a!==void 0?a:r,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const YX=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class sYe{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=fU,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 m=If.now();this.renderScheduledAtthis.bindToMotionValue(i,n)),bU.current||SEe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:xN.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){XX.delete(this.current),this.projection&&this.projection.unmount(),ig(this.notifyUpdate),ig(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=qy.has(t),r=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&vs.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 Hx){const n=Hx[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):ho()}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=US(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"&&(QSe(r)||ISe(r))?r=parseFloat(r):!iYe(r)&&rg.test(n)&&(r=FSe(t,n)),this.setBaseTarget(t,al(r)?r.get():r)),al(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=q7(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&&!al(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 iU),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class EEe extends sYe{constructor(){super(...arguments),this.KeyframeResolver=qSe}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;al(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function oYe(e){return window.getComputedStyle(e)}class aYe extends EEe{constructor(){super(...arguments),this.type="html",this.renderInstance=fSe}readValueFromInstance(t,n){if(qy.has(n)){const i=dU(n);return i&&i.default||0}else{const i=oYe(t),r=(cSe(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return dEe(t,n)}build(t,n,i){G7(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return J7(t,n,i)}}class lYe extends EEe{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ho}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(qy.has(n)){const i=dU(n);return i&&i.default||0}return n=hSe.has(n)?n:z7(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return gSe(t,n,i)}build(t,n,i){X7(t,n,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,i,r){pSe(t,n,i,r)}mount(t){this.isSVGTag=Z7(t.tagName),super.mount(t)}}const cYe=(e,t)=>H7(e)?new lYe(t):new aYe(t,{allowProjection:e!==p.Fragment}),uYe=MWe({...TGe,...eYe,...LXe,...tYe},cYe),mr=Yqe(uYe);function UI(){!bU.current&&SEe();const[e]=p.useState(xN.current);return e}function Jo(){return Jo=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?p.useEffect:p.useLayoutEffect;function ov(e,t,n){var i=p.useRef(t);i.current=t,p.useEffect(function(){function r(s){i.current(s)}return e&&window.addEventListener(e,r,n),function(){e&&window.removeEventListener(e,r)}},[e])}var dYe=["container"];function fYe(e){var t=e.container,n=t===void 0?document.body:t,i=QI(e,dYe);return ri.createPortal(bi.createElement("div",Jo({},i)),n)}function hYe(e){return bi.createElement("svg",Jo({width:"44",height:"44",viewBox:"0 0 768 768"},e),bi.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 pYe(e){return bi.createElement("svg",Jo({width:"44",height:"44",viewBox:"0 0 768 768"},e),bi.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 mYe(e){return bi.createElement("svg",Jo({width:"44",height:"44",viewBox:"0 0 768 768"},e),bi.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function gYe(){return p.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function JX(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 lm=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 B5(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=lm(e,s,n,innerWidth)[0],f=lm(t,s,i,innerHeight),h=innerWidth/2,m=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-(m+t))-m+(f[0]?u/2:u),lastCX:a,lastCY:l}}function L$(e,t,n){var i=e%180!=0;return i?[n,t,i]:[t,n,i]}function U5(e,t,n){var i=L$(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 SA(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=p.useRef(e);l.current=e;var c=p.useRef(0),u=p.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=p.useCallback(function(){var h=[].slice.call(arguments),m=Date.now();function g(){c.current=m,d(),l.current.apply(null,h)}var b=c.current,v=m-b;if(b===0&&(i&&g(),c.current=m),r!==void 0){if(v>r)return void g()}else v=1&&s&&s())};d()}function d(){c=requestAnimationFrame(u)}}var yYe={T:0,L:0,W:0,H:0,FIT:void 0},TEe=function(){var e=p.useRef(!1);return p.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},vYe=["className"];function xYe(e){var t=e.className,n=t===void 0?"":t,i=QI(e,vYe);return bi.createElement("div",Jo({className:"PhotoView__Spinner "+n},i),bi.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},bi.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"}),bi.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var wYe=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function OYe(e){var t=e.src,n=e.loaded,i=e.broken,r=e.className,s=e.onPhotoLoad,a=e.loadingElement,l=e.brokenElement,c=QI(e,wYe),u=TEe();return t&&!i?bi.createElement(bi.Fragment,null,bi.createElement("img",Jo({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?bi.createElement("span",{className:"PhotoView__icon"},a):bi.createElement(xYe,{className:"PhotoView__icon"}))):l?bi.createElement("span",{className:"PhotoView__icon"},typeof l=="function"?l({src:t}):l):null}var kYe={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 SYe(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,m=e.className,g=e.style,b=e.loadingElement,v=e.brokenElement,y=e.onPhotoTap,w=e.onMaskTap,x=e.onReachMove,O=e.onReachUp,S=e.onPhotoResize,k=e.isActive,C=e.expose,E=wN(kYe),R=E[0],A=E[1],N=p.useRef(0),T=TEe(),j=R.naturalWidth,_=j===void 0?s:j,I=R.naturalHeight,D=I===void 0?l:I,P=R.width,L=P===void 0?s:P,B=R.height,M=B===void 0?l:B,H=R.loaded,K=H===void 0?!n:H,F=R.broken,q=R.x,Q=R.y,X=R.touched,ne=R.stopRaf,z=R.maskTouched,Y=R.rotate,ae=R.scale,Ee=R.CX,Z=R.CY,G=R.lastX,te=R.lastY,de=R.lastCX,Ce=R.lastCY,le=R.lastScale,fe=R.touchTime,ce=R.touchLength,Te=R.pause,Me=R.reach,we=ny({onScale:function(Pe){return Ue(kA(Pe))},onRotate:function(Pe){Y!==Pe&&(C({rotate:Pe}),A(Jo({rotate:Pe},U5(_,D,Pe))))}});function Ue(Pe,yt,jt){ae!==Pe&&(C({scale:Pe}),A(Jo({scale:Pe},B5(q,Q,L,M,ae,Pe,yt,jt),Pe<=1&&{x:0,y:0})))}var ke=SA(function(Pe,yt,jt){if(jt===void 0&&(jt=0),(X||z)&&k){var qt=L$(Y,L,M),ln=qt[0],qe=qt[1];if(jt===0&&N.current===0){var Ie=Math.abs(Pe-Ee)<=20,We=Math.abs(yt-Z)<=20;if(Ie&&We)return void A({lastCX:Pe,lastCY:yt});N.current=Ie?yt>Z?3:2:1}var gt,it=Pe-de,kt=yt-Ce;if(jt===0){var ct=lm(it+G,ae,ln,innerWidth)[0],Kt=lm(kt+te,ae,qe,innerHeight);gt=function(Xt,Ge,mt,xt){return Ge&&Xt===1||xt==="x"?"x":mt&&Xt>1||xt==="y"?"y":void 0}(N.current,ct,Kt[0],Me),gt!==void 0&&x(gt,Pe,yt,ae)}if(gt==="x"||z)return void A({reach:"x"});var dn=kA(ae+(jt-ce)/100/2*ae,_/L,.2);C({scale:dn}),A(Jo({touchLength:jt,reach:gt,scale:dn},B5(q,Q,L,M,ae,dn,Pe,yt,it,kt)))}},{maxWait:8});function je(Pe){return!ne&&!X&&(T.current&&A(Jo({},Pe,{pause:u})),T.current)}var re,ve,be,xe,Ke,Ze,he,ye,Ae=(Ke=function(Pe){return je({x:Pe})},Ze=function(Pe){return je({y:Pe})},he=function(Pe){return T.current&&(C({scale:Pe}),A({scale:Pe})),!X&&T.current},ye=ny({X:function(Pe){return Ke(Pe)},Y:function(Pe){return Ze(Pe)},S:function(Pe){return he(Pe)}}),function(Pe,yt,jt,qt,ln,qe,Ie,We,gt,it,kt){var ct=L$(it,ln,qe),Kt=ct[0],dn=ct[1],Xt=lm(Pe,We,Kt,innerWidth),Ge=Xt[0],mt=Xt[1],xt=lm(yt,We,dn,innerHeight),hn=xt[0],Vt=xt[1],Qe=Date.now()-kt;if(Qe>=200||We!==Ie||Math.abs(gt-Ie)>1){var rt=B5(Pe,yt,ln,qe,Ie,We),En=rt.x,et=rt.y,bt=Ge?mt:En!==Pe?En:null,zn=hn?Vt:et!==yt?et:null;return bt!==null&&Tb(Pe,bt,ye.X),zn!==null&&Tb(yt,zn,ye.Y),void(We!==Ie&&Tb(Ie,We,ye.S))}var $t=(Pe-jt)/Qe,Ni=(yt-qt)/Qe,Fn=Math.sqrt(Math.pow($t,2)+Math.pow(Ni,2)),Yn=!1,vn=!1;(function(si,Bn){var ni,Ui=si,Ri=0,Qi=0,Ve=function(Vn){ni||(ni=Vn);var xr=Vn-ni,Ks=Math.sign(si),is=-.001*Ks,Ur=Math.sign(-Ui)*Math.pow(Ui,2)*2e-4,Hn=Ui*xr+(is+Ur)*Math.pow(xr,2)/2;Ri+=Hn,ni=Vn,Ks*(Ui+=(is+Ur)*xr)<=0?Jt():Bn(Ri)?St():Jt()};function St(){Qi=requestAnimationFrame(Ve)}function Jt(){cancelAnimationFrame(Qi)}St()})(Fn,function(si){var Bn=Pe+si*($t/Fn),ni=yt+si*(Ni/Fn),Ui=lm(Bn,Ie,Kt,innerWidth),Ri=Ui[0],Qi=Ui[1],Ve=lm(ni,Ie,dn,innerHeight),St=Ve[0],Jt=Ve[1];if(Ri&&!Yn&&(Yn=!0,Ge?Tb(Bn,Qi,ye.X):eY(Qi,Bn+(Bn-Qi),ye.X)),St&&!vn&&(vn=!0,hn?Tb(ni,Jt,ye.Y):eY(Jt,ni+(ni-Jt),ye.Y)),Yn&&vn)return!1;var Vn=Yn||ye.X(Qi),xr=vn||ye.Y(Jt);return Vn&&xr})}),He=(re=y,ve=function(Pe,yt){Me||Ue(ae!==1?1:Math.max(2,_/L),Pe,yt)},be=p.useRef(0),xe=SA(function(){be.current=0,re.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var Pe=[].slice.call(arguments);be.current+=1,xe.apply(void 0,Pe),be.current>=2&&(xe.cancel(),be.current=0,ve.apply(void 0,Pe))});function De(Pe,yt){if(N.current=0,(X||z)&&k){A({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var jt=kA(ae,_/L);if(Ae(q,Q,G,te,L,M,ae,jt,le,Y,fe),O(Pe,yt),Ee===Pe&&Z===yt){if(X)return void He(Pe,yt);z&&w(Pe,yt)}}}function At(Pe,yt,jt){jt===void 0&&(jt=0),A({touched:!0,CX:Pe,CY:yt,lastCX:Pe,lastCY:yt,lastX:q,lastY:Q,lastScale:ae,touchLength:jt,touchTime:Date.now()})}function Nt(Pe){A({maskTouched:!0,CX:Pe.clientX,CY:Pe.clientY,lastX:q,lastY:Q})}ov(mh?void 0:"mousemove",function(Pe){Pe.preventDefault(),ke(Pe.clientX,Pe.clientY)}),ov(mh?void 0:"mouseup",function(Pe){De(Pe.clientX,Pe.clientY)}),ov(mh?"touchmove":void 0,function(Pe){Pe.preventDefault();var yt=JX(Pe);ke.apply(void 0,yt)},{passive:!1}),ov(mh?"touchend":void 0,function(Pe){var yt=Pe.changedTouches[0];De(yt.clientX,yt.clientY)},{passive:!1}),ov("resize",SA(function(){K&&!X&&(A(U5(_,D,Y)),S())},{maxWait:8})),M$(function(){k&&C(Jo({scale:ae,rotate:Y},we))},[k]);var Ot=function(Pe,yt,jt,qt,ln,qe,Ie,We,gt,it){var kt=function(En,et,bt,zn,$t){var Ni=p.useRef(!1),Fn=wN({lead:!0,scale:bt}),Yn=Fn[0],vn=Yn.lead,si=Yn.scale,Bn=Fn[1],ni=SA(function(Ui){try{return $t(!0),Bn({lead:!1,scale:Ui}),Promise.resolve()}catch(Ri){return Promise.reject(Ri)}},{wait:zn});return M$(function(){Ni.current?($t(!1),Bn({lead:!0}),ni(bt)):Ni.current=!0},[bt]),vn?[En*si,et*si,bt/si]:[En*bt,et*bt,1]}(qe,Ie,We,gt,it),ct=kt[0],Kt=kt[1],dn=kt[2],Xt=function(En,et,bt,zn,$t){var Ni=p.useState(yYe),Fn=Ni[0],Yn=Ni[1],vn=p.useState(0),si=vn[0],Bn=vn[1],ni=p.useRef(),Ui=ny({OK:function(){return En&&Bn(4)}});function Ri(Qi){$t(!1),Bn(Qi)}return p.useEffect(function(){if(ni.current||(ni.current=Date.now()),bt){if(function(Qi,Ve){var St=Qi&&Qi.current;if(St&&St.nodeType===1){var Jt=St.getBoundingClientRect();Ve({T:Jt.top,L:Jt.left,W:Jt.width,H:Jt.height,FIT:St.tagName==="IMG"?getComputedStyle(St).objectFit:void 0})}}(et,Yn),En)return Date.now()-ni.current<250?(Bn(1),requestAnimationFrame(function(){Bn(2),requestAnimationFrame(function(){return Ri(3)})}),void setTimeout(Ui.OK,zn)):void Bn(4);Ri(5)}},[En,bt]),[si,Fn]}(Pe,yt,jt,gt,it),Ge=Xt[0],mt=Xt[1],xt=mt.W,hn=mt.FIT,Vt=innerWidth/2,Qe=innerHeight/2,rt=Ge<3||Ge>4;return[rt?xt?mt.L:Vt:qt+(Vt-qe*We/2),rt?xt?mt.T:Qe:ln+(Qe-Ie*We/2),ct,rt&&hn?ct*(mt.H/xt):Kt,Ge===0?dn:rt?xt/(qe*We)||.01:dn,rt?hn?1:0:1,Ge,hn]}(u,c,K,q,Q,L,M,ae,d,function(Pe){return A({pause:Pe})}),vt=Ot[4],Tt=Ot[6],ft="transform "+d+"ms "+f,pt={className:m,onMouseDown:mh?void 0:function(Pe){Pe.stopPropagation(),Pe.button===0&&At(Pe.clientX,Pe.clientY,0)},onTouchStart:mh?function(Pe){Pe.stopPropagation(),At.apply(void 0,JX(Pe))}:void 0,onWheel:function(Pe){if(!Me){var yt=kA(ae-Pe.deltaY/100/2,_/L);A({stopRaf:!0}),Ue(yt,Pe.clientX,Pe.clientY)}},style:{width:Ot[2]+"px",height:Ot[3]+"px",opacity:Ot[5],objectFit:Tt===4?void 0:Ot[7],transform:Y?"rotate("+Y+"deg)":void 0,transition:Tt>2?ft+", opacity "+d+"ms ease, height "+(Tt<4?d/2:Tt>4?d:0)+"ms "+f:void 0}};return bi.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:g,onMouseDown:!mh&&k?Nt:void 0,onTouchStart:mh&&k?function(Pe){return Nt(Pe.touches[0])}:void 0},bi.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+vt+", 0, 0, "+vt+", "+Ot[0]+", "+Ot[1]+")",transition:X||Te?void 0:ft,willChange:k?"transform":void 0}},n?bi.createElement(OYe,Jo({src:n,loaded:K,broken:F},pt,{onPhotoLoad:function(Pe){A(Jo({},Pe,Pe.loaded&&U5(Pe.naturalWidth||0,Pe.naturalHeight||0,Y)))},loadingElement:b,brokenElement:v})):i&&i({attrs:pt,scale:vt,rotate:Y})))}var tY={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 EYe(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,m=h===void 0||h,g=e.overlayRender,b=e.toolbarRender,v=e.className,y=e.maskClassName,w=e.photoClassName,x=e.photoWrapClassName,O=e.loadingElement,S=e.brokenElement,k=e.images,C=e.index,E=C===void 0?0:C,R=e.onIndexChange,A=e.visible,N=e.onClose,T=e.afterClose,j=e.portalContainer,_=wN(tY),I=_[0],D=_[1],P=p.useState(0),L=P[0],B=P[1],M=I.x,H=I.touched,K=I.pause,F=I.lastCX,q=I.lastCY,Q=I.bg,X=Q===void 0?u:Q,ne=I.lastBg,z=I.overlay,Y=I.minimal,ae=I.scale,Ee=I.rotate,Z=I.onScale,G=I.onRotate,te=e.hasOwnProperty("index"),de=te?E:L,Ce=te?R:B,le=p.useRef(de),fe=k.length,ce=k[de],Te=typeof n=="boolean"?n:fe>n,Me=function(vt,Tt){var ft=p.useReducer(function(jt){return!jt},!1)[1],pt=p.useRef(0),Pe=function(jt){var qt=p.useRef(jt);function ln(qe){qt.current=qe}return p.useMemo(function(){(function(qe){vt?(qe(vt),pt.current=1):pt.current=2})(ln)},[jt]),[qt.current,ln]}(vt),yt=Pe[1];return[Pe[0],pt.current,function(){ft(),pt.current===2&&(yt(!1),Tt&&Tt()),pt.current=0}]}(A,T),we=Me[0],Ue=Me[1],ke=Me[2];M$(function(){if(we)return D({pause:!0,x:de*-(innerWidth+D0)}),void(le.current=de);D(tY)},[we]);var je=ny({close:function(vt){G&&G(0),D({overlay:!0,lastBg:X}),N(vt)},changeIndex:function(vt,Tt){Tt===void 0&&(Tt=!1);var ft=Te?le.current+(vt-de):vt,pt=fe-1,Pe=D$(ft,0,pt),yt=Te?ft:Pe,jt=innerWidth+D0;D({touched:!1,lastCX:void 0,lastCY:void 0,x:-jt*yt,pause:Tt}),le.current=yt,Ce&&Ce(Te?vt<0?pt:vt>pt?0:vt:Pe)}}),re=je.close,ve=je.changeIndex;function be(vt){return vt?re():D({overlay:!z})}function xe(){D({x:-(innerWidth+D0)*de,lastCX:void 0,lastCY:void 0,pause:!0}),le.current=de}function Ke(vt,Tt,ft,pt){vt==="x"?function(Pe){if(F!==void 0){var yt=Pe-F,jt=yt;!Te&&(de===0&&yt>0||de===fe-1&&yt<0)&&(jt=yt/2),D({touched:!0,lastCX:F,x:-(innerWidth+D0)*le.current+jt,pause:!1})}else D({touched:!0,lastCX:Pe,x:M,pause:!1})}(Tt):vt==="y"&&function(Pe,yt){if(q!==void 0){var jt=u===null?null:D$(u,.01,u-Math.abs(Pe-q)/100/4);D({touched:!0,lastCY:q,bg:yt===1?jt:u,minimal:yt===1})}else D({touched:!0,lastCY:Pe,bg:X,minimal:!0})}(ft,pt)}function Ze(vt,Tt){var ft=vt-(F??vt),pt=Tt-(q??Tt),Pe=!1;if(ft<-40)ve(de+1);else if(ft>40)ve(de-1);else{var yt=-(innerWidth+D0)*le.current;Math.abs(pt)>100&&Y&&f&&(Pe=!0,re()),D({touched:!1,x:yt,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!Pe||z})}}ov("keydown",function(vt){if(A)switch(vt.key){case"ArrowLeft":ve(de-1,!0);break;case"ArrowRight":ve(de+1,!0);break;case"Escape":re()}});var he=function(vt,Tt,ft){return p.useMemo(function(){var pt=vt.length;return ft?vt.concat(vt).concat(vt).slice(pt+Tt-1,pt+Tt+2):vt.slice(Math.max(Tt-1,0),Math.min(Tt+2,pt+1))},[vt,Tt,ft])}(k,de,Te);if(!we)return null;var ye=z&&!Ue,Ae=A?X:ne,He=Z&&G&&{images:k,index:de,visible:A,onClose:re,onIndexChange:ve,overlayVisible:ye,overlay:ce&&ce.overlay,scale:ae,rotate:Ee,onScale:Z,onRotate:G},De=i?i(Ue):400,At=r?r(Ue):ZX,Nt=i?i(3):600,Ot=r?r(3):ZX;return bi.createElement(fYe,{className:"PhotoView-Portal"+(ye?"":" PhotoView-Slider__clean")+(A?"":" PhotoView-Slider__willClose")+(v?" "+v:""),role:"dialog",onClick:function(vt){return vt.stopPropagation()},container:j},A&&bi.createElement(gYe,null),bi.createElement("div",{className:"PhotoView-Slider__Backdrop"+(y?" "+y:"")+(Ue===1?" PhotoView-Slider__fadeIn":Ue===2?" PhotoView-Slider__fadeOut":""),style:{background:Ae?"rgba(0, 0, 0, "+Ae+")":void 0,transitionTimingFunction:At,transitionDuration:(H?0:De)+"ms",animationDuration:De+"ms"},onAnimationEnd:ke}),m&&bi.createElement("div",{className:"PhotoView-Slider__BannerWrap"},bi.createElement("div",{className:"PhotoView-Slider__Counter"},de+1," / ",fe),bi.createElement("div",{className:"PhotoView-Slider__BannerRight"},b&&He&&b(He),bi.createElement(hYe,{className:"PhotoView-Slider__toolbarIcon",onClick:re}))),he.map(function(vt,Tt){var ft=Te||de!==0?le.current-1+Tt:de+Tt;return bi.createElement(SYe,{key:Te?vt.key+"/"+vt.src+"/"+ft:vt.key,item:vt,speed:De,easing:At,visible:A,onReachMove:Ke,onReachUp:Ze,onPhotoTap:function(){return be(s)},onMaskTap:function(){return be(l)},wrapClassName:x,className:w,style:{left:(innerWidth+D0)*ft+"px",transform:"translate3d("+M+"px, 0px, 0)",transition:H||K?void 0:"transform "+Nt+"ms "+Ot},loadingElement:O,brokenElement:S,onPhotoResize:xe,isActive:le.current===ft,expose:D})}),!mh&&m&&bi.createElement(bi.Fragment,null,(Te||de!==0)&&bi.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return ve(de-1,!0)}},bi.createElement(pYe,null)),(Te||de+1-1){var y=u.slice();return y.splice(v,1,b),void l({images:y})}l(function(w){return{images:w.images.concat(b)}})},remove:function(b){l(function(v){var y=v.images.filter(function(w){return w.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)}}),m=ny({close:function(){l({visible:!1}),i&&i(!1,f,a)},changeIndex:function(b){l({index:b}),n&&n(b,a)}}),g=p.useMemo(function(){return Jo({},a,h)},[a,h]);return bi.createElement(CEe.Provider,{value:g},t,bi.createElement(EYe,Jo({images:u,visible:d,index:f,onIndexChange:m.changeIndex,onClose:m.close},r)))}var AEe=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=p.useContext(CEe),h=(t=function(){return f.nextId()},(n=p.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),m=p.useRef(null);p.useImperativeHandle(d==null?void 0:d.ref,function(){return m.current}),p.useEffect(function(){return function(){f.remove(h)}},[]);var g=ny({render:function(v){return r&&r(v)},show:function(v,y){f.show(h),function(w,x){if(d){var O=d.props[w];O&&O(x)}}(v,y)}}),b=p.useMemo(function(){var v={};return u.forEach(function(y){v[y]=g.show.bind(null,y)}),v},[]);return p.useEffect(function(){f.update({key:h,src:i,originRef:m,render:g.render,overlay:s,width:a,height:l})},[i]),d?p.Children.only(p.cloneElement(d,Jo({},b,{ref:m}))):null};function gy(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.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),o.jsx("path",{d:"m7.5 9 2.7 2.5L7.5 14M12.7 14h3.8"}),o.jsx("path",{d:"M3.8 7.5h16.4",opacity:".55"})]})}function _Ee(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.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),o.jsx("path",{d:"M3.8 8h16.4"}),o.jsx("circle",{cx:"6.5",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"8.8",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),o.jsx("path",{d:"m9 15 2.2-4 1.6 2.4 1.1-1.2L16 15H9Z"})]})}function yU(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:"M12 3.4 19 6v5.3c0 4.3-2.7 7.6-7 9.3-4.3-1.7-7-5-7-9.3V6l7-2.6Z"}),o.jsx("path",{d:"m8.8 12 2 2 4.4-4.4"})]})}function I_(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:"M3.5 7.7h6.1l1.7 2h9.2v7.5a2.3 2.3 0 0 1-2.3 2.3H5.8a2.3 2.3 0 0 1-2.3-2.3V7.7Z"}),o.jsx("path",{d:"M3.8 7.7V6.8a2.3 2.3 0 0 1 2.3-2.3h3l1.8 2h6.9a2.3 2.3 0 0 1 2.3 2.3v.9"}),o.jsx("path",{d:"M12 13v3M10.5 14.5h3"})]})}function _Ye(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 5v14M5 12h14"})})}function nY(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 11.5 5.5-5.5 5.5 5.5M12 6v12"})})}function iY(e){return o.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",...e,children:o.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1.75",fill:"currentColor"})})}function jYe(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.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),o.jsx("circle",{cx:"8.5",cy:"9",r:"1.4"}),o.jsx("path",{d:"m5.5 17 4.2-4.2 2.6 2.4 2.1-2.1 4.1 3.9"})]})}function NYe(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.5h7l5 5v12H6z"}),o.jsx("path",{d:"M13 3.5v5h5M9 13h6M9 16h5"})]})}function RYe(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.5",y:"5",width:"13.5",height:"14",rx:"2.5"}),o.jsx("path",{d:"m17 10 3.5-2v8L17 14zM7 8.5h4.5"})]})}function IYe(e){return o.jsx("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:"m12 3 1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM18.5 15.5l.7 2.1 2.1.7-2.1.7-.7 2.1-.7-2.1-2.1-.7 2.1-.7z"})})}function jEe(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function $$(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:"m9 6 6 6-6 6"})})}function PYe(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:"M4.8 8.2A8 8 0 1 1 4 12M4.8 8.2V4.5M4.8 8.2h3.7"}),o.jsx("path",{d:"M12 8v4.5l3 1.8"})]})}function ic(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"M20 12a8 8 0 1 1-2.35-5.65"})})}function DYe(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:"8",y:"8",width:"11",height:"11",rx:"2"}),o.jsx("path",{d:"M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"})]})}function NEe(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:"m5 12.5 4.2 4.2L19 7"})})}function V(e,t={}){return mn.t(e,{...t,ns:"adk"})}function Fl(e){const t=new Headers(e);return t.has("Accept-Language")||t.set("Accept-Language",mn.resolvedLanguage||mn.language),t}function F$(){return mn.resolvedLanguage||mn.language}const rY="veadk_auth_qs",MYe=new Set(["view","source","sessionId","artifactSha256","validationReportSha256","projectId","versionId"]);let iO=null;function LYe(){if(iO!==null)return iO;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&&MYe.has(a)?n:t).append(a,s)});const r=t.toString();if(r?(sessionStorage.setItem(rY,r),iO=r):iO=sessionStorage.getItem(rY)??"",r){const s=n.toString();window.history.replaceState(null,"",window.location.pathname+(s?`?${s}`:"")+window.location.hash)}return iO}function ia(e){const t=LYe();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}const Ga=3e4,vr=12e4,vU=1e4;function Xa(e,t=Ga){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const ON="veadk_local_user",kN="veadk_local_user_tab",$Ye="X-VeADK-OAuth-Refresh-Retry",FYe=[50,250],BYe=/^[A-Za-z0-9]{1,16}$/;function REe(){try{const e=sessionStorage.getItem(kN);if(e)return e;const t=localStorage.getItem(ON);return t&&sessionStorage.setItem(kN,t),t}catch{try{return localStorage.getItem(ON)}catch{return null}}}function sY(e){try{sessionStorage.setItem(kN,e)}catch{}try{localStorage.setItem(ON,e)}catch{}}function UYe(){try{sessionStorage.removeItem(kN)}catch{}try{localStorage.removeItem(ON)}catch{}}function hu(e){const t=new Headers(e),n=REe();return n&&t.set("X-VeADK-Local-User",n),t}async function IEe(){let e;try{e=await fetch("/web/auth-config",{headers:Fl({Accept:"application/json"}),signal:Xa(void 0,vU)})}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 QYe(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function zYe(){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 VYe(){const[e,t]=await Promise.all([B$(),IEe()]);return e.status==="unauthenticated"&&t.length>0}function HYe(){window.location.assign("/oauth2/logout")}async function qYe(){for(let e=0;;e+=1){let t;try{t=await fetch("/oauth2/userinfo",{headers:Fl({Accept:"application/json"}),signal:Xa(void 0,vU)})}catch(i){throw console.warn("[identity] /oauth2/userinfo is unreachable:",i),new Error(V("identity.serviceNetworkFailed"))}const n=FYe[e];if(t.status!==401||t.headers.get($Ye)!=="1"||n===void 0)return t;await new Promise(i=>window.setTimeout(i,n))}}async function B$(){const e=await qYe();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=REe();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function WYe(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 KYe(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const U$="veadk:authentication-required";let Uk=null,ek=null;function GYe(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 XYe(e){Uk||(Uk=new Promise(n=>{ek=n}),window.dispatchEvent(new Event(U$)));const t=Uk;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 YYe(){return Uk!==null}function ZYe(){ek==null||ek(),ek=null,Uk=null}async function zI(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 JYe=/\brun_sse\s*failed\s*:\s*404\b/i,eZe=/session not found/i,tZe=/(?:^|[::\s])not found\s*$/i,nZe=/Expecting (?:'[^']+'|\w+)(?: delimiter)?: line \d+ column \d+ \(char \d+\)/i,iZe=/Unknown or expired collection_id\s+'[^']+'\.\s*Call collect_resources first\./i,rZe=/(?: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 M0(e,t){return e.includes(t)?e:`${e} -${t}`}function lm(e){const t=String(e),n=V("runSse.rawResponseLabel");let i=t.includes(n)?t:`${n}${t}`;if(GYe.test(t))i=D0(i,V("runSse.toolArgumentHint"));else{if(XYe.test(t))return D0(i,V("runSse.resourceCollectionExpiredHint"));if(YYe.test(t))return D0(i,V("runSse.modelQuotaHint"));qYe.test(t)&&(WYe.test(t)?i=D0(i,V("runSse.persistentMemoryHint")):KYe.test(t)&&(i=D0(i,V("runSse.unsupportedRouteHint"))))}return D0(i,V("runSse.networkConfigurationHint"))}async function*zI(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(` -`);if(!(!c||c==="[DONE]"||c==="ping"))try{return JSON.parse(c)}catch{const u=r(c);throw l?new Error(V("sse.incompleteEvent",{data:u})):new Error(V("sse.invalidEventJson",{data:u}))}};try{for(;;){const{done:a,value:l}=await t.read();if(a)break;i+=n.decode(l,{stream:!0});let c=i.match(/\r?\n\r?\n/);for(;(c==null?void 0:c.index)!==void 0;){const u=i.slice(0,c.index);i=i.slice(c.index+c[0].length);const d=s(u);d!==void 0&&(yield d),c=i.match(/\r?\n\r?\n/)}}if(i+=n.decode(),i.trim()){const a=s(i,!0);a!==void 0&&(yield a)}}finally{try{await t.cancel()}catch{}finally{t.releaseLock()}}}const ZYe="X-Studio-FaaS-Instance",JYe="X-Studio-FaaS-Request-Id";function eZe(e,t,n){var s,a;const i=((s=e.headers.get(ZYe))==null?void 0:s.trim())??"";if(!t||!n||!i)return null;const r=((a=e.headers.get(JYe))==null?void 0:a.trim())??"";return{runtimeId:t,region:n,instanceName:i,...r?{requestId:r}:{}}}function oY(e,t,n,i){const r=e==="byteplus"?"https://console.byteplus.com":"https://console.volcengine.com",s=new URLSearchParams({projectName:"default",runtimeId:n,instanceName:i});return`${r}/agentkit/region:agentkit+${encodeURIComponent(t)}/runtime?${s}`}function tZe(e){return/\b(?:ERROR|FATAL|CRITICAL)\b/i.test(e)?"error":/\bWARN(?:ING)?\b/i.test(e)?"warning":/\bDEBUG\b/i.test(e)?"debug":/\bINFO\b/i.test(e)?"info":"default"}function nZe(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="done"?!0:t.type==="context"?typeof t.instanceName=="string"&&typeof t.consoleUrl=="string":t.type==="logs"?typeof t.text=="string"&&typeof t.updatedAt=="number":t.type==="error"?typeof t.message=="string"&&(t.detail===void 0||typeof t.detail=="string")&&(t.statusCode===void 0||typeof t.statusCode=="string")&&(t.errorCode===void 0||typeof t.errorCode=="string")&&(t.requestId===void 0||typeof t.requestId=="string")&&(t.responseBody===void 0||typeof t.responseBody=="string"):!1}function TEe(e){var i;const t=[e.message],n=[e.statusCode?V("runtimeLogs.httpStatus",{status:e.statusCode}):"",e.errorCode?V("runtimeLogs.errorCode",{code:e.errorCode}):"",e.requestId?`Request ID:${e.requestId}`:""].filter(Boolean);return n.length>0&&t.push(n.join(` +${t}`}function cm(e){const t=String(e),n=V("runSse.rawResponseLabel");let i=t.includes(n)?t:`${n}${t}`;if(nZe.test(t))i=M0(i,V("runSse.toolArgumentHint"));else{if(iZe.test(t))return M0(i,V("runSse.resourceCollectionExpiredHint"));if(rZe.test(t))return M0(i,V("runSse.modelQuotaHint"));JYe.test(t)&&(eZe.test(t)?i=M0(i,V("runSse.persistentMemoryHint")):tZe.test(t)&&(i=M0(i,V("runSse.unsupportedRouteHint"))))}return M0(i,V("runSse.networkConfigurationHint"))}async function*VI(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(` +`);if(!(!c||c==="[DONE]"||c==="ping"))try{return JSON.parse(c)}catch{const u=r(c);throw l?new Error(V("sse.incompleteEvent",{data:u})):new Error(V("sse.invalidEventJson",{data:u}))}};try{for(;;){const{done:a,value:l}=await t.read();if(a)break;i+=n.decode(l,{stream:!0});let c=i.match(/\r?\n\r?\n/);for(;(c==null?void 0:c.index)!==void 0;){const u=i.slice(0,c.index);i=i.slice(c.index+c[0].length);const d=s(u);d!==void 0&&(yield d),c=i.match(/\r?\n\r?\n/)}}if(i+=n.decode(),i.trim()){const a=s(i,!0);a!==void 0&&(yield a)}}finally{try{await t.cancel()}catch{}finally{t.releaseLock()}}}const sZe="X-Studio-FaaS-Instance",oZe="X-Studio-FaaS-Request-Id";function aZe(e,t,n){var s,a;const i=((s=e.headers.get(sZe))==null?void 0:s.trim())??"";if(!t||!n||!i)return null;const r=((a=e.headers.get(oZe))==null?void 0:a.trim())??"";return{runtimeId:t,region:n,instanceName:i,...r?{requestId:r}:{}}}function oY(e,t,n,i){const r=e==="byteplus"?"https://console.byteplus.com":"https://console.volcengine.com",s=new URLSearchParams({projectName:"default",runtimeId:n,instanceName:i});return`${r}/agentkit/region:agentkit+${encodeURIComponent(t)}/runtime?${s}`}function lZe(e){return/\b(?:ERROR|FATAL|CRITICAL)\b/i.test(e)?"error":/\bWARN(?:ING)?\b/i.test(e)?"warning":/\bDEBUG\b/i.test(e)?"debug":/\bINFO\b/i.test(e)?"info":"default"}function cZe(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="done"?!0:t.type==="context"?typeof t.instanceName=="string"&&typeof t.consoleUrl=="string":t.type==="logs"?typeof t.text=="string"&&typeof t.updatedAt=="number":t.type==="error"?typeof t.message=="string"&&(t.detail===void 0||typeof t.detail=="string")&&(t.statusCode===void 0||typeof t.statusCode=="string")&&(t.errorCode===void 0||typeof t.errorCode=="string")&&(t.requestId===void 0||typeof t.requestId=="string")&&(t.responseBody===void 0||typeof t.responseBody=="string"):!1}function PEe(e){var i;const t=[e.message],n=[e.statusCode?V("runtimeLogs.httpStatus",{status:e.statusCode}):"",e.errorCode?V("runtimeLogs.errorCode",{code:e.errorCode}):"",e.requestId?`Request ID:${e.requestId}`:""].filter(Boolean);return n.length>0&&t.push(n.join(` `)),e.detail&&e.detail!==e.message&&t.push(e.detail),e.responseBody&&!((i=e.detail)!=null&&i.includes(e.responseBody))&&t.push(V("runtimeLogs.cloudResponseBody",{body:e.responseBody})),t.join(` -`)}async function iZe(e){const t=`HTTP ${e.status}${e.statusText?` ${e.statusText}`:""}`,n=await e.text();if(!n)return t;try{const i=JSON.parse(n);if(typeof i.detail=="string"&&i.detail)return`${t} +`)}async function uZe(e){const t=`HTTP ${e.status}${e.statusText?` ${e.statusText}`:""}`,n=await e.text();if(!n)return t;try{const i=JSON.parse(n);if(typeof i.detail=="string"&&i.detail)return`${t} -${i.detail}`;if(i.detail&&typeof i.detail=="object"){const r=i.detail;if(typeof r.message=="string")return TEe({message:r.message,...typeof r.detail=="string"?{detail:r.detail}:{},...typeof r.statusCode=="string"?{statusCode:r.statusCode}:{},...typeof r.errorCode=="string"?{errorCode:r.errorCode}:{},...typeof r.requestId=="string"?{requestId:r.requestId}:{},...typeof r.responseBody=="string"?{responseBody:r.responseBody}:{}})}return`${t} +${i.detail}`;if(i.detail&&typeof i.detail=="object"){const r=i.detail;if(typeof r.message=="string")return PEe({message:r.message,...typeof r.detail=="string"?{detail:r.detail}:{},...typeof r.statusCode=="string"?{statusCode:r.statusCode}:{},...typeof r.errorCode=="string"?{errorCode:r.errorCode}:{},...typeof r.requestId=="string"?{requestId:r.requestId}:{},...typeof r.responseBody=="string"?{responseBody:r.responseBody}:{}})}return`${t} ${JSON.stringify(i,null,2)}`}catch{return`${t} -${n}`}}async function*rZe({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(ta(`/web/runtime-logs/${encodeURIComponent(e)}/stream?${a.toString()}`),{headers:Ll(pu({Accept:"text/event-stream"})),cache:"no-store",signal:s});if(!l.ok)throw new Error(V("runtimeLogs.loadFailedWithDetail",{detail:await iZe(l)}));for await(const c of zI(l)){if(!nZe(c))throw new Error(V("runtimeLogs.invalidFormat"));yield c}}const sZe=255,oZe=/[\p{L}\p{M}\p{N}\p{P}\p{Zs}]/u;function aZe(e){const t=e.normalize("NFKC").replace(/\s+/gu," ").trim(),n=new TextEncoder;let i=0,r="";for(const s of t){if(!oZe.test(s))continue;const a=n.encode(s).byteLength;if(i+a>sZe)break;r+=s,i+=a}return r.replace(/ +/g," ").trimEnd()}const lZe=/RunPipeline result could not be reconciled|Polling build status failed/i;class D_ extends Error{constructor({taskId:n,cause:i}={}){super("The deployment request may still be running, but its status could not be confirmed.");Jt(this,"taskId");this.name="DeploymentStatusUnconfirmedError",this.taskId=n}}function AEe(e){if(e instanceof D_)return!0;const t=e instanceof Error?e.message:String(e??"");return lZe.test(t)}function _Ee(e){return!!(e&&typeof e=="object"&&"name"in e&&e.name==="AbortError")}async function cZe({load:e,signal:t,timeoutMs:n=30*6e4,intervalMs:i=2e3,shouldRetry:r=()=>!0}){if(t!=null&&t.aborted)throw t.reason??new DOMException("Aborted","AbortError");const s=Date.now()+Math.max(0,n);for(;!(t!=null&&t.aborted)&&Date.now()<=s;){try{const a=await e(t);if(a.done)return a}catch(a){if(t!=null&&t.aborted||_Ee(a)||!r(a))throw a}if(t!=null&&t.aborted)throw t.reason??new DOMException("Aborted","AbortError");i<=0||await new Promise((a,l)=>{const c=()=>{globalThis.clearTimeout(u),t==null||t.removeEventListener("abort",c),l((t==null?void 0:t.reason)??new DOMException("Aborted","AbortError"))},u=globalThis.setTimeout(()=>{t==null||t.removeEventListener("abort",c),a()},i);t==null||t.addEventListener("abort",c,{once:!0})})}return null}const Q$="ap-southeast-1",xU="cn-beijing",uZe="https://ark.ap-southeast.bytepluses.com/api/v3",dZe="https://ark.cn-beijing.volces.com/api/v3/",fZe="https://console.byteplus.com/ark/region:ark+ap-southeast-1/openManagement",hZe="https://console.volcengine.com/ark/region:ark+cn-beijing/openManagement",pZe="dola-seed-2-1-turbo-260628",mZe="doubao-seed-2-1-pro-260628",gZe="skylark-embedding-vision-250615",bZe="doubao-embedding-vision-250615",yZe="seed-2-0-lite-260228",vZe="doubao-seed-2-0-lite-260428",xZe="dola-seedream-5-0-pro-260628",wZe="doubao-seedream-5-0-260128",OZe="seededit-3-0-i2i-250628",kZe="doubao-seededit-3-0-i2i-250628",SZe="dreamina-seedance-2-0-260128",EZe="doubao-seedance-2-0-260128";function iu(e){return e==="byteplus"?[{value:Q$,label:Q$}]:[{value:"cn-beijing",label:V("cloudRegion.cnBeijing")},{value:"cn-shanghai",label:V("cloudRegion.cnShanghai")}]}function qi(e){var t;return((t=iu(e)[0])==null?void 0:t.value)||xU}const CZe=new Set(["cn-beijing","cn-shanghai","ap-southeast-1"]);function VI(e){return typeof e=="string"&&CZe.has(e)}function Lf(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 lp(e){return e==="byteplus"?pZe:mZe}function wa(e){return e==="byteplus"?uZe:dZe}function TZe(e){return e==="byteplus"?fZe:hZe}function AZe(e){return e==="byteplus"?gZe:bZe}function _Ze(e){return e==="byteplus"?yZe:vZe}function jZe(e){return e==="byteplus"?xZe:wZe}function NZe(e){return e==="byteplus"?OZe:kZe}function RZe(e){return e==="byteplus"?SZe:EZe}const wU="veadk.messageFeedback.v1";function OU(e,t,n,i){return[e,t,n,i].join(":")}function kU(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(wU)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function IZe(e,t,n){if(typeof window>"u")return;const i=kU();i[e]={...i[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(wU,JSON.stringify(i))}function jEe(e){if(typeof window>"u")return;const t=OU(e.runtimeId,e.appName,e.userId,e.sessionId),n=kU(),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(wU,JSON.stringify(n))}}const M_="",SU=new Map;function NEe(e,t){SU.set(e,t)}function REe(){SU.clear()}function pc(e){const t=SU.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 Lt(e,t={},n={},i=qa){const r=Wa(t.signal,i),s=!!n.runtimeId&&String(t.method??"GET").toUpperCase()==="DELETE",a={...t,...s?{method:"POST"}:{},headers:Ll(pu(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(ta(`${M_}/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(ta(`${M_}/agentkit-proxy${e}`),{...d,headers:f})}return fetch(ta(`${M_}${e}`),d)},c=async d=>{if(d.headers.get("X-Studio-Error-Source")==="upstream")return!1;if(QYe(d))return!0;if(d.status!==401)return!1;try{return await LYe()}catch{return!1}};let u=await l();for(;await c(u);)await zYe(r),u=await l();return u}function pn(e,t={},n=qa){return Lt(e,t,{},n)}function PZe(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 dn(e,t){const n=e.headers.get("X-Studio-Error-Source"),i=n==="upstream"?e.headers.get("X-Studio-Upstream-Status")??e.status:e.status,r=V("common.fallbackWithHttpStatus",{fallback:t,status:i}),s=await e.text().catch(()=>"");if(n==="upstream")return V("client.errorWithCloudResponse",{context:r,action:e.headers.get("X-Studio-Upstream-Action")??"",response:s||V("client.emptyCloudResponse")});if(!s)return r;try{const a=JSON.parse(s),l=PZe(a.detail??a.error);return n==="transport"||n==="studio"?l?`${r} -${l}`:r:l?V("client.errorWithDetailAndRawResponse",{context:r,detail:l,response:s}):V("client.errorWithRawResponse",{context:r,response:s})}catch{return V("client.errorWithRawResponse",{context:r,response:s})}}async function EU(e,t=!1){const n=await Lt(`/web/model-api-keys${t?"?refresh=true":""}`,{signal:e,cache:"no-store"});if(!n.ok)throw new Error(await dn(n,V("client.loadArkApiKeysFailed")));return await n.json()}async function IEe(e,t){const n=await Lt(`/web/model-api-keys/${encodeURIComponent(e)}/value`,{method:"POST",signal:t,cache:"no-store"});if(!n.ok)throw new Error(await dn(n,V("client.loadArkApiKeysFailed")));return await n.json()}async function Bw(e){const t=new URLSearchParams;e!=null&&e.apiKeyId&&t.set("apiKeyId",e.apiKeyId),e!=null&&e.refresh&&t.set("refresh","true"),e!=null&&e.scope&&t.set("scope",e.scope);const n=t.toString(),i=await Lt(`/web/model-options${n?`?${n}`:""}`,{signal:e==null?void 0:e.signal,cache:"no-store"});if(!i.ok)throw new Error(await dn(i,V("client.loadModelsFailed")));return await i.json()}async function PEe(){const e=await Lt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class Uw extends Error{constructor(){super(V("client.runtimeAccessDenied")),this.name="RuntimeAccessDeniedError"}}class po extends Error{constructor(t,n=!1,i=!1){super(t),this.unsupported=n,this.retryable=i,this.name="RuntimeProbeError"}}const DEe=()=>V("client.privateRuntimeUnavailable"),MEe=()=>V("client.runtimeTemporarilyUnavailable"),aY=["cn-beijing","cn-shanghai"],DZe=3e4,Qw=5*60*1e3,LEe=60*1e3;let VS="volcengine";const ix=new Map,yb=new Map,vb=new Map,xd=new Map,Vr=new Map;function CU(e,t,n){return`${t}:${e}:${n??""}`}function $Ee(e){e!==VS&&Vr.clear(),VS=e}function kC(e){const t=(e||"").trim();if(VS==="byteplus")return[t&&!t.startsWith("cn-")?t:Q$];const n=t&&!t.startsWith("ap-")?t:xU;return aY.includes(n)?[n,...aY.filter(i=>i!==n)]:[n]}function HI(e){const t=(e||"").trim();return t?[t]:kC()}function qy(...e){return e.map(t=>String(t??"")).join("")}function _g(e,t,n){const i=e.get(t);return i!=null&&i.value&&Date.now()-i.updatedAt<=n?i.value:null}function TU(e,t,n){return e.set(t,{value:n,updatedAt:Date.now()}),n}function C2(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 FEe(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function SC(e,t,n,i,r=qa){const s=await Lt("/list-apps",{signal:i},n??{base:e,apiKey:t},r),a=n!=null&&n.runtimeId?await FEe(s):"";if(n!=null&&n.runtimeId&&a==="runtime_access_denied")throw new Uw;if(n!=null&&n.runtimeId&&a==="runtime_private_endpoint_unreachable")throw new po(DEe());if(n!=null&&n.runtimeId&&["runtime_proxy_connect_error","runtime_proxy_timeout","runtime_json_connect_error","runtime_json_timeout"].includes(a))throw new po(MEe(),!1,!0);if(n!=null&&n.runtimeId&&s.status===404)throw new po(V("client.runtimeConnectionUnsupported"),!0,!0);if(n!=null&&n.runtimeId&&(s.status===401||s.status===403))throw new po(V("client.runtimeConnectionDenied"));if(!s.ok)throw new Error(await dn(s,V("client.listAgentsFailed")));let l;try{l=await s.json()}catch{throw new po(V("client.invalidListAppsJson"))}if(!Array.isArray(l)||l.some(u=>typeof u!="string"||!u.trim()))throw new po(V("client.invalidListAppsFormat"));const c=l.map(u=>u.trim());return n!=null&&n.runtimeId&&ix.set(CU(n.runtimeId,n.region??"",n.runtimeVersion),{apps:c,expiresAt:Date.now()+DZe}),c}async function BEe(e,t){const{app:n,ep:i}=pc(e),r=await Lt(`/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 dn(r,V("client.createSessionFailed"));throw new Error(l===a?a:V("common.fallbackWithDetail",{fallback:a,detail:l}))}return(await r.json()).id}async function AU(e,t){const{app:n,ep:i}=pc(e),r=await Lt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},i);if(!r.ok)throw new Error(`list sessions failed: ${r.status}`);return r.json()}async function qI(e,t,n){const{app:i,ep:r}=pc(e),s=await Lt(`/apps/${i}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}`,{},r);if(!s.ok){const l=await dn(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=OU(r.runtimeId,i,t,n);a.state={...kU()[l]??{},...a.state??{}}}return a}async function UEe(e){const{app:t,ep:n}=pc(e.appName);if(!n.runtimeId)throw new Error(V("client.feedbackRuntimeOnly"));if(!n.region)throw new Error(V("client.feedbackRegionMissing"));const i=await Lt("/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??""})},{},hr);if(!i.ok)throw new Error(await dn(i,V("client.submitFeedbackFailed")));const r=await i.json(),s=OU(n.runtimeId,t,e.userId,e.sessionId);return IZe(s,e.eventId,r),r}async function WI(e,t={}){const n=qy(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),i=_g(xd,n,LEe);if(!t.force&&i)return i;const r=xd.get(n);if(!t.force&&(r!=null&&r.promise))return r.promise;let s=null;const a=(async()=>{for(const l of HI(e.region)){const c=new URLSearchParams({runtimeId:e.runtimeId,region:l,appName:e.appName,page_size:String(e.pageSize??100)}),u=await Lt(`/web/evaluation/feedback-cases?${c.toString()}`);if(u.ok)return TU(xd,n,await u.json());s=new Error(await dn(u,V("client.loadEvaluationSetsFailed")))}throw s??new Error(V("client.loadEvaluationSetsFailed"))})();xd.set(n,{...r,promise:a,updatedAt:(r==null?void 0:r.updatedAt)??0});try{return await a}finally{const l=xd.get(n);(l==null?void 0:l.promise)===a&&xd.set(n,{value:l.value,updatedAt:l.updatedAt})}}async function z$(e){let t=null;for(const n of HI(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName,userId:e.userId}),r=await Lt(`/web/evaluation/statuses?${i.toString()}`);if(r.ok)return r.json();t=new Error(await dn(r,V("client.loadAutoEvaluationStatusFailed")))}throw t??new Error(V("client.loadAutoEvaluationStatusFailed"))}async function QEe(e){let t=null;for(const n of HI(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName}),r=await Lt(`/web/evaluation/optimizations?${i.toString()}`);if(r.ok)return r.json();t=new Error(await dn(r,V("client.loadOptimizationsFailed")))}throw t??new Error(V("client.loadOptimizationsFailed"))}function zEe(e){return _g(xd,qy(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),LEe)}function MZe(e){WI(e).catch(()=>{})}function VEe(e){WI(e,{force:!0}).catch(()=>{})}function HEe(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 L_(e){const t=e.comment??"",n=e.rating==="bad"&&!!t.trim();for(const[i,r]of xd.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;xd.set(i,{value:{...s,sets:HEe(s.sets,l),items:l},updatedAt:Date.now(),promise:r.promise})}}async function qEe(e){let t=null;for(const n of HI(e.region)){const i=await Lt("/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})},{},hr);if(i.ok){const r=await i.json(),s=new Set(e.itemIds);for(const[a,l]of xd.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));xd.set(a,{value:{...c,sets:HEe(c.sets,u),items:u},updatedAt:Date.now()})}return r}t=new Error(await dn(i,V("client.deleteEvaluationCaseFailed")))}throw t??new Error(V("client.deleteEvaluationCaseFailed"))}async function V$(e,t,n){const{app:i,ep:r}=pc(e),s=await Lt(`/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 LZe(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 WEe(e,t,n,i,r){const{app:s,ep:a}=pc(e),l=r==null?"":`?version=${encodeURIComponent(r)}`,c=`/apps/${encodeURIComponent(s)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/artifacts/${encodeURIComponent(i)}${l}`,u=await Lt(c,{},a,hr);if(!u.ok)throw new Error(await dn(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=LZe(f.data),m=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength);return{blob:new Blob([m],{type:f.mimeType??f.mime_type??"application/octet-stream"}),downloadName:f.displayName??f.display_name??i}}async function jU(e,t,n,i,r){const{blob:s}=await WEe(e,t,n,i,r);return URL.createObjectURL(s)}async function $Ze(e){const t=await Lt("/web/media/capabilities");if(!t.ok)throw new Error(await dn(t,"media capabilities failed"));return t.json()}async function KEe(e,t,n,i){const{app:r}=pc(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 Lt("/web/media",{method:"POST",body:s},{},hr);if(!a.ok)throw new Error(await dn(a,V("client.uploadFileFailed")));return{...await a.json(),status:"ready"}}async function H$(e,t,n){const{app:i}=pc(e),r=`/web/media/${encodeURIComponent(i)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}/delete`,s=await Lt(r,{method:"POST"});if(!s.ok&&s.status!==404)throw new Error(await dn(s,"media cleanup failed"))}function GEe(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 $_(e,t){const n=GEe(t);if(!n)throw new Error("Invalid VeADK media URI");const i=await Lt(`${n}/delete`,{method:"POST"});if(!i.ok&&i.status!==404)throw new Error(await dn(i,"media cleanup failed"))}function XEe(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=GEe(t);if(!n)return t;const i=`${n}/content`;return ta(`${M_}${i}`)}async function kN(e,t,n){const{app:i,ep:r}=pc(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 Lt(`/web/runtime-trace?${c.toString()}`),s.status===404)throw new Error(V("client.traceDisabled"))}else s=await Lt(`/dev/apps/${encodeURIComponent(i)}/debug/trace/session/${encodeURIComponent(t)}`,{},r);if(!s.ok)throw new Error(await dn(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 q$(e){const t=await Lt("/web/issue-feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await dn(t,V("client.submitIssueFeedbackFailed")));if((await t.json()).submitted!==!0)throw new Error(V("client.issueFeedbackNotConfirmed"));return{submitted:!0}}async function YEe(e,t,n=!0){const i=await Lt(`/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 Lt(`/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 W$(e){const{app:t,ep:n}=pc(e);return YEe(t,n,!1)}async function FZe(e,t,n){let i=null;for(const r of kC(t)){const s={runtimeId:e,region:r};try{const a=CU(e,r),l=ix.get(a);l&&l.expiresAt<=Date.now()&&ix.delete(a);const c=ix.get(a),u=n||(c==null?void 0:c.apps[0])||(await SC("","",s))[0];if(!u)throw new Error(V("client.noPreviewableAgent"));return YEe(u,s)}catch(a){if(a instanceof Uw||a instanceof po&&!a.unsupported)throw a;i=a instanceof Error?a:new Error(String(a))}}throw i??new Error(V("client.noPreviewableAgent"))}async function NU(e,t,n={},i={}){const r=typeof n=="string"?n:void 0,s=typeof n=="string"?i:n,a=qy(e,t||"cn-beijing",r??""),l=_g(yb,a,Qw);if(!s.force&&l)return l;const c=yb.get(a);if(!s.force&&(c!=null&&c.promise))return c.promise;const u=FZe(e,t,r).then(d=>TU(yb,a,d));yb.set(a,{...c,promise:u,updatedAt:(c==null?void 0:c.updatedAt)??0});try{return await u}finally{const d=yb.get(a);(d==null?void 0:d.promise)===u&&yb.set(a,{value:d.value,updatedAt:d.updatedAt})}}function ZEe(e,t,n=""){return _g(yb,qy(e,t||"cn-beijing",n),Qw)}function JEe(e,t,n=""){NU(e,t,n).catch(()=>{})}async function eCe(e,t,n,i){const{app:r,ep:s}=pc(e),a=new URLSearchParams({source:t,app_name:r,q:n,user_id:i}),l=await Lt(`/web/search?${a.toString()}`,{},s);if(!l.ok)throw new Error(await dn(l,V("client.agentSearchFailed")));return l.json()}async function tCe(e,t){const{app:n}=pc(e),i=await Lt(`/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 nCe(){return lm(V("client.emptySseBody"))}function F_(){return lm(V("client.noDisplayableSseReply"))}const BZe=6e4;function Kx(){return V("client.firstSseEventTimeout")}function iCe(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(Kx())))},BZe);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*K$({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:m}=pc(e),g=r.flatMap(S=>S.status&&S.status!=="ready"?[]:S.uri?[{fileData:{mimeType:S.mimeType,fileUri:S.uri,displayName:S.name},partMetadata:{veadkMedia:{id:S.id,uri:S.uri,name:S.name,mimeType:S.mimeType,sizeBytes:S.sizeBytes}}}]:S.data?[{inlineData:{mimeType:S.mimeType,data:S.data,displayName:S.name}}]:[]),b=s&&(s.skills.length>0||s.targetAgent)?s:void 0,v=[...g,...u.map(S=>({functionResponse:{id:S.id,name:S.name,response:S.response}})),...i.trim()?[{text:i}]:[]];if(b&&v.length>0){const S=v[0],k=S.partMetadata;v[0]={...S,partMetadata:{...k,veadkInvocation:b}}}let y;const w=iCe(d);try{y=await Lt("/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:w.signal},m,0)}catch(S){throw w.cleanup(),w.timedOut()?new Error(Kx()):d!=null&&d.aborted||(S==null?void 0:S.name)==="AbortError"?S:new Error(lm(S))}const x=eZe(y,m.runtimeId??"",m.region??"");if(x&&(f==null||f(x)),!y.ok){w.cleanup();const S=await dn(y,V("client.runSessionFailed"));throw new Error(lm(V("client.runSseFailedWithDetail",{status:y.status,detail:S})))}let O=!1;try{for await(const S of zI(y)){O=!0,w.clearDeadline();const k=S;typeof k.error=="string"&&(k.error=lm(k.error)),typeof k.errorMessage=="string"&&(k.errorMessage=lm(k.errorMessage)),typeof k.error_message=="string"&&(k.error_message=lm(k.error_message)),yield k}}catch(S){throw w.timedOut()?new Error(Kx()):d!=null&&d.aborted||(S==null?void 0:S.name)==="AbortError"?S:new Error(lm(S))}finally{w.cleanup()}if(!O)throw new Error(nCe())}async function KI(e,t){const n=new URLSearchParams({name:e,region:t}),i=await Lt(`/web/runtime-name-availability?${n.toString()}`,{cache:"no-store"});if(!i.ok)throw new Error(await dn(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 rCe(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 Lt(`/web/deployment-resources?${n.toString()}`,{signal:t});if(!i.ok)throw new Error(await dn(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 sCe(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 oCe({runtimeId:e,appName:t,userId:n,sessionId:i,environmentMounts:r}){const{app:s}=pc(t);let a;try{a=await Lt("/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 dn(a,V("client.environmentMountFailed")));return sCe(await a.json(),r)}function RU(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 aCe(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 lY={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 lCe(e){var r;const t=await Lt("/web/system-info",{signal:e});if(!t.ok)throw new Error(await dn(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)=>(lY[s.kind]??Number.MAX_SAFE_INTEGER)-(lY[a.kind]??Number.MAX_SAFE_INTEGER));return{storage:{tosAddress:n.storage.tosAddress},sandboxTools:i}}const cCe=new Set(["preparing","queued","building","scanning","available","failed"]);function IU(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"||!cCe.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 uCe(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||!cCe.has(t.status.phase)||typeof t.status.createdAt!="string"||typeof t.status.updatedAt!="string")throw new Error(V("client.invalidEnvironmentManifest"));return t}function dCe(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 UZe(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 QZe(e){const t=dCe(e);if(!t)return;const n=e;if(typeof n.reference!="string")throw new Error(V("client.invalidImageSource"));return{...t,reference:n.reference}}function PU(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:UZe(t.gitSource),containerRepository:dCe(t.containerRepository),imageSource:QZe(t.imageSource),latestVersion:IU(t.latestVersion)}}function fCe(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 DU(e){const t=await Lt("/web/workspaces",{signal:e});if(!t.ok)throw new Error(await dn(t,V("client.loadWorkspacesFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(V("client.invalidWorkspaceList"));return n.items.map(fCe)}async function hCe(e,t,n,i){const r=await Lt(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i});if(!r.ok)throw new Error(await dn(r,V("client.saveWorkspaceFailed")));return fCe(await r.json())}function pCe(e,t){return hCe("/web/workspaces","POST",e,t)}function mCe(e,t,n){return hCe(`/web/workspaces/${encodeURIComponent(e)}`,"PATCH",t,n)}async function gCe(e,t){const n=await Lt(`/web/workspaces/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await dn(n,V("client.deleteWorkspaceFailed")))}async function EC(e){const t=await Lt("/web/v3/environments",{signal:e});if(!t.ok)throw new Error(await dn(t,V("client.loadEnvironmentsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(V("client.invalidEnvironmentList"));return n.items.map(PU)}async function bCe(e,t){const n=await Lt("/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 dn(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 yCe(e,t){const n=await Lt(`/web/v3/environments/${encodeURIComponent(e)}/share-code`,{method:"POST",signal:t});if(!n.ok)throw new Error(await dn(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 vCe(e,t){const n=await Lt("/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 dn(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 xCe(e,t){const n=await Lt("/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 dn(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:PU(s.environment),error:s.error??""}})}async function wCe(e,t,n,i){let r;try{r=await Lt(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 dn(r,V("client.saveEnvironmentFailed")));return PU(await r.json())}function OCe(e,t){return wCe("/web/v3/environments","POST",e,t)}function kCe(e,t,n){return wCe(`/web/v3/environments/${encodeURIComponent(e)}`,"PATCH",t,n)}async function SCe(e,t){const n=await Lt(`/web/v3/environments/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await dn(n,V("client.deleteEnvironmentFailed")))}async function G$(e,t){const n=await Lt(`/web/v3/environments/${encodeURIComponent(e)}/build`,{method:"POST",signal:t});if(!n.ok)throw new Error(await dn(n,V("client.startEnvironmentBuildFailed")));const i=IU(await n.json());if(!i)throw new Error(V("client.invalidEnvironmentBuild"));return i}async function ECe(e,t,n={}){const i=n.includeLogs?"?includeLogs=true":"",r=await Lt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}${i}`,{signal:n.signal});if(!r.ok)throw new Error(await dn(r,V("client.loadEnvironmentBuildFailed")));const s=IU(await r.json());if(!s)throw new Error(V("client.invalidEnvironmentBuild"));return s}async function CCe(e,t,n){const i=await Lt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}/manifest`,{signal:n});if(!i.ok)throw new Error(await dn(i,V("client.loadEnvironmentManifestFailed")));return uCe(await i.json())}function cY(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 TCe(e){const t=await Lt("/web/v3/environment-resources",{signal:e});if(!t.ok)throw new Error(await dn(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:cY(n.codePipeline),containerRegistry:cY(n.containerRegistry)}}async function zZe(e,t){const n=await Lt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/model-env`,{method:"POST",signal:t});if(!n.ok)throw new Error(await dn(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 GI(e){const t=await Lt("/web/identity/user-pools",{signal:e});if(!t.ok)throw new Error(await dn(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})}class uY extends Error{constructor(t,n){super(n),this.status=t,this.name="DeploymentRecoveryHttpError"}}const Qk=new Map;function VZe(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 zk extends Error{constructor(t){super(t.message),this.detail=t,this.name="GithubCicdPipelineError"}}async function kp(e){const t=await e.text().catch(()=>"");if(t)try{const n=JSON.parse(t),i=VZe(n.detail??n.error);if(i)return new zk(i)}catch{return new zk({message:t})}return new zk({message:V("client.syncGithubFailed",{status:e.status})})}async function ACe(e){const t=await Lt("/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 kp(t);return t.json()}async function _Ce(e){const t=await Lt("/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 kp(t);return t.json()}async function jCe(e){const t=await Lt("/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 kp(t);return t.json()}async function HZe(e){const t=await Lt("/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 kp(t);return t.json()}async function NCe(e){const t=await Lt(`/web/github-cicd/runtime-binding?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await kp(t);const n=await t.json();return n.pipelineId?n:null}async function B_(e){const t=await Lt(`/web/github-delivery/versions?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await kp(t);return t.json()}async function RCe(e){const t=await Lt("/web/github-delivery/rollback-pr",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await kp(t);return t.json()}async function MU(e){const t=await Lt("/web/github-cicd/runtime-binding",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await kp(t);return t.json()}async function ICe(e){const t=await Lt("/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 kp(t);return t.json()}async function Wy(e,t,n,i){var h,m,g,b,v;const r=i==null?void 0:i.taskId,s=r?new AbortController:void 0;r&&s&&Qk.set(r,s);const a=()=>{r&&Qk.get(r)===s&&Qk.delete(r)},l=async y=>{if(_Ee(y))throw y;if(!r||!(i!=null&&i.runtimeId)||typeof i.baseRuntimeVersion!="number")throw new D_({taskId:r,cause:y});const w=await cZe({signal:s==null?void 0:s.signal,shouldRetry:x=>!(x instanceof uY)||x.status===404||x.status===408||x.status===429||x.status>=500,load:async x=>{const O=await Lt("/web/deploy-agentkit/status",{method:"POST",headers:{"Content-Type":"application/json"},signal:x,body:JSON.stringify({taskId:r,runtimeId:i.runtimeId,runtimeName:i.runtimeName,appName:i.appName??e,region:n.region,projectName:n.projectName,baseRuntimeVersion:i.baseRuntimeVersion})},{},3e4);if(!O.ok)throw new uY(O.status,await dn(O,V("client.deploymentFailed")));return O.json()}});if(!w)throw new D_({taskId:r,cause:y});return w};let c=null,u=null;try{const y=!!(i!=null&&i.migrationTaskId);(h=i==null?void 0:i.onStage)==null||h.call(i,{level:"info",phase:"upload",message:V(y?"client.validatingMigrationArtifact":"client.uploadingCodePackage"),pct:0}),c=await Lt("/web/deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},signal:s==null?void 0:s.signal,body:JSON.stringify({name:e,files:y?[]: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:aZe((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),(m=i==null?void 0:i.onStage)==null||m.call(i,{level:"success",phase:"upload",message:V(y?"client.migrationArtifactValidated":"client.codePackageUploaded"),pct:100})}catch(y){try{u=await l(y)}finally{a()}}if(c&&!c.ok){const y=await dn(c,V("client.deploymentFailed"));throw a(),new Error(y)}if(c)try{for await(const y of zI(c)){const w=y;if(w&&w.done){u=w;break}w&&w.message&&((g=i==null?void 0:i.onStage)==null||g.call(i,w))}}catch(y){try{u=await l(y)}finally{a()}}if(u)a();else try{u=await l()}finally{a()}if(!u.success){const y=new Error(u.error||V("client.deploymentFailed"));throw AEe(y)?new D_({taskId:r,cause:y}):y}if(!u.agentName)throw new Error(V("client.deploymentMissingAgentName"));if(!u.runtimeId&&!u.url)throw new Error(V("client.deploymentMissingConnection"));const d=(b=u.runtimeName)!=null&&b.trim()?u.agentName:e,f=((v=u.runtimeName)==null?void 0:v.trim())||u.agentName;return{apikey:u.apikey??"",url:u.url??"",agentName:d,runtimeName:f,runtimeId:u.runtimeId,consoleUrl:u.consoleUrl,region:u.region,version:u.version,warnings:u.warnings,feishuChannel:u.feishuChannel}}async function PCe(e){var n;const t=await Lt("/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=Qk.get(e))==null||n.abort(),Qk.delete(e)}async function qZe(e=xU){const t=await Lt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(V("client.loadFailed",{status:t.status}));return(await t.json()).runtimes??[]}const HS={title:"AgentKit Studio",logoUrl:""},X$={enabled:!1},U5={studio:!1,version:"",provider:"volcengine",branding:HS,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,agentUsage:!1,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local",telemetry:X$};function WZe(e){if(!e||typeof e!="object")return X$;const t=e;if(t.enabled!==!0||!t.studio||typeof t.studio!="object")return X$;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 DCe(){var e,t;try{const n=await Lt("/web/ui-config");if(!n.ok)return U5;const i=await n.json(),r=typeof((e=i.branding)==null?void 0:e.logoUrl)=="string"?i.branding.logoUrl:HS.logoUrl,s=i.provider==="byteplus"?"byteplus":"volcengine";return $Ee(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:HS.title,logoUrl:r?ta(r):""},features:{...U5.features,...i.features??{}},defaultView:i.defaultView??"chat",agentsSource:i.agentsSource==="cloud"?"cloud":"local",telemetry:WZe(i.telemetry)}}catch{return U5}}const MCe={role:"user",telemetry:{userId:"",accountId:""},capabilities:{createAgents:!1,createPersonalAgents:!1,manageAgents:!1,runtimeScope:"mine",manageUsers:!1}};async function LCe(){var n,i,r,s,a,l;const e=await Lt("/web/access");if(!e.ok)throw new Error(V("client.loadPermissionsFailed",{status:e.status}));const t=await e.json();if(!["super_admin","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"||((a=t.capabilities)==null?void 0:a.manageUsers)!==void 0&&typeof t.capabilities.manageUsers!="boolean"||!["all","mine"].includes((l=t.capabilities)==null?void 0:l.runtimeScope))throw new Error(V("client.invalidPermissionResponse"));return t}async function $Ce(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 Lt(`/web/studio-update${i}`);if(!r.ok)throw new Error(V("client.checkStudioUpdateFailed",{status:r.status}));return await r.json()}async function FCe(){const e=await Lt("/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 BCe(e){const t=await Lt("/web/studio-update",{method:"POST",headers:{"Content-Type":"application/json","X-VeADK-Studio-Update":"1"},body:JSON.stringify({version:e})},{},hr);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 UCe({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 Lt(`/web/agent-usage?${a.toString()}`,{signal:s});if(!l.ok)throw new Error(await dn(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 Sp(e=""){return`/web/cronjobs${e?`/${encodeURIComponent(e)}`:""}`}async function Y$(e){const t=await Lt(Sp(),{signal:e});if(!t.ok)throw new Error(await dn(t,V("client.loadCronJobsFailed")));const n=await t.json();return Array.isArray(n)?n:n.items??[]}async function KZe(e,t){const n=await Lt(Sp(e),{signal:t});if(!n.ok)throw new Error(await dn(n,V("client.loadCronJobFailed")));return await n.json()}async function QCe(e){const t=await Lt(Sp(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await dn(t,V("client.createCronJobFailed")));return await t.json()}async function zCe(e,t){const n=await Lt(`${Sp(e)}/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(await dn(n,V("client.updateCronJobFailed")));return await n.json()}async function VCe(e,t){const n=t?"enable":"disable",i=await Lt(`${Sp(e)}/${n}`,{method:"POST"});if(!i.ok)throw new Error(await dn(i,V(t?"client.enableCronJobFailed":"client.pauseCronJobFailed")));return await i.json()}async function HCe(e){const t=await Lt(`${Sp(e)}/run`,{method:"POST"});if(!t.ok)throw new Error(await dn(t,V("client.runCronJobFailed")));return await t.json()}async function Z$(e,t){const n=await Lt(`${Sp(e)}/runs`,{signal:t});if(!n.ok)throw new Error(await dn(n,V("client.loadCronHistoryFailed")));const i=await n.json();return Array.isArray(i)?i:i.items??[]}async function qCe(e,t){const n=await Lt(`${Sp(e)}/runs/${encodeURIComponent(t)}/cancel`,{method:"POST"});if(!n.ok)throw new Error(await dn(n,V("client.stopCronRunFailed")));return await n.json()}async function WCe(e){const t=await Lt(Sp(e),{method:"DELETE"});if(!t.ok)throw new Error(await dn(t,V("client.deleteCronJobFailed")))}class LU extends Error{constructor(t,n){super(t),this.status=n,this.name="RuntimeListError"}}async function zw(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 Lt(`/web/runtimes?${t.toString()}`,{signal:e.signal});if(!n.ok){const r=await dn(n,V("client.loadRuntimeFailed"));throw new LU(r,n.status)}const i=await n.json();return{runtimes:i.runtimes??[],nextToken:i.nextToken??""}}async function Gx(e,t,n={}){if(n.preferCached){const i=CU(e,t,n.currentVersion),r=ix.get(i);if(r&&r.expiresAt>Date.now())return[...r.apps];r&&ix.delete(i)}try{const i={runtimeId:e,region:t,runtimeVersion:n.currentVersion};return n.retryProbe&&(i.retryProbe=!0),await SC("","",i,n.signal,n.timeoutMs)}catch(i){if(i instanceof Uw||i instanceof po||i instanceof Error)throw i;return null}}async function KCe(e,t){const n=new URLSearchParams({region:t}),i=await Lt(`/web/runtime-tool-channel/${encodeURIComponent(e)}/capabilities?${n.toString()}`);if(!i.ok)throw new po(await dn(i,V("client.loadLocalToolsFailed")),!1,!0);return await i.json()}async function GCe(e,t){const n=new URLSearchParams({region:t}),i=await Lt(`/web/runtime-route-channel/${encodeURIComponent(e)}/connect?${n.toString()}`,{method:"POST"});if(!i.ok)throw new po(await dn(i,V("client.connectDynamicRouteFailed")),!1,!0);return await i.json()}async function XCe(e,t,n={}){const i={runtimeId:e,region:t};n.retryProbe&&(i.retryProbe=!0);const r=await Lt("/.well-known/agent-card.json",{},i),s=await FEe(r);if(s==="runtime_access_denied")throw new Uw;if(s==="runtime_private_endpoint_unreachable")throw new po(DEe());if(["runtime_proxy_connect_error","runtime_proxy_timeout"].includes(s))throw new po(MEe());if(r.status===404)return null;if(r.status===401||r.status===403)throw new po(V("client.a2aProbeDenied"));if(!r.ok)throw new Error(await dn(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 YCe(e,t){const n=new URLSearchParams({runtimeId:e,region:t}),i=await Lt(`/web/runtime-api-key/reveal?${n.toString()}`,{method:"POST",cache:"no-store"});if(!i.ok)throw new Error(await dn(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 ZCe(e,t){const n=await Lt("/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}))}}async function JCe({runtimeId:e,region:t,appName:n,etag:i,signal:r}){const s=await Lt("/web/runtime-mcp-credentials",{method:"POST",cache:"no-store",signal:r,headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t,appName:n,etag:i})});if(!s.ok)throw new Error(await dn(s,V("client.loadMcpCredentialsFailed")));const a=await s.json().catch(()=>null);if(!Array.isArray(a==null?void 0:a.credentials))throw new Error(V("client.invalidMcpCredentials"));return a.credentials.map(l=>{if(!l||typeof l!="object")throw new Error(V("client.invalidMcpCredentials"));const c=l,u={agentName:c.agentName,name:c.name,url:c.url,authTokenEnv:c.authTokenEnv,value:c.value};if(Object.values(u).some(d=>typeof d!="string"))throw new Error(V("client.invalidMcpCredentials"));return u})}function U_({runtimeId:e,region:t,appName:n,currentVersion:i}){return qy(VS,t,e,i??"",(n==null?void 0:n.trim())??"")}async function GZe({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 Lt(`/web/runtime-update-capability?${s.toString()}`);if(!a.ok)throw new Error(await XZe(a));return await a.json()}function XI({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=U_(a);if(s&&Vr.delete(l),!s){const f=_g(Vr,l,Qw);if(f)return C2(Promise.resolve(f),r);const h=(u=Vr.get(l))==null?void 0:u.promise;if(h)return C2(h,r);if(n){const m=U_({...a,appName:""}),g=(d=Vr.get(m))==null?void 0:d.promise;if(g){let b;return b=g.then(v=>{var w,x,O,S,k;if(v.recoveryStatus==="preparing")return((w=Vr.get(l))==null?void 0:w.promise)===b&&Vr.delete(l),v;const y=((O=(x=v.agent)==null?void 0:x.appName)==null?void 0:O.trim())??"";return y&&y!==n.trim()?(((S=Vr.get(l))==null?void 0:S.promise)===b&&Vr.delete(l),XI(a)):(((k=Vr.get(l))==null?void 0:k.promise)===b&&Vr.set(l,{value:v,updatedAt:Date.now()}),v)},v=>{var y;throw((y=Vr.get(l))==null?void 0:y.promise)===b&&Vr.delete(l),v}),Vr.set(l,{promise:b,updatedAt:0}),C2(b,r)}}}let c;return c=GZe({...a,force:s}).then(f=>{var h,m,g,b,v;if(f.recoveryStatus==="preparing")return((h=Vr.get(l))==null?void 0:h.promise)===c&&Vr.delete(l),f;if(((m=Vr.get(l))==null?void 0:m.promise)===c){Vr.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 w of y){const x=U_({...a,appName:w});x!==l&&!((v=Vr.get(x))!=null&&v.promise)&&Vr.set(x,{value:f,updatedAt:Date.now()})}}return f},f=>{var h;throw((h=Vr.get(l))==null?void 0:h.promise)===c&&Vr.delete(l),f}),Vr.set(l,{promise:c,updatedAt:0}),C2(c,r)}function J$({runtimeId:e,region:t,appName:n,currentVersion:i}){return _g(Vr,U_({runtimeId:e,region:t,appName:n,currentVersion:i}),Qw)}function eF(e){return XI(e).then(()=>{},()=>{})}function tF(e,t){if(!e){Vr.clear();return}for(const n of Vr.keys()){const[i,r,s]=n.split("");i===VS&&s===e&&(!t||r===t)&&Vr.delete(n)}}async function XZe(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 YZe(e,t){let n=null;for(const i of kC(t)){const r=await Lt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(i)}`);if(r.ok)return r.json();n=new Error(await dn(r,V("client.loadRuntimeDetailFailed")))}throw n??new Error(V("client.loadRuntimeDetailFailed"))}async function $U(e,t="cn-beijing",n={}){const i=qy(e,t||"cn-beijing"),r=_g(vb,i,Qw);if(!n.force&&r)return r;const s=vb.get(i);if(!n.force&&(s!=null&&s.promise))return s.promise;const a=YZe(e,t).then(l=>TU(vb,i,l));vb.set(i,{...s,promise:a,updatedAt:(s==null?void 0:s.updatedAt)??0});try{return await a}finally{const l=vb.get(i);(l==null?void 0:l.promise)===a&&vb.set(i,{value:l.value,updatedAt:l.updatedAt})}}function eTe(e,t="cn-beijing"){return _g(vb,qy(e,t||"cn-beijing"),Qw)}function tTe(e,t="cn-beijing"){$U(e,t).catch(()=>{})}async function Vk(e){const t=await Lt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await dn(t,V("client.generateProjectFailed")));return t.json()}const ZZe=19e4,JZe=12e4;async function nTe(e){const t=await Lt("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},ZZe);if(!t.ok)throw new Error(await dn(t,V("client.generateAgentConfigFailed")));return QI(t,V("client.generateAgentConfigFailed"))}async function iTe(e,t){const n=await Lt("/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,mcpCredentialReuses:t==null?void 0:t.mcpCredentialReuses})},{},JZe);if(!n.ok)throw new Error(await dn(n,V("client.createDebugRunFailed")));return QI(n,V("client.createDebugRunFailed"))}async function rTe(e,t){const n=await Lt(`/web/generated-agent-test-runs/${e}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:t})});if(!n.ok)throw new Error(await dn(n,V("client.createDebugSessionFailed")));return(await QI(n,V("client.createDebugSessionFailed"))).id}async function sTe(e,t){const n=await Lt(`/web/generated-agent-test-runs/${encodeURIComponent(e)}/trace/session/${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await dn(n,V("client.loadDebugTraceFailed")));const i=await QI(n,V("client.loadDebugTraceFailed"));if(!Array.isArray(i))throw new Error(V("client.invalidDebugTrace"));return i}async function*oTe({runId:e,userId:t,sessionId:n,text:i,signal:r}){const s=i.trim()?[{text:i}]:[],a=iCe(r);let l;try{l=await Lt(`/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(Kx()):c}if(!l.ok)throw a.cleanup(),new Error(await dn(l,V("client.debugRunFailed")));try{for await(const c of zI(l))a.clearDeadline(),yield c}catch(c){throw a.timedOut()?new Error(Kx()):c}finally{a.cleanup()}}async function av(e){const t=await Lt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await dn(t,V("client.cleanupDebugRunFailed")))}function aTe(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 lTe(e){const t=await Lt("/web/system-info/sandbox-tools/updates",{signal:e});if(!t.ok)throw new Error(await dn(t,V("client.loadSandboxVersionsFailed")));const n=await t.json();if(!Array.isArray(n.tools))throw new Error(V("client.invalidSandboxVersion"));return n.tools.map(aTe)}async function cTe(e){const t=await Lt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/update`,{method:"POST"},{},33e4);if(!t.ok)throw new Error(await dn(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:aTe(n.state)}}const eJe=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_SITE_BRANDING:HS,DEFAULT_STUDIO_ACCESS:MCe,GithubCicdPipelineError:zk,RuntimeAccessDeniedError:Uw,RuntimeListError:LU,RuntimeProbeError:po,attachGithubDeliveryCicdToSourceSync:HZe,bindGithubCicdRuntime:MU,buildEnvironment:G$,cancelAgentkitDeployment:PCe,cancelCronJobRun:qCe,checkRuntimeNameAvailability:KI,clearMessageFeedbackCache:jEe,clearRemoteApps:REe,componentSearch:eCe,createCronJob:QCe,createEnvironment:OCe,createGeneratedAgentTestRun:iTe,createGeneratedAgentTestSession:rTe,createGithubCicdPipeline:ACe,createGithubDeliveryCicdPipeline:_Ce,createGithubDeliveryRollbackPr:RCe,createSession:BEe,createWorkspace:pCe,deleteAgentFeedbackCases:qEe,deleteCronJob:WCe,deleteEnvironment:SCe,deleteGeneratedAgentTestRun:av,deleteMedia:$_,deleteRuntime:ZCe,deleteSession:V$,deleteSessionMedia:H$,deleteWorkspace:gCe,deployAgentkitProject:Wy,downloadArtifact:_U,ensureRuntimeRouteChannel:GCe,exportEnvironmentShareCode:yCe,fetchRemoteApps:SC,generateAgentDraftFromRequirement:nTe,generateAgentProject:Vk,getAgentFeedbackCases:WI,getAgentInfo:W$,getAgentOptimizations:QEe,getAgentUsage:UCe,getAutomaticEvaluationStatuses:z$,getCachedAgentFeedbackCases:zEe,getCachedRuntimeAgentInfo:ZEe,getCachedRuntimeDetail:eTe,getCachedRuntimeUpdateCapability:J$,getCronJob:KZe,getEnvironmentBuild:ECe,getEnvironmentManifest:CCe,getEnvironmentResources:TCe,getGeneratedAgentTestTrace:sTe,getGithubCicdRuntimeBinding:NCe,getGithubDeliveryVersions:B_,getMediaCapabilities:$Ze,getMyRuntimes:qZe,getRuntimeAgentInfo:NU,getRuntimeDetail:$U,getRuntimeMcpCredentials:JCe,getRuntimeStudioToolCapabilities:KCe,getRuntimeUpdateCapability:XI,getRuntimes:zw,getSandboxImageUpdates:lTe,getSession:qI,getSessionTrace:kN,getStudioAccess:LCe,getStudioUpdatePermissions:FCe,getStudioUpdateStatus:$Ce,getSystemInfo:lCe,getUiConfig:DCe,httpErrorMessage:dn,importEnvironmentShareCodes:xCe,initializeGithubDeliveryMain:jCe,inspectEnvironmentRepository:bCe,inspectEnvironmentShareCodes:vCe,invalidateRuntimeUpdateCapabilityCache:tF,listApps:PEe,listCronJobRuns:Z$,listCronJobs:Y$,listDeploymentResources:rCe,listEnvironments:EC,listIdentityUserPools:GI,listModelApiKeys:EU,listModelOptions:Bw,listSessions:AU,listWorkspaces:DU,mediaContentUrl:XEe,parseEnvironmentManifest:uCe,parseEnvironmentShareCodes:RU,parsePreparedSessionEnvironmentMounts:sCe,prefetchAgentFeedbackCases:MZe,prefetchRuntimeAgentInfo:JEe,prefetchRuntimeDetail:tTe,prefetchRuntimeUpdateCapability:eF,prepareSessionEnvironmentMounts:oCe,previewArtifact:jU,probeRuntimeA2a:XCe,probeRuntimeApps:Gx,refreshAgentFeedbackCases:VEe,registerRemoteApp:NEe,revealModelApiKey:IEe,revealRuntimeApiKey:YCe,runCronJobNow:HCe,runGeneratedAgentTestSSE:oTe,runSSE:K$,runSseEmptyResponseError:nCe,runSseFirstEventTimeoutError:Kx,runSseIncompleteResponseError:F_,runtimeRegionCandidates:kC,setClientCloudProvider:$Ee,setCronJobEnabled:VCe,startStudioUpdate:BCe,studioFetch:pn,submitIssueFeedback:q$,submitMessageFeedback:UEe,syncGithubCicdRuntime:ICe,updateCodexSandboxToolModelEnv:zZe,updateCronJob:zCe,updateEnvironment:kCe,updateSandboxTool:cTe,updateWorkspace:mCe,uploadMedia:KEe,upsertCachedAgentFeedbackCase:L_,webSearch:tCe,writeEnvironmentShareCode:aCe},Symbol.toStringTag,{value:"Module"})),tJe="/web/sandbox/sessions",dY="/web/sandbox/codex-project-handoff",fY=3e4,Q5=33e4,nJe=6e4,iJe=6e5,rO=15e3,Oh=6e4,rJe=33e4,hY=3e4,sJe=60*60,nF=40;function YI(e){const t=e.trim().toLowerCase();return["ready","running","wakeable"].includes(t)?"ready":t}function FU(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 Yr(e){const t=Ll(e);return t.has("Accept")||t.set("Accept","application/json"),t}class BU extends Error{constructor(n,i={}){var r;super(n);Jt(this,"code");Jt(this,"retryable");Jt(this,"publicMessage");Jt(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 oJe(e){return e instanceof BU?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 BU(u,{code:typeof s.code=="string"?s.code:"",retryable:s.retryable===!0,publicMessage:l||c,httpStatus:e.status})}async function pY(e,t){const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{throw new Error(V("sandbox.invalidStudioResponse",{fallback:t}))}}function eb(e,t="codex",n=e.toolName==="intelligent-development"){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:n,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:ZI(e.permissions),...e.conversation===void 0?{}:{restoredConversation:xb(e.conversation)}}}function mY(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 gY(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 sO={approvalPolicy:"on-request",approvalsReviewer:"user",sandboxMode:"workspace-write",networkAccess:!1};function ZI(e){if(!e||typeof e!="object")return{...sO};const t=e,n=t.approvalPolicy,i=t.approvalsReviewer,r=t.sandboxMode;return{approvalPolicy:n==="untrusted"||n==="on-request"||n==="never"?n:sO.approvalPolicy,approvalsReviewer:i==="user"||i==="auto_review"?i:sO.approvalsReviewer,sandboxMode:r==="read-only"||r==="workspace-write"||r==="danger-full-access"?r:sO.sandboxMode,networkAccess:typeof t.networkAccess=="boolean"?t.networkAccess:sO.networkAccess}}function bY(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:ZI(t.permissions)}}function uo(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function aJe(e){const t=uo(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 lJe(e){const t=uo(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 uTe(e){const t=uo(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 xb(e){const t=uo(e),n=uTe(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=uo(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=uo(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:ZI(t.permissions)}}function iF(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 cJe(e){const t=iF(e.usage);if(!t||typeof e.turnId!="string")return;const n=iF(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 uJe(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}:{}}}function dTe(e={}){let t="";const n=[],i=new Map,r=new Map;let s,a;function l(){var h;const f=s?[...n,s]:n;(h=e.onBlocks)==null||h.call(e,[...f])}function c(f){t+=f;const h=n[n.length-1],m=n.length-1,g=[...i.values()].includes(m);(h==null?void 0:h.kind)==="text"&&!g?n[m]={...h,text:h.text+f}:n.push({kind:"text",text:f}),l()}function u(f){if(typeof f.id!="string"||f.kind!=="thinking"&&f.kind!=="commentary"&&f.kind!=="tool"||f.status!=="running"&&f.status!=="done"&&f.status!=="error")return;const h=f.status!=="running";let m;if(f.kind==="thinking")m={kind:"thinking",text:typeof f.text=="string"?f.text:"",done:h};else if(f.kind==="commentary"){if(typeof f.text!="string"||!f.text)return;m={kind:"text",text:f.text}}else{if(typeof f.name!="string"||!f.name)return;m={kind:"tool",name:f.name,args:f.args,response:f.response,status:f.status==="error"?"failed":h?"completed":"running",done:h}}m={...m,id:f.id,...typeof f.itemType=="string"?{itemType:f.itemType}:{},...typeof f.phase=="string"?{phase:f.phase}:{},...typeof f.durationMs=="number"?{durationMs:f.durationMs}:{}};const g=i.get(f.id);g===void 0?(i.set(f.id,n.length),n.push(m)):n[g]=m,l()}function d(f){var b,v,y,w;let h="message";const m=[];for(const x of f.split(/\r?\n/))x.startsWith("event:")&&(h=x.slice(6).trim()),x.startsWith("data:")&&m.push(x.slice(5).trimStart());if(m.length===0)return;let g;try{g=JSON.parse(m.join(` -`))}catch{throw new Error(V("sandbox.invalidConversationResponse"))}if(h==="error"){const x=typeof g.message=="string"&&g.message?g.message:V("sandbox.conversationFailed");throw new BU(x,{code:typeof g.code=="string"?g.code:"",retryable:g.retryable===!0,publicMessage:x})}if(h==="progress"&&typeof g.text=="string"&&(s=g.text?{kind:"progress",text:g.text}:void 0,l()),["activity","delta","tool_output","tool_progress","plan","diff"].includes(h)&&(s=void 0),h==="activity"&&u(g),(h==="tool_output"||h==="tool_progress")&&typeof g.id=="string"){const x=i.get(g.id),O=x===void 0?void 0:n[x];if((O==null?void 0:O.kind)==="tool"&&x!==void 0&&typeof g.text=="string"){const S=uo(O.response)||{};n[x]=h==="tool_progress"?{...O,progressText:g.text}:{...O,response:{...S,output:(g.snapshot?"":String(S.output||""))+g.text}},l()}}if((h==="plan"||h==="diff")&&typeof g.id=="string"){const x=typeof g.text=="string"?g.text:"",O=Array.isArray(g.items)?g.items:Array.isArray(g.plan)?g.plan:[],S=h==="diff"?{kind:"diff",id:g.id,text:x,done:g.status==="done"}:{kind:"plan",id:g.id,title:V("developmentRuns.plan"),summary:x,done:g.status==="done",items:O.flatMap(C=>{const E=uo(C);if(!E||typeof(E.text??E.step)!="string")return[];const R=E.status==="inProgress"?"in_progress":E.status;return[{text:String(E.text??E.step),status:R==="completed"||R==="failed"||R==="in_progress"?R:"pending"}]})},k=i.get(g.id);k===void 0?(i.set(g.id,n.length),n.push(S)):n[k]=S,l()}if(h==="development.source_ready"||h==="development.succeeded"){const x=uo(g.payload),O=uo(x==null?void 0:x.delivery),S=h==="development.succeeded";if(O&&typeof O.sessionId=="string"&&typeof O.artifactSha256=="string"&&typeof O.validationReportSha256=="string"&&typeof O.agentName=="string"&&typeof O.entryPoint=="string"&&typeof O.fileCount=="number"&&typeof O.artifactSize=="number"&&typeof O.validatedAt=="string"&&O.deployable===!0&&O.verified===S&&typeof O.validationSummary=="string"&&Array.isArray(O.gateSummary)&&O.gateSummary.every(k=>typeof k=="string")){const k={kind:"delivery",value:{sessionId:O.sessionId,...typeof O.projectId=="string"&&typeof O.versionId=="string"?{projectId:O.projectId,versionId:O.versionId,...O.parentVersionId===null||typeof O.parentVersionId=="string"?{parentVersionId:O.parentVersionId}:{}}:{},artifactSha256:O.artifactSha256,validationReportSha256:O.validationReportSha256,agentName:O.agentName,entryPoint:O.entryPoint,fileCount:O.fileCount,artifactSize:O.artifactSize,validatedAt:O.validatedAt,gateSummary:O.gateSummary,deployable:O.deployable,verified:O.verified,validationSummary:O.validationSummary}},C=n.findIndex(E=>E.kind==="delivery"&&E.value.sessionId===O.sessionId&&E.value.artifactSha256===O.artifactSha256&&E.value.validationReportSha256===O.validationReportSha256);C===-1?n.push(k):n[C]=k,l()}}if(h==="approval"){const x=uJe(g);x&&((b=e.onApproval)==null||b.call(e,x))}if(h==="usage"){const x=cJe(g);x&&(a=x,(v=e.onUsage)==null||v.call(e,x))}if(h==="approval_resolved"&&typeof g.approvalId=="string"&&((y=e.onApprovalResolved)==null||y.call(e,g.approvalId)),h==="delta"&&typeof g.text=="string")if(typeof g.id=="string"&&g.id){const x=r.get(g.id),O=x===void 0?void 0:n[x],S=((w=uo(g))==null?void 0:w.snapshot)===!0;(O==null?void 0:O.kind)==="text"?n[x]={...O,phase:typeof g.phase=="string"&&g.phase?g.phase:O.phase,text:S?O.text.startsWith(g.text)?O.text:g.text:O.text+g.text}:(r.set(g.id,n.length),n.push({kind:"text",text:g.text,id:g.id,itemType:typeof g.itemType=="string"?g.itemType:void 0,phase:typeof g.phase=="string"?g.phase:void 0})),t=n.filter(k=>k.kind==="text").map(k=>k.text).join(""),l()}else c(g.text);if(h==="done"&&!t&&typeof g.text=="string"&&c(g.text),h==="done"){for(let x=0;x({text:t,blocks:n.map(f=>({...f})),...a?{usage:a}:{}})}}async function dJe(e,t={}){if(!e.body)throw new Error(V("sandbox.emptyConversationResponse"));const n=e.body.getReader(),i=new TextDecoder;let r="";const s=dTe(t);for(;;){const{done:l,value:c}=await n.read();r+=i.decode(c,{stream:!l});const u=r.split(/\r?\n\r?\n/);if(r=u.pop()??"",u.forEach(s.consumeFrame),l)break}r.trim()&&s.consumeFrame(r),s.consumeFrame(`event: done -data: {}`);const a=s.result();if(a.blocks.length===0)throw new Error(V("sandbox.emptyReply"));return a}async function jc(e,t,n,{method:i="GET",body:r,options:s={},fallback:a}){if(!t)throw new Error(V("sandbox.missingSession"));const l=await pn(`${e}/${encodeURIComponent(t)}/${n}`,{method:i,headers:Yr(r===void 0?void 0:{"Content-Type":"application/json"}),...r===void 0?{}:{body:JSON.stringify(r)},signal:s.signal},Oh);if(!l.ok)throw await Es(l,a);return l.json()}function fTe(e,t={}){return{async listSessions(n={}){const i=await pn(gY(e,n),{method:"GET",headers:Yr(),signal:n.signal},fY);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=>eb(s,"codex",t.intelligentDevelopment)),...(r.snapshots??[]).map(s=>mY(s))]},async startSession(n={}){var s,a;const i=((s=n.displayName)==null?void 0:s.trim())??"",r=await pn(e,{method:"POST",headers:Yr({"Content-Type":"application/json"}),body:JSON.stringify({displayName:t.textOnly&&n.projectId?Array.from(i).slice(0,nF).join(""):i,...(a=n.modelId)!=null&&a.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},Q5);if(!r.ok)throw await Es(r,V("sandbox.startFailed"));return eb(await r.json(),"codex",t.intelligentDevelopment)},async listAgentSessions(n,i={}){const r=await pn(gY(`/web/${n}/sessions`,i),{method:"GET",headers:Yr(),signal:i.signal},fY);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=>eb(a,n)),...(s.snapshots??[]).map(a=>mY(a,n))]},async startAgentSession(n,i={}){var s;const r=await pn(`/web/${n}/sessions`,{method:"POST",headers:Yr({"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},Q5);if(!r.ok)throw await Es(r,V("sandbox.createAgentFailed",{kind:n}));return eb(await r.json(),n)},async openAgentSession(n,i,r={}){if(!i)throw new Error(V("sandbox.missingSessionToOpen"));const s=await pn(`/web/${n}/sessions/${encodeURIComponent(i)}/open`,{method:"POST",headers:Yr(),signal:r.signal},Oh);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:eb(a,n),kind:n,webuiUrl:ta(a.webuiUrl)}},async launchAgentTerminal(n,i,r={}){if(!i)throw new Error(V("sandbox.missingSessionForTerminal"));const s=await pn(`/web/${n}/sessions/${encodeURIComponent(i)}/terminal`,{method:"POST",headers:Yr(),signal:r.signal},Oh);if(!s.ok)throw await Es(s,V("sandbox.openTerminalFailed",{kind:n}));const a=await s.json();return{url:hTe(a.url,`${n} Terminal`),...typeof a.shellSessionId=="string"?{shellSessionId:a.shellSessionId}:{}}},async deleteAgentSession(n,i,r={}){if(!i)return;const s=await pn(`/web/${n}/sessions/${encodeURIComponent(i)}`,{method:"DELETE",headers:Yr(),signal:r.signal},rO);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 pn(`${s}/snapshots/${encodeURIComponent(i)}/resume`,{method:"POST",headers:Yr(),signal:r.signal},Q5);if(!a.ok)throw await Es(a,V("sandbox.resumeSnapshotFailed"));return eb(await a.json(),n)},async deleteSnapshot(n,i,r={}){if(!i)return;const s=n==="codex"?"/web/sandbox":`/web/${n}`,a=await pn(`${s}/snapshots/${encodeURIComponent(i)}`,{method:"DELETE",headers:Yr(),signal:r.signal},rO);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 pn(`${e}/${encodeURIComponent(n)}/connect`,{method:"POST",headers:Yr({"Content-Type":"application/json"}),signal:i.signal},nJe);if(!r.ok)throw await Es(r,V("sandbox.connectCodexFailed"));const s=eb(await r.json(),"codex",t.intelligentDevelopment);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 pn(`${e}/${encodeURIComponent(n.sessionId)}/messages`,{method:"POST",headers:Yr({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??iJe);if(!r.ok)throw await Es(r,V("sandbox.conversationFailed"));return dJe(r,i)},async interruptSession(n,i={}){if(!n)return;const r=await pn(`${e}/${encodeURIComponent(n)}/interrupt`,{method:"POST",headers:Yr(),signal:i.signal},t.interruptTimeoutMs??rO);if(!r.ok&&![404,409].includes(r.status))throw await Es(r,V("sandbox.interruptFailed"))},async getStatus(n,i={}){const r=await jc(e,n,"status",{options:i,fallback:V("sandbox.getStatusFailed")}),s=bY(r),a=uo(r),l=iF(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=uo(await jc(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 pn(`${dY}/pairings`,{method:"POST",headers:Yr({Accept:"application/json","Content-Type":"application/json"}),body:JSON.stringify({ttlSeconds:sJe}),signal:n.signal},hY);if(!i.ok)throw await Es(i,V("sandbox.createHandoffPairingFailed"));const r=uo(await pY(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 pn(`${dY}/pairings/${encodeURIComponent(n)}`,{headers:Yr({Accept:"application/json"}),signal:i.signal},hY);if(!r.ok)throw await Es(r,V("sandbox.getHandoffStatusFailed"));const s=uo(await pY(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=uo(await jc(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=aJe(s);return a?[a]:[]})},async setModel(n,i,r={}){const s=uo(await jc(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=uo(await jc(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=lJe(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=uo(await jc(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=uTe(c);return u?[u]:[]}),...typeof l.nextCursor=="string"?{nextCursor:l.nextCursor}:{}}},async newThread(n,i={}){return xb(await jc(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 xb(await jc(e,n,`threads/${encodeURIComponent(i)}`,{options:r,fallback:V("sandbox.readThreadFailed")}))},async resumeThread(n,i,r={}){return xb(await jc(e,n,"threads/resume",{method:"POST",body:{threadId:i},options:r,fallback:V("sandbox.resumeThreadFailed")}))},async forkThread(n,i={}){return xb(await jc(e,n,"threads/fork",{method:"POST",options:i,fallback:V("sandbox.forkThreadFailed")}))},async archiveThread(n,i,r={}){const s=uo(await jc(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:xb(s)}:{}}},async deleteThread(n,i,r={}){const s=uo(await jc(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:xb(s)}:{}}},async compactThread(n,i={}){await jc(e,n,"threads/compact",{method:"POST",options:i,fallback:V("sandbox.compactThreadFailed")})},async getSettings(n,i={}){const r=await pn(`${e}/${encodeURIComponent(n)}/settings`,{method:"GET",headers:Yr(),signal:i.signal},Oh);if(!r.ok)throw await Es(r,V("sandbox.getSettingsFailed"));return bY(await r.json())},async updatePermissions(n,i,r={}){const s=await pn(`${e}/${encodeURIComponent(n)}/permissions`,{method:"PUT",headers:Yr({"Content-Type":"application/json"}),body:JSON.stringify(i),signal:r.signal},Oh);if(!s.ok)throw await Es(s,V("sandbox.updatePermissionsFailed"));const a=await s.json();return ZI(a.permissions)},async updateWorkspace(n,i,r={}){const s=await pn(`${e}/${encodeURIComponent(n)}/workspace`,{method:"PUT",headers:Yr({"Content-Type":"application/json"}),body:JSON.stringify({cwd:i}),signal:r.signal},Oh);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 pn(`${e}/${encodeURIComponent(n)}/directories?${s}`,{method:"GET",headers:Yr(),signal:r.signal},Oh);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 pn(`${e}/${encodeURIComponent(n)}/approvals/${encodeURIComponent(i)}`,{method:"POST",headers:Yr({"Content-Type":"application/json"}),body:JSON.stringify({decision:r}),signal:s.signal},Oh);if(!a.ok)throw await Es(a,V("sandbox.resolveApprovalFailed"))},async launchTerminal(n,i={}){return yY(e,n,"terminal",i)},async launchBrowser(n,i={}){return yY(e,n,"browser",i)},async uploadFile(n,i,r={}){const s=new FormData;s.set("file",i,i.name);const a=await pn(`${e}/${encodeURIComponent(n)}/files`,{method:"POST",headers:Yr(),body:s,signal:r.signal},rJe);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 pn(`${e}/${encodeURIComponent(n)}/disconnect`,{method:"POST",headers:Yr(),signal:i.signal},rO);if(!r.ok&&r.status!==404)throw await Es(r,V("sandbox.disconnectCodexFailed"))},async deleteSession(n,i={}){if(!n)return;const r=await pn(`${e}/${encodeURIComponent(n)}`,{method:"DELETE",headers:Yr(),signal:i.signal},rO);if(!r.ok&&r.status!==404)throw await Es(r,V("sandbox.deleteCodexFailed"))}}}const kr=fTe(tJe),M0=fTe("/web/intelligent-development/sessions",{textOnly:!0,messageTimeoutMs:36e5,interruptTimeoutMs:45e3,intelligentDevelopment:!0});async function yY(e,t,n,i){const r=await pn(`${e}/${encodeURIComponent(t)}/${n}`,{method:"POST",headers:Yr(),signal:i.signal},Oh);if(!r.ok)throw await Es(r,V(n==="terminal"?"sandbox.openSandboxTerminalFailed":"sandbox.openSandboxBrowserFailed"));const s=await r.json();return{url:hTe(s.url,V("sandbox.toolLabel")),...typeof s.shellSessionId=="string"?{shellSessionId:s.shellSessionId}:{}}}function hTe(e,t){if(typeof e!="string")throw new Error(V("sandbox.invalidToolUrl",{label:t}));if(e.startsWith("/"))return ta(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()}const zc=e=>["succeeded","cancelled","failed"].includes(e.state),pTe="/web/intelligent-development";class Xx extends Error{constructor(t,n){super(t),this.status=n}}async function tb(e,t="GET",n,i){const r=await pn(`${pTe}${e}`,{method:t,signal:i,headers:Yr(n===void 0?void 0:{"Content-Type":"application/json"}),...n===void 0?{}:{body:JSON.stringify(n)}},3e4);if(!r.ok){const s=await r.json().catch(()=>null),a=s==null?void 0:s.detail;throw new Xx(typeof a=="string"?a:(a==null?void 0:a.message)||V("developmentRuns.requestFailed"),r.status)}return r.json()}function L0(e){const t=e;if(!t||typeof t.runId!="string"||typeof t.sessionId!="string"||!["queued","running","recovering","waiting_user","stopping","succeeded","cancelled","failed"].includes(t.state))throw new Error(V("developmentRuns.invalidResponse"));return t}const bd={async active(e){const t=await tb("/runs","GET",void 0,e);if(!Array.isArray(t.runs))throw new Error(V("developmentRuns.invalidResponse"));return t.runs.map(L0)},async get(e,t){return L0(await tb(`/runs/${encodeURIComponent(e)}`,"GET",void 0,t))},async list(e,t){const n=await tb(`/sessions/${encodeURIComponent(e)}/runs`,"GET",void 0,t);if(!Array.isArray(n.runs))throw new Error(V("developmentRuns.invalidResponse"));return n.runs.map(L0)},async create(e,t,n){return L0(await tb(`/sessions/${encodeURIComponent(e)}/runs`,"POST",{message:t,requestId:n}))},async steer(e,t,n){await tb(`/runs/${encodeURIComponent(e)}/inputs`,"POST",{message:t,clientId:n})},async stop(e){return L0(await tb(`/runs/${encodeURIComponent(e)}/stop`,"POST"))},async resume(e){return L0(await tb(`/runs/${encodeURIComponent(e)}/resume`,"POST"))}};class fJe{constructor(t){Jt(this,"cursor",0);Jt(this,"turns",[]);Jt(this,"activeInput");Jt(this,"itemTurns",new Map);Jt(this,"nativeInputs",new Map);Jt(this,"metrics",new Map);Jt(this,"inputOrder",[]);Jt(this,"projections",new Map);Jt(this,"itemInputs",new Map);this.run=t,this.activeInput=t.requestId}projection(t){let n=this.projections.get(t);if(!n){const i={role:"assistant",blocks:[],meta:{localId:`${t}:assistant`}},r=this.turns.findIndex(s=>{var a;return((a=s.meta)==null?void 0:a.localId)===`${t}:user`});this.turns.splice(r<0?this.turns.length:r+1,0,i),n=dTe({onBlocks:s=>{i.blocks=s.map(a=>({...a,turnId:this.itemTurns.get(a.id||"")}))},onUsage:s=>{i.meta={...i.meta,sandboxUsage:s.usage}}}),this.projections.set(t,n)}return n}apply(t){if(t.payload.runId!==this.run.runId)throw new Error(V("developmentRuns.invalidResponse"));if(t.seq<=this.cursor)return;if(t.seq!==this.cursor+1)throw new Error(V("developmentRuns.eventGap"));for(const i of this.turns)i.blocks.some(r=>r.kind==="turn-summary")&&(i.blocks=i.blocks.filter(r=>r.kind!=="turn-summary"));const n=t.payload;if(t.type==="run.input"&&typeof n.clientId=="string"&&typeof n.message=="string")this.turns.push({role:"user",blocks:[{kind:"text",text:n.message}],meta:{localId:`${n.clientId}:user`},activity:{id:`${n.clientId}:delivery`,title:V(`developmentRuns.input.${String(n.status)}`)}}),this.inputOrder.push(n.clientId),this.projection(n.clientId),n.status==="delivered"&&this.inputOrder.indexOf(n.clientId)>=this.inputOrder.indexOf(this.activeInput)&&(this.activeInput=n.clientId);else if(t.type==="run.input_status"&&typeof n.clientId=="string"){const i=this.turns.find(r=>{var s;return((s=r.meta)==null?void 0:s.localId)===`${n.clientId}:user`});i&&(i.activity={id:`${n.clientId}:delivery`,title:V(`developmentRuns.input.${String(n.status)}`)}),n.status==="delivered"&&this.inputOrder.indexOf(n.clientId)>=this.inputOrder.indexOf(this.activeInput)&&(this.activeInput=n.clientId)}else if(t.type==="run.turn"&&typeof n.turnId=="string"){const r={...this.metrics.get(n.turnId),turnId:n.turnId,status:String(n.status||"inProgress"),toolCalls:0,toolDurationComplete:!1};for(const s of["startedAt","completedAt","durationMs"])typeof n[s]=="number"&&Number.isFinite(n[s])&&n[s]>=0&&(r[s]=n[s]);if(typeof n.model=="string"&&(r.model=n.model),n.usage&&typeof n.usage=="object"&&!Array.isArray(n.usage)){const s={};for(const a of["totalTokens","inputTokens","outputTokens","cachedInputTokens","cacheWriteInputTokens","reasoningOutputTokens"]){const l=n.usage[a];typeof l=="number"&&Number.isSafeInteger(l)&&l>=0&&(s[a]=l)}r.usage=s}n.usageIncomplete===!0&&(r.usageIncomplete=!0),this.metrics.set(n.turnId,r),this.nativeInputs.set(n.turnId,this.activeInput),this.projection(this.activeInput)}else if(t.type==="run.status"){if(this.run={...this.run,...n},zc(this.run))for(const[i,r]of this.metrics)r.status==="inProgress"&&this.metrics.set(i,{...r,status:"unavailable",usageIncomplete:!0});if(zc(this.run)||this.run.state==="waiting_user")for(const i of this.projections.values())i.consumeFrame(`event: done +${n}`}}async function*dZe({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(ia(`/web/runtime-logs/${encodeURIComponent(e)}/stream?${a.toString()}`),{headers:Fl(hu({Accept:"text/event-stream"})),cache:"no-store",signal:s});if(!l.ok)throw new Error(V("runtimeLogs.loadFailedWithDetail",{detail:await uZe(l)}));for await(const c of VI(l)){if(!cZe(c))throw new Error(V("runtimeLogs.invalidFormat"));yield c}}const fZe=255,hZe=/[\p{L}\p{M}\p{N}\p{P}\p{Zs}]/u;function pZe(e){const t=e.normalize("NFKC").replace(/\s+/gu," ").trim(),n=new TextEncoder;let i=0,r="";for(const s of t){if(!hZe.test(s))continue;const a=n.encode(s).byteLength;if(i+a>fZe)break;r+=s,i+=a}return r.replace(/ +/g," ").trimEnd()}const mZe=/RunPipeline result could not be reconciled|Polling build status failed/i;class P_ extends Error{constructor({taskId:n,cause:i}={}){super("The deployment request may still be running, but its status could not be confirmed.");rn(this,"taskId");this.name="DeploymentStatusUnconfirmedError",this.taskId=n}}function DEe(e){if(e instanceof P_)return!0;const t=e instanceof Error?e.message:String(e??"");return mZe.test(t)}function MEe(e){return!!(e&&typeof e=="object"&&"name"in e&&e.name==="AbortError")}async function gZe({load:e,signal:t,timeoutMs:n=30*6e4,intervalMs:i=2e3,shouldRetry:r=()=>!0}){if(t!=null&&t.aborted)throw t.reason??new DOMException("Aborted","AbortError");const s=Date.now()+Math.max(0,n);for(;!(t!=null&&t.aborted)&&Date.now()<=s;){try{const a=await e(t);if(a.done)return a}catch(a){if(t!=null&&t.aborted||MEe(a)||!r(a))throw a}if(t!=null&&t.aborted)throw t.reason??new DOMException("Aborted","AbortError");i<=0||await new Promise((a,l)=>{const c=()=>{globalThis.clearTimeout(u),t==null||t.removeEventListener("abort",c),l((t==null?void 0:t.reason)??new DOMException("Aborted","AbortError"))},u=globalThis.setTimeout(()=>{t==null||t.removeEventListener("abort",c),a()},i);t==null||t.addEventListener("abort",c,{once:!0})})}return null}const Q$="ap-southeast-1",xU="cn-beijing",bZe="https://ark.ap-southeast.bytepluses.com/api/v3",yZe="https://ark.cn-beijing.volces.com/api/v3/",vZe="https://console.byteplus.com/ark/region:ark+ap-southeast-1/openManagement",xZe="https://console.volcengine.com/ark/region:ark+cn-beijing/openManagement",wZe="dola-seed-2-1-turbo-260628",OZe="doubao-seed-2-1-pro-260628",kZe="skylark-embedding-vision-250615",SZe="doubao-embedding-vision-250615",EZe="seed-2-0-lite-260228",CZe="doubao-seed-2-0-lite-260428",TZe="dola-seedream-5-0-pro-260628",AZe="doubao-seedream-5-0-260128",_Ze="seededit-3-0-i2i-250628",jZe="doubao-seededit-3-0-i2i-250628",NZe="dreamina-seedance-2-0-260128",RZe="doubao-seedance-2-0-260128";function nu(e){return e==="byteplus"?[{value:Q$,label:Q$}]:[{value:"cn-beijing",label:V("cloudRegion.cnBeijing")},{value:"cn-shanghai",label:V("cloudRegion.cnShanghai")}]}function Xi(e){var t;return((t=nu(e)[0])==null?void 0:t.value)||xU}const IZe=new Set(["cn-beijing","cn-shanghai","ap-southeast-1"]);function HI(e){return typeof e=="string"&&IZe.has(e)}function $f(e,t){var i;return((i=(t?nu(t):[...nu("volcengine"),...nu("byteplus")]).find(r=>r.value===e))==null?void 0:i.label)||e||"-"}function lp(e){return e==="byteplus"?wZe:OZe}function Ca(e){return e==="byteplus"?bZe:yZe}function PZe(e){return e==="byteplus"?vZe:xZe}function DZe(e){return e==="byteplus"?kZe:SZe}function MZe(e){return e==="byteplus"?EZe:CZe}function LZe(e){return e==="byteplus"?TZe:AZe}function $Ze(e){return e==="byteplus"?_Ze:jZe}function FZe(e){return e==="byteplus"?NZe:RZe}const wU="veadk.messageFeedback.v1";function OU(e,t,n,i){return[e,t,n,i].join(":")}function kU(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(wU)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function BZe(e,t,n){if(typeof window>"u")return;const i=kU();i[e]={...i[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(wU,JSON.stringify(i))}function LEe(e){if(typeof window>"u")return;const t=OU(e.runtimeId,e.appName,e.userId,e.sessionId),n=kU(),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(wU,JSON.stringify(n))}}const D_="",SU=new Map;function $Ee(e,t){SU.set(e,t)}function FEe(){SU.clear()}function mc(e){const t=SU.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 Lt(e,t={},n={},i=Ga){const r=Xa(t.signal,i),s=!!n.runtimeId&&String(t.method??"GET").toUpperCase()==="DELETE",a={...t,...s?{method:"POST"}:{},headers:Fl(hu(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(ia(`${D_}/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(ia(`${D_}/agentkit-proxy${e}`),{...d,headers:f})}return fetch(ia(`${D_}${e}`),d)},c=async d=>{if(d.headers.get("X-Studio-Error-Source")==="upstream")return!1;if(GYe(d))return!0;if(d.status!==401)return!1;try{return await VYe()}catch{return!1}};let u=await l();for(;await c(u);)await XYe(r),u=await l();return u}function gn(e,t={},n=Ga){return Lt(e,t,{},n)}function UZe(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 fn(e,t){const n=e.headers.get("X-Studio-Error-Source"),i=n==="upstream"?e.headers.get("X-Studio-Upstream-Status")??e.status:e.status,r=V("common.fallbackWithHttpStatus",{fallback:t,status:i}),s=await e.text().catch(()=>"");if(n==="upstream")return V("client.errorWithCloudResponse",{context:r,action:e.headers.get("X-Studio-Upstream-Action")??"",response:s||V("client.emptyCloudResponse")});if(!s)return r;try{const a=JSON.parse(s),l=UZe(a.detail??a.error);return n==="transport"||n==="studio"?l?`${r} +${l}`:r:l?V("client.errorWithDetailAndRawResponse",{context:r,detail:l,response:s}):V("client.errorWithRawResponse",{context:r,response:s})}catch{return V("client.errorWithRawResponse",{context:r,response:s})}}async function EU(e,t=!1){const n=await Lt(`/web/model-api-keys${t?"?refresh=true":""}`,{signal:e,cache:"no-store"});if(!n.ok)throw new Error(await fn(n,V("client.loadArkApiKeysFailed")));return await n.json()}async function BEe(e,t){const n=await Lt(`/web/model-api-keys/${encodeURIComponent(e)}/value`,{method:"POST",signal:t,cache:"no-store"});if(!n.ok)throw new Error(await fn(n,V("client.loadArkApiKeysFailed")));return await n.json()}async function Bw(e){const t=new URLSearchParams;e!=null&&e.apiKeyId&&t.set("apiKeyId",e.apiKeyId),e!=null&&e.refresh&&t.set("refresh","true"),e!=null&&e.scope&&t.set("scope",e.scope);const n=t.toString(),i=await Lt(`/web/model-options${n?`?${n}`:""}`,{signal:e==null?void 0:e.signal,cache:"no-store"});if(!i.ok)throw new Error(await fn(i,V("client.loadModelsFailed")));return await i.json()}async function UEe(){const e=await Lt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class Uw extends Error{constructor(){super(V("client.runtimeAccessDenied")),this.name="RuntimeAccessDeniedError"}}class bo extends Error{constructor(t,n=!1,i=!1){super(t),this.unsupported=n,this.retryable=i,this.name="RuntimeProbeError"}}const QEe=()=>V("client.privateRuntimeUnavailable"),zEe=()=>V("client.runtimeTemporarilyUnavailable"),aY=["cn-beijing","cn-shanghai"],QZe=3e4,Qw=5*60*1e3,VEe=60*1e3;let VS="volcengine";const ix=new Map,vb=new Map,xb=new Map,wd=new Map,Vr=new Map;function CU(e,t,n){return`${t}:${e}:${n??""}`}function HEe(e){e!==VS&&Vr.clear(),VS=e}function kC(e){const t=(e||"").trim();if(VS==="byteplus")return[t&&!t.startsWith("cn-")?t:Q$];const n=t&&!t.startsWith("ap-")?t:xU;return aY.includes(n)?[n,...aY.filter(i=>i!==n)]:[n]}function qI(e){const t=(e||"").trim();return t?[t]:kC()}function Wy(...e){return e.map(t=>String(t??"")).join("")}function jg(e,t,n){const i=e.get(t);return i!=null&&i.value&&Date.now()-i.updatedAt<=n?i.value:null}function TU(e,t,n){return e.set(t,{value:n,updatedAt:Date.now()}),n}function EA(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 qEe(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function SC(e,t,n,i,r=Ga){const s=await Lt("/list-apps",{signal:i},n??{base:e,apiKey:t},r),a=n!=null&&n.runtimeId?await qEe(s):"";if(n!=null&&n.runtimeId&&a==="runtime_access_denied")throw new Uw;if(n!=null&&n.runtimeId&&a==="runtime_private_endpoint_unreachable")throw new bo(QEe());if(n!=null&&n.runtimeId&&["runtime_proxy_connect_error","runtime_proxy_timeout","runtime_json_connect_error","runtime_json_timeout"].includes(a))throw new bo(zEe(),!1,!0);if(n!=null&&n.runtimeId&&s.status===404)throw new bo(V("client.runtimeConnectionUnsupported"),!0,!0);if(n!=null&&n.runtimeId&&(s.status===401||s.status===403))throw new bo(V("client.runtimeConnectionDenied"));if(!s.ok)throw new Error(await fn(s,V("client.listAgentsFailed")));let l;try{l=await s.json()}catch{throw new bo(V("client.invalidListAppsJson"))}if(!Array.isArray(l)||l.some(u=>typeof u!="string"||!u.trim()))throw new bo(V("client.invalidListAppsFormat"));const c=l.map(u=>u.trim());return n!=null&&n.runtimeId&&ix.set(CU(n.runtimeId,n.region??"",n.runtimeVersion),{apps:c,expiresAt:Date.now()+QZe}),c}async function WEe(e,t){const{app:n,ep:i}=mc(e),r=await Lt(`/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 fn(r,V("client.createSessionFailed"));throw new Error(l===a?a:V("common.fallbackWithDetail",{fallback:a,detail:l}))}return(await r.json()).id}async function AU(e,t){const{app:n,ep:i}=mc(e),r=await Lt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},i);if(!r.ok)throw new Error(`list sessions failed: ${r.status}`);return r.json()}async function WI(e,t,n){const{app:i,ep:r}=mc(e),s=await Lt(`/apps/${i}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}`,{},r);if(!s.ok){const l=await fn(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=OU(r.runtimeId,i,t,n);a.state={...kU()[l]??{},...a.state??{}}}return a}async function KEe(e){const{app:t,ep:n}=mc(e.appName);if(!n.runtimeId)throw new Error(V("client.feedbackRuntimeOnly"));if(!n.region)throw new Error(V("client.feedbackRegionMissing"));const i=await Lt("/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??""})},{},vr);if(!i.ok)throw new Error(await fn(i,V("client.submitFeedbackFailed")));const r=await i.json(),s=OU(n.runtimeId,t,e.userId,e.sessionId);return BZe(s,e.eventId,r),r}async function KI(e,t={}){const n=Wy(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),i=jg(wd,n,VEe);if(!t.force&&i)return i;const r=wd.get(n);if(!t.force&&(r!=null&&r.promise))return r.promise;let s=null;const a=(async()=>{for(const l of qI(e.region)){const c=new URLSearchParams({runtimeId:e.runtimeId,region:l,appName:e.appName,page_size:String(e.pageSize??100)}),u=await Lt(`/web/evaluation/feedback-cases?${c.toString()}`);if(u.ok)return TU(wd,n,await u.json());s=new Error(await fn(u,V("client.loadEvaluationSetsFailed")))}throw s??new Error(V("client.loadEvaluationSetsFailed"))})();wd.set(n,{...r,promise:a,updatedAt:(r==null?void 0:r.updatedAt)??0});try{return await a}finally{const l=wd.get(n);(l==null?void 0:l.promise)===a&&wd.set(n,{value:l.value,updatedAt:l.updatedAt})}}async function z$(e){let t=null;for(const n of qI(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName,userId:e.userId}),r=await Lt(`/web/evaluation/statuses?${i.toString()}`);if(r.ok)return r.json();t=new Error(await fn(r,V("client.loadAutoEvaluationStatusFailed")))}throw t??new Error(V("client.loadAutoEvaluationStatusFailed"))}async function GEe(e){let t=null;for(const n of qI(e.region)){const i=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName}),r=await Lt(`/web/evaluation/optimizations?${i.toString()}`);if(r.ok)return r.json();t=new Error(await fn(r,V("client.loadOptimizationsFailed")))}throw t??new Error(V("client.loadOptimizationsFailed"))}function XEe(e){return jg(wd,Wy(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),VEe)}function zZe(e){KI(e).catch(()=>{})}function YEe(e){KI(e,{force:!0}).catch(()=>{})}function ZEe(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 M_(e){const t=e.comment??"",n=e.rating==="bad"&&!!t.trim();for(const[i,r]of wd.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;wd.set(i,{value:{...s,sets:ZEe(s.sets,l),items:l},updatedAt:Date.now(),promise:r.promise})}}async function JEe(e){let t=null;for(const n of qI(e.region)){const i=await Lt("/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})},{},vr);if(i.ok){const r=await i.json(),s=new Set(e.itemIds);for(const[a,l]of wd.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));wd.set(a,{value:{...c,sets:ZEe(c.sets,u),items:u},updatedAt:Date.now()})}return r}t=new Error(await fn(i,V("client.deleteEvaluationCaseFailed")))}throw t??new Error(V("client.deleteEvaluationCaseFailed"))}async function V$(e,t,n){const{app:i,ep:r}=mc(e),s=await Lt(`/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 VZe(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 eCe(e,t,n,i,r){const{app:s,ep:a}=mc(e),l=r==null?"":`?version=${encodeURIComponent(r)}`,c=`/apps/${encodeURIComponent(s)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/artifacts/${encodeURIComponent(i)}${l}`,u=await Lt(c,{},a,vr);if(!u.ok)throw new Error(await fn(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=VZe(f.data),m=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength);return{blob:new Blob([m],{type:f.mimeType??f.mime_type??"application/octet-stream"}),downloadName:f.displayName??f.display_name??i}}async function jU(e,t,n,i,r){const{blob:s}=await eCe(e,t,n,i,r);return URL.createObjectURL(s)}async function HZe(e){const t=await Lt("/web/media/capabilities");if(!t.ok)throw new Error(await fn(t,"media capabilities failed"));return t.json()}async function tCe(e,t,n,i){const{app:r}=mc(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 Lt("/web/media",{method:"POST",body:s},{},vr);if(!a.ok)throw new Error(await fn(a,V("client.uploadFileFailed")));return{...await a.json(),status:"ready"}}async function H$(e,t,n){const{app:i}=mc(e),r=`/web/media/${encodeURIComponent(i)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}/delete`,s=await Lt(r,{method:"POST"});if(!s.ok&&s.status!==404)throw new Error(await fn(s,"media cleanup failed"))}function nCe(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 L_(e,t){const n=nCe(t);if(!n)throw new Error("Invalid VeADK media URI");const i=await Lt(`${n}/delete`,{method:"POST"});if(!i.ok&&i.status!==404)throw new Error(await fn(i,"media cleanup failed"))}function iCe(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=nCe(t);if(!n)return t;const i=`${n}/content`;return ia(`${D_}${i}`)}async function SN(e,t,n){const{app:i,ep:r}=mc(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 Lt(`/web/runtime-trace?${c.toString()}`),s.status===404)throw new Error(V("client.traceDisabled"))}else s=await Lt(`/dev/apps/${encodeURIComponent(i)}/debug/trace/session/${encodeURIComponent(t)}`,{},r);if(!s.ok)throw new Error(await fn(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 q$(e){const t=await Lt("/web/issue-feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await fn(t,V("client.submitIssueFeedbackFailed")));if((await t.json()).submitted!==!0)throw new Error(V("client.issueFeedbackNotConfirmed"));return{submitted:!0}}async function rCe(e,t,n=!0){const i=await Lt(`/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 Lt(`/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 W$(e){const{app:t,ep:n}=mc(e);return rCe(t,n,!1)}async function qZe(e,t,n){let i=null;for(const r of kC(t)){const s={runtimeId:e,region:r};try{const a=CU(e,r),l=ix.get(a);l&&l.expiresAt<=Date.now()&&ix.delete(a);const c=ix.get(a),u=n||(c==null?void 0:c.apps[0])||(await SC("","",s))[0];if(!u)throw new Error(V("client.noPreviewableAgent"));return rCe(u,s)}catch(a){if(a instanceof Uw||a instanceof bo&&!a.unsupported)throw a;i=a instanceof Error?a:new Error(String(a))}}throw i??new Error(V("client.noPreviewableAgent"))}async function NU(e,t,n={},i={}){const r=typeof n=="string"?n:void 0,s=typeof n=="string"?i:n,a=Wy(e,t||"cn-beijing",r??""),l=jg(vb,a,Qw);if(!s.force&&l)return l;const c=vb.get(a);if(!s.force&&(c!=null&&c.promise))return c.promise;const u=qZe(e,t,r).then(d=>TU(vb,a,d));vb.set(a,{...c,promise:u,updatedAt:(c==null?void 0:c.updatedAt)??0});try{return await u}finally{const d=vb.get(a);(d==null?void 0:d.promise)===u&&vb.set(a,{value:d.value,updatedAt:d.updatedAt})}}function sCe(e,t,n=""){return jg(vb,Wy(e,t||"cn-beijing",n),Qw)}function oCe(e,t,n=""){NU(e,t,n).catch(()=>{})}async function aCe(e,t,n,i){const{app:r,ep:s}=mc(e),a=new URLSearchParams({source:t,app_name:r,q:n,user_id:i}),l=await Lt(`/web/search?${a.toString()}`,{},s);if(!l.ok)throw new Error(await fn(l,V("client.agentSearchFailed")));return l.json()}async function lCe(e,t){const{app:n}=mc(e),i=await Lt(`/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 cCe(){return cm(V("client.emptySseBody"))}function $_(){return cm(V("client.noDisplayableSseReply"))}const WZe=6e4;function Kx(){return V("client.firstSseEventTimeout")}function uCe(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(Kx())))},WZe);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*K$({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:m}=mc(e),g=r.flatMap(S=>S.status&&S.status!=="ready"?[]:S.uri?[{fileData:{mimeType:S.mimeType,fileUri:S.uri,displayName:S.name},partMetadata:{veadkMedia:{id:S.id,uri:S.uri,name:S.name,mimeType:S.mimeType,sizeBytes:S.sizeBytes}}}]:S.data?[{inlineData:{mimeType:S.mimeType,data:S.data,displayName:S.name}}]:[]),b=s&&(s.skills.length>0||s.targetAgent)?s:void 0,v=[...g,...u.map(S=>({functionResponse:{id:S.id,name:S.name,response:S.response}})),...i.trim()?[{text:i}]:[]];if(b&&v.length>0){const S=v[0],k=S.partMetadata;v[0]={...S,partMetadata:{...k,veadkInvocation:b}}}let y;const w=uCe(d);try{y=await Lt("/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:w.signal},m,0)}catch(S){throw w.cleanup(),w.timedOut()?new Error(Kx()):d!=null&&d.aborted||(S==null?void 0:S.name)==="AbortError"?S:new Error(cm(S))}const x=aZe(y,m.runtimeId??"",m.region??"");if(x&&(f==null||f(x)),!y.ok){w.cleanup();const S=await fn(y,V("client.runSessionFailed"));throw new Error(cm(V("client.runSseFailedWithDetail",{status:y.status,detail:S})))}let O=!1;try{for await(const S of VI(y)){O=!0,w.clearDeadline();const k=S;typeof k.error=="string"&&(k.error=cm(k.error)),typeof k.errorMessage=="string"&&(k.errorMessage=cm(k.errorMessage)),typeof k.error_message=="string"&&(k.error_message=cm(k.error_message)),yield k}}catch(S){throw w.timedOut()?new Error(Kx()):d!=null&&d.aborted||(S==null?void 0:S.name)==="AbortError"?S:new Error(cm(S))}finally{w.cleanup()}if(!O)throw new Error(cCe())}async function GI(e,t){const n=new URLSearchParams({name:e,region:t}),i=await Lt(`/web/runtime-name-availability?${n.toString()}`,{cache:"no-store"});if(!i.ok)throw new Error(await fn(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 dCe(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 Lt(`/web/deployment-resources?${n.toString()}`,{signal:t});if(!i.ok)throw new Error(await fn(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 fCe(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 hCe({runtimeId:e,appName:t,userId:n,sessionId:i,environmentMounts:r}){const{app:s}=mc(t);let a;try{a=await Lt("/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 fn(a,V("client.environmentMountFailed")));return fCe(await a.json(),r)}function RU(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 pCe(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 lY={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 mCe(e){var r;const t=await Lt("/web/system-info",{signal:e});if(!t.ok)throw new Error(await fn(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)=>(lY[s.kind]??Number.MAX_SAFE_INTEGER)-(lY[a.kind]??Number.MAX_SAFE_INTEGER));return{storage:{tosAddress:n.storage.tosAddress},sandboxTools:i}}const gCe=new Set(["preparing","queued","building","scanning","available","failed"]);function IU(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"||!gCe.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 bCe(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||!gCe.has(t.status.phase)||typeof t.status.createdAt!="string"||typeof t.status.updatedAt!="string")throw new Error(V("client.invalidEnvironmentManifest"));return t}function yCe(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 KZe(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 GZe(e){const t=yCe(e);if(!t)return;const n=e;if(typeof n.reference!="string")throw new Error(V("client.invalidImageSource"));return{...t,reference:n.reference}}function PU(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:KZe(t.gitSource),containerRepository:yCe(t.containerRepository),imageSource:GZe(t.imageSource),latestVersion:IU(t.latestVersion)}}function vCe(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 DU(e){const t=await Lt("/web/workspaces",{signal:e});if(!t.ok)throw new Error(await fn(t,V("client.loadWorkspacesFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(V("client.invalidWorkspaceList"));return n.items.map(vCe)}async function xCe(e,t,n,i){const r=await Lt(e,{method:t,headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i});if(!r.ok)throw new Error(await fn(r,V("client.saveWorkspaceFailed")));return vCe(await r.json())}function wCe(e,t){return xCe("/web/workspaces","POST",e,t)}function OCe(e,t,n){return xCe(`/web/workspaces/${encodeURIComponent(e)}`,"PATCH",t,n)}async function kCe(e,t){const n=await Lt(`/web/workspaces/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await fn(n,V("client.deleteWorkspaceFailed")))}async function EC(e){const t=await Lt("/web/v3/environments",{signal:e});if(!t.ok)throw new Error(await fn(t,V("client.loadEnvironmentsFailed")));const n=await t.json();if(!Array.isArray(n.items))throw new Error(V("client.invalidEnvironmentList"));return n.items.map(PU)}async function SCe(e,t){const n=await Lt("/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 fn(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 ECe(e,t){const n=await Lt(`/web/v3/environments/${encodeURIComponent(e)}/share-code`,{method:"POST",signal:t});if(!n.ok)throw new Error(await fn(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 CCe(e,t){const n=await Lt("/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 fn(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 TCe(e,t){const n=await Lt("/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 fn(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:PU(s.environment),error:s.error??""}})}async function ACe(e,t,n,i){let r;try{r=await Lt(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 fn(r,V("client.saveEnvironmentFailed")));return PU(await r.json())}function _Ce(e,t){return ACe("/web/v3/environments","POST",e,t)}function jCe(e,t,n){return ACe(`/web/v3/environments/${encodeURIComponent(e)}`,"PATCH",t,n)}async function NCe(e,t){const n=await Lt(`/web/v3/environments/${encodeURIComponent(e)}`,{method:"DELETE",signal:t});if(!n.ok)throw new Error(await fn(n,V("client.deleteEnvironmentFailed")))}async function G$(e,t){const n=await Lt(`/web/v3/environments/${encodeURIComponent(e)}/build`,{method:"POST",signal:t});if(!n.ok)throw new Error(await fn(n,V("client.startEnvironmentBuildFailed")));const i=IU(await n.json());if(!i)throw new Error(V("client.invalidEnvironmentBuild"));return i}async function RCe(e,t,n={}){const i=n.includeLogs?"?includeLogs=true":"",r=await Lt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}${i}`,{signal:n.signal});if(!r.ok)throw new Error(await fn(r,V("client.loadEnvironmentBuildFailed")));const s=IU(await r.json());if(!s)throw new Error(V("client.invalidEnvironmentBuild"));return s}async function ICe(e,t,n){const i=await Lt(`/web/v3/environments/${encodeURIComponent(e)}/builds/${encodeURIComponent(t)}/manifest`,{signal:n});if(!i.ok)throw new Error(await fn(i,V("client.loadEnvironmentManifestFailed")));return bCe(await i.json())}function cY(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 PCe(e){const t=await Lt("/web/v3/environment-resources",{signal:e});if(!t.ok)throw new Error(await fn(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:cY(n.codePipeline),containerRegistry:cY(n.containerRegistry)}}async function XZe(e,t){const n=await Lt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/model-env`,{method:"POST",signal:t});if(!n.ok)throw new Error(await fn(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 XI(e){const t=await Lt("/web/identity/user-pools",{signal:e});if(!t.ok)throw new Error(await fn(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})}class uY extends Error{constructor(t,n){super(n),this.status=t,this.name="DeploymentRecoveryHttpError"}}const Qk=new Map;function YZe(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 zk extends Error{constructor(t){super(t.message),this.detail=t,this.name="GithubCicdPipelineError"}}async function kp(e){const t=await e.text().catch(()=>"");if(t)try{const n=JSON.parse(t),i=YZe(n.detail??n.error);if(i)return new zk(i)}catch{return new zk({message:t})}return new zk({message:V("client.syncGithubFailed",{status:e.status})})}async function DCe(e){const t=await Lt("/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 kp(t);return t.json()}async function MCe(e){const t=await Lt("/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 kp(t);return t.json()}async function LCe(e){const t=await Lt("/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 kp(t);return t.json()}async function ZZe(e){const t=await Lt("/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 kp(t);return t.json()}async function $Ce(e){const t=await Lt(`/web/github-cicd/runtime-binding?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await kp(t);const n=await t.json();return n.pipelineId?n:null}async function F_(e){const t=await Lt(`/web/github-delivery/versions?runtimeId=${encodeURIComponent(e)}`);if(!t.ok)throw await kp(t);return t.json()}async function FCe(e){const t=await Lt("/web/github-delivery/rollback-pr",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await kp(t);return t.json()}async function MU(e){const t=await Lt("/web/github-cicd/runtime-binding",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await kp(t);return t.json()}async function BCe(e){const t=await Lt("/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 kp(t);return t.json()}async function Ky(e,t,n,i){var h,m,g,b,v;const r=i==null?void 0:i.taskId,s=r?new AbortController:void 0;r&&s&&Qk.set(r,s);const a=()=>{r&&Qk.get(r)===s&&Qk.delete(r)},l=async y=>{if(MEe(y))throw y;if(!r||!(i!=null&&i.runtimeId)||typeof i.baseRuntimeVersion!="number")throw new P_({taskId:r,cause:y});const w=await gZe({signal:s==null?void 0:s.signal,shouldRetry:x=>!(x instanceof uY)||x.status===404||x.status===408||x.status===429||x.status>=500,load:async x=>{const O=await Lt("/web/deploy-agentkit/status",{method:"POST",headers:{"Content-Type":"application/json"},signal:x,body:JSON.stringify({taskId:r,runtimeId:i.runtimeId,runtimeName:i.runtimeName,appName:i.appName??e,region:n.region,projectName:n.projectName,baseRuntimeVersion:i.baseRuntimeVersion})},{},3e4);if(!O.ok)throw new uY(O.status,await fn(O,V("client.deploymentFailed")));return O.json()}});if(!w)throw new P_({taskId:r,cause:y});return w};let c=null,u=null;try{const y=!!(i!=null&&i.migrationTaskId);(h=i==null?void 0:i.onStage)==null||h.call(i,{level:"info",phase:"upload",message:V(y?"client.validatingMigrationArtifact":"client.uploadingCodePackage"),pct:0}),c=await Lt("/web/deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},signal:s==null?void 0:s.signal,body:JSON.stringify({name:e,files:y?[]: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:pZe((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),(m=i==null?void 0:i.onStage)==null||m.call(i,{level:"success",phase:"upload",message:V(y?"client.migrationArtifactValidated":"client.codePackageUploaded"),pct:100})}catch(y){try{u=await l(y)}finally{a()}}if(c&&!c.ok){const y=await fn(c,V("client.deploymentFailed"));throw a(),new Error(y)}if(c)try{for await(const y of VI(c)){const w=y;if(w&&w.done){u=w;break}w&&w.message&&((g=i==null?void 0:i.onStage)==null||g.call(i,w))}}catch(y){try{u=await l(y)}finally{a()}}if(u)a();else try{u=await l()}finally{a()}if(!u.success){const y=new Error(u.error||V("client.deploymentFailed"));throw DEe(y)?new P_({taskId:r,cause:y}):y}if(!u.agentName)throw new Error(V("client.deploymentMissingAgentName"));if(!u.runtimeId&&!u.url)throw new Error(V("client.deploymentMissingConnection"));const d=(b=u.runtimeName)!=null&&b.trim()?u.agentName:e,f=((v=u.runtimeName)==null?void 0:v.trim())||u.agentName;return{apikey:u.apikey??"",url:u.url??"",agentName:d,runtimeName:f,runtimeId:u.runtimeId,consoleUrl:u.consoleUrl,region:u.region,version:u.version,warnings:u.warnings,feishuChannel:u.feishuChannel}}async function UCe(e){var n;const t=await Lt("/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=Qk.get(e))==null||n.abort(),Qk.delete(e)}async function JZe(e=xU){const t=await Lt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(V("client.loadFailed",{status:t.status}));return(await t.json()).runtimes??[]}const HS={title:"AgentKit Studio",logoUrl:""},X$={enabled:!1},Q5={studio:!1,version:"",provider:"volcengine",branding:HS,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,agentUsage:!1,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local",telemetry:X$};function eJe(e){if(!e||typeof e!="object")return X$;const t=e;if(t.enabled!==!0||!t.studio||typeof t.studio!="object")return X$;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 QCe(){var e,t;try{const n=await Lt("/web/ui-config");if(!n.ok)return Q5;const i=await n.json(),r=typeof((e=i.branding)==null?void 0:e.logoUrl)=="string"?i.branding.logoUrl:HS.logoUrl,s=i.provider==="byteplus"?"byteplus":"volcengine";return HEe(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:HS.title,logoUrl:r?ia(r):""},features:{...Q5.features,...i.features??{}},defaultView:i.defaultView??"chat",agentsSource:i.agentsSource==="cloud"?"cloud":"local",telemetry:eJe(i.telemetry)}}catch{return Q5}}const zCe={role:"user",telemetry:{userId:"",accountId:""},capabilities:{createAgents:!1,createPersonalAgents:!1,manageAgents:!1,runtimeScope:"mine",manageUsers:!1}};async function VCe(){var n,i,r,s,a,l;const e=await Lt("/web/access");if(!e.ok)throw new Error(V("client.loadPermissionsFailed",{status:e.status}));const t=await e.json();if(!["super_admin","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"||((a=t.capabilities)==null?void 0:a.manageUsers)!==void 0&&typeof t.capabilities.manageUsers!="boolean"||!["all","mine"].includes((l=t.capabilities)==null?void 0:l.runtimeScope))throw new Error(V("client.invalidPermissionResponse"));return t}async function HCe(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 Lt(`/web/studio-update${i}`);if(!r.ok)throw new Error(V("client.checkStudioUpdateFailed",{status:r.status}));return await r.json()}async function qCe(){const e=await Lt("/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 WCe(e){const t=await Lt("/web/studio-update",{method:"POST",headers:{"Content-Type":"application/json","X-VeADK-Studio-Update":"1"},body:JSON.stringify({version:e})},{},vr);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 KCe({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 Lt(`/web/agent-usage?${a.toString()}`,{signal:s});if(!l.ok)throw new Error(await fn(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 Sp(e=""){return`/web/cronjobs${e?`/${encodeURIComponent(e)}`:""}`}async function Y$(e){const t=await Lt(Sp(),{signal:e});if(!t.ok)throw new Error(await fn(t,V("client.loadCronJobsFailed")));const n=await t.json();return Array.isArray(n)?n:n.items??[]}async function tJe(e,t){const n=await Lt(Sp(e),{signal:t});if(!n.ok)throw new Error(await fn(n,V("client.loadCronJobFailed")));return await n.json()}async function GCe(e){const t=await Lt(Sp(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await fn(t,V("client.createCronJobFailed")));return await t.json()}async function XCe(e,t){const n=await Lt(`${Sp(e)}/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(await fn(n,V("client.updateCronJobFailed")));return await n.json()}async function YCe(e,t){const n=t?"enable":"disable",i=await Lt(`${Sp(e)}/${n}`,{method:"POST"});if(!i.ok)throw new Error(await fn(i,V(t?"client.enableCronJobFailed":"client.pauseCronJobFailed")));return await i.json()}async function ZCe(e){const t=await Lt(`${Sp(e)}/run`,{method:"POST"});if(!t.ok)throw new Error(await fn(t,V("client.runCronJobFailed")));return await t.json()}async function Z$(e,t){const n=await Lt(`${Sp(e)}/runs`,{signal:t});if(!n.ok)throw new Error(await fn(n,V("client.loadCronHistoryFailed")));const i=await n.json();return Array.isArray(i)?i:i.items??[]}async function JCe(e,t){const n=await Lt(`${Sp(e)}/runs/${encodeURIComponent(t)}/cancel`,{method:"POST"});if(!n.ok)throw new Error(await fn(n,V("client.stopCronRunFailed")));return await n.json()}async function eTe(e){const t=await Lt(Sp(e),{method:"DELETE"});if(!t.ok)throw new Error(await fn(t,V("client.deleteCronJobFailed")))}class LU extends Error{constructor(t,n){super(t),this.status=n,this.name="RuntimeListError"}}async function zw(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 Lt(`/web/runtimes?${t.toString()}`,{signal:e.signal});if(!n.ok){const r=await fn(n,V("client.loadRuntimeFailed"));throw new LU(r,n.status)}const i=await n.json();return{runtimes:i.runtimes??[],nextToken:i.nextToken??""}}async function Gx(e,t,n={}){if(n.preferCached){const i=CU(e,t,n.currentVersion),r=ix.get(i);if(r&&r.expiresAt>Date.now())return[...r.apps];r&&ix.delete(i)}try{const i={runtimeId:e,region:t,runtimeVersion:n.currentVersion};return n.retryProbe&&(i.retryProbe=!0),await SC("","",i,n.signal,n.timeoutMs)}catch(i){if(i instanceof Uw||i instanceof bo||i instanceof Error)throw i;return null}}async function tTe(e,t){const n=new URLSearchParams({region:t}),i=await Lt(`/web/runtime-tool-channel/${encodeURIComponent(e)}/capabilities?${n.toString()}`);if(!i.ok)throw new bo(await fn(i,V("client.loadLocalToolsFailed")),!1,!0);return await i.json()}async function nTe(e,t){const n=new URLSearchParams({region:t}),i=await Lt(`/web/runtime-route-channel/${encodeURIComponent(e)}/connect?${n.toString()}`,{method:"POST"});if(!i.ok)throw new bo(await fn(i,V("client.connectDynamicRouteFailed")),!1,!0);return await i.json()}async function iTe(e,t,n={}){const i={runtimeId:e,region:t};n.retryProbe&&(i.retryProbe=!0);const r=await Lt("/.well-known/agent-card.json",{},i),s=await qEe(r);if(s==="runtime_access_denied")throw new Uw;if(s==="runtime_private_endpoint_unreachable")throw new bo(QEe());if(["runtime_proxy_connect_error","runtime_proxy_timeout"].includes(s))throw new bo(zEe());if(r.status===404)return null;if(r.status===401||r.status===403)throw new bo(V("client.a2aProbeDenied"));if(!r.ok)throw new Error(await fn(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 rTe(e,t){const n=new URLSearchParams({runtimeId:e,region:t}),i=await Lt(`/web/runtime-api-key/reveal?${n.toString()}`,{method:"POST",cache:"no-store"});if(!i.ok)throw new Error(await fn(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 sTe(e,t){const n=await Lt("/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}))}}async function oTe({runtimeId:e,region:t,appName:n,etag:i,signal:r}){const s=await Lt("/web/runtime-mcp-credentials",{method:"POST",cache:"no-store",signal:r,headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t,appName:n,etag:i})});if(!s.ok)throw new Error(await fn(s,V("client.loadMcpCredentialsFailed")));const a=await s.json().catch(()=>null);if(!Array.isArray(a==null?void 0:a.credentials))throw new Error(V("client.invalidMcpCredentials"));return a.credentials.map(l=>{if(!l||typeof l!="object")throw new Error(V("client.invalidMcpCredentials"));const c=l,u={agentName:c.agentName,name:c.name,url:c.url,authTokenEnv:c.authTokenEnv,value:c.value};if(Object.values(u).some(d=>typeof d!="string"))throw new Error(V("client.invalidMcpCredentials"));return u})}function B_({runtimeId:e,region:t,appName:n,currentVersion:i}){return Wy(VS,t,e,i??"",(n==null?void 0:n.trim())??"")}async function nJe({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 Lt(`/web/runtime-update-capability?${s.toString()}`);if(!a.ok)throw new Error(await iJe(a));return await a.json()}function YI({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=B_(a);if(s&&Vr.delete(l),!s){const f=jg(Vr,l,Qw);if(f)return EA(Promise.resolve(f),r);const h=(u=Vr.get(l))==null?void 0:u.promise;if(h)return EA(h,r);if(n){const m=B_({...a,appName:""}),g=(d=Vr.get(m))==null?void 0:d.promise;if(g){let b;return b=g.then(v=>{var w,x,O,S,k;if(v.recoveryStatus==="preparing")return((w=Vr.get(l))==null?void 0:w.promise)===b&&Vr.delete(l),v;const y=((O=(x=v.agent)==null?void 0:x.appName)==null?void 0:O.trim())??"";return y&&y!==n.trim()?(((S=Vr.get(l))==null?void 0:S.promise)===b&&Vr.delete(l),YI(a)):(((k=Vr.get(l))==null?void 0:k.promise)===b&&Vr.set(l,{value:v,updatedAt:Date.now()}),v)},v=>{var y;throw((y=Vr.get(l))==null?void 0:y.promise)===b&&Vr.delete(l),v}),Vr.set(l,{promise:b,updatedAt:0}),EA(b,r)}}}let c;return c=nJe({...a,force:s}).then(f=>{var h,m,g,b,v;if(f.recoveryStatus==="preparing")return((h=Vr.get(l))==null?void 0:h.promise)===c&&Vr.delete(l),f;if(((m=Vr.get(l))==null?void 0:m.promise)===c){Vr.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 w of y){const x=B_({...a,appName:w});x!==l&&!((v=Vr.get(x))!=null&&v.promise)&&Vr.set(x,{value:f,updatedAt:Date.now()})}}return f},f=>{var h;throw((h=Vr.get(l))==null?void 0:h.promise)===c&&Vr.delete(l),f}),Vr.set(l,{promise:c,updatedAt:0}),EA(c,r)}function J$({runtimeId:e,region:t,appName:n,currentVersion:i}){return jg(Vr,B_({runtimeId:e,region:t,appName:n,currentVersion:i}),Qw)}function eF(e){return YI(e).then(()=>{},()=>{})}function tF(e,t){if(!e){Vr.clear();return}for(const n of Vr.keys()){const[i,r,s]=n.split("");i===VS&&s===e&&(!t||r===t)&&Vr.delete(n)}}async function iJe(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 rJe(e,t){let n=null;for(const i of kC(t)){const r=await Lt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(i)}`);if(r.ok)return r.json();n=new Error(await fn(r,V("client.loadRuntimeDetailFailed")))}throw n??new Error(V("client.loadRuntimeDetailFailed"))}async function $U(e,t="cn-beijing",n={}){const i=Wy(e,t||"cn-beijing"),r=jg(xb,i,Qw);if(!n.force&&r)return r;const s=xb.get(i);if(!n.force&&(s!=null&&s.promise))return s.promise;const a=rJe(e,t).then(l=>TU(xb,i,l));xb.set(i,{...s,promise:a,updatedAt:(s==null?void 0:s.updatedAt)??0});try{return await a}finally{const l=xb.get(i);(l==null?void 0:l.promise)===a&&xb.set(i,{value:l.value,updatedAt:l.updatedAt})}}function aTe(e,t="cn-beijing"){return jg(xb,Wy(e,t||"cn-beijing"),Qw)}function lTe(e,t="cn-beijing"){$U(e,t).catch(()=>{})}async function Vk(e){const t=await Lt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await fn(t,V("client.generateProjectFailed")));return t.json()}const sJe=19e4,oJe=12e4;async function cTe(e){const t=await Lt("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},sJe);if(!t.ok)throw new Error(await fn(t,V("client.generateAgentConfigFailed")));return zI(t,V("client.generateAgentConfigFailed"))}async function uTe(e,t){const n=await Lt("/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,mcpCredentialReuses:t==null?void 0:t.mcpCredentialReuses})},{},oJe);if(!n.ok)throw new Error(await fn(n,V("client.createDebugRunFailed")));return zI(n,V("client.createDebugRunFailed"))}async function dTe(e,t){const n=await Lt(`/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 fn(n,V("client.createDebugSessionFailed")));return(await zI(n,V("client.createDebugSessionFailed"))).id}async function fTe(e,t){const n=await Lt(`/web/generated-agent-test-runs/${encodeURIComponent(e)}/trace/session/${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await fn(n,V("client.loadDebugTraceFailed")));const i=await zI(n,V("client.loadDebugTraceFailed"));if(!Array.isArray(i))throw new Error(V("client.invalidDebugTrace"));return i}async function*hTe({runId:e,userId:t,sessionId:n,text:i,signal:r}){const s=i.trim()?[{text:i}]:[],a=uCe(r);let l;try{l=await Lt(`/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(Kx()):c}if(!l.ok)throw a.cleanup(),new Error(await fn(l,V("client.debugRunFailed")));try{for await(const c of VI(l))a.clearDeadline(),yield c}catch(c){throw a.timedOut()?new Error(Kx()):c}finally{a.cleanup()}}async function av(e){const t=await Lt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await fn(t,V("client.cleanupDebugRunFailed")))}function pTe(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 mTe(e){const t=await Lt("/web/system-info/sandbox-tools/updates",{signal:e});if(!t.ok)throw new Error(await fn(t,V("client.loadSandboxVersionsFailed")));const n=await t.json();if(!Array.isArray(n.tools))throw new Error(V("client.invalidSandboxVersion"));return n.tools.map(pTe)}async function gTe(e){const t=await Lt(`/web/system-info/sandbox-tools/${encodeURIComponent(e)}/update`,{method:"POST"},{},33e4);if(!t.ok)throw new Error(await fn(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:pTe(n.state)}}const aJe=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_SITE_BRANDING:HS,DEFAULT_STUDIO_ACCESS:zCe,GithubCicdPipelineError:zk,RuntimeAccessDeniedError:Uw,RuntimeListError:LU,RuntimeProbeError:bo,attachGithubDeliveryCicdToSourceSync:ZZe,bindGithubCicdRuntime:MU,buildEnvironment:G$,cancelAgentkitDeployment:UCe,cancelCronJobRun:JCe,checkRuntimeNameAvailability:GI,clearMessageFeedbackCache:LEe,clearRemoteApps:FEe,componentSearch:aCe,createCronJob:GCe,createEnvironment:_Ce,createGeneratedAgentTestRun:uTe,createGeneratedAgentTestSession:dTe,createGithubCicdPipeline:DCe,createGithubDeliveryCicdPipeline:MCe,createGithubDeliveryRollbackPr:FCe,createSession:WEe,createWorkspace:wCe,deleteAgentFeedbackCases:JEe,deleteCronJob:eTe,deleteEnvironment:NCe,deleteGeneratedAgentTestRun:av,deleteMedia:L_,deleteRuntime:sTe,deleteSession:V$,deleteSessionMedia:H$,deleteWorkspace:kCe,deployAgentkitProject:Ky,downloadArtifact:_U,ensureRuntimeRouteChannel:nTe,exportEnvironmentShareCode:ECe,fetchRemoteApps:SC,generateAgentDraftFromRequirement:cTe,generateAgentProject:Vk,getAgentFeedbackCases:KI,getAgentInfo:W$,getAgentOptimizations:GEe,getAgentUsage:KCe,getAutomaticEvaluationStatuses:z$,getCachedAgentFeedbackCases:XEe,getCachedRuntimeAgentInfo:sCe,getCachedRuntimeDetail:aTe,getCachedRuntimeUpdateCapability:J$,getCronJob:tJe,getEnvironmentBuild:RCe,getEnvironmentManifest:ICe,getEnvironmentResources:PCe,getGeneratedAgentTestTrace:fTe,getGithubCicdRuntimeBinding:$Ce,getGithubDeliveryVersions:F_,getMediaCapabilities:HZe,getMyRuntimes:JZe,getRuntimeAgentInfo:NU,getRuntimeDetail:$U,getRuntimeMcpCredentials:oTe,getRuntimeStudioToolCapabilities:tTe,getRuntimeUpdateCapability:YI,getRuntimes:zw,getSandboxImageUpdates:mTe,getSession:WI,getSessionTrace:SN,getStudioAccess:VCe,getStudioUpdatePermissions:qCe,getStudioUpdateStatus:HCe,getSystemInfo:mCe,getUiConfig:QCe,httpErrorMessage:fn,importEnvironmentShareCodes:TCe,initializeGithubDeliveryMain:LCe,inspectEnvironmentRepository:SCe,inspectEnvironmentShareCodes:CCe,invalidateRuntimeUpdateCapabilityCache:tF,listApps:UEe,listCronJobRuns:Z$,listCronJobs:Y$,listDeploymentResources:dCe,listEnvironments:EC,listIdentityUserPools:XI,listModelApiKeys:EU,listModelOptions:Bw,listSessions:AU,listWorkspaces:DU,mediaContentUrl:iCe,parseEnvironmentManifest:bCe,parseEnvironmentShareCodes:RU,parsePreparedSessionEnvironmentMounts:fCe,prefetchAgentFeedbackCases:zZe,prefetchRuntimeAgentInfo:oCe,prefetchRuntimeDetail:lTe,prefetchRuntimeUpdateCapability:eF,prepareSessionEnvironmentMounts:hCe,previewArtifact:jU,probeRuntimeA2a:iTe,probeRuntimeApps:Gx,refreshAgentFeedbackCases:YEe,registerRemoteApp:$Ee,revealModelApiKey:BEe,revealRuntimeApiKey:rTe,runCronJobNow:ZCe,runGeneratedAgentTestSSE:hTe,runSSE:K$,runSseEmptyResponseError:cCe,runSseFirstEventTimeoutError:Kx,runSseIncompleteResponseError:$_,runtimeRegionCandidates:kC,setClientCloudProvider:HEe,setCronJobEnabled:YCe,startStudioUpdate:WCe,studioFetch:gn,submitIssueFeedback:q$,submitMessageFeedback:KEe,syncGithubCicdRuntime:BCe,updateCodexSandboxToolModelEnv:XZe,updateCronJob:XCe,updateEnvironment:jCe,updateSandboxTool:gTe,updateWorkspace:OCe,uploadMedia:tCe,upsertCachedAgentFeedbackCase:M_,webSearch:lCe,writeEnvironmentShareCode:pCe},Symbol.toStringTag,{value:"Module"})),lJe="/web/sandbox/sessions",dY="/web/sandbox/codex-project-handoff",fY=3e4,z5=33e4,cJe=6e4,uJe=6e5,rO=15e3,Oh=6e4,dJe=33e4,hY=3e4,fJe=60*60,nF=40;function ZI(e){const t=e.trim().toLowerCase();return["ready","running","wakeable"].includes(t)?"ready":t}function FU(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 Xr(e){const t=Fl(e);return t.has("Accept")||t.set("Accept","application/json"),t}class BU extends Error{constructor(n,i={}){var r;super(n);rn(this,"code");rn(this,"retryable");rn(this,"publicMessage");rn(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 hJe(e){return e instanceof BU?e.publicMessage:e instanceof Error&&e.name==="TimeoutError"?V("sandbox.developmentTimeout"):e instanceof TypeError?V("sandbox.developmentDisconnected"):V("sandbox.developmentFailed")}async function _s(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 BU(u,{code:typeof s.code=="string"?s.code:"",retryable:s.retryable===!0,publicMessage:l||c,httpStatus:e.status})}async function pY(e,t){const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{throw new Error(V("sandbox.invalidStudioResponse",{fallback:t}))}}function tb(e,t="codex",n=e.toolName==="intelligent-development"){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:n,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:JI(e.permissions),...e.conversation===void 0?{}:{restoredConversation:wb(e.conversation)}}}function mY(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 gY(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 sO={approvalPolicy:"on-request",approvalsReviewer:"user",sandboxMode:"workspace-write",networkAccess:!1};function JI(e){if(!e||typeof e!="object")return{...sO};const t=e,n=t.approvalPolicy,i=t.approvalsReviewer,r=t.sandboxMode;return{approvalPolicy:n==="untrusted"||n==="on-request"||n==="never"?n:sO.approvalPolicy,approvalsReviewer:i==="user"||i==="auto_review"?i:sO.approvalsReviewer,sandboxMode:r==="read-only"||r==="workspace-write"||r==="danger-full-access"?r:sO.sandboxMode,networkAccess:typeof t.networkAccess=="boolean"?t.networkAccess:sO.networkAccess}}function bY(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:JI(t.permissions)}}function mo(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function pJe(e){const t=mo(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 mJe(e){const t=mo(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 bTe(e){const t=mo(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 wb(e){const t=mo(e),n=bTe(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=mo(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=mo(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:JI(t.permissions)}}function iF(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 gJe(e){const t=iF(e.usage);if(!t||typeof e.turnId!="string")return;const n=iF(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 bJe(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}:{}}}function yTe(e={}){let t="";const n=[],i=new Map,r=new Map;let s,a;function l(){var h;const f=s?[...n,s]:n;(h=e.onBlocks)==null||h.call(e,[...f])}function c(f){t+=f;const h=n[n.length-1],m=n.length-1,g=[...i.values()].includes(m);(h==null?void 0:h.kind)==="text"&&!g?n[m]={...h,text:h.text+f}:n.push({kind:"text",text:f}),l()}function u(f){if(typeof f.id!="string"||f.kind!=="thinking"&&f.kind!=="commentary"&&f.kind!=="tool"||f.status!=="running"&&f.status!=="done"&&f.status!=="error")return;const h=f.status!=="running";let m;if(f.kind==="thinking")m={kind:"thinking",text:typeof f.text=="string"?f.text:"",done:h};else if(f.kind==="commentary"){if(typeof f.text!="string"||!f.text)return;m={kind:"text",text:f.text}}else{if(typeof f.name!="string"||!f.name)return;m={kind:"tool",name:f.name,args:f.args,response:f.response,status:f.status==="error"?"failed":h?"completed":"running",done:h}}m={...m,id:f.id,...typeof f.itemType=="string"?{itemType:f.itemType}:{},...typeof f.phase=="string"?{phase:f.phase}:{},...typeof f.durationMs=="number"?{durationMs:f.durationMs}:{}};const g=i.get(f.id);g===void 0?(i.set(f.id,n.length),n.push(m)):n[g]=m,l()}function d(f){var b,v,y,w;let h="message";const m=[];for(const x of f.split(/\r?\n/))x.startsWith("event:")&&(h=x.slice(6).trim()),x.startsWith("data:")&&m.push(x.slice(5).trimStart());if(m.length===0)return;let g;try{g=JSON.parse(m.join(` +`))}catch{throw new Error(V("sandbox.invalidConversationResponse"))}if(h==="error"){const x=typeof g.message=="string"&&g.message?g.message:V("sandbox.conversationFailed");throw new BU(x,{code:typeof g.code=="string"?g.code:"",retryable:g.retryable===!0,publicMessage:x})}if(h==="progress"&&typeof g.text=="string"&&(s=g.text?{kind:"progress",text:g.text}:void 0,l()),["activity","delta","tool_output","tool_progress","plan","diff"].includes(h)&&(s=void 0),h==="activity"&&u(g),(h==="tool_output"||h==="tool_progress")&&typeof g.id=="string"){const x=i.get(g.id),O=x===void 0?void 0:n[x];if((O==null?void 0:O.kind)==="tool"&&x!==void 0&&typeof g.text=="string"){const S=mo(O.response)||{};n[x]=h==="tool_progress"?{...O,progressText:g.text}:{...O,response:{...S,output:(g.snapshot?"":String(S.output||""))+g.text}},l()}}if((h==="plan"||h==="diff")&&typeof g.id=="string"){const x=typeof g.text=="string"?g.text:"",O=Array.isArray(g.items)?g.items:Array.isArray(g.plan)?g.plan:[],S=h==="diff"?{kind:"diff",id:g.id,text:x,done:g.status==="done"}:{kind:"plan",id:g.id,title:V("developmentRuns.plan"),summary:x,done:g.status==="done",items:O.flatMap(C=>{const E=mo(C);if(!E||typeof(E.text??E.step)!="string")return[];const R=E.status==="inProgress"?"in_progress":E.status;return[{text:String(E.text??E.step),status:R==="completed"||R==="failed"||R==="in_progress"?R:"pending"}]})},k=i.get(g.id);k===void 0?(i.set(g.id,n.length),n.push(S)):n[k]=S,l()}if(h==="development.source_ready"||h==="development.succeeded"){const x=mo(g.payload),O=mo(x==null?void 0:x.delivery),S=h==="development.succeeded";if(O&&typeof O.sessionId=="string"&&typeof O.artifactSha256=="string"&&typeof O.validationReportSha256=="string"&&typeof O.agentName=="string"&&typeof O.entryPoint=="string"&&typeof O.fileCount=="number"&&typeof O.artifactSize=="number"&&typeof O.validatedAt=="string"&&O.deployable===!0&&O.verified===S&&typeof O.validationSummary=="string"&&Array.isArray(O.gateSummary)&&O.gateSummary.every(k=>typeof k=="string")){const k={kind:"delivery",value:{sessionId:O.sessionId,...typeof O.projectId=="string"&&typeof O.versionId=="string"?{projectId:O.projectId,versionId:O.versionId,...O.parentVersionId===null||typeof O.parentVersionId=="string"?{parentVersionId:O.parentVersionId}:{}}:{},artifactSha256:O.artifactSha256,validationReportSha256:O.validationReportSha256,agentName:O.agentName,entryPoint:O.entryPoint,fileCount:O.fileCount,artifactSize:O.artifactSize,validatedAt:O.validatedAt,gateSummary:O.gateSummary,deployable:O.deployable,verified:O.verified,validationSummary:O.validationSummary}},C=n.findIndex(E=>E.kind==="delivery"&&E.value.sessionId===O.sessionId&&E.value.artifactSha256===O.artifactSha256&&E.value.validationReportSha256===O.validationReportSha256);C===-1?n.push(k):n[C]=k,l()}}if(h==="approval"){const x=bJe(g);x&&((b=e.onApproval)==null||b.call(e,x))}if(h==="usage"){const x=gJe(g);x&&(a=x,(v=e.onUsage)==null||v.call(e,x))}if(h==="approval_resolved"&&typeof g.approvalId=="string"&&((y=e.onApprovalResolved)==null||y.call(e,g.approvalId)),h==="delta"&&typeof g.text=="string")if(typeof g.id=="string"&&g.id){const x=r.get(g.id),O=x===void 0?void 0:n[x],S=((w=mo(g))==null?void 0:w.snapshot)===!0;(O==null?void 0:O.kind)==="text"?n[x]={...O,phase:typeof g.phase=="string"&&g.phase?g.phase:O.phase,text:S?O.text.startsWith(g.text)?O.text:g.text:O.text+g.text}:(r.set(g.id,n.length),n.push({kind:"text",text:g.text,id:g.id,itemType:typeof g.itemType=="string"?g.itemType:void 0,phase:typeof g.phase=="string"?g.phase:void 0})),t=n.filter(k=>k.kind==="text").map(k=>k.text).join(""),l()}else c(g.text);if(h==="done"&&!t&&typeof g.text=="string"&&c(g.text),h==="done"){for(let x=0;x({text:t,blocks:n.map(f=>({...f})),...a?{usage:a}:{}})}}async function yJe(e,t={}){if(!e.body)throw new Error(V("sandbox.emptyConversationResponse"));const n=e.body.getReader(),i=new TextDecoder;let r="";const s=yTe(t);for(;;){const{done:l,value:c}=await n.read();r+=i.decode(c,{stream:!l});const u=r.split(/\r?\n\r?\n/);if(r=u.pop()??"",u.forEach(s.consumeFrame),l)break}r.trim()&&s.consumeFrame(r),s.consumeFrame(`event: done +data: {}`);const a=s.result();if(a.blocks.length===0)throw new Error(V("sandbox.emptyReply"));return a}async function Ac(e,t,n,{method:i="GET",body:r,options:s={},fallback:a}){if(!t)throw new Error(V("sandbox.missingSession"));const l=await gn(`${e}/${encodeURIComponent(t)}/${n}`,{method:i,headers:Xr(r===void 0?void 0:{"Content-Type":"application/json"}),...r===void 0?{}:{body:JSON.stringify(r)},signal:s.signal},Oh);if(!l.ok)throw await _s(l,a);return l.json()}function vTe(e,t={}){return{async listSessions(n={}){const i=await gn(gY(e,n),{method:"GET",headers:Xr(),signal:n.signal},fY);if(!i.ok)throw await _s(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=>tb(s,"codex",t.intelligentDevelopment)),...(r.snapshots??[]).map(s=>mY(s))]},async startSession(n={}){var s,a;const i=((s=n.displayName)==null?void 0:s.trim())??"",r=await gn(e,{method:"POST",headers:Xr({"Content-Type":"application/json"}),body:JSON.stringify({displayName:t.textOnly&&n.projectId?Array.from(i).slice(0,nF).join(""):i,...(a=n.modelId)!=null&&a.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},z5);if(!r.ok)throw await _s(r,V("sandbox.startFailed"));return tb(await r.json(),"codex",t.intelligentDevelopment)},async listAgentSessions(n,i={}){const r=await gn(gY(`/web/${n}/sessions`,i),{method:"GET",headers:Xr(),signal:i.signal},fY);if(!r.ok)throw await _s(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=>tb(a,n)),...(s.snapshots??[]).map(a=>mY(a,n))]},async startAgentSession(n,i={}){var s;const r=await gn(`/web/${n}/sessions`,{method:"POST",headers:Xr({"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},z5);if(!r.ok)throw await _s(r,V("sandbox.createAgentFailed",{kind:n}));return tb(await r.json(),n)},async openAgentSession(n,i,r={}){if(!i)throw new Error(V("sandbox.missingSessionToOpen"));const s=await gn(`/web/${n}/sessions/${encodeURIComponent(i)}/open`,{method:"POST",headers:Xr(),signal:r.signal},Oh);if(!s.ok)throw await _s(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:tb(a,n),kind:n,webuiUrl:ia(a.webuiUrl)}},async launchAgentTerminal(n,i,r={}){if(!i)throw new Error(V("sandbox.missingSessionForTerminal"));const s=await gn(`/web/${n}/sessions/${encodeURIComponent(i)}/terminal`,{method:"POST",headers:Xr(),signal:r.signal},Oh);if(!s.ok)throw await _s(s,V("sandbox.openTerminalFailed",{kind:n}));const a=await s.json();return{url:xTe(a.url,`${n} Terminal`),...typeof a.shellSessionId=="string"?{shellSessionId:a.shellSessionId}:{}}},async deleteAgentSession(n,i,r={}){if(!i)return;const s=await gn(`/web/${n}/sessions/${encodeURIComponent(i)}`,{method:"DELETE",headers:Xr(),signal:r.signal},rO);if(!s.ok&&s.status!==404)throw await _s(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 gn(`${s}/snapshots/${encodeURIComponent(i)}/resume`,{method:"POST",headers:Xr(),signal:r.signal},z5);if(!a.ok)throw await _s(a,V("sandbox.resumeSnapshotFailed"));return tb(await a.json(),n)},async deleteSnapshot(n,i,r={}){if(!i)return;const s=n==="codex"?"/web/sandbox":`/web/${n}`,a=await gn(`${s}/snapshots/${encodeURIComponent(i)}`,{method:"DELETE",headers:Xr(),signal:r.signal},rO);if(!a.ok&&a.status!==404)throw await _s(a,V("sandbox.deleteSnapshotFailed"))},async connectSession(n,i={}){if(!n)throw new Error(V("sandbox.missingSessionToConnect"));const r=await gn(`${e}/${encodeURIComponent(n)}/connect`,{method:"POST",headers:Xr({"Content-Type":"application/json"}),signal:i.signal},cJe);if(!r.ok)throw await _s(r,V("sandbox.connectCodexFailed"));const s=tb(await r.json(),"codex",t.intelligentDevelopment);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 gn(`${e}/${encodeURIComponent(n.sessionId)}/messages`,{method:"POST",headers:Xr({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??uJe);if(!r.ok)throw await _s(r,V("sandbox.conversationFailed"));return yJe(r,i)},async interruptSession(n,i={}){if(!n)return;const r=await gn(`${e}/${encodeURIComponent(n)}/interrupt`,{method:"POST",headers:Xr(),signal:i.signal},t.interruptTimeoutMs??rO);if(!r.ok&&![404,409].includes(r.status))throw await _s(r,V("sandbox.interruptFailed"))},async getStatus(n,i={}){const r=await Ac(e,n,"status",{options:i,fallback:V("sandbox.getStatusFailed")}),s=bY(r),a=mo(r),l=iF(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=mo(await Ac(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 gn(`${dY}/pairings`,{method:"POST",headers:Xr({Accept:"application/json","Content-Type":"application/json"}),body:JSON.stringify({ttlSeconds:fJe}),signal:n.signal},hY);if(!i.ok)throw await _s(i,V("sandbox.createHandoffPairingFailed"));const r=mo(await pY(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 gn(`${dY}/pairings/${encodeURIComponent(n)}`,{headers:Xr({Accept:"application/json"}),signal:i.signal},hY);if(!r.ok)throw await _s(r,V("sandbox.getHandoffStatusFailed"));const s=mo(await pY(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=mo(await Ac(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=pJe(s);return a?[a]:[]})},async setModel(n,i,r={}){const s=mo(await Ac(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=mo(await Ac(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=mJe(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=mo(await Ac(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=bTe(c);return u?[u]:[]}),...typeof l.nextCursor=="string"?{nextCursor:l.nextCursor}:{}}},async newThread(n,i={}){return wb(await Ac(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 wb(await Ac(e,n,`threads/${encodeURIComponent(i)}`,{options:r,fallback:V("sandbox.readThreadFailed")}))},async resumeThread(n,i,r={}){return wb(await Ac(e,n,"threads/resume",{method:"POST",body:{threadId:i},options:r,fallback:V("sandbox.resumeThreadFailed")}))},async forkThread(n,i={}){return wb(await Ac(e,n,"threads/fork",{method:"POST",options:i,fallback:V("sandbox.forkThreadFailed")}))},async archiveThread(n,i,r={}){const s=mo(await Ac(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:wb(s)}:{}}},async deleteThread(n,i,r={}){const s=mo(await Ac(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:wb(s)}:{}}},async compactThread(n,i={}){await Ac(e,n,"threads/compact",{method:"POST",options:i,fallback:V("sandbox.compactThreadFailed")})},async getSettings(n,i={}){const r=await gn(`${e}/${encodeURIComponent(n)}/settings`,{method:"GET",headers:Xr(),signal:i.signal},Oh);if(!r.ok)throw await _s(r,V("sandbox.getSettingsFailed"));return bY(await r.json())},async updatePermissions(n,i,r={}){const s=await gn(`${e}/${encodeURIComponent(n)}/permissions`,{method:"PUT",headers:Xr({"Content-Type":"application/json"}),body:JSON.stringify(i),signal:r.signal},Oh);if(!s.ok)throw await _s(s,V("sandbox.updatePermissionsFailed"));const a=await s.json();return JI(a.permissions)},async updateWorkspace(n,i,r={}){const s=await gn(`${e}/${encodeURIComponent(n)}/workspace`,{method:"PUT",headers:Xr({"Content-Type":"application/json"}),body:JSON.stringify({cwd:i}),signal:r.signal},Oh);if(!s.ok)throw await _s(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 gn(`${e}/${encodeURIComponent(n)}/directories?${s}`,{method:"GET",headers:Xr(),signal:r.signal},Oh);if(!a.ok)throw await _s(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 gn(`${e}/${encodeURIComponent(n)}/approvals/${encodeURIComponent(i)}`,{method:"POST",headers:Xr({"Content-Type":"application/json"}),body:JSON.stringify({decision:r}),signal:s.signal},Oh);if(!a.ok)throw await _s(a,V("sandbox.resolveApprovalFailed"))},async launchTerminal(n,i={}){return yY(e,n,"terminal",i)},async launchBrowser(n,i={}){return yY(e,n,"browser",i)},async uploadFile(n,i,r={}){const s=new FormData;s.set("file",i,i.name);const a=await gn(`${e}/${encodeURIComponent(n)}/files`,{method:"POST",headers:Xr(),body:s,signal:r.signal},dJe);if(!a.ok)throw await _s(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 gn(`${e}/${encodeURIComponent(n)}/disconnect`,{method:"POST",headers:Xr(),signal:i.signal},rO);if(!r.ok&&r.status!==404)throw await _s(r,V("sandbox.disconnectCodexFailed"))},async deleteSession(n,i={}){if(!n)return;const r=await gn(`${e}/${encodeURIComponent(n)}`,{method:"DELETE",headers:Xr(),signal:i.signal},rO);if(!r.ok&&r.status!==404)throw await _s(r,V("sandbox.deleteCodexFailed"))}}}const Ar=vTe(lJe),L0=vTe("/web/intelligent-development/sessions",{textOnly:!0,messageTimeoutMs:36e5,interruptTimeoutMs:45e3,intelligentDevelopment:!0});async function yY(e,t,n,i){const r=await gn(`${e}/${encodeURIComponent(t)}/${n}`,{method:"POST",headers:Xr(),signal:i.signal},Oh);if(!r.ok)throw await _s(r,V(n==="terminal"?"sandbox.openSandboxTerminalFailed":"sandbox.openSandboxBrowserFailed"));const s=await r.json();return{url:xTe(s.url,V("sandbox.toolLabel")),...typeof s.shellSessionId=="string"?{shellSessionId:s.shellSessionId}:{}}}function xTe(e,t){if(typeof e!="string")throw new Error(V("sandbox.invalidToolUrl",{label:t}));if(e.startsWith("/"))return ia(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()}const Uc=e=>["succeeded","cancelled","failed"].includes(e.state),wTe="/web/intelligent-development";class Xx extends Error{constructor(t,n){super(t),this.status=n}}async function nb(e,t="GET",n,i){const r=await gn(`${wTe}${e}`,{method:t,signal:i,headers:Xr(n===void 0?void 0:{"Content-Type":"application/json"}),...n===void 0?{}:{body:JSON.stringify(n)}},3e4);if(!r.ok){const s=await r.json().catch(()=>null),a=s==null?void 0:s.detail;throw new Xx(typeof a=="string"?a:(a==null?void 0:a.message)||V("developmentRuns.requestFailed"),r.status)}return r.json()}function $0(e){const t=e;if(!t||typeof t.runId!="string"||typeof t.sessionId!="string"||!["queued","running","recovering","waiting_user","stopping","succeeded","cancelled","failed"].includes(t.state))throw new Error(V("developmentRuns.invalidResponse"));return t}const yd={async active(e){const t=await nb("/runs","GET",void 0,e);if(!Array.isArray(t.runs))throw new Error(V("developmentRuns.invalidResponse"));return t.runs.map($0)},async get(e,t){return $0(await nb(`/runs/${encodeURIComponent(e)}`,"GET",void 0,t))},async list(e,t){const n=await nb(`/sessions/${encodeURIComponent(e)}/runs`,"GET",void 0,t);if(!Array.isArray(n.runs))throw new Error(V("developmentRuns.invalidResponse"));return n.runs.map($0)},async create(e,t,n){return $0(await nb(`/sessions/${encodeURIComponent(e)}/runs`,"POST",{message:t,requestId:n}))},async steer(e,t,n){await nb(`/runs/${encodeURIComponent(e)}/inputs`,"POST",{message:t,clientId:n})},async stop(e){return $0(await nb(`/runs/${encodeURIComponent(e)}/stop`,"POST"))},async resume(e){return $0(await nb(`/runs/${encodeURIComponent(e)}/resume`,"POST"))}};class vJe{constructor(t){rn(this,"cursor",0);rn(this,"turns",[]);rn(this,"activeInput");rn(this,"itemTurns",new Map);rn(this,"nativeInputs",new Map);rn(this,"metrics",new Map);rn(this,"inputOrder",[]);rn(this,"projections",new Map);rn(this,"itemInputs",new Map);this.run=t,this.activeInput=t.requestId}projection(t){let n=this.projections.get(t);if(!n){const i={role:"assistant",blocks:[],meta:{localId:`${t}:assistant`}},r=this.turns.findIndex(s=>{var a;return((a=s.meta)==null?void 0:a.localId)===`${t}:user`});this.turns.splice(r<0?this.turns.length:r+1,0,i),n=yTe({onBlocks:s=>{i.blocks=s.map(a=>({...a,turnId:this.itemTurns.get(a.id||"")}))},onUsage:s=>{i.meta={...i.meta,sandboxUsage:s.usage}}}),this.projections.set(t,n)}return n}apply(t){if(t.payload.runId!==this.run.runId)throw new Error(V("developmentRuns.invalidResponse"));if(t.seq<=this.cursor)return;if(t.seq!==this.cursor+1)throw new Error(V("developmentRuns.eventGap"));for(const i of this.turns)i.blocks.some(r=>r.kind==="turn-summary")&&(i.blocks=i.blocks.filter(r=>r.kind!=="turn-summary"));const n=t.payload;if(t.type==="run.input"&&typeof n.clientId=="string"&&typeof n.message=="string")this.turns.push({role:"user",blocks:[{kind:"text",text:n.message}],meta:{localId:`${n.clientId}:user`},activity:{id:`${n.clientId}:delivery`,title:V(`developmentRuns.input.${String(n.status)}`)}}),this.inputOrder.push(n.clientId),this.projection(n.clientId),n.status==="delivered"&&this.inputOrder.indexOf(n.clientId)>=this.inputOrder.indexOf(this.activeInput)&&(this.activeInput=n.clientId);else if(t.type==="run.input_status"&&typeof n.clientId=="string"){const i=this.turns.find(r=>{var s;return((s=r.meta)==null?void 0:s.localId)===`${n.clientId}:user`});i&&(i.activity={id:`${n.clientId}:delivery`,title:V(`developmentRuns.input.${String(n.status)}`)}),n.status==="delivered"&&this.inputOrder.indexOf(n.clientId)>=this.inputOrder.indexOf(this.activeInput)&&(this.activeInput=n.clientId)}else if(t.type==="run.turn"&&typeof n.turnId=="string"){const r={...this.metrics.get(n.turnId),turnId:n.turnId,status:String(n.status||"inProgress"),toolCalls:0,toolDurationComplete:!1};for(const s of["startedAt","completedAt","durationMs"])typeof n[s]=="number"&&Number.isFinite(n[s])&&n[s]>=0&&(r[s]=n[s]);if(typeof n.model=="string"&&(r.model=n.model),n.usage&&typeof n.usage=="object"&&!Array.isArray(n.usage)){const s={};for(const a of["totalTokens","inputTokens","outputTokens","cachedInputTokens","cacheWriteInputTokens","reasoningOutputTokens"]){const l=n.usage[a];typeof l=="number"&&Number.isSafeInteger(l)&&l>=0&&(s[a]=l)}r.usage=s}n.usageIncomplete===!0&&(r.usageIncomplete=!0),this.metrics.set(n.turnId,r),this.nativeInputs.set(n.turnId,this.activeInput),this.projection(this.activeInput)}else if(t.type==="run.status"){if(this.run={...this.run,...n},Uc(this.run))for(const[i,r]of this.metrics)r.status==="inProgress"&&this.metrics.set(i,{...r,status:"unavailable",usageIncomplete:!0});if(Uc(this.run)||this.run.state==="waiting_user")for(const i of this.projections.values())i.consumeFrame(`event: done data: {}`)}else if(!t.type.startsWith("run.")){const i=typeof n.id=="string"&&n.id?n.id:["plan","diff"].includes(t.type)?t.type:"",r=i?`${String(n.turnId||"")}:${i}`:"",s=r&&this.itemInputs.get(r)||this.activeInput;r&&(this.itemInputs.set(r,s),typeof n.turnId=="string"&&this.itemTurns.set(r,n.turnId)),typeof n.turnId=="string"&&this.nativeInputs.set(n.turnId,this.activeInput);const a=t.type==="activity"&&n.kind==="commentary";this.projection(s).consumeFrame(`event: ${a?"delta":t.type} -data: ${JSON.stringify({...n,...r?{id:r}:{},...a?{snapshot:!0}:{}})}`)}(t.type==="run.input"||t.type==="run.input_status")&&n.status==="delivered"&&typeof n.turnId=="string"&&typeof n.clientId=="string"&&this.nativeInputs.set(n.turnId,n.clientId),this.decorate(),this.cursor=t.seq}decorate(){const t=!zc(this.run)&&this.run.state!=="waiting_user",n=[...this.turns].reverse().find(i=>i.role==="assistant");for(const i of this.turns)i.role==="assistant"&&(i.meta={...i.meta,streaming:t&&i===n});for(const i of this.metrics.values()){if(!["completed","failed","interrupted","cancelled","unavailable"].includes(i.status))continue;const r=new Map;for(const u of this.turns)for(const d of u.blocks)d.kind==="tool"&&d.turnId===i.turnId&&d.id&&r.set(d.id,d);const s=[...r.values()].filter(u=>typeof u.durationMs=="number"&&Number.isFinite(u.durationMs)&&u.durationMs>=0),a={...i,toolCalls:r.size,toolDurationComplete:s.length===r.size,toolDurationMs:s.length||!r.size?s.reduce((u,d)=>u+d.durationMs,0):void 0},l=this.nativeInputs.get(i.turnId),c=this.turns.find(u=>{var d;return((d=u.meta)==null?void 0:d.localId)===`${l}:assistant`});if(c){const u=c.blocks.reduce((d,f,h)=>f.turnId===i.turnId?h:d,-1);c.blocks.splice(u<0?c.blocks.length:u+1,0,{kind:"turn-summary",id:`${i.turnId}:summary`,turnId:i.turnId,value:a})}}}}function hJe(e,t){return new Promise((n,i)=>{if(t.aborted){i(new DOMException("Aborted","AbortError"));return}const r=()=>{clearTimeout(s),i(new DOMException("Aborted","AbortError"))},s=setTimeout(()=>{t.removeEventListener("abort",r),n()},e);t.addEventListener("abort",r,{once:!0})})}async function pJe(e,t,n){var c;const i=await pn(`${pTe}/runs/${encodeURIComponent(e.run.runId)}/events?after=${e.cursor}`,{signal:t,headers:Yr({Accept:"text/event-stream"})},0);if(!i.ok)throw new Xx(V("developmentRuns.requestFailed"),i.status);if(!i.body)throw new Error(V("developmentRuns.invalidResponse"));const r=i.body.getReader(),s=new TextDecoder;let a="",l=!1;try{for(;;){const{value:u,done:d}=await r.read();a+=s.decode(u,{stream:!d});const f=a.split(/\r?\n\r?\n/);a=f.pop()||"";for(const h of f){const m=h.split(/\r?\n/),g=(c=m.find(y=>y.startsWith("event:")))==null?void 0:c.slice(6).trim();if(g==="done"){l=!0;continue}const b=m.filter(y=>y.startsWith("data:")).map(y=>y.slice(5).trimStart()).join(` -`);if(!g||!b)continue;const v=JSON.parse(b);if(!Number.isSafeInteger(v.seq))throw new Error(V("developmentRuns.invalidResponse"));e.apply({seq:v.seq,type:g,payload:v})}if(n(),d)break}if(!l)throw new Error(V("developmentRuns.reconnecting"))}finally{await r.cancel().catch(()=>{}),r.releaseLock()}}async function mJe(e,t,n,i,r){const s=new Map;let a=0;const l=new Map;let c;r==null||r(h=>{t.aborted||h.sessionId!==e||(l.set(h.runId,h),c==null||c())});const u=h=>new Promise(m=>{const g=()=>{clearTimeout(b),t.removeEventListener("abort",g),c=void 0,m()},b=setTimeout(g,h);c=g,t.addEventListener("abort",g,{once:!0}),(t.aborted||l.size)&&g()}),d=new Map,f=()=>{var m;if(t.aborted)return;const h=[...s.values()];n(h.flatMap(g=>{let b=d.get(g);return(!b||b.cursor!==g.cursor)&&(b={cursor:g.cursor,turns:g.turns.map(v=>({...v}))},d.set(g,b)),b.turns}),((m=h[h.length-1])==null?void 0:m.run)||null)};for(;!t.aborted;)try{const h=l.size?[]:await bd.list(e,t),m=[...new Map([...h,...l.values()].map(g=>[g.runId,g])).values()];l.clear();for(const g of m){let b=s.get(g.runId);if(b||(b=new fJe(g),s.set(g.runId,b)),b.cursor>=g.lastSeq&&(b.run=g),b.cursor{a=0,i(""),f()})}catch(v){if(!(v instanceof Xx&&v.status===404&&zc(g)))throw v}}a=0,i(""),f(),await u(1500)}catch(h){if(t.aborted)return;if(h instanceof Xx&&[401,403,404].includes(h.status))throw h;i(V("developmentRuns.reconnecting")),await hJe(Math.min(1e3*2**a++,15e3),t)}}function gJe({sessionId:e,ownerId:t,onTurns:n,onBusy:i}){const[r,s]=p.useState(null),[a,l]=p.useState(""),[c,u]=p.useState(""),[d,f]=p.useState(!1),[h,m]=p.useState(!1),g=p.useRef({onTurns:n,onBusy:i});g.current={onTurns:n,onBusy:i};const b=p.useRef(0),v=p.useRef([]),y=p.useRef([]),w=p.useRef(null),x=()=>{const T=new Set(v.current.map(N=>{var _;return(_=N.meta)==null?void 0:_.localId}));y.current=y.current.filter(N=>{var _;return!T.has((_=N.meta)==null?void 0:_.localId)}),g.current.onTurns([...v.current,...y.current])},O=p.useRef(!1),S=p.useRef(!1),k=p.useRef(null),C=p.useRef({sessionId:e,ownerId:t});C.current={sessionId:e,ownerId:t},p.useEffect(()=>{b.current+=1,s(null),u(""),l(""),v.current=[],w.current=null;const T=k.current;if(((T==null?void 0:T.session)!==e||T.owner!==t)&&(y.current=[],m(!1),S.current=!1,k.current=null,O.current=!1,f(!1)),e&&x(),!e||!t)return;const N=new AbortController,_=()=>!N.signal.aborted&&C.current.sessionId===e&&C.current.ownerId===t;return mJe(e,N.signal,(D,M)=>{_()&&(v.current=D,x(),s(M),g.current.onBusy(O.current||!!(M&&!zc(M))),M&&zc(M)&&(m(!1),S.current=!1))},D=>{_()&&l(D)},D=>{_()&&(w.current=D)}).catch(D=>{_()&&u(D instanceof Error?D.message:String(D))}),()=>N.abort()},[e,t]);function E(T,N=e){const _=C.current.ownerId;let D=k.current;return(!D||D.session!==N||D.owner!==_||D.text!==T)&&(D={session:N,owner:_,text:T,id:crypto.randomUUID()},k.current=D),y.current.some(M=>{var P;return((P=M.meta)==null?void 0:P.localId)===`${D.id}:user`})||y.current.push({role:"user",blocks:[{kind:"text",text:T}],meta:{localId:`${D.id}:user`}},{role:"assistant",blocks:[{kind:"progress",text:V(r&&!zc(r)?"developmentRuns.processing":"developmentRuns.preparing")}],meta:{localId:`${D.id}:assistant`}}),[...y.current]}async function R(T,N=e){var L;if(!T.trim()||O.current||S.current)return!1;O.current=!0,f(!0),u("");const _=C.current.ownerId,D=()=>C.current.ownerId===_&&C.current.sessionId===N;E(T,N),x(),g.current.onBusy(!0);const M=k.current,P=(M==null?void 0:M.session)===N&&M.owner===_&&M.text===T?M:{session:N,owner:_,text:T,id:crypto.randomUUID(),runId:void 0,stopRequested:!1};k.current=P;try{const B=await bd.list(N),I=B[B.length-1];if(!D())return!1;!P.runId&&I&&!zc(I)&&I.requestId!==P.id&&(P.runId=I.runId);let z;return P.runId?(await bd.steer(P.runId,T,P.id),z=await bd.get(P.runId)):z=await bd.create(N,T,P.id),(P.stopRequested||D()&&S.current)&&(z=await bd.stop(z.runId)),D()&&(s(z),(L=w.current)==null||L.call(w,z),g.current.onBusy(!zc(z)),k.current=null),!0}catch(B){return D()&&(g.current.onBusy(!!(r&&!zc(r))),u(B instanceof Error?B.message:String(B)),P.stopRequested&&(S.current=!1,m(!1))),!1}finally{D()&&(O.current=!1,f(!1))}}async function A(){S.current=!0,m(!0),u(""),k.current&&(k.current.stopRequested=!0);const T=b.current;try{const _=(await bd.list(e)).find(D=>!zc(D));if(_){const D=await bd.stop(_.runId);T===b.current&&s(D)}else!O.current&&T===b.current&&(S.current=!1,m(!1))}catch(N){T===b.current&&(u(N instanceof Error?N.message:String(N)),m(!1),S.current=!1)}}async function j(){if(!r)return;const T=b.current;try{const N=await bd.resume(r.runId);T===b.current&&(s(N),u(""))}catch(N){T===b.current&&u(N instanceof Error?N.message:String(N))}}return{run:r,connection:a,error:c,submitting:d,stopPending:h,prepare:E,submit:R,stop:A,resume:j}}function vY(e){return e?["stopping","waiting_user","failed","cancelled"].includes(e.state)?e.statusMessage:e.phase==="reporting"?V("developmentRuns.reporting"):e.state==="recovering"?e.statusMessage:["outcome_read","delivery"].includes(e.phase)?V("developmentRuns.packaging"):e.phase==="version"?V("developmentRuns.savingVersion"):e.phase==="cycle_complete"?V("developmentRuns.finishing"):e.statusMessage:""}function mTe(e){if(e==null||!Number.isFinite(e)||e<0)return V("developmentRuns.notReported");const t=Math.round(e);if(t===0)return`<${V("developmentRuns.durationUnits.milliseconds",{value:"1"})}`;if(t<1e3)return V("developmentRuns.durationUnits.milliseconds",{value:t.toLocaleString(F$())});const n=Math.round(t/100);return[["hours",Math.floor(n/36e3)],["minutes",Math.floor(n%36e3/600)],["seconds",n%600/10]].filter(([,r])=>r>0).map(([r,s])=>V(`developmentRuns.durationUnits.${r}`,{value:s.toLocaleString(F$(),{maximumFractionDigits:1})})).join(" ")}const z5=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},xY=e=>typeof e=="string"?e.replace(/\s+/g," ").trim().slice(0,160):"";function gTe(e){var n;const t=z5(e.args);if(e.itemType==="dynamicToolCall"&&e.name==="submit_build_result")return V("developmentRuns.submitResult");if(e.itemType==="commandExecution"){const i=Array.isArray(t.commandActions)?t.commandActions.map(z5):[],r=new Set(i.map(c=>c.type));if(i.length&&r.size===1){if(r.has("read"))return V("developmentRuns.read",{target:"Read project files"});if(r.has("listFiles"))return V("developmentRuns.listFiles",{target:"List directory"});if(r.has("search"))return V("developmentRuns.search",{target:"Search project files"})}const s=typeof t.command=="string"?t.command:"",l=((n=[[/\b(?:pytest|vitest|jest)\b|\b(?:npm|pnpm|yarn) (?:run )?test\b/,"Run tests"],[/\b(?:npm|pnpm|yarn) (?:ci|install|add)\b|\b(?:pip|pip3|uv pip) install\b|\buv sync\b/,"Install dependencies"],[/\b(?:ruff|eslint|prettier|pyright|tsc)\b/,"Check code quality"],[/\b(?:npm|pnpm|yarn) (?:run )?build\b|\bpython[^;]* -m build\b/,"Build project"],[/\bgit (?:status|diff|log|show)\b/,"Inspect Git changes"],[/\bgit (?:add|commit)\b/,"Save Git changes"],[/\b(?:curl|wget)\b/,"Send HTTP request"],[/\bcompileall\b/,"Check Python syntax"]].find(([c])=>c.test(s)))==null?void 0:n[1])||"Run shell command";return V("developmentRuns.command",{target:l})}if(e.itemType==="fileChange"){const i=Array.isArray(t.changes)?t.changes.map(r=>xY(z5(r).path)).filter(Boolean):[];return V("developmentRuns.editFiles",{target:i.join(", ")})}return e.itemType==="webSearch"?V("developmentRuns.webSearch",{target:xY(t.query)}):e.name}const bJe=e=>["tool","thinking","plan","diff"].includes(e.kind);function yJe(e){const t=[];return e.forEach((n,i)=>{if(n.kind==="progress")return;const r=bJe(n),s=t[t.length-1];r&&(s!=null&&s.process)?s.blocks.push(n):t.push({id:n.id||`${n.kind}:${i}`,process:r,blocks:[n]})}),t}const wY="M 15 15 C 15 5, 25 5, 30 15 C 35 25, 45 25, 45 15 C 45 5, 35 5, 30 15 C 25 25, 15 25, 15 15";function gy({variant:e="infinity",size:t=e==="ring"?20:32,label:n="加载中",decorative:i=!1,className:r="",style:s}){const a=BI(),l=typeof t=="number"?t/2:`calc(${t} / 2)`,c=typeof t=="number"?t*3/40:`calc(${t} * 3 / 40)`;return o.jsxs("span",{className:`studio-loading studio-loading--${e} ${r}`.trim(),style:s,role:i?void 0:"status","aria-live":i?void 0:"polite","aria-hidden":i||void 0,children:[e==="infinity"?o.jsxs("svg",{className:"studio-loading__infinity",width:typeof t=="number"?t:void 0,height:typeof l=="number"?l:void 0,style:typeof t=="string"?{width:t,height:l}:void 0,viewBox:"0 0 60 30",fill:"none","aria-hidden":"true",children:[o.jsx("path",{className:"studio-loading__track",d:wY,strokeWidth:"4",strokeLinecap:"round"}),o.jsx(cr.path,{className:"studio-loading__path",d:wY,strokeWidth:"4",strokeLinecap:"round",strokeDasharray:a?void 0:"100",initial:{strokeDashoffset:100},animate:{strokeDashoffset:a?0:[100,-100]},transition:{duration:a?0:2,repeat:a?0:1/0,ease:"linear"}})]}):o.jsx(cr.div,{className:"studio-loading__ring",style:{width:t,height:t,borderWidth:c},"aria-hidden":"true",animate:{rotate:a?0:360},transition:{duration:a?0:1,repeat:a?0:1/0,ease:"linear"}}),!i&&o.jsx("span",{className:"studio-loading__label",children:n})]})}function Us({className:e="",type:t="button",variant:n="primary",size:i="default",startIcon:r,endIcon:s,iconOnly:a=!1,hoverEffect:l="background",loading:c=!1,disabled:u,children:d,...f}){return o.jsxs("button",{...f,type:t,disabled:u||c,"aria-busy":c||f["aria-busy"],"data-hover-effect":a?l:void 0,className:`studio-button studio-button--${n} studio-button--size-${i}${a?" studio-button--icon-only":""}${c?" studio-button--loading":""} ${e}`.trim(),children:[r&&o.jsx("span",{className:"studio-button__icon","aria-hidden":"true",children:r}),!a&&o.jsx("span",{className:"studio-button__label",children:d}),!a&&s&&o.jsx("span",{className:"studio-button__icon studio-button__end-icon","aria-hidden":"true",children:s}),c&&o.jsx("span",{className:"studio-button__loading","aria-hidden":"true",children:o.jsx(gy,{variant:"ring",size:"var(--studio-button-icon-size)",decorative:!0})})]})}function vJe({variant:e,...t}){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:e==="warning"?o.jsxs(o.Fragment,{children:[o.jsx("path",{d:"m10.3 4.5-7.6 13a2 2 0 0 0 1.7 3h15.2a2 2 0 0 0 1.7-3l-7.6-13a2 2 0 0 0-3.4 0Z"}),o.jsx("path",{d:"M12 9v4m0 3.5h.01"})]}):o.jsxs(o.Fragment,{children:[o.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),e==="success"?o.jsx("path",{d:"m8 12 2.7 2.7L16 9.4"}):e==="error"?o.jsx("path",{d:"m9.2 9.2 5.6 5.6m0-5.6-5.6 5.6"}):o.jsx("path",{d:"M12 11v5m0-8h.01"})]})})}function xJe(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 wJe({variant:e="info",title:t,description:n,action:i,onDismiss:r,closeLabel:s="关闭通知",className:a="",role:l="status",...c}){return o.jsxs("div",{...c,role:l,className:`studio-toast ${a}`.trim(),"data-variant":e,children:[o.jsx(vJe,{variant:e,className:"studio-toast__status"}),o.jsxs("div",{className:"studio-toast__content",children:[t!=null&&o.jsx("div",{className:"studio-toast__title",children:t}),n!=null&&o.jsx("div",{className:"studio-toast__description",children:n}),i!=null&&o.jsx("div",{className:"studio-toast__action",children:i})]}),r&&o.jsx(Us,{variant:"ghost",iconOnly:!0,startIcon:o.jsx(xJe,{}),"aria-label":s,onClick:r,className:"studio-toast__close"})]})}function UU(){}const OJe=Object.freeze([]),_l=Object.freeze({});function JI(e){p.useEffect(e,OJe)}const OY={};function Xu(e,t){const n=p.useRef(OY);return n.current===OY&&(n.current=e(t)),n}const kJe=()=>{},Fn=typeof document<"u"?p.useLayoutEffect:kJe;function SJe(e,t){return function(i,...r){const s=new URL(e);return s.searchParams.set("code",i.toString()),r.forEach(a=>s.searchParams.append("args[]",a)),`${t} error #${i}; visit ${s} for the full message.`}}const mc=SJe("https://base-ui.com/production-error","Base UI"),bTe=p.createContext(void 0);function QU(){const e=p.useContext(bTe);if(!e)throw new Error(mc(73));return e}var yTe={exports:{}},vTe={};/** +data: ${JSON.stringify({...n,...r?{id:r}:{},...a?{snapshot:!0}:{}})}`)}(t.type==="run.input"||t.type==="run.input_status")&&n.status==="delivered"&&typeof n.turnId=="string"&&typeof n.clientId=="string"&&this.nativeInputs.set(n.turnId,n.clientId),this.decorate(),this.cursor=t.seq}decorate(){const t=!Uc(this.run)&&this.run.state!=="waiting_user",n=[...this.turns].reverse().find(i=>i.role==="assistant");for(const i of this.turns)i.role==="assistant"&&(i.meta={...i.meta,streaming:t&&i===n});for(const i of this.metrics.values()){if(!["completed","failed","interrupted","cancelled","unavailable"].includes(i.status))continue;const r=new Map;for(const u of this.turns)for(const d of u.blocks)d.kind==="tool"&&d.turnId===i.turnId&&d.id&&r.set(d.id,d);const s=[...r.values()].filter(u=>typeof u.durationMs=="number"&&Number.isFinite(u.durationMs)&&u.durationMs>=0),a={...i,toolCalls:r.size,toolDurationComplete:s.length===r.size,toolDurationMs:s.length||!r.size?s.reduce((u,d)=>u+d.durationMs,0):void 0},l=this.nativeInputs.get(i.turnId),c=this.turns.find(u=>{var d;return((d=u.meta)==null?void 0:d.localId)===`${l}:assistant`});if(c){const u=c.blocks.reduce((d,f,h)=>f.turnId===i.turnId?h:d,-1);c.blocks.splice(u<0?c.blocks.length:u+1,0,{kind:"turn-summary",id:`${i.turnId}:summary`,turnId:i.turnId,value:a})}}}}function xJe(e,t){return new Promise((n,i)=>{if(t.aborted){i(new DOMException("Aborted","AbortError"));return}const r=()=>{clearTimeout(s),i(new DOMException("Aborted","AbortError"))},s=setTimeout(()=>{t.removeEventListener("abort",r),n()},e);t.addEventListener("abort",r,{once:!0})})}async function wJe(e,t,n){var c;const i=await gn(`${wTe}/runs/${encodeURIComponent(e.run.runId)}/events?after=${e.cursor}`,{signal:t,headers:Xr({Accept:"text/event-stream"})},0);if(!i.ok)throw new Xx(V("developmentRuns.requestFailed"),i.status);if(!i.body)throw new Error(V("developmentRuns.invalidResponse"));const r=i.body.getReader(),s=new TextDecoder;let a="",l=!1;try{for(;;){const{value:u,done:d}=await r.read();a+=s.decode(u,{stream:!d});const f=a.split(/\r?\n\r?\n/);a=f.pop()||"";for(const h of f){const m=h.split(/\r?\n/),g=(c=m.find(y=>y.startsWith("event:")))==null?void 0:c.slice(6).trim();if(g==="done"){l=!0;continue}const b=m.filter(y=>y.startsWith("data:")).map(y=>y.slice(5).trimStart()).join(` +`);if(!g||!b)continue;const v=JSON.parse(b);if(!Number.isSafeInteger(v.seq))throw new Error(V("developmentRuns.invalidResponse"));e.apply({seq:v.seq,type:g,payload:v})}if(n(),d)break}if(!l)throw new Error(V("developmentRuns.reconnecting"))}finally{await r.cancel().catch(()=>{}),r.releaseLock()}}async function OJe(e,t,n,i,r){const s=new Map;let a=0;const l=new Map;let c;r==null||r(h=>{t.aborted||h.sessionId!==e||(l.set(h.runId,h),c==null||c())});const u=h=>new Promise(m=>{const g=()=>{clearTimeout(b),t.removeEventListener("abort",g),c=void 0,m()},b=setTimeout(g,h);c=g,t.addEventListener("abort",g,{once:!0}),(t.aborted||l.size)&&g()}),d=new Map,f=()=>{var m;if(t.aborted)return;const h=[...s.values()];n(h.flatMap(g=>{let b=d.get(g);return(!b||b.cursor!==g.cursor)&&(b={cursor:g.cursor,turns:g.turns.map(v=>({...v}))},d.set(g,b)),b.turns}),((m=h[h.length-1])==null?void 0:m.run)||null)};for(;!t.aborted;)try{const h=l.size?[]:await yd.list(e,t),m=[...new Map([...h,...l.values()].map(g=>[g.runId,g])).values()];l.clear();for(const g of m){let b=s.get(g.runId);if(b||(b=new vJe(g),s.set(g.runId,b)),b.cursor>=g.lastSeq&&(b.run=g),b.cursor{a=0,i(""),f()})}catch(v){if(!(v instanceof Xx&&v.status===404&&Uc(g)))throw v}}a=0,i(""),f(),await u(1500)}catch(h){if(t.aborted)return;if(h instanceof Xx&&[401,403,404].includes(h.status))throw h;i(V("developmentRuns.reconnecting")),await xJe(Math.min(1e3*2**a++,15e3),t)}}function kJe({sessionId:e,ownerId:t,onTurns:n,onBusy:i}){const[r,s]=p.useState(null),[a,l]=p.useState(""),[c,u]=p.useState(""),[d,f]=p.useState(!1),[h,m]=p.useState(!1),g=p.useRef({onTurns:n,onBusy:i});g.current={onTurns:n,onBusy:i};const b=p.useRef(0),v=p.useRef([]),y=p.useRef([]),w=p.useRef(null),x=()=>{const T=new Set(v.current.map(j=>{var _;return(_=j.meta)==null?void 0:_.localId}));y.current=y.current.filter(j=>{var _;return!T.has((_=j.meta)==null?void 0:_.localId)}),g.current.onTurns([...v.current,...y.current])},O=p.useRef(!1),S=p.useRef(!1),k=p.useRef(null),C=p.useRef({sessionId:e,ownerId:t});C.current={sessionId:e,ownerId:t},p.useEffect(()=>{b.current+=1,s(null),u(""),l(""),v.current=[],w.current=null;const T=k.current;if(((T==null?void 0:T.session)!==e||T.owner!==t)&&(y.current=[],m(!1),S.current=!1,k.current=null,O.current=!1,f(!1)),e&&x(),!e||!t)return;const j=new AbortController,_=()=>!j.signal.aborted&&C.current.sessionId===e&&C.current.ownerId===t;return OJe(e,j.signal,(I,D)=>{_()&&(v.current=I,x(),s(D),g.current.onBusy(O.current||!!(D&&!Uc(D))),D&&Uc(D)&&(m(!1),S.current=!1))},I=>{_()&&l(I)},I=>{_()&&(w.current=I)}).catch(I=>{_()&&u(I instanceof Error?I.message:String(I))}),()=>j.abort()},[e,t]);function E(T,j=e){const _=C.current.ownerId;let I=k.current;return(!I||I.session!==j||I.owner!==_||I.text!==T)&&(I={session:j,owner:_,text:T,id:crypto.randomUUID()},k.current=I),y.current.some(D=>{var P;return((P=D.meta)==null?void 0:P.localId)===`${I.id}:user`})||y.current.push({role:"user",blocks:[{kind:"text",text:T}],meta:{localId:`${I.id}:user`}},{role:"assistant",blocks:[{kind:"progress",text:V(r&&!Uc(r)?"developmentRuns.processing":"developmentRuns.preparing")}],meta:{localId:`${I.id}:assistant`}}),[...y.current]}async function R(T,j=e){var L;if(!T.trim()||O.current||S.current)return!1;O.current=!0,f(!0),u("");const _=C.current.ownerId,I=()=>C.current.ownerId===_&&C.current.sessionId===j;E(T,j),x(),g.current.onBusy(!0);const D=k.current,P=(D==null?void 0:D.session)===j&&D.owner===_&&D.text===T?D:{session:j,owner:_,text:T,id:crypto.randomUUID(),runId:void 0,stopRequested:!1};k.current=P;try{const B=await yd.list(j),M=B[B.length-1];if(!I())return!1;!P.runId&&M&&!Uc(M)&&M.requestId!==P.id&&(P.runId=M.runId);let H;return P.runId?(await yd.steer(P.runId,T,P.id),H=await yd.get(P.runId)):H=await yd.create(j,T,P.id),(P.stopRequested||I()&&S.current)&&(H=await yd.stop(H.runId)),I()&&(s(H),(L=w.current)==null||L.call(w,H),g.current.onBusy(!Uc(H)),k.current=null),!0}catch(B){return I()&&(g.current.onBusy(!!(r&&!Uc(r))),u(B instanceof Error?B.message:String(B)),P.stopRequested&&(S.current=!1,m(!1))),!1}finally{I()&&(O.current=!1,f(!1))}}async function A(){S.current=!0,m(!0),u(""),k.current&&(k.current.stopRequested=!0);const T=b.current;try{const _=(await yd.list(e)).find(I=>!Uc(I));if(_){const I=await yd.stop(_.runId);T===b.current&&s(I)}else!O.current&&T===b.current&&(S.current=!1,m(!1))}catch(j){T===b.current&&(u(j instanceof Error?j.message:String(j)),m(!1),S.current=!1)}}async function N(){if(!r)return;const T=b.current;try{const j=await yd.resume(r.runId);T===b.current&&(s(j),u(""))}catch(j){T===b.current&&u(j instanceof Error?j.message:String(j))}}return{run:r,connection:a,error:c,submitting:d,stopPending:h,prepare:E,submit:R,stop:A,resume:N}}function vY(e){return e?["stopping","waiting_user","failed","cancelled"].includes(e.state)?e.statusMessage:e.phase==="reporting"?V("developmentRuns.reporting"):e.state==="recovering"?e.statusMessage:["outcome_read","delivery"].includes(e.phase)?V("developmentRuns.packaging"):e.phase==="version"?V("developmentRuns.savingVersion"):e.phase==="cycle_complete"?V("developmentRuns.finishing"):e.statusMessage:""}function OTe(e){if(e==null||!Number.isFinite(e)||e<0)return V("developmentRuns.notReported");const t=Math.round(e);if(t===0)return`<${V("developmentRuns.durationUnits.milliseconds",{value:"1"})}`;if(t<1e3)return V("developmentRuns.durationUnits.milliseconds",{value:t.toLocaleString(F$())});const n=Math.round(t/100);return[["hours",Math.floor(n/36e3)],["minutes",Math.floor(n%36e3/600)],["seconds",n%600/10]].filter(([,r])=>r>0).map(([r,s])=>V(`developmentRuns.durationUnits.${r}`,{value:s.toLocaleString(F$(),{maximumFractionDigits:1})})).join(" ")}const V5=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},xY=e=>typeof e=="string"?e.replace(/\s+/g," ").trim().slice(0,160):"";function kTe(e){var n;const t=V5(e.args);if(e.itemType==="dynamicToolCall"&&e.name==="submit_build_result")return V("developmentRuns.submitResult");if(e.itemType==="commandExecution"){const i=Array.isArray(t.commandActions)?t.commandActions.map(V5):[],r=new Set(i.map(c=>c.type));if(i.length&&r.size===1){if(r.has("read"))return V("developmentRuns.read",{target:"Read project files"});if(r.has("listFiles"))return V("developmentRuns.listFiles",{target:"List directory"});if(r.has("search"))return V("developmentRuns.search",{target:"Search project files"})}const s=typeof t.command=="string"?t.command:"",l=(n=[[/\b(?:pytest|vitest|jest)\b|\b(?:npm|pnpm|yarn) (?:run )?test\b/,"Run tests"],[/\b(?:npm|pnpm|yarn) (?:ci|install|add)\b|\b(?:pip|pip3|uv pip) install\b|\buv sync\b/,"Install dependencies"],[/\b(?:ruff|eslint|prettier|pyright|tsc)\b/,"Check code quality"],[/\b(?:npm|pnpm|yarn) (?:run )?build\b|\bpython[^;]* -m build\b/,"Build project"],[/\bgit (?:status|diff|log|show)\b/,"Inspect Git changes"],[/\bgit (?:add|commit)\b/,"Save Git changes"],[/\b(?:curl|wget)\b/,"Send HTTP request"],[/\bcompileall\b/,"Check Python syntax"]].find(([c])=>c.test(s)))==null?void 0:n[1];return l?V("developmentRuns.command",{target:l}):e.name}if(e.itemType==="fileChange"){const i=Array.isArray(t.changes)?t.changes.map(r=>xY(V5(r).path)).filter(Boolean):[];return V("developmentRuns.editFiles",{target:i.join(", ")})}return e.itemType==="webSearch"?V("developmentRuns.webSearch",{target:xY(t.query)}):e.name}const SJe=e=>["tool","thinking","plan","diff"].includes(e.kind);function EJe(e){const t=[];return e.forEach((n,i)=>{if(n.kind==="progress")return;const r=SJe(n),s=t[t.length-1];r&&(s!=null&&s.process)?s.blocks.push(n):t.push({id:n.id||`${n.kind}:${i}`,process:r,blocks:[n]})}),t}const wY="M 15 15 C 15 5, 25 5, 30 15 C 35 25, 45 25, 45 15 C 45 5, 35 5, 30 15 C 25 25, 15 25, 15 15";function by({variant:e="infinity",size:t=e==="ring"?20:32,label:n="加载中",decorative:i=!1,className:r="",style:s}){const a=UI(),l=typeof t=="number"?t/2:`calc(${t} / 2)`,c=typeof t=="number"?t*3/40:`calc(${t} * 3 / 40)`;return o.jsxs("span",{className:`studio-loading studio-loading--${e} ${r}`.trim(),style:s,role:i?void 0:"status","aria-live":i?void 0:"polite","aria-hidden":i||void 0,children:[e==="infinity"?o.jsxs("svg",{className:"studio-loading__infinity",width:typeof t=="number"?t:void 0,height:typeof l=="number"?l:void 0,style:typeof t=="string"?{width:t,height:l}:void 0,viewBox:"0 0 60 30",fill:"none","aria-hidden":"true",children:[o.jsx("path",{className:"studio-loading__track",d:wY,strokeWidth:"4",strokeLinecap:"round"}),o.jsx(mr.path,{className:"studio-loading__path",d:wY,strokeWidth:"4",strokeLinecap:"round",strokeDasharray:a?void 0:"100",initial:{strokeDashoffset:100},animate:{strokeDashoffset:a?0:[100,-100]},transition:{duration:a?0:2,repeat:a?0:1/0,ease:"linear"}})]}):o.jsx(mr.div,{className:"studio-loading__ring",style:{width:t,height:t,borderWidth:c},"aria-hidden":"true",animate:{rotate:a?0:360},transition:{duration:a?0:1,repeat:a?0:1/0,ease:"linear"}}),!i&&o.jsx("span",{className:"studio-loading__label",children:n})]})}function Vs({className:e="",type:t="button",variant:n="primary",size:i="default",startIcon:r,endIcon:s,iconOnly:a=!1,hoverEffect:l="background",loading:c=!1,disabled:u,children:d,...f}){return o.jsxs("button",{...f,type:t,disabled:u||c,"aria-busy":c||f["aria-busy"],"data-hover-effect":a?l:void 0,className:`studio-button studio-button--${n} studio-button--size-${i}${a?" studio-button--icon-only":""}${c?" studio-button--loading":""} ${e}`.trim(),children:[r&&o.jsx("span",{className:"studio-button__icon","aria-hidden":"true",children:r}),!a&&o.jsx("span",{className:"studio-button__label",children:d}),!a&&s&&o.jsx("span",{className:"studio-button__icon studio-button__end-icon","aria-hidden":"true",children:s}),c&&o.jsx("span",{className:"studio-button__loading","aria-hidden":"true",children:o.jsx(by,{variant:"ring",size:"var(--studio-button-icon-size)",decorative:!0})})]})}function CJe({variant:e,...t}){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:e==="warning"?o.jsxs(o.Fragment,{children:[o.jsx("path",{d:"m10.3 4.5-7.6 13a2 2 0 0 0 1.7 3h15.2a2 2 0 0 0 1.7-3l-7.6-13a2 2 0 0 0-3.4 0Z"}),o.jsx("path",{d:"M12 9v4m0 3.5h.01"})]}):o.jsxs(o.Fragment,{children:[o.jsx("circle",{cx:"12",cy:"12",r:"8.5"}),e==="success"?o.jsx("path",{d:"m8 12 2.7 2.7L16 9.4"}):e==="error"?o.jsx("path",{d:"m9.2 9.2 5.6 5.6m0-5.6-5.6 5.6"}):o.jsx("path",{d:"M12 11v5m0-8h.01"})]})})}function TJe(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 AJe({variant:e="info",title:t,description:n,action:i,onDismiss:r,closeLabel:s="关闭通知",className:a="",role:l="status",...c}){return o.jsxs("div",{...c,role:l,className:`studio-toast ${a}`.trim(),"data-variant":e,children:[o.jsx(CJe,{variant:e,className:"studio-toast__status"}),o.jsxs("div",{className:"studio-toast__content",children:[t!=null&&o.jsx("div",{className:"studio-toast__title",children:t}),n!=null&&o.jsx("div",{className:"studio-toast__description",children:n}),i!=null&&o.jsx("div",{className:"studio-toast__action",children:i})]}),r&&o.jsx(Vs,{variant:"ghost",iconOnly:!0,startIcon:o.jsx(TJe,{}),"aria-label":s,onClick:r,className:"studio-toast__close"})]})}function UU(){}const _Je=Object.freeze([]),Nl=Object.freeze({});function eP(e){p.useEffect(e,_Je)}const OY={};function Gu(e,t){const n=p.useRef(OY);return n.current===OY&&(n.current=e(t)),n}const jJe=()=>{},Qn=typeof document<"u"?p.useLayoutEffect:jJe;function NJe(e,t){return function(i,...r){const s=new URL(e);return s.searchParams.set("code",i.toString()),r.forEach(a=>s.searchParams.append("args[]",a)),`${t} error #${i}; visit ${s} for the full message.`}}const gc=NJe("https://base-ui.com/production-error","Base UI"),STe=p.createContext(void 0);function QU(){const e=p.useContext(STe);if(!e)throw new Error(gc(73));return e}var ETe={exports:{}},CTe={};/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -135,343 +135,343 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...a?{snapshot:!0}:{}})}`)}(t.type== * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var eP=p,EJe=pI;function CJe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var TJe=typeof Object.is=="function"?Object.is:CJe,AJe=EJe.useSyncExternalStore,_Je=eP.useRef,jJe=eP.useEffect,NJe=eP.useMemo,RJe=eP.useDebugValue;vTe.useSyncExternalStoreWithSelector=function(e,t,n,i,r){var s=_Je(null);if(s.current===null){var a={hasValue:!1,value:null};s.current=a}else a=s.current;s=NJe(function(){function c(m){if(!u){if(u=!0,d=m,m=i(m),r!==void 0&&a.hasValue){var g=a.value;if(r(g,m))return f=g}return f=m}if(g=f,TJe(d,m))return g;var b=i(m);return r!==void 0&&r(g,b)?(d=m,g):(d=m,f=b)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,i,r]);var l=AJe(e,s[0],s[1]);return jJe(function(){a.hasValue=!0,a.value=l},[l]),RJe(l),l};yTe.exports=vTe;var xTe=yTe.exports;const IJe=_w(xTe),PJe=parseInt(p.version,10);function zU(e){return PJe>=e}const DJe=zU(19),MJe=DJe?$Je:FJe;function wTe(e,t,n,i,r){return MJe(e,t,n,i,r)}function LJe(e,t,n,i,r){const s=p.useCallback(()=>t(e.getSnapshot(),n,i,r),[e,t,n,i,r]);return pI.useSyncExternalStore(e.subscribe,s,s)}function $Je(e,t,n,i,r){return LJe(e,t,n,i,r)}function FJe(e,t,n,i,r){return xTe.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,i,r))}class BJe{constructor(t){Jt(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Jt(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const i of this.listeners){if(n!==this.updateTick)return;i(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,i,r){return wTe(this,t,n,i,r)}}const VU={...Fy},V5=VU.useInsertionEffect,UJe=V5&&V5!==VU.useLayoutEffect?V5:e=>e();function Hn(e){const t=Xu(QJe).current;return t.next=e,UJe(t.effect),t.trampoline}function QJe(){const e={next:void 0,callback:zJe,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function zJe(){}class tP extends BJe{constructor(t,n={},i){super(t),this.context=n,this.selectors=i}useSyncedValue(t,n){p.useDebugValue(t);const i=this;Fn(()=>{i.state[t]!==n&&i.set(t,n)},[i,t,n])}useSyncedValueWithCleanup(t,n){const i=this;Fn(()=>(i.state[t]!==n&&i.set(t,n),()=>{i.set(t,void 0)}),[i,t,n])}useSyncedValues(t){const n=this,i=Object.values(t);Fn(()=>{n.update(t)},[n,...i])}useControlledProp(t,n){p.useDebugValue(t);const i=this,r=n!==void 0;Fn(()=>{r&&!Object.is(i.state[t],n)&&i.setState({...i.state,[t]:n})},[i,t,n,r])}select(t,n,i,r){const s=this.selectors[t];return s(this.state,n,i,r)}useState(t,n,i,r){return p.useDebugValue(t),wTe(this,this.selectors[t],n,i,r)}useContextCallback(t,n){p.useDebugValue(t);const i=Hn(n??UU);this.context[t]=i}useStateSetter(t){const n=p.useRef(void 0);return n.current===void 0&&(n.current=i=>{this.set(t,i)}),n.current}observe(t,n){let i;typeof t=="function"?i=t:i=this.selectors[t];let r=i(this.state);return n(r,r,this),this.subscribe(s=>{const a=i(s);if(!Object.is(r,a)){const l=r;r=a,n(a,l,this)}})}}function nP(){return typeof window<"u"}function Va(e){return HU(e)?(e.nodeName||"").toLowerCase():"#document"}function Vs(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ep(e){var t;return(t=(HU(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function HU(e){return nP()?e instanceof Node||e instanceof Vs(e).Node:!1}function lr(e){return nP()?e instanceof Element||e instanceof Vs(e).Element:!1}function Qs(e){return nP()?e instanceof HTMLElement||e instanceof Vs(e).HTMLElement:!1}function Yx(e){return!nP()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Vs(e).ShadowRoot}function CC(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=du(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&r!=="inline"&&r!=="contents"}function VJe(e){return/^(table|td|th)$/.test(Va(e))}function iP(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const HJe=/transform|translate|scale|rotate|perspective|filter/,qJe=/paint|layout|strict|content/,nb=e=>!!e&&e!=="none";let H5;function qU(e){const t=lr(e)?du(e):e;return nb(t.transform)||nb(t.translate)||nb(t.scale)||nb(t.rotate)||nb(t.perspective)||!WU()&&(nb(t.backdropFilter)||nb(t.filter))||HJe.test(t.willChange||"")||qJe.test(t.contain||"")}function WJe(e){let t=rg(e);for(;Qs(t)&&!zm(t);){if(qU(t))return t;if(iP(t))return null;t=rg(t)}return null}function WU(){return H5==null&&(H5=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),H5}function zm(e){return/^(html|body|#document)$/.test(Va(e))}function du(e){return Vs(e).getComputedStyle(e)}function rP(e){return lr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function rg(e){if(Va(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Yx(e)&&e.host||Ep(e);return Yx(t)?t.host:t}function OTe(e){const t=rg(e);return zm(t)?(e.ownerDocument||e).body:Qs(t)&&CC(t)?t:OTe(t)}function qS(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=OTe(e),s=r===((i=e.ownerDocument)==null?void 0:i.body),a=Vs(r);if(s){const l=rF(a);return t.concat(a,a.visualViewport||[],CC(r)?r:[],l&&n?qS(l):[])}else return t.concat(r,qS(r,[],n))}function rF(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function If(...e){return()=>{for(let t=0;t{e.removeEventListener(t,n,i)}}const T2=null;let KJe=class{constructor(){Jt(this,"callbacks",[]);Jt(this,"callbacksCount",0);Jt(this,"nextId",1);Jt(this,"startId",1);Jt(this,"isScheduled",!1);Jt(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)}},A2=new KJe;class Jl{constructor(){Jt(this,"currentId",T2);Jt(this,"cancel",()=>{this.currentId!==T2&&(A2.cancel(this.currentId),this.currentId=T2)});Jt(this,"disposeEffect",()=>this.cancel)}static create(){return new Jl}static request(t){return A2.request(t)}static cancel(t){return A2.cancel(t)}request(t){this.cancel(),this.currentId=A2.request(()=>{this.currentId=T2,t()})}}function KU(){const e=Xu(Jl.create).current;return JI(e.disposeEffect),e}const oO=0;class fu{constructor(){Jt(this,"currentId",oO);Jt(this,"clear",()=>{this.currentId!==oO&&(clearTimeout(this.currentId),this.currentId=oO)});Jt(this,"disposeEffect",()=>this.clear)}static create(){return new fu}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=oO,n()},t)}isStarted(){return this.currentId!==oO}}function by(){const e=Xu(fu.create).current;return JI(e.disposeEffect),e}let kY=0;function GJe(e){return kY+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${kY}`}function q5(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}function XJe(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:YJe,platform:ZJe,maxTouchPoints:JJe}=XJe(),sP=YJe.toLowerCase(),WS=ZJe.toLowerCase(),oP=/^i(os$|p)/.test(WS)||WS==="macintel"&&JJe>1,SY="android",sF=WS===SY||sP.includes(SY),eet=!oP&&WS.startsWith("mac");WS.startsWith("win");const tet=eet||oP;var xle;const Vw=typeof CSS<"u"&&!!((xle=CSS.supports)!=null&&xle.call(CSS,"-webkit-backdrop-filter:none"));!Vw&&sP.includes("firefox");!Vw&&sP.includes("chrom");const net=tet,kTe=/jsdom|happydom/.test(sP),oF="data-base-ui-focusable",STe="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Yl(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function Qn(e,t){var i;if(!e||!t)return!1;const n=(i=t.getRootNode)==null?void 0:i.call(t);if(e.contains(t))return!0;if(n&&Yx(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function ea(e){return"composedPath"in e?e.composedPath()[0]:e.target}function ETe(e,t){if(!lr(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,i]of t.entries())if(Qn(i,n))return!i.hasAttribute("data-trigger-disabled");return!1}function W5(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function iet(e){return e.matches("html,body")}function GU(e){return Qs(e)&&e.matches(STe)}function ret(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${STe}`))!=null}function EY(e){return e?e.getAttribute("role")==="combobox"&&GU(e):!1}function aF(e){if(!e||kTe)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function CY(e){return e?e.hasAttribute(oF)?e:e.querySelector(`[${oF}]`)||e:null}function sg(e,t,n=!0){return e.filter(r=>r.parentId===t).flatMap(r=>{var s;return[...!n||(s=r.context)!=null&&s.open?[r]:[],...sg(e,r.id,n)]})}function TY(e,t){var r;let n=[],i=(r=e.find(s=>s.id===t))==null?void 0:r.parentId;for(;i;){const s=e.find(a=>a.id===i);i=s==null?void 0:s.parentId,s&&(n=n.concat(s))}return n}function set(e){e.preventDefault(),e.stopPropagation()}function oet(e){return"nativeEvent"in e}function aet(e){return e.pointerType===""&&e.isTrusted?!0:sF&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function CTe(e){return kTe?!1:!sF&&e.width===0&&e.height===0||sF&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function rx(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function cet(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const uet=["top","right","bottom","left"],og=Math.min,qh=Math.max,SN=Math.round,_2=Math.floor,Wh=e=>({x:e,y:e}),det={left:"right",right:"left",bottom:"top",top:"bottom"};function XU(e,t,n){return qh(e,og(t,n))}function $f(e,t){return typeof e=="function"?e(t):e}function Hu(e){return e.split("-")[0]}function Cp(e){return e.split("-")[1]}function YU(e){return e==="x"?"y":"x"}function aP(e){return e==="y"?"height":"width"}function Lu(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function lP(e){return YU(Lu(e))}function fet(e,t,n){n===void 0&&(n=!1);const i=Cp(e),r=lP(e),s=aP(r);let a=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=EN(a)),[a,EN(a)]}function het(e){const t=EN(e);return[lF(e),t,lF(t)]}function lF(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const AY=["left","right"],_Y=["right","left"],pet=["top","bottom"],met=["bottom","top"];function get(e,t,n){switch(e){case"top":case"bottom":return n?t?_Y:AY:t?AY:_Y;case"left":case"right":return t?pet:met;default:return[]}}function bet(e,t,n,i){const r=Cp(e);let s=get(Hu(e),n==="start",i);return r&&(s=s.map(a=>a+"-"+r),t&&(s=s.concat(s.map(lF)))),s}function EN(e){const t=Hu(e);return det[t]+e.slice(t.length)}function yet(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 ZU(e){return typeof e!="number"?yet(e):{top:e,right:e,bottom:e,left:e}}function CN(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 vet(e){return e.visibility==="hidden"||e.visibility==="collapse"}function TTe(e,t=e?du(e):null){return!e||!e.isConnected||!t||vet(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const xet='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function wet(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Yx(n)?n.host:null}function cF(e){for(const t of Array.from(e.children))if(Va(t)==="summary")return t;return null}function Oet(e,t){const n=cF(t);return!!n&&(e===n||Qn(n,e))}function ATe(e){const t=e?Va(e):"";return e!=null&&e.matches(xet)&&(t!=="summary"||e.parentElement!=null&&Va(e.parentElement)==="details"&&cF(e.parentElement)===e)&&(t!=="details"||cF(e)==null)&&(t!=="input"||e.type!=="hidden")}function _Te(e){if(!ATe(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=wet(t)){const n=t!==e,i=Va(t)==="slot";if(t.hasAttribute("inert")||n&&Va(t)==="details"&&!t.open&&!Oet(e,t)||t.hasAttribute("hidden")||!i&&!ket(t,n))return!1}return!0}function ket(e,t){const n=du(e);return t?n.display!=="none":TTe(e,n)}function jTe(e){const t=e.tabIndex;if(t<0){const n=Va(e);if(n==="details"||n==="audio"||n==="video"||Qs(e)&&e.isContentEditable)return 0}return t}function K5(e){if(Va(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function Eet(e,t){const n=K5(e);if(!n)return!0;const i=t.find(r=>{const s=K5(r);return(s==null?void 0:s.name)===n.name&&s.form===n.form&&s.checked});return i?i===n:t.find(r=>{const s=K5(r);return(s==null?void 0:s.name)===n.name&&s.form===n.form})===n}function NTe(e){if(Qs(e)&&Va(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Qs(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function RTe(e,t){NTe(e).forEach(n=>{ATe(n)&&t.push(n),RTe(n,t)})}function ITe(e,t,n){NTe(e).forEach(i=>{Qs(i)&&i.matches(t)&&n.push(i),ITe(i,t,n)})}function JU(e){return _Te(e)&&jTe(e)>=0}function PTe(e){const t=[];return RTe(e,t),t.filter(_Te)}function TC(e){const t=PTe(e);return t.filter(n=>jTe(n)>=0&&Eet(n,t))}function DTe(e,t){const n=TC(e),i=n.length;if(i===0)return;const r=Yl(or(e)),s=n.indexOf(r),a=s===-1?t===1?0:i-1:s+t;return n[a]}function eQ(e){return DTe(or(e).body,1)||e}function MTe(e){return DTe(or(e).body,-1)||e}function LTe(e,t){if(!e)return null;const n=TC(or(e).body),i=n.length;if(i===0)return null;const r=n.indexOf(e);if(r===-1)return null;const s=(r+t+i)%i;return n[s]}function Cet(e){return LTe(e,1)}function Tet(e){return LTe(e,-1)}function sx(e,t){const n=t||e.currentTarget,i=e.relatedTarget;return!i||!Qn(n,i)}function Aet(e){TC(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function jY(e){const t=[];ITe(e,"[data-tabindex]",t),t.forEach(n=>{const i=n.dataset.tabindex;delete n.dataset.tabindex,i?n.setAttribute("tabindex",i):n.removeAttribute("tabindex")})}function G5(e){const t=new Map;let n=0,i=0;return e.forEach((r,s)=>{const a=r.transitionStatus==="ending";t.set(r.id,{value:r,domIndex:s,visibleIndex:a?-1:n,offsetY:i}),i+=r.height||0,a||(n+=1)}),t}function X5(e,t){let n=0;return e.map(i=>{if(i.transitionStatus==="ending")return i;const r=n>=t;return n+=1,i.limited===r?i:{...i,limited:r}})}const tf={toasts:e=>e.toasts,isEmpty:e=>e.toasts.length===0,toast:(e,t)=>{var n;return(n=e.toastMetadata.get(t))==null?void 0:n.value},toastIndex:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.domIndex)??-1},toastOffsetY:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.offsetY)??0},toastVisibleIndex:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.visibleIndex)??-1},focused:e=>e.focused,expanded:e=>e.hovering||e.focused,expandedOrOutOfFocus:e=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:e=>e.prevFocusElement};class _et extends tP{constructor(n){super({...n,toastMetadata:G5(n.toasts)},{},tf);Jt(this,"timers",new Map);Jt(this,"areTimersPaused",!1);Jt(this,"setViewport",n=>{this.set("viewport",n)});Jt(this,"disposeEffect",()=>()=>{this.timers.forEach(n=>{var i;(i=n.timeout)==null||i.clear()}),this.timers.clear()});Jt(this,"addToast",n=>{const{timeout:i,limit:r}=this.state,s=n.id||GJe("toast");if(n.id){const u=tf.toast(this.state,n.id);if(u)if(u.transitionStatus==="ending")this.removeToast(n.id,!0);else{const{id:d,transitionStatus:f,...h}=n;return this.updateToastInternal(n.id,h,!0,!0),n.id}}const a={...n,id:s,updateKey:0,transitionStatus:"starting"},l=[a,...this.state.toasts];this.setToasts(X5(l,r));const c=a.timeout??i;return a.type!=="loading"&&c>0&&this.scheduleTimer(s,c,()=>this.closeToast(s)),tf.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),s});Jt(this,"updateToast",(n,i)=>{this.updateToastInternal(n,i,!1,!0)});Jt(this,"updateToastInternal",(n,i,r=!1,s=!1)=>{const{timeout:a,toasts:l}=this.state,c=tf.toast(this.state,n);if(!c||c.transitionStatus==="ending")return;const u={...c,...i,...s&&{updateKey:c.updateKey+1}};this.setToasts(l.map(y=>y.id===n?u:y));const d=u.timeout??a,f=c.timeout??a,h=Object.hasOwn(i,"timeout"),m=u.transitionStatus!=="ending"&&u.type!=="loading"&&d>0,g=this.timers.has(n),b=f!==d,v=c.type==="loading";if(!m&&g){this.clearTimer(n);return}m&&(!g||b||h||v||r)&&(this.clearTimer(n),this.scheduleTimer(n,d,()=>this.closeToast(n)),tf.expandedOrOutOfFocus(this.state)&&this.pauseTimers())});Jt(this,"closeToast",n=>{const i=n===void 0,{limit:r,toasts:s}=this.state;let a;if(i)a=s,this.clearTimers();else{const u=tf.toast(this.state,n);if(!u)return;a=[u],this.clearTimer(n)}const l=s.map(u=>i||u.id===n?{...u,transitionStatus:"ending",height:0}:u),c=X5(l,r);this.setToasts(c,!c.some(u=>u.transitionStatus!=="ending")),a.forEach(u=>{var d;u.transitionStatus!=="ending"&&((d=u.onClose)==null||d.call(u))}),this.handleFocusManagement(n)});Jt(this,"promiseToast",(n,i)=>{const r=q5(i.loading),s=this.addToast({...r,type:"loading"}),a=n.then(l=>{const c=q5(i.success,l);return this.updateToast(s,{...c,type:"success",timeout:c.timeout}),l}).catch(l=>{const c=q5(i.error,l);return this.updateToast(s,{...c,type:"error",timeout:c.timeout}),Promise.reject(l)});return{}.hasOwnProperty.call(i,"setPromise")&&i.setPromise(a),a});Jt(this,"handleDocumentPointerDown",n=>{if(n.pointerType!=="touch")return;const i=ea(n);Qn(this.state.viewport,i)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))})}syncProviderProps(n,i){const r=this.state.limit!==i;if(this.state.timeout===n&&!r)return;const s={timeout:n,limit:i};if(r){const a=X5(this.state.toasts,i);s.toasts=a,s.toastMetadata=G5(a)}this.update(s)}removeToast(n,i=!1){var l;const r=tf.toastIndex(this.state,n);if(r===-1)return;const s=this.state.toasts[r];i||(l=s==null?void 0:s.onRemove)==null||l.call(s);const a=[...this.state.toasts];a.splice(r,1),this.setToasts(a)}pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(n=>{n.timeout&&(n.timeout.clear(),n.remaining=Math.max(n.remaining-(Date.now()-n.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((n,i)=>{n.remaining=n.remaining>0?n.remaining:n.delay,n.timeout??(n.timeout=fu.create()),n.timeout.start(n.remaining,()=>{this.handleTimerFired(i),n.callback()}),n.start=Date.now()}))}restoreFocusToPrevElement(){var n;(n=this.state.prevFocusElement)==null||n.focus({preventScroll:!0})}scheduleTimer(n,i,r){const s=Date.now(),l=!tf.expandedOrOutOfFocus(this.state)?fu.create():void 0;l==null||l.start(i,()=>{this.handleTimerFired(n),r()}),this.timers.set(n,{timeout:l,start:s,delay:i,remaining:i,callback:r})}clearTimers(){this.timers.forEach(n=>{var i;(i=n.timeout)==null||i.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(n){var r;const i=this.timers.get(n);(r=i==null?void 0:i.timeout)==null||r.clear(),this.timers.delete(n),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(n){this.timers.delete(n),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(n,i=n.length===0){const r={toasts:n,toastMetadata:G5(n)};i&&(r.hovering=!1,r.focused=!1),this.update(r)}handleFocusManagement(n){var c,u;const i=Yl(or(this.state.viewport));if(!this.state.viewport||!Qn(this.state.viewport,i)||!aF(i))return;if(n===void 0){this.restoreFocusToPrevElement();return}const r=tf.toasts(this.state),s=tf.toastIndex(this.state,n),a=(d,f)=>{for(let h=d;h>=0&&hnew _et({timeout:i,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return JI(a.disposeEffect),p.useEffect(function(){return s?s[" subscribe"](({action:u,options:d})=>{const f=d.id;u==="promise"&&d.promise?a.promiseToast(d.promise,d):u==="update"&&f?a.updateToast(f,d):u==="close"?a.closeToast(f):a.addToast(d)}):void 0},[a,s]),o.jsxs(bTe.Provider,{value:a,children:[o.jsx(Net,{store:a,timeout:i,limit:r}),n]})};function Net(e){const{store:t,timeout:n,limit:i}=e;return Fn(()=>{t.syncProviderProps(n,i)},[t,n,i]),null}const Ret={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},$Te={...Ret,position:"fixed",top:0,left:0},yy=p.forwardRef(function(t,n){const[i,r]=p.useState();Fn(()=>{net&&Vw&&r("button")},[]);const s={tabIndex:0,role:i};return o.jsx("span",{...t,ref:n,style:$Te,"aria-hidden":i?void 0:!0,...s,"data-base-ui-focus-guard":""})});function Zx(e,t,n,i){const r=Xu(FTe).current;return Pet(r,e,t,n,i)&&BTe(r,[e,t,n,i]),r.callback}function Iet(e){const t=Xu(FTe).current;return Det(t,e)&&BTe(t,e),t.callback}function FTe(){return{callback:null,cleanup:null,refs:[]}}function Pet(e,t,n,i,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==i||e.refs[3]!==r}function Det(e,t){return e.refs.length!==t.length||e.refs.some((n,i)=>n!==t[i])}function BTe(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=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function iQ(e){return typeof e=="function"}function zTe(e,t){return iQ(e)?e(t):e??tQ}function Uet(e,t){return t?e?(...n)=>{const i=n[0];if(qTe(i)){const s=i;AN(s);const a=t(...n);return s.baseUIHandlerPrevented||e==null||e(...n),a}const r=t(...n);return e==null||e(...n),r}:VTe(t):e}function VTe(e){return e&&((...t)=>{const n=t[0];return qTe(n)&&AN(n),e(...t)})}function AN(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function HTe(e,t){return t?e?t+" "+e:t:e}function qTe(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Oo(e,t,n={}){const i=t.render,r=Qet(t,n);if(n.enabled===!1)return null;const s=n.state??_l;return Het(e,i,r,s)}function Qet(e,t={}){const{className:n,style:i,render:r}=e,{state:s=_l,ref:a,props:l,stateAttributesMapping:c,enabled:u=!0}=t,d=u?Let(n,s):void 0,f=u?UTe(i,s):void 0,h=u?Met(s,c):_l,m=u&&l?zet(l):void 0,g=u?uF(h,m)??{}:_l;return typeof document<"u"&&(u?Array.isArray(a)?g.ref=Iet([g.ref,NY(r),...a]):g.ref=Zx(g.ref,NY(r),a):Zx(null,null)),u?(d!==void 0&&(g.className=HTe(g.className,d)),f!==void 0&&(g.style=uF(g.style,f)),g):_l}function zet(e){return Array.isArray(e)?$et(e):nQ(void 0,e)}const Vet=Symbol.for("react.lazy");function Het(e,t,n,i){if(t){if(typeof t=="function")return t(n,i);const r=nQ(n,t.props);r.ref=n.ref;let s=t;return(s==null?void 0:s.$$typeof)===Vet&&(s=p.Children.toArray(t)[0]),p.cloneElement(s,r)}if(e&&typeof e=="string")return qet(e,n);throw new Error(mc(8))}function qet(e,t){return e==="button"?p.createElement("button",{type:"button",...t,key:t.key}):e==="img"?p.createElement("img",{alt:"",...t,key:t.key}):p.createElement(e,t)}const Wet=p.forwardRef(function(t,n){var B;const{render:i,className:r,style:s,children:a,...l}=t,c=QU(),u=by(),d=p.useRef(!1),f=p.useRef(!1),h=p.useRef(!1),m=c.useState("isEmpty"),g=c.useState("toasts"),b=c.useState("focused"),v=c.useState("expanded"),y=c.useState("prevFocusElement"),w=(B=g[0])==null?void 0:B.height,x=g.some(I=>I.transitionStatus==="ending"),O=g.filter(I=>I.priority==="high");p.useEffect(()=>{const I=c.state.viewport;if(!I||m)return;const z=Vs(I),K=or(I);function F(X){X.key==="F6"&&ea(X)!==I&&(X.preventDefault(),c.set("prevFocusElement",Yl(K)),I==null||I.focus({preventScroll:!0}),c.pauseTimers(),c.set("focused",!0))}function q(X){ea(X)===z&&(c.set("isWindowFocused",!1),c.pauseTimers())}function H(X){if(X.relatedTarget)return;const ne=ea(X),Q=Yl(or(I));(ne===z||!Qn(I,ne)||!aF(Q))&&c.resumeTimers(),u.start(0,()=>c.set("isWindowFocused",!0))}return If(vi(z,"keydown",F),vi(z,"blur",q,!0),vi(z,"focus",H,!0),vi(K,"pointerdown",c.handleDocumentPointerDown,!0))},[c,u,m]);function S(I){var K,F;d.current=!0;const z=I.relatedTarget===c.state.viewport?g.find(q=>q.transitionStatus!=="ending"&&!q.limited):void 0;z?(F=(K=z.ref)==null?void 0:K.current)==null||F.focus():c.restoreFocusToPrevElement()}function k(I){I.key==="Tab"&&I.shiftKey&&ea(I.nativeEvent)===c.state.viewport&&(I.preventDefault(),c.restoreFocusToPrevElement())}function C(){c.state.toasts.some(z=>z.transitionStatus==="ending")||h.current||!f.current||(c.state.isWindowFocused&&c.resumeTimers(),c.set("hovering",!1),f.current=!1)}p.useEffect(C,[x,c]);function E(){c.pauseTimers(),c.set("hovering",!0),f.current=!1}function R(){c.state.isWindowFocused&&c.resumeTimers()}function A(){f.current=!0,C()}function j(I){I.pointerType==="touch"&&(h.current=!0)}function T(I){I.pointerType==="touch"&&(h.current=!1,C())}function N(){if(d.current){d.current=!1;return}b||aF(Yl(or(c.state.viewport)))&&(c.set("focused",!0),c.pauseTimers())}function _(I){!b||Qn(c.state.viewport,I.relatedTarget)||(c.set("focused",!1),R())}const D={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:E,onMouseMove:E,onMouseLeave:A,onFocus:N,onBlur:_,onKeyDown:k,onClick:N,onPointerDown:j,onPointerUp:T,onPointerCancel:T,style:{"--toast-frontmost-height":w?`${w}px`:void 0}},M={expanded:v},P=!m&&y&&o.jsx(yy,{onFocus:S}),L=Oo("div",t,{ref:[n,c.setViewport],state:M,props:[D,l,{children:o.jsxs(p.Fragment,{children:[P,a,P]})}]});return o.jsxs(p.Fragment,{children:[P,L,!b&&O.length>0&&o.jsx("div",{style:$Te,children:O.map(I=>o.jsxs("div",{role:"alert","aria-atomic":!0,children:[o.jsx("div",{children:I.title}),o.jsx("div",{children:I.description})]},I.id))})]})});function rQ(e){return zU(19)?e:e?"true":void 0}const WTe=p.createContext(void 0);function Ket(){const e=p.useContext(WTe);if(!e)throw new Error(mc(66));return e}let _N=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const Get={"data-starting-style":""},Xet={"data-ending-style":""},cP={transitionStatus(e){return e==="starting"?Get:e==="ending"?Xet:null}};function gh(e){return e==null?e:"current"in e?e.current:e}function sQ(e,t=!1){const n=KU();return Hn((i,r=null)=>{n.cancel();const s=gh(e);if(s==null)return;const a=s,l=()=>{si.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 AC(e){const{enabled:t=!0,open:n,ref:i,onComplete:r}=e,s=Hn(r),a=sQ(i,n);p.useEffect(()=>{if(!t)return;const l=new AbortController;return a(s,l.signal),()=>{l.abort()}},[t,n,s,a])}const Yet=500,Zet={style:{transition:"none"}},oQ="data-base-ui-click-trigger",Jet="data-base-ui-swipe-ignore",ett="data-swipe-ignore",ttt=`[${Jet}]`,ntt=`[${ett}]`,itt={fallbackAxisSide:"end"},rtt={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Y5(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function stt(e){const n=Vs(e).getComputedStyle(e).transform;let i=0,r=0,s=1;if(n&&n!=="none"){const a=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(a){const l=a[1].split(", ").map(parseFloat);l.length===6?(i=l[4],r=l[5],s=Math.sqrt(l[0]*l[0]+l[1]*l[1])):l.length===16&&(i=l[12],r=l[13],s=l[0])}}return{x:i,y:r,scale:s}}const ott={...cP,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},RY=40,att=10,IY=.5,ltt=1,ctt=`${ttt},${ntt}`,utt=p.forwardRef(function(t,n){var Qe;const{toast:i,render:r,className:s,swipeDirection:a=["down","right"],style:l,...c}=t,u=((Qe=i.positionerProps)==null?void 0:Qe.anchor)!==void 0;let d=[];u||(d=Array.isArray(a)?a:[a]);const f=d.length>0,h=QU(),[m,g]=p.useState(void 0),[b,v]=p.useState(!1),[y,w]=p.useState(!1),[x,O]=p.useState({x:0,y:0}),[S,k]=p.useState({x:0,y:0,scale:1}),[C,E]=p.useState(),[R,A]=p.useState(),[j,T]=p.useState(null),N=p.useRef(null),_=p.useRef(void 0),D=p.useRef({x:0,y:0}),M=p.useRef({x:0,y:0,scale:1}),P=p.useRef(void 0),L=p.useRef(0),B=p.useRef(!1),I=p.useRef({x:0,y:0}),z=p.useRef(!1),K=p.useRef({x:0,y:0}),F=p.useRef(null),q=p.useRef(null),H=h.useState("toastIndex",i.id),X=h.useState("toastVisibleIndex",i.id),ne=h.useState("toastOffsetY",i.id),Q=h.useState("focused"),Z=h.useState("expanded");AC({open:i.transitionStatus!=="ending",ref:N,onComplete(){i.transitionStatus==="ending"&&h.removeToast(i.id)}});const ce=Hn((we=!1)=>{const Ne=N.current;if(!Ne)return;const ie=Ne.style.height;Ne.style.height="auto";const fe=Ne.offsetHeight;Ne.style.height=ie;function Se(){h.updateToastInternal(i.id,{ref:N,height:fe,transitionStatus:void 0})}we?si.flushSync(Se):Se()});Fn(()=>{const we=_.current;i.transitionStatus!=="starting"&&we===i.id||(we!==void 0&&(g(void 0),k({x:0,y:0,scale:1}),Ee({x:0,y:0})),_.current=i.id,ce())},[ce,i.id,i.transitionStatus]);function Ee(we){K.current=we,O(we)}Fn(()=>()=>{var we;(we=q.current)==null||we.abort()},[]);function Y(we,Ne){const ie=ke=>ke>0?ke**IY:-(Math.abs(ke)**IY),fe=we>0&&!d.includes("right")||we<0&&!d.includes("left"),Se=Ne>0&&!d.includes("down")||Ne<0&&!d.includes("up");return{x:fe?ie(we):we,y:Se?ie(Ne):Ne}}const G=Hn(we=>{var qe;if(we.pointerId!==F.current)return;F.current=null,(qe=q.current)==null||qe.abort(),q.current=null,v(!1),w(!1),T(null);const Ne=M.current;if(we.type==="pointercancel"||B.current){Ee({x:Ne.x,y:Ne.y}),g(void 0);return}const ie=K.current,fe=ie.x-Ne.x,Se=ie.y-Ne.y;let ke;for(const it of d)if(Y5(it,fe,Se)>RY){ke=it;break}ke?(g(ke),h.closeToast(i.id)):(Ee({x:Ne.x,y:Ne.y}),g(void 0))});function te(we){var it,de;if(we.button!==0)return;we.pointerType==="touch"&&h.pauseTimers();const Ne=ea(we.nativeEvent);if(Ne==null?void 0:Ne.closest(`button,a,input,textarea,[role="button"],${ctt}`))return;B.current=!1,P.current=void 0,L.current=0,F.current=we.pointerId,D.current={x:we.clientX,y:we.clientY},I.current=D.current;const fe=we.currentTarget,Se=stt(fe);M.current=Se,k(Se),Ee({x:Se.x,y:Se.y}),h.set("hovering",!0),v(!0),w(!1),T(null),z.current=!0,(it=q.current)==null||it.abort();const ke=new AbortController;q.current=ke;const qe=or(fe);qe.addEventListener("pointerup",G,{signal:ke.signal}),qe.addEventListener("pointercancel",G,{signal:ke.signal}),(de=fe.setPointerCapture)==null||de.call(fe,we.pointerId)}function ue(we){if(we.pointerId!==F.current)return;we.preventDefault(),z.current&&(D.current={x:we.clientX,y:we.clientY},z.current=!1);const{clientY:Ne,clientX:ie,movementX:fe,movementY:Se}=we;(Se<0&&Ne>I.current.y||Se>0&&NeI.current.x||fe>0&&ie=ltt){w(!0);const Tt=d.includes("left")||d.includes("right"),ft=d.includes("up")||d.includes("down");if(Tt&&ft){const gt=Math.abs(ke),Me=Math.abs(qe);ve=gt>Me?"horizontal":"vertical",T(ve)}}let Te;if(!P.current)ve==="vertical"?qe>0?Te="down":qe<0&&(Te="up"):ve==="horizontal"?ke>0?Te="right":ke<0&&(Te="left"):Math.abs(ke)>=Math.abs(qe)?Te=ke>0?"right":"left":Te=qe>0?"down":"up",Te&&d.includes(Te)&&(P.current=Te,L.current=Y5(Te,ke,qe),g(Te));else{const Ot=P.current,Tt=Y5(Ot,de,it);Tt>RY?(B.current=!1,g(Ot)):!(d.includes("left")&&d.includes("right"))&&!(d.includes("up")&&d.includes("down"))&&L.current-Tt>=att&&(B.current=!0)}const Ke=Y(ke,qe);let $e=M.current.x,At=M.current.y;const Nt=d.includes("left")||d.includes("right"),vt=d.includes("up")||d.includes("down");ve!=="vertical"&&Nt&&($e+=Ke.x),ve!=="horizontal"&&vt&&(At+=Ke.y),Ee({x:$e,y:At})}function Ce(we){if(we.key==="Escape"){if(!N.current||!Qn(N.current,Yl(or(N.current))))return;h.closeToast(i.id)}}p.useEffect(()=>{const we=N.current;if(!f||!we)return;function Ne(ie){F.current===null||!Qn(we,ea(ie))||ie.preventDefault()}return vi(we,"touchmove",Ne,{passive:!1})},[f]);function se(){const we=x.x-S.x,Ne=x.y-S.y;return{transition:b?"none":void 0,transform:b?`translateX(${x.x}px) translateY(${x.y}px) scale(${S.scale})`:void 0,"--toast-swipe-movement-x":`${we}px`,"--toast-swipe-movement-y":`${Ne}px`}}const he=i.priority==="high",ae={role:he?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":C,"aria-describedby":R,"aria-hidden":he&&!Q?!0:void 0,onPointerDown:f?te:void 0,onPointerMove:f?ue:void 0,onPointerUp:f?G:void 0,onPointerCancel:f?G:void 0,onKeyDown:Ce,inert:rQ(i.limited),style:{...se(),"--toast-index":i.transitionStatus==="ending"?H:X,"--toast-offset-y":`${ne}px`,"--toast-height":i.height?`${i.height}px`:void 0}},Ae=p.useMemo(()=>({toast:i,setTitleId:E,setDescriptionId:A,recalculateHeight:ce,visibleIndex:X,expanded:Z}),[i,E,A,ce,X,Z]),De={transitionStatus:i.transitionStatus,expanded:Z,limited:i.limited||!1,type:i.type,swiping:b,swipeDirection:m},ye=Oo("div",t,{ref:[n,N],state:De,stateAttributesMapping:ott,props:[ae,c]});return o.jsx(WTe.Provider,{value:Ae,children:ye})});let PY=0;function dtt(e,t="mui"){const[n,i]=p.useState(e),r=e||n;return p.useEffect(()=>{n==null&&(PY+=1,i(`${t}-${PY}`))},[n,t]),r}const DY=VU.useId;function _C(e,t){if(DY!==void 0){const n=DY();return e??(t?`${t}-${n}`:n)}return dtt(e,t)}function KTe(e){return e==null||typeof e=="boolean"||e===""?!1:Array.isArray(e)?e.some(KTe):!0}function ftt(e){return p.isValidElement(e)&&KTe(e.props.children)}function GTe(e,t,n){const{toast:i,setTitleId:r,setDescriptionId:s}=Ket(),a=n==="title"?r:s,l=t??(n==="title"?i.title:i.description);return{id:_C(e),children:l,type:i.type,setId:a}}function XTe(e,t,n){const i=ftt(e);return Fn(()=>{if(i)return n(t),()=>{n(r=>r===t?void 0:r)}},[i,t,n]),i?e:null}const htt=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:a,children:l,...c}=t,{id:u,children:d,type:f,setId:h}=GTe(a,l,"description"),g=Oo("p",t,{ref:n,state:{type:f},props:{...c,id:u,children:d}});return XTe(g,u,h)}),ptt=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:a,children:l,...c}=t,{id:u,children:d,type:f,setId:h}=GTe(a,l,"title"),g=Oo("h2",t,{ref:n,state:{type:f},props:{...c,id:u,children:d}});return XTe(g,u,h)}),mtt=p.createContext(void 0);function gtt(e=!1){const t=p.useContext(mtt);if(t===void 0&&!e)throw new Error(mc(16));return t}function btt(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:p.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 Z5(e,t,{detail:n=0}={}){e.dispatchEvent(new(Vs(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function uP(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:i=0,native:r=!0,composite:s}=e,a=p.useRef(null),l=gtt(!0),c=s??l!==void 0,{props:u}=btt({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:i,isNativeButton:r}),d=p.useCallback(()=>{const m=a.current;J5(m)&&c&&t&&u.disabled===void 0&&m.disabled&&(m.disabled=!1)},[t,u.disabled,c]);Fn(d,[d]);const f=p.useCallback((m={})=>{const{onClick:g,onMouseDown:b,onKeyUp:v,onKeyDown:y,onPointerDown:w,...x}=m;return nQ({onClick(O){if(t){O.preventDefault();return}g==null||g(O)},onMouseDown(O){t||b==null||b(O)},onKeyDown(O){if(t||(AN(O),y==null||y(O),O.baseUIHandlerPrevented))return;const S=O.target===O.currentTarget,k=O.currentTarget,C=J5(k),E=!r&&ytt(k),R=S&&(r?C:!E),A=O.key==="Enter",j=O.key===" ",T=k.getAttribute("role"),N=(T==null?void 0:T.startsWith("menuitem"))||T==="option"||T==="gridcell";if(S&&c&&j){if(O.defaultPrevented&&N)return;O.preventDefault(),(!r||C)&&(O.preventBaseUIHandler(),Z5(k,O));return}if(!R||r||!j&&!A){S&&E&&j&&O.preventDefault();return}O.defaultPrevented||(O.preventDefault(),A&&(O.preventBaseUIHandler(),Z5(k,O)))},onKeyUp(O){if(!t){if(AN(O),v==null||v(O),O.target===O.currentTarget&&r&&c&&J5(O.currentTarget)&&O.key===" "){O.preventDefault();return}O.baseUIHandlerPrevented||O.target===O.currentTarget&&!r&&!c&&!O.defaultPrevented&&O.key===" "&&(O.preventBaseUIHandler(),Z5(O.currentTarget,O))}},onPointerDown(O){if(t){O.preventDefault();return}w==null||w(O)}},r?{type:"button"}:{role:"button"},u,x)},[t,u,c,r]),h=Hn(m=>{a.current=m,d()});return{getButtonProps:f,buttonRef:h}}function J5(e){return Qs(e)&&e.tagName==="BUTTON"}function ytt(e){return Qs(e)&&e.tagName==="A"&&!!e.href}const YTe="none",Jx="trigger-press",Vc="trigger-hover",ZTe="outside-press",JTe="close-press",KS="focus-out",e2e="escape-key",t2e="imperative-action";function Zs(e,t,n,i){let r=!1,s=!1;const a=_l;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 jN(e){return`data-base-ui-${e}`}const n2e=p.createContext(null),i2e=()=>p.useContext(n2e),vtt=jN("portal");function r2e(e={}){const{ref:t,container:n,componentProps:i=_l,elementProps:r}=e,s=_C(),a=i2e(),l=a==null?void 0:a.portalNode,[c,u]=p.useState(null),[d,f]=p.useState(null),h=Hn(v=>{v!==null&&f(v)}),m=p.useRef(null);Fn(()=>{if(n===null){m.current&&(m.current=null,f(null),u(null));return}const v=(n&&(HU(n)?n:n.current))??l??document.body;if(v==null){m.current&&(m.current=null,f(null),u(null));return}m.current!==v&&(m.current=v,f(null),u(v))},[n,l]);const g=Oo("div",i,{ref:[t,h],props:[{id:s,[vtt]:""},r]}),b=c&&g?si.createPortal(g,c):null;return{node:d,nodeId:p.isValidElement(g)?g.props.id:void 0,subtree:b}}const s2e=p.forwardRef(function(t,n){const{render:i,className:r,style:s,children:a,container:l,...c}=t,{node:u,nodeId:d,subtree:f}=r2e({container:l,ref:n,componentProps:t,elementProps:c}),h=p.useRef(null),m=p.useRef(null),g=p.useRef(null),b=p.useRef(null),[v,y]=p.useState(null),w=p.useRef(!1),x=v==null?void 0:v.modal,O=v==null?void 0:v.open,S=!!v&&!v.modal&&v.open&&!!u;p.useEffect(()=>{if(!u||x)return;function C(E){u&&E.relatedTarget&&sx(E)&&(E.type==="focusin"?w.current&&(jY(u),w.current=!1):(Aet(u),w.current=!0))}return If(vi(u,"focusin",C,!0),vi(u,"focusout",C,!0))},[u,x]),Fn(()=>{!u||O!==!0||!w.current||(jY(u),w.current=!1)},[O,u]);const k=p.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:m,beforeInsideRef:g,afterInsideRef:b,portalNode:u,setFocusManagerState:y}),[u]);return o.jsxs(p.Fragment,{children:[f,o.jsxs(n2e.Provider,{value:k,children:[S&&u&&o.jsx(yy,{"data-type":"outside",ref:h,onFocus:C=>{var E;if(sx(C,u))(E=g.current)==null||E.focus();else{const R=v?v.domReference:null,A=MTe(R);A==null||A.focus()}}}),S&&u&&o.jsx("span",{"aria-owns":d,style:rtt}),u&&si.createPortal(a,u),S&&u&&o.jsx(yy,{"data-type":"outside",ref:m,onFocus:C=>{var E;if(sx(C,u))(E=b.current)==null||E.focus();else{const R=v?v.domReference:null,A=eQ(R);A==null||A.focus(),v!=null&&v.closeOnFocusOut&&(v==null||v.onOpenChange(!1,Zs(KS,C.nativeEvent)))}}})]})]})}),xtt=p.forwardRef(function(t,n){const{children:i,container:r,className:s,render:a,style:l,...c}=t,{node:u,subtree:d}=r2e({container:r,ref:n,componentProps:t,elementProps:c});return!d&&!u?null:o.jsxs(p.Fragment,{children:[d,u&&si.createPortal(i,u)]})}),wtt=p.forwardRef(function(t,n){return o.jsx(xtt,{ref:n,...t})});function El(e){const t=Xu(Ott,e).current;return t.next=e,Fn(t.effect),t}function Ott(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function ktt(e,t){return t!=null&&!rx(t)?0:typeof e=="function"?e():e}function dF(e,t,n){const i=ktt(e,n);return typeof i=="number"?i:i==null?void 0:i[t]}function MY(e){return typeof e=="function"?e():e}function o2e(e,t){return t||e==="click"||e==="mousedown"}function Stt(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}let j2=0;function eL(e,t={}){const{preventScroll:n=!1,sync:i=!1,shouldFocus:r}=t;cancelAnimationFrame(j2);function s(){r&&!r()||e==null||e.focus({preventScroll:n})}if(i)return s(),UU;const a=requestAnimationFrame(s);return j2=a,()=>{j2===a&&(cancelAnimationFrame(a),j2=0)}}const tL={inert:new WeakMap,"aria-hidden":new WeakMap},LY="data-base-ui-inert",fF={inert:new WeakSet,"aria-hidden":new WeakSet};let aO=new WeakMap,nL=0;function Ett(e){return fF[e]}function a2e(e){return e?Yx(e)?e.host:a2e(e.parentNode):null}const $Y=(e,t)=>t.map(n=>{if(e.contains(n))return n;const i=a2e(n);return e.contains(i)?i:null}).filter(n=>n!=null),FY=e=>{const t=new Set;return e.forEach(n=>{let i=n;for(;i&&!t.has(i);)t.add(i),i=i.parentNode}),t},BY=(e,t,n)=>{const i=[],r=s=>{!s||n.has(s)||Array.from(s.children).forEach(a=>{Va(a)!=="script"&&(t.has(a)?r(a):i.push(a))})};return r(e),i};function Ctt(e,t,n,i,{mark:r=!0}){let s=null;i?s="inert":n&&(s="aria-hidden");let a=null,l=null;const c=$Y(t,e),u=r?BY(t,FY(c),new Set(c)):[],d=[],f=[];if(s){const h=tL[s],m=Ett(s);l=m,a=h;const g=$Y(t,Array.from(t.querySelectorAll("[aria-live]"))),b=c.concat(g);BY(t,FY(b),new Set(b)).forEach(y=>{const w=y.getAttribute(s),x=w!==null&&w!=="false",O=(h.get(y)||0)+1;h.set(y,O),d.push(y),O===1&&x&&m.add(y),x||y.setAttribute(s,s==="inert"?"":"true")})}return r&&u.forEach(h=>{const m=(aO.get(h)||0)+1;aO.set(h,m),f.push(h),m===1&&h.setAttribute(LY,"")}),nL+=1,()=>{a&&d.forEach(h=>{const g=(a.get(h)||0)-1;a.set(h,g),g||(!(l!=null&&l.has(h))&&s&&h.removeAttribute(s),l==null||l.delete(h))}),r&&f.forEach(h=>{const m=(aO.get(h)||0)-1;aO.set(h,m),m||h.removeAttribute(LY)}),nL-=1,nL||(tL.inert=new WeakMap,tL["aria-hidden"]=new WeakMap,fF.inert=new WeakSet,fF["aria-hidden"]=new WeakSet,aO=new WeakMap)}}function UY(e,t={}){const{ariaHidden:n=!1,inert:i=!1,mark:r=!0}=t,s=or(e[0]).body;return Ctt(e,s,n,i,{mark:r})}function l2e(){const e=new Map;return{emit(t,n){var i;(i=e.get(t))==null||i.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var i;(i=e.get(t))==null||i.delete(n)}}}class Ttt{constructor(){Jt(this,"nodesRef",{current:[]});Jt(this,"events",l2e())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(i=>i===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const c2e=p.createContext(null),u2e=p.createContext(null),dP=()=>{var e;return((e=p.useContext(c2e))==null?void 0:e.id)||null},Hw=e=>{const t=p.useContext(u2e);return e??t};function Att(e){const t=_C(),n=Hw(e),i=dP();return Fn(()=>{if(!t)return;const r={id:t,parentId:i};return n==null||n.addNode(r),()=>{n==null||n.removeNode(r)}},[n,t,i]),t}function _tt(e){const{children:t,id:n}=e,i=dP();return o.jsx(c2e.Provider,{value:p.useMemo(()=>({id:n,parentId:i}),[n,i]),children:t})}function jtt(e){const{children:t,externalTree:n}=e,i=Xu(()=>n??new Ttt).current;return o.jsx(u2e.Provider,{value:i,children:t})}function Ntt(e,t){const n=Vs(ea(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const QY=20;let Cm=[];function aQ(){Cm=Cm.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function zY(e){aQ(),e&&Va(e)!=="body"&&(Cm.push(new WeakRef(e)),Cm.length>QY&&(Cm=Cm.slice(-QY)))}function VY(){var e;return aQ(),(e=Cm[Cm.length-1])==null?void 0:e.deref()}function Rtt(e){return e?JU(e)?e:TC(e)[0]||e:null}function HY(e){var r;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((r=e.getAttribute("role"))!=null&&r.includes("dialog")))return;const n=PTe(e).filter(s=>{const a=s.getAttribute("data-tabindex")||"";return JU(s)||s.hasAttribute("data-tabindex")&&!a.startsWith("-")}),i=e.getAttribute("tabindex");n.length===0?i!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function d2e(e){const{context:t,children:n,disabled:i=!1,initialFocus:r=!0,returnFocus:s=!0,restoreFocus:a=!1,modal:l=!0,closeOnFocusOut:c=!0,openInteractionType:u="",nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:h,externalTree:m,getInsideElements:g}=e,b="rootStore"in t?t.rootStore:t,v=b.useState("open"),y=b.useState("domReferenceElement"),w=b.useState("floatingElement"),{events:x,dataRef:O}=b.context,S=Hn(()=>{var Y;return(Y=O.current.floatingContext)==null?void 0:Y.nodeId}),k=r===!1,C=EY(y)&&k,E=El(r),R=El(s),A=El(u),j=El(v),T=Hw(m),N=i2e(),_=p.useRef(!1),D=p.useRef(!1),M=p.useRef(!1),P=p.useRef(null),L=p.useRef(""),B=p.useRef(""),I=p.useRef(null),z=p.useRef(null),K=Zx(I,h,N==null?void 0:N.beforeInsideRef),F=Zx(z,N==null?void 0:N.afterInsideRef),q=by(),H=by(),X=KU(),ne=N!=null,Q=CY(w),Z=Hn((Y=Q)=>Y?TC(Y):[]),ce=Hn(()=>(g==null?void 0:g().filter(Y=>Y!=null))??[]);p.useEffect(()=>{if(i||!l)return;function Y(te){te.key==="Tab"&&Qn(Q,Yl(or(Q)))&&Z().length===0&&!C&&set(te)}const G=or(Q);return vi(G,"keydown",Y)},[i,Q,l,C,Z]),p.useEffect(()=>{if(i||!v)return;const Y=or(Q);function G(){M.current=!1}function te(Ce){const se=ea(Ce),he=ce(),ae=Qn(w,se)||Qn(y,se)||Qn(N==null?void 0:N.portalNode,se)||he.some(Ae=>Ae===se||Qn(Ae,se));M.current=!ae,B.current=Ce.pointerType||"keyboard",se!=null&&se.closest(`[${oQ}]`)&&(D.current=!0,H.start(0,()=>{D.current=!1}))}function ue(){B.current="keyboard"}return If(vi(Y,"pointerdown",te,!0),vi(Y,"pointerup",G,!0),vi(Y,"pointercancel",G,!0),vi(Y,"keydown",ue,!0),G)},[i,w,y,Q,v,N,H,ce]),p.useEffect(()=>{if(i||!c)return;const Y=or(Q);function G(){D.current=!0,H.start(0,()=>{D.current=!1})}function te(he){const ae=ea(he);JU(ae)&&(P.current=ae)}function ue(he){const ae=he.relatedTarget,Ae=he.currentTarget,De=ea(he);l&&ae==null&&De!=null&&Qn(w,De)&&zY(De),queueMicrotask(()=>{const ye=S(),Qe=b.context.triggerElements,we=ce(),Ne=(ae==null?void 0:ae.hasAttribute(jN("focus-guard")))&&[I.current,z.current,N==null?void 0:N.beforeInsideRef.current,N==null?void 0:N.afterInsideRef.current,N==null?void 0:N.beforeOutsideRef.current,N==null?void 0:N.afterOutsideRef.current,gh(f),gh(d)].includes(ae),ie=!(Qn(y,ae)||Qn(w,ae)||Qn(ae,w)||Qn(N==null?void 0:N.portalNode,ae)||we.some(fe=>fe===ae||Qn(fe,ae))||Qe.hasMatchingElement(fe=>Qn(fe,ae))||Ne||T&&(sg(T.nodesRef.current,ye).find(fe=>{var Se,ke;return Qn((Se=fe.context)==null?void 0:Se.elements.floating,ae)||Qn((ke=fe.context)==null?void 0:ke.elements.domReference,ae)})||TY(T.nodesRef.current,ye).find(fe=>{var Se,ke,qe;return[(Se=fe.context)==null?void 0:Se.elements.floating,CY((ke=fe.context)==null?void 0:ke.elements.floating)].includes(ae)||((qe=fe.context)==null?void 0:qe.elements.domReference)===ae})));if(Ae===y&&Q&&HY(Q),a&&Ae!==y&&!TTe(De)&&Yl(Y)===Y.body){if(Qs(Q)&&(Q.focus(),a==="popup")){X.request(()=>{Q.focus()});return}const fe=Z(),Se=P.current,ke=(Se&&fe.includes(Se)?Se:null)||fe[fe.length-1]||Q;Qs(ke)&&ke.focus()}if(O.current.insideReactTree){O.current.insideReactTree=!1;return}(C||!l)&&ae&&ie&&!D.current&&(C||ae!==VY())&&(_.current=!0,b.setOpen(!1,Zs(KS,he)))})}function Ce(){M.current||(O.current.insideReactTree=!0,q.start(0,()=>{O.current.insideReactTree=!1}))}const se=Qs(y)?y:null;if(!(!w&&!se))return If(se&&vi(se,"focusout",ue),se&&vi(se,"pointerdown",G),w&&vi(w,"focusin",te),w&&vi(w,"focusout",ue),w&&N&&vi(w,"focusout",Ce,!0))},[i,y,w,Q,l,T,N,b,c,a,Z,C,S,O,q,H,X,d,f,ce]),p.useEffect(()=>{var Ae,De,ye;if(i||!w||!v)return;const Y=Array.from(((Ae=N==null?void 0:N.portalNode)==null?void 0:Ae.querySelectorAll(`[${jN("portal")}]`))||[]),te=(ye=(De=(T?TY(T.nodesRef.current,S()):[]).find(Qe=>{var we;return EY(((we=Qe.context)==null?void 0:we.elements.domReference)||null)}))==null?void 0:De.context)==null?void 0:ye.elements.domReference,Ce=[...[w,...Y,I.current,z.current,N==null?void 0:N.beforeOutsideRef.current,N==null?void 0:N.afterOutsideRef.current,...ce()],te,gh(f),gh(d),C?y:null].filter(Qe=>Qe!=null),se=UY(Ce,{ariaHidden:l||C,mark:!1}),he=[w,...Y].filter(Qe=>Qe!=null),ae=UY(he);return()=>{ae(),se()}},[v,i,y,w,l,N,C,T,S,d,f,ce]),Fn(()=>{if(!v||i||!Qs(Q))return;L.current="",B.current="";const Y=or(Q),G=Yl(Y);queueMicrotask(()=>{const te=E.current,ue=typeof te=="function"?te(A.current||""):te;if(ue===void 0||ue===!1||Qn(Q,G))return;let se=null;const he=()=>(se==null&&(se=Z(Q)),se[0]||Q);let ae;ue===!0||ue===null?ae=he():ae=gh(ue),ae=ae||he();const Ae=Qn(Q,Yl(Y));eL(ae,{preventScroll:ae===Q,shouldFocus(){if(!j.current)return!1;if(Ae)return!0;const De=Yl(Y);return!(De!==ae&&Qn(Q,De))}})})},[i,v,Q,Z,E,A,j]),Fn(()=>{if(i||!Q)return;const Y=or(Q),G=Yl(Y),te=A.current==null;zY(G);function ue(se){if(se.open||(L.current=Ntt(se.nativeEvent,B.current)),se.reason===Vc&&se.nativeEvent.type==="mouseleave"&&(_.current=!0),se.reason===ZTe)if(se.nested)_.current=!1;else if(aet(se.nativeEvent)||CTe(se.nativeEvent))_.current=!1;else{let he=!1;or(Q).createElement("div").focus({get preventScroll(){return he=!0,!1}}),he?_.current=!1:_.current=!0}}x.on("openchange",ue);function Ce(se){const he=R.current;let ae=typeof he=="function"?he(se):he;if(ae===void 0||ae===!1)return null;ae===null&&(ae=!0);const Ae=y!=null&&y.isConnected?y:null,De=G!=null&&G.isConnected&&Va(G)!=="body"?G:null;let ye=te?De||Ae:Ae||De;return ye||(ye=VY()||null),typeof ae=="boolean"?ye:gh(ae)||ye||null}return()=>{x.off("openchange",ue);const se=Yl(Y),he=ce(),ae=Qn(w,se)||he.some(Qe=>Qe===se||Qn(Qe,se))||T&&sg(T.nodesRef.current,S(),!1).some(Qe=>{var we;return Qn((we=Qe.context)==null?void 0:we.elements.floating,se)}),Ae=R.current,De=L.current,ye=Ce(De);queueMicrotask(()=>{const Qe=Rtt(ye),we=typeof Ae!="boolean";if(Ae&&!_.current&&Qs(Qe)&&(!(!we&&Qe!==se&&se!==Y.body)||ae)){const Ne={preventScroll:!0};De==="keyboard"&&(Ne.focusVisible=!0),Qe.focus(Ne)}_.current=!1})}},[i,w,Q,R,A,x,T,y,S,ce]),Fn(()=>{if(!Vw||v||!w)return;const Y=Yl(or(w));!Qs(Y)||!GU(Y)||Qn(w,Y)&&Y.blur()},[v,w]),Fn(()=>{if(!(i||!N))return N.setFocusManagerState({modal:l,closeOnFocusOut:c,open:v,onOpenChange:b.setOpen,domReference:y}),()=>{N.setFocusManagerState(null)}},[i,N,l,v,b,c,y]),Fn(()=>{if(!(i||!Q))return HY(Q),()=>{queueMicrotask(aQ)}},[i,Q]);const Ee=!i&&(l?!C:!0)&&(ne||l);return o.jsxs(p.Fragment,{children:[Ee&&o.jsx(yy,{"data-type":"inside",ref:K,onFocus:Y=>{var G;if(l){const te=Z();eL(te[te.length-1])}else if(N!=null&&N.portalNode)if(_.current=!1,sx(Y,N.portalNode)){const te=eQ(y);te==null||te.focus()}else(G=gh(f??N.beforeOutsideRef))==null||G.focus()}}),n,Ee&&o.jsx(yy,{"data-type":"inside",ref:F,onFocus:Y=>{var G;if(l)eL(Z()[0]);else if(N!=null&&N.portalNode)if(c&&(_.current=!0),sx(Y,N.portalNode)){const te=MTe(y);te==null||te.focus()}else(G=gh(d??N.afterOutsideRef))==null||G.focus()}})]})}function f2e(e,t={}){const{enabled:n=!0,event:i="click",toggle:r=!0,ignoreMouse:s=!1,stickIfOpen:a=!0,touchOpenDelay:l=0,reason:c=Jx}=t,u="rootStore"in e?e.rootStore:e,d=u.context.dataRef,f=p.useRef(void 0),h=KU(),m=by(),g=p.useMemo(()=>{function b(y,w,x,O){const S=Zs(c,w,x);y&&O==="touch"&&l>0?m.start(l,()=>{u.setOpen(!0,S)}):u.setOpen(y,S)}function v(y,w,x){const O=d.current.openEvent,S=u.select("domReferenceElement")!==w;return y&&S||!y||!r?!0:O&&a?!x(O.type):!1}return{onPointerDown(y){f.current=rx(y.pointerType,!0)&&CTe(y.nativeEvent)?"virtual":y.pointerType},onMouseDown(y){const w=f.current,x=y.nativeEvent,O=u.select("open");if(y.button!==0||i==="click"||rx(w,!0)&&s)return;const S=v(O,y.currentTarget,E=>E==="click"||E==="mousedown"),k=ea(x);if(GU(k)){b(S,x,k,w);return}const C=y.currentTarget;h.request(()=>{b(S,x,C,w)})},onClick(y){if(i==="mousedown-only")return;const w=f.current;if(i==="mousedown"&&w){f.current=void 0;return}if(rx(w,!0)&&s)return;const x=u.select("open"),O=v(x,y.currentTarget,S=>S==="click"||S==="mousedown"||S==="keydown"||S==="keyup");b(O,y.nativeEvent,y.currentTarget,w)},onKeyDown(){f.current=void 0}}},[d,i,s,c,u,a,r,h,m,l]);return p.useMemo(()=>n?{reference:g}:_l,[n,g])}function Itt(){return!1}function Ptt(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function h2e(e,t={}){const{enabled:n=!0,escapeKey:i=!0,outsidePress:r=!0,outsidePressEvent:s="sloppy",referencePress:a=Itt,bubbles:l,externalTree:c}=t,u="rootStore"in e?e.rootStore:e,d=u.useState("open"),f=u.useState("floatingElement"),{dataRef:h}=u.context,m=Hw(c),g=Hn(typeof r=="function"?r:()=>!1),b=typeof r=="function"?g:r,v=b!==!1,y=Hn(()=>s),{escapeKey:w,outsidePress:x}=Ptt(l),O=p.useRef(!1),S=p.useRef(!1),k=p.useRef(!1),C=p.useRef(!1),E=p.useRef(""),R=p.useRef(null),A=by(),j=by(),T=Hn(()=>{j.clear(),h.current.insideReactTree=!1}),N=Hn(K=>{var H;const F=(H=h.current.floatingContext)==null?void 0:H.nodeId;return(m?sg(m.nodesRef.current,F):[]).some(X=>{var ne;return((ne=X.context)==null?void 0:ne.open)&&!X.context.dataRef.current[K]})}),_=Hn(K=>W5(K,u.select("floatingElement"))||W5(K,u.select("domReferenceElement"))),D=Hn(K=>{a()&&u.setOpen(!1,Zs(Jx,K.nativeEvent))}),M=Hn(K=>{if(!d||!n||!i||K.key!=="Escape"||C.current||!w&&N("__escapeKeyBubbles"))return;const F=oet(K)?K.nativeEvent:K,q=Zs(e2e,F);u.setOpen(!1,q),q.isCanceled||K.preventDefault(),!w&&!q.isPropagationAllowed&&K.stopPropagation()}),P=Hn(()=>{h.current.insideReactTree=!0,j.start(0,T)}),L=Hn(K=>{if(!d||!n||K.button!==0)return;const F=ea(K.nativeEvent);Qn(u.select("floatingElement"),F)&&(O.current||(O.current=!0,S.current=!1))}),B=Hn(K=>{!d||!n||(K.defaultPrevented||K.nativeEvent.defaultPrevented)&&O.current&&(S.current=!0)});p.useEffect(()=>{if(!d||!n)return T;h.current.__escapeKeyBubbles=w,h.current.__outsidePressBubbles=x;const K=new fu,F=new fu;function q(){K.clear(),C.current=!0}function H(){K.start(Vw?5:0,()=>{C.current=!1})}function X(){k.current=!0,F.start(0,()=>{k.current=!1})}function ne(){O.current=!1,S.current=!1}function Q(){const we=E.current,Ne=we==="pen"||!we?"mouse":we,ie=y(),fe=typeof ie=="function"?ie():ie;return typeof fe=="string"?fe:fe[Ne]}function Z(we){const Ne=Q();return Ne==="intentional"&&we.type!=="click"||Ne==="sloppy"&&we.type==="click"}function ce(we){var fe;const Ne=(fe=h.current.floatingContext)==null?void 0:fe.nodeId,ie=m&&sg(m.nodesRef.current,Ne).some(Se=>{var ke;return W5(we,(ke=Se.context)==null?void 0:ke.elements.floating)});return _(we)||ie}function Ee(we){if(Z(we)){we.type!=="click"&&!_(we)&&(F.clear(),k.current=!1),T();return}if(h.current.insideReactTree){T();return}const Ne=ea(we),ie=`[${jN("inert")}]`,fe=lr(Ne)?Ne.getRootNode():null,Se=Array.from((Yx(fe)?fe:or(u.select("floatingElement"))).querySelectorAll(ie)),ke=u.context.triggerElements;if(Ne&&(ke.hasElement(Ne)||ke.hasMatchingElement(it=>Qn(it,Ne))))return;let qe=lr(Ne)?Ne:null;for(;qe&&!zm(qe);){const it=rg(qe);if(zm(it)||!lr(it))break;qe=it}if(!(Se.length&&lr(Ne)&&!iet(Ne)&&!Qn(Ne,u.select("floatingElement"))&&Se.every(it=>!Qn(qe,it)))){if(Qs(Ne)&&!("touches"in we)){const it=zm(Ne),de=du(Ne),ve=/auto|scroll/,Te=it||ve.test(de.overflowX),Ke=it||ve.test(de.overflowY),$e=Te&&Ne.clientWidth>0&&Ne.scrollWidth>Ne.clientWidth,At=Ke&&Ne.clientHeight>0&&Ne.scrollHeight>Ne.clientHeight,Nt=de.direction==="rtl",vt=At&&(Nt?we.offsetX<=Ne.offsetWidth-Ne.clientWidth:we.offsetX>Ne.clientWidth),Ot=$e&&we.offsetY>Ne.clientHeight;if(vt||Ot)return}if(!ce(we)){if(Q()==="intentional"&&k.current){F.clear(),k.current=!1;return}typeof b=="function"&&!b(we)||N("__outsidePressBubbles")||(u.setOpen(!1,Zs(ZTe,we)),T())}}}function Y(we){Q()!=="sloppy"||we.pointerType==="touch"||!u.select("open")||!n||_(we)||Ee(we)}function G(we){if(Q()!=="sloppy"||!u.select("open")||!n||_(we))return;const Ne=we.touches[0];Ne&&(R.current={startTime:Date.now(),startX:Ne.clientX,startY:Ne.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},A.start(1e3,()=>{R.current&&(R.current.dismissOnTouchEnd=!1,R.current.dismissOnMouseDown=!1)}))}function te(we,Ne){const ie=ea(we);if(!ie)return;const fe=vi(ie,we.type,()=>{Ne(we),fe()})}function ue(we){E.current="touch",te(we,G)}function Ce(we){A.clear(),we.type==="pointerdown"&&(E.current=we.pointerType),!(we.type==="mousedown"&&R.current&&!R.current.dismissOnMouseDown)&&te(we,Ne=>{Ne.type==="pointerdown"?Y(Ne):Ee(Ne)})}function se(we){if(!O.current)return;const Ne=S.current;if(ne(),Q()==="intentional"){if(we.type==="pointercancel"){Ne&&X();return}if(!ce(we)){if(Ne){X();return}typeof b=="function"&&!b(we)||(F.clear(),k.current=!0,T())}}}function he(we){if(Q()!=="sloppy"||!R.current||_(we))return;const Ne=we.touches[0];if(!Ne)return;const ie=Math.abs(Ne.clientX-R.current.startX),fe=Math.abs(Ne.clientY-R.current.startY),Se=Math.sqrt(ie*ie+fe*fe);Se>5&&(R.current.dismissOnTouchEnd=!0),Se>10&&(Ee(we),A.clear(),R.current=null)}function ae(we){te(we,he)}function Ae(we){Q()!=="sloppy"||!R.current||_(we)||(R.current.dismissOnTouchEnd&&Ee(we),A.clear(),R.current=null)}function De(we){te(we,Ae)}const ye=or(f),Qe=If(i&&If(vi(ye,"keydown",M),vi(ye,"compositionstart",q),vi(ye,"compositionend",H)),v&&If(vi(ye,"click",Ce,!0),vi(ye,"pointerdown",Ce,!0),vi(ye,"pointerup",se,!0),vi(ye,"pointercancel",se,!0),vi(ye,"mousedown",Ce,!0),vi(ye,"mouseup",se,!0),vi(ye,"touchstart",ue,!0),vi(ye,"touchmove",ae,!0),vi(ye,"touchend",De,!0)));return()=>{Qe(),K.clear(),F.clear(),ne(),k.current=!1,T()}},[h,f,i,v,b,d,n,w,x,M,T,y,N,_,m,u,A]);const I=p.useMemo(()=>({onKeyDown:M,onPointerDown:D,onClick:D}),[M,D]),z=p.useMemo(()=>({onKeyDown:M,onPointerDown:B,onMouseDown:B,onClickCapture:P,onMouseDownCapture(K){P(),L(K)},onPointerDownCapture(K){P(),L(K)},onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[M,P,L,B]);return p.useMemo(()=>n?{reference:I,floating:z,trigger:I}:{},[n,I,z])}function qY(e,t,n){let{reference:i,floating:r}=e;const s=Lu(t),a=lP(t),l=aP(a),c=Hu(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 m;switch(c){case"top":m={x:d,y:i.y-r.height};break;case"bottom":m={x:d,y:i.y+i.height};break;case"right":m={x:i.x+i.width,y:f};break;case"left":m={x:i.x-r.width,y:f};break;default:m={x:i.x,y:i.y}}const g=Cp(t);return g&&(m[a]+=h*(g==="end"?1:-1)*(n&&u?-1:1)),m}async function Dtt(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:m=0}=$f(t,e),g=ZU(m),v=l[h?f==="floating"?"reference":"floating":f],y=CN(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})),w=f==="floating"?{x:i,y:r,width:a.floating.width,height:a.floating.height}:a.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),O=await(s.isElement==null?void 0:s.isElement(x))&&await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1},S=CN(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:x,strategy:c}):w);return{top:(y.top-S.top+g.top)/O.y,bottom:(S.bottom-y.bottom+g.bottom)/O.y,left:(y.left-S.left+g.left)/O.x,right:(S.right-y.right+g.right)/O.x}}const Mtt=50,Ltt=async(e,t,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:a}=n,l=a.detectOverflow?a:{...a,detectOverflow:Dtt},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}=qY(u,i,c),h=i,m=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}=$f(e,t)||{};if(u==null)return{};const f=ZU(d),h={x:n,y:i},m=lP(r),g=aP(m),b=await a.getDimensions(u),v=m==="y",y=v?"top":"left",w=v?"bottom":"right",x=v?"clientHeight":"clientWidth",O=s.reference[g]+s.reference[m]-h[m]-s.floating[g],S=h[m]-s.reference[m],k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let C=k?k[x]:0;(!C||!await(a.isElement==null?void 0:a.isElement(k)))&&(C=l.floating[x]||s.floating[g]);const E=O/2-S/2,R=C/2-b[g]/2-1,A=og(f[y],R),j=og(f[w],R),T=C-b[g]-j,N=C/2-b[g]/2+E,_=XU(A,N,T),D=!c.arrow&&Cp(r)!=null&&N!==_&&s.reference[g]/2-(N_<=0)){var j,T;const _=(((j=s.flip)==null?void 0:j.index)||0)+1,D=C[_];if(D&&(!(f==="alignment"?w!==Lu(D):!1)||A.every(L=>Lu(L.placement)===w?L.overflows[0]>0:!0)))return{data:{index:_,overflows:A},reset:{placement:D}};let M=(T=A.filter(P=>P.overflows[0]<=0).sort((P,L)=>P.overflows[1]-L.overflows[1])[0])==null?void 0:T.placement;if(!M)switch(m){case"bestFit":{var N;const P=(N=A.filter(L=>{if(k){const B=Lu(L.placement);return B===w||B==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(B=>B>0).reduce((B,I)=>B+I,0)]).sort((L,B)=>L[1]-B[1])[0])==null?void 0:N[0];P&&(M=P);break}case"initialPlacement":M=l;break}if(r!==M)return{reset:{placement:M}}}return{}}}};function WY(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function KY(e){return uet.some(t=>e[t]>=0)}const Btt=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:i}=t,{strategy:r="referenceHidden",...s}=$f(e,t);switch(r){case"referenceHidden":{const a=await i.detectOverflow(t,{...s,elementContext:"reference"}),l=WY(a,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:KY(l)}}}case"escaped":{const a=await i.detectOverflow(t,{...s,altBoundary:!0}),l=WY(a,n.floating);return{data:{escapedOffsets:l,escaped:KY(l)}}}default:return{}}}}},p2e=new Set(["left","top"]);async function Utt(e,t){const{placement:n,platform:i,elements:r}=e,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),a=Hu(n),l=Cp(n),c=Lu(n)==="y",u=p2e.has(a)?-1:1,d=s&&c?-1:1,f=$f(t,e);let{mainAxis:h,crossAxis:m,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"&&(m=l==="end"?g*-1:g),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const Qtt=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 Utt(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}}}}},ztt=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:w=>{let{x,y:O}=w;return{x,y:O}}},...u}=$f(e,t),d={x:n,y:i},f=await s.detectOverflow(t,u),h=Lu(r),m=YU(h);let g=d[m],b=d[h];const v=(w,x)=>XU(x+f[w==="y"?"top":"left"],x,x-f[w==="y"?"bottom":"right"]);a&&(g=v(m,g)),l&&(b=v(h,b));const y=c.fn({...t,[m]:g,[h]:b});return{...y,data:{x:y.x-n,y:y.y-i,enabled:{[m]:a,[h]:l}}}}}},Vtt=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}=$f(e,t),h={x:r,y:s},m=Lu(a),g=YU(m);let b=h[g],v=h[m];const y=$f(u,t),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(n=y.mainAxis)!=null?n:0,crossAxis:(i=y.crossAxis)!=null?i:0};if(d){const S=g==="y"?"height":"width",k=l.reference[g]-l.floating[S]+w.mainAxis,C=l.reference[g]+l.reference[S]-w.mainAxis;bC&&(b=C)}if(f){var x,O;const S=g==="y"?"width":"height",k=p2e.has(Hu(a)),C=l.reference[m]-l.floating[S]+(k&&((x=c.offset)==null?void 0:x[m])||0)+(k?0:w.crossAxis),E=l.reference[m]+l.reference[S]+(k?0:((O=c.offset)==null?void 0:O[m])||0)-(k?w.crossAxis:0);vE&&(v=E)}return{[g]:b,[m]:v}}}},Htt=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}=$f(e,t),c=await r.detectOverflow(t,l),u=Hu(n),d=Cp(n),f=Lu(n)==="y",{width:h,height:m}=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=m-c.top-c.bottom,y=h-c.left-c.right,w=og(m-c[g],v),x=og(h-c[b],y),O=t.middlewareData.shift,S=!O;let k=w,C=x;O!=null&&O.enabled.x&&(C=y),O!=null&&O.enabled.y&&(k=v),S&&!d&&(f?C=h-2*qh(c.left,c.right):k=m-2*qh(c.top,c.bottom)),await a({...t,availableWidth:C,availableHeight:k});const E=await r.getDimensions(s.floating);return h!==E.width||m!==E.height?{reset:{rects:!0}}:{}}}};function m2e(e){const t=du(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=Qs(e),s=r?e.offsetWidth:n,a=r?e.offsetHeight:i,l=SN(n)!==s||SN(i)!==a;return l&&(n=s,i=a),{width:n,height:i,$:l}}function lQ(e){return lr(e)?e:e.contextElement}function ox(e){const t=lQ(e);if(!Qs(t))return Wh(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:s}=m2e(t);let a=(s?SN(n.width):n.width)/i,l=(s?SN(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const qtt=Wh(0);function g2e(e){const t=Vs(e);return!WU()||!t.visualViewport?qtt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Wtt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Vs(e)}function vy(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=lQ(e);let a=Wh(1);t&&(i?lr(i)&&(a=ox(i)):a=ox(e));const l=Wtt(s,n,i)?g2e(s):Wh(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=Vs(s),m=lr(i)?Vs(i):i;let g=h,b=rF(g);for(;b&&m!==g;){const v=ox(b),y=b.getBoundingClientRect(),w=du(b),x=y.left+(b.clientLeft+parseFloat(w.paddingLeft))*v.x,O=y.top+(b.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=x,u+=O,g=Vs(b),b=rF(g)}}return CN({width:d,height:f,x:c,y:u})}function fP(e,t){const n=rP(e).scrollLeft;return t?t.left+n:vy(Ep(e)).left+n}function b2e(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-fP(e,n),r=n.top+t.scrollTop;return{x:i,y:r}}function Ktt(e){let{elements:t,rect:n,offsetParent:i,strategy:r}=e;const s=r==="fixed",a=Ep(i),l=t?iP(t.floating):!1;if(i===a||l&&s)return n;let c={scrollLeft:0,scrollTop:0},u=Wh(1);const d=Wh(0),f=Qs(i);if((f||!s)&&((Va(i)!=="body"||CC(a))&&(c=rP(i)),f)){const m=vy(i);u=ox(i),d.x=m.x+i.clientLeft,d.y=m.y+i.clientTop}const h=a&&!f&&!s?b2e(a,c):Wh(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 Gtt(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Xtt(e){const t=rP(e),n=e.ownerDocument.body,i=qh(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=qh(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+fP(e);const a=-t.scrollTop;return du(n).direction==="rtl"&&(s+=qh(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:a}}const Ytt=25;function Ztt(e,t,n){n===void 0&&(n="viewport");const i=n==="layoutViewport",r=Vs(e),s=Ep(e),a=r.visualViewport;let l=s.clientWidth,c=s.clientHeight,u=0,d=0;if(a){const h=!WU()||t==="fixed";i?h||(u=-a.offsetLeft,d=-a.offsetTop):(l=a.width,c=a.height,h&&(u=a.offsetLeft,d=a.offsetTop))}if(fP(s)<=0){const h=s.ownerDocument,m=h.body,g=getComputedStyle(m),b=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(s.clientWidth-m.clientWidth-b),y=getComputedStyle(s).scrollbarGutter==="stable both-edges"?v/2:v;y<=Ytt&&(l-=y)}return{width:l,height:c,x:u,y:d}}function Jtt(e,t){const n=vy(e,!0,t==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,s=ox(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 GY(e,t,n){let i;if(t==="viewport"||t==="layoutViewport")i=Ztt(e,n,t);else if(t==="document")i=Xtt(Ep(e));else if(lr(t))i=Jtt(t,n);else{const r=g2e(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return CN(i)}function ent(e,t){const n=t.get(e);if(n)return n;let i=qS(e,[],!1).filter(l=>lr(l)&&Va(l)!=="body"),r=null;const s=du(e).position==="fixed";let a=s?rg(e):e;for(;lr(a)&&!zm(a);){const l=du(a),c=qU(a),u=r?r.position:s?"fixed":"";!c&&(u==="fixed"||u==="absolute"&&l.position==="static")?i=i.filter(f=>f!==a):r=l,a=rg(a)}return t.set(e,i),i}function tnt(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const a=[...n==="clippingAncestors"?iP(t)?[]:ent(t,this._c):[].concat(n),i],l=GY(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)}C=!1}try{i=new IntersectionObserver(E,{...k,root:s.ownerDocument})}catch{i=new IntersectionObserver(E,k)}i.observe(e)}const c=Vs(e),u=()=>l(n);return c.addEventListener("resize",u),l(!0),()=>{c.removeEventListener("resize",u),a()}}function hF(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=lQ(e),d=r||s?[...u?qS(u):[],...t?qS(t):[]]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n),s&&y.addEventListener("resize",n)});const f=u&&l?ant(u,n,s):null;let h=-1,m=null;a&&(m=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!c&&m.observe(u),t&&m.observe(t));let g,b=c?vy(e):null;c&&v();function v(){const y=vy(e);b&&!v2e(b,y)&&n(),b=y,g=requestAnimationFrame(v)}return n(),()=>{var y;d.forEach(w=>{r&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const lnt=Qtt,cnt=ztt,unt=Ftt,dnt=Htt,fnt=Btt,YY=$tt,hnt=Vtt,pnt=(e,t,n)=>{const i=new Map,r=n??{},s={...ont,...r.platform,_c:i};return Ltt(e,t,{...r,platform:s})};var mnt=typeof document<"u",gnt=function(){},z_=mnt?p.useLayoutEffect:gnt;function NN(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(!NN(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)&&!NN(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function x2e(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ZY(e,t){const n=x2e(e);return Math.round(t*n)/n}function rL(e){const t=p.useRef(e);return z_(()=>{t.current=e}),t}function w2e(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]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(i);NN(h,i)||m(i);const[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useCallback(L=>{L!==k.current&&(k.current=L,b(L))},[]),x=p.useCallback(L=>{L!==C.current&&(C.current=L,y(L))},[]),O=s||g,S=a||v,k=p.useRef(null),C=p.useRef(null),E=p.useRef(d),R=c!=null,A=rL(c),j=rL(r),T=rL(u),N=p.useCallback(()=>{if(!k.current||!C.current)return;const L={placement:t,strategy:n,middleware:h};j.current&&(L.platform=j.current),pnt(k.current,C.current,L).then(B=>{const I={...B,isPositioned:T.current!==!1};_.current&&!NN(E.current,I)&&(E.current=I,si.flushSync(()=>{f(I)}))})},[h,t,n,j,T]);z_(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(L=>({...L,isPositioned:!1})))},[u]);const _=p.useRef(!1);z_(()=>(_.current=!0,()=>{_.current=!1}),[]),z_(()=>{if(O&&(k.current=O),S&&(C.current=S),O&&S){if(A.current)return A.current(O,S,N);N()}},[O,S,N,A,R]);const D=p.useMemo(()=>({reference:k,floating:C,setReference:w,setFloating:x}),[w,x]),M=p.useMemo(()=>({reference:O,floating:S}),[O,S]),P=p.useMemo(()=>{const L={position:n,left:0,top:0};if(!M.floating)return L;const B=ZY(M.floating,d.x),I=ZY(M.floating,d.y);return l?{...L,transform:"translate("+B+"px, "+I+"px)",...x2e(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:I}},[n,l,M.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:N,refs:D,elements:M,floatingStyles:P}),[d,N,D,M,P])}const bnt=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?YY({element:i.current,padding:r}).fn(n):{}:i?YY({element:i,padding:r}).fn(n):{}}}},O2e=(e,t)=>{const n=lnt(e);return{name:n.name,fn:n.fn,options:[e,t]}},k2e=(e,t)=>{const n=cnt(e);return{name:n.name,fn:n.fn,options:[e,t]}},S2e=(e,t)=>({fn:hnt(e).fn,options:[e,t]}),E2e=(e,t)=>{const n=unt(e);return{name:n.name,fn:n.fn,options:[e,t]}},C2e=(e,t)=>{const n=dnt(e);return{name:n.name,fn:n.fn,options:[e,t]}},ynt=(e,t)=>{const n=fnt(e);return{name:n.name,fn:n.fn,options:[e,t]}},vnt=(e,t)=>{const n=bnt(e);return{name:n.name,fn:n.fn,options:[e,t]}},xnt={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class cQ extends tP{constructor(n){const{syncOnly:i,nested:r,onOpenChange:s,triggerElements:a,...l}=n;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:l2e(),nested:r,triggerElements:a},xnt);Jt(this,"syncOpenEvent",(n,i)=>{(!n||!this.state.open||i!=null&&cet(i))&&(this.context.dataRef.current.openEvent=n?i:void 0)});Jt(this,"dispatchOpenChange",(n,i)=>{this.syncOpenEvent(n,i.event);const r={open:n,reason:i.reason,nativeEvent:i.event,nested:this.context.nested,triggerElement:i.trigger};this.context.events.emit("openchange",r)});Jt(this,"setOpen",(n,i)=>{var r,s,a,l;if(this.syncOnly){(s=(r=this.context).onOpenChange)==null||s.call(r,n,i);return}this.dispatchOpenChange(n,i),(l=(a=this.context).onOpenChange)==null||l.call(a,n,i)});this.syncOnly=i}}function wnt(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:i,floatingId:r,nested:s,onOpenChange:a}=e,l=t.useState("open"),c=t.useState("activeTriggerElement"),u=t.useState(n?"popupElement":"positionerElement"),d=t.context.triggerElements,f=a,h=p.useRef(null);i===void 0&&h.current===null&&(h.current=new cQ({open:l,transitionStatus:void 0,referenceElement:c,floatingElement:u,triggerElements:d,onOpenChange:f,floatingId:r,syncOnly:!0,nested:s}));const m=i??h.current;return t.useSyncedValue("floatingId",r),Fn(()=>{const g={open:l,floatingId:r,referenceElement:c,floatingElement:u};lr(c)&&(g.domReferenceElement=c),m.state.positionReference===m.state.referenceElement&&(g.positionReference=c),m.update(g)},[l,r,c,u,m]),m.context.onOpenChange=f,m.context.nested=s,m}function T2e(e,t=!1,n=!1){const[i,r]=p.useState(e&&t?"idle":void 0),[s,a]=p.useState(e);return e&&!s&&(a(!0),r("starting")),!e&&s&&i!=="ending"&&!n&&r("ending"),!e&&!s&&i==="ending"&&r(void 0),Fn(()=>{if(!e&&s&&i!=="ending"&&n){const l=Jl.request(()=>{r("ending")});return()=>{Jl.cancel(l)}}},[e,s,i,n]),Fn(()=>{if(!e||t)return;const l=Jl.request(()=>{r(void 0)});return()=>{Jl.cancel(l)}},[t,e]),Fn(()=>{if(!e||!t)return;e&&s&&i!=="idle"&&r("starting");const l=Jl.request(()=>{r("idle")});return()=>{Jl.cancel(l)}},[t,e,s,i]),{mounted:s,setMounted:a,transitionStatus:i}}const A2e={tabIndex:-1,[oF]:""};function _2e(e){return t=>t==="touch"?e.current:!0}function j2e(e,t=!1){const n=_C(),i=dP()!=null,r=Xu(()=>e(n,i)).current;return wnt({popupStore:r,treatPopupAsFloatingElement:t,floatingRootContext:r.state.floatingRootContext,floatingId:n,nested:i,onOpenChange:r.setOpen}),r}function N2e({handle:e,store:t}){return Fn(()=>e.attachStore(t),[e,t]),null}function Ont(e,t){const n=p.useRef(null),i=p.useRef(null);return p.useCallback(r=>{if(e===void 0)return;let s=!1;if(n.current!==null){const a=n.current,l=i.current,c=t.context.triggerElements.getById(a);l&&c===l&&(t.context.triggerElements.delete(a),s=!0),n.current=null,i.current=null}if(r!==null&&(n.current=e,i.current=r,t.context.triggerElements.add(e,r),s=!0),s){const a=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==a&&t.set("triggerCount",a)}},[t,e])}function R2e(e,t,n,i=!1){t?e.preventUnmountingOnClose=!1:i&&(e.preventUnmountingOnClose=!0);const r=(n==null?void 0:n.id)??null;(r||t)&&(e.activeTriggerId=r,e.activeTriggerElement=n??null)}function knt(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function I2e(e,t,n,i){const r=n.useState("isMountedByTrigger",e),s=Ont(e,n),a=Hn(c=>{const u=n.select("open"),d=n.select("activeTriggerId");if(d===e){n.update({activeTriggerElement:c,...u?i:null});return}d==null&&u&&n.update({activeTriggerId:e,activeTriggerElement:c,...i})}),l=p.useCallback(c=>{s(c),c&&a(c)},[s,a]);return Fn(()=>{r&&n.update({activeTriggerElement:t.current,...i})},[r,n,t,...Object.values(i)]),{registerTrigger:l,isMountedByThisTrigger:r}}function P2e(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,i=p.useRef(null),r=e.useState("open"),s=e.useState("triggerCount"),a=e.useState("activeTriggerId"),l=e.useState("activeTriggerElement");Fn(()=>{if(!r){i.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const c=e.context.triggerElements.size,u={};e.state.triggerCount!==c&&(u.triggerCount=c);const d=e.select("activeTriggerId");let f=null;if(d){const h=e.context.triggerElements.getById(d);if(h)i.current=d,h!==e.state.activeTriggerElement&&(u.activeTriggerElement=h);else{for(const[m,g]of e.context.triggerElements.entries())if(g===e.state.activeTriggerElement){u.activeTriggerId=m,u.activeTriggerElement=g,i.current=m;break}u.activeTriggerId===void 0&&(i.current===d?f=d:i.current=null)}}else i.current=null;if(!f&&!d&&c===1){const h=e.context.triggerElements.entries().next();if(!h.done){const[m,g]=h.value;u.activeTriggerId=m,u.activeTriggerElement=g,i.current=m}}(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)&&e.update(u),f&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===f&&!e.context.triggerElements.getById(f)){const h=Zs(YTe);e.setOpen(!1,h),h.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,s,a,l,n])}function D2e(e,t,n){const{mounted:i,setMounted:r,transitionStatus:s}=T2e(e),a=t.useState("preventUnmountingOnClose"),l=e?!1:a;t.useSyncedValues({mounted:i,transitionStatus:s,preventUnmountingOnClose:l});const c=Hn(()=>{var u,d;r(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(d=(u=t.context).onOpenChangeComplete)==null||d.call(u,!1)});return AC({enabled:i&&!e&&!l,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:s}}function M2e(e,t){e.useSyncedValues(t),Fn(()=>()=>{e.update({activeTriggerProps:_l,inactiveTriggerProps:_l,popupProps:_l})},[e])}function L2e(e,t){Fn(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),Fn(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class uQ{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function Snt(){return new cQ({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new uQ,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function $2e(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Snt(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:_l,inactiveTriggerProps:_l,popupProps:_l}}function F2e(e,t,n=!1){return new cQ({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const Hk=e=>e.triggerIdProp??e.activeTriggerId,dQ=e=>e.openProp??e.open,JY=e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0};function B2e(e,t){return t!==void 0&&dQ(e)&&Hk(e)===t}function Ent(e,t){return B2e(e,t)?!0:t!==void 0&&dQ(e)&&Hk(e)==null&&e.triggerCount===1}const U2e={open:dQ,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Hk,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:JY,isTriggerActive:(e,t)=>t!==void 0&&Hk(e)===t,isOpenedByTrigger:(e,t)=>B2e(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Hk(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Ent(e,t)?JY(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Q2e(e){const t=p.useCallback(i=>e===void 0?UU:e.subscribeStore(i),[e]),n=p.useCallback(()=>e===void 0?void 0:e.store,[e]);return pI.useSyncExternalStore(t,n,()=>e==null?void 0:e.serverStore)}function Cnt(e){return Tnt(e,e.rootContext)}function Tnt(e,t){const{nodeId:n,externalTree:i}=e,r=t.useState("referenceElement"),s=t.useState("floatingElement"),a=t.useState("domReferenceElement"),l=t.useState("open"),c=t.useState("floatingId"),[u,d]=p.useState(null),[f,h]=p.useState(void 0),[m,g]=p.useState(void 0),b=p.useRef(null),v=Hw(i),y=p.useMemo(()=>({reference:r,floating:s,domReference:a}),[r,s,a]),w=w2e({...e,elements:{...y,...u&&{reference:u}}}),x=lr(f)?f:null,O=m===void 0?t.state.floatingElement:m;t.useSyncedValue("referenceElement",f??null),t.useSyncedValue("domReferenceElement",f===void 0?a:x),t.useSyncedValue("floatingElement",O);const S=p.useCallback(j=>{const T=lr(j)?{getBoundingClientRect:()=>j.getBoundingClientRect(),getClientRects:()=>j.getClientRects(),contextElement:j}:j;d(T),w.refs.setReference(T)},[w.refs]),k=p.useCallback(j=>{(lr(j)||j===null)&&(b.current=j,h(j)),(lr(w.refs.reference.current)||w.refs.reference.current===null||j!==null&&!lr(j))&&w.refs.setReference(j)},[w.refs,h]),C=p.useCallback(j=>{g(j),w.refs.setFloating(j)},[w.refs]),E=p.useMemo(()=>({...w.refs,setReference:k,setFloating:C,setPositionReference:S,domReference:b}),[w.refs,k,C,S]),R=p.useMemo(()=>({...w.elements,domReference:a}),[w.elements,a]),A=p.useMemo(()=>({...w,dataRef:t.context.dataRef,open:l,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:E,elements:R,nodeId:n,rootStore:t}),[w,E,R,n,t,l,c]);return Fn(()=>{a&&(b.current=a)},[a]),Fn(()=>{t.context.dataRef.current.floatingContext=A;const j=v==null?void 0:v.nodesRef.current.find(T=>T.id===n);j&&(j.context=A)}),p.useMemo(()=>({...w,context:A,refs:E,elements:R,rootStore:t}),[w,E,R,A,t])}class fQ{constructor(){Jt(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});Jt(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new fu,this.restTimeout=new fu,this.handleCloseOptions=void 0}static create(){return new fQ}}const RN=new WeakMap;function IN(e){var n,i,r;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&RN.get(t)===e&&((n=e.pointerEventsScopeElement)==null||n.style.removeProperty("pointer-events"),(i=e.pointerEventsReferenceElement)==null||i.style.removeProperty("pointer-events"),(r=e.pointerEventsFloatingElement)==null||r.style.removeProperty("pointer-events"),RN.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function z2e(e,t){const{scopeElement:n,referenceElement:i,floatingElement:r}=t,s=RN.get(n);s&&s!==e&&IN(s),IN(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=i,e.pointerEventsFloatingElement=r,RN.set(n,e),n.style.pointerEvents="none",i.style.pointerEvents="auto",r.style.pointerEvents="auto"}function V2e(e){const t=e.context.dataRef.current,n=Xu(()=>t.hoverInteractionState??fQ.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),JI(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Ant(e,t={}){const{enabled:n=!0,closeDelay:i=0,nodeId:r}=t,s="rootStore"in e?e.rootStore:e,a=s.useState("open"),l=s.useState("floatingElement"),c=s.useState("domReferenceElement"),{dataRef:u}=s.context,d=Hw(),f=dP(),h=V2e(s),m=by(),g=Hn(()=>{var y;return o2e((y=u.current.openEvent)==null?void 0:y.type,h.interactedInside)}),b=Hn(()=>{var y;return Stt((y=u.current.openEvent)==null?void 0:y.type)}),v=Hn(()=>{IN(h)});Fn(()=>{a||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,v())},[a,h,v]),p.useEffect(()=>v,[v]),Fn(()=>{var y,w,x,O,S;if(n&&a&&(y=h.handleCloseOptions)!=null&&y.blockPointerEvents&&b()&&lr(c)&&l){const k=c,C=l,E=or(l),R=(x=(w=d==null?void 0:d.nodesRef.current.find(N=>N.id===f))==null?void 0:w.context)==null?void 0:x.elements.floating;R&&(R.style.pointerEvents="");const A=h.pointerEventsScopeElement!==C?h.pointerEventsScopeElement:null,j=R!==C?R:null,T=((S=(O=h.handleCloseOptions)==null?void 0:O.getScope)==null?void 0:S.call(O))??A??j??k.closest("[data-rootownerid]")??E.body;return z2e(h,{scopeElement:T,referenceElement:k,floatingElement:C}),()=>{v()}}},[n,a,c,l,h,b,d,f,v]),p.useEffect(()=>{if(!n)return;function y(){return!!(d&&f&&sg(d.nodesRef.current,f).length>0)}function w(E){const R=dF(i,"close",h.pointerType),A=()=>{s.setOpen(!1,Zs(Vc,E)),d==null||d.events.emit("floating.closed",E)};R?h.openChangeTimeout.start(R,A):(h.openChangeTimeout.clear(),A())}function x(E){const R=ea(E);if(!ret(R)){h.interactedInside=!1;return}h.interactedInside=(R==null?void 0:R.closest("[aria-haspopup]"))!=null}function O(){h.openChangeTimeout.clear(),m.clear(),d==null||d.events.off("floating.closed",k),v()}function S(E){var T;if(y()&&d){d.events.on("floating.closed",k);return}if(ETe(E.relatedTarget,s.context.triggerElements))return;const R=((T=u.current.floatingContext)==null?void 0:T.nodeId)??r,A=E.relatedTarget;if(!(d&&R&&lr(A)&&sg(d.nodesRef.current,R,!1).some(N=>{var _;return Qn((_=N.context)==null?void 0:_.elements.floating,A)}))){if(h.handler){h.handler(E);return}v(),b()&&!g()&&w(E)}}function k(E){!d||!f||y()||m.start(0,()=>{d.events.off("floating.closed",k),s.setOpen(!1,Zs(Vc,E)),d.events.emit("floating.closed",E)})}const C=l;return If(C&&vi(C,"mouseenter",O),C&&vi(C,"mouseleave",S),C&&vi(C,"pointerdown",x,!0),()=>{d==null||d.events.off("floating.closed",k)})},[n,l,s,u,i,r,b,g,v,h,d,f,m])}const _nt={current:null};function jnt(e,t={}){var M;const{enabled:n=!0,delay:i=0,handleClose:r=null,mouseOnly:s=!1,restMs:a=0,move:l=!0,triggerElementRef:c=_nt,externalTree:u,isActiveTrigger:d=!0,getHandleCloseContext:f,isClosing:h,shouldOpen:m,guardStaleOpen:g=!1}=t,b="rootStore"in e?e.rootStore:e,{dataRef:v,events:y}=b.context,w=Hw(u),x=V2e(b),O=p.useRef(!1),S=El(r),k=El(i),C=El(a),E=El(n),R=El(m),A=El(h),j=Hn(()=>{var P;return o2e((P=v.current.openEvent)==null?void 0:P.type,x.interactedInside)}),T=Hn(()=>{var P;return((P=R.current)==null?void 0:P.call(R))!==!1}),N=Hn((P,L,B)=>{const I=b.context.triggerElements;if(I.hasElement(L))return!P||!Qn(P,L);if(!lr(B))return!1;const z=B;return I.hasMatchingElement(K=>Qn(K,z))&&(!P||!Qn(P,z))}),_=Hn(()=>{if(!x.handler)return;or(b.select("domReferenceElement")).removeEventListener("mousemove",x.handler),x.handler=void 0}),D=Hn(()=>{IN(x)});return d&&(x.handleCloseOptions=(M=S.current)==null?void 0:M.__options),p.useEffect(()=>_,[_]),p.useEffect(()=>{if(!n)return;function P(L){L.open?O.current=!1:(O.current=L.reason===Vc,_(),x.openChangeTimeout.clear(),x.restTimeout.clear(),x.blockMouseMove=!0,x.restTimeoutPending=!1)}return y.on("openchange",P),()=>{y.off("openchange",P)}},[n,y,x,_]),p.useEffect(()=>{if(!n)return;function P(F,q=!0){const H=dF(k.current,"close",x.pointerType);H?x.openChangeTimeout.start(H,()=>{b.setOpen(!1,Zs(Vc,F)),w==null||w.events.emit("floating.closed",F)}):q&&(x.openChangeTimeout.clear(),b.setOpen(!1,Zs(Vc,F)),w==null||w.events.emit("floating.closed",F))}const L=c.current??(d?b.select("domReferenceElement"):null);if(!lr(L))return;function B(F){var he;if(x.openChangeTimeout.clear(),x.blockMouseMove=!1,s&&!rx(x.pointerType))return;const q=MY(C.current),H=dF(k.current,"open",x.pointerType),X=ea(F),ne=F.currentTarget??null,Q=b.select("domReferenceElement");let Z=ne;if(lr(X)&&!b.context.triggerElements.hasElement(X)){for(const ae of b.context.triggerElements.elements())if(Qn(ae,X)){Z=ae;break}}lr(ne)&&lr(Q)&&!b.context.triggerElements.hasElement(ne)&&Qn(ne,Q)&&(Z=Q);const ce=Z==null?!1:N(Q,Z,X),Ee=b.select("open"),Y=((he=A.current)==null?void 0:he.call(A))??b.select("transitionStatus")==="ending",G=!Ee&&Y&&O.current,te=!ce&&lr(Z)&&lr(Q)&&Qn(Q,Z)&&G,ue=q>0&&!H,Ce=ce&&(Ee||G)||te,se=!Ee||ce;if(Ce){T()&&b.setOpen(!0,Zs(Vc,F,Z));return}ue||(H?x.openChangeTimeout.start(H,()=>{se&&T()&&b.setOpen(!0,Zs(Vc,F,Z))}):se&&T()&&b.setOpen(!0,Zs(Vc,F,Z)))}function I(F){if(j()){D();return}_();const q=b.select("domReferenceElement"),H=or(q);x.restTimeout.clear(),x.restTimeoutPending=!1;const X=v.current.floatingContext??(f==null?void 0:f());if(ETe(F.relatedTarget,b.context.triggerElements))return;if(S.current&&X){b.select("open")||x.openChangeTimeout.clear();const Q=c.current;x.handler=S.current({...X,tree:w,x:F.clientX,y:F.clientY,onClose(){D(),_(),E.current&&!j()&&Q===b.select("domReferenceElement")&&P(F,!0)}}),H.addEventListener("mousemove",x.handler),x.handler(F);return}(x.pointerType==="touch"?!Qn(b.select("floatingElement"),F.relatedTarget):!0)&&P(F)}function z(F){Qn(L,F.relatedTarget)||(x.openChangeTimeout.clear(),x.restTimeout.clear(),x.restTimeoutPending=!1)}const K=g?vi(L,"mouseout",z):void 0;return l?If(vi(L,"mousemove",B,{once:!0}),vi(L,"mouseenter",B),vi(L,"mouseleave",I),K):If(vi(L,"mouseenter",B),vi(L,"mouseleave",I),K)},[_,D,v,k,b,n,S,x,d,N,j,s,l,C,c,w,E,f,A,T,g]),p.useMemo(()=>{if(!n)return;function P(L){x.pointerType=L.pointerType}return{onPointerDown:P,onPointerEnter:P,onMouseMove(L){var X,ne,Q;const{nativeEvent:B}=L,I=L.currentTarget,z=b.select("domReferenceElement"),K=b.select("open"),F=N(z,I,L.target);if(s&&!rx(x.pointerType))return;if(K&&F&&((X=x.handleCloseOptions)!=null&&X.blockPointerEvents)){const Z=b.select("floatingElement");if(Z){const ce=((Q=(ne=x.handleCloseOptions)==null?void 0:ne.getScope)==null?void 0:Q.call(ne))??I.ownerDocument.body;z2e(x,{scopeElement:ce,referenceElement:I,floatingElement:Z})}}const q=MY(C.current);if(K&&!F||q===0||!F&&x.restTimeoutPending&&L.movementX**2+L.movementY**2<2)return;x.restTimeout.clear();function H(){if(x.restTimeoutPending=!1,j())return;const Z=b.select("open");!x.blockMouseMove&&(!Z||F)&&T()&&b.setOpen(!0,Zs(Vc,B,I))}x.pointerType==="touch"?si.flushSync(()=>{H()}):F&&K?H():(x.restTimeoutPending=!0,x.restTimeout.start(q,H))}}},[n,x,j,N,s,b,C,T])}const eZ=.1,Nnt=eZ*eZ,Ir=.5;function N2(e,t,n,i,r,s){return i>=t!=s>=t&&e<=(r-n)*(t-i)/(s-i)+n}function R2(e,t,n,i,r,s,a,l,c,u){let d=!1;return N2(e,t,n,i,r,s)&&(d=!d),N2(e,t,r,s,a,l)&&(d=!d),N2(e,t,a,l,c,u)&&(d=!d),N2(e,t,c,u,n,i)&&(d=!d),d}function Rnt(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function I2(e,t,n,i,r,s){const a=Math.min(n,r),l=Math.max(n,r),c=Math.min(i,s),u=Math.max(i,s);return e>=a&&e<=l&&t>=c&&t<=u}function Int(e={}){const{blockPointerEvents:t=!1}=e,n=new fu,i=({x:r,y:s,placement:a,elements:l,onClose:c,nodeId:u,tree:d})=>{const f=a==null?void 0:a.split("-")[0];let h=!1,m=null,g=null,b=typeof performance<"u"?performance.now():0;function v(w,x){const O=performance.now(),S=O-b;if(m===null||g===null||S===0)return m=w,g=x,b=O,!1;const k=w-m,C=x-g,E=k*k+C*C,R=S*S*Nnt;return m=w,g=x,b=O,E0)}function N(){T()||y()}if(T())return;const _=O.getBoundingClientRect(),D=S.getBoundingClientRect(),M=r>D.right-D.width/2,P=s>D.bottom-D.height/2,L=D.width>_.width,B=D.height>_.height,I=(L?_:D).left,z=(L?_:D).right,K=(B?_:D).top,F=(B?_:D).bottom;if(f==="top"&&s>=_.bottom-1||f==="bottom"&&s<=_.top+1||f==="left"&&r>=_.right-1||f==="right"&&r<=_.left+1){N();return}let q=!1;switch(f){case"top":q=I2(k,C,I,_.top+1,z,D.bottom-1);break;case"bottom":q=I2(k,C,I,D.top+1,z,_.bottom-1);break;case"left":q=I2(k,C,D.right-1,F,_.left+1,K);break;case"right":q=I2(k,C,_.right-1,F,D.left+1,K);break}if(q)return;if(h&&!Rnt(k,C,_)){N();return}if(!R&&v(k,C)){N();return}let H=!1;switch(f){case"top":{const X=L?Ir/2:Ir*4,ne=L||M?r+X:r-X,Q=L?r-X:M?r+X:r-X,Z=s+Ir+1,ce=M||L?D.bottom-Ir:D.top,Ee=M?L?D.bottom-Ir:D.top:D.bottom-Ir;H=R2(k,C,ne,Z,Q,Z,D.left,ce,D.right,Ee);break}case"bottom":{const X=L?Ir/2:Ir*4,ne=L||M?r+X:r-X,Q=L?r-X:M?r+X:r-X,Z=s-Ir,ce=M||L?D.top+Ir:D.bottom,Ee=M?L?D.top+Ir:D.bottom:D.top+Ir;H=R2(k,C,ne,Z,Q,Z,D.left,ce,D.right,Ee);break}case"left":{const X=B?Ir/2:Ir*4,ne=B||P?s+X:s-X,Q=B?s-X:P?s+X:s-X,Z=r+Ir+1,ce=P||B?D.right-Ir:D.left,Ee=P?B?D.right-Ir:D.left:D.right-Ir;H=R2(k,C,ce,D.top,Ee,D.bottom,Z,ne,Z,Q);break}case"right":{const X=B?Ir/2:Ir*4,ne=B||P?s+X:s-X,Q=B?s-X:P?s+X:s-X,Z=r-Ir,ce=P||B?D.left+Ir:D.right,Ee=P?B?D.left+Ir:D.right:D.left+Ir;H=R2(k,C,Z,ne,Z,Q,ce,D.top,Ee,D.bottom);break}}H?h||n.start(40,N):N()}};return i.__options={...e,blockPointerEvents:t},i}const Pnt=p.createContext(void 0);function Dnt(){const e=p.useContext(Pnt);return(e==null?void 0:e.direction)??"ltr"}const Mnt=e=>({name:"arrow",options:e,async fn(t){var B,I;const{x:n,y:i,placement:r,rects:s,platform:a,elements:l,middlewareData:c}=t,{element:u,padding:d=0,offsetParent:f="real"}=$f(e,t)||{};if(u==null)return{};const h=ZU(d),m={x:n,y:i},g=lP(r),b=aP(g),v=await a.getDimensions(u),y=g==="y",w=y?"top":"left",x=y?"bottom":"right",O=y?"clientHeight":"clientWidth",S=s.reference[b]+s.reference[g]-m[g]-s.floating[b],k=m[g]-s.reference[g],C=f==="real"?await((B=a.getOffsetParent)==null?void 0:B.call(a,u)):l.floating;let E=l.floating[O]||s.floating[b];(!E||!await((I=a.isElement)==null?void 0:I.call(a,C)))&&(E=l.floating[O]||s.floating[b]);const R=S/2-k/2,A=E/2-v[b]/2-1,j=Math.min(h[w],A),T=Math.min(h[x],A),N=j,_=E-v[b]-T,D=E/2-v[b]/2+R,M=XU(N,D,_),P=!c.arrow&&Cp(r)!=null&&D!==M&&s.reference[b]/2-(D({...Mnt(e),options:[e,t]}),$nt={name:"hide",async fn(e){const{width:t,height:n,x:i,y:r}=e.rects.reference,s=t===0&&n===0&&i===0&&r===0,a=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:a.top-n>=0||a.right-t>=0||a.bottom-n>=0||a.left-t>=0||s}}}},Fnt={sideX:"left",sideY:"top"},tZ="--available-width",nZ="--available-height";function H2e(e,t,n){const i=e==="inline-start"||e==="inline-end";return{top:"top",right:i?n?"inline-start":"inline-end":"right",bottom:"bottom",left:i?n?"inline-end":"inline-start":"left"}[t]}function iZ(e,t,n){const{rects:i,placement:r}=e;return{side:H2e(t,Hu(r),n),align:Cp(r)||"center",anchor:{width:i.reference.width,height:i.reference.height},positioner:{width:i.floating.width,height:i.floating.height}}}function Bnt(e){return Unt(e,Cnt)}function Unt(e,t){var ft,gt;const{anchor:n,positionMethod:i="absolute",side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,collisionBoundary:c,collisionPadding:u=5,sticky:d=!1,arrowPadding:f=5,disableAnchorTracking:h=!1,inline:m,keepMounted:g=!1,floatingRootContext:b,mounted:v,collisionAvoidance:y,shift:w,nodeId:x,adaptiveOrigin:O,lazyFlip:S=!1,externalTree:k}=e,[C,E]=p.useState(null);!v&&C!==null&&E(null);const R=y.side||"flip",A=y.align||"flip",j=y.fallbackAxisSide||"end",T=(w==null?void 0:w.crossAxis)??!1,N=w==null?void 0:w.rootBoundary,_=typeof n=="function"?n:void 0,D=Hn(_),M=_?D:n,P=El(n),L=El(v),I=Dnt()==="rtl",z=C||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":I?"left":"right","inline-start":I?"right":"left"}[r],K=a==="center"?z:`${z}-${a}`;let F=u;typeof F=="number"?F={top:F,right:F,bottom:F,left:F}:F&&(F={top:F.top||0,right:F.right||0,bottom:F.bottom||0,left:F.left||0});const q=1,H=r==="bottom"?q:0,X=r==="top"?q:0,ne=r==="right"?q:0,Q=r==="left"?q:0,Z={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:F},ce=p.useRef(null),Ee=El(s),Y=El(l),G=typeof s!="function"?s:0,te=typeof l!="function"?l:0,ue=[];m&&ue.push(m),ue.push(O2e(Me=>{const bt=iZ(Me,r,I),jt=typeof Ee.current=="function"?Ee.current(bt):Ee.current,Ct=typeof Y.current=="function"?Y.current(bt):Y.current;return{mainAxis:jt,crossAxis:Ct,alignmentAxis:Ct}},[G,te,I,r]));const Ce=A==="none"&&R!=="shift",se=!Ce&&(d||T||R==="shift"),he=R==="none"?null:E2e({...Z,padding:{top:F.top+q+H,right:F.right+q+Q,bottom:F.bottom+q+X,left:F.left+q+ne},mainAxis:!T&&R==="flip",crossAxis:A==="flip"?"alignment":!1,fallbackAxisSideDirection:j}),ae=Ce?null:k2e({...Z,rootBoundary:N,mainAxis:A!=="none",crossAxis:se,limiter:d||T?void 0:S2e(Me=>{if(!ce.current)return{};const{width:bt,height:jt}=ce.current.getBoundingClientRect(),Ct=Lu(Hu(Me.placement)),sn=Ct==="y"?bt:jt,We=Ct==="y"?F.left+F.right:F.top+F.bottom;return{offset:sn/2+We/2}})},[Z,d,T,N,F,A]);R==="shift"||A==="shift"||a==="center"?ue.push(ae,he):ue.push(he,ae),ue.push(C2e({...Z,apply({elements:{floating:Me},availableWidth:bt,availableHeight:jt,rects:Ct}){if(!L.current)return;const sn=Me.style;sn.setProperty(tZ,`${bt}px`),sn.setProperty(nZ,`${jt}px`);const We=Vs(Me).devicePixelRatio||1,{x:Le,y:Ge,width:pt,height:ot}=Ct.reference,kt=(Math.round((Le+pt)*We)-Math.round(Le*We))/We,rt=(Math.round((Ge+ot)*We)-Math.round(Ge*We))/We;sn.setProperty("--anchor-width",`${kt}px`),sn.setProperty("--anchor-height",`${rt}px`)}}),Lnt(Me=>({element:ce.current||or(Me.elements.floating).createElement("div"),padding:f,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(Me){var at,On,Je;const{elements:bt,middlewareData:jt,placement:Ct,rects:sn,y:We}=Me,Le=Hu(Ct),Ge=Lu(Le),pt=ce.current,ot=((at=jt.arrow)==null?void 0:at.x)||0,kt=((On=jt.arrow)==null?void 0:On.y)||0,rt=(pt==null?void 0:pt.clientWidth)||0,qt=(pt==null?void 0:pt.clientHeight)||0,cn=ot+rt/2,un=kt+qt/2,Xe=Math.abs(((Je=jt.shift)==null?void 0:Je.y)||0),mt=sn.reference.height/2,St=typeof s=="function"?s(iZ(Me,r,I)):s,on=Xe>St,zt={top:`${cn}px calc(100% + ${St}px)`,bottom:`${cn}px ${-St}px`,left:`calc(100% + ${St}px) ${un}px`,right:`${-St}px ${un}px`}[Le],Be=`${cn}px ${sn.reference.y+mt-We}px`;return bt.floating.style.setProperty("--transform-origin",se&&Ge==="y"&&on?Be:zt),{}}},$nt,O),Fn(()=>{!v&&b&&b.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[v,b]);const Ae=p.useMemo(()=>({elementResize:!h&&typeof ResizeObserver<"u",layoutShift:!h&&typeof IntersectionObserver<"u"}),[h]),{refs:De,elements:ye,x:Qe,y:we,middlewareData:Ne,update:ie,placement:fe,context:Se,isPositioned:ke,floatingStyles:qe}=t({rootContext:b,open:g?v:void 0,placement:K,middleware:ue,strategy:i,whileElementsMounted:g?void 0:(...Me)=>hF(...Me,Ae),nodeId:x,externalTree:k}),{sideX:it,sideY:de}=Ne.adaptiveOrigin||Fnt,ve=ke?i:"fixed",Te=p.useMemo(()=>{let Me;return ke?O?Me={position:ve,[it]:Qe,[de]:we}:Me={...qe,position:ve}:Me={position:ve,top:0,left:0},Me[tZ]="100vw",Me[nZ]="100vh",ke||(Me.opacity=0),Me},[O,ve,it,Qe,de,we,qe,ke]),Ke=p.useRef(null);Fn(()=>{if(!v)return;const Me=P.current,bt=typeof Me=="function"?Me():Me,Ct=(rZ(bt)?bt.current:bt)||null||null;Ct!==Ke.current&&(De.setPositionReference(Ct),Ke.current=Ct)},[v,De,M,P]),p.useEffect(()=>{if(!v)return;const Me=P.current;typeof Me!="function"&&rZ(Me)&&Me.current!==Ke.current&&(De.setPositionReference(Me.current),Ke.current=Me.current)},[v,De,M,P]),p.useEffect(()=>{if(g&&v&&ye.reference&&ye.floating)return hF(ye.reference,ye.floating,ie,Ae)},[g,v,ye,ie,Ae]);const $e=Hu(fe),At=H2e(r,$e,I),Nt=Cp(fe)||"center",vt=!!((ft=Ne.hide)!=null&&ft.referenceHidden);Fn(()=>{S&&v&&ke&&$e!==z&&E($e)},[S,v,ke,$e,z]);const Ot=p.useMemo(()=>{var Me,bt;return{position:"absolute",top:(Me=Ne.arrow)==null?void 0:Me.y,left:(bt=Ne.arrow)==null?void 0:bt.x}},[Ne.arrow]),Tt=((gt=Ne.arrow)==null?void 0:gt.centerOffset)!==0;return p.useMemo(()=>({positionerStyles:Te,arrowStyles:Ot,arrowRef:ce,arrowUncentered:Tt,side:At,align:Nt,physicalSide:$e,anchorHidden:vt,refs:De,context:Se,isPositioned:ke,update:ie}),[Te,Ot,ce,Tt,At,Nt,$e,vt,De,Se,ke,ie])}function rZ(e){return e!=null&&"current"in e}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=_N.startingStyle]="startingStyle",e[e.endingStyle=_N.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const Qnt={"data-popup-open":""},znt={"data-popup-open":"","data-pressed":""},Vnt={"data-open":""},Hnt={"data-closed":""},qnt={"data-anchor-hidden":""},q2e={open(e){return e?Qnt:null}},Wnt={open(e){return e?znt:null}},hQ={open(e){return e?Vnt:Hnt},anchorHidden(e){return e?qnt:null}},W2e={...hQ,...cP};function K2e(e){return e==="starting"?Zet:_l}function Knt(e,t,{styles:n,transitionStatus:i,props:r,refs:s,hidden:a,inert:l=!1}){const c={...n};return l&&(c.pointerEvents="none"),Oo("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:a,style:c},K2e(i),r],stateAttributesMapping:hQ})}function G2e(){const e=QU(),t=e.useState("toasts");return p.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function Pd({orientation:e="vertical",maxHeight:t,hideScrollbar:n=!1,fadeEdges:i=!1,contentClassName:r="",className:s="",style:a,children:l,hasMore:c=!1,onLoadMore:u,threshold:d=24,onScroll:f,ref:h,...m}){const[g,b]=p.useState(!1),[v,y]=p.useState(!1),[w,x]=p.useState({top:!1,bottom:!1}),O=p.useRef(null),S=p.useRef(null),k=i&&e!=="horizontal",C=!!u&&e!=="horizontal";p.useImperativeHandle(h,()=>O.current,[]),p.useEffect(()=>()=>{var A;(A=S.current)==null||A.abort()},[]);const E=p.useCallback(()=>{const A=O.current;if(!k||!A)return;const j=A.scrollHeight-A.clientHeight,T=j>1&&A.scrollTop>1,N=j>1&&j-A.scrollTop>1;x(_=>_.top===T&&_.bottom===N?_:{top:T,bottom:N})},[k]);p.useEffect(()=>{const A=O.current;if(!k||!A)return;const j=new ResizeObserver(E);j.observe(A);for(const T of A.children)j.observe(T);return E(),()=>j.disconnect()},[k,C,E]);async function R(){if(!u||!c||S.current)return;const A=new AbortController;S.current=A,b(!0),y(!1);try{await u(A.signal)}catch{A.signal.aborted||y(!0)}finally{A.signal.aborted||b(!1),S.current===A&&(S.current=null)}}return o.jsxs("div",{...m,ref:O,className:`studio-scroll-area ${s}`.trim(),"data-orientation":e,"data-hide-scrollbar":n||void 0,"data-fade-edges":k&&(w.top||w.bottom)||void 0,"data-fade-top":k&&w.top||void 0,"data-fade-bottom":k&&w.bottom||void 0,style:{maxHeight:t,...a},onScroll:A=>{f==null||f(A),E();const j=A.currentTarget;!A.defaultPrevented&&e!=="horizontal"&&!v&&j.scrollTop>0&&j.scrollHeight-j.clientHeight-j.scrollTop<=Math.max(0,d)&&R()},children:[o.jsx("div",{className:`studio-scroll-area__content ${r}`.trim(),"aria-busy":u?g:void 0,children:l}),u&&e!=="horizontal"&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"studio-scroll-area__footer",children:[g?o.jsx(gy,{size:24}):o.jsx("span",{role:"status","aria-live":"polite",children:v?"加载失败":c?"向下滚动加载更多":"已加载全部"}),!g&&c&&o.jsx("button",{type:"button",onClick:()=>void R(),children:v?"重试":"加载更多"})]})})]})}function Gnt(){const{add:e,close:t}=G2e();return{add:p.useCallback(({id:i,title:r,description:s,variant:a="info",duration:l,action:c,closeLabel:u,onClose:d})=>e({id:i,title:r,description:s,timeout:l,priority:"low",onClose:d,data:{variant:a,action:c,closeLabel:u}}),[e]),dismiss:t}}function Xnt({position:e,label:t}){const{toasts:n,close:i}=G2e();return o.jsx(wtt,{children:o.jsx(Wet,{className:"studio-toast-viewport","data-position":e,"data-empty":n.length===0||void 0,"aria-label":t,render:o.jsx(Pd,{contentClassName:"studio-toast-viewport__stack"}),children:n.map(r=>{var s,a,l;return o.jsx(utt,{toast:r,className:"studio-toast-root",swipeDirection:[],children:o.jsx(wJe,{role:"presentation",variant:(s=r.data)==null?void 0:s.variant,title:r.title!=null?o.jsx(ptt,{render:o.jsx("div",{}),children:r.title}):void 0,description:r.description!=null?o.jsx(htt,{render:o.jsx("div",{}),children:r.description}):void 0,action:(a=r.data)==null?void 0:a.action,closeLabel:(l=r.data)==null?void 0:l.closeLabel,onDismiss:()=>i(r.id)})},r.id)})})})}function Ynt({children:e,duration:t=4e3,position:n="top-center",label:i="通知"}){return o.jsxs(jet,{timeout:t,limit:3,children:[e,o.jsx(Xnt,{position:n,label:i})]})}function Znt({ownerId:e,sessionId:t,onOpen:n,hideNotices:i,refreshKey:r,onUpdate:s}){const{t:a}=je("sandbox"),l=Gnt(),c=p.useRef(new Map),u=p.useRef(new Map),d=p.useRef(null),f=p.useRef({sessionId:t,onOpen:n,toast:l,t:a,hideNotices:i,onUpdate:s});return f.current={sessionId:t,onOpen:n,toast:l,t:a,hideNotices:i,onUpdate:s},p.useEffect(()=>{if(i){f.current.toast.dismiss(),u.current.clear();return}for(const h of c.current.values())h.sessionId===t&&(f.current.toast.dismiss(h.runId),u.current.delete(h.runId))},[t,i]),p.useEffect(()=>{var h;(h=d.current)==null||h.call(d)},[r]),p.useEffect(()=>{if(!e)return;const h=new AbortController,m=c.current,g=u.current,b=new Set;let v,y=!1,w=[],x="";const O=(C,E=x)=>{var R,A;x=E,h.signal.aborted||(A=(R=f.current).onUpdate)==null||A.call(R,{ownerId:e,runs:w,loading:C,error:E})},S=C=>{const{toast:E,t:R,sessionId:A,onOpen:j}=f.current;if(!h.signal.aborted){if(f.current.hideNotices||C.sessionId===A){E.dismiss(C.runId),g.delete(C.runId);return}b.has(C.runId)||g.get(C.runId)===C.state||(g.set(C.runId,C.state),E.add({id:C.runId,duration:0,title:R(`taskNotice.${C.state}`),description:C.message.slice(0,80),variant:C.state==="succeeded"?"success":C.state==="failed"?"error":"info",closeLabel:R("taskNotice.hide"),onClose:()=>b.add(C.runId),action:o.jsx(Us,{variant:"secondary",onClick:()=>{j(C.sessionId,h.signal).catch(T=>{h.signal.aborted||E.add({id:"task-open-error",variant:"error",description:T instanceof Error?T.message:String(T)})})},children:R("taskNotice.open")})}))}},k=async(C=!1)=>{if(!(y||h.signal.aborted)){clearTimeout(v),y=!0,C&&O(!0);try{const E=await bd.active(h.signal);if(h.signal.aborted)return;w=E,O(!1,"");const R=new Set(E.map(A=>A.runId));for(const A of m.values())if(!R.has(A.runId)&&!zc(A)){let j;try{j=await bd.get(A.runId,h.signal)}catch(T){if(T instanceof Xx&&T.status===404){m.delete(A.runId),g.delete(A.runId),f.current.toast.dismiss(A.runId);continue}throw T}if(h.signal.aborted)return;m.set(j.runId,j),S(j)}for(const A of E)m.set(A.runId,A),S(A);f.current.toast.dismiss("task-connection")}catch(E){if(h.signal.aborted)return;E instanceof Xx&&[401,403].includes(E.status)&&(w=[],m.clear(),g.clear(),f.current.toast.dismiss()),O(!1,E instanceof Error?E.message:f.current.t("taskNotice.reconnecting")),!h.signal.aborted&&m.size&&!f.current.hideNotices&&f.current.toast.add({id:"task-connection",duration:0,description:f.current.t("taskNotice.reconnecting")})}finally{y=!1,h.signal.aborted||(v=setTimeout(k,3e3))}}};return d.current=()=>{k(!0)},O(!0),k(),()=>{h.abort(),clearTimeout(v),d.current=null,f.current.toast.dismiss()}},[e]),null}function Jnt(e){const{t}=je("sandbox");return o.jsx(Ynt,{position:"bottom-right",label:t("taskNotice.label"),children:o.jsx(Znt,{...e},e.ownerId)})}const GS=["super_admin","admin","developer","user"];class XS extends Error{constructor(t,n){super(t),this.code=t,this.status=n}}async function X2e(e){let t;try{t=await e.json()}catch{throw new XS("invalid_response",e.status)}if(!e.ok){const n=t&&typeof t=="object"&&"code"in t&&typeof t.code=="string"?t.code:"request_failed";throw new XS(n,e.status)}return t}function Y2e(e){return!e||typeof e!="object"?!1:"id"in e&&typeof e.id=="string"&&"name"in e&&typeof e.name=="string"&&"email"in e&&typeof e.email=="string"&&"role"in e&&GS.some(t=>t===e.role)&&"status"in e&&typeof e.status=="string"&&"lastLogin"in e&&typeof e.lastLogin=="string"&&"protected"in e&&typeof e.protected=="boolean"&&"currentUser"in e&&typeof e.currentUser=="boolean"&&"roleConflict"in e&&typeof e.roleConflict=="boolean"}async function eit(e){const t=new URLSearchParams({page:String(e.page),pageSize:"20",query:e.query});e.role&&t.set("role",e.role);const n=await X2e(await pn(`/web/users?${t}`,{signal:e.signal,cache:"no-store"}));if(!n||typeof n!="object"||!("items"in n)||!Array.isArray(n.items)||!n.items.every(Y2e)||!("total"in n)||typeof n.total!="number"||!("poolTotal"in n)||typeof n.poolTotal!="number"||!("page"in n)||typeof n.page!="number"||!("pageSize"in n)||typeof n.pageSize!="number"||!("userPoolId"in n)||typeof n.userPoolId!="string"||!("clientId"in n)||typeof n.clientId!="string"||!("provider"in n)||!["volcengine","byteplus"].includes(String(n.provider)))throw new XS("invalid_response",502);return n}async function tit(e,t,n){const i=await X2e(await pn(`/web/users/${encodeURIComponent(e.id)}/role`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:t,expectedRole:e.role}),signal:n}));if(!i||typeof i!="object"||!("user"in i)||!Y2e(i.user))throw new XS("invalid_response",502);return i.user}function nit(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 iit(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 jg({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:m}){const{t:g}=je("ui"),b=l??g("deploymentSelect.searchPlaceholder"),v=d??g("deploymentSelect.emptyMessage"),y=p.useId(),w=p.useRef(null),x=p.useRef(null),O=p.useRef(null),S=p.useRef(null),k=p.useRef([]),[C,E]=p.useState(!1),[R,A]=p.useState(0),j=r.find(L=>L.value===t),T=(j==null?void 0:j.label)??(t?n:void 0),N=a!==void 0&&!!f,_=()=>{E(!1),N&&a&&(f==null||f(""))};p.useEffect(()=>{if(!C)return;const L=B=>{B.target instanceof Node&&w.current&&!w.current.contains(B.target)&&_()};return window.addEventListener("pointerdown",L),()=>window.removeEventListener("pointerdown",L)},[C,f,a,N]),p.useEffect(()=>{var L,B;if(C){if(N){(L=O.current)==null||L.focus();return}(B=k.current[R])==null||B.focus()}},[C,N]),p.useEffect(()=>{var L;!C||N&&document.activeElement===O.current||(L=k.current[R])==null||L.focus()},[R,C,N]),p.useEffect(()=>{A(L=>Math.min(L,Math.max(0,r.length-1)))},[r.length]),p.useEffect(()=>{if(!C||!u||c||!h)return;const L=window.requestAnimationFrame(()=>{const B=S.current;B&&B.scrollHeight<=B.clientHeight+1&&h()});return()=>window.cancelAnimationFrame(L)},[u,c,h,C,r.length]);const D=(L=1)=>{const B=r.findIndex(z=>z.value===t),I=B>=0?B:L===1?0:Math.max(0,r.length-1);A(I),E(!0)},M=L=>{r.length!==0&&A((L+r.length)%r.length)},P=L=>{var B;m(L.value),_(),(B=x.current)==null||B.focus()};return o.jsxs("div",{className:"pp-deployment-select",ref:w,onKeyDown:L=>{var I,z;const B=L.target===O.current;if(L.key==="Escape"&&C){L.preventDefault(),_(),(I=x.current)==null||I.focus();return}if(L.key==="Tab"){_();return}if(B){L.key==="ArrowDown"&&r.length>0&&(L.preventDefault(),A(0),(z=k.current[0])==null||z.focus());return}L.key==="ArrowDown"?(L.preventDefault(),C?M(R+1):D(1)):L.key==="ArrowUp"?(L.preventDefault(),C?M(R-1):D(-1)):C&&L.key==="Home"?(L.preventDefault(),A(0)):C&&L.key==="End"&&(L.preventDefault(),A(Math.max(0,r.length-1)))},children:[o.jsxs("button",{ref:x,type:"button",className:"pp-deployment-select-trigger","aria-label":e,"aria-haspopup":"listbox","aria-expanded":C,"aria-controls":C?y:void 0,disabled:s,onClick:()=>{C?_():D()},children:[o.jsx("span",{className:T?void 0:"is-placeholder",children:T??i}),o.jsx(nit,{className:`pp-deployment-select-chevron${C?" is-open":""}`})]}),C&&o.jsxs("div",{className:"pp-deployment-select-menu",children:[N&&o.jsx("div",{className:"pp-deployment-select-search",children:o.jsx("input",{ref:O,type:"search",value:a,"aria-label":g("deploymentSelect.searchAriaLabel",{label:e}),placeholder:b,autoComplete:"off",onChange:L=>f==null?void 0:f(L.currentTarget.value)})}),o.jsx("div",{id:y,ref:S,className:"pp-deployment-select-options",role:"listbox","aria-label":e,"aria-busy":c||void 0,onScroll:L=>{if(!u||c||!h)return;const B=L.currentTarget;B.scrollHeight-B.scrollTop-B.clientHeight<=24&&h()},children:r.map((L,B)=>{const I=L.value===t;return o.jsxs("button",{ref:z=>{k.current[B]=z},type:"button",role:"option","aria-selected":I,tabIndex:B===R?0:-1,className:`pp-deployment-select-option${I?" is-selected":""}`,title:L.description,onFocus:()=>A(B),onClick:()=>P(L),children:[o.jsxs("span",{className:"pp-deployment-select-copy",children:[o.jsxs("span",{className:"pp-deployment-select-name",children:[L.label,L.badge&&o.jsx("span",{className:"pp-deployment-select-badge",children:L.badge})]}),L.description&&o.jsx("small",{children:L.description})]}),I&&o.jsx(iit,{})]},L.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 hP({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"})})})}function mn({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})}function rit(){return o.jsx("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("path",{d:"M16 7a6.5 6.5 0 1 0 .2 5M16 3.5V7h-3.5"})})}function Z2e(e){return e instanceof XS?e.code:"request_failed"}function sit({user:e,onClose:t,onSaved:n}){const{t:i,i18n:r}=je("users"),s=p.useRef(null),a=p.useRef(null),l=p.useId(),c=p.useId(),[u,d]=p.useState(e.role),[f,h]=p.useState(!1),[m,g]=p.useState("");p.useEffect(()=>{const v=s.current,y=document.activeElement;return v==null||v.showModal(),()=>{var w;(w=a.current)==null||w.abort(),v==null||v.close(),y instanceof HTMLElement&&y.isConnected&&y.focus()}},[]);const b=async()=>{if(f||u===e.role&&!e.roleConflict)return;const v=new AbortController;a.current=v,h(!0),g("");try{const y=await tit(e,u,v.signal);v.signal.aborted||n(y)}catch(y){v.signal.aborted||g(i(`errors.${Z2e(y)}`,{defaultValue:i("errors.request_failed")}))}finally{v.signal.aborted||h(!1)}};return o.jsxs("dialog",{ref:s,className:"user-role-dialog","aria-labelledby":l,"aria-describedby":c,"aria-busy":f,onCancel:v=>{v.preventDefault(),f||t()},children:[o.jsxs("header",{children:[o.jsx("h2",{id:l,children:i("changeRole")}),o.jsx("button",{type:"button",className:"users-close",onClick:t,disabled:f,"aria-label":i("close"),children:o.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:o.jsx("path",{d:"m5 5 10 10M15 5 5 15"})})})]}),o.jsxs("div",{className:"user-role-dialog-body",children:[o.jsxs("div",{className:"users-account",children:[o.jsx("strong",{children:e.name}),o.jsx("span",{children:e.email||e.id})]}),o.jsx("label",{className:"users-field-label",children:i("role")}),o.jsx(jg,{ariaLabel:i("role"),placeholder:i("role"),value:u,disabled:f,options:GS.map(v=>({value:v,label:i(`roles.${v}`),description:i(`descriptions.${v}`)})),onChange:v=>{const y=GS.find(w=>w===v);y&&d(y)}},r.resolvedLanguage),o.jsx("p",{id:c,className:"users-help",children:i("effectiveAfterRefresh")}),m?o.jsx("p",{className:"users-error",role:"alert",children:m}):null]}),o.jsxs("footer",{children:[o.jsx("button",{className:"users-button",type:"button",disabled:f,onClick:t,children:i("cancel")}),o.jsx("button",{className:"users-button is-primary",type:"button",disabled:f||u===e.role&&!e.roleConflict,onClick:()=>void b(),children:i(f?"saving":"save")})]})]})}function oit({onBack:e}){const{t,i18n:n}=je("users"),[i,r]=p.useState(null),[s,a]=p.useState(!0),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(""),[b,v]=p.useState(1),[y,w]=p.useState(0),[x,O]=p.useState(null),[S,k]=p.useState(null),[C,E]=p.useState(null);p.useEffect(()=>{const T=new AbortController;return a(!0),c(""),eit({page:b,query:f,role:m,signal:T.signal}).then(N=>{if(!T.signal.aborted){if(N.total>0&&N.items.length===0&&b>1){v(1);return}r(N),E(new Date)}}).catch(N=>{T.signal.aborted||c(Z2e(N))}).finally(()=>{T.signal.aborted||a(!1)}),()=>T.abort()},[b,f,m,y]);const R=T=>{T.preventDefault(),h(u.trim()),v(1),w(N=>N+1)},A=T=>{if(!T)return t("neverLoggedIn");const N=Number(T),_=new Date(Number.isFinite(N)&&N>0?N<1e12?N*1e3:N:T);return Number.isNaN(_.getTime())?t("unknown"):_.toLocaleString(n.resolvedLanguage,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})},j=Math.max(1,Math.ceil(((i==null?void 0:i.total)??0)/20));return o.jsxs("section",{className:"users-page","aria-labelledby":"users-title",children:[o.jsxs("header",{className:"users-page-header",children:[o.jsx(hP,{label:t("back"),onClick:e}),o.jsx("h1",{id:"users-title",children:t("title")}),i?o.jsx("span",{className:"users-count",children:t("memberCount",{count:i.poolTotal})}):null]}),o.jsxs("div",{className:"users-content",children:[i?o.jsxs("div",{className:"users-pool",children:[o.jsx("span",{children:i.provider==="byteplus"?"BytePlus Identity":t("volcengineIdentity")}),o.jsxs("span",{className:"users-pool-id",title:i.userPoolId,children:[t("pool")," ",i.userPoolId]})]}):null,o.jsxs("div",{className:"users-toolbar",children:[o.jsxs("form",{className:"users-search",onSubmit:R,children:[o.jsx("input",{value:u,onChange:T=>d(T.target.value),onKeyDown:T=>{T.key==="Enter"&&(T.nativeEvent.isComposing||T.keyCode===229)&&T.preventDefault()},"aria-label":t("searchPlaceholder"),placeholder:t("searchPlaceholder"),maxLength:200}),o.jsx("button",{type:"submit",className:"users-button",disabled:s,children:t("search")})]}),o.jsx("div",{className:"users-role-filter",children:o.jsx(jg,{ariaLabel:t("filterRole"),placeholder:t("allRoles"),value:m,options:[{value:"",label:t("allRoles")},...GS.map(T=>({value:T,label:t(`roles.${T}`)}))],onChange:T=>{const N=GS.find(_=>_===T);g(N??""),v(1)}})}),o.jsxs("button",{type:"button",className:"users-button users-refresh",disabled:s,onClick:()=>{k(null),w(T=>T+1)},children:[o.jsx(rit,{}),o.jsx("span",{children:t("refresh")})]})]}),o.jsx("div",{className:"users-feedback","aria-live":"polite",children:s?o.jsx(mn,{children:t("loading")}):S?o.jsx("span",{children:t("saved",{name:S.name,role:t(`roles.${S.role}`)})}):C?o.jsx("span",{children:t("updatedAt",{time:C.toLocaleTimeString(n.resolvedLanguage,{hour:"2-digit",minute:"2-digit",hour12:!1})})}):null}),l?o.jsxs("div",{className:"users-error users-error-banner",role:"alert",children:[o.jsx("span",{children:t(`errors.${l}`,{defaultValue:t("errors.request_failed")})}),o.jsx("button",{type:"button",className:"users-button",onClick:()=>w(T=>T+1),children:t("retry")})]}):null,o.jsxs("div",{className:"users-table-wrap","aria-busy":s,children:[o.jsxs("table",{className:"users-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:t("user")}),o.jsx("th",{scope:"col",children:t("role")}),o.jsx("th",{scope:"col",children:t("status")}),o.jsx("th",{scope:"col",children:t("lastLogin")}),o.jsx("th",{scope:"col",children:o.jsx("span",{className:"sr-only",children:t("actions")})})]})}),o.jsx("tbody",{children:i==null?void 0:i.items.map(T=>{var N;return o.jsxs("tr",{children:[o.jsx("td",{"data-label":t("user"),children:o.jsxs("div",{className:"users-person",children:[o.jsx("span",{className:"users-avatar","aria-hidden":"true",children:(N=Array.from(T.name)[0])==null?void 0:N.toUpperCase()}),o.jsxs("div",{className:"users-account",children:[o.jsxs("strong",{children:[T.name,T.currentUser?o.jsx("span",{className:"users-self",children:t("you")}):null]}),o.jsx("span",{title:T.email||T.id,children:T.email||T.id})]})]})}),o.jsxs("td",{"data-label":t("role"),children:[o.jsx("span",{className:`users-role-badge${T.role==="super_admin"?" is-super":""}`,children:t(`roles.${T.role}`)}),T.roleConflict?o.jsx("span",{className:"users-inline-warning",children:t("roleConflict")}):null]}),o.jsx("td",{"data-label":t("status"),children:o.jsx("span",{className:"users-status",children:t(`states.${T.status}`,{defaultValue:t("unknown")})})}),o.jsx("td",{"data-label":t("lastLogin"),className:"users-last-login",children:A(T.lastLogin)}),o.jsx("td",{className:"users-actions",children:T.protected?o.jsx("span",{className:"users-protected",title:t("protectedExplanation"),children:t("initialAdministrator")}):o.jsx("button",{type:"button",className:"users-button is-text",disabled:s||!!l||T.currentUser,onClick:()=>{k(null),O(T)},children:t("changeRole")})})]},T.id)})})]}),!s&&!l&&(i==null?void 0:i.items.length)===0?o.jsxs("div",{className:"users-empty",children:[o.jsx("strong",{children:t("noUsers")}),o.jsx("span",{children:t(f||m?"tryAnotherSearch":"poolEmpty")})]}):null,s&&!i?o.jsx("div",{className:"users-empty",children:o.jsx(mn,{children:t("loading")})}):null]}),i?o.jsxs("footer",{className:"users-pagination",children:[o.jsx("span",{children:t("resultCount",{count:i.total})}),o.jsxs("div",{children:[o.jsx("button",{type:"button",className:"users-button",disabled:b<=1||s,onClick:()=>v(T=>T-1),children:t("previous")}),o.jsxs("span",{children:[b," / ",j]}),o.jsx("button",{type:"button",className:"users-button",disabled:b>=j||s,onClick:()=>v(T=>T+1),children:t("next")})]})]}):null]}),x?o.jsx(sit,{user:x,onClose:()=>O(null),onSaved:T=>{O(null),k(T),w(N=>N+1)}}):null]})}const ait=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"})}),lit=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"})}),cit=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"})}),pP=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"})}),P2=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"})}),uit=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"})]}),YS=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"})}),J2e=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"})}),dit=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"})}),fit=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"})}),hit=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"})}),pQ=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"})}),pit=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"})}),eAe=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"})}),mit=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"})}),git=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"})}),bit=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"})}),yit=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"})}),vit=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"})}),xit=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"})}),wit=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"})}),tAe=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"})]}),Oit=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"})]}),kit=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"})}),Sit=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"})]}),sZ=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"})]}),Eit=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"})}),nAe=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"})}),iAe=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"})}),Cit=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"})}),Tit=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"})}),Ait=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"})}),_it=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"})}),jit=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"})}),V_=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"})}),Nit=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"})}),Rit=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"})}),rAe=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"})]}),mQ=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"})});/** + */var tP=p,RJe=mI;function IJe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var PJe=typeof Object.is=="function"?Object.is:IJe,DJe=RJe.useSyncExternalStore,MJe=tP.useRef,LJe=tP.useEffect,$Je=tP.useMemo,FJe=tP.useDebugValue;CTe.useSyncExternalStoreWithSelector=function(e,t,n,i,r){var s=MJe(null);if(s.current===null){var a={hasValue:!1,value:null};s.current=a}else a=s.current;s=$Je(function(){function c(m){if(!u){if(u=!0,d=m,m=i(m),r!==void 0&&a.hasValue){var g=a.value;if(r(g,m))return f=g}return f=m}if(g=f,PJe(d,m))return g;var b=i(m);return r!==void 0&&r(g,b)?(d=m,g):(d=m,f=b)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,i,r]);var l=DJe(e,s[0],s[1]);return LJe(function(){a.hasValue=!0,a.value=l},[l]),FJe(l),l};ETe.exports=CTe;var TTe=ETe.exports;const BJe=_w(TTe),UJe=parseInt(p.version,10);function zU(e){return UJe>=e}const QJe=zU(19),zJe=QJe?HJe:qJe;function ATe(e,t,n,i,r){return zJe(e,t,n,i,r)}function VJe(e,t,n,i,r){const s=p.useCallback(()=>t(e.getSnapshot(),n,i,r),[e,t,n,i,r]);return mI.useSyncExternalStore(e.subscribe,s,s)}function HJe(e,t,n,i,r){return VJe(e,t,n,i,r)}function qJe(e,t,n,i,r){return TTe.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,i,r))}class WJe{constructor(t){rn(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));rn(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const i of this.listeners){if(n!==this.updateTick)return;i(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,i,r){return ATe(this,t,n,i,r)}}const VU={...By},H5=VU.useInsertionEffect,KJe=H5&&H5!==VU.useLayoutEffect?H5:e=>e();function Gn(e){const t=Gu(GJe).current;return t.next=e,KJe(t.effect),t.trampoline}function GJe(){const e={next:void 0,callback:XJe,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function XJe(){}class nP extends WJe{constructor(t,n={},i){super(t),this.context=n,this.selectors=i}useSyncedValue(t,n){p.useDebugValue(t);const i=this;Qn(()=>{i.state[t]!==n&&i.set(t,n)},[i,t,n])}useSyncedValueWithCleanup(t,n){const i=this;Qn(()=>(i.state[t]!==n&&i.set(t,n),()=>{i.set(t,void 0)}),[i,t,n])}useSyncedValues(t){const n=this,i=Object.values(t);Qn(()=>{n.update(t)},[n,...i])}useControlledProp(t,n){p.useDebugValue(t);const i=this,r=n!==void 0;Qn(()=>{r&&!Object.is(i.state[t],n)&&i.setState({...i.state,[t]:n})},[i,t,n,r])}select(t,n,i,r){const s=this.selectors[t];return s(this.state,n,i,r)}useState(t,n,i,r){return p.useDebugValue(t),ATe(this,this.selectors[t],n,i,r)}useContextCallback(t,n){p.useDebugValue(t);const i=Gn(n??UU);this.context[t]=i}useStateSetter(t){const n=p.useRef(void 0);return n.current===void 0&&(n.current=i=>{this.set(t,i)}),n.current}observe(t,n){let i;typeof t=="function"?i=t:i=this.selectors[t];let r=i(this.state);return n(r,r,this),this.subscribe(s=>{const a=i(s);if(!Object.is(r,a)){const l=r;r=a,n(a,l,this)}})}}function iP(){return typeof window<"u"}function Wa(e){return HU(e)?(e.nodeName||"").toLowerCase():"#document"}function Ws(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ep(e){var t;return(t=(HU(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function HU(e){return iP()?e instanceof Node||e instanceof Ws(e).Node:!1}function pr(e){return iP()?e instanceof Element||e instanceof Ws(e).Element:!1}function Hs(e){return iP()?e instanceof HTMLElement||e instanceof Ws(e).HTMLElement:!1}function Yx(e){return!iP()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ws(e).ShadowRoot}function CC(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=uu(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&r!=="inline"&&r!=="contents"}function YJe(e){return/^(table|td|th)$/.test(Wa(e))}function rP(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const ZJe=/transform|translate|scale|rotate|perspective|filter/,JJe=/paint|layout|strict|content/,ib=e=>!!e&&e!=="none";let q5;function qU(e){const t=pr(e)?uu(e):e;return ib(t.transform)||ib(t.translate)||ib(t.scale)||ib(t.rotate)||ib(t.perspective)||!WU()&&(ib(t.backdropFilter)||ib(t.filter))||ZJe.test(t.willChange||"")||JJe.test(t.contain||"")}function eet(e){let t=sg(e);for(;Hs(t)&&!Vm(t);){if(qU(t))return t;if(rP(t))return null;t=sg(t)}return null}function WU(){return q5==null&&(q5=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),q5}function Vm(e){return/^(html|body|#document)$/.test(Wa(e))}function uu(e){return Ws(e).getComputedStyle(e)}function sP(e){return pr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function sg(e){if(Wa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Yx(e)&&e.host||Ep(e);return Yx(t)?t.host:t}function _Te(e){const t=sg(e);return Vm(t)?(e.ownerDocument||e).body:Hs(t)&&CC(t)?t:_Te(t)}function qS(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=_Te(e),s=r===((i=e.ownerDocument)==null?void 0:i.body),a=Ws(r);if(s){const l=rF(a);return t.concat(a,a.visualViewport||[],CC(r)?r:[],l&&n?qS(l):[])}else return t.concat(r,qS(r,[],n))}function rF(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Pf(...e){return()=>{for(let t=0;t{e.removeEventListener(t,n,i)}}const CA=null;let tet=class{constructor(){rn(this,"callbacks",[]);rn(this,"callbacksCount",0);rn(this,"nextId",1);rn(this,"startId",1);rn(this,"isScheduled",!1);rn(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)}},TA=new tet;class ec{constructor(){rn(this,"currentId",CA);rn(this,"cancel",()=>{this.currentId!==CA&&(TA.cancel(this.currentId),this.currentId=CA)});rn(this,"disposeEffect",()=>this.cancel)}static create(){return new ec}static request(t){return TA.request(t)}static cancel(t){return TA.cancel(t)}request(t){this.cancel(),this.currentId=TA.request(()=>{this.currentId=CA,t()})}}function KU(){const e=Gu(ec.create).current;return eP(e.disposeEffect),e}const oO=0;class du{constructor(){rn(this,"currentId",oO);rn(this,"clear",()=>{this.currentId!==oO&&(clearTimeout(this.currentId),this.currentId=oO)});rn(this,"disposeEffect",()=>this.clear)}static create(){return new du}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=oO,n()},t)}isStarted(){return this.currentId!==oO}}function yy(){const e=Gu(du.create).current;return eP(e.disposeEffect),e}let kY=0;function net(e){return kY+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${kY}`}function W5(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}function iet(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:ret,platform:set,maxTouchPoints:oet}=iet(),oP=ret.toLowerCase(),WS=set.toLowerCase(),aP=/^i(os$|p)/.test(WS)||WS==="macintel"&&oet>1,SY="android",sF=WS===SY||oP.includes(SY),aet=!aP&&WS.startsWith("mac");WS.startsWith("win");const cet=aet||aP;var Ele;const Vw=typeof CSS<"u"&&!!((Ele=CSS.supports)!=null&&Ele.call(CSS,"-webkit-backdrop-filter:none"));!Vw&&oP.includes("firefox");!Vw&&oP.includes("chrom");const uet=cet,jTe=/jsdom|happydom/.test(oP),oF="data-base-ui-focusable",NTe="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Zl(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function qn(e,t){var i;if(!e||!t)return!1;const n=(i=t.getRootNode)==null?void 0:i.call(t);if(e.contains(t))return!0;if(n&&Yx(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function na(e){return"composedPath"in e?e.composedPath()[0]:e.target}function RTe(e,t){if(!pr(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,i]of t.entries())if(qn(i,n))return!i.hasAttribute("data-trigger-disabled");return!1}function K5(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function det(e){return e.matches("html,body")}function GU(e){return Hs(e)&&e.matches(NTe)}function fet(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${NTe}`))!=null}function EY(e){return e?e.getAttribute("role")==="combobox"&&GU(e):!1}function aF(e){if(!e||jTe)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function CY(e){return e?e.hasAttribute(oF)?e:e.querySelector(`[${oF}]`)||e:null}function og(e,t,n=!0){return e.filter(r=>r.parentId===t).flatMap(r=>{var s;return[...!n||(s=r.context)!=null&&s.open?[r]:[],...og(e,r.id,n)]})}function TY(e,t){var r;let n=[],i=(r=e.find(s=>s.id===t))==null?void 0:r.parentId;for(;i;){const s=e.find(a=>a.id===i);i=s==null?void 0:s.parentId,s&&(n=n.concat(s))}return n}function het(e){e.preventDefault(),e.stopPropagation()}function pet(e){return"nativeEvent"in e}function met(e){return e.pointerType===""&&e.isTrusted?!0:sF&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function ITe(e){return jTe?!1:!sF&&e.width===0&&e.height===0||sF&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function rx(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function get(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const bet=["top","right","bottom","left"],ag=Math.min,qh=Math.max,EN=Math.round,AA=Math.floor,Wh=e=>({x:e,y:e}),yet={left:"right",right:"left",bottom:"top",top:"bottom"};function XU(e,t,n){return qh(e,ag(t,n))}function Ff(e,t){return typeof e=="function"?e(t):e}function Vu(e){return e.split("-")[0]}function Cp(e){return e.split("-")[1]}function YU(e){return e==="x"?"y":"x"}function lP(e){return e==="y"?"height":"width"}function Mu(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function cP(e){return YU(Mu(e))}function vet(e,t,n){n===void 0&&(n=!1);const i=Cp(e),r=cP(e),s=lP(r);let a=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=CN(a)),[a,CN(a)]}function xet(e){const t=CN(e);return[lF(e),t,lF(t)]}function lF(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const AY=["left","right"],_Y=["right","left"],wet=["top","bottom"],Oet=["bottom","top"];function ket(e,t,n){switch(e){case"top":case"bottom":return n?t?_Y:AY:t?AY:_Y;case"left":case"right":return t?wet:Oet;default:return[]}}function Eet(e,t,n,i){const r=Cp(e);let s=ket(Vu(e),n==="start",i);return r&&(s=s.map(a=>a+"-"+r),t&&(s=s.concat(s.map(lF)))),s}function CN(e){const t=Vu(e);return yet[t]+e.slice(t.length)}function Cet(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 ZU(e){return typeof e!="number"?Cet(e):{top:e,right:e,bottom:e,left:e}}function TN(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 Tet(e){return e.visibility==="hidden"||e.visibility==="collapse"}function PTe(e,t=e?uu(e):null){return!e||!e.isConnected||!t||Tet(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const Aet='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function _et(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Yx(n)?n.host:null}function cF(e){for(const t of Array.from(e.children))if(Wa(t)==="summary")return t;return null}function jet(e,t){const n=cF(t);return!!n&&(e===n||qn(n,e))}function DTe(e){const t=e?Wa(e):"";return e!=null&&e.matches(Aet)&&(t!=="summary"||e.parentElement!=null&&Wa(e.parentElement)==="details"&&cF(e.parentElement)===e)&&(t!=="details"||cF(e)==null)&&(t!=="input"||e.type!=="hidden")}function MTe(e){if(!DTe(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=_et(t)){const n=t!==e,i=Wa(t)==="slot";if(t.hasAttribute("inert")||n&&Wa(t)==="details"&&!t.open&&!jet(e,t)||t.hasAttribute("hidden")||!i&&!Net(t,n))return!1}return!0}function Net(e,t){const n=uu(e);return t?n.display!=="none":PTe(e,n)}function LTe(e){const t=e.tabIndex;if(t<0){const n=Wa(e);if(n==="details"||n==="audio"||n==="video"||Hs(e)&&e.isContentEditable)return 0}return t}function G5(e){if(Wa(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function Ret(e,t){const n=G5(e);if(!n)return!0;const i=t.find(r=>{const s=G5(r);return(s==null?void 0:s.name)===n.name&&s.form===n.form&&s.checked});return i?i===n:t.find(r=>{const s=G5(r);return(s==null?void 0:s.name)===n.name&&s.form===n.form})===n}function $Te(e){if(Hs(e)&&Wa(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Hs(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function FTe(e,t){$Te(e).forEach(n=>{DTe(n)&&t.push(n),FTe(n,t)})}function BTe(e,t,n){$Te(e).forEach(i=>{Hs(i)&&i.matches(t)&&n.push(i),BTe(i,t,n)})}function JU(e){return MTe(e)&<e(e)>=0}function UTe(e){const t=[];return FTe(e,t),t.filter(MTe)}function TC(e){const t=UTe(e);return t.filter(n=>LTe(n)>=0&&Ret(n,t))}function QTe(e,t){const n=TC(e),i=n.length;if(i===0)return;const r=Zl(fr(e)),s=n.indexOf(r),a=s===-1?t===1?0:i-1:s+t;return n[a]}function eQ(e){return QTe(fr(e).body,1)||e}function zTe(e){return QTe(fr(e).body,-1)||e}function VTe(e,t){if(!e)return null;const n=TC(fr(e).body),i=n.length;if(i===0)return null;const r=n.indexOf(e);if(r===-1)return null;const s=(r+t+i)%i;return n[s]}function Iet(e){return VTe(e,1)}function Pet(e){return VTe(e,-1)}function sx(e,t){const n=t||e.currentTarget,i=e.relatedTarget;return!i||!qn(n,i)}function Det(e){TC(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function jY(e){const t=[];BTe(e,"[data-tabindex]",t),t.forEach(n=>{const i=n.dataset.tabindex;delete n.dataset.tabindex,i?n.setAttribute("tabindex",i):n.removeAttribute("tabindex")})}function X5(e){const t=new Map;let n=0,i=0;return e.forEach((r,s)=>{const a=r.transitionStatus==="ending";t.set(r.id,{value:r,domIndex:s,visibleIndex:a?-1:n,offsetY:i}),i+=r.height||0,a||(n+=1)}),t}function Y5(e,t){let n=0;return e.map(i=>{if(i.transitionStatus==="ending")return i;const r=n>=t;return n+=1,i.limited===r?i:{...i,limited:r}})}const rf={toasts:e=>e.toasts,isEmpty:e=>e.toasts.length===0,toast:(e,t)=>{var n;return(n=e.toastMetadata.get(t))==null?void 0:n.value},toastIndex:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.domIndex)??-1},toastOffsetY:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.offsetY)??0},toastVisibleIndex:(e,t)=>{var n;return((n=e.toastMetadata.get(t))==null?void 0:n.visibleIndex)??-1},focused:e=>e.focused,expanded:e=>e.hovering||e.focused,expandedOrOutOfFocus:e=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:e=>e.prevFocusElement};class Met extends nP{constructor(n){super({...n,toastMetadata:X5(n.toasts)},{},rf);rn(this,"timers",new Map);rn(this,"areTimersPaused",!1);rn(this,"setViewport",n=>{this.set("viewport",n)});rn(this,"disposeEffect",()=>()=>{this.timers.forEach(n=>{var i;(i=n.timeout)==null||i.clear()}),this.timers.clear()});rn(this,"addToast",n=>{const{timeout:i,limit:r}=this.state,s=n.id||net("toast");if(n.id){const u=rf.toast(this.state,n.id);if(u)if(u.transitionStatus==="ending")this.removeToast(n.id,!0);else{const{id:d,transitionStatus:f,...h}=n;return this.updateToastInternal(n.id,h,!0,!0),n.id}}const a={...n,id:s,updateKey:0,transitionStatus:"starting"},l=[a,...this.state.toasts];this.setToasts(Y5(l,r));const c=a.timeout??i;return a.type!=="loading"&&c>0&&this.scheduleTimer(s,c,()=>this.closeToast(s)),rf.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),s});rn(this,"updateToast",(n,i)=>{this.updateToastInternal(n,i,!1,!0)});rn(this,"updateToastInternal",(n,i,r=!1,s=!1)=>{const{timeout:a,toasts:l}=this.state,c=rf.toast(this.state,n);if(!c||c.transitionStatus==="ending")return;const u={...c,...i,...s&&{updateKey:c.updateKey+1}};this.setToasts(l.map(y=>y.id===n?u:y));const d=u.timeout??a,f=c.timeout??a,h=Object.hasOwn(i,"timeout"),m=u.transitionStatus!=="ending"&&u.type!=="loading"&&d>0,g=this.timers.has(n),b=f!==d,v=c.type==="loading";if(!m&&g){this.clearTimer(n);return}m&&(!g||b||h||v||r)&&(this.clearTimer(n),this.scheduleTimer(n,d,()=>this.closeToast(n)),rf.expandedOrOutOfFocus(this.state)&&this.pauseTimers())});rn(this,"closeToast",n=>{const i=n===void 0,{limit:r,toasts:s}=this.state;let a;if(i)a=s,this.clearTimers();else{const u=rf.toast(this.state,n);if(!u)return;a=[u],this.clearTimer(n)}const l=s.map(u=>i||u.id===n?{...u,transitionStatus:"ending",height:0}:u),c=Y5(l,r);this.setToasts(c,!c.some(u=>u.transitionStatus!=="ending")),a.forEach(u=>{var d;u.transitionStatus!=="ending"&&((d=u.onClose)==null||d.call(u))}),this.handleFocusManagement(n)});rn(this,"promiseToast",(n,i)=>{const r=W5(i.loading),s=this.addToast({...r,type:"loading"}),a=n.then(l=>{const c=W5(i.success,l);return this.updateToast(s,{...c,type:"success",timeout:c.timeout}),l}).catch(l=>{const c=W5(i.error,l);return this.updateToast(s,{...c,type:"error",timeout:c.timeout}),Promise.reject(l)});return{}.hasOwnProperty.call(i,"setPromise")&&i.setPromise(a),a});rn(this,"handleDocumentPointerDown",n=>{if(n.pointerType!=="touch")return;const i=na(n);qn(this.state.viewport,i)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))})}syncProviderProps(n,i){const r=this.state.limit!==i;if(this.state.timeout===n&&!r)return;const s={timeout:n,limit:i};if(r){const a=Y5(this.state.toasts,i);s.toasts=a,s.toastMetadata=X5(a)}this.update(s)}removeToast(n,i=!1){var l;const r=rf.toastIndex(this.state,n);if(r===-1)return;const s=this.state.toasts[r];i||(l=s==null?void 0:s.onRemove)==null||l.call(s);const a=[...this.state.toasts];a.splice(r,1),this.setToasts(a)}pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(n=>{n.timeout&&(n.timeout.clear(),n.remaining=Math.max(n.remaining-(Date.now()-n.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((n,i)=>{n.remaining=n.remaining>0?n.remaining:n.delay,n.timeout??(n.timeout=du.create()),n.timeout.start(n.remaining,()=>{this.handleTimerFired(i),n.callback()}),n.start=Date.now()}))}restoreFocusToPrevElement(){var n;(n=this.state.prevFocusElement)==null||n.focus({preventScroll:!0})}scheduleTimer(n,i,r){const s=Date.now(),l=!rf.expandedOrOutOfFocus(this.state)?du.create():void 0;l==null||l.start(i,()=>{this.handleTimerFired(n),r()}),this.timers.set(n,{timeout:l,start:s,delay:i,remaining:i,callback:r})}clearTimers(){this.timers.forEach(n=>{var i;(i=n.timeout)==null||i.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(n){var r;const i=this.timers.get(n);(r=i==null?void 0:i.timeout)==null||r.clear(),this.timers.delete(n),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(n){this.timers.delete(n),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(n,i=n.length===0){const r={toasts:n,toastMetadata:X5(n)};i&&(r.hovering=!1,r.focused=!1),this.update(r)}handleFocusManagement(n){var c,u;const i=Zl(fr(this.state.viewport));if(!this.state.viewport||!qn(this.state.viewport,i)||!aF(i))return;if(n===void 0){this.restoreFocusToPrevElement();return}const r=rf.toasts(this.state),s=rf.toastIndex(this.state,n),a=(d,f)=>{for(let h=d;h>=0&&hnew Met({timeout:i,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return eP(a.disposeEffect),p.useEffect(function(){return s?s[" subscribe"](({action:u,options:d})=>{const f=d.id;u==="promise"&&d.promise?a.promiseToast(d.promise,d):u==="update"&&f?a.updateToast(f,d):u==="close"?a.closeToast(f):a.addToast(d)}):void 0},[a,s]),o.jsxs(STe.Provider,{value:a,children:[o.jsx($et,{store:a,timeout:i,limit:r}),n]})};function $et(e){const{store:t,timeout:n,limit:i}=e;return Qn(()=>{t.syncProviderProps(n,i)},[t,n,i]),null}const Fet={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},HTe={...Fet,position:"fixed",top:0,left:0},vy=p.forwardRef(function(t,n){const[i,r]=p.useState();Qn(()=>{uet&&Vw&&r("button")},[]);const s={tabIndex:0,role:i};return o.jsx("span",{...t,ref:n,style:HTe,"aria-hidden":i?void 0:!0,...s,"data-base-ui-focus-guard":""})});function Zx(e,t,n,i){const r=Gu(qTe).current;return Uet(r,e,t,n,i)&&WTe(r,[e,t,n,i]),r.callback}function Bet(e){const t=Gu(qTe).current;return Qet(t,e)&&WTe(t,e),t.callback}function qTe(){return{callback:null,cleanup:null,refs:[]}}function Uet(e,t,n,i,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==i||e.refs[3]!==r}function Qet(e,t){return e.refs.length!==t.length||e.refs.some((n,i)=>n!==t[i])}function WTe(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=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function iQ(e){return typeof e=="function"}function XTe(e,t){return iQ(e)?e(t):e??tQ}function Ket(e,t){return t?e?(...n)=>{const i=n[0];if(JTe(i)){const s=i;_N(s);const a=t(...n);return s.baseUIHandlerPrevented||e==null||e(...n),a}const r=t(...n);return e==null||e(...n),r}:YTe(t):e}function YTe(e){return e&&((...t)=>{const n=t[0];return JTe(n)&&_N(n),e(...t)})}function _N(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function ZTe(e,t){return t?e?t+" "+e:t:e}function JTe(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Eo(e,t,n={}){const i=t.render,r=Get(t,n);if(n.enabled===!1)return null;const s=n.state??Nl;return Zet(e,i,r,s)}function Get(e,t={}){const{className:n,style:i,render:r}=e,{state:s=Nl,ref:a,props:l,stateAttributesMapping:c,enabled:u=!0}=t,d=u?Vet(n,s):void 0,f=u?KTe(i,s):void 0,h=u?zet(s,c):Nl,m=u&&l?Xet(l):void 0,g=u?uF(h,m)??{}:Nl;return typeof document<"u"&&(u?Array.isArray(a)?g.ref=Bet([g.ref,NY(r),...a]):g.ref=Zx(g.ref,NY(r),a):Zx(null,null)),u?(d!==void 0&&(g.className=ZTe(g.className,d)),f!==void 0&&(g.style=uF(g.style,f)),g):Nl}function Xet(e){return Array.isArray(e)?Het(e):nQ(void 0,e)}const Yet=Symbol.for("react.lazy");function Zet(e,t,n,i){if(t){if(typeof t=="function")return t(n,i);const r=nQ(n,t.props);r.ref=n.ref;let s=t;return(s==null?void 0:s.$$typeof)===Yet&&(s=p.Children.toArray(t)[0]),p.cloneElement(s,r)}if(e&&typeof e=="string")return Jet(e,n);throw new Error(gc(8))}function Jet(e,t){return e==="button"?p.createElement("button",{type:"button",...t,key:t.key}):e==="img"?p.createElement("img",{alt:"",...t,key:t.key}):p.createElement(e,t)}const ett=p.forwardRef(function(t,n){var B;const{render:i,className:r,style:s,children:a,...l}=t,c=QU(),u=yy(),d=p.useRef(!1),f=p.useRef(!1),h=p.useRef(!1),m=c.useState("isEmpty"),g=c.useState("toasts"),b=c.useState("focused"),v=c.useState("expanded"),y=c.useState("prevFocusElement"),w=(B=g[0])==null?void 0:B.height,x=g.some(M=>M.transitionStatus==="ending"),O=g.filter(M=>M.priority==="high");p.useEffect(()=>{const M=c.state.viewport;if(!M||m)return;const H=Ws(M),K=fr(M);function F(X){X.key==="F6"&&na(X)!==M&&(X.preventDefault(),c.set("prevFocusElement",Zl(K)),M==null||M.focus({preventScroll:!0}),c.pauseTimers(),c.set("focused",!0))}function q(X){na(X)===H&&(c.set("isWindowFocused",!1),c.pauseTimers())}function Q(X){if(X.relatedTarget)return;const ne=na(X),z=Zl(fr(M));(ne===H||!qn(M,ne)||!aF(z))&&c.resumeTimers(),u.start(0,()=>c.set("isWindowFocused",!0))}return Pf(yi(H,"keydown",F),yi(H,"blur",q,!0),yi(H,"focus",Q,!0),yi(K,"pointerdown",c.handleDocumentPointerDown,!0))},[c,u,m]);function S(M){var K,F;d.current=!0;const H=M.relatedTarget===c.state.viewport?g.find(q=>q.transitionStatus!=="ending"&&!q.limited):void 0;H?(F=(K=H.ref)==null?void 0:K.current)==null||F.focus():c.restoreFocusToPrevElement()}function k(M){M.key==="Tab"&&M.shiftKey&&na(M.nativeEvent)===c.state.viewport&&(M.preventDefault(),c.restoreFocusToPrevElement())}function C(){c.state.toasts.some(H=>H.transitionStatus==="ending")||h.current||!f.current||(c.state.isWindowFocused&&c.resumeTimers(),c.set("hovering",!1),f.current=!1)}p.useEffect(C,[x,c]);function E(){c.pauseTimers(),c.set("hovering",!0),f.current=!1}function R(){c.state.isWindowFocused&&c.resumeTimers()}function A(){f.current=!0,C()}function N(M){M.pointerType==="touch"&&(h.current=!0)}function T(M){M.pointerType==="touch"&&(h.current=!1,C())}function j(){if(d.current){d.current=!1;return}b||aF(Zl(fr(c.state.viewport)))&&(c.set("focused",!0),c.pauseTimers())}function _(M){!b||qn(c.state.viewport,M.relatedTarget)||(c.set("focused",!1),R())}const I={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:E,onMouseMove:E,onMouseLeave:A,onFocus:j,onBlur:_,onKeyDown:k,onClick:j,onPointerDown:N,onPointerUp:T,onPointerCancel:T,style:{"--toast-frontmost-height":w?`${w}px`:void 0}},D={expanded:v},P=!m&&y&&o.jsx(vy,{onFocus:S}),L=Eo("div",t,{ref:[n,c.setViewport],state:D,props:[I,l,{children:o.jsxs(p.Fragment,{children:[P,a,P]})}]});return o.jsxs(p.Fragment,{children:[P,L,!b&&O.length>0&&o.jsx("div",{style:HTe,children:O.map(M=>o.jsxs("div",{role:"alert","aria-atomic":!0,children:[o.jsx("div",{children:M.title}),o.jsx("div",{children:M.description})]},M.id))})]})});function rQ(e){return zU(19)?e:e?"true":void 0}const eAe=p.createContext(void 0);function ttt(){const e=p.useContext(eAe);if(!e)throw new Error(gc(66));return e}let jN=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const ntt={"data-starting-style":""},itt={"data-ending-style":""},uP={transitionStatus(e){return e==="starting"?ntt:e==="ending"?itt:null}};function gh(e){return e==null?e:"current"in e?e.current:e}function sQ(e,t=!1){const n=KU();return Gn((i,r=null)=>{n.cancel();const s=gh(e);if(s==null)return;const a=s,l=()=>{ri.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 AC(e){const{enabled:t=!0,open:n,ref:i,onComplete:r}=e,s=Gn(r),a=sQ(i,n);p.useEffect(()=>{if(!t)return;const l=new AbortController;return a(s,l.signal),()=>{l.abort()}},[t,n,s,a])}const rtt=500,stt={style:{transition:"none"}},oQ="data-base-ui-click-trigger",ott="data-base-ui-swipe-ignore",att="data-swipe-ignore",ltt=`[${ott}]`,ctt=`[${att}]`,utt={fallbackAxisSide:"end"},dtt={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Z5(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function ftt(e){const n=Ws(e).getComputedStyle(e).transform;let i=0,r=0,s=1;if(n&&n!=="none"){const a=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(a){const l=a[1].split(", ").map(parseFloat);l.length===6?(i=l[4],r=l[5],s=Math.sqrt(l[0]*l[0]+l[1]*l[1])):l.length===16&&(i=l[12],r=l[13],s=l[0])}}return{x:i,y:r,scale:s}}const htt={...uP,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},RY=40,ptt=10,IY=.5,mtt=1,gtt=`${ltt},${ctt}`,btt=p.forwardRef(function(t,n){var Ue;const{toast:i,render:r,className:s,swipeDirection:a=["down","right"],style:l,...c}=t,u=((Ue=i.positionerProps)==null?void 0:Ue.anchor)!==void 0;let d=[];u||(d=Array.isArray(a)?a:[a]);const f=d.length>0,h=QU(),[m,g]=p.useState(void 0),[b,v]=p.useState(!1),[y,w]=p.useState(!1),[x,O]=p.useState({x:0,y:0}),[S,k]=p.useState({x:0,y:0,scale:1}),[C,E]=p.useState(),[R,A]=p.useState(),[N,T]=p.useState(null),j=p.useRef(null),_=p.useRef(void 0),I=p.useRef({x:0,y:0}),D=p.useRef({x:0,y:0,scale:1}),P=p.useRef(void 0),L=p.useRef(0),B=p.useRef(!1),M=p.useRef({x:0,y:0}),H=p.useRef(!1),K=p.useRef({x:0,y:0}),F=p.useRef(null),q=p.useRef(null),Q=h.useState("toastIndex",i.id),X=h.useState("toastVisibleIndex",i.id),ne=h.useState("toastOffsetY",i.id),z=h.useState("focused"),Y=h.useState("expanded");AC({open:i.transitionStatus!=="ending",ref:j,onComplete(){i.transitionStatus==="ending"&&h.removeToast(i.id)}});const ae=Gn((ke=!1)=>{const je=j.current;if(!je)return;const re=je.style.height;je.style.height="auto";const ve=je.offsetHeight;je.style.height=re;function be(){h.updateToastInternal(i.id,{ref:j,height:ve,transitionStatus:void 0})}ke?ri.flushSync(be):be()});Qn(()=>{const ke=_.current;i.transitionStatus!=="starting"&&ke===i.id||(ke!==void 0&&(g(void 0),k({x:0,y:0,scale:1}),Ee({x:0,y:0})),_.current=i.id,ae())},[ae,i.id,i.transitionStatus]);function Ee(ke){K.current=ke,O(ke)}Qn(()=>()=>{var ke;(ke=q.current)==null||ke.abort()},[]);function Z(ke,je){const re=xe=>xe>0?xe**IY:-(Math.abs(xe)**IY),ve=ke>0&&!d.includes("right")||ke<0&&!d.includes("left"),be=je>0&&!d.includes("down")||je<0&&!d.includes("up");return{x:ve?re(ke):ke,y:be?re(je):je}}const G=Gn(ke=>{var Ke;if(ke.pointerId!==F.current)return;F.current=null,(Ke=q.current)==null||Ke.abort(),q.current=null,v(!1),w(!1),T(null);const je=D.current;if(ke.type==="pointercancel"||B.current){Ee({x:je.x,y:je.y}),g(void 0);return}const re=K.current,ve=re.x-je.x,be=re.y-je.y;let xe;for(const Ze of d)if(Z5(Ze,ve,be)>RY){xe=Ze;break}xe?(g(xe),h.closeToast(i.id)):(Ee({x:je.x,y:je.y}),g(void 0))});function te(ke){var Ze,he;if(ke.button!==0)return;ke.pointerType==="touch"&&h.pauseTimers();const je=na(ke.nativeEvent);if(je==null?void 0:je.closest(`button,a,input,textarea,[role="button"],${gtt}`))return;B.current=!1,P.current=void 0,L.current=0,F.current=ke.pointerId,I.current={x:ke.clientX,y:ke.clientY},M.current=I.current;const ve=ke.currentTarget,be=ftt(ve);D.current=be,k(be),Ee({x:be.x,y:be.y}),h.set("hovering",!0),v(!0),w(!1),T(null),H.current=!0,(Ze=q.current)==null||Ze.abort();const xe=new AbortController;q.current=xe;const Ke=fr(ve);Ke.addEventListener("pointerup",G,{signal:xe.signal}),Ke.addEventListener("pointercancel",G,{signal:xe.signal}),(he=ve.setPointerCapture)==null||he.call(ve,ke.pointerId)}function de(ke){if(ke.pointerId!==F.current)return;ke.preventDefault(),H.current&&(I.current={x:ke.clientX,y:ke.clientY},H.current=!1);const{clientY:je,clientX:re,movementX:ve,movementY:be}=ke;(be<0&&je>M.current.y||be>0&&jeM.current.x||ve>0&&re=mtt){w(!0);const Tt=d.includes("left")||d.includes("right"),ft=d.includes("up")||d.includes("down");if(Tt&&ft){const pt=Math.abs(xe),Pe=Math.abs(Ke);ye=pt>Pe?"horizontal":"vertical",T(ye)}}let Ae;if(!P.current)ye==="vertical"?Ke>0?Ae="down":Ke<0&&(Ae="up"):ye==="horizontal"?xe>0?Ae="right":xe<0&&(Ae="left"):Math.abs(xe)>=Math.abs(Ke)?Ae=xe>0?"right":"left":Ae=Ke>0?"down":"up",Ae&&d.includes(Ae)&&(P.current=Ae,L.current=Z5(Ae,xe,Ke),g(Ae));else{const vt=P.current,Tt=Z5(vt,he,Ze);Tt>RY?(B.current=!1,g(vt)):!(d.includes("left")&&d.includes("right"))&&!(d.includes("up")&&d.includes("down"))&&L.current-Tt>=ptt&&(B.current=!0)}const He=Z(xe,Ke);let De=D.current.x,At=D.current.y;const Nt=d.includes("left")||d.includes("right"),Ot=d.includes("up")||d.includes("down");ye!=="vertical"&&Nt&&(De+=He.x),ye!=="horizontal"&&Ot&&(At+=He.y),Ee({x:De,y:At})}function Ce(ke){if(ke.key==="Escape"){if(!j.current||!qn(j.current,Zl(fr(j.current))))return;h.closeToast(i.id)}}p.useEffect(()=>{const ke=j.current;if(!f||!ke)return;function je(re){F.current===null||!qn(ke,na(re))||re.preventDefault()}return yi(ke,"touchmove",je,{passive:!1})},[f]);function le(){const ke=x.x-S.x,je=x.y-S.y;return{transition:b?"none":void 0,transform:b?`translateX(${x.x}px) translateY(${x.y}px) scale(${S.scale})`:void 0,"--toast-swipe-movement-x":`${ke}px`,"--toast-swipe-movement-y":`${je}px`}}const fe=i.priority==="high",ce={role:fe?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":C,"aria-describedby":R,"aria-hidden":fe&&!z?!0:void 0,onPointerDown:f?te:void 0,onPointerMove:f?de:void 0,onPointerUp:f?G:void 0,onPointerCancel:f?G:void 0,onKeyDown:Ce,inert:rQ(i.limited),style:{...le(),"--toast-index":i.transitionStatus==="ending"?Q:X,"--toast-offset-y":`${ne}px`,"--toast-height":i.height?`${i.height}px`:void 0}},Te=p.useMemo(()=>({toast:i,setTitleId:E,setDescriptionId:A,recalculateHeight:ae,visibleIndex:X,expanded:Y}),[i,E,A,ae,X,Y]),Me={transitionStatus:i.transitionStatus,expanded:Y,limited:i.limited||!1,type:i.type,swiping:b,swipeDirection:m},we=Eo("div",t,{ref:[n,j],state:Me,stateAttributesMapping:htt,props:[ce,c]});return o.jsx(eAe.Provider,{value:Te,children:we})});let PY=0;function ytt(e,t="mui"){const[n,i]=p.useState(e),r=e||n;return p.useEffect(()=>{n==null&&(PY+=1,i(`${t}-${PY}`))},[n,t]),r}const DY=VU.useId;function _C(e,t){if(DY!==void 0){const n=DY();return e??(t?`${t}-${n}`:n)}return ytt(e,t)}function tAe(e){return e==null||typeof e=="boolean"||e===""?!1:Array.isArray(e)?e.some(tAe):!0}function vtt(e){return p.isValidElement(e)&&tAe(e.props.children)}function nAe(e,t,n){const{toast:i,setTitleId:r,setDescriptionId:s}=ttt(),a=n==="title"?r:s,l=t??(n==="title"?i.title:i.description);return{id:_C(e),children:l,type:i.type,setId:a}}function iAe(e,t,n){const i=vtt(e);return Qn(()=>{if(i)return n(t),()=>{n(r=>r===t?void 0:r)}},[i,t,n]),i?e:null}const xtt=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:a,children:l,...c}=t,{id:u,children:d,type:f,setId:h}=nAe(a,l,"description"),g=Eo("p",t,{ref:n,state:{type:f},props:{...c,id:u,children:d}});return iAe(g,u,h)}),wtt=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:a,children:l,...c}=t,{id:u,children:d,type:f,setId:h}=nAe(a,l,"title"),g=Eo("h2",t,{ref:n,state:{type:f},props:{...c,id:u,children:d}});return iAe(g,u,h)}),Ott=p.createContext(void 0);function ktt(e=!1){const t=p.useContext(Ott);if(t===void 0&&!e)throw new Error(gc(16));return t}function Stt(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:p.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 J5(e,t,{detail:n=0}={}){e.dispatchEvent(new(Ws(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function dP(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:i=0,native:r=!0,composite:s}=e,a=p.useRef(null),l=ktt(!0),c=s??l!==void 0,{props:u}=Stt({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:i,isNativeButton:r}),d=p.useCallback(()=>{const m=a.current;eL(m)&&c&&t&&u.disabled===void 0&&m.disabled&&(m.disabled=!1)},[t,u.disabled,c]);Qn(d,[d]);const f=p.useCallback((m={})=>{const{onClick:g,onMouseDown:b,onKeyUp:v,onKeyDown:y,onPointerDown:w,...x}=m;return nQ({onClick(O){if(t){O.preventDefault();return}g==null||g(O)},onMouseDown(O){t||b==null||b(O)},onKeyDown(O){if(t||(_N(O),y==null||y(O),O.baseUIHandlerPrevented))return;const S=O.target===O.currentTarget,k=O.currentTarget,C=eL(k),E=!r&&Ett(k),R=S&&(r?C:!E),A=O.key==="Enter",N=O.key===" ",T=k.getAttribute("role"),j=(T==null?void 0:T.startsWith("menuitem"))||T==="option"||T==="gridcell";if(S&&c&&N){if(O.defaultPrevented&&j)return;O.preventDefault(),(!r||C)&&(O.preventBaseUIHandler(),J5(k,O));return}if(!R||r||!N&&!A){S&&E&&N&&O.preventDefault();return}O.defaultPrevented||(O.preventDefault(),A&&(O.preventBaseUIHandler(),J5(k,O)))},onKeyUp(O){if(!t){if(_N(O),v==null||v(O),O.target===O.currentTarget&&r&&c&&eL(O.currentTarget)&&O.key===" "){O.preventDefault();return}O.baseUIHandlerPrevented||O.target===O.currentTarget&&!r&&!c&&!O.defaultPrevented&&O.key===" "&&(O.preventBaseUIHandler(),J5(O.currentTarget,O))}},onPointerDown(O){if(t){O.preventDefault();return}w==null||w(O)}},r?{type:"button"}:{role:"button"},u,x)},[t,u,c,r]),h=Gn(m=>{a.current=m,d()});return{getButtonProps:f,buttonRef:h}}function eL(e){return Hs(e)&&e.tagName==="BUTTON"}function Ett(e){return Hs(e)&&e.tagName==="A"&&!!e.href}const rAe="none",Jx="trigger-press",Qc="trigger-hover",sAe="outside-press",oAe="close-press",KS="focus-out",aAe="escape-key",lAe="imperative-action";function to(e,t,n,i){let r=!1,s=!1;const a=Nl;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 NN(e){return`data-base-ui-${e}`}const cAe=p.createContext(null),uAe=()=>p.useContext(cAe),Ctt=NN("portal");function dAe(e={}){const{ref:t,container:n,componentProps:i=Nl,elementProps:r}=e,s=_C(),a=uAe(),l=a==null?void 0:a.portalNode,[c,u]=p.useState(null),[d,f]=p.useState(null),h=Gn(v=>{v!==null&&f(v)}),m=p.useRef(null);Qn(()=>{if(n===null){m.current&&(m.current=null,f(null),u(null));return}const v=(n&&(HU(n)?n:n.current))??l??document.body;if(v==null){m.current&&(m.current=null,f(null),u(null));return}m.current!==v&&(m.current=v,f(null),u(v))},[n,l]);const g=Eo("div",i,{ref:[t,h],props:[{id:s,[Ctt]:""},r]}),b=c&&g?ri.createPortal(g,c):null;return{node:d,nodeId:p.isValidElement(g)?g.props.id:void 0,subtree:b}}const fAe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,children:a,container:l,...c}=t,{node:u,nodeId:d,subtree:f}=dAe({container:l,ref:n,componentProps:t,elementProps:c}),h=p.useRef(null),m=p.useRef(null),g=p.useRef(null),b=p.useRef(null),[v,y]=p.useState(null),w=p.useRef(!1),x=v==null?void 0:v.modal,O=v==null?void 0:v.open,S=!!v&&!v.modal&&v.open&&!!u;p.useEffect(()=>{if(!u||x)return;function C(E){u&&E.relatedTarget&&sx(E)&&(E.type==="focusin"?w.current&&(jY(u),w.current=!1):(Det(u),w.current=!0))}return Pf(yi(u,"focusin",C,!0),yi(u,"focusout",C,!0))},[u,x]),Qn(()=>{!u||O!==!0||!w.current||(jY(u),w.current=!1)},[O,u]);const k=p.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:m,beforeInsideRef:g,afterInsideRef:b,portalNode:u,setFocusManagerState:y}),[u]);return o.jsxs(p.Fragment,{children:[f,o.jsxs(cAe.Provider,{value:k,children:[S&&u&&o.jsx(vy,{"data-type":"outside",ref:h,onFocus:C=>{var E;if(sx(C,u))(E=g.current)==null||E.focus();else{const R=v?v.domReference:null,A=zTe(R);A==null||A.focus()}}}),S&&u&&o.jsx("span",{"aria-owns":d,style:dtt}),u&&ri.createPortal(a,u),S&&u&&o.jsx(vy,{"data-type":"outside",ref:m,onFocus:C=>{var E;if(sx(C,u))(E=b.current)==null||E.focus();else{const R=v?v.domReference:null,A=eQ(R);A==null||A.focus(),v!=null&&v.closeOnFocusOut&&(v==null||v.onOpenChange(!1,to(KS,C.nativeEvent)))}}})]})]})}),Ttt=p.forwardRef(function(t,n){const{children:i,container:r,className:s,render:a,style:l,...c}=t,{node:u,subtree:d}=dAe({container:r,ref:n,componentProps:t,elementProps:c});return!d&&!u?null:o.jsxs(p.Fragment,{children:[d,u&&ri.createPortal(i,u)]})}),Att=p.forwardRef(function(t,n){return o.jsx(Ttt,{ref:n,...t})});function Tl(e){const t=Gu(_tt,e).current;return t.next=e,Qn(t.effect),t}function _tt(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function jtt(e,t){return t!=null&&!rx(t)?0:typeof e=="function"?e():e}function dF(e,t,n){const i=jtt(e,n);return typeof i=="number"?i:i==null?void 0:i[t]}function MY(e){return typeof e=="function"?e():e}function hAe(e,t){return t||e==="click"||e==="mousedown"}function Ntt(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}let _A=0;function tL(e,t={}){const{preventScroll:n=!1,sync:i=!1,shouldFocus:r}=t;cancelAnimationFrame(_A);function s(){r&&!r()||e==null||e.focus({preventScroll:n})}if(i)return s(),UU;const a=requestAnimationFrame(s);return _A=a,()=>{_A===a&&(cancelAnimationFrame(a),_A=0)}}const nL={inert:new WeakMap,"aria-hidden":new WeakMap},LY="data-base-ui-inert",fF={inert:new WeakSet,"aria-hidden":new WeakSet};let aO=new WeakMap,iL=0;function Rtt(e){return fF[e]}function pAe(e){return e?Yx(e)?e.host:pAe(e.parentNode):null}const $Y=(e,t)=>t.map(n=>{if(e.contains(n))return n;const i=pAe(n);return e.contains(i)?i:null}).filter(n=>n!=null),FY=e=>{const t=new Set;return e.forEach(n=>{let i=n;for(;i&&!t.has(i);)t.add(i),i=i.parentNode}),t},BY=(e,t,n)=>{const i=[],r=s=>{!s||n.has(s)||Array.from(s.children).forEach(a=>{Wa(a)!=="script"&&(t.has(a)?r(a):i.push(a))})};return r(e),i};function Itt(e,t,n,i,{mark:r=!0}){let s=null;i?s="inert":n&&(s="aria-hidden");let a=null,l=null;const c=$Y(t,e),u=r?BY(t,FY(c),new Set(c)):[],d=[],f=[];if(s){const h=nL[s],m=Rtt(s);l=m,a=h;const g=$Y(t,Array.from(t.querySelectorAll("[aria-live]"))),b=c.concat(g);BY(t,FY(b),new Set(b)).forEach(y=>{const w=y.getAttribute(s),x=w!==null&&w!=="false",O=(h.get(y)||0)+1;h.set(y,O),d.push(y),O===1&&x&&m.add(y),x||y.setAttribute(s,s==="inert"?"":"true")})}return r&&u.forEach(h=>{const m=(aO.get(h)||0)+1;aO.set(h,m),f.push(h),m===1&&h.setAttribute(LY,"")}),iL+=1,()=>{a&&d.forEach(h=>{const g=(a.get(h)||0)-1;a.set(h,g),g||(!(l!=null&&l.has(h))&&s&&h.removeAttribute(s),l==null||l.delete(h))}),r&&f.forEach(h=>{const m=(aO.get(h)||0)-1;aO.set(h,m),m||h.removeAttribute(LY)}),iL-=1,iL||(nL.inert=new WeakMap,nL["aria-hidden"]=new WeakMap,fF.inert=new WeakSet,fF["aria-hidden"]=new WeakSet,aO=new WeakMap)}}function UY(e,t={}){const{ariaHidden:n=!1,inert:i=!1,mark:r=!0}=t,s=fr(e[0]).body;return Itt(e,s,n,i,{mark:r})}function mAe(){const e=new Map;return{emit(t,n){var i;(i=e.get(t))==null||i.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var i;(i=e.get(t))==null||i.delete(n)}}}class Ptt{constructor(){rn(this,"nodesRef",{current:[]});rn(this,"events",mAe())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(i=>i===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const gAe=p.createContext(null),bAe=p.createContext(null),fP=()=>{var e;return((e=p.useContext(gAe))==null?void 0:e.id)||null},Hw=e=>{const t=p.useContext(bAe);return e??t};function Dtt(e){const t=_C(),n=Hw(e),i=fP();return Qn(()=>{if(!t)return;const r={id:t,parentId:i};return n==null||n.addNode(r),()=>{n==null||n.removeNode(r)}},[n,t,i]),t}function Mtt(e){const{children:t,id:n}=e,i=fP();return o.jsx(gAe.Provider,{value:p.useMemo(()=>({id:n,parentId:i}),[n,i]),children:t})}function Ltt(e){const{children:t,externalTree:n}=e,i=Gu(()=>n??new Ptt).current;return o.jsx(bAe.Provider,{value:i,children:t})}function $tt(e,t){const n=Ws(na(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const QY=20;let Tm=[];function aQ(){Tm=Tm.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function zY(e){aQ(),e&&Wa(e)!=="body"&&(Tm.push(new WeakRef(e)),Tm.length>QY&&(Tm=Tm.slice(-QY)))}function VY(){var e;return aQ(),(e=Tm[Tm.length-1])==null?void 0:e.deref()}function Ftt(e){return e?JU(e)?e:TC(e)[0]||e:null}function HY(e){var r;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((r=e.getAttribute("role"))!=null&&r.includes("dialog")))return;const n=UTe(e).filter(s=>{const a=s.getAttribute("data-tabindex")||"";return JU(s)||s.hasAttribute("data-tabindex")&&!a.startsWith("-")}),i=e.getAttribute("tabindex");n.length===0?i!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function yAe(e){const{context:t,children:n,disabled:i=!1,initialFocus:r=!0,returnFocus:s=!0,restoreFocus:a=!1,modal:l=!0,closeOnFocusOut:c=!0,openInteractionType:u="",nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:h,externalTree:m,getInsideElements:g}=e,b="rootStore"in t?t.rootStore:t,v=b.useState("open"),y=b.useState("domReferenceElement"),w=b.useState("floatingElement"),{events:x,dataRef:O}=b.context,S=Gn(()=>{var Z;return(Z=O.current.floatingContext)==null?void 0:Z.nodeId}),k=r===!1,C=EY(y)&&k,E=Tl(r),R=Tl(s),A=Tl(u),N=Tl(v),T=Hw(m),j=uAe(),_=p.useRef(!1),I=p.useRef(!1),D=p.useRef(!1),P=p.useRef(null),L=p.useRef(""),B=p.useRef(""),M=p.useRef(null),H=p.useRef(null),K=Zx(M,h,j==null?void 0:j.beforeInsideRef),F=Zx(H,j==null?void 0:j.afterInsideRef),q=yy(),Q=yy(),X=KU(),ne=j!=null,z=CY(w),Y=Gn((Z=z)=>Z?TC(Z):[]),ae=Gn(()=>(g==null?void 0:g().filter(Z=>Z!=null))??[]);p.useEffect(()=>{if(i||!l)return;function Z(te){te.key==="Tab"&&qn(z,Zl(fr(z)))&&Y().length===0&&!C&&het(te)}const G=fr(z);return yi(G,"keydown",Z)},[i,z,l,C,Y]),p.useEffect(()=>{if(i||!v)return;const Z=fr(z);function G(){D.current=!1}function te(Ce){const le=na(Ce),fe=ae(),ce=qn(w,le)||qn(y,le)||qn(j==null?void 0:j.portalNode,le)||fe.some(Te=>Te===le||qn(Te,le));D.current=!ce,B.current=Ce.pointerType||"keyboard",le!=null&&le.closest(`[${oQ}]`)&&(I.current=!0,Q.start(0,()=>{I.current=!1}))}function de(){B.current="keyboard"}return Pf(yi(Z,"pointerdown",te,!0),yi(Z,"pointerup",G,!0),yi(Z,"pointercancel",G,!0),yi(Z,"keydown",de,!0),G)},[i,w,y,z,v,j,Q,ae]),p.useEffect(()=>{if(i||!c)return;const Z=fr(z);function G(){I.current=!0,Q.start(0,()=>{I.current=!1})}function te(fe){const ce=na(fe);JU(ce)&&(P.current=ce)}function de(fe){const ce=fe.relatedTarget,Te=fe.currentTarget,Me=na(fe);l&&ce==null&&Me!=null&&qn(w,Me)&&zY(Me),queueMicrotask(()=>{const we=S(),Ue=b.context.triggerElements,ke=ae(),je=(ce==null?void 0:ce.hasAttribute(NN("focus-guard")))&&[M.current,H.current,j==null?void 0:j.beforeInsideRef.current,j==null?void 0:j.afterInsideRef.current,j==null?void 0:j.beforeOutsideRef.current,j==null?void 0:j.afterOutsideRef.current,gh(f),gh(d)].includes(ce),re=!(qn(y,ce)||qn(w,ce)||qn(ce,w)||qn(j==null?void 0:j.portalNode,ce)||ke.some(ve=>ve===ce||qn(ve,ce))||Ue.hasMatchingElement(ve=>qn(ve,ce))||je||T&&(og(T.nodesRef.current,we).find(ve=>{var be,xe;return qn((be=ve.context)==null?void 0:be.elements.floating,ce)||qn((xe=ve.context)==null?void 0:xe.elements.domReference,ce)})||TY(T.nodesRef.current,we).find(ve=>{var be,xe,Ke;return[(be=ve.context)==null?void 0:be.elements.floating,CY((xe=ve.context)==null?void 0:xe.elements.floating)].includes(ce)||((Ke=ve.context)==null?void 0:Ke.elements.domReference)===ce})));if(Te===y&&z&&HY(z),a&&Te!==y&&!PTe(Me)&&Zl(Z)===Z.body){if(Hs(z)&&(z.focus(),a==="popup")){X.request(()=>{z.focus()});return}const ve=Y(),be=P.current,xe=(be&&ve.includes(be)?be:null)||ve[ve.length-1]||z;Hs(xe)&&xe.focus()}if(O.current.insideReactTree){O.current.insideReactTree=!1;return}(C||!l)&&ce&&re&&!I.current&&(C||ce!==VY())&&(_.current=!0,b.setOpen(!1,to(KS,fe)))})}function Ce(){D.current||(O.current.insideReactTree=!0,q.start(0,()=>{O.current.insideReactTree=!1}))}const le=Hs(y)?y:null;if(!(!w&&!le))return Pf(le&&yi(le,"focusout",de),le&&yi(le,"pointerdown",G),w&&yi(w,"focusin",te),w&&yi(w,"focusout",de),w&&j&&yi(w,"focusout",Ce,!0))},[i,y,w,z,l,T,j,b,c,a,Y,C,S,O,q,Q,X,d,f,ae]),p.useEffect(()=>{var Te,Me,we;if(i||!w||!v)return;const Z=Array.from(((Te=j==null?void 0:j.portalNode)==null?void 0:Te.querySelectorAll(`[${NN("portal")}]`))||[]),te=(we=(Me=(T?TY(T.nodesRef.current,S()):[]).find(Ue=>{var ke;return EY(((ke=Ue.context)==null?void 0:ke.elements.domReference)||null)}))==null?void 0:Me.context)==null?void 0:we.elements.domReference,Ce=[...[w,...Z,M.current,H.current,j==null?void 0:j.beforeOutsideRef.current,j==null?void 0:j.afterOutsideRef.current,...ae()],te,gh(f),gh(d),C?y:null].filter(Ue=>Ue!=null),le=UY(Ce,{ariaHidden:l||C,mark:!1}),fe=[w,...Z].filter(Ue=>Ue!=null),ce=UY(fe);return()=>{ce(),le()}},[v,i,y,w,l,j,C,T,S,d,f,ae]),Qn(()=>{if(!v||i||!Hs(z))return;L.current="",B.current="";const Z=fr(z),G=Zl(Z);queueMicrotask(()=>{const te=E.current,de=typeof te=="function"?te(A.current||""):te;if(de===void 0||de===!1||qn(z,G))return;let le=null;const fe=()=>(le==null&&(le=Y(z)),le[0]||z);let ce;de===!0||de===null?ce=fe():ce=gh(de),ce=ce||fe();const Te=qn(z,Zl(Z));tL(ce,{preventScroll:ce===z,shouldFocus(){if(!N.current)return!1;if(Te)return!0;const Me=Zl(Z);return!(Me!==ce&&qn(z,Me))}})})},[i,v,z,Y,E,A,N]),Qn(()=>{if(i||!z)return;const Z=fr(z),G=Zl(Z),te=A.current==null;zY(G);function de(le){if(le.open||(L.current=$tt(le.nativeEvent,B.current)),le.reason===Qc&&le.nativeEvent.type==="mouseleave"&&(_.current=!0),le.reason===sAe)if(le.nested)_.current=!1;else if(met(le.nativeEvent)||ITe(le.nativeEvent))_.current=!1;else{let fe=!1;fr(z).createElement("div").focus({get preventScroll(){return fe=!0,!1}}),fe?_.current=!1:_.current=!0}}x.on("openchange",de);function Ce(le){const fe=R.current;let ce=typeof fe=="function"?fe(le):fe;if(ce===void 0||ce===!1)return null;ce===null&&(ce=!0);const Te=y!=null&&y.isConnected?y:null,Me=G!=null&&G.isConnected&&Wa(G)!=="body"?G:null;let we=te?Me||Te:Te||Me;return we||(we=VY()||null),typeof ce=="boolean"?we:gh(ce)||we||null}return()=>{x.off("openchange",de);const le=Zl(Z),fe=ae(),ce=qn(w,le)||fe.some(Ue=>Ue===le||qn(Ue,le))||T&&og(T.nodesRef.current,S(),!1).some(Ue=>{var ke;return qn((ke=Ue.context)==null?void 0:ke.elements.floating,le)}),Te=R.current,Me=L.current,we=Ce(Me);queueMicrotask(()=>{const Ue=Ftt(we),ke=typeof Te!="boolean";if(Te&&!_.current&&Hs(Ue)&&(!(!ke&&Ue!==le&&le!==Z.body)||ce)){const je={preventScroll:!0};Me==="keyboard"&&(je.focusVisible=!0),Ue.focus(je)}_.current=!1})}},[i,w,z,R,A,x,T,y,S,ae]),Qn(()=>{if(!Vw||v||!w)return;const Z=Zl(fr(w));!Hs(Z)||!GU(Z)||qn(w,Z)&&Z.blur()},[v,w]),Qn(()=>{if(!(i||!j))return j.setFocusManagerState({modal:l,closeOnFocusOut:c,open:v,onOpenChange:b.setOpen,domReference:y}),()=>{j.setFocusManagerState(null)}},[i,j,l,v,b,c,y]),Qn(()=>{if(!(i||!z))return HY(z),()=>{queueMicrotask(aQ)}},[i,z]);const Ee=!i&&(l?!C:!0)&&(ne||l);return o.jsxs(p.Fragment,{children:[Ee&&o.jsx(vy,{"data-type":"inside",ref:K,onFocus:Z=>{var G;if(l){const te=Y();tL(te[te.length-1])}else if(j!=null&&j.portalNode)if(_.current=!1,sx(Z,j.portalNode)){const te=eQ(y);te==null||te.focus()}else(G=gh(f??j.beforeOutsideRef))==null||G.focus()}}),n,Ee&&o.jsx(vy,{"data-type":"inside",ref:F,onFocus:Z=>{var G;if(l)tL(Y()[0]);else if(j!=null&&j.portalNode)if(c&&(_.current=!0),sx(Z,j.portalNode)){const te=zTe(y);te==null||te.focus()}else(G=gh(d??j.afterOutsideRef))==null||G.focus()}})]})}function vAe(e,t={}){const{enabled:n=!0,event:i="click",toggle:r=!0,ignoreMouse:s=!1,stickIfOpen:a=!0,touchOpenDelay:l=0,reason:c=Jx}=t,u="rootStore"in e?e.rootStore:e,d=u.context.dataRef,f=p.useRef(void 0),h=KU(),m=yy(),g=p.useMemo(()=>{function b(y,w,x,O){const S=to(c,w,x);y&&O==="touch"&&l>0?m.start(l,()=>{u.setOpen(!0,S)}):u.setOpen(y,S)}function v(y,w,x){const O=d.current.openEvent,S=u.select("domReferenceElement")!==w;return y&&S||!y||!r?!0:O&&a?!x(O.type):!1}return{onPointerDown(y){f.current=rx(y.pointerType,!0)&&ITe(y.nativeEvent)?"virtual":y.pointerType},onMouseDown(y){const w=f.current,x=y.nativeEvent,O=u.select("open");if(y.button!==0||i==="click"||rx(w,!0)&&s)return;const S=v(O,y.currentTarget,E=>E==="click"||E==="mousedown"),k=na(x);if(GU(k)){b(S,x,k,w);return}const C=y.currentTarget;h.request(()=>{b(S,x,C,w)})},onClick(y){if(i==="mousedown-only")return;const w=f.current;if(i==="mousedown"&&w){f.current=void 0;return}if(rx(w,!0)&&s)return;const x=u.select("open"),O=v(x,y.currentTarget,S=>S==="click"||S==="mousedown"||S==="keydown"||S==="keyup");b(O,y.nativeEvent,y.currentTarget,w)},onKeyDown(){f.current=void 0}}},[d,i,s,c,u,a,r,h,m,l]);return p.useMemo(()=>n?{reference:g}:Nl,[n,g])}function Btt(){return!1}function Utt(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function xAe(e,t={}){const{enabled:n=!0,escapeKey:i=!0,outsidePress:r=!0,outsidePressEvent:s="sloppy",referencePress:a=Btt,bubbles:l,externalTree:c}=t,u="rootStore"in e?e.rootStore:e,d=u.useState("open"),f=u.useState("floatingElement"),{dataRef:h}=u.context,m=Hw(c),g=Gn(typeof r=="function"?r:()=>!1),b=typeof r=="function"?g:r,v=b!==!1,y=Gn(()=>s),{escapeKey:w,outsidePress:x}=Utt(l),O=p.useRef(!1),S=p.useRef(!1),k=p.useRef(!1),C=p.useRef(!1),E=p.useRef(""),R=p.useRef(null),A=yy(),N=yy(),T=Gn(()=>{N.clear(),h.current.insideReactTree=!1}),j=Gn(K=>{var Q;const F=(Q=h.current.floatingContext)==null?void 0:Q.nodeId;return(m?og(m.nodesRef.current,F):[]).some(X=>{var ne;return((ne=X.context)==null?void 0:ne.open)&&!X.context.dataRef.current[K]})}),_=Gn(K=>K5(K,u.select("floatingElement"))||K5(K,u.select("domReferenceElement"))),I=Gn(K=>{a()&&u.setOpen(!1,to(Jx,K.nativeEvent))}),D=Gn(K=>{if(!d||!n||!i||K.key!=="Escape"||C.current||!w&&j("__escapeKeyBubbles"))return;const F=pet(K)?K.nativeEvent:K,q=to(aAe,F);u.setOpen(!1,q),q.isCanceled||K.preventDefault(),!w&&!q.isPropagationAllowed&&K.stopPropagation()}),P=Gn(()=>{h.current.insideReactTree=!0,N.start(0,T)}),L=Gn(K=>{if(!d||!n||K.button!==0)return;const F=na(K.nativeEvent);qn(u.select("floatingElement"),F)&&(O.current||(O.current=!0,S.current=!1))}),B=Gn(K=>{!d||!n||(K.defaultPrevented||K.nativeEvent.defaultPrevented)&&O.current&&(S.current=!0)});p.useEffect(()=>{if(!d||!n)return T;h.current.__escapeKeyBubbles=w,h.current.__outsidePressBubbles=x;const K=new du,F=new du;function q(){K.clear(),C.current=!0}function Q(){K.start(Vw?5:0,()=>{C.current=!1})}function X(){k.current=!0,F.start(0,()=>{k.current=!1})}function ne(){O.current=!1,S.current=!1}function z(){const ke=E.current,je=ke==="pen"||!ke?"mouse":ke,re=y(),ve=typeof re=="function"?re():re;return typeof ve=="string"?ve:ve[je]}function Y(ke){const je=z();return je==="intentional"&&ke.type!=="click"||je==="sloppy"&&ke.type==="click"}function ae(ke){var ve;const je=(ve=h.current.floatingContext)==null?void 0:ve.nodeId,re=m&&og(m.nodesRef.current,je).some(be=>{var xe;return K5(ke,(xe=be.context)==null?void 0:xe.elements.floating)});return _(ke)||re}function Ee(ke){if(Y(ke)){ke.type!=="click"&&!_(ke)&&(F.clear(),k.current=!1),T();return}if(h.current.insideReactTree){T();return}const je=na(ke),re=`[${NN("inert")}]`,ve=pr(je)?je.getRootNode():null,be=Array.from((Yx(ve)?ve:fr(u.select("floatingElement"))).querySelectorAll(re)),xe=u.context.triggerElements;if(je&&(xe.hasElement(je)||xe.hasMatchingElement(Ze=>qn(Ze,je))))return;let Ke=pr(je)?je:null;for(;Ke&&!Vm(Ke);){const Ze=sg(Ke);if(Vm(Ze)||!pr(Ze))break;Ke=Ze}if(!(be.length&&pr(je)&&!det(je)&&!qn(je,u.select("floatingElement"))&&be.every(Ze=>!qn(Ke,Ze)))){if(Hs(je)&&!("touches"in ke)){const Ze=Vm(je),he=uu(je),ye=/auto|scroll/,Ae=Ze||ye.test(he.overflowX),He=Ze||ye.test(he.overflowY),De=Ae&&je.clientWidth>0&&je.scrollWidth>je.clientWidth,At=He&&je.clientHeight>0&&je.scrollHeight>je.clientHeight,Nt=he.direction==="rtl",Ot=At&&(Nt?ke.offsetX<=je.offsetWidth-je.clientWidth:ke.offsetX>je.clientWidth),vt=De&&ke.offsetY>je.clientHeight;if(Ot||vt)return}if(!ae(ke)){if(z()==="intentional"&&k.current){F.clear(),k.current=!1;return}typeof b=="function"&&!b(ke)||j("__outsidePressBubbles")||(u.setOpen(!1,to(sAe,ke)),T())}}}function Z(ke){z()!=="sloppy"||ke.pointerType==="touch"||!u.select("open")||!n||_(ke)||Ee(ke)}function G(ke){if(z()!=="sloppy"||!u.select("open")||!n||_(ke))return;const je=ke.touches[0];je&&(R.current={startTime:Date.now(),startX:je.clientX,startY:je.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},A.start(1e3,()=>{R.current&&(R.current.dismissOnTouchEnd=!1,R.current.dismissOnMouseDown=!1)}))}function te(ke,je){const re=na(ke);if(!re)return;const ve=yi(re,ke.type,()=>{je(ke),ve()})}function de(ke){E.current="touch",te(ke,G)}function Ce(ke){A.clear(),ke.type==="pointerdown"&&(E.current=ke.pointerType),!(ke.type==="mousedown"&&R.current&&!R.current.dismissOnMouseDown)&&te(ke,je=>{je.type==="pointerdown"?Z(je):Ee(je)})}function le(ke){if(!O.current)return;const je=S.current;if(ne(),z()==="intentional"){if(ke.type==="pointercancel"){je&&X();return}if(!ae(ke)){if(je){X();return}typeof b=="function"&&!b(ke)||(F.clear(),k.current=!0,T())}}}function fe(ke){if(z()!=="sloppy"||!R.current||_(ke))return;const je=ke.touches[0];if(!je)return;const re=Math.abs(je.clientX-R.current.startX),ve=Math.abs(je.clientY-R.current.startY),be=Math.sqrt(re*re+ve*ve);be>5&&(R.current.dismissOnTouchEnd=!0),be>10&&(Ee(ke),A.clear(),R.current=null)}function ce(ke){te(ke,fe)}function Te(ke){z()!=="sloppy"||!R.current||_(ke)||(R.current.dismissOnTouchEnd&&Ee(ke),A.clear(),R.current=null)}function Me(ke){te(ke,Te)}const we=fr(f),Ue=Pf(i&&Pf(yi(we,"keydown",D),yi(we,"compositionstart",q),yi(we,"compositionend",Q)),v&&Pf(yi(we,"click",Ce,!0),yi(we,"pointerdown",Ce,!0),yi(we,"pointerup",le,!0),yi(we,"pointercancel",le,!0),yi(we,"mousedown",Ce,!0),yi(we,"mouseup",le,!0),yi(we,"touchstart",de,!0),yi(we,"touchmove",ce,!0),yi(we,"touchend",Me,!0)));return()=>{Ue(),K.clear(),F.clear(),ne(),k.current=!1,T()}},[h,f,i,v,b,d,n,w,x,D,T,y,j,_,m,u,A]);const M=p.useMemo(()=>({onKeyDown:D,onPointerDown:I,onClick:I}),[D,I]),H=p.useMemo(()=>({onKeyDown:D,onPointerDown:B,onMouseDown:B,onClickCapture:P,onMouseDownCapture(K){P(),L(K)},onPointerDownCapture(K){P(),L(K)},onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[D,P,L,B]);return p.useMemo(()=>n?{reference:M,floating:H,trigger:M}:{},[n,M,H])}function qY(e,t,n){let{reference:i,floating:r}=e;const s=Mu(t),a=cP(t),l=lP(a),c=Vu(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 m;switch(c){case"top":m={x:d,y:i.y-r.height};break;case"bottom":m={x:d,y:i.y+i.height};break;case"right":m={x:i.x+i.width,y:f};break;case"left":m={x:i.x-r.width,y:f};break;default:m={x:i.x,y:i.y}}const g=Cp(t);return g&&(m[a]+=h*(g==="end"?1:-1)*(n&&u?-1:1)),m}async function Qtt(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:m=0}=Ff(t,e),g=ZU(m),v=l[h?f==="floating"?"reference":"floating":f],y=TN(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})),w=f==="floating"?{x:i,y:r,width:a.floating.width,height:a.floating.height}:a.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),O=await(s.isElement==null?void 0:s.isElement(x))&&await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1},S=TN(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:x,strategy:c}):w);return{top:(y.top-S.top+g.top)/O.y,bottom:(S.bottom-y.bottom+g.bottom)/O.y,left:(y.left-S.left+g.left)/O.x,right:(S.right-y.right+g.right)/O.x}}const ztt=50,Vtt=async(e,t,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:a}=n,l=a.detectOverflow?a:{...a,detectOverflow:Qtt},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}=qY(u,i,c),h=i,m=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}=Ff(e,t)||{};if(u==null)return{};const f=ZU(d),h={x:n,y:i},m=cP(r),g=lP(m),b=await a.getDimensions(u),v=m==="y",y=v?"top":"left",w=v?"bottom":"right",x=v?"clientHeight":"clientWidth",O=s.reference[g]+s.reference[m]-h[m]-s.floating[g],S=h[m]-s.reference[m],k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let C=k?k[x]:0;(!C||!await(a.isElement==null?void 0:a.isElement(k)))&&(C=l.floating[x]||s.floating[g]);const E=O/2-S/2,R=C/2-b[g]/2-1,A=ag(f[y],R),N=ag(f[w],R),T=C-b[g]-N,j=C/2-b[g]/2+E,_=XU(A,j,T),I=!c.arrow&&Cp(r)!=null&&j!==_&&s.reference[g]/2-(j_<=0)){var N,T;const _=(((N=s.flip)==null?void 0:N.index)||0)+1,I=C[_];if(I&&(!(f==="alignment"?w!==Mu(I):!1)||A.every(L=>Mu(L.placement)===w?L.overflows[0]>0:!0)))return{data:{index:_,overflows:A},reset:{placement:I}};let D=(T=A.filter(P=>P.overflows[0]<=0).sort((P,L)=>P.overflows[1]-L.overflows[1])[0])==null?void 0:T.placement;if(!D)switch(m){case"bestFit":{var j;const P=(j=A.filter(L=>{if(k){const B=Mu(L.placement);return B===w||B==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(B=>B>0).reduce((B,M)=>B+M,0)]).sort((L,B)=>L[1]-B[1])[0])==null?void 0:j[0];P&&(D=P);break}case"initialPlacement":D=l;break}if(r!==D)return{reset:{placement:D}}}return{}}}};function WY(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function KY(e){return bet.some(t=>e[t]>=0)}const Wtt=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:i}=t,{strategy:r="referenceHidden",...s}=Ff(e,t);switch(r){case"referenceHidden":{const a=await i.detectOverflow(t,{...s,elementContext:"reference"}),l=WY(a,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:KY(l)}}}case"escaped":{const a=await i.detectOverflow(t,{...s,altBoundary:!0}),l=WY(a,n.floating);return{data:{escapedOffsets:l,escaped:KY(l)}}}default:return{}}}}},wAe=new Set(["left","top"]);async function Ktt(e,t){const{placement:n,platform:i,elements:r}=e,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),a=Vu(n),l=Cp(n),c=Mu(n)==="y",u=wAe.has(a)?-1:1,d=s&&c?-1:1,f=Ff(t,e);let{mainAxis:h,crossAxis:m,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"&&(m=l==="end"?g*-1:g),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const Gtt=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 Ktt(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}}}}},Xtt=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:w=>{let{x,y:O}=w;return{x,y:O}}},...u}=Ff(e,t),d={x:n,y:i},f=await s.detectOverflow(t,u),h=Mu(r),m=YU(h);let g=d[m],b=d[h];const v=(w,x)=>XU(x+f[w==="y"?"top":"left"],x,x-f[w==="y"?"bottom":"right"]);a&&(g=v(m,g)),l&&(b=v(h,b));const y=c.fn({...t,[m]:g,[h]:b});return{...y,data:{x:y.x-n,y:y.y-i,enabled:{[m]:a,[h]:l}}}}}},Ytt=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}=Ff(e,t),h={x:r,y:s},m=Mu(a),g=YU(m);let b=h[g],v=h[m];const y=Ff(u,t),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:(n=y.mainAxis)!=null?n:0,crossAxis:(i=y.crossAxis)!=null?i:0};if(d){const S=g==="y"?"height":"width",k=l.reference[g]-l.floating[S]+w.mainAxis,C=l.reference[g]+l.reference[S]-w.mainAxis;bC&&(b=C)}if(f){var x,O;const S=g==="y"?"width":"height",k=wAe.has(Vu(a)),C=l.reference[m]-l.floating[S]+(k&&((x=c.offset)==null?void 0:x[m])||0)+(k?0:w.crossAxis),E=l.reference[m]+l.reference[S]+(k?0:((O=c.offset)==null?void 0:O[m])||0)-(k?w.crossAxis:0);vE&&(v=E)}return{[g]:b,[m]:v}}}},Ztt=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}=Ff(e,t),c=await r.detectOverflow(t,l),u=Vu(n),d=Cp(n),f=Mu(n)==="y",{width:h,height:m}=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=m-c.top-c.bottom,y=h-c.left-c.right,w=ag(m-c[g],v),x=ag(h-c[b],y),O=t.middlewareData.shift,S=!O;let k=w,C=x;O!=null&&O.enabled.x&&(C=y),O!=null&&O.enabled.y&&(k=v),S&&!d&&(f?C=h-2*qh(c.left,c.right):k=m-2*qh(c.top,c.bottom)),await a({...t,availableWidth:C,availableHeight:k});const E=await r.getDimensions(s.floating);return h!==E.width||m!==E.height?{reset:{rects:!0}}:{}}}};function OAe(e){const t=uu(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=Hs(e),s=r?e.offsetWidth:n,a=r?e.offsetHeight:i,l=EN(n)!==s||EN(i)!==a;return l&&(n=s,i=a),{width:n,height:i,$:l}}function lQ(e){return pr(e)?e:e.contextElement}function ox(e){const t=lQ(e);if(!Hs(t))return Wh(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:s}=OAe(t);let a=(s?EN(n.width):n.width)/i,l=(s?EN(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const Jtt=Wh(0);function kAe(e){const t=Ws(e);return!WU()||!t.visualViewport?Jtt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ent(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Ws(e)}function xy(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=lQ(e);let a=Wh(1);t&&(i?pr(i)&&(a=ox(i)):a=ox(e));const l=ent(s,n,i)?kAe(s):Wh(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=Ws(s),m=pr(i)?Ws(i):i;let g=h,b=rF(g);for(;b&&m!==g;){const v=ox(b),y=b.getBoundingClientRect(),w=uu(b),x=y.left+(b.clientLeft+parseFloat(w.paddingLeft))*v.x,O=y.top+(b.clientTop+parseFloat(w.paddingTop))*v.y;c*=v.x,u*=v.y,d*=v.x,f*=v.y,c+=x,u+=O,g=Ws(b),b=rF(g)}}return TN({width:d,height:f,x:c,y:u})}function hP(e,t){const n=sP(e).scrollLeft;return t?t.left+n:xy(Ep(e)).left+n}function SAe(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-hP(e,n),r=n.top+t.scrollTop;return{x:i,y:r}}function tnt(e){let{elements:t,rect:n,offsetParent:i,strategy:r}=e;const s=r==="fixed",a=Ep(i),l=t?rP(t.floating):!1;if(i===a||l&&s)return n;let c={scrollLeft:0,scrollTop:0},u=Wh(1);const d=Wh(0),f=Hs(i);if((f||!s)&&((Wa(i)!=="body"||CC(a))&&(c=sP(i)),f)){const m=xy(i);u=ox(i),d.x=m.x+i.clientLeft,d.y=m.y+i.clientTop}const h=a&&!f&&!s?SAe(a,c):Wh(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 nnt(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function int(e){const t=sP(e),n=e.ownerDocument.body,i=qh(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=qh(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-t.scrollLeft+hP(e);const a=-t.scrollTop;return uu(n).direction==="rtl"&&(s+=qh(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:a}}const rnt=25;function snt(e,t,n){n===void 0&&(n="viewport");const i=n==="layoutViewport",r=Ws(e),s=Ep(e),a=r.visualViewport;let l=s.clientWidth,c=s.clientHeight,u=0,d=0;if(a){const h=!WU()||t==="fixed";i?h||(u=-a.offsetLeft,d=-a.offsetTop):(l=a.width,c=a.height,h&&(u=a.offsetLeft,d=a.offsetTop))}if(hP(s)<=0){const h=s.ownerDocument,m=h.body,g=getComputedStyle(m),b=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(s.clientWidth-m.clientWidth-b),y=getComputedStyle(s).scrollbarGutter==="stable both-edges"?v/2:v;y<=rnt&&(l-=y)}return{width:l,height:c,x:u,y:d}}function ont(e,t){const n=xy(e,!0,t==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,s=ox(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 GY(e,t,n){let i;if(t==="viewport"||t==="layoutViewport")i=snt(e,n,t);else if(t==="document")i=int(Ep(e));else if(pr(t))i=ont(t,n);else{const r=kAe(e);i={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return TN(i)}function ant(e,t){const n=t.get(e);if(n)return n;let i=qS(e,[],!1).filter(l=>pr(l)&&Wa(l)!=="body"),r=null;const s=uu(e).position==="fixed";let a=s?sg(e):e;for(;pr(a)&&!Vm(a);){const l=uu(a),c=qU(a),u=r?r.position:s?"fixed":"";!c&&(u==="fixed"||u==="absolute"&&l.position==="static")?i=i.filter(f=>f!==a):r=l,a=sg(a)}return t.set(e,i),i}function lnt(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const a=[...n==="clippingAncestors"?rP(t)?[]:ant(t,this._c):[].concat(n),i],l=GY(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)}C=!1}try{i=new IntersectionObserver(E,{...k,root:s.ownerDocument})}catch{i=new IntersectionObserver(E,k)}i.observe(e)}const c=Ws(e),u=()=>l(n);return c.addEventListener("resize",u),l(!0),()=>{c.removeEventListener("resize",u),a()}}function hF(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=lQ(e),d=r||s?[...u?qS(u):[],...t?qS(t):[]]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n),s&&y.addEventListener("resize",n)});const f=u&&l?pnt(u,n,s):null;let h=-1,m=null;a&&(m=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!c&&m.observe(u),t&&m.observe(t));let g,b=c?xy(e):null;c&&v();function v(){const y=xy(e);b&&!CAe(b,y)&&n(),b=y,g=requestAnimationFrame(v)}return n(),()=>{var y;d.forEach(w=>{r&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const mnt=Gtt,gnt=Xtt,bnt=qtt,ynt=Ztt,vnt=Wtt,YY=Htt,xnt=Ytt,wnt=(e,t,n)=>{const i=new Map,r=n??{},s={...hnt,...r.platform,_c:i};return Vtt(e,t,{...r,platform:s})};var Ont=typeof document<"u",knt=function(){},Q_=Ont?p.useLayoutEffect:knt;function RN(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(!RN(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)&&!RN(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function TAe(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ZY(e,t){const n=TAe(e);return Math.round(t*n)/n}function sL(e){const t=p.useRef(e);return Q_(()=>{t.current=e}),t}function AAe(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]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(i);RN(h,i)||m(i);const[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useCallback(L=>{L!==k.current&&(k.current=L,b(L))},[]),x=p.useCallback(L=>{L!==C.current&&(C.current=L,y(L))},[]),O=s||g,S=a||v,k=p.useRef(null),C=p.useRef(null),E=p.useRef(d),R=c!=null,A=sL(c),N=sL(r),T=sL(u),j=p.useCallback(()=>{if(!k.current||!C.current)return;const L={placement:t,strategy:n,middleware:h};N.current&&(L.platform=N.current),wnt(k.current,C.current,L).then(B=>{const M={...B,isPositioned:T.current!==!1};_.current&&!RN(E.current,M)&&(E.current=M,ri.flushSync(()=>{f(M)}))})},[h,t,n,N,T]);Q_(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(L=>({...L,isPositioned:!1})))},[u]);const _=p.useRef(!1);Q_(()=>(_.current=!0,()=>{_.current=!1}),[]),Q_(()=>{if(O&&(k.current=O),S&&(C.current=S),O&&S){if(A.current)return A.current(O,S,j);j()}},[O,S,j,A,R]);const I=p.useMemo(()=>({reference:k,floating:C,setReference:w,setFloating:x}),[w,x]),D=p.useMemo(()=>({reference:O,floating:S}),[O,S]),P=p.useMemo(()=>{const L={position:n,left:0,top:0};if(!D.floating)return L;const B=ZY(D.floating,d.x),M=ZY(D.floating,d.y);return l?{...L,transform:"translate("+B+"px, "+M+"px)",...TAe(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:M}},[n,l,D.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:j,refs:I,elements:D,floatingStyles:P}),[d,j,I,D,P])}const Snt=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?YY({element:i.current,padding:r}).fn(n):{}:i?YY({element:i,padding:r}).fn(n):{}}}},_Ae=(e,t)=>{const n=mnt(e);return{name:n.name,fn:n.fn,options:[e,t]}},jAe=(e,t)=>{const n=gnt(e);return{name:n.name,fn:n.fn,options:[e,t]}},NAe=(e,t)=>({fn:xnt(e).fn,options:[e,t]}),RAe=(e,t)=>{const n=bnt(e);return{name:n.name,fn:n.fn,options:[e,t]}},IAe=(e,t)=>{const n=ynt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ent=(e,t)=>{const n=vnt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Cnt=(e,t)=>{const n=Snt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tnt={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class cQ extends nP{constructor(n){const{syncOnly:i,nested:r,onOpenChange:s,triggerElements:a,...l}=n;super({...l,positionReference:l.referenceElement,domReferenceElement:l.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:mAe(),nested:r,triggerElements:a},Tnt);rn(this,"syncOpenEvent",(n,i)=>{(!n||!this.state.open||i!=null&&get(i))&&(this.context.dataRef.current.openEvent=n?i:void 0)});rn(this,"dispatchOpenChange",(n,i)=>{this.syncOpenEvent(n,i.event);const r={open:n,reason:i.reason,nativeEvent:i.event,nested:this.context.nested,triggerElement:i.trigger};this.context.events.emit("openchange",r)});rn(this,"setOpen",(n,i)=>{var r,s,a,l;if(this.syncOnly){(s=(r=this.context).onOpenChange)==null||s.call(r,n,i);return}this.dispatchOpenChange(n,i),(l=(a=this.context).onOpenChange)==null||l.call(a,n,i)});this.syncOnly=i}}function Ant(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:i,floatingId:r,nested:s,onOpenChange:a}=e,l=t.useState("open"),c=t.useState("activeTriggerElement"),u=t.useState(n?"popupElement":"positionerElement"),d=t.context.triggerElements,f=a,h=p.useRef(null);i===void 0&&h.current===null&&(h.current=new cQ({open:l,transitionStatus:void 0,referenceElement:c,floatingElement:u,triggerElements:d,onOpenChange:f,floatingId:r,syncOnly:!0,nested:s}));const m=i??h.current;return t.useSyncedValue("floatingId",r),Qn(()=>{const g={open:l,floatingId:r,referenceElement:c,floatingElement:u};pr(c)&&(g.domReferenceElement=c),m.state.positionReference===m.state.referenceElement&&(g.positionReference=c),m.update(g)},[l,r,c,u,m]),m.context.onOpenChange=f,m.context.nested=s,m}function PAe(e,t=!1,n=!1){const[i,r]=p.useState(e&&t?"idle":void 0),[s,a]=p.useState(e);return e&&!s&&(a(!0),r("starting")),!e&&s&&i!=="ending"&&!n&&r("ending"),!e&&!s&&i==="ending"&&r(void 0),Qn(()=>{if(!e&&s&&i!=="ending"&&n){const l=ec.request(()=>{r("ending")});return()=>{ec.cancel(l)}}},[e,s,i,n]),Qn(()=>{if(!e||t)return;const l=ec.request(()=>{r(void 0)});return()=>{ec.cancel(l)}},[t,e]),Qn(()=>{if(!e||!t)return;e&&s&&i!=="idle"&&r("starting");const l=ec.request(()=>{r("idle")});return()=>{ec.cancel(l)}},[t,e,s,i]),{mounted:s,setMounted:a,transitionStatus:i}}const DAe={tabIndex:-1,[oF]:""};function MAe(e){return t=>t==="touch"?e.current:!0}function LAe(e,t=!1){const n=_C(),i=fP()!=null,r=Gu(()=>e(n,i)).current;return Ant({popupStore:r,treatPopupAsFloatingElement:t,floatingRootContext:r.state.floatingRootContext,floatingId:n,nested:i,onOpenChange:r.setOpen}),r}function $Ae({handle:e,store:t}){return Qn(()=>e.attachStore(t),[e,t]),null}function _nt(e,t){const n=p.useRef(null),i=p.useRef(null);return p.useCallback(r=>{if(e===void 0)return;let s=!1;if(n.current!==null){const a=n.current,l=i.current,c=t.context.triggerElements.getById(a);l&&c===l&&(t.context.triggerElements.delete(a),s=!0),n.current=null,i.current=null}if(r!==null&&(n.current=e,i.current=r,t.context.triggerElements.add(e,r),s=!0),s){const a=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==a&&t.set("triggerCount",a)}},[t,e])}function FAe(e,t,n,i=!1){t?e.preventUnmountingOnClose=!1:i&&(e.preventUnmountingOnClose=!0);const r=(n==null?void 0:n.id)??null;(r||t)&&(e.activeTriggerId=r,e.activeTriggerElement=n??null)}function jnt(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function BAe(e,t,n,i){const r=n.useState("isMountedByTrigger",e),s=_nt(e,n),a=Gn(c=>{const u=n.select("open"),d=n.select("activeTriggerId");if(d===e){n.update({activeTriggerElement:c,...u?i:null});return}d==null&&u&&n.update({activeTriggerId:e,activeTriggerElement:c,...i})}),l=p.useCallback(c=>{s(c),c&&a(c)},[s,a]);return Qn(()=>{r&&n.update({activeTriggerElement:t.current,...i})},[r,n,t,...Object.values(i)]),{registerTrigger:l,isMountedByThisTrigger:r}}function UAe(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,i=p.useRef(null),r=e.useState("open"),s=e.useState("triggerCount"),a=e.useState("activeTriggerId"),l=e.useState("activeTriggerElement");Qn(()=>{if(!r){i.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const c=e.context.triggerElements.size,u={};e.state.triggerCount!==c&&(u.triggerCount=c);const d=e.select("activeTriggerId");let f=null;if(d){const h=e.context.triggerElements.getById(d);if(h)i.current=d,h!==e.state.activeTriggerElement&&(u.activeTriggerElement=h);else{for(const[m,g]of e.context.triggerElements.entries())if(g===e.state.activeTriggerElement){u.activeTriggerId=m,u.activeTriggerElement=g,i.current=m;break}u.activeTriggerId===void 0&&(i.current===d?f=d:i.current=null)}}else i.current=null;if(!f&&!d&&c===1){const h=e.context.triggerElements.entries().next();if(!h.done){const[m,g]=h.value;u.activeTriggerId=m,u.activeTriggerElement=g,i.current=m}}(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)&&e.update(u),f&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===f&&!e.context.triggerElements.getById(f)){const h=to(rAe);e.setOpen(!1,h),h.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[r,e,s,a,l,n])}function QAe(e,t,n){const{mounted:i,setMounted:r,transitionStatus:s}=PAe(e),a=t.useState("preventUnmountingOnClose"),l=e?!1:a;t.useSyncedValues({mounted:i,transitionStatus:s,preventUnmountingOnClose:l});const c=Gn(()=>{var u,d;r(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(d=(u=t.context).onOpenChangeComplete)==null||d.call(u,!1)});return AC({enabled:i&&!e&&!l,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:s}}function zAe(e,t){e.useSyncedValues(t),Qn(()=>()=>{e.update({activeTriggerProps:Nl,inactiveTriggerProps:Nl,popupProps:Nl})},[e])}function VAe(e,t){Qn(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),Qn(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class uQ{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function Nnt(){return new cQ({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new uQ,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function HAe(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Nnt(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Nl,inactiveTriggerProps:Nl,popupProps:Nl}}function qAe(e,t,n=!1){return new cQ({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const Hk=e=>e.triggerIdProp??e.activeTriggerId,dQ=e=>e.openProp??e.open,JY=e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0};function WAe(e,t){return t!==void 0&&dQ(e)&&Hk(e)===t}function Rnt(e,t){return WAe(e,t)?!0:t!==void 0&&dQ(e)&&Hk(e)==null&&e.triggerCount===1}const KAe={open:dQ,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Hk,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:JY,isTriggerActive:(e,t)=>t!==void 0&&Hk(e)===t,isOpenedByTrigger:(e,t)=>WAe(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Hk(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Rnt(e,t)?JY(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function GAe(e){const t=p.useCallback(i=>e===void 0?UU:e.subscribeStore(i),[e]),n=p.useCallback(()=>e===void 0?void 0:e.store,[e]);return mI.useSyncExternalStore(t,n,()=>e==null?void 0:e.serverStore)}function Int(e){return Pnt(e,e.rootContext)}function Pnt(e,t){const{nodeId:n,externalTree:i}=e,r=t.useState("referenceElement"),s=t.useState("floatingElement"),a=t.useState("domReferenceElement"),l=t.useState("open"),c=t.useState("floatingId"),[u,d]=p.useState(null),[f,h]=p.useState(void 0),[m,g]=p.useState(void 0),b=p.useRef(null),v=Hw(i),y=p.useMemo(()=>({reference:r,floating:s,domReference:a}),[r,s,a]),w=AAe({...e,elements:{...y,...u&&{reference:u}}}),x=pr(f)?f:null,O=m===void 0?t.state.floatingElement:m;t.useSyncedValue("referenceElement",f??null),t.useSyncedValue("domReferenceElement",f===void 0?a:x),t.useSyncedValue("floatingElement",O);const S=p.useCallback(N=>{const T=pr(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),getClientRects:()=>N.getClientRects(),contextElement:N}:N;d(T),w.refs.setReference(T)},[w.refs]),k=p.useCallback(N=>{(pr(N)||N===null)&&(b.current=N,h(N)),(pr(w.refs.reference.current)||w.refs.reference.current===null||N!==null&&!pr(N))&&w.refs.setReference(N)},[w.refs,h]),C=p.useCallback(N=>{g(N),w.refs.setFloating(N)},[w.refs]),E=p.useMemo(()=>({...w.refs,setReference:k,setFloating:C,setPositionReference:S,domReference:b}),[w.refs,k,C,S]),R=p.useMemo(()=>({...w.elements,domReference:a}),[w.elements,a]),A=p.useMemo(()=>({...w,dataRef:t.context.dataRef,open:l,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:E,elements:R,nodeId:n,rootStore:t}),[w,E,R,n,t,l,c]);return Qn(()=>{a&&(b.current=a)},[a]),Qn(()=>{t.context.dataRef.current.floatingContext=A;const N=v==null?void 0:v.nodesRef.current.find(T=>T.id===n);N&&(N.context=A)}),p.useMemo(()=>({...w,context:A,refs:E,elements:R,rootStore:t}),[w,E,R,A,t])}class fQ{constructor(){rn(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});rn(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new du,this.restTimeout=new du,this.handleCloseOptions=void 0}static create(){return new fQ}}const IN=new WeakMap;function PN(e){var n,i,r;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&IN.get(t)===e&&((n=e.pointerEventsScopeElement)==null||n.style.removeProperty("pointer-events"),(i=e.pointerEventsReferenceElement)==null||i.style.removeProperty("pointer-events"),(r=e.pointerEventsFloatingElement)==null||r.style.removeProperty("pointer-events"),IN.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function XAe(e,t){const{scopeElement:n,referenceElement:i,floatingElement:r}=t,s=IN.get(n);s&&s!==e&&PN(s),PN(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=i,e.pointerEventsFloatingElement=r,IN.set(n,e),n.style.pointerEvents="none",i.style.pointerEvents="auto",r.style.pointerEvents="auto"}function YAe(e){const t=e.context.dataRef.current,n=Gu(()=>t.hoverInteractionState??fQ.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),eP(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Dnt(e,t={}){const{enabled:n=!0,closeDelay:i=0,nodeId:r}=t,s="rootStore"in e?e.rootStore:e,a=s.useState("open"),l=s.useState("floatingElement"),c=s.useState("domReferenceElement"),{dataRef:u}=s.context,d=Hw(),f=fP(),h=YAe(s),m=yy(),g=Gn(()=>{var y;return hAe((y=u.current.openEvent)==null?void 0:y.type,h.interactedInside)}),b=Gn(()=>{var y;return Ntt((y=u.current.openEvent)==null?void 0:y.type)}),v=Gn(()=>{PN(h)});Qn(()=>{a||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,v())},[a,h,v]),p.useEffect(()=>v,[v]),Qn(()=>{var y,w,x,O,S;if(n&&a&&(y=h.handleCloseOptions)!=null&&y.blockPointerEvents&&b()&&pr(c)&&l){const k=c,C=l,E=fr(l),R=(x=(w=d==null?void 0:d.nodesRef.current.find(j=>j.id===f))==null?void 0:w.context)==null?void 0:x.elements.floating;R&&(R.style.pointerEvents="");const A=h.pointerEventsScopeElement!==C?h.pointerEventsScopeElement:null,N=R!==C?R:null,T=((S=(O=h.handleCloseOptions)==null?void 0:O.getScope)==null?void 0:S.call(O))??A??N??k.closest("[data-rootownerid]")??E.body;return XAe(h,{scopeElement:T,referenceElement:k,floatingElement:C}),()=>{v()}}},[n,a,c,l,h,b,d,f,v]),p.useEffect(()=>{if(!n)return;function y(){return!!(d&&f&&og(d.nodesRef.current,f).length>0)}function w(E){const R=dF(i,"close",h.pointerType),A=()=>{s.setOpen(!1,to(Qc,E)),d==null||d.events.emit("floating.closed",E)};R?h.openChangeTimeout.start(R,A):(h.openChangeTimeout.clear(),A())}function x(E){const R=na(E);if(!fet(R)){h.interactedInside=!1;return}h.interactedInside=(R==null?void 0:R.closest("[aria-haspopup]"))!=null}function O(){h.openChangeTimeout.clear(),m.clear(),d==null||d.events.off("floating.closed",k),v()}function S(E){var T;if(y()&&d){d.events.on("floating.closed",k);return}if(RTe(E.relatedTarget,s.context.triggerElements))return;const R=((T=u.current.floatingContext)==null?void 0:T.nodeId)??r,A=E.relatedTarget;if(!(d&&R&&pr(A)&&og(d.nodesRef.current,R,!1).some(j=>{var _;return qn((_=j.context)==null?void 0:_.elements.floating,A)}))){if(h.handler){h.handler(E);return}v(),b()&&!g()&&w(E)}}function k(E){!d||!f||y()||m.start(0,()=>{d.events.off("floating.closed",k),s.setOpen(!1,to(Qc,E)),d.events.emit("floating.closed",E)})}const C=l;return Pf(C&&yi(C,"mouseenter",O),C&&yi(C,"mouseleave",S),C&&yi(C,"pointerdown",x,!0),()=>{d==null||d.events.off("floating.closed",k)})},[n,l,s,u,i,r,b,g,v,h,d,f,m])}const Mnt={current:null};function Lnt(e,t={}){var D;const{enabled:n=!0,delay:i=0,handleClose:r=null,mouseOnly:s=!1,restMs:a=0,move:l=!0,triggerElementRef:c=Mnt,externalTree:u,isActiveTrigger:d=!0,getHandleCloseContext:f,isClosing:h,shouldOpen:m,guardStaleOpen:g=!1}=t,b="rootStore"in e?e.rootStore:e,{dataRef:v,events:y}=b.context,w=Hw(u),x=YAe(b),O=p.useRef(!1),S=Tl(r),k=Tl(i),C=Tl(a),E=Tl(n),R=Tl(m),A=Tl(h),N=Gn(()=>{var P;return hAe((P=v.current.openEvent)==null?void 0:P.type,x.interactedInside)}),T=Gn(()=>{var P;return((P=R.current)==null?void 0:P.call(R))!==!1}),j=Gn((P,L,B)=>{const M=b.context.triggerElements;if(M.hasElement(L))return!P||!qn(P,L);if(!pr(B))return!1;const H=B;return M.hasMatchingElement(K=>qn(K,H))&&(!P||!qn(P,H))}),_=Gn(()=>{if(!x.handler)return;fr(b.select("domReferenceElement")).removeEventListener("mousemove",x.handler),x.handler=void 0}),I=Gn(()=>{PN(x)});return d&&(x.handleCloseOptions=(D=S.current)==null?void 0:D.__options),p.useEffect(()=>_,[_]),p.useEffect(()=>{if(!n)return;function P(L){L.open?O.current=!1:(O.current=L.reason===Qc,_(),x.openChangeTimeout.clear(),x.restTimeout.clear(),x.blockMouseMove=!0,x.restTimeoutPending=!1)}return y.on("openchange",P),()=>{y.off("openchange",P)}},[n,y,x,_]),p.useEffect(()=>{if(!n)return;function P(F,q=!0){const Q=dF(k.current,"close",x.pointerType);Q?x.openChangeTimeout.start(Q,()=>{b.setOpen(!1,to(Qc,F)),w==null||w.events.emit("floating.closed",F)}):q&&(x.openChangeTimeout.clear(),b.setOpen(!1,to(Qc,F)),w==null||w.events.emit("floating.closed",F))}const L=c.current??(d?b.select("domReferenceElement"):null);if(!pr(L))return;function B(F){var fe;if(x.openChangeTimeout.clear(),x.blockMouseMove=!1,s&&!rx(x.pointerType))return;const q=MY(C.current),Q=dF(k.current,"open",x.pointerType),X=na(F),ne=F.currentTarget??null,z=b.select("domReferenceElement");let Y=ne;if(pr(X)&&!b.context.triggerElements.hasElement(X)){for(const ce of b.context.triggerElements.elements())if(qn(ce,X)){Y=ce;break}}pr(ne)&&pr(z)&&!b.context.triggerElements.hasElement(ne)&&qn(ne,z)&&(Y=z);const ae=Y==null?!1:j(z,Y,X),Ee=b.select("open"),Z=((fe=A.current)==null?void 0:fe.call(A))??b.select("transitionStatus")==="ending",G=!Ee&&Z&&O.current,te=!ae&&pr(Y)&&pr(z)&&qn(z,Y)&&G,de=q>0&&!Q,Ce=ae&&(Ee||G)||te,le=!Ee||ae;if(Ce){T()&&b.setOpen(!0,to(Qc,F,Y));return}de||(Q?x.openChangeTimeout.start(Q,()=>{le&&T()&&b.setOpen(!0,to(Qc,F,Y))}):le&&T()&&b.setOpen(!0,to(Qc,F,Y)))}function M(F){if(N()){I();return}_();const q=b.select("domReferenceElement"),Q=fr(q);x.restTimeout.clear(),x.restTimeoutPending=!1;const X=v.current.floatingContext??(f==null?void 0:f());if(RTe(F.relatedTarget,b.context.triggerElements))return;if(S.current&&X){b.select("open")||x.openChangeTimeout.clear();const z=c.current;x.handler=S.current({...X,tree:w,x:F.clientX,y:F.clientY,onClose(){I(),_(),E.current&&!N()&&z===b.select("domReferenceElement")&&P(F,!0)}}),Q.addEventListener("mousemove",x.handler),x.handler(F);return}(x.pointerType==="touch"?!qn(b.select("floatingElement"),F.relatedTarget):!0)&&P(F)}function H(F){qn(L,F.relatedTarget)||(x.openChangeTimeout.clear(),x.restTimeout.clear(),x.restTimeoutPending=!1)}const K=g?yi(L,"mouseout",H):void 0;return l?Pf(yi(L,"mousemove",B,{once:!0}),yi(L,"mouseenter",B),yi(L,"mouseleave",M),K):Pf(yi(L,"mouseenter",B),yi(L,"mouseleave",M),K)},[_,I,v,k,b,n,S,x,d,j,N,s,l,C,c,w,E,f,A,T,g]),p.useMemo(()=>{if(!n)return;function P(L){x.pointerType=L.pointerType}return{onPointerDown:P,onPointerEnter:P,onMouseMove(L){var X,ne,z;const{nativeEvent:B}=L,M=L.currentTarget,H=b.select("domReferenceElement"),K=b.select("open"),F=j(H,M,L.target);if(s&&!rx(x.pointerType))return;if(K&&F&&((X=x.handleCloseOptions)!=null&&X.blockPointerEvents)){const Y=b.select("floatingElement");if(Y){const ae=((z=(ne=x.handleCloseOptions)==null?void 0:ne.getScope)==null?void 0:z.call(ne))??M.ownerDocument.body;XAe(x,{scopeElement:ae,referenceElement:M,floatingElement:Y})}}const q=MY(C.current);if(K&&!F||q===0||!F&&x.restTimeoutPending&&L.movementX**2+L.movementY**2<2)return;x.restTimeout.clear();function Q(){if(x.restTimeoutPending=!1,N())return;const Y=b.select("open");!x.blockMouseMove&&(!Y||F)&&T()&&b.setOpen(!0,to(Qc,B,M))}x.pointerType==="touch"?ri.flushSync(()=>{Q()}):F&&K?Q():(x.restTimeoutPending=!0,x.restTimeout.start(q,Q))}}},[n,x,N,j,s,b,C,T])}const eZ=.1,$nt=eZ*eZ,Ir=.5;function jA(e,t,n,i,r,s){return i>=t!=s>=t&&e<=(r-n)*(t-i)/(s-i)+n}function NA(e,t,n,i,r,s,a,l,c,u){let d=!1;return jA(e,t,n,i,r,s)&&(d=!d),jA(e,t,r,s,a,l)&&(d=!d),jA(e,t,a,l,c,u)&&(d=!d),jA(e,t,c,u,n,i)&&(d=!d),d}function Fnt(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function RA(e,t,n,i,r,s){const a=Math.min(n,r),l=Math.max(n,r),c=Math.min(i,s),u=Math.max(i,s);return e>=a&&e<=l&&t>=c&&t<=u}function Bnt(e={}){const{blockPointerEvents:t=!1}=e,n=new du,i=({x:r,y:s,placement:a,elements:l,onClose:c,nodeId:u,tree:d})=>{const f=a==null?void 0:a.split("-")[0];let h=!1,m=null,g=null,b=typeof performance<"u"?performance.now():0;function v(w,x){const O=performance.now(),S=O-b;if(m===null||g===null||S===0)return m=w,g=x,b=O,!1;const k=w-m,C=x-g,E=k*k+C*C,R=S*S*$nt;return m=w,g=x,b=O,E0)}function j(){T()||y()}if(T())return;const _=O.getBoundingClientRect(),I=S.getBoundingClientRect(),D=r>I.right-I.width/2,P=s>I.bottom-I.height/2,L=I.width>_.width,B=I.height>_.height,M=(L?_:I).left,H=(L?_:I).right,K=(B?_:I).top,F=(B?_:I).bottom;if(f==="top"&&s>=_.bottom-1||f==="bottom"&&s<=_.top+1||f==="left"&&r>=_.right-1||f==="right"&&r<=_.left+1){j();return}let q=!1;switch(f){case"top":q=RA(k,C,M,_.top+1,H,I.bottom-1);break;case"bottom":q=RA(k,C,M,I.top+1,H,_.bottom-1);break;case"left":q=RA(k,C,I.right-1,F,_.left+1,K);break;case"right":q=RA(k,C,_.right-1,F,I.left+1,K);break}if(q)return;if(h&&!Fnt(k,C,_)){j();return}if(!R&&v(k,C)){j();return}let Q=!1;switch(f){case"top":{const X=L?Ir/2:Ir*4,ne=L||D?r+X:r-X,z=L?r-X:D?r+X:r-X,Y=s+Ir+1,ae=D||L?I.bottom-Ir:I.top,Ee=D?L?I.bottom-Ir:I.top:I.bottom-Ir;Q=NA(k,C,ne,Y,z,Y,I.left,ae,I.right,Ee);break}case"bottom":{const X=L?Ir/2:Ir*4,ne=L||D?r+X:r-X,z=L?r-X:D?r+X:r-X,Y=s-Ir,ae=D||L?I.top+Ir:I.bottom,Ee=D?L?I.top+Ir:I.bottom:I.top+Ir;Q=NA(k,C,ne,Y,z,Y,I.left,ae,I.right,Ee);break}case"left":{const X=B?Ir/2:Ir*4,ne=B||P?s+X:s-X,z=B?s-X:P?s+X:s-X,Y=r+Ir+1,ae=P||B?I.right-Ir:I.left,Ee=P?B?I.right-Ir:I.left:I.right-Ir;Q=NA(k,C,ae,I.top,Ee,I.bottom,Y,ne,Y,z);break}case"right":{const X=B?Ir/2:Ir*4,ne=B||P?s+X:s-X,z=B?s-X:P?s+X:s-X,Y=r-Ir,ae=P||B?I.left+Ir:I.right,Ee=P?B?I.left+Ir:I.right:I.left+Ir;Q=NA(k,C,Y,ne,Y,z,ae,I.top,Ee,I.bottom);break}}Q?h||n.start(40,j):j()}};return i.__options={...e,blockPointerEvents:t},i}const Unt=p.createContext(void 0);function Qnt(){const e=p.useContext(Unt);return(e==null?void 0:e.direction)??"ltr"}const znt=e=>({name:"arrow",options:e,async fn(t){var B,M;const{x:n,y:i,placement:r,rects:s,platform:a,elements:l,middlewareData:c}=t,{element:u,padding:d=0,offsetParent:f="real"}=Ff(e,t)||{};if(u==null)return{};const h=ZU(d),m={x:n,y:i},g=cP(r),b=lP(g),v=await a.getDimensions(u),y=g==="y",w=y?"top":"left",x=y?"bottom":"right",O=y?"clientHeight":"clientWidth",S=s.reference[b]+s.reference[g]-m[g]-s.floating[b],k=m[g]-s.reference[g],C=f==="real"?await((B=a.getOffsetParent)==null?void 0:B.call(a,u)):l.floating;let E=l.floating[O]||s.floating[b];(!E||!await((M=a.isElement)==null?void 0:M.call(a,C)))&&(E=l.floating[O]||s.floating[b]);const R=S/2-k/2,A=E/2-v[b]/2-1,N=Math.min(h[w],A),T=Math.min(h[x],A),j=N,_=E-v[b]-T,I=E/2-v[b]/2+R,D=XU(j,I,_),P=!c.arrow&&Cp(r)!=null&&I!==D&&s.reference[b]/2-(I({...znt(e),options:[e,t]}),Hnt={name:"hide",async fn(e){const{width:t,height:n,x:i,y:r}=e.rects.reference,s=t===0&&n===0&&i===0&&r===0,a=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:a.top-n>=0||a.right-t>=0||a.bottom-n>=0||a.left-t>=0||s}}}},qnt={sideX:"left",sideY:"top"},tZ="--available-width",nZ="--available-height";function ZAe(e,t,n){const i=e==="inline-start"||e==="inline-end";return{top:"top",right:i?n?"inline-start":"inline-end":"right",bottom:"bottom",left:i?n?"inline-end":"inline-start":"left"}[t]}function iZ(e,t,n){const{rects:i,placement:r}=e;return{side:ZAe(t,Vu(r),n),align:Cp(r)||"center",anchor:{width:i.reference.width,height:i.reference.height},positioner:{width:i.floating.width,height:i.floating.height}}}function Wnt(e){return Knt(e,Int)}function Knt(e,t){var ft,pt;const{anchor:n,positionMethod:i="absolute",side:r="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,collisionBoundary:c,collisionPadding:u=5,sticky:d=!1,arrowPadding:f=5,disableAnchorTracking:h=!1,inline:m,keepMounted:g=!1,floatingRootContext:b,mounted:v,collisionAvoidance:y,shift:w,nodeId:x,adaptiveOrigin:O,lazyFlip:S=!1,externalTree:k}=e,[C,E]=p.useState(null);!v&&C!==null&&E(null);const R=y.side||"flip",A=y.align||"flip",N=y.fallbackAxisSide||"end",T=(w==null?void 0:w.crossAxis)??!1,j=w==null?void 0:w.rootBoundary,_=typeof n=="function"?n:void 0,I=Gn(_),D=_?I:n,P=Tl(n),L=Tl(v),M=Qnt()==="rtl",H=C||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":M?"left":"right","inline-start":M?"right":"left"}[r],K=a==="center"?H:`${H}-${a}`;let F=u;typeof F=="number"?F={top:F,right:F,bottom:F,left:F}:F&&(F={top:F.top||0,right:F.right||0,bottom:F.bottom||0,left:F.left||0});const q=1,Q=r==="bottom"?q:0,X=r==="top"?q:0,ne=r==="right"?q:0,z=r==="left"?q:0,Y={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:F},ae=p.useRef(null),Ee=Tl(s),Z=Tl(l),G=typeof s!="function"?s:0,te=typeof l!="function"?l:0,de=[];m&&de.push(m),de.push(_Ae(Pe=>{const yt=iZ(Pe,r,M),jt=typeof Ee.current=="function"?Ee.current(yt):Ee.current,qt=typeof Z.current=="function"?Z.current(yt):Z.current;return{mainAxis:jt,crossAxis:qt,alignmentAxis:qt}},[G,te,M,r]));const Ce=A==="none"&&R!=="shift",le=!Ce&&(d||T||R==="shift"),fe=R==="none"?null:RAe({...Y,padding:{top:F.top+q+Q,right:F.right+q+z,bottom:F.bottom+q+X,left:F.left+q+ne},mainAxis:!T&&R==="flip",crossAxis:A==="flip"?"alignment":!1,fallbackAxisSideDirection:N}),ce=Ce?null:jAe({...Y,rootBoundary:j,mainAxis:A!=="none",crossAxis:le,limiter:d||T?void 0:NAe(Pe=>{if(!ae.current)return{};const{width:yt,height:jt}=ae.current.getBoundingClientRect(),qt=Mu(Vu(Pe.placement)),ln=qt==="y"?yt:jt,qe=qt==="y"?F.left+F.right:F.top+F.bottom;return{offset:ln/2+qe/2}})},[Y,d,T,j,F,A]);R==="shift"||A==="shift"||a==="center"?de.push(ce,fe):de.push(fe,ce),de.push(IAe({...Y,apply({elements:{floating:Pe},availableWidth:yt,availableHeight:jt,rects:qt}){if(!L.current)return;const ln=Pe.style;ln.setProperty(tZ,`${yt}px`),ln.setProperty(nZ,`${jt}px`);const qe=Ws(Pe).devicePixelRatio||1,{x:Ie,y:We,width:gt,height:it}=qt.reference,kt=(Math.round((Ie+gt)*qe)-Math.round(Ie*qe))/qe,ct=(Math.round((We+it)*qe)-Math.round(We*qe))/qe;ln.setProperty("--anchor-width",`${kt}px`),ln.setProperty("--anchor-height",`${ct}px`)}}),Vnt(Pe=>({element:ae.current||fr(Pe.elements.floating).createElement("div"),padding:f,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(Pe){var rt,En,et;const{elements:yt,middlewareData:jt,placement:qt,rects:ln,y:qe}=Pe,Ie=Vu(qt),We=Mu(Ie),gt=ae.current,it=((rt=jt.arrow)==null?void 0:rt.x)||0,kt=((En=jt.arrow)==null?void 0:En.y)||0,ct=(gt==null?void 0:gt.clientWidth)||0,Kt=(gt==null?void 0:gt.clientHeight)||0,dn=it+ct/2,Xt=kt+Kt/2,Ge=Math.abs(((et=jt.shift)==null?void 0:et.y)||0),mt=ln.reference.height/2,xt=typeof s=="function"?s(iZ(Pe,r,M)):s,hn=Ge>xt,Vt={top:`${dn}px calc(100% + ${xt}px)`,bottom:`${dn}px ${-xt}px`,left:`calc(100% + ${xt}px) ${Xt}px`,right:`${-xt}px ${Xt}px`}[Ie],Qe=`${dn}px ${ln.reference.y+mt-qe}px`;return yt.floating.style.setProperty("--transform-origin",le&&We==="y"&&hn?Qe:Vt),{}}},Hnt,O),Qn(()=>{!v&&b&&b.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[v,b]);const Te=p.useMemo(()=>({elementResize:!h&&typeof ResizeObserver<"u",layoutShift:!h&&typeof IntersectionObserver<"u"}),[h]),{refs:Me,elements:we,x:Ue,y:ke,middlewareData:je,update:re,placement:ve,context:be,isPositioned:xe,floatingStyles:Ke}=t({rootContext:b,open:g?v:void 0,placement:K,middleware:de,strategy:i,whileElementsMounted:g?void 0:(...Pe)=>hF(...Pe,Te),nodeId:x,externalTree:k}),{sideX:Ze,sideY:he}=je.adaptiveOrigin||qnt,ye=xe?i:"fixed",Ae=p.useMemo(()=>{let Pe;return xe?O?Pe={position:ye,[Ze]:Ue,[he]:ke}:Pe={...Ke,position:ye}:Pe={position:ye,top:0,left:0},Pe[tZ]="100vw",Pe[nZ]="100vh",xe||(Pe.opacity=0),Pe},[O,ye,Ze,Ue,he,ke,Ke,xe]),He=p.useRef(null);Qn(()=>{if(!v)return;const Pe=P.current,yt=typeof Pe=="function"?Pe():Pe,qt=(rZ(yt)?yt.current:yt)||null||null;qt!==He.current&&(Me.setPositionReference(qt),He.current=qt)},[v,Me,D,P]),p.useEffect(()=>{if(!v)return;const Pe=P.current;typeof Pe!="function"&&rZ(Pe)&&Pe.current!==He.current&&(Me.setPositionReference(Pe.current),He.current=Pe.current)},[v,Me,D,P]),p.useEffect(()=>{if(g&&v&&we.reference&&we.floating)return hF(we.reference,we.floating,re,Te)},[g,v,we,re,Te]);const De=Vu(ve),At=ZAe(r,De,M),Nt=Cp(ve)||"center",Ot=!!((ft=je.hide)!=null&&ft.referenceHidden);Qn(()=>{S&&v&&xe&&De!==H&&E(De)},[S,v,xe,De,H]);const vt=p.useMemo(()=>{var Pe,yt;return{position:"absolute",top:(Pe=je.arrow)==null?void 0:Pe.y,left:(yt=je.arrow)==null?void 0:yt.x}},[je.arrow]),Tt=((pt=je.arrow)==null?void 0:pt.centerOffset)!==0;return p.useMemo(()=>({positionerStyles:Ae,arrowStyles:vt,arrowRef:ae,arrowUncentered:Tt,side:At,align:Nt,physicalSide:De,anchorHidden:Ot,refs:Me,context:be,isPositioned:xe,update:re}),[Ae,vt,ae,Tt,At,Nt,De,Ot,Me,be,xe,re])}function rZ(e){return e!=null&&"current"in e}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=jN.startingStyle]="startingStyle",e[e.endingStyle=jN.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const Gnt={"data-popup-open":""},Xnt={"data-popup-open":"","data-pressed":""},Ynt={"data-open":""},Znt={"data-closed":""},Jnt={"data-anchor-hidden":""},JAe={open(e){return e?Gnt:null}},eit={open(e){return e?Xnt:null}},hQ={open(e){return e?Ynt:Znt},anchorHidden(e){return e?Jnt:null}},e2e={...hQ,...uP};function t2e(e){return e==="starting"?stt:Nl}function tit(e,t,{styles:n,transitionStatus:i,props:r,refs:s,hidden:a,inert:l=!1}){const c={...n};return l&&(c.pointerEvents="none"),Eo("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:a,style:c},t2e(i),r],stateAttributesMapping:hQ})}function n2e(){const e=QU(),t=e.useState("toasts");return p.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function Dd({orientation:e="vertical",maxHeight:t,hideScrollbar:n=!1,fadeEdges:i=!1,contentClassName:r="",className:s="",style:a,children:l,hasMore:c=!1,onLoadMore:u,threshold:d=24,onScroll:f,ref:h,...m}){const[g,b]=p.useState(!1),[v,y]=p.useState(!1),[w,x]=p.useState({top:!1,bottom:!1}),O=p.useRef(null),S=p.useRef(null),k=i&&e!=="horizontal",C=!!u&&e!=="horizontal";p.useImperativeHandle(h,()=>O.current,[]),p.useEffect(()=>()=>{var A;(A=S.current)==null||A.abort()},[]);const E=p.useCallback(()=>{const A=O.current;if(!k||!A)return;const N=A.scrollHeight-A.clientHeight,T=N>1&&A.scrollTop>1,j=N>1&&N-A.scrollTop>1;x(_=>_.top===T&&_.bottom===j?_:{top:T,bottom:j})},[k]);p.useEffect(()=>{const A=O.current;if(!k||!A)return;const N=new ResizeObserver(E);N.observe(A);for(const T of A.children)N.observe(T);return E(),()=>N.disconnect()},[k,C,E]);async function R(){if(!u||!c||S.current)return;const A=new AbortController;S.current=A,b(!0),y(!1);try{await u(A.signal)}catch{A.signal.aborted||y(!0)}finally{A.signal.aborted||b(!1),S.current===A&&(S.current=null)}}return o.jsxs("div",{...m,ref:O,className:`studio-scroll-area ${s}`.trim(),"data-orientation":e,"data-hide-scrollbar":n||void 0,"data-fade-edges":k&&(w.top||w.bottom)||void 0,"data-fade-top":k&&w.top||void 0,"data-fade-bottom":k&&w.bottom||void 0,style:{maxHeight:t,...a},onScroll:A=>{f==null||f(A),E();const N=A.currentTarget;!A.defaultPrevented&&e!=="horizontal"&&!v&&N.scrollTop>0&&N.scrollHeight-N.clientHeight-N.scrollTop<=Math.max(0,d)&&R()},children:[o.jsx("div",{className:`studio-scroll-area__content ${r}`.trim(),"aria-busy":u?g:void 0,children:l}),u&&e!=="horizontal"&&o.jsx(o.Fragment,{children:o.jsxs("div",{className:"studio-scroll-area__footer",children:[g?o.jsx(by,{size:24}):o.jsx("span",{role:"status","aria-live":"polite",children:v?"加载失败":c?"向下滚动加载更多":"已加载全部"}),!g&&c&&o.jsx("button",{type:"button",onClick:()=>void R(),children:v?"重试":"加载更多"})]})})]})}function nit(){const{add:e,close:t}=n2e();return{add:p.useCallback(({id:i,title:r,description:s,variant:a="info",duration:l,action:c,closeLabel:u,onClose:d})=>e({id:i,title:r,description:s,timeout:l,priority:"low",onClose:d,data:{variant:a,action:c,closeLabel:u}}),[e]),dismiss:t}}function iit({position:e,label:t}){const{toasts:n,close:i}=n2e();return o.jsx(Att,{children:o.jsx(ett,{className:"studio-toast-viewport","data-position":e,"data-empty":n.length===0||void 0,"aria-label":t,render:o.jsx(Dd,{contentClassName:"studio-toast-viewport__stack"}),children:n.map(r=>{var s,a,l;return o.jsx(btt,{toast:r,className:"studio-toast-root",swipeDirection:[],children:o.jsx(AJe,{role:"presentation",variant:(s=r.data)==null?void 0:s.variant,title:r.title!=null?o.jsx(wtt,{render:o.jsx("div",{}),children:r.title}):void 0,description:r.description!=null?o.jsx(xtt,{render:o.jsx("div",{}),children:r.description}):void 0,action:(a=r.data)==null?void 0:a.action,closeLabel:(l=r.data)==null?void 0:l.closeLabel,onDismiss:()=>i(r.id)})},r.id)})})})}function rit({children:e,duration:t=4e3,position:n="top-center",label:i="通知"}){return o.jsxs(Let,{timeout:t,limit:3,children:[e,o.jsx(iit,{position:n,label:i})]})}function sit({ownerId:e,sessionId:t,onOpen:n,hideNotices:i,refreshKey:r,onUpdate:s}){const{t:a}=_e("sandbox"),l=nit(),c=p.useRef(new Map),u=p.useRef(new Map),d=p.useRef(null),f=p.useRef({sessionId:t,onOpen:n,toast:l,t:a,hideNotices:i,onUpdate:s});return f.current={sessionId:t,onOpen:n,toast:l,t:a,hideNotices:i,onUpdate:s},p.useEffect(()=>{if(i){f.current.toast.dismiss(),u.current.clear();return}for(const h of c.current.values())h.sessionId===t&&(f.current.toast.dismiss(h.runId),u.current.delete(h.runId))},[t,i]),p.useEffect(()=>{var h;(h=d.current)==null||h.call(d)},[r]),p.useEffect(()=>{if(!e)return;const h=new AbortController,m=c.current,g=u.current,b=new Set;let v,y=!1,w=[],x="";const O=(C,E=x)=>{var R,A;x=E,h.signal.aborted||(A=(R=f.current).onUpdate)==null||A.call(R,{ownerId:e,runs:w,loading:C,error:E})},S=C=>{const{toast:E,t:R,sessionId:A,onOpen:N}=f.current;if(!h.signal.aborted){if(f.current.hideNotices||C.sessionId===A){E.dismiss(C.runId),g.delete(C.runId);return}b.has(C.runId)||g.get(C.runId)===C.state||(g.set(C.runId,C.state),E.add({id:C.runId,duration:0,title:R(`taskNotice.${C.state}`),description:C.message.slice(0,80),variant:C.state==="succeeded"?"success":C.state==="failed"?"error":"info",closeLabel:R("taskNotice.hide"),onClose:()=>b.add(C.runId),action:o.jsx(Vs,{variant:"secondary",onClick:()=>{N(C.sessionId,h.signal).catch(T=>{h.signal.aborted||E.add({id:"task-open-error",variant:"error",description:T instanceof Error?T.message:String(T)})})},children:R("taskNotice.open")})}))}},k=async(C=!1)=>{if(!(y||h.signal.aborted)){clearTimeout(v),y=!0,C&&O(!0);try{const E=await yd.active(h.signal);if(h.signal.aborted)return;w=E,O(!1,"");const R=new Set(E.map(A=>A.runId));for(const A of m.values())if(!R.has(A.runId)&&!Uc(A)){let N;try{N=await yd.get(A.runId,h.signal)}catch(T){if(T instanceof Xx&&T.status===404){m.delete(A.runId),g.delete(A.runId),f.current.toast.dismiss(A.runId);continue}throw T}if(h.signal.aborted)return;m.set(N.runId,N),S(N)}for(const A of E)m.set(A.runId,A),S(A);f.current.toast.dismiss("task-connection")}catch(E){if(h.signal.aborted)return;E instanceof Xx&&[401,403].includes(E.status)&&(w=[],m.clear(),g.clear(),f.current.toast.dismiss()),O(!1,E instanceof Error?E.message:f.current.t("taskNotice.reconnecting")),!h.signal.aborted&&m.size&&!f.current.hideNotices&&f.current.toast.add({id:"task-connection",duration:0,description:f.current.t("taskNotice.reconnecting")})}finally{y=!1,h.signal.aborted||(v=setTimeout(k,3e3))}}};return d.current=()=>{k(!0)},O(!0),k(),()=>{h.abort(),clearTimeout(v),d.current=null,f.current.toast.dismiss()}},[e]),null}function oit(e){const{t}=_e("sandbox");return o.jsx(rit,{position:"bottom-right",label:t("taskNotice.label"),children:o.jsx(sit,{...e},e.ownerId)})}const GS=["super_admin","admin","developer","user"];class XS extends Error{constructor(t,n){super(t),this.code=t,this.status=n}}async function i2e(e){let t;try{t=await e.json()}catch{throw new XS("invalid_response",e.status)}if(!e.ok){const n=t&&typeof t=="object"&&"code"in t&&typeof t.code=="string"?t.code:"request_failed";throw new XS(n,e.status)}return t}function r2e(e){return!e||typeof e!="object"?!1:"id"in e&&typeof e.id=="string"&&"name"in e&&typeof e.name=="string"&&"email"in e&&typeof e.email=="string"&&"role"in e&&GS.some(t=>t===e.role)&&"status"in e&&typeof e.status=="string"&&"lastLogin"in e&&typeof e.lastLogin=="string"&&"protected"in e&&typeof e.protected=="boolean"&&"currentUser"in e&&typeof e.currentUser=="boolean"&&"roleConflict"in e&&typeof e.roleConflict=="boolean"}async function ait(e){const t=new URLSearchParams({page:String(e.page),pageSize:"20",query:e.query});e.role&&t.set("role",e.role);const n=await i2e(await gn(`/web/users?${t}`,{signal:e.signal,cache:"no-store"}));if(!n||typeof n!="object"||!("items"in n)||!Array.isArray(n.items)||!n.items.every(r2e)||!("total"in n)||typeof n.total!="number"||!("poolTotal"in n)||typeof n.poolTotal!="number"||!("page"in n)||typeof n.page!="number"||!("pageSize"in n)||typeof n.pageSize!="number"||!("userPoolId"in n)||typeof n.userPoolId!="string"||!("clientId"in n)||typeof n.clientId!="string"||!("provider"in n)||!["volcengine","byteplus"].includes(String(n.provider)))throw new XS("invalid_response",502);return n}async function lit(e,t,n){const i=await i2e(await gn(`/web/users/${encodeURIComponent(e.id)}/role`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:t,expectedRole:e.role}),signal:n}));if(!i||typeof i!="object"||!("user"in i)||!r2e(i.user))throw new XS("invalid_response",502);return i.user}function cit(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 uit(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 Ng({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:m}){const{t:g}=_e("ui"),b=l??g("deploymentSelect.searchPlaceholder"),v=d??g("deploymentSelect.emptyMessage"),y=p.useId(),w=p.useRef(null),x=p.useRef(null),O=p.useRef(null),S=p.useRef(null),k=p.useRef([]),[C,E]=p.useState(!1),[R,A]=p.useState(0),N=r.find(L=>L.value===t),T=(N==null?void 0:N.label)??(t?n:void 0),j=a!==void 0&&!!f,_=()=>{E(!1),j&&a&&(f==null||f(""))};p.useEffect(()=>{if(!C)return;const L=B=>{B.target instanceof Node&&w.current&&!w.current.contains(B.target)&&_()};return window.addEventListener("pointerdown",L),()=>window.removeEventListener("pointerdown",L)},[C,f,a,j]),p.useEffect(()=>{var L,B;if(C){if(j){(L=O.current)==null||L.focus();return}(B=k.current[R])==null||B.focus()}},[C,j]),p.useEffect(()=>{var L;!C||j&&document.activeElement===O.current||(L=k.current[R])==null||L.focus()},[R,C,j]),p.useEffect(()=>{A(L=>Math.min(L,Math.max(0,r.length-1)))},[r.length]),p.useEffect(()=>{if(!C||!u||c||!h)return;const L=window.requestAnimationFrame(()=>{const B=S.current;B&&B.scrollHeight<=B.clientHeight+1&&h()});return()=>window.cancelAnimationFrame(L)},[u,c,h,C,r.length]);const I=(L=1)=>{const B=r.findIndex(H=>H.value===t),M=B>=0?B:L===1?0:Math.max(0,r.length-1);A(M),E(!0)},D=L=>{r.length!==0&&A((L+r.length)%r.length)},P=L=>{var B;m(L.value),_(),(B=x.current)==null||B.focus()};return o.jsxs("div",{className:"pp-deployment-select",ref:w,onKeyDown:L=>{var M,H;const B=L.target===O.current;if(L.key==="Escape"&&C){L.preventDefault(),_(),(M=x.current)==null||M.focus();return}if(L.key==="Tab"){_();return}if(B){L.key==="ArrowDown"&&r.length>0&&(L.preventDefault(),A(0),(H=k.current[0])==null||H.focus());return}L.key==="ArrowDown"?(L.preventDefault(),C?D(R+1):I(1)):L.key==="ArrowUp"?(L.preventDefault(),C?D(R-1):I(-1)):C&&L.key==="Home"?(L.preventDefault(),A(0)):C&&L.key==="End"&&(L.preventDefault(),A(Math.max(0,r.length-1)))},children:[o.jsxs("button",{ref:x,type:"button",className:"pp-deployment-select-trigger","aria-label":e,"aria-haspopup":"listbox","aria-expanded":C,"aria-controls":C?y:void 0,disabled:s,onClick:()=>{C?_():I()},children:[o.jsx("span",{className:T?void 0:"is-placeholder",children:T??i}),o.jsx(cit,{className:`pp-deployment-select-chevron${C?" is-open":""}`})]}),C&&o.jsxs("div",{className:"pp-deployment-select-menu",children:[j&&o.jsx("div",{className:"pp-deployment-select-search",children:o.jsx("input",{ref:O,type:"search",value:a,"aria-label":g("deploymentSelect.searchAriaLabel",{label:e}),placeholder:b,autoComplete:"off",onChange:L=>f==null?void 0:f(L.currentTarget.value)})}),o.jsx("div",{id:y,ref:S,className:"pp-deployment-select-options",role:"listbox","aria-label":e,"aria-busy":c||void 0,onScroll:L=>{if(!u||c||!h)return;const B=L.currentTarget;B.scrollHeight-B.scrollTop-B.clientHeight<=24&&h()},children:r.map((L,B)=>{const M=L.value===t;return o.jsxs("button",{ref:H=>{k.current[B]=H},type:"button",role:"option","aria-selected":M,tabIndex:B===R?0:-1,className:`pp-deployment-select-option${M?" is-selected":""}`,title:L.description,onFocus:()=>A(B),onClick:()=>P(L),children:[o.jsxs("span",{className:"pp-deployment-select-copy",children:[o.jsxs("span",{className:"pp-deployment-select-name",children:[L.label,L.badge&&o.jsx("span",{className:"pp-deployment-select-badge",children:L.badge})]}),L.description&&o.jsx("small",{children:L.description})]}),M&&o.jsx(uit,{})]},L.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 pP({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"})})})}function bn({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})}function dit(){return o.jsx("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("path",{d:"M16 7a6.5 6.5 0 1 0 .2 5M16 3.5V7h-3.5"})})}function s2e(e){return e instanceof XS?e.code:"request_failed"}function fit({user:e,onClose:t,onSaved:n}){const{t:i,i18n:r}=_e("users"),s=p.useRef(null),a=p.useRef(null),l=p.useId(),c=p.useId(),[u,d]=p.useState(e.role),[f,h]=p.useState(!1),[m,g]=p.useState("");p.useEffect(()=>{const v=s.current,y=document.activeElement;return v==null||v.showModal(),()=>{var w;(w=a.current)==null||w.abort(),v==null||v.close(),y instanceof HTMLElement&&y.isConnected&&y.focus()}},[]);const b=async()=>{if(f||u===e.role&&!e.roleConflict)return;const v=new AbortController;a.current=v,h(!0),g("");try{const y=await lit(e,u,v.signal);v.signal.aborted||n(y)}catch(y){v.signal.aborted||g(i(`errors.${s2e(y)}`,{defaultValue:i("errors.request_failed")}))}finally{v.signal.aborted||h(!1)}};return o.jsxs("dialog",{ref:s,className:"user-role-dialog","aria-labelledby":l,"aria-describedby":c,"aria-busy":f,onCancel:v=>{v.preventDefault(),f||t()},children:[o.jsxs("header",{children:[o.jsx("h2",{id:l,children:i("changeRole")}),o.jsx("button",{type:"button",className:"users-close",onClick:t,disabled:f,"aria-label":i("close"),children:o.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:o.jsx("path",{d:"m5 5 10 10M15 5 5 15"})})})]}),o.jsxs("div",{className:"user-role-dialog-body",children:[o.jsxs("div",{className:"users-account",children:[o.jsx("strong",{children:e.name}),o.jsx("span",{children:e.email||e.id})]}),o.jsx("label",{className:"users-field-label",children:i("role")}),o.jsx(Ng,{ariaLabel:i("role"),placeholder:i("role"),value:u,disabled:f,options:GS.map(v=>({value:v,label:i(`roles.${v}`),description:i(`descriptions.${v}`)})),onChange:v=>{const y=GS.find(w=>w===v);y&&d(y)}},r.resolvedLanguage),o.jsx("p",{id:c,className:"users-help",children:i("effectiveAfterRefresh")}),m?o.jsx("p",{className:"users-error",role:"alert",children:m}):null]}),o.jsxs("footer",{children:[o.jsx("button",{className:"users-button",type:"button",disabled:f,onClick:t,children:i("cancel")}),o.jsx("button",{className:"users-button is-primary",type:"button",disabled:f||u===e.role&&!e.roleConflict,onClick:()=>void b(),children:i(f?"saving":"save")})]})]})}function hit({onBack:e}){const{t,i18n:n}=_e("users"),[i,r]=p.useState(null),[s,a]=p.useState(!0),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(""),[b,v]=p.useState(1),[y,w]=p.useState(0),[x,O]=p.useState(null),[S,k]=p.useState(null),[C,E]=p.useState(null);p.useEffect(()=>{const T=new AbortController;return a(!0),c(""),ait({page:b,query:f,role:m,signal:T.signal}).then(j=>{if(!T.signal.aborted){if(j.total>0&&j.items.length===0&&b>1){v(1);return}r(j),E(new Date)}}).catch(j=>{T.signal.aborted||c(s2e(j))}).finally(()=>{T.signal.aborted||a(!1)}),()=>T.abort()},[b,f,m,y]);const R=T=>{T.preventDefault(),h(u.trim()),v(1),w(j=>j+1)},A=T=>{if(!T)return t("neverLoggedIn");const j=Number(T),_=new Date(Number.isFinite(j)&&j>0?j<1e12?j*1e3:j:T);return Number.isNaN(_.getTime())?t("unknown"):_.toLocaleString(n.resolvedLanguage,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})},N=Math.max(1,Math.ceil(((i==null?void 0:i.total)??0)/20));return o.jsxs("section",{className:"users-page","aria-labelledby":"users-title",children:[o.jsxs("header",{className:"users-page-header",children:[o.jsx(pP,{label:t("back"),onClick:e}),o.jsx("h1",{id:"users-title",children:t("title")}),i?o.jsx("span",{className:"users-count",children:t("memberCount",{count:i.poolTotal})}):null]}),o.jsxs("div",{className:"users-content",children:[i?o.jsxs("div",{className:"users-pool",children:[o.jsx("span",{children:i.provider==="byteplus"?"BytePlus Identity":t("volcengineIdentity")}),o.jsxs("span",{className:"users-pool-id",title:i.userPoolId,children:[t("pool")," ",i.userPoolId]})]}):null,o.jsxs("div",{className:"users-toolbar",children:[o.jsxs("form",{className:"users-search",onSubmit:R,children:[o.jsx("input",{value:u,onChange:T=>d(T.target.value),onKeyDown:T=>{T.key==="Enter"&&(T.nativeEvent.isComposing||T.keyCode===229)&&T.preventDefault()},"aria-label":t("searchPlaceholder"),placeholder:t("searchPlaceholder"),maxLength:200}),o.jsx("button",{type:"submit",className:"users-button",disabled:s,children:t("search")})]}),o.jsx("div",{className:"users-role-filter",children:o.jsx(Ng,{ariaLabel:t("filterRole"),placeholder:t("allRoles"),value:m,options:[{value:"",label:t("allRoles")},...GS.map(T=>({value:T,label:t(`roles.${T}`)}))],onChange:T=>{const j=GS.find(_=>_===T);g(j??""),v(1)}})}),o.jsxs("button",{type:"button",className:"users-button users-refresh",disabled:s,onClick:()=>{k(null),w(T=>T+1)},children:[o.jsx(dit,{}),o.jsx("span",{children:t("refresh")})]})]}),o.jsx("div",{className:"users-feedback","aria-live":"polite",children:s?o.jsx(bn,{children:t("loading")}):S?o.jsx("span",{children:t("saved",{name:S.name,role:t(`roles.${S.role}`)})}):C?o.jsx("span",{children:t("updatedAt",{time:C.toLocaleTimeString(n.resolvedLanguage,{hour:"2-digit",minute:"2-digit",hour12:!1})})}):null}),l?o.jsxs("div",{className:"users-error users-error-banner",role:"alert",children:[o.jsx("span",{children:t(`errors.${l}`,{defaultValue:t("errors.request_failed")})}),o.jsx("button",{type:"button",className:"users-button",onClick:()=>w(T=>T+1),children:t("retry")})]}):null,o.jsxs("div",{className:"users-table-wrap","aria-busy":s,children:[o.jsxs("table",{className:"users-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:t("user")}),o.jsx("th",{scope:"col",children:t("role")}),o.jsx("th",{scope:"col",children:t("status")}),o.jsx("th",{scope:"col",children:t("lastLogin")}),o.jsx("th",{scope:"col",children:o.jsx("span",{className:"sr-only",children:t("actions")})})]})}),o.jsx("tbody",{children:i==null?void 0:i.items.map(T=>{var j;return o.jsxs("tr",{children:[o.jsx("td",{"data-label":t("user"),children:o.jsxs("div",{className:"users-person",children:[o.jsx("span",{className:"users-avatar","aria-hidden":"true",children:(j=Array.from(T.name)[0])==null?void 0:j.toUpperCase()}),o.jsxs("div",{className:"users-account",children:[o.jsxs("strong",{children:[T.name,T.currentUser?o.jsx("span",{className:"users-self",children:t("you")}):null]}),o.jsx("span",{title:T.email||T.id,children:T.email||T.id})]})]})}),o.jsxs("td",{"data-label":t("role"),children:[o.jsx("span",{className:`users-role-badge${T.role==="super_admin"?" is-super":""}`,children:t(`roles.${T.role}`)}),T.roleConflict?o.jsx("span",{className:"users-inline-warning",children:t("roleConflict")}):null]}),o.jsx("td",{"data-label":t("status"),children:o.jsx("span",{className:"users-status",children:t(`states.${T.status}`,{defaultValue:t("unknown")})})}),o.jsx("td",{"data-label":t("lastLogin"),className:"users-last-login",children:A(T.lastLogin)}),o.jsx("td",{className:"users-actions",children:T.protected?o.jsx("span",{className:"users-protected",title:t("protectedExplanation"),children:t("initialAdministrator")}):o.jsx("button",{type:"button",className:"users-button is-text",disabled:s||!!l||T.currentUser,onClick:()=>{k(null),O(T)},children:t("changeRole")})})]},T.id)})})]}),!s&&!l&&(i==null?void 0:i.items.length)===0?o.jsxs("div",{className:"users-empty",children:[o.jsx("strong",{children:t("noUsers")}),o.jsx("span",{children:t(f||m?"tryAnotherSearch":"poolEmpty")})]}):null,s&&!i?o.jsx("div",{className:"users-empty",children:o.jsx(bn,{children:t("loading")})}):null]}),i?o.jsxs("footer",{className:"users-pagination",children:[o.jsx("span",{children:t("resultCount",{count:i.total})}),o.jsxs("div",{children:[o.jsx("button",{type:"button",className:"users-button",disabled:b<=1||s,onClick:()=>v(T=>T-1),children:t("previous")}),o.jsxs("span",{children:[b," / ",N]}),o.jsx("button",{type:"button",className:"users-button",disabled:b>=N||s,onClick:()=>v(T=>T+1),children:t("next")})]})]}):null]}),x?o.jsx(fit,{user:x,onClose:()=>O(null),onSaved:T=>{O(null),k(T),w(j=>j+1)}}):null]})}const pit=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"})}),mit=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"})}),git=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"})}),mP=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"})}),IA=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"})}),bit=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"})]}),YS=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"})}),o2e=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"})}),yit=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"})}),vit=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"})}),xit=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"})}),pQ=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"})}),wit=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"})}),a2e=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"})}),Oit=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"})}),kit=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"})}),Sit=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"})}),Eit=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"})}),Cit=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"})}),Tit=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"})}),Ait=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"})}),l2e=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"})]}),_it=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"})]}),jit=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"})}),Nit=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"})]}),sZ=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"})]}),Rit=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"})}),c2e=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"})}),u2e=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"})}),Iit=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"})}),Pit=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"})}),Dit=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"})}),Mit=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"})}),Lit=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"})}),z_=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"})}),$it=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"})}),Fit=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"})}),d2e=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"})]}),mQ=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. * See the LICENSE file in the root directory of this source tree. - */const Iit=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),sAe=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim();/** + */const Bit=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),f2e=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim();/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var Pit={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + */var Uit={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Dit=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:r="",children:s,iconNode:a,...l},c)=>p.createElement("svg",{ref:c,...Pit,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:sAe("lucide",r),...l},[...a.map(([u,d])=>p.createElement(u,d)),...Array.isArray(s)?s:[s]]));/** + */const Qit=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:r="",children:s,iconNode:a,...l},c)=>p.createElement("svg",{ref:c,...Uit,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:f2e("lucide",r),...l},[...a.map(([u,d])=>p.createElement(u,d)),...Array.isArray(s)?s:[s]]));/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vn=(e,t)=>{const n=p.forwardRef(({className:i,...r},s)=>p.createElement(Dit,{ref:s,iconNode:t,className:sAe(`lucide-${Iit(e)}`,i),...r}));return n.displayName=`${e}`,n};/** + */const wn=(e,t)=>{const n=p.forwardRef(({className:i,...r},s)=>p.createElement(Qit,{ref:s,iconNode:t,className:f2e(`lucide-${Bit(e)}`,i),...r}));return n.displayName=`${e}`,n};/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oAe=vn("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + */const h2e=wn("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Mit=vn("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/** + */const zit=wn("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qk=vn("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** + */const qk=wn("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Lit=vn("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** + */const Vit=wn("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aAe=vn("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);/** + */const p2e=wn("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lAe=vn("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** + */const m2e=wn("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $it=vn("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** + */const Hit=wn("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Fit=vn("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/** + */const qit=wn("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Bd=vn("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + */const Ud=wn("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Bit=vn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + */const Wit=wn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Uit=vn("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + */const Kit=wn("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jC=vn("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const jC=wn("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const H_=vn("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + */const V_=wn("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Qit=vn("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + */const Git=wn("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pF=vn("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** + */const pF=wn("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zit=vn("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + */const Xit=wn("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Vit=vn("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/** + */const Yit=wn("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mP=vn("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + */const gP=wn("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Hit=vn("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/** + */const Zit=wn("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qit=vn("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** + */const Jit=wn("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const q_=vn("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** + */const H_=wn("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gP=vn("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** + */const bP=wn("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oZ=vn("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** + */const oZ=wn("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xy=vn("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** + */const wy=wn("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Wit=vn("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const ert=wn("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Kit=vn("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/** + */const trt=wn("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Git=vn("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/** + */const nrt=wn("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gQ=vn("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 gQ=wn("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Xit=vn("FileType2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 13v-1h6v1",key:"1dh9dg"}],["path",{d:"M5 12v6",key:"150t9c"}],["path",{d:"M4 18h2",key:"1xrofg"}]]);/** + */const irt=wn("FileType2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 13v-1h6v1",key:"1dh9dg"}],["path",{d:"M5 12v6",key:"150t9c"}],["path",{d:"M4 18h2",key:"1xrofg"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const cAe=vn("FileVideo2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["rect",{width:"8",height:"6",x:"2",y:"12",rx:"1",key:"1a6c1e"}],["path",{d:"m10 15.5 4 2.5v-6l-4 2.5",key:"t7cp39"}]]);/** + */const g2e=wn("FileVideo2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["rect",{width:"8",height:"6",x:"2",y:"12",rx:"1",key:"1a6c1e"}],["path",{d:"m10 15.5 4 2.5v-6l-4 2.5",key:"t7cp39"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Yit=vn("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/** + */const rrt=wn("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Zit=vn("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/** + */const srt=wn("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bQ=vn("FolderUp",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);/** + */const bQ=wn("FolderUp",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Jit=vn("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** + */const ort=wn("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ert=vn("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** + */const art=wn("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const trt=vn("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/** + */const lrt=wn("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bP=vn("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** + */const yP=wn("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yQ=vn("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** + */const yQ=wn("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Hf=vn("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + */const Tp=wn("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const uAe=vn("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** + */const b2e=wn("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nrt=vn("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/** + */const crt=wn("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Mi=vn("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + */const Bi=wn("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const irt=vn("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** + */const urt=wn("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const rrt=vn("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** + */const drt=wn("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ax=vn("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** + */const ax=wn("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const srt=vn("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** + */const frt=wn("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const dAe=vn("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** + */const y2e=wn("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ort=vn("MonitorPlay",[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);/** + */const hrt=wn("MonitorPlay",[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const art=vn("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** + */const prt=wn("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lrt=vn("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + */const mrt=wn("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jl=vn("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + */const Rl=wn("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const crt=vn("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + */const grt=wn("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fAe=vn("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/** + */const v2e=wn("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const urt=vn("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** + */const brt=wn("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const PN=vn("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + */const DN=wn("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const drt=vn("Shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/** + */const yrt=wn("Shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aZ=vn("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + */const aZ=wn("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ZS=vn("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** + */const ZS=wn("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const frt=vn("Split",[["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M8 3H3v5",key:"15dfkv"}],["path",{d:"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3",key:"1qrqzj"}],["path",{d:"m15 9 6-6",key:"ko1vev"}]]);/** + */const vrt=wn("Split",[["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M8 3H3v5",key:"15dfkv"}],["path",{d:"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3",key:"1qrqzj"}],["path",{d:"m15 9 6-6",key:"ko1vev"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ag=vn("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + */const lg=wn("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const hrt=vn("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const xrt=wn("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const prt=vn("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** + */const wrt=wn("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Oa=vn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),lZ=Object.freeze({totalTokenCount:0,promptTokenCount:0,candidatesTokenCount:0,thoughtsTokenCount:0,cachedContentTokenCount:0}),W_=Object.freeze({modelName:"",current:lZ,cumulative:lZ}),mrt={totalTokenCount:"total_token_count",promptTokenCount:"prompt_token_count",candidatesTokenCount:"candidates_token_count",thoughtsTokenCount:"thoughts_token_count",cachedContentTokenCount:"cached_content_token_count"},grt=24,brt=64,yrt=16;function D2(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 vrt(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=D2(t),s=n.reduce((d,f)=>d+brt+D2(f),0),a=i.reduce((d,f)=>d+yrt+D2(f.name)+D2(f.description??""),0);return grt+r+s+a}function xrt({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 wrt(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 lO(e,t){const n=e,i=n[t]??n[mrt[t]];return typeof i=="number"&&Number.isFinite(i)&&i>0?Math.round(i):0}function Ort(e){const t=lO(e,"promptTokenCount"),n=lO(e,"candidatesTokenCount"),i=lO(e,"thoughtsTokenCount");return{totalTokenCount:lO(e,"totalTokenCount")||t+n+i,promptTokenCount:t,candidatesTokenCount:n,thoughtsTokenCount:i,cachedContentTokenCount:lO(e,"cachedContentTokenCount")}}function krt(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 hAe(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=Ort(s);return a.totalTokenCount===0?r===e.modelName?e:{...e,modelName:r}:{modelName:r,current:a,cumulative:krt(e.cumulative,a)}}function cZ(e){return e.reduce((t,n)=>hAe(t,n),W_)}function uZ(e){return e.blocks.flatMap(t=>t.kind==="tool"?[{name:t.name,args:t.args,response:t.response,done:t.done}]:[])}function Srt(e){const t=e.attributes;return String(t["invocation.id"]??t["gen_ai.invocation.id"]??t["gcp.vertex.agent.invocation_id"]??"")}function Ert(e,t){if(!t)return e;const n=new Set(e.filter(r=>Srt(r)===t).map(r=>r.trace_id)),i=e.filter(r=>n.has(r.trace_id));return i.length>0?i:e}function wy(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Tm(e){return typeof e=="string"?e:""}function pAe(e,t){return e==="pending"||e==="running"||e==="completed"||e==="failed"?e:t}function Crt(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=wy(t)??{};return wy(n.result)??n}function Trt(e){var n;const t=(n=wy(e))==null?void 0:n.branches;return Array.isArray(t)?t.map(i=>{var r;return Tm((r=wy(i))==null?void 0:r.label)}):[]}function mAe(e,t,n){const i=Trt(e),r=Crt(t),s=Array.isArray(r.branches)?r.branches:[],a=n==="running"?"running":"pending";return{branches:[0,1].map(c=>{const u=wy(s[c])??{};return{label:Tm(u.label)||i[c]||`方向 ${c+1}`,content:Tm(u.content),status:pAe(u.status,a),error:Tm(u.error)}})}}function Art(e){const t=wy(e),n=wy(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:Tm(n.requestId),branchIndex:n.branchIndex,label:Tm(n.label),delta:Tm(n.delta),status:pAe(n.status,"running"),error:Tm(n.error)||void 0}}function _rt(e,t,n){return{branches:mAe(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 Na(e,t){return hn.t(`blocks.codexProgress.${e}`,{ns:"conversation",...t})}const gAe=28e4;function dZ(e){try{return JSON.stringify(e).length}catch{return gAe}}function jrt(e){const t=e.slice(-200);let n=t.reduce((i,r)=>i+dZ(r),0);for(;t.length>1&&n>gAe;)n-=dZ(t.shift());return t}function Gc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Bi(e){return typeof e=="string"?e:""}function vQ(e,t=""){const n=Bi(e).toLowerCase();return t.endsWith(".failed")||["failed","error","declined","cancelled"].includes(n)?"failed":t.endsWith(".completed")||["completed","done","success"].includes(n)?"completed":"running"}function bAe(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 yAe(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=Bi(e.command),n=Bi(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 wb(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 vAe(e){const t=Bi(e.id||e.itemId||e.item_id),n=Bi(e.kind);if(!t||!n)return null;const i=vQ(e.status),r=Bi(e.text||e.detail||e.delta),s=!Bi(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:Bi(e.title)||Na("planTitle"),summary:r||void 0,items:a.flatMap(l=>{const c=Gc(l),u=Bi(c==null?void 0:c.text);if(!u)return[];const d=Bi(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=Na(n==="file_change"||n==="fileChange"?"fallback.fileChange":n==="approval"?"fallback.approval":n==="status"?"fallback.status":"fallback.command"),l=yAe(e),c=bAe(e)??(n==="status"&&r||void 0);return{id:t,block:wb(Bi(e.name||e.title)||a,t,i,l,c)}}return null}function xAe(e){const t=Bi(e.type),n=Gc(e.item),i=Bi(n==null?void 0:n.type),r=Bi((n==null?void 0:n.id)||e.id)||(t==="turn.failed"?"turn":"");if(!r)return null;const s=vQ(n==null?void 0:n.status,t);if(i==="reasoning"||i==="agent_message"){const a=Bi(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=Gc(c),d=Bi(u==null?void 0:u.text);if(!d)return[];const f=Bi(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:Na("planTitle"),summary:Na("planSummary",{completed:l.filter(c=>c.status==="completed").length,total:l.length}),items:l,done:s!=="running"}}:null}if(i==="command_execution"){const a=Na(`command.${s}`);return{id:r,block:wb(a,r,s,yAe(n??{}),bAe(n??{}))}}if(i==="file_change"){const a=Array.isArray(n==null?void 0:n.changes)?n.changes:[],l=a.length?Na("projectFiles",{count:a.length}):Na("projectFile"),c=Na(`fileChange.${s}`,{subject:l});return{id:r,block:wb(c,r,s,a.length?{changes:a}:void 0)}}if(i==="mcp_tool_call"){const a=[Bi(n==null?void 0:n.server),Bi(n==null?void 0:n.tool)].filter(Boolean).join("/")||Na("externalTool"),l=Na(`mcp.${s}`,{tool:a}),c=Gc(n==null?void 0:n.error),u=(n==null?void 0:n.result)!==void 0?n.result:Bi(c==null?void 0:c.message)||void 0;return{id:r,block:wb(l,r,s,n==null?void 0:n.arguments,u)}}if(i==="collab_tool_call"){const a=Bi(n==null?void 0:n.tool),l=["spawn_agent","send_input","wait","close_agent"].includes(a)?a:"default",c=Na(`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:wb(c,r,s,Object.keys(u).length?u:void 0,n==null?void 0:n.agents_states)}}if(i==="web_search"){const a=Na(`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:wb(a,r,s,Object.keys(l).length?l:void 0)}}if(i==="error"||t==="error"||t==="turn.failed"){const a=Gc(e.error),l=Bi((n==null?void 0:n.message)||e.message||(a==null?void 0:a.message))||Na("errorDetail");return{id:r,block:wb(Na("errorTitle"),r,"failed",void 0,l)}}return null}function Nrt(e){const t=Gc(e),n=Gc(t==null?void 0:t.veadkStudioToolProgress);if(!n||n.kind!=="codex")return null;const i=Bi(n.toolName),r=Bi(n.requestId);if(!i||!r)return null;const s=Gc(n.event??n.activity);if(!s)return null;const a=Gc(s.item)||Bi(s.type)?xAe(s):vAe(s);if(!a)return null;const l=Bi(n.title||n.label),c=Bi(s.agentSessionId??s.agent_session_id),u=Bi(s.sandboxSessionId??s.sandbox_session_id),d=Bi(s.threadId??s.thread_id),f=vQ(s.status,Bi(s.type)),m=Bi(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}:{},...m?{terminalStatus:m}:{},event:a}}function Rrt(e,t){const n=Gc(t),i=Gc((n==null?void 0:n.codexActivity)??(n==null?void 0:n.codex_activity));if(!i)return e;const r=Bi(i.title)||(e==null?void 0:e.title)||"Codex Sandbox",s=Bi(i.agentSessionId??i.agent_session_id)||(e==null?void 0:e.agentSessionId),a=Bi(i.sandboxSessionId??i.sandbox_session_id)||(e==null?void 0:e.sandboxSessionId),l=Bi(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=Gc(d);if(!f)continue;const h=Gc(f.item)||Bi(f.type)?xAe(f):vAe(f);h&&(h.finalAnswer||(c=mF(c,{title:r,...s?{agentSessionId:s}:{},...a?{sandboxSessionId:a}:{},...l?{threadId:l}:{},event:h})))}return c}function mF(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:jrt(n)}}const wAe="send_a2ui_json_to_client",gF="validated_a2ui_json",bF="adk_request_credential",fZ="transfer_to_agent";function Irt(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 yF(){return{blocks:[],liveStart:0,pendingCodexProgress:[]}}function hZ(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=mF(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=mF(i.codexActivity,t),i.status=t.terminalStatus??"running",t.terminalStatus&&(i.done=!0),"applied")}return"unmatched"}function Prt(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 pZ(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 vF=e=>e.functionCall??e.function_call,JS=e=>e.functionResponse??e.function_response;function Drt(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function Mrt(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function yP(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:Mrt(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 eE(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 Lrt=new Set(["llm","sequential","parallel","loop","a2a"]);function $rt(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"&&Lrt.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 Frt(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 Brt(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 sL(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 M2(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function OAe(e,t){var d,f,h,m,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=Art(v.partMetadata??v.part_metadata);return y?[y]:[]}),l=s.flatMap(v=>{const y=Nrt(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 w=n[y];if(!(w.kind!=="tool"||w.done||w.name!==v.toolName||v.requestId&&w.callId&&w.callId!==v.requestId)){w.response=_rt(w.args,w.response,v),w.status="running";break}}for(const v of l)hZ(n,v)==="unmatched"&&(r=[...r,v].slice(-64));return{blocks:n,liveStart:i,pendingCodexProgress:r}}const c=s.some(v=>vF(v)||JS(v));if(t.partial&&!c){for(const v of s){const y=eE(v);typeof y=="string"&&y&&sL(n,v.thought?"thinking":"text",y)}return{blocks:n,liveStart:i,pendingCodexProgress:r}}n.length=i;for(const v of s){const y=vF(v),w=JS(v),x=yP([v]),O=eE(v);if(typeof O=="string"&&O)sL(n,v.thought?"thinking":"text",O);else if(x.length)M2(n),Frt(n,x);else if(y)if(M2(n),y.name===fZ){const S=Drt(y.args)||((f=t.actions)==null?void 0:f.transferToAgent)||((h=t.actions)==null?void 0:h.transfer_to_agent)||hn.t("app:common.unknownAgent");n.push({kind:"agent-transfer",agentName:S,done:!1})}else if(y.name===bF){const S=y.args??{},k=S.authConfig??S.auth_config??S,E=String(S.functionCallId??S.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;n.push({kind:"auth",callId:y.id??"",label:E,authUri:Irt(k),authConfig:k,done:!1})}else{const S={kind:"tool",name:y.name??"",callId:y.id,args:y.args,done:!1};if(n.push(S),S.callId){const k=[];for(const C of r)C.toolName===S.name&&C.requestId===S.callId?hZ(n,C):k.push(C);r=k}}else if(w){if(M2(n),w.name===fZ)for(let S=n.length-1;S>=0;S--){const k=n[S];if(k.kind==="agent-transfer"&&!k.done){k.done=!0;break}}if(w.name===bF)for(let S=n.length-1;S>=0;S--){const k=n[S];if(k.kind==="auth"&&!k.done){k.done=!0;break}}for(let S=n.length-1;S>=0;S--){const k=n[S],C=k.kind==="tool"&&k.name==="delegate_to_codex_sandbox";if(k.kind==="tool"&&(!k.done||C)&&k.name===w.name&&(!w.id||!k.callId||k.callId===w.id)){const E=C?pZ(k.response):"";if(k.done=!0,k.response=w.response,C){k.codexActivity=Rrt(k.codexActivity,w.response),k.status=Prt(w.response);const R=pZ(w.response);R&&R!==E&&sL(n,"text",R)}break}}if(w.name===wAe){const S=((m=w.response)==null?void 0:m[gF])??[];if(S.length){const k=n[n.length-1];k&&k.kind==="a2ui"?k.messages.push(...S):n.push({kind:"a2ui",messages:S})}}}}const u=((g=t.actions)==null?void 0:g.artifactDelta)??((b=t.actions)==null?void 0:b.artifact_delta);return u&&Brt(n,Object.entries(u).map(([v,y])=>({filename:v,version:y}))),M2(n),i=n.length,{blocks:n,liveStart:i,pendingCodexProgress:r}}function Urt(e,t){var u,d,f,h,m,g;if(e.partial===!0)return!1;const n=((u=e.content)==null?void 0:u.parts)??[],i=n.some(b=>{const v=eE(b);return!b.thought&&typeof v=="string"&&v.trim().length>0||yP([b]).length>0}),r=n.some(b=>{var y;const v=JS(b);return(v==null?void 0:v.name)===wAe&&Array.isArray((y=v.response)==null?void 0:y[gF])&&v.response[gF].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)??((m=e.actions)==null?void 0:m.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 Qrt(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=>!!(eE(s)||yP([s]).length>0||vF(s)||JS(s)))}function xF(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=yF();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 m=i.get(h);if(!m&&r){const y=i.get(r);y&&(!y.meta.author||y.meta.author===d)&&(i.delete(r),r=void 0,m=y)}if(!m&&!Qrt(u))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(!m){const y=`${e}-${n++}`;m={acc:yF(),localId:y,meta:{author:d||void 0,invocationId:f||void 0}}}m.acc=OAe(m.acc,u);const g=u.usageMetadata??u.usage_metadata,b=Urt(u,m.acc.blocks);m.meta={...m.meta,author:d||m.meta.author,localId:m.localId,streaming:!b,tokens:(g==null?void 0:g.totalTokenCount)||m.meta.tokens,ts:u.timestamp||m.meta.ts,invocationId:f||m.meta.invocationId,eventId:b&&u.id?u.id:m.meta.eventId};const v={role:"assistant",blocks:m.acc.blocks,meta:m.meta};return b?(i.delete(h),r=void 0):i.set(h,m),{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 Db(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 zrt(e,t={}){var r;let n=[],i=xF("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 m;return((m=JS(h))==null?void 0:m.name)===bF})){for(let h=n.length-1;h>=0;h--)if(n[h].role==="assistant"){for(let m=n[h].blocks.length-1;m>=0;m--){const g=n[h].blocks[m];if(g.kind==="auth"){g.done=!0;break}}break}}const c=l.map(eE).filter(h=>!!h).join(""),u=yP(l),d=$rt(l);if(!c&&!u.length&&!d)continue;for(const h of i.finish())n=Db(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}})}else{const l=i.project(s);l.ignored||(n=Db(n,l.turn))}for(const s of i.finish())n=Db(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 vP(e,t=hn.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 kAe(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=kAe(i,t,e);if(r)return r}}function Vrt(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=kAe(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 Hrt(e,t){const n=[];return e.forEach((i,r)=>{const s=Vrt(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 qrt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"9",cy:"8",r:"3.25"}),o.jsx("path",{d:"M2.75 20v-1.5a6.25 6.25 0 0 1 12.5 0V20M16 5.25a3.25 3.25 0 0 1 0 6.5M18 14a5.5 5.5 0 0 1 3.25 5V20"})]})}function SAe(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=p.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},xQ=e=>{const t=Wrt(e),n=p.Children.count(t);return p.Children.map(t,i=>{if(typeof i=="string"&&i.trim())return n<=1?i:o.jsx("span",{children:i});if(p.isValidElement(i)){const r=i,{children:s,...a}=r.props;return s!=null?p.cloneElement(r,a,xQ(s)):r}return i})},Krt="_Badge_1viyg_1",Grt={Badge:Krt},Lo=({children:e,className:t,variant:n="soft",color:i="secondary",size:r="sm",pill:s,...a})=>o.jsx("div",{className:Ti(Grt.Badge,t),"data-color":i,"data-size":r,"data-pill":s?"":void 0,"data-variant":n,...a,children:xQ(e)});var Xrt=typeof xm=="object"&&xm&&xm.Object===Object&&xm,Yrt=typeof self=="object"&&self&&self.Object===Object&&self;Xrt||Yrt||Function("return this")();var Zrt=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Jrt(){const e=p.useRef(!1);return p.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),p.useCallback(()=>e.current,[])}var mZ={width:void 0,height:void 0};function EAe(e){const{ref:t,box:n="content-box"}=e,[{width:i,height:r},s]=p.useState(mZ),a=Jrt(),l=p.useRef({...mZ}),c=p.useRef(void 0);return c.current=e.onResize,p.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=gZ(d,f,"inlineSize"),m=gZ(d,f,"blockSize");if(l.current.width!==h||l.current.height!==m){const b={width:h,height:m};l.current.width=h,l.current.height=m,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 gZ(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 wQ(e,t){const n=p.useRef(e);Zrt(()=>{n.current=e},[e]),p.useEffect(()=>{if(!t&&t!==0)return;const i=setTimeout(()=>{n.current()},t);return()=>{clearTimeout(i)}},[t])}const est={DEV:!1,MODE:"production"},lx=typeof import.meta<"u"?est:void 0,tst=!!(lx!=null&&lx.DEV),nst=typeof navigator<"u"&&/(jsdom|happy-dom)/i.test(navigator.userAgent)||typeof globalThis.happyDOM=="object",CAe=(lx==null?void 0:lx.MODE)==="test"||nst,ist=typeof window<"u",TAe=typeof document<"u",rst=ist&&TAe,OQ=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())},DN=(e,t)=>{const n=()=>{const a=setTimeout(e);return()=>{clearTimeout(a)}};if(!rst||typeof window.requestAnimationFrame!="function"||TAe&&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)}},Ky=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},{}),oL=e=>typeof e=="number"?`${e}deg`:e,aL=e=>String(e),L2=e=>`${e}ms`,lL=({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(${oL(i)})`,r==null?null:`skewX(${oL(r)})`,s==null?null:`skewY(${oL(s)})`].filter(Boolean);return a.length?a.join(" "):"none"},cL=({blur:e}={})=>{const t=[e==null?null:`blur(${e}px)`].filter(Boolean);return t.length?t.join(" "):"none"},Kh=e=>{e.preventDefault()},AAe=e=>e.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]'),sst="_LoadingIndicator_7yl6f_1",ost={LoadingIndicator:sst},NC=({className:e,size:t,strokeWidth:n,style:i,...r})=>o.jsx("div",{...r,className:Ti(ost.LoadingIndicator,e),style:i||Ky({"indicator-size":t,"indicator-stroke":n})});var ast=Object.defineProperty,kQ=(e,t)=>ast(e,"name",{value:t,configurable:!0});function wF(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}kQ(wF,"setRef");function _Ae(...e){return t=>{let n=!1;const i=e.map(r=>{const s=wF(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;rlst(e,"name",{value:t,configurable:!0});function cp(e){const t=p.forwardRef((n,i)=>{let{children:r,...s}=n,a=null,l=!1;const c=[];OF(r)&&typeof $2=="function"&&(r=$2(r._payload)),p.Children.forEach(r,h=>{var m;if(DAe(h)){l=!0;const g=h;let b="child"in g.props?g.props.child:g.props.children;OF(b)&&typeof $2=="function"&&(b=$2(b._payload)),a=cst(g,b),c.push((m=a==null?void 0:a.props)==null?void 0:m.children)}else c.push(h)}),a?a=p.cloneElement(a,void 0,c):!l&&p.Children.count(r)===1&&p.isValidElement(r)&&(a=r);const u=a?PAe(a):void 0,d=fr(i,u);if(!a){if(r||r===0)throw new Error(l?fst(e):dst(e));return r}const f=IAe(s,a.props??{});return a.type!==p.Fragment&&(f.ref=i?d:u),p.cloneElement(a,f)});return t.displayName=`${e}.Slot`,t}Ud(cp,"createSlot");var jAe=cp("Slot"),NAe=Symbol.for("radix.slottable");function RAe(e){const t=Ud(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=NAe,t}Ud(RAe,"createSlottable");var cst=Ud((e,t)=>{if("child"in e.props){const n=e.props.child;return p.isValidElement(n)?p.cloneElement(n,void 0,e.props.children(n.props.children)):null}return p.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function IAe(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}}Ud(IAe,"mergeProps");function PAe(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)}Ud(PAe,"getElementRef");function DAe(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===NAe}Ud(DAe,"isSlottable");var ust=Symbol.for("react.lazy");function OF(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===ust&&"_payload"in e&&MAe(e._payload)}Ud(OF,"isLazyComponent");function MAe(e){return typeof e=="object"&&e!==null&&"then"in e}Ud(MAe,"isPromiseLike");var dst=Ud(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),fst=Ud(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),$2=Fy[" use ".trim().toString()],hst=Object.defineProperty,pst=(e,t)=>hst(e,"name",{value:t,configurable:!0}),mst=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Fr=mst.reduce((e,t)=>{const n=cp(`Primitive.${t}`),i=p.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 SQ(e,t){e&&si.flushSync(()=>e.dispatchEvent(t))}pst(SQ,"dispatchDiscreteCustomEvent");var gst=Object.defineProperty,bst=(e,t)=>gst(e,"name",{value:t,configurable:!0}),yst=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"}),vst=p.forwardRef(bst(function(t,n){return o.jsx(Fr.span,{...t,ref:n,style:{...yst,...t.style}})},"VisuallyHidden")),xst=vst,wst=Object.defineProperty,Iu=(e,t)=>wst(e,"name",{value:t,configurable:!0});function Ost(e,t){const n=p.createContext(t);n.displayName=e+"Context";const i=Iu(s=>{const{children:a,...l}=s,c=p.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=p.useContext(n);if(c)return c;if(t!==void 0)return t;if(!l)throw new Error(`\`${s}\` must be used within \`${e}\``)}return Iu(r,"useContext"),[i,r]}Iu(Ost,"createContext");function gc(e,t=[]){let n=[];function i(s,a){const l=p.createContext(a);l.displayName=s+"Context";const c=n.length;n=[...n,a];const u=Iu(f=>{var y;const{scope:h,children:m,...g}=f,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=p.useMemo(()=>g,Object.values(g));return o.jsx(b.Provider,{value:v,children:m})},"Provider");u.displayName=s+"Provider";function d(f,h,m={}){var y;const{optional:g=!1}=m,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=p.useContext(b);if(v)return v;if(a!==void 0)return a;if(!g)throw new Error(`\`${f}\` must be used within \`${s}\``)}return Iu(d,"useContext"),[u,d]}Iu(i,"createContext");const r=Iu(()=>{const s=n.map(a=>p.createContext(a));return Iu(function(l){const c=(l==null?void 0:l[e])||s;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])},"useScope")},"createScope");return r.scopeName=e,[i,LAe(r,...t)]}Iu(gc,"createContextScope");function LAe(...e){const t=e[0];if(e.length===1)return t;const n=Iu(()=>{const i=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return Iu(function(s){const a=i.reduce((l,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...l,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}Iu(LAe,"composeContextScopes");var kst=Object.defineProperty,ma=(e,t)=>kst(e,"name",{value:t,configurable:!0});function EQ(e){const t=e+"CollectionProvider",[n,i]=gc(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=ma(b=>{const{scope:v,children:y}=b,w=p.useRef(null),x=p.useRef(new Map).current;return o.jsx(r,{scope:v,itemMap:x,collectionRef:w,children:y})},"CollectionProvider");a.displayName=t;const l=e+"CollectionSlot",c=cp(l),u=p.forwardRef((b,v)=>{const{scope:y,children:w}=b,x=s(l,y),O=fr(v,x.collectionRef);return o.jsx(c,{ref:O,children:w})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=cp(d),m=p.forwardRef((b,v)=>{const{scope:y,children:w,...x}=b,O=p.useRef(null),S=fr(v,O),k=s(d,y);return p.useEffect(()=>(k.itemMap.set(O,{ref:O,...x}),()=>void k.itemMap.delete(O))),o.jsx(h,{[f]:"",ref:S,children:w})});m.displayName=d;function g(b){const v=s(e+"CollectionConsumer",b);return p.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const x=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((k,C)=>x.indexOf(k.ref.current)-x.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return ma(g,"useCollection"),[{Provider:a,Slot:u,ItemSlot:m},g,i]}ma(EQ,"createCollection");var bZ=new WeakMap,jo,Qc,uL=(Qc=class extends Map{constructor(n){super(n);WW(this,jo);$M(this,jo,[...super.keys()]),bZ.set(this,!0)}set(n,i){return bZ.get(this)&&(this.has(n)?rl(this,jo)[rl(this,jo).indexOf(n)]=n:rl(this,jo).push(n)),super.set(n,i),this}insert(n,i,r){const s=this.has(i),a=rl(this,jo).length,l=CQ(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=[...rl(this,jo)];let h,m=!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 Qc(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 Qc(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 Qc(i)}toReversed(){const n=new Qc;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 Qc(i)}slice(n,i){const r=new Qc;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}},jo=new WeakMap,ma(Qc,"OrderedDict"),Qc);function K_(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=$Ae(e,t);return n===-1?void 0:e[n]}ma(K_,"at");function $Ae(e,t){const n=e.length,i=CQ(t),r=i>=0?i:n+i;return r<0||r>=n?-1:r}ma($Ae,"toSafeIndex");function CQ(e){return e!==e||e===0?0:Math.trunc(e)}ma(CQ,"toSafeInteger");function Sst(e){const t=e+"CollectionProvider",[n,i]=gc(t),[r,s]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new uL,setItemMap:ma(()=>{},"setItemMap")}),a=ma(({state:x,...O})=>x?o.jsx(c,{...O,state:x}):o.jsx(l,{...O}),"CollectionProvider");a.displayName=t;const l=ma(x=>{const O=v();return o.jsx(c,{...x,state:O})},"CollectionInit");l.displayName=t+"Init";const c=ma(x=>{const{scope:O,children:S,state:k}=x,C=p.useRef(null),[E,R]=p.useState(null),A=fr(C,R),[j,T]=k;return p.useEffect(()=>{if(!E)return;const N=UAe(()=>{});return N.observe(E,{childList:!0,subtree:!0}),()=>{N.disconnect()}},[E]),o.jsx(r,{scope:O,itemMap:j,setItemMap:T,collectionRef:A,collectionRefObject:C,collectionElement:E,children:S})},"CollectionProviderImpl");c.displayName=t+"Impl";const u=e+"CollectionSlot",d=cp(u),f=p.forwardRef((x,O)=>{const{scope:S,children:k}=x,C=s(u,S),E=fr(O,C.collectionRef);return o.jsx(d,{ref:E,children:k})});f.displayName=u;const h=e+"CollectionItemSlot",m="data-radix-collection-item",g=cp(h),b=p.forwardRef((x,O)=>{const{scope:S,children:k,...C}=x,E=p.useRef(null),[R,A]=p.useState(null),j=fr(O,E,A),T=s(h,S),{setItemMap:N}=T,_=p.useRef(C);FAe(_.current,C)||(_.current=C);const D=_.current;return p.useEffect(()=>{const M=D;return N(P=>R?P.has(R)?P.set(R,{...M,element:R}).toSorted(kF):(P.set(R,{...M,element:R}),P.toSorted(kF)):P),()=>{N(P=>!R||!P.has(R)?P:(P.delete(R),new uL(P)))}},[R,D,N]),o.jsx(g,{[m]:"",ref:j,children:k})});b.displayName=h;function v(){return p.useState(new uL)}ma(v,"useInitCollection");function y(x){const{itemMap:O}=s(e+"CollectionConsumer",x);return O}return ma(y,"useCollection"),[{Provider:a,Slot:f,ItemSlot:b},{createCollectionScope:i,useCollection:y,useInitCollection:v}]}ma(Sst,"createCollection");function FAe(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}ma(FAe,"shallowEqual");function BAe(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}ma(BAe,"isElementPreceding");function kF(e,t){return!e[1].element||!t[1].element?0:BAe(e[1].element,t[1].element)?-1:1}ma(kF,"sortByDocumentPosition");function UAe(e){return new MutationObserver(n=>{for(const i of n)if(i.type==="childList"){e();return}})}ma(UAe,"getChildListObserver");var Est=Object.defineProperty,qw=(e,t)=>Est(e,"name",{value:t,configurable:!0}),QAe=!!(typeof window<"u"&&window.document&&window.document.createElement);function An(e,t,{checkForDefaultPrevented:n=!0}={}){return qw(function(r){if(e==null||e(r),n===!1||!r||!r.defaultPrevented)return t==null?void 0:t(r)},"handleEvent")}qw(An,"composeEventHandlers");function Cst(e){var t;if(!QAe)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}qw(Cst,"getOwnerWindow");function SF(e){if(!QAe)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}qw(SF,"getOwnerDocument");function zAe(e,t=!1){const{activeElement:n}=SF(e);if(!(n!=null&&n.nodeName))return null;if(VAe(n)&&n.contentDocument)return zAe(n.contentDocument.body,t);if(t){const i=n.getAttribute("aria-activedescendant");if(i){const r=SF(n).getElementById(i);if(r)return r}}return n}qw(zAe,"getActiveElement");function VAe(e){return e.tagName==="IFRAME"}qw(VAe,"isFrame");var qu=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},Tst=Object.defineProperty,Ast=(e,t)=>Tst(e,"name",{value:t,configurable:!0}),yZ=Fy[" useEffectEvent ".trim().toString()],vZ=Fy[" useInsertionEffect ".trim().toString()];function HAe(e){if(typeof yZ=="function")return yZ(e);const t=p.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof vZ=="function"?vZ(()=>{t.current=e}):qu(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}Ast(HAe,"useEffectEvent");var _st=Object.defineProperty,RC=(e,t)=>_st(e,"name",{value:t,configurable:!0}),jst=Fy[" useInsertionEffect ".trim().toString()]||qu;function td({prop:e,defaultProp:t,onChange:n=RC(()=>{},"onChange"),caller:i}){const[r,s,a]=qAe({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:r,u=p.useCallback(d=>{var f;if(l){const h=WAe(d)?d(e):d;h!==e&&((f=a.current)==null||f.call(a,h))}else s(d)},[l,e,s,a]);return[c,u]}RC(td,"useControllableState");function qAe({defaultProp:e,onChange:t}){const[n,i]=p.useState(e),r=p.useRef(n),s=p.useRef(t);return jst(()=>{s.current=t},[t]),p.useEffect(()=>{var a;r.current!==n&&((a=s.current)==null||a.call(s,n),r.current=n)},[n,r]),[n,i,s]}RC(qAe,"useUncontrolledState");function WAe(e){return typeof e=="function"}RC(WAe,"isFunction");var xZ=Symbol("RADIX:SYNC_STATE");function Nst(e,t,n,i){const{prop:r,defaultProp:s,onChange:a,caller:l}=t,c=r!==void 0,u=HAe(a),d=[{...n,state:s}];i&&d.push(i);const[f,h]=p.useReducer((v,y)=>{if(y.type===xZ)return{...v,state:y.state};const w=e(v,y);return c&&!Object.is(w.state,v.state)&&u(w.state),w},...d),m=f.state,g=p.useRef(m);p.useEffect(()=>{g.current!==m&&(g.current=m,c||u(m))},[m,g,c]);const b=p.useMemo(()=>r!==void 0?{...f,state:r}:f,[f,r]);return p.useEffect(()=>{c&&!Object.is(r,f.state)&&h({type:xZ,state:r})},[r,f.state,c]),[b,h]}RC(Nst,"useControllableStateReducer");var Rst=Object.defineProperty,up=(e,t)=>Rst(e,"name",{value:t,configurable:!0});function KAe(e,t){return p.useReducer((n,i)=>t[n][i]??n,e)}up(KAe,"useStateMachine");var qf=up(e=>{const{present:t,children:n}=e,i=GAe(t),r=typeof n=="function"?n({present:i.isPresent}):p.Children.only(n),s=XAe(i.ref,YAe(r));return typeof n=="function"||i.isPresent?p.cloneElement(r,{ref:s}):null},"Presence");function GAe(e){const[t,n]=p.useState(),i=p.useRef(null),r=p.useRef(e),s=p.useRef("none"),a=p.useRef(void 0),l=e?"mounted":"unmounted",[c,u]=KAe(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{c==="mounted"?(s.current=a.current??lv(i.current),a.current=void 0):s.current="none"},[c]),qu(()=>{const d=i.current,f=r.current;if(f!==e){const m=s.current,g=lv(d);e?(a.current=g,u("MOUNT")):g==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,u]),qu(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=up(g=>{const v=lv(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"),m=up(g=>{g.target===t&&(s.current=lv(i.current))},"handleAnimationStart");return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:p.useCallback(d=>{if(d){const f=getComputedStyle(d);i.current=f,a.current=lv(f)}else i.current=null;n(d)},[])}}up(GAe,"usePresence");function EF(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}up(EF,"setRef");function XAe(...e){const t=p.useRef(e);return t.current=e,p.useCallback(n=>{const i=t.current;let r=!1;const s=i.map(a=>{const l=EF(a,n);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let a=0;aIst(e,"name",{value:t,configurable:!0}),Dst=Fy[" useId ".trim().toString()]||(()=>{}),Mst=0;function lg(e){const[t,n]=p.useState(Dst());return qu(()=>{e||n(i=>i??String(Mst++))},[e]),e||(t?`radix-${t}`:"")}Pst(lg,"useId");var Lst=Object.defineProperty,$st=(e,t)=>Lst(e,"name",{value:t,configurable:!0}),Fst=p.createContext(void 0);function IC(e){const t=p.useContext(Fst);return e||t||"ltr"}$st(IC,"useDirection");var Bst=Object.defineProperty,Ust=(e,t)=>Bst(e,"name",{value:t,configurable:!0});function Dd(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}Ust(Dd,"useCallbackRef");var Qst=Object.defineProperty,ha=(e,t)=>Qst(e,"name",{value:t,configurable:!0}),CF="dismissableLayer.update",zst="dismissableLayer.pointerDownOutside",Vst="dismissableLayer.focusOutside",wZ,ZAe=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),TQ=p.forwardRef(ha(function(t,n){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l,onInteractOutside:c,onDismiss:u,...d}=t,f=p.useContext(ZAe),[h,m]=p.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=p.useState({}),v=fr(n,m),y=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),x=w?y.indexOf(w):-1,O=h?y.indexOf(h):-1,S=f.layersWithOutsidePointerEventsDisabled.size>0,k=O>=x,C=p.useRef(!1),E=JAe(T=>{a==null||a(T),c==null||c(T),T.defaultPrevented||u==null||u()},{ownerDocument:g,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(T=>{if(!(T instanceof Node))return!1;const N=[...f.branches].some(_=>_.contains(T));return k&&!N},[f.branches,k])}),R=e_e(T=>{if(r&&C.current)return;const N=T.target;[...f.branches].some(D=>D.contains(N))||(l==null||l(T),c==null||c(T),T.defaultPrevented||u==null||u())},g),A=h?O===y.length-1:!1,j=Dd(T=>{T.key==="Escape"&&(s==null||s(T),!T.defaultPrevented&&u&&(T.preventDefault(),u()))});return p.useEffect(()=>{if(A)return g.addEventListener("keydown",j,{capture:!0}),()=>g.removeEventListener("keydown",j,{capture:!0})},[g,A,j]),p.useEffect(()=>{if(h)return i&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(wZ=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),TF(),()=>{i&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=wZ))}},[h,g,i,f]),p.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),TF())},[h,f]),p.useEffect(()=>{const T=ha(()=>b({}),"handleUpdate");return document.addEventListener(CF,T),()=>document.removeEventListener(CF,T)},[]),o.jsx(Fr.div,{...d,ref:v,style:{pointerEvents:S?k?"auto":"none":void 0,...t.style},onFocusCapture:An(t.onFocusCapture,R.onFocusCapture),onBlurCapture:An(t.onBlurCapture,R.onBlurCapture),onPointerDownCapture:An(t.onPointerDownCapture,E.onPointerDownCapture)})},"DismissableLayer"));function Hst(){const e=p.useContext(ZAe),[t,n]=p.useState(null);return p.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}ha(Hst,"useDismissableLayerSurface");var qst=ha(()=>!0,"IS_TRUE");function JAe(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:s,shouldHandlePointerDownOutside:a=qst}=t,l=Dd(e),c=p.useRef(!1),u=p.useRef(!1),d=p.useRef(new Map),f=p.useRef(()=>{});return p.useEffect(()=>{function h(){u.current=!1,r.current=!1,d.current.clear()}ha(h,"resetOutsideInteraction");function m(){return Array.from(d.current.values()).some(Boolean)}ha(m,"isOutsideInteractionIntercepted");function g(x){if(!u.current)return;const O=x.target;O instanceof Node&&[...s].some(k=>k.contains(O))||d.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}ha(g,"handleInteractionCapture");function b(x){u.current&&d.current.set(x.type,!1)}ha(b,"handleInteractionBubble");const v=ha(x=>{if(x.target&&!c.current){let O=function(){n.removeEventListener("click",f.current);const k=m();h(),k||AQ(zst,l,S,{discrete:!0})};if(ha(O,"handleAndDispatchPointerDownOutsideEvent"),!a(x.target)){n.removeEventListener("click",f.current),h(),c.current=!1;return}const S={originalEvent:x};u.current=!0,r.current=i&&x.button===0,d.current.clear(),!i||x.button!==0?O():(n.removeEventListener("click",f.current),f.current=O,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 x of y)n.addEventListener(x,g,!0),n.addEventListener(x,b);const w=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(w),n.removeEventListener("pointerdown",v),n.removeEventListener("click",f.current);for(const x of y)n.removeEventListener(x,g,!0),n.removeEventListener(x,b)}},[n,l,i,r,s,a]),{onPointerDownCapture:ha(()=>c.current=!0,"onPointerDownCapture")}}ha(JAe,"usePointerDownOutside");function e_e(e,t=globalThis==null?void 0:globalThis.document){const n=Dd(e),i=p.useRef(!1);return p.useEffect(()=>{const r=ha(s=>{s.target&&!i.current&&AQ(Vst,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:ha(()=>i.current=!0,"onFocusCapture"),onBlurCapture:ha(()=>i.current=!1,"onBlurCapture")}}ha(e_e,"useFocusOutside");function TF(){const e=new CustomEvent(CF);document.dispatchEvent(e)}ha(TF,"dispatchUpdate");function AQ(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?SQ(r,s):r.dispatchEvent(s)}ha(AQ,"handleAndDispatchCustomEvent");var Wst=Object.defineProperty,Nl=(e,t)=>Wst(e,"name",{value:t,configurable:!0}),dL="focusScope.autoFocusOnMount",fL="focusScope.autoFocusOnUnmount",OZ={bubbles:!1,cancelable:!0},t_e=p.forwardRef(Nl(function(t,n){const{loop:i=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=t,[c,u]=p.useState(null),d=Dd(s),f=Dd(a),h=p.useRef(null),m=fr(n,u),g=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let v=function(O){if(g.paused||!c)return;const S=O.target;c.contains(S)?h.current=S:kh(h.current,{select:!0})},y=function(O){if(g.paused||!c)return;const S=O.relatedTarget;S!==null&&(c.contains(S)||kh(h.current,{select:!0}))},w=function(O){if(document.activeElement===document.body)for(const k of O)k.removedNodes.length>0&&kh(c)};Nl(v,"handleFocusIn"),Nl(y,"handleFocusOut"),Nl(w,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",y);const x=new MutationObserver(w);return c&&x.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),x.disconnect()}}},[r,c,g.paused]),p.useEffect(()=>{if(c){kZ.add(g);const v=document.activeElement;if(!c.contains(v)){const w=new CustomEvent(dL,OZ);c.addEventListener(dL,d),c.dispatchEvent(w),w.defaultPrevented||(n_e(a_e(_Q(c)),{select:!0}),document.activeElement===v&&kh(c))}return()=>{c.removeEventListener(dL,d),setTimeout(()=>{const w=new CustomEvent(fL,OZ);c.addEventListener(fL,f),c.dispatchEvent(w),w.defaultPrevented||kh(v??document.body,{select:!0}),c.removeEventListener(fL,f),kZ.remove(g)},0)}}},[c,d,f,g]);const b=p.useCallback(v=>{if(!i&&!r||g.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(y&&w){const x=v.currentTarget,[O,S]=i_e(x);O&&S?!v.shiftKey&&w===S?(v.preventDefault(),i&&kh(O,{select:!0})):v.shiftKey&&w===O&&(v.preventDefault(),i&&kh(S,{select:!0})):w===x&&v.preventDefault()}},[i,r,g.paused]);return o.jsx(Fr.div,{tabIndex:-1,...l,ref:m,onKeyDown:b})},"FocusScope"));function n_e(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(kh(i,{select:t}),document.activeElement!==n)return}Nl(n_e,"focusFirst");function i_e(e){const t=_Q(e),n=AF(t,e),i=AF(t.reverse(),e);return[n,i]}Nl(i_e,"getTabbableEdges");function _Q(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Nl(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}Nl(_Q,"getTabbableCandidates");function AF(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(n?!i.checkVisibility({checkVisibilityCSS:!0}):r_e(i,{upTo:t})))return i}Nl(AF,"findVisible");function r_e(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}Nl(r_e,"isHidden");function s_e(e){return e instanceof HTMLInputElement&&"select"in e}Nl(s_e,"isSelectableInput");function kh(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&s_e(e)&&t&&e.select()}}Nl(kh,"focus");var kZ=o_e();function o_e(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=_F(e,t),e.unshift(t)},remove(t){var n;e=_F(e,t),(n=e[0])==null||n.resume()}}}Nl(o_e,"createFocusScopesStack");function _F(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}Nl(_F,"arrayRemove");function a_e(e){return e.filter(t=>t.tagName!=="A")}Nl(a_e,"removeLinks");var Kst=Object.defineProperty,Gst=(e,t)=>Kst(e,"name",{value:t,configurable:!0}),jQ=p.forwardRef(Gst(function(t,n){var c;const{container:i,...r}=t,[s,a]=p.useState(!1);qu(()=>a(!0),[]);const l=i||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?si.createPortal(o.jsx(Fr.div,{...r,ref:n}),l):null},"Portal")),Xst=Object.defineProperty,NQ=(e,t)=>Xst(e,"name",{value:t,configurable:!0}),F2=0,nf=null;function Yst(e){return xP(),e.children}NQ(Yst,"FocusGuards");function xP(){p.useEffect(()=>{nf||(nf={start:jF(),end:jF()});const{start:e,end:t}=nf;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),F2++,()=>{F2===1&&(nf==null||nf.start.remove(),nf==null||nf.end.remove(),nf=null),F2=Math.max(0,F2-1)}},[])}NQ(xP,"useFocusGuards");function jF(){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}NQ(jF,"createFocusGuard");var mf=function(){return mf=Object.assign||function(t){for(var n,i=1,r=arguments.length;i"u")return pot;var t=mot(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])}},bot=d_e(),cx="data-scroll-locked",yot=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(Jst,` { + */const Ta=wn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),lZ=Object.freeze({totalTokenCount:0,promptTokenCount:0,candidatesTokenCount:0,thoughtsTokenCount:0,cachedContentTokenCount:0}),q_=Object.freeze({modelName:"",current:lZ,cumulative:lZ}),Ort={totalTokenCount:"total_token_count",promptTokenCount:"prompt_token_count",candidatesTokenCount:"candidates_token_count",thoughtsTokenCount:"thoughts_token_count",cachedContentTokenCount:"cached_content_token_count"},krt=24,Srt=64,Ert=16;function PA(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 Crt(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=PA(t),s=n.reduce((d,f)=>d+Srt+PA(f),0),a=i.reduce((d,f)=>d+Ert+PA(f.name)+PA(f.description??""),0);return krt+r+s+a}function Trt({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 Art(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 lO(e,t){const n=e,i=n[t]??n[Ort[t]];return typeof i=="number"&&Number.isFinite(i)&&i>0?Math.round(i):0}function _rt(e){const t=lO(e,"promptTokenCount"),n=lO(e,"candidatesTokenCount"),i=lO(e,"thoughtsTokenCount");return{totalTokenCount:lO(e,"totalTokenCount")||t+n+i,promptTokenCount:t,candidatesTokenCount:n,thoughtsTokenCount:i,cachedContentTokenCount:lO(e,"cachedContentTokenCount")}}function jrt(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 x2e(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=_rt(s);return a.totalTokenCount===0?r===e.modelName?e:{...e,modelName:r}:{modelName:r,current:a,cumulative:jrt(e.cumulative,a)}}function cZ(e){return e.reduce((t,n)=>x2e(t,n),q_)}function uZ(e){return e.blocks.flatMap(t=>t.kind==="tool"?[{name:t.name,args:t.args,response:t.response,done:t.done}]:[])}function Nrt(e){const t=e.attributes;return String(t["invocation.id"]??t["gen_ai.invocation.id"]??t["gcp.vertex.agent.invocation_id"]??"")}function Rrt(e,t){if(!t)return e;const n=new Set(e.filter(r=>Nrt(r)===t).map(r=>r.trace_id)),i=e.filter(r=>n.has(r.trace_id));return i.length>0?i:e}function Oy(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Am(e){return typeof e=="string"?e:""}function w2e(e,t){return e==="pending"||e==="running"||e==="completed"||e==="failed"?e:t}function Irt(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=Oy(t)??{};return Oy(n.result)??n}function Prt(e){var n;const t=(n=Oy(e))==null?void 0:n.branches;return Array.isArray(t)?t.map(i=>{var r;return Am((r=Oy(i))==null?void 0:r.label)}):[]}function O2e(e,t,n){const i=Prt(e),r=Irt(t),s=Array.isArray(r.branches)?r.branches:[],a=n==="running"?"running":"pending";return{branches:[0,1].map(c=>{const u=Oy(s[c])??{};return{label:Am(u.label)||i[c]||`方向 ${c+1}`,content:Am(u.content),status:w2e(u.status,a),error:Am(u.error)}})}}function Drt(e){const t=Oy(e),n=Oy(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:Am(n.requestId),branchIndex:n.branchIndex,label:Am(n.label),delta:Am(n.delta),status:w2e(n.status,"running"),error:Am(n.error)||void 0}}function Mrt(e,t,n){return{branches:O2e(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 Pa(e,t){return mn.t(`blocks.codexProgress.${e}`,{ns:"conversation",...t})}const k2e=28e4;function dZ(e){try{return JSON.stringify(e).length}catch{return k2e}}function Lrt(e){const t=e.slice(-200);let n=t.reduce((i,r)=>i+dZ(r),0);for(;t.length>1&&n>k2e;)n-=dZ(t.shift());return t}function Kc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Hi(e){return typeof e=="string"?e:""}function vQ(e,t=""){const n=Hi(e).toLowerCase();return t.endsWith(".failed")||["failed","error","declined","cancelled"].includes(n)?"failed":t.endsWith(".completed")||["completed","done","success"].includes(n)?"completed":"running"}function S2e(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 E2e(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=Hi(e.command),n=Hi(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 Ob(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 C2e(e){const t=Hi(e.id||e.itemId||e.item_id),n=Hi(e.kind);if(!t||!n)return null;const i=vQ(e.status),r=Hi(e.text||e.detail||e.delta),s=!Hi(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:Hi(e.title)||Pa("planTitle"),summary:r||void 0,items:a.flatMap(l=>{const c=Kc(l),u=Hi(c==null?void 0:c.text);if(!u)return[];const d=Hi(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=Pa(n==="file_change"||n==="fileChange"?"fallback.fileChange":n==="approval"?"fallback.approval":n==="status"?"fallback.status":"fallback.command"),l=E2e(e),c=S2e(e)??(n==="status"&&r||void 0);return{id:t,block:Ob(Hi(e.name||e.title)||a,t,i,l,c)}}return null}function T2e(e){const t=Hi(e.type),n=Kc(e.item),i=Hi(n==null?void 0:n.type),r=Hi((n==null?void 0:n.id)||e.id)||(t==="turn.failed"?"turn":"");if(!r)return null;const s=vQ(n==null?void 0:n.status,t);if(i==="reasoning"||i==="agent_message"){const a=Hi(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=Kc(c),d=Hi(u==null?void 0:u.text);if(!d)return[];const f=Hi(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:Pa("planTitle"),summary:Pa("planSummary",{completed:l.filter(c=>c.status==="completed").length,total:l.length}),items:l,done:s!=="running"}}:null}if(i==="command_execution"){const a=Pa(`command.${s}`);return{id:r,block:Ob(a,r,s,E2e(n??{}),S2e(n??{}))}}if(i==="file_change"){const a=Array.isArray(n==null?void 0:n.changes)?n.changes:[],l=a.length?Pa("projectFiles",{count:a.length}):Pa("projectFile"),c=Pa(`fileChange.${s}`,{subject:l});return{id:r,block:Ob(c,r,s,a.length?{changes:a}:void 0)}}if(i==="mcp_tool_call"){const a=[Hi(n==null?void 0:n.server),Hi(n==null?void 0:n.tool)].filter(Boolean).join("/")||Pa("externalTool"),l=Pa(`mcp.${s}`,{tool:a}),c=Kc(n==null?void 0:n.error),u=(n==null?void 0:n.result)!==void 0?n.result:Hi(c==null?void 0:c.message)||void 0;return{id:r,block:Ob(l,r,s,n==null?void 0:n.arguments,u)}}if(i==="collab_tool_call"){const a=Hi(n==null?void 0:n.tool),l=["spawn_agent","send_input","wait","close_agent"].includes(a)?a:"default",c=Pa(`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:Ob(c,r,s,Object.keys(u).length?u:void 0,n==null?void 0:n.agents_states)}}if(i==="web_search"){const a=Pa(`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:Ob(a,r,s,Object.keys(l).length?l:void 0)}}if(i==="error"||t==="error"||t==="turn.failed"){const a=Kc(e.error),l=Hi((n==null?void 0:n.message)||e.message||(a==null?void 0:a.message))||Pa("errorDetail");return{id:r,block:Ob(Pa("errorTitle"),r,"failed",void 0,l)}}return null}function $rt(e){const t=Kc(e),n=Kc(t==null?void 0:t.veadkStudioToolProgress);if(!n||n.kind!=="codex")return null;const i=Hi(n.toolName),r=Hi(n.requestId);if(!i||!r)return null;const s=Kc(n.event??n.activity);if(!s)return null;const a=Kc(s.item)||Hi(s.type)?T2e(s):C2e(s);if(!a)return null;const l=Hi(n.title||n.label),c=Hi(s.agentSessionId??s.agent_session_id),u=Hi(s.sandboxSessionId??s.sandbox_session_id),d=Hi(s.threadId??s.thread_id),f=vQ(s.status,Hi(s.type)),m=Hi(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}:{},...m?{terminalStatus:m}:{},event:a}}function Frt(e,t){const n=Kc(t),i=Kc((n==null?void 0:n.codexActivity)??(n==null?void 0:n.codex_activity));if(!i)return e;const r=Hi(i.title)||(e==null?void 0:e.title)||"Codex Sandbox",s=Hi(i.agentSessionId??i.agent_session_id)||(e==null?void 0:e.agentSessionId),a=Hi(i.sandboxSessionId??i.sandbox_session_id)||(e==null?void 0:e.sandboxSessionId),l=Hi(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=Kc(d);if(!f)continue;const h=Kc(f.item)||Hi(f.type)?T2e(f):C2e(f);h&&(h.finalAnswer||(c=mF(c,{title:r,...s?{agentSessionId:s}:{},...a?{sandboxSessionId:a}:{},...l?{threadId:l}:{},event:h})))}return c}function mF(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:Lrt(n)}}const A2e="send_a2ui_json_to_client",gF="validated_a2ui_json",bF="adk_request_credential",fZ="transfer_to_agent";function Brt(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 yF(){return{blocks:[],liveStart:0,pendingCodexProgress:[]}}function hZ(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=mF(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=mF(i.codexActivity,t),i.status=t.terminalStatus??"running",t.terminalStatus&&(i.done=!0),"applied")}return"unmatched"}function Urt(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 pZ(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 vF=e=>e.functionCall??e.function_call,JS=e=>e.functionResponse??e.function_response;function Qrt(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function zrt(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function vP(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:zrt(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 eE(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 Vrt=new Set(["llm","sequential","parallel","loop","a2a"]);function Hrt(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"&&Vrt.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 qrt(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 Wrt(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 oL(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 DA(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function _2e(e,t){var d,f,h,m,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=Drt(v.partMetadata??v.part_metadata);return y?[y]:[]}),l=s.flatMap(v=>{const y=$rt(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 w=n[y];if(!(w.kind!=="tool"||w.done||w.name!==v.toolName||v.requestId&&w.callId&&w.callId!==v.requestId)){w.response=Mrt(w.args,w.response,v),w.status="running";break}}for(const v of l)hZ(n,v)==="unmatched"&&(r=[...r,v].slice(-64));return{blocks:n,liveStart:i,pendingCodexProgress:r}}const c=s.some(v=>vF(v)||JS(v));if(t.partial&&!c){for(const v of s){const y=eE(v);typeof y=="string"&&y&&oL(n,v.thought?"thinking":"text",y)}return{blocks:n,liveStart:i,pendingCodexProgress:r}}n.length=i;for(const v of s){const y=vF(v),w=JS(v),x=vP([v]),O=eE(v);if(typeof O=="string"&&O)oL(n,v.thought?"thinking":"text",O);else if(x.length)DA(n),qrt(n,x);else if(y)if(DA(n),y.name===fZ){const S=Qrt(y.args)||((f=t.actions)==null?void 0:f.transferToAgent)||((h=t.actions)==null?void 0:h.transfer_to_agent)||mn.t("app:common.unknownAgent");n.push({kind:"agent-transfer",agentName:S,done:!1})}else if(y.name===bF){const S=y.args??{},k=S.authConfig??S.auth_config??S,E=String(S.functionCallId??S.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;n.push({kind:"auth",callId:y.id??"",label:E,authUri:Brt(k),authConfig:k,done:!1})}else{const S={kind:"tool",name:y.name??"",callId:y.id,args:y.args,done:!1};if(n.push(S),S.callId){const k=[];for(const C of r)C.toolName===S.name&&C.requestId===S.callId?hZ(n,C):k.push(C);r=k}}else if(w){if(DA(n),w.name===fZ)for(let S=n.length-1;S>=0;S--){const k=n[S];if(k.kind==="agent-transfer"&&!k.done){k.done=!0;break}}if(w.name===bF)for(let S=n.length-1;S>=0;S--){const k=n[S];if(k.kind==="auth"&&!k.done){k.done=!0;break}}for(let S=n.length-1;S>=0;S--){const k=n[S],C=k.kind==="tool"&&k.name==="delegate_to_codex_sandbox";if(k.kind==="tool"&&(!k.done||C)&&k.name===w.name&&(!w.id||!k.callId||k.callId===w.id)){const E=C?pZ(k.response):"";if(k.done=!0,k.response=w.response,C){k.codexActivity=Frt(k.codexActivity,w.response),k.status=Urt(w.response);const R=pZ(w.response);R&&R!==E&&oL(n,"text",R)}break}}if(w.name===A2e){const S=((m=w.response)==null?void 0:m[gF])??[];if(S.length){const k=n[n.length-1];k&&k.kind==="a2ui"?k.messages.push(...S):n.push({kind:"a2ui",messages:S})}}}}const u=((g=t.actions)==null?void 0:g.artifactDelta)??((b=t.actions)==null?void 0:b.artifact_delta);return u&&Wrt(n,Object.entries(u).map(([v,y])=>({filename:v,version:y}))),DA(n),i=n.length,{blocks:n,liveStart:i,pendingCodexProgress:r}}function Krt(e,t){var u,d,f,h,m,g;if(e.partial===!0)return!1;const n=((u=e.content)==null?void 0:u.parts)??[],i=n.some(b=>{const v=eE(b);return!b.thought&&typeof v=="string"&&v.trim().length>0||vP([b]).length>0}),r=n.some(b=>{var y;const v=JS(b);return(v==null?void 0:v.name)===A2e&&Array.isArray((y=v.response)==null?void 0:y[gF])&&v.response[gF].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)??((m=e.actions)==null?void 0:m.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 Grt(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=>!!(eE(s)||vP([s]).length>0||vF(s)||JS(s)))}function xF(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=yF();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 m=i.get(h);if(!m&&r){const y=i.get(r);y&&(!y.meta.author||y.meta.author===d)&&(i.delete(r),r=void 0,m=y)}if(!m&&!Grt(u))return{turn:{role:"assistant",blocks:[]},completed:!1,ignored:!0};if(!m){const y=`${e}-${n++}`;m={acc:yF(),localId:y,meta:{author:d||void 0,invocationId:f||void 0}}}m.acc=_2e(m.acc,u);const g=u.usageMetadata??u.usage_metadata,b=Krt(u,m.acc.blocks);m.meta={...m.meta,author:d||m.meta.author,localId:m.localId,streaming:!b,tokens:(g==null?void 0:g.totalTokenCount)||m.meta.tokens,ts:u.timestamp||m.meta.ts,invocationId:f||m.meta.invocationId,eventId:b&&u.id?u.id:m.meta.eventId};const v={role:"assistant",blocks:m.acc.blocks,meta:m.meta};return b?(i.delete(h),r=void 0):i.set(h,m),{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 Mb(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 Xrt(e,t={}){var r;let n=[],i=xF("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 m;return((m=JS(h))==null?void 0:m.name)===bF})){for(let h=n.length-1;h>=0;h--)if(n[h].role==="assistant"){for(let m=n[h].blocks.length-1;m>=0;m--){const g=n[h].blocks[m];if(g.kind==="auth"){g.done=!0;break}}break}}const c=l.map(eE).filter(h=>!!h).join(""),u=vP(l),d=Hrt(l);if(!c&&!u.length&&!d)continue;for(const h of i.finish())n=Mb(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}})}else{const l=i.project(s);l.ignored||(n=Mb(n,l.turn))}for(const s of i.finish())n=Mb(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 xP(e,t=mn.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 j2e(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=j2e(i,t,e);if(r)return r}}function Yrt(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=j2e(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 Zrt(e,t){const n=[];return e.forEach((i,r)=>{const s=Yrt(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 Jrt(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"9",cy:"8",r:"3.25"}),o.jsx("path",{d:"M2.75 20v-1.5a6.25 6.25 0 0 1 12.5 0V20M16 5.25a3.25 3.25 0 0 1 0 6.5M18 14a5.5 5.5 0 0 1 3.25 5V20"})]})}function N2e(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=p.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},xQ=e=>{const t=est(e),n=p.Children.count(t);return p.Children.map(t,i=>{if(typeof i=="string"&&i.trim())return n<=1?i:o.jsx("span",{children:i});if(p.isValidElement(i)){const r=i,{children:s,...a}=r.props;return s!=null?p.cloneElement(r,a,xQ(s)):r}return i})},tst="_Badge_1viyg_1",nst={Badge:tst},zo=({children:e,className:t,variant:n="soft",color:i="secondary",size:r="sm",pill:s,...a})=>o.jsx("div",{className:ji(nst.Badge,t),"data-color":i,"data-size":r,"data-pill":s?"":void 0,"data-variant":n,...a,children:xQ(e)});var ist=typeof wm=="object"&&wm&&wm.Object===Object&&wm,rst=typeof self=="object"&&self&&self.Object===Object&&self;ist||rst||Function("return this")();var sst=typeof window<"u"?p.useLayoutEffect:p.useEffect;function ost(){const e=p.useRef(!1);return p.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),p.useCallback(()=>e.current,[])}var mZ={width:void 0,height:void 0};function R2e(e){const{ref:t,box:n="content-box"}=e,[{width:i,height:r},s]=p.useState(mZ),a=ost(),l=p.useRef({...mZ}),c=p.useRef(void 0);return c.current=e.onResize,p.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=gZ(d,f,"inlineSize"),m=gZ(d,f,"blockSize");if(l.current.width!==h||l.current.height!==m){const b={width:h,height:m};l.current.width=h,l.current.height=m,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 gZ(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 wQ(e,t){const n=p.useRef(e);sst(()=>{n.current=e},[e]),p.useEffect(()=>{if(!t&&t!==0)return;const i=setTimeout(()=>{n.current()},t);return()=>{clearTimeout(i)}},[t])}const ast={DEV:!1,MODE:"production"},lx=typeof import.meta<"u"?ast:void 0,lst=!!(lx!=null&&lx.DEV),cst=typeof navigator<"u"&&/(jsdom|happy-dom)/i.test(navigator.userAgent)||typeof globalThis.happyDOM=="object",I2e=(lx==null?void 0:lx.MODE)==="test"||cst,ust=typeof window<"u",P2e=typeof document<"u",dst=ust&&P2e,OQ=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())},MN=(e,t)=>{const n=()=>{const a=setTimeout(e);return()=>{clearTimeout(a)}};if(!dst||typeof window.requestAnimationFrame!="function"||P2e&&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)}},Gy=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},{}),aL=e=>typeof e=="number"?`${e}deg`:e,lL=e=>String(e),MA=e=>`${e}ms`,cL=({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(${aL(i)})`,r==null?null:`skewX(${aL(r)})`,s==null?null:`skewY(${aL(s)})`].filter(Boolean);return a.length?a.join(" "):"none"},uL=({blur:e}={})=>{const t=[e==null?null:`blur(${e}px)`].filter(Boolean);return t.length?t.join(" "):"none"},Kh=e=>{e.preventDefault()},D2e=e=>e.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]'),fst="_LoadingIndicator_7yl6f_1",hst={LoadingIndicator:fst},NC=({className:e,size:t,strokeWidth:n,style:i,...r})=>o.jsx("div",{...r,className:ji(hst.LoadingIndicator,e),style:i||Gy({"indicator-size":t,"indicator-stroke":n})});var pst=Object.defineProperty,kQ=(e,t)=>pst(e,"name",{value:t,configurable:!0});function wF(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}kQ(wF,"setRef");function M2e(...e){return t=>{let n=!1;const i=e.map(r=>{const s=wF(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;rmst(e,"name",{value:t,configurable:!0});function cp(e){const t=p.forwardRef((n,i)=>{let{children:r,...s}=n,a=null,l=!1;const c=[];OF(r)&&typeof LA=="function"&&(r=LA(r._payload)),p.Children.forEach(r,h=>{var m;if(Q2e(h)){l=!0;const g=h;let b="child"in g.props?g.props.child:g.props.children;OF(b)&&typeof LA=="function"&&(b=LA(b._payload)),a=gst(g,b),c.push((m=a==null?void 0:a.props)==null?void 0:m.children)}else c.push(h)}),a?a=p.cloneElement(a,void 0,c):!l&&p.Children.count(r)===1&&p.isValidElement(r)&&(a=r);const u=a?U2e(a):void 0,d=yr(i,u);if(!a){if(r||r===0)throw new Error(l?vst(e):yst(e));return r}const f=B2e(s,a.props??{});return a.type!==p.Fragment&&(f.ref=i?d:u),p.cloneElement(a,f)});return t.displayName=`${e}.Slot`,t}Qd(cp,"createSlot");var L2e=cp("Slot"),$2e=Symbol.for("radix.slottable");function F2e(e){const t=Qd(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=$2e,t}Qd(F2e,"createSlottable");var gst=Qd((e,t)=>{if("child"in e.props){const n=e.props.child;return p.isValidElement(n)?p.cloneElement(n,void 0,e.props.children(n.props.children)):null}return p.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function B2e(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}}Qd(B2e,"mergeProps");function U2e(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)}Qd(U2e,"getElementRef");function Q2e(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$2e}Qd(Q2e,"isSlottable");var bst=Symbol.for("react.lazy");function OF(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===bst&&"_payload"in e&&z2e(e._payload)}Qd(OF,"isLazyComponent");function z2e(e){return typeof e=="object"&&e!==null&&"then"in e}Qd(z2e,"isPromiseLike");var yst=Qd(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),vst=Qd(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),LA=By[" use ".trim().toString()],xst=Object.defineProperty,wst=(e,t)=>xst(e,"name",{value:t,configurable:!0}),Ost=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Fr=Ost.reduce((e,t)=>{const n=cp(`Primitive.${t}`),i=p.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 SQ(e,t){e&&ri.flushSync(()=>e.dispatchEvent(t))}wst(SQ,"dispatchDiscreteCustomEvent");var kst=Object.defineProperty,Sst=(e,t)=>kst(e,"name",{value:t,configurable:!0}),Est=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"}),Cst=p.forwardRef(Sst(function(t,n){return o.jsx(Fr.span,{...t,ref:n,style:{...Est,...t.style}})},"VisuallyHidden")),Tst=Cst,Ast=Object.defineProperty,Ru=(e,t)=>Ast(e,"name",{value:t,configurable:!0});function _st(e,t){const n=p.createContext(t);n.displayName=e+"Context";const i=Ru(s=>{const{children:a,...l}=s,c=p.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=p.useContext(n);if(c)return c;if(t!==void 0)return t;if(!l)throw new Error(`\`${s}\` must be used within \`${e}\``)}return Ru(r,"useContext"),[i,r]}Ru(_st,"createContext");function bc(e,t=[]){let n=[];function i(s,a){const l=p.createContext(a);l.displayName=s+"Context";const c=n.length;n=[...n,a];const u=Ru(f=>{var y;const{scope:h,children:m,...g}=f,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=p.useMemo(()=>g,Object.values(g));return o.jsx(b.Provider,{value:v,children:m})},"Provider");u.displayName=s+"Provider";function d(f,h,m={}){var y;const{optional:g=!1}=m,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=p.useContext(b);if(v)return v;if(a!==void 0)return a;if(!g)throw new Error(`\`${f}\` must be used within \`${s}\``)}return Ru(d,"useContext"),[u,d]}Ru(i,"createContext");const r=Ru(()=>{const s=n.map(a=>p.createContext(a));return Ru(function(l){const c=(l==null?void 0:l[e])||s;return p.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])},"useScope")},"createScope");return r.scopeName=e,[i,V2e(r,...t)]}Ru(bc,"createContextScope");function V2e(...e){const t=e[0];if(e.length===1)return t;const n=Ru(()=>{const i=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return Ru(function(s){const a=i.reduce((l,{useScope:c,scopeName:u})=>{const f=c(s)[`__scope${u}`];return{...l,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}Ru(V2e,"composeContextScopes");var jst=Object.defineProperty,xa=(e,t)=>jst(e,"name",{value:t,configurable:!0});function EQ(e){const t=e+"CollectionProvider",[n,i]=bc(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=xa(b=>{const{scope:v,children:y}=b,w=p.useRef(null),x=p.useRef(new Map).current;return o.jsx(r,{scope:v,itemMap:x,collectionRef:w,children:y})},"CollectionProvider");a.displayName=t;const l=e+"CollectionSlot",c=cp(l),u=p.forwardRef((b,v)=>{const{scope:y,children:w}=b,x=s(l,y),O=yr(v,x.collectionRef);return o.jsx(c,{ref:O,children:w})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=cp(d),m=p.forwardRef((b,v)=>{const{scope:y,children:w,...x}=b,O=p.useRef(null),S=yr(v,O),k=s(d,y);return p.useEffect(()=>(k.itemMap.set(O,{ref:O,...x}),()=>void k.itemMap.delete(O))),o.jsx(h,{[f]:"",ref:S,children:w})});m.displayName=d;function g(b){const v=s(e+"CollectionConsumer",b);return p.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const x=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((k,C)=>x.indexOf(k.ref.current)-x.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return xa(g,"useCollection"),[{Provider:a,Slot:u,ItemSlot:m},g,i]}xa(EQ,"createCollection");var bZ=new WeakMap,Mo,Bc,dL=(Bc=class extends Map{constructor(n){super(n);WW(this,Mo);FM(this,Mo,[...super.keys()]),bZ.set(this,!0)}set(n,i){return bZ.get(this)&&(this.has(n)?il(this,Mo)[il(this,Mo).indexOf(n)]=n:il(this,Mo).push(n)),super.set(n,i),this}insert(n,i,r){const s=this.has(i),a=il(this,Mo).length,l=CQ(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=[...il(this,Mo)];let h,m=!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 Bc(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 Bc(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 Bc(i)}toReversed(){const n=new Bc;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 Bc(i)}slice(n,i){const r=new Bc;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}},Mo=new WeakMap,xa(Bc,"OrderedDict"),Bc);function W_(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=H2e(e,t);return n===-1?void 0:e[n]}xa(W_,"at");function H2e(e,t){const n=e.length,i=CQ(t),r=i>=0?i:n+i;return r<0||r>=n?-1:r}xa(H2e,"toSafeIndex");function CQ(e){return e!==e||e===0?0:Math.trunc(e)}xa(CQ,"toSafeInteger");function Nst(e){const t=e+"CollectionProvider",[n,i]=bc(t),[r,s]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new dL,setItemMap:xa(()=>{},"setItemMap")}),a=xa(({state:x,...O})=>x?o.jsx(c,{...O,state:x}):o.jsx(l,{...O}),"CollectionProvider");a.displayName=t;const l=xa(x=>{const O=v();return o.jsx(c,{...x,state:O})},"CollectionInit");l.displayName=t+"Init";const c=xa(x=>{const{scope:O,children:S,state:k}=x,C=p.useRef(null),[E,R]=p.useState(null),A=yr(C,R),[N,T]=k;return p.useEffect(()=>{if(!E)return;const j=K2e(()=>{});return j.observe(E,{childList:!0,subtree:!0}),()=>{j.disconnect()}},[E]),o.jsx(r,{scope:O,itemMap:N,setItemMap:T,collectionRef:A,collectionRefObject:C,collectionElement:E,children:S})},"CollectionProviderImpl");c.displayName=t+"Impl";const u=e+"CollectionSlot",d=cp(u),f=p.forwardRef((x,O)=>{const{scope:S,children:k}=x,C=s(u,S),E=yr(O,C.collectionRef);return o.jsx(d,{ref:E,children:k})});f.displayName=u;const h=e+"CollectionItemSlot",m="data-radix-collection-item",g=cp(h),b=p.forwardRef((x,O)=>{const{scope:S,children:k,...C}=x,E=p.useRef(null),[R,A]=p.useState(null),N=yr(O,E,A),T=s(h,S),{setItemMap:j}=T,_=p.useRef(C);q2e(_.current,C)||(_.current=C);const I=_.current;return p.useEffect(()=>{const D=I;return j(P=>R?P.has(R)?P.set(R,{...D,element:R}).toSorted(kF):(P.set(R,{...D,element:R}),P.toSorted(kF)):P),()=>{j(P=>!R||!P.has(R)?P:(P.delete(R),new dL(P)))}},[R,I,j]),o.jsx(g,{[m]:"",ref:N,children:k})});b.displayName=h;function v(){return p.useState(new dL)}xa(v,"useInitCollection");function y(x){const{itemMap:O}=s(e+"CollectionConsumer",x);return O}return xa(y,"useCollection"),[{Provider:a,Slot:f,ItemSlot:b},{createCollectionScope:i,useCollection:y,useInitCollection:v}]}xa(Nst,"createCollection");function q2e(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}xa(q2e,"shallowEqual");function W2e(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}xa(W2e,"isElementPreceding");function kF(e,t){return!e[1].element||!t[1].element?0:W2e(e[1].element,t[1].element)?-1:1}xa(kF,"sortByDocumentPosition");function K2e(e){return new MutationObserver(n=>{for(const i of n)if(i.type==="childList"){e();return}})}xa(K2e,"getChildListObserver");var Rst=Object.defineProperty,qw=(e,t)=>Rst(e,"name",{value:t,configurable:!0}),G2e=!!(typeof window<"u"&&window.document&&window.document.createElement);function _n(e,t,{checkForDefaultPrevented:n=!0}={}){return qw(function(r){if(e==null||e(r),n===!1||!r||!r.defaultPrevented)return t==null?void 0:t(r)},"handleEvent")}qw(_n,"composeEventHandlers");function Ist(e){var t;if(!G2e)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}qw(Ist,"getOwnerWindow");function SF(e){if(!G2e)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}qw(SF,"getOwnerDocument");function X2e(e,t=!1){const{activeElement:n}=SF(e);if(!(n!=null&&n.nodeName))return null;if(Y2e(n)&&n.contentDocument)return X2e(n.contentDocument.body,t);if(t){const i=n.getAttribute("aria-activedescendant");if(i){const r=SF(n).getElementById(i);if(r)return r}}return n}qw(X2e,"getActiveElement");function Y2e(e){return e.tagName==="IFRAME"}qw(Y2e,"isFrame");var Hu=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},Pst=Object.defineProperty,Dst=(e,t)=>Pst(e,"name",{value:t,configurable:!0}),yZ=By[" useEffectEvent ".trim().toString()],vZ=By[" useInsertionEffect ".trim().toString()];function Z2e(e){if(typeof yZ=="function")return yZ(e);const t=p.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof vZ=="function"?vZ(()=>{t.current=e}):Hu(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}Dst(Z2e,"useEffectEvent");var Mst=Object.defineProperty,RC=(e,t)=>Mst(e,"name",{value:t,configurable:!0}),Lst=By[" useInsertionEffect ".trim().toString()]||Hu;function ed({prop:e,defaultProp:t,onChange:n=RC(()=>{},"onChange"),caller:i}){const[r,s,a]=J2e({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:r,u=p.useCallback(d=>{var f;if(l){const h=e_e(d)?d(e):d;h!==e&&((f=a.current)==null||f.call(a,h))}else s(d)},[l,e,s,a]);return[c,u]}RC(ed,"useControllableState");function J2e({defaultProp:e,onChange:t}){const[n,i]=p.useState(e),r=p.useRef(n),s=p.useRef(t);return Lst(()=>{s.current=t},[t]),p.useEffect(()=>{var a;r.current!==n&&((a=s.current)==null||a.call(s,n),r.current=n)},[n,r]),[n,i,s]}RC(J2e,"useUncontrolledState");function e_e(e){return typeof e=="function"}RC(e_e,"isFunction");var xZ=Symbol("RADIX:SYNC_STATE");function $st(e,t,n,i){const{prop:r,defaultProp:s,onChange:a,caller:l}=t,c=r!==void 0,u=Z2e(a),d=[{...n,state:s}];i&&d.push(i);const[f,h]=p.useReducer((v,y)=>{if(y.type===xZ)return{...v,state:y.state};const w=e(v,y);return c&&!Object.is(w.state,v.state)&&u(w.state),w},...d),m=f.state,g=p.useRef(m);p.useEffect(()=>{g.current!==m&&(g.current=m,c||u(m))},[m,g,c]);const b=p.useMemo(()=>r!==void 0?{...f,state:r}:f,[f,r]);return p.useEffect(()=>{c&&!Object.is(r,f.state)&&h({type:xZ,state:r})},[r,f.state,c]),[b,h]}RC($st,"useControllableStateReducer");var Fst=Object.defineProperty,up=(e,t)=>Fst(e,"name",{value:t,configurable:!0});function t_e(e,t){return p.useReducer((n,i)=>t[n][i]??n,e)}up(t_e,"useStateMachine");var qf=up(e=>{const{present:t,children:n}=e,i=n_e(t),r=typeof n=="function"?n({present:i.isPresent}):p.Children.only(n),s=i_e(i.ref,r_e(r));return typeof n=="function"||i.isPresent?p.cloneElement(r,{ref:s}):null},"Presence");function n_e(e){const[t,n]=p.useState(),i=p.useRef(null),r=p.useRef(e),s=p.useRef("none"),a=p.useRef(void 0),l=e?"mounted":"unmounted",[c,u]=t_e(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{c==="mounted"?(s.current=a.current??lv(i.current),a.current=void 0):s.current="none"},[c]),Hu(()=>{const d=i.current,f=r.current;if(f!==e){const m=s.current,g=lv(d);e?(a.current=g,u("MOUNT")):g==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,u]),Hu(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=up(g=>{const v=lv(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"),m=up(g=>{g.target===t&&(s.current=lv(i.current))},"handleAnimationStart");return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:p.useCallback(d=>{if(d){const f=getComputedStyle(d);i.current=f,a.current=lv(f)}else i.current=null;n(d)},[])}}up(n_e,"usePresence");function EF(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}up(EF,"setRef");function i_e(...e){const t=p.useRef(e);return t.current=e,p.useCallback(n=>{const i=t.current;let r=!1;const s=i.map(a=>{const l=EF(a,n);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let a=0;aBst(e,"name",{value:t,configurable:!0}),Qst=By[" useId ".trim().toString()]||(()=>{}),zst=0;function cg(e){const[t,n]=p.useState(Qst());return Hu(()=>{e||n(i=>i??String(zst++))},[e]),e||(t?`radix-${t}`:"")}Ust(cg,"useId");var Vst=Object.defineProperty,Hst=(e,t)=>Vst(e,"name",{value:t,configurable:!0}),qst=p.createContext(void 0);function IC(e){const t=p.useContext(qst);return e||t||"ltr"}Hst(IC,"useDirection");var Wst=Object.defineProperty,Kst=(e,t)=>Wst(e,"name",{value:t,configurable:!0});function Md(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var i;return(i=t.current)==null?void 0:i.call(t,...n)},[])}Kst(Md,"useCallbackRef");var Gst=Object.defineProperty,ya=(e,t)=>Gst(e,"name",{value:t,configurable:!0}),CF="dismissableLayer.update",Xst="dismissableLayer.pointerDownOutside",Yst="dismissableLayer.focusOutside",wZ,s_e=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),TQ=p.forwardRef(ya(function(t,n){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:l,onInteractOutside:c,onDismiss:u,...d}=t,f=p.useContext(s_e),[h,m]=p.useState(null),g=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=p.useState({}),v=yr(n,m),y=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),x=w?y.indexOf(w):-1,O=h?y.indexOf(h):-1,S=f.layersWithOutsidePointerEventsDisabled.size>0,k=O>=x,C=p.useRef(!1),E=o_e(T=>{a==null||a(T),c==null||c(T),T.defaultPrevented||u==null||u()},{ownerDocument:g,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(T=>{if(!(T instanceof Node))return!1;const j=[...f.branches].some(_=>_.contains(T));return k&&!j},[f.branches,k])}),R=a_e(T=>{if(r&&C.current)return;const j=T.target;[...f.branches].some(I=>I.contains(j))||(l==null||l(T),c==null||c(T),T.defaultPrevented||u==null||u())},g),A=h?O===y.length-1:!1,N=Md(T=>{T.key==="Escape"&&(s==null||s(T),!T.defaultPrevented&&u&&(T.preventDefault(),u()))});return p.useEffect(()=>{if(A)return g.addEventListener("keydown",N,{capture:!0}),()=>g.removeEventListener("keydown",N,{capture:!0})},[g,A,N]),p.useEffect(()=>{if(h)return i&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(wZ=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),TF(),()=>{i&&(f.layersWithOutsidePointerEventsDisabled.delete(h),f.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=wZ))}},[h,g,i,f]),p.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),TF())},[h,f]),p.useEffect(()=>{const T=ya(()=>b({}),"handleUpdate");return document.addEventListener(CF,T),()=>document.removeEventListener(CF,T)},[]),o.jsx(Fr.div,{...d,ref:v,style:{pointerEvents:S?k?"auto":"none":void 0,...t.style},onFocusCapture:_n(t.onFocusCapture,R.onFocusCapture),onBlurCapture:_n(t.onBlurCapture,R.onBlurCapture),onPointerDownCapture:_n(t.onPointerDownCapture,E.onPointerDownCapture)})},"DismissableLayer"));function Zst(){const e=p.useContext(s_e),[t,n]=p.useState(null);return p.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}ya(Zst,"useDismissableLayerSurface");var Jst=ya(()=>!0,"IS_TRUE");function o_e(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:s,shouldHandlePointerDownOutside:a=Jst}=t,l=Md(e),c=p.useRef(!1),u=p.useRef(!1),d=p.useRef(new Map),f=p.useRef(()=>{});return p.useEffect(()=>{function h(){u.current=!1,r.current=!1,d.current.clear()}ya(h,"resetOutsideInteraction");function m(){return Array.from(d.current.values()).some(Boolean)}ya(m,"isOutsideInteractionIntercepted");function g(x){if(!u.current)return;const O=x.target;O instanceof Node&&[...s].some(k=>k.contains(O))||d.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{u.current&&f.current()},0)}ya(g,"handleInteractionCapture");function b(x){u.current&&d.current.set(x.type,!1)}ya(b,"handleInteractionBubble");const v=ya(x=>{if(x.target&&!c.current){let O=function(){n.removeEventListener("click",f.current);const k=m();h(),k||AQ(Xst,l,S,{discrete:!0})};if(ya(O,"handleAndDispatchPointerDownOutsideEvent"),!a(x.target)){n.removeEventListener("click",f.current),h(),c.current=!1;return}const S={originalEvent:x};u.current=!0,r.current=i&&x.button===0,d.current.clear(),!i||x.button!==0?O():(n.removeEventListener("click",f.current),f.current=O,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 x of y)n.addEventListener(x,g,!0),n.addEventListener(x,b);const w=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(w),n.removeEventListener("pointerdown",v),n.removeEventListener("click",f.current);for(const x of y)n.removeEventListener(x,g,!0),n.removeEventListener(x,b)}},[n,l,i,r,s,a]),{onPointerDownCapture:ya(()=>c.current=!0,"onPointerDownCapture")}}ya(o_e,"usePointerDownOutside");function a_e(e,t=globalThis==null?void 0:globalThis.document){const n=Md(e),i=p.useRef(!1);return p.useEffect(()=>{const r=ya(s=>{s.target&&!i.current&&AQ(Yst,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:ya(()=>i.current=!0,"onFocusCapture"),onBlurCapture:ya(()=>i.current=!1,"onBlurCapture")}}ya(a_e,"useFocusOutside");function TF(){const e=new CustomEvent(CF);document.dispatchEvent(e)}ya(TF,"dispatchUpdate");function AQ(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?SQ(r,s):r.dispatchEvent(s)}ya(AQ,"handleAndDispatchCustomEvent");var eot=Object.defineProperty,Il=(e,t)=>eot(e,"name",{value:t,configurable:!0}),fL="focusScope.autoFocusOnMount",hL="focusScope.autoFocusOnUnmount",OZ={bubbles:!1,cancelable:!0},l_e=p.forwardRef(Il(function(t,n){const{loop:i=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=t,[c,u]=p.useState(null),d=Md(s),f=Md(a),h=p.useRef(null),m=yr(n,u),g=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let v=function(O){if(g.paused||!c)return;const S=O.target;c.contains(S)?h.current=S:kh(h.current,{select:!0})},y=function(O){if(g.paused||!c)return;const S=O.relatedTarget;S!==null&&(c.contains(S)||kh(h.current,{select:!0}))},w=function(O){if(document.activeElement===document.body)for(const k of O)k.removedNodes.length>0&&kh(c)};Il(v,"handleFocusIn"),Il(y,"handleFocusOut"),Il(w,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",y);const x=new MutationObserver(w);return c&&x.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),x.disconnect()}}},[r,c,g.paused]),p.useEffect(()=>{if(c){kZ.add(g);const v=document.activeElement;if(!c.contains(v)){const w=new CustomEvent(fL,OZ);c.addEventListener(fL,d),c.dispatchEvent(w),w.defaultPrevented||(c_e(p_e(_Q(c)),{select:!0}),document.activeElement===v&&kh(c))}return()=>{c.removeEventListener(fL,d),setTimeout(()=>{const w=new CustomEvent(hL,OZ);c.addEventListener(hL,f),c.dispatchEvent(w),w.defaultPrevented||kh(v??document.body,{select:!0}),c.removeEventListener(hL,f),kZ.remove(g)},0)}}},[c,d,f,g]);const b=p.useCallback(v=>{if(!i&&!r||g.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(y&&w){const x=v.currentTarget,[O,S]=u_e(x);O&&S?!v.shiftKey&&w===S?(v.preventDefault(),i&&kh(O,{select:!0})):v.shiftKey&&w===O&&(v.preventDefault(),i&&kh(S,{select:!0})):w===x&&v.preventDefault()}},[i,r,g.paused]);return o.jsx(Fr.div,{tabIndex:-1,...l,ref:m,onKeyDown:b})},"FocusScope"));function c_e(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(kh(i,{select:t}),document.activeElement!==n)return}Il(c_e,"focusFirst");function u_e(e){const t=_Q(e),n=AF(t,e),i=AF(t.reverse(),e);return[n,i]}Il(u_e,"getTabbableEdges");function _Q(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Il(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}Il(_Q,"getTabbableCandidates");function AF(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(n?!i.checkVisibility({checkVisibilityCSS:!0}):d_e(i,{upTo:t})))return i}Il(AF,"findVisible");function d_e(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}Il(d_e,"isHidden");function f_e(e){return e instanceof HTMLInputElement&&"select"in e}Il(f_e,"isSelectableInput");function kh(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&f_e(e)&&t&&e.select()}}Il(kh,"focus");var kZ=h_e();function h_e(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=_F(e,t),e.unshift(t)},remove(t){var n;e=_F(e,t),(n=e[0])==null||n.resume()}}}Il(h_e,"createFocusScopesStack");function _F(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}Il(_F,"arrayRemove");function p_e(e){return e.filter(t=>t.tagName!=="A")}Il(p_e,"removeLinks");var tot=Object.defineProperty,not=(e,t)=>tot(e,"name",{value:t,configurable:!0}),jQ=p.forwardRef(not(function(t,n){var c;const{container:i,...r}=t,[s,a]=p.useState(!1);Hu(()=>a(!0),[]);const l=i||s&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return l?ri.createPortal(o.jsx(Fr.div,{...r,ref:n}),l):null},"Portal")),iot=Object.defineProperty,NQ=(e,t)=>iot(e,"name",{value:t,configurable:!0}),$A=0,sf=null;function rot(e){return wP(),e.children}NQ(rot,"FocusGuards");function wP(){p.useEffect(()=>{sf||(sf={start:jF(),end:jF()});const{start:e,end:t}=sf;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),$A++,()=>{$A===1&&(sf==null||sf.start.remove(),sf==null||sf.end.remove(),sf=null),$A=Math.max(0,$A-1)}},[])}NQ(wP,"useFocusGuards");function jF(){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}NQ(jF,"createFocusGuard");var gf=function(){return gf=Object.assign||function(t){for(var n,i=1,r=arguments.length;i"u")return wot;var t=Oot(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])}},Sot=y_e(),cx="data-scroll-locked",Eot=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(oot,` { overflow: hidden `).concat(i,`; padding-right: `).concat(l,"px ").concat(i,`; } @@ -488,173 +488,173 @@ data: ${JSON.stringify({...n,...r?{id:r}:{},...a?{snapshot:!0}:{}})}`)}(t.type== `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(i,";")].filter(Boolean).join(""),` } - .`).concat(G_,` { + .`).concat(K_,` { right: `).concat(l,"px ").concat(i,`; } - .`).concat(X_,` { + .`).concat(G_,` { margin-right: `).concat(l,"px ").concat(i,`; } - .`).concat(G_," .").concat(G_,` { + .`).concat(K_," .").concat(K_,` { right: 0 `).concat(i,`; } - .`).concat(X_," .").concat(X_,` { + .`).concat(G_," .").concat(G_,` { margin-right: 0 `).concat(i,`; } body[`).concat(cx,`] { - `).concat(eot,": ").concat(l,`px; + `).concat(aot,": ").concat(l,`px; } -`)},EZ=function(){var e=parseInt(document.body.getAttribute(cx)||"0",10);return isFinite(e)?e:0},vot=function(){p.useEffect(function(){return document.body.setAttribute(cx,(EZ()+1).toString()),function(){var e=EZ()-1;e<=0?document.body.removeAttribute(cx):document.body.setAttribute(cx,e.toString())}},[])},xot=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,r=i===void 0?"margin":i;vot();var s=p.useMemo(function(){return got(r)},[r]);return p.createElement(bot,{styles:yot(s,!t,r,n?"":"!important")})},NF=!1;if(typeof window<"u")try{var B2=Object.defineProperty({},"passive",{get:function(){return NF=!0,!0}});window.addEventListener("test",B2,B2),window.removeEventListener("test",B2,B2)}catch{NF=!1}var $0=NF?{passive:!1}:!1,wot=function(e){return e.tagName==="TEXTAREA"},f_e=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!wot(e)&&n[t]==="visible")},Oot=function(e){return f_e(e,"overflowY")},kot=function(e){return f_e(e,"overflowX")},CZ=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=h_e(e,i);if(r){var s=p_e(e,i),a=s[1],l=s[2];if(a>l)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},Sot=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},Eot=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},h_e=function(e,t){return e==="v"?Oot(t):kot(t)},p_e=function(e,t){return e==="v"?Sot(t):Eot(t)},Cot=function(e,t){return e==="h"&&t==="rtl"?-1:1},Tot=function(e,t,n,i,r){var s=Cot(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 m=p_e(e,l),g=m[0],b=m[1],v=m[2],y=b-v-s*g;(g||y)&&h_e(e,l)&&(f+=y,h+=g);var w=l.parentNode;l=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}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},U2=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},TZ=function(e){return[e.deltaX,e.deltaY]},AZ=function(e){return e&&"current"in e?e.current:e},Aot=function(e,t){return e[0]===t[0]&&e[1]===t[1]},_ot=function(e){return` +`)},EZ=function(){var e=parseInt(document.body.getAttribute(cx)||"0",10);return isFinite(e)?e:0},Cot=function(){p.useEffect(function(){return document.body.setAttribute(cx,(EZ()+1).toString()),function(){var e=EZ()-1;e<=0?document.body.removeAttribute(cx):document.body.setAttribute(cx,e.toString())}},[])},Tot=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,r=i===void 0?"margin":i;Cot();var s=p.useMemo(function(){return kot(r)},[r]);return p.createElement(Sot,{styles:Eot(s,!t,r,n?"":"!important")})},NF=!1;if(typeof window<"u")try{var FA=Object.defineProperty({},"passive",{get:function(){return NF=!0,!0}});window.addEventListener("test",FA,FA),window.removeEventListener("test",FA,FA)}catch{NF=!1}var F0=NF?{passive:!1}:!1,Aot=function(e){return e.tagName==="TEXTAREA"},v_e=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Aot(e)&&n[t]==="visible")},_ot=function(e){return v_e(e,"overflowY")},jot=function(e){return v_e(e,"overflowX")},CZ=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=x_e(e,i);if(r){var s=w_e(e,i),a=s[1],l=s[2];if(a>l)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},Not=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},Rot=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},x_e=function(e,t){return e==="v"?_ot(t):jot(t)},w_e=function(e,t){return e==="v"?Not(t):Rot(t)},Iot=function(e,t){return e==="h"&&t==="rtl"?-1:1},Pot=function(e,t,n,i,r){var s=Iot(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 m=w_e(e,l),g=m[0],b=m[1],v=m[2],y=b-v-s*g;(g||y)&&x_e(e,l)&&(f+=y,h+=g);var w=l.parentNode;l=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}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},BA=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},TZ=function(e){return[e.deltaX,e.deltaY]},AZ=function(e){return e&&"current"in e?e.current:e},Dot=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Mot=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},jot=0,F0=[];function Not(e){var t=p.useRef([]),n=p.useRef([0,0]),i=p.useRef(),r=p.useState(jot++)[0],s=p.useState(d_e)[0],a=p.useRef(e);p.useEffect(function(){a.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var b=Zst([e.lockRef.current],(e.shards||[]).map(AZ),!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=p.useCallback(function(b,v){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!a.current.allowPinchZoom;var y=U2(b),w=n.current,x="deltaX"in b?b.deltaX:w[0]-y[0],O="deltaY"in b?b.deltaY:w[1]-y[1],S,k=b.target,C=Math.abs(x)>Math.abs(O)?"h":"v";if("touches"in b&&C==="h"&&k.type==="range")return!1;var E=window.getSelection(),R=E&&E.anchorNode,A=R?R===k||R.contains(k):!1;if(A)return!1;var j=CZ(C,k);if(!j)return!0;if(j?S=C:(S=C==="v"?"h":"v",j=CZ(C,k)),!j)return!1;if(!i.current&&"changedTouches"in b&&(x||O)&&(i.current=S),!S)return!0;var T=i.current||S;return Tot(T,v,b,T==="h"?x:O)},[]),c=p.useCallback(function(b){var v=b;if(!(!F0.length||F0[F0.length-1]!==s)){var y="deltaY"in v?TZ(v):U2(v),w=t.current.filter(function(S){return S.name===v.type&&(S.target===v.target||v.target===S.shadowParent)&&Aot(S.delta,y)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var x=(a.current.shards||[]).map(AZ).filter(Boolean).filter(function(S){return S.contains(v.target)}),O=x.length>0?l(v,x[0]):!a.current.noIsolation;O&&v.cancelable&&v.preventDefault()}}},[]),u=p.useCallback(function(b,v,y,w){var x={name:b,delta:v,target:y,should:w,shadowParent:Rot(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(O){return O!==x})},1)},[]),d=p.useCallback(function(b){n.current=U2(b),i.current=void 0},[]),f=p.useCallback(function(b){u(b.type,TZ(b),b.target,l(b,e.lockRef.current))},[]),h=p.useCallback(function(b){u(b.type,U2(b),b.target,l(b,e.lockRef.current))},[]);p.useEffect(function(){return F0.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,$0),document.addEventListener("touchmove",c,$0),document.addEventListener("touchstart",d,$0),function(){F0=F0.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,$0),document.removeEventListener("touchmove",c,$0),document.removeEventListener("touchstart",d,$0)}},[]);var m=e.removeScrollBar,g=e.inert;return p.createElement(p.Fragment,null,g?p.createElement(s,{styles:_ot(r)}):null,m?p.createElement(xot,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Rot(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Iot=aot(u_e,Not);var RQ=p.forwardRef(function(e,t){return p.createElement(wP,mf({},e,{ref:t,sideCar:Iot}))});RQ.classNames=wP.classNames;var Pot=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},B0=new WeakMap,Q2=new WeakMap,z2={},gL=0,m_e=function(e){return e&&(e.host||m_e(e.parentNode))},Dot=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=m_e(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})},Mot=function(e,t,n,i){var r=Dot(t,Array.isArray(e)?e:[e]);z2[n]||(z2[n]=new WeakMap);var s=z2[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 m=h.getAttribute(i),g=m!==null&&m!=="false",b=(B0.get(h)||0)+1,v=(s.get(h)||0)+1;B0.set(h,b),s.set(h,v),a.push(h),b===1&&g&&Q2.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(),gL++,function(){a.forEach(function(f){var h=B0.get(f)-1,m=s.get(f)-1;B0.set(f,h),s.set(f,m),h||(Q2.has(f)||f.removeAttribute(i),Q2.delete(f)),m||f.removeAttribute(n)}),gL--,gL||(B0=new WeakMap,B0=new WeakMap,Q2=new WeakMap,z2={})}},g_e=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),r=Pot(e);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),Mot(i,r,n,"aria-hidden")):function(){return null}},Lot=Object.defineProperty,$ot=(e,t)=>Lot(e,"name",{value:t,configurable:!0});function PC(e){const[t,n]=p.useState(void 0);return qu(()=>{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}$ot(PC,"useSize");var Fot=Object.defineProperty,dp=(e,t)=>Fot(e,"name",{value:t,configurable:!0}),IQ="Checkbox",[Bot,tcn]=gc(IQ),[Uot,PQ]=Bot(IQ);function b_e(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,m]=td({prop:n,defaultProp:r??!1,onChange:c,caller:IQ}),[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useRef(!1),[x,O]=p.useReducer(C=>C+1,0),S=g?!!a||!!g.closest("form"):!0,k={checked:h,disabled:s,setChecked:m,control:g,setControl:b,name:l,form:a,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:x,onUserInteraction:O,required:u,defaultChecked:Gh(r)?!1:r,isFormControl:S,bubbleInput:v,setBubbleInput:y};return o.jsx(Uot,{scope:t,...k,children:y_e(f)?f(k):i})}dp(b_e,"CheckboxProvider");var Qot="CheckboxTrigger",zot=p.forwardRef(dp(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:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=PQ(Qot,t),y=fr(s,f),w=p.useRef(u);return p.useEffect(()=>{const x=a==null?void 0:a.form;if(x){const O=dp(()=>h(w.current),"reset");return x.addEventListener("reset",O),()=>x.removeEventListener("reset",O)}},[a,h]),o.jsx(Fr.button,{type:"button",role:"checkbox","aria-checked":Gh(u)?"mixed":u,"aria-required":d,"data-state":DQ(u),"data-disabled":c?"":void 0,disabled:c,value:l,...r,ref:y,onKeyDown:An(n,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:An(i,x=>{g(),h(O=>Gh(O)?!0:!O),v&&b&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})},"CheckboxTrigger")),Vot=p.forwardRef(dp(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(b_e,{__scopeCheckbox:i,checked:s,defaultChecked:a,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>o.jsxs(o.Fragment,{children:[o.jsx(zot,{...h,ref:n,__scopeCheckbox:i}),m&&o.jsx(Kot,{__scopeCheckbox:i})]})})},"Checkbox")),Hot="CheckboxIndicator",qot=p.forwardRef(dp(function(t,n){const{__scopeCheckbox:i,forceMount:r,...s}=t,a=PQ(Hot,i);return o.jsx(qf,{present:r||Gh(a.checked)||a.checked===!0,children:o.jsx(Fr.span,{"data-state":DQ(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...t.style}})})},"CheckboxIndicator")),Wot="CheckboxBubbleInput",Kot=p.forwardRef(dp(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:m,form:g,bubbleInput:b,setBubbleInput:v}=PQ(Wot,t),y=fr(r,v),w=PC(s),x=p.useRef(!1),O=p.useRef(c),S=p.useRef(l);p.useEffect(()=>{const C=b;if(!C)return;const E=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(E,"checked").set,j=l!==S.current;S.current=l;const T=O.current!==c;O.current=c;const N=!(j&&a.current);if(T&&A){x.current=!j;const _=new Event("click",{bubbles:N});C.indeterminate=Gh(c),A.call(C,Gh(c)?!1:c),C.dispatchEvent(_),x.current=!1}},[b,c,a,l]);const k=p.useRef(Gh(c)?!1:c);return o.jsx(Fr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??k.current,required:d,disabled:f,name:h,value:m,form:g,...i,tabIndex:-1,ref:y,onClick:An(n,C=>{x.current&&C.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function y_e(e){return typeof e=="function"}dp(y_e,"isFunction");function Gh(e){return e==="indeterminate"}dp(Gh,"isIndeterminate");function DQ(e){return Gh(e)?"indeterminate":e?"checked":"unchecked"}dp(DQ,"getState");var Got=Object.defineProperty,Vm=(e,t)=>Got(e,"name",{value:t,configurable:!0}),v_e="Popper",[x_e,Ww]=gc(v_e),[Xot,w_e]=x_e(v_e),Yot=Vm(e=>{const{__scopePopper:t,children:n}=e,[i,r]=p.useState(null),[s,a]=p.useState(void 0);return o.jsx(Xot,{scope:t,anchor:i,onAnchorChange:r,placementState:s,setPlacementState:a,children:n})},"Popper"),Zot="PopperAnchor",Jot=p.forwardRef(Vm(function(t,n){const{__scopePopper:i,virtualRef:r,...s}=t,a=w_e(Zot,i),l=p.useRef(null),c=a.onAnchorChange,u=p.useCallback(b=>{l.current=b,b&&c(b)},[c]),d=fr(n,u),f=p.useRef(null);p.useEffect(()=>{if(!r)return;const b=f.current;f.current=r.current,b!==f.current&&c(f.current)});const h=a.placementState&&OP(a.placementState),m=h==null?void 0:h[0],g=h==null?void 0:h[1];return r?null:o.jsx(Fr.div,{"data-radix-popper-side":m,"data-radix-popper-align":g,...s,ref:d})},"PopperAnchor")),O_e="PopperContent",[eat,ncn]=x_e(O_e),tat=p.forwardRef(Vm(function(t,n){var Z,ce,Ee,Y,G,te,ue;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:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...v}=t,y=w_e(O_e,i),[w,x]=p.useState(null),O=fr(n,x),[S,k]=p.useState(null),C=PC(S),E=(C==null?void 0:C.width)??0,R=(C==null?void 0:C.height)??0,A=r+(a!=="center"?"-"+a:""),j=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},T=Array.isArray(d)?d:[d],N=T.length>0,_={padding:j,boundary:T.filter(k_e),altBoundary:N},{refs:D,floatingStyles:M,placement:P,isPositioned:L,middlewareData:B}=w2e({strategy:"fixed",placement:A,whileElementsMounted:Vm((...Ce)=>hF(...Ce,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:y.anchor},middleware:[O2e({mainAxis:s+R,alignmentAxis:l}),u&&k2e({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?S2e():void 0,..._}),u&&E2e({..._}),C2e({..._,apply:Vm(({elements:Ce,rects:se,availableWidth:he,availableHeight:ae})=>{const{width:Ae,height:De}=se.reference,ye=Ce.floating.style;ye.setProperty("--radix-popper-available-width",`${he}px`),ye.setProperty("--radix-popper-available-height",`${ae}px`),ye.setProperty("--radix-popper-anchor-width",`${Ae}px`),ye.setProperty("--radix-popper-anchor-height",`${De}px`)},"apply")}),S&&vnt({element:S,padding:c}),nat({arrowWidth:E,arrowHeight:R}),m&&ynt({strategy:"referenceHidden",..._,boundary:N?_.boundary:void 0})]}),I=y.setPlacementState;qu(()=>(I(P),()=>{I(void 0)}),[P,I]);const[z,K]=OP(P),F=Dd(b);qu(()=>{L&&(F==null||F())},[L,F]);const q=(Z=B.arrow)==null?void 0:Z.x,H=(ce=B.arrow)==null?void 0:ce.y,X=((Ee=B.arrow)==null?void 0:Ee.centerOffset)!==0,[ne,Q]=p.useState();return qu(()=>{w&&Q(window.getComputedStyle(w).zIndex)},[w]),o.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:L?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(Y=B.transformOrigin)==null?void 0:Y.x,(G=B.transformOrigin)==null?void 0:G.y].join(" "),...((te=B.hide)==null?void 0:te.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:o.jsx(eat,{scope:i,placedSide:z,placedAlign:K,onArrowChange:k,arrowX:q,arrowY:H,shouldHideArrow:X,children:o.jsx(Fr.div,{"data-side":z,"data-align":K,...v,ref:O,style:{...v.style,animation:L?(ue=v.style)==null?void 0:ue.animation:"none"}})})})},"PopperContent"));function k_e(e){return e!==null}Vm(k_e,"isNotNull");var nat=Vm(e=>({name:"transformOrigin",options:e,fn(t){var v,y,w;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]=OP(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((y=r.arrow)==null?void 0:y.x)??0)+l/2,m=(((w=r.arrow)==null?void 0:w.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:`${m}px`):u==="left"&&(g=`${i.floating.width+c}px`,b=a?f:`${m}px`),{data:{x:g,y:b}}}}),"transformOrigin");function OP(e){const[t,n="center"]=e.split("-");return[t,n]}Vm(OP,"getSideAndAlignFromPlacement");var kP=Yot,MQ=Jot,LQ=tat,iat=Object.defineProperty,$Q=(e,t)=>iat(e,"name",{value:t,configurable:!0}),bL=!1;function S_e(){const[e,t]=p.useState(bL);return p.useEffect(()=>{bL||(bL=!0,t(!0))},[]),e}$Q(S_e,"useIsHydrated");var E_e=Fy[" useSyncExternalStore ".trim().toString()];function C_e(){return()=>{}}$Q(C_e,"subscribe");function T_e(){return E_e(C_e,()=>!0,()=>!1)}$Q(T_e,"useIsHydratedModern");var rat=typeof E_e=="function"?T_e:S_e,sat=Object.defineProperty,Gy=(e,t)=>sat(e,"name",{value:t,configurable:!0}),yL="rovingFocusGroup.onEntryFocus",oat={bubbles:!1,cancelable:!0},SP="RovingFocusGroup",[RF,A_e,aat]=EQ(SP),[lat,Kw]=gc(SP,[aat]),[cat,uat]=lat(SP),dat=p.forwardRef(Gy(function(t,n){return o.jsx(RF.Provider,{scope:t.__scopeRovingFocusGroup,children:o.jsx(RF.Slot,{scope:t.__scopeRovingFocusGroup,children:o.jsx(fat,{...t,ref:n})})})},"RovingFocusGroup")),fat=p.forwardRef(Gy(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,m=p.useRef(null),g=fr(n,m),b=IC(a),[v,y]=td({prop:l,defaultProp:c??null,onChange:u,caller:SP}),[w,x]=p.useState(!1),O=Dd(d),S=A_e(i),k=p.useRef(!1),[C,E]=p.useState(0);return p.useEffect(()=>{const R=m.current;if(R)return R.addEventListener(yL,O),()=>R.removeEventListener(yL,O)},[O]),o.jsx(cat,{scope:i,orientation:r,dir:b,loop:s,currentTabStopId:v,onItemFocus:p.useCallback(R=>y(R),[y]),onItemShiftTab:p.useCallback(()=>x(!0),[]),onFocusableItemAdd:p.useCallback(()=>E(R=>R+1),[]),onFocusableItemRemove:p.useCallback(()=>E(R=>R-1),[]),children:o.jsx(Fr.div,{tabIndex:w||C===0?-1:0,"data-orientation":r,...h,ref:g,style:{outline:"none",...t.style},onMouseDown:An(t.onMouseDown,()=>{k.current=!0}),onFocus:An(t.onFocus,R=>{const A=!k.current;if(R.target===R.currentTarget&&A&&!w){const j=new CustomEvent(yL,oat);if(R.currentTarget.dispatchEvent(j),!j.defaultPrevented){const T=S().filter(P=>P.focusable),N=T.find(P=>P.active),_=T.find(P=>P.id===v),M=[N,_,...T].filter(Boolean).map(P=>P.ref.current);FQ(M,f)}}k.current=!1}),onBlur:An(t.onBlur,()=>x(!1))})})},"RovingFocusGroupImpl")),hat="RovingFocusGroupItem",pat=p.forwardRef(Gy(function(t,n){const{__scopeRovingFocusGroup:i,focusable:r=!0,active:s=!1,tabStopId:a,children:l,...c}=t,u=lg(),d=a||u,f=uat(hat,i),h=f.currentTabStopId===d,m=A_e(i),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:v}=f,y=rat();return qu(()=>{if(!(!y||!r))return g(),()=>b()},[y,r,g,b]),p.useEffect(()=>{if(!(y||!r))return g(),()=>b()},[y,r,g,b]),o.jsx(RF.ItemSlot,{scope:i,id:d,focusable:r,active:s,children:o.jsx(Fr.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:An(t.onMouseDown,w=>{r?f.onItemFocus(d):w.preventDefault()}),onFocus:An(t.onFocus,()=>f.onItemFocus(d)),onKeyDown:An(t.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){f.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const x=j_e(w,f.orientation,f.dir);if(x!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let S=m().filter(k=>k.focusable).map(k=>k.ref.current);if(x==="last")S.reverse();else if(x==="prev"||x==="next"){x==="prev"&&S.reverse();const k=S.indexOf(w.currentTarget);S=f.loop?N_e(S,k+1):S.slice(k+1)}setTimeout(()=>FQ(S))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:v!=null}):l})})},"RovingFocusGroupItem")),mat={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function __e(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Gy(__e,"getDirectionAwareKey");function j_e(e,t,n){const i=__e(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return mat[i]}Gy(j_e,"getFocusIntent");function FQ(e,t=!1){const n=document.activeElement;for(const i of e)if(i===n||(i.focus({preventScroll:t}),document.activeElement!==n))return}Gy(FQ,"focusFirst");function N_e(e,t){return e.map((n,i)=>e[(t+i)%e.length])}Gy(N_e,"wrapArray");var BQ=dat,UQ=pat,gat=Object.defineProperty,Ji=(e,t)=>gat(e,"name",{value:t,configurable:!0}),IF=["Enter"," "],bat=["ArrowDown","PageUp","Home"],R_e=["ArrowUp","PageDown","End"],yat=[...bat,...R_e],vat={ltr:[...IF,"ArrowRight"],rtl:[...IF,"ArrowLeft"]},xat={ltr:["ArrowLeft"],rtl:["ArrowRight"]},EP="Menu",[tE,wat,Oat]=EQ(EP),[Xy,I_e]=gc(EP,[Oat,Ww,Kw]),CP=Ww(),P_e=Kw(),[D_e,Ng]=Xy(EP),[kat,DC]=Xy(EP),Sat=Ji(e=>{const{__scopeMenu:t,open:n=!1,children:i,dir:r,onOpenChange:s,modal:a=!0}=e,l=CP(t),[c,u]=p.useState(null),d=p.useRef(!1),f=Dd(s),h=IC(r);return p.useEffect(()=>{const m=Ji(()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=Ji(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),p.useEffect(()=>{if(!n)return;const m=Ji(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[n,f]),o.jsx(kP,{...l,children:o.jsx(D_e,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:o.jsx(kat,{scope:t,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:a,children:i})})})},"Menu"),M_e=p.forwardRef(Ji(function(t,n){const{__scopeMenu:i,...r}=t,s=CP(i);return o.jsx(MQ,{...s,...r,ref:n})},"MenuAnchor")),L_e="MenuPortal",[Eat,$_e]=Xy(L_e,{forceMount:void 0}),Cat=Ji(e=>{const{__scopeMenu:t,forceMount:n,children:i,container:r}=e,s=Ng(L_e,t);return o.jsx(Eat,{scope:t,forceMount:n,children:o.jsx(qf,{present:n||s.open,children:o.jsx(jQ,{asChild:!0,container:r,children:i})})})},"MenuPortal"),_d="MenuContent",[Tat,QQ]=Xy(_d),Aat=p.forwardRef(Ji(function(t,n){const i=$_e(_d,t.__scopeMenu),{forceMount:r=i.forceMount,...s}=t,a=Ng(_d,t.__scopeMenu),l=DC(_d,t.__scopeMenu);return o.jsx(tE.Provider,{scope:t.__scopeMenu,children:o.jsx(qf,{present:r||a.open,children:o.jsx(tE.Slot,{scope:t.__scopeMenu,children:l.modal?o.jsx(_at,{...s,ref:n}):o.jsx(jat,{...s,ref:n})})})})},"MenuContent")),_at=p.forwardRef(Ji(function(t,n){const i=Ng(_d,t.__scopeMenu),r=p.useRef(null),s=fr(n,r);return p.useEffect(()=>{const a=r.current;if(a)return g_e(a)},[]),o.jsx(zQ,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:An(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentModal")),jat=p.forwardRef(Ji(function(t,n){const i=Ng(_d,t.__scopeMenu);return o.jsx(zQ,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentNonModal")),Nat=cp("MenuContent.ScrollLock"),zQ=p.forwardRef(Ji(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:m,onDismiss:g,disableOutsideScroll:b,...v}=t,y=Ng(_d,i),w=DC(_d,i),x=CP(i),O=P_e(i),S=wat(i),[k,C]=p.useState(null),E=p.useRef(null),R=fr(n,E,y.onContentChange),A=p.useRef(0),j=p.useRef(""),T=p.useRef(0),N=p.useRef(null),_=p.useRef("right"),D=p.useRef(0),M=b?RQ:p.Fragment,P=b?{as:Nat,allowPinchZoom:!0}:void 0,L=Ji(I=>{var Q,Z;const z=j.current+I,K=S().filter(ce=>!ce.disabled),F=document.activeElement,q=(Q=K.find(ce=>ce.ref.current===F))==null?void 0:Q.textValue,H=K.map(ce=>ce.textValue),X=q_e(H,z,q),ne=(Z=K.find(ce=>ce.textValue===X))==null?void 0:Z.ref.current;Ji(function ce(Ee){j.current=Ee,window.clearTimeout(A.current),Ee!==""&&(A.current=window.setTimeout(()=>ce(""),1e3))},"updateSearch")(z),ne&&setTimeout(()=>ne.focus())},"handleTypeaheadSearch");p.useEffect(()=>()=>window.clearTimeout(A.current),[]),xP();const B=p.useCallback(I=>{var K,F;return _.current===((K=N.current)==null?void 0:K.side)&&K_e(I,(F=N.current)==null?void 0:F.area)},[]);return o.jsx(Tat,{scope:i,searchRef:j,onItemEnter:p.useCallback(I=>{B(I)&&I.preventDefault()},[B]),onItemLeave:p.useCallback(I=>{var z;B(I)||((z=E.current)==null||z.focus(),C(null))},[B]),onTriggerLeave:p.useCallback(I=>{B(I)&&I.preventDefault()},[B]),pointerGraceTimerRef:T,onPointerGraceIntentChange:p.useCallback(I=>{N.current=I},[]),children:o.jsx(M,{...P,children:o.jsx(t_e,{asChild:!0,trapped:s,onMountAutoFocus:An(a,I=>{var z;I.preventDefault(),(z=E.current)==null||z.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:o.jsx(TQ,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,children:o.jsx(BQ,{asChild:!0,...O,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:k,onCurrentTabStopIdChange:C,onEntryFocus:An(u,I=>{w.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(LQ,{role:"menu","aria-orientation":"vertical","data-state":HQ(y.open),"data-radix-menu-content":"",dir:w.dir,...x,...v,ref:R,style:{outline:"none",...v.style},onKeyDown:An(v.onKeyDown,I=>{const K=I.target.closest("[data-radix-menu-content]")===I.currentTarget,F=I.ctrlKey||I.altKey||I.metaKey,q=I.key.length===1;K&&(I.key==="Tab"&&I.preventDefault(),!F&&q&&L(I.key));const H=E.current;if(I.target!==H||!yat.includes(I.key))return;I.preventDefault();const ne=S().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);R_e.includes(I.key)&&ne.reverse(),V_e(ne)}),onBlur:An(t.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(A.current),j.current="")}),onPointerMove:An(t.onPointerMove,ew(I=>{const z=I.target,K=D.current!==I.clientX;if(I.currentTarget.contains(z)&&K){const F=I.clientX>D.current?"right":"left";_.current=F,D.current=I.clientX}}))})})})})})})},"MenuContentImpl")),Rat=p.forwardRef(Ji(function(t,n){const{__scopeMenu:i,...r}=t;return o.jsx(Fr.div,{role:"group",...r,ref:n})},"MenuGroup")),PF="MenuItem",_Z="menu.itemSelect",VQ=p.forwardRef(Ji(function(t,n){const{disabled:i=!1,onSelect:r,...s}=t,a=p.useRef(null),l=DC(PF,t.__scopeMenu),c=QQ(PF,t.__scopeMenu),u=fr(n,a),d=p.useRef(!1),f=Ji(()=>{const h=a.current;if(!i&&h){const m=new CustomEvent(_Z,{bubbles:!0,cancelable:!0});h.addEventListener(_Z,g=>r==null?void 0:r(g),{once:!0}),SQ(h,m),m.defaultPrevented?d.current=!1:l.onClose()}},"handleSelect");return o.jsx(F_e,{...s,ref:u,disabled:i,onClick:An(t.onClick,f),onPointerDown:h=>{var m;(m=t.onPointerDown)==null||m.call(t,h),d.current=!0},onPointerUp:An(t.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:An(t.onKeyDown,h=>{i||h.target!==h.currentTarget||c.searchRef.current!==""&&h.key===" "||IF.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})},"MenuItem")),F_e=p.forwardRef(Ji(function(t,n){const{__scopeMenu:i,disabled:r=!1,textValue:s,...a}=t,l=QQ(PF,i),c=P_e(i),u=p.useRef(null),d=fr(n,u),[f,h]=p.useState(!1),[m,g]=p.useState("");return p.useEffect(()=>{const b=u.current;b&&g((b.textContent??"").trim())},[a.children]),o.jsx(tE.ItemSlot,{scope:i,disabled:r,textValue:s??m,children:o.jsx(UQ,{asChild:!0,...c,focusable:!r,children:o.jsx(Fr.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:d,onPointerMove:An(t.onPointerMove,ew(b=>{r?l.onItemLeave(b):(l.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:An(t.onPointerLeave,ew(b=>l.onItemLeave(b))),onFocus:An(t.onFocus,()=>h(!0)),onBlur:An(t.onBlur,()=>h(!1))})})})},"MenuItemImpl")),Iat=p.forwardRef(Ji(function(t,n){const{checked:i=!1,onCheckedChange:r,...s}=t;return o.jsx(U_e,{scope:t.__scopeMenu,checked:i,children:o.jsx(VQ,{role:"menuitemcheckbox","aria-checked":nE(i)?"mixed":i,...s,ref:n,"data-state":TP(i),onSelect:An(s.onSelect,()=>r==null?void 0:r(nE(i)?!0:!i),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),Pat="MenuRadioGroup",[Dat,Mat]=Xy(Pat,{value:void 0,onValueChange:Ji(()=>{},"onValueChange")}),Lat=p.forwardRef(Ji(function(t,n){const{value:i,onValueChange:r,...s}=t,a=Dd(r);return o.jsx(Dat,{scope:t.__scopeMenu,value:i,onValueChange:a,children:o.jsx(Rat,{...s,ref:n})})},"MenuRadioGroup")),$at="MenuRadioItem",Fat=p.forwardRef(Ji(function(t,n){const{value:i,...r}=t,s=Mat($at,t.__scopeMenu),a=i===s.value;return o.jsx(U_e,{scope:t.__scopeMenu,checked:a,children:o.jsx(VQ,{role:"menuitemradio","aria-checked":a,...r,ref:n,"data-state":TP(a),onSelect:An(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,i)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),B_e="MenuItemIndicator",[U_e,Bat]=Xy(B_e,{checked:!1}),Uat=p.forwardRef(Ji(function(t,n){const{__scopeMenu:i,forceMount:r,...s}=t,a=Bat(B_e,i);return o.jsx(qf,{present:r||nE(a.checked)||a.checked===!0,children:o.jsx(Fr.span,{...s,ref:n,"data-state":TP(a.checked)})})},"MenuItemIndicator")),Qat=p.forwardRef(Ji(function(t,n){const{__scopeMenu:i,...r}=t;return o.jsx(Fr.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})},"MenuSeparator")),Q_e="MenuSub",[zat,z_e]=Xy(Q_e),Vat=Ji(e=>{const{__scopeMenu:t,children:n,open:i=!1,onOpenChange:r}=e,s=Ng(Q_e,t),a=CP(t),[l,c]=p.useState(null),[u,d]=p.useState(null),f=Dd(r);return p.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),o.jsx(kP,{...a,children:o.jsx(D_e,{scope:t,open:i,onOpenChange:f,content:u,onContentChange:d,children:o.jsx(zat,{scope:t,contentId:lg(),triggerId:lg(),trigger:l,onTriggerChange:c,children:n})})})},"MenuSub"),V2="MenuSubTrigger",Hat=p.forwardRef(Ji(function(t,n){const i=Ng(V2,t.__scopeMenu),r=DC(V2,t.__scopeMenu),s=z_e(V2,t.__scopeMenu),a=QQ(V2,t.__scopeMenu),l=p.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=a,d={__scopeMenu:t.__scopeMenu},f=p.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);p.useEffect(()=>f,[f]),p.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),u(null)}},[c,u]);const h=fr(n,s.onTriggerChange);return o.jsx(M_e,{asChild:!0,...d,children:o.jsx(F_e,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?s.contentId:void 0,"data-state":HQ(i.open),...t,ref:h,onClick:m=>{var g;(g=t.onClick)==null||g.call(t,m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),i.open||i.onOpenChange(!0))},onPointerMove:An(t.onPointerMove,ew(m=>{a.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!i.open&&!l.current&&(a.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{i.onOpenChange(!0),f()},100))})),onPointerLeave:An(t.onPointerLeave,ew(m=>{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,w=y==="right",x=w?-5:5,O=g[w?"left":"right"],S=g[w?"right":"left"];a.onPointerGraceIntentChange({area:[{x:m.clientX+x,y:m.clientY},{x:O,y:g.top},{x:S,y:g.top},{x:S,y:g.bottom},{x:O,y:g.bottom}],side:y}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(m),m.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:An(t.onKeyDown,m=>{var b;t.disabled||m.target!==m.currentTarget||a.searchRef.current!==""&&m.key===" "||vat[r.dir].includes(m.key)&&(i.onOpenChange(!0),(b=i.content)==null||b.focus(),m.preventDefault())})})})},"MenuSubTrigger")),qat="MenuSubContent",Wat=p.forwardRef(Ji(function(t,n){const i=$_e(_d,t.__scopeMenu),{forceMount:r=i.forceMount,align:s="start",...a}=t,l=Ng(_d,t.__scopeMenu),c=DC(_d,t.__scopeMenu),u=z_e(qat,t.__scopeMenu),d=p.useRef(null),f=fr(n,d);return o.jsx(tE.Provider,{scope:t.__scopeMenu,children:o.jsx(qf,{present:r||l.open,children:o.jsx(tE.Slot,{scope:t.__scopeMenu,children:o.jsx(zQ,{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 m;c.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:An(t.onFocusOutside,h=>{h.target!==u.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:An(t.onEscapeKeyDown,h=>{c.onClose(),h.preventDefault()}),onKeyDown:An(t.onKeyDown,h=>{var b;const m=h.currentTarget.contains(h.target),g=xat[c.dir].includes(h.key);m&&g&&(l.onOpenChange(!1),(b=u.trigger)==null||b.focus(),h.preventDefault())})})})})})},"MenuSubContent"));function HQ(e){return e?"open":"closed"}Ji(HQ,"getOpenState");function nE(e){return e==="indeterminate"}Ji(nE,"isIndeterminate");function TP(e){return nE(e)?"indeterminate":e?"checked":"unchecked"}Ji(TP,"getCheckedState");function V_e(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}Ji(V_e,"focusFirst");function H_e(e,t){return e.map((n,i)=>e[(t+i)%e.length])}Ji(H_e,"wrapArray");function q_e(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=H_e(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}Ji(q_e,"getNextMatch");function W_e(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}Ji(W_e,"isPointInPolygon");function K_e(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return W_e(n,t)}Ji(K_e,"isPointerInGraceArea");function ew(e){return t=>t.pointerType==="mouse"?e(t):void 0}Ji(ew,"whenMouse");var Kat=Sat,Gat=M_e,Xat=Cat,Yat=Aat,Zat=VQ,Jat=Iat,elt=Lat,tlt=Fat,nlt=Uat,ilt=Qat,rlt=Vat,slt=Hat,olt=Wat,alt=Object.defineProperty,mu=(e,t)=>alt(e,"name",{value:t,configurable:!0}),qQ="DropdownMenu",[llt,icn]=gc(qQ,[I_e]),gu=I_e(),[clt,G_e]=llt(qQ),ult=mu(e=>{const{__scopeDropdownMenu:t,children:n,dir:i,open:r,defaultOpen:s,onOpenChange:a,modal:l=!0}=e,c=gu(t),u=p.useRef(null),[d,f]=td({prop:r,defaultProp:s??!1,onChange:a,caller:qQ});return o.jsx(clt,{scope:t,triggerId:lg(),triggerRef:u,contentId:lg(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),modal:l,children:o.jsx(Kat,{...c,open:d,onOpenChange:f,dir:i,modal:l,children:n})})},"DropdownMenu"),dlt="DropdownMenuTrigger",flt=p.forwardRef(mu(function(t,n){const{__scopeDropdownMenu:i,disabled:r=!1,...s}=t,a=G_e(dlt,i),l=gu(i),c=fr(n,a.triggerRef);return o.jsx(Gat,{asChild:!0,...l,children:o.jsx(Fr.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:An(t.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(a.onOpenToggle(),a.open||u.preventDefault())}),onKeyDown:An(t.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&a.onOpenToggle(),u.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),hlt=mu(e=>{const{__scopeDropdownMenu:t,...n}=e,i=gu(t);return o.jsx(Xat,{...i,...n})},"DropdownMenuPortal"),plt="DropdownMenuContent",mlt=p.forwardRef(mu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=G_e(plt,i),a=gu(i),l=p.useRef(!1);return o.jsx(Yat,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...r,ref:n,onCloseAutoFocus:An(t.onCloseAutoFocus,c=>{var u;l.current||(u=s.triggerRef.current)==null||u.focus(),l.current=!1,c.preventDefault()}),onInteractOutside:An(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")),glt=p.forwardRef(mu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gu(i);return o.jsx(Zat,{...s,...r,ref:n})},"DropdownMenuItem")),blt=p.forwardRef(mu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gu(i);return o.jsx(Jat,{...s,...r,ref:n})},"DropdownMenuCheckboxItem")),ylt=p.forwardRef(mu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gu(i);return o.jsx(elt,{...s,...r,ref:n})},"DropdownMenuRadioGroup")),vlt=p.forwardRef(mu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gu(i);return o.jsx(tlt,{...s,...r,ref:n})},"DropdownMenuRadioItem")),xlt=p.forwardRef(mu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gu(i);return o.jsx(nlt,{...s,...r,ref:n})},"DropdownMenuItemIndicator")),wlt=p.forwardRef(mu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gu(i);return o.jsx(ilt,{...s,...r,ref:n})},"DropdownMenuSeparator")),Olt=mu(e=>{const{__scopeDropdownMenu:t,children:n,open:i,onOpenChange:r,defaultOpen:s}=e,a=gu(t),[l,c]=td({prop:i,defaultProp:s??!1,onChange:r,caller:"DropdownMenuSub"});return o.jsx(rlt,{...a,open:l,onOpenChange:c,children:n})},"DropdownMenuSub"),klt=p.forwardRef(mu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gu(i);return o.jsx(slt,{...s,...r,ref:n})},"DropdownMenuSubTrigger")),Slt=p.forwardRef(mu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=gu(i);return o.jsx(olt,{...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")),Elt=ult,Clt=flt,X_e=hlt,Tlt=mlt,Y_e=glt,Alt=blt,_lt=ylt,jlt=vlt,Z_e=xlt,Nlt=wlt,Rlt=Olt,Ilt=klt,Plt=Slt,Dlt=Object.defineProperty,Rg=(e,t)=>Dlt(e,"name",{value:t,configurable:!0}),WQ="Popover",[J_e,rcn]=gc(WQ,[Ww]),KQ=Ww(),[Mlt,Gw]=J_e(WQ),Llt=Rg(e=>{const{__scopePopover:t,children:n,open:i,defaultOpen:r,onOpenChange:s,modal:a=!1}=e,l=KQ(t),c=p.useRef(null),[u,d]=p.useState(!1),[f,h]=td({prop:i,defaultProp:r??!1,onChange:s,caller:WQ});return o.jsx(kP,{...l,children:o.jsx(Mlt,{scope:t,contentId:lg(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:a,children:n})})},"Popover"),$lt="PopoverTrigger",Flt=p.forwardRef(Rg(function(t,n){const{__scopePopover:i,...r}=t,s=Gw($lt,i),a=KQ(i),l=fr(n,s.triggerRef),c=o.jsx(Fr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":GQ(s.open),...r,ref:l,onClick:An(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:o.jsx(MQ,{asChild:!0,...a,children:c})},"PopoverTrigger")),eje="PopoverPortal",[Blt,Ult]=J_e(eje,{forceMount:void 0}),Qlt=Rg(e=>{const{__scopePopover:t,forceMount:n,children:i,container:r}=e,s=Gw(eje,t);return o.jsx(Blt,{scope:t,forceMount:n,children:o.jsx(qf,{present:n||s.open,children:o.jsx(jQ,{asChild:!0,container:r,children:i})})})},"PopoverPortal"),iE="PopoverContent",zlt=p.forwardRef(Rg(function(t,n){const i=Ult(iE,t.__scopePopover),{forceMount:r=i.forceMount,...s}=t,a=Gw(iE,t.__scopePopover);return o.jsx(qf,{present:r||a.open,children:a.modal?o.jsx(Hlt,{...s,ref:n}):o.jsx(qlt,{...s,ref:n})})},"PopoverContent")),Vlt=cp("PopoverContent.RemoveScroll"),Hlt=p.forwardRef(Rg(function(t,n){const i=Gw(iE,t.__scopePopover),r=p.useRef(null),s=fr(n,r),a=p.useRef(!1);return p.useEffect(()=>{const l=r.current;if(l)return g_e(l)},[]),o.jsx(RQ,{as:Vlt,allowPinchZoom:!0,children:o.jsx(tje,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:An(t.onCloseAutoFocus,l=>{var c;l.preventDefault(),a.current||(c=i.triggerRef.current)==null||c.focus()}),onPointerDownOutside:An(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:An(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),qlt=p.forwardRef(Rg(function(t,n){const i=Gw(iE,t.__scopePopover),r=p.useRef(!1),s=p.useRef(!1);return o.jsx(tje,{...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")),tje=p.forwardRef(Rg(function(t,n){const{__scopePopover:i,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...h}=t,m=Gw(iE,i),g=KQ(i);return xP(),o.jsx(t_e,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:o.jsx(TQ,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:o.jsx(LQ,{"data-state":GQ(m.open),role:"dialog",id:m.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 GQ(e){return e?"open":"closed"}Rg(GQ,"getState");var nje=Llt,ije=Flt,rje=Qlt,sje=zlt,Wlt=Object.defineProperty,ul=(e,t)=>Wlt(e,"name",{value:t,configurable:!0}),oje="Radio",[Klt,aje]=gc(oje),[Glt,AP]=Klt(oje);function lje(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]=p.useState(null),[m,g]=p.useState(null),b=p.useRef(!1),[v,y]=p.useReducer(O=>O+1,0),w=f?!!s||!!f.closest("form"):!0,x={checked:n,disabled:r,required:c,name:a,form:s,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:b,userInteractionCount:v,onUserInteraction:y,isFormControl:w,bubbleInput:m,setBubbleInput:g,onCheck:ul(()=>l==null?void 0:l(),"onCheck")};return o.jsx(Glt,{scope:t,...x,children:cje(d)?d(x):i})}ul(lje,"RadioProvider");var Xlt="RadioTrigger",Ylt=p.forwardRef(ul(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:m}=AP(Xlt,t),g=fr(r,c);return o.jsx(Fr.button,{type:"button",role:"radio","aria-checked":s,"data-state":XQ(s),"data-disabled":a?"":void 0,disabled:a,value:l,...i,ref:g,onClick:An(n,b=>{s||(f(),u()),m&&h&&(d.current=b.isPropagationStopped(),d.current||b.stopPropagation())})})},"RadioTrigger")),Zlt="RadioIndicator",Jlt=p.forwardRef(ul(function(t,n){const{__scopeRadio:i,forceMount:r,...s}=t,a=AP(Zlt,i);return o.jsx(qf,{present:r||a.checked,children:o.jsx(Fr.span,{"data-state":XQ(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:n})})},"RadioIndicator")),ect="RadioBubbleInput",tct=p.forwardRef(ul(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:m,hasConsumerStoppedPropagationRef:g,userInteractionCount:b}=AP(ect,t),v=fr(r,m),y=PC(s),w=p.useRef(!1),x=p.useRef(a),O=p.useRef(b);p.useEffect(()=>{const k=h;if(!k)return;const C=window.HTMLInputElement.prototype,R=Object.getOwnPropertyDescriptor(C,"checked").set,A=b!==O.current;O.current=b;const j=x.current!==a;x.current=a;const T=!(A&&g.current);if(j&&R){w.current=!A;const N=new Event("click",{bubbles:T});R.call(k,a),k.dispatchEvent(N),w.current=!1}},[h,a,g,b]);const S=p.useRef(a);return o.jsx(Fr.input,{type:"radio","aria-hidden":!0,defaultChecked:S.current,required:l,disabled:c,name:u,value:d,form:f,...i,tabIndex:-1,ref:v,onClick:An(n,k=>{w.current&&k.stopPropagation()}),style:{...i.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function cje(e){return typeof e=="function"}ul(cje,"isFunction");function XQ(e){return e?"checked":"unchecked"}ul(XQ,"getState");var nct=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],YQ="RadioGroup",[ict,scn]=gc(YQ,[Kw,aje]),uje=Kw(),_P=aje(),[rct,sct]=ict(YQ),oct=p.forwardRef(ul(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:m,...g}=t,b=uje(i),v=IC(f),[y,w]=td({prop:l,defaultProp:a??null,onChange:m,caller:YQ}),[x,O]=p.useState(null),S=fr(n,O),k=p.useRef(y);return p.useEffect(()=>{const C=s?x==null?void 0:x.ownerDocument.getElementById(s):x==null?void 0:x.closest("form");if(C instanceof HTMLFormElement){const E=ul(()=>w(k.current),"reset");return C.addEventListener("reset",E),()=>C.removeEventListener("reset",E)}},[x,s,w]),o.jsx(rct,{scope:i,name:r,form:s,required:c,disabled:u,value:y,onValueChange:w,children:o.jsx(BQ,{asChild:!0,...b,orientation:d,dir:v,loop:h,children:o.jsx(Fr.div,{role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":u?"":void 0,dir:v,...g,ref:S})})})},"RadioGroup")),act="RadioGroupItemProvider",lct="RadioGroupItemTrigger";function dje(e){const{__scopeRadioGroup:t,value:n,disabled:i,children:r,internal_do_not_use_render:s}=e,a=sct(act,t),l=_P(t),c=a.disabled||i;return o.jsx(lje,{...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})}ul(dje,"RadioGroupItemProvider");var cct=p.forwardRef(ul(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=uje(i),a=_P(i),{checked:l,disabled:c}=AP(lct,a.__scopeRadio),u=p.useRef(null),d=fr(n,u),f=p.useRef(!1);return p.useEffect(()=>{const h=ul(g=>{nct.includes(g.key)&&(f.current=!0)},"handleKeyDown"),m=ul(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),o.jsx(UQ,{asChild:!0,...s,focusable:!c,active:l,children:o.jsx(Ylt,{...a,...r,ref:d,onKeyDown:An(r.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:An(r.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),uct=p.forwardRef(ul(function(t,n){const{__scopeRadioGroup:i,value:r,disabled:s,...a}=t;return o.jsx(dje,{__scopeRadioGroup:i,value:r,disabled:s,internal_do_not_use_render:({isFormControl:l})=>o.jsxs(o.Fragment,{children:[o.jsx(cct,{...a,ref:n,__scopeRadioGroup:i}),l&&o.jsx(dct,{__scopeRadioGroup:i})]})})},"RadioGroupItem")),dct=p.forwardRef(ul(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=_P(i);return o.jsx(tct,{...s,...r,ref:n})},"RadioGroupItemBubbleInput")),fct=p.forwardRef(ul(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=_P(i);return o.jsx(Jlt,{...s,...r,ref:n})},"RadioGroupIndicator")),hct=Object.defineProperty,cg=(e,t)=>hct(e,"name",{value:t,configurable:!0}),ZQ="Switch",[pct,ocn]=gc(ZQ),[mct,JQ]=pct(ZQ);function fje(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,m]=td({prop:n,defaultProp:r??!1,onChange:c,caller:ZQ}),[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useRef(!1),[x,O]=p.useReducer(C=>C+1,0),S=g?!!a||!!g.closest("form"):!0,k={checked:h,setChecked:m,disabled:s,control:g,setControl:b,name:l,form:a,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:x,onUserInteraction:O,required:u,defaultChecked:r,isFormControl:S,bubbleInput:v,setBubbleInput:y};return o.jsx(mct,{scope:t,...k,children:hje(f)?f(k):i})}cg(fje,"SwitchProvider");var gct="SwitchTrigger",bct=p.forwardRef(cg(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:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=JQ(gct,t),y=fr(r,f),w=p.useRef(u);return p.useEffect(()=>{const x=a?s==null?void 0:s.ownerDocument.getElementById(a):s==null?void 0:s.form;if(x instanceof HTMLFormElement){const O=cg(()=>h(w.current),"reset");return x.addEventListener("reset",O),()=>x.removeEventListener("reset",O)}},[s,a,h]),o.jsx(Fr.button,{type:"button",role:"switch","aria-checked":u,"aria-required":d,"data-state":ez(u),"data-disabled":c?"":void 0,disabled:c,value:l,...i,ref:y,onClick:An(n,x=>{g(),h(O=>!O),v&&b&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})},"SwitchTrigger")),yct=p.forwardRef(cg(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(fje,{__scopeSwitch:i,checked:s,defaultChecked:a,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>o.jsxs(o.Fragment,{children:[o.jsx(bct,{...h,ref:n,__scopeSwitch:i}),m&&o.jsx(Oct,{__scopeSwitch:i})]})})},"Switch")),vct="SwitchThumb",xct=p.forwardRef(cg(function(t,n){const{__scopeSwitch:i,...r}=t,s=JQ(vct,i);return o.jsx(Fr.span,{"data-state":ez(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:n})},"SwitchThumb")),wct="SwitchBubbleInput",Oct=p.forwardRef(cg(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:m,form:g,bubbleInput:b,setBubbleInput:v}=JQ(wct,t),y=fr(r,v),w=PC(s),x=p.useRef(!1),O=p.useRef(c),S=p.useRef(l);p.useEffect(()=>{const C=b;if(!C)return;const E=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(E,"checked").set,j=l!==S.current;S.current=l;const T=O.current!==c;O.current=c;const N=!(j&&a.current);if(T&&A){x.current=!j;const _=new Event("click",{bubbles:N});A.call(C,c),C.dispatchEvent(_),x.current=!1}},[b,c,a,l]);const k=p.useRef(c);return o.jsx(Fr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??k.current,required:d,disabled:f,name:h,value:m,form:g,...i,tabIndex:-1,ref:y,onClick:An(n,C=>{x.current&&C.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function hje(e){return typeof e=="function"}cg(hje,"isFunction");function ez(e){return e?"checked":"unchecked"}cg(ez,"getState");var kct=Object.defineProperty,Sct=(e,t)=>kct(e,"name",{value:t,configurable:!0}),Ect="Toggle",Cct=p.forwardRef(Sct(function(t,n){const{pressed:i,defaultPressed:r,onPressedChange:s,...a}=t,[l,c]=td({prop:i,onChange:s,defaultProp:r??!1,caller:Ect});return o.jsx(Fr.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":t.disabled?"":void 0,...a,ref:n,onClick:An(t.onClick,()=>{t.disabled||c(!l)})})},"Toggle")),Tct=Object.defineProperty,ug=(e,t)=>Tct(e,"name",{value:t,configurable:!0}),Xw="ToggleGroup",[pje,acn]=gc(Xw,[Kw]),mje=Kw(),Act=p.forwardRef(ug(function(t,n){const{type:i,...r}=t;if(i==="single"){const s=r;return o.jsx(_ct,{role:"radiogroup",...s,ref:n})}if(i==="multiple"){const s=r;return o.jsx(jct,{role:"toolbar",...s,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${Xw}\``)},"ToggleGroup")),[gje,bje]=pje(Xw),_ct=p.forwardRef(ug(function(t,n){const{value:i,defaultValue:r,onValueChange:s=ug(()=>{},"onValueChange"),...a}=t,[l,c]=td({prop:i,defaultProp:r??"",onChange:s,caller:Xw});return o.jsx(gje,{scope:t.__scopeToggleGroup,type:"single",value:p.useMemo(()=>l?[l]:[],[l]),onItemActivate:c,onItemDeactivate:p.useCallback(()=>c(""),[c]),children:o.jsx(yje,{...a,ref:n})})},"ToggleGroupImplSingle")),jct=p.forwardRef(ug(function(t,n){const{value:i,defaultValue:r,onValueChange:s=ug(()=>{},"onValueChange"),...a}=t,[l,c]=td({prop:i,defaultProp:r??[],onChange:s,caller:Xw}),u=p.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=p.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return o.jsx(gje,{scope:t.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:u,onItemDeactivate:d,children:o.jsx(yje,{...a,ref:n})})},"ToggleGroupImplMultiple")),[Nct,Rct]=pje(Xw),yje=p.forwardRef(ug(function(t,n){const{__scopeToggleGroup:i,disabled:r=!1,rovingFocus:s=!0,orientation:a,dir:l,loop:c=!0,...u}=t,d=mje(i),f=IC(l),h={dir:f,...u};return o.jsx(Nct,{scope:i,rovingFocus:s,disabled:r,children:s?o.jsx(BQ,{asChild:!0,...d,orientation:a,dir:f,loop:c,children:o.jsx(Fr.div,{...h,ref:n})}):o.jsx(Fr.div,{...h,ref:n})})},"ToggleGroupImpl")),DF="ToggleGroupItem",Ict=p.forwardRef(ug(function(t,n){const i=bje(DF,t.__scopeToggleGroup),r=Rct(DF,t.__scopeToggleGroup),s=mje(t.__scopeToggleGroup),a=i.value.includes(t.value),l=r.disabled||t.disabled,c={...t,pressed:a,disabled:l},u=p.useRef(null);return r.rovingFocus?o.jsx(UQ,{asChild:!0,...s,focusable:!l,active:a,ref:u,children:o.jsx(jZ,{...c,ref:n})}):o.jsx(jZ,{...c,ref:n})},"ToggleGroupItem")),jZ=p.forwardRef(ug(function(t,n){const{__scopeToggleGroup:i,value:r,...s}=t,a=bje(DF,i),l={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},c=a.type==="single"?l:void 0;return o.jsx(Cct,{...c,...s,ref:n,onPressedChange:u=>{u?a.onItemActivate(r):a.onItemDeactivate(r)}})},"ToggleGroupItemImpl")),Pct=Object.defineProperty,ya=(e,t)=>Pct(e,"name",{value:t,configurable:!0}),[tz,lcn]=gc("Tooltip",[Ww]),nz=Ww(),Dct="TooltipProvider",Mct=700,MF="tooltip.open",[Lct,iz]=tz(Dct),$ct=ya(e=>{const{__scopeTooltip:t,delayDuration:n=Mct,skipDelayDuration:i=300,disableHoverableContent:r=!1,children:s}=e,a=p.useRef(!0),l=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),o.jsx(Lct,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),a.current=!1)},[i]),onClose:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,i))},[i]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(u=>{l.current=u},[]),disableHoverableContent:r,children:s})},"TooltipProvider"),LF="Tooltip",[Fct,MC]=tz(LF),Bct=ya(e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:r,onOpenChange:s,disableHoverableContent:a,delayDuration:l}=e,c=iz(LF,e.__scopeTooltip),u=nz(t),[d,f]=p.useState(null),[h,m]=p.useState(void 0),g=lg(),b=p.useRef(0),v=a??c.disableHoverableContent,y=l??c.delayDuration,w=p.useRef(!1),[x,O]=td({prop:i,defaultProp:r??!1,onChange:ya(A=>{A?(c.onOpen(),document.dispatchEvent(new CustomEvent(MF))):c.onClose(),s==null||s(A)},"onChange"),caller:LF}),S=p.useMemo(()=>x?w.current?"delayed-open":"instant-open":"closed",[x]),k=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,w.current=!1,O(!0)},[O]),C=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,O(!1)},[O]),E=p.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{w.current=!0,O(!0),b.current=0},y)},[y,O]);p.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const R=h??g;return o.jsx(kP,{...u,children:o.jsx(Fct,{scope:t,contentId:R,setContentId:m,open:x,stateAttribute:S,trigger:d,onTriggerChange:f,onTriggerEnter:p.useCallback(()=>{c.isOpenDelayedRef.current?E():k()},[c.isOpenDelayedRef,E,k]),onTriggerLeave:p.useCallback(()=>{v?C():(window.clearTimeout(b.current),b.current=0)},[C,v]),onOpen:k,onClose:C,disableHoverableContent:v,children:n})})},"Tooltip"),NZ="TooltipTrigger",Uct=p.forwardRef(ya(function(t,n){const{__scopeTooltip:i,...r}=t,s=MC(NZ,i),a=iz(NZ,i),l=nz(i),c=p.useRef(null),u=fr(n,c,s.onTriggerChange),d=p.useRef(!1),f=p.useRef(!1),h=p.useCallback(()=>d.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),o.jsx(MQ,{asChild:!0,...l,children:o.jsx(Fr.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:u,onPointerMove:An(t.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:An(t.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:An(t.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:An(t.onFocus,()=>{d.current||s.onOpen()}),onBlur:An(t.onBlur,s.onClose),onClick:An(t.onClick,s.onClose)})})},"TooltipTrigger")),vje="TooltipPortal",[Qct,zct]=tz(vje,{forceMount:void 0}),Vct=ya(e=>{const{__scopeTooltip:t,forceMount:n,children:i,container:r}=e,s=MC(vje,t);return o.jsx(Qct,{scope:t,forceMount:n,children:o.jsx(qf,{present:n||s.open,children:o.jsx(jQ,{asChild:!0,container:r,children:i})})})},"TooltipPortal"),rE="TooltipContent",Hct=p.forwardRef(ya(function(t,n){const i=zct(rE,t.__scopeTooltip),{forceMount:r=i.forceMount,side:s="top",...a}=t,l=MC(rE,t.__scopeTooltip);return o.jsx(qf,{present:r||l.open,children:l.disableHoverableContent?o.jsx(xje,{side:s,...a,ref:n}):o.jsx(qct,{side:s,...a,ref:n})})},"TooltipContent")),qct=p.forwardRef(ya(function(t,n){const i=MC(rE,t.__scopeTooltip),r=iz(rE,t.__scopeTooltip),s=p.useRef(null),a=fr(n,s),[l,c]=p.useState(null),{trigger:u,onClose:d}=i,f=s.current,{onPointerInTransitChange:h}=r,m=p.useCallback(()=>{c(null),h(!1)},[h]),g=p.useCallback((b,v)=>{const y=b.currentTarget,w={x:b.clientX,y:b.clientY},x=wje(w,y.getBoundingClientRect()),O=Oje(w,x),S=kje(v.getBoundingClientRect()),k=Eje([...O,...S]);c(k),h(!0)},[h]);return p.useEffect(()=>()=>m(),[m]),p.useEffect(()=>{if(u&&f){const b=ya(y=>g(y,f),"handleTriggerLeave"),v=ya(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,m]),p.useEffect(()=>{if(l){const b=ya(v=>{const y=v.target,w={x:v.clientX,y:v.clientY},x=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),O=!Sje(w,l);x?m():O&&(m(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,l,d,m]),o.jsx(xje,{...t,ref:a})},"TooltipContentHoverable")),Wct=RAe("TooltipContent"),xje=p.forwardRef(ya(function(t,n){const{__scopeTooltip:i,children:r,"aria-label":s,id:a,onEscapeKeyDown:l,onPointerDownOutside:c,...u}=t,d=MC(rE,i),f=nz(i),{onClose:h}=d;p.useEffect(()=>(document.addEventListener(MF,h),()=>document.removeEventListener(MF,h)),[h]),p.useEffect(()=>{if(d.trigger){const g=ya(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:m}=d;return qu(()=>(m(a),()=>{m(void 0)}),[a,m]),o.jsx(TQ,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:h,children:o.jsxs(LQ,{"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(Wct,{children:r}),s?o.jsx(xst,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function wje(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")}}ya(wje,"getExitSideFromRect");function Oje(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}ya(Oje,"getPaddedExitPoints");function kje(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}]}ya(kje,"getPointsFromRect");function Sje(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}ya(Sje,"isPointInPolygon");function Eje(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),Cje(t)}ya(Eje,"getHull");function Cje(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)}ya(Cje,"getHullPresorted");var Kct=$ct,Gct=Bct,Tje=Uct,Xct=Vct,Yct=Hct;function dg(e){const t=p.useRef(e);return t.current=e,t}let tw=[],H2=!1;const RZ=e=>{var t,n;if(e.key==="Escape"){const[i]=tw;i&&(e.preventDefault(),(n=(t=i.callback).current)==null||n.call(t))}},Aje=()=>{tw.length>0&&!H2?(document.body.addEventListener("keydown",RZ),H2=!0):tw.length===0&&H2&&(document.body.removeEventListener("keydown",RZ),H2=!1)},Zct=e=>{tw.unshift(e),Aje()},Jct=({id:e})=>{tw=tw.filter(t=>t.id!==e),Aje()},LC=(e,t)=>{const n=p.useId(),i=dg(t);p.useEffect(()=>{if(!e)return;const r={id:n,callback:i};return Zct(r),()=>Jct(r)},[n,e,i])},eut=p.createContext(null);function _je(){const e=p.useContext(eut);return(e==null?void 0:e.linkComponent)??"a"}function $C(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const tut=()=>CAe,IZ=(e,t=!1,n="TransitionGroup")=>{const i=[];return p.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},U0=()=>{},Q0=e=>{const t=p.useRef(e);return t.current=e,p.useCallback(n=>t.current(n),[])};function nut(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 iut(e,t,n){if((CAe||tst)&&t&&n>1)throw new Error(`Cannot use forwardRef with multiple children in <${e} />`)}const rut="_TransitionGroupChild_1hv1z_1",sut={TransitionGroupChild:rut},jje={enter:!1,enterActive:!1,exit:!1,exitActive:!1,interrupted:!1},out=e=>({...jje,enter:!e}),aut=(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 jje}},lut=({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:m,onExit:g,onExitActive:b,onExitComplete:v})=>{const[y,w]=p.useReducer(aut,out(a||!1)),x=p.useRef(!1),O=p.useRef(null),S=p.useRef(c);S.current=c;const k=p.useRef(u);k.current=u;const C=p.useRef(null),E=p.useCallback(R=>{const A=O.current;if(!(!A||R===C.current))switch(C.current=R,R){case"enter":f(A);break;case"enter-active":h(A);break;case"enter-complete":m(A);break;case"exit":g(A);break;case"exit-active":b(A);break;case"exit-complete":v(A);break}},[f,h,m,g,b,v]);return yi.useLayoutEffect(()=>{if(!l){let j;w({type:"exit-before"}),E("exit");const T=DN(()=>{w({type:"exit-active"}),E("exit-active"),j=window.setTimeout(()=>{E("exit-complete"),d()},k.current)});return()=>{T(),j!==void 0&&clearTimeout(j)}}if(a&&!x.current){x.current=!0;return}let R;w({type:"enter-before"}),E("enter");const A=DN(()=>{w({type:"enter-active"}),E("enter-active"),R=window.setTimeout(()=>{w({type:"done"}),E("enter-complete")},S.current)});return()=>{A(),R!==void 0&&clearTimeout(R)}},[l,a,d,E]),p.useEffect(()=>()=>{x.current=!1},[]),o.jsx(t,{ref:$C([O,e]),className:Ti(i,sut.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})},cut=e=>{const{enterMountDelay:t,preventMountTransition:n}=e,i=!n&&t!=null?t:null,[r,s]=p.useState(i==null);return wQ(()=>s(!0),r?null:i),r?o.jsx(lut,{...e}):null},Yw=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=tut()}=e,m=Q0(e.onEnter??U0),g=Q0(e.onEnterActive??U0),b=Q0(e.onEnterComplete??U0),v=Q0(e.onExit??U0),y=Q0(e.onExitActive??U0),w=Q0(e.onExitComplete??U0);p.Children.forEach(i,k=>{if(k&&!k.key)throw new Error("Child elements of must include a `key`")});const x=p.useCallback(k=>({component:k,shouldRender:!0,removeChild:()=>{S(C=>C.filter(E=>k.key!==E.component.key))},onEnter:m,onEnterActive:g,onEnterComplete:b,onExit:v,onExitActive:y,onExitComplete:w}),[m,g,b,v,y,w]),[O,S]=p.useState(()=>IZ(i).map(k=>({...x(k),preventMountTransition:u})));return p.useLayoutEffect(()=>{S(k=>{const C=IZ(i);return nut(C,k,x,f)})},[i,f,x]),iut("TransitionGroup",t,p.Children.count(i)),h?o.jsx(o.Fragment,{children:p.Children.map(i,k=>o.jsx(n,{ref:t,className:r,style:a,"data-transition-id":s,children:k}))}):o.jsx(o.Fragment,{children:O.map(({component:k,...C})=>o.jsx(cut,{...C,as:n,className:r,transitionId:s,enterDuration:l,exitDuration:c,enterMountDelay:d,style:a,ref:t,children:k},k.key))})},uut="_Button_1864l_1",dut="_ButtonInner_1864l_4",fut="_ButtonLoader_1864l_749",vL={Button:uut,ButtonInner:dut,ButtonLoader:fut},It=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:m,className:g,onClick:b,disabled:v,disabledTone:y,inert:w=u,...x}=e,O=v||w,S=p.useCallback(k=>{v||b==null||b(k)},[b,v]);return o.jsxs("button",{type:t,className:Ti(vL.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:OQ,disabled:O,"aria-disabled":O,tabIndex:O?-1:void 0,"data-disabled":v?"":void 0,"data-disabled-tone":v?y:void 0,onClick:S,...x,children:[o.jsx(Yw,{className:vL.ButtonLoader,enterDuration:250,exitDuration:150,children:u&&o.jsx(NC,{},"loader")}),o.jsx("span",{className:vL.ButtonInner,children:xQ(m)})]})},hut=()=>{var e;return typeof ClipboardItem<"u"&&!!((e=navigator.clipboard)!=null&&e.write)};function put(e){const{"text/plain":t,...n}=e;return new ClipboardItem({...n,...t?{"text/plain":new Blob([t],{type:"text/plain"})}:null})}async function mut(e,t=document.body){if(typeof e=="string")return PZ(e,t);try{return hut()?(await navigator.clipboard.write([put(e)]),!0):e["text/plain"]?PZ(e["text/plain"],t):!1}catch{return!1}}async function PZ(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 gut="_TransitionItem_1o7b1_1",but={TransitionItem:gut},yut=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}=kut(e);return o.jsx(t,{className:Ti("block",l==="absolute"&&"relative",n),"data-transition-position":l,style:d,children:o.jsx(Yw,{as:t,className:Ti(but.TransitionItem,a),enterDuration:c,exitDuration:u,insertMethod:s,preventInitialTransition:r,children:i})})},vut=400,xut=500,wut=200,Out=300;function kut({initial:e,enter:t,exit:n,forceCompositeLayer:i}){const r=lL(e),s=lL(t),a=lL(n),l=[r,a,s].some(b=>b!=="none"),c=(t==null?void 0:t.duration)??(l?xut:vut),u=(t==null?void 0:t.timingFunction)??(l?"var(--cubic-enter)":"ease"),d=(n==null?void 0:n.duration)??(l?Out:wut),f=(n==null?void 0:n.timingFunction)??(l?"var(--cubic-exit)":"ease"),h=Ky({"tg-will-change":i?"transform, opacity":"auto","tg-enter-opacity":aL((t==null?void 0:t.opacity)??1),"tg-enter-transform":s,"tg-enter-filter":cL(t),"tg-enter-duration":L2(c),"tg-enter-delay":L2((t==null?void 0:t.delay)??0),"tg-enter-timing-function":u,"tg-exit-opacity":aL((n==null?void 0:n.opacity)??0),"tg-exit-transform":a,"tg-exit-filter":cL(n),"tg-exit-duration":L2(d),"tg-exit-delay":L2((n==null?void 0:n.delay)??0),"tg-exit-timing-function":f,"tg-initial-opacity":aL((e==null?void 0:e.opacity)??(n==null?void 0:n.opacity)??0),"tg-initial-transform":r==="none"?a:r,"tg-initial-filter":cL(e??n??{})}),m=((t==null?void 0:t.delay)??0)+c,g=((n==null?void 0:n.delay)??0)+d;return{enterTotalDuration:m,exitTotalDuration:g,variables:h}}const rz=({children:e,copyValue:t,onClick:n,...i})=>{const[r,s]=p.useState(!1),a=p.useRef(null),l=c=>{r||(s(!0),n==null||n(c),mut(typeof t=="function"?t():t),a.current=window.setTimeout(()=>{s(!1)},1300))};return p.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]),o.jsxs(It,{...i,onClick:l,children:[o.jsx(yut,{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(YS,{},"copied-icon"):o.jsx(eAe,{},"copy-icon")}),typeof e=="function"?e({copied:r}):e]})},Sut="_Menu_1t4b0_1",Eut="_MenuList_1t4b0_3",Cut="_MenuItemContent_1t4b0_53",Tut="_MenuItem_1t4b0_53",Aut="_ItemActions_1t4b0_98",_ut="_PressableInner_1t4b0_117",jut="_Separator_1t4b0_135",Nut="_SubMenuItem_1t4b0_139",Rut="_SubTriggerIcon_1t4b0_141",Iut="_RadioItem_1t4b0_151",Put="_RadioIndicatorActive_1t4b0_158",Dut="_RadioIndicator_1t4b0_158",Mut="_CheckboxItem_1t4b0_249",Lut="_CheckboxIndicator_1t4b0_256",$ut="_CheckboxCircle_1t4b0_269",hs={Menu:Sut,MenuList:Eut,MenuItemContent:Cut,MenuItem:Tut,ItemActions:Aut,PressableInner:_ut,Separator:jut,SubMenuItem:Nut,SubTriggerIcon:Rut,RadioItem:Iut,RadioIndicatorActive:Put,RadioIndicator:Dut,CheckboxItem:Mut,CheckboxIndicator:Lut,CheckboxCircle:$ut},Nje=p.createContext(null),FC=()=>{const e=p.useContext(Nje);if(!e)throw new Error("Menu components must be wrapped in ");return e},Lr=({children:e,forceOpen:t,onOpen:n,onClose:i,modal:r=!1})=>{const[s,a]=p.useState(!1),l=t??s,c=dg(n),u=dg(i),d=p.useCallback(h=>{var m,g;a(h),h?(m=c.current)==null||m.call(c):(g=u.current)==null||g.call(u)},[c,u]);LC(s,()=>{d(!1)});const f=p.useMemo(()=>({open:l,setOpen:d}),[l,d]);return o.jsx(Nje.Provider,{value:f,children:o.jsx(Elt,{open:l,onOpenChange:d,modal:r,children:e})})},Fut=({className:e,children:t,disabled:n,onSelect:i,onClick:r})=>{const{open:s}=FC(),a=l=>{s||l.preventDefault()};return i?o.jsx(Y_e,{className:Ti(hs.MenuItem,e),onSelect:i,onClick:r,disabled:n,onPointerMove:a,onPointerLeave:a,children:o.jsx("div",{className:hs.PressableInner,children:t})}):o.jsx("div",{className:Ti(hs.MenuItemContent,e),children:t})},But=({className:e,children:t})=>o.jsx("div",{className:Ti(hs.ItemActions,e),children:t}),Uut=({children:e,onClick:t})=>{const{setOpen:n}=FC();return o.jsx(It,{className:"rounded-sm",color:"secondary",size:"xs",uniform:!0,iconSize:"sm",variant:"ghost",onClick:i=>{i.stopPropagation(),n(!1),t(i)},children:e})},Qut=e=>{const{className:t,children:n,href:i,to:r,disabled:s,as:a,...l}=e,{open:c}=FC(),u=i||r,d=u?/^https?:\/\//.test(u):!0,f=_je(),h=a||(d?"a":f),m=b=>{c||b.preventDefault()},g=d?{target:"_blank",rel:"noopener noreferrer",href:i??r}:{href:i,to:r};return o.jsx(Y_e,{asChild:!0,className:Ti(hs.MenuItem,t),disabled:s,onPointerMove:d?void 0:m,onPointerLeave:d?void 0:m,children:o.jsx(h,{...g,...l,children:o.jsx("span",{className:hs.PressableInner,children:n})})})},zut=({className:e})=>o.jsx(Nlt,{className:Ti(hs.Separator,e),role:"separator"}),Vut=({children:e,side:t,sideOffset:n=5,align:i,alignOffset:r,width:s,minWidth:a,maxHeight:l})=>{const{open:c}=FC();return o.jsx(X_e,{forceMount:!0,children:o.jsx(Yw,{className:hs.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:c&&o.jsx(Tlt,{forceMount:!0,className:hs.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:Kh,style:Ky({"menu-width":s,"menu-min-width":a,"menu-max-height":l}),children:e},"dropdown")})})},Hut=({children:e,disabled:t})=>o.jsx(Clt,{asChild:!0,disabled:t,children:e}),Rje=p.createContext(null),Ije=()=>{const e=p.useContext(Rje);if(!e)throw new Error("Submenu components must be wrapped in ");return e},qut=({children:e,forceOpen:t,onOpen:n,onClose:i})=>{const[r,s]=p.useState(!1),a=p.useRef(null),l=t??r,c=dg(n),u=dg(i),d=p.useCallback(h=>{var m,g;s(h),h?(m=c.current)==null||m.call(c):(g=u.current)==null||g.call(u)},[c,u]);LC(r,()=>{var h;d(!1),(h=a.current)==null||h.focus()});const f=p.useMemo(()=>({open:l,setOpen:d,triggerRef:a}),[l,d]);return o.jsx(Rje.Provider,{value:f,children:o.jsx(Rlt,{open:l,onOpenChange:d,children:e})})},Wut=({className:e,children:t,disabled:n})=>{const{open:i}=FC(),{triggerRef:r}=Ije(),s=a=>{i||a.preventDefault()};return o.jsx(Ilt,{ref:r,className:Ti(hs.MenuItem,hs.SubMenuItem,e),disabled:n,onPointerMove:s,onPointerLeave:s,children:o.jsxs("div",{className:hs.PressableInner,children:[t,o.jsx(hit,{width:"16",height:"16",className:hs.SubTriggerIcon})]})})},Kut=({children:e,sideOffset:t=4,alignOffset:n=-6,width:i="auto",minWidth:r="auto",maxHeight:s})=>{const{open:a}=Ije();return o.jsx(X_e,{forceMount:!0,children:o.jsx(Yw,{className:hs.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:a&&o.jsx(Plt,{className:hs.MenuList,sideOffset:t,alignOffset:n,avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:Kh,style:Ky({"menu-width":i,"menu-min-width":r,"menu-max-height":s}),children:e},"submenu")})})},Gut=({children:e,value:t,onChange:n,indicatorPosition:i="end",...r})=>o.jsx(_lt,{...r,value:t,onValueChange:s=>n(s),"data-indicator-position":i,children:e}),Xut=({className:e,children:t,...n})=>o.jsx(jlt,{className:Ti(hs.MenuItem,hs.RadioItem,e),...n,children:o.jsxs("div",{className:hs.PressableInner,children:[o.jsx("div",{className:hs.RadioIndicator,children:o.jsx(Z_e,{className:hs.RadioIndicatorActive})}),t]})}),Yut=({className:e,children:t,indicatorPosition:n="end",indicatorVariant:i="solid",...r})=>o.jsx(Alt,{className:Ti(hs.MenuItem,hs.CheckboxItem,e),...r,"data-indicator-position":n,"data-indicator-variant":i,children:o.jsxs("div",{className:hs.PressableInner,children:[o.jsx("div",{className:hs.CheckboxIndicator,children:o.jsx(Z_e,{children:i==="ghost"?o.jsx(YS,{className:"size-4"}):o.jsx("div",{className:hs.CheckboxCircle,children:o.jsx(YS,{className:"size-4"})})})}),t]})});Lr.Content=Vut;Lr.Item=Fut;Lr.ItemActions=But;Lr.ItemAction=Uut;Lr.Link=Qut;Lr.Separator=zut;Lr.Trigger=Hut;Lr.Sub=qut;Lr.SubTrigger=Wut;Lr.SubContent=Kut;Lr.CheckboxItem=Yut;Lr.RadioGroup=Gut;Lr.RadioItem=Xut;const Zut="_Tooltip_16g2y_1",Jut="_TriggerDecorator_16g2y_73",Pje={Tooltip:Zut,TriggerDecorator:Jut},mo=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:m=5,gutterSize:g="md",contentClassName:b,onPointerDown:v,onClick:y,...w}=e,[x,O]=p.useState(!1),[S,k]=p.useState(!1);wQ(()=>k(!1),S?400:null);const C=r??x,E=A=>{typeof r!="boolean"&&(O(A),u&&k(A))},R=A=>{u&&S&&(A.preventDefault(),A.stopPropagation())};return o.jsxs(Dje,{open:C,delayDuration:a,onOpenChange:E,disableHoverableContent:!l,children:[o.jsx(Tje,{asChild:!0,children:o.jsx(jAe,{...w,ref:t,onPointerDown:A=>{R(A),v==null||v(A)},onClick:A=>{R(A),y==null||y(A)},children:n})}),o.jsx(Mje,{maxWidth:s,compact:c,align:d,alignOffset:f,side:h,sideOffset:m,gutterSize:g,className:b,children:i})]})},Dje=({children:e,open:t,onOpenChange:n,...i})=>(LC(t,()=>{n(!1)}),o.jsx(Kct,{children:o.jsx(Gct,{open:t,onOpenChange:n,...i,children:e})})),Mje=({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(Xct,{children:o.jsx(Yct,{...u,className:Ti(Pje.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:Kh,children:e})}),edt=({children:e,asChild:t=!0,...n})=>o.jsx(Tje,{asChild:t,...n,children:e}),tdt=e=>{const{children:t,className:n,focusable:i=!0,ref:r,...s}=e,a=typeof t=="string";return o.jsx(jAe,{ref:r,...s,className:Ti(Pje.TriggerDecorator,n),tabIndex:i?0:void 0,children:a?o.jsx("span",{children:t}):t})};mo.Root=Dje;mo.Content=Mje;mo.Trigger=edt;mo.TriggerDecorator=tdt;const ndt=50,DZ=48;function idt(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 rdt(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 sdt(e,t,n){const i=Math.max(0,t-DZ),r=Math.min(e.length,t+n+DZ);return(i>0?"…":"")+e.slice(i,r).trim()+(r{var c;if((c=l.events)!=null&&c.length)return l;try{return await qI(t,e,l.id)}catch{return l}})),a=[];for(const l of s)for(const{text:c,role:u,ts:d}of idt(l)){const f=c.toLowerCase().indexOf(i);if(f!==-1){a.push({type:"session",appId:t,sessionId:l.id,title:rdt(l),snippet:sdt(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,ndt)}async function adt(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await tCe(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 ldt(e,t,n,i){if(!t||!i.trim())return{results:[]};const r=await eCe(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 cdt(e,t,n){return e==="session"?{results:await odt(n.userId,n.appId,t)}:e==="web"?adt(n.appId,t):ldt(e,n.appId,n.userId,t)}function Lje({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 udt(e){return o.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:o.jsx(Lje,{})})}function ddt(e){return o.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:o.jsx(Lje,{mirrored:!0})})}function fdt(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 hdt(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 pdt(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 $je(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 Fje(e){return o.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M3.25 2.25h6l3.5 3.5v8H3.25v-11Z"}),o.jsx("path",{d:"M9.25 2.25v3.5h3.5M5.5 8.25h5M5.5 10.75h4"})]})}function mdt({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 gdt({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 bdt({active:e=!1,onClick:t}){const{t:n}=je("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(hdt,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:n("search.nav")})]})}function ydt(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 MN(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 MZ(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 vdt({userId:e,appId:t,agentInfo:n,capabilitiesLoading:i,agentLabel:r,onOpenSession:s}){var L,B;const{t:a,i18n:l}=je("workspaceTools"),c=l.resolvedLanguage||l.language,[u,d]=p.useState("session"),[f,h]=p.useState(""),[m,g]=p.useState([]),[b,v]=p.useState(),[y,w]=p.useState(!1),[x,O]=p.useState(!1),[S,k]=p.useState(!1),C=p.useRef(0),E=p.useRef(null),R=ydt(t,n,i,a),A=R.find(I=>I.id===u),j=u==="knowledge"?(L=n==null?void 0:n.components)==null?void 0:L.find(I=>I.source==="knowledgebase"||I.kind==="knowledgebase"):u==="memory"?(B=n==null?void 0:n.components)==null?void 0:B.find(I=>I.source==="long_term_memory"||I.kind==="memory"):void 0;p.useEffect(()=>{C.current+=1,d("session"),g([]),v(void 0),O(!1),w(!1),k(!1)},[t]),p.useEffect(()=>{if(!S)return;function I(z){var K;(K=E.current)!=null&&K.contains(z.target)||k(!1)}return document.addEventListener("pointerdown",I),()=>document.removeEventListener("pointerdown",I)},[S]);async function T(I,z){var H;const K=I.trim();if(!K||!((H=R.find(X=>X.id===z))!=null&&H.ready))return;const F=++C.current;w(!0),O(!0);let q;try{q=await cdt(z,K,{userId:e,appId:t})}catch(X){const ne=X instanceof Error?X.message:String(X);q={results:[],note:a("search.failed",{message:ne})}}F===C.current&&(g(q.results),v(q.note),w(!1))}function N(I){C.current+=1,h(I),g([]),v(void 0),O(!1),w(!1)}function _(I){C.current+=1,d(I),k(!1),g([]),v(void 0),O(!1),w(!1)}const D=!!(A!=null&&A.ready),M=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"),P=j!=null&&j.backend?MN(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:E,children:[o.jsxs("button",{className:"search-source-picker",type:"button","aria-label":a("search.sourceTypeAria",{label:(A==null?void 0:A.label)??a("search.notSelected")}),"aria-haspopup":"listbox","aria-expanded":S,onClick:()=>k(I=>!I),children:[o.jsx("span",{children:(A==null?void 0:A.label)??a("search.sourceType")}),P&&o.jsx("small",{children:P}),o.jsx(gdt,{open:S})]}),S&&o.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":a("search.selectSource"),children:R.map(I=>{var F,q;const z=I.id==="knowledge"?(F=n==null?void 0:n.components)==null?void 0:F.find(H=>H.source==="knowledgebase"||H.kind==="knowledgebase"):I.id==="memory"?(q=n==null?void 0:n.components)==null?void 0:q.find(H=>H.source==="long_term_memory"||H.kind==="memory"):void 0,K=z?[z.name,z.backend?MN(z.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:()=>_(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=>N(I.target.value),onKeyDown:I=>{I.key==="Enter"&&(I.preventDefault(),T(f,u))},placeholder:M,disabled:!D,autoFocus:!0}),o.jsx("button",{className:"search-go",onClick:()=>void T(f,u),disabled:!f.trim()||y,"aria-label":a("search.nav"),children:y?o.jsx(Mi,{className:"icon spin"}):o.jsx(mdt,{className:"icon"})})]}),o.jsx("div",{className:"search-results",children:D?x?y?null:b?o.jsx("div",{className:"search-empty",children:b}):m.length===0&&x?o.jsx("div",{className:"search-empty",children:a("search.noResults",{query:f.trim()})}):m.map((I,z)=>o.jsx(xdt,{result:I,agentLabel:r,onOpen:s,locale:c},z)):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"):(A==null?void 0:A.unavailableLabel)??a("search.sourceUnavailable"):a("search.noAgentHint")})})]})}function xdt({result:e,agentLabel:t,onOpen:n,locale:i}){const{t:r}=je("workspaceTools");switch(e.type){case"session":return o.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[o.jsx(dAe,{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?` · ${MZ(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(bP,{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(xy,{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(LZ,{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?` · ${MN(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(LZ,{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?` · ${MN(e.sourceType,r)}`:"",e.ts?` · ${MZ(e.ts,i)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function LZ({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 wdt({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 Odt({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 Bje(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 jP="/assets/media/logo-DCsNZy-k.svg",sz="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";function kdt(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.5 4.5H6a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-13a2 2 0 0 0-2-2h-2.5"}),o.jsx("rect",{x:"8.5",y:"2.5",width:"7",height:"4",rx:"1.5"}),o.jsx("path",{d:"m8 13 2.5 2.5L16 10"})]})}const $Z="(max-width: 860px)";function FZ({title:e}){const t=p.useRef(null),n=p.useRef(null),[i,r]=p.useState(0);p.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 Sdt(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 Edt(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 Cdt(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 Tdt={super_admin:"account.roles.super_admin",admin:"account.roles.admin",developer:"account.roles.developer",user:"account.roles.user"};function Adt({activePage:e,access:t,userInfo:n,onAgentKitCli:i,onDeveloperResources:r,onSystemInfo:s,onIssueFeedback:a,onLogout:l}){const{t:c,i18n:u}=je(["sidebar","common"]),[d,f]=p.useState("");if(!n)return null;const h=BYe(n)||c("sidebar:account.defaultUser"),m=typeof n.email=="string"?n.email.trim():"",g=Cdt(h),b=UYe(n),v=b===d?"":b,y=oC(u.resolvedLanguage??u.language)??sC;return o.jsx("div",{className:"sidebar-user",children:o.jsxs("div",{className:"sidebar-user-row",children:[o.jsxs(Lr,{modal:!0,children:[o.jsx(Lr.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(Lr.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(Lo,{color:"secondary",size:"sm",variant:"soft",pill:!0,children:c(`sidebar:${Tdt[t.role]}`)})]}),m&&m!==h&&o.jsx("div",{className:"account-sub",children:m})]})]}),o.jsxs(Lr.Item,{className:"account-menu-action",onSelect:s,children:[o.jsx(Hf,{className:"icon","aria-hidden":"true"}),c("sidebar:account.systemInfo")]}),o.jsxs(Lr.Sub,{children:[o.jsx(Lr.SubTrigger,{className:"account-menu-action",children:o.jsxs("span",{className:"account-menu-action__label",children:[o.jsx(Edt,{className:"icon"}),c("sidebar:account.language")]})}),o.jsx(Lr.SubContent,{sideOffset:6,minWidth:136,children:o.jsx(Lr.RadioGroup,{value:y,onChange:w=>{Jze(w)},indicatorPosition:"end",children:D9.map(w=>o.jsx(Lr.RadioItem,{value:w,children:c(`common:languageNames.${w}`)},w))})})]}),o.jsxs(Lr.Item,{className:"account-menu-action",onSelect:a,children:[o.jsx(Bje,{className:"icon"}),c("sidebar:account.issueFeedback")]}),o.jsxs(Lr.Item,{className:"account-menu-action",onSelect:l,children:[o.jsx(rrt,{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(mo,{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(Oit,{className:"icon"})})}),o.jsx(mo,{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(uit,{className:"icon"})})})]})]})})}function _dt({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:m,onReviewCenter:g,onAddAgent:b,onMyAgents:v,onWorkspace:y,onApplications:w,onCronJobs:x,onAgentKitCli:O,onDeveloperResources:S,onSystemInfo:k,onUserManagement:C,onIssueFeedback:E,onPickSession:R,onDeleteSession:A,userInfo:j,onLogout:T}){const{t:N}=je("sidebar"),_=H=>(s==null?void 0:s[H])!==!1,D=a.role==="admin"||a.role==="super_admin",M=a.capabilities.manageUsers&&!!C,[P,L]=p.useState(null),B=p.useRef(typeof window<"u"&&window.matchMedia($Z).matches),[I,z]=p.useState(B.current),K=n.map(H=>({id:H.id,title:vP(H.events,N("history.newConversation")),createdAt:(H.lastUpdateTime??0)*1e3})).sort((H,X)=>X.createdAt-H.createdAt),F=()=>{B.current=!1,z(H=>!H),L(null)};p.useEffect(()=>{const H=window.matchMedia($Z),X=ne=>{ne.matches?z(Q=>Q||(B.current=!0,!0)):B.current&&(B.current=!1,z(!1))};return H.addEventListener("change",X),()=>H.removeEventListener("change",X)},[]);const q=t==="byteplus"?sz:jP;return o.jsxs("aside",{className:`sidebar ${I?"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":N("navigation.home"),title:N("navigation.home"),children:[o.jsx("img",{className:"brand-logo",src:e.logoUrl||q,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:F,"aria-label":N(I?"navigation.expand":"navigation.collapse"),title:N(I?"navigation.expand":"navigation.collapse"),children:I?o.jsx(ddt,{className:"icon"}):o.jsx(udt,{className:"icon"})})]}),o.jsxs("nav",{className:"sidebar-nav","aria-label":N("navigation.label"),children:[_("newChat")&&o.jsxs("button",{className:`new-chat new-chat--conversation${r==="new-chat"?" is-active":""}`,onClick:d,"aria-label":N("navigation.newChat"),"aria-current":r==="new-chat"?"page":void 0,title:N("navigation.newChat"),children:[o.jsx(fdt,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:N("navigation.newChat")})]}),_("search")&&o.jsx(bdt,{active:r==="search",onClick:f}),o.jsxs("button",{className:`new-chat new-chat--agents${r==="agents"?" is-active":""}`,onClick:v,"aria-label":N("navigation.agents"),"aria-current":r==="agents"?"page":void 0,title:N("navigation.agents"),children:[o.jsx(pdt,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:N("navigation.agents")})]}),o.jsxs("button",{className:`new-chat new-chat--workspaces${r==="workspaces"?" is-active":""}`,onClick:y,"aria-label":N("navigation.workspaces"),"aria-current":r==="workspaces"?"page":void 0,title:N("navigation.workspaces"),children:[o.jsx($it,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:N("navigation.workspaces")})]}),o.jsxs("button",{className:`new-chat new-chat--library${r==="library"?" is-active":""}`,onClick:m,"aria-label":N("navigation.library"),"aria-current":r==="library"?"page":void 0,title:N("navigation.library"),children:[o.jsx($je,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:N("navigation.library")})]}),o.jsxs("button",{className:`new-chat new-chat--cronjobs${r==="cronjobs"?" is-active":""}`,onClick:x,"aria-label":N("navigation.cronjobs"),"aria-current":r==="cronjobs"?"page":void 0,title:N("navigation.cronjobs"),children:[o.jsx(pQ,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:N("navigation.cronjobs")})]}),o.jsxs("button",{className:`new-chat new-chat--applications${r==="applications"?" is-active":""}`,onClick:w,"aria-label":N("navigation.automations"),"aria-current":r==="applications"?"page":void 0,title:N("navigation.automations"),children:[o.jsx(Sdt,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:N("navigation.automations")})]})]}),D||M?o.jsxs("nav",{className:"sidebar-nav sidebar-nav--administration","aria-label":N("navigation.administration"),children:[o.jsx("div",{className:"sidebar-nav-group-title","aria-hidden":"true",children:N("navigation.administration")}),D?o.jsxs("button",{type:"button",className:`new-chat new-chat--review-center${r==="review-center"?" is-active":""}`,onClick:g,"aria-label":N("navigation.reviewCenter"),"aria-current":r==="review-center"?"page":void 0,title:N("navigation.reviewCenter"),children:[o.jsx(kdt,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:N("navigation.reviewCenter")})]}):null,M?o.jsxs("button",{type:"button",className:`new-chat${r==="users"?" is-active":""}`,onClick:C,"aria-label":N("navigation.users"),"aria-current":r==="users"?"page":void 0,title:N("navigation.users"),children:[o.jsx(qrt,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:N("navigation.users")})]}):null]}):null]}),_("history")&&o.jsxs("div",{className:"sidebar-history",children:[o.jsxs("div",{className:"history-head",children:[o.jsx("span",{children:N("history.title")}),_("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":N("history.create"),title:N("history.create"),children:o.jsx(jl,{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:N("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:N("history.empty")}):null,u.threads.map(H=>{const X=H.id===u.currentThreadId,ne=H.name||H.preview||`Thread ${H.id.slice(0,8)}`,Q=H.id===u.busyThreadId;return o.jsxs("div",{className:`history-item ${X?"active":""}`,children:[o.jsxs("button",{type:"button",className:"history-item-btn",onClick:()=>u.onSelect(H.id),"aria-current":X?"page":void 0,title:ne,disabled:Q,children:[o.jsx(FZ,{title:ne}),X?o.jsx("span",{className:"history-current-badge",children:N("history.current")}):null]}),o.jsx("button",{type:"button",className:"history-more","aria-label":N("history.manage",{title:ne}),title:N("history.more"),disabled:Q,onClick:()=>L(Z=>Z===H.id?null:H.id),children:o.jsx(oZ,{className:"icon"})}),P===H.id?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>L(null)}),o.jsx("div",{className:"history-menu",children:o.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{L(null),u.onDelete(H)},children:[o.jsx(ag,{className:"icon"})," ",N("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?N("history.loadingMore"):N("history.loadMore")}):null]}):o.jsxs(o.Fragment,{children:[K.length===0?o.jsx("div",{className:"history-empty",children:N("history.empty")}):null,K.map(H=>{const X=H.id===i,ne=(l==null?void 0:l.has(H.id))===!0,Q=!ne&&(c==null?void 0:c.has(H.id))===!0;return o.jsxs("div",{className:`history-item ${X?"active":""}`,children:[o.jsxs("button",{className:"history-item-btn",onClick:()=>R(H.id),"aria-current":X?"page":void 0,title:H.title,children:[o.jsx(FZ,{title:H.title}),Q&&o.jsxs("span",{className:"history-evaluating-status",title:N("history.evaluatingTitle"),children:[o.jsx("span",{className:"history-evaluating","aria-hidden":"true"}),N("history.evaluating")]})]}),o.jsxs("div",{className:"history-action-slot",children:[ne?o.jsx(NC,{className:"history-streaming-indicator",size:12,role:"status","aria-label":N("history.generating")}):null,o.jsx("button",{type:"button",className:"history-more","aria-label":N("history.manage",{title:H.title}),title:N("history.more"),onClick:()=>L(Z=>Z===H.id?null:H.id),children:o.jsx(oZ,{className:"icon"})})]}),P===H.id&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>L(null)}),o.jsx("div",{className:"history-menu",children:o.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{L(null),A(H.id)},children:[o.jsx(ag,{className:"icon"})," ",N("history.delete")]})})]})]},H.id)})]})})]}),o.jsx("div",{className:"sidebar-footer",children:o.jsx(Adt,{activePage:r,access:a,userInfo:j,onAgentKitCli:O,onDeveloperResources:S,onSystemInfo:k,onIssueFeedback:E,onLogout:T})})]})}function Fo(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n{}};function NP(){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}})}Y_.prototype=NP.prototype={constructor:Y_,on:function(e,t){var n=this._,i=Ndt(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)),UZ.hasOwnProperty(t)?{space:UZ[t],local:e}:e}function Idt(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===$F&&t.documentElement.namespaceURI===$F?t.createElement(e):t.createElementNS(n,e)}}function Pdt(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Uje(e){var t=RP(e);return(t.local?Pdt:Idt)(t)}function Ddt(){}function oz(e){return e==null?Ddt:function(){return this.querySelector(e)}}function Mdt(e){typeof e!="function"&&(e=oz(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r=x&&(x=w+1);!(S=v[x])&&++x=0;)(a=i[r])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function aft(e){e||(e=lft);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 cft(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function uft(){return Array.from(this)}function dft(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?Oft:typeof t=="function"?Sft:kft)(e,t,n??"")):nw(this.node(),e)}function nw(e,t){return e.style.getPropertyValue(t)||qje(e).getComputedStyle(e,null).getPropertyValue(t)}function Cft(e){return function(){delete this[e]}}function Tft(e,t){return function(){this[e]=t}}function Aft(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function _ft(e,t){return arguments.length>1?this.each((t==null?Cft:typeof t=="function"?Aft:Tft)(e,t)):this.node()[e]}function Wje(e){return e.trim().split(/^|\s+/)}function az(e){return e.classList||new Kje(e)}function Kje(e){this._node=e,this._names=Wje(e.getAttribute("class")||"")}Kje.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 Gje(e,t){for(var n=az(e),i=-1,r=t.length;++i=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function iht(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,s;n()=>e;function FF(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}})}FF.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function hht(e){return!e.ctrlKey&&!e.button}function pht(){return this.parentNode}function mht(e,t){return t??{x:e.x,y:e.y}}function ght(){return navigator.maxTouchPoints||"ontouchstart"in this}function tNe(){var e=hht,t=pht,n=mht,i=ght,r={},s=NP("start","drag","end"),a=0,l,c,u,d,f=0;function h(O){O.on("mousedown.drag",m).filter(i).on("touchstart.drag",v).on("touchmove.drag",y,fht).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(O,S){if(!(d||!e.call(this,O,S))){var k=x(this,t.call(this,O,S),O,S,"mouse");k&&(Wc(O.view).on("mousemove.drag",g,sE).on("mouseup.drag",b,sE),Jje(O.view),xL(O),u=!1,l=O.clientX,c=O.clientY,k("start",O))}}function g(O){if(ux(O),!u){var S=O.clientX-l,k=O.clientY-c;u=S*S+k*k>f}r.mouse("drag",O)}function b(O){Wc(O.view).on("mousemove.drag mouseup.drag",null),eNe(O.view,u),ux(O),r.mouse("end",O)}function v(O,S){if(e.call(this,O,S)){var k=O.changedTouches,C=t.call(this,O,S),E=k.length,R,A;for(R=0;R>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?W2(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?W2(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=yht.exec(e))?new rc(t[1],t[2],t[3],1):(t=vht.exec(e))?new rc(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=xht.exec(e))?W2(t[1],t[2],t[3],t[4]):(t=wht.exec(e))?W2(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Oht.exec(e))?KZ(t[1],t[2]/100,t[3]/100,1):(t=kht.exec(e))?KZ(t[1],t[2]/100,t[3]/100,t[4]):QZ.hasOwnProperty(e)?HZ(QZ[e]):e==="transparent"?new rc(NaN,NaN,NaN,0):null}function HZ(e){return new rc(e>>16&255,e>>8&255,e&255,1)}function W2(e,t,n,i){return i<=0&&(e=t=n=NaN),new rc(e,t,n,i)}function Cht(e){return e instanceof UC||(e=Oy(e)),e?(e=e.rgb(),new rc(e.r,e.g,e.b,e.opacity)):new rc}function BF(e,t,n,i){return arguments.length===1?Cht(e):new rc(e,t,n,i??1)}function rc(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}lz(rc,BF,nNe(UC,{brighter(e){return e=e==null?$N:Math.pow($N,e),new rc(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?oE:Math.pow(oE,e),new rc(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new rc(ny(this.r),ny(this.g),ny(this.b),FN(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:qZ,formatHex:qZ,formatHex8:Tht,formatRgb:WZ,toString:WZ}));function qZ(){return`#${Mb(this.r)}${Mb(this.g)}${Mb(this.b)}`}function Tht(){return`#${Mb(this.r)}${Mb(this.g)}${Mb(this.b)}${Mb((isNaN(this.opacity)?1:this.opacity)*255)}`}function WZ(){const e=FN(this.opacity);return`${e===1?"rgb(":"rgba("}${ny(this.r)}, ${ny(this.g)}, ${ny(this.b)}${e===1?")":`, ${e})`}`}function FN(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ny(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Mb(e){return e=ny(e),(e<16?"0":"")+e.toString(16)}function KZ(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new kd(e,t,n,i)}function iNe(e){if(e instanceof kd)return new kd(e.h,e.s,e.l,e.opacity);if(e instanceof UC||(e=Oy(e)),!e)return new kd;if(e instanceof kd)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 kd(a,l,c,e.opacity)}function Aht(e,t,n,i){return arguments.length===1?iNe(e):new kd(e,t,n,i??1)}function kd(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}lz(kd,Aht,nNe(UC,{brighter(e){return e=e==null?$N:Math.pow($N,e),new kd(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?oE:Math.pow(oE,e),new kd(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 rc(wL(e>=240?e-240:e+120,r,i),wL(e,r,i),wL(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new kd(GZ(this.h),K2(this.s),K2(this.l),FN(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=FN(this.opacity);return`${e===1?"hsl(":"hsla("}${GZ(this.h)}, ${K2(this.s)*100}%, ${K2(this.l)*100}%${e===1?")":`, ${e})`}`}}));function GZ(e){return e=(e||0)%360,e<0?e+360:e}function K2(e){return Math.max(0,Math.min(1,e||0))}function wL(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 IP=e=>()=>e;function rNe(e,t){return function(n){return e+n*t}}function _ht(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 ccn(e,t){var n=t-e;return n?rNe(e,n>180||n<-180?n-360*Math.round(n/360):n):IP(isNaN(e)?t:e)}function jht(e){return(e=+e)==1?sNe:function(t,n){return n-t?_ht(t,n,e):IP(isNaN(t)?n:t)}}function sNe(e,t){var n=t-e;return n?rNe(e,n):IP(isNaN(e)?t:e)}const BN=function e(t){var n=jht(t);function i(r,s){var a=n((r=BF(r)).r,(s=BF(s)).r),l=n(r.g,s.g),c=n(r.b,s.b),u=sNe(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 Nht(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:ff(i,r)})),n=OL.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(r(f)+"rotate(",null,i)-2,x:ff(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:ff(u,d)}):d&&f.push(r(f)+"skewX("+d+i)}function c(u,d,f,h,m,g){if(u!==f||d!==h){var b=m.push(r(m)+"scale(",null,",",null,")");g.push({i:b-4,x:ff(u,f)},{i:b-2,x:ff(d,h)})}else(f!==1||h!==1)&&m.push(r(m)+"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(m){for(var g=-1,b=h.length,v;++g=0&&e._call.call(void 0,t),e=e._next;--iw}function ZZ(){ky=(QN=lE.now())+PP,iw=ek=0;try{qht()}finally{iw=0,Kht(),ky=0}}function Wht(){var e=lE.now(),t=e-QN;t>cNe&&(PP-=t,QN=e)}function Kht(){for(var e,t=UN,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:UN=n);tk=e,zF(i)}function zF(e){if(!iw){ek&&(ek=clearTimeout(ek));var t=e-ky;t>24?(e<1/0&&(ek=setTimeout(ZZ,e-lE.now()-PP)),cO&&(cO=clearInterval(cO))):(cO||(QN=lE.now(),cO=setInterval(Wht,cNe)),iw=1,uNe(ZZ))}}function JZ(e,t,n){var i=new zN;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var Ght=NP("start","end","cancel","interrupt"),Xht=[],fNe=0,eJ=1,VF=2,J_=3,tJ=4,HF=5,ej=6;function DP(e,t,n,i,r,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;Yht(e,n,{name:t,index:i,group:r,on:Ght,tween:Xht,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:fNe})}function uz(e,t){var n=Qd(e,t);if(n.state>fNe)throw new Error("too late; already scheduled");return n}function Wf(e,t){var n=Qd(e,t);if(n.state>J_)throw new Error("too late; already running");return n}function Qd(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Yht(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=dNe(s,0,n.time);function s(u){n.state=eJ,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var d,f,h,m;if(n.state!==eJ)return c();for(d in i)if(m=i[d],m.name===n.name){if(m.state===J_)return JZ(a);m.state===tJ?(m.state=ej,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete i[d]):+dVF&&i.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function Tpt(e,t,n){var i,r,s=Cpt(t)?uz:Wf;return function(){var a=s(this,e),l=a.on;l!==i&&(r=(i=l).copy()).on(t,n),a.on=r}}function Apt(e,t){var n=this._id;return arguments.length<2?Qd(this.node(),n).on.on(e):this.each(Tpt(n,e,t))}function _pt(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function jpt(){return this.on("end.remove",_pt(this._id))}function Npt(e){var t=this._name,n=this._id;typeof e!="function"&&(e=oz(e));for(var i=this._groups,r=i.length,s=new Array(r),a=0;a()=>e;function nmt(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 $h(e,t,n){this.k=e,this.x=t,this.y=n}$h.prototype={constructor:$h,scale:function(e){return e===1?this:new $h(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new $h(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 MP=new $h(1,0,0);gNe.prototype=$h.prototype;function gNe(e){for(;!e.__zoom;)if(!(e=e.parentNode))return MP;return e.__zoom}function kL(e){e.stopImmediatePropagation()}function uO(e){e.preventDefault(),e.stopImmediatePropagation()}function imt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function rmt(){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 nJ(){return this.__zoom||MP}function smt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function omt(){return navigator.maxTouchPoints||"ontouchstart"in this}function amt(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 bNe(){var e=imt,t=rmt,n=amt,i=smt,r=omt,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Z_,u=NP("start","zoom","end"),d,f,h,m=500,g=150,b=0,v=10;function y(_){_.property("__zoom",nJ).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",A).filter(r).on("touchstart.zoom",j).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(_,D,M,P){var L=_.selection?_.selection():_;L.property("__zoom",nJ),_!==L?S(_,D,M,P):L.interrupt().each(function(){k(this,arguments).event(P).start().zoom(null,typeof D=="function"?D.apply(this,arguments):D).end()})},y.scaleBy=function(_,D,M,P){y.scaleTo(_,function(){var L=this.__zoom.k,B=typeof D=="function"?D.apply(this,arguments):D;return L*B},M,P)},y.scaleTo=function(_,D,M,P){y.transform(_,function(){var L=t.apply(this,arguments),B=this.__zoom,I=M==null?O(L):typeof M=="function"?M.apply(this,arguments):M,z=B.invert(I),K=typeof D=="function"?D.apply(this,arguments):D;return n(x(w(B,K),I,z),L,a)},M,P)},y.translateBy=function(_,D,M,P){y.transform(_,function(){return n(this.__zoom.translate(typeof D=="function"?D.apply(this,arguments):D,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),a)},null,P)},y.translateTo=function(_,D,M,P,L){y.transform(_,function(){var B=t.apply(this,arguments),I=this.__zoom,z=P==null?O(B):typeof P=="function"?P.apply(this,arguments):P;return n(MP.translate(z[0],z[1]).scale(I.k).translate(typeof D=="function"?-D.apply(this,arguments):-D,typeof M=="function"?-M.apply(this,arguments):-M),B,a)},P,L)};function w(_,D){return D=Math.max(s[0],Math.min(s[1],D)),D===_.k?_:new $h(D,_.x,_.y)}function x(_,D,M){var P=D[0]-M[0]*_.k,L=D[1]-M[1]*_.k;return P===_.x&&L===_.y?_:new $h(_.k,P,L)}function O(_){return[(+_[0][0]+ +_[1][0])/2,(+_[0][1]+ +_[1][1])/2]}function S(_,D,M,P){_.on("start.zoom",function(){k(this,arguments).event(P).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(P).end()}).tween("zoom",function(){var L=this,B=arguments,I=k(L,B).event(P),z=t.apply(L,B),K=M==null?O(z):typeof M=="function"?M.apply(L,B):M,F=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),q=L.__zoom,H=typeof D=="function"?D.apply(L,B):D,X=c(q.invert(K).concat(F/q.k),H.invert(K).concat(F/H.k));return function(ne){if(ne===1)ne=H;else{var Q=X(ne),Z=F/Q[2];ne=new $h(Z,K[0]-Q[0]*Z,K[1]-Q[1]*Z)}I.zoom(null,ne)}})}function k(_,D,M){return!M&&_.__zooming||new C(_,D)}function C(_,D){this.that=_,this.args=D,this.active=0,this.sourceEvent=null,this.extent=t.apply(_,D),this.taps=0}C.prototype={event:function(_){return _&&(this.sourceEvent=_),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(_,D){return this.mouse&&_!=="mouse"&&(this.mouse[1]=D.invert(this.mouse[0])),this.touch0&&_!=="touch"&&(this.touch0[1]=D.invert(this.touch0[0])),this.touch1&&_!=="touch"&&(this.touch1[1]=D.invert(this.touch1[0])),this.that.__zoom=D,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(_){var D=Wc(this.that).datum();u.call(_,this.that,new nmt(_,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),D)}};function E(_,...D){if(!e.apply(this,arguments))return;var M=k(this,D).event(_),P=this.__zoom,L=Math.max(s[0],Math.min(s[1],P.k*Math.pow(2,i.apply(this,arguments)))),B=vd(_);if(M.wheel)(M.mouse[0][0]!==B[0]||M.mouse[0][1]!==B[1])&&(M.mouse[1]=P.invert(M.mouse[0]=B)),clearTimeout(M.wheel);else{if(P.k===L)return;M.mouse=[B,P.invert(B)],tj(this),M.start()}uO(_),M.wheel=setTimeout(I,g),M.zoom("mouse",n(x(w(P,L),M.mouse[0],M.mouse[1]),M.extent,a));function I(){M.wheel=null,M.end()}}function R(_,...D){if(h||!e.apply(this,arguments))return;var M=_.currentTarget,P=k(this,D,!0).event(_),L=Wc(_.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",F,!0),B=vd(_,M),I=_.clientX,z=_.clientY;Jje(_.view),kL(_),P.mouse=[B,this.__zoom.invert(B)],tj(this),P.start();function K(q){if(uO(q),!P.moved){var H=q.clientX-I,X=q.clientY-z;P.moved=H*H+X*X>b}P.event(q).zoom("mouse",n(x(P.that.__zoom,P.mouse[0]=vd(q,M),P.mouse[1]),P.extent,a))}function F(q){L.on("mousemove.zoom mouseup.zoom",null),eNe(q.view,P.moved),uO(q),P.event(q).end()}}function A(_,...D){if(e.apply(this,arguments)){var M=this.__zoom,P=vd(_.changedTouches?_.changedTouches[0]:_,this),L=M.invert(P),B=M.k*(_.shiftKey?.5:2),I=n(x(w(M,B),P,L),t.apply(this,D),a);uO(_),l>0?Wc(this).transition().duration(l).call(S,I,P,_):Wc(this).call(y.transform,I,P,_)}}function j(_,...D){if(e.apply(this,arguments)){var M=_.touches,P=M.length,L=k(this,D,_.changedTouches.length===P).event(_),B,I,z,K;for(kL(_),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.`},cE=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],yNe=["Enter"," ","Escape"],vNe={"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 rw;(function(e){e.Strict="strict",e.Loose="loose"})(rw||(rw={}));var iy;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(iy||(iy={}));var uE;(function(e){e.Partial="partial",e.Full="full"})(uE||(uE={}));const xNe={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var bm;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(bm||(bm={}));var dE;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(dE||(dE={}));var fn;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(fn||(fn={}));const iJ={[fn.Left]:fn.Right,[fn.Right]:fn.Left,[fn.Top]:fn.Bottom,[fn.Bottom]:fn.Top};function wNe(e){return e===null?null:e?"valid":"invalid"}const ONe=e=>"id"in e&&"source"in e&&"target"in e,lmt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),fz=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),QC=(e,t=[0,0])=>{const{width:n,height:i}=Tp(e),r=e.origin??t,s=n*r[0],a=i*r[1];return{x:e.position.x-s,y:e.position.y-a}},cmt=(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):fz(r)?r:t.nodeLookup.get(r.id));const l=a?VN(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return LP(i,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return $P(n)},zC=(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=LP(n,VN(r)),i=!0)}),i?$P(n):{x:0,y:0,width:0,height:0}},hz=(e,t,[n,i,r]=[0,0,1],s=!1,a=!1)=>{const l={...Zw(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 m=d.width??u.width??u.initialWidth??null,g=d.height??u.height??u.initialHeight??null,b=fE(l,ow(u)),v=(m??0)*(g??0),y=s&&b>0;(!u.internals.handleBounds||y||b>=v||u.dragging)&&c.push(u)}return c},umt=(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 dmt(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 fmt({nodes:e,width:t,height:n,panZoom:i,minZoom:r,maxZoom:s},a){if(e.size===0)return!0;const l=dmt(e,a),c=zC(l),u=mz(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 kNe({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",Md.error005());else{const m=l.measured.width,g=l.measured.height;m&&g&&(f=[[c,u],[c+m,u+g]])}else l&&Ey(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=Ey(f)?Sy(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(s==null||s("015",Md.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 hmt({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 m=s.has(h.id),g=!m&&h.parentId&&a.find(b=>b.id===h.parentId);(m||g)&&a.push(h)}const l=new Set(t.map(h=>h.id)),c=i.filter(h=>h.deletable!==!1),d=umt(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 sw=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Sy=(e={x:0,y:0},t,n)=>({x:sw(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:sw(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function SNe(e,t,n){const{width:i,height:r}=Tp(n),{x:s,y:a}=n.internals.positionAbsolute;return Sy(e,[[s,a],[s+i,a+r]],t)}const rJ=(e,t,n)=>en?-sw(Math.abs(e-n),1,t)/t:0,pz=(e,t,n=15,i=40)=>{const r=rJ(e.x,i,t.width-i)*n,s=rJ(e.y,i,t.height-i)*n;return[r,s]},LP=(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)}),qF=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),$P=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),ow=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=fz(e)?e.internals.positionAbsolute:QC(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}},VN=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=fz(e)?e.internals.positionAbsolute:QC(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)}},ENe=(e,t)=>$P(LP(qF(e),qF(t))),fE=(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)},sJ=e=>Ed(e.width)&&Ed(e.height)&&Ed(e.x)&&Ed(e.y),Ed=e=>!isNaN(e)&&isFinite(e),CNe=(e,t)=>(n,i)=>{},VC=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Zw=({x:e,y:t},[n,i,r],s=!1,a=[1,1])=>{const l={x:(e-n)/r,y:(t-i)/r};return s?VC(l,a):l},aw=({x:e,y:t},[n,i,r])=>({x:e*r+n,y:t*r+i});function z0(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 pmt(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=z0(e,n),r=z0(e,t);return{top:i,right:r,bottom:i,left:r,x:r*2,y:i*2}}if(typeof e=="object"){const i=z0(e.top??e.y??0,n),r=z0(e.bottom??e.y??0,n),s=z0(e.left??e.x??0,t),a=z0(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 mmt(e,t,n,i,r,s){const{x:a,y:l}=aw(e,[t,n,i]),{x:c,y:u}=aw({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 mz=(e,t,n,i,r,s)=>{const a=pmt(s,t,n),l=(t-a.x)/e.width,c=(n-a.y)/e.height,u=Math.min(l,c),d=sw(u,i,r),f=e.x+e.width/2,h=e.y+e.height/2,m=t/2-f*d,g=n/2-h*d,b=mmt(e,m,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:m-v.left+v.right,y:g-v.top+v.bottom,zoom:d}},hE=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Ey(e){return e!=null&&e!=="parent"}function Tp(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 gz(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 TNe(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 oJ(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function gmt(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}function bmt(e){return{...vNe,...e||{}}}function Kk(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:r}){const{x:s,y:a}=Cd(e),l=Zw({x:s-((r==null?void 0:r.left)??0),y:a-((r==null?void 0:r.top)??0)},i),{x:c,y:u}=n?VC(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const bz=e=>({width:e.offsetWidth,height:e.offsetHeight}),ANe=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},ymt=["INPUT","SELECT","TEXTAREA"];function _Ne(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:ymt.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const jNe=e=>"clientX"in e,Cd=(e,t)=>{var s,a;const n=jNe(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)}},aJ=(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,...bz(a)}})};function NNe({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 Y2(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function lJ({pos:e,x1:t,y1:n,x2:i,y2:r,c:s}){switch(e){case fn.Left:return[t-Y2(t-i,s),n];case fn.Right:return[t+Y2(i-t,s),n];case fn.Top:return[t,n-Y2(n-r,s)];case fn.Bottom:return[t,n+Y2(r-n,s)]}}function RNe({sourceX:e,sourceY:t,sourcePosition:n=fn.Bottom,targetX:i,targetY:r,targetPosition:s=fn.Top,curvature:a=.25}){const[l,c]=lJ({pos:n,x1:e,y1:t,x2:i,y2:r,c:a}),[u,d]=lJ({pos:s,x1:i,y1:r,x2:e,y2:t,c:a}),[f,h,m,g]=NNe({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,m,g]}function INe({sourceX:e,sourceY:t,targetX:n,targetY:i}){const r=Math.abs(n-e)/2,s=n0}const wmt=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,Omt=(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)),kmt=(e,t,n={})=>{var s;if(!e.source||!e.target)return(s=n.onError)==null||s.call(n,"006",Md.error006()),t;const i=n.getEdgeId||wmt;let r;return ONe(e)?r={...e}:r={...e,id:i(e)},Omt(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function PNe({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[r,s,a,l]=INe({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,r,s,a,l]}const cJ={[fn.Left]:{x:-1,y:0},[fn.Right]:{x:1,y:0},[fn.Top]:{x:0,y:-1},[fn.Bottom]:{x:0,y:1}},Smt=({source:e,sourcePosition:t=fn.Bottom,target:n})=>t===fn.Left||t===fn.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Emt({source:e,sourcePosition:t=fn.Bottom,target:n,targetPosition:i=fn.Top,center:r,offset:s,stepPosition:a}){const l=cJ[t],c=cJ[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=Smt({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",m=f[h];let g=[],b,v;const y={x:0,y:0},w={x:0,y:0},[,,x,O]=INe({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 E=[{x:b,y:u.y},{x:b,y:d.y}],R=[{x:u.x,y:v},{x:d.x,y:v}];l[h]===m?g=h==="x"?E:R:g=h==="x"?R:E}else{const E=[{x:u.x,y:d.y}],R=[{x:d.x,y:u.y}];if(h==="x"?g=l.x===m?R:E:g=l.y===m?E:R,t===i){const _=Math.abs(e[h]-n[h]);if(_<=s){const D=Math.min(s-1,s-_);l[h]===m?y[h]=(u[h]>e[h]?-1:1)*D:w[h]=(d[h]>n[h]?-1:1)*D}}if(t!==i){const _=h==="x"?"y":"x",D=l[h]===c[_],M=u[_]>d[_],P=u[_]=N?(b=(A.x+j.x)/2,v=g[0].y):(b=g[0].x,v=(A.y+j.y)/2)}const S={x:u.x+y.x,y:u.y+y.y},k={x:d.x+w.x,y:d.y+w.y};return[[e,...S.x!==g[0].x||S.y!==g[0].y?[S]:[],...g,...k.x!==g[g.length-1].x||k.y!==g[g.length-1].y?[k]:[],n],b,v,x,O]}function Cmt(e,t,n,i){const r=Math.min(uJ(e,t)/2,uJ(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 WF(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function Amt(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=WF(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 DNe=1e3,_mt=10,yz={nodeOrigin:[0,0],nodeExtent:cE,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},jmt={...yz,checkEquality:!0};function vz(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function Nmt(e,t,n){const i=vz(yz,n);for(const r of e.values())if(r.parentId)wz(r,e,t,i);else{const s=QC(r,i.nodeOrigin),a=Ey(r.extent)?r.extent:i.nodeExtent,l=Sy(s,a,Tp(r));r.internals.positionAbsolute=l}}function Rmt(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 xz(e){return e==="manual"}function KF(e,t,n,i={}){var d,f;const r=vz(jmt,i),s={i:0},a=new Map(t),l=r!=null&&r.elevateNodesOnSelect&&!xz(r.zIndexMode)?DNe:0;let c=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let m=a.get(h.id);if(r.checkEquality&&h===(m==null?void 0:m.internals.userNode))t.set(h.id,m);else{const g=QC(h,r.nodeOrigin),b=Ey(h.extent)?h.extent:r.nodeExtent,v=Sy(g,b,Tp(h));m={...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:Rmt(h,m),z:MNe(h,l,r.zIndexMode),userNode:h}},t.set(h.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(c=!1),h.parentId&&wz(m,t,n,i,s),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function Imt(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 wz(e,t,n,i,r){const{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:l,zIndexMode:c}=vz(yz,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}Imt(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*_mt),r&&d.internals.rootParentIndex!==void 0&&(r.i=d.internals.rootParentIndex);const f=s&&!xz(c)?DNe:0,{x:h,y:m,z:g}=Pmt(e,d,a,l,f,c),{positionAbsolute:b}=e.internals,v=h!==b.x||m!==b.y;(v||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:h,y:m}:b,z:g}})}function MNe(e,t,n){const i=Ed(e.zIndex)?e.zIndex:0;return xz(n)?i:i+(e.selected?t:0)}function Pmt(e,t,n,i,r,s){const{x:a,y:l}=t.internals.positionAbsolute,c=Tp(e),u=QC(e,n),d=Ey(e.extent)?Sy(u,e.extent,c):u;let f=Sy({x:a+d.x,y:l+d.y},i,c);e.extent==="parent"&&(f=SNe(f,c,t));const h=MNe(e,r,s),m=t.internals.z??0;return{x:f.x,y:f.y,z:m>=h?m+1:h}}function Oz(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)??ow(c),d=ENe(u,l.rect);s.set(l.parentId,{expandedRect:d,parent:c})}return s.size>0&&s.forEach(({expandedRect:l,parent:c},u)=>{var x;const d=c.internals.positionAbsolute,f=Tp(c),h=c.origin??i,m=l.x0||g>0||y||w)&&(r.push({id:u,type:"position",position:{x:c.position.x-m+y,y:c.position.y-g+w}}),(x=n.get(u))==null||x.forEach(O=>{e.some(S=>S.id===O.id)||r.push({id:O.id,type:"position",position:{x:O.position.x+m,y:O.position.y+g}})})),(f.width0){const m=Oz(h,t,n,r);u.push(...m)}return{changes:u,updatedInternals:c}}async function Mmt({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 pJ(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 LNe(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}`;pJ("source",c,d,e,r,a),pJ("target",c,u,e,s,l),t.set(i.id,i)}}function $Ne(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:$Ne(n,t):!1}function mJ(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 Lmt(e,t,n,i){const r=new Map;for(const[s,a]of e)if((a.selected||a.id===i)&&(!a.parentId||!$Ne(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 SL({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 $mt({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=VC(s,t);return{x:a.x-s.x,y:a.y-s.y}}function Fmt({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,m=!1,g=!1,b=null;function v({noDragClassName:w,handleSelector:x,domNode:O,isSelectable:S,nodeId:k,nodeClickDistance:C=0}){h=Wc(O);function E({x:T,y:N}){const{nodeLookup:_,nodeExtent:D,snapGrid:M,snapToGrid:P,nodeOrigin:L,onNodeDrag:B,onSelectionDrag:I,onError:z,updateNodePositions:K}=t();s={x:T,y:N};let F=!1;const q=l.size>1,H=q&&D?qF(zC(l)):null,X=q&&P?$mt({dragItems:l,snapGrid:M,x:T,y:N}):null;for(const[ne,Q]of l){if(!_.has(ne))continue;let Z={x:T-Q.distance.x,y:N-Q.distance.y};P&&(Z=X?{x:Math.round(Z.x+X.x),y:Math.round(Z.y+X.y)}:VC(Z,M));let ce=null;if(q&&D&&!Q.extent&&H){const{positionAbsolute:G}=Q.internals,te=G.x-H.x+D[0][0],ue=G.x+Q.measured.width-H.x2+D[1][0],Ce=G.y-H.y+D[0][1],se=G.y+Q.measured.height-H.y2+D[1][1];ce=[[te,Ce],[ue,se]]}const{position:Ee,positionAbsolute:Y}=kNe({nodeId:ne,nextPosition:Z,nodeLookup:_,nodeExtent:ce||D,nodeOrigin:L,onError:z});F=F||Q.position.x!==Ee.x||Q.position.y!==Ee.y,Q.position=Ee,Q.internals.positionAbsolute=Y}if(g=g||F,!!F&&(K(l,!0),b&&(i||B||!k&&I))){const[ne,Q]=SL({nodeId:k,dragItems:l,nodeLookup:_});i==null||i(b,l,ne,Q),B==null||B(b,ne,Q),k||I==null||I(b,Q)}}async function R(){if(!d)return;const{transform:T,panBy:N,autoPanSpeed:_,autoPanOnNodeDrag:D}=t();if(!D){c=!1,cancelAnimationFrame(a);return}const[M,P]=pz(u,d,_);(M!==0||P!==0)&&(s.x=(s.x??0)-M/T[2],s.y=(s.y??0)-P/T[2],await N({x:M,y:P})&&E(s)),a=requestAnimationFrame(R)}function A(T){var q;const{nodeLookup:N,multiSelectionActive:_,nodesDraggable:D,transform:M,snapGrid:P,snapToGrid:L,selectNodesOnDrag:B,onNodeDragStart:I,onSelectionDragStart:z,unselectNodesAndEdges:K}=t();f=!0,(!B||!S)&&!_&&k&&((q=N.get(k))!=null&&q.selected||K()),S&&B&&k&&(e==null||e(k));const F=Kk(T.sourceEvent,{transform:M,snapGrid:P,snapToGrid:L,containerBounds:d});if(s=F,l=Lmt(N,D,F,k),l.size>0&&(n||I||!k&&z)){const[H,X]=SL({nodeId:k,dragItems:l,nodeLookup:N});n==null||n(T.sourceEvent,l,H,X),I==null||I(T.sourceEvent,H,X),k||z==null||z(T.sourceEvent,X)}}const j=tNe().clickDistance(C).on("start",T=>{const{domNode:N,nodeDragThreshold:_,transform:D,snapGrid:M,snapToGrid:P}=t();d=(N==null?void 0:N.getBoundingClientRect())||null,m=!1,g=!1,b=T.sourceEvent,_===0&&A(T),s=Kk(T.sourceEvent,{transform:D,snapGrid:M,snapToGrid:P,containerBounds:d}),u=Cd(T.sourceEvent,d)}).on("drag",T=>{const{autoPanOnNodeDrag:N,transform:_,snapGrid:D,snapToGrid:M,nodeDragThreshold:P,nodeLookup:L}=t(),B=Kk(T.sourceEvent,{transform:_,snapGrid:D,snapToGrid:M,containerBounds:d});if(b=T.sourceEvent,(T.sourceEvent.type==="touchmove"&&T.sourceEvent.touches.length>1||k&&!L.has(k))&&(m=!0),!m){if(!c&&N&&f&&(c=!0,R()),!f){const I=Cd(T.sourceEvent,d),z=I.x-u.x,K=I.y-u.y;Math.sqrt(z*z+K*K)>P&&A(T)}(s.x!==B.xSnapped||s.y!==B.ySnapped)&&l&&f&&(u=Cd(T.sourceEvent,d),E(B))}}).on("end",T=>{if(!f||m){m&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),l.size>0){const{nodeLookup:N,updateNodePositions:_,onNodeDragStop:D,onSelectionDragStop:M}=t();if(g&&(_(l,!1),g=!1),r||D||!k&&M){const[P,L]=SL({nodeId:k,dragItems:l,nodeLookup:N,dragging:!1});r==null||r(T.sourceEvent,l,P,L),D==null||D(T.sourceEvent,P,L),k||M==null||M(T.sourceEvent,L)}}}).filter(T=>{const N=T.target;return!T.button&&(!w||!mJ(N,`.${w}`,O))&&(!x||mJ(N,x,O))});h.call(j)}function y(){h==null||h.on(".drag",null)}return{update:v,destroy:y}}function Bmt(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())fE(r,ow(s))>0&&i.push(s);return i}const Umt=250;function Qmt(e,t,n,i){var l,c;let r=[],s=1/0;const a=Bmt(e,n,t+Umt);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:m}=Cy(u,f,f.position,!0),g=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(m-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 FNe(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,...Cy(a,c,c.position,!0)}:c}function BNe(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function zmt(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const UNe=()=>!0;function Vmt(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:m,onConnectStart:g,onConnect:b,onConnectEnd:v,isValidConnection:y=UNe,onReconnectEnd:w,updateConnection:x,getTransform:O,getFromHandle:S,autoPanSpeed:k,dragThreshold:C=1,handleDomNode:E}){const R=ANe(e.target);let A=0,j;const{x:T,y:N}=Cd(e),_=BNe(s,E),D=l==null?void 0:l.getBoundingClientRect();let M=!1;if(!D||!_)return;const P=FNe(r,_,i,c,t);if(!P)return;let L=Cd(e,D),B=!1,I=null,z=!1,K=null;function F(){if(!d||!D)return;const[Ee,Y]=pz(L,D,k);h({x:Ee,y:Y}),A=requestAnimationFrame(F)}const q={...P,nodeId:r,type:_,position:P.position},H=c.get(r);let ne={inProgress:!0,isValid:null,from:Cy(H,q,fn.Left,!0),fromHandle:q,fromPosition:q.position,fromNode:H,to:L,toHandle:null,toPosition:iJ[q.position],toNode:null,pointer:L};function Q(){M=!0,x(ne),g==null||g(e,{nodeId:r,handleId:i,handleType:_})}C===0&&Q();function Z(Ee){if(!M){const{x:se,y:he}=Cd(Ee),ae=se-T,Ae=he-N;if(!(ae*ae+Ae*Ae>C*C))return;Q()}if(!S()||!q){ce(Ee);return}const Y=O();L=Cd(Ee,D),j=Qmt(Zw(L,Y,!1,[1,1]),n,c,q),B||(F(),B=!0);const G=QNe(Ee,{handle:j,connectionMode:t,fromNodeId:r,fromHandleId:i,fromType:a?"target":"source",isValidConnection:y,doc:R,lib:u,flowId:f,nodeLookup:c});K=G.handleDomNode,I=G.connection,z=zmt(!!j,G.isValid);const te=c.get(r),ue=te?Cy(te,q,fn.Left,!0):ne.from,Ce={...ne,from:ue,isValid:z,to:G.toHandle&&z?aw({x:G.toHandle.x,y:G.toHandle.y},Y):L,toHandle:G.toHandle,toPosition:z&&G.toHandle?G.toHandle.position:iJ[q.position],toNode:G.toHandle?c.get(G.toHandle.nodeId):null,pointer:L};x(Ce),ne=Ce}function ce(Ee){if(!("touches"in Ee&&Ee.touches.length>0)){if(M){(j||K)&&I&&z&&(b==null||b(I));const{inProgress:Y,...G}=ne,te={...G,toPosition:ne.toHandle?ne.toPosition:null};v==null||v(Ee,te),s&&(w==null||w(Ee,te))}m(),cancelAnimationFrame(A),B=!1,z=!1,I=null,K=null,R.removeEventListener("mousemove",Z),R.removeEventListener("mouseup",ce),R.removeEventListener("touchmove",Z),R.removeEventListener("touchend",ce)}}R.addEventListener("mousemove",Z),R.addEventListener("mouseup",ce),R.addEventListener("touchmove",Z),R.addEventListener("touchend",ce)}function QNe(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s,doc:a,lib:l,flowId:c,isValidConnection:u=UNe,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:m,y:g}=Cd(e),b=a.elementFromPoint(m,g),v=b!=null&&b.classList.contains(`${l}-flow__handle`)?b:h,y={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=BNe(void 0,v),x=v.getAttribute("data-nodeid"),O=v.getAttribute("data-handleid"),S=v.classList.contains("connectable"),k=v.classList.contains("connectableend");if(!x||!w)return y;const C={source:f?x:i,sourceHandle:f?O:r,target:f?i:x,targetHandle:f?r:O};y.connection=C;const R=S&&k&&(n===rw.Strict?f&&w==="source"||!f&&w==="target":x!==i||O!==r);y.isValid=R&&u(C),y.toHandle=FNe(x,w,O,d,n,!0)}return y}const GF={onPointerDown:Vmt,isValid:QNe};function Hmt({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const r=Wc(e);function s({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:m=!1}){const g=x=>{if(x.sourceEvent.type!=="wheel"||!t)return;const O=n(),S=x.sourceEvent.ctrlKey&&hE()?10:1,k=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*d,C=O[2]*Math.pow(2,k*S);t.scaleTo(C)};let b=[0,0];const v=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(b=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},y=x=>{const O=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const S=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],k=[S[0]-b[0],S[1]-b[1]];b=S;const C=i()*Math.max(O[2],Math.log(O[2]))*(m?-1:1),E={x:O[0]-k[0]*C,y:O[1]-k[1]*C},R=[[0,0],[c,u]];t.setViewportConstrained({x:E.x,y:E.y,zoom:O[2]},R,l)},w=bNe().on("start",v).on("zoom",f?y:null).on("zoom.wheel",h?g:null);r.call(w,{})}function a(){r.on("zoom",null)}return{update:s,destroy:a,pointer:vd}}const FP=e=>({x:e.x,y:e.y,zoom:e.k}),EL=({x:e,y:t,zoom:n})=>MP.translate(e,t).scale(n),Lv=(e,t)=>e.target.closest(`.${t}`),zNe=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),qmt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,CL=(e,t=0,n=qmt,i=()=>{})=>{const r=typeof t=="number"&&t>0;return r||i(),r?e.transition().duration(t).ease(n).on("end",i):e},VNe=e=>{const t=e.ctrlKey&&hE()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Wmt({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(Lv(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=vd(d),y=VNe(d),w=f*Math.pow(2,y);i.scaleTo(n,w,v,d);return}const h=d.deltaMode===1?20:1;let m=r===iy.Vertical?0:d.deltaX*h,g=r===iy.Horizontal?0:d.deltaY*h;!hE()&&d.shiftKey&&r!==iy.Vertical&&(m=d.deltaY*h,g=0),i.translateBy(n,-(m/f)*s,-(g/f)*s,{internal:!0});const b=FP(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 Kmt({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,r){const s=i.type==="wheel",a=!t&&s&&!i.ctrlKey,l=Lv(i,e);if(i.ctrlKey&&s&&l&&i.preventDefault(),a||l)return null;i.preventDefault(),n.call(this,i,r)}}function Gmt({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var s,a,l;if((s=i.sourceEvent)!=null&&s.internal)return;const r=FP(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 Xmt({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:r}){return s=>{var a,l;e.usedRightMouseButton=!!(n&&zNe(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,FP(s.transform)))}}function Ymt({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&&zNe(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),e.usedRightMouseButton=!1,i(!1),r)){const c=FP(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(a.sourceEvent,c)},n?150:0)}}}function Zmt({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,m=n&&f.ctrlKey,g=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Lv(f,`${u}-flow__node`)||Lv(f,`${u}-flow__edge`)))return!0;if(!i&&!h&&!r&&!s&&!n||a||d&&!g||Lv(f,l)&&g||Lv(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&&!m&&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 Jmt({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=bNe().scaleExtent([t,n]).translateExtent(i),h=Wc(e).call(f);w({x:r.x,y:r.y,zoom:sw(r.zoom,t,n)},[[0,0],[d.width,d.height]],i);const m=h.on("wheel.zoom"),g=h.on("dblclick.zoom");f.wheelDelta(VNe);async function b(j,T){return h?new Promise(N=>{f==null||f.interpolate((T==null?void 0:T.interpolate)==="linear"?Wk:Z_).transform(CL(h,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>N(!0)),j)}):!1}function v({noWheelClassName:j,noPanClassName:T,onPaneContextMenu:N,userSelectionActive:_,panOnScroll:D,panOnDrag:M,panOnScrollMode:P,panOnScrollSpeed:L,preventScrolling:B,zoomOnPinch:I,zoomOnScroll:z,zoomOnDoubleClick:K,zoomActivationKeyPressed:F,lib:q,onTransformChange:H,connectionInProgress:X,paneClickDistance:ne,selectionOnDrag:Q}){_&&!u.isZoomingOrPanning&&y();const Z=D&&!F&&!_;f.clickDistance(Q?1/0:!Ed(ne)||ne<0?0:ne);const ce=Z?Wmt({zoomPanValues:u,noWheelClassName:j,d3Selection:h,d3Zoom:f,panOnScrollMode:P,panOnScrollSpeed:L,zoomOnPinch:I,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:l}):Kmt({noWheelClassName:j,preventScrolling:B,d3ZoomHandler:m});h.on("wheel.zoom",ce,{passive:!1});const Ee=Gmt({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});f.on("start",Ee);const Y=Xmt({zoomPanValues:u,panOnDrag:M,onPaneContextMenu:!!N,onPanZoom:s,onTransformChange:H});f.on("zoom",Y);const G=Ymt({zoomPanValues:u,panOnDrag:M,panOnScroll:D,onPaneContextMenu:N,onPanZoomEnd:l,onDraggingChange:c});f.on("end",G);const te=Zmt({zoomActivationKeyPressed:F,panOnDrag:M,zoomOnScroll:z,panOnScroll:D,zoomOnDoubleClick:K,zoomOnPinch:I,userSelectionActive:_,noPanClassName:T,noWheelClassName:j,lib:q,connectionInProgress:X});f.filter(te),K?h.on("dblclick.zoom",g):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function w(j,T,N){const _=EL(j),D=f==null?void 0:f.constrain()(_,T,N);return D&&await b(D),D}async function x(j,T){const N=EL(j);return await b(N,T),N}function O(j){if(h){const T=EL(j),N=h.property("__zoom");(N.k!==j.zoom||N.x!==j.x||N.y!==j.y)&&(f==null||f.transform(h,T,null,{sync:!0}))}}function S(){const j=h?gNe(h.node()):{x:0,y:0,k:1};return{x:j.x,y:j.y,zoom:j.k}}async function k(j,T){return h?new Promise(N=>{f==null||f.interpolate((T==null?void 0:T.interpolate)==="linear"?Wk:Z_).scaleTo(CL(h,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>N(!0)),j)}):!1}async function C(j,T){return h?new Promise(N=>{f==null||f.interpolate((T==null?void 0:T.interpolate)==="linear"?Wk:Z_).scaleBy(CL(h,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>N(!0)),j)}):!1}function E(j){f==null||f.scaleExtent(j)}function R(j){f==null||f.translateExtent(j)}function A(j){const T=!Ed(j)||j<0?0:j;f==null||f.clickDistance(T)}return{update:v,destroy:y,setViewport:x,setViewportConstrained:w,getViewport:S,scaleTo:k,scaleBy:C,setScaleExtent:E,setTranslateExtent:R,syncViewport:O,setClickDistance:A}}var lw;(function(e){e.Line="line",e.Handle="handle"})(lw||(lw={}));function egt({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 gJ(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 Gp(e,t){return Math.max(0,t-e)}function Xp(e,t){return Math.max(0,e-t)}function Z2(e,t,n){return Math.max(0,t-e,e-n)}function bJ(e,t){return e?!t:t}function tgt(e,t,n,i,r,s,a,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:m,ySnapped:g}=n,{minWidth:b,maxWidth:v,minHeight:y,maxHeight:w}=i,{x,y:O,width:S,height:k,aspectRatio:C}=e;let E=Math.floor(d?m-e.pointerX:0),R=Math.floor(f?g-e.pointerY:0);const A=S+(c?-E:E),j=k+(u?-R:R),T=-s[0]*S,N=-s[1]*k;let _=Z2(A,b,v),D=Z2(j,y,w);if(a){let L=0,B=0;c&&E<0?L=Gp(x+E+T,a[0][0]):!c&&E>0&&(L=Xp(x+A+T,a[1][0])),u&&R<0?B=Gp(O+R+N,a[0][1]):!u&&R>0&&(B=Xp(O+j+N,a[1][1])),_=Math.max(_,L),D=Math.max(D,B)}if(l){let L=0,B=0;c&&E>0?L=Xp(x+E,l[0][0]):!c&&E<0&&(L=Gp(x+A,l[1][0])),u&&R>0?B=Xp(O+R,l[0][1]):!u&&R<0&&(B=Gp(O+j,l[1][1])),_=Math.max(_,L),D=Math.max(D,B)}if(r){if(d){const L=Z2(A/C,y,w)*C;if(_=Math.max(_,L),a){let B=0;!c&&!u||c&&!u&&h?B=Xp(O+N+A/C,a[1][1])*C:B=Gp(O+N+(c?E:-E)/C,a[0][1])*C,_=Math.max(_,B)}if(l){let B=0;!c&&!u||c&&!u&&h?B=Gp(O+A/C,l[1][1])*C:B=Xp(O+(c?E:-E)/C,l[0][1])*C,_=Math.max(_,B)}}if(f){const L=Z2(j*C,b,v)/C;if(D=Math.max(D,L),a){let B=0;!c&&!u||u&&!c&&h?B=Xp(x+j*C+T,a[1][0])/C:B=Gp(x+(u?R:-R)*C+T,a[0][0])/C,D=Math.max(D,B)}if(l){let B=0;!c&&!u||u&&!c&&h?B=Gp(x+j*C,l[1][0])/C:B=Xp(x+(u?R:-R)*C,l[0][0])/C,D=Math.max(D,B)}}}R=R+(R<0?D:-D),E=E+(E<0?_:-_),r&&(h?A>j*C?R=(bJ(c,u)?-E:E)/C:E=(bJ(c,u)?-R:R)*C:d?(R=E/C,u=c):(E=R*C,c=u));const M=c?x+E:x,P=u?O+R:O;return{width:S+(c?-E:E),height:k+(u?-R:R),x:s[0]*E*(c?-1:1)+M,y:s[1]*R*(u?-1:1)+P}}const HNe={width:0,height:0,x:0,y:0},ngt={...HNe,pointerX:0,pointerY:0,aspectRatio:1};function igt(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 rgt({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:r}){const s=Wc(e);let a={controlDirection:gJ("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:m,onResize:g,onResizeEnd:b,shouldResize:v}){let y={...HNe},w={...ngt};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:gJ(u)};let x,O=null,S=[],k,C,E,R=!1;const A=tNe().on("start",j=>{const{nodeLookup:T,transform:N,snapGrid:_,snapToGrid:D,nodeOrigin:M,paneDomNode:P}=n();if(x=T.get(t),!x)return;O=(P==null?void 0:P.getBoundingClientRect())??null;const{xSnapped:L,ySnapped:B}=Kk(j.sourceEvent,{transform:N,snapGrid:_,snapToGrid:D,containerBounds:O});y={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},w={...y,pointerX:L,pointerY:B,aspectRatio:y.width/y.height},k=void 0,C=Ey(x.extent)?x.extent:void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(k=T.get(x.parentId)),k&&x.extent==="parent"&&(C=[[0,0],[k.measured.width,k.measured.height]]),S=[],E=void 0;for(const[I,z]of T)if(z.parentId===t&&(S.push({id:I,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const K=igt(z,x,z.origin??M);E?E=[[Math.min(K[0][0],E[0][0]),Math.min(K[0][1],E[0][1])],[Math.max(K[1][0],E[1][0]),Math.max(K[1][1],E[1][1])]]:E=K}m==null||m(j,{...y})}).on("drag",j=>{const{transform:T,snapGrid:N,snapToGrid:_,nodeOrigin:D}=n(),M=Kk(j.sourceEvent,{transform:T,snapGrid:N,snapToGrid:_,containerBounds:O}),P=[];if(!x)return;const{x:L,y:B,width:I,height:z}=y,K={},F=x.origin??D,{width:q,height:H,x:X,y:ne}=tgt(w,a.controlDirection,M,a.boundaries,a.keepAspectRatio,F,C,E),Q=q!==I,Z=H!==z,ce=X!==L&&Q,Ee=ne!==B&&Z;if(!ce&&!Ee&&!Q&&!Z)return;if((ce||Ee||F[0]===1||F[1]===1)&&(K.x=ce?X:y.x,K.y=Ee?ne:y.y,y.x=K.x,y.y=K.y,S.length>0)){const ue=X-L,Ce=ne-B;for(const se of S)se.position={x:se.position.x-ue+F[0]*(q-I),y:se.position.y-Ce+F[1]*(H-z)},P.push(se)}if((Q||Z)&&(K.width=Q&&(!a.resizeDirection||a.resizeDirection==="horizontal")?q:y.width,K.height=Z&&(!a.resizeDirection||a.resizeDirection==="vertical")?H:y.height,y.width=K.width,y.height=K.height),k&&x.expandParent){const ue=F[0]*(K.width??0);K.x&&K.x{R&&(b==null||b(j,{...y}),r==null||r({...y}),R=!1)});s.call(A)}function c(){s.on(".drag",null)}return{update:l,destroy:c}}const sgt={},yJ=e=>{let t;const n=new Set,i=(d,f)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const m=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(g=>g(t,m))}},r=()=>t,c={setState:i,getState:r,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(sgt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(i,r,c);return c},ogt=e=>e?yJ(e):yJ,{useDebugValue:agt}=yi,{useSyncExternalStoreWithSelector:lgt}=IJe,cgt=e=>e;function qNe(e,t=cgt,n){const i=lgt(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return agt(i),i}const vJ=(e,t)=>{const n=ogt(e),i=(r,s=t)=>qNe(n,r,s);return Object.assign(i,n),i},ugt=(e,t)=>e?vJ(e,t):vJ;function As(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!Object.is(r,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||!Object.is(e[i],t[i]))return!1;return!0}const BP=p.createContext(null),dgt=BP.Provider,WNe=Md.error001("react");function zi(e,t){const n=p.useContext(BP);if(n===null)throw new Error(WNe);return qNe(n,e,t)}function _s(){const e=p.useContext(BP);if(e===null)throw new Error(WNe);return p.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const xJ={display:"none"},fgt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},KNe="react-flow__node-desc",GNe="react-flow__edge-desc",hgt="react-flow__aria-live",pgt=e=>e.ariaLiveMessage,mgt=e=>e.ariaLabelConfig;function ggt({rfId:e}){const t=zi(pgt);return o.jsx("div",{id:`${hgt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:fgt,children:t})}function bgt({rfId:e,disableKeyboardA11y:t}){const n=zi(mgt);return o.jsxs(o.Fragment,{children:[o.jsx("div",{id:`${KNe}-${e}`,style:xJ,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),o.jsx("div",{id:`${GNe}-${e}`,style:xJ,children:n["edge.a11yDescription.default"]}),!t&&o.jsx(ggt,{rfId:e})]})}const UP=p.forwardRef(({position:e="top-left",children:t,className:n,style:i,...r},s)=>{const a=`${e}`.split("-");return o.jsx("div",{className:Fo(["react-flow__panel",n,...a]),style:i,ref:s,...r,children:t})});UP.displayName="Panel";function ygt({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:o.jsx(UP,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:o.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const vgt=e=>{const t=[],n=[];for(const[,i]of e.nodeLookup)i.selected&&t.push(i.internals.userNode);for(const[,i]of e.edgeLookup)i.selected&&n.push(i);return{selectedNodes:t,selectedEdges:n}},J2=e=>e.id;function xgt(e,t){return As(e.selectedNodes.map(J2),t.selectedNodes.map(J2))&&As(e.selectedEdges.map(J2),t.selectedEdges.map(J2))}function wgt({onSelectionChange:e}){const t=_s(),{selectedNodes:n,selectedEdges:i}=zi(vgt,xgt);return p.useEffect(()=>{const r={nodes:n,edges:i};e==null||e(r),t.getState().onSelectionChangeHandlers.forEach(s=>s(r))},[n,i,e]),null}const Ogt=e=>!!e.onSelectionChangeHandlers;function kgt({onSelectionChange:e}){const t=zi(Ogt);return e||t?o.jsx(wgt,{onSelectionChange:e}):null}const XNe=[0,0],Sgt={x:0,y:0,zoom:1},Egt=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],wJ=[...Egt,"rfId"],Cgt=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),OJ={translateExtent:cE,nodeOrigin:XNe,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Tgt(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:r,setTranslateExtent:s,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:c}=zi(Cgt,As),u=_s();p.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=OJ,l()}),[]);const d=p.useRef(OJ);return p.useEffect(()=>{for(const f of wJ){const h=e[f],m=d.current[f];h!==m&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?i(h):f==="maxZoom"?r(h):f==="translateExtent"?s(h):f==="nodeExtent"?a(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:bmt(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},wJ.map(f=>e[f])),null}function kJ(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Agt(e){var i;const[t,n]=p.useState(e==="system"?null:e);return p.useEffect(()=>{if(e!=="system"){n(e);return}const r=kJ(),s=()=>n(r!=null&&r.matches?"dark":"light");return s(),r==null||r.addEventListener("change",s),()=>{r==null||r.removeEventListener("change",s)}},[e]),t!==null?t:(i=kJ())!=null&&i.matches?"dark":"light"}const SJ=typeof document<"u"?document:null;function pE(e=null,t={target:SJ,actInsideInputWithModifier:!0}){const[n,i]=p.useState(!1),r=p.useRef(!1),s=p.useRef(new Set([])),[a,l]=p.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` +`)},Lot=0,B0=[];function $ot(e){var t=p.useRef([]),n=p.useRef([0,0]),i=p.useRef(),r=p.useState(Lot++)[0],s=p.useState(y_e)[0],a=p.useRef(e);p.useEffect(function(){a.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var b=sot([e.lockRef.current],(e.shards||[]).map(AZ),!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=p.useCallback(function(b,v){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!a.current.allowPinchZoom;var y=BA(b),w=n.current,x="deltaX"in b?b.deltaX:w[0]-y[0],O="deltaY"in b?b.deltaY:w[1]-y[1],S,k=b.target,C=Math.abs(x)>Math.abs(O)?"h":"v";if("touches"in b&&C==="h"&&k.type==="range")return!1;var E=window.getSelection(),R=E&&E.anchorNode,A=R?R===k||R.contains(k):!1;if(A)return!1;var N=CZ(C,k);if(!N)return!0;if(N?S=C:(S=C==="v"?"h":"v",N=CZ(C,k)),!N)return!1;if(!i.current&&"changedTouches"in b&&(x||O)&&(i.current=S),!S)return!0;var T=i.current||S;return Pot(T,v,b,T==="h"?x:O)},[]),c=p.useCallback(function(b){var v=b;if(!(!B0.length||B0[B0.length-1]!==s)){var y="deltaY"in v?TZ(v):BA(v),w=t.current.filter(function(S){return S.name===v.type&&(S.target===v.target||v.target===S.shadowParent)&&Dot(S.delta,y)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var x=(a.current.shards||[]).map(AZ).filter(Boolean).filter(function(S){return S.contains(v.target)}),O=x.length>0?l(v,x[0]):!a.current.noIsolation;O&&v.cancelable&&v.preventDefault()}}},[]),u=p.useCallback(function(b,v,y,w){var x={name:b,delta:v,target:y,should:w,shadowParent:Fot(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(O){return O!==x})},1)},[]),d=p.useCallback(function(b){n.current=BA(b),i.current=void 0},[]),f=p.useCallback(function(b){u(b.type,TZ(b),b.target,l(b,e.lockRef.current))},[]),h=p.useCallback(function(b){u(b.type,BA(b),b.target,l(b,e.lockRef.current))},[]);p.useEffect(function(){return B0.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,F0),document.addEventListener("touchmove",c,F0),document.addEventListener("touchstart",d,F0),function(){B0=B0.filter(function(b){return b!==s}),document.removeEventListener("wheel",c,F0),document.removeEventListener("touchmove",c,F0),document.removeEventListener("touchstart",d,F0)}},[]);var m=e.removeScrollBar,g=e.inert;return p.createElement(p.Fragment,null,g?p.createElement(s,{styles:Mot(r)}):null,m?p.createElement(Tot,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Fot(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Bot=pot(b_e,$ot);var RQ=p.forwardRef(function(e,t){return p.createElement(OP,gf({},e,{ref:t,sideCar:Bot}))});RQ.classNames=OP.classNames;var Uot=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},U0=new WeakMap,UA=new WeakMap,QA={},bL=0,O_e=function(e){return e&&(e.host||O_e(e.parentNode))},Qot=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=O_e(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})},zot=function(e,t,n,i){var r=Qot(t,Array.isArray(e)?e:[e]);QA[n]||(QA[n]=new WeakMap);var s=QA[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 m=h.getAttribute(i),g=m!==null&&m!=="false",b=(U0.get(h)||0)+1,v=(s.get(h)||0)+1;U0.set(h,b),s.set(h,v),a.push(h),b===1&&g&&UA.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(),bL++,function(){a.forEach(function(f){var h=U0.get(f)-1,m=s.get(f)-1;U0.set(f,h),s.set(f,m),h||(UA.has(f)||f.removeAttribute(i),UA.delete(f)),m||f.removeAttribute(n)}),bL--,bL||(U0=new WeakMap,U0=new WeakMap,UA=new WeakMap,QA={})}},k_e=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),r=Uot(e);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live], script"))),zot(i,r,n,"aria-hidden")):function(){return null}},Vot=Object.defineProperty,Hot=(e,t)=>Vot(e,"name",{value:t,configurable:!0});function PC(e){const[t,n]=p.useState(void 0);return Hu(()=>{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}Hot(PC,"useSize");var qot=Object.defineProperty,dp=(e,t)=>qot(e,"name",{value:t,configurable:!0}),IQ="Checkbox",[Wot,xcn]=bc(IQ),[Kot,PQ]=Wot(IQ);function S_e(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,m]=ed({prop:n,defaultProp:r??!1,onChange:c,caller:IQ}),[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useRef(!1),[x,O]=p.useReducer(C=>C+1,0),S=g?!!a||!!g.closest("form"):!0,k={checked:h,disabled:s,setChecked:m,control:g,setControl:b,name:l,form:a,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:x,onUserInteraction:O,required:u,defaultChecked:Gh(r)?!1:r,isFormControl:S,bubbleInput:v,setBubbleInput:y};return o.jsx(Kot,{scope:t,...k,children:E_e(f)?f(k):i})}dp(S_e,"CheckboxProvider");var Got="CheckboxTrigger",Xot=p.forwardRef(dp(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:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=PQ(Got,t),y=yr(s,f),w=p.useRef(u);return p.useEffect(()=>{const x=a==null?void 0:a.form;if(x){const O=dp(()=>h(w.current),"reset");return x.addEventListener("reset",O),()=>x.removeEventListener("reset",O)}},[a,h]),o.jsx(Fr.button,{type:"button",role:"checkbox","aria-checked":Gh(u)?"mixed":u,"aria-required":d,"data-state":DQ(u),"data-disabled":c?"":void 0,disabled:c,value:l,...r,ref:y,onKeyDown:_n(n,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:_n(i,x=>{g(),h(O=>Gh(O)?!0:!O),v&&b&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})},"CheckboxTrigger")),Yot=p.forwardRef(dp(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(S_e,{__scopeCheckbox:i,checked:s,defaultChecked:a,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>o.jsxs(o.Fragment,{children:[o.jsx(Xot,{...h,ref:n,__scopeCheckbox:i}),m&&o.jsx(tat,{__scopeCheckbox:i})]})})},"Checkbox")),Zot="CheckboxIndicator",Jot=p.forwardRef(dp(function(t,n){const{__scopeCheckbox:i,forceMount:r,...s}=t,a=PQ(Zot,i);return o.jsx(qf,{present:r||Gh(a.checked)||a.checked===!0,children:o.jsx(Fr.span,{"data-state":DQ(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:n,style:{pointerEvents:"none",...t.style}})})},"CheckboxIndicator")),eat="CheckboxBubbleInput",tat=p.forwardRef(dp(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:m,form:g,bubbleInput:b,setBubbleInput:v}=PQ(eat,t),y=yr(r,v),w=PC(s),x=p.useRef(!1),O=p.useRef(c),S=p.useRef(l);p.useEffect(()=>{const C=b;if(!C)return;const E=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(E,"checked").set,N=l!==S.current;S.current=l;const T=O.current!==c;O.current=c;const j=!(N&&a.current);if(T&&A){x.current=!N;const _=new Event("click",{bubbles:j});C.indeterminate=Gh(c),A.call(C,Gh(c)?!1:c),C.dispatchEvent(_),x.current=!1}},[b,c,a,l]);const k=p.useRef(Gh(c)?!1:c);return o.jsx(Fr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??k.current,required:d,disabled:f,name:h,value:m,form:g,...i,tabIndex:-1,ref:y,onClick:_n(n,C=>{x.current&&C.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function E_e(e){return typeof e=="function"}dp(E_e,"isFunction");function Gh(e){return e==="indeterminate"}dp(Gh,"isIndeterminate");function DQ(e){return Gh(e)?"indeterminate":e?"checked":"unchecked"}dp(DQ,"getState");var nat=Object.defineProperty,Hm=(e,t)=>nat(e,"name",{value:t,configurable:!0}),C_e="Popper",[T_e,Ww]=bc(C_e),[iat,A_e]=T_e(C_e),rat=Hm(e=>{const{__scopePopper:t,children:n}=e,[i,r]=p.useState(null),[s,a]=p.useState(void 0);return o.jsx(iat,{scope:t,anchor:i,onAnchorChange:r,placementState:s,setPlacementState:a,children:n})},"Popper"),sat="PopperAnchor",oat=p.forwardRef(Hm(function(t,n){const{__scopePopper:i,virtualRef:r,...s}=t,a=A_e(sat,i),l=p.useRef(null),c=a.onAnchorChange,u=p.useCallback(b=>{l.current=b,b&&c(b)},[c]),d=yr(n,u),f=p.useRef(null);p.useEffect(()=>{if(!r)return;const b=f.current;f.current=r.current,b!==f.current&&c(f.current)});const h=a.placementState&&kP(a.placementState),m=h==null?void 0:h[0],g=h==null?void 0:h[1];return r?null:o.jsx(Fr.div,{"data-radix-popper-side":m,"data-radix-popper-align":g,...s,ref:d})},"PopperAnchor")),__e="PopperContent",[aat,wcn]=T_e(__e),lat=p.forwardRef(Hm(function(t,n){var Y,ae,Ee,Z,G,te,de;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:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...v}=t,y=A_e(__e,i),[w,x]=p.useState(null),O=yr(n,x),[S,k]=p.useState(null),C=PC(S),E=(C==null?void 0:C.width)??0,R=(C==null?void 0:C.height)??0,A=r+(a!=="center"?"-"+a:""),N=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},T=Array.isArray(d)?d:[d],j=T.length>0,_={padding:N,boundary:T.filter(j_e),altBoundary:j},{refs:I,floatingStyles:D,placement:P,isPositioned:L,middlewareData:B}=AAe({strategy:"fixed",placement:A,whileElementsMounted:Hm((...Ce)=>hF(...Ce,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:y.anchor},middleware:[_Ae({mainAxis:s+R,alignmentAxis:l}),u&&jAe({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?NAe():void 0,..._}),u&&RAe({..._}),IAe({..._,apply:Hm(({elements:Ce,rects:le,availableWidth:fe,availableHeight:ce})=>{const{width:Te,height:Me}=le.reference,we=Ce.floating.style;we.setProperty("--radix-popper-available-width",`${fe}px`),we.setProperty("--radix-popper-available-height",`${ce}px`),we.setProperty("--radix-popper-anchor-width",`${Te}px`),we.setProperty("--radix-popper-anchor-height",`${Me}px`)},"apply")}),S&&Cnt({element:S,padding:c}),cat({arrowWidth:E,arrowHeight:R}),m&&Ent({strategy:"referenceHidden",..._,boundary:j?_.boundary:void 0})]}),M=y.setPlacementState;Hu(()=>(M(P),()=>{M(void 0)}),[P,M]);const[H,K]=kP(P),F=Md(b);Hu(()=>{L&&(F==null||F())},[L,F]);const q=(Y=B.arrow)==null?void 0:Y.x,Q=(ae=B.arrow)==null?void 0:ae.y,X=((Ee=B.arrow)==null?void 0:Ee.centerOffset)!==0,[ne,z]=p.useState();return Hu(()=>{w&&z(window.getComputedStyle(w).zIndex)},[w]),o.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:L?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(Z=B.transformOrigin)==null?void 0:Z.x,(G=B.transformOrigin)==null?void 0:G.y].join(" "),...((te=B.hide)==null?void 0:te.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:o.jsx(aat,{scope:i,placedSide:H,placedAlign:K,onArrowChange:k,arrowX:q,arrowY:Q,shouldHideArrow:X,children:o.jsx(Fr.div,{"data-side":H,"data-align":K,...v,ref:O,style:{...v.style,animation:L?(de=v.style)==null?void 0:de.animation:"none"}})})})},"PopperContent"));function j_e(e){return e!==null}Hm(j_e,"isNotNull");var cat=Hm(e=>({name:"transformOrigin",options:e,fn(t){var v,y,w;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]=kP(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((y=r.arrow)==null?void 0:y.x)??0)+l/2,m=(((w=r.arrow)==null?void 0:w.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:`${m}px`):u==="left"&&(g=`${i.floating.width+c}px`,b=a?f:`${m}px`),{data:{x:g,y:b}}}}),"transformOrigin");function kP(e){const[t,n="center"]=e.split("-");return[t,n]}Hm(kP,"getSideAndAlignFromPlacement");var SP=rat,MQ=oat,LQ=lat,uat=Object.defineProperty,$Q=(e,t)=>uat(e,"name",{value:t,configurable:!0}),yL=!1;function N_e(){const[e,t]=p.useState(yL);return p.useEffect(()=>{yL||(yL=!0,t(!0))},[]),e}$Q(N_e,"useIsHydrated");var R_e=By[" useSyncExternalStore ".trim().toString()];function I_e(){return()=>{}}$Q(I_e,"subscribe");function P_e(){return R_e(I_e,()=>!0,()=>!1)}$Q(P_e,"useIsHydratedModern");var dat=typeof R_e=="function"?P_e:N_e,fat=Object.defineProperty,Xy=(e,t)=>fat(e,"name",{value:t,configurable:!0}),vL="rovingFocusGroup.onEntryFocus",hat={bubbles:!1,cancelable:!0},EP="RovingFocusGroup",[RF,D_e,pat]=EQ(EP),[mat,Kw]=bc(EP,[pat]),[gat,bat]=mat(EP),yat=p.forwardRef(Xy(function(t,n){return o.jsx(RF.Provider,{scope:t.__scopeRovingFocusGroup,children:o.jsx(RF.Slot,{scope:t.__scopeRovingFocusGroup,children:o.jsx(vat,{...t,ref:n})})})},"RovingFocusGroup")),vat=p.forwardRef(Xy(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,m=p.useRef(null),g=yr(n,m),b=IC(a),[v,y]=ed({prop:l,defaultProp:c??null,onChange:u,caller:EP}),[w,x]=p.useState(!1),O=Md(d),S=D_e(i),k=p.useRef(!1),[C,E]=p.useState(0);return p.useEffect(()=>{const R=m.current;if(R)return R.addEventListener(vL,O),()=>R.removeEventListener(vL,O)},[O]),o.jsx(gat,{scope:i,orientation:r,dir:b,loop:s,currentTabStopId:v,onItemFocus:p.useCallback(R=>y(R),[y]),onItemShiftTab:p.useCallback(()=>x(!0),[]),onFocusableItemAdd:p.useCallback(()=>E(R=>R+1),[]),onFocusableItemRemove:p.useCallback(()=>E(R=>R-1),[]),children:o.jsx(Fr.div,{tabIndex:w||C===0?-1:0,"data-orientation":r,...h,ref:g,style:{outline:"none",...t.style},onMouseDown:_n(t.onMouseDown,()=>{k.current=!0}),onFocus:_n(t.onFocus,R=>{const A=!k.current;if(R.target===R.currentTarget&&A&&!w){const N=new CustomEvent(vL,hat);if(R.currentTarget.dispatchEvent(N),!N.defaultPrevented){const T=S().filter(P=>P.focusable),j=T.find(P=>P.active),_=T.find(P=>P.id===v),D=[j,_,...T].filter(Boolean).map(P=>P.ref.current);FQ(D,f)}}k.current=!1}),onBlur:_n(t.onBlur,()=>x(!1))})})},"RovingFocusGroupImpl")),xat="RovingFocusGroupItem",wat=p.forwardRef(Xy(function(t,n){const{__scopeRovingFocusGroup:i,focusable:r=!0,active:s=!1,tabStopId:a,children:l,...c}=t,u=cg(),d=a||u,f=bat(xat,i),h=f.currentTabStopId===d,m=D_e(i),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:v}=f,y=dat();return Hu(()=>{if(!(!y||!r))return g(),()=>b()},[y,r,g,b]),p.useEffect(()=>{if(!(y||!r))return g(),()=>b()},[y,r,g,b]),o.jsx(RF.ItemSlot,{scope:i,id:d,focusable:r,active:s,children:o.jsx(Fr.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:_n(t.onMouseDown,w=>{r?f.onItemFocus(d):w.preventDefault()}),onFocus:_n(t.onFocus,()=>f.onItemFocus(d)),onKeyDown:_n(t.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){f.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const x=L_e(w,f.orientation,f.dir);if(x!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let S=m().filter(k=>k.focusable).map(k=>k.ref.current);if(x==="last")S.reverse();else if(x==="prev"||x==="next"){x==="prev"&&S.reverse();const k=S.indexOf(w.currentTarget);S=f.loop?$_e(S,k+1):S.slice(k+1)}setTimeout(()=>FQ(S))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:v!=null}):l})})},"RovingFocusGroupItem")),Oat={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function M_e(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Xy(M_e,"getDirectionAwareKey");function L_e(e,t,n){const i=M_e(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return Oat[i]}Xy(L_e,"getFocusIntent");function FQ(e,t=!1){const n=document.activeElement;for(const i of e)if(i===n||(i.focus({preventScroll:t}),document.activeElement!==n))return}Xy(FQ,"focusFirst");function $_e(e,t){return e.map((n,i)=>e[(t+i)%e.length])}Xy($_e,"wrapArray");var BQ=yat,UQ=wat,kat=Object.defineProperty,ir=(e,t)=>kat(e,"name",{value:t,configurable:!0}),IF=["Enter"," "],Sat=["ArrowDown","PageUp","Home"],F_e=["ArrowUp","PageDown","End"],Eat=[...Sat,...F_e],Cat={ltr:[...IF,"ArrowRight"],rtl:[...IF,"ArrowLeft"]},Tat={ltr:["ArrowLeft"],rtl:["ArrowRight"]},CP="Menu",[tE,Aat,_at]=EQ(CP),[Yy,B_e]=bc(CP,[_at,Ww,Kw]),TP=Ww(),U_e=Kw(),[Q_e,Rg]=Yy(CP),[jat,DC]=Yy(CP),Nat=ir(e=>{const{__scopeMenu:t,open:n=!1,children:i,dir:r,onOpenChange:s,modal:a=!0}=e,l=TP(t),[c,u]=p.useState(null),d=p.useRef(!1),f=Md(s),h=IC(r);return p.useEffect(()=>{const m=ir(()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},"handleKeyDown"),g=ir(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),p.useEffect(()=>{if(!n)return;const m=ir(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[n,f]),o.jsx(SP,{...l,children:o.jsx(Q_e,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:o.jsx(jat,{scope:t,onClose:p.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:a,children:i})})})},"Menu"),z_e=p.forwardRef(ir(function(t,n){const{__scopeMenu:i,...r}=t,s=TP(i);return o.jsx(MQ,{...s,...r,ref:n})},"MenuAnchor")),V_e="MenuPortal",[Rat,H_e]=Yy(V_e,{forceMount:void 0}),Iat=ir(e=>{const{__scopeMenu:t,forceMount:n,children:i,container:r}=e,s=Rg(V_e,t);return o.jsx(Rat,{scope:t,forceMount:n,children:o.jsx(qf,{present:n||s.open,children:o.jsx(jQ,{asChild:!0,container:r,children:i})})})},"MenuPortal"),jd="MenuContent",[Pat,QQ]=Yy(jd),Dat=p.forwardRef(ir(function(t,n){const i=H_e(jd,t.__scopeMenu),{forceMount:r=i.forceMount,...s}=t,a=Rg(jd,t.__scopeMenu),l=DC(jd,t.__scopeMenu);return o.jsx(tE.Provider,{scope:t.__scopeMenu,children:o.jsx(qf,{present:r||a.open,children:o.jsx(tE.Slot,{scope:t.__scopeMenu,children:l.modal?o.jsx(Mat,{...s,ref:n}):o.jsx(Lat,{...s,ref:n})})})})},"MenuContent")),Mat=p.forwardRef(ir(function(t,n){const i=Rg(jd,t.__scopeMenu),r=p.useRef(null),s=yr(n,r);return p.useEffect(()=>{const a=r.current;if(a)return k_e(a)},[]),o.jsx(zQ,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:_n(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentModal")),Lat=p.forwardRef(ir(function(t,n){const i=Rg(jd,t.__scopeMenu);return o.jsx(zQ,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentNonModal")),$at=cp("MenuContent.ScrollLock"),zQ=p.forwardRef(ir(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:m,onDismiss:g,disableOutsideScroll:b,...v}=t,y=Rg(jd,i),w=DC(jd,i),x=TP(i),O=U_e(i),S=Aat(i),[k,C]=p.useState(null),E=p.useRef(null),R=yr(n,E,y.onContentChange),A=p.useRef(0),N=p.useRef(""),T=p.useRef(0),j=p.useRef(null),_=p.useRef("right"),I=p.useRef(0),D=b?RQ:p.Fragment,P=b?{as:$at,allowPinchZoom:!0}:void 0,L=ir(M=>{var z,Y;const H=N.current+M,K=S().filter(ae=>!ae.disabled),F=document.activeElement,q=(z=K.find(ae=>ae.ref.current===F))==null?void 0:z.textValue,Q=K.map(ae=>ae.textValue),X=J_e(Q,H,q),ne=(Y=K.find(ae=>ae.textValue===X))==null?void 0:Y.ref.current;ir(function ae(Ee){N.current=Ee,window.clearTimeout(A.current),Ee!==""&&(A.current=window.setTimeout(()=>ae(""),1e3))},"updateSearch")(H),ne&&setTimeout(()=>ne.focus())},"handleTypeaheadSearch");p.useEffect(()=>()=>window.clearTimeout(A.current),[]),wP();const B=p.useCallback(M=>{var K,F;return _.current===((K=j.current)==null?void 0:K.side)&&tje(M,(F=j.current)==null?void 0:F.area)},[]);return o.jsx(Pat,{scope:i,searchRef:N,onItemEnter:p.useCallback(M=>{B(M)&&M.preventDefault()},[B]),onItemLeave:p.useCallback(M=>{var H;B(M)||((H=E.current)==null||H.focus(),C(null))},[B]),onTriggerLeave:p.useCallback(M=>{B(M)&&M.preventDefault()},[B]),pointerGraceTimerRef:T,onPointerGraceIntentChange:p.useCallback(M=>{j.current=M},[]),children:o.jsx(D,{...P,children:o.jsx(l_e,{asChild:!0,trapped:s,onMountAutoFocus:_n(a,M=>{var H;M.preventDefault(),(H=E.current)==null||H.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:o.jsx(TQ,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,children:o.jsx(BQ,{asChild:!0,...O,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:k,onCurrentTabStopIdChange:C,onEntryFocus:_n(u,M=>{w.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(LQ,{role:"menu","aria-orientation":"vertical","data-state":HQ(y.open),"data-radix-menu-content":"",dir:w.dir,...x,...v,ref:R,style:{outline:"none",...v.style},onKeyDown:_n(v.onKeyDown,M=>{const K=M.target.closest("[data-radix-menu-content]")===M.currentTarget,F=M.ctrlKey||M.altKey||M.metaKey,q=M.key.length===1;K&&(M.key==="Tab"&&M.preventDefault(),!F&&q&&L(M.key));const Q=E.current;if(M.target!==Q||!Eat.includes(M.key))return;M.preventDefault();const ne=S().filter(z=>!z.disabled).map(z=>z.ref.current);F_e.includes(M.key)&&ne.reverse(),Y_e(ne)}),onBlur:_n(t.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(A.current),N.current="")}),onPointerMove:_n(t.onPointerMove,ew(M=>{const H=M.target,K=I.current!==M.clientX;if(M.currentTarget.contains(H)&&K){const F=M.clientX>I.current?"right":"left";_.current=F,I.current=M.clientX}}))})})})})})})},"MenuContentImpl")),Fat=p.forwardRef(ir(function(t,n){const{__scopeMenu:i,...r}=t;return o.jsx(Fr.div,{role:"group",...r,ref:n})},"MenuGroup")),PF="MenuItem",_Z="menu.itemSelect",VQ=p.forwardRef(ir(function(t,n){const{disabled:i=!1,onSelect:r,...s}=t,a=p.useRef(null),l=DC(PF,t.__scopeMenu),c=QQ(PF,t.__scopeMenu),u=yr(n,a),d=p.useRef(!1),f=ir(()=>{const h=a.current;if(!i&&h){const m=new CustomEvent(_Z,{bubbles:!0,cancelable:!0});h.addEventListener(_Z,g=>r==null?void 0:r(g),{once:!0}),SQ(h,m),m.defaultPrevented?d.current=!1:l.onClose()}},"handleSelect");return o.jsx(q_e,{...s,ref:u,disabled:i,onClick:_n(t.onClick,f),onPointerDown:h=>{var m;(m=t.onPointerDown)==null||m.call(t,h),d.current=!0},onPointerUp:_n(t.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:_n(t.onKeyDown,h=>{i||h.target!==h.currentTarget||c.searchRef.current!==""&&h.key===" "||IF.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})},"MenuItem")),q_e=p.forwardRef(ir(function(t,n){const{__scopeMenu:i,disabled:r=!1,textValue:s,...a}=t,l=QQ(PF,i),c=U_e(i),u=p.useRef(null),d=yr(n,u),[f,h]=p.useState(!1),[m,g]=p.useState("");return p.useEffect(()=>{const b=u.current;b&&g((b.textContent??"").trim())},[a.children]),o.jsx(tE.ItemSlot,{scope:i,disabled:r,textValue:s??m,children:o.jsx(UQ,{asChild:!0,...c,focusable:!r,children:o.jsx(Fr.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:d,onPointerMove:_n(t.onPointerMove,ew(b=>{r?l.onItemLeave(b):(l.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:_n(t.onPointerLeave,ew(b=>l.onItemLeave(b))),onFocus:_n(t.onFocus,()=>h(!0)),onBlur:_n(t.onBlur,()=>h(!1))})})})},"MenuItemImpl")),Bat=p.forwardRef(ir(function(t,n){const{checked:i=!1,onCheckedChange:r,...s}=t;return o.jsx(K_e,{scope:t.__scopeMenu,checked:i,children:o.jsx(VQ,{role:"menuitemcheckbox","aria-checked":nE(i)?"mixed":i,...s,ref:n,"data-state":AP(i),onSelect:_n(s.onSelect,()=>r==null?void 0:r(nE(i)?!0:!i),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),Uat="MenuRadioGroup",[Qat,zat]=Yy(Uat,{value:void 0,onValueChange:ir(()=>{},"onValueChange")}),Vat=p.forwardRef(ir(function(t,n){const{value:i,onValueChange:r,...s}=t,a=Md(r);return o.jsx(Qat,{scope:t.__scopeMenu,value:i,onValueChange:a,children:o.jsx(Fat,{...s,ref:n})})},"MenuRadioGroup")),Hat="MenuRadioItem",qat=p.forwardRef(ir(function(t,n){const{value:i,...r}=t,s=zat(Hat,t.__scopeMenu),a=i===s.value;return o.jsx(K_e,{scope:t.__scopeMenu,checked:a,children:o.jsx(VQ,{role:"menuitemradio","aria-checked":a,...r,ref:n,"data-state":AP(a),onSelect:_n(r.onSelect,()=>{var l;return(l=s.onValueChange)==null?void 0:l.call(s,i)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),W_e="MenuItemIndicator",[K_e,Wat]=Yy(W_e,{checked:!1}),Kat=p.forwardRef(ir(function(t,n){const{__scopeMenu:i,forceMount:r,...s}=t,a=Wat(W_e,i);return o.jsx(qf,{present:r||nE(a.checked)||a.checked===!0,children:o.jsx(Fr.span,{...s,ref:n,"data-state":AP(a.checked)})})},"MenuItemIndicator")),Gat=p.forwardRef(ir(function(t,n){const{__scopeMenu:i,...r}=t;return o.jsx(Fr.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})},"MenuSeparator")),G_e="MenuSub",[Xat,X_e]=Yy(G_e),Yat=ir(e=>{const{__scopeMenu:t,children:n,open:i=!1,onOpenChange:r}=e,s=Rg(G_e,t),a=TP(t),[l,c]=p.useState(null),[u,d]=p.useState(null),f=Md(r);return p.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),o.jsx(SP,{...a,children:o.jsx(Q_e,{scope:t,open:i,onOpenChange:f,content:u,onContentChange:d,children:o.jsx(Xat,{scope:t,contentId:cg(),triggerId:cg(),trigger:l,onTriggerChange:c,children:n})})})},"MenuSub"),zA="MenuSubTrigger",Zat=p.forwardRef(ir(function(t,n){const i=Rg(zA,t.__scopeMenu),r=DC(zA,t.__scopeMenu),s=X_e(zA,t.__scopeMenu),a=QQ(zA,t.__scopeMenu),l=p.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=a,d={__scopeMenu:t.__scopeMenu},f=p.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);p.useEffect(()=>f,[f]),p.useEffect(()=>{const m=c.current;return()=>{window.clearTimeout(m),u(null)}},[c,u]);const h=yr(n,s.onTriggerChange);return o.jsx(z_e,{asChild:!0,...d,children:o.jsx(q_e,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?s.contentId:void 0,"data-state":HQ(i.open),...t,ref:h,onClick:m=>{var g;(g=t.onClick)==null||g.call(t,m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),i.open||i.onOpenChange(!0))},onPointerMove:_n(t.onPointerMove,ew(m=>{a.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!i.open&&!l.current&&(a.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{i.onOpenChange(!0),f()},100))})),onPointerLeave:_n(t.onPointerLeave,ew(m=>{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,w=y==="right",x=w?-5:5,O=g[w?"left":"right"],S=g[w?"right":"left"];a.onPointerGraceIntentChange({area:[{x:m.clientX+x,y:m.clientY},{x:O,y:g.top},{x:S,y:g.top},{x:S,y:g.bottom},{x:O,y:g.bottom}],side:y}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(m),m.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:_n(t.onKeyDown,m=>{var b;t.disabled||m.target!==m.currentTarget||a.searchRef.current!==""&&m.key===" "||Cat[r.dir].includes(m.key)&&(i.onOpenChange(!0),(b=i.content)==null||b.focus(),m.preventDefault())})})})},"MenuSubTrigger")),Jat="MenuSubContent",elt=p.forwardRef(ir(function(t,n){const i=H_e(jd,t.__scopeMenu),{forceMount:r=i.forceMount,align:s="start",...a}=t,l=Rg(jd,t.__scopeMenu),c=DC(jd,t.__scopeMenu),u=X_e(Jat,t.__scopeMenu),d=p.useRef(null),f=yr(n,d);return o.jsx(tE.Provider,{scope:t.__scopeMenu,children:o.jsx(qf,{present:r||l.open,children:o.jsx(tE.Slot,{scope:t.__scopeMenu,children:o.jsx(zQ,{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 m;c.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:_n(t.onFocusOutside,h=>{h.target!==u.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:_n(t.onEscapeKeyDown,h=>{c.onClose(),h.preventDefault()}),onKeyDown:_n(t.onKeyDown,h=>{var b;const m=h.currentTarget.contains(h.target),g=Tat[c.dir].includes(h.key);m&&g&&(l.onOpenChange(!1),(b=u.trigger)==null||b.focus(),h.preventDefault())})})})})})},"MenuSubContent"));function HQ(e){return e?"open":"closed"}ir(HQ,"getOpenState");function nE(e){return e==="indeterminate"}ir(nE,"isIndeterminate");function AP(e){return nE(e)?"indeterminate":e?"checked":"unchecked"}ir(AP,"getCheckedState");function Y_e(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}ir(Y_e,"focusFirst");function Z_e(e,t){return e.map((n,i)=>e[(t+i)%e.length])}ir(Z_e,"wrapArray");function J_e(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=Z_e(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}ir(J_e,"getNextMatch");function eje(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}ir(eje,"isPointInPolygon");function tje(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return eje(n,t)}ir(tje,"isPointerInGraceArea");function ew(e){return t=>t.pointerType==="mouse"?e(t):void 0}ir(ew,"whenMouse");var tlt=Nat,nlt=z_e,ilt=Iat,rlt=Dat,slt=VQ,olt=Bat,alt=Vat,llt=qat,clt=Kat,ult=Gat,dlt=Yat,flt=Zat,hlt=elt,plt=Object.defineProperty,pu=(e,t)=>plt(e,"name",{value:t,configurable:!0}),qQ="DropdownMenu",[mlt,Ocn]=bc(qQ,[B_e]),mu=B_e(),[glt,nje]=mlt(qQ),blt=pu(e=>{const{__scopeDropdownMenu:t,children:n,dir:i,open:r,defaultOpen:s,onOpenChange:a,modal:l=!0}=e,c=mu(t),u=p.useRef(null),[d,f]=ed({prop:r,defaultProp:s??!1,onChange:a,caller:qQ});return o.jsx(glt,{scope:t,triggerId:cg(),triggerRef:u,contentId:cg(),open:d,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(h=>!h),[f]),modal:l,children:o.jsx(tlt,{...c,open:d,onOpenChange:f,dir:i,modal:l,children:n})})},"DropdownMenu"),ylt="DropdownMenuTrigger",vlt=p.forwardRef(pu(function(t,n){const{__scopeDropdownMenu:i,disabled:r=!1,...s}=t,a=nje(ylt,i),l=mu(i),c=yr(n,a.triggerRef);return o.jsx(nlt,{asChild:!0,...l,children:o.jsx(Fr.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:_n(t.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(a.onOpenToggle(),a.open||u.preventDefault())}),onKeyDown:_n(t.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&a.onOpenToggle(),u.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),xlt=pu(e=>{const{__scopeDropdownMenu:t,...n}=e,i=mu(t);return o.jsx(ilt,{...i,...n})},"DropdownMenuPortal"),wlt="DropdownMenuContent",Olt=p.forwardRef(pu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=nje(wlt,i),a=mu(i),l=p.useRef(!1);return o.jsx(rlt,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...r,ref:n,onCloseAutoFocus:_n(t.onCloseAutoFocus,c=>{var u;l.current||(u=s.triggerRef.current)==null||u.focus(),l.current=!1,c.preventDefault()}),onInteractOutside:_n(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")),klt=p.forwardRef(pu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=mu(i);return o.jsx(slt,{...s,...r,ref:n})},"DropdownMenuItem")),Slt=p.forwardRef(pu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=mu(i);return o.jsx(olt,{...s,...r,ref:n})},"DropdownMenuCheckboxItem")),Elt=p.forwardRef(pu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=mu(i);return o.jsx(alt,{...s,...r,ref:n})},"DropdownMenuRadioGroup")),Clt=p.forwardRef(pu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=mu(i);return o.jsx(llt,{...s,...r,ref:n})},"DropdownMenuRadioItem")),Tlt=p.forwardRef(pu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=mu(i);return o.jsx(clt,{...s,...r,ref:n})},"DropdownMenuItemIndicator")),Alt=p.forwardRef(pu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=mu(i);return o.jsx(ult,{...s,...r,ref:n})},"DropdownMenuSeparator")),_lt=pu(e=>{const{__scopeDropdownMenu:t,children:n,open:i,onOpenChange:r,defaultOpen:s}=e,a=mu(t),[l,c]=ed({prop:i,defaultProp:s??!1,onChange:r,caller:"DropdownMenuSub"});return o.jsx(dlt,{...a,open:l,onOpenChange:c,children:n})},"DropdownMenuSub"),jlt=p.forwardRef(pu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=mu(i);return o.jsx(flt,{...s,...r,ref:n})},"DropdownMenuSubTrigger")),Nlt=p.forwardRef(pu(function(t,n){const{__scopeDropdownMenu:i,...r}=t,s=mu(i);return o.jsx(hlt,{...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")),Rlt=blt,Ilt=vlt,ije=xlt,Plt=Olt,rje=klt,Dlt=Slt,Mlt=Elt,Llt=Clt,sje=Tlt,$lt=Alt,Flt=_lt,Blt=jlt,Ult=Nlt,Qlt=Object.defineProperty,Ig=(e,t)=>Qlt(e,"name",{value:t,configurable:!0}),WQ="Popover",[oje,kcn]=bc(WQ,[Ww]),KQ=Ww(),[zlt,Gw]=oje(WQ),Vlt=Ig(e=>{const{__scopePopover:t,children:n,open:i,defaultOpen:r,onOpenChange:s,modal:a=!1}=e,l=KQ(t),c=p.useRef(null),[u,d]=p.useState(!1),[f,h]=ed({prop:i,defaultProp:r??!1,onChange:s,caller:WQ});return o.jsx(SP,{...l,children:o.jsx(zlt,{scope:t,contentId:cg(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:p.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:a,children:n})})},"Popover"),Hlt="PopoverTrigger",qlt=p.forwardRef(Ig(function(t,n){const{__scopePopover:i,...r}=t,s=Gw(Hlt,i),a=KQ(i),l=yr(n,s.triggerRef),c=o.jsx(Fr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":GQ(s.open),...r,ref:l,onClick:_n(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:o.jsx(MQ,{asChild:!0,...a,children:c})},"PopoverTrigger")),aje="PopoverPortal",[Wlt,Klt]=oje(aje,{forceMount:void 0}),Glt=Ig(e=>{const{__scopePopover:t,forceMount:n,children:i,container:r}=e,s=Gw(aje,t);return o.jsx(Wlt,{scope:t,forceMount:n,children:o.jsx(qf,{present:n||s.open,children:o.jsx(jQ,{asChild:!0,container:r,children:i})})})},"PopoverPortal"),iE="PopoverContent",Xlt=p.forwardRef(Ig(function(t,n){const i=Klt(iE,t.__scopePopover),{forceMount:r=i.forceMount,...s}=t,a=Gw(iE,t.__scopePopover);return o.jsx(qf,{present:r||a.open,children:a.modal?o.jsx(Zlt,{...s,ref:n}):o.jsx(Jlt,{...s,ref:n})})},"PopoverContent")),Ylt=cp("PopoverContent.RemoveScroll"),Zlt=p.forwardRef(Ig(function(t,n){const i=Gw(iE,t.__scopePopover),r=p.useRef(null),s=yr(n,r),a=p.useRef(!1);return p.useEffect(()=>{const l=r.current;if(l)return k_e(l)},[]),o.jsx(RQ,{as:Ylt,allowPinchZoom:!0,children:o.jsx(lje,{...t,ref:s,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_n(t.onCloseAutoFocus,l=>{var c;l.preventDefault(),a.current||(c=i.triggerRef.current)==null||c.focus()}),onPointerDownOutside:_n(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:_n(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),Jlt=p.forwardRef(Ig(function(t,n){const i=Gw(iE,t.__scopePopover),r=p.useRef(!1),s=p.useRef(!1);return o.jsx(lje,{...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")),lje=p.forwardRef(Ig(function(t,n){const{__scopePopover:i,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...h}=t,m=Gw(iE,i),g=KQ(i);return wP(),o.jsx(l_e,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:o.jsx(TQ,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:o.jsx(LQ,{"data-state":GQ(m.open),role:"dialog",id:m.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 GQ(e){return e?"open":"closed"}Ig(GQ,"getState");var cje=Vlt,uje=qlt,dje=Glt,fje=Xlt,ect=Object.defineProperty,cl=(e,t)=>ect(e,"name",{value:t,configurable:!0}),hje="Radio",[tct,pje]=bc(hje),[nct,_P]=tct(hje);function mje(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]=p.useState(null),[m,g]=p.useState(null),b=p.useRef(!1),[v,y]=p.useReducer(O=>O+1,0),w=f?!!s||!!f.closest("form"):!0,x={checked:n,disabled:r,required:c,name:a,form:s,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:b,userInteractionCount:v,onUserInteraction:y,isFormControl:w,bubbleInput:m,setBubbleInput:g,onCheck:cl(()=>l==null?void 0:l(),"onCheck")};return o.jsx(nct,{scope:t,...x,children:gje(d)?d(x):i})}cl(mje,"RadioProvider");var ict="RadioTrigger",rct=p.forwardRef(cl(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:m}=_P(ict,t),g=yr(r,c);return o.jsx(Fr.button,{type:"button",role:"radio","aria-checked":s,"data-state":XQ(s),"data-disabled":a?"":void 0,disabled:a,value:l,...i,ref:g,onClick:_n(n,b=>{s||(f(),u()),m&&h&&(d.current=b.isPropagationStopped(),d.current||b.stopPropagation())})})},"RadioTrigger")),sct="RadioIndicator",oct=p.forwardRef(cl(function(t,n){const{__scopeRadio:i,forceMount:r,...s}=t,a=_P(sct,i);return o.jsx(qf,{present:r||a.checked,children:o.jsx(Fr.span,{"data-state":XQ(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:n})})},"RadioIndicator")),act="RadioBubbleInput",lct=p.forwardRef(cl(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:m,hasConsumerStoppedPropagationRef:g,userInteractionCount:b}=_P(act,t),v=yr(r,m),y=PC(s),w=p.useRef(!1),x=p.useRef(a),O=p.useRef(b);p.useEffect(()=>{const k=h;if(!k)return;const C=window.HTMLInputElement.prototype,R=Object.getOwnPropertyDescriptor(C,"checked").set,A=b!==O.current;O.current=b;const N=x.current!==a;x.current=a;const T=!(A&&g.current);if(N&&R){w.current=!A;const j=new Event("click",{bubbles:T});R.call(k,a),k.dispatchEvent(j),w.current=!1}},[h,a,g,b]);const S=p.useRef(a);return o.jsx(Fr.input,{type:"radio","aria-hidden":!0,defaultChecked:S.current,required:l,disabled:c,name:u,value:d,form:f,...i,tabIndex:-1,ref:v,onClick:_n(n,k=>{w.current&&k.stopPropagation()}),style:{...i.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function gje(e){return typeof e=="function"}cl(gje,"isFunction");function XQ(e){return e?"checked":"unchecked"}cl(XQ,"getState");var cct=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],YQ="RadioGroup",[uct,Scn]=bc(YQ,[Kw,pje]),bje=Kw(),jP=pje(),[dct,fct]=uct(YQ),hct=p.forwardRef(cl(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:m,...g}=t,b=bje(i),v=IC(f),[y,w]=ed({prop:l,defaultProp:a??null,onChange:m,caller:YQ}),[x,O]=p.useState(null),S=yr(n,O),k=p.useRef(y);return p.useEffect(()=>{const C=s?x==null?void 0:x.ownerDocument.getElementById(s):x==null?void 0:x.closest("form");if(C instanceof HTMLFormElement){const E=cl(()=>w(k.current),"reset");return C.addEventListener("reset",E),()=>C.removeEventListener("reset",E)}},[x,s,w]),o.jsx(dct,{scope:i,name:r,form:s,required:c,disabled:u,value:y,onValueChange:w,children:o.jsx(BQ,{asChild:!0,...b,orientation:d,dir:v,loop:h,children:o.jsx(Fr.div,{role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":u?"":void 0,dir:v,...g,ref:S})})})},"RadioGroup")),pct="RadioGroupItemProvider",mct="RadioGroupItemTrigger";function yje(e){const{__scopeRadioGroup:t,value:n,disabled:i,children:r,internal_do_not_use_render:s}=e,a=fct(pct,t),l=jP(t),c=a.disabled||i;return o.jsx(mje,{...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})}cl(yje,"RadioGroupItemProvider");var gct=p.forwardRef(cl(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=bje(i),a=jP(i),{checked:l,disabled:c}=_P(mct,a.__scopeRadio),u=p.useRef(null),d=yr(n,u),f=p.useRef(!1);return p.useEffect(()=>{const h=cl(g=>{cct.includes(g.key)&&(f.current=!0)},"handleKeyDown"),m=cl(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),o.jsx(UQ,{asChild:!0,...s,focusable:!c,active:l,children:o.jsx(rct,{...a,...r,ref:d,onKeyDown:_n(r.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:_n(r.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),bct=p.forwardRef(cl(function(t,n){const{__scopeRadioGroup:i,value:r,disabled:s,...a}=t;return o.jsx(yje,{__scopeRadioGroup:i,value:r,disabled:s,internal_do_not_use_render:({isFormControl:l})=>o.jsxs(o.Fragment,{children:[o.jsx(gct,{...a,ref:n,__scopeRadioGroup:i}),l&&o.jsx(yct,{__scopeRadioGroup:i})]})})},"RadioGroupItem")),yct=p.forwardRef(cl(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=jP(i);return o.jsx(lct,{...s,...r,ref:n})},"RadioGroupItemBubbleInput")),vct=p.forwardRef(cl(function(t,n){const{__scopeRadioGroup:i,...r}=t,s=jP(i);return o.jsx(oct,{...s,...r,ref:n})},"RadioGroupIndicator")),xct=Object.defineProperty,ug=(e,t)=>xct(e,"name",{value:t,configurable:!0}),ZQ="Switch",[wct,Ecn]=bc(ZQ),[Oct,JQ]=wct(ZQ);function vje(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,m]=ed({prop:n,defaultProp:r??!1,onChange:c,caller:ZQ}),[g,b]=p.useState(null),[v,y]=p.useState(null),w=p.useRef(!1),[x,O]=p.useReducer(C=>C+1,0),S=g?!!a||!!g.closest("form"):!0,k={checked:h,setChecked:m,disabled:s,control:g,setControl:b,name:l,form:a,value:d,hasConsumerStoppedPropagationRef:w,userInteractionCount:x,onUserInteraction:O,required:u,defaultChecked:r,isFormControl:S,bubbleInput:v,setBubbleInput:y};return o.jsx(Oct,{scope:t,...k,children:xje(f)?f(k):i})}ug(vje,"SwitchProvider");var kct="SwitchTrigger",Sct=p.forwardRef(ug(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:m,onUserInteraction:g,isFormControl:b,bubbleInput:v}=JQ(kct,t),y=yr(r,f),w=p.useRef(u);return p.useEffect(()=>{const x=a?s==null?void 0:s.ownerDocument.getElementById(a):s==null?void 0:s.form;if(x instanceof HTMLFormElement){const O=ug(()=>h(w.current),"reset");return x.addEventListener("reset",O),()=>x.removeEventListener("reset",O)}},[s,a,h]),o.jsx(Fr.button,{type:"button",role:"switch","aria-checked":u,"aria-required":d,"data-state":ez(u),"data-disabled":c?"":void 0,disabled:c,value:l,...i,ref:y,onClick:_n(n,x=>{g(),h(O=>!O),v&&b&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})},"SwitchTrigger")),Ect=p.forwardRef(ug(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(vje,{__scopeSwitch:i,checked:s,defaultChecked:a,disabled:c,required:l,onCheckedChange:d,name:r,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>o.jsxs(o.Fragment,{children:[o.jsx(Sct,{...h,ref:n,__scopeSwitch:i}),m&&o.jsx(_ct,{__scopeSwitch:i})]})})},"Switch")),Cct="SwitchThumb",Tct=p.forwardRef(ug(function(t,n){const{__scopeSwitch:i,...r}=t,s=JQ(Cct,i);return o.jsx(Fr.span,{"data-state":ez(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:n})},"SwitchThumb")),Act="SwitchBubbleInput",_ct=p.forwardRef(ug(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:m,form:g,bubbleInput:b,setBubbleInput:v}=JQ(Act,t),y=yr(r,v),w=PC(s),x=p.useRef(!1),O=p.useRef(c),S=p.useRef(l);p.useEffect(()=>{const C=b;if(!C)return;const E=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(E,"checked").set,N=l!==S.current;S.current=l;const T=O.current!==c;O.current=c;const j=!(N&&a.current);if(T&&A){x.current=!N;const _=new Event("click",{bubbles:j});A.call(C,c),C.dispatchEvent(_),x.current=!1}},[b,c,a,l]);const k=p.useRef(c);return o.jsx(Fr.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??k.current,required:d,disabled:f,name:h,value:m,form:g,...i,tabIndex:-1,ref:y,onClick:_n(n,C=>{x.current&&C.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function xje(e){return typeof e=="function"}ug(xje,"isFunction");function ez(e){return e?"checked":"unchecked"}ug(ez,"getState");var jct=Object.defineProperty,Nct=(e,t)=>jct(e,"name",{value:t,configurable:!0}),Rct="Toggle",Ict=p.forwardRef(Nct(function(t,n){const{pressed:i,defaultPressed:r,onPressedChange:s,...a}=t,[l,c]=ed({prop:i,onChange:s,defaultProp:r??!1,caller:Rct});return o.jsx(Fr.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":t.disabled?"":void 0,...a,ref:n,onClick:_n(t.onClick,()=>{t.disabled||c(!l)})})},"Toggle")),Pct=Object.defineProperty,dg=(e,t)=>Pct(e,"name",{value:t,configurable:!0}),Xw="ToggleGroup",[wje,Ccn]=bc(Xw,[Kw]),Oje=Kw(),Dct=p.forwardRef(dg(function(t,n){const{type:i,...r}=t;if(i==="single"){const s=r;return o.jsx(Mct,{role:"radiogroup",...s,ref:n})}if(i==="multiple"){const s=r;return o.jsx(Lct,{role:"toolbar",...s,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${Xw}\``)},"ToggleGroup")),[kje,Sje]=wje(Xw),Mct=p.forwardRef(dg(function(t,n){const{value:i,defaultValue:r,onValueChange:s=dg(()=>{},"onValueChange"),...a}=t,[l,c]=ed({prop:i,defaultProp:r??"",onChange:s,caller:Xw});return o.jsx(kje,{scope:t.__scopeToggleGroup,type:"single",value:p.useMemo(()=>l?[l]:[],[l]),onItemActivate:c,onItemDeactivate:p.useCallback(()=>c(""),[c]),children:o.jsx(Eje,{...a,ref:n})})},"ToggleGroupImplSingle")),Lct=p.forwardRef(dg(function(t,n){const{value:i,defaultValue:r,onValueChange:s=dg(()=>{},"onValueChange"),...a}=t,[l,c]=ed({prop:i,defaultProp:r??[],onChange:s,caller:Xw}),u=p.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=p.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return o.jsx(kje,{scope:t.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:u,onItemDeactivate:d,children:o.jsx(Eje,{...a,ref:n})})},"ToggleGroupImplMultiple")),[$ct,Fct]=wje(Xw),Eje=p.forwardRef(dg(function(t,n){const{__scopeToggleGroup:i,disabled:r=!1,rovingFocus:s=!0,orientation:a,dir:l,loop:c=!0,...u}=t,d=Oje(i),f=IC(l),h={dir:f,...u};return o.jsx($ct,{scope:i,rovingFocus:s,disabled:r,children:s?o.jsx(BQ,{asChild:!0,...d,orientation:a,dir:f,loop:c,children:o.jsx(Fr.div,{...h,ref:n})}):o.jsx(Fr.div,{...h,ref:n})})},"ToggleGroupImpl")),DF="ToggleGroupItem",Bct=p.forwardRef(dg(function(t,n){const i=Sje(DF,t.__scopeToggleGroup),r=Fct(DF,t.__scopeToggleGroup),s=Oje(t.__scopeToggleGroup),a=i.value.includes(t.value),l=r.disabled||t.disabled,c={...t,pressed:a,disabled:l},u=p.useRef(null);return r.rovingFocus?o.jsx(UQ,{asChild:!0,...s,focusable:!l,active:a,ref:u,children:o.jsx(jZ,{...c,ref:n})}):o.jsx(jZ,{...c,ref:n})},"ToggleGroupItem")),jZ=p.forwardRef(dg(function(t,n){const{__scopeToggleGroup:i,value:r,...s}=t,a=Sje(DF,i),l={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},c=a.type==="single"?l:void 0;return o.jsx(Ict,{...c,...s,ref:n,onPressedChange:u=>{u?a.onItemActivate(r):a.onItemDeactivate(r)}})},"ToggleGroupItemImpl")),Uct=Object.defineProperty,ka=(e,t)=>Uct(e,"name",{value:t,configurable:!0}),[tz,Tcn]=bc("Tooltip",[Ww]),nz=Ww(),Qct="TooltipProvider",zct=700,MF="tooltip.open",[Vct,iz]=tz(Qct),Hct=ka(e=>{const{__scopeTooltip:t,delayDuration:n=zct,skipDelayDuration:i=300,disableHoverableContent:r=!1,children:s}=e,a=p.useRef(!0),l=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),o.jsx(Vct,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),a.current=!1)},[i]),onClose:p.useCallback(()=>{i<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,i))},[i]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(u=>{l.current=u},[]),disableHoverableContent:r,children:s})},"TooltipProvider"),LF="Tooltip",[qct,MC]=tz(LF),Wct=ka(e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:r,onOpenChange:s,disableHoverableContent:a,delayDuration:l}=e,c=iz(LF,e.__scopeTooltip),u=nz(t),[d,f]=p.useState(null),[h,m]=p.useState(void 0),g=cg(),b=p.useRef(0),v=a??c.disableHoverableContent,y=l??c.delayDuration,w=p.useRef(!1),[x,O]=ed({prop:i,defaultProp:r??!1,onChange:ka(A=>{A?(c.onOpen(),document.dispatchEvent(new CustomEvent(MF))):c.onClose(),s==null||s(A)},"onChange"),caller:LF}),S=p.useMemo(()=>x?w.current?"delayed-open":"instant-open":"closed",[x]),k=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,w.current=!1,O(!0)},[O]),C=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,O(!1)},[O]),E=p.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{w.current=!0,O(!0),b.current=0},y)},[y,O]);p.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const R=h??g;return o.jsx(SP,{...u,children:o.jsx(qct,{scope:t,contentId:R,setContentId:m,open:x,stateAttribute:S,trigger:d,onTriggerChange:f,onTriggerEnter:p.useCallback(()=>{c.isOpenDelayedRef.current?E():k()},[c.isOpenDelayedRef,E,k]),onTriggerLeave:p.useCallback(()=>{v?C():(window.clearTimeout(b.current),b.current=0)},[C,v]),onOpen:k,onClose:C,disableHoverableContent:v,children:n})})},"Tooltip"),NZ="TooltipTrigger",Kct=p.forwardRef(ka(function(t,n){const{__scopeTooltip:i,...r}=t,s=MC(NZ,i),a=iz(NZ,i),l=nz(i),c=p.useRef(null),u=yr(n,c,s.onTriggerChange),d=p.useRef(!1),f=p.useRef(!1),h=p.useCallback(()=>d.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),o.jsx(MQ,{asChild:!0,...l,children:o.jsx(Fr.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:u,onPointerMove:_n(t.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:_n(t.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:_n(t.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:_n(t.onFocus,()=>{d.current||s.onOpen()}),onBlur:_n(t.onBlur,s.onClose),onClick:_n(t.onClick,s.onClose)})})},"TooltipTrigger")),Cje="TooltipPortal",[Gct,Xct]=tz(Cje,{forceMount:void 0}),Yct=ka(e=>{const{__scopeTooltip:t,forceMount:n,children:i,container:r}=e,s=MC(Cje,t);return o.jsx(Gct,{scope:t,forceMount:n,children:o.jsx(qf,{present:n||s.open,children:o.jsx(jQ,{asChild:!0,container:r,children:i})})})},"TooltipPortal"),rE="TooltipContent",Zct=p.forwardRef(ka(function(t,n){const i=Xct(rE,t.__scopeTooltip),{forceMount:r=i.forceMount,side:s="top",...a}=t,l=MC(rE,t.__scopeTooltip);return o.jsx(qf,{present:r||l.open,children:l.disableHoverableContent?o.jsx(Tje,{side:s,...a,ref:n}):o.jsx(Jct,{side:s,...a,ref:n})})},"TooltipContent")),Jct=p.forwardRef(ka(function(t,n){const i=MC(rE,t.__scopeTooltip),r=iz(rE,t.__scopeTooltip),s=p.useRef(null),a=yr(n,s),[l,c]=p.useState(null),{trigger:u,onClose:d}=i,f=s.current,{onPointerInTransitChange:h}=r,m=p.useCallback(()=>{c(null),h(!1)},[h]),g=p.useCallback((b,v)=>{const y=b.currentTarget,w={x:b.clientX,y:b.clientY},x=Aje(w,y.getBoundingClientRect()),O=_je(w,x),S=jje(v.getBoundingClientRect()),k=Rje([...O,...S]);c(k),h(!0)},[h]);return p.useEffect(()=>()=>m(),[m]),p.useEffect(()=>{if(u&&f){const b=ka(y=>g(y,f),"handleTriggerLeave"),v=ka(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,m]),p.useEffect(()=>{if(l){const b=ka(v=>{const y=v.target,w={x:v.clientX,y:v.clientY},x=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),O=!Nje(w,l);x?m():O&&(m(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,f,l,d,m]),o.jsx(Tje,{...t,ref:a})},"TooltipContentHoverable")),eut=F2e("TooltipContent"),Tje=p.forwardRef(ka(function(t,n){const{__scopeTooltip:i,children:r,"aria-label":s,id:a,onEscapeKeyDown:l,onPointerDownOutside:c,...u}=t,d=MC(rE,i),f=nz(i),{onClose:h}=d;p.useEffect(()=>(document.addEventListener(MF,h),()=>document.removeEventListener(MF,h)),[h]),p.useEffect(()=>{if(d.trigger){const g=ka(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:m}=d;return Hu(()=>(m(a),()=>{m(void 0)}),[a,m]),o.jsx(TQ,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:h,children:o.jsxs(LQ,{"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(eut,{children:r}),s?o.jsx(Tst,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function Aje(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")}}ka(Aje,"getExitSideFromRect");function _je(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}ka(_je,"getPaddedExitPoints");function jje(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}]}ka(jje,"getPointsFromRect");function Nje(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}ka(Nje,"isPointInPolygon");function Rje(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),Ije(t)}ka(Rje,"getHull");function Ije(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)}ka(Ije,"getHullPresorted");var tut=Hct,nut=Wct,Pje=Kct,iut=Yct,rut=Zct;function fg(e){const t=p.useRef(e);return t.current=e,t}let tw=[],VA=!1;const RZ=e=>{var t,n;if(e.key==="Escape"){const[i]=tw;i&&(e.preventDefault(),(n=(t=i.callback).current)==null||n.call(t))}},Dje=()=>{tw.length>0&&!VA?(document.body.addEventListener("keydown",RZ),VA=!0):tw.length===0&&VA&&(document.body.removeEventListener("keydown",RZ),VA=!1)},sut=e=>{tw.unshift(e),Dje()},out=({id:e})=>{tw=tw.filter(t=>t.id!==e),Dje()},LC=(e,t)=>{const n=p.useId(),i=fg(t);p.useEffect(()=>{if(!e)return;const r={id:n,callback:i};return sut(r),()=>out(r)},[n,e,i])},aut=p.createContext(null);function Mje(){const e=p.useContext(aut);return(e==null?void 0:e.linkComponent)??"a"}function $C(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const lut=()=>I2e,IZ=(e,t=!1,n="TransitionGroup")=>{const i=[];return p.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},Q0=()=>{},z0=e=>{const t=p.useRef(e);return t.current=e,p.useCallback(n=>t.current(n),[])};function cut(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 uut(e,t,n){if((I2e||lst)&&t&&n>1)throw new Error(`Cannot use forwardRef with multiple children in <${e} />`)}const dut="_TransitionGroupChild_1hv1z_1",fut={TransitionGroupChild:dut},Lje={enter:!1,enterActive:!1,exit:!1,exitActive:!1,interrupted:!1},hut=e=>({...Lje,enter:!e}),put=(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 Lje}},mut=({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:m,onExit:g,onExitActive:b,onExitComplete:v})=>{const[y,w]=p.useReducer(put,hut(a||!1)),x=p.useRef(!1),O=p.useRef(null),S=p.useRef(c);S.current=c;const k=p.useRef(u);k.current=u;const C=p.useRef(null),E=p.useCallback(R=>{const A=O.current;if(!(!A||R===C.current))switch(C.current=R,R){case"enter":f(A);break;case"enter-active":h(A);break;case"enter-complete":m(A);break;case"exit":g(A);break;case"exit-active":b(A);break;case"exit-complete":v(A);break}},[f,h,m,g,b,v]);return bi.useLayoutEffect(()=>{if(!l){let N;w({type:"exit-before"}),E("exit");const T=MN(()=>{w({type:"exit-active"}),E("exit-active"),N=window.setTimeout(()=>{E("exit-complete"),d()},k.current)});return()=>{T(),N!==void 0&&clearTimeout(N)}}if(a&&!x.current){x.current=!0;return}let R;w({type:"enter-before"}),E("enter");const A=MN(()=>{w({type:"enter-active"}),E("enter-active"),R=window.setTimeout(()=>{w({type:"done"}),E("enter-complete")},S.current)});return()=>{A(),R!==void 0&&clearTimeout(R)}},[l,a,d,E]),p.useEffect(()=>()=>{x.current=!1},[]),o.jsx(t,{ref:$C([O,e]),className:ji(i,fut.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})},gut=e=>{const{enterMountDelay:t,preventMountTransition:n}=e,i=!n&&t!=null?t:null,[r,s]=p.useState(i==null);return wQ(()=>s(!0),r?null:i),r?o.jsx(mut,{...e}):null},Yw=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=lut()}=e,m=z0(e.onEnter??Q0),g=z0(e.onEnterActive??Q0),b=z0(e.onEnterComplete??Q0),v=z0(e.onExit??Q0),y=z0(e.onExitActive??Q0),w=z0(e.onExitComplete??Q0);p.Children.forEach(i,k=>{if(k&&!k.key)throw new Error("Child elements of must include a `key`")});const x=p.useCallback(k=>({component:k,shouldRender:!0,removeChild:()=>{S(C=>C.filter(E=>k.key!==E.component.key))},onEnter:m,onEnterActive:g,onEnterComplete:b,onExit:v,onExitActive:y,onExitComplete:w}),[m,g,b,v,y,w]),[O,S]=p.useState(()=>IZ(i).map(k=>({...x(k),preventMountTransition:u})));return p.useLayoutEffect(()=>{S(k=>{const C=IZ(i);return cut(C,k,x,f)})},[i,f,x]),uut("TransitionGroup",t,p.Children.count(i)),h?o.jsx(o.Fragment,{children:p.Children.map(i,k=>o.jsx(n,{ref:t,className:r,style:a,"data-transition-id":s,children:k}))}):o.jsx(o.Fragment,{children:O.map(({component:k,...C})=>o.jsx(gut,{...C,as:n,className:r,transitionId:s,enterDuration:l,exitDuration:c,enterMountDelay:d,style:a,ref:t,children:k},k.key))})},but="_Button_1864l_1",yut="_ButtonInner_1864l_4",vut="_ButtonLoader_1864l_749",xL={Button:but,ButtonInner:yut,ButtonLoader:vut},It=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:m,className:g,onClick:b,disabled:v,disabledTone:y,inert:w=u,...x}=e,O=v||w,S=p.useCallback(k=>{v||b==null||b(k)},[b,v]);return o.jsxs("button",{type:t,className:ji(xL.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:OQ,disabled:O,"aria-disabled":O,tabIndex:O?-1:void 0,"data-disabled":v?"":void 0,"data-disabled-tone":v?y:void 0,onClick:S,...x,children:[o.jsx(Yw,{className:xL.ButtonLoader,enterDuration:250,exitDuration:150,children:u&&o.jsx(NC,{},"loader")}),o.jsx("span",{className:xL.ButtonInner,children:xQ(m)})]})},xut=()=>{var e;return typeof ClipboardItem<"u"&&!!((e=navigator.clipboard)!=null&&e.write)};function wut(e){const{"text/plain":t,...n}=e;return new ClipboardItem({...n,...t?{"text/plain":new Blob([t],{type:"text/plain"})}:null})}async function Out(e,t=document.body){if(typeof e=="string")return PZ(e,t);try{return xut()?(await navigator.clipboard.write([wut(e)]),!0):e["text/plain"]?PZ(e["text/plain"],t):!1}catch{return!1}}async function PZ(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 kut="_TransitionItem_1o7b1_1",Sut={TransitionItem:kut},Eut=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}=jut(e);return o.jsx(t,{className:ji("block",l==="absolute"&&"relative",n),"data-transition-position":l,style:d,children:o.jsx(Yw,{as:t,className:ji(Sut.TransitionItem,a),enterDuration:c,exitDuration:u,insertMethod:s,preventInitialTransition:r,children:i})})},Cut=400,Tut=500,Aut=200,_ut=300;function jut({initial:e,enter:t,exit:n,forceCompositeLayer:i}){const r=cL(e),s=cL(t),a=cL(n),l=[r,a,s].some(b=>b!=="none"),c=(t==null?void 0:t.duration)??(l?Tut:Cut),u=(t==null?void 0:t.timingFunction)??(l?"var(--cubic-enter)":"ease"),d=(n==null?void 0:n.duration)??(l?_ut:Aut),f=(n==null?void 0:n.timingFunction)??(l?"var(--cubic-exit)":"ease"),h=Gy({"tg-will-change":i?"transform, opacity":"auto","tg-enter-opacity":lL((t==null?void 0:t.opacity)??1),"tg-enter-transform":s,"tg-enter-filter":uL(t),"tg-enter-duration":MA(c),"tg-enter-delay":MA((t==null?void 0:t.delay)??0),"tg-enter-timing-function":u,"tg-exit-opacity":lL((n==null?void 0:n.opacity)??0),"tg-exit-transform":a,"tg-exit-filter":uL(n),"tg-exit-duration":MA(d),"tg-exit-delay":MA((n==null?void 0:n.delay)??0),"tg-exit-timing-function":f,"tg-initial-opacity":lL((e==null?void 0:e.opacity)??(n==null?void 0:n.opacity)??0),"tg-initial-transform":r==="none"?a:r,"tg-initial-filter":uL(e??n??{})}),m=((t==null?void 0:t.delay)??0)+c,g=((n==null?void 0:n.delay)??0)+d;return{enterTotalDuration:m,exitTotalDuration:g,variables:h}}const rz=({children:e,copyValue:t,onClick:n,...i})=>{const[r,s]=p.useState(!1),a=p.useRef(null),l=c=>{r||(s(!0),n==null||n(c),Out(typeof t=="function"?t():t),a.current=window.setTimeout(()=>{s(!1)},1300))};return p.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]),o.jsxs(It,{...i,onClick:l,children:[o.jsx(Eut,{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(YS,{},"copied-icon"):o.jsx(a2e,{},"copy-icon")}),typeof e=="function"?e({copied:r}):e]})},Nut="_Menu_1t4b0_1",Rut="_MenuList_1t4b0_3",Iut="_MenuItemContent_1t4b0_53",Put="_MenuItem_1t4b0_53",Dut="_ItemActions_1t4b0_98",Mut="_PressableInner_1t4b0_117",Lut="_Separator_1t4b0_135",$ut="_SubMenuItem_1t4b0_139",Fut="_SubTriggerIcon_1t4b0_141",But="_RadioItem_1t4b0_151",Uut="_RadioIndicatorActive_1t4b0_158",Qut="_RadioIndicator_1t4b0_158",zut="_CheckboxItem_1t4b0_249",Vut="_CheckboxIndicator_1t4b0_256",Hut="_CheckboxCircle_1t4b0_269",gs={Menu:Nut,MenuList:Rut,MenuItemContent:Iut,MenuItem:Put,ItemActions:Dut,PressableInner:Mut,Separator:Lut,SubMenuItem:$ut,SubTriggerIcon:Fut,RadioItem:But,RadioIndicatorActive:Uut,RadioIndicator:Qut,CheckboxItem:zut,CheckboxIndicator:Vut,CheckboxCircle:Hut},$je=p.createContext(null),FC=()=>{const e=p.useContext($je);if(!e)throw new Error("Menu components must be wrapped in ");return e},Lr=({children:e,forceOpen:t,onOpen:n,onClose:i,modal:r=!1})=>{const[s,a]=p.useState(!1),l=t??s,c=fg(n),u=fg(i),d=p.useCallback(h=>{var m,g;a(h),h?(m=c.current)==null||m.call(c):(g=u.current)==null||g.call(u)},[c,u]);LC(s,()=>{d(!1)});const f=p.useMemo(()=>({open:l,setOpen:d}),[l,d]);return o.jsx($je.Provider,{value:f,children:o.jsx(Rlt,{open:l,onOpenChange:d,modal:r,children:e})})},qut=({className:e,children:t,disabled:n,onSelect:i,onClick:r})=>{const{open:s}=FC(),a=l=>{s||l.preventDefault()};return i?o.jsx(rje,{className:ji(gs.MenuItem,e),onSelect:i,onClick:r,disabled:n,onPointerMove:a,onPointerLeave:a,children:o.jsx("div",{className:gs.PressableInner,children:t})}):o.jsx("div",{className:ji(gs.MenuItemContent,e),children:t})},Wut=({className:e,children:t})=>o.jsx("div",{className:ji(gs.ItemActions,e),children:t}),Kut=({children:e,onClick:t})=>{const{setOpen:n}=FC();return o.jsx(It,{className:"rounded-sm",color:"secondary",size:"xs",uniform:!0,iconSize:"sm",variant:"ghost",onClick:i=>{i.stopPropagation(),n(!1),t(i)},children:e})},Gut=e=>{const{className:t,children:n,href:i,to:r,disabled:s,as:a,...l}=e,{open:c}=FC(),u=i||r,d=u?/^https?:\/\//.test(u):!0,f=Mje(),h=a||(d?"a":f),m=b=>{c||b.preventDefault()},g=d?{target:"_blank",rel:"noopener noreferrer",href:i??r}:{href:i,to:r};return o.jsx(rje,{asChild:!0,className:ji(gs.MenuItem,t),disabled:s,onPointerMove:d?void 0:m,onPointerLeave:d?void 0:m,children:o.jsx(h,{...g,...l,children:o.jsx("span",{className:gs.PressableInner,children:n})})})},Xut=({className:e})=>o.jsx($lt,{className:ji(gs.Separator,e),role:"separator"}),Yut=({children:e,side:t,sideOffset:n=5,align:i,alignOffset:r,width:s,minWidth:a,maxHeight:l})=>{const{open:c}=FC();return o.jsx(ije,{forceMount:!0,children:o.jsx(Yw,{className:gs.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:c&&o.jsx(Plt,{forceMount:!0,className:gs.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:Kh,style:Gy({"menu-width":s,"menu-min-width":a,"menu-max-height":l}),children:e},"dropdown")})})},Zut=({children:e,disabled:t})=>o.jsx(Ilt,{asChild:!0,disabled:t,children:e}),Fje=p.createContext(null),Bje=()=>{const e=p.useContext(Fje);if(!e)throw new Error("Submenu components must be wrapped in ");return e},Jut=({children:e,forceOpen:t,onOpen:n,onClose:i})=>{const[r,s]=p.useState(!1),a=p.useRef(null),l=t??r,c=fg(n),u=fg(i),d=p.useCallback(h=>{var m,g;s(h),h?(m=c.current)==null||m.call(c):(g=u.current)==null||g.call(u)},[c,u]);LC(r,()=>{var h;d(!1),(h=a.current)==null||h.focus()});const f=p.useMemo(()=>({open:l,setOpen:d,triggerRef:a}),[l,d]);return o.jsx(Fje.Provider,{value:f,children:o.jsx(Flt,{open:l,onOpenChange:d,children:e})})},edt=({className:e,children:t,disabled:n})=>{const{open:i}=FC(),{triggerRef:r}=Bje(),s=a=>{i||a.preventDefault()};return o.jsx(Blt,{ref:r,className:ji(gs.MenuItem,gs.SubMenuItem,e),disabled:n,onPointerMove:s,onPointerLeave:s,children:o.jsxs("div",{className:gs.PressableInner,children:[t,o.jsx(xit,{width:"16",height:"16",className:gs.SubTriggerIcon})]})})},tdt=({children:e,sideOffset:t=4,alignOffset:n=-6,width:i="auto",minWidth:r="auto",maxHeight:s})=>{const{open:a}=Bje();return o.jsx(ije,{forceMount:!0,children:o.jsx(Yw,{className:gs.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:a&&o.jsx(Ult,{className:gs.MenuList,sideOffset:t,alignOffset:n,avoidCollisions:!0,collisionPadding:{bottom:30,top:30,left:12,right:12},onEscapeKeyDown:Kh,style:Gy({"menu-width":i,"menu-min-width":r,"menu-max-height":s}),children:e},"submenu")})})},ndt=({children:e,value:t,onChange:n,indicatorPosition:i="end",...r})=>o.jsx(Mlt,{...r,value:t,onValueChange:s=>n(s),"data-indicator-position":i,children:e}),idt=({className:e,children:t,...n})=>o.jsx(Llt,{className:ji(gs.MenuItem,gs.RadioItem,e),...n,children:o.jsxs("div",{className:gs.PressableInner,children:[o.jsx("div",{className:gs.RadioIndicator,children:o.jsx(sje,{className:gs.RadioIndicatorActive})}),t]})}),rdt=({className:e,children:t,indicatorPosition:n="end",indicatorVariant:i="solid",...r})=>o.jsx(Dlt,{className:ji(gs.MenuItem,gs.CheckboxItem,e),...r,"data-indicator-position":n,"data-indicator-variant":i,children:o.jsxs("div",{className:gs.PressableInner,children:[o.jsx("div",{className:gs.CheckboxIndicator,children:o.jsx(sje,{children:i==="ghost"?o.jsx(YS,{className:"size-4"}):o.jsx("div",{className:gs.CheckboxCircle,children:o.jsx(YS,{className:"size-4"})})})}),t]})});Lr.Content=Yut;Lr.Item=qut;Lr.ItemActions=Wut;Lr.ItemAction=Kut;Lr.Link=Gut;Lr.Separator=Xut;Lr.Trigger=Zut;Lr.Sub=Jut;Lr.SubTrigger=edt;Lr.SubContent=tdt;Lr.CheckboxItem=rdt;Lr.RadioGroup=ndt;Lr.RadioItem=idt;const sdt="_Tooltip_16g2y_1",odt="_TriggerDecorator_16g2y_73",Uje={Tooltip:sdt,TriggerDecorator:odt},yo=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:m=5,gutterSize:g="md",contentClassName:b,onPointerDown:v,onClick:y,...w}=e,[x,O]=p.useState(!1),[S,k]=p.useState(!1);wQ(()=>k(!1),S?400:null);const C=r??x,E=A=>{typeof r!="boolean"&&(O(A),u&&k(A))},R=A=>{u&&S&&(A.preventDefault(),A.stopPropagation())};return o.jsxs(Qje,{open:C,delayDuration:a,onOpenChange:E,disableHoverableContent:!l,children:[o.jsx(Pje,{asChild:!0,children:o.jsx(L2e,{...w,ref:t,onPointerDown:A=>{R(A),v==null||v(A)},onClick:A=>{R(A),y==null||y(A)},children:n})}),o.jsx(zje,{maxWidth:s,compact:c,align:d,alignOffset:f,side:h,sideOffset:m,gutterSize:g,className:b,children:i})]})},Qje=({children:e,open:t,onOpenChange:n,...i})=>(LC(t,()=>{n(!1)}),o.jsx(tut,{children:o.jsx(nut,{open:t,onOpenChange:n,...i,children:e})})),zje=({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(iut,{children:o.jsx(rut,{...u,className:ji(Uje.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:Kh,children:e})}),adt=({children:e,asChild:t=!0,...n})=>o.jsx(Pje,{asChild:t,...n,children:e}),ldt=e=>{const{children:t,className:n,focusable:i=!0,ref:r,...s}=e,a=typeof t=="string";return o.jsx(L2e,{ref:r,...s,className:ji(Uje.TriggerDecorator,n),tabIndex:i?0:void 0,children:a?o.jsx("span",{children:t}):t})};yo.Root=Qje;yo.Content=zje;yo.Trigger=adt;yo.TriggerDecorator=ldt;const cdt=50,DZ=48;function udt(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 ddt(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 fdt(e,t,n){const i=Math.max(0,t-DZ),r=Math.min(e.length,t+n+DZ);return(i>0?"…":"")+e.slice(i,r).trim()+(r{var c;if((c=l.events)!=null&&c.length)return l;try{return await WI(t,e,l.id)}catch{return l}})),a=[];for(const l of s)for(const{text:c,role:u,ts:d}of udt(l)){const f=c.toLowerCase().indexOf(i);if(f!==-1){a.push({type:"session",appId:t,sessionId:l.id,title:ddt(l),snippet:fdt(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,cdt)}async function pdt(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await lCe(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 mdt(e,t,n,i){if(!t||!i.trim())return{results:[]};const r=await aCe(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 gdt(e,t,n){return e==="session"?{results:await hdt(n.userId,n.appId,t)}:e==="web"?pdt(n.appId,t):mdt(e,n.appId,n.userId,t)}function Vje({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 bdt(e){return o.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:o.jsx(Vje,{})})}function ydt(e){return o.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:o.jsx(Vje,{mirrored:!0})})}function vdt(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 xdt(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 wdt(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 Hje(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 qje(e){return o.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M3.25 2.25h6l3.5 3.5v8H3.25v-11Z"}),o.jsx("path",{d:"M9.25 2.25v3.5h3.5M5.5 8.25h5M5.5 10.75h4"})]})}function Odt({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 kdt({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 Sdt({active:e=!1,onClick:t}){const{t:n}=_e("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(xdt,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:n("search.nav")})]})}function Edt(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 LN(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 MZ(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 Cdt({userId:e,appId:t,agentInfo:n,capabilitiesLoading:i,agentLabel:r,onOpenSession:s}){var L,B;const{t:a,i18n:l}=_e("workspaceTools"),c=l.resolvedLanguage||l.language,[u,d]=p.useState("session"),[f,h]=p.useState(""),[m,g]=p.useState([]),[b,v]=p.useState(),[y,w]=p.useState(!1),[x,O]=p.useState(!1),[S,k]=p.useState(!1),C=p.useRef(0),E=p.useRef(null),R=Edt(t,n,i,a),A=R.find(M=>M.id===u),N=u==="knowledge"?(L=n==null?void 0:n.components)==null?void 0:L.find(M=>M.source==="knowledgebase"||M.kind==="knowledgebase"):u==="memory"?(B=n==null?void 0:n.components)==null?void 0:B.find(M=>M.source==="long_term_memory"||M.kind==="memory"):void 0;p.useEffect(()=>{C.current+=1,d("session"),g([]),v(void 0),O(!1),w(!1),k(!1)},[t]),p.useEffect(()=>{if(!S)return;function M(H){var K;(K=E.current)!=null&&K.contains(H.target)||k(!1)}return document.addEventListener("pointerdown",M),()=>document.removeEventListener("pointerdown",M)},[S]);async function T(M,H){var Q;const K=M.trim();if(!K||!((Q=R.find(X=>X.id===H))!=null&&Q.ready))return;const F=++C.current;w(!0),O(!0);let q;try{q=await gdt(H,K,{userId:e,appId:t})}catch(X){const ne=X instanceof Error?X.message:String(X);q={results:[],note:a("search.failed",{message:ne})}}F===C.current&&(g(q.results),v(q.note),w(!1))}function j(M){C.current+=1,h(M),g([]),v(void 0),O(!1),w(!1)}function _(M){C.current+=1,d(M),k(!1),g([]),v(void 0),O(!1),w(!1)}const I=!!(A!=null&&A.ready),D=t?u==="web"?a("search.placeholder.web"):u==="knowledge"?a("search.placeholder.knowledge",{name:(N==null?void 0:N.name)??a("search.placeholder.knowledgeFallback")}):u==="memory"?a("search.placeholder.memory",{name:(N==null?void 0:N.name)??a("search.placeholder.memoryFallback")}):a("search.placeholder.session"):a("search.placeholder.selectAgent"),P=N!=null&&N.backend?LN(N.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:E,children:[o.jsxs("button",{className:"search-source-picker",type:"button","aria-label":a("search.sourceTypeAria",{label:(A==null?void 0:A.label)??a("search.notSelected")}),"aria-haspopup":"listbox","aria-expanded":S,onClick:()=>k(M=>!M),children:[o.jsx("span",{children:(A==null?void 0:A.label)??a("search.sourceType")}),P&&o.jsx("small",{children:P}),o.jsx(kdt,{open:S})]}),S&&o.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":a("search.selectSource"),children:R.map(M=>{var F,q;const H=M.id==="knowledge"?(F=n==null?void 0:n.components)==null?void 0:F.find(Q=>Q.source==="knowledgebase"||Q.kind==="knowledgebase"):M.id==="memory"?(q=n==null?void 0:n.components)==null?void 0:q.find(Q=>Q.source==="long_term_memory"||Q.kind==="memory"):void 0,K=H?[H.name,H.backend?LN(H.backend,a):""].filter(Boolean).join(" · "):M.ready?M.description:M.unavailableLabel;return o.jsxs("button",{type:"button",role:"option","aria-selected":u===M.id,disabled:!M.ready,onClick:()=>_(M.id),children:[o.jsx("span",{children:M.label}),K&&o.jsx("small",{children:K})]},M.id)})})]}),o.jsx("span",{className:"search-box-divider","aria-hidden":!0}),o.jsx("input",{className:"search-input",value:f,onChange:M=>j(M.target.value),onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),T(f,u))},placeholder:D,disabled:!I,autoFocus:!0}),o.jsx("button",{className:"search-go",onClick:()=>void T(f,u),disabled:!f.trim()||y,"aria-label":a("search.nav"),children:y?o.jsx(Bi,{className:"icon spin"}):o.jsx(Odt,{className:"icon"})})]}),o.jsx("div",{className:"search-results",children:I?x?y?null:b?o.jsx("div",{className:"search-empty",children:b}):m.length===0&&x?o.jsx("div",{className:"search-empty",children:a("search.noResults",{query:f.trim()})}):m.map((M,H)=>o.jsx(Tdt,{result:M,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"):(A==null?void 0:A.unavailableLabel)??a("search.sourceUnavailable"):a("search.noAgentHint")})})]})}function Tdt({result:e,agentLabel:t,onOpen:n,locale:i}){const{t:r}=_e("workspaceTools");switch(e.type){case"session":return o.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[o.jsx(y2e,{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?` · ${MZ(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(yP,{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(wy,{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(LZ,{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?` · ${LN(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(LZ,{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?` · ${LN(e.sourceType,r)}`:"",e.ts?` · ${MZ(e.ts,i)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function LZ({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 Adt({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 _dt({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 Wje(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 NP="/assets/media/logo-DCsNZy-k.svg",sz="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";function jdt(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.5 4.5H6a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-13a2 2 0 0 0-2-2h-2.5"}),o.jsx("rect",{x:"8.5",y:"2.5",width:"7",height:"4",rx:"1.5"}),o.jsx("path",{d:"m8 13 2.5 2.5L16 10"})]})}const $Z="(max-width: 860px)";function FZ({title:e}){const t=p.useRef(null),n=p.useRef(null),[i,r]=p.useState(0);p.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 Ndt(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 Rdt(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 Idt(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 Pdt={super_admin:"account.roles.super_admin",admin:"account.roles.admin",developer:"account.roles.developer",user:"account.roles.user"};function Ddt({activePage:e,access:t,userInfo:n,onAgentKitCli:i,onDeveloperResources:r,onSystemInfo:s,onIssueFeedback:a,onLogout:l}){const{t:c,i18n:u}=_e(["sidebar","common"]),[d,f]=p.useState("");if(!n)return null;const h=WYe(n)||c("sidebar:account.defaultUser"),m=typeof n.email=="string"?n.email.trim():"",g=Idt(h),b=KYe(n),v=b===d?"":b,y=oC(u.resolvedLanguage??u.language)??sC;return o.jsx("div",{className:"sidebar-user",children:o.jsxs("div",{className:"sidebar-user-row",children:[o.jsxs(Lr,{modal:!0,children:[o.jsx(Lr.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(Lr.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(zo,{color:"secondary",size:"sm",variant:"soft",pill:!0,children:c(`sidebar:${Pdt[t.role]}`)})]}),m&&m!==h&&o.jsx("div",{className:"account-sub",children:m})]})]}),o.jsxs(Lr.Item,{className:"account-menu-action",onSelect:s,children:[o.jsx(Tp,{className:"icon","aria-hidden":"true"}),c("sidebar:account.systemInfo")]}),o.jsxs(Lr.Sub,{children:[o.jsx(Lr.SubTrigger,{className:"account-menu-action",children:o.jsxs("span",{className:"account-menu-action__label",children:[o.jsx(Rdt,{className:"icon"}),c("sidebar:account.language")]})}),o.jsx(Lr.SubContent,{sideOffset:6,minWidth:136,children:o.jsx(Lr.RadioGroup,{value:y,onChange:w=>{oVe(w)},indicatorPosition:"end",children:D9.map(w=>o.jsx(Lr.RadioItem,{value:w,children:c(`common:languageNames.${w}`)},w))})})]}),o.jsxs(Lr.Item,{className:"account-menu-action",onSelect:a,children:[o.jsx(Wje,{className:"icon"}),c("sidebar:account.issueFeedback")]}),o.jsxs(Lr.Item,{className:"account-menu-action",onSelect:l,children:[o.jsx(drt,{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(yo,{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(_it,{className:"icon"})})}),o.jsx(yo,{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(bit,{className:"icon"})})})]})]})})}function Mdt({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:m,onReviewCenter:g,onAddAgent:b,onMyAgents:v,onWorkspace:y,onApplications:w,onCronJobs:x,onAgentKitCli:O,onDeveloperResources:S,onSystemInfo:k,onUserManagement:C,onIssueFeedback:E,onPickSession:R,onDeleteSession:A,userInfo:N,onLogout:T}){const{t:j}=_e("sidebar"),_=Q=>(s==null?void 0:s[Q])!==!1,I=a.role==="admin"||a.role==="super_admin",D=a.capabilities.manageUsers&&!!C,[P,L]=p.useState(null),B=p.useRef(typeof window<"u"&&window.matchMedia($Z).matches),[M,H]=p.useState(B.current),K=n.map(Q=>({id:Q.id,title:xP(Q.events,j("history.newConversation")),createdAt:(Q.lastUpdateTime??0)*1e3})).sort((Q,X)=>X.createdAt-Q.createdAt),F=()=>{B.current=!1,H(Q=>!Q),L(null)};p.useEffect(()=>{const Q=window.matchMedia($Z),X=ne=>{ne.matches?H(z=>z||(B.current=!0,!0)):B.current&&(B.current=!1,H(!1))};return Q.addEventListener("change",X),()=>Q.removeEventListener("change",X)},[]);const q=t==="byteplus"?sz:NP;return o.jsxs("aside",{className:`sidebar ${M?"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||q,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:F,"aria-label":j(M?"navigation.expand":"navigation.collapse"),title:j(M?"navigation.expand":"navigation.collapse"),children:M?o.jsx(ydt,{className:"icon"}):o.jsx(bdt,{className:"icon"})})]}),o.jsxs("nav",{className:"sidebar-nav","aria-label":j("navigation.label"),children:[_("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(vdt,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.newChat")})]}),_("search")&&o.jsx(Sdt,{active:r==="search",onClick:f}),o.jsxs("button",{className:`new-chat new-chat--agents${r==="agents"?" is-active":""}`,onClick:v,"aria-label":j("navigation.agents"),"aria-current":r==="agents"?"page":void 0,title:j("navigation.agents"),children:[o.jsx(wdt,{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:y,"aria-label":j("navigation.workspaces"),"aria-current":r==="workspaces"?"page":void 0,title:j("navigation.workspaces"),children:[o.jsx(Hit,{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:m,"aria-label":j("navigation.library"),"aria-current":r==="library"?"page":void 0,title:j("navigation.library"),children:[o.jsx(Hje,{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(pQ,{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:w,"aria-label":j("navigation.automations"),"aria-current":r==="applications"?"page":void 0,title:j("navigation.automations"),children:[o.jsx(Ndt,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.automations")})]})]}),I||D?o.jsxs("nav",{className:"sidebar-nav sidebar-nav--administration","aria-label":j("navigation.administration"),children:[o.jsx("div",{className:"sidebar-nav-group-title","aria-hidden":"true",children:j("navigation.administration")}),I?o.jsxs("button",{type:"button",className:`new-chat new-chat--review-center${r==="review-center"?" is-active":""}`,onClick:g,"aria-label":j("navigation.reviewCenter"),"aria-current":r==="review-center"?"page":void 0,title:j("navigation.reviewCenter"),children:[o.jsx(jdt,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.reviewCenter")})]}):null,D?o.jsxs("button",{type:"button",className:`new-chat${r==="users"?" is-active":""}`,onClick:C,"aria-label":j("navigation.users"),"aria-current":r==="users"?"page":void 0,title:j("navigation.users"),children:[o.jsx(Jrt,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:j("navigation.users")})]}):null]}):null]}),_("history")&&o.jsxs("div",{className:"sidebar-history",children:[o.jsxs("div",{className:"history-head",children:[o.jsx("span",{children:j("history.title")}),_("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(Rl,{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(Q=>{const X=Q.id===u.currentThreadId,ne=Q.name||Q.preview||`Thread ${Q.id.slice(0,8)}`,z=Q.id===u.busyThreadId;return o.jsxs("div",{className:`history-item ${X?"active":""}`,children:[o.jsxs("button",{type:"button",className:"history-item-btn",onClick:()=>u.onSelect(Q.id),"aria-current":X?"page":void 0,title:ne,disabled:z,children:[o.jsx(FZ,{title:ne}),X?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:ne}),title:j("history.more"),disabled:z,onClick:()=>L(Y=>Y===Q.id?null:Q.id),children:o.jsx(oZ,{className:"icon"})}),P===Q.id?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>L(null)}),o.jsx("div",{className:"history-menu",children:o.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{L(null),u.onDelete(Q)},children:[o.jsx(lg,{className:"icon"})," ",j("history.delete")]})})]}):null]},Q.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:[K.length===0?o.jsx("div",{className:"history-empty",children:j("history.empty")}):null,K.map(Q=>{const X=Q.id===i,ne=(l==null?void 0:l.has(Q.id))===!0,z=!ne&&(c==null?void 0:c.has(Q.id))===!0;return o.jsxs("div",{className:`history-item ${X?"active":""}`,children:[o.jsxs("button",{className:"history-item-btn",onClick:()=>R(Q.id),"aria-current":X?"page":void 0,title:Q.title,children:[o.jsx(FZ,{title:Q.title}),z&&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:[ne?o.jsx(NC,{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:Q.title}),title:j("history.more"),onClick:()=>L(Y=>Y===Q.id?null:Q.id),children:o.jsx(oZ,{className:"icon"})})]}),P===Q.id&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>L(null)}),o.jsx("div",{className:"history-menu",children:o.jsxs("button",{type:"button",className:"menu-item menu-item--danger",onClick:()=>{L(null),A(Q.id)},children:[o.jsx(lg,{className:"icon"})," ",j("history.delete")]})})]})]},Q.id)})]})})]}),o.jsx("div",{className:"sidebar-footer",children:o.jsx(Ddt,{activePage:r,access:a,userInfo:N,onAgentKitCli:O,onDeveloperResources:S,onSystemInfo:k,onIssueFeedback:E,onLogout:T})})]})}function Ho(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,i;n{}};function RP(){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}})}X_.prototype=RP.prototype={constructor:X_,on:function(e,t){var n=this._,i=$dt(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)),UZ.hasOwnProperty(t)?{space:UZ[t],local:e}:e}function Bdt(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===$F&&t.documentElement.namespaceURI===$F?t.createElement(e):t.createElementNS(n,e)}}function Udt(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Kje(e){var t=IP(e);return(t.local?Udt:Bdt)(t)}function Qdt(){}function oz(e){return e==null?Qdt:function(){return this.querySelector(e)}}function zdt(e){typeof e!="function"&&(e=oz(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r=x&&(x=w+1);!(S=v[x])&&++x=0;)(a=i[r])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function pft(e){e||(e=mft);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 gft(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function bft(){return Array.from(this)}function yft(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?_ft:typeof t=="function"?Nft:jft)(e,t,n??"")):nw(this.node(),e)}function nw(e,t){return e.style.getPropertyValue(t)||Jje(e).getComputedStyle(e,null).getPropertyValue(t)}function Ift(e){return function(){delete this[e]}}function Pft(e,t){return function(){this[e]=t}}function Dft(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Mft(e,t){return arguments.length>1?this.each((t==null?Ift:typeof t=="function"?Dft:Pft)(e,t)):this.node()[e]}function eNe(e){return e.trim().split(/^|\s+/)}function az(e){return e.classList||new tNe(e)}function tNe(e){this._node=e,this._names=eNe(e.getAttribute("class")||"")}tNe.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 nNe(e,t){for(var n=az(e),i=-1,r=t.length;++i=0&&(n=t.slice(i+1),t=t.slice(0,i)),{type:t,name:n}})}function uht(e){return function(){var t=this.__on;if(t){for(var n=0,i=-1,r=t.length,s;n()=>e;function FF(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}})}FF.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function xht(e){return!e.ctrlKey&&!e.button}function wht(){return this.parentNode}function Oht(e,t){return t??{x:e.x,y:e.y}}function kht(){return navigator.maxTouchPoints||"ontouchstart"in this}function lNe(){var e=xht,t=wht,n=Oht,i=kht,r={},s=RP("start","drag","end"),a=0,l,c,u,d,f=0;function h(O){O.on("mousedown.drag",m).filter(i).on("touchstart.drag",v).on("touchmove.drag",y,vht).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(O,S){if(!(d||!e.call(this,O,S))){var k=x(this,t.call(this,O,S),O,S,"mouse");k&&(qc(O.view).on("mousemove.drag",g,sE).on("mouseup.drag",b,sE),oNe(O.view),wL(O),u=!1,l=O.clientX,c=O.clientY,k("start",O))}}function g(O){if(ux(O),!u){var S=O.clientX-l,k=O.clientY-c;u=S*S+k*k>f}r.mouse("drag",O)}function b(O){qc(O.view).on("mousemove.drag mouseup.drag",null),aNe(O.view,u),ux(O),r.mouse("end",O)}function v(O,S){if(e.call(this,O,S)){var k=O.changedTouches,C=t.call(this,O,S),E=k.length,R,A;for(R=0;R>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?qA(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?qA(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=Eht.exec(e))?new sc(t[1],t[2],t[3],1):(t=Cht.exec(e))?new sc(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Tht.exec(e))?qA(t[1],t[2],t[3],t[4]):(t=Aht.exec(e))?qA(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=_ht.exec(e))?KZ(t[1],t[2]/100,t[3]/100,1):(t=jht.exec(e))?KZ(t[1],t[2]/100,t[3]/100,t[4]):QZ.hasOwnProperty(e)?HZ(QZ[e]):e==="transparent"?new sc(NaN,NaN,NaN,0):null}function HZ(e){return new sc(e>>16&255,e>>8&255,e&255,1)}function qA(e,t,n,i){return i<=0&&(e=t=n=NaN),new sc(e,t,n,i)}function Iht(e){return e instanceof UC||(e=ky(e)),e?(e=e.rgb(),new sc(e.r,e.g,e.b,e.opacity)):new sc}function BF(e,t,n,i){return arguments.length===1?Iht(e):new sc(e,t,n,i??1)}function sc(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}lz(sc,BF,cNe(UC,{brighter(e){return e=e==null?FN:Math.pow(FN,e),new sc(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?oE:Math.pow(oE,e),new sc(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new sc(iy(this.r),iy(this.g),iy(this.b),BN(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:qZ,formatHex:qZ,formatHex8:Pht,formatRgb:WZ,toString:WZ}));function qZ(){return`#${Lb(this.r)}${Lb(this.g)}${Lb(this.b)}`}function Pht(){return`#${Lb(this.r)}${Lb(this.g)}${Lb(this.b)}${Lb((isNaN(this.opacity)?1:this.opacity)*255)}`}function WZ(){const e=BN(this.opacity);return`${e===1?"rgb(":"rgba("}${iy(this.r)}, ${iy(this.g)}, ${iy(this.b)}${e===1?")":`, ${e})`}`}function BN(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function iy(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Lb(e){return e=iy(e),(e<16?"0":"")+e.toString(16)}function KZ(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Sd(e,t,n,i)}function uNe(e){if(e instanceof Sd)return new Sd(e.h,e.s,e.l,e.opacity);if(e instanceof UC||(e=ky(e)),!e)return new Sd;if(e instanceof Sd)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 Sd(a,l,c,e.opacity)}function Dht(e,t,n,i){return arguments.length===1?uNe(e):new Sd(e,t,n,i??1)}function Sd(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}lz(Sd,Dht,cNe(UC,{brighter(e){return e=e==null?FN:Math.pow(FN,e),new Sd(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?oE:Math.pow(oE,e),new Sd(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 sc(OL(e>=240?e-240:e+120,r,i),OL(e,r,i),OL(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new Sd(GZ(this.h),WA(this.s),WA(this.l),BN(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=BN(this.opacity);return`${e===1?"hsl(":"hsla("}${GZ(this.h)}, ${WA(this.s)*100}%, ${WA(this.l)*100}%${e===1?")":`, ${e})`}`}}));function GZ(e){return e=(e||0)%360,e<0?e+360:e}function WA(e){return Math.max(0,Math.min(1,e||0))}function OL(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 PP=e=>()=>e;function dNe(e,t){return function(n){return e+n*t}}function Mht(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 Acn(e,t){var n=t-e;return n?dNe(e,n>180||n<-180?n-360*Math.round(n/360):n):PP(isNaN(e)?t:e)}function Lht(e){return(e=+e)==1?fNe:function(t,n){return n-t?Mht(t,n,e):PP(isNaN(t)?n:t)}}function fNe(e,t){var n=t-e;return n?dNe(e,n):PP(isNaN(e)?t:e)}const UN=function e(t){var n=Lht(t);function i(r,s){var a=n((r=BF(r)).r,(s=BF(s)).r),l=n(r.g,s.g),c=n(r.b,s.b),u=fNe(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 $ht(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:hf(i,r)})),n=kL.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(r(f)+"rotate(",null,i)-2,x:hf(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:hf(u,d)}):d&&f.push(r(f)+"skewX("+d+i)}function c(u,d,f,h,m,g){if(u!==f||d!==h){var b=m.push(r(m)+"scale(",null,",",null,")");g.push({i:b-4,x:hf(u,f)},{i:b-2,x:hf(d,h)})}else(f!==1||h!==1)&&m.push(r(m)+"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(m){for(var g=-1,b=h.length,v;++g=0&&e._call.call(void 0,t),e=e._next;--iw}function ZZ(){Sy=(zN=lE.now())+DP,iw=tk=0;try{Jht()}finally{iw=0,tpt(),Sy=0}}function ept(){var e=lE.now(),t=e-zN;t>gNe&&(DP-=t,zN=e)}function tpt(){for(var e,t=QN,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:QN=n);nk=e,zF(i)}function zF(e){if(!iw){tk&&(tk=clearTimeout(tk));var t=e-Sy;t>24?(e<1/0&&(tk=setTimeout(ZZ,e-lE.now()-DP)),cO&&(cO=clearInterval(cO))):(cO||(zN=lE.now(),cO=setInterval(ept,gNe)),iw=1,bNe(ZZ))}}function JZ(e,t,n){var i=new VN;return t=t==null?0:+t,i.restart(r=>{i.stop(),e(r+t)},t,n),i}var npt=RP("start","end","cancel","interrupt"),ipt=[],vNe=0,eJ=1,VF=2,Z_=3,tJ=4,HF=5,J_=6;function MP(e,t,n,i,r,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;rpt(e,n,{name:t,index:i,group:r,on:npt,tween:ipt,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:vNe})}function uz(e,t){var n=zd(e,t);if(n.state>vNe)throw new Error("too late; already scheduled");return n}function Wf(e,t){var n=zd(e,t);if(n.state>Z_)throw new Error("too late; already running");return n}function zd(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function rpt(e,t,n){var i=e.__transition,r;i[t]=n,n.timer=yNe(s,0,n.time);function s(u){n.state=eJ,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var d,f,h,m;if(n.state!==eJ)return c();for(d in i)if(m=i[d],m.name===n.name){if(m.state===Z_)return JZ(a);m.state===tJ?(m.state=J_,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete i[d]):+dVF&&i.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function Ppt(e,t,n){var i,r,s=Ipt(t)?uz:Wf;return function(){var a=s(this,e),l=a.on;l!==i&&(r=(i=l).copy()).on(t,n),a.on=r}}function Dpt(e,t){var n=this._id;return arguments.length<2?zd(this.node(),n).on.on(e):this.each(Ppt(n,e,t))}function Mpt(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Lpt(){return this.on("end.remove",Mpt(this._id))}function $pt(e){var t=this._name,n=this._id;typeof e!="function"&&(e=oz(e));for(var i=this._groups,r=i.length,s=new Array(r),a=0;a()=>e;function cmt(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 $h(e,t,n){this.k=e,this.x=t,this.y=n}$h.prototype={constructor:$h,scale:function(e){return e===1?this:new $h(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new $h(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 LP=new $h(1,0,0);kNe.prototype=$h.prototype;function kNe(e){for(;!e.__zoom;)if(!(e=e.parentNode))return LP;return e.__zoom}function SL(e){e.stopImmediatePropagation()}function uO(e){e.preventDefault(),e.stopImmediatePropagation()}function umt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function dmt(){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 nJ(){return this.__zoom||LP}function fmt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function hmt(){return navigator.maxTouchPoints||"ontouchstart"in this}function pmt(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 SNe(){var e=umt,t=dmt,n=pmt,i=fmt,r=hmt,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Y_,u=RP("start","zoom","end"),d,f,h,m=500,g=150,b=0,v=10;function y(_){_.property("__zoom",nJ).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",A).filter(r).on("touchstart.zoom",N).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",j).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(_,I,D,P){var L=_.selection?_.selection():_;L.property("__zoom",nJ),_!==L?S(_,I,D,P):L.interrupt().each(function(){k(this,arguments).event(P).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},y.scaleBy=function(_,I,D,P){y.scaleTo(_,function(){var L=this.__zoom.k,B=typeof I=="function"?I.apply(this,arguments):I;return L*B},D,P)},y.scaleTo=function(_,I,D,P){y.transform(_,function(){var L=t.apply(this,arguments),B=this.__zoom,M=D==null?O(L):typeof D=="function"?D.apply(this,arguments):D,H=B.invert(M),K=typeof I=="function"?I.apply(this,arguments):I;return n(x(w(B,K),M,H),L,a)},D,P)},y.translateBy=function(_,I,D,P){y.transform(_,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),a)},null,P)},y.translateTo=function(_,I,D,P,L){y.transform(_,function(){var B=t.apply(this,arguments),M=this.__zoom,H=P==null?O(B):typeof P=="function"?P.apply(this,arguments):P;return n(LP.translate(H[0],H[1]).scale(M.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof D=="function"?-D.apply(this,arguments):-D),B,a)},P,L)};function w(_,I){return I=Math.max(s[0],Math.min(s[1],I)),I===_.k?_:new $h(I,_.x,_.y)}function x(_,I,D){var P=I[0]-D[0]*_.k,L=I[1]-D[1]*_.k;return P===_.x&&L===_.y?_:new $h(_.k,P,L)}function O(_){return[(+_[0][0]+ +_[1][0])/2,(+_[0][1]+ +_[1][1])/2]}function S(_,I,D,P){_.on("start.zoom",function(){k(this,arguments).event(P).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(P).end()}).tween("zoom",function(){var L=this,B=arguments,M=k(L,B).event(P),H=t.apply(L,B),K=D==null?O(H):typeof D=="function"?D.apply(L,B):D,F=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),q=L.__zoom,Q=typeof I=="function"?I.apply(L,B):I,X=c(q.invert(K).concat(F/q.k),Q.invert(K).concat(F/Q.k));return function(ne){if(ne===1)ne=Q;else{var z=X(ne),Y=F/z[2];ne=new $h(Y,K[0]-z[0]*Y,K[1]-z[1]*Y)}M.zoom(null,ne)}})}function k(_,I,D){return!D&&_.__zooming||new C(_,I)}function C(_,I){this.that=_,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(_,I),this.taps=0}C.prototype={event:function(_){return _&&(this.sourceEvent=_),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(_,I){return this.mouse&&_!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&_!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&_!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(_){var I=qc(this.that).datum();u.call(_,this.that,new cmt(_,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),I)}};function E(_,...I){if(!e.apply(this,arguments))return;var D=k(this,I).event(_),P=this.__zoom,L=Math.max(s[0],Math.min(s[1],P.k*Math.pow(2,i.apply(this,arguments)))),B=xd(_);if(D.wheel)(D.mouse[0][0]!==B[0]||D.mouse[0][1]!==B[1])&&(D.mouse[1]=P.invert(D.mouse[0]=B)),clearTimeout(D.wheel);else{if(P.k===L)return;D.mouse=[B,P.invert(B)],ej(this),D.start()}uO(_),D.wheel=setTimeout(M,g),D.zoom("mouse",n(x(w(P,L),D.mouse[0],D.mouse[1]),D.extent,a));function M(){D.wheel=null,D.end()}}function R(_,...I){if(h||!e.apply(this,arguments))return;var D=_.currentTarget,P=k(this,I,!0).event(_),L=qc(_.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",F,!0),B=xd(_,D),M=_.clientX,H=_.clientY;oNe(_.view),SL(_),P.mouse=[B,this.__zoom.invert(B)],ej(this),P.start();function K(q){if(uO(q),!P.moved){var Q=q.clientX-M,X=q.clientY-H;P.moved=Q*Q+X*X>b}P.event(q).zoom("mouse",n(x(P.that.__zoom,P.mouse[0]=xd(q,D),P.mouse[1]),P.extent,a))}function F(q){L.on("mousemove.zoom mouseup.zoom",null),aNe(q.view,P.moved),uO(q),P.event(q).end()}}function A(_,...I){if(e.apply(this,arguments)){var D=this.__zoom,P=xd(_.changedTouches?_.changedTouches[0]:_,this),L=D.invert(P),B=D.k*(_.shiftKey?.5:2),M=n(x(w(D,B),P,L),t.apply(this,I),a);uO(_),l>0?qc(this).transition().duration(l).call(S,M,P,_):qc(this).call(y.transform,M,P,_)}}function N(_,...I){if(e.apply(this,arguments)){var D=_.touches,P=D.length,L=k(this,I,_.changedTouches.length===P).event(_),B,M,H,K;for(SL(_),M=0;M`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.`},cE=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],ENe=["Enter"," ","Escape"],CNe={"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 rw;(function(e){e.Strict="strict",e.Loose="loose"})(rw||(rw={}));var ry;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ry||(ry={}));var uE;(function(e){e.Partial="partial",e.Full="full"})(uE||(uE={}));const TNe={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ym;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ym||(ym={}));var dE;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(dE||(dE={}));var pn;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(pn||(pn={}));const iJ={[pn.Left]:pn.Right,[pn.Right]:pn.Left,[pn.Top]:pn.Bottom,[pn.Bottom]:pn.Top};function ANe(e){return e===null?null:e?"valid":"invalid"}const _Ne=e=>"id"in e&&"source"in e&&"target"in e,mmt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),fz=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),QC=(e,t=[0,0])=>{const{width:n,height:i}=Ap(e),r=e.origin??t,s=n*r[0],a=i*r[1];return{x:e.position.x-s,y:e.position.y-a}},gmt=(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):fz(r)?r:t.nodeLookup.get(r.id));const l=a?HN(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return $P(i,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return FP(n)},zC=(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=$P(n,HN(r)),i=!0)}),i?FP(n):{x:0,y:0,width:0,height:0}},hz=(e,t,[n,i,r]=[0,0,1],s=!1,a=!1)=>{const l={...Zw(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 m=d.width??u.width??u.initialWidth??null,g=d.height??u.height??u.initialHeight??null,b=fE(l,ow(u)),v=(m??0)*(g??0),y=s&&b>0;(!u.internals.handleBounds||y||b>=v||u.dragging)&&c.push(u)}return c},bmt=(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 ymt(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 vmt({nodes:e,width:t,height:n,panZoom:i,minZoom:r,maxZoom:s},a){if(e.size===0)return!0;const l=ymt(e,a),c=zC(l),u=mz(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 jNe({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",Ld.error005());else{const m=l.measured.width,g=l.measured.height;m&&g&&(f=[[c,u],[c+m,u+g]])}else l&&Cy(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=Cy(f)?Ey(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(s==null||s("015",Ld.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 xmt({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 m=s.has(h.id),g=!m&&h.parentId&&a.find(b=>b.id===h.parentId);(m||g)&&a.push(h)}const l=new Set(t.map(h=>h.id)),c=i.filter(h=>h.deletable!==!1),d=bmt(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 sw=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ey=(e={x:0,y:0},t,n)=>({x:sw(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:sw(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function NNe(e,t,n){const{width:i,height:r}=Ap(n),{x:s,y:a}=n.internals.positionAbsolute;return Ey(e,[[s,a],[s+i,a+r]],t)}const rJ=(e,t,n)=>en?-sw(Math.abs(e-n),1,t)/t:0,pz=(e,t,n=15,i=40)=>{const r=rJ(e.x,i,t.width-i)*n,s=rJ(e.y,i,t.height-i)*n;return[r,s]},$P=(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)}),qF=({x:e,y:t,width:n,height:i})=>({x:e,y:t,x2:e+n,y2:t+i}),FP=({x:e,y:t,x2:n,y2:i})=>({x:e,y:t,width:n-e,height:i-t}),ow=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=fz(e)?e.internals.positionAbsolute:QC(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}},HN=(e,t=[0,0])=>{var r,s;const{x:n,y:i}=fz(e)?e.internals.positionAbsolute:QC(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)}},RNe=(e,t)=>FP($P(qF(e),qF(t))),fE=(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)},sJ=e=>Cd(e.width)&&Cd(e.height)&&Cd(e.x)&&Cd(e.y),Cd=e=>!isNaN(e)&&isFinite(e),INe=(e,t)=>(n,i)=>{},VC=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Zw=({x:e,y:t},[n,i,r],s=!1,a=[1,1])=>{const l={x:(e-n)/r,y:(t-i)/r};return s?VC(l,a):l},aw=({x:e,y:t},[n,i,r])=>({x:e*r+n,y:t*r+i});function V0(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 wmt(e,t,n){if(typeof e=="string"||typeof e=="number"){const i=V0(e,n),r=V0(e,t);return{top:i,right:r,bottom:i,left:r,x:r*2,y:i*2}}if(typeof e=="object"){const i=V0(e.top??e.y??0,n),r=V0(e.bottom??e.y??0,n),s=V0(e.left??e.x??0,t),a=V0(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 Omt(e,t,n,i,r,s){const{x:a,y:l}=aw(e,[t,n,i]),{x:c,y:u}=aw({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 mz=(e,t,n,i,r,s)=>{const a=wmt(s,t,n),l=(t-a.x)/e.width,c=(n-a.y)/e.height,u=Math.min(l,c),d=sw(u,i,r),f=e.x+e.width/2,h=e.y+e.height/2,m=t/2-f*d,g=n/2-h*d,b=Omt(e,m,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:m-v.left+v.right,y:g-v.top+v.bottom,zoom:d}},hE=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Cy(e){return e!=null&&e!=="parent"}function Ap(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 gz(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 PNe(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 oJ(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function kmt(){let e,t;return{promise:new Promise((i,r)=>{e=i,t=r}),resolve:e,reject:t}}function Smt(e){return{...CNe,...e||{}}}function Kk(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:i,containerBounds:r}){const{x:s,y:a}=Td(e),l=Zw({x:s-((r==null?void 0:r.left)??0),y:a-((r==null?void 0:r.top)??0)},i),{x:c,y:u}=n?VC(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const bz=e=>({width:e.offsetWidth,height:e.offsetHeight}),DNe=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Emt=["INPUT","SELECT","TEXTAREA"];function MNe(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:Emt.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const LNe=e=>"clientX"in e,Td=(e,t)=>{var s,a;const n=LNe(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)}},aJ=(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,...bz(a)}})};function $Ne({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 XA(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function lJ({pos:e,x1:t,y1:n,x2:i,y2:r,c:s}){switch(e){case pn.Left:return[t-XA(t-i,s),n];case pn.Right:return[t+XA(i-t,s),n];case pn.Top:return[t,n-XA(n-r,s)];case pn.Bottom:return[t,n+XA(r-n,s)]}}function FNe({sourceX:e,sourceY:t,sourcePosition:n=pn.Bottom,targetX:i,targetY:r,targetPosition:s=pn.Top,curvature:a=.25}){const[l,c]=lJ({pos:n,x1:e,y1:t,x2:i,y2:r,c:a}),[u,d]=lJ({pos:s,x1:i,y1:r,x2:e,y2:t,c:a}),[f,h,m,g]=$Ne({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,m,g]}function BNe({sourceX:e,sourceY:t,targetX:n,targetY:i}){const r=Math.abs(n-e)/2,s=n0}const Amt=({source:e,sourceHandle:t,target:n,targetHandle:i})=>`xy-edge__${e}${t||""}-${n}${i||""}`,_mt=(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)),jmt=(e,t,n={})=>{var s;if(!e.source||!e.target)return(s=n.onError)==null||s.call(n,"006",Ld.error006()),t;const i=n.getEdgeId||Amt;let r;return _Ne(e)?r={...e}:r={...e,id:i(e)},_mt(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function UNe({sourceX:e,sourceY:t,targetX:n,targetY:i}){const[r,s,a,l]=BNe({sourceX:e,sourceY:t,targetX:n,targetY:i});return[`M ${e},${t}L ${n},${i}`,r,s,a,l]}const cJ={[pn.Left]:{x:-1,y:0},[pn.Right]:{x:1,y:0},[pn.Top]:{x:0,y:-1},[pn.Bottom]:{x:0,y:1}},Nmt=({source:e,sourcePosition:t=pn.Bottom,target:n})=>t===pn.Left||t===pn.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Rmt({source:e,sourcePosition:t=pn.Bottom,target:n,targetPosition:i=pn.Top,center:r,offset:s,stepPosition:a}){const l=cJ[t],c=cJ[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=Nmt({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",m=f[h];let g=[],b,v;const y={x:0,y:0},w={x:0,y:0},[,,x,O]=BNe({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 E=[{x:b,y:u.y},{x:b,y:d.y}],R=[{x:u.x,y:v},{x:d.x,y:v}];l[h]===m?g=h==="x"?E:R:g=h==="x"?R:E}else{const E=[{x:u.x,y:d.y}],R=[{x:d.x,y:u.y}];if(h==="x"?g=l.x===m?R:E:g=l.y===m?E:R,t===i){const _=Math.abs(e[h]-n[h]);if(_<=s){const I=Math.min(s-1,s-_);l[h]===m?y[h]=(u[h]>e[h]?-1:1)*I:w[h]=(d[h]>n[h]?-1:1)*I}}if(t!==i){const _=h==="x"?"y":"x",I=l[h]===c[_],D=u[_]>d[_],P=u[_]=j?(b=(A.x+N.x)/2,v=g[0].y):(b=g[0].x,v=(A.y+N.y)/2)}const S={x:u.x+y.x,y:u.y+y.y},k={x:d.x+w.x,y:d.y+w.y};return[[e,...S.x!==g[0].x||S.y!==g[0].y?[S]:[],...g,...k.x!==g[g.length-1].x||k.y!==g[g.length-1].y?[k]:[],n],b,v,x,O]}function Imt(e,t,n,i){const r=Math.min(uJ(e,t)/2,uJ(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 WF(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`:""}function Dmt(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=WF(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 QNe=1e3,Mmt=10,yz={nodeOrigin:[0,0],nodeExtent:cE,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Lmt={...yz,checkEquality:!0};function vz(e,t){const n={...e};for(const i in t)t[i]!==void 0&&(n[i]=t[i]);return n}function $mt(e,t,n){const i=vz(yz,n);for(const r of e.values())if(r.parentId)wz(r,e,t,i);else{const s=QC(r,i.nodeOrigin),a=Cy(r.extent)?r.extent:i.nodeExtent,l=Ey(s,a,Ap(r));r.internals.positionAbsolute=l}}function Fmt(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 xz(e){return e==="manual"}function KF(e,t,n,i={}){var d,f;const r=vz(Lmt,i),s={i:0},a=new Map(t),l=r!=null&&r.elevateNodesOnSelect&&!xz(r.zIndexMode)?QNe:0;let c=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let m=a.get(h.id);if(r.checkEquality&&h===(m==null?void 0:m.internals.userNode))t.set(h.id,m);else{const g=QC(h,r.nodeOrigin),b=Cy(h.extent)?h.extent:r.nodeExtent,v=Ey(g,b,Ap(h));m={...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:Fmt(h,m),z:zNe(h,l,r.zIndexMode),userNode:h}},t.set(h.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(c=!1),h.parentId&&wz(m,t,n,i,s),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function Bmt(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 wz(e,t,n,i,r){const{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:l,zIndexMode:c}=vz(yz,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}Bmt(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*Mmt),r&&d.internals.rootParentIndex!==void 0&&(r.i=d.internals.rootParentIndex);const f=s&&!xz(c)?QNe:0,{x:h,y:m,z:g}=Umt(e,d,a,l,f,c),{positionAbsolute:b}=e.internals,v=h!==b.x||m!==b.y;(v||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:h,y:m}:b,z:g}})}function zNe(e,t,n){const i=Cd(e.zIndex)?e.zIndex:0;return xz(n)?i:i+(e.selected?t:0)}function Umt(e,t,n,i,r,s){const{x:a,y:l}=t.internals.positionAbsolute,c=Ap(e),u=QC(e,n),d=Cy(e.extent)?Ey(u,e.extent,c):u;let f=Ey({x:a+d.x,y:l+d.y},i,c);e.extent==="parent"&&(f=NNe(f,c,t));const h=zNe(e,r,s),m=t.internals.z??0;return{x:f.x,y:f.y,z:m>=h?m+1:h}}function Oz(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)??ow(c),d=RNe(u,l.rect);s.set(l.parentId,{expandedRect:d,parent:c})}return s.size>0&&s.forEach(({expandedRect:l,parent:c},u)=>{var x;const d=c.internals.positionAbsolute,f=Ap(c),h=c.origin??i,m=l.x0||g>0||y||w)&&(r.push({id:u,type:"position",position:{x:c.position.x-m+y,y:c.position.y-g+w}}),(x=n.get(u))==null||x.forEach(O=>{e.some(S=>S.id===O.id)||r.push({id:O.id,type:"position",position:{x:O.position.x+m,y:O.position.y+g}})})),(f.width0){const m=Oz(h,t,n,r);u.push(...m)}return{changes:u,updatedInternals:c}}async function zmt({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 pJ(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 VNe(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}`;pJ("source",c,d,e,r,a),pJ("target",c,u,e,s,l),t.set(i.id,i)}}function HNe(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:HNe(n,t):!1}function mJ(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 Vmt(e,t,n,i){const r=new Map;for(const[s,a]of e)if((a.selected||a.id===i)&&(!a.parentId||!HNe(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 EL({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 Hmt({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=VC(s,t);return{x:a.x-s.x,y:a.y-s.y}}function qmt({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,m=!1,g=!1,b=null;function v({noDragClassName:w,handleSelector:x,domNode:O,isSelectable:S,nodeId:k,nodeClickDistance:C=0}){h=qc(O);function E({x:T,y:j}){const{nodeLookup:_,nodeExtent:I,snapGrid:D,snapToGrid:P,nodeOrigin:L,onNodeDrag:B,onSelectionDrag:M,onError:H,updateNodePositions:K}=t();s={x:T,y:j};let F=!1;const q=l.size>1,Q=q&&I?qF(zC(l)):null,X=q&&P?Hmt({dragItems:l,snapGrid:D,x:T,y:j}):null;for(const[ne,z]of l){if(!_.has(ne))continue;let Y={x:T-z.distance.x,y:j-z.distance.y};P&&(Y=X?{x:Math.round(Y.x+X.x),y:Math.round(Y.y+X.y)}:VC(Y,D));let ae=null;if(q&&I&&!z.extent&&Q){const{positionAbsolute:G}=z.internals,te=G.x-Q.x+I[0][0],de=G.x+z.measured.width-Q.x2+I[1][0],Ce=G.y-Q.y+I[0][1],le=G.y+z.measured.height-Q.y2+I[1][1];ae=[[te,Ce],[de,le]]}const{position:Ee,positionAbsolute:Z}=jNe({nodeId:ne,nextPosition:Y,nodeLookup:_,nodeExtent:ae||I,nodeOrigin:L,onError:H});F=F||z.position.x!==Ee.x||z.position.y!==Ee.y,z.position=Ee,z.internals.positionAbsolute=Z}if(g=g||F,!!F&&(K(l,!0),b&&(i||B||!k&&M))){const[ne,z]=EL({nodeId:k,dragItems:l,nodeLookup:_});i==null||i(b,l,ne,z),B==null||B(b,ne,z),k||M==null||M(b,z)}}async function R(){if(!d)return;const{transform:T,panBy:j,autoPanSpeed:_,autoPanOnNodeDrag:I}=t();if(!I){c=!1,cancelAnimationFrame(a);return}const[D,P]=pz(u,d,_);(D!==0||P!==0)&&(s.x=(s.x??0)-D/T[2],s.y=(s.y??0)-P/T[2],await j({x:D,y:P})&&E(s)),a=requestAnimationFrame(R)}function A(T){var q;const{nodeLookup:j,multiSelectionActive:_,nodesDraggable:I,transform:D,snapGrid:P,snapToGrid:L,selectNodesOnDrag:B,onNodeDragStart:M,onSelectionDragStart:H,unselectNodesAndEdges:K}=t();f=!0,(!B||!S)&&!_&&k&&((q=j.get(k))!=null&&q.selected||K()),S&&B&&k&&(e==null||e(k));const F=Kk(T.sourceEvent,{transform:D,snapGrid:P,snapToGrid:L,containerBounds:d});if(s=F,l=Vmt(j,I,F,k),l.size>0&&(n||M||!k&&H)){const[Q,X]=EL({nodeId:k,dragItems:l,nodeLookup:j});n==null||n(T.sourceEvent,l,Q,X),M==null||M(T.sourceEvent,Q,X),k||H==null||H(T.sourceEvent,X)}}const N=lNe().clickDistance(C).on("start",T=>{const{domNode:j,nodeDragThreshold:_,transform:I,snapGrid:D,snapToGrid:P}=t();d=(j==null?void 0:j.getBoundingClientRect())||null,m=!1,g=!1,b=T.sourceEvent,_===0&&A(T),s=Kk(T.sourceEvent,{transform:I,snapGrid:D,snapToGrid:P,containerBounds:d}),u=Td(T.sourceEvent,d)}).on("drag",T=>{const{autoPanOnNodeDrag:j,transform:_,snapGrid:I,snapToGrid:D,nodeDragThreshold:P,nodeLookup:L}=t(),B=Kk(T.sourceEvent,{transform:_,snapGrid:I,snapToGrid:D,containerBounds:d});if(b=T.sourceEvent,(T.sourceEvent.type==="touchmove"&&T.sourceEvent.touches.length>1||k&&!L.has(k))&&(m=!0),!m){if(!c&&j&&f&&(c=!0,R()),!f){const M=Td(T.sourceEvent,d),H=M.x-u.x,K=M.y-u.y;Math.sqrt(H*H+K*K)>P&&A(T)}(s.x!==B.xSnapped||s.y!==B.ySnapped)&&l&&f&&(u=Td(T.sourceEvent,d),E(B))}}).on("end",T=>{if(!f||m){m&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),l.size>0){const{nodeLookup:j,updateNodePositions:_,onNodeDragStop:I,onSelectionDragStop:D}=t();if(g&&(_(l,!1),g=!1),r||I||!k&&D){const[P,L]=EL({nodeId:k,dragItems:l,nodeLookup:j,dragging:!1});r==null||r(T.sourceEvent,l,P,L),I==null||I(T.sourceEvent,P,L),k||D==null||D(T.sourceEvent,L)}}}).filter(T=>{const j=T.target;return!T.button&&(!w||!mJ(j,`.${w}`,O))&&(!x||mJ(j,x,O))});h.call(N)}function y(){h==null||h.on(".drag",null)}return{update:v,destroy:y}}function Wmt(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())fE(r,ow(s))>0&&i.push(s);return i}const Kmt=250;function Gmt(e,t,n,i){var l,c;let r=[],s=1/0;const a=Wmt(e,n,t+Kmt);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:m}=Ty(u,f,f.position,!0),g=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(m-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 qNe(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,...Ty(a,c,c.position,!0)}:c}function WNe(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Xmt(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const KNe=()=>!0;function Ymt(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:m,onConnectStart:g,onConnect:b,onConnectEnd:v,isValidConnection:y=KNe,onReconnectEnd:w,updateConnection:x,getTransform:O,getFromHandle:S,autoPanSpeed:k,dragThreshold:C=1,handleDomNode:E}){const R=DNe(e.target);let A=0,N;const{x:T,y:j}=Td(e),_=WNe(s,E),I=l==null?void 0:l.getBoundingClientRect();let D=!1;if(!I||!_)return;const P=qNe(r,_,i,c,t);if(!P)return;let L=Td(e,I),B=!1,M=null,H=!1,K=null;function F(){if(!d||!I)return;const[Ee,Z]=pz(L,I,k);h({x:Ee,y:Z}),A=requestAnimationFrame(F)}const q={...P,nodeId:r,type:_,position:P.position},Q=c.get(r);let ne={inProgress:!0,isValid:null,from:Ty(Q,q,pn.Left,!0),fromHandle:q,fromPosition:q.position,fromNode:Q,to:L,toHandle:null,toPosition:iJ[q.position],toNode:null,pointer:L};function z(){D=!0,x(ne),g==null||g(e,{nodeId:r,handleId:i,handleType:_})}C===0&&z();function Y(Ee){if(!D){const{x:le,y:fe}=Td(Ee),ce=le-T,Te=fe-j;if(!(ce*ce+Te*Te>C*C))return;z()}if(!S()||!q){ae(Ee);return}const Z=O();L=Td(Ee,I),N=Gmt(Zw(L,Z,!1,[1,1]),n,c,q),B||(F(),B=!0);const G=GNe(Ee,{handle:N,connectionMode:t,fromNodeId:r,fromHandleId:i,fromType:a?"target":"source",isValidConnection:y,doc:R,lib:u,flowId:f,nodeLookup:c});K=G.handleDomNode,M=G.connection,H=Xmt(!!N,G.isValid);const te=c.get(r),de=te?Ty(te,q,pn.Left,!0):ne.from,Ce={...ne,from:de,isValid:H,to:G.toHandle&&H?aw({x:G.toHandle.x,y:G.toHandle.y},Z):L,toHandle:G.toHandle,toPosition:H&&G.toHandle?G.toHandle.position:iJ[q.position],toNode:G.toHandle?c.get(G.toHandle.nodeId):null,pointer:L};x(Ce),ne=Ce}function ae(Ee){if(!("touches"in Ee&&Ee.touches.length>0)){if(D){(N||K)&&M&&H&&(b==null||b(M));const{inProgress:Z,...G}=ne,te={...G,toPosition:ne.toHandle?ne.toPosition:null};v==null||v(Ee,te),s&&(w==null||w(Ee,te))}m(),cancelAnimationFrame(A),B=!1,H=!1,M=null,K=null,R.removeEventListener("mousemove",Y),R.removeEventListener("mouseup",ae),R.removeEventListener("touchmove",Y),R.removeEventListener("touchend",ae)}}R.addEventListener("mousemove",Y),R.addEventListener("mouseup",ae),R.addEventListener("touchmove",Y),R.addEventListener("touchend",ae)}function GNe(e,{handle:t,connectionMode:n,fromNodeId:i,fromHandleId:r,fromType:s,doc:a,lib:l,flowId:c,isValidConnection:u=KNe,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:m,y:g}=Td(e),b=a.elementFromPoint(m,g),v=b!=null&&b.classList.contains(`${l}-flow__handle`)?b:h,y={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=WNe(void 0,v),x=v.getAttribute("data-nodeid"),O=v.getAttribute("data-handleid"),S=v.classList.contains("connectable"),k=v.classList.contains("connectableend");if(!x||!w)return y;const C={source:f?x:i,sourceHandle:f?O:r,target:f?i:x,targetHandle:f?r:O};y.connection=C;const R=S&&k&&(n===rw.Strict?f&&w==="source"||!f&&w==="target":x!==i||O!==r);y.isValid=R&&u(C),y.toHandle=qNe(x,w,O,d,n,!0)}return y}const GF={onPointerDown:Ymt,isValid:GNe};function Zmt({domNode:e,panZoom:t,getTransform:n,getViewScale:i}){const r=qc(e);function s({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:m=!1}){const g=x=>{if(x.sourceEvent.type!=="wheel"||!t)return;const O=n(),S=x.sourceEvent.ctrlKey&&hE()?10:1,k=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*d,C=O[2]*Math.pow(2,k*S);t.scaleTo(C)};let b=[0,0];const v=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(b=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},y=x=>{const O=n();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!t)return;const S=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],k=[S[0]-b[0],S[1]-b[1]];b=S;const C=i()*Math.max(O[2],Math.log(O[2]))*(m?-1:1),E={x:O[0]-k[0]*C,y:O[1]-k[1]*C},R=[[0,0],[c,u]];t.setViewportConstrained({x:E.x,y:E.y,zoom:O[2]},R,l)},w=SNe().on("start",v).on("zoom",f?y:null).on("zoom.wheel",h?g:null);r.call(w,{})}function a(){r.on("zoom",null)}return{update:s,destroy:a,pointer:xd}}const BP=e=>({x:e.x,y:e.y,zoom:e.k}),CL=({x:e,y:t,zoom:n})=>LP.translate(e,t).scale(n),Lv=(e,t)=>e.target.closest(`.${t}`),XNe=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Jmt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,TL=(e,t=0,n=Jmt,i=()=>{})=>{const r=typeof t=="number"&&t>0;return r||i(),r?e.transition().duration(t).ease(n).on("end",i):e},YNe=e=>{const t=e.ctrlKey&&hE()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function egt({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:i,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(Lv(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=xd(d),y=YNe(d),w=f*Math.pow(2,y);i.scaleTo(n,w,v,d);return}const h=d.deltaMode===1?20:1;let m=r===ry.Vertical?0:d.deltaX*h,g=r===ry.Horizontal?0:d.deltaY*h;!hE()&&d.shiftKey&&r!==ry.Vertical&&(m=d.deltaY*h,g=0),i.translateBy(n,-(m/f)*s,-(g/f)*s,{internal:!0});const b=BP(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 tgt({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(i,r){const s=i.type==="wheel",a=!t&&s&&!i.ctrlKey,l=Lv(i,e);if(i.ctrlKey&&s&&l&&i.preventDefault(),a||l)return null;i.preventDefault(),n.call(this,i,r)}}function ngt({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return i=>{var s,a,l;if((s=i.sourceEvent)!=null&&s.internal)return;const r=BP(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 igt({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:i,onPanZoom:r}){return s=>{var a,l;e.usedRightMouseButton=!!(n&&XNe(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,BP(s.transform)))}}function rgt({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&&XNe(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),e.usedRightMouseButton=!1,i(!1),r)){const c=BP(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(a.sourceEvent,c)},n?150:0)}}}function sgt({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,m=n&&f.ctrlKey,g=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Lv(f,`${u}-flow__node`)||Lv(f,`${u}-flow__edge`)))return!0;if(!i&&!h&&!r&&!s&&!n||a||d&&!g||Lv(f,l)&&g||Lv(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&&!m&&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 ogt({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=SNe().scaleExtent([t,n]).translateExtent(i),h=qc(e).call(f);w({x:r.x,y:r.y,zoom:sw(r.zoom,t,n)},[[0,0],[d.width,d.height]],i);const m=h.on("wheel.zoom"),g=h.on("dblclick.zoom");f.wheelDelta(YNe);async function b(N,T){return h?new Promise(j=>{f==null||f.interpolate((T==null?void 0:T.interpolate)==="linear"?Wk:Y_).transform(TL(h,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>j(!0)),N)}):!1}function v({noWheelClassName:N,noPanClassName:T,onPaneContextMenu:j,userSelectionActive:_,panOnScroll:I,panOnDrag:D,panOnScrollMode:P,panOnScrollSpeed:L,preventScrolling:B,zoomOnPinch:M,zoomOnScroll:H,zoomOnDoubleClick:K,zoomActivationKeyPressed:F,lib:q,onTransformChange:Q,connectionInProgress:X,paneClickDistance:ne,selectionOnDrag:z}){_&&!u.isZoomingOrPanning&&y();const Y=I&&!F&&!_;f.clickDistance(z?1/0:!Cd(ne)||ne<0?0:ne);const ae=Y?egt({zoomPanValues:u,noWheelClassName:N,d3Selection:h,d3Zoom:f,panOnScrollMode:P,panOnScrollSpeed:L,zoomOnPinch:M,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:l}):tgt({noWheelClassName:N,preventScrolling:B,d3ZoomHandler:m});h.on("wheel.zoom",ae,{passive:!1});const Ee=ngt({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});f.on("start",Ee);const Z=igt({zoomPanValues:u,panOnDrag:D,onPaneContextMenu:!!j,onPanZoom:s,onTransformChange:Q});f.on("zoom",Z);const G=rgt({zoomPanValues:u,panOnDrag:D,panOnScroll:I,onPaneContextMenu:j,onPanZoomEnd:l,onDraggingChange:c});f.on("end",G);const te=sgt({zoomActivationKeyPressed:F,panOnDrag:D,zoomOnScroll:H,panOnScroll:I,zoomOnDoubleClick:K,zoomOnPinch:M,userSelectionActive:_,noPanClassName:T,noWheelClassName:N,lib:q,connectionInProgress:X});f.filter(te),K?h.on("dblclick.zoom",g):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function w(N,T,j){const _=CL(N),I=f==null?void 0:f.constrain()(_,T,j);return I&&await b(I),I}async function x(N,T){const j=CL(N);return await b(j,T),j}function O(N){if(h){const T=CL(N),j=h.property("__zoom");(j.k!==N.zoom||j.x!==N.x||j.y!==N.y)&&(f==null||f.transform(h,T,null,{sync:!0}))}}function S(){const N=h?kNe(h.node()):{x:0,y:0,k:1};return{x:N.x,y:N.y,zoom:N.k}}async function k(N,T){return h?new Promise(j=>{f==null||f.interpolate((T==null?void 0:T.interpolate)==="linear"?Wk:Y_).scaleTo(TL(h,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>j(!0)),N)}):!1}async function C(N,T){return h?new Promise(j=>{f==null||f.interpolate((T==null?void 0:T.interpolate)==="linear"?Wk:Y_).scaleBy(TL(h,T==null?void 0:T.duration,T==null?void 0:T.ease,()=>j(!0)),N)}):!1}function E(N){f==null||f.scaleExtent(N)}function R(N){f==null||f.translateExtent(N)}function A(N){const T=!Cd(N)||N<0?0:N;f==null||f.clickDistance(T)}return{update:v,destroy:y,setViewport:x,setViewportConstrained:w,getViewport:S,scaleTo:k,scaleBy:C,setScaleExtent:E,setTranslateExtent:R,syncViewport:O,setClickDistance:A}}var lw;(function(e){e.Line="line",e.Handle="handle"})(lw||(lw={}));function agt({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 gJ(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 Xp(e,t){return Math.max(0,t-e)}function Yp(e,t){return Math.max(0,e-t)}function YA(e,t,n){return Math.max(0,t-e,e-n)}function bJ(e,t){return e?!t:t}function lgt(e,t,n,i,r,s,a,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:m,ySnapped:g}=n,{minWidth:b,maxWidth:v,minHeight:y,maxHeight:w}=i,{x,y:O,width:S,height:k,aspectRatio:C}=e;let E=Math.floor(d?m-e.pointerX:0),R=Math.floor(f?g-e.pointerY:0);const A=S+(c?-E:E),N=k+(u?-R:R),T=-s[0]*S,j=-s[1]*k;let _=YA(A,b,v),I=YA(N,y,w);if(a){let L=0,B=0;c&&E<0?L=Xp(x+E+T,a[0][0]):!c&&E>0&&(L=Yp(x+A+T,a[1][0])),u&&R<0?B=Xp(O+R+j,a[0][1]):!u&&R>0&&(B=Yp(O+N+j,a[1][1])),_=Math.max(_,L),I=Math.max(I,B)}if(l){let L=0,B=0;c&&E>0?L=Yp(x+E,l[0][0]):!c&&E<0&&(L=Xp(x+A,l[1][0])),u&&R>0?B=Yp(O+R,l[0][1]):!u&&R<0&&(B=Xp(O+N,l[1][1])),_=Math.max(_,L),I=Math.max(I,B)}if(r){if(d){const L=YA(A/C,y,w)*C;if(_=Math.max(_,L),a){let B=0;!c&&!u||c&&!u&&h?B=Yp(O+j+A/C,a[1][1])*C:B=Xp(O+j+(c?E:-E)/C,a[0][1])*C,_=Math.max(_,B)}if(l){let B=0;!c&&!u||c&&!u&&h?B=Xp(O+A/C,l[1][1])*C:B=Yp(O+(c?E:-E)/C,l[0][1])*C,_=Math.max(_,B)}}if(f){const L=YA(N*C,b,v)/C;if(I=Math.max(I,L),a){let B=0;!c&&!u||u&&!c&&h?B=Yp(x+N*C+T,a[1][0])/C:B=Xp(x+(u?R:-R)*C+T,a[0][0])/C,I=Math.max(I,B)}if(l){let B=0;!c&&!u||u&&!c&&h?B=Xp(x+N*C,l[1][0])/C:B=Yp(x+(u?R:-R)*C,l[0][0])/C,I=Math.max(I,B)}}}R=R+(R<0?I:-I),E=E+(E<0?_:-_),r&&(h?A>N*C?R=(bJ(c,u)?-E:E)/C:E=(bJ(c,u)?-R:R)*C:d?(R=E/C,u=c):(E=R*C,c=u));const D=c?x+E:x,P=u?O+R:O;return{width:S+(c?-E:E),height:k+(u?-R:R),x:s[0]*E*(c?-1:1)+D,y:s[1]*R*(u?-1:1)+P}}const ZNe={width:0,height:0,x:0,y:0},cgt={...ZNe,pointerX:0,pointerY:0,aspectRatio:1};function ugt(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 dgt({domNode:e,nodeId:t,getStoreItems:n,onChange:i,onEnd:r}){const s=qc(e);let a={controlDirection:gJ("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:m,onResize:g,onResizeEnd:b,shouldResize:v}){let y={...ZNe},w={...cgt};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:gJ(u)};let x,O=null,S=[],k,C,E,R=!1;const A=lNe().on("start",N=>{const{nodeLookup:T,transform:j,snapGrid:_,snapToGrid:I,nodeOrigin:D,paneDomNode:P}=n();if(x=T.get(t),!x)return;O=(P==null?void 0:P.getBoundingClientRect())??null;const{xSnapped:L,ySnapped:B}=Kk(N.sourceEvent,{transform:j,snapGrid:_,snapToGrid:I,containerBounds:O});y={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},w={...y,pointerX:L,pointerY:B,aspectRatio:y.width/y.height},k=void 0,C=Cy(x.extent)?x.extent:void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(k=T.get(x.parentId)),k&&x.extent==="parent"&&(C=[[0,0],[k.measured.width,k.measured.height]]),S=[],E=void 0;for(const[M,H]of T)if(H.parentId===t&&(S.push({id:M,position:{...H.position},extent:H.extent}),H.extent==="parent"||H.expandParent)){const K=ugt(H,x,H.origin??D);E?E=[[Math.min(K[0][0],E[0][0]),Math.min(K[0][1],E[0][1])],[Math.max(K[1][0],E[1][0]),Math.max(K[1][1],E[1][1])]]:E=K}m==null||m(N,{...y})}).on("drag",N=>{const{transform:T,snapGrid:j,snapToGrid:_,nodeOrigin:I}=n(),D=Kk(N.sourceEvent,{transform:T,snapGrid:j,snapToGrid:_,containerBounds:O}),P=[];if(!x)return;const{x:L,y:B,width:M,height:H}=y,K={},F=x.origin??I,{width:q,height:Q,x:X,y:ne}=lgt(w,a.controlDirection,D,a.boundaries,a.keepAspectRatio,F,C,E),z=q!==M,Y=Q!==H,ae=X!==L&&z,Ee=ne!==B&&Y;if(!ae&&!Ee&&!z&&!Y)return;if((ae||Ee||F[0]===1||F[1]===1)&&(K.x=ae?X:y.x,K.y=Ee?ne:y.y,y.x=K.x,y.y=K.y,S.length>0)){const de=X-L,Ce=ne-B;for(const le of S)le.position={x:le.position.x-de+F[0]*(q-M),y:le.position.y-Ce+F[1]*(Q-H)},P.push(le)}if((z||Y)&&(K.width=z&&(!a.resizeDirection||a.resizeDirection==="horizontal")?q:y.width,K.height=Y&&(!a.resizeDirection||a.resizeDirection==="vertical")?Q:y.height,y.width=K.width,y.height=K.height),k&&x.expandParent){const de=F[0]*(K.width??0);K.x&&K.x{R&&(b==null||b(N,{...y}),r==null||r({...y}),R=!1)});s.call(A)}function c(){s.on(".drag",null)}return{update:l,destroy:c}}const fgt={},yJ=e=>{let t;const n=new Set,i=(d,f)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const m=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(g=>g(t,m))}},r=()=>t,c={setState:i,getState:r,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(fgt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(i,r,c);return c},hgt=e=>e?yJ(e):yJ,{useDebugValue:pgt}=bi,{useSyncExternalStoreWithSelector:mgt}=BJe,ggt=e=>e;function JNe(e,t=ggt,n){const i=mgt(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return pgt(i),i}const vJ=(e,t)=>{const n=hgt(e),i=(r,s=t)=>JNe(n,r,s);return Object.assign(i,n),i},bgt=(e,t)=>e?vJ(e,t):vJ;function Rs(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!Object.is(r,t.get(i)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||!Object.is(e[i],t[i]))return!1;return!0}const UP=p.createContext(null),ygt=UP.Provider,eRe=Ld.error001("react");function Ki(e,t){const n=p.useContext(UP);if(n===null)throw new Error(eRe);return JNe(n,e,t)}function Is(){const e=p.useContext(UP);if(e===null)throw new Error(eRe);return p.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const xJ={display:"none"},vgt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},tRe="react-flow__node-desc",nRe="react-flow__edge-desc",xgt="react-flow__aria-live",wgt=e=>e.ariaLiveMessage,Ogt=e=>e.ariaLabelConfig;function kgt({rfId:e}){const t=Ki(wgt);return o.jsx("div",{id:`${xgt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:vgt,children:t})}function Sgt({rfId:e,disableKeyboardA11y:t}){const n=Ki(Ogt);return o.jsxs(o.Fragment,{children:[o.jsx("div",{id:`${tRe}-${e}`,style:xJ,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),o.jsx("div",{id:`${nRe}-${e}`,style:xJ,children:n["edge.a11yDescription.default"]}),!t&&o.jsx(kgt,{rfId:e})]})}const QP=p.forwardRef(({position:e="top-left",children:t,className:n,style:i,...r},s)=>{const a=`${e}`.split("-");return o.jsx("div",{className:Ho(["react-flow__panel",n,...a]),style:i,ref:s,...r,children:t})});QP.displayName="Panel";function Egt({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:o.jsx(QP,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:o.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Cgt=e=>{const t=[],n=[];for(const[,i]of e.nodeLookup)i.selected&&t.push(i.internals.userNode);for(const[,i]of e.edgeLookup)i.selected&&n.push(i);return{selectedNodes:t,selectedEdges:n}},ZA=e=>e.id;function Tgt(e,t){return Rs(e.selectedNodes.map(ZA),t.selectedNodes.map(ZA))&&Rs(e.selectedEdges.map(ZA),t.selectedEdges.map(ZA))}function Agt({onSelectionChange:e}){const t=Is(),{selectedNodes:n,selectedEdges:i}=Ki(Cgt,Tgt);return p.useEffect(()=>{const r={nodes:n,edges:i};e==null||e(r),t.getState().onSelectionChangeHandlers.forEach(s=>s(r))},[n,i,e]),null}const _gt=e=>!!e.onSelectionChangeHandlers;function jgt({onSelectionChange:e}){const t=Ki(_gt);return e||t?o.jsx(Agt,{onSelectionChange:e}):null}const iRe=[0,0],Ngt={x:0,y:0,zoom:1},Rgt=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],wJ=[...Rgt,"rfId"],Igt=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),OJ={translateExtent:cE,nodeOrigin:iRe,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Pgt(e){const{setNodes:t,setEdges:n,setMinZoom:i,setMaxZoom:r,setTranslateExtent:s,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:c}=Ki(Igt,Rs),u=Is();p.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=OJ,l()}),[]);const d=p.useRef(OJ);return p.useEffect(()=>{for(const f of wJ){const h=e[f],m=d.current[f];h!==m&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?i(h):f==="maxZoom"?r(h):f==="translateExtent"?s(h):f==="nodeExtent"?a(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:Smt(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},wJ.map(f=>e[f])),null}function kJ(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Dgt(e){var i;const[t,n]=p.useState(e==="system"?null:e);return p.useEffect(()=>{if(e!=="system"){n(e);return}const r=kJ(),s=()=>n(r!=null&&r.matches?"dark":"light");return s(),r==null||r.addEventListener("change",s),()=>{r==null||r.removeEventListener("change",s)}},[e]),t!==null?t:(i=kJ())!=null&&i.matches?"dark":"light"}const SJ=typeof document<"u"?document:null;function pE(e=null,t={target:SJ,actInsideInputWithModifier:!0}){const[n,i]=p.useState(!1),r=p.useRef(!1),s=p.useRef(new Set([])),[a,l]=p.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` `).replace(` `,` +`).split(` -`)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return p.useEffect(()=>{const c=(t==null?void 0:t.target)??SJ,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=m=>{var v,y;if(r.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!r.current||r.current&&!u)&&_Ne(m))return!1;const b=CJ(m.code,l);if(s.current.add(m[b]),EJ(a,s.current,!1)){const w=((y=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:y[0])||m.target,x=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";t.preventDefault!==!1&&(r.current||!x)&&m.preventDefault(),i(!0)}},f=m=>{const g=CJ(m.code,l);EJ(a,s.current,!0)?(i(!1),s.current.clear()):s.current.delete(m[g]),m.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 EJ(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(r=>t.has(r)))}function CJ(e,t){return t.includes(e)?"code":"key"}const _gt=()=>{const e=_s();return p.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=mz(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 Zw(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=aw(t,n);return{x:a.x+r,y:a.y+s}}}),[])};function YNe(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)jgt(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 jgt(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 ZNe(e,t){return YNe(e,t)}function JNe(e,t){return YNe(e,t)}function Ob(e,t){return{id:e,type:"select",selected:t}}function $v(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(Ob(s.id,a)))}return i}function TJ({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 AJ(e){return{id:e.id,type:"remove"}}const Ngt=CNe();function Rgt(e,t,n={}){return kmt(e,t,{...n,onError:n.onError??Ngt})}const _J=e=>lmt(e),Igt=e=>ONe(e);function eRe(e){return p.forwardRef(e)}const Pgt=typeof window<"u"?p.useLayoutEffect:p.useEffect;function jJ(e){const[t,n]=p.useState(BigInt(0)),[i]=p.useState(()=>Dgt(()=>n(r=>r+BigInt(1))));return Pgt(()=>{const r=i.get();r.length&&(e(r),i.reset())},[t]),i}function Dgt(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const tRe=p.createContext(null);function Mgt({children:e}){const t=_s(),n=p.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:m,onNodesChangeMiddlewareMap:g}=t.getState();let b=c;for(const y of l)b=typeof y=="function"?y(b):y;let v=TJ({items:b,lookup:h});for(const y of g.values())v=y(v);d&&u(b),v.length>0?f==null||f(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:w,setNodes:x}=t.getState();y&&x(w)})},[]),i=jJ(n),r=p.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let m=c;for(const g of l)m=typeof g=="function"?g(m):g;d?u(m):f&&f(TJ({items:m,lookup:h}))},[]),s=jJ(r),a=p.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return o.jsx(tRe.Provider,{value:a,children:e})}function Lgt(){const e=p.useContext(tRe);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const $gt=e=>!!e.panZoom;function QP(){const e=_gt(),t=_s(),n=Lgt(),i=zi($gt),r=p.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,w;const{nodeLookup:h,nodeOrigin:m}=t.getState(),g=_J(f)?f:h.get(f.id),b=g.parentId?TNe(g.position,g.measured,g.parentId,h,m):g.position,v={...g,position:b,width:((y=g.measured)==null?void 0:y.width)??g.width,height:((w=g.measured)==null?void 0:w.height)??g.height};return ow(v)},u=(f,h,m={replace:!1})=>{a(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return m.replace&&_J(v)?v:{...b,...v}}return b}))},d=(f,h,m={replace:!1})=>{l(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return m.replace&&Igt(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(m=>[...m,...h])},addEdges:f=>{const h=Array.isArray(f)?f:[f];n.edgeQueue.push(m=>[...m,...h])},toObject:()=>{const{nodes:f=[],edges:h=[],transform:m}=t.getState(),[g,b,v]=m;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:m,edges:g,onNodesDelete:b,onEdgesDelete:v,triggerNodeChanges:y,triggerEdgeChanges:w,onDelete:x,onBeforeDelete:O}=t.getState(),{nodes:S,edges:k}=await hmt({nodesToRemove:f,edgesToRemove:h,nodes:m,edges:g,onBeforeDelete:O}),C=k.length>0,E=S.length>0;if(C){const R=k.map(AJ);v==null||v(k),w(R)}if(E){const R=S.map(AJ);b==null||b(S),y(R)}return(E||C)&&(x==null||x({nodes:S,edges:k})),{deletedNodes:S,deletedEdges:k}},getIntersectingNodes:(f,h=!0,m)=>{const g=sJ(f),b=g?f:c(f),v=m!==void 0;return b?(m||t.getState().nodes).filter(y=>{const w=t.getState().nodeLookup.get(y.id);if(w&&!g&&(y.id===f.id||!w.internals.positionAbsolute))return!1;const x=ow(v?y:w),O=fE(x,b);return h&&O>0||O>=x.width*x.height||O>=b.width*b.height}):[]},isNodeIntersecting:(f,h,m=!0)=>{const b=sJ(f)?f:c(f);if(!b)return!1;const v=fE(b,h);return m&&v>0||v>=h.width*h.height||v>=b.width*b.height},updateNode:u,updateNodeData:(f,h,m={replace:!1})=>{u(f,g=>{const b=typeof h=="function"?h(g):h;return m.replace?{...g,data:b}:{...g,data:{...g.data,...b}}},m)},updateEdge:d,updateEdgeData:(f,h,m={replace:!1})=>{d(f,g=>{const b=typeof h=="function"?h(g):h;return m.replace?{...g,data:b}:{...g,data:{...g.data,...b}}},m)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:m}=t.getState();return cmt(f,{nodeLookup:h,nodeOrigin:m})},getHandleConnections:({type:f,id:h,nodeId:m})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${m}-${f}${h?`-${h}`:""}`))==null?void 0:g.values())??[])},getNodeConnections:({type:f,handleId:h,nodeId:m})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${m}${f?h?`-${f}-${h}`:`-${f}`:""}`))==null?void 0:g.values())??[])},fitView:async f=>{const h=t.getState().fitViewResolver??gmt();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(m=>[...m]),h.promise}}},[]);return p.useMemo(()=>({...r,...e,viewportInitialized:i}),[i])}const NJ=e=>e.selected,Fgt=typeof window<"u"?window:void 0;function Bgt({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=_s(),{deleteElements:i}=QP(),r=pE(e,{actInsideInputWithModifier:!1}),s=pE(t,{target:Fgt});p.useEffect(()=>{if(r){const{edges:a,nodes:l}=n.getState();i({nodes:l.filter(NJ),edges:a.filter(NJ)}),n.setState({nodesSelectionActive:!1})}},[r]),p.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function Ugt(e){const t=_s();p.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=bz(e.current);(i.height===0||i.width===0)&&((l=(a=t.getState()).onError)==null||l.call(a,"004",Md.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 zP={position:"absolute",width:"100%",height:"100%",top:0,left:0},Qgt=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function zgt({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:s=iy.Free,zoomOnDoubleClick:a=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:m=!0,children:g,noWheelClassName:b,noPanClassName:v,onViewportChange:y,isControlledViewport:w,paneClickDistance:x,selectionOnDrag:O}){const S=_s(),k=p.useRef(null),{userSelectionActive:C,lib:E,connectionInProgress:R}=zi(Qgt,As),A=pE(h),j=p.useRef();Ugt(k);const T=p.useCallback(N=>{y==null||y({x:N[0],y:N[1],zoom:N[2]}),w||S.setState({transform:N})},[y,w]);return p.useEffect(()=>{if(k.current){j.current=Jmt({domNode:k.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:M=>S.setState(P=>P.paneDragging===M?P:{paneDragging:M}),onPanZoomStart:(M,P)=>{const{onViewportChangeStart:L,onMoveStart:B}=S.getState();B==null||B(M,P),L==null||L(P)},onPanZoom:(M,P)=>{const{onViewportChange:L,onMove:B}=S.getState();B==null||B(M,P),L==null||L(P)},onPanZoomEnd:(M,P)=>{const{onViewportChangeEnd:L,onMoveEnd:B}=S.getState();B==null||B(M,P),L==null||L(P)}});const{x:N,y:_,zoom:D}=j.current.getViewport();return S.setState({panZoom:j.current,transform:[N,_,D],domNode:k.current.closest(".react-flow")}),()=>{var M;(M=j.current)==null||M.destroy()}}},[]),p.useEffect(()=>{var N;(N=j.current)==null||N.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:s,zoomOnDoubleClick:a,panOnDrag:l,zoomActivationKeyPressed:A,preventScrolling:m,noPanClassName:v,userSelectionActive:C,noWheelClassName:b,lib:E,onTransformChange:T,connectionInProgress:R,selectionOnDrag:O,paneClickDistance:x})},[e,t,n,i,r,s,a,l,A,m,v,C,b,E,T,R,O,x]),o.jsx("div",{className:"react-flow__renderer",ref:k,style:zP,children:g})}const Vgt=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Hgt(){const{userSelectionActive:e,userSelectionRect:t}=zi(Vgt,As);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 TL=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},qgt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Wgt({isSelecting:e,selectionKeyPressed:t,selectionMode:n=uE.Full,panOnDrag:i,autoPanOnSelection:r,paneClickDistance:s,selectionOnDrag:a,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:m,onPaneMouseLeave:g,children:b}){const v=p.useRef(0),y=_s(),{userSelectionActive:w,elementsSelectable:x,dragging:O,connectionInProgress:S,panBy:k,autoPanSpeed:C}=zi(qgt,As),E=x&&(e||w),R=p.useRef(null),A=p.useRef(),j=p.useRef(new Set),T=p.useRef(new Set),N=p.useRef(!1),_=p.useRef({x:0,y:0}),D=p.useRef(!1),M=Q=>{if(N.current||S){N.current=!1;return}u==null||u(Q),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},P=Q=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){Q.preventDefault();return}d==null||d(Q)},L=f?Q=>f(Q):void 0,B=Q=>{N.current&&(Q.stopPropagation(),N.current=!1)},I=Q=>{var se,he;const{domNode:Z,transform:ce}=y.getState();if(A.current=Z==null?void 0:Z.getBoundingClientRect(),!A.current)return;const Ee=Q.target===R.current;if(!Ee&&!!Q.target.closest(".nokey")||!e||!(a&&Ee||t)||Q.button!==0||!Q.isPrimary)return;(he=(se=Q.target)==null?void 0:se.setPointerCapture)==null||he.call(se,Q.pointerId),N.current=!1;const{x:te,y:ue}=Cd(Q.nativeEvent,A.current),Ce=Zw({x:te,y:ue},ce);y.setState({userSelectionRect:{width:0,height:0,startX:Ce.x,startY:Ce.y,x:te,y:ue}}),Ee||(Q.stopPropagation(),Q.preventDefault())};function z(Q,Z){const{userSelectionRect:ce}=y.getState();if(!ce)return;const{transform:Ee,nodeLookup:Y,edgeLookup:G,connectionLookup:te,triggerNodeChanges:ue,triggerEdgeChanges:Ce,defaultEdgeOptions:se}=y.getState(),he={x:ce.startX,y:ce.startY},{x:ae,y:Ae}=aw(he,Ee),De={startX:he.x,startY:he.y,x:QNe.id)),T.current=new Set;const we=(se==null?void 0:se.selectable)??!0;for(const Ne of j.current){const ie=te.get(Ne);if(ie)for(const{edgeId:fe}of ie.values()){const Se=G.get(fe);Se&&(Se.selectable??we)&&T.current.add(fe)}}if(!oJ(ye,j.current)){const Ne=$v(Y,j.current,!0);ue(Ne)}if(!oJ(Qe,T.current)){const Ne=$v(G,T.current);Ce(Ne)}y.setState({userSelectionRect:De,userSelectionActive:!0,nodesSelectionActive:!1})}function K(){if(!r||!A.current)return;const[Q,Z]=pz(_.current,A.current,C);k({x:Q,y:Z}).then(ce=>{if(!N.current||!ce){v.current=requestAnimationFrame(K);return}const{x:Ee,y:Y}=_.current;z(Ee,Y),v.current=requestAnimationFrame(K)})}const F=()=>{cancelAnimationFrame(v.current),v.current=0,D.current=!1};p.useEffect(()=>()=>F(),[]);const q=Q=>{const{userSelectionRect:Z,transform:ce,resetSelectedElements:Ee}=y.getState();if(!A.current||!Z)return;const{x:Y,y:G}=Cd(Q.nativeEvent,A.current);_.current={x:Y,y:G};const te=aw({x:Z.startX,y:Z.startY},ce);if(!N.current){const ue=t?0:s;if(Math.hypot(Y-te.x,G-te.y)<=ue)return;Ee(),l==null||l(Q)}N.current=!0,D.current||(K(),D.current=!0),z(Y,G)},H=Q=>{var Z,ce;Q.button===0&&((ce=(Z=Q.target)==null?void 0:Z.releasePointerCapture)==null||ce.call(Z,Q.pointerId),!w&&Q.target===R.current&&y.getState().userSelectionRect&&(M==null||M(Q)),y.setState({userSelectionActive:!1,userSelectionRect:null}),N.current&&(c==null||c(Q),y.setState({nodesSelectionActive:j.current.size>0})),F())},X=Q=>{var Z,ce;(ce=(Z=Q.target)==null?void 0:Z.releasePointerCapture)==null||ce.call(Z,Q.pointerId),F()},ne=i===!0||Array.isArray(i)&&i.includes(0);return o.jsxs("div",{className:Fo(["react-flow__pane",{draggable:ne,dragging:O,selection:e}]),onClick:E?void 0:TL(M,R),onContextMenu:TL(P,R),onWheel:TL(L,R),onPointerEnter:E?void 0:h,onPointerMove:E?q:m,onPointerUp:E?H:void 0,onPointerCancel:E?X:void 0,onPointerDownCapture:E?I:void 0,onClickCapture:E?B:void 0,onPointerLeave:g,ref:R,style:zP,children:[b,o.jsx(Hgt,{})]})}function XF({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",Md.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 nRe({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:s,nodeClickDistance:a}){const l=_s(),[c,u]=p.useState(!1),d=p.useRef();return p.useEffect(()=>{d.current=Fmt({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{XF({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),p.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 Kgt=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function iRe(){const e=_s();return p.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=Kgt(a),m=r?s[0]:5,g=r?s[1]:5,b=n.direction.x*m*n.factor,v=n.direction.y*g*n.factor;for(const[,y]of u){if(!h(y))continue;let w={x:y.internals.positionAbsolute.x+b,y:y.internals.positionAbsolute.y+v};r&&(w=VC(w,s));const{position:x,positionAbsolute:O}=kNe({nodeId:y.id,nextPosition:w,nodeLookup:u,nodeExtent:i,nodeOrigin:d,onError:l});y.position=x,y.internals.positionAbsolute=O,f.set(y.id,y)}c(f)},[])}const kz=p.createContext(null),Ggt=kz.Provider;kz.Consumer;const rRe=()=>p.useContext(kz),Xgt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Ygt=(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===rw.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 Zgt({type:e="source",position:t=fn.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},m){var D,M;const g=a||null,b=e==="target",v=_s(),y=rRe(),{connectOnClick:w,noPanClassName:x,rfId:O}=zi(Xgt,As),{connectingFrom:S,connectingTo:k,clickConnecting:C,isPossibleEndHandle:E,connectionInProcess:R,clickConnectionInProcess:A,valid:j}=zi(Ygt(y,g,e),As);y||(M=(D=v.getState()).onError)==null||M.call(D,"010",Md.error010());const T=P=>{const{defaultEdgeOptions:L,onConnect:B,hasDefaultEdges:I}=v.getState(),z={...L,...P};if(I){const{edges:K,setEdges:F,onError:q}=v.getState();F(Rgt(z,K,{onError:q}))}B==null||B(z),l==null||l(z)},N=P=>{if(!y)return;const L=jNe(P.nativeEvent);if(r&&(L&&P.button===0||!L)){const B=v.getState();GF.onPointerDown(P.nativeEvent,{handleDomNode:P.currentTarget,autoPanOnConnect:B.autoPanOnConnect,connectionMode:B.connectionMode,connectionRadius:B.connectionRadius,domNode:B.domNode,nodeLookup:B.nodeLookup,lib:B.lib,isTarget:b,handleId:g,nodeId:y,flowId:B.rfId,panBy:B.panBy,cancelConnection:B.cancelConnection,onConnectStart:B.onConnectStart,onConnectEnd:(...I)=>{var z,K;return(K=(z=v.getState()).onConnectEnd)==null?void 0:K.call(z,...I)},updateConnection:B.updateConnection,onConnect:T,isValidConnection:n||((...I)=>{var z,K;return((K=(z=v.getState()).isValidConnection)==null?void 0:K.call(z,...I))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:B.autoPanSpeed,dragThreshold:B.connectionDragThreshold})}L?d==null||d(P):f==null||f(P)},_=P=>{const{onClickConnectStart:L,onClickConnectEnd:B,connectionClickStartHandle:I,connectionMode:z,isValidConnection:K,lib:F,rfId:q,nodeLookup:H,connection:X}=v.getState();if(!y||!I&&!r)return;if(!I){L==null||L(P.nativeEvent,{nodeId:y,handleId:g,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:y,type:e,id:g}});return}const ne=ANe(P.target),Q=n||K,{connection:Z,isValid:ce}=GF.isValid(P.nativeEvent,{handle:{nodeId:y,id:g,type:e},connectionMode:z,fromNodeId:I.nodeId,fromHandleId:I.id||null,fromType:I.type,isValidConnection:Q,flowId:q,doc:ne,lib:F,nodeLookup:H});ce&&Z&&T(Z);const Ee=structuredClone(X);delete Ee.inProgress,Ee.toPosition=Ee.toHandle?Ee.toHandle.position:null,B==null||B(P,Ee),v.setState({connectionClickStartHandle:null})};return o.jsx("div",{"data-handleid":g,"data-nodeid":y,"data-handlepos":t,"data-id":`${O}-${y}-${g}-${e}`,className:Fo(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,u,{source:!b,target:b,connectable:i,connectablestart:r,connectableend:s,clickconnecting:C,connectingfrom:S,connectingto:k,valid:j,connectionindicator:i&&(!R||E)&&(R||A?s:r)}]),onMouseDown:N,onTouchStart:N,onClick:w?_:void 0,ref:m,...h,children:c})}const sc=p.memo(eRe(Zgt));function Jgt({data:e,isConnectable:t,sourcePosition:n=fn.Bottom}){return o.jsxs(o.Fragment,{children:[e==null?void 0:e.label,o.jsx(sc,{type:"source",position:n,isConnectable:t})]})}function ebt({data:e,isConnectable:t,targetPosition:n=fn.Top,sourcePosition:i=fn.Bottom}){return o.jsxs(o.Fragment,{children:[o.jsx(sc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,o.jsx(sc,{type:"source",position:i,isConnectable:t})]})}function tbt(){return null}function nbt({data:e,isConnectable:t,targetPosition:n=fn.Top}){return o.jsxs(o.Fragment,{children:[o.jsx(sc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const qN={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},RJ={input:Jgt,default:ebt,output:nbt,group:tbt};function ibt(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 rbt=e=>{const{width:t,height:n,x:i,y:r}=zC(e.nodeLookup,{filter:s=>!!s.selected});return{width:Ed(t)?t:null,height:Ed(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 sbt({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=_s(),{width:r,height:s,transformString:a,userSelectionActive:l}=zi(rbt,As),c=iRe(),u=p.useRef(null);p.useEffect(()=>{var m;n||(m=u.current)==null||m.focus({preventScroll:!0})},[n]);const d=!l&&r!==null&&s!==null;if(nRe({nodeRef:u,disabled:!d}),!d)return null;const f=e?m=>{const g=i.getState().nodes.filter(b=>b.selected);e(m,g)}:void 0,h=m=>{Object.prototype.hasOwnProperty.call(qN,m.key)&&(m.preventDefault(),c({direction:qN[m.key],factor:m.shiftKey?4:1}))};return o.jsx("div",{className:Fo(["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 IJ=typeof window<"u"?window:void 0,obt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function sRe({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:m,multiSelectionKeyCode:g,panActivationKeyCode:b,zoomActivationKeyCode:v,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:O,panOnScrollSpeed:S,panOnScrollMode:k,zoomOnDoubleClick:C,panOnDrag:E,autoPanOnSelection:R,defaultViewport:A,translateExtent:j,minZoom:T,maxZoom:N,preventScrolling:_,onSelectionContextMenu:D,noWheelClassName:M,noPanClassName:P,disableKeyboardA11y:L,onViewportChange:B,isControlledViewport:I}){const{nodesSelectionActive:z,userSelectionActive:K}=zi(obt,As),F=pE(u,{target:IJ}),q=pE(b,{target:IJ}),H=q||E,X=q||O,ne=d&&H!==!0,Q=F||K||ne;return Bgt({deleteKeyCode:c,multiSelectionKeyCode:g}),o.jsx(zgt,{onPaneContextMenu:s,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:X,panOnScrollSpeed:S,panOnScrollMode:k,zoomOnDoubleClick:C,panOnDrag:!F&&H,defaultViewport:A,translateExtent:j,minZoom:T,maxZoom:N,zoomActivationKeyCode:v,preventScrolling:_,noWheelClassName:M,noPanClassName:P,onViewportChange:B,isControlledViewport:I,paneClickDistance:l,selectionOnDrag:ne,children:o.jsxs(Wgt,{onSelectionStart:h,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:a,panOnDrag:H,autoPanOnSelection:R,isSelecting:!!Q,selectionMode:f,selectionKeyPressed:F,paneClickDistance:l,selectionOnDrag:ne,children:[e,z&&o.jsx(sbt,{onSelectionContextMenu:D,noPanClassName:P,disableKeyboardA11y:L})]})})}sRe.displayName="FlowRenderer";const abt=p.memo(sRe),lbt=e=>t=>e?hz(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 cbt(e){return zi(p.useCallback(lbt(e),[e]),As)}const ubt=e=>e.updateNodeInternals;function dbt(){const e=zi(ubt),[t]=p.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 p.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function fbt({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const r=_s(),s=p.useRef(null),a=p.useRef(null),l=p.useRef(e.sourcePosition),c=p.useRef(e.targetPosition),u=p.useRef(t),d=n&&!!e.internals.handleBounds;return p.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]),p.useEffect(()=>()=>{a.current&&(i==null||i.unobserve(a.current),a.current=null)},[]),p.useEffect(()=>{if(s.current){const f=u.current!==t,h=l.current!==e.sourcePosition,m=c.current!==e.targetPosition;(f||h||m)&&(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 hbt({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:m,disableKeyboardA11y:g,rfId:b,nodeTypes:v,nodeClickDistance:y,onError:w}){const{node:x,internals:O,isParent:S}=zi(Q=>{const Z=Q.nodeLookup.get(e),ce=Q.parentLookup.has(e);return{node:Z,internals:Z.internals,isParent:ce}},As);let k=x.type||"default",C=(v==null?void 0:v[k])||RJ[k];C===void 0&&(w==null||w("003",Md.error003(k)),k="default",C=(v==null?void 0:v.default)||RJ.default);const E=!!(x.draggable||l&&typeof x.draggable>"u"),R=!!(x.selectable||c&&typeof x.selectable>"u"),A=!!(x.connectable||u&&typeof x.connectable>"u"),j=!!(x.focusable||d&&typeof x.focusable>"u"),T=_s(),N=gz(x),_=fbt({node:x,nodeType:k,hasDimensions:N,resizeObserver:f}),D=nRe({nodeRef:_,disabled:x.hidden||!E,noDragClassName:h,handleSelector:x.dragHandle,nodeId:e,isSelectable:R,nodeClickDistance:y}),M=iRe();if(x.hidden)return null;const P=Tp(x),L=ibt(x),B=R||E||t||n||i||r,I=n?Q=>n(Q,{...O.userNode}):void 0,z=i?Q=>i(Q,{...O.userNode}):void 0,K=r?Q=>r(Q,{...O.userNode}):void 0,F=s?Q=>s(Q,{...O.userNode}):void 0,q=a?Q=>a(Q,{...O.userNode}):void 0,H=Q=>{const{selectNodesOnDrag:Z,nodeDragThreshold:ce}=T.getState();R&&(!Z||!E||ce>0)&&XF({id:e,store:T,nodeRef:_}),t&&t(Q,{...O.userNode})},X=Q=>{if(!(_Ne(Q.nativeEvent)||g)){if(yNe.includes(Q.key)&&R){const Z=Q.key==="Escape";XF({id:e,store:T,unselect:Z,nodeRef:_})}else if(E&&x.selected&&Object.prototype.hasOwnProperty.call(qN,Q.key)){Q.preventDefault();const{ariaLabelConfig:Z}=T.getState();T.setState({ariaLiveMessage:Z["node.a11yDescription.ariaLiveMessage"]({direction:Q.key.replace("Arrow","").toLowerCase(),x:~~O.positionAbsolute.x,y:~~O.positionAbsolute.y})}),M({direction:qN[Q.key],factor:Q.shiftKey?4:1})}}},ne=()=>{var te;if(g||!((te=_.current)!=null&&te.matches(":focus-visible")))return;const{transform:Q,width:Z,height:ce,autoPanOnNodeFocus:Ee,setCenter:Y}=T.getState();if(!Ee)return;hz(new Map([[e,x]]),{x:0,y:0,width:Z,height:ce},Q,!0).length>0||Y(x.position.x+P.width/2,x.position.y+P.height/2,{zoom:Q[2]})};return o.jsx("div",{className:Fo(["react-flow__node",`react-flow__node-${k}`,{[m]:E},x.className,{selected:x.selected,selectable:R,parent:S,draggable:E,dragging:D}]),ref:_,style:{zIndex:O.z,transform:`translate(${O.positionAbsolute.x}px,${O.positionAbsolute.y}px)`,pointerEvents:B?"all":"none",visibility:N?"visible":"hidden",...x.style,...L},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:I,onMouseMove:z,onMouseLeave:K,onContextMenu:F,onClick:H,onDoubleClick:q,onKeyDown:j?X:void 0,tabIndex:j?0:void 0,onFocus:j?ne:void 0,role:x.ariaRole??(j?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${KNe}-${b}`,"aria-label":x.ariaLabel,...x.domAttributes,children:o.jsx(Ggt,{value:e,children:o.jsx(C,{id:e,data:x.data,type:k,positionAbsoluteX:O.positionAbsolute.x,positionAbsoluteY:O.positionAbsolute.y,selected:x.selected??!1,selectable:R,draggable:E,deletable:x.deletable??!0,isConnectable:A,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:D,dragHandle:x.dragHandle,zIndex:O.z,parentId:x.parentId,...P})})})}var pbt=p.memo(hbt);const mbt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function oRe(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:s}=zi(mbt,As),a=cbt(e.onlyRenderVisibleElements),l=dbt();return o.jsx("div",{className:"react-flow__nodes",style:zP,children:a.map(c=>o.jsx(pbt,{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))})}oRe.displayName="NodeRenderer";const gbt=p.memo(oRe);function bbt(e){return zi(p.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&&xmt({sourceNode:s,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[e]),As)}const ybt=({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"})},vbt=({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"})},PJ={[dE.Arrow]:ybt,[dE.ArrowClosed]:vbt};function xbt(e){const t=_s();return p.useMemo(()=>{var r,s;return Object.prototype.hasOwnProperty.call(PJ,e)?PJ[e]:((s=(r=t.getState()).onError)==null||s.call(r,"009",Md.error009(e)),null)},[e])}const wbt=({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=xbt(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},aRe=({defaultColor:e,rfId:t})=>{const n=zi(s=>s.edges),i=zi(s=>s.defaultEdgeOptions),r=p.useMemo(()=>Amt(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(wbt,{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};aRe.displayName="MarkerDefinitions";var Obt=p.memo(aRe);function lRe({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]=p.useState({x:1,y:0,width:0,height:0}),m=Fo(["react-flow__edge-textwrapper",u]),g=p.useRef(null);return p.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:m,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}lRe.displayName="EdgeText";const kbt=p.memo(lRe);function HC({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:Fo(["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&&Ed(t)&&Ed(n)?o.jsx(kbt,{x:t,y:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function DJ({pos:e,x1:t,y1:n,x2:i,y2:r}){return e===fn.Left||e===fn.Right?[.5*(t+i),n]:[t,.5*(n+r)]}function cRe({sourceX:e,sourceY:t,sourcePosition:n=fn.Bottom,targetX:i,targetY:r,targetPosition:s=fn.Top}){const[a,l]=DJ({pos:n,x1:e,y1:t,x2:i,y2:r}),[c,u]=DJ({pos:s,x1:i,y1:r,x2:e,y2:t}),[d,f,h,m]=NNe({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,m]}function uRe(e){return p.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:m,style:g,markerEnd:b,markerStart:v,interactionWidth:y})=>{const[w,x,O]=cRe({sourceX:n,sourceY:i,sourcePosition:a,targetX:r,targetY:s,targetPosition:l}),S=e.isInternal?void 0:t;return o.jsx(HC,{id:S,path:w,labelX:x,labelY:O,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:y})})}const Sbt=uRe({isInternal:!1}),dRe=uRe({isInternal:!0});Sbt.displayName="SimpleBezierEdge";dRe.displayName="SimpleBezierEdgeInternal";function fRe(e){return p.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:m=fn.Bottom,targetPosition:g=fn.Top,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:w})=>{const[x,O,S]=HN({sourceX:n,sourceY:i,sourcePosition:m,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}),k=e.isInternal?void 0:t;return o.jsx(HC,{id:k,path:x,labelX:O,labelY:S,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:b,markerStart:v,interactionWidth:w})})}const hRe=fRe({isInternal:!1}),pRe=fRe({isInternal:!0});hRe.displayName="SmoothStepEdge";pRe.displayName="SmoothStepEdgeInternal";function mRe(e){return p.memo(({id:t,...n})=>{var r;const i=e.isInternal?void 0:t;return o.jsx(hRe,{...n,id:i,pathOptions:p.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const Ebt=mRe({isInternal:!1}),gRe=mRe({isInternal:!0});Ebt.displayName="StepEdge";gRe.displayName="StepEdgeInternal";function bRe(e){return p.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:m,markerStart:g,interactionWidth:b})=>{const[v,y,w]=PNe({sourceX:n,sourceY:i,targetX:r,targetY:s}),x=e.isInternal?void 0:t;return o.jsx(HC,{id:x,path:v,labelX:y,labelY:w,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:g,interactionWidth:b})})}const Cbt=bRe({isInternal:!1}),yRe=bRe({isInternal:!0});Cbt.displayName="StraightEdge";yRe.displayName="StraightEdgeInternal";function vRe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:a=fn.Bottom,targetPosition:l=fn.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:w})=>{const[x,O,S]=RNe({sourceX:n,sourceY:i,sourcePosition:a,targetX:r,targetY:s,targetPosition:l,curvature:y==null?void 0:y.curvature}),k=e.isInternal?void 0:t;return o.jsx(HC,{id:k,path:x,labelX:O,labelY:S,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:w})})}const Tbt=vRe({isInternal:!1}),xRe=vRe({isInternal:!0});Tbt.displayName="BezierEdge";xRe.displayName="BezierEdgeInternal";const MJ={default:xRe,straight:yRe,step:gRe,smoothstep:pRe,simplebezier:dRe},LJ={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Abt=(e,t,n)=>n===fn.Left?e-t:n===fn.Right?e+t:e,_bt=(e,t,n)=>n===fn.Top?e-t:n===fn.Bottom?e+t:e,$J="react-flow__edgeupdater";function FJ({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:Fo([$J,`${$J}-${l}`]),cx:Abt(t,i,e),cy:_bt(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function jbt({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:m}){const g=_s(),b=(O,S)=>{if(O.button!==0)return;const{autoPanOnConnect:k,domNode:C,connectionMode:E,connectionRadius:R,lib:A,onConnectStart:j,cancelConnection:T,nodeLookup:N,rfId:_,panBy:D,updateConnection:M}=g.getState(),P=S.type==="target",L=(z,K)=>{h(!1),f==null||f(z,n,S.type,K)},B=z=>u==null?void 0:u(n,z),I=(z,K)=>{h(!0),d==null||d(O,n,S.type),j==null||j(z,K)};GF.onPointerDown(O.nativeEvent,{autoPanOnConnect:k,connectionMode:E,connectionRadius:R,domNode:C,handleId:S.id,nodeId:S.nodeId,nodeLookup:N,isTarget:P,edgeUpdaterType:S.type,lib:A,flowId:_,cancelConnection:T,panBy:D,isValidConnection:(...z)=>{var K,F;return((F=(K=g.getState()).isValidConnection)==null?void 0:F.call(K,...z))??!0},onConnect:B,onConnectStart:I,onConnectEnd:(...z)=>{var K,F;return(F=(K=g.getState()).onConnectEnd)==null?void 0:F.call(K,...z)},onReconnectEnd:L,updateConnection:M,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:O.currentTarget})},v=O=>b(O,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=O=>b(O,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),w=()=>m(!0),x=()=>m(!1);return o.jsxs(o.Fragment,{children:[(e===!0||e==="source")&&o.jsx(FJ,{position:l,centerX:i,centerY:r,radius:t,onMouseDown:v,onMouseEnter:w,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&o.jsx(FJ,{position:c,centerX:s,centerY:a,radius:t,onMouseDown:y,onMouseEnter:w,onMouseOut:x,type:"target"})]})}function Nbt({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:m,rfId:g,edgeTypes:b,noPanClassName:v,onError:y,disableKeyboardA11y:w}){let x=zi(Y=>Y.edgeLookup.get(e));const O=zi(Y=>Y.defaultEdgeOptions);x=O?{...O,...x}:x;let S=x.type||"default",k=(b==null?void 0:b[S])||MJ[S];k===void 0&&(y==null||y("011",Md.error011(S)),S="default",k=(b==null?void 0:b.default)||MJ.default);const C=!!(x.focusable||t&&typeof x.focusable>"u"),E=typeof f<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),R=!!(x.selectable||i&&typeof x.selectable>"u"),A=p.useRef(null),[j,T]=p.useState(!1),[N,_]=p.useState(!1),D=_s(),{zIndex:M,sourceX:P,sourceY:L,targetX:B,targetY:I,sourcePosition:z,targetPosition:K}=zi(p.useCallback(Y=>{const G=Y.nodeLookup.get(x.source),te=Y.nodeLookup.get(x.target);if(!G||!te)return{zIndex:x.zIndex,...LJ};const ue=Tmt({id:e,sourceNode:G,targetNode:te,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:Y.connectionMode,onError:y});return{zIndex:vmt({selected:x.selected,zIndex:x.zIndex,sourceNode:G,targetNode:te,elevateOnSelect:Y.elevateEdgesOnSelect,zIndexMode:Y.zIndexMode}),...ue||LJ}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),As),F=p.useMemo(()=>x.markerStart?`url('#${WF(x.markerStart,g)}')`:void 0,[x.markerStart,g]),q=p.useMemo(()=>x.markerEnd?`url('#${WF(x.markerEnd,g)}')`:void 0,[x.markerEnd,g]);if(x.hidden||P===null||L===null||B===null||I===null)return null;const H=Y=>{var Ce;const{addSelectedEdges:G,unselectNodesAndEdges:te,multiSelectionActive:ue}=D.getState();R&&(D.setState({nodesSelectionActive:!1}),x.selected&&ue?(te({nodes:[],edges:[x]}),(Ce=A.current)==null||Ce.blur()):G([e])),r&&r(Y,x)},X=s?Y=>{s(Y,{...x})}:void 0,ne=a?Y=>{a(Y,{...x})}:void 0,Q=l?Y=>{l(Y,{...x})}:void 0,Z=c?Y=>{c(Y,{...x})}:void 0,ce=u?Y=>{u(Y,{...x})}:void 0,Ee=Y=>{var G;if(!w&&yNe.includes(Y.key)&&R){const{unselectNodesAndEdges:te,addSelectedEdges:ue}=D.getState();Y.key==="Escape"?((G=A.current)==null||G.blur(),te({edges:[x]})):ue([e])}};return o.jsx("svg",{style:{zIndex:M},children:o.jsxs("g",{className:Fo(["react-flow__edge",`react-flow__edge-${S}`,x.className,v,{selected:x.selected,animated:x.animated,inactive:!R&&!r,updating:j,selectable:R}]),onClick:H,onDoubleClick:X,onContextMenu:ne,onMouseEnter:Q,onMouseMove:Z,onMouseLeave:ce,onKeyDown:C?Ee:void 0,tabIndex:C?0:void 0,role:x.ariaRole??(C?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":C?`${GNe}-${g}`:void 0,ref:A,...x.domAttributes,children:[!N&&o.jsx(k,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:R,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:P,sourceY:L,targetX:B,targetY:I,sourcePosition:z,targetPosition:K,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:F,markerEnd:q,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),E&&o.jsx(jbt,{edge:x,isReconnectable:E,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,sourceX:P,sourceY:L,targetX:B,targetY:I,sourcePosition:z,targetPosition:K,setUpdateHover:T,setReconnecting:_})]})})}var Rbt=p.memo(Nbt);const Ibt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function wRe({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:m,onReconnectEnd:g,disableKeyboardA11y:b}){const{edgesFocusable:v,edgesReconnectable:y,elementsSelectable:w,onError:x}=zi(Ibt,As),O=bbt(t);return o.jsxs("div",{className:"react-flow__edges",children:[o.jsx(Obt,{defaultColor:e,rfId:n}),O.map(S=>o.jsx(Rbt,{id:S,edgesFocusable:v,edgesReconnectable:y,elementsSelectable:w,noPanClassName:r,onReconnect:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:m,onReconnectEnd:g,rfId:n,onError:x,edgeTypes:i,disableKeyboardA11y:b},S))]})}wRe.displayName="EdgeRenderer";const Pbt=p.memo(wRe),Dbt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Mbt({children:e}){const t=zi(Dbt);return o.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Lbt(e){const t=QP(),n=p.useRef(!1);p.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const $bt=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Fbt(e){const t=zi($bt),n=_s();return p.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Bbt(e){return e.connection.inProgress?{...e.connection,to:Zw(e.connection.to,e.transform)}:{...e.connection}}function Ubt(e){return Bbt}function Qbt(e){const t=Ubt();return zi(t,As)}const zbt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Vbt({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:r,width:s,height:a,isValid:l,inProgress:c}=zi(zbt,As);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:Fo(["react-flow__connection",wNe(l)]),children:o.jsx(ORe,{style:t,type:n,CustomComponent:i,isValid:l})})})}const ORe=({style:e,type:t=bm.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:m}=Qbt();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:wNe(i),toNode:d,toHandle:f,pointer:m});let g="";const b={sourceX:s.x,sourceY:s.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case bm.Bezier:[g]=RNe(b);break;case bm.SimpleBezier:[g]=cRe(b);break;case bm.Step:[g]=HN({...b,borderRadius:0});break;case bm.SmoothStep:[g]=HN(b);break;default:[g]=PNe(b)}return o.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};ORe.displayName="ConnectionLine";const Hbt={};function BJ(e=Hbt){p.useRef(e),_s(),p.useEffect(()=>{},[e])}function qbt(){_s(),p.useRef(!1),p.useEffect(()=>{},[])}function kRe({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:m,connectionLineType:g,connectionLineStyle:b,connectionLineComponent:v,connectionLineContainerStyle:y,selectionKeyCode:w,selectionOnDrag:x,selectionMode:O,multiSelectionKeyCode:S,panActivationKeyCode:k,zoomActivationKeyCode:C,deleteKeyCode:E,onlyRenderVisibleElements:R,elementsSelectable:A,defaultViewport:j,translateExtent:T,minZoom:N,maxZoom:_,preventScrolling:D,defaultMarkerColor:M,zoomOnScroll:P,zoomOnPinch:L,panOnScroll:B,panOnScrollSpeed:I,panOnScrollMode:z,zoomOnDoubleClick:K,panOnDrag:F,autoPanOnSelection:q,onPaneClick:H,onPaneMouseEnter:X,onPaneMouseMove:ne,onPaneMouseLeave:Q,onPaneScroll:Z,onPaneContextMenu:ce,paneClickDistance:Ee,nodeClickDistance:Y,onEdgeContextMenu:G,onEdgeMouseEnter:te,onEdgeMouseMove:ue,onEdgeMouseLeave:Ce,reconnectRadius:se,onReconnect:he,onReconnectStart:ae,onReconnectEnd:Ae,noDragClassName:De,noWheelClassName:ye,noPanClassName:Qe,disableKeyboardA11y:we,nodeExtent:Ne,rfId:ie,viewport:fe,onViewportChange:Se}){return BJ(e),BJ(t),qbt(),Lbt(n),Fbt(fe),o.jsx(abt,{onPaneClick:H,onPaneMouseEnter:X,onPaneMouseMove:ne,onPaneMouseLeave:Q,onPaneContextMenu:ce,onPaneScroll:Z,paneClickDistance:Ee,deleteKeyCode:E,selectionKeyCode:w,selectionOnDrag:x,selectionMode:O,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:S,panActivationKeyCode:k,zoomActivationKeyCode:C,elementsSelectable:A,zoomOnScroll:P,zoomOnPinch:L,zoomOnDoubleClick:K,panOnScroll:B,panOnScrollSpeed:I,panOnScrollMode:z,panOnDrag:F,autoPanOnSelection:q,defaultViewport:j,translateExtent:T,minZoom:N,maxZoom:_,onSelectionContextMenu:f,preventScrolling:D,noDragClassName:De,noWheelClassName:ye,noPanClassName:Qe,disableKeyboardA11y:we,onViewportChange:Se,isControlledViewport:!!fe,children:o.jsxs(Mbt,{children:[o.jsx(Pbt,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:a,onReconnect:he,onReconnectStart:ae,onReconnectEnd:Ae,onlyRenderVisibleElements:R,onEdgeContextMenu:G,onEdgeMouseEnter:te,onEdgeMouseMove:ue,onEdgeMouseLeave:Ce,reconnectRadius:se,defaultMarkerColor:M,noPanClassName:Qe,disableKeyboardA11y:we,rfId:ie}),o.jsx(Vbt,{style:b,type:g,component:v,containerStyle:y}),o.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsx(gbt,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:Y,onlyRenderVisibleElements:R,noPanClassName:Qe,noDragClassName:De,disableKeyboardA11y:we,nodeExtent:Ne,rfId:ie}),o.jsx("div",{className:"react-flow__viewport-portal"})]})})}kRe.displayName="GraphView";const Wbt=p.memo(kRe),Kbt=CNe(),UJ=({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 m=new Map,g=new Map,b=new Map,v=new Map,y=i??t??[],w=n??e??[],x=d??[0,0],O=f??cE;LNe(b,v,y);const{nodesInitialized:S}=KF(w,m,g,{nodeOrigin:x,nodeExtent:O,zIndexMode:h});let k=[0,0,1];if(a&&r&&s){const C=zC(m,{filter:j=>!!((j.width||j.initialWidth)&&(j.height||j.initialHeight))}),{x:E,y:R,zoom:A}=mz(C,r,s,c,u,(l==null?void 0:l.padding)??.1);k=[E,R,A]}return{rfId:"1",width:r??0,height:s??0,transform:k,nodes:w,nodesInitialized:S,nodeLookup:m,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:cE,nodeExtent:O,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:rw.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:l,fitViewResolver:null,connection:{...xNe},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Kbt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:vNe,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Gbt=({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})=>ugt((m,g)=>{async function b(){const{nodeLookup:v,panZoom:y,fitViewOptions:w,fitViewResolver:x,width:O,height:S,minZoom:k,maxZoom:C}=g();y&&(await fmt({nodes:v,width:O,height:S,panZoom:y,minZoom:k,maxZoom:C},w),x==null||x.resolve(!0),m({fitViewResolver:null}))}return{...UJ({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:w,nodeOrigin:x,elevateNodesOnSelect:O,fitViewQueued:S,zIndexMode:k,nodesSelectionActive:C}=g(),{nodesInitialized:E,hasSelectedNodes:R}=KF(v,y,w,{nodeOrigin:x,nodeExtent:f,elevateNodesOnSelect:O,checkEquality:!0,zIndexMode:k}),A=C&&R;S&&E?(b(),m({nodes:v,nodesInitialized:E,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:A})):m({nodes:v,nodesInitialized:E,nodesSelectionActive:A})},setEdges:v=>{const{connectionLookup:y,edgeLookup:w}=g();LNe(y,w,v),m({edges:v})},setDefaultNodesAndEdges:(v,y)=>{if(v){const{setNodes:w}=g();w(v),m({hasDefaultNodes:!0})}if(y){const{setEdges:w}=g();w(y),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:y,nodeLookup:w,parentLookup:x,domNode:O,nodeOrigin:S,nodeExtent:k,debug:C,fitViewQueued:E,zIndexMode:R}=g(),{changes:A,updatedInternals:j}=Dmt(v,w,x,O,S,k,R);j&&(Nmt(w,x,{nodeOrigin:S,nodeExtent:k,zIndexMode:R}),E?(b(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(A==null?void 0:A.length)>0&&(C&&console.log("React Flow: trigger node changes",A),y==null||y(A)))},updateNodePositions:(v,y=!1)=>{const w=[];let x=[];const{nodeLookup:O,triggerNodeChanges:S,connection:k,updateConnection:C,onNodesChangeMiddlewareMap:E}=g();for(const[R,A]of v){const j=O.get(R),T=!!(j!=null&&j.expandParent&&(j!=null&&j.parentId)&&(A!=null&&A.position)),N={id:R,type:"position",position:T?{x:Math.max(0,A.position.x),y:Math.max(0,A.position.y)}:A.position,dragging:y};if(j&&k.inProgress&&k.fromNode.id===j.id){const _=Cy(j,k.fromHandle,fn.Left,!0);C({...k,from:_})}T&&j.parentId&&w.push({id:R,parentId:j.parentId,rect:{...A.internals.positionAbsolute,width:A.measured.width??0,height:A.measured.height??0}}),x.push(N)}if(w.length>0){const{parentLookup:R,nodeOrigin:A}=g(),j=Oz(w,O,R,A);x.push(...j)}for(const R of E.values())x=R(x);S(x)},triggerNodeChanges:v=>{const{onNodesChange:y,setNodes:w,nodes:x,hasDefaultNodes:O,debug:S}=g();if(v!=null&&v.length){if(O){const k=ZNe(v,x);w(k)}S&&console.log("React Flow: trigger node changes",v),y==null||y(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:y,setEdges:w,edges:x,hasDefaultEdges:O,debug:S}=g();if(v!=null&&v.length){if(O){const k=JNe(v,x);w(k)}S&&console.log("React Flow: trigger edge changes",v),y==null||y(v)}},addSelectedNodes:v=>{const{multiSelectionActive:y,edgeLookup:w,nodeLookup:x,triggerNodeChanges:O,triggerEdgeChanges:S}=g();if(y){const k=v.map(C=>Ob(C,!0));O(k);return}O($v(x,new Set([...v]),!0)),S($v(w))},addSelectedEdges:v=>{const{multiSelectionActive:y,edgeLookup:w,nodeLookup:x,triggerNodeChanges:O,triggerEdgeChanges:S}=g();if(y){const k=v.map(C=>Ob(C,!0));S(k);return}S($v(w,new Set([...v]))),O($v(x,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:y}={})=>{const{edges:w,nodes:x,nodeLookup:O,triggerNodeChanges:S,triggerEdgeChanges:k}=g(),C=v||x,E=y||w,R=[];for(const j of C){if(!j.selected)continue;const T=O.get(j.id);T&&(T.selected=!1),R.push(Ob(j.id,!1))}const A=[];for(const j of E)j.selected&&A.push(Ob(j.id,!1));S(R),k(A)},setMinZoom:v=>{const{panZoom:y,maxZoom:w}=g();y==null||y.setScaleExtent([v,w]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:y,minZoom:w}=g();y==null||y.setScaleExtent([w,v]),m({maxZoom:v})},setTranslateExtent:v=>{var y;(y=g().panZoom)==null||y.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:y,triggerNodeChanges:w,triggerEdgeChanges:x,elementsSelectable:O}=g();if(!O)return;const S=y.reduce((C,E)=>E.selected?[...C,Ob(E.id,!1)]:C,[]),k=v.reduce((C,E)=>E.selected?[...C,Ob(E.id,!1)]:C,[]);w(S),x(k)},setNodeExtent:v=>{const{nodes:y,nodeLookup:w,parentLookup:x,nodeOrigin:O,elevateNodesOnSelect:S,nodeExtent:k,zIndexMode:C}=g();v[0][0]===k[0][0]&&v[0][1]===k[0][1]&&v[1][0]===k[1][0]&&v[1][1]===k[1][1]||(KF(y,w,x,{nodeOrigin:O,nodeExtent:v,elevateNodesOnSelect:S,checkEquality:!1,zIndexMode:C}),m({nodeExtent:v}))},panBy:v=>{const{transform:y,width:w,height:x,panZoom:O,translateExtent:S}=g();return Mmt({delta:v,panZoom:O,transform:y,translateExtent:S,width:w,height:x})},setCenter:async(v,y,w)=>{const{width:x,height:O,maxZoom:S,panZoom:k}=g();if(!k)return!1;const C=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:S;return await k.setViewport({x:x/2-v*C,y:O/2-y*C,zoom:C},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{m({connection:{...xNe}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...UJ()})}},Object.is);function SRe({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:m}){const[g]=p.useState(()=>Gbt({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(dgt,{value:g,children:o.jsx(Mgt,{children:m})})}function Xbt({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:m}){return p.useContext(BP)?o.jsx(o.Fragment,{children:e}):o.jsx(SRe,{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:m,children:e})}const Ybt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Zbt({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:m,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:O,onNodeContextMenu:S,onNodeDoubleClick:k,onNodeDragStart:C,onNodeDrag:E,onNodeDragStop:R,onNodesDelete:A,onEdgesDelete:j,onDelete:T,onSelectionChange:N,onSelectionDragStart:_,onSelectionDrag:D,onSelectionDragStop:M,onSelectionContextMenu:P,onSelectionStart:L,onSelectionEnd:B,onBeforeDelete:I,connectionMode:z,connectionLineType:K=bm.Bezier,connectionLineStyle:F,connectionLineComponent:q,connectionLineContainerStyle:H,deleteKeyCode:X="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:Q=!1,selectionMode:Z=uE.Full,panActivationKeyCode:ce="Space",multiSelectionKeyCode:Ee=hE()?"Meta":"Control",zoomActivationKeyCode:Y=hE()?"Meta":"Control",snapToGrid:G,snapGrid:te,onlyRenderVisibleElements:ue=!1,selectNodesOnDrag:Ce,nodesDraggable:se,autoPanOnNodeFocus:he,nodesConnectable:ae,nodesFocusable:Ae,nodeOrigin:De=XNe,edgesFocusable:ye,edgesReconnectable:Qe,elementsSelectable:we=!0,defaultViewport:Ne=Sgt,minZoom:ie=.5,maxZoom:fe=2,translateExtent:Se=cE,preventScrolling:ke=!0,nodeExtent:qe,defaultMarkerColor:it="#b1b1b7",zoomOnScroll:de=!0,zoomOnPinch:ve=!0,panOnScroll:Te=!1,panOnScrollSpeed:Ke=.5,panOnScrollMode:$e=iy.Free,zoomOnDoubleClick:At=!0,panOnDrag:Nt=!0,onPaneClick:vt,onPaneMouseEnter:Ot,onPaneMouseMove:Tt,onPaneMouseLeave:ft,onPaneScroll:gt,onPaneContextMenu:Me,paneClickDistance:bt=1,nodeClickDistance:jt=0,children:Ct,onReconnect:sn,onReconnectStart:We,onReconnectEnd:Le,onEdgeContextMenu:Ge,onEdgeDoubleClick:pt,onEdgeMouseEnter:ot,onEdgeMouseMove:kt,onEdgeMouseLeave:rt,reconnectRadius:qt=10,onNodesChange:cn,onEdgesChange:un,noDragClassName:Xe="nodrag",noWheelClassName:mt="nowheel",noPanClassName:St="nopan",fitView:on,fitViewOptions:zt,connectOnClick:Be,attributionPosition:at,proOptions:On,defaultEdgeOptions:Je,elevateNodesOnSelect:yt=!0,elevateEdgesOnSelect:Bn=!1,disableKeyboardA11y:Vt=!1,autoPanOnConnect:Wn,autoPanOnNodeDrag:_n,autoPanOnSelection:ei=!0,autoPanSpeed:Sn,connectionRadius:Vn,isValidConnection:Cn,onError:Kn,style:vr,id:xr,nodeDragThreshold:er,connectionDragThreshold:He,viewport:wt,onViewportChange:tn,width:Gn,height:Cr,colorMode:ys="light",debug:is,onScroll:Tr,ariaLabelConfig:Xn,zIndexMode:ii="basic",...Ur},Gi){const oe=xr||"1",tr=Agt(ys),Uo=p.useCallback(no=>{no.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Tr==null||Tr(no)},[Tr]);return o.jsx("div",{"data-testid":"rf__wrapper",...Ur,onScroll:Uo,style:{...vr,...Ybt},ref:Gi,className:Fo(["react-flow",r,tr]),id:xr,role:"application",children:o.jsxs(Xbt,{nodes:e,edges:t,width:Gn,height:Cr,fitView:on,fitViewOptions:zt,minZoom:ie,maxZoom:fe,nodeOrigin:De,nodeExtent:qe,zIndexMode:ii,children:[o.jsx(Tgt,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:m,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,nodesDraggable:se,autoPanOnNodeFocus:he,nodesConnectable:ae,nodesFocusable:Ae,edgesFocusable:ye,edgesReconnectable:Qe,elementsSelectable:we,elevateNodesOnSelect:yt,elevateEdgesOnSelect:Bn,minZoom:ie,maxZoom:fe,nodeExtent:qe,onNodesChange:cn,onEdgesChange:un,snapToGrid:G,snapGrid:te,connectionMode:z,translateExtent:Se,connectOnClick:Be,defaultEdgeOptions:Je,fitView:on,fitViewOptions:zt,onNodesDelete:A,onEdgesDelete:j,onDelete:T,onNodeDragStart:C,onNodeDrag:E,onNodeDragStop:R,onSelectionDrag:D,onSelectionDragStart:_,onSelectionDragStop:M,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:St,nodeOrigin:De,rfId:oe,autoPanOnConnect:Wn,autoPanOnNodeDrag:_n,autoPanSpeed:Sn,onError:Kn,connectionRadius:Vn,isValidConnection:Cn,selectNodesOnDrag:Ce,nodeDragThreshold:er,connectionDragThreshold:He,onBeforeDelete:I,debug:is,ariaLabelConfig:Xn,zIndexMode:ii}),o.jsx(Wbt,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:O,onNodeContextMenu:S,onNodeDoubleClick:k,nodeTypes:s,edgeTypes:a,connectionLineType:K,connectionLineStyle:F,connectionLineComponent:q,connectionLineContainerStyle:H,selectionKeyCode:ne,selectionOnDrag:Q,selectionMode:Z,deleteKeyCode:X,multiSelectionKeyCode:Ee,panActivationKeyCode:ce,zoomActivationKeyCode:Y,onlyRenderVisibleElements:ue,defaultViewport:Ne,translateExtent:Se,minZoom:ie,maxZoom:fe,preventScrolling:ke,zoomOnScroll:de,zoomOnPinch:ve,zoomOnDoubleClick:At,panOnScroll:Te,panOnScrollSpeed:Ke,panOnScrollMode:$e,panOnDrag:Nt,autoPanOnSelection:ei,onPaneClick:vt,onPaneMouseEnter:Ot,onPaneMouseMove:Tt,onPaneMouseLeave:ft,onPaneScroll:gt,onPaneContextMenu:Me,paneClickDistance:bt,nodeClickDistance:jt,onSelectionContextMenu:P,onSelectionStart:L,onSelectionEnd:B,onReconnect:sn,onReconnectStart:We,onReconnectEnd:Le,onEdgeContextMenu:Ge,onEdgeDoubleClick:pt,onEdgeMouseEnter:ot,onEdgeMouseMove:kt,onEdgeMouseLeave:rt,reconnectRadius:qt,defaultMarkerColor:it,noDragClassName:Xe,noWheelClassName:mt,noPanClassName:St,rfId:oe,disableKeyboardA11y:Vt,nodeExtent:qe,viewport:wt,onViewportChange:tn}),o.jsx(kgt,{onSelectionChange:N}),Ct,o.jsx(ygt,{proOptions:On,position:at}),o.jsx(bgt,{rfId:oe,disableKeyboardA11y:Vt})]})})}var Jbt=eRe(Zbt);const eyt=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function tyt({children:e}){const t=zi(eyt);return t?si.createPortal(e,t):null}function nyt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>ZNe(r,s)),[]);return[t,n,i]}function iyt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>JNe(r,s)),[]);return[t,n,i]}const ryt=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||!gz(n.userNode))return!1;return!0};function syt(e={includeHiddenNodes:!1}){return zi(ryt(e))}function oyt({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:Fo(["react-flow__background-pattern",n,i])})}function ayt({radius:e,className:t}){return o.jsx("circle",{cx:e,cy:e,r:e,className:Fo(["react-flow__background-pattern","dots",t])})}var Hm;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Hm||(Hm={}));const lyt={[Hm.Dots]:1,[Hm.Lines]:1,[Hm.Cross]:6},cyt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ERe({id:e,variant:t=Hm.Dots,gap:n=20,size:i,lineWidth:r=1,offset:s=0,color:a,bgColor:l,style:c,className:u,patternClassName:d}){const f=p.useRef(null),{transform:h,patternId:m}=zi(cyt,As),g=i||lyt[t],b=t===Hm.Dots,v=t===Hm.Cross,y=Array.isArray(n)?n:[n,n],w=[y[0]*h[2]||1,y[1]*h[2]||1],x=g*h[2],O=Array.isArray(s)?s:[s,s],S=v?[x,x]:w,k=[O[0]*h[2]||1+S[0]/2,O[1]*h[2]||1+S[1]/2],C=`${m}${e||""}`;return o.jsxs("svg",{className:Fo(["react-flow__background",u]),style:{...c,...zP,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[o.jsx("pattern",{id:C,x:h[0]%w[0],y:h[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`,children:b?o.jsx(ayt,{radius:x/2,className:d}):o.jsx(oyt,{dimensions:S,lineWidth:r,variant:t,className:d})}),o.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}ERe.displayName="Background";const uyt=p.memo(ERe);function dyt(){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 fyt(){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 hyt(){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 pyt(){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 myt(){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 eA({children:e,className:t,...n}){return o.jsx("button",{type:"button",className:Fo(["react-flow__controls-button",t]),...n,children:e})}const gyt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function CRe({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":m}){const g=_s(),{isInteractive:b,minZoomReached:v,maxZoomReached:y,ariaLabelConfig:w}=zi(gyt,As),{zoomIn:x,zoomOut:O,fitView:S}=QP(),k=()=>{x(),s==null||s()},C=()=>{O(),a==null||a()},E=()=>{S(r),l==null||l()},R=()=>{g.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),c==null||c(!b)},A=h==="horizontal"?"horizontal":"vertical";return o.jsxs(UP,{className:Fo(["react-flow__controls",A,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(eA,{onClick:k,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:y,children:o.jsx(dyt,{})}),o.jsx(eA,{onClick:C,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:o.jsx(fyt,{})})]}),n&&o.jsx(eA,{className:"react-flow__controls-fitview",onClick:E,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:o.jsx(hyt,{})}),i&&o.jsx(eA,{className:"react-flow__controls-interactive",onClick:R,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:b?o.jsx(myt,{}):o.jsx(pyt,{})}),d]})}CRe.displayName="Controls";const byt=p.memo(CRe);function yyt({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:m}){const{background:g,backgroundColor:b}=s||{},v=a||g||b;return o.jsx("rect",{className:Fo(["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:m?y=>m(y,e):void 0})}const vyt=p.memo(yyt),xyt=e=>e.nodes.map(t=>t.id),AL=e=>e instanceof Function?e:()=>e;function wyt({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:s=vyt,onClick:a}){const l=zi(xyt,As),c=AL(t),u=AL(e),d=AL(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsx(o.Fragment,{children:l.map(h=>o.jsx(kyt,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:s,onClick:a,shapeRendering:f},h))})}function Oyt({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:m}=zi(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:w}=b.internals.positionAbsolute,{width:x,height:O}=Tp(v);return{node:v,x:y,y:w,width:x,height:O}},As);return!u||u.hidden||!gz(u)?null:o.jsx(l,{x:d,y:f,width:h,height:m,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 kyt=p.memo(Oyt);var Syt=p.memo(wyt);const Eyt=200,Cyt=150,Tyt=e=>!e.hidden,Ayt=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?ENe(zC(e.nodeLookup,{filter:Tyt}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},_yt="react-flow__minimap-desc";function TRe({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:m,onNodeClick:g,pannable:b=!1,zoomable:v=!1,ariaLabel:y,inversePan:w,zoomStep:x=1,offsetScale:O=5}){const S=_s(),k=p.useRef(null),{boundingRect:C,viewBB:E,rfId:R,panZoom:A,translateExtent:j,flowWidth:T,flowHeight:N,ariaLabelConfig:_}=zi(Ayt,As),D=(e==null?void 0:e.width)??Eyt,M=(e==null?void 0:e.height)??Cyt,P=C.width/D,L=C.height/M,B=Math.max(P,L),I=B*D,z=B*M,K=O*B,F=C.x-(I-C.width)/2-K,q=C.y-(z-C.height)/2-K,H=I+K*2,X=z+K*2,ne=`${_yt}-${R}`,Q=p.useRef(0),Z=p.useRef();Q.current=B,p.useEffect(()=>{if(k.current&&A)return Z.current=Hmt({domNode:k.current,panZoom:A,getTransform:()=>S.getState().transform,getViewScale:()=>Q.current}),()=>{var G;(G=Z.current)==null||G.destroy()}},[A]),p.useEffect(()=>{var G;(G=Z.current)==null||G.update({translateExtent:j,width:T,height:N,inversePan:w,pannable:b,zoomStep:x,zoomable:v})},[b,v,w,x,j,T,N]);const ce=m?G=>{var Ce;const[te,ue]=((Ce=Z.current)==null?void 0:Ce.pointer(G))||[0,0];m(G,{x:te,y:ue})}:void 0,Ee=g?p.useCallback((G,te)=>{const ue=S.getState().nodeLookup.get(te).internals.userNode;g(G,ue)},[]):void 0,Y=y??_["minimap.ariaLabel"];return o.jsx(UP,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*B:void 0,"--xy-minimap-node-background-color-props":typeof 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:Fo(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxs("svg",{width:D,height:M,viewBox:`${F} ${q} ${H} ${X}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:k,onClick:ce,children:[Y&&o.jsx("title",{id:ne,children:Y}),o.jsx(Syt,{onClick:Ee,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:r,nodeStrokeWidth:a,nodeComponent:l}),o.jsx("path",{className:"react-flow__minimap-mask",d:`M${F-K},${q-K}h${H+K*2}v${X+K*2}h${-H-K*2}z - M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}TRe.displayName="MiniMap";p.memo(TRe);const jyt=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Nyt={[lw.Line]:"right",[lw.Handle]:"bottom-right"};function Ryt({nodeId:e,position:t,variant:n=lw.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:m=!0,shouldResize:g,onResizeStart:b,onResize:v,onResizeEnd:y}){const w=rRe(),x=typeof e=="string"?e:w,O=_s(),S=p.useRef(null),k=n===lw.Handle,C=zi(p.useCallback(jyt(k&&m),[k,m]),As),E=p.useRef(null),R=t??Nyt[n];p.useEffect(()=>{if(!(!S.current||!x))return E.current||(E.current=rgt({domNode:S.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:j,transform:T,snapGrid:N,snapToGrid:_,nodeOrigin:D,domNode:M}=O.getState();return{nodeLookup:j,transform:T,snapGrid:N,snapToGrid:_,nodeOrigin:D,paneDomNode:M}},onChange:(j,T)=>{const{triggerNodeChanges:N,nodeLookup:_,parentLookup:D,nodeOrigin:M}=O.getState(),P=[],L={x:j.x,y:j.y},B=_.get(x);if(B&&B.expandParent&&B.parentId){const I=B.origin??M,z=j.width??B.measured.width??0,K=j.height??B.measured.height??0,F={id:B.id,parentId:B.parentId,rect:{width:z,height:K,...TNe({x:j.x??B.position.x,y:j.y??B.position.y},{width:z,height:K},B.parentId,_,I)}},q=Oz([F],_,D,M);P.push(...q),L.x=j.x?Math.max(I[0]*z,j.x):void 0,L.y=j.y?Math.max(I[1]*K,j.y):void 0}if(L.x!==void 0&&L.y!==void 0){const I={id:x,type:"position",position:{...L}};P.push(I)}if(j.width!==void 0&&j.height!==void 0){const z={id:x,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:j.width,height:j.height}};P.push(z)}for(const I of T){const z={...I,type:"position"};P.push(z)}N(P)},onEnd:({width:j,height:T})=>{const N={id:x,type:"dimensions",resizing:!1,dimensions:{width:j,height:T}};O.getState().triggerNodeChanges([N])}})),E.current.update({controlPosition:R,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:b,onResize:v,onResizeEnd:y,shouldResize:g}),()=>{var j;(j=E.current)==null||j.destroy()}},[R,l,c,u,d,f,b,v,y,g]);const A=R.split("-");return o.jsx("div",{className:Fo(["react-flow__resize-control","nodrag",...A,n,i]),ref:S,style:{...r,scale:C,...a&&{[k?"backgroundColor":"borderColor"]:a}},children:s})}p.memo(Ryt);var ARe=Object.defineProperty,Iyt=(e,t,n)=>t in e?ARe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pyt=(e,t)=>{for(var n in t)ARe(e,n,{get:t[n],enumerable:!0})},Dyt=(e,t,n)=>Iyt(e,t+"",n),_Re={};Pyt(_Re,{Graph:()=>nd,alg:()=>Sz,json:()=>NRe,version:()=>$yt});var Myt=Object.defineProperty,jRe=(e,t)=>{for(var n in t)Myt(e,n,{get:t[n],enumerable:!0})},nd=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=nk(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=Lyt(this._isDirected,s,a,l);return s=f.v,a=f.w,Object.freeze(f),this._edgeObjs[d]=f,QJ(this._preds[a],s),QJ(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?_L(this._isDirected,t):nk(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?_L(this._isDirected,t):nk(this._isDirected,t,n,i))in this._edgeLabels}removeEdge(t,n,i){let r=arguments.length===1?_L(this._isDirected,t):nk(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],zJ(this._preds[l],a),zJ(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 QJ(e,t){e[t]?e[t]++:e[t]=1}function zJ(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function nk(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 Lyt(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 _L(e,t){return nk(e,t.v,t.w,t.name)}var $yt="4.0.1",NRe={};jRe(NRe,{read:()=>Qyt,write:()=>Fyt});function Fyt(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Byt(e),edges:Uyt(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function Byt(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 Uyt(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 Qyt(e){let t=new nd(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 Sz={};jRe(Sz,{CycleException:()=>KN,bellmanFord:()=>RRe,components:()=>Hyt,dijkstra:()=>WN,dijkstraAll:()=>Kyt,findCycles:()=>Gyt,floydWarshall:()=>Yyt,isAcyclic:()=>Jyt,postorder:()=>t0t,preorder:()=>n0t,prim:()=>i0t,shortestPaths:()=>r0t,tarjan:()=>PRe,topsort:()=>DRe});var zyt=()=>1;function RRe(e,t,n,i){return Vyt(e,String(t),n||zyt,i||function(r){return e.outEdges(r)})}function Vyt(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 WN(e,t,n,i){let r=function(s){return e.outEdges(s)};return Wyt(e,String(t),n||qyt,i||r)}function Wyt(e,t,n,i){let r={},s=new IRe,a,l,c=function(u){let d=u.v!==a?u.v:u.w,f=r[d],h=n(u),m=l.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);m0&&(a=s.removeMin(),l=r[a],l.distance!==Number.POSITIVE_INFINITY);)i(a).forEach(c);return r}function Kyt(e,t,n){return e.nodes().reduce(function(i,r){return i[r]=WN(e,r,t,n),i},{})}function PRe(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 Gyt(e){return PRe(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var Xyt=()=>1;function Yyt(e,t,n){return Zyt(e,t||Xyt,n||function(i){return e.outEdges(i)})}function Zyt(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],m=d.distance+f.distance;m{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=MRe(e,l,n==="post",a,s,i,r)}),r}function MRe(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=MRe(e,l,n,i,r,s,a)}),n&&(a=s(a,t))),a}function LRe(e,t,n){return e0t(e,t,n,function(i,r){return i.push(r),i},[])}function t0t(e,t){return LRe(e,t,"post")}function n0t(e,t){return LRe(e,t,"pre")}function i0t(e,t){let n=new nd,i={},r=new IRe,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 r0t(e,t,n,i){return s0t(e,t,n,i??(r=>{let s=e.outEdges(r);return s??[]}))}function s0t(e,t,n,i){if(n===void 0)return WN(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 $Re(e){let t=new nd({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 VJ(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 qC(e){let t=mE(BRe(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 a0t(e){let t=e.nodes().map(i=>{let r=e.node(i).rank;return r===void 0?Number.MAX_VALUE:r}),n=Sf(Math.min,t);e.nodes().forEach(i=>{let r=e.node(i);Object.hasOwn(r,"rank")&&(r.rank-=n)})}function l0t(e){let t=e.nodes().map(a=>e.node(a).rank).filter(a=>a!==void 0),n=Sf(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 HJ(e,t,n,i){let r={width:0,height:0};return arguments.length>=4&&(r.rank=n,r.order=i),Jw(e,"border",r,t)}function c0t(e,t=FRe){let n=[];for(let i=0;iFRe){let n=c0t(t);return e(...n.map(i=>e(...i)))}else return e(...t)}function BRe(e){let t=e.nodes().map(n=>{let i=e.node(n).rank;return i===void 0?Number.MIN_VALUE:i});return Sf(Math.max,t)}function u0t(e,t){let n={lhs:[],rhs:[]};return e.forEach(i=>{t(i)?n.lhs.push(i):n.rhs.push(i)}),n}function URe(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function QRe(e,t){return t()}var d0t=0;function Ez(e){let t=++d0t;return e+(""+t)}function mE(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 f0t(e,t){return e.reduce((n,i,r)=>(n[i]=t[r],n),{})}var HP="\0",h0t="3.0.0",p0t=class{constructor(){Dyt(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return qJ(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&qJ(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,m0t)),n=n._prev;return"["+e.join(", ")+"]"}};function qJ(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function m0t(e,t){if(e!=="_next"&&e!=="_prev")return t}var g0t=p0t,b0t=()=>1;function y0t(e,t){if(e.nodeCount()<=1)return[];let n=x0t(e,t||b0t);return v0t(n.graph,n.buckets,n.zeroIdx).flatMap(i=>e.outEdges(i.v,i.w)||[])}function v0t(e,t,n){var i;let r=[],s=t[t.length-1],a=t[0],l;for(;e.nodeCount();){for(;l=a.dequeue();)jL(e,t,n,l);for(;l=s.dequeue();)jL(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(jL(e,t,n,l,!0)||[]);break}}}return r}function jL(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,YF(t,n,u)}),(e.outEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=l.w,d=e.node(u);d.in-=c,YF(t,n,d)}),e.removeNode(i.v),a}function x0t(e,t){let n=new nd,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=w0t(r+i+3).map(()=>new g0t),a=i+1;return n.nodes().forEach(l=>{YF(s,a,n.node(l))}),{graph:n,buckets:s,zeroIdx:a}}function YF(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 w0t(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,Ez("rev"))});function t(n){return i=>n.edge(i).weight}}function k0t(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 S0t(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 E0t(e){e.graph().dummyChains=[],e.edges().forEach(t=>C0t(e,t))}function C0t(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 Cz(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=Sf(Math.min,a);return l===Number.POSITIVE_INFINITY&&(l=0),r.rank=l}e.sources().forEach(n)}function cw(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var zRe=A0t;function A0t(e){let t=new nd({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(;_0t(t,e){let a=s.v,l=i===a?s.w:a;!e.hasNode(l)&&!cw(t,s)&&(e.setNode(l,{}),e.setEdge(i,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function j0t(e,t){return t.edges().reduce((n,i)=>{let r=Number.POSITIVE_INFINITY;return e.hasNode(i.v)!==e.hasNode(i.w)&&(r=cw(t,i)),rt.node(i).rank+=n)}var{preorder:R0t,postorder:I0t}=Sz,P0t=Yy;Yy.initLowLimValues=Az;Yy.initCutValues=Tz;Yy.calcCutValue=VRe;Yy.leaveEdge=qRe;Yy.enterEdge=WRe;Yy.exchangeEdges=KRe;function Yy(e){e=o0t(e),Cz(e);let t=zRe(e);Az(t),Tz(t,e);let n,i;for(;n=qRe(t);)i=WRe(t,e,n),KRe(t,e,n,i)}function Tz(e,t){let n=I0t(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(i=>D0t(e,t,i))}function D0t(e,t,n){let i=e.node(n).parent,r=e.edge(n,i);r.cutvalue=VRe(e,t,n)}function VRe(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,L0t(e,n,d)){let m=e.edge(n,d).cutvalue;a+=f?-m:m}}}),a}function Az(e,t){arguments.length<2&&(t=e.nodes()[0]),HRe(e,{},1,t)}function HRe(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=HRe(e,t,n,c,i))}),a.low=s,a.lim=n++,r?a.parent=r:delete a.parent,n}function qRe(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function WRe(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===WJ(e,e.node(u.v),l)&&c!==WJ(e,e.node(u.w),l)).reduce((u,d)=>cw(t,d)!e.node(r).parent);if(!n)return;let i=R0t(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 L0t(e,t,n){return e.hasEdge(t,n)}function WJ(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var $0t=F0t;function F0t(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":KJ(e);break;case"tight-tree":U0t(e);break;case"longest-path":B0t(e);break;case"none":break;default:KJ(e)}}var B0t=Cz;function U0t(e){Cz(e),zRe(e)}function KJ(e){P0t(e)}var Q0t=z0t;function z0t(e){let t=H0t(e);e.graph().dummyChains.forEach(n=>{let i=e.node(n),r=i.edgeObj,s=V0t(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 H0t(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(HP).forEach(i),t}function q0t(e){let t=Jw(e,"root",{},"_root"),n=W0t(e),i=Object.values(n),r=Sf(Math.max,i)-1,s=2*r+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=s);let a=K0t(e)+1;e.children(HP).forEach(l=>GRe(e,t,s,a,r,n,l)),e.graph().nodeRankFactor=s}function GRe(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=HJ(e,"_bt"),d=HJ(e,"_bb"),f=e.node(a);e.setParent(u,a),f.borderTop=u,e.setParent(d,a),f.borderBottom=d,c.forEach(h=>{var m;GRe(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,w=b!==v?1:r-((m=s[a])!=null?m:0)+1;e.setEdge(u,b,{weight:y,minlen:w,nestingEdge:!0}),e.setEdge(v,d,{weight:y,minlen:w,nestingEdge:!0})}),e.parent(a)||e.setEdge(t,u,{weight:0,minlen:r+((l=s[a])!=null?l:0)})}function W0t(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(HP).forEach(i=>n(i,1)),t}function K0t(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function G0t(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var X0t=Y0t;function Y0t(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;sXJ(e.node(t))),e.edges().forEach(t=>XJ(e.edge(t)))}function XJ(e){let t=e.width;e.width=e.height,e.height=t}function evt(e){e.nodes().forEach(t=>NL(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(NL),Object.hasOwn(i,"y")&&NL(i)})}function NL(e){e.y=-e.y}function tvt(e){e.nodes().forEach(t=>RL(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(RL),Object.hasOwn(i,"x")&&RL(i)})}function RL(e){let t=e.x;e.x=e.y,e.y=t}function nvt(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),i=n.map(l=>e.node(l).rank),r=Sf(Math.max,i),s=mE(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 ivt(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 svt(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 ovt(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 avt(i)}function avt(e){let t=[];function n(r){return s=>{s.merged||(s.barycenter===void 0||r.barycenter===void 0||s.barycenter>=r.barycenter)&&lvt(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=>GN(r,["vs","i","barycenter","weight"]))}function lvt(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 cvt(e,t){let n=u0t(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(uvt(!!t)),c=YJ(s,r,c),i.forEach(d=>{c+=d.vs.length,s.push(d.vs),a+=d.barycenter*d.weight,l+=d.weight,c=YJ(s,r,c)});let u={vs:s.flat(1)};return l&&(u.barycenter=a/l,u.weight=l),u}function YJ(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 uvt(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function YRe(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=svt(e,r);u.forEach(h=>{if(e.children(h.v).length){let m=YRe(e,h.v,n,i);c[h.v]=m,Object.hasOwn(m,"barycenter")&&fvt(h,m)}});let d=ovt(u,n);dvt(d,c);let f=cvt(d,i);if(a&&l){f.vs=[a,f.vs,l].flat(1);let h=e.predecessors(a);if(h&&h.length){let m=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+m.order+b.order)/(f.weight+2),f.weight+=2}}return f}function dvt(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(i=>t[i]?t[i].vs:i)})}function fvt(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 hvt(e,t,n,i){i||(i=e.nodes());let r=pvt(e),s=new nd({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),m=h!==void 0?h.weight:0;s.setEdge(f,a,{weight:e.edge(d).weight+m})}),Object.hasOwn(l,"minRank")&&s.setNode(a,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),s}function pvt(e){let t;for(;e.hasNode(t=Ez("_root")););return t}function mvt(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 ZRe(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,ZRe);return}let n=BRe(e),i=ZJ(e,mE(1,n+1),"inEdges"),r=ZJ(e,mE(n-1,-1,-1),"outEdges"),s=nvt(e);if(JJ(e,s),t.disableOptimalOrderHeuristic)return;let a=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){gvt(u%2?i:r,u%4>=2,c),s=qC(e);let f=ivt(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 hvt(e,s,n,i.get(s)||[])})}function gvt(e,t,n){let i=new nd;e.forEach(function(r){n.forEach(l=>i.setEdge(l.left,l.right));let s=r.graph().root,a=YRe(r,s,i,t);a.vs.forEach((l,c)=>r.node(l).order=c),mvt(r,i,a.vs)})}function JJ(e,t){Object.values(t).forEach(n=>n.forEach((i,r)=>e.node(i).order=r))}function bvt(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=vvt(e,d),m=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),w=y.order;(w{let f=s[d];if(f!==void 0&&e.node(f).dummy){let h=e.predecessors(f);h&&h.forEach(m=>{if(m===void 0)return;let g=e.node(m);g.dummy&&(g.orderu)&&JRe(n,m,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 m=h[0];if(m===void 0)return;c=e.node(m).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 vvt(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(i=>e.node(i).dummy)}}function JRe(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 xvt(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 wvt(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((m,g)=>{let b=a[m],v=a[g];return(b!==void 0?b:0)-(v!==void 0?v:0)}),h=(f.length-1)/2;for(let m=Math.floor(h),g=Math.ceil(h);m<=g;++m){let b=f[m];if(b===void 0)continue;let v=a[b];if(v!==void 0&&s[u]===u&&c{var y;let w=(y=s[v.v])!=null?y:0,x=a.edge(v);return Math.max(b,w+(x!==void 0?x:0))},0):s[m]=0}function d(m){let g=a.outEdges(m),b=Number.POSITIVE_INFINITY;g&&(b=g.reduce((y,w)=>{let x=s[w.w],O=a.edge(w);return Math.min(y,(x!==void 0?x:0)-(O!==void 0?O:0))},Number.POSITIVE_INFINITY));let v=e.node(m);b!==Number.POSITIVE_INFINITY&&v.borderType!==l&&(s[m]=Math.max(s[m]!==void 0?s[m]:0,b))}function f(m){return a.predecessors(m)||[]}function h(m){return a.successors(m)||[]}return c(u,f),c(d,h),Object.keys(i).forEach(m=>{var g;let b=n[m];b!==void 0&&(s[m]=(g=s[b])!=null?g:0)}),s}function kvt(e,t,n,i){let r=new nd,s=e.graph(),a=Avt(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 Svt(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=_vt(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-Sf(Math.min,u);a!=="l"&&(d=r-Sf(Math.max,u)),d&&(e[l]=VP(c,f=>f+d))})})}function Cvt(e,t=void 0){let n=e.ul;return n?VP(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 Tvt(e){let t=qC(e),n=Object.assign(bvt(e,t),yvt(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=wvt(e,r,n,d=>(a==="u"?e.predecessors(d):e.successors(d))||[]),u=Ovt(e,r,c.root,c.align,l==="r");l==="r"&&(u=VP(u,d=>-d)),i[a+l]=u})});let s=Svt(e,i);return Evt(i,s),Cvt(i,e.graph().align)}function Avt(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 _vt(e,t){return e.node(t).width}function jvt(e){e=$Re(e),Nvt(e),Object.entries(Tvt(e)).forEach(([t,n])=>e.node(t).x=n)}function Nvt(e){let t=qC(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 Rvt(e,t={}){let n=t.debugTiming?URe:QRe;return n("layout",()=>{let i=n(" buildLayoutGraph",()=>Qvt(e));return n(" runLayout",()=>Ivt(i,n,t)),n(" updateInputGraph",()=>Pvt(e,i)),i})}function Ivt(e,t,n){t(" makeSpaceForEdgeLabels",()=>zvt(e)),t(" removeSelfEdges",()=>Zvt(e)),t(" acyclic",()=>O0t(e)),t(" nestingGraph.run",()=>q0t(e)),t(" rank",()=>$0t($Re(e))),t(" injectEdgeLabelProxies",()=>Vvt(e)),t(" removeEmptyRanks",()=>l0t(e)),t(" nestingGraph.cleanup",()=>G0t(e)),t(" normalizeRanks",()=>a0t(e)),t(" assignRankMinMax",()=>Hvt(e)),t(" removeEdgeLabelProxies",()=>qvt(e)),t(" normalize.run",()=>E0t(e)),t(" parentDummyChains",()=>Q0t(e)),t(" addBorderSegments",()=>X0t(e)),t(" order",()=>ZRe(e,n)),t(" insertSelfEdges",()=>Jvt(e)),t(" adjustCoordinateSystem",()=>Z0t(e)),t(" position",()=>jvt(e)),t(" positionSelfEdges",()=>ext(e)),t(" removeBorderNodes",()=>Yvt(e)),t(" normalize.undo",()=>T0t(e)),t(" fixupEdgeLabelCoords",()=>Gvt(e)),t(" undoCoordinateSystem",()=>J0t(e)),t(" translateGraph",()=>Wvt(e)),t(" assignNodeIntersects",()=>Kvt(e)),t(" reversePoints",()=>Xvt(e)),t(" acyclic.undo",()=>S0t(e))}function Pvt(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 Dvt=["nodesep","edgesep","ranksep","marginx","marginy"],Mvt={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},Lvt=["acyclicer","ranker","rankdir","align","rankalign"],$vt=["width","height","rank"],eee={width:0,height:0},Fvt=["minlen","weight","width","height","labeloffset"],Bvt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Uvt=["labelpos"];function Qvt(e){let t=new nd({multigraph:!0,compound:!0}),n=PL(e.graph());return t.setGraph(Object.assign({},Mvt,IL(n,Dvt),GN(n,Lvt))),e.nodes().forEach(i=>{let r=PL(e.node(i)),s=IL(r,$vt);Object.keys(eee).forEach(l=>{s[l]===void 0&&(s[l]=eee[l])}),t.setNode(i,s);let a=e.parent(i);a!==void 0&&t.setParent(i,a)}),e.edges().forEach(i=>{let r=PL(e.edge(i));t.setEdge(i,Object.assign({},Bvt,IL(r,Fvt),GN(r,Uvt)))}),t}function zvt(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 Vvt(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};Jw(e,"edge-proxy",r,"_ep")}})}function Hvt(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 qvt(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 Wvt(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,m=u.height;t=Math.min(t,d-h/2),n=Math.max(n,d+h/2),i=Math.min(i,f-m/2),r=Math.max(r,f+m/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 Kvt(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(VJ(i,s)),n.points.push(VJ(r,a))})}function Gvt(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 Xvt(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function Yvt(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 Zvt(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 Jvt(e){qC(e).forEach(t=>{let n=0;t.forEach((i,r)=>{let s=e.node(i);s.order=r+n,(s.selfEdges||[]).forEach(a=>{Jw(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 ext(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 IL(e,t){return VP(GN(e,t),Number)}function PL(e){let t={};return e&&Object.entries(e).forEach(([n,i])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=i}),t}function txt(e){let t=qC(e),n=new nd({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 nxt={graphlib:_Re,version:h0t,layout:Rvt,debug:txt,util:{time:URe,notime:QRe}},tee=nxt;/*! For license information please see dagre.esm.js.LEGAL.txt */const ik={llm:{labelKey:"buildCanvas.patterns.llm.label",descriptionKey:"buildCanvas.patterns.llm.description",icon:lAe},sequential:{labelKey:"buildCanvas.patterns.sequential.label",descriptionKey:"buildCanvas.patterns.sequential.description",icon:nrt},parallel:{labelKey:"buildCanvas.patterns.parallel.label",descriptionKey:"buildCanvas.patterns.parallel.description",icon:Mit},loop:{labelKey:"buildCanvas.patterns.loop.label",descriptionKey:"buildCanvas.patterns.loop.description",icon:fAe},a2a:{labelKey:"buildCanvas.patterns.a2a.label",descriptionKey:"buildCanvas.patterns.a2a.description",icon:bP}},ZF=220,JF=88,nee=96,iee=34,Gk=64,DL=310,Fv=24,eIe=56,e8=40,ree=40,ixt=18,rxt=58,sxt=!1,oxt=e=>e==="sequential"||e==="parallel"||e==="loop";function t8(e,t){const n=e.agentType??"llm";return oxt(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function n8(e,t=[],n="horizontal",i=!1){const r=e.agentType??"llm";if(!t8(e,t))return{width:ZF,height:JF};if(i&&e.subAgents.length===0)return{width:DL,height:Gk};const s=e.subAgents.map((f,h)=>n8(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"?eIe:Fv,u=n==="horizontal"?r!=="parallel":r==="parallel",d=s.length?r==="parallel"?ixt+ree:r==="loop"?rxt:0:ree;return u?{width:Math.max(DL,s.reduce((f,h)=>f+h.width,0)+e8*Math.max(0,s.length-1)+c*2),height:Gk+Fv+l+d+Fv}:{width:Math.max(DL,a+Fv*2),height:Gk+c+s.reduce((f,h)=>f+h.height,0)+e8*Math.max(0,s.length-1)+d+c}}function dO(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function axt(e,t){return e.length===t.length&&e.every((n,i)=>n===t[i])}function see(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function fO(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:dE.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 oee(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,m,g,b){const v=f.agentType??"llm",y=dO(h);return t8(f,h)?(l(f,h,m,g,b),y):(r.push({id:y,type:"agent",parentId:m,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(ik[v].descriptionKey),childCount:f.subAgents.length,containedIn:b}}),y)}function l(f,h,m,g={x:0,y:0},b){const v=f.agentType??"sequential",y=dO(h),w=n8(f,h,t,n);r.push({id:y,type:"group",parentId:m,extent:m?"parent":void 0,position:g,style:{width:w.width,height:w.height},data:{kind:"agent",path:h,agent:f,title:f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i(ik[v].labelKey)),pattern:v,description:f.description.trim()||i(ik[v].descriptionKey),childCount:f.subAgents.length,containedIn:b,layoutWidth:w.width,layoutHeight:w.height,compactEmptyGroup:n&&f.subAgents.length===0}});const x=f.subAgents.map((E,R)=>n8(E,[...h,R],t,n)),O=x.length&&v!=="parallel"?eIe:Fv,S=t==="horizontal"?v!=="parallel":v==="parallel";let k=O;const C=f.subAgents.map((E,R)=>{const A=x[R],j=S?{x:k,y:Gk+Fv}:{x:(w.width-A.width)/2,y:Gk+k};return k+=(S?A.width:A.height)+e8,a(E,[...h,R],y,j,v)});if(v==="sequential"||v==="loop"){for(let E=0;E1&&s.push(fO(C[C.length-1],C[0],i("buildCanvas.edges.continueLoop"),{loop:!0,tone:"loop"}))}return y}const c=(f,h)=>{const m=f.agentType??"llm",g=dO(h);if(t8(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:m==="a2a"?i("buildCanvas.patterns.a2a.label"):f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i("buildCanvas.unnamedStep")),pattern:m,description:f.description.trim()||i(ik[m].descriptionKey),childCount:f.subAgents.length}}),f.subAgents.length===0)return[g];const b=[];return f.subAgents.forEach((v,y)=>{const w=[...h,y],x=dO(w);s.push(fO(g,x,i("buildCanvas.edges.call"),{insert:{parentPath:h,index:y}})),b.push(...c(v,w))}),b},u=dO([]),d=c(e,[]);return s.push(fO("terminal-input",u)),d.forEach(f=>s.push(fO(f,"terminal-output"))),lxt(r,s,t)}function lxt(e,t,n){const i=new tee.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?nee:s.data.layoutWidth??ZF,height:a?iee:s.data.layoutHeight??JF})}),t.filter(s=>r.has(s.source)&&r.has(s.target)).forEach(s=>i.setEdge(s.source,s.target)),tee.layout(i),{nodes:e.map(s=>{if(s.parentId)return s;const a=i.node(s.id),l=s.data.kind==="terminal",c=l?nee:s.data.layoutWidth??ZF,u=l?iee:s.data.layoutHeight??JF;return{...s,position:{x:a.x-c/2,y:a.y-u/2}}}),edges:t}}const qP=p.createContext(null),WP=p.createContext("horizontal");function cxt({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}=je("create"),h=p.useContext(qP),[m,g]=p.useState(!1),[b,v,y]=HN({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(HC,{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(tyt,{children:o.jsxs("div",{className:`abc-edge-tools${h&&(d!=null&&d.insert)?" can-insert":""}${m?" 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:w=>{w.stopPropagation(),h==null||h.onInsert(d.insert.parentPath,d.insert.index)},children:o.jsx(jl,{})})]})})]})}function uxt({data:e,selected:t}){const{t:n}=je("create"),i=p.useContext(qP),r=p.useContext(WP),s=r==="vertical"?fn.Top:fn.Left,a=r==="vertical"?fn.Bottom:fn.Right,l=r==="vertical"?fn.Right:fn.Bottom,c=e.pattern??"llm",u=ik[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(sc,{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(ag,{})}),o.jsx(sc,{type:"source",position:a,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(sc,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),o.jsx(sc,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function dxt({data:e,selected:t}){const{t:n}=je("create"),i=p.useContext(qP),r=p.useContext(WP),s=r==="vertical"?fn.Top:fn.Left,a=r==="vertical"?fn.Bottom:fn.Right,l=r==="vertical"?fn.Right:fn.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(sc,{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(jl,{})}),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(jl,{})})]}),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(jl,{}),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(jl,{}),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(ag,{})}),o.jsx(sc,{type:"source",position:a,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(sc,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),o.jsx(sc,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function fxt({data:e}){const t=p.useContext(WP);return o.jsxs("div",{className:"abc-terminal",children:[o.jsx(sc,{type:"target",position:t==="vertical"?fn.Top:fn.Left,className:"abc-handle"}),o.jsx("span",{children:e.title}),o.jsx(sc,{type:"source",position:t==="vertical"?fn.Bottom:fn.Right,className:"abc-handle"})]})}const hxt={agent:uxt,group:dxt,terminal:fxt},pxt={insertStep:cxt};function mxt({draft:e,selectedPath:t,onSelect:n,onAdd:i,onInsert:r,onDelete:s,readOnly:a=!1,interactivePreview:l=!1,direction:c="horizontal"}){const{t:u}=je("create"),d=p.useMemo(()=>oee(e,c,a,u),[]),[f,h,m]=nyt(d.nodes),[g,b,v]=iyt(d.edges),y=syt(),w=p.useRef(`${c}:${a?"readonly":"editable"}:${see(e)}`),x=p.useRef(null),{fitView:O}=QP(),S=p.useMemo(()=>oee(e,c,a,u),[c,e,a,u]),[k,C]=p.useState(()=>window.matchMedia("(max-width: 860px)").matches),E=p.useMemo(()=>a?{padding:.16,minZoom:.05,maxZoom:.9}:k?{padding:.08,minZoom:.35,maxZoom:.9}:{padding:.14,minZoom:.42,maxZoom:1.1},[k,a]),R=p.useCallback((j=0)=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const T=x.current;if(T&&(T.clientWidth===0||T.clientHeight===0)&&j<8){R(j+1);return}O(E)})})},[E,O]);p.useEffect(()=>{const j=window.matchMedia("(max-width: 860px)"),T=N=>C(N.matches);return j.addEventListener("change",T),()=>j.removeEventListener("change",T)},[]),p.useEffect(()=>{const j=`${c}:${a?"readonly":"editable"}:${see(e)}`,T=j!==w.current;w.current=j,b(S.edges),h(N=>{const _=new Map(N.map(D=>[D.id,D]));return S.nodes.map(D=>{const M=_.get(D.id);return{...D,measured:!T&&M&&M.type===D.type?M.measured:void 0,position:!T&&M?M.position:D.position,selected:D.data.kind==="agent"&&!!D.data.path&&axt(D.data.path,t)}})}),T&&R()},[S,e,R,t,b,h]),p.useEffect(()=>{R()},[k,R]),p.useEffect(()=>{y&&R()},[S,R,y]),p.useEffect(()=>{if(!a||!x.current)return;const j=new ResizeObserver(()=>R());return j.observe(x.current),R(),()=>j.disconnect()},[R,a]);const A=p.useMemo(()=>a?null:{onAdd:i,onInsert:r,onDelete:s},[i,s,r,a]);return o.jsx(WP.Provider,{value:c,children:o.jsx(qP.Provider,{value:A,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:x,className:"abc-canvas",children:o.jsxs(Jbt,{nodes:f,edges:g,nodeTypes:hxt,edgeTypes:pxt,onNodesChange:m,onEdgesChange:v,onNodeClick:(j,T)=>{!a&&T.data.kind==="agent"&&T.data.path&&n(T.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:E,onInit:()=>R(),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(uyt,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!a||l)&&o.jsx(byt,{showInteractive:!1}),sxt]})})})})})}function gE(e){return o.jsx(SRe,{children:o.jsx(mxt,{...e})})}hn.hasResourceBundle("en-US","create")||hn.addResourceBundle("en-US","create",que,!0,!0);hn.hasResourceBundle("zh-CN","create")||hn.addResourceBundle("zh-CN","create",Kbe,!0,!0);function Wt(e,t={}){return hn.t(e,{...t,ns:"create"})}function WC(e,t){return e.map(n=>({...n,get label(){return Wt(`${t}.${n.id}.label`)},get desc(){return Wt(`${t}.${n.id}.description`)}}))}function $u(e,t){const n={...e};for(const[i,r]of Object.entries(t))Object.defineProperty(n,i,{configurable:!0,enumerable:!0,get:()=>Wt(r)});return n}const tIe="https://ark.cn-beijing.volces.com/api/v3/";$u({key:"MODEL_AGENT_NAME",required:!1,placeholder:"doubao-seed-1-6-250615"},{comment:"traditional.catalog.env.modelAgentName.comment"});const nj=[$u({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:tIe}],XN=[],YN={get label(){return Wt("traditional.catalog.links.console")},url:"https://console.volcengine.com/vikingdb/openviking"},gxt={get label(){return Wt("traditional.catalog.links.documentation")},url:"https://github.com/volcengine/OpenViking/blob/main/docs/zh/api/05-sessions.md"},nIe="https://api.vikingdb.cn-beijing.volces.com/openviking",bxt=`{ +`)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return p.useEffect(()=>{const c=(t==null?void 0:t.target)??SJ,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=m=>{var v,y;if(r.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!r.current||r.current&&!u)&&MNe(m))return!1;const b=CJ(m.code,l);if(s.current.add(m[b]),EJ(a,s.current,!1)){const w=((y=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:y[0])||m.target,x=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";t.preventDefault!==!1&&(r.current||!x)&&m.preventDefault(),i(!0)}},f=m=>{const g=CJ(m.code,l);EJ(a,s.current,!0)?(i(!1),s.current.clear()):s.current.delete(m[g]),m.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 EJ(e,t,n){return e.filter(i=>n||i.length===t.size).some(i=>i.every(r=>t.has(r)))}function CJ(e,t){return t.includes(e)?"code":"key"}const Mgt=()=>{const e=Is();return p.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=mz(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 Zw(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=aw(t,n);return{x:a.x+r,y:a.y+s}}}),[])};function rRe(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)Lgt(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 Lgt(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 sRe(e,t){return rRe(e,t)}function oRe(e,t){return rRe(e,t)}function kb(e,t){return{id:e,type:"select",selected:t}}function $v(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(kb(s.id,a)))}return i}function TJ({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 AJ(e){return{id:e.id,type:"remove"}}const $gt=INe();function Fgt(e,t,n={}){return jmt(e,t,{...n,onError:n.onError??$gt})}const _J=e=>mmt(e),Bgt=e=>_Ne(e);function aRe(e){return p.forwardRef(e)}const Ugt=typeof window<"u"?p.useLayoutEffect:p.useEffect;function jJ(e){const[t,n]=p.useState(BigInt(0)),[i]=p.useState(()=>Qgt(()=>n(r=>r+BigInt(1))));return Ugt(()=>{const r=i.get();r.length&&(e(r),i.reset())},[t]),i}function Qgt(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const lRe=p.createContext(null);function zgt({children:e}){const t=Is(),n=p.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:m,onNodesChangeMiddlewareMap:g}=t.getState();let b=c;for(const y of l)b=typeof y=="function"?y(b):y;let v=TJ({items:b,lookup:h});for(const y of g.values())v=y(v);d&&u(b),v.length>0?f==null||f(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:w,setNodes:x}=t.getState();y&&x(w)})},[]),i=jJ(n),r=p.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let m=c;for(const g of l)m=typeof g=="function"?g(m):g;d?u(m):f&&f(TJ({items:m,lookup:h}))},[]),s=jJ(r),a=p.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return o.jsx(lRe.Provider,{value:a,children:e})}function Vgt(){const e=p.useContext(lRe);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Hgt=e=>!!e.panZoom;function zP(){const e=Mgt(),t=Is(),n=Vgt(),i=Ki(Hgt),r=p.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,w;const{nodeLookup:h,nodeOrigin:m}=t.getState(),g=_J(f)?f:h.get(f.id),b=g.parentId?PNe(g.position,g.measured,g.parentId,h,m):g.position,v={...g,position:b,width:((y=g.measured)==null?void 0:y.width)??g.width,height:((w=g.measured)==null?void 0:w.height)??g.height};return ow(v)},u=(f,h,m={replace:!1})=>{a(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return m.replace&&_J(v)?v:{...b,...v}}return b}))},d=(f,h,m={replace:!1})=>{l(g=>g.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return m.replace&&Bgt(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(m=>[...m,...h])},addEdges:f=>{const h=Array.isArray(f)?f:[f];n.edgeQueue.push(m=>[...m,...h])},toObject:()=>{const{nodes:f=[],edges:h=[],transform:m}=t.getState(),[g,b,v]=m;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:m,edges:g,onNodesDelete:b,onEdgesDelete:v,triggerNodeChanges:y,triggerEdgeChanges:w,onDelete:x,onBeforeDelete:O}=t.getState(),{nodes:S,edges:k}=await xmt({nodesToRemove:f,edgesToRemove:h,nodes:m,edges:g,onBeforeDelete:O}),C=k.length>0,E=S.length>0;if(C){const R=k.map(AJ);v==null||v(k),w(R)}if(E){const R=S.map(AJ);b==null||b(S),y(R)}return(E||C)&&(x==null||x({nodes:S,edges:k})),{deletedNodes:S,deletedEdges:k}},getIntersectingNodes:(f,h=!0,m)=>{const g=sJ(f),b=g?f:c(f),v=m!==void 0;return b?(m||t.getState().nodes).filter(y=>{const w=t.getState().nodeLookup.get(y.id);if(w&&!g&&(y.id===f.id||!w.internals.positionAbsolute))return!1;const x=ow(v?y:w),O=fE(x,b);return h&&O>0||O>=x.width*x.height||O>=b.width*b.height}):[]},isNodeIntersecting:(f,h,m=!0)=>{const b=sJ(f)?f:c(f);if(!b)return!1;const v=fE(b,h);return m&&v>0||v>=h.width*h.height||v>=b.width*b.height},updateNode:u,updateNodeData:(f,h,m={replace:!1})=>{u(f,g=>{const b=typeof h=="function"?h(g):h;return m.replace?{...g,data:b}:{...g,data:{...g.data,...b}}},m)},updateEdge:d,updateEdgeData:(f,h,m={replace:!1})=>{d(f,g=>{const b=typeof h=="function"?h(g):h;return m.replace?{...g,data:b}:{...g,data:{...g.data,...b}}},m)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:m}=t.getState();return gmt(f,{nodeLookup:h,nodeOrigin:m})},getHandleConnections:({type:f,id:h,nodeId:m})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${m}-${f}${h?`-${h}`:""}`))==null?void 0:g.values())??[])},getNodeConnections:({type:f,handleId:h,nodeId:m})=>{var g;return Array.from(((g=t.getState().connectionLookup.get(`${m}${f?h?`-${f}-${h}`:`-${f}`:""}`))==null?void 0:g.values())??[])},fitView:async f=>{const h=t.getState().fitViewResolver??kmt();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(m=>[...m]),h.promise}}},[]);return p.useMemo(()=>({...r,...e,viewportInitialized:i}),[i])}const NJ=e=>e.selected,qgt=typeof window<"u"?window:void 0;function Wgt({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Is(),{deleteElements:i}=zP(),r=pE(e,{actInsideInputWithModifier:!1}),s=pE(t,{target:qgt});p.useEffect(()=>{if(r){const{edges:a,nodes:l}=n.getState();i({nodes:l.filter(NJ),edges:a.filter(NJ)}),n.setState({nodesSelectionActive:!1})}},[r]),p.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function Kgt(e){const t=Is();p.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=bz(e.current);(i.height===0||i.width===0)&&((l=(a=t.getState()).onError)==null||l.call(a,"004",Ld.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 VP={position:"absolute",width:"100%",height:"100%",top:0,left:0},Ggt=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Xgt({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:s=ry.Free,zoomOnDoubleClick:a=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:m=!0,children:g,noWheelClassName:b,noPanClassName:v,onViewportChange:y,isControlledViewport:w,paneClickDistance:x,selectionOnDrag:O}){const S=Is(),k=p.useRef(null),{userSelectionActive:C,lib:E,connectionInProgress:R}=Ki(Ggt,Rs),A=pE(h),N=p.useRef();Kgt(k);const T=p.useCallback(j=>{y==null||y({x:j[0],y:j[1],zoom:j[2]}),w||S.setState({transform:j})},[y,w]);return p.useEffect(()=>{if(k.current){N.current=ogt({domNode:k.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:D=>S.setState(P=>P.paneDragging===D?P:{paneDragging:D}),onPanZoomStart:(D,P)=>{const{onViewportChangeStart:L,onMoveStart:B}=S.getState();B==null||B(D,P),L==null||L(P)},onPanZoom:(D,P)=>{const{onViewportChange:L,onMove:B}=S.getState();B==null||B(D,P),L==null||L(P)},onPanZoomEnd:(D,P)=>{const{onViewportChangeEnd:L,onMoveEnd:B}=S.getState();B==null||B(D,P),L==null||L(P)}});const{x:j,y:_,zoom:I}=N.current.getViewport();return S.setState({panZoom:N.current,transform:[j,_,I],domNode:k.current.closest(".react-flow")}),()=>{var D;(D=N.current)==null||D.destroy()}}},[]),p.useEffect(()=>{var j;(j=N.current)==null||j.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:s,zoomOnDoubleClick:a,panOnDrag:l,zoomActivationKeyPressed:A,preventScrolling:m,noPanClassName:v,userSelectionActive:C,noWheelClassName:b,lib:E,onTransformChange:T,connectionInProgress:R,selectionOnDrag:O,paneClickDistance:x})},[e,t,n,i,r,s,a,l,A,m,v,C,b,E,T,R,O,x]),o.jsx("div",{className:"react-flow__renderer",ref:k,style:VP,children:g})}const Ygt=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Zgt(){const{userSelectionActive:e,userSelectionRect:t}=Ki(Ygt,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 AL=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Jgt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function ebt({isSelecting:e,selectionKeyPressed:t,selectionMode:n=uE.Full,panOnDrag:i,autoPanOnSelection:r,paneClickDistance:s,selectionOnDrag:a,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:m,onPaneMouseLeave:g,children:b}){const v=p.useRef(0),y=Is(),{userSelectionActive:w,elementsSelectable:x,dragging:O,connectionInProgress:S,panBy:k,autoPanSpeed:C}=Ki(Jgt,Rs),E=x&&(e||w),R=p.useRef(null),A=p.useRef(),N=p.useRef(new Set),T=p.useRef(new Set),j=p.useRef(!1),_=p.useRef({x:0,y:0}),I=p.useRef(!1),D=z=>{if(j.current||S){j.current=!1;return}u==null||u(z),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},P=z=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){z.preventDefault();return}d==null||d(z)},L=f?z=>f(z):void 0,B=z=>{j.current&&(z.stopPropagation(),j.current=!1)},M=z=>{var le,fe;const{domNode:Y,transform:ae}=y.getState();if(A.current=Y==null?void 0:Y.getBoundingClientRect(),!A.current)return;const Ee=z.target===R.current;if(!Ee&&!!z.target.closest(".nokey")||!e||!(a&&Ee||t)||z.button!==0||!z.isPrimary)return;(fe=(le=z.target)==null?void 0:le.setPointerCapture)==null||fe.call(le,z.pointerId),j.current=!1;const{x:te,y:de}=Td(z.nativeEvent,A.current),Ce=Zw({x:te,y:de},ae);y.setState({userSelectionRect:{width:0,height:0,startX:Ce.x,startY:Ce.y,x:te,y:de}}),Ee||(z.stopPropagation(),z.preventDefault())};function H(z,Y){const{userSelectionRect:ae}=y.getState();if(!ae)return;const{transform:Ee,nodeLookup:Z,edgeLookup:G,connectionLookup:te,triggerNodeChanges:de,triggerEdgeChanges:Ce,defaultEdgeOptions:le}=y.getState(),fe={x:ae.startX,y:ae.startY},{x:ce,y:Te}=aw(fe,Ee),Me={startX:fe.x,startY:fe.y,x:zje.id)),T.current=new Set;const ke=(le==null?void 0:le.selectable)??!0;for(const je of N.current){const re=te.get(je);if(re)for(const{edgeId:ve}of re.values()){const be=G.get(ve);be&&(be.selectable??ke)&&T.current.add(ve)}}if(!oJ(we,N.current)){const je=$v(Z,N.current,!0);de(je)}if(!oJ(Ue,T.current)){const je=$v(G,T.current);Ce(je)}y.setState({userSelectionRect:Me,userSelectionActive:!0,nodesSelectionActive:!1})}function K(){if(!r||!A.current)return;const[z,Y]=pz(_.current,A.current,C);k({x:z,y:Y}).then(ae=>{if(!j.current||!ae){v.current=requestAnimationFrame(K);return}const{x:Ee,y:Z}=_.current;H(Ee,Z),v.current=requestAnimationFrame(K)})}const F=()=>{cancelAnimationFrame(v.current),v.current=0,I.current=!1};p.useEffect(()=>()=>F(),[]);const q=z=>{const{userSelectionRect:Y,transform:ae,resetSelectedElements:Ee}=y.getState();if(!A.current||!Y)return;const{x:Z,y:G}=Td(z.nativeEvent,A.current);_.current={x:Z,y:G};const te=aw({x:Y.startX,y:Y.startY},ae);if(!j.current){const de=t?0:s;if(Math.hypot(Z-te.x,G-te.y)<=de)return;Ee(),l==null||l(z)}j.current=!0,I.current||(K(),I.current=!0),H(Z,G)},Q=z=>{var Y,ae;z.button===0&&((ae=(Y=z.target)==null?void 0:Y.releasePointerCapture)==null||ae.call(Y,z.pointerId),!w&&z.target===R.current&&y.getState().userSelectionRect&&(D==null||D(z)),y.setState({userSelectionActive:!1,userSelectionRect:null}),j.current&&(c==null||c(z),y.setState({nodesSelectionActive:N.current.size>0})),F())},X=z=>{var Y,ae;(ae=(Y=z.target)==null?void 0:Y.releasePointerCapture)==null||ae.call(Y,z.pointerId),F()},ne=i===!0||Array.isArray(i)&&i.includes(0);return o.jsxs("div",{className:Ho(["react-flow__pane",{draggable:ne,dragging:O,selection:e}]),onClick:E?void 0:AL(D,R),onContextMenu:AL(P,R),onWheel:AL(L,R),onPointerEnter:E?void 0:h,onPointerMove:E?q:m,onPointerUp:E?Q:void 0,onPointerCancel:E?X:void 0,onPointerDownCapture:E?M:void 0,onClickCapture:E?B:void 0,onPointerLeave:g,ref:R,style:VP,children:[b,o.jsx(Zgt,{})]})}function XF({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",Ld.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 cRe({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:s,nodeClickDistance:a}){const l=Is(),[c,u]=p.useState(!1),d=p.useRef();return p.useEffect(()=>{d.current=qmt({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{XF({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),p.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 tbt=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function uRe(){const e=Is();return p.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=tbt(a),m=r?s[0]:5,g=r?s[1]:5,b=n.direction.x*m*n.factor,v=n.direction.y*g*n.factor;for(const[,y]of u){if(!h(y))continue;let w={x:y.internals.positionAbsolute.x+b,y:y.internals.positionAbsolute.y+v};r&&(w=VC(w,s));const{position:x,positionAbsolute:O}=jNe({nodeId:y.id,nextPosition:w,nodeLookup:u,nodeExtent:i,nodeOrigin:d,onError:l});y.position=x,y.internals.positionAbsolute=O,f.set(y.id,y)}c(f)},[])}const kz=p.createContext(null),nbt=kz.Provider;kz.Consumer;const dRe=()=>p.useContext(kz),ibt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),rbt=(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===rw.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 sbt({type:e="source",position:t=pn.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},m){var I,D;const g=a||null,b=e==="target",v=Is(),y=dRe(),{connectOnClick:w,noPanClassName:x,rfId:O}=Ki(ibt,Rs),{connectingFrom:S,connectingTo:k,clickConnecting:C,isPossibleEndHandle:E,connectionInProcess:R,clickConnectionInProcess:A,valid:N}=Ki(rbt(y,g,e),Rs);y||(D=(I=v.getState()).onError)==null||D.call(I,"010",Ld.error010());const T=P=>{const{defaultEdgeOptions:L,onConnect:B,hasDefaultEdges:M}=v.getState(),H={...L,...P};if(M){const{edges:K,setEdges:F,onError:q}=v.getState();F(Fgt(H,K,{onError:q}))}B==null||B(H),l==null||l(H)},j=P=>{if(!y)return;const L=LNe(P.nativeEvent);if(r&&(L&&P.button===0||!L)){const B=v.getState();GF.onPointerDown(P.nativeEvent,{handleDomNode:P.currentTarget,autoPanOnConnect:B.autoPanOnConnect,connectionMode:B.connectionMode,connectionRadius:B.connectionRadius,domNode:B.domNode,nodeLookup:B.nodeLookup,lib:B.lib,isTarget:b,handleId:g,nodeId:y,flowId:B.rfId,panBy:B.panBy,cancelConnection:B.cancelConnection,onConnectStart:B.onConnectStart,onConnectEnd:(...M)=>{var H,K;return(K=(H=v.getState()).onConnectEnd)==null?void 0:K.call(H,...M)},updateConnection:B.updateConnection,onConnect:T,isValidConnection:n||((...M)=>{var H,K;return((K=(H=v.getState()).isValidConnection)==null?void 0:K.call(H,...M))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:B.autoPanSpeed,dragThreshold:B.connectionDragThreshold})}L?d==null||d(P):f==null||f(P)},_=P=>{const{onClickConnectStart:L,onClickConnectEnd:B,connectionClickStartHandle:M,connectionMode:H,isValidConnection:K,lib:F,rfId:q,nodeLookup:Q,connection:X}=v.getState();if(!y||!M&&!r)return;if(!M){L==null||L(P.nativeEvent,{nodeId:y,handleId:g,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:y,type:e,id:g}});return}const ne=DNe(P.target),z=n||K,{connection:Y,isValid:ae}=GF.isValid(P.nativeEvent,{handle:{nodeId:y,id:g,type:e},connectionMode:H,fromNodeId:M.nodeId,fromHandleId:M.id||null,fromType:M.type,isValidConnection:z,flowId:q,doc:ne,lib:F,nodeLookup:Q});ae&&Y&&T(Y);const Ee=structuredClone(X);delete Ee.inProgress,Ee.toPosition=Ee.toHandle?Ee.toHandle.position:null,B==null||B(P,Ee),v.setState({connectionClickStartHandle:null})};return o.jsx("div",{"data-handleid":g,"data-nodeid":y,"data-handlepos":t,"data-id":`${O}-${y}-${g}-${e}`,className:Ho(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,u,{source:!b,target:b,connectable:i,connectablestart:r,connectableend:s,clickconnecting:C,connectingfrom:S,connectingto:k,valid:N,connectionindicator:i&&(!R||E)&&(R||A?s:r)}]),onMouseDown:j,onTouchStart:j,onClick:w?_:void 0,ref:m,...h,children:c})}const oc=p.memo(aRe(sbt));function obt({data:e,isConnectable:t,sourcePosition:n=pn.Bottom}){return o.jsxs(o.Fragment,{children:[e==null?void 0:e.label,o.jsx(oc,{type:"source",position:n,isConnectable:t})]})}function abt({data:e,isConnectable:t,targetPosition:n=pn.Top,sourcePosition:i=pn.Bottom}){return o.jsxs(o.Fragment,{children:[o.jsx(oc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,o.jsx(oc,{type:"source",position:i,isConnectable:t})]})}function lbt(){return null}function cbt({data:e,isConnectable:t,targetPosition:n=pn.Top}){return o.jsxs(o.Fragment,{children:[o.jsx(oc,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const WN={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},RJ={input:obt,default:abt,output:cbt,group:lbt};function ubt(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 dbt=e=>{const{width:t,height:n,x:i,y:r}=zC(e.nodeLookup,{filter:s=>!!s.selected});return{width:Cd(t)?t:null,height:Cd(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 fbt({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const i=Is(),{width:r,height:s,transformString:a,userSelectionActive:l}=Ki(dbt,Rs),c=uRe(),u=p.useRef(null);p.useEffect(()=>{var m;n||(m=u.current)==null||m.focus({preventScroll:!0})},[n]);const d=!l&&r!==null&&s!==null;if(cRe({nodeRef:u,disabled:!d}),!d)return null;const f=e?m=>{const g=i.getState().nodes.filter(b=>b.selected);e(m,g)}:void 0,h=m=>{Object.prototype.hasOwnProperty.call(WN,m.key)&&(m.preventDefault(),c({direction:WN[m.key],factor:m.shiftKey?4:1}))};return o.jsx("div",{className:Ho(["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 IJ=typeof window<"u"?window:void 0,hbt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function fRe({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:m,multiSelectionKeyCode:g,panActivationKeyCode:b,zoomActivationKeyCode:v,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:O,panOnScrollSpeed:S,panOnScrollMode:k,zoomOnDoubleClick:C,panOnDrag:E,autoPanOnSelection:R,defaultViewport:A,translateExtent:N,minZoom:T,maxZoom:j,preventScrolling:_,onSelectionContextMenu:I,noWheelClassName:D,noPanClassName:P,disableKeyboardA11y:L,onViewportChange:B,isControlledViewport:M}){const{nodesSelectionActive:H,userSelectionActive:K}=Ki(hbt,Rs),F=pE(u,{target:IJ}),q=pE(b,{target:IJ}),Q=q||E,X=q||O,ne=d&&Q!==!0,z=F||K||ne;return Wgt({deleteKeyCode:c,multiSelectionKeyCode:g}),o.jsx(Xgt,{onPaneContextMenu:s,elementsSelectable:y,zoomOnScroll:w,zoomOnPinch:x,panOnScroll:X,panOnScrollSpeed:S,panOnScrollMode:k,zoomOnDoubleClick:C,panOnDrag:!F&&Q,defaultViewport:A,translateExtent:N,minZoom:T,maxZoom:j,zoomActivationKeyCode:v,preventScrolling:_,noWheelClassName:D,noPanClassName:P,onViewportChange:B,isControlledViewport:M,paneClickDistance:l,selectionOnDrag:ne,children:o.jsxs(ebt,{onSelectionStart:h,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:a,panOnDrag:Q,autoPanOnSelection:R,isSelecting:!!z,selectionMode:f,selectionKeyPressed:F,paneClickDistance:l,selectionOnDrag:ne,children:[e,H&&o.jsx(fbt,{onSelectionContextMenu:I,noPanClassName:P,disableKeyboardA11y:L})]})})}fRe.displayName="FlowRenderer";const pbt=p.memo(fRe),mbt=e=>t=>e?hz(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 gbt(e){return Ki(p.useCallback(mbt(e),[e]),Rs)}const bbt=e=>e.updateNodeInternals;function ybt(){const e=Ki(bbt),[t]=p.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 p.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function vbt({node:e,nodeType:t,hasDimensions:n,resizeObserver:i}){const r=Is(),s=p.useRef(null),a=p.useRef(null),l=p.useRef(e.sourcePosition),c=p.useRef(e.targetPosition),u=p.useRef(t),d=n&&!!e.internals.handleBounds;return p.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]),p.useEffect(()=>()=>{a.current&&(i==null||i.unobserve(a.current),a.current=null)},[]),p.useEffect(()=>{if(s.current){const f=u.current!==t,h=l.current!==e.sourcePosition,m=c.current!==e.targetPosition;(f||h||m)&&(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 xbt({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:m,disableKeyboardA11y:g,rfId:b,nodeTypes:v,nodeClickDistance:y,onError:w}){const{node:x,internals:O,isParent:S}=Ki(z=>{const Y=z.nodeLookup.get(e),ae=z.parentLookup.has(e);return{node:Y,internals:Y.internals,isParent:ae}},Rs);let k=x.type||"default",C=(v==null?void 0:v[k])||RJ[k];C===void 0&&(w==null||w("003",Ld.error003(k)),k="default",C=(v==null?void 0:v.default)||RJ.default);const E=!!(x.draggable||l&&typeof x.draggable>"u"),R=!!(x.selectable||c&&typeof x.selectable>"u"),A=!!(x.connectable||u&&typeof x.connectable>"u"),N=!!(x.focusable||d&&typeof x.focusable>"u"),T=Is(),j=gz(x),_=vbt({node:x,nodeType:k,hasDimensions:j,resizeObserver:f}),I=cRe({nodeRef:_,disabled:x.hidden||!E,noDragClassName:h,handleSelector:x.dragHandle,nodeId:e,isSelectable:R,nodeClickDistance:y}),D=uRe();if(x.hidden)return null;const P=Ap(x),L=ubt(x),B=R||E||t||n||i||r,M=n?z=>n(z,{...O.userNode}):void 0,H=i?z=>i(z,{...O.userNode}):void 0,K=r?z=>r(z,{...O.userNode}):void 0,F=s?z=>s(z,{...O.userNode}):void 0,q=a?z=>a(z,{...O.userNode}):void 0,Q=z=>{const{selectNodesOnDrag:Y,nodeDragThreshold:ae}=T.getState();R&&(!Y||!E||ae>0)&&XF({id:e,store:T,nodeRef:_}),t&&t(z,{...O.userNode})},X=z=>{if(!(MNe(z.nativeEvent)||g)){if(ENe.includes(z.key)&&R){const Y=z.key==="Escape";XF({id:e,store:T,unselect:Y,nodeRef:_})}else if(E&&x.selected&&Object.prototype.hasOwnProperty.call(WN,z.key)){z.preventDefault();const{ariaLabelConfig:Y}=T.getState();T.setState({ariaLiveMessage:Y["node.a11yDescription.ariaLiveMessage"]({direction:z.key.replace("Arrow","").toLowerCase(),x:~~O.positionAbsolute.x,y:~~O.positionAbsolute.y})}),D({direction:WN[z.key],factor:z.shiftKey?4:1})}}},ne=()=>{var te;if(g||!((te=_.current)!=null&&te.matches(":focus-visible")))return;const{transform:z,width:Y,height:ae,autoPanOnNodeFocus:Ee,setCenter:Z}=T.getState();if(!Ee)return;hz(new Map([[e,x]]),{x:0,y:0,width:Y,height:ae},z,!0).length>0||Z(x.position.x+P.width/2,x.position.y+P.height/2,{zoom:z[2]})};return o.jsx("div",{className:Ho(["react-flow__node",`react-flow__node-${k}`,{[m]:E},x.className,{selected:x.selected,selectable:R,parent:S,draggable:E,dragging:I}]),ref:_,style:{zIndex:O.z,transform:`translate(${O.positionAbsolute.x}px,${O.positionAbsolute.y}px)`,pointerEvents:B?"all":"none",visibility:j?"visible":"hidden",...x.style,...L},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:M,onMouseMove:H,onMouseLeave:K,onContextMenu:F,onClick:Q,onDoubleClick:q,onKeyDown:N?X:void 0,tabIndex:N?0:void 0,onFocus:N?ne:void 0,role:x.ariaRole??(N?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${tRe}-${b}`,"aria-label":x.ariaLabel,...x.domAttributes,children:o.jsx(nbt,{value:e,children:o.jsx(C,{id:e,data:x.data,type:k,positionAbsoluteX:O.positionAbsolute.x,positionAbsoluteY:O.positionAbsolute.y,selected:x.selected??!1,selectable:R,draggable:E,deletable:x.deletable??!0,isConnectable:A,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:I,dragHandle:x.dragHandle,zIndex:O.z,parentId:x.parentId,...P})})})}var wbt=p.memo(xbt);const Obt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function hRe(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:s}=Ki(Obt,Rs),a=gbt(e.onlyRenderVisibleElements),l=ybt();return o.jsx("div",{className:"react-flow__nodes",style:VP,children:a.map(c=>o.jsx(wbt,{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))})}hRe.displayName="NodeRenderer";const kbt=p.memo(hRe);function Sbt(e){return Ki(p.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&&Tmt({sourceNode:s,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[e]),Rs)}const Ebt=({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"})},Cbt=({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"})},PJ={[dE.Arrow]:Ebt,[dE.ArrowClosed]:Cbt};function Tbt(e){const t=Is();return p.useMemo(()=>{var r,s;return Object.prototype.hasOwnProperty.call(PJ,e)?PJ[e]:((s=(r=t.getState()).onError)==null||s.call(r,"009",Ld.error009(e)),null)},[e])}const Abt=({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=Tbt(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},pRe=({defaultColor:e,rfId:t})=>{const n=Ki(s=>s.edges),i=Ki(s=>s.defaultEdgeOptions),r=p.useMemo(()=>Dmt(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(Abt,{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};pRe.displayName="MarkerDefinitions";var _bt=p.memo(pRe);function mRe({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]=p.useState({x:1,y:0,width:0,height:0}),m=Ho(["react-flow__edge-textwrapper",u]),g=p.useRef(null);return p.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:m,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}mRe.displayName="EdgeText";const jbt=p.memo(mRe);function HC({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:Ho(["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&&Cd(t)&&Cd(n)?o.jsx(jbt,{x:t,y:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function DJ({pos:e,x1:t,y1:n,x2:i,y2:r}){return e===pn.Left||e===pn.Right?[.5*(t+i),n]:[t,.5*(n+r)]}function gRe({sourceX:e,sourceY:t,sourcePosition:n=pn.Bottom,targetX:i,targetY:r,targetPosition:s=pn.Top}){const[a,l]=DJ({pos:n,x1:e,y1:t,x2:i,y2:r}),[c,u]=DJ({pos:s,x1:i,y1:r,x2:e,y2:t}),[d,f,h,m]=$Ne({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,m]}function bRe(e){return p.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:m,style:g,markerEnd:b,markerStart:v,interactionWidth:y})=>{const[w,x,O]=gRe({sourceX:n,sourceY:i,sourcePosition:a,targetX:r,targetY:s,targetPosition:l}),S=e.isInternal?void 0:t;return o.jsx(HC,{id:S,path:w,labelX:x,labelY:O,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:y})})}const Nbt=bRe({isInternal:!1}),yRe=bRe({isInternal:!0});Nbt.displayName="SimpleBezierEdge";yRe.displayName="SimpleBezierEdgeInternal";function vRe(e){return p.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:m=pn.Bottom,targetPosition:g=pn.Top,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:w})=>{const[x,O,S]=qN({sourceX:n,sourceY:i,sourcePosition:m,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}),k=e.isInternal?void 0:t;return o.jsx(HC,{id:k,path:x,labelX:O,labelY:S,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:b,markerStart:v,interactionWidth:w})})}const xRe=vRe({isInternal:!1}),wRe=vRe({isInternal:!0});xRe.displayName="SmoothStepEdge";wRe.displayName="SmoothStepEdgeInternal";function ORe(e){return p.memo(({id:t,...n})=>{var r;const i=e.isInternal?void 0:t;return o.jsx(xRe,{...n,id:i,pathOptions:p.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const Rbt=ORe({isInternal:!1}),kRe=ORe({isInternal:!0});Rbt.displayName="StepEdge";kRe.displayName="StepEdgeInternal";function SRe(e){return p.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:m,markerStart:g,interactionWidth:b})=>{const[v,y,w]=UNe({sourceX:n,sourceY:i,targetX:r,targetY:s}),x=e.isInternal?void 0:t;return o.jsx(HC,{id:x,path:v,labelX:y,labelY:w,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:g,interactionWidth:b})})}const Ibt=SRe({isInternal:!1}),ERe=SRe({isInternal:!0});Ibt.displayName="StraightEdge";ERe.displayName="StraightEdgeInternal";function CRe(e){return p.memo(({id:t,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:a=pn.Bottom,targetPosition:l=pn.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:w})=>{const[x,O,S]=FNe({sourceX:n,sourceY:i,sourcePosition:a,targetX:r,targetY:s,targetPosition:l,curvature:y==null?void 0:y.curvature}),k=e.isInternal?void 0:t;return o.jsx(HC,{id:k,path:x,labelX:O,labelY:S,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,markerEnd:b,markerStart:v,interactionWidth:w})})}const Pbt=CRe({isInternal:!1}),TRe=CRe({isInternal:!0});Pbt.displayName="BezierEdge";TRe.displayName="BezierEdgeInternal";const MJ={default:TRe,straight:ERe,step:kRe,smoothstep:wRe,simplebezier:yRe},LJ={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Dbt=(e,t,n)=>n===pn.Left?e-t:n===pn.Right?e+t:e,Mbt=(e,t,n)=>n===pn.Top?e-t:n===pn.Bottom?e+t:e,$J="react-flow__edgeupdater";function FJ({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:Ho([$J,`${$J}-${l}`]),cx:Dbt(t,i,e),cy:Mbt(n,i,e),r:i,stroke:"transparent",fill:"transparent"})}function Lbt({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:m}){const g=Is(),b=(O,S)=>{if(O.button!==0)return;const{autoPanOnConnect:k,domNode:C,connectionMode:E,connectionRadius:R,lib:A,onConnectStart:N,cancelConnection:T,nodeLookup:j,rfId:_,panBy:I,updateConnection:D}=g.getState(),P=S.type==="target",L=(H,K)=>{h(!1),f==null||f(H,n,S.type,K)},B=H=>u==null?void 0:u(n,H),M=(H,K)=>{h(!0),d==null||d(O,n,S.type),N==null||N(H,K)};GF.onPointerDown(O.nativeEvent,{autoPanOnConnect:k,connectionMode:E,connectionRadius:R,domNode:C,handleId:S.id,nodeId:S.nodeId,nodeLookup:j,isTarget:P,edgeUpdaterType:S.type,lib:A,flowId:_,cancelConnection:T,panBy:I,isValidConnection:(...H)=>{var K,F;return((F=(K=g.getState()).isValidConnection)==null?void 0:F.call(K,...H))??!0},onConnect:B,onConnectStart:M,onConnectEnd:(...H)=>{var K,F;return(F=(K=g.getState()).onConnectEnd)==null?void 0:F.call(K,...H)},onReconnectEnd:L,updateConnection:D,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:O.currentTarget})},v=O=>b(O,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=O=>b(O,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),w=()=>m(!0),x=()=>m(!1);return o.jsxs(o.Fragment,{children:[(e===!0||e==="source")&&o.jsx(FJ,{position:l,centerX:i,centerY:r,radius:t,onMouseDown:v,onMouseEnter:w,onMouseOut:x,type:"source"}),(e===!0||e==="target")&&o.jsx(FJ,{position:c,centerX:s,centerY:a,radius:t,onMouseDown:y,onMouseEnter:w,onMouseOut:x,type:"target"})]})}function $bt({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:m,rfId:g,edgeTypes:b,noPanClassName:v,onError:y,disableKeyboardA11y:w}){let x=Ki(Z=>Z.edgeLookup.get(e));const O=Ki(Z=>Z.defaultEdgeOptions);x=O?{...O,...x}:x;let S=x.type||"default",k=(b==null?void 0:b[S])||MJ[S];k===void 0&&(y==null||y("011",Ld.error011(S)),S="default",k=(b==null?void 0:b.default)||MJ.default);const C=!!(x.focusable||t&&typeof x.focusable>"u"),E=typeof f<"u"&&(x.reconnectable||n&&typeof x.reconnectable>"u"),R=!!(x.selectable||i&&typeof x.selectable>"u"),A=p.useRef(null),[N,T]=p.useState(!1),[j,_]=p.useState(!1),I=Is(),{zIndex:D,sourceX:P,sourceY:L,targetX:B,targetY:M,sourcePosition:H,targetPosition:K}=Ki(p.useCallback(Z=>{const G=Z.nodeLookup.get(x.source),te=Z.nodeLookup.get(x.target);if(!G||!te)return{zIndex:x.zIndex,...LJ};const de=Pmt({id:e,sourceNode:G,targetNode:te,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:Z.connectionMode,onError:y});return{zIndex:Cmt({selected:x.selected,zIndex:x.zIndex,sourceNode:G,targetNode:te,elevateOnSelect:Z.elevateEdgesOnSelect,zIndexMode:Z.zIndexMode}),...de||LJ}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),Rs),F=p.useMemo(()=>x.markerStart?`url('#${WF(x.markerStart,g)}')`:void 0,[x.markerStart,g]),q=p.useMemo(()=>x.markerEnd?`url('#${WF(x.markerEnd,g)}')`:void 0,[x.markerEnd,g]);if(x.hidden||P===null||L===null||B===null||M===null)return null;const Q=Z=>{var Ce;const{addSelectedEdges:G,unselectNodesAndEdges:te,multiSelectionActive:de}=I.getState();R&&(I.setState({nodesSelectionActive:!1}),x.selected&&de?(te({nodes:[],edges:[x]}),(Ce=A.current)==null||Ce.blur()):G([e])),r&&r(Z,x)},X=s?Z=>{s(Z,{...x})}:void 0,ne=a?Z=>{a(Z,{...x})}:void 0,z=l?Z=>{l(Z,{...x})}:void 0,Y=c?Z=>{c(Z,{...x})}:void 0,ae=u?Z=>{u(Z,{...x})}:void 0,Ee=Z=>{var G;if(!w&&ENe.includes(Z.key)&&R){const{unselectNodesAndEdges:te,addSelectedEdges:de}=I.getState();Z.key==="Escape"?((G=A.current)==null||G.blur(),te({edges:[x]})):de([e])}};return o.jsx("svg",{style:{zIndex:D},children:o.jsxs("g",{className:Ho(["react-flow__edge",`react-flow__edge-${S}`,x.className,v,{selected:x.selected,animated:x.animated,inactive:!R&&!r,updating:N,selectable:R}]),onClick:Q,onDoubleClick:X,onContextMenu:ne,onMouseEnter:z,onMouseMove:Y,onMouseLeave:ae,onKeyDown:C?Ee:void 0,tabIndex:C?0:void 0,role:x.ariaRole??(C?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":C?`${nRe}-${g}`:void 0,ref:A,...x.domAttributes,children:[!j&&o.jsx(k,{id:e,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:R,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:P,sourceY:L,targetX:B,targetY:M,sourcePosition:H,targetPosition:K,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:F,markerEnd:q,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),E&&o.jsx(Lbt,{edge:x,isReconnectable:E,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,sourceX:P,sourceY:L,targetX:B,targetY:M,sourcePosition:H,targetPosition:K,setUpdateHover:T,setReconnecting:_})]})})}var Fbt=p.memo($bt);const Bbt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function ARe({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:m,onReconnectEnd:g,disableKeyboardA11y:b}){const{edgesFocusable:v,edgesReconnectable:y,elementsSelectable:w,onError:x}=Ki(Bbt,Rs),O=Sbt(t);return o.jsxs("div",{className:"react-flow__edges",children:[o.jsx(_bt,{defaultColor:e,rfId:n}),O.map(S=>o.jsx(Fbt,{id:S,edgesFocusable:v,edgesReconnectable:y,elementsSelectable:w,noPanClassName:r,onReconnect:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:m,onReconnectEnd:g,rfId:n,onError:x,edgeTypes:i,disableKeyboardA11y:b},S))]})}ARe.displayName="EdgeRenderer";const Ubt=p.memo(ARe),Qbt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function zbt({children:e}){const t=Ki(Qbt);return o.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function Vbt(e){const t=zP(),n=p.useRef(!1);p.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Hbt=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function qbt(e){const t=Ki(Hbt),n=Is();return p.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Wbt(e){return e.connection.inProgress?{...e.connection,to:Zw(e.connection.to,e.transform)}:{...e.connection}}function Kbt(e){return Wbt}function Gbt(e){const t=Kbt();return Ki(t,Rs)}const Xbt=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Ybt({containerStyle:e,style:t,type:n,component:i}){const{nodesConnectable:r,width:s,height:a,isValid:l,inProgress:c}=Ki(Xbt,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:Ho(["react-flow__connection",ANe(l)]),children:o.jsx(_Re,{style:t,type:n,CustomComponent:i,isValid:l})})})}const _Re=({style:e,type:t=ym.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:m}=Gbt();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:ANe(i),toNode:d,toHandle:f,pointer:m});let g="";const b={sourceX:s.x,sourceY:s.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case ym.Bezier:[g]=FNe(b);break;case ym.SimpleBezier:[g]=gRe(b);break;case ym.Step:[g]=qN({...b,borderRadius:0});break;case ym.SmoothStep:[g]=qN(b);break;default:[g]=UNe(b)}return o.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};_Re.displayName="ConnectionLine";const Zbt={};function BJ(e=Zbt){p.useRef(e),Is(),p.useEffect(()=>{},[e])}function Jbt(){Is(),p.useRef(!1),p.useEffect(()=>{},[])}function jRe({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:m,connectionLineType:g,connectionLineStyle:b,connectionLineComponent:v,connectionLineContainerStyle:y,selectionKeyCode:w,selectionOnDrag:x,selectionMode:O,multiSelectionKeyCode:S,panActivationKeyCode:k,zoomActivationKeyCode:C,deleteKeyCode:E,onlyRenderVisibleElements:R,elementsSelectable:A,defaultViewport:N,translateExtent:T,minZoom:j,maxZoom:_,preventScrolling:I,defaultMarkerColor:D,zoomOnScroll:P,zoomOnPinch:L,panOnScroll:B,panOnScrollSpeed:M,panOnScrollMode:H,zoomOnDoubleClick:K,panOnDrag:F,autoPanOnSelection:q,onPaneClick:Q,onPaneMouseEnter:X,onPaneMouseMove:ne,onPaneMouseLeave:z,onPaneScroll:Y,onPaneContextMenu:ae,paneClickDistance:Ee,nodeClickDistance:Z,onEdgeContextMenu:G,onEdgeMouseEnter:te,onEdgeMouseMove:de,onEdgeMouseLeave:Ce,reconnectRadius:le,onReconnect:fe,onReconnectStart:ce,onReconnectEnd:Te,noDragClassName:Me,noWheelClassName:we,noPanClassName:Ue,disableKeyboardA11y:ke,nodeExtent:je,rfId:re,viewport:ve,onViewportChange:be}){return BJ(e),BJ(t),Jbt(),Vbt(n),qbt(ve),o.jsx(pbt,{onPaneClick:Q,onPaneMouseEnter:X,onPaneMouseMove:ne,onPaneMouseLeave:z,onPaneContextMenu:ae,onPaneScroll:Y,paneClickDistance:Ee,deleteKeyCode:E,selectionKeyCode:w,selectionOnDrag:x,selectionMode:O,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:S,panActivationKeyCode:k,zoomActivationKeyCode:C,elementsSelectable:A,zoomOnScroll:P,zoomOnPinch:L,zoomOnDoubleClick:K,panOnScroll:B,panOnScrollSpeed:M,panOnScrollMode:H,panOnDrag:F,autoPanOnSelection:q,defaultViewport:N,translateExtent:T,minZoom:j,maxZoom:_,onSelectionContextMenu:f,preventScrolling:I,noDragClassName:Me,noWheelClassName:we,noPanClassName:Ue,disableKeyboardA11y:ke,onViewportChange:be,isControlledViewport:!!ve,children:o.jsxs(zbt,{children:[o.jsx(Ubt,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:a,onReconnect:fe,onReconnectStart:ce,onReconnectEnd:Te,onlyRenderVisibleElements:R,onEdgeContextMenu:G,onEdgeMouseEnter:te,onEdgeMouseMove:de,onEdgeMouseLeave:Ce,reconnectRadius:le,defaultMarkerColor:D,noPanClassName:Ue,disableKeyboardA11y:ke,rfId:re}),o.jsx(Ybt,{style:b,type:g,component:v,containerStyle:y}),o.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsx(kbt,{nodeTypes:e,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:Z,onlyRenderVisibleElements:R,noPanClassName:Ue,noDragClassName:Me,disableKeyboardA11y:ke,nodeExtent:je,rfId:re}),o.jsx("div",{className:"react-flow__viewport-portal"})]})})}jRe.displayName="GraphView";const eyt=p.memo(jRe),tyt=INe(),UJ=({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 m=new Map,g=new Map,b=new Map,v=new Map,y=i??t??[],w=n??e??[],x=d??[0,0],O=f??cE;VNe(b,v,y);const{nodesInitialized:S}=KF(w,m,g,{nodeOrigin:x,nodeExtent:O,zIndexMode:h});let k=[0,0,1];if(a&&r&&s){const C=zC(m,{filter:N=>!!((N.width||N.initialWidth)&&(N.height||N.initialHeight))}),{x:E,y:R,zoom:A}=mz(C,r,s,c,u,(l==null?void 0:l.padding)??.1);k=[E,R,A]}return{rfId:"1",width:r??0,height:s??0,transform:k,nodes:w,nodesInitialized:S,nodeLookup:m,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:cE,nodeExtent:O,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:rw.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:l,fitViewResolver:null,connection:{...TNe},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:tyt,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:CNe,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},nyt=({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})=>bgt((m,g)=>{async function b(){const{nodeLookup:v,panZoom:y,fitViewOptions:w,fitViewResolver:x,width:O,height:S,minZoom:k,maxZoom:C}=g();y&&(await vmt({nodes:v,width:O,height:S,panZoom:y,minZoom:k,maxZoom:C},w),x==null||x.resolve(!0),m({fitViewResolver:null}))}return{...UJ({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:w,nodeOrigin:x,elevateNodesOnSelect:O,fitViewQueued:S,zIndexMode:k,nodesSelectionActive:C}=g(),{nodesInitialized:E,hasSelectedNodes:R}=KF(v,y,w,{nodeOrigin:x,nodeExtent:f,elevateNodesOnSelect:O,checkEquality:!0,zIndexMode:k}),A=C&&R;S&&E?(b(),m({nodes:v,nodesInitialized:E,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:A})):m({nodes:v,nodesInitialized:E,nodesSelectionActive:A})},setEdges:v=>{const{connectionLookup:y,edgeLookup:w}=g();VNe(y,w,v),m({edges:v})},setDefaultNodesAndEdges:(v,y)=>{if(v){const{setNodes:w}=g();w(v),m({hasDefaultNodes:!0})}if(y){const{setEdges:w}=g();w(y),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:y,nodeLookup:w,parentLookup:x,domNode:O,nodeOrigin:S,nodeExtent:k,debug:C,fitViewQueued:E,zIndexMode:R}=g(),{changes:A,updatedInternals:N}=Qmt(v,w,x,O,S,k,R);N&&($mt(w,x,{nodeOrigin:S,nodeExtent:k,zIndexMode:R}),E?(b(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(A==null?void 0:A.length)>0&&(C&&console.log("React Flow: trigger node changes",A),y==null||y(A)))},updateNodePositions:(v,y=!1)=>{const w=[];let x=[];const{nodeLookup:O,triggerNodeChanges:S,connection:k,updateConnection:C,onNodesChangeMiddlewareMap:E}=g();for(const[R,A]of v){const N=O.get(R),T=!!(N!=null&&N.expandParent&&(N!=null&&N.parentId)&&(A!=null&&A.position)),j={id:R,type:"position",position:T?{x:Math.max(0,A.position.x),y:Math.max(0,A.position.y)}:A.position,dragging:y};if(N&&k.inProgress&&k.fromNode.id===N.id){const _=Ty(N,k.fromHandle,pn.Left,!0);C({...k,from:_})}T&&N.parentId&&w.push({id:R,parentId:N.parentId,rect:{...A.internals.positionAbsolute,width:A.measured.width??0,height:A.measured.height??0}}),x.push(j)}if(w.length>0){const{parentLookup:R,nodeOrigin:A}=g(),N=Oz(w,O,R,A);x.push(...N)}for(const R of E.values())x=R(x);S(x)},triggerNodeChanges:v=>{const{onNodesChange:y,setNodes:w,nodes:x,hasDefaultNodes:O,debug:S}=g();if(v!=null&&v.length){if(O){const k=sRe(v,x);w(k)}S&&console.log("React Flow: trigger node changes",v),y==null||y(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:y,setEdges:w,edges:x,hasDefaultEdges:O,debug:S}=g();if(v!=null&&v.length){if(O){const k=oRe(v,x);w(k)}S&&console.log("React Flow: trigger edge changes",v),y==null||y(v)}},addSelectedNodes:v=>{const{multiSelectionActive:y,edgeLookup:w,nodeLookup:x,triggerNodeChanges:O,triggerEdgeChanges:S}=g();if(y){const k=v.map(C=>kb(C,!0));O(k);return}O($v(x,new Set([...v]),!0)),S($v(w))},addSelectedEdges:v=>{const{multiSelectionActive:y,edgeLookup:w,nodeLookup:x,triggerNodeChanges:O,triggerEdgeChanges:S}=g();if(y){const k=v.map(C=>kb(C,!0));S(k);return}S($v(w,new Set([...v]))),O($v(x,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:y}={})=>{const{edges:w,nodes:x,nodeLookup:O,triggerNodeChanges:S,triggerEdgeChanges:k}=g(),C=v||x,E=y||w,R=[];for(const N of C){if(!N.selected)continue;const T=O.get(N.id);T&&(T.selected=!1),R.push(kb(N.id,!1))}const A=[];for(const N of E)N.selected&&A.push(kb(N.id,!1));S(R),k(A)},setMinZoom:v=>{const{panZoom:y,maxZoom:w}=g();y==null||y.setScaleExtent([v,w]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:y,minZoom:w}=g();y==null||y.setScaleExtent([w,v]),m({maxZoom:v})},setTranslateExtent:v=>{var y;(y=g().panZoom)==null||y.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:y,triggerNodeChanges:w,triggerEdgeChanges:x,elementsSelectable:O}=g();if(!O)return;const S=y.reduce((C,E)=>E.selected?[...C,kb(E.id,!1)]:C,[]),k=v.reduce((C,E)=>E.selected?[...C,kb(E.id,!1)]:C,[]);w(S),x(k)},setNodeExtent:v=>{const{nodes:y,nodeLookup:w,parentLookup:x,nodeOrigin:O,elevateNodesOnSelect:S,nodeExtent:k,zIndexMode:C}=g();v[0][0]===k[0][0]&&v[0][1]===k[0][1]&&v[1][0]===k[1][0]&&v[1][1]===k[1][1]||(KF(y,w,x,{nodeOrigin:O,nodeExtent:v,elevateNodesOnSelect:S,checkEquality:!1,zIndexMode:C}),m({nodeExtent:v}))},panBy:v=>{const{transform:y,width:w,height:x,panZoom:O,translateExtent:S}=g();return zmt({delta:v,panZoom:O,transform:y,translateExtent:S,width:w,height:x})},setCenter:async(v,y,w)=>{const{width:x,height:O,maxZoom:S,panZoom:k}=g();if(!k)return!1;const C=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:S;return await k.setViewport({x:x/2-v*C,y:O/2-y*C,zoom:C},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),!0},cancelConnection:()=>{m({connection:{...TNe}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...UJ()})}},Object.is);function NRe({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:m}){const[g]=p.useState(()=>nyt({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(ygt,{value:g,children:o.jsx(zgt,{children:m})})}function iyt({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:m}){return p.useContext(UP)?o.jsx(o.Fragment,{children:e}):o.jsx(NRe,{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:m,children:e})}const ryt={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function syt({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:m,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:O,onNodeContextMenu:S,onNodeDoubleClick:k,onNodeDragStart:C,onNodeDrag:E,onNodeDragStop:R,onNodesDelete:A,onEdgesDelete:N,onDelete:T,onSelectionChange:j,onSelectionDragStart:_,onSelectionDrag:I,onSelectionDragStop:D,onSelectionContextMenu:P,onSelectionStart:L,onSelectionEnd:B,onBeforeDelete:M,connectionMode:H,connectionLineType:K=ym.Bezier,connectionLineStyle:F,connectionLineComponent:q,connectionLineContainerStyle:Q,deleteKeyCode:X="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:z=!1,selectionMode:Y=uE.Full,panActivationKeyCode:ae="Space",multiSelectionKeyCode:Ee=hE()?"Meta":"Control",zoomActivationKeyCode:Z=hE()?"Meta":"Control",snapToGrid:G,snapGrid:te,onlyRenderVisibleElements:de=!1,selectNodesOnDrag:Ce,nodesDraggable:le,autoPanOnNodeFocus:fe,nodesConnectable:ce,nodesFocusable:Te,nodeOrigin:Me=iRe,edgesFocusable:we,edgesReconnectable:Ue,elementsSelectable:ke=!0,defaultViewport:je=Ngt,minZoom:re=.5,maxZoom:ve=2,translateExtent:be=cE,preventScrolling:xe=!0,nodeExtent:Ke,defaultMarkerColor:Ze="#b1b1b7",zoomOnScroll:he=!0,zoomOnPinch:ye=!0,panOnScroll:Ae=!1,panOnScrollSpeed:He=.5,panOnScrollMode:De=ry.Free,zoomOnDoubleClick:At=!0,panOnDrag:Nt=!0,onPaneClick:Ot,onPaneMouseEnter:vt,onPaneMouseMove:Tt,onPaneMouseLeave:ft,onPaneScroll:pt,onPaneContextMenu:Pe,paneClickDistance:yt=1,nodeClickDistance:jt=0,children:qt,onReconnect:ln,onReconnectStart:qe,onReconnectEnd:Ie,onEdgeContextMenu:We,onEdgeDoubleClick:gt,onEdgeMouseEnter:it,onEdgeMouseMove:kt,onEdgeMouseLeave:ct,reconnectRadius:Kt=10,onNodesChange:dn,onEdgesChange:Xt,noDragClassName:Ge="nodrag",noWheelClassName:mt="nowheel",noPanClassName:xt="nopan",fitView:hn,fitViewOptions:Vt,connectOnClick:Qe,attributionPosition:rt,proOptions:En,defaultEdgeOptions:et,elevateNodesOnSelect:bt=!0,elevateEdgesOnSelect:zn=!1,disableKeyboardA11y:$t=!1,autoPanOnConnect:Ni,autoPanOnNodeDrag:Fn,autoPanOnSelection:Yn=!0,autoPanSpeed:vn,connectionRadius:si,isValidConnection:Bn,onError:ni,style:Ui,id:Ri,nodeDragThreshold:Qi,connectionDragThreshold:Ve,viewport:St,onViewportChange:Jt,width:Vn,height:xr,colorMode:Ks="light",debug:is,onScroll:Ur,ariaLabelConfig:Hn,zIndexMode:di="basic",...Cr},Qr){const so=Ri||"1",Za=Dgt(Ks),rs=p.useCallback(oe=>{oe.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ur==null||Ur(oe)},[Ur]);return o.jsx("div",{"data-testid":"rf__wrapper",...Cr,onScroll:rs,style:{...Ui,...ryt},ref:Qr,className:Ho(["react-flow",r,Za]),id:Ri,role:"application",children:o.jsxs(iyt,{nodes:e,edges:t,width:Vn,height:xr,fitView:hn,fitViewOptions:Vt,minZoom:re,maxZoom:ve,nodeOrigin:Me,nodeExtent:Ke,zIndexMode:di,children:[o.jsx(Pgt,{nodes:e,edges:t,defaultNodes:n,defaultEdges:i,onConnect:m,onConnectStart:g,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,nodesDraggable:le,autoPanOnNodeFocus:fe,nodesConnectable:ce,nodesFocusable:Te,edgesFocusable:we,edgesReconnectable:Ue,elementsSelectable:ke,elevateNodesOnSelect:bt,elevateEdgesOnSelect:zn,minZoom:re,maxZoom:ve,nodeExtent:Ke,onNodesChange:dn,onEdgesChange:Xt,snapToGrid:G,snapGrid:te,connectionMode:H,translateExtent:be,connectOnClick:Qe,defaultEdgeOptions:et,fitView:hn,fitViewOptions:Vt,onNodesDelete:A,onEdgesDelete:N,onDelete:T,onNodeDragStart:C,onNodeDrag:E,onNodeDragStop:R,onSelectionDrag:I,onSelectionDragStart:_,onSelectionDragStop:D,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:xt,nodeOrigin:Me,rfId:so,autoPanOnConnect:Ni,autoPanOnNodeDrag:Fn,autoPanSpeed:vn,onError:ni,connectionRadius:si,isValidConnection:Bn,selectNodesOnDrag:Ce,nodeDragThreshold:Qi,connectionDragThreshold:Ve,onBeforeDelete:M,debug:is,ariaLabelConfig:Hn,zIndexMode:di}),o.jsx(eyt,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:O,onNodeContextMenu:S,onNodeDoubleClick:k,nodeTypes:s,edgeTypes:a,connectionLineType:K,connectionLineStyle:F,connectionLineComponent:q,connectionLineContainerStyle:Q,selectionKeyCode:ne,selectionOnDrag:z,selectionMode:Y,deleteKeyCode:X,multiSelectionKeyCode:Ee,panActivationKeyCode:ae,zoomActivationKeyCode:Z,onlyRenderVisibleElements:de,defaultViewport:je,translateExtent:be,minZoom:re,maxZoom:ve,preventScrolling:xe,zoomOnScroll:he,zoomOnPinch:ye,zoomOnDoubleClick:At,panOnScroll:Ae,panOnScrollSpeed:He,panOnScrollMode:De,panOnDrag:Nt,autoPanOnSelection:Yn,onPaneClick:Ot,onPaneMouseEnter:vt,onPaneMouseMove:Tt,onPaneMouseLeave:ft,onPaneScroll:pt,onPaneContextMenu:Pe,paneClickDistance:yt,nodeClickDistance:jt,onSelectionContextMenu:P,onSelectionStart:L,onSelectionEnd:B,onReconnect:ln,onReconnectStart:qe,onReconnectEnd:Ie,onEdgeContextMenu:We,onEdgeDoubleClick:gt,onEdgeMouseEnter:it,onEdgeMouseMove:kt,onEdgeMouseLeave:ct,reconnectRadius:Kt,defaultMarkerColor:Ze,noDragClassName:Ge,noWheelClassName:mt,noPanClassName:xt,rfId:so,disableKeyboardA11y:$t,nodeExtent:Ke,viewport:St,onViewportChange:Jt}),o.jsx(jgt,{onSelectionChange:j}),qt,o.jsx(Egt,{proOptions:En,position:rt}),o.jsx(Sgt,{rfId:so,disableKeyboardA11y:$t})]})})}var oyt=aRe(syt);const ayt=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function lyt({children:e}){const t=Ki(ayt);return t?ri.createPortal(e,t):null}function cyt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>sRe(r,s)),[]);return[t,n,i]}function uyt(e){const[t,n]=p.useState(e),i=p.useCallback(r=>n(s=>oRe(r,s)),[]);return[t,n,i]}const dyt=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||!gz(n.userNode))return!1;return!0};function fyt(e={includeHiddenNodes:!1}){return Ki(dyt(e))}function hyt({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:Ho(["react-flow__background-pattern",n,i])})}function pyt({radius:e,className:t}){return o.jsx("circle",{cx:e,cy:e,r:e,className:Ho(["react-flow__background-pattern","dots",t])})}var qm;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(qm||(qm={}));const myt={[qm.Dots]:1,[qm.Lines]:1,[qm.Cross]:6},gyt=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function RRe({id:e,variant:t=qm.Dots,gap:n=20,size:i,lineWidth:r=1,offset:s=0,color:a,bgColor:l,style:c,className:u,patternClassName:d}){const f=p.useRef(null),{transform:h,patternId:m}=Ki(gyt,Rs),g=i||myt[t],b=t===qm.Dots,v=t===qm.Cross,y=Array.isArray(n)?n:[n,n],w=[y[0]*h[2]||1,y[1]*h[2]||1],x=g*h[2],O=Array.isArray(s)?s:[s,s],S=v?[x,x]:w,k=[O[0]*h[2]||1+S[0]/2,O[1]*h[2]||1+S[1]/2],C=`${m}${e||""}`;return o.jsxs("svg",{className:Ho(["react-flow__background",u]),style:{...c,...VP,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[o.jsx("pattern",{id:C,x:h[0]%w[0],y:h[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`,children:b?o.jsx(pyt,{radius:x/2,className:d}):o.jsx(hyt,{dimensions:S,lineWidth:r,variant:t,className:d})}),o.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}RRe.displayName="Background";const byt=p.memo(RRe);function yyt(){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 vyt(){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 xyt(){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 wyt(){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 Oyt(){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 JA({children:e,className:t,...n}){return o.jsx("button",{type:"button",className:Ho(["react-flow__controls-button",t]),...n,children:e})}const kyt=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function IRe({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":m}){const g=Is(),{isInteractive:b,minZoomReached:v,maxZoomReached:y,ariaLabelConfig:w}=Ki(kyt,Rs),{zoomIn:x,zoomOut:O,fitView:S}=zP(),k=()=>{x(),s==null||s()},C=()=>{O(),a==null||a()},E=()=>{S(r),l==null||l()},R=()=>{g.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),c==null||c(!b)},A=h==="horizontal"?"horizontal":"vertical";return o.jsxs(QP,{className:Ho(["react-flow__controls",A,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(JA,{onClick:k,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:y,children:o.jsx(yyt,{})}),o.jsx(JA,{onClick:C,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:o.jsx(vyt,{})})]}),n&&o.jsx(JA,{className:"react-flow__controls-fitview",onClick:E,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:o.jsx(xyt,{})}),i&&o.jsx(JA,{className:"react-flow__controls-interactive",onClick:R,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:b?o.jsx(Oyt,{}):o.jsx(wyt,{})}),d]})}IRe.displayName="Controls";const Syt=p.memo(IRe);function Eyt({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:m}){const{background:g,backgroundColor:b}=s||{},v=a||g||b;return o.jsx("rect",{className:Ho(["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:m?y=>m(y,e):void 0})}const Cyt=p.memo(Eyt),Tyt=e=>e.nodes.map(t=>t.id),_L=e=>e instanceof Function?e:()=>e;function Ayt({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:s=Cyt,onClick:a}){const l=Ki(Tyt,Rs),c=_L(t),u=_L(e),d=_L(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsx(o.Fragment,{children:l.map(h=>o.jsx(jyt,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:s,onClick:a,shapeRendering:f},h))})}function _yt({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:m}=Ki(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:w}=b.internals.positionAbsolute,{width:x,height:O}=Ap(v);return{node:v,x:y,y:w,width:x,height:O}},Rs);return!u||u.hidden||!gz(u)?null:o.jsx(l,{x:d,y:f,width:h,height:m,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 jyt=p.memo(_yt);var Nyt=p.memo(Ayt);const Ryt=200,Iyt=150,Pyt=e=>!e.hidden,Dyt=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?RNe(zC(e.nodeLookup,{filter:Pyt}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Myt="react-flow__minimap-desc";function PRe({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:m,onNodeClick:g,pannable:b=!1,zoomable:v=!1,ariaLabel:y,inversePan:w,zoomStep:x=1,offsetScale:O=5}){const S=Is(),k=p.useRef(null),{boundingRect:C,viewBB:E,rfId:R,panZoom:A,translateExtent:N,flowWidth:T,flowHeight:j,ariaLabelConfig:_}=Ki(Dyt,Rs),I=(e==null?void 0:e.width)??Ryt,D=(e==null?void 0:e.height)??Iyt,P=C.width/I,L=C.height/D,B=Math.max(P,L),M=B*I,H=B*D,K=O*B,F=C.x-(M-C.width)/2-K,q=C.y-(H-C.height)/2-K,Q=M+K*2,X=H+K*2,ne=`${Myt}-${R}`,z=p.useRef(0),Y=p.useRef();z.current=B,p.useEffect(()=>{if(k.current&&A)return Y.current=Zmt({domNode:k.current,panZoom:A,getTransform:()=>S.getState().transform,getViewScale:()=>z.current}),()=>{var G;(G=Y.current)==null||G.destroy()}},[A]),p.useEffect(()=>{var G;(G=Y.current)==null||G.update({translateExtent:N,width:T,height:j,inversePan:w,pannable:b,zoomStep:x,zoomable:v})},[b,v,w,x,N,T,j]);const ae=m?G=>{var Ce;const[te,de]=((Ce=Y.current)==null?void 0:Ce.pointer(G))||[0,0];m(G,{x:te,y:de})}:void 0,Ee=g?p.useCallback((G,te)=>{const de=S.getState().nodeLookup.get(te).internals.userNode;g(G,de)},[]):void 0,Z=y??_["minimap.ariaLabel"];return o.jsx(QP,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*B:void 0,"--xy-minimap-node-background-color-props":typeof 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:Ho(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxs("svg",{width:I,height:D,viewBox:`${F} ${q} ${Q} ${X}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:k,onClick:ae,children:[Z&&o.jsx("title",{id:ne,children:Z}),o.jsx(Nyt,{onClick:Ee,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:r,nodeStrokeWidth:a,nodeComponent:l}),o.jsx("path",{className:"react-flow__minimap-mask",d:`M${F-K},${q-K}h${Q+K*2}v${X+K*2}h${-Q-K*2}z + M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}PRe.displayName="MiniMap";p.memo(PRe);const Lyt=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,$yt={[lw.Line]:"right",[lw.Handle]:"bottom-right"};function Fyt({nodeId:e,position:t,variant:n=lw.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:m=!0,shouldResize:g,onResizeStart:b,onResize:v,onResizeEnd:y}){const w=dRe(),x=typeof e=="string"?e:w,O=Is(),S=p.useRef(null),k=n===lw.Handle,C=Ki(p.useCallback(Lyt(k&&m),[k,m]),Rs),E=p.useRef(null),R=t??$yt[n];p.useEffect(()=>{if(!(!S.current||!x))return E.current||(E.current=dgt({domNode:S.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:N,transform:T,snapGrid:j,snapToGrid:_,nodeOrigin:I,domNode:D}=O.getState();return{nodeLookup:N,transform:T,snapGrid:j,snapToGrid:_,nodeOrigin:I,paneDomNode:D}},onChange:(N,T)=>{const{triggerNodeChanges:j,nodeLookup:_,parentLookup:I,nodeOrigin:D}=O.getState(),P=[],L={x:N.x,y:N.y},B=_.get(x);if(B&&B.expandParent&&B.parentId){const M=B.origin??D,H=N.width??B.measured.width??0,K=N.height??B.measured.height??0,F={id:B.id,parentId:B.parentId,rect:{width:H,height:K,...PNe({x:N.x??B.position.x,y:N.y??B.position.y},{width:H,height:K},B.parentId,_,M)}},q=Oz([F],_,I,D);P.push(...q),L.x=N.x?Math.max(M[0]*H,N.x):void 0,L.y=N.y?Math.max(M[1]*K,N.y):void 0}if(L.x!==void 0&&L.y!==void 0){const M={id:x,type:"position",position:{...L}};P.push(M)}if(N.width!==void 0&&N.height!==void 0){const H={id:x,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:N.width,height:N.height}};P.push(H)}for(const M of T){const H={...M,type:"position"};P.push(H)}j(P)},onEnd:({width:N,height:T})=>{const j={id:x,type:"dimensions",resizing:!1,dimensions:{width:N,height:T}};O.getState().triggerNodeChanges([j])}})),E.current.update({controlPosition:R,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:b,onResize:v,onResizeEnd:y,shouldResize:g}),()=>{var N;(N=E.current)==null||N.destroy()}},[R,l,c,u,d,f,b,v,y,g]);const A=R.split("-");return o.jsx("div",{className:Ho(["react-flow__resize-control","nodrag",...A,n,i]),ref:S,style:{...r,scale:C,...a&&{[k?"backgroundColor":"borderColor"]:a}},children:s})}p.memo(Fyt);var DRe=Object.defineProperty,Byt=(e,t,n)=>t in e?DRe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Uyt=(e,t)=>{for(var n in t)DRe(e,n,{get:t[n],enumerable:!0})},Qyt=(e,t,n)=>Byt(e,t+"",n),MRe={};Uyt(MRe,{Graph:()=>td,alg:()=>Sz,json:()=>$Re,version:()=>Hyt});var zyt=Object.defineProperty,LRe=(e,t)=>{for(var n in t)zyt(e,n,{get:t[n],enumerable:!0})},td=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=ik(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=Vyt(this._isDirected,s,a,l);return s=f.v,a=f.w,Object.freeze(f),this._edgeObjs[d]=f,QJ(this._preds[a],s),QJ(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?jL(this._isDirected,t):ik(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?jL(this._isDirected,t):ik(this._isDirected,t,n,i))in this._edgeLabels}removeEdge(t,n,i){let r=arguments.length===1?jL(this._isDirected,t):ik(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],zJ(this._preds[l],a),zJ(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 QJ(e,t){e[t]?e[t]++:e[t]=1}function zJ(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function ik(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 Vyt(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 jL(e,t){return ik(e,t.v,t.w,t.name)}var Hyt="4.0.1",$Re={};LRe($Re,{read:()=>Gyt,write:()=>qyt});function qyt(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Wyt(e),edges:Kyt(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function Wyt(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 Kyt(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 Gyt(e){let t=new td(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 Sz={};LRe(Sz,{CycleException:()=>GN,bellmanFord:()=>FRe,components:()=>Zyt,dijkstra:()=>KN,dijkstraAll:()=>t0t,findCycles:()=>n0t,floydWarshall:()=>r0t,isAcyclic:()=>o0t,postorder:()=>l0t,preorder:()=>c0t,prim:()=>u0t,shortestPaths:()=>d0t,tarjan:()=>URe,topsort:()=>QRe});var Xyt=()=>1;function FRe(e,t,n,i){return Yyt(e,String(t),n||Xyt,i||function(r){return e.outEdges(r)})}function Yyt(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 KN(e,t,n,i){let r=function(s){return e.outEdges(s)};return e0t(e,String(t),n||Jyt,i||r)}function e0t(e,t,n,i){let r={},s=new BRe,a,l,c=function(u){let d=u.v!==a?u.v:u.w,f=r[d],h=n(u),m=l.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);m0&&(a=s.removeMin(),l=r[a],l.distance!==Number.POSITIVE_INFINITY);)i(a).forEach(c);return r}function t0t(e,t,n){return e.nodes().reduce(function(i,r){return i[r]=KN(e,r,t,n),i},{})}function URe(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 n0t(e){return URe(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var i0t=()=>1;function r0t(e,t,n){return s0t(e,t||i0t,n||function(i){return e.outEdges(i)})}function s0t(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],m=d.distance+f.distance;m{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=zRe(e,l,n==="post",a,s,i,r)}),r}function zRe(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=zRe(e,l,n,i,r,s,a)}),n&&(a=s(a,t))),a}function VRe(e,t,n){return a0t(e,t,n,function(i,r){return i.push(r),i},[])}function l0t(e,t){return VRe(e,t,"post")}function c0t(e,t){return VRe(e,t,"pre")}function u0t(e,t){let n=new td,i={},r=new BRe,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 d0t(e,t,n,i){return f0t(e,t,n,i??(r=>{let s=e.outEdges(r);return s??[]}))}function f0t(e,t,n,i){if(n===void 0)return KN(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 HRe(e){let t=new td({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 VJ(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 qC(e){let t=mE(WRe(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 p0t(e){let t=e.nodes().map(i=>{let r=e.node(i).rank;return r===void 0?Number.MAX_VALUE:r}),n=Ef(Math.min,t);e.nodes().forEach(i=>{let r=e.node(i);Object.hasOwn(r,"rank")&&(r.rank-=n)})}function m0t(e){let t=e.nodes().map(a=>e.node(a).rank).filter(a=>a!==void 0),n=Ef(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 HJ(e,t,n,i){let r={width:0,height:0};return arguments.length>=4&&(r.rank=n,r.order=i),Jw(e,"border",r,t)}function g0t(e,t=qRe){let n=[];for(let i=0;iqRe){let n=g0t(t);return e(...n.map(i=>e(...i)))}else return e(...t)}function WRe(e){let t=e.nodes().map(n=>{let i=e.node(n).rank;return i===void 0?Number.MIN_VALUE:i});return Ef(Math.max,t)}function b0t(e,t){let n={lhs:[],rhs:[]};return e.forEach(i=>{t(i)?n.lhs.push(i):n.rhs.push(i)}),n}function KRe(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function GRe(e,t){return t()}var y0t=0;function Ez(e){let t=++y0t;return e+(""+t)}function mE(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 v0t(e,t){return e.reduce((n,i,r)=>(n[i]=t[r],n),{})}var qP="\0",x0t="3.0.0",w0t=class{constructor(){Qyt(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return qJ(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&qJ(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,O0t)),n=n._prev;return"["+e.join(", ")+"]"}};function qJ(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function O0t(e,t){if(e!=="_next"&&e!=="_prev")return t}var k0t=w0t,S0t=()=>1;function E0t(e,t){if(e.nodeCount()<=1)return[];let n=T0t(e,t||S0t);return C0t(n.graph,n.buckets,n.zeroIdx).flatMap(i=>e.outEdges(i.v,i.w)||[])}function C0t(e,t,n){var i;let r=[],s=t[t.length-1],a=t[0],l;for(;e.nodeCount();){for(;l=a.dequeue();)NL(e,t,n,l);for(;l=s.dequeue();)NL(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(NL(e,t,n,l,!0)||[]);break}}}return r}function NL(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,YF(t,n,u)}),(e.outEdges(i.v)||[]).forEach(l=>{let c=e.edge(l),u=l.w,d=e.node(u);d.in-=c,YF(t,n,d)}),e.removeNode(i.v),a}function T0t(e,t){let n=new td,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=A0t(r+i+3).map(()=>new k0t),a=i+1;return n.nodes().forEach(l=>{YF(s,a,n.node(l))}),{graph:n,buckets:s,zeroIdx:a}}function YF(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 A0t(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,Ez("rev"))});function t(n){return i=>n.edge(i).weight}}function j0t(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 N0t(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 R0t(e){e.graph().dummyChains=[],e.edges().forEach(t=>I0t(e,t))}function I0t(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 Cz(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=Ef(Math.min,a);return l===Number.POSITIVE_INFINITY&&(l=0),r.rank=l}e.sources().forEach(n)}function cw(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var XRe=D0t;function D0t(e){let t=new td({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(;M0t(t,e){let a=s.v,l=i===a?s.w:a;!e.hasNode(l)&&!cw(t,s)&&(e.setNode(l,{}),e.setEdge(i,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function L0t(e,t){return t.edges().reduce((n,i)=>{let r=Number.POSITIVE_INFINITY;return e.hasNode(i.v)!==e.hasNode(i.w)&&(r=cw(t,i)),rt.node(i).rank+=n)}var{preorder:F0t,postorder:B0t}=Sz,U0t=Zy;Zy.initLowLimValues=Az;Zy.initCutValues=Tz;Zy.calcCutValue=YRe;Zy.leaveEdge=JRe;Zy.enterEdge=eIe;Zy.exchangeEdges=tIe;function Zy(e){e=h0t(e),Cz(e);let t=XRe(e);Az(t),Tz(t,e);let n,i;for(;n=JRe(t);)i=eIe(t,e,n),tIe(t,e,n,i)}function Tz(e,t){let n=B0t(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(i=>Q0t(e,t,i))}function Q0t(e,t,n){let i=e.node(n).parent,r=e.edge(n,i);r.cutvalue=YRe(e,t,n)}function YRe(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,V0t(e,n,d)){let m=e.edge(n,d).cutvalue;a+=f?-m:m}}}),a}function Az(e,t){arguments.length<2&&(t=e.nodes()[0]),ZRe(e,{},1,t)}function ZRe(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=ZRe(e,t,n,c,i))}),a.low=s,a.lim=n++,r?a.parent=r:delete a.parent,n}function JRe(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function eIe(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===WJ(e,e.node(u.v),l)&&c!==WJ(e,e.node(u.w),l)).reduce((u,d)=>cw(t,d)!e.node(r).parent);if(!n)return;let i=F0t(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 V0t(e,t,n){return e.hasEdge(t,n)}function WJ(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var H0t=q0t;function q0t(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":KJ(e);break;case"tight-tree":K0t(e);break;case"longest-path":W0t(e);break;case"none":break;default:KJ(e)}}var W0t=Cz;function K0t(e){Cz(e),XRe(e)}function KJ(e){U0t(e)}var G0t=X0t;function X0t(e){let t=Z0t(e);e.graph().dummyChains.forEach(n=>{let i=e.node(n),r=i.edgeObj,s=Y0t(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 Z0t(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(qP).forEach(i),t}function J0t(e){let t=Jw(e,"root",{},"_root"),n=evt(e),i=Object.values(n),r=Ef(Math.max,i)-1,s=2*r+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=s);let a=tvt(e)+1;e.children(qP).forEach(l=>nIe(e,t,s,a,r,n,l)),e.graph().nodeRankFactor=s}function nIe(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=HJ(e,"_bt"),d=HJ(e,"_bb"),f=e.node(a);e.setParent(u,a),f.borderTop=u,e.setParent(d,a),f.borderBottom=d,c.forEach(h=>{var m;nIe(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,w=b!==v?1:r-((m=s[a])!=null?m:0)+1;e.setEdge(u,b,{weight:y,minlen:w,nestingEdge:!0}),e.setEdge(v,d,{weight:y,minlen:w,nestingEdge:!0})}),e.parent(a)||e.setEdge(t,u,{weight:0,minlen:r+((l=s[a])!=null?l:0)})}function evt(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(qP).forEach(i=>n(i,1)),t}function tvt(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function nvt(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var ivt=rvt;function rvt(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;sXJ(e.node(t))),e.edges().forEach(t=>XJ(e.edge(t)))}function XJ(e){let t=e.width;e.width=e.height,e.height=t}function avt(e){e.nodes().forEach(t=>RL(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(RL),Object.hasOwn(i,"y")&&RL(i)})}function RL(e){e.y=-e.y}function lvt(e){e.nodes().forEach(t=>IL(e.node(t))),e.edges().forEach(t=>{var n;let i=e.edge(t);(n=i.points)==null||n.forEach(IL),Object.hasOwn(i,"x")&&IL(i)})}function IL(e){let t=e.x;e.x=e.y,e.y=t}function cvt(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),i=n.map(l=>e.node(l).rank),r=Ef(Math.max,i),s=mE(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 uvt(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 fvt(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 hvt(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 pvt(i)}function pvt(e){let t=[];function n(r){return s=>{s.merged||(s.barycenter===void 0||r.barycenter===void 0||s.barycenter>=r.barycenter)&&mvt(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=>XN(r,["vs","i","barycenter","weight"]))}function mvt(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 gvt(e,t){let n=b0t(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(bvt(!!t)),c=YJ(s,r,c),i.forEach(d=>{c+=d.vs.length,s.push(d.vs),a+=d.barycenter*d.weight,l+=d.weight,c=YJ(s,r,c)});let u={vs:s.flat(1)};return l&&(u.barycenter=a/l,u.weight=l),u}function YJ(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 bvt(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function rIe(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=fvt(e,r);u.forEach(h=>{if(e.children(h.v).length){let m=rIe(e,h.v,n,i);c[h.v]=m,Object.hasOwn(m,"barycenter")&&vvt(h,m)}});let d=hvt(u,n);yvt(d,c);let f=gvt(d,i);if(a&&l){f.vs=[a,f.vs,l].flat(1);let h=e.predecessors(a);if(h&&h.length){let m=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+m.order+b.order)/(f.weight+2),f.weight+=2}}return f}function yvt(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(i=>t[i]?t[i].vs:i)})}function vvt(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 xvt(e,t,n,i){i||(i=e.nodes());let r=wvt(e),s=new td({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),m=h!==void 0?h.weight:0;s.setEdge(f,a,{weight:e.edge(d).weight+m})}),Object.hasOwn(l,"minRank")&&s.setNode(a,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),s}function wvt(e){let t;for(;e.hasNode(t=Ez("_root")););return t}function Ovt(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 sIe(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,sIe);return}let n=WRe(e),i=ZJ(e,mE(1,n+1),"inEdges"),r=ZJ(e,mE(n-1,-1,-1),"outEdges"),s=cvt(e);if(JJ(e,s),t.disableOptimalOrderHeuristic)return;let a=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){kvt(u%2?i:r,u%4>=2,c),s=qC(e);let f=uvt(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 xvt(e,s,n,i.get(s)||[])})}function kvt(e,t,n){let i=new td;e.forEach(function(r){n.forEach(l=>i.setEdge(l.left,l.right));let s=r.graph().root,a=rIe(r,s,i,t);a.vs.forEach((l,c)=>r.node(l).order=c),Ovt(r,i,a.vs)})}function JJ(e,t){Object.values(t).forEach(n=>n.forEach((i,r)=>e.node(i).order=r))}function Svt(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=Cvt(e,d),m=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),w=y.order;(w{let f=s[d];if(f!==void 0&&e.node(f).dummy){let h=e.predecessors(f);h&&h.forEach(m=>{if(m===void 0)return;let g=e.node(m);g.dummy&&(g.orderu)&&oIe(n,m,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 m=h[0];if(m===void 0)return;c=e.node(m).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 Cvt(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(i=>e.node(i).dummy)}}function oIe(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 Tvt(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 Avt(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((m,g)=>{let b=a[m],v=a[g];return(b!==void 0?b:0)-(v!==void 0?v:0)}),h=(f.length-1)/2;for(let m=Math.floor(h),g=Math.ceil(h);m<=g;++m){let b=f[m];if(b===void 0)continue;let v=a[b];if(v!==void 0&&s[u]===u&&c{var y;let w=(y=s[v.v])!=null?y:0,x=a.edge(v);return Math.max(b,w+(x!==void 0?x:0))},0):s[m]=0}function d(m){let g=a.outEdges(m),b=Number.POSITIVE_INFINITY;g&&(b=g.reduce((y,w)=>{let x=s[w.w],O=a.edge(w);return Math.min(y,(x!==void 0?x:0)-(O!==void 0?O:0))},Number.POSITIVE_INFINITY));let v=e.node(m);b!==Number.POSITIVE_INFINITY&&v.borderType!==l&&(s[m]=Math.max(s[m]!==void 0?s[m]:0,b))}function f(m){return a.predecessors(m)||[]}function h(m){return a.successors(m)||[]}return c(u,f),c(d,h),Object.keys(i).forEach(m=>{var g;let b=n[m];b!==void 0&&(s[m]=(g=s[b])!=null?g:0)}),s}function jvt(e,t,n,i){let r=new td,s=e.graph(),a=Dvt(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 Nvt(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=Mvt(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-Ef(Math.min,u);a!=="l"&&(d=r-Ef(Math.max,u)),d&&(e[l]=HP(c,f=>f+d))})})}function Ivt(e,t=void 0){let n=e.ul;return n?HP(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 Pvt(e){let t=qC(e),n=Object.assign(Svt(e,t),Evt(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=Avt(e,r,n,d=>(a==="u"?e.predecessors(d):e.successors(d))||[]),u=_vt(e,r,c.root,c.align,l==="r");l==="r"&&(u=HP(u,d=>-d)),i[a+l]=u})});let s=Nvt(e,i);return Rvt(i,s),Ivt(i,e.graph().align)}function Dvt(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 Mvt(e,t){return e.node(t).width}function Lvt(e){e=HRe(e),$vt(e),Object.entries(Pvt(e)).forEach(([t,n])=>e.node(t).x=n)}function $vt(e){let t=qC(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 Fvt(e,t={}){let n=t.debugTiming?KRe:GRe;return n("layout",()=>{let i=n(" buildLayoutGraph",()=>Gvt(e));return n(" runLayout",()=>Bvt(i,n,t)),n(" updateInputGraph",()=>Uvt(e,i)),i})}function Bvt(e,t,n){t(" makeSpaceForEdgeLabels",()=>Xvt(e)),t(" removeSelfEdges",()=>sxt(e)),t(" acyclic",()=>_0t(e)),t(" nestingGraph.run",()=>J0t(e)),t(" rank",()=>H0t(HRe(e))),t(" injectEdgeLabelProxies",()=>Yvt(e)),t(" removeEmptyRanks",()=>m0t(e)),t(" nestingGraph.cleanup",()=>nvt(e)),t(" normalizeRanks",()=>p0t(e)),t(" assignRankMinMax",()=>Zvt(e)),t(" removeEdgeLabelProxies",()=>Jvt(e)),t(" normalize.run",()=>R0t(e)),t(" parentDummyChains",()=>G0t(e)),t(" addBorderSegments",()=>ivt(e)),t(" order",()=>sIe(e,n)),t(" insertSelfEdges",()=>oxt(e)),t(" adjustCoordinateSystem",()=>svt(e)),t(" position",()=>Lvt(e)),t(" positionSelfEdges",()=>axt(e)),t(" removeBorderNodes",()=>rxt(e)),t(" normalize.undo",()=>P0t(e)),t(" fixupEdgeLabelCoords",()=>nxt(e)),t(" undoCoordinateSystem",()=>ovt(e)),t(" translateGraph",()=>ext(e)),t(" assignNodeIntersects",()=>txt(e)),t(" reversePoints",()=>ixt(e)),t(" acyclic.undo",()=>N0t(e))}function Uvt(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 Qvt=["nodesep","edgesep","ranksep","marginx","marginy"],zvt={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},Vvt=["acyclicer","ranker","rankdir","align","rankalign"],Hvt=["width","height","rank"],eee={width:0,height:0},qvt=["minlen","weight","width","height","labeloffset"],Wvt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Kvt=["labelpos"];function Gvt(e){let t=new td({multigraph:!0,compound:!0}),n=DL(e.graph());return t.setGraph(Object.assign({},zvt,PL(n,Qvt),XN(n,Vvt))),e.nodes().forEach(i=>{let r=DL(e.node(i)),s=PL(r,Hvt);Object.keys(eee).forEach(l=>{s[l]===void 0&&(s[l]=eee[l])}),t.setNode(i,s);let a=e.parent(i);a!==void 0&&t.setParent(i,a)}),e.edges().forEach(i=>{let r=DL(e.edge(i));t.setEdge(i,Object.assign({},Wvt,PL(r,qvt),XN(r,Kvt)))}),t}function Xvt(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 Yvt(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};Jw(e,"edge-proxy",r,"_ep")}})}function Zvt(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 Jvt(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 ext(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,m=u.height;t=Math.min(t,d-h/2),n=Math.max(n,d+h/2),i=Math.min(i,f-m/2),r=Math.max(r,f+m/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 txt(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(VJ(i,s)),n.points.push(VJ(r,a))})}function nxt(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 ixt(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function rxt(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 sxt(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 oxt(e){qC(e).forEach(t=>{let n=0;t.forEach((i,r)=>{let s=e.node(i);s.order=r+n,(s.selfEdges||[]).forEach(a=>{Jw(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 axt(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 PL(e,t){return HP(XN(e,t),Number)}function DL(e){let t={};return e&&Object.entries(e).forEach(([n,i])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=i}),t}function lxt(e){let t=qC(e),n=new td({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 cxt={graphlib:MRe,version:x0t,layout:Fvt,debug:lxt,util:{time:KRe,notime:GRe}},tee=cxt;/*! For license information please see dagre.esm.js.LEGAL.txt */const rk={llm:{labelKey:"buildCanvas.patterns.llm.label",descriptionKey:"buildCanvas.patterns.llm.description",icon:m2e},sequential:{labelKey:"buildCanvas.patterns.sequential.label",descriptionKey:"buildCanvas.patterns.sequential.description",icon:crt},parallel:{labelKey:"buildCanvas.patterns.parallel.label",descriptionKey:"buildCanvas.patterns.parallel.description",icon:zit},loop:{labelKey:"buildCanvas.patterns.loop.label",descriptionKey:"buildCanvas.patterns.loop.description",icon:v2e},a2a:{labelKey:"buildCanvas.patterns.a2a.label",descriptionKey:"buildCanvas.patterns.a2a.description",icon:yP}},ZF=220,JF=88,nee=96,iee=34,Gk=64,ML=310,Fv=24,aIe=56,e8=40,ree=40,uxt=18,dxt=58,fxt=!1,hxt=e=>e==="sequential"||e==="parallel"||e==="loop";function t8(e,t){const n=e.agentType??"llm";return hxt(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function n8(e,t=[],n="horizontal",i=!1){const r=e.agentType??"llm";if(!t8(e,t))return{width:ZF,height:JF};if(i&&e.subAgents.length===0)return{width:ML,height:Gk};const s=e.subAgents.map((f,h)=>n8(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"?aIe:Fv,u=n==="horizontal"?r!=="parallel":r==="parallel",d=s.length?r==="parallel"?uxt+ree:r==="loop"?dxt:0:ree;return u?{width:Math.max(ML,s.reduce((f,h)=>f+h.width,0)+e8*Math.max(0,s.length-1)+c*2),height:Gk+Fv+l+d+Fv}:{width:Math.max(ML,a+Fv*2),height:Gk+c+s.reduce((f,h)=>f+h.height,0)+e8*Math.max(0,s.length-1)+d+c}}function dO(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function pxt(e,t){return e.length===t.length&&e.every((n,i)=>n===t[i])}function see(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function fO(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:dE.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 oee(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,m,g,b){const v=f.agentType??"llm",y=dO(h);return t8(f,h)?(l(f,h,m,g,b),y):(r.push({id:y,type:"agent",parentId:m,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(rk[v].descriptionKey),childCount:f.subAgents.length,containedIn:b}}),y)}function l(f,h,m,g={x:0,y:0},b){const v=f.agentType??"sequential",y=dO(h),w=n8(f,h,t,n);r.push({id:y,type:"group",parentId:m,extent:m?"parent":void 0,position:g,style:{width:w.width,height:w.height},data:{kind:"agent",path:h,agent:f,title:f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i(rk[v].labelKey)),pattern:v,description:f.description.trim()||i(rk[v].descriptionKey),childCount:f.subAgents.length,containedIn:b,layoutWidth:w.width,layoutHeight:w.height,compactEmptyGroup:n&&f.subAgents.length===0}});const x=f.subAgents.map((E,R)=>n8(E,[...h,R],t,n)),O=x.length&&v!=="parallel"?aIe:Fv,S=t==="horizontal"?v!=="parallel":v==="parallel";let k=O;const C=f.subAgents.map((E,R)=>{const A=x[R],N=S?{x:k,y:Gk+Fv}:{x:(w.width-A.width)/2,y:Gk+k};return k+=(S?A.width:A.height)+e8,a(E,[...h,R],y,N,v)});if(v==="sequential"||v==="loop"){for(let E=0;E1&&s.push(fO(C[C.length-1],C[0],i("buildCanvas.edges.continueLoop"),{loop:!0,tone:"loop"}))}return y}const c=(f,h)=>{const m=f.agentType??"llm",g=dO(h);if(t8(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:m==="a2a"?i("buildCanvas.patterns.a2a.label"):f.name.trim()||(h.length===0?i("buildCanvas.rootAgent"):i("buildCanvas.unnamedStep")),pattern:m,description:f.description.trim()||i(rk[m].descriptionKey),childCount:f.subAgents.length}}),f.subAgents.length===0)return[g];const b=[];return f.subAgents.forEach((v,y)=>{const w=[...h,y],x=dO(w);s.push(fO(g,x,i("buildCanvas.edges.call"),{insert:{parentPath:h,index:y}})),b.push(...c(v,w))}),b},u=dO([]),d=c(e,[]);return s.push(fO("terminal-input",u)),d.forEach(f=>s.push(fO(f,"terminal-output"))),mxt(r,s,t)}function mxt(e,t,n){const i=new tee.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?nee:s.data.layoutWidth??ZF,height:a?iee:s.data.layoutHeight??JF})}),t.filter(s=>r.has(s.source)&&r.has(s.target)).forEach(s=>i.setEdge(s.source,s.target)),tee.layout(i),{nodes:e.map(s=>{if(s.parentId)return s;const a=i.node(s.id),l=s.data.kind==="terminal",c=l?nee:s.data.layoutWidth??ZF,u=l?iee:s.data.layoutHeight??JF;return{...s,position:{x:a.x-c/2,y:a.y-u/2}}}),edges:t}}const WP=p.createContext(null),KP=p.createContext("horizontal");function gxt({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}=_e("create"),h=p.useContext(WP),[m,g]=p.useState(!1),[b,v,y]=qN({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(HC,{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(lyt,{children:o.jsxs("div",{className:`abc-edge-tools${h&&(d!=null&&d.insert)?" can-insert":""}${m?" 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:w=>{w.stopPropagation(),h==null||h.onInsert(d.insert.parentPath,d.insert.index)},children:o.jsx(Rl,{})})]})})]})}function bxt({data:e,selected:t}){const{t:n}=_e("create"),i=p.useContext(WP),r=p.useContext(KP),s=r==="vertical"?pn.Top:pn.Left,a=r==="vertical"?pn.Bottom:pn.Right,l=r==="vertical"?pn.Right:pn.Bottom,c=e.pattern??"llm",u=rk[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(oc,{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(lg,{})}),o.jsx(oc,{type:"source",position:a,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(oc,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),o.jsx(oc,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function yxt({data:e,selected:t}){const{t:n}=_e("create"),i=p.useContext(WP),r=p.useContext(KP),s=r==="vertical"?pn.Top:pn.Left,a=r==="vertical"?pn.Bottom:pn.Right,l=r==="vertical"?pn.Right:pn.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(oc,{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(Rl,{})}),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(Rl,{})})]}),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(Rl,{}),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(Rl,{}),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(lg,{})}),o.jsx(oc,{type:"source",position:a,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(oc,{id:"loop-target",type:"target",position:l,className:"abc-handle abc-loop-handle"}),o.jsx(oc,{id:"loop-source",type:"source",position:l,className:"abc-handle abc-loop-handle"})]})]})}function vxt({data:e}){const t=p.useContext(KP);return o.jsxs("div",{className:"abc-terminal",children:[o.jsx(oc,{type:"target",position:t==="vertical"?pn.Top:pn.Left,className:"abc-handle"}),o.jsx("span",{children:e.title}),o.jsx(oc,{type:"source",position:t==="vertical"?pn.Bottom:pn.Right,className:"abc-handle"})]})}const xxt={agent:bxt,group:yxt,terminal:vxt},wxt={insertStep:gxt};function Oxt({draft:e,selectedPath:t,onSelect:n,onAdd:i,onInsert:r,onDelete:s,readOnly:a=!1,interactivePreview:l=!1,direction:c="horizontal"}){const{t:u}=_e("create"),d=p.useMemo(()=>oee(e,c,a,u),[]),[f,h,m]=cyt(d.nodes),[g,b,v]=uyt(d.edges),y=fyt(),w=p.useRef(`${c}:${a?"readonly":"editable"}:${see(e)}`),x=p.useRef(null),{fitView:O}=zP(),S=p.useMemo(()=>oee(e,c,a,u),[c,e,a,u]),[k,C]=p.useState(()=>window.matchMedia("(max-width: 860px)").matches),E=p.useMemo(()=>a?{padding:.16,minZoom:.05,maxZoom:.9}:k?{padding:.08,minZoom:.35,maxZoom:.9}:{padding:.14,minZoom:.42,maxZoom:1.1},[k,a]),R=p.useCallback((N=0)=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const T=x.current;if(T&&(T.clientWidth===0||T.clientHeight===0)&&N<8){R(N+1);return}O(E)})})},[E,O]);p.useEffect(()=>{const N=window.matchMedia("(max-width: 860px)"),T=j=>C(j.matches);return N.addEventListener("change",T),()=>N.removeEventListener("change",T)},[]),p.useEffect(()=>{const N=`${c}:${a?"readonly":"editable"}:${see(e)}`,T=N!==w.current;w.current=N,b(S.edges),h(j=>{const _=new Map(j.map(I=>[I.id,I]));return S.nodes.map(I=>{const D=_.get(I.id);return{...I,measured:!T&&D&&D.type===I.type?D.measured:void 0,position:!T&&D?D.position:I.position,selected:I.data.kind==="agent"&&!!I.data.path&&pxt(I.data.path,t)}})}),T&&R()},[S,e,R,t,b,h]),p.useEffect(()=>{R()},[k,R]),p.useEffect(()=>{y&&R()},[S,R,y]),p.useEffect(()=>{if(!a||!x.current)return;const N=new ResizeObserver(()=>R());return N.observe(x.current),R(),()=>N.disconnect()},[R,a]);const A=p.useMemo(()=>a?null:{onAdd:i,onInsert:r,onDelete:s},[i,s,r,a]);return o.jsx(KP.Provider,{value:c,children:o.jsx(WP.Provider,{value:A,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:x,className:"abc-canvas",children:o.jsxs(oyt,{nodes:f,edges:g,nodeTypes:xxt,edgeTypes:wxt,onNodesChange:m,onEdgesChange:v,onNodeClick:(N,T)=>{!a&&T.data.kind==="agent"&&T.data.path&&n(T.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:E,onInit:()=>R(),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(byt,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!a||l)&&o.jsx(Syt,{showInteractive:!1}),fxt]})})})})})}function gE(e){return o.jsx(NRe,{children:o.jsx(Oxt,{...e})})}mn.hasResourceBundle("en-US","create")||mn.addResourceBundle("en-US","create",Yue,!0,!0);mn.hasResourceBundle("zh-CN","create")||mn.addResourceBundle("zh-CN","create",eye,!0,!0);function Gt(e,t={}){return mn.t(e,{...t,ns:"create"})}function WC(e,t){return e.map(n=>({...n,get label(){return Gt(`${t}.${n.id}.label`)},get desc(){return Gt(`${t}.${n.id}.description`)}}))}function Lu(e,t){const n={...e};for(const[i,r]of Object.entries(t))Object.defineProperty(n,i,{configurable:!0,enumerable:!0,get:()=>Gt(r)});return n}const lIe="https://ark.cn-beijing.volces.com/api/v3/";Lu({key:"MODEL_AGENT_NAME",required:!1,placeholder:"doubao-seed-1-6-250615"},{comment:"traditional.catalog.env.modelAgentName.comment"});const tj=[Lu({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:lIe}],YN=[],ZN={get label(){return Gt("traditional.catalog.links.console")},url:"https://console.volcengine.com/vikingdb/openviking"},kxt={get label(){return Gt("traditional.catalog.links.documentation")},url:"https://github.com/volcengine/OpenViking/blob/main/docs/zh/api/05-sessions.md"},cIe="https://api.vikingdb.cn-beijing.volces.com/openviking",Sxt=`{ "self": {"enabled": true}, "peer": {"enabled": true}, "working_memory": {"enabled": true}, "memory_types": null -}`,yxt=[{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}],vxt=[$u({key:"DATABASE_VIKINGMEM_PROJECT",required:!1,placeholder:"default",hidden:!0},{comment:"traditional.catalog.env.vikingMemoryProject.comment"}),$u({key:"DATABASE_VIKING_REGION",required:!1,hidden:!0},{comment:"traditional.catalog.env.vikingMemoryRegion.comment"}),$u({key:"DATABASE_VIKINGMEM_MEMORY_TYPE",required:!1,placeholder:"sys_event_v1,sys_profile_v1",hidden:!0},{comment:"traditional.catalog.env.vikingMemoryType.comment"})],rk=[$u({key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx"},{comment:"traditional.catalog.env.feishuAppId.comment"}),$u({key:"FEISHU_APP_SECRET",required:!0,secret:!0},{placeholder:"traditional.catalog.env.feishuAppSecret.placeholder",comment:"traditional.catalog.env.feishuAppSecret.comment"})],fx={topK:"3",region:"cn-beijing",endpoint:"https://open.volcengineapi.com/"};function KP(e){if(e==="byteplus"){const t="ap-southeast-1";return{topK:fx.topK,region:t,endpoint:`https://agentkit.${t}.byteplusapi.com/`}}return fx}const iIe=[$u({key:"REGISTRY_SPACE_ID",required:!0},{placeholder:"traditional.catalog.env.registrySpaceId.placeholder",comment:"traditional.catalog.env.registrySpaceId.comment"}),$u({key:"REGISTRY_TOP_K",required:!1,placeholder:fx.topK},{comment:"traditional.catalog.env.registryTopK.comment"}),$u({key:"REGISTRY_REGION",required:!1,placeholder:fx.region},{comment:"traditional.catalog.env.registryRegion.comment"}),$u({key:"REGISTRY_ENDPOINT",required:!1,placeholder:fx.endpoint},{comment:"traditional.catalog.env.registryEndpoint.comment"})],e1=WC([{id:"web_search",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:XN},{id:"parallel_web_search",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:XN},{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 Wt("traditional.catalog.env.agentKitToolId.comment")}},{key:"AGENTKIT_TOOL_REGION",required:!1,placeholder:"cn-beijing",get comment(){return Wt("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"),xxt=new Set(["web_scraper","text_to_speech","vesearch"]),wxt=new Set(["web_search","parallel_web_search"]),Oxt=e1.filter(e=>!xxt.has(e.id));function rIe(e="volcengine"){const t=e==="byteplus"?wxt:new Set;return Oxt.filter(n=>!t.has(n.id))}const hx=WC([{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"),i8=WC([{id:"local",env:nj,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},...nj],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},...nj],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",env:vxt},{id:"openviking",env:[{key:"DATABASE_OPENVIKING_URL",required:!0,placeholder:nIe,get comment(){return Wt("traditional.catalog.env.openVikingUrl.comment")},link:YN},{key:"DATABASE_OPENVIKING_API_KEY",required:!0,comment:"OpenViking API Key",link:YN},{key:"DATABASE_OPENVIKING_USER_ID",required:!1,placeholder:"default",get comment(){return Wt("traditional.catalog.env.openVikingMemoryUserId.comment")},get help(){return Wt("traditional.catalog.env.openVikingMemoryUserId.help")}},{key:"DATABASE_OPENVIKING_MEMORY_POLICY",required:!1,placeholder:bxt,get comment(){return Wt("traditional.catalog.env.openVikingMemoryPolicy.comment")},multiline:!0,format:"json",get help(){return Wt("traditional.catalog.env.openVikingMemoryPolicy.help")},link:gxt}]},{id:"mem0",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}],pipExtra:"database"}],"traditional.backends.longTerm"),qm="viking",r8=WC([{id:"viking",env:yxt},{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},...nj],pipExtra:"extensions",needsEmbedding:!0},{id:"context_search",env:[...XN,{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:nIe,get comment(){return Wt("traditional.catalog.env.openVikingUrl.comment")},link:YN},{key:"DATABASE_OPENVIKING_API_KEY",required:!0,comment:"OpenViking API Key",link:YN},{key:"DATABASE_OPENVIKING_USER_ID",required:!1,placeholder:"default",get comment(){return Wt("traditional.catalog.env.openVikingKnowledgeUserId.comment")},get help(){return Wt("traditional.catalog.env.openVikingKnowledgeUserId.help")}},{key:"DATABASE_OPENVIKING_TARGET_URI",required:!1,placeholder:"viking://user/default/resources//",get comment(){return Wt("traditional.catalog.env.openVikingTargetUri.comment")},get help(){return Wt("traditional.catalog.env.openVikingTargetUri.help")}}]}],"traditional.backends.knowledge"),kxt=WC([{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:[...XN,$u({key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1},{comment:"traditional.catalog.env.tlsServiceName.comment"})]}],"traditional.exporters");function ru(e="volcengine"){return{name:"",description:Wt("defaults.description"),instruction:Wt("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:lp(e),modelFallbacks:[],modelSource:"ark",modelProvider:"",modelApiBase:"",shortTermBackend:"local",longTermBackend:"local",longTermMemoryIndex:"",autoSaveSession:!1,knowledgebaseBackend:qm,knowledgebaseIndex:"",tracingExporters:[],selectedSkills:[],cloudEnvironment:{environmentId:"",environmentVersionId:""},deployment:{feishuEnabled:!1,modelApiKeyId:"",modelApiKeyName:""}}}function hO(e){return{id:e,get displayName(){return Wt(`traditional.optimization.options.${e}.label`)},get description(){return Wt(`traditional.optimization.options.${e}.description`)}}}const _z=[hO("context_engine"),hO("compressor"),hO("verifier"),hO("long_run_control"),hO("mcp_resilience")],Sxt=[{id:"quality",get displayName(){return Wt("traditional.optimization.groups.quality")},componentIds:["context_engine","verifier"]},{id:"cost",get displayName(){return Wt("traditional.optimization.groups.cost")},componentIds:["compressor"]},{id:"stability",get displayName(){return Wt("traditional.optimization.groups.stability")},componentIds:["long_run_control","mcp_resilience"]}],t1=_z.map(e=>e.id);function Ext(e){return e==="byteplus"?Wt("traditional.optimization.bytePlusUnavailable"):null}const sIe=["context_engine","compressor","verifier","long_run_control"],Cxt=new Set(["1","true","yes","on"]),jz=[{id:"default",get displayName(){return Wt("traditional.optimization.profiles.default.label")},get description(){return Wt("traditional.optimization.profiles.default.description")},defaultComponents:[],autoAddedComponents:[]},{id:"ops",get displayName(){return Wt("traditional.optimization.profiles.ops.label")},get description(){return Wt("traditional.optimization.profiles.ops.description")},defaultComponents:["context_engine","verifier","long_run_control","mcp_resilience"],autoAddedComponents:["sql_readonly"]}];function ij(e){var t;return((t=_z.find(n=>n.id===e))==null?void 0:t.displayName)??e}function Txt(e){var t;return((t=jz.find(n=>n.id===e))==null?void 0:t.displayName)??e}function Nz(e){const t=jz.find(n=>n.id===e);return t?[...t.defaultComponents]:[]}function Lb(e,t="default"){const n=new Set(e);return{enabled:n.size>0,profile:t,componentOverrides:Object.fromEntries(t1.map(r=>[r,n.has(r)]))}}function Rz(e){if(!e)return;const t=e.profile==="ops"?"ops":"default",n=t==="ops"?Nz(t):t1.filter(i=>{var r;return((r=e.componentOverrides)==null?void 0:r[i])===!0});return{...Lb(n,t),...e.catalogVersion?{catalogVersion:e.catalogVersion}:{},...e.planHash?{planHash:e.planHash}:{}}}function ML(e){return Cxt.has((e==null?void 0:e.trim().toLowerCase())??"")}function Axt(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 _xt(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(!ML(n))return Lb([],i);const r=Axt(t.get("HARNESS_SIDECAR_COMPONENT_OVERRIDES"));if(r){const l={...Lb(t1.filter(c=>r[c]===!0),i),enabled:!0};return i==="ops"?Rz(l)??l:l}if(i==="ops")return Lb(Nz(i),i);const s=[...ML(t.get("HARNESS_MODEL_PROXY_ENABLED"))?sIe:[],...ML(t.get("HARNESS_MCP_GATEWAY_ENABLED"))?["mcp_resilience"]:[]];return{...Lb(s,i),enabled:!0}}function jxt(e,t){return{...e,modelName:t.modelName||e.modelName,description:t.description,instruction:t.instruction}}function Nxt(e){var t;return((t=e.harnessSidecar)==null?void 0:t.profile)??"default"}function ZN(e){var n;const t=(n=e.harnessSidecar)==null?void 0:n.componentOverrides;return t?t1.filter(i=>t[i]):[]}function Rxt(e){const t=new Set(ZN(e));return sIe.filter(n=>t.has(n))}function Ixt(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 Zy(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 Iz(e){return Zy(e).modelName}function oIe(e,t,n,i=!1){var c,u,d,f;const r=Zy((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,m)=>oIe(h,s[m],void 0,i))}}function Pxt(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 s8(e,t){var c,u,d;const n=e.cloudProvider??t,i=ru(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:Rz(e.harnessSidecar),subAgents:(e.subAgents??[]).map(f=>s8(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:s8(f.agent,n)}))}}:{}}}const Dxt=["动态子智能体协作规则:","Dynamic sub-agent collaboration rules:"],Mxt=["collect_resources","create_agents","handoff_to"];function Lxt(e){return e.replace(/\\([\\`*_[\]{}()<>#+\-.!|])/g,"$1")}function $xt(e){const t=Dxt.flatMap(i=>{const r=[];let s=0;for(;si-r),n=t.find((i,r)=>{const s=t[r+1]??e.length,a=Lxt(e.slice(i,s));return Mxt.every(l=>a.includes(l))});return n===void 0?e:e.slice(0,n).trimEnd()}function Fxt(e){const t=n=>({...n,instruction:n.dynamicAgentDelegation===!0?$xt(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 aIe(e,t){var l,c;const n=ru(t),i=[...e.tools??[]],r=e1.filter(u=>u.toolNames.some(d=>i.includes(d))),s=new Set(r.flatMap(u=>u.toolNames)),a=Zy(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=>aIe(u,t))}}function Pz(e,t,n=[]){var l,c,u,d;const i=((l=e.draft)==null?void 0:l.cloudProvider)??t,r=Zy(e.model),s=e.draft?s8(e.draft,i):e.graph?aIe(e.graph,i):{...ru(i),modelSource:void 0,name:((c=e.name)==null?void 0:c.trim())||e.appName.trim(),description:e.description??"",instruction:e.instruction||ru(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?Fxt(s):s;return Ixt(oIe(a,e.graph,{name:((d=e.name)==null?void 0:d.trim())||e.appName.trim(),model:e.model},!!e.draft),new Set(n))}function Bxt(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 aee({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 Uxt={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",studio_write_artifact:"studioTools.labels.studio_write_artifact"};function o8(e,t,n){const i=e1.find(s=>s.id===e||s.toolNames.includes(e)),r=Uxt[e];return r?t(r):n||(i==null?void 0:i.label)||e}function Qxt(){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 zxt(){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 Vxt({agentName:e,tools:t,selectedIds:n,loading:i,disabled:r,unavailableReason:s,onChange:a,onClose:l}){const{t:c}=je("workspaceTools"),[u,d]=p.useState(""),f=p.useMemo(()=>new Set(n),[n]),h=p.useRef(`studio-tool-${Math.random().toString(36).slice(2)}`),m=p.useMemo(()=>{const b=u.trim().toLowerCase();return b?t.filter(v=>`${v.name} ${v.id} ${v.description}`.toLowerCase().includes(b)):t},[u,t]);p.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 si.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(aee,{})}),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(Qxt,{})})]}),o.jsxs("div",{className:"studio-tool-dialog-body",children:[o.jsxs("label",{className:"studio-tool-search",children:[o.jsx(zxt,{}),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}):m.length===0?o.jsx("div",{className:"studio-tool-empty",children:c("studioTools.noMatch")}):m.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(aee,{})}),o.jsxs("span",{className:"studio-tool-option-copy",children:[o.jsx("strong",{children:o8(b.id,c,b.name)}),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)}const JN=[{id:"ubuntu-22.04",label:"Ubuntu 22.04",image:"ubuntu:22.04"},{id:"ubuntu-24.04",label:"Ubuntu 24.04",image:"ubuntu:24.04"}],lIe=[{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 基础镜像"}],Dz="agentkit-cli-2107625663-cn-beijing.cr.volces.com/agentkit/agent-native-requirements-aio:0.2.1-20260831",cIe={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"},uIe=[{id:"python-3.10",label:"Python 3.10"},{id:"python-3.12",label:"Python 3.12"}],Hxt={"python-3.10":"3.10.18","python-3.12":"3.12.11"},Mz=[{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"}]}],qxt=Mz.flatMap(e=>e.options),Wxt=["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"],Kxt=["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"],Gxt={"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 pO(e,t){for(const n of t)e.includes(n)||e.push(n)}function Xxt(e,t,n,i,r){const s=["ca-certificates"];r||pO(s,i?[`python${n}`,`python${n}-venv`]:Wxt);for(const a of t)a.id==="playwright"||a.id==="chromium"||(a.installer==="apt"&&pO(s,[a.packageName]),a.id==="opencli"&&pO(s,["curl","xz-utils"]));return e.optionIds.some(a=>a==="playwright"||a==="chromium")&&(pO(s,Kxt),pO(s,Gxt[e.operatingSystem])),s}const LL={name:"",description:"",baseEnvironment:"aio-sandbox",operatingSystem:"ubuntu-22.04",language:"python-3.12",optionIds:[],selectedSkills:[]};function Xh(e){var t;return((t=uIe.find(n=>n.id===e))==null?void 0:t.label)??e}function a8(e){var t;return((t=JN.find(n=>n.id===e))==null?void 0:t.label)??e}function l8(e){var t;return((t=lIe.find(n=>n.id===e))==null?void 0:t.label)??e}function Yxt(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 Lz(e,t="volcengine"){const n=qxt.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=Hxt[a],u=JN.find(b=>b.id===e.operatingSystem)??JN[0],d=e.operatingSystem==="ubuntu-22.04"&&l==="3.10"||e.operatingSystem==="ubuntu-24.04"&&l==="3.12",f=Xxt(e,n,l,d,s),h=i?[`ARG AIO_BASE_IMAGE=${Dz}`,"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=${cIe[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 m=new Set(e.optionIds);(m.has("playwright")||m.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 Zxt(){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 Jxt(){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 c8(){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 dIe(){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 ewt(){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 lee(){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 cee(){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 Gl(e){return`${e.environment_id}\0${e.environment_version_id}`}function Xk(e){return e.latestVersion?{environment_id:e.id,environment_version_id:e.latestVersion.versionId}:null}function rj(e,t){return e.environmentIds.flatMap(n=>{const i=t.get(n),r=i?Xk(i):null;return r?[r]:[]})}function twt({environments:e,workspaces:t,value:n,selectedWorkspaceIds:i,loading:r,error:s,onConfirm:a,onClose:l}){const{t:c}=je("workspaceTools"),[u,d]=p.useState(""),[f,h]=p.useState(!1),[m,g]=p.useState(""),b=p.useId(),v=p.useMemo(()=>new Map(e.map(T=>[T.id,T])),[e]),[y,w]=p.useState(()=>new Set(i)),[x,O]=p.useState(()=>{const T=new Set(t.filter(N=>i.includes(N.id)).flatMap(N=>N.environmentIds));return new Set(n.filter(N=>!T.has(N.environment_id)).map(Gl))}),S=p.useMemo(()=>new Set(t.filter(T=>y.has(T.id)).flatMap(T=>T.environmentIds)),[y,t]),k=p.useMemo(()=>{const T=new Set(x);for(const N of t)if(y.has(N.id))for(const _ of rj(N,v))T.add(Gl(_));return T},[x,y,v,t]),C=p.useMemo(()=>{const T=u.trim().toLocaleLowerCase();return T?e.filter(N=>`${N.name} ${N.description} ${Xh(N.language)}`.toLocaleLowerCase().includes(T)):e},[e,u]),E=p.useMemo(()=>{const T=u.trim().toLocaleLowerCase();return T?t.filter(N=>{const _=N.environmentIds.map(D=>{var M;return((M=v.get(D))==null?void 0:M.name)??""}).join(" ");return`${N.name} ${N.description} ${_}`.toLocaleLowerCase().includes(T)}):t},[v,u,t]);p.useEffect(()=>{const T=document.body.style.overflow,N=_=>{_.key==="Escape"&&!f&&l()};return document.body.style.overflow="hidden",document.addEventListener("keydown",N),()=>{document.body.style.overflow=T,document.removeEventListener("keydown",N)}},[l,f]);const R=T=>{const N=Xk(T);if(!N)return;const _=Gl(N);S.has(T.id)||O(D=>{const M=new Set(D);return M.has(_)?M.delete(_):M.add(_),M})},A=T=>{const N=rj(T,v);N.length!==0&&(w(_=>{const D=new Set(_);return D.has(T.id)?D.delete(T.id):D.add(T.id),D}),O(_=>{const D=new Set(_);for(const M of N)D.delete(Gl(M));return D}))},j=async()=>{const T=new Map(n.map(_=>[Gl(_),_])),N=e.flatMap(_=>{const D=Xk(_);if(!D||!k.has(Gl(D)))return[];const M=T.get(Gl(D));return[{...D,mount_instance_id:(M==null?void 0:M.mount_instance_id)||crypto.randomUUID()}]});h(!0),g("");try{await a(N,[...y]),l()}catch(_){g(_ instanceof Error?_.message:c("sessionEnvironment.mountFailed"))}finally{h(!1)}};return si.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(c8,{})}),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(Zxt,{})})]}),o.jsxs("div",{className:"studio-tool-dialog-body",children:[o.jsxs("label",{className:"studio-tool-search",children:[o.jsx(Jxt,{}),o.jsx("input",{value:u,"aria-label":c("sessionEnvironment.searchAria"),placeholder:c("sessionEnvironment.searchPlaceholder"),autoFocus:!0,onChange:T=>d(T.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}):C.length===0&&E.length===0?o.jsx("div",{className:"studio-tool-empty",children:c("sessionEnvironment.noMatch")}):o.jsxs(o.Fragment,{children:[E.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")}),E.map(T=>{const N=rj(T,v),_=y.has(T.id),D=N.length===0;return o.jsxs("label",{className:`studio-tool-option session-environment-option is-workspace${_?" is-selected":""}${D?" is-disabled":""}`,children:[o.jsx("span",{className:"studio-tool-option-icon",children:o.jsx(dIe,{})}),o.jsxs("span",{className:"studio-tool-option-copy",children:[o.jsx("strong",{children:T.name}),o.jsx("span",{children:T.description||c("sessionEnvironment.reuseAll")}),o.jsx("small",{children:c("sessionEnvironment.availableEnvironmentCount",{count:N.length})})]}),o.jsx("input",{type:"checkbox",checked:_,disabled:D,"aria-label":c("sessionEnvironment.selectWorkspace",{name:T.name}),onChange:()=>A(T)}),o.jsx("span",{className:"session-environment-check","aria-hidden":"true",children:o.jsx(cee,{})})]},T.id)})]}),C.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")}),C.map(T=>{const N=Xk(T);if(!N)return null;const _=t.filter(P=>y.has(P.id)&&P.environmentIds.includes(T.id)),D=_.length>0,M=k.has(Gl(N));return o.jsxs("label",{className:`studio-tool-option session-environment-option${M?" is-selected":""}${D?" is-covered":""}`,children:[o.jsx("span",{className:"studio-tool-option-icon",children:o.jsx(c8,{})}),o.jsxs("span",{className:"studio-tool-option-copy",children:[o.jsx("strong",{children:T.name}),o.jsx("span",{children:D?c("sessionEnvironment.includedByWorkspaces",{names:_.map(P=>P.name).join(c("sessionEnvironment.nameSeparator"))}):T.description||Xh(T.language)}),o.jsxs("small",{children:[Xh(T.language)," · ",N.environment_version_id]})]}),o.jsx("input",{type:"checkbox",checked:M,disabled:D,"aria-label":c("sessionEnvironment.selectEnvironment",{name:T.name}),onChange:()=>R(T)}),o.jsx("span",{className:"session-environment-check","aria-hidden":"true",children:o.jsx(cee,{})})]},Gl(N))})]})]})})]}),o.jsxs("footer",{className:"session-environment-dialog__footer",children:[o.jsx("span",{className:m?"is-error":"",role:m?"alert":void 0,children:m||c("sessionEnvironment.selectionSummary",{workspaces:c("sessionEnvironment.selectedWorkspaceCount",{count:y.size}),environments:c("sessionEnvironment.coveredEnvironmentCount",{count:k.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 nwt({environments:e,workspaces:t,value:n,selectedWorkspaceIds:i,loading:r,disabled:s=!1,error:a="",onChange:l,onRefresh:c}){const{t:u}=je("workspaceTools"),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[g,b]=p.useState(""),v=p.useRef(null),y=p.useMemo(()=>new Map(e.flatMap(E=>{const R=Xk(E);return R?[[Gl(R),E]]:[]})),[e]),w=p.useMemo(()=>new Map(e.map(E=>[E.id,E])),[e]),x=t.filter(E=>i.includes(E.id)),O=new Set(x.flatMap(E=>E.environmentIds)),S=n.filter(E=>!O.has(E.environment_id)),k=()=>{f(!1),requestAnimationFrame(()=>{var E;return(E=v.current)==null?void 0:E.focus()})},C=async(E,R)=>{if(l){m(!0),b("");try{await l(E,R)}catch(A){b(A instanceof Error?A.message:u("sessionEnvironment.mountFailed"))}finally{m(!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:[x.map(E=>{const R=new Set(rj(E,w).map(A=>A.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(dIe,{})}),o.jsxs("span",{className:"session-environment-item__copy",children:[o.jsx("strong",{children:E.name}),o.jsx("small",{children:u("sessionEnvironment.environmentCount",{count:R.size})})]}),l&&o.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":u("sessionEnvironment.removeWorkspace",{name:E.name}),title:u("sessionEnvironment.remove"),disabled:s||h,onClick:()=>{const A=i.filter(T=>T!==E.id),j=new Set(t.filter(T=>A.includes(T.id)).flatMap(T=>T.environmentIds));C(n.filter(T=>!R.has(T.environment_id)||j.has(T.environment_id)),A)},children:o.jsx(lee,{})})]},`workspace:${E.id}`)}),S.map(E=>{const R=y.get(Gl(E));return o.jsxs("div",{className:"session-environment-item",role:"listitem",children:[o.jsx("span",{className:"session-environment-item__icon",children:o.jsx(c8,{})}),o.jsxs("span",{className:"session-environment-item__copy",children:[o.jsx("strong",{children:(R==null?void 0:R.name)??E.environment_id}),o.jsx("small",{children:R?Xh(R.language):E.environment_version_id})]}),l&&o.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":u("sessionEnvironment.removeEnvironment",{name:(R==null?void 0:R.name)??E.environment_id}),title:u("sessionEnvironment.remove"),disabled:s||h,onClick:()=>void C(n.filter(A=>Gl(A)!==Gl(E)),[...i]),children:o.jsx(lee,{})})]},Gl(E))})]}),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(ewt,{}),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(twt,{environments:e,workspaces:t,value:n,selectedWorkspaceIds:i,loading:r,error:a,onConfirm:(E,R)=>l==null?void 0:l(E,R),onClose:k})]})}function fIe(e){return 1+e.children.reduce((t,n)=>t+fIe(n),0)}function hIe(e){return e.id||e.name}function iwt(e,t,n){const i=hIe(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 pIe(e,t,n=!0){return{...e,id:hIe(e),name:iwt(e,n,t),children:e.children.map(i=>pIe(i,t,!1))}}function mIe(e){const t=ru(),n=Zy(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(mIe)}}function rwt(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}const swt=new Set(["StudioExternalToolset"]);function owt(e){return[...new Map(e.filter(t=>t.name.trim()).map(t=>[t.name.trim(),{...t,name:t.name.trim()}])).values()]}function tA({title:e,count:t}){const{t:n}=je("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 awt({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:m=[],selectedEnvironmentWorkspaceIds:g=[],environmentsLoading:b=!1,environmentsDisabled:v=!1,environmentsError:y="",onEnvironmentsChange:w,onEnvironmentsRefresh:x}){const{t:O}=je("workspaceTools"),[S,k]=p.useState(null),[C,E]=p.useState(!1),R=p.useRef(null),A=()=>{E(!1),window.requestAnimationFrame(()=>{var F;return(F=R.current)==null?void 0:F.focus()})};if(p.useEffect(()=>{if(!C)return;const F=document.body.style.overflow,q=H=>{H.key==="Escape"&&A()};return document.body.style.overflow="hidden",document.addEventListener("keydown",q),()=>{document.body.style.overflow=F,document.removeEventListener("keydown",q)}},[C]),n&&!t)return o.jsx("aside",{className:`topo is-loading${i==="drawer"?" is-drawer":""}`,"aria-label":O("agentTopology.info"),"aria-live":"polite",children:o.jsx(mn,{as:"span",className:"topo-loading-label",duration:2.2,children:O("agentTopology.loadingInfo")})});if(!t)return null;const j=Iz(t.model),T=pIe(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:[]},O),N=rwt(t.tools).filter(F=>!swt.has(F)).map(F=>({id:`base:tool:${F}`,name:F,label:o8(F,O),custom:!1,removable:!1})),_=new Set(N.map(F=>F.name)),D=new Set(s),M=new Set(a),P=r.filter(F=>D.has(F.id)&&!_.has(F.id)).map(F=>({id:`studio:tool:${F.id}`,name:F.id,label:o8(F.id,O,F.name),custom:!0,removable:!M.has(F.id)})),L=[...N,...P],B=owt(t.skills),I=!!d,z=mIe(T),K=F=>o.jsx(gE,{draft:z,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},F);return o.jsxs(o.Fragment,{children:[o.jsxs("aside",{className:`topo${i==="drawer"?" is-drawer":""}`,"aria-label":O("agentTopology.infoAndTopology"),children:[o.jsxs("section",{className:"topo-agent-card","aria-label":O("agentTopology.info"),children:[o.jsxs("div",{className:"topo-agent-heading",children:[o.jsx("h2",{title:t.name,children:t.name||O("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":O("agentTopology.tools"),children:[o.jsx(tA,{title:O("agentTopology.tools"),count:L.length}),o.jsx("div",{className:"topo-module-scroll topo-tools-scroll",role:"region","aria-label":O("agentTopology.toolList"),tabIndex:0,children:L.length>0?o.jsx("div",{className:"topo-tool-list",children:L.map(F=>o.jsxs("div",{className:"topo-tool",title:F.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:F.label}),o.jsx("code",{children:F.name})]}),F.custom&&o.jsx("span",{className:"topo-custom-badge",children:O("agentTopology.studioTool")})]}),F.custom&&F.removable&&o.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":O("agentTopology.removeTool",{name:F.name}),title:O("agentTopology.remove"),disabled:c,onClick:()=>d==null?void 0:d(s.filter(q=>q!==F.name)),children:"×"})]},F.id))}):o.jsx("div",{className:"topo-empty",children:O("agentTopology.notConfigured")})}),I&&o.jsx("div",{className:"topo-capability-add-dock",children:o.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":O("agentTopology.addStudioTool"),disabled:c,onClick:()=>k("tool"),children:[o.jsx("span",{"aria-hidden":"true",children:"+"}),o.jsx("span",{children:O("agentTopology.addStudioToolHere")})]})})]}),o.jsxs("section",{className:"topo-module-card topo-skills-card","aria-label":O("agentTopology.skills"),children:[o.jsx(tA,{title:O("agentTopology.skills"),count:t.skillsPreviewSupported?B.length:void 0}),o.jsx("div",{className:"topo-module-scroll topo-skills-scroll",role:"region","aria-label":O("agentTopology.skillList"),tabIndex:0,children:t.skillsPreviewSupported?B.length>0?o.jsx("div",{className:"topo-skill-list",children:B.map(F=>o.jsxs("div",{className:"topo-skill",title:F.description||F.name,children:[o.jsx("div",{className:"topo-skill-title",children:o.jsx("span",{className:"topo-skill-name",children:F.name})}),F.description&&o.jsx("span",{className:"topo-skill-description",children:F.description})]},`${F.name}:${F.description}`))}):o.jsx("div",{className:"topo-empty",children:O("agentTopology.notConfigured")}):o.jsx("div",{className:"topo-empty",children:O("agentTopology.previewUnsupported")})})]}),(w||m.length>0)&&o.jsxs("section",{className:"topo-module-card topo-environment-card","aria-label":O("agentTopology.sessionEnvironment"),children:[o.jsx(tA,{title:O("agentTopology.environment"),count:m.length}),o.jsx(nwt,{environments:f,workspaces:h,value:m,selectedWorkspaceIds:g,loading:b,disabled:v,error:y,onChange:w,onRefresh:x})]}),o.jsxs("section",{className:"topo-module-card topo-topology","aria-label":O("agentTopology.agentCanvas"),children:[o.jsxs("div",{className:"topo-canvas-heading",children:[o.jsx(tA,{title:O("agentTopology.topology"),count:fIe(T)}),o.jsx("button",{ref:R,type:"button",className:"topo-canvas-expand","aria-label":O("agentTopology.viewCanvasFullscreen"),title:O("agentTopology.viewFullscreen"),onClick:()=>E(!0),children:o.jsx(ax,{"aria-hidden":"true"})})]}),o.jsx("div",{className:"topo-canvas-preview",role:"region","aria-label":O("agentTopology.executionCanvas"),children:K(`conversation-canvas:${e}`)})]})]}),S==="tool"&&d&&o.jsx(Vxt,{agentName:t.name,tools:r.filter(F=>!_.has(F.id)&&!M.has(F.id)),selectedIds:s,loading:l,disabled:c,unavailableReason:u,onChange:d,onClose:()=>k(null)})]}),C&&si.createPortal(o.jsxs("section",{className:"topo-canvas-dialog",role:"dialog","aria-modal":"true","aria-label":O("agentTopology.fullscreenExecutionCanvas"),children:[o.jsxs("header",{className:"topo-canvas-dialog-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:O("agentTopology.executionCanvas")}),o.jsx("span",{children:t.name})]}),o.jsx("button",{type:"button","aria-label":O("agentTopology.closeFullscreenCanvas"),title:O("agentTopology.close"),onClick:A,autoFocus:!0,children:o.jsx(Oa,{"aria-hidden":"true"})})]}),o.jsx("div",{className:"topo-canvas-dialog-body",children:K(`conversation-canvas-fullscreen:${e}`)})]}),document.body)]})}const KC={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};function uee(e){return o.jsxs("svg",{...KC,...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 lwt(e){return o.jsxs("svg",{...KC,...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 cwt(e){return o.jsxs("svg",{...KC,...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 eR(e){return o.jsxs("svg",{...KC,...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 gIe(e){return o.jsx("svg",{...KC,...e,children:o.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}const uwt=180,dee=500,$L=10,fee=32;function dwt(e){return Array.from(new Set(e.split(/[,,]/).map(t=>t.trim()).filter(Boolean)))}function fwt({artifact:e,busy:t,error:n,onClose:i,onSave:r}){const{t:s}=je("workspaceTools"),[a,l]=p.useState(e.name),[c,u]=p.useState(e.description??""),[d,f]=p.useState((e.tags??[]).join(",")),[h,m]=p.useState(""),g=p.useId(),b=p.useId(),v=p.useRef(null),y=p.useRef(null),w=p.useRef(t),x=p.useRef(i);p.useEffect(()=>{w.current=t,x.current=i},[t,i]),p.useEffect(()=>{var R,A;const k=document.body.style.overflow,C=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(R=y.current)==null||R.focus(),(A=y.current)==null||A.select();const E=j=>{if(j.key==="Escape"&&!w.current){j.preventDefault(),x.current();return}if(j.key!=="Tab")return;const T=v.current;if(!T)return;const N=Array.from(T.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(M=>M.getClientRects().length>0);if(N.length===0){j.preventDefault();return}const _=N[0],D=N[N.length-1];j.shiftKey&&document.activeElement===_?(j.preventDefault(),D.focus()):!j.shiftKey&&document.activeElement===D&&(j.preventDefault(),_.focus())};return window.addEventListener("keydown",E),()=>{window.removeEventListener("keydown",E),document.body.style.overflow=k,C!=null&&C.isConnected&&C.focus()}},[]);const O=k=>{var R;k.preventDefault();const C=a.trim(),E=dwt(d);if(!C){m(s("artifactEdit.nameRequired")),(R=y.current)==null||R.focus();return}if(E.length>$L){m(s("artifactEdit.tooManyTags",{max:$L}));return}if(E.some(A=>A.length>fee)){m(s("artifactEdit.tagTooLong",{max:fee}));return}m(""),r({name:C,description:c.trim(),tags:E})},S=h||n;return si.createPortal(o.jsx("div",{className:"artifact-edit-backdrop",onMouseDown:k=>{k.target===k.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(gIe,{})})]}),o.jsxs("form",{onSubmit:O,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:uwt,disabled:t,"aria-invalid":!!S||void 0,onChange:k=>{l(k.target.value),m("")}})]}),o.jsxs("label",{className:"artifact-edit-field",children:[o.jsx("span",{children:s("artifactEdit.description")}),o.jsx("textarea",{value:c,maxLength:dee,disabled:t,rows:4,placeholder:s("artifactEdit.descriptionPlaceholder"),onChange:k=>u(k.target.value)}),o.jsxs("small",{children:[c.length,"/",dee]})]}),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:$L}),onChange:k=>{f(k.target.value),m("")}})]}),S?o.jsx("div",{className:"artifact-edit-error",role:"alert",children:S}):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 bIe({label:e,menuLabel:t,items:n,placement:i="bottom-end"}){return o.jsxs(Lr,{children:[o.jsx(Lr.Trigger,{children:o.jsx(It,{type:"button",color:"secondary",variant:"ghost",size:"md",iconSize:"sm",uniform:!0,"aria-label":e,title:e,disabled:n.length===0,children:o.jsx(git,{"aria-hidden":"true"})})}),o.jsxs(Lr.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(Lr.Item,{disabled:r.disabled,onSelect:r.onSelect,children:o.jsx("span",{title:r.title,children:r.label})},r.label))]})]})}const hwt="_Alert_1tr02_1",pwt="_Content_1tr02_145",mwt="_Indicator_1tr02_156",gwt="_Message_1tr02_159",bwt="_Title_1tr02_162",ywt="_Description_1tr02_168",vwt="_Actions_1tr02_173",ib={Alert:hwt,Content:pwt,Indicator:mwt,Message:gwt,Title:bwt,Description:ywt,Actions:vwt},Ty=({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=p.useRef(null),h=p.useRef(null),[m,g]=p.useState("end"),{width:b}=EAe({ref:f});return p.useEffect(()=>{var y;const v=((y=h.current)==null?void 0:y.clientWidth)??0;if(v&&b){const w=v>b/3?"bottom":"end";g(w)}},[b]),o.jsxs("div",{ref:$C([u,f]),className:Ti(ib.Alert,l),"data-variant":t,"data-color":e,role:e==="danger"?"alert":void 0,"data-actions-placement":s??m,...d,children:[a===!1?null:o.jsx("div",{className:ib.Indicator,children:a??o.jsx(xwt,{color:e})}),o.jsxs("div",{className:ib.Content,children:[o.jsxs("div",{className:ib.Message,children:[n&&o.jsx("div",{className:ib.Title,children:n}),i&&o.jsx("div",{className:ib.Description,children:i})]}),r&&o.jsx("div",{className:Ti(ib.Actions,c),ref:h,children:r})]})]})},xwt=({color:e})=>{switch(e){case"warning":case"caution":case"danger":return o.jsx(rAe,{});case"success":return o.jsx(J2e,{});default:return o.jsx(tAe,{})}};function Yu({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}=je("shell"),f=r??d("confirm.cancel"),h=s??d("confirm.close"),m=p.useId(),g=p.useId(),b=p.useRef(null),v=p.useRef(l),y=p.useRef(c);return p.useEffect(()=>{v.current=l,y.current=c},[l,c]),p.useEffect(()=>{var S;const w=document.body.style.overflow,x=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(S=b.current)==null||S.focus();const O=k=>{k.key==="Escape"&&!v.current&&y.current()};return window.addEventListener("keydown",O),()=>{document.body.style.overflow=w,window.removeEventListener("keydown",O),x!=null&&x.isConnected&&x.focus()}},[]),si.createPortal(o.jsx("div",{className:"studio-confirm-backdrop",onMouseDown:w=>{w.target===w.currentTarget&&!l&&c()},children:o.jsxs("section",{className:`studio-confirm-dialog studio-confirm-dialog--${a}`,role:"alertdialog","aria-modal":"true","aria-labelledby":m,"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(rAe,{})}),o.jsx("h2",{id:m,children:e})]}),o.jsx(It,{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(mQ,{})})]}),o.jsxs("div",{className:"studio-confirm-body",children:[o.jsx("p",{id:g,children:t}),n?o.jsx(Ty,{className:"studio-confirm-error",color:"danger",variant:"soft",description:n}):null]}),o.jsxs("footer",{className:"studio-confirm-actions",children:[o.jsx(It,{ref:b,type:"button",color:"secondary",variant:"ghost",size:"lg",pill:!1,onClick:c,disabled:l,children:f}),o.jsx(It,{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 wwt="_Container_1a6nz_1",Owt="_Input_1a6nz_229",hee={Container:wwt,Input:Owt},fs=e=>{const t=p.useRef(null),i=`search-ui-input-${p.useId()}`,{id:r,name:s,type:a="text",variant:l="outline",size:c="md",gutterSize:u,className:d,autoComplete:f,disabled:h=!1,readOnly:m=!1,invalid:g=!1,allowAutofillExtensions:b=a==="password"||!!s||!!f&&f!=="off",onFocus:v,onBlur:y,onAnimationStart:w,onAutofill:x,autoSelect:O,startAdornment:S,endAdornment:k,pill:C,opticallyAlign:E,ref:R,...A}=e,j=D=>{const M=t.current;if(!D.target||!(D.target instanceof Element)||!M||M.contains(D.target)||D.target.closest("button, [type='button'], [role='button'], [role='menuitem']"))return;D.preventDefault(),document.activeElement!==M&&M.focus();const{left:P,top:L}=M.getBoundingClientRect(),{clientX:B,clientY:I}=D,z=I{var D;O&&((D=t.current)==null||D.select())},[O]);const _=D=>{w==null||w(D),D.animationName==="native-autofill-in"&&(x==null||x())};return o.jsxs("div",{className:Ti(hee.Container,d),"data-variant":l,"data-size":c,"data-gutter-size":u,"data-focused":T,"data-disabled":h?"":void 0,"data-readonly":m?"":void 0,"data-invalid":g?"":void 0,"data-pill":C?"":void 0,"data-optically-align":E,"data-has-start-adornment":S?"":void 0,"data-has-end-adornment":k?"":void 0,onMouseDown:j,children:[S,o.jsx("input",{...A,ref:$C([R,t]),id:r||(b?void 0:i),className:hee.Input,type:a,name:s,autoComplete:f,readOnly:m,disabled:h,onFocus:D=>{N(!0),v==null||v(D)},onBlur:D=>{N(!1),y==null||y(D)},onAnimationStart:_,"data-lpignore":b?void 0:!0,"data-1p-ignore":b?void 0:!0}),k]})},kwt="_SelectControl_1tyi7_1",Swt="_Clear_1tyi7_436",Ewt="_DropdownIcon_1tyi7_437",Cwt="_TriggerText_1tyi7_468",Twt="_IndicatorWrapper_1tyi7_476",Awt="_StartIcon_1tyi7_482",_wt="_DropdownIconChevron_1tyi7_534",jwt="_LoadingIndicator_1tyi7_537",Ch={SelectControl:kwt,Clear:Swt,DropdownIcon:Ewt,TriggerText:Cwt,IndicatorWrapper:Twt,StartIcon:Awt,DropdownIconChevron:_wt,LoadingIndicator:jwt},Nwt=({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:m=!0,loading:g,onClearClick:b,selected:v=!1,StartIcon:y,dropdownIconType:w="dropdown",...x})=>{const O=p.useRef(null),k=!!b&&v&&!g&&!a,C=w&&w!=="none"&&!g,E=k||g||C,R=!g&&!a,A=T=>{var N;switch(T.key){case"ArrowDown":case"ArrowUp":case" ":T.stopPropagation(),T.preventDefault(),r?r():(N=O.current)==null||N.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0,pointerType:"mouse"}));break;case"Enter":break;default:n==null||n(T)}},j=T=>{var N;T.button!==2&&(T.stopPropagation(),r?(T.preventDefault(),r()):(t==null||t(T),(N=x.onClick)==null||N.call(x,T)))};return o.jsxs("span",{ref:$C([O,e]),className:Ti(Ch.SelectControl,c),role:"button",tabIndex:a?-1:0,onPointerEnter:T=>{OQ(T),i==null||i(T)},onPointerDown:R?j:void 0,onKeyDown:R?A:void 0,"data-variant":u,"data-block":f?"":void 0,"data-pill":m?"":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,...x,onClick:void 0,children:[y&&o.jsx(y,{className:Ch.StartIcon}),o.jsx("span",{className:Ch.TriggerText,children:l}),E&&o.jsxs("div",{className:Ch.IndicatorWrapper,children:[k&&o.jsx(It,{"aria-label":"Clear current value",className:Ch.Clear,onPointerDown:T=>{T.stopPropagation()},onClick:T=>{T.stopPropagation(),T.preventDefault(),b()},color:"secondary",variant:C?"ghost":"solid",size:"3xs",uniform:!0,pill:m,"data-only-child":C?void 0:"",children:o.jsx(mQ,{})}),g&&o.jsx(NC,{className:Ch.LoadingIndicator}),C&&o.jsx(Rwt,{iconType:w})]})]})},Rwt=({iconType:e})=>e==="chevronDown"?o.jsx(dit,{className:Ti(Ch.DropdownIcon,Ch.DropdownIconChevron)}):o.jsx(bit,{className:Ch.DropdownIcon}),Iwt="_Menu_n4tw6_3",Pwt="_MenuList_n4tw6_5",Dwt="_MenuInner_n4tw6_50",Mwt="_OptionsList_n4tw6_64",Lwt="_Option_n4tw6_64",$wt="_PressableInner_n4tw6_111",Fwt="_OptionInner_n4tw6_113",Bwt="_OptionCheck_n4tw6_118",Uwt="_OptionIndicatorSlot_n4tw6_123",Qwt="_OptionGroupHeading_n4tw6_128",zwt="_OptionHardLimitHeading_n4tw6_140",Vwt="_OptionsLimit_n4tw6_147",Hwt="_Action_n4tw6_152",qwt="_ActionInner_n4tw6_218",Wwt="_ActionsContainer_n4tw6_224",Kwt="_Search_n4tw6_244",Gwt="_SearchEmpty_n4tw6_247",es={Menu:Iwt,MenuList:Pwt,MenuInner:Dwt,OptionsList:Mwt,Option:Lwt,PressableInner:$wt,OptionInner:Fwt,OptionCheck:Bwt,OptionIndicatorSlot:Uwt,OptionGroupHeading:Qwt,OptionHardLimitHeading:zwt,OptionsLimit:Vwt,Action:Hwt,ActionInner:qwt,ActionsContainer:Wwt,Search:Kwt,SearchEmpty:Gwt},yIe=p.createContext(null),Ig=()=>{const e=p.use(yIe);if(!e)throw new Error("Select components must be wrapped in ");return e},i1t=({label:e})=>o.jsx(o.Fragment,{children:e}),r1t=({label:e})=>o.jsx(o.Fragment,{children:e}),s1t=({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})},no=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:m="Loading...",pill:g=!0,listWidth:b,options:v,actions:y=[],side:w="bottom",avoidCollisions:x=!0,onChange:O,optionClassName:S,OptionView:k=i1t,TriggerStartIcon:C,triggerClassName:E,opticallyAlign:R,TriggerView:A,searchPlaceholder:N="",searchPredicate:T=b1t,searchEmptyMessage:j="No results found.",listMaxWidth:_="auto"}=e,I=e.block??a!=="ghost",D=e.align??(I?"center":"start"),P=e.alignOffset??(D==="center"?0:-5),L=e.listMinWidth??(I?"auto":300),B=fg((ae,Ee)=>{if(s){if(!ae.value){O([]);return}if(Ee){const Z=i.filter(te=>te!==ae.value),G=u8(v,Z);O(G)}else{const Z=u8(v,i);O(Z.concat(ae))}}else O(ae)}),M=p.useRef(T);M.current=T;const H=p.useMemo(()=>y,[y.length]),K=p.useRef(y);K.current=y;const F=p.useCallback(ae=>{var Ee;(Ee=K.current.find(Z=>Z.id===ae))==null||Ee.onSelect(ae)},[]),q=p.useMemo(()=>$z(v)?v.reduce((ae,Ee)=>ae+Ee.options.length,0):v.length,[v]),X=`select-trigger-${p.useId()}`,ne=q>15,z=p.useMemo(()=>s?{multiple:!0,value:i,TriggerView:A??s1t}:{multiple:!1,value:i,TriggerView:A??r1t},[s,i,A]),Y=p.useMemo(()=>({...z,triggerId:X,id:t,name:r,required:n,options:v,placeholder:h,loadingPlaceholder:m,loading:u,clearable:d,variant:a,pill:g,size:l,dropdownIconType:c,block:I,align:D,alignOffset:P,side:w,avoidCollisions:x,listWidth:b,listMinWidth:L,listMaxWidth:_,searchPlaceholder:N,searchEmptyMessage:j,TriggerStartIcon:C,triggerClassName:E,opticallyAlign:R,optionClassName:S,OptionView:k,actions:H,onActionSelect:F,onSelectRef:B,searchPredicateRef:M,searchable:ne,disabled:f}),[z,X,t,n,r,v,h,m,u,d,a,g,l,c,I,D,P,w,x,b,L,_,N,j,C,E,R,S,k,H,F,B,ne,f]);return o.jsx(EIe.Provider,{value:Y,children:o.jsx(a1t,{})})},o1t=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:m,dropdownIconType:g,placeholder:b,loadingPlaceholder:v,block:y,opticallyAlign:w,triggerClassName:x,TriggerStartIcon:O,TriggerView:S,onSelectRef:k}=Pg(),{onOpenChange:C,...E}=e,R=s?r[0]:r,A=l?v:b,N=p.useMemo(()=>v1t(a,R)||{value:"",label:A},[R,a,A]),T=s?r.length>0:!!r,j=l||!T,_=p.useMemo(()=>NIe(),[]),I=p.useMemo(()=>{if(!s)return{values:[],selectedAll:!1};const L=u8(a,r),B=a.flatMap(M=>"options"in M?M.options:M);return{values:L.length?L:[{value:"",label:A}],selectedAll:B.length<=r.length}},[s,a,r,A]),D=L=>{const B=L.key;if(!s&&RIe(B)){const M=_(B);L.stopPropagation();const H=IIe(a,M,R);H&&k.current(H)}},P=()=>{k.current({value:"",label:""}),C==null||C(!1)};return o.jsxs($wt,{id:t,className:x,selected:!j,variant:f,pill:h,block:y,size:m,disabled:c,loading:l,StartIcon:O,opticallyAlign:w,dropdownIconType:g,onClearClick:u?P:void 0,onInteract:C,onKeyDown:D,...E,children:[s?o.jsx(S,{...I}):o.jsx(S,{...N}),(d||n)&&o.jsx("input",{id:n,name:d,value:R,tabIndex:-1,onFocus:()=>{var L;(L=document.getElementById(t))==null||L.focus()},onChange:()=>{},required:i,className:"sr-only w-full h-0 left-0 bottom-0 pointer-events-none","aria-hidden":"true"})]})},a1t=()=>{const{triggerId:e,loading:t,side:n,align:i,alignOffset:r,avoidCollisions:s,listWidth:a,listMinWidth:l,listMaxWidth:c}=Pg(),[u,d]=p.useState(!1),f=p.useRef(null),h=m=>{const g=m===void 0?!u:m;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 LC(u,()=>{h(!1)}),o.jsxs(cje,{open:u,onOpenChange:m=>{t&&m||h(m)},modal:!1,children:[o.jsx(uje,{asChild:!0,children:o.jsx(o1t,{onOpenChange:h})}),o.jsx(dje,{forceMount:!0,children:o.jsx(Yw,{className:es.Menu,enterDuration:350,exitDuration:200,disableAnimations:!0,children:u&&o.jsx(fje,{ref:f,forceMount:!0,className:es.MenuList,side:n,sideOffset:5,align:i,alignOffset:r,avoidCollisions:s,collisionPadding:{bottom:30,top:30},onOpenAutoFocus:Kh,onCloseAutoFocus:Kh,onEscapeKeyDown:Kh,style:Gy({"select-list-width":a,"select-list-min-width":l,"select-list-max-width":c}),children:o.jsx(l1t,{onOpenChange:h})},"dropdown")})})]})},CIe=p.createContext(null),n1=()=>{const e=p.use(CIe);if(!e)throw new Error("CustomSelectMenu components must be wrapped in ");return e},l1t=({onOpenChange:e})=>{const{multiple:t,value:n,options:i,searchable:r,searchPredicateRef:s}=Pg(),a=p.useRef(()=>e(!1)),l=p.useRef(null),c=p.useRef(null),u=p.useRef(null),[d,f]=p.useState(""),[h,m]=p.useState(()=>{var R;return((t?n[0]:n)||((R=t2(i))==null?void 0:R.value))??""}),g=p.useMemo(()=>NIe(),[]),v=`select-list-${p.useId()}`,y=p.useRef(t?"":n),w=p.useMemo(()=>d.trim().toLocaleLowerCase(),[d]),x=p.useMemo(()=>y1t(i,w,s.current),[i,w,s]),O=p.useMemo(()=>t2(x),[x]),S=p.useRef(!1),k=E=>{const R=E.key,A=t?n[0]:n,N=h||(O==null?void 0:O.value)||A,T=document.activeElement===u.current,j=l.current;if(!j)return;const _=()=>{const P=new PointerEvent("pointerup",{bubbles:!0,cancelable:!0,pointerType:"mouse"}),L=Sh(h,j);L==null||L.dispatchEvent(P)},I=(P,L)=>{m(P),L.scrollIntoView({block:"nearest"})},D=()=>{const P=t?n[0]:n;if(P){const B=Sh(P,j);if(B){I(P,B);return}}const L=t2(i);if(L){const B=Sh(L.value,j);B&&I(L.value,B)}};switch(R){case"ArrowDown":{if(E.preventDefault(),!h||!Sh(h,j)){D();return}const P=x1t(h,j),L=P==null?void 0:P.getAttribute("data-option-id");P&&L&&I(L,P);return}case"ArrowUp":{if(E.preventDefault(),!h||!Sh(h,j)){D();return}const P=w1t(N,j),L=P==null?void 0:P.getAttribute("data-option-id");P&&L&&I(L,P);return}case"Enter":E.preventDefault(),_();return;case" ":if(w&&T)return;E.preventDefault(),_();return}if(RIe(R)){if(T)return;const P=g(R);E.stopPropagation();const L=IIe(i,P,h);if(L){const B=Sh(L.value,j);B&&(m(L.value),B.scrollIntoView({block:"nearest"}))}}},C=p.useMemo(()=>({valueRef:y,listId:v,highlightedValue:h,setHighlightedValue:m,requestCloseRef:a,searchTerm:d,setSearchTerm:f,searchInputRef:u,listRef:c}),[v,h,m,d,f]);return p.useEffect(()=>{MN(()=>{if(!l.current)return;const R=Sh(h,l.current);R==null||R.scrollIntoView({block:"center"})});const E=u.current||l.current;return E==null||E.focus({preventScroll:!0}),()=>{S.current=!1}},[]),p.useLayoutEffect(()=>{if(!S.current){S.current=!0;return}if(!c.current)return;c.current.scrollTop=0;const E=t2(x);E&&m(E.value)},[x]),o.jsx(CIe,{value:C,children:o.jsxs("div",{id:v,className:es.MenuInner,onKeyDown:k,ref:l,tabIndex:0,children:[r&&o.jsx(c1t,{value:d,onChange:f}),o.jsx(u1t,{filteredOptions:x}),o.jsx(m1t,{})]})})},c1t=({value:e,onChange:t})=>{const{searchPlaceholder:n}=Pg(),{listId:i,searchInputRef:r}=n1(),s=a=>{t(a.target.value)};return o.jsx("div",{className:es.Search,children:o.jsx(ms,{startAdornment:o.jsx(Pit,{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})})},GC=e=>"options"in e,$z=e=>e[0]&&GC(e[0]),px=300,u1t=({filteredOptions:e})=>{const{searchEmptyMessage:t}=Pg(),{listRef:n}=n1();if(!e.length)return typeof t=="string"?o.jsx("p",{className:es.SearchEmpty,"data-text-only":!0,children:t}):o.jsx("div",{className:es.SearchEmpty,children:t});const i=$z(e),r=!i&&e.length>px,s=i?e.map(a=>o.jsx(f1t,{...a},a.label)):e.slice(0,px).map(a=>o.jsx(AIe,{...a},a.value));return o.jsxs("div",{className:es.OptionsList,ref:n,children:[s,r&&o.jsx(TIe,{numHidden:e.length-px})]})},d1t={limit:100,label:"Show all"},f1t=({label:e,options:t,optionsLimit:n=d1t})=>{const i=p.useId(),{searchTerm:r,setHighlightedValue:s}=n1(),[a,l]=p.useState(!1),c=n.limit{l(!0),s(t[n.limit].value)};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:es.OptionGroupHeading,children:[o.jsx("div",{className:es.OptionIndicatorSlot}),e]}),d.map(h=>o.jsx(AIe,{...h},h.value)),c&&o.jsx(h1t,{value:`group-limit-${i}`,label:n.label,onPointerUp:f}),u&&o.jsx(TIe,{numHidden:t.length-px})]})},TIe=({numHidden:e})=>o.jsxs("div",{className:es.OptionHardLimitHeading,children:[o.jsx("div",{className:es.OptionIndicatorSlot}),`…and ${e.toLocaleString()} more options. Use search to refine results further.`]}),h1t=({value:e,label:t,onPointerUp:n})=>{const{highlightedValue:i,setHighlightedValue:r}=n1(),s=e===i,a=()=>{s||r(e)},l=()=>{r(c=>c!==e?c:"")};return o.jsx("div",{className:ji(es.Option,es.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:ji(es.PressableInner,es.OptionInner),children:[o.jsx("div",{className:es.OptionIndicatorSlot}),t]})})},p1t="data-option-id",AIe=e=>{const{optionClassName:t,OptionView:n,value:i,multiple:r,onSelectRef:s}=Pg(),{valueRef:a,requestCloseRef:l,highlightedValue:c,setHighlightedValue:u}=n1(),{value:d,disabled:f,tooltip:h}=e,m=a.current,g=r?i.includes(d):d===m,b=d===c,v=()=>{var x;r?s.current(e,g):(s.current(e),(x=l.current)==null||x.call(l))},y=()=>{b||u(d)},w=()=>{u(x=>x!==d?x:"")};return o.jsx("div",{className:ji(es.Option,t),"data-highlight":b?"":void 0,role:"option","aria-selected":b,"data-selected":g?"":void 0,[p1t]:d,onPointerUp:f?void 0:v,onPointerMove:f?void 0:y,onPointerLeave:f?void 0:w,"aria-disabled":f,"data-disabled":f?"":void 0,children:o.jsxs("div",{className:es.PressableInner,children:[o.jsxs("div",{className:es.OptionInner,children:[o.jsx("div",{className:es.OptionIndicatorSlot,children:g&&o.jsx(YS,{className:es.OptionCheck})}),o.jsx(n,{...e}),h&&o.jsx(yo,{content:h.content,maxWidth:h.maxWidth,side:"right",children:o.jsx(l2e,{})})]}),e.description&&o.jsxs("div",{className:es.OptionInner,children:[o.jsx("div",{className:es.OptionIndicatorSlot}),e.description]})]})})},m1t=()=>{const{actions:e}=Pg();return e.length===0?null:o.jsx("div",{className:es.ActionsContainer,children:e.map(t=>o.jsx(g1t,{...t},t.id))})},g1t=({id:e,label:t,Icon:n,className:i})=>{const{onActionSelect:r}=Pg(),{requestCloseRef:s}=n1(),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:es.Action,onPointerUp:l,onKeyDown:a,tabIndex:0,children:o.jsxs("div",{className:ji(es.ActionInner,i),children:[n&&o.jsx(n,{role:"presentation"}),t]})})},b1t=(e,t)=>e.label.toLowerCase().includes(t),y1t=(e,t,n)=>{const i=t.trim().toLocaleLowerCase();if(!i)return e;const r=s=>n(s,i);return $z(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),[])},t2=e=>{if(!e.length)return;let t;for(const n of e)if(GC(n)){const i=n.options.find(r=>!r.disabled);if(i){t=i;break}}else if(!n.disabled){t=n;break}return t},v1t=(e,t)=>{let n;for(const i of e)if(GC(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},u8=(e,t)=>{let n=[];const i=new Set(t);for(const r of e)if(GC(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},_Ie=40,Sh=(e,t)=>t.querySelector(`[data-option-id="${e}"]`),jIe=e=>e.matches("[data-option-id]:not([data-disabled])"),x1t=(e,t)=>{const n=Sh(e,t);let i=n==null?void 0:n.nextElementSibling,r=0;for(;i&&r<_Ie;){if(jIe(i))return i;i=i.nextElementSibling,r+=1}},w1t=(e,t)=>{const n=Sh(e,t);let i=n==null?void 0:n.previousElementSibling,r=0;for(;i&&r<_Ie;){if(jIe(i))return i;i=i.previousElementSibling,r+=1}},NIe=()=>{let e="",t;return n=>(n=n.toLowerCase(),e+=n,t&&clearTimeout(t),t=setTimeout(()=>{e=""},500),n.repeat(e.length)===e?n:e)},RIe=e=>/^[a-zA-Z0-9]$/.test(e),IIe=(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(GC(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 qo(...e){return e.filter(Boolean).join(" ")}const pee=[["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 O1t(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]=pee[n%pee.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 uw({seed:e,className:t}){return o.jsx("span",{className:qo("resource-card__identity-mark",t),style:O1t(e),"aria-hidden":"true"})}function k1t(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 Bf({className:e,...t}){return o.jsx("section",{className:qo("resource-page",e),...t})}function e0({title:e,description:t,className:n}){return o.jsxs("header",{className:qo("resource-page__header",n),children:[o.jsx("h1",{children:e}),t?o.jsx("p",{children:t}):null]})}function S1t({className:e,...t}){return o.jsx("div",{className:qo("resource-detail",e),...t})}function E1t({className:e,...t}){return o.jsx("header",{className:qo("resource-detail__header",e),...t})}function C1t({title:e,description:t,identitySeed:n,meta:i,backLabel:r,onBack:s}){const{t:a}=_e("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(Kit,{"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(uw,{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 T1t({className:e,...t}){return o.jsx("div",{className:qo("resource-detail__actions",e),...t})}function A1t({className:e,...t}){return o.jsx("div",{className:qo("resource-detail__body",e),...t})}function XC({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:m,children:g}){var x;const{t:b}=_e("ui"),v=!!(d!=null&&d.length),y=(x=d==null?void 0:d.find(O=>O.key===f))==null?void 0:x.content,w=h??b("resourceCollection.detailNavigation");return o.jsxs(S1t,{className:l,children:[o.jsxs(E1t,{children:[o.jsx(C1t,{title:e,description:t,identitySeed:n,meta:i,backLabel:r,onBack:s}),a?o.jsx(T1t,{className:c,children:a}):null]}),o.jsx(A1t,{className:qo(v&&"is-split",u),children:v?o.jsxs(o.Fragment,{children:[o.jsx("nav",{className:"resource-detail__navigation","aria-label":w,children:d==null?void 0:d.map(O=>o.jsx(It,{type:"button",color:"secondary",variant:O.key===f?"soft":"ghost",size:"lg",pill:!1,block:!0,"aria-current":O.key===f?"page":void 0,disabled:O.disabled,onClick:()=>m==null?void 0:m(O.key),children:o.jsx("span",{className:"resource-detail__navigation-label",children:O.label})},O.key))}),o.jsx("div",{className:"resource-detail__content",children:y})]}):g})]})}function Fz({className:e,...t}){return o.jsx("dl",{className:qo("resource-detail__summary",e),...t})}function PIe({title:e,description:t,actions:n,className:i}){return o.jsxs("header",{className:qo("resource-detail__section-header",i),children:[o.jsxs("div",{children:[o.jsx("h2",{children:e}),t?o.jsx("p",{children:t}):null]}),n]})}function Bz({rows:e,rowKey:t,rowLabel:n,columns:i,searchValue:r,onSearchChange:s,searchPlaceholder:a,searchLabel:l,toolbarActions:c,primaryAction:u,rowActions:d,scrollRef:f,onScroll:h,busy:m,footer:g,emptyLabel:b}){const{t:v}=_e("ui"),y=!!d,w=b??v("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(ms,{type:"search",value:r,onChange:x=>s(x.target.value),placeholder:a,"aria-label":l})}),c,u?o.jsx(It,{type:"button",color:"primary",disabled:u.disabled,title:u.title,onClick:u.onClick,children:u.label}):null]}),o.jsxs("div",{ref:f,className:"resource-data-table__frame","aria-busy":m||void 0,onScroll:h,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)),y?o.jsx("th",{scope:"col",className:"resource-data-table__actions-heading",children:o.jsx("span",{className:"sr-only",children:v("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+(y?1:0),children:w})}):e.map(x=>{const O=t(x),S=(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)),d?o.jsx("td",{className:"resource-data-table__actions",children:o.jsx(SIe,{label:v("resourceCollection.moreActions",{label:S}),menuLabel:v("resourceCollection.actionsFor",{label:S}),items:d(x)})}):null]},O)})})]}),g]})]})}function t0({className:e,...t}){return o.jsx("div",{className:qo("resource-toolbar",e),...t})}function n0({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,m=d[h];m&&(n(m.id),(g=document.getElementById(`${r}-${m.id}-tab`))==null||g.focus())};return o.jsx("nav",{className:qo("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 hp({className:e,...t}){return o.jsxs("label",{className:qo("resource-search",e),children:[o.jsx(k1t,{}),o.jsx("input",{type:"search",...t})]})}const _1t=150,j1t=200;function mee(e){e.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0,pointerType:"mouse",button:0}))}function hg({id:e,ariaLabel:t,value:n,options:i,onChange:r,className:s,disabled:a=!1}){const l=p.useRef(null),c=p.useRef(null),u=p.useRef(null),d=p.useRef(!1),f=p.useCallback(()=>{c.current!==null&&(window.clearTimeout(c.current),c.current=null)},[]),h=p.useCallback(()=>{u.current!==null&&(window.clearTimeout(u.current),u.current=null)},[]),m=p.useCallback(()=>{var y;return((y=l.current)==null?void 0:y.querySelector(".resource-filter-select__trigger"))??null},[]),g=p.useCallback(()=>{h();const y=m();d.current&&(y==null?void 0:y.getAttribute("data-state"))==="open"&&mee(y),d.current=!1},[h,m]),b=p.useCallback(()=>{d.current&&(h(),u.current=window.setTimeout(g,j1t))},[h,g]),v=p.useCallback(y=>{var O;if(a||!window.matchMedia("(hover: hover) and (pointer: fine)").matches)return;h();const w=m();if(!w||w.getAttribute("data-state")==="open")return;const x=document.activeElement;x instanceof HTMLElement&&x!==w&&!((O=l.current)!=null&&O.contains(x))&&x.matches("input, textarea, [contenteditable='true']")||(f(),c.current=window.setTimeout(()=>{const S=m();!S||S.getAttribute("data-state")==="open"||(d.current=!0,mee(S))},_1t))},[h,f,a,m]);return p.useEffect(()=>{const y=w=>{var C;if(!d.current)return;const x=m();if(!x||x.getAttribute("data-state")!=="open"){d.current=!1,h();return}const O=w.target;if(!(O instanceof Node))return;const S=x.getAttribute("aria-controls"),k=S?document.getElementById(S):null;if((C=l.current)!=null&&C.contains(O)||k!=null&&k.contains(O)){h();return}b()};return document.addEventListener("pointermove",y,{passive:!0}),()=>{document.removeEventListener("pointermove",y),f(),h()}},[h,f,m,b]),o.jsxs("div",{ref:l,className:qo("resource-filter-select",s),onMouseEnter:v,onMouseLeave:()=>{f(),b()},children:[o.jsx("label",{className:"sr-only",htmlFor:e,children:t}),o.jsx(no,{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 Dg=p.forwardRef(function({className:t,...n},i){return o.jsx("section",{ref:i,className:qo("resource-results",t),...n})});function Ka(){const{t:e}=_e("ui");return o.jsxs("div",{className:"resource-loading-state",role:"status","aria-live":"polite","aria-busy":"true",children:[o.jsx(NC,{size:16}),o.jsx(bn,{as:"span",duration:2.4,children:e("resourceCollection.loading")})]})}function i0({className:e,...t}){return o.jsx("div",{className:qo("resource-grid",e),...t})}function Uz({className:e,footer:t,actions:n,activateLabel:i,onActivate:r,children:s,...a}){return o.jsxs("article",{className:qo("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 rj({className:e,iconOnly:t=!1,tone:n="secondary",...i}){return o.jsx("button",{type:"button",className:qo("resource-card__action",`is-${n}`,t&&"is-icon-only",e),...i})}function d8({label:e,icon:t="arrow",tone:n="primary",className:i,children:r,title:s,...a}){const l=t==="play"?o.jsx(Rit,{}):t==="plus"?o.jsx(u2e,{}):o.jsx(mit,{});return o.jsx(rj,{className:i,iconOnly:!0,tone:n,"aria-label":e,title:s??e,...a,children:r??l})}function Qz({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 zz({children:e,title:t}){return o.jsx("p",{className:"resource-card__description",title:t,children:e})}function DIe({items:e,className:t}){return o.jsx("dl",{className:qo("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 pg({className:e,icon:t,children:n,...i}){return o.jsxs("button",{type:"button",className:qo("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 N1t=new Set(["avif","bmp","gif","heic","jpeg","jpg","png","svg","tif","tiff","webp"]),R1t=new Set(["avi","m4v","mkv","mov","mp4","mpeg","mpg","webm"]),I1t=new Set(["csv","htm","html","json","md","pdf","svg","txt","xml","yaml","yml"]);function MIe(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t+1).toLocaleLowerCase()}function nR(e,t){if(!Number.isFinite(e))return t;const n=e;return n>1e10?n:n*1e3}function P1t(e){var t,n;return((t=e.actions)==null?void 0:t.artifactDelta)??((n=e.actions)==null?void 0:n.artifact_delta)}function D1t(e){return`${e.replace(/\.pptx$/i,"")}.preview.webp`}function M1t(e){var t;return(((t=e.content)==null?void 0:t.parts)??[]).map(n=>n.functionResponse??n.function_response).filter(n=>!!n)}function L1t(e){if(!e)return{};const t=e.result;return t&&typeof t=="object"&&!Array.isArray(t)?t:e}function gee(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 $1t(e,t){const n=L1t(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:gee(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:gee(u||"generated-video",c,s),url:c,type:s,taskId:u})}return a}function bee(e,t){return new Date(nR(e,t)||Date.now()).toISOString()}function F1t(e,t){var r;const n=[],i=new Set;for(const s of e)for(const a of s.sessions){const l=nR(a.lastUpdateTime,Date.now()),c=xP(a.events,t);for(const u of a.events??[])for(const d of M1t(u)){const f=(d==null?void 0:d.name)??"";for(const h of $1t(f,d==null?void 0:d.response)){const m=`${a.id}:${u.id??""}:${f}:${h.url}`;i.has(m)||(i.add(m),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:bee(a.lastUpdateTime,l),createdAt:bee(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 LIe(e){const t=MIe(e);return N1t.has(t)?"image":R1t.has(t)?"video":"document"}function B1t(e){const t=LIe(e);return t==="image"?"image":t==="video"?"video":I1t.has(MIe(e))?"frame":"unavailable"}function U1t(e,t,n="en-US"){var r;const i=[];for(const s of e)for(const a of s.sessions){const l=nR(a.lastUpdateTime,0),c=new Map;for(const u of a.events??[]){const d=P1t(u);if(!d)continue;const f=nR(u.timestamp,l);for(const[h,m]of Object.entries(d)){if(!h||!Number.isFinite(m))continue;const g=c.get(h);(!g||m>=g.version)&&c.set(h,{filename:h,version:m,createdAt:f})}}for(const u of c.values()){if(/\.preview\.webp$/i.test(u.filename))continue;const d=c.get(D1t(u.filename)),f=d??u,h=d?"image":B1t(u.filename);i.push({id:`${s.appName}:${a.id}:${u.filename}:${u.version}`,appName:s.appName,agentId:s.agentId,sessionId:a.id,sessionTitle:xP(a.events,t),agentName:((r=s.agentName)==null?void 0:r.trim())||s.appName,sessionUpdatedAt:l,name:u.filename,version:u.version,type:LIe(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 $Ie(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 FIe(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 BL=40;function Q1t(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 z1t(e,t){return e(`artifactLibrary.types.${t}`)}function n2(e){return e instanceof Error?e.message:String(e)}function BIe({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(uee,{})}):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(uee,{})})]})})}function V1t({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(BIe,{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:FIe(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:$Ie(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(SIe,{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 H1t({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:m,toolbarFilters:g}){var Ze,he;const{t:b,i18n:v}=_e("workspaceTools"),y=v.resolvedLanguage||v.language,[w,x]=p.useState("all"),[O,S]=p.useState(""),[k,C]=p.useState(null),[E,R]=p.useState(""),[A,N]=p.useState(""),[T,j]=p.useState(""),[_,I]=p.useState(""),[D,P]=p.useState({}),[L,B]=p.useState(()=>new Set),[M,H]=p.useState(null),[K,F]=p.useState(!1),[q,Q]=p.useState(""),[X,ne]=p.useState(null),[z,Y]=p.useState(!1),[ae,Ee]=p.useState(BL),Z=p.useRef(null),G=p.useRef(null),te=p.useRef(0),de=p.useRef(null),Ce=p.useRef(null),le=p.useRef(!1),fe=p.useCallback(()=>{te.current+=1,C(null),R(""),N("")},[]),ce=p.useMemo(()=>t?[...t]:U1t(e,b("library.untitledSession"),y),[t,y,e,b]),Te=p.useMemo(()=>ce.filter(ye=>!L.has(ye.id)).map(ye=>D[ye.id]??ye),[ce,D,L]);p.useEffect(()=>()=>{te.current+=1},[]),p.useEffect(()=>()=>{E&&URL.revokeObjectURL(E)},[E]),p.useEffect(()=>{var De;if(!k)return;const ye=document.activeElement,Ae=document.body.style.overflow;document.body.style.overflow="hidden",(De=Z.current)==null||De.focus();const He=At=>{if(At.key==="Escape"){At.preventDefault(),fe();return}if(At.key!=="Tab")return;const Nt=G.current;if(!Nt)return;const Ot=Array.from(Nt.querySelectorAll('button:not([disabled]), video[controls], iframe, [tabindex]:not([tabindex="-1"])')).filter(ft=>ft.getClientRects().length>0);if(Ot.length===0){At.preventDefault();return}const vt=Ot[0],Tt=Ot[Ot.length-1];At.shiftKey&&document.activeElement===vt?(At.preventDefault(),Tt.focus()):!At.shiftKey&&document.activeElement===Tt&&(At.preventDefault(),vt.focus())};return document.addEventListener("keydown",He),()=>{document.removeEventListener("keydown",He),document.body.style.overflow=Ae,ye!=null&&ye.isConnected&&ye.focus()}},[fe,k]);const Me=async ye=>{const Ae=te.current+1;if(te.current=Ae,j(""),R(""),C(ye),ye.preview.mode!=="unavailable"){if(ye.contentUrl){R(ye.contentUrl);return}N(`preview:${ye.id}`);try{const He=await jU(ye.appName,n,ye.sessionId,ye.preview.filename,ye.preview.version);if(te.current!==Ae){URL.revokeObjectURL(He);return}R(He)}catch(He){te.current===Ae&&j(b("artifactLibrary.previewFailed",{name:ye.name,message:n2(He)}))}finally{te.current===Ae&&N("")}}},we=async ye=>{j(""),N(`download:${ye.id}`);try{d?await d(ye):await _U(ye.appName,n,ye.sessionId,ye.name,ye.version),I(b("artifactLibrary.downloadStarted",{name:ye.name}))}catch(Ae){j(b("artifactLibrary.downloadFailed",{name:ye.name,message:n2(Ae)}))}finally{N("")}},Ue=async ye=>{if(!(!M||!c)){F(!0),Q("");try{const He=await c(M,ye)??{...M,...ye,updatedAt:Date.now()};P(De=>({...De,[M.id]:He})),I(b("artifactLibrary.updated",{name:He.name})),H(null)}catch(Ae){Q(n2(Ae))}finally{F(!1)}}},ke=async()=>{if(!(!X||!u)){Y(!0),j("");try{await u(X),B(ye=>new Set([...ye,X.id])),I(b("artifactLibrary.deleted",{name:X.name})),(k==null?void 0:k.id)===X.id&&fe(),ne(null)}catch(ye){j(b("artifactLibrary.deleteFailed",{name:X.name,message:n2(ye)})),ne(null)}finally{Y(!1)}}},je=p.useMemo(()=>{const ye=O.trim().toLocaleLowerCase();return Te.filter(Ae=>{var He;return(He=Ae.origin)!=null&&He.region&&Ae.origin.region!==h||w!=="all"&&Ae.type!==w?!1:ye?[Ae.name,Ae.sessionTitle,Ae.agentName].some(De=>De.toLocaleLowerCase().includes(ye)):!0})},[w,Te,O,h]),re=p.useMemo(()=>je.slice(0,ae),[je,ae]),ve=ae{le.current||(le.current=!0,Ee(ye=>ye+BL))},[]);p.useEffect(()=>{Ee(BL)},[r,w,O,je.length]),p.useEffect(()=>{le.current=!1},[ae]),p.useEffect(()=>{const ye=Ce.current,Ae=de.current;if(!i||!ye||!Ae||!ve)return;const He=new IntersectionObserver(([De])=>{De.isIntersecting&&be()},{root:Ae,rootMargin:"240px 0px",threshold:.01});return He.observe(ye),()=>He.disconnect()},[i,ve,be,ae]);const xe=()=>{const ye=de.current;!i||!ye||!ve||ye.scrollHeight-ye.scrollTop-ye.clientHeight<=240&&be()},Ke=!!O.trim()||w!=="all"||Te.some(ye=>{var Ae;return((Ae=ye.origin)==null?void 0:Ae.region)&&ye.origin.region!==h});return o.jsxs("div",{className:"artifact-library-page resource-collection",children:[o.jsxs(t0,{className:"artifact-library-toolbar library-resource-toolbar",children:[m,o.jsxs("div",{className:"resource-toolbar__actions",children:[o.jsx(hg,{id:"artifact-type-filter",ariaLabel:b("artifactLibrary.typeFilter"),value:w,options:Q1t(b),onChange:x}),g,o.jsx(hp,{"aria-label":b("artifactLibrary.searchAria"),value:O,onChange:ye=>S(ye.target.value),placeholder:b("artifactLibrary.searchPlaceholder")})]})]}),a&&Te.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,T?o.jsxs("div",{className:"artifact-library-banner",role:"alert",children:[o.jsx("span",{children:T}),o.jsx("button",{type:"button",onClick:()=>j(""),children:b("artifactLibrary.close")})]}):null,o.jsx(Dg,{ref:de,className:"artifact-library-results","aria-label":b("artifactLibrary.listAria"),onScroll:xe,children:o.jsxs("div",{className:"artifact-library-panel",children:[s&&Te.length===0?o.jsx(Ka,{}):a&&Te.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]}):je.length===0?o.jsxs("div",{className:"artifact-library-empty",children:[o.jsx("p",{children:b(Ke?"artifactLibrary.noMatch":"artifactLibrary.noArtifacts")}),o.jsx("span",{children:b(Ke?"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:re.map(ye=>o.jsx(V1t,{artifact:ye,pendingAction:A,disabled:!n&&!t,onPreview:Ae=>void Me(Ae),onDownload:Ae=>void we(Ae),onEdit:c?Ae=>{Q(""),H(Ae)}:void 0,onDelete:u?ne:void 0,onOpenSource:f,t:b,locale:y},ye.id))})]})}),ve?o.jsx("div",{ref:Ce,className:"artifact-library-load-more",role:"status","aria-live":"polite",children:o.jsx(bn,{as:"span",duration:2.4,children:b("artifactLibrary.loadingMore")})}):null]})}),o.jsx("p",{className:"artifact-library-status","aria-live":"polite",children:_}),k?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:fe}),o.jsxs("div",{ref:G,className:"artifact-library-preview-panel",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("h2",{id:"artifact-library-preview-title",children:k.name}),o.jsx("p",{children:b("artifactLibrary.preview.meta",{type:z1t(b,k.type),version:k.version})})]}),o.jsx("button",{ref:Z,type:"button","aria-label":b("artifactLibrary.preview.close"),onClick:fe,children:o.jsx(kIe,{})})]}),o.jsxs("div",{className:"artifact-library-preview-content",children:[o.jsx("div",{className:"artifact-library-preview-canvas",children:A===`preview:${k.id}`?o.jsx(bn,{as:"span",duration:2.4,children:b("artifactLibrary.preview.loading")}):E&&k.preview.mode==="image"?o.jsx("img",{src:E,alt:b("artifactLibrary.preview.alt",{name:k.name})}):E&&k.preview.mode==="video"?o.jsx("video",{src:E,controls:!0,"aria-label":b("artifactLibrary.preview.alt",{name:k.name})}):E&&k.preview.mode==="frame"?o.jsx("iframe",{src:E,title:b("artifactLibrary.preview.alt",{name:k.name})}):o.jsxs("div",{className:"artifact-library-preview-unavailable",children:[o.jsx(BIe,{artifact:k,large:!0}),o.jsx("p",{children:b(T?"artifactLibrary.preview.loadFailed":"artifactLibrary.preview.unsupported")})]})}),o.jsxs("aside",{className:"artifact-library-preview-details","aria-label":b("artifactLibrary.preview.sourceAria"),children:[k.description?o.jsx("p",{className:"artifact-library-preview-description",children:k.description}):null,o.jsxs("dl",{children:[o.jsxs("div",{children:[o.jsx("dt",{children:b("artifactLibrary.preview.agent")}),o.jsx("dd",{title:k.agentName,children:k.agentName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:b("artifactLibrary.preview.session")}),o.jsx("dd",{title:k.sessionTitle,children:k.sessionTitle})]}),(Ze=k.origin)!=null&&Ze.toolName?o.jsxs("div",{children:[o.jsx("dt",{children:b("artifactLibrary.preview.tool")}),o.jsx("dd",{children:k.origin.toolName})]}):null,o.jsxs("div",{children:[o.jsx("dt",{children:b("artifactLibrary.preview.createdAt")}),o.jsx("dd",{children:$Ie(k.createdAt,y,b("artifactLibrary.unknownTime"))})]}),k.sizeBytes?o.jsxs("div",{children:[o.jsx("dt",{children:b("artifactLibrary.preview.fileSize")}),o.jsx("dd",{children:FIe(k.sizeBytes)})]}):null]}),(he=k.tags)!=null&&he.length?o.jsx("div",{className:"artifact-library-preview-tags","aria-label":b("artifactLibrary.preview.tags"),children:k.tags.map(ye=>o.jsx("span",{children:ye},ye))}):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 ye=k;fe(),f(ye)},children:[o.jsx(gwt,{}),b("artifactLibrary.preview.viewSession")]}):null,c?o.jsxs("button",{type:"button",className:"is-secondary",disabled:k.canManage===!1,onClick:()=>{const ye=k;fe(),Q(""),H(ye)},children:[o.jsx(tR,{}),b("artifactLibrary.edit")]}):null]}),o.jsxs("button",{type:"button",disabled:A.startsWith("download:")||!n&&!t,onClick:()=>void we(k),children:[o.jsx(mwt,{}),b("artifactLibrary.download")]})]})]})]}):null,M?o.jsx(vwt,{artifact:M,busy:K,error:q,onClose:()=>{K||H(null)},onSave:ye=>void Ue(ye)}):null,X?o.jsx(Xu,{title:b("artifactLibrary.deleteDialog.title"),description:b("artifactLibrary.deleteDialog.description",{name:X.name}),confirmLabel:b(z?"artifactLibrary.deleteDialog.deleting":"artifactLibrary.deleteDialog.confirm"),closeLabel:b("artifactLibrary.deleteDialog.close"),variant:"danger",busy:z,onCancel:()=>{z||ne(null)},onConfirm:()=>void ke()}):null]})}mn.hasResourceBundle("en-US","workspaceTools")||mn.addResourceBundle("en-US","workspaceTools",Nme,!0,!0);mn.hasResourceBundle("zh-CN","workspaceTools")||mn.addResourceBundle("zh-CN","workspaceTools",Pwe,!0,!0);function Mg(e,t={}){return mn.t(e,{...t,ns:"workspaceTools"})}function q1t(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 YC(e,t){if(e.ok)return e;let n;try{n=await e.json()}catch{n=void 0}throw new Error(q1t(n,Mg("artifactLibrary.api.withStatus",{message:t,status:e.status})))}function UL(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 UIe(e){const t=e;return{...t,createdAt:UL(t.createdAt),updatedAt:UL(t.updatedAt),sessionUpdatedAt:UL(t.sessionUpdatedAt)}}async function QIe(e){const t=await e.json();return Array.isArray(t.items)?t.items.map(UIe):[]}async function W1t(){const e=await YC(await gn("/web/artifacts"),Mg("artifactLibrary.api.listFailed"));return QIe(e)}async function K1t(e){if(e.length===0)return W1t();const t=await YC(await gn("/web/artifacts/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({candidates:e})},24e4),Mg("artifactLibrary.api.syncFailed"));return QIe(t)}async function G1t(e,t){const n=await YC(await gn(`/web/artifacts/${encodeURIComponent(e.id)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),Mg("artifactLibrary.api.updateFailed"));return UIe(await n.json())}async function X1t(e){await YC(await gn(`/web/artifacts/${encodeURIComponent(e.id)}`,{method:"DELETE"}),Mg("artifactLibrary.api.deleteFailed"))}async function Y1t(e){const n=await(await YC(await gn(`/web/artifacts/${encodeURIComponent(e.id)}/content?download=true`,{},24e4),Mg("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 zIe="KNOWLEDGE_PROVIDER_ASSOCIATION_INVALID";class XP extends Error{constructor(n,i,r={}){super(n);rn(this,"status");rn(this,"errorCode");rn(this,"requestId");rn(this,"diagnostics");rn(this,"detail");rn(this,"payload");rn(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 VIe extends Error{constructor(n){super(n.map(({region:i,error:r})=>`${i}: ${r.message||V("knowledge.loadFailed")}`).join(` +`));rn(this,"failures");this.name="KnowledgeRegionAggregateError",this.failures=n}}const Z1t=new Set(["ak","apikey","sk","accesskey","accesskeyid","authorization","authkey","clientsecret","cookie","credential","credentials","password","passwd","privatekey","secret","secretaccesskey","secretkey","securitytoken","sessiontoken","setcookie","token"]),J1t=6,yee=50,HIe=4e3;function eOt(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}function tOt(e){const t=eOt(e);return Z1t.has(t)||t.endsWith("password")||t.endsWith("secret")||t.endsWith("token")||t.endsWith("credential")}function nOt(e){return/<\s*(?:!doctype|html|head|body|script|style)\b/i.test(e)}function ok(e){if(nOt(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 f8(e,t=0,n=new WeakSet){if(e===null||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="string")return ok(e).slice(0,HIe);if(typeof e!="object")return;if(t>=J1t)return V("knowledge.depthTruncated");if(n.has(e))return V("knowledge.circularReference");if(n.add(e),Array.isArray(e))return e.slice(0,yee).map(r=>f8(r,t+1,n));const i={};return Object.entries(e).slice(0,yee).forEach(([r,s])=>{i[r]=tOt(r)?V("knowledge.redacted"):f8(s,t+1,n)}),i}function vee(e){if(e===void 0)return"";const t=f8(e);if(typeof t=="string")return t;if(t===void 0)return"";try{return JSON.stringify(t).slice(0,HIe)}catch{return V("knowledge.diagnosticsUnavailable")}}function sl(e,t){if(e instanceof VIe)return e.failures.map(({region:a,error:l})=>`${a} +${sl(l,t)}`).join(` + +`);if(!(e instanceof XP))return(e instanceof Error?ok(e.message):"")||t;const n=ok(e.message)||t,i=[Number.isFinite(e.status)?V("knowledge.statusCode",{status:e.status}):"",e.errorCode?V("knowledge.errorCode",{code:ok(e.errorCode)}):"",e.requestId?V("knowledge.requestId",{requestId:ok(e.requestId)}):""].filter(Boolean).join(" · "),r=vee(e.diagnostics),s=vee(e.detail);return[n,i,r?V("knowledge.diagnostics",{diagnostics:r}):"",s&&s!==n?V("knowledge.detail",{detail:s}):""].filter(Boolean).join(` +`)}function sj(...e){for(const t of e)if(typeof t=="string"&&t.trim())return t.trim();return""}function iOt(e){return Array.isArray(e)?e.map(t=>{const n=Yu(t),i=sj(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 rOt(e,t=!0){const n=Yu(e),i=Object.prototype.hasOwnProperty.call(n,"detail")?n.detail:typeof e=="string"?e:void 0,r=Yu(i);return{message:typeof i=="string"?t?i.trim():"":sj(r.message,n.message,iOt(i)),errorCode:sj(r.errorCode,n.errorCode),requestId:sj(r.requestId,r.request_id,r.RequestId,n.requestId,n.request_id),diagnostics:r.diagnostics??n.diagnostics,detail:i,payload:e}}function Yu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function Yi(e){return typeof e=="string"?e:""}function bE(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function Vz(e){const t=Yu(e);return{id:Yi(t.id),name:Yi(t.name),description:Yi(t.description),providerType:Yi(t.providerType),providerKnowledgeId:Yi(t.providerKnowledgeId),projectName:Yi(t.projectName),region:Yi(t.region),status:Yi(t.status),createdAt:Yi(t.createdAt),updatedAt:Yi(t.updatedAt),ownerId:Yi(t.ownerId),ownerLabel:Yi(t.ownerLabel),canManage:t.canManage===!0}}function ZC(e){const t=Yu(e);return{id:Yi(t.id),name:Yi(t.name),type:Yi(t.type),sizeBytes:bE(t.sizeBytes,0),status:Yi(t.status),url:Yi(t.url),tosPath:Yi(t.tosPath),metadata:Yu(t.metadata),createdAt:Yi(t.createdAt),updatedAt:Yi(t.updatedAt),sourceMarkdown:Yi(t.sourceMarkdown)}}function sOt(e){const t=Yu(e),n=t.attachment,i=Yu(n);return{id:Yi(t.id),title:Yi(t.title),content:Yi(t.content),attachmentUrl:Yi(t.attachmentUrl)||Yi(i.url)||Yi(i.previewUrl),attachmentType:Yi(t.attachmentType)||Yi(i.type)||Yi(i.mimeType),attachment:n,tableFields:t.tableFields}}async function Vd(e,t={},n=Ga){var f;const i=Fl(hu(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:Xa(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=rOt(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 XP(u.message||d,r.status,{errorCode:u.errorCode,requestId:u.requestId,diagnostics:u.diagnostics,detail:u.detail,payload:u.payload,rawBody:s})}function r0(e){const t=new URLSearchParams;e.trim()&&t.set("region",e.trim());const n=t.toString();return n?`?${n}`:""}async function oOt(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 Vd(`/web/knowledge-bases?${t.toString()}`,{signal:e.signal}),i=Yu(n);return{items:Array.isArray(i.items)?i.items.map(Vz):[],nextToken:Yi(i.nextToken)}}function aOt(e){return`${e.region}\0${e.id}`}async function lOt(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 oOt({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 m=h.region?h:{...h,region:d};a.set(aOt(m),m)})}),r.length===n.length)throw new VIe(r);return{items:[...a.values()],nextTokens:s,failures:r}}function cOt(e){return Vd("/web/knowledge-bases",{method:"POST",body:JSON.stringify(e)},vr).then(Vz)}function uOt(e,t,n){return Vd(`/web/knowledge-bases/${encodeURIComponent(e)}${r0(t)}`,{method:"PATCH",body:JSON.stringify(n)}).then(Vz)}function dOt(e,t){return Vd(`/web/knowledge-bases/${encodeURIComponent(e)}${r0(t)}`,{method:"DELETE"},vr)}async function fOt(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 Vd(`/web/knowledge-bases/${encodeURIComponent(e)}/documents?${n.toString()}`,{signal:t.signal}),r=Yu(i);return{items:Array.isArray(r.items)?r.items.map(ZC):[],offset:bE(r.offset,0),limit:bE(r.limit,t.limit??30),hasMore:r.hasMore===!0}}async function hOt(e,t,n){const i=new URLSearchParams({region:n.region,offset:String(n.offset??0),limit:String(n.limit??20)}),r=await Vd(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}/preview?${i.toString()}`,{signal:n.signal}),s=Yu(r);return{document:ZC(s.document),chunks:Array.isArray(s.chunks)?s.chunks.map(sOt):[],sourceMarkdown:Yi(s.sourceMarkdown),offset:bE(s.offset,0),limit:bE(s.limit,n.limit??20),hasMore:s.hasMore===!0}}function pOt(e,t,n){return Vd(`/web/knowledge-bases/${encodeURIComponent(e)}/documents${r0(t)}`,{method:"POST",body:JSON.stringify(n)},vr).then(ZC)}async function mOt(e,t,n){const i=await Vd(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/web-preview${r0(t)}`,{method:"POST",body:JSON.stringify({sourceType:"url",url:n.url})},vr),r=Yu(i);return{name:Yi(r.name),url:Yi(r.url),sourceMarkdown:Yi(r.sourceMarkdown)}}function gOt(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)),Vd(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/upload${r0(t)}`,{method:"POST",body:i},vr).then(ZC)}function bOt(e,t,n,i){return Vd(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}${r0(n)}`,{method:"PATCH",body:JSON.stringify(i)}).then(ZC)}function yOt(e,t,n){return Vd(`/web/knowledge-bases/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}${r0(n)}`,{method:"DELETE"},vr)}function s0({className:e="",title:t,status:n,description:i,metadata:r,detailAction:s,action:a,auxiliaryAction:l}){return o.jsxs(Uz,{className:`library-resource-card ${e}`.trim(),activateLabel:`${s.label} ${t}`,onActivate:s.disabled?void 0:s.onClick,footer:o.jsx(DIe,{items:r.map(c=>({label:c.label,value:c.value,title:c.title,hideLabel:!0}))}),actions:o.jsxs(o.Fragment,{children:[l?o.jsx(d8,{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(d8,{label:`${a.label} ${t}`,icon:a.icon,disabled:a.disabled,title:a.title,onClick:a.onClick}):null]}),children:[o.jsx(Qz,{leading:o.jsx(uw,{seed:t}),title:t,titleText:t,status:n}),o.jsx(zz,{title:i,children:i})]})}function jcn(){}function xee(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 qIe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const vOt=/[$_\p{ID_Start}]/u,xOt=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,wOt=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,OOt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kOt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,WIe={};function Ncn(e){return e?vOt.test(String.fromCodePoint(e)):!1}function Rcn(e,t){const i=(t||WIe).jsx?wOt:xOt;return e?i.test(String.fromCodePoint(e)):!1}function wee(e,t){return(WIe.jsx?kOt:OOt).test(e)}const SOt=/[ \t\n\f\r]/g;function EOt(e){return typeof e=="object"?e.type==="text"?Oee(e.value):!1:Oee(e)}function Oee(e){return e.replace(SOt,"")===""}let JC=class{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}};JC.prototype.normal={};JC.prototype.property={};JC.prototype.space=void 0;function KIe(e,t){const n={},i={};for(const r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new JC(n,i,t)}function yE(e){return e.toLowerCase()}class yc{constructor(t,n){this.attribute=n,this.property=t}}yc.prototype.attribute="";yc.prototype.booleanish=!1;yc.prototype.boolean=!1;yc.prototype.commaOrSpaceSeparated=!1;yc.prototype.commaSeparated=!1;yc.prototype.defined=!1;yc.prototype.mustUseProperty=!1;yc.prototype.number=!1;yc.prototype.overloadedBoolean=!1;yc.prototype.property="";yc.prototype.spaceSeparated=!1;yc.prototype.space=void 0;let COt=0;const gi=o0(),Lo=o0(),h8=o0(),Ut=o0(),Yr=o0(),mx=o0(),Dc=o0();function o0(){return 2**++COt}const p8=Object.freeze(Object.defineProperty({__proto__:null,boolean:gi,booleanish:Lo,commaOrSpaceSeparated:Dc,commaSeparated:mx,number:Ut,overloadedBoolean:h8,spaceSeparated:Yr},Symbol.toStringTag,{value:"Module"})),QL=Object.keys(p8);class Hz extends yc{constructor(t,n,i,r){let s=-1;if(super(t,n),kee(this,"space",r),typeof i=="number")for(;++s4&&n.slice(0,4)==="data"&&NOt.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(See,IOt);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!See.test(s)){let a=s.replace(jOt,ROt);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}r=Hz}return new r(i,t)}function ROt(e){return"-"+e.toLowerCase()}function IOt(e){return e.charAt(1).toUpperCase()}const eT=KIe([GIe,TOt,ZIe,JIe,ePe],"html"),Lg=KIe([GIe,AOt,ZIe,JIe,ePe],"svg");function Eee(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function tPe(e){return e.join(" ").trim()}var qz={},Cee=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,POt=/\n/g,DOt=/^\s*/,MOt=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,LOt=/^:\s*/,$Ot=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,FOt=/^[;\s]*/,BOt=/^\s+|\s+$/g,UOt=` +`,Tee="/",Aee="*",Ab="",QOt="comment",zOt="declaration";function VOt(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(POt);b&&(n+=b.length);var v=g.lastIndexOf(UOt);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(DOt)}function d(g){var b;for(g=g||[];b=f();)b!==!1&&g.push(b);return g}function f(){var g=s();if(!(Tee!=e.charAt(0)||Aee!=e.charAt(1))){for(var b=2;Ab!=e.charAt(b)&&(Aee!=e.charAt(b)||Tee!=e.charAt(b+1));)++b;if(b+=2,Ab===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:QOt,comment:v})}}function h(){var g=s(),b=c(MOt);if(b){if(f(),!c(LOt))return l("property missing ':'");var v=c($Ot),y=g({type:zOt,property:_ee(b[0].replace(Cee,Ab)),value:v?_ee(v[0].replace(Cee,Ab)):Ab});return c(FOt),y}}function m(){var g=[];d(g);for(var b;b=h();)b!==!1&&(g.push(b),d(g));return g}return u(),m()}function _ee(e){return e?e.replace(BOt,Ab):Ab}var HOt=VOt,qOt=wm&&wm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qz,"__esModule",{value:!0});qz.default=KOt;const WOt=qOt(HOt);function KOt(e,t){let n=null;if(!e||typeof e!="string")return n;const i=(0,WOt.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 ZP={};Object.defineProperty(ZP,"__esModule",{value:!0});ZP.camelCase=void 0;var GOt=/^--[a-zA-Z0-9_-]+$/,XOt=/-([a-z])/g,YOt=/^[^-]+$/,ZOt=/^-(webkit|moz|ms|o|khtml)-/,JOt=/^-(ms)-/,ekt=function(e){return!e||YOt.test(e)||GOt.test(e)},tkt=function(e,t){return t.toUpperCase()},jee=function(e,t){return"".concat(t,"-")},nkt=function(e,t){return t===void 0&&(t={}),ekt(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(JOt,jee):e=e.replace(ZOt,jee),e.replace(XOt,tkt))};ZP.camelCase=nkt;var ikt=wm&&wm.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},rkt=ikt(qz),skt=ZP;function m8(e,t){var n={};return!e||typeof e!="string"||(0,rkt.default)(e,function(i,r){i&&r&&(n[(0,skt.camelCase)(i,t)]=r)}),n}m8.default=m8;var okt=m8;const akt=_w(okt),JP=nPe("end"),Kf=nPe("start");function nPe(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 lkt(e){const t=Kf(e),n=JP(e);if(t&&n)return{start:t,end:n}}function Yk(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Nee(e.position):"start"in e||"end"in e?Nee(e):"line"in e||"column"in e?g8(e):""}function g8(e){return Ree(e&&e.line)+":"+Ree(e&&e.column)}function Nee(e){return g8(e&&e.start)+"-"+g8(e&&e.end)}function Ree(e){return e&&typeof e=="number"?e:1}class dl 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=Yk(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}}dl.prototype.file="";dl.prototype.name="";dl.prototype.reason="";dl.prototype.message="";dl.prototype.stack="";dl.prototype.column=void 0;dl.prototype.line=void 0;dl.prototype.ancestors=void 0;dl.prototype.cause=void 0;dl.prototype.fatal=void 0;dl.prototype.place=void 0;dl.prototype.ruleId=void 0;dl.prototype.source=void 0;const Wz={}.hasOwnProperty,ckt=new Map,ukt=/[A-Z]/g,dkt=new Set(["table","tbody","thead","tfoot","tr"]),fkt=new Set(["td","th"]),iPe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function hkt(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=wkt(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=xkt(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"?Lg:eT,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=rPe(r,e,void 0);return s&&typeof s!="string"?s:r.create(e,r.Fragment,{children:s||void 0},void 0)}function rPe(e,t,n){if(t.type==="element")return pkt(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return mkt(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return bkt(e,t,n);if(t.type==="mdxjsEsm")return gkt(e,t);if(t.type==="root")return ykt(e,t,n);if(t.type==="text")return vkt(e,t)}function pkt(e,t,n){const i=e.schema;let r=i;t.tagName.toLowerCase()==="svg"&&i.space==="html"&&(r=Lg,e.schema=r),e.ancestors.push(t);const s=oPe(e,t.tagName,!1),a=Okt(e,t);let l=Gz(e,t);return dkt.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!EOt(c):!0})),sPe(e,a,s,t),Kz(a,l),e.ancestors.pop(),e.schema=i,e.create(t,s,a,n)}function mkt(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)}vE(e,t.position)}function gkt(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);vE(e,t.position)}function bkt(e,t,n){const i=e.schema;let r=i;t.name==="svg"&&i.space==="html"&&(r=Lg,e.schema=r),e.ancestors.push(t);const s=t.name===null?e.Fragment:oPe(e,t.name,!0),a=kkt(e,t),l=Gz(e,t);return sPe(e,a,s,t),Kz(a,l),e.ancestors.pop(),e.schema=i,e.create(t,s,a,n)}function ykt(e,t,n){const i={};return Kz(i,Gz(e,t)),e.create(t,e.Fragment,i,n)}function vkt(e,t){return t.value}function sPe(e,t,n,i){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=i)}function Kz(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function xkt(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 wkt(e,t){return n;function n(i,r,s,a){const l=Array.isArray(s.children),c=Kf(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 Okt(e,t){const n={};let i,r;for(r in t.properties)if(r!=="children"&&Wz.call(t.properties,r)){const s=Skt(e,r,t.properties[r]);if(s){const[a,l]=s;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&fkt.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 kkt(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 vE(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 vE(e,t.position);else s=i.value===null?!0:i.value;n[r]=s}return n}function Gz(e,t){const n=[];let i=-1;const r=e.passKeys?new Map:ckt;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?(ru(e,e.length,0,t),e):t}const Dee={}.hasOwnProperty;function lPe(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 Nd(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Al=$g(/[A-Za-z]/),ll=$g(/[\dA-Za-z]/),Ikt=$g(/[#-'*+\--9=?A-Z^-~]/);function iR(e){return e!==null&&(e<32||e===127)}const b8=$g(/\d/),Pkt=$g(/[\dA-Fa-f]/),Dkt=$g(/[!-/:-@[-`{-~]/);function In(e){return e!==null&&e<-2}function Kr(e){return e!==null&&(e<0||e===32)}function Fi(e){return e===-2||e===-1||e===32}const eD=$g(new RegExp("\\p{P}|\\p{S}","u")),_y=$g(/\s/);function $g(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function r1(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 nr(e,t,n,i){const r=i?i-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(c){return Fi(c)?(e.enter(n),l(c)):t(c)}function l(c){return Fi(c)&&s++a))return;const C=t.events.length;let E=C,R,A;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){if(R){A=t.events[E][1].end;break}R=!0}for(y(i),k=C;kx;){const S=n[O];t.containerState=S[1],S[0].exit.call(t,e)}n.length=x}function w(){r.write([null]),s=void 0,r=void 0,t.containerState._closeFlow=void 0}}function Bkt(e,t,n){return nr(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function dw(e){if(e===null||Kr(e)||_y(e))return 1;if(eD(e))return 2}function tD(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};Lee(f,-c),Lee(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=Tu(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=Tu(u,[["enter",r,t],["enter",a,t],["exit",a,t],["enter",s,t]]),u=Tu(u,tD(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=Tu(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=Tu(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,ru(e,i-1,n-i+3,u),n=i+u.length-d-2;break}}for(n=-1;++n0&&Fi(k)?nr(e,w,"linePrefix",s+1)(k):w(k)}function w(k){return k===null||In(k)?e.check($ee,b,O)(k):(e.enter("codeFlowValue"),x(k))}function x(k){return k===null||In(k)?(e.exit("codeFlowValue"),w(k)):(e.consume(k),x)}function O(k){return e.exit("codeFenced"),t(k)}function S(k,C,E){let R=0;return A;function A(I){return k.enter("lineEnding"),k.consume(I),k.exit("lineEnding"),N}function N(I){return k.enter("codeFencedFence"),Fi(I)?nr(k,T,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):T(I)}function T(I){return I===l?(k.enter("codeFencedFenceSequence"),j(I)):E(I)}function j(I){return I===l?(R++,k.consume(I),j):R>=a?(k.exit("codeFencedFenceSequence"),Fi(I)?nr(k,_,"whitespace")(I):_(I)):E(I)}function _(I){return I===null||In(I)?(k.exit("codeFencedFence"),C(I)):E(I)}}}function Zkt(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 VL={name:"codeIndented",tokenize:eSt},Jkt={partial:!0,tokenize:tSt};function eSt(e,t,n){const i=this;return r;function r(u){return e.enter("codeIndented"),nr(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):In(u)?e.attempt(Jkt,a,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||In(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function tSt(e,t,n){const i=this;return r;function r(a){return i.parser.lazy[i.now().line]?n(a):In(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r):nr(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):In(a)?r(a):n(a)}}const nSt={name:"codeText",previous:rSt,resolve:iSt,tokenize:sSt};function iSt(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&&mO(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),mO(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),mO(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 pPe(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||iR(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"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(l),h(y)):y===null||y===60||In(y)?n(y):(e.consume(y),y===92?g:m)}function g(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function b(y){return!d&&(y===null||y===41||Kr(y))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(i),t(y)):d999||m===null||m===91||m===93&&!c||m===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(m):m===93?(e.exit(s),e.enter(r),e.consume(m),e.exit(r),e.exit(i),t):In(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===null||m===91||m===93||In(m)||l++>999?(e.exit("chunkString"),d(m)):(e.consume(m),c||(c=!Fi(m)),m===92?h:f)}function h(m){return m===91||m===92||m===93?(e.consume(m),l++,f):f(m)}}function gPe(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):In(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),nr(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||In(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 Zk(e,t){let n;return i;function i(r){return In(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,i):Fi(r)?nr(e,i,n?"linePrefix":"lineSuffix")(r):t(r)}}const hSt={name:"definition",tokenize:mSt},pSt={partial:!0,tokenize:gSt};function mSt(e,t,n){const i=this;let r;return s;function s(m){return e.enter("definition"),a(m)}function a(m){return mPe.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function l(m){return r=Nd(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),c):n(m)}function c(m){return Kr(m)?Zk(e,u)(m):u(m)}function u(m){return pPe(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(pSt,f,f)(m)}function f(m){return Fi(m)?nr(e,h,"whitespace")(m):h(m)}function h(m){return m===null||In(m)?(e.exit("definition"),i.parser.defined.push(r),t(m)):n(m)}}function gSt(e,t,n){return i;function i(l){return Kr(l)?Zk(e,r)(l):n(l)}function r(l){return gPe(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return Fi(l)?nr(e,a,"whitespace")(l):a(l)}function a(l){return l===null||In(l)?t(l):n(l)}}const bSt={name:"hardBreakEscape",tokenize:ySt};function ySt(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),r}function r(s){return In(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const vSt={name:"headingAtx",resolve:xSt,tokenize:wSt};function xSt(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"},ru(e,i,n-i+1,[["enter",r,t],["enter",s,t],["exit",s,t],["exit",r,t]])),e}function wSt(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||Kr(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||In(d)?(e.exit("atxHeading"),t(d)):Fi(d)?nr(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||Kr(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const OSt=["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"],Bee=["pre","script","style","textarea"],kSt={concrete:!0,name:"htmlFlow",resolveTo:CSt,tokenize:TSt},SSt={partial:!0,tokenize:_St},ESt={partial:!0,tokenize:ASt};function CSt(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 TSt(e,t,n){const i=this;let r,s,a,l,c;return u;function u(F){return d(F)}function d(F){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(F),f}function f(F){return F===33?(e.consume(F),h):F===47?(e.consume(F),s=!0,b):F===63?(e.consume(F),r=3,i.interrupt?t:M):Al(F)?(e.consume(F),a=String.fromCharCode(F),v):n(F)}function h(F){return F===45?(e.consume(F),r=2,m):F===91?(e.consume(F),r=5,l=0,g):Al(F)?(e.consume(F),r=4,i.interrupt?t:M):n(F)}function m(F){return F===45?(e.consume(F),i.interrupt?t:M):n(F)}function g(F){const q="CDATA[";return F===q.charCodeAt(l++)?(e.consume(F),l===q.length?i.interrupt?t:T:g):n(F)}function b(F){return Al(F)?(e.consume(F),a=String.fromCharCode(F),v):n(F)}function v(F){if(F===null||F===47||F===62||Kr(F)){const q=F===47,Q=a.toLowerCase();return!q&&!s&&Bee.includes(Q)?(r=1,i.interrupt?t(F):T(F)):OSt.includes(a.toLowerCase())?(r=6,q?(e.consume(F),y):i.interrupt?t(F):T(F)):(r=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(F):s?w(F):x(F))}return F===45||ll(F)?(e.consume(F),a+=String.fromCharCode(F),v):n(F)}function y(F){return F===62?(e.consume(F),i.interrupt?t:T):n(F)}function w(F){return Fi(F)?(e.consume(F),w):A(F)}function x(F){return F===47?(e.consume(F),A):F===58||F===95||Al(F)?(e.consume(F),O):Fi(F)?(e.consume(F),x):A(F)}function O(F){return F===45||F===46||F===58||F===95||ll(F)?(e.consume(F),O):S(F)}function S(F){return F===61?(e.consume(F),k):Fi(F)?(e.consume(F),S):x(F)}function k(F){return F===null||F===60||F===61||F===62||F===96?n(F):F===34||F===39?(e.consume(F),c=F,C):Fi(F)?(e.consume(F),k):E(F)}function C(F){return F===c?(e.consume(F),c=null,R):F===null||In(F)?n(F):(e.consume(F),C)}function E(F){return F===null||F===34||F===39||F===47||F===60||F===61||F===62||F===96||Kr(F)?S(F):(e.consume(F),E)}function R(F){return F===47||F===62||Fi(F)?x(F):n(F)}function A(F){return F===62?(e.consume(F),N):n(F)}function N(F){return F===null||In(F)?T(F):Fi(F)?(e.consume(F),N):n(F)}function T(F){return F===45&&r===2?(e.consume(F),D):F===60&&r===1?(e.consume(F),P):F===62&&r===4?(e.consume(F),H):F===63&&r===3?(e.consume(F),M):F===93&&r===5?(e.consume(F),B):In(F)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(SSt,K,j)(F)):F===null||In(F)?(e.exit("htmlFlowData"),j(F)):(e.consume(F),T)}function j(F){return e.check(ESt,_,K)(F)}function _(F){return e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),I}function I(F){return F===null||In(F)?j(F):(e.enter("htmlFlowData"),T(F))}function D(F){return F===45?(e.consume(F),M):T(F)}function P(F){return F===47?(e.consume(F),a="",L):T(F)}function L(F){if(F===62){const q=a.toLowerCase();return Bee.includes(q)?(e.consume(F),H):T(F)}return Al(F)&&a.length<8?(e.consume(F),a+=String.fromCharCode(F),L):T(F)}function B(F){return F===93?(e.consume(F),M):T(F)}function M(F){return F===62?(e.consume(F),H):F===45&&r===2?(e.consume(F),M):T(F)}function H(F){return F===null||In(F)?(e.exit("htmlFlowData"),K(F)):(e.consume(F),H)}function K(F){return e.exit("htmlFlow"),t(F)}}function ASt(e,t,n){const i=this;return r;function r(a){return In(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 _St(e,t,n){return i;function i(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(tT,t,n)}}const jSt={name:"htmlText",tokenize:NSt};function NSt(e,t,n){const i=this;let r,s,a;return l;function l(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),c}function c(M){return M===33?(e.consume(M),u):M===47?(e.consume(M),S):M===63?(e.consume(M),x):Al(M)?(e.consume(M),E):n(M)}function u(M){return M===45?(e.consume(M),d):M===91?(e.consume(M),s=0,g):Al(M)?(e.consume(M),w):n(M)}function d(M){return M===45?(e.consume(M),m):n(M)}function f(M){return M===null?n(M):M===45?(e.consume(M),h):In(M)?(a=f,P(M)):(e.consume(M),f)}function h(M){return M===45?(e.consume(M),m):f(M)}function m(M){return M===62?D(M):M===45?h(M):f(M)}function g(M){const H="CDATA[";return M===H.charCodeAt(s++)?(e.consume(M),s===H.length?b:g):n(M)}function b(M){return M===null?n(M):M===93?(e.consume(M),v):In(M)?(a=b,P(M)):(e.consume(M),b)}function v(M){return M===93?(e.consume(M),y):b(M)}function y(M){return M===62?D(M):M===93?(e.consume(M),y):b(M)}function w(M){return M===null||M===62?D(M):In(M)?(a=w,P(M)):(e.consume(M),w)}function x(M){return M===null?n(M):M===63?(e.consume(M),O):In(M)?(a=x,P(M)):(e.consume(M),x)}function O(M){return M===62?D(M):x(M)}function S(M){return Al(M)?(e.consume(M),k):n(M)}function k(M){return M===45||ll(M)?(e.consume(M),k):C(M)}function C(M){return In(M)?(a=C,P(M)):Fi(M)?(e.consume(M),C):D(M)}function E(M){return M===45||ll(M)?(e.consume(M),E):M===47||M===62||Kr(M)?R(M):n(M)}function R(M){return M===47?(e.consume(M),D):M===58||M===95||Al(M)?(e.consume(M),A):In(M)?(a=R,P(M)):Fi(M)?(e.consume(M),R):D(M)}function A(M){return M===45||M===46||M===58||M===95||ll(M)?(e.consume(M),A):N(M)}function N(M){return M===61?(e.consume(M),T):In(M)?(a=N,P(M)):Fi(M)?(e.consume(M),N):R(M)}function T(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),r=M,j):In(M)?(a=T,P(M)):Fi(M)?(e.consume(M),T):(e.consume(M),_)}function j(M){return M===r?(e.consume(M),r=void 0,I):M===null?n(M):In(M)?(a=j,P(M)):(e.consume(M),j)}function _(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||Kr(M)?R(M):(e.consume(M),_)}function I(M){return M===47||M===62||Kr(M)?R(M):n(M)}function D(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function P(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),L}function L(M){return Fi(M)?nr(e,B,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):B(M)}function B(M){return e.enter("htmlTextData"),a(M)}}const Zz={name:"labelEnd",resolveAll:DSt,resolveTo:MSt,tokenize:LSt},RSt={tokenize:$St},ISt={tokenize:FSt},PSt={tokenize:BSt};function DSt(e){let t=-1;const n=[];for(;++t=3&&(u===null||In(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===r?(e.consume(u),i++,c):(e.exit("thematicBreakSequence"),Fi(u)?nr(e,l,"whitespace")(u):l(u))}}const Kl={continuation:{tokenize:XSt},exit:ZSt,name:"list",tokenize:GSt},WSt={partial:!0,tokenize:JSt},KSt={partial:!0,tokenize:YSt};function GSt(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(m){const g=i.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!i.containerState.marker||m===i.containerState.marker:b8(m)){if(i.containerState.type||(i.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(oj,n,u)(m):u(m);if(!i.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(m)}return n(m)}function c(m){return b8(m)&&++a<10?(e.consume(m),c):(!i.interrupt||a<2)&&(i.containerState.marker?m===i.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||m,e.check(tT,i.interrupt?n:d,e.attempt(WSt,h,f))}function d(m){return i.containerState.initialBlankLine=!0,s++,h(m)}function f(m){return Fi(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),h):n(m)}function h(m){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function XSt(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(tT,r,s);function r(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,nr(e,t,"listItemIndent",i.containerState.size+1)(l)}function s(l){return i.containerState.furtherBlankLines||!Fi(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(KSt,t,a)(l))}function a(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,nr(e,e.attempt(Kl,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function YSt(e,t,n){const i=this;return nr(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 ZSt(e){e.exit(this.containerState.type)}function JSt(e,t,n){const i=this;return nr(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!Fi(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Uee={name:"setextUnderline",resolveTo:eEt,tokenize:tEt};function eEt(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 tEt(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"),Fi(u)?nr(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||In(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const nEt={tokenize:iEt};function iEt(e){const t=this,n=e.attempt(tT,i,e.attempt(this.parser.constructs.flowInitial,r,nr(e,e.attempt(this.parser.constructs.flow,r,e.attempt(lSt,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 rEt={resolveAll:yPe()},sEt=bPe("string"),oEt=bPe("text");function bPe(e){return{resolveAll:yPe(e==="text"?aEt: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 xEt(e,t){let n=-1;const i=[];let r;for(;++n0){const it=Se.tokenStack[Se.tokenStack.length-1];(it[1]||zee).call(Se,void 0,it[0])}for(fe.position={start:Yp(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:Yp(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},qe=-1;++qe0&&(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 TEt(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function AEt(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _Et(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=r1(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 jEt(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 NEt(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function pPe(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 REt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return pPe(e,t);const r={src:r1(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 IEt(e,t){const n={src:r1(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 PEt(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 DEt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return pPe(e,t);const r={href:r1(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 MEt(e,t){const n={href:r1(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 LEt(e,t,n){const i=e.all(t),r=n?$Et(n):mPe(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){const Ze=be.tokenStack[be.tokenStack.length-1];(Ze[1]||zee).call(be,void 0,Ze[0])}for(ve.position={start:Zp(re.length>0?re[0][1].start:{line:1,column:1,offset:0}),end:Zp(re.length>0?re[re.length-2][1].end:{line:1,column:1,offset:0})},Ke=-1;++Ke0&&(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 PEt(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DEt(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function MEt(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),r=r1(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 LEt(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 $Et(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function wPe(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 FEt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return wPe(e,t);const r={src:r1(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 BEt(e,t){const n={src:r1(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 UEt(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 QEt(e,t){const n=String(t.identifier).toUpperCase(),i=e.definitionById.get(n);if(!i)return wPe(e,t);const r={href:r1(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 zEt(e,t){const n={href:r1(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 VEt(e,t,n){const i=e.all(t),r=n?HEt(n):OPe(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(;++l1}function FEt(e,t){const n={},i=e.all(t);let r=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++r0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Kf(t.children[1]),c=ZP(t.children[t.children.length-1]);l&&c&&(a.position={start:l,end:c}),r.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function VEt(e,t,n){const i=n?n.children:void 0,s=(i?i.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,l=a?a.length:t.children.length;let c=-1;const u=[];for(;++c0,!0),i[0]),r=i.index+i[0].length,i=n.exec(t);return s.push(qee(t.slice(r),r>0,!1)),s.join("")}function qee(e,t,n){let i=0,r=e.length;if(t){let s=e.codePointAt(i);for(;s===Vee||s===Hee;)i++,s=e.codePointAt(i)}if(n){let s=e.codePointAt(r-1);for(;s===Vee||s===Hee;)r--,s=e.codePointAt(r-1)}return r>i?e.slice(i,r):""}function WEt(e,t){const n={type:"text",value:qEt(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function KEt(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const GEt={blockquote:SEt,break:EEt,code:CEt,delete:TEt,emphasis:AEt,footnoteReference:_Et,heading:jEt,html:NEt,imageReference:REt,image:IEt,inlineCode:PEt,linkReference:DEt,link:MEt,listItem:LEt,list:FEt,paragraph:BEt,root:UEt,strong:QEt,table:zEt,tableCell:HEt,tableRow:VEt,text:WEt,thematicBreak:KEt,toml:rA,yaml:rA,definition:rA,footnoteDefinition:rA};function rA(){}const gPe=-1,tD=0,Jk=1,iR=2,Jz=3,eV=4,tV=5,nV=6,bPe=7,yPe=8,XEt=typeof self=="object"?self:globalThis,Wee=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new XEt[e](t)},YEt=(e,t)=>{const n=(r,s)=>(e.set(s,r),r),i=r=>{if(e.has(r))return e.get(r);const[s,a]=t[r];switch(s){case tD:case gPe:return n(a,r);case Jk:{const l=n([],r);for(const c of a)l.push(i(c));return l}case iR:{const l=n({},r);for(const[c,u]of a)l[i(c)]=i(u);return l}case Jz:return n(new Date(a),r);case eV:{const{source:l,flags:c}=a;return n(new RegExp(l,c),r)}case tV:{const l=n(new Map,r);for(const[c,u]of a)l.set(i(c),i(u));return l}case nV:{const l=n(new Set,r);for(const c of a)l.add(i(c));return l}case bPe:{const{name:l,message:c}=a;return n(Wee(l,c),r)}case yPe:return n(BigInt(a),r);case"BigInt":return n(Object(BigInt(a)),r);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(Wee(s,a),r)};return i},Kee=e=>YEt(new Map,e)(0),V0="",{toString:ZEt}={},{keys:JEt}=Object,gO=e=>{const t=typeof e;if(t!=="object"||!e)return[tD,t];const n=ZEt.call(e).slice(8,-1);switch(n){case"Array":return[Jk,V0];case"Object":return[iR,V0];case"Date":return[Jz,V0];case"RegExp":return[eV,V0];case"Map":return[tV,V0];case"Set":return[nV,V0];case"DataView":return[Jk,n]}return n.includes("Array")?[Jk,n]:n.includes("Error")?[bPe,n]:[iR,n]},sA=([e,t])=>e===tD&&(t==="function"||t==="symbol"),eCt=(e,t,n,i)=>{const r=(a,l)=>{const c=i.push(a)-1;return n.set(l,c),c},s=a=>{if(n.has(a))return n.get(a);let[l,c]=gO(a);switch(l){case tD:{let d=a;switch(c){case"bigint":l=yPe,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return r([gPe],a)}return r([l,d],a)}case Jk:{if(c){let h=a;return c==="DataView"?h=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(a)),r([c,[...h]],a)}const d=[],f=r([l,d],a);for(const h of a)d.push(s(h));return f}case iR:{if(c)switch(c){case"BigInt":return r([c,a.toString()],a);case"Boolean":case"Number":case"String":return r([c,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const d=[],f=r([l,d],a);for(const h of JEt(a))(e||!sA(gO(a[h])))&&d.push([s(h),s(a[h])]);return f}case Jz:return r([l,a.toISOString()],a);case eV:{const{source:d,flags:f}=a;return r([l,{source:d,flags:f}],a)}case tV:{const d=[],f=r([l,d],a);for(const[h,m]of a)(e||!(sA(gO(h))||sA(gO(m))))&&d.push([s(h),s(m)]);return f}case nV:{const d=[],f=r([l,d],a);for(const h of a)(e||!sA(gO(h)))&&d.push(s(h));return f}}const{message:u}=a;return r([l,{name:c,message:u}],a)};return s},Gee=(e,{json:t,lossy:n}={})=>{const i=[];return eCt(!(t||n),!!t,new Map,i)(e),i},fw=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Kee(Gee(e,t)):structuredClone(e):(e,t)=>Kee(Gee(e,t));function tCt(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function nCt(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function iCt(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||tCt,i=e.options.footnoteBackLabel||nCt,r=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&g.push({type:"text",value:" "});let w=typeof n=="string"?n:n(c,m);typeof w=="string"&&(w={type:"text",value:w}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(c,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...g)}else d.push(...g);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...fw(a),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:` +`});const u={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,u),e.applyData(t,u)}function HEt(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let i=-1;for(;!t&&++i1}function qEt(e,t){const n={},i=e.all(t);let r=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++r0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Kf(t.children[1]),c=JP(t.children[t.children.length-1]);l&&c&&(a.position={start:l,end:c}),r.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function YEt(e,t,n){const i=n?n.children:void 0,s=(i?i.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,l=a?a.length:t.children.length;let c=-1;const u=[];for(;++c0,!0),i[0]),r=i.index+i[0].length,i=n.exec(t);return s.push(qee(t.slice(r),r>0,!1)),s.join("")}function qee(e,t,n){let i=0,r=e.length;if(t){let s=e.codePointAt(i);for(;s===Vee||s===Hee;)i++,s=e.codePointAt(i)}if(n){let s=e.codePointAt(r-1);for(;s===Vee||s===Hee;)r--,s=e.codePointAt(r-1)}return r>i?e.slice(i,r):""}function eCt(e,t){const n={type:"text",value:JEt(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function tCt(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const nCt={blockquote:NEt,break:REt,code:IEt,delete:PEt,emphasis:DEt,footnoteReference:MEt,heading:LEt,html:$Et,imageReference:FEt,image:BEt,inlineCode:UEt,linkReference:QEt,link:zEt,listItem:VEt,list:qEt,paragraph:WEt,root:KEt,strong:GEt,table:XEt,tableCell:ZEt,tableRow:YEt,text:eCt,thematicBreak:tCt,toml:i2,yaml:i2,definition:i2,footnoteDefinition:i2};function i2(){}const kPe=-1,nD=0,Jk=1,rR=2,Jz=3,eV=4,tV=5,nV=6,SPe=7,EPe=8,iCt=typeof self=="object"?self:globalThis,Wee=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new iCt[e](t)},rCt=(e,t)=>{const n=(r,s)=>(e.set(s,r),r),i=r=>{if(e.has(r))return e.get(r);const[s,a]=t[r];switch(s){case nD:case kPe:return n(a,r);case Jk:{const l=n([],r);for(const c of a)l.push(i(c));return l}case rR:{const l=n({},r);for(const[c,u]of a)l[i(c)]=i(u);return l}case Jz:return n(new Date(a),r);case eV:{const{source:l,flags:c}=a;return n(new RegExp(l,c),r)}case tV:{const l=n(new Map,r);for(const[c,u]of a)l.set(i(c),i(u));return l}case nV:{const l=n(new Set,r);for(const c of a)l.add(i(c));return l}case SPe:{const{name:l,message:c}=a;return n(Wee(l,c),r)}case EPe:return n(BigInt(a),r);case"BigInt":return n(Object(BigInt(a)),r);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(Wee(s,a),r)};return i},Kee=e=>rCt(new Map,e)(0),H0="",{toString:sCt}={},{keys:oCt}=Object,gO=e=>{const t=typeof e;if(t!=="object"||!e)return[nD,t];const n=sCt.call(e).slice(8,-1);switch(n){case"Array":return[Jk,H0];case"Object":return[rR,H0];case"Date":return[Jz,H0];case"RegExp":return[eV,H0];case"Map":return[tV,H0];case"Set":return[nV,H0];case"DataView":return[Jk,n]}return n.includes("Array")?[Jk,n]:n.includes("Error")?[SPe,n]:[rR,n]},r2=([e,t])=>e===nD&&(t==="function"||t==="symbol"),aCt=(e,t,n,i)=>{const r=(a,l)=>{const c=i.push(a)-1;return n.set(l,c),c},s=a=>{if(n.has(a))return n.get(a);let[l,c]=gO(a);switch(l){case nD:{let d=a;switch(c){case"bigint":l=EPe,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return r([kPe],a)}return r([l,d],a)}case Jk:{if(c){let h=a;return c==="DataView"?h=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(a)),r([c,[...h]],a)}const d=[],f=r([l,d],a);for(const h of a)d.push(s(h));return f}case rR:{if(c)switch(c){case"BigInt":return r([c,a.toString()],a);case"Boolean":case"Number":case"String":return r([c,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const d=[],f=r([l,d],a);for(const h of oCt(a))(e||!r2(gO(a[h])))&&d.push([s(h),s(a[h])]);return f}case Jz:return r([l,a.toISOString()],a);case eV:{const{source:d,flags:f}=a;return r([l,{source:d,flags:f}],a)}case tV:{const d=[],f=r([l,d],a);for(const[h,m]of a)(e||!(r2(gO(h))||r2(gO(m))))&&d.push([s(h),s(m)]);return f}case nV:{const d=[],f=r([l,d],a);for(const h of a)(e||!r2(gO(h)))&&d.push(s(h));return f}}const{message:u}=a;return r([l,{name:c,message:u}],a)};return s},Gee=(e,{json:t,lossy:n}={})=>{const i=[];return aCt(!(t||n),!!t,new Map,i)(e),i},fw=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Kee(Gee(e,t)):structuredClone(e):(e,t)=>Kee(Gee(e,t));function lCt(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function cCt(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function uCt(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||lCt,i=e.options.footnoteBackLabel||cCt,r=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&g.push({type:"text",value:" "});let w=typeof n=="string"?n:n(c,m);typeof w=="string"&&(w={type:"text",value:w}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof i=="string"?i:i(c,m),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...g)}else d.push(...g);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...fw(a),id:"footnote-label"},children:[{type:"text",value:r}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` -`}]}}const nT=function(e){if(e==null)return aCt;if(typeof e=="function")return nD(e);if(typeof e=="object")return Array.isArray(e)?rCt(e):sCt(e);if(typeof e=="string")return oCt(e);throw new Error("Expected function, string, or object as test")};function rCt(e){const t=[];let n=-1;for(;++n":""))+")"})}return h;function h(){let m=vPe,g,b,v;if((!t||s(c,u,d[d.length-1]||void 0))&&(m=dCt(n(c,d)),m[0]===v8))return m;if("children"in c&&c.children){const y=c;if(y.children&&m[0]!==uCt)for(b=(i?y.children.length:-1)+a,v=d.concat(y);b>-1&&b":""))+")"})}return h;function h(){let m=CPe,g,b,v;if((!t||s(c,u,d[d.length-1]||void 0))&&(m=yCt(n(c,d)),m[0]===v8))return m;if("children"in c&&c.children){const y=c;if(y.children&&m[0]!==bCt)for(b=(i?y.children.length:-1)+a,v=d.concat(y);b>-1&&b0&&n.push({type:"text",value:` -`}),n}function Xee(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Yee(e,t){const n=hCt(e,t),i=n.one(e,void 0),r=iCt(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&s.children.push({type:"text",value:` -`},r),s}function yCt(e,t){return e&&"run"in e?async function(n,i){const r=Yee(n,{file:i,...t});await e.run(r,i)}:function(n,i){return Yee(n,{file:i,...e||t})}}function Zee(e){if(e)throw e}var lj=Object.prototype.hasOwnProperty,wPe=Object.prototype.toString,Jee=Object.defineProperty,ete=Object.getOwnPropertyDescriptor,tte=function(t){return typeof Array.isArray=="function"?Array.isArray(t):wPe.call(t)==="[object Array]"},nte=function(t){if(!t||wPe.call(t)!=="[object Object]")return!1;var n=lj.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&lj.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;var r;for(r in t);return typeof r>"u"||lj.call(t,r)},ite=function(t,n){Jee&&n.name==="__proto__"?Jee(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},rte=function(t,n){if(n==="__proto__")if(lj.call(t,n)){if(ete)return ete(t,n).value}else return;return t[n]},vCt=function e(){var t,n,i,r,s,a,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});ca.length;let c;l&&a.push(r);try{c=e.apply(this,a)}catch(u){const d=u;if(l&&n)throw d;return r(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(s,r):c instanceof Error?r(c):s(c))}function r(a,...l){n||(n=!0,t(a,...l))}function s(a){r(null,a)}}const df={basename:OCt,dirname:kCt,extname:SCt,join:ECt,sep:"/"};function OCt(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');rT(e);let n=0,i=-1,r=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else i<0&&(s=!0,i=r+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let a=-1,l=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else a<0&&(s=!0,a=r+1),l>-1&&(e.codePointAt(r)===t.codePointAt(l--)?l<0&&(i=r):(l=-1,i=a));return n===i?i=a:i<0&&(i=e.length),e.slice(n,i)}function kCt(e){if(rT(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function SCt(e){rT(e);let t=e.length,n=-1,i=0,r=-1,s=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){i=t+1;break}continue}n<0&&(a=!0,n=t+1),l===46?r<0?r=t:s!==1&&(s=1):r>-1&&(s=-1)}return r<0||n<0||s===0||s===1&&r===n-1&&r===i+1?"":e.slice(r,n)}function ECt(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function TCt(e,t){let n="",i=0,r=-1,s=0,a=-1,l,c;for(;++a<=e.length;){if(a2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",i=0):(n=n.slice(0,c),i=n.length-1-n.lastIndexOf("/")),r=a,s=0;continue}}else if(n.length>0){n="",i=0,r=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(r+1,a):n=e.slice(r+1,a),i=a-r-1;r=a,s=0}else l===46&&s>-1?s++:s=-1}return n}function rT(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ACt={cwd:_Ct};function _Ct(){return"/"}function O8(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function jCt(e){if(typeof e=="string")e=new URL(e);else if(!O8(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return NCt(e)}function NCt(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n0){let[m,...g]=d;const b=i[h][1];w8(b)&&w8(m)&&(m=HL(!0,b,m)),i[h]=[u,m,...g]}}}}const DCt=new iV().freeze();function GL(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function XL(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function YL(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ote(e){if(!w8(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ate(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function oA(e){return MCt(e)?e:new OPe(e)}function MCt(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function LCt(e){return typeof e=="string"||$Ct(e)}function $Ct(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const FCt="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",lte=[],cte={allowDangerousHtml:!0},BCt=/^(https?|ircs?|mailto|xmpp)$/i,UCt=[{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 kPe(e){const t=QCt(e),n=zCt(e);return VCt(t.runSync(t.parse(n),n),e)}function QCt(e){const t=e.rehypePlugins||lte,n=e.remarkPlugins||lte,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...cte}:cte;return DCt().use(kEt).use(n).use(yCt,i).use(t)}function zCt(e){const t=e.children||"",n=new OPe;return typeof t=="string"&&(n.value=t),n}function VCt(e,t){const n=t.allowedElements,i=t.allowElement,r=t.components,s=t.disallowedElements,a=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||HCt;for(const d of UCt)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+FCt+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),iT(e,u),okt(e,{Fragment:o.Fragment,components:r,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return a?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let m;for(m in QL)if(Object.hasOwn(QL,m)&&Object.hasOwn(d.properties,m)){const g=d.properties[m],b=QL[m];(b===null||b.includes(d.tagName))&&(d.properties[m]=c(String(g||""),m,d))}}if(d.type==="element"){let m=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!m&&i&&typeof f=="number"&&(m=!i(d,f,h)),m&&h&&typeof f=="number")return l&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function HCt(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),r=e.indexOf("/");return t===-1||r!==-1&&t>r||n!==-1&&t>n||i!==-1&&t>i||BCt.test(e.slice(0,t))?e:""}function ute(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(t);for(;r!==-1;)i++,r=n.indexOf(t,r+t.length);return i}function qCt(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function WCt(e,t,n){const r=nT((n||{}).ignore||[]),s=KCt(t);let a=-1;for(;++a0?{type:"text",value:k}:void 0),k===!1?h.lastIndex=O+1:(g!==O&&w.push({type:"text",value:u.value.slice(g,O)}),Array.isArray(k)?w.push(...k):k&&w.push(k),g=O+x[0].length,y=!0),!h.global)break;x=h.exec(u.value)}return y?(g?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const r=ute(e,"(");let s=ute(e,")");for(;i!==-1&&r>s;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),s++;return[e,n]}function SPe(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Ay(n)||JP(n))&&(!t||n!==47)}EPe.peek=bTt;function cTt(){this.buffer()}function uTt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function dTt(){this.buffer()}function fTt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function hTt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=jd(this.sliceSerialize(e)).toLowerCase(),n.label=t}function pTt(e){this.exit(e)}function mTt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=jd(this.sliceSerialize(e)).toLowerCase(),n.label=t}function gTt(e){this.exit(e)}function bTt(){return"["}function EPe(e,t,n,i){const r=n.createTracker(i);let s=r.move("[^");const a=n.enter("footnoteReference"),l=n.enter("reference");return s+=r.move(n.safe(n.associationId(e),{after:"]",before:s})),l(),a(),s+=r.move("]"),s}function yTt(){return{enter:{gfmFootnoteCallString:cTt,gfmFootnoteCall:uTt,gfmFootnoteDefinitionLabelString:dTt,gfmFootnoteDefinition:fTt},exit:{gfmFootnoteCallString:hTt,gfmFootnoteCall:pTt,gfmFootnoteDefinitionLabelString:mTt,gfmFootnoteDefinition:gTt}}}function vTt(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:EPe},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,s,a){const l=s.createTracker(a);let c=l.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return c+=l.move(s.safe(s.associationId(i),{before:c,after:"]"})),d(),c+=l.move("]:"),i.children&&i.children.length>0&&(l.shift(4),c+=l.move((t?` -`:" ")+s.indentLines(s.containerFlow(i,l.current()),t?CPe:xTt))),u(),c}}function xTt(e,t,n){return t===0?e:CPe(e,t,n)}function CPe(e,t,n){return(n?"":" ")+e}const wTt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];TPe.peek=CTt;function OTt(){return{canContainEols:["delete"],enter:{strikethrough:STt},exit:{strikethrough:ETt}}}function kTt(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:wTt}],handlers:{delete:TPe}}}function STt(e){this.enter({type:"delete",children:[]},e)}function ETt(e){this.exit(e)}function TPe(e,t,n,i){const r=n.createTracker(i),s=n.enter("strikethrough");let a=r.move("~~");return a+=n.containerPhrasing(e,{...r.current(),before:a,after:"~"}),a+=r.move("~~"),s(),a}function CTt(){return"~"}function TTt(e){return e.length}function ATt(e,t){const n=t||{},i=(n.align||[]).concat(),r=n.stringLength||TTt,s=[],a=[],l=[],c=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++yc[y])&&(c[y]=x)}b.push(w)}a[d]=b,l[d]=v}let f=-1;if(typeof i=="object"&&"length"in i)for(;++fc[f]&&(c[f]=w),m[f]=w),h[f]=x}a.splice(1,0,h),l.splice(1,0,m),d=-1;const g=[];for(;++d "),s.shift(2);const a=n.indentLines(n.containerFlow(e,s.current()),NTt);return r(),a}function NTt(e,t,n){return">"+(n?"":" ")+e}function RTt(e,t){return hte(e,t.inConstruct,!0)&&!hte(e,t.notInConstruct,!1)}function hte(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++ia&&(a=s):s=1,r=i+t.length,i=n.indexOf(t,r);return a}function PTt(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function DTt(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function MTt(e,t,n,i){const r=DTt(n),s=e.value||"",a=r==="`"?"GraveAccent":"Tilde";if(PTt(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(s,LTt);return f(),h}const l=n.createTracker(i),c=r.repeat(Math.max(ITt(s,r)+1,3)),u=n.enter("codeFenced");let d=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${a}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${a}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:` +`}),n}function Xee(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Yee(e,t){const n=xCt(e,t),i=n.one(e,void 0),r=uCt(n),s=Array.isArray(i)?{type:"root",children:i}:i||{type:"root",children:[]};return r&&s.children.push({type:"text",value:` +`},r),s}function ECt(e,t){return e&&"run"in e?async function(n,i){const r=Yee(n,{file:i,...t});await e.run(r,i)}:function(n,i){return Yee(n,{file:i,...e||t})}}function Zee(e){if(e)throw e}var aj=Object.prototype.hasOwnProperty,APe=Object.prototype.toString,Jee=Object.defineProperty,ete=Object.getOwnPropertyDescriptor,tte=function(t){return typeof Array.isArray=="function"?Array.isArray(t):APe.call(t)==="[object Array]"},nte=function(t){if(!t||APe.call(t)!=="[object Object]")return!1;var n=aj.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&aj.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;var r;for(r in t);return typeof r>"u"||aj.call(t,r)},ite=function(t,n){Jee&&n.name==="__proto__"?Jee(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},rte=function(t,n){if(n==="__proto__")if(aj.call(t,n)){if(ete)return ete(t,n).value}else return;return t[n]},CCt=function e(){var t,n,i,r,s,a,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});ca.length;let c;l&&a.push(r);try{c=e.apply(this,a)}catch(u){const d=u;if(l&&n)throw d;return r(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(s,r):c instanceof Error?r(c):s(c))}function r(a,...l){n||(n=!0,t(a,...l))}function s(a){r(null,a)}}const ff={basename:_Ct,dirname:jCt,extname:NCt,join:RCt,sep:"/"};function _Ct(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');rT(e);let n=0,i=-1,r=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else i<0&&(s=!0,i=r+1);return i<0?"":e.slice(n,i)}if(t===e)return"";let a=-1,l=t.length-1;for(;r--;)if(e.codePointAt(r)===47){if(s){n=r+1;break}}else a<0&&(s=!0,a=r+1),l>-1&&(e.codePointAt(r)===t.codePointAt(l--)?l<0&&(i=r):(l=-1,i=a));return n===i?i=a:i<0&&(i=e.length),e.slice(n,i)}function jCt(e){if(rT(e),e.length===0)return".";let t=-1,n=e.length,i;for(;--n;)if(e.codePointAt(n)===47){if(i){t=n;break}}else i||(i=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function NCt(e){rT(e);let t=e.length,n=-1,i=0,r=-1,s=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){i=t+1;break}continue}n<0&&(a=!0,n=t+1),l===46?r<0?r=t:s!==1&&(s=1):r>-1&&(s=-1)}return r<0||n<0||s===0||s===1&&r===n-1&&r===i+1?"":e.slice(r,n)}function RCt(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function PCt(e,t){let n="",i=0,r=-1,s=0,a=-1,l,c;for(;++a<=e.length;){if(a2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",i=0):(n=n.slice(0,c),i=n.length-1-n.lastIndexOf("/")),r=a,s=0;continue}}else if(n.length>0){n="",i=0,r=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(r+1,a):n=e.slice(r+1,a),i=a-r-1;r=a,s=0}else l===46&&s>-1?s++:s=-1}return n}function rT(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const DCt={cwd:MCt};function MCt(){return"/"}function O8(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function LCt(e){if(typeof e=="string")e=new URL(e);else if(!O8(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return $Ct(e)}function $Ct(e){if(e.hostname!==""){const i=new TypeError('File URL host must be "localhost" or empty on darwin');throw i.code="ERR_INVALID_FILE_URL_HOST",i}const t=e.pathname;let n=-1;for(;++n0){let[m,...g]=d;const b=i[h][1];w8(b)&&w8(m)&&(m=qL(!0,b,m)),i[h]=[u,m,...g]}}}}const QCt=new iV().freeze();function XL(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function YL(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ZL(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ote(e){if(!w8(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ate(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function s2(e){return zCt(e)?e:new _Pe(e)}function zCt(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function VCt(e){return typeof e=="string"||HCt(e)}function HCt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const qCt="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",lte=[],cte={allowDangerousHtml:!0},WCt=/^(https?|ircs?|mailto|xmpp)$/i,KCt=[{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 jPe(e){const t=GCt(e),n=XCt(e);return YCt(t.runSync(t.parse(n),n),e)}function GCt(e){const t=e.rehypePlugins||lte,n=e.remarkPlugins||lte,i=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...cte}:cte;return QCt().use(jEt).use(n).use(ECt,i).use(t)}function XCt(e){const t=e.children||"",n=new _Pe;return typeof t=="string"&&(n.value=t),n}function YCt(e,t){const n=t.allowedElements,i=t.allowElement,r=t.components,s=t.disallowedElements,a=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||ZCt;for(const d of KCt)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+qCt+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),iT(e,u),hkt(e,{Fragment:o.Fragment,components:r,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return a?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let m;for(m in zL)if(Object.hasOwn(zL,m)&&Object.hasOwn(d.properties,m)){const g=d.properties[m],b=zL[m];(b===null||b.includes(d.tagName))&&(d.properties[m]=c(String(g||""),m,d))}}if(d.type==="element"){let m=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!m&&i&&typeof f=="number"&&(m=!i(d,f,h)),m&&h&&typeof f=="number")return l&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function ZCt(e){const t=e.indexOf(":"),n=e.indexOf("?"),i=e.indexOf("#"),r=e.indexOf("/");return t===-1||r!==-1&&t>r||n!==-1&&t>n||i!==-1&&t>i||WCt.test(e.slice(0,t))?e:""}function ute(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(t);for(;r!==-1;)i++,r=n.indexOf(t,r+t.length);return i}function JCt(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function eTt(e,t,n){const r=nT((n||{}).ignore||[]),s=tTt(t);let a=-1;for(;++a0?{type:"text",value:k}:void 0),k===!1?h.lastIndex=O+1:(g!==O&&w.push({type:"text",value:u.value.slice(g,O)}),Array.isArray(k)?w.push(...k):k&&w.push(k),g=O+x[0].length,y=!0),!h.global)break;x=h.exec(u.value)}return y?(g?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],i=n.indexOf(")");const r=ute(e,"(");let s=ute(e,")");for(;i!==-1&&r>s;)e+=n.slice(0,i+1),n=n.slice(i+1),i=n.indexOf(")"),s++;return[e,n]}function NPe(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||_y(n)||eD(n))&&(!t||n!==47)}RPe.peek=STt;function gTt(){this.buffer()}function bTt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function yTt(){this.buffer()}function vTt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function xTt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Nd(this.sliceSerialize(e)).toLowerCase(),n.label=t}function wTt(e){this.exit(e)}function OTt(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Nd(this.sliceSerialize(e)).toLowerCase(),n.label=t}function kTt(e){this.exit(e)}function STt(){return"["}function RPe(e,t,n,i){const r=n.createTracker(i);let s=r.move("[^");const a=n.enter("footnoteReference"),l=n.enter("reference");return s+=r.move(n.safe(n.associationId(e),{after:"]",before:s})),l(),a(),s+=r.move("]"),s}function ETt(){return{enter:{gfmFootnoteCallString:gTt,gfmFootnoteCall:bTt,gfmFootnoteDefinitionLabelString:yTt,gfmFootnoteDefinition:vTt},exit:{gfmFootnoteCallString:xTt,gfmFootnoteCall:wTt,gfmFootnoteDefinitionLabelString:OTt,gfmFootnoteDefinition:kTt}}}function CTt(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:RPe},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(i,r,s,a){const l=s.createTracker(a);let c=l.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return c+=l.move(s.safe(s.associationId(i),{before:c,after:"]"})),d(),c+=l.move("]:"),i.children&&i.children.length>0&&(l.shift(4),c+=l.move((t?` +`:" ")+s.indentLines(s.containerFlow(i,l.current()),t?IPe:TTt))),u(),c}}function TTt(e,t,n){return t===0?e:IPe(e,t,n)}function IPe(e,t,n){return(n?"":" ")+e}const ATt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];PPe.peek=ITt;function _Tt(){return{canContainEols:["delete"],enter:{strikethrough:NTt},exit:{strikethrough:RTt}}}function jTt(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ATt}],handlers:{delete:PPe}}}function NTt(e){this.enter({type:"delete",children:[]},e)}function RTt(e){this.exit(e)}function PPe(e,t,n,i){const r=n.createTracker(i),s=n.enter("strikethrough");let a=r.move("~~");return a+=n.containerPhrasing(e,{...r.current(),before:a,after:"~"}),a+=r.move("~~"),s(),a}function ITt(){return"~"}function PTt(e){return e.length}function DTt(e,t){const n=t||{},i=(n.align||[]).concat(),r=n.stringLength||PTt,s=[],a=[],l=[],c=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++yc[y])&&(c[y]=x)}b.push(w)}a[d]=b,l[d]=v}let f=-1;if(typeof i=="object"&&"length"in i)for(;++fc[f]&&(c[f]=w),m[f]=w),h[f]=x}a.splice(1,0,h),l.splice(1,0,m),d=-1;const g=[];for(;++d "),s.shift(2);const a=n.indentLines(n.containerFlow(e,s.current()),$Tt);return r(),a}function $Tt(e,t,n){return">"+(n?"":" ")+e}function FTt(e,t){return hte(e,t.inConstruct,!0)&&!hte(e,t.notInConstruct,!1)}function hte(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++ia&&(a=s):s=1,r=i+t.length,i=n.indexOf(t,r);return a}function UTt(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function QTt(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function zTt(e,t,n,i){const r=QTt(n),s=e.value||"",a=r==="`"?"GraveAccent":"Tilde";if(UTt(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(s,VTt);return f(),h}const l=n.createTracker(i),c=r.repeat(Math.max(BTt(s,r)+1,3)),u=n.enter("codeFenced");let d=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${a}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${a}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:` `,encode:["`"],...l.current()})),f()}return d+=l.move(` `),s&&(d+=l.move(s+` -`)),d+=l.move(c),u(),d}function LTt(e,t,n){return(n?"":" ")+e}function rV(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function $Tt(e,t,n,i){const r=rV(n),s=r==='"'?"Quote":"Apostrophe",a=n.enter("definition");let l=n.enter("label");const c=n.createTracker(i);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":` -`,...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),a(),u}function FTt(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function xE(e){return"&#x"+e.toString(16).toUpperCase()+";"}function rR(e,t,n){const i=dw(e),r=dw(t);return i===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}_Pe.peek=BTt;function _Pe(e,t,n,i){const r=FTt(n),s=n.enter("emphasis"),a=n.createTracker(i),l=a.move(r);let c=a.move(n.containerPhrasing(e,{after:r,before:l,...a.current()}));const u=c.charCodeAt(0),d=rR(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=xE(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=rR(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+xE(f));const m=a.move(r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function BTt(e,t,n){return n.options.emphasis||"*"}function UTt(e,t){let n=!1;return iT(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,v8}),!!((!e.depth||e.depth<3)&&Xz(e)&&(t.options.setext||n))}function QTt(e,t,n,i){const r=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(i);if(UTt(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:` +`)),d+=l.move(c),u(),d}function VTt(e,t,n){return(n?"":" ")+e}function rV(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function HTt(e,t,n,i){const r=rV(n),s=r==='"'?"Quote":"Apostrophe",a=n.enter("definition");let l=n.enter("label");const c=n.createTracker(i);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":` +`,...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),a(),u}function qTt(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function xE(e){return"&#x"+e.toString(16).toUpperCase()+";"}function sR(e,t,n){const i=dw(e),r=dw(t);return i===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}MPe.peek=WTt;function MPe(e,t,n,i){const r=qTt(n),s=n.enter("emphasis"),a=n.createTracker(i),l=a.move(r);let c=a.move(n.containerPhrasing(e,{after:r,before:l,...a.current()}));const u=c.charCodeAt(0),d=sR(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=xE(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=sR(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+xE(f));const m=a.move(r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function WTt(e,t,n){return n.options.emphasis||"*"}function KTt(e,t){let n=!1;return iT(e,function(i){if("value"in i&&/\r?\n|\r/.test(i.value)||i.type==="break")return n=!0,v8}),!!((!e.depth||e.depth<3)&&Xz(e)&&(t.options.setext||n))}function GTt(e,t,n,i){const r=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(i);if(KTt(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:` `,after:` `});return f(),d(),h+` `+(r===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(` `))+1))}const a="#".repeat(r),l=n.enter("headingAtx"),c=n.enter("phrasing");s.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:` -`,...s.current()});return/^[\t ]/.test(u)&&(u=xE(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),l(),u}jPe.peek=zTt;function jPe(e){return e.value||""}function zTt(){return"<"}NPe.peek=VTt;function NPe(e,t,n,i){const r=rV(n),s=r==='"'?"Quote":"Apostrophe",a=n.enter("image");let l=n.enter("label");const c=n.createTracker(i);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),u+=c.move(")"),a(),u}function VTt(){return"!"}RPe.peek=HTt;function RPe(e,t,n,i){const r=e.referenceType,s=n.enter("imageReference");let a=n.enter("label");const l=n.createTracker(i);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,s(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function HTt(){return"!"}IPe.peek=qTt;function IPe(e,t,n){let i=e.value||"",r="`",s=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++s\u007F]/.test(e.url))}DPe.peek=WTt;function DPe(e,t,n,i){const r=rV(n),s=r==='"'?"Quote":"Apostrophe",a=n.createTracker(i);let l,c;if(PPe(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),l(),n.stack=d,f}l=n.enter("link"),c=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(c=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=n.enter(`title${s}`),u+=a.move(" "+r),u+=a.move(n.safe(e.title,{before:u,after:r,...a.current()})),u+=a.move(r),c()),u+=a.move(")"),l(),u}function WTt(e,t,n){return PPe(e,n)?"<":"["}MPe.peek=KTt;function MPe(e,t,n,i){const r=e.referenceType,s=n.enter("linkReference");let a=n.enter("label");const l=n.createTracker(i);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,s(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function KTt(){return"["}function sV(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function GTt(e){const t=sV(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function XTt(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function LPe(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function YTt(e,t,n,i){const r=n.enter("list"),s=n.bulletCurrent;let a=e.ordered?XTt(n):sV(n);const l=e.ordered?a==="."?")":".":GTt(n);let c=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),LPe(n)===a&&d){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let a=s.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const l=n.createTracker(i);l.move(s+" ".repeat(a-s.length)),l.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.current()),d);return c(),u;function d(f,h,m){return h?(m?"":" ".repeat(a))+f:(m?s:s+" ".repeat(a-s.length))+f}}function e2t(e,t,n,i){const r=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(e,i);return s(),r(),a}const t2t=nT(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function n2t(e,t,n,i){return(e.children.some(function(a){return t2t(a)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function i2t(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}$Pe.peek=r2t;function $Pe(e,t,n,i){const r=i2t(n),s=n.enter("strong"),a=n.createTracker(i),l=a.move(r+r);let c=a.move(n.containerPhrasing(e,{after:r,before:l,...a.current()}));const u=c.charCodeAt(0),d=rR(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=xE(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=rR(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+xE(f));const m=a.move(r+r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function r2t(e,t,n){return n.options.strong||"*"}function s2t(e,t,n,i){return n.safe(e.value,i)}function o2t(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function a2t(e,t,n){const i=(LPe(n)+(n.options.ruleSpaces?" ":"")).repeat(o2t(n));return n.options.ruleSpaces?i.slice(0,-1):i}const FPe={blockquote:jTt,break:pte,code:MTt,definition:$Tt,emphasis:_Pe,hardBreak:pte,heading:QTt,html:jPe,image:NPe,imageReference:RPe,inlineCode:IPe,link:DPe,linkReference:MPe,list:YTt,listItem:JTt,paragraph:e2t,root:n2t,strong:$Pe,text:s2t,thematicBreak:a2t};function l2t(){return{enter:{table:c2t,tableData:mte,tableHeader:mte,tableRow:d2t},exit:{codeText:f2t,table:u2t,tableData:t3,tableHeader:t3,tableRow:t3}}}function c2t(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function u2t(e){this.exit(e),this.data.inTable=void 0}function d2t(e){this.enter({type:"tableRow",children:[]},e)}function t3(e){this.exit(e)}function mte(e){this.enter({type:"tableCell",children:[]},e)}function f2t(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,h2t));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function h2t(e,t){return t==="|"?t:e}function p2t(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,r=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,...s.current()});return/^[\t ]/.test(u)&&(u=xE(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),l(),u}LPe.peek=XTt;function LPe(e){return e.value||""}function XTt(){return"<"}$Pe.peek=YTt;function $Pe(e,t,n,i){const r=rV(n),s=r==='"'?"Quote":"Apostrophe",a=n.enter("image");let l=n.enter("label");const c=n.createTracker(i);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),l()),u+=c.move(")"),a(),u}function YTt(){return"!"}FPe.peek=ZTt;function FPe(e,t,n,i){const r=e.referenceType,s=n.enter("imageReference");let a=n.enter("label");const l=n.createTracker(i);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,s(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function ZTt(){return"!"}BPe.peek=JTt;function BPe(e,t,n){let i=e.value||"",r="`",s=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(i);)r+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++s\u007F]/.test(e.url))}QPe.peek=eAt;function QPe(e,t,n,i){const r=rV(n),s=r==='"'?"Quote":"Apostrophe",a=n.createTracker(i);let l,c;if(UPe(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),l(),n.stack=d,f}l=n.enter("link"),c=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(c=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=n.enter(`title${s}`),u+=a.move(" "+r),u+=a.move(n.safe(e.title,{before:u,after:r,...a.current()})),u+=a.move(r),c()),u+=a.move(")"),l(),u}function eAt(e,t,n){return UPe(e,n)?"<":"["}zPe.peek=tAt;function zPe(e,t,n,i){const r=e.referenceType,s=n.enter("linkReference");let a=n.enter("label");const l=n.createTracker(i);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,s(),r==="full"||!u||u!==f?c+=l.move(f+"]"):r==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function tAt(){return"["}function sV(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function nAt(e){const t=sV(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function iAt(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function VPe(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function rAt(e,t,n,i){const r=n.enter("list"),s=n.bulletCurrent;let a=e.ordered?iAt(n):sV(n);const l=e.ordered?a==="."?")":".":nAt(n);let c=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),VPe(n)===a&&d){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let a=s.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const l=n.createTracker(i);l.move(s+" ".repeat(a-s.length)),l.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.current()),d);return c(),u;function d(f,h,m){return h?(m?"":" ".repeat(a))+f:(m?s:s+" ".repeat(a-s.length))+f}}function aAt(e,t,n,i){const r=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(e,i);return s(),r(),a}const lAt=nT(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function cAt(e,t,n,i){return(e.children.some(function(a){return lAt(a)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function uAt(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}HPe.peek=dAt;function HPe(e,t,n,i){const r=uAt(n),s=n.enter("strong"),a=n.createTracker(i),l=a.move(r+r);let c=a.move(n.containerPhrasing(e,{after:r,before:l,...a.current()}));const u=c.charCodeAt(0),d=sR(i.before.charCodeAt(i.before.length-1),u,r);d.inside&&(c=xE(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=sR(i.after.charCodeAt(0),f,r);h.inside&&(c=c.slice(0,-1)+xE(f));const m=a.move(r+r);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function dAt(e,t,n){return n.options.strong||"*"}function fAt(e,t,n,i){return n.safe(e.value,i)}function hAt(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function pAt(e,t,n){const i=(VPe(n)+(n.options.ruleSpaces?" ":"")).repeat(hAt(n));return n.options.ruleSpaces?i.slice(0,-1):i}const qPe={blockquote:LTt,break:pte,code:zTt,definition:HTt,emphasis:MPe,hardBreak:pte,heading:GTt,html:LPe,image:$Pe,imageReference:FPe,inlineCode:BPe,link:QPe,linkReference:zPe,list:rAt,listItem:oAt,paragraph:aAt,root:cAt,strong:HPe,text:fAt,thematicBreak:pAt};function mAt(){return{enter:{table:gAt,tableData:mte,tableHeader:mte,tableRow:yAt},exit:{codeText:vAt,table:bAt,tableData:n3,tableHeader:n3,tableRow:n3}}}function gAt(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function bAt(e){this.exit(e),this.data.inTable=void 0}function yAt(e){this.enter({type:"tableRow",children:[]},e)}function n3(e){this.exit(e)}function mte(e){this.enter({type:"tableCell",children:[]},e)}function vAt(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,xAt));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function xAt(e,t){return t==="|"?t:e}function wAt(e){const t=e||{},n=t.tableCellPadding,i=t.tablePipeAlign,r=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:c,tableRow:l}};function a(m,g,b,v){return u(d(m,b,v),m.align)}function l(m,g,b,v){const y=f(m,b,v),w=u([y]);return w.slice(0,w.indexOf(` -`))}function c(m,g,b,v){const y=b.enter("tableCell"),w=b.enter("phrasing"),x=b.containerPhrasing(m,{...v,before:s,after:s});return w(),y(),x}function u(m,g){return ATt(m,{align:g,alignDelimiters:i,padding:n,stringLength:r})}function d(m,g,b){const v=m.children;let y=-1;const w=[],x=g.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const R2t={tokenize:B2t,partial:!0};function I2t(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:L2t,continuation:{tokenize:$2t},exit:F2t}},text:{91:{name:"gfmFootnoteCall",tokenize:M2t},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:P2t,resolveTo:D2t}}}}function P2t(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=jd(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 D2t(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 M2t(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||Kr(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return r.includes(jd(i.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Kr(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 L2t(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||Kr(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return s=jd(i.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Kr(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),Zi(e,m,"gfmFootnoteDefinitionWhitespace")):n(g)}function m(g){return t(g)}}function $2t(e,t,n){return e.check(tT,t,e.attempt(R2t,t,n))}function F2t(e){e.exit("gfmFootnoteDefinition")}function B2t(e,t,n){const i=this;return Zi(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 U2t(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++,m);if(f<2&&!n)return c(g);const v=a.exit("strikethroughSequenceTemporary"),y=dw(g);return v._open=!y||y===2&&!!b,v._close=!b||b===2&&!!y,l(g)}}}class Q2t{constructor(){this.map=[]}add(t,n,i){z2t(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 z2t(e,t,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r-1;){const _=i.events[j][1].type;if(_==="lineEnding"||_==="linePrefix")j--;else break}const T=j>-1?i.events[j][1].type:null,N=T==="tableHead"||T==="tableRow"?k:c;return N===k&&i.parser.lazy[i.now().line]?n(A):N(A)}function c(A){return e.enter("tableHead"),e.enter("tableRow"),u(A)}function u(A){return A===124||(a=!0,s+=1),d(A)}function d(A){return A===null?n(A):In(A)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),m):n(A):Di(A)?Zi(e,d,"whitespace")(A):(s+=1,a&&(a=!1,r+=1),A===124?(e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(A)))}function f(A){return A===null||A===124||Kr(A)?(e.exit("data"),d(A)):(e.consume(A),A===92?h:f)}function h(A){return A===92||A===124?(e.consume(A),f):f(A)}function m(A){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(A):(e.enter("tableDelimiterRow"),a=!1,Di(A)?Zi(e,g,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):g(A))}function g(A){return A===45||A===58?v(A):A===124?(a=!0,e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),b):S(A)}function b(A){return Di(A)?Zi(e,v,"whitespace")(A):v(A)}function v(A){return A===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(A),e.exit("tableDelimiterMarker"),y):A===45?(s+=1,y(A)):A===null||In(A)?O(A):S(A)}function y(A){return A===45?(e.enter("tableDelimiterFiller"),w(A)):S(A)}function w(A){return A===45?(e.consume(A),w):A===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(A),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(A))}function x(A){return Di(A)?Zi(e,O,"whitespace")(A):O(A)}function O(A){return A===124?g(A):A===null||In(A)?!a||r!==s?S(A):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(A)):S(A)}function S(A){return n(A)}function k(A){return e.enter("tableRow"),C(A)}function C(A){return A===124?(e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),C):A===null||In(A)?(e.exit("tableRow"),t(A)):Di(A)?Zi(e,C,"whitespace")(A):(e.enter("data"),E(A))}function E(A){return A===null||A===124||Kr(A)?(e.exit("data"),C(A)):(e.consume(A),A===92?R:E)}function R(A){return A===92||A===124?(e.consume(A),E):E(A)}}function W2t(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 Q2t;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({},cv(t.events,r)),e.add(r,0,[["exit",s,t]]),s=void 0),s}function bte(e,t,n,i,r){const s=[],a=cv(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 cv(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const K2t={name:"tasklistCheck",tokenize:X2t};function G2t(){return{text:{91:K2t}}}function X2t(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 Kr(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 In(c)?t(c):Di(c)?e.check({tokenize:Y2t},t,n)(c):n(c)}}function Y2t(e,t,n){return Zi(e,i,"whitespace");function i(r){return r===null?n(r):t(r)}}function Z2t(e){return tPe([k2t(),I2t(),U2t(e),H2t(),G2t()])}const J2t={};function KPe(e){const t=this,n=e||J2t,i=t.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),a=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(Z2t(n)),s.push(v2t()),a.push(x2t(n))}const yte=function(e,t,n){const i=nT(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 XPe(e,t,n){return e.type==="element"?aAt(e,t,n):e.type==="text"?n.whitespace==="normal"?YPe(e,n):lAt(e):[]}function aAt(e,t,n){const i=ZPe(e,n),r=e.children||[];let s=-1,a=[];if(sAt(e))return a;let l,c;for(S8(e)||Ote(e)&&yte(t,e,Ote)?c=` -`:rAt(e)?(l=2,c=2):GPe(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},m=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"],O={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},S={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},k=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:k.concat([{begin:/\(/,end:/\)/,keywords:O,contains:k.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+a+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:O,relevance:0},{begin:m,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:O,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:O,illegal:"",keywords:O,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function pAt(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=hAt(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 iD(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"],m=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._-]+)+/},w=["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"],O=["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"],S=["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:[...w,...x,"set","shopt",...O,...S]},contains:[m,e.SHEBANG(),g,f,s,a,y,l,c,u,d,n]}}function mAt(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},m=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],w={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:"("+a+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:v,relevance:0},{begin:m,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 gAt(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},m=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"],O={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},S={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},k=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:k.concat([{begin:/\(/,end:/\)/,keywords:O,contains:k.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+a+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:O,relevance:0},{begin:m,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:O,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:O,illegal:"",keywords:O,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function bAt(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},m=e.inherit(h,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,m]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},v=e.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});h.contains=[b,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],m.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]},w={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},x=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",O={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,w,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,w,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+x+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,w],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]},O]}}const yAt=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_-]*/}}),vAt=["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"],xAt=["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"],wAt=[...vAt,...xAt],OAt=["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(),kAt=["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(),SAt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),EAt=["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 eDe(e){const t=e.regex,n=yAt(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:":("+kAt.join("|")+")"},{begin:":(:)?("+SAt.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+EAt.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:OAt.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+wAt.join("|")+")\\b"}]}}function tDe(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 nDe(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:"iDe(e,t,n-1))}function rDe(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+iDe("(?:<"+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,kte,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},kte,u]}}const Ste="[A-Za-z$_][0-9A-Za-z$_]*",TAt=["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"],AAt=["true","false","null","undefined","NaN","Infinity"],sDe=["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"],oDe=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],aDe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],_At=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],jAt=[].concat(aDe,sDe,oDe);function cV(e){const t=e.regex,n=(L,{after:B})=>{const I="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,B)=>{const I=L[0].length+L.index,z=L.input[I];if(z==="<"||z===","){B.ignoreMatch();return}z===">"&&(n(L,{after:I})||B.ignoreMatch());let K;const F=L.input.substring(I);if(K=F.match(/^\s*=/)){B.ignoreMatch();return}if((K=F.match(/^\s+extends\s+/))&&K.index===0){B.ignoreMatch();return}}},l={$pattern:Ste,keyword:TAt,literal:AAt,built_in:jAt,"variable.language":_At},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:[]},m={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]},w={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const O=[].concat(w,h.contains),S=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(O)}]),k={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},C={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"}}]},E={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:{_:[...sDe,...oDe]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},A={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[k],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function T(L){return t.concat("(?!",L.join("|"),")")}const N={match:t.concat(/\b/,T([...aDe,"super","import"].map(L=>`${L}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},_={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},D={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},k]},M="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(M)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[k]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:E},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,w,{match:/\$\d+/},f,E,{scope:"attr",match:i+t.lookahead(":"),relevance:0},P,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,e.REGEXP_MODE,{className:"function",begin:M,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:S}]}]},{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"]}]}]},A,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[k,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},_,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[k]},N,j,C,D,{match:/\$[(.]/}]}}function uV(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 dv="[0-9](_*[0-9])*",uA=`\\.(${dv})`,dA="[0-9a-fA-F](_*[0-9a-fA-F])*",NAt={className:"number",variants:[{begin:`(\\b(${dv})((${uA})|\\.)?|(${uA}))[eE][+-]?(${dv})[fFdD]?\\b`},{begin:`\\b(${dv})((${uA})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${uA})[fFdD]?\\b`},{begin:`\\b(${dv})[fFdD]\\b`},{begin:`\\b0[xX]((${dA})\\.?|(${dA})?\\.(${dA}))[pP][+-]?(${dv})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${dA})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function RAt(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=NAt,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 IAt=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_-]*/}}),PAt=["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"],DAt=["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"],MAt=[...PAt,...DAt],LAt=["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(),lDe=["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(),cDe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),$At=["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(),FAt=lDe.concat(cDe).sort().reverse();function BAt(e){const t=IAt(e),n=FAt,i="and or not only",r="[\\w-]+",s="("+r+"|@\\{"+r+"\\})",a=[],l=[],c=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},u=function(x,O,S){return{className:x,begin:O,relevance:S}},d={$pattern:/[a-z-]+/,keyword:i,attribute:LAt.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}),m={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("+$At.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,m,u("keyword","all\\b"),u("variable","@\\{"+r+"\\}"),{begin:"\\b("+MAt.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:":("+lDe.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+cDe.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},w={begin:r+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,v,w,g,y,m,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function UAt(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 dV(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 m=[n,c];return[u,d,f,h].forEach(y=>{y.contains=y.contains.concat(m)}),m=m.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:m},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:m}]}]},n,s,u,d,{className:"quote",begin:"^>\\s+",contains:m,end:"$"},r,i,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function QAt(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 zAt(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 w=y==="\\1"?y:t.concat(y,v);return t.concat(t.concat("(?:",b,")"),v,/(?:\\.|[^\\\/])*?/,w,/(?:\\.|[^\\\/])*?/,y,i)},m=(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:m("(?:m|qr)?",/\//,/\//)},{begin:m("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:m("m|qr",/\(/,/\)/)},{begin:m("m|qr",/\[/,/\]/)},{begin:m("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 VAt(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":(_,D)=>{D.data._beginMatch=_[1]||_[2]},"on:end":(_,D)=>{D.data._beginMatch!==_[1]&&D.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),m=`[ -]`,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"],w=["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"],O={keyword:y,literal:(_=>{const D=[];return _.forEach(M=>{D.push(M),M.toLowerCase()===M?D.push(M.toUpperCase()):D.push(M.toLowerCase())}),D})(v),built_in:w},S=_=>_.map(D=>D.replace(/\|\d+$/,"")),k={variants:[{match:[/new/,t.concat(m,"+"),t.concat("(?!",S(w).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},C=t.concat(i,"\\b(?!\\()"),E={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),C],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),C],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"}}]},R={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},A={relevance:0,begin:/\(/,end:/\)/,keywords:O,contains:[R,a,E,e.C_BLOCK_COMMENT_MODE,g,b,k]},j={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",S(y).join("\\b|"),"|",S(w).join("\\b|"),"\\b)"),i,t.concat(m,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[A]};A.contains.push(j);const T=[R,E,e.C_BLOCK_COMMENT_MODE,g,b,k],N={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",...T]},...T,{scope:"meta",variants:[{match:r},{match:s}]}]};return{case_insensitive:!1,keywords:O,contains:[N,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,E,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},k,{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:O,contains:["self",N,a,E,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 HAt(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 uDe(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function hV(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])*",m=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,g=`\\b|${i.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${m}))[eE][+-]?(${h})[jJ]?(?=${g})`},{begin:`(${m})[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 qAt(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function WAt(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 KAt(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",m="[0-9](_?[0-9])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${m}))?([eE][+-]?(${m})|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}]},k=[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=k,b.contains=k;const A=[{begin:/^\s*=>/,starts:{end:"$",contains:k}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:k}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(A).concat(u).concat(k)}}function dDe(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 GAt=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_-]*/}}),XAt=["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"],YAt=["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"],ZAt=[...XAt,...YAt],JAt=["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(),e_t=["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(),t_t=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),n_t=["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 fDe(e){const t=GAt(e),n=t_t,i=e_t,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("+ZAt.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("+n_t.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:JAt.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 i_t(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function hDe(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"],m=d,g=[...u,...c].filter(S=>!d.includes(S)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...m),/\s*\(/),relevance:0,keywords:{built_in:m}};function w(S){return t.concat(/\b/,t.either(...S.map(k=>k.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:w(h),relevance:0};function O(S,{exceptions:k,when:C}={}){const E=C;return k=k||[],S.map(R=>R.match(/\|\d+$/)||k.includes(R)?R:E(R)?`${R}|0`:R)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:O(g,{when:S=>S.length<3}),literal:s,type:l,built_in:f},contains:[{scope:"type",match:w(a)},x,y,b,i,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function pDe(e){return e?typeof e=="string"?e:e.source:null}function bO(e){return Pr("(?=",e,")")}function Pr(...e){return e.map(n=>pDe(n)).join("")}function r_t(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Ol(...e){return"("+(r_t(e).capture?"":"?:")+e.map(i=>pDe(i)).join("|")+")"}const pV=e=>Pr(/\b/,e,/\w$/.test(e)?/\b/:/\B/),s_t=["Protocol","Type"].map(pV),Ete=["init","self"].map(pV),o_t=["Any","Self"],n3=["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"],Cte=["false","nil","true"],a_t=["assignment","associativity","higherThan","left","lowerThan","none","right"],l_t=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Tte=["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"],mDe=Ol(/[/=\-+!*%<>&|^~?]/,/[\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]/),gDe=Ol(mDe,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),i3=Pr(mDe,gDe,"*"),bDe=Ol(/[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]/),sR=Ol(bDe,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),cf=Pr(bDe,sR,"*"),fA=Pr(/[A-Z]/,sR,"*"),c_t=["attached","autoclosure",Pr(/convention\(/,Ol("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Pr(/objc\(/,cf,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],u_t=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function d_t(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,Ol(...s_t,...Ete)],className:{2:"keyword"}},s={match:Pr(/\./,Ol(...n3)),relevance:0},a=n3.filter(Ce=>typeof Ce=="string").concat(["_|0"]),l=n3.filter(Ce=>typeof Ce!="string").concat(o_t).map(pV),c={variants:[{className:"keyword",match:Ol(...l,...Ete)}]},u={$pattern:Ol(/\b\w+/,/#\w+/),keyword:a.concat(l_t),literal:Cte},d=[r,s,c],f={match:Pr(/\./,Ol(...Tte)),relevance:0},h={className:"built_in",match:Pr(/\b/,Ol(...Tte),/(?=\()/)},m=[f,h],g={match:/->/,relevance:0},b={className:"operator",relevance:0,variants:[{match:i3},{match:`\\.(\\.|${gDe})+`}]},v=[g,b],y="([0-9]_*)+",w="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${w})(\\.(${w}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},O=(Ce="")=>({className:"subst",variants:[{match:Pr(/\\/,Ce,/[0\\tnr"']/)},{match:Pr(/\\/,Ce,/u\{[0-9a-fA-F]{1,8}\}/)}]}),S=(Ce="")=>({className:"subst",match:Pr(/\\/,Ce,/[\t ]*(?:[\r\n]|\r\n)/)}),k=(Ce="")=>({className:"subst",label:"interpol",begin:Pr(/\\/,Ce,/\(/),end:/\)/}),C=(Ce="")=>({begin:Pr(Ce,/"""/),end:Pr(/"""/,Ce),contains:[O(Ce),S(Ce),k(Ce)]}),E=(Ce="")=>({begin:Pr(Ce,/"/),end:Pr(/"/,Ce),contains:[O(Ce),k(Ce)]}),R={className:"string",variants:[C(),C("#"),C("##"),C("###"),E(),E("#"),E("##"),E("###")]},A=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],j={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:A},T=Ce=>{const se=Pr(Ce,/\//),he=Pr(/\//,Ce);return{begin:se,end:he,contains:[...A,{scope:"comment",begin:`#(?!.*${he})`,end:/$/}]}},N={scope:"regexp",variants:[T("###"),T("##"),T("#"),j]},_={match:Pr(/`/,cf,/`/)},D={className:"variable",match:/\$\d+/},M={className:"variable",match:`\\$${sR}+`},P=[_,D,M],L={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:u_t,contains:[...v,x,R]}]}},B={scope:"keyword",match:Pr(/@/,Ol(...c_t),bO(Ol(/\(/,/\s+/)))},I={scope:"meta",match:Pr(/@/,cf)},z=[L,B,I],K={match:bO(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Pr(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,sR,"+")},{className:"type",match:fA,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Pr(/\s+&\s+/,bO(fA)),relevance:0}]},F={begin://,keywords:u,contains:[...i,...d,...z,g,K]};K.contains.push(F);const q={match:Pr(cf,/\s*:/),keywords:"_|0",relevance:0},H={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",q,...i,N,...d,...m,...v,x,R,...P,...z,K]},X={begin://,keywords:"repeat each",contains:[...i,K]},ne={begin:Ol(bO(Pr(cf,/\s*:/)),bO(Pr(cf,/\s+/,cf,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:cf}]},Q={begin:/\(/,end:/\)/,keywords:u,contains:[ne,...i,...d,...v,x,R,...z,K,H],endsParent:!0,illegal:/["']/},Z={match:[/(func|macro)/,/\s+/,Ol(_.match,cf,i3)],className:{1:"keyword",3:"title.function"},contains:[X,Q,t],illegal:[/\[/,/%/]},ce={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[X,Q,t],illegal:/\[|%/},Ee={match:[/operator/,/\s+/,i3],className:{1:"keyword",3:"title"}},Y={begin:[/precedencegroup/,/\s+/,fA],className:{1:"keyword",3:"title"},contains:[K],keywords:[...a_t,...Cte],end:/}/},G={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},te={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ue={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,cf,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[X,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:fA},...d],relevance:0}]};for(const Ce of R.variants){const se=Ce.contains.find(ae=>ae.label==="interpol");se.keywords=u;const he=[...d,...m,...v,x,R,...P];se.contains=[...he,{begin:/\(/,end:/\)/,contains:["self",...he]}]}return{name:"Swift",keywords:u,contains:[...i,Z,ce,G,te,ue,Ee,Y,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},N,...d,...m,...v,x,R,...P,...z,K,H]}}const oR="[A-Za-z$_][0-9A-Za-z$_]*",yDe=["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"],vDe=["true","false","null","undefined","NaN","Infinity"],xDe=["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"],wDe=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ODe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],kDe=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],SDe=[].concat(ODe,xDe,wDe);function f_t(e){const t=e.regex,n=(L,{after:B})=>{const I="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,B)=>{const I=L[0].length+L.index,z=L.input[I];if(z==="<"||z===","){B.ignoreMatch();return}z===">"&&(n(L,{after:I})||B.ignoreMatch());let K;const F=L.input.substring(I);if(K=F.match(/^\s*=/)){B.ignoreMatch();return}if((K=F.match(/^\s+extends\s+/))&&K.index===0){B.ignoreMatch();return}}},l={$pattern:oR,keyword:yDe,literal:vDe,built_in:SDe,"variable.language":kDe},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:[]},m={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]},w={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const O=[].concat(w,h.contains),S=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(O)}]),k={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},C={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"}}]},E={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:{_:[...xDe,...wDe]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},A={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[k],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function T(L){return t.concat("(?!",L.join("|"),")")}const N={match:t.concat(/\b/,T([...ODe,"super","import"].map(L=>`${L}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},_={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},D={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},k]},M="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(M)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[k]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:E},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,w,{match:/\$\d+/},f,E,{scope:"attr",match:i+t.lookahead(":"),relevance:0},P,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,e.REGEXP_MODE,{className:"function",begin:M,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:S}]}]},{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"]}]}]},A,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[k,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},_,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[k]},N,j,C,D,{match:/\$[(.]/}]}}function mV(e){const t=e.regex,n=f_t(e),i=oR,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:oR,keyword:yDe.concat(c),literal:vDe,built_in:SDe.concat(r),"variable.language":kDe},d={className:"meta",begin:"@"+i},f=(b,v,y)=>{const w=b.contains.findIndex(x=>x.label===v);if(w===-1)throw new Error("can not find mode to replace");b.contains.splice(w,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(b=>b.scope==="attr"),m=Object.assign({},h,{match:t.concat(i,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,m]),n.contains=n.contains.concat([d,s,a,m]),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 h_t(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 p_t(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 EDe(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 gV(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"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},g={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[m],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),m.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const m_t={arduino:pAt,bash:iD,c:mAt,cpp:gAt,csharp:bAt,css:eDe,diff:tDe,go:nDe,graphql:CAt,ini:lV,java:rDe,javascript:cV,json:uV,kotlin:RAt,less:BAt,lua:UAt,makefile:dV,markdown:fV,objectivec:QAt,perl:zAt,php:VAt,"php-template":HAt,plaintext:uDe,python:hV,"python-repl":qAt,r:WAt,ruby:KAt,rust:dDe,scss:fDe,shell:i_t,sql:hDe,swift:d_t,typescript:mV,vbnet:h_t,wasm:p_t,xml:EDe,yaml:gV};function CDe(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)&&CDe(n)}),e}let Ate=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function TDe(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Am(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 g_t="",_te=e=>!!e.scope,b_t=(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 y_t{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=TDe(t)}openNode(t){if(!_te(t))return;const n=b_t(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){_te(t)&&(this.buffer+=g_t)}value(){return this.buffer}span(t){this.buffer+=``}}const jte=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class bV{constructor(){this.rootNode=jte(),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=jte({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=>{bV._collapse(n)}))}}class v_t extends bV{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 y_t(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function wE(e){return e?typeof e=="string"?e:e.source:null}function ADe(e){return a0("(?=",e,")")}function x_t(e){return a0("(?:",e,")*")}function w_t(e){return a0("(?:",e,")?")}function a0(...e){return e.map(n=>wE(n)).join("")}function O_t(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function yV(...e){return"("+(O_t(e).capture?"":"?:")+e.map(i=>wE(i)).join("|")+")"}function _De(e){return new RegExp(e.toString()+"|").exec("").length-1}function k_t(e,t){const n=e&&e.exec(t);return n&&n.index===0}const S_t=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function vV(e,{joinWith:t}){let n=0;return e.map(i=>{n+=1;const r=n;let s=wE(i),a="";for(;s.length>0;){const l=S_t.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 E_t=/\b\B/,jDe="[a-zA-Z]\\w*",xV="[a-zA-Z_]\\w*",NDe="\\b\\d+(\\.\\d+)?",RDe="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",IDe="\\b(0b[01]+)",C_t="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",T_t=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=a0(t,/.*\b/,e.binary,/\b.*/)),Am({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},e)},OE={begin:"\\\\[\\s\\S]",relevance:0},A_t={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[OE]},__t={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[OE]},j_t={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/},rD=function(e,t,n={}){const i=Am({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=yV("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:a0(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},N_t=rD("//","$"),R_t=rD("/\\*","\\*/"),I_t=rD("#","$"),P_t={scope:"number",begin:NDe,relevance:0},D_t={scope:"number",begin:RDe,relevance:0},M_t={scope:"number",begin:IDe,relevance:0},L_t={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[OE,{begin:/\[/,end:/\]/,relevance:0,contains:[OE]}]},$_t={scope:"title",begin:jDe,relevance:0},F_t={scope:"title",begin:xV,relevance:0},B_t={begin:"\\.\\s*"+xV,relevance:0},U_t=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 hA=Object.freeze({__proto__:null,APOS_STRING_MODE:A_t,BACKSLASH_ESCAPE:OE,BINARY_NUMBER_MODE:M_t,BINARY_NUMBER_RE:IDe,COMMENT:rD,C_BLOCK_COMMENT_MODE:R_t,C_LINE_COMMENT_MODE:N_t,C_NUMBER_MODE:D_t,C_NUMBER_RE:RDe,END_SAME_AS_BEGIN:U_t,HASH_COMMENT_MODE:I_t,IDENT_RE:jDe,MATCH_NOTHING_RE:E_t,METHOD_GUARD:B_t,NUMBER_MODE:P_t,NUMBER_RE:NDe,PHRASAL_WORDS_MODE:j_t,QUOTE_STRING_MODE:__t,REGEXP_MODE:L_t,RE_STARTERS_RE:C_t,SHEBANG:T_t,TITLE_MODE:$_t,UNDERSCORE_IDENT_RE:xV,UNDERSCORE_TITLE_MODE:F_t});function Q_t(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function z_t(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function V_t(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Q_t,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function H_t(e,t){Array.isArray(e.illegal)&&(e.illegal=yV(...e.illegal))}function q_t(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 W_t(e,t){e.relevance===void 0&&(e.relevance=1)}const K_t=(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=a0(n.beforeMatch,ADe(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},G_t=["of","and","for","in","not","or","if","then","parent","list","value"],X_t="keyword";function PDe(e,t,n=X_t){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,PDe(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,Y_t(c[0],c[1])]})}}function Y_t(e,t){return t?Number(t):Z_t(e)?0:1}function Z_t(e){return G_t.includes(e.toLowerCase())}const Nte={},ry=e=>{console.error(e)},Rte=(e,...t)=>{console.log(`WARN: ${e}`,...t)},H0=(e,t)=>{Nte[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Nte[`${e}/${t}`]=!0)},aR=new Error;function DDe(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+=_De(t[l-1]);e[n]=a,e[n]._emit=s,e[n]._multi=!0}function J_t(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw ry("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),aR;if(typeof e.beginScope!="object"||e.beginScope===null)throw ry("beginScope must be object"),aR;DDe(e,e.begin,{key:"beginScope"}),e.begin=vV(e.begin,{joinWith:""})}}function ejt(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw ry("skip, excludeEnd, returnEnd not compatible with endScope: {}"),aR;if(typeof e.endScope!="object"||e.endScope===null)throw ry("endScope must be object"),aR;DDe(e,e.end,{key:"endScope"}),e.end=vV(e.end,{joinWith:""})}}function tjt(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function njt(e){tjt(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),J_t(e),ejt(e)}function ijt(e){function t(a,l){return new RegExp(wE(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+=_De(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(vV(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;[z_t,q_t,njt,K_t].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[V_t,H_t,W_t].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=PDe(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=wE(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 rjt(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=Am(e.classNameAliases||{}),s(e)}function MDe(e){return e?e.endsWithParent||MDe(e.starts):!1}function rjt(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Am(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:MDe(e)?Am(e,{starts:e.starts?Am(e.starts):null}):Object.isFrozen(e)?Am(e):e}var sjt="11.11.1";class ojt extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const r3=TDe,Ite=Am,Pte=Symbol("nomatch"),ajt=7,LDe=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:v_t};function c(M){return l.noHighlightRe.test(M)}function u(M){let P=M.className+" ";P+=M.parentNode?M.parentNode.className:"";const L=l.languageDetectRe.exec(P);if(L){const B=E(L[1]);return B||(Rte(s.replace("{}",L[1])),Rte("Falling back to no-highlight mode for this block.",M)),B?L[1]:"no-highlight"}return P.split(/\s+/).find(B=>c(B)||E(B))}function d(M,P,L){let B="",I="";typeof P=="object"?(B=M,L=P.ignoreIllegals,I=P.language):(H0("10.7.0","highlight(lang, code, ...args) has been deprecated."),H0("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),I=M,B=P),L===void 0&&(L=!0);const z={code:B,language:I};_("before:highlight",z);const K=z.result?z.result:f(z.language,z.code,L);return K.code=z.code,_("after:highlight",K),K}function f(M,P,L,B){const I=Object.create(null);function z(ie,fe){return ie.keywords[fe]}function K(){if(!he.keywords){Ae.addText(De);return}let ie=0;he.keywordPatternRe.lastIndex=0;let fe=he.keywordPatternRe.exec(De),Se="";for(;fe;){Se+=De.substring(ie,fe.index);const ke=ue.case_insensitive?fe[0].toLowerCase():fe[0],qe=z(he,ke);if(qe){const[it,de]=qe;if(Ae.addText(Se),Se="",I[ke]=(I[ke]||0)+1,I[ke]<=ajt&&(ye+=de),it.startsWith("_"))Se+=fe[0];else{const ve=ue.classNameAliases[it]||it;H(fe[0],ve)}}else Se+=fe[0];ie=he.keywordPatternRe.lastIndex,fe=he.keywordPatternRe.exec(De)}Se+=De.substring(ie),Ae.addText(Se)}function F(){if(De==="")return;let ie=null;if(typeof he.subLanguage=="string"){if(!t[he.subLanguage]){Ae.addText(De);return}ie=f(he.subLanguage,De,!0,ae[he.subLanguage]),ae[he.subLanguage]=ie._top}else ie=m(De,he.subLanguage.length?he.subLanguage:null);he.relevance>0&&(ye+=ie.relevance),Ae.__addSublanguage(ie._emitter,ie.language)}function q(){he.subLanguage!=null?F():K(),De=""}function H(ie,fe){ie!==""&&(Ae.startScope(fe),Ae.addText(ie),Ae.endScope())}function X(ie,fe){let Se=1;const ke=fe.length-1;for(;Se<=ke;){if(!ie._emit[Se]){Se++;continue}const qe=ue.classNameAliases[ie[Se]]||ie[Se],it=fe[Se];qe?H(it,qe):(De=it,K(),De=""),Se++}}function ne(ie,fe){return ie.scope&&typeof ie.scope=="string"&&Ae.openNode(ue.classNameAliases[ie.scope]||ie.scope),ie.beginScope&&(ie.beginScope._wrap?(H(De,ue.classNameAliases[ie.beginScope._wrap]||ie.beginScope._wrap),De=""):ie.beginScope._multi&&(X(ie.beginScope,fe),De="")),he=Object.create(ie,{parent:{value:he}}),he}function Q(ie,fe,Se){let ke=k_t(ie.endRe,Se);if(ke){if(ie["on:end"]){const qe=new Ate(ie);ie["on:end"](fe,qe),qe.isMatchIgnored&&(ke=!1)}if(ke){for(;ie.endsParent&&ie.parent;)ie=ie.parent;return ie}}if(ie.endsWithParent)return Q(ie.parent,fe,Se)}function Z(ie){return he.matcher.regexIndex===0?(De+=ie[0],1):(Ne=!0,0)}function ce(ie){const fe=ie[0],Se=ie.rule,ke=new Ate(Se),qe=[Se.__beforeBegin,Se["on:begin"]];for(const it of qe)if(it&&(it(ie,ke),ke.isMatchIgnored))return Z(fe);return Se.skip?De+=fe:(Se.excludeBegin&&(De+=fe),q(),!Se.returnBegin&&!Se.excludeBegin&&(De=fe)),ne(Se,ie),Se.returnBegin?0:fe.length}function Ee(ie){const fe=ie[0],Se=P.substring(ie.index),ke=Q(he,ie,Se);if(!ke)return Pte;const qe=he;he.endScope&&he.endScope._wrap?(q(),H(fe,he.endScope._wrap)):he.endScope&&he.endScope._multi?(q(),X(he.endScope,ie)):qe.skip?De+=fe:(qe.returnEnd||qe.excludeEnd||(De+=fe),q(),qe.excludeEnd&&(De=fe));do he.scope&&Ae.closeNode(),!he.skip&&!he.subLanguage&&(ye+=he.relevance),he=he.parent;while(he!==ke.parent);return ke.starts&&ne(ke.starts,ie),qe.returnEnd?0:fe.length}function Y(){const ie=[];for(let fe=he;fe!==ue;fe=fe.parent)fe.scope&&ie.unshift(fe.scope);ie.forEach(fe=>Ae.openNode(fe))}let G={};function te(ie,fe){const Se=fe&&fe[0];if(De+=ie,Se==null)return q(),0;if(G.type==="begin"&&fe.type==="end"&&G.index===fe.index&&Se===""){if(De+=P.slice(fe.index,fe.index+1),!r){const ke=new Error(`0 width match regex (${M})`);throw ke.languageName=M,ke.badRule=G.rule,ke}return 1}if(G=fe,fe.type==="begin")return ce(fe);if(fe.type==="illegal"&&!L){const ke=new Error('Illegal lexeme "'+Se+'" for mode "'+(he.scope||"")+'"');throw ke.mode=he,ke}else if(fe.type==="end"){const ke=Ee(fe);if(ke!==Pte)return ke}if(fe.type==="illegal"&&Se==="")return De+=` -`,1;if(we>1e5&&we>fe.index*3)throw new Error("potential infinite loop, way more iterations than matches");return De+=Se,Se.length}const ue=E(M);if(!ue)throw ry(s.replace("{}",M)),new Error('Unknown language: "'+M+'"');const Ce=ijt(ue);let se="",he=B||Ce;const ae={},Ae=new l.__emitter(l);Y();let De="",ye=0,Qe=0,we=0,Ne=!1;try{if(ue.__emitTokens)ue.__emitTokens(P,Ae);else{for(he.matcher.considerAll();;){we++,Ne?Ne=!1:he.matcher.considerAll(),he.matcher.lastIndex=Qe;const ie=he.matcher.exec(P);if(!ie)break;const fe=P.substring(Qe,ie.index),Se=te(fe,ie);Qe=ie.index+Se}te(P.substring(Qe))}return Ae.finalize(),se=Ae.toHTML(),{language:M,value:se,relevance:ye,illegal:!1,_emitter:Ae,_top:he}}catch(ie){if(ie.message&&ie.message.includes("Illegal"))return{language:M,value:r3(P),illegal:!0,relevance:0,_illegalBy:{message:ie.message,index:Qe,context:P.slice(Qe-100,Qe+100),mode:ie.mode,resultSoFar:se},_emitter:Ae};if(r)return{language:M,value:r3(P),illegal:!1,relevance:0,errorRaised:ie,_emitter:Ae,_top:he};throw ie}}function h(M){const P={value:r3(M),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return P._emitter.addText(M),P}function m(M,P){P=P||l.languages||Object.keys(t);const L=h(M),B=P.filter(E).filter(A).map(q=>f(q,M,!1));B.unshift(L);const I=B.sort((q,H)=>{if(q.relevance!==H.relevance)return H.relevance-q.relevance;if(q.language&&H.language){if(E(q.language).supersetOf===H.language)return 1;if(E(H.language).supersetOf===q.language)return-1}return 0}),[z,K]=I,F=z;return F.secondBest=K,F}function g(M,P,L){const B=P&&n[P]||L;M.classList.add("hljs"),M.classList.add(`language-${B}`)}function b(M){let P=null;const L=u(M);if(c(L))return;if(_("before:highlightElement",{el:M,language:L}),M.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",M);return}if(M.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(M)),l.throwUnescapedHTML))throw new ojt("One of your code blocks includes unescaped HTML.",M.innerHTML);P=M;const B=P.textContent,I=L?d(B,{language:L,ignoreIllegals:!0}):m(B);M.innerHTML=I.value,M.dataset.highlighted="yes",g(M,L,I.language),M.result={language:I.language,re:I.relevance,relevance:I.relevance},I.secondBest&&(M.secondBest={language:I.secondBest.language,relevance:I.secondBest.relevance}),_("after:highlightElement",{el:M,result:I,text:B})}function v(M){l=Ite(l,M)}const y=()=>{O(),H0("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function w(){O(),H0("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function O(){function M(){O()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",M,!1),x=!0;return}document.querySelectorAll(l.cssSelector).forEach(b)}function S(M,P){let L=null;try{L=P(e)}catch(B){if(ry("Language definition for '{}' could not be registered.".replace("{}",M)),r)ry(B);else throw B;L=a}L.name||(L.name=M),t[M]=L,L.rawDefinition=P.bind(null,e),L.aliases&&R(L.aliases,{languageName:M})}function k(M){delete t[M];for(const P of Object.keys(n))n[P]===M&&delete n[P]}function C(){return Object.keys(t)}function E(M){return M=(M||"").toLowerCase(),t[M]||t[n[M]]}function R(M,{languageName:P}){typeof M=="string"&&(M=[M]),M.forEach(L=>{n[L.toLowerCase()]=P})}function A(M){const P=E(M);return P&&!P.disableAutodetect}function j(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 T(M){j(M),i.push(M)}function N(M){const P=i.indexOf(M);P!==-1&&i.splice(P,1)}function _(M,P){const L=M;i.forEach(function(B){B[L]&&B[L](P)})}function D(M){return H0("10.7.0","highlightBlock will be removed entirely in v12.0"),H0("10.7.0","Please use highlightElement now."),b(M)}Object.assign(e,{highlight:d,highlightAuto:m,highlightAll:O,highlightElement:b,highlightBlock:D,configure:v,initHighlighting:y,initHighlightingOnLoad:w,registerLanguage:S,unregisterLanguage:k,listLanguages:C,getLanguage:E,registerAliases:R,autoDetection:A,inherit:Ite,addPlugin:T,removePlugin:N}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=sjt,e.regex={concat:a0,lookahead:ADe,either:yV,optional:w_t,anyNumberOfTimes:x_t};for(const M in hA)typeof hA[M]=="object"&&CDe(hA[M]);return Object.assign(e,hA),e},hw=LDe({});hw.newInstance=()=>LDe({});var ljt=hw;hw.HighlightJS=hw;hw.default=hw;const Qa=_w(ljt),Dte={},cjt="hljs-";function ujt(e){const t=Qa.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||Dte,h=typeof f.prefix=="string"?f.prefix:cjt;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:djt,classPrefix:h});const m=t.highlight(u,{ignoreIllegals:!0,language:c});if(m.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:m.errorRaised});const g=m._emitter.root,b=g.data;return b.language=m.language,b.relevance=m.relevance,g}function i(c,u){const f=(u||Dte).subset||r();let h=-1,m=0,g;for(;++hm&&(m=v.data.relevance,g=v)}return g||{type:"root",children:[],data:{language:void 0,relevance:m}}}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 djt{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 fjt={};function Mte(e){const t=e||fjt,n=t.aliases,i=t.detect||!1,r=t.languages||m_t,s=t.plainText,a=t.prefix,l=t.subset;let c="hljs";const u=ujt(r);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");c=d===-1?a:a.slice(0,d)}return function(d,f){iT(d,"element",function(h,m,g){if(h.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const b=hjt(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=oAt(h,{whitespace:"pre"});let y;try{y=b?u.highlight(b,v,{prefix:a}):u.highlightAuto(v,{prefix:a,subset:l})}catch(w){const x=w;if(b&&/Unknown language/.test(x.message)){f.message("Cannot highlight as `"+b+"`, it’s not registered",{ancestors:[g,h],cause:x,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw x}!b&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function hjt(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=Fte(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 Fjt(e){return e>=56320&&e<=57343}function Bjt(e,t){return(e-55296)*1024+9216+t}function zDe(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function VDe(e){return e>=64976&&e<=65007||$jt.has(e)}var ct;(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"})(ct||(ct={}));const Ujt=65536;class Qjt{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=Ujt,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(Fjt(n))return this.pos++,this._addGap(),Bjt(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,ge.EOF;return this._err(ct.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,ge.EOF;const i=this.html.charCodeAt(n);return i===ge.CARRIAGE_RETURN?ge.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,ge.EOF;let t=this.html.charCodeAt(this.pos);return t===ge.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,ge.LINE_FEED):t===ge.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,QDe(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===ge.LINE_FEED||t===ge.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){zDe(t)?this._err(ct.controlCharacterInInputStream):VDe(t)&&this._err(ct.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 zjt=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))),Vjt=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 Hjt(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Vjt.get(e))!==null&&t!==void 0?t:e}var ga;(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"})(ga||(ga={}));const qjt=32;var _m;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(_m||(_m={}));function C8(e){return e>=ga.ZERO&&e<=ga.NINE}function Wjt(e){return e>=ga.UPPER_A&&e<=ga.UPPER_F||e>=ga.LOWER_A&&e<=ga.LOWER_F}function Kjt(e){return e>=ga.UPPER_A&&e<=ga.UPPER_Z||e>=ga.LOWER_A&&e<=ga.LOWER_Z||C8(e)}function Gjt(e){return e===ga.EQUALS||Kjt(e)}var ca;(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"})(ca||(ca={}));var Nh;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Nh||(Nh={}));class Xjt{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=ca.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Nh.Strict}startEntity(t){this.decodeMode=t,this.state=ca.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case ca.EntityStart:return t.charCodeAt(n)===ga.NUM?(this.state=ca.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=ca.NamedEntity,this.stateNamedEntity(t,n));case ca.NumericStart:return this.stateNumericStart(t,n);case ca.NumericDecimal:return this.stateNumericDecimal(t,n);case ca.NumericHex:return this.stateNumericHex(t,n);case ca.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|qjt)===ga.LOWER_X?(this.state=ca.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=ca.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===ga.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Nh.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]&_m.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]&~_m.VALUE_LENGTH:r[t+1],i),n===3&&this.emitCodePoint(r[t+2],i),i}end(){var t;switch(this.state){case ca.NamedEntity:return this.result!==0&&(this.decodeMode!==Nh.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ca.NumericDecimal:return this.emitNumericEntity(0,2);case ca.NumericHex:return this.emitNumericEntity(0,3);case ca.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ca.EntityStart:return 0}}}function Yjt(e,t,n,i){const r=(t&_m.BRANCH_LENGTH)>>7,s=t&_m.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 _t;(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/"})(_t||(_t={}));var sy;(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"})(sy||(sy={}));var _u;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(_u||(_u={}));var Ye;(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"})(Ye||(Ye={}));var $;(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"})($||($={}));const Zjt=new Map([[Ye.A,$.A],[Ye.ADDRESS,$.ADDRESS],[Ye.ANNOTATION_XML,$.ANNOTATION_XML],[Ye.APPLET,$.APPLET],[Ye.AREA,$.AREA],[Ye.ARTICLE,$.ARTICLE],[Ye.ASIDE,$.ASIDE],[Ye.B,$.B],[Ye.BASE,$.BASE],[Ye.BASEFONT,$.BASEFONT],[Ye.BGSOUND,$.BGSOUND],[Ye.BIG,$.BIG],[Ye.BLOCKQUOTE,$.BLOCKQUOTE],[Ye.BODY,$.BODY],[Ye.BR,$.BR],[Ye.BUTTON,$.BUTTON],[Ye.CAPTION,$.CAPTION],[Ye.CENTER,$.CENTER],[Ye.CODE,$.CODE],[Ye.COL,$.COL],[Ye.COLGROUP,$.COLGROUP],[Ye.DD,$.DD],[Ye.DESC,$.DESC],[Ye.DETAILS,$.DETAILS],[Ye.DIALOG,$.DIALOG],[Ye.DIR,$.DIR],[Ye.DIV,$.DIV],[Ye.DL,$.DL],[Ye.DT,$.DT],[Ye.EM,$.EM],[Ye.EMBED,$.EMBED],[Ye.FIELDSET,$.FIELDSET],[Ye.FIGCAPTION,$.FIGCAPTION],[Ye.FIGURE,$.FIGURE],[Ye.FONT,$.FONT],[Ye.FOOTER,$.FOOTER],[Ye.FOREIGN_OBJECT,$.FOREIGN_OBJECT],[Ye.FORM,$.FORM],[Ye.FRAME,$.FRAME],[Ye.FRAMESET,$.FRAMESET],[Ye.H1,$.H1],[Ye.H2,$.H2],[Ye.H3,$.H3],[Ye.H4,$.H4],[Ye.H5,$.H5],[Ye.H6,$.H6],[Ye.HEAD,$.HEAD],[Ye.HEADER,$.HEADER],[Ye.HGROUP,$.HGROUP],[Ye.HR,$.HR],[Ye.HTML,$.HTML],[Ye.I,$.I],[Ye.IMG,$.IMG],[Ye.IMAGE,$.IMAGE],[Ye.INPUT,$.INPUT],[Ye.IFRAME,$.IFRAME],[Ye.KEYGEN,$.KEYGEN],[Ye.LABEL,$.LABEL],[Ye.LI,$.LI],[Ye.LINK,$.LINK],[Ye.LISTING,$.LISTING],[Ye.MAIN,$.MAIN],[Ye.MALIGNMARK,$.MALIGNMARK],[Ye.MARQUEE,$.MARQUEE],[Ye.MATH,$.MATH],[Ye.MENU,$.MENU],[Ye.META,$.META],[Ye.MGLYPH,$.MGLYPH],[Ye.MI,$.MI],[Ye.MO,$.MO],[Ye.MN,$.MN],[Ye.MS,$.MS],[Ye.MTEXT,$.MTEXT],[Ye.NAV,$.NAV],[Ye.NOBR,$.NOBR],[Ye.NOFRAMES,$.NOFRAMES],[Ye.NOEMBED,$.NOEMBED],[Ye.NOSCRIPT,$.NOSCRIPT],[Ye.OBJECT,$.OBJECT],[Ye.OL,$.OL],[Ye.OPTGROUP,$.OPTGROUP],[Ye.OPTION,$.OPTION],[Ye.P,$.P],[Ye.PARAM,$.PARAM],[Ye.PLAINTEXT,$.PLAINTEXT],[Ye.PRE,$.PRE],[Ye.RB,$.RB],[Ye.RP,$.RP],[Ye.RT,$.RT],[Ye.RTC,$.RTC],[Ye.RUBY,$.RUBY],[Ye.S,$.S],[Ye.SCRIPT,$.SCRIPT],[Ye.SEARCH,$.SEARCH],[Ye.SECTION,$.SECTION],[Ye.SELECT,$.SELECT],[Ye.SOURCE,$.SOURCE],[Ye.SMALL,$.SMALL],[Ye.SPAN,$.SPAN],[Ye.STRIKE,$.STRIKE],[Ye.STRONG,$.STRONG],[Ye.STYLE,$.STYLE],[Ye.SUB,$.SUB],[Ye.SUMMARY,$.SUMMARY],[Ye.SUP,$.SUP],[Ye.TABLE,$.TABLE],[Ye.TBODY,$.TBODY],[Ye.TEMPLATE,$.TEMPLATE],[Ye.TEXTAREA,$.TEXTAREA],[Ye.TFOOT,$.TFOOT],[Ye.TD,$.TD],[Ye.TH,$.TH],[Ye.THEAD,$.THEAD],[Ye.TITLE,$.TITLE],[Ye.TR,$.TR],[Ye.TRACK,$.TRACK],[Ye.TT,$.TT],[Ye.U,$.U],[Ye.UL,$.UL],[Ye.SVG,$.SVG],[Ye.VAR,$.VAR],[Ye.WBR,$.WBR],[Ye.XMP,$.XMP]]);function o1(e){var t;return(t=Zjt.get(e))!==null&&t!==void 0?t:$.UNKNOWN}const Rt=$,Jjt={[_t.HTML]:new Set([Rt.ADDRESS,Rt.APPLET,Rt.AREA,Rt.ARTICLE,Rt.ASIDE,Rt.BASE,Rt.BASEFONT,Rt.BGSOUND,Rt.BLOCKQUOTE,Rt.BODY,Rt.BR,Rt.BUTTON,Rt.CAPTION,Rt.CENTER,Rt.COL,Rt.COLGROUP,Rt.DD,Rt.DETAILS,Rt.DIR,Rt.DIV,Rt.DL,Rt.DT,Rt.EMBED,Rt.FIELDSET,Rt.FIGCAPTION,Rt.FIGURE,Rt.FOOTER,Rt.FORM,Rt.FRAME,Rt.FRAMESET,Rt.H1,Rt.H2,Rt.H3,Rt.H4,Rt.H5,Rt.H6,Rt.HEAD,Rt.HEADER,Rt.HGROUP,Rt.HR,Rt.HTML,Rt.IFRAME,Rt.IMG,Rt.INPUT,Rt.LI,Rt.LINK,Rt.LISTING,Rt.MAIN,Rt.MARQUEE,Rt.MENU,Rt.META,Rt.NAV,Rt.NOEMBED,Rt.NOFRAMES,Rt.NOSCRIPT,Rt.OBJECT,Rt.OL,Rt.P,Rt.PARAM,Rt.PLAINTEXT,Rt.PRE,Rt.SCRIPT,Rt.SECTION,Rt.SELECT,Rt.SOURCE,Rt.STYLE,Rt.SUMMARY,Rt.TABLE,Rt.TBODY,Rt.TD,Rt.TEMPLATE,Rt.TEXTAREA,Rt.TFOOT,Rt.TH,Rt.THEAD,Rt.TITLE,Rt.TR,Rt.TRACK,Rt.UL,Rt.WBR,Rt.XMP]),[_t.MATHML]:new Set([Rt.MI,Rt.MO,Rt.MN,Rt.MS,Rt.MTEXT,Rt.ANNOTATION_XML]),[_t.SVG]:new Set([Rt.TITLE,Rt.FOREIGN_OBJECT,Rt.DESC]),[_t.XLINK]:new Set,[_t.XML]:new Set,[_t.XMLNS]:new Set},T8=new Set([Rt.H1,Rt.H2,Rt.H3,Rt.H4,Rt.H5,Rt.H6]);Ye.STYLE,Ye.SCRIPT,Ye.XMP,Ye.IFRAME,Ye.NOEMBED,Ye.NOFRAMES,Ye.PLAINTEXT;var Oe;(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"})(Oe||(Oe={}));const bo={DATA:Oe.DATA,RCDATA:Oe.RCDATA,RAWTEXT:Oe.RAWTEXT,SCRIPT_DATA:Oe.SCRIPT_DATA,PLAINTEXT:Oe.PLAINTEXT,CDATA_SECTION:Oe.CDATA_SECTION};function eNt(e){return e>=ge.DIGIT_0&&e<=ge.DIGIT_9}function ok(e){return e>=ge.LATIN_CAPITAL_A&&e<=ge.LATIN_CAPITAL_Z}function tNt(e){return e>=ge.LATIN_SMALL_A&&e<=ge.LATIN_SMALL_Z}function nm(e){return tNt(e)||ok(e)}function Ute(e){return nm(e)||eNt(e)}function pA(e){return e+32}function qDe(e){return e===ge.SPACE||e===ge.LINE_FEED||e===ge.TABULATION||e===ge.FORM_FEED}function Qte(e){return qDe(e)||e===ge.SOLIDUS||e===ge.GREATER_THAN_SIGN}function nNt(e){return e===ge.NULL?ct.nullCharacterReference:e>1114111?ct.characterReferenceOutsideUnicodeRange:QDe(e)?ct.surrogateCharacterReference:VDe(e)?ct.noncharacterCharacterReference:zDe(e)||e===ge.CARRIAGE_RETURN?ct.controlCharacterReference:null}class iNt{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=Oe.DATA,this.returnState=Oe.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Qjt(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Xjt(zjt,(i,r)=>{this.preprocessor.pos=this.entityStartPos+r-1,this._flushCodePointConsumedAsCharacterReference(i)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ct.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:i=>{this._err(ct.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+i)},validateNumericCharacterReference:i=>{const r=nNt(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(ct.endTagWithAttributes),t.selfClosing&&this._err(ct.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 Ei.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Ei.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Ei.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:Ei.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=qDe(t)?Ei.WHITESPACE_CHARACTER:t===ge.NULL?Ei.NULL_CHARACTER:Ei.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Ei.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=Oe.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Nh.Attribute:Nh.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Oe.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Oe.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Oe.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case Oe.DATA:{this._stateData(t);break}case Oe.RCDATA:{this._stateRcdata(t);break}case Oe.RAWTEXT:{this._stateRawtext(t);break}case Oe.SCRIPT_DATA:{this._stateScriptData(t);break}case Oe.PLAINTEXT:{this._statePlaintext(t);break}case Oe.TAG_OPEN:{this._stateTagOpen(t);break}case Oe.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case Oe.TAG_NAME:{this._stateTagName(t);break}case Oe.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case Oe.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case Oe.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case Oe.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case Oe.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case Oe.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case Oe.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case Oe.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case Oe.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case Oe.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case Oe.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case Oe.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case Oe.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case Oe.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case Oe.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case Oe.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case Oe.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case Oe.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case Oe.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case Oe.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case Oe.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case Oe.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case Oe.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case Oe.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case Oe.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case Oe.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case Oe.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case Oe.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case Oe.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case Oe.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case Oe.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case Oe.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case Oe.BOGUS_COMMENT:{this._stateBogusComment(t);break}case Oe.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case Oe.COMMENT_START:{this._stateCommentStart(t);break}case Oe.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case Oe.COMMENT:{this._stateComment(t);break}case Oe.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case Oe.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case Oe.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case Oe.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case Oe.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case Oe.COMMENT_END:{this._stateCommentEnd(t);break}case Oe.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case Oe.DOCTYPE:{this._stateDoctype(t);break}case Oe.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case Oe.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case Oe.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case Oe.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case Oe.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case Oe.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case Oe.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case Oe.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case Oe.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case Oe.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case Oe.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case Oe.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case Oe.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case Oe.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case Oe.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case Oe.CDATA_SECTION:{this._stateCdataSection(t);break}case Oe.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case Oe.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case Oe.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Oe.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case ge.LESS_THAN_SIGN:{this.state=Oe.TAG_OPEN;break}case ge.AMPERSAND:{this._startCharacterReference();break}case ge.NULL:{this._err(ct.unexpectedNullCharacter),this._emitCodePoint(t);break}case ge.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case ge.AMPERSAND:{this._startCharacterReference();break}case ge.LESS_THAN_SIGN:{this.state=Oe.RCDATA_LESS_THAN_SIGN;break}case ge.NULL:{this._err(ct.unexpectedNullCharacter),this._emitChars(Ss);break}case ge.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case ge.LESS_THAN_SIGN:{this.state=Oe.RAWTEXT_LESS_THAN_SIGN;break}case ge.NULL:{this._err(ct.unexpectedNullCharacter),this._emitChars(Ss);break}case ge.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case ge.LESS_THAN_SIGN:{this.state=Oe.SCRIPT_DATA_LESS_THAN_SIGN;break}case ge.NULL:{this._err(ct.unexpectedNullCharacter),this._emitChars(Ss);break}case ge.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case ge.NULL:{this._err(ct.unexpectedNullCharacter),this._emitChars(Ss);break}case ge.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(nm(t))this._createStartTagToken(),this.state=Oe.TAG_NAME,this._stateTagName(t);else switch(t){case ge.EXCLAMATION_MARK:{this.state=Oe.MARKUP_DECLARATION_OPEN;break}case ge.SOLIDUS:{this.state=Oe.END_TAG_OPEN;break}case ge.QUESTION_MARK:{this._err(ct.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Oe.BOGUS_COMMENT,this._stateBogusComment(t);break}case ge.EOF:{this._err(ct.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ct.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Oe.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(nm(t))this._createEndTagToken(),this.state=Oe.TAG_NAME,this._stateTagName(t);else switch(t){case ge.GREATER_THAN_SIGN:{this._err(ct.missingEndTagName),this.state=Oe.DATA;break}case ge.EOF:{this._err(ct.eofBeforeTagName),this._emitChars("");break}case ge.NULL:{this._err(ct.unexpectedNullCharacter),this.state=Oe.SCRIPT_DATA_ESCAPED,this._emitChars(Ss);break}case ge.EOF:{this._err(ct.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Oe.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===ge.SOLIDUS?this.state=Oe.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:nm(t)?(this._emitChars("<"),this.state=Oe.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=Oe.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){nm(t)?(this.state=Oe.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case ge.NULL:{this._err(ct.unexpectedNullCharacter),this.state=Oe.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ss);break}case ge.EOF:{this._err(ct.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Oe.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===ge.SOLIDUS?(this.state=Oe.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Oe.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Hl.SCRIPT,!1)&&Qte(this.preprocessor.peek(Hl.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])!==_t.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(lNt,_t.HTML)}clearBackToTableBodyContext(){this.clearBackTo(aNt,_t.HTML)}clearBackToTableRowContext(){this.clearBackTo(oNt,_t.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]===$.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]===$.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 _t.HTML:{if(r===t)return!0;if(n.has(r))return!1;break}case _t.SVG:{if(Hte.has(r))return!1;break}case _t.MATHML:{if(Vte.has(r))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,lR)}hasInListItemScope(t){return this.hasInDynamicScope(t,rNt)}hasInButtonScope(t){return this.hasInDynamicScope(t,sNt)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case _t.HTML:{if(T8.has(n))return!0;if(lR.has(n))return!1;break}case _t.SVG:{if(Hte.has(n))return!1;break}case _t.MATHML:{if(Vte.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===_t.HTML)switch(this.tagIDs[n]){case t:return!0;case $.TABLE:case $.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===_t.HTML)switch(this.tagIDs[t]){case $.TBODY:case $.THEAD:case $.TFOOT:return!0;case $.TABLE:case $.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===_t.HTML)switch(this.tagIDs[n]){case t:return!0;case $.OPTION:case $.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&WDe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&zte.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&zte.has(this.currentTagId);)this.pop()}}const s3=3;var hf;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(hf||(hf={}));const qte={type:hf.Marker};class dNt{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>=s3&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(qte)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:hf.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const i=this.entries.indexOf(this.bookmark);this.entries.splice(i,0,{type:hf.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(qte);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(i=>i.type===hf.Marker||this.treeAdapter.getTagName(i.element)===t);return n&&n.type===hf.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===hf.Element&&n.element===t)}}const im={createDocument(){return{nodeName:"#document",mode:_u.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};im.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(im.isTextNode(n)){n.value+=t;return}}im.appendChild(e,im.createTextNode(t))},insertTextBefore(e,t,n){const i=e.childNodes[e.childNodes.indexOf(n)-1];i&&im.isTextNode(i)?i.value+=t:im.insertBefore(e,im.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(i=>i.name));for(let i=0;ie.startsWith(n))}function bNt(e){return e.name===KDe&&e.publicId===null&&(e.systemId===null||e.systemId===fNt)}function yNt(e){if(e.name!==KDe)return _u.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===hNt)return _u.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),mNt.has(n))return _u.QUIRKS;let i=t===null?pNt:GDe;if(Wte(n,i))return _u.QUIRKS;if(i=t===null?XDe:gNt,Wte(n,i))return _u.LIMITED_QUIRKS}return _u.NO_QUIRKS}const Kte={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},vNt="definitionurl",xNt="definitionURL",wNt=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])),ONt=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:_t.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:_t.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:_t.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:_t.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:_t.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:_t.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:_t.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:_t.XML}],["xml:space",{prefix:"xml",name:"space",namespace:_t.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:_t.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:_t.XMLNS}]]),kNt=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])),SNt=new Set([$.B,$.BIG,$.BLOCKQUOTE,$.BODY,$.BR,$.CENTER,$.CODE,$.DD,$.DIV,$.DL,$.DT,$.EM,$.EMBED,$.H1,$.H2,$.H3,$.H4,$.H5,$.H6,$.HEAD,$.HR,$.I,$.IMG,$.LI,$.LISTING,$.MENU,$.META,$.NOBR,$.OL,$.P,$.PRE,$.RUBY,$.S,$.SMALL,$.SPAN,$.STRONG,$.STRIKE,$.SUB,$.SUP,$.TABLE,$.TT,$.U,$.UL,$.VAR]);function ENt(e){const t=e.tagID;return t===$.FONT&&e.attrs.some(({name:i})=>i===sy.COLOR||i===sy.SIZE||i===sy.FACE)||SNt.has(t)}function YDe(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)===_t.HTML;this.currentNotInHTML=!i,this.tokenizer.inForeignNode=!i&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,_t.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=Ie.TEXT}switchToPlaintextParsing(){this.insertionMode=Ie.TEXT,this.originalInsertionMode=Ie.IN_BODY,this.tokenizer.state=bo.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)===Ye.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==_t.HTML))switch(this.fragmentContextID){case $.TITLE:case $.TEXTAREA:{this.tokenizer.state=bo.RCDATA;break}case $.STYLE:case $.XMP:case $.IFRAME:case $.NOEMBED:case $.NOFRAMES:case $.NOSCRIPT:{this.tokenizer.state=bo.RAWTEXT;break}case $.SCRIPT:{this.tokenizer.state=bo.SCRIPT_DATA;break}case $.PLAINTEXT:{this.tokenizer.state=bo.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,_t.HTML,[]);this._attachElementToTree(i,null),this.openElements.push(i,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,_t.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(Ye.HTML,_t.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,$.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===Ei.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===$.SVG&&this.treeAdapter.getTagName(n)===Ye.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===_t.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===$.MGLYPH||t.tagID===$.MALIGNMARK)&&i!==void 0&&!this._isIntegrationPoint(i,n,_t.HTML)}_processToken(t){switch(t.type){case Ei.CHARACTER:{this.onCharacter(t);break}case Ei.NULL_CHARACTER:{this.onNullCharacter(t);break}case Ei.COMMENT:{this.onComment(t);break}case Ei.DOCTYPE:{this.onDoctype(t);break}case Ei.START_TAG:{this._processStartTag(t);break}case Ei.END_TAG:{this.onEndTag(t);break}case Ei.EOF:{this.onEof(t);break}case Ei.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,i){const r=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return _Nt(t,r,s,i)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(r=>r.type===hf.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=Ie.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion($.P),this.openElements.popUntilTagNamePopped($.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case $.TR:{this.insertionMode=Ie.IN_ROW;return}case $.TBODY:case $.THEAD:case $.TFOOT:{this.insertionMode=Ie.IN_TABLE_BODY;return}case $.CAPTION:{this.insertionMode=Ie.IN_CAPTION;return}case $.COLGROUP:{this.insertionMode=Ie.IN_COLUMN_GROUP;return}case $.TABLE:{this.insertionMode=Ie.IN_TABLE;return}case $.BODY:{this.insertionMode=Ie.IN_BODY;return}case $.FRAMESET:{this.insertionMode=Ie.IN_FRAMESET;return}case $.SELECT:{this._resetInsertionModeForSelect(t);return}case $.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case $.HTML:{this.insertionMode=this.headElement?Ie.AFTER_HEAD:Ie.BEFORE_HEAD;return}case $.TD:case $.TH:{if(t>0){this.insertionMode=Ie.IN_CELL;return}break}case $.HEAD:{if(t>0){this.insertionMode=Ie.IN_HEAD;return}break}}this.insertionMode=Ie.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const i=this.openElements.tagIDs[n];if(i===$.TEMPLATE)break;if(i===$.TABLE){this.insertionMode=Ie.IN_SELECT_IN_TABLE;return}}this.insertionMode=Ie.IN_SELECT}_isElementCausesFosterParenting(t){return JDe.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 $.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===_t.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case $.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 Jjt[i].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){cIt(this,t);return}switch(this.insertionMode){case Ie.INITIAL:{yO(this,t);break}case Ie.BEFORE_HTML:{eS(this,t);break}case Ie.BEFORE_HEAD:{tS(this,t);break}case Ie.IN_HEAD:{nS(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{iS(this,t);break}case Ie.AFTER_HEAD:{rS(this,t);break}case Ie.IN_BODY:case Ie.IN_CAPTION:case Ie.IN_CELL:case Ie.IN_TEMPLATE:{tMe(this,t);break}case Ie.TEXT:case Ie.IN_SELECT:case Ie.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case Ie.IN_TABLE:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:{o3(this,t);break}case Ie.IN_TABLE_TEXT:{aMe(this,t);break}case Ie.IN_COLUMN_GROUP:{cR(this,t);break}case Ie.AFTER_BODY:{uR(this,t);break}case Ie.AFTER_AFTER_BODY:{uj(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){lIt(this,t);return}switch(this.insertionMode){case Ie.INITIAL:{yO(this,t);break}case Ie.BEFORE_HTML:{eS(this,t);break}case Ie.BEFORE_HEAD:{tS(this,t);break}case Ie.IN_HEAD:{nS(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{iS(this,t);break}case Ie.AFTER_HEAD:{rS(this,t);break}case Ie.TEXT:{this._insertCharacters(t);break}case Ie.IN_TABLE:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:{o3(this,t);break}case Ie.IN_COLUMN_GROUP:{cR(this,t);break}case Ie.AFTER_BODY:{uR(this,t);break}case Ie.AFTER_AFTER_BODY:{uj(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){A8(this,t);return}switch(this.insertionMode){case Ie.INITIAL:case Ie.BEFORE_HTML:case Ie.BEFORE_HEAD:case Ie.IN_HEAD:case Ie.IN_HEAD_NO_SCRIPT:case Ie.AFTER_HEAD:case Ie.IN_BODY:case Ie.IN_TABLE:case Ie.IN_CAPTION:case Ie.IN_COLUMN_GROUP:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:case Ie.IN_CELL:case Ie.IN_SELECT:case Ie.IN_SELECT_IN_TABLE:case Ie.IN_TEMPLATE:case Ie.IN_FRAMESET:case Ie.AFTER_FRAMESET:{A8(this,t);break}case Ie.IN_TABLE_TEXT:{vO(this,t);break}case Ie.AFTER_BODY:{BNt(this,t);break}case Ie.AFTER_AFTER_BODY:case Ie.AFTER_AFTER_FRAMESET:{UNt(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case Ie.INITIAL:{QNt(this,t);break}case Ie.BEFORE_HEAD:case Ie.IN_HEAD:case Ie.IN_HEAD_NO_SCRIPT:case Ie.AFTER_HEAD:{this._err(t,ct.misplacedDoctype);break}case Ie.IN_TABLE_TEXT:{vO(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,ct.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?uIt(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case Ie.INITIAL:{yO(this,t);break}case Ie.BEFORE_HTML:{zNt(this,t);break}case Ie.BEFORE_HEAD:{HNt(this,t);break}case Ie.IN_HEAD:{Vd(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{KNt(this,t);break}case Ie.AFTER_HEAD:{XNt(this,t);break}case Ie.IN_BODY:{hl(this,t);break}case Ie.IN_TABLE:{pw(this,t);break}case Ie.IN_TABLE_TEXT:{vO(this,t);break}case Ie.IN_CAPTION:{qRt(this,t);break}case Ie.IN_COLUMN_GROUP:{CV(this,t);break}case Ie.IN_TABLE_BODY:{aD(this,t);break}case Ie.IN_ROW:{lD(this,t);break}case Ie.IN_CELL:{GRt(this,t);break}case Ie.IN_SELECT:{uMe(this,t);break}case Ie.IN_SELECT_IN_TABLE:{YRt(this,t);break}case Ie.IN_TEMPLATE:{JRt(this,t);break}case Ie.AFTER_BODY:{tIt(this,t);break}case Ie.IN_FRAMESET:{nIt(this,t);break}case Ie.AFTER_FRAMESET:{rIt(this,t);break}case Ie.AFTER_AFTER_BODY:{oIt(this,t);break}case Ie.AFTER_AFTER_FRAMESET:{aIt(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?dIt(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case Ie.INITIAL:{yO(this,t);break}case Ie.BEFORE_HTML:{VNt(this,t);break}case Ie.BEFORE_HEAD:{qNt(this,t);break}case Ie.IN_HEAD:{WNt(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{GNt(this,t);break}case Ie.AFTER_HEAD:{YNt(this,t);break}case Ie.IN_BODY:{oD(this,t);break}case Ie.TEXT:{MRt(this,t);break}case Ie.IN_TABLE:{kE(this,t);break}case Ie.IN_TABLE_TEXT:{vO(this,t);break}case Ie.IN_CAPTION:{WRt(this,t);break}case Ie.IN_COLUMN_GROUP:{KRt(this,t);break}case Ie.IN_TABLE_BODY:{_8(this,t);break}case Ie.IN_ROW:{cMe(this,t);break}case Ie.IN_CELL:{XRt(this,t);break}case Ie.IN_SELECT:{dMe(this,t);break}case Ie.IN_SELECT_IN_TABLE:{ZRt(this,t);break}case Ie.IN_TEMPLATE:{eIt(this,t);break}case Ie.AFTER_BODY:{hMe(this,t);break}case Ie.IN_FRAMESET:{iIt(this,t);break}case Ie.AFTER_FRAMESET:{sIt(this,t);break}case Ie.AFTER_AFTER_BODY:{uj(this,t);break}}}onEof(t){switch(this.insertionMode){case Ie.INITIAL:{yO(this,t);break}case Ie.BEFORE_HTML:{eS(this,t);break}case Ie.BEFORE_HEAD:{tS(this,t);break}case Ie.IN_HEAD:{nS(this,t);break}case Ie.IN_HEAD_NO_SCRIPT:{iS(this,t);break}case Ie.AFTER_HEAD:{rS(this,t);break}case Ie.IN_BODY:case Ie.IN_TABLE:case Ie.IN_CAPTION:case Ie.IN_COLUMN_GROUP:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:case Ie.IN_CELL:case Ie.IN_SELECT:case Ie.IN_SELECT_IN_TABLE:{sMe(this,t);break}case Ie.TEXT:{LRt(this,t);break}case Ie.IN_TABLE_TEXT:{vO(this,t);break}case Ie.IN_TEMPLATE:{fMe(this,t);break}case Ie.AFTER_BODY:case Ie.IN_FRAMESET:case Ie.AFTER_FRAMESET:case Ie.AFTER_AFTER_BODY:case Ie.AFTER_AFTER_FRAMESET:{EV(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===ge.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 Ie.IN_HEAD:case Ie.IN_HEAD_NO_SCRIPT:case Ie.AFTER_HEAD:case Ie.TEXT:case Ie.IN_COLUMN_GROUP:case Ie.IN_SELECT:case Ie.IN_SELECT_IN_TABLE:case Ie.IN_FRAMESET:case Ie.AFTER_FRAMESET:{this._insertCharacters(t);break}case Ie.IN_BODY:case Ie.IN_CAPTION:case Ie.IN_CELL:case Ie.IN_TEMPLATE:case Ie.AFTER_BODY:case Ie.AFTER_AFTER_BODY:case Ie.AFTER_AFTER_FRAMESET:{eMe(this,t);break}case Ie.IN_TABLE:case Ie.IN_TABLE_BODY:case Ie.IN_ROW:{o3(this,t);break}case Ie.IN_TABLE_TEXT:{oMe(this,t);break}}}};function PNt(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):rMe(e,t),n}function DNt(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 MNt(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>=RNt;!l||c?(c&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(a)):(a=LNt(e,l),i===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(i),e.treeAdapter.appendChild(a,i),i=a)}return i}function LNt(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 $Nt(e,t,n){const i=e.treeAdapter.getTagName(t),r=o1(i);if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);r===$.TEMPLATE&&s===_t.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function FNt(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 SV(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 QNt(e,t){e._setDocumentType(t);const n=t.forceQuirks?_u.QUIRKS:yNt(t);bNt(t)||e._err(t,ct.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Ie.BEFORE_HTML}function yO(e,t){e._err(t,ct.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,_u.QUIRKS),e.insertionMode=Ie.BEFORE_HTML,e._processToken(t)}function zNt(e,t){t.tagID===$.HTML?(e._insertElement(t,_t.HTML),e.insertionMode=Ie.BEFORE_HEAD):eS(e,t)}function VNt(e,t){const n=t.tagID;(n===$.HTML||n===$.HEAD||n===$.BODY||n===$.BR)&&eS(e,t)}function eS(e,t){e._insertFakeRootElement(),e.insertionMode=Ie.BEFORE_HEAD,e._processToken(t)}function HNt(e,t){switch(t.tagID){case $.HTML:{hl(e,t);break}case $.HEAD:{e._insertElement(t,_t.HTML),e.headElement=e.openElements.current,e.insertionMode=Ie.IN_HEAD;break}default:tS(e,t)}}function qNt(e,t){const n=t.tagID;n===$.HEAD||n===$.BODY||n===$.HTML||n===$.BR?tS(e,t):e._err(t,ct.endTagWithoutMatchingOpenElement)}function tS(e,t){e._insertFakeElement(Ye.HEAD,$.HEAD),e.headElement=e.openElements.current,e.insertionMode=Ie.IN_HEAD,e._processToken(t)}function Vd(e,t){switch(t.tagID){case $.HTML:{hl(e,t);break}case $.BASE:case $.BASEFONT:case $.BGSOUND:case $.LINK:case $.META:{e._appendElement(t,_t.HTML),t.ackSelfClosing=!0;break}case $.TITLE:{e._switchToTextParsing(t,bo.RCDATA);break}case $.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,bo.RAWTEXT):(e._insertElement(t,_t.HTML),e.insertionMode=Ie.IN_HEAD_NO_SCRIPT);break}case $.NOFRAMES:case $.STYLE:{e._switchToTextParsing(t,bo.RAWTEXT);break}case $.SCRIPT:{e._switchToTextParsing(t,bo.SCRIPT_DATA);break}case $.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Ie.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Ie.IN_TEMPLATE);break}case $.HEAD:{e._err(t,ct.misplacedStartTagForHeadElement);break}default:nS(e,t)}}function WNt(e,t){switch(t.tagID){case $.HEAD:{e.openElements.pop(),e.insertionMode=Ie.AFTER_HEAD;break}case $.BODY:case $.BR:case $.HTML:{nS(e,t);break}case $.TEMPLATE:{l0(e,t);break}default:e._err(t,ct.endTagWithoutMatchingOpenElement)}}function l0(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==$.TEMPLATE&&e._err(t,ct.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped($.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ct.endTagWithoutMatchingOpenElement)}function nS(e,t){e.openElements.pop(),e.insertionMode=Ie.AFTER_HEAD,e._processToken(t)}function KNt(e,t){switch(t.tagID){case $.HTML:{hl(e,t);break}case $.BASEFONT:case $.BGSOUND:case $.HEAD:case $.LINK:case $.META:case $.NOFRAMES:case $.STYLE:{Vd(e,t);break}case $.NOSCRIPT:{e._err(t,ct.nestedNoscriptInHead);break}default:iS(e,t)}}function GNt(e,t){switch(t.tagID){case $.NOSCRIPT:{e.openElements.pop(),e.insertionMode=Ie.IN_HEAD;break}case $.BR:{iS(e,t);break}default:e._err(t,ct.endTagWithoutMatchingOpenElement)}}function iS(e,t){const n=t.type===Ei.EOF?ct.openElementsLeftAfterEof:ct.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Ie.IN_HEAD,e._processToken(t)}function XNt(e,t){switch(t.tagID){case $.HTML:{hl(e,t);break}case $.BODY:{e._insertElement(t,_t.HTML),e.framesetOk=!1,e.insertionMode=Ie.IN_BODY;break}case $.FRAMESET:{e._insertElement(t,_t.HTML),e.insertionMode=Ie.IN_FRAMESET;break}case $.BASE:case $.BASEFONT:case $.BGSOUND:case $.LINK:case $.META:case $.NOFRAMES:case $.SCRIPT:case $.STYLE:case $.TEMPLATE:case $.TITLE:{e._err(t,ct.abandonedHeadElementChild),e.openElements.push(e.headElement,$.HEAD),Vd(e,t),e.openElements.remove(e.headElement);break}case $.HEAD:{e._err(t,ct.misplacedStartTagForHeadElement);break}default:rS(e,t)}}function YNt(e,t){switch(t.tagID){case $.BODY:case $.HTML:case $.BR:{rS(e,t);break}case $.TEMPLATE:{l0(e,t);break}default:e._err(t,ct.endTagWithoutMatchingOpenElement)}}function rS(e,t){e._insertFakeElement(Ye.BODY,$.BODY),e.insertionMode=Ie.IN_BODY,sD(e,t)}function sD(e,t){switch(t.type){case Ei.CHARACTER:{tMe(e,t);break}case Ei.WHITESPACE_CHARACTER:{eMe(e,t);break}case Ei.COMMENT:{A8(e,t);break}case Ei.START_TAG:{hl(e,t);break}case Ei.END_TAG:{oD(e,t);break}case Ei.EOF:{sMe(e,t);break}}}function eMe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function tMe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function ZNt(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function JNt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function eRt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,_t.HTML),e.insertionMode=Ie.IN_FRAMESET)}function tRt(e,t){e.openElements.hasInButtonScope($.P)&&e._closePElement(),e._insertElement(t,_t.HTML)}function nRt(e,t){e.openElements.hasInButtonScope($.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&T8.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,_t.HTML)}function iRt(e,t){e.openElements.hasInButtonScope($.P)&&e._closePElement(),e._insertElement(t,_t.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function rRt(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope($.P)&&e._closePElement(),e._insertElement(t,_t.HTML),n||(e.formElement=e.openElements.current))}function sRt(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===$.LI&&r===$.LI||(n===$.DD||n===$.DT)&&(r===$.DD||r===$.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==$.ADDRESS&&r!==$.DIV&&r!==$.P&&e._isSpecialElement(e.openElements.items[i],r))break}e.openElements.hasInButtonScope($.P)&&e._closePElement(),e._insertElement(t,_t.HTML)}function oRt(e,t){e.openElements.hasInButtonScope($.P)&&e._closePElement(),e._insertElement(t,_t.HTML),e.tokenizer.state=bo.PLAINTEXT}function aRt(e,t){e.openElements.hasInScope($.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped($.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,_t.HTML),e.framesetOk=!1}function lRt(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Ye.A);n&&(SV(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,_t.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function cRt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,_t.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function uRt(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope($.NOBR)&&(SV(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,_t.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function dRt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,_t.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function fRt(e,t){e.treeAdapter.getDocumentMode(e.document)!==_u.QUIRKS&&e.openElements.hasInButtonScope($.P)&&e._closePElement(),e._insertElement(t,_t.HTML),e.framesetOk=!1,e.insertionMode=Ie.IN_TABLE}function nMe(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,_t.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function iMe(e){const t=HDe(e,sy.TYPE);return t!=null&&t.toLowerCase()===jNt}function hRt(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,_t.HTML),iMe(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function pRt(e,t){e._appendElement(t,_t.HTML),t.ackSelfClosing=!0}function mRt(e,t){e.openElements.hasInButtonScope($.P)&&e._closePElement(),e._appendElement(t,_t.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function gRt(e,t){t.tagName=Ye.IMG,t.tagID=$.IMG,nMe(e,t)}function bRt(e,t){e._insertElement(t,_t.HTML),e.skipNextNewLine=!0,e.tokenizer.state=bo.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Ie.TEXT}function yRt(e,t){e.openElements.hasInButtonScope($.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,bo.RAWTEXT)}function vRt(e,t){e.framesetOk=!1,e._switchToTextParsing(t,bo.RAWTEXT)}function Yte(e,t){e._switchToTextParsing(t,bo.RAWTEXT)}function xRt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,_t.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Ie.IN_TABLE||e.insertionMode===Ie.IN_CAPTION||e.insertionMode===Ie.IN_TABLE_BODY||e.insertionMode===Ie.IN_ROW||e.insertionMode===Ie.IN_CELL?Ie.IN_SELECT_IN_TABLE:Ie.IN_SELECT}function wRt(e,t){e.openElements.currentTagId===$.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,_t.HTML)}function ORt(e,t){e.openElements.hasInScope($.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,_t.HTML)}function kRt(e,t){e.openElements.hasInScope($.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion($.RTC),e._insertElement(t,_t.HTML)}function SRt(e,t){e._reconstructActiveFormattingElements(),YDe(t),kV(t),t.selfClosing?e._appendElement(t,_t.MATHML):e._insertElement(t,_t.MATHML),t.ackSelfClosing=!0}function ERt(e,t){e._reconstructActiveFormattingElements(),ZDe(t),kV(t),t.selfClosing?e._appendElement(t,_t.SVG):e._insertElement(t,_t.SVG),t.ackSelfClosing=!0}function Zte(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,_t.HTML)}function hl(e,t){switch(t.tagID){case $.I:case $.S:case $.B:case $.U:case $.EM:case $.TT:case $.BIG:case $.CODE:case $.FONT:case $.SMALL:case $.STRIKE:case $.STRONG:{cRt(e,t);break}case $.A:{lRt(e,t);break}case $.H1:case $.H2:case $.H3:case $.H4:case $.H5:case $.H6:{nRt(e,t);break}case $.P:case $.DL:case $.OL:case $.UL:case $.DIV:case $.DIR:case $.NAV:case $.MAIN:case $.MENU:case $.ASIDE:case $.CENTER:case $.FIGURE:case $.FOOTER:case $.HEADER:case $.HGROUP:case $.DIALOG:case $.DETAILS:case $.ADDRESS:case $.ARTICLE:case $.SEARCH:case $.SECTION:case $.SUMMARY:case $.FIELDSET:case $.BLOCKQUOTE:case $.FIGCAPTION:{tRt(e,t);break}case $.LI:case $.DD:case $.DT:{sRt(e,t);break}case $.BR:case $.IMG:case $.WBR:case $.AREA:case $.EMBED:case $.KEYGEN:{nMe(e,t);break}case $.HR:{mRt(e,t);break}case $.RB:case $.RTC:{ORt(e,t);break}case $.RT:case $.RP:{kRt(e,t);break}case $.PRE:case $.LISTING:{iRt(e,t);break}case $.XMP:{yRt(e,t);break}case $.SVG:{ERt(e,t);break}case $.HTML:{ZNt(e,t);break}case $.BASE:case $.LINK:case $.META:case $.STYLE:case $.TITLE:case $.SCRIPT:case $.BGSOUND:case $.BASEFONT:case $.TEMPLATE:{Vd(e,t);break}case $.BODY:{JNt(e,t);break}case $.FORM:{rRt(e,t);break}case $.NOBR:{uRt(e,t);break}case $.MATH:{SRt(e,t);break}case $.TABLE:{fRt(e,t);break}case $.INPUT:{hRt(e,t);break}case $.PARAM:case $.TRACK:case $.SOURCE:{pRt(e,t);break}case $.IMAGE:{gRt(e,t);break}case $.BUTTON:{aRt(e,t);break}case $.APPLET:case $.OBJECT:case $.MARQUEE:{dRt(e,t);break}case $.IFRAME:{vRt(e,t);break}case $.SELECT:{xRt(e,t);break}case $.OPTION:case $.OPTGROUP:{wRt(e,t);break}case $.NOEMBED:case $.NOFRAMES:{Yte(e,t);break}case $.FRAMESET:{eRt(e,t);break}case $.TEXTAREA:{bRt(e,t);break}case $.NOSCRIPT:{e.options.scriptingEnabled?Yte(e,t):Zte(e,t);break}case $.PLAINTEXT:{oRt(e,t);break}case $.COL:case $.TH:case $.TD:case $.TR:case $.HEAD:case $.FRAME:case $.TBODY:case $.TFOOT:case $.THEAD:case $.CAPTION:case $.COLGROUP:break;default:Zte(e,t)}}function CRt(e,t){if(e.openElements.hasInScope($.BODY)&&(e.insertionMode=Ie.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function TRt(e,t){e.openElements.hasInScope($.BODY)&&(e.insertionMode=Ie.AFTER_BODY,hMe(e,t))}function ARt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function _Rt(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope($.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped($.FORM):n&&e.openElements.remove(n))}function jRt(e){e.openElements.hasInButtonScope($.P)||e._insertFakeElement(Ye.P,$.P),e._closePElement()}function NRt(e){e.openElements.hasInListItemScope($.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion($.LI),e.openElements.popUntilTagNamePopped($.LI))}function RRt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function IRt(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function PRt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function DRt(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Ye.BR,$.BR),e.openElements.pop(),e.framesetOk=!1}function rMe(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!==$.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 oD(e,t){switch(t.tagID){case $.A:case $.B:case $.I:case $.S:case $.U:case $.EM:case $.TT:case $.BIG:case $.CODE:case $.FONT:case $.NOBR:case $.SMALL:case $.STRIKE:case $.STRONG:{SV(e,t);break}case $.P:{jRt(e);break}case $.DL:case $.UL:case $.OL:case $.DIR:case $.DIV:case $.NAV:case $.PRE:case $.MAIN:case $.MENU:case $.ASIDE:case $.BUTTON:case $.CENTER:case $.FIGURE:case $.FOOTER:case $.HEADER:case $.HGROUP:case $.DIALOG:case $.ADDRESS:case $.ARTICLE:case $.DETAILS:case $.SEARCH:case $.SECTION:case $.SUMMARY:case $.LISTING:case $.FIELDSET:case $.BLOCKQUOTE:case $.FIGCAPTION:{ARt(e,t);break}case $.LI:{NRt(e);break}case $.DD:case $.DT:{RRt(e,t);break}case $.H1:case $.H2:case $.H3:case $.H4:case $.H5:case $.H6:{IRt(e);break}case $.BR:{DRt(e);break}case $.BODY:{CRt(e,t);break}case $.HTML:{TRt(e,t);break}case $.FORM:{_Rt(e);break}case $.APPLET:case $.OBJECT:case $.MARQUEE:{PRt(e,t);break}case $.TEMPLATE:{l0(e,t);break}default:rMe(e,t)}}function sMe(e,t){e.tmplInsertionModeStack.length>0?fMe(e,t):EV(e,t)}function MRt(e,t){var n;t.tagID===$.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function LRt(e,t){e._err(t,ct.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function o3(e,t){if(e.openElements.currentTagId!==void 0&&JDe.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Ie.IN_TABLE_TEXT,t.type){case Ei.CHARACTER:{aMe(e,t);break}case Ei.WHITESPACE_CHARACTER:{oMe(e,t);break}}else sT(e,t)}function $Rt(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,_t.HTML),e.insertionMode=Ie.IN_CAPTION}function FRt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,_t.HTML),e.insertionMode=Ie.IN_COLUMN_GROUP}function BRt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Ye.COLGROUP,$.COLGROUP),e.insertionMode=Ie.IN_COLUMN_GROUP,CV(e,t)}function URt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,_t.HTML),e.insertionMode=Ie.IN_TABLE_BODY}function QRt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Ye.TBODY,$.TBODY),e.insertionMode=Ie.IN_TABLE_BODY,aD(e,t)}function zRt(e,t){e.openElements.hasInTableScope($.TABLE)&&(e.openElements.popUntilTagNamePopped($.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function VRt(e,t){iMe(t)?e._appendElement(t,_t.HTML):sT(e,t),t.ackSelfClosing=!0}function HRt(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,_t.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function pw(e,t){switch(t.tagID){case $.TD:case $.TH:case $.TR:{QRt(e,t);break}case $.STYLE:case $.SCRIPT:case $.TEMPLATE:{Vd(e,t);break}case $.COL:{BRt(e,t);break}case $.FORM:{HRt(e,t);break}case $.TABLE:{zRt(e,t);break}case $.TBODY:case $.TFOOT:case $.THEAD:{URt(e,t);break}case $.INPUT:{VRt(e,t);break}case $.CAPTION:{$Rt(e,t);break}case $.COLGROUP:{FRt(e,t);break}default:sT(e,t)}}function kE(e,t){switch(t.tagID){case $.TABLE:{e.openElements.hasInTableScope($.TABLE)&&(e.openElements.popUntilTagNamePopped($.TABLE),e._resetInsertionMode());break}case $.TEMPLATE:{l0(e,t);break}case $.BODY:case $.CAPTION:case $.COL:case $.COLGROUP:case $.HTML:case $.TBODY:case $.TD:case $.TFOOT:case $.TH:case $.THEAD:case $.TR:break;default:sT(e,t)}}function sT(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,sD(e,t),e.fosterParentingEnabled=n}function oMe(e,t){e.pendingCharacterTokens.push(t)}function aMe(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function vO(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===$.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===$.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===$.OPTGROUP&&e.openElements.pop();break}case $.OPTION:{e.openElements.currentTagId===$.OPTION&&e.openElements.pop();break}case $.SELECT:{e.openElements.hasInSelectScope($.SELECT)&&(e.openElements.popUntilTagNamePopped($.SELECT),e._resetInsertionMode());break}case $.TEMPLATE:{l0(e,t);break}}}function YRt(e,t){const n=t.tagID;n===$.CAPTION||n===$.TABLE||n===$.TBODY||n===$.TFOOT||n===$.THEAD||n===$.TR||n===$.TD||n===$.TH?(e.openElements.popUntilTagNamePopped($.SELECT),e._resetInsertionMode(),e._processStartTag(t)):uMe(e,t)}function ZRt(e,t){const n=t.tagID;n===$.CAPTION||n===$.TABLE||n===$.TBODY||n===$.TFOOT||n===$.THEAD||n===$.TR||n===$.TD||n===$.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped($.SELECT),e._resetInsertionMode(),e.onEndTag(t)):dMe(e,t)}function JRt(e,t){switch(t.tagID){case $.BASE:case $.BASEFONT:case $.BGSOUND:case $.LINK:case $.META:case $.NOFRAMES:case $.SCRIPT:case $.STYLE:case $.TEMPLATE:case $.TITLE:{Vd(e,t);break}case $.CAPTION:case $.COLGROUP:case $.TBODY:case $.TFOOT:case $.THEAD:{e.tmplInsertionModeStack[0]=Ie.IN_TABLE,e.insertionMode=Ie.IN_TABLE,pw(e,t);break}case $.COL:{e.tmplInsertionModeStack[0]=Ie.IN_COLUMN_GROUP,e.insertionMode=Ie.IN_COLUMN_GROUP,CV(e,t);break}case $.TR:{e.tmplInsertionModeStack[0]=Ie.IN_TABLE_BODY,e.insertionMode=Ie.IN_TABLE_BODY,aD(e,t);break}case $.TD:case $.TH:{e.tmplInsertionModeStack[0]=Ie.IN_ROW,e.insertionMode=Ie.IN_ROW,lD(e,t);break}default:e.tmplInsertionModeStack[0]=Ie.IN_BODY,e.insertionMode=Ie.IN_BODY,hl(e,t)}}function eIt(e,t){t.tagID===$.TEMPLATE&&l0(e,t)}function fMe(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped($.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):EV(e,t)}function tIt(e,t){t.tagID===$.HTML?hl(e,t):uR(e,t)}function hMe(e,t){var n;if(t.tagID===$.HTML){if(e.fragmentContext||(e.insertionMode=Ie.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===$.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 uR(e,t)}function uR(e,t){e.insertionMode=Ie.IN_BODY,sD(e,t)}function nIt(e,t){switch(t.tagID){case $.HTML:{hl(e,t);break}case $.FRAMESET:{e._insertElement(t,_t.HTML);break}case $.FRAME:{e._appendElement(t,_t.HTML),t.ackSelfClosing=!0;break}case $.NOFRAMES:{Vd(e,t);break}}}function iIt(e,t){t.tagID===$.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==$.FRAMESET&&(e.insertionMode=Ie.AFTER_FRAMESET))}function rIt(e,t){switch(t.tagID){case $.HTML:{hl(e,t);break}case $.NOFRAMES:{Vd(e,t);break}}}function sIt(e,t){t.tagID===$.HTML&&(e.insertionMode=Ie.AFTER_AFTER_FRAMESET)}function oIt(e,t){t.tagID===$.HTML?hl(e,t):uj(e,t)}function uj(e,t){e.insertionMode=Ie.IN_BODY,sD(e,t)}function aIt(e,t){switch(t.tagID){case $.HTML:{hl(e,t);break}case $.NOFRAMES:{Vd(e,t);break}}}function lIt(e,t){t.chars=Ss,e._insertCharacters(t)}function cIt(e,t){e._insertCharacters(t),e.framesetOk=!1}function pMe(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==_t.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function uIt(e,t){if(ENt(t))pMe(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),i=e.treeAdapter.getNamespaceURI(n);i===_t.MATHML?YDe(t):i===_t.SVG&&(CNt(t),ZDe(t)),kV(t),t.selfClosing?e._appendElement(t,i):e._insertElement(t,i),t.ackSelfClosing=!0}}function dIt(e,t){if(t.tagID===$.P||t.tagID===$.BR){pMe(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)===_t.HTML){e._endTagOutsideForeignContent(t);break}const r=e.treeAdapter.getTagName(i);if(r.toLowerCase()===t.tagName){t.tagName=r,e.openElements.shortenToLength(n);break}}}Ye.AREA,Ye.BASE,Ye.BASEFONT,Ye.BGSOUND,Ye.BR,Ye.COL,Ye.EMBED,Ye.FRAME,Ye.HR,Ye.IMG,Ye.INPUT,Ye.KEYGEN,Ye.LINK,Ye.META,Ye.PARAM,Ye.SOURCE,Ye.TRACK,Ye.WBR;const fIt=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,hIt=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Jte={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function mMe(e,t){const n=kIt(e),i=APe("type",{handlers:{root:pIt,element:mIt,text:gIt,comment:bMe,doctype:bIt,raw:vIt},unknown:xIt}),r={parser:n?new Xte(Jte):Xte.getFragmentParser(void 0,Jte),handle(l){i(l,r)},stitches:!1,options:t||{}};i(e,r),a1(r,Kf());const s=n?r.parser.document:r.parser.getFragment(),a=Sjt(s,{file:r.options.file});return r.stitches&&iT(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 gMe(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:Ei.CHARACTER,chars:e.value,location:oT(e)};a1(t,Kf(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function bIt(e,t){const n={type:Ei.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:oT(e)};a1(t,Kf(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function yIt(e,t){t.stitches=!0;const n=SIt(e);if("children"in e&&"children"in n){const i=mMe({type:"root",children:e.children},t.options);n.children=i.children}bMe({type:"comment",value:{stitch:n}},t)}function bMe(e,t){const n=e.value,i={type:Ei.COMMENT,data:n,location:oT(e)};a1(t,Kf(e)),t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken)}function vIt(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,yMe(t,Kf(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(fIt,"<$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 xIt(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))yIt(n,t);else{let i="";throw hIt.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 a1(e,t){yMe(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=bo.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 yMe(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 wIt(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===bo.PLAINTEXT)return;a1(t,Kf(e));const i=t.parser.openElements.current;let r="namespaceURI"in i?i.namespaceURI:$b.html;r===$b.html&&n==="svg"&&(r=$b.svg);const s=_jt({...e,children:[]},{space:r===$b.svg?"svg":"html"}),a={type:Ei.START_TAG,tagName:n,tagID:o1(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:oT(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function OIt(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Ljt.includes(n)||t.parser.tokenizer.state===bo.PLAINTEXT)return;a1(t,ZP(e));const i={type:Ei.END_TAG,tagName:n,tagID:o1(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:oT(e)};t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===bo.RCDATA||t.parser.tokenizer.state===bo.RAWTEXT||t.parser.tokenizer.state===bo.SCRIPT_DATA)&&(t.parser.tokenizer.state=bo.DATA)}function kIt(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function oT(e){const t=Kf(e)||{line:void 0,column:void 0,offset:void 0},n=ZP(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 SIt(e){return"children"in e?fw({...e,children:[]}):fw(e)}function EIt(e){return function(t,n){return mMe(t,{...e,file:n})}}const CIt="modulepreload",TIt=function(e){return"/"+e},ene={},Bs=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=TIt(c),c in ene)return;ene[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":CIt,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(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 AIt=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,_It=/[\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]/,jIt=/[\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]/,a3={Space_Separator:AIt,ID_Start:_It,ID_Continue:jIt},co={isSpaceSeparator(e){return typeof e=="string"&&a3.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||a3.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==="‍"||a3.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 j8,Tl,Rh,dR,pg,Nd,ua,TV,sS;var NIt=function(t,n){j8=String(t),Tl="start",Rh=[],dR=0,pg=1,Nd=0,ua=void 0,TV=void 0,sS=void 0;do ua=RIt(),DIt[Tl]();while(ua.type!=="eof");return typeof n=="function"?N8({"":sS},"",n):sS};function N8(e,t,n){const i=e[t];if(i!=null&&typeof i=="object")if(Array.isArray(i))for(let r=0;r0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const FAt={tokenize:WAt,partial:!0};function BAt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:VAt,continuation:{tokenize:HAt},exit:qAt}},text:{91:{name:"gfmFootnoteCall",tokenize:zAt},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:UAt,resolveTo:QAt}}}}function UAt(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=Nd(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 QAt(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 zAt(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||Kr(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return r.includes(Nd(i.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Kr(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 VAt(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||Kr(g))return n(g);if(g===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return s=Nd(i.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Kr(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),nr(e,m,"gfmFootnoteDefinitionWhitespace")):n(g)}function m(g){return t(g)}}function HAt(e,t,n){return e.check(tT,t,e.attempt(FAt,t,n))}function qAt(e){e.exit("gfmFootnoteDefinition")}function WAt(e,t,n){const i=this;return nr(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 KAt(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++,m);if(f<2&&!n)return c(g);const v=a.exit("strikethroughSequenceTemporary"),y=dw(g);return v._open=!y||y===2&&!!b,v._close=!b||b===2&&!!y,l(g)}}}class GAt{constructor(){this.map=[]}add(t,n,i){XAt(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 XAt(e,t,n,i){let r=0;if(!(n===0&&i.length===0)){for(;r-1;){const _=i.events[N][1].type;if(_==="lineEnding"||_==="linePrefix")N--;else break}const T=N>-1?i.events[N][1].type:null,j=T==="tableHead"||T==="tableRow"?k:c;return j===k&&i.parser.lazy[i.now().line]?n(A):j(A)}function c(A){return e.enter("tableHead"),e.enter("tableRow"),u(A)}function u(A){return A===124||(a=!0,s+=1),d(A)}function d(A){return A===null?n(A):In(A)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),m):n(A):Fi(A)?nr(e,d,"whitespace")(A):(s+=1,a&&(a=!1,r+=1),A===124?(e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(A)))}function f(A){return A===null||A===124||Kr(A)?(e.exit("data"),d(A)):(e.consume(A),A===92?h:f)}function h(A){return A===92||A===124?(e.consume(A),f):f(A)}function m(A){return i.interrupt=!1,i.parser.lazy[i.now().line]?n(A):(e.enter("tableDelimiterRow"),a=!1,Fi(A)?nr(e,g,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):g(A))}function g(A){return A===45||A===58?v(A):A===124?(a=!0,e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),b):S(A)}function b(A){return Fi(A)?nr(e,v,"whitespace")(A):v(A)}function v(A){return A===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(A),e.exit("tableDelimiterMarker"),y):A===45?(s+=1,y(A)):A===null||In(A)?O(A):S(A)}function y(A){return A===45?(e.enter("tableDelimiterFiller"),w(A)):S(A)}function w(A){return A===45?(e.consume(A),w):A===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(A),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(A))}function x(A){return Fi(A)?nr(e,O,"whitespace")(A):O(A)}function O(A){return A===124?g(A):A===null||In(A)?!a||r!==s?S(A):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(A)):S(A)}function S(A){return n(A)}function k(A){return e.enter("tableRow"),C(A)}function C(A){return A===124?(e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),C):A===null||In(A)?(e.exit("tableRow"),t(A)):Fi(A)?nr(e,C,"whitespace")(A):(e.enter("data"),E(A))}function E(A){return A===null||A===124||Kr(A)?(e.exit("data"),C(A)):(e.consume(A),A===92?R:E)}function R(A){return A===92||A===124?(e.consume(A),E):E(A)}}function e2t(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 GAt;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({},cv(t.events,r)),e.add(r,0,[["exit",s,t]]),s=void 0),s}function bte(e,t,n,i,r){const s=[],a=cv(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 cv(e,t){const n=e[t],i=n[0]==="enter"?"start":"end";return n[1][i]}const t2t={name:"tasklistCheck",tokenize:i2t};function n2t(){return{text:{91:t2t}}}function i2t(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 Kr(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 In(c)?t(c):Fi(c)?e.check({tokenize:r2t},t,n)(c):n(c)}}function r2t(e,t,n){return nr(e,i,"whitespace");function i(r){return r===null?n(r):t(r)}}function s2t(e){return lPe([jAt(),BAt(),KAt(e),ZAt(),n2t()])}const o2t={};function tDe(e){const t=this,n=e||o2t,i=t.data(),r=i.micromarkExtensions||(i.micromarkExtensions=[]),s=i.fromMarkdownExtensions||(i.fromMarkdownExtensions=[]),a=i.toMarkdownExtensions||(i.toMarkdownExtensions=[]);r.push(s2t(n)),s.push(CAt()),a.push(TAt(n))}const yte=function(e,t,n){const i=nT(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 iDe(e,t,n){return e.type==="element"?p2t(e,t,n):e.type==="text"?n.whitespace==="normal"?rDe(e,n):m2t(e):[]}function p2t(e,t,n){const i=sDe(e,n),r=e.children||[];let s=-1,a=[];if(f2t(e))return a;let l,c;for(S8(e)||Ote(e)&&yte(t,e,Ote)?c=` +`:d2t(e)?(l=2,c=2):nDe(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},m=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"],O={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},S={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},k=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:k.concat([{begin:/\(/,end:/\)/,keywords:O,contains:k.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+a+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:O,relevance:0},{begin:m,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:O,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:O,illegal:"",keywords:O,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function w2t(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=x2t(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 rD(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"],m=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._-]+)+/},w=["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"],O=["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"],S=["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:[...w,...x,"set","shopt",...O,...S]},contains:[m,e.SHEBANG(),g,f,s,a,y,l,c,u,d,n]}}function O2t(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},m=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],w={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:"("+a+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:v,relevance:0},{begin:m,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 k2t(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},m=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"],O={type:b,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},S={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},k=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:k.concat([{begin:/\(/,end:/\)/,keywords:O,contains:k.concat(["self"]),relevance:0}]),relevance:0},E={className:"function",begin:"("+a+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:O,relevance:0},{begin:m,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:O,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:O,illegal:"",keywords:O,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function S2t(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},m=e.inherit(h,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,m]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},v=e.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});h.contains=[b,g,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],m.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]},w={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},x=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",O={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,w,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,w,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+x+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,w],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]},O]}}const E2t=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_-]*/}}),C2t=["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"],T2t=["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"],A2t=[...C2t,...T2t],_2t=["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(),j2t=["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(),N2t=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),R2t=["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 aDe(e){const t=e.regex,n=E2t(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:":("+j2t.join("|")+")"},{begin:":(:)?("+N2t.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+R2t.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:_2t.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+A2t.join("|")+")\\b"}]}}function lDe(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 cDe(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:"uDe(e,t,n-1))}function dDe(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+uDe("(?:<"+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,kte,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},kte,u]}}const Ste="[A-Za-z$_][0-9A-Za-z$_]*",P2t=["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"],D2t=["true","false","null","undefined","NaN","Infinity"],fDe=["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"],hDe=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],pDe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],M2t=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],L2t=[].concat(pDe,fDe,hDe);function cV(e){const t=e.regex,n=(L,{after:B})=>{const M="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,B)=>{const M=L[0].length+L.index,H=L.input[M];if(H==="<"||H===","){B.ignoreMatch();return}H===">"&&(n(L,{after:M})||B.ignoreMatch());let K;const F=L.input.substring(M);if(K=F.match(/^\s*=/)){B.ignoreMatch();return}if((K=F.match(/^\s+extends\s+/))&&K.index===0){B.ignoreMatch();return}}},l={$pattern:Ste,keyword:P2t,literal:D2t,built_in:L2t,"variable.language":M2t},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:[]},m={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]},w={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const O=[].concat(w,h.contains),S=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(O)}]),k={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},C={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"}}]},E={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:{_:[...fDe,...hDe]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},A={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[k],illegal:/%/},N={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function T(L){return t.concat("(?!",L.join("|"),")")}const j={match:t.concat(/\b/,T([...pDe,"super","import"].map(L=>`${L}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},_={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},I={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},k]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[k]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:E},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,w,{match:/\$\d+/},f,E,{scope:"attr",match:i+t.lookahead(":"),relevance:0},P,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,e.REGEXP_MODE,{className:"function",begin:D,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:S}]}]},{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"]}]}]},A,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[k,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},_,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[k]},j,N,C,I,{match:/\$[(.]/}]}}function uV(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 dv="[0-9](_*[0-9])*",c2=`\\.(${dv})`,u2="[0-9a-fA-F](_*[0-9a-fA-F])*",$2t={className:"number",variants:[{begin:`(\\b(${dv})((${c2})|\\.)?|(${c2}))[eE][+-]?(${dv})[fFdD]?\\b`},{begin:`\\b(${dv})((${c2})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${c2})[fFdD]?\\b`},{begin:`\\b(${dv})[fFdD]\\b`},{begin:`\\b0[xX]((${u2})\\.?|(${u2})?\\.(${u2}))[pP][+-]?(${dv})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${u2})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function F2t(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=$2t,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 B2t=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_-]*/}}),U2t=["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"],Q2t=["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"],z2t=[...U2t,...Q2t],V2t=["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(),mDe=["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(),gDe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),H2t=["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(),q2t=mDe.concat(gDe).sort().reverse();function W2t(e){const t=B2t(e),n=q2t,i="and or not only",r="[\\w-]+",s="("+r+"|@\\{"+r+"\\})",a=[],l=[],c=function(x){return{className:"string",begin:"~?"+x+".*?"+x}},u=function(x,O,S){return{className:x,begin:O,relevance:S}},d={$pattern:/[a-z-]+/,keyword:i,attribute:V2t.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}),m={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("+H2t.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,m,u("keyword","all\\b"),u("variable","@\\{"+r+"\\}"),{begin:"\\b("+z2t.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:":("+mDe.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+gDe.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},w={begin:r+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,v,w,g,y,m,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function K2t(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 dV(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 m=[n,c];return[u,d,f,h].forEach(y=>{y.contains=y.contains.concat(m)}),m=m.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:m},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:m}]}]},n,s,u,d,{className:"quote",begin:"^>\\s+",contains:m,end:"$"},r,i,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function G2t(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 X2t(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 w=y==="\\1"?y:t.concat(y,v);return t.concat(t.concat("(?:",b,")"),v,/(?:\\.|[^\\\/])*?/,w,/(?:\\.|[^\\\/])*?/,y,i)},m=(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:m("(?:m|qr)?",/\//,/\//)},{begin:m("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:m("m|qr",/\(/,/\)/)},{begin:m("m|qr",/\[/,/\]/)},{begin:m("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 Y2t(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":(_,I)=>{I.data._beginMatch=_[1]||_[2]},"on:end":(_,I)=>{I.data._beginMatch!==_[1]&&I.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),m=`[ +]`,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"],w=["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"],O={keyword:y,literal:(_=>{const I=[];return _.forEach(D=>{I.push(D),D.toLowerCase()===D?I.push(D.toUpperCase()):I.push(D.toLowerCase())}),I})(v),built_in:w},S=_=>_.map(I=>I.replace(/\|\d+$/,"")),k={variants:[{match:[/new/,t.concat(m,"+"),t.concat("(?!",S(w).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},C=t.concat(i,"\\b(?!\\()"),E={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),C],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),C],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"}}]},R={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},A={relevance:0,begin:/\(/,end:/\)/,keywords:O,contains:[R,a,E,e.C_BLOCK_COMMENT_MODE,g,b,k]},N={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",S(y).join("\\b|"),"|",S(w).join("\\b|"),"\\b)"),i,t.concat(m,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[A]};A.contains.push(N);const T=[R,E,e.C_BLOCK_COMMENT_MODE,g,b,k],j={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",...T]},...T,{scope:"meta",variants:[{match:r},{match:s}]}]};return{case_insensitive:!1,keywords:O,contains:[j,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,N,E,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},k,{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:O,contains:["self",j,a,E,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 Z2t(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 bDe(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function hV(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])*",m=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,g=`\\b|${i.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${m}))[eE][+-]?(${h})[jJ]?(?=${g})`},{begin:`(${m})[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 J2t(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function e_t(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 t_t(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",m="[0-9](_?[0-9])*",g={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${m}))?([eE][+-]?(${m})|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}]},k=[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=k,b.contains=k;const A=[{begin:/^\s*=>/,starts:{end:"$",contains:k}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:k}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(A).concat(u).concat(k)}}function yDe(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 n_t=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_-]*/}}),i_t=["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"],r_t=["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"],s_t=[...i_t,...r_t],o_t=["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(),a_t=["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(),l_t=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),c_t=["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 vDe(e){const t=n_t(e),n=l_t,i=a_t,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("+s_t.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("+c_t.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:o_t.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 u_t(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function xDe(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"],m=d,g=[...u,...c].filter(S=>!d.includes(S)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...m),/\s*\(/),relevance:0,keywords:{built_in:m}};function w(S){return t.concat(/\b/,t.either(...S.map(k=>k.replace(/\s+/,"\\s+"))),/\b/)}const x={scope:"keyword",match:w(h),relevance:0};function O(S,{exceptions:k,when:C}={}){const E=C;return k=k||[],S.map(R=>R.match(/\|\d+$/)||k.includes(R)?R:E(R)?`${R}|0`:R)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:O(g,{when:S=>S.length<3}),literal:s,type:l,built_in:f},contains:[{scope:"type",match:w(a)},x,y,b,i,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function wDe(e){return e?typeof e=="string"?e:e.source:null}function bO(e){return Pr("(?=",e,")")}function Pr(...e){return e.map(n=>wDe(n)).join("")}function d_t(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Sl(...e){return"("+(d_t(e).capture?"":"?:")+e.map(i=>wDe(i)).join("|")+")"}const pV=e=>Pr(/\b/,e,/\w$/.test(e)?/\b/:/\B/),f_t=["Protocol","Type"].map(pV),Ete=["init","self"].map(pV),h_t=["Any","Self"],i3=["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"],Cte=["false","nil","true"],p_t=["assignment","associativity","higherThan","left","lowerThan","none","right"],m_t=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Tte=["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"],ODe=Sl(/[/=\-+!*%<>&|^~?]/,/[\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]/),kDe=Sl(ODe,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),r3=Pr(ODe,kDe,"*"),SDe=Sl(/[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]/),oR=Sl(SDe,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),uf=Pr(SDe,oR,"*"),d2=Pr(/[A-Z]/,oR,"*"),g_t=["attached","autoclosure",Pr(/convention\(/,Sl("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Pr(/objc\(/,uf,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],b_t=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function y_t(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,Sl(...f_t,...Ete)],className:{2:"keyword"}},s={match:Pr(/\./,Sl(...i3)),relevance:0},a=i3.filter(Ce=>typeof Ce=="string").concat(["_|0"]),l=i3.filter(Ce=>typeof Ce!="string").concat(h_t).map(pV),c={variants:[{className:"keyword",match:Sl(...l,...Ete)}]},u={$pattern:Sl(/\b\w+/,/#\w+/),keyword:a.concat(m_t),literal:Cte},d=[r,s,c],f={match:Pr(/\./,Sl(...Tte)),relevance:0},h={className:"built_in",match:Pr(/\b/,Sl(...Tte),/(?=\()/)},m=[f,h],g={match:/->/,relevance:0},b={className:"operator",relevance:0,variants:[{match:r3},{match:`\\.(\\.|${kDe})+`}]},v=[g,b],y="([0-9]_*)+",w="([0-9a-fA-F]_*)+",x={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${w})(\\.(${w}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},O=(Ce="")=>({className:"subst",variants:[{match:Pr(/\\/,Ce,/[0\\tnr"']/)},{match:Pr(/\\/,Ce,/u\{[0-9a-fA-F]{1,8}\}/)}]}),S=(Ce="")=>({className:"subst",match:Pr(/\\/,Ce,/[\t ]*(?:[\r\n]|\r\n)/)}),k=(Ce="")=>({className:"subst",label:"interpol",begin:Pr(/\\/,Ce,/\(/),end:/\)/}),C=(Ce="")=>({begin:Pr(Ce,/"""/),end:Pr(/"""/,Ce),contains:[O(Ce),S(Ce),k(Ce)]}),E=(Ce="")=>({begin:Pr(Ce,/"/),end:Pr(/"/,Ce),contains:[O(Ce),k(Ce)]}),R={className:"string",variants:[C(),C("#"),C("##"),C("###"),E(),E("#"),E("##"),E("###")]},A=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],N={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:A},T=Ce=>{const le=Pr(Ce,/\//),fe=Pr(/\//,Ce);return{begin:le,end:fe,contains:[...A,{scope:"comment",begin:`#(?!.*${fe})`,end:/$/}]}},j={scope:"regexp",variants:[T("###"),T("##"),T("#"),N]},_={match:Pr(/`/,uf,/`/)},I={className:"variable",match:/\$\d+/},D={className:"variable",match:`\\$${oR}+`},P=[_,I,D],L={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:b_t,contains:[...v,x,R]}]}},B={scope:"keyword",match:Pr(/@/,Sl(...g_t),bO(Sl(/\(/,/\s+/)))},M={scope:"meta",match:Pr(/@/,uf)},H=[L,B,M],K={match:bO(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Pr(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,oR,"+")},{className:"type",match:d2,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Pr(/\s+&\s+/,bO(d2)),relevance:0}]},F={begin://,keywords:u,contains:[...i,...d,...H,g,K]};K.contains.push(F);const q={match:Pr(uf,/\s*:/),keywords:"_|0",relevance:0},Q={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",q,...i,j,...d,...m,...v,x,R,...P,...H,K]},X={begin://,keywords:"repeat each",contains:[...i,K]},ne={begin:Sl(bO(Pr(uf,/\s*:/)),bO(Pr(uf,/\s+/,uf,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:uf}]},z={begin:/\(/,end:/\)/,keywords:u,contains:[ne,...i,...d,...v,x,R,...H,K,Q],endsParent:!0,illegal:/["']/},Y={match:[/(func|macro)/,/\s+/,Sl(_.match,uf,r3)],className:{1:"keyword",3:"title.function"},contains:[X,z,t],illegal:[/\[/,/%/]},ae={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[X,z,t],illegal:/\[|%/},Ee={match:[/operator/,/\s+/,r3],className:{1:"keyword",3:"title"}},Z={begin:[/precedencegroup/,/\s+/,d2],className:{1:"keyword",3:"title"},contains:[K],keywords:[...p_t,...Cte],end:/}/},G={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},te={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},de={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,uf,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[X,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:d2},...d],relevance:0}]};for(const Ce of R.variants){const le=Ce.contains.find(ce=>ce.label==="interpol");le.keywords=u;const fe=[...d,...m,...v,x,R,...P];le.contains=[...fe,{begin:/\(/,end:/\)/,contains:["self",...fe]}]}return{name:"Swift",keywords:u,contains:[...i,Y,ae,G,te,de,Ee,Z,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},j,...d,...m,...v,x,R,...P,...H,K,Q]}}const aR="[A-Za-z$_][0-9A-Za-z$_]*",EDe=["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"],CDe=["true","false","null","undefined","NaN","Infinity"],TDe=["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"],ADe=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],_De=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],jDe=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],NDe=[].concat(_De,TDe,ADe);function v_t(e){const t=e.regex,n=(L,{after:B})=>{const M="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,B)=>{const M=L[0].length+L.index,H=L.input[M];if(H==="<"||H===","){B.ignoreMatch();return}H===">"&&(n(L,{after:M})||B.ignoreMatch());let K;const F=L.input.substring(M);if(K=F.match(/^\s*=/)){B.ignoreMatch();return}if((K=F.match(/^\s+extends\s+/))&&K.index===0){B.ignoreMatch();return}}},l={$pattern:aR,keyword:EDe,literal:CDe,built_in:NDe,"variable.language":jDe},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:[]},m={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]},w={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]},x=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,{match:/\$\d+/},f];h.contains=x.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(x)});const O=[].concat(w,h.contains),S=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(O)}]),k={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},C={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"}}]},E={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:{_:[...TDe,...ADe]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},A={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[k],illegal:/%/},N={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function T(L){return t.concat("(?!",L.join("|"),")")}const j={match:t.concat(/\b/,T([..._De,"super","import"].map(L=>`${L}\\s*\\(`)),i,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},_={begin:t.concat(/\./,t.lookahead(t.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},I={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},k]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[k]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:E},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,g,b,v,w,{match:/\$\d+/},f,E,{scope:"attr",match:i+t.lookahead(":"),relevance:0},P,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,e.REGEXP_MODE,{className:"function",begin:D,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:S}]}]},{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"]}]}]},A,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[k,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},_,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[k]},j,N,C,I,{match:/\$[(.]/}]}}function mV(e){const t=e.regex,n=v_t(e),i=aR,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:aR,keyword:EDe.concat(c),literal:CDe,built_in:NDe.concat(r),"variable.language":jDe},d={className:"meta",begin:"@"+i},f=(b,v,y)=>{const w=b.contains.findIndex(x=>x.label===v);if(w===-1)throw new Error("can not find mode to replace");b.contains.splice(w,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(b=>b.scope==="attr"),m=Object.assign({},h,{match:t.concat(i,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,m]),n.contains=n.contains.concat([d,s,a,m]),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 x_t(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 w_t(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 RDe(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 gV(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"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},g={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[m],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),m.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const O_t={arduino:w2t,bash:rD,c:O2t,cpp:k2t,csharp:S2t,css:aDe,diff:lDe,go:cDe,graphql:I2t,ini:lV,java:dDe,javascript:cV,json:uV,kotlin:F2t,less:W2t,lua:K2t,makefile:dV,markdown:fV,objectivec:G2t,perl:X2t,php:Y2t,"php-template":Z2t,plaintext:bDe,python:hV,"python-repl":J2t,r:e_t,ruby:t_t,rust:yDe,scss:vDe,shell:u_t,sql:xDe,swift:y_t,typescript:mV,vbnet:x_t,wasm:w_t,xml:RDe,yaml:gV};function IDe(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)&&IDe(n)}),e}let Ate=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function PDe(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function _m(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 k_t="",_te=e=>!!e.scope,S_t=(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 E_t{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=PDe(t)}openNode(t){if(!_te(t))return;const n=S_t(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){_te(t)&&(this.buffer+=k_t)}value(){return this.buffer}span(t){this.buffer+=``}}const jte=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class bV{constructor(){this.rootNode=jte(),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=jte({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=>{bV._collapse(n)}))}}class C_t extends bV{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 E_t(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function wE(e){return e?typeof e=="string"?e:e.source:null}function DDe(e){return l0("(?=",e,")")}function T_t(e){return l0("(?:",e,")*")}function A_t(e){return l0("(?:",e,")?")}function l0(...e){return e.map(n=>wE(n)).join("")}function __t(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function yV(...e){return"("+(__t(e).capture?"":"?:")+e.map(i=>wE(i)).join("|")+")"}function MDe(e){return new RegExp(e.toString()+"|").exec("").length-1}function j_t(e,t){const n=e&&e.exec(t);return n&&n.index===0}const N_t=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function vV(e,{joinWith:t}){let n=0;return e.map(i=>{n+=1;const r=n;let s=wE(i),a="";for(;s.length>0;){const l=N_t.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 R_t=/\b\B/,LDe="[a-zA-Z]\\w*",xV="[a-zA-Z_]\\w*",$De="\\b\\d+(\\.\\d+)?",FDe="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",BDe="\\b(0b[01]+)",I_t="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",P_t=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=l0(t,/.*\b/,e.binary,/\b.*/)),_m({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},e)},OE={begin:"\\\\[\\s\\S]",relevance:0},D_t={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[OE]},M_t={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[OE]},L_t={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/},sD=function(e,t,n={}){const i=_m({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=yV("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:l0(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},$_t=sD("//","$"),F_t=sD("/\\*","\\*/"),B_t=sD("#","$"),U_t={scope:"number",begin:$De,relevance:0},Q_t={scope:"number",begin:FDe,relevance:0},z_t={scope:"number",begin:BDe,relevance:0},V_t={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[OE,{begin:/\[/,end:/\]/,relevance:0,contains:[OE]}]},H_t={scope:"title",begin:LDe,relevance:0},q_t={scope:"title",begin:xV,relevance:0},W_t={begin:"\\.\\s*"+xV,relevance:0},K_t=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 f2=Object.freeze({__proto__:null,APOS_STRING_MODE:D_t,BACKSLASH_ESCAPE:OE,BINARY_NUMBER_MODE:z_t,BINARY_NUMBER_RE:BDe,COMMENT:sD,C_BLOCK_COMMENT_MODE:F_t,C_LINE_COMMENT_MODE:$_t,C_NUMBER_MODE:Q_t,C_NUMBER_RE:FDe,END_SAME_AS_BEGIN:K_t,HASH_COMMENT_MODE:B_t,IDENT_RE:LDe,MATCH_NOTHING_RE:R_t,METHOD_GUARD:W_t,NUMBER_MODE:U_t,NUMBER_RE:$De,PHRASAL_WORDS_MODE:L_t,QUOTE_STRING_MODE:M_t,REGEXP_MODE:V_t,RE_STARTERS_RE:I_t,SHEBANG:P_t,TITLE_MODE:H_t,UNDERSCORE_IDENT_RE:xV,UNDERSCORE_TITLE_MODE:q_t});function G_t(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function X_t(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Y_t(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=G_t,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Z_t(e,t){Array.isArray(e.illegal)&&(e.illegal=yV(...e.illegal))}function J_t(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 ejt(e,t){e.relevance===void 0&&(e.relevance=1)}const tjt=(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=l0(n.beforeMatch,DDe(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},njt=["of","and","for","in","not","or","if","then","parent","list","value"],ijt="keyword";function UDe(e,t,n=ijt){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,UDe(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,rjt(c[0],c[1])]})}}function rjt(e,t){return t?Number(t):sjt(e)?0:1}function sjt(e){return njt.includes(e.toLowerCase())}const Nte={},sy=e=>{console.error(e)},Rte=(e,...t)=>{console.log(`WARN: ${e}`,...t)},q0=(e,t)=>{Nte[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Nte[`${e}/${t}`]=!0)},lR=new Error;function QDe(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+=MDe(t[l-1]);e[n]=a,e[n]._emit=s,e[n]._multi=!0}function ojt(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw sy("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),lR;if(typeof e.beginScope!="object"||e.beginScope===null)throw sy("beginScope must be object"),lR;QDe(e,e.begin,{key:"beginScope"}),e.begin=vV(e.begin,{joinWith:""})}}function ajt(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw sy("skip, excludeEnd, returnEnd not compatible with endScope: {}"),lR;if(typeof e.endScope!="object"||e.endScope===null)throw sy("endScope must be object"),lR;QDe(e,e.end,{key:"endScope"}),e.end=vV(e.end,{joinWith:""})}}function ljt(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function cjt(e){ljt(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),ojt(e),ajt(e)}function ujt(e){function t(a,l){return new RegExp(wE(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+=MDe(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(vV(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;[X_t,J_t,cjt,tjt].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[Y_t,Z_t,ejt].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=UDe(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=wE(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 djt(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=_m(e.classNameAliases||{}),s(e)}function zDe(e){return e?e.endsWithParent||zDe(e.starts):!1}function djt(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return _m(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:zDe(e)?_m(e,{starts:e.starts?_m(e.starts):null}):Object.isFrozen(e)?_m(e):e}var fjt="11.11.1";class hjt extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const s3=PDe,Ite=_m,Pte=Symbol("nomatch"),pjt=7,VDe=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:C_t};function c(D){return l.noHighlightRe.test(D)}function u(D){let P=D.className+" ";P+=D.parentNode?D.parentNode.className:"";const L=l.languageDetectRe.exec(P);if(L){const B=E(L[1]);return B||(Rte(s.replace("{}",L[1])),Rte("Falling back to no-highlight mode for this block.",D)),B?L[1]:"no-highlight"}return P.split(/\s+/).find(B=>c(B)||E(B))}function d(D,P,L){let B="",M="";typeof P=="object"?(B=D,L=P.ignoreIllegals,M=P.language):(q0("10.7.0","highlight(lang, code, ...args) has been deprecated."),q0("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),M=D,B=P),L===void 0&&(L=!0);const H={code:B,language:M};_("before:highlight",H);const K=H.result?H.result:f(H.language,H.code,L);return K.code=H.code,_("after:highlight",K),K}function f(D,P,L,B){const M=Object.create(null);function H(re,ve){return re.keywords[ve]}function K(){if(!fe.keywords){Te.addText(Me);return}let re=0;fe.keywordPatternRe.lastIndex=0;let ve=fe.keywordPatternRe.exec(Me),be="";for(;ve;){be+=Me.substring(re,ve.index);const xe=de.case_insensitive?ve[0].toLowerCase():ve[0],Ke=H(fe,xe);if(Ke){const[Ze,he]=Ke;if(Te.addText(be),be="",M[xe]=(M[xe]||0)+1,M[xe]<=pjt&&(we+=he),Ze.startsWith("_"))be+=ve[0];else{const ye=de.classNameAliases[Ze]||Ze;Q(ve[0],ye)}}else be+=ve[0];re=fe.keywordPatternRe.lastIndex,ve=fe.keywordPatternRe.exec(Me)}be+=Me.substring(re),Te.addText(be)}function F(){if(Me==="")return;let re=null;if(typeof fe.subLanguage=="string"){if(!t[fe.subLanguage]){Te.addText(Me);return}re=f(fe.subLanguage,Me,!0,ce[fe.subLanguage]),ce[fe.subLanguage]=re._top}else re=m(Me,fe.subLanguage.length?fe.subLanguage:null);fe.relevance>0&&(we+=re.relevance),Te.__addSublanguage(re._emitter,re.language)}function q(){fe.subLanguage!=null?F():K(),Me=""}function Q(re,ve){re!==""&&(Te.startScope(ve),Te.addText(re),Te.endScope())}function X(re,ve){let be=1;const xe=ve.length-1;for(;be<=xe;){if(!re._emit[be]){be++;continue}const Ke=de.classNameAliases[re[be]]||re[be],Ze=ve[be];Ke?Q(Ze,Ke):(Me=Ze,K(),Me=""),be++}}function ne(re,ve){return re.scope&&typeof re.scope=="string"&&Te.openNode(de.classNameAliases[re.scope]||re.scope),re.beginScope&&(re.beginScope._wrap?(Q(Me,de.classNameAliases[re.beginScope._wrap]||re.beginScope._wrap),Me=""):re.beginScope._multi&&(X(re.beginScope,ve),Me="")),fe=Object.create(re,{parent:{value:fe}}),fe}function z(re,ve,be){let xe=j_t(re.endRe,be);if(xe){if(re["on:end"]){const Ke=new Ate(re);re["on:end"](ve,Ke),Ke.isMatchIgnored&&(xe=!1)}if(xe){for(;re.endsParent&&re.parent;)re=re.parent;return re}}if(re.endsWithParent)return z(re.parent,ve,be)}function Y(re){return fe.matcher.regexIndex===0?(Me+=re[0],1):(je=!0,0)}function ae(re){const ve=re[0],be=re.rule,xe=new Ate(be),Ke=[be.__beforeBegin,be["on:begin"]];for(const Ze of Ke)if(Ze&&(Ze(re,xe),xe.isMatchIgnored))return Y(ve);return be.skip?Me+=ve:(be.excludeBegin&&(Me+=ve),q(),!be.returnBegin&&!be.excludeBegin&&(Me=ve)),ne(be,re),be.returnBegin?0:ve.length}function Ee(re){const ve=re[0],be=P.substring(re.index),xe=z(fe,re,be);if(!xe)return Pte;const Ke=fe;fe.endScope&&fe.endScope._wrap?(q(),Q(ve,fe.endScope._wrap)):fe.endScope&&fe.endScope._multi?(q(),X(fe.endScope,re)):Ke.skip?Me+=ve:(Ke.returnEnd||Ke.excludeEnd||(Me+=ve),q(),Ke.excludeEnd&&(Me=ve));do fe.scope&&Te.closeNode(),!fe.skip&&!fe.subLanguage&&(we+=fe.relevance),fe=fe.parent;while(fe!==xe.parent);return xe.starts&&ne(xe.starts,re),Ke.returnEnd?0:ve.length}function Z(){const re=[];for(let ve=fe;ve!==de;ve=ve.parent)ve.scope&&re.unshift(ve.scope);re.forEach(ve=>Te.openNode(ve))}let G={};function te(re,ve){const be=ve&&ve[0];if(Me+=re,be==null)return q(),0;if(G.type==="begin"&&ve.type==="end"&&G.index===ve.index&&be===""){if(Me+=P.slice(ve.index,ve.index+1),!r){const xe=new Error(`0 width match regex (${D})`);throw xe.languageName=D,xe.badRule=G.rule,xe}return 1}if(G=ve,ve.type==="begin")return ae(ve);if(ve.type==="illegal"&&!L){const xe=new Error('Illegal lexeme "'+be+'" for mode "'+(fe.scope||"")+'"');throw xe.mode=fe,xe}else if(ve.type==="end"){const xe=Ee(ve);if(xe!==Pte)return xe}if(ve.type==="illegal"&&be==="")return Me+=` +`,1;if(ke>1e5&&ke>ve.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Me+=be,be.length}const de=E(D);if(!de)throw sy(s.replace("{}",D)),new Error('Unknown language: "'+D+'"');const Ce=ujt(de);let le="",fe=B||Ce;const ce={},Te=new l.__emitter(l);Z();let Me="",we=0,Ue=0,ke=0,je=!1;try{if(de.__emitTokens)de.__emitTokens(P,Te);else{for(fe.matcher.considerAll();;){ke++,je?je=!1:fe.matcher.considerAll(),fe.matcher.lastIndex=Ue;const re=fe.matcher.exec(P);if(!re)break;const ve=P.substring(Ue,re.index),be=te(ve,re);Ue=re.index+be}te(P.substring(Ue))}return Te.finalize(),le=Te.toHTML(),{language:D,value:le,relevance:we,illegal:!1,_emitter:Te,_top:fe}}catch(re){if(re.message&&re.message.includes("Illegal"))return{language:D,value:s3(P),illegal:!0,relevance:0,_illegalBy:{message:re.message,index:Ue,context:P.slice(Ue-100,Ue+100),mode:re.mode,resultSoFar:le},_emitter:Te};if(r)return{language:D,value:s3(P),illegal:!1,relevance:0,errorRaised:re,_emitter:Te,_top:fe};throw re}}function h(D){const P={value:s3(D),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return P._emitter.addText(D),P}function m(D,P){P=P||l.languages||Object.keys(t);const L=h(D),B=P.filter(E).filter(A).map(q=>f(q,D,!1));B.unshift(L);const M=B.sort((q,Q)=>{if(q.relevance!==Q.relevance)return Q.relevance-q.relevance;if(q.language&&Q.language){if(E(q.language).supersetOf===Q.language)return 1;if(E(Q.language).supersetOf===q.language)return-1}return 0}),[H,K]=M,F=H;return F.secondBest=K,F}function g(D,P,L){const B=P&&n[P]||L;D.classList.add("hljs"),D.classList.add(`language-${B}`)}function b(D){let P=null;const L=u(D);if(c(L))return;if(_("before:highlightElement",{el:D,language:L}),D.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",D);return}if(D.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(D)),l.throwUnescapedHTML))throw new hjt("One of your code blocks includes unescaped HTML.",D.innerHTML);P=D;const B=P.textContent,M=L?d(B,{language:L,ignoreIllegals:!0}):m(B);D.innerHTML=M.value,D.dataset.highlighted="yes",g(D,L,M.language),D.result={language:M.language,re:M.relevance,relevance:M.relevance},M.secondBest&&(D.secondBest={language:M.secondBest.language,relevance:M.secondBest.relevance}),_("after:highlightElement",{el:D,result:M,text:B})}function v(D){l=Ite(l,D)}const y=()=>{O(),q0("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function w(){O(),q0("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let x=!1;function O(){function D(){O()}if(document.readyState==="loading"){x||window.addEventListener("DOMContentLoaded",D,!1),x=!0;return}document.querySelectorAll(l.cssSelector).forEach(b)}function S(D,P){let L=null;try{L=P(e)}catch(B){if(sy("Language definition for '{}' could not be registered.".replace("{}",D)),r)sy(B);else throw B;L=a}L.name||(L.name=D),t[D]=L,L.rawDefinition=P.bind(null,e),L.aliases&&R(L.aliases,{languageName:D})}function k(D){delete t[D];for(const P of Object.keys(n))n[P]===D&&delete n[P]}function C(){return Object.keys(t)}function E(D){return D=(D||"").toLowerCase(),t[D]||t[n[D]]}function R(D,{languageName:P}){typeof D=="string"&&(D=[D]),D.forEach(L=>{n[L.toLowerCase()]=P})}function A(D){const P=E(D);return P&&!P.disableAutodetect}function N(D){D["before:highlightBlock"]&&!D["before:highlightElement"]&&(D["before:highlightElement"]=P=>{D["before:highlightBlock"](Object.assign({block:P.el},P))}),D["after:highlightBlock"]&&!D["after:highlightElement"]&&(D["after:highlightElement"]=P=>{D["after:highlightBlock"](Object.assign({block:P.el},P))})}function T(D){N(D),i.push(D)}function j(D){const P=i.indexOf(D);P!==-1&&i.splice(P,1)}function _(D,P){const L=D;i.forEach(function(B){B[L]&&B[L](P)})}function I(D){return q0("10.7.0","highlightBlock will be removed entirely in v12.0"),q0("10.7.0","Please use highlightElement now."),b(D)}Object.assign(e,{highlight:d,highlightAuto:m,highlightAll:O,highlightElement:b,highlightBlock:I,configure:v,initHighlighting:y,initHighlightingOnLoad:w,registerLanguage:S,unregisterLanguage:k,listLanguages:C,getLanguage:E,registerAliases:R,autoDetection:A,inherit:Ite,addPlugin:T,removePlugin:j}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=fjt,e.regex={concat:l0,lookahead:DDe,either:yV,optional:A_t,anyNumberOfTimes:T_t};for(const D in f2)typeof f2[D]=="object"&&IDe(f2[D]);return Object.assign(e,f2),e},hw=VDe({});hw.newInstance=()=>VDe({});var mjt=hw;hw.HighlightJS=hw;hw.default=hw;const Ha=_w(mjt),Dte={},gjt="hljs-";function bjt(e){const t=Ha.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||Dte,h=typeof f.prefix=="string"?f.prefix:gjt;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:yjt,classPrefix:h});const m=t.highlight(u,{ignoreIllegals:!0,language:c});if(m.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:m.errorRaised});const g=m._emitter.root,b=g.data;return b.language=m.language,b.relevance=m.relevance,g}function i(c,u){const f=(u||Dte).subset||r();let h=-1,m=0,g;for(;++hm&&(m=v.data.relevance,g=v)}return g||{type:"root",children:[],data:{language:void 0,relevance:m}}}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 yjt{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 vjt={};function Mte(e){const t=e||vjt,n=t.aliases,i=t.detect||!1,r=t.languages||O_t,s=t.plainText,a=t.prefix,l=t.subset;let c="hljs";const u=bjt(r);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");c=d===-1?a:a.slice(0,d)}return function(d,f){iT(d,"element",function(h,m,g){if(h.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const b=xjt(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=h2t(h,{whitespace:"pre"});let y;try{y=b?u.highlight(b,v,{prefix:a}):u.highlightAuto(v,{prefix:a,subset:l})}catch(w){const x=w;if(b&&/Unknown language/.test(x.message)){f.message("Cannot highlight as `"+b+"`, it’s not registered",{ancestors:[g,h],cause:x,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw x}!b&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function xjt(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=Fte(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 qjt(e){return e>=56320&&e<=57343}function Wjt(e,t){return(e-55296)*1024+9216+t}function XDe(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function YDe(e){return e>=64976&&e<=65007||Hjt.has(e)}var lt;(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"})(lt||(lt={}));const Kjt=65536;class Gjt{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=Kjt,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(qjt(n))return this.pos++,this._addGap(),Wjt(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,me.EOF;return this._err(lt.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,me.EOF;const i=this.html.charCodeAt(n);return i===me.CARRIAGE_RETURN?me.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,me.EOF;let t=this.html.charCodeAt(this.pos);return t===me.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,me.LINE_FEED):t===me.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,GDe(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===me.LINE_FEED||t===me.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){XDe(t)?this._err(lt.controlCharacterInInputStream):YDe(t)&&this._err(lt.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 Xjt=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))),Yjt=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 Zjt(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Yjt.get(e))!==null&&t!==void 0?t:e}var wa;(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"})(wa||(wa={}));const Jjt=32;var jm;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(jm||(jm={}));function C8(e){return e>=wa.ZERO&&e<=wa.NINE}function eNt(e){return e>=wa.UPPER_A&&e<=wa.UPPER_F||e>=wa.LOWER_A&&e<=wa.LOWER_F}function tNt(e){return e>=wa.UPPER_A&&e<=wa.UPPER_Z||e>=wa.LOWER_A&&e<=wa.LOWER_Z||C8(e)}function nNt(e){return e===wa.EQUALS||tNt(e)}var pa;(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"})(pa||(pa={}));var Nh;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Nh||(Nh={}));class iNt{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=pa.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Nh.Strict}startEntity(t){this.decodeMode=t,this.state=pa.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case pa.EntityStart:return t.charCodeAt(n)===wa.NUM?(this.state=pa.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=pa.NamedEntity,this.stateNamedEntity(t,n));case pa.NumericStart:return this.stateNumericStart(t,n);case pa.NumericDecimal:return this.stateNumericDecimal(t,n);case pa.NumericHex:return this.stateNumericHex(t,n);case pa.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|Jjt)===wa.LOWER_X?(this.state=pa.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=pa.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===wa.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Nh.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]&jm.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]&~jm.VALUE_LENGTH:r[t+1],i),n===3&&this.emitCodePoint(r[t+2],i),i}end(){var t;switch(this.state){case pa.NamedEntity:return this.result!==0&&(this.decodeMode!==Nh.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case pa.NumericDecimal:return this.emitNumericEntity(0,2);case pa.NumericHex:return this.emitNumericEntity(0,3);case pa.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case pa.EntityStart:return 0}}}function rNt(e,t,n,i){const r=(t&jm.BRANCH_LENGTH)>>7,s=t&jm.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 _t;(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/"})(_t||(_t={}));var oy;(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"})(oy||(oy={}));var Au;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Au||(Au={}));var Xe;(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"})(Xe||(Xe={}));var $;(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"})($||($={}));const sNt=new Map([[Xe.A,$.A],[Xe.ADDRESS,$.ADDRESS],[Xe.ANNOTATION_XML,$.ANNOTATION_XML],[Xe.APPLET,$.APPLET],[Xe.AREA,$.AREA],[Xe.ARTICLE,$.ARTICLE],[Xe.ASIDE,$.ASIDE],[Xe.B,$.B],[Xe.BASE,$.BASE],[Xe.BASEFONT,$.BASEFONT],[Xe.BGSOUND,$.BGSOUND],[Xe.BIG,$.BIG],[Xe.BLOCKQUOTE,$.BLOCKQUOTE],[Xe.BODY,$.BODY],[Xe.BR,$.BR],[Xe.BUTTON,$.BUTTON],[Xe.CAPTION,$.CAPTION],[Xe.CENTER,$.CENTER],[Xe.CODE,$.CODE],[Xe.COL,$.COL],[Xe.COLGROUP,$.COLGROUP],[Xe.DD,$.DD],[Xe.DESC,$.DESC],[Xe.DETAILS,$.DETAILS],[Xe.DIALOG,$.DIALOG],[Xe.DIR,$.DIR],[Xe.DIV,$.DIV],[Xe.DL,$.DL],[Xe.DT,$.DT],[Xe.EM,$.EM],[Xe.EMBED,$.EMBED],[Xe.FIELDSET,$.FIELDSET],[Xe.FIGCAPTION,$.FIGCAPTION],[Xe.FIGURE,$.FIGURE],[Xe.FONT,$.FONT],[Xe.FOOTER,$.FOOTER],[Xe.FOREIGN_OBJECT,$.FOREIGN_OBJECT],[Xe.FORM,$.FORM],[Xe.FRAME,$.FRAME],[Xe.FRAMESET,$.FRAMESET],[Xe.H1,$.H1],[Xe.H2,$.H2],[Xe.H3,$.H3],[Xe.H4,$.H4],[Xe.H5,$.H5],[Xe.H6,$.H6],[Xe.HEAD,$.HEAD],[Xe.HEADER,$.HEADER],[Xe.HGROUP,$.HGROUP],[Xe.HR,$.HR],[Xe.HTML,$.HTML],[Xe.I,$.I],[Xe.IMG,$.IMG],[Xe.IMAGE,$.IMAGE],[Xe.INPUT,$.INPUT],[Xe.IFRAME,$.IFRAME],[Xe.KEYGEN,$.KEYGEN],[Xe.LABEL,$.LABEL],[Xe.LI,$.LI],[Xe.LINK,$.LINK],[Xe.LISTING,$.LISTING],[Xe.MAIN,$.MAIN],[Xe.MALIGNMARK,$.MALIGNMARK],[Xe.MARQUEE,$.MARQUEE],[Xe.MATH,$.MATH],[Xe.MENU,$.MENU],[Xe.META,$.META],[Xe.MGLYPH,$.MGLYPH],[Xe.MI,$.MI],[Xe.MO,$.MO],[Xe.MN,$.MN],[Xe.MS,$.MS],[Xe.MTEXT,$.MTEXT],[Xe.NAV,$.NAV],[Xe.NOBR,$.NOBR],[Xe.NOFRAMES,$.NOFRAMES],[Xe.NOEMBED,$.NOEMBED],[Xe.NOSCRIPT,$.NOSCRIPT],[Xe.OBJECT,$.OBJECT],[Xe.OL,$.OL],[Xe.OPTGROUP,$.OPTGROUP],[Xe.OPTION,$.OPTION],[Xe.P,$.P],[Xe.PARAM,$.PARAM],[Xe.PLAINTEXT,$.PLAINTEXT],[Xe.PRE,$.PRE],[Xe.RB,$.RB],[Xe.RP,$.RP],[Xe.RT,$.RT],[Xe.RTC,$.RTC],[Xe.RUBY,$.RUBY],[Xe.S,$.S],[Xe.SCRIPT,$.SCRIPT],[Xe.SEARCH,$.SEARCH],[Xe.SECTION,$.SECTION],[Xe.SELECT,$.SELECT],[Xe.SOURCE,$.SOURCE],[Xe.SMALL,$.SMALL],[Xe.SPAN,$.SPAN],[Xe.STRIKE,$.STRIKE],[Xe.STRONG,$.STRONG],[Xe.STYLE,$.STYLE],[Xe.SUB,$.SUB],[Xe.SUMMARY,$.SUMMARY],[Xe.SUP,$.SUP],[Xe.TABLE,$.TABLE],[Xe.TBODY,$.TBODY],[Xe.TEMPLATE,$.TEMPLATE],[Xe.TEXTAREA,$.TEXTAREA],[Xe.TFOOT,$.TFOOT],[Xe.TD,$.TD],[Xe.TH,$.TH],[Xe.THEAD,$.THEAD],[Xe.TITLE,$.TITLE],[Xe.TR,$.TR],[Xe.TRACK,$.TRACK],[Xe.TT,$.TT],[Xe.U,$.U],[Xe.UL,$.UL],[Xe.SVG,$.SVG],[Xe.VAR,$.VAR],[Xe.WBR,$.WBR],[Xe.XMP,$.XMP]]);function o1(e){var t;return(t=sNt.get(e))!==null&&t!==void 0?t:$.UNKNOWN}const Rt=$,oNt={[_t.HTML]:new Set([Rt.ADDRESS,Rt.APPLET,Rt.AREA,Rt.ARTICLE,Rt.ASIDE,Rt.BASE,Rt.BASEFONT,Rt.BGSOUND,Rt.BLOCKQUOTE,Rt.BODY,Rt.BR,Rt.BUTTON,Rt.CAPTION,Rt.CENTER,Rt.COL,Rt.COLGROUP,Rt.DD,Rt.DETAILS,Rt.DIR,Rt.DIV,Rt.DL,Rt.DT,Rt.EMBED,Rt.FIELDSET,Rt.FIGCAPTION,Rt.FIGURE,Rt.FOOTER,Rt.FORM,Rt.FRAME,Rt.FRAMESET,Rt.H1,Rt.H2,Rt.H3,Rt.H4,Rt.H5,Rt.H6,Rt.HEAD,Rt.HEADER,Rt.HGROUP,Rt.HR,Rt.HTML,Rt.IFRAME,Rt.IMG,Rt.INPUT,Rt.LI,Rt.LINK,Rt.LISTING,Rt.MAIN,Rt.MARQUEE,Rt.MENU,Rt.META,Rt.NAV,Rt.NOEMBED,Rt.NOFRAMES,Rt.NOSCRIPT,Rt.OBJECT,Rt.OL,Rt.P,Rt.PARAM,Rt.PLAINTEXT,Rt.PRE,Rt.SCRIPT,Rt.SECTION,Rt.SELECT,Rt.SOURCE,Rt.STYLE,Rt.SUMMARY,Rt.TABLE,Rt.TBODY,Rt.TD,Rt.TEMPLATE,Rt.TEXTAREA,Rt.TFOOT,Rt.TH,Rt.THEAD,Rt.TITLE,Rt.TR,Rt.TRACK,Rt.UL,Rt.WBR,Rt.XMP]),[_t.MATHML]:new Set([Rt.MI,Rt.MO,Rt.MN,Rt.MS,Rt.MTEXT,Rt.ANNOTATION_XML]),[_t.SVG]:new Set([Rt.TITLE,Rt.FOREIGN_OBJECT,Rt.DESC]),[_t.XLINK]:new Set,[_t.XML]:new Set,[_t.XMLNS]:new Set},T8=new Set([Rt.H1,Rt.H2,Rt.H3,Rt.H4,Rt.H5,Rt.H6]);Xe.STYLE,Xe.SCRIPT,Xe.XMP,Xe.IFRAME,Xe.NOEMBED,Xe.NOFRAMES,Xe.PLAINTEXT;var Se;(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"})(Se||(Se={}));const xo={DATA:Se.DATA,RCDATA:Se.RCDATA,RAWTEXT:Se.RAWTEXT,SCRIPT_DATA:Se.SCRIPT_DATA,PLAINTEXT:Se.PLAINTEXT,CDATA_SECTION:Se.CDATA_SECTION};function aNt(e){return e>=me.DIGIT_0&&e<=me.DIGIT_9}function ak(e){return e>=me.LATIN_CAPITAL_A&&e<=me.LATIN_CAPITAL_Z}function lNt(e){return e>=me.LATIN_SMALL_A&&e<=me.LATIN_SMALL_Z}function im(e){return lNt(e)||ak(e)}function Ute(e){return im(e)||aNt(e)}function h2(e){return e+32}function JDe(e){return e===me.SPACE||e===me.LINE_FEED||e===me.TABULATION||e===me.FORM_FEED}function Qte(e){return JDe(e)||e===me.SOLIDUS||e===me.GREATER_THAN_SIGN}function cNt(e){return e===me.NULL?lt.nullCharacterReference:e>1114111?lt.characterReferenceOutsideUnicodeRange:GDe(e)?lt.surrogateCharacterReference:YDe(e)?lt.noncharacterCharacterReference:XDe(e)||e===me.CARRIAGE_RETURN?lt.controlCharacterReference:null}class uNt{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=Se.DATA,this.returnState=Se.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Gjt(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new iNt(Xjt,(i,r)=>{this.preprocessor.pos=this.entityStartPos+r-1,this._flushCodePointConsumedAsCharacterReference(i)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(lt.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:i=>{this._err(lt.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+i)},validateNumericCharacterReference:i=>{const r=cNt(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(lt.endTagWithAttributes),t.selfClosing&&this._err(lt.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 Ai.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Ai.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Ai.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:Ai.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=JDe(t)?Ai.WHITESPACE_CHARACTER:t===me.NULL?Ai.NULL_CHARACTER:Ai.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Ai.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=Se.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Nh.Attribute:Nh.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Se.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Se.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Se.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case Se.DATA:{this._stateData(t);break}case Se.RCDATA:{this._stateRcdata(t);break}case Se.RAWTEXT:{this._stateRawtext(t);break}case Se.SCRIPT_DATA:{this._stateScriptData(t);break}case Se.PLAINTEXT:{this._statePlaintext(t);break}case Se.TAG_OPEN:{this._stateTagOpen(t);break}case Se.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case Se.TAG_NAME:{this._stateTagName(t);break}case Se.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case Se.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case Se.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case Se.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case Se.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case Se.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case Se.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case Se.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case Se.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case Se.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case Se.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case Se.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case Se.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case Se.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case Se.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case Se.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case Se.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case Se.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case Se.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case Se.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case Se.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case Se.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case Se.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case Se.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case Se.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case Se.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case Se.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case Se.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case Se.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case Se.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case Se.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case Se.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case Se.BOGUS_COMMENT:{this._stateBogusComment(t);break}case Se.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case Se.COMMENT_START:{this._stateCommentStart(t);break}case Se.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case Se.COMMENT:{this._stateComment(t);break}case Se.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case Se.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case Se.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case Se.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case Se.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case Se.COMMENT_END:{this._stateCommentEnd(t);break}case Se.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case Se.DOCTYPE:{this._stateDoctype(t);break}case Se.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case Se.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case Se.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case Se.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case Se.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case Se.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case Se.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case Se.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case Se.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case Se.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case Se.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case Se.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case Se.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case Se.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case Se.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case Se.CDATA_SECTION:{this._stateCdataSection(t);break}case Se.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case Se.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case Se.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Se.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case me.LESS_THAN_SIGN:{this.state=Se.TAG_OPEN;break}case me.AMPERSAND:{this._startCharacterReference();break}case me.NULL:{this._err(lt.unexpectedNullCharacter),this._emitCodePoint(t);break}case me.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case me.AMPERSAND:{this._startCharacterReference();break}case me.LESS_THAN_SIGN:{this.state=Se.RCDATA_LESS_THAN_SIGN;break}case me.NULL:{this._err(lt.unexpectedNullCharacter),this._emitChars(As);break}case me.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case me.LESS_THAN_SIGN:{this.state=Se.RAWTEXT_LESS_THAN_SIGN;break}case me.NULL:{this._err(lt.unexpectedNullCharacter),this._emitChars(As);break}case me.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case me.LESS_THAN_SIGN:{this.state=Se.SCRIPT_DATA_LESS_THAN_SIGN;break}case me.NULL:{this._err(lt.unexpectedNullCharacter),this._emitChars(As);break}case me.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case me.NULL:{this._err(lt.unexpectedNullCharacter),this._emitChars(As);break}case me.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(im(t))this._createStartTagToken(),this.state=Se.TAG_NAME,this._stateTagName(t);else switch(t){case me.EXCLAMATION_MARK:{this.state=Se.MARKUP_DECLARATION_OPEN;break}case me.SOLIDUS:{this.state=Se.END_TAG_OPEN;break}case me.QUESTION_MARK:{this._err(lt.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Se.BOGUS_COMMENT,this._stateBogusComment(t);break}case me.EOF:{this._err(lt.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(lt.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Se.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(im(t))this._createEndTagToken(),this.state=Se.TAG_NAME,this._stateTagName(t);else switch(t){case me.GREATER_THAN_SIGN:{this._err(lt.missingEndTagName),this.state=Se.DATA;break}case me.EOF:{this._err(lt.eofBeforeTagName),this._emitChars("");break}case me.NULL:{this._err(lt.unexpectedNullCharacter),this.state=Se.SCRIPT_DATA_ESCAPED,this._emitChars(As);break}case me.EOF:{this._err(lt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Se.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===me.SOLIDUS?this.state=Se.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:im(t)?(this._emitChars("<"),this.state=Se.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=Se.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){im(t)?(this.state=Se.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case me.NULL:{this._err(lt.unexpectedNullCharacter),this.state=Se.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(As);break}case me.EOF:{this._err(lt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Se.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===me.SOLIDUS?(this.state=Se.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Se.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Wl.SCRIPT,!1)&&Qte(this.preprocessor.peek(Wl.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])!==_t.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(mNt,_t.HTML)}clearBackToTableBodyContext(){this.clearBackTo(pNt,_t.HTML)}clearBackToTableRowContext(){this.clearBackTo(hNt,_t.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]===$.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]===$.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 _t.HTML:{if(r===t)return!0;if(n.has(r))return!1;break}case _t.SVG:{if(Hte.has(r))return!1;break}case _t.MATHML:{if(Vte.has(r))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,cR)}hasInListItemScope(t){return this.hasInDynamicScope(t,dNt)}hasInButtonScope(t){return this.hasInDynamicScope(t,fNt)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case _t.HTML:{if(T8.has(n))return!0;if(cR.has(n))return!1;break}case _t.SVG:{if(Hte.has(n))return!1;break}case _t.MATHML:{if(Vte.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===_t.HTML)switch(this.tagIDs[n]){case t:return!0;case $.TABLE:case $.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===_t.HTML)switch(this.tagIDs[t]){case $.TBODY:case $.THEAD:case $.TFOOT:return!0;case $.TABLE:case $.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===_t.HTML)switch(this.tagIDs[n]){case t:return!0;case $.OPTION:case $.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&eMe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&zte.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&zte.has(this.currentTagId);)this.pop()}}const o3=3;var pf;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(pf||(pf={}));const qte={type:pf.Marker};class yNt{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>=o3&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(qte)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:pf.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const i=this.entries.indexOf(this.bookmark);this.entries.splice(i,0,{type:pf.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(qte);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(i=>i.type===pf.Marker||this.treeAdapter.getTagName(i.element)===t);return n&&n.type===pf.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===pf.Element&&n.element===t)}}const rm={createDocument(){return{nodeName:"#document",mode:Au.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};rm.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(rm.isTextNode(n)){n.value+=t;return}}rm.appendChild(e,rm.createTextNode(t))},insertTextBefore(e,t,n){const i=e.childNodes[e.childNodes.indexOf(n)-1];i&&rm.isTextNode(i)?i.value+=t:rm.insertBefore(e,rm.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(i=>i.name));for(let i=0;ie.startsWith(n))}function SNt(e){return e.name===tMe&&e.publicId===null&&(e.systemId===null||e.systemId===vNt)}function ENt(e){if(e.name!==tMe)return Au.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===xNt)return Au.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),ONt.has(n))return Au.QUIRKS;let i=t===null?wNt:nMe;if(Wte(n,i))return Au.QUIRKS;if(i=t===null?iMe:kNt,Wte(n,i))return Au.LIMITED_QUIRKS}return Au.NO_QUIRKS}const Kte={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},CNt="definitionurl",TNt="definitionURL",ANt=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])),_Nt=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:_t.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:_t.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:_t.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:_t.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:_t.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:_t.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:_t.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:_t.XML}],["xml:space",{prefix:"xml",name:"space",namespace:_t.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:_t.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:_t.XMLNS}]]),jNt=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])),NNt=new Set([$.B,$.BIG,$.BLOCKQUOTE,$.BODY,$.BR,$.CENTER,$.CODE,$.DD,$.DIV,$.DL,$.DT,$.EM,$.EMBED,$.H1,$.H2,$.H3,$.H4,$.H5,$.H6,$.HEAD,$.HR,$.I,$.IMG,$.LI,$.LISTING,$.MENU,$.META,$.NOBR,$.OL,$.P,$.PRE,$.RUBY,$.S,$.SMALL,$.SPAN,$.STRONG,$.STRIKE,$.SUB,$.SUP,$.TABLE,$.TT,$.U,$.UL,$.VAR]);function RNt(e){const t=e.tagID;return t===$.FONT&&e.attrs.some(({name:i})=>i===oy.COLOR||i===oy.SIZE||i===oy.FACE)||NNt.has(t)}function rMe(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)===_t.HTML;this.currentNotInHTML=!i,this.tokenizer.inForeignNode=!i&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,_t.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=Re.TEXT}switchToPlaintextParsing(){this.insertionMode=Re.TEXT,this.originalInsertionMode=Re.IN_BODY,this.tokenizer.state=xo.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)===Xe.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==_t.HTML))switch(this.fragmentContextID){case $.TITLE:case $.TEXTAREA:{this.tokenizer.state=xo.RCDATA;break}case $.STYLE:case $.XMP:case $.IFRAME:case $.NOEMBED:case $.NOFRAMES:case $.NOSCRIPT:{this.tokenizer.state=xo.RAWTEXT;break}case $.SCRIPT:{this.tokenizer.state=xo.SCRIPT_DATA;break}case $.PLAINTEXT:{this.tokenizer.state=xo.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,_t.HTML,[]);this._attachElementToTree(i,null),this.openElements.push(i,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,_t.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(Xe.HTML,_t.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,$.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===Ai.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===$.SVG&&this.treeAdapter.getTagName(n)===Xe.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===_t.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===$.MGLYPH||t.tagID===$.MALIGNMARK)&&i!==void 0&&!this._isIntegrationPoint(i,n,_t.HTML)}_processToken(t){switch(t.type){case Ai.CHARACTER:{this.onCharacter(t);break}case Ai.NULL_CHARACTER:{this.onNullCharacter(t);break}case Ai.COMMENT:{this.onComment(t);break}case Ai.DOCTYPE:{this.onDoctype(t);break}case Ai.START_TAG:{this._processStartTag(t);break}case Ai.END_TAG:{this.onEndTag(t);break}case Ai.EOF:{this.onEof(t);break}case Ai.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,i){const r=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return MNt(t,r,s,i)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(r=>r.type===pf.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=Re.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion($.P),this.openElements.popUntilTagNamePopped($.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case $.TR:{this.insertionMode=Re.IN_ROW;return}case $.TBODY:case $.THEAD:case $.TFOOT:{this.insertionMode=Re.IN_TABLE_BODY;return}case $.CAPTION:{this.insertionMode=Re.IN_CAPTION;return}case $.COLGROUP:{this.insertionMode=Re.IN_COLUMN_GROUP;return}case $.TABLE:{this.insertionMode=Re.IN_TABLE;return}case $.BODY:{this.insertionMode=Re.IN_BODY;return}case $.FRAMESET:{this.insertionMode=Re.IN_FRAMESET;return}case $.SELECT:{this._resetInsertionModeForSelect(t);return}case $.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case $.HTML:{this.insertionMode=this.headElement?Re.AFTER_HEAD:Re.BEFORE_HEAD;return}case $.TD:case $.TH:{if(t>0){this.insertionMode=Re.IN_CELL;return}break}case $.HEAD:{if(t>0){this.insertionMode=Re.IN_HEAD;return}break}}this.insertionMode=Re.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const i=this.openElements.tagIDs[n];if(i===$.TEMPLATE)break;if(i===$.TABLE){this.insertionMode=Re.IN_SELECT_IN_TABLE;return}}this.insertionMode=Re.IN_SELECT}_isElementCausesFosterParenting(t){return oMe.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 $.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===_t.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case $.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 oNt[i].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){gIt(this,t);return}switch(this.insertionMode){case Re.INITIAL:{yO(this,t);break}case Re.BEFORE_HTML:{eS(this,t);break}case Re.BEFORE_HEAD:{tS(this,t);break}case Re.IN_HEAD:{nS(this,t);break}case Re.IN_HEAD_NO_SCRIPT:{iS(this,t);break}case Re.AFTER_HEAD:{rS(this,t);break}case Re.IN_BODY:case Re.IN_CAPTION:case Re.IN_CELL:case Re.IN_TEMPLATE:{lMe(this,t);break}case Re.TEXT:case Re.IN_SELECT:case Re.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case Re.IN_TABLE:case Re.IN_TABLE_BODY:case Re.IN_ROW:{a3(this,t);break}case Re.IN_TABLE_TEXT:{pMe(this,t);break}case Re.IN_COLUMN_GROUP:{uR(this,t);break}case Re.AFTER_BODY:{dR(this,t);break}case Re.AFTER_AFTER_BODY:{cj(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){mIt(this,t);return}switch(this.insertionMode){case Re.INITIAL:{yO(this,t);break}case Re.BEFORE_HTML:{eS(this,t);break}case Re.BEFORE_HEAD:{tS(this,t);break}case Re.IN_HEAD:{nS(this,t);break}case Re.IN_HEAD_NO_SCRIPT:{iS(this,t);break}case Re.AFTER_HEAD:{rS(this,t);break}case Re.TEXT:{this._insertCharacters(t);break}case Re.IN_TABLE:case Re.IN_TABLE_BODY:case Re.IN_ROW:{a3(this,t);break}case Re.IN_COLUMN_GROUP:{uR(this,t);break}case Re.AFTER_BODY:{dR(this,t);break}case Re.AFTER_AFTER_BODY:{cj(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){A8(this,t);return}switch(this.insertionMode){case Re.INITIAL:case Re.BEFORE_HTML:case Re.BEFORE_HEAD:case Re.IN_HEAD:case Re.IN_HEAD_NO_SCRIPT:case Re.AFTER_HEAD:case Re.IN_BODY:case Re.IN_TABLE:case Re.IN_CAPTION:case Re.IN_COLUMN_GROUP:case Re.IN_TABLE_BODY:case Re.IN_ROW:case Re.IN_CELL:case Re.IN_SELECT:case Re.IN_SELECT_IN_TABLE:case Re.IN_TEMPLATE:case Re.IN_FRAMESET:case Re.AFTER_FRAMESET:{A8(this,t);break}case Re.IN_TABLE_TEXT:{vO(this,t);break}case Re.AFTER_BODY:{WNt(this,t);break}case Re.AFTER_AFTER_BODY:case Re.AFTER_AFTER_FRAMESET:{KNt(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case Re.INITIAL:{GNt(this,t);break}case Re.BEFORE_HEAD:case Re.IN_HEAD:case Re.IN_HEAD_NO_SCRIPT:case Re.AFTER_HEAD:{this._err(t,lt.misplacedDoctype);break}case Re.IN_TABLE_TEXT:{vO(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,lt.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?bIt(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case Re.INITIAL:{yO(this,t);break}case Re.BEFORE_HTML:{XNt(this,t);break}case Re.BEFORE_HEAD:{ZNt(this,t);break}case Re.IN_HEAD:{Hd(this,t);break}case Re.IN_HEAD_NO_SCRIPT:{tRt(this,t);break}case Re.AFTER_HEAD:{iRt(this,t);break}case Re.IN_BODY:{fl(this,t);break}case Re.IN_TABLE:{pw(this,t);break}case Re.IN_TABLE_TEXT:{vO(this,t);break}case Re.IN_CAPTION:{JRt(this,t);break}case Re.IN_COLUMN_GROUP:{CV(this,t);break}case Re.IN_TABLE_BODY:{lD(this,t);break}case Re.IN_ROW:{cD(this,t);break}case Re.IN_CELL:{nIt(this,t);break}case Re.IN_SELECT:{bMe(this,t);break}case Re.IN_SELECT_IN_TABLE:{rIt(this,t);break}case Re.IN_TEMPLATE:{oIt(this,t);break}case Re.AFTER_BODY:{lIt(this,t);break}case Re.IN_FRAMESET:{cIt(this,t);break}case Re.AFTER_FRAMESET:{dIt(this,t);break}case Re.AFTER_AFTER_BODY:{hIt(this,t);break}case Re.AFTER_AFTER_FRAMESET:{pIt(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?yIt(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case Re.INITIAL:{yO(this,t);break}case Re.BEFORE_HTML:{YNt(this,t);break}case Re.BEFORE_HEAD:{JNt(this,t);break}case Re.IN_HEAD:{eRt(this,t);break}case Re.IN_HEAD_NO_SCRIPT:{nRt(this,t);break}case Re.AFTER_HEAD:{rRt(this,t);break}case Re.IN_BODY:{aD(this,t);break}case Re.TEXT:{zRt(this,t);break}case Re.IN_TABLE:{kE(this,t);break}case Re.IN_TABLE_TEXT:{vO(this,t);break}case Re.IN_CAPTION:{eIt(this,t);break}case Re.IN_COLUMN_GROUP:{tIt(this,t);break}case Re.IN_TABLE_BODY:{_8(this,t);break}case Re.IN_ROW:{gMe(this,t);break}case Re.IN_CELL:{iIt(this,t);break}case Re.IN_SELECT:{yMe(this,t);break}case Re.IN_SELECT_IN_TABLE:{sIt(this,t);break}case Re.IN_TEMPLATE:{aIt(this,t);break}case Re.AFTER_BODY:{xMe(this,t);break}case Re.IN_FRAMESET:{uIt(this,t);break}case Re.AFTER_FRAMESET:{fIt(this,t);break}case Re.AFTER_AFTER_BODY:{cj(this,t);break}}}onEof(t){switch(this.insertionMode){case Re.INITIAL:{yO(this,t);break}case Re.BEFORE_HTML:{eS(this,t);break}case Re.BEFORE_HEAD:{tS(this,t);break}case Re.IN_HEAD:{nS(this,t);break}case Re.IN_HEAD_NO_SCRIPT:{iS(this,t);break}case Re.AFTER_HEAD:{rS(this,t);break}case Re.IN_BODY:case Re.IN_TABLE:case Re.IN_CAPTION:case Re.IN_COLUMN_GROUP:case Re.IN_TABLE_BODY:case Re.IN_ROW:case Re.IN_CELL:case Re.IN_SELECT:case Re.IN_SELECT_IN_TABLE:{fMe(this,t);break}case Re.TEXT:{VRt(this,t);break}case Re.IN_TABLE_TEXT:{vO(this,t);break}case Re.IN_TEMPLATE:{vMe(this,t);break}case Re.AFTER_BODY:case Re.IN_FRAMESET:case Re.AFTER_FRAMESET:case Re.AFTER_AFTER_BODY:case Re.AFTER_AFTER_FRAMESET:{EV(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===me.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 Re.IN_HEAD:case Re.IN_HEAD_NO_SCRIPT:case Re.AFTER_HEAD:case Re.TEXT:case Re.IN_COLUMN_GROUP:case Re.IN_SELECT:case Re.IN_SELECT_IN_TABLE:case Re.IN_FRAMESET:case Re.AFTER_FRAMESET:{this._insertCharacters(t);break}case Re.IN_BODY:case Re.IN_CAPTION:case Re.IN_CELL:case Re.IN_TEMPLATE:case Re.AFTER_BODY:case Re.AFTER_AFTER_BODY:case Re.AFTER_AFTER_FRAMESET:{aMe(this,t);break}case Re.IN_TABLE:case Re.IN_TABLE_BODY:case Re.IN_ROW:{a3(this,t);break}case Re.IN_TABLE_TEXT:{hMe(this,t);break}}}};function UNt(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):dMe(e,t),n}function QNt(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 zNt(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>=FNt;!l||c?(c&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(a)):(a=VNt(e,l),i===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(i),e.treeAdapter.appendChild(a,i),i=a)}return i}function VNt(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 HNt(e,t,n){const i=e.treeAdapter.getTagName(t),r=o1(i);if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);r===$.TEMPLATE&&s===_t.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function qNt(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 SV(e,t){for(let n=0;n<$Nt;n++){const i=UNt(e,t);if(!i)break;const r=QNt(e,i);if(!r)break;e.activeFormattingElements.bookmark=i;const s=zNt(e,r,i.element),a=e.openElements.getCommonAncestor(i.element);e.treeAdapter.detachNode(s),a&&HNt(e,a,s),qNt(e,r,i)}}function A8(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function WNt(e,t){e._appendCommentNode(t,e.openElements.items[0])}function KNt(e,t){e._appendCommentNode(t,e.document)}function EV(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let i=e.openElements.stackTop;i>=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 GNt(e,t){e._setDocumentType(t);const n=t.forceQuirks?Au.QUIRKS:ENt(t);SNt(t)||e._err(t,lt.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Re.BEFORE_HTML}function yO(e,t){e._err(t,lt.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Au.QUIRKS),e.insertionMode=Re.BEFORE_HTML,e._processToken(t)}function XNt(e,t){t.tagID===$.HTML?(e._insertElement(t,_t.HTML),e.insertionMode=Re.BEFORE_HEAD):eS(e,t)}function YNt(e,t){const n=t.tagID;(n===$.HTML||n===$.HEAD||n===$.BODY||n===$.BR)&&eS(e,t)}function eS(e,t){e._insertFakeRootElement(),e.insertionMode=Re.BEFORE_HEAD,e._processToken(t)}function ZNt(e,t){switch(t.tagID){case $.HTML:{fl(e,t);break}case $.HEAD:{e._insertElement(t,_t.HTML),e.headElement=e.openElements.current,e.insertionMode=Re.IN_HEAD;break}default:tS(e,t)}}function JNt(e,t){const n=t.tagID;n===$.HEAD||n===$.BODY||n===$.HTML||n===$.BR?tS(e,t):e._err(t,lt.endTagWithoutMatchingOpenElement)}function tS(e,t){e._insertFakeElement(Xe.HEAD,$.HEAD),e.headElement=e.openElements.current,e.insertionMode=Re.IN_HEAD,e._processToken(t)}function Hd(e,t){switch(t.tagID){case $.HTML:{fl(e,t);break}case $.BASE:case $.BASEFONT:case $.BGSOUND:case $.LINK:case $.META:{e._appendElement(t,_t.HTML),t.ackSelfClosing=!0;break}case $.TITLE:{e._switchToTextParsing(t,xo.RCDATA);break}case $.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,xo.RAWTEXT):(e._insertElement(t,_t.HTML),e.insertionMode=Re.IN_HEAD_NO_SCRIPT);break}case $.NOFRAMES:case $.STYLE:{e._switchToTextParsing(t,xo.RAWTEXT);break}case $.SCRIPT:{e._switchToTextParsing(t,xo.SCRIPT_DATA);break}case $.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Re.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Re.IN_TEMPLATE);break}case $.HEAD:{e._err(t,lt.misplacedStartTagForHeadElement);break}default:nS(e,t)}}function eRt(e,t){switch(t.tagID){case $.HEAD:{e.openElements.pop(),e.insertionMode=Re.AFTER_HEAD;break}case $.BODY:case $.BR:case $.HTML:{nS(e,t);break}case $.TEMPLATE:{c0(e,t);break}default:e._err(t,lt.endTagWithoutMatchingOpenElement)}}function c0(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==$.TEMPLATE&&e._err(t,lt.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped($.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,lt.endTagWithoutMatchingOpenElement)}function nS(e,t){e.openElements.pop(),e.insertionMode=Re.AFTER_HEAD,e._processToken(t)}function tRt(e,t){switch(t.tagID){case $.HTML:{fl(e,t);break}case $.BASEFONT:case $.BGSOUND:case $.HEAD:case $.LINK:case $.META:case $.NOFRAMES:case $.STYLE:{Hd(e,t);break}case $.NOSCRIPT:{e._err(t,lt.nestedNoscriptInHead);break}default:iS(e,t)}}function nRt(e,t){switch(t.tagID){case $.NOSCRIPT:{e.openElements.pop(),e.insertionMode=Re.IN_HEAD;break}case $.BR:{iS(e,t);break}default:e._err(t,lt.endTagWithoutMatchingOpenElement)}}function iS(e,t){const n=t.type===Ai.EOF?lt.openElementsLeftAfterEof:lt.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Re.IN_HEAD,e._processToken(t)}function iRt(e,t){switch(t.tagID){case $.HTML:{fl(e,t);break}case $.BODY:{e._insertElement(t,_t.HTML),e.framesetOk=!1,e.insertionMode=Re.IN_BODY;break}case $.FRAMESET:{e._insertElement(t,_t.HTML),e.insertionMode=Re.IN_FRAMESET;break}case $.BASE:case $.BASEFONT:case $.BGSOUND:case $.LINK:case $.META:case $.NOFRAMES:case $.SCRIPT:case $.STYLE:case $.TEMPLATE:case $.TITLE:{e._err(t,lt.abandonedHeadElementChild),e.openElements.push(e.headElement,$.HEAD),Hd(e,t),e.openElements.remove(e.headElement);break}case $.HEAD:{e._err(t,lt.misplacedStartTagForHeadElement);break}default:rS(e,t)}}function rRt(e,t){switch(t.tagID){case $.BODY:case $.HTML:case $.BR:{rS(e,t);break}case $.TEMPLATE:{c0(e,t);break}default:e._err(t,lt.endTagWithoutMatchingOpenElement)}}function rS(e,t){e._insertFakeElement(Xe.BODY,$.BODY),e.insertionMode=Re.IN_BODY,oD(e,t)}function oD(e,t){switch(t.type){case Ai.CHARACTER:{lMe(e,t);break}case Ai.WHITESPACE_CHARACTER:{aMe(e,t);break}case Ai.COMMENT:{A8(e,t);break}case Ai.START_TAG:{fl(e,t);break}case Ai.END_TAG:{aD(e,t);break}case Ai.EOF:{fMe(e,t);break}}}function aMe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function lMe(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function sRt(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function oRt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function aRt(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,_t.HTML),e.insertionMode=Re.IN_FRAMESET)}function lRt(e,t){e.openElements.hasInButtonScope($.P)&&e._closePElement(),e._insertElement(t,_t.HTML)}function cRt(e,t){e.openElements.hasInButtonScope($.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&T8.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,_t.HTML)}function uRt(e,t){e.openElements.hasInButtonScope($.P)&&e._closePElement(),e._insertElement(t,_t.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function dRt(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope($.P)&&e._closePElement(),e._insertElement(t,_t.HTML),n||(e.formElement=e.openElements.current))}function fRt(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===$.LI&&r===$.LI||(n===$.DD||n===$.DT)&&(r===$.DD||r===$.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==$.ADDRESS&&r!==$.DIV&&r!==$.P&&e._isSpecialElement(e.openElements.items[i],r))break}e.openElements.hasInButtonScope($.P)&&e._closePElement(),e._insertElement(t,_t.HTML)}function hRt(e,t){e.openElements.hasInButtonScope($.P)&&e._closePElement(),e._insertElement(t,_t.HTML),e.tokenizer.state=xo.PLAINTEXT}function pRt(e,t){e.openElements.hasInScope($.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped($.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,_t.HTML),e.framesetOk=!1}function mRt(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Xe.A);n&&(SV(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,_t.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function gRt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,_t.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function bRt(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope($.NOBR)&&(SV(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,_t.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function yRt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,_t.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function vRt(e,t){e.treeAdapter.getDocumentMode(e.document)!==Au.QUIRKS&&e.openElements.hasInButtonScope($.P)&&e._closePElement(),e._insertElement(t,_t.HTML),e.framesetOk=!1,e.insertionMode=Re.IN_TABLE}function cMe(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,_t.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function uMe(e){const t=ZDe(e,oy.TYPE);return t!=null&&t.toLowerCase()===LNt}function xRt(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,_t.HTML),uMe(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function wRt(e,t){e._appendElement(t,_t.HTML),t.ackSelfClosing=!0}function ORt(e,t){e.openElements.hasInButtonScope($.P)&&e._closePElement(),e._appendElement(t,_t.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function kRt(e,t){t.tagName=Xe.IMG,t.tagID=$.IMG,cMe(e,t)}function SRt(e,t){e._insertElement(t,_t.HTML),e.skipNextNewLine=!0,e.tokenizer.state=xo.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Re.TEXT}function ERt(e,t){e.openElements.hasInButtonScope($.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,xo.RAWTEXT)}function CRt(e,t){e.framesetOk=!1,e._switchToTextParsing(t,xo.RAWTEXT)}function Yte(e,t){e._switchToTextParsing(t,xo.RAWTEXT)}function TRt(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,_t.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Re.IN_TABLE||e.insertionMode===Re.IN_CAPTION||e.insertionMode===Re.IN_TABLE_BODY||e.insertionMode===Re.IN_ROW||e.insertionMode===Re.IN_CELL?Re.IN_SELECT_IN_TABLE:Re.IN_SELECT}function ARt(e,t){e.openElements.currentTagId===$.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,_t.HTML)}function _Rt(e,t){e.openElements.hasInScope($.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,_t.HTML)}function jRt(e,t){e.openElements.hasInScope($.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion($.RTC),e._insertElement(t,_t.HTML)}function NRt(e,t){e._reconstructActiveFormattingElements(),rMe(t),kV(t),t.selfClosing?e._appendElement(t,_t.MATHML):e._insertElement(t,_t.MATHML),t.ackSelfClosing=!0}function RRt(e,t){e._reconstructActiveFormattingElements(),sMe(t),kV(t),t.selfClosing?e._appendElement(t,_t.SVG):e._insertElement(t,_t.SVG),t.ackSelfClosing=!0}function Zte(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,_t.HTML)}function fl(e,t){switch(t.tagID){case $.I:case $.S:case $.B:case $.U:case $.EM:case $.TT:case $.BIG:case $.CODE:case $.FONT:case $.SMALL:case $.STRIKE:case $.STRONG:{gRt(e,t);break}case $.A:{mRt(e,t);break}case $.H1:case $.H2:case $.H3:case $.H4:case $.H5:case $.H6:{cRt(e,t);break}case $.P:case $.DL:case $.OL:case $.UL:case $.DIV:case $.DIR:case $.NAV:case $.MAIN:case $.MENU:case $.ASIDE:case $.CENTER:case $.FIGURE:case $.FOOTER:case $.HEADER:case $.HGROUP:case $.DIALOG:case $.DETAILS:case $.ADDRESS:case $.ARTICLE:case $.SEARCH:case $.SECTION:case $.SUMMARY:case $.FIELDSET:case $.BLOCKQUOTE:case $.FIGCAPTION:{lRt(e,t);break}case $.LI:case $.DD:case $.DT:{fRt(e,t);break}case $.BR:case $.IMG:case $.WBR:case $.AREA:case $.EMBED:case $.KEYGEN:{cMe(e,t);break}case $.HR:{ORt(e,t);break}case $.RB:case $.RTC:{_Rt(e,t);break}case $.RT:case $.RP:{jRt(e,t);break}case $.PRE:case $.LISTING:{uRt(e,t);break}case $.XMP:{ERt(e,t);break}case $.SVG:{RRt(e,t);break}case $.HTML:{sRt(e,t);break}case $.BASE:case $.LINK:case $.META:case $.STYLE:case $.TITLE:case $.SCRIPT:case $.BGSOUND:case $.BASEFONT:case $.TEMPLATE:{Hd(e,t);break}case $.BODY:{oRt(e,t);break}case $.FORM:{dRt(e,t);break}case $.NOBR:{bRt(e,t);break}case $.MATH:{NRt(e,t);break}case $.TABLE:{vRt(e,t);break}case $.INPUT:{xRt(e,t);break}case $.PARAM:case $.TRACK:case $.SOURCE:{wRt(e,t);break}case $.IMAGE:{kRt(e,t);break}case $.BUTTON:{pRt(e,t);break}case $.APPLET:case $.OBJECT:case $.MARQUEE:{yRt(e,t);break}case $.IFRAME:{CRt(e,t);break}case $.SELECT:{TRt(e,t);break}case $.OPTION:case $.OPTGROUP:{ARt(e,t);break}case $.NOEMBED:case $.NOFRAMES:{Yte(e,t);break}case $.FRAMESET:{aRt(e,t);break}case $.TEXTAREA:{SRt(e,t);break}case $.NOSCRIPT:{e.options.scriptingEnabled?Yte(e,t):Zte(e,t);break}case $.PLAINTEXT:{hRt(e,t);break}case $.COL:case $.TH:case $.TD:case $.TR:case $.HEAD:case $.FRAME:case $.TBODY:case $.TFOOT:case $.THEAD:case $.CAPTION:case $.COLGROUP:break;default:Zte(e,t)}}function IRt(e,t){if(e.openElements.hasInScope($.BODY)&&(e.insertionMode=Re.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function PRt(e,t){e.openElements.hasInScope($.BODY)&&(e.insertionMode=Re.AFTER_BODY,xMe(e,t))}function DRt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function MRt(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope($.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped($.FORM):n&&e.openElements.remove(n))}function LRt(e){e.openElements.hasInButtonScope($.P)||e._insertFakeElement(Xe.P,$.P),e._closePElement()}function $Rt(e){e.openElements.hasInListItemScope($.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion($.LI),e.openElements.popUntilTagNamePopped($.LI))}function FRt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function BRt(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function URt(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function QRt(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Xe.BR,$.BR),e.openElements.pop(),e.framesetOk=!1}function dMe(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!==$.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 aD(e,t){switch(t.tagID){case $.A:case $.B:case $.I:case $.S:case $.U:case $.EM:case $.TT:case $.BIG:case $.CODE:case $.FONT:case $.NOBR:case $.SMALL:case $.STRIKE:case $.STRONG:{SV(e,t);break}case $.P:{LRt(e);break}case $.DL:case $.UL:case $.OL:case $.DIR:case $.DIV:case $.NAV:case $.PRE:case $.MAIN:case $.MENU:case $.ASIDE:case $.BUTTON:case $.CENTER:case $.FIGURE:case $.FOOTER:case $.HEADER:case $.HGROUP:case $.DIALOG:case $.ADDRESS:case $.ARTICLE:case $.DETAILS:case $.SEARCH:case $.SECTION:case $.SUMMARY:case $.LISTING:case $.FIELDSET:case $.BLOCKQUOTE:case $.FIGCAPTION:{DRt(e,t);break}case $.LI:{$Rt(e);break}case $.DD:case $.DT:{FRt(e,t);break}case $.H1:case $.H2:case $.H3:case $.H4:case $.H5:case $.H6:{BRt(e);break}case $.BR:{QRt(e);break}case $.BODY:{IRt(e,t);break}case $.HTML:{PRt(e,t);break}case $.FORM:{MRt(e);break}case $.APPLET:case $.OBJECT:case $.MARQUEE:{URt(e,t);break}case $.TEMPLATE:{c0(e,t);break}default:dMe(e,t)}}function fMe(e,t){e.tmplInsertionModeStack.length>0?vMe(e,t):EV(e,t)}function zRt(e,t){var n;t.tagID===$.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function VRt(e,t){e._err(t,lt.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function a3(e,t){if(e.openElements.currentTagId!==void 0&&oMe.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Re.IN_TABLE_TEXT,t.type){case Ai.CHARACTER:{pMe(e,t);break}case Ai.WHITESPACE_CHARACTER:{hMe(e,t);break}}else sT(e,t)}function HRt(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,_t.HTML),e.insertionMode=Re.IN_CAPTION}function qRt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,_t.HTML),e.insertionMode=Re.IN_COLUMN_GROUP}function WRt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Xe.COLGROUP,$.COLGROUP),e.insertionMode=Re.IN_COLUMN_GROUP,CV(e,t)}function KRt(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,_t.HTML),e.insertionMode=Re.IN_TABLE_BODY}function GRt(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Xe.TBODY,$.TBODY),e.insertionMode=Re.IN_TABLE_BODY,lD(e,t)}function XRt(e,t){e.openElements.hasInTableScope($.TABLE)&&(e.openElements.popUntilTagNamePopped($.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function YRt(e,t){uMe(t)?e._appendElement(t,_t.HTML):sT(e,t),t.ackSelfClosing=!0}function ZRt(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,_t.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function pw(e,t){switch(t.tagID){case $.TD:case $.TH:case $.TR:{GRt(e,t);break}case $.STYLE:case $.SCRIPT:case $.TEMPLATE:{Hd(e,t);break}case $.COL:{WRt(e,t);break}case $.FORM:{ZRt(e,t);break}case $.TABLE:{XRt(e,t);break}case $.TBODY:case $.TFOOT:case $.THEAD:{KRt(e,t);break}case $.INPUT:{YRt(e,t);break}case $.CAPTION:{HRt(e,t);break}case $.COLGROUP:{qRt(e,t);break}default:sT(e,t)}}function kE(e,t){switch(t.tagID){case $.TABLE:{e.openElements.hasInTableScope($.TABLE)&&(e.openElements.popUntilTagNamePopped($.TABLE),e._resetInsertionMode());break}case $.TEMPLATE:{c0(e,t);break}case $.BODY:case $.CAPTION:case $.COL:case $.COLGROUP:case $.HTML:case $.TBODY:case $.TD:case $.TFOOT:case $.TH:case $.THEAD:case $.TR:break;default:sT(e,t)}}function sT(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,oD(e,t),e.fosterParentingEnabled=n}function hMe(e,t){e.pendingCharacterTokens.push(t)}function pMe(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function vO(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===$.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===$.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===$.OPTGROUP&&e.openElements.pop();break}case $.OPTION:{e.openElements.currentTagId===$.OPTION&&e.openElements.pop();break}case $.SELECT:{e.openElements.hasInSelectScope($.SELECT)&&(e.openElements.popUntilTagNamePopped($.SELECT),e._resetInsertionMode());break}case $.TEMPLATE:{c0(e,t);break}}}function rIt(e,t){const n=t.tagID;n===$.CAPTION||n===$.TABLE||n===$.TBODY||n===$.TFOOT||n===$.THEAD||n===$.TR||n===$.TD||n===$.TH?(e.openElements.popUntilTagNamePopped($.SELECT),e._resetInsertionMode(),e._processStartTag(t)):bMe(e,t)}function sIt(e,t){const n=t.tagID;n===$.CAPTION||n===$.TABLE||n===$.TBODY||n===$.TFOOT||n===$.THEAD||n===$.TR||n===$.TD||n===$.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped($.SELECT),e._resetInsertionMode(),e.onEndTag(t)):yMe(e,t)}function oIt(e,t){switch(t.tagID){case $.BASE:case $.BASEFONT:case $.BGSOUND:case $.LINK:case $.META:case $.NOFRAMES:case $.SCRIPT:case $.STYLE:case $.TEMPLATE:case $.TITLE:{Hd(e,t);break}case $.CAPTION:case $.COLGROUP:case $.TBODY:case $.TFOOT:case $.THEAD:{e.tmplInsertionModeStack[0]=Re.IN_TABLE,e.insertionMode=Re.IN_TABLE,pw(e,t);break}case $.COL:{e.tmplInsertionModeStack[0]=Re.IN_COLUMN_GROUP,e.insertionMode=Re.IN_COLUMN_GROUP,CV(e,t);break}case $.TR:{e.tmplInsertionModeStack[0]=Re.IN_TABLE_BODY,e.insertionMode=Re.IN_TABLE_BODY,lD(e,t);break}case $.TD:case $.TH:{e.tmplInsertionModeStack[0]=Re.IN_ROW,e.insertionMode=Re.IN_ROW,cD(e,t);break}default:e.tmplInsertionModeStack[0]=Re.IN_BODY,e.insertionMode=Re.IN_BODY,fl(e,t)}}function aIt(e,t){t.tagID===$.TEMPLATE&&c0(e,t)}function vMe(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped($.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):EV(e,t)}function lIt(e,t){t.tagID===$.HTML?fl(e,t):dR(e,t)}function xMe(e,t){var n;if(t.tagID===$.HTML){if(e.fragmentContext||(e.insertionMode=Re.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===$.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 dR(e,t)}function dR(e,t){e.insertionMode=Re.IN_BODY,oD(e,t)}function cIt(e,t){switch(t.tagID){case $.HTML:{fl(e,t);break}case $.FRAMESET:{e._insertElement(t,_t.HTML);break}case $.FRAME:{e._appendElement(t,_t.HTML),t.ackSelfClosing=!0;break}case $.NOFRAMES:{Hd(e,t);break}}}function uIt(e,t){t.tagID===$.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==$.FRAMESET&&(e.insertionMode=Re.AFTER_FRAMESET))}function dIt(e,t){switch(t.tagID){case $.HTML:{fl(e,t);break}case $.NOFRAMES:{Hd(e,t);break}}}function fIt(e,t){t.tagID===$.HTML&&(e.insertionMode=Re.AFTER_AFTER_FRAMESET)}function hIt(e,t){t.tagID===$.HTML?fl(e,t):cj(e,t)}function cj(e,t){e.insertionMode=Re.IN_BODY,oD(e,t)}function pIt(e,t){switch(t.tagID){case $.HTML:{fl(e,t);break}case $.NOFRAMES:{Hd(e,t);break}}}function mIt(e,t){t.chars=As,e._insertCharacters(t)}function gIt(e,t){e._insertCharacters(t),e.framesetOk=!1}function wMe(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==_t.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function bIt(e,t){if(RNt(t))wMe(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),i=e.treeAdapter.getNamespaceURI(n);i===_t.MATHML?rMe(t):i===_t.SVG&&(INt(t),sMe(t)),kV(t),t.selfClosing?e._appendElement(t,i):e._insertElement(t,i),t.ackSelfClosing=!0}}function yIt(e,t){if(t.tagID===$.P||t.tagID===$.BR){wMe(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)===_t.HTML){e._endTagOutsideForeignContent(t);break}const r=e.treeAdapter.getTagName(i);if(r.toLowerCase()===t.tagName){t.tagName=r,e.openElements.shortenToLength(n);break}}}Xe.AREA,Xe.BASE,Xe.BASEFONT,Xe.BGSOUND,Xe.BR,Xe.COL,Xe.EMBED,Xe.FRAME,Xe.HR,Xe.IMG,Xe.INPUT,Xe.KEYGEN,Xe.LINK,Xe.META,Xe.PARAM,Xe.SOURCE,Xe.TRACK,Xe.WBR;const vIt=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,xIt=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Jte={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function OMe(e,t){const n=jIt(e),i=DPe("type",{handlers:{root:wIt,element:OIt,text:kIt,comment:SMe,doctype:SIt,raw:CIt},unknown:TIt}),r={parser:n?new Xte(Jte):Xte.getFragmentParser(void 0,Jte),handle(l){i(l,r)},stitches:!1,options:t||{}};i(e,r),a1(r,Kf());const s=n?r.parser.document:r.parser.getFragment(),a=Njt(s,{file:r.options.file});return r.stitches&&iT(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 kMe(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:Ai.CHARACTER,chars:e.value,location:oT(e)};a1(t,Kf(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function SIt(e,t){const n={type:Ai.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:oT(e)};a1(t,Kf(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function EIt(e,t){t.stitches=!0;const n=NIt(e);if("children"in e&&"children"in n){const i=OMe({type:"root",children:e.children},t.options);n.children=i.children}SMe({type:"comment",value:{stitch:n}},t)}function SMe(e,t){const n=e.value,i={type:Ai.COMMENT,data:n,location:oT(e)};a1(t,Kf(e)),t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken)}function CIt(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,EMe(t,Kf(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(vIt,"<$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 TIt(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))EIt(n,t);else{let i="";throw xIt.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 a1(e,t){EMe(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=xo.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 EMe(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 AIt(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===xo.PLAINTEXT)return;a1(t,Kf(e));const i=t.parser.openElements.current;let r="namespaceURI"in i?i.namespaceURI:Fb.html;r===Fb.html&&n==="svg"&&(r=Fb.svg);const s=Mjt({...e,children:[]},{space:r===Fb.svg?"svg":"html"}),a={type:Ai.START_TAG,tagName:n,tagID:o1(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:oT(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function _It(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Vjt.includes(n)||t.parser.tokenizer.state===xo.PLAINTEXT)return;a1(t,JP(e));const i={type:Ai.END_TAG,tagName:n,tagID:o1(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:oT(e)};t.parser.currentToken=i,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===xo.RCDATA||t.parser.tokenizer.state===xo.RAWTEXT||t.parser.tokenizer.state===xo.SCRIPT_DATA)&&(t.parser.tokenizer.state=xo.DATA)}function jIt(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function oT(e){const t=Kf(e)||{line:void 0,column:void 0,offset:void 0},n=JP(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 NIt(e){return"children"in e?fw({...e,children:[]}):fw(e)}function RIt(e){return function(t,n){return OMe(t,{...e,file:n})}}const IIt="modulepreload",PIt=function(e){return"/"+e},ene={},zs=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=PIt(c),c in ene)return;ene[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":IIt,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(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 DIt=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,MIt=/[\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]/,LIt=/[\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]/,l3={Space_Separator:DIt,ID_Start:MIt,ID_Continue:LIt},po={isSpaceSeparator(e){return typeof e=="string"&&l3.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||l3.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==="‍"||l3.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 j8,_l,Rh,fR,mg,Rd,ma,TV,sS;var $It=function(t,n){j8=String(t),_l="start",Rh=[],fR=0,mg=1,Rd=0,ma=void 0,TV=void 0,sS=void 0;do ma=FIt(),QIt[_l]();while(ma.type!=="eof");return typeof n=="function"?N8({"":sS},"",n):sS};function N8(e,t,n){const i=e[t];if(i!=null&&typeof i=="object")if(Array.isArray(i))for(let r=0;r0;){const n=Yh();if(!co.isHexDigit(n))throw us(Et());e+=Et()}return String.fromCodePoint(parseInt(e,16))}const DIt={start(){if(ua.type==="eof")throw ob();l3()},beforePropertyName(){switch(ua.type){case"identifier":case"string":TV=ua.value,Tl="afterPropertyName";return;case"punctuator":mA();return;case"eof":throw ob()}},afterPropertyName(){if(ua.type==="eof")throw ob();Tl="beforePropertyValue"},beforePropertyValue(){if(ua.type==="eof")throw ob();l3()},beforeArrayValue(){if(ua.type==="eof")throw ob();if(ua.type==="punctuator"&&ua.value==="]"){mA();return}l3()},afterPropertyValue(){if(ua.type==="eof")throw ob();switch(ua.value){case",":Tl="beforePropertyName";return;case"}":mA()}},afterArrayValue(){if(ua.type==="eof")throw ob();switch(ua.value){case",":Tl="beforeArrayValue";return;case"]":mA()}},end(){}};function l3(){let e;switch(ua.type){case"punctuator":switch(ua.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=ua.value;break}if(sS===void 0)sS=e;else{const t=Rh[Rh.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,TV,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")Rh.push(e),Array.isArray(e)?Tl="beforeArrayValue":Tl="beforePropertyName";else{const t=Rh[Rh.length-1];t==null?Tl="end":Array.isArray(t)?Tl="afterArrayValue":Tl="afterPropertyValue"}}function mA(){Rh.pop();const e=Rh[Rh.length-1];e==null?Tl="end":Array.isArray(e)?Tl="afterArrayValue":Tl="afterPropertyValue"}function us(e){return fR(e===void 0?`JSON5: invalid end of input at ${pg}:${Nd}`:`JSON5: invalid character '${xMe(e)}' at ${pg}:${Nd}`)}function ob(){return fR(`JSON5: invalid end of input at ${pg}:${Nd}`)}function tne(){return Nd-=5,fR(`JSON5: invalid identifier character at ${pg}:${Nd}`)}function MIt(e){console.warn(`JSON5: '${xMe(e)}' in strings is not valid ECMAScript; consider escaping`)}function xMe(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 fR(e){const t=new SyntaxError(e);return t.lineNumber=pg,t.columnNumber=Nd,t}var LIt=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 w="";for(let O=0;Ov[O]=0)throw TypeError("Converting circular structure to JSON5");r.push(b);let v=s;s=s+c;let y=a||Object.keys(b),w=[];for(const O of y){const S=d(O,b);if(S!==void 0){let k=m(O)+":";c!==""&&(k+=" "),k+=S,w.push(k)}}let x;if(w.length===0)x="{}";else{let O;if(c==="")O=w.join(","),x="{"+O+"}";else{let S=`, +`&&Et(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw hs(Et());case void 0:throw hs(Et())}return Et()}function UIt(){let e="",t=Yh();if(!po.isHexDigit(t)||(e+=Et(),t=Yh(),!po.isHexDigit(t)))throw hs(Et());return e+=Et(),String.fromCodePoint(parseInt(e,16))}function R8(){let e="",t=4;for(;t-- >0;){const n=Yh();if(!po.isHexDigit(n))throw hs(Et());e+=Et()}return String.fromCodePoint(parseInt(e,16))}const QIt={start(){if(ma.type==="eof")throw ab();c3()},beforePropertyName(){switch(ma.type){case"identifier":case"string":TV=ma.value,_l="afterPropertyName";return;case"punctuator":p2();return;case"eof":throw ab()}},afterPropertyName(){if(ma.type==="eof")throw ab();_l="beforePropertyValue"},beforePropertyValue(){if(ma.type==="eof")throw ab();c3()},beforeArrayValue(){if(ma.type==="eof")throw ab();if(ma.type==="punctuator"&&ma.value==="]"){p2();return}c3()},afterPropertyValue(){if(ma.type==="eof")throw ab();switch(ma.value){case",":_l="beforePropertyName";return;case"}":p2()}},afterArrayValue(){if(ma.type==="eof")throw ab();switch(ma.value){case",":_l="beforeArrayValue";return;case"]":p2()}},end(){}};function c3(){let e;switch(ma.type){case"punctuator":switch(ma.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=ma.value;break}if(sS===void 0)sS=e;else{const t=Rh[Rh.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,TV,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")Rh.push(e),Array.isArray(e)?_l="beforeArrayValue":_l="beforePropertyName";else{const t=Rh[Rh.length-1];t==null?_l="end":Array.isArray(t)?_l="afterArrayValue":_l="afterPropertyValue"}}function p2(){Rh.pop();const e=Rh[Rh.length-1];e==null?_l="end":Array.isArray(e)?_l="afterArrayValue":_l="afterPropertyValue"}function hs(e){return hR(e===void 0?`JSON5: invalid end of input at ${mg}:${Rd}`:`JSON5: invalid character '${TMe(e)}' at ${mg}:${Rd}`)}function ab(){return hR(`JSON5: invalid end of input at ${mg}:${Rd}`)}function tne(){return Rd-=5,hR(`JSON5: invalid identifier character at ${mg}:${Rd}`)}function zIt(e){console.warn(`JSON5: '${TMe(e)}' in strings is not valid ECMAScript; consider escaping`)}function TMe(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 hR(e){const t=new SyntaxError(e);return t.lineNumber=mg,t.columnNumber=Rd,t}var VIt=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 w="";for(let O=0;Ov[O]=0)throw TypeError("Converting circular structure to JSON5");r.push(b);let v=s;s=s+c;let y=a||Object.keys(b),w=[];for(const O of y){const S=d(O,b);if(S!==void 0){let k=m(O)+":";c!==""&&(k+=" "),k+=S,w.push(k)}}let x;if(w.length===0)x="{}";else{let O;if(c==="")O=w.join(","),x="{"+O+"}";else{let S=`, `+s;O=w.join(S),x=`{ `+s+O+`, -`+v+"}"}}return r.pop(),s=v,x}function m(b){if(b.length===0)return f(b);const v=String.fromCodePoint(b.codePointAt(0));if(!co.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 x=0;x=0)throw TypeError("Converting circular structure to JSON5");r.push(b);let v=s;s=s+c;let y=[];for(let x=0;x30)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"&&UIt.test(e.trim()))throw new Error("ECharts option contains an external resource");if(Array.isArray(e)){for(const n of e)hR(n,t+1);return}if(lk(e))for(const[n,i]of Object.entries(e)){if(BIt.has(n))throw new Error("ECharts option contains an unsafe key");hR(i,t+1)}}function QIt(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 zIt(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(VIt),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 qIt(e,t){const n=/^(?:new\s+)?echarts\.graphic\.(LinearGradient|RadialGradient)\s*\(/;let i="",r=!1,s=!1,a=!1;for(let l=t;lFIt)throw new Error("ECharts option is too large");const n=WIt(QIt(e));let i;try{i=wMe.parse(n)}catch(a){throw/\bfunction\s*\(|=>/.test(n)?new Error("ECharts function callbacks are not supported"):a}if(!lk(i))throw new Error("ECharts option must be a data object");hR(i);const r={...i};r.aria={...lk(r.aria)?r.aria:{},enabled:!0};const s=r.tooltip;return lk(s)?r.tooltip={...s,renderMode:"richText"}:Array.isArray(s)&&(r.tooltip=s.map(a=>lk(a)?{...a,renderMode:"richText"}:a)),t&&(r.animation=!1),r}let c3;function KIt(){return c3??(c3=Bs(()=>import("../visualizations/echarts/index-CGT341lL.js"),[]).catch(e=>{throw c3=void 0,e})),c3}function GIt({source:e}){const{t}=je("conversation"),n=p.useRef(null),[i,r]=p.useState(!1),[s,a]=p.useState("");return p.useEffect(()=>{let l=!1,c,u,d;r(!1);try{d=OMe(e,window.matchMedia("(prefers-reduced-motion: reduce)").matches),a("")}catch{a("invalid");return}return KIt().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(mn,{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 XIt=p.memo(GIt);let nne,ine=Promise.resolve(),YIt=0;function ZIt(){return nne??(nne=Bs(async()=>{const{default:e}=await import("../visualizations/mermaid/mermaid.core-DeGzkuWe.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))),nne}function JIt(e){const t=ine.then(async()=>{const n=await ZIt(),i=`mermaid-diagram-${YIt+=1}`;return n.render(i,e)});return ine=t.then(()=>{},()=>{}),t}function ePt({source:e}){const{t}=je("conversation"),n=p.useRef(null),[i,r]=p.useState(null),[s,a]=p.useState(!1);return p.useEffect(()=>{let l=!1;return r(null),a(!1),JIt(e).then(c=>{l||r(c)}).catch(()=>{l||a(!0)}),()=>{l=!0}},[e]),p.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(mn,{duration:2.2,spread:15,children:t("visualization.rendering")})})}const tPt=p.memo(ePt),nPt="_SegmentedControl_1sl7d_1",iPt="_SegmentedControlOption_1sl7d_140",rPt="_SegmentedControlThumb_1sl7d_219",I8={SegmentedControl:nPt,SegmentedControlOption:iPt,SegmentedControlThumb:rPt},Pu=({value:e,onChange:t,children:n,block:i,pill:r=!0,size:s="md",gutterSize:a,className:l,onClick:c,...u})=>{const d=p.useRef(null),f=p.useRef(null),h=p.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 w=b.clientWidth;let x=Math.floor(y.clientWidth);const O=y.offsetLeft;if(w-(x+O)<2&&(x=x-1),v.style.width=`${Math.floor(x)}px`,v.style.transform=`translateX(${O}px)`,b.scrollWidth>w){const S=w*.15,k=b.scrollLeft,C=y.offsetLeft,E=C+x;(Ck+w-S)&&g&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);EAe({ref:d,onResize:()=>{const g=f.current;if(!g)return;const b=g.style.transition;g.style.transition="",h(!1),g.style.transition=b}}),p.useLayoutEffect(()=>{const g=d.current,b=f.current;!g||!b||(h(!!b.style.transition),b.style.transition||DN(()=>{b.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[h,e,s,a,r]);const m=g=>{g&&t&&t(g)};return o.jsxs(Act,{ref:d,className:Ti(I8.SegmentedControl,l),type:"single",value:e,loop:!1,onValueChange:m,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:I8.SegmentedControlThumb,ref:f}),n]})},sPt=({children:e,...t})=>o.jsx(Ict,{className:I8.SegmentedControlOption,...t,onPointerEnter:OQ,children:o.jsx("span",{className:"relative",children:e})});Pu.Option=sPt;function oPt({children:e,label:t,language:n,source:i,streaming:r=!1}){const{t:s}=je("conversation"),[a,l]=p.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(Pu,{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(Pu.Option,{value:"preview",disabled:r,children:s("visualization.preview")}),o.jsx(Pu.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 aPt=p.memo(oPt);function kMe(e){const t=e==null?void 0:e.trim().toLowerCase();if(t==="mermaid")return"mermaid";if(t==="echart"||t==="echarts")return"echarts"}const SMe=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function P8(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(P8).join(""):p.isValidElement(e)?P8(e.props.children):""}function lPt(e){var i;const t=p.Children.toArray(e)[0];if(!p.isValidElement(t))return;const n=(i=t.props.className)==null?void 0:i.split(/\s+/).find(r=>r.startsWith("language-"));return kMe(n==null?void 0:n.slice(9))}function EMe(e){if(!e)return!1;try{const t=e.toLowerCase();return SMe.some(n=>t.includes(n))}catch{return!1}}function cPt(e){var i;const t=(i=e==null?void 0:e.properties)==null?void 0:i.href;if(!t)return!1;if(EMe(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 SMe.some(s=>r.includes(s))}return!1}function uPt({text:e,className:t,allowRawHtml:n=!0,streaming:i=!1}){const{t:r}=je("conversation"),[s,a]=p.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},m=h({children:f});if(m)return m}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(kPe,{remarkPlugins:[KPe],rehypePlugins:n?[EIt,Mte]:[Mte],components:{pre:({node:d,children:f,...h})=>{const m=lPt(f);if(m==="mermaid"||m==="echarts"){const g=P8(f).replace(/\n$/,"");return o.jsx(aPt,{label:m==="mermaid"?"Mermaid":"ECharts",language:m,source:g,streaming:i,children:m==="mermaid"?o.jsx(tPt,{source:g}):o.jsx(XIt,{source:g})})}return o.jsx("pre",{...h,children:f})},a:({node:d,...f})=>{const h=f.href;if(h&&(EMe(h)||cPt(d))){const m=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:m,title:g}),children:[o.jsx("video",{src:m,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(ax,{})})]}),o.jsx("div",{className:"video-caption",children:o.jsx("a",{href:m,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,...m})=>{const g=o.jsx("img",{...m,src:f,alt:h??"",loading:"lazy"});return f?o.jsx(wEe,{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(ax,{})})]})}):g},video:({node:d,src:f,children:h,...m})=>{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,...m,playsInline:!0,className:"video-thumbnail",children:h}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(ax,{})})]})}):o.jsx("video",{src:f,controls:!0,playsInline:!0,className:"video-inline",...m,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(gP,{})}),o.jsx("button",{type:"button",className:"video-viewer-close","aria-label":r("markdown.close"),onClick:()=>a(null),children:o.jsx(Oa,{})})]})]}),o.jsx("div",{className:"video-viewer-body",children:o.jsx("video",{src:s.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const Ju=p.memo(uPt);function u3(e){return(e==null?void 0:e.trim())||Dg("resourceMetadata.unknownSource")}function CMe(e){return(e==null?void 0:e.trim())||Dg("resourceMetadata.unknownCreator")}function dPt(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 fPt(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 hPt(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 pPt(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 aT({title:e,children:t,onClose:n,busy:i=!1,className:r=""}){const{t:s}=je("ui"),a=p.useId(),l=p.useRef(null),c=p.useRef(null),u=p.useRef(i),d=p.useRef(n);return p.useEffect(()=>{u.current=i,d.current=n},[i,n]),p.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 m=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(O=>O.getClientRects().length>0);if(y.length===0){b.preventDefault();return}const w=y[0],x=y[y.length-1];b.shiftKey&&(document.activeElement===w||!v.contains(document.activeElement))?(b.preventDefault(),x.focus()):!b.shiftKey&&(document.activeElement===x||!v.contains(document.activeElement))&&(b.preventDefault(),w.focus())};return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m),document.body.style.overflow=h,f!=null&&f.isConnected&&f.focus()}},[]),si.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(hPt,{})})]}),t]})}),document.body)}function SE({message:e}){return e?o.jsx("div",{className:"knowledge-form-error",role:"alert",children:e}):null}function D8(e){return e instanceof DOMException&&e.name==="AbortError"}function mPt(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 TMe=[".jpg",".jpeg",".png"].join(","),gPt=new Set(TMe.split(",")),AMe=[".pdf",".pptx",".docx",".xlsx",".txt"].join(","),bPt=new Set(AMe.split(",")),yPt=200*1024*1024;function M8(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t).toLocaleLowerCase()}function vPt(e,t,n){return e.size>yPt?n("knowledge.errors.fileTooLarge"):t==="image"?gPt.has(M8(e.name))?"":n("knowledge.errors.invalidImageType"):bPt.has(M8(e.name))?"":n("knowledge.errors.invalidDocumentType")}function AV(e){return e<=0?"-":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function L8(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 xPt({region:e,onClose:t,onCreated:n}){const{t:i}=je("ui"),[r,s]=p.useState(""),[a,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(!1),[h,m]=p.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),m("");const w={name:g,description:a.trim()||void 0,region:e};try{n(await nOt(w))}catch(x){m(ol(x,i("knowledge.errors.createBase")))}finally{f(!1)}};return o.jsx(aT,{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(SE,{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 wPt({item:e,onClose:t,onUpdated:n}){const{t:i}=je("ui"),[r,s]=p.useState(e.description),[a,l]=p.useState(!1),[c,u]=p.useState(""),d=async f=>{f.preventDefault(),l(!0),u("");try{n(await iOt(e.id,e.region,{description:r.trim()}))}catch(h){u(ol(h,i("knowledge.errors.updateBase")))}finally{l(!1)}};return o.jsx(aT,{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(SE,{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 _Me(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 OPt({base:e,onClose:t,onCreated:n,onAssociationInvalid:i}){const{t:r}=je("ui"),[s,a]=p.useState("document"),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(null),[b,v]=p.useState(!1),[y,w]=p.useState("{}"),[x,O]=p.useState(""),[S,k]=p.useState(""),[C,E]=p.useState(null),R=p.useRef(null),A=p.useRef(null),j=p.useRef(null),T=p.useRef(0),N=!!x;p.useEffect(()=>{var L;C&&!N&&((L=j.current)==null||L.focus())},[N,C]);const _=L=>{N||L===s||(a(L),g(null),h(""),c(""),d(""),k(""),E(null),v(!1),T.current=0,R.current&&(R.current.value=""))},D=L=>{if(!L||s==="web")return;const B=vPt(L,s,r);if(B){g(null),c(""),d(""),k(B);return}g(L),k(""),c(L.name.replace(/\.[^.]+$/,"")),d(M8(L.name).slice(1))},M=async L=>{if(L.preventDefault(),s==="web"?!f.trim():!m)return;let B;try{B=_Me(y,r("knowledge.errors.metadataObject"))}catch(I){k(ol(I,r("knowledge.errors.metadataFormat")));return}O(s==="web"?C?"save":"preview":"upload"),k("");try{if(s==="web")if(C){const I={sourceType:"url",metadata:C.metadata,url:C.preview.url,sourceTitle:C.preview.name,sourceMarkdown:C.preview.sourceMarkdown};await aOt(e.id,e.region,I),n()}else{const I=await lOt(e.id,e.region,{url:f.trim()});if(!I.sourceMarkdown.trim())throw new Error(r("knowledge.errors.noWebPreview"));E({preview:I,metadata:B})}else m&&(await cOt(e.id,e.region,{file:m,name:l.trim()||void 0,documentType:u.trim()||void 0,metadata:B}),n())}catch(I){I instanceof GP&&I.errorCode===MIe?i(I):k(ol(I,r(s==="web"?C?"knowledge.errors.addWeb":"knowledge.errors.previewWeb":"knowledge.errors.uploadFile")))}finally{O("")}},P=()=>{N||(E(null),k(""),requestAnimationFrame(()=>{var L;return(L=A.current)==null?void 0:L.focus()}))};return o.jsx(aT,{title:r(C?"knowledge.previewWeb":"knowledge.addData"),onClose:t,busy:N,className:C?"knowledge-dialog--preview knowledge-dialog--web-confirm":"",children:o.jsx("form",{onSubmit:L=>void M(L),children:C?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:C.preview.name,children:C.preview.name}),o.jsx("a",{href:C.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(Ju,{text:C.preview.sourceMarkdown,allowRawHtml:!1,className:"knowledge-preview__markdown"})})}),S?o.jsx("div",{className:"knowledge-web-preview__error",children:o.jsx(SE,{message:S})}):null]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",className:"is-back",onClick:P,disabled:N,children:r("knowledge.backToEdit")}),o.jsx("button",{type:"button",onClick:t,disabled:N,children:r("common.cancel")}),o.jsx("button",{ref:j,type:"submit",className:"is-primary",disabled:N,children:r(x==="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(([L,B])=>o.jsx("button",{type:"button",role:"tab",id:`knowledge-source-${L}-tab`,"aria-controls":`knowledge-source-${L}-panel`,"aria-selected":s===L,tabIndex:s===L?0:-1,className:s===L?"is-active":"",disabled:N,onClick:()=>_(L),onKeyDown:I=>{const z=["image","document","web"];if(!["ArrowLeft","ArrowRight","Home","End"].includes(I.key))return;I.preventDefault();const K=z.indexOf(L),F=I.key==="Home"?z[0]:I.key==="End"?z[z.length-1]:z[(K+(I.key==="ArrowRight"?1:-1)+z.length)%z.length];_(F),requestAnimationFrame(()=>{var q;return(q=document.getElementById(`knowledge-source-${F}-tab`))==null?void 0:q.focus()})},children:B},L))}),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:A,autoFocus:!0,type:"url",value:f,disabled:N,onChange:L=>{h(L.target.value),k("")},placeholder:"https://example.com/article"})]}),o.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:x==="preview"?o.jsx(mn,{children:r("knowledge.generatingWebPreview")}):null})]}):o.jsxs(o.Fragment,{children:[o.jsx("input",{ref:R,className:"knowledge-upload-input",type:"file","aria-label":r("knowledge.selectFile"),accept:s==="image"?TMe:AMe,disabled:N,onChange:L=>{var B;D(((B=L.currentTarget.files)==null?void 0:B[0])??null),L.currentTarget.value=""}}),o.jsxs("button",{type:"button",className:`knowledge-upload-dropzone${b?" is-dragging":""}${m?" is-ready":""}`,disabled:N,onClick:()=>{var L;return(L=R.current)==null?void 0:L.click()},onDragEnter:L=>{L.preventDefault(),!N&&(T.current+=1,v(!0))},onDragOver:L=>{L.preventDefault(),N||(L.dataTransfer.dropEffect="copy")},onDragLeave:L=>{L.preventDefault(),T.current=Math.max(0,T.current-1),T.current===0&&v(!1)},onDrop:L=>{var B;L.preventDefault(),T.current=0,v(!1),N||D(((B=L.dataTransfer.files)==null?void 0:B[0])??null)},children:[o.jsx("strong",{children:m?m.name:r("knowledge.selectOrDropFile")}),o.jsx("span",{children:m?r("knowledge.selectedFile",{size:AV(m.size)}):r(s==="image"?"knowledge.imageFileHelp":"knowledge.documentFileHelp")})]}),o.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:N?o.jsx(mn,{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:N,maxLength:256,onChange:L=>c(L.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.optionalType")}),o.jsx("input",{value:u,disabled:N,maxLength:64,onChange:L=>d(L.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:N,onChange:L=>w(L.target.value),spellCheck:!1})]}),o.jsx(SE,{message:S})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:t,disabled:N,children:r("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:N||(s==="web"?!f.trim():!m),children:r(N?s==="web"?"common.generating":"common.uploading":s==="web"?"knowledge.generatePreview":"knowledge.uploadFile")})]})]})})})}function kPt({base:e,item:t,onClose:n,onUpdated:i}){const{t:r}=je("ui"),[s,a]=p.useState(()=>JSON.stringify(t.metadata??{},null,2)),[l,c]=p.useState(!1),[u,d]=p.useState(""),f=async h=>{h.preventDefault();let m;try{m=_Me(s,r("knowledge.errors.metadataObject"))}catch(g){d(ol(g,r("knowledge.errors.metadataFormat")));return}c(!0),d("");try{i(await uOt(e.id,t.id,e.region,{metadata:m}))}catch(g){d(ol(g,r("knowledge.errors.updateDocument")))}finally{c(!1)}};return o.jsx(aT,{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(SE,{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 jMe=new Set(["avif","bmp","gif","jpeg","jpg","png","svg","webp"]),NMe=new Set(["aac","flac","m4a","mp3","ogg","wav","webm"]),RMe=new Set(["m4v","mov","mp4","mpeg","mpg","ogg","webm"]),SPt=new Set(["pdf"]),EPt=new Set(["doc","docx","ppt","pptx","xls","xlsx"]),CPt=new Set(["creating","indexing","pending","processing","queued","submitted"]),TPt=new Set(["error","failed","unavailable"]);function rne(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function gA(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 APt(e,t){if(Array.isArray(e)){if(e.length===0)return null;const r=e.map(rne);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=>gA(a[l])))}}return{columns:[t("knowledge.value")],rows:e.map(s=>[gA(s)])}}const n=rne(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])=>gA(c[l])))}}return{columns:[t("knowledge.field"),t("knowledge.value")],rows:i.map(([r,s])=>[r,gA(s)])}}function IMe(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 _Pt(e){const t=IMe(e);return t.startsWith("http://")||t.startsWith("https://")?t:""}function jPt(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 jMe.has(i)?"image":NMe.has(i)?"audio":RMe.has(i)?"video":SPt.has(i)?"pdf":t||i?"file":"none"}function NPt(e,t){const n=e.status.trim().toLocaleLowerCase();if(CPt.has(n))return{title:t("knowledge.preview.processingTitle"),detail:t("knowledge.preview.processingDetail")};if(TPt.has(n))return{title:t("knowledge.preview.failedTitle"),detail:t("knowledge.preview.failedDetail")};const i=L8(e).toLocaleLowerCase();return i==="pdf"||EPt.has(i)?{title:t("knowledge.preview.noParsedTitle"),detail:t("knowledge.preview.noParsedDetail")}:jMe.has(i)||NMe.has(i)||RMe.has(i)?{title:t("knowledge.preview.noMediaTitle"),detail:t("knowledge.preview.noMediaDetail")}:{title:t("knowledge.preview.noDataTitle"),detail:t("knowledge.preview.noDataDetail")}}function RPt({chunk:e}){const{t}=je("ui"),[n,i]=p.useState(!1),r=IMe(e.attachmentUrl),s=jPt(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 IPt({base:e,item:t,onClose:n}){const{t:i}=je("ui"),[r,s]=p.useState([]),[a,l]=p.useState(t),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(!1),[v,y]=p.useState(""),w=p.useRef(0),x=p.useRef(null),O=p.useCallback(async(E=0)=>{var j;(j=x.current)==null||j.abort();const R=new AbortController;x.current=R;const A=w.current+1;w.current=A,E>0?m(!0):f(!0),y(""),E===0&&(s([]),b(!1));try{const T=await oOt(e.id,t.id,{region:e.region,offset:E,signal:R.signal});if(w.current!==A)return;l(T.document.id?T.document:t),u(T.sourceMarkdown||T.document.sourceMarkdown),s(N=>E>0?[...N,...T.chunks]:T.chunks),b(T.hasMore)}catch(T){!D8(T)&&w.current===A&&y(ol(T,i("knowledge.errors.loadPreview")))}finally{w.current===A&&(f(!1),m(!1))}},[e.id,e.region,t,i]);p.useEffect(()=>(O(),()=>{var E;(E=x.current)==null||E.abort(),w.current+=1}),[O]);const S=_Pt(a.url||t.url),k=NPt(a,i),C=a.metadata._veadk_content_format==="markdown";return o.jsx(aT,{title:a.name||t.name||t.id,onClose:n,className:"knowledge-dialog--preview",children:o.jsxs("div",{className:"knowledge-preview",children:[a.sizeBytes>0||S?o.jsxs("div",{className:"knowledge-preview__meta",children:[a.sizeBytes>0?o.jsx("span",{children:AV(a.sizeBytes)}):null,S?o.jsx("a",{href:S,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(Ju,{text:c,allowRawHtml:!1,className:"knowledge-preview__markdown"})}):d?o.jsx("div",{className:"knowledge-preview__state",role:"status",children:o.jsx(mn,{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 O(),children:i("common.retry")})]}):r.length===0?o.jsxs("div",{className:"knowledge-preview__state",children:[o.jsx("p",{children:k.title}),o.jsx("span",{children:S?i("knowledge.preview.openOriginalHint"):k.detail}),o.jsx("button",{type:"button",onClick:()=>void O(),children:i("common.reload")})]}):o.jsxs("div",{className:"knowledge-preview__chunks",children:[r.map((E,R)=>{const A=APt(E.tableFields,i),j=E.id||`${R}:${E.title}`;return o.jsxs("article",{className:"knowledge-preview__chunk",children:[o.jsx("header",{children:o.jsx("h3",{children:E.title||i("knowledge.preview.chunk",{index:R+1})})}),E.content?C?o.jsx(Ju,{text:E.content,allowRawHtml:!1,className:"knowledge-preview__markdown"}):o.jsx("p",{className:"knowledge-preview__content",children:E.content}):null,A?o.jsx("div",{className:"knowledge-preview__table-wrap",children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsx("tr",{children:A.columns.map((T,N)=>o.jsx("th",{scope:"col",children:T},`${T}:${N}`))})}),o.jsx("tbody",{children:A.rows.map((T,N)=>o.jsx("tr",{children:T.map((_,D)=>o.jsx("td",{children:_},D))},N))})]})}):null,o.jsx(RPt,{chunk:E})]},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 O(r.length),children:h?o.jsx(mn,{as:"span",duration:2.4,children:i("knowledge.preview.loadingMore")}):i("knowledge.preview.loadMore")}):null]})})]})})}function PPt({cloudProvider:e,region:t,active:n=!0,activationRevision:i=0,onDetailChange:r,toolbarLeading:s,toolbarFilters:a}){const{t:l,i18n:c}=je("ui"),[u,d]=p.useState([]),[f,h]=p.useState({}),[m,g]=p.useState([]),[b,v]=p.useState(""),[y,w]=p.useState("overview"),[x,O]=p.useState(""),[S,k]=p.useState(""),[C,E]=p.useState(!0),[R,A]=p.useState(!1),[j,T]=p.useState(""),[N,_]=p.useState([]),[D,M]=p.useState(!1),[P,L]=p.useState(""),[B,I]=p.useState(""),[z,K]=p.useState(""),[F,q]=p.useState(!1),[H,X]=p.useState(!1),[ne,Q]=p.useState(!1),[Z,ce]=p.useState(null),[Ee,Y]=p.useState(null),[G,te]=p.useState(null),[ue,Ce]=p.useState(null),[se,he]=p.useState(null),[ae,Ae]=p.useState(!1),De=p.useRef(0),ye=p.useRef(0),Qe=p.useRef([]),we=p.useRef(!1),Ne=p.useRef(!1),ie=p.useRef(null),fe=p.useRef(null),Se=p.useRef({}),ke=p.useRef(!1),qe=p.useRef(null),it=p.useRef(null),de=p.useRef(null),ve=p.useRef(null),Te=p.useMemo(()=>[t],[t]),Ke=p.useCallback(We=>`${We.region}\0${We.id}`,[]),$e=u.find(We=>Ke(We)===b)??null,At=!!($e&&z===Ke($e));p.useEffect(()=>{r==null||r(!!$e)},[r,$e]),p.useEffect(()=>{w("overview"),k("")},[b]);const Nt=p.useMemo(()=>{const We=x.trim().toLocaleLowerCase();return We?u.filter(Le=>[Le.name,Le.description,Le.ownerLabel,Le.providerKnowledgeId].some(Ge=>Ge.toLocaleLowerCase().includes(We))):u},[u,x]),vt=p.useMemo(()=>{const We=S.trim().toLocaleLowerCase();return We?N.filter(Le=>[Le.name,Le.id,L8(Le)].some(Ge=>Ge.toLocaleLowerCase().includes(We))):N},[S,N]);p.useEffect(()=>{Y(null)},[$e==null?void 0:$e.id,$e==null?void 0:$e.region]);const Ot=p.useCallback(async(We=!1)=>{var pt;if(We&&(ke.current||Object.keys(Se.current).length===0))return;(pt=ie.current)==null||pt.abort();const Le=new AbortController;ie.current=Le;const Ge=De.current+1;De.current=Ge,ke.current=!0,We?A(!0):E(!0),T(""),We||g([]);try{const ot=await tOt({regions:Te,nextTokens:We?Se.current:void 0,signal:Le.signal});if(De.current!==Ge)return;d(rt=>We?[...rt,...ot.items.filter(qt=>!rt.some(cn=>Ke(cn)===Ke(qt)))]:ot.items),Se.current=ot.nextTokens,h(ot.nextTokens);const kt=ot.failures.map(({region:rt,error:qt})=>`${Lf(rt,e)}: ${ol(qt,l("common.loadFailed"))}`);g(rt=>We?[...new Set([...rt,...kt])]:kt),We||v(rt=>ot.items.some(qt=>Ke(qt)===rt)?rt:"")}catch(ot){if(D8(ot))return;De.current===Ge&&(We?g(kt=>[...new Set([...kt,ol(ot,l("knowledge.errors.loadMoreBases"))])]):T(ol(ot,l("knowledge.errors.loadBases"))))}finally{De.current===Ge&&(ke.current=!1,E(!1),A(!1))}},[Ke,e,Te,l]),Tt=p.useCallback(async(We,Le=!1)=>{var ot;if(Le&&we.current)return;(ot=fe.current)==null||ot.abort();const Ge=new AbortController;fe.current=Ge;const pt=ye.current+1;ye.current=pt,Le||(Qe.current=[],Ne.current=!1,_([]),q(!1),I("")),we.current=!0,M(!0),Le?I(""):L("");try{const kt=await sOt(We.id,{region:We.region,offset:Le?Qe.current.length:0,signal:Ge.signal});if(ye.current!==pt)return;K(un=>un===Ke(We)?"":un);const rt=Qe.current,qt=Le?[...rt,...kt.items.filter(un=>!un.id||!rt.some(Xe=>Xe.id===un.id))]:kt.items,cn=kt.hasMore&&(!Le||qt.length>rt.length);Qe.current=qt,Ne.current=cn,_(qt),q(cn)}catch(kt){if(D8(kt))return;ye.current===pt&&(kt instanceof GP&&kt.errorCode===MIe&&(K(Ke(We)),ce(qt=>qt&&Ke(qt)===Ke(We)?null:qt)),Le?I(ol(kt,l("knowledge.errors.loadMoreData"))):L(ol(kt,l("knowledge.errors.loadData"))))}finally{ye.current===pt&&(we.current=!1,M(!1))}},[Ke,l]);p.useEffect(()=>{var We;(We=ie.current)==null||We.abort(),De.current+=1,ke.current=!1,Se.current={},d([]),h({}),g([]),v(""),K(""),T(""),E(!0)},[e]),p.useEffect(()=>{if(n)return Ot(),()=>{var We;(We=ie.current)==null||We.abort(),De.current+=1,ke.current=!1}},[n,i,Ot]),p.useEffect(()=>{var We,Le;if(!n){(We=fe.current)==null||We.abort(),ye.current+=1,we.current=!1;return}if(!$e){(Le=fe.current)==null||Le.abort(),ye.current+=1,Qe.current=[],we.current=!1,Ne.current=!1,_([]),q(!1),I("");return}return Tt($e),()=>{var Ge;(Ge=fe.current)==null||Ge.abort(),ye.current+=1,we.current=!1}},[n,i,$e==null?void 0:$e.id,$e==null?void 0:$e.region]);const ft=n&&!$e&&!x.trim()&&!C&&!R&&!j&&Object.keys(f).length>0;p.useEffect(()=>{const We=it.current,Le=qe.current;if(!We||!Le||!ft)return;const Ge=new IntersectionObserver(([pt])=>{pt.isIntersecting&&Ot(!0)},{root:Le,rootMargin:"240px 0px",threshold:.01});return Ge.observe(We),()=>Ge.disconnect()},[ft,Ot]);const gt=()=>{const We=qe.current;!We||!ft||We.scrollHeight-We.scrollTop-We.clientHeight<=240&&Ot(!0)},Me=!!($e&&N.length>0&&F&&!D&&!B);p.useEffect(()=>{const We=ve.current,Le=de.current;if(!$e||!We||!Le||!Me)return;const Ge=new IntersectionObserver(([pt])=>{pt.isIntersecting&&Tt($e,!0)},{root:de.current,rootMargin:"240px 0px",threshold:.01});return Ge.observe(We),()=>Ge.disconnect()},[Me,Tt,$e==null?void 0:$e.id,$e==null?void 0:$e.region]);const bt=()=>{const We=de.current;if(!$e||!We||!Ne.current||we.current||B)return;const{scrollHeight:Le,scrollTop:Ge,clientHeight:pt}=We;Le-Ge-pt<=240&&Tt($e,!0)},jt=We=>{d(Le=>Le.map(Ge=>Ke(Ge)===Ke(We)?We:Ge))},Ct=async()=>{if(ue){Ae(!0);try{await rOt(ue.id,ue.region),d(We=>We.filter(Le=>Ke(Le)!==Ke(ue))),K(We=>We===Ke(ue)?"":We),b===Ke(ue)&&v(""),Ce(null)}catch(We){T(ol(We,l("knowledge.errors.deleteBase"))),Ce(null)}finally{Ae(!1)}}},sn=async()=>{if(!(!$e||!se)){Ae(!0);try{await dOt($e.id,se.id,$e.region);const We=Qe.current.filter(Le=>Le.id!==se.id);Qe.current=We,_(We),he(null)}catch(We){L(ol(We,l("knowledge.errors.deleteDocument"))),he(null)}finally{Ae(!1)}}};return o.jsxs("section",{className:`knowledge-library${$e?" is-detail":" resource-collection"}`,"aria-label":l("knowledge.library"),children:[$e?o.jsx(XC,{className:"knowledge-library__detail",title:$e.name,description:$e.description||l("common.noDescription"),identitySeed:$e.name,backLabel:l("knowledge.backToList"),onBack:()=>v(""),sections:[{key:"overview",label:l("skillCenter.overview"),content:o.jsx("section",{className:"knowledge-overview",children:o.jsxs(Fz,{className:"knowledge-overview__summary",children:[o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.provider")}),o.jsx("dd",{children:$e.providerType||"-"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.knowledgeId")}),o.jsx("dd",{className:"knowledge-keyboard-reveal",tabIndex:0,title:$e.providerKnowledgeId,children:$e.providerKnowledgeId||"-"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.project")}),o.jsx("dd",{children:$e.projectName||"default"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.creator")}),o.jsx("dd",{children:u3($e.ownerLabel)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("skillCenter.updatedAt")}),o.jsx("dd",{children:mPt($e.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${N.length>0?" is-table":""}`,"aria-live":"polite",children:D&&N.length===0?o.jsx(Ha,{}):P&&N.length===0?o.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[o.jsx("p",{children:P}),At&&$e.canManage?o.jsx("button",{type:"button",onClick:()=>Ce($e),children:l("knowledge.deleteInvalidAssociation")}):o.jsx("button",{type:"button",onClick:()=>void Tt($e),children:l("common.retry")})]}):N.length===0?o.jsxs("div",{className:"knowledge-library__state",children:[o.jsx(fPt,{}),o.jsx("p",{children:l("knowledge.noData")}),$e.canManage&&o.jsx("button",{type:"button",onClick:()=>ce($e),children:l("knowledge.addFirstData")})]}):o.jsx(Bz,{rows:vt,rowKey:We=>We.id,rowLabel:We=>We.name||We.id,columns:[{key:"name",header:l("common.name"),className:"is-primary-column",render:We=>o.jsx("span",{title:We.name||We.id,children:We.name||We.id})},{key:"format",header:l("knowledge.format"),className:"is-compact-column",render:We=>L8(We)},{key:"size",header:l("knowledge.size"),className:"is-compact-column",render:We=>AV(We.sizeBytes)}],searchValue:S,onSearchChange:k,searchPlaceholder:l("knowledge.searchData"),searchLabel:l("knowledge.searchLibraryData"),primaryAction:$e.canManage?{label:l(At?"knowledge.associationInvalid":"knowledge.addData"),disabled:At,title:At?l("knowledge.providerMissing"):void 0,onClick:()=>ce($e)}:void 0,rowActions:We=>[{label:l("common.preview"),onSelect:()=>Y(We)},...$e.canManage?[{label:l("common.edit"),onSelect:()=>te(We)},{label:l("common.delete"),onSelect:()=>he(We),danger:!0}]:[]],scrollRef:de,onScroll:bt,busy:D,emptyLabel:l("knowledge.noMatchingData"),footer:D?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")})]}):B?o.jsxs("div",{className:"knowledge-document-pagination is-error",role:"alert",children:[o.jsx("span",{children:B}),o.jsx("button",{type:"button",onClick:()=>void Tt($e,!0),children:l("knowledge.retryLoading")})]}):F?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:w,actions:$e.canManage?o.jsxs(o.Fragment,{children:[o.jsx(It,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>Ce($e),children:l("common.delete")}),o.jsx(It,{type:"button",color:"primary",size:"lg",pill:!1,onClick:()=>Q(!0),children:l("common.edit")})]}):void 0}):o.jsxs(o.Fragment,{children:[o.jsxs(e0,{className:"knowledge-library__toolbar library-resource-toolbar",children:[s,o.jsxs("div",{className:"resource-toolbar__actions",children:[a,o.jsx(hp,{value:x,onChange:We=>O(We.target.value),placeholder:l("knowledge.searchBases"),"aria-label":l("knowledge.searchBases")})]})]}),o.jsxs(Pg,{ref:qe,"aria-live":"polite",onScroll:gt,children:[m.length>0&&!C&&o.jsxs("div",{className:"knowledge-region-warning",role:"status",children:[o.jsx("span",{children:l("knowledge.someBasesFailed")}),o.jsx("button",{type:"button",onClick:()=>void Ot(),children:l("common.retry")})]}),C&&u.length===0?o.jsx(Ha,{}):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 Ot(),children:l("common.retry")})]}):Nt.length===0&&x.trim()?o.jsxs("div",{className:"knowledge-library__state",children:[o.jsx(dPt,{}),o.jsx("p",{children:l("knowledge.noMatchingBases")})]}):o.jsxs(n0,{children:[x.trim()?null:o.jsx(hg,{"aria-label":l("knowledge.createBase"),icon:o.jsx(pPt,{}),onClick:()=>X(!0),children:l("knowledge.createBase")}),Nt.map(We=>o.jsx(r0,{className:"knowledge-card",title:We.name,description:We.description||l("common.noDescription"),metadata:[{label:l("knowledge.creator"),value:u3(We.ownerLabel),title:u3(We.ownerLabel)},{label:l("knowledge.project"),value:We.projectName||"default",title:We.projectName||"default"}],action:{label:z===Ke(We)?l("knowledge.associationInvalid"):l("knowledge.addData"),icon:"plus",disabled:!We.canManage||z===Ke(We),title:We.canManage?z===Ke(We)?l("knowledge.providerMissing"):void 0:l("knowledge.noManagePermission"),onClick:()=>ce(We)},detailAction:{label:l("common.viewDetails"),onClick:()=>v(Ke(We))}},Ke(We)))]}),ft||R?o.jsx("div",{ref:it,className:"my-agent-load-more",role:"status","aria-live":"polite",children:R?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:l("knowledge.loadingMoreBases")})]}):ft?o.jsx("span",{children:l("skillCenter.scrollForMore")}):null}):null]})]}),H&&o.jsx(xPt,{region:t,onClose:()=>X(!1),onCreated:We=>{d(Le=>[We,...Le]),v(Ke(We)),X(!1)}}),$e&&ne&&o.jsx(wPt,{item:$e,onClose:()=>Q(!1),onUpdated:We=>{jt(We),Q(!1)}}),$e&&Ee&&o.jsx(IPt,{base:$e,item:Ee,onClose:()=>Y(null)}),Z&&o.jsx(OPt,{base:Z,onClose:()=>ce(null),onAssociationInvalid:We=>{K(Ke(Z)),$e&&Ke($e)===Ke(Z)&&L(ol(We,l("knowledge.associationInvalid"))),ce(null)},onCreated:()=>{$e&&Ke($e)===Ke(Z)&&Tt($e),ce(null)}}),$e&&G&&o.jsx(kPt,{base:$e,item:G,onClose:()=>te(null),onUpdated:We=>{const Le=Qe.current.map(Ge=>Ge.id===We.id?We:Ge);Qe.current=Le,_(Le),te(null)}}),ue&&o.jsx(Yu,{title:l("knowledge.deleteBaseTitle"),description:l("knowledge.deleteBaseDescription",{name:ue.name}),confirmLabel:l(ae?"common.deleting":"common.delete"),variant:"danger",busy:ae,onCancel:()=>Ce(null),onConfirm:()=>void Ct()}),se&&o.jsx(Yu,{title:l("knowledge.deleteDocumentTitle"),description:l("knowledge.deleteDocumentDescription",{name:se.name||se.id}),confirmLabel:l(ae?"common.deleting":"common.delete"),variant:"danger",busy:ae,onCancel:()=>he(null),onConfirm:()=>void sn()})]})}const DPt="_EmptyMessage_1r5gu_1",MPt="_IconBadge_1r5gu_16",LPt="_Title_1r5gu_54",$Pt="_Description_1r5gu_69",FPt="_ActionRow_1r5gu_77",lT={EmptyMessage:DPt,IconBadge:MPt,Title:LPt,Description:$Pt,ActionRow:FPt},Rn=({children:e,className:t,fill:n="static"})=>o.jsx("div",{className:Ti(lT.EmptyMessage,t),"data-fill":n,children:e}),BPt=({size:e="md",color:t="secondary",children:n,className:i})=>o.jsx("div",{className:Ti(lT.IconBadge,i),"data-size":e,"data-color":t,children:n}),UPt=({children:e,className:t,color:n="secondary"})=>o.jsx("div",{className:Ti(lT.Title,t),"data-color":n,children:e}),QPt=({children:e,className:t})=>o.jsx("div",{className:Ti(lT.Description,t),children:e}),zPt=({children:e,className:t})=>o.jsx("div",{className:Ti(lT.ActionRow,t),children:e});Rn.Icon=BPt;Rn.Title=UPt;Rn.Description=QPt;Rn.ActionRow=zPt;const VPt={name:"studio_share_space"},HPt={name:"studio_review_space"},PMe={share:VPt,review:HPt},qPt=PMe.share.name,DMe=PMe.review.name,WPt=[qPt,DMe];function MMe(e){return WPt.includes(e.trim().toLowerCase())}function KPt(e){return e.name===DMe}const GPt="/web/skill-management";class _V 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 $l(e,t={},n=qa){return fetch(ta(`${GPt}${e}`),{...t,headers:Ll(pu(t.headers)),signal:Wa(t.signal,n)})}async function cD(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 _V(n,e.status,i,e.statusText,r,s)}async function Fl(e,t){if(!e.ok)throw await cD(e,t);return e.json()}async function XPt(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),Fl(await $l(`/spaces?${t}`,{signal:e.signal}),V("skills.listSpacesFailed"))}async function YPt(e){if(MMe(e.name))throw new _V(V("skills.reservedSpaceName"),409,"SKILL_SPACE_RESERVED_IDENTITY");return Fl(await $l("/spaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),V("skills.createSpaceFailed"))}async function ZPt(e){const t=new URLSearchParams({region:e.region});return Fl(await $l(`/shared-space/ensure?${t}`,{method:"POST",signal:e.signal}),V("skills.sharedSpaceFailed"))}async function JPt(e){return Fl(await $l(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/review`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({region:e.region,version:e.version})},hr),V("skills.submitReviewFailed"))}async function eDt(e){const t=new URLSearchParams({region:e.region});return Fl(await $l(`/reviews?${t}`,{signal:e.signal}),V("skills.listReviewsFailed"))}async function tDt(e){const t=new URLSearchParams({region:e.region});return Fl(await $l(`/reviews/${encodeURIComponent(e.id)}/files?${t}`,{signal:e.signal},hr),V("skills.reviewFilesFailed"))}async function nDt(e){return Fl(await $l(`/reviews/${encodeURIComponent(e.id)}/decision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({region:e.region,decision:e.decision,reason:e.reason||"",comment:e.comment||""})},hr),V("skills.decideReviewFailed"))}async function iDt(e){const t=new URLSearchParams({region:e.region});return Fl(await $l(`/spaces/${encodeURIComponent(e.spaceId)}/reviews?${t}`,{signal:e.signal}),V("skills.listReviewsFailed"))}async function rDt(e){if(MMe(e.name))throw new _V(V("skills.reservedSpaceName"),409,"SKILL_SPACE_RESERVED_IDENTITY");return Fl(await $l(`/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 sDt(e){const t=new URLSearchParams({region:e.region});await Fl(await $l(`/spaces/${encodeURIComponent(e.spaceId)}?${t}`,{method:"DELETE"}),V("skills.deleteSpaceFailed"))}async function oDt(e){const t=new URLSearchParams({region:e.region});return e.project&&t.set("project",e.project),Fl(await $l(`/spaces/${encodeURIComponent(e.spaceId)}/skills?${t}`,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},hr),V("skills.uploadFailed"))}async function aDt(e){return Fl(await $l("/validate",{method:"POST",headers:{"Content-Type":"application/zip"},body:e},hr),V("skills.validateFailed"))}async function lDt(e){const t=new URLSearchParams({region:e.region});await Fl(await $l(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}?${t}`,{method:"DELETE"}),V("skills.deleteFailed"))}async function LMe(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 Fl(await $l(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/files?${t}`),V("skills.listFilesFailed"));return Array.isArray(n.files)?n.files:[]}async function cDt(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 $l(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/archive?${t}`,{},hr);n.ok||await Fl(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)}function oc(e){var t;return((t=e==null?void 0:e.displayName)==null?void 0:t.trim())||(e==null?void 0:e.name)||""}async function uD(e){const t=await fetch(ta(e),{headers:Ll(pu({accept:"application/json"})),signal:Wa(void 0,qa)});if(!t.ok)throw await cD(t,Wt("helpers.skills.agentKitRequestFailed"));return t.json()}async function $Me(){return((await uD("/web/skill-spaces")).items||[]).filter(t=>!KPt(t))}async function FMe(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await uD(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function uDt(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),uD(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`)}async function dDt(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 uD(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${c}`)}function fDt(e,t){const n=Fb(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 Fb(e){return e.skillId||e.skillName}function hDt(e,t,n="volcengine"){return n==="byteplus"?"":`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}hn.hasResourceBundle("en-US","skills")||hn.addResourceBundle("en-US","skills",Ihe,!0,!0);hn.hasResourceBundle("zh-CN","skills")||hn.addResourceBundle("zh-CN","skills",Dve,!0,!0);function Yt(e,t={}){return hn.t(e,{...t,ns:"skills"})}const pDt="/web/skill-workbench";class $8 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 Wu(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(Yt("api.invalidFormat",{label:t}));return e}function sne(e,t){if(e!=null){if(typeof e!="string"||!e.trim()||e.trim().length>256)throw new Error(Yt("api.invalidFormat",{label:t}));return e.trim()}}function mDt(e){if(e!=null){if(e==="pending"||e==="ready"||e==="failed"||e==="unknown")return e;throw new Error(Yt("api.invalidFormat",{label:Yt("api.recoveryStatus")}))}}async function Bf(e,t={},n=qa){return fetch(ta(`${pDt}${e}`),{...t,headers:pu(t.headers),signal:Wa(t.signal,n)})}async function jV(e,t){var i;const n=await e.text().catch(()=>"");try{const r=Wu(JSON.parse(n),Yt("api.errorResponse")),s=r.detail&&typeof r.detail=="object"?Wu(r.detail,Yt("api.errorDetails")):r;return new $8(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])||Yt("api.missingContentType");return new $8(Yt("api.gatewayError",{fallback:t,status:e.status,contentType:r}),e.status,"SKILL_WORKBENCH_ERROR",!1,e.statusText,void 0,n)}}async function mg(e,t){if(!e.ok)throw await jV(e,t);const n=e.headers.get("content-type")??"";if(!n.includes("application/json")){const i=n.split(";",1)[0]||Yt("api.missingContentType");throw new Error(Yt("api.nonJson",{fallback:t,status:e.status,contentType:i}))}return e.json()}function gDt(e){return Array.isArray(e)?e.map(t=>{const n=Wu(t,Yt("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(Yt("api.invalidActivity"));if(i==="tool"){if(typeof n.name!="string")throw new Error(Yt("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(Yt("api.invalidTextActivity"));return{id:n.id,kind:i,status:r,text:n.text}}):[]}function bDt(e){if(e==null)return;const t=Wu(e,Yt("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"||!VI(t.region)||typeof t.projectName!="string")throw new Error(Yt("api.invalidFormat",{label:Yt("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 EE(e){const t=Wu(e,Yt("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(Yt("api.invalidFormat",{label:Yt("api.task")}));const n=Array.isArray(t.files)?t.files.flatMap(l=>{const c=Wu(l,Yt("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(Yt("api.unknownTaskState"));const r=sne(t.toolId,"Tool ID"),s=sne(t.sessionId,"Session ID"),a=mDt(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:gDt(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:bDt(t.publication)}:{}}}async function dD(e){const t=Wu(await mg(await Bf("/capabilities",{signal:e}),Yt("api.loadCapability")),Yt("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 yDt(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 Bf(`/tasks/from-upload?${n}`,{method:"POST",body:e.file,headers:{"Content-Type":"application/zip"},signal:e.signal},hr);return EE(await mg(i,Yt("api.startOptimization")))}const t=await Bf("/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},hr);return EE(await mg(t,Yt("api.startTask")))}async function vDt(e,t){return EE(await mg(await Bf(`/tasks/${encodeURIComponent(e)}`,{signal:t}),Yt("api.loadTask")))}async function d3(e,t,n){const i=new URLSearchParams;i.set("expected_revision",String(t));const r=Wu(await mg(await Bf(`/tasks/${encodeURIComponent(e)}/artifact?${i.toString()}`,{signal:n}),Yt("api.loadArtifact")),Yt("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(Yt("api.invalidFormat",{label:Yt("api.artifact")}));const s=r.files.map(a=>{const l=Wu(a,Yt("api.artifactFile"));if(typeof l.path!="string"||typeof l.size!="number"||typeof l.content!="string")throw new Error(Yt("api.invalidFormat",{label:Yt("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 f3(e){const t=await Bf(`/tasks/${encodeURIComponent(e.jobId)}/refinements`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({intent:e.intent,expectedRevision:e.expectedRevision})},hr);return EE(await mg(t,Yt("api.refine")))}async function xDt(e){const t=await Bf(`/tasks/${encodeURIComponent(e.jobId)}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedRevision:e.expectedRevision})});return EE(await mg(t,Yt("api.stop")))}async function wDt(e){const t=await Bf(`/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 jV(t,Yt("api.publish"));if(!(t.headers.get("content-type")??"").includes("application/x-ndjson"))throw new Error(Yt("api.nonNdjson"));if(!t.body)throw new Error(Yt("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=Wu(JSON.parse(u),Yt("api.publishProgress"));if(d.type==="progress"){if(typeof d.phase!="string"||!i.has(d.phase)||typeof d.message!="string")throw new Error(Yt("api.invalidPublishProgress"));(h=e.onProgress)==null||h.call(e,{phase:d.phase,message:d.message});return}if(d.type==="error"){const m=Wu(d.error,Yt("api.publishError"));throw new $8(typeof m.message=="string"?m.message:Yt("api.publish"),500,typeof m.code=="string"?m.code:"SKILL_PUBLISH_FAILED",m.retryable===!0,"",m.originalError&&typeof m.originalError=="object"?m.originalError:void 0,JSON.stringify(d.error))}if(d.type!=="complete")throw new Error(Yt("api.unknownPublishEvent"));const f=Wu(d.result,Yt("api.publishResult"));if(typeof f.skillId!="string"||typeof f.version!="string"||!Array.isArray(f.skillSpaceIds)||!f.skillSpaceIds.every(m=>typeof m=="string")||f.disposition!=="create-new"&&f.disposition!=="update-source"||!VI(f.region)||typeof f.projectName!="string")throw new Error(Yt("api.invalidFormat",{label:Yt("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(Yt("api.streamEnded"));return r}async function ODt(e){await mg(await Bf(`/tasks/${encodeURIComponent(e)}`,{method:"DELETE"}),Yt("api.deleteTask"))}async function kDt(e,t,n){var c;const i=new URLSearchParams;i.set("expected_revision",String(t)),i.set("expected_sha256",n);const r=await Bf(`/tasks/${encodeURIComponent(e)}/download?${i.toString()}`,{},hr);if(!r.ok)throw await jV(r,Yt("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 BMe=p.createContext(void 0);function c0(e){const t=p.useContext(BMe);if(t===void 0&&!e)throw new Error(mc(47));return t}const SDt={...U2e,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class EDt extends tP{constructor(n,i,r){const s=new uQ;super(CDt(n,s,i,r),TDt(s),SDt);Jt(this,"setOpen",(n,i)=>{var f,h;const r=i.reason===Vc,s=i.reason===Jx&&i.event.detail===0,a=!n&&(i.reason===e2e||i.reason==null),l=knt(i),c=this.select("activeTriggerId");if(!n&&i.reason===JTe&&i.trigger==null&&c!=null&&(i.trigger=this.context.triggerElements.getById(c)??this.select("activeTriggerElement")??void 0),(h=(f=this.context).onOpenChange)==null||h.call(f,n,i),i.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,i);const u=()=>{const m={open:n,openChangeReason:i.reason};R2e(m,n,i.trigger,l()),this.update(m)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Yet,()=>{this.set("stickIfOpen",!1)}),si.flushSync(u)):u();let d;s?d="click":a?d="dismiss":i.reason===KS&&(d="focus"),this.set("instantType",d)})}}function CDt(e,t,n,i=!1){const r={...$2e(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return r.open&&(e==null?void 0:e.mounted)===void 0&&(r.mounted=!0),r.floatingRootContext=F2e(t,n,i),r}function TDt(e){return{popupRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:p.createRef(),beforeContentFocusGuardRef:p.createRef(),stickIfOpenTimeout:new fu,triggerElements:e}}function one({props:e}){const{children:t,open:n,defaultOpen:i=!1,onOpenChange:r,onOpenChangeComplete:s,modal:a=!1,handle:l,triggerId:c,defaultTriggerId:u=null}=e,d=_Dt(l,{modal:a,open:i,openProp:n,activeTriggerId:u,triggerIdProp:c});d.useControlledProp("openProp",n),d.useControlledProp("triggerIdProp",c);const f=d.useState("open"),h=d.useState("mounted"),m=d.useState("payload");d.useContextCallback("onOpenChange",r),d.useContextCallback("onOpenChangeComplete",s),L2e(d,f),P2e(d);const{forceUnmount:g}=D2e(f,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});d.useSyncedValues({modal:a}),p.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]),p.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:()=>d.setOpen(!1,Zs(t2e))}),[g,d]);const b=f||h;return o.jsxs(BMe.Provider,{value:d,children:[l&&o.jsx(N2e,{handle:l,store:d}),b&&o.jsx(jDt,{store:d,modal:a}),typeof t=="function"?t({payload:m}):t]})}function ADt(e){return c0(!0)?o.jsx(one,{props:e}):o.jsx(jtt,{children:o.jsx(one,{props:e})})}function _Dt(e,t){const n=j2e((i,r)=>new EDt(t,i,r));return p.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function jDt({store:e,modal:t}){const n=e.useState("floatingRootContext"),i=h2e(n,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),r=i.reference,s=i.floating;return M2e(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:s}),null}const NDt=300;function pp(e){return _C(e,"base-ui")}function RDt(e,t){const n=p.useRef(null);function i(s){si.flushSync(()=>{e.setOpen(!1,Zs(KS,s.nativeEvent,s.currentTarget))});const a=Tet(n.current);a==null||a.focus()}function r(s){var l;const a=e.select("positionerElement");if(a&&sx(s,a))(l=e.context.beforeContentFocusGuardRef.current)==null||l.focus();else{si.flushSync(()=>{e.setOpen(!1,Zs(KS,s.nativeEvent,s.currentTarget))});let c=Cet(e.context.triggerFocusTargetRef.current||t.current);for(;c!==null&&Qn(a,c);){const u=c;if(c=eQ(c),c===u)break}c==null||c.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:i,handleFocusTargetFocus:r}}function IDt(e){const t=p.useRef(""),n=p.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:p.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r?e(r,r.pointerType):e(r,t.current),t.current=""},[e]),onPointerDown:n}}function UMe(e,t){const n=Hn((s,a)=>{(typeof e=="function"?e():e)||t(a||(oP?"touch":""))}),{onClick:i,onPointerDown:r}=IDt(n);return p.useMemo(()=>({onClick:i,onPointerDown:r}),[i,r])}const PDt=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:a=!1,nativeButton:l=!0,handle:c,payload:u,openOnHover:d=!1,delay:f=NDt,closeDelay:h=0,id:m,...g}=t,b=c0(!0),y=Q2e(c)??b;if(!y)throw new Error(mc(74));const w=pp(m),x=y.useState("isTriggerActive",w),O=y.useState("floatingRootContext"),S=y.useState("isOpenedByTrigger",w),k=y.useState("triggerPopupId",w),C=p.useRef(null),{registerTrigger:E,isMountedByThisTrigger:R}=I2e(w,C,y,{payload:u,disabled:a,openOnHover:d,closeDelay:h}),A=y.useState("openChangeReason"),j=y.useState("stickIfOpen"),T=y.useState("openMethod"),N=y.useState("focusManagerModal"),_=jnt(O,{enabled:!a&&d&&(T!=="touch"||A!==Jx),mouseOnly:!0,move:!1,handleClose:Int(),restMs:f,delay:{close:h},triggerElementRef:C,isActiveTrigger:x,isClosing:()=>y.select("transitionStatus")==="ending"}),D=f2e(O,{stickIfOpen:j}),M=UMe(()=>y.select("open"),ne=>{y.set("openMethod",ne)}),P=y.useState("triggerProps",R),{getButtonProps:L,buttonRef:B}=uP({disabled:a,native:l}),I={open(ne){return ne&&A===Jx?Wnt.open(ne):q2e.open(ne)}},{preFocusGuardRef:z,handlePreFocusGuardFocus:K,handleFocusTargetFocus:F}=RDt(y,C),H=Oo("button",t,{state:{disabled:a,open:S},ref:[B,n,E,C],props:[D.reference,_,P,M,{[oQ]:"",id:w,"aria-haspopup":"dialog","aria-expanded":S,"aria-controls":k},g,L],stateAttributesMapping:I}),X=o.jsx(p.Fragment,{children:H},w);return R&&!N?o.jsxs(p.Fragment,{children:[o.jsx(yy,{ref:z,onFocus:K}),X,o.jsx(yy,{ref:y.context.triggerFocusTargetRef,onFocus:F})]}):X}),QMe=p.createContext(void 0);function DDt(){const e=p.useContext(QMe);if(e===void 0)throw new Error(mc(45));return e}const MDt=p.forwardRef(function(t,n){const{keepMounted:i=!1,...r}=t;return c0().useState("mounted")||i?o.jsx(QMe.Provider,{value:i,children:o.jsx(s2e,{ref:n,...r})}):null}),zMe=p.createContext(void 0);function LDt(){const e=p.useContext(zMe);if(!e)throw new Error(mc(46));return e}const VMe=p.forwardRef(function(t,n){const{cutout:i,...r}=t;let s;if(i){const a=i.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${a.left}px ${a.top}px,${a.left}px ${a.bottom}px,${a.right}px ${a.bottom}px,${a.right}px ${a.top}px,${a.left}px ${a.top}px)`}return o.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});let ane={},lne={},cne="";function fD(e,t){return CC(e)?e:t}function une(e,t,n){return/hidden|clip/.test(e.getComputedStyle(fD(t,n)).overflowY)}function $Dt(e){if(typeof document>"u")return!1;const t=or(e);return Vs(t).innerWidth-t.documentElement.clientWidth>0}function FDt(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=or(e),i=n.documentElement,r=n.body,s=fD(i,r),a=s.style.overflowY,l=i.style.scrollbarGutter;i.style.scrollbarGutter="stable",s.style.overflowY="scroll";const c=s.offsetWidth;s.style.overflowY="hidden";const u=s.offsetWidth;return s.style.overflowY=a,i.style.scrollbarGutter=l,c===u}function BDt(e){const t=or(e),n=t.documentElement,i=t.body,r=fD(n,i),s={overflowY:r.style.overflowY,overflowX:r.style.overflowX};return Object.assign(r.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(r.style,s)}}function UDt(e){var m;const t=or(e),n=t.documentElement,i=t.body,r=Vs(n);let s=0,a=0,l=!1;const c=Jl.create();if(Vw&&(((m=r.visualViewport)==null?void 0:m.scale)??1)!==1)return()=>{};function u(){const g=r.getComputedStyle(n),b=r.getComputedStyle(i),w=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,a=n.scrollLeft,ane={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},cne=n.style.scrollBehavior,lne={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};const x=n.scrollHeight>n.clientHeight,O=n.scrollWidth>n.clientWidth,S=g.overflowY==="scroll"||b.overflowY==="scroll",k=g.overflowX==="scroll"||b.overflowX==="scroll",C=Math.max(0,r.innerWidth-i.clientWidth),E=Math.max(0,r.innerHeight-i.clientHeight),R=parseFloat(b.marginTop)+parseFloat(b.marginBottom),A=parseFloat(b.marginLeft)+parseFloat(b.marginRight),j=fD(n,i);if(l=FDt(e),l){n.style.scrollbarGutter=w,j.style.overflowY="hidden",j.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:w,overflowY:"hidden",overflowX:"hidden"}),(x||S)&&(n.style.overflowY="scroll"),(O||k)&&(n.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:R||E?`calc(100dvh - ${R+E}px)`:"100dvh",width:A||C?`calc(100vw - ${A+C}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),i.scrollTop=s,i.scrollLeft=a,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,ane),Object.assign(i.style,lne),l||(n.scrollTop=s,n.scrollLeft=a,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=cne)}function f(){d(),c.request(u)}u();const h=vi(r,"resize",f);return()=>{c.cancel(),d(),typeof r.removeEventListener=="function"&&h()}}class QDt{constructor(){Jt(this,"lockCount",0);Jt(this,"restore",null);Jt(this,"timeoutLock",fu.create());Jt(this,"timeoutUnlock",fu.create());Jt(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Jt(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const n=or(t),i=n.documentElement,r=n.body,s=Vs(i);if(une(s,i,r)){const l=new s.MutationObserver(()=>{une(s,i,r)||(l.disconnect(),this.restore=null,this.lock(t))}),c={attributes:!0};l.observe(i,c),l.observe(r,c),this.restore=()=>l.disconnect();return}const a=oP||!$Dt(t);this.restore=a?BDt(t):UDt(t)}}const zDt=new QDt;function HMe(e=!0,t=null){Fn(()=>{if(e)return zDt.acquire(t)},[e,t])}const VDt=20;function HDt(e,t,n,i){const[r,s]=p.useState(!1);Fn(()=>{if(!e||!t||n==null){s(!1);return}const a=or(n).documentElement.clientWidth,l=n.offsetWidth;s(a>0&&l>0&&l>=a-VDt)},[e,t,n]),HMe(e&&(!t||r),i)}const qDt=p.forwardRef(function(t,n){const{render:i,className:r,style:s,anchor:a,positionMethod:l,side:c,align:u,sideOffset:d,alignOffset:f,collisionBoundary:h="clipping-ancestors",collisionPadding:m,arrowPadding:g,sticky:b,disableAnchorTracking:v=!1,collisionAvoidance:y=itt,...w}=t,x=c0(),O=DDt(),S=Att(),k=x.useState("floatingRootContext"),C=x.useState("mounted"),E=x.useState("open"),R=x.useState("openChangeReason"),A=x.useState("activeTriggerElement"),j=x.useState("modal"),T=x.useState("openMethod"),N=x.useState("positionerElement"),_=x.useState("instantType"),D=x.useState("transitionStatus"),M=x.useState("adaptiveOrigin"),P=p.useRef(null),L=sQ(N),B=Bnt({anchor:a,floatingRootContext:k,positionMethod:l,mounted:C,side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:g,collisionBoundary:h,collisionPadding:m,sticky:b,disableAnchorTracking:v,keepMounted:O,nodeId:S,collisionAvoidance:y,adaptiveOrigin:M}),I=k.useState("domReferenceElement");Fn(()=>{const H=I,X=P.current;if(H&&(P.current=H),X&&H&&H!==X){x.set("instantType",void 0);const ne=new AbortController;return L(()=>{x.set("instantType","trigger-change")},ne.signal),()=>{ne.abort()}}},[I,L,x]);const z=j===!0&&R!==Vc;HDt(E&&z,T==="touch",N,A);const K=x.useStateSetter("positionerElement"),F={open:E,side:B.side,align:B.align,anchorHidden:B.anchorHidden,instant:_},q=Knt(t,F,{styles:B.positionerStyles,transitionStatus:D,props:w,refs:[n,K],hidden:!C,inert:!E});return o.jsxs(zMe.Provider,{value:B,children:[C&&z&&o.jsx(VMe,{inert:rQ(!E),cutout:A}),o.jsx(_tt,{id:S,children:q})]})}),WDt="ArrowUp",KDt="ArrowDown",GDt="ArrowLeft",XDt="ArrowRight",YDt="Home",ZDt="End",qMe=new Set([WDt,KDt,GDt,XDt,YDt,ZDt]),JDt=p.createContext(void 0);function eMt(e){return p.useContext(JDt)}const tMt=p.createContext(void 0);function nMt(){const[e,t]=p.useState(0),n=Hn(()=>(t(r=>r+1),()=>{t(r=>Math.max(0,r-1))}));return{context:p.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const iMt=p.forwardRef(function(t,n){const{render:i,className:r,style:s,initialFocus:a,finalFocus:l,...c}=t,u=c0(),d=LDt(),f=eMt()!=null,{context:h,hasClosePart:m}=nMt(),g=u.useState("open"),b=u.useState("openMethod"),v=u.useState("instantType"),y=u.useState("transitionStatus"),w=u.useState("popupProps"),x=u.useState("titleElementId"),O=u.useState("descriptionElementId"),S=u.useState("modal"),k=u.useState("mounted"),C=u.useState("openChangeReason"),E=u.useState("activeTriggerElement"),R=u.useState("floatingRootContext"),A=R.useState("floatingId"),j=u.useState("disabled"),T=u.useState("openOnHover"),N=u.useState("closeDelay");AC({open:g,ref:u.context.popupRef,onComplete(){var B,I;g&&((I=(B=u.context).onOpenChangeComplete)==null||I.call(B,!0))}}),Ant(R,{enabled:T&&!j,closeDelay:N});const _=a===void 0?_2e(u.context.popupRef):a,D=S!==!1&&m;u.useSyncedValue("focusManagerModal",D);const M=u.useStateSetter("popupElement"),P={open:g,side:d.side,align:d.align,instant:v,transitionStatus:y},L=Oo("div",t,{state:P,ref:[n,u.context.popupRef,M],props:[w,{id:A,role:"dialog",...A2e,"aria-labelledby":x,"aria-describedby":O,onKeyDown(B){f&&qMe.has(B.key)&&B.stopPropagation()}},K2e(y),c],stateAttributesMapping:W2e});return o.jsx(d2e,{context:R,openInteractionType:b,modal:D,disabled:!k||C===Vc,initialFocus:_,returnFocus:l,restoreFocus:"popup",previousFocusableElement:Qs(E)?E:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:o.jsx(tMt.Provider,{value:h,children:L})})}),rMt=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...a}=t,l=c0(),c=pp(a.id);return l.useSyncedValueWithCleanup("titleElementId",c),Oo("h2",t,{ref:n,props:[{id:c},a]})}),sMt=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...a}=t,l=c0(),c=pp(a.id);return l.useSyncedValueWithCleanup("descriptionElementId",c),Oo("p",t,{ref:n,props:[{id:c},a]})});function dne(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 oMt(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 NV(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 aMt(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 lMt(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 cMt(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 uMt(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 dMt(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 fMt(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 fne(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 hMt(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 pMt(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 hne(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 l1(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 mMt({value:e}){const{t,i18n:n}=je("adk"),[i,r]=p.useState(!1),s=f=>f==null?t("developmentRuns.notReported"):f.toLocaleString(n.resolvedLanguage||n.language),a=mTe,l=e.usage,c=(l==null?void 0:l.inputTokens)!=null&&l.cachedInputTokens!=null&&l.cachedInputTokens<=l.inputTokens?l.inputTokens-l.cachedInputTokens:void 0,u=l!=null&&l.inputTokens&&l.cachedInputTokens!=null&&c!=null?`${(l.cachedInputTokens/l.inputTokens*100).toFixed(1)}%`:void 0,d=[["inputTokens",l==null?void 0:l.inputTokens],["cachedInputTokens",l==null?void 0:l.cachedInputTokens],["uncachedInputTokens",c],["cacheWriteInputTokens",l==null?void 0:l.cacheWriteInputTokens],["outputTokens",l==null?void 0:l.outputTokens],["reasoningOutputTokens",l==null?void 0:l.reasoningOutputTokens]];return o.jsxs("div",{className:"development-turn-summary","data-turn-id":e.turnId,children:[o.jsx("span",{children:t(`developmentRuns.turnStatus.${e.status}`)}),o.jsx("span",{children:t("developmentRuns.toolCalls",{count:e.toolCalls})}),o.jsx("span",{children:t("developmentRuns.turnDuration",{duration:a(e.durationMs)})}),o.jsx("span",{title:t("developmentRuns.toolDurationHelp"),children:t(e.toolDurationComplete?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:a(e.toolDurationMs)})}),o.jsxs(ADt,{open:i,onOpenChange:r,children:[o.jsxs(PDt,{className:"development-token-trigger",openOnHover:!0,delay:150,closeDelay:150,onFocus:f=>{f.currentTarget.matches(":focus-visible")&&r(!0)},children:[o.jsx("span",{children:"Tokens"}),o.jsx("span",{className:"development-token-value",children:s(l==null?void 0:l.totalTokens)}),e.usageIncomplete&&o.jsxs("span",{children:["· ",t("developmentRuns.partial")]}),o.jsx(l1,{className:"development-token-chevron"})]}),o.jsx(MDt,{children:o.jsx(qDt,{side:"top",align:"end",sideOffset:8,className:"development-token-positioner",children:o.jsxs(iMt,{className:"development-token-popup",initialFocus:!1,finalFocus:!1,children:[o.jsx(rMt,{className:"development-token-title",children:t("developmentRuns.tokenDetails")}),o.jsxs("dl",{children:[o.jsxs("div",{children:[o.jsx("dt",{children:t("developmentRuns.model")}),o.jsx("dd",{children:e.model||t("developmentRuns.notReported")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:t("developmentRuns.totalTokens")}),o.jsx("dd",{children:s(l==null?void 0:l.totalTokens)})]}),d.map(([f,h])=>o.jsxs("div",{children:[o.jsx("dt",{children:t(`developmentRuns.${f}`)}),o.jsx("dd",{children:s(h)})]},f)),o.jsxs("div",{children:[o.jsx("dt",{children:t("developmentRuns.cacheHitRate")}),o.jsx("dd",{children:u||t("developmentRuns.notReported")})]})]}),o.jsxs(sMt,{className:"development-token-note",children:[t("developmentRuns.tokenHelp"),e.usageIncomplete?` ${t("developmentRuns.partialHelp")}`:""]})]})})})]})]})}function RV(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 hD({kind:e,...t}){return e==="thinking"?o.jsx(RV,{...t}):o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:e==="tool"?o.jsxs(o.Fragment,{children:[o.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"3"}),o.jsx("path",{d:"m7 9 3 3-3 3m6 0h4"})]}):e==="plan"?o.jsxs(o.Fragment,{children:[o.jsx("path",{d:"m4 7 1.5 1.5L8 6m-4 7 1.5 1.5L8 12M11 7h9m-9 6h9m-9 6h9"}),o.jsx("circle",{cx:"6",cy:"19",r:"1"})]}):o.jsx(o.Fragment,{children:o.jsx("path",{d:"M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9zM14 3v6h6M8 13h8m-4-3v6M8 18h8"})})})}function gMt({blocks:e,active:t,status:n,render:i}){const{t:r}=je("adk"),[s,a]=p.useState(!1),l=[...e].reverse().find(h=>"done"in h&&!h.done),c=e.filter(h=>h.kind==="tool"),u=c.filter(h=>h.durationMs!=null),d=u.reduce((h,m)=>h+(m.durationMs||0),0);let f=r("developmentRuns.processSummary",{count:e.length});return t&&(f=n||((l==null?void 0:l.kind)==="thinking"?r("developmentRuns.thinking"):(l==null?void 0:l.kind)==="tool"?gTe(l):(l==null?void 0:l.kind)==="plan"?r("developmentRuns.plan"):(l==null?void 0:l.kind)==="diff"?r("developmentRuns.diff"):r("developmentRuns.processing"))),o.jsxs("section",{className:"development-process",children:[o.jsxs("button",{type:"button",className:"development-process__toggle","aria-expanded":s,onClick:()=>a(!s),children:[o.jsx(l1,{className:`tool-chevron${s?" is-open":""}`}),o.jsx("span",{className:"tool-icon",children:o.jsx(hD,{kind:(l==null?void 0:l.kind)==="thinking"||(l==null?void 0:l.kind)==="plan"||(l==null?void 0:l.kind)==="diff"?l.kind:"tool"})}),t?o.jsx(mn,{className:"development-process__title","aria-live":"polite",children:f}):o.jsx("span",{className:"development-process__title",children:f}),!t&&c.length>0&&o.jsxs("span",{className:"development-process__duration",children:[r("developmentRuns.toolCalls",{count:c.length}),u.length>0?` · ${r(u.length===c.length?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:mTe(d)})}`:""]})]}),o.jsx("div",{className:"development-process__items",hidden:!s,children:i(e)})]})}function bMt({blocks:e,active:t,status:n="",render:i}){const{t:r}=je("adk"),s=yJe(e),a=s[s.length-1],l=[...e].reverse().find(u=>u.kind==="progress"),c=n||((l==null?void 0:l.kind)==="progress"?l.text:"");return o.jsxs(o.Fragment,{children:[s.map(u=>u.process?o.jsx(gMt,{blocks:u.blocks,active:t&&u===a,status:c,render:i},u.id):o.jsx("div",{"data-assistant-phase":u.blocks[0].phase,children:i(u.blocks)},u.id)),t&&!(a!=null&&a.process)&&o.jsxs("div",{className:"development-process__status",role:"status",children:[o.jsx("span",{className:"tool-icon",children:o.jsx(hD,{kind:"thinking"})}),o.jsx(mn,{children:c||r("developmentRuns.processing")})]})]})}const yMt={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 vMt(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 xMt(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function wMt(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function IV(e,t){if(xMt(e))return vMt(t,e.path);if(wMt(e)){const n=yMt[e.call],i={};for(const[r,s]of Object.entries(e.args??{}))i[r]=IV(s,t);return n?n(i):`[unknown fn: ${e.call}]`}return e}function OMt(e,t){const n=IV(e,t);return n==null?"":typeof n=="string"?n:String(n)}const WMe=new Map;function u0(e,t){WMe.set(e,t)}function kMt(e){return WMe.get(e)}function SMt(e,t,n){const i=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(let s=0;sIV(i,e.dataModel),resolveString:i=>OMt(i,e.dataModel),dispatchAction:t,render:i=>{if(!i)return null;const r=e.components[i];if(!r)return null;const s=kMt(r.component)??EMt;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 GMe(e){const t=p.useRef(null),n=p.useRef(!0),i=28,r=p.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 pD({value:e,skillPrefix:t="/",onRemoveSkill:n,onRemoveAgent:i}){const{t:r}=je("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(ZS,{"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(Oa,{})}):null]},s.name)),e.targetAgent?o.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[o.jsx(aAe,{"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(Oa,{})}):null]}):null]})}function PV(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function XMe(e){var n,i,r,s;const t=PV(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 YMe(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function ZMe(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?XEe(t,e.uri):""}function TMt({kind:e}){return e==="image"?o.jsx(yQ,{}):e==="video"?o.jsx(cAe,{}):e==="pdf"?o.jsx(Xit,{}):o.jsx(gQ,{})}function mD({appName:e,items:t,compact:n=!1,onRemove:i}){const{t:r}=je("conversation"),[s,a]=p.useState(null);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(l=>{const c=PV(l.mimeType),u=ZMe(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(lrt,{})})]}):o.jsx("span",{className:"media-card-icon",children:o.jsx(TMt,{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:XMe(l)}),l.status==="uploading"?o.jsxs(o.Fragment,{children:[o.jsx(Mi,{className:"media-card-spinner"})," ",r("media.uploading")]}):l.status==="error"?l.error??r("media.uploadFailed"):YMe(l.sizeBytes)]})]}),!n&&l.status!=="uploading"&&l.status!=="error"?o.jsx(ax,{className:"media-card-open"}):null]});return o.jsxs(cr.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(wEe,{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(Oa,{})}):null]},l.id)})}),o.jsx(Ad,{children:s?o.jsx(AMt,{appName:e,item:s,onClose:()=>a(null)}):null})]})}function AMt({appName:e,item:t,onClose:n}){const{t:i}=je("conversation"),r=p.useMemo(()=>ZMe(t,e),[e,t]),s=PV(t.mimeType),[a,l]=p.useState(""),[c,u]=p.useState(s==="text"||s==="markdown"),[d,f]=p.useState("");return p.useEffect(()=>{const h=m=>{m.key==="Escape"&&n()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[n]),p.useEffect(()=>{if(s!=="text"&&s!=="markdown")return;const h=new AbortController;return u(!0),f(""),fetch(r,{signal:h.signal}).then(m=>{if(!m.ok)throw new Error(`HTTP ${m.status}`);return m.text()}).then(l).catch(m=>{h.signal.aborted||f(m instanceof Error?m.message:String(m))}).finally(()=>{h.signal.aborted||u(!1)}),()=>h.abort()},[s,r]),o.jsx(cr.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(cr.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:[XMe(t),t.sizeBytes?` · ${YMe(t.sizeBytes)}`:""]})]}),o.jsxs("nav",{children:[o.jsx("a",{href:r,download:t.name,"aria-label":i("media.download"),children:o.jsx(gP,{})}),o.jsx("button",{type:"button",onClick:n,"aria-label":i("media.close"),children:o.jsx(Oa,{})})]})]}),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(Mi,{})," ",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(Ju,{text:a})}):null,!c&&s==="text"?o.jsx("pre",{className:"media-document media-document--plain",children:a}):null]})]})})}function _Mt({definition:e,label:t,done:n,open:i,onToggle:r}){const{t:s}=je("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(mn,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:c}),o.jsx(l1,{className:`builtin-tool-chevron${i?" is-open":""}`})]})}function ou(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Nn(e){return typeof e=="string"?e:""}function pne(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function Du(e){return Array.isArray(e)?e:[]}function F8(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=ou(t)??{};return ou(n.result)??n}function gD(e){if(typeof e=="string")try{return gD(JSON.parse(e))}catch{return e}const t=ou(e);if(!t)return"";const n=ou(t.result);return Nn(t.error)||Nn(t.message)||Nn(n==null?void 0:n.error)||Nn(n==null?void 0:n.message)}function jMt(e){if(e.kind==="tool")return"tool";if(e.kind==="knowledge_base")return"knowledge_base";const t=ou(e.metadata),n=Nn(t==null?void 0:t.source_type).toLowerCase(),i=Nn(e.source).toLowerCase();return n==="skillhub"||i.startsWith("skill_hub:")?"skill_hub":"skill_space"}const JMe={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function NMt(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 RMt(e){return e==="veadk_builtin_tools"?"tool":e==="agentkit_knowledge"?"knowledge_base":e.startsWith("skill_hub:")?"skill_hub":"skill_space"}function IMt(e,t=JMe){const n=F8(e),i=ou(n.capabilities)??{},r=Du(n.resources).flatMap(a=>{const l=ou(a);if(!l)return[];const c=l.kind==="tool"?"tool":l.kind==="knowledge_base"?"knowledge_base":"skill";return[{ref:Nn(l.ref),kind:c,category:jMt(l),name:Nn(l.name)||Nn(l.ref)||t.unnamedResource,description:Nn(l.description),source:Nn(l.source),version:Nn(l.version)}]}),s=Du(n.sources).flatMap(a=>{const l=ou(a);if(!l)return[];const c=Nn(l.source),u=Nn(l.status),d=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:c,category:RMt(c),label:NMt(c,t),status:d,count:pne(l.count),message:Nn(l.message),searchKeywords:Du(l.search_keywords).map(Nn).filter(Boolean)}]});return{collectionId:Nn(n.collection_id),capabilities:{googleAdkVersion:Nn(i.google_adk_version),agentTypes:Du(i.agent_types).map(Nn).filter(Boolean),maxOrchestrationDepth:pne(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 PMt(e,t){return{resources:e.resources.filter(n=>n.category===t),sources:e.sources.filter(n=>n.category===t)}}function e5e(e,t,n=JMe){const i=F8(e),r=F8(t),s=new Map(Du(r.results).flatMap(d=>{const f=ou(d),h=Nn(f==null?void 0:f.name);return f&&h?[[h,f]]:[]})),a=Du(i.agents).flatMap(d=>{const f=ou(d),h=Nn(f==null?void 0:f.name);return f&&h?[f]:[]}),l=new Set(a.map(d=>Nn(d.name))),c=[...s.entries()].filter(([d])=>!l.has(d)).map(([d])=>({name:d})),u=[...a,...c].map(d=>{const f=Nn(d.name),h=Du(d.nodes).flatMap(C=>{const E=ou(C);return E?[E]:[]}),m=Nn(d.root_node),g=h.find(C=>Nn(C.id)===m),b=h.filter(C=>Nn(C.id)!==m).map(C=>({id:Nn(C.id)||n.unnamedAgent,type:Nn(C.type)||"llm",description:Nn(C.description)})),v=s.get(f),y=Nn(v==null?void 0:v.status),w=y==="failed"?"failed":y==="completed"?"completed":"running",x=mne(v==null?void 0:v.resources),O=x.length>0?x:mne(h.flatMap(C=>Du(C.resources))),S=gne(v==null?void 0:v.python_tools),k=S.length>0?S:gne(h.flatMap(C=>Du(C.python_tools)));return{name:f,description:Nn(v==null?void 0:v.description)||Nn(g==null?void 0:g.description)||Nn(d.task),task:Nn(d.task),rootType:Nn(v==null?void 0:v.root_type)||Nn(g==null?void 0:g.type)||"llm",nodeCount:h.length,subAgentCount:b.length,resourceCount:O.length,pythonToolCount:k.length,skills:O.filter(C=>C.kind==="skill"),knowledgeBases:O.filter(C=>C.kind==="knowledge_base"),builtinTools:O.filter(C=>C.kind==="tool"),pythonTools:k,subAgents:b,status:w,output:Nn(v==null?void 0:v.output),error:Nn(v==null?void 0:v.error)}});return{collectionId:Nn(r.collection_id)||Nn(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 DMt(e,t){return!!gD(t)||e5e(e,t).failedCount>0}function mne(e){const t=new Set;return Du(e).flatMap(n=>{const i=ou(n),r=Nn(i?i.ref:n);if(!r||t.has(r))return[];t.add(r);const s=Nn(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:Nn(i==null?void 0:i.name)||l[l.length-1]||r,description:Nn(i==null?void 0:i.description),version:Nn(i==null?void 0:i.version),source:Nn(i==null?void 0:i.source)}]})}function gne(e){const t=new Set;return Du(e).flatMap(n=>{const i=ou(n),r=Nn(i==null?void 0:i.name),s=Nn(i==null?void 0:i.code),a=`${r}\0${s}`;return!i||!r||t.has(a)?[]:(t.add(a),[{name:r,description:Nn(i.description),code:s,entrypoint:Nn(i.entrypoint)||r,dependencies:Du(i.dependencies).map(Nn).filter(Boolean)}])})}function MMt({branch:e}){return o.jsxs("div",{className:`branch-compare__body${e.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[e.content?o.jsx(Ju,{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 LMt({args:e,response:t,status:n,onBranchSelect:i}){const{t:r}=je("conversation"),s=p.useMemo(()=>mAe(e,t,n),[e,t,n]),[a,l]=p.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(Lo,{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(Lo,{color:"info",size:"sm",variant:"soft",children:c.label})}),o.jsx(MMt,{branch:c}),o.jsx("footer",{className:"branch-compare__footer",children:o.jsx(It,{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 t5e({controlled:e,default:t,name:n,state:i="value"}){const{current:r}=p.useRef(e!==void 0),[s,a]=p.useState(t),l=r?e:s,c=p.useCallback(u=>{r||a(u)},[]);return[l,c]}const n5e=p.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function $Mt(){return p.useContext(n5e)}function FMt(e){const{children:t,elementsRef:n,labelsRef:i,onMapChange:r}=e,s=Hn(r),[,a]=p.useState(!1),l=Xu(UMt).current,c=Xu(BMt).current,u=p.useRef(0),d=p.useRef(!0),f=p.useRef([]),h=p.useRef(null),m=Hn(()=>{d.current||(d.current=!0,a(S=>!S))}),g=Hn((S,k)=>{c.set(S,k),m()}),b=Hn(S=>{c.delete(S),m()}),v=Hn(S=>{const k=new Map;return n.current.length=0,i&&(i.current.length=0),S.forEach(C=>{var E,R;k.set(C.element,{...C.registration.metadata??{},index:C.index}),n.current[C.index]=C.element,i&&(i.current[C.index]=C.registration.label!==void 0?C.registration.label:((R=(E=C.registration.textRef)==null?void 0:E.current)==null?void 0:R.textContent)??C.element.textContent)}),u.current=n.current.length,k});function y(S){var E;if((E=h.current)==null||E.disconnect(),h.current=null,typeof MutationObserver!="function"||S.length<2)return;const k=new MutationObserver(R=>{if(!VMt(R))return;let A=null;for(const j of S)if(j.isConnected){if(A&&i5e(A,j)>0){k.disconnect(),m();return}A=j}});h.current=k;const C=new Set;for(let R=1;Rk.observe(R,{childList:!0}))}const w=Hn(()=>{const[S,k]=QMt(c),C=v(S);y(k),f.current=S,d.current=!1,l.forEach(E=>E(C)),s(C)});Fn(()=>(d.current||v(f.current),()=>{n.current=[],i&&(i.current=[])}),[n,i,v]),Fn(()=>{d.current&&w()}),Fn(()=>()=>{var S;(S=h.current)==null||S.disconnect(),d.current=!0},[]);const x=Hn(S=>(l.add(S),()=>{l.delete(S)})),O=p.useMemo(()=>({register:g,unregister:b,subscribeMapChange:x,nextIndexRef:u}),[g,b,x,u]);return o.jsx(n5e.Provider,{value:O,children:t})}function BMt(){return new Map}function UMt(){return new Set}function QMt(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)=>i5e(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 zMt(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function VMt(e){for(const t of e)for(let n=0;nnull},o5e=p.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:m,style:g,...b}=t,v=p.useMemo(()=>{if(h===void 0)return m??[]},[h,m]),y=p.useRef([]),[w,x]=t5e({controlled:h,default:v,name:"Accordion",state:"value"}),O=Hn((E,R,A)=>{if(d)if(R){const j=w.slice();if(j.push(E),u==null||u(j,A),A.isCanceled)return;x(j)}else{const j=w.filter(T=>T!==E);if(u==null||u(j,A),A.isCanceled)return;x(j)}else{const j=w[0]===E?[]:[E];if(u==null||u(j,A),A.isCanceled)return;x(j)}}),S=p.useMemo(()=>({value:w,disabled:s,orientation:f}),[w,s,f]),k=p.useMemo(()=>({disabled:s,handleValueChange:O,hiddenUntilFound:a??!1,keepMounted:l??!1,state:S,value:w}),[s,O,a,l,S,w]),C=Oo("div",t,{state:S,ref:n,props:b,stateAttributesMapping:HMt});return o.jsx(r5e.Provider,{value:k,children:o.jsx(FMt,{elementsRef:y,children:C})})});function qMt(e){const{open:t,defaultOpen:n,onOpenChange:i,disabled:r}=e,[s,a]=t5e({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:c,transitionStatus:u}=T2e(s,!0,!0),d=pp(),[f,h]=p.useState(),m=f===null?void 0:f??d,g=Hn(b=>{const v=!s,y=Zs(Jx,b.nativeEvent);i(v,y),!y.isCanceled&&a(v)});return p.useMemo(()=>({defaultPanelId:d,disabled:r,handleTrigger:g,mounted:l,open:s,panelId:m,setMounted:c,setOpen:a,setPanelIdState:h,transitionStatus:u}),[d,r,g,l,s,m,c,a,h,u])}const a5e=p.createContext(void 0);function l5e(){const e=p.useContext(a5e);if(e===void 0)throw new Error(mc(15));return e}function WMt(e={}){const{guess:t,label:n,metadata:i,textRef:r,index:s}=e,{register:a,unregister:l,subscribeMapChange:c,nextIndexRef:u}=$Mt(),d=p.useRef(-1),[f,h]=p.useState(s==null&&t?()=>{if(d.current===-1){const v=u.current;u.current+=1,d.current=v}return d.current}:-1),m=s??f,g=p.useRef(null),b=p.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 Fn(()=>{if(s==null)return c(v=>{var w;const y=g.current?(w=v.get(g.current))==null?void 0:w.index:null;y!=null&&h(y)})},[s,c]),{ref:b,index:m}}const c5e=p.createContext(void 0);function DV(){const e=p.useContext(c5e);if(e===void 0)throw new Error(mc(9));return e}let MV=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=_N.startingStyle]="startingStyle",e[e.endingStyle=_N.endingStyle]="endingStyle",e}({}),KMt=function(e){return e.panelOpen="data-panel-open",e}({});const GMt={[MV.open]:""},XMt={[MV.closed]:""},YMt={open(e){return e?{[KMt.panelOpen]:""}:null}},ZMt={open(e){return e?GMt:XMt}};let JMt=function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e}({});const LV={...ZMt,index:e=>({[JMt.index]:String(e)}),...cP,value:()=>null},u5e=p.forwardRef(function(t,n){const{className:i,disabled:r=!1,onOpenChange:s,render:a,value:l,style:c,...u}=t,{ref:d,index:f}=WMt(),h=Zx(n,d),{disabled:m,handleValueChange:g,state:b,value:v}=s5e(),y=pp(),w=l??y,x=r||m,O=v.indexOf(w)!==-1,S=Hn((M,P)=>{s==null||s(M,P),!P.isCanceled&&g(w,M,P)}),k=qMt({open:O,onOpenChange:S,disabled:x}),C=p.useMemo(()=>({open:k.open,disabled:k.disabled,transitionStatus:k.transitionStatus}),[k.open,k.disabled,k.transitionStatus]),E=p.useMemo(()=>({...k,onOpenChange:S,state:C}),[k,C,S]),R=p.useMemo(()=>({...b,hidden:!O&&!k.mounted,index:f,disabled:x,open:O}),[k.mounted,x,f,O,b]),A=pp(),[j,T]=p.useState(),N=j===null?void 0:j??A,_=p.useMemo(()=>({defaultTriggerId:A,open:O,state:R,setTriggerId:T,triggerId:N}),[A,O,R,T,N]),D=Oo("div",t,{state:R,ref:h,props:u,stateAttributesMapping:LV});return o.jsx(a5e.Provider,{value:E,children:o.jsx(c5e.Provider,{value:_,children:D})})}),d5e=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...a}=t,{state:l}=DV();return Oo("h3",t,{state:l,ref:n,props:a,stateAttributesMapping:LV})}),f5e=p.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:m}=l5e(),g=i||m,{getButtonProps:b,buttonRef:v}=uP({disabled:g,focusableWhenDisabled:!0,native:l}),{defaultTriggerId:y,state:w,setTriggerId:x}=DV(),O=s||void 0,S=O??y;return Fn(()=>(x(E=>O??(E===null?void 0:E)),()=>{x(E=>E===O?null:E)}),[O,x]),Oo("button",t,{state:w,ref:[n,v],props:[{"aria-controls":f?d:void 0,"aria-expanded":f,id:S,onClick:h},u,b],stateAttributesMapping:YMt})}),xO={height:void 0,width:void 0};function e5t(e){const{externalRef:t,hiddenUntilFound:n,id:i,keepMounted:r,mounted:s,onOpenChange:a,open:l,setMounted:c,setOpen:u,transitionStatus:d}=e,f=p.useRef(null),h=p.useRef(null),[m,g]=p.useState(xO),b=p.useRef(xO),v=p.useRef(!1),y=p.useRef(l),w=p.useRef(!1),[x,O]=p.useState(!1),S=p.useRef(null),k=Zx(t,f),C=El(l),E=sQ(f),R=!l&&!s,A=x?"idle":d,j=l&&(y.current||w.current),T=!l&&s&&h.current==="css-animation"&&m.height===void 0&&m.width===void 0?b.current:m,N=n&&R&&h.current!=="css-animation",_=Hn((B,I=!0)=>{I&&(b.current=B),g(B)}),D=Hn(()=>{var B;(B=S.current)==null||B.call(S),S.current=null}),M=Hn(B=>{D(),S.current=()=>{S.current=null,B()}}),P=Hn(()=>{l&&s&&h.current==="css-animation"&&(w.current=!0)});Fn(()=>{!x||d==="starting"||O(!1)},[x,d]),p.useEffect(()=>()=>{P(),D()},[P,D]),Fn(()=>{const B=f.current;if(!B)return;!l&&S.current&&D();const I=t5t(B,j);if(h.current=I,l&&d==="idle"&&y.current&&I==="css-animation"){b.current=q0(B);return}if(l&&d==="starting"){const F=v.current;if(v.current=!1,I==="none"){_(q0(B)),O(!0);return}if(I==="css-transition"){const X=n5t(B);if(_(q0(B)),!F)return X;const ne=bA(B,"transition-duration","0s");return M(ne),O(!0),X}_(q0(B));const q=bA(B,"animation-name","none");if(!F){q();return}const H=bA(B,"animation-duration","0s");q(),M(H),O(!0);return}if(!l&&s&&(d==="idle"||d==="starting")){if(y.current=!1,w.current=!1,I==="none"){_(xO,!1),c(!1);return}_(q0(B));return}if(d!=="ending")return;if(I==="none"){c(!1);return}const z=q0(B);if(!(z.height>0||z.width>0)){c(!1);return}_(z),I==="css-animation"&&bA(B,"animation-name","none")()},[s,l,D,_,c,M,j,d]),AC({enabled:l&&s&&A==="idle",open:!0,ref:f,onComplete(){l&&_(xO,!1)}}),p.useEffect(()=>{if(l||!s||A!=="ending"||!f.current)return;const I=new AbortController;let z=-1;function K(){C.current||(c(!1),_(xO,!1))}return z=Jl.request(()=>{E(K,I.signal)}),()=>{Jl.cancel(z),I.abort()}},[C,s,l,A,E,_,c]),Fn(()=>{const B=f.current;!B||!n||!R||B.setAttribute("hidden","until-found")},[R,n]),p.useEffect(function(){const I=f.current;if(!I)return;function z(K){const F=Zs(YTe,K);a(!0,F),!F.isCanceled&&(v.current=!0,u(!0))}return vi(I,"beforematch",z)},[a,u]);const L=r||n||s||l;return{height:T.height,props:{...N?{[MV.startingStyle]:""}:void 0,hidden:R,id:i},ref:k,shouldPreventOpenAnimation:j,shouldRender:L,transitionStatus:A,width:T.width}}function q0(e){return{height:e.scrollHeight,width:e.scrollWidth}}function t5t(e,t){const n=Vs(e).getComputedStyle(e),i=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&bne(n.animationDuration),r=bne(n.transitionDuration);return i&&r||r?"css-transition":i?"css-animation":"none"}function bne(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function bA(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 n5t(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=Jl.request(n);return()=>{Jl.cancel(i),n()}}let yne=function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e}({});const h5e=p.forwardRef(function(t,n){const{className:i,hiddenUntilFound:r,keepMounted:s,id:a,render:l,style:c,...u}=t,{hiddenUntilFound:d,keepMounted:f}=s5e(),{defaultPanelId:h,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,setPanelIdState:w,transitionStatus:x}=l5e(),O=r??d,S=s??f,k=a||void 0,C=a??h;Fn(()=>(w(I=>k??(I===null?void 0:I)),()=>{w(I=>I===k?null:I)}),[k,w]);const{height:E,props:R,ref:A,shouldPreventOpenAnimation:j,shouldRender:T,transitionStatus:N,width:_}=e5t({externalRef:n,hiddenUntilFound:O,id:C,keepMounted:S,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,transitionStatus:x}),{state:D,triggerId:M}=DV(),P={...D,transitionStatus:N},L=UTe(c,P),B=Oo("div",{...t,style:void 0},{state:P,ref:A,props:[R,{"aria-labelledby":M,role:"region",style:{[yne.accordionPanelHeight]:E===void 0?"auto":`${E}px`,[yne.accordionPanelWidth]:_===void 0?"auto":`${_}px`}},u,L?{style:L}:void 0,j?{style:{animationName:"none"}}:void 0],stateAttributesMapping:LV});return T?B:null}),i5t=(e,t)=>{const n=e.currentTarget,i={x:e.clientX,y:e.clientY},r=r5t(i,n.getBoundingClientRect()),s=s5t(i,r),a=o5t(t.getBoundingClientRect());return l5t([...s,...a])};function r5t(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 s5t(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 o5t(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 a5t(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 l5t(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),c5t(t)}function c5t(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 u5t="_Transition_1wdpp_1",d5t="_Popover_1wdpp_3",p5e={Transition:u5t,Popover:d5t},m5e=p.createContext(null),bD=()=>{const e=p.use(m5e);if(!e)throw new Error("Popover components must be wrapped in ");return e},Wm=({open:e,onOpenChange:t,showOnHover:n=!1,hoverOpenDelay:i=150,children:r})=>{const[s,a]=p.useState(!1),[l,c]=p.useState(!1),u=p.useRef(null),d=p.useRef(null),f=p.useRef(void 0),h=p.useRef(!1),m=p.useRef(!1),g=e??s,[b,v]=p.useState(!1);wQ(()=>v(!1),b?500:null);const y=dg(t),w=dg(C=>{var E,R;clearTimeout(f.current),g!==C&&(C||(c(!1),n&&h.current&&((E=u.current)==null||E.focus()),h.current=!1),(R=y.current)==null||R.call(y,C),a(C),n&&v(C))}),x=p.useCallback(C=>{w.current(C)},[w]),O=p.useCallback(()=>{f.current=setTimeout(()=>x(!0),i)},[x,i]),S=p.useCallback(()=>{clearTimeout(f.current)},[]);p.useEffect(()=>()=>{clearTimeout(f.current)},[]);const k=p.useMemo(()=>({open:g,setOpen:x,shake:l,setShake:c,showOnHover:n,temporarilyPreventClickToClose:b,onTriggerEnter:O,onTriggerLeave:S,isPointerInTransitRef:m,triggerRef:u,contentRef:d,hoverOpenFocusedWithTab:h}),[g,x,l,c,n,b,h,m,O,S]);return o.jsx(m5e,{value:k,children:o.jsx(nje,{open:g,onOpenChange:x,modal:!1,children:r})})},f5t=({children:e,onPointerDown:t,onClick:n})=>{const{setOpen:i,showOnHover:r,temporarilyPreventClickToClose:s,onTriggerEnter:a,onTriggerLeave:l,isPointerInTransitRef:c,triggerRef:u,contentRef:d}=bD(),f=p.useRef(!1),h=b=>{!(b.currentTarget.nodeName.toLocaleLowerCase()==="a")&&s&&(b.preventDefault(),b.stopPropagation())},m=b=>{b.pointerType!=="touch"&&!f.current&&!c.current&&(a(),f.current=!0)},g=()=>{f.current&&(l(),f.current=!1)};return o.jsx(ije,{asChild:!0,ref:u,onPointerDown:b=>{h(b),t==null||t(b)},onClick:b=>{h(b),n==null||n(b)},onPointerMove:r?m: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})},g5e=({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:m,contentRef:g}=bD(),b=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const w=AAe(y),x=w[w.length-1];x==null||x.focus()}};return p.useEffect(()=>{const v=g.current;!v||!f||v!=null&&v.contains(document.activeElement)||h||v.focus({preventScroll:!0})},[g,h,f]),o.jsx(sje,{forceMount:!0,ref:g,className:Ti(p5e.Popover,d),style:Ky({"popover-width":n,"popover-min-width":i,"popover-max-width":r}),onCloseAutoFocus:h?Kh:void 0,"data-animate":m?"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:Kh,onEscapeKeyDown:Kh,onKeyDown:b,children:e})},h5t=e=>{const{setOpen:t,triggerRef:n,contentRef:i,isPointerInTransitRef:r,hoverOpenFocusedWithTab:s}=bD(),[a,l]=p.useState(null),c=p.useCallback(()=>{l(null),r.current=!1},[r]),u=p.useCallback((d,f)=>{const h=i5t(d,f);l(h),r.current=!0},[r]);return p.useEffect(()=>()=>c(),[c]),p.useEffect(()=>{const d=n.current,f=i.current;if(!d||!f)return;const h=g=>u(g,f),m=g=>u(g,d);return d.addEventListener("pointerleave",h),f.addEventListener("pointerleave",m),()=>{d.removeEventListener("pointerleave",h),f.removeEventListener("pointerleave",m)}},[i,n,u,c]),p.useEffect(()=>{if(!a)return;const d=f=>{const h=n.current,m=i.current,g=f.target,b={x:f.clientX,y:f.clientY},v=(h==null?void 0:h.contains(g))||(m==null?void 0:m.contains(g)),y=!a5t(b,a),w=g.hasAttribute("aria-haspopup");v?c():(y||w)&&(c(),t(!1))};return document.addEventListener("pointermove",d),()=>document.removeEventListener("pointermove",d)},[a,t,c,n,i]),p.useEffect(()=>{const d=f=>{if(i.current&&f.key==="Tab"&&!f.shiftKey){const[h]=AAe(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(g5e,{...e})},p5t=e=>{const{open:t,showOnHover:n,setOpen:i}=bD();return LC(t,()=>{i(!1)}),o.jsx(rje,{forceMount:!0,children:o.jsx(Yw,{enterDuration:600,exitDuration:300,className:p5e.Transition,disableAnimations:!0,children:t&&(n?o.jsx(h5t,{...e},"popover-hover"):o.jsx(g5e,{...e},"popover"))})})};Wm.Trigger=f5t;Wm.Content=p5t;const m5t=["skill_hub","skill_space","knowledge_base","tool"];function b5e(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 y5e({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 g5t(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 h3({label:e,resources:t}){const{t:n}=je("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(Lo,{color:"secondary",size:"sm",variant:"soft",children:g5t(i,n)})]}),i.description?o.jsx("p",{children:i.description}):null]},i.ref))})]})}function b5t({tools:e}){const{t}=je("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(o5e,{children:e.map((n,i)=>o.jsxs(u5e,{className:"create-agent-card__python-tool",value:`${n.name}:${i}`,children:[o.jsx(d5e,{className:"create-agent-card__python-tool-header",children:o.jsxs(f5e,{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(Lo,{color:"secondary",size:"sm",variant:"soft",children:t("blocks.createAgents.selfAuthoredTools")}),o.jsx(b5e,{className:"create-agent-card__python-tool-chevron"})]})]})}),o.jsxs(h5e,{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 y5t({agents:e}){const{t}=je("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(Lo,{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 yA({label:e,count:t,icon:n,children:i}){const{t:r}=je("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(Wm,{showOnHover:!0,hoverOpenDelay:120,children:[o.jsx(Wm.Trigger,{children:s}),o.jsx(Wm.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:i})]})}function v5t({response:e,status:t}){const{t:n}=je("conversation"),i=p.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=p.useMemo(()=>IMt(e,i),[i,e]),s=p.useMemo(()=>m5t.map(c=>{const u=PMt(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?gD(e):"";return o.jsx("section",{className:"create-agent-tool-card","aria-label":n("blocks.createAgents.collectionAria"),children:t==="running"?o.jsx(y5e,{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(o5e,{className:"create-agent-card__accordion",children:s.map(c=>o.jsxs(u5e,{className:"create-agent-card__accordion-item",value:c.value,children:[o.jsx(d5e,{className:"create-agent-card__accordion-header",children:o.jsxs(f5e,{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(Lo,{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(b5e,{className:"create-agent-card__accordion-chevron"})]})]})}),o.jsx(h5e,{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(Lo,{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 x5t({args:e,response:t,status:n}){const{t:i}=je("conversation"),r=p.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=p.useMemo(()=>e5e(e,t,r),[e,r,t]),a=n==="failed"?gD(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(Uz,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[o.jsx(Qz,{leading:o.jsx(uw,{seed:l.name}),title:l.name,titleText:l.name,status:o.jsx(Lo,{color:"secondary",size:"sm",variant:"soft",children:i(`blocks.createAgents.agentTypes.${l.rootType}`,{defaultValue:l.rootType})})}),l.description?o.jsx(zz,{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(yA,{label:i("blocks.createAgents.skill"),count:l.skills.length,icon:o.jsx(V_,{"aria-hidden":"true"}),children:o.jsx(h3,{label:i("blocks.createAgents.skill"),resources:l.skills})}),o.jsx(yA,{label:i("blocks.createAgents.knowledgeBase"),count:l.knowledgeBases.length,icon:o.jsx($je,{"aria-hidden":"true"}),children:o.jsx(h3,{label:i("blocks.createAgents.knowledgeBase"),resources:l.knowledgeBases})}),o.jsxs(yA,{label:i("blocks.createAgents.toolsLabel"),count:d,icon:o.jsx(jit,{"aria-hidden":"true"}),children:[o.jsx(h3,{label:i("blocks.createAgents.builtinTool"),resources:l.builtinTools}),o.jsx(b5t,{tools:l.pythonTools})]}),o.jsx(yA,{label:i("blocks.createAgents.subAgents"),count:l.subAgentCount,icon:o.jsx(Rit,{"aria-hidden":"true"}),children:o.jsx(y5t,{agents:l.subAgents})})]})]},l.name)})}):n==="running"?o.jsx(y5e,{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 w5t={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:dne},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:dne},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:dMt},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:hMt},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:pMt},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:hne},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:hne},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:oMt},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:NV},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:aMt},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:lMt},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:cMt},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:uMt},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:fMt,detailRenderer:v5t},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:fne,detailRenderer:x5t},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:fne,detailRenderer:LMt,hideHeader:!0}};function O5t(e){return w5t[e]}function k5t(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 S5t(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 E5t(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 $g(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function v5e(e){return o.jsx("svg",{...$g(e),children:o.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function p3(e){return o.jsx("svg",{...$g(e),children:o.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function C5t(e){return o.jsx("svg",{...$g(e),children:o.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function T5t(e){return o.jsx("svg",{...$g(e),children:o.jsx("path",{d:"m9 5 7 7-7 7"})})}function yD(e){return o.jsx("svg",{...$g(e),children:o.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function A5t(e){return o.jsxs("svg",{...$g(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 _5t(e){return o.jsx("svg",{...$g(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 x5e(e){return o.jsxs("svg",{...$g(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 j5t=p.lazy(()=>Bs(()=>Promise.resolve().then(()=>X$e),void 0)),N5t=p.lazy(()=>Bs(()=>import("../chunks/CodeDiffEditor-s8hBhMMg.js"),[])),w5e="veadk-code-workspace-theme";function R5t(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 I5t(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 P5t(){if(typeof window>"u")return"light";try{return window.localStorage.getItem(w5e)==="dark"?"dark":"light"}catch{return"light"}}function D5t(e){return e===""?0:e.split(` -`).length}function mw({project:e,open:t,onClose:n,onChange:i,readOnly:r=!1,comparison:s}){var N;const{t:a}=je("workspaceTools"),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(n),[f,h]=p.useState(P5t),m=p.useMemo(()=>s?E5t(s.baseProject.files,e.files):[],[s,e.files]),g=p.useMemo(()=>s?m.map(_=>({path:_.path,content:_.status==="deleted"?_.before:_.after})):e.files,[m,s,e.files]),b=p.useMemo(()=>new Map(m.map(_=>[_.path,_.status])),[m]),[v,y]=p.useState(((N=g[0])==null?void 0:N.path)??null),[w,x]=p.useState(new Set),O=p.useMemo(()=>R5t(g),[g]),S=g.find(_=>_.path===v)??null,k=m.find(_=>_.path===v)??null;if(d.current=n,p.useEffect(()=>{try{window.localStorage.setItem(w5e,f)}catch{}},[f]),p.useEffect(()=>{var P;if(!t)return;const _=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=L=>{if(L.key==="Escape"){L.preventDefault(),d.current();return}if(L.key!=="Tab"||!c.current)return;const B=[...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(B.length===0)return;const I=B[0],z=B[B.length-1];L.shiftKey&&document.activeElement===I?(L.preventDefault(),z.focus()):!L.shiftKey&&document.activeElement===z&&(L.preventDefault(),I.focus())};return window.addEventListener("keydown",M),()=>{document.body.style.overflow=_,window.removeEventListener("keydown",M),D!=null&&D.isConnected&&D.focus()}},[t]),p.useEffect(()=>{S||g.length===0||y(g[0].path)},[g,S]),!t)return null;function C(_){x(D=>{const M=new Set(D);return M.has(_)?M.delete(_):M.add(_),M})}function E(_){return _?o.jsx("span",{className:`code-browser-change is-${_}`,children:a(`codeBrowser.change.${_}`)}):null}function R(_,D,M){return I5t(_,D===0).map(P=>{const L=M?`${M}/${P.name}`:P.name;if(!(P.children.size>0&&P.path===void 0)&&P.path){const z=b.get(P.path);return o.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:[o.jsx(p3,{}),o.jsx("span",{children:P.name}),E(z)]},L)}const I=w.has(L);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+D*16}px`},onClick:()=>C(L),"aria-expanded":!I,children:[o.jsx(T5t,{className:I?"":"is-open"}),o.jsx(C5t,{}),o.jsx("span",{children:P.name})]}),!I&&R(P,D+1,L)]},L)})}function A(_){!S||s||i({...e,files:e.files.map(D=>D.path===S.path?{...D,content:_}:D)})}const j=f==="light"?"dark":"light",T=a(s?"codeBrowser.noChanges":"codeBrowser.chooseFile");return si.createPortal(o.jsx("div",{className:"code-browser-backdrop",onMouseDown:_=>{_.target===_.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(v5e,{})}),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(_5t,{}):o.jsx(A5t,{})}),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(yD,{})})]})]}),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?R(O,0,""):o.jsx("div",{className:"code-browser-empty",children:T})})]}),o.jsxs("main",{className:"code-browser-main",children:[o.jsx("div",{className:"code-browser-tabs",role:"tablist","aria-label":a("codeBrowser.openFiles"),children:S?o.jsxs("div",{className:"code-browser-tab",role:"tab","aria-selected":"true",children:[o.jsx(p3,{}),o.jsx("span",{children:S.path.split("/").pop()}),E(k==null?void 0:k.status)]}):null}),o.jsxs("div",{className:"code-browser-path",children:[o.jsx(p3,{}),o.jsx("span",{children:(S==null?void 0:S.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:S?o.jsx(p.Suspense,{fallback:o.jsx("div",{className:"code-browser-empty",children:a("codeBrowser.loadingEditor")}),children:k?o.jsx(N5t,{before:k.before,after:k.after,path:k.path,theme:f}):o.jsx(j5t,{value:S.content,path:S.path,onChange:A,readOnly:r,theme:f})}):o.jsx("div",{className:"code-browser-empty",children:T})}),o.jsxs("footer",{className:"code-browser-statusbar",children:[o.jsx("span",{children:s?a("codeBrowser.changedFileCount",{count:m.length}):a("codeBrowser.fileCount",{count:e.files.length})}),o.jsx("span",{children:S?a("codeBrowser.lineCount",{count:D5t(S.content)}):"UTF-8"})]})]})]})]})}),document.body)}function M5t({project:e,onChange:t,className:n="",label:i}){const{t:r}=je("workspaceTools"),[s,a]=p.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(v5e,{}),o.jsx("span",{children:l})]}),o.jsx(mw,{project:e,open:s,onClose:()=>a(!1),onChange:t})]})}const O5e="send_a2ui_json_to_client",L5t=28,$5t=3e3;function F5t(e,t,n){let i=t;for(let r=0;r65535?2:1}return i}function B5t(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function k5e(e,t,n,i){const[r,s]=p.useState(()=>t?"":e),a=p.useRef(r),l=p.useRef(e),c=p.useRef(null),u=p.useRef(0),d=p.useRef(n);return l.current=e,d.current=n,p.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 m=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]),p.useEffect(()=>{r===e&&(i==null||i())},[r,i,e]),p.useEffect(()=>()=>{c.current!==null&&(window.cancelAnimationFrame(c.current),c.current=null)},[]),r}function U5t(){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 Q5t(){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 z5t(){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 V5t({activity:e}){const{t}=je("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 H5t(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 S5e({text:e,done:t,answerStarted:n=!1,streaming:i=!1,onStreamFrame:r}){const{t:s}=je("conversation"),[a,l]=p.useState(!(t||n)),c=p.useRef(!1);p.useEffect(()=>{c.current||l(!(t||n))},[n,t]);const u=()=>{c.current=!0,l(g=>!g)},d=e.replace(/\r\n?/g,` +`+v+"]"}return r.pop(),s=v,w}};const HIt={parse:$It,stringify:VIt};var AMe=HIt;const qIt=2e5,WIt=new Set(["__proto__","constructor","prototype"]),KIt=/^(?:https?:|data:|blob:|file:|javascript:|image:\/\/)/i;function ck(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function pR(e,t=0){if(t>30)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"&&KIt.test(e.trim()))throw new Error("ECharts option contains an external resource");if(Array.isArray(e)){for(const n of e)pR(n,t+1);return}if(ck(e))for(const[n,i]of Object.entries(e)){if(WIt.has(n))throw new Error("ECharts option contains an unsafe key");pR(i,t+1)}}function GIt(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 XIt(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(YIt),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 JIt(e,t){const n=/^(?:new\s+)?echarts\.graphic\.(LinearGradient|RadialGradient)\s*\(/;let i="",r=!1,s=!1,a=!1;for(let l=t;lqIt)throw new Error("ECharts option is too large");const n=ePt(GIt(e));let i;try{i=AMe.parse(n)}catch(a){throw/\bfunction\s*\(|=>/.test(n)?new Error("ECharts function callbacks are not supported"):a}if(!ck(i))throw new Error("ECharts option must be a data object");pR(i);const r={...i};r.aria={...ck(r.aria)?r.aria:{},enabled:!0};const s=r.tooltip;return ck(s)?r.tooltip={...s,renderMode:"richText"}:Array.isArray(s)&&(r.tooltip=s.map(a=>ck(a)?{...a,renderMode:"richText"}:a)),t&&(r.animation=!1),r}let u3;function tPt(){return u3??(u3=zs(()=>import("../visualizations/echarts/index-CGT341lL.js"),[]).catch(e=>{throw u3=void 0,e})),u3}function nPt({source:e}){const{t}=_e("conversation"),n=p.useRef(null),[i,r]=p.useState(!1),[s,a]=p.useState("");return p.useEffect(()=>{let l=!1,c,u,d;r(!1);try{d=_Me(e,window.matchMedia("(prefers-reduced-motion: reduce)").matches),a("")}catch{a("invalid");return}return tPt().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(bn,{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 iPt=p.memo(nPt);let nne,ine=Promise.resolve(),rPt=0;function sPt(){return nne??(nne=zs(async()=>{const{default:e}=await import("../visualizations/mermaid/mermaid.core-Bi7HkArr.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))),nne}function oPt(e){const t=ine.then(async()=>{const n=await sPt(),i=`mermaid-diagram-${rPt+=1}`;return n.render(i,e)});return ine=t.then(()=>{},()=>{}),t}function aPt({source:e}){const{t}=_e("conversation"),n=p.useRef(null),[i,r]=p.useState(null),[s,a]=p.useState(!1);return p.useEffect(()=>{let l=!1;return r(null),a(!1),oPt(e).then(c=>{l||r(c)}).catch(()=>{l||a(!0)}),()=>{l=!0}},[e]),p.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(bn,{duration:2.2,spread:15,children:t("visualization.rendering")})})}const lPt=p.memo(aPt),cPt="_SegmentedControl_1sl7d_1",uPt="_SegmentedControlOption_1sl7d_140",dPt="_SegmentedControlThumb_1sl7d_219",I8={SegmentedControl:cPt,SegmentedControlOption:uPt,SegmentedControlThumb:dPt},Iu=({value:e,onChange:t,children:n,block:i,pill:r=!0,size:s="md",gutterSize:a,className:l,onClick:c,...u})=>{const d=p.useRef(null),f=p.useRef(null),h=p.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 w=b.clientWidth;let x=Math.floor(y.clientWidth);const O=y.offsetLeft;if(w-(x+O)<2&&(x=x-1),v.style.width=`${Math.floor(x)}px`,v.style.transform=`translateX(${O}px)`,b.scrollWidth>w){const S=w*.15,k=b.scrollLeft,C=y.offsetLeft,E=C+x;(Ck+w-S)&&g&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);R2e({ref:d,onResize:()=>{const g=f.current;if(!g)return;const b=g.style.transition;g.style.transition="",h(!1),g.style.transition=b}}),p.useLayoutEffect(()=>{const g=d.current,b=f.current;!g||!b||(h(!!b.style.transition),b.style.transition||MN(()=>{b.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[h,e,s,a,r]);const m=g=>{g&&t&&t(g)};return o.jsxs(Dct,{ref:d,className:ji(I8.SegmentedControl,l),type:"single",value:e,loop:!1,onValueChange:m,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:I8.SegmentedControlThumb,ref:f}),n]})},fPt=({children:e,...t})=>o.jsx(Bct,{className:I8.SegmentedControlOption,...t,onPointerEnter:OQ,children:o.jsx("span",{className:"relative",children:e})});Iu.Option=fPt;function hPt({children:e,label:t,language:n,source:i,streaming:r=!1}){const{t:s}=_e("conversation"),[a,l]=p.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(Iu,{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(Iu.Option,{value:"preview",disabled:r,children:s("visualization.preview")}),o.jsx(Iu.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 pPt=p.memo(hPt);function jMe(e){const t=e==null?void 0:e.trim().toLowerCase();if(t==="mermaid")return"mermaid";if(t==="echart"||t==="echarts")return"echarts"}const NMe=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function P8(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(P8).join(""):p.isValidElement(e)?P8(e.props.children):""}function mPt(e){var i;const t=p.Children.toArray(e)[0];if(!p.isValidElement(t))return;const n=(i=t.props.className)==null?void 0:i.split(/\s+/).find(r=>r.startsWith("language-"));return jMe(n==null?void 0:n.slice(9))}function RMe(e){if(!e)return!1;try{const t=e.toLowerCase();return NMe.some(n=>t.includes(n))}catch{return!1}}function gPt(e){var i;const t=(i=e==null?void 0:e.properties)==null?void 0:i.href;if(!t)return!1;if(RMe(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 NMe.some(s=>r.includes(s))}return!1}function bPt({text:e,className:t,allowRawHtml:n=!0,streaming:i=!1}){const{t:r}=_e("conversation"),[s,a]=p.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},m=h({children:f});if(m)return m}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(jPe,{remarkPlugins:[tDe],rehypePlugins:n?[RIt,Mte]:[Mte],components:{pre:({node:d,children:f,...h})=>{const m=mPt(f);if(m==="mermaid"||m==="echarts"){const g=P8(f).replace(/\n$/,"");return o.jsx(pPt,{label:m==="mermaid"?"Mermaid":"ECharts",language:m,source:g,streaming:i,children:m==="mermaid"?o.jsx(lPt,{source:g}):o.jsx(iPt,{source:g})})}return o.jsx("pre",{...h,children:f})},a:({node:d,...f})=>{const h=f.href;if(h&&(RMe(h)||gPt(d))){const m=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:m,title:g}),children:[o.jsx("video",{src:m,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(ax,{})})]}),o.jsx("div",{className:"video-caption",children:o.jsx("a",{href:m,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,...m})=>{const g=o.jsx("img",{...m,src:f,alt:h??"",loading:"lazy"});return f?o.jsx(AEe,{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(ax,{})})]})}):g},video:({node:d,src:f,children:h,...m})=>{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,...m,playsInline:!0,className:"video-thumbnail",children:h}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(ax,{})})]})}):o.jsx("video",{src:f,controls:!0,playsInline:!0,className:"video-inline",...m,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(bP,{})}),o.jsx("button",{type:"button",className:"video-viewer-close","aria-label":r("markdown.close"),onClick:()=>a(null),children:o.jsx(Ta,{})})]})]}),o.jsx("div",{className:"video-viewer-body",children:o.jsx("video",{src:s.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const Zu=p.memo(bPt);function d3(e){return(e==null?void 0:e.trim())||Mg("resourceMetadata.unknownSource")}function IMe(e){return(e==null?void 0:e.trim())||Mg("resourceMetadata.unknownCreator")}function yPt(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 vPt(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 xPt(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 wPt(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 aT({title:e,children:t,onClose:n,busy:i=!1,className:r=""}){const{t:s}=_e("ui"),a=p.useId(),l=p.useRef(null),c=p.useRef(null),u=p.useRef(i),d=p.useRef(n);return p.useEffect(()=>{u.current=i,d.current=n},[i,n]),p.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 m=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(O=>O.getClientRects().length>0);if(y.length===0){b.preventDefault();return}const w=y[0],x=y[y.length-1];b.shiftKey&&(document.activeElement===w||!v.contains(document.activeElement))?(b.preventDefault(),x.focus()):!b.shiftKey&&(document.activeElement===x||!v.contains(document.activeElement))&&(b.preventDefault(),w.focus())};return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m),document.body.style.overflow=h,f!=null&&f.isConnected&&f.focus()}},[]),ri.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(xPt,{})})]}),t]})}),document.body)}function SE({message:e}){return e?o.jsx("div",{className:"knowledge-form-error",role:"alert",children:e}):null}function D8(e){return e instanceof DOMException&&e.name==="AbortError"}function OPt(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 PMe=[".jpg",".jpeg",".png"].join(","),kPt=new Set(PMe.split(",")),DMe=[".pdf",".pptx",".docx",".xlsx",".txt"].join(","),SPt=new Set(DMe.split(",")),EPt=200*1024*1024;function M8(e){const t=e.lastIndexOf(".");return t<0?"":e.slice(t).toLocaleLowerCase()}function CPt(e,t,n){return e.size>EPt?n("knowledge.errors.fileTooLarge"):t==="image"?kPt.has(M8(e.name))?"":n("knowledge.errors.invalidImageType"):SPt.has(M8(e.name))?"":n("knowledge.errors.invalidDocumentType")}function AV(e){return e<=0?"-":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function L8(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 TPt({region:e,onClose:t,onCreated:n}){const{t:i}=_e("ui"),[r,s]=p.useState(""),[a,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(!1),[h,m]=p.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),m("");const w={name:g,description:a.trim()||void 0,region:e};try{n(await cOt(w))}catch(x){m(sl(x,i("knowledge.errors.createBase")))}finally{f(!1)}};return o.jsx(aT,{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(SE,{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 APt({item:e,onClose:t,onUpdated:n}){const{t:i}=_e("ui"),[r,s]=p.useState(e.description),[a,l]=p.useState(!1),[c,u]=p.useState(""),d=async f=>{f.preventDefault(),l(!0),u("");try{n(await uOt(e.id,e.region,{description:r.trim()}))}catch(h){u(sl(h,i("knowledge.errors.updateBase")))}finally{l(!1)}};return o.jsx(aT,{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(SE,{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 MMe(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 _Pt({base:e,onClose:t,onCreated:n,onAssociationInvalid:i}){const{t:r}=_e("ui"),[s,a]=p.useState("document"),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(null),[b,v]=p.useState(!1),[y,w]=p.useState("{}"),[x,O]=p.useState(""),[S,k]=p.useState(""),[C,E]=p.useState(null),R=p.useRef(null),A=p.useRef(null),N=p.useRef(null),T=p.useRef(0),j=!!x;p.useEffect(()=>{var L;C&&!j&&((L=N.current)==null||L.focus())},[j,C]);const _=L=>{j||L===s||(a(L),g(null),h(""),c(""),d(""),k(""),E(null),v(!1),T.current=0,R.current&&(R.current.value=""))},I=L=>{if(!L||s==="web")return;const B=CPt(L,s,r);if(B){g(null),c(""),d(""),k(B);return}g(L),k(""),c(L.name.replace(/\.[^.]+$/,"")),d(M8(L.name).slice(1))},D=async L=>{if(L.preventDefault(),s==="web"?!f.trim():!m)return;let B;try{B=MMe(y,r("knowledge.errors.metadataObject"))}catch(M){k(sl(M,r("knowledge.errors.metadataFormat")));return}O(s==="web"?C?"save":"preview":"upload"),k("");try{if(s==="web")if(C){const M={sourceType:"url",metadata:C.metadata,url:C.preview.url,sourceTitle:C.preview.name,sourceMarkdown:C.preview.sourceMarkdown};await pOt(e.id,e.region,M),n()}else{const M=await mOt(e.id,e.region,{url:f.trim()});if(!M.sourceMarkdown.trim())throw new Error(r("knowledge.errors.noWebPreview"));E({preview:M,metadata:B})}else m&&(await gOt(e.id,e.region,{file:m,name:l.trim()||void 0,documentType:u.trim()||void 0,metadata:B}),n())}catch(M){M instanceof XP&&M.errorCode===zIe?i(M):k(sl(M,r(s==="web"?C?"knowledge.errors.addWeb":"knowledge.errors.previewWeb":"knowledge.errors.uploadFile")))}finally{O("")}},P=()=>{j||(E(null),k(""),requestAnimationFrame(()=>{var L;return(L=A.current)==null?void 0:L.focus()}))};return o.jsx(aT,{title:r(C?"knowledge.previewWeb":"knowledge.addData"),onClose:t,busy:j,className:C?"knowledge-dialog--preview knowledge-dialog--web-confirm":"",children:o.jsx("form",{onSubmit:L=>void D(L),children:C?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:C.preview.name,children:C.preview.name}),o.jsx("a",{href:C.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(Zu,{text:C.preview.sourceMarkdown,allowRawHtml:!1,className:"knowledge-preview__markdown"})})}),S?o.jsx("div",{className:"knowledge-web-preview__error",children:o.jsx(SE,{message:S})}):null]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",className:"is-back",onClick:P,disabled:j,children:r("knowledge.backToEdit")}),o.jsx("button",{type:"button",onClick:t,disabled:j,children:r("common.cancel")}),o.jsx("button",{ref:N,type:"submit",className:"is-primary",disabled:j,children:r(x==="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(([L,B])=>o.jsx("button",{type:"button",role:"tab",id:`knowledge-source-${L}-tab`,"aria-controls":`knowledge-source-${L}-panel`,"aria-selected":s===L,tabIndex:s===L?0:-1,className:s===L?"is-active":"",disabled:j,onClick:()=>_(L),onKeyDown:M=>{const H=["image","document","web"];if(!["ArrowLeft","ArrowRight","Home","End"].includes(M.key))return;M.preventDefault();const K=H.indexOf(L),F=M.key==="Home"?H[0]:M.key==="End"?H[H.length-1]:H[(K+(M.key==="ArrowRight"?1:-1)+H.length)%H.length];_(F),requestAnimationFrame(()=>{var q;return(q=document.getElementById(`knowledge-source-${F}-tab`))==null?void 0:q.focus()})},children:B},L))}),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:A,autoFocus:!0,type:"url",value:f,disabled:j,onChange:L=>{h(L.target.value),k("")},placeholder:"https://example.com/article"})]}),o.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:x==="preview"?o.jsx(bn,{children:r("knowledge.generatingWebPreview")}):null})]}):o.jsxs(o.Fragment,{children:[o.jsx("input",{ref:R,className:"knowledge-upload-input",type:"file","aria-label":r("knowledge.selectFile"),accept:s==="image"?PMe:DMe,disabled:j,onChange:L=>{var B;I(((B=L.currentTarget.files)==null?void 0:B[0])??null),L.currentTarget.value=""}}),o.jsxs("button",{type:"button",className:`knowledge-upload-dropzone${b?" is-dragging":""}${m?" is-ready":""}`,disabled:j,onClick:()=>{var L;return(L=R.current)==null?void 0:L.click()},onDragEnter:L=>{L.preventDefault(),!j&&(T.current+=1,v(!0))},onDragOver:L=>{L.preventDefault(),j||(L.dataTransfer.dropEffect="copy")},onDragLeave:L=>{L.preventDefault(),T.current=Math.max(0,T.current-1),T.current===0&&v(!1)},onDrop:L=>{var B;L.preventDefault(),T.current=0,v(!1),j||I(((B=L.dataTransfer.files)==null?void 0:B[0])??null)},children:[o.jsx("strong",{children:m?m.name:r("knowledge.selectOrDropFile")}),o.jsx("span",{children:m?r("knowledge.selectedFile",{size:AV(m.size)}):r(s==="image"?"knowledge.imageFileHelp":"knowledge.documentFileHelp")})]}),o.jsx("div",{className:"knowledge-upload-status",role:"status","aria-live":"polite",children:j?o.jsx(bn,{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:j,maxLength:256,onChange:L=>c(L.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:r("knowledge.optionalType")}),o.jsx("input",{value:u,disabled:j,maxLength:64,onChange:L=>d(L.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:j,onChange:L=>w(L.target.value),spellCheck:!1})]}),o.jsx(SE,{message:S})]}),o.jsxs("footer",{className:"knowledge-dialog__actions",children:[o.jsx("button",{type:"button",onClick:t,disabled:j,children:r("common.cancel")}),o.jsx("button",{type:"submit",className:"is-primary",disabled:j||(s==="web"?!f.trim():!m),children:r(j?s==="web"?"common.generating":"common.uploading":s==="web"?"knowledge.generatePreview":"knowledge.uploadFile")})]})]})})})}function jPt({base:e,item:t,onClose:n,onUpdated:i}){const{t:r}=_e("ui"),[s,a]=p.useState(()=>JSON.stringify(t.metadata??{},null,2)),[l,c]=p.useState(!1),[u,d]=p.useState(""),f=async h=>{h.preventDefault();let m;try{m=MMe(s,r("knowledge.errors.metadataObject"))}catch(g){d(sl(g,r("knowledge.errors.metadataFormat")));return}c(!0),d("");try{i(await bOt(e.id,t.id,e.region,{metadata:m}))}catch(g){d(sl(g,r("knowledge.errors.updateDocument")))}finally{c(!1)}};return o.jsx(aT,{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(SE,{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 LMe=new Set(["avif","bmp","gif","jpeg","jpg","png","svg","webp"]),$Me=new Set(["aac","flac","m4a","mp3","ogg","wav","webm"]),FMe=new Set(["m4v","mov","mp4","mpeg","mpg","ogg","webm"]),NPt=new Set(["pdf"]),RPt=new Set(["doc","docx","ppt","pptx","xls","xlsx"]),IPt=new Set(["creating","indexing","pending","processing","queued","submitted"]),PPt=new Set(["error","failed","unavailable"]);function rne(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{}}function m2(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 DPt(e,t){if(Array.isArray(e)){if(e.length===0)return null;const r=e.map(rne);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=>m2(a[l])))}}return{columns:[t("knowledge.value")],rows:e.map(s=>[m2(s)])}}const n=rne(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])=>m2(c[l])))}}return{columns:[t("knowledge.field"),t("knowledge.value")],rows:i.map(([r,s])=>[r,m2(s)])}}function BMe(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 MPt(e){const t=BMe(e);return t.startsWith("http://")||t.startsWith("https://")?t:""}function LPt(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 LMe.has(i)?"image":$Me.has(i)?"audio":FMe.has(i)?"video":NPt.has(i)?"pdf":t||i?"file":"none"}function $Pt(e,t){const n=e.status.trim().toLocaleLowerCase();if(IPt.has(n))return{title:t("knowledge.preview.processingTitle"),detail:t("knowledge.preview.processingDetail")};if(PPt.has(n))return{title:t("knowledge.preview.failedTitle"),detail:t("knowledge.preview.failedDetail")};const i=L8(e).toLocaleLowerCase();return i==="pdf"||RPt.has(i)?{title:t("knowledge.preview.noParsedTitle"),detail:t("knowledge.preview.noParsedDetail")}:LMe.has(i)||$Me.has(i)||FMe.has(i)?{title:t("knowledge.preview.noMediaTitle"),detail:t("knowledge.preview.noMediaDetail")}:{title:t("knowledge.preview.noDataTitle"),detail:t("knowledge.preview.noDataDetail")}}function FPt({chunk:e}){const{t}=_e("ui"),[n,i]=p.useState(!1),r=BMe(e.attachmentUrl),s=LPt(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 BPt({base:e,item:t,onClose:n}){const{t:i}=_e("ui"),[r,s]=p.useState([]),[a,l]=p.useState(t),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(!1),[v,y]=p.useState(""),w=p.useRef(0),x=p.useRef(null),O=p.useCallback(async(E=0)=>{var N;(N=x.current)==null||N.abort();const R=new AbortController;x.current=R;const A=w.current+1;w.current=A,E>0?m(!0):f(!0),y(""),E===0&&(s([]),b(!1));try{const T=await hOt(e.id,t.id,{region:e.region,offset:E,signal:R.signal});if(w.current!==A)return;l(T.document.id?T.document:t),u(T.sourceMarkdown||T.document.sourceMarkdown),s(j=>E>0?[...j,...T.chunks]:T.chunks),b(T.hasMore)}catch(T){!D8(T)&&w.current===A&&y(sl(T,i("knowledge.errors.loadPreview")))}finally{w.current===A&&(f(!1),m(!1))}},[e.id,e.region,t,i]);p.useEffect(()=>(O(),()=>{var E;(E=x.current)==null||E.abort(),w.current+=1}),[O]);const S=MPt(a.url||t.url),k=$Pt(a,i),C=a.metadata._veadk_content_format==="markdown";return o.jsx(aT,{title:a.name||t.name||t.id,onClose:n,className:"knowledge-dialog--preview",children:o.jsxs("div",{className:"knowledge-preview",children:[a.sizeBytes>0||S?o.jsxs("div",{className:"knowledge-preview__meta",children:[a.sizeBytes>0?o.jsx("span",{children:AV(a.sizeBytes)}):null,S?o.jsx("a",{href:S,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(Zu,{text:c,allowRawHtml:!1,className:"knowledge-preview__markdown"})}):d?o.jsx("div",{className:"knowledge-preview__state",role:"status",children:o.jsx(bn,{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 O(),children:i("common.retry")})]}):r.length===0?o.jsxs("div",{className:"knowledge-preview__state",children:[o.jsx("p",{children:k.title}),o.jsx("span",{children:S?i("knowledge.preview.openOriginalHint"):k.detail}),o.jsx("button",{type:"button",onClick:()=>void O(),children:i("common.reload")})]}):o.jsxs("div",{className:"knowledge-preview__chunks",children:[r.map((E,R)=>{const A=DPt(E.tableFields,i),N=E.id||`${R}:${E.title}`;return o.jsxs("article",{className:"knowledge-preview__chunk",children:[o.jsx("header",{children:o.jsx("h3",{children:E.title||i("knowledge.preview.chunk",{index:R+1})})}),E.content?C?o.jsx(Zu,{text:E.content,allowRawHtml:!1,className:"knowledge-preview__markdown"}):o.jsx("p",{className:"knowledge-preview__content",children:E.content}):null,A?o.jsx("div",{className:"knowledge-preview__table-wrap",children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsx("tr",{children:A.columns.map((T,j)=>o.jsx("th",{scope:"col",children:T},`${T}:${j}`))})}),o.jsx("tbody",{children:A.rows.map((T,j)=>o.jsx("tr",{children:T.map((_,I)=>o.jsx("td",{children:_},I))},j))})]})}):null,o.jsx(FPt,{chunk:E})]},N)}),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 O(r.length),children:h?o.jsx(bn,{as:"span",duration:2.4,children:i("knowledge.preview.loadingMore")}):i("knowledge.preview.loadMore")}):null]})})]})})}function UPt({cloudProvider:e,region:t,active:n=!0,activationRevision:i=0,onDetailChange:r,toolbarLeading:s,toolbarFilters:a}){const{t:l,i18n:c}=_e("ui"),[u,d]=p.useState([]),[f,h]=p.useState({}),[m,g]=p.useState([]),[b,v]=p.useState(""),[y,w]=p.useState("overview"),[x,O]=p.useState(""),[S,k]=p.useState(""),[C,E]=p.useState(!0),[R,A]=p.useState(!1),[N,T]=p.useState(""),[j,_]=p.useState([]),[I,D]=p.useState(!1),[P,L]=p.useState(""),[B,M]=p.useState(""),[H,K]=p.useState(""),[F,q]=p.useState(!1),[Q,X]=p.useState(!1),[ne,z]=p.useState(!1),[Y,ae]=p.useState(null),[Ee,Z]=p.useState(null),[G,te]=p.useState(null),[de,Ce]=p.useState(null),[le,fe]=p.useState(null),[ce,Te]=p.useState(!1),Me=p.useRef(0),we=p.useRef(0),Ue=p.useRef([]),ke=p.useRef(!1),je=p.useRef(!1),re=p.useRef(null),ve=p.useRef(null),be=p.useRef({}),xe=p.useRef(!1),Ke=p.useRef(null),Ze=p.useRef(null),he=p.useRef(null),ye=p.useRef(null),Ae=p.useMemo(()=>[t],[t]),He=p.useCallback(qe=>`${qe.region}\0${qe.id}`,[]),De=u.find(qe=>He(qe)===b)??null,At=!!(De&&H===He(De));p.useEffect(()=>{r==null||r(!!De)},[r,De]),p.useEffect(()=>{w("overview"),k("")},[b]);const Nt=p.useMemo(()=>{const qe=x.trim().toLocaleLowerCase();return qe?u.filter(Ie=>[Ie.name,Ie.description,Ie.ownerLabel,Ie.providerKnowledgeId].some(We=>We.toLocaleLowerCase().includes(qe))):u},[u,x]),Ot=p.useMemo(()=>{const qe=S.trim().toLocaleLowerCase();return qe?j.filter(Ie=>[Ie.name,Ie.id,L8(Ie)].some(We=>We.toLocaleLowerCase().includes(qe))):j},[S,j]);p.useEffect(()=>{Z(null)},[De==null?void 0:De.id,De==null?void 0:De.region]);const vt=p.useCallback(async(qe=!1)=>{var gt;if(qe&&(xe.current||Object.keys(be.current).length===0))return;(gt=re.current)==null||gt.abort();const Ie=new AbortController;re.current=Ie;const We=Me.current+1;Me.current=We,xe.current=!0,qe?A(!0):E(!0),T(""),qe||g([]);try{const it=await lOt({regions:Ae,nextTokens:qe?be.current:void 0,signal:Ie.signal});if(Me.current!==We)return;d(ct=>qe?[...ct,...it.items.filter(Kt=>!ct.some(dn=>He(dn)===He(Kt)))]:it.items),be.current=it.nextTokens,h(it.nextTokens);const kt=it.failures.map(({region:ct,error:Kt})=>`${$f(ct,e)}: ${sl(Kt,l("common.loadFailed"))}`);g(ct=>qe?[...new Set([...ct,...kt])]:kt),qe||v(ct=>it.items.some(Kt=>He(Kt)===ct)?ct:"")}catch(it){if(D8(it))return;Me.current===We&&(qe?g(kt=>[...new Set([...kt,sl(it,l("knowledge.errors.loadMoreBases"))])]):T(sl(it,l("knowledge.errors.loadBases"))))}finally{Me.current===We&&(xe.current=!1,E(!1),A(!1))}},[He,e,Ae,l]),Tt=p.useCallback(async(qe,Ie=!1)=>{var it;if(Ie&&ke.current)return;(it=ve.current)==null||it.abort();const We=new AbortController;ve.current=We;const gt=we.current+1;we.current=gt,Ie||(Ue.current=[],je.current=!1,_([]),q(!1),M("")),ke.current=!0,D(!0),Ie?M(""):L("");try{const kt=await fOt(qe.id,{region:qe.region,offset:Ie?Ue.current.length:0,signal:We.signal});if(we.current!==gt)return;K(Xt=>Xt===He(qe)?"":Xt);const ct=Ue.current,Kt=Ie?[...ct,...kt.items.filter(Xt=>!Xt.id||!ct.some(Ge=>Ge.id===Xt.id))]:kt.items,dn=kt.hasMore&&(!Ie||Kt.length>ct.length);Ue.current=Kt,je.current=dn,_(Kt),q(dn)}catch(kt){if(D8(kt))return;we.current===gt&&(kt instanceof XP&&kt.errorCode===zIe&&(K(He(qe)),ae(Kt=>Kt&&He(Kt)===He(qe)?null:Kt)),Ie?M(sl(kt,l("knowledge.errors.loadMoreData"))):L(sl(kt,l("knowledge.errors.loadData"))))}finally{we.current===gt&&(ke.current=!1,D(!1))}},[He,l]);p.useEffect(()=>{var qe;(qe=re.current)==null||qe.abort(),Me.current+=1,xe.current=!1,be.current={},d([]),h({}),g([]),v(""),K(""),T(""),E(!0)},[e]),p.useEffect(()=>{if(n)return vt(),()=>{var qe;(qe=re.current)==null||qe.abort(),Me.current+=1,xe.current=!1}},[n,i,vt]),p.useEffect(()=>{var qe,Ie;if(!n){(qe=ve.current)==null||qe.abort(),we.current+=1,ke.current=!1;return}if(!De){(Ie=ve.current)==null||Ie.abort(),we.current+=1,Ue.current=[],ke.current=!1,je.current=!1,_([]),q(!1),M("");return}return Tt(De),()=>{var We;(We=ve.current)==null||We.abort(),we.current+=1,ke.current=!1}},[n,i,De==null?void 0:De.id,De==null?void 0:De.region]);const ft=n&&!De&&!x.trim()&&!C&&!R&&!N&&Object.keys(f).length>0;p.useEffect(()=>{const qe=Ze.current,Ie=Ke.current;if(!qe||!Ie||!ft)return;const We=new IntersectionObserver(([gt])=>{gt.isIntersecting&&vt(!0)},{root:Ie,rootMargin:"240px 0px",threshold:.01});return We.observe(qe),()=>We.disconnect()},[ft,vt]);const pt=()=>{const qe=Ke.current;!qe||!ft||qe.scrollHeight-qe.scrollTop-qe.clientHeight<=240&&vt(!0)},Pe=!!(De&&j.length>0&&F&&!I&&!B);p.useEffect(()=>{const qe=ye.current,Ie=he.current;if(!De||!qe||!Ie||!Pe)return;const We=new IntersectionObserver(([gt])=>{gt.isIntersecting&&Tt(De,!0)},{root:he.current,rootMargin:"240px 0px",threshold:.01});return We.observe(qe),()=>We.disconnect()},[Pe,Tt,De==null?void 0:De.id,De==null?void 0:De.region]);const yt=()=>{const qe=he.current;if(!De||!qe||!je.current||ke.current||B)return;const{scrollHeight:Ie,scrollTop:We,clientHeight:gt}=qe;Ie-We-gt<=240&&Tt(De,!0)},jt=qe=>{d(Ie=>Ie.map(We=>He(We)===He(qe)?qe:We))},qt=async()=>{if(de){Te(!0);try{await dOt(de.id,de.region),d(qe=>qe.filter(Ie=>He(Ie)!==He(de))),K(qe=>qe===He(de)?"":qe),b===He(de)&&v(""),Ce(null)}catch(qe){T(sl(qe,l("knowledge.errors.deleteBase"))),Ce(null)}finally{Te(!1)}}},ln=async()=>{if(!(!De||!le)){Te(!0);try{await yOt(De.id,le.id,De.region);const qe=Ue.current.filter(Ie=>Ie.id!==le.id);Ue.current=qe,_(qe),fe(null)}catch(qe){L(sl(qe,l("knowledge.errors.deleteDocument"))),fe(null)}finally{Te(!1)}}};return o.jsxs("section",{className:`knowledge-library${De?" is-detail":" resource-collection"}`,"aria-label":l("knowledge.library"),children:[De?o.jsx(XC,{className:"knowledge-library__detail",title:De.name,description:De.description||l("common.noDescription"),identitySeed:De.name,backLabel:l("knowledge.backToList"),onBack:()=>v(""),sections:[{key:"overview",label:l("skillCenter.overview"),content:o.jsx("section",{className:"knowledge-overview",children:o.jsxs(Fz,{className:"knowledge-overview__summary",children:[o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.provider")}),o.jsx("dd",{children:De.providerType||"-"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.knowledgeId")}),o.jsx("dd",{className:"knowledge-keyboard-reveal",tabIndex:0,title:De.providerKnowledgeId,children:De.providerKnowledgeId||"-"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.project")}),o.jsx("dd",{children:De.projectName||"default"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("knowledge.creator")}),o.jsx("dd",{children:d3(De.ownerLabel)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:l("skillCenter.updatedAt")}),o.jsx("dd",{children:OPt(De.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${j.length>0?" is-table":""}`,"aria-live":"polite",children:I&&j.length===0?o.jsx(Ka,{}):P&&j.length===0?o.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[o.jsx("p",{children:P}),At&&De.canManage?o.jsx("button",{type:"button",onClick:()=>Ce(De),children:l("knowledge.deleteInvalidAssociation")}):o.jsx("button",{type:"button",onClick:()=>void Tt(De),children:l("common.retry")})]}):j.length===0?o.jsxs("div",{className:"knowledge-library__state",children:[o.jsx(vPt,{}),o.jsx("p",{children:l("knowledge.noData")}),De.canManage&&o.jsx("button",{type:"button",onClick:()=>ae(De),children:l("knowledge.addFirstData")})]}):o.jsx(Bz,{rows:Ot,rowKey:qe=>qe.id,rowLabel:qe=>qe.name||qe.id,columns:[{key:"name",header:l("common.name"),className:"is-primary-column",render:qe=>o.jsx("span",{title:qe.name||qe.id,children:qe.name||qe.id})},{key:"format",header:l("knowledge.format"),className:"is-compact-column",render:qe=>L8(qe)},{key:"size",header:l("knowledge.size"),className:"is-compact-column",render:qe=>AV(qe.sizeBytes)}],searchValue:S,onSearchChange:k,searchPlaceholder:l("knowledge.searchData"),searchLabel:l("knowledge.searchLibraryData"),primaryAction:De.canManage?{label:l(At?"knowledge.associationInvalid":"knowledge.addData"),disabled:At,title:At?l("knowledge.providerMissing"):void 0,onClick:()=>ae(De)}:void 0,rowActions:qe=>[{label:l("common.preview"),onSelect:()=>Z(qe)},...De.canManage?[{label:l("common.edit"),onSelect:()=>te(qe)},{label:l("common.delete"),onSelect:()=>fe(qe),danger:!0}]:[]],scrollRef:he,onScroll:yt,busy:I,emptyLabel:l("knowledge.noMatchingData"),footer:I?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")})]}):B?o.jsxs("div",{className:"knowledge-document-pagination is-error",role:"alert",children:[o.jsx("span",{children:B}),o.jsx("button",{type:"button",onClick:()=>void Tt(De,!0),children:l("knowledge.retryLoading")})]}):F?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:w,actions:De.canManage?o.jsxs(o.Fragment,{children:[o.jsx(It,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>Ce(De),children:l("common.delete")}),o.jsx(It,{type:"button",color:"primary",size:"lg",pill:!1,onClick:()=>z(!0),children:l("common.edit")})]}):void 0}):o.jsxs(o.Fragment,{children:[o.jsxs(t0,{className:"knowledge-library__toolbar library-resource-toolbar",children:[s,o.jsxs("div",{className:"resource-toolbar__actions",children:[a,o.jsx(hp,{value:x,onChange:qe=>O(qe.target.value),placeholder:l("knowledge.searchBases"),"aria-label":l("knowledge.searchBases")})]})]}),o.jsxs(Dg,{ref:Ke,"aria-live":"polite",onScroll:pt,children:[m.length>0&&!C&&o.jsxs("div",{className:"knowledge-region-warning",role:"status",children:[o.jsx("span",{children:l("knowledge.someBasesFailed")}),o.jsx("button",{type:"button",onClick:()=>void vt(),children:l("common.retry")})]}),C&&u.length===0?o.jsx(Ka,{}):N?o.jsxs("div",{className:"knowledge-library__state is-error",role:"alert",children:[o.jsx("p",{children:N}),o.jsx("button",{type:"button",onClick:()=>void vt(),children:l("common.retry")})]}):Nt.length===0&&x.trim()?o.jsxs("div",{className:"knowledge-library__state",children:[o.jsx(yPt,{}),o.jsx("p",{children:l("knowledge.noMatchingBases")})]}):o.jsxs(i0,{children:[x.trim()?null:o.jsx(pg,{"aria-label":l("knowledge.createBase"),icon:o.jsx(wPt,{}),onClick:()=>X(!0),children:l("knowledge.createBase")}),Nt.map(qe=>o.jsx(s0,{className:"knowledge-card",title:qe.name,description:qe.description||l("common.noDescription"),metadata:[{label:l("knowledge.creator"),value:d3(qe.ownerLabel),title:d3(qe.ownerLabel)},{label:l("knowledge.project"),value:qe.projectName||"default",title:qe.projectName||"default"}],action:{label:H===He(qe)?l("knowledge.associationInvalid"):l("knowledge.addData"),icon:"plus",disabled:!qe.canManage||H===He(qe),title:qe.canManage?H===He(qe)?l("knowledge.providerMissing"):void 0:l("knowledge.noManagePermission"),onClick:()=>ae(qe)},detailAction:{label:l("common.viewDetails"),onClick:()=>v(He(qe))}},He(qe)))]}),ft||R?o.jsx("div",{ref:Ze,className:"my-agent-load-more",role:"status","aria-live":"polite",children:R?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:l("knowledge.loadingMoreBases")})]}):ft?o.jsx("span",{children:l("skillCenter.scrollForMore")}):null}):null]})]}),Q&&o.jsx(TPt,{region:t,onClose:()=>X(!1),onCreated:qe=>{d(Ie=>[qe,...Ie]),v(He(qe)),X(!1)}}),De&&ne&&o.jsx(APt,{item:De,onClose:()=>z(!1),onUpdated:qe=>{jt(qe),z(!1)}}),De&&Ee&&o.jsx(BPt,{base:De,item:Ee,onClose:()=>Z(null)}),Y&&o.jsx(_Pt,{base:Y,onClose:()=>ae(null),onAssociationInvalid:qe=>{K(He(Y)),De&&He(De)===He(Y)&&L(sl(qe,l("knowledge.associationInvalid"))),ae(null)},onCreated:()=>{De&&He(De)===He(Y)&&Tt(De),ae(null)}}),De&&G&&o.jsx(jPt,{base:De,item:G,onClose:()=>te(null),onUpdated:qe=>{const Ie=Ue.current.map(We=>We.id===qe.id?qe:We);Ue.current=Ie,_(Ie),te(null)}}),de&&o.jsx(Xu,{title:l("knowledge.deleteBaseTitle"),description:l("knowledge.deleteBaseDescription",{name:de.name}),confirmLabel:l(ce?"common.deleting":"common.delete"),variant:"danger",busy:ce,onCancel:()=>Ce(null),onConfirm:()=>void qt()}),le&&o.jsx(Xu,{title:l("knowledge.deleteDocumentTitle"),description:l("knowledge.deleteDocumentDescription",{name:le.name||le.id}),confirmLabel:l(ce?"common.deleting":"common.delete"),variant:"danger",busy:ce,onCancel:()=>fe(null),onConfirm:()=>void ln()})]})}const QPt="_EmptyMessage_1r5gu_1",zPt="_IconBadge_1r5gu_16",VPt="_Title_1r5gu_54",HPt="_Description_1r5gu_69",qPt="_ActionRow_1r5gu_77",lT={EmptyMessage:QPt,IconBadge:zPt,Title:VPt,Description:HPt,ActionRow:qPt},Rn=({children:e,className:t,fill:n="static"})=>o.jsx("div",{className:ji(lT.EmptyMessage,t),"data-fill":n,children:e}),WPt=({size:e="md",color:t="secondary",children:n,className:i})=>o.jsx("div",{className:ji(lT.IconBadge,i),"data-size":e,"data-color":t,children:n}),KPt=({children:e,className:t,color:n="secondary"})=>o.jsx("div",{className:ji(lT.Title,t),"data-color":n,children:e}),GPt=({children:e,className:t})=>o.jsx("div",{className:ji(lT.Description,t),children:e}),XPt=({children:e,className:t})=>o.jsx("div",{className:ji(lT.ActionRow,t),children:e});Rn.Icon=WPt;Rn.Title=KPt;Rn.Description=GPt;Rn.ActionRow=XPt;const YPt={name:"studio_share_space"},ZPt={name:"studio_review_space"},UMe={share:YPt,review:ZPt},JPt=UMe.share.name,QMe=UMe.review.name,eDt=[JPt,QMe];function zMe(e){return eDt.includes(e.trim().toLowerCase())}function tDt(e){return e.name===QMe}const nDt="/web/skill-management";class _V 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 Bl(e,t={},n=Ga){return fetch(ia(`${nDt}${e}`),{...t,headers:Fl(hu(t.headers)),signal:Xa(t.signal,n)})}async function uD(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 _V(n,e.status,i,e.statusText,r,s)}async function Ul(e,t){if(!e.ok)throw await uD(e,t);return e.json()}async function iDt(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),Ul(await Bl(`/spaces?${t}`,{signal:e.signal}),V("skills.listSpacesFailed"))}async function rDt(e){if(zMe(e.name))throw new _V(V("skills.reservedSpaceName"),409,"SKILL_SPACE_RESERVED_IDENTITY");return Ul(await Bl("/spaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),V("skills.createSpaceFailed"))}async function sDt(e){const t=new URLSearchParams({region:e.region});return Ul(await Bl(`/shared-space/ensure?${t}`,{method:"POST",signal:e.signal}),V("skills.sharedSpaceFailed"))}async function oDt(e){return Ul(await Bl(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/review`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({region:e.region,version:e.version})},vr),V("skills.submitReviewFailed"))}async function aDt(e){const t=new URLSearchParams({region:e.region});return Ul(await Bl(`/reviews?${t}`,{signal:e.signal}),V("skills.listReviewsFailed"))}async function lDt(e){const t=new URLSearchParams({region:e.region});return Ul(await Bl(`/reviews/${encodeURIComponent(e.id)}/files?${t}`,{signal:e.signal},vr),V("skills.reviewFilesFailed"))}async function cDt(e){return Ul(await Bl(`/reviews/${encodeURIComponent(e.id)}/decision`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({region:e.region,decision:e.decision,reason:e.reason||"",comment:e.comment||""})},vr),V("skills.decideReviewFailed"))}async function uDt(e){const t=new URLSearchParams({region:e.region});return Ul(await Bl(`/spaces/${encodeURIComponent(e.spaceId)}/reviews?${t}`,{signal:e.signal}),V("skills.listReviewsFailed"))}async function dDt(e){if(zMe(e.name))throw new _V(V("skills.reservedSpaceName"),409,"SKILL_SPACE_RESERVED_IDENTITY");return Ul(await Bl(`/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 fDt(e){const t=new URLSearchParams({region:e.region});await Ul(await Bl(`/spaces/${encodeURIComponent(e.spaceId)}?${t}`,{method:"DELETE"}),V("skills.deleteSpaceFailed"))}async function hDt(e){const t=new URLSearchParams({region:e.region});return e.project&&t.set("project",e.project),Ul(await Bl(`/spaces/${encodeURIComponent(e.spaceId)}/skills?${t}`,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},vr),V("skills.uploadFailed"))}async function pDt(e){return Ul(await Bl("/validate",{method:"POST",headers:{"Content-Type":"application/zip"},body:e},vr),V("skills.validateFailed"))}async function mDt(e){const t=new URLSearchParams({region:e.region});await Ul(await Bl(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}?${t}`,{method:"DELETE"}),V("skills.deleteFailed"))}async function VMe(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 Ul(await Bl(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/files?${t}`),V("skills.listFilesFailed"));return Array.isArray(n.files)?n.files:[]}async function gDt(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 Bl(`/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/archive?${t}`,{},vr);n.ok||await Ul(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)}function ac(e){var t;return((t=e==null?void 0:e.displayName)==null?void 0:t.trim())||(e==null?void 0:e.name)||""}async function dD(e){const t=await fetch(ia(e),{headers:Fl(hu({accept:"application/json"})),signal:Xa(void 0,Ga)});if(!t.ok)throw await uD(t,Gt("helpers.skills.agentKitRequestFailed"));return t.json()}async function HMe(){return((await dD("/web/skill-spaces")).items||[]).filter(t=>!tDt(t))}async function qMe(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await dD(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function bDt(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),dD(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`)}async function yDt(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 dD(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${c}`)}function vDt(e,t){const n=Bb(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 Bb(e){return e.skillId||e.skillName}function xDt(e,t,n="volcengine"){return n==="byteplus"?"":`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}mn.hasResourceBundle("en-US","skills")||mn.addResourceBundle("en-US","skills",Fhe,!0,!0);mn.hasResourceBundle("zh-CN","skills")||mn.addResourceBundle("zh-CN","skills",Qve,!0,!0);function tn(e,t={}){return mn.t(e,{...t,ns:"skills"})}const wDt="/web/skill-workbench";class $8 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 qu(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(tn("api.invalidFormat",{label:t}));return e}function sne(e,t){if(e!=null){if(typeof e!="string"||!e.trim()||e.trim().length>256)throw new Error(tn("api.invalidFormat",{label:t}));return e.trim()}}function ODt(e){if(e!=null){if(e==="pending"||e==="ready"||e==="failed"||e==="unknown")return e;throw new Error(tn("api.invalidFormat",{label:tn("api.recoveryStatus")}))}}async function Uf(e,t={},n=Ga){return fetch(ia(`${wDt}${e}`),{...t,headers:hu(t.headers),signal:Xa(t.signal,n)})}async function jV(e,t){var i;const n=await e.text().catch(()=>"");try{const r=qu(JSON.parse(n),tn("api.errorResponse")),s=r.detail&&typeof r.detail=="object"?qu(r.detail,tn("api.errorDetails")):r;return new $8(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])||tn("api.missingContentType");return new $8(tn("api.gatewayError",{fallback:t,status:e.status,contentType:r}),e.status,"SKILL_WORKBENCH_ERROR",!1,e.statusText,void 0,n)}}async function gg(e,t){if(!e.ok)throw await jV(e,t);const n=e.headers.get("content-type")??"";if(!n.includes("application/json")){const i=n.split(";",1)[0]||tn("api.missingContentType");throw new Error(tn("api.nonJson",{fallback:t,status:e.status,contentType:i}))}return e.json()}function kDt(e){return Array.isArray(e)?e.map(t=>{const n=qu(t,tn("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(tn("api.invalidActivity"));if(i==="tool"){if(typeof n.name!="string")throw new Error(tn("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(tn("api.invalidTextActivity"));return{id:n.id,kind:i,status:r,text:n.text}}):[]}function SDt(e){if(e==null)return;const t=qu(e,tn("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"||!HI(t.region)||typeof t.projectName!="string")throw new Error(tn("api.invalidFormat",{label:tn("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 EE(e){const t=qu(e,tn("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(tn("api.invalidFormat",{label:tn("api.task")}));const n=Array.isArray(t.files)?t.files.flatMap(l=>{const c=qu(l,tn("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(tn("api.unknownTaskState"));const r=sne(t.toolId,"Tool ID"),s=sne(t.sessionId,"Session ID"),a=ODt(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:kDt(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:SDt(t.publication)}:{}}}async function fD(e){const t=qu(await gg(await Uf("/capabilities",{signal:e}),tn("api.loadCapability")),tn("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 EDt(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 Uf(`/tasks/from-upload?${n}`,{method:"POST",body:e.file,headers:{"Content-Type":"application/zip"},signal:e.signal},vr);return EE(await gg(i,tn("api.startOptimization")))}const t=await Uf("/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},vr);return EE(await gg(t,tn("api.startTask")))}async function CDt(e,t){return EE(await gg(await Uf(`/tasks/${encodeURIComponent(e)}`,{signal:t}),tn("api.loadTask")))}async function f3(e,t,n){const i=new URLSearchParams;i.set("expected_revision",String(t));const r=qu(await gg(await Uf(`/tasks/${encodeURIComponent(e)}/artifact?${i.toString()}`,{signal:n}),tn("api.loadArtifact")),tn("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(tn("api.invalidFormat",{label:tn("api.artifact")}));const s=r.files.map(a=>{const l=qu(a,tn("api.artifactFile"));if(typeof l.path!="string"||typeof l.size!="number"||typeof l.content!="string")throw new Error(tn("api.invalidFormat",{label:tn("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 h3(e){const t=await Uf(`/tasks/${encodeURIComponent(e.jobId)}/refinements`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({intent:e.intent,expectedRevision:e.expectedRevision})},vr);return EE(await gg(t,tn("api.refine")))}async function TDt(e){const t=await Uf(`/tasks/${encodeURIComponent(e.jobId)}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedRevision:e.expectedRevision})});return EE(await gg(t,tn("api.stop")))}async function ADt(e){const t=await Uf(`/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 jV(t,tn("api.publish"));if(!(t.headers.get("content-type")??"").includes("application/x-ndjson"))throw new Error(tn("api.nonNdjson"));if(!t.body)throw new Error(tn("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=qu(JSON.parse(u),tn("api.publishProgress"));if(d.type==="progress"){if(typeof d.phase!="string"||!i.has(d.phase)||typeof d.message!="string")throw new Error(tn("api.invalidPublishProgress"));(h=e.onProgress)==null||h.call(e,{phase:d.phase,message:d.message});return}if(d.type==="error"){const m=qu(d.error,tn("api.publishError"));throw new $8(typeof m.message=="string"?m.message:tn("api.publish"),500,typeof m.code=="string"?m.code:"SKILL_PUBLISH_FAILED",m.retryable===!0,"",m.originalError&&typeof m.originalError=="object"?m.originalError:void 0,JSON.stringify(d.error))}if(d.type!=="complete")throw new Error(tn("api.unknownPublishEvent"));const f=qu(d.result,tn("api.publishResult"));if(typeof f.skillId!="string"||typeof f.version!="string"||!Array.isArray(f.skillSpaceIds)||!f.skillSpaceIds.every(m=>typeof m=="string")||f.disposition!=="create-new"&&f.disposition!=="update-source"||!HI(f.region)||typeof f.projectName!="string")throw new Error(tn("api.invalidFormat",{label:tn("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(tn("api.streamEnded"));return r}async function _Dt(e){await gg(await Uf(`/tasks/${encodeURIComponent(e)}`,{method:"DELETE"}),tn("api.deleteTask"))}async function jDt(e,t,n){var c;const i=new URLSearchParams;i.set("expected_revision",String(t)),i.set("expected_sha256",n);const r=await Uf(`/tasks/${encodeURIComponent(e)}/download?${i.toString()}`,{},vr);if(!r.ok)throw await jV(r,tn("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 WMe=p.createContext(void 0);function u0(e){const t=p.useContext(WMe);if(t===void 0&&!e)throw new Error(gc(47));return t}const NDt={...KAe,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class RDt extends nP{constructor(n,i,r){const s=new uQ;super(IDt(n,s,i,r),PDt(s),NDt);rn(this,"setOpen",(n,i)=>{var f,h;const r=i.reason===Qc,s=i.reason===Jx&&i.event.detail===0,a=!n&&(i.reason===aAe||i.reason==null),l=jnt(i),c=this.select("activeTriggerId");if(!n&&i.reason===oAe&&i.trigger==null&&c!=null&&(i.trigger=this.context.triggerElements.getById(c)??this.select("activeTriggerElement")??void 0),(h=(f=this.context).onOpenChange)==null||h.call(f,n,i),i.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,i);const u=()=>{const m={open:n,openChangeReason:i.reason};FAe(m,n,i.trigger,l()),this.update(m)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(rtt,()=>{this.set("stickIfOpen",!1)}),ri.flushSync(u)):u();let d;s?d="click":a?d="dismiss":i.reason===KS&&(d="focus"),this.set("instantType",d)})}}function IDt(e,t,n,i=!1){const r={...HAe(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return r.open&&(e==null?void 0:e.mounted)===void 0&&(r.mounted=!0),r.floatingRootContext=qAe(t,n,i),r}function PDt(e){return{popupRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:p.createRef(),beforeContentFocusGuardRef:p.createRef(),stickIfOpenTimeout:new du,triggerElements:e}}function one({props:e}){const{children:t,open:n,defaultOpen:i=!1,onOpenChange:r,onOpenChangeComplete:s,modal:a=!1,handle:l,triggerId:c,defaultTriggerId:u=null}=e,d=MDt(l,{modal:a,open:i,openProp:n,activeTriggerId:u,triggerIdProp:c});d.useControlledProp("openProp",n),d.useControlledProp("triggerIdProp",c);const f=d.useState("open"),h=d.useState("mounted"),m=d.useState("payload");d.useContextCallback("onOpenChange",r),d.useContextCallback("onOpenChangeComplete",s),VAe(d,f),UAe(d);const{forceUnmount:g}=QAe(f,d,()=>{d.update({stickIfOpen:!0,openChangeReason:null})});d.useSyncedValues({modal:a}),p.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]),p.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:()=>d.setOpen(!1,to(lAe))}),[g,d]);const b=f||h;return o.jsxs(WMe.Provider,{value:d,children:[l&&o.jsx($Ae,{handle:l,store:d}),b&&o.jsx(LDt,{store:d,modal:a}),typeof t=="function"?t({payload:m}):t]})}function DDt(e){return u0(!0)?o.jsx(one,{props:e}):o.jsx(Ltt,{children:o.jsx(one,{props:e})})}function MDt(e,t){const n=LAe((i,r)=>new RDt(t,i,r));return p.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function LDt({store:e,modal:t}){const n=e.useState("floatingRootContext"),i=xAe(n,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),r=i.reference,s=i.floating;return zAe(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:s}),null}const $Dt=300;function pp(e){return _C(e,"base-ui")}function FDt(e,t){const n=p.useRef(null);function i(s){ri.flushSync(()=>{e.setOpen(!1,to(KS,s.nativeEvent,s.currentTarget))});const a=Pet(n.current);a==null||a.focus()}function r(s){var l;const a=e.select("positionerElement");if(a&&sx(s,a))(l=e.context.beforeContentFocusGuardRef.current)==null||l.focus();else{ri.flushSync(()=>{e.setOpen(!1,to(KS,s.nativeEvent,s.currentTarget))});let c=Iet(e.context.triggerFocusTargetRef.current||t.current);for(;c!==null&&qn(a,c);){const u=c;if(c=eQ(c),c===u)break}c==null||c.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:i,handleFocusTargetFocus:r}}function BDt(e){const t=p.useRef(""),n=p.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:p.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r?e(r,r.pointerType):e(r,t.current),t.current=""},[e]),onPointerDown:n}}function KMe(e,t){const n=Gn((s,a)=>{(typeof e=="function"?e():e)||t(a||(aP?"touch":""))}),{onClick:i,onPointerDown:r}=BDt(n);return p.useMemo(()=>({onClick:i,onPointerDown:r}),[i,r])}const UDt=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:a=!1,nativeButton:l=!0,handle:c,payload:u,openOnHover:d=!1,delay:f=$Dt,closeDelay:h=0,id:m,...g}=t,b=u0(!0),y=GAe(c)??b;if(!y)throw new Error(gc(74));const w=pp(m),x=y.useState("isTriggerActive",w),O=y.useState("floatingRootContext"),S=y.useState("isOpenedByTrigger",w),k=y.useState("triggerPopupId",w),C=p.useRef(null),{registerTrigger:E,isMountedByThisTrigger:R}=BAe(w,C,y,{payload:u,disabled:a,openOnHover:d,closeDelay:h}),A=y.useState("openChangeReason"),N=y.useState("stickIfOpen"),T=y.useState("openMethod"),j=y.useState("focusManagerModal"),_=Lnt(O,{enabled:!a&&d&&(T!=="touch"||A!==Jx),mouseOnly:!0,move:!1,handleClose:Bnt(),restMs:f,delay:{close:h},triggerElementRef:C,isActiveTrigger:x,isClosing:()=>y.select("transitionStatus")==="ending"}),I=vAe(O,{stickIfOpen:N}),D=KMe(()=>y.select("open"),ne=>{y.set("openMethod",ne)}),P=y.useState("triggerProps",R),{getButtonProps:L,buttonRef:B}=dP({disabled:a,native:l}),M={open(ne){return ne&&A===Jx?eit.open(ne):JAe.open(ne)}},{preFocusGuardRef:H,handlePreFocusGuardFocus:K,handleFocusTargetFocus:F}=FDt(y,C),Q=Eo("button",t,{state:{disabled:a,open:S},ref:[B,n,E,C],props:[I.reference,_,P,D,{[oQ]:"",id:w,"aria-haspopup":"dialog","aria-expanded":S,"aria-controls":k},g,L],stateAttributesMapping:M}),X=o.jsx(p.Fragment,{children:Q},w);return R&&!j?o.jsxs(p.Fragment,{children:[o.jsx(vy,{ref:H,onFocus:K}),X,o.jsx(vy,{ref:y.context.triggerFocusTargetRef,onFocus:F})]}):X}),GMe=p.createContext(void 0);function QDt(){const e=p.useContext(GMe);if(e===void 0)throw new Error(gc(45));return e}const zDt=p.forwardRef(function(t,n){const{keepMounted:i=!1,...r}=t;return u0().useState("mounted")||i?o.jsx(GMe.Provider,{value:i,children:o.jsx(fAe,{ref:n,...r})}):null}),XMe=p.createContext(void 0);function VDt(){const e=p.useContext(XMe);if(!e)throw new Error(gc(46));return e}const YMe=p.forwardRef(function(t,n){const{cutout:i,...r}=t;let s;if(i){const a=i.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${a.left}px ${a.top}px,${a.left}px ${a.bottom}px,${a.right}px ${a.bottom}px,${a.right}px ${a.top}px,${a.left}px ${a.top}px)`}return o.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});let ane={},lne={},cne="";function hD(e,t){return CC(e)?e:t}function une(e,t,n){return/hidden|clip/.test(e.getComputedStyle(hD(t,n)).overflowY)}function HDt(e){if(typeof document>"u")return!1;const t=fr(e);return Ws(t).innerWidth-t.documentElement.clientWidth>0}function qDt(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=fr(e),i=n.documentElement,r=n.body,s=hD(i,r),a=s.style.overflowY,l=i.style.scrollbarGutter;i.style.scrollbarGutter="stable",s.style.overflowY="scroll";const c=s.offsetWidth;s.style.overflowY="hidden";const u=s.offsetWidth;return s.style.overflowY=a,i.style.scrollbarGutter=l,c===u}function WDt(e){const t=fr(e),n=t.documentElement,i=t.body,r=hD(n,i),s={overflowY:r.style.overflowY,overflowX:r.style.overflowX};return Object.assign(r.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(r.style,s)}}function KDt(e){var m;const t=fr(e),n=t.documentElement,i=t.body,r=Ws(n);let s=0,a=0,l=!1;const c=ec.create();if(Vw&&(((m=r.visualViewport)==null?void 0:m.scale)??1)!==1)return()=>{};function u(){const g=r.getComputedStyle(n),b=r.getComputedStyle(i),w=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,a=n.scrollLeft,ane={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},cne=n.style.scrollBehavior,lne={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};const x=n.scrollHeight>n.clientHeight,O=n.scrollWidth>n.clientWidth,S=g.overflowY==="scroll"||b.overflowY==="scroll",k=g.overflowX==="scroll"||b.overflowX==="scroll",C=Math.max(0,r.innerWidth-i.clientWidth),E=Math.max(0,r.innerHeight-i.clientHeight),R=parseFloat(b.marginTop)+parseFloat(b.marginBottom),A=parseFloat(b.marginLeft)+parseFloat(b.marginRight),N=hD(n,i);if(l=qDt(e),l){n.style.scrollbarGutter=w,N.style.overflowY="hidden",N.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:w,overflowY:"hidden",overflowX:"hidden"}),(x||S)&&(n.style.overflowY="scroll"),(O||k)&&(n.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:R||E?`calc(100dvh - ${R+E}px)`:"100dvh",width:A||C?`calc(100vw - ${A+C}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),i.scrollTop=s,i.scrollLeft=a,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,ane),Object.assign(i.style,lne),l||(n.scrollTop=s,n.scrollLeft=a,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=cne)}function f(){d(),c.request(u)}u();const h=yi(r,"resize",f);return()=>{c.cancel(),d(),typeof r.removeEventListener=="function"&&h()}}class GDt{constructor(){rn(this,"lockCount",0);rn(this,"restore",null);rn(this,"timeoutLock",du.create());rn(this,"timeoutUnlock",du.create());rn(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});rn(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const n=fr(t),i=n.documentElement,r=n.body,s=Ws(i);if(une(s,i,r)){const l=new s.MutationObserver(()=>{une(s,i,r)||(l.disconnect(),this.restore=null,this.lock(t))}),c={attributes:!0};l.observe(i,c),l.observe(r,c),this.restore=()=>l.disconnect();return}const a=aP||!HDt(t);this.restore=a?WDt(t):KDt(t)}}const XDt=new GDt;function ZMe(e=!0,t=null){Qn(()=>{if(e)return XDt.acquire(t)},[e,t])}const YDt=20;function ZDt(e,t,n,i){const[r,s]=p.useState(!1);Qn(()=>{if(!e||!t||n==null){s(!1);return}const a=fr(n).documentElement.clientWidth,l=n.offsetWidth;s(a>0&&l>0&&l>=a-YDt)},[e,t,n]),ZMe(e&&(!t||r),i)}const JDt=p.forwardRef(function(t,n){const{render:i,className:r,style:s,anchor:a,positionMethod:l,side:c,align:u,sideOffset:d,alignOffset:f,collisionBoundary:h="clipping-ancestors",collisionPadding:m,arrowPadding:g,sticky:b,disableAnchorTracking:v=!1,collisionAvoidance:y=utt,...w}=t,x=u0(),O=QDt(),S=Dtt(),k=x.useState("floatingRootContext"),C=x.useState("mounted"),E=x.useState("open"),R=x.useState("openChangeReason"),A=x.useState("activeTriggerElement"),N=x.useState("modal"),T=x.useState("openMethod"),j=x.useState("positionerElement"),_=x.useState("instantType"),I=x.useState("transitionStatus"),D=x.useState("adaptiveOrigin"),P=p.useRef(null),L=sQ(j),B=Wnt({anchor:a,floatingRootContext:k,positionMethod:l,mounted:C,side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:g,collisionBoundary:h,collisionPadding:m,sticky:b,disableAnchorTracking:v,keepMounted:O,nodeId:S,collisionAvoidance:y,adaptiveOrigin:D}),M=k.useState("domReferenceElement");Qn(()=>{const Q=M,X=P.current;if(Q&&(P.current=Q),X&&Q&&Q!==X){x.set("instantType",void 0);const ne=new AbortController;return L(()=>{x.set("instantType","trigger-change")},ne.signal),()=>{ne.abort()}}},[M,L,x]);const H=N===!0&&R!==Qc;ZDt(E&&H,T==="touch",j,A);const K=x.useStateSetter("positionerElement"),F={open:E,side:B.side,align:B.align,anchorHidden:B.anchorHidden,instant:_},q=tit(t,F,{styles:B.positionerStyles,transitionStatus:I,props:w,refs:[n,K],hidden:!C,inert:!E});return o.jsxs(XMe.Provider,{value:B,children:[C&&H&&o.jsx(YMe,{inert:rQ(!E),cutout:A}),o.jsx(Mtt,{id:S,children:q})]})}),eMt="ArrowUp",tMt="ArrowDown",nMt="ArrowLeft",iMt="ArrowRight",rMt="Home",sMt="End",JMe=new Set([eMt,tMt,nMt,iMt,rMt,sMt]),oMt=p.createContext(void 0);function aMt(e){return p.useContext(oMt)}const lMt=p.createContext(void 0);function cMt(){const[e,t]=p.useState(0),n=Gn(()=>(t(r=>r+1),()=>{t(r=>Math.max(0,r-1))}));return{context:p.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const uMt=p.forwardRef(function(t,n){const{render:i,className:r,style:s,initialFocus:a,finalFocus:l,...c}=t,u=u0(),d=VDt(),f=aMt()!=null,{context:h,hasClosePart:m}=cMt(),g=u.useState("open"),b=u.useState("openMethod"),v=u.useState("instantType"),y=u.useState("transitionStatus"),w=u.useState("popupProps"),x=u.useState("titleElementId"),O=u.useState("descriptionElementId"),S=u.useState("modal"),k=u.useState("mounted"),C=u.useState("openChangeReason"),E=u.useState("activeTriggerElement"),R=u.useState("floatingRootContext"),A=R.useState("floatingId"),N=u.useState("disabled"),T=u.useState("openOnHover"),j=u.useState("closeDelay");AC({open:g,ref:u.context.popupRef,onComplete(){var B,M;g&&((M=(B=u.context).onOpenChangeComplete)==null||M.call(B,!0))}}),Dnt(R,{enabled:T&&!N,closeDelay:j});const _=a===void 0?MAe(u.context.popupRef):a,I=S!==!1&&m;u.useSyncedValue("focusManagerModal",I);const D=u.useStateSetter("popupElement"),P={open:g,side:d.side,align:d.align,instant:v,transitionStatus:y},L=Eo("div",t,{state:P,ref:[n,u.context.popupRef,D],props:[w,{id:A,role:"dialog",...DAe,"aria-labelledby":x,"aria-describedby":O,onKeyDown(B){f&&JMe.has(B.key)&&B.stopPropagation()}},t2e(y),c],stateAttributesMapping:e2e});return o.jsx(yAe,{context:R,openInteractionType:b,modal:I,disabled:!k||C===Qc,initialFocus:_,returnFocus:l,restoreFocus:"popup",previousFocusableElement:Hs(E)?E:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:o.jsx(lMt.Provider,{value:h,children:L})})}),dMt=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...a}=t,l=u0(),c=pp(a.id);return l.useSyncedValueWithCleanup("titleElementId",c),Eo("h2",t,{ref:n,props:[{id:c},a]})}),fMt=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...a}=t,l=u0(),c=pp(a.id);return l.useSyncedValueWithCleanup("descriptionElementId",c),Eo("p",t,{ref:n,props:[{id:c},a]})});function dne(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 hMt(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 NV(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 pMt(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 mMt(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 gMt(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 bMt(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 yMt(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 vMt(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 fne(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 xMt(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 wMt(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 hne(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 l1(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 OMt({value:e}){const{t,i18n:n}=_e("adk"),[i,r]=p.useState(!1),s=f=>f==null?t("developmentRuns.notReported"):f.toLocaleString(n.resolvedLanguage||n.language),a=OTe,l=e.usage,c=(l==null?void 0:l.inputTokens)!=null&&l.cachedInputTokens!=null&&l.cachedInputTokens<=l.inputTokens?l.inputTokens-l.cachedInputTokens:void 0,u=l!=null&&l.inputTokens&&l.cachedInputTokens!=null&&c!=null?`${(l.cachedInputTokens/l.inputTokens*100).toFixed(1)}%`:void 0,d=[["inputTokens",l==null?void 0:l.inputTokens],["cachedInputTokens",l==null?void 0:l.cachedInputTokens],["uncachedInputTokens",c],["cacheWriteInputTokens",l==null?void 0:l.cacheWriteInputTokens],["outputTokens",l==null?void 0:l.outputTokens],["reasoningOutputTokens",l==null?void 0:l.reasoningOutputTokens]];return o.jsxs("div",{className:"development-turn-summary","data-turn-id":e.turnId,children:[o.jsx("span",{children:t(`developmentRuns.turnStatus.${e.status}`)}),o.jsx("span",{children:t("developmentRuns.toolCalls",{count:e.toolCalls})}),o.jsx("span",{children:t("developmentRuns.turnDuration",{duration:a(e.durationMs)})}),o.jsx("span",{title:t("developmentRuns.toolDurationHelp"),children:t(e.toolDurationComplete?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:a(e.toolDurationMs)})}),o.jsxs(DDt,{open:i,onOpenChange:r,children:[o.jsxs(UDt,{className:"development-token-trigger",openOnHover:!0,delay:150,closeDelay:150,onFocus:f=>{f.currentTarget.matches(":focus-visible")&&r(!0)},children:[o.jsx("span",{children:"Tokens"}),o.jsx("span",{className:"development-token-value",children:s(l==null?void 0:l.totalTokens)}),e.usageIncomplete&&o.jsxs("span",{children:["· ",t("developmentRuns.partial")]}),o.jsx(l1,{className:"development-token-chevron"})]}),o.jsx(zDt,{children:o.jsx(JDt,{side:"top",align:"end",sideOffset:8,className:"development-token-positioner",children:o.jsxs(uMt,{className:"development-token-popup",initialFocus:!1,finalFocus:!1,children:[o.jsx(dMt,{className:"development-token-title",children:t("developmentRuns.tokenDetails")}),o.jsxs("dl",{children:[o.jsxs("div",{children:[o.jsx("dt",{children:t("developmentRuns.model")}),o.jsx("dd",{children:e.model||t("developmentRuns.notReported")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:t("developmentRuns.totalTokens")}),o.jsx("dd",{children:s(l==null?void 0:l.totalTokens)})]}),d.map(([f,h])=>o.jsxs("div",{children:[o.jsx("dt",{children:t(`developmentRuns.${f}`)}),o.jsx("dd",{children:s(h)})]},f)),o.jsxs("div",{children:[o.jsx("dt",{children:t("developmentRuns.cacheHitRate")}),o.jsx("dd",{children:u||t("developmentRuns.notReported")})]})]}),o.jsxs(fMt,{className:"development-token-note",children:[t("developmentRuns.tokenHelp"),e.usageIncomplete?` ${t("developmentRuns.partialHelp")}`:""]})]})})})]})]})}function RV(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 pD({kind:e,...t}){return e==="thinking"?o.jsx(RV,{...t}):o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:e==="tool"?o.jsxs(o.Fragment,{children:[o.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"3"}),o.jsx("path",{d:"m7 9 3 3-3 3m6 0h4"})]}):e==="plan"?o.jsxs(o.Fragment,{children:[o.jsx("path",{d:"m4 7 1.5 1.5L8 6m-4 7 1.5 1.5L8 12M11 7h9m-9 6h9m-9 6h9"}),o.jsx("circle",{cx:"6",cy:"19",r:"1"})]}):o.jsx(o.Fragment,{children:o.jsx("path",{d:"M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9zM14 3v6h6M8 13h8m-4-3v6M8 18h8"})})})}function kMt({blocks:e,active:t,status:n,render:i}){const{t:r}=_e("adk"),[s,a]=p.useState(!1),l=[...e].reverse().find(h=>"done"in h&&!h.done),c=e.filter(h=>h.kind==="tool"),u=c.filter(h=>h.durationMs!=null),d=u.reduce((h,m)=>h+(m.durationMs||0),0);let f=r("developmentRuns.processSummary",{count:e.length});return t&&(f=n||((l==null?void 0:l.kind)==="thinking"?r("developmentRuns.thinking"):(l==null?void 0:l.kind)==="tool"?kTe(l):(l==null?void 0:l.kind)==="plan"?r("developmentRuns.plan"):(l==null?void 0:l.kind)==="diff"?r("developmentRuns.diff"):r("developmentRuns.processing"))),o.jsxs("section",{className:"development-process",children:[o.jsxs("button",{type:"button",className:"development-process__toggle","aria-expanded":s,onClick:()=>a(!s),children:[o.jsx(l1,{className:`tool-chevron${s?" is-open":""}`}),o.jsx("span",{className:"tool-icon",children:o.jsx(pD,{kind:(l==null?void 0:l.kind)==="thinking"||(l==null?void 0:l.kind)==="plan"||(l==null?void 0:l.kind)==="diff"?l.kind:"tool"})}),t?o.jsx(bn,{className:"development-process__title","aria-live":"polite",children:f}):o.jsx("span",{className:"development-process__title",children:f}),!t&&c.length>0&&o.jsxs("span",{className:"development-process__duration",children:[r("developmentRuns.toolCalls",{count:c.length}),u.length>0?` · ${r(u.length===c.length?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:OTe(d)})}`:""]})]}),o.jsx("div",{className:"development-process__items",hidden:!s,children:i(e)})]})}function SMt({blocks:e,active:t,status:n="",render:i}){const{t:r}=_e("adk"),s=EJe(e),a=s[s.length-1],l=[...e].reverse().find(u=>u.kind==="progress"),c=n||((l==null?void 0:l.kind)==="progress"?l.text:"");return o.jsxs(o.Fragment,{children:[s.map(u=>u.process?o.jsx(kMt,{blocks:u.blocks,active:t&&u===a,status:c,render:i},u.id):o.jsx("div",{"data-assistant-phase":u.blocks[0].phase,children:i(u.blocks)},u.id)),t&&!(a!=null&&a.process)&&o.jsxs("div",{className:"development-process__status",role:"status",children:[o.jsx("span",{className:"tool-icon",children:o.jsx(pD,{kind:"thinking"})}),o.jsx(bn,{children:c||r("developmentRuns.processing")})]})]})}const EMt={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 CMt(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 TMt(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function AMt(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function IV(e,t){if(TMt(e))return CMt(t,e.path);if(AMt(e)){const n=EMt[e.call],i={};for(const[r,s]of Object.entries(e.args??{}))i[r]=IV(s,t);return n?n(i):`[unknown fn: ${e.call}]`}return e}function _Mt(e,t){const n=IV(e,t);return n==null?"":typeof n=="string"?n:String(n)}const e5e=new Map;function d0(e,t){e5e.set(e,t)}function jMt(e){return e5e.get(e)}function NMt(e,t,n){const i=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(let s=0;sIV(i,e.dataModel),resolveString:i=>_Mt(i,e.dataModel),dispatchAction:t,render:i=>{if(!i)return null;const r=e.components[i];if(!r)return null;const s=jMt(r.component)??RMt;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 n5e(e){const t=p.useRef(null),n=p.useRef(!0),i=28,r=p.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 mD({value:e,skillPrefix:t="/",onRemoveSkill:n,onRemoveAgent:i}){const{t:r}=_e("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(ZS,{"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(Ta,{})}):null]},s.name)),e.targetAgent?o.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[o.jsx(p2e,{"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(Ta,{})}):null]}):null]})}function PV(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function i5e(e){var n,i,r,s;const t=PV(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 r5e(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function s5e(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?iCe(t,e.uri):""}function PMt({kind:e}){return e==="image"?o.jsx(yQ,{}):e==="video"?o.jsx(g2e,{}):e==="pdf"?o.jsx(irt,{}):o.jsx(gQ,{})}function gD({appName:e,items:t,compact:n=!1,onRemove:i}){const{t:r}=_e("conversation"),[s,a]=p.useState(null);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(l=>{const c=PV(l.mimeType),u=s5e(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(mrt,{})})]}):o.jsx("span",{className:"media-card-icon",children:o.jsx(PMt,{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:i5e(l)}),l.status==="uploading"?o.jsxs(o.Fragment,{children:[o.jsx(Bi,{className:"media-card-spinner"})," ",r("media.uploading")]}):l.status==="error"?l.error??r("media.uploadFailed"):r5e(l.sizeBytes)]})]}),!n&&l.status!=="uploading"&&l.status!=="error"?o.jsx(ax,{className:"media-card-open"}):null]});return o.jsxs(mr.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(AEe,{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(Ta,{})}):null]},l.id)})}),o.jsx(_d,{children:s?o.jsx(DMt,{appName:e,item:s,onClose:()=>a(null)}):null})]})}function DMt({appName:e,item:t,onClose:n}){const{t:i}=_e("conversation"),r=p.useMemo(()=>s5e(t,e),[e,t]),s=PV(t.mimeType),[a,l]=p.useState(""),[c,u]=p.useState(s==="text"||s==="markdown"),[d,f]=p.useState("");return p.useEffect(()=>{const h=m=>{m.key==="Escape"&&n()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[n]),p.useEffect(()=>{if(s!=="text"&&s!=="markdown")return;const h=new AbortController;return u(!0),f(""),fetch(r,{signal:h.signal}).then(m=>{if(!m.ok)throw new Error(`HTTP ${m.status}`);return m.text()}).then(l).catch(m=>{h.signal.aborted||f(m instanceof Error?m.message:String(m))}).finally(()=>{h.signal.aborted||u(!1)}),()=>h.abort()},[s,r]),o.jsx(mr.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(mr.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:[i5e(t),t.sizeBytes?` · ${r5e(t.sizeBytes)}`:""]})]}),o.jsxs("nav",{children:[o.jsx("a",{href:r,download:t.name,"aria-label":i("media.download"),children:o.jsx(bP,{})}),o.jsx("button",{type:"button",onClick:n,"aria-label":i("media.close"),children:o.jsx(Ta,{})})]})]}),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(Bi,{})," ",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(Zu,{text:a})}):null,!c&&s==="text"?o.jsx("pre",{className:"media-document media-document--plain",children:a}):null]})]})})}function MMt({definition:e,label:t,done:n,open:i,onToggle:r}){const{t:s}=_e("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(bn,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:c}),o.jsx(l1,{className:`builtin-tool-chevron${i?" is-open":""}`})]})}function su(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Nn(e){return typeof e=="string"?e:""}function pne(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function Pu(e){return Array.isArray(e)?e:[]}function F8(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return{}}const n=su(t)??{};return su(n.result)??n}function bD(e){if(typeof e=="string")try{return bD(JSON.parse(e))}catch{return e}const t=su(e);if(!t)return"";const n=su(t.result);return Nn(t.error)||Nn(t.message)||Nn(n==null?void 0:n.error)||Nn(n==null?void 0:n.message)}function LMt(e){if(e.kind==="tool")return"tool";if(e.kind==="knowledge_base")return"knowledge_base";const t=su(e.metadata),n=Nn(t==null?void 0:t.source_type).toLowerCase(),i=Nn(e.source).toLowerCase();return n==="skillhub"||i.startsWith("skill_hub:")?"skill_hub":"skill_space"}const o5e={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function $Mt(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 FMt(e){return e==="veadk_builtin_tools"?"tool":e==="agentkit_knowledge"?"knowledge_base":e.startsWith("skill_hub:")?"skill_hub":"skill_space"}function BMt(e,t=o5e){const n=F8(e),i=su(n.capabilities)??{},r=Pu(n.resources).flatMap(a=>{const l=su(a);if(!l)return[];const c=l.kind==="tool"?"tool":l.kind==="knowledge_base"?"knowledge_base":"skill";return[{ref:Nn(l.ref),kind:c,category:LMt(l),name:Nn(l.name)||Nn(l.ref)||t.unnamedResource,description:Nn(l.description),source:Nn(l.source),version:Nn(l.version)}]}),s=Pu(n.sources).flatMap(a=>{const l=su(a);if(!l)return[];const c=Nn(l.source),u=Nn(l.status),d=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:c,category:FMt(c),label:$Mt(c,t),status:d,count:pne(l.count),message:Nn(l.message),searchKeywords:Pu(l.search_keywords).map(Nn).filter(Boolean)}]});return{collectionId:Nn(n.collection_id),capabilities:{googleAdkVersion:Nn(i.google_adk_version),agentTypes:Pu(i.agent_types).map(Nn).filter(Boolean),maxOrchestrationDepth:pne(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 UMt(e,t){return{resources:e.resources.filter(n=>n.category===t),sources:e.sources.filter(n=>n.category===t)}}function a5e(e,t,n=o5e){const i=F8(e),r=F8(t),s=new Map(Pu(r.results).flatMap(d=>{const f=su(d),h=Nn(f==null?void 0:f.name);return f&&h?[[h,f]]:[]})),a=Pu(i.agents).flatMap(d=>{const f=su(d),h=Nn(f==null?void 0:f.name);return f&&h?[f]:[]}),l=new Set(a.map(d=>Nn(d.name))),c=[...s.entries()].filter(([d])=>!l.has(d)).map(([d])=>({name:d})),u=[...a,...c].map(d=>{const f=Nn(d.name),h=Pu(d.nodes).flatMap(C=>{const E=su(C);return E?[E]:[]}),m=Nn(d.root_node),g=h.find(C=>Nn(C.id)===m),b=h.filter(C=>Nn(C.id)!==m).map(C=>({id:Nn(C.id)||n.unnamedAgent,type:Nn(C.type)||"llm",description:Nn(C.description)})),v=s.get(f),y=Nn(v==null?void 0:v.status),w=y==="failed"?"failed":y==="completed"?"completed":"running",x=mne(v==null?void 0:v.resources),O=x.length>0?x:mne(h.flatMap(C=>Pu(C.resources))),S=gne(v==null?void 0:v.python_tools),k=S.length>0?S:gne(h.flatMap(C=>Pu(C.python_tools)));return{name:f,description:Nn(v==null?void 0:v.description)||Nn(g==null?void 0:g.description)||Nn(d.task),task:Nn(d.task),rootType:Nn(v==null?void 0:v.root_type)||Nn(g==null?void 0:g.type)||"llm",nodeCount:h.length,subAgentCount:b.length,resourceCount:O.length,pythonToolCount:k.length,skills:O.filter(C=>C.kind==="skill"),knowledgeBases:O.filter(C=>C.kind==="knowledge_base"),builtinTools:O.filter(C=>C.kind==="tool"),pythonTools:k,subAgents:b,status:w,output:Nn(v==null?void 0:v.output),error:Nn(v==null?void 0:v.error)}});return{collectionId:Nn(r.collection_id)||Nn(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 QMt(e,t){return!!bD(t)||a5e(e,t).failedCount>0}function mne(e){const t=new Set;return Pu(e).flatMap(n=>{const i=su(n),r=Nn(i?i.ref:n);if(!r||t.has(r))return[];t.add(r);const s=Nn(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:Nn(i==null?void 0:i.name)||l[l.length-1]||r,description:Nn(i==null?void 0:i.description),version:Nn(i==null?void 0:i.version),source:Nn(i==null?void 0:i.source)}]})}function gne(e){const t=new Set;return Pu(e).flatMap(n=>{const i=su(n),r=Nn(i==null?void 0:i.name),s=Nn(i==null?void 0:i.code),a=`${r}\0${s}`;return!i||!r||t.has(a)?[]:(t.add(a),[{name:r,description:Nn(i.description),code:s,entrypoint:Nn(i.entrypoint)||r,dependencies:Pu(i.dependencies).map(Nn).filter(Boolean)}])})}function zMt({branch:e}){return o.jsxs("div",{className:`branch-compare__body${e.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[e.content?o.jsx(Zu,{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 VMt({args:e,response:t,status:n,onBranchSelect:i}){const{t:r}=_e("conversation"),s=p.useMemo(()=>O2e(e,t,n),[e,t,n]),[a,l]=p.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(zo,{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(zo,{color:"info",size:"sm",variant:"soft",children:c.label})}),o.jsx(zMt,{branch:c}),o.jsx("footer",{className:"branch-compare__footer",children:o.jsx(It,{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 l5e({controlled:e,default:t,name:n,state:i="value"}){const{current:r}=p.useRef(e!==void 0),[s,a]=p.useState(t),l=r?e:s,c=p.useCallback(u=>{r||a(u)},[]);return[l,c]}const c5e=p.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function HMt(){return p.useContext(c5e)}function qMt(e){const{children:t,elementsRef:n,labelsRef:i,onMapChange:r}=e,s=Gn(r),[,a]=p.useState(!1),l=Gu(KMt).current,c=Gu(WMt).current,u=p.useRef(0),d=p.useRef(!0),f=p.useRef([]),h=p.useRef(null),m=Gn(()=>{d.current||(d.current=!0,a(S=>!S))}),g=Gn((S,k)=>{c.set(S,k),m()}),b=Gn(S=>{c.delete(S),m()}),v=Gn(S=>{const k=new Map;return n.current.length=0,i&&(i.current.length=0),S.forEach(C=>{var E,R;k.set(C.element,{...C.registration.metadata??{},index:C.index}),n.current[C.index]=C.element,i&&(i.current[C.index]=C.registration.label!==void 0?C.registration.label:((R=(E=C.registration.textRef)==null?void 0:E.current)==null?void 0:R.textContent)??C.element.textContent)}),u.current=n.current.length,k});function y(S){var E;if((E=h.current)==null||E.disconnect(),h.current=null,typeof MutationObserver!="function"||S.length<2)return;const k=new MutationObserver(R=>{if(!YMt(R))return;let A=null;for(const N of S)if(N.isConnected){if(A&&u5e(A,N)>0){k.disconnect(),m();return}A=N}});h.current=k;const C=new Set;for(let R=1;Rk.observe(R,{childList:!0}))}const w=Gn(()=>{const[S,k]=GMt(c),C=v(S);y(k),f.current=S,d.current=!1,l.forEach(E=>E(C)),s(C)});Qn(()=>(d.current||v(f.current),()=>{n.current=[],i&&(i.current=[])}),[n,i,v]),Qn(()=>{d.current&&w()}),Qn(()=>()=>{var S;(S=h.current)==null||S.disconnect(),d.current=!0},[]);const x=Gn(S=>(l.add(S),()=>{l.delete(S)})),O=p.useMemo(()=>({register:g,unregister:b,subscribeMapChange:x,nextIndexRef:u}),[g,b,x,u]);return o.jsx(c5e.Provider,{value:O,children:t})}function WMt(){return new Map}function KMt(){return new Set}function GMt(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)=>u5e(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 XMt(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function YMt(e){for(const t of e)for(let n=0;nnull},h5e=p.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:m,style:g,...b}=t,v=p.useMemo(()=>{if(h===void 0)return m??[]},[h,m]),y=p.useRef([]),[w,x]=l5e({controlled:h,default:v,name:"Accordion",state:"value"}),O=Gn((E,R,A)=>{if(d)if(R){const N=w.slice();if(N.push(E),u==null||u(N,A),A.isCanceled)return;x(N)}else{const N=w.filter(T=>T!==E);if(u==null||u(N,A),A.isCanceled)return;x(N)}else{const N=w[0]===E?[]:[E];if(u==null||u(N,A),A.isCanceled)return;x(N)}}),S=p.useMemo(()=>({value:w,disabled:s,orientation:f}),[w,s,f]),k=p.useMemo(()=>({disabled:s,handleValueChange:O,hiddenUntilFound:a??!1,keepMounted:l??!1,state:S,value:w}),[s,O,a,l,S,w]),C=Eo("div",t,{state:S,ref:n,props:b,stateAttributesMapping:ZMt});return o.jsx(d5e.Provider,{value:k,children:o.jsx(qMt,{elementsRef:y,children:C})})});function JMt(e){const{open:t,defaultOpen:n,onOpenChange:i,disabled:r}=e,[s,a]=l5e({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:l,setMounted:c,transitionStatus:u}=PAe(s,!0,!0),d=pp(),[f,h]=p.useState(),m=f===null?void 0:f??d,g=Gn(b=>{const v=!s,y=to(Jx,b.nativeEvent);i(v,y),!y.isCanceled&&a(v)});return p.useMemo(()=>({defaultPanelId:d,disabled:r,handleTrigger:g,mounted:l,open:s,panelId:m,setMounted:c,setOpen:a,setPanelIdState:h,transitionStatus:u}),[d,r,g,l,s,m,c,a,h,u])}const p5e=p.createContext(void 0);function m5e(){const e=p.useContext(p5e);if(e===void 0)throw new Error(gc(15));return e}function e5t(e={}){const{guess:t,label:n,metadata:i,textRef:r,index:s}=e,{register:a,unregister:l,subscribeMapChange:c,nextIndexRef:u}=HMt(),d=p.useRef(-1),[f,h]=p.useState(s==null&&t?()=>{if(d.current===-1){const v=u.current;u.current+=1,d.current=v}return d.current}:-1),m=s??f,g=p.useRef(null),b=p.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 Qn(()=>{if(s==null)return c(v=>{var w;const y=g.current?(w=v.get(g.current))==null?void 0:w.index:null;y!=null&&h(y)})},[s,c]),{ref:b,index:m}}const g5e=p.createContext(void 0);function DV(){const e=p.useContext(g5e);if(e===void 0)throw new Error(gc(9));return e}let MV=function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=jN.startingStyle]="startingStyle",e[e.endingStyle=jN.endingStyle]="endingStyle",e}({}),t5t=function(e){return e.panelOpen="data-panel-open",e}({});const n5t={[MV.open]:""},i5t={[MV.closed]:""},r5t={open(e){return e?{[t5t.panelOpen]:""}:null}},s5t={open(e){return e?n5t:i5t}};let o5t=function(e){return e.index="data-index",e.disabled="data-disabled",e.open="data-open",e}({});const LV={...s5t,index:e=>({[o5t.index]:String(e)}),...uP,value:()=>null},b5e=p.forwardRef(function(t,n){const{className:i,disabled:r=!1,onOpenChange:s,render:a,value:l,style:c,...u}=t,{ref:d,index:f}=e5t(),h=Zx(n,d),{disabled:m,handleValueChange:g,state:b,value:v}=f5e(),y=pp(),w=l??y,x=r||m,O=v.indexOf(w)!==-1,S=Gn((D,P)=>{s==null||s(D,P),!P.isCanceled&&g(w,D,P)}),k=JMt({open:O,onOpenChange:S,disabled:x}),C=p.useMemo(()=>({open:k.open,disabled:k.disabled,transitionStatus:k.transitionStatus}),[k.open,k.disabled,k.transitionStatus]),E=p.useMemo(()=>({...k,onOpenChange:S,state:C}),[k,C,S]),R=p.useMemo(()=>({...b,hidden:!O&&!k.mounted,index:f,disabled:x,open:O}),[k.mounted,x,f,O,b]),A=pp(),[N,T]=p.useState(),j=N===null?void 0:N??A,_=p.useMemo(()=>({defaultTriggerId:A,open:O,state:R,setTriggerId:T,triggerId:j}),[A,O,R,T,j]),I=Eo("div",t,{state:R,ref:h,props:u,stateAttributesMapping:LV});return o.jsx(p5e.Provider,{value:E,children:o.jsx(g5e.Provider,{value:_,children:I})})}),y5e=p.forwardRef(function(t,n){const{render:i,className:r,style:s,...a}=t,{state:l}=DV();return Eo("h3",t,{state:l,ref:n,props:a,stateAttributesMapping:LV})}),v5e=p.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:m}=m5e(),g=i||m,{getButtonProps:b,buttonRef:v}=dP({disabled:g,focusableWhenDisabled:!0,native:l}),{defaultTriggerId:y,state:w,setTriggerId:x}=DV(),O=s||void 0,S=O??y;return Qn(()=>(x(E=>O??(E===null?void 0:E)),()=>{x(E=>E===O?null:E)}),[O,x]),Eo("button",t,{state:w,ref:[n,v],props:[{"aria-controls":f?d:void 0,"aria-expanded":f,id:S,onClick:h},u,b],stateAttributesMapping:r5t})}),xO={height:void 0,width:void 0};function a5t(e){const{externalRef:t,hiddenUntilFound:n,id:i,keepMounted:r,mounted:s,onOpenChange:a,open:l,setMounted:c,setOpen:u,transitionStatus:d}=e,f=p.useRef(null),h=p.useRef(null),[m,g]=p.useState(xO),b=p.useRef(xO),v=p.useRef(!1),y=p.useRef(l),w=p.useRef(!1),[x,O]=p.useState(!1),S=p.useRef(null),k=Zx(t,f),C=Tl(l),E=sQ(f),R=!l&&!s,A=x?"idle":d,N=l&&(y.current||w.current),T=!l&&s&&h.current==="css-animation"&&m.height===void 0&&m.width===void 0?b.current:m,j=n&&R&&h.current!=="css-animation",_=Gn((B,M=!0)=>{M&&(b.current=B),g(B)}),I=Gn(()=>{var B;(B=S.current)==null||B.call(S),S.current=null}),D=Gn(B=>{I(),S.current=()=>{S.current=null,B()}}),P=Gn(()=>{l&&s&&h.current==="css-animation"&&(w.current=!0)});Qn(()=>{!x||d==="starting"||O(!1)},[x,d]),p.useEffect(()=>()=>{P(),I()},[P,I]),Qn(()=>{const B=f.current;if(!B)return;!l&&S.current&&I();const M=l5t(B,N);if(h.current=M,l&&d==="idle"&&y.current&&M==="css-animation"){b.current=W0(B);return}if(l&&d==="starting"){const F=v.current;if(v.current=!1,M==="none"){_(W0(B)),O(!0);return}if(M==="css-transition"){const X=c5t(B);if(_(W0(B)),!F)return X;const ne=g2(B,"transition-duration","0s");return D(ne),O(!0),X}_(W0(B));const q=g2(B,"animation-name","none");if(!F){q();return}const Q=g2(B,"animation-duration","0s");q(),D(Q),O(!0);return}if(!l&&s&&(d==="idle"||d==="starting")){if(y.current=!1,w.current=!1,M==="none"){_(xO,!1),c(!1);return}_(W0(B));return}if(d!=="ending")return;if(M==="none"){c(!1);return}const H=W0(B);if(!(H.height>0||H.width>0)){c(!1);return}_(H),M==="css-animation"&&g2(B,"animation-name","none")()},[s,l,I,_,c,D,N,d]),AC({enabled:l&&s&&A==="idle",open:!0,ref:f,onComplete(){l&&_(xO,!1)}}),p.useEffect(()=>{if(l||!s||A!=="ending"||!f.current)return;const M=new AbortController;let H=-1;function K(){C.current||(c(!1),_(xO,!1))}return H=ec.request(()=>{E(K,M.signal)}),()=>{ec.cancel(H),M.abort()}},[C,s,l,A,E,_,c]),Qn(()=>{const B=f.current;!B||!n||!R||B.setAttribute("hidden","until-found")},[R,n]),p.useEffect(function(){const M=f.current;if(!M)return;function H(K){const F=to(rAe,K);a(!0,F),!F.isCanceled&&(v.current=!0,u(!0))}return yi(M,"beforematch",H)},[a,u]);const L=r||n||s||l;return{height:T.height,props:{...j?{[MV.startingStyle]:""}:void 0,hidden:R,id:i},ref:k,shouldPreventOpenAnimation:N,shouldRender:L,transitionStatus:A,width:T.width}}function W0(e){return{height:e.scrollHeight,width:e.scrollWidth}}function l5t(e,t){const n=Ws(e).getComputedStyle(e),i=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&bne(n.animationDuration),r=bne(n.transitionDuration);return i&&r||r?"css-transition":i?"css-animation":"none"}function bne(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function g2(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 c5t(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=ec.request(n);return()=>{ec.cancel(i),n()}}let yne=function(e){return e.accordionPanelHeight="--accordion-panel-height",e.accordionPanelWidth="--accordion-panel-width",e}({});const x5e=p.forwardRef(function(t,n){const{className:i,hiddenUntilFound:r,keepMounted:s,id:a,render:l,style:c,...u}=t,{hiddenUntilFound:d,keepMounted:f}=f5e(),{defaultPanelId:h,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,setPanelIdState:w,transitionStatus:x}=m5e(),O=r??d,S=s??f,k=a||void 0,C=a??h;Qn(()=>(w(M=>k??(M===null?void 0:M)),()=>{w(M=>M===k?null:M)}),[k,w]);const{height:E,props:R,ref:A,shouldPreventOpenAnimation:N,shouldRender:T,transitionStatus:j,width:_}=a5t({externalRef:n,hiddenUntilFound:O,id:C,keepMounted:S,mounted:m,onOpenChange:g,open:b,setMounted:v,setOpen:y,transitionStatus:x}),{state:I,triggerId:D}=DV(),P={...I,transitionStatus:j},L=KTe(c,P),B=Eo("div",{...t,style:void 0},{state:P,ref:A,props:[R,{"aria-labelledby":D,role:"region",style:{[yne.accordionPanelHeight]:E===void 0?"auto":`${E}px`,[yne.accordionPanelWidth]:_===void 0?"auto":`${_}px`}},u,L?{style:L}:void 0,N?{style:{animationName:"none"}}:void 0],stateAttributesMapping:LV});return T?B:null}),u5t=(e,t)=>{const n=e.currentTarget,i={x:e.clientX,y:e.clientY},r=d5t(i,n.getBoundingClientRect()),s=f5t(i,r),a=h5t(t.getBoundingClientRect());return m5t([...s,...a])};function d5t(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 f5t(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 h5t(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 p5t(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 m5t(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),g5t(t)}function g5t(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 b5t="_Transition_1wdpp_1",y5t="_Popover_1wdpp_3",w5e={Transition:b5t,Popover:y5t},O5e=p.createContext(null),yD=()=>{const e=p.use(O5e);if(!e)throw new Error("Popover components must be wrapped in ");return e},Km=({open:e,onOpenChange:t,showOnHover:n=!1,hoverOpenDelay:i=150,children:r})=>{const[s,a]=p.useState(!1),[l,c]=p.useState(!1),u=p.useRef(null),d=p.useRef(null),f=p.useRef(void 0),h=p.useRef(!1),m=p.useRef(!1),g=e??s,[b,v]=p.useState(!1);wQ(()=>v(!1),b?500:null);const y=fg(t),w=fg(C=>{var E,R;clearTimeout(f.current),g!==C&&(C||(c(!1),n&&h.current&&((E=u.current)==null||E.focus()),h.current=!1),(R=y.current)==null||R.call(y,C),a(C),n&&v(C))}),x=p.useCallback(C=>{w.current(C)},[w]),O=p.useCallback(()=>{f.current=setTimeout(()=>x(!0),i)},[x,i]),S=p.useCallback(()=>{clearTimeout(f.current)},[]);p.useEffect(()=>()=>{clearTimeout(f.current)},[]);const k=p.useMemo(()=>({open:g,setOpen:x,shake:l,setShake:c,showOnHover:n,temporarilyPreventClickToClose:b,onTriggerEnter:O,onTriggerLeave:S,isPointerInTransitRef:m,triggerRef:u,contentRef:d,hoverOpenFocusedWithTab:h}),[g,x,l,c,n,b,h,m,O,S]);return o.jsx(O5e,{value:k,children:o.jsx(cje,{open:g,onOpenChange:x,modal:!1,children:r})})},v5t=({children:e,onPointerDown:t,onClick:n})=>{const{setOpen:i,showOnHover:r,temporarilyPreventClickToClose:s,onTriggerEnter:a,onTriggerLeave:l,isPointerInTransitRef:c,triggerRef:u,contentRef:d}=yD(),f=p.useRef(!1),h=b=>{!(b.currentTarget.nodeName.toLocaleLowerCase()==="a")&&s&&(b.preventDefault(),b.stopPropagation())},m=b=>{b.pointerType!=="touch"&&!f.current&&!c.current&&(a(),f.current=!0)},g=()=>{f.current&&(l(),f.current=!1)};return o.jsx(uje,{asChild:!0,ref:u,onPointerDown:b=>{h(b),t==null||t(b)},onClick:b=>{h(b),n==null||n(b)},onPointerMove:r?m: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})},k5e=({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:m,contentRef:g}=yD(),b=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const w=D2e(y),x=w[w.length-1];x==null||x.focus()}};return p.useEffect(()=>{const v=g.current;!v||!f||v!=null&&v.contains(document.activeElement)||h||v.focus({preventScroll:!0})},[g,h,f]),o.jsx(fje,{forceMount:!0,ref:g,className:ji(w5e.Popover,d),style:Gy({"popover-width":n,"popover-min-width":i,"popover-max-width":r}),onCloseAutoFocus:h?Kh:void 0,"data-animate":m?"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:Kh,onEscapeKeyDown:Kh,onKeyDown:b,children:e})},x5t=e=>{const{setOpen:t,triggerRef:n,contentRef:i,isPointerInTransitRef:r,hoverOpenFocusedWithTab:s}=yD(),[a,l]=p.useState(null),c=p.useCallback(()=>{l(null),r.current=!1},[r]),u=p.useCallback((d,f)=>{const h=u5t(d,f);l(h),r.current=!0},[r]);return p.useEffect(()=>()=>c(),[c]),p.useEffect(()=>{const d=n.current,f=i.current;if(!d||!f)return;const h=g=>u(g,f),m=g=>u(g,d);return d.addEventListener("pointerleave",h),f.addEventListener("pointerleave",m),()=>{d.removeEventListener("pointerleave",h),f.removeEventListener("pointerleave",m)}},[i,n,u,c]),p.useEffect(()=>{if(!a)return;const d=f=>{const h=n.current,m=i.current,g=f.target,b={x:f.clientX,y:f.clientY},v=(h==null?void 0:h.contains(g))||(m==null?void 0:m.contains(g)),y=!p5t(b,a),w=g.hasAttribute("aria-haspopup");v?c():(y||w)&&(c(),t(!1))};return document.addEventListener("pointermove",d),()=>document.removeEventListener("pointermove",d)},[a,t,c,n,i]),p.useEffect(()=>{const d=f=>{if(i.current&&f.key==="Tab"&&!f.shiftKey){const[h]=D2e(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(k5e,{...e})},w5t=e=>{const{open:t,showOnHover:n,setOpen:i}=yD();return LC(t,()=>{i(!1)}),o.jsx(dje,{forceMount:!0,children:o.jsx(Yw,{enterDuration:600,exitDuration:300,className:w5e.Transition,disableAnimations:!0,children:t&&(n?o.jsx(x5t,{...e},"popover-hover"):o.jsx(k5e,{...e},"popover"))})})};Km.Trigger=v5t;Km.Content=w5t;const O5t=["skill_hub","skill_space","knowledge_base","tool"];function S5e(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 E5e({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 k5t(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 p3({label:e,resources:t}){const{t:n}=_e("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(zo,{color:"secondary",size:"sm",variant:"soft",children:k5t(i,n)})]}),i.description?o.jsx("p",{children:i.description}):null]},i.ref))})]})}function S5t({tools:e}){const{t}=_e("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(h5e,{children:e.map((n,i)=>o.jsxs(b5e,{className:"create-agent-card__python-tool",value:`${n.name}:${i}`,children:[o.jsx(y5e,{className:"create-agent-card__python-tool-header",children:o.jsxs(v5e,{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(zo,{color:"secondary",size:"sm",variant:"soft",children:t("blocks.createAgents.selfAuthoredTools")}),o.jsx(S5e,{className:"create-agent-card__python-tool-chevron"})]})]})}),o.jsxs(x5e,{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 E5t({agents:e}){const{t}=_e("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(zo,{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 b2({label:e,count:t,icon:n,children:i}){const{t:r}=_e("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(Km,{showOnHover:!0,hoverOpenDelay:120,children:[o.jsx(Km.Trigger,{children:s}),o.jsx(Km.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:i})]})}function C5t({response:e,status:t}){const{t:n}=_e("conversation"),i=p.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=p.useMemo(()=>BMt(e,i),[i,e]),s=p.useMemo(()=>O5t.map(c=>{const u=UMt(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?bD(e):"";return o.jsx("section",{className:"create-agent-tool-card","aria-label":n("blocks.createAgents.collectionAria"),children:t==="running"?o.jsx(E5e,{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(h5e,{className:"create-agent-card__accordion",children:s.map(c=>o.jsxs(b5e,{className:"create-agent-card__accordion-item",value:c.value,children:[o.jsx(y5e,{className:"create-agent-card__accordion-header",children:o.jsxs(v5e,{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(zo,{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(S5e,{className:"create-agent-card__accordion-chevron"})]})]})}),o.jsx(x5e,{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(zo,{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 T5t({args:e,response:t,status:n}){const{t:i}=_e("conversation"),r=p.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=p.useMemo(()=>a5e(e,t,r),[e,r,t]),a=n==="failed"?bD(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(Uz,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[o.jsx(Qz,{leading:o.jsx(uw,{seed:l.name}),title:l.name,titleText:l.name,status:o.jsx(zo,{color:"secondary",size:"sm",variant:"soft",children:i(`blocks.createAgents.agentTypes.${l.rootType}`,{defaultValue:l.rootType})})}),l.description?o.jsx(zz,{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(b2,{label:i("blocks.createAgents.skill"),count:l.skills.length,icon:o.jsx(z_,{"aria-hidden":"true"}),children:o.jsx(p3,{label:i("blocks.createAgents.skill"),resources:l.skills})}),o.jsx(b2,{label:i("blocks.createAgents.knowledgeBase"),count:l.knowledgeBases.length,icon:o.jsx(Hje,{"aria-hidden":"true"}),children:o.jsx(p3,{label:i("blocks.createAgents.knowledgeBase"),resources:l.knowledgeBases})}),o.jsxs(b2,{label:i("blocks.createAgents.toolsLabel"),count:d,icon:o.jsx(Lit,{"aria-hidden":"true"}),children:[o.jsx(p3,{label:i("blocks.createAgents.builtinTool"),resources:l.builtinTools}),o.jsx(S5t,{tools:l.pythonTools})]}),o.jsx(b2,{label:i("blocks.createAgents.subAgents"),count:l.subAgentCount,icon:o.jsx(Fit,{"aria-hidden":"true"}),children:o.jsx(E5t,{agents:l.subAgents})})]})]},l.name)})}):n==="running"?o.jsx(E5e,{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 A5t={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:dne},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:dne},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:yMt},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:xMt},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:wMt},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:hne},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:hne},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:hMt},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:NV},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:pMt},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:mMt},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:gMt},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:bMt},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:vMt,detailRenderer:C5t},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:fne,detailRenderer:T5t},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:fne,detailRenderer:VMt,hideHeader:!0}};function _5t(e){return A5t[e]}function j5t(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 N5t(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 R5t(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 Fg(e){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...e}}function C5e(e){return o.jsx("svg",{...Fg(e),children:o.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function m3(e){return o.jsx("svg",{...Fg(e),children:o.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function I5t(e){return o.jsx("svg",{...Fg(e),children:o.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function P5t(e){return o.jsx("svg",{...Fg(e),children:o.jsx("path",{d:"m9 5 7 7-7 7"})})}function vD(e){return o.jsx("svg",{...Fg(e),children:o.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function D5t(e){return o.jsxs("svg",{...Fg(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 M5t(e){return o.jsx("svg",{...Fg(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 T5e(e){return o.jsxs("svg",{...Fg(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 L5t=p.lazy(()=>zs(()=>Promise.resolve().then(()=>iFe),void 0)),$5t=p.lazy(()=>zs(()=>import("../chunks/CodeDiffEditor-BQpKN2_Y.js"),[])),A5e="veadk-code-workspace-theme";function F5t(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 B5t(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 U5t(){if(typeof window>"u")return"light";try{return window.localStorage.getItem(A5e)==="dark"?"dark":"light"}catch{return"light"}}function Q5t(e){return e===""?0:e.split(` +`).length}function mw({project:e,open:t,onClose:n,onChange:i,readOnly:r=!1,comparison:s}){var j;const{t:a}=_e("workspaceTools"),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(n),[f,h]=p.useState(U5t),m=p.useMemo(()=>s?R5t(s.baseProject.files,e.files):[],[s,e.files]),g=p.useMemo(()=>s?m.map(_=>({path:_.path,content:_.status==="deleted"?_.before:_.after})):e.files,[m,s,e.files]),b=p.useMemo(()=>new Map(m.map(_=>[_.path,_.status])),[m]),[v,y]=p.useState(((j=g[0])==null?void 0:j.path)??null),[w,x]=p.useState(new Set),O=p.useMemo(()=>F5t(g),[g]),S=g.find(_=>_.path===v)??null,k=m.find(_=>_.path===v)??null;if(d.current=n,p.useEffect(()=>{try{window.localStorage.setItem(A5e,f)}catch{}},[f]),p.useEffect(()=>{var P;if(!t)return;const _=document.body.style.overflow,I=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(P=u.current)==null||P.focus();const D=L=>{if(L.key==="Escape"){L.preventDefault(),d.current();return}if(L.key!=="Tab"||!c.current)return;const B=[...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(B.length===0)return;const M=B[0],H=B[B.length-1];L.shiftKey&&document.activeElement===M?(L.preventDefault(),H.focus()):!L.shiftKey&&document.activeElement===H&&(L.preventDefault(),M.focus())};return window.addEventListener("keydown",D),()=>{document.body.style.overflow=_,window.removeEventListener("keydown",D),I!=null&&I.isConnected&&I.focus()}},[t]),p.useEffect(()=>{S||g.length===0||y(g[0].path)},[g,S]),!t)return null;function C(_){x(I=>{const D=new Set(I);return D.has(_)?D.delete(_):D.add(_),D})}function E(_){return _?o.jsx("span",{className:`code-browser-change is-${_}`,children:a(`codeBrowser.change.${_}`)}):null}function R(_,I,D){return B5t(_,I===0).map(P=>{const L=D?`${D}/${P.name}`:P.name;if(!(P.children.size>0&&P.path===void 0)&&P.path){const H=b.get(P.path);return o.jsxs("button",{type:"button",className:`code-browser-file${v===P.path?" is-active":""}`,style:{paddingLeft:`${12+I*16}px`},onClick:()=>y(P.path??null),title:P.path,"aria-pressed":v===P.path,children:[o.jsx(m3,{}),o.jsx("span",{children:P.name}),E(H)]},L)}const M=w.has(L);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+I*16}px`},onClick:()=>C(L),"aria-expanded":!M,children:[o.jsx(P5t,{className:M?"":"is-open"}),o.jsx(I5t,{}),o.jsx("span",{children:P.name})]}),!M&&R(P,I+1,L)]},L)})}function A(_){!S||s||i({...e,files:e.files.map(I=>I.path===S.path?{...I,content:_}:I)})}const N=f==="light"?"dark":"light",T=a(s?"codeBrowser.noChanges":"codeBrowser.chooseFile");return ri.createPortal(o.jsx("div",{className:"code-browser-backdrop",onMouseDown:_=>{_.target===_.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(C5e,{})}),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(N),"aria-label":a("codeBrowser.switchTheme"),title:a("codeBrowser.switchThemeTitle",{theme:a(`codeBrowser.themes.${N}`)}),children:f==="light"?o.jsx(M5t,{}):o.jsx(D5t,{})}),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(vD,{})})]})]}),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?R(O,0,""):o.jsx("div",{className:"code-browser-empty",children:T})})]}),o.jsxs("main",{className:"code-browser-main",children:[o.jsx("div",{className:"code-browser-tabs",role:"tablist","aria-label":a("codeBrowser.openFiles"),children:S?o.jsxs("div",{className:"code-browser-tab",role:"tab","aria-selected":"true",children:[o.jsx(m3,{}),o.jsx("span",{children:S.path.split("/").pop()}),E(k==null?void 0:k.status)]}):null}),o.jsxs("div",{className:"code-browser-path",children:[o.jsx(m3,{}),o.jsx("span",{children:(S==null?void 0:S.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:S?o.jsx(p.Suspense,{fallback:o.jsx("div",{className:"code-browser-empty",children:a("codeBrowser.loadingEditor")}),children:k?o.jsx($5t,{before:k.before,after:k.after,path:k.path,theme:f}):o.jsx(L5t,{value:S.content,path:S.path,onChange:A,readOnly:r,theme:f})}):o.jsx("div",{className:"code-browser-empty",children:T})}),o.jsxs("footer",{className:"code-browser-statusbar",children:[o.jsx("span",{children:s?a("codeBrowser.changedFileCount",{count:m.length}):a("codeBrowser.fileCount",{count:e.files.length})}),o.jsx("span",{children:S?a("codeBrowser.lineCount",{count:Q5t(S.content)}):"UTF-8"})]})]})]})]})}),document.body)}function z5t({project:e,onChange:t,className:n="",label:i}){const{t:r}=_e("workspaceTools"),[s,a]=p.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(C5e,{}),o.jsx("span",{children:l})]}),o.jsx(mw,{project:e,open:s,onClose:()=>a(!1),onChange:t})]})}const _5e="send_a2ui_json_to_client",V5t=28,H5t=3e3;function q5t(e,t,n){let i=t;for(let r=0;r65535?2:1}return i}function W5t(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function j5e(e,t,n,i){const[r,s]=p.useState(()=>t?"":e),a=p.useRef(r),l=p.useRef(e),c=p.useRef(null),u=p.useRef(0),d=p.useRef(n);return l.current=e,d.current=n,p.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 m=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]),p.useEffect(()=>{r===e&&(i==null||i())},[r,i,e]),p.useEffect(()=>()=>{c.current!==null&&(window.cancelAnimationFrame(c.current),c.current=null)},[]),r}function K5t(){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 G5t(){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 X5t(){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 Y5t({activity:e}){const{t}=_e("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 Z5t(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 N5e({text:e,done:t,answerStarted:n=!1,streaming:i=!1,onStreamFrame:r}){const{t:s}=_e("conversation"),[a,l]=p.useState(!(t||n)),c=p.useRef(!1);p.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 w=y[v-1]??"",x=y[v+b.length]??"";return!w||!x||new RegExp("\\p{Script=Han}","u").test(w)&&new RegExp("\\p{Script=Han}","u").test(x)||/[(\[{“‘/]/u.test(w)||/[),.\]},。!?;:、”’]/u.test(x)?"":" "})).join(` -`),f=k5e(d,!t||i,r),{ref:h,onScroll:m}=GMe(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(RV,{className:`thinking-logo ${t?"":"is-active"}`})}),t?o.jsx("span",{className:"think-label think-label--done",children:s("blocks.thinkingDone")}):o.jsx(mn,{className:"think-label",duration:2.4,spread:18,children:s("blocks.thinking")}),o.jsx(jC,{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:m,children:f})})})]})}function q5t({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(RV,{className:"thinking-logo is-active"})}),o.jsx(mn,{className:"think-label",duration:2.4,spread:18,children:e})]})})}function W5t({value:e,onResolve:t,onResolveComparison:n,onDownload:i,onDeploy:r}){const{t:s,i18n:a}=je("conversation"),l=N=>N.split(new RegExp("(?<=[/_-])")).map((_,D)=>o.jsxs(p.Fragment,{children:[_,o.jsx("wbr",{})]},`${D}:${_}`)),[c,u]=p.useState(e.files?e:null),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[g,b]=p.useState(null),[v,y]=p.useState(null),[w,x]=p.useState(""),[O,S]=p.useState(null),k=new Date(e.validatedAt),C=e.validatedAt?Number.isNaN(k.getTime())?e.validatedAt:k.toLocaleString(a.resolvedLanguage??a.language,{hour12:!1}):s("blocks.justNow");p.useEffect(()=>{if(!O)return;const N=window.setTimeout(()=>S(null),$5t);return()=>window.clearTimeout(N)},[O]);async function E(){if(c)return c;if(!t)throw new Error(s("blocks.sourceUnavailable"));const N=await t(e);return u(N),N}async function R(){y("source"),x(""),S(null);try{await E(),f(!0)}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}async function A(){if(i){y("download"),x(""),S(null);try{await i(e),S({message:s("blocks.downloadStarted")})}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}}async function j(){if(n){y("compare"),x(""),S(null);try{const N=g??await n(e);b(N),m(!0)}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(null)}}}async function T(){y("deploy"),x(""),S(null);try{r==null||r(await E())}catch(N){x(N instanceof Error?N.message:String(N))}finally{y(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(S5t,{}):o.jsx(k5t,{})}),o.jsxs("div",{className:"delivery-card-heading",children:[o.jsx("strong",{children:l(e.agentName)}),o.jsx("span",{children:e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource")})]})]}),o.jsxs("dl",{className:"delivery-card-grid",children:[o.jsxs("div",{className:"delivery-card-entry",children:[o.jsx("dt",{children:s("blocks.entryPoint")}),o.jsx("dd",{children:o.jsx("code",{children:l(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",{className:"delivery-card-time",children:[o.jsx("dt",{children:e.verified?s("blocks.validationTime"):s("blocks.generationTime")}),o.jsx("dd",{children:C})]})]}),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("div",{className:"delivery-card-secondary-actions",children:[o.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void R(),disabled:!t||v!==null,children:[v==="source"?o.jsx(Mi,{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 j(),disabled:!n||v!==null,children:[v==="compare"?o.jsx(Mi,{className:"spin","aria-hidden":"true"}):null,s(v==="compare"?"blocks.preparing":"blocks.viewChanges")]}):null,o.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void A(),disabled:!i||v!==null,"aria-busy":v==="download",children:[v==="download"?o.jsx(Mi,{className:"spin","aria-hidden":"true"}):null,s(v==="download"?"blocks.preparing":"blocks.downloadSource")]})]}),o.jsxs("button",{type:"button",className:"delivery-card-primary",onClick:()=>void T(),disabled:!e.deployable||!r||!t||v!==null,title:e.deployable?s("blocks.manualDeploy"):s("blocks.sourceNotReady"),children:[v==="deploy"?o.jsx(Mi,{className:"spin","aria-hidden":"true"}):null,s("blocks.deployAgent")]})]}),w?o.jsx("p",{className:"delivery-card-error",role:"alert",children:w}):null,O?o.jsx("p",{className:"delivery-card-status",role:"status","aria-live":"polite",children:O.message}):null]}),o.jsx(mw,{project:{name:e.agentName,files:(c==null?void 0:c.files)??[]},open:d,onClose:()=>f(!1),onChange:()=>{},readOnly:!0}),o.jsx(mw,{project:{name:(g==null?void 0:g.target.agentName)??e.agentName,files:(g==null?void 0:g.target.files)??[]},comparison:g?{baseProject:{name:g.base.agentName,files:g.base.files??[]},baseLabel:s("blocks.beforeOptimization"),targetLabel:s("blocks.afterOptimization")}:void 0,open:h,onClose:()=>m(!1),onChange:()=>{},readOnly:!0})]})}function E5e(){return o.jsx(S5e,{text:"",done:!1})}const K5t=p.memo(function({text:t,streaming:n,onStreamFrame:i,onStreamComplete:r}){const s=k5e(t,n,i,r);return s?o.jsx("div",{className:"bubble",children:o.jsx(Ju,{text:s,streaming:n})}):null});function G5t({title:e,summary:t,items:n,done:i}){const{t:r}=je("conversation"),[s,a]=p.useState(!i),l=p.useRef(!1);p.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(Q5t,{})}),i?o.jsx("span",{className:"plan-title",children:e}):o.jsx(mn,{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(l1,{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 X5t(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 Y5t({name:e,args:t,response:n,done:i,status:r,defaultOpen:s=!1,retrying:a=!1,codexActivity:l,native:c=!1,progressText:u,onBranchSelect:d,onAction:f}){const{t:h}=je("conversation"),g=e==="create_agents"&&i&&DMt(t,n)?"failed":r??(i?"completed":"running"),b=e==="create_agents"&&g==="failed"&&a,v=O5t(e),y=v==null?void 0:v.detailRenderer,w=(v==null?void 0:v.hideHeader)===!0,x=w||s||!!y||!!l,[O,S]=p.useState(x),k=p.useRef(!1);p.useEffect(()=>{!k.current&&x&&S(!0)},[x]);const C=()=>{k.current=!0,S(T=>!T)},E=e===O5e?h("blocks.renderUi"):e,R=X5t(n),A=n==null?null:typeof n=="string"?n:JSON.stringify(n,null,2),j=!c&&A&&A.length>2e3?`${A.slice(0,2e3)} -${h("blocks.truncated")}`:A;return o.jsxs(cr.div,{className:`block-tool${v?" block-tool--builtin":""}`,"data-status":g,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[v&&!w?o.jsx(_Mt,{definition:v,label:b?h("blocks.agentAdjusting"):g==="failed"?h(`blocks.tools.${v.name}.failed`,{defaultValue:v.failedLabel??v.doneLabel}):H5t(e,t,h),done:i,open:O,onToggle:C}):v?null:o.jsxs("button",{className:"tool-head tool-head--generic",onClick:C,type:"button","aria-expanded":O,children:[o.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:c?o.jsx(hD,{kind:"tool"}):o.jsx(U5t,{})}),i?o.jsx("span",{className:"tool-name",children:E}):o.jsx(mn,{className:"tool-name",duration:2.2,spread:15,children:E}),c&&g==="failed"&&o.jsx("span",{className:"development-tool-failure",children:o.jsx(Rx,{ns:"adk",i18nKey:"developmentRuns.toolFailed"})}),o.jsx(l1,{className:`tool-chevron${O?" is-open":""}`})]}),o.jsx("div",{className:`${w?"":"think-collapse "}${O?"open":""}`,children:o.jsxs("div",{className:"think-collapse-inner",children:[l?o.jsxs("section",{className:"codex-sandbox-run","aria-label":h("blocks.sandboxDetails"),children:[o.jsxs("div",{className:"codex-sandbox-run__label",children:[o.jsxs("span",{className:"codex-sandbox-run__badge",children:[o.jsx(z5t,{}),o.jsx("span",{children:"Codex Sandbox"})]}),o.jsx("span",{className:"codex-sandbox-run__title",children:l.title})]}),o.jsx(V5t,{activity:l}),o.jsx("div",{className:"codex-sandbox-run__stream",children:l.items.length>0?o.jsx(_y,{blocks:l.items.map(T=>T.block),streaming:!i,onAction:f}):o.jsx(mn,{className:"codex-sandbox-run__empty",children:h("blocks.waitingCodex")})})]}):null,y?o.jsx(y,{args:t,response:n,status:g,onBranchSelect:d}):l?null:o.jsxs("div",{className:"tool-detail",children:[u&&o.jsx("div",{className:"development-tool-meta",children:u}),t!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:h("blocks.arguments")}),o.jsx("pre",{className:"tool-args",children:JSON.stringify(t,null,2)})]}),j!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:h("blocks.result")}),o.jsx("pre",{className:"tool-args tool-result",children:j})]}),R.length>0&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:h("blocks.artifacts")}),o.jsx("div",{className:"studio-tool-artifacts",children:R.map(T=>o.jsx("a",{href:T.contentUrl,download:T.name,children:h("blocks.downloadNamed",{name:T.name})},`${T.contentUrl}:${T.name}`))})]})]})]})})]})}function Z5t({block:e,onDownload:t,onPreview:n}){const{t:i}=je("conversation"),[r,s]=p.useState(""),[a,l]=p.useState(""),[c,u]=p.useState(null);p.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("")}}},m=e.files.filter(g=>!g.filename.endsWith(".preview.webp"));return o.jsxs("div",{className:"artifact-list",children:[m.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(gQ,{})}),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(Mi,{className:"spin"}):o.jsx(Wit,{}),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(Mi,{className:"spin"}):o.jsx(gP,{}),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(Oa,{})})]}),o.jsx("div",{className:"artifact-preview__canvas",children:o.jsx("img",{src:c.url,alt:i("blocks.slidePreview",{name:c.name})})})]})]})]})}function J5t({block:e,onAuth:t}){const{t:n}=je("conversation"),[i,r]=p.useState(e.done?"done":"idle"),[s,a]=p.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(cr.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[o.jsx(aZ,{className:"auth-card-icon auth-card-icon--done"}),o.jsx("span",{children:n("blocks.authorized",{tool:l})})]}):o.jsxs(cr.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(aZ,{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(Rx,{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(Rx,{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(Mi,{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 _y({groupProcess:e=!1,liveStatus:t,blocks:n,appName:i="",streaming:r=!1,onStreamFrame:s,onStreamComplete:a,onAction:l,onAuth:c,onArtifactDownload:u,onArtifactPreview:d,onResolveDelivery:f,onResolveDeliveryComparison:h,onDownloadDelivery:m,onDeployDelivery:g,onBranchSelect:b}){if(e)return o.jsx(bMt,{blocks:n,active:r,status:t,render:y=>o.jsx(_y,{blocks:y,appName:i,streaming:r,onStreamFrame:s,onStreamComplete:a,onAction:l,onAuth:c,onArtifactDownload:u,onArtifactPreview:d,onResolveDelivery:f,onResolveDeliveryComparison:h,onDownloadDelivery:m,onDeployDelivery:g,onBranchSelect:b})});const v=n.reduce((y,w,x)=>w.kind==="text"?x:y,-1);return o.jsx(o.Fragment,{children:n.map((y,w)=>{switch(y.kind){case"turn-summary":return o.jsx(mMt,{value:y.value},y.id||w);case"diff":return o.jsxs("details",{className:"development-diff",children:[o.jsxs("summary",{children:[o.jsx("span",{className:"tool-icon",children:o.jsx(hD,{kind:"diff"})}),o.jsx("span",{children:o.jsx(Rx,{ns:"adk",i18nKey:"developmentRuns.diff"})}),o.jsx(l1,{className:"tool-chevron"})]}),o.jsx("pre",{children:y.text})]},y.id??w);case"progress":return o.jsx(q5t,{text:y.text},"build-progress");case"thinking":{const x=n.slice(w+1).some(O=>O.kind==="text"&&!!O.text.trim());return o.jsx(S5e,{text:y.text,done:y.done,answerStarted:x,streaming:r,onStreamFrame:s},y.id??w)}case"text":{const x=y.text.replace(/^\s+/,"");return x?o.jsx(K5t,{text:x,streaming:r,onStreamFrame:s,onStreamComplete:w===v?a:void 0},y.id??w):null}case"plan":return o.jsx(G5t,{title:y.title,summary:y.summary,items:y.items,done:y.done},y.id??w);case"attachment":return o.jsx(mD,{appName:i,items:y.files},y.id??w);case"artifact":return o.jsx(Z5t,{block:y,onDownload:u,onPreview:d},y.id??w);case"delivery":return o.jsx(W5t,{value:y.value,onResolve:f,onResolveComparison:h,onDownload:m,onDeploy:g},y.id??w);case"invocation":return o.jsx(pD,{value:y.value},y.id??w);case"tool":{if(y.name===O5e&&y.done)return null;const x=y.name==="create_agents"&&n.slice(w+1).some(O=>O.kind==="tool"&&O.name==="create_agents");return o.jsx(Y5t,{name:y.itemType?gTe(y):y.name,native:!!y.itemType,progressText:y.progressText,args:y.args,response:y.response,done:y.done,status:y.status,defaultOpen:y.defaultOpen,retrying:y.name==="create_agents"&&(r||x),codexActivity:y.codexActivity,onBranchSelect:b,onAction:l},y.id??w)}case"agent-transfer":return null;case"auth":return o.jsx(J5t,{block:y,onAuth:c},y.id??w);case"a2ui":return KMe(y.messages).filter(x=>x.components[x.rootId]).map(x=>o.jsx(cr.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(CMt,{surface:x,onAction:l})},`${w}-${x.surfaceId}`));default:return null}})})}const eLt=()=>{};function tLt(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(Yt("conversation.unsupportedActivity"))}function nLt({activities:e}){const{t}=je("skills"),n=p.useMemo(()=>e.filter(i=>i.kind!=="status").map(tLt),[e]);return n.length===0?null:o.jsx("div",{className:"skill-conversation","aria-label":t("conversation.ariaLabel"),"aria-live":"polite",children:o.jsx(_y,{blocks:n,onAction:eLt})})}function vne(){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 dj({label:e,value:t,options:n,onChange:i,disabled:r=!1,allowCustom:s=!1,required:a=!1,placeholder:l,error:c}){const{t:u}=je("skills"),d=l??u("configSelect.placeholder"),f=p.useId(),h=p.useId(),m=p.useId(),g=p.useRef(null),b=p.useRef(null),v=p.useRef(null),y=p.useRef(null),w=p.useRef([]),x=n.findIndex(D=>D.value===t),O=t.trim().toLocaleLowerCase(),S=s&&O?n.filter(D=>D.value.toLocaleLowerCase().includes(O)||D.label.toLocaleLowerCase().includes(O)):n,[k,C]=p.useState(!1),[E,R]=p.useState(Math.max(0,x)),A=x>=0?n[x]:void 0,j=r||!s&&n.length===0,T=(D=!1)=>{C(!1),D&&window.requestAnimationFrame(()=>{var M,P;return s?(M=v.current)==null?void 0:M.focus():(P=b.current)==null?void 0:P.focus()})},N=D=>{j||S.length!==0&&(R(Math.min(Math.max(D,0),S.length-1)),C(!0))};p.useEffect(()=>{if(!k)return;const D=y.current,M=s?void 0:window.requestAnimationFrame(()=>{var I;(I=w.current[E])==null||I.focus()}),P=I=>{if(!D)return;const z=D.scrollTop<=0,K=D.scrollTop+D.clientHeight>=D.scrollHeight-1;(D.scrollHeight<=D.clientHeight||I.deltaY<0&&z||I.deltaY>0&&K)&&I.preventDefault(),I.stopPropagation()},L=I=>{var z;I.target instanceof Node&&!((z=g.current)!=null&&z.contains(I.target))&&T()},B=I=>{I.key==="Escape"&&T(!0)};return D==null||D.addEventListener("wheel",P,{passive:!1}),window.addEventListener("pointerdown",L),window.addEventListener("keydown",B),()=>{M!==void 0&&window.cancelAnimationFrame(M),D==null||D.removeEventListener("wheel",P),window.removeEventListener("pointerdown",L),window.removeEventListener("keydown",B)}},[E,s,k]);const _=D=>{var P;if(S.length===0)return;const M=(D+S.length)%S.length;R(M),(P=w.current[M])==null||P.focus()};return o.jsxs("div",{ref:g,className:`skill-config-select${k?" is-open":""}`,onBlur:D=>{var M;(!D.relatedTarget||!((M=g.current)!=null&&M.contains(D.relatedTarget)))&&T()},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":k,children:[o.jsx("input",{ref:v,value:t,disabled:r,role:"combobox","aria-autocomplete":"list","aria-expanded":k,"aria-controls":k?f:void 0,"aria-labelledby":h,"aria-required":a,"aria-invalid":!!c,"aria-describedby":c?m:void 0,placeholder:d,onChange:D=>{i(D.target.value),R(0),n.length>0&&C(!0)},onClick:()=>{!k&&S.length>0&&N(0)},onKeyDown:D=>{var M,P;if(!(D.nativeEvent.isComposing||D.keyCode===229))if(D.key==="ArrowDown")D.preventDefault(),k?(M=w.current[E])==null||M.focus():N(0);else if(D.key==="ArrowUp")D.preventDefault(),k?(P=w.current[S.length-1])==null||P.focus():N(S.length-1);else if(D.key==="Enter"&&k){D.preventDefault();const L=S[E];L&&i(L.value),T()}else D.key==="Escape"&&(D.preventDefault(),T())}}),o.jsx("button",{type:"button",className:"skill-config-select__toggle",disabled:r||n.length===0,"aria-label":u(k?"configSelect.collapseOptions":"configSelect.expandOptions"),onClick:()=>{k?T():N(0)},children:o.jsx(vne,{})})]}):o.jsxs("button",{ref:b,type:"button",className:"skill-config-select__trigger",disabled:j,"aria-haspopup":"listbox","aria-expanded":k,"aria-controls":k?f:void 0,"aria-labelledby":h,"aria-required":a,onClick:()=>{k?T():N(x>=0?x:0)},onKeyDown:D=>{D.key==="ArrowDown"?(D.preventDefault(),N(x>=0?x:0)):D.key==="ArrowUp"&&(D.preventDefault(),N(x>=0?x:n.length-1))},children:[o.jsx("span",{className:A?void 0:"is-placeholder",title:A==null?void 0:A.label,children:(A==null?void 0:A.label)||(n.length===0?u("configSelect.noOptions"):d)}),o.jsx(vne,{})]}),k?o.jsxs("div",{ref:y,id:f,className:"skill-config-select__menu",role:"listbox","aria-labelledby":h,children:[S.length===0?o.jsx("div",{className:"skill-config-select__empty",role:"status",children:u("configSelect.noMatches")}):null,S.map((D,M)=>{const P=D.value===t;return o.jsx("button",{ref:L=>{w.current[M]=L},type:"button",role:"option","aria-selected":P,tabIndex:M===E?0:-1,className:`skill-config-select__option${P?" is-selected":""}`,title:D.label,onFocus:()=>R(M),onClick:()=>{i(D.value),T(!0)},onKeyDown:L=>{L.key==="Enter"||L.key===" "?(L.preventDefault(),i(D.value),T(!0)):L.key==="ArrowDown"?(L.preventDefault(),_(M+1)):L.key==="ArrowUp"?(L.preventDefault(),_(M-1)):L.key==="Home"?(L.preventDefault(),_(0)):L.key==="End"&&(L.preventDefault(),_(n.length-1))},children:D.label},D.value)})]}):null,c?o.jsx("span",{id:m,className:"skill-config-select__error",role:"alert",children:c}):null]})}function yr(e,t){return e instanceof Error?e:typeof e=="string"&&e.trim()?new Error(e.trim()):new Error(t)}function ps({error:e}){var s,a,l,c,u;const{t}=je("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 $V=Symbol.for("yaml.alias"),B8=Symbol.for("yaml.document"),Km=Symbol.for("yaml.map"),C5e=Symbol.for("yaml.pair"),Uf=Symbol.for("yaml.scalar"),c1=Symbol.for("yaml.seq"),ed=Symbol.for("yaml.node.type"),u1=e=>!!e&&typeof e=="object"&&e[ed]===$V,cT=e=>!!e&&typeof e=="object"&&e[ed]===B8,uT=e=>!!e&&typeof e=="object"&&e[ed]===Km,wo=e=>!!e&&typeof e=="object"&&e[ed]===C5e,ns=e=>!!e&&typeof e=="object"&&e[ed]===Uf,dT=e=>!!e&&typeof e=="object"&&e[ed]===c1;function yo(e){if(e&&typeof e=="object")switch(e[ed]){case Km:case c1:return!0}return!1}function xo(e){if(e&&typeof e=="object")switch(e[ed]){case $V:case Km:case Uf:case c1:return!0}return!1}const T5e=e=>(ns(e)||yo(e))&&!!e.anchor,kb=Symbol("break visit"),iLt=Symbol("skip children"),oS=Symbol("remove node");function d1(e,t){const n=rLt(t);cT(e)?Uv(null,e.contents,n,Object.freeze([e]))===oS&&(e.contents=null):Uv(null,e,n,Object.freeze([]))}d1.BREAK=kb;d1.SKIP=iLt;d1.REMOVE=oS;function Uv(e,t,n,i){const r=sLt(e,t,n,i);if(xo(r)||wo(r))return oLt(e,i,r),Uv(e,r,n,i);if(typeof r!="symbol"){if(yo(t)){i=Object.freeze(i.concat(t));for(let s=0;se.replace(/[!,[\]{}]/g,t=>aLt[t]);class kl{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},kl.defaultYaml,t),this.tags=Object.assign({},kl.defaultTags,n)}clone(){const t=new kl(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new kl(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:kl.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},kl.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:kl.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},kl.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+lLt(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&&xo(t.contents)){const s={};d1(t.contents,(a,l)=>{xo(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(` -`)}}kl.defaultYaml={explicit:!1,version:"1.2"};kl.defaultTags={"!!":"tag:yaml.org,2002:"};function A5e(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 _5e(e){const t=new Set;return d1(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function j5e(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function cLt(e,t){const n=[],i=new Map;let r=null;return{onAnchor:s=>{n.push(s),r??(r=_5e(e));const a=j5e(t,r);return r.add(a),a},setAnchors:()=>{for(const s of n){const a=i.get(s);if(typeof a=="object"&&a.anchor&&(ns(a.node)||yo(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 Qv(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;rKu(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!T5e(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 FV{constructor(t){Object.defineProperty(this,ed,{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(!cT(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=Ku(this,"",a);if(typeof r=="function")for(const{count:c,res:u}of a.anchors.values())r(u,c);return typeof s=="function"?Qv(s,{"":l},"",l):l}}let BV=class extends FV{constructor(t){super($V),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let i;n!=null&&n.aliasResolveCache?i=n.aliasResolveCache:(i=[],d1(t,{Node:(s,a)=>{(u1(a)||T5e(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||(Ku(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=fj(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(A5e(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 fj(e,t,n){if(u1(t)){const i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(yo(t)){let i=0;for(const r of t.items){const s=fj(e,r,n);s>i&&(i=s)}return i}else if(wo(t)){const i=fj(e,t.key,n),r=fj(e,t.value,n);return Math.max(i,r)}return 1}const N5e=e=>!e||typeof e!="function"&&typeof e!="object";class ui extends FV{constructor(t){super(Uf),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Ku(this.value,t,n)}toString(){return String(this.value)}}ui.BLOCK_FOLDED="BLOCK_FOLDED";ui.BLOCK_LITERAL="BLOCK_LITERAL";ui.PLAIN="PLAIN";ui.QUOTE_DOUBLE="QUOTE_DOUBLE";ui.QUOTE_SINGLE="QUOTE_SINGLE";const uLt="tag:yaml.org,2002:";function dLt(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 CE(e,t,n){var f,h,m;if(cT(e)&&(e=e.contents),xo(e))return e;if(wo(e)){const g=(h=(f=n.schema[Km]).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 BV(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=uLt+t.slice(2));let u=dLt(e,t,a.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new ui(e);return c&&(c.node=g),g}u=e instanceof Map?a[Km]:Symbol.iterator in Object(e)?a[c1]:a[Km]}s&&(s(u),delete n.onTagObj);const d=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((m=u==null?void 0:u.nodeClass)==null?void 0:m.from)=="function"?u.nodeClass.from(n.schema,e,n):new ui(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function pR(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 CE(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 ck=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class R5e extends FV{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=>xo(i)||wo(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(ck(t))this.add(n);else{const[i,...r]=t,s=this.get(i,!0);if(yo(s))s.addIn(r,n);else if(s===void 0&&this.schema)this.set(i,pR(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(yo(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&&ns(s)?s.value:s:yo(s)?s.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!wo(n))return!1;const i=n.value;return i==null||t&&ns(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 yo(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(yo(s))s.setIn(r,n);else if(s===void 0&&this.schema)this.set(i,pR(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}}const fLt=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Fh(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Bb=(e,t,n)=>e.endsWith(` +`),f=j5e(d,!t||i,r),{ref:h,onScroll:m}=n5e(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(RV,{className:`thinking-logo ${t?"":"is-active"}`})}),t?o.jsx("span",{className:"think-label think-label--done",children:s("blocks.thinkingDone")}):o.jsx(bn,{className:"think-label",duration:2.4,spread:18,children:s("blocks.thinking")}),o.jsx(jC,{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:m,children:f})})})]})}function J5t({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(RV,{className:"thinking-logo is-active"})}),o.jsx(bn,{className:"think-label",duration:2.4,spread:18,children:e})]})})}function eLt({value:e,onResolve:t,onResolveComparison:n,onDownload:i,onDeploy:r}){const{t:s,i18n:a}=_e("conversation"),l=j=>j.split(new RegExp("(?<=[/_-])")).map((_,I)=>o.jsxs(p.Fragment,{children:[_,o.jsx("wbr",{})]},`${I}:${_}`)),[c,u]=p.useState(e.files?e:null),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[g,b]=p.useState(null),[v,y]=p.useState(null),[w,x]=p.useState(""),[O,S]=p.useState(null),k=new Date(e.validatedAt),C=e.validatedAt?Number.isNaN(k.getTime())?e.validatedAt:k.toLocaleString(a.resolvedLanguage??a.language,{hour12:!1}):s("blocks.justNow");p.useEffect(()=>{if(!O)return;const j=window.setTimeout(()=>S(null),H5t);return()=>window.clearTimeout(j)},[O]);async function E(){if(c)return c;if(!t)throw new Error(s("blocks.sourceUnavailable"));const j=await t(e);return u(j),j}async function R(){y("source"),x(""),S(null);try{await E(),f(!0)}catch(j){x(j instanceof Error?j.message:String(j))}finally{y(null)}}async function A(){if(i){y("download"),x(""),S(null);try{await i(e),S({message:s("blocks.downloadStarted")})}catch(j){x(j instanceof Error?j.message:String(j))}finally{y(null)}}}async function N(){if(n){y("compare"),x(""),S(null);try{const j=g??await n(e);b(j),m(!0)}catch(j){x(j instanceof Error?j.message:String(j))}finally{y(null)}}}async function T(){y("deploy"),x(""),S(null);try{r==null||r(await E())}catch(j){x(j instanceof Error?j.message:String(j))}finally{y(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(N5t,{}):o.jsx(j5t,{})}),o.jsxs("div",{className:"delivery-card-heading",children:[o.jsx("strong",{children:l(e.agentName)}),o.jsx("span",{children:e.verified?s("blocks.verifiedDelivery"):s("blocks.generatedSource")})]})]}),o.jsxs("dl",{className:"delivery-card-grid",children:[o.jsxs("div",{className:"delivery-card-entry",children:[o.jsx("dt",{children:s("blocks.entryPoint")}),o.jsx("dd",{children:o.jsx("code",{children:l(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",{className:"delivery-card-time",children:[o.jsx("dt",{children:e.verified?s("blocks.validationTime"):s("blocks.generationTime")}),o.jsx("dd",{children:C})]})]}),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("div",{className:"delivery-card-secondary-actions",children:[o.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void R(),disabled:!t||v!==null,children:[v==="source"?o.jsx(Bi,{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 N(),disabled:!n||v!==null,children:[v==="compare"?o.jsx(Bi,{className:"spin","aria-hidden":"true"}):null,s(v==="compare"?"blocks.preparing":"blocks.viewChanges")]}):null,o.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void A(),disabled:!i||v!==null,"aria-busy":v==="download",children:[v==="download"?o.jsx(Bi,{className:"spin","aria-hidden":"true"}):null,s(v==="download"?"blocks.preparing":"blocks.downloadSource")]})]}),o.jsxs("button",{type:"button",className:"delivery-card-primary",onClick:()=>void T(),disabled:!e.deployable||!r||!t||v!==null,title:e.deployable?s("blocks.manualDeploy"):s("blocks.sourceNotReady"),children:[v==="deploy"?o.jsx(Bi,{className:"spin","aria-hidden":"true"}):null,s("blocks.deployAgent")]})]}),w?o.jsx("p",{className:"delivery-card-error",role:"alert",children:w}):null,O?o.jsx("p",{className:"delivery-card-status",role:"status","aria-live":"polite",children:O.message}):null]}),o.jsx(mw,{project:{name:e.agentName,files:(c==null?void 0:c.files)??[]},open:d,onClose:()=>f(!1),onChange:()=>{},readOnly:!0}),o.jsx(mw,{project:{name:(g==null?void 0:g.target.agentName)??e.agentName,files:(g==null?void 0:g.target.files)??[]},comparison:g?{baseProject:{name:g.base.agentName,files:g.base.files??[]},baseLabel:s("blocks.beforeOptimization"),targetLabel:s("blocks.afterOptimization")}:void 0,open:h,onClose:()=>m(!1),onChange:()=>{},readOnly:!0})]})}function R5e(){return o.jsx(N5e,{text:"",done:!1})}const tLt=p.memo(function({text:t,streaming:n,onStreamFrame:i,onStreamComplete:r}){const s=j5e(t,n,i,r);return s?o.jsx("div",{className:"bubble",children:o.jsx(Zu,{text:s,streaming:n})}):null});function nLt({title:e,summary:t,items:n,done:i}){const{t:r}=_e("conversation"),[s,a]=p.useState(!i),l=p.useRef(!1);p.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(G5t,{})}),i?o.jsx("span",{className:"plan-title",children:e}):o.jsx(bn,{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(l1,{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 iLt(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 rLt({name:e,args:t,response:n,done:i,status:r,defaultOpen:s=!1,retrying:a=!1,codexActivity:l,native:c=!1,progressText:u,onBranchSelect:d,onAction:f}){const{t:h}=_e("conversation"),g=e==="create_agents"&&i&&QMt(t,n)?"failed":r??(i?"completed":"running"),b=e==="create_agents"&&g==="failed"&&a,v=_5t(e),y=v==null?void 0:v.detailRenderer,w=(v==null?void 0:v.hideHeader)===!0,x=w||s||!!y||!!l,[O,S]=p.useState(x),k=p.useRef(!1);p.useEffect(()=>{!k.current&&x&&S(!0)},[x]);const C=()=>{k.current=!0,S(T=>!T)},E=e===_5e?h("blocks.renderUi"):e,R=iLt(n),A=n==null?null:typeof n=="string"?n:JSON.stringify(n,null,2),N=!c&&A&&A.length>2e3?`${A.slice(0,2e3)} +${h("blocks.truncated")}`:A;return o.jsxs(mr.div,{className:`block-tool${v?" block-tool--builtin":""}`,"data-status":g,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[v&&!w?o.jsx(MMt,{definition:v,label:b?h("blocks.agentAdjusting"):g==="failed"?h(`blocks.tools.${v.name}.failed`,{defaultValue:v.failedLabel??v.doneLabel}):Z5t(e,t,h),done:i,open:O,onToggle:C}):v?null:o.jsxs("button",{className:"tool-head tool-head--generic",onClick:C,type:"button","aria-expanded":O,children:[o.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:c?o.jsx(pD,{kind:"tool"}):o.jsx(K5t,{})}),i?o.jsx("span",{className:"tool-name",children:E}):o.jsx(bn,{className:"tool-name",duration:2.2,spread:15,children:E}),c&&g==="failed"&&o.jsx("span",{className:"development-tool-failure",children:o.jsx(Rx,{ns:"adk",i18nKey:"developmentRuns.toolFailed"})}),o.jsx(l1,{className:`tool-chevron${O?" is-open":""}`})]}),o.jsx("div",{className:`${w?"":"think-collapse "}${O?"open":""}`,children:o.jsxs("div",{className:"think-collapse-inner",children:[l?o.jsxs("section",{className:"codex-sandbox-run","aria-label":h("blocks.sandboxDetails"),children:[o.jsxs("div",{className:"codex-sandbox-run__label",children:[o.jsxs("span",{className:"codex-sandbox-run__badge",children:[o.jsx(X5t,{}),o.jsx("span",{children:"Codex Sandbox"})]}),o.jsx("span",{className:"codex-sandbox-run__title",children:l.title})]}),o.jsx(Y5t,{activity:l}),o.jsx("div",{className:"codex-sandbox-run__stream",children:l.items.length>0?o.jsx(jy,{blocks:l.items.map(T=>T.block),streaming:!i,onAction:f}):o.jsx(bn,{className:"codex-sandbox-run__empty",children:h("blocks.waitingCodex")})})]}):null,y?o.jsx(y,{args:t,response:n,status:g,onBranchSelect:d}):l?null:o.jsxs("div",{className:"tool-detail",children:[u&&o.jsx("div",{className:"development-tool-meta",children:u}),t!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:h("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:h("blocks.result")}),o.jsx("pre",{className:"tool-args tool-result",children:N})]}),R.length>0&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:h("blocks.artifacts")}),o.jsx("div",{className:"studio-tool-artifacts",children:R.map(T=>o.jsx("a",{href:T.contentUrl,download:T.name,children:h("blocks.downloadNamed",{name:T.name})},`${T.contentUrl}:${T.name}`))})]})]})]})})]})}function sLt({block:e,onDownload:t,onPreview:n}){const{t:i}=_e("conversation"),[r,s]=p.useState(""),[a,l]=p.useState(""),[c,u]=p.useState(null);p.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("")}}},m=e.files.filter(g=>!g.filename.endsWith(".preview.webp"));return o.jsxs("div",{className:"artifact-list",children:[m.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(gQ,{})}),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(Bi,{className:"spin"}):o.jsx(ert,{}),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(Bi,{className:"spin"}):o.jsx(bP,{}),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(Ta,{})})]}),o.jsx("div",{className:"artifact-preview__canvas",children:o.jsx("img",{src:c.url,alt:i("blocks.slidePreview",{name:c.name})})})]})]})]})}function oLt({block:e,onAuth:t}){const{t:n}=_e("conversation"),[i,r]=p.useState(e.done?"done":"idle"),[s,a]=p.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(mr.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[o.jsx(aZ,{className:"auth-card-icon auth-card-icon--done"}),o.jsx("span",{children:n("blocks.authorized",{tool:l})})]}):o.jsxs(mr.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(aZ,{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(Rx,{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(Rx,{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(Bi,{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 jy({groupProcess:e=!1,liveStatus:t,blocks:n,appName:i="",streaming:r=!1,onStreamFrame:s,onStreamComplete:a,onAction:l,onAuth:c,onArtifactDownload:u,onArtifactPreview:d,onResolveDelivery:f,onResolveDeliveryComparison:h,onDownloadDelivery:m,onDeployDelivery:g,onBranchSelect:b}){if(e)return o.jsx(SMt,{blocks:n,active:r,status:t,render:y=>o.jsx(jy,{blocks:y,appName:i,streaming:r,onStreamFrame:s,onStreamComplete:a,onAction:l,onAuth:c,onArtifactDownload:u,onArtifactPreview:d,onResolveDelivery:f,onResolveDeliveryComparison:h,onDownloadDelivery:m,onDeployDelivery:g,onBranchSelect:b})});const v=n.reduce((y,w,x)=>w.kind==="text"?x:y,-1);return o.jsx(o.Fragment,{children:n.map((y,w)=>{switch(y.kind){case"turn-summary":return o.jsx(OMt,{value:y.value},y.id||w);case"diff":return o.jsxs("details",{className:"development-diff",children:[o.jsxs("summary",{children:[o.jsx("span",{className:"tool-icon",children:o.jsx(pD,{kind:"diff"})}),o.jsx("span",{children:o.jsx(Rx,{ns:"adk",i18nKey:"developmentRuns.diff"})}),o.jsx(l1,{className:"tool-chevron"})]}),o.jsx("pre",{children:y.text})]},y.id??w);case"progress":return o.jsx(J5t,{text:y.text},"build-progress");case"thinking":{const x=n.slice(w+1).some(O=>O.kind==="text"&&!!O.text.trim());return o.jsx(N5e,{text:y.text,done:y.done,answerStarted:x,streaming:r,onStreamFrame:s},y.id??w)}case"text":{const x=y.text.replace(/^\s+/,"");return x?o.jsx(tLt,{text:x,streaming:r,onStreamFrame:s,onStreamComplete:w===v?a:void 0},y.id??w):null}case"plan":return o.jsx(nLt,{title:y.title,summary:y.summary,items:y.items,done:y.done},y.id??w);case"attachment":return o.jsx(gD,{appName:i,items:y.files},y.id??w);case"artifact":return o.jsx(sLt,{block:y,onDownload:u,onPreview:d},y.id??w);case"delivery":return o.jsx(eLt,{value:y.value,onResolve:f,onResolveComparison:h,onDownload:m,onDeploy:g},y.id??w);case"invocation":return o.jsx(mD,{value:y.value},y.id??w);case"tool":{if(y.name===_5e&&y.done)return null;const x=y.name==="create_agents"&&n.slice(w+1).some(O=>O.kind==="tool"&&O.name==="create_agents");return o.jsx(rLt,{name:y.itemType?kTe(y):y.name,native:!!y.itemType,progressText:y.progressText,args:y.args,response:y.response,done:y.done,status:y.status,defaultOpen:y.defaultOpen,retrying:y.name==="create_agents"&&(r||x),codexActivity:y.codexActivity,onBranchSelect:b,onAction:l},y.id??w)}case"agent-transfer":return null;case"auth":return o.jsx(oLt,{block:y,onAuth:c},y.id??w);case"a2ui":return t5e(y.messages).filter(x=>x.components[x.rootId]).map(x=>o.jsx(mr.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(IMt,{surface:x,onAction:l})},`${w}-${x.surfaceId}`));default:return null}})})}const aLt=()=>{};function lLt(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(tn("conversation.unsupportedActivity"))}function cLt({activities:e}){const{t}=_e("skills"),n=p.useMemo(()=>e.filter(i=>i.kind!=="status").map(lLt),[e]);return n.length===0?null:o.jsx("div",{className:"skill-conversation","aria-label":t("conversation.ariaLabel"),"aria-live":"polite",children:o.jsx(jy,{blocks:n,onAction:aLt})})}function vne(){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 uj({label:e,value:t,options:n,onChange:i,disabled:r=!1,allowCustom:s=!1,required:a=!1,placeholder:l,error:c}){const{t:u}=_e("skills"),d=l??u("configSelect.placeholder"),f=p.useId(),h=p.useId(),m=p.useId(),g=p.useRef(null),b=p.useRef(null),v=p.useRef(null),y=p.useRef(null),w=p.useRef([]),x=n.findIndex(I=>I.value===t),O=t.trim().toLocaleLowerCase(),S=s&&O?n.filter(I=>I.value.toLocaleLowerCase().includes(O)||I.label.toLocaleLowerCase().includes(O)):n,[k,C]=p.useState(!1),[E,R]=p.useState(Math.max(0,x)),A=x>=0?n[x]:void 0,N=r||!s&&n.length===0,T=(I=!1)=>{C(!1),I&&window.requestAnimationFrame(()=>{var D,P;return s?(D=v.current)==null?void 0:D.focus():(P=b.current)==null?void 0:P.focus()})},j=I=>{N||S.length!==0&&(R(Math.min(Math.max(I,0),S.length-1)),C(!0))};p.useEffect(()=>{if(!k)return;const I=y.current,D=s?void 0:window.requestAnimationFrame(()=>{var M;(M=w.current[E])==null||M.focus()}),P=M=>{if(!I)return;const H=I.scrollTop<=0,K=I.scrollTop+I.clientHeight>=I.scrollHeight-1;(I.scrollHeight<=I.clientHeight||M.deltaY<0&&H||M.deltaY>0&&K)&&M.preventDefault(),M.stopPropagation()},L=M=>{var H;M.target instanceof Node&&!((H=g.current)!=null&&H.contains(M.target))&&T()},B=M=>{M.key==="Escape"&&T(!0)};return I==null||I.addEventListener("wheel",P,{passive:!1}),window.addEventListener("pointerdown",L),window.addEventListener("keydown",B),()=>{D!==void 0&&window.cancelAnimationFrame(D),I==null||I.removeEventListener("wheel",P),window.removeEventListener("pointerdown",L),window.removeEventListener("keydown",B)}},[E,s,k]);const _=I=>{var P;if(S.length===0)return;const D=(I+S.length)%S.length;R(D),(P=w.current[D])==null||P.focus()};return o.jsxs("div",{ref:g,className:`skill-config-select${k?" is-open":""}`,onBlur:I=>{var D;(!I.relatedTarget||!((D=g.current)!=null&&D.contains(I.relatedTarget)))&&T()},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":k,children:[o.jsx("input",{ref:v,value:t,disabled:r,role:"combobox","aria-autocomplete":"list","aria-expanded":k,"aria-controls":k?f:void 0,"aria-labelledby":h,"aria-required":a,"aria-invalid":!!c,"aria-describedby":c?m:void 0,placeholder:d,onChange:I=>{i(I.target.value),R(0),n.length>0&&C(!0)},onClick:()=>{!k&&S.length>0&&j(0)},onKeyDown:I=>{var D,P;if(!(I.nativeEvent.isComposing||I.keyCode===229))if(I.key==="ArrowDown")I.preventDefault(),k?(D=w.current[E])==null||D.focus():j(0);else if(I.key==="ArrowUp")I.preventDefault(),k?(P=w.current[S.length-1])==null||P.focus():j(S.length-1);else if(I.key==="Enter"&&k){I.preventDefault();const L=S[E];L&&i(L.value),T()}else I.key==="Escape"&&(I.preventDefault(),T())}}),o.jsx("button",{type:"button",className:"skill-config-select__toggle",disabled:r||n.length===0,"aria-label":u(k?"configSelect.collapseOptions":"configSelect.expandOptions"),onClick:()=>{k?T():j(0)},children:o.jsx(vne,{})})]}):o.jsxs("button",{ref:b,type:"button",className:"skill-config-select__trigger",disabled:N,"aria-haspopup":"listbox","aria-expanded":k,"aria-controls":k?f:void 0,"aria-labelledby":h,"aria-required":a,onClick:()=>{k?T():j(x>=0?x:0)},onKeyDown:I=>{I.key==="ArrowDown"?(I.preventDefault(),j(x>=0?x:0)):I.key==="ArrowUp"&&(I.preventDefault(),j(x>=0?x:n.length-1))},children:[o.jsx("span",{className:A?void 0:"is-placeholder",title:A==null?void 0:A.label,children:(A==null?void 0:A.label)||(n.length===0?u("configSelect.noOptions"):d)}),o.jsx(vne,{})]}),k?o.jsxs("div",{ref:y,id:f,className:"skill-config-select__menu",role:"listbox","aria-labelledby":h,children:[S.length===0?o.jsx("div",{className:"skill-config-select__empty",role:"status",children:u("configSelect.noMatches")}):null,S.map((I,D)=>{const P=I.value===t;return o.jsx("button",{ref:L=>{w.current[D]=L},type:"button",role:"option","aria-selected":P,tabIndex:D===E?0:-1,className:`skill-config-select__option${P?" is-selected":""}`,title:I.label,onFocus:()=>R(D),onClick:()=>{i(I.value),T(!0)},onKeyDown:L=>{L.key==="Enter"||L.key===" "?(L.preventDefault(),i(I.value),T(!0)):L.key==="ArrowDown"?(L.preventDefault(),_(D+1)):L.key==="ArrowUp"?(L.preventDefault(),_(D-1)):L.key==="Home"?(L.preventDefault(),_(0)):L.key==="End"&&(L.preventDefault(),_(n.length-1))},children:I.label},I.value)})]}):null,c?o.jsx("span",{id:m,className:"skill-config-select__error",role:"alert",children:c}):null]})}function Er(e,t){return e instanceof Error?e:typeof e=="string"&&e.trim()?new Error(e.trim()):new Error(t)}function bs({error:e}){var s,a,l,c,u;const{t}=_e("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 $V=Symbol.for("yaml.alias"),B8=Symbol.for("yaml.document"),Gm=Symbol.for("yaml.map"),I5e=Symbol.for("yaml.pair"),Qf=Symbol.for("yaml.scalar"),c1=Symbol.for("yaml.seq"),Ju=Symbol.for("yaml.node.type"),u1=e=>!!e&&typeof e=="object"&&e[Ju]===$V,cT=e=>!!e&&typeof e=="object"&&e[Ju]===B8,uT=e=>!!e&&typeof e=="object"&&e[Ju]===Gm,So=e=>!!e&&typeof e=="object"&&e[Ju]===I5e,ns=e=>!!e&&typeof e=="object"&&e[Ju]===Qf,dT=e=>!!e&&typeof e=="object"&&e[Ju]===c1;function wo(e){if(e&&typeof e=="object")switch(e[Ju]){case Gm:case c1:return!0}return!1}function ko(e){if(e&&typeof e=="object")switch(e[Ju]){case $V:case Gm:case Qf:case c1:return!0}return!1}const P5e=e=>(ns(e)||wo(e))&&!!e.anchor,Sb=Symbol("break visit"),uLt=Symbol("skip children"),oS=Symbol("remove node");function d1(e,t){const n=dLt(t);cT(e)?Uv(null,e.contents,n,Object.freeze([e]))===oS&&(e.contents=null):Uv(null,e,n,Object.freeze([]))}d1.BREAK=Sb;d1.SKIP=uLt;d1.REMOVE=oS;function Uv(e,t,n,i){const r=fLt(e,t,n,i);if(ko(r)||So(r))return hLt(e,i,r),Uv(e,r,n,i);if(typeof r!="symbol"){if(wo(t)){i=Object.freeze(i.concat(t));for(let s=0;se.replace(/[!,[\]{}]/g,t=>pLt[t]);class El{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},El.defaultYaml,t),this.tags=Object.assign({},El.defaultTags,n)}clone(){const t=new El(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new El(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:El.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},El.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:El.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},El.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+mLt(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&&ko(t.contents)){const s={};d1(t.contents,(a,l)=>{ko(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(` +`)}}El.defaultYaml={explicit:!1,version:"1.2"};El.defaultTags={"!!":"tag:yaml.org,2002:"};function D5e(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 M5e(e){const t=new Set;return d1(e,{Value(n,i){i.anchor&&t.add(i.anchor)}}),t}function L5e(e,t){for(let n=1;;++n){const i=`${e}${n}`;if(!t.has(i))return i}}function gLt(e,t){const n=[],i=new Map;let r=null;return{onAnchor:s=>{n.push(s),r??(r=M5e(e));const a=L5e(t,r);return r.add(a),a},setAnchors:()=>{for(const s of n){const a=i.get(s);if(typeof a=="object"&&a.anchor&&(ns(a.node)||wo(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 Qv(e,t,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;rWu(i,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!P5e(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 FV{constructor(t){Object.defineProperty(this,Ju,{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(!cT(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=Wu(this,"",a);if(typeof r=="function")for(const{count:c,res:u}of a.anchors.values())r(u,c);return typeof s=="function"?Qv(s,{"":l},"",l):l}}let BV=class extends FV{constructor(t){super($V),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let i;n!=null&&n.aliasResolveCache?i=n.aliasResolveCache:(i=[],d1(t,{Node:(s,a)=>{(u1(a)||P5e(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||(Wu(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=dj(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(D5e(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 dj(e,t,n){if(u1(t)){const i=t.resolve(e),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(wo(t)){let i=0;for(const r of t.items){const s=dj(e,r,n);s>i&&(i=s)}return i}else if(So(t)){const i=dj(e,t.key,n),r=dj(e,t.value,n);return Math.max(i,r)}return 1}const $5e=e=>!e||typeof e!="function"&&typeof e!="object";class ci extends FV{constructor(t){super(Qf),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Wu(this.value,t,n)}toString(){return String(this.value)}}ci.BLOCK_FOLDED="BLOCK_FOLDED";ci.BLOCK_LITERAL="BLOCK_LITERAL";ci.PLAIN="PLAIN";ci.QUOTE_DOUBLE="QUOTE_DOUBLE";ci.QUOTE_SINGLE="QUOTE_SINGLE";const bLt="tag:yaml.org,2002:";function yLt(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 CE(e,t,n){var f,h,m;if(cT(e)&&(e=e.contents),ko(e))return e;if(So(e)){const g=(h=(f=n.schema[Gm]).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 BV(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=bLt+t.slice(2));let u=yLt(e,t,a.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new ci(e);return c&&(c.node=g),g}u=e instanceof Map?a[Gm]:Symbol.iterator in Object(e)?a[c1]:a[Gm]}s&&(s(u),delete n.onTagObj);const d=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((m=u==null?void 0:u.nodeClass)==null?void 0:m.from)=="function"?u.nodeClass.from(n.schema,e,n):new ci(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function mR(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 CE(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 uk=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class F5e extends FV{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=>ko(i)||So(i)?i.clone(t):i),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(uk(t))this.add(n);else{const[i,...r]=t,s=this.get(i,!0);if(wo(s))s.addIn(r,n);else if(s===void 0&&this.schema)this.set(i,mR(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(wo(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&&ns(s)?s.value:s:wo(s)?s.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!So(n))return!1;const i=n.value;return i==null||t&&ns(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 wo(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(wo(s))s.setIn(r,n);else if(s===void 0&&this.schema)this.set(i,mR(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}}const vLt=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Fh(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Ub=(e,t,n)=>e.endsWith(` `)?Fh(n,t):n.includes(` `)?` -`+Fh(n,t):(e.endsWith(" ")?"":" ")+n,I5e="flow",U8="block",hj="quoted";function vD(e,t,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:a,onOverflow:l}={}){if(!r||r<0)return e;rr-Math.max(2,s)?u.push(0):f=r-i);let h,m,g=!1,b=-1,v=-1,y=-1;n===U8&&(b=xne(e,b,t.length),b!==-1&&(f=b+c));for(let x;x=e[b+=1];){if(n===hj&&x==="\\"){switch(v=b,e[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}y=b}if(x===` +`+Fh(n,t):(e.endsWith(" ")?"":" ")+n,B5e="flow",U8="block",fj="quoted";function xD(e,t,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:a,onOverflow:l}={}){if(!r||r<0)return e;rr-Math.max(2,s)?u.push(0):f=r-i);let h,m,g=!1,b=-1,v=-1,y=-1;n===U8&&(b=xne(e,b,t.length),b!==-1&&(f=b+c));for(let x;x=e[b+=1];){if(n===fj&&x==="\\"){switch(v=b,e[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}y=b}if(x===` `)n===U8&&(b=xne(e,b,t.length)),f=b+t.length+c,h=void 0;else{if(x===" "&&m&&m!==" "&&m!==` `&&m!==" "){const O=e[b+1];O&&O!==" "&&O!==` -`&&O!==" "&&(h=b)}if(b>=f)if(h)u.push(h),f=h+c,h=void 0;else if(n===hj){for(;m===" "||m===" ";)m=x,x=e[b+=1],g=!0;const O=b>y+1?b-2:v-1;if(d[O])return e;u.push(O),d[O]=!0,f=O+c,h=void 0}else g=!0}m=x}if(g&&l&&l(),u.length===0)return e;a&&a();let w=e.slice(0,u[0]);for(let x=0;x=f)if(h)u.push(h),f=h+c,h=void 0;else if(n===fj){for(;m===" "||m===" ";)m=x,x=e[b+=1],g=!0;const O=b>y+1?b-2:v-1;if(d[O])return e;u.push(O),d[O]=!0,f=O+c,h=void 0}else g=!0}m=x}if(g&&l&&l(),u.length===0)return e;a&&a();let w=e.slice(0,u[0]);for(let x=0;x({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),wD=e=>/^(%|---|\.\.\.)/m.test(e);function hLt(e,t,n){if(!t||t<0)return!1;const i=t-n,r=e.length;if(r<=i)return!1;for(let s=0,a=0;si)return!0;if(a=s+1,r-a<=i)return!1}return!0}function aS(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:i}=t,r=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(wD(e)?" ":"");let a="",l=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(a+=n.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{a+=n.slice(l,c);const d=n.substr(c+2,4);switch(d){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:d.substr(0,2)==="00"?a+="\\x"+d.substr(2):a+=n.substr(c,6)}c+=5,l=c+1}break;case"n":if(i||n[c+2]==='"'||n.length({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),OD=e=>/^(%|---|\.\.\.)/m.test(e);function xLt(e,t,n){if(!t||t<0)return!1;const i=t-n,r=e.length;if(r<=i)return!1;for(let s=0,a=0;si)return!0;if(a=s+1,r-a<=i)return!1}return!0}function aS(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:i}=t,r=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(OD(e)?" ":"");let a="",l=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(a+=n.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{a+=n.slice(l,c);const d=n.substr(c+2,4);switch(d){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:d.substr(0,2)==="00"?a+="\\x"+d.substr(2):a+=n.substr(c,6)}c+=5,l=c+1}break;case"n":if(i||n[c+2]==='"'||n.length `;let f,h;for(h=n.length;h>0;--h){const S=n[h-1];if(S!==` `&&S!==" "&&S!==" ")break}let m=n.substring(h);const g=m.indexOf(` `);g===-1?f="-":n===m||g!==m.length-1?(f="+",s&&s()):f="",m&&(n=n.slice(0,-m.length),m[m.length-1]===` `&&(m=m.slice(0,-1)),m=m.replace(z8,`$&${u}`));let b=!1,v,y=-1;for(v=0;v{k=!0});const E=vD(`${w}${S}${m}`,u,U8,C);if(!k)return`>${O} +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`);let k=!1;const C=wD(i,!0);a!=="folded"&&t!==ci.BLOCK_FOLDED&&(C.onOverflow=()=>{k=!0});const E=xD(`${w}${S}${m}`,u,U8,C);if(!k)return`>${O} ${u}${E}`}return n=n.replace(/\n+/g,`$&${u}`),`|${O} -${u}${w}${n}${m}`}function pLt(e,t,n,i){const{type:r,value:s}=e,{actualString:a,implicitKey:l,indent:c,indentStep:u,inFlow:d}=t;if(l&&s.includes(` +${u}${w}${n}${m}`}function wLt(e,t,n,i){const{type:r,value:s}=e,{actualString:a,implicitKey:l,indent:c,indentStep:u,inFlow:d}=t;if(l&&s.includes(` `)||d&&/[[\]{},]/.test(s))return zv(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||d||!s.includes(` -`)?zv(s,t):pj(e,t,n,i);if(!l&&!d&&r!==ui.PLAIN&&s.includes(` -`))return pj(e,t,n,i);if(wD(s)){if(c==="")return t.forceBlockIndent=!0,pj(e,t,n,i);if(l&&c===u)return zv(s,t)}const f=s.replace(/\n+/g,`$& -${c}`);if(a){const h=b=>{var v;return b.default&&b.tag!=="tag:yaml.org,2002:str"&&((v=b.test)==null?void 0:v.test(f))},{compat:m,tags:g}=t.doc.schema;if(g.some(h)||m!=null&&m.some(h))return zv(s,t)}return l?f:vD(f,c,I5e,xD(t,!1))}function UV(e,t,n,i){const{implicitKey:r,inFlow:s}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:l}=e;l!==ui.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(l=ui.QUOTE_DOUBLE);const c=d=>{switch(d){case ui.BLOCK_FOLDED:case ui.BLOCK_LITERAL:return r||s?zv(a.value,t):pj(a,t,n,i);case ui.QUOTE_DOUBLE:return aS(a.value,t);case ui.QUOTE_SINGLE:return Q8(a.value,t);case ui.PLAIN:return pLt(a,t,n,i);default:return null}};let u=c(l);if(u===null){const{defaultKeyType:d,defaultStringType:f}=t.options,h=r&&d||f;if(u=c(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}function P5e(e,t){const n=Object.assign({blockQuote:!0,commentString:fLt,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function mLt(e,t){var r;if(t.tag){const s=e.filter(a=>a.tag===t.tag);if(s.length>0)return s.find(a=>a.format===t.format)??s[0]}let n,i;if(ns(t)){i=t.value;let s=e.filter(a=>{var l;return(l=a.identify)==null?void 0:l.call(a,i)});if(s.length>1){const a=s.filter(l=>l.test);a.length>0&&(s=a)}n=s.find(a=>a.format===t.format)??s.find(a=>!a.format)}else i=t,n=e.find(s=>s.nodeClass&&i instanceof s.nodeClass);if(!n){const s=((r=i==null?void 0:i.constructor)==null?void 0:r.name)??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${s} value`)}return n}function gLt(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const r=[],s=(ns(e)||yo(e))&&e.anchor;s&&A5e(s)&&(n.add(s),r.push(`&${s}`));const a=e.tag??(t.default?null:t.tag);return a&&r.push(i.directives.tagString(a)),r.join(" ")}function gw(e,t,n,i){var c;if(wo(e))return e.toString(t,n,i);if(u1(e)){if(t.doc.directives)return e.toString(t);if((c=t.resolvedAliases)!=null&&c.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r;const s=xo(e)?e:t.doc.createNode(e,{onTagObj:u=>r=u});r??(r=mLt(t.doc.schema.tags,s));const a=gLt(s,r,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const l=typeof r.stringify=="function"?r.stringify(s,t,n,i):ns(s)?UV(s,t,n,i):s.toString(t,n,i);return a?ns(s)||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a} -${t.indent}${l}`:l}function bLt({key:e,value:t},n,i,r){const{allNullValues:s,doc:a,indent:l,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=xo(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(yo(e)||!xo(e)&&typeof e=="object"){const C="With simple keys, collection cannot be used as a key value";throw new Error(C)}}let m=!f&&(!e||h&&t==null&&!n.inFlow||yo(e)||(ns(e)?e.type===ui.BLOCK_FOLDED||e.type===ui.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(f||!s),indent:l+c});let g=!1,b=!1,v=gw(e,n,()=>g=!0,()=>b=!0);if(!m&&!n.inFlow&&v.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(n.inFlow){if(s||t==null)return g&&i&&i(),v===""?"?":m?`? ${v}`:v}else if(s&&!f||t==null&&m)return v=`? ${v}`,h&&!g?v+=Bb(v,n.indent,u(h)):b&&r&&r(),v;g&&(h=null),m?(h&&(v+=Bb(v,n.indent,u(h))),v=`? ${v} -${l}:`):(v=`${v}:`,h&&(v+=Bb(v,n.indent,u(h))));let y,w,x;xo(t)?(y=!!t.spaceBefore,w=t.commentBefore,x=t.comment):(y=!1,w=null,x=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!m&&!h&&ns(t)&&(n.indentAtStart=v.length+1),b=!1,!d&&c.length>=2&&!n.inFlow&&!m&&dT(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let O=!1;const S=gw(t,n,()=>O=!0,()=>b=!0);let k=" ";if(h||y||w){if(k=y?` +`)?zv(s,t):hj(e,t,n,i);if(!l&&!d&&r!==ci.PLAIN&&s.includes(` +`))return hj(e,t,n,i);if(OD(s)){if(c==="")return t.forceBlockIndent=!0,hj(e,t,n,i);if(l&&c===u)return zv(s,t)}const f=s.replace(/\n+/g,`$& +${c}`);if(a){const h=b=>{var v;return b.default&&b.tag!=="tag:yaml.org,2002:str"&&((v=b.test)==null?void 0:v.test(f))},{compat:m,tags:g}=t.doc.schema;if(g.some(h)||m!=null&&m.some(h))return zv(s,t)}return l?f:xD(f,c,B5e,wD(t,!1))}function UV(e,t,n,i){const{implicitKey:r,inFlow:s}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:l}=e;l!==ci.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(l=ci.QUOTE_DOUBLE);const c=d=>{switch(d){case ci.BLOCK_FOLDED:case ci.BLOCK_LITERAL:return r||s?zv(a.value,t):hj(a,t,n,i);case ci.QUOTE_DOUBLE:return aS(a.value,t);case ci.QUOTE_SINGLE:return Q8(a.value,t);case ci.PLAIN:return wLt(a,t,n,i);default:return null}};let u=c(l);if(u===null){const{defaultKeyType:d,defaultStringType:f}=t.options,h=r&&d||f;if(u=c(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}function U5e(e,t){const n=Object.assign({blockQuote:!0,commentString:vLt,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function OLt(e,t){var r;if(t.tag){const s=e.filter(a=>a.tag===t.tag);if(s.length>0)return s.find(a=>a.format===t.format)??s[0]}let n,i;if(ns(t)){i=t.value;let s=e.filter(a=>{var l;return(l=a.identify)==null?void 0:l.call(a,i)});if(s.length>1){const a=s.filter(l=>l.test);a.length>0&&(s=a)}n=s.find(a=>a.format===t.format)??s.find(a=>!a.format)}else i=t,n=e.find(s=>s.nodeClass&&i instanceof s.nodeClass);if(!n){const s=((r=i==null?void 0:i.constructor)==null?void 0:r.name)??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${s} value`)}return n}function kLt(e,t,{anchors:n,doc:i}){if(!i.directives)return"";const r=[],s=(ns(e)||wo(e))&&e.anchor;s&&D5e(s)&&(n.add(s),r.push(`&${s}`));const a=e.tag??(t.default?null:t.tag);return a&&r.push(i.directives.tagString(a)),r.join(" ")}function gw(e,t,n,i){var c;if(So(e))return e.toString(t,n,i);if(u1(e)){if(t.doc.directives)return e.toString(t);if((c=t.resolvedAliases)!=null&&c.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r;const s=ko(e)?e:t.doc.createNode(e,{onTagObj:u=>r=u});r??(r=OLt(t.doc.schema.tags,s));const a=kLt(s,r,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const l=typeof r.stringify=="function"?r.stringify(s,t,n,i):ns(s)?UV(s,t,n,i):s.toString(t,n,i);return a?ns(s)||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a} +${t.indent}${l}`:l}function SLt({key:e,value:t},n,i,r){const{allNullValues:s,doc:a,indent:l,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=ko(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(wo(e)||!ko(e)&&typeof e=="object"){const C="With simple keys, collection cannot be used as a key value";throw new Error(C)}}let m=!f&&(!e||h&&t==null&&!n.inFlow||wo(e)||(ns(e)?e.type===ci.BLOCK_FOLDED||e.type===ci.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(f||!s),indent:l+c});let g=!1,b=!1,v=gw(e,n,()=>g=!0,()=>b=!0);if(!m&&!n.inFlow&&v.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(n.inFlow){if(s||t==null)return g&&i&&i(),v===""?"?":m?`? ${v}`:v}else if(s&&!f||t==null&&m)return v=`? ${v}`,h&&!g?v+=Ub(v,n.indent,u(h)):b&&r&&r(),v;g&&(h=null),m?(h&&(v+=Ub(v,n.indent,u(h))),v=`? ${v} +${l}:`):(v=`${v}:`,h&&(v+=Ub(v,n.indent,u(h))));let y,w,x;ko(t)?(y=!!t.spaceBefore,w=t.commentBefore,x=t.comment):(y=!1,w=null,x=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!m&&!h&&ns(t)&&(n.indentAtStart=v.length+1),b=!1,!d&&c.length>=2&&!n.inFlow&&!m&&dT(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let O=!1;const S=gw(t,n,()=>O=!0,()=>b=!0);let k=" ";if(h||y||w){if(k=y?` `:"",w){const C=u(w);k+=` ${Fh(C,n.indent)}`}S===""&&!n.inFlow?k===` `&&x&&(k=` `):k+=` -${n.indent}`}else if(!m&&yo(t)){const C=S[0],E=S.indexOf(` -`),R=E!==-1,A=n.inFlow??t.flow??t.items.length===0;if(R||!A){let j=!1;if(R&&(C==="&"||C==="!")){let T=S.indexOf(" ");C==="&"&&T!==-1&&Te===vA||typeof e=="symbol"&&e.description===vA,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ui(Symbol(vA)),{addToJSMap:M5e}),stringify:()=>vA},yLt=(e,t)=>(Zh.identify(t)||ns(t)&&(!t.type||t.type===ui.PLAIN)&&Zh.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Zh.tag&&n.default));function M5e(e,t,n){const i=L5e(e,n);if(dT(i))for(const r of i.items)m3(e,t,r);else if(Array.isArray(i))for(const r of i)m3(e,t,r);else m3(e,t,i)}function m3(e,t,n){const i=L5e(e,n);if(!uT(i))throw new Error("Merge sources must be maps or map aliases");const r=i.toJSON(null,e,Map);for(const[s,a]of r)t instanceof Map?t.has(s)||t.set(s,a):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function L5e(e,t){return e&&u1(t)?t.resolve(e.doc,e):t}function $5e(e,t,{key:n,value:i}){if(xo(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(yLt(e,n))M5e(e,t,i);else{const r=Ku(n,"",e);if(t instanceof Map)t.set(r,Ku(i,r,e));else if(t instanceof Set)t.add(r);else{const s=vLt(n,r,e),a=Ku(i,s,e);s in t?Object.defineProperty(t,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[s]=a}}return t}function vLt(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(xo(e)&&(n!=null&&n.doc)){const i=P5e(n.doc,{});i.anchors=new Set;for(const s of n.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;const r=e.toString(i);if(!n.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),D5e(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function QV(e,t,n){const i=CE(e,void 0,n),r=CE(t,void 0,n);return new Rl(i,r)}class Rl{constructor(t,n=null){Object.defineProperty(this,ed,{value:C5e}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return xo(n)&&(n=n.clone(t)),xo(i)&&(i=i.clone(t)),new Rl(n,i)}toJSON(t,n){const i=n!=null&&n.mapAsMap?new Map:{};return $5e(n,i,this)}toString(t,n,i){return t!=null&&t.doc?bLt(this,t,n,i):JSON.stringify(this)}}function F5e(e,t,n){return(t.inFlow??e.flow?wLt:xLt)(e,t,n)}function xLt({comment:e,items:t},n,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:a,onComment:l}){const{indent:c,options:{commentString:u}}=n,d=Object.assign({},n,{indent:s,type:null});let f=!1;const h=[];for(let g=0;gv=null,()=>f=!0);v&&(y+=Bb(y,s,u(v))),f&&v&&(f=!1),h.push(i+y)}let m;if(h.length===0)m=r.start+r.end;else{m=h[0];for(let g=1;ge===y2||typeof e=="symbol"&&e.description===y2,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ci(Symbol(y2)),{addToJSMap:z5e}),stringify:()=>y2},ELt=(e,t)=>(Zh.identify(t)||ns(t)&&(!t.type||t.type===ci.PLAIN)&&Zh.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Zh.tag&&n.default));function z5e(e,t,n){const i=V5e(e,n);if(dT(i))for(const r of i.items)g3(e,t,r);else if(Array.isArray(i))for(const r of i)g3(e,t,r);else g3(e,t,i)}function g3(e,t,n){const i=V5e(e,n);if(!uT(i))throw new Error("Merge sources must be maps or map aliases");const r=i.toJSON(null,e,Map);for(const[s,a]of r)t instanceof Map?t.has(s)||t.set(s,a):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function V5e(e,t){return e&&u1(t)?t.resolve(e.doc,e):t}function H5e(e,t,{key:n,value:i}){if(ko(n)&&n.addToJSMap)n.addToJSMap(e,t,i);else if(ELt(e,n))z5e(e,t,i);else{const r=Wu(n,"",e);if(t instanceof Map)t.set(r,Wu(i,r,e));else if(t instanceof Set)t.add(r);else{const s=CLt(n,r,e),a=Wu(i,s,e);s in t?Object.defineProperty(t,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[s]=a}}return t}function CLt(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(ko(e)&&(n!=null&&n.doc)){const i=U5e(n.doc,{});i.anchors=new Set;for(const s of n.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;const r=e.toString(i);if(!n.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),Q5e(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function QV(e,t,n){const i=CE(e,void 0,n),r=CE(t,void 0,n);return new Pl(i,r)}class Pl{constructor(t,n=null){Object.defineProperty(this,Ju,{value:I5e}),this.key=t,this.value=n}clone(t){let{key:n,value:i}=this;return ko(n)&&(n=n.clone(t)),ko(i)&&(i=i.clone(t)),new Pl(n,i)}toJSON(t,n){const i=n!=null&&n.mapAsMap?new Map:{};return H5e(n,i,this)}toString(t,n,i){return t!=null&&t.doc?SLt(this,t,n,i):JSON.stringify(this)}}function q5e(e,t,n){return(t.inFlow??e.flow?ALt:TLt)(e,t,n)}function TLt({comment:e,items:t},n,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:a,onComment:l}){const{indent:c,options:{commentString:u}}=n,d=Object.assign({},n,{indent:s,type:null});let f=!1;const h=[];for(let g=0;gv=null,()=>f=!0);v&&(y+=Ub(y,s,u(v))),f&&v&&(f=!1),h.push(i+y)}let m;if(h.length===0)m=r.start+r.end;else{m=h[0];for(let g=1;gv=null);u||(u=f.length>d||y.includes(` -`)),g0&&(u||(u=f.reduce((w,x)=>w+x.length+2,2)+(y.length+2)>t.options.lineWidth)),u&&(y+=",")),v&&(y+=Bb(y,i,l(v))),f.push(y),d=f.length}const{start:h,end:m}=n;if(f.length===0)return h+m;if(!u){const g=f.reduce((b,v)=>b+v.length+2,2);u=t.options.lineWidth>0&&g>t.options.lineWidth}if(u){let g=h;for(const b of f)g+=b?` +`+Fh(u(e),c),l&&l()):f&&a&&a(),m}function ALt({items:e},t,{flowChars:n,itemIndent:i}){const{indent:r,indentStep:s,flowCollectionPadding:a,options:{commentString:l}}=t;i+=s;const c=Object.assign({},t,{indent:i,inFlow:!0,type:null});let u=!1,d=0;const f=[];for(let g=0;gv=null);u||(u=f.length>d||y.includes(` +`)),g0&&(u||(u=f.reduce((w,x)=>w+x.length+2,2)+(y.length+2)>t.options.lineWidth)),u&&(y+=",")),v&&(y+=Ub(y,i,l(v))),f.push(y),d=f.length}const{start:h,end:m}=n;if(f.length===0)return h+m;if(!u){const g=f.reduce((b,v)=>b+v.length+2,2);u=t.options.lineWidth>0&&g>t.options.lineWidth}if(u){let g=h;for(const b of f)g+=b?` ${s}${r}${b}`:` `;return`${g} -${r}${m}`}else return`${h}${a}${f.join(" ")}${a}${m}`}function mR({indent:e,options:{commentString:t}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){const s=Fh(t(i),e);n.push(s.trimStart())}}function Ub(e,t){const n=ns(t)?t.value:t;for(const i of e)if(wo(i)&&(i.key===t||i.key===n||ns(i.key)&&i.key.value===n))return i}class Mu extends R5e{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Km,t),this.items=[]}static from(t,n,i){const{keepUndefined:r,replacer:s}=i,a=new this(t),l=(c,u)=>{if(typeof s=="function")u=s.call(n,c,u);else if(Array.isArray(s)&&!s.includes(c))return;(u!==void 0||r)&&a.items.push(QV(c,u,i))};if(n instanceof Map)for(const[c,u]of n)l(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let i;wo(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new Rl(t,t==null?void 0:t.value):i=new Rl(t.key,t.value);const r=Ub(this.items,i.key),s=(a=this.schema)==null?void 0:a.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);ns(r.value)&&N5e(i.value)?r.value.value=i.value:r.value=i.value}else if(s){const l=this.items.findIndex(c=>s(i,c)<0);l===-1?this.items.push(i):this.items.splice(l,0,i)}else this.items.push(i)}delete(t){const n=Ub(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=Ub(this.items,t),r=i==null?void 0:i.value;return(!n&&ns(r)?r.value:r)??void 0}has(t){return!!Ub(this.items,t)}set(t,n){this.add(new Rl(t,n),!0)}toJSON(t,n,i){const r=i?new i:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(r);for(const s of this.items)$5e(n,r,s);return r}toString(t,n,i){if(!t)return JSON.stringify(this);for(const r of this.items)if(!wo(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),F5e(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}}const f1={collection:"map",default:!0,nodeClass:Mu,tag:"tag:yaml.org,2002:map",resolve(e,t){return uT(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Mu.from(e,t,n)};class jy extends R5e{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(c1,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=xA(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const i=xA(t);if(typeof i!="number")return;const r=this.items[i];return!n&&ns(r)?r.value:r}has(t){const n=xA(t);return typeof n=="number"&&n=0?t:null}const h1={collection:"seq",default:!0,nodeClass:jy,tag:"tag:yaml.org,2002:seq",resolve(e,t){return dT(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>jy.from(e,t,n)},OD={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),UV(e,t,n,i)}},kD={identify:e=>e==null,createNode:()=>new ui(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ui(null),stringify:({source:e},t)=>typeof e=="string"&&kD.test.test(e)?e:t.options.nullStr},zV={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new ui(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&zV.test.test(e)){const i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};function Hd({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);const r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let a=s.indexOf(".");a<0&&(a=s.length,s+=".");let l=t-(s.length-a-1);for(;l-- >0;)s+="0"}return s}const B5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Hd},U5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Hd(e)}},Q5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new ui(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Hd},SD=e=>typeof e=="bigint"||Number.isInteger(e),VV=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function z5e(e,t,n){const{value:i}=e;return SD(i)&&i>=0?n+i.toString(t):Hd(e)}const V5e={identify:e=>SD(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>VV(e,2,8,n),stringify:e=>z5e(e,8,"0o")},H5e={identify:SD,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>VV(e,0,10,n),stringify:Hd},q5e={identify:e=>SD(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>VV(e,2,16,n),stringify:e=>z5e(e,16,"0x")},OLt=[f1,h1,OD,kD,zV,V5e,H5e,q5e,B5e,U5e,Q5e];function wne(e){return typeof e=="bigint"||Number.isInteger(e)}const wA=({value:e})=>JSON.stringify(e),kLt=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:wA},{identify:e=>e==null,createNode:()=>new ui(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:wA},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:wA},{identify:wne,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>wne(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:wA}],SLt={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},ELt=[f1,h1].concat(kLt,SLt),HV={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r1&&t("Each pair must have its own sequence indicator");const r=i.items[0]||new Rl(new ui(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore} +${r}${m}`}else return`${h}${a}${f.join(" ")}${a}${m}`}function gR({indent:e,options:{commentString:t}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){const s=Fh(t(i),e);n.push(s.trimStart())}}function Qb(e,t){const n=ns(t)?t.value:t;for(const i of e)if(So(i)&&(i.key===t||i.key===n||ns(i.key)&&i.key.value===n))return i}class Du extends F5e{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Gm,t),this.items=[]}static from(t,n,i){const{keepUndefined:r,replacer:s}=i,a=new this(t),l=(c,u)=>{if(typeof s=="function")u=s.call(n,c,u);else if(Array.isArray(s)&&!s.includes(c))return;(u!==void 0||r)&&a.items.push(QV(c,u,i))};if(n instanceof Map)for(const[c,u]of n)l(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let i;So(t)?i=t:!t||typeof t!="object"||!("key"in t)?i=new Pl(t,t==null?void 0:t.value):i=new Pl(t.key,t.value);const r=Qb(this.items,i.key),s=(a=this.schema)==null?void 0:a.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);ns(r.value)&&$5e(i.value)?r.value.value=i.value:r.value=i.value}else if(s){const l=this.items.findIndex(c=>s(i,c)<0);l===-1?this.items.push(i):this.items.splice(l,0,i)}else this.items.push(i)}delete(t){const n=Qb(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=Qb(this.items,t),r=i==null?void 0:i.value;return(!n&&ns(r)?r.value:r)??void 0}has(t){return!!Qb(this.items,t)}set(t,n){this.add(new Pl(t,n),!0)}toJSON(t,n,i){const r=i?new i:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(r);for(const s of this.items)H5e(n,r,s);return r}toString(t,n,i){if(!t)return JSON.stringify(this);for(const r of this.items)if(!So(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),q5e(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:i,onComment:n})}}const f1={collection:"map",default:!0,nodeClass:Du,tag:"tag:yaml.org,2002:map",resolve(e,t){return uT(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Du.from(e,t,n)};class Ny extends F5e{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(c1,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=v2(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const i=v2(t);if(typeof i!="number")return;const r=this.items[i];return!n&&ns(r)?r.value:r}has(t){const n=v2(t);return typeof n=="number"&&n=0?t:null}const h1={collection:"seq",default:!0,nodeClass:Ny,tag:"tag:yaml.org,2002:seq",resolve(e,t){return dT(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Ny.from(e,t,n)},kD={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,i){return t=Object.assign({actualString:!0},t),UV(e,t,n,i)}},SD={identify:e=>e==null,createNode:()=>new ci(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ci(null),stringify:({source:e},t)=>typeof e=="string"&&SD.test.test(e)?e:t.options.nullStr},zV={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new ci(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&zV.test.test(e)){const i=e[0]==="t"||e[0]==="T";if(t===i)return e}return t?n.options.trueStr:n.options.falseStr}};function qd({format:e,minFractionDigits:t,tag:n,value:i}){if(typeof i=="bigint")return String(i);const r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(i,-0)?"-0":JSON.stringify(i);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let a=s.indexOf(".");a<0&&(a=s.length,s+=".");let l=t-(s.length-a-1);for(;l-- >0;)s+="0"}return s}const W5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:qd},K5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():qd(e)}},G5e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new ci(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:qd},ED=e=>typeof e=="bigint"||Number.isInteger(e),VV=(e,t,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e.substring(t),n);function X5e(e,t,n){const{value:i}=e;return ED(i)&&i>=0?n+i.toString(t):qd(e)}const Y5e={identify:e=>ED(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>VV(e,2,8,n),stringify:e=>X5e(e,8,"0o")},Z5e={identify:ED,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>VV(e,0,10,n),stringify:qd},J5e={identify:e=>ED(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>VV(e,2,16,n),stringify:e=>X5e(e,16,"0x")},_Lt=[f1,h1,kD,SD,zV,Y5e,Z5e,J5e,W5e,K5e,G5e];function wne(e){return typeof e=="bigint"||Number.isInteger(e)}const x2=({value:e})=>JSON.stringify(e),jLt=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:x2},{identify:e=>e==null,createNode:()=>new ci(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:x2},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:x2},{identify:wne,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>wne(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:x2}],NLt={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},RLt=[f1,h1].concat(jLt,NLt),HV={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r1&&t("Each pair must have its own sequence indicator");const r=i.items[0]||new Pl(new ci(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore} ${r.key.commentBefore}`:i.commentBefore),i.comment){const s=r.value??r.key;s.comment=s.comment?`${i.comment} -${s.comment}`:i.comment}i=r}e.items[n]=wo(i)?i:new Rl(i)}}else t("Expected a sequence for this tag");return e}function K5e(e,t,n){const{replacer:i}=n,r=new jy(e);r.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof i=="function"&&(a=i.call(t,String(s++),a));let l,c;if(Array.isArray(a))if(a.length===2)l=a[0],c=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const u=Object.keys(a);if(u.length===1)l=u[0],c=a[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=a;r.items.push(QV(l,c,n))}return r}const qV={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:W5e,createNode:K5e};class gx extends jy{constructor(){super(),this.add=Mu.prototype.add.bind(this),this.delete=Mu.prototype.delete.bind(this),this.get=Mu.prototype.get.bind(this),this.has=Mu.prototype.has.bind(this),this.set=Mu.prototype.set.bind(this),this.tag=gx.tag}toJSON(t,n){if(!n)return super.toJSON(t);const i=new Map;n!=null&&n.onCreate&&n.onCreate(i);for(const r of this.items){let s,a;if(wo(r)?(s=Ku(r.key,"",n),a=Ku(r.value,s,n)):s=Ku(r,"",n),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,a)}return i}static from(t,n,i){const r=K5e(t,n,i),s=new this;return s.items=r.items,s}}gx.tag="tag:yaml.org,2002:omap";const WV={collection:"seq",identify:e=>e instanceof Map,nodeClass:gx,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=W5e(e,t),i=[];for(const{key:r}of n.items)ns(r)&&(i.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new gx,n)},createNode:(e,t,n)=>gx.from(e,t,n)};function G5e({value:e,source:t},n){return t&&(e?X5e:Y5e).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const X5e={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ui(!0),stringify:G5e},Y5e={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ui(!1),stringify:G5e},CLt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Hd},TLt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Hd(e)}},ALt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new ui(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:Hd},fT=e=>typeof e=="bigint"||Number.isInteger(e);function ED(e,t,n,{intAsBigInt:i}){const r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const a=BigInt(e);return r==="-"?BigInt(-1)*a:a}const s=parseInt(e,n);return r==="-"?-1*s:s}function KV(e,t,n){const{value:i}=e;if(fT(i)){const r=i.toString(t);return i<0?"-"+n+r.substr(1):n+r}return Hd(e)}const _Lt={identify:fT,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>ED(e,2,2,n),stringify:e=>KV(e,2,"0b")},jLt={identify:fT,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>ED(e,1,8,n),stringify:e=>KV(e,8,"0")},NLt={identify:fT,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>ED(e,0,10,n),stringify:Hd},RLt={identify:fT,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>ED(e,2,16,n),stringify:e=>KV(e,16,"0x")};class bx extends Mu{constructor(t){super(t),this.tag=bx.tag}add(t){let n;wo(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Rl(t.key,null):n=new Rl(t,null),Ub(this.items,n.key)||this.items.push(n)}get(t,n){const i=Ub(this.items,t);return!n&&wo(i)?ns(i.key)?i.key.value:i.key:i}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const i=Ub(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new Rl(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){const{replacer:r}=i,s=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof r=="function"&&(a=r.call(n,a,a)),s.items.push(QV(a,null,i));return s}}bx.tag="tag:yaml.org,2002:set";const GV={collection:"map",identify:e=>e instanceof Set,nodeClass:bx,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>bx.from(e,t,n),resolve(e,t){if(uT(e)){if(e.hasAllNullValues(!0))return Object.assign(new bx,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function XV(e,t){const n=e[0],i=n==="-"||n==="+"?e.substring(1):e,r=a=>t?BigInt(a):Number(a),s=i.replace(/_/g,"").split(":").reduce((a,l)=>a*r(60)+r(l),r(0));return n==="-"?r(-1)*s:s}function Z5e(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return Hd(e);let i="";t<0&&(i="-",t*=n(-1));const r=n(60),s=[t%r];return t<60?s.unshift(0):(t=(t-s[0])/r,s.unshift(t%r),t>=60&&(t=(t-s[0])/r,s.unshift(t))),i+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const J5e={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>XV(e,n),stringify:Z5e},eLe={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>XV(e,!1),stringify:Z5e},CD={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(CD.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,r,s,a,l]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,i-1,r,s||0,a||0,l||0,c);const d=t[8];if(d&&d!=="Z"){let f=XV(d,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},One=[f1,h1,OD,kD,X5e,Y5e,_Lt,jLt,NLt,RLt,CLt,TLt,ALt,HV,Zh,WV,qV,GV,J5e,eLe,CD],kne=new Map([["core",OLt],["failsafe",[f1,h1,OD]],["json",ELt],["yaml11",One],["yaml-1.1",One]]),Sne={binary:HV,bool:zV,float:Q5e,floatExp:U5e,floatNaN:B5e,floatTime:eLe,int:H5e,intHex:q5e,intOct:V5e,intTime:J5e,map:f1,merge:Zh,null:kD,omap:WV,pairs:qV,seq:h1,set:GV,timestamp:CD},ILt={"tag:yaml.org,2002:binary":HV,"tag:yaml.org,2002:merge":Zh,"tag:yaml.org,2002:omap":WV,"tag:yaml.org,2002:pairs":qV,"tag:yaml.org,2002:set":GV,"tag:yaml.org,2002:timestamp":CD};function g3(e,t,n){const i=kne.get(t);if(i&&!e)return n&&!i.includes(Zh)?i.concat(Zh):i.slice();let r=i;if(!r)if(Array.isArray(e))r=[];else{const s=Array.from(kne.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(const s of e)r=r.concat(s);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(Zh)),r.reduce((s,a)=>{const l=typeof a=="string"?Sne[a]:a;if(!l){const c=JSON.stringify(a),u=Object.keys(Sne).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return s.includes(l)||s.push(l),s},[])}const PLt=(e,t)=>e.keyt.key?1:0;let DLt=class tLe{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(t)?g3(t,"compat"):t?g3(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?ILt:{},this.tags=g3(n,this.name,i),this.toStringOptions=l??null,Object.defineProperty(this,Km,{value:f1}),Object.defineProperty(this,Uf,{value:OD}),Object.defineProperty(this,c1,{value:h1}),this.sortMapEntries=typeof a=="function"?a:a===!0?PLt:null}clone(){const t=Object.create(tLe.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function MLt(e,t){var c;const n=[];let i=t.directives===!0;if(t.directives!==!1&&e.directives){const u=e.directives.toString(e);u?(n.push(u),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");const r=P5e(e,t),{commentString:s}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=s(e.commentBefore);n.unshift(Fh(u,""))}let a=!1,l=null;if(e.contents){if(xo(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){const f=s(e.contents.commentBefore);n.push(Fh(f,""))}r.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>a=!0;let d=gw(e.contents,r,()=>l=null,u);l&&(d+=Bb(d,"",s(l))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(gw(e.contents,r));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=s(e.comment);u.includes(` +${s.comment}`:i.comment}i=r}e.items[n]=So(i)?i:new Pl(i)}}else t("Expected a sequence for this tag");return e}function tLe(e,t,n){const{replacer:i}=n,r=new Ny(e);r.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof i=="function"&&(a=i.call(t,String(s++),a));let l,c;if(Array.isArray(a))if(a.length===2)l=a[0],c=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const u=Object.keys(a);if(u.length===1)l=u[0],c=a[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=a;r.items.push(QV(l,c,n))}return r}const qV={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:eLe,createNode:tLe};class gx extends Ny{constructor(){super(),this.add=Du.prototype.add.bind(this),this.delete=Du.prototype.delete.bind(this),this.get=Du.prototype.get.bind(this),this.has=Du.prototype.has.bind(this),this.set=Du.prototype.set.bind(this),this.tag=gx.tag}toJSON(t,n){if(!n)return super.toJSON(t);const i=new Map;n!=null&&n.onCreate&&n.onCreate(i);for(const r of this.items){let s,a;if(So(r)?(s=Wu(r.key,"",n),a=Wu(r.value,s,n)):s=Wu(r,"",n),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,a)}return i}static from(t,n,i){const r=tLe(t,n,i),s=new this;return s.items=r.items,s}}gx.tag="tag:yaml.org,2002:omap";const WV={collection:"seq",identify:e=>e instanceof Map,nodeClass:gx,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=eLe(e,t),i=[];for(const{key:r}of n.items)ns(r)&&(i.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new gx,n)},createNode:(e,t,n)=>gx.from(e,t,n)};function nLe({value:e,source:t},n){return t&&(e?iLe:rLe).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const iLe={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ci(!0),stringify:nLe},rLe={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ci(!1),stringify:nLe},ILt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:qd},PLt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():qd(e)}},DLt={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new ci(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const i=e.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(t.minFractionDigits=i.length)}return t},stringify:qd},fT=e=>typeof e=="bigint"||Number.isInteger(e);function CD(e,t,n,{intAsBigInt:i}){const r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),i){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const a=BigInt(e);return r==="-"?BigInt(-1)*a:a}const s=parseInt(e,n);return r==="-"?-1*s:s}function KV(e,t,n){const{value:i}=e;if(fT(i)){const r=i.toString(t);return i<0?"-"+n+r.substr(1):n+r}return qd(e)}const MLt={identify:fT,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>CD(e,2,2,n),stringify:e=>KV(e,2,"0b")},LLt={identify:fT,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>CD(e,1,8,n),stringify:e=>KV(e,8,"0")},$Lt={identify:fT,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>CD(e,0,10,n),stringify:qd},FLt={identify:fT,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>CD(e,2,16,n),stringify:e=>KV(e,16,"0x")};class bx extends Du{constructor(t){super(t),this.tag=bx.tag}add(t){let n;So(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Pl(t.key,null):n=new Pl(t,null),Qb(this.items,n.key)||this.items.push(n)}get(t,n){const i=Qb(this.items,t);return!n&&So(i)?ns(i.key)?i.key.value:i.key:i}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const i=Qb(this.items,t);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new Pl(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,i){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(t,n,i){const{replacer:r}=i,s=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof r=="function"&&(a=r.call(n,a,a)),s.items.push(QV(a,null,i));return s}}bx.tag="tag:yaml.org,2002:set";const GV={collection:"map",identify:e=>e instanceof Set,nodeClass:bx,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>bx.from(e,t,n),resolve(e,t){if(uT(e)){if(e.hasAllNullValues(!0))return Object.assign(new bx,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function XV(e,t){const n=e[0],i=n==="-"||n==="+"?e.substring(1):e,r=a=>t?BigInt(a):Number(a),s=i.replace(/_/g,"").split(":").reduce((a,l)=>a*r(60)+r(l),r(0));return n==="-"?r(-1)*s:s}function sLe(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return qd(e);let i="";t<0&&(i="-",t*=n(-1));const r=n(60),s=[t%r];return t<60?s.unshift(0):(t=(t-s[0])/r,s.unshift(t%r),t>=60&&(t=(t-s[0])/r,s.unshift(t))),i+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const oLe={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>XV(e,n),stringify:sLe},aLe={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>XV(e,!1),stringify:sLe},TD={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(TD.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,i,r,s,a,l]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,i-1,r,s||0,a||0,l||0,c);const d=t[8];if(d&&d!=="Z"){let f=XV(d,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},One=[f1,h1,kD,SD,iLe,rLe,MLt,LLt,$Lt,FLt,ILt,PLt,DLt,HV,Zh,WV,qV,GV,oLe,aLe,TD],kne=new Map([["core",_Lt],["failsafe",[f1,h1,kD]],["json",RLt],["yaml11",One],["yaml-1.1",One]]),Sne={binary:HV,bool:zV,float:G5e,floatExp:K5e,floatNaN:W5e,floatTime:aLe,int:Z5e,intHex:J5e,intOct:Y5e,intTime:oLe,map:f1,merge:Zh,null:SD,omap:WV,pairs:qV,seq:h1,set:GV,timestamp:TD},BLt={"tag:yaml.org,2002:binary":HV,"tag:yaml.org,2002:merge":Zh,"tag:yaml.org,2002:omap":WV,"tag:yaml.org,2002:pairs":qV,"tag:yaml.org,2002:set":GV,"tag:yaml.org,2002:timestamp":TD};function b3(e,t,n){const i=kne.get(t);if(i&&!e)return n&&!i.includes(Zh)?i.concat(Zh):i.slice();let r=i;if(!r)if(Array.isArray(e))r=[];else{const s=Array.from(kne.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(const s of e)r=r.concat(s);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(Zh)),r.reduce((s,a)=>{const l=typeof a=="string"?Sne[a]:a;if(!l){const c=JSON.stringify(a),u=Object.keys(Sne).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return s.includes(l)||s.push(l),s},[])}const ULt=(e,t)=>e.keyt.key?1:0;let QLt=class lLe{constructor({compat:t,customTags:n,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(t)?b3(t,"compat"):t?b3(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?BLt:{},this.tags=b3(n,this.name,i),this.toStringOptions=l??null,Object.defineProperty(this,Gm,{value:f1}),Object.defineProperty(this,Qf,{value:kD}),Object.defineProperty(this,c1,{value:h1}),this.sortMapEntries=typeof a=="function"?a:a===!0?ULt:null}clone(){const t=Object.create(lLe.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function zLt(e,t){var c;const n=[];let i=t.directives===!0;if(t.directives!==!1&&e.directives){const u=e.directives.toString(e);u?(n.push(u),i=!0):e.directives.docStart&&(i=!0)}i&&n.push("---");const r=U5e(e,t),{commentString:s}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=s(e.commentBefore);n.unshift(Fh(u,""))}let a=!1,l=null;if(e.contents){if(ko(e.contents)){if(e.contents.spaceBefore&&i&&n.push(""),e.contents.commentBefore){const f=s(e.contents.commentBefore);n.push(Fh(f,""))}r.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>a=!0;let d=gw(e.contents,r,()=>l=null,u);l&&(d+=Ub(d,"",s(l))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(gw(e.contents,r));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=s(e.comment);u.includes(` `)?(n.push("..."),n.push(Fh(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&a&&(u=u.replace(/^\n+/,"")),u&&((!a||l)&&n[n.length-1]!==""&&n.push(""),n.push(Fh(s(u),"")))}return n.join(` `)+` -`}class hT{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ed,{value:B8});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:a}=s;i!=null&&i._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new kl({version:a}),this.setSchema(a,i),this.contents=t===void 0?null:this.createNode(t,r,i)}clone(){const t=Object.create(hT.prototype,{[ed]:{value:B8}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=xo(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){W0(this.contents)&&this.contents.add(t)}addIn(t,n){W0(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const i=_5e(this);t.anchor=!n||i.has(n)?j5e(n||"a",i):n}return new BV(t.anchor)}createNode(t,n,i){let r;if(typeof n=="function")t=n.call({"":t},"",t),r=n;else if(Array.isArray(n)){const v=w=>typeof w=="number"||w instanceof String||w instanceof Number,y=n.filter(v).map(String);y.length>0&&(n=n.concat(y)),r=n}else i===void 0&&n&&(i=n,n=void 0);const{aliasDuplicateObjects:s,anchorPrefix:a,flow:l,keepUndefined:c,onTagObj:u,tag:d}=i??{},{onAnchor:f,setAnchors:h,sourceObjects:m}=cLt(this,a||"a"),g={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:m},b=CE(t,d,g);return l&&yo(b)&&(b.flow=!0),h(),b}createPair(t,n,i={}){const r=this.createNode(t,null,i),s=this.createNode(n,null,i);return new Rl(r,s)}delete(t){return W0(this.contents)?this.contents.delete(t):!1}deleteIn(t){return ck(t)?this.contents==null?!1:(this.contents=null,!0):W0(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return yo(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return ck(t)?!n&&ns(this.contents)?this.contents.value:this.contents:yo(this.contents)?this.contents.getIn(t,n):void 0}has(t){return yo(this.contents)?this.contents.has(t):!1}hasIn(t){return ck(t)?this.contents!==void 0:yo(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=pR(this.schema,[t],n):W0(this.contents)&&this.contents.set(t,n)}setIn(t,n){ck(t)?this.contents=n:this.contents==null?this.contents=pR(this.schema,Array.from(t),n):W0(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new kl({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new kl({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{const r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new DLt(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:a}={}){const l={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Ku(this.contents,n??"",l);if(typeof s=="function")for(const{count:u,res:d}of l.anchors.values())s(d,u);return typeof a=="function"?Qv(a,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return MLt(this,t)}}function W0(e){if(yo(e))return!0;throw new Error("Expected a YAML collection as document contents")}class nLe extends Error{constructor(t,n,i,r){super(),this.name=t,this.code=i,this.message=r,this.pos=n}}class uk extends nLe{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class LLt extends nLe{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const Ene=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>t.linePos(l));const{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let s=r-1,a=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&a.length>80){const l=Math.min(s-39,a.length-79);a="…"+a.substring(l),s-=l-1}if(a.length>80&&(a=a.substring(0,79)+"…"),i>1&&/^ *$/.test(a.substring(0,s))){let l=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);l.length>80&&(l=l.substring(0,79)+`… +`}class hT{constructor(t,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Ju,{value:B8});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:a}=s;i!=null&&i._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new El({version:a}),this.setSchema(a,i),this.contents=t===void 0?null:this.createNode(t,r,i)}clone(){const t=Object.create(hT.prototype,{[Ju]:{value:B8}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=ko(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){K0(this.contents)&&this.contents.add(t)}addIn(t,n){K0(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const i=M5e(this);t.anchor=!n||i.has(n)?L5e(n||"a",i):n}return new BV(t.anchor)}createNode(t,n,i){let r;if(typeof n=="function")t=n.call({"":t},"",t),r=n;else if(Array.isArray(n)){const v=w=>typeof w=="number"||w instanceof String||w instanceof Number,y=n.filter(v).map(String);y.length>0&&(n=n.concat(y)),r=n}else i===void 0&&n&&(i=n,n=void 0);const{aliasDuplicateObjects:s,anchorPrefix:a,flow:l,keepUndefined:c,onTagObj:u,tag:d}=i??{},{onAnchor:f,setAnchors:h,sourceObjects:m}=gLt(this,a||"a"),g={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:m},b=CE(t,d,g);return l&&wo(b)&&(b.flow=!0),h(),b}createPair(t,n,i={}){const r=this.createNode(t,null,i),s=this.createNode(n,null,i);return new Pl(r,s)}delete(t){return K0(this.contents)?this.contents.delete(t):!1}deleteIn(t){return uk(t)?this.contents==null?!1:(this.contents=null,!0):K0(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return wo(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return uk(t)?!n&&ns(this.contents)?this.contents.value:this.contents:wo(this.contents)?this.contents.getIn(t,n):void 0}has(t){return wo(this.contents)?this.contents.has(t):!1}hasIn(t){return uk(t)?this.contents!==void 0:wo(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=mR(this.schema,[t],n):K0(this.contents)&&this.contents.set(t,n)}setIn(t,n){uk(t)?this.contents=n:this.contents==null?this.contents=mR(this.schema,Array.from(t),n):K0(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let i;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new El({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new El({version:t}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{const r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new QLt(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:a}={}){const l={anchors:new Map,doc:this,keep:!t,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Wu(this.contents,n??"",l);if(typeof s=="function")for(const{count:u,res:d}of l.anchors.values())s(d,u);return typeof a=="function"?Qv(a,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return zLt(this,t)}}function K0(e){if(wo(e))return!0;throw new Error("Expected a YAML collection as document contents")}class cLe extends Error{constructor(t,n,i,r){super(),this.name=t,this.code=i,this.message=r,this.pos=n}}class dk extends cLe{constructor(t,n,i){super("YAMLParseError",t,n,i)}}class VLt extends cLe{constructor(t,n,i){super("YAMLWarning",t,n,i)}}const Ene=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>t.linePos(l));const{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let s=r-1,a=e.substring(t.lineStarts[i-1],t.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&a.length>80){const l=Math.min(s-39,a.length-79);a="…"+a.substring(l),s-=l-1}if(a.length>80&&(a=a.substring(0,79)+"…"),i>1&&/^ *$/.test(a.substring(0,s))){let l=e.substring(t.lineStarts[i-2],t.lineStarts[i-1]);l.length>80&&(l=l.substring(0,79)+`… `),a=l+a}if(/[^ ]/.test(a)){let l=1;const c=n.linePos[1];(c==null?void 0:c.line)===i&&c.col>r&&(l=Math.max(1,Math.min(c.col-r,80-s)));const u=" ".repeat(s)+"^".repeat(l);n.message+=`: ${a} ${u} `}};function bw(e,{flow:t,indicator:n,next:i,offset:r,onError:s,parentIndent:a,startOnNewline:l}){let c=!1,u=l,d=l,f="",h="",m=!1,g=!1,b=null,v=null,y=null,w=null,x=null,O=null,S=null;for(const E of e)switch(g&&(E.type!=="space"&&E.type!=="newline"&&E.type!=="comma"&&s(E.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),b&&(u&&E.type!=="comment"&&E.type!=="newline"&&s(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),b=null),E.type){case"space":!t&&(n!=="doc-start"||(i==null?void 0:i.type)!=="flow-collection")&&E.source.includes(" ")&&(b=E),d=!0;break;case"comment":{d||s(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const R=E.source.substring(1)||" ";f?f+=h+R:f=R,h="",u=!1;break}case"newline":u?f?f+=E.source:(!O||n!=="seq-item-ind")&&(c=!0):h+=E.source,u=!0,m=!0,(v||y)&&(w=E),d=!0;break;case"anchor":v&&s(E,"MULTIPLE_ANCHORS","A node can have at most one anchor"),E.source.endsWith(":")&&s(E.offset+E.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),v=E,S??(S=E.offset),u=!1,d=!1,g=!0;break;case"tag":{y&&s(E,"MULTIPLE_TAGS","A node can have at most one tag"),y=E,S??(S=E.offset),u=!1,d=!1,g=!0;break}case n:(v||y)&&s(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),O&&s(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${t??"collection"}`),O=E,u=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(t){x&&s(E,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),x=E,u=!1,d=!1;break}default:s(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),u=!1,d=!1}const k=e[e.length-1],C=k?k.offset+k.source.length:r;return g&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b&&(u&&b.indent<=a||(i==null?void 0:i.type)==="block-map"||(i==null?void 0:i.type)==="block-seq")&&s(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:x,found:O,spaceBefore:c,comment:f,hasNewline:m,anchor:v,tag:y,newlineAfterProp:w,end:C,start:S??C}}function TE(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(` -`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(TE(t.key)||TE(t.value))return!0}return!1;default:return!0}}function V8(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&TE(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function iLe(e,t,n){const{uniqueKeys:i}=e.options;if(i===!1)return!1;const r=typeof i=="function"?i:(s,a)=>s===a||ns(s)&&ns(a)&&s.value===a.value;return t.some(s=>r(s.key,n))}const Cne="All mapping items must start at the same column";function $Lt({composeNode:e,composeEmptyNode:t},n,i,r,s){var d;const a=(s==null?void 0:s.nodeClass)??Mu,l=new a(n.schema);n.atRoot&&(n.atRoot=!1);let c=i.offset,u=null;for(const f of i.items){const{start:h,key:m,sep:g,value:b}=f,v=bw(h,{indicator:"explicit-key-ind",next:m??(g==null?void 0:g[0]),offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0}),y=!v.found;if(y){if(m&&(m.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==i.indent&&r(c,"BAD_INDENT",Cne)),!v.anchor&&!v.tag&&!g){u=v.end,v.comment&&(l.comment?l.comment+=` -`+v.comment:l.comment=v.comment);continue}(v.newlineAfterProp||TE(m))&&r(m??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=v.found)==null?void 0:d.indent)!==i.indent&&r(c,"BAD_INDENT",Cne);n.atKey=!0;const w=v.end,x=m?e(n,m,v,r):t(n,w,h,null,v,r);n.schema.compat&&V8(i.indent,m,r),n.atKey=!1,iLe(n,l.items,x)&&r(w,"DUPLICATE_KEY","Map keys must be unique");const O=bw(g??[],{indicator:"map-value-ind",next:b,offset:x.range[2],onError:r,parentIndent:i.indent,startOnNewline:!m||m.type==="block-scalar"});if(c=O.end,O.found){y&&((b==null?void 0:b.type)==="block-map"&&!O.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&v.starte&&(e.type==="block-map"||e.type==="block-seq");function BLt({composeNode:e,composeEmptyNode:t},n,i,r,s){var v;const a=i.start.source==="{",l=a?"flow map":"flow sequence",c=(s==null?void 0:s.nodeClass)??(a?Mu:jy),u=new c(n.schema);u.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset+i.start.source.length;for(let y=0;y0){const y=pT(g,b,n.options.strict,r);y.comment&&(u.comment?u.comment+=` -`+y.comment:u.comment=y.comment),u.range=[i.offset,b,y.offset]}else u.range=[i.offset,b,b];return u}function v3(e,t,n,i,r,s){const a=n.type==="block-map"?$Lt(e,t,n,i,s):n.type==="block-seq"?FLt(e,t,n,i,s):BLt(e,t,n,i,s),l=a.constructor;return r==="!"||r===l.tagName?(a.tag=l.tagName,a):(r&&(a.tag=r),a)}function ULt(e,t,n,i,r){var h;const s=i.tag,a=s?t.directives.tagName(s.source,m=>r(s,"TAG_RESOLVE_FAILED",m)):null;if(n.type==="block-seq"){const{anchor:m,newlineAfterProp:g}=i,b=m&&s?m.offset>s.offset?m:s:m??s;b&&(!g||g.offsetm.tag===a&&m.collection===l);if(!c){const m=t.schema.knownTags[a];if((m==null?void 0:m.collection)===l)t.schema.tags.push(Object.assign({},m,{default:!1})),c=m;else return m?r(s,"BAD_COLLECTION_TYPE",`${m.tag} used for ${l} collection, but expects ${m.collection??"scalar"}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),v3(e,t,n,r,a)}const u=v3(e,t,n,r,a,c),d=((h=c.resolve)==null?void 0:h.call(c,u,m=>r(s,"TAG_RESOLVE_FAILED",m),t.options))??u,f=xo(d)?d:new ui(d);return f.range=u.range,f.tag=a,c!=null&&c.format&&(f.format=c.format),f}function QLt(e,t,n){const i=t.offset,r=zLt(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};const s=r.mode===">"?ui.BLOCK_FOLDED:ui.BLOCK_LITERAL,a=t.source?VLt(t.source):[];let l=a.length;for(let b=a.length-1;b>=0;--b){const v=a[b][1];if(v===""||v==="\r")l=b;else break}if(l===0){const b=r.chomp==="+"&&a.length>0?` +`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(TE(t.key)||TE(t.value))return!0}return!1;default:return!0}}function V8(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const i=t.end[0];i.indent===e&&(i.source==="]"||i.source==="}")&&TE(t)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function uLe(e,t,n){const{uniqueKeys:i}=e.options;if(i===!1)return!1;const r=typeof i=="function"?i:(s,a)=>s===a||ns(s)&&ns(a)&&s.value===a.value;return t.some(s=>r(s.key,n))}const Cne="All mapping items must start at the same column";function HLt({composeNode:e,composeEmptyNode:t},n,i,r,s){var d;const a=(s==null?void 0:s.nodeClass)??Du,l=new a(n.schema);n.atRoot&&(n.atRoot=!1);let c=i.offset,u=null;for(const f of i.items){const{start:h,key:m,sep:g,value:b}=f,v=bw(h,{indicator:"explicit-key-ind",next:m??(g==null?void 0:g[0]),offset:c,onError:r,parentIndent:i.indent,startOnNewline:!0}),y=!v.found;if(y){if(m&&(m.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==i.indent&&r(c,"BAD_INDENT",Cne)),!v.anchor&&!v.tag&&!g){u=v.end,v.comment&&(l.comment?l.comment+=` +`+v.comment:l.comment=v.comment);continue}(v.newlineAfterProp||TE(m))&&r(m??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=v.found)==null?void 0:d.indent)!==i.indent&&r(c,"BAD_INDENT",Cne);n.atKey=!0;const w=v.end,x=m?e(n,m,v,r):t(n,w,h,null,v,r);n.schema.compat&&V8(i.indent,m,r),n.atKey=!1,uLe(n,l.items,x)&&r(w,"DUPLICATE_KEY","Map keys must be unique");const O=bw(g??[],{indicator:"map-value-ind",next:b,offset:x.range[2],onError:r,parentIndent:i.indent,startOnNewline:!m||m.type==="block-scalar"});if(c=O.end,O.found){y&&((b==null?void 0:b.type)==="block-map"&&!O.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&v.starte&&(e.type==="block-map"||e.type==="block-seq");function WLt({composeNode:e,composeEmptyNode:t},n,i,r,s){var v;const a=i.start.source==="{",l=a?"flow map":"flow sequence",c=(s==null?void 0:s.nodeClass)??(a?Du:Ny),u=new c(n.schema);u.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset+i.start.source.length;for(let y=0;y0){const y=pT(g,b,n.options.strict,r);y.comment&&(u.comment?u.comment+=` +`+y.comment:u.comment=y.comment),u.range=[i.offset,b,y.offset]}else u.range=[i.offset,b,b];return u}function x3(e,t,n,i,r,s){const a=n.type==="block-map"?HLt(e,t,n,i,s):n.type==="block-seq"?qLt(e,t,n,i,s):WLt(e,t,n,i,s),l=a.constructor;return r==="!"||r===l.tagName?(a.tag=l.tagName,a):(r&&(a.tag=r),a)}function KLt(e,t,n,i,r){var h;const s=i.tag,a=s?t.directives.tagName(s.source,m=>r(s,"TAG_RESOLVE_FAILED",m)):null;if(n.type==="block-seq"){const{anchor:m,newlineAfterProp:g}=i,b=m&&s?m.offset>s.offset?m:s:m??s;b&&(!g||g.offsetm.tag===a&&m.collection===l);if(!c){const m=t.schema.knownTags[a];if((m==null?void 0:m.collection)===l)t.schema.tags.push(Object.assign({},m,{default:!1})),c=m;else return m?r(s,"BAD_COLLECTION_TYPE",`${m.tag} used for ${l} collection, but expects ${m.collection??"scalar"}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),x3(e,t,n,r,a)}const u=x3(e,t,n,r,a,c),d=((h=c.resolve)==null?void 0:h.call(c,u,m=>r(s,"TAG_RESOLVE_FAILED",m),t.options))??u,f=ko(d)?d:new ci(d);return f.range=u.range,f.tag=a,c!=null&&c.format&&(f.format=c.format),f}function GLt(e,t,n){const i=t.offset,r=XLt(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};const s=r.mode===">"?ci.BLOCK_FOLDED:ci.BLOCK_LITERAL,a=t.source?YLt(t.source):[];let l=a.length;for(let b=a.length-1;b>=0;--b){const v=a[b][1];if(v===""||v==="\r")l=b;else break}if(l===0){const b=r.chomp==="+"&&a.length>0?` `.repeat(Math.max(1,a.length-1)):"";let v=i+r.length;return t.source&&(v+=t.source.length),{value:b,type:s,comment:r.comment,range:[i,v,v]}}let c=t.indent+r.indent,u=t.offset+r.length,d=0;for(let b=0;bc&&(c=v.length);else{v.length=l;--b)a[b][0].length>c&&(l=b+1);let f="",h="",m=!1;for(let b=0;bc||y[0]===" "?(h===" "?h=` `:!m&&h===` `&&(h=` @@ -667,98 +667,98 @@ ${u} `+a[b][0].slice(c);f[f.length-1]!==` `&&(f+=` `);break;default:f+=` -`}const g=i+r.length+t.source.length;return{value:f,type:s,comment:r.comment,range:[i,g,g]}}function zLt({offset:e,props:t},n,i){if(t[0].type!=="block-scalar-header")return i(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=t[0],s=r[0];let a=0,l="",c=-1;for(let h=1;hn(i+h,m,g);switch(r){case"scalar":l=ui.PLAIN,c=qLt(s,u);break;case"single-quoted-scalar":l=ui.QUOTE_SINGLE,c=WLt(s,u);break;case"double-quoted-scalar":l=ui.QUOTE_DOUBLE,c=KLt(s,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}const d=i+s.length,f=pT(a,d,t,n);return{value:c,type:l,comment:f.comment,range:[i,d,f.offset]}}function qLt(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),rLe(e)}function WLt(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),rLe(e.slice(1,-1)).replace(/''/g,"'")}function rLe(e){let t,n;try{t=new RegExp(`(.*?)(?n(i+h,m,g);switch(r){case"scalar":l=ci.PLAIN,c=JLt(s,u);break;case"single-quoted-scalar":l=ci.QUOTE_SINGLE,c=e3t(s,u);break;case"double-quoted-scalar":l=ci.QUOTE_DOUBLE,c=t3t(s,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}const d=i+s.length,f=pT(a,d,t,n);return{value:c,type:l,comment:f.comment,range:[i,d,f.offset]}}function JLt(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),dLe(e)}function e3t(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),dLe(e.slice(1,-1)).replace(/''/g,"'")}function dLe(e){let t,n;try{t=new RegExp(`(.*?)(?s?e.slice(s,i+1):r)}else n+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function GLt(e,t){let n="",i=e[t+1];for(;(i===" "||i===" "||i===` +`)&&(n+=i>s?e.slice(s,i+1):r)}else n+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function n3t(e,t){let n="",i=e[t+1];for(;(i===" "||i===" "||i===` `||i==="\r")&&!(i==="\r"&&e[t+2]!==` `);)i===` `&&(n+=` -`),t+=1,i=e[t+1];return n||(n=" "),{fold:n,offset:t}}const XLt={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function YLt(e,t,n,i){const r=e.substr(t,n),a=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(a)}catch{const l=e.substr(t-2,n+2);return i(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function sLe(e,t,n,i){const{value:r,type:s,comment:a,range:l}=t.type==="block-scalar"?QLt(e,t,i):HLt(t,e.options.strict,i),c=n?e.directives.tagName(n.source,f=>i(n,"TAG_RESOLVE_FAILED",f)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[Uf]:c?u=ZLt(e.schema,r,c,n,i):t.type==="scalar"?u=JLt(e,r,t,i):u=e.schema[Uf];let d;try{const f=u.resolve(r,h=>i(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=ns(f)?f:new ui(f)}catch(f){const h=f instanceof Error?f.message:String(f);i(n??t,"TAG_RESOLVE_FAILED",h),d=new ui(r)}return d.range=l,d.source=r,s&&(d.type=s),c&&(d.tag=c),u.format&&(d.format=u.format),a&&(d.comment=a),d}function ZLt(e,t,n,i,r){var l;if(n==="!")return e[Uf];const s=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)s.push(c);else return c;for(const c of s)if((l=c.test)!=null&&l.test(t))return c;const a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Uf])}function JLt({atKey:e,directives:t,schema:n},i,r,s){const a=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(i))})||n[Uf];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(i))})??n[Uf];if(a.tag!==l.tag){const c=t.tagString(a.tag),u=t.tagString(l.tag),d=`Value may be parsed as either ${c} or ${u}`;s(r,"TAG_RESOLVE_FAILED",d,!0)}}return a}function e3t(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let r=t[i];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++i];(r==null?void 0:r.type)==="space";)e+=r.source.length,r=t[++i];break}}return e}const t3t={composeNode:oLe,composeEmptyNode:YV};function oLe(e,t,n,i){const r=e.atKey,{spaceBefore:s,comment:a,anchor:l,tag:c}=n;let u,d=!0;switch(t.type){case"alias":u=n3t(e,t,i),(l||c)&&i(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=sLe(e,t,c,i),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=ULt(t3t,e,t,n,i),l&&(u.anchor=l.source.substring(1))}catch(f){const h=f instanceof Error?f.message:String(f);i(t,"RESOURCE_EXHAUSTION",h)}break;default:{const f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",f),d=!1}}return u??(u=YV(e,t.offset,void 0,null,n,i)),l&&u.anchor===""&&i(l,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!ns(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&i(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(u.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?u.comment=a:u.commentBefore=a),e.options.keepSourceTokens&&d&&(u.srcToken=t),u}function YV(e,t,n,i,{spaceBefore:r,comment:s,anchor:a,tag:l,end:c},u){const d={type:"scalar",offset:e3t(t,n,i),indent:-1,source:""},f=sLe(e,d,l,u);return a&&(f.anchor=a.source.substring(1),f.anchor===""&&u(a,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=c),f}function n3t({options:e},{offset:t,source:n,end:i},r){const s=new BV(n.substring(1));s.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=t+n.length,l=pT(i,a,e.strict,r);return s.range=[t,a,l.offset],l.comment&&(s.comment=l.comment),s}function i3t(e,t,{offset:n,start:i,value:r,end:s},a){const l=Object.assign({_directives:t},e),c=new hT(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=bw(i,{indicator:"doc-start",next:r??(s==null?void 0:s[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!d.hasNewline&&a(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?oLe(u,r,d,a):YV(u,d.end,i,null,d,a);const f=c.contents.range[2],h=pT(s,f,!1,a);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function wO(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function Tne(e){var r;let t="",n=!1,i=!1;for(let s=0;si(n,"TAG_RESOLVE_FAILED",f)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[Qf]:c?u=s3t(e.schema,r,c,n,i):t.type==="scalar"?u=o3t(e,r,t,i):u=e.schema[Qf];let d;try{const f=u.resolve(r,h=>i(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=ns(f)?f:new ci(f)}catch(f){const h=f instanceof Error?f.message:String(f);i(n??t,"TAG_RESOLVE_FAILED",h),d=new ci(r)}return d.range=l,d.source=r,s&&(d.type=s),c&&(d.tag=c),u.format&&(d.format=u.format),a&&(d.comment=a),d}function s3t(e,t,n,i,r){var l;if(n==="!")return e[Qf];const s=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)s.push(c);else return c;for(const c of s)if((l=c.test)!=null&&l.test(t))return c;const a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Qf])}function o3t({atKey:e,directives:t,schema:n},i,r,s){const a=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(i))})||n[Qf];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(i))})??n[Qf];if(a.tag!==l.tag){const c=t.tagString(a.tag),u=t.tagString(l.tag),d=`Value may be parsed as either ${c} or ${u}`;s(r,"TAG_RESOLVE_FAILED",d,!0)}}return a}function a3t(e,t,n){if(t){n??(n=t.length);for(let i=n-1;i>=0;--i){let r=t[i];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++i];(r==null?void 0:r.type)==="space";)e+=r.source.length,r=t[++i];break}}return e}const l3t={composeNode:hLe,composeEmptyNode:YV};function hLe(e,t,n,i){const r=e.atKey,{spaceBefore:s,comment:a,anchor:l,tag:c}=n;let u,d=!0;switch(t.type){case"alias":u=c3t(e,t,i),(l||c)&&i(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=fLe(e,t,c,i),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=KLt(l3t,e,t,n,i),l&&(u.anchor=l.source.substring(1))}catch(f){const h=f instanceof Error?f.message:String(f);i(t,"RESOURCE_EXHAUSTION",h)}break;default:{const f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;i(t,"UNEXPECTED_TOKEN",f),d=!1}}return u??(u=YV(e,t.offset,void 0,null,n,i)),l&&u.anchor===""&&i(l,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!ns(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&i(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(u.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?u.comment=a:u.commentBefore=a),e.options.keepSourceTokens&&d&&(u.srcToken=t),u}function YV(e,t,n,i,{spaceBefore:r,comment:s,anchor:a,tag:l,end:c},u){const d={type:"scalar",offset:a3t(t,n,i),indent:-1,source:""},f=fLe(e,d,l,u);return a&&(f.anchor=a.source.substring(1),f.anchor===""&&u(a,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=c),f}function c3t({options:e},{offset:t,source:n,end:i},r){const s=new BV(n.substring(1));s.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=t+n.length,l=pT(i,a,e.strict,r);return s.range=[t,a,l.offset],l.comment&&(s.comment=l.comment),s}function u3t(e,t,{offset:n,start:i,value:r,end:s},a){const l=Object.assign({_directives:t},e),c=new hT(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=bw(i,{indicator:"doc-start",next:r??(s==null?void 0:s[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!d.hasNewline&&a(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?hLe(u,r,d,a):YV(u,d.end,i,null,d,a);const f=c.contents.range[2],h=pT(s,f,!1,a);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function wO(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function Tne(e){var r;let t="",n=!1,i=!1;for(let s=0;s{const a=wO(n);s?this.warnings.push(new LLt(a,i,r)):this.errors.push(new uk(a,i,r))},this.directives=new kl({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:i,afterEmptyLine:r}=Tne(this.prelude);if(i){const s=t.contents;if(n)t.comment=t.comment?`${t.comment} -${i}`:i;else if(r||t.directives.docStart||!s)t.commentBefore=i;else if(yo(s)&&!s.flow&&s.items.length>0){let a=s.items[0];wo(a)&&(a=a.key);const l=a.commentBefore;a.commentBefore=l?`${i} +`)+(a.substring(1)||" "),n=!0,i=!1;break;case"%":((r=e[s+1])==null?void 0:r[0])!=="#"&&(s+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:t,afterEmptyLine:i}}let d3t=class{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,s)=>{const a=wO(n);s?this.warnings.push(new VLt(a,i,r)):this.errors.push(new dk(a,i,r))},this.directives=new El({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:i,afterEmptyLine:r}=Tne(this.prelude);if(i){const s=t.contents;if(n)t.comment=t.comment?`${t.comment} +${i}`:i;else if(r||t.directives.docStart||!s)t.commentBefore=i;else if(wo(s)&&!s.flow&&s.items.length>0){let a=s.items[0];So(a)&&(a=a.key);const l=a.commentBefore;a.commentBefore=l?`${i} ${l}`:i}else{const a=s.commentBefore;s.commentBefore=a?`${i} -${a}`:i}}if(n){for(let s=0;s{const s=wO(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=i3t(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,i=new uk(wO(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){const i="Unexpected doc-end without preceding document";this.errors.push(new uk(wO(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const n=pT(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const i=this.doc.comment;this.doc.comment=i?`${i} -${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new uk(wO(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const i=Object.assign({_directives:this.directives},this.options),r=new hT(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};const aLe="\uFEFF",lLe="",cLe="",H8="";function s3t(e){switch(e){case aLe:return"byte-order-mark";case lLe:return"doc-mode";case cLe:return"flow-error-end";case H8:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +${a}`:i}}if(n){for(let s=0;s{const s=wO(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=u3t(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,i=new dk(wO(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){const i="Unexpected doc-end without preceding document";this.errors.push(new dk(wO(t),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const n=pT(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const i=this.doc.comment;this.doc.comment=i?`${i} +${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new dk(wO(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const i=Object.assign({_directives:this.directives},this.options),r=new hT(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};const pLe="\uFEFF",mLe="",gLe="",H8="";function f3t(e){switch(e){case pLe:return"byte-order-mark";case mLe:return"doc-mode";case gLe:return"flow-error-end";case H8:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function fd(e){switch(e){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}const Ane=new Set("0123456789ABCDEFabcdef"),o3t=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),OA=new Set(",[]{}"),a3t=new Set(` ,[]{} -\r `),x3=e=>!e||a3t.has(e);class l3t{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` +`:case"\r":case" ":return!0;default:return!1}}const Ane=new Set("0123456789ABCDEFabcdef"),h3t=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),w2=new Set(",[]{}"),p3t=new Set(` ,[]{} +\r `),w3=e=>!e||p3t.has(e);class m3t{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` `?!0:n==="\r"?this.buffer[t+1]===` `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let i=0;for(;n===" ";)n=this.buffer[++i+t];if(n==="\r"){const r=this.buffer[i+t+1];if(r===` `||!r&&!this.atEnd)return t+i+1}return n===` `||i>=this.indentNext||!n&&!this.atEnd?t+i:-1}if(n==="-"||n==="."){const i=this.buffer.substr(t,3);if((i==="---"||i==="...")&&fd(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!fd(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&fd(n)){const i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(x3),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,i=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&ithis.indentValue&&!fd(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&fd(n)){const i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(w3),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,i=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>fd(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,i;e:for(let s=this.pos;i=this.buffer[s];++s)switch(i){case" ":n+=1;break;case` `:t=s,n=0;break;case"\r":{const a=this.buffer[s+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===` `)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const s=this.continueScalar(t+1);if(s===-1)break;t=this.buffer.indexOf(` `,s)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let r=t+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===` `;)i=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)do{let s=t-1,a=this.buffer[s];a==="\r"&&(a=this.buffer[--s]);const l=s;for(;a===" ";)a=this.buffer[--s];if(a===` -`&&s>=this.pos&&s+1+n>l)t=s;else break}while(!0);return yield H8,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){const s=this.buffer[i+1];if(fd(s)||t&&OA.has(s))break;n=i}else if(fd(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===` +`&&s>=this.pos&&s+1+n>l)t=s;else break}while(!0);return yield H8,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){const s=this.buffer[i+1];if(fd(s)||t&&w2.has(s))break;n=i}else if(fd(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===` `?(i+=1,r=` -`,s=this.buffer[i+1]):n=i),s==="#"||t&&OA.has(s))break;if(r===` -`){const a=this.continueScalar(i+1);if(a===-1)break;i=Math.max(i,a-2)}}else{if(t&&OA.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield H8,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(x3),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(fd(i)||n&&OA.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!fd(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(o3t.has(n))n=this.buffer[++t];else if(n==="%"&&Ane.has(this.buffer[t+1])&&Ane.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===` +`,s=this.buffer[i+1]):n=i),s==="#"||t&&w2.has(s))break;if(r===` +`){const a=this.continueScalar(i+1);if(a===-1)break;i=Math.max(i,a-2)}}else{if(t&&w2.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield H8,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const i=this.buffer.slice(this.pos,t);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(w3),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(fd(i)||n&&w2.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!fd(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(h3t.has(n))n=this.buffer[++t];else if(n==="%"&&Ane.has(this.buffer[t+1])&&Ane.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===` `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||t&&i===" ");const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let n=this.pos,i=this.buffer[n];for(;!t(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class c3t{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,i=this.lineStarts.length;for(;n>1;this.lineStarts[s]=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function gR(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&jne(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{const r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{const r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&_ne(r.start)===-1&&(n.indent===0||r.start.every(s=>s.type!=="comment"||s.indent0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let n=this.pos,i=this.buffer[n];for(;!t(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class g3t{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,i=this.lineStarts.length;for(;n>1;this.lineStarts[s]=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function bR(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&jne(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{const r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{const r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&_ne(r.start)===-1&&(n.indent===0||r.start.every(s=>s.type!=="comment"||s.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(cm(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(uLe(n.key)&&!cm(n.sep,"newline")){const l=K0(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(cm(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=K0(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]}):cm(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&&!cm(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)){gR(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||cm(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=kA(i),s=K0(r);jne(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(` +`,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)){bR(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(um(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(bLe(n.key)&&!um(n.sep,"newline")){const l=G0(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(um(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=G0(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]}):um(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&&!um(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)){bR(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||um(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=O2(i),s=G0(r);jne(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=kA(t),i=K0(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=kA(t),i=K0(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 d3t(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new c3t||null,prettyErrors:t}}function dLe(e,t={}){const{lineCounter:n,prettyErrors:i}=d3t(t),r=new u3t(n==null?void 0:n.addNewLine),s=new r3t(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 uk(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(a.errors.forEach(Ene(e,n)),a.warnings.forEach(Ene(e,n))),a}function f3t(e,t,n){let i;const r=dLe(e,n);if(!r)return null;if(r.warnings.forEach(s=>D5e(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 TD(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 cT(e)&&!i?e.toString(n):new hT(e,i,n).toString(n)}const fLe=1024;let h3t=0,Fu=class{constructor(t,n){this.from=t,this.to=n}};class qn{constructor(t={}){this.id=h3t++,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=$o.match(t)),n=>{let i=t(n);return i===void 0?null:[this,i]}}}qn.closedBy=new qn({deserialize:e=>e.split(" ")});qn.openedBy=new qn({deserialize:e=>e.split(" ")});qn.group=new qn({deserialize:e=>e.split(" ")});qn.isolate=new qn({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});qn.contextHash=new qn({perNode:!0});qn.lookAhead=new qn({perNode:!0});qn.mounted=new qn({perNode:!0});class yx{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[qn.mounted.id]}}const p3t=Object.create(null);class $o{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):p3t,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),r=new $o(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(qn.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(qn.group),s=-1;s<(r?r.length:0);s++){let a=n[s<0?i.name:r[s]];if(a)return a}}}}$o.none=new $o("",Object.create(null),0,8);class p1{constructor(t){this.types=t;for(let n=0;n0;for(let c=this.cursor(a|ar.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:eH($o.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new Ci(this.type,n,i,r,this.propValues),t.makeTree||((n,i,r)=>new Ci($o.none,n,i,r)))}static build(t){return y3t(t)}}Ci.empty=new Ci($o.none,[],[],0);class ZV{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 ZV(this.buffer,this.index)}}class gg{constructor(t,n,i){this.buffer=t,this.length=n,this.set=i}get type(){return $o.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 AE(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&ar.EnterBracketed&&d instanceof Ci&&(h=yx.get(d))&&!h.overlay&&h.bracketed&&i>=f&&i<=f+d.length)&&!hLe(r,i,f,f+d.length))){if(d instanceof gg){if(s&ar.ExcludeBuffers)continue;let m=d.findChild(0,d.buffer.length,n,i-f,r);if(m>-1)return new Ef(new m3t(a,d,t,f),null,m)}else if(s&ar.IncludeAnonymous||!d.type.isAnonymous||JV(d)){let m;if(!(s&ar.IgnoreMounts)&&(m=yx.get(d))&&!m.overlay)return new dl(m.tree,f,t,a);let g=new dl(d,f,t,a);return s&ar.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(n<0?d.children.length-1:0,n,i,r,s)}}}if(s&ar.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&ar.IgnoreOverlays)&&(r=yx.get(this._tree))&&r.overlay){let s=t-this.from,a=i&ar.EnterBracketed&&r.bracketed;for(let{from:l,to:c}of r.overlay)if((n>0||a?l<=s:l=s:c>s))return new dl(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 Rne(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 q8(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 m3t{constructor(t,n,i,r){this.parent=t,this.buffer=n,this.index=i,this.start=r}}class Ef extends pLe{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 Ef(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&ar.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 Ef(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 Ef(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 Ef(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 Ci(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function mLe(e){if(!e.length)return null;let t=0,n=e[0];for(let s=1;sn.from||a.to=t){let l=new dl(a.tree,a.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(AE(l,t,n,!1))}}return r?mLe(r):i}class bR{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&~ar.EnterBracketed,t instanceof dl)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 dl?(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&ar.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ar.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&ar.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&ar.IncludeAnonymous||l instanceof gg||!l.type.isAnonymous||JV(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 q8(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 JV(e){return e.children.some(t=>t instanceof gg||!t.type.isAnonymous||JV(t))}function y3t(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=fLe,reused:s=[],minRepeatType:a=i.types.length}=e,l=Array.isArray(n)?new ZV(n,n.length):n,c=i.types,u=0,d=0;function f(S,k,C,E,R,A){let{id:j,start:T,end:N,size:_}=l,D=d,M=u;if(_<0)if(l.next(),_==-1){let z=s[j];C.push(z),E.push(T-S);return}else if(_==-3){u=j;return}else if(_==-4){d=j;return}else throw new RangeError(`Unrecognized record size: ${_}`);let P=c[j],L,B,I=T-S;if(N-T<=r&&(B=v(l.pos-k,R))){let z=new Uint16Array(B.size-B.skip),K=l.pos-B.size,F=z.length;for(;l.pos>K;)F=y(B.start,z,F);L=new gg(z,N-B.start,i),I=B.start-S}else{let z=l.pos-_;l.next();let K=[],F=[],q=j>=a?j:-1,H=0,X=N;for(;l.pos>z;)q>=0&&l.id==q&&l.size>=0?(l.end<=X-r&&(g(K,F,T,H,l.end,X,q,D,M),H=K.length,X=l.end),l.next()):A>2500?h(T,z,K,F):f(T,z,K,F,q,A+1);if(q>=0&&H>0&&H-1&&H>0){let ne=m(P,M);L=eH(P,K,F,0,K.length,0,N-T,ne,ne)}else L=b(P,K,F,N-T,D-N,M)}C.push(L),E.push(I)}function h(S,k,C,E){let R=[],A=0,j=-1;for(;l.pos>k;){let{id:T,start:N,end:_,size:D}=l;if(D>4)l.next();else{if(j>-1&&N=0;_-=3)T[D++]=R[_],T[D++]=R[_+1]-N,T[D++]=R[_+2]-N,T[D++]=D;C.push(new gg(T,R[2]-N,i)),E.push(N-S)}}function m(S,k){return(C,E,R)=>{let A=0,j=C.length-1,T,N;if(j>=0&&(T=C[j])instanceof Ci){if(!j&&T.type==S&&T.length==R)return T;(N=T.prop(qn.lookAhead))&&(A=E[j]+T.length+N)}return b(S,C,E,R,A,k)}}function g(S,k,C,E,R,A,j,T,N){let _=[],D=[];for(;S.length>E;)_.push(S.pop()),D.push(k.pop()+C-R);S.push(b(i.types[j],_,D,A-R,T-A,N)),k.push(R-C)}function b(S,k,C,E,R,A,j){if(A){let T=[qn.contextHash,A];j=j?[T].concat(j):[T]}if(R>25){let T=[qn.lookAhead,R];j=j?[T].concat(j):[T]}return new Ci(S,k,C,E,j)}function v(S,k){let C=l.fork(),E=0,R=0,A=0,j=C.end-r,T={size:0,start:0,skip:0};e:for(let N=C.pos-S;C.pos>N;){let _=C.size;if(C.id==k&&_>=0){T.size=E,T.start=R,T.skip=A,A+=4,E+=4,C.next();continue}let D=C.pos-_;if(_<0||D=a?4:0,P=C.start;for(C.next();C.pos>D;){if(C.size<0)if(C.size==-3||C.size==-4)M+=4;else break e;else C.id>=a&&(M+=4);C.next()}R=P,E+=_,A+=M}return(k<0||E==S)&&(T.size=E,T.start=R,T.skip=A),T.size>4?T:void 0}function y(S,k,C){let{id:E,start:R,end:A,size:j}=l;if(l.next(),j>=0&&E4){let N=l.pos-(j-4);for(;l.pos>N;)C=y(S,k,C)}k[--C]=T,k[--C]=A-S,k[--C]=R-S,k[--C]=E}else j==-3?u=E:j==-4&&(d=E);return C}let w=[],x=[];for(;l.pos>0;)f(e.start||0,e.bufferStart||0,w,x,-1,0);let O=(t=e.length)!==null&&t!==void 0?t:w.length?x[0]+w[0].length:0;return new Ci(c[e.topID],w.reverse(),x.reverse(),O)}const Ine=new WeakMap;function mj(e,t){if(!e.isAnonymous||t instanceof gg||t.type!=e)return 1;let n=Ine.get(t);if(n==null){n=1;for(let i of t.children){if(i.type!=e||!(i instanceof Ci)){n=1;break}n+=mj(e,i)}Ine.set(t,n)}return n}function eH(e,t,n,i,r,s,a,l,c){let u=0;for(let g=i;g=d)break;k+=C}if(x==O+1){if(k>d){let C=g[O];m(C.children,C.positions,0,C.children.length,b[O]+w);continue}f.push(g[O])}else{let C=b[x-1]+g[x-1].length-S;f.push(eH(e,g,b,O,x,S,C,null,c))}h.push(S+w-s)}}return m(t,n,i,r,0),(l||c)(f,h,a)}class tH{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 Ef?this.setBuffer(t.context.buffer,t.index,n):t instanceof dl&&this.map.set(t.tree,n)}get(t){return t instanceof Ef?this.getBuffer(t.context.buffer,t.index):t instanceof dl?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 Jh{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 Jh(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 m=Math.max(h.from,c)-u,g=Math.min(h.to,f)-u;h=m>=g?null:new Jh(m,g,h.tree,h.offset+u,l>0,!!d)}if(h&&r.push(h),a.to>f)break;a=snew Fu(r.from,r.to)):[new Fu(0,0)]:[new Fu(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 v3t{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 gLe(e){return(t,n,i,r)=>new w3t(t,e,n,i,r)}class Pne{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 Dne(e){if(!e.length||e.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(e))}class x3t{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 W8=new qn({perNode:!0});class w3t{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 Ci(i.type,i.children,i.positions,i.length,i.propValues.concat([[W8,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[qn.mounted.id]=new yx(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(m=>m.fromf)&&n.ranges.push({from:f,to:h})}}l=!1}else if(i&&(a=O3t(i.ranges,r.from,r.to)))l=a!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew Fu(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 Fu(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=$ne(this.ranges,n.ranges);u.length&&(Dne(u),this.inner.splice(n.index,0,new Pne(n.parser,n.parser.startParse(this.input,Fne(n.mounts,u),u),n.ranges.map(d=>new Fu(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 O3t(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 Mne(e,t,n,i,r,s){if(t=t&&n.enter(i,1,ar.IgnoreOverlays|ar.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 Ci)n=n.children[0];else break}return!1}}let S3t=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(W8))!==null&&n!==void 0?n:i.to,this.inner=new Lne(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(W8))!==null&&t!==void 0?t:n.to,this.inner=new Lne(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(qn.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 $ne(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 Fu(l,c.to))):c.to>l?n[s--]=new Fu(l,c.to):n.splice(s--,1))}}return i}function E3t(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),m=Math.min(d,f,i);hnew Fu(h.from+i,h.to+i)),f=E3t(t,d,c,u);for(let h=0,m=c;;h++){let g=h==f.length,b=g?u:f[h].from;if(b>m&&n.push(new Jh(m,b,r.tree,-a,s.from>=m||s.openStart,s.to<=b||s.openEnd)),g)break;m=f[h].to}}else n.push(new Jh(c,u,r.tree,-a,s.from>=a||s.openStart,s.to<=l||s.openEnd))}return n}let K8=[],bLe=[];(()=>{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=bLe[i])t=i+1;else return!0;if(t==n)return!1}}function Bne(e){return e>=127462&&e<=127487}const Une=8205;function T3t(e,t,n=!0,i=!0){return(n?yLe:A3t)(e,t,i)}function yLe(e,t,n){if(t==e.length)return t;t&&vLe(e.charCodeAt(t))&&xLe(e.charCodeAt(t-1))&&t--;let i=w3(e,t);for(t+=Qne(i);t=0&&Bne(w3(e,a));)s++,a-=2;if(s%2==0)break;t+=2}else break}return t}function A3t(e,t,n){for(;t>1;){let i=yLe(e,t-2,n);if(i=56320&&e<57344}function xLe(e){return e>=55296&&e<56320}function Qne(e){return e<65536?1:2}let rr=class wLe{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]=yw(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),gf.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]=yw(this,t,n);let i=[];return this.decompose(t,n,i,0),gf.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 lS(this),s=new lS(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 lS(this,t)}iterRange(t,n=this.length){return new OLe(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 kLe(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]?wLe.empty:t.length<=32?new fo(t):gf.from(fo.split(t,[]))}};class fo extends rr{constructor(t,n=_3t(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 j3t(r,l,i,a);r=l+1,i++}}decompose(t,n,i,r){let s=t<=0&&n>=this.length?this:new fo(zne(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(r&1){let a=i.pop(),l=gj(s.text,a.text.slice(),0,s.length);if(l.length<=32)i.push(new fo(l,a.length+s.length));else{let c=l.length>>1;i.push(new fo(l.slice(0,c)),new fo(l.slice(c)))}}else i.push(s)}replace(t,n,i){if(!(i instanceof fo))return super.replace(t,n,i);[t,n]=yw(this,t,n);let r=gj(this.text,gj(i.text,zne(this.text,0,t)),n),s=this.length+i.length-(n-t);return r.length<=32?new fo(r,s):gf.from(fo.split(r,[]),s)}sliceString(t,n=this.length,i=` -`){[t,n]=yw(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 fo(i,r)),i=[],r=-1);return r>-1&&n.push(new fo(i,r)),n}}class gf extends rr{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]=yw(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 gf(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]=yw(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 gf))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 m of t)i+=m.lines;if(i<32){let m=[];for(let g of t)g.flatten(m);return new fo(m,n)}let r=Math.max(32,i>>5),s=r<<1,a=r>>1,l=[],c=0,u=-1,d=[];function f(m){let g;if(m.lines>s&&m instanceof gf)for(let b of m.children)f(b);else m.lines>a&&(c>a||!c)?(h(),l.push(m)):m instanceof fo&&c&&(g=d[d.length-1])instanceof fo&&m.lines+g.lines<=32?(c+=m.lines,u+=m.length+1,d[d.length-1]=new fo(g.text.concat(m.text),g.length+1+m.length)):(c+m.lines>r&&h(),c+=m.lines,u+=m.length+1,d.push(m))}function h(){c!=0&&(l.push(d.length==1?d[0]:gf.from(d,u)),u=-1,c=d.length=0)}for(let m of t)f(m);return h(),l.length==1?l[0]:new gf(l,n)}}rr.empty=new fo([""],0);function _3t(e){let t=-1;for(let n of e)t+=n.length+1;return t}function gj(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 fo?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 fo?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 fo){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 fo?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 OLe{constructor(t,n,i){this.value="",this.done=!1,this.cursor=new lS(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 kLe{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"&&(rr.prototype[Symbol.iterator]=function(){return this.iter()},lS.prototype[Symbol.iterator]=OLe.prototype[Symbol.iterator]=kLe.prototype[Symbol.iterator]=function(){return this});let j3t=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 yw(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function va(e,t,n=!0,i=!0){return T3t(e,t,n,i)}function N3t(e){return e>=56320&&e<57344}function R3t(e){return e>=55296&&e<56320}function ec(e,t){let n=e.charCodeAt(t);if(!R3t(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return N3t(i)?(n-55296<<10)+(i-56320)+65536:n}function nH(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function bf(e){return e<65536?1:2}const G8=/\r\n?|\n/;var Fa=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(Fa||(Fa={}));class Df{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;nt)return s+(t-r);s+=l}else{if(i!=Fa.Simple&&u>=t&&(i==Fa.TrackDel&&rt||i==Fa.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 Df(t)}static create(t){return new Df(t)}}class Zo extends Df{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 X8(this,(n,i,r,s,a)=>t=t.replace(r,r+(i-n),a),!1),t}mapDesc(t,n=!1){return Y8(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&&jm(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=m?typeof m=="string"?rr.of(m.split(i||G8)):m:rr.empty,b=g.length;if(f==h&&b==0)return;fa&&al(r,f-a,-1),al(r,h-f,b),jm(s,r,g),a=h}}return u(t),c(!l),l}static empty(t){return new Zo(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 jm(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 Y8(e,t,n,i=!1){let r=[],s=i?[]:null,a=new _E(e),l=new _E(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);al(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 _E{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return n>=t.length?rr.empty:t[n]}textBit(t){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!t?rr.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 ym{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 ym(i,r,this.flags,this.goalColumn)}extend(t,n=t,i=0){if(t<=this.anchor&&n>=this.anchor)return dt.range(t,n,void 0,void 0,i);let r=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return dt.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 dt.range(t.anchor,t.head)}static create(t,n,i,r){return new ym(t,n,i,r)}}class dt{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:dt.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 dt(t.ranges.map(n=>ym.fromJSON(n)),t.main)}static single(t,n=t){return new dt([dt.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?dt.range(c,l):dt.range(l,c))}}return new dt(t,n)}}function ELe(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let iH=0;class ln{constructor(t,n,i,r,s){this.combine=t,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=iH++,this.default=t([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(t={}){return new ln(t.combine||(n=>n),t.compareInput||((n,i)=>n===i),t.compare||(t.combine?(n,i)=>n===i:rH),!!t.static,t.enables)}of(t){return new bj([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new bj(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new bj(t,this,2,n)}from(t,n){return n||(n=i=>i),this.compute([t],i=>n(i.field(t)))}}function rH(e,t){return e==t||e.length==t.length&&e.every((n,i)=>n===t[i])}class bj{constructor(t,n,i,r){this.dependencies=t,this.facet=n,this.type=i,this.value=r,this.id=iH++}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)||Z8(f,d)){let m=i(f);if(l?!Vne(m,f.values[a],r):!r(m,f.values[a]))return f.values[a]=m,1}return 0},reconfigure:(f,h)=>{let m,g=h.config.address[s];if(g!=null){let b=vR(h,g);if(this.dependencies.every(v=>v instanceof ln?h.facet(v)===f.facet(v):v instanceof Ka?h.field(v,!1)==f.field(v,!1):!0)||(l?Vne(m=i(f),b,r):r(m=i(f),b)))return f.values[a]=b,0}else m=i(f);return f.values[a]=m,1}}}get extension(){return this}}function Vne(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(EA).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(EA),a=r.facet(EA),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,EA.of({field:this,create:t})]}get extension(){return this}}const Ab={lowest:4,low:3,default:2,high:1,highest:0};function OO(e){return t=>new CLe(t,e)}const _p={highest:OO(Ab.highest),high:OO(Ab.high),default:OO(Ab.default),low:OO(Ab.low),lowest:OO(Ab.lowest)};class CLe{constructor(t,n){this.inner=t,this.prec=n}get extension(){return this}}class _D{of(t){return new J8(this,t)}reconfigure(t){return _D.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class J8{constructor(t,n){this.compartment=t,this.inner=n}get extension(){return this}}class yR{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 P3t(t,n,a))h instanceof Ka?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(m=>h.slot(m));let d=i==null?void 0:i.config.facets;for(let h in s){let m=s[h],g=m[0].facet,b=d&&d[h]||[];if(m.every(v=>v.type==0))if(l[g.id]=c.length<<1|1,rH(b,m))c.push(i.facet(g));else{let v=g.combine(m.map(y=>y.value));c.push(i&&g.compare(v,i.facet(g))?i.facet(g):v)}else{for(let v of m)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=>I3t(v,g,m))}}let f=u.map(h=>h(l));return new yR(t,a,f,l,c,s)}}function P3t(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 J8&&n.delete(a.compartment)}if(r.set(a,l),Array.isArray(a))for(let u of a)s(u,l);else if(a instanceof J8){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 CLe)s(a.inner,a.prec);else if(a instanceof Ka)i[l].push(a),a.provides&&s(a.provides,l);else if(a instanceof bj)i[l].push(a),a.facet.extensions&&s(a.facet.extensions,Ab.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,Ab.default),i.reduce((a,l)=>a.concat(l))}function cS(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 vR(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const TLe=ln.define(),eB=ln.define({combine:e=>e.some(t=>t),static:!0}),ALe=ln.define({combine:e=>e.length?e[0]:void 0,static:!0}),_Le=ln.define(),jLe=ln.define(),NLe=ln.define(),RLe=ln.define({combine:e=>e.length?e[0]:!1});class Xf{constructor(t,n){this.type=t,this.value=n}static define(){return new D3t}}class D3t{of(t){return new Xf(this,t)}}class M3t{constructor(t){this.map=t}of(t){return new Jn(this,t)}}class Jn{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 Jn(this.type,n)}is(t){return this.type==t}static define(t={}){return new M3t(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}}Jn.reconfigure=Jn.define();Jn.appendConfig=Jn.define();class Mo{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&&ELe(i,n.newLength),s.some(l=>l.type==Mo.time)||(this.annotations=s.concat(Mo.time.of(Date.now())))}static create(t,n,i,r,s,a){return new Mo(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(Mo.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}Mo.time=Xf.define();Mo.userEvent=Xf.define();Mo.addToHistory=Xf.define();Mo.remote=Xf.define();function L3t(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 Mo?e=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Mo?e=s[0]:e=PLe(t,vx(s),!1)}return e}function F3t(e){let t=e.startState,n=t.facet(NLe),i=e;for(let r=n.length-1;r>=0;r--){let s=n[r](e);s&&Object.keys(s).length&&(i=ILe(i,tB(t,s,e.changes.newLength),!0))}return i==e?e:Mo.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}const B3t=[];function vx(e){return e==null?B3t:Array.isArray(e)?e:[e]}var Ts=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(Ts||(Ts={}));const U3t=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let nB;try{nB=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Q3t(e){if(nB)return nB.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||U3t.test(n)))return!0}return!1}function z3t(e){return t=>{if(!/\S/.test(t))return Ts.Space;if(Q3t(t))return Ts.Word;for(let n=0;n-1)return Ts.Word;return Ts.Other}}class Ui{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(Jn.reconfigure)?(n=null,i=l.value):l.is(Jn.appendConfig)&&(n=null,i=vx(i).concat(l.value));let s;n?s=t.startState.values.slice():(n=yR.resolve(i,r,this),s=new Ui(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,u)=>u.reconfigure(c,this),null).values);let a=t.startState.facet(eB)?t.newSelection:t.newSelection.asSingle();new Ui(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:dt.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=vx(i.effects);for(let l=1;la.spec.fromJSON(l,c)))}}return Ui.create({doc:t.doc,selection:dt.fromJSON(t.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(t={}){let n=yR.resolve(t.extensions||[],new Map),i=t.doc instanceof rr?t.doc:rr.of((t.doc||"").split(n.staticFacet(Ui.lineSeparator)||G8)),r=t.selection?t.selection instanceof dt?t.selection:dt.single(t.selection.anchor,t.selection.head):dt.single(0);return ELe(r,i.length),n.staticFacet(eB)||(r=r.asSingle()),new Ui(n,i,r,n.dynamicSlots.map(()=>null),(s,a)=>a.create(s),null)}get tabSize(){return this.facet(Ui.tabSize)}get lineBreak(){return this.facet(Ui.lineSeparator)||` -`}get readOnly(){return this.facet(RLe)}phrase(t,...n){for(let i of this.facet(Ui.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(TLe))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 z3t(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=va(n,a,!1);if(s(n.slice(c,a))!=Ts.Word)break;a=c}for(;le.length?e[0]:4});Ui.lineSeparator=ALe;Ui.readOnly=RLe;Ui.phrases=ln.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])}});Ui.languageData=TLe;Ui.changeFilter=_Le;Ui.transactionFilter=jLe;Ui.transactionExtender=NLe;_D.reconfigure=Jn.define();function Yf(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 bg{eq(t){return this==t}range(t,n=t){return jE.create(t,n,this)}}bg.prototype.startSide=bg.prototype.endSide=0;bg.prototype.point=!1;bg.prototype.mapMode=Fa.TrackDel;function sH(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}class jE{constructor(t,n,i){this.from=t,this.to=n,this.value=i}static create(t,n,i){return new jE(t,n,i)}}function iB(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class oH{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);sm||h==m&&u.startSide>0&&u.endSide<=0)continue;(m-h||u.endSide-u.startSide)<0||(a<0&&(a=h),u.point&&(l=Math.max(l,m-h)),i.push(u),r.push(h-a),s.push(m-a))}return{mapped:i.length?new oH(r,s,i,l):null,pos:a}}}class Pi{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 Pi(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(iB)),this.isEmpty)return n.length?Pi.of(n):this;let l=new DLe(this,null,-1).goto(0),c=0,u=[],d=new mp;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 NE.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return NE.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=Hne(a,l,i),u=new kO(a,c,s),d=new kO(l,c,s);i.iterGaps((f,h,m)=>qne(u,f,d,h,m,r)),i.empty&&i.length==0&&qne(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=Hne(s,a),c=new kO(s,l,0).goto(i),u=new kO(a,l,0).goto(i);for(;;){if(c.to!=u.to||!rB(c.active,u.active)||c.point&&(!u.point||!sH(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 kO(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 mp;for(let r of t instanceof jE?[t]:n?V3t(t):t)i.add(r.from,r.to,r.value);return i.finish()}static join(t){if(!t.length)return Pi.empty;let n=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let r=t[i];r!=Pi.empty;r=r.nextLayer)n=new Pi(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}}Pi.empty=new Pi([],[],null,-1);function V3t(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(iB);t=i}return e}Pi.empty.nextLayer=Pi.empty;class mp{finishChunk(t){this.chunks.push(new oH(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 mp)).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(Pi.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=Pi.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function Hne(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 DLe(a,n,i,s));return r.length==1?r[0]:new NE(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--)O3(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--)O3(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(),O3(this.heap,0)}}}function O3(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 kO{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=NE.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){CA(this.active,t),CA(this.activeTo,t),CA(this.activeRank,t),this.minActive=Wne(this.active,this.activeTo)}addActive(t){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n0;)n++;TA(this.active,n,i),TA(this.activeTo,n,r),TA(this.activeRank,n,s),t&&TA(t,n,this.cursor.from),this.minActive=Wne(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&&CA(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 qne(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,m=h<0?e.to+c:n.to,g=Math.min(m,a);if(e.point||n.point?(e.point&&n.point&&sH(e.point,n.point)&&rB(e.activeForPoint(e.to),n.activeForPoint(n.to))||s.comparePoint(l,g,e.point,n.point),d=!1):(d&&s.boundChange(l),g>l&&!rB(e.active,n.active)&&s.compareRange(l,g,e.active,n.active),u&&ga)break;l=m,h<=0&&e.next(),h>=0&&n.next()}}function rB(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 Wne(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=va(e,r)}return i===!0?-1:e.length}const oB="ͼ",Kne=typeof Symbol>"u"?"__"+oB:Symbol.for(oB),aB=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Gne=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class yg{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 m in l){let g=l[m];if(/&/.test(m))s(m.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 ("+m+") should be a primitive value.");s(r(m),g,d,h)}else g!=null&&d.push(m.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=Gne[Kne]||1;return Gne[Kne]=t+1,oB+t.toString(36)}static mount(t,n,i){let r=t[aB],s=i&&i.nonce;r?s&&r.setNonce(s):r=new H3t(t,s),r.mount(Array.isArray(n)?n:[n],t)}}let Xne=new Map;class H3t{constructor(t,n){let i=t.ownerDocument||t,r=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&r.CSSStyleSheet){let s=Xne.get(i);if(s)return t[aB]=s;this.sheet=new r.CSSStyleSheet,Xne.set(i,this)}else this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[aB]=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:'"'},q3t=typeof navigator<"u"&&/Mac/.test(navigator.platform),W3t=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ma=0;Ma<10;Ma++)vg[48+Ma]=vg[96+Ma]=String(Ma);for(var Ma=1;Ma<=24;Ma++)vg[Ma+111]="F"+Ma;for(var Ma=65;Ma<=90;Ma++)vg[Ma]=String.fromCharCode(Ma+32),RE[Ma]=String.fromCharCode(Ma);for(var k3 in vg)RE.hasOwnProperty(k3)||(RE[k3]=vg[k3]);function K3t(e){var t=q3t&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||W3t&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?RE:vg)[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 Mr(){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 rn={mac:Jne||/Mac/.test(Sl.platform),windows:/Win/.test(Sl.platform),linux:/Linux|X11/.test(Sl.platform),ie:jD,ie_version:LLe?lB.documentMode||6:uB?+uB[1]:cB?+cB[1]:0,gecko:Yne,gecko_version:Yne?+(/Firefox\/(\d+)/.exec(Sl.userAgent)||[0,0])[1]:0,chrome:!!S3,chrome_version:S3?+S3[1]:0,ios:Jne,android:/Android\b/.test(Sl.userAgent),webkit:Zne,webkit_version:Zne?+(/\bAppleWebKit\/(\d+)/.exec(Sl.userAgent)||[0,0])[1]:0,safari:dB,safari_version:dB?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Sl.userAgent)||[0,0])[1]:0,tabSize:lB.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function aH(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 xR=Object.create(null);function lH(e,t,n){if(e==t)return!0;e||(e=xR),t||(t=xR);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 G3t(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 eie(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 X3t(e){let t=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new Ny(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}=$Le(t,n);i=(s?n?-3e8:-1:5e8)-1,r=(a?n?2e8:1:-6e8)+1}return new Ny(t,i,r,n,t.widget||null,!0)}static line(t){return new gT(t)}static set(t,n=!1){return Pi.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}En.none=Pi.empty;class mT extends En{constructor(t){let{start:n,end:i}=$Le(t);super(n?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?aH(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||xR}eq(t){return this==t||t instanceof mT&&this.tagName==t.tagName&&lH(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)}}mT.prototype.point=!1;class gT extends En{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof gT&&this.spec.class==t.spec.class&&lH(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)}}gT.prototype.mapMode=Fa.TrackBefore;gT.prototype.point=!0;class Ny extends En{constructor(t,n,i,r,s,a){super(n,i,s,t),this.block=r,this.isReplace=a,this.mapMode=r?n<=0?Fa.TrackBefore:Fa.TrackAfter:Fa.TrackDel}get type(){return this.startSide!=this.endSide?za.WidgetRange:this.startSide<=0?za.WidgetBefore:za.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof Ny&&Y3t(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)}}Ny.prototype.point=!0;function $Le(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 Y3t(e,t){return e==t||!!(e&&t&&e.compare(t))}function xx(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 IE extends bg{constructor(t,n,i){super(),this.tagName=t,this.attributes=n,this.rank=i}eq(t){return t==this||t instanceof IE&&this.tagName==t.tagName&&lH(this.attributes,t.attributes)}static create(t){return new IE(t.tagName,t.attributes||xR,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(t,n=!1){return Pi.of(t,n)}}IE.prototype.startSide=IE.prototype.endSide=-1;function PE(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function fB(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function uS(e,t){if(!t.anchorNode)return!1;try{return fB(e,t.anchorNode)}catch{return!1}}function dS(e){return e.nodeType==3?ME(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function fS(e,t,n,i){return n?tie(e,t,n,i,-1)||tie(e,t,n,i,1):!1}function xg(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function wR(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function tie(e,t,n,i,r){for(;;){if(e==n&&t==i)return!0;if(t==(r<0?0:gp(e))){if(e.nodeName=="DIV")return!1;let s=e.parentNode;if(!s||s.nodeType!=1)return!1;t=xg(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?gp(e):0}else return!1}}function gp(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function DE(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 Z3t(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 FLe(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 J3t(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,m=d==c.body,g=1,b=1;if(m)h=Z3t(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 w=d.getBoundingClientRect();({scaleX:g,scaleY:b}=FLe(d,w)),h={left:w.left,right:w.left+d.clientWidth*g,top:w.top,bottom:w.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 BLe(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 e4t{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?gp(n):0),i,Math.min(t.focusOffset,i?gp(i):0))}set(t,n,i,r){this.anchorNode=t,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}}let Sb=null;rn.safari&&rn.safari_version>=26&&(Sb=!1);function ULe(e){if(e.setActive)return e.setActive();if(Sb)return e.focus(Sb);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(Sb==null?{get preventScroll(){return Sb={preventScroll:!0},!0}}:void 0),!Sb){Sb=!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 zLe(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=gp(n)}else if(n.parentNode&&!wR(n))i=xg(n),n=n.parentNode;else return null}}function VLe(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 WLe(e,t){if(e.length!=t.length)return!1;for(let n=0;n=0;b-=3)if(rf[b+1]==-m){let v=rf[b+2],y=v&2?r:v&4?v&1?s:r:0;y&&(Hr[f]=Hr[rf[b]]=y),l=b;break}}else{if(rf.length==189)break;rf[l++]=f,rf[l++]=h,rf[l++]=c}else if((g=Hr[f])==2||g==1){let b=g==r;c=b?0:1;for(let v=l-3;v>=0;v-=3){let y=rf[v+2];if(y&2)break;if(b)rf[v+2]|=2;else{if(y&4)break;rf[v+2]|=4}}}}}function l4t(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),Hr[--g]=m;c=d}else s=u,c++}}}function pB(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 Cf(c,b.from,m));let v=b.direction==Ry!=!(m%2);mB(e,v?i+1:i,r,b.inner,b.from,b.to,a),c=b.to}g=b.to}else{if(g==n||(d?Hr[g]!=l:Hr[g]==l))break;g++}h?pB(e,c,g,i+1,r,h,a):ct;){let d=!0,f=!1;if(!u||c>s[u-1].to){let b=Hr[c-1];b!=l&&(d=!1,f=b==16)}let h=!d&&l==1?[]:null,m=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(Hr[v-1]==l)break e;break}}if(h)h.push(b);else{b.toHr.length;)Hr[Hr.length]=256;let i=[],r=t==Ry?0:1;return mB(e,r,r,n,0,e.length,i),i}function KLe(e){return[new Cf(0,e,0)]}let GLe="";function u4t(e,t,n,i,r){var s;let a=i.head-e.from,l=Cf.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=va(e.text,a,c.forward(r,n));(dc.to)&&(d=u),GLe=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)}),i3e=ln.define({combine:e=>e.some(t=>t)}),r3e=ln.define();class Ox{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 Ox(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 Ox(dt.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const AA=Jn.define({map:(e,t)=>e.map(t)}),s3e=Jn.define();function ac(e,t,n){let i=e.facet(JLe);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 Ih=ln.define({combine:e=>e.length?e[0]:!0});let f4t=0;const Vv=ln.define({combine(e){return e.filter((t,n)=>{for(let i=0;i{let c=[];return a&&c.push(ND.of(u=>{let d=u.plugin(l);return d?a(d):En.none})),s&&c.push(s(l)),c})}static fromClass(t,n){return to.define((i,r)=>new t(i,r),n)}}class E3{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(ac(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){ac(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){ac(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const o3e=ln.define(),fH=ln.define(),ND=ln.define(),a3e=ln.define(),hH=ln.define(),bT=ln.define(),l3e=ln.define();function iie(e,t){let n=e.state.facet(l3e);if(!n.length)return n;let i=n.map(s=>s instanceof Function?s(e):s),r=[];return Pi.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 m=l[h].spec.bidiIsolate,g;if(m==null&&(m=d4t(t.text,u,d)),c>0&&f.length&&(g=f[f.length-1]).to==u&&g.direction==m)g.to=d,f=g.inner;else{let b={from:u,to:d,direction:m,inner:[]};f.push(b),f=b.inner}}}}),r}const c3e=ln.define();function pH(e){let t=0,n=0,i=0,r=0;for(let s of e.state.facet(c3e)){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 dk=ln.define();class Bu{constructor(t,n,i,r){this.fromA=t,this.toA=n,this.fromB=i,this.toB=r}join(t){return new Bu(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 Bu(s,a,l,c))),this.changedRanges=r}static create(t,n,i){return new OR(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 h4t=[];class eo{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 h4t}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&&G3t(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=xg(this.dom),r=this.length?t>0:n>0;return new Td(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 ID)return t;return null}static get(t){return t.cmTile}}class RD extends eo{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=rie(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=rie(r);this.length=a}}function rie(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class ID extends RD{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=eo.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 ep)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 ep extends RD{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 ep(n||document.createElement(t.tagName),t);return n||(i.flags|=4),i}}class vw extends RD{constructor(t,n){super(t),this.attrs=n}isLine(){return!0}static start(t,n,i){let r=new vw(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,m=0;h=f&&(g.isComposite()?c(g,f-m):(!a||a.isHidden&&(n>0&&!(a.flags&32)||i&&m4t(a,g)))&&(b>f||g.flags&32)?(a=g,l=f-m):(mr&&(t=r);let s=t,a=t,l=0;t==0&&n<0||t==r&&n>=0?rn.chrome||rn.gecko||(t?(s--,l=1):a=0)?0:c.length-1];return rn.safari&&!l&&u.width==0&&(u=Array.prototype.find.call(c,d=>d.width)||u),i==null?u:DE(u,(l?l>0:n<0)==i)}static of(t,n){let i=new Qb(n||document.createTextNode(t),t);return n||(i.flags|=2),i}}class Iy extends eo{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 DE(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 g4t{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 ic&&u.mark.eq(c.mark))u.dom!=c.dom&&u.setDOM(C3(c.dom)),r=u;else{if(this.cache.reused.get(c)){let f=eo.get(c.dom);f&&f.setDOM(C3(c.dom))}let d=ic.of(c.mark,c.dom);r.append(d),r=d}this.cache.reused.set(c,2)}let s=eo.get(t.text);s&&this.cache.reused.set(s,2);let a=new Qb(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=u3e);let r=vw.start(t,n||((i=this.cache.find(vw))===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 ic&&l.mark.eq(a))r=l,n--;else{let c=ic.of(a,(i=this.cache.find(ic,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||!sie(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(rn.ios&&sie(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(T3,0,32)||new Iy(T3.toDOM(),0,T3,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 b4t(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(kR,void 0,1);return i&&(i.flags=n),i||new kR(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class v4t{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 SR=[Iy,vw,Qb,ic,kR,ep,ID];for(let e=0;e[]),this.index=SR.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 ic&&r.unshift(a.mark)),this.openWidget=!1},leave:a=>{a.isLine()?r.length&&(r.length=s=0):a instanceof ic&&(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=Pi.spans(this.decorations,t,n,{point:(l,c,u,d,f,h)=>{if(u instanceof Ny){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 m=u.widget||(u.block?xw.block:xw.inline),g=O4t(u),b=this.cache.findWidget(m,c-l,g)||Iy.of(m,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=k4t(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=eo.get(r);if(r==this.view.contentDOM)break;s instanceof ic?n.push(s):s!=null&&s.isLine()?i=s:s instanceof ep||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new vw(r,u3e):i||n.push(ic.of(new mT({tagName:r.nodeName.toLowerCase(),attributes:X3t(r)}),r)))}return{line:i,marks:n}}}function sie(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 O4t(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 u3e={class:"cm-line"};function k4t(e,t){let n=t.spec.attributes,i=t.spec.class;return!n&&!i||(e||(e={class:"cm-line"}),n&&aH(n,e),i&&(e.class+=" "+i)),e}function S4t(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 ic&&t.push(i.mark)}return t}function C3(e){let t=eo.get(e);return t&&t.setDOM(e.cloneNode()),e}class xw extends qd{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}}xw.inline=new xw("span");xw.block=new xw("div");const T3=new class extends qd{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class oie{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=En.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 ID(t,t.contentDOM),this.updateInner([new Bu(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:!I4t(t.changes,this.hasComposition)&&!t.selectionSet&&(r=t.state.selection.main.head));let s=r>-1?C4t(this.view,t.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:f}=this.hasComposition;i=new Bu(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,(rn.ie||rn.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=_4t(a,this.decorations,t.changes);c.length&&(i=Bu.extendWithRanges(i,c));let u=N4t(l,this.blockWrappers,t.changes);return u.length&&(i=Bu.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 w4t(this.view,a,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&eo.get(n.text)&&l.cache.reused.set(eo.get(n.text),2),this.tile=l.run(t,n),bB(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=rn.chrome||rn.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)&&uS(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)),rn.gecko&&c.empty&&!this.hasComposition&&E4t(u)){let h=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(h,u.node.childNodes[u.offset]||null)),u=d=new Td(h,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!fS(u.node,u.offset,f.anchorNode,f.anchorOffset)||!fS(d.node,d.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,c))&&(this.view.observer.ignore(()=>{rn.android&&rn.chrome&&i.contains(f.focusNode)&&R4t(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let h=PE(this.view.root);if(h)if(c.empty){if(rn.gecko){let m=T4t(u.node,u.offset);if(m&&m!=3){let g=(m==1?zLe:VLe)(u.node,u.offset);g&&(u=new Td(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 m=document.createRange();c.anchor>c.head&&([u,d]=[d,u]),m.setEnd(d.node,d.offset),m.setStart(u.node,u.offset),h.removeAllRanges(),h.addRange(m)}a&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,d)),this.impreciseAnchor=u.precise?null:new Td(f.anchorNode,f.anchorOffset),this.impreciseHead=d.precise?null:new Td(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&fS(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=PE(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=gp(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&&!eo.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 A3?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==qr.LTR,u=0,d=(f,h,m)=>{for(let g=0;gr);g++){let b=f.children[g],v=h+b.length,y=b.dom.getBoundingClientRect(),{height:w}=y;if(m&&!g&&(u+=y.top-m.top),b instanceof ep)v>i&&d(b,h,y);else if(h>=i&&(u>0&&n.push(-u),n.push(w+u),u=0,a)){let x=b.dom.lastChild,O=x?dS(x):[];if(O.length){let S=O[O.length-1],k=c?S.right-y.left:y.right-S.left;k>l&&(l=k,this.minWidth=s,this.minWidthFrom=h,this.minWidthTo=v)}}m&&g==f.children.length-1&&(u+=m.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"?qr.RTL:qr.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=dS(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=dS(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(En.replace({widget:new A3(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,a))}if(!s)break;i=s.to+1}return En.set(t)}updateDeco(){let t=1,n=this.view.state.facet(ND).map(s=>(this.dynamicDecorationMap[t++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(hH).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(Pi.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(r3e))try{if(u(this.view,t.range,t))return!0}catch(d){ac(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=pH(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(J3t(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(){bB(this.tile)}}function bB(e,t){let n=t==null?void 0:t.get(e);if(n!=1){n==null&&e.destroy();for(let i of e.children)bB(i,t)}}function E4t(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 d3e(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=zLe(n.focusNode,n.focusOffset),r=VLe(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=eo.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(e.docView.lastCompositionAfterCursor){let c=eo.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 C4t(e,t,n){let i=d3e(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 Bu(c.mapPos(s),c.mapPos(a),s,a),text:r}}function T4t(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t{it.from&&(n=!0)}),n}class A3 extends qd{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 P4t(e,t,n=1){let i=e.charCategorizer(t),r=e.doc.lineAt(t),s=t-r.from;if(r.length==0)return dt.cursor(t);s==0?n=1:s==r.length&&(n=-1);let a=s,l=s;n<0?a=va(r.text,s,!1):l=va(r.text,s);let c=i(r.text.slice(a,l));for(;a>0;){let u=va(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+sB(a,s,e.state.tabSize)}function yB(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==za.Text&&(r.type!=s.type||(n<0?s.fromt)))&&(r=s)}}return r||i}return i}function M4t(e,t,n,i){let r=yB(e,t.head,t.assoc||-1),s=!i||r.type!=za.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==qr.LTR)?a.right-1:a.left+1,y:(s.top+s.bottom)/2});if(c!=null)return dt.cursor(c,n?-1:1)}return dt.cursor(n?r.to:r.from,n?-1:1)}function aie(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=u4t(r,s,a,l,n),d=GLe;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 L4t(e,t,n){let i=e.state.charCategorizer(t),r=i(n);return s=>{let a=i(s);return r==Ts.Space&&(r=a),r==a}}function $4t(e,t,n,i){let r=t.head,s=n?1:-1;if(r==(n?e.state.doc.length:0))return dt.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,m=i??h;for(let g=0;;g+=h){let b=l+(m+g)*s,v=vB(e,{x:f,y:b},!1,s);if(n?b>c.bottom:bl:w{if(t>s&&tr(e)),n.from,t.head>n.from?-1:1);return i==n.from?n:dt.cursor(i,ie.viewState.docHeight)return new yf(e.state.doc.length,-1);if(u=e.elementAtHeight(c),i==null)break;if(u.type==za.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==za.Text){let f=D4t(e,r,u,a,l);return new yf(f,f==u.from?1:-1)}}if(u.type!=za.Text)return c<(u.top+u.bottom)/2?new yf(u.from,1):new yf(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 F4t(e,a,l,e.textDirectionAt(u.from)).scanTile(d,u.from)}class F4t{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 w=0;w1)){if(w.bottomthis.y)(!u||u.top>w.top)&&(u=w),x=-1;else{let O=w.left>this.x?this.x-w.left:w.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 m=(l?this.dirAt(t[d],1):this.baseDir)==qr.LTR;return{i:d,after:this.x>(h.left+h.right)/2==m}}scanText(t,n){let i=[];for(let s=0;s{let a=i[s]-n,l=i[s+1]-n;return ME(t.dom,a,l).getClientRects()});return r.after?new yf(i[r.i+1],-1):new yf(i[r.i],1)}scanTile(t,n){if(!t.length)return new yf(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:ME(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 yf(i[r.i+1],-1):new yf(a,1)}}const fv="￿";class B4t{constructor(t,n){this.points=t,this.view=n,this.text="",this.lineSeparator=n.state.facet(Ui.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=fv}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=eo.get(r),l=r.nextSibling;if(l==n){a!=null&&a.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let c=eo.get(l);(a&&c?a.breakAfter:(a?a.breakAfter:wR(r))||wR(l)&&(r.nodeName!="BR"||a!=null&&a.isWidget())&&this.text.length>s)&&!Q4t(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=eo.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+(U4t(t,i.node,i.offset)?n:0))}}function U4t(e,t,n){for(;;){if(!t||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=h3e(t.docView.tile,n,i,0))){let c=s||a?[]:H4t(t),u=new B4t(c,t);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=q4t(c,this.bounds.from)}else{let c=t.observer.selectionRange,u=s&&s.node==c.focusNode&&s.offset==c.focusOffset||!fB(t.contentDOM,c.focusNode)?l.main.head:t.docView.posFromDOM(c.focusNode,c.focusOffset),d=a&&a.node==c.anchorNode&&a.offset==c.anchorOffset||!fB(t.contentDOM,c.anchorNode)?l.main.anchor:t.docView.posFromDOM(c.anchorNode,c.anchorOffset),f=t.viewport;if((rn.ios||rn.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(dt.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),m=0;h&&(m=t.inputState.lastTouchY<=h.bottom?-1:1),this.newSel=dt.create([dt.cursor(u,m)])}else this.newSel=dt.single(d,u)}}}function h3e(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 h3e(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 p3e(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||rn.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:rr.of(t.text.slice(s.from-l,h).split(fv))}:(m=m3e(f,t.text,u-l,d))&&(rn.chrome&&a==13&&m.toB==m.from+2&&t.text.slice(m.from,m.toB)==fv+fv&&m.toB--,n={from:l+m.from,to:l+m.toA,insert:rr.of(t.text.slice(m.from,m.toB).split(fv))})}else i&&(!e.hasFocus&&r.facet(Ih)||ER(i,s))&&(i=null);if(!n&&!i)return!1;if((rn.mac||rn.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=dt.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:rr.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)}:rn.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==` - `&&e.lineWrapping&&(i&&(i=dt.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:rr.of([" "])}),n)return mH(e,n,i,a);if(i&&!ER(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=f3e(r.facet(bT).map(u=>u(e)),i))),e.dispatch({selection:i,scrollIntoView:l,userEvent:c}),!0}else return!1}function mH(e,t,n,i=-1){if(rn.ios&&e.inputState.flushIOSKey(t))return!0;let r=e.state.selection.main;if(rn.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&&wx(e.contentDOM,"Enter",13)||(t.from==r.from-1&&t.to==r.to&&t.insert.length==0||i==8&&t.insert.lengthr.head)&&wx(e.contentDOM,"Backspace",8)||t.from==r.from&&t.to==r.to+1&&t.insert.length==0&&wx(e.contentDOM,"Delete",46)))return!0;let s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a,l=()=>a||(a=V4t(e,t,n));return e.state.facet(e3e).some(c=>c(e,t.from,t.to,s,l))||e.dispatch(l()),!0}function V4t(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:dt.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&&d3e(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 m=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-m,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}),w=g.to-s.to;return{changes:y,range:u?dt.range(Math.max(0,u.anchor+w),Math.max(0,u.head+w)):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 m3e(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 H4t(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 lie(n,i)),(r!=n||s!=i)&&t.push(new lie(r,s))),t}function q4t(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?dt.single(n+t,i+t):null}function ER(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class W4t{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,rn.safari&&t.contentDOM.addEventListener("input",()=>null),rn.gecko&&c6t(t.contentDOM.ownerDocument)}handleEvent(t){!n6t(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=G4t(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&&b3e.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),rn.android&&rn.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;if(rn.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&(g3e.some(n=>n.keyCode==t.keyCode)&&!t.ctrlKey||X4t.indexOf(t.key)>-1&&t.ctrlKey)){let n={ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey,shiftKey:t.shiftKey};return n.shiftKey&&rn.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&K4t(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:rn.safari&&!rn.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 K4t(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function cie(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(r){ac(n.state,r)}}}function G4t(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(cie(i.value,c))}if(a)for(let l in a){let c=a[l];c&&n(l).observers.push(cie(i.value,c))}}for(let i in $d)n(i).handlers.push($d[i]);for(let i in Pl)n(i).observers.push(Pl[i]);return t}const g3e=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],X4t="dthko",b3e=[16,17,18,20,91,92,224,225],_A=6;function jA(e){return Math.max(0,e)*.7+8}function Y4t(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class Z4t{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=BLe(t.contentDOM),this.atoms=t.state.facet(bT).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(Ui.allowMultipleSelections)&&J4t(t,n),this.dragging=t6t(t,n)&&x3e(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&&Y4t(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=pH(this.view);t.clientX-c.left<=r+_A?n=-jA(r-t.clientX):t.clientX+c.right>=a-_A&&(n=jA(t.clientX-a)),t.clientY-c.top<=s+_A?i=-jA(s-t.clientY):t.clientY+c.bottom>=l-_A&&(i=jA(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=f3e(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 J4t(e,t){let n=e.state.facet(XLe);return n.length?n[0](t):rn.mac?t.metaKey:t.ctrlKey}function e6t(e,t){let n=e.state.facet(YLe);return n.length?n[0](t):rn.mac?!t.altKey:!t.ctrlKey}function t6t(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let i=PE(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 n6t(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=eo.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(t))return!1;return!0}const $d=Object.create(null),Pl=Object.create(null),y3e=rn.ie&&rn.ie_version<15||rn.ios&&rn.webkit_version<604;function i6t(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(),v3e(e,n.value)},50)}function PD(e,t,n){for(let i of e.facet(t))n=i(n,e);return n}function v3e(e,t){t=PD(e.state,uH,t);let{state:n}=e,i,r=1,s=n.toText(t),a=s.lines==n.selection.ranges.length;if(xB!=null&&n.selection.ranges.every(c=>c.empty)&&xB==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:dt.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:dt.cursor(c.from+u.length)}}):i=n.replaceSelection(s);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Pl.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,rn.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())};Pl.wheel=Pl.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()};$d.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);Pl.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")};Pl.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};Pl.touchend=(e,t)=>{e.inputState.touchActive=!1};$d.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(ZLe))if(n=i(e,t),n)break;if(!n&&t.button==0&&(n=s6t(e,t)),n){let i=!e.hasFocus;e.inputState.startMouseSelection(new Z4t(e,t,n,i)),i&&e.observer.ignore(()=>{ULe(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 uie(e,t,n,i){if(i==1)return dt.cursor(t,n);if(i==2)return P4t(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?(fie+1)%3:1}function s6t(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),i=x3e(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=uie(e,c.pos,c.assoc,i);if(n.pos!=c.pos&&!a){let f=uie(e,n.pos,n.assoc,i),h=Math.min(f.from,d.from),m=Math.max(f.to,d.to);d=h1&&(u=o6t(r,c.pos))?u:l?r.addRange(d):dt.create([d])}}}function o6t(e,t){for(let n=0;n=t)return dt.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}$d.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=dt.undirectionalRange(s,a))}}let{inputState:i}=e;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",PD(e.state,dH,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};$d.dragend=e=>(e.inputState.draggedContent=null,!1);function pie(e,t,n,i){if(n=PD(e.state,uH,n),!n)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:s}=e.inputState,a=i&&s&&e6t(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}$d.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&&pie(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 pie(e,t,i,!0),!0}return!1};$d.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=y3e?null:t.clipboardData;return n?(v3e(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(i6t(e),!1)};function a6t(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 l6t(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:PD(e,dH,t.join(e.lineBreak)),ranges:n,linewise:i}}let xB=null;$d.copy=$d.cut=(e,t)=>{if(!uS(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=l6t(e.state);if(!n&&!r)return!1;xB=r?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=y3e?null:t.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(a6t(e,n),!1)};const w3e=Xf.define();function O3e(e,t){let n=[];for(let i of e.facet(t3e)){let r=i(e,t);r&&n.push(r)}return n.length?e.update({effects:n,annotations:w3e.of(!0)}):null}function k3e(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=O3e(e.state,t);n?e.dispatch(n):e.update([])}},10)}Pl.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),k3e(e)};Pl.blur=e=>{e.observer.clearSelectionRange(),k3e(e)};Pl.compositionstart=Pl.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};Pl.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,rn.chrome&&rn.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))};Pl.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};$d.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 mH(e,{from:c,to:u,insert:e.state.toText(s)},null),!0}}let r;if(rn.chrome&&rn.android&&(r=g3e.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 rn.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),rn.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>Pl.compositionend(e,t),20),!1};const mie=new Set;function c6t(e){mie.has(e)||(mie.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const gie=["pre-wrap","normal","pre-line","break-spaces"];let ww=!1;function bie(){ww=!1}class u6t{constructor(t){this.lineWrapping=t,this.doc=rr.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 gie.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)>yj&&(ww=!0),this.height=t)}replace(t,n,i){return Il.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,Jr.ByPosNoHeight,i.setDoc(n),0,0),m=h.to>=u?h:s.lineAt(u,Jr.ByPosNoHeight,i,0,0);for(f+=m.to-u,u=m.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,Jr.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 Bc extends S3e{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 Sd(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 Bc||r instanceof Da&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Da?r=new Bc(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):Il.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 Da extends Il{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 Da?i[i.length-1]=new Da(s.length+r):i.push(null,new Da(r-1))}if(t>0){let s=i[0];s instanceof Da?i[0]=new Da(t+s.length):i.unshift(new Da(t-1),null)}return Il.of(i)}decomposeLeft(t,n){n.push(new Da(t-1),null)}decomposeRight(t,n){n.push(null,new Da(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 Da(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)>=yj&&(c=-2);let m=new Bc(d,f,h);m.outdated=!1,a.push(m),l+=d+1}l<=s&&a.push(null,new Da(s-l).updateHeight(t,l));let u=Il.of(a);return(c<0||Math.abs(u.height-this.height)>=yj||Math.abs(c-this.heightMetrics(t,n).perLine)>=yj)&&(ww=!0),CR(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 h6t extends Il{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==Jr.ByPosNoHeight?Jr.ByPosNoHeight:Jr.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,Jr.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&&yie(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?Il.of(this.break?[t,null,n]:[t,n]):(this.left=CR(this.left,t),this.right=CR(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 yie(e,t){let n,i;e[t]==null&&(n=e[t-1])instanceof Da&&(i=e[t+1])instanceof Da&&e.splice(t-1,3,new Da(n.length+1+i.length))}const p6t=5;class gH{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 Bc?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Bc(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=p6t)&&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 Bc(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,n){let i=new Da(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 Bc)return t;let n=new Bc(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 Bc)&&!this.isCovered?this.nodes.push(new Bc(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 y6t(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left0&&t.top0}function v6t(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class j3{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 u6t(i),this.stateDeco=wie(n),this.heightMap=Il.empty().applyChanges(this.stateDeco,rr.empty,this.heightOracle.setDoc(n.doc),[new Bu(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=En.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 NA(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?xie:new bH(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(fk(t,this.scaler))})}update(t,n=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=wie(this.state);let r=t.changedRanges,s=Bu.extendWithRanges(r,m6t(i,this.stateDeco,t?t.changes:Zo.empty(this.state.doc.length))),a=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);bie(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=a||ww)&&(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(i3e)&&(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"?qr.RTL:qr.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:S,scaleY:k}=FLe(n,l);(S>.005&&Math.abs(this.scaleX-S)>.005||k>.005&&Math.abs(this.scaleY-k)>.005)&&(this.scaleX=S,this.scaleY=k,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 m=BLe(this.view.contentDOM,!1).y;m!=this.scrollParent&&(this.scrollParent=m,this.scrollAnchorHeight=-1,this.scrollOffset=0);let g=this.getScrollOffset();this.scrollOffset!=g&&(this.scrollAnchorHeight=-1,this.scrollOffset=g),this.scrolledToBottom=QLe(this.scrollParent||t.win);let b=(this.printing?v6t:b6t)(n,this.paddingTop),v=b.top-this.pixelViewport.top,y=b.bottom-this.pixelViewport.bottom;this.pixelViewport=b;let w=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(w!=this.inView&&(this.inView=w,w&&(c=!0)),!this.inView&&!this.scrollTarget&&!y6t(t.dom))return 0;let x=l.width;if((this.contentDOMWidth!=x||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=t.scrollDOM.clientHeight,u|=16),c){let S=t.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(S)&&(a=!0),a||r.lineWrapping&&Math.abs(x-this.contentDOMWidth)>r.charWidth){let{lineHeight:k,charWidth:C,textHeight:E}=t.docView.measureTextSize();a=k>0&&r.refresh(s,k,C,E,Math.max(5,x/C),S),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)),bie();for(let k of this.viewports){let C=k.from==this.viewport.from?S:t.docView.measureVisibleLineHeights(k);this.heightMap=(a?Il.empty().applyChanges(this.stateDeco,rr.empty,this.heightOracle,[new Bu(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new d6t(k.from,C))}ww&&(u|=2)}let O=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return O&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),u|=this.updateForViewport()),(u&2||O)&&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 NA(r.lineAt(a-i*1e3,Jr.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,Jr.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,Jr.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!=qr.LTR&&!i)return[];let l=[],c=(d,f,h,m)=>{if(f-dd&&yy.from>=h.from&&y.to<=h.to&&Math.abs(y.from-d)y.fromw));if(!v){if(fx.from<=f&&x.to>=f)){let x=n.moveToLineBoundary(dt.cursor(f),!1,!0).head;x>d&&(f=x)}let y=this.gapSize(h,d,f,m),w=i||y<2e6?y:2e6;v=new j3(d,f,y,w)}l.push(v)},u=d=>{if(d.length2e6)for(let k of t)k.from>=d.from&&k.fromd.from&&c(d.from,m,d,f),gn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let i=[];Pi.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)||fk(this.heightMap.lineAt(t,Jr.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)||fk(this.heightMap.lineAt(this.scaler.fromDOM(t),Jr.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 fk(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 NA{constructor(t,n){this.from=t,this.to=n}}function w6t(e,t,n){let i=[],r=e,s=0;return Pi.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 IA(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 O6t(e,t){for(let n of e)if(t(n))return n}const xie={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function wie(e){let t=e.facet(ND).filter(i=>typeof i!="function"),n=e.facet(hH).filter(i=>typeof i!="function");return n.length&&t.push(Pi.join(n)),t}class bH{constructor(t,n,i){let r=0,s=0,a=0;this.viewports=i.map(({from:l,to:c})=>{let u=n.lineAt(l,Jr.ByPos,t,0,0).top,d=n.lineAt(c,Jr.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 fk(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new Sd(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map(r=>fk(r,t)):e._content)}const PA=ln.define({combine:e=>e.join(" ")}),wB=ln.define({combine:e=>e.indexOf(!0)>-1}),OB=yg.newName(),E3e=yg.newName(),C3e=yg.newName(),T3e={"&light":"."+E3e,"&dark":"."+C3e};function kB(e,t,n){return new yg(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 k6t=kB("."+OB,{"&":{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"}},T3e),S6t={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},N3=rn.ie&&rn.ie_version<=11;class E6t{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new e4t,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);(rn.ie&&rn.ie_version<=11||rn.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&&rn.android&&t.constructor.EDIT_CONTEXT!==!1&&!(rn.chrome&&rn.chrome_version<126)&&(this.editContext=new T6t(t),t.state.facet(Ih)&&(t.contentDOM.editContext=this.editContext.editContext)),N3&&(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(Ih)?i.root.activeElement!=this.dom:!uS(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}(rn.ie&&rn.ie_version<=11||rn.android&&rn.chrome)&&!i.state.selection.main.empty&&r.focusNode&&fS(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=PE(t.root);if(!n)return!1;let i=rn.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&C6t(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=uS(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&&wx(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&&uS(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 z4t(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=p3e(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!ER(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=Oie(n,t.previousSibling||t.target.previousSibling,-1),r=Oie(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(Ih)!=t.state.facet(Ih)&&(t.view.contentDOM.editContext=t.state.facet(Ih)?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 Oie(e,t,n){for(;t;){let i=eo.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 kie(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 fS(a.node,a.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function C6t(e,t){if(t.getComposedRanges){let r=t.getComposedRanges(e.root)[0];if(r)return kie(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?kie(e,n):null}class T6t{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=m3e(t.state.sliceDoc(l,c),i.text,(u?r.from:r.to)-l,u?"end":null);if(!d){let h=dt.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));ER(h,r)||t.dispatch({selection:h,userEvent:"select"});return}let f={from:d.from+l,to:d.toA+l,insert:rr.of(i.text.slice(d.from,d.toB).split(` -`))};if((rn.mac||rn.android)&&f.from==a-1&&/^\. ?$/.test(i.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:c,insert:rr.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!t.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);mH(t,f,dt.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=PE(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 Gt{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||t4t(t.parent)||document,this.viewState=new vie(this,t.state||Ui.create(t)),t.scrollTo&&t.scrollTo.is(AA)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Vv).map(r=>new E3(r));for(let r of this.plugins)r.update(this);this.observer=new E6t(this),this.inputState=new W4t(this),this.inputState.ensureHandlers(this.plugins),this.docView=new oie(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 Mo?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(w3e))?(this.inputState.notifiedFocused=a,l=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,c=O3e(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(Ui.phrases)!=this.state.facet(Ui.phrases))return this.setState(s);r=OR.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:m}=h.state.selection,{x:g,y:b}=this.state.facet(Gt.cursorScrollMargin);f=new Ox(m.empty?m:dt.cursor(m.head,m.head>m.anchor?-1:1),"nearest","nearest",b,g)}for(let m of h.effects)m.is(AA)&&(f=m.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=TR.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(dk)!=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(PA)!=r.state.facet(PA)&&(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(gB))try{h(r)}catch(m){ac(this.state,m,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!p3e(this,d)&&u.force&&wx(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 vie(this,t),this.plugins=t.facet(Vv).map(i=>new E3(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new oie(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(Vv),i=t.state.facet(Vv);if(n!=i){let r=[];for(let s of i){let a=n.indexOf(s);if(a<0)r.push(new E3(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(QLe(i||this.win))s=-1,a=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(r);s=m.from,a=m.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(m=>{try{return m.read(this)}catch(g){return ac(this.state,g),Sie}}),f=OR.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 m=0;m1||g<-1)&&!(rn.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(gB))l(n)}get themeClasses(){return OB+" "+(this.state.facet(wB)?C3e:E3e)+" "+this.state.facet(PA)}updateAttrs(){let t=Eie(this,o3e,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ih)?"true":"false",class:"cm-content",style:`${rn.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),Eie(this,fH,n);let i=this.observer.ignore(()=>{let r=eie(this.contentDOM,this.contentAttrs,n),s=eie(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(Gt.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(dk);let t=this.state.facet(Gt.cspNonce);yg.mount(this.root,this.styleModules.concat(k6t).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 _3(this,t,aie(this,t,n,i))}moveByGroup(t,n){return _3(this,t,aie(this,t,n,i=>L4t(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 dt.cursor(s.side(n,r)+t.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(t,n,i=!0){return M4t(this,t,n,i)}moveVertically(t,n,i){return _3(this,t,$4t(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=vB(this,t,n);return i&&i.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),vB(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let i=this.state.doc.lineAt(t),r=this.bidiSpans(i),s=r[Cf.find(r,t-i.from,-1,n)];return this.docView.coordsAt(t,n,s.dir==qr.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(n3e)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>A6t)return KLe(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||WLe(s.isolates,i=iie(this,t))))return s.order;i||(i=iie(this,t));let r=c4t(t.text,n,i);return this.bidiCache.push(new TR(t.from,t.to,n,i,!0,r)),r}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||rn.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{ULe(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 AA.of(new Ox(typeof t=="number"?dt.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 AA.of(new Ox(dt.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 to.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return to.define(()=>({}),{eventObservers:t})}static theme(t,n){let i=yg.newName(),r=[PA.of(i),dk.of(kB(`.${i}`,t))];return n&&n.dark&&r.push(wB.of(!0)),r}static baseTheme(t){return _p.lowest(dk.of(kB("."+OB,t,T3e)))}static findFromDOM(t){var n;let i=t.querySelector(".cm-content"),r=i&&eo.get(i)||eo.get(t);return((n=r==null?void 0:r.root)===null||n===void 0?void 0:n.view)||null}}Gt.styleModule=dk;Gt.inputHandler=e3e;Gt.clipboardInputFilter=uH;Gt.clipboardOutputFilter=dH;Gt.scrollHandler=r3e;Gt.focusChangeEffect=t3e;Gt.perLineTextDirection=n3e;Gt.exceptionSink=JLe;Gt.updateListener=gB;Gt.editable=Ih;Gt.mouseSelectionStyle=ZLe;Gt.dragMovesSelection=YLe;Gt.clickAddsSelectionRange=XLe;Gt.decorations=ND;Gt.blockWrappers=a3e;Gt.outerDecorations=hH;Gt.atomicRanges=bT;Gt.bidiIsolatedRanges=l3e;Gt.cursorScrollMargin=ln.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}}});Gt.scrollMargins=c3e;Gt.darkTheme=wB;Gt.cspNonce=ln.define({combine:e=>e.length?e[0]:""});Gt.contentAttributes=fH;Gt.editorAttributes=o3e;Gt.lineWrapping=Gt.contentAttributes.of({class:"cm-lineWrapping"});Gt.announce=Jn.define();const A6t=4096,Sie={};class TR{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:qr.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&&aH(a,n)}return n}const _6t=rn.mac?"mac":rn.windows?"win":rn.linux?"linux":"key";function j6t(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 R6t(e,t,n){return _3e(A3e(e.state),t,e,n)}let vm=null;const I6t=4e3;function P6t(e,t=_6t){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 m=n[a]||(n[a]=Object.create(null)),g=l.split(/ (?!$)/).map(y=>j6t(y,t));for(let y=1;y{let O=vm={view:x,prefix:w,scope:a};return setTimeout(()=>{vm==O&&(vm=null)},I6t),!0}]})}let b=g.join(" ");r(b,!1);let v=m[b]||(m[b]={preventDefault:!1,stopPropagation:!1,run:((h=(f=m._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(m=>f(m,SB))}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 SB=null;function _3e(e,t,n,i){SB=t;let r=K3t(t),s=ec(r,0),a=bf(s)==r.length&&r!=" ",l="",c=!1,u=!1,d=!1;vm&&vm.view==n&&vm.scope==i&&(l=vm.prefix+" ",b3e.indexOf(t.keyCode)<0&&(u=!0,vm=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},m=e[i],g,b;return m&&(h(m[l+DA(r,t,!a)])?c=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(rn.windows&&t.ctrlKey&&t.altKey)&&!(rn.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(g=vg[t.keyCode])&&g!=r?(h(m[l+DA(g,t,!0)])||t.shiftKey&&(b=RE[t.keyCode])!=r&&b!=g&&h(m[l+DA(b,t,!1)]))&&(c=!0):a&&t.shiftKey&&h(m[l+DA(r,t,!0)])&&(c=!0),!c&&h(m._any)&&(c=!0)),u&&(c=!0),c&&d&&t.stopPropagation(),SB=null,c}class oy{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=j3e(t);return[new oy(n,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return D6t(t,n,i)}}function j3e(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==qr.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function Tie(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 D6t(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==qr.LTR,a=e.contentDOM,l=a.getBoundingClientRect(),c=j3e(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),m=yB(e,i,1),g=yB(e,r,-1),b=m.type==za.Text?m:null,v=g.type==za.Text?g:null;if(b&&(e.lineWrapping||m.widgetLineBreaks)&&(b=Tie(e,i,1,b)),v&&(e.lineWrapping||g.widgetLineBreaks)&&(v=Tie(e,r,-1,v)),b&&v&&b.from==v.from&&b.to==v.to)return w(x(n.from,n.to,b));{let S=b?x(n.from,null,b):O(m,!1),k=v?x(null,n.to,v):O(g,!0),C=[];return(b||m).to<(v||g).from-(b&&v?1:0)||m.widgetLineBreaks>1&&S.bottom+e.defaultLineHeight/2T&&_.from=M)break;I>D&&j(Math.max(B,D),S==null&&B<=T,Math.min(I,M),k==null&&I>=N,L.dir)}if(D=P.to+1,D>=M)break}return A.length==0&&j(T,S==null,N,k==null,e.textDirection),{top:E,bottom:R,horizontal:A}}function O(S,k){let C=l.top+(k?S.top:S.bottom);return{top:C,bottom:C,horizontal:[]}}}function M6t(e,t){return e.constructor==t.constructor&&e.eq(t)}class L6t{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(vj)!=t.state.facet(vj)&&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(vj);for(;n!M6t(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,rn.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const vj=ln.define();function N3e(e){return[to.define(t=>new L6t(t,e)),vj.of(e)]}const Ow=ln.define({combine(e){return Yf(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function $6t(e={}){return[Ow.of(e),F6t,B6t,U6t,i3e.of(!0)]}function R3e(e){return e.startState.facet(Ow)!=e.state.facet(Ow)}const F6t=N3e({above:!0,markers(e){let{state:t}=e,n=t.facet(Ow),i=[];for(let r of t.selection.ranges){let s=r==t.selection.main;if(r.empty||n.drawRangeCursor&&!(s&&rn.ios&&n.iosSelectionHandles)){let a=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:dt.cursor(r.head,r.assoc);for(let c of oy.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=R3e(e);return n&&Aie(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){Aie(t.state,e)},class:"cm-cursorLayer"});function Aie(e,t){t.style.animationDuration=e.facet(Ow).cursorBlinkRate+"ms"}const B6t=N3e({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 oy.forRange(e,"cm-selectionBackground",r))t.push(s);if(rn.ios&&!n.empty&&e.state.facet(Ow).iosSelectionHandles){for(let r of oy.forRange(e,"cm-selectionHandle cm-selectionHandle-start",dt.cursor(n.from,1)))t.push(r);for(let r of oy.forRange(e,"cm-selectionHandle cm-selectionHandle-end",dt.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||R3e(e)},class:"cm-selectionLayer"}),U6t=_p.highest(Gt.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"}}}})),I3e=Jn.define({map(e,t){return e==null?null:t.mapPos(e)}}),hk=Ka.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,i)=>i.is(I3e)?i.value:n,e)}}),Q6t=to.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(hk);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(hk)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(hk),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(hk)!=e&&this.view.dispatch({effects:I3e.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 z6t(){return[hk,Q6t]}function _ie(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 V6t(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 H6t{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 mp,i=n.add.bind(n);for(let{from:r,to:s}of V6t(t,this.maxLength))_ie(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;(m=this.regexp.exec(c.text))&&m.indexthis.addMatch(v,t,b,g));n=n.update({filterFrom:d,filterTo:f,filter:(b,v)=>bf,add:h})}}return n}}const EB=/x/.unicode!=null?"gu":"g",q6t=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,EB),W6t={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 R3=null;function K6t(){var e;if(R3==null&&typeof document<"u"&&document.body){let t=document.body.style;R3=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return R3||!1}const xj=ln.define({combine(e){let t=Yf(e,{render:null,specialChars:q6t,addSpecialChars:null});return(t.replaceTabs=!K6t())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,EB)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,EB)),t}});function G6t(e={}){return[xj.of(e),X6t()]}let jie=null;function X6t(){return jie||(jie=to.fromClass(class{constructor(e){this.view=e,this.decorations=En.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(xj)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new H6t({regexp:e.specialChars,decoration:(t,n,i)=>{let{doc:r}=n.state,s=ec(t[0],0);if(s==9){let a=r.lineAt(i),l=n.state.tabSize,c=Ld(a.text,l,i-a.from);return En.replace({widget:new e$t((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=En.replace({widget:new J6t(e,s)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(xj);e.startState.facet(xj)!=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 Y6t="•";function Z6t(e){return e>=32?Y6t:e==10?"␤":String.fromCharCode(9216+e)}class J6t extends qd{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=Z6t(this.code),i=t.state.phrase("Control character")+" "+(W6t[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 e$t extends qd{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 t$t(){return i$t}const n$t=En.line({class:"cm-activeLine"}),i$t=to.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(n$t.range(r.from)),t=r.from)}return En.set(n)}},{decorations:e=>e.decorations});class r$t extends qd{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?dS(t.firstChild):[];if(!n.length)return null;let i=window.getComputedStyle(t.parentNode),r=DE(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 s$t(e){let t=to.fromClass(class{constructor(n){this.view=n,this.placeholder=e?En.set([En.widget({widget:new r$t(e),side:1}).range(0)]):En.none}get decorations(){return this.view.state.doc.length?En.none:this.placeholder}},{decorations:n=>n.decorations});return typeof e=="string"?[t,Gt.contentAttributes.of({"aria-placeholder":e})]:t}const CB=2e3;function o$t(e,t,n){let i=Math.min(t.line,n.line),r=Math.max(t.line,n.line),s=[];if(t.off>CB||n.off>CB||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(dt.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=sB(u.text,a,e.tabSize,!0);if(d<0)s.push(dt.cursor(u.to));else{let f=sB(u.text,l,e.tabSize);s.push(dt.range(u.from+d,u.from+f))}}}return s}function a$t(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function Nie(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>CB?-1:r==i.length?a$t(e,t.clientX):Ld(i.text,e.state.tabSize,n-i.from);return{line:i.number,col:s,off:r}}function l$t(e,t){let n=Nie(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=Nie(e,r);if(!l)return i;let c=o$t(e.state,n,l);return c.length?a?dt.create(c.concat(i.ranges)):dt.create(c):i}}:null}function c$t(e){let t=n=>n.altKey&&n.button==0;return Gt.mouseSelectionStyle.of((n,i)=>t(i)?l$t(n,i):null)}const u$t={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},d$t={style:"cursor: crosshair"};function f$t(e={}){let[t,n]=u$t[e.key||"Alt"],i=to.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,Gt.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?d$t:null})]}const MA="-10000px";class P3e{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 h$t(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const I3=ln.define({combine:e=>{var t,n,i;return{position:rn.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)||h$t}}}),Rie=new WeakMap,yH=to.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(I3);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 P3e(e,vH,(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(I3);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=MA,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(rn.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=pH(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(I3).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=MA;continue}let m=c.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,g=m?7:0,b=h.right-h.left,v=(t=Rie.get(u))!==null&&t!==void 0?t:h.bottom-h.top,y=u.offset||m$t,w=this.view.textDirection==qr.LTR,x=h.width>i.right-i.left?w?i.left:i.right-h.width:w?Math.max(i.left,Math.min(f.left-(m?14:0)+y.x,i.right-b)):Math.min(Math.max(i.left,f.left-b+(m?14:0)-y.x),i.right-b),O=this.above[l];!c.strictSide&&(O?f.top-v-g-y.yi.bottom)&&O==i.bottom-f.bottom>f.top-i.top&&(O=this.above[l]=!O);let S=(O?f.top-i.top:i.bottom-f.bottom)-g;if(Sx&&E.topk&&(k=O?E.top-v-2-g:E.bottom+g+2);if(this.position=="absolute"?(d.style.top=(k-e.parent.top)/s+"px",Iie(d,(x-e.parent.left)/r)):(d.style.top=k/s+"px",Iie(d,x/r)),m){let E=f.left+(w?y.x:-y.x)-(x+14-7);m.style.left=E/r+"px"}u.overlap!==!0&&a.push({left:x,top:k,right:C,bottom:k+v}),d.classList.toggle("cm-tooltip-above",O),d.classList.toggle("cm-tooltip-below",!O),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=MA}},{eventObservers:{scroll(){this.maybeMeasure()}}});function Iie(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const p$t=Gt.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"}}}),m$t={x:0,y:0},vH=ln.define({enables:[yH,p$t]}),AR=ln.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class DD{static create(t){return new DD(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new P3e(t,AR,(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 g$t=vH.compute([AR],e=>{let t=e.facet(AR);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:DD.create,above:t[0].above,arrow:t.some(n=>n.arrow)}}),D3e=ln.define();class b$t{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==qr.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=>ac(t.state,c,"hover tooltip"))}else a(s)}get tooltip(){let t=this.view.plugin(yH),n=t?t.manager.tooltips.findIndex(i=>i.create==DD.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&&!y$t(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:!v$t(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 LA=4;function y$t(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-LA&&t.clientX<=i+LA&&t.clientY>=r-LA&&t.clientY<=s+LA}function v$t(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 x$t(e,t={}){let n=Jn.define(),i=new WeakMap,r=Ka.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,Fa.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(O$t)&&!u.value||u.value==r)&&(a=[]);return a.length&&c&&i.set(a,c),a},provide:a=>AR.from(a)});const s=to.define(a=>new b$t(a,e,r,i,n,t.hoverTime||300));return{active:r,extension:[r,s,D3e.of(s),g$t]}}function w$t(e,t,n,i={}){var r;let s=e.state.facet(D3e).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 M3e(e,t){let n=e.plugin(yH);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}const O$t=Jn.define(),Pie=ln.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 xH(e,t){let n=e.plugin(L3e),i=n?n.specs.indexOf(t):-1;return i>-1?n.panels[i]:null}const L3e=to.fromClass(class{constructor(e){this.input=e.state.facet(LE),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(Pie);this.top=new $A(e,!0,t.topContainer),this.bottom=new $A(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(Pie);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new $A(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new $A(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(LE);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=>Gt.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class $A{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=Die(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=Die(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 Die(e){let t=e.nextSibling;return e.remove(),t}const LE=ln.define({enables:L3e});function k$t(e,t){let n,i=new Promise(a=>n=a),r=a=>S$t(a,t,n);e.state.field(P3,!1)?e.dispatch({effects:$3e.of(r)}):e.dispatch({effects:Jn.appendConfig.of(P3.init(()=>[r]))});let s=F3e.of(r);return{close:s,result:i.then(a=>((e.win.queueMicrotask||(c=>e.win.setTimeout(c,10)))(()=>{e.state.field(P3).indexOf(r)>-1&&e.dispatch({effects:s})}),a))}}const P3=Ka.define({create(){return[]},update(e,t){for(let n of t.effects)n.is($3e)?e=[n.value].concat(e):n.is(F3e)&&(e=e.filter(i=>i!=n.value));return e},provide:e=>LE.computeN([e],t=>t.field(e))}),$3e=Jn.define(),F3e=Jn.define();function S$t(e,t,n){let i=t.content?t.content(e,()=>a(null)):null;if(!i){if(i=Mr("form"),t.input){let l=Mr("input",t.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),i.appendChild(Mr("label",(t.label||"")+": ",l))}else i.appendChild(document.createTextNode(t.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(Mr("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=Mr("div",i,Mr("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 bp extends bg{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}bp.prototype.elementClass="";bp.prototype.toDOM=void 0;bp.prototype.mapMode=Fa.TrackBefore;bp.prototype.startSide=bp.prototype.endSide=-1;bp.prototype.point=!0;const wj=ln.define(),E$t=ln.define(),C$t={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Pi.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},pS=ln.define();function T$t(e){return[B3e(),pS.of({...C$t,...e})]}const Mie=ln.define({combine:e=>e.some(t=>t)});function B3e(e){return[A$t]}const A$t=to.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(pS).map(t=>new $ie(e,t)),this.fixed=!e.state.facet(Mie);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(Mie)!=!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=Pi.iter(this.view.state.facet(wj),this.view.viewport.from),i=[],r=this.gutters.map(s=>new _$t(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==za.Text&&a){TB(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==za.Text){TB(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(pS),n=e.state.facet(pS),i=e.docChanged||e.heightChanged||e.viewportChanged||!Pi.eq(e.startState.facet(wj),e.state.facet(wj),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 $ie(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=>Gt.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==qr.LTR?{left:i,right:r}:{right:i,left:r}})});function Lie(e){return Array.isArray(e)?e:[e]}function TB(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class _$t{constructor(t,n,i){this.gutter=t,this.height=i,this.i=0,this.cursor=Pi.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 U3e(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=[];TB(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(E$t)){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 $ie{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=Lie(n.markers(t)),n.initialSpacer&&(this.spacer=new U3e(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=Lie(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!Pi.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 U3e{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":""),j$t(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 D3 extends bp{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function M3(e,t){return e.state.facet(Hv).formatNumber(t,e.state)}const I$t=pS.compute([Hv],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(N$t)},lineMarker(t,n,i){return i.some(r=>r.toDOM)?null:new D3(M3(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,i)=>{for(let r of t.state.facet(R$t)){let s=r(t,n,i);if(s)return s}return null},lineMarkerChange:t=>t.startState.facet(Hv)!=t.state.facet(Hv),initialSpacer(t){return new D3(M3(t,Fie(t.state.doc.lines)))},updateSpacer(t,n){let i=M3(n.view,Fie(n.view.state.doc.lines));return i==t.number?t:new D3(i)},domEventHandlers:e.facet(Hv).domEventHandlers,side:"before"}));function Q3e(e={}){return[Hv.of(e),B3e(),I$t]}function Fie(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(P$t.range(r)))}return Pi.of(t)});function M$t(){return D$t}let L$t=0,pf=class AB{constructor(t,n,i,r){this.name=t,this.set=n,this.base=i,this.modified=r,this.id=L$t++}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 AB&&(n=t),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let r=new AB(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 _R(t);return i=>i.modified.indexOf(n)>-1?i:_R.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}},$$t=0;class _R{constructor(t){this.name=t,this.instances=[],this.id=$$t++}static get(t,n){if(!n.length)return t;let i=n[0].instances.find(l=>l.base==t&&F$t(n,l.modified));if(i)return i;let r=[],s=new pf(t.name,r,t,n);for(let l of n)l.instances.push(s);let a=B$t(n);for(let l of t.set)if(!l.modified.length)for(let c of a)r.push(_R.get(l,c));return s}}function F$t(e,t){return e.length==t.length&&e.every((n,i)=>n==t[i])}function B$t(e){let t=[[]];for(let n=0;ni.length-n.length)}function jp(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 m=r[f++];if(f==r.length&&m=="!"){a=0;break}if(m!="/")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 $E(i,a,c>0?s.slice(0,c):null);t[u]=d.sort(t[u])}}return z3e.add(t)}const z3e=new qn({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 $E(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}});let $E=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 U$t(e,t){let n=null;for(let i of e){let r=i.style(t);r&&(n=n?n+" "+r:r)}return n}function Q$t(e,t,n,i=0,r=e.length){let s=new z$t(i,Array.isArray(t)?t:[t],n);s.highlightRange(e.cursor(),i,r,"",s.highlighters),s.flush(r)}class z$t{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(m=>!m.scope||m.scope(a)));let u=r,d=V$t(t)||$E.empty,f=U$t(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(qn.mounted);if(h&&h.overlay){let m=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 w=v=x||!t.nextSibling())););if(!w||x>i)break;y=w.to+l,y>n&&(this.highlightRange(m.cursor(),Math.max(n,w.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 V$t(e){let t=e.type.prop(z3e);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const en=pf.define,FA=en(),um=en(),Bie=en(um),Uie=en(um),dm=en(),BA=en(dm),L3=en(dm),uf=en(),ab=en(uf),sf=en(),of=en(),_B=en(),SO=en(_B),UA=en(),re={comment:FA,lineComment:en(FA),blockComment:en(FA),docComment:en(FA),name:um,variableName:en(um),typeName:Bie,tagName:en(Bie),propertyName:Uie,attributeName:en(Uie),className:en(um),labelName:en(um),namespace:en(um),macroName:en(um),literal:dm,string:BA,docString:en(BA),character:en(BA),attributeValue:en(BA),number:L3,integer:en(L3),float:en(L3),bool:en(dm),regexp:en(dm),escape:en(dm),color:en(dm),url:en(dm),keyword:sf,self:en(sf),null:en(sf),atom:en(sf),unit:en(sf),modifier:en(sf),operatorKeyword:en(sf),controlKeyword:en(sf),definitionKeyword:en(sf),moduleKeyword:en(sf),operator:of,derefOperator:en(of),arithmeticOperator:en(of),logicOperator:en(of),bitwiseOperator:en(of),compareOperator:en(of),updateOperator:en(of),definitionOperator:en(of),typeOperator:en(of),controlOperator:en(of),punctuation:_B,separator:en(_B),bracket:SO,angleBracket:en(SO),squareBracket:en(SO),paren:en(SO),brace:en(SO),content:uf,heading:ab,heading1:en(ab),heading2:en(ab),heading3:en(ab),heading4:en(ab),heading5:en(ab),heading6:en(ab),contentSeparator:en(uf),list:en(uf),quote:en(uf),emphasis:en(uf),strong:en(uf),link:en(uf),monospace:en(uf),strikethrough:en(uf),inserted:en(),deleted:en(),changed:en(),invalid:en(),meta:UA,documentMeta:en(UA),annotation:en(UA),processingInstruction:en(UA),definition:pf.defineModifier("definition"),constant:pf.defineModifier("constant"),function:pf.defineModifier("function"),standard:pf.defineModifier("standard"),local:pf.defineModifier("local"),special:pf.defineModifier("special")};for(let e in re){let t=re[e];t instanceof pf&&(t.name=e)}V3e([{tag:re.link,class:"tok-link"},{tag:re.heading,class:"tok-heading"},{tag:re.emphasis,class:"tok-emphasis"},{tag:re.strong,class:"tok-strong"},{tag:re.keyword,class:"tok-keyword"},{tag:re.atom,class:"tok-atom"},{tag:re.bool,class:"tok-bool"},{tag:re.url,class:"tok-url"},{tag:re.labelName,class:"tok-labelName"},{tag:re.inserted,class:"tok-inserted"},{tag:re.deleted,class:"tok-deleted"},{tag:re.literal,class:"tok-literal"},{tag:re.string,class:"tok-string"},{tag:re.number,class:"tok-number"},{tag:[re.regexp,re.escape,re.special(re.string)],class:"tok-string2"},{tag:re.variableName,class:"tok-variableName"},{tag:re.local(re.variableName),class:"tok-variableName tok-local"},{tag:re.definition(re.variableName),class:"tok-variableName tok-definition"},{tag:re.special(re.variableName),class:"tok-variableName2"},{tag:re.definition(re.propertyName),class:"tok-propertyName tok-definition"},{tag:re.typeName,class:"tok-typeName"},{tag:re.namespace,class:"tok-namespace"},{tag:re.className,class:"tok-className"},{tag:re.macroName,class:"tok-macroName"},{tag:re.propertyName,class:"tok-propertyName"},{tag:re.operator,class:"tok-operator"},{tag:re.comment,class:"tok-comment"},{tag:re.meta,class:"tok-meta"},{tag:re.invalid,class:"tok-invalid"},{tag:re.punctuation,class:"tok-punctuation"}]);var $3;const Nm=new qn;function MD(e){return ln.define({combine:e?t=>t.concat(e):void 0})}const wH=new qn;class Xc{constructor(t,n,i=[],r=""){this.data=t,this.name=r,Ui.prototype.hasOwnProperty("tree")||Object.defineProperty(Ui.prototype,"tree",{get(){return Br(this)}}),this.parser=n,this.extension=[wg.of(this),Ui.languageData.of((s,a,l)=>{let c=Qie(s,a,l),u=c.type.prop(Nm);if(!u)return[];let d=s.facet(u),f=c.type.prop(wH);if(f){let h=c.resolve(a-c.from,l);for(let m of f)if(m.test(h,s)){let g=s.facet(m.facet);return m.type=="replace"?g:g.concat(d)}}return d})].concat(i)}isActiveAt(t,n,i=-1){return Qie(t,n,i).type.prop(Nm)==this.data}findRegions(t){let n=t.facet(wg);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(Nm)==this.data){i.push({from:a,to:a+s.length});return}let l=s.prop(qn.mounted);if(l){if(l.tree.prop(Nm)==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 yp(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Br(e){let t=e.field(Xc.state,!1);return t?t.tree:Ci.empty}class H$t{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 EO=null;class Py{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 Py(t,n,[],Ci.empty,0,i,[],null)}startParse(){return this.parser.startParse(new H$t(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Ci.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(Jh.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=EO;EO=this;try{return t()}finally{EO=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=zie(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=Jh.applyChanges(i,c),r=Ci.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=zie(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 AD{createParse(n,i,r){let s=r[0].from,a=r[r.length-1].to;return{parsedPos:s,advance(){let c=EO;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 Ci($o.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 EO}}function zie(e,t,n){return Jh.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class kw{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 kw(n)}static init(t){let n=Math.min(3e3,t.doc.length),i=Py.create(t.facet(wg).parser,t,{from:0,to:n});return i.work(20,n)||i.takeTree(),new kw(i)}}Xc.state=Ka.define({create:kw.init,update(e,t){for(let n of t.effects)if(n.is(Xc.setState))return n.value;return t.startState.facet(wg)!=t.state.facet(wg)?kw.init(t.state):e.apply(t)}});let H3e=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(H3e=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const F3=typeof navigator<"u"&&(!(($3=navigator.scheduling)===null||$3===void 0)&&$3.isInputPending)?()=>navigator.scheduling.isInputPending():null,q$t=to.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(Xc.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(Xc.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=H3e(this.work))}work(t){this.working=null;let n=Date.now();if(this.chunkEndr+1e3,c=s.context.work(()=>F3&&F3()||Date.now()>a,r+(l?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Xc.setState.of(new kw(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=>ac(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()}}}),wg=ln.define({combine(e){return e.length?e[0]:null},enables:e=>[Xc.state,q$t,Gt.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class Og{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}class jR{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 jR(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 W$t=ln.define(),g1=ln.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 Dy(e){let t=e.facet(g1);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function FE(e,t){let n="",i=e.tabSize,r=e.facet(g1)[0];if(r==" "){for(;t>=i;)n+=" ",t-=i;r=" "}for(let s=0;s=t?K$t(e,n,t):null}class LD{constructor(t,n={}){this.state=t,this.options=n,this.unit=Dy(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 Ld(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 Np=new qn;function K$t(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 q3e(i,e,n)}function q3e(e,t,n){for(let i=e;i;i=i.next){let r=X$t(i.node);if(r)return r(kH.create(t,n,i))}return 0}function G$t(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function X$t(e){let t=e.type.prop(Np);if(t)return t;let n=e.firstChild,i;if(n&&(i=n.type.prop(qn.closedBy))){let r=e.lastChild,s=r&&i.indexOf(r.name)>-1;return a=>W3e(a,!0,1,void 0,s&&!G$t(a)?r.from:void 0)}return e.parent==null?Y$t:null}function Y$t(){return 0}class kH extends LD{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 kH(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(Z$t(i,t))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return q3e(this.context.next,this.base,this.pos)}}function Z$t(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function J$t(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 kx({closing:e,align:t=!0,units:n=1}){return i=>W3e(i,t,n,e)}function W3e(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?J$t(e):null;return c?l?e.column(c.from):e.column(c.to):e.baseIndent+(l?0:e.unit*n)}const eFt=e=>e.baseIndent;function Sx({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}const tFt=200;function nFt(){return Ui.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+tFt)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=OH(a,d.from);if(f==null)continue;let h=/^\s*/.exec(d.text)[0],m=FE(a,f);h!=m&&c.push({from:d.from,to:d.from+h.length,insert:m})}return c.length?[e,{changes:c,sequential:!0}]:e})}const K3e=ln.define(),Rp=new qn;function yT(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 rFt(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function NR(e,t,n){for(let i of e.facet(K3e)){let r=i(e,t,n);if(r)return r}return iFt(e,t,n)}function G3e(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 $D=Jn.define({map:G3e}),vT=Jn.define({map:G3e});function X3e(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 My=Ka.define({create(){return En.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((i,r)=>e=Vie(e,i,r)),e=e.map(t.changes);let n=[];for(let i of t.effects)i.is($D)&&!sFt(e,i.value.from,i.value.to)?n.push(i.value):i.is(vT)&&(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(J3e),r=n.map(s=>(i?En.replace({widget:new fFt(i(t.state,s))}):Hie).range(s.from,s.to));e=e.update({add:r})}return t.selection&&(e=Vie(e,t.selection.main.head)),e},provide:e=>Gt.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 RR(e,t,n){var i;let r=null;return(i=e.field(My,!1))===null||i===void 0||i.between(t,n,(s,a)=>{(!r||r.from>s)&&(r={from:s,to:a})}),r}function sFt(e,t,n){let i=!1;return e.between(t,t,(r,s)=>{r==t&&s==n&&(i=!0)}),i}function Y3e(e,t){return e.field(My,!1)?t:t.concat(Jn.appendConfig.of(e4e()))}const oFt=e=>{for(let t of X3e(e)){let n=NR(e.state,t.from,t.to);if(n)return e.dispatch({effects:Y3e(e.state,[$D.of(n),Z3e(e,n)])}),!0}return!1},aFt=e=>{if(!e.state.field(My,!1))return!1;let t=[];for(let n of X3e(e)){let i=RR(e.state,n.from,n.to);i&&t.push(vT.of(i),Z3e(e,i,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function Z3e(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return Gt.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}const lFt=e=>{let{state:t}=e,n=[];for(let i=0;i{let t=e.state.field(My,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(i,r)=>{n.push(vT.of({from:i,to:r}))}),e.dispatch({effects:n}),!0},uFt=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:oFt},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:aFt},{key:"Ctrl-Alt-[",run:lFt},{key:"Ctrl-Alt-]",run:cFt}],dFt={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},J3e=ln.define({combine(e){return Yf(e,dFt)}});function e4e(e){return[My,mFt]}function t4e(e,t){let{state:n}=e,i=n.facet(J3e),r=a=>{let l=e.lineBlockAt(e.posAtDOM(a.target)),c=RR(e.state,l.from,l.to);c&&e.dispatch({effects:vT.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 Hie=En.replace({widget:new class extends qd{toDOM(e){return t4e(e,null)}}});class fFt extends qd{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return t4e(t,this.value)}}const hFt={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class B3 extends bp{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 pFt(e={}){let t={...hFt,...e},n=new B3(t,!0),i=new B3(t,!1),r=to.fromClass(class{constructor(a){this.from=a.viewport.from,this.markers=this.buildMarkers(a)}update(a){(a.docChanged||a.viewportChanged||a.startState.facet(wg)!=a.state.facet(wg)||a.startState.field(My,!1)!=a.state.field(My,!1)||Br(a.startState)!=Br(a.state)||t.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let l=new mp;for(let c of a.viewportLineBlocks){let u=RR(a.state,c.from,c.to)?i:NR(a.state,c.from,c.to)?n:null;u&&l.add(c.from,c.from,u)}return l.finish()}}),{domEventHandlers:s}=t;return[r,T$t({class:"cm-foldGutter",markers(a){var l;return((l=a.plugin(r))===null||l===void 0?void 0:l.markers)||Pi.empty},initialSpacer(){return new B3(t,!1)},domEventHandlers:{...s,click:(a,l,c)=>{if(s.click&&s.click(a,l,c))return!0;let u=RR(a.state,l.from,l.to);if(u)return a.dispatch({effects:vT.of(u)}),!0;let d=NR(a.state,l.from,l.to);return d?(a.dispatch({effects:$D.of(d)}),!0):!1}}}),e4e()]}const mFt=Gt.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 xT{constructor(t,n){this.specs=t;let i;function r(l){let c=yg.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 Xc?l=>l.prop(Nm)==a.data:a?l=>l==a:void 0,this.style=V3e(t.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new yg(i):null,this.themeType=n.themeType}static define(t,n){return new xT(t,n||{})}}const jB=ln.define(),n4e=ln.define({combine(e){return e.length?[e[0]]:null}});function Oj(e){let t=e.facet(jB);return t.length?t:e.facet(n4e)}function i4e(e,t){let n=[bFt],i;return e instanceof xT&&(e.module&&n.push(Gt.styleModule.of(e.module)),i=e.themeType),t!=null&&t.fallback?n.push(n4e.of(e)):i?n.push(jB.computeN([Gt.darkTheme],r=>r.facet(Gt.darkTheme)==(i=="dark")?[e]:[])):n.push(jB.of(e)),n}function Ccn(e,t,n){let i=Oj(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 gFt{constructor(t){this.markCache=Object.create(null),this.tree=Br(t.state),this.decorations=this.buildDeco(t,Oj(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=Br(t.state),i=Oj(t.state),r=i!=Oj(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 En.none;let i=new mp;for(let{from:r,to:s}of t.visibleRanges)Q$t(this.tree,n,(a,l,c)=>{i.add(a,l,this.markCache[c]||(this.markCache[c]=En.mark({class:c})))},r,s);return i.finish()}}const bFt=_p.high(to.fromClass(gFt,{decorations:e=>e.decorations})),yFt=xT.define([{tag:re.meta,color:"#404740"},{tag:re.link,textDecoration:"underline"},{tag:re.heading,textDecoration:"underline",fontWeight:"bold"},{tag:re.emphasis,fontStyle:"italic"},{tag:re.strong,fontWeight:"bold"},{tag:re.strikethrough,textDecoration:"line-through"},{tag:re.keyword,color:"#708"},{tag:[re.atom,re.bool,re.url,re.contentSeparator,re.labelName],color:"#219"},{tag:[re.literal,re.inserted],color:"#164"},{tag:[re.string,re.deleted],color:"#a11"},{tag:[re.regexp,re.escape,re.special(re.string)],color:"#e40"},{tag:re.definition(re.variableName),color:"#00f"},{tag:re.local(re.variableName),color:"#30a"},{tag:[re.typeName,re.namespace],color:"#085"},{tag:re.className,color:"#167"},{tag:[re.special(re.variableName),re.macroName],color:"#256"},{tag:re.definition(re.propertyName),color:"#00c"},{tag:re.comment,color:"#940"},{tag:re.invalid,color:"#f00"}]),vFt=Gt.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),r4e=1e4,s4e="()[]{}",o4e=ln.define({combine(e){return Yf(e,{afterCursor:!0,brackets:s4e,maxScanDistance:r4e,renderMatch:OFt})}}),xFt=En.mark({class:"cm-matchingBracket"}),wFt=En.mark({class:"cm-nonmatchingBracket"});function OFt(e){let t=[],n=e.matched?xFt:wFt;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 qie(e){let t=[],n=e.facet(o4e);for(let i of e.selection.ranges){if(!i.empty)continue;let r=Tf(e,i.head,-1,n)||i.head>0&&Tf(e,i.head-1,1,n)||n.afterCursor&&(Tf(e,i.head,1,n)||i.heade.decorations}),SFt=[kFt,vFt];function EFt(e={}){return[o4e.of(e),SFt]}const a4e=new qn;function NB(e,t,n){let i=e.prop(t<0?qn.openedBy:qn.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 RB(e){let t=e.type.prop(a4e);return t?t(e.node):e}function Tf(e,t,n,i={}){let r=i.maxScanDistance||r4e,s=i.brackets||s4e,a=Br(e),l=a.resolveInner(t,n);for(let c=l;c;c=c.parent){let u=NB(c.type,n,s);if(u&&c.from0?t>=d.from&&td.from&&t<=d.to))return CFt(e,t,n,c,d,u,s)}}return TFt(e,t,n,a,l.type,r,s)}function CFt(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 m=d.value;n<0&&(h+=m.length);let g=t+h*n;for(let b=n>0?0:m.length-1,v=n>0?m.length:-1;b!=v;b+=n){let y=a.indexOf(m[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+=m.length)}return d.done?{start:u,matched:!1}:null}function Wie(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 AFt(e){return{name:e.name||"",token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||_Ft,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||CH,mergeTokens:e.mergeTokens!==!1}}function _Ft(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 Kie=new WeakMap;class SH extends Xc{constructor(t){let n=MD(t.languageData),i=AFt(t),r,s=new class extends AD{createParse(a,l,c){return new NFt(r,a,l,c)}};super(n,s,[],t.name),this.topNode=PFt(n,this),r=this,this.streamParser=i,this.stateAfter=new qn({perNode:!0}),this.tokenTable=t.tokenTable?new f4e(i.tokenTable):IFt}static define(t){return new SH(t)}getIndent(t){let n,{overrideIndentation:i}=t.options;i&&(n=Kie.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 Ci&&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&&EH(e,s.tree,0-s.offset,n,l),u;if(c&&c.pos<=i&&(u=c4e(e,s.tree,n+s.offset,c.pos+s.offset,!1)))return{state:c.state,tree:u}}return{state:e.streamParser.startState(r?Dy(r):4),tree:Ci.empty}}let NFt=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=Py.get(),a=r[0].from,{state:l,tree:c}=jFt(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(Dy(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let t=Py.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)+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=O2(t),i=G0(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=O2(t),i=G0(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 y3t(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new g3t||null,prettyErrors:t}}function yLe(e,t={}){const{lineCounter:n,prettyErrors:i}=y3t(t),r=new b3t(n==null?void 0:n.addNewLine),s=new d3t(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 dk(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(a.errors.forEach(Ene(e,n)),a.warnings.forEach(Ene(e,n))),a}function v3t(e,t,n){let i;const r=yLe(e,n);if(!r)return null;if(r.warnings.forEach(s=>Q5e(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 AD(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 cT(e)&&!i?e.toString(n):new hT(e,i,n).toString(n)}const vLe=1024;let x3t=0,$u=class{constructor(t,n){this.from=t,this.to=n}};class Xn{constructor(t={}){this.id=x3t++,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=Vo.match(t)),n=>{let i=t(n);return i===void 0?null:[this,i]}}}Xn.closedBy=new Xn({deserialize:e=>e.split(" ")});Xn.openedBy=new Xn({deserialize:e=>e.split(" ")});Xn.group=new Xn({deserialize:e=>e.split(" ")});Xn.isolate=new Xn({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});Xn.contextHash=new Xn({perNode:!0});Xn.lookAhead=new Xn({perNode:!0});Xn.mounted=new Xn({perNode:!0});class yx{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[Xn.mounted.id]}}const w3t=Object.create(null);class Vo{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):w3t,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),r=new Vo(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(Xn.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(Xn.group),s=-1;s<(r?r.length:0);s++){let a=n[s<0?i.name:r[s]];if(a)return a}}}}Vo.none=new Vo("",Object.create(null),0,8);class p1{constructor(t){this.types=t;for(let n=0;n0;for(let c=this.cursor(a|hr.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:eH(Vo.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new _i(this.type,n,i,r,this.propValues),t.makeTree||((n,i,r)=>new _i(Vo.none,n,i,r)))}static build(t){return E3t(t)}}_i.empty=new _i(Vo.none,[],[],0);class ZV{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 ZV(this.buffer,this.index)}}class bg{constructor(t,n,i){this.buffer=t,this.length=n,this.set=i}get type(){return Vo.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 AE(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&hr.EnterBracketed&&d instanceof _i&&(h=yx.get(d))&&!h.overlay&&h.bracketed&&i>=f&&i<=f+d.length)&&!xLe(r,i,f,f+d.length))){if(d instanceof bg){if(s&hr.ExcludeBuffers)continue;let m=d.findChild(0,d.buffer.length,n,i-f,r);if(m>-1)return new Cf(new O3t(a,d,t,f),null,m)}else if(s&hr.IncludeAnonymous||!d.type.isAnonymous||JV(d)){let m;if(!(s&hr.IgnoreMounts)&&(m=yx.get(d))&&!m.overlay)return new ul(m.tree,f,t,a);let g=new ul(d,f,t,a);return s&hr.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(n<0?d.children.length-1:0,n,i,r,s)}}}if(s&hr.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&hr.IgnoreOverlays)&&(r=yx.get(this._tree))&&r.overlay){let s=t-this.from,a=i&hr.EnterBracketed&&r.bracketed;for(let{from:l,to:c}of r.overlay)if((n>0||a?l<=s:l=s:c>s))return new ul(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 Rne(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 q8(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 O3t{constructor(t,n,i,r){this.parent=t,this.buffer=n,this.index=i,this.start=r}}class Cf extends wLe{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 Cf(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&hr.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 Cf(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 Cf(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 Cf(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 _i(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function OLe(e){if(!e.length)return null;let t=0,n=e[0];for(let s=1;sn.from||a.to=t){let l=new ul(a.tree,a.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(AE(l,t,n,!1))}}return r?OLe(r):i}class yR{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&~hr.EnterBracketed,t instanceof ul)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 ul?(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&hr.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&hr.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&hr.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&hr.IncludeAnonymous||l instanceof bg||!l.type.isAnonymous||JV(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 q8(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 JV(e){return e.children.some(t=>t instanceof bg||!t.type.isAnonymous||JV(t))}function E3t(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=vLe,reused:s=[],minRepeatType:a=i.types.length}=e,l=Array.isArray(n)?new ZV(n,n.length):n,c=i.types,u=0,d=0;function f(S,k,C,E,R,A){let{id:N,start:T,end:j,size:_}=l,I=d,D=u;if(_<0)if(l.next(),_==-1){let H=s[N];C.push(H),E.push(T-S);return}else if(_==-3){u=N;return}else if(_==-4){d=N;return}else throw new RangeError(`Unrecognized record size: ${_}`);let P=c[N],L,B,M=T-S;if(j-T<=r&&(B=v(l.pos-k,R))){let H=new Uint16Array(B.size-B.skip),K=l.pos-B.size,F=H.length;for(;l.pos>K;)F=y(B.start,H,F);L=new bg(H,j-B.start,i),M=B.start-S}else{let H=l.pos-_;l.next();let K=[],F=[],q=N>=a?N:-1,Q=0,X=j;for(;l.pos>H;)q>=0&&l.id==q&&l.size>=0?(l.end<=X-r&&(g(K,F,T,Q,l.end,X,q,I,D),Q=K.length,X=l.end),l.next()):A>2500?h(T,H,K,F):f(T,H,K,F,q,A+1);if(q>=0&&Q>0&&Q-1&&Q>0){let ne=m(P,D);L=eH(P,K,F,0,K.length,0,j-T,ne,ne)}else L=b(P,K,F,j-T,I-j,D)}C.push(L),E.push(M)}function h(S,k,C,E){let R=[],A=0,N=-1;for(;l.pos>k;){let{id:T,start:j,end:_,size:I}=l;if(I>4)l.next();else{if(N>-1&&j=0;_-=3)T[I++]=R[_],T[I++]=R[_+1]-j,T[I++]=R[_+2]-j,T[I++]=I;C.push(new bg(T,R[2]-j,i)),E.push(j-S)}}function m(S,k){return(C,E,R)=>{let A=0,N=C.length-1,T,j;if(N>=0&&(T=C[N])instanceof _i){if(!N&&T.type==S&&T.length==R)return T;(j=T.prop(Xn.lookAhead))&&(A=E[N]+T.length+j)}return b(S,C,E,R,A,k)}}function g(S,k,C,E,R,A,N,T,j){let _=[],I=[];for(;S.length>E;)_.push(S.pop()),I.push(k.pop()+C-R);S.push(b(i.types[N],_,I,A-R,T-A,j)),k.push(R-C)}function b(S,k,C,E,R,A,N){if(A){let T=[Xn.contextHash,A];N=N?[T].concat(N):[T]}if(R>25){let T=[Xn.lookAhead,R];N=N?[T].concat(N):[T]}return new _i(S,k,C,E,N)}function v(S,k){let C=l.fork(),E=0,R=0,A=0,N=C.end-r,T={size:0,start:0,skip:0};e:for(let j=C.pos-S;C.pos>j;){let _=C.size;if(C.id==k&&_>=0){T.size=E,T.start=R,T.skip=A,A+=4,E+=4,C.next();continue}let I=C.pos-_;if(_<0||I=a?4:0,P=C.start;for(C.next();C.pos>I;){if(C.size<0)if(C.size==-3||C.size==-4)D+=4;else break e;else C.id>=a&&(D+=4);C.next()}R=P,E+=_,A+=D}return(k<0||E==S)&&(T.size=E,T.start=R,T.skip=A),T.size>4?T:void 0}function y(S,k,C){let{id:E,start:R,end:A,size:N}=l;if(l.next(),N>=0&&E4){let j=l.pos-(N-4);for(;l.pos>j;)C=y(S,k,C)}k[--C]=T,k[--C]=A-S,k[--C]=R-S,k[--C]=E}else N==-3?u=E:N==-4&&(d=E);return C}let w=[],x=[];for(;l.pos>0;)f(e.start||0,e.bufferStart||0,w,x,-1,0);let O=(t=e.length)!==null&&t!==void 0?t:w.length?x[0]+w[0].length:0;return new _i(c[e.topID],w.reverse(),x.reverse(),O)}const Ine=new WeakMap;function pj(e,t){if(!e.isAnonymous||t instanceof bg||t.type!=e)return 1;let n=Ine.get(t);if(n==null){n=1;for(let i of t.children){if(i.type!=e||!(i instanceof _i)){n=1;break}n+=pj(e,i)}Ine.set(t,n)}return n}function eH(e,t,n,i,r,s,a,l,c){let u=0;for(let g=i;g=d)break;k+=C}if(x==O+1){if(k>d){let C=g[O];m(C.children,C.positions,0,C.children.length,b[O]+w);continue}f.push(g[O])}else{let C=b[x-1]+g[x-1].length-S;f.push(eH(e,g,b,O,x,S,C,null,c))}h.push(S+w-s)}}return m(t,n,i,r,0),(l||c)(f,h,a)}class tH{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 Cf?this.setBuffer(t.context.buffer,t.index,n):t instanceof ul&&this.map.set(t.tree,n)}get(t){return t instanceof Cf?this.getBuffer(t.context.buffer,t.index):t instanceof ul?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 Jh{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 Jh(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 m=Math.max(h.from,c)-u,g=Math.min(h.to,f)-u;h=m>=g?null:new Jh(m,g,h.tree,h.offset+u,l>0,!!d)}if(h&&r.push(h),a.to>f)break;a=snew $u(r.from,r.to)):[new $u(0,0)]:[new $u(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 C3t{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 kLe(e){return(t,n,i,r)=>new A3t(t,e,n,i,r)}class Pne{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 Dne(e){if(!e.length||e.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(e))}class T3t{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 W8=new Xn({perNode:!0});class A3t{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 _i(i.type,i.children,i.positions,i.length,i.propValues.concat([[W8,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[Xn.mounted.id]=new yx(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(m=>m.fromf)&&n.ranges.push({from:f,to:h})}}l=!1}else if(i&&(a=_3t(i.ranges,r.from,r.to)))l=a!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew $u(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 $u(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=$ne(this.ranges,n.ranges);u.length&&(Dne(u),this.inner.splice(n.index,0,new Pne(n.parser,n.parser.startParse(this.input,Fne(n.mounts,u),u),n.ranges.map(d=>new $u(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 _3t(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 Mne(e,t,n,i,r,s){if(t=t&&n.enter(i,1,hr.IgnoreOverlays|hr.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 _i)n=n.children[0];else break}return!1}}let N3t=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(W8))!==null&&n!==void 0?n:i.to,this.inner=new Lne(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(W8))!==null&&t!==void 0?t:n.to,this.inner=new Lne(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(Xn.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 $ne(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 $u(l,c.to))):c.to>l?n[s--]=new $u(l,c.to):n.splice(s--,1))}}return i}function R3t(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),m=Math.min(d,f,i);hnew $u(h.from+i,h.to+i)),f=R3t(t,d,c,u);for(let h=0,m=c;;h++){let g=h==f.length,b=g?u:f[h].from;if(b>m&&n.push(new Jh(m,b,r.tree,-a,s.from>=m||s.openStart,s.to<=b||s.openEnd)),g)break;m=f[h].to}}else n.push(new Jh(c,u,r.tree,-a,s.from>=a||s.openStart,s.to<=l||s.openEnd))}return n}let K8=[],SLe=[];(()=>{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=SLe[i])t=i+1;else return!0;if(t==n)return!1}}function Bne(e){return e>=127462&&e<=127487}const Une=8205;function P3t(e,t,n=!0,i=!0){return(n?ELe:D3t)(e,t,i)}function ELe(e,t,n){if(t==e.length)return t;t&&CLe(e.charCodeAt(t))&&TLe(e.charCodeAt(t-1))&&t--;let i=O3(e,t);for(t+=Qne(i);t=0&&Bne(O3(e,a));)s++,a-=2;if(s%2==0)break;t+=2}else break}return t}function D3t(e,t,n){for(;t>1;){let i=ELe(e,t-2,n);if(i=56320&&e<57344}function TLe(e){return e>=55296&&e<56320}function Qne(e){return e<65536?1:2}let cr=class ALe{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]=yw(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),bf.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]=yw(this,t,n);let i=[];return this.decompose(t,n,i,0),bf.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 lS(this),s=new lS(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 lS(this,t)}iterRange(t,n=this.length){return new _Le(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 jLe(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]?ALe.empty:t.length<=32?new go(t):bf.from(go.split(t,[]))}};class go extends cr{constructor(t,n=M3t(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 L3t(r,l,i,a);r=l+1,i++}}decompose(t,n,i,r){let s=t<=0&&n>=this.length?this:new go(zne(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(r&1){let a=i.pop(),l=mj(s.text,a.text.slice(),0,s.length);if(l.length<=32)i.push(new go(l,a.length+s.length));else{let c=l.length>>1;i.push(new go(l.slice(0,c)),new go(l.slice(c)))}}else i.push(s)}replace(t,n,i){if(!(i instanceof go))return super.replace(t,n,i);[t,n]=yw(this,t,n);let r=mj(this.text,mj(i.text,zne(this.text,0,t)),n),s=this.length+i.length-(n-t);return r.length<=32?new go(r,s):bf.from(go.split(r,[]),s)}sliceString(t,n=this.length,i=` +`){[t,n]=yw(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 go(i,r)),i=[],r=-1);return r>-1&&n.push(new go(i,r)),n}}class bf extends cr{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]=yw(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 bf(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]=yw(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 bf))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 m of t)i+=m.lines;if(i<32){let m=[];for(let g of t)g.flatten(m);return new go(m,n)}let r=Math.max(32,i>>5),s=r<<1,a=r>>1,l=[],c=0,u=-1,d=[];function f(m){let g;if(m.lines>s&&m instanceof bf)for(let b of m.children)f(b);else m.lines>a&&(c>a||!c)?(h(),l.push(m)):m instanceof go&&c&&(g=d[d.length-1])instanceof go&&m.lines+g.lines<=32?(c+=m.lines,u+=m.length+1,d[d.length-1]=new go(g.text.concat(m.text),g.length+1+m.length)):(c+m.lines>r&&h(),c+=m.lines,u+=m.length+1,d.push(m))}function h(){c!=0&&(l.push(d.length==1?d[0]:bf.from(d,u)),u=-1,c=d.length=0)}for(let m of t)f(m);return h(),l.length==1?l[0]:new bf(l,n)}}cr.empty=new go([""],0);function M3t(e){let t=-1;for(let n of e)t+=n.length+1;return t}function mj(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 go?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 go?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 go){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 go?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 _Le{constructor(t,n,i){this.value="",this.done=!1,this.cursor=new lS(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 jLe{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"&&(cr.prototype[Symbol.iterator]=function(){return this.iter()},lS.prototype[Symbol.iterator]=_Le.prototype[Symbol.iterator]=jLe.prototype[Symbol.iterator]=function(){return this});let L3t=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 yw(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function Sa(e,t,n=!0,i=!0){return P3t(e,t,n,i)}function $3t(e){return e>=56320&&e<57344}function F3t(e){return e>=55296&&e<56320}function tc(e,t){let n=e.charCodeAt(t);if(!F3t(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return $3t(i)?(n-55296<<10)+(i-56320)+65536:n}function nH(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function yf(e){return e<65536?1:2}const G8=/\r\n?|\n/;var Qa=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(Qa||(Qa={}));class Mf{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;nt)return s+(t-r);s+=l}else{if(i!=Qa.Simple&&u>=t&&(i==Qa.TrackDel&&rt||i==Qa.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 Mf(t)}static create(t){return new Mf(t)}}class ea extends Mf{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 X8(this,(n,i,r,s,a)=>t=t.replace(r,r+(i-n),a),!1),t}mapDesc(t,n=!1){return Y8(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&&Nm(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=m?typeof m=="string"?cr.of(m.split(i||G8)):m:cr.empty,b=g.length;if(f==h&&b==0)return;fa&&ol(r,f-a,-1),ol(r,h-f,b),Nm(s,r,g),a=h}}return u(t),c(!l),l}static empty(t){return new ea(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 Nm(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 Y8(e,t,n,i=!1){let r=[],s=i?[]:null,a=new _E(e),l=new _E(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);ol(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 _E{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return n>=t.length?cr.empty:t[n]}textBit(t){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!t?cr.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 vm{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 vm(i,r,this.flags,this.goalColumn)}extend(t,n=t,i=0){if(t<=this.anchor&&n>=this.anchor)return dt.range(t,n,void 0,void 0,i);let r=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return dt.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 dt.range(t.anchor,t.head)}static create(t,n,i,r){return new vm(t,n,i,r)}}class dt{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:dt.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 dt(t.ranges.map(n=>vm.fromJSON(n)),t.main)}static single(t,n=t){return new dt([dt.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?dt.range(c,l):dt.range(l,c))}}return new dt(t,n)}}function RLe(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let iH=0;class un{constructor(t,n,i,r,s){this.combine=t,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=iH++,this.default=t([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(t={}){return new un(t.combine||(n=>n),t.compareInput||((n,i)=>n===i),t.compare||(t.combine?(n,i)=>n===i:rH),!!t.static,t.enables)}of(t){return new gj([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new gj(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new gj(t,this,2,n)}from(t,n){return n||(n=i=>i),this.compute([t],i=>n(i.field(t)))}}function rH(e,t){return e==t||e.length==t.length&&e.every((n,i)=>n===t[i])}class gj{constructor(t,n,i,r){this.dependencies=t,this.facet=n,this.type=i,this.value=r,this.id=iH++}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)||Z8(f,d)){let m=i(f);if(l?!Vne(m,f.values[a],r):!r(m,f.values[a]))return f.values[a]=m,1}return 0},reconfigure:(f,h)=>{let m,g=h.config.address[s];if(g!=null){let b=xR(h,g);if(this.dependencies.every(v=>v instanceof un?h.facet(v)===f.facet(v):v instanceof Ya?h.field(v,!1)==f.field(v,!1):!0)||(l?Vne(m=i(f),b,r):r(m=i(f),b)))return f.values[a]=b,0}else m=i(f);return f.values[a]=m,1}}}get extension(){return this}}function Vne(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(S2).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(S2),a=r.facet(S2),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,S2.of({field:this,create:t})]}get extension(){return this}}const _b={lowest:4,low:3,default:2,high:1,highest:0};function OO(e){return t=>new ILe(t,e)}const jp={highest:OO(_b.highest),high:OO(_b.high),default:OO(_b.default),low:OO(_b.low),lowest:OO(_b.lowest)};class ILe{constructor(t,n){this.inner=t,this.prec=n}get extension(){return this}}class jD{of(t){return new J8(this,t)}reconfigure(t){return jD.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class J8{constructor(t,n){this.compartment=t,this.inner=n}get extension(){return this}}class vR{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 U3t(t,n,a))h instanceof Ya?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(m=>h.slot(m));let d=i==null?void 0:i.config.facets;for(let h in s){let m=s[h],g=m[0].facet,b=d&&d[h]||[];if(m.every(v=>v.type==0))if(l[g.id]=c.length<<1|1,rH(b,m))c.push(i.facet(g));else{let v=g.combine(m.map(y=>y.value));c.push(i&&g.compare(v,i.facet(g))?i.facet(g):v)}else{for(let v of m)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=>B3t(v,g,m))}}let f=u.map(h=>h(l));return new vR(t,a,f,l,c,s)}}function U3t(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 J8&&n.delete(a.compartment)}if(r.set(a,l),Array.isArray(a))for(let u of a)s(u,l);else if(a instanceof J8){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 ILe)s(a.inner,a.prec);else if(a instanceof Ya)i[l].push(a),a.provides&&s(a.provides,l);else if(a instanceof gj)i[l].push(a),a.facet.extensions&&s(a.facet.extensions,_b.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,_b.default),i.reduce((a,l)=>a.concat(l))}function cS(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 xR(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const PLe=un.define(),eB=un.define({combine:e=>e.some(t=>t),static:!0}),DLe=un.define({combine:e=>e.length?e[0]:void 0,static:!0}),MLe=un.define(),LLe=un.define(),$Le=un.define(),FLe=un.define({combine:e=>e.length?e[0]:!1});class Xf{constructor(t,n){this.type=t,this.value=n}static define(){return new Q3t}}class Q3t{of(t){return new Xf(this,t)}}class z3t{constructor(t){this.map=t}of(t){return new Jn(this,t)}}class Jn{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 Jn(this.type,n)}is(t){return this.type==t}static define(t={}){return new z3t(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}}Jn.reconfigure=Jn.define();Jn.appendConfig=Jn.define();class Qo{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&&RLe(i,n.newLength),s.some(l=>l.type==Qo.time)||(this.annotations=s.concat(Qo.time.of(Date.now())))}static create(t,n,i,r,s,a){return new Qo(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(Qo.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}Qo.time=Xf.define();Qo.userEvent=Xf.define();Qo.addToHistory=Xf.define();Qo.remote=Xf.define();function V3t(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 Qo?e=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Qo?e=s[0]:e=ULe(t,vx(s),!1)}return e}function q3t(e){let t=e.startState,n=t.facet($Le),i=e;for(let r=n.length-1;r>=0;r--){let s=n[r](e);s&&Object.keys(s).length&&(i=BLe(i,tB(t,s,e.changes.newLength),!0))}return i==e?e:Qo.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}const W3t=[];function vx(e){return e==null?W3t: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 K3t=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let nB;try{nB=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function G3t(e){if(nB)return nB.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||K3t.test(n)))return!0}return!1}function X3t(e){return t=>{if(!/\S/.test(t))return Ns.Space;if(G3t(t))return Ns.Word;for(let n=0;n-1)return Ns.Word;return Ns.Other}}class qi{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(Jn.reconfigure)?(n=null,i=l.value):l.is(Jn.appendConfig)&&(n=null,i=vx(i).concat(l.value));let s;n?s=t.startState.values.slice():(n=vR.resolve(i,r,this),s=new qi(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,u)=>u.reconfigure(c,this),null).values);let a=t.startState.facet(eB)?t.newSelection:t.newSelection.asSingle();new qi(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:dt.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=vx(i.effects);for(let l=1;la.spec.fromJSON(l,c)))}}return qi.create({doc:t.doc,selection:dt.fromJSON(t.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(t={}){let n=vR.resolve(t.extensions||[],new Map),i=t.doc instanceof cr?t.doc:cr.of((t.doc||"").split(n.staticFacet(qi.lineSeparator)||G8)),r=t.selection?t.selection instanceof dt?t.selection:dt.single(t.selection.anchor,t.selection.head):dt.single(0);return RLe(r,i.length),n.staticFacet(eB)||(r=r.asSingle()),new qi(n,i,r,n.dynamicSlots.map(()=>null),(s,a)=>a.create(s),null)}get tabSize(){return this.facet(qi.tabSize)}get lineBreak(){return this.facet(qi.lineSeparator)||` +`}get readOnly(){return this.facet(FLe)}phrase(t,...n){for(let i of this.facet(qi.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(PLe))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 X3t(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=Sa(n,a,!1);if(s(n.slice(c,a))!=Ns.Word)break;a=c}for(;le.length?e[0]:4});qi.lineSeparator=DLe;qi.readOnly=FLe;qi.phrases=un.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])}});qi.languageData=PLe;qi.changeFilter=MLe;qi.transactionFilter=LLe;qi.transactionExtender=$Le;jD.reconfigure=Jn.define();function Yf(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 yg{eq(t){return this==t}range(t,n=t){return jE.create(t,n,this)}}yg.prototype.startSide=yg.prototype.endSide=0;yg.prototype.point=!1;yg.prototype.mapMode=Qa.TrackDel;function sH(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}class jE{constructor(t,n,i){this.from=t,this.to=n,this.value=i}static create(t,n,i){return new jE(t,n,i)}}function iB(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class oH{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);sm||h==m&&u.startSide>0&&u.endSide<=0)continue;(m-h||u.endSide-u.startSide)<0||(a<0&&(a=h),u.point&&(l=Math.max(l,m-h)),i.push(u),r.push(h-a),s.push(m-a))}return{mapped:i.length?new oH(r,s,i,l):null,pos:a}}}class $i{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 $i(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(iB)),this.isEmpty)return n.length?$i.of(n):this;let l=new QLe(this,null,-1).goto(0),c=0,u=[],d=new mp;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 NE.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return NE.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=Hne(a,l,i),u=new kO(a,c,s),d=new kO(l,c,s);i.iterGaps((f,h,m)=>qne(u,f,d,h,m,r)),i.empty&&i.length==0&&qne(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=Hne(s,a),c=new kO(s,l,0).goto(i),u=new kO(a,l,0).goto(i);for(;;){if(c.to!=u.to||!rB(c.active,u.active)||c.point&&(!u.point||!sH(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 kO(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 mp;for(let r of t instanceof jE?[t]:n?Y3t(t):t)i.add(r.from,r.to,r.value);return i.finish()}static join(t){if(!t.length)return $i.empty;let n=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let r=t[i];r!=$i.empty;r=r.nextLayer)n=new $i(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}}$i.empty=new $i([],[],null,-1);function Y3t(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(iB);t=i}return e}$i.empty.nextLayer=$i.empty;class mp{finishChunk(t){this.chunks.push(new oH(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 mp)).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($i.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=$i.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function Hne(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 QLe(a,n,i,s));return r.length==1?r[0]:new NE(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--)k3(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--)k3(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(),k3(this.heap,0)}}}function k3(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 kO{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=NE.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){E2(this.active,t),E2(this.activeTo,t),E2(this.activeRank,t),this.minActive=Wne(this.active,this.activeTo)}addActive(t){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n0;)n++;C2(this.active,n,i),C2(this.activeTo,n,r),C2(this.activeRank,n,s),t&&C2(t,n,this.cursor.from),this.minActive=Wne(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&&E2(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 qne(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,m=h<0?e.to+c:n.to,g=Math.min(m,a);if(e.point||n.point?(e.point&&n.point&&sH(e.point,n.point)&&rB(e.activeForPoint(e.to),n.activeForPoint(n.to))||s.comparePoint(l,g,e.point,n.point),d=!1):(d&&s.boundChange(l),g>l&&!rB(e.active,n.active)&&s.compareRange(l,g,e.active,n.active),u&&ga)break;l=m,h<=0&&e.next(),h>=0&&n.next()}}function rB(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 Wne(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=Sa(e,r)}return i===!0?-1:e.length}const oB="ͼ",Kne=typeof Symbol>"u"?"__"+oB:Symbol.for(oB),aB=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Gne=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class vg{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 m in l){let g=l[m];if(/&/.test(m))s(m.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 ("+m+") should be a primitive value.");s(r(m),g,d,h)}else g!=null&&d.push(m.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=Gne[Kne]||1;return Gne[Kne]=t+1,oB+t.toString(36)}static mount(t,n,i){let r=t[aB],s=i&&i.nonce;r?s&&r.setNonce(s):r=new Z3t(t,s),r.mount(Array.isArray(n)?n:[n],t)}}let Xne=new Map;class Z3t{constructor(t,n){let i=t.ownerDocument||t,r=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&r.CSSStyleSheet){let s=Xne.get(i);if(s)return t[aB]=s;this.sheet=new r.CSSStyleSheet,Xne.set(i,this)}else this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[aB]=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:'"'},J3t=typeof navigator<"u"&&/Mac/.test(navigator.platform),e4t=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Fa=0;Fa<10;Fa++)xg[48+Fa]=xg[96+Fa]=String(Fa);for(var Fa=1;Fa<=24;Fa++)xg[Fa+111]="F"+Fa;for(var Fa=65;Fa<=90;Fa++)xg[Fa]=String.fromCharCode(Fa+32),RE[Fa]=String.fromCharCode(Fa);for(var S3 in xg)RE.hasOwnProperty(S3)||(RE[S3]=xg[S3]);function t4t(e){var t=J3t&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||e4t&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?RE:xg)[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 Mr(){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 an={mac:Jne||/Mac/.test(Cl.platform),windows:/Win/.test(Cl.platform),linux:/Linux|X11/.test(Cl.platform),ie:ND,ie_version:VLe?lB.documentMode||6:uB?+uB[1]:cB?+cB[1]:0,gecko:Yne,gecko_version:Yne?+(/Firefox\/(\d+)/.exec(Cl.userAgent)||[0,0])[1]:0,chrome:!!E3,chrome_version:E3?+E3[1]:0,ios:Jne,android:/Android\b/.test(Cl.userAgent),webkit:Zne,webkit_version:Zne?+(/\bAppleWebKit\/(\d+)/.exec(Cl.userAgent)||[0,0])[1]:0,safari:dB,safari_version:dB?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Cl.userAgent)||[0,0])[1]:0,tabSize:lB.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function aH(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 wR=Object.create(null);function lH(e,t,n){if(e==t)return!0;e||(e=wR),t||(t=wR);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 n4t(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 eie(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 i4t(e){let t=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new Ry(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}=HLe(t,n);i=(s?n?-3e8:-1:5e8)-1,r=(a?n?2e8:1:-6e8)+1}return new Ry(t,i,r,n,t.widget||null,!0)}static line(t){return new gT(t)}static set(t,n=!1){return $i.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Tn.none=$i.empty;class mT extends Tn{constructor(t){let{start:n,end:i}=HLe(t);super(n?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?aH(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||wR}eq(t){return this==t||t instanceof mT&&this.tagName==t.tagName&&lH(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)}}mT.prototype.point=!1;class gT extends Tn{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof gT&&this.spec.class==t.spec.class&&lH(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)}}gT.prototype.mapMode=Qa.TrackBefore;gT.prototype.point=!0;class Ry extends Tn{constructor(t,n,i,r,s,a){super(n,i,s,t),this.block=r,this.isReplace=a,this.mapMode=r?n<=0?Qa.TrackBefore:Qa.TrackAfter:Qa.TrackDel}get type(){return this.startSide!=this.endSide?qa.WidgetRange:this.startSide<=0?qa.WidgetBefore:qa.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof Ry&&r4t(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)}}Ry.prototype.point=!0;function HLe(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 r4t(e,t){return e==t||!!(e&&t&&e.compare(t))}function xx(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 IE extends yg{constructor(t,n,i){super(),this.tagName=t,this.attributes=n,this.rank=i}eq(t){return t==this||t instanceof IE&&this.tagName==t.tagName&&lH(this.attributes,t.attributes)}static create(t){return new IE(t.tagName,t.attributes||wR,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(t,n=!1){return $i.of(t,n)}}IE.prototype.startSide=IE.prototype.endSide=-1;function PE(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function fB(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function uS(e,t){if(!t.anchorNode)return!1;try{return fB(e,t.anchorNode)}catch{return!1}}function dS(e){return e.nodeType==3?ME(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function fS(e,t,n,i){return n?tie(e,t,n,i,-1)||tie(e,t,n,i,1):!1}function wg(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function OR(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function tie(e,t,n,i,r){for(;;){if(e==n&&t==i)return!0;if(t==(r<0?0:gp(e))){if(e.nodeName=="DIV")return!1;let s=e.parentNode;if(!s||s.nodeType!=1)return!1;t=wg(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?gp(e):0}else return!1}}function gp(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function DE(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 s4t(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 qLe(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 o4t(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,m=d==c.body,g=1,b=1;if(m)h=s4t(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 w=d.getBoundingClientRect();({scaleX:g,scaleY:b}=qLe(d,w)),h={left:w.left,right:w.left+d.clientWidth*g,top:w.top,bottom:w.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 WLe(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 a4t{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?gp(n):0),i,Math.min(t.focusOffset,i?gp(i):0))}set(t,n,i,r){this.anchorNode=t,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}}let Eb=null;an.safari&&an.safari_version>=26&&(Eb=!1);function KLe(e){if(e.setActive)return e.setActive();if(Eb)return e.focus(Eb);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(Eb==null?{get preventScroll(){return Eb={preventScroll:!0},!0}}:void 0),!Eb){Eb=!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 XLe(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=gp(n)}else if(n.parentNode&&!OR(n))i=wg(n),n=n.parentNode;else return null}}function YLe(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 e3e(e,t){if(e.length!=t.length)return!1;for(let n=0;n=0;b-=3)if(of[b+1]==-m){let v=of[b+2],y=v&2?r:v&4?v&1?s:r:0;y&&(Hr[f]=Hr[of[b]]=y),l=b;break}}else{if(of.length==189)break;of[l++]=f,of[l++]=h,of[l++]=c}else if((g=Hr[f])==2||g==1){let b=g==r;c=b?0:1;for(let v=l-3;v>=0;v-=3){let y=of[v+2];if(y&2)break;if(b)of[v+2]|=2;else{if(y&4)break;of[v+2]|=4}}}}}function m4t(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),Hr[--g]=m;c=d}else s=u,c++}}}function pB(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 Tf(c,b.from,m));let v=b.direction==Iy!=!(m%2);mB(e,v?i+1:i,r,b.inner,b.from,b.to,a),c=b.to}g=b.to}else{if(g==n||(d?Hr[g]!=l:Hr[g]==l))break;g++}h?pB(e,c,g,i+1,r,h,a):ct;){let d=!0,f=!1;if(!u||c>s[u-1].to){let b=Hr[c-1];b!=l&&(d=!1,f=b==16)}let h=!d&&l==1?[]:null,m=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(Hr[v-1]==l)break e;break}}if(h)h.push(b);else{b.toHr.length;)Hr[Hr.length]=256;let i=[],r=t==Iy?0:1;return mB(e,r,r,n,0,e.length,i),i}function t3e(e){return[new Tf(0,e,0)]}let n3e="";function b4t(e,t,n,i,r){var s;let a=i.head-e.from,l=Tf.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=Sa(e.text,a,c.forward(r,n));(dc.to)&&(d=u),n3e=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)}),u3e=un.define({combine:e=>e.some(t=>t)}),d3e=un.define();class Ox{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 Ox(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 Ox(dt.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const T2=Jn.define({map:(e,t)=>e.map(t)}),f3e=Jn.define();function lc(e,t,n){let i=e.facet(o3e);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 Ih=un.define({combine:e=>e.length?e[0]:!0});let v4t=0;const Vv=un.define({combine(e){return e.filter((t,n)=>{for(let i=0;i{let c=[];return a&&c.push(RD.of(u=>{let d=u.plugin(l);return d?a(d):Tn.none})),s&&c.push(s(l)),c})}static fromClass(t,n){return ro.define((i,r)=>new t(i,r),n)}}class C3{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(lc(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){lc(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){lc(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const h3e=un.define(),fH=un.define(),RD=un.define(),p3e=un.define(),hH=un.define(),bT=un.define(),m3e=un.define();function iie(e,t){let n=e.state.facet(m3e);if(!n.length)return n;let i=n.map(s=>s instanceof Function?s(e):s),r=[];return $i.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 m=l[h].spec.bidiIsolate,g;if(m==null&&(m=y4t(t.text,u,d)),c>0&&f.length&&(g=f[f.length-1]).to==u&&g.direction==m)g.to=d,f=g.inner;else{let b={from:u,to:d,direction:m,inner:[]};f.push(b),f=b.inner}}}}),r}const g3e=un.define();function pH(e){let t=0,n=0,i=0,r=0;for(let s of e.state.facet(g3e)){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 fk=un.define();class Fu{constructor(t,n,i,r){this.fromA=t,this.toA=n,this.fromB=i,this.toB=r}join(t){return new Fu(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 Fu(s,a,l,c))),this.changedRanges=r}static create(t,n,i){return new kR(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 x4t=[];class io{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 x4t}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&&n4t(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=wg(this.dom),r=this.length?t>0:n>0;return new Ad(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 PD)return t;return null}static get(t){return t.cmTile}}class ID extends io{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=rie(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=rie(r);this.length=a}}function rie(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class PD extends ID{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=io.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 ep)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 ep extends ID{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 ep(n||document.createElement(t.tagName),t);return n||(i.flags|=4),i}}class vw extends ID{constructor(t,n){super(t),this.attrs=n}isLine(){return!0}static start(t,n,i){let r=new vw(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,m=0;h=f&&(g.isComposite()?c(g,f-m):(!a||a.isHidden&&(n>0&&!(a.flags&32)||i&&O4t(a,g)))&&(b>f||g.flags&32)?(a=g,l=f-m):(mr&&(t=r);let s=t,a=t,l=0;t==0&&n<0||t==r&&n>=0?an.chrome||an.gecko||(t?(s--,l=1):a=0)?0:c.length-1];return an.safari&&!l&&u.width==0&&(u=Array.prototype.find.call(c,d=>d.width)||u),i==null?u:DE(u,(l?l>0:n<0)==i)}static of(t,n){let i=new zb(n||document.createTextNode(t),t);return n||(i.flags|=2),i}}class Py extends io{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 DE(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 k4t{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 rc&&u.mark.eq(c.mark))u.dom!=c.dom&&u.setDOM(T3(c.dom)),r=u;else{if(this.cache.reused.get(c)){let f=io.get(c.dom);f&&f.setDOM(T3(c.dom))}let d=rc.of(c.mark,c.dom);r.append(d),r=d}this.cache.reused.set(c,2)}let s=io.get(t.text);s&&this.cache.reused.set(s,2);let a=new zb(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=b3e);let r=vw.start(t,n||((i=this.cache.find(vw))===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 rc&&l.mark.eq(a))r=l,n--;else{let c=rc.of(a,(i=this.cache.find(rc,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||!sie(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(an.ios&&sie(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(A3,0,32)||new Py(A3.toDOM(),0,A3,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 S4t(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(SR,void 0,1);return i&&(i.flags=n),i||new SR(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class C4t{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 ER=[Py,vw,zb,rc,SR,ep,PD];for(let e=0;e[]),this.index=ER.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 rc&&r.unshift(a.mark)),this.openWidget=!1},leave:a=>{a.isLine()?r.length&&(r.length=s=0):a instanceof rc&&(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=$i.spans(this.decorations,t,n,{point:(l,c,u,d,f,h)=>{if(u instanceof Ry){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 m=u.widget||(u.block?xw.block:xw.inline),g=_4t(u),b=this.cache.findWidget(m,c-l,g)||Py.of(m,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=j4t(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=io.get(r);if(r==this.view.contentDOM)break;s instanceof rc?n.push(s):s!=null&&s.isLine()?i=s:s instanceof ep||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new vw(r,b3e):i||n.push(rc.of(new mT({tagName:r.nodeName.toLowerCase(),attributes:i4t(r)}),r)))}return{line:i,marks:n}}}function sie(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 _4t(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 b3e={class:"cm-line"};function j4t(e,t){let n=t.spec.attributes,i=t.spec.class;return!n&&!i||(e||(e={class:"cm-line"}),n&&aH(n,e),i&&(e.class+=" "+i)),e}function N4t(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 rc&&t.push(i.mark)}return t}function T3(e){let t=io.get(e);return t&&t.setDOM(e.cloneNode()),e}class xw extends Wd{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}}xw.inline=new xw("span");xw.block=new xw("div");const A3=new class extends Wd{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class oie{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Tn.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 PD(t,t.contentDOM),this.updateInner([new Fu(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:!B4t(t.changes,this.hasComposition)&&!t.selectionSet&&(r=t.state.selection.main.head));let s=r>-1?I4t(this.view,t.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:f}=this.hasComposition;i=new Fu(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,(an.ie||an.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=M4t(a,this.decorations,t.changes);c.length&&(i=Fu.extendWithRanges(i,c));let u=$4t(l,this.blockWrappers,t.changes);return u.length&&(i=Fu.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 A4t(this.view,a,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&io.get(n.text)&&l.cache.reused.set(io.get(n.text),2),this.tile=l.run(t,n),bB(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=an.chrome||an.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)&&uS(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)),an.gecko&&c.empty&&!this.hasComposition&&R4t(u)){let h=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(h,u.node.childNodes[u.offset]||null)),u=d=new Ad(h,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!fS(u.node,u.offset,f.anchorNode,f.anchorOffset)||!fS(d.node,d.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,c))&&(this.view.observer.ignore(()=>{an.android&&an.chrome&&i.contains(f.focusNode)&&F4t(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let h=PE(this.view.root);if(h)if(c.empty){if(an.gecko){let m=P4t(u.node,u.offset);if(m&&m!=3){let g=(m==1?XLe:YLe)(u.node,u.offset);g&&(u=new Ad(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 m=document.createRange();c.anchor>c.head&&([u,d]=[d,u]),m.setEnd(d.node,d.offset),m.setStart(u.node,u.offset),h.removeAllRanges(),h.addRange(m)}a&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,d)),this.impreciseAnchor=u.precise?null:new Ad(f.anchorNode,f.anchorOffset),this.impreciseHead=d.precise?null:new Ad(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&fS(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=PE(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=gp(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&&!io.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 _3?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==qr.LTR,u=0,d=(f,h,m)=>{for(let g=0;gr);g++){let b=f.children[g],v=h+b.length,y=b.dom.getBoundingClientRect(),{height:w}=y;if(m&&!g&&(u+=y.top-m.top),b instanceof ep)v>i&&d(b,h,y);else if(h>=i&&(u>0&&n.push(-u),n.push(w+u),u=0,a)){let x=b.dom.lastChild,O=x?dS(x):[];if(O.length){let S=O[O.length-1],k=c?S.right-y.left:y.right-S.left;k>l&&(l=k,this.minWidth=s,this.minWidthFrom=h,this.minWidthTo=v)}}m&&g==f.children.length-1&&(u+=m.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"?qr.RTL:qr.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=dS(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=dS(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(Tn.replace({widget:new _3(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,a))}if(!s)break;i=s.to+1}return Tn.set(t)}updateDeco(){let t=1,n=this.view.state.facet(RD).map(s=>(this.dynamicDecorationMap[t++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(hH).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($i.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(d3e))try{if(u(this.view,t.range,t))return!0}catch(d){lc(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=pH(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(o4t(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(){bB(this.tile)}}function bB(e,t){let n=t==null?void 0:t.get(e);if(n!=1){n==null&&e.destroy();for(let i of e.children)bB(i,t)}}function R4t(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 y3e(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let i=XLe(n.focusNode,n.focusOffset),r=YLe(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=io.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(e.docView.lastCompositionAfterCursor){let c=io.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 I4t(e,t,n){let i=y3e(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 Fu(c.mapPos(s),c.mapPos(a),s,a),text:r}}function P4t(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t{it.from&&(n=!0)}),n}class _3 extends Wd{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 U4t(e,t,n=1){let i=e.charCategorizer(t),r=e.doc.lineAt(t),s=t-r.from;if(r.length==0)return dt.cursor(t);s==0?n=1:s==r.length&&(n=-1);let a=s,l=s;n<0?a=Sa(r.text,s,!1):l=Sa(r.text,s);let c=i(r.text.slice(a,l));for(;a>0;){let u=Sa(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+sB(a,s,e.state.tabSize)}function yB(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==qa.Text&&(r.type!=s.type||(n<0?s.fromt)))&&(r=s)}}return r||i}return i}function z4t(e,t,n,i){let r=yB(e,t.head,t.assoc||-1),s=!i||r.type!=qa.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==qr.LTR)?a.right-1:a.left+1,y:(s.top+s.bottom)/2});if(c!=null)return dt.cursor(c,n?-1:1)}return dt.cursor(n?r.to:r.from,n?-1:1)}function aie(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=b4t(r,s,a,l,n),d=n3e;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 V4t(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 H4t(e,t,n,i){let r=t.head,s=n?1:-1;if(r==(n?e.state.doc.length:0))return dt.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,m=i??h;for(let g=0;;g+=h){let b=l+(m+g)*s,v=vB(e,{x:f,y:b},!1,s);if(n?b>c.bottom:bl:w{if(t>s&&tr(e)),n.from,t.head>n.from?-1:1);return i==n.from?n:dt.cursor(i,ie.viewState.docHeight)return new vf(e.state.doc.length,-1);if(u=e.elementAtHeight(c),i==null)break;if(u.type==qa.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==qa.Text){let f=Q4t(e,r,u,a,l);return new vf(f,f==u.from?1:-1)}}if(u.type!=qa.Text)return c<(u.top+u.bottom)/2?new vf(u.from,1):new vf(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 q4t(e,a,l,e.textDirectionAt(u.from)).scanTile(d,u.from)}class q4t{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 w=0;w1)){if(w.bottomthis.y)(!u||u.top>w.top)&&(u=w),x=-1;else{let O=w.left>this.x?this.x-w.left:w.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 m=(l?this.dirAt(t[d],1):this.baseDir)==qr.LTR;return{i:d,after:this.x>(h.left+h.right)/2==m}}scanText(t,n){let i=[];for(let s=0;s{let a=i[s]-n,l=i[s+1]-n;return ME(t.dom,a,l).getClientRects()});return r.after?new vf(i[r.i+1],-1):new vf(i[r.i],1)}scanTile(t,n){if(!t.length)return new vf(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:ME(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 vf(i[r.i+1],-1):new vf(a,1)}}const fv="￿";class W4t{constructor(t,n){this.points=t,this.view=n,this.text="",this.lineSeparator=n.state.facet(qi.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=fv}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=io.get(r),l=r.nextSibling;if(l==n){a!=null&&a.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let c=io.get(l);(a&&c?a.breakAfter:(a?a.breakAfter:OR(r))||OR(l)&&(r.nodeName!="BR"||a!=null&&a.isWidget())&&this.text.length>s)&&!G4t(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=io.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+(K4t(t,i.node,i.offset)?n:0))}}function K4t(e,t,n){for(;;){if(!t||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=x3e(t.docView.tile,n,i,0))){let c=s||a?[]:Z4t(t),u=new W4t(c,t);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=J4t(c,this.bounds.from)}else{let c=t.observer.selectionRange,u=s&&s.node==c.focusNode&&s.offset==c.focusOffset||!fB(t.contentDOM,c.focusNode)?l.main.head:t.docView.posFromDOM(c.focusNode,c.focusOffset),d=a&&a.node==c.anchorNode&&a.offset==c.anchorOffset||!fB(t.contentDOM,c.anchorNode)?l.main.anchor:t.docView.posFromDOM(c.anchorNode,c.anchorOffset),f=t.viewport;if((an.ios||an.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(dt.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),m=0;h&&(m=t.inputState.lastTouchY<=h.bottom?-1:1),this.newSel=dt.create([dt.cursor(u,m)])}else this.newSel=dt.single(d,u)}}}function x3e(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 x3e(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 w3e(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||an.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:cr.of(t.text.slice(s.from-l,h).split(fv))}:(m=O3e(f,t.text,u-l,d))&&(an.chrome&&a==13&&m.toB==m.from+2&&t.text.slice(m.from,m.toB)==fv+fv&&m.toB--,n={from:l+m.from,to:l+m.toA,insert:cr.of(t.text.slice(m.from,m.toB).split(fv))})}else i&&(!e.hasFocus&&r.facet(Ih)||CR(i,s))&&(i=null);if(!n&&!i)return!1;if((an.mac||an.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=dt.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:cr.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)}:an.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==` + `&&e.lineWrapping&&(i&&(i=dt.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:cr.of([" "])}),n)return mH(e,n,i,a);if(i&&!CR(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=v3e(r.facet(bT).map(u=>u(e)),i))),e.dispatch({selection:i,scrollIntoView:l,userEvent:c}),!0}else return!1}function mH(e,t,n,i=-1){if(an.ios&&e.inputState.flushIOSKey(t))return!0;let r=e.state.selection.main;if(an.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&&wx(e.contentDOM,"Enter",13)||(t.from==r.from-1&&t.to==r.to&&t.insert.length==0||i==8&&t.insert.lengthr.head)&&wx(e.contentDOM,"Backspace",8)||t.from==r.from&&t.to==r.to+1&&t.insert.length==0&&wx(e.contentDOM,"Delete",46)))return!0;let s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a,l=()=>a||(a=Y4t(e,t,n));return e.state.facet(a3e).some(c=>c(e,t.from,t.to,s,l))||e.dispatch(l()),!0}function Y4t(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:dt.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&&y3e(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 m=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-m,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}),w=g.to-s.to;return{changes:y,range:u?dt.range(Math.max(0,u.anchor+w),Math.max(0,u.head+w)):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 O3e(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 Z4t(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 lie(n,i)),(r!=n||s!=i)&&t.push(new lie(r,s))),t}function J4t(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?dt.single(n+t,i+t):null}function CR(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class e6t{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,an.safari&&t.contentDOM.addEventListener("input",()=>null),an.gecko&&g6t(t.contentDOM.ownerDocument)}handleEvent(t){!c6t(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=n6t(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&&S3e.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),an.android&&an.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;if(an.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&(k3e.some(n=>n.keyCode==t.keyCode)&&!t.ctrlKey||i6t.indexOf(t.key)>-1&&t.ctrlKey)){let n={ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey,shiftKey:t.shiftKey};return n.shiftKey&&an.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&t6t(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:an.safari&&!an.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 t6t(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function cie(e,t){return(n,i)=>{try{return t.call(e,i,n)}catch(r){lc(n.state,r)}}}function n6t(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(cie(i.value,c))}if(a)for(let l in a){let c=a[l];c&&n(l).observers.push(cie(i.value,c))}}for(let i in Fd)n(i).handlers.push(Fd[i]);for(let i in Ml)n(i).observers.push(Ml[i]);return t}const k3e=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],i6t="dthko",S3e=[16,17,18,20,91,92,224,225],A2=6;function _2(e){return Math.max(0,e)*.7+8}function r6t(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class s6t{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=WLe(t.contentDOM),this.atoms=t.state.facet(bT).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(qi.allowMultipleSelections)&&o6t(t,n),this.dragging=l6t(t,n)&&T3e(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&&r6t(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=pH(this.view);t.clientX-c.left<=r+A2?n=-_2(r-t.clientX):t.clientX+c.right>=a-A2&&(n=_2(t.clientX-a)),t.clientY-c.top<=s+A2?i=-_2(s-t.clientY):t.clientY+c.bottom>=l-A2&&(i=_2(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=v3e(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 o6t(e,t){let n=e.state.facet(i3e);return n.length?n[0](t):an.mac?t.metaKey:t.ctrlKey}function a6t(e,t){let n=e.state.facet(r3e);return n.length?n[0](t):an.mac?!t.altKey:!t.ctrlKey}function l6t(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let i=PE(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 c6t(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=io.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(t))return!1;return!0}const Fd=Object.create(null),Ml=Object.create(null),E3e=an.ie&&an.ie_version<15||an.ios&&an.webkit_version<604;function u6t(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(),C3e(e,n.value)},50)}function DD(e,t,n){for(let i of e.facet(t))n=i(n,e);return n}function C3e(e,t){t=DD(e.state,uH,t);let{state:n}=e,i,r=1,s=n.toText(t),a=s.lines==n.selection.ranges.length;if(xB!=null&&n.selection.ranges.every(c=>c.empty)&&xB==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:dt.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:dt.cursor(c.from+u.length)}}):i=n.replaceSelection(s);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Ml.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,an.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())};Ml.wheel=Ml.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()};Fd.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);Ml.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")};Ml.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};Ml.touchend=(e,t)=>{e.inputState.touchActive=!1};Fd.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(s3e))if(n=i(e,t),n)break;if(!n&&t.button==0&&(n=f6t(e,t)),n){let i=!e.hasFocus;e.inputState.startMouseSelection(new s6t(e,t,n,i)),i&&e.observer.ignore(()=>{KLe(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 uie(e,t,n,i){if(i==1)return dt.cursor(t,n);if(i==2)return U4t(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?(fie+1)%3:1}function f6t(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),i=T3e(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=uie(e,c.pos,c.assoc,i);if(n.pos!=c.pos&&!a){let f=uie(e,n.pos,n.assoc,i),h=Math.min(f.from,d.from),m=Math.max(f.to,d.to);d=h1&&(u=h6t(r,c.pos))?u:l?r.addRange(d):dt.create([d])}}}function h6t(e,t){for(let n=0;n=t)return dt.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}Fd.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=dt.undirectionalRange(s,a))}}let{inputState:i}=e;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",DD(e.state,dH,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};Fd.dragend=e=>(e.inputState.draggedContent=null,!1);function pie(e,t,n,i){if(n=DD(e.state,uH,n),!n)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:s}=e.inputState,a=i&&s&&a6t(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}Fd.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&&pie(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 pie(e,t,i,!0),!0}return!1};Fd.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=E3e?null:t.clipboardData;return n?(C3e(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(u6t(e),!1)};function p6t(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 m6t(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:DD(e,dH,t.join(e.lineBreak)),ranges:n,linewise:i}}let xB=null;Fd.copy=Fd.cut=(e,t)=>{if(!uS(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=m6t(e.state);if(!n&&!r)return!1;xB=r?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=E3e?null:t.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(p6t(e,n),!1)};const A3e=Xf.define();function _3e(e,t){let n=[];for(let i of e.facet(l3e)){let r=i(e,t);r&&n.push(r)}return n.length?e.update({effects:n,annotations:A3e.of(!0)}):null}function j3e(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=_3e(e.state,t);n?e.dispatch(n):e.update([])}},10)}Ml.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),j3e(e)};Ml.blur=e=>{e.observer.clearSelectionRange(),j3e(e)};Ml.compositionstart=Ml.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};Ml.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,an.chrome&&an.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))};Ml.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};Fd.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 mH(e,{from:c,to:u,insert:e.state.toText(s)},null),!0}}let r;if(an.chrome&&an.android&&(r=k3e.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 an.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),an.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>Ml.compositionend(e,t),20),!1};const mie=new Set;function g6t(e){mie.has(e)||(mie.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const gie=["pre-wrap","normal","pre-line","break-spaces"];let ww=!1;function bie(){ww=!1}class b6t{constructor(t){this.lineWrapping=t,this.doc=cr.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 gie.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)>bj&&(ww=!0),this.height=t)}replace(t,n,i){return Dl.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,Zr.ByPosNoHeight,i.setDoc(n),0,0),m=h.to>=u?h:s.lineAt(u,Zr.ByPosNoHeight,i,0,0);for(f+=m.to-u,u=m.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,Zr.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 $c extends N3e{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 Ed(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 $c||r instanceof $a&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof $a?r=new $c(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):Dl.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 $a extends Dl{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 $a?i[i.length-1]=new $a(s.length+r):i.push(null,new $a(r-1))}if(t>0){let s=i[0];s instanceof $a?i[0]=new $a(t+s.length):i.unshift(new $a(t-1),null)}return Dl.of(i)}decomposeLeft(t,n){n.push(new $a(t-1),null)}decomposeRight(t,n){n.push(null,new $a(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 $a(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)>=bj&&(c=-2);let m=new $c(d,f,h);m.outdated=!1,a.push(m),l+=d+1}l<=s&&a.push(null,new $a(s-l).updateHeight(t,l));let u=Dl.of(a);return(c<0||Math.abs(u.height-this.height)>=bj||Math.abs(c-this.heightMetrics(t,n).perLine)>=bj)&&(ww=!0),TR(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 x6t extends Dl{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==Zr.ByPosNoHeight?Zr.ByPosNoHeight:Zr.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,Zr.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&&yie(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?Dl.of(this.break?[t,null,n]:[t,n]):(this.left=TR(this.left,t),this.right=TR(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 yie(e,t){let n,i;e[t]==null&&(n=e[t-1])instanceof $a&&(i=e[t+1])instanceof $a&&e.splice(t-1,3,new $a(n.length+1+i.length))}const w6t=5;class gH{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 $c?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new $c(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=w6t)&&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 $c(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,n){let i=new $a(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 $c)return t;let n=new $c(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 $c)&&!this.isCovered?this.nodes.push(new $c(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 E6t(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left0&&t.top0}function C6t(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class N3{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 b6t(i),this.stateDeco=wie(n),this.heightMap=Dl.empty().applyChanges(this.stateDeco,cr.empty,this.heightOracle.setDoc(n.doc),[new Fu(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=Tn.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 j2(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?xie:new bH(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(hk(t,this.scaler))})}update(t,n=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=wie(this.state);let r=t.changedRanges,s=Fu.extendWithRanges(r,O6t(i,this.stateDeco,t?t.changes:ea.empty(this.state.doc.length))),a=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);bie(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=a||ww)&&(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(u3e)&&(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"?qr.RTL:qr.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:S,scaleY:k}=qLe(n,l);(S>.005&&Math.abs(this.scaleX-S)>.005||k>.005&&Math.abs(this.scaleY-k)>.005)&&(this.scaleX=S,this.scaleY=k,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 m=WLe(this.view.contentDOM,!1).y;m!=this.scrollParent&&(this.scrollParent=m,this.scrollAnchorHeight=-1,this.scrollOffset=0);let g=this.getScrollOffset();this.scrollOffset!=g&&(this.scrollAnchorHeight=-1,this.scrollOffset=g),this.scrolledToBottom=GLe(this.scrollParent||t.win);let b=(this.printing?C6t:S6t)(n,this.paddingTop),v=b.top-this.pixelViewport.top,y=b.bottom-this.pixelViewport.bottom;this.pixelViewport=b;let w=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(w!=this.inView&&(this.inView=w,w&&(c=!0)),!this.inView&&!this.scrollTarget&&!E6t(t.dom))return 0;let x=l.width;if((this.contentDOMWidth!=x||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=t.scrollDOM.clientHeight,u|=16),c){let S=t.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(S)&&(a=!0),a||r.lineWrapping&&Math.abs(x-this.contentDOMWidth)>r.charWidth){let{lineHeight:k,charWidth:C,textHeight:E}=t.docView.measureTextSize();a=k>0&&r.refresh(s,k,C,E,Math.max(5,x/C),S),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)),bie();for(let k of this.viewports){let C=k.from==this.viewport.from?S:t.docView.measureVisibleLineHeights(k);this.heightMap=(a?Dl.empty().applyChanges(this.stateDeco,cr.empty,this.heightOracle,[new Fu(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new y6t(k.from,C))}ww&&(u|=2)}let O=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return O&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),u|=this.updateForViewport()),(u&2||O)&&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 j2(r.lineAt(a-i*1e3,Zr.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,Zr.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,Zr.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!=qr.LTR&&!i)return[];let l=[],c=(d,f,h,m)=>{if(f-dd&&yy.from>=h.from&&y.to<=h.to&&Math.abs(y.from-d)y.fromw));if(!v){if(fx.from<=f&&x.to>=f)){let x=n.moveToLineBoundary(dt.cursor(f),!1,!0).head;x>d&&(f=x)}let y=this.gapSize(h,d,f,m),w=i||y<2e6?y:2e6;v=new N3(d,f,y,w)}l.push(v)},u=d=>{if(d.length2e6)for(let k of t)k.from>=d.from&&k.fromd.from&&c(d.from,m,d,f),gn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let i=[];$i.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)||hk(this.heightMap.lineAt(t,Zr.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)||hk(this.heightMap.lineAt(this.scaler.fromDOM(t),Zr.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 hk(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 j2{constructor(t,n){this.from=t,this.to=n}}function A6t(e,t,n){let i=[],r=e,s=0;return $i.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 R2(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 _6t(e,t){for(let n of e)if(t(n))return n}const xie={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function wie(e){let t=e.facet(RD).filter(i=>typeof i!="function"),n=e.facet(hH).filter(i=>typeof i!="function");return n.length&&t.push($i.join(n)),t}class bH{constructor(t,n,i){let r=0,s=0,a=0;this.viewports=i.map(({from:l,to:c})=>{let u=n.lineAt(l,Zr.ByPos,t,0,0).top,d=n.lineAt(c,Zr.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 hk(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),i=t.toDOM(e.bottom);return new Ed(e.from,e.length,n,i-n,Array.isArray(e._content)?e._content.map(r=>hk(r,t)):e._content)}const I2=un.define({combine:e=>e.join(" ")}),wB=un.define({combine:e=>e.indexOf(!0)>-1}),OB=vg.newName(),R3e=vg.newName(),I3e=vg.newName(),P3e={"&light":"."+R3e,"&dark":"."+I3e};function kB(e,t,n){return new vg(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 j6t=kB("."+OB,{"&":{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"}},P3e),N6t={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},R3=an.ie&&an.ie_version<=11;class R6t{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new a4t,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);(an.ie&&an.ie_version<=11||an.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&&an.android&&t.constructor.EDIT_CONTEXT!==!1&&!(an.chrome&&an.chrome_version<126)&&(this.editContext=new P6t(t),t.state.facet(Ih)&&(t.contentDOM.editContext=this.editContext.editContext)),R3&&(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(Ih)?i.root.activeElement!=this.dom:!uS(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}(an.ie&&an.ie_version<=11||an.android&&an.chrome)&&!i.state.selection.main.empty&&r.focusNode&&fS(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=PE(t.root);if(!n)return!1;let i=an.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&I6t(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=uS(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&&wx(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&&uS(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 X4t(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=w3e(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!CR(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=Oie(n,t.previousSibling||t.target.previousSibling,-1),r=Oie(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(Ih)!=t.state.facet(Ih)&&(t.view.contentDOM.editContext=t.state.facet(Ih)?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 Oie(e,t,n){for(;t;){let i=io.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 kie(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 fS(a.node,a.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function I6t(e,t){if(t.getComposedRanges){let r=t.getComposedRanges(e.root)[0];if(r)return kie(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?kie(e,n):null}class P6t{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=O3e(t.state.sliceDoc(l,c),i.text,(u?r.from:r.to)-l,u?"end":null);if(!d){let h=dt.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));CR(h,r)||t.dispatch({selection:h,userEvent:"select"});return}let f={from:d.from+l,to:d.toA+l,insert:cr.of(i.text.slice(d.from,d.toB).split(` +`))};if((an.mac||an.android)&&f.from==a-1&&/^\. ?$/.test(i.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:c,insert:cr.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!t.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);mH(t,f,dt.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=PE(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||l4t(t.parent)||document,this.viewState=new vie(this,t.state||qi.create(t)),t.scrollTo&&t.scrollTo.is(T2)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Vv).map(r=>new C3(r));for(let r of this.plugins)r.update(this);this.observer=new R6t(this),this.inputState=new e6t(this),this.inputState.ensureHandlers(this.plugins),this.docView=new oie(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 Qo?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(A3e))?(this.inputState.notifiedFocused=a,l=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,c=_3e(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(qi.phrases)!=this.state.facet(qi.phrases))return this.setState(s);r=kR.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:m}=h.state.selection,{x:g,y:b}=this.state.facet(Zt.cursorScrollMargin);f=new Ox(m.empty?m:dt.cursor(m.head,m.head>m.anchor?-1:1),"nearest","nearest",b,g)}for(let m of h.effects)m.is(T2)&&(f=m.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=AR.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(fk)!=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(I2)!=r.state.facet(I2)&&(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(gB))try{h(r)}catch(m){lc(this.state,m,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!w3e(this,d)&&u.force&&wx(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 vie(this,t),this.plugins=t.facet(Vv).map(i=>new C3(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new oie(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(Vv),i=t.state.facet(Vv);if(n!=i){let r=[];for(let s of i){let a=n.indexOf(s);if(a<0)r.push(new C3(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(GLe(i||this.win))s=-1,a=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(r);s=m.from,a=m.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(m=>{try{return m.read(this)}catch(g){return lc(this.state,g),Sie}}),f=kR.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 m=0;m1||g<-1)&&!(an.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(gB))l(n)}get themeClasses(){return OB+" "+(this.state.facet(wB)?I3e:R3e)+" "+this.state.facet(I2)}updateAttrs(){let t=Eie(this,h3e,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ih)?"true":"false",class:"cm-content",style:`${an.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),Eie(this,fH,n);let i=this.observer.ignore(()=>{let r=eie(this.contentDOM,this.contentAttrs,n),s=eie(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(fk);let t=this.state.facet(Zt.cspNonce);vg.mount(this.root,this.styleModules.concat(j6t).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 j3(this,t,aie(this,t,n,i))}moveByGroup(t,n){return j3(this,t,aie(this,t,n,i=>V4t(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 dt.cursor(s.side(n,r)+t.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(t,n,i=!0){return z4t(this,t,n,i)}moveVertically(t,n,i){return j3(this,t,H4t(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=vB(this,t,n);return i&&i.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),vB(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let i=this.state.doc.lineAt(t),r=this.bidiSpans(i),s=r[Tf.find(r,t-i.from,-1,n)];return this.docView.coordsAt(t,n,s.dir==qr.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(c3e)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>D6t)return t3e(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||e3e(s.isolates,i=iie(this,t))))return s.order;i||(i=iie(this,t));let r=g4t(t.text,n,i);return this.bidiCache.push(new AR(t.from,t.to,n,i,!0,r)),r}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||an.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{KLe(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 T2.of(new Ox(typeof t=="number"?dt.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 T2.of(new Ox(dt.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 ro.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return ro.define(()=>({}),{eventObservers:t})}static theme(t,n){let i=vg.newName(),r=[I2.of(i),fk.of(kB(`.${i}`,t))];return n&&n.dark&&r.push(wB.of(!0)),r}static baseTheme(t){return jp.lowest(fk.of(kB("."+OB,t,P3e)))}static findFromDOM(t){var n;let i=t.querySelector(".cm-content"),r=i&&io.get(i)||io.get(t);return((n=r==null?void 0:r.root)===null||n===void 0?void 0:n.view)||null}}Zt.styleModule=fk;Zt.inputHandler=a3e;Zt.clipboardInputFilter=uH;Zt.clipboardOutputFilter=dH;Zt.scrollHandler=d3e;Zt.focusChangeEffect=l3e;Zt.perLineTextDirection=c3e;Zt.exceptionSink=o3e;Zt.updateListener=gB;Zt.editable=Ih;Zt.mouseSelectionStyle=s3e;Zt.dragMovesSelection=r3e;Zt.clickAddsSelectionRange=i3e;Zt.decorations=RD;Zt.blockWrappers=p3e;Zt.outerDecorations=hH;Zt.atomicRanges=bT;Zt.bidiIsolatedRanges=m3e;Zt.cursorScrollMargin=un.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=g3e;Zt.darkTheme=wB;Zt.cspNonce=un.define({combine:e=>e.length?e[0]:""});Zt.contentAttributes=fH;Zt.editorAttributes=h3e;Zt.lineWrapping=Zt.contentAttributes.of({class:"cm-lineWrapping"});Zt.announce=Jn.define();const D6t=4096,Sie={};class AR{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:qr.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&&aH(a,n)}return n}const M6t=an.mac?"mac":an.windows?"win":an.linux?"linux":"key";function L6t(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 F6t(e,t,n){return M3e(D3e(e.state),t,e,n)}let xm=null;const B6t=4e3;function U6t(e,t=M6t){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 m=n[a]||(n[a]=Object.create(null)),g=l.split(/ (?!$)/).map(y=>L6t(y,t));for(let y=1;y{let O=xm={view:x,prefix:w,scope:a};return setTimeout(()=>{xm==O&&(xm=null)},B6t),!0}]})}let b=g.join(" ");r(b,!1);let v=m[b]||(m[b]={preventDefault:!1,stopPropagation:!1,run:((h=(f=m._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(m=>f(m,SB))}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 SB=null;function M3e(e,t,n,i){SB=t;let r=t4t(t),s=tc(r,0),a=yf(s)==r.length&&r!=" ",l="",c=!1,u=!1,d=!1;xm&&xm.view==n&&xm.scope==i&&(l=xm.prefix+" ",S3e.indexOf(t.keyCode)<0&&(u=!0,xm=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},m=e[i],g,b;return m&&(h(m[l+P2(r,t,!a)])?c=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(an.windows&&t.ctrlKey&&t.altKey)&&!(an.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(g=xg[t.keyCode])&&g!=r?(h(m[l+P2(g,t,!0)])||t.shiftKey&&(b=RE[t.keyCode])!=r&&b!=g&&h(m[l+P2(b,t,!1)]))&&(c=!0):a&&t.shiftKey&&h(m[l+P2(r,t,!0)])&&(c=!0),!c&&h(m._any)&&(c=!0)),u&&(c=!0),c&&d&&t.stopPropagation(),SB=null,c}class ay{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=L3e(t);return[new ay(n,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return Q6t(t,n,i)}}function L3e(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==qr.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function Tie(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 Q6t(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==qr.LTR,a=e.contentDOM,l=a.getBoundingClientRect(),c=L3e(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),m=yB(e,i,1),g=yB(e,r,-1),b=m.type==qa.Text?m:null,v=g.type==qa.Text?g:null;if(b&&(e.lineWrapping||m.widgetLineBreaks)&&(b=Tie(e,i,1,b)),v&&(e.lineWrapping||g.widgetLineBreaks)&&(v=Tie(e,r,-1,v)),b&&v&&b.from==v.from&&b.to==v.to)return w(x(n.from,n.to,b));{let S=b?x(n.from,null,b):O(m,!1),k=v?x(null,n.to,v):O(g,!0),C=[];return(b||m).to<(v||g).from-(b&&v?1:0)||m.widgetLineBreaks>1&&S.bottom+e.defaultLineHeight/2T&&_.from=D)break;M>I&&N(Math.max(B,I),S==null&&B<=T,Math.min(M,D),k==null&&M>=j,L.dir)}if(I=P.to+1,I>=D)break}return A.length==0&&N(T,S==null,j,k==null,e.textDirection),{top:E,bottom:R,horizontal:A}}function O(S,k){let C=l.top+(k?S.top:S.bottom);return{top:C,bottom:C,horizontal:[]}}}function z6t(e,t){return e.constructor==t.constructor&&e.eq(t)}class V6t{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(yj)!=t.state.facet(yj)&&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(yj);for(;n!z6t(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,an.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const yj=un.define();function $3e(e){return[ro.define(t=>new V6t(t,e)),yj.of(e)]}const Ow=un.define({combine(e){return Yf(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function H6t(e={}){return[Ow.of(e),q6t,W6t,K6t,u3e.of(!0)]}function F3e(e){return e.startState.facet(Ow)!=e.state.facet(Ow)}const q6t=$3e({above:!0,markers(e){let{state:t}=e,n=t.facet(Ow),i=[];for(let r of t.selection.ranges){let s=r==t.selection.main;if(r.empty||n.drawRangeCursor&&!(s&&an.ios&&n.iosSelectionHandles)){let a=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:dt.cursor(r.head,r.assoc);for(let c of ay.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=F3e(e);return n&&Aie(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){Aie(t.state,e)},class:"cm-cursorLayer"});function Aie(e,t){t.style.animationDuration=e.facet(Ow).cursorBlinkRate+"ms"}const W6t=$3e({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 ay.forRange(e,"cm-selectionBackground",r))t.push(s);if(an.ios&&!n.empty&&e.state.facet(Ow).iosSelectionHandles){for(let r of ay.forRange(e,"cm-selectionHandle cm-selectionHandle-start",dt.cursor(n.from,1)))t.push(r);for(let r of ay.forRange(e,"cm-selectionHandle cm-selectionHandle-end",dt.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||F3e(e)},class:"cm-selectionLayer"}),K6t=jp.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"}}}})),B3e=Jn.define({map(e,t){return e==null?null:t.mapPos(e)}}),pk=Ya.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,i)=>i.is(B3e)?i.value:n,e)}}),G6t=ro.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(pk);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(pk)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(pk),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(pk)!=e&&this.view.dispatch({effects:B3e.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 X6t(){return[pk,G6t]}function _ie(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 Y6t(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 Z6t{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 mp,i=n.add.bind(n);for(let{from:r,to:s}of Y6t(t,this.maxLength))_ie(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;(m=this.regexp.exec(c.text))&&m.indexthis.addMatch(v,t,b,g));n=n.update({filterFrom:d,filterTo:f,filter:(b,v)=>bf,add:h})}}return n}}const EB=/x/.unicode!=null?"gu":"g",J6t=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,EB),e$t={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 I3=null;function t$t(){var e;if(I3==null&&typeof document<"u"&&document.body){let t=document.body.style;I3=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return I3||!1}const vj=un.define({combine(e){let t=Yf(e,{render:null,specialChars:J6t,addSpecialChars:null});return(t.replaceTabs=!t$t())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,EB)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,EB)),t}});function n$t(e={}){return[vj.of(e),i$t()]}let jie=null;function i$t(){return jie||(jie=ro.fromClass(class{constructor(e){this.view=e,this.decorations=Tn.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(vj)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new Z6t({regexp:e.specialChars,decoration:(t,n,i)=>{let{doc:r}=n.state,s=tc(t[0],0);if(s==9){let a=r.lineAt(i),l=n.state.tabSize,c=$d(a.text,l,i-a.from);return Tn.replace({widget:new a$t((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=Tn.replace({widget:new o$t(e,s)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(vj);e.startState.facet(vj)!=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 r$t="•";function s$t(e){return e>=32?r$t:e==10?"␤":String.fromCharCode(9216+e)}class o$t extends Wd{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=s$t(this.code),i=t.state.phrase("Control character")+" "+(e$t[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 a$t extends Wd{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 l$t(){return u$t}const c$t=Tn.line({class:"cm-activeLine"}),u$t=ro.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(c$t.range(r.from)),t=r.from)}return Tn.set(n)}},{decorations:e=>e.decorations});class d$t extends Wd{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?dS(t.firstChild):[];if(!n.length)return null;let i=window.getComputedStyle(t.parentNode),r=DE(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 f$t(e){let t=ro.fromClass(class{constructor(n){this.view=n,this.placeholder=e?Tn.set([Tn.widget({widget:new d$t(e),side:1}).range(0)]):Tn.none}get decorations(){return this.view.state.doc.length?Tn.none:this.placeholder}},{decorations:n=>n.decorations});return typeof e=="string"?[t,Zt.contentAttributes.of({"aria-placeholder":e})]:t}const CB=2e3;function h$t(e,t,n){let i=Math.min(t.line,n.line),r=Math.max(t.line,n.line),s=[];if(t.off>CB||n.off>CB||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(dt.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=sB(u.text,a,e.tabSize,!0);if(d<0)s.push(dt.cursor(u.to));else{let f=sB(u.text,l,e.tabSize);s.push(dt.range(u.from+d,u.from+f))}}}return s}function p$t(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function Nie(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>CB?-1:r==i.length?p$t(e,t.clientX):$d(i.text,e.state.tabSize,n-i.from);return{line:i.number,col:s,off:r}}function m$t(e,t){let n=Nie(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=Nie(e,r);if(!l)return i;let c=h$t(e.state,n,l);return c.length?a?dt.create(c.concat(i.ranges)):dt.create(c):i}}:null}function g$t(e){let t=n=>n.altKey&&n.button==0;return Zt.mouseSelectionStyle.of((n,i)=>t(i)?m$t(n,i):null)}const b$t={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},y$t={style:"cursor: crosshair"};function v$t(e={}){let[t,n]=b$t[e.key||"Alt"],i=ro.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?y$t:null})]}const D2="-10000px";class U3e{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 x$t(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const P3=un.define({combine:e=>{var t,n,i;return{position:an.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)||x$t}}}),Rie=new WeakMap,yH=ro.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(P3);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 U3e(e,vH,(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(P3);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=D2,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(an.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=pH(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(P3).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=D2;continue}let m=c.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,g=m?7:0,b=h.right-h.left,v=(t=Rie.get(u))!==null&&t!==void 0?t:h.bottom-h.top,y=u.offset||O$t,w=this.view.textDirection==qr.LTR,x=h.width>i.right-i.left?w?i.left:i.right-h.width:w?Math.max(i.left,Math.min(f.left-(m?14:0)+y.x,i.right-b)):Math.min(Math.max(i.left,f.left-b+(m?14:0)-y.x),i.right-b),O=this.above[l];!c.strictSide&&(O?f.top-v-g-y.yi.bottom)&&O==i.bottom-f.bottom>f.top-i.top&&(O=this.above[l]=!O);let S=(O?f.top-i.top:i.bottom-f.bottom)-g;if(Sx&&E.topk&&(k=O?E.top-v-2-g:E.bottom+g+2);if(this.position=="absolute"?(d.style.top=(k-e.parent.top)/s+"px",Iie(d,(x-e.parent.left)/r)):(d.style.top=k/s+"px",Iie(d,x/r)),m){let E=f.left+(w?y.x:-y.x)-(x+14-7);m.style.left=E/r+"px"}u.overlap!==!0&&a.push({left:x,top:k,right:C,bottom:k+v}),d.classList.toggle("cm-tooltip-above",O),d.classList.toggle("cm-tooltip-below",!O),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=D2}},{eventObservers:{scroll(){this.maybeMeasure()}}});function Iie(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const w$t=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"}}}),O$t={x:0,y:0},vH=un.define({enables:[yH,w$t]}),_R=un.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class MD{static create(t){return new MD(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new U3e(t,_R,(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 k$t=vH.compute([_R],e=>{let t=e.facet(_R);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:MD.create,above:t[0].above,arrow:t.some(n=>n.arrow)}}),Q3e=un.define();class S$t{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==qr.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=>lc(t.state,c,"hover tooltip"))}else a(s)}get tooltip(){let t=this.view.plugin(yH),n=t?t.manager.tooltips.findIndex(i=>i.create==MD.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&&!E$t(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:!C$t(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 M2=4;function E$t(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-M2&&t.clientX<=i+M2&&t.clientY>=r-M2&&t.clientY<=s+M2}function C$t(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 T$t(e,t={}){let n=Jn.define(),i=new WeakMap,r=Ya.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,Qa.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(_$t)&&!u.value||u.value==r)&&(a=[]);return a.length&&c&&i.set(a,c),a},provide:a=>_R.from(a)});const s=ro.define(a=>new S$t(a,e,r,i,n,t.hoverTime||300));return{active:r,extension:[r,s,Q3e.of(s),k$t]}}function A$t(e,t,n,i={}){var r;let s=e.state.facet(Q3e).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 z3e(e,t){let n=e.plugin(yH);if(!n)return null;let i=n.manager.tooltips.indexOf(t);return i<0?null:n.manager.tooltipViews[i]}const _$t=Jn.define(),Pie=un.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 xH(e,t){let n=e.plugin(V3e),i=n?n.specs.indexOf(t):-1;return i>-1?n.panels[i]:null}const V3e=ro.fromClass(class{constructor(e){this.input=e.state.facet(LE),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(Pie);this.top=new L2(e,!0,t.topContainer),this.bottom=new L2(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(Pie);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new L2(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new L2(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(LE);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 L2{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=Die(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=Die(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 Die(e){let t=e.nextSibling;return e.remove(),t}const LE=un.define({enables:V3e});function j$t(e,t){let n,i=new Promise(a=>n=a),r=a=>N$t(a,t,n);e.state.field(D3,!1)?e.dispatch({effects:H3e.of(r)}):e.dispatch({effects:Jn.appendConfig.of(D3.init(()=>[r]))});let s=q3e.of(r);return{close:s,result:i.then(a=>((e.win.queueMicrotask||(c=>e.win.setTimeout(c,10)))(()=>{e.state.field(D3).indexOf(r)>-1&&e.dispatch({effects:s})}),a))}}const D3=Ya.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(H3e)?e=[n.value].concat(e):n.is(q3e)&&(e=e.filter(i=>i!=n.value));return e},provide:e=>LE.computeN([e],t=>t.field(e))}),H3e=Jn.define(),q3e=Jn.define();function N$t(e,t,n){let i=t.content?t.content(e,()=>a(null)):null;if(!i){if(i=Mr("form"),t.input){let l=Mr("input",t.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),i.appendChild(Mr("label",(t.label||"")+": ",l))}else i.appendChild(document.createTextNode(t.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(Mr("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=Mr("div",i,Mr("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 bp extends yg{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}bp.prototype.elementClass="";bp.prototype.toDOM=void 0;bp.prototype.mapMode=Qa.TrackBefore;bp.prototype.startSide=bp.prototype.endSide=-1;bp.prototype.point=!0;const xj=un.define(),R$t=un.define(),I$t={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>$i.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},pS=un.define();function P$t(e){return[W3e(),pS.of({...I$t,...e})]}const Mie=un.define({combine:e=>e.some(t=>t)});function W3e(e){return[D$t]}const D$t=ro.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(pS).map(t=>new $ie(e,t)),this.fixed=!e.state.facet(Mie);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(Mie)!=!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=$i.iter(this.view.state.facet(xj),this.view.viewport.from),i=[],r=this.gutters.map(s=>new M$t(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==qa.Text&&a){TB(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==qa.Text){TB(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(pS),n=e.state.facet(pS),i=e.docChanged||e.heightChanged||e.viewportChanged||!$i.eq(e.startState.facet(xj),e.state.facet(xj),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 $ie(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==qr.LTR?{left:i,right:r}:{right:i,left:r}})});function Lie(e){return Array.isArray(e)?e:[e]}function TB(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class M$t{constructor(t,n,i){this.gutter=t,this.height=i,this.i=0,this.cursor=$i.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 K3e(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=[];TB(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(R$t)){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 $ie{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=Lie(n.markers(t)),n.initialSpacer&&(this.spacer=new K3e(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=Lie(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!$i.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 K3e{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":""),L$t(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 M3 extends bp{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function L3(e,t){return e.state.facet(Hv).formatNumber(t,e.state)}const B$t=pS.compute([Hv],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet($$t)},lineMarker(t,n,i){return i.some(r=>r.toDOM)?null:new M3(L3(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,i)=>{for(let r of t.state.facet(F$t)){let s=r(t,n,i);if(s)return s}return null},lineMarkerChange:t=>t.startState.facet(Hv)!=t.state.facet(Hv),initialSpacer(t){return new M3(L3(t,Fie(t.state.doc.lines)))},updateSpacer(t,n){let i=L3(n.view,Fie(n.view.state.doc.lines));return i==t.number?t:new M3(i)},domEventHandlers:e.facet(Hv).domEventHandlers,side:"before"}));function G3e(e={}){return[Hv.of(e),W3e(),B$t]}function Fie(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(U$t.range(r)))}return $i.of(t)});function z$t(){return Q$t}let V$t=0,mf=class AB{constructor(t,n,i,r){this.name=t,this.set=n,this.base=i,this.modified=r,this.id=V$t++}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 AB&&(n=t),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let r=new AB(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 jR(t);return i=>i.modified.indexOf(n)>-1?i:jR.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}},H$t=0;class jR{constructor(t){this.name=t,this.instances=[],this.id=H$t++}static get(t,n){if(!n.length)return t;let i=n[0].instances.find(l=>l.base==t&&q$t(n,l.modified));if(i)return i;let r=[],s=new mf(t.name,r,t,n);for(let l of n)l.instances.push(s);let a=W$t(n);for(let l of t.set)if(!l.modified.length)for(let c of a)r.push(jR.get(l,c));return s}}function q$t(e,t){return e.length==t.length&&e.every((n,i)=>n==t[i])}function W$t(e){let t=[[]];for(let n=0;ni.length-n.length)}function Np(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 m=r[f++];if(f==r.length&&m=="!"){a=0;break}if(m!="/")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 $E(i,a,c>0?s.slice(0,c):null);t[u]=d.sort(t[u])}}return X3e.add(t)}const X3e=new Xn({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 $E(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}});let $E=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 K$t(e,t){let n=null;for(let i of e){let r=i.style(t);r&&(n=n?n+" "+r:r)}return n}function G$t(e,t,n,i=0,r=e.length){let s=new X$t(i,Array.isArray(t)?t:[t],n);s.highlightRange(e.cursor(),i,r,"",s.highlighters),s.flush(r)}class X$t{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(m=>!m.scope||m.scope(a)));let u=r,d=Y$t(t)||$E.empty,f=K$t(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(Xn.mounted);if(h&&h.overlay){let m=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 w=v=x||!t.nextSibling())););if(!w||x>i)break;y=w.to+l,y>n&&(this.highlightRange(m.cursor(),Math.max(n,w.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 Y$t(e){let t=e.type.prop(X3e);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const sn=mf.define,$2=sn(),dm=sn(),Bie=sn(dm),Uie=sn(dm),fm=sn(),F2=sn(fm),$3=sn(fm),df=sn(),lb=sn(df),af=sn(),lf=sn(),_B=sn(),SO=sn(_B),B2=sn(),se={comment:$2,lineComment:sn($2),blockComment:sn($2),docComment:sn($2),name:dm,variableName:sn(dm),typeName:Bie,tagName:sn(Bie),propertyName:Uie,attributeName:sn(Uie),className:sn(dm),labelName:sn(dm),namespace:sn(dm),macroName:sn(dm),literal:fm,string:F2,docString:sn(F2),character:sn(F2),attributeValue:sn(F2),number:$3,integer:sn($3),float:sn($3),bool:sn(fm),regexp:sn(fm),escape:sn(fm),color:sn(fm),url:sn(fm),keyword:af,self:sn(af),null:sn(af),atom:sn(af),unit:sn(af),modifier:sn(af),operatorKeyword:sn(af),controlKeyword:sn(af),definitionKeyword:sn(af),moduleKeyword:sn(af),operator:lf,derefOperator:sn(lf),arithmeticOperator:sn(lf),logicOperator:sn(lf),bitwiseOperator:sn(lf),compareOperator:sn(lf),updateOperator:sn(lf),definitionOperator:sn(lf),typeOperator:sn(lf),controlOperator:sn(lf),punctuation:_B,separator:sn(_B),bracket:SO,angleBracket:sn(SO),squareBracket:sn(SO),paren:sn(SO),brace:sn(SO),content:df,heading:lb,heading1:sn(lb),heading2:sn(lb),heading3:sn(lb),heading4:sn(lb),heading5:sn(lb),heading6:sn(lb),contentSeparator:sn(df),list:sn(df),quote:sn(df),emphasis:sn(df),strong:sn(df),link:sn(df),monospace:sn(df),strikethrough:sn(df),inserted:sn(),deleted:sn(),changed:sn(),invalid:sn(),meta:B2,documentMeta:sn(B2),annotation:sn(B2),processingInstruction:sn(B2),definition:mf.defineModifier("definition"),constant:mf.defineModifier("constant"),function:mf.defineModifier("function"),standard:mf.defineModifier("standard"),local:mf.defineModifier("local"),special:mf.defineModifier("special")};for(let e in se){let t=se[e];t instanceof mf&&(t.name=e)}Y3e([{tag:se.link,class:"tok-link"},{tag:se.heading,class:"tok-heading"},{tag:se.emphasis,class:"tok-emphasis"},{tag:se.strong,class:"tok-strong"},{tag:se.keyword,class:"tok-keyword"},{tag:se.atom,class:"tok-atom"},{tag:se.bool,class:"tok-bool"},{tag:se.url,class:"tok-url"},{tag:se.labelName,class:"tok-labelName"},{tag:se.inserted,class:"tok-inserted"},{tag:se.deleted,class:"tok-deleted"},{tag:se.literal,class:"tok-literal"},{tag:se.string,class:"tok-string"},{tag:se.number,class:"tok-number"},{tag:[se.regexp,se.escape,se.special(se.string)],class:"tok-string2"},{tag:se.variableName,class:"tok-variableName"},{tag:se.local(se.variableName),class:"tok-variableName tok-local"},{tag:se.definition(se.variableName),class:"tok-variableName tok-definition"},{tag:se.special(se.variableName),class:"tok-variableName2"},{tag:se.definition(se.propertyName),class:"tok-propertyName tok-definition"},{tag:se.typeName,class:"tok-typeName"},{tag:se.namespace,class:"tok-namespace"},{tag:se.className,class:"tok-className"},{tag:se.macroName,class:"tok-macroName"},{tag:se.propertyName,class:"tok-propertyName"},{tag:se.operator,class:"tok-operator"},{tag:se.comment,class:"tok-comment"},{tag:se.meta,class:"tok-meta"},{tag:se.invalid,class:"tok-invalid"},{tag:se.punctuation,class:"tok-punctuation"}]);var F3;const Rm=new Xn;function LD(e){return un.define({combine:e?t=>t.concat(e):void 0})}const wH=new Xn;class Gc{constructor(t,n,i=[],r=""){this.data=t,this.name=r,qi.prototype.hasOwnProperty("tree")||Object.defineProperty(qi.prototype,"tree",{get(){return Br(this)}}),this.parser=n,this.extension=[Og.of(this),qi.languageData.of((s,a,l)=>{let c=Qie(s,a,l),u=c.type.prop(Rm);if(!u)return[];let d=s.facet(u),f=c.type.prop(wH);if(f){let h=c.resolve(a-c.from,l);for(let m of f)if(m.test(h,s)){let g=s.facet(m.facet);return m.type=="replace"?g:g.concat(d)}}return d})].concat(i)}isActiveAt(t,n,i=-1){return Qie(t,n,i).type.prop(Rm)==this.data}findRegions(t){let n=t.facet(Og);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(Rm)==this.data){i.push({from:a,to:a+s.length});return}let l=s.prop(Xn.mounted);if(l){if(l.tree.prop(Rm)==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 yp(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Br(e){let t=e.field(Gc.state,!1);return t?t.tree:_i.empty}class Z$t{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 EO=null;class Dy{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 Dy(t,n,[],_i.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Z$t(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=_i.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(Jh.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=EO;EO=this;try{return t()}finally{EO=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=zie(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=Jh.applyChanges(i,c),r=_i.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=zie(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 _D{createParse(n,i,r){let s=r[0].from,a=r[r.length-1].to;return{parsedPos:s,advance(){let c=EO;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 _i(Vo.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 EO}}function zie(e,t,n){return Jh.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class kw{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 kw(n)}static init(t){let n=Math.min(3e3,t.doc.length),i=Dy.create(t.facet(Og).parser,t,{from:0,to:n});return i.work(20,n)||i.takeTree(),new kw(i)}}Gc.state=Ya.define({create:kw.init,update(e,t){for(let n of t.effects)if(n.is(Gc.setState))return n.value;return t.startState.facet(Og)!=t.state.facet(Og)?kw.init(t.state):e.apply(t)}});let Z3e=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(Z3e=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const B3=typeof navigator<"u"&&(!((F3=navigator.scheduling)===null||F3===void 0)&&F3.isInputPending)?()=>navigator.scheduling.isInputPending():null,J$t=ro.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(Gc.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(Gc.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=Z3e(this.work))}work(t){this.working=null;let n=Date.now();if(this.chunkEndr+1e3,c=s.context.work(()=>B3&&B3()||Date.now()>a,r+(l?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Gc.setState.of(new kw(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=>lc(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()}}}),Og=un.define({combine(e){return e.length?e[0]:null},enables:e=>[Gc.state,J$t,Zt.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class kg{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}class NR{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 NR(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 eFt=un.define(),g1=un.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 My(e){let t=e.facet(g1);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function FE(e,t){let n="",i=e.tabSize,r=e.facet(g1)[0];if(r==" "){for(;t>=i;)n+=" ",t-=i;r=" "}for(let s=0;s=t?tFt(e,n,t):null}class $D{constructor(t,n={}){this.state=t,this.options=n,this.unit=My(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 $d(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 Rp=new Xn;function tFt(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 J3e(i,e,n)}function J3e(e,t,n){for(let i=e;i;i=i.next){let r=iFt(i.node);if(r)return r(kH.create(t,n,i))}return 0}function nFt(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function iFt(e){let t=e.type.prop(Rp);if(t)return t;let n=e.firstChild,i;if(n&&(i=n.type.prop(Xn.closedBy))){let r=e.lastChild,s=r&&i.indexOf(r.name)>-1;return a=>e4e(a,!0,1,void 0,s&&!nFt(a)?r.from:void 0)}return e.parent==null?rFt:null}function rFt(){return 0}class kH extends $D{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 kH(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(sFt(i,t))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return J3e(this.context.next,this.base,this.pos)}}function sFt(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function oFt(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 kx({closing:e,align:t=!0,units:n=1}){return i=>e4e(i,t,n,e)}function e4e(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?oFt(e):null;return c?l?e.column(c.from):e.column(c.to):e.baseIndent+(l?0:e.unit*n)}const aFt=e=>e.baseIndent;function Sx({except:e,units:t=1}={}){return n=>{let i=e&&e.test(n.textAfter);return n.baseIndent+(i?0:t*n.unit)}}const lFt=200;function cFt(){return qi.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+lFt)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=OH(a,d.from);if(f==null)continue;let h=/^\s*/.exec(d.text)[0],m=FE(a,f);h!=m&&c.push({from:d.from,to:d.from+h.length,insert:m})}return c.length?[e,{changes:c,sequential:!0}]:e})}const t4e=un.define(),Ip=new Xn;function yT(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 dFt(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function RR(e,t,n){for(let i of e.facet(t4e)){let r=i(e,t,n);if(r)return r}return uFt(e,t,n)}function n4e(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 FD=Jn.define({map:n4e}),vT=Jn.define({map:n4e});function i4e(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 Ly=Ya.define({create(){return Tn.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((i,r)=>e=Vie(e,i,r)),e=e.map(t.changes);let n=[];for(let i of t.effects)i.is(FD)&&!fFt(e,i.value.from,i.value.to)?n.push(i.value):i.is(vT)&&(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(o4e),r=n.map(s=>(i?Tn.replace({widget:new vFt(i(t.state,s))}):Hie).range(s.from,s.to));e=e.update({add:r})}return t.selection&&(e=Vie(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 IR(e,t,n){var i;let r=null;return(i=e.field(Ly,!1))===null||i===void 0||i.between(t,n,(s,a)=>{(!r||r.from>s)&&(r={from:s,to:a})}),r}function fFt(e,t,n){let i=!1;return e.between(t,t,(r,s)=>{r==t&&s==n&&(i=!0)}),i}function r4e(e,t){return e.field(Ly,!1)?t:t.concat(Jn.appendConfig.of(a4e()))}const hFt=e=>{for(let t of i4e(e)){let n=RR(e.state,t.from,t.to);if(n)return e.dispatch({effects:r4e(e.state,[FD.of(n),s4e(e,n)])}),!0}return!1},pFt=e=>{if(!e.state.field(Ly,!1))return!1;let t=[];for(let n of i4e(e)){let i=IR(e.state,n.from,n.to);i&&t.push(vT.of(i),s4e(e,i,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function s4e(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 mFt=e=>{let{state:t}=e,n=[];for(let i=0;i{let t=e.state.field(Ly,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(i,r)=>{n.push(vT.of({from:i,to:r}))}),e.dispatch({effects:n}),!0},bFt=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:hFt},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:pFt},{key:"Ctrl-Alt-[",run:mFt},{key:"Ctrl-Alt-]",run:gFt}],yFt={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},o4e=un.define({combine(e){return Yf(e,yFt)}});function a4e(e){return[Ly,OFt]}function l4e(e,t){let{state:n}=e,i=n.facet(o4e),r=a=>{let l=e.lineBlockAt(e.posAtDOM(a.target)),c=IR(e.state,l.from,l.to);c&&e.dispatch({effects:vT.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 Hie=Tn.replace({widget:new class extends Wd{toDOM(e){return l4e(e,null)}}});class vFt extends Wd{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return l4e(t,this.value)}}const xFt={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class U3 extends bp{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 wFt(e={}){let t={...xFt,...e},n=new U3(t,!0),i=new U3(t,!1),r=ro.fromClass(class{constructor(a){this.from=a.viewport.from,this.markers=this.buildMarkers(a)}update(a){(a.docChanged||a.viewportChanged||a.startState.facet(Og)!=a.state.facet(Og)||a.startState.field(Ly,!1)!=a.state.field(Ly,!1)||Br(a.startState)!=Br(a.state)||t.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let l=new mp;for(let c of a.viewportLineBlocks){let u=IR(a.state,c.from,c.to)?i:RR(a.state,c.from,c.to)?n:null;u&&l.add(c.from,c.from,u)}return l.finish()}}),{domEventHandlers:s}=t;return[r,P$t({class:"cm-foldGutter",markers(a){var l;return((l=a.plugin(r))===null||l===void 0?void 0:l.markers)||$i.empty},initialSpacer(){return new U3(t,!1)},domEventHandlers:{...s,click:(a,l,c)=>{if(s.click&&s.click(a,l,c))return!0;let u=IR(a.state,l.from,l.to);if(u)return a.dispatch({effects:vT.of(u)}),!0;let d=RR(a.state,l.from,l.to);return d?(a.dispatch({effects:FD.of(d)}),!0):!1}}}),a4e()]}const OFt=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 xT{constructor(t,n){this.specs=t;let i;function r(l){let c=vg.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 Gc?l=>l.prop(Rm)==a.data:a?l=>l==a:void 0,this.style=Y3e(t.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new vg(i):null,this.themeType=n.themeType}static define(t,n){return new xT(t,n||{})}}const jB=un.define(),c4e=un.define({combine(e){return e.length?[e[0]]:null}});function wj(e){let t=e.facet(jB);return t.length?t:e.facet(c4e)}function u4e(e,t){let n=[SFt],i;return e instanceof xT&&(e.module&&n.push(Zt.styleModule.of(e.module)),i=e.themeType),t!=null&&t.fallback?n.push(c4e.of(e)):i?n.push(jB.computeN([Zt.darkTheme],r=>r.facet(Zt.darkTheme)==(i=="dark")?[e]:[])):n.push(jB.of(e)),n}function Hcn(e,t,n){let i=wj(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 kFt{constructor(t){this.markCache=Object.create(null),this.tree=Br(t.state),this.decorations=this.buildDeco(t,wj(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=Br(t.state),i=wj(t.state),r=i!=wj(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 Tn.none;let i=new mp;for(let{from:r,to:s}of t.visibleRanges)G$t(this.tree,n,(a,l,c)=>{i.add(a,l,this.markCache[c]||(this.markCache[c]=Tn.mark({class:c})))},r,s);return i.finish()}}const SFt=jp.high(ro.fromClass(kFt,{decorations:e=>e.decorations})),EFt=xT.define([{tag:se.meta,color:"#404740"},{tag:se.link,textDecoration:"underline"},{tag:se.heading,textDecoration:"underline",fontWeight:"bold"},{tag:se.emphasis,fontStyle:"italic"},{tag:se.strong,fontWeight:"bold"},{tag:se.strikethrough,textDecoration:"line-through"},{tag:se.keyword,color:"#708"},{tag:[se.atom,se.bool,se.url,se.contentSeparator,se.labelName],color:"#219"},{tag:[se.literal,se.inserted],color:"#164"},{tag:[se.string,se.deleted],color:"#a11"},{tag:[se.regexp,se.escape,se.special(se.string)],color:"#e40"},{tag:se.definition(se.variableName),color:"#00f"},{tag:se.local(se.variableName),color:"#30a"},{tag:[se.typeName,se.namespace],color:"#085"},{tag:se.className,color:"#167"},{tag:[se.special(se.variableName),se.macroName],color:"#256"},{tag:se.definition(se.propertyName),color:"#00c"},{tag:se.comment,color:"#940"},{tag:se.invalid,color:"#f00"}]),CFt=Zt.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),d4e=1e4,f4e="()[]{}",h4e=un.define({combine(e){return Yf(e,{afterCursor:!0,brackets:f4e,maxScanDistance:d4e,renderMatch:_Ft})}}),TFt=Tn.mark({class:"cm-matchingBracket"}),AFt=Tn.mark({class:"cm-nonmatchingBracket"});function _Ft(e){let t=[],n=e.matched?TFt:AFt;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 qie(e){let t=[],n=e.facet(h4e);for(let i of e.selection.ranges){if(!i.empty)continue;let r=Af(e,i.head,-1,n)||i.head>0&&Af(e,i.head-1,1,n)||n.afterCursor&&(Af(e,i.head,1,n)||i.heade.decorations}),NFt=[jFt,CFt];function RFt(e={}){return[h4e.of(e),NFt]}const p4e=new Xn;function NB(e,t,n){let i=e.prop(t<0?Xn.openedBy:Xn.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 RB(e){let t=e.type.prop(p4e);return t?t(e.node):e}function Af(e,t,n,i={}){let r=i.maxScanDistance||d4e,s=i.brackets||f4e,a=Br(e),l=a.resolveInner(t,n);for(let c=l;c;c=c.parent){let u=NB(c.type,n,s);if(u&&c.from0?t>=d.from&&td.from&&t<=d.to))return IFt(e,t,n,c,d,u,s)}}return PFt(e,t,n,a,l.type,r,s)}function IFt(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 m=d.value;n<0&&(h+=m.length);let g=t+h*n;for(let b=n>0?0:m.length-1,v=n>0?m.length:-1;b!=v;b+=n){let y=a.indexOf(m[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+=m.length)}return d.done?{start:u,matched:!1}:null}function Wie(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 DFt(e){return{name:e.name||"",token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||MFt,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||CH,mergeTokens:e.mergeTokens!==!1}}function MFt(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 Kie=new WeakMap;class SH extends Gc{constructor(t){let n=LD(t.languageData),i=DFt(t),r,s=new class extends _D{createParse(a,l,c){return new $Ft(r,a,l,c)}};super(n,s,[],t.name),this.topNode=UFt(n,this),r=this,this.streamParser=i,this.stateAfter=new Xn({perNode:!0}),this.tokenTable=t.tokenTable?new v4e(i.tokenTable):BFt}static define(t){return new SH(t)}getIndent(t){let n,{overrideIndentation:i}=t.options;i&&(n=Kie.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 _i&&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&&EH(e,s.tree,0-s.offset,n,l),u;if(c&&c.pos<=i&&(u=g4e(e,s.tree,n+s.offset,c.pos+s.offset,!1)))return{state:c.state,tree:u}}return{state:e.streamParser.startState(r?My(r):4),tree:_i.empty}}let $Ft=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=Dy.get(),a=r[0].from,{state:l,tree:c}=LFt(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(My(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let t=Dy.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 l4e(n,t?t.state.tabSize:4,t?Dy(t.state):2);if(a.eol())s.blankLine(this.state,a.indentUnit);else for(;!a.eol();){let l=u4e(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 CH=Object.create(null),BE=[$o.none],RFt=new p1(BE),Gie=[],Xie=Object.create(null),d4e=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"]])d4e[e]=h4e(CH,t);class f4e{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),d4e)}resolve(t){return t?this.table[t]||(this.table[t]=h4e(this.extra,t)):0}}const IFt=new f4e(CH);function U3(e,t){Gie.indexOf(e)>-1||(Gie.push(e),console.warn(t))}function h4e(e,t){let n=[];for(let l of t.split(" ")){let c=[];for(let u of l.split(".")){let d=e[u]||re[u];d?typeof d=="function"?c.length?c=c.map(d):U3(u,`Modifier ${u} used at start of tag`):c.length?U3(u,`Tag ${u} used as modifier`):c=Array.isArray(d)?d:[d]:U3(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=Xie[r];if(s)return s.id;let a=Xie[r]=$o.define({id:BE.length,name:i,props:[jp({[i]:n})]});return BE.push(a),a.id}function PFt(e,t){let n=$o.define({id:BE.length,name:"Document",props:[Nm.add(()=>e),Np.add(()=>i=>t.getIndent(i))],top:!0});return BE.push(n),n}qr.RTL,qr.LTR;var Yie={};class IR{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 IR(t,[],n,i,i,0,[],0,r?new Zie(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 IR(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 DFt(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 Zie{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class DFt{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 PR{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 PR(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 PR(this.stack,this.pos,this.index)}}function pk(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 kj{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Jie=new kj;class MFt{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Jie,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=Jie,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 Ex{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:i}=n.p;p4e(this.data,t,n,this.id,i.data,i.tokenPrecTable)}}Ex.prototype.contextual=Ex.prototype.fallback=Ex.prototype.extend=!1;class DR{constructor(t,n,i){this.precTable=n,this.elseToken=i,this.data=typeof t=="string"?pk(t):t}token(t,n){let i=t.pos,r=0;for(;;){let s=t.next<0,a=t.resolveOffset(1,1);if(p4e(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))}}DR.prototype.contextual=Ex.prototype.fallback=Ex.prototype.extend=!1;class ko{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function p4e(e,t,n,i,r,s){let a=0,l=1<0){let g=e[m];if(c.allows(g)&&(t.token.value==-1||t.token.value==g||LFt(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+m+(m<<1),b=e[g],v=e[g+1]||65536;if(d=v)f=m+1;else{a=e[g+2],t.advance();continue e}}break}}function ere(e,t,n){for(let i=t,r;(r=e[i])!=65535;i++)if(r==n)return i-t;return-1}function LFt(e,t,n,i){let r=ere(n,i,t);return r<0||ere(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 $Ft=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?tre(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?tre(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 Ci){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 FFt{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(i=>new kj)}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 kj,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 kj,{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 $Ft(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&&QFt(r);if(a)return Nc&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw Nc&&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 Nc&&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(qn.contextHash)||0)==d))return t.useNode(f,h),Nc&&console.log(a+this.stackID(t)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof Ci)||f.children.length==0||f.positions[0]>0)break;let m=f.children[0];if(m instanceof Ci&&f.positions[0]==0)f=m;else break}}let l=s.stateSlot(t.state,4);if(l>0)return t.reduce(l),Nc&&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 nre(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(),Nc&&console.log(d+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let f=l.split(),h=d;for(let m=0;m<10&&f.forceReduce()&&(Nc&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));m++)Nc&&(h=this.stackID(f)+" -> ");for(let m of l.recoverByInsert(c))Nc&&console.log(d+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,i);this.stream.end>l.pos?(u==l.pos&&(u++,c=0),l.recoverByDelete(c,u),Nc&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),nre(l,i)):(!r||r.scoree;class FD{constructor(t){this.start=t.start,this.shift=t.shift||z3,this.reduce=t.reduce||z3,this.reuse=t.reuse||z3,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class vp extends AD{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 p1(n.map((l,c)=>$o.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=fLe;let a=pk(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 Ex(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 BFt(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=Th(this.data,s+2);else break;r=n(Th(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=Th(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(vp.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]=ire(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 zFt=316,VFt=317,rre=1,HFt=2,qFt=3,WFt=4,KFt=318,GFt=320,XFt=321,YFt=5,ZFt=6,JFt=0,IB=[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],m4e=125,e8t=59,PB=47,t8t=42,n8t=43,i8t=45,r8t=60,s8t=44,o8t=63,a8t=46,l8t=91,c8t=new FD({start:!1,shift(e,t){return t==YFt||t==ZFt||t==GFt?e:t==XFt},strict:!1}),u8t=new ko((e,t)=>{let{next:n}=e;(n==m4e||n==-1||t.context)&&e.acceptToken(KFt)},{contextual:!0,fallback:!0}),d8t=new ko((e,t)=>{let{next:n}=e,i;IB.indexOf(n)>-1||n==PB&&((i=e.peek(1))==PB||i==t8t)||n!=m4e&&n!=e8t&&n!=-1&&!t.context&&e.acceptToken(zFt)},{contextual:!0}),f8t=new ko((e,t)=>{e.next==l8t&&!t.context&&e.acceptToken(VFt)},{contextual:!0}),h8t=new ko((e,t)=>{let{next:n}=e;if(n==n8t||n==i8t){if(e.advance(),n==e.next){e.advance();let i=!t.context&&t.canShift(rre);e.acceptToken(i?rre:HFt)}}else n==o8t&&e.peek(1)==a8t&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(qFt))},{contextual:!0});function V3(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}const p8t=new ko((e,t)=>{if(e.next!=r8t||!t.dialectEnabled(JFt)||(e.advance(),e.next==PB))return;let n=0;for(;IB.indexOf(e.next)>-1;)e.advance(),n++;if(V3(e.next,!0)){for(e.advance(),n++;V3(e.next,!1);)e.advance(),n++;for(;IB.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==s8t)return;for(let i=0;;i++){if(i==7){if(!V3(e.next,!0))return;break}if(e.next!="extends".charCodeAt(i))break;e.advance(),n++}}e.acceptToken(WFt,-n)}),m8t=jp({"get set async static":re.modifier,"for while do if else switch try catch finally return throw break continue default case defer":re.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":re.operatorKeyword,"let var const using function class extends":re.definitionKeyword,"import export from":re.moduleKeyword,"with debugger new":re.keyword,TemplateString:re.special(re.string),super:re.atom,BooleanLiteral:re.bool,this:re.self,null:re.null,Star:re.modifier,VariableName:re.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":re.function(re.variableName),VariableDefinition:re.definition(re.variableName),Label:re.labelName,PropertyName:re.propertyName,PrivatePropertyName:re.special(re.propertyName),"CallExpression/MemberExpression/PropertyName":re.function(re.propertyName),"FunctionDeclaration/VariableDefinition":re.function(re.definition(re.variableName)),"ClassDeclaration/VariableDefinition":re.definition(re.className),"NewExpression/VariableName":re.className,PropertyDefinition:re.definition(re.propertyName),PrivatePropertyDefinition:re.definition(re.special(re.propertyName)),UpdateOp:re.updateOperator,"LineComment Hashbang":re.lineComment,BlockComment:re.blockComment,Number:re.number,String:re.string,Escape:re.escape,ArithOp:re.arithmeticOperator,LogicOp:re.logicOperator,BitOp:re.bitwiseOperator,CompareOp:re.compareOperator,RegExp:re.regexp,Equals:re.definitionOperator,Arrow:re.function(re.punctuation),": Spread":re.punctuation,"( )":re.paren,"[ ]":re.squareBracket,"{ }":re.brace,"InterpolationStart InterpolationEnd":re.special(re.brace),".":re.derefOperator,", ;":re.separator,"@":re.meta,TypeName:re.typeName,TypeDefinition:re.definition(re.typeName),"type enum interface implements namespace module declare":re.definitionKeyword,"abstract global Privacy readonly override":re.modifier,"is keyof unique infer asserts":re.operatorKeyword,JSXAttributeValue:re.attributeValue,JSXText:re.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":re.angleBracket,"JSXIdentifier JSXNameSpacedName":re.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":re.attributeName,"JSXBuiltin/JSXIdentifier":re.standard(re.tagName)}),g8t={__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},b8t={__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},y8t={__proto__:null,"<":193},v8t=vp.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:c8t,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:[m8t],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:[d8t,f8t,h8t,p8t,2,3,4,5,6,7,8,9,10,11,12,13,14,u8t,new DR("$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 DR("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=>g8t[e]||-1},{term:343,get:e=>b8t[e]||-1},{term:95,get:e=>y8t[e]||-1}],tokenPrec:15201});class TH{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=Br(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(b4e(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 sre(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 x8t(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+$/]:x8t(t);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:t,validFor:n}:null}}function g4e(e,t){return n=>{for(let i=Br(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 ore{constructor(t,n,i,r){this.completion=t,this.source=n,this.match=i,this.score=r}}function ay(e){return e.selection.main.from}function b4e(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 _H=Xf.define();function w8t(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:dt.cursor(l.from+s+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const are=new WeakMap;function O8t(e){if(!Array.isArray(e))return e;let t=are.get(e);return t||are.set(e,t=AH(e)),t}const MR=Jn.define(),UE=Jn.define();class k8t{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&&S<=57||S>=97&&S<=122?2:S>=65&&S<=90?1:0:(k=nH(S))!=k.toLowerCase()?1:k!=k.toUpperCase()?2:0;(!w||C==1&&v||O==0&&C!=0)&&(n[f]==S||i[f]==S&&(h=!0)?a[f++]=w:a.length&&(y=!1)),O=C,w+=bf(S)}return f==c&&a[0]==0&&y?this.result(-100+(h?-200:0),a,t):m==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]):m==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?bf(ec(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 S8t{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:E8t,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=>lre(t(i),n(i)),optionClass:(t,n)=>i=>lre(t(i),n(i)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function lre(e,t){return e?t?e+" "+t:e:t}function E8t(e,t,n,i,r,s){let a=e.textDirection==qr.RTL,l=a,c=!1,u="top",d,f,h=t.left-r.left,m=r.right-t.right,g=i.right-i.left,b=i.bottom-i.top;if(l&&h=b||w>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 jH=Jn.define();function C8t(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 H3(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 T8t{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(ba);this.optionContent=C8t(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=H3(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:jH.of(d)}),c.preventDefault())}}),this.dom.addEventListener("focusout",c=>{let u=t.state.field(this.stateField,!1);u&&u.tooltip&&t.state.facet(ba).closeOnBlur&&c.relatedTarget!=t.contentDOM&&t.dispatch({effects:UE.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=H3(s.length,a,t.state.facet(ba).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=H3(n.options.length,n.selected,this.view.state.facet(ba).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=>ac(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&&_8t(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 m=r.appendChild(document.createElement("completion-section"));m.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 m=h(l,this.view.state,this.view,c);m&&d.appendChild(m)}}return i.from&&r.classList.add("cm-completionListIncompleteTop"),i.tonew T8t(n,e,t)}function _8t(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 cre(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function j8t(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(m=>m.name==h)||i.push(typeof f=="string"?{name:h}:f)}},a=t.facet(ba);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 ore(h,d.source,f?f(h):[],1e9-n.length));else{let h=t.sliceDoc(d.from,d.to),m,g=a.filterStrict?new S8t(h):new k8t(h);for(let b of d.result.options)if(m=g.match(b.label)){let v=b.displayLabel?f?f(b,m.matched):[]:m.matched,y=m.score+(b.boost||0);if(s(new ore(b,d.source,v,y)),typeof b.section=="object"&&b.section.rank==="dynamic"){let{name:w}=b.section;r||(r=Object.create(null)),r[w]=Math.max(y,r[w]||-1e9)}}}}if(i){let d=Object.create(null),f=0,h=(m,g)=>(m.rank==="dynamic"&&g.rank==="dynamic"?r[g.name]-r[m.name]:0)||(typeof m.rank=="number"?m.rank:1e9)-(typeof g.rank=="number"?g.rank:1e9)||(m.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):cre(d.completion)>cre(c)&&(l[l.length-1]=d),c=d.completion}return l}class qv{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 qv(this.options,ure(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=j8t(t,n);if(!l.length)return r&&t.some(u=>u.isPending)?r.setDisabled():null;let c=n.facet(ba).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:M8t,above:s.aboveCursor},r?r.timestamp:Date.now(),c,!1)}map(t){return new qv(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new qv(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class LR{constructor(t,n,i){this.active=t,this.id=n,this.open=i}static start(){return new LR(P8t,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,i=n.facet(ba),s=(i.override||n.languageDataAt("autocomplete",ay(n)).map(O8t)).map(c=>(this.active.find(d=>d.source==c)||new Uu(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(NH));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||s.some(c=>c.hasResult()&&t.changes.touchesRange(c.from,c.to))||!N8t(s,this.active)||l?a=qv.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 Uu(c.source,0):c));for(let c of t.effects)c.is(jH)&&(a=a&&a.setSelected(c.value,this.id));return s==this.active&&a==this.open?this:new LR(s,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?R8t:I8t}}function N8t(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n-1&&(n["aria-activedescendant"]=e+"-"+t),n}const P8t=[];function y4e(e,t){if(e.isUserEvent("input.complete")){let i=e.annotation(_H);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 Uu{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=y4e(t,n),r=this;(i&8||i&16&&this.touches(t))&&(r=new Uu(r.source,0)),i&4&&r.state==0&&(r=new Uu(this.source,1)),r=r.updateFor(t,i);for(let s of t.effects)if(s.is(MR))r=new Uu(r.source,1,s.value);else if(s.is(UE))r=new Uu(r.source,0);else if(s.is(NH))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(ay(t.state))}}class Cx extends Uu{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=ay(t.state);if(l>a||!r||n&2&&(ay(t.startState)==this.from||ln.map(t))}}),tc=Ka.define({create(){return LR.start()},update(e,t){return e.update(t)},provide:e=>[vH.from(e,t=>t.tooltip),Gt.contentAttributes.from(e,t=>t.attrs)]});function RH(e,t){const n=t.completion.apply||t.completion.label;let i=e.state.field(tc).active.find(r=>r.source==t.source);return i instanceof Cx?(typeof n=="string"?e.dispatch({...w8t(e.state,n,i.from,i.to),annotations:_H.of(t.completion)}):n(e,t.completion,i.from,i.to),!0):!1}const M8t=A8t(tc,RH);function QA(e,t="option"){return n=>{let i=n.state.field(tc,!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:jH.of(l)}),!0}}const L8t=e=>{let t=e.state.field(tc,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.state.field(tc,!1)?(e.dispatch({effects:MR.of(!0)}),!0):!1,$8t=e=>{let t=e.state.field(tc,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:UE.of(null)}),!0)};class F8t{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const B8t=50,U8t=1e3,Q8t=to.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(tc).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(tc),n=e.state.facet(ba);if(!e.selectionSet&&!e.docChanged&&e.startState.field(tc)==t)return;let i=e.transactions.some(s=>{let a=y4e(s,n);return a&8||(s.selection||s.docChanged)&&!(a&3)});for(let s=0;sB8t&&Date.now()-a.time>U8t){for(let l of a.context.abortListeners)try{l()}catch(c){ac(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(MR)))&&(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(tc);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(ba).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=ay(t),i=new TH(t,n,e.explicit,this.view),r=new F8t(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:UE.of(null)}),ac(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(ba).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(ba),i=this.view.state.field(tc);for(let r=0;rl.source==s.active.source);if(a&&a.isPending)if(s.done==null){let l=new Uu(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:NH.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(tc,!1);if(t&&t.tooltip&&this.view.state.facet(ba).closeOnBlur){let n=t.open&&M3e(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:UE.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:MR.of(!1)}),20),this.composing=0}}}),z8t=typeof navigator=="object"&&/Win/.test(navigator.platform),V8t=_p.highest(Gt.domEventHandlers({keydown(e,t){let n=t.state.field(tc,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(z8t&&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&&RH(t,i),!1}})),v4e=Gt.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 H8t{constructor(t,n,i,r){this.field=t,this.line=n,this.from=i,this.to=r}}class IH{constructor(t,n,i){this.field=t,this.from=n,this.to=i}map(t){let n=t.mapPos(this.from,-1,Fa.TrackDel),i=t.mapPos(this.to,1,Fa.TrackDel);return n==null||i==null?null:new IH(this.field,n,i)}}class PH{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 IH(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 H8t(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 PH(i,r)}}let q8t=En.widget({widget:new class extends qd{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),W8t=En.mark({class:"cm-snippetField"});class b1{constructor(t,n){this.ranges=t,this.active=n,this.deco=En.set(t.map(i=>(i.from==i.to?q8t:W8t).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 b1(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 wT=Jn.define({map(e,t){return e&&e.map(t)}}),K8t=Jn.define(),QE=Ka.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(wT))return n.value;if(n.is(K8t)&&e)return new b1(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=>Gt.decorations.from(e,t=>t?t.deco:En.none)});function DH(e,t){return dt.create(e.filter(n=>n.field==t).map(n=>dt.range(n.from,n.to)))}function G8t(e){let t=PH.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:rr.of(a)},scrollIntoView:!0,annotations:i?[_H.of(i),Mo.userEvent.of("input.complete")]:void 0};if(l.length&&(u.selection=DH(l,0)),l.some(d=>d.field>0)){let d=new b1(l,0),f=u.effects=[wT.of(d)];n.state.field(QE,!1)===void 0&&f.push(Jn.appendConfig.of([QE,eBt,tBt,v4e]))}n.dispatch(n.state.update(u))}}function x4e(e){return({state:t,dispatch:n})=>{let i=t.field(QE,!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:DH(i.ranges,r),effects:wT.of(s?null:new b1(i.ranges,r)),scrollIntoView:!0})),!0}}const X8t=({state:e,dispatch:t})=>e.field(QE,!1)?(t(e.update({effects:wT.of(null)})),!0):!1,Y8t=x4e(1),Z8t=x4e(-1),J8t=[{key:"Tab",run:Y8t,shift:Z8t},{key:"Escape",run:X8t}],dre=ln.define({combine(e){return e.length?e[0]:J8t}}),eBt=_p.highest(m1.compute([dre],e=>e.facet(dre)));function Fs(e,t){return{...t,apply:G8t(e)}}const tBt=Gt.domEventHandlers({mousedown(e,t){let n=t.state.field(QE,!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:DH(n.ranges,r.field),effects:wT.of(n.ranges.some(s=>s.field>r.field)?new b1(n.ranges,r.field):null),scrollIntoView:!0}),!0)}}),zE={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},zb=Jn.define({map(e,t){let n=t.mapPos(e,-1,Fa.TrackAfter);return n??void 0}}),MH=new class extends bg{};MH.startSide=1;MH.endSide=-1;const w4e=Ka.define({create(){return Pi.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(zb)&&(e=e.update({add:[MH.range(n.value,n.value+1)]}));return e}});function nBt(){return[rBt,w4e]}const W3="()[]{}<>«»»«[]{}";function O4e(e){for(let t=0;t{if((iBt?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(i.length>2||i.length==2&&bf(ec(i,0))==1||t!=r.from||n!=r.to)return!1;let s=aBt(e.state,i);return s?(e.dispatch(s),!0):!1}),sBt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=k4e(e,e.selection.main.head).brackets||zE.brackets,r=null,s=e.changeByRange(a=>{if(a.empty){let l=lBt(e.doc,a.head);for(let c of i)if(c==l&&BD(e.doc,a.head)==O4e(ec(c,0)))return{changes:{from:a.head-c.length,to:a.head+c.length},range:dt.cursor(a.head-c.length)}}return{range:r=a}});return r||t(e.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},oBt=[{key:"Backspace",run:sBt}];function aBt(e,t){let n=k4e(e,e.selection.main.head),i=n.brackets||zE.brackets;for(let r of i){let s=O4e(ec(r,0));if(t==r)return s==r?dBt(e,r,i.indexOf(r+r+r)>-1,n):cBt(e,r,s,n.before||zE.before);if(t==s&&S4e(e,e.selection.main.from))return uBt(e,r,s)}return null}function S4e(e,t){let n=!1;return e.field(w4e).between(0,e.doc.length,i=>{i==t&&(n=!0)}),n}function BD(e,t){let n=e.sliceString(t,t+2);return n.slice(0,bf(ec(n,0)))}function lBt(e,t){let n=e.sliceString(t-2,t);return bf(ec(n,0))==n.length?n:n.slice(1)}function cBt(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:zb.of(a.to+t.length),range:dt.range(a.anchor+t.length,a.head+t.length)};let l=BD(e.doc,a.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+n,from:a.head},effects:zb.of(a.head+t.length),range:dt.cursor(a.head+t.length)}:{range:r=a}});return r?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function uBt(e,t,n){let i=null,r=e.changeByRange(s=>s.empty&&BD(e.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:dt.cursor(s.head+n.length)}:i={range:s});return i?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function dBt(e,t,n,i){let r=i.stringPrefixes||zE.stringPrefixes,s=null,a=e.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:t,from:l.to}],effects:zb.of(l.to+t.length),range:dt.range(l.anchor+t.length,l.head+t.length)};let c=l.head,u=BD(e.doc,c),d;if(u==t){if(fre(e,c))return{changes:{insert:t+t,from:c},effects:zb.of(c+t.length),range:dt.cursor(c+t.length)};if(S4e(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:dt.cursor(c+h.length)}}}else{if(n&&e.sliceDoc(c-2*t.length,c)==t+t&&(d=hre(e,c-2*t.length,r))>-1&&fre(e,d))return{changes:{insert:t+t+t+t,from:c},effects:zb.of(c+t.length),range:dt.cursor(c+t.length)};if(e.charCategorizer(c)(u)!=Ts.Word&&hre(e,c,r)>-1&&!fBt(e,c,t,r))return{changes:{insert:t+t,from:c},effects:zb.of(c+t.length),range:dt.cursor(c+t.length)}}return{range:s=l}});return s?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function fre(e,t){let n=Br(e).resolveInner(t+1);return n.parent&&n.from==t}function fBt(e,t,n,i){let r=Br(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 hre(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=Ts.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))!=Ts.Word)return s}return-1}function hBt(e={}){return[V8t,tc,ba.of(e),Q8t,pBt,v4e]}const E4e=[{key:"Ctrl-Space",run:q3},{mac:"Alt-`",run:q3},{mac:"Alt-i",run:q3},{key:"Escape",run:$8t},{key:"ArrowDown",run:QA(!0)},{key:"ArrowUp",run:QA(!1)},{key:"PageDown",run:QA(!0,"page")},{key:"PageUp",run:QA(!1,"page")},{key:"Enter",run:L8t}],pBt=_p.highest(m1.computeN([ba],e=>e.facet(ba).defaultKeymap?[E4e]:[])),C4e=[Fs("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Fs("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Fs("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Fs("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Fs("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Fs(`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 m4e(n,t?t.state.tabSize:4,t?My(t.state):2);if(a.eol())s.blankLine(this.state,a.indentUnit);else for(;!a.eol();){let l=b4e(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 CH=Object.create(null),BE=[Vo.none],FFt=new p1(BE),Gie=[],Xie=Object.create(null),y4e=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"]])y4e[e]=x4e(CH,t);class v4e{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),y4e)}resolve(t){return t?this.table[t]||(this.table[t]=x4e(this.extra,t)):0}}const BFt=new v4e(CH);function Q3(e,t){Gie.indexOf(e)>-1||(Gie.push(e),console.warn(t))}function x4e(e,t){let n=[];for(let l of t.split(" ")){let c=[];for(let u of l.split(".")){let d=e[u]||se[u];d?typeof d=="function"?c.length?c=c.map(d):Q3(u,`Modifier ${u} used at start of tag`):c.length?Q3(u,`Tag ${u} used as modifier`):c=Array.isArray(d)?d:[d]:Q3(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=Xie[r];if(s)return s.id;let a=Xie[r]=Vo.define({id:BE.length,name:i,props:[Np({[i]:n})]});return BE.push(a),a.id}function UFt(e,t){let n=Vo.define({id:BE.length,name:"Document",props:[Rm.add(()=>e),Rp.add(()=>i=>t.getIndent(i))],top:!0});return BE.push(n),n}qr.RTL,qr.LTR;var Yie={};class PR{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 PR(t,[],n,i,i,0,[],0,r?new Zie(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 PR(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 QFt(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 Zie{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class QFt{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 DR{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 DR(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 DR(this.stack,this.pos,this.index)}}function mk(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 Oj{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Jie=new Oj;class zFt{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Jie,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=Jie,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 Ex{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:i}=n.p;w4e(this.data,t,n,this.id,i.data,i.tokenPrecTable)}}Ex.prototype.contextual=Ex.prototype.fallback=Ex.prototype.extend=!1;class MR{constructor(t,n,i){this.precTable=n,this.elseToken=i,this.data=typeof t=="string"?mk(t):t}token(t,n){let i=t.pos,r=0;for(;;){let s=t.next<0,a=t.resolveOffset(1,1);if(w4e(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))}}MR.prototype.contextual=Ex.prototype.fallback=Ex.prototype.extend=!1;class Co{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function w4e(e,t,n,i,r,s){let a=0,l=1<0){let g=e[m];if(c.allows(g)&&(t.token.value==-1||t.token.value==g||VFt(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+m+(m<<1),b=e[g],v=e[g+1]||65536;if(d=v)f=m+1;else{a=e[g+2],t.advance();continue e}}break}}function ere(e,t,n){for(let i=t,r;(r=e[i])!=65535;i++)if(r==n)return i-t;return-1}function VFt(e,t,n,i){let r=ere(n,i,t);return r<0||ere(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 HFt=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?tre(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?tre(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 _i){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 qFt{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(i=>new Oj)}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 Oj,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 Oj,{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 HFt(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&&GFt(r);if(a)return _c&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw _c&&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 _c&&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(Xn.contextHash)||0)==d))return t.useNode(f,h),_c&&console.log(a+this.stackID(t)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof _i)||f.children.length==0||f.positions[0]>0)break;let m=f.children[0];if(m instanceof _i&&f.positions[0]==0)f=m;else break}}let l=s.stateSlot(t.state,4);if(l>0)return t.reduce(l),_c&&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 nre(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(),_c&&console.log(d+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let f=l.split(),h=d;for(let m=0;m<10&&f.forceReduce()&&(_c&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));m++)_c&&(h=this.stackID(f)+" -> ");for(let m of l.recoverByInsert(c))_c&&console.log(d+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,i);this.stream.end>l.pos?(u==l.pos&&(u++,c=0),l.recoverByDelete(c,u),_c&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),nre(l,i)):(!r||r.scoree;class BD{constructor(t){this.start=t.start,this.shift=t.shift||V3,this.reduce=t.reduce||V3,this.reuse=t.reuse||V3,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class vp extends _D{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 p1(n.map((l,c)=>Vo.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=vLe;let a=mk(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 Ex(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 WFt(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=Th(this.data,s+2);else break;r=n(Th(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=Th(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(vp.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]=ire(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 XFt=316,YFt=317,rre=1,ZFt=2,JFt=3,e8t=4,t8t=318,n8t=320,i8t=321,r8t=5,s8t=6,o8t=0,IB=[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],O4e=125,a8t=59,PB=47,l8t=42,c8t=43,u8t=45,d8t=60,f8t=44,h8t=63,p8t=46,m8t=91,g8t=new BD({start:!1,shift(e,t){return t==r8t||t==s8t||t==n8t?e:t==i8t},strict:!1}),b8t=new Co((e,t)=>{let{next:n}=e;(n==O4e||n==-1||t.context)&&e.acceptToken(t8t)},{contextual:!0,fallback:!0}),y8t=new Co((e,t)=>{let{next:n}=e,i;IB.indexOf(n)>-1||n==PB&&((i=e.peek(1))==PB||i==l8t)||n!=O4e&&n!=a8t&&n!=-1&&!t.context&&e.acceptToken(XFt)},{contextual:!0}),v8t=new Co((e,t)=>{e.next==m8t&&!t.context&&e.acceptToken(YFt)},{contextual:!0}),x8t=new Co((e,t)=>{let{next:n}=e;if(n==c8t||n==u8t){if(e.advance(),n==e.next){e.advance();let i=!t.context&&t.canShift(rre);e.acceptToken(i?rre:ZFt)}}else n==h8t&&e.peek(1)==p8t&&(e.advance(),e.advance(),(e.next<48||e.next>57)&&e.acceptToken(JFt))},{contextual:!0});function H3(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}const w8t=new Co((e,t)=>{if(e.next!=d8t||!t.dialectEnabled(o8t)||(e.advance(),e.next==PB))return;let n=0;for(;IB.indexOf(e.next)>-1;)e.advance(),n++;if(H3(e.next,!0)){for(e.advance(),n++;H3(e.next,!1);)e.advance(),n++;for(;IB.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==f8t)return;for(let i=0;;i++){if(i==7){if(!H3(e.next,!0))return;break}if(e.next!="extends".charCodeAt(i))break;e.advance(),n++}}e.acceptToken(e8t,-n)}),O8t=Np({"get set async static":se.modifier,"for while do if else switch try catch finally return throw break continue default case defer":se.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":se.operatorKeyword,"let var const using function class extends":se.definitionKeyword,"import export from":se.moduleKeyword,"with debugger new":se.keyword,TemplateString:se.special(se.string),super:se.atom,BooleanLiteral:se.bool,this:se.self,null:se.null,Star:se.modifier,VariableName:se.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":se.function(se.variableName),VariableDefinition:se.definition(se.variableName),Label:se.labelName,PropertyName:se.propertyName,PrivatePropertyName:se.special(se.propertyName),"CallExpression/MemberExpression/PropertyName":se.function(se.propertyName),"FunctionDeclaration/VariableDefinition":se.function(se.definition(se.variableName)),"ClassDeclaration/VariableDefinition":se.definition(se.className),"NewExpression/VariableName":se.className,PropertyDefinition:se.definition(se.propertyName),PrivatePropertyDefinition:se.definition(se.special(se.propertyName)),UpdateOp:se.updateOperator,"LineComment Hashbang":se.lineComment,BlockComment:se.blockComment,Number:se.number,String:se.string,Escape:se.escape,ArithOp:se.arithmeticOperator,LogicOp:se.logicOperator,BitOp:se.bitwiseOperator,CompareOp:se.compareOperator,RegExp:se.regexp,Equals:se.definitionOperator,Arrow:se.function(se.punctuation),": Spread":se.punctuation,"( )":se.paren,"[ ]":se.squareBracket,"{ }":se.brace,"InterpolationStart InterpolationEnd":se.special(se.brace),".":se.derefOperator,", ;":se.separator,"@":se.meta,TypeName:se.typeName,TypeDefinition:se.definition(se.typeName),"type enum interface implements namespace module declare":se.definitionKeyword,"abstract global Privacy readonly override":se.modifier,"is keyof unique infer asserts":se.operatorKeyword,JSXAttributeValue:se.attributeValue,JSXText:se.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":se.angleBracket,"JSXIdentifier JSXNameSpacedName":se.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":se.attributeName,"JSXBuiltin/JSXIdentifier":se.standard(se.tagName)}),k8t={__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},S8t={__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},E8t={__proto__:null,"<":193},C8t=vp.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:g8t,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:[O8t],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:[y8t,v8t,x8t,w8t,2,3,4,5,6,7,8,9,10,11,12,13,14,b8t,new MR("$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 MR("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=>k8t[e]||-1},{term:343,get:e=>S8t[e]||-1},{term:95,get:e=>E8t[e]||-1}],tokenPrec:15201});class TH{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=Br(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(S4e(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 sre(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 T8t(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+$/]:T8t(t);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:t,validFor:n}:null}}function k4e(e,t){return n=>{for(let i=Br(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 ore{constructor(t,n,i,r){this.completion=t,this.source=n,this.match=i,this.score=r}}function ly(e){return e.selection.main.from}function S4e(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 _H=Xf.define();function A8t(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:dt.cursor(l.from+s+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const are=new WeakMap;function _8t(e){if(!Array.isArray(e))return e;let t=are.get(e);return t||are.set(e,t=AH(e)),t}const LR=Jn.define(),UE=Jn.define();class j8t{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&&S<=57||S>=97&&S<=122?2:S>=65&&S<=90?1:0:(k=nH(S))!=k.toLowerCase()?1:k!=k.toUpperCase()?2:0;(!w||C==1&&v||O==0&&C!=0)&&(n[f]==S||i[f]==S&&(h=!0)?a[f++]=w:a.length&&(y=!1)),O=C,w+=yf(S)}return f==c&&a[0]==0&&y?this.result(-100+(h?-200:0),a,t):m==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]):m==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?yf(tc(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 N8t{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:R8t,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=>lre(t(i),n(i)),optionClass:(t,n)=>i=>lre(t(i),n(i)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function lre(e,t){return e?t?e+" "+t:e:t}function R8t(e,t,n,i,r,s){let a=e.textDirection==qr.RTL,l=a,c=!1,u="top",d,f,h=t.left-r.left,m=r.right-t.right,g=i.right-i.left,b=i.bottom-i.top;if(l&&h=b||w>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 jH=Jn.define();function I8t(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 q3(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 P8t{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(Oa);this.optionContent=I8t(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=q3(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:jH.of(d)}),c.preventDefault())}}),this.dom.addEventListener("focusout",c=>{let u=t.state.field(this.stateField,!1);u&&u.tooltip&&t.state.facet(Oa).closeOnBlur&&c.relatedTarget!=t.contentDOM&&t.dispatch({effects:UE.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=q3(s.length,a,t.state.facet(Oa).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=q3(n.options.length,n.selected,this.view.state.facet(Oa).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=>lc(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&&M8t(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 m=r.appendChild(document.createElement("completion-section"));m.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 m=h(l,this.view.state,this.view,c);m&&d.appendChild(m)}}return i.from&&r.classList.add("cm-completionListIncompleteTop"),i.tonew P8t(n,e,t)}function M8t(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 cre(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function L8t(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(m=>m.name==h)||i.push(typeof f=="string"?{name:h}:f)}},a=t.facet(Oa);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 ore(h,d.source,f?f(h):[],1e9-n.length));else{let h=t.sliceDoc(d.from,d.to),m,g=a.filterStrict?new N8t(h):new j8t(h);for(let b of d.result.options)if(m=g.match(b.label)){let v=b.displayLabel?f?f(b,m.matched):[]:m.matched,y=m.score+(b.boost||0);if(s(new ore(b,d.source,v,y)),typeof b.section=="object"&&b.section.rank==="dynamic"){let{name:w}=b.section;r||(r=Object.create(null)),r[w]=Math.max(y,r[w]||-1e9)}}}}if(i){let d=Object.create(null),f=0,h=(m,g)=>(m.rank==="dynamic"&&g.rank==="dynamic"?r[g.name]-r[m.name]:0)||(typeof m.rank=="number"?m.rank:1e9)-(typeof g.rank=="number"?g.rank:1e9)||(m.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):cre(d.completion)>cre(c)&&(l[l.length-1]=d),c=d.completion}return l}class qv{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 qv(this.options,ure(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=L8t(t,n);if(!l.length)return r&&t.some(u=>u.isPending)?r.setDisabled():null;let c=n.facet(Oa).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:z8t,above:s.aboveCursor},r?r.timestamp:Date.now(),c,!1)}map(t){return new qv(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new qv(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class $R{constructor(t,n,i){this.active=t,this.id=n,this.open=i}static start(){return new $R(U8t,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,i=n.facet(Oa),s=(i.override||n.languageDataAt("autocomplete",ly(n)).map(_8t)).map(c=>(this.active.find(d=>d.source==c)||new Bu(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(NH));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||s.some(c=>c.hasResult()&&t.changes.touchesRange(c.from,c.to))||!$8t(s,this.active)||l?a=qv.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 Bu(c.source,0):c));for(let c of t.effects)c.is(jH)&&(a=a&&a.setSelected(c.value,this.id));return s==this.active&&a==this.open?this:new $R(s,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?F8t:B8t}}function $8t(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n-1&&(n["aria-activedescendant"]=e+"-"+t),n}const U8t=[];function E4e(e,t){if(e.isUserEvent("input.complete")){let i=e.annotation(_H);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 Bu{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=E4e(t,n),r=this;(i&8||i&16&&this.touches(t))&&(r=new Bu(r.source,0)),i&4&&r.state==0&&(r=new Bu(this.source,1)),r=r.updateFor(t,i);for(let s of t.effects)if(s.is(LR))r=new Bu(r.source,1,s.value);else if(s.is(UE))r=new Bu(r.source,0);else if(s.is(NH))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(ly(t.state))}}class Cx extends Bu{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=ly(t.state);if(l>a||!r||n&2&&(ly(t.startState)==this.from||ln.map(t))}}),nc=Ya.define({create(){return $R.start()},update(e,t){return e.update(t)},provide:e=>[vH.from(e,t=>t.tooltip),Zt.contentAttributes.from(e,t=>t.attrs)]});function RH(e,t){const n=t.completion.apply||t.completion.label;let i=e.state.field(nc).active.find(r=>r.source==t.source);return i instanceof Cx?(typeof n=="string"?e.dispatch({...A8t(e.state,n,i.from,i.to),annotations:_H.of(t.completion)}):n(e,t.completion,i.from,i.to),!0):!1}const z8t=D8t(nc,RH);function U2(e,t="option"){return n=>{let i=n.state.field(nc,!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:jH.of(l)}),!0}}const V8t=e=>{let t=e.state.field(nc,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.state.field(nc,!1)?(e.dispatch({effects:LR.of(!0)}),!0):!1,H8t=e=>{let t=e.state.field(nc,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:UE.of(null)}),!0)};class q8t{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const W8t=50,K8t=1e3,G8t=ro.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(nc).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(nc),n=e.state.facet(Oa);if(!e.selectionSet&&!e.docChanged&&e.startState.field(nc)==t)return;let i=e.transactions.some(s=>{let a=E4e(s,n);return a&8||(s.selection||s.docChanged)&&!(a&3)});for(let s=0;sW8t&&Date.now()-a.time>K8t){for(let l of a.context.abortListeners)try{l()}catch(c){lc(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(LR)))&&(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(nc);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(Oa).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=ly(t),i=new TH(t,n,e.explicit,this.view),r=new q8t(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:UE.of(null)}),lc(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(Oa).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(Oa),i=this.view.state.field(nc);for(let r=0;rl.source==s.active.source);if(a&&a.isPending)if(s.done==null){let l=new Bu(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:NH.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(nc,!1);if(t&&t.tooltip&&this.view.state.facet(Oa).closeOnBlur){let n=t.open&&z3e(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:UE.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:LR.of(!1)}),20),this.composing=0}}}),X8t=typeof navigator=="object"&&/Win/.test(navigator.platform),Y8t=jp.highest(Zt.domEventHandlers({keydown(e,t){let n=t.state.field(nc,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(X8t&&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&&RH(t,i),!1}})),C4e=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 Z8t{constructor(t,n,i,r){this.field=t,this.line=n,this.from=i,this.to=r}}class IH{constructor(t,n,i){this.field=t,this.from=n,this.to=i}map(t){let n=t.mapPos(this.from,-1,Qa.TrackDel),i=t.mapPos(this.to,1,Qa.TrackDel);return n==null||i==null?null:new IH(this.field,n,i)}}class PH{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 IH(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 Z8t(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 PH(i,r)}}let J8t=Tn.widget({widget:new class extends Wd{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),eBt=Tn.mark({class:"cm-snippetField"});class b1{constructor(t,n){this.ranges=t,this.active=n,this.deco=Tn.set(t.map(i=>(i.from==i.to?J8t:eBt).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 b1(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 wT=Jn.define({map(e,t){return e&&e.map(t)}}),tBt=Jn.define(),QE=Ya.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(wT))return n.value;if(n.is(tBt)&&e)return new b1(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:Tn.none)});function DH(e,t){return dt.create(e.filter(n=>n.field==t).map(n=>dt.range(n.from,n.to)))}function nBt(e){let t=PH.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:cr.of(a)},scrollIntoView:!0,annotations:i?[_H.of(i),Qo.userEvent.of("input.complete")]:void 0};if(l.length&&(u.selection=DH(l,0)),l.some(d=>d.field>0)){let d=new b1(l,0),f=u.effects=[wT.of(d)];n.state.field(QE,!1)===void 0&&f.push(Jn.appendConfig.of([QE,aBt,lBt,C4e]))}n.dispatch(n.state.update(u))}}function T4e(e){return({state:t,dispatch:n})=>{let i=t.field(QE,!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:DH(i.ranges,r),effects:wT.of(s?null:new b1(i.ranges,r)),scrollIntoView:!0})),!0}}const iBt=({state:e,dispatch:t})=>e.field(QE,!1)?(t(e.update({effects:wT.of(null)})),!0):!1,rBt=T4e(1),sBt=T4e(-1),oBt=[{key:"Tab",run:rBt,shift:sBt},{key:"Escape",run:iBt}],dre=un.define({combine(e){return e.length?e[0]:oBt}}),aBt=jp.highest(m1.compute([dre],e=>e.facet(dre)));function Qs(e,t){return{...t,apply:nBt(e)}}const lBt=Zt.domEventHandlers({mousedown(e,t){let n=t.state.field(QE,!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:DH(n.ranges,r.field),effects:wT.of(n.ranges.some(s=>s.field>r.field)?new b1(n.ranges,r.field):null),scrollIntoView:!0}),!0)}}),zE={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Vb=Jn.define({map(e,t){let n=t.mapPos(e,-1,Qa.TrackAfter);return n??void 0}}),MH=new class extends yg{};MH.startSide=1;MH.endSide=-1;const A4e=Ya.define({create(){return $i.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(Vb)&&(e=e.update({add:[MH.range(n.value,n.value+1)]}));return e}});function cBt(){return[dBt,A4e]}const K3="()[]{}<>«»»«[]{}";function _4e(e){for(let t=0;t{if((uBt?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(i.length>2||i.length==2&&yf(tc(i,0))==1||t!=r.from||n!=r.to)return!1;let s=pBt(e.state,i);return s?(e.dispatch(s),!0):!1}),fBt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=j4e(e,e.selection.main.head).brackets||zE.brackets,r=null,s=e.changeByRange(a=>{if(a.empty){let l=mBt(e.doc,a.head);for(let c of i)if(c==l&&UD(e.doc,a.head)==_4e(tc(c,0)))return{changes:{from:a.head-c.length,to:a.head+c.length},range:dt.cursor(a.head-c.length)}}return{range:r=a}});return r||t(e.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},hBt=[{key:"Backspace",run:fBt}];function pBt(e,t){let n=j4e(e,e.selection.main.head),i=n.brackets||zE.brackets;for(let r of i){let s=_4e(tc(r,0));if(t==r)return s==r?yBt(e,r,i.indexOf(r+r+r)>-1,n):gBt(e,r,s,n.before||zE.before);if(t==s&&N4e(e,e.selection.main.from))return bBt(e,r,s)}return null}function N4e(e,t){let n=!1;return e.field(A4e).between(0,e.doc.length,i=>{i==t&&(n=!0)}),n}function UD(e,t){let n=e.sliceString(t,t+2);return n.slice(0,yf(tc(n,0)))}function mBt(e,t){let n=e.sliceString(t-2,t);return yf(tc(n,0))==n.length?n:n.slice(1)}function gBt(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:Vb.of(a.to+t.length),range:dt.range(a.anchor+t.length,a.head+t.length)};let l=UD(e.doc,a.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+n,from:a.head},effects:Vb.of(a.head+t.length),range:dt.cursor(a.head+t.length)}:{range:r=a}});return r?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function bBt(e,t,n){let i=null,r=e.changeByRange(s=>s.empty&&UD(e.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:dt.cursor(s.head+n.length)}:i={range:s});return i?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function yBt(e,t,n,i){let r=i.stringPrefixes||zE.stringPrefixes,s=null,a=e.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:t,from:l.to}],effects:Vb.of(l.to+t.length),range:dt.range(l.anchor+t.length,l.head+t.length)};let c=l.head,u=UD(e.doc,c),d;if(u==t){if(fre(e,c))return{changes:{insert:t+t,from:c},effects:Vb.of(c+t.length),range:dt.cursor(c+t.length)};if(N4e(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:dt.cursor(c+h.length)}}}else{if(n&&e.sliceDoc(c-2*t.length,c)==t+t&&(d=hre(e,c-2*t.length,r))>-1&&fre(e,d))return{changes:{insert:t+t+t+t,from:c},effects:Vb.of(c+t.length),range:dt.cursor(c+t.length)};if(e.charCategorizer(c)(u)!=Ns.Word&&hre(e,c,r)>-1&&!vBt(e,c,t,r))return{changes:{insert:t+t,from:c},effects:Vb.of(c+t.length),range:dt.cursor(c+t.length)}}return{range:s=l}});return s?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function fre(e,t){let n=Br(e).resolveInner(t+1);return n.parent&&n.from==t}function vBt(e,t,n,i){let r=Br(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 hre(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 xBt(e={}){return[Y8t,nc,Oa.of(e),G8t,wBt,C4e]}const R4e=[{key:"Ctrl-Space",run:W3},{mac:"Alt-`",run:W3},{mac:"Alt-i",run:W3},{key:"Escape",run:H8t},{key:"ArrowDown",run:U2(!0)},{key:"ArrowUp",run:U2(!1)},{key:"PageDown",run:U2(!0,"page")},{key:"PageUp",run:U2(!1,"page")},{key:"Enter",run:V8t}],wBt=jp.highest(m1.computeN([Oa],e=>e.facet(Oa).defaultKeymap?[R4e]:[])),I4e=[Qs("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Qs("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Qs("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Qs("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Qs("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Qs(`try { \${} } catch (\${error}) { \${} -}`,{label:"try",detail:"/ catch block",type:"keyword"}),Fs("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Fs(`if (\${}) { +}`,{label:"try",detail:"/ catch block",type:"keyword"}),Qs("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Qs(`if (\${}) { \${} } else { \${} -}`,{label:"if",detail:"/ else block",type:"keyword"}),Fs(`class \${name} { +}`,{label:"if",detail:"/ else block",type:"keyword"}),Qs(`class \${name} { constructor(\${params}) { \${} } -}`,{label:"class",detail:"definition",type:"keyword"}),Fs('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Fs('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],mBt=C4e.concat([Fs("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Fs("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Fs("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),pre=new tH,T4e=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function CO(e){return(t,n)=>{let i=t.node.getChild("VariableDefinition");return i&&n(i,e),!0}}const gBt=["FunctionDeclaration"],bBt={FunctionDeclaration:CO("function"),ClassDeclaration:CO("class"),ClassExpression:()=>!0,EnumDeclaration:CO("constant"),TypeAliasDeclaration:CO("type"),NamespaceDeclaration:CO("namespace"),VariableDefinition(e,t){e.matchContext(gBt)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function A4e(e,t){let n=pre.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(ar.IncludeAnonymous).iterate(a=>{if(r)r=!1;else if(a.name){let l=bBt[a.name];if(l&&l(a,s)||T4e.has(a.name))return!1}else if(a.to-a.from>8192){for(let l of A4e(e,a.node))i.push(l);return!1}}),pre.set(t,i),i}const mre=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,_4e=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function yBt(e){let t=Br(e.state).resolveInner(e.pos,-1);if(_4e.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&mre.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let i=[];for(let r=t;r;r=r.parent)T4e.has(r.name)&&(i=i.concat(A4e(e.state.doc,r)));return{options:i,from:n?t.from:e.pos,validFor:mre}}const Mf=yp.define({name:"javascript",parser:v8t.configure({props:[Np.add({IfStatement:Sx({except:/^\s*({|else\b)/}),TryStatement:Sx({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:eFt,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:kx({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":Sx({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}}),Rp.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":yT,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:"$"}}),j4e={test:e=>/^JSX/.test(e.name),facet:MD({commentTokens:{block:{open:"{/*",close:"*/}"}}})},N4e=Mf.configure({dialect:"ts"},"typescript"),R4e=Mf.configure({dialect:"jsx",props:[wH.add(e=>e.isTop?[j4e]:void 0)]}),I4e=Mf.configure({dialect:"jsx ts",props:[wH.add(e=>e.isTop?[j4e]:void 0)]},"typescript");let P4e=e=>({label:e,type:"keyword"});const D4e="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(P4e),vBt=D4e.concat(["declare","implements","private","protected","public"].map(P4e));function DB(e={}){let t=e.jsx?e.typescript?I4e:R4e:e.typescript?N4e:Mf,n=e.typescript?mBt.concat(vBt):C4e.concat(D4e);return new Og(t,[Mf.data.of({autocomplete:g4e(_4e,AH(n))}),Mf.data.of({autocomplete:yBt}),e.jsx?OBt:[]])}function xBt(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 gre(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 wBt=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),OBt=Gt.inputHandler.of((e,t,n,i,r)=>{if((wBt?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||i!=">"&&i!="/"||!Mf.isActiveAt(e.state,t,-1))return!1;let s=r(),{state:a}=s,l=a.changeByRange(c=>{var u;let{head:d}=c,f=Br(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 m=f.parent,g=m.parent;if(g&&m.from==d-2&&((h=gre(a.doc,g.firstChild,d))||((u=g.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let b=`${h}>`;return{range:dt.cursor(d+b.length,-1),changes:{from:d,insert:b}}}}else if(i==">"){let m=xBt(f);if(m&&m.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(a.doc.sliceString(d,d+2))&&(h=gre(a.doc,m,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)}),kBt=jp({String:re.string,Number:re.number,"True False":re.bool,PropertyName:re.propertyName,Null:re.null,", :":re.separator,"[ ]":re.squareBracket,"{ }":re.brace}),SBt=vp.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:[kBt],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}),EBt=yp.define({name:"json",parser:SBt.configure({props:[Np.add({Object:Sx({except:/^\s*\}/}),Array:Sx({except:/^\s*\]/})}),Rp.add({"Object Array":yT})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function CBt(){return new Og(EBt)}class $R{static create(t,n,i,r,s){let a=r+(r<<8)+t+(n<<4)|0;return new $R(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=[[qn.contextHash,r]]}addChild(t,n){t.prop(qn.contextHash)!=this.hash&&(t=new Ci(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 Ci(t.types[this.type],this.children,this.positions,n-this.from).balance({makeTree:(r,s,a)=>new Ci($o.none,r,s,a,this.hashProp)})}}var Qt;(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"})(Qt||(Qt={}));class TBt{constructor(t,n){this.start=t,this.content=n,this.marks=[],this.parsers=[]}}class ABt{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 mS(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==Qt.OrderedList?FH:$H)(n,t,!1);return i>0&&(e.type!=Qt.BulletList||LH(n,t,!1)<0)&&n.text.charCodeAt(n.pos+i-1)==e.value}const M4e={[Qt.Blockquote](e,t,n){return n.next!=62?!1:(n.markers.push(Yi(Qt.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(id(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0)},[Qt.ListItem](e,t,n){return n.indent-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[Qt.OrderedList]:bre,[Qt.BulletList]:bre,[Qt.Document](){return!0}};function id(e){return e==32||e==9||e==10||e==13}function mS(e,t=0){for(;tn&&id(e.charCodeAt(t-1));)t--;return t}function L4e(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(H4e.SetextHeading)>-1||i<3?-1:1}function F4e(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function $H(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||id(e.text.charCodeAt(e.pos+1)))&&(!n||F4e(t,Qt.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 B4e(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t6?-1:n}function U4e(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t/,z4e=/\?>/,LB=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/,X4e=/\?>/,LB=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(i);if(s)return e.append(Yi(Qt.Comment,n,n+1+s[0].length));let a=/^\?[^]*?\?>/.exec(i);if(a)return e.append(Yi(Qt.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(Yi(Qt.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=HE.test(r),l=HE.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),m=f&&(t==42||!d||l);return e.append(new Uc(t==95?X4e:Y4e,n,i,(h?1:0)|(m?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(Yi(Qt.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(Yi(Qt.HardBreak,n,i+1))}return-1},Link(e,t,n){return t==91?e.append(new Uc(_b,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new Uc(FR,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 Uc&&(r.type==_b||r.type==FR)){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]=PBt(e,s,r.type==_b?Qt.Link:Qt.Image,r.from,n+1);if(r.type==_b)for(let l=0;lt?Yi(Qt.URL,t+n,s+n):s==e.length?null:!1}}function J4e(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 Uc(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 Uc&&(n.type==_b||n.type==FR))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 Uc&&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 Uc&&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 Uc?n:null}skipSpace(t){return mS(this.text,t-this.offset)+this.offset}elt(t,n,i,r){return typeof t=="string"?Yi(this.parser.getNodeType(t),n,i,r):new G4e(t,n)}}BH.linkStart=_b;BH.imageStart=FR;function FB(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(qn.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=t6e(n.from-i,t.ranges);if(n.to-i<=t.ranges[t.rangeI].to)t.addNode(n.tree,d);else{let f=new Ci(t.parser.nodeSet.types[Qt.Paragraph],[],[],0,t.block.hashProp);t.reusePlaceholders.set(f,n.tree),t.addNode(f,d)}if(n.type.is("Block")&&(DBt.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 t6e(e,t){let n=e;for(let i=1;izA[e]),Object.keys(zA).map(e=>H4e[e]),Object.keys(zA),NBt,M4e,Object.keys(G3).map(e=>G3[e]),Object.keys(G3),[]);function FBt(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 BBt(e){let{codeParser:t,htmlParser:n}=e;return{wrap:gLe((r,s)=>{let a=r.type.id;if(t&&(a==Qt.CodeBlock||a==Qt.FencedCode)){let l="";if(a==Qt.FencedCode){let u=r.node.getChild(Qt.CodeInfo);u&&(l=s.read(u.from,u.to))}let c=t(l);if(c)return{parser:c,overlay:u=>u.type.id==Qt.CodeText,bracketed:a==Qt.FencedCode}}else if(n&&(a==Qt.HTMLBlock||a==Qt.HTMLTag||a==Qt.CommentBlock))return{parser:n,overlay:FBt(r.node,r.from,r.to)};return null})}}const UBt={resolve:"Strikethrough",mark:"StrikethroughMark"},QBt={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":re.strikethrough}},{name:"StrikethroughMark",style:re.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=HE.test(i),c=HE.test(r);return e.addDelimiter(UBt,n,n+2,!a&&(!c||s||l),!s&&(!l||a||c))},after:"Emphasis"}]};function gS(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 wre(e,t){for(let n=t;n\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class Ore{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)&&n6e.test(r=n.text.slice(n.pos))){let s=[];gS(t,i.content,0,s,i.start)==gS(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=[];gS(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 zBt={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":re.heading}},"TableRow",{name:"TableCell",style:re.content},{name:"TableDelimiter",style:re.processingInstruction}],parseBlock:[{name:"Table",leaf(e,t){return wre(t.content,0)?new Ore:null},endLeaf(e,t,n){if(n.parsers.some(r=>r instanceof Ore)||!wre(t.text,t.basePos))return!1;let i=e.peekLine();return n6e.test(i)&&gS(e,t.text,t.basePos)==gS(e,i,t.basePos)},before:"SetextHeading"}]};class VBt{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 HBt={defineNodes:[{name:"Task",block:!0,style:re.list},{name:"TaskMarker",style:re.atom}],parseBlock:[{name:"TaskList",leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name=="ListItem"?new VBt:null},after:"SetextHeading"}]},kre=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,Sre=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,qBt=/[\w-]+\.[\w-]+($|[/:])/,Ere=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,Cre=/\/[a-zA-Z\d@.]+/gy;function Tre(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==")"&&Tre(e,t,i,")")>Tre(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 Are(e,t){Ere.lastIndex=t;let n=Ere.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 KBt={parseInline:[{name:"Autolink",parse(e,t,n){let i=n-e.offset;if(i&&/\w/.test(e.text[i-1]))return-1;kre.lastIndex=i;let r=kre.exec(e.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=WBt(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=Are(e.text,i):(s=Are(e.text,i+r[0].length),s>-1&&r[0]=="xmpp:"&&(Cre.lastIndex=s,r=Cre.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)}}]},GBt=[zBt,HBt,QBt,KBt];function i6e(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 Rre=null,Ire=null,Pre=0;function UB(e,t){let n=e.pos+t;if(Pre==n&&Ire==e)return Rre;let i=e.peek(t),r="";for(;O9t(i);)r+=String.fromCharCode(i),i=e.peek(++t);return Ire=e,Pre=n,Rre=r?r.toLowerCase():i==k9t||i==S9t?void 0:null}const d6e=60,BR=62,QH=47,k9t=63,S9t=33,E9t=45;function Dre(e,t){this.name=e,this.parent=t}const C9t=[UH,a6e,r6e,s6e,o6e],T9t=new FD({start:null,shift(e,t,n,i){return C9t.indexOf(t)>-1?new Dre(UB(i,1)||"",e):e},reduce(e,t){return t==l6e&&e?e.parent:e},reuse(e,t,n,i){let r=t.type.id;return r==UH||r==g9t?new Dre(UB(i,1)||"",e):e},strict:!1}),A9t=new ko((e,t)=>{if(e.next!=d6e){e.next<0&&t.context&&e.acceptToken(X3);return}e.advance();let n=e.next==QH;n&&e.advance();let i=UB(e,0);if(i===void 0)return;if(!i)return e.acceptToken(n?u9t:c9t);let r=t.context?t.context.name:null;if(n){if(i==r)return e.acceptToken(o9t);if(r&&w9t[r])return e.acceptToken(X3,-2);if(t.dialectEnabled(y9t))return e.acceptToken(a9t);for(let s=t.context;s;s=s.parent)if(s.name==i)return;e.acceptToken(l9t)}else{if(i=="script")return e.acceptToken(r6e);if(i=="style")return e.acceptToken(s6e);if(i=="textarea")return e.acceptToken(o6e);if(x9t.hasOwnProperty(i))return e.acceptToken(a6e);r&&Nre[r]&&Nre[r][i]?e.acceptToken(X3,-1):e.acceptToken(UH)}},{contextual:!0}),_9t=new ko(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(jre);break}if(e.next==E9t)t++;else if(e.next==BR&&t>=2){n>=3&&e.acceptToken(jre,-2);break}else t=0;e.advance()}});function j9t(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const N9t=new ko((e,t)=>{if(e.next==QH&&e.peek(1)==BR){let n=t.dialectEnabled(v9t)||j9t(t.context);e.acceptToken(n?s9t:_re,2)}else e.next==BR&&e.acceptToken(_re,1)});function zH(e,t,n){let i=2+e.length;return new ko(r=>{for(let s=0,a=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(t);break}if(s==0&&r.next==d6e||s==1&&r.next==QH||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 R9t=zH("script",JBt,e9t),I9t=zH("style",t9t,n9t),P9t=zH("textarea",i9t,r9t),D9t=jp({"Text RawText IncompleteTag IncompleteCloseTag":re.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":re.angleBracket,TagName:re.tagName,"MismatchedCloseTag/TagName":[re.tagName,re.invalid],AttributeName:re.attributeName,"AttributeValue UnquotedAttributeValue":re.attributeValue,Is:re.definitionOperator,"EntityReference CharacterReference":re.character,Comment:re.blockComment,ProcessingInst:re.processingInstruction,DoctypeDecl:re.documentMeta}),M9t=vp.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:T9t,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:[D9t],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==h9t)return Y3(l,c,n);if(u==p9t)return Y3(l,c,i);if(u==m9t)return Y3(l,c,r);if(u==l6e&&s.length){let d=l.node,f=d.firstChild,h=f&&Mre(f,c),m;if(h){for(let g of s)if(g.tag==h&&(!g.attrs||g.attrs(m||(m=f6e(f,c))))){let b=d.lastChild,v=b.type.id==b9t?b.from:d.to;if(v>f.to)return{parser:g.parser,overlay:[{from:f.to,to:v}]}}}}if(a&&u==c6e){let d=l.node,f;if(f=d.firstChild){let h=a[c.read(f.from,f.to)];if(h)for(let m of h){if(m.tagName&&m.tagName!=Mre(d.parent,c))continue;let g=d.lastChild;if(g.type.id==BB){let b=g.from+1,v=g.lastChild,y=g.to-(v&&v.isError?0:1);if(y>b)return{parser:m.parser,overlay:[{from:b,to:y}],bracketed:!0}}else if(g.type.id==u6e)return{parser:m.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const L9t=145,Lre=1,$9t=146,F9t=147,p6e=2,B9t=148,U9t=3,Q9t=4,m6e=[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],z9t=58,V9t=40,g6e=95,H9t=91,Sj=45,q9t=46,W9t=35,K9t=37,G9t=38,X9t=92,Y9t=10,Z9t=42;function qE(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function VH(e){return e>=48&&e<=57}function $re(e){return VH(e)||e>=97&&e<=102||e>=65&&e<=70}const b6e=(e,t,n)=>(i,r)=>{for(let s=!1,a=0,l=0;;l++){let{next:c}=i;if(qE(c)||c==Sj||c==g6e||s&&VH(c))!s&&(c!=Sj||l>0)&&(s=!0),a===l&&c==Sj&&a++,i.advance();else if(c==X9t&&i.peek(1)!=Y9t){if(i.advance(),$re(i.next)){do i.advance();while($re(i.next));i.next==32&&i.advance()}else i.next>-1&&i.advance();s=!0}else{s&&i.acceptToken(a==2&&r.canShift(p6e)?t:c==V9t?n:e);break}}},J9t=new ko(b6e($9t,p6e,F9t),{contextual:!0}),e7t=new ko(b6e(B9t,U9t,Q9t),{contextual:!0}),t7t=new ko(e=>{if(m6e.includes(e.peek(-1))){let{next:t}=e;(qE(t)||t==g6e||t==W9t||t==q9t||t==Z9t||t==H9t||t==z9t&&qE(e.peek(1))||t==Sj||t==G9t)&&e.acceptToken(L9t)}}),n7t=new ko(e=>{if(!m6e.includes(e.peek(-1))){let{next:t}=e;if(t==K9t&&(e.advance(),e.acceptToken(Lre)),qE(t)){do e.advance();while(qE(e.next)||VH(e.next));e.acceptToken(Lre)}}}),i7t=jp({"AtKeyword import charset namespace keyframes media supports font-feature-values":re.definitionKeyword,"from to selector scope MatchFlag":re.keyword,NamespaceName:re.namespace,KeyframeName:re.labelName,KeyframeRangeName:re.operatorKeyword,TagName:re.tagName,ClassName:re.className,PseudoClassName:re.constant(re.className),IdName:re.labelName,"FeatureName PropertyName":re.propertyName,AttributeName:re.attributeName,NumberLiteral:re.number,KeywordQuery:re.keyword,UnaryQueryOp:re.operatorKeyword,"CallTag ValueName FontName":re.atom,VariableName:re.variableName,Callee:re.operatorKeyword,Unit:re.unit,"UniversalSelector NestingSelector":re.definitionOperator,"MatchOp CompareOp":re.compareOperator,"ChildOp SiblingOp, LogicOp":re.logicOperator,BinOp:re.arithmeticOperator,Important:re.modifier,Comment:re.blockComment,ColorLiteral:re.color,"ParenthesizedContent StringLiteral":re.string,":":re.punctuation,"PseudoOp #":re.derefOperator,"; , |":re.separator,"( )":re.paren,"[ ]":re.squareBracket,"{ }":re.brace}),r7t={__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},s7t={__proto__:null,or:104,and:104,not:112,only:112,layer:206},o7t={__proto__:null,selector:118,style:124,layer:202},a7t={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},l7t={__proto__:null,to:243},c7t=vp.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:[t7t,n7t,J9t,e7t,1,2,3,4,new DR("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=>r7t[e]||-1},{term:148,get:e=>s7t[e]||-1},{term:4,get:e=>o7t[e]||-1},{term:28,get:e=>a7t[e]||-1},{term:146,get:e=>l7t[e]||-1}],tokenPrec:2405});let Z3=null;function J3(){if(!Z3&&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)));Z3=t.sort().map(i=>({type:"property",label:i,apply:i+": "}))}return Z3||[]}const Fre=["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})),Bre=["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}))),u7t=["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})),d7t=["@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})),dh=/^(\w[\w-]*|-\w[\w-]*|)$/,f7t=/^-(-[\w-]*)?$/;function h7t(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 Ure=new tH,p7t=["Declaration"];function m7t(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function y6e(e,t,n){if(t.to-t.from>4096){let i=Ure.get(t);if(i)return i;let r=[],s=new Set,a=t.cursor(ar.IncludeAnonymous);if(a.firstChild())do for(let l of y6e(e,a.node,n))s.has(l.label)||(s.add(l.label),r.push(l));while(a.nextSibling());return Ure.set(t,r),r}else{let i=[],r=new Set;return t.cursor().iterate(s=>{var a;if(n(s)&&s.matchContext(p7t)&&((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 g7t=e=>t=>{let{state:n,pos:i}=t,r=Br(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:J3(),validFor:dh};if(r.name=="ValueName")return{from:r.from,options:Bre,validFor:dh};if(r.name=="PseudoClassName")return{from:r.from,options:Fre,validFor:dh};if(e(r)||(t.explicit||s)&&h7t(r,n.doc))return{from:e(r)||s?r.from:i,options:y6e(n.doc,m7t(r),e),validFor:f7t};if(r.name=="TagName"){for(let{parent:c}=r;c;c=c.parent)if(c.name=="Block")return{from:r.from,options:J3(),validFor:dh};return{from:r.from,options:u7t,validFor:dh}}if(r.name=="AtKeyword")return{from:r.from,options:d7t,validFor:dh};if(!t.explicit)return null;let a=r.resolve(i),l=a.childBefore(i);return l&&l.name==":"&&a.name=="PseudoClassSelector"?{from:i,options:Fre,validFor:dh}:l&&l.name==":"&&a.name=="Declaration"||a.name=="ArgList"?{from:i,options:Bre,validFor:dh}:a.name=="Block"||a.name=="Styles"?{from:i,options:J3(),validFor:dh}:null},b7t=g7t(e=>e.name=="VariableName"),UR=yp.define({name:"css",parser:c7t.configure({props:[Np.add({Declaration:Sx()}),Rp.add({"Block KeyframeList":yT})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function y7t(){return new Og(UR,UR.data.of({autocomplete:b7t}))}const AO=["_blank","_self","_top","_parent"],e4=["ascii","utf-8","utf-16","latin1","latin1"],t4=["get","post","put","delete"],n4=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Rc=["true","false"],kn={},v7t={a:{attrs:{href:null,ping:null,type:null,media:null,target:AO,hreflang:null}},abbr:kn,address:kn,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:kn,aside:kn,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:kn,base:{attrs:{href:null,target:AO}},bdi:kn,bdo:kn,blockquote:{attrs:{cite:null}},body:kn,br:kn,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:n4,formmethod:t4,formnovalidate:["novalidate"],formtarget:AO,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:kn,center:kn,cite:kn,code:kn,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:kn,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:kn,div:kn,dl:kn,dt:kn,em:kn,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:kn,figure:kn,footer:kn,form:{attrs:{action:null,name:null,"accept-charset":e4,autocomplete:["on","off"],enctype:n4,method:t4,novalidate:["novalidate"],target:AO}},h1:kn,h2:kn,h3:kn,h4:kn,h5:kn,h6:kn,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:kn,hgroup:kn,hr:kn,html:{attrs:{manifest:null}},i:kn,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:n4,formmethod:t4,formnovalidate:["novalidate"],formtarget:AO,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:kn,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:kn,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:kn,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:e4,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:kn,noscript:kn,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:kn,param:{attrs:{name:null,value:null}},pre:kn,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:kn,rt:kn,ruby:kn,samp:kn,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:e4}},section:kn,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:kn,source:{attrs:{src:null,type:null,media:null}},span:kn,strong:kn,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:kn,summary:kn,sup:kn,table:kn,tbody:kn,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:kn,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:kn,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:kn,time:{attrs:{datetime:null}},title:kn,tr:kn,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:kn,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:kn},v6e={accesskey:null,class:null,contenteditable:Rc,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:Rc,autocorrect:Rc,autocapitalize:Rc,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":Rc,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Rc,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Rc,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Rc,"aria-hidden":Rc,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Rc,"aria-multiselectable":Rc,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Rc,"aria-relevant":null,"aria-required":Rc,"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},x6e="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 x6e)v6e[e]=null;class WE{constructor(t,n){this.tags={...v7t,...t},this.globalAttrs={...v6e,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}WE.default=new WE;function Ew(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 Cw(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function w6e(e,t,n){let i=n.tags[Ew(e,Cw(t))];return(i==null?void 0:i.children)||n.allTags}function HH(e,t){let n=[];for(let i=Cw(t);i&&!i.type.isTop;i=Cw(i.parent)){let r=Ew(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 O6e=/^[:\-\.\w\u00b7-\uffff]*$/;function Qre(e,t,n,i,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">",a=Cw(n,n.name=="StartTag"||n.name=="TagName");return{from:i,to:r,options:w6e(e.doc,a,t).map(l=>({label:l,type:"type"})).concat(HH(e.doc,n).map((l,c)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function zre(e,t,n,i){let r=/\s*>/.test(e.sliceDoc(i,i+5))?"":">";return{from:n,to:i,options:HH(e.doc,t).map((s,a)=>({label:s,apply:s+r,type:"type",boost:99-a})),validFor:O6e}}function x7t(e,t,n,i){let r=[],s=0;for(let a of w6e(e.doc,n,t))r.push({label:"<"+a,type:"type"});for(let a of HH(e.doc,n))r.push({label:"",type:"type",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function w7t(e,t,n,i,r){let s=Cw(n),a=s?t.tags[Ew(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:O6e}}function O7t(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=Cw(n),h=f?t.tags[Ew(e.doc,f)]:null;d=(h==null?void 0:h.attrs)&&h.attrs[u]}if(d){let f=e.sliceDoc(i,r).toLowerCase(),h='"',m='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",m=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+m,type:"constant"})}}return{from:i,to:r,options:l,validFor:c}}function k6e(e,t){let{state:n,pos:i}=t,r=Br(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.fromk6e(i,r)}const E7t=Mf.parser.configure({top:"SingleExpression"}),S6e=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:N4e.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:R4e.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:I4e.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:E7t},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:Mf.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:UR.parser}],E6e=[{name:"style",parser:UR.parser.configure({top:"Styles"})}].concat(x6e.map(e=>({name:e,parser:Mf.parser}))),C6e=yp.define({name:"html",parser:M9t.configure({props:[Np.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:"-_"}}),Ej=C6e.configure({wrap:h6e(S6e,E6e)});function C7t(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=h6e((e.nestedLanguages||[]).concat(S6e),(e.nestedAttributes||[]).concat(E6e)));let i=n?C6e.configure({wrap:n,dialect:t}):t?Ej.configure({dialect:t}):Ej;return new Og(i,[Ej.data.of({autocomplete:S7t(e)}),e.autoCloseTags!==!1?T7t:[],DB().support,y7t().support])}const Vre=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),T7t=Gt.inputHandler.of((e,t,n,i,r)=>{if(e.composing||e.state.readOnly||t!=n||i!=">"&&i!="/"||!Ej.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:m}=c,g=Br(a).resolveInner(m,-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=Ew(a.doc,v.parent,m))&&!Vre.has(b)){let y=m+(a.doc.sliceString(m,m+1)===">"?1:0),w=``;return{range:c,changes:{from:m,to:y,insert:w}}}}else if(h&&i=="/"&&g.name=="IncompleteCloseTag"){let v=g.parent;if(g.from==m-2&&((f=v.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(b=Ew(a.doc,v,m))&&!Vre.has(b)){let y=m+(a.doc.sliceString(m,m+1)===">"?1:0),w=`${b}>`;return{range:dt.cursor(m+w.length,-1),changes:{from:m,to:y,insert:w}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([s,a.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),T6e=MD({commentTokens:{block:{open:""}}}),A6e=new qn,_6e=$Bt.configure({props:[Rp.add(e=>!e.is("Block")||e.is("Document")||QB(e)!=null||A7t(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),A6e.add(QB),Np.add({Document:()=>null}),Nm.add({Document:T6e})]});function QB(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function A7t(e){return e.name=="OrderedList"||e.name=="BulletList"}function _7t(e,t){let n=e;for(;;){let i=n.nextSibling,r;if(!i||(r=QB(i.type))!=null&&r<=t)break;n=i}return n.to}const j7t=K3e.of((e,t,n)=>{for(let i=Br(e).resolveInner(n,-1);i&&!(i.fromn)return{from:n,to:s}}return null});function qH(e){return new Xc(T6e,e,[],"markdown")}const N7t=qH(_6e),R7t=_6e.configure([GBt,YBt,XBt,ZBt,{props:[Rp.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),QR=qH(R7t);function I7t(e,t){return n=>{if(n&&e){let i=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?i=e(n):i=jR.matchLanguageName(e,n,!0),i instanceof jR)return i.support?i.support.language.parser:Py.getSkippingParser(i.load());if(i)return i.parser}return t?t.parser:null}}let i4=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(+N6e(this.item,t)[2]+n):"";return this.spaceBefore+i+this.type+this.spaceAfter}};function j6e(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 i4(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 i4(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 i4(s.parent,c,c+d,a[1],u,f,s))}}return i}function N6e(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function r4(e,t,n,i=0){for(let r=-1,s=e;;){if(s.name=="ListItem"){let l=N6e(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 WH(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(g1)!=" ")return e;let i=Ld(e,4,n),r="";for(let s=i;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+e.slice(n)}const P7t=(e={})=>({state:t,dispatch:n})=>{let i=Br(t),{doc:r}=t,s=null,a=t.changeByRange(l=>{if(!l.empty||!QR.isActiveAt(t,l.from,-1)&&!QR.isActiveAt(t,l.from,1))return s={range:l};let c=l.from,u=r.lineAt(c),d=j6e(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,w=f.node.getChild("ListItem","ListItem");if(y.to>=c||w&&w.to0&&!/[^\s>]/.test(r.lineAt(u.from-1).text)||e.nonTightLists===!1){let x=d.length>1?d[d.length-2]:null,O,S="";x&&x.item?(O=u.from+x.from,S=x.marker(r,1)):O=u.from+(x?x.to:0);let k=[{from:O,to:c,insert:S}];return f.node.name=="OrderedList"&&r4(f.item,r,k,-2),x&&x.node.name=="OrderedList"&&r4(x.item,r,k),{range:dt.cursor(O+S.length),changes:k}}else{let x=qre(d,t,u);return{range:dt.cursor(c+x.length+1),changes:{from:u.from,insert:x+t.lineBreak}}}}if(f.node.name=="Blockquote"&&h&&u.from){let y=r.lineAt(u.from-1),w=/>\s*$/.exec(y.text);if(w&&w.index==f.from){let x=t.changes([{from:y.from+w.index,to:y.to},{from:u.from+f.from,to:u.to}]);return{range:l.map(x),changes:x}}}let m=[];f.node.name=="OrderedList"&&r4(f.item,r,m);let g=f.item&&f.item.from]*/.exec(u.text)[0].length>=f.to)for(let y=0,w=d.length-1;y<=w;y++)b+=y==w&&!g?d[y].marker(r,1):d[y].blank(yu.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return b=WH(b,t),M7t(f.node,t.doc)&&(b=qre(d,t,u)+t.lineBreak+b),m.push({from:v,to:c,insert:t.lineBreak+b}),{range:dt.cursor(v+b.length+1),changes:m}});return s?!1:(n(t.update(a,{scrollIntoView:!0,userEvent:"input"})),!0)},D7t=P7t();function Hre(e){return e.name=="QuoteMark"||e.name=="ListMark"}function M7t(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=Br(e),i=null,r=e.changeByRange(s=>{let a=s.from,{doc:l}=e;if(s.empty&&QR.isActiveAt(e,s.from)){let c=l.lineAt(a),u=j6e(L7t(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:dt.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),!QR.isActiveAt(t.state,i.from,1)))return!1;let s=Br(t.state),a=!1;return s.iterate({from:i.from,to:i.to,enter:l=>{(l.from>i.from||z7t.test(l.name))&&(a=!0)},leave:l=>{l.to=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}const VUt=new ko((e,t)=>{let n;if(e.next<0)e.acceptToken(K7t);else if(t.context.flags&Cj)o4(e.next)&&e.acceptToken(W7t,1);else if(((n=e.peek(-1))<0||o4(n))&&t.canShift(Wre)){let i=0;for(;e.next==KH||e.next==QD;)e.advance(),i++;(e.next==Ly||e.next==KE||e.next==GH)&&e.acceptToken(Wre,-i)}else o4(e.next)&&e.acceptToken(q7t,1)},{contextual:!0}),HUt=new ko((e,t)=>{let n=t.context;if(n.flags)return;let i=e.peek(-1);if(i==Ly||i==KE){let r=0,s=0;for(;;){if(e.next==KH)r++;else if(e.next==QD)r+=8-r%8;else break;e.advance(),s++}r!=n.indent&&e.next!=Ly&&e.next!=KE&&e.next!=GH&&(r[e,t|F6e])),KUt=new FD({start:qUt,reduce(e,t,n,i){return e.flags&Cj&&zUt.has(t)||(t==dUt||t==M6e)&&e.flags&F6e?e.parent:e},shift(e,t,n,i){return t==I6e?new Tj(e,WUt(i.read(i.pos,n.pos)),0):t==P6e?e.parent:t==Y7t||t==tUt||t==rUt||t==D6e?new Tj(e,0,Cj):Yre.has(t)?new Tj(e,0,Yre.get(t)|e.flags&Cj):e},hash(e){return e.hash}}),GUt=new ko(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==KH||n==QD)){n!=MUt&&n!=LUt&&n!=Ly&&n!=KE&&n!=GH&&e.acceptToken(H7t);return}}}),XUt=new ko((e,t)=>{let{flags:n}=t.context,i=n&yh?$6e:L6e,r=(n&vh)>0,s=!(n&xh),a=(n&wh)>0,l=e.pos;for(;!(e.next<0);)if(a&&e.next==zB)if(e.peek(1)==zB)e.advance(2);else{if(e.pos==l){e.acceptToken(D6e,1);return}break}else if(s&&e.next==Xre){if(e.pos==l){e.advance();let c=e.next;c>=0&&(e.advance(),YUt(e,c)),e.acceptToken(X7t);return}break}else if(e.next==Xre&&!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(Kre,r?3:1);return}break}else if(e.next==Ly){if(r)e.advance();else if(e.pos==l){e.acceptToken(Kre);return}break}else e.advance();e.pos>l&&e.acceptToken(G7t)});function YUt(e,t){if(t==$Ut)for(let n=0;n<2&&e.next>=48&&e.next<=55;n++)e.advance();else if(t==FUt)for(let n=0;n<2&&a4(e.next);n++)e.advance();else if(t==UUt)for(let n=0;n<4&&a4(e.next);n++)e.advance();else if(t==QUt)for(let n=0;n<8&&a4(e.next);n++)e.advance();else if(t==BUt&&e.next==zB){for(e.advance();e.next>=0&&e.next!=Gre&&e.next!=L6e&&e.next!=$6e&&e.next!=Ly;)e.advance();e.next==Gre&&e.advance()}}const ZUt=jp({'async "*" "**" FormatConversion FormatSpec':re.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":re.controlKeyword,"in not and or is del":re.operatorKeyword,"from def class global nonlocal lambda":re.definitionKeyword,import:re.moduleKeyword,"with as print":re.keyword,Boolean:re.bool,None:re.null,VariableName:re.variableName,"CallExpression/VariableName":re.function(re.variableName),"FunctionDefinition/VariableName":re.function(re.definition(re.variableName)),"ClassDefinition/VariableName":re.definition(re.className),PropertyName:re.propertyName,"CallExpression/MemberExpression/PropertyName":re.function(re.propertyName),Comment:re.lineComment,Number:re.number,String:re.string,FormatString:re.special(re.string),Escape:re.escape,UpdateOp:re.updateOperator,"ArithOp!":re.arithmeticOperator,BitOp:re.bitwiseOperator,CompareOp:re.compareOperator,AssignOp:re.definitionOperator,Ellipsis:re.punctuation,At:re.meta,"( )":re.paren,"[ ]":re.squareBracket,"{ }":re.brace,".":re.derefOperator,", ;":re.separator}),JUt={__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},eQt=vp.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:[GUt,HUt,VUt,XUt,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:e=>JUt[e]||-1}],tokenPrec:7668}),Zre=new tH,B6e=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function HA(e){return(t,n,i)=>{if(i)return!1;let r=t.node.getChild("VariableName");return r&&n(r,e),!0}}const tQt={FunctionDefinition:HA("function"),ClassDefinition:HA("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:HA("variable"),AsPattern:HA("variable"),__proto__:null};function U6e(e,t){let n=Zre.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(ar.IncludeAnonymous).iterate(a=>{if(a.name){let l=tQt[a.name];if(l&&l(a,s,r)||!r&&B6e.has(a.name))return!1;r=!1}else if(a.to-a.from>8192){for(let l of U6e(e,a.node))i.push(l);return!1}}),Zre.set(t,i),i}const Jre=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,Q6e=["String","FormatString","Comment","PropertyName"];function nQt(e){let t=Br(e.state).resolveInner(e.pos,-1);if(Q6e.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&Jre.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let i=[];for(let r=t;r;r=r.parent)B6e.has(r.name)&&(i=i.concat(U6e(e.state.doc,r)));return{options:i,from:n?t.from:e.pos,validFor:Jre}}const iQt=["__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"}))),rQt=[Fs("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),Fs("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),Fs("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),Fs("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),Fs(`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=FR.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 _i(this.parser.nodeSet.types[t],Sw,Sw,(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(FB(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?J4e(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=FB(this.parser.parseInline(t.content,t.start),t.marks);this.addNode(this.buffer.writeElements(n,-t.start).finish(Ht.Paragraph,t.content.length),t.start)}elt(t,n,i,r){return typeof t=="string"?tr(this.parser.getNodeType(t),n,i,r):new n6e(t,n)}get buffer(){return new t6e(this.parser.nodeSet)}}function J4e(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,m=r.get(d.tree);m?h=m:d.to+i>s?(h=J4e(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 _i(n.type,a,l,n.to+i-c,n.tree?n.tree.propValues:void 0)}class QD extends _D{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 BBt(this,t,n,i);for(let s of this.wrappers)r=s(r,t,n,i);return r}configure(t){let n=$B(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(TO(n.defineNodes)){r=Object.assign({},r);let h=i.types.slice(),m;for(let g of n.defineNodes){let{name:b,block:v,composite:y,style:w}=typeof g=="string"?{name:g}:g;if(h.some(S=>S.name==b))continue;y&&(r[h.length]=(S,k,C)=>y(k,C,S.value));let x=h.length,O=y?["Block","BlockContext"]:v?x>=Ht.ATXHeading1&&x<=Ht.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;h.push(Vo.define({id:x,name:b,props:O&&[[Xn.group,O]]})),w&&(m||(m={}),Array.isArray(w)||w instanceof mf?m[b]=w:Object.assign(m,w))}i=new p1(h),m&&(i=i.extend(Np(m)))}if(TO(n.props)&&(i=i.extend(...n.props)),TO(n.remove))for(let h of n.remove){let m=this.blockNames.indexOf(h),g=this.inlineNames.indexOf(h);m>-1&&(s[m]=a[m]=void 0),g>-1&&(c[g]=void 0)}if(TO(n.parseBlock))for(let h of n.parseBlock){let m=l.indexOf(h.name);if(m>-1)s[m]=h.parse,a[m]=h.leaf;else{let g=h.before?z2(l,h.before):h.after?z2(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(TO(n.parseInline))for(let h of n.parseInline){let m=u.indexOf(h.name);if(m>-1)c[m]=h.parse;else{let g=h.before?z2(u,h.before):h.after?z2(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 QD(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 BH(this,t,n);e:for(let r=n;r=0){r=l;continue e}}r++}return i.resolveMarkers(0)}}function TO(e){return e!=null&&e.length>0}function $B(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=$B(e[0]);if(e.length==1)return t;let n=$B(e.slice(1));if(!n||!t)return t||n;let i=(a,l)=>(a||Sw).concat(l||Sw),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 z2(e,t){let n=e.indexOf(t);if(n<0)throw new RangeError(`Position specified relative to unknown parser ${t}`);return n}let e6e=[Vo.none];for(let e=1,t;t=Ht[e];e++)e6e[e]=Vo.define({id:e,name:t,props:e>=Ht.Escape?[]:[[Xn.group,e in z4e?["Block","BlockContext"]:["Block","LeafBlock"]]],top:t=="Document"});const Sw=[];class t6e{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 _i.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:t,length:n})}}let VE=class{constructor(t,n,i,r=Sw){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 t6e(t).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class n6e{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 Sw}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 tr(e,t,n,i){return new VE(e,t,n,i)}const i6e={resolve:"Emphasis",mark:"EmphasisMark"},r6e={resolve:"Emphasis",mark:"EmphasisMark"},jb={},BR={};class Fc{constructor(t,n,i,r){this.type=t,this.from=n,this.to=i,this.side=r}}const xre="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let HE=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{HE=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const X3={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(tr(Ht.Autolink,n,n+1+r[0].length,[tr(Ht.LinkMark,n,n+1),tr(Ht.URL,n+1,n+r[0].length),tr(Ht.LinkMark,n+r[0].length,n+1+r[0].length)]));let s=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(i);if(s)return e.append(tr(Ht.Comment,n,n+1+s[0].length));let a=/^\?[^]*?\?>/.exec(i);if(a)return e.append(tr(Ht.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(tr(Ht.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=HE.test(r),l=HE.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),m=f&&(t==42||!d||l);return e.append(new Fc(t==95?i6e:r6e,n,i,(h?1:0)|(m?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(tr(Ht.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(tr(Ht.HardBreak,n,i+1))}return-1},Link(e,t,n){return t==91?e.append(new Fc(jb,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new Fc(BR,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 Fc&&(r.type==jb||r.type==BR)){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]=UBt(e,s,r.type==jb?Ht.Link:Ht.Image,r.from,n+1);if(r.type==jb)for(let l=0;lt?tr(Ht.URL,t+n,s+n):s==e.length?null:!1}}function o6e(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 Fc(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 Fc&&(n.type==jb||n.type==BR))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 Fc&&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 Fc&&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 Fc?n:null}skipSpace(t){return mS(this.text,t-this.offset)+this.offset}elt(t,n,i,r){return typeof t=="string"?tr(this.parser.getNodeType(t),n,i,r):new n6e(t,n)}}BH.linkStart=jb;BH.imageStart=BR;function FB(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(Xn.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=l6e(n.from-i,t.ranges);if(n.to-i<=t.ranges[t.rangeI].to)t.addNode(n.tree,d);else{let f=new _i(t.parser.nodeSet.types[Ht.Paragraph],[],[],0,t.block.hashProp);t.reusePlaceholders.set(f,n.tree),t.addNode(f,d)}if(n.type.is("Block")&&(QBt.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 l6e(e,t){let n=e;for(let i=1;iQ2[e]),Object.keys(Q2).map(e=>Z4e[e]),Object.keys(Q2),$Bt,z4e,Object.keys(X3).map(e=>X3[e]),Object.keys(X3),[]);function qBt(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 WBt(e){let{codeParser:t,htmlParser:n}=e;return{wrap:kLe((r,s)=>{let a=r.type.id;if(t&&(a==Ht.CodeBlock||a==Ht.FencedCode)){let l="";if(a==Ht.FencedCode){let u=r.node.getChild(Ht.CodeInfo);u&&(l=s.read(u.from,u.to))}let c=t(l);if(c)return{parser:c,overlay:u=>u.type.id==Ht.CodeText,bracketed:a==Ht.FencedCode}}else if(n&&(a==Ht.HTMLBlock||a==Ht.HTMLTag||a==Ht.CommentBlock))return{parser:n,overlay:qBt(r.node,r.from,r.to)};return null})}}const KBt={resolve:"Strikethrough",mark:"StrikethroughMark"},GBt={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":se.strikethrough}},{name:"StrikethroughMark",style:se.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=HE.test(i),c=HE.test(r);return e.addDelimiter(KBt,n,n+2,!a&&(!c||s||l),!s&&(!l||a||c))},after:"Emphasis"}]};function gS(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 wre(e,t){for(let n=t;n\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class Ore{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)&&c6e.test(r=n.text.slice(n.pos))){let s=[];gS(t,i.content,0,s,i.start)==gS(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=[];gS(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 XBt={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":se.heading}},"TableRow",{name:"TableCell",style:se.content},{name:"TableDelimiter",style:se.processingInstruction}],parseBlock:[{name:"Table",leaf(e,t){return wre(t.content,0)?new Ore:null},endLeaf(e,t,n){if(n.parsers.some(r=>r instanceof Ore)||!wre(t.text,t.basePos))return!1;let i=e.peekLine();return c6e.test(i)&&gS(e,t.text,t.basePos)==gS(e,i,t.basePos)},before:"SetextHeading"}]};class YBt{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 ZBt={defineNodes:[{name:"Task",block:!0,style:se.list},{name:"TaskMarker",style:se.atom}],parseBlock:[{name:"TaskList",leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name=="ListItem"?new YBt:null},after:"SetextHeading"}]},kre=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,Sre=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,JBt=/[\w-]+\.[\w-]+($|[/:])/,Ere=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,Cre=/\/[a-zA-Z\d@.]+/gy;function Tre(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==")"&&Tre(e,t,i,")")>Tre(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 Are(e,t){Ere.lastIndex=t;let n=Ere.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 t9t={parseInline:[{name:"Autolink",parse(e,t,n){let i=n-e.offset;if(i&&/\w/.test(e.text[i-1]))return-1;kre.lastIndex=i;let r=kre.exec(e.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=e9t(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=Are(e.text,i):(s=Are(e.text,i+r[0].length),s>-1&&r[0]=="xmpp:"&&(Cre.lastIndex=s,r=Cre.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)}}]},n9t=[XBt,ZBt,GBt,t9t];function u6e(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 Rre=null,Ire=null,Pre=0;function UB(e,t){let n=e.pos+t;if(Pre==n&&Ire==e)return Rre;let i=e.peek(t),r="";for(;_9t(i);)r+=String.fromCharCode(i),i=e.peek(++t);return Ire=e,Pre=n,Rre=r?r.toLowerCase():i==j9t||i==N9t?void 0:null}const y6e=60,UR=62,QH=47,j9t=63,N9t=33,R9t=45;function Dre(e,t){this.name=e,this.parent=t}const I9t=[UH,p6e,d6e,f6e,h6e],P9t=new BD({start:null,shift(e,t,n,i){return I9t.indexOf(t)>-1?new Dre(UB(i,1)||"",e):e},reduce(e,t){return t==m6e&&e?e.parent:e},reuse(e,t,n,i){let r=t.type.id;return r==UH||r==k9t?new Dre(UB(i,1)||"",e):e},strict:!1}),D9t=new Co((e,t)=>{if(e.next!=y6e){e.next<0&&t.context&&e.acceptToken(Y3);return}e.advance();let n=e.next==QH;n&&e.advance();let i=UB(e,0);if(i===void 0)return;if(!i)return e.acceptToken(n?b9t:g9t);let r=t.context?t.context.name:null;if(n){if(i==r)return e.acceptToken(h9t);if(r&&A9t[r])return e.acceptToken(Y3,-2);if(t.dialectEnabled(E9t))return e.acceptToken(p9t);for(let s=t.context;s;s=s.parent)if(s.name==i)return;e.acceptToken(m9t)}else{if(i=="script")return e.acceptToken(d6e);if(i=="style")return e.acceptToken(f6e);if(i=="textarea")return e.acceptToken(h6e);if(T9t.hasOwnProperty(i))return e.acceptToken(p6e);r&&Nre[r]&&Nre[r][i]?e.acceptToken(Y3,-1):e.acceptToken(UH)}},{contextual:!0}),M9t=new Co(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(jre);break}if(e.next==R9t)t++;else if(e.next==UR&&t>=2){n>=3&&e.acceptToken(jre,-2);break}else t=0;e.advance()}});function L9t(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const $9t=new Co((e,t)=>{if(e.next==QH&&e.peek(1)==UR){let n=t.dialectEnabled(C9t)||L9t(t.context);e.acceptToken(n?f9t:_re,2)}else e.next==UR&&e.acceptToken(_re,1)});function zH(e,t,n){let i=2+e.length;return new Co(r=>{for(let s=0,a=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(t);break}if(s==0&&r.next==y6e||s==1&&r.next==QH||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 F9t=zH("script",o9t,a9t),B9t=zH("style",l9t,c9t),U9t=zH("textarea",u9t,d9t),Q9t=Np({"Text RawText IncompleteTag IncompleteCloseTag":se.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":se.angleBracket,TagName:se.tagName,"MismatchedCloseTag/TagName":[se.tagName,se.invalid],AttributeName:se.attributeName,"AttributeValue UnquotedAttributeValue":se.attributeValue,Is:se.definitionOperator,"EntityReference CharacterReference":se.character,Comment:se.blockComment,ProcessingInst:se.processingInstruction,DoctypeDecl:se.documentMeta}),z9t=vp.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:P9t,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:[Q9t],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==x9t)return Z3(l,c,n);if(u==w9t)return Z3(l,c,i);if(u==O9t)return Z3(l,c,r);if(u==m6e&&s.length){let d=l.node,f=d.firstChild,h=f&&Mre(f,c),m;if(h){for(let g of s)if(g.tag==h&&(!g.attrs||g.attrs(m||(m=v6e(f,c))))){let b=d.lastChild,v=b.type.id==S9t?b.from:d.to;if(v>f.to)return{parser:g.parser,overlay:[{from:f.to,to:v}]}}}}if(a&&u==g6e){let d=l.node,f;if(f=d.firstChild){let h=a[c.read(f.from,f.to)];if(h)for(let m of h){if(m.tagName&&m.tagName!=Mre(d.parent,c))continue;let g=d.lastChild;if(g.type.id==BB){let b=g.from+1,v=g.lastChild,y=g.to-(v&&v.isError?0:1);if(y>b)return{parser:m.parser,overlay:[{from:b,to:y}],bracketed:!0}}else if(g.type.id==b6e)return{parser:m.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const V9t=145,Lre=1,H9t=146,q9t=147,w6e=2,W9t=148,K9t=3,G9t=4,O6e=[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],X9t=58,Y9t=40,k6e=95,Z9t=91,kj=45,J9t=46,e7t=35,t7t=37,n7t=38,i7t=92,r7t=10,s7t=42;function qE(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function VH(e){return e>=48&&e<=57}function $re(e){return VH(e)||e>=97&&e<=102||e>=65&&e<=70}const S6e=(e,t,n)=>(i,r)=>{for(let s=!1,a=0,l=0;;l++){let{next:c}=i;if(qE(c)||c==kj||c==k6e||s&&VH(c))!s&&(c!=kj||l>0)&&(s=!0),a===l&&c==kj&&a++,i.advance();else if(c==i7t&&i.peek(1)!=r7t){if(i.advance(),$re(i.next)){do i.advance();while($re(i.next));i.next==32&&i.advance()}else i.next>-1&&i.advance();s=!0}else{s&&i.acceptToken(a==2&&r.canShift(w6e)?t:c==Y9t?n:e);break}}},o7t=new Co(S6e(H9t,w6e,q9t),{contextual:!0}),a7t=new Co(S6e(W9t,K9t,G9t),{contextual:!0}),l7t=new Co(e=>{if(O6e.includes(e.peek(-1))){let{next:t}=e;(qE(t)||t==k6e||t==e7t||t==J9t||t==s7t||t==Z9t||t==X9t&&qE(e.peek(1))||t==kj||t==n7t)&&e.acceptToken(V9t)}}),c7t=new Co(e=>{if(!O6e.includes(e.peek(-1))){let{next:t}=e;if(t==t7t&&(e.advance(),e.acceptToken(Lre)),qE(t)){do e.advance();while(qE(e.next)||VH(e.next));e.acceptToken(Lre)}}}),u7t=Np({"AtKeyword import charset namespace keyframes media supports font-feature-values":se.definitionKeyword,"from to selector scope MatchFlag":se.keyword,NamespaceName:se.namespace,KeyframeName:se.labelName,KeyframeRangeName:se.operatorKeyword,TagName:se.tagName,ClassName:se.className,PseudoClassName:se.constant(se.className),IdName:se.labelName,"FeatureName PropertyName":se.propertyName,AttributeName:se.attributeName,NumberLiteral:se.number,KeywordQuery:se.keyword,UnaryQueryOp:se.operatorKeyword,"CallTag ValueName FontName":se.atom,VariableName:se.variableName,Callee:se.operatorKeyword,Unit:se.unit,"UniversalSelector NestingSelector":se.definitionOperator,"MatchOp CompareOp":se.compareOperator,"ChildOp SiblingOp, LogicOp":se.logicOperator,BinOp:se.arithmeticOperator,Important:se.modifier,Comment:se.blockComment,ColorLiteral:se.color,"ParenthesizedContent StringLiteral":se.string,":":se.punctuation,"PseudoOp #":se.derefOperator,"; , |":se.separator,"( )":se.paren,"[ ]":se.squareBracket,"{ }":se.brace}),d7t={__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},f7t={__proto__:null,or:104,and:104,not:112,only:112,layer:206},h7t={__proto__:null,selector:118,style:124,layer:202},p7t={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},m7t={__proto__:null,to:243},g7t=vp.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:[l7t,c7t,o7t,a7t,1,2,3,4,new MR("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=>d7t[e]||-1},{term:148,get:e=>f7t[e]||-1},{term:4,get:e=>h7t[e]||-1},{term:28,get:e=>p7t[e]||-1},{term:146,get:e=>m7t[e]||-1}],tokenPrec:2405});let J3=null;function e4(){if(!J3&&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)));J3=t.sort().map(i=>({type:"property",label:i,apply:i+": "}))}return J3||[]}const Fre=["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})),Bre=["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}))),b7t=["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})),y7t=["@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})),dh=/^(\w[\w-]*|-\w[\w-]*|)$/,v7t=/^-(-[\w-]*)?$/;function x7t(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 Ure=new tH,w7t=["Declaration"];function O7t(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function E6e(e,t,n){if(t.to-t.from>4096){let i=Ure.get(t);if(i)return i;let r=[],s=new Set,a=t.cursor(hr.IncludeAnonymous);if(a.firstChild())do for(let l of E6e(e,a.node,n))s.has(l.label)||(s.add(l.label),r.push(l));while(a.nextSibling());return Ure.set(t,r),r}else{let i=[],r=new Set;return t.cursor().iterate(s=>{var a;if(n(s)&&s.matchContext(w7t)&&((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 k7t=e=>t=>{let{state:n,pos:i}=t,r=Br(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:e4(),validFor:dh};if(r.name=="ValueName")return{from:r.from,options:Bre,validFor:dh};if(r.name=="PseudoClassName")return{from:r.from,options:Fre,validFor:dh};if(e(r)||(t.explicit||s)&&x7t(r,n.doc))return{from:e(r)||s?r.from:i,options:E6e(n.doc,O7t(r),e),validFor:v7t};if(r.name=="TagName"){for(let{parent:c}=r;c;c=c.parent)if(c.name=="Block")return{from:r.from,options:e4(),validFor:dh};return{from:r.from,options:b7t,validFor:dh}}if(r.name=="AtKeyword")return{from:r.from,options:y7t,validFor:dh};if(!t.explicit)return null;let a=r.resolve(i),l=a.childBefore(i);return l&&l.name==":"&&a.name=="PseudoClassSelector"?{from:i,options:Fre,validFor:dh}:l&&l.name==":"&&a.name=="Declaration"||a.name=="ArgList"?{from:i,options:Bre,validFor:dh}:a.name=="Block"||a.name=="Styles"?{from:i,options:e4(),validFor:dh}:null},S7t=k7t(e=>e.name=="VariableName"),QR=yp.define({name:"css",parser:g7t.configure({props:[Rp.add({Declaration:Sx()}),Ip.add({"Block KeyframeList":yT})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function E7t(){return new kg(QR,QR.data.of({autocomplete:S7t}))}const AO=["_blank","_self","_top","_parent"],t4=["ascii","utf-8","utf-16","latin1","latin1"],n4=["get","post","put","delete"],i4=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],jc=["true","false"],Cn={},C7t={a:{attrs:{href:null,ping:null,type:null,media:null,target:AO,hreflang:null}},abbr:Cn,address:Cn,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Cn,aside:Cn,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Cn,base:{attrs:{href:null,target:AO}},bdi:Cn,bdo:Cn,blockquote:{attrs:{cite:null}},body:Cn,br:Cn,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:i4,formmethod:n4,formnovalidate:["novalidate"],formtarget:AO,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Cn,center:Cn,cite:Cn,code:Cn,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:Cn,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Cn,div:Cn,dl:Cn,dt:Cn,em:Cn,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Cn,figure:Cn,footer:Cn,form:{attrs:{action:null,name:null,"accept-charset":t4,autocomplete:["on","off"],enctype:i4,method:n4,novalidate:["novalidate"],target:AO}},h1:Cn,h2:Cn,h3:Cn,h4:Cn,h5:Cn,h6:Cn,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Cn,hgroup:Cn,hr:Cn,html:{attrs:{manifest:null}},i:Cn,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:i4,formmethod:n4,formnovalidate:["novalidate"],formtarget:AO,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:Cn,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Cn,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:Cn,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:t4,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:Cn,noscript:Cn,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:Cn,param:{attrs:{name:null,value:null}},pre:Cn,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Cn,rt:Cn,ruby:Cn,samp:Cn,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:t4}},section:Cn,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Cn,source:{attrs:{src:null,type:null,media:null}},span:Cn,strong:Cn,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Cn,summary:Cn,sup:Cn,table:Cn,tbody:Cn,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Cn,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:Cn,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Cn,time:{attrs:{datetime:null}},title:Cn,tr:Cn,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Cn,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:Cn},C6e={accesskey:null,class:null,contenteditable:jc,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:jc,autocorrect:jc,autocapitalize:jc,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":jc,"aria-autocomplete":["inline","list","both","none"],"aria-busy":jc,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":jc,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":jc,"aria-hidden":jc,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":jc,"aria-multiselectable":jc,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":jc,"aria-relevant":null,"aria-required":jc,"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},T6e="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 T6e)C6e[e]=null;class WE{constructor(t,n){this.tags={...C7t,...t},this.globalAttrs={...C6e,...n},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}WE.default=new WE;function Ew(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 Cw(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function A6e(e,t,n){let i=n.tags[Ew(e,Cw(t))];return(i==null?void 0:i.children)||n.allTags}function HH(e,t){let n=[];for(let i=Cw(t);i&&!i.type.isTop;i=Cw(i.parent)){let r=Ew(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 _6e=/^[:\-\.\w\u00b7-\uffff]*$/;function Qre(e,t,n,i,r){let s=/\s*>/.test(e.sliceDoc(r,r+5))?"":">",a=Cw(n,n.name=="StartTag"||n.name=="TagName");return{from:i,to:r,options:A6e(e.doc,a,t).map(l=>({label:l,type:"type"})).concat(HH(e.doc,n).map((l,c)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function zre(e,t,n,i){let r=/\s*>/.test(e.sliceDoc(i,i+5))?"":">";return{from:n,to:i,options:HH(e.doc,t).map((s,a)=>({label:s,apply:s+r,type:"type",boost:99-a})),validFor:_6e}}function T7t(e,t,n,i){let r=[],s=0;for(let a of A6e(e.doc,n,t))r.push({label:"<"+a,type:"type"});for(let a of HH(e.doc,n))r.push({label:"",type:"type",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function A7t(e,t,n,i,r){let s=Cw(n),a=s?t.tags[Ew(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:_6e}}function _7t(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=Cw(n),h=f?t.tags[Ew(e.doc,f)]:null;d=(h==null?void 0:h.attrs)&&h.attrs[u]}if(d){let f=e.sliceDoc(i,r).toLowerCase(),h='"',m='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",m=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+m,type:"constant"})}}return{from:i,to:r,options:l,validFor:c}}function j6e(e,t){let{state:n,pos:i}=t,r=Br(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.fromj6e(i,r)}const R7t=Lf.parser.configure({top:"SingleExpression"}),N6e=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:$4e.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:F4e.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:B4e.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:R7t},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:Lf.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:QR.parser}],R6e=[{name:"style",parser:QR.parser.configure({top:"Styles"})}].concat(T6e.map(e=>({name:e,parser:Lf.parser}))),I6e=yp.define({name:"html",parser:z9t.configure({props:[Rp.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:"-_"}}),Sj=I6e.configure({wrap:x6e(N6e,R6e)});function I7t(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=x6e((e.nestedLanguages||[]).concat(N6e),(e.nestedAttributes||[]).concat(R6e)));let i=n?I6e.configure({wrap:n,dialect:t}):t?Sj.configure({dialect:t}):Sj;return new kg(i,[Sj.data.of({autocomplete:N7t(e)}),e.autoCloseTags!==!1?P7t:[],DB().support,E7t().support])}const Vre=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),P7t=Zt.inputHandler.of((e,t,n,i,r)=>{if(e.composing||e.state.readOnly||t!=n||i!=">"&&i!="/"||!Sj.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:m}=c,g=Br(a).resolveInner(m,-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=Ew(a.doc,v.parent,m))&&!Vre.has(b)){let y=m+(a.doc.sliceString(m,m+1)===">"?1:0),w=``;return{range:c,changes:{from:m,to:y,insert:w}}}}else if(h&&i=="/"&&g.name=="IncompleteCloseTag"){let v=g.parent;if(g.from==m-2&&((f=v.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(b=Ew(a.doc,v,m))&&!Vre.has(b)){let y=m+(a.doc.sliceString(m,m+1)===">"?1:0),w=`${b}>`;return{range:dt.cursor(m+w.length,-1),changes:{from:m,to:y,insert:w}}}}return{range:c}});return l.changes.empty?!1:(e.dispatch([s,a.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),P6e=LD({commentTokens:{block:{open:""}}}),D6e=new Xn,M6e=HBt.configure({props:[Ip.add(e=>!e.is("Block")||e.is("Document")||QB(e)!=null||D7t(e)?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),D6e.add(QB),Rp.add({Document:()=>null}),Rm.add({Document:P6e})]});function QB(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function D7t(e){return e.name=="OrderedList"||e.name=="BulletList"}function M7t(e,t){let n=e;for(;;){let i=n.nextSibling,r;if(!i||(r=QB(i.type))!=null&&r<=t)break;n=i}return n.to}const L7t=t4e.of((e,t,n)=>{for(let i=Br(e).resolveInner(n,-1);i&&!(i.fromn)return{from:n,to:s}}return null});function qH(e){return new Gc(P6e,e,[],"markdown")}const $7t=qH(M6e),F7t=M6e.configure([n9t,r9t,i9t,s9t,{props:[Ip.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),zR=qH(F7t);function B7t(e,t){return n=>{if(n&&e){let i=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?i=e(n):i=NR.matchLanguageName(e,n,!0),i instanceof NR)return i.support?i.support.language.parser:Dy.getSkippingParser(i.load());if(i)return i.parser}return t?t.parser:null}}let r4=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(+$6e(this.item,t)[2]+n):"";return this.spaceBefore+i+this.type+this.spaceAfter}};function L6e(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 r4(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 r4(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 r4(s.parent,c,c+d,a[1],u,f,s))}}return i}function $6e(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function s4(e,t,n,i=0){for(let r=-1,s=e;;){if(s.name=="ListItem"){let l=$6e(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 WH(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(g1)!=" ")return e;let i=$d(e,4,n),r="";for(let s=i;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+e.slice(n)}const U7t=(e={})=>({state:t,dispatch:n})=>{let i=Br(t),{doc:r}=t,s=null,a=t.changeByRange(l=>{if(!l.empty||!zR.isActiveAt(t,l.from,-1)&&!zR.isActiveAt(t,l.from,1))return s={range:l};let c=l.from,u=r.lineAt(c),d=L6e(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,w=f.node.getChild("ListItem","ListItem");if(y.to>=c||w&&w.to0&&!/[^\s>]/.test(r.lineAt(u.from-1).text)||e.nonTightLists===!1){let x=d.length>1?d[d.length-2]:null,O,S="";x&&x.item?(O=u.from+x.from,S=x.marker(r,1)):O=u.from+(x?x.to:0);let k=[{from:O,to:c,insert:S}];return f.node.name=="OrderedList"&&s4(f.item,r,k,-2),x&&x.node.name=="OrderedList"&&s4(x.item,r,k),{range:dt.cursor(O+S.length),changes:k}}else{let x=qre(d,t,u);return{range:dt.cursor(c+x.length+1),changes:{from:u.from,insert:x+t.lineBreak}}}}if(f.node.name=="Blockquote"&&h&&u.from){let y=r.lineAt(u.from-1),w=/>\s*$/.exec(y.text);if(w&&w.index==f.from){let x=t.changes([{from:y.from+w.index,to:y.to},{from:u.from+f.from,to:u.to}]);return{range:l.map(x),changes:x}}}let m=[];f.node.name=="OrderedList"&&s4(f.item,r,m);let g=f.item&&f.item.from]*/.exec(u.text)[0].length>=f.to)for(let y=0,w=d.length-1;y<=w;y++)b+=y==w&&!g?d[y].marker(r,1):d[y].blank(yu.from&&/\s/.test(u.text.charAt(v-u.from-1));)v--;return b=WH(b,t),z7t(f.node,t.doc)&&(b=qre(d,t,u)+t.lineBreak+b),m.push({from:v,to:c,insert:t.lineBreak+b}),{range:dt.cursor(v+b.length+1),changes:m}});return s?!1:(n(t.update(a,{scrollIntoView:!0,userEvent:"input"})),!0)},Q7t=U7t();function Hre(e){return e.name=="QuoteMark"||e.name=="ListMark"}function z7t(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=Br(e),i=null,r=e.changeByRange(s=>{let a=s.from,{doc:l}=e;if(s.empty&&zR.isActiveAt(e,s.from)){let c=l.lineAt(a),u=L6e(V7t(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:dt.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),!zR.isActiveAt(t.state,i.from,1)))return!1;let s=Br(t.state),a=!1;return s.iterate({from:i.from,to:i.to,enter:l=>{(l.from>i.from||X7t.test(l.name))&&(a=!0)},leave:l=>{l.to=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}const YUt=new Co((e,t)=>{let n;if(e.next<0)e.acceptToken(tUt);else if(t.context.flags&Ej)a4(e.next)&&e.acceptToken(eUt,1);else if(((n=e.peek(-1))<0||a4(n))&&t.canShift(Wre)){let i=0;for(;e.next==KH||e.next==zD;)e.advance(),i++;(e.next==$y||e.next==KE||e.next==GH)&&e.acceptToken(Wre,-i)}else a4(e.next)&&e.acceptToken(J7t,1)},{contextual:!0}),ZUt=new Co((e,t)=>{let n=t.context;if(n.flags)return;let i=e.peek(-1);if(i==$y||i==KE){let r=0,s=0;for(;;){if(e.next==KH)r++;else if(e.next==zD)r+=8-r%8;else break;e.advance(),s++}r!=n.indent&&e.next!=$y&&e.next!=KE&&e.next!=GH&&(r[e,t|q6e])),tQt=new BD({start:JUt,reduce(e,t,n,i){return e.flags&Ej&&XUt.has(t)||(t==yUt||t==z6e)&&e.flags&q6e?e.parent:e},shift(e,t,n,i){return t==B6e?new Cj(e,eQt(i.read(i.pos,n.pos)),0):t==U6e?e.parent:t==rUt||t==lUt||t==dUt||t==Q6e?new Cj(e,0,Ej):Yre.has(t)?new Cj(e,0,Yre.get(t)|e.flags&Ej):e},hash(e){return e.hash}}),nQt=new Co(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==KH||n==zD)){n!=zUt&&n!=VUt&&n!=$y&&n!=KE&&n!=GH&&e.acceptToken(Z7t);return}}}),iQt=new Co((e,t)=>{let{flags:n}=t.context,i=n&yh?H6e:V6e,r=(n&vh)>0,s=!(n&xh),a=(n&wh)>0,l=e.pos;for(;!(e.next<0);)if(a&&e.next==zB)if(e.peek(1)==zB)e.advance(2);else{if(e.pos==l){e.acceptToken(Q6e,1);return}break}else if(s&&e.next==Xre){if(e.pos==l){e.advance();let c=e.next;c>=0&&(e.advance(),rQt(e,c)),e.acceptToken(iUt);return}break}else if(e.next==Xre&&!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(Kre,r?3:1);return}break}else if(e.next==$y){if(r)e.advance();else if(e.pos==l){e.acceptToken(Kre);return}break}else e.advance();e.pos>l&&e.acceptToken(nUt)});function rQt(e,t){if(t==HUt)for(let n=0;n<2&&e.next>=48&&e.next<=55;n++)e.advance();else if(t==qUt)for(let n=0;n<2&&l4(e.next);n++)e.advance();else if(t==KUt)for(let n=0;n<4&&l4(e.next);n++)e.advance();else if(t==GUt)for(let n=0;n<8&&l4(e.next);n++)e.advance();else if(t==WUt&&e.next==zB){for(e.advance();e.next>=0&&e.next!=Gre&&e.next!=V6e&&e.next!=H6e&&e.next!=$y;)e.advance();e.next==Gre&&e.advance()}}const sQt=Np({'async "*" "**" FormatConversion FormatSpec':se.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":se.controlKeyword,"in not and or is del":se.operatorKeyword,"from def class global nonlocal lambda":se.definitionKeyword,import:se.moduleKeyword,"with as print":se.keyword,Boolean:se.bool,None:se.null,VariableName:se.variableName,"CallExpression/VariableName":se.function(se.variableName),"FunctionDefinition/VariableName":se.function(se.definition(se.variableName)),"ClassDefinition/VariableName":se.definition(se.className),PropertyName:se.propertyName,"CallExpression/MemberExpression/PropertyName":se.function(se.propertyName),Comment:se.lineComment,Number:se.number,String:se.string,FormatString:se.special(se.string),Escape:se.escape,UpdateOp:se.updateOperator,"ArithOp!":se.arithmeticOperator,BitOp:se.bitwiseOperator,CompareOp:se.compareOperator,AssignOp:se.definitionOperator,Ellipsis:se.punctuation,At:se.meta,"( )":se.paren,"[ ]":se.squareBracket,"{ }":se.brace,".":se.derefOperator,", ;":se.separator}),oQt={__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},aQt=vp.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:[nQt,ZUt,YUt,iQt,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:e=>oQt[e]||-1}],tokenPrec:7668}),Zre=new tH,W6e=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function V2(e){return(t,n,i)=>{if(i)return!1;let r=t.node.getChild("VariableName");return r&&n(r,e),!0}}const lQt={FunctionDefinition:V2("function"),ClassDefinition:V2("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:V2("variable"),AsPattern:V2("variable"),__proto__:null};function K6e(e,t){let n=Zre.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(hr.IncludeAnonymous).iterate(a=>{if(a.name){let l=lQt[a.name];if(l&&l(a,s,r)||!r&&W6e.has(a.name))return!1;r=!1}else if(a.to-a.from>8192){for(let l of K6e(e,a.node))i.push(l);return!1}}),Zre.set(t,i),i}const Jre=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,G6e=["String","FormatString","Comment","PropertyName"];function cQt(e){let t=Br(e.state).resolveInner(e.pos,-1);if(G6e.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&Jre.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let i=[];for(let r=t;r;r=r.parent)W6e.has(r.name)&&(i=i.concat(K6e(e.state.doc,r)));return{options:i,from:n?t.from:e.pos,validFor:Jre}}const uQt=["__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"}))),dQt=[Qs("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),Qs("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),Qs("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),Qs("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),Qs(`if \${}: -`,{label:"if",detail:"block",type:"keyword"}),Fs("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),Fs("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),Fs("import ${module}",{label:"import",detail:"statement",type:"keyword"}),Fs("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],sQt=g4e(Q6e,AH(iQt.concat(rQt)));function l4(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 c4(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 u4=yp.define({name:"python",parser:eQt.configure({props:[Np.add({Body:e=>{var t;let n=/^\s*(#|$)/.test(e.textAfter)&&l4(e)||e.node;return(t=c4(e,n))!==null&&t!==void 0?t:e.continue()},MatchBody:e=>{var t;let n=l4(e);return(t=c4(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":kx({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":kx({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":kx({closing:"]"}),MemberExpression:e=>e.baseIndent+e.unit,"String FormatString":()=>null,Script:e=>{var t;let n=l4(e);return(t=n&&c4(e,n))!==null&&t!==void 0?t:e.continue()}}),Rp.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":yT,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 oQt(){return new Og(u4,[u4.data.of({autocomplete:nQt}),u4.data.of({autocomplete:sQt})])}const hv=63,ese=64,aQt=1,lQt=2,z6e=3,cQt=4,V6e=5,uQt=6,dQt=7,H6e=65,fQt=66,hQt=8,pQt=9,mQt=10,gQt=11,bQt=12,q6e=13,yQt=19,vQt=20,xQt=29,wQt=33,OQt=34,kQt=47,SQt=0,XH=1,VB=2,GE=3,HB=4;class jb{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}}jb.top=new jb(null,-1,SQt);function bS(e,t){for(let n=0,i=t-e.pos-1;;i--,n++){let r=e.peek(i);if(xp(r)||r==-1)return n}}function qB(e){return e==32||e==9}function xp(e){return e==10||e==13}function W6e(e){return qB(e)||xp(e)}function Vb(e){return e<0||W6e(e)}const EQt=new FD({start:jb.top,reduce(e,t){return e.type==GE&&(t==vQt||t==OQt)?e.parent:e},shift(e,t,n,i){if(t==z6e)return new jb(e,bS(i,i.pos),XH);if(t==H6e||t==V6e)return new jb(e,bS(i,i.pos),VB);if(t==hv)return e.parent;if(t==yQt||t==wQt)return new jb(e,0,GE);if(t==q6e&&e.type==HB)return e.parent;if(t==kQt){let r=/[1-9]/.exec(i.read(i.pos,n.pos));if(r)return new jb(e,e.depth+ +r[0],HB)}return e},hash(e){return e.hash}});function Tw(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&Vb(e.peek(n+3))}const CQt=new ko((e,t)=>{if(e.next==-1&&t.canShift(ese))return e.acceptToken(ese);let n=e.peek(-1);if((xp(n)||n<0)&&t.context.type!=GE){if(Tw(e,45))if(t.canShift(hv))e.acceptToken(hv);else return e.acceptToken(aQt,3);if(Tw(e,46))if(t.canShift(hv))e.acceptToken(hv);else return e.acceptToken(lQt,3);let i=0;for(;e.next==32;)i++,e.advance();(i{if(t.context.type==GE){e.next==63&&(e.advance(),Vb(e.next)&&e.acceptToken(dQt));return}if(e.next==45)e.advance(),Vb(e.next)&&e.acceptToken(t.context.type==XH&&t.context.depth==bS(e,e.pos-1)?cQt:z6e);else if(e.next==63)e.advance(),Vb(e.next)&&e.acceptToken(t.context.type==VB&&t.context.depth==bS(e,e.pos-1)?uQt:V6e);else{let n=e.pos;for(;;)if(qB(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)K6e(e);else if(e.next==38)WB(e);else if(e.next==42){WB(e);break}else if(e.next==39||e.next==34){if(YH(e,!0))break;return}else if(e.next==91||e.next==123){if(!_Qt(e))return;break}else{G6e(e,!0,!1,0);break}for(;qB(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(xQt))return;let i=e.peek(1);Vb(i)&&e.acceptTokenTo(t.context.type==VB&&t.context.depth==bS(e,n)?fQt:H6e,n)}}},{contextual:!0});function AQt(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 tse(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function nse(e,t){return e.next==37?(e.advance(),tse(e.next)&&e.advance(),tse(e.next)&&e.advance(),!0):AQt(e.next)||t&&e.next==44?(e.advance(),!0):!1}function K6e(e){if(e.advance(),e.next==60){for(e.advance();;)if(!nse(e,!0)){e.next==62&&e.advance();break}}else for(;nse(e,!1););}function WB(e){for(e.advance();!Vb(e.next)&&zR(e.next)!="f";)e.advance()}function YH(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(xp(s)){if(t)return!1;i=!0}else if(t&&e.pos>=r+1024)return!1}return!i}function _Qt(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(!YH(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||xp(e.next))return!1;e.advance()}}const jQt="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function zR(e){return e<33?"u":e>125?"s":jQt[e-33]}function d4(e,t){let n=zR(e);return n!="u"&&!(t&&n=="f")}function G6e(e,t,n,i){if(zR(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&d4(e.peek(1),n))e.advance();else return!1;let r=e.pos;for(;;){let s=e.next,a=0,l=i+1;for(;W6e(s);){if(xp(s)){if(t)return!1;l=0}else l++;s=e.peek(++a)}if(!(s>=0&&(s==58?d4(e.peek(a+1),n):s==35?e.peek(a-1)!=32:d4(s,n)))||!n&&l<=i||l==0&&!n&&(Tw(e,45,a)||Tw(e,46,a)))break;if(t&&zR(s)=="f")return!1;for(let u=a;u>=0;u--)e.advance();if(t&&e.pos>r+1024)return!1}return!0}const NQt=new ko((e,t)=>{if(e.next==33)K6e(e),e.acceptToken(bQt);else if(e.next==38||e.next==42){let n=e.next==38?mQt:gQt;WB(e),e.acceptToken(n)}else e.next==39||e.next==34?(YH(e,!1),e.acceptToken(pQt)):G6e(e,!1,t.context.type==GE,t.context.depth)&&e.acceptToken(hQt)}),RQt=new ko((e,t)=>{let n=t.context.type==HB?t.context.depth:-1,i=e.pos;e:for(;;){let r=0,s=e.next;for(;s==32;)s=e.peek(++r);if(!r&&(Tw(e,45,r)||Tw(e,46,r))||!xp(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:EQt,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[IQt],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:[CQt,TQt,NQt,RQt,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),DQt=yp.define({name:"yaml",parser:PQt.configure({props:[Np.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:kx({closing:"}"}),FlowSequence:kx({closing:"]"})}),Rp.add({"FlowMapping FlowSequence":yT,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function MQt(){return new Og(DQt)}function LQt(e){X6e(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=JH(e.state,n.from);return i.line?JQt(e):i.block?tzt(e):!1};function ZH(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 JQt=ZH(rzt,0),ezt=ZH(t$e,0),tzt=ZH((e,t)=>t$e(e,t,izt(t)),0);function JH(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const _O=50;function nzt(e,{open:t,close:n},i,r){let s=e.sliceDoc(i-_O,i),a=e.sliceDoc(r,r+_O),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*_O?d=f=e.sliceDoc(i,r):(d=e.sliceDoc(i,i+_O),f=e.sliceDoc(r-_O,r));let h=/^\s*/.exec(d)[0].length,m=/\s*$/.exec(f)[0].length,g=f.length-m-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-m-n.length,margin:/\s/.test(f.charAt(g-1))?1:0}}:null}function izt(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 t$e(e,t,n=t.selection.ranges){let i=n.map(s=>JH(t,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,a)=>nzt(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,m=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 GB=Xf.define(),szt=Xf.define(),ozt=ln.define(),n$e=ln.define({combine(e){return Yf(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)})}}),i$e=Ka.define({create(){return Af.empty},update(e,t){let n=t.state.facet(n$e),i=t.annotation(GB);if(i){let c=lc.fromTransaction(t,i.selection),u=i.side,d=u==0?e.undone:e.done;return c?d=VR(d,d.length,n.minDepth,c):d=o$e(d,t.startState.selection),new Af(u==0?i.rest:d,u==0?d:i.rest)}let r=t.annotation(szt);if((r=="full"||r=="before")&&(e=e.isolate()),t.annotation(Mo.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let s=lc.fromTransaction(t),a=t.annotation(Mo.time),l=t.annotation(Mo.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 Af(e.done.map(lc.fromJSON),e.undone.map(lc.fromJSON))}});function azt(e={}){return[i$e,n$e.of(e),Gt.domEventHandlers({beforeinput(t,n){let i=t.inputType=="historyUndo"?r$e:t.inputType=="historyRedo"?XB:null;return i?(t.preventDefault(),i(n)):!1}})]}function zD(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(i$e,!1);if(!r)return!1;let s=r.pop(e,n,t);return s?(i(s),!0):!1}}const r$e=zD(0,!1),XB=zD(1,!1),lzt=zD(0,!0),czt=zD(1,!0);class lc{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 lc(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 lc(t.changes&&Zo.fromJSON(t.changes),[],t.mapped&&Df.fromJSON(t.mapped),t.startSelection&&dt.fromJSON(t.startSelection),t.selectionsAfter.map(dt.fromJSON))}static fromTransaction(t,n){let i=Qu;for(let r of t.startState.facet(ozt)){let s=r(t);s.length&&(i=i.concat(s))}return!i.length&&t.changes.empty?null:new lc(t.changes.invert(t.startState.doc),i,void 0,n||t.startState.selection,Qu)}static selection(t){return new lc(void 0,Qu,void 0,void 0,t)}}function VR(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 uzt(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 dzt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,i)=>n.empty!=t.ranges[i].empty).length===0}function s$e(e,t){return e.length?t.length?e.concat(t):e:t}const Qu=[],fzt=200;function o$e(e,t){if(e.length){let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-fzt));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),VR(e,e.length-1,1e9,n.setSelAfter(i)))}else return[lc.selection([t])]}function hzt(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 f4(e,t){if(!e.length)return e;let n=e.length,i=Qu;for(;n;){let r=pzt(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?[lc.selection(i)]:Qu}function pzt(e,t,n){let i=s$e(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):Qu,n);if(!e.changes)return lc.selection(i);let r=e.changes.map(t),s=t.mapDesc(e.changes,!0),a=e.mapped?e.mapped.composeDesc(s):s;return new lc(r,Jn.mapEffects(e.effects,t),a,e.startSelection.map(s),i)}const mzt=/^(input\.type|delete)($|\.)/;class Af{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 Af(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||mzt.test(i))&&(!l.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?e.moveByChar(n,t):VD(n,t))}function pl(e){return e.textDirectionAt(e.state.selection.main.head)==qr.LTR}const l$e=e=>a$e(e,!pl(e)),c$e=e=>a$e(e,pl(e));function u$e(e,t){return Kd(e,n=>n.empty?e.moveByGroup(n,t):VD(n,t))}const bzt=e=>u$e(e,!pl(e)),yzt=e=>u$e(e,pl(e));function vzt(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 HD(e,t,n){let i=Br(e).resolveInner(t.head),r=n?qn.closedBy:qn.openedBy;for(let c=t.head;;){let u=n?i.childAfter(c):i.childBefore(c);if(!u)break;vzt(e,u,r)?i=u:c=n?u.to:u.from}let s=i.type.prop(r),a,l;return s&&(a=n?Tf(e,i.from,1):Tf(e,i.to,-1))&&a.matched?l=n?a.end.to:a.end.from:l=n?i.to:i.from,dt.cursor(l,n?-1:1)}const xzt=e=>Kd(e,t=>HD(e.state,t,!pl(e))),wzt=e=>Kd(e,t=>HD(e.state,t,pl(e)));function d$e(e,t){return Kd(e,n=>{if(!n.empty)return VD(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}const f$e=e=>d$e(e,!1),h$e=e=>d$e(e,!0);function p$e(e){let t=e.scrollDOM.clientHeighta.empty?e.moveVertically(a,t,n.height):VD(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.bottomm$e(e,!1),YB=e=>m$e(e,!0);function Fg(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=dt.cursor(i.from+s))}return r}const Ozt=e=>Kd(e,t=>Fg(e,t,!0)),kzt=e=>Kd(e,t=>Fg(e,t,!1)),Szt=e=>Kd(e,t=>Fg(e,t,!pl(e))),Ezt=e=>Kd(e,t=>Fg(e,t,pl(e))),Czt=e=>Kd(e,t=>dt.cursor(e.lineBlockAt(t.head).from,1)),Tzt=e=>Kd(e,t=>dt.cursor(e.lineBlockAt(t.head).to,-1));function Azt(e,t,n){let i=!1,r=y1(e.selection,s=>{let a=Tf(e,s.head,-1)||Tf(e,s.head,1)||s.head>0&&Tf(e,s.head-1,1)||s.headAzt(e,t);function rd(e,t,n){let i=y1(e.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=t&&(r=dt.range(r.head,r.anchor));let s=n(r);return dt.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(e.state.selection)?!1:(e.dispatch(Wd(e.state,i)),!0)}function g$e(e,t){return rd(e,t,n=>e.moveByChar(n,t))}const b$e=e=>g$e(e,!pl(e)),y$e=e=>g$e(e,pl(e));function v$e(e,t){return rd(e,t,n=>e.moveByGroup(n,t))}const jzt=e=>v$e(e,!pl(e)),Nzt=e=>v$e(e,pl(e)),Rzt=e=>{let t=!pl(e);return rd(e,t,n=>HD(e.state,n,t))},Izt=e=>{let t=pl(e);return rd(e,t,n=>HD(e.state,n,t))};function x$e(e,t){return rd(e,t,n=>e.moveVertically(n,t))}const w$e=e=>x$e(e,!1),O$e=e=>x$e(e,!0);function k$e(e,t){return rd(e,t,n=>e.moveVertically(n,t,p$e(e).height))}const rse=e=>k$e(e,!1),sse=e=>k$e(e,!0),Pzt=e=>rd(e,!0,t=>Fg(e,t,!0)),Dzt=e=>rd(e,!1,t=>Fg(e,t,!1)),Mzt=e=>{let t=!pl(e);return rd(e,t,n=>Fg(e,n,t))},Lzt=e=>{let t=pl(e);return rd(e,t,n=>Fg(e,n,t))},$zt=e=>rd(e,!1,t=>dt.cursor(e.lineBlockAt(t.head).from)),Fzt=e=>rd(e,!0,t=>dt.cursor(e.lineBlockAt(t.head).to)),ose=({state:e,dispatch:t})=>(t(Wd(e,{anchor:0})),!0),ase=({state:e,dispatch:t})=>(t(Wd(e,{anchor:e.doc.length})),!0),lse=({state:e,dispatch:t})=>(t(Wd(e,{anchor:e.selection.main.anchor,head:0})),!0),cse=({state:e,dispatch:t})=>(t(Wd(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Bzt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),Uzt=({state:e,dispatch:t})=>{let n=qD(e).map(({from:i,to:r})=>dt.range(i,Math.min(r+1,e.doc.length)));return t(e.update({selection:dt.create(n),userEvent:"select"})),!0},Qzt=({state:e,dispatch:t})=>{let n=y1(e.selection,i=>{let r=Br(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 dt.range(l.to,l.from)}return i});return n.eq(e.selection)?!1:(t(Wd(e,n)),!0)};function S$e(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(Wd(n,dt.create(r,r.length-1))),!0)}const zzt=e=>S$e(e,!1),Vzt=e=>S$e(e,!0),Hzt=({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=dt.create([n.main]):n.main.empty||(i=dt.create([dt.cursor(n.main.head)])),i?(t(Wd(e,i)),!0):!1};function OT(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=qA(e,c,!0)),a=Math.min(a,c),l=Math.max(l,c)}else a=qA(e,a,!1),l=qA(e,l,!0);return a==l?{range:s}:{changes:{from:a,to:l},range:dt.cursor(a,ar(e)))i.between(t,t,(r,s)=>{rt&&(t=n?s:r)});return t}const E$e=(e,t,n)=>OT(e,i=>{let r=i.from,{state:s}=e,a=s.doc.lineAt(r),l,c;if(n&&!t&&r>a.from&&rE$e(e,!1,!0),C$e=e=>E$e(e,!0,!1),T$e=(e,t)=>OT(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=va(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}),A$e=e=>T$e(e,!1),qzt=e=>T$e(e,!0),Wzt=e=>OT(e,t=>{let n=e.lineBlockAt(t.head).to;return t.headOT(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),Gzt=e=>OT(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:rr.of(["",""])},range:dt.cursor(i.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},Yzt=({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:va(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:va(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:dt.cursor(l)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function qD(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 _$e(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let s of qD(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(dt.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(dt.range(c.anchor-l,c.head-l))}}return i.length?(t(e.update({changes:i,scrollIntoView:!0,selection:dt.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Zzt=({state:e,dispatch:t})=>_$e(e,t,!1),Jzt=({state:e,dispatch:t})=>_$e(e,t,!0);function j$e(e,t,n){if(e.readOnly)return!1;let i=[];for(let s of qD(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 eVt=({state:e,dispatch:t})=>j$e(e,t,!1),tVt=({state:e,dispatch:t})=>j$e(e,t,!0),nVt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(qD(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 iVt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Br(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(qn.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 use=N$e(!1),rVt=N$e(!0);function N$e(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&&iVt(t,s);e&&(s=a=(a<=l.to?l:t.doc.lineAt(a)).to);let u=new LD(t,{simulateBreak:s,simulateDoubleBreak:!!c}),d=OH(u,s);for(d==null&&(d=Ld(/^\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:dt.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const sVt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new LD(e,{overrideIndentation:s=>{let a=n[s];return a??-1}}),r=eq(e,(s,a,l)=>{let c=OH(i,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let u=/^\s*/.exec(s.text)[0],d=FE(e,c);(u!=d||l.frome.readOnly?!1:(t(e.update(eq(e,(n,i)=>{i.push({from:n.from,insert:e.facet(g1)})}),{userEvent:"input.indent"})),!0),I$e=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(eq(e,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=Ld(r,e.tabSize),a=0,l=FE(e,Math.max(0,s-Dy(e)));for(;a(e.setTabFocusMode(),!0),aVt=[{key:"Ctrl-b",run:l$e,shift:b$e,preventDefault:!0},{key:"Ctrl-f",run:c$e,shift:y$e},{key:"Ctrl-p",run:f$e,shift:w$e},{key:"Ctrl-n",run:h$e,shift:O$e},{key:"Ctrl-a",run:Czt,shift:$zt},{key:"Ctrl-e",run:Tzt,shift:Fzt},{key:"Ctrl-d",run:C$e},{key:"Ctrl-h",run:ZB},{key:"Ctrl-k",run:Wzt},{key:"Ctrl-Alt-h",run:A$e},{key:"Ctrl-o",run:Xzt},{key:"Ctrl-t",run:Yzt},{key:"Ctrl-v",run:YB}],lVt=[{key:"ArrowLeft",run:l$e,shift:b$e,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:bzt,shift:jzt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Szt,shift:Mzt,preventDefault:!0},{key:"ArrowRight",run:c$e,shift:y$e,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:yzt,shift:Nzt,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Ezt,shift:Lzt,preventDefault:!0},{key:"ArrowUp",run:f$e,shift:w$e,preventDefault:!0},{mac:"Cmd-ArrowUp",run:ose,shift:lse},{mac:"Ctrl-ArrowUp",run:ise,shift:rse},{key:"ArrowDown",run:h$e,shift:O$e,preventDefault:!0},{mac:"Cmd-ArrowDown",run:ase,shift:cse},{mac:"Ctrl-ArrowDown",run:YB,shift:sse},{key:"PageUp",run:ise,shift:rse},{key:"PageDown",run:YB,shift:sse},{key:"Home",run:kzt,shift:Dzt,preventDefault:!0},{key:"Mod-Home",run:ose,shift:lse},{key:"End",run:Ozt,shift:Pzt,preventDefault:!0},{key:"Mod-End",run:ase,shift:cse},{key:"Enter",run:use,shift:use},{key:"Mod-a",run:Bzt},{key:"Backspace",run:ZB,shift:ZB,preventDefault:!0},{key:"Delete",run:C$e,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:A$e,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:qzt,preventDefault:!0},{mac:"Mod-Backspace",run:Kzt,preventDefault:!0},{mac:"Mod-Delete",run:Gzt,preventDefault:!0}].concat(aVt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),cVt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:xzt,shift:Rzt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:wzt,shift:Izt},{key:"Alt-ArrowUp",run:Zzt},{key:"Shift-Alt-ArrowUp",run:eVt},{key:"Alt-ArrowDown",run:Jzt},{key:"Shift-Alt-ArrowDown",run:tVt},{key:"Mod-Alt-ArrowUp",run:zzt},{key:"Mod-Alt-ArrowDown",run:Vzt},{key:"Escape",run:Hzt},{key:"Mod-Enter",run:rVt},{key:"Alt-l",mac:"Ctrl-l",run:Uzt},{key:"Mod-i",run:Qzt,preventDefault:!0},{key:"Mod-[",run:I$e},{key:"Mod-]",run:R$e},{key:"Mod-Alt-\\",run:sVt},{key:"Shift-Mod-k",run:nVt},{key:"Shift-Mod-\\",run:_zt},{key:"Mod-/",run:ZQt},{key:"Alt-A",run:ezt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:oVt}].concat(lVt),uVt={key:"Tab",run:R$e,shift:I$e},dse=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class Aw{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(dse(l)):dse,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 ec(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=nH(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=bf(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=HR(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 Tx(n,t.sliceString(n,i));return h4.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=HR(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Tx.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(D$e.prototype[Symbol.iterator]=M$e.prototype[Symbol.iterator]=function(){return this});function dVt(e){try{return new RegExp(e,tq),!0}catch{return!1}}function HR(e,t){if(t>=e.length)return t;let n=e.lineAt(t),i;for(;t=56320&&i<57344;)t++;return t}const fVt=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:i,result:r}=k$t(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,m=u?+u:l.number;if(u&&f){let v=m/100;c&&(v=v*(c=="-"?-1:1)+l.number/t.doc.lines),m=Math.round(t.doc.lines*v)}else u&&c&&(m=m*(c=="-"?-1:1)+l.number);let g=t.doc.line(Math.max(1,Math.min(t.doc.lines,m))),b=dt.cursor(g.from+Math.max(0,Math.min(h,g.length)));e.dispatch({effects:[i,Gt.scrollIntoView(b.from,{y:"center"})],selection:b})}),!0},hVt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},pVt=ln.define({combine(e){return Yf(e,hVt,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function mVt(e){return[xVt,vVt]}const gVt=En.mark({class:"cm-selectionMatch"}),bVt=En.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function fse(e,t,n,i){return(n==0||e(t.sliceDoc(n-1,n))!=Ts.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=Ts.Word)}function yVt(e,t,n,i){return e(t.sliceDoc(n,n+1))==Ts.Word&&e(t.sliceDoc(i-1,i))==Ts.Word}const vVt=to.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(pVt),{state:n}=e,i=n.selection;if(i.ranges.length>1)return En.none;let r=i.main,s,a=null;if(r.empty){if(!t.highlightWordAroundCursor)return En.none;let c=n.wordAt(r.head);if(!c)return En.none;a=n.charCategorizer(r.head),s=n.sliceDoc(c.from,c.to)}else{let c=r.to-r.from;if(c200)return En.none;if(t.wholeWords){if(s=n.sliceDoc(r.from,r.to),a=n.charCategorizer(r.head),!(fse(a,n,r.from,r.to)&&yVt(a,n,r.from,r.to)))return En.none}else if(s=n.sliceDoc(r.from,r.to),!s)return En.none}let l=[];for(let c of e.visibleRanges){let u=new Aw(n.doc,s,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!a||fse(a,n,d,f))&&(r.empty&&d<=r.from&&f>=r.to?l.push(bVt.range(d,f)):(d>=r.to||f<=r.from)&&l.push(gVt.range(d,f)),l.length>t.maxMatches))return En.none}}return En.set(l)}},{decorations:e=>e.decorations}),xVt=Gt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),wVt=({state:e,dispatch:t})=>{let{selection:n}=e,i=dt.create(n.ranges.map(r=>e.wordAt(r.head)||dt.cursor(r.head)),n.mainIndex);return i.eq(n)?!1:(t(e.update({selection:i})),!0)};function OVt(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 Aw(e.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(a)return null;l=new Aw(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 kVt=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(s=>s.from===s.to))return wVt({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=OVt(e,i);return r?(t(e.update({selection:e.selection.addRange(dt.range(r.from,r.to),!1),effects:Gt.scrollIntoView(r.to)})),!0):!1},v1=ln.define({combine(e){return Yf(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new LVt(t),scrollToMatch:t=>Gt.scrollIntoView(t)})}});class L$e{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||dVt(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 _Vt(this):new CVt(this)}getCursor(t,n=0,i){let r=t.doc?t:Ui.create({doc:t});return i==null&&(i=r.doc.length),this.regexp?mv(this,r,n,i):pv(this,r,n,i)}}class $$e{constructor(t){this.spec=t}}function SVt(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 pv(e,t,n,i){let r;return e.wholeWord&&(r=EVt(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(r=SVt(e.test,t,r)),new Aw(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:s=>s.toLowerCase(),r)}function EVt(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=pv(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 TVt(e,t,n){return(i,r,s)=>(!n||n(i,r,s))&&e(s[0],t,i,r)}function mv(e,t,n,i){let r;return e.wholeWord&&(r=AVt(t.charCategorizer(t.selection.main.head))),e.test&&(r=TVt(e.test,t,r)),new D$e(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:r},n,i)}function qR(e,t){return e.slice(va(e,t,!1),t)}function WR(e,t){return e.slice(t,va(e,t))}function AVt(e){return(t,n,i)=>!i[0].length||(e(qR(i.input,i.index))!=Ts.Word||e(WR(i.input,i.index))!=Ts.Word)&&(e(WR(i.input,i.index+i[0].length))!=Ts.Word||e(qR(i.input,i.index+i[0].length))!=Ts.Word)}class _Vt extends $$e{nextMatch(t,n,i){let r=mv(this.spec,t,i,t.doc.length).next();return r.done&&(r=mv(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=mv(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=mv(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 XE=Jn.define(),nq=Jn.define(),Gm=Ka.define({create(e){return new p4(JB(e).create(),null)},update(e,t){for(let n of t.effects)n.is(XE)?e=new p4(n.value.create(),e.panel):n.is(nq)&&(e=new p4(e.query,n.value?iq:null));return e},provide:e=>LE.from(e,t=>t.panel)});class p4{constructor(t,n){this.query=t,this.panel=n}}const jVt=En.mark({class:"cm-searchMatch"}),NVt=En.mark({class:"cm-searchMatch cm-searchMatch-selected"}),RVt=to.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Gm))}update(e){let t=e.state.field(Gm);(t!=e.startState.field(Gm)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return En.none;let{view:n}=this,i=new mp;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?NVt:jVt)})}return i.finish()}},{decorations:e=>e.decorations});function kT(e){return t=>{let n=t.state.field(Gm,!1);return n&&n.query.spec.valid?e(t,n):U$e(t)}}const KR=kT((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);if(!i)return!1;let r=dt.single(i.from,i.to),s=e.state.facet(v1);return e.dispatch({selection:r,effects:[rq(e,i),s.scrollToMatch(r.main,e)],userEvent:"select.search"}),B$e(e),!0}),GR=kT((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);if(!r)return!1;let s=dt.single(r.from,r.to),a=e.state.facet(v1);return e.dispatch({selection:s,effects:[rq(e,r),a.scrollToMatch(s.main,e)],userEvent:"select.search"}),B$e(e),!0}),IVt=kT((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:dt.create(n.map(i=>dt.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),PVt=({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 Aw(e.doc,e.sliceDoc(i,r));!l.next().done;){if(s.length>1e3)return!1;l.value.from==i&&(a=s.length),s.push(dt.range(l.value.from,l.value.to))}return t(e.update({selection:dt.create(s,a),userEvent:"select.search.matches"})),!0},hse=kT((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(Gt.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=dt.single(a.from,a.to).map(f),d.push(rq(e,a)),d.push(n.facet(v1).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),DVt=kT((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:Gt.announce.of(i),userEvent:"input.replace.all"}),!0});function iq(e){return e.state.facet(v1).createPanel(e)}function JB(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(v1);return new L$e({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 F$e(e){let t=xH(e,iq);return t&&t.dom.querySelector("[main-field]")}function B$e(e){let t=F$e(e);t&&t==e.root.activeElement&&t.select()}const U$e=e=>{let t=e.state.field(Gm,!1);if(t&&t.panel){let n=F$e(e);if(n&&n!=e.root.activeElement){let i=JB(e.state,t.query.spec);i.valid&&e.dispatch({effects:XE.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[nq.of(!0),t?XE.of(JB(e.state,t.query.spec)):Jn.appendConfig.of(FVt)]});return!0},Q$e=e=>{let t=e.state.field(Gm,!1);if(!t||!t.panel)return!1;let n=xH(e,iq);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:nq.of(!1)}),!0},MVt=[{key:"Mod-f",run:U$e,scope:"editor search-panel"},{key:"F3",run:KR,shift:GR,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:KR,shift:GR,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Q$e,scope:"editor search-panel"},{key:"Mod-Shift-l",run:PVt},{key:"Mod-Alt-g",run:fVt},{key:"Mod-d",run:kVt,preventDefault:!0}];class LVt{constructor(t){this.view=t;let n=this.query=t.state.field(Gm).query.spec;this.commit=this.commit.bind(this),this.searchField=Mr("input",{value:n.search,placeholder:Ic(t,"Find"),"aria-label":Ic(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Mr("input",{value:n.replace,placeholder:Ic(t,"Replace"),"aria-label":Ic(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Mr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Mr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Mr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function i(r,s,a){return Mr("button",{class:"cm-button",name:r,onclick:s,type:"button"},a)}this.dom=Mr("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,i("next",()=>KR(t),[Ic(t,"next")]),i("prev",()=>GR(t),[Ic(t,"previous")]),i("select",()=>IVt(t),[Ic(t,"all")]),Mr("label",null,[this.caseField,Ic(t,"match case")]),Mr("label",null,[this.reField,Ic(t,"regexp")]),Mr("label",null,[this.wordField,Ic(t,"by word")]),...t.state.readOnly?[]:[Mr("br"),this.replaceField,i("replace",()=>hse(t),[Ic(t,"replace")]),i("replaceAll",()=>DVt(t),[Ic(t,"replace all")])],Mr("button",{name:"close",onclick:()=>Q$e(t),"aria-label":Ic(t,"close"),type:"button"},["×"])])}commit(){let t=new L$e({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:XE.of(t)}))}keydown(t){R6t(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?GR:KR)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),hse(this.view))}update(t){for(let n of t.transactions)for(let i of n.effects)i.is(XE)&&!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(v1).top}}function Ic(e,t){return e.state.phrase(t)}const WA=30,KA=/[\s\.,:;?!]/;function rq(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-WA),a=Math.min(r,n+WA),l=e.state.sliceDoc(s,a);if(s!=i.from){for(let c=0;cl.length-WA;c--)if(!KA.test(l[c-1])&&KA.test(l[c])){l=l.slice(0,c);break}}return Gt.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${i.number}.`)}const $Vt=Gt.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"}}),FVt=[Gm,_p.low(RVt),$Vt];class pse{constructor(t,n,i){this.from=t,this.to=n,this.diagnostic=i}}class Nb{constructor(t,n,i){this.diagnostics=t,this.panel=n,this.selected=i}static init(t,n,i){let r=i.facet(YE).markerFilter;r&&(t=r(t,i));let s=t.slice().sort((m,g)=>m.from-g.from||m.to-g.to),a=new mp,l=[],c=0,u=i.doc.iter(),d=0,f=i.doc.length;for(let m=0;;){let g=m==s.length?null:s[m];if(!g&&!l.length)break;let b,v;if(l.length)b=c,v=l.reduce((x,O)=>Math.min(x,O.to),g&&g.from>b?g.from:1e8);else{if(b=g.from,b>f)break;v=g.to,l.push(g),m++}for(;mx.from||x.to==b))l.push(x),m++,v=Math.min(x.to,v);else{v=Math.min(x.from,v);break}}v=Math.min(v,f);let y=!1;if(l.some(x=>x.from==b&&(x.to==v||v==f))&&(y=b==v,!y&&v-b<10)){let x=b-(d+u.value.length);x>0&&(u.next(x),d=b);for(let O=b;;){if(O>=v){y=!0;break}if(!u.lineBreak&&d+u.value.length>O)break;O=d+u.value.length,d+=u.value.length,u.next()}}let w=ZVt(l);if(y)a.add(b,b,En.widget({widget:new KVt(w),diagnostics:l.slice()}));else{let x=l.reduce((O,S)=>S.markClass?O+" "+S.markClass:O,"");a.add(b,v,En.mark({class:"cm-lintRange cm-lintRange-"+w+x,diagnostics:l.slice(),inclusiveEnd:l.some(O=>O.to>v)}))}if(c=v,c==f)break;for(let x=0;x{if(!(t&&a.diagnostics.indexOf(t)<0))if(!i)i=new pse(r,s,t||a.diagnostics[0]);else{if(a.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new pse(i.from,s,i.diagnostic)}}),i}function BVt(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(YE).hideOn(e,n,i);if(r!=null)return r;let s=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(a=>a.is(z$e))||e.changes.touchesRange(s.from,Math.max(s.to,i)))}function UVt(e,t){return e.field(Yc,!1)?t:t.concat(Jn.appendConfig.of(JVt))}const z$e=Jn.define(),sq=Jn.define(),V$e=Jn.define(),Yc=Ka.define({create(){return new Nb(En.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=kg(n,e.selected.diagnostic,s)||kg(n,null,s)}!n.size&&r&&t.state.facet(YE).autoPanel&&(r=null),e=new Nb(n,r,i)}for(let n of t.effects)if(n.is(z$e)){let i=t.state.facet(YE).autoPanel?n.value.length?ZE.open:null:e.panel;e=Nb.init(n.value,i,t.state)}else n.is(sq)?e=new Nb(e.diagnostics,n.value?ZE.open:null,e.selected):n.is(V$e)&&(e=new Nb(e.diagnostics,e.panel,n.value));return e},provide:e=>[LE.from(e,t=>t.panel),Gt.decorations.from(e,t=>t.diagnostics)]}),QVt=En.mark({class:"cm-lintRange cm-lintRange-active"});function zVt(e,t,n){let{diagnostics:i}=e.state.field(Yc),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)&&(tq$e(e,n,!1)))}const HVt=e=>{let t=e.state.field(Yc,!1);(!t||!t.panel)&&e.dispatch({effects:UVt(e.state,[sq.of(!0)])});let n=xH(e,ZE.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},mse=e=>{let t=e.state.field(Yc,!1);return!t||!t.panel?!1:(e.dispatch({effects:sq.of(!1)}),!0)},qVt=e=>{let t=e.state.field(Yc,!1);if(!t)return!1;let n=e.state.selection.main,i=kg(t.diagnostics,null,n.to+1);return!i&&(i=kg(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}),w$t(e,i.from,1,{tooltip:W$e,until:r=>r.docChanged||r.newSelection.main.headi.to}),!0)},WVt=[{key:"Mod-Shift-m",run:HVt,preventDefault:!0},{key:"F8",run:qVt}],YE=ln.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...Yf(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:gse,tooltipFilter:gse,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 gse(e,t){return e?t?(n,i)=>t(e(n,i),i):e:t}function H$e(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 q$e(e,t,n){var i;let r=n?H$e(t.actions):[];return Mr("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Mr("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=m=>{if(m.preventDefault(),l)return;l=!0;let g=kg(e.state.field(Yc).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),Mr("u",u.slice(d,d+1)),u.slice(d+1)],h=s.markClass?" "+s.markClass:"";return Mr("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${r[a]})"`}.`},f)}),t.source&&Mr("div",{class:"cm-diagnosticSource"},t.source))}class KVt extends qd{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Mr("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class bse{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=q$e(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class ZE{constructor(t){this.view=t,this.items=[];let n=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)mse(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=H$e(s.actions);for(let l=0;l{for(let s=0;smse(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Yc).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 m=i;mi&&(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(Yc),i=kg(n.diagnostics,this.items[t].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:V$e.of(i)})}static open(t){return new ZE(t)}}function GVt(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function GA(e){return GVt(``,'width="6" height="3"')}const XVt=Gt.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:GA("#f11")},".cm-lintRange-warning":{backgroundImage:GA("orange")},".cm-lintRange-info":{backgroundImage:GA("#999")},".cm-lintRange-hint":{backgroundImage:GA("#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 YVt(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function ZVt(e){let t="hint",n=1;for(let i of e){let r=YVt(i.severity);r>n&&(n=r,t=i.severity)}return t}const W$e=x$t(zVt,{hideOn:BVt}),JVt=[Yc,Gt.decorations.compute([Yc],e=>{let{selected:t,panel:n}=e.field(Yc);return!t||!n||t.from==t.to?En.none:En.set([QVt.range(t.from,t.to)])}),W$e,XVt];var yse=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(oBt)),t.defaultKeymap!==!1&&(s=s.concat(cVt)),t.searchKeymap!==!1&&(s=s.concat(MVt)),t.historyKeymap!==!1&&(s=s.concat(gzt)),t.foldKeymap!==!1&&(s=s.concat(uFt)),t.completionKeymap!==!1&&(s=s.concat(E4e)),t.lintKeymap!==!1&&(s=s.concat(WVt));var a=[];return t.lineNumbers!==!1&&a.push(Q3e()),t.highlightActiveLineGutter!==!1&&a.push(M$t()),t.highlightSpecialChars!==!1&&a.push(G6t()),t.history!==!1&&a.push(azt()),t.foldGutter!==!1&&a.push(pFt()),t.drawSelection!==!1&&a.push($6t()),t.dropCursor!==!1&&a.push(z6t()),t.allowMultipleSelections!==!1&&a.push(Ui.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&a.push(nFt()),t.syntaxHighlighting!==!1&&a.push(i4e(yFt,{fallback:!0})),t.bracketMatching!==!1&&a.push(EFt()),t.closeBrackets!==!1&&a.push(nBt()),t.autocompletion!==!1&&a.push(hBt()),t.rectangularSelection!==!1&&a.push(c$t()),r!==!1&&a.push(f$t()),t.highlightActiveLine!==!1&&a.push(t$t()),t.highlightSelectionMatches!==!1&&a.push(mVt()),t.tabSize&&typeof t.tabSize=="number"&&a.push(g1.of(" ".repeat(t.tabSize))),a.concat([m1.of(s.flat())]).filter(Boolean)};const eHt="#e5c07b",vse="#e06c75",tHt="#56b6c2",nHt="#ffffff",Aj="#abb2bf",e9="#7d8799",iHt="#61afef",rHt="#98c379",xse="#d19a66",sHt="#c678dd",oHt="#21252b",wse="#2c313a",Ose="#282c34",m4="#353a42",aHt="#3E4451",kse="#528bff",lHt=Gt.theme({"&":{color:Aj,backgroundColor:Ose},".cm-content":{caretColor:kse},".cm-cursor, .cm-dropCursor":{borderLeftColor:kse},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:aHt},".cm-panels":{backgroundColor:oHt,color:Aj},".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:Ose,color:e9,border:"none"},".cm-activeLineGutter":{backgroundColor:wse},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:m4},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:m4,borderBottomColor:m4},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:wse,color:Aj}}},{dark:!0}),cHt=xT.define([{tag:re.keyword,color:sHt},{tag:[re.name,re.deleted,re.character,re.propertyName,re.macroName],color:vse},{tag:[re.function(re.variableName),re.labelName],color:iHt},{tag:[re.color,re.constant(re.name),re.standard(re.name)],color:xse},{tag:[re.definition(re.name),re.separator],color:Aj},{tag:[re.typeName,re.className,re.number,re.changed,re.annotation,re.modifier,re.self,re.namespace],color:eHt},{tag:[re.operator,re.operatorKeyword,re.url,re.escape,re.regexp,re.link,re.special(re.string)],color:tHt},{tag:[re.meta,re.comment],color:e9},{tag:re.strong,fontWeight:"bold"},{tag:re.emphasis,fontStyle:"italic"},{tag:re.strikethrough,textDecoration:"line-through"},{tag:re.link,color:e9,textDecoration:"underline"},{tag:re.heading,fontWeight:"bold",color:vse},{tag:[re.atom,re.bool,re.special(re.variableName)],color:xse},{tag:[re.processingInstruction,re.string,re.inserted],color:rHt},{tag:re.invalid,color:nHt}]),uHt=[lHt,i4e(cHt)];var dHt=Gt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),fHt=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,m=n.basicSetup,g=m===void 0?!0:m,b=[];switch(r&&b.unshift(m1.of([uVt])),g&&(typeof g=="boolean"?b.unshift(yse()):b.unshift(yse(g))),h&&b.unshift(s$t(h)),d){case"light":b.push(dHt);break;case"dark":b.push(uHt);break;case"none":break;default:b.push(d);break}return a===!1&&b.push(Gt.editable.of(!1)),c&&b.push(Ui.readOnly.of(!0)),[...b]},hHt=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 pHt{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 Sse{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 g4=null,mHt=()=>typeof window>"u"?new Sse:(g4||(g4=new Sse),g4),gHt=Gt.theme({"& .cm-scroller":{height:"100% !important"}}),Ese=null,b4=null;function bHt(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===Ese||(Ese=a,b4=Gt.theme({"&":{height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s}})),b4}var Cse=Xf.define(),yHt=200,vHt=[];function xHt(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?vHt:l,u=e.autoFocus,d=e.theme,f=d===void 0?"light":d,h=e.height,m=h===void 0?null:h,g=e.minHeight,b=g===void 0?null:g,v=e.maxHeight,y=v===void 0?null:v,w=e.width,x=w===void 0?null:w,O=e.minWidth,S=O===void 0?null:O,k=e.maxWidth,C=k===void 0?null:k,E=e.placeholder,R=E===void 0?"":E,A=e.editable,j=A===void 0?!0:A,T=e.readOnly,N=T===void 0?!1:T,_=e.indentWithTab,D=_===void 0?!0:_,M=e.basicSetup,P=M===void 0?!0:M,L=e.root,B=e.initialState,I=p.useState(),z=I[0],K=I[1],F=p.useState(),q=F[0],H=F[1],X=p.useState(),ne=X[0],Q=X[1],Z=p.useState(()=>({current:null}))[0],ce=p.useState(()=>({current:null}))[0],Ee=bHt(m,b,y,x,S,C),Y=Gt.updateListener.of(ue=>{if(ue.docChanged&&typeof i=="function"&&!ue.transactions.some(he=>he.annotation(Cse))){Z.current?Z.current.reset():(Z.current=new pHt(()=>{if(ce.current){var he=ce.current;ce.current=null,he()}Z.current=null},yHt),mHt().add(Z.current));var Ce=ue.state.doc,se=Ce.toString();i(se,ue)}r&&r(hHt(ue))}),G=fHt({theme:f,editable:j,readOnly:N,placeholder:R,indentWithTab:D,basicSetup:P}),te=[Y,...Ee?[Ee]:[],gHt,...G];return a&&typeof a=="function"&&te.push(Gt.updateListener.of(a)),te=te.concat(c),p.useLayoutEffect(()=>{if(z&&!ne){var ue={doc:t,selection:n,extensions:te},Ce=B?Ui.fromJSON(B.json,ue,B.fields):Ui.create(ue);if(Q(Ce),!q){var se=new Gt({state:Ce,parent:z,root:L});H(se),s&&s(se,Ce)}}return()=>{q&&(Q(void 0),H(void 0))}},[z,ne]),p.useEffect(()=>{e.container&&K(e.container)},[e.container]),p.useEffect(()=>()=>{q&&(q.destroy(),H(void 0)),Z.current&&(Z.current.cancel(),Z.current=null)},[q]),p.useEffect(()=>{u&&q&&q.focus()},[u,q]),p.useEffect(()=>{q&&q.dispatch({effects:Jn.reconfigure.of(te)})},[f,c,m,b,y,x,S,C,R,j,N,D,P,i,a]),p.useEffect(()=>{if(t!==void 0){var ue=q?q.state.doc.toString():"";if(q&&t!==ue){var Ce=Z.current&&!Z.current.isDone,se=()=>{q&&t!==q.state.doc.toString()&&q.dispatch({changes:{from:0,to:q.state.doc.toString().length,insert:t||""},annotations:[Cse.of(!0)]})};Ce?ce.current=se:se()}}},[t,q]),{state:ne,setState:Q,view:q,setView:H,container:z,setContainer:K}}var wHt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],K$e=p.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,m=e.theme,g=m===void 0?"light":m,b=e.height,v=e.minHeight,y=e.maxHeight,w=e.width,x=e.minWidth,O=e.maxWidth,S=e.basicSetup,k=e.placeholder,C=e.indentWithTab,E=e.editable,R=e.readOnly,A=e.root,j=e.initialState,T=YQt(e,wHt),N=p.useRef(null),_=xHt({root:A,value:r,autoFocus:h,theme:g,height:b,minHeight:v,maxHeight:y,width:w,minWidth:x,maxWidth:O,basicSetup:S,placeholder:k,indentWithTab:C,editable:E,readOnly:R,selection:s,onChange:c,onStatistics:u,onCreateEditor:d,onUpdate:f,extensions:l,initialState:j}),D=_.state,M=_.view,P=_.container,L=_.setContainer;p.useImperativeHandle(t,()=>({editor:N.current,state:D,view:M}),[N,P,D,M]);var B=p.useCallback(z=>{N.current=z,L(z)},[L]);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",KB({ref:B,className:""+I+(n?" "+n:"")},T))});K$e.displayName="CodeMirror";function G$e(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")?[SH.define(XQt)]:i==="py"||i==="pyi"?[oQt()]:["ts","tsx","mts","cts"].includes(i??"")?[DB({typescript:!0,jsx:i==="tsx"})]:["js","jsx","mjs","cjs"].includes(i??"")?[DB({jsx:i==="jsx"})]:i==="json"||i==="jsonc"?[CBt()]:i==="yaml"||i==="yml"?[MQt()]:["md","markdown"].includes(i??"")?[B7t()]:[]}function ST({value:e,path:t,onChange:n,readOnly:i=!1,theme:r="light",lineNumberStart:s=1,height:a="100%",minHeight:l,maxHeight:c,extensions:u}){const d=p.useMemo(()=>[...G$e(t),...s===1?[]:[Q3e({formatNumber:f=>String(f+s-1)})],...u??[]],[s,t,u]);return o.jsx(K$e,{value:e,height:a,minHeight:l,maxHeight:c,theme:r,extensions:d,editable:!i,onChange:n,basicSetup:{lineNumbers:s===1,foldGutter:!0,highlightActiveLine:!0,highlightActiveLineGutter:!0,autocompletion:!1}})}const X$e=Object.freeze(Object.defineProperty({__proto__:null,default:ST,languageFor:G$e},Symbol.toStringTag,{value:"Module"}));function OHt(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=dLe(t.slice(1,n).join(` +`,{label:"if",detail:"block",type:"keyword"}),Qs("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),Qs("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),Qs("import ${module}",{label:"import",detail:"statement",type:"keyword"}),Qs("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],fQt=k4e(G6e,AH(uQt.concat(dQt)));function c4(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 u4(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 d4=yp.define({name:"python",parser:aQt.configure({props:[Rp.add({Body:e=>{var t;let n=/^\s*(#|$)/.test(e.textAfter)&&c4(e)||e.node;return(t=u4(e,n))!==null&&t!==void 0?t:e.continue()},MatchBody:e=>{var t;let n=c4(e);return(t=u4(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":kx({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":kx({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":kx({closing:"]"}),MemberExpression:e=>e.baseIndent+e.unit,"String FormatString":()=>null,Script:e=>{var t;let n=c4(e);return(t=n&&u4(e,n))!==null&&t!==void 0?t:e.continue()}}),Ip.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":yT,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 hQt(){return new kg(d4,[d4.data.of({autocomplete:cQt}),d4.data.of({autocomplete:fQt})])}const hv=63,ese=64,pQt=1,mQt=2,X6e=3,gQt=4,Y6e=5,bQt=6,yQt=7,Z6e=65,vQt=66,xQt=8,wQt=9,OQt=10,kQt=11,SQt=12,J6e=13,EQt=19,CQt=20,TQt=29,AQt=33,_Qt=34,jQt=47,NQt=0,XH=1,VB=2,GE=3,HB=4;class Nb{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}}Nb.top=new Nb(null,-1,NQt);function bS(e,t){for(let n=0,i=t-e.pos-1;;i--,n++){let r=e.peek(i);if(xp(r)||r==-1)return n}}function qB(e){return e==32||e==9}function xp(e){return e==10||e==13}function e$e(e){return qB(e)||xp(e)}function Hb(e){return e<0||e$e(e)}const RQt=new BD({start:Nb.top,reduce(e,t){return e.type==GE&&(t==CQt||t==_Qt)?e.parent:e},shift(e,t,n,i){if(t==X6e)return new Nb(e,bS(i,i.pos),XH);if(t==Z6e||t==Y6e)return new Nb(e,bS(i,i.pos),VB);if(t==hv)return e.parent;if(t==EQt||t==AQt)return new Nb(e,0,GE);if(t==J6e&&e.type==HB)return e.parent;if(t==jQt){let r=/[1-9]/.exec(i.read(i.pos,n.pos));if(r)return new Nb(e,e.depth+ +r[0],HB)}return e},hash(e){return e.hash}});function Tw(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&Hb(e.peek(n+3))}const IQt=new Co((e,t)=>{if(e.next==-1&&t.canShift(ese))return e.acceptToken(ese);let n=e.peek(-1);if((xp(n)||n<0)&&t.context.type!=GE){if(Tw(e,45))if(t.canShift(hv))e.acceptToken(hv);else return e.acceptToken(pQt,3);if(Tw(e,46))if(t.canShift(hv))e.acceptToken(hv);else return e.acceptToken(mQt,3);let i=0;for(;e.next==32;)i++,e.advance();(i{if(t.context.type==GE){e.next==63&&(e.advance(),Hb(e.next)&&e.acceptToken(yQt));return}if(e.next==45)e.advance(),Hb(e.next)&&e.acceptToken(t.context.type==XH&&t.context.depth==bS(e,e.pos-1)?gQt:X6e);else if(e.next==63)e.advance(),Hb(e.next)&&e.acceptToken(t.context.type==VB&&t.context.depth==bS(e,e.pos-1)?bQt:Y6e);else{let n=e.pos;for(;;)if(qB(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)t$e(e);else if(e.next==38)WB(e);else if(e.next==42){WB(e);break}else if(e.next==39||e.next==34){if(YH(e,!0))break;return}else if(e.next==91||e.next==123){if(!MQt(e))return;break}else{n$e(e,!0,!1,0);break}for(;qB(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(TQt))return;let i=e.peek(1);Hb(i)&&e.acceptTokenTo(t.context.type==VB&&t.context.depth==bS(e,n)?vQt:Z6e,n)}}},{contextual:!0});function DQt(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 tse(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function nse(e,t){return e.next==37?(e.advance(),tse(e.next)&&e.advance(),tse(e.next)&&e.advance(),!0):DQt(e.next)||t&&e.next==44?(e.advance(),!0):!1}function t$e(e){if(e.advance(),e.next==60){for(e.advance();;)if(!nse(e,!0)){e.next==62&&e.advance();break}}else for(;nse(e,!1););}function WB(e){for(e.advance();!Hb(e.next)&&VR(e.next)!="f";)e.advance()}function YH(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(xp(s)){if(t)return!1;i=!0}else if(t&&e.pos>=r+1024)return!1}return!i}function MQt(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(!YH(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||xp(e.next))return!1;e.advance()}}const LQt="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function VR(e){return e<33?"u":e>125?"s":LQt[e-33]}function f4(e,t){let n=VR(e);return n!="u"&&!(t&&n=="f")}function n$e(e,t,n,i){if(VR(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&f4(e.peek(1),n))e.advance();else return!1;let r=e.pos;for(;;){let s=e.next,a=0,l=i+1;for(;e$e(s);){if(xp(s)){if(t)return!1;l=0}else l++;s=e.peek(++a)}if(!(s>=0&&(s==58?f4(e.peek(a+1),n):s==35?e.peek(a-1)!=32:f4(s,n)))||!n&&l<=i||l==0&&!n&&(Tw(e,45,a)||Tw(e,46,a)))break;if(t&&VR(s)=="f")return!1;for(let u=a;u>=0;u--)e.advance();if(t&&e.pos>r+1024)return!1}return!0}const $Qt=new Co((e,t)=>{if(e.next==33)t$e(e),e.acceptToken(SQt);else if(e.next==38||e.next==42){let n=e.next==38?OQt:kQt;WB(e),e.acceptToken(n)}else e.next==39||e.next==34?(YH(e,!1),e.acceptToken(wQt)):n$e(e,!1,t.context.type==GE,t.context.depth)&&e.acceptToken(xQt)}),FQt=new Co((e,t)=>{let n=t.context.type==HB?t.context.depth:-1,i=e.pos;e:for(;;){let r=0,s=e.next;for(;s==32;)s=e.peek(++r);if(!r&&(Tw(e,45,r)||Tw(e,46,r))||!xp(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:RQt,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[BQt],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:[IQt,PQt,$Qt,FQt,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),QQt=yp.define({name:"yaml",parser:UQt.configure({props:[Rp.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:kx({closing:"}"}),FlowSequence:kx({closing:"]"})}),Ip.add({"FlowMapping FlowSequence":yT,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function zQt(){return new kg(QQt)}function VQt(e){i$e(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=JH(e.state,n.from);return i.line?ozt(e):i.block?lzt(e):!1};function ZH(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 ozt=ZH(dzt,0),azt=ZH(l$e,0),lzt=ZH((e,t)=>l$e(e,t,uzt(t)),0);function JH(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const _O=50;function czt(e,{open:t,close:n},i,r){let s=e.sliceDoc(i-_O,i),a=e.sliceDoc(r,r+_O),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*_O?d=f=e.sliceDoc(i,r):(d=e.sliceDoc(i,i+_O),f=e.sliceDoc(r-_O,r));let h=/^\s*/.exec(d)[0].length,m=/\s*$/.exec(f)[0].length,g=f.length-m-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-m-n.length,margin:/\s/.test(f.charAt(g-1))?1:0}}:null}function uzt(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 l$e(e,t,n=t.selection.ranges){let i=n.map(s=>JH(t,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,a)=>czt(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,m=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 GB=Xf.define(),fzt=Xf.define(),hzt=un.define(),c$e=un.define({combine(e){return Yf(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)})}}),u$e=Ya.define({create(){return _f.empty},update(e,t){let n=t.state.facet(c$e),i=t.annotation(GB);if(i){let c=cc.fromTransaction(t,i.selection),u=i.side,d=u==0?e.undone:e.done;return c?d=HR(d,d.length,n.minDepth,c):d=h$e(d,t.startState.selection),new _f(u==0?i.rest:d,u==0?d:i.rest)}let r=t.annotation(fzt);if((r=="full"||r=="before")&&(e=e.isolate()),t.annotation(Qo.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let s=cc.fromTransaction(t),a=t.annotation(Qo.time),l=t.annotation(Qo.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 _f(e.done.map(cc.fromJSON),e.undone.map(cc.fromJSON))}});function pzt(e={}){return[u$e,c$e.of(e),Zt.domEventHandlers({beforeinput(t,n){let i=t.inputType=="historyUndo"?d$e:t.inputType=="historyRedo"?XB:null;return i?(t.preventDefault(),i(n)):!1}})]}function VD(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(u$e,!1);if(!r)return!1;let s=r.pop(e,n,t);return s?(i(s),!0):!1}}const d$e=VD(0,!1),XB=VD(1,!1),mzt=VD(0,!0),gzt=VD(1,!0);class cc{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 cc(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 cc(t.changes&&ea.fromJSON(t.changes),[],t.mapped&&Mf.fromJSON(t.mapped),t.startSelection&&dt.fromJSON(t.startSelection),t.selectionsAfter.map(dt.fromJSON))}static fromTransaction(t,n){let i=Uu;for(let r of t.startState.facet(hzt)){let s=r(t);s.length&&(i=i.concat(s))}return!i.length&&t.changes.empty?null:new cc(t.changes.invert(t.startState.doc),i,void 0,n||t.startState.selection,Uu)}static selection(t){return new cc(void 0,Uu,void 0,void 0,t)}}function HR(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 bzt(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 yzt(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,i)=>n.empty!=t.ranges[i].empty).length===0}function f$e(e,t){return e.length?t.length?e.concat(t):e:t}const Uu=[],vzt=200;function h$e(e,t){if(e.length){let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-vzt));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),HR(e,e.length-1,1e9,n.setSelAfter(i)))}else return[cc.selection([t])]}function xzt(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 h4(e,t){if(!e.length)return e;let n=e.length,i=Uu;for(;n;){let r=wzt(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?[cc.selection(i)]:Uu}function wzt(e,t,n){let i=f$e(e.selectionsAfter.length?e.selectionsAfter.map(l=>l.map(t)):Uu,n);if(!e.changes)return cc.selection(i);let r=e.changes.map(t),s=t.mapDesc(e.changes,!0),a=e.mapped?e.mapped.composeDesc(s):s;return new cc(r,Jn.mapEffects(e.effects,t),a,e.startSelection.map(s),i)}const Ozt=/^(input\.type|delete)($|\.)/;class _f{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 _f(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||Ozt.test(i))&&(!l.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?e.moveByChar(n,t):HD(n,t))}function hl(e){return e.textDirectionAt(e.state.selection.main.head)==qr.LTR}const m$e=e=>p$e(e,!hl(e)),g$e=e=>p$e(e,hl(e));function b$e(e,t){return Gd(e,n=>n.empty?e.moveByGroup(n,t):HD(n,t))}const Szt=e=>b$e(e,!hl(e)),Ezt=e=>b$e(e,hl(e));function Czt(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 qD(e,t,n){let i=Br(e).resolveInner(t.head),r=n?Xn.closedBy:Xn.openedBy;for(let c=t.head;;){let u=n?i.childAfter(c):i.childBefore(c);if(!u)break;Czt(e,u,r)?i=u:c=n?u.to:u.from}let s=i.type.prop(r),a,l;return s&&(a=n?Af(e,i.from,1):Af(e,i.to,-1))&&a.matched?l=n?a.end.to:a.end.from:l=n?i.to:i.from,dt.cursor(l,n?-1:1)}const Tzt=e=>Gd(e,t=>qD(e.state,t,!hl(e))),Azt=e=>Gd(e,t=>qD(e.state,t,hl(e)));function y$e(e,t){return Gd(e,n=>{if(!n.empty)return HD(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}const v$e=e=>y$e(e,!1),x$e=e=>y$e(e,!0);function w$e(e){let t=e.scrollDOM.clientHeighta.empty?e.moveVertically(a,t,n.height):HD(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.bottomO$e(e,!1),YB=e=>O$e(e,!0);function Bg(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=dt.cursor(i.from+s))}return r}const _zt=e=>Gd(e,t=>Bg(e,t,!0)),jzt=e=>Gd(e,t=>Bg(e,t,!1)),Nzt=e=>Gd(e,t=>Bg(e,t,!hl(e))),Rzt=e=>Gd(e,t=>Bg(e,t,hl(e))),Izt=e=>Gd(e,t=>dt.cursor(e.lineBlockAt(t.head).from,1)),Pzt=e=>Gd(e,t=>dt.cursor(e.lineBlockAt(t.head).to,-1));function Dzt(e,t,n){let i=!1,r=y1(e.selection,s=>{let a=Af(e,s.head,-1)||Af(e,s.head,1)||s.head>0&&Af(e,s.head-1,1)||s.headDzt(e,t);function id(e,t,n){let i=y1(e.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=t&&(r=dt.range(r.head,r.anchor));let s=n(r);return dt.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(e.state.selection)?!1:(e.dispatch(Kd(e.state,i)),!0)}function k$e(e,t){return id(e,t,n=>e.moveByChar(n,t))}const S$e=e=>k$e(e,!hl(e)),E$e=e=>k$e(e,hl(e));function C$e(e,t){return id(e,t,n=>e.moveByGroup(n,t))}const Lzt=e=>C$e(e,!hl(e)),$zt=e=>C$e(e,hl(e)),Fzt=e=>{let t=!hl(e);return id(e,t,n=>qD(e.state,n,t))},Bzt=e=>{let t=hl(e);return id(e,t,n=>qD(e.state,n,t))};function T$e(e,t){return id(e,t,n=>e.moveVertically(n,t))}const A$e=e=>T$e(e,!1),_$e=e=>T$e(e,!0);function j$e(e,t){return id(e,t,n=>e.moveVertically(n,t,w$e(e).height))}const rse=e=>j$e(e,!1),sse=e=>j$e(e,!0),Uzt=e=>id(e,!0,t=>Bg(e,t,!0)),Qzt=e=>id(e,!1,t=>Bg(e,t,!1)),zzt=e=>{let t=!hl(e);return id(e,t,n=>Bg(e,n,t))},Vzt=e=>{let t=hl(e);return id(e,t,n=>Bg(e,n,t))},Hzt=e=>id(e,!1,t=>dt.cursor(e.lineBlockAt(t.head).from)),qzt=e=>id(e,!0,t=>dt.cursor(e.lineBlockAt(t.head).to)),ose=({state:e,dispatch:t})=>(t(Kd(e,{anchor:0})),!0),ase=({state:e,dispatch:t})=>(t(Kd(e,{anchor:e.doc.length})),!0),lse=({state:e,dispatch:t})=>(t(Kd(e,{anchor:e.selection.main.anchor,head:0})),!0),cse=({state:e,dispatch:t})=>(t(Kd(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Wzt=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),Kzt=({state:e,dispatch:t})=>{let n=WD(e).map(({from:i,to:r})=>dt.range(i,Math.min(r+1,e.doc.length)));return t(e.update({selection:dt.create(n),userEvent:"select"})),!0},Gzt=({state:e,dispatch:t})=>{let n=y1(e.selection,i=>{let r=Br(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 dt.range(l.to,l.from)}return i});return n.eq(e.selection)?!1:(t(Kd(e,n)),!0)};function N$e(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(Kd(n,dt.create(r,r.length-1))),!0)}const Xzt=e=>N$e(e,!1),Yzt=e=>N$e(e,!0),Zzt=({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=dt.create([n.main]):n.main.empty||(i=dt.create([dt.cursor(n.main.head)])),i?(t(Kd(e,i)),!0):!1};function OT(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:dt.cursor(a,ar(e)))i.between(t,t,(r,s)=>{rt&&(t=n?s:r)});return t}const R$e=(e,t,n)=>OT(e,i=>{let r=i.from,{state:s}=e,a=s.doc.lineAt(r),l,c;if(n&&!t&&r>a.from&&rR$e(e,!1,!0),I$e=e=>R$e(e,!0,!1),P$e=(e,t)=>OT(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=Sa(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}),D$e=e=>P$e(e,!1),Jzt=e=>P$e(e,!0),eVt=e=>OT(e,t=>{let n=e.lineBlockAt(t.head).to;return t.headOT(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),nVt=e=>OT(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:cr.of(["",""])},range:dt.cursor(i.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},rVt=({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:Sa(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:Sa(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:dt.cursor(l)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function WD(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 M$e(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let s of WD(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(dt.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(dt.range(c.anchor-l,c.head-l))}}return i.length?(t(e.update({changes:i,scrollIntoView:!0,selection:dt.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const sVt=({state:e,dispatch:t})=>M$e(e,t,!1),oVt=({state:e,dispatch:t})=>M$e(e,t,!0);function L$e(e,t,n){if(e.readOnly)return!1;let i=[];for(let s of WD(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 aVt=({state:e,dispatch:t})=>L$e(e,t,!1),lVt=({state:e,dispatch:t})=>L$e(e,t,!0),cVt=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(WD(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 uVt(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Br(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(Xn.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 use=$$e(!1),dVt=$$e(!0);function $$e(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&&uVt(t,s);e&&(s=a=(a<=l.to?l:t.doc.lineAt(a)).to);let u=new $D(t,{simulateBreak:s,simulateDoubleBreak:!!c}),d=OH(u,s);for(d==null&&(d=$d(/^\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:dt.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const fVt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new $D(e,{overrideIndentation:s=>{let a=n[s];return a??-1}}),r=eq(e,(s,a,l)=>{let c=OH(i,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let u=/^\s*/.exec(s.text)[0],d=FE(e,c);(u!=d||l.frome.readOnly?!1:(t(e.update(eq(e,(n,i)=>{i.push({from:n.from,insert:e.facet(g1)})}),{userEvent:"input.indent"})),!0),B$e=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(eq(e,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=$d(r,e.tabSize),a=0,l=FE(e,Math.max(0,s-My(e)));for(;a(e.setTabFocusMode(),!0),pVt=[{key:"Ctrl-b",run:m$e,shift:S$e,preventDefault:!0},{key:"Ctrl-f",run:g$e,shift:E$e},{key:"Ctrl-p",run:v$e,shift:A$e},{key:"Ctrl-n",run:x$e,shift:_$e},{key:"Ctrl-a",run:Izt,shift:Hzt},{key:"Ctrl-e",run:Pzt,shift:qzt},{key:"Ctrl-d",run:I$e},{key:"Ctrl-h",run:ZB},{key:"Ctrl-k",run:eVt},{key:"Ctrl-Alt-h",run:D$e},{key:"Ctrl-o",run:iVt},{key:"Ctrl-t",run:rVt},{key:"Ctrl-v",run:YB}],mVt=[{key:"ArrowLeft",run:m$e,shift:S$e,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Szt,shift:Lzt,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Nzt,shift:zzt,preventDefault:!0},{key:"ArrowRight",run:g$e,shift:E$e,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Ezt,shift:$zt,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Rzt,shift:Vzt,preventDefault:!0},{key:"ArrowUp",run:v$e,shift:A$e,preventDefault:!0},{mac:"Cmd-ArrowUp",run:ose,shift:lse},{mac:"Ctrl-ArrowUp",run:ise,shift:rse},{key:"ArrowDown",run:x$e,shift:_$e,preventDefault:!0},{mac:"Cmd-ArrowDown",run:ase,shift:cse},{mac:"Ctrl-ArrowDown",run:YB,shift:sse},{key:"PageUp",run:ise,shift:rse},{key:"PageDown",run:YB,shift:sse},{key:"Home",run:jzt,shift:Qzt,preventDefault:!0},{key:"Mod-Home",run:ose,shift:lse},{key:"End",run:_zt,shift:Uzt,preventDefault:!0},{key:"Mod-End",run:ase,shift:cse},{key:"Enter",run:use,shift:use},{key:"Mod-a",run:Wzt},{key:"Backspace",run:ZB,shift:ZB,preventDefault:!0},{key:"Delete",run:I$e,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:D$e,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Jzt,preventDefault:!0},{mac:"Mod-Backspace",run:tVt,preventDefault:!0},{mac:"Mod-Delete",run:nVt,preventDefault:!0}].concat(pVt.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),gVt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Tzt,shift:Fzt},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Azt,shift:Bzt},{key:"Alt-ArrowUp",run:sVt},{key:"Shift-Alt-ArrowUp",run:aVt},{key:"Alt-ArrowDown",run:oVt},{key:"Shift-Alt-ArrowDown",run:lVt},{key:"Mod-Alt-ArrowUp",run:Xzt},{key:"Mod-Alt-ArrowDown",run:Yzt},{key:"Escape",run:Zzt},{key:"Mod-Enter",run:dVt},{key:"Alt-l",mac:"Ctrl-l",run:Kzt},{key:"Mod-i",run:Gzt,preventDefault:!0},{key:"Mod-[",run:B$e},{key:"Mod-]",run:F$e},{key:"Mod-Alt-\\",run:fVt},{key:"Shift-Mod-k",run:cVt},{key:"Shift-Mod-\\",run:Mzt},{key:"Mod-/",run:szt},{key:"Alt-A",run:azt},{key:"Ctrl-m",mac:"Shift-Alt-m",run:hVt}].concat(mVt),bVt={key:"Tab",run:F$e,shift:B$e},dse=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class Aw{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(dse(l)):dse,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 tc(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=nH(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=yf(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=qR(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 Tx(n,t.sliceString(n,i));return p4.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=qR(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Tx.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Q$e.prototype[Symbol.iterator]=z$e.prototype[Symbol.iterator]=function(){return this});function yVt(e){try{return new RegExp(e,tq),!0}catch{return!1}}function qR(e,t){if(t>=e.length)return t;let n=e.lineAt(t),i;for(;t=56320&&i<57344;)t++;return t}const vVt=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:i,result:r}=j$t(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,m=u?+u:l.number;if(u&&f){let v=m/100;c&&(v=v*(c=="-"?-1:1)+l.number/t.doc.lines),m=Math.round(t.doc.lines*v)}else u&&c&&(m=m*(c=="-"?-1:1)+l.number);let g=t.doc.line(Math.max(1,Math.min(t.doc.lines,m))),b=dt.cursor(g.from+Math.max(0,Math.min(h,g.length)));e.dispatch({effects:[i,Zt.scrollIntoView(b.from,{y:"center"})],selection:b})}),!0},xVt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},wVt=un.define({combine(e){return Yf(e,xVt,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function OVt(e){return[TVt,CVt]}const kVt=Tn.mark({class:"cm-selectionMatch"}),SVt=Tn.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function fse(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 EVt(e,t,n,i){return e(t.sliceDoc(n,n+1))==Ns.Word&&e(t.sliceDoc(i-1,i))==Ns.Word}const CVt=ro.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(wVt),{state:n}=e,i=n.selection;if(i.ranges.length>1)return Tn.none;let r=i.main,s,a=null;if(r.empty){if(!t.highlightWordAroundCursor)return Tn.none;let c=n.wordAt(r.head);if(!c)return Tn.none;a=n.charCategorizer(r.head),s=n.sliceDoc(c.from,c.to)}else{let c=r.to-r.from;if(c200)return Tn.none;if(t.wholeWords){if(s=n.sliceDoc(r.from,r.to),a=n.charCategorizer(r.head),!(fse(a,n,r.from,r.to)&&EVt(a,n,r.from,r.to)))return Tn.none}else if(s=n.sliceDoc(r.from,r.to),!s)return Tn.none}let l=[];for(let c of e.visibleRanges){let u=new Aw(n.doc,s,c.from,c.to);for(;!u.next().done;){let{from:d,to:f}=u.value;if((!a||fse(a,n,d,f))&&(r.empty&&d<=r.from&&f>=r.to?l.push(SVt.range(d,f)):(d>=r.to||f<=r.from)&&l.push(kVt.range(d,f)),l.length>t.maxMatches))return Tn.none}}return Tn.set(l)}},{decorations:e=>e.decorations}),TVt=Zt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),AVt=({state:e,dispatch:t})=>{let{selection:n}=e,i=dt.create(n.ranges.map(r=>e.wordAt(r.head)||dt.cursor(r.head)),n.mainIndex);return i.eq(n)?!1:(t(e.update({selection:i})),!0)};function _Vt(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 Aw(e.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(a)return null;l=new Aw(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 jVt=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(s=>s.from===s.to))return AVt({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=_Vt(e,i);return r?(t(e.update({selection:e.selection.addRange(dt.range(r.from,r.to),!1),effects:Zt.scrollIntoView(r.to)})),!0):!1},v1=un.define({combine(e){return Yf(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new VVt(t),scrollToMatch:t=>Zt.scrollIntoView(t)})}});class V$e{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||yVt(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 MVt(this):new IVt(this)}getCursor(t,n=0,i){let r=t.doc?t:qi.create({doc:t});return i==null&&(i=r.doc.length),this.regexp?mv(this,r,n,i):pv(this,r,n,i)}}class H$e{constructor(t){this.spec=t}}function NVt(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 pv(e,t,n,i){let r;return e.wholeWord&&(r=RVt(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(r=NVt(e.test,t,r)),new Aw(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:s=>s.toLowerCase(),r)}function RVt(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=pv(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 PVt(e,t,n){return(i,r,s)=>(!n||n(i,r,s))&&e(s[0],t,i,r)}function mv(e,t,n,i){let r;return e.wholeWord&&(r=DVt(t.charCategorizer(t.selection.main.head))),e.test&&(r=PVt(e.test,t,r)),new Q$e(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:r},n,i)}function WR(e,t){return e.slice(Sa(e,t,!1),t)}function KR(e,t){return e.slice(t,Sa(e,t))}function DVt(e){return(t,n,i)=>!i[0].length||(e(WR(i.input,i.index))!=Ns.Word||e(KR(i.input,i.index))!=Ns.Word)&&(e(KR(i.input,i.index+i[0].length))!=Ns.Word||e(WR(i.input,i.index+i[0].length))!=Ns.Word)}class MVt extends H$e{nextMatch(t,n,i){let r=mv(this.spec,t,i,t.doc.length).next();return r.done&&(r=mv(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=mv(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=mv(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 XE=Jn.define(),nq=Jn.define(),Xm=Ya.define({create(e){return new m4(JB(e).create(),null)},update(e,t){for(let n of t.effects)n.is(XE)?e=new m4(n.value.create(),e.panel):n.is(nq)&&(e=new m4(e.query,n.value?iq:null));return e},provide:e=>LE.from(e,t=>t.panel)});class m4{constructor(t,n){this.query=t,this.panel=n}}const LVt=Tn.mark({class:"cm-searchMatch"}),$Vt=Tn.mark({class:"cm-searchMatch cm-searchMatch-selected"}),FVt=ro.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Xm))}update(e){let t=e.state.field(Xm);(t!=e.startState.field(Xm)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Tn.none;let{view:n}=this,i=new mp;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?$Vt:LVt)})}return i.finish()}},{decorations:e=>e.decorations});function kT(e){return t=>{let n=t.state.field(Xm,!1);return n&&n.query.spec.valid?e(t,n):K$e(t)}}const GR=kT((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);if(!i)return!1;let r=dt.single(i.from,i.to),s=e.state.facet(v1);return e.dispatch({selection:r,effects:[rq(e,i),s.scrollToMatch(r.main,e)],userEvent:"select.search"}),W$e(e),!0}),XR=kT((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);if(!r)return!1;let s=dt.single(r.from,r.to),a=e.state.facet(v1);return e.dispatch({selection:s,effects:[rq(e,r),a.scrollToMatch(s.main,e)],userEvent:"select.search"}),W$e(e),!0}),BVt=kT((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:dt.create(n.map(i=>dt.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),UVt=({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 Aw(e.doc,e.sliceDoc(i,r));!l.next().done;){if(s.length>1e3)return!1;l.value.from==i&&(a=s.length),s.push(dt.range(l.value.from,l.value.to))}return t(e.update({selection:dt.create(s,a),userEvent:"select.search.matches"})),!0},hse=kT((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=dt.single(a.from,a.to).map(f),d.push(rq(e,a)),d.push(n.facet(v1).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:"input.replace"}),!0}),QVt=kT((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 iq(e){return e.state.facet(v1).createPanel(e)}function JB(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(v1);return new V$e({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 q$e(e){let t=xH(e,iq);return t&&t.dom.querySelector("[main-field]")}function W$e(e){let t=q$e(e);t&&t==e.root.activeElement&&t.select()}const K$e=e=>{let t=e.state.field(Xm,!1);if(t&&t.panel){let n=q$e(e);if(n&&n!=e.root.activeElement){let i=JB(e.state,t.query.spec);i.valid&&e.dispatch({effects:XE.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[nq.of(!0),t?XE.of(JB(e.state,t.query.spec)):Jn.appendConfig.of(qVt)]});return!0},G$e=e=>{let t=e.state.field(Xm,!1);if(!t||!t.panel)return!1;let n=xH(e,iq);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:nq.of(!1)}),!0},zVt=[{key:"Mod-f",run:K$e,scope:"editor search-panel"},{key:"F3",run:GR,shift:XR,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:GR,shift:XR,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:G$e,scope:"editor search-panel"},{key:"Mod-Shift-l",run:UVt},{key:"Mod-Alt-g",run:vVt},{key:"Mod-d",run:jVt,preventDefault:!0}];class VVt{constructor(t){this.view=t;let n=this.query=t.state.field(Xm).query.spec;this.commit=this.commit.bind(this),this.searchField=Mr("input",{value:n.search,placeholder:Nc(t,"Find"),"aria-label":Nc(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Mr("input",{value:n.replace,placeholder:Nc(t,"Replace"),"aria-label":Nc(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Mr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Mr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Mr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function i(r,s,a){return Mr("button",{class:"cm-button",name:r,onclick:s,type:"button"},a)}this.dom=Mr("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,i("next",()=>GR(t),[Nc(t,"next")]),i("prev",()=>XR(t),[Nc(t,"previous")]),i("select",()=>BVt(t),[Nc(t,"all")]),Mr("label",null,[this.caseField,Nc(t,"match case")]),Mr("label",null,[this.reField,Nc(t,"regexp")]),Mr("label",null,[this.wordField,Nc(t,"by word")]),...t.state.readOnly?[]:[Mr("br"),this.replaceField,i("replace",()=>hse(t),[Nc(t,"replace")]),i("replaceAll",()=>QVt(t),[Nc(t,"replace all")])],Mr("button",{name:"close",onclick:()=>G$e(t),"aria-label":Nc(t,"close"),type:"button"},["×"])])}commit(){let t=new V$e({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:XE.of(t)}))}keydown(t){F6t(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?XR:GR)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),hse(this.view))}update(t){for(let n of t.transactions)for(let i of n.effects)i.is(XE)&&!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(v1).top}}function Nc(e,t){return e.state.phrase(t)}const q2=30,W2=/[\s\.,:;?!]/;function rq(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-q2),a=Math.min(r,n+q2),l=e.state.sliceDoc(s,a);if(s!=i.from){for(let c=0;cl.length-q2;c--)if(!W2.test(l[c-1])&&W2.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 HVt=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"}}),qVt=[Xm,jp.low(FVt),HVt];class pse{constructor(t,n,i){this.from=t,this.to=n,this.diagnostic=i}}class Rb{constructor(t,n,i){this.diagnostics=t,this.panel=n,this.selected=i}static init(t,n,i){let r=i.facet(YE).markerFilter;r&&(t=r(t,i));let s=t.slice().sort((m,g)=>m.from-g.from||m.to-g.to),a=new mp,l=[],c=0,u=i.doc.iter(),d=0,f=i.doc.length;for(let m=0;;){let g=m==s.length?null:s[m];if(!g&&!l.length)break;let b,v;if(l.length)b=c,v=l.reduce((x,O)=>Math.min(x,O.to),g&&g.from>b?g.from:1e8);else{if(b=g.from,b>f)break;v=g.to,l.push(g),m++}for(;mx.from||x.to==b))l.push(x),m++,v=Math.min(x.to,v);else{v=Math.min(x.from,v);break}}v=Math.min(v,f);let y=!1;if(l.some(x=>x.from==b&&(x.to==v||v==f))&&(y=b==v,!y&&v-b<10)){let x=b-(d+u.value.length);x>0&&(u.next(x),d=b);for(let O=b;;){if(O>=v){y=!0;break}if(!u.lineBreak&&d+u.value.length>O)break;O=d+u.value.length,d+=u.value.length,u.next()}}let w=sHt(l);if(y)a.add(b,b,Tn.widget({widget:new tHt(w),diagnostics:l.slice()}));else{let x=l.reduce((O,S)=>S.markClass?O+" "+S.markClass:O,"");a.add(b,v,Tn.mark({class:"cm-lintRange cm-lintRange-"+w+x,diagnostics:l.slice(),inclusiveEnd:l.some(O=>O.to>v)}))}if(c=v,c==f)break;for(let x=0;x{if(!(t&&a.diagnostics.indexOf(t)<0))if(!i)i=new pse(r,s,t||a.diagnostics[0]);else{if(a.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new pse(i.from,s,i.diagnostic)}}),i}function WVt(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(YE).hideOn(e,n,i);if(r!=null)return r;let s=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(a=>a.is(X$e))||e.changes.touchesRange(s.from,Math.max(s.to,i)))}function KVt(e,t){return e.field(Xc,!1)?t:t.concat(Jn.appendConfig.of(oHt))}const X$e=Jn.define(),sq=Jn.define(),Y$e=Jn.define(),Xc=Ya.define({create(){return new Rb(Tn.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=Sg(n,e.selected.diagnostic,s)||Sg(n,null,s)}!n.size&&r&&t.state.facet(YE).autoPanel&&(r=null),e=new Rb(n,r,i)}for(let n of t.effects)if(n.is(X$e)){let i=t.state.facet(YE).autoPanel?n.value.length?ZE.open:null:e.panel;e=Rb.init(n.value,i,t.state)}else n.is(sq)?e=new Rb(e.diagnostics,n.value?ZE.open:null,e.selected):n.is(Y$e)&&(e=new Rb(e.diagnostics,e.panel,n.value));return e},provide:e=>[LE.from(e,t=>t.panel),Zt.decorations.from(e,t=>t.diagnostics)]}),GVt=Tn.mark({class:"cm-lintRange cm-lintRange-active"});function XVt(e,t,n){let{diagnostics:i}=e.state.field(Xc),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)&&(tJ$e(e,n,!1)))}const ZVt=e=>{let t=e.state.field(Xc,!1);(!t||!t.panel)&&e.dispatch({effects:KVt(e.state,[sq.of(!0)])});let n=xH(e,ZE.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},mse=e=>{let t=e.state.field(Xc,!1);return!t||!t.panel?!1:(e.dispatch({effects:sq.of(!1)}),!0)},JVt=e=>{let t=e.state.field(Xc,!1);if(!t)return!1;let n=e.state.selection.main,i=Sg(t.diagnostics,null,n.to+1);return!i&&(i=Sg(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}),A$t(e,i.from,1,{tooltip:eFe,until:r=>r.docChanged||r.newSelection.main.headi.to}),!0)},eHt=[{key:"Mod-Shift-m",run:ZVt,preventDefault:!0},{key:"F8",run:JVt}],YE=un.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...Yf(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:gse,tooltipFilter:gse,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 gse(e,t){return e?t?(n,i)=>t(e(n,i),i):e:t}function Z$e(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 J$e(e,t,n){var i;let r=n?Z$e(t.actions):[];return Mr("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Mr("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=m=>{if(m.preventDefault(),l)return;l=!0;let g=Sg(e.state.field(Xc).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),Mr("u",u.slice(d,d+1)),u.slice(d+1)],h=s.markClass?" "+s.markClass:"";return Mr("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${r[a]})"`}.`},f)}),t.source&&Mr("div",{class:"cm-diagnosticSource"},t.source))}class tHt extends Wd{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Mr("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class bse{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=J$e(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class ZE{constructor(t){this.view=t,this.items=[];let n=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)mse(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=Z$e(s.actions);for(let l=0;l{for(let s=0;smse(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Xc).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 m=i;mi&&(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(Xc),i=Sg(n.diagnostics,this.items[t].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:Y$e.of(i)})}static open(t){return new ZE(t)}}function nHt(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function K2(e){return nHt(``,'width="6" height="3"')}const iHt=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:K2("#f11")},".cm-lintRange-warning":{backgroundImage:K2("orange")},".cm-lintRange-info":{backgroundImage:K2("#999")},".cm-lintRange-hint":{backgroundImage:K2("#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 rHt(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function sHt(e){let t="hint",n=1;for(let i of e){let r=rHt(i.severity);r>n&&(n=r,t=i.severity)}return t}const eFe=T$t(XVt,{hideOn:WVt}),oHt=[Xc,Zt.decorations.compute([Xc],e=>{let{selected:t,panel:n}=e.field(Xc);return!t||!n||t.from==t.to?Tn.none:Tn.set([GVt.range(t.from,t.to)])}),eFe,iHt];var yse=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(hBt)),t.defaultKeymap!==!1&&(s=s.concat(gVt)),t.searchKeymap!==!1&&(s=s.concat(zVt)),t.historyKeymap!==!1&&(s=s.concat(kzt)),t.foldKeymap!==!1&&(s=s.concat(bFt)),t.completionKeymap!==!1&&(s=s.concat(R4e)),t.lintKeymap!==!1&&(s=s.concat(eHt));var a=[];return t.lineNumbers!==!1&&a.push(G3e()),t.highlightActiveLineGutter!==!1&&a.push(z$t()),t.highlightSpecialChars!==!1&&a.push(n$t()),t.history!==!1&&a.push(pzt()),t.foldGutter!==!1&&a.push(wFt()),t.drawSelection!==!1&&a.push(H6t()),t.dropCursor!==!1&&a.push(X6t()),t.allowMultipleSelections!==!1&&a.push(qi.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&a.push(cFt()),t.syntaxHighlighting!==!1&&a.push(u4e(EFt,{fallback:!0})),t.bracketMatching!==!1&&a.push(RFt()),t.closeBrackets!==!1&&a.push(cBt()),t.autocompletion!==!1&&a.push(xBt()),t.rectangularSelection!==!1&&a.push(g$t()),r!==!1&&a.push(v$t()),t.highlightActiveLine!==!1&&a.push(l$t()),t.highlightSelectionMatches!==!1&&a.push(OVt()),t.tabSize&&typeof t.tabSize=="number"&&a.push(g1.of(" ".repeat(t.tabSize))),a.concat([m1.of(s.flat())]).filter(Boolean)};const aHt="#e5c07b",vse="#e06c75",lHt="#56b6c2",cHt="#ffffff",Tj="#abb2bf",e9="#7d8799",uHt="#61afef",dHt="#98c379",xse="#d19a66",fHt="#c678dd",hHt="#21252b",wse="#2c313a",Ose="#282c34",g4="#353a42",pHt="#3E4451",kse="#528bff",mHt=Zt.theme({"&":{color:Tj,backgroundColor:Ose},".cm-content":{caretColor:kse},".cm-cursor, .cm-dropCursor":{borderLeftColor:kse},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:pHt},".cm-panels":{backgroundColor:hHt,color:Tj},".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:Ose,color:e9,border:"none"},".cm-activeLineGutter":{backgroundColor:wse},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:g4},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:g4,borderBottomColor:g4},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:wse,color:Tj}}},{dark:!0}),gHt=xT.define([{tag:se.keyword,color:fHt},{tag:[se.name,se.deleted,se.character,se.propertyName,se.macroName],color:vse},{tag:[se.function(se.variableName),se.labelName],color:uHt},{tag:[se.color,se.constant(se.name),se.standard(se.name)],color:xse},{tag:[se.definition(se.name),se.separator],color:Tj},{tag:[se.typeName,se.className,se.number,se.changed,se.annotation,se.modifier,se.self,se.namespace],color:aHt},{tag:[se.operator,se.operatorKeyword,se.url,se.escape,se.regexp,se.link,se.special(se.string)],color:lHt},{tag:[se.meta,se.comment],color:e9},{tag:se.strong,fontWeight:"bold"},{tag:se.emphasis,fontStyle:"italic"},{tag:se.strikethrough,textDecoration:"line-through"},{tag:se.link,color:e9,textDecoration:"underline"},{tag:se.heading,fontWeight:"bold",color:vse},{tag:[se.atom,se.bool,se.special(se.variableName)],color:xse},{tag:[se.processingInstruction,se.string,se.inserted],color:dHt},{tag:se.invalid,color:cHt}]),bHt=[mHt,u4e(gHt)];var yHt=Zt.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),vHt=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,m=n.basicSetup,g=m===void 0?!0:m,b=[];switch(r&&b.unshift(m1.of([bVt])),g&&(typeof g=="boolean"?b.unshift(yse()):b.unshift(yse(g))),h&&b.unshift(f$t(h)),d){case"light":b.push(yHt);break;case"dark":b.push(bHt);break;case"none":break;default:b.push(d);break}return a===!1&&b.push(Zt.editable.of(!1)),c&&b.push(qi.readOnly.of(!0)),[...b]},xHt=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 wHt{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 Sse{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 b4=null,OHt=()=>typeof window>"u"?new Sse:(b4||(b4=new Sse),b4),kHt=Zt.theme({"& .cm-scroller":{height:"100% !important"}}),Ese=null,y4=null;function SHt(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===Ese||(Ese=a,y4=Zt.theme({"&":{height:e,minHeight:t,maxHeight:n,width:i,minWidth:r,maxWidth:s}})),y4}var Cse=Xf.define(),EHt=200,CHt=[];function THt(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?CHt:l,u=e.autoFocus,d=e.theme,f=d===void 0?"light":d,h=e.height,m=h===void 0?null:h,g=e.minHeight,b=g===void 0?null:g,v=e.maxHeight,y=v===void 0?null:v,w=e.width,x=w===void 0?null:w,O=e.minWidth,S=O===void 0?null:O,k=e.maxWidth,C=k===void 0?null:k,E=e.placeholder,R=E===void 0?"":E,A=e.editable,N=A===void 0?!0:A,T=e.readOnly,j=T===void 0?!1:T,_=e.indentWithTab,I=_===void 0?!0:_,D=e.basicSetup,P=D===void 0?!0:D,L=e.root,B=e.initialState,M=p.useState(),H=M[0],K=M[1],F=p.useState(),q=F[0],Q=F[1],X=p.useState(),ne=X[0],z=X[1],Y=p.useState(()=>({current:null}))[0],ae=p.useState(()=>({current:null}))[0],Ee=SHt(m,b,y,x,S,C),Z=Zt.updateListener.of(de=>{if(de.docChanged&&typeof i=="function"&&!de.transactions.some(fe=>fe.annotation(Cse))){Y.current?Y.current.reset():(Y.current=new wHt(()=>{if(ae.current){var fe=ae.current;ae.current=null,fe()}Y.current=null},EHt),OHt().add(Y.current));var Ce=de.state.doc,le=Ce.toString();i(le,de)}r&&r(xHt(de))}),G=vHt({theme:f,editable:N,readOnly:j,placeholder:R,indentWithTab:I,basicSetup:P}),te=[Z,...Ee?[Ee]:[],kHt,...G];return a&&typeof a=="function"&&te.push(Zt.updateListener.of(a)),te=te.concat(c),p.useLayoutEffect(()=>{if(H&&!ne){var de={doc:t,selection:n,extensions:te},Ce=B?qi.fromJSON(B.json,de,B.fields):qi.create(de);if(z(Ce),!q){var le=new Zt({state:Ce,parent:H,root:L});Q(le),s&&s(le,Ce)}}return()=>{q&&(z(void 0),Q(void 0))}},[H,ne]),p.useEffect(()=>{e.container&&K(e.container)},[e.container]),p.useEffect(()=>()=>{q&&(q.destroy(),Q(void 0)),Y.current&&(Y.current.cancel(),Y.current=null)},[q]),p.useEffect(()=>{u&&q&&q.focus()},[u,q]),p.useEffect(()=>{q&&q.dispatch({effects:Jn.reconfigure.of(te)})},[f,c,m,b,y,x,S,C,R,N,j,I,P,i,a]),p.useEffect(()=>{if(t!==void 0){var de=q?q.state.doc.toString():"";if(q&&t!==de){var Ce=Y.current&&!Y.current.isDone,le=()=>{q&&t!==q.state.doc.toString()&&q.dispatch({changes:{from:0,to:q.state.doc.toString().length,insert:t||""},annotations:[Cse.of(!0)]})};Ce?ae.current=le:le()}}},[t,q]),{state:ne,setState:z,view:q,setView:Q,container:H,setContainer:K}}var AHt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],tFe=p.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,m=e.theme,g=m===void 0?"light":m,b=e.height,v=e.minHeight,y=e.maxHeight,w=e.width,x=e.minWidth,O=e.maxWidth,S=e.basicSetup,k=e.placeholder,C=e.indentWithTab,E=e.editable,R=e.readOnly,A=e.root,N=e.initialState,T=rzt(e,AHt),j=p.useRef(null),_=THt({root:A,value:r,autoFocus:h,theme:g,height:b,minHeight:v,maxHeight:y,width:w,minWidth:x,maxWidth:O,basicSetup:S,placeholder:k,indentWithTab:C,editable:E,readOnly:R,selection:s,onChange:c,onStatistics:u,onCreateEditor:d,onUpdate:f,extensions:l,initialState:N}),I=_.state,D=_.view,P=_.container,L=_.setContainer;p.useImperativeHandle(t,()=>({editor:j.current,state:I,view:D}),[j,P,I,D]);var B=p.useCallback(H=>{j.current=H,L(H)},[L]);if(typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var M=typeof g=="string"?"cm-theme-"+g:"cm-theme";return o.jsx("div",KB({ref:B,className:""+M+(n?" "+n:"")},T))});tFe.displayName="CodeMirror";function nFe(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")?[SH.define(izt)]:i==="py"||i==="pyi"?[hQt()]:["ts","tsx","mts","cts"].includes(i??"")?[DB({typescript:!0,jsx:i==="tsx"})]:["js","jsx","mjs","cjs"].includes(i??"")?[DB({jsx:i==="jsx"})]:i==="json"||i==="jsonc"?[IBt()]:i==="yaml"||i==="yml"?[zQt()]:["md","markdown"].includes(i??"")?[W7t()]:[]}function ST({value:e,path:t,onChange:n,readOnly:i=!1,theme:r="light",lineNumberStart:s=1,height:a="100%",minHeight:l,maxHeight:c,extensions:u}){const d=p.useMemo(()=>[...nFe(t),...s===1?[]:[G3e({formatNumber:f=>String(f+s-1)})],...u??[]],[s,t,u]);return o.jsx(tFe,{value:e,height:a,minHeight:l,maxHeight:c,theme:r,extensions:d,editable:!i,onChange:n,basicSetup:{lineNumbers:s===1,foldGutter:!0,highlightActiveLine:!0,highlightActiveLineGutter:!0,autocompletion:!1}})}const iFe=Object.freeze(Object.defineProperty({__proto__:null,default:ST,languageFor:nFe},Symbol.toStringTag,{value:"Module"}));function _Ht(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=yLe(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:TD(l).trim()}))}}function kHt(){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 SHt(){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 EHt(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 Y$e({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(SHt,{}),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(kHt,{}),o.jsx("span",{children:r.name})]}),r.children.length>0?o.jsx(Y$e,{nodes:r.children,depth:t+1,activePath:n,onSelect:i}):null]},r.path))}function CHt(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 WD({files:e}){var m;const{t,i18n:n}=je("skills"),i=p.useMemo(()=>EHt(e),[e]),[r,s]=p.useState(((m=e[0])==null?void 0:m.path)||""),[a,l]=p.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=p.useMemo(()=>OHt(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(Y$e,{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:()=>CHt(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(Ju,{text:h.body,allowRawHtml:!1,className:"skill-file-preview__markdown-body"})]}):o.jsx(ST,{value:c.content,path:c.path,readOnly:!0,onChange:()=>{}})})]}):o.jsx("div",{className:"skill-file-preview__binary",children:t("fileTree.noFiles")})})]})}const THt=Object.freeze(Object.defineProperty({__proto__:null,SkillFileTree:WD},Symbol.toStringTag,{value:"Module"})),AHt=1200,_Ht=3,Z$e=2,jHt=/SKILL\.md|frontmatter|Skill name|description|根目录|目录名|UTF-8|文本文件|文件数|符号链接|敏感凭证/i,Tse={concise:"generation.styles.concise",strict:"generation.styles.strict",tutorial:"generation.styles.tutorial",automation:"generation.styles.automation"};function Ase(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 NHt(e){return e?e.state==="ready"?Yt("generation.stages.ready"):e.state==="failed"?Yt("generation.stages.failed"):e.state==="cancelled"?Yt("generation.stages.cancelled"):e.stage==="validating"?Yt("generation.stages.validating"):e.stage==="packaging"?Yt("generation.stages.packaging"):Yt("generation.stages.generating"):Yt("generation.stages.preparing")}function y4(e){var t;return e.state==="failed"&&((t=e.validation)==null?void 0:t.valid)===!1&&e.validation.errors.some(n=>jHt.test(n))}function _se(e){var n;const t=((n=e.validation)==null?void 0:n.errors.join(` -`))||e.error||Yt("generation.validation.fallback");return[Yt("generation.validation.repairInstruction"),Yt("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:AD(l).trim()}))}}function jHt(){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 NHt(){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 RHt(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 rFe({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(NHt,{}),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(jHt,{}),o.jsx("span",{children:r.name})]}),r.children.length>0?o.jsx(rFe,{nodes:r.children,depth:t+1,activePath:n,onSelect:i}):null]},r.path))}function IHt(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 KD({files:e}){var m;const{t,i18n:n}=_e("skills"),i=p.useMemo(()=>RHt(e),[e]),[r,s]=p.useState(((m=e[0])==null?void 0:m.path)||""),[a,l]=p.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=p.useMemo(()=>_Ht(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(rFe,{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:()=>IHt(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(Zu,{text:h.body,allowRawHtml:!1,className:"skill-file-preview__markdown-body"})]}):o.jsx(ST,{value:c.content,path:c.path,readOnly:!0,onChange:()=>{}})})]}):o.jsx("div",{className:"skill-file-preview__binary",children:t("fileTree.noFiles")})})]})}const PHt=Object.freeze(Object.defineProperty({__proto__:null,SkillFileTree:KD},Symbol.toStringTag,{value:"Module"})),DHt=1200,MHt=3,sFe=2,LHt=/SKILL\.md|frontmatter|Skill name|description|根目录|目录名|UTF-8|文本文件|文件数|符号链接|敏感凭证/i,Tse={concise:"generation.styles.concise",strict:"generation.styles.strict",tutorial:"generation.styles.tutorial",automation:"generation.styles.automation"};function Ase(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 $Ht(e){return e?e.state==="ready"?tn("generation.stages.ready"):e.state==="failed"?tn("generation.stages.failed"):e.state==="cancelled"?tn("generation.stages.cancelled"):e.stage==="validating"?tn("generation.stages.validating"):e.stage==="packaging"?tn("generation.stages.packaging"):tn("generation.stages.generating"):tn("generation.stages.preparing")}function v4(e){var t;return e.state==="failed"&&((t=e.validation)==null?void 0:t.valid)===!1&&e.validation.errors.some(n=>LHt.test(n))}function _se(e){var n;const t=((n=e.validation)==null?void 0:n.errors.join(` +`))||e.error||tn("generation.validation.fallback");return[tn("generation.validation.repairInstruction"),tn("generation.validation.recheckInstruction"),t.slice(0,2e3)].join(` -`)}function RHt(e){var t;if(e.repairing||((t=e.task)==null?void 0:t.state)==="running"&&e.repairMode){if(e.repairMode==="manual")return Yt("generation.stages.repairingAgain");const n=Math.max(1,e.repairAttempts||1);return Yt("generation.stages.autoRepairing",{attempt:n,max:Z$e})}return NHt(e.task)}function jse(){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 IHt(e,t=Date.now()){if(!(e!=null&&e.expiresAt))return Yt("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 Yt("generation.remaining",{minutes:i,seconds:String(r).padStart(2,"0")})}function PHt(e){return e?e.length>64?Yt("generation.validation.nameTooLong"):/^[a-z0-9-]+$/.test(e)?"":Yt("generation.validation.invalidName"):""}function Nse(e){return e?e.length>128?Yt("generation.validation.modelTooLong"):/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/.test(e)?"":Yt("generation.validation.invalidModel"):""}function v4(e){return`${e.region||""}:${e.id}`}function DHt(){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 MHt({operation:e,cloudProvider:t,space:n,availableSpaces:i=[],spacesLoading:r=!1,initialIntent:s="",source:a,onBack:l,onPublished:c}){var Se,ke,qe,it;const{t:u}=je("skills"),[d,f]=p.useState(null),[h,m]=p.useState(null),[g,b]=p.useState(s),[v,y]=p.useState(""),[w,x]=p.useState([]),[O,S]=p.useState([]),[k,C]=p.useState(""),[E,R]=p.useState(!1),[A,j]=p.useState(""),[T,N]=p.useState(""),[_,D]=p.useState(null),[M,P]=p.useState(""),[L,B]=p.useState(""),[I,z]=p.useState(n?v4(n):""),[K,F]=p.useState(Date.now()),q=p.useRef([]);p.useEffect(()=>{const de=new AbortController;return dD(de.signal).then(ve=>{f(ve),x([Ase(0,ve)])}).catch(ve=>{de.signal.aborted||m(yr(ve,Yt("generation.errors.loadCapability")))}),()=>de.abort()},[]),p.useEffect(()=>{q.current=O},[O]),p.useEffect(()=>{const de=window.setInterval(()=>F(Date.now()),1e3);return()=>window.clearInterval(de)},[]),p.useEffect(()=>{const de=ve=>{q.current.some(Te=>{var Ke;return((Ke=Te.task)==null?void 0:Ke.state)==="running"||Te.repairing})&&ve.preventDefault()};return window.addEventListener("beforeunload",de),()=>{var ve;window.removeEventListener("beforeunload",de);for(const Te of q.current)(ve=Te.task)!=null&&ve.jobId&&ODt(Te.task.jobId).catch(()=>{})}},[]),p.useEffect(()=>{if(!O.some(Ke=>{var $e;return(($e=Ke.task)==null?void 0:$e.state)==="running"||Ke.repairing}))return;let de=!1,ve;const Te=async()=>{const Ke=q.current,$e=await Promise.all(Ke.map(async At=>{var Nt;if(((Nt=At.task)==null?void 0:Nt.state)!=="running")return At;try{const vt=await vDt(At.task.jobId);if(y4(vt)&&(At.repairAttempts||0)ft.map(gt=>gt.id===At.id?{...gt,task:vt,repairing:!0,repairMode:"auto",repairAttempts:Tt,repairError:void 0}:gt));try{const ft=await f3({jobId:vt.jobId,intent:_se(vt),expectedRevision:vt.revision});return{...At,task:ft,artifact:void 0,repairing:!1,repairMode:"auto",repairAttempts:Tt,repairError:void 0,error:void 0,pollError:void 0}}catch(ft){return{...At,task:vt,repairing:!1,repairMode:void 0,repairAttempts:Tt,repairError:yr(ft,Yt("generation.errors.autoRepair")),pollError:void 0}}}let Ot=At.artifact;return vt.state==="ready"&&(Ot=await d3(vt.jobId,vt.revision)),{...At,task:vt,artifact:Ot,repairing:!1,repairMode:vt.state==="running"?At.repairMode:void 0,repairError:void 0,error:void 0,pollError:void 0}}catch(vt){return{...At,pollError:yr(vt,Yt("generation.errors.pollCandidate"))}}}));de||(S($e),ve=window.setTimeout(()=>void Te(),AHt))};return Te(),()=>{de=!0,ve!==void 0&&window.clearTimeout(ve)}},[O.some(de=>{var ve;return((ve=de.task)==null?void 0:ve.state)==="running"||de.repairing})]);const H=O.find(de=>de.id===k)||O[0],X=e==="create"&&!n,ne=i.find(de=>v4(de)===I)??null,Q=n??ne,Z=i.map(de=>({value:v4(de),label:`${oc(de)||u("generation.unnamedSpace")} · ${Lf(de.region||"cn-beijing",t)}`})),ce=PHt(v),Ee=!!(d!=null&&d.enabled&&g.trim()&&!ce&&w.length>0&&w.every(de=>de.model.trim()&&!Nse(de.model.trim()))),Y=(de,ve)=>{x(Te=>Te.map(Ke=>Ke.id===de?{...Ke,...ve}:Ke))},G=async de=>{const ve={...de,model:de.model.trim()},Te=de.style==="custom"?de.customStyle.trim():de.style;try{const Ke=await yDt({operation:e,intent:g.trim(),model:ve.model,style:Te,name:v.trim()||void 0,source:a});return{id:de.id,config:ve,task:Ke}}catch(Ke){return{id:de.id,config:ve,error:yr(Ke,Yt("generation.errors.createCandidate"))}}},te=async()=>{if(!Ee)return;R(!0),D(null);const de=w.map(Te=>({id:Te.id,config:Te}));S(de),C(w[0].id);const ve=await Promise.all(w.map(G));S(ve)},ue=async de=>{S(Te=>Te.map(Ke=>Ke.id===de.id?{...Ke,error:void 0}:Ke));const ve=await G(de.config);S(Te=>Te.map(Ke=>Ke.id===de.id?ve:Ke))},Ce=async()=>{if(!(!(H!=null&&H.task)||!A.trim()||H.task.state!=="ready")){N("refine"),D(null);try{const de=await f3({jobId:H.task.jobId,intent:A.trim(),expectedRevision:H.task.revision});S(ve=>ve.map(Te=>Te.id===H.id?{...Te,task:de,artifact:void 0}:Te)),j("")}catch(de){D(yr(de,Yt("generation.errors.refine")))}finally{N("")}}},se=async()=>{if(!(!(H!=null&&H.task)||!y4(H.task))){N("refine"),D(null),S(de=>de.map(ve=>ve.id===H.id?{...ve,repairing:!0,repairMode:"manual",repairError:void 0}:ve));try{const de=await f3({jobId:H.task.jobId,intent:_se(H.task),expectedRevision:H.task.revision});S(ve=>ve.map(Te=>Te.id===H.id?{...Te,task:de,artifact:void 0,repairing:!1,repairMode:"manual",repairError:void 0}:Te))}catch(de){S(ve=>ve.map(Te=>Te.id===H.id?{...Te,repairing:!1,repairMode:void 0,repairError:yr(de,Yt("generation.errors.repairAgain"))}:Te))}finally{N("")}}},he=async()=>{if(!(!(H!=null&&H.task)||H.task.state!=="ready"||L)){N("publish"),D(null);try{if(!Q)throw new Error(Yt("generation.errors.selectSpace"));const de=H.artifact||await d3(H.task.jobId,H.task.revision),ve=(a==null?void 0:a.region)||Q.region||"";if(!VI(ve))throw new Error(Yt("generation.errors.unsupportedRegion"));await wDt({jobId:H.task.jobId,expectedRevision:H.task.revision,expectedArtifactSha256:de.sha256,disposition:e==="optimize"?"update-source":"create-new",skillSpaceIds:[Q.id],projectName:(a==null?void 0:a.projectName)||Q.projectName,region:ve,onProgress:Te=>P(Te.message)}),B(H.id),c()}catch(de){D(yr(de,Yt("generation.errors.upload")))}finally{N(""),P("")}}},ae=async()=>{if(!(!(H!=null&&H.task)||H.task.state!=="ready")){N("download");try{const de=H.artifact||await d3(H.task.jobId,H.task.revision);await kDt(H.task.jobId,H.task.revision,de.sha256)}catch(de){D(yr(de,Yt("generation.errors.download")))}finally{N("")}}},Ae=async()=>{O.some(de=>{var ve;return((ve=de.task)==null?void 0:ve.state)==="running"})&&!window.confirm(Yt("generation.leaveConfirmation"))||(await Promise.allSettled(O.flatMap(de=>{var ve;return((ve=de.task)==null?void 0:ve.state)==="running"?[xDt({jobId:de.task.jobId,expectedRevision:de.task.revision})]:[]})),l())},De=e==="create"?u("generation.createTitle"):u("generation.optimizeTitle",{name:(a==null?void 0:a.name)||u("generation.skillFallback")}),ye=de=>{var ve;return((ve=d==null?void 0:d.models.find(Te=>Te.id===de))==null?void 0:ve.label)||de},Qe=de=>de.config.style==="custom"?de.config.customStyle.trim()||u("generation.styles.customFallback"):u(Tse[de.config.style]),we=[...Object.entries(Tse).map(([de,ve])=>({value:de,label:u(ve)})),{value:"custom",label:u("generation.styles.custom")}],Ne=de=>de.error||de.repairError?u("generation.stages.failed"):RHt(de),ie=de=>!de.error&&!de.repairError&&(de.repairing||!de.task||de.task.state==="running"),fe=O.some(de=>{var ve;return((ve=de.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 Ae(),"aria-label":u("generation.back"),children:o.jsx(DHt,{})}),o.jsxs("div",{children:[o.jsx("h1",{children:De}),o.jsx("p",{children:oc(n)||u("generation.home")})]}),O.length>0?o.jsx("span",{className:"skill-generation__ttl",children:IHt(H==null?void 0:H.task,K)}):null]}),E?o.jsxs("div",{className:"skill-generation__workspace",children:[o.jsx("div",{className:"skill-generation__candidate-tabs",role:"tablist","aria-label":u("generation.candidates"),children:O.map(de=>o.jsxs("button",{type:"button",role:"tab","aria-selected":(H==null?void 0:H.id)===de.id,className:(H==null?void 0:H.id)===de.id?"is-active":"",onClick:()=>C(de.id),children:[o.jsxs("span",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.style")}),o.jsx("strong",{children:Qe(de)})]}),o.jsxs("span",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.model")}),o.jsx("strong",{children:ye(de.config.model)})]}),o.jsxs("span",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.progress")}),o.jsxs("strong",{children:[ie(de)?o.jsx(jse,{}):null,Ne(de)]})]})]},de.id))}),H?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:Qe(H)})]}),o.jsxs("div",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.model")}),o.jsx("strong",{children:ye(H.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:[ie(H)?o.jsx(jse,{}):null,ie(H)?o.jsx(mn,{children:Ne(H)}):Ne(H)]})]})]})}),H.task?o.jsx(nLt,{activities:H.task.activities}):null,H.pollError?o.jsx("div",{className:"skill-inline-notice",children:o.jsx(ps,{error:H.pollError})}):null,H.repairError?o.jsx("div",{className:"skill-inline-notice",children:o.jsx(ps,{error:H.repairError})}):null,H.error?o.jsxs("div",{className:"skill-inline-error",children:[o.jsx(ps,{error:H.error}),o.jsx("button",{type:"button",onClick:()=>void ue(H),children:u("generation.retryCandidate")})]}):null,(Se=H.task)!=null&&Se.validation&&!H.task.validation.valid&&!H.repairing&&H.task.state==="failed"?o.jsxs("div",{className:"skill-validation-errors",children:[o.jsx("strong",{children:u("generation.formatValidationFailed")}),H.task.validation.errors.map(de=>o.jsx("p",{children:de},de)),y4(H.task)?o.jsx("button",{type:"button",disabled:!!T,onClick:()=>void se(),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")}),((ke=H.task)==null?void 0:ke.state)==="ready"?o.jsx("button",{type:"button",onClick:()=>void ae(),disabled:!!T,children:u("generation.downloadZip")}):null]}),H.artifact?o.jsx(WD,{files:H.artifact.files}):o.jsx("div",{className:"skill-generation__files-empty",children:((qe=H.task)==null?void 0:qe.state)==="ready"?u("generation.loadingFiles"):u("generation.filesPending")})]}),((it=H.task)==null?void 0:it.state)==="ready"?o.jsxs("div",{className:"skill-generation__ready-actions",children:[X?o.jsx("div",{className:"skill-generation__publish-target",children:o.jsx(dj,{label:u("generation.uploadToSpace"),value:I,options:Z,onChange:z,disabled:r,placeholder:u(r?"generation.loadingSpaces":"generation.selectSpace")})}):null,o.jsxs("footer",{className:"skill-generation__followup",children:[o.jsx("textarea",{value:A,onChange:de=>j(de.target.value),placeholder:u("generation.continuePlaceholder")}),o.jsx("button",{type:"button",className:"skill-button",disabled:!A.trim()||!!T,onClick:()=>void Ce(),children:u("generation.continue")}),o.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!!T||!!L||!Q,onClick:()=>void he(),children:T==="publish"?M||u("generation.uploading"):u(e==="optimize"?"generation.overwrite":X?"generation.uploadToSelectedSpace":"generation.uploadToCurrentSpace")})]})]}):null,_?o.jsx("div",{className:"skill-inline-error skill-generation__action-error",children:o.jsx(ps,{error:_})}):null]}):null,!fe&&O.every(de=>de.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:de=>b(de.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:de=>y(de.target.value),placeholder:u("generation.autoNamePlaceholder"),"aria-invalid":!!ce,"aria-describedby":"skill-name-help"}),ce?o.jsx("span",{id:"skill-name-help",className:"skill-generation__field-error",role:"alert",children:ce}):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:[w.map((de,ve)=>o.jsxs("article",{className:"skill-generation__group",children:[o.jsxs("header",{children:[o.jsx("strong",{children:u("generation.plan",{count:ve+1})}),w.length>1?o.jsx("button",{type:"button",onClick:()=>x(Te=>Te.filter(Ke=>Ke.id!==de.id)),children:u("generation.remove")}):null]}),o.jsx(dj,{label:u("generation.model"),required:!0,value:de.model,options:(d==null?void 0:d.models.map(Te=>({value:Te.id,label:Te.label})))||[],onChange:Te=>Y(de.id,{model:Te}),allowCustom:!0,placeholder:u("generation.modelPlaceholder"),error:Nse(de.model.trim())}),o.jsx(dj,{label:u("generation.style"),required:!0,value:de.style,options:we,onChange:Te=>Y(de.id,{style:Te})}),de.style==="custom"?o.jsxs("label",{children:[o.jsx("span",{children:u("generation.customStyle")}),o.jsx("textarea",{value:de.customStyle,onChange:Te=>Y(de.id,{customStyle:Te.target.value}),placeholder:u("generation.customStylePlaceholder")})]}):null]},de.id)),d&&w.length<_Ht?o.jsx("button",{type:"button",className:"skill-generation__add-group",onClick:()=>x(de=>[...de,Ase(de.length,d)]),children:u("generation.addConfiguration")}):null]}),h?o.jsx("div",{className:"skill-inline-error",children:o.jsx(ps,{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:!Ee,onClick:()=>void te(),children:u("generation.generate")})})]})]})}async function J$e(e,t,n,i){const r=new URLSearchParams({region:e.region}),s=await fetch(ta(`/web/skill-management/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/versions?${r}`),{...t,headers:Ll(pu(t.headers)),signal:Wa(e.signal,i)});if(!s.ok)throw await cD(s,n);return s.json()}function LHt(e){return J$e(e,{},V("skills.listVersionsFailed"),qa)}function $Ht(e){return J$e(e,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},V("skills.uploadVersionFailed"),hr)}function eFe(e){const t=new Map;for(const n of e){const i=`${n.sourceSkillId}:${n.version}`,r=t.get(i);(!r||n.submittedAt>r.submittedAt)&&t.set(i,n)}return t}function FHt(e,t,n,i){const r=i.trim().toLocaleLowerCase();return e.filter(s=>s.kind===t&&(n==="all"||s.status===n)&&`${s.name} ${s.description} ${s.author} ${s.version}`.toLocaleLowerCase().includes(r))}const tFe=p.createContext(void 0);function Bg(e){const t=p.useContext(tFe);if(!e&&t===void 0)throw new Error(mc(27));return t}const x1=p.forwardRef(function(t,n){const{render:i,className:r,style:s,forceRender:a=!1,...l}=t,c=Bg(),u=c.useState("open"),d=c.useState("nested"),f=c.useState("mounted"),h=c.useState("transitionStatus");return Oo("div",t,{state:{open:u,transitionStatus:h},ref:[c.context.backdropRef,n],stateAttributesMapping:W2e,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:a||!d})}),KD=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:a=!1,nativeButton:l=!0,...c}=t,u=Bg(),d=u.useState("open"),{getButtonProps:f,buttonRef:h}=uP({disabled:a,native:l}),m={disabled:a};function g(b){d&&u.setOpen(!1,Zs(JTe,b.nativeEvent))}return Oo("button",t,{state:m,ref:[n,h],props:[{onClick:g},c,f]})}),ET=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:a,...l}=t,c=Bg(),u=pp(a);return c.useSyncedValueWithCleanup("descriptionElementId",u),Oo("p",t,{ref:n,props:[{id:u},l]})}),nFe=p.createContext(void 0);function BHt(){const e=p.useContext(nFe);if(e===void 0)throw new Error(mc(26));return e}const UHt={...hQ,...cP,nestedDialogOpen(e){return e?{"data-nested-dialog-open":""}:null}},w1=p.forwardRef(function(t,n){const{render:i,className:r,style:s,finalFocus:a,initialFocus:l,...c}=t,u=Bg(),d=u.useState("descriptionElementId"),f=u.useState("disablePointerDismissal"),h=u.useState("floatingRootContext"),m=u.useState("popupProps"),g=u.useState("modal"),b=u.useState("mounted"),v=u.useState("nested"),y=u.useState("nestedOpenDialogCount"),w=u.useState("open"),x=u.useState("openMethod"),O=u.useState("titleElementId"),S=u.useState("transitionStatus"),k=u.useState("role"),C=h.useState("floatingId");BHt(),AC({open:w,ref:u.context.popupRef,onComplete(){var N,_;w&&((_=(N=u.context).onOpenChangeComplete)==null||_.call(N,!0))}});const E=l===void 0?_2e(u.context.popupRef):l,R=y>0,A=u.useStateSetter("popupElement"),T=Oo("div",t,{state:{open:w,nested:v,transitionStatus:S,nestedDialogOpen:R},props:[m,{id:C,"aria-labelledby":O,"aria-describedby":d,role:k,...A2e,hidden:!b,onKeyDown(N){qMe.has(N.key)&&N.stopPropagation()},style:{"--nested-dialogs":y}},c],ref:[n,u.context.popupRef,A],stateAttributesMapping:UHt});return o.jsx(d2e,{context:h,openInteractionType:x,disabled:!b,closeOnFocusOut:!f,initialFocus:E,returnFocus:a,modal:g!==!1,restoreFocus:"popup",children:T})}),O1=p.forwardRef(function(t,n){const{keepMounted:i=!1,...r}=t,s=Bg(),a=s.useState("mounted"),l=s.useState("modal"),c=s.useState("open");return a||i?o.jsx(nFe.Provider,{value:i,children:o.jsxs(s2e,{ref:n,...r,children:[a&&l===!0&&o.jsx(VMe,{ref:s.context.internalBackdropRef,inert:rQ(!c)}),t.children]})}):null});function QHt({store:e,parentContext:t,isDrawer:n}){const i=e.useState("open"),r=e.useState("disablePointerDismissal"),s=e.useState("modal"),a=e.useState("popupElement"),l=e.useState("floatingRootContext"),[c,u]=p.useState(0),[d,f]=p.useState(0),h=c===0,m=h2e(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(g){if(!e.context.outsidePressEnabledRef.current||"button"in g&&g.button!==0)return!1;if("touches"in g){if(g.type==="touchend"){if(g.changedTouches.length!==1||g.touches.length!==0)return!1}else if(g.touches.length!==1)return!1}const b=ea(g);if(h&&!r){if(s){const v=e.context.internalBackdropRef.current,y=e.context.backdropRef.current;return v||y?v===b||y===b||Qn(b,a)&&!(b!=null&&b.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:h});return HMe(i&&s===!0,a),e.useContextCallback("onNestedDialogOpen",(g,b)=>{u(g),f(b)}),Fn(()=>(t!=null&&t.onNestedDialogOpen&&(i?t.onNestedDialogOpen(c+1,d+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t!=null&&t.onNestedDialogOpen&&i&&t.onNestedDialogOpen(0,0)}),[n,i,c,d,t]),M2e(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:d}),null}const zHt={...U2e,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class VHt extends tP{constructor(n,i,r){const s=new uQ,a=HHt(n,s,i,r);super(a,qHt(s),zHt);Jt(this,"setOpen",(n,i)=>{var s,a;if(i.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&i.trigger==null&&this.state.activeTriggerId!=null&&(i.trigger=this.state.activeTriggerElement??void 0),(a=(s=this.context).onOpenChange)==null||a.call(s,n,i),i.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,i);const r={open:n};R2e(r,n,i.trigger),this.update(r)})}}function HHt(e,t,n,i=!1){const r={...$2e(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e};return r.floatingRootContext=F2e(t,n,i),r}function qHt(e){return{popupRef:p.createRef(),backdropRef:p.createRef(),internalBackdropRef:p.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function WHt(e,t){const{children:n,open:i,defaultOpen:r=!1,onOpenChange:s,onOpenChangeComplete:a,disablePointerDismissal:l=!1,modal:c=!0,actionsRef:u,handle:d,triggerId:f,defaultTriggerId:h=null}=t,m=e==="drawer",g=c,b=l,v="dialog",y=Bg(!0),w=y!=null,x={modal:g,disablePointerDismissal:b,nested:w,role:v},O=j2e((A,j)=>new VHt({open:r,openProp:i,activeTriggerId:h,triggerIdProp:f,...x},A,j),!0);O.useControlledProp("openProp",i),O.useControlledProp("triggerIdProp",f),O.useSyncedValues(x),O.useContextCallback("onOpenChange",s),O.useContextCallback("onOpenChangeComplete",a);const S=O.useState("open"),k=O.useState("mounted"),C=O.useState("payload");L2e(O,S),P2e(O);const{forceUnmount:E}=D2e(S,O);p.useImperativeHandle(u,()=>({unmount:E,close:()=>O.setOpen(!1,Zs(t2e))}),[E,O]);const R=S||k;return o.jsxs(tFe.Provider,{value:O,children:[d&&o.jsx(N2e,{handle:d,store:O}),R&&o.jsx(QHt,{store:O,parentContext:y==null?void 0:y.context,isDrawer:m}),typeof n=="function"?n({payload:C}):n]})}function k1(e){return WHt("dialog",e)}const S1=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:a,...l}=t,c=Bg(),u=pp(a);return c.useSyncedValueWithCleanup("titleElementId",u),Oo("h2",t,{ref:n,props:[{id:u},l]})}),iFe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:a=!1,nativeButton:l=!0,id:c,payload:u,handle:d,...f}=t,h=Bg(!0),g=Q2e(d)??h;if(!g)throw new Error(mc(79));const b=pp(c),v=g.useState("floatingRootContext"),y=g.useState("isOpenedByTrigger",b),w=g.useState("triggerPopupId",b),x=p.useRef(null),{registerTrigger:O,isMountedByThisTrigger:S}=I2e(b,x,g,{payload:u}),{getButtonProps:k,buttonRef:C}=uP({disabled:a,native:l}),E=f2e(v),R=UMe(()=>g.select("open"),T=>{g.set("openMethod",T)}),A={disabled:a,open:y},j=g.useState("triggerProps",S);return Oo("button",t,{state:A,ref:[C,n,O,x],props:[E.reference,j,R,{[oQ]:"",id:b,"aria-haspopup":"dialog","aria-expanded":y,"aria-controls":w},f,k],stateAttributesMapping:q2e})});async function rFe(e,t){const n=new URLSearchParams({region:e.region}),i=t?"/retry":`?${n}`,r=await fetch(ta(`/web/skill-management/reviews/${encodeURIComponent(e.id)}/score${i}`),{method:t?"POST":"GET",headers:Ll(pu(t?{"Content-Type":"application/json"}:void 0)),...t?{body:JSON.stringify({region:e.region})}:{},signal:Wa(e.signal,qa)});if(!r.ok)throw await cD(r,hn.t(t?"score.retryFailed":"score.loadFailed",{ns:"reviews"}));return r.json()}const KHt=e=>rFe(e,!1),GHt=e=>rFe(e,!0),XHt=["safety","usability","completeness","reliability","maintainability"];function sFe(e){return(e==null?void 0:e.status)==="queued"||(e==null?void 0:e.status)==="running"}function YHt(e){if(e.status!=="not_requested")return{status:e.status,overallScore:e.overallScore,scoredAt:e.scoredAt,modelName:e.modelName,rubricVersion:e.rubricVersion,error:e.error}}function oq({score:e}){const{t}=je("reviews");return o.jsx("span",{className:`review-score-label is-${(e==null?void 0:e.status)||"unscored"}`,children:(e==null?void 0:e.status)==="completed"?typeof e.overallScore=="number"?t("score.points",{score:e.overallScore}):t("score.insufficient"):t(`score.status.${(e==null?void 0:e.status)||"unscored"}`)})}function oFe({application:e,canRetry:t=!1,onScoreChanged:n}){const{t:i,i18n:r}=je("reviews"),[s,a]=p.useState(e.aiReview),[l,c]=p.useState(!!e.aiReview),[u,d]=p.useState(null),[f,h]=p.useState({revision:0,retry:!1}),[m,g]=p.useState(""),b=p.useRef(-1),v=p.useRef(n);v.current=n;const{id:y,region:w}=e,x=!!e.aiReview;p.useEffect(()=>{if(!x&&f.revision===0)return;const k=new AbortController;let C,E=!1,R=!0;const A=async(N,_=!1)=>{var D;if(!(E||k.signal.aborted)&&!(!_&&document.visibilityState==="hidden")){E=!0,_&&c(!0),d(null);try{const M=await(N?GHt:KHt)({id:y,region:w,signal:k.signal});if(k.signal.aborted)return;a(M),(D=v.current)==null||D.call(v,M,N),R=sFe(M),R&&document.visibilityState!=="hidden"&&(C=setTimeout(()=>void A(!1),5e3))}catch(M){k.signal.aborted||(R=!1,d(yr(M,i(N?"score.retryFailed":"score.loadFailed"))))}finally{E=!1,k.signal.aborted||c(!1)}}},j=()=>{clearTimeout(C),R&&document.visibilityState!=="hidden"&&A(!1)},T=f.retry&&b.current!==f.revision;return T&&(b.current=f.revision),A(T,!0),document.addEventListener("visibilitychange",j),()=>{k.abort(),clearTimeout(C),document.removeEventListener("visibilitychange",j)}},[y,w,x,f,i]);const O=(s==null?void 0:s.status)==="completed"?s.result:void 0;p.useEffect(()=>{if(!O){g("");return}const k=URL.createObjectURL(new Blob([JSON.stringify(O,null,2)],{type:"application/json"}));return g(k),()=>URL.revokeObjectURL(k)},[O]);const S=k=>h(C=>({revision:C.revision+1,retry:k}));return o.jsxs("section",{className:"review-score","aria-label":i("score.title"),children:[o.jsxs("div",{className:"review-score__header",children:[o.jsx("div",{"aria-live":"polite",children:l?o.jsx(mn,{children:i(f.retry?"score.starting":"score.loading")}):o.jsx(oq,{score:s})}),o.jsxs("div",{className:"review-score__actions",children:[m?o.jsx("a",{className:"cw-btn cw-btn-ghost",href:m,download:`${y}-score.json`,children:i("score.download")}):null,t&&(!s||s.status==="failed"||s.status==="not_requested")?o.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:l,onClick:()=>S(!0),children:i((s==null?void 0:s.status)==="failed"?"score.retry":"score.start")}):null]})]}),o.jsx("p",{className:"review-score__hint",children:i("score.hint")}),u?o.jsxs("div",{className:"review-score__error",role:"alert",children:[o.jsx(ps,{error:u}),o.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:l,onClick:()=>S(!1),children:i("score.reload")})]}):null,s!=null&&s.error?o.jsx("div",{role:"alert",className:"review-score__error",children:o.jsxs("details",{className:"review-score__raw-error",open:!0,children:[o.jsx("summary",{children:i("score.originalError")}),o.jsx("pre",{children:s.error})]})}):(s==null?void 0:s.status)==="failed"?o.jsx("p",{role:"alert",className:"review-score__error",children:i("score.failed")}):null,O?o.jsxs(o.Fragment,{children:[O.riskFlags.length?o.jsxs("div",{className:"review-score__risks",children:[o.jsx("h3",{children:i("score.risks")}),o.jsx("ul",{children:O.riskFlags.map((k,C)=>o.jsxs("li",{children:[o.jsx("strong",{children:i(`score.severity.${k.severity}`)})," · ",k.reason]},`${C}:${k.reason}`))})]}):null,O.coverage&&!O.coverage.complete?o.jsxs("div",{className:"review-score__coverage",children:[o.jsx("h3",{children:i("score.coverage")}),o.jsx("p",{children:i("score.coverageIncomplete")}),o.jsx("p",{children:i("score.coverageCount",{included:O.coverage.includedFiles,total:O.coverage.totalFiles})}),o.jsxs("ul",{children:[O.coverage.omittedFiles.map(k=>o.jsx("li",{children:i("score.omittedFile",k)},`omitted:${k.path}`)),O.coverage.truncatedFiles.map(k=>o.jsx("li",{children:i("score.truncatedFile",k)},`truncated:${k.path}`))]})]}):null,o.jsx("dl",{className:"review-score__dimensions",children:XHt.map(k=>{const C=O.dimensions[k];return o.jsxs("div",{className:k==="safety"&&C.score!==null&&C.score<60?"is-risk":void 0,children:[o.jsxs("dt",{children:[o.jsx("span",{children:i(`score.dimensions.${k}`)}),o.jsx("strong",{children:C.score===null?i("score.insufficient"):i("score.points",{score:C.score})})]}),o.jsx("dd",{children:C.reason})]},k)})}),O.suggestions.length?o.jsxs("div",{className:"review-score__suggestions",children:[o.jsx("h3",{children:i("score.suggestions")}),o.jsx("ul",{children:O.suggestions.map((k,C)=>o.jsx("li",{children:k},`${C}:${k}`))})]}):null,o.jsxs("dl",{className:"review-score__metadata",children:[o.jsxs("div",{children:[o.jsx("dt",{children:i("score.model")}),o.jsx("dd",{children:O.modelName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:i("score.rubric")}),o.jsx("dd",{children:O.rubricVersion})]}),o.jsxs("div",{children:[o.jsx("dt",{children:i("score.time")}),o.jsx("dd",{children:o.jsx("time",{dateTime:O.scoredAt,children:new Date(O.scoredAt).toLocaleString(r.language,{hour12:!1})})})]})]})]}):null]})}function ZHt({application:e}){const{t}=je("reviews"),[n,i]=p.useState(!1),[r,s]=p.useState(e.aiReview),a=p.useId();return p.useEffect(()=>s(e.aiReview),[e.aiReview]),o.jsxs("div",{className:"review-score-history",children:[o.jsxs("button",{type:"button",className:"review-score-history__toggle","aria-expanded":n,"aria-controls":a,onClick:()=>i(l=>!l),children:[o.jsx("span",{children:t("score.title")}),o.jsx(oq,{score:r}),o.jsx("span",{children:t(n?"score.collapse":"score.expand")})]}),n?o.jsx("div",{id:a,children:o.jsx(oFe,{application:e,onScoreChanged:s},`${e.region}:${e.id}`)}):null]})}function CT({status:e}){const{t}=je("reviews");return o.jsxs("span",{className:`review-status is-${e}`,children:[o.jsx("span",{"aria-hidden":"true"}),t(`status.${e}`)]})}function aq({person:e,fallback:t,compact:n=!1}){const{t:i}=je("reviews"),[r,s]=p.useState(""),a=(e==null?void 0:e.name)||t||i("detail.unknownReviewer"),l=e==null?void 0:e.avatarUrl;return o.jsxs("span",{className:`review-person${n?" is-compact":""}`,children:[l&&l!==r?o.jsx("img",{className:"review-person__avatar",src:l,alt:"",referrerPolicy:"no-referrer",onError:()=>s(l)}):o.jsx("span",{className:"review-person__avatar is-fallback","aria-hidden":"true",children:Array.from(a)[0]}),o.jsxs("span",{className:"review-person__text",children:[o.jsx("span",{children:a}),!n&&(e!=null&&e.email)?o.jsx("span",{className:"review-person__email",children:e.email}):null]})]})}function lq({application:e}){const{t,i18n:n}=je("reviews");return o.jsxs("div",{className:"review-outcome",children:[o.jsx(CT,{status:e.status}),e.reviewer||e.reviewedBy||e.reviewedAt?o.jsxs("dl",{className:"review-outcome__facts",children:[e.reviewer||e.reviewedBy?o.jsxs("div",{children:[o.jsx("dt",{children:t(`detail.${e.status==="returned"?"returnedBy":e.status==="approved"?"approvedBy":"reviewer"}`)}),o.jsx("dd",{children:o.jsx(aq,{person:e.reviewer,fallback:e.reviewedBy})})]}):null,e.reviewedAt?o.jsxs("div",{children:[o.jsx("dt",{children:t("detail.reviewedAt")}),o.jsx("dd",{children:o.jsx("time",{dateTime:e.reviewedAt,children:new Date(e.reviewedAt).toLocaleString(n.language,{hour12:!1})})})]}):null]}):null,e.reason?o.jsxs("div",{className:"review-outcome__message is-returned",children:[o.jsx("strong",{children:t("decision.reason")}),o.jsx("p",{children:e.reason})]}):null,e.comment?o.jsxs("div",{className:"review-outcome__message",children:[o.jsx("strong",{children:t("detail.comment")}),o.jsx("p",{children:e.comment})]}):null,e.status==="pending"?o.jsx("p",{className:"review-outcome__hint",children:t("detail.pendingHint")}):null,e.status==="approving"?o.jsx("p",{className:"review-outcome__hint",children:t("detail.approvingHint")}):null]})}function cq({applications:e}){const{t,i18n:n}=je("reviews");return e.length?o.jsx("ol",{className:"review-source-history",children:[...e].sort((i,r)=>r.submittedAt.localeCompare(i.submittedAt)).map(i=>o.jsxs("li",{children:[o.jsxs("div",{className:"review-source-history__submission",children:[o.jsx("strong",{children:i.version}),o.jsx("span",{children:t("detail.submitted",{name:i.author})}),o.jsx("time",{dateTime:i.submittedAt,children:new Date(i.submittedAt).toLocaleString(n.language,{hour12:!1})})]}),o.jsx(lq,{application:i}),o.jsx(ZHt,{application:i})]},i.id))}):o.jsx("p",{className:"review-outcome__hint",children:t("detail.noHistory")})}function JHt({name:e,applications:t,onClose:n}){const{t:i}=je("reviews"),r=p.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);return o.jsx(k1,{open:!0,onOpenChange:s=>{s||n()},children:o.jsxs(O1,{children:[o.jsx(x1,{className:"review-backdrop"}),o.jsxs(w1,{className:"review-drawer",finalFocus:()=>{var s;return(s=r.current)!=null&&s.isConnected?r.current:null},children:[o.jsxs("header",{className:"review-drawer__header",children:[o.jsxs("div",{children:[o.jsx(S1,{children:i("detail.history")}),o.jsx(ET,{children:e})]}),o.jsx(KD,{className:"review-icon-button","aria-label":i("actions.close"),children:o.jsx(yD,{})})]}),o.jsx("div",{className:"review-drawer__body",children:o.jsx(cq,{applications:t})})]})]})})}function eqt({skill:e,space:t,region:n,reviews:i,onClose:r,onChanged:s,onSubmitReview:a}){const{t:l,i18n:c}=je("ui"),[u,d]=p.useState(null),[f,h]=p.useState(e.version),[m,g]=p.useState(!0),[b,v]=p.useState(null),[y,w]=p.useState(null),[x,O]=p.useState([]),[S,k]=p.useState(!1),[C,E]=p.useState(null),[R,A]=p.useState(0),[j,T]=p.useState(0),[N,_]=p.useState(null),D=p.useRef(null),M=p.useRef(null),P=p.useRef(null),L=p.useRef(!1),B=p.useRef(!0),I=p.useRef({onClose:r,busy:N});I.current={onClose:r,busy:N};const z=u==null?void 0:u.items.find(Z=>Z.version===f),K=p.useMemo(()=>eFe(i),[i]),F=K.get(`${e.skillId}:${f}`),q=i.filter(Z=>Z.sourceSkillId===e.skillId&&Z.version===f&&Z.id!==(F==null?void 0:F.id)),H=!!(a&&(u!=null&&u.canUpdate)&&z&&["running","ready"].includes(z.status.toLowerCase())&&(!F||F.status==="returned"));p.useEffect(()=>{var Ee;B.current=!0;const Z=document.activeElement instanceof HTMLElement?document.activeElement:null;(Ee=P.current)==null||Ee.focus();const ce=Y=>{var Ce;if(Y.key==="Escape"&&(Y.preventDefault(),I.current.busy||I.current.onClose()),Y.key!=="Tab")return;const G=Array.from(((Ce=D.current)==null?void 0:Ce.querySelectorAll('button:not([disabled]), input:not([disabled]):not([type="file"]), a[href], summary, [tabindex="0"]'))||[]),te=G[0],ue=G[G.length-1];Y.shiftKey&&document.activeElement===te&&(Y.preventDefault(),ue==null||ue.focus()),!Y.shiftKey&&document.activeElement===ue&&(Y.preventDefault(),te==null||te.focus())};return document.addEventListener("keydown",ce),()=>{B.current=!1,document.removeEventListener("keydown",ce),Z!=null&&Z.isConnected&&Z.focus()}},[]),p.useEffect(()=>{const Z=new AbortController;return g(!0),v(null),LHt({spaceId:t.id,skillId:e.skillId,region:n,signal:Z.signal}).then(ce=>{Z.signal.aborted||(d(ce),h(Ee=>{var Y;return ce.items.some(G=>G.version===Ee)?Ee:((Y=ce.items[0])==null?void 0:Y.version)||""}))}).catch(ce=>{Z.signal.aborted||v(yr(ce,l("skillCenter.versions.loadFailed")))}).finally(()=>{Z.signal.aborted||g(!1)}),()=>Z.abort()},[t.id,e.skillId,n,R,l]),p.useEffect(()=>{if(!f||!z)return;let Z=!0;return k(!0),E(null),O([]),LMe({spaceId:t.id,skillId:e.skillId,region:n,version:f}).then(ce=>{Z&&O(ce)}).catch(ce=>{Z&&E(yr(ce,l("skillCenter.versions.filesFailed")))}).finally(()=>{Z&&k(!1)}),()=>{Z=!1}},[t.id,e.skillId,n,f,!!z,j,l]);async function X(Z){if(!L.current){L.current=!0,_("upload"),w(null);try{const ce=await $Ht({spaceId:t.id,skillId:e.skillId,region:n,file:Z});if(!B.current)return;h(ce.version),A(Ee=>Ee+1),s()}catch(ce){B.current&&w(yr(ce,l("skillCenter.versions.uploadFailed")))}finally{L.current=!1,B.current&&_(null)}}}async function ne(){if(!(!H||!a||L.current)){L.current=!0,_("submit"),w(null);try{await a(f)}catch(Z){B.current&&w(yr(Z,l("skillCenter.versions.submitFailed")))}finally{L.current=!1,B.current&&_(null)}}}function Q(Z){if(!Z)return"—";const ce=new Date(Z);return Number.isNaN(ce.getTime())?Z:ce.toLocaleString(c.resolvedLanguage||c.language)}return o.jsx("div",{className:"skill-detail-backdrop",onMouseDown:Z=>{Z.target===Z.currentTarget&&!N&&r()},children:o.jsxs("section",{className:"skill-detail-dialog skill-versions",role:"dialog","aria-modal":"true","aria-labelledby":"skill-versions-title",ref:D,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-versions-title",children:l("skillCenter.versions.title")}),o.jsx("p",{title:e.skillName,children:e.skillName})]})}),o.jsxs("div",{className:"skill-detail-actions",children:[o.jsx("button",{type:"button",disabled:m||!!N,onClick:()=>A(Z=>Z+1),children:l("skillCenter.versions.refresh")}),u!=null&&u.canUpdate?o.jsx("button",{type:"button",disabled:!!N,onClick:()=>{var Z;return(Z=M.current)==null?void 0:Z.click()},children:l(N==="upload"?"skillCenter.versions.uploading":"skillCenter.versions.upload")}):null,o.jsx("button",{type:"button",ref:P,disabled:!!N,onClick:r,children:l("skillCenter.versions.close")})]}),o.jsx("input",{className:"skill-versions__file-input",ref:M,type:"file",accept:".zip,application/zip","aria-label":l("skillCenter.versions.upload"),onChange:Z=>{var Ee;const ce=(Ee=Z.target.files)==null?void 0:Ee[0];Z.target.value="",ce&&X(ce)}})]}),y?o.jsx("div",{className:"skill-versions__notice",role:"alert",children:o.jsx(ps,{error:y})}):null,u!=null&&u.canUpdate?o.jsx("p",{className:"skill-versions__hint",children:l("skillCenter.versions.hint")}):null,o.jsxs("div",{className:"skill-versions__body",children:[o.jsxs("div",{className:"skill-versions__history","aria-busy":m,children:[m&&!u?o.jsx("p",{role:"status",children:l("skillCenter.versions.loading")}):null,b?o.jsxs("div",{role:"alert",children:[o.jsx(ps,{error:b}),o.jsx("button",{className:"cw-btn cw-btn-ghost",type:"button",onClick:()=>A(Z=>Z+1),children:l("skillCenter.versions.retry")})]}):null,!m&&!b&&!(u!=null&&u.items.length)?o.jsx("p",{children:l("skillCenter.versions.empty")}):null,o.jsx("div",{className:"skill-versions__list",role:"list","aria-label":l("skillCenter.versions.title"),children:u==null?void 0:u.items.map(Z=>o.jsx("div",{role:"listitem",children:o.jsxs("button",{type:"button",className:`skill-versions__version${f===Z.version?" is-active":""}`,"aria-pressed":f===Z.version,onClick:()=>h(Z.version),children:[o.jsxs("span",{className:"skill-versions__version-title",children:[o.jsx("strong",{children:Z.sourceVersion||Z.version}),Z.isCurrent?o.jsx("span",{children:l("skillCenter.versions.current")}):null]}),o.jsx("time",{dateTime:Z.createdAt,children:Q(Z.createdAt)}),K.get(`${e.skillId}:${Z.version}`)?o.jsx(CT,{status:K.get(`${e.skillId}:${Z.version}`).status}):o.jsx("span",{children:l(t.isShared?"skillCenter.versions.shared":"skillCenter.versions.notSubmitted")})]})},Z.version))})]}),o.jsx("div",{className:"skill-versions__detail",children:z?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"skill-versions__summary",children:[o.jsxs("div",{children:[o.jsx("h3",{children:z.sourceVersion||z.version}),o.jsx("p",{title:z.description,children:z.description}),z.author||e.author?o.jsx("p",{className:"skill-versions__author",children:l("skillCenter.authorName",{name:z.author||e.author})}):null]}),a&&(u!=null&&u.canUpdate)?o.jsx("button",{type:"button",className:"cw-btn cw-btn-primary",disabled:!H||!!N,onClick:()=>void ne(),children:l(N==="submit"?"skillCenter.versions.submitting":"skillCenter.versions.submit")}):null]}),z.error?o.jsx("p",{className:"skill-versions__notice",role:"alert",children:z.error}):null,["running","ready"].includes(z.status.toLowerCase())?null:o.jsx("p",{role:"status",children:l("skillCenter.versions.processing",{status:z.status})}),F?o.jsx(lq,{application:F}):null,q.length?o.jsxs("details",{className:"skill-versions__review-history",children:[o.jsx("summary",{children:l("skillCenter.versions.history")}),o.jsx(cq,{applications:q})]}):null,o.jsx("div",{className:"skill-versions__files",children:S?o.jsx("p",{role:"status",children:l("skillCenter.versions.filesLoading")}):C?o.jsxs("div",{role:"alert",children:[o.jsx(ps,{error:C}),o.jsx("button",{className:"cw-btn cw-btn-ghost",type:"button",onClick:()=>T(Z=>Z+1),children:l("skillCenter.versions.retry")})]}):x.length?o.jsx(WD,{files:x},f):o.jsx("p",{children:l("skillCenter.versions.filesEmpty")})})]}):null})]})]})})}function tqt({region:e,active:t,revision:n,onOpen:i}){const{t:r}=je("ui"),[s,a]=p.useState(null),[l,c]=p.useState(null),[u,d]=p.useState(0);return p.useEffect(()=>{if(!t)return;const f=new AbortController;return c(null),ZPt({region:e,signal:f.signal}).then(h=>{f.signal.aborted||a(h)}).catch(h=>{f.signal.aborted||c(yr(h,r("skillCenter.sharedLoadFailed")))}),()=>f.abort()},[t,e,u,n,r]),o.jsxs("div",{className:"skillcenter-shared-space",children:[o.jsx(r0,{className:"skillcenter-space-card",title:r("skillCenter.sharedSpace"),description:r("skillCenter.sharedDescription"),status:o.jsx("span",{className:"skillcenter-shared-badge",children:r("skillCenter.sharedVisibility")}),metadata:[{label:r("skillCenter.skillCount"),value:s?r("skillCenter.skillCountValue",{count:s.skillCount??0}):r(l?"skillCenter.sharedLoadFailed":"skillCenter.sharedPreparing")}],detailAction:{label:r("common.viewDetails"),disabled:!s||!!l,onClick:()=>{s&&i(s)}},action:l?{label:r("common.reload"),onClick:()=>d(f=>f+1)}:void 0}),l?o.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:o.jsx(ps,{error:l})}):null]})}function uq({title:e,children:t,onClose:n,className:i=""}){const{t:r}=je("skills"),s=p.useRef(null);return p.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 nqt({region:e,regionOptions:t,onClose:n,onCreated:i}){const{t:r}=je("skills"),[s,a]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(e),[f,h]=p.useState(!1),[m,g]=p.useState(null),b=async()=>{if(s.trim()){h(!0),g(null);try{const v=await YPt({name:s.trim(),description:l.trim()||void 0,region:u});i({...v,region:v.region||u})}catch(v){g(yr(v,r("management.createSpaceFailed")))}finally{h(!1)}}};return o.jsxs(uq,{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(dj,{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)})]}),m?o.jsx("div",{className:"skill-inline-error",children:o.jsx(ps,{error:m})}):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 iqt({space:e,region:t,onClose:n,onUpdated:i}){const{t:r}=je("skills"),[s,a]=p.useState(e.name),[l,c]=p.useState(e.description||""),[u,d]=p.useState(!1),[f,h]=p.useState(null),m=async()=>{if(s.trim()){d(!0),h(null);try{const g=await rDt({spaceId:e.id,name:s.trim(),description:l.trim()||void 0,region:t});i({...e,...g,skillCount:e.skillCount})}catch(g){h(yr(g,r("management.updateSpaceFailed")))}finally{d(!1)}}};return o.jsxs(uq,{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(ps,{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 m(),children:r(u?"management.saving":"management.save")})]})]})}function rqt({space:e,region:t,onClose:n,onUploaded:i}){const{t:r,i18n:s}=je("skills"),[a,l]=p.useState(null),[c,u]=p.useState(null),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[g,b]=p.useState(null),[v,y]=p.useState(!1),w=p.useRef(0),x=p.useRef(null),O=async k=>{const C=w.current+1;if(w.current=C,l(k),u(null),b(null),f(!!k),!!k)try{const E=await aDt(k);w.current===C&&u({name:E.name,fileCount:E.files.length})}catch(E){w.current===C&&b(yr(E,r("management.archiveValidationFailed")))}finally{w.current===C&&f(!1)}},S=async()=>{if(!(!a||!c)){m(!0),b(null);try{await oDt({spaceId:e.id,region:t,project:e.projectName,file:a}),i()}catch(k){b(yr(k,r("management.uploadFailed")))}finally{m(!1)}}};return o.jsxs(uq,{title:r("management.uploadTitle",{name:oc(e)}),className:"skill-upload-dialog",onClose:n,children:[o.jsxs("div",{className:"skill-dialog__body",children:[o.jsx("input",{ref:x,className:"skill-upload-dialog__input",type:"file",accept:".zip,application/zip",onChange:k=>{var C;return void O(((C=k.target.files)==null?void 0:C[0])||null)}}),o.jsxs("button",{type:"button",className:`skill-upload-dropzone${v?" is-dragging":""}`,onClick:()=>{var k;return(k=x.current)==null?void 0:k.click()},onDragEnter:k=>{k.preventDefault(),y(!0)},onDragOver:k=>{k.preventDefault(),k.dataTransfer.dropEffect="copy",y(!0)},onDragLeave:k=>{k.currentTarget.contains(k.relatedTarget)||y(!1)},onDrop:k=>{var C;k.preventDefault(),y(!1),O(((C=k.dataTransfer.files)==null?void 0:C[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(ps,{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 S(),children:r(h?"management.uploading":"management.upload")})]})]})}function sqt(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 GD(e,t=Date.now(),n="zh-CN"){if(e===void 0||e==="")return"—";const i=sqt(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,m)=>n.toLowerCase().startsWith("zh")?`${f} ${m}前`: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 oqt=12,Rse=12;function XR({disabled:e,placement:t="top",children:n}){const{t:i}=je("ui"),r=p.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 aqt=new Set(["active","available","creating","disabled","enabled","failed","inactive","pending","published","ready","released","running","success","unavailable","unreleased","updating"]);function aFe(e,t){const n=(e||"").trim().toLowerCase();return aqt.has(n)?t(`skillCenter.status.${n}`):t("skillCenter.status.unknown")}function lqt(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 cqt(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 Ise(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 $c(e){return`${e.region||"default"}:${e.projectName||"default"}:${e.id}`}function uqt(e,t){const n=new Map(e.map(i=>[$c(i),i]));for(const i of t)n.set($c(i),i);return[...n.values()].sort((i,r)=>Ise(r.updatedAt)-Ise(i.updatedAt))}function dqt(e){const t=e.replace(/\r\n/g,` +`)}function FHt(e){var t;if(e.repairing||((t=e.task)==null?void 0:t.state)==="running"&&e.repairMode){if(e.repairMode==="manual")return tn("generation.stages.repairingAgain");const n=Math.max(1,e.repairAttempts||1);return tn("generation.stages.autoRepairing",{attempt:n,max:sFe})}return $Ht(e.task)}function jse(){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 BHt(e,t=Date.now()){if(!(e!=null&&e.expiresAt))return tn("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 tn("generation.remaining",{minutes:i,seconds:String(r).padStart(2,"0")})}function UHt(e){return e?e.length>64?tn("generation.validation.nameTooLong"):/^[a-z0-9-]+$/.test(e)?"":tn("generation.validation.invalidName"):""}function Nse(e){return e?e.length>128?tn("generation.validation.modelTooLong"):/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/.test(e)?"":tn("generation.validation.invalidModel"):""}function x4(e){return`${e.region||""}:${e.id}`}function QHt(){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 zHt({operation:e,cloudProvider:t,space:n,availableSpaces:i=[],spacesLoading:r=!1,initialIntent:s="",source:a,onBack:l,onPublished:c}){var be,xe,Ke,Ze;const{t:u}=_e("skills"),[d,f]=p.useState(null),[h,m]=p.useState(null),[g,b]=p.useState(s),[v,y]=p.useState(""),[w,x]=p.useState([]),[O,S]=p.useState([]),[k,C]=p.useState(""),[E,R]=p.useState(!1),[A,N]=p.useState(""),[T,j]=p.useState(""),[_,I]=p.useState(null),[D,P]=p.useState(""),[L,B]=p.useState(""),[M,H]=p.useState(n?x4(n):""),[K,F]=p.useState(Date.now()),q=p.useRef([]);p.useEffect(()=>{const he=new AbortController;return fD(he.signal).then(ye=>{f(ye),x([Ase(0,ye)])}).catch(ye=>{he.signal.aborted||m(Er(ye,tn("generation.errors.loadCapability")))}),()=>he.abort()},[]),p.useEffect(()=>{q.current=O},[O]),p.useEffect(()=>{const he=window.setInterval(()=>F(Date.now()),1e3);return()=>window.clearInterval(he)},[]),p.useEffect(()=>{const he=ye=>{q.current.some(Ae=>{var He;return((He=Ae.task)==null?void 0:He.state)==="running"||Ae.repairing})&&ye.preventDefault()};return window.addEventListener("beforeunload",he),()=>{var ye;window.removeEventListener("beforeunload",he);for(const Ae of q.current)(ye=Ae.task)!=null&&ye.jobId&&_Dt(Ae.task.jobId).catch(()=>{})}},[]),p.useEffect(()=>{if(!O.some(He=>{var De;return((De=He.task)==null?void 0:De.state)==="running"||He.repairing}))return;let he=!1,ye;const Ae=async()=>{const He=q.current,De=await Promise.all(He.map(async At=>{var Nt;if(((Nt=At.task)==null?void 0:Nt.state)!=="running")return At;try{const Ot=await CDt(At.task.jobId);if(v4(Ot)&&(At.repairAttempts||0)ft.map(pt=>pt.id===At.id?{...pt,task:Ot,repairing:!0,repairMode:"auto",repairAttempts:Tt,repairError:void 0}:pt));try{const ft=await h3({jobId:Ot.jobId,intent:_se(Ot),expectedRevision:Ot.revision});return{...At,task:ft,artifact:void 0,repairing:!1,repairMode:"auto",repairAttempts:Tt,repairError:void 0,error:void 0,pollError:void 0}}catch(ft){return{...At,task:Ot,repairing:!1,repairMode:void 0,repairAttempts:Tt,repairError:Er(ft,tn("generation.errors.autoRepair")),pollError:void 0}}}let vt=At.artifact;return Ot.state==="ready"&&(vt=await f3(Ot.jobId,Ot.revision)),{...At,task:Ot,artifact:vt,repairing:!1,repairMode:Ot.state==="running"?At.repairMode:void 0,repairError:void 0,error:void 0,pollError:void 0}}catch(Ot){return{...At,pollError:Er(Ot,tn("generation.errors.pollCandidate"))}}}));he||(S(De),ye=window.setTimeout(()=>void Ae(),DHt))};return Ae(),()=>{he=!0,ye!==void 0&&window.clearTimeout(ye)}},[O.some(he=>{var ye;return((ye=he.task)==null?void 0:ye.state)==="running"||he.repairing})]);const Q=O.find(he=>he.id===k)||O[0],X=e==="create"&&!n,ne=i.find(he=>x4(he)===M)??null,z=n??ne,Y=i.map(he=>({value:x4(he),label:`${ac(he)||u("generation.unnamedSpace")} · ${$f(he.region||"cn-beijing",t)}`})),ae=UHt(v),Ee=!!(d!=null&&d.enabled&&g.trim()&&!ae&&w.length>0&&w.every(he=>he.model.trim()&&!Nse(he.model.trim()))),Z=(he,ye)=>{x(Ae=>Ae.map(He=>He.id===he?{...He,...ye}:He))},G=async he=>{const ye={...he,model:he.model.trim()},Ae=he.style==="custom"?he.customStyle.trim():he.style;try{const He=await EDt({operation:e,intent:g.trim(),model:ye.model,style:Ae,name:v.trim()||void 0,source:a});return{id:he.id,config:ye,task:He}}catch(He){return{id:he.id,config:ye,error:Er(He,tn("generation.errors.createCandidate"))}}},te=async()=>{if(!Ee)return;R(!0),I(null);const he=w.map(Ae=>({id:Ae.id,config:Ae}));S(he),C(w[0].id);const ye=await Promise.all(w.map(G));S(ye)},de=async he=>{S(Ae=>Ae.map(He=>He.id===he.id?{...He,error:void 0}:He));const ye=await G(he.config);S(Ae=>Ae.map(He=>He.id===he.id?ye:He))},Ce=async()=>{if(!(!(Q!=null&&Q.task)||!A.trim()||Q.task.state!=="ready")){j("refine"),I(null);try{const he=await h3({jobId:Q.task.jobId,intent:A.trim(),expectedRevision:Q.task.revision});S(ye=>ye.map(Ae=>Ae.id===Q.id?{...Ae,task:he,artifact:void 0}:Ae)),N("")}catch(he){I(Er(he,tn("generation.errors.refine")))}finally{j("")}}},le=async()=>{if(!(!(Q!=null&&Q.task)||!v4(Q.task))){j("refine"),I(null),S(he=>he.map(ye=>ye.id===Q.id?{...ye,repairing:!0,repairMode:"manual",repairError:void 0}:ye));try{const he=await h3({jobId:Q.task.jobId,intent:_se(Q.task),expectedRevision:Q.task.revision});S(ye=>ye.map(Ae=>Ae.id===Q.id?{...Ae,task:he,artifact:void 0,repairing:!1,repairMode:"manual",repairError:void 0}:Ae))}catch(he){S(ye=>ye.map(Ae=>Ae.id===Q.id?{...Ae,repairing:!1,repairMode:void 0,repairError:Er(he,tn("generation.errors.repairAgain"))}:Ae))}finally{j("")}}},fe=async()=>{if(!(!(Q!=null&&Q.task)||Q.task.state!=="ready"||L)){j("publish"),I(null);try{if(!z)throw new Error(tn("generation.errors.selectSpace"));const he=Q.artifact||await f3(Q.task.jobId,Q.task.revision),ye=(a==null?void 0:a.region)||z.region||"";if(!HI(ye))throw new Error(tn("generation.errors.unsupportedRegion"));await ADt({jobId:Q.task.jobId,expectedRevision:Q.task.revision,expectedArtifactSha256:he.sha256,disposition:e==="optimize"?"update-source":"create-new",skillSpaceIds:[z.id],projectName:(a==null?void 0:a.projectName)||z.projectName,region:ye,onProgress:Ae=>P(Ae.message)}),B(Q.id),c()}catch(he){I(Er(he,tn("generation.errors.upload")))}finally{j(""),P("")}}},ce=async()=>{if(!(!(Q!=null&&Q.task)||Q.task.state!=="ready")){j("download");try{const he=Q.artifact||await f3(Q.task.jobId,Q.task.revision);await jDt(Q.task.jobId,Q.task.revision,he.sha256)}catch(he){I(Er(he,tn("generation.errors.download")))}finally{j("")}}},Te=async()=>{O.some(he=>{var ye;return((ye=he.task)==null?void 0:ye.state)==="running"})&&!window.confirm(tn("generation.leaveConfirmation"))||(await Promise.allSettled(O.flatMap(he=>{var ye;return((ye=he.task)==null?void 0:ye.state)==="running"?[TDt({jobId:he.task.jobId,expectedRevision:he.task.revision})]:[]})),l())},Me=e==="create"?u("generation.createTitle"):u("generation.optimizeTitle",{name:(a==null?void 0:a.name)||u("generation.skillFallback")}),we=he=>{var ye;return((ye=d==null?void 0:d.models.find(Ae=>Ae.id===he))==null?void 0:ye.label)||he},Ue=he=>he.config.style==="custom"?he.config.customStyle.trim()||u("generation.styles.customFallback"):u(Tse[he.config.style]),ke=[...Object.entries(Tse).map(([he,ye])=>({value:he,label:u(ye)})),{value:"custom",label:u("generation.styles.custom")}],je=he=>he.error||he.repairError?u("generation.stages.failed"):FHt(he),re=he=>!he.error&&!he.repairError&&(he.repairing||!he.task||he.task.state==="running"),ve=O.some(he=>{var ye;return((ye=he.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 Te(),"aria-label":u("generation.back"),children:o.jsx(QHt,{})}),o.jsxs("div",{children:[o.jsx("h1",{children:Me}),o.jsx("p",{children:ac(n)||u("generation.home")})]}),O.length>0?o.jsx("span",{className:"skill-generation__ttl",children:BHt(Q==null?void 0:Q.task,K)}):null]}),E?o.jsxs("div",{className:"skill-generation__workspace",children:[o.jsx("div",{className:"skill-generation__candidate-tabs",role:"tablist","aria-label":u("generation.candidates"),children:O.map(he=>o.jsxs("button",{type:"button",role:"tab","aria-selected":(Q==null?void 0:Q.id)===he.id,className:(Q==null?void 0:Q.id)===he.id?"is-active":"",onClick:()=>C(he.id),children:[o.jsxs("span",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.style")}),o.jsx("strong",{children:Ue(he)})]}),o.jsxs("span",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.model")}),o.jsx("strong",{children:we(he.config.model)})]}),o.jsxs("span",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.progress")}),o.jsxs("strong",{children:[re(he)?o.jsx(jse,{}):null,je(he)]})]})]},he.id))}),Q?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:Ue(Q)})]}),o.jsxs("div",{className:"skill-generation__summary-row",children:[o.jsx("span",{children:u("generation.model")}),o.jsx("strong",{children:we(Q.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:[re(Q)?o.jsx(jse,{}):null,re(Q)?o.jsx(bn,{children:je(Q)}):je(Q)]})]})]})}),Q.task?o.jsx(cLt,{activities:Q.task.activities}):null,Q.pollError?o.jsx("div",{className:"skill-inline-notice",children:o.jsx(bs,{error:Q.pollError})}):null,Q.repairError?o.jsx("div",{className:"skill-inline-notice",children:o.jsx(bs,{error:Q.repairError})}):null,Q.error?o.jsxs("div",{className:"skill-inline-error",children:[o.jsx(bs,{error:Q.error}),o.jsx("button",{type:"button",onClick:()=>void de(Q),children:u("generation.retryCandidate")})]}):null,(be=Q.task)!=null&&be.validation&&!Q.task.validation.valid&&!Q.repairing&&Q.task.state==="failed"?o.jsxs("div",{className:"skill-validation-errors",children:[o.jsx("strong",{children:u("generation.formatValidationFailed")}),Q.task.validation.errors.map(he=>o.jsx("p",{children:he},he)),v4(Q.task)?o.jsx("button",{type:"button",disabled:!!T,onClick:()=>void le(),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")}),((xe=Q.task)==null?void 0:xe.state)==="ready"?o.jsx("button",{type:"button",onClick:()=>void ce(),disabled:!!T,children:u("generation.downloadZip")}):null]}),Q.artifact?o.jsx(KD,{files:Q.artifact.files}):o.jsx("div",{className:"skill-generation__files-empty",children:((Ke=Q.task)==null?void 0:Ke.state)==="ready"?u("generation.loadingFiles"):u("generation.filesPending")})]}),((Ze=Q.task)==null?void 0:Ze.state)==="ready"?o.jsxs("div",{className:"skill-generation__ready-actions",children:[X?o.jsx("div",{className:"skill-generation__publish-target",children:o.jsx(uj,{label:u("generation.uploadToSpace"),value:M,options:Y,onChange:H,disabled:r,placeholder:u(r?"generation.loadingSpaces":"generation.selectSpace")})}):null,o.jsxs("footer",{className:"skill-generation__followup",children:[o.jsx("textarea",{value:A,onChange:he=>N(he.target.value),placeholder:u("generation.continuePlaceholder")}),o.jsx("button",{type:"button",className:"skill-button",disabled:!A.trim()||!!T,onClick:()=>void Ce(),children:u("generation.continue")}),o.jsx("button",{type:"button",className:"skill-button skill-button--primary",disabled:!!T||!!L||!z,onClick:()=>void fe(),children:T==="publish"?D||u("generation.uploading"):u(e==="optimize"?"generation.overwrite":X?"generation.uploadToSelectedSpace":"generation.uploadToCurrentSpace")})]})]}):null,_?o.jsx("div",{className:"skill-inline-error skill-generation__action-error",children:o.jsx(bs,{error:_})}):null]}):null,!ve&&O.every(he=>he.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:he=>b(he.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:he=>y(he.target.value),placeholder:u("generation.autoNamePlaceholder"),"aria-invalid":!!ae,"aria-describedby":"skill-name-help"}),ae?o.jsx("span",{id:"skill-name-help",className:"skill-generation__field-error",role:"alert",children:ae}):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:[w.map((he,ye)=>o.jsxs("article",{className:"skill-generation__group",children:[o.jsxs("header",{children:[o.jsx("strong",{children:u("generation.plan",{count:ye+1})}),w.length>1?o.jsx("button",{type:"button",onClick:()=>x(Ae=>Ae.filter(He=>He.id!==he.id)),children:u("generation.remove")}):null]}),o.jsx(uj,{label:u("generation.model"),required:!0,value:he.model,options:(d==null?void 0:d.models.map(Ae=>({value:Ae.id,label:Ae.label})))||[],onChange:Ae=>Z(he.id,{model:Ae}),allowCustom:!0,placeholder:u("generation.modelPlaceholder"),error:Nse(he.model.trim())}),o.jsx(uj,{label:u("generation.style"),required:!0,value:he.style,options:ke,onChange:Ae=>Z(he.id,{style:Ae})}),he.style==="custom"?o.jsxs("label",{children:[o.jsx("span",{children:u("generation.customStyle")}),o.jsx("textarea",{value:he.customStyle,onChange:Ae=>Z(he.id,{customStyle:Ae.target.value}),placeholder:u("generation.customStylePlaceholder")})]}):null]},he.id)),d&&w.lengthx(he=>[...he,Ase(he.length,d)]),children:u("generation.addConfiguration")}):null]}),h?o.jsx("div",{className:"skill-inline-error",children:o.jsx(bs,{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:!Ee,onClick:()=>void te(),children:u("generation.generate")})})]})]})}async function oFe(e,t,n,i){const r=new URLSearchParams({region:e.region}),s=await fetch(ia(`/web/skill-management/spaces/${encodeURIComponent(e.spaceId)}/skills/${encodeURIComponent(e.skillId)}/versions?${r}`),{...t,headers:Fl(hu(t.headers)),signal:Xa(e.signal,i)});if(!s.ok)throw await uD(s,n);return s.json()}function VHt(e){return oFe(e,{},V("skills.listVersionsFailed"),Ga)}function HHt(e){return oFe(e,{method:"POST",headers:{"Content-Type":"application/zip"},body:e.file},V("skills.uploadVersionFailed"),vr)}function aFe(e){const t=new Map;for(const n of e){const i=`${n.sourceSkillId}:${n.version}`,r=t.get(i);(!r||n.submittedAt>r.submittedAt)&&t.set(i,n)}return t}function qHt(e,t,n,i){const r=i.trim().toLocaleLowerCase();return e.filter(s=>s.kind===t&&(n==="all"||s.status===n)&&`${s.name} ${s.description} ${s.author} ${s.version}`.toLocaleLowerCase().includes(r))}const lFe=p.createContext(void 0);function Ug(e){const t=p.useContext(lFe);if(!e&&t===void 0)throw new Error(gc(27));return t}const x1=p.forwardRef(function(t,n){const{render:i,className:r,style:s,forceRender:a=!1,...l}=t,c=Ug(),u=c.useState("open"),d=c.useState("nested"),f=c.useState("mounted"),h=c.useState("transitionStatus");return Eo("div",t,{state:{open:u,transitionStatus:h},ref:[c.context.backdropRef,n],stateAttributesMapping:e2e,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:a||!d})}),GD=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:a=!1,nativeButton:l=!0,...c}=t,u=Ug(),d=u.useState("open"),{getButtonProps:f,buttonRef:h}=dP({disabled:a,native:l}),m={disabled:a};function g(b){d&&u.setOpen(!1,to(oAe,b.nativeEvent))}return Eo("button",t,{state:m,ref:[n,h],props:[{onClick:g},c,f]})}),ET=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:a,...l}=t,c=Ug(),u=pp(a);return c.useSyncedValueWithCleanup("descriptionElementId",u),Eo("p",t,{ref:n,props:[{id:u},l]})}),cFe=p.createContext(void 0);function WHt(){const e=p.useContext(cFe);if(e===void 0)throw new Error(gc(26));return e}const KHt={...hQ,...uP,nestedDialogOpen(e){return e?{"data-nested-dialog-open":""}:null}},w1=p.forwardRef(function(t,n){const{render:i,className:r,style:s,finalFocus:a,initialFocus:l,...c}=t,u=Ug(),d=u.useState("descriptionElementId"),f=u.useState("disablePointerDismissal"),h=u.useState("floatingRootContext"),m=u.useState("popupProps"),g=u.useState("modal"),b=u.useState("mounted"),v=u.useState("nested"),y=u.useState("nestedOpenDialogCount"),w=u.useState("open"),x=u.useState("openMethod"),O=u.useState("titleElementId"),S=u.useState("transitionStatus"),k=u.useState("role"),C=h.useState("floatingId");WHt(),AC({open:w,ref:u.context.popupRef,onComplete(){var j,_;w&&((_=(j=u.context).onOpenChangeComplete)==null||_.call(j,!0))}});const E=l===void 0?MAe(u.context.popupRef):l,R=y>0,A=u.useStateSetter("popupElement"),T=Eo("div",t,{state:{open:w,nested:v,transitionStatus:S,nestedDialogOpen:R},props:[m,{id:C,"aria-labelledby":O,"aria-describedby":d,role:k,...DAe,hidden:!b,onKeyDown(j){JMe.has(j.key)&&j.stopPropagation()},style:{"--nested-dialogs":y}},c],ref:[n,u.context.popupRef,A],stateAttributesMapping:KHt});return o.jsx(yAe,{context:h,openInteractionType:x,disabled:!b,closeOnFocusOut:!f,initialFocus:E,returnFocus:a,modal:g!==!1,restoreFocus:"popup",children:T})}),O1=p.forwardRef(function(t,n){const{keepMounted:i=!1,...r}=t,s=Ug(),a=s.useState("mounted"),l=s.useState("modal"),c=s.useState("open");return a||i?o.jsx(cFe.Provider,{value:i,children:o.jsxs(fAe,{ref:n,...r,children:[a&&l===!0&&o.jsx(YMe,{ref:s.context.internalBackdropRef,inert:rQ(!c)}),t.children]})}):null});function GHt({store:e,parentContext:t,isDrawer:n}){const i=e.useState("open"),r=e.useState("disablePointerDismissal"),s=e.useState("modal"),a=e.useState("popupElement"),l=e.useState("floatingRootContext"),[c,u]=p.useState(0),[d,f]=p.useState(0),h=c===0,m=xAe(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(g){if(!e.context.outsidePressEnabledRef.current||"button"in g&&g.button!==0)return!1;if("touches"in g){if(g.type==="touchend"){if(g.changedTouches.length!==1||g.touches.length!==0)return!1}else if(g.touches.length!==1)return!1}const b=na(g);if(h&&!r){if(s){const v=e.context.internalBackdropRef.current,y=e.context.backdropRef.current;return v||y?v===b||y===b||qn(b,a)&&!(b!=null&&b.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:h});return ZMe(i&&s===!0,a),e.useContextCallback("onNestedDialogOpen",(g,b)=>{u(g),f(b)}),Qn(()=>(t!=null&&t.onNestedDialogOpen&&(i?t.onNestedDialogOpen(c+1,d+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t!=null&&t.onNestedDialogOpen&&i&&t.onNestedDialogOpen(0,0)}),[n,i,c,d,t]),zAe(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:d}),null}const XHt={...KAe,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class YHt extends nP{constructor(n,i,r){const s=new uQ,a=ZHt(n,s,i,r);super(a,JHt(s),XHt);rn(this,"setOpen",(n,i)=>{var s,a;if(i.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&i.trigger==null&&this.state.activeTriggerId!=null&&(i.trigger=this.state.activeTriggerElement??void 0),(a=(s=this.context).onOpenChange)==null||a.call(s,n,i),i.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,i);const r={open:n};FAe(r,n,i.trigger),this.update(r)})}}function ZHt(e,t,n,i=!1){const r={...HAe(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e};return r.floatingRootContext=qAe(t,n,i),r}function JHt(e){return{popupRef:p.createRef(),backdropRef:p.createRef(),internalBackdropRef:p.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function eqt(e,t){const{children:n,open:i,defaultOpen:r=!1,onOpenChange:s,onOpenChangeComplete:a,disablePointerDismissal:l=!1,modal:c=!0,actionsRef:u,handle:d,triggerId:f,defaultTriggerId:h=null}=t,m=e==="drawer",g=c,b=l,v="dialog",y=Ug(!0),w=y!=null,x={modal:g,disablePointerDismissal:b,nested:w,role:v},O=LAe((A,N)=>new YHt({open:r,openProp:i,activeTriggerId:h,triggerIdProp:f,...x},A,N),!0);O.useControlledProp("openProp",i),O.useControlledProp("triggerIdProp",f),O.useSyncedValues(x),O.useContextCallback("onOpenChange",s),O.useContextCallback("onOpenChangeComplete",a);const S=O.useState("open"),k=O.useState("mounted"),C=O.useState("payload");VAe(O,S),UAe(O);const{forceUnmount:E}=QAe(S,O);p.useImperativeHandle(u,()=>({unmount:E,close:()=>O.setOpen(!1,to(lAe))}),[E,O]);const R=S||k;return o.jsxs(lFe.Provider,{value:O,children:[d&&o.jsx($Ae,{handle:d,store:O}),R&&o.jsx(GHt,{store:O,parentContext:y==null?void 0:y.context,isDrawer:m}),typeof n=="function"?n({payload:C}):n]})}function k1(e){return eqt("dialog",e)}const S1=p.forwardRef(function(t,n){const{render:i,className:r,style:s,id:a,...l}=t,c=Ug(),u=pp(a);return c.useSyncedValueWithCleanup("titleElementId",u),Eo("h2",t,{ref:n,props:[{id:u},l]})}),uFe=p.forwardRef(function(t,n){const{render:i,className:r,style:s,disabled:a=!1,nativeButton:l=!0,id:c,payload:u,handle:d,...f}=t,h=Ug(!0),g=GAe(d)??h;if(!g)throw new Error(gc(79));const b=pp(c),v=g.useState("floatingRootContext"),y=g.useState("isOpenedByTrigger",b),w=g.useState("triggerPopupId",b),x=p.useRef(null),{registerTrigger:O,isMountedByThisTrigger:S}=BAe(b,x,g,{payload:u}),{getButtonProps:k,buttonRef:C}=dP({disabled:a,native:l}),E=vAe(v),R=KMe(()=>g.select("open"),T=>{g.set("openMethod",T)}),A={disabled:a,open:y},N=g.useState("triggerProps",S);return Eo("button",t,{state:A,ref:[C,n,O,x],props:[E.reference,N,R,{[oQ]:"",id:b,"aria-haspopup":"dialog","aria-expanded":y,"aria-controls":w},f,k],stateAttributesMapping:JAe})});async function dFe(e,t){const n=new URLSearchParams({region:e.region}),i=t?"/retry":`?${n}`,r=await fetch(ia(`/web/skill-management/reviews/${encodeURIComponent(e.id)}/score${i}`),{method:t?"POST":"GET",headers:Fl(hu(t?{"Content-Type":"application/json"}:void 0)),...t?{body:JSON.stringify({region:e.region})}:{},signal:Xa(e.signal,Ga)});if(!r.ok)throw await uD(r,mn.t(t?"score.retryFailed":"score.loadFailed",{ns:"reviews"}));return r.json()}const tqt=e=>dFe(e,!1),nqt=e=>dFe(e,!0),iqt=["safety","usability","completeness","reliability","maintainability"];function fFe(e){return(e==null?void 0:e.status)==="queued"||(e==null?void 0:e.status)==="running"}function rqt(e){if(e.status!=="not_requested")return{status:e.status,overallScore:e.overallScore,scoredAt:e.scoredAt,modelName:e.modelName,rubricVersion:e.rubricVersion,error:e.error}}function oq({score:e}){const{t}=_e("reviews");return o.jsx("span",{className:`review-score-label is-${(e==null?void 0:e.status)||"unscored"}`,children:(e==null?void 0:e.status)==="completed"?typeof e.overallScore=="number"?t("score.points",{score:e.overallScore}):t("score.insufficient"):t(`score.status.${(e==null?void 0:e.status)||"unscored"}`)})}function hFe({application:e,canRetry:t=!1,onScoreChanged:n}){const{t:i,i18n:r}=_e("reviews"),[s,a]=p.useState(e.aiReview),[l,c]=p.useState(!!e.aiReview),[u,d]=p.useState(null),[f,h]=p.useState({revision:0,retry:!1}),[m,g]=p.useState(""),b=p.useRef(-1),v=p.useRef(n);v.current=n;const{id:y,region:w}=e,x=!!e.aiReview;p.useEffect(()=>{if(!x&&f.revision===0)return;const k=new AbortController;let C,E=!1,R=!0;const A=async(j,_=!1)=>{var I;if(!(E||k.signal.aborted)&&!(!_&&document.visibilityState==="hidden")){E=!0,_&&c(!0),d(null);try{const D=await(j?nqt:tqt)({id:y,region:w,signal:k.signal});if(k.signal.aborted)return;a(D),(I=v.current)==null||I.call(v,D,j),R=fFe(D),R&&document.visibilityState!=="hidden"&&(C=setTimeout(()=>void A(!1),5e3))}catch(D){k.signal.aborted||(R=!1,d(Er(D,i(j?"score.retryFailed":"score.loadFailed"))))}finally{E=!1,k.signal.aborted||c(!1)}}},N=()=>{clearTimeout(C),R&&document.visibilityState!=="hidden"&&A(!1)},T=f.retry&&b.current!==f.revision;return T&&(b.current=f.revision),A(T,!0),document.addEventListener("visibilitychange",N),()=>{k.abort(),clearTimeout(C),document.removeEventListener("visibilitychange",N)}},[y,w,x,f,i]);const O=(s==null?void 0:s.status)==="completed"?s.result:void 0;p.useEffect(()=>{if(!O){g("");return}const k=URL.createObjectURL(new Blob([JSON.stringify(O,null,2)],{type:"application/json"}));return g(k),()=>URL.revokeObjectURL(k)},[O]);const S=k=>h(C=>({revision:C.revision+1,retry:k}));return o.jsxs("section",{className:"review-score","aria-label":i("score.title"),children:[o.jsxs("div",{className:"review-score__header",children:[o.jsx("div",{"aria-live":"polite",children:l?o.jsx(bn,{children:i(f.retry?"score.starting":"score.loading")}):o.jsx(oq,{score:s})}),o.jsxs("div",{className:"review-score__actions",children:[m?o.jsx("a",{className:"cw-btn cw-btn-ghost",href:m,download:`${y}-score.json`,children:i("score.download")}):null,t&&(!s||s.status==="failed"||s.status==="not_requested")?o.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:l,onClick:()=>S(!0),children:i((s==null?void 0:s.status)==="failed"?"score.retry":"score.start")}):null]})]}),o.jsx("p",{className:"review-score__hint",children:i("score.hint")}),u?o.jsxs("div",{className:"review-score__error",role:"alert",children:[o.jsx(bs,{error:u}),o.jsx("button",{type:"button",className:"cw-btn cw-btn-ghost",disabled:l,onClick:()=>S(!1),children:i("score.reload")})]}):null,s!=null&&s.error?o.jsx("div",{role:"alert",className:"review-score__error",children:o.jsxs("details",{className:"review-score__raw-error",open:!0,children:[o.jsx("summary",{children:i("score.originalError")}),o.jsx("pre",{children:s.error})]})}):(s==null?void 0:s.status)==="failed"?o.jsx("p",{role:"alert",className:"review-score__error",children:i("score.failed")}):null,O?o.jsxs(o.Fragment,{children:[O.riskFlags.length?o.jsxs("div",{className:"review-score__risks",children:[o.jsx("h3",{children:i("score.risks")}),o.jsx("ul",{children:O.riskFlags.map((k,C)=>o.jsxs("li",{children:[o.jsx("strong",{children:i(`score.severity.${k.severity}`)})," · ",k.reason]},`${C}:${k.reason}`))})]}):null,O.coverage&&!O.coverage.complete?o.jsxs("div",{className:"review-score__coverage",children:[o.jsx("h3",{children:i("score.coverage")}),o.jsx("p",{children:i("score.coverageIncomplete")}),o.jsx("p",{children:i("score.coverageCount",{included:O.coverage.includedFiles,total:O.coverage.totalFiles})}),o.jsxs("ul",{children:[O.coverage.omittedFiles.map(k=>o.jsx("li",{children:i("score.omittedFile",k)},`omitted:${k.path}`)),O.coverage.truncatedFiles.map(k=>o.jsx("li",{children:i("score.truncatedFile",k)},`truncated:${k.path}`))]})]}):null,o.jsx("dl",{className:"review-score__dimensions",children:iqt.map(k=>{const C=O.dimensions[k];return o.jsxs("div",{className:k==="safety"&&C.score!==null&&C.score<60?"is-risk":void 0,children:[o.jsxs("dt",{children:[o.jsx("span",{children:i(`score.dimensions.${k}`)}),o.jsx("strong",{children:C.score===null?i("score.insufficient"):i("score.points",{score:C.score})})]}),o.jsx("dd",{children:C.reason})]},k)})}),O.suggestions.length?o.jsxs("div",{className:"review-score__suggestions",children:[o.jsx("h3",{children:i("score.suggestions")}),o.jsx("ul",{children:O.suggestions.map((k,C)=>o.jsx("li",{children:k},`${C}:${k}`))})]}):null,o.jsxs("dl",{className:"review-score__metadata",children:[o.jsxs("div",{children:[o.jsx("dt",{children:i("score.model")}),o.jsx("dd",{children:O.modelName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:i("score.rubric")}),o.jsx("dd",{children:O.rubricVersion})]}),o.jsxs("div",{children:[o.jsx("dt",{children:i("score.time")}),o.jsx("dd",{children:o.jsx("time",{dateTime:O.scoredAt,children:new Date(O.scoredAt).toLocaleString(r.language,{hour12:!1})})})]})]})]}):null]})}function sqt({application:e}){const{t}=_e("reviews"),[n,i]=p.useState(!1),[r,s]=p.useState(e.aiReview),a=p.useId();return p.useEffect(()=>s(e.aiReview),[e.aiReview]),o.jsxs("div",{className:"review-score-history",children:[o.jsxs("button",{type:"button",className:"review-score-history__toggle","aria-expanded":n,"aria-controls":a,onClick:()=>i(l=>!l),children:[o.jsx("span",{children:t("score.title")}),o.jsx(oq,{score:r}),o.jsx("span",{children:t(n?"score.collapse":"score.expand")})]}),n?o.jsx("div",{id:a,children:o.jsx(hFe,{application:e,onScoreChanged:s},`${e.region}:${e.id}`)}):null]})}function CT({status:e}){const{t}=_e("reviews");return o.jsxs("span",{className:`review-status is-${e}`,children:[o.jsx("span",{"aria-hidden":"true"}),t(`status.${e}`)]})}function aq({person:e,fallback:t,compact:n=!1}){const{t:i}=_e("reviews"),[r,s]=p.useState(""),a=(e==null?void 0:e.name)||t||i("detail.unknownReviewer"),l=e==null?void 0:e.avatarUrl;return o.jsxs("span",{className:`review-person${n?" is-compact":""}`,children:[l&&l!==r?o.jsx("img",{className:"review-person__avatar",src:l,alt:"",referrerPolicy:"no-referrer",onError:()=>s(l)}):o.jsx("span",{className:"review-person__avatar is-fallback","aria-hidden":"true",children:Array.from(a)[0]}),o.jsxs("span",{className:"review-person__text",children:[o.jsx("span",{children:a}),!n&&(e!=null&&e.email)?o.jsx("span",{className:"review-person__email",children:e.email}):null]})]})}function lq({application:e}){const{t,i18n:n}=_e("reviews");return o.jsxs("div",{className:"review-outcome",children:[o.jsx(CT,{status:e.status}),e.reviewer||e.reviewedBy||e.reviewedAt?o.jsxs("dl",{className:"review-outcome__facts",children:[e.reviewer||e.reviewedBy?o.jsxs("div",{children:[o.jsx("dt",{children:t(`detail.${e.status==="returned"?"returnedBy":e.status==="approved"?"approvedBy":"reviewer"}`)}),o.jsx("dd",{children:o.jsx(aq,{person:e.reviewer,fallback:e.reviewedBy})})]}):null,e.reviewedAt?o.jsxs("div",{children:[o.jsx("dt",{children:t("detail.reviewedAt")}),o.jsx("dd",{children:o.jsx("time",{dateTime:e.reviewedAt,children:new Date(e.reviewedAt).toLocaleString(n.language,{hour12:!1})})})]}):null]}):null,e.reason?o.jsxs("div",{className:"review-outcome__message is-returned",children:[o.jsx("strong",{children:t("decision.reason")}),o.jsx("p",{children:e.reason})]}):null,e.comment?o.jsxs("div",{className:"review-outcome__message",children:[o.jsx("strong",{children:t("detail.comment")}),o.jsx("p",{children:e.comment})]}):null,e.status==="pending"?o.jsx("p",{className:"review-outcome__hint",children:t("detail.pendingHint")}):null,e.status==="approving"?o.jsx("p",{className:"review-outcome__hint",children:t("detail.approvingHint")}):null]})}function cq({applications:e}){const{t,i18n:n}=_e("reviews");return e.length?o.jsx("ol",{className:"review-source-history",children:[...e].sort((i,r)=>r.submittedAt.localeCompare(i.submittedAt)).map(i=>o.jsxs("li",{children:[o.jsxs("div",{className:"review-source-history__submission",children:[o.jsx("strong",{children:i.version}),o.jsx("span",{children:t("detail.submitted",{name:i.author})}),o.jsx("time",{dateTime:i.submittedAt,children:new Date(i.submittedAt).toLocaleString(n.language,{hour12:!1})})]}),o.jsx(lq,{application:i}),o.jsx(sqt,{application:i})]},i.id))}):o.jsx("p",{className:"review-outcome__hint",children:t("detail.noHistory")})}function oqt({name:e,applications:t,onClose:n}){const{t:i}=_e("reviews"),r=p.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);return o.jsx(k1,{open:!0,onOpenChange:s=>{s||n()},children:o.jsxs(O1,{children:[o.jsx(x1,{className:"review-backdrop"}),o.jsxs(w1,{className:"review-drawer",finalFocus:()=>{var s;return(s=r.current)!=null&&s.isConnected?r.current:null},children:[o.jsxs("header",{className:"review-drawer__header",children:[o.jsxs("div",{children:[o.jsx(S1,{children:i("detail.history")}),o.jsx(ET,{children:e})]}),o.jsx(GD,{className:"review-icon-button","aria-label":i("actions.close"),children:o.jsx(vD,{})})]}),o.jsx("div",{className:"review-drawer__body",children:o.jsx(cq,{applications:t})})]})]})})}function aqt({skill:e,space:t,region:n,reviews:i,onClose:r,onChanged:s,onSubmitReview:a}){const{t:l,i18n:c}=_e("ui"),[u,d]=p.useState(null),[f,h]=p.useState(e.version),[m,g]=p.useState(!0),[b,v]=p.useState(null),[y,w]=p.useState(null),[x,O]=p.useState([]),[S,k]=p.useState(!1),[C,E]=p.useState(null),[R,A]=p.useState(0),[N,T]=p.useState(0),[j,_]=p.useState(null),I=p.useRef(null),D=p.useRef(null),P=p.useRef(null),L=p.useRef(!1),B=p.useRef(!0),M=p.useRef({onClose:r,busy:j});M.current={onClose:r,busy:j};const H=u==null?void 0:u.items.find(Y=>Y.version===f),K=p.useMemo(()=>aFe(i),[i]),F=K.get(`${e.skillId}:${f}`),q=i.filter(Y=>Y.sourceSkillId===e.skillId&&Y.version===f&&Y.id!==(F==null?void 0:F.id)),Q=!!(a&&(u!=null&&u.canUpdate)&&H&&["running","ready"].includes(H.status.toLowerCase())&&(!F||F.status==="returned"));p.useEffect(()=>{var Ee;B.current=!0;const Y=document.activeElement instanceof HTMLElement?document.activeElement:null;(Ee=P.current)==null||Ee.focus();const ae=Z=>{var Ce;if(Z.key==="Escape"&&(Z.preventDefault(),M.current.busy||M.current.onClose()),Z.key!=="Tab")return;const G=Array.from(((Ce=I.current)==null?void 0:Ce.querySelectorAll('button:not([disabled]), input:not([disabled]):not([type="file"]), a[href], summary, [tabindex="0"]'))||[]),te=G[0],de=G[G.length-1];Z.shiftKey&&document.activeElement===te&&(Z.preventDefault(),de==null||de.focus()),!Z.shiftKey&&document.activeElement===de&&(Z.preventDefault(),te==null||te.focus())};return document.addEventListener("keydown",ae),()=>{B.current=!1,document.removeEventListener("keydown",ae),Y!=null&&Y.isConnected&&Y.focus()}},[]),p.useEffect(()=>{const Y=new AbortController;return g(!0),v(null),VHt({spaceId:t.id,skillId:e.skillId,region:n,signal:Y.signal}).then(ae=>{Y.signal.aborted||(d(ae),h(Ee=>{var Z;return ae.items.some(G=>G.version===Ee)?Ee:((Z=ae.items[0])==null?void 0:Z.version)||""}))}).catch(ae=>{Y.signal.aborted||v(Er(ae,l("skillCenter.versions.loadFailed")))}).finally(()=>{Y.signal.aborted||g(!1)}),()=>Y.abort()},[t.id,e.skillId,n,R,l]),p.useEffect(()=>{if(!f||!H)return;let Y=!0;return k(!0),E(null),O([]),VMe({spaceId:t.id,skillId:e.skillId,region:n,version:f}).then(ae=>{Y&&O(ae)}).catch(ae=>{Y&&E(Er(ae,l("skillCenter.versions.filesFailed")))}).finally(()=>{Y&&k(!1)}),()=>{Y=!1}},[t.id,e.skillId,n,f,!!H,N,l]);async function X(Y){if(!L.current){L.current=!0,_("upload"),w(null);try{const ae=await HHt({spaceId:t.id,skillId:e.skillId,region:n,file:Y});if(!B.current)return;h(ae.version),A(Ee=>Ee+1),s()}catch(ae){B.current&&w(Er(ae,l("skillCenter.versions.uploadFailed")))}finally{L.current=!1,B.current&&_(null)}}}async function ne(){if(!(!Q||!a||L.current)){L.current=!0,_("submit"),w(null);try{await a(f)}catch(Y){B.current&&w(Er(Y,l("skillCenter.versions.submitFailed")))}finally{L.current=!1,B.current&&_(null)}}}function z(Y){if(!Y)return"—";const ae=new Date(Y);return Number.isNaN(ae.getTime())?Y:ae.toLocaleString(c.resolvedLanguage||c.language)}return o.jsx("div",{className:"skill-detail-backdrop",onMouseDown:Y=>{Y.target===Y.currentTarget&&!j&&r()},children:o.jsxs("section",{className:"skill-detail-dialog skill-versions",role:"dialog","aria-modal":"true","aria-labelledby":"skill-versions-title",ref:I,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-versions-title",children:l("skillCenter.versions.title")}),o.jsx("p",{title:e.skillName,children:e.skillName})]})}),o.jsxs("div",{className:"skill-detail-actions",children:[o.jsx("button",{type:"button",disabled:m||!!j,onClick:()=>A(Y=>Y+1),children:l("skillCenter.versions.refresh")}),u!=null&&u.canUpdate?o.jsx("button",{type:"button",disabled:!!j,onClick:()=>{var Y;return(Y=D.current)==null?void 0:Y.click()},children:l(j==="upload"?"skillCenter.versions.uploading":"skillCenter.versions.upload")}):null,o.jsx("button",{type:"button",ref:P,disabled:!!j,onClick:r,children:l("skillCenter.versions.close")})]}),o.jsx("input",{className:"skill-versions__file-input",ref:D,type:"file",accept:".zip,application/zip","aria-label":l("skillCenter.versions.upload"),onChange:Y=>{var Ee;const ae=(Ee=Y.target.files)==null?void 0:Ee[0];Y.target.value="",ae&&X(ae)}})]}),y?o.jsx("div",{className:"skill-versions__notice",role:"alert",children:o.jsx(bs,{error:y})}):null,u!=null&&u.canUpdate?o.jsx("p",{className:"skill-versions__hint",children:l("skillCenter.versions.hint")}):null,o.jsxs("div",{className:"skill-versions__body",children:[o.jsxs("div",{className:"skill-versions__history","aria-busy":m,children:[m&&!u?o.jsx("p",{role:"status",children:l("skillCenter.versions.loading")}):null,b?o.jsxs("div",{role:"alert",children:[o.jsx(bs,{error:b}),o.jsx("button",{className:"cw-btn cw-btn-ghost",type:"button",onClick:()=>A(Y=>Y+1),children:l("skillCenter.versions.retry")})]}):null,!m&&!b&&!(u!=null&&u.items.length)?o.jsx("p",{children:l("skillCenter.versions.empty")}):null,o.jsx("div",{className:"skill-versions__list",role:"list","aria-label":l("skillCenter.versions.title"),children:u==null?void 0:u.items.map(Y=>o.jsx("div",{role:"listitem",children:o.jsxs("button",{type:"button",className:`skill-versions__version${f===Y.version?" is-active":""}`,"aria-pressed":f===Y.version,onClick:()=>h(Y.version),children:[o.jsxs("span",{className:"skill-versions__version-title",children:[o.jsx("strong",{children:Y.sourceVersion||Y.version}),Y.isCurrent?o.jsx("span",{children:l("skillCenter.versions.current")}):null]}),o.jsx("time",{dateTime:Y.createdAt,children:z(Y.createdAt)}),K.get(`${e.skillId}:${Y.version}`)?o.jsx(CT,{status:K.get(`${e.skillId}:${Y.version}`).status}):o.jsx("span",{children:l(t.isShared?"skillCenter.versions.shared":"skillCenter.versions.notSubmitted")})]})},Y.version))})]}),o.jsx("div",{className:"skill-versions__detail",children:H?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"skill-versions__summary",children:[o.jsxs("div",{children:[o.jsx("h3",{children:H.sourceVersion||H.version}),o.jsx("p",{title:H.description,children:H.description}),H.author||e.author?o.jsx("p",{className:"skill-versions__author",children:l("skillCenter.authorName",{name:H.author||e.author})}):null]}),a&&(u!=null&&u.canUpdate)?o.jsx("button",{type:"button",className:"cw-btn cw-btn-primary",disabled:!Q||!!j,onClick:()=>void ne(),children:l(j==="submit"?"skillCenter.versions.submitting":"skillCenter.versions.submit")}):null]}),H.error?o.jsx("p",{className:"skill-versions__notice",role:"alert",children:H.error}):null,["running","ready"].includes(H.status.toLowerCase())?null:o.jsx("p",{role:"status",children:l("skillCenter.versions.processing",{status:H.status})}),F?o.jsx(lq,{application:F}):null,q.length?o.jsxs("details",{className:"skill-versions__review-history",children:[o.jsx("summary",{children:l("skillCenter.versions.history")}),o.jsx(cq,{applications:q})]}):null,o.jsx("div",{className:"skill-versions__files",children:S?o.jsx("p",{role:"status",children:l("skillCenter.versions.filesLoading")}):C?o.jsxs("div",{role:"alert",children:[o.jsx(bs,{error:C}),o.jsx("button",{className:"cw-btn cw-btn-ghost",type:"button",onClick:()=>T(Y=>Y+1),children:l("skillCenter.versions.retry")})]}):x.length?o.jsx(KD,{files:x},f):o.jsx("p",{children:l("skillCenter.versions.filesEmpty")})})]}):null})]})]})})}function lqt({region:e,active:t,revision:n,onOpen:i}){const{t:r}=_e("ui"),[s,a]=p.useState(null),[l,c]=p.useState(null),[u,d]=p.useState(0);return p.useEffect(()=>{if(!t)return;const f=new AbortController;return c(null),sDt({region:e,signal:f.signal}).then(h=>{f.signal.aborted||a(h)}).catch(h=>{f.signal.aborted||c(Er(h,r("skillCenter.sharedLoadFailed")))}),()=>f.abort()},[t,e,u,n,r]),o.jsxs("div",{className:"skillcenter-shared-space",children:[o.jsx(s0,{className:"skillcenter-space-card",title:r("skillCenter.sharedSpace"),description:r("skillCenter.sharedDescription"),status:o.jsx("span",{className:"skillcenter-shared-badge",children:r("skillCenter.sharedVisibility")}),metadata:[{label:r("skillCenter.skillCount"),value:s?r("skillCenter.skillCountValue",{count:s.skillCount??0}):r(l?"skillCenter.sharedLoadFailed":"skillCenter.sharedPreparing")}],detailAction:{label:r("common.viewDetails"),disabled:!s||!!l,onClick:()=>{s&&i(s)}},action:l?{label:r("common.reload"),onClick:()=>d(f=>f+1)}:void 0}),l?o.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:o.jsx(bs,{error:l})}):null]})}function uq({title:e,children:t,onClose:n,className:i=""}){const{t:r}=_e("skills"),s=p.useRef(null);return p.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 cqt({region:e,regionOptions:t,onClose:n,onCreated:i}){const{t:r}=_e("skills"),[s,a]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(e),[f,h]=p.useState(!1),[m,g]=p.useState(null),b=async()=>{if(s.trim()){h(!0),g(null);try{const v=await rDt({name:s.trim(),description:l.trim()||void 0,region:u});i({...v,region:v.region||u})}catch(v){g(Er(v,r("management.createSpaceFailed")))}finally{h(!1)}}};return o.jsxs(uq,{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(uj,{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)})]}),m?o.jsx("div",{className:"skill-inline-error",children:o.jsx(bs,{error:m})}):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 uqt({space:e,region:t,onClose:n,onUpdated:i}){const{t:r}=_e("skills"),[s,a]=p.useState(e.name),[l,c]=p.useState(e.description||""),[u,d]=p.useState(!1),[f,h]=p.useState(null),m=async()=>{if(s.trim()){d(!0),h(null);try{const g=await dDt({spaceId:e.id,name:s.trim(),description:l.trim()||void 0,region:t});i({...e,...g,skillCount:e.skillCount})}catch(g){h(Er(g,r("management.updateSpaceFailed")))}finally{d(!1)}}};return o.jsxs(uq,{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(bs,{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 m(),children:r(u?"management.saving":"management.save")})]})]})}function dqt({space:e,region:t,onClose:n,onUploaded:i}){const{t:r,i18n:s}=_e("skills"),[a,l]=p.useState(null),[c,u]=p.useState(null),[d,f]=p.useState(!1),[h,m]=p.useState(!1),[g,b]=p.useState(null),[v,y]=p.useState(!1),w=p.useRef(0),x=p.useRef(null),O=async k=>{const C=w.current+1;if(w.current=C,l(k),u(null),b(null),f(!!k),!!k)try{const E=await pDt(k);w.current===C&&u({name:E.name,fileCount:E.files.length})}catch(E){w.current===C&&b(Er(E,r("management.archiveValidationFailed")))}finally{w.current===C&&f(!1)}},S=async()=>{if(!(!a||!c)){m(!0),b(null);try{await hDt({spaceId:e.id,region:t,project:e.projectName,file:a}),i()}catch(k){b(Er(k,r("management.uploadFailed")))}finally{m(!1)}}};return o.jsxs(uq,{title:r("management.uploadTitle",{name:ac(e)}),className:"skill-upload-dialog",onClose:n,children:[o.jsxs("div",{className:"skill-dialog__body",children:[o.jsx("input",{ref:x,className:"skill-upload-dialog__input",type:"file",accept:".zip,application/zip",onChange:k=>{var C;return void O(((C=k.target.files)==null?void 0:C[0])||null)}}),o.jsxs("button",{type:"button",className:`skill-upload-dropzone${v?" is-dragging":""}`,onClick:()=>{var k;return(k=x.current)==null?void 0:k.click()},onDragEnter:k=>{k.preventDefault(),y(!0)},onDragOver:k=>{k.preventDefault(),k.dataTransfer.dropEffect="copy",y(!0)},onDragLeave:k=>{k.currentTarget.contains(k.relatedTarget)||y(!1)},onDrop:k=>{var C;k.preventDefault(),y(!1),O(((C=k.dataTransfer.files)==null?void 0:C[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(bs,{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 S(),children:r(h?"management.uploading":"management.upload")})]})]})}function fqt(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 XD(e,t=Date.now(),n="zh-CN"){if(e===void 0||e==="")return"—";const i=fqt(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,m)=>n.toLowerCase().startsWith("zh")?`${f} ${m}前`: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 hqt=12,Rse=12;function YR({disabled:e,placement:t="top",children:n}){const{t:i}=_e("ui"),r=p.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 pqt=new Set(["active","available","creating","disabled","enabled","failed","inactive","pending","published","ready","released","running","success","unavailable","unreleased","updating"]);function pFe(e,t){const n=(e||"").trim().toLowerCase();return pqt.has(n)?t(`skillCenter.status.${n}`):t("skillCenter.status.unknown")}function mqt(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 gqt(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 Ise(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 Mc(e){return`${e.region||"default"}:${e.projectName||"default"}:${e.id}`}function bqt(e,t){const n=new Map(e.map(i=>[Mc(i),i]));for(const i of t)n.set(Mc(i),i);return[...n.values()].sort((i,r)=>Ise(r.updatedAt)-Ise(i.updatedAt))}function yqt(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 lFe(e,t){const n=(e||"").trim();return!n||[">",">-","|","|-"].includes(n)?t("common.noDescription"):n}function fqt(){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 hqt(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 Pse({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 pqt(){return o.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function mqt({page:e,total:t,pageSize:n,onPage:i}){const{t:r}=je("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(Pse,{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(Pse,{direction:"right"})})]})]})}function gqt({children:e}){return o.jsx("div",{className:"skillcenter-empty",children:e})}function x4({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(Rn,{fill:"none",children:[o.jsx(Rn.Title,{children:t}),n?o.jsx(Rn.Description,{children:n}):null,i?o.jsx(ps,{error:i}):null,r?o.jsx(Rn.ActionRow,{children:o.jsx(It,{color:"secondary",size:"lg",onClick:r.onClick,children:r.label})}):null]})})}function Dse({errors:e,cloudProvider:t,fullPage:n=!1,onRetry:i}){const{t:r}=je("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:Lf(s,t)}),o.jsx(ps,{error:a})]},s))]}),o.jsx("button",{type:"button",onClick:i,children:r("common.reload")})]})}function bqt({skill:e,space:t,region:n,cloudProvider:i,detail:r,files:s,loading:a,error:l,canOptimize:c,reviews:u,reviewsLoading:d,reviewsError:f,onOptimize:h,onDownload:m,onClose:g}){const{t:b}=je("ui"),[v,y]=p.useState("files");return p.useEffect(()=>{const w=x=>{x.key==="Escape"&&g()};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[g]),o.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:g,children:o.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:w=>w.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:lFe((r==null?void 0:r.description)||e.skillDescription,b)})]})}),o.jsxs("div",{className:"skill-detail-actions",children:[o.jsx("button",{type:"button",onClick:m,disabled:s.length===0,children:b("skillCenter.downloadZip")}),t.isShared?null:o.jsx(XR,{disabled:!c,placement:"bottom",children:o.jsx("button",{type:"button",onClick:h,disabled:!c,children:b("skillCenter.optimize")})}),o.jsx("button",{type:"button",className:"skill-detail-close",onClick:g,"aria-label":b("skillCenter.closeSkillDetails"),children:o.jsx(fqt,{})})]})]}),o.jsxs("dl",{className:"skill-detail-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:b("skillCenter.skillId")}),o.jsx("dd",{title:e.skillId,children:e.skillId})]}),o.jsxs("div",{children:[o.jsx("dt",{children:b("agentSelector.version")}),o.jsx("dd",{children:e.sourceVersion||(r==null?void 0:r.version)||e.version||"—"})]}),e.author?o.jsxs("div",{children:[o.jsx("dt",{children:b("skillCenter.author")}),o.jsx("dd",{children:e.author})]}):null,o.jsxs("div",{children:[o.jsx("dt",{children:b("agentSelector.status")}),o.jsx("dd",{children:aFe(e.skillStatus,b)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:b("skillCenter.skillSpace")}),o.jsx("dd",{title:oc(t),children:t.isShared?b("skillCenter.sharedSpace"):oc(t)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:b("myAgents.region")}),o.jsx("dd",{children:Lf(n,i)})]})]}),o.jsx(t0,{className:"skill-detail-tabs",idPrefix:"skill-detail",ariaLabel:b("skillCenter.skillDetailSections"),value:v,items:[{id:"files",label:b("skillCenter.allFiles"),panelId:"skill-detail-panel"},{id:"reviews",label:b("skillCenter.reviewHistory"),panelId:"skill-detail-panel"}],onChange:y}),o.jsx("div",{className:`skill-detail-content${v==="files"?" skill-detail-content--files":" skill-detail-content--reviews"}`,id:"skill-detail-panel",role:"tabpanel","aria-labelledby":`skill-detail-${v}-tab`,children:v==="reviews"?d?o.jsx(Ha,{}):f?o.jsx("div",{role:"alert",children:o.jsx(ps,{error:f})}):o.jsx(cq,{applications:u}):a?o.jsxs("div",{className:"skillcenter-loading",children:[o.jsx(pqt,{}),b("skillCenter.loadingSkillContent")]}):l?o.jsx("div",{className:"skillcenter-error",children:o.jsx(ps,{error:l})}):s.length>0?o.jsx(WD,{files:s.map(w=>w.path.endsWith("SKILL.md")&&w.content?{...w,content:dqt(w.content)}:w)}):o.jsx(gqt,{children:b("skillCenter.noSkillContent")})})]})})}function yqt({space:e,canUseSandbox:t,onUpload:n,onSandbox:i,onClose:r}){const{t:s}=je("ui");return p.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:oc(e),children:oc(e)})]}),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(XR,{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 vqt({cloudProvider:e="volcengine",region:t,active:n=!0,activationRevision:i=0,initialWorkspace:r=null,onInitialWorkspaceConsumed:s,onPageTitleChange:a,toolbarLeading:l,toolbarFilters:c}){var er;const{t:u,i18n:d}=je("ui"),f=p.useMemo(()=>[t],[t]),[h,m]=p.useState([]),[g,b]=p.useState(null),[v,y]=p.useState([]),w=p.useMemo(()=>eFe(v),[v]),[x,O]=p.useState(null),[S,k]=p.useState(null),[C,E]=p.useState(!1),R=p.useRef(""),A=p.useRef(!1),[j,T]=p.useState({}),[N,_]=p.useState(!1),[D,M]=p.useState(""),[P,L]=p.useState((r==null?void 0:r.space)??null),B=p.useRef(P);B.current=P;const[I,z]=p.useState([]),[K,F]=p.useState(1),[q,H]=p.useState(0),[X,ne]=p.useState(!1),[Q,Z]=p.useState(null),[ce,Ee]=p.useState(!1),[Y,G]=p.useState(""),[te,ue]=p.useState("overview"),[Ce,se]=p.useState(null),[he,ae]=p.useState(null),[Ae,De]=p.useState(null),[ye,Qe]=p.useState([]),[we,Ne]=p.useState(!1),[ie,fe]=p.useState(null),[Se,ke]=p.useState(null),[qe,it]=p.useState(!1),[de,ve]=p.useState(null),[Te,Ke]=p.useState(null),[$e,At]=p.useState(null),[Nt,vt]=p.useState(0),[Ot,Tt]=p.useState(0),[ft,gt]=p.useState(""),[Me,bt]=p.useState(""),[jt,Ct]=p.useState(null),[sn,We]=p.useState(r),Le=p.useRef(0),Ge=p.useRef(0),pt=p.useRef(!1),ot=p.useRef(null),kt=p.useRef(null),rt=p.useRef(null),qt=p.useDeferredValue(D),cn=p.useDeferredValue(Y),un=sn&&(P||sn.selectPublishSpace)?sn.operation==="create"?u("skillCenter.createSkill"):u("skillCenter.optimizeNamed",{name:((er=sn.source)==null?void 0:er.name)||u("skillCenter.skill")}):"",Xe=P!=null&&P.isShared?u("skillCenter.sharedSpace"):oc(P),mt=!(P!=null&&P.isShared)||P.canWrite===!0,St=un||Xe||u("skillCenter.library");p.useEffect(()=>{n&&(a==null||a(St))},[n,a,St]),p.useEffect(()=>{r&&(s==null||s())},[r,s]);const on=p.useMemo(()=>{const He=qt.trim().toLocaleLowerCase(),wt=h.filter(tn=>!tn.isShared);return He?wt.filter(tn=>`${oc(tn)} ${tn.name} ${tn.description||""} ${tn.projectName||""}`.toLocaleLowerCase().includes(He)):wt},[qt,h]),zt=p.useMemo(()=>{const He=cn.trim().toLocaleLowerCase();return He?I.filter(wt=>`${wt.skillName} ${wt.skillDescription||""}`.toLocaleLowerCase().includes(He)):I},[cn,I]),Be=(P==null?void 0:P.region)||qi(e);p.useEffect(()=>{if(!n||!P)return;const He=()=>Tt(tn=>tn+1),wt=()=>{document.visibilityState==="visible"&&He()};return window.addEventListener("focus",He),document.addEventListener("visibilitychange",wt),()=>{window.removeEventListener("focus",He),document.removeEventListener("visibilitychange",wt)}},[n,P==null?void 0:P.id]),p.useEffect(()=>{const He=P?`${Be}:${P.id}`:"";if(R.current!==He&&(R.current=He,y([]),O(null),ae(null)),k(null),E(!1),!n||!P||P.isShared)return;const wt=new AbortController;return E(!0),iDt({spaceId:P.id,region:Be,signal:wt.signal}).then(tn=>{wt.signal.aborted||y(tn.items)}).catch(tn=>{wt.signal.aborted||k(yr(tn,u("skillCenter.reviewStatusFailed")))}).finally(()=>{wt.signal.aborted||E(!1)}),()=>wt.abort()},[P==null?void 0:P.id,P==null?void 0:P.isShared,Be,Ot,n,i,u]);const at=p.useMemo(()=>f.flatMap(He=>{var tn;const wt=(tn=j[He])==null?void 0:tn.error;return wt?[{region:He,error:wt}]:[]}),[j,f]),On=f.some(He=>{const wt=j[He];return!!(wt&&!wt.done&&!wt.error)}),Je=at.length===f.length;p.useEffect(()=>{const He=new AbortController;return dD(He.signal).then(ke).catch(()=>ke({enabled:!1,reason:u("skillCenter.adminNotConfigured"),operations:["create","optimize"],models:[],styles:{}})),()=>He.abort()},[u]);const yt=p.useCallback(async(He,wt)=>{var Tr;if(pt.current||He.length===0)return;pt.current=!0,_(!0),wt&&((Tr=ot.current)==null||Tr.abort(),m([]),T(Object.fromEntries(He.map(({region:Xn})=>[Xn,{nextPage:1,loadedCount:0,done:!1,error:null}]))));const tn=new AbortController;ot.current=tn;const Gn=++Ge.current,Cr=await Promise.allSettled(He.map(async({region:Xn,page:ii})=>({region:Xn,page:ii,result:await XPt({region:Xn,page:ii,pageSize:oqt,signal:tn.signal})})));if(Ge.current!==Gn)return;const ys=Cr.map((Xn,ii)=>{const Ur=He[ii];return Xn.status==="rejected"?{request:Ur,error:yr(Xn.reason,u("skillCenter.errors.loadSpaces")),items:[],totalCount:0,scannedCount:0}:{request:Ur,error:null,items:(Xn.value.result.items||[]).map(Gi=>({...Gi,region:Gi.region||Xn.value.region})),totalCount:Xn.value.result.totalCount||0,scannedCount:Xn.value.result.scannedCount??Xn.value.result.items.length}}),is=ys.flatMap(Xn=>Xn.items);T(Xn=>{const ii={...Xn};return ys.forEach(({request:Ur,error:Gi,scannedCount:oe,totalCount:tr})=>{const Uo=ii[Ur.region]||{nextPage:Ur.page,loadedCount:0,done:!1,error:null};if(Gi){ii[Ur.region]={...Uo,error:Gi};return}const no=Uo.loadedCount+oe;ii[Ur.region]={nextPage:Ur.page+1,loadedCount:no,done:oe===0||no>=tr,error:null}}),ii}),m(Xn=>uqt(wt?[]:Xn,is)),L(Xn=>Xn&&(is.find(ii=>$c(ii)===$c(Xn))||Xn)),pt.current=!1,_(!1)},[]),Bn=p.useCallback(()=>{if(pt.current)return;const He=f.flatMap(wt=>{const tn=j[wt];return tn&&!tn.done&&!tn.error?[{region:wt,page:tn.nextPage}]:[]});yt(He,!1)},[yt,j,f]);p.useEffect(()=>{ei(),L(null),z([]),F(1)},[e]),p.useEffect(()=>{if(n)return yt(f.map(He=>({region:He,page:1})),!0),()=>{var He;Ge.current+=1,(He=ot.current)==null||He.abort(),pt.current=!1}},[n,i,yt,f,Nt]),p.useEffect(()=>{const He=rt.current,wt=kt.current;if(!He||!wt||!On||N)return;const tn=new IntersectionObserver(([Gn])=>{Gn.isIntersecting&&Bn()},{root:wt,rootMargin:"240px 0px",threshold:.01});return tn.observe(He),()=>tn.disconnect()},[On,Bn,N]);const Vt=()=>{const He=kt.current;!He||!On||N||He.scrollHeight-He.scrollTop-He.clientHeight<=240&&Bn()};p.useEffect(()=>{if(!P){z([]),H(0),Ee(!1);return}let He=!0;return ne(!0),Z(null),uDt(P.id,{region:Be,page:K,pageSize:Rse,project:P.projectName}).then(wt=>{He&&(z(wt.items||[]),H(wt.totalCount||0),Ee(wt.degraded===!0))}).catch(wt=>{He&&(z([]),H(0),Ee(!1),Z(yr(wt,u("skillCenter.errors.loadSkills"))))}).finally(()=>{He&&ne(!1)}),()=>{He=!1}},[Be,P,K,Ot,u]);const Wn=He=>{ei(),L(He),ue("overview"),F(1),G("")},_n=()=>{ei(),L(null),z([]),H(0),Ee(!1),ue("overview"),F(1),G(""),Ct(null)},ei=()=>{Le.current+=1,se(null),De(null),Qe([]),fe(null),Ne(!1)},Sn=async He=>{if(!P)return;const wt=Fb(He),tn=Le.current+1;Le.current=tn,se(He),De(null),fe(null),Ne(!0);try{const[Gn,Cr]=await Promise.all([dDt(P.id,wt,He.version,Be,P.projectName,He.skillName,P.name),LMe({spaceId:P.id,skillId:wt,version:He.version,region:Be,skillSpaceName:P.name,skillName:He.skillName})]);Le.current===tn&&(De(Gn),Qe(Cr))}catch(Gn){Le.current===tn&&fe(yr(Gn,u("skillCenter.errors.loadSkillDetails")))}finally{Le.current===tn&&Ne(!1)}},Vn=He=>{if(P)return{kind:"skill-center",skillId:Fb(He),version:He.version,region:Be,projectName:P.projectName,skillSpaceId:P.id,skillSpaceName:P.name,name:He.skillName,description:He.skillDescription}},Cn=He=>{const wt=Vn(He);!wt||!(Se!=null&&Se.enabled)||(ei(),We({operation:"optimize",source:wt}))},Kn=async He=>{if(!(!P||!window.confirm(u("skillCenter.deleteSkillConfirm",{name:He.skillName})))){gt(He.skillId),Ct(null);try{await lDt({spaceId:P.id,skillId:He.skillId,region:Be}),Tt(wt=>wt+1),vt(wt=>wt+1)}catch(wt){Ct(yr(wt,u("skillCenter.errors.deleteSkill")))}finally{gt("")}}},vr=async He=>{if(!window.confirm(u("skillCenter.deleteSpaceConfirm",{name:oc(He)})))return;const wt=$c(He);bt(wt),Ct(null);try{await sDt({spaceId:He.id,region:He.region||qi(e)}),P&&$c(P)===wt&&_n(),vt(tn=>tn+1)}catch(tn){Ct(yr(tn,u("skillCenter.errors.deleteSpace")))}finally{bt("")}},xr=async(He,wt=He.version,tn=!1)=>{var ys,is,Tr,Xn;if(!P||A.current)return;const Gn=P,Cr=`${Gn.region}:${Gn.id}:${He.skillId}:${wt}`;A.current=!0,b(Cr),Ct(null);try{const ii=await JPt({spaceId:Gn.id,skillId:He.skillId,version:wt,region:Gn.region||Be});((ys=B.current)==null?void 0:ys.id)===Gn.id&&((is=B.current)==null?void 0:is.region)===Gn.region&&y(Ur=>[...Ur.filter(Gi=>Gi.id!==ii.id),ii])}catch(ii){if(tn)throw yr(ii,u("skillCenter.reviewFailed"));((Tr=B.current)==null?void 0:Tr.id)===Gn.id&&((Xn=B.current)==null?void 0:Xn.region)===Gn.region&&Ct(yr(ii,u("skillCenter.reviewFailed")))}finally{A.current=!1,b(null)}};return sn&&(P||sn.selectPublishSpace)?o.jsx(MHt,{operation:sn.operation,cloudProvider:e,space:P??void 0,availableSpaces:h.filter(He=>!He.isShared),spacesLoading:N,initialIntent:sn.initialIntent,source:sn.source,onBack:()=>We(null),onPublished:()=>{Tt(He=>He+1),vt(He=>He+1)}}):o.jsxs("section",{className:`skillcenter${P?" is-space":" resource-collection"}`,children:[P?o.jsx(XC,{className:"skillcenter-detail",title:Xe||P.name,description:P.isShared?u("skillCenter.sharedDescription"):P.description||u("skillCenter.manageSpaceDescription"),identitySeed:P.name,backLabel:u("skillCenter.backToSpaces"),onBack:_n,sections:[{key:"overview",label:u("skillCenter.overview"),content:o.jsxs(o.Fragment,{children:[jt?o.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:o.jsx(ps,{error:jt})}):null,S?o.jsxs("div",{className:"skillcenter-inline-error",role:"alert",children:[o.jsx(ps,{error:S}),o.jsx("button",{type:"button",onClick:()=>Tt(He=>He+1),children:u("common.reload")})]}):null,o.jsx("section",{className:"skillcenter-overview",children:o.jsxs(Fz,{className:"skillcenter-detail-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:u("skillCenter.skillCount")}),o.jsx("dd",{children:q})]}),o.jsxs("div",{children:[o.jsx("dt",{children:u("skillCenter.updatedAt")}),o.jsx("dd",{children:P.updatedAt?cqt(P.updatedAt,d.resolvedLanguage??d.language):"—"})]})]})})]})},{key:"skills",label:u("skillCenter.skills"),content:o.jsxs(o.Fragment,{children:[jt?o.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:o.jsx(ps,{error:jt})}):null,S?o.jsxs("div",{className:"skillcenter-inline-error",role:"alert",children:[o.jsx(ps,{error:S}),o.jsx("button",{type:"button",onClick:()=>Tt(He=>He+1),children:u("common.reload")})]}):null,o.jsxs("section",{className:"skillcenter-results","aria-label":u("skillCenter.skillsInSpace",{name:Xe||P.name}),children:[o.jsx(TIe,{title:u("skillCenter.skills"),description:u("skillCenter.totalItems",{count:q}),actions:o.jsxs(o.Fragment,{children:[o.jsx(hp,{"aria-label":u("skillCenter.searchSkills"),value:Y,onChange:He=>G(He.target.value),placeholder:u("skillCenter.searchSkills")}),o.jsx(It,{color:"secondary",variant:"outline",size:"sm",pill:!1,disabled:X||C,onClick:()=>Tt(He=>He+1),children:u("common.refresh")})]})}),ce?o.jsx("div",{className:"skillcenter-inline-warning",role:"status",children:u("skillCenter.degradedRelationWarning")}):null,X&&I.length===0?o.jsx(Ha,{}):Q&&I.length===0?o.jsx(x4,{kind:"error",title:u("skillCenter.cannotLoadSkills"),error:Q,action:{label:u("common.reload"),onClick:()=>Tt(He=>He+1)}}):zt.length===0?o.jsx(x4,{kind:"empty",title:Y.trim()?u("skillCenter.noMatchingSkills"):u("skillCenter.noSkills"),description:Y.trim()?u("skillCenter.tryAnotherName"):u(P.isShared?"skillCenter.sharedEmpty":"skillCenter.emptySkillsDescription"),action:!Y.trim()&&mt?{label:u("skillCenter.localUpload"),onClick:()=>At(P)}:void 0}):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:zt.map(He=>{const wt=w.get(`${He.skillId}:${He.version}`);return o.jsxs("tr",{children:[o.jsx("td",{className:"skillcenter-table__skill",children:o.jsxs("button",{type:"button",onClick:()=>void Sn(He),children:[o.jsxs("span",{className:"skillcenter-table__title-row",children:[o.jsx("strong",{title:He.skillName,children:He.skillName}),He.version?o.jsx("span",{className:"skillcenter-table__version-badge",children:He.sourceVersion||He.version}):null]}),o.jsx("span",{className:"skillcenter-table__description",children:lFe(He.skillDescription,u)}),P.isShared&&He.author?o.jsx("span",{className:"skillcenter-table__author",children:u("skillCenter.authorName",{name:He.author})}):null]})}),o.jsx("td",{children:o.jsxs("div",{className:"skillcenter-review-status",children:[o.jsx("span",{className:`skillcenter-status ${lqt(He.skillStatus)}`,children:aFe(He.skillStatus,u)}),wt?o.jsx(CT,{status:wt.status}):null,wt!=null&&wt.reviewer||wt!=null&&wt.reviewedBy?o.jsx(aq,{compact:!0,person:wt.reviewer,fallback:wt.reviewedBy}):null]})}),o.jsx("td",{children:o.jsxs("div",{className:"skillcenter-table__actions",children:[o.jsx("button",{type:"button",onClick:()=>void Sn(He),children:u("common.view")}),!He.lookupByName&&He.skillId?o.jsx("button",{type:"button",onClick:()=>ae(He),children:u("skillCenter.versions.title")}):null,!P.isShared&&!He.lookupByName&&He.skillId?o.jsx("button",{type:"button",disabled:C||S!==null||g!==null||wt!==void 0&&wt.status!=="returned",onClick:()=>void xr(He),children:g===`${P.region}:${P.id}:${He.skillId}:${He.version}`?u("skillCenter.reviewSubmitting"):u(wt?{pending:"skillCenter.reviewPending",approving:"skillCenter.reviewApproving",approved:"skillCenter.reviewApproved",returned:"skillCenter.reviewRetry"}[wt.status]:"skillCenter.requestPublication")}):null,v.some(tn=>tn.sourceSkillId===He.skillId)?o.jsx("button",{type:"button",onClick:()=>O(He),children:u("skillCenter.reviewHistory")}):null,P.isShared?null:o.jsx(XR,{disabled:!(Se!=null&&Se.enabled),children:o.jsx("button",{type:"button",disabled:!(Se!=null&&Se.enabled),onClick:()=>Cn(He),children:u("skillCenter.optimize")})}),!He.lookupByName&&mt?o.jsx("button",{type:"button",className:"is-danger",disabled:ft===He.skillId,onClick:()=>void Kn(He),children:ft===He.skillId?u("common.deleting"):u("common.delete")}):null]})})]},`${Fb(He)}:${He.version}`)})})]})}),!Y.trim()&&!X&&!Q&&q>0?o.jsx(mqt,{page:K,total:q,pageSize:Rse,onPage:F}):null]})]})}],activeSectionKey:te,navigationLabel:u("skillCenter.spaceDetails"),onSectionChange:He=>ue(He),actionsClassName:"skillcenter-toolbar-actions",actions:o.jsxs(o.Fragment,{children:[P.isShared?null:o.jsxs(o.Fragment,{children:[o.jsx(It,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>ve(P),children:u("skillCenter.editSpace")}),o.jsx(It,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,disabled:Me===$c(P),onClick:()=>void vr(P),children:Me===$c(P)?u("common.deleting"):u("skillCenter.deleteSpace")})]}),mt?o.jsx(It,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>At(P),children:u("skillCenter.localUpload")}):null,P.isShared?null:o.jsx(XR,{disabled:!(Se!=null&&Se.enabled),children:o.jsxs(It,{type:"button",color:"primary",size:"lg",pill:!1,disabled:!(Se!=null&&Se.enabled),onClick:()=>We({operation:"create"}),children:[o.jsx(iAe,{"aria-hidden":"true"}),o.jsx("span",{children:u("skillCenter.createSkill")})]})})]})}):o.jsxs(o.Fragment,{children:[o.jsxs(e0,{className:"skillcenter-list-toolbar library-resource-toolbar",children:[l,o.jsxs("div",{className:"resource-toolbar__actions",children:[c,o.jsx(hp,{"aria-label":u("skillCenter.searchSpaces"),value:D,onChange:He=>M(He.target.value),placeholder:u("skillCenter.searchSpaces")})]})]}),jt?o.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:o.jsx(ps,{error:jt})}):null,o.jsxs(Pg,{className:"skillcenter-list-results",ref:kt,"aria-label":u("skillCenter.spaceList"),onScroll:Vt,children:[at.length>0&&!Je?o.jsx(Dse,{errors:at,cloudProvider:e,onRetry:()=>vt(He=>He+1)}):null,o.jsxs(n0,{children:[o.jsx(tqt,{region:t,active:n,revision:Nt+i,onOpen:Wn},`${e}:${t}`),D.trim()?null:o.jsx(hg,{"aria-label":u("skillCenter.createSpace"),icon:o.jsx(hqt,{}),onClick:()=>it(!0),children:u("skillCenter.newSpace")}),on.map(He=>{const wt=$c(He);return o.jsx(r0,{className:"skillcenter-space-card",title:oc(He),description:He.description||u("common.noDescription"),metadata:[{label:u("skillCenter.skillCount"),value:u("skillCenter.skillCountValue",{count:He.skillCount??0})},{label:u("skillCenter.updatedAt"),value:GD(He.updatedAt,Date.now(),d.resolvedLanguage??d.language)}],action:{label:u("skillCenter.addSkill"),icon:"plus",onClick:()=>Ke(He)},detailAction:{label:u("common.viewDetails"),onClick:()=>Wn(He)}},wt)})]}),N&&h.length===0?o.jsx(Ha,{}):Je&&h.length===0?o.jsx(Dse,{errors:at,cloudProvider:e,fullPage:!0,onRetry:()=>vt(He=>He+1)}):on.length===0&&D.trim()?o.jsx(x4,{kind:"empty",title:u("skillCenter.noMatchingSpaces"),description:u("skillCenter.tryAnotherName")}):null,!Je&&h.length>0?o.jsx("div",{className:"my-agent-load-more",ref:rt,"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:u("skillCenter.loadingMoreSpaces")})]}):On?o.jsx("span",{children:u("skillCenter.scrollForMore")}):at.length>0?o.jsx("span",{children:u("skillCenter.someSpacesFailed")}):o.jsx("span",{children:u("skillCenter.allSpacesLoaded")})}):null]})]}),he&&P?o.jsx(eqt,{skill:he,space:P,region:Be,reviews:v.filter(He=>He.sourceSkillId===he.skillId),onClose:()=>ae(null),onChanged:()=>Tt(He=>He+1),onSubmitReview:!P.isShared&&!C&&!S?He=>xr(he,He,!0):void 0},`${Be}:${P.id}:${he.skillId}`):null,x?o.jsx(JHt,{name:x.skillName,applications:v.filter(He=>He.sourceSkillId===x.skillId),onClose:()=>O(null)}):null,Ce&&P&&o.jsx(bqt,{skill:Ce,space:P,region:Be,cloudProvider:e,detail:Ae,files:ye,loading:we,error:ie,reviews:v.filter(He=>He.sourceSkillId===Ce.skillId),reviewsLoading:C,reviewsError:S,canOptimize:!P.isShared&&(Se==null?void 0:Se.enabled)===!0,onOptimize:()=>Cn(Ce),onDownload:()=>void cDt({spaceId:P.id,skillId:Fb(Ce),version:Ce.version,region:Be,fallbackName:Ce.skillName,skillSpaceName:P.name,skillName:Ce.skillName}).catch(He=>fe(yr(He,u("skillCenter.errors.downloadSkill")))),onClose:ei}),qe?o.jsx(nqt,{region:t,regionOptions:iu(e),onClose:()=>it(!1),onCreated:He=>{it(!1),vt(wt=>wt+1),L({...He,region:He.region||t})}}):null,de?o.jsx(iqt,{space:de,region:de.region||qi(e),onClose:()=>ve(null),onUpdated:He=>{const wt={...He,region:He.region||de.region||qi(e)};ve(null),L(tn=>tn&&$c(tn)===$c(wt)?wt:tn),m(tn=>tn.map(Gn=>$c(Gn)===$c(wt)?wt:Gn)),vt(tn=>tn+1)}}):null,Te?o.jsx(yqt,{space:Te,canUseSandbox:(Se==null?void 0:Se.enabled)===!0,onClose:()=>Ke(null),onUpload:()=>{At(Te),Ke(null)},onSandbox:()=>{const He=Te;Ke(null),Wn(He),We({operation:"create"})}}):null,$e?o.jsx(rqt,{space:$e,region:$e.region||qi(e),onClose:()=>At(null),onUploaded:()=>{At(null),Tt(He=>He+1),vt(He=>He+1)}}):null]})}function xqt(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 wqt({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}=je("workspaceTools"),m=p.useMemo(()=>xqt(f),[f]),g=f("library.tabs.skills"),b=VI(t)?t:qi(e),[v,y]=p.useState(b),[w,x]=p.useState(g),O=p.useRef(g),[S,k]=p.useState(!1),[C,E]=p.useState(()=>new Set(["skills",n])),[R,A]=p.useState({skills:0,knowledge:0,artifacts:0}),j=p.useRef(u),[T,N]=p.useState([]),[_,D]=p.useState(!1),[M,P]=p.useState(""),L=p.useMemo(()=>{const ne=R1t(l,f("library.untitledSession"));return{key:JSON.stringify(ne),candidates:ne}},[l,f]),B=p.useRef(L);B.current.key!==L.key&&(B.current=L);const I=B.current.candidates,z=p.useMemo(()=>iu(e),[e]);p.useEffect(()=>{y(b)},[b]),p.useEffect(()=>{const ne=O.current;x(Q=>Q===ne?g:Q),O.current=g},[g]),p.useEffect(()=>{j.current=u},[u]),p.useEffect(()=>{E(ne=>{if(ne.has(n))return ne;const Q=new Set(ne);return Q.add(n),Q})},[n]),p.useEffect(()=>{var Q;const ne=n==="skills"?w:((Q=m.find(Z=>Z.id===n))==null?void 0:Q.label)||f("library.title");r==null||r(ne)},[n,r,w,f,m]),p.useEffect(()=>{var ne;n==="artifacts"&&((ne=j.current)==null||ne.call(j))},[n,R.artifacts]);const K=p.useCallback(async()=>{D(!0),P("");try{N(await U1t(I))}catch(ne){P(ne instanceof Error?ne.message:String(ne))}finally{D(!1)}},[I]);p.useEffect(()=>{n==="artifacts"&&K()},[n,R.artifacts,K]);const F=ne=>{E(Q=>{if(Q.has(ne))return Q;const Z=new Set(Q);return Z.add(ne),Z}),A(Q=>({...Q,[ne]:Q[ne]+1})),i(ne)},q=o.jsx(t0,{idPrefix:"library",ariaLabel:f("library.categoryAria"),value:n,items:m,onChange:F}),H=ne=>o.jsx(fg,{id:ne,ariaLabel:f("library.regionAria"),value:v,options:z,onChange:y}),X=n==="skills"?w!==g:n==="knowledge"&&S;return o.jsxs(Ff,{className:`library-view${X?" is-detail":""}`,"aria-label":f("library.title"),children:[X?null:o.jsx(Jy,{className:"library-view__header",title:f("library.title")}),o.jsxs("div",{className:"library-panels",children:[C.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(vqt,{cloudProvider:e,region:v,active:n==="skills",activationRevision:R.skills,onPageTitleChange:x,initialWorkspace:s,onInitialWorkspaceConsumed:a,toolbarLeading:q,toolbarFilters:H("library-skills-region-filter")})}):null,C.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(PPt,{cloudProvider:e,region:v,active:n==="knowledge",activationRevision:R.knowledge,onDetailChange:k,toolbarLeading:q,toolbarFilters:H("library-knowledge-region-filter")})}):null,C.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($1t,{items:T,region:v,userId:c,active:n==="artifacts",activationRevision:R.artifacts,loading:_,error:M?da(M,h.resolvedLanguage||h.language)||f("artifactLibrary.loadDetailFallback"):"",onRetry:()=>void K(),onEdit:Q1t,onDelete:z1t,onDownload:V1t,onOpenSource:d?ne=>d(ne.appName,ne.sessionId):void 0,toolbarLeading:q,toolbarFilters:H("library-artifacts-region-filter")})}):null]})]})}const cFe="veadk_agentkit_connections",Oqt=3e3,Mse=6e4;function wd(){try{const e=localStorage.getItem(cFe);return(e?JSON.parse(e):[]).filter(n=>!n.runtimeId||!!n.region)}catch{return[]}}function XD(e){try{localStorage.setItem(cFe,JSON.stringify(e))}catch{}}function Rd(e,t){return`agentkit:${e}:${t}`}function uFe(e){try{return new URL(e).host}catch{return e}}function E1(e){REe();for(const t of e)if(!(t.runtimeId&&!t.region))for(const n of t.apps)NEe(Rd(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,region:t.region}:{app:n,base:t.base,apiKey:t.apiKey})}function dFe(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=wd(),c=l.findIndex(u=>u.runtimeId===e);return c===-1?l.push(a):l[c]=a,XD(l),E1(l),a}async function kqt(e,t,n,i,r){let s=null,a=n||"cn-beijing",l=null;for(const f of kC(n))try{const h=await Gx(e,f,{retryProbe:!0,preferCached:!0,currentVersion:i});if(h&&h.length>0){await GCe(e,f),s=h,a=f;break}}catch(h){if(h instanceof Uw)throw YR(e),h;if(h instanceof po&&h.unsupported){l=h;continue}throw h}if(!s||s.length===0)throw YR(e),l||new po(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=dFe(e,t,a,s,u,i);return Rd(d.id,s[0])}function Sqt(e){return new Promise(t=>window.setTimeout(t,e))}async function _j(e,t,n,i,r={}){const s=Date.now();for(;;)try{return await kqt(e,t,n,i,r.agentName)}catch(a){const l=Date.now()-s;if(!r.waitForReady||!(a instanceof po)||!a.retryable||l>=Mse)throw a;const c=Math.min(Oqt,Mse-l);await Sqt(c)}}async function fFe(e,t,n,i){const r=t.trim().replace(/\/+$/,""),s=await SC(r,n.trim()),a={id:Date.now().toString(36),name:e.trim()||uFe(r),base:r,apiKey:n.trim(),apps:s,appLabels:i&&s.length>0?{[s[0]]:i}:void 0},l=[...wd().filter(c=>c.base!==r),a];return XD(l),E1(l),a}function Eqt(e){const t=wd().filter(n=>n.id!==e);return XD(t),E1(t),t}function YR(e){const t=wd().filter(n=>n.runtimeId!==e);return XD(t),E1(t),t}function hFe(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:Rd(r.id,s),label:a,app:s,remote:!0,host:r.runtimeId?r.name:uFe(r.base??""),runtimeId:r.runtimeId,region:r.region,currentVersion:r.currentVersion}}));return[...n,...i]}const Lse=Object.freeze(Object.defineProperty({__proto__:null,addConnection:fFe,addRuntimeConnection:dFe,buildAgentEntries:hFe,connectRuntime:_j,loadConnections:wd,registerConnections:E1,remoteAppId:Rd,removeConnection:Eqt,removeRuntimeConnection:YR},Symbol.toStringTag,{value:"Module"}));function Cqt({onAdded:e,onCancel:t}){const{t:n}=je("conversation"),[i,r]=p.useState(""),[s,a]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(!1),[f,h]=p.useState(""),m=i.trim().length>0&&s.trim().length>0&&!u;async function g(){if(m){d(!0),h("");try{const b=await fFe(l,i,s,l);if(b.apps.length===0){h(n("addAgentKit.noAgents")),d(!1);return}e(Rd(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:!m,children:[u?o.jsx(Mi,{className:"icon spin"}):null,n(u?"addAgentKit.connecting":"addAgentKit.connect")]})]})]})})}const Tqt=/[\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff]/u,Aqt={"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"},_qt={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 YD(e){var r,s;const t=((r=e.message)==null?void 0:r.trim())??"",n=e.messageCode?Aqt[e.messageCode]:void 0;if(n)return V(n);if(t&&(F$().toLowerCase()==="zh-cn"||!Tqt.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?_qt[e.phase]:void 0;return i?V(i):t||V("client.deploymentProgress.inProgress")}function jqt(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 Nqt=[{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"}]}],Rqt={核心能力回归:"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 mk(e,t){const n=Rqt[e];return n?t(n):e}const $se=["basic","usage","evaluations","optimizations","integrations","versions"],Iqt=20;function Pqt(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 jO=[{id:"api-server",label:"API Server"},{id:"a2a",label:"A2A"}];function w4(e,t){return e?`${e.replace(/\/+$/,"")}${t}`:""}function Dqt(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 Fse(e,t){return e==="key_auth"?"API Key":e==="custom_jwt"?"OAuth / JWT":t(e==="none"?"agentWorkspace.noAuthentication":"agentWorkspace.notAvailable")}function Bse(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 Mqt(e,t){return e.changeType==="rollback"?t("agentWorkspace.rollbackEvent"):e.version}function t9(e){return JSON.stringify(e)}function pFe(e){return e==="key_auth"?`API_KEY = "" +`,4);return n>=0?t.slice(n+5).trimStart():e}function mFe(e,t){const n=(e||"").trim();return!n||[">",">-","|","|-"].includes(n)?t("common.noDescription"):n}function vqt(){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 xqt(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 Pse({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 wqt(){return o.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function Oqt({page:e,total:t,pageSize:n,onPage:i}){const{t:r}=_e("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(Pse,{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(Pse,{direction:"right"})})]})]})}function kqt({children:e}){return o.jsx("div",{className:"skillcenter-empty",children:e})}function w4({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(Rn,{fill:"none",children:[o.jsx(Rn.Title,{children:t}),n?o.jsx(Rn.Description,{children:n}):null,i?o.jsx(bs,{error:i}):null,r?o.jsx(Rn.ActionRow,{children:o.jsx(It,{color:"secondary",size:"lg",onClick:r.onClick,children:r.label})}):null]})})}function Dse({errors:e,cloudProvider:t,fullPage:n=!1,onRetry:i}){const{t:r}=_e("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:$f(s,t)}),o.jsx(bs,{error:a})]},s))]}),o.jsx("button",{type:"button",onClick:i,children:r("common.reload")})]})}function Sqt({skill:e,space:t,region:n,cloudProvider:i,detail:r,files:s,loading:a,error:l,canOptimize:c,reviews:u,reviewsLoading:d,reviewsError:f,onOptimize:h,onDownload:m,onClose:g}){const{t:b}=_e("ui"),[v,y]=p.useState("files");return p.useEffect(()=>{const w=x=>{x.key==="Escape"&&g()};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[g]),o.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:g,children:o.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:w=>w.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:mFe((r==null?void 0:r.description)||e.skillDescription,b)})]})}),o.jsxs("div",{className:"skill-detail-actions",children:[o.jsx("button",{type:"button",onClick:m,disabled:s.length===0,children:b("skillCenter.downloadZip")}),t.isShared?null:o.jsx(YR,{disabled:!c,placement:"bottom",children:o.jsx("button",{type:"button",onClick:h,disabled:!c,children:b("skillCenter.optimize")})}),o.jsx("button",{type:"button",className:"skill-detail-close",onClick:g,"aria-label":b("skillCenter.closeSkillDetails"),children:o.jsx(vqt,{})})]})]}),o.jsxs("dl",{className:"skill-detail-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:b("skillCenter.skillId")}),o.jsx("dd",{title:e.skillId,children:e.skillId})]}),o.jsxs("div",{children:[o.jsx("dt",{children:b("agentSelector.version")}),o.jsx("dd",{children:e.sourceVersion||(r==null?void 0:r.version)||e.version||"—"})]}),e.author?o.jsxs("div",{children:[o.jsx("dt",{children:b("skillCenter.author")}),o.jsx("dd",{children:e.author})]}):null,o.jsxs("div",{children:[o.jsx("dt",{children:b("agentSelector.status")}),o.jsx("dd",{children:pFe(e.skillStatus,b)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:b("skillCenter.skillSpace")}),o.jsx("dd",{title:ac(t),children:t.isShared?b("skillCenter.sharedSpace"):ac(t)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:b("myAgents.region")}),o.jsx("dd",{children:$f(n,i)})]})]}),o.jsx(n0,{className:"skill-detail-tabs",idPrefix:"skill-detail",ariaLabel:b("skillCenter.skillDetailSections"),value:v,items:[{id:"files",label:b("skillCenter.allFiles"),panelId:"skill-detail-panel"},{id:"reviews",label:b("skillCenter.reviewHistory"),panelId:"skill-detail-panel"}],onChange:y}),o.jsx("div",{className:`skill-detail-content${v==="files"?" skill-detail-content--files":" skill-detail-content--reviews"}`,id:"skill-detail-panel",role:"tabpanel","aria-labelledby":`skill-detail-${v}-tab`,children:v==="reviews"?d?o.jsx(Ka,{}):f?o.jsx("div",{role:"alert",children:o.jsx(bs,{error:f})}):o.jsx(cq,{applications:u}):a?o.jsxs("div",{className:"skillcenter-loading",children:[o.jsx(wqt,{}),b("skillCenter.loadingSkillContent")]}):l?o.jsx("div",{className:"skillcenter-error",children:o.jsx(bs,{error:l})}):s.length>0?o.jsx(KD,{files:s.map(w=>w.path.endsWith("SKILL.md")&&w.content?{...w,content:yqt(w.content)}:w)}):o.jsx(kqt,{children:b("skillCenter.noSkillContent")})})]})})}function Eqt({space:e,canUseSandbox:t,onUpload:n,onSandbox:i,onClose:r}){const{t:s}=_e("ui");return p.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:ac(e),children:ac(e)})]}),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(YR,{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 Cqt({cloudProvider:e="volcengine",region:t,active:n=!0,activationRevision:i=0,initialWorkspace:r=null,onInitialWorkspaceConsumed:s,onPageTitleChange:a,toolbarLeading:l,toolbarFilters:c}){var Qi;const{t:u,i18n:d}=_e("ui"),f=p.useMemo(()=>[t],[t]),[h,m]=p.useState([]),[g,b]=p.useState(null),[v,y]=p.useState([]),w=p.useMemo(()=>aFe(v),[v]),[x,O]=p.useState(null),[S,k]=p.useState(null),[C,E]=p.useState(!1),R=p.useRef(""),A=p.useRef(!1),[N,T]=p.useState({}),[j,_]=p.useState(!1),[I,D]=p.useState(""),[P,L]=p.useState((r==null?void 0:r.space)??null),B=p.useRef(P);B.current=P;const[M,H]=p.useState([]),[K,F]=p.useState(1),[q,Q]=p.useState(0),[X,ne]=p.useState(!1),[z,Y]=p.useState(null),[ae,Ee]=p.useState(!1),[Z,G]=p.useState(""),[te,de]=p.useState("overview"),[Ce,le]=p.useState(null),[fe,ce]=p.useState(null),[Te,Me]=p.useState(null),[we,Ue]=p.useState([]),[ke,je]=p.useState(!1),[re,ve]=p.useState(null),[be,xe]=p.useState(null),[Ke,Ze]=p.useState(!1),[he,ye]=p.useState(null),[Ae,He]=p.useState(null),[De,At]=p.useState(null),[Nt,Ot]=p.useState(0),[vt,Tt]=p.useState(0),[ft,pt]=p.useState(""),[Pe,yt]=p.useState(""),[jt,qt]=p.useState(null),[ln,qe]=p.useState(r),Ie=p.useRef(0),We=p.useRef(0),gt=p.useRef(!1),it=p.useRef(null),kt=p.useRef(null),ct=p.useRef(null),Kt=p.useDeferredValue(I),dn=p.useDeferredValue(Z),Xt=ln&&(P||ln.selectPublishSpace)?ln.operation==="create"?u("skillCenter.createSkill"):u("skillCenter.optimizeNamed",{name:((Qi=ln.source)==null?void 0:Qi.name)||u("skillCenter.skill")}):"",Ge=P!=null&&P.isShared?u("skillCenter.sharedSpace"):ac(P),mt=!(P!=null&&P.isShared)||P.canWrite===!0,xt=Xt||Ge||u("skillCenter.library");p.useEffect(()=>{n&&(a==null||a(xt))},[n,a,xt]),p.useEffect(()=>{r&&(s==null||s())},[r,s]);const hn=p.useMemo(()=>{const Ve=Kt.trim().toLocaleLowerCase(),St=h.filter(Jt=>!Jt.isShared);return Ve?St.filter(Jt=>`${ac(Jt)} ${Jt.name} ${Jt.description||""} ${Jt.projectName||""}`.toLocaleLowerCase().includes(Ve)):St},[Kt,h]),Vt=p.useMemo(()=>{const Ve=dn.trim().toLocaleLowerCase();return Ve?M.filter(St=>`${St.skillName} ${St.skillDescription||""}`.toLocaleLowerCase().includes(Ve)):M},[dn,M]),Qe=(P==null?void 0:P.region)||Xi(e);p.useEffect(()=>{if(!n||!P)return;const Ve=()=>Tt(Jt=>Jt+1),St=()=>{document.visibilityState==="visible"&&Ve()};return window.addEventListener("focus",Ve),document.addEventListener("visibilitychange",St),()=>{window.removeEventListener("focus",Ve),document.removeEventListener("visibilitychange",St)}},[n,P==null?void 0:P.id]),p.useEffect(()=>{const Ve=P?`${Qe}:${P.id}`:"";if(R.current!==Ve&&(R.current=Ve,y([]),O(null),ce(null)),k(null),E(!1),!n||!P||P.isShared)return;const St=new AbortController;return E(!0),uDt({spaceId:P.id,region:Qe,signal:St.signal}).then(Jt=>{St.signal.aborted||y(Jt.items)}).catch(Jt=>{St.signal.aborted||k(Er(Jt,u("skillCenter.reviewStatusFailed")))}).finally(()=>{St.signal.aborted||E(!1)}),()=>St.abort()},[P==null?void 0:P.id,P==null?void 0:P.isShared,Qe,vt,n,i,u]);const rt=p.useMemo(()=>f.flatMap(Ve=>{var Jt;const St=(Jt=N[Ve])==null?void 0:Jt.error;return St?[{region:Ve,error:St}]:[]}),[N,f]),En=f.some(Ve=>{const St=N[Ve];return!!(St&&!St.done&&!St.error)}),et=rt.length===f.length;p.useEffect(()=>{const Ve=new AbortController;return fD(Ve.signal).then(xe).catch(()=>xe({enabled:!1,reason:u("skillCenter.adminNotConfigured"),operations:["create","optimize"],models:[],styles:{}})),()=>Ve.abort()},[u]);const bt=p.useCallback(async(Ve,St)=>{var Ur;if(gt.current||Ve.length===0)return;gt.current=!0,_(!0),St&&((Ur=it.current)==null||Ur.abort(),m([]),T(Object.fromEntries(Ve.map(({region:Hn})=>[Hn,{nextPage:1,loadedCount:0,done:!1,error:null}]))));const Jt=new AbortController;it.current=Jt;const Vn=++We.current,xr=await Promise.allSettled(Ve.map(async({region:Hn,page:di})=>({region:Hn,page:di,result:await iDt({region:Hn,page:di,pageSize:hqt,signal:Jt.signal})})));if(We.current!==Vn)return;const Ks=xr.map((Hn,di)=>{const Cr=Ve[di];return Hn.status==="rejected"?{request:Cr,error:Er(Hn.reason,u("skillCenter.errors.loadSpaces")),items:[],totalCount:0,scannedCount:0}:{request:Cr,error:null,items:(Hn.value.result.items||[]).map(Qr=>({...Qr,region:Qr.region||Hn.value.region})),totalCount:Hn.value.result.totalCount||0,scannedCount:Hn.value.result.scannedCount??Hn.value.result.items.length}}),is=Ks.flatMap(Hn=>Hn.items);T(Hn=>{const di={...Hn};return Ks.forEach(({request:Cr,error:Qr,scannedCount:so,totalCount:Za})=>{const rs=di[Cr.region]||{nextPage:Cr.page,loadedCount:0,done:!1,error:null};if(Qr){di[Cr.region]={...rs,error:Qr};return}const oe=rs.loadedCount+so;di[Cr.region]={nextPage:Cr.page+1,loadedCount:oe,done:so===0||oe>=Za,error:null}}),di}),m(Hn=>bqt(St?[]:Hn,is)),L(Hn=>Hn&&(is.find(di=>Mc(di)===Mc(Hn))||Hn)),gt.current=!1,_(!1)},[]),zn=p.useCallback(()=>{if(gt.current)return;const Ve=f.flatMap(St=>{const Jt=N[St];return Jt&&!Jt.done&&!Jt.error?[{region:St,page:Jt.nextPage}]:[]});bt(Ve,!1)},[bt,N,f]);p.useEffect(()=>{Yn(),L(null),H([]),F(1)},[e]),p.useEffect(()=>{if(n)return bt(f.map(Ve=>({region:Ve,page:1})),!0),()=>{var Ve;We.current+=1,(Ve=it.current)==null||Ve.abort(),gt.current=!1}},[n,i,bt,f,Nt]),p.useEffect(()=>{const Ve=ct.current,St=kt.current;if(!Ve||!St||!En||j)return;const Jt=new IntersectionObserver(([Vn])=>{Vn.isIntersecting&&zn()},{root:St,rootMargin:"240px 0px",threshold:.01});return Jt.observe(Ve),()=>Jt.disconnect()},[En,zn,j]);const $t=()=>{const Ve=kt.current;!Ve||!En||j||Ve.scrollHeight-Ve.scrollTop-Ve.clientHeight<=240&&zn()};p.useEffect(()=>{if(!P){H([]),Q(0),Ee(!1);return}let Ve=!0;return ne(!0),Y(null),bDt(P.id,{region:Qe,page:K,pageSize:Rse,project:P.projectName}).then(St=>{Ve&&(H(St.items||[]),Q(St.totalCount||0),Ee(St.degraded===!0))}).catch(St=>{Ve&&(H([]),Q(0),Ee(!1),Y(Er(St,u("skillCenter.errors.loadSkills"))))}).finally(()=>{Ve&&ne(!1)}),()=>{Ve=!1}},[Qe,P,K,vt,u]);const Ni=Ve=>{Yn(),L(Ve),de("overview"),F(1),G("")},Fn=()=>{Yn(),L(null),H([]),Q(0),Ee(!1),de("overview"),F(1),G(""),qt(null)},Yn=()=>{Ie.current+=1,le(null),Me(null),Ue([]),ve(null),je(!1)},vn=async Ve=>{if(!P)return;const St=Bb(Ve),Jt=Ie.current+1;Ie.current=Jt,le(Ve),Me(null),ve(null),je(!0);try{const[Vn,xr]=await Promise.all([yDt(P.id,St,Ve.version,Qe,P.projectName,Ve.skillName,P.name),VMe({spaceId:P.id,skillId:St,version:Ve.version,region:Qe,skillSpaceName:P.name,skillName:Ve.skillName})]);Ie.current===Jt&&(Me(Vn),Ue(xr))}catch(Vn){Ie.current===Jt&&ve(Er(Vn,u("skillCenter.errors.loadSkillDetails")))}finally{Ie.current===Jt&&je(!1)}},si=Ve=>{if(P)return{kind:"skill-center",skillId:Bb(Ve),version:Ve.version,region:Qe,projectName:P.projectName,skillSpaceId:P.id,skillSpaceName:P.name,name:Ve.skillName,description:Ve.skillDescription}},Bn=Ve=>{const St=si(Ve);!St||!(be!=null&&be.enabled)||(Yn(),qe({operation:"optimize",source:St}))},ni=async Ve=>{if(!(!P||!window.confirm(u("skillCenter.deleteSkillConfirm",{name:Ve.skillName})))){pt(Ve.skillId),qt(null);try{await mDt({spaceId:P.id,skillId:Ve.skillId,region:Qe}),Tt(St=>St+1),Ot(St=>St+1)}catch(St){qt(Er(St,u("skillCenter.errors.deleteSkill")))}finally{pt("")}}},Ui=async Ve=>{if(!window.confirm(u("skillCenter.deleteSpaceConfirm",{name:ac(Ve)})))return;const St=Mc(Ve);yt(St),qt(null);try{await fDt({spaceId:Ve.id,region:Ve.region||Xi(e)}),P&&Mc(P)===St&&Fn(),Ot(Jt=>Jt+1)}catch(Jt){qt(Er(Jt,u("skillCenter.errors.deleteSpace")))}finally{yt("")}},Ri=async(Ve,St=Ve.version,Jt=!1)=>{var Ks,is,Ur,Hn;if(!P||A.current)return;const Vn=P,xr=`${Vn.region}:${Vn.id}:${Ve.skillId}:${St}`;A.current=!0,b(xr),qt(null);try{const di=await oDt({spaceId:Vn.id,skillId:Ve.skillId,version:St,region:Vn.region||Qe});((Ks=B.current)==null?void 0:Ks.id)===Vn.id&&((is=B.current)==null?void 0:is.region)===Vn.region&&y(Cr=>[...Cr.filter(Qr=>Qr.id!==di.id),di])}catch(di){if(Jt)throw Er(di,u("skillCenter.reviewFailed"));((Ur=B.current)==null?void 0:Ur.id)===Vn.id&&((Hn=B.current)==null?void 0:Hn.region)===Vn.region&&qt(Er(di,u("skillCenter.reviewFailed")))}finally{A.current=!1,b(null)}};return ln&&(P||ln.selectPublishSpace)?o.jsx(zHt,{operation:ln.operation,cloudProvider:e,space:P??void 0,availableSpaces:h.filter(Ve=>!Ve.isShared),spacesLoading:j,initialIntent:ln.initialIntent,source:ln.source,onBack:()=>qe(null),onPublished:()=>{Tt(Ve=>Ve+1),Ot(Ve=>Ve+1)}}):o.jsxs("section",{className:`skillcenter${P?" is-space":" resource-collection"}`,children:[P?o.jsx(XC,{className:"skillcenter-detail",title:Ge||P.name,description:P.isShared?u("skillCenter.sharedDescription"):P.description||u("skillCenter.manageSpaceDescription"),identitySeed:P.name,backLabel:u("skillCenter.backToSpaces"),onBack:Fn,sections:[{key:"overview",label:u("skillCenter.overview"),content:o.jsxs(o.Fragment,{children:[jt?o.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:o.jsx(bs,{error:jt})}):null,S?o.jsxs("div",{className:"skillcenter-inline-error",role:"alert",children:[o.jsx(bs,{error:S}),o.jsx("button",{type:"button",onClick:()=>Tt(Ve=>Ve+1),children:u("common.reload")})]}):null,o.jsx("section",{className:"skillcenter-overview",children:o.jsxs(Fz,{className:"skillcenter-detail-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:u("skillCenter.skillCount")}),o.jsx("dd",{children:q})]}),o.jsxs("div",{children:[o.jsx("dt",{children:u("skillCenter.updatedAt")}),o.jsx("dd",{children:P.updatedAt?gqt(P.updatedAt,d.resolvedLanguage??d.language):"—"})]})]})})]})},{key:"skills",label:u("skillCenter.skills"),content:o.jsxs(o.Fragment,{children:[jt?o.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:o.jsx(bs,{error:jt})}):null,S?o.jsxs("div",{className:"skillcenter-inline-error",role:"alert",children:[o.jsx(bs,{error:S}),o.jsx("button",{type:"button",onClick:()=>Tt(Ve=>Ve+1),children:u("common.reload")})]}):null,o.jsxs("section",{className:"skillcenter-results","aria-label":u("skillCenter.skillsInSpace",{name:Ge||P.name}),children:[o.jsx(PIe,{title:u("skillCenter.skills"),description:u("skillCenter.totalItems",{count:q}),actions:o.jsxs(o.Fragment,{children:[o.jsx(hp,{"aria-label":u("skillCenter.searchSkills"),value:Z,onChange:Ve=>G(Ve.target.value),placeholder:u("skillCenter.searchSkills")}),o.jsx(It,{color:"secondary",variant:"outline",size:"sm",pill:!1,disabled:X||C,onClick:()=>Tt(Ve=>Ve+1),children:u("common.refresh")})]})}),ae?o.jsx("div",{className:"skillcenter-inline-warning",role:"status",children:u("skillCenter.degradedRelationWarning")}):null,X&&M.length===0?o.jsx(Ka,{}):z&&M.length===0?o.jsx(w4,{kind:"error",title:u("skillCenter.cannotLoadSkills"),error:z,action:{label:u("common.reload"),onClick:()=>Tt(Ve=>Ve+1)}}):Vt.length===0?o.jsx(w4,{kind:"empty",title:Z.trim()?u("skillCenter.noMatchingSkills"):u("skillCenter.noSkills"),description:Z.trim()?u("skillCenter.tryAnotherName"):u(P.isShared?"skillCenter.sharedEmpty":"skillCenter.emptySkillsDescription"),action:!Z.trim()&&mt?{label:u("skillCenter.localUpload"),onClick:()=>At(P)}:void 0}):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:Vt.map(Ve=>{const St=w.get(`${Ve.skillId}:${Ve.version}`);return o.jsxs("tr",{children:[o.jsx("td",{className:"skillcenter-table__skill",children:o.jsxs("button",{type:"button",onClick:()=>void vn(Ve),children:[o.jsxs("span",{className:"skillcenter-table__title-row",children:[o.jsx("strong",{title:Ve.skillName,children:Ve.skillName}),Ve.version?o.jsx("span",{className:"skillcenter-table__version-badge",children:Ve.sourceVersion||Ve.version}):null]}),o.jsx("span",{className:"skillcenter-table__description",children:mFe(Ve.skillDescription,u)}),P.isShared&&Ve.author?o.jsx("span",{className:"skillcenter-table__author",children:u("skillCenter.authorName",{name:Ve.author})}):null]})}),o.jsx("td",{children:o.jsxs("div",{className:"skillcenter-review-status",children:[o.jsx("span",{className:`skillcenter-status ${mqt(Ve.skillStatus)}`,children:pFe(Ve.skillStatus,u)}),St?o.jsx(CT,{status:St.status}):null,St!=null&&St.reviewer||St!=null&&St.reviewedBy?o.jsx(aq,{compact:!0,person:St.reviewer,fallback:St.reviewedBy}):null]})}),o.jsx("td",{children:o.jsxs("div",{className:"skillcenter-table__actions",children:[o.jsx("button",{type:"button",onClick:()=>void vn(Ve),children:u("common.view")}),!Ve.lookupByName&&Ve.skillId?o.jsx("button",{type:"button",onClick:()=>ce(Ve),children:u("skillCenter.versions.title")}):null,!P.isShared&&!Ve.lookupByName&&Ve.skillId?o.jsx("button",{type:"button",disabled:C||S!==null||g!==null||St!==void 0&&St.status!=="returned",onClick:()=>void Ri(Ve),children:g===`${P.region}:${P.id}:${Ve.skillId}:${Ve.version}`?u("skillCenter.reviewSubmitting"):u(St?{pending:"skillCenter.reviewPending",approving:"skillCenter.reviewApproving",approved:"skillCenter.reviewApproved",returned:"skillCenter.reviewRetry"}[St.status]:"skillCenter.requestPublication")}):null,v.some(Jt=>Jt.sourceSkillId===Ve.skillId)?o.jsx("button",{type:"button",onClick:()=>O(Ve),children:u("skillCenter.reviewHistory")}):null,P.isShared?null:o.jsx(YR,{disabled:!(be!=null&&be.enabled),children:o.jsx("button",{type:"button",disabled:!(be!=null&&be.enabled),onClick:()=>Bn(Ve),children:u("skillCenter.optimize")})}),!Ve.lookupByName&&mt?o.jsx("button",{type:"button",className:"is-danger",disabled:ft===Ve.skillId,onClick:()=>void ni(Ve),children:ft===Ve.skillId?u("common.deleting"):u("common.delete")}):null]})})]},`${Bb(Ve)}:${Ve.version}`)})})]})}),!Z.trim()&&!X&&!z&&q>0?o.jsx(Oqt,{page:K,total:q,pageSize:Rse,onPage:F}):null]})]})}],activeSectionKey:te,navigationLabel:u("skillCenter.spaceDetails"),onSectionChange:Ve=>de(Ve),actionsClassName:"skillcenter-toolbar-actions",actions:o.jsxs(o.Fragment,{children:[P.isShared?null:o.jsxs(o.Fragment,{children:[o.jsx(It,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>ye(P),children:u("skillCenter.editSpace")}),o.jsx(It,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,disabled:Pe===Mc(P),onClick:()=>void Ui(P),children:Pe===Mc(P)?u("common.deleting"):u("skillCenter.deleteSpace")})]}),mt?o.jsx(It,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>At(P),children:u("skillCenter.localUpload")}):null,P.isShared?null:o.jsx(YR,{disabled:!(be!=null&&be.enabled),children:o.jsxs(It,{type:"button",color:"primary",size:"lg",pill:!1,disabled:!(be!=null&&be.enabled),onClick:()=>qe({operation:"create"}),children:[o.jsx(u2e,{"aria-hidden":"true"}),o.jsx("span",{children:u("skillCenter.createSkill")})]})})]})}):o.jsxs(o.Fragment,{children:[o.jsxs(t0,{className:"skillcenter-list-toolbar library-resource-toolbar",children:[l,o.jsxs("div",{className:"resource-toolbar__actions",children:[c,o.jsx(hp,{"aria-label":u("skillCenter.searchSpaces"),value:I,onChange:Ve=>D(Ve.target.value),placeholder:u("skillCenter.searchSpaces")})]})]}),jt?o.jsx("div",{className:"skillcenter-inline-error",role:"alert",children:o.jsx(bs,{error:jt})}):null,o.jsxs(Dg,{className:"skillcenter-list-results",ref:kt,"aria-label":u("skillCenter.spaceList"),onScroll:$t,children:[rt.length>0&&!et?o.jsx(Dse,{errors:rt,cloudProvider:e,onRetry:()=>Ot(Ve=>Ve+1)}):null,o.jsxs(i0,{children:[o.jsx(lqt,{region:t,active:n,revision:Nt+i,onOpen:Ni},`${e}:${t}`),I.trim()?null:o.jsx(pg,{"aria-label":u("skillCenter.createSpace"),icon:o.jsx(xqt,{}),onClick:()=>Ze(!0),children:u("skillCenter.newSpace")}),hn.map(Ve=>{const St=Mc(Ve);return o.jsx(s0,{className:"skillcenter-space-card",title:ac(Ve),description:Ve.description||u("common.noDescription"),metadata:[{label:u("skillCenter.skillCount"),value:u("skillCenter.skillCountValue",{count:Ve.skillCount??0})},{label:u("skillCenter.updatedAt"),value:XD(Ve.updatedAt,Date.now(),d.resolvedLanguage??d.language)}],action:{label:u("skillCenter.addSkill"),icon:"plus",onClick:()=>He(Ve)},detailAction:{label:u("common.viewDetails"),onClick:()=>Ni(Ve)}},St)})]}),j&&h.length===0?o.jsx(Ka,{}):et&&h.length===0?o.jsx(Dse,{errors:rt,cloudProvider:e,fullPage:!0,onRetry:()=>Ot(Ve=>Ve+1)}):hn.length===0&&I.trim()?o.jsx(w4,{kind:"empty",title:u("skillCenter.noMatchingSpaces"),description:u("skillCenter.tryAnotherName")}):null,!et&&h.length>0?o.jsx("div",{className:"my-agent-load-more",ref:ct,"aria-live":"polite",children:j?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:u("skillCenter.loadingMoreSpaces")})]}):En?o.jsx("span",{children:u("skillCenter.scrollForMore")}):rt.length>0?o.jsx("span",{children:u("skillCenter.someSpacesFailed")}):o.jsx("span",{children:u("skillCenter.allSpacesLoaded")})}):null]})]}),fe&&P?o.jsx(aqt,{skill:fe,space:P,region:Qe,reviews:v.filter(Ve=>Ve.sourceSkillId===fe.skillId),onClose:()=>ce(null),onChanged:()=>Tt(Ve=>Ve+1),onSubmitReview:!P.isShared&&!C&&!S?Ve=>Ri(fe,Ve,!0):void 0},`${Qe}:${P.id}:${fe.skillId}`):null,x?o.jsx(oqt,{name:x.skillName,applications:v.filter(Ve=>Ve.sourceSkillId===x.skillId),onClose:()=>O(null)}):null,Ce&&P&&o.jsx(Sqt,{skill:Ce,space:P,region:Qe,cloudProvider:e,detail:Te,files:we,loading:ke,error:re,reviews:v.filter(Ve=>Ve.sourceSkillId===Ce.skillId),reviewsLoading:C,reviewsError:S,canOptimize:!P.isShared&&(be==null?void 0:be.enabled)===!0,onOptimize:()=>Bn(Ce),onDownload:()=>void gDt({spaceId:P.id,skillId:Bb(Ce),version:Ce.version,region:Qe,fallbackName:Ce.skillName,skillSpaceName:P.name,skillName:Ce.skillName}).catch(Ve=>ve(Er(Ve,u("skillCenter.errors.downloadSkill")))),onClose:Yn}),Ke?o.jsx(cqt,{region:t,regionOptions:nu(e),onClose:()=>Ze(!1),onCreated:Ve=>{Ze(!1),Ot(St=>St+1),L({...Ve,region:Ve.region||t})}}):null,he?o.jsx(uqt,{space:he,region:he.region||Xi(e),onClose:()=>ye(null),onUpdated:Ve=>{const St={...Ve,region:Ve.region||he.region||Xi(e)};ye(null),L(Jt=>Jt&&Mc(Jt)===Mc(St)?St:Jt),m(Jt=>Jt.map(Vn=>Mc(Vn)===Mc(St)?St:Vn)),Ot(Jt=>Jt+1)}}):null,Ae?o.jsx(Eqt,{space:Ae,canUseSandbox:(be==null?void 0:be.enabled)===!0,onClose:()=>He(null),onUpload:()=>{At(Ae),He(null)},onSandbox:()=>{const Ve=Ae;He(null),Ni(Ve),qe({operation:"create"})}}):null,De?o.jsx(dqt,{space:De,region:De.region||Xi(e),onClose:()=>At(null),onUploaded:()=>{At(null),Tt(Ve=>Ve+1),Ot(Ve=>Ve+1)}}):null]})}function Tqt(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 Aqt({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}=_e("workspaceTools"),m=p.useMemo(()=>Tqt(f),[f]),g=f("library.tabs.skills"),b=HI(t)?t:Xi(e),[v,y]=p.useState(b),[w,x]=p.useState(g),O=p.useRef(g),[S,k]=p.useState(!1),[C,E]=p.useState(()=>new Set(["skills",n])),[R,A]=p.useState({skills:0,knowledge:0,artifacts:0}),N=p.useRef(u),[T,j]=p.useState([]),[_,I]=p.useState(!1),[D,P]=p.useState(""),L=p.useMemo(()=>{const ne=F1t(l,f("library.untitledSession"));return{key:JSON.stringify(ne),candidates:ne}},[l,f]),B=p.useRef(L);B.current.key!==L.key&&(B.current=L);const M=B.current.candidates,H=p.useMemo(()=>nu(e),[e]);p.useEffect(()=>{y(b)},[b]),p.useEffect(()=>{const ne=O.current;x(z=>z===ne?g:z),O.current=g},[g]),p.useEffect(()=>{N.current=u},[u]),p.useEffect(()=>{E(ne=>{if(ne.has(n))return ne;const z=new Set(ne);return z.add(n),z})},[n]),p.useEffect(()=>{var z;const ne=n==="skills"?w:((z=m.find(Y=>Y.id===n))==null?void 0:z.label)||f("library.title");r==null||r(ne)},[n,r,w,f,m]),p.useEffect(()=>{var ne;n==="artifacts"&&((ne=N.current)==null||ne.call(N))},[n,R.artifacts]);const K=p.useCallback(async()=>{I(!0),P("");try{j(await K1t(M))}catch(ne){P(ne instanceof Error?ne.message:String(ne))}finally{I(!1)}},[M]);p.useEffect(()=>{n==="artifacts"&&K()},[n,R.artifacts,K]);const F=ne=>{E(z=>{if(z.has(ne))return z;const Y=new Set(z);return Y.add(ne),Y}),A(z=>({...z,[ne]:z[ne]+1})),i(ne)},q=o.jsx(n0,{idPrefix:"library",ariaLabel:f("library.categoryAria"),value:n,items:m,onChange:F}),Q=ne=>o.jsx(hg,{id:ne,ariaLabel:f("library.regionAria"),value:v,options:H,onChange:y}),X=n==="skills"?w!==g:n==="knowledge"&&S;return o.jsxs(Bf,{className:`library-view${X?" is-detail":""}`,"aria-label":f("library.title"),children:[X?null:o.jsx(e0,{className:"library-view__header",title:f("library.title")}),o.jsxs("div",{className:"library-panels",children:[C.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(Cqt,{cloudProvider:e,region:v,active:n==="skills",activationRevision:R.skills,onPageTitleChange:x,initialWorkspace:s,onInitialWorkspaceConsumed:a,toolbarLeading:q,toolbarFilters:Q("library-skills-region-filter")})}):null,C.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(UPt,{cloudProvider:e,region:v,active:n==="knowledge",activationRevision:R.knowledge,onDetailChange:k,toolbarLeading:q,toolbarFilters:Q("library-knowledge-region-filter")})}):null,C.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(H1t,{items:T,region:v,userId:c,active:n==="artifacts",activationRevision:R.artifacts,loading:_,error:D?ga(D,h.resolvedLanguage||h.language)||f("artifactLibrary.loadDetailFallback"):"",onRetry:()=>void K(),onEdit:G1t,onDelete:X1t,onDownload:Y1t,onOpenSource:d?ne=>d(ne.appName,ne.sessionId):void 0,toolbarLeading:q,toolbarFilters:Q("library-artifacts-region-filter")})}):null]})]})}const gFe="veadk_agentkit_connections",_qt=3e3,Mse=6e4;function Od(){try{const e=localStorage.getItem(gFe);return(e?JSON.parse(e):[]).filter(n=>!n.runtimeId||!!n.region)}catch{return[]}}function YD(e){try{localStorage.setItem(gFe,JSON.stringify(e))}catch{}}function Id(e,t){return`agentkit:${e}:${t}`}function bFe(e){try{return new URL(e).host}catch{return e}}function E1(e){FEe();for(const t of e)if(!(t.runtimeId&&!t.region))for(const n of t.apps)$Ee(Id(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,region:t.region}:{app:n,base:t.base,apiKey:t.apiKey})}function yFe(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=Od(),c=l.findIndex(u=>u.runtimeId===e);return c===-1?l.push(a):l[c]=a,YD(l),E1(l),a}async function jqt(e,t,n,i,r){let s=null,a=n||"cn-beijing",l=null;for(const f of kC(n))try{const h=await Gx(e,f,{retryProbe:!0,preferCached:!0,currentVersion:i});if(h&&h.length>0){await nTe(e,f),s=h,a=f;break}}catch(h){if(h instanceof Uw)throw ZR(e),h;if(h instanceof bo&&h.unsupported){l=h;continue}throw h}if(!s||s.length===0)throw ZR(e),l||new bo(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=yFe(e,t,a,s,u,i);return Id(d.id,s[0])}function Nqt(e){return new Promise(t=>window.setTimeout(t,e))}async function Aj(e,t,n,i,r={}){const s=Date.now();for(;;)try{return await jqt(e,t,n,i,r.agentName)}catch(a){const l=Date.now()-s;if(!r.waitForReady||!(a instanceof bo)||!a.retryable||l>=Mse)throw a;const c=Math.min(_qt,Mse-l);await Nqt(c)}}async function vFe(e,t,n,i){const r=t.trim().replace(/\/+$/,""),s=await SC(r,n.trim()),a={id:Date.now().toString(36),name:e.trim()||bFe(r),base:r,apiKey:n.trim(),apps:s,appLabels:i&&s.length>0?{[s[0]]:i}:void 0},l=[...Od().filter(c=>c.base!==r),a];return YD(l),E1(l),a}function Rqt(e){const t=Od().filter(n=>n.id!==e);return YD(t),E1(t),t}function ZR(e){const t=Od().filter(n=>n.runtimeId!==e);return YD(t),E1(t),t}function xFe(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:Id(r.id,s),label:a,app:s,remote:!0,host:r.runtimeId?r.name:bFe(r.base??""),runtimeId:r.runtimeId,region:r.region,currentVersion:r.currentVersion}}));return[...n,...i]}const Lse=Object.freeze(Object.defineProperty({__proto__:null,addConnection:vFe,addRuntimeConnection:yFe,buildAgentEntries:xFe,connectRuntime:Aj,loadConnections:Od,registerConnections:E1,remoteAppId:Id,removeConnection:Rqt,removeRuntimeConnection:ZR},Symbol.toStringTag,{value:"Module"}));function Iqt({onAdded:e,onCancel:t}){const{t:n}=_e("conversation"),[i,r]=p.useState(""),[s,a]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(!1),[f,h]=p.useState(""),m=i.trim().length>0&&s.trim().length>0&&!u;async function g(){if(m){d(!0),h("");try{const b=await vFe(l,i,s,l);if(b.apps.length===0){h(n("addAgentKit.noAgents")),d(!1);return}e(Id(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:!m,children:[u?o.jsx(Bi,{className:"icon spin"}):null,n(u?"addAgentKit.connecting":"addAgentKit.connect")]})]})]})})}const Pqt=/[\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff]/u,Dqt={"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"},Mqt={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 ZD(e){var r,s;const t=((r=e.message)==null?void 0:r.trim())??"",n=e.messageCode?Dqt[e.messageCode]:void 0;if(n)return V(n);if(t&&(F$().toLowerCase()==="zh-cn"||!Pqt.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?Mqt[e.phase]:void 0;return i?V(i):t||V("client.deploymentProgress.inProgress")}function Lqt(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 $qt=[{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"}]}],Fqt={核心能力回归:"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 gk(e,t){const n=Fqt[e];return n?t(n):e}const $se=["basic","usage","evaluations","optimizations","integrations","versions"],Bqt=20;function Uqt(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 jO=[{id:"api-server",label:"API Server"},{id:"a2a",label:"A2A"}];function O4(e,t){return e?`${e.replace(/\/+$/,"")}${t}`:""}function Qqt(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 Fse(e,t){return e==="key_auth"?"API Key":e==="custom_jwt"?"OAuth / JWT":t(e==="none"?"agentWorkspace.noAuthentication":"agentWorkspace.notAvailable")}function Bse(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 zqt(e,t){return e.changeType==="rollback"?t("agentWorkspace.rollbackEvent"):e.version}function t9(e){return JSON.stringify(e)}function wFe(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 Lqt(e,t,n){const i=e.replace(/\/+$/,"");return`\`\`\`python +HEADERS = {"Authorization": f"Bearer {AUTH_TOKEN}"}`}function Vqt(e,t,n){const i=e.replace(/\/+$/,"");return`\`\`\`python import uuid import requests @@ -767,7 +767,7 @@ BASE_URL = ${t9(i)} APP_NAME = ${t9(t)} USER_ID = "demo-user" SESSION_ID = str(uuid.uuid4()) -${pFe(n)} +${wFe(n)} session_response = requests.post( f"{BASE_URL}/apps/{APP_NAME}/users/{USER_ID}/sessions/{SESSION_ID}", @@ -797,13 +797,13 @@ with requests.post( for line in response.iter_lines(): if line: print(line.decode("utf-8")) -\`\`\``}function $qt(e,t){return`\`\`\`python +\`\`\``}function Hqt(e,t){return`\`\`\`python import uuid import requests AGENT_URL = ${t9(e)} -${pFe(t)} +${wFe(t)} response = requests.post( AGENT_URL, @@ -824,23 +824,23 @@ response = requests.post( ) response.raise_for_status() print(response.json()) -\`\`\``}function Fqt({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 Use({available:e,authType:t,value:n,visible:i,loading:r,error:s,onToggle:a}){const{t:l}=je("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(Fqt,{visible:i})}),s&&o.jsx("span",{className:"aw-integration-secret-error",role:"alert",children:s})]}):l("agentWorkspace.notAvailable")}function Qse({protocol:e,title:t,available:n,fields:i,example:r}){const{t:s}=je("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(Ju,{text:r,className:"aw-integration-example-code",allowRawHtml:!1})]})]})}function Bqt(e,t,n){var i;return Pz({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 mFe(e){return e?1+e.children.reduce((t,n)=>t+mFe(n),0):1}function gFe(e){return 1+e.subAgents.reduce((t,n)=>t+gFe(n),0)}function n9(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 Uqt(e,t,n){const i=n9(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 Qqt(e,t){return typeof e.score!="number"||!Number.isFinite(e.score)?"—":t("agentWorkspace.scoreValue",{score:Math.round(e.score*100)})}function zqt(e,t){return t(`agentWorkspace.priority.${e}`)}const Vqt={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 Hqt(e,t){var n;return e.module==="other"?((n=e.customModule)==null?void 0:n.trim())||t("agentWorkspace.modules.other"):t(Vqt[e.module])}function qqt(e,t){return e.find(n=>n.kind===t)}function zse(e,t){return e.items.map(n=>({...n,tag:t(n.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")})).sort((n,i)=>n9(i.createdAt)-n9(n.createdAt))}function Wqt(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 Kqt(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 Gqt(e,t){return{phase:"update",label:t("agentWorkspace.deploymentSteps.update.label"),description:t("agentWorkspace.deploymentSteps.update.description",e)}}function bFe(e,t){const n=Kqt(t),i=[...n.slice(0,-1)];return e.instanceRange&&i.push(Gqt(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 yFe(e,t){const n=bFe(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 Xqt(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 vFe({log:e,autoExpand:t,title:n,ariaLabel:i,copyLabel:r,defaultPendingMessage:s}){const{t:a,i18n:l}=je("ui"),c=p.useRef(null),u=!!((e==null?void 0:e.status)!=="complete"&&t),[d,f]=p.useState(u),[h,m]=p.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 qqt({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 Use({available:e,authType:t,value:n,visible:i,loading:r,error:s,onToggle:a}){const{t:l}=_e("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(qqt,{visible:i})}),s&&o.jsx("span",{className:"aw-integration-secret-error",role:"alert",children:s})]}):l("agentWorkspace.notAvailable")}function Qse({protocol:e,title:t,available:n,fields:i,example:r}){const{t:s}=_e("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(Zu,{text:r,className:"aw-integration-example-code",allowRawHtml:!1})]})]})}function Wqt(e,t,n){var i;return Pz({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 OFe(e){return e?1+e.children.reduce((t,n)=>t+OFe(n),0):1}function kFe(e){return 1+e.subAgents.reduce((t,n)=>t+kFe(n),0)}function n9(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 Kqt(e,t,n){const i=n9(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 Gqt(e,t){return typeof e.score!="number"||!Number.isFinite(e.score)?"—":t("agentWorkspace.scoreValue",{score:Math.round(e.score*100)})}function Xqt(e,t){return t(`agentWorkspace.priority.${e}`)}const Yqt={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 Zqt(e,t){var n;return e.module==="other"?((n=e.customModule)==null?void 0:n.trim())||t("agentWorkspace.modules.other"):t(Yqt[e.module])}function Jqt(e,t){return e.find(n=>n.kind===t)}function zse(e,t){return e.items.map(n=>({...n,tag:t(n.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")})).sort((n,i)=>n9(i.createdAt)-n9(n.createdAt))}function eWt(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 tWt(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 nWt(e,t){return{phase:"update",label:t("agentWorkspace.deploymentSteps.update.label"),description:t("agentWorkspace.deploymentSteps.update.description",e)}}function SFe(e,t){const n=tWt(t),i=[...n.slice(0,-1)];return e.instanceRange&&i.push(nWt(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 EFe(e,t){const n=SFe(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 iWt(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 CFe({log:e,autoExpand:t,title:n,ariaLabel:i,copyLabel:r,defaultPendingMessage:s}){const{t:a,i18n:l}=_e("ui"),c=p.useRef(null),u=!!((e==null?void 0:e.status)!=="complete"&&t),[d,f]=p.useState(u),[h,m]=p.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(` -`),w=(e==null?void 0:e.pendingMessage)||s;if(p.useEffect(()=>{e&&f(u)},[e==null?void 0:e.status,u]),p.useEffect(()=>{if(!d||!g)return;const E=c.current;E&&(E.scrollTop=E.scrollHeight)},[d,g,y]),!e||!e.text&&e.status!=="error"&&!e.pendingMessage)return null;const x=Xqt(e.updatedAt,l.resolvedLanguage??l.language),O=e.status==="complete"?a("agentWorkspace.logStatus.synced"):e.status==="error"?a("agentWorkspace.logStatus.failed"):a("agentWorkspace.logStatus.syncing"),S=e.omittedEarly?a("agentWorkspace.logStatus.earlyOmitted"):e.snapshotTruncated?a("agentWorkspace.logStatus.recentOnly"):e.truncated?a("agentWorkspace.logStatus.partiallyOmitted"):"",k=[O,e.lineCount?a("agentWorkspace.logLines",{count:e.lineCount}):"",S,x].filter(Boolean).join(" · ");async function C(){try{await navigator.clipboard.writeText(b),m(!0),window.setTimeout(()=>m(!1),1500)}catch{m(!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:k})]}),o.jsxs("div",{className:"aw-deploy-log-actions",children:[g&&o.jsx("button",{type:"button",onClick:()=>f(E=>!E),children:a(d?"common.collapse":"common.expand")}),g&&o.jsxs("button",{type:"button",onClick:()=>void C(),"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(Bd,{"aria-hidden":!0}):o.jsx(mP,{"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:w}))]})}function Yqt({task:e}){var n;const{t}=je("ui");return o.jsx(vFe,{log:e.buildLog,autoExpand:((n=e.buildLog)==null?void 0:n.status)!=="complete"&&(e.status==="running"||e.status==="error")&&yFe(e,t)===1,title:t("agentWorkspace.buildLog"),ariaLabel:t("agentWorkspace.buildLog"),copyLabel:t("agentWorkspace.buildLog"),defaultPendingMessage:t("agentWorkspace.waitingBuildLog")})}function Zqt({task:e}){var n;const{t}=je("ui");return o.jsx(vFe,{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 Jqt({task:e,onReturnToEdit:t}){const{t:n}=je("ui"),i=bFe(e,n),r=yFe(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(H_,{}):e.status==="running"?o.jsx(Mi,{className:"spin"}):e.status==="success"?o.jsx(Qit,{}):e.status==="error"?o.jsx(H_,{}):o.jsx(pF,{})}),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),[yt,Bn]=p.useState(()=>new Set),[Vt,Wn]=p.useState(!1),[_n,ei]=p.useState(""),[Sn,Vn]=p.useState(null),[Cn,Kn]=p.useState([]),[vr,xr]=p.useState([]),[er,He]=p.useState(!1),[wt,tn]=p.useState(""),[Gn,Cr]=p.useState(""),[ys,is]=p.useState(0),[Tr,Xn]=p.useState([]),[ii,Ur]=p.useState(!1),[Gi,oe]=p.useState(""),[tr,Uo]=p.useState(0),[no,io]=p.useState(null),[So,rs]=p.useState(1),[Hs,Qo]=p.useState(!1),[Ga,Yn]=p.useState(""),[Ai,Bl]=p.useState(0),[zo,wi]=p.useState(!1),[Xa,Eo]=p.useState(()=>new Set),[js,vc]=p.useState(!1),[Sa,nr]=p.useState(""),[qs,Ar]=p.useState(""),[Ya,Un]=p.useState(()=>new Set),Ns=p.useRef(!1),vs=p.useRef(""),_r=p.useRef(null),Rs=p.useRef(0),Qr=p.useRef(0),_i=p.useRef(0),[Vo,Ho]=p.useState(Nqt),[bu,ml]=p.useState("");p.useEffect(()=>{e.length!==0&&Ho(pe=>pe.map((Ue,tt)=>tt===0&&Ue.agentIds.length===0?{...Ue,agentIds:e.slice(0,2).map(nt=>nt.id)}:Ue))},[e]);const Ea=p.useMemo(()=>{const pe=new Map;for(const Ue of e)Ue.runtimeId&&pe.set(Ue.runtimeId,Ue);return pe},[e]),Ca=p.useMemo(()=>{var Ue;const pe=new Map;for(const tt of t){const nt=(Ue=tt.deploymentTarget)==null?void 0:Ue.runtimeId;if(!nt||!Ea.has(nt))continue;const wn=pe.get(nt);(!wn||tt.updatedAt>wn.updatedAt)&&pe.set(nt,tt)}return pe},[Ea,t]),gl=p.useMemo(()=>{const pe=new Map;for(const Ue of f){if(!Ue.runtimeId)continue;const tt=pe.get(Ue.runtimeId);(!tt||Ue.startedAt>tt.startedAt)&&pe.set(Ue.runtimeId,Ue)}return pe},[f]),sd=p.useMemo(()=>{const pe=Le.trim().toLowerCase();return pe?e.filter(Ue=>{const tt=Ue.runtimeId?Ca.get(Ue.runtimeId):void 0,nt=Ue.runtimeId?gl.get(Ue.runtimeId):void 0;return[Ue.label,Ue.app,Ue.host??"",(tt==null?void 0:tt.draft.name)??"",(tt==null?void 0:tt.draft.description)??"",(nt==null?void 0:nt.runtimeName)??""].join(" ").toLowerCase().includes(pe)}):e},[e,gl,Le,Ca]),Is=p.useMemo(()=>{const pe=Le.trim().toLowerCase();return t.filter(Ue=>{var nt;const tt=(nt=Ue.deploymentTarget)==null?void 0:nt.runtimeId;return tt&&Ea.has(tt)?!1:pe?`${Ue.draft.name} ${Ue.draft.description}`.toLowerCase().includes(pe):!0})},[Ea,t,Le]),xc=p.useMemo(()=>t.filter(pe=>{var tt;const Ue=(tt=pe.deploymentTarget)==null?void 0:tt.runtimeId;return!Ue||!Ea.has(Ue)}).length,[Ea,t]),yu=p.useMemo(()=>{const pe=Le.trim().toLowerCase();return pe?Vo.filter(Ue=>Ue.name.toLowerCase().includes(pe)):Vo},[Vo,Le]),xe=e.find(pe=>pe.id===I),fi=t.find(pe=>pe.id===K),Li=h?f.find(pe=>pe.id===h):void 0,zr=xe!=null&&xe.runtimeId?Ca.get(xe.runtimeId):void 0,hi=y?Nt:I&&r===I?i:null,Vi=(hi==null?void 0:hi.appName)||(xe==null?void 0:xe.runtimeApp)||(xe==null?void 0:xe.app)||"",Ta=(c&&(xe!=null&&xe.runtimeId)?$se:$se.filter(pe=>pe!=="usage")).map(pe=>({id:pe,label:_(`agentWorkspace.sections.${pe}`)})),Co=JSON.stringify([(xe==null?void 0:xe.runtimeId)??"",(xe==null?void 0:xe.region)??"cn-beijing",Vi,So]),xs=(no==null?void 0:no.requestKey)===Co?no.value:null,Aa=`${(xe==null?void 0:xe.region)??"cn-beijing"}:${(xe==null?void 0:xe.runtimeId)??""}`,wc=(Ce==null?void 0:Ce.requestKey)===Aa?Ce.value:"",pr=(X==null?void 0:X.requestKey)===Aa?X:null,qo=!!((oi=pr==null?void 0:pr.apiApps)!=null&&oi.length),Za=!!(pr!=null&&pr.a2a),ia=((th=pr==null?void 0:pr.apiApps)==null?void 0:th[0])??Vi,Pn=(q==null?void 0:q.endpoint)??"",Ja=Dqt(((I1=pr==null?void 0:pr.a2a)==null?void 0:I1.endpoint)??"",Pn),ra=(xe==null?void 0:xe.runtimeApp)||"",el=JSON.stringify([(xe==null?void 0:xe.runtimeId)??"",(xe==null?void 0:xe.region)??"",(xe==null?void 0:xe.currentVersion)??null,ra]),Re=l&&(xe!=null&&xe.runtimeId)&&xe.region&&sn===0?J$({runtimeId:xe.runtimeId,region:xe.region,appName:ra,currentVersion:xe.currentVersion}):null,et=(de==null?void 0:de.requestKey)===el?de.value:Re,Pt=et!=null&&et.reason?da(et.reason,D.resolvedLanguage||D.language):"",Tn=(et==null?void 0:et.warnings.filter(pe=>da(pe,D.resolvedLanguage||D.language)))??[];p.useEffect(()=>{const pe=Rs.current+1;Rs.current=pe,ve(null),At("");const Ue=(xe==null?void 0:xe.runtimeId)??"",tt=(xe==null?void 0:xe.region)??"";if(!l||!Ue||!tt){Ke(!1);return}const nt=sn===0?J$({runtimeId:Ue,region:tt,appName:ra,currentVersion:xe==null?void 0:xe.currentVersion}):null;if(nt){ve({requestKey:el,value:nt}),Ke(!1);return}const wn=new AbortController;let ut,Oi=0;const oo=60;Ke(!0);const ki=Ws=>{XI({runtimeId:Ue,region:tt,appName:ra,currentVersion:xe==null?void 0:xe.currentVersion,signal:wn.signal,force:Ws&&sn>0}).then(yl=>{var w0,PT;if(pe!==Rs.current)return;const Mp=yl.recoveryStatus==="preparing";if(yl.runtime.runtimeId!==Ue||yl.runtime.region!==tt||!Mp&&ra&&((w0=yl.agent)==null?void 0:w0.appName)!==ra||yl.canUpdate&&!((PT=yl.agent)!=null&&PT.appName)){At(_("agentWorkspace.errors.updateCapabilityMismatch"));return}if(ve({requestKey:el,value:yl}),Ke(!1),!!Mp){if(Oi+=1,Oi>=oo){At(_("agentWorkspace.errors.updateConfigRestoring"));return}ut=window.setTimeout(()=>ki(!1),1e3)}}).catch(()=>{pe!==Rs.current||wn.signal.aborted||At(_("agentWorkspace.errors.checkUpdateCapability"))}).finally(()=>{pe===Rs.current&&!wn.signal.aborted&&Ke(!1)})};return ki(!0),()=>{wn.abort(),ut!=null&&window.clearTimeout(ut)}},[l,ra,sn,xe==null?void 0:xe.currentVersion,xe==null?void 0:xe.region,xe==null?void 0:xe.runtimeId,el]);const an=p.useMemo(()=>{const pe=new Map(e.map((tt,nt)=>[tt.id,nt])),Ue=new Map(n.map((tt,nt)=>[tt,nt]));return[...sd].sort((tt,nt)=>{const wn=tt.runtimeId?gl.get(tt.runtimeId):void 0,ut=nt.runtimeId?gl.get(nt.runtimeId):void 0,Oi=(wn==null?void 0:wn.status)==="running"?wn.startedAt:0,oo=(ut==null?void 0:ut.status)==="running"?ut.startedAt:0;if(Oi!==oo)return oo-Oi;const ki=Ue.get(tt.id),Ws=Ue.get(nt.id);return ki!=null&&Ws!=null?ki-Ws:ki!=null?-1:Ws!=null?1:(pe.get(tt.id)??0)-(pe.get(nt.id)??0)})},[n,e,sd,gl]),gn=(xe==null?void 0:xe.label)||(hi==null?void 0:hi.name)||(fi==null?void 0:fi.draft.name)||(Li==null?void 0:Li.agentName)||((x0=Li==null?void 0:Li.agentDraft)==null?void 0:x0.name)||_("agentWorkspace.noAgentSelected"),xn=Vo.find(pe=>pe.id===bu),nn=an.filter(pe=>pe.canDelete===!0),yn=an.filter(pe=>On.has(pe.id)&&pe.canDelete===!0),Dn=Is.filter(pe=>yt.has(pe.id)),Zn=nn.length+Is.length,ss=yn.length+Dn.length,mr=p.useMemo(()=>{var Ue;if(Li!=null&&Li.agentDraft)return Li.agentDraft;if(fi!=null&&fi.draft)return fi.draft;const pe=(Ue=xe==null?void 0:xe.region)!=null&&Ue.startsWith("ap-")?"byteplus":"volcengine";return et!=null&&et.agent&&(et.recoveryStatus==="complete"||et.recoveryStatus==="draft-only")?Pz(et.agent,pe,et.runtime.configuredEnvKeys):Bqt(hi,Vi||(xe==null?void 0:xe.label)||"agent",pe)},[hi,Vi,xe==null?void 0:xe.label,xe==null?void 0:xe.region,fi==null?void 0:fi.draft,Li==null?void 0:Li.agentDraft,et]),Ps=((IT=hi==null?void 0:hi.draft)==null?void 0:IT.harnessSidecar)??_xt(q==null?void 0:q.envs),tl=Ps?t1.filter(pe=>Ps.componentOverrides[pe]):[],sa=fi?a?"":_("agentWorkspace.errors.noCreatePermission"):l?xe!=null&&xe.runtimeId?xe.region?Te?_("agentWorkspace.errors.checkingUpdateConfig"):$e||(et?et.recoveryStatus!=="complete"&&et.recoveryStatus!=="draft-only"?Pt||_("agentWorkspace.errors.originalConfigUnavailable"):et.canUpdate?(xu=et.agent)!=null&&xu.appName?"":_("agentWorkspace.errors.agentInfoMissing"):Pt||_("agentWorkspace.errors.updateUnsupported"):_("agentWorkspace.errors.updateCapabilityPending")):_("agentWorkspace.errors.runtimeRegionMissing"):_("agentWorkspace.errors.cloudOnlyUpdate"):_("agentWorkspace.errors.noManagePermission"),oa="aw-update-disabled-reason",vu=p.useMemo(()=>{if(hi)return hi.tools;const pe=(mr.builtinTools??[]).map(Ue=>{var tt;return((tt=e1.find(nt=>nt.id===Ue))==null?void 0:tt.label)??Ue});return Array.from(new Set([...mr.tools,...pe,...(mr.customTools??[]).map(Ue=>Ue.name),...(mr.mcpTools??[]).map(Ue=>Ue.name)].filter(Boolean)))},[mr,hi]),me=p.useMemo(()=>hi?hi.skillsPreviewSupported?hi.skills.map(pe=>pe.name):null:Array.from(new Set([...(mr.selectedSkills??[]).map(pe=>pe.name),...mr.skills].filter(Boolean))),[mr,hi]),ze=p.useMemo(()=>{if(Li)return Li;if(fi){const pe=f.filter(Ue=>Ue.draftId===fi.id).sort((Ue,tt)=>tt.startedAt-Ue.startedAt)[0];return pe||f.filter(Ue=>{var tt,nt;return((tt=Ue.agentDraft)==null?void 0:tt.name)===fi.draft.name||Ue.agentName===fi.draft.name||!!((nt=fi.deploymentTarget)!=null&&nt.runtimeId)&&Ue.runtimeId===fi.deploymentTarget.runtimeId}).sort((Ue,tt)=>tt.startedAt-Ue.startedAt)[0]}if(xe)return f.filter(pe=>!!xe.runtimeId&&pe.runtimeId===xe.runtimeId||pe.agentName===xe.label).sort((pe,Ue)=>Ue.startedAt-pe.startedAt)[0]},[f,xe,fi,Li]),Pe=!!(h&&ze&&ze.id===h),ht=!!(ze&&(ze.status!=="success"||Pe)),J=(ze==null?void 0:ze.status)==="running",_e=ze!=null&&ze.draftId?t.find(pe=>pe.id===ze.draftId)??(ze.agentDraft?{id:ze.draftId,draft:ze.agentDraft,updatedAt:ze.startedAt}:void 0):void 0,lt=p.useMemo(()=>Wqt(mr),[mr]),$t=(xe==null?void 0:xe.currentVersion)??(q==null?void 0:q.currentVersion)??null,bn=$t??(Li==null?void 0:Li.startedAt)??"unknown",ri=hi?`runtime:${(xe==null?void 0:xe.runtimeId)??hi.name}:v${bn}:${lt}`:`draft:${(Li==null?void 0:Li.id)??(fi==null?void 0:fi.id)??(xe==null?void 0:xe.id)??gn}:${lt}`;p.useEffect(()=>{L==="usage"&&!c&&B("basic")},[c,L]),p.useEffect(()=>{if(!h)return;const pe=f.find(tt=>tt.id===h),Ue=pe!=null&&pe.runtimeId?Ea.get(pe.runtimeId):void 0;if(Ue){F(""),z(Ue.id),B("basic");return}z(""),F(""),B("basic")},[Ea,f,h]),p.useEffect(()=>{if(!m){vs.current="";return}const pe=`${m}:${g}:${b}:${c}`;vs.current!==pe&&e.some(Ue=>Ue.id===m)&&(vs.current=pe,F(""),z(m),B(g==="usage"&&!c?"basic":g),g==="evaluations"&&(ot(b),rt("")))},[e,c,m,g,b]),p.useEffect(()=>{for(const pe of an.slice(0,8)){if(!pe.runtimeId)continue;const Ue=pe.region??"cn-beijing";tTe(pe.runtimeId,Ue),JEe(pe.runtimeId,Ue,pe.runtimeApp??"")}},[an]),p.useEffect(()=>{let pe=!1;const Ue=(xe==null?void 0:xe.runtimeId)??"",tt=(xe==null?void 0:xe.region)??"cn-beijing",nt=(xe==null?void 0:xe.runtimeApp)??"",wn=Ue?ZEe(Ue,tt,nt):null;if(vt(wn),gt(""),bt(!1),Tt(!!wn||!y||!Ue),!(!y||!Ue))return NU(Ue,tt,nt,{force:!0}).then(ut=>{pe||vt(ut)}).catch(ut=>{!pe&&!wn&&vt(null),pe||(bt(ut instanceof po&&ut.unsupported),gt(_("agentWorkspace.errors.loadAgentInfo")))}).finally(()=>{pe||Tt(!0)}),()=>{pe=!0}},[y,sn,xe==null?void 0:xe.currentVersion,xe==null?void 0:xe.region,xe==null?void 0:xe.runtimeApp,xe==null?void 0:xe.runtimeId]),p.useEffect(()=>{let pe=!1;const Ue=(xe==null?void 0:xe.runtimeId)??"",tt=(xe==null?void 0:xe.region)??"cn-beijing";if(Xn([]),oe(""),L!=="optimizations"||!Ue){Ur(!1);return}if(y&&!Vi){Ur(!Ot);return}return Ur(!0),QEe({runtimeId:Ue,region:tt,appName:Vi}).then(nt=>{pe||Xn(nt.groups)}).catch(()=>{pe||oe(_("agentWorkspace.errors.loadOptimizations"))}).finally(()=>{pe||Ur(!1)}),()=>{pe=!0}},[Ot,y,tr,L,Vi,xe==null?void 0:xe.region,xe==null?void 0:xe.runtimeId]),p.useEffect(()=>{rs(1)},[xe==null?void 0:xe.runtimeId,Vi]),p.useEffect(()=>{const pe=_i.current+1;_i.current=pe;const Ue=(xe==null?void 0:xe.runtimeId)??"",tt=(xe==null?void 0:xe.region)??"cn-beijing",nt=Vi;if(Yn(""),L!=="usage"||!Ue){Qo(!1);return}if(!nt){Qo(y&&!Ot);return}const wn=new AbortController;return Qo(!0),UCe({runtimeId:Ue,region:tt,appName:nt,page:So,pageSize:Iqt,signal:wn.signal}).then(ut=>{if(pe===_i.current){if(ut.runtimeId!==Ue||ut.appName!==nt||ut.page!==So){Yn(_("agentWorkspace.errors.usageMismatch"));return}io({requestKey:Co,value:ut})}}).catch(()=>{pe!==_i.current||wn.signal.aborted||Yn(_("agentWorkspace.errors.loadUsage"))}).finally(()=>{pe===_i.current&&Qo(!1)}),()=>{wn.abort()}},[So,Ai,Co,Ot,y,L,Vi,xe==null?void 0:xe.region,xe==null?void 0:xe.runtimeId]),p.useEffect(()=>{Qr.current+=1,se(null),ae(!1),De(!1),Qe(""),ue("api-server")},[Aa,L]);function Gr(){Qr.current+=1,se(null),ae(!1),De(!1),Qe("")}function wr(pe){pe!==te&&(Gr(),ue(pe))}async function jr(){if(he){Gr();return}const pe=(xe==null?void 0:xe.runtimeId)??"",Ue=(xe==null?void 0:xe.region)??"cn-beijing";if(!pe)return;const tt=Qr.current+1;Qr.current=tt,De(!0),Qe("");try{const nt=await YCe(pe,Ue);if(tt!==Qr.current)return;se({requestKey:Aa,value:nt}),ae(!0)}catch(nt){if(tt!==Qr.current)return;se(null),ae(!1),Qe(nt instanceof Error?nt.message:_("agentWorkspace.errors.loadApiKey"))}finally{tt===Qr.current&&De(!1)}}p.useEffect(()=>{let pe=!1;const Ue=(xe==null?void 0:xe.runtimeId)??"",tt=(xe==null?void 0:xe.region)??"cn-beijing",nt=Ue?eTe(Ue,tt):null;if(H(nt),Ct(""),!!Ue)return $U(Ue,tt,{force:!0}).then(wn=>{pe||H(wn)}).catch(()=>{!pe&&!nt&&H(null),pe||Ct(_("agentWorkspace.errors.loadRuntimeDetails"))}),()=>{pe=!0}},[sn,xe==null?void 0:xe.currentVersion,xe==null?void 0:xe.region,xe==null?void 0:xe.runtimeId]),p.useEffect(()=>{let pe=!1;const Ue=(xe==null?void 0:xe.runtimeId)??"";if(ke(""),L!=="versions"||!Ue){fe(!1),Ue||Ne(null);return}return fe(!0),B_(Ue).then(tt=>{pe||Ne(tt)}).catch(()=>{pe||(Ne(null),ke(_("agentWorkspace.errors.loadGithubVersions")))}).finally(()=>{pe||fe(!1)}),()=>{pe=!0}},[L,xe==null?void 0:xe.currentVersion,xe==null?void 0:xe.runtimeId]),p.useEffect(()=>{let pe=!1;const Ue=(xe==null?void 0:xe.runtimeId)??"",tt=(xe==null?void 0:xe.region)??"cn-beijing",nt=`${tt}:${Ue}`;if(Ee(""),L!=="integrations"||!Ue){Z(!1),Ue||ne(null);return}Z(!0);const wn=Gx(Ue,tt,{retryProbe:!0}).catch(ut=>{if(ut instanceof po&&ut.unsupported)return null;throw ut});return Promise.all([wn,XCe(Ue,tt,{retryProbe:!0})]).then(([ut,Oi])=>{pe||ne({requestKey:nt,apiApps:ut,a2a:Oi})}).catch(()=>{pe||(ne(null),Ee(_("agentWorkspace.errors.probeIntegration")))}).finally(()=>{pe||Z(!1)}),()=>{pe=!0}},[Y,L,xe==null?void 0:xe.currentVersion,xe==null?void 0:xe.region,xe==null?void 0:xe.runtimeId]),p.useEffect(()=>{let pe=!1;const Ue=(xe==null?void 0:xe.runtimeId)??"",tt=(xe==null?void 0:xe.region)??"cn-beijing",nt=Ue&&Vi?zEe({runtimeId:Ue,region:tt,appName:Vi,pageSize:100}):null;if(Kn(nt?zse(nt,_):[]),xr((nt==null?void 0:nt.sets)??[]),tn(""),Cr((nt==null?void 0:nt.unsupportedMessage)??""),L!=="evaluations"||!Ue){He(!1);return}if(y&&!Vi){He(!Ot);return}return He(!nt),WI({runtimeId:Ue,region:tt,appName:Vi,pageSize:100},{force:!0}).then(wn=>{pe||(xr(wn.sets),Kn(zse(wn,_)),Cr(wn.unsupportedMessage??""))}).catch(()=>{pe||(tn(_("agentWorkspace.errors.loadEvaluations")),Cr(""))}).finally(()=>{pe||He(!1)}),()=>{pe=!0}},[Ot,y,ys,L,Vi,hi==null?void 0:hi.appName,xe==null?void 0:xe.region,xe==null?void 0:xe.runtimeId,_]);async function Or(pe){const Ue=(xe==null?void 0:xe.runtimeId)??"",tt=pe.commitSha??"";if(!(!Ue||!tt||qe)){it(tt),ke("");try{await RCe({runtimeId:Ue,targetCommitSha:tt});const nt=await B_(Ue);Ne(nt)}catch(nt){ke(nt instanceof Error?nt.message:_("agentWorkspace.errors.rollbackVersion"))}finally{it("")}}}p.useEffect(()=>{const pe=new Set(Cn.map(Ue=>Ue.id));Eo(Ue=>{const tt=new Set([...Ue].filter(nt=>pe.has(nt)));return tt.size===Ue.size?Ue:tt}),Un(Ue=>{const tt=new Set([...Ue].filter(nt=>pe.has(nt)));return tt.size===Ue.size?Ue:tt}),qs&&!pe.has(qs)&&Ar("")},[Cn,qs]),p.useEffect(()=>{wi(!1),Eo(new Set),Un(new Set),nr(""),Ar("")},[xe==null?void 0:xe.runtimeId]),p.useEffect(()=>{const pe=new Set(an.filter(Ue=>Ue.canDelete===!0).map(Ue=>Ue.id));Je(Ue=>{const tt=new Set([...Ue].filter(nt=>pe.has(nt)));return tt.size===Ue.size?Ue:tt})},[an]),p.useEffect(()=>{const pe=new Set(Is.map(Ue=>Ue.id));Bn(Ue=>{const tt=new Set([...Ue].filter(nt=>pe.has(nt)));return tt.size===Ue.size?Ue:tt})},[Is]);const Xr=p.useMemo(()=>!v||!(xe!=null&&xe.runtimeId)||v.runtimeId!==xe.runtimeId||Vi&&v.agentName&&v.agentName!==Vi?null:{...v,tag:_(v.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},[v,xe==null?void 0:xe.runtimeId,Vi,_]),bl=p.useMemo(()=>jqt(_),[_]),ro=p.useMemo(()=>xe!=null&&xe.runtimeId?Xr?[Xr,...Cn.filter(pe=>pe.id!==Xr.id&&(!pe.messageId||pe.messageId!==Xr.messageId))]:Cn:bl,[bl,Cn,Xr,xe==null?void 0:xe.runtimeId]),Nr=ro.filter(pe=>{if(pe.kind!==pt||(pe.source==="auto"?"auto":"user")!==qt)return!1;const tt=kt.trim().toLowerCase();return tt?[pe.input,pe.output,pe.referenceOutput,pe.comment,pe.tag??"",pe.sessionId,pe.messageId,pe.userId,pe.evaluationSetName].join(" ").toLowerCase().includes(tt):!0}),ws=Nr.filter(pe=>Xa.has(pe.id)),so=!!(xe!=null&&xe.runtimeId),Gd=pe=>{ot(pe),rt(""),nr("");const Ue=ro.find(tt=>tt.kind===pe);Ar((Ue==null?void 0:Ue.id)??""),window.setTimeout(()=>{var tt;(tt=_r.current)==null||tt.scrollIntoView({behavior:"smooth",block:"start"})},0)},Qg=pe=>{nr(""),Eo(Ue=>{const tt=new Set(Ue);return tt.has(pe.id)?tt.delete(pe.id):tt.add(pe.id),tt})},m0=()=>{nr(""),Eo(new Set(Nr.map(pe=>pe.id)))},g0=()=>{nr(""),Eo(new Set),wi(!1)},b0=pe=>{Un(Ue=>{const tt=new Set(Ue);return tt.has(pe)?tt.delete(pe):tt.add(pe),tt})},y0=pe=>{Ar(pe.id),nr(""),!(!pe.sessionId||!pe.messageId)&&(R==null||R(pe))},zg=async pe=>{if(!(xe!=null&&xe.runtimeId)||!Vi||js||pe.length===0)return;const Ue=pe.length===1?_("agentWorkspace.deleteOneCaseConfirm"):_("agentWorkspace.deleteCasesConfirm",{count:pe.length});if(!window.confirm(Ue))return;const tt=pe.map(wn=>wn.id),nt=new Set(tt);vc(!0),nr("");try{await qEe({runtimeId:xe.runtimeId,region:xe.region??"cn-beijing",appName:Vi,itemIds:tt});const wn=new Map;for(const ut of pe)wn.set(ut.kind,(wn.get(ut.kind)??0)+1);Kn(ut=>ut.filter(Oi=>!nt.has(Oi.id))),xr(ut=>ut.map(Oi=>({...Oi,itemCount:Math.max(0,Oi.itemCount-(wn.get(Oi.kind)??0))}))),Eo(ut=>new Set([...ut].filter(Oi=>!nt.has(Oi)))),Un(ut=>new Set([...ut].filter(Oi=>!nt.has(Oi)))),qs&&nt.has(qs)&&Ar(""),pe.length>1&&wi(!1),A==null||A(pe)}catch(wn){nr(wn instanceof Error?wn.message:String(wn))}finally{vc(!1)}},$i=pe=>{Ho(Ue=>Ue.map(tt=>tt.id===pe.id?pe:tt))},Oc=()=>{const pe=new Set(e.map(nt=>nt.id)),Ue=n.filter(nt=>pe.has(nt)),tt=new Set(Ue);return[...Ue,...e.filter(nt=>!tt.has(nt.id)).map(nt=>nt.id)]},Vg=(pe,Ue,tt)=>{if(!O||pe===Ue)return;const nt=Oc().filter(Oi=>Oi!==pe),wn=nt.indexOf(Ue),ut=wn<0?nt.length:tt==="after"?wn+1:wn;nt.splice(ut,0,pe),O(nt)},Jf=(pe,Ue)=>{if(!un||un===Ue)return;const tt=pe.currentTarget.getBoundingClientRect();St(Ue),zt(pe.clientY>tt.top+tt.height/2?"after":"before")},Pp=(pe,Ue)=>{if(!O)return;const tt=Oc(),nt=tt.indexOf(pe),wn=Math.max(0,Math.min(tt.length-1,nt+Ue));nt<0||nt===wn||(tt.splice(nt,1),tt.splice(wn,0,pe),O(tt))},Dp=pe=>{pe.canDelete===!0&&(ei(""),Je(Ue=>{const tt=new Set(Ue);return tt.has(pe.id)?tt.delete(pe.id):tt.add(pe.id),tt}))},eh=pe=>{ei(""),Bn(Ue=>{const tt=new Set(Ue);return tt.has(pe.id)?tt.delete(pe.id):tt.add(pe.id),tt})},Xd=()=>{ei(""),Je(new Set(nn.map(pe=>pe.id))),Bn(new Set(Is.map(pe=>pe.id)))},od=()=>{ei(""),Je(new Set),Bn(new Set),at(!1)},Hg=()=>{if(ss===0||Vt)return;const pe=yn.length,Ue=Dn.length;ei(""),Vn({kind:"selection",title:_(pe===1&&Ue===0?"agentWorkspace.deleteAgentTitle":pe===0&&Ue===1?"myAgents.deleteDraftTitle":"agentWorkspace.deleteSelectedTitle"),description:pe===1&&Ue===0?_("agentWorkspace.deleteAgentDescription",{name:yn[0].label}):pe===0&&Ue===1?_("agentWorkspace.deleteDraftDescription",{name:Dn[0].draft.name||_("agentSelector.unnamedAgent")}):_("agentWorkspace.deleteSelectionDescription",{count:ss,warning:pe>0?_("agentWorkspace.runtimeDeletionWarning",{count:pe}):_("agentWorkspace.draftDeletionWarning")}),confirmLabel:_(pe===0&&Ue===1?"myAgents.deleteDraft":"agentWorkspace.deleteSelected"),agents:yn,drafts:Dn})},qg=async()=>{if(!(!Sn||Vt)){Wn(!0),ei("");try{if(Sn.kind==="selection"){const{agents:pe,drafts:Ue}=Sn;if(pe.length>0){if(!S)throw new Error(_("agentWorkspace.errors.deleteDeployedUnsupported"));await S(pe)}Ue.length>0&&(k==null||k(Ue)),Je(new Set),Bn(new Set),at(!1),pe.some(tt=>tt.id===I)&&z(""),Ue.some(tt=>tt.id===K)&&F("")}else if(Sn.kind==="agent"){if(!S)throw new Error(_("agentWorkspace.errors.deleteDeployedUnsupported"));await S([Sn.agent]),I===Sn.agent.id&&z("")}else{if(!k)throw new Error(_("agentWorkspace.errors.deleteDraftUnsupported"));k([Sn.draft]),K===Sn.draft.id&&F("")}Vn(null)}catch(pe){ei(pe instanceof Error?pe.message:String(pe))}finally{Wn(!1)}}},Dt=pe=>{!S||pe.canDelete!==!0||Vt||(ei(""),Vn({kind:"agent",title:_("agentWorkspace.deleteAgentTitle"),description:_("agentWorkspace.deleteAgentDescription",{name:pe.label}),confirmLabel:_("agentWorkspace.deleteAgent"),agent:pe}))},Rr=pe=>{if(!k||Vt)return;const Ue=pe.draft.name||_("agentSelector.unnamedAgent");ei(""),Vn({kind:"draft",title:_("myAgents.deleteDraftTitle"),description:_("agentWorkspace.deleteDraftDescription",{name:Ue}),confirmLabel:_("myAgents.deleteDraft"),draft:pe})},ad=()=>{const pe=`eval-${Date.now()}`,Ue={id:pe,name:_("agentWorkspace.newEvaluationGroupName",{count:Vo.length+1}),agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};Ho(tt=>[Ue,...tt]),ml(pe)},v0=pe=>{$i({...pe,history:[{id:`run-${Date.now()}`,createdAt:_("agentWorkspace.evaluationDefaults.justNow"),score:86+pe.history.length%7,status:"completed"},...pe.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":_("agentWorkspace.workspace"),children:[o.jsx("button",{type:"button",className:M==="library"?"is-active":"","aria-pressed":M==="library",onClick:()=>{P("library"),Ge("")},children:_("agentWorkspace.library")}),o.jsx("button",{type:"button",className:M==="evaluation"?"is-active":"","aria-pressed":M==="evaluation",onClick:()=>{P("evaluation"),Ge("")},children:_("agentWorkspace.evaluation")})]}),o.jsxs("div",{className:"aw-workspace-frame",children:[o.jsxs("div",{className:"aw-workspace","aria-hidden":M==="evaluation"||void 0,ref:pe=>{pe==null||pe.toggleAttribute("inert",M==="evaluation")},children:[o.jsxs("aside",{className:"aw-sidebar","aria-label":_(M==="library"?"agentWorkspace.agentList":"agentWorkspace.evaluationGroupList"),children:[o.jsxs("label",{className:"aw-search",children:[o.jsx(PN,{"aria-hidden":!0}),o.jsx("input",{value:Le,onChange:pe=>Ge(pe.currentTarget.value),placeholder:_(M==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups"),"aria-label":_(M==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups")})]}),o.jsxs("button",{type:"button",className:"aw-create-card",onClick:M==="library"?j:ad,disabled:M==="library"&&!a,children:[o.jsx(jl,{"aria-hidden":!0}),o.jsx("span",{children:_(M==="library"?"agentWorkspace.newAgent":"agentWorkspace.newEvaluationGroup")})]}),M==="library"&&(S||k)&&o.jsx("div",{className:`aw-selection-toolbar${Be?" is-active":""}`,children:Be?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-selection-count",children:_("agentWorkspace.selectedCount",{count:ss})}),o.jsx("button",{type:"button",onClick:Xd,disabled:Zn===0||Vt,children:_("agentWorkspace.selectAll")}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void Hg(),disabled:ss===0||Vt,children:_(Vt?"common.deleting":"agentWorkspace.deleteSelected")}),o.jsx("button",{type:"button",onClick:od,disabled:Vt,children:_("common.cancel")})]}):o.jsx("button",{type:"button",onClick:()=>{ei(""),at(!0)},disabled:Zn===0,children:_("common.select")})}),M==="library"&&_n&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:_n}),o.jsx("div",{className:"aw-agent-list",children:M==="evaluation"?yu.length===0?o.jsx("div",{className:"aw-list-empty",children:_("agentWorkspace.noMatchingEvaluationGroups")}):yu.map(pe=>o.jsxs("button",{type:"button",className:`aw-agent-item${pe.id===bu?" is-active":""}`,onClick:()=>ml(pe.id),children:[o.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[o.jsx("strong",{children:mk(pe.name,_)}),o.jsx("small",{children:_("agentWorkspace.groupStats",{agents:pe.agentIds.length,runs:pe.history.length})})]}),o.jsx(qk,{"aria-hidden":!0})]},pe.id)):u&&an.length===0&&Is.length===0?o.jsx("div",{className:"aw-list-empty",children:_("agentWorkspace.loadingCloudAgents")}):d&&an.length===0&&Is.length===0?o.jsxs("div",{className:"aw-list-empty aw-list-error",children:[o.jsx("span",{children:d}),x&&o.jsx("button",{type:"button",onClick:x,children:_("common.retry")})]}):an.length===0&&Is.length===0?o.jsx("div",{className:"aw-list-empty",children:_("myAgents.noMatchingAgents")}):o.jsxs(o.Fragment,{children:[Is.map(pe=>{const tt=f.filter(wn=>wn.draftId===pe.id).sort((wn,ut)=>ut.startedAt-wn.startedAt)[0]??f.filter(wn=>{var ut,Oi;return((ut=wn.agentDraft)==null?void 0:ut.name)===pe.draft.name||wn.agentName===pe.draft.name||!!((Oi=pe.deploymentTarget)!=null&&Oi.runtimeId)&&wn.runtimeId===pe.deploymentTarget.runtimeId}).sort((wn,ut)=>ut.startedAt-wn.startedAt)[0],nt=yt.has(pe.id);return o.jsxs("button",{type:"button",className:["aw-agent-item",Be?"is-selecting":"",nt?"is-selected-for-delete":"",pe.id===K?"is-active":""].filter(Boolean).join(" "),"aria-pressed":Be?nt:void 0,onClick:()=>{if(Be){eh(pe);return}z(""),F(pe.id),B("basic")},children:[Be&&o.jsx("span",{className:`aw-select-marker${nt?" 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:pe.draft.name||_("agentSelector.unnamedAgent")}),o.jsx("span",{className:`aw-draft-badge${(tt==null?void 0:tt.status)==="running"?" is-deploying":""}`,children:(tt==null?void 0:tt.status)==="running"?_("myAgents.deploying"):_("myAgents.draft")})]}),o.jsx("small",{children:pe.deploymentTarget?_("agentWorkspace.updatePending"):_("agentWorkspace.notPublished")})]}),o.jsx(qk,{"aria-hidden":!0})]},pe.id)}),an.map(pe=>{const Ue=pe.runtimeId?gl.get(pe.runtimeId):void 0,tt=pe.runtimeId?Ca.get(pe.runtimeId):void 0,nt=On.has(pe.id),wn=pe.canDelete===!0,ut=(Ue==null?void 0:Ue.status)==="running"?{label:_("myAgents.deploying"),className:" is-deploying"}:(Ue==null?void 0:Ue.status)==="error"?{label:_("agentWorkspace.failed"),className:" is-error"}:(Ue==null?void 0:Ue.status)==="cancelled"?{label:_("agentWorkspace.cancelled"),className:" is-muted"}:tt?{label:_("agentWorkspace.updatePending"),className:""}:null,Oi=(Ue==null?void 0:Ue.status)==="running"?_("agentWorkspace.updatingDeployment"):tt?_("agentWorkspace.updatePending"):pe.remote?pe.host||_("agentWorkspace.remoteAgent"):_("agentWorkspace.localAgent"),oo=["aw-agent-item","aw-agent-item--sortable",pe.id===I?"is-active":"",Be?"is-selecting":"",nt?"is-selected-for-delete":"",Be&&!wn?"is-selection-disabled":"",pe.id===un?"is-dragging":"",pe.id===mt&&pe.id!==un?`is-drop-target is-drop-${on}`:""].filter(Boolean).join(" ");return o.jsxs("button",{type:"button",draggable:!!O&&!Be,className:oo,"aria-pressed":Be?nt:void 0,"aria-keyshortcuts":O?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:ki=>{O&&(Ns.current=!0,Xe(pe.id),ki.dataTransfer.effectAllowed="move",ki.dataTransfer.setData("text/plain",pe.id))},onDragEnter:ki=>{Jf(ki,pe.id)},onDragOver:ki=>{!un||un===pe.id||(ki.preventDefault(),ki.dataTransfer.dropEffect="move",Jf(ki,pe.id))},onDragLeave:ki=>{const Ws=ki.relatedTarget;Ws instanceof Node&&ki.currentTarget.contains(Ws)||mt===pe.id&&St("")},onDrop:ki=>{ki.preventDefault();const Ws=ki.dataTransfer.getData("text/plain")||un;Vg(Ws,pe.id,on),Xe(""),St(""),zt("before")},onDragEnd:()=>{Xe(""),St(""),zt("before"),window.setTimeout(()=>{Ns.current=!1},0)},onKeyDown:ki=>{ki.altKey&&(ki.key==="ArrowUp"?(ki.preventDefault(),Pp(pe.id,-1)):ki.key==="ArrowDown"&&(ki.preventDefault(),Pp(pe.id,1)))},onClick:ki=>{if(Be){ki.preventDefault(),Dp(pe);return}if(Ns.current){ki.preventDefault(),Ns.current=!1;return}F(""),z(pe.id),B("basic"),C(pe.id)},children:[Be&&o.jsx("span",{className:`aw-select-marker${nt?" 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:pe.label}),pe.currentVersion!=null&&o.jsxs("span",{className:"aw-version-badge",children:["v",pe.currentVersion]}),ut&&o.jsx("span",{className:`aw-draft-badge${ut.className}`,children:ut.label})]}),o.jsx("small",{children:Oi})]}),o.jsx(qk,{"aria-hidden":!0})]},pe.id)})]})}),o.jsx("div",{className:"aw-list-count",children:_("agentWorkspace.totalCount",{count:M==="library"?e.length+xc:Vo.length})})]}),M==="evaluation"&&xn?o.jsx(rWt,{group:xn,agents:e,cases:ro,onChange:$i,onRun:v0}):M==="evaluation"?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:_("agentWorkspace.noEvaluationGroupSelected")})}):!xe&&!fi&&!Li?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:_("agentWorkspace.noAgentSelected")})}):o.jsxs("main",{className:`aw-main${J?" is-deploying":""}${y?" resource-page":""}`,children:[xe&&!hi&&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:_("agentWorkspace.loadingAgent")}),o.jsx("small",{children:_("agentWorkspace.loadingAgentDescription")})]})]})}),L==="integrations"&&Q&&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:_("agentWorkspace.probingIntegration")}),o.jsx("small",{children:_("agentWorkspace.probingIntegrationDescription")})]})]})}),o.jsx(XC,{className:"aw-agent-detail",title:gn,description:mr.description||_(s||y&&!Ot?"agentWorkspace.loadingAgentInfo":"common.noDescription"),identitySeed:gn,backLabel:_("agentWorkspace.backToAgentList"),onBack:y?w:void 0,meta:o.jsxs(o.Fragment,{children:[$t!=null&&o.jsxs("span",{className:"aw-agent-meta",children:["v",$t]}),fi&&o.jsx("span",{className:"aw-agent-meta",children:_("myAgents.draft")}),zr&&o.jsx("span",{className:"aw-agent-meta",children:_("agentWorkspace.updatePending")}),!xe&&!fi&&Li&&o.jsx("span",{className:"aw-agent-meta",children:Li.label})]}),actionsClassName:"aw-head-actions",bodyClassName:"aw-agent-detail__body",actions:fi||zr||xe!=null&&xe.canDelete?o.jsxs(o.Fragment,{children:[(fi||zr)&&o.jsxs(It,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>{const pe=fi??zr;pe&&Rr(pe)},disabled:Vt,"aria-label":_("myAgents.deleteDraft"),title:_("myAgents.deleteDraft"),children:[o.jsx(ag,{"aria-hidden":!0}),o.jsx("span",{children:_("myAgents.deleteDraft")})]}),(xe==null?void 0:xe.canDelete)&&o.jsxs(It,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>void Dt(xe),disabled:Vt,"aria-label":_("agentWorkspace.deleteAgent"),title:_("agentWorkspace.deleteAgent"),children:[o.jsx(ag,{"aria-hidden":!0}),o.jsx("span",{children:_(Vt?"common.deleting":"agentWorkspace.deleteAgent")})]})]}):void 0,sections:Ta.map(pe=>{var Ue,tt,nt,wn;return{key:pe.id,label:pe.label,disabled:J,content:pe.id===L?o.jsxs(o.Fragment,{children:[ze&&ht&&o.jsx("div",{className:`aw-detail-deployment${J?" is-running":""}`,children:o.jsx(Jqt,{task:ze,onReturnToEdit:_e&&N?()=>N(_e):void 0})}),o.jsxs("div",{className:"aw-content",children:[L==="basic"&&o.jsxs("div",{className:"aw-basic-stack",children:[Me&&o.jsx(Ty,{className:"aw-detail-fetch-alert",color:"warning",variant:"soft",title:_("agentWorkspace.partialInfoUnavailable"),description:_("agentWorkspace.upgradeRuntimeForDetails")}),(ft&&!Me||jt)&&o.jsx(Ty,{className:"aw-detail-fetch-alert",color:"danger",variant:"soft",title:_("agentWorkspace.detailLoadFailed"),description:_("agentWorkspace.detailLoadFailedDescription"),actions:o.jsx(It,{type:"button",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:()=>We(ut=>ut+1),children:_("common.retry")})}),xe&&et&&!et.canUpdate&&o.jsxs("div",{className:"aw-update-recovery-notice",role:et.recoveryStatus==="preparing"?"status":"alert",children:[o.jsx("strong",{children:et.recoveryStatus==="preparing"?_("agentWorkspace.restoringUpdateConfig"):_("agentWorkspace.updateConfigUnavailable")}),Pt&&o.jsx("span",{children:Pt}),Tn.map(ut=>o.jsx("span",{children:ut},ut))]}),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:_("agentWorkspace.deploymentConfig")}),o.jsx("p",{children:_("agentWorkspace.deploymentConfigDescription")})]})}),o.jsxs("dl",{className:"aw-readonly-config",children:[o.jsxs("div",{children:[o.jsx("dt",{children:_("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)||_("agentWorkspace.loading")]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:_("agentWorkspace.deploymentRegion")}),o.jsx("dd",{children:(q==null?void 0:q.region)||(xe==null?void 0:xe.region)||(ze==null?void 0:ze.region)||_("agentWorkspace.notAvailable")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:_("agentWorkspace.networkAccess")}),o.jsx("dd",{children:q!=null&&q.networkTypes.length?q.networkTypes.join(" / "):_("agentWorkspace.notAvailable")})]})]})]}),o.jsxs("section",{className:"aw-canvas-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:_("agentWorkspace.executionFlow")})}),o.jsx("div",{className:"aw-canvas",children:o.jsx(gE,{draft:mr,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},ri)})]}),o.jsxs("section",{className:"aw-details-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:_("agentWorkspace.details")})}),o.jsxs("dl",{className:"aw-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:_("agentSelector.model")}),o.jsx("dd",{children:Iz(hi==null?void 0:hi.model)||mr.modelName||_("agentWorkspace.notAvailable")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:_("agentWorkspace.agentCountLabel")}),o.jsx("dd",{children:hi!=null&&hi.graph?mFe(hi.graph):gFe(mr)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:_("agentSelector.tools")}),o.jsx("dd",{className:"aw-fact-badges",children:vu.length?vu.map(ut=>o.jsx("span",{children:ut},ut)):_("agentWorkspace.none")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:_("agentSelector.skills")}),o.jsx("dd",{className:"aw-fact-badges",children:me===null?_("agentSelector.previewUnsupported"):me.length?me.map(ut=>o.jsx("span",{children:ut},ut)):_("agentWorkspace.none")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:_("systemInfo.currentVersion")}),o.jsx("dd",{children:$t!=null?`v${$t}`:_("agentWorkspace.notAvailable")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:_("agentSelector.status")}),o.jsx("dd",{children:fi?_("myAgents.draft"):(ze==null?void 0:ze.status)==="error"?_("agentWorkspace.deploymentFailed"):(ze==null?void 0:ze.status)==="cancelled"?_("agentWorkspace.cancelled"):zr?_("agentWorkspace.updatePending"):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-status-dot"}),_("skillCenter.status.available")]})})]})]})]}),o.jsxs("section",{className:"aw-sidecar-panel aw-settings-card","aria-label":_("agentWorkspace.selectedOptimizations"),children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:_("agentWorkspace.selectedOptimizations")}),o.jsx("p",{children:_("agentWorkspace.selectedOptimizationsDescription")})]})}),o.jsxs("dl",{className:"aw-readonly-config",children:[o.jsxs("div",{children:[o.jsx("dt",{children:_("agentWorkspace.configurationStatus")}),o.jsx("dd",{className:Ps!=null&&Ps.enabled?"is-ready":void 0,children:Ps?Ps.enabled?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-status-dot"}),_("skillCenter.status.enabled")]}):_("skillCenter.status.inactive"):_("agentWorkspace.notRecorded")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:_("agentWorkspace.optimizationProfile")}),o.jsx("dd",{children:Ps?Txt(Ps.profile):_("agentWorkspace.legacyConfigMissing")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:_("agentWorkspace.selectedOptimizations")}),o.jsx("dd",{className:"aw-fact-badges",children:Ps?tl.length?tl.map(ut=>o.jsx("span",{children:ij(ut)},ut)):_("agentWorkspace.noneSelected"):_("agentWorkspace.legacyConfigMissing")})]})]})]})]}),L==="usage"&&(xe==null?void 0:xe.runtimeId)&&o.jsxs("section",{className:"aw-usage","aria-busy":Hs,children:[o.jsx("div",{className:"aw-usage-intro",children:o.jsx("h3",{children:_("agentWorkspace.usageOverview")})}),Hs&&!xs&&o.jsx("div",{className:"aw-usage-state",role:"status","aria-live":"polite",children:o.jsx(mn,{as:"span",children:_("agentWorkspace.loadingUsage")})}),Ga&&o.jsxs("div",{className:"aw-usage-state is-error",role:"alert",children:[o.jsx("span",{children:Ga}),o.jsx("button",{type:"button",onClick:()=>Bl(ut=>ut+1),children:_("common.retry")})]}),!Hs&&!Ga&&!xs&&!Vi&&o.jsx("div",{className:"aw-usage-state",children:_("agentWorkspace.usageUnavailable")}),xs&&o.jsxs(o.Fragment,{children:[o.jsxs("dl",{className:"aw-usage-summary","aria-label":_("agentWorkspace.usageSummary"),children:[o.jsxs("div",{children:[o.jsx("dt",{children:_("agentWorkspace.totalCalls")}),o.jsx("dd",{children:xs.totalInvocations.toLocaleString(D.resolvedLanguage??D.language)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:_("agentWorkspace.userCount")}),o.jsx("dd",{children:xs.totalUsers.toLocaleString(D.resolvedLanguage??D.language)})]})]}),o.jsxs("div",{className:"aw-usage-users-head",children:[o.jsx("h3",{children:_("agentWorkspace.userDetails")}),Hs&&o.jsx(mn,{as:"span",role:"status","aria-live":"polite",children:_("agentWorkspace.refreshing")})]}),xs.users.length===0?o.jsx("div",{className:"aw-usage-state",children:_("agentWorkspace.noUsage")}):o.jsx("div",{className:"aw-usage-table-wrap",children:o.jsxs("table",{className:"aw-usage-table",children:[o.jsx("caption",{children:_("agentWorkspace.usageUserList")}),o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:_("agentWorkspace.user")}),o.jsx("th",{scope:"col",children:_("agentWorkspace.callCount")}),o.jsx("th",{scope:"col",children:_("agentWorkspace.lastUsed")})]})}),o.jsx("tbody",{children:xs.users.map(ut=>o.jsxs("tr",{children:[o.jsxs("td",{children:[o.jsx("strong",{children:ut.displayName||ut.userId||_("agentWorkspace.unknownUser")}),ut.displayName&&ut.userId&&o.jsx("small",{title:ut.userId,children:ut.userId})]}),o.jsx("td",{children:ut.invocationCount.toLocaleString(D.resolvedLanguage??D.language)}),o.jsx("td",{children:o.jsx("time",{dateTime:ut.lastUsedAt,children:Pqt(ut.lastUsedAt,D.resolvedLanguage??D.language,_)})})]},ut.userId))})]})}),xs.totalPages>1&&o.jsxs("nav",{className:"aw-usage-pagination","aria-label":_("agentWorkspace.usagePagination"),children:[o.jsx("button",{type:"button",disabled:Hs||xs.page<=1,onClick:()=>rs(ut=>Math.max(1,ut-1)),children:_("common.previousPage")}),o.jsx("span",{"aria-live":"polite",children:_("agentWorkspace.pageOf",{page:xs.page,total:xs.totalPages})}),o.jsx("button",{type:"button",disabled:Hs||xs.page>=xs.totalPages,onClick:()=>rs(ut=>ut+1),children:_("common.nextPage")})]})]})]}),L==="versions"&&o.jsxs("section",{className:"aw-version-stack",children:[o.jsxs("div",{className:"aw-integration-intro",children:[o.jsx("h3",{children:_("agentWorkspace.githubVersions")}),o.jsx("p",{children:(Ue=we==null?void 0:we.cicd)!=null&&Ue.enabled?_("agentWorkspace.githubVersionsDescription"):_("agentWorkspace.currentVersionOnly")})]}),ie&&o.jsx("div",{className:"aw-case-empty",children:_("agentWorkspace.loadingVersions")}),Se&&o.jsxs("div",{className:"aw-integration-error",role:"alert",children:[o.jsx("span",{children:Se}),(xe==null?void 0:xe.runtimeId)&&o.jsx("button",{type:"button",onClick:()=>void B_(xe.runtimeId??"").then(Ne),children:_("common.retry")})]}),!ie&&!Se&&o.jsxs("div",{className:"aw-version-list",children:[(we==null?void 0:we.githubSyncError)&&o.jsx("div",{className:"aw-integration-error",role:"alert",children:o.jsx("span",{children:we.githubSyncError})}),(we==null?void 0:we.latestSourceRuntimeStatus)&&we.latestSourceRuntimeStatus!=="published"&&((tt=we.versions[0])==null?void 0:tt.commitSha)&&we.versions[0].commitSha!==we.currentCommitSha&&o.jsx("div",{className:"aw-integration-notice",role:"status",children:o.jsxs("span",{children:[_("agentWorkspace.sourceMergedRuntimeStill"),Bse(we.latestSourceRuntimeStatus,_),_("agentWorkspace.currentProductionVersionHint")]})}),we!=null&&we.versions.length?we.versions.map(ut=>{var yl;const Oi=ut.commitSha??"",oo=ut.runtimeStatus??ut.status,ki=ut.changeType==="rollback",Ws=!!((yl=we.cicd)!=null&&yl.enabled)&&!!Oi&&!ki&&Oi!==we.currentCommitSha;return o.jsxs("article",{className:"aw-version-row",children:[o.jsxs("div",{children:[o.jsx("strong",{children:Mqt(ut,_)}),o.jsx("small",{children:ut.createdAt||_("agentWorkspace.noTime")})]}),o.jsxs("div",{children:[o.jsx("span",{children:_("agentWorkspace.prLink")}),ut.pullRequestUrl?o.jsx("a",{href:ut.pullRequestUrl,target:"_blank",rel:"noopener noreferrer",children:_("agentWorkspace.viewPr")}):o.jsx("em",{children:_("agentWorkspace.noPr")})]}),o.jsxs("div",{children:[o.jsx("span",{children:_("agentWorkspace.author")}),o.jsx("em",{children:ut.author||"Studio"})]}),o.jsxs("div",{children:[o.jsx("span",{children:_("agentWorkspace.publishStatus")}),o.jsx("em",{children:Bse(oo,_)})]}),o.jsxs("div",{className:"aw-version-actions",children:[o.jsx("button",{type:"button",disabled:!Ws||qe===Oi,onClick:()=>void Or(ut),children:_(qe===Oi?"agentWorkspace.rollingBack":"agentWorkspace.rollbackToVersion")}),ut.workflowRunUrl&&o.jsx("a",{href:ut.workflowRunUrl,target:"_blank",rel:"noopener noreferrer",children:_("agentWorkspace.viewRelease")})]})]},`${ut.version}-${Oi||ut.createdAt}`)}):o.jsxs("article",{className:"aw-version-row",children:[o.jsxs("div",{children:[o.jsx("strong",{children:$t!=null?`v${$t}`:_("agentWorkspace.noVersion")}),o.jsx("small",{children:(q==null?void 0:q.updatedAt)||_("agentWorkspace.noTime")})]}),o.jsx("p",{children:_("agentWorkspace.currentVersionOnly")})]})]})]}),L==="integrations"&&o.jsxs("div",{className:"aw-integration-stack",children:[o.jsxs("div",{className:"aw-integration-intro",children:[o.jsx("h3",{children:_("agentWorkspace.integrationMethods")}),o.jsx("p",{children:_("agentWorkspace.integrationDescription")})]}),ce&&o.jsxs("div",{className:"aw-integration-error",role:"alert",children:[o.jsx("span",{children:ce}),o.jsx("button",{type:"button",onClick:()=>G(ut=>ut+1),children:_("common.retry")})]}),!ce&&o.jsxs("div",{className:"aw-integration-body",children:[o.jsxs("div",{className:`aw-integration-protocol-tabs${te==="a2a"?" is-a2a":""}`,role:"tablist","aria-label":_("agentWorkspace.integrationProtocol"),children:[o.jsx("span",{className:"aw-integration-protocol-slider","aria-hidden":"true"}),jO.map((ut,Oi)=>o.jsx("button",{type:"button",id:`integration-${ut.id}-tab`,role:"tab","aria-selected":te===ut.id,"aria-controls":`integration-${ut.id}-panel`,tabIndex:te===ut.id?0:-1,onClick:()=>wr(ut.id),onKeyDown:oo=>{var yl;if(!["ArrowLeft","ArrowRight","Home","End"].includes(oo.key))return;oo.preventDefault();const ki=oo.key==="Home"?0:oo.key==="End"?jO.length-1:(Oi+(oo.key==="ArrowRight"?1:-1)+jO.length)%jO.length,Ws=jO[ki];wr(Ws.id),(yl=document.getElementById(`integration-${Ws.id}-tab`))==null||yl.focus()},children:ut.label},ut.id))]}),te==="api-server"?o.jsx(Qse,{protocol:"api-server",title:"API Server",available:qo,fields:[{label:"Agent",value:qo?((nt=pr==null?void 0:pr.apiApps)==null?void 0:nt.join("、"))??"":""},{label:_("agentWorkspace.discoveryEndpoint"),value:qo?w4(Pn,"/list-apps"):""},{label:_("agentWorkspace.invocationEndpoint"),value:qo?w4(Pn,"/run_sse"):""},{label:_("agentWorkspace.authentication"),value:qo?Fse(q==null?void 0:q.authType,_):""},{label:"API Key",value:o.jsx(Use,{available:qo,authType:q==null?void 0:q.authType,value:wc,visible:he&&!!wc,loading:Ae,error:ye,onToggle:()=>void jr()})}],example:qo?Lqt(Pn,ia,q==null?void 0:q.authType):""}):o.jsx(Qse,{protocol:"a2a",title:"A2A",available:Za,fields:[{label:"Agent",value:((wn=pr==null?void 0:pr.a2a)==null?void 0:wn.name)??""},{label:"Agent Card",value:Za?w4(Pn,"/.well-known/agent-card.json"):""},{label:_("agentWorkspace.invocationUrl"),value:Ja},{label:_("agentWorkspace.authentication"),value:Za?Fse(q==null?void 0:q.authType,_):""},{label:"API Key",value:o.jsx(Use,{available:Za,authType:q==null?void 0:q.authType,value:wc,visible:he&&!!wc,loading:Ae,error:ye,onToggle:()=>void jr()})}],example:Za?$qt(Ja,q==null?void 0:q.authType):""})]})]}),L==="evaluations"&&o.jsxs("section",{className:"aw-cases",children:[(xe==null?void 0:xe.runtimeId)&&o.jsx("div",{className:"aw-case-summary",children:["good","bad"].map(ut=>{const Oi=qqt(vr,ut),oo=ro.filter(Ws=>Ws.kind===ut).length,ki=Xr?oo:(Oi==null?void 0:Oi.itemCount)??oo;return o.jsxs("button",{type:"button",onClick:()=>Gd(ut),children:[o.jsx("strong",{children:ki}),o.jsx("span",{children:_(ut==="good"?"agentWorkspace.goodCases":"agentWorkspace.badCases")})]},ut)})}),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":_("agentWorkspace.caseResultFilter"),children:["good","bad"].map(ut=>o.jsx("button",{type:"button",className:pt===ut?"is-active":"","aria-pressed":pt===ut,onClick:()=>ot(ut),children:_(ut==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},ut))}),o.jsx("div",{className:"aw-case-source-filters","aria-label":_("agentWorkspace.feedbackSourceFilter"),children:["auto","user"].map(ut=>o.jsx("button",{type:"button",className:qt===ut?"is-active":"","aria-pressed":qt===ut,onClick:()=>cn(ut),children:_(ut==="auto"?"agentWorkspace.automaticFeedback":"agentWorkspace.manualFeedback")},ut))})]}),o.jsxs("label",{className:"aw-case-search",children:[o.jsx(PN,{"aria-hidden":!0}),o.jsx("input",{type:"search",value:kt,onChange:ut=>rt(ut.currentTarget.value),placeholder:_("agentWorkspace.searchCasesPlaceholder"),"aria-label":_("agentWorkspace.searchCases")})]})]}),so&&o.jsx("div",{className:`aw-case-toolbar${zo?" is-active":""}`,children:zo?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-selection-count",children:_("agentWorkspace.selectedCaseCount",{count:ws.length})}),o.jsx("button",{type:"button",onClick:m0,disabled:Nr.length===0||js,children:_("agentWorkspace.selectAllVisible")}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void zg(ws),disabled:ws.length===0||js,children:_(js?"common.deleting":"agentWorkspace.deleteSelected")}),o.jsx("button",{type:"button",onClick:g0,disabled:js,children:_("common.cancel")})]}):o.jsx("button",{type:"button",onClick:()=>{nr(""),wi(!0)},disabled:Nr.length===0||js,children:_("agentWorkspace.selectCases")})}),Sa&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:Sa}),o.jsx("div",{ref:_r,children:o.jsx(iWt,{cases:Nr,loading:er&&Nr.length===0,error:wt,notice:Gn,runtimeBacked:!!(xe!=null&&xe.runtimeId),selectionMode:zo,selectedCaseIds:Xa,focusedCaseId:qs,expandedCaseIds:Ya,deleting:js,canDelete:so,onOpenCase:y0,onToggleCase:Qg,onToggleExpanded:b0,onDeleteCase:ut=>void zg([ut]),onRetry:()=>is(ut=>ut+1)})})]}),L==="optimizations"&&o.jsxs("section",{className:"aw-optimizations",children:[o.jsxs("div",{className:"aw-optimization-intro",children:[o.jsx("h3",{children:_("agentWorkspace.optimizations")}),o.jsx("p",{children:_("agentWorkspace.optimizationsDescription")})]}),ii?o.jsxs("div",{className:"aw-optimization-state",role:"status",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsx("span",{children:_("agentWorkspace.loadingOptimizations")})]}):Gi?o.jsxs("div",{className:"aw-optimization-state is-error",role:"alert",children:[o.jsx("span",{children:Gi}),o.jsx("button",{type:"button",onClick:()=>Uo(ut=>ut+1),children:_("common.retry")})]}):Tr.length>0?o.jsx(tWt,{groups:Tr}):o.jsx("div",{className:"aw-optimization-state",children:_("agentWorkspace.noOptimizations")})]})]}),L==="basic"&&(xe||fi)&&o.jsxs("div",{className:"aw-basic-actions",children:[xe&&o.jsxs("button",{type:"button",className:"aw-talk studio-update-action",onClick:()=>E==null?void 0:E(xe),children:[o.jsx(srt,{"aria-hidden":!0}),o.jsx("span",{children:_("agentWorkspace.chat")})]}),o.jsxs("span",{className:`aw-update-wrap${sa?" is-disabled":""}`,tabIndex:sa?0:void 0,"aria-describedby":sa?oa:void 0,children:[o.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:!!sa,"aria-busy":Te||void 0,"aria-describedby":sa?oa:void 0,onClick:()=>fi?N==null?void 0:N(fi):et?T(et):void 0,children:Te?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"loading-gap-spinner aw-update-spinner","aria-hidden":"true"}),o.jsx("span",{children:_("agentWorkspace.preparing")})]}):_(fi||zr?"agentWorkspace.continueEditing":"agentWorkspace.update")}),sa&&o.jsx("span",{id:oa,className:"aw-update-disabled-reason",role:"tooltip",children:sa})]})]})]}):null}}),activeSectionKey:L,navigationLabel:_("agentWorkspace.agentDetails"),onSectionChange:B})]})]}),M==="evaluation"&&o.jsx("div",{className:"aw-evaluation-glass",role:"status",children:o.jsx("span",{children:_("agentWorkspace.comingSoon")})})]})]}),Sn&&o.jsx(Yu,{variant:"danger",title:Sn.title,description:Sn.description,confirmLabel:Vt?_("common.deleting"):Sn.confirmLabel,closeLabel:_("agentWorkspace.closeDeleteConfirmation"),busy:Vt,onCancel:()=>Vn(null),onConfirm:()=>void qg()})]})}function tWt({groups:e}){const{t}=je("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:zqt(n.priority,t)})}),o.jsx("td",{children:o.jsx("span",{className:"aw-optimization-module",children:Hqt(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 nWt(){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 iWt({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:m,onDeleteCase:g,onRetry:b}){const{t:v,i18n:y}=je("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(w=>{var A,j;const x=w.id.startsWith("local:"),O=(a==null?void 0:a.has(w.id))??!1,S=(c==null?void 0:c.has(w.id))??!1,C=w.output.length+w.referenceOutput.length>220||(((A=w.reason)==null?void 0:A.length)??0)>120,E=d&&!x,R=!!(w.comment&&w.comment.trim()!==((j=w.reason)==null?void 0:j.trim()));return o.jsxs("div",{className:["aw-case-row",l===w.id?"is-focused":"",s?"is-selecting":"",O?"is-selected-for-delete":""].filter(Boolean).join(" "),role:"row",tabIndex:0,"aria-selected":s?O:void 0,onClick:()=>{if(s){E&&(h==null||h(w));return}f==null||f(w)},onKeyDown:T=>{T.target===T.currentTarget&&(T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),s?E&&(h==null||h(w)):f==null||f(w)))},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&&E&&o.jsx("span",{className:`aw-select-marker${O?" is-checked":""}`,"aria-hidden":"true"}),o.jsx("strong",{title:w.input,children:w.input||v("agentWorkspace.noUserInput")})]}),R&&o.jsxs("small",{title:w.comment,children:[v("agentWorkspace.note"),w.comment]}),o.jsx("small",{className:"aw-case-time",children:Uqt(w.createdAt,y.resolvedLanguage??y.language,v)}),(w.userId||w.sessionId)&&o.jsx("small",{title:[w.userId,w.sessionId].filter(Boolean).join(" · "),children:[w.userId,w.sessionId].filter(Boolean).join(" · ")})]}),o.jsxs("div",{className:`aw-case-output aw-case-cell${S?" is-expanded":""}`,"data-label":v("agentWorkspace.agentOutput"),children:[o.jsx("p",{className:"aw-case-output-preview",title:w.output,children:w.output||v("agentWorkspace.noVisibleResponse")}),w.referenceOutput&&o.jsxs("small",{className:"aw-case-output-preview",title:w.referenceOutput,children:[v("agentWorkspace.reference"),": ",w.referenceOutput]}),C&&o.jsx("button",{type:"button",className:"aw-case-expand",onClick:T=>{T.stopPropagation(),m==null||m(w.id)},children:v(S?"common.collapse":"common.expand")})]}),o.jsx("div",{className:"aw-case-score aw-case-cell","data-label":v("agentWorkspace.score"),children:Qqt(w,v)}),o.jsx("div",{className:`aw-case-reason aw-case-cell${S?" is-expanded":""}`,"data-label":v("agentWorkspace.scoreReason"),children:o.jsx("p",{title:w.reason||void 0,children:w.reason||"—"})}),o.jsx("div",{className:"aw-case-actions aw-case-cell","data-label":v("skillCenter.actions"),children:E&&o.jsx("button",{type:"button",className:"aw-case-delete",onClick:T=>{T.stopPropagation(),g==null||g(w)},disabled:u,title:v("agentWorkspace.deleteFeedbackCase"),"aria-label":v("agentWorkspace.deleteFeedbackCase"),children:o.jsx(nWt,{})})})]},w.id)})]})}function rWt({group:e,agents:t,cases:n,onChange:i,onRun:r}){const{t:s}=je("ui"),[a,l]=p.useState("config"),c=e.agentIds.map(h=>t.find(m=>m.id===h)).filter(h=>!!h),u=["回答质量","事实准确性","工具调用","响应效率"];p.useEffect(()=>l("config"),[e.id]);const d=h=>{i({...e,agentIds:e.agentIds.includes(h)?e.agentIds.filter(m=>m!==h):[...e.agentIds,h]})},f=h=>{i({...e,metrics:e.metrics.includes(h)?e.metrics.filter(m=>m!==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:mk(e.name,s)}),o.jsx("span",{children:s("agentWorkspace.evaluationGroup")})]}),o.jsx("p",{children:s("agentWorkspace.evaluationGroupStats",{agents:c.length,caseSet:mk(e.caseSet,s),runs:e.history.length})})]}),o.jsxs("button",{type:"button",className:"aw-run",onClick:()=>r(e),disabled:!0,children:[o.jsx(Zit,{"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:mk(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,m)=>o.jsxs("button",{type:"button",children:[o.jsxs("span",{children:[o.jsx("strong",{children:s("agentWorkspace.evaluationRun",{index:e.history.length-m})}),o.jsx("small",{children:s("agentWorkspace.evaluationRunMeta",{time:mk(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(Bd,{}),s("agentWorkspace.completed")]}),o.jsx(qk,{"aria-hidden":!0})]},h.id))})]})})]})}async function dq(e,t={}){const n=await fetch(ta(`/web/agent-reviews${e}`),{...t,headers:Ll(pu({"Content-Type":"application/json"})),signal:Wa(t.signal??void 0,6e4)});if(!n.ok)throw new Error(await n.text());return n.json()}function sWt(e,t){return dq(`?${new URLSearchParams({region:e})}`,{signal:t})}function oWt(e,t,n){return dq(`/${encodeURIComponent(e)}?${new URLSearchParams({region:t})}`,{signal:n})}function aWt(e,t,n){return dq(`/${encodeURIComponent(e)}/${t}`,{method:"POST",body:JSON.stringify(n)})}const lWt=20,Vse=256;function O4({label:e,value:t,onChange:n,limit:i,disabled:r,required:s=!1}){const{t:a}=je("agentReviews");return o.jsxs("label",{children:[e,o.jsx("textarea",{"aria-label":e,value:t,onChange:l=>n(Array.from(l.target.value).slice(0,i).join("")),maxLength:i*2,disabled:r,required:s,rows:3}),o.jsx("span",{className:"agent-review-text-count",children:a("textCount",{count:Array.from(t).length,limit:i})})]})}function ZR({person:e}){return o.jsxs("span",{className:"agent-review-person",title:e.email||e.name,children:[e.avatarUrl?o.jsx("img",{src:e.avatarUrl,alt:"",referrerPolicy:"no-referrer",onError:t=>{t.currentTarget.hidden=!0}}):null,o.jsx("span",{children:e.name||e.id})]})}function xFe({runtimeId:e,region:t,name:n,canPublish:i,onClose:r,onChanged:s}){const{t:a,i18n:l}=je("agentReviews"),[c,u]=p.useState(null),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(""),[v,y]=p.useState(""),[w,x]=p.useState(""),[O,S]=p.useState(""),[k,C]=p.useState(0),[E,R]=p.useState(!1),[A,j]=p.useState(null);p.useEffect(()=>{const P=new AbortController;return f(!0),b(""),oWt(e,t,P.signal).then(L=>{P.signal.aborted||u(L.application)}).catch(L=>{P.signal.aborted||b(L instanceof Error?L.message:String(L))}).finally(()=>{P.signal.aborted||f(!1)}),()=>P.abort()},[e,t,k]);async function T(P,L){if(!h){m(!0),b("");try{const B=await aWt(e,P,{region:t,...P==="submit"?{message:v}:{},...P==="publish"||P==="decision"?{comment:w}:{},...P==="decision"?{applicationId:c==null?void 0:c.id,decision:L,reason:O}:{}});u(B),x(""),S(""),R(!1),j(null),s()}catch(B){b(B instanceof Error?B.message:String(B))}finally{m(!1)}}}const N=(c==null?void 0:c.status)==="pending",_=!!(c!=null&&c.published),D=!N&&!_,M=P=>new Date(P).toLocaleString(l.language);return o.jsx(k1,{open:!0,onOpenChange:P=>{!P&&!h&&r()},children:o.jsxs(O1,{children:[o.jsx(x1,{className:"agent-review-backdrop"}),o.jsxs(w1,{className:"agent-review-dialog",children:[o.jsxs("header",{className:"agent-review-dialog-header",children:[o.jsxs("div",{children:[o.jsx(S1,{children:n}),o.jsx(ET,{children:a("dialogDescription")})]}),o.jsx(KD,{className:"agent-review-close",disabled:h,"aria-label":a("close"),children:o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m6 6 12 12M6 18 18 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})})]}),o.jsxs("div",{className:"agent-review-dialog-body",children:[d?o.jsx(Ha,{}):null,g?o.jsxs("div",{className:"agent-review-error",role:"alert",children:[o.jsx("p",{children:g}),o.jsx("button",{type:"button",disabled:h||d,onClick:()=>C(P=>P+1),children:a("refresh")})]}):null,!d&&c?o.jsxs(o.Fragment,{children:[o.jsxs("dl",{className:"agent-review-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:a("statusTitle")}),o.jsxs("dd",{children:[a(`status.${c.status}`),c.status==="approved"&&!_?` · ${a("private")}`:""]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:a("submitter")}),o.jsx("dd",{children:o.jsx(ZR,{person:c.submitter})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:a("submittedAt")}),o.jsx("dd",{children:M(c.submittedAt)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:a("version")}),o.jsx("dd",{children:c.agent.version??"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:a("model")}),o.jsx("dd",{children:c.agent.model||"—"})]}),c.reviewer?o.jsxs("div",{children:[o.jsx("dt",{children:a(c.status==="returned"?"returnedBy":"approvedBy")}),o.jsx("dd",{children:o.jsx(ZR,{person:c.reviewer})})]}):null,c.reviewedAt?o.jsxs("div",{children:[o.jsx("dt",{children:a("reviewedAt")}),o.jsx("dd",{children:M(c.reviewedAt)})]}):null]}),o.jsxs("section",{children:[o.jsx("h3",{children:a("description")}),o.jsx("p",{children:c.agent.description||"—"})]}),c.message?o.jsxs("section",{children:[o.jsx("h3",{children:a("message")}),o.jsx("p",{children:c.message})]}):null,c.reason?o.jsxs("section",{children:[o.jsx("h3",{children:a("reason")}),o.jsx("p",{children:c.reason})]}):null,c.comment?o.jsxs("section",{children:[o.jsx("h3",{children:a("comment")}),o.jsx("p",{children:c.comment})]}):null,c.contentChanged?o.jsx("p",{role:"alert",className:"agent-review-warning",children:a("contentChanged")}):null]}):null,!d&&!g&&D&&!i?o.jsx(O4,{label:a("message"),value:v,onChange:y,limit:lWt,disabled:h}):null,!d&&!g&&i&&(N||D)?o.jsx(O4,{label:a("comment"),value:w,onChange:x,limit:Vse,disabled:h}):null,E?o.jsx(O4,{label:a("reasonRequired"),value:O,onChange:S,limit:Vse,disabled:h,required:!0}):null,A?o.jsx("p",{role:"status",children:a(`${A}Confirm`)}):null]}),o.jsxs("footer",{className:"agent-review-dialog-footer",children:[h?o.jsx("span",{role:"status",children:a("saving")}):null,!d&&(!g||c)?A?o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",disabled:h,onClick:()=>j(null),children:a("cancel")}),o.jsx("button",{type:"button",disabled:h,onClick:()=>void T(A),children:a("confirm")})]}):E?o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",disabled:h,onClick:()=>R(!1),children:a("cancel")}),o.jsx("button",{type:"button",disabled:h||!O.trim(),onClick:()=>void T("decision","returned"),children:a("return")})]}):o.jsxs(o.Fragment,{children:[_?o.jsx("button",{type:"button",disabled:h,onClick:()=>j("unpublish"),children:a("unpublish")}):null,N?o.jsx("button",{type:"button",disabled:h,onClick:()=>j("withdraw"),children:a("withdraw")}):null,N&&i?o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",disabled:h,onClick:()=>R(!0),children:a("return")}),o.jsx("button",{type:"button",className:"is-primary",disabled:h||(c==null?void 0:c.contentChanged),onClick:()=>void T("decision","approved"),children:a("approve")})]}):null,D?o.jsx("button",{type:"button",className:"is-primary",disabled:h,onClick:()=>void T(i?"publish":"submit"),children:a(i?"publish":"submit")}):null]}):null]})]})]})})}const cWt=5e3,uWt=4;let k4=0;const Hse=[];function qse(e){return e instanceof Error&&e.name==="AbortError"}function dWt(e){return e instanceof Error&&e.name==="TimeoutError"}function fWt(e){return dWt(e)||e instanceof LU&&[500,502,503,504].includes(e.status)}function hWt(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 pWt(e={},t={}){const n=t.request??zw,i=t.wait??hWt;try{return await n(e)}catch(r){if(!fWt(r))throw r;return await i(cWt,e.signal),n(e)}}async function wFe(e){var t;k4>=uWt&&await new Promise(n=>Hse.push(n)),k4+=1;try{return await e()}finally{k4-=1,(t=Hse.shift())==null||t()}}async function mWt(e,t){await Promise.allSettled(e.map(n=>wFe(()=>t(n))))}function Rb(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 Bh({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 gWt(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 bWt(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 yWt(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 vWt(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 JE({kind:e,...t}){return e==="codex"?o.jsx(gWt,{...t}):e==="deepseek-harness"?o.jsx(vWt,{...t}):e==="openclaw"?o.jsx(bWt,{...t}):o.jsx(yWt,{...t})}const xWt=["general","codex","deepseek-harness","openclaw","hermes"],wWt=24,OWt=3e4,kWt=7e3,SWt=2e4,EWt=6,CWt=2,TWt=250,Rm=new Map,Ax=new Map,AWt=new Set;function lb(e){const t=e.runtime;return t?`${t.region}:${t.runtimeId}:${t.currentVersion??""}`:""}function Wse(e,t){const n=e instanceof Error&&e.message.trim()?e.message.trim():t("myAgents.compatibility.unknownError");return{status:e instanceof po&&e.unsupported?"unsupported":"error",message:n}}function Eb(e){if(!e){Rm.clear(),Ax.clear(),tF();return}const t=new Set(e);if(t.size!==0){for(const[n,i]of Ax)i.page.runtimes.some(r=>t.has(r.runtimeId))&&Ax.delete(n);for(const n of t)tF(n);Rm.clear()}}function _Wt(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 jWt(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 NWt(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 RWt({type:e}){return e==="general"?o.jsx(Bh,{}):o.jsx(JE,{kind:e})}function IWt(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 Kse(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:CMe(e.author),isMine:e.isMine,runtime:{runtimeId:e.runtimeId,region:e.region,currentVersion:e.currentVersion,canDelete:e.canDelete,canManage:e.canManage,canPublish:e.canPublish,visibility:e.visibility,reviewStatus:e.reviewStatus}}}function PWt(e,t){const n=YI(e.status);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:CMe(e.createdBy),isMine:e.isMine,region:e.region,sandbox:e}}function DWt(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 MWt(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 LWt(e,t){return e.trim()||qi(t)}async function $Wt(e,t,n,i,r,s){const a=`${e}:${t}:${n}`,l=Ax.get(a);if(l&&l.expiresAt>Date.now())return i(l.page.runtimes.map(d=>Kse(d,r))),l.page.nextToken;l&&Ax.delete(a);let c=Rm.get(a);c||(c=pWt({scope:e,region:t,pageSize:wWt,nextToken:n,signal:s}),Rm.set(a,c),c.then(()=>Rm.delete(a),()=>Rm.delete(a)));const u=await c;return Ax.set(a,{page:u,expiresAt:Date.now()+OWt}),i(u.runtimes.map(d=>Kse(d,r))),u.nextToken}function FWt({agent:e,onReview:t,onUse:n,onViewDetails:i,onPrepareUpdate:r,compatibility:s,onRetryCompatibility:a,connecting:l,connectError:c,connected:u,deploymentTask:d,nowMs:f,onViewDeploymentTask:h,onEditDraft:m,onDeleteDraft:g}){var j,T,N,_;const{t:b,i18n:v}=je("ui"),y=(j=e.sandbox)==null?void 0:j.status.toLowerCase(),w=((T=e.sandbox)==null?void 0:T.resourceType)==="snapshot",x=!!(e.runtime||y==="ready"||y==="wakeable"),O=(s==null?void 0:s.status)==="checking",S=(s==null?void 0:s.status)==="unsupported",k=(s==null?void 0:s.status)==="error",C=((N=e.sandbox)==null?void 0:N.resourceType)==="snapshot"?e.sandbox.sourceSessionId||e.sandbox.snapshotId:(_=e.sandbox)==null?void 0:_.id,E=()=>{if(e.draft){d?h==null||h(d):i==null||i(e);return}!x&&!e.sandbox||(d?h==null||h(d):i==null||i(e))},R=(e.draft||x||!!e.sandbox)&&!!(d?h:i),A=e.draft?d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.viewRuntimeDetails",{name:e.name}):d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.viewDetails",{name:e.name});return o.jsxs(Uz,{className:`my-agent-card${l?" is-connecting":""}${e.runtime?" has-review":""}`,activateLabel:R?A:void 0,onActivate:R?E:void 0,onPointerEnter:()=>r==null?void 0:r(e),onFocusCapture:()=>r==null?void 0:r(e),footer:o.jsxs("div",{className:"my-agent-card-footer",children:[o.jsx(AIe,{className:"my-agent-meta",items:[{label:e.specificationLabel,value:e.specification,hideLabel:!0,className:"my-agent-region"},{label:b("myAgents.time"),value:GD(e.createdAt,f,v.resolvedLanguage??v.language),hideLabel:!0,className:"my-agent-created-at"},...e.sandbox?[{label:b("myAgents.remainingTime"),value:e.sandbox.resourceType==="snapshot"||e.sandbox.persistent?b("myAgents.neverExpires"):IWt(e.sandbox.expireAt,f,b),className:`my-agent-expiry${e.sandbox.resourceType==="snapshot"||e.sandbox.persistent?"":" is-expiring"}`}]:[]]}),e.runtime?o.jsxs("div",{className:"agent-review-card-controls",children:[o.jsx("span",{className:"agent-review-card-status",children:b(e.runtime.visibility==="enterprise"?"enterprise":"private",{ns:"agentReviews"})}),e.runtime.canManage?o.jsxs(sj,{className:"agent-review-card-action",onClick:D=>{D.stopPropagation(),t==null||t(e)},children:[b(e.runtime.reviewStatus?"details":e.runtime.canPublish?"publish":"submit",{ns:"agentReviews"}),e.runtime.reviewStatus?` · ${b(`status.${e.runtime.reviewStatus}`,{ns:"agentReviews"})}`:""]}):null]}):null]}),actions:e.draft?o.jsxs(o.Fragment,{children:[o.jsx(sj,{"aria-label":d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.editDraftNamed",{name:e.name}),onClick:()=>d?h==null?void 0:h(d):m==null?void 0:m(e.draft),children:b(d?"myAgents.viewProgress":"common.edit")}),o.jsx(sj,{tone:"danger","aria-label":b("myAgents.deleteDraftNamed",{name:e.name}),onClick:()=>g==null?void 0:g(e.draft),children:b("common.delete")})]}):k||S?o.jsxs(It,{type:"button",color:"primary",size:"sm",pill:!1,"aria-label":b("myAgents.recheckCompatibility",{name:e.name}),onClick:()=>a==null?void 0:a(e),children:[o.jsx(pP,{}),b("common.retry")]}):o.jsx(d8,{className:u?"my-agent-use is-connected":"my-agent-use",disabled:!x||O||S||l||u,"aria-busy":l||void 0,label:u?b("myAgents.connectedNamed",{name:e.name}):w?b("myAgents.wakeAndChat",{name:e.name}):b("myAgents.chatWith",{name:e.name}),onClick:()=>void(n==null?void 0:n(e)),children:l?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-use-spinner","aria-hidden":"true"}),o.jsx("span",{className:"sr-only",children:b(w?"myAgents.waking":"agentSelector.connecting")})]}):o.jsx(jWt,{})}),children:[o.jsx(Qz,{leading:o.jsx(uw,{seed:e.name}),title:e.name,subtitle:e.sandbox?o.jsx("span",{className:"my-agent-session-id",title:C,children:C}):void 0,status:e.draft?d?o.jsx("span",{className:"my-agent-deploying-badge",children:b("myAgents.deploying")}):o.jsx("span",{className:"my-agent-draft-badge",children:b("myAgents.draft")}):e.sandbox?o.jsx("span",{className:"my-agent-status-label","data-ready":YI(e.sandbox.status)==="ready"||void 0,children:e.description}):e.runtime&&d?o.jsx("span",{className:"my-agent-deploying-badge",children:b("myAgents.deploying")}):O?o.jsx(mo,{content:s==null?void 0:s.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(Lo,{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:b("myAgents.checking")})]})})}):S?o.jsx(mo,{content:s==null?void 0:s.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(Lo,{className:"my-agent-compatibility-status",color:"warning",variant:"soft",size:"sm",pill:!0,children:b("myAgents.chatUnsupported")})})}):k?o.jsx(mo,{content:s==null?void 0:s.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(Lo,{className:"my-agent-compatibility-status",color:"danger",variant:"soft",size:"sm",pill:!0,children:b("myAgents.checkFailed")})})}):null}),c?o.jsx(mo,{content:c,contentClassName:"my-agent-error-tooltip",maxWidth:360,interactive:!0,children:o.jsx("p",{className:"my-agent-wake-note",role:"alert",tabIndex:0,children:c})}):null,w&&l?o.jsx("p",{className:"my-agent-wake-note",role:"status",children:o.jsx(mn,{children:b("myAgents.wakingHint")})}):null,e.sandbox?null:o.jsx(zz,{children:e.description})]})}function BWt({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:m,onActiveTypeChange:g,sandboxRefreshKey:b=0,connectedRuntimeId:v="",hiddenRuntimeIds:y=AWt,drafts:w=[],deploymentTasks:x=[],draftDeploymentTaskIds:O={},onViewDeploymentTask:S,onEditDraft:k,onDeleteDraft:C}){const{t:E}=je("ui"),R=p.useRef(null),A=p.useRef(null),j=p.useRef(0),T=p.useRef(null),N=p.useRef(0),_=p.useRef(null),D=p.useRef(new Map),M=LWt(t,e),[P,L]=p.useState(null),[B,I]=p.useState(""),[z,K]=p.useState(s==="mine"?"mine":"all"),[F,q]=p.useState(M),[H,X]=p.useState([]),[ne,Q]=p.useState(""),[Z,ce]=p.useState(!0),[Ee,Y]=p.useState(""),[G,te]=p.useState([]),[ue,Ce]=p.useState(!1),[se,he]=p.useState(""),[ae,Ae]=p.useState(""),[De,ye]=p.useState({}),[Qe,we]=p.useState({}),[Ne,ie]=p.useState(null),[fe,Se]=p.useState(()=>Date.now()),ke=p.useMemo(()=>xWt.map(Le=>({value:Le,label:E(`myAgents.agentTypes.${Le}`)})),[E]),qe=p.useMemo(()=>{const Le=iu(e);return Le.some(Ge=>Ge.value===M)?Le:[{value:M,label:M},...Le]},[e,M]);p.useEffect(()=>{s==="mine"&&K("mine")},[s]),p.useEffect(()=>{q(M)},[M]),p.useEffect(()=>{Se(Date.now());const Le=window.setInterval(()=>Se(Date.now()),1e3);return()=>window.clearInterval(Le)},[]);const it=p.useMemo(()=>w.map(Le=>DWt(Le,E)),[w,E]),de=p.useMemo(()=>{const Le=new Map,Ge=new Map,pt=new Map;for(const ot of x){if(ot.status!=="running")continue;if(Le.set(ot.id,ot),ot.draftId){const rt=Ge.get(ot.draftId);(!rt||ot.startedAt>rt.startedAt)&&Ge.set(ot.draftId,ot)}if(!ot.runtimeId)continue;const kt=pt.get(ot.runtimeId);(!kt||ot.startedAt>kt.startedAt)&&pt.set(ot.runtimeId,ot)}return{byId:Le,byDraftId:Ge,byRuntimeId:pt}},[x]),ve=p.useCallback(Le=>{var pt;if(Le.draft){const ot=O[Le.draft.id];return de.byDraftId.get(Le.draft.id)??(ot?de.byId.get(ot):void 0)}const Ge=(pt=Le.runtime)==null?void 0:pt.runtimeId;return Ge?de.byRuntimeId.get(Ge):void 0},[de,O]),Te=p.useCallback((Le,Ge)=>{var kt;(kt=T.current)==null||kt.abort(),Rm.clear();const pt=new AbortController;T.current=pt;const ot=++j.current;return ce(!0),Y(""),$Wt(z,F,Le,rt=>{j.current===ot&&X(qt=>Ge?rt:[...qt,...rt])},E,pt.signal).then(rt=>{j.current===ot&&Q(rt)}).catch(rt=>{j.current===ot&&(qse(rt)||Y(Rb(rt,E("myAgents.loadGeneralAgents"),"GET /web/runtimes")))}).finally(()=>{j.current===ot&&ce(!1),T.current===pt&&(T.current=null)})},[z,F,E]);p.useEffect(()=>{if(m==="general")return X([]),Q(""),Te("",!0),()=>{var Le;(Le=T.current)==null||Le.abort(),T.current=null,Rm.clear(),j.current+=1}},[m,Te]),p.useEffect(()=>{if(m!=="general"){for(const pt of D.current.values())pt.abort();D.current.clear();return}const Le=new Set(H.filter(pt=>{var ot,kt;return((ot=pt.runtime)==null?void 0:ot.runtimeId)!==v&&((kt=pt.runtime)==null?void 0:kt.region)===F}).map(lb).filter(Boolean));for(const[pt,ot]of D.current)Le.has(pt)||(ot.abort(),D.current.delete(pt));const Ge=H.filter(pt=>{var qt,cn,un;const ot=(qt=pt.runtime)==null?void 0:qt.runtimeId;if(!ot||ot===v||((cn=pt.runtime)==null?void 0:cn.region)!==F)return!1;const kt=lb(pt),rt=(un=Qe[kt])==null?void 0:un.status;return!D.current.has(kt)&&(!rt||rt==="checking")});for(const pt of Ge)D.current.set(lb(pt),new AbortController);we(pt=>{var rt,qt;let ot=!1;const kt={...pt};for(const cn of H){const un=lb(cn);if(!un)continue;const Xe=((rt=cn.runtime)==null?void 0:rt.runtimeId)===v;Xe&&((qt=kt[un])==null?void 0:qt.status)!=="compatible"?(kt[un]={status:"compatible",message:E("myAgents.compatibility.supported")},ot=!0):!Xe&&!kt[un]&&(kt[un]={status:"checking",message:E("myAgents.compatibility.checking")},ot=!0)}return ot?kt:pt}),mWt(Ge,async pt=>{const ot=pt.runtime;if(!ot)return;const kt=lb(pt),rt=D.current.get(kt);if(rt)try{const qt=await Gx(ot.runtimeId,ot.region,{signal:rt.signal,preferCached:!0,timeoutMs:kWt,currentVersion:ot.currentVersion});if(rt.signal.aborted)return;we(cn=>({...cn,[kt]:qt&&qt.length>0?{status:"compatible",message:E("myAgents.compatibility.supported")}:{status:"unsupported",message:E("myAgents.compatibility.empty")}}))}catch(qt){if(rt.signal.aborted||(qt==null?void 0:qt.name)==="AbortError")return;we(cn=>({...cn,[kt]:Wse(qt,E)}))}finally{D.current.get(kt)===rt&&D.current.delete(kt)}})},[m,v,F,H,E]),p.useEffect(()=>()=>{var Le;(Le=T.current)==null||Le.abort();for(const Ge of D.current.values())Ge.abort();D.current.clear()},[]);const Ke=p.useCallback(async Le=>{var ot;(ot=_.current)==null||ot.abort();const Ge=new AbortController;_.current=Ge;const pt=++N.current;Ce(!0),he(""),te([]);try{const kt=Le==="codex"?await kr.listSessions({signal:Ge.signal,autoResumeSnapshots:!1}):await kr.listAgentSessions(Le,{signal:Ge.signal,autoResumeSnapshots:!1});if(N.current!==pt)return;te(kt.map(rt=>PWt(rt,E)))}catch(kt){if((kt==null?void 0:kt.name)==="AbortError"||N.current!==pt)return;he(Rb(kt,E("myAgents.loadAgentType",{type:E(`myAgents.agentTypes.${Le}`)}),`GET /web/${Le==="codex"?"sandbox":Le}/sessions`))}finally{_.current===Ge&&(_.current=null),N.current===pt&&Ce(!1)}},[E]);function $e(Le){var Ge;Le!==m&&(Le==="general"?(j.current+=1,X([]),Q(""),Y(""),ce(!0)):((Ge=_.current)==null||Ge.abort(),_.current=null,N.current+=1,te([]),he(""),Ce(!0)),g(Le))}function At(){m==="general"&&(j.current+=1,X([]),Q(""),Y(""),ce(!0))}function Nt(Le){Le!==z&&(At(),K(Le))}function vt(Le){Le!==F&&(At(),q(Le))}p.useEffect(()=>{var Le;if(m==="general"){(Le=_.current)==null||Le.abort(),_.current=null,N.current+=1;return}return Ke(m),()=>{var Ge;(Ge=_.current)==null||Ge.abort(),_.current=null,N.current+=1}},[m,Ke,b]),p.useEffect(()=>{const Le=A.current,Ge=R.current;if(!Le||!Ge||m!=="general"||!ne||Z)return;const pt=new IntersectionObserver(([ot])=>{ot.isIntersecting&&Te(ne,!1)},{root:Ge,rootMargin:"240px 0px",threshold:.01});return pt.observe(Le),()=>pt.disconnect()},[m,Te,Z,ne]);const Ot=p.useCallback(async Le=>{if(!ae){Ae(Le.id),ye(Ge=>({...Ge,[Le.id]:""}));try{await new Promise(Ge=>requestAnimationFrame(()=>Ge())),Le.sandbox?await f(Le.sandbox):await c(Le)}catch(Ge){ye(pt=>({...pt,[Le.id]:Ge instanceof Error?Ge.message:String(Ge)}))}finally{Ae("")}}},[ae,c,f]),Tt=p.useCallback(async Le=>{var kt;const Ge=Le.runtime;if(!Ge)return;const pt=lb(Le);we(rt=>({...rt,[pt]:{status:"checking",message:E("myAgents.compatibility.checking")}})),(kt=D.current.get(pt))==null||kt.abort();const ot=new AbortController;D.current.set(pt,ot);try{const rt=await wFe(()=>Gx(Ge.runtimeId,Ge.region,{retryProbe:!0,signal:ot.signal,timeoutMs:SWt,currentVersion:Ge.currentVersion}));if(ot.signal.aborted)return;we(qt=>({...qt,[pt]:rt&&rt.length>0?{status:"compatible",message:E("myAgents.compatibility.supported")}:{status:"unsupported",message:E("myAgents.compatibility.empty")}}))}catch(rt){if(ot.signal.aborted||qse(rt))return;we(qt=>({...qt,[pt]:Wse(rt,E)}))}finally{D.current.get(pt)===ot&&D.current.delete(pt)}},[E]),ft=p.useCallback(Le=>{const Ge=Le.runtime;!r||!Ge||ve(Le)||eF({runtimeId:Ge.runtimeId,region:Ge.region,appName:Le.appName,currentVersion:Ge.currentVersion})},[r,ve]),gt=p.useMemo(()=>{const Le=B.trim().toLocaleLowerCase(),Ge=m==="general"?[...it,...H]:G,ot=(z==="mine"?Ge.filter(cn=>cn.isMine):Ge).filter(cn=>{var Xe;const un=((Xe=cn.runtime)==null?void 0:Xe.region)??cn.region;return!un||un===F}),kt=Le?ot.filter(cn=>cn.name.toLocaleLowerCase().includes(Le)):ot;if(m!=="general")return kt;const rt=y.size>0?kt.filter(cn=>!cn.runtime||!y.has(cn.runtime.runtimeId)):kt,qt=rt.findIndex(cn=>{var un;return((un=cn.runtime)==null?void 0:un.runtimeId)===v});return qt<=0?rt:[rt[qt],...rt.slice(0,qt),...rt.slice(qt+1)]},[m,v,it,y,B,z,F,H,G]);p.useEffect(()=>{if(!r||m!=="general")return;const Le=gt.filter(rt=>!!rt.runtime).filter(rt=>!ve(rt)).slice(0,EWt);if(Le.length===0)return;let Ge=!1,pt=0;const ot=async()=>{for(;!Ge;){const rt=Le[pt];if(pt+=1,!(rt!=null&&rt.runtime)||(await eF({runtimeId:rt.runtime.runtimeId,region:rt.runtime.region,appName:rt.appName,currentVersion:rt.runtime.currentVersion}),Ge))return}},kt=window.setTimeout(()=>{for(let rt=0;rt{Ge=!0,window.clearTimeout(kt)}},[m,r,ve,gt]);const Me=E(`myAgents.agentTypes.${m}`,{defaultValue:E("myAgents.agent")}),bt=m==="general"?Z&&H.length===0&&it.length===0:ue&&G.length===0,jt=!bt&>.length===0,sn=(m==="general"?n:i)?m==="general"?()=>a(F):()=>d(m):void 0,We=m==="codex"&&i&&!!l;return o.jsxs(Ff,{className:"my-agents-page","aria-label":E("myAgents.agent"),children:[o.jsx(Jy,{title:E("myAgents.agent"),className:"my-agents-header"}),o.jsxs(e0,{className:"my-agent-toolbar",children:[o.jsx(t0,{idPrefix:"my-agent-ownership",ariaLabel:E("myAgents.creatorFilter"),value:z,items:[{id:"all",label:E("common.all"),disabled:s==="mine"},{id:"mine",label:E("agentSelector.createdByMe")}],onChange:Nt}),o.jsxs("div",{className:"resource-toolbar__actions",children:[o.jsx(fg,{id:"my-agent-type-filter",ariaLabel:E("myAgents.agentType"),value:m,options:ke,onChange:$e}),o.jsx(fg,{id:"my-agent-region-filter",ariaLabel:E("myAgents.region"),value:F,options:qe,onChange:vt}),o.jsx(hp,{className:"my-agent-search","aria-label":E("myAgents.searchAgents"),value:B,onChange:Le=>I(Le.target.value),placeholder:E("common.search")}),We?o.jsxs("button",{type:"button",className:"my-agent-create-secondary",onClick:l,children:[o.jsx(NWt,{}),o.jsx("span",{children:E("myAgents.handoff")})]}):null]})]}),o.jsxs(Pg,{className:"my-agent-results",ref:R,"aria-label":E("myAgents.agentList",{type:Me}),children:[bt?o.jsx(Ha,{}):(m==="general"?Ee:se)&>.length===0?o.jsxs("div",{className:"my-agent-empty",role:"alert",children:[o.jsx("p",{children:m==="general"?Ee:se}),o.jsx("button",{type:"button",onClick:()=>{m==="general"?Te("",!0):Ke(m)},children:E("common.reload")})]}):jt&&!sn?B.trim()||z==="mine"||F!==M?o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(Rn,{fill:"none",children:[o.jsx(Rn.Icon,{children:o.jsx(xit,{})}),o.jsx(Rn.Title,{children:E("myAgents.noMatchingAgents")}),o.jsx(Rn.Description,{children:E("myAgents.adjustSearch")})]})}):m!=="general"?o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(Rn,{fill:"none",children:[o.jsx(Rn.Icon,{children:o.jsx(RWt,{type:m})}),o.jsx(Rn.Title,{className:"my-agent-sandbox-empty-title",children:E("myAgents.noAgentType",{type:Me})})]})}):o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(Rn,{fill:"none",children:[o.jsx(Rn.Icon,{children:o.jsx(Bh,{})}),o.jsx(Rn.Title,{children:E("myAgents.noGeneralAgents")}),o.jsx(Rn.Description,{children:E("myAgents.createGeneralAgentDescription")})]})}):o.jsxs(o.Fragment,{children:[m==="general"&&Ee?o.jsxs("div",{className:"my-agent-inline-error",role:"alert",children:[o.jsx("span",{children:Ee}),o.jsx("button",{type:"button",onClick:()=>void Te("",!0),children:E("common.reload")})]}):null,o.jsxs(n0,{className:"my-agent-grid",children:[sn?o.jsx(hg,{className:"my-agent-create-card","aria-label":E("myAgents.createAgentType",{type:Me}),onClick:sn,icon:o.jsx(_Wt,{}),children:E("myAgents.createAgent")}):null,gt.map(Le=>{var pt,ot,kt,rt,qt;const Ge=MWt(Le,H,E);return o.jsx(FWt,{agent:Le,onReview:L,deploymentTask:ve(Le),nowMs:fe,onViewDeploymentTask:S,onUse:Ot,compatibility:Le.runtime?Qe[lb(Le)]??{status:"checking",message:E("myAgents.compatibility.checking")}:void 0,onRetryCompatibility:Tt,onPrepareUpdate:((pt=Le.runtime)==null?void 0:pt.canManage)===!1||((ot=Le.runtime)==null?void 0:ot.visibility)==="enterprise"||((kt=Le.runtime)==null?void 0:kt.reviewStatus)==="pending"?void 0:ft,onViewDetails:Ge&&((rt=Le.runtime)==null?void 0:rt.canManage)!==!1?()=>{Ge.sandbox?h(Ge.sandbox):u(Ge)}:void 0,connecting:Le.id===ae,connectError:De[Le.id],connected:((qt=Le.runtime)==null?void 0:qt.runtimeId)===v,onEditDraft:k,onDeleteDraft:ie},Le.id)})]})]}),m==="general"&&!Ee&&!bt&&(gt.length>0||!!ne)&&o.jsx("div",{className:"my-agent-load-more",ref:A,"aria-live":"polite",children:Z?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:E("myAgents.loadingMore")})]}):ne?o.jsx("span",{children:E("myAgents.scrollForMore")}):o.jsx("span",{children:E("myAgents.allLoaded")})})]}),P!=null&&P.runtime?o.jsx(xFe,{runtimeId:P.runtime.runtimeId,region:P.runtime.region,name:P.name,canPublish:P.runtime.canPublish===!0,onClose:()=>L(null),onChanged:()=>{Eb(),Te("",!0)}},`${P.runtime.region}:${P.runtime.runtimeId}`):null,Ne?o.jsx(Yu,{title:E("myAgents.deleteDraftTitle"),description:E("myAgents.deleteDraftDescription",{name:Ne.draft.name||E("agentSelector.unnamedAgent")}),confirmLabel:E("myAgents.deleteDraft"),variant:"danger",onCancel:()=>ie(null),onConfirm:()=>{C==null||C(Ne),ie(null)}}):null]})}function fq({section:e,onWorkspace:t,onEnvironment:n,onProjects:i,actions:r,children:s,className:a=""}){const{t:l}=je("ui"),c=l(e==="workspaces"?"workspace.title":e==="environments"?"common.environment":"workspace.codeProjects");return o.jsxs(Ff,{className:`workspace-center ${a}`,"aria-label":c,children:[o.jsx(Jy,{title:c}),o.jsxs(e0,{children:[(t||n)&&o.jsx(t0,{items:[{id:"workspaces",label:l("workspace.title")},{id:"environments",label:l("common.environment")},...i?[{id:"projects",label:l("workspace.codeProjects")}]:[]],value:e,onChange:u=>{u==="workspaces"&&(t==null||t()),u==="environments"&&(n==null||n()),u==="projects"&&(i==null||i())},ariaLabel:l("workspace.resourceType"),idPrefix:"workspace-center"}),o.jsx("div",{className:"resource-toolbar__actions",children:r})]}),s]})}const UWt="_Container_13560_1",QWt="_Textarea_13560_174",Gse={Container:UWt,Textarea:QWt},Sg=e=>{const t=p.useRef(null),i=`search-ui-input-${p.useId()}`,{id:r,name:s,variant:a="outline",size:l="md",gutterSize:c,className:u,autoComplete:d,disabled:f=!1,readOnly:h=!1,invalid:m=!1,allowAutofillExtensions:g=!!s,onFocus:b,onBlur:v,onAnimationStart:y,onAutofill:w,autoSelect:x,rows:O=3,maxRows:S,autoResize:k,ref:C,onChange:E,...R}=e,[A,j]=p.useState(!1),T=k?Math.max(S??10,O):O;p.useEffect(()=>{var D;x&&((D=t.current)==null||D.select())},[x]);const N=D=>{y==null||y(D),D.animationName==="native-autofill-in"&&(w==null||w())},_=p.useCallback(()=>{if(!k||!t.current||T===void 0)return;t.current.style.height="0px";const D=t.current.scrollHeight;t.current.style.height=D+"px"},[k,T]);return p.useEffect(()=>{_()},[e.value,O,_]),o.jsx("div",{className:Ti(Gse.Container,u),"data-variant":a,"data-size":l,"data-gutter-size":c,"data-focused":A,"data-disabled":f?"":void 0,"data-readonly":h?"":void 0,"data-invalid":m?"":void 0,style:Ky({"textarea-min-rows":`${O}`,"textarea-max-rows":`${T}`}),children:o.jsx("textarea",{...R,onChange:D=>{E==null||E(D),_()},ref:$C([t,C]),id:r||(g?void 0:i),className:Gse.Textarea,name:s,readOnly:h,disabled:f,rows:O,onFocus:D=>{j(!0),b==null||b(D)},onBlur:D=>{j(!1),v==null||v(D)},onAnimationStart:N,"data-lpignore":g?void 0:!0,"data-1p-ignore":g?void 0:!0})})},ZD="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",zWt="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",VWt="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",HWt="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",qWt="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",WWt="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",KWt="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",GWt="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",XWt="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",YWt="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 hq(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"})})}Qa.registerLanguage("bash",iD);const ZWt=48;function JWt(e,t=ZWt){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function eKt(e){return Qa.highlight(e,{language:"bash",ignoreIllegals:!0}).value}function tKt({status:e}){return e==="succeeded"?o.jsx(Bd,{"aria-hidden":!0}):e==="failed"?o.jsx(pF,{"aria-hidden":!0}):e==="running"?o.jsx(Mi,{className:"studio-build-progress__spinner","aria-hidden":!0}):o.jsx(zit,{"aria-hidden":!0})}function Xse(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 nKt({steps:e,log:t,logError:n="",logTruncated:i=!1,logUpdatedAt:r,loading:s=!1}){const{t:a,i18n:l}=je("ui"),c=p.useRef(null),u=p.useRef(!0),[d,f]=p.useState(!1),h=p.useMemo(()=>eKt(t),[t]);p.useEffect(()=>{const g=c.current;g&&t&&u.current&&(g.scrollTop=g.scrollHeight)},[t]);const m=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(tKt,{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"):"",Xse(r,l.resolvedLanguage??l.language)?` · ${Xse(r,l.resolvedLanguage??l.language)}`:""]})]}),o.jsxs(It,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:!t,onClick:()=>void m(),"aria-label":a(d?"studioBuildProgress.copiedLog":"studioBuildProgress.copyLog"),children:[d?o.jsx(Bd,{"aria-hidden":!0}):o.jsx(mP,{"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=JWt(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 Yse({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(kit,{}):o.jsx(Cit,{})})]})}function cb(e,t){return e[t]|e[t+1]<<8}function G0(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function iKt(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 OFe(e,t={}){let i=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(G0(e,u)===101010256){i=u;break}if(i<0)throw new Error(Wt("helpers.zip.invalid"));const r=cb(e,i+10);if(t.maxEntries!==void 0&&r>t.maxEntries)throw new Error(Wt("helpers.zip.tooManyFiles",{count:t.maxEntries}));let s=G0(e,i+16);const a=new TextDecoder("utf-8"),l=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error(Wt("helpers.zip.tooLarge"));const w=cb(e,v+26),x=cb(e,v+28),O=v+30+w+x,S=e.subarray(O,O+f);let k;if(d===0)k=S;else if(d===8)k=await iKt(S);else{s+=46+m+g+b;continue}l.push({name:y,text:a.decode(k)}),s+=46+m+g+b}return l}const i9=/(^|\/)skill\.md$/i;function rKt(e){const t=(e??"").replace(/\r\n?/g,` +`),w=(e==null?void 0:e.pendingMessage)||s;if(p.useEffect(()=>{e&&f(u)},[e==null?void 0:e.status,u]),p.useEffect(()=>{if(!d||!g)return;const E=c.current;E&&(E.scrollTop=E.scrollHeight)},[d,g,y]),!e||!e.text&&e.status!=="error"&&!e.pendingMessage)return null;const x=iWt(e.updatedAt,l.resolvedLanguage??l.language),O=e.status==="complete"?a("agentWorkspace.logStatus.synced"):e.status==="error"?a("agentWorkspace.logStatus.failed"):a("agentWorkspace.logStatus.syncing"),S=e.omittedEarly?a("agentWorkspace.logStatus.earlyOmitted"):e.snapshotTruncated?a("agentWorkspace.logStatus.recentOnly"):e.truncated?a("agentWorkspace.logStatus.partiallyOmitted"):"",k=[O,e.lineCount?a("agentWorkspace.logLines",{count:e.lineCount}):"",S,x].filter(Boolean).join(" · ");async function C(){try{await navigator.clipboard.writeText(b),m(!0),window.setTimeout(()=>m(!1),1500)}catch{m(!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:k})]}),o.jsxs("div",{className:"aw-deploy-log-actions",children:[g&&o.jsx("button",{type:"button",onClick:()=>f(E=>!E),children:a(d?"common.collapse":"common.expand")}),g&&o.jsxs("button",{type:"button",onClick:()=>void C(),"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(Ud,{"aria-hidden":!0}):o.jsx(gP,{"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:w}))]})}function rWt({task:e}){var n;const{t}=_e("ui");return o.jsx(CFe,{log:e.buildLog,autoExpand:((n=e.buildLog)==null?void 0:n.status)!=="complete"&&(e.status==="running"||e.status==="error")&&EFe(e,t)===1,title:t("agentWorkspace.buildLog"),ariaLabel:t("agentWorkspace.buildLog"),copyLabel:t("agentWorkspace.buildLog"),defaultPendingMessage:t("agentWorkspace.waitingBuildLog")})}function sWt({task:e}){var n;const{t}=_e("ui");return o.jsx(CFe,{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 oWt({task:e,onReturnToEdit:t}){const{t:n}=_e("ui"),i=SFe(e,n),r=EFe(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(V_,{}):e.status==="running"?o.jsx(Bi,{className:"spin"}):e.status==="success"?o.jsx(Git,{}):e.status==="error"?o.jsx(V_,{}):o.jsx(pF,{})}),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),[bt,zn]=p.useState(()=>new Set),[$t,Ni]=p.useState(!1),[Fn,Yn]=p.useState(""),[vn,si]=p.useState(null),[Bn,ni]=p.useState([]),[Ui,Ri]=p.useState([]),[Qi,Ve]=p.useState(!1),[St,Jt]=p.useState(""),[Vn,xr]=p.useState(""),[Ks,is]=p.useState(0),[Ur,Hn]=p.useState([]),[di,Cr]=p.useState(!1),[Qr,so]=p.useState(""),[Za,rs]=p.useState(0),[oe,sr]=p.useState(null),[To,oa]=p.useState(1),[Ps,Ao]=p.useState(!1),[ws,Oi]=p.useState(""),[Ii,gu]=p.useState(0),[ss,or]=p.useState(!1),[Aa,oo]=p.useState(()=>new Set),[Tr,Ql]=p.useState(!1),[Ja,ur]=p.useState(""),[Wo,zr]=p.useState(""),[aa,Pn]=p.useState(()=>new Set),os=p.useRef(!1),Os=p.useRef(""),as=p.useRef(null),Ds=p.useRef(0),Gr=p.useRef(0),vi=p.useRef(0),[_o,jo]=p.useState($qt),[ks,pl]=p.useState("");p.useEffect(()=>{e.length!==0&&jo(pe=>pe.map((Be,tt)=>tt===0&&Be.agentIds.length===0?{...Be,agentIds:e.slice(0,2).map(nt=>nt.id)}:Be))},[e]);const la=p.useMemo(()=>{const pe=new Map;for(const Be of e)Be.runtimeId&&pe.set(Be.runtimeId,Be);return pe},[e]),_a=p.useMemo(()=>{var Be;const pe=new Map;for(const tt of t){const nt=(Be=tt.deploymentTarget)==null?void 0:Be.runtimeId;if(!nt||!la.has(nt))continue;const Sn=pe.get(nt);(!Sn||tt.updatedAt>Sn.updatedAt)&&pe.set(nt,tt)}return pe},[la,t]),ml=p.useMemo(()=>{const pe=new Map;for(const Be of f){if(!Be.runtimeId)continue;const tt=pe.get(Be.runtimeId);(!tt||Be.startedAt>tt.startedAt)&&pe.set(Be.runtimeId,Be)}return pe},[f]),rd=p.useMemo(()=>{const pe=Ie.trim().toLowerCase();return pe?e.filter(Be=>{const tt=Be.runtimeId?_a.get(Be.runtimeId):void 0,nt=Be.runtimeId?ml.get(Be.runtimeId):void 0;return[Be.label,Be.app,Be.host??"",(tt==null?void 0:tt.draft.name)??"",(tt==null?void 0:tt.draft.description)??"",(nt==null?void 0:nt.runtimeName)??""].join(" ").toLowerCase().includes(pe)}):e},[e,ml,Ie,_a]),Gs=p.useMemo(()=>{const pe=Ie.trim().toLowerCase();return t.filter(Be=>{var nt;const tt=(nt=Be.deploymentTarget)==null?void 0:nt.runtimeId;return tt&&la.has(tt)?!1:pe?`${Be.draft.name} ${Be.draft.description}`.toLowerCase().includes(pe):!0})},[la,t,Ie]),sd=p.useMemo(()=>t.filter(pe=>{var tt;const Be=(tt=pe.deploymentTarget)==null?void 0:tt.runtimeId;return!Be||!la.has(Be)}).length,[la,t]),bu=p.useMemo(()=>{const pe=Ie.trim().toLowerCase();return pe?_o.filter(Be=>Be.name.toLowerCase().includes(pe)):_o},[_o,Ie]),Oe=e.find(pe=>pe.id===M),fi=t.find(pe=>pe.id===K),rr=h?f.find(pe=>pe.id===h):void 0,ja=Oe!=null&&Oe.runtimeId?_a.get(Oe.runtimeId):void 0,wi=y?Nt:M&&r===M?i:null,Ji=(wi==null?void 0:wi.appName)||(Oe==null?void 0:Oe.runtimeApp)||(Oe==null?void 0:Oe.app)||"",gl=(c&&(Oe!=null&&Oe.runtimeId)?$se:$se.filter(pe=>pe!=="usage")).map(pe=>({id:pe,label:_(`agentWorkspace.sections.${pe}`)})),ca=JSON.stringify([(Oe==null?void 0:Oe.runtimeId)??"",(Oe==null?void 0:Oe.region)??"cn-beijing",Ji,To]),Ss=(oe==null?void 0:oe.requestKey)===ca?oe.value:null,No=`${(Oe==null?void 0:Oe.region)??"cn-beijing"}:${(Oe==null?void 0:Oe.runtimeId)??""}`,Ms=(Ce==null?void 0:Ce.requestKey)===No?Ce.value:"",ar=(X==null?void 0:X.requestKey)===No?X:null,Ro=!!((oi=ar==null?void 0:ar.apiApps)!=null&&oi.length),bl=!!(ar!=null&&ar.a2a),Ko=((th=ar==null?void 0:ar.apiApps)==null?void 0:th[0])??Ji,Dn=(q==null?void 0:q.endpoint)??"",yl=Qqt(((I1=ar==null?void 0:ar.a2a)==null?void 0:I1.endpoint)??"",Dn),Na=(Oe==null?void 0:Oe.runtimeApp)||"",vl=JSON.stringify([(Oe==null?void 0:Oe.runtimeId)??"",(Oe==null?void 0:Oe.region)??"",(Oe==null?void 0:Oe.currentVersion)??null,Na]),Ne=l&&(Oe!=null&&Oe.runtimeId)&&Oe.region&&ln===0?J$({runtimeId:Oe.runtimeId,region:Oe.region,appName:Na,currentVersion:Oe.currentVersion}):null,Je=(he==null?void 0:he.requestKey)===vl?he.value:Ne,Pt=Je!=null&&Je.reason?ga(Je.reason,I.resolvedLanguage||I.language):"",An=(Je==null?void 0:Je.warnings.filter(pe=>ga(pe,I.resolvedLanguage||I.language)))??[];p.useEffect(()=>{const pe=Ds.current+1;Ds.current=pe,ye(null),At("");const Be=(Oe==null?void 0:Oe.runtimeId)??"",tt=(Oe==null?void 0:Oe.region)??"";if(!l||!Be||!tt){He(!1);return}const nt=ln===0?J$({runtimeId:Be,region:tt,appName:Na,currentVersion:Oe==null?void 0:Oe.currentVersion}):null;if(nt){ye({requestKey:vl,value:nt}),He(!1);return}const Sn=new AbortController;let ut,Ei=0;const uo=60;He(!0);const Ci=Xs=>{YI({runtimeId:Be,region:tt,appName:Na,currentVersion:Oe==null?void 0:Oe.currentVersion,signal:Sn.signal,force:Xs&&ln>0}).then(xl=>{var O0,IT;if(pe!==Ds.current)return;const Lp=xl.recoveryStatus==="preparing";if(xl.runtime.runtimeId!==Be||xl.runtime.region!==tt||!Lp&&Na&&((O0=xl.agent)==null?void 0:O0.appName)!==Na||xl.canUpdate&&!((IT=xl.agent)!=null&&IT.appName)){At(_("agentWorkspace.errors.updateCapabilityMismatch"));return}if(ye({requestKey:vl,value:xl}),He(!1),!!Lp){if(Ei+=1,Ei>=uo){At(_("agentWorkspace.errors.updateConfigRestoring"));return}ut=window.setTimeout(()=>Ci(!1),1e3)}}).catch(()=>{pe!==Ds.current||Sn.signal.aborted||At(_("agentWorkspace.errors.checkUpdateCapability"))}).finally(()=>{pe===Ds.current&&!Sn.signal.aborted&&He(!1)})};return Ci(!0),()=>{Sn.abort(),ut!=null&&window.clearTimeout(ut)}},[l,Na,ln,Oe==null?void 0:Oe.currentVersion,Oe==null?void 0:Oe.region,Oe==null?void 0:Oe.runtimeId,vl]);const cn=p.useMemo(()=>{const pe=new Map(e.map((tt,nt)=>[tt.id,nt])),Be=new Map(n.map((tt,nt)=>[tt,nt]));return[...rd].sort((tt,nt)=>{const Sn=tt.runtimeId?ml.get(tt.runtimeId):void 0,ut=nt.runtimeId?ml.get(nt.runtimeId):void 0,Ei=(Sn==null?void 0:Sn.status)==="running"?Sn.startedAt:0,uo=(ut==null?void 0:ut.status)==="running"?ut.startedAt:0;if(Ei!==uo)return uo-Ei;const Ci=Be.get(tt.id),Xs=Be.get(nt.id);return Ci!=null&&Xs!=null?Ci-Xs:Ci!=null?-1:Xs!=null?1:(pe.get(tt.id)??0)-(pe.get(nt.id)??0)})},[n,e,rd,ml]),yn=(Oe==null?void 0:Oe.label)||(wi==null?void 0:wi.name)||(fi==null?void 0:fi.draft.name)||(rr==null?void 0:rr.agentName)||((w0=rr==null?void 0:rr.agentDraft)==null?void 0:w0.name)||_("agentWorkspace.noAgentSelected"),On=_o.find(pe=>pe.id===ks),on=cn.filter(pe=>pe.canDelete===!0),xn=cn.filter(pe=>En.has(pe.id)&&pe.canDelete===!0),Mn=Gs.filter(pe=>bt.has(pe.id)),Zn=on.length+Gs.length,ls=xn.length+Mn.length,wr=p.useMemo(()=>{var Be;if(rr!=null&&rr.agentDraft)return rr.agentDraft;if(fi!=null&&fi.draft)return fi.draft;const pe=(Be=Oe==null?void 0:Oe.region)!=null&&Be.startsWith("ap-")?"byteplus":"volcengine";return Je!=null&&Je.agent&&(Je.recoveryStatus==="complete"||Je.recoveryStatus==="draft-only")?Pz(Je.agent,pe,Je.runtime.configuredEnvKeys):Wqt(wi,Ji||(Oe==null?void 0:Oe.label)||"agent",pe)},[wi,Ji,Oe==null?void 0:Oe.label,Oe==null?void 0:Oe.region,fi==null?void 0:fi.draft,rr==null?void 0:rr.agentDraft,Je]),Ls=((RT=wi==null?void 0:wi.draft)==null?void 0:RT.harnessSidecar)??Mxt(q==null?void 0:q.envs),el=Ls?t1.filter(pe=>Ls.componentOverrides[pe]):[],ua=fi?a?"":_("agentWorkspace.errors.noCreatePermission"):l?Oe!=null&&Oe.runtimeId?Oe.region?Ae?_("agentWorkspace.errors.checkingUpdateConfig"):De||(Je?Je.recoveryStatus!=="complete"&&Je.recoveryStatus!=="draft-only"?Pt||_("agentWorkspace.errors.originalConfigUnavailable"):Je.canUpdate?(vu=Je.agent)!=null&&vu.appName?"":_("agentWorkspace.errors.agentInfoMissing"):Pt||_("agentWorkspace.errors.updateUnsupported"):_("agentWorkspace.errors.updateCapabilityPending")):_("agentWorkspace.errors.runtimeRegionMissing"):_("agentWorkspace.errors.cloudOnlyUpdate"):_("agentWorkspace.errors.noManagePermission"),da="aw-update-disabled-reason",yu=p.useMemo(()=>{if(wi)return wi.tools;const pe=(wr.builtinTools??[]).map(Be=>{var tt;return((tt=e1.find(nt=>nt.id===Be))==null?void 0:tt.label)??Be});return Array.from(new Set([...wr.tools,...pe,...(wr.customTools??[]).map(Be=>Be.name),...(wr.mcpTools??[]).map(Be=>Be.name)].filter(Boolean)))},[wr,wi]),ki=p.useMemo(()=>wi?wi.skillsPreviewSupported?wi.skills.map(pe=>pe.name):null:Array.from(new Set([...(wr.selectedSkills??[]).map(pe=>pe.name),...wr.skills].filter(Boolean))),[wr,wi]),Si=p.useMemo(()=>{if(rr)return rr;if(fi){const pe=f.filter(Be=>Be.draftId===fi.id).sort((Be,tt)=>tt.startedAt-Be.startedAt)[0];return pe||f.filter(Be=>{var tt,nt;return((tt=Be.agentDraft)==null?void 0:tt.name)===fi.draft.name||Be.agentName===fi.draft.name||!!((nt=fi.deploymentTarget)!=null&&nt.runtimeId)&&Be.runtimeId===fi.deploymentTarget.runtimeId}).sort((Be,tt)=>tt.startedAt-Be.startedAt)[0]}if(Oe)return f.filter(pe=>!!Oe.runtimeId&&pe.runtimeId===Oe.runtimeId||pe.agentName===Oe.label).sort((pe,Be)=>Be.startedAt-pe.startedAt)[0]},[f,Oe,fi,rr]),Ct=!!(h&&Si&&Si.id===h),ii=!!(Si&&(Si.status!=="success"||Ct)),ee=(Si==null?void 0:Si.status)==="running",$e=Si!=null&&Si.draftId?t.find(pe=>pe.id===Si.draftId)??(Si.agentDraft?{id:Si.draftId,draft:Si.agentDraft,updatedAt:Si.startedAt}:void 0):void 0,ht=p.useMemo(()=>eWt(wr),[wr]),Qt=(Oe==null?void 0:Oe.currentVersion)??(q==null?void 0:q.currentVersion)??null,ie=Qt??(rr==null?void 0:rr.startedAt)??"unknown",Le=wi?`runtime:${(Oe==null?void 0:Oe.runtimeId)??wi.name}:v${ie}:${ht}`:`draft:${(rr==null?void 0:rr.id)??(fi==null?void 0:fi.id)??(Oe==null?void 0:Oe.id)??yn}:${ht}`;p.useEffect(()=>{L==="usage"&&!c&&B("basic")},[c,L]),p.useEffect(()=>{if(!h)return;const pe=f.find(tt=>tt.id===h),Be=pe!=null&&pe.runtimeId?la.get(pe.runtimeId):void 0;if(Be){F(""),H(Be.id),B("basic");return}H(""),F(""),B("basic")},[la,f,h]),p.useEffect(()=>{if(!m){Os.current="";return}const pe=`${m}:${g}:${b}:${c}`;Os.current!==pe&&e.some(Be=>Be.id===m)&&(Os.current=pe,F(""),H(m),B(g==="usage"&&!c?"basic":g),g==="evaluations"&&(it(b),ct("")))},[e,c,m,g,b]),p.useEffect(()=>{for(const pe of cn.slice(0,8)){if(!pe.runtimeId)continue;const Be=pe.region??"cn-beijing";lTe(pe.runtimeId,Be),oCe(pe.runtimeId,Be,pe.runtimeApp??"")}},[cn]),p.useEffect(()=>{let pe=!1;const Be=(Oe==null?void 0:Oe.runtimeId)??"",tt=(Oe==null?void 0:Oe.region)??"cn-beijing",nt=(Oe==null?void 0:Oe.runtimeApp)??"",Sn=Be?sCe(Be,tt,nt):null;if(Ot(Sn),pt(""),yt(!1),Tt(!!Sn||!y||!Be),!(!y||!Be))return NU(Be,tt,nt,{force:!0}).then(ut=>{pe||Ot(ut)}).catch(ut=>{!pe&&!Sn&&Ot(null),pe||(yt(ut instanceof bo&&ut.unsupported),pt(_("agentWorkspace.errors.loadAgentInfo")))}).finally(()=>{pe||Tt(!0)}),()=>{pe=!0}},[y,ln,Oe==null?void 0:Oe.currentVersion,Oe==null?void 0:Oe.region,Oe==null?void 0:Oe.runtimeApp,Oe==null?void 0:Oe.runtimeId]),p.useEffect(()=>{let pe=!1;const Be=(Oe==null?void 0:Oe.runtimeId)??"",tt=(Oe==null?void 0:Oe.region)??"cn-beijing";if(Hn([]),so(""),L!=="optimizations"||!Be){Cr(!1);return}if(y&&!Ji){Cr(!vt);return}return Cr(!0),GEe({runtimeId:Be,region:tt,appName:Ji}).then(nt=>{pe||Hn(nt.groups)}).catch(()=>{pe||so(_("agentWorkspace.errors.loadOptimizations"))}).finally(()=>{pe||Cr(!1)}),()=>{pe=!0}},[vt,y,Za,L,Ji,Oe==null?void 0:Oe.region,Oe==null?void 0:Oe.runtimeId]),p.useEffect(()=>{oa(1)},[Oe==null?void 0:Oe.runtimeId,Ji]),p.useEffect(()=>{const pe=vi.current+1;vi.current=pe;const Be=(Oe==null?void 0:Oe.runtimeId)??"",tt=(Oe==null?void 0:Oe.region)??"cn-beijing",nt=Ji;if(Oi(""),L!=="usage"||!Be){Ao(!1);return}if(!nt){Ao(y&&!vt);return}const Sn=new AbortController;return Ao(!0),KCe({runtimeId:Be,region:tt,appName:nt,page:To,pageSize:Bqt,signal:Sn.signal}).then(ut=>{if(pe===vi.current){if(ut.runtimeId!==Be||ut.appName!==nt||ut.page!==To){Oi(_("agentWorkspace.errors.usageMismatch"));return}sr({requestKey:ca,value:ut})}}).catch(()=>{pe!==vi.current||Sn.signal.aborted||Oi(_("agentWorkspace.errors.loadUsage"))}).finally(()=>{pe===vi.current&&Ao(!1)}),()=>{Sn.abort()}},[To,Ii,ca,vt,y,L,Ji,Oe==null?void 0:Oe.region,Oe==null?void 0:Oe.runtimeId]),p.useEffect(()=>{Gr.current+=1,le(null),ce(!1),Me(!1),Ue(""),de("api-server")},[No,L]);function ot(){Gr.current+=1,le(null),ce(!1),Me(!1),Ue("")}function at(pe){pe!==te&&(ot(),de(pe))}async function Ft(){if(fe){ot();return}const pe=(Oe==null?void 0:Oe.runtimeId)??"",Be=(Oe==null?void 0:Oe.region)??"cn-beijing";if(!pe)return;const tt=Gr.current+1;Gr.current=tt,Me(!0),Ue("");try{const nt=await rTe(pe,Be);if(tt!==Gr.current)return;le({requestKey:No,value:nt}),ce(!0)}catch(nt){if(tt!==Gr.current)return;le(null),ce(!1),Ue(nt instanceof Error?nt.message:_("agentWorkspace.errors.loadApiKey"))}finally{tt===Gr.current&&Me(!1)}}p.useEffect(()=>{let pe=!1;const Be=(Oe==null?void 0:Oe.runtimeId)??"",tt=(Oe==null?void 0:Oe.region)??"cn-beijing",nt=Be?aTe(Be,tt):null;if(Q(nt),qt(""),!!Be)return $U(Be,tt,{force:!0}).then(Sn=>{pe||Q(Sn)}).catch(()=>{!pe&&!nt&&Q(null),pe||qt(_("agentWorkspace.errors.loadRuntimeDetails"))}),()=>{pe=!0}},[ln,Oe==null?void 0:Oe.currentVersion,Oe==null?void 0:Oe.region,Oe==null?void 0:Oe.runtimeId]),p.useEffect(()=>{let pe=!1;const Be=(Oe==null?void 0:Oe.runtimeId)??"";if(xe(""),L!=="versions"||!Be){ve(!1),Be||je(null);return}return ve(!0),F_(Be).then(tt=>{pe||je(tt)}).catch(()=>{pe||(je(null),xe(_("agentWorkspace.errors.loadGithubVersions")))}).finally(()=>{pe||ve(!1)}),()=>{pe=!0}},[L,Oe==null?void 0:Oe.currentVersion,Oe==null?void 0:Oe.runtimeId]),p.useEffect(()=>{let pe=!1;const Be=(Oe==null?void 0:Oe.runtimeId)??"",tt=(Oe==null?void 0:Oe.region)??"cn-beijing",nt=`${tt}:${Be}`;if(Ee(""),L!=="integrations"||!Be){Y(!1),Be||ne(null);return}Y(!0);const Sn=Gx(Be,tt,{retryProbe:!0}).catch(ut=>{if(ut instanceof bo&&ut.unsupported)return null;throw ut});return Promise.all([Sn,iTe(Be,tt,{retryProbe:!0})]).then(([ut,Ei])=>{pe||ne({requestKey:nt,apiApps:ut,a2a:Ei})}).catch(()=>{pe||(ne(null),Ee(_("agentWorkspace.errors.probeIntegration")))}).finally(()=>{pe||Y(!1)}),()=>{pe=!0}},[Z,L,Oe==null?void 0:Oe.currentVersion,Oe==null?void 0:Oe.region,Oe==null?void 0:Oe.runtimeId]),p.useEffect(()=>{let pe=!1;const Be=(Oe==null?void 0:Oe.runtimeId)??"",tt=(Oe==null?void 0:Oe.region)??"cn-beijing",nt=Be&&Ji?XEe({runtimeId:Be,region:tt,appName:Ji,pageSize:100}):null;if(ni(nt?zse(nt,_):[]),Ri((nt==null?void 0:nt.sets)??[]),Jt(""),xr((nt==null?void 0:nt.unsupportedMessage)??""),L!=="evaluations"||!Be){Ve(!1);return}if(y&&!Ji){Ve(!vt);return}return Ve(!nt),KI({runtimeId:Be,region:tt,appName:Ji,pageSize:100},{force:!0}).then(Sn=>{pe||(Ri(Sn.sets),ni(zse(Sn,_)),xr(Sn.unsupportedMessage??""))}).catch(()=>{pe||(Jt(_("agentWorkspace.errors.loadEvaluations")),xr(""))}).finally(()=>{pe||Ve(!1)}),()=>{pe=!0}},[vt,y,Ks,L,Ji,wi==null?void 0:wi.appName,Oe==null?void 0:Oe.region,Oe==null?void 0:Oe.runtimeId,_]);async function kn(pe){const Be=(Oe==null?void 0:Oe.runtimeId)??"",tt=pe.commitSha??"";if(!(!Be||!tt||Ke)){Ze(tt),xe("");try{await FCe({runtimeId:Be,targetCommitSha:tt});const nt=await F_(Be);je(nt)}catch(nt){xe(nt instanceof Error?nt.message:_("agentWorkspace.errors.rollbackVersion"))}finally{Ze("")}}}p.useEffect(()=>{const pe=new Set(Bn.map(Be=>Be.id));oo(Be=>{const tt=new Set([...Be].filter(nt=>pe.has(nt)));return tt.size===Be.size?Be:tt}),Pn(Be=>{const tt=new Set([...Be].filter(nt=>pe.has(nt)));return tt.size===Be.size?Be:tt}),Wo&&!pe.has(Wo)&&zr("")},[Bn,Wo]),p.useEffect(()=>{or(!1),oo(new Set),Pn(new Set),ur(""),zr("")},[Oe==null?void 0:Oe.runtimeId]),p.useEffect(()=>{const pe=new Set(cn.filter(Be=>Be.canDelete===!0).map(Be=>Be.id));et(Be=>{const tt=new Set([...Be].filter(nt=>pe.has(nt)));return tt.size===Be.size?Be:tt})},[cn]),p.useEffect(()=>{const pe=new Set(Gs.map(Be=>Be.id));zn(Be=>{const tt=new Set([...Be].filter(nt=>pe.has(nt)));return tt.size===Be.size?Be:tt})},[Gs]);const Or=p.useMemo(()=>!v||!(Oe!=null&&Oe.runtimeId)||v.runtimeId!==Oe.runtimeId||Ji&&v.agentName&&v.agentName!==Ji?null:{...v,tag:_(v.kind==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},[v,Oe==null?void 0:Oe.runtimeId,Ji,_]),ao=p.useMemo(()=>Lqt(_),[_]),lo=p.useMemo(()=>Oe!=null&&Oe.runtimeId?Or?[Or,...Bn.filter(pe=>pe.id!==Or.id&&(!pe.messageId||pe.messageId!==Or.messageId))]:Bn:ao,[ao,Bn,Or,Oe==null?void 0:Oe.runtimeId]),Nr=lo.filter(pe=>{if(pe.kind!==gt||(pe.source==="auto"?"auto":"user")!==Kt)return!1;const tt=kt.trim().toLowerCase();return tt?[pe.input,pe.output,pe.referenceOutput,pe.comment,pe.tag??"",pe.sessionId,pe.messageId,pe.userId,pe.evaluationSetName].join(" ").toLowerCase().includes(tt):!0}),Es=Nr.filter(pe=>Aa.has(pe.id)),co=!!(Oe!=null&&Oe.runtimeId),Yd=pe=>{it(pe),ct(""),ur("");const Be=lo.find(tt=>tt.kind===pe);zr((Be==null?void 0:Be.id)??""),window.setTimeout(()=>{var tt;(tt=as.current)==null||tt.scrollIntoView({behavior:"smooth",block:"start"})},0)},zg=pe=>{ur(""),oo(Be=>{const tt=new Set(Be);return tt.has(pe.id)?tt.delete(pe.id):tt.add(pe.id),tt})},g0=()=>{ur(""),oo(new Set(Nr.map(pe=>pe.id)))},b0=()=>{ur(""),oo(new Set),or(!1)},y0=pe=>{Pn(Be=>{const tt=new Set(Be);return tt.has(pe)?tt.delete(pe):tt.add(pe),tt})},v0=pe=>{zr(pe.id),ur(""),!(!pe.sessionId||!pe.messageId)&&(R==null||R(pe))},Vg=async pe=>{if(!(Oe!=null&&Oe.runtimeId)||!Ji||Tr||pe.length===0)return;const Be=pe.length===1?_("agentWorkspace.deleteOneCaseConfirm"):_("agentWorkspace.deleteCasesConfirm",{count:pe.length});if(!window.confirm(Be))return;const tt=pe.map(Sn=>Sn.id),nt=new Set(tt);Ql(!0),ur("");try{await JEe({runtimeId:Oe.runtimeId,region:Oe.region??"cn-beijing",appName:Ji,itemIds:tt});const Sn=new Map;for(const ut of pe)Sn.set(ut.kind,(Sn.get(ut.kind)??0)+1);ni(ut=>ut.filter(Ei=>!nt.has(Ei.id))),Ri(ut=>ut.map(Ei=>({...Ei,itemCount:Math.max(0,Ei.itemCount-(Sn.get(Ei.kind)??0))}))),oo(ut=>new Set([...ut].filter(Ei=>!nt.has(Ei)))),Pn(ut=>new Set([...ut].filter(Ei=>!nt.has(Ei)))),Wo&&nt.has(Wo)&&zr(""),pe.length>1&&or(!1),A==null||A(pe)}catch(Sn){ur(Sn instanceof Error?Sn.message:String(Sn))}finally{Ql(!1)}},zi=pe=>{jo(Be=>Be.map(tt=>tt.id===pe.id?pe:tt))},xc=()=>{const pe=new Set(e.map(nt=>nt.id)),Be=n.filter(nt=>pe.has(nt)),tt=new Set(Be);return[...Be,...e.filter(nt=>!tt.has(nt.id)).map(nt=>nt.id)]},Hg=(pe,Be,tt)=>{if(!O||pe===Be)return;const nt=xc().filter(Ei=>Ei!==pe),Sn=nt.indexOf(Be),ut=Sn<0?nt.length:tt==="after"?Sn+1:Sn;nt.splice(ut,0,pe),O(nt)},Jf=(pe,Be)=>{if(!Xt||Xt===Be)return;const tt=pe.currentTarget.getBoundingClientRect();xt(Be),Vt(pe.clientY>tt.top+tt.height/2?"after":"before")},Dp=(pe,Be)=>{if(!O)return;const tt=xc(),nt=tt.indexOf(pe),Sn=Math.max(0,Math.min(tt.length-1,nt+Be));nt<0||nt===Sn||(tt.splice(nt,1),tt.splice(Sn,0,pe),O(tt))},Mp=pe=>{pe.canDelete===!0&&(Yn(""),et(Be=>{const tt=new Set(Be);return tt.has(pe.id)?tt.delete(pe.id):tt.add(pe.id),tt}))},eh=pe=>{Yn(""),zn(Be=>{const tt=new Set(Be);return tt.has(pe.id)?tt.delete(pe.id):tt.add(pe.id),tt})},Zd=()=>{Yn(""),et(new Set(on.map(pe=>pe.id))),zn(new Set(Gs.map(pe=>pe.id)))},od=()=>{Yn(""),et(new Set),zn(new Set),rt(!1)},qg=()=>{if(ls===0||$t)return;const pe=xn.length,Be=Mn.length;Yn(""),si({kind:"selection",title:_(pe===1&&Be===0?"agentWorkspace.deleteAgentTitle":pe===0&&Be===1?"myAgents.deleteDraftTitle":"agentWorkspace.deleteSelectedTitle"),description:pe===1&&Be===0?_("agentWorkspace.deleteAgentDescription",{name:xn[0].label}):pe===0&&Be===1?_("agentWorkspace.deleteDraftDescription",{name:Mn[0].draft.name||_("agentSelector.unnamedAgent")}):_("agentWorkspace.deleteSelectionDescription",{count:ls,warning:pe>0?_("agentWorkspace.runtimeDeletionWarning",{count:pe}):_("agentWorkspace.draftDeletionWarning")}),confirmLabel:_(pe===0&&Be===1?"myAgents.deleteDraft":"agentWorkspace.deleteSelected"),agents:xn,drafts:Mn})},Wg=async()=>{if(!(!vn||$t)){Ni(!0),Yn("");try{if(vn.kind==="selection"){const{agents:pe,drafts:Be}=vn;if(pe.length>0){if(!S)throw new Error(_("agentWorkspace.errors.deleteDeployedUnsupported"));await S(pe)}Be.length>0&&(k==null||k(Be)),et(new Set),zn(new Set),rt(!1),pe.some(tt=>tt.id===M)&&H(""),Be.some(tt=>tt.id===K)&&F("")}else if(vn.kind==="agent"){if(!S)throw new Error(_("agentWorkspace.errors.deleteDeployedUnsupported"));await S([vn.agent]),M===vn.agent.id&&H("")}else{if(!k)throw new Error(_("agentWorkspace.errors.deleteDraftUnsupported"));k([vn.draft]),K===vn.draft.id&&F("")}si(null)}catch(pe){Yn(pe instanceof Error?pe.message:String(pe))}finally{Ni(!1)}}},Dt=pe=>{!S||pe.canDelete!==!0||$t||(Yn(""),si({kind:"agent",title:_("agentWorkspace.deleteAgentTitle"),description:_("agentWorkspace.deleteAgentDescription",{name:pe.label}),confirmLabel:_("agentWorkspace.deleteAgent"),agent:pe}))},Rr=pe=>{if(!k||$t)return;const Be=pe.draft.name||_("agentSelector.unnamedAgent");Yn(""),si({kind:"draft",title:_("myAgents.deleteDraftTitle"),description:_("agentWorkspace.deleteDraftDescription",{name:Be}),confirmLabel:_("myAgents.deleteDraft"),draft:pe})},ad=()=>{const pe=`eval-${Date.now()}`,Be={id:pe,name:_("agentWorkspace.newEvaluationGroupName",{count:_o.length+1}),agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};jo(tt=>[Be,...tt]),pl(pe)},x0=pe=>{zi({...pe,history:[{id:`run-${Date.now()}`,createdAt:_("agentWorkspace.evaluationDefaults.justNow"),score:86+pe.history.length%7,status:"completed"},...pe.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":_("agentWorkspace.workspace"),children:[o.jsx("button",{type:"button",className:D==="library"?"is-active":"","aria-pressed":D==="library",onClick:()=>{P("library"),We("")},children:_("agentWorkspace.library")}),o.jsx("button",{type:"button",className:D==="evaluation"?"is-active":"","aria-pressed":D==="evaluation",onClick:()=>{P("evaluation"),We("")},children:_("agentWorkspace.evaluation")})]}),o.jsxs("div",{className:"aw-workspace-frame",children:[o.jsxs("div",{className:"aw-workspace","aria-hidden":D==="evaluation"||void 0,ref:pe=>{pe==null||pe.toggleAttribute("inert",D==="evaluation")},children:[o.jsxs("aside",{className:"aw-sidebar","aria-label":_(D==="library"?"agentWorkspace.agentList":"agentWorkspace.evaluationGroupList"),children:[o.jsxs("label",{className:"aw-search",children:[o.jsx(DN,{"aria-hidden":!0}),o.jsx("input",{value:Ie,onChange:pe=>We(pe.currentTarget.value),placeholder:_(D==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups"),"aria-label":_(D==="library"?"myAgents.searchAgents":"agentWorkspace.searchEvaluationGroups")})]}),o.jsxs("button",{type:"button",className:"aw-create-card",onClick:D==="library"?N:ad,disabled:D==="library"&&!a,children:[o.jsx(Rl,{"aria-hidden":!0}),o.jsx("span",{children:_(D==="library"?"agentWorkspace.newAgent":"agentWorkspace.newEvaluationGroup")})]}),D==="library"&&(S||k)&&o.jsx("div",{className:`aw-selection-toolbar${Qe?" is-active":""}`,children:Qe?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-selection-count",children:_("agentWorkspace.selectedCount",{count:ls})}),o.jsx("button",{type:"button",onClick:Zd,disabled:Zn===0||$t,children:_("agentWorkspace.selectAll")}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void qg(),disabled:ls===0||$t,children:_($t?"common.deleting":"agentWorkspace.deleteSelected")}),o.jsx("button",{type:"button",onClick:od,disabled:$t,children:_("common.cancel")})]}):o.jsx("button",{type:"button",onClick:()=>{Yn(""),rt(!0)},disabled:Zn===0,children:_("common.select")})}),D==="library"&&Fn&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:Fn}),o.jsx("div",{className:"aw-agent-list",children:D==="evaluation"?bu.length===0?o.jsx("div",{className:"aw-list-empty",children:_("agentWorkspace.noMatchingEvaluationGroups")}):bu.map(pe=>o.jsxs("button",{type:"button",className:`aw-agent-item${pe.id===ks?" is-active":""}`,onClick:()=>pl(pe.id),children:[o.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[o.jsx("strong",{children:gk(pe.name,_)}),o.jsx("small",{children:_("agentWorkspace.groupStats",{agents:pe.agentIds.length,runs:pe.history.length})})]}),o.jsx(qk,{"aria-hidden":!0})]},pe.id)):u&&cn.length===0&&Gs.length===0?o.jsx("div",{className:"aw-list-empty",children:_("agentWorkspace.loadingCloudAgents")}):d&&cn.length===0&&Gs.length===0?o.jsxs("div",{className:"aw-list-empty aw-list-error",children:[o.jsx("span",{children:d}),x&&o.jsx("button",{type:"button",onClick:x,children:_("common.retry")})]}):cn.length===0&&Gs.length===0?o.jsx("div",{className:"aw-list-empty",children:_("myAgents.noMatchingAgents")}):o.jsxs(o.Fragment,{children:[Gs.map(pe=>{const tt=f.filter(Sn=>Sn.draftId===pe.id).sort((Sn,ut)=>ut.startedAt-Sn.startedAt)[0]??f.filter(Sn=>{var ut,Ei;return((ut=Sn.agentDraft)==null?void 0:ut.name)===pe.draft.name||Sn.agentName===pe.draft.name||!!((Ei=pe.deploymentTarget)!=null&&Ei.runtimeId)&&Sn.runtimeId===pe.deploymentTarget.runtimeId}).sort((Sn,ut)=>ut.startedAt-Sn.startedAt)[0],nt=bt.has(pe.id);return o.jsxs("button",{type:"button",className:["aw-agent-item",Qe?"is-selecting":"",nt?"is-selected-for-delete":"",pe.id===K?"is-active":""].filter(Boolean).join(" "),"aria-pressed":Qe?nt:void 0,onClick:()=>{if(Qe){eh(pe);return}H(""),F(pe.id),B("basic")},children:[Qe&&o.jsx("span",{className:`aw-select-marker${nt?" 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:pe.draft.name||_("agentSelector.unnamedAgent")}),o.jsx("span",{className:`aw-draft-badge${(tt==null?void 0:tt.status)==="running"?" is-deploying":""}`,children:(tt==null?void 0:tt.status)==="running"?_("myAgents.deploying"):_("myAgents.draft")})]}),o.jsx("small",{children:pe.deploymentTarget?_("agentWorkspace.updatePending"):_("agentWorkspace.notPublished")})]}),o.jsx(qk,{"aria-hidden":!0})]},pe.id)}),cn.map(pe=>{const Be=pe.runtimeId?ml.get(pe.runtimeId):void 0,tt=pe.runtimeId?_a.get(pe.runtimeId):void 0,nt=En.has(pe.id),Sn=pe.canDelete===!0,ut=(Be==null?void 0:Be.status)==="running"?{label:_("myAgents.deploying"),className:" is-deploying"}:(Be==null?void 0:Be.status)==="error"?{label:_("agentWorkspace.failed"),className:" is-error"}:(Be==null?void 0:Be.status)==="cancelled"?{label:_("agentWorkspace.cancelled"),className:" is-muted"}:tt?{label:_("agentWorkspace.updatePending"),className:""}:null,Ei=(Be==null?void 0:Be.status)==="running"?_("agentWorkspace.updatingDeployment"):tt?_("agentWorkspace.updatePending"):pe.remote?pe.host||_("agentWorkspace.remoteAgent"):_("agentWorkspace.localAgent"),uo=["aw-agent-item","aw-agent-item--sortable",pe.id===M?"is-active":"",Qe?"is-selecting":"",nt?"is-selected-for-delete":"",Qe&&!Sn?"is-selection-disabled":"",pe.id===Xt?"is-dragging":"",pe.id===mt&&pe.id!==Xt?`is-drop-target is-drop-${hn}`:""].filter(Boolean).join(" ");return o.jsxs("button",{type:"button",draggable:!!O&&!Qe,className:uo,"aria-pressed":Qe?nt:void 0,"aria-keyshortcuts":O?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:Ci=>{O&&(os.current=!0,Ge(pe.id),Ci.dataTransfer.effectAllowed="move",Ci.dataTransfer.setData("text/plain",pe.id))},onDragEnter:Ci=>{Jf(Ci,pe.id)},onDragOver:Ci=>{!Xt||Xt===pe.id||(Ci.preventDefault(),Ci.dataTransfer.dropEffect="move",Jf(Ci,pe.id))},onDragLeave:Ci=>{const Xs=Ci.relatedTarget;Xs instanceof Node&&Ci.currentTarget.contains(Xs)||mt===pe.id&&xt("")},onDrop:Ci=>{Ci.preventDefault();const Xs=Ci.dataTransfer.getData("text/plain")||Xt;Hg(Xs,pe.id,hn),Ge(""),xt(""),Vt("before")},onDragEnd:()=>{Ge(""),xt(""),Vt("before"),window.setTimeout(()=>{os.current=!1},0)},onKeyDown:Ci=>{Ci.altKey&&(Ci.key==="ArrowUp"?(Ci.preventDefault(),Dp(pe.id,-1)):Ci.key==="ArrowDown"&&(Ci.preventDefault(),Dp(pe.id,1)))},onClick:Ci=>{if(Qe){Ci.preventDefault(),Mp(pe);return}if(os.current){Ci.preventDefault(),os.current=!1;return}F(""),H(pe.id),B("basic"),C(pe.id)},children:[Qe&&o.jsx("span",{className:`aw-select-marker${nt?" 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:pe.label}),pe.currentVersion!=null&&o.jsxs("span",{className:"aw-version-badge",children:["v",pe.currentVersion]}),ut&&o.jsx("span",{className:`aw-draft-badge${ut.className}`,children:ut.label})]}),o.jsx("small",{children:Ei})]}),o.jsx(qk,{"aria-hidden":!0})]},pe.id)})]})}),o.jsx("div",{className:"aw-list-count",children:_("agentWorkspace.totalCount",{count:D==="library"?e.length+sd:_o.length})})]}),D==="evaluation"&&On?o.jsx(dWt,{group:On,agents:e,cases:lo,onChange:zi,onRun:x0}):D==="evaluation"?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:_("agentWorkspace.noEvaluationGroupSelected")})}):!Oe&&!fi&&!rr?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:_("agentWorkspace.noAgentSelected")})}):o.jsxs("main",{className:`aw-main${ee?" is-deploying":""}${y?" resource-page":""}`,children:[Oe&&!wi&&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:_("agentWorkspace.loadingAgent")}),o.jsx("small",{children:_("agentWorkspace.loadingAgentDescription")})]})]})}),L==="integrations"&&z&&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:_("agentWorkspace.probingIntegration")}),o.jsx("small",{children:_("agentWorkspace.probingIntegrationDescription")})]})]})}),o.jsx(XC,{className:"aw-agent-detail",title:yn,description:wr.description||_(s||y&&!vt?"agentWorkspace.loadingAgentInfo":"common.noDescription"),identitySeed:yn,backLabel:_("agentWorkspace.backToAgentList"),onBack:y?w:void 0,meta:o.jsxs(o.Fragment,{children:[Qt!=null&&o.jsxs("span",{className:"aw-agent-meta",children:["v",Qt]}),fi&&o.jsx("span",{className:"aw-agent-meta",children:_("myAgents.draft")}),ja&&o.jsx("span",{className:"aw-agent-meta",children:_("agentWorkspace.updatePending")}),!Oe&&!fi&&rr&&o.jsx("span",{className:"aw-agent-meta",children:rr.label})]}),actionsClassName:"aw-head-actions",bodyClassName:"aw-agent-detail__body",actions:fi||ja||Oe!=null&&Oe.canDelete?o.jsxs(o.Fragment,{children:[(fi||ja)&&o.jsxs(It,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>{const pe=fi??ja;pe&&Rr(pe)},disabled:$t,"aria-label":_("myAgents.deleteDraft"),title:_("myAgents.deleteDraft"),children:[o.jsx(lg,{"aria-hidden":!0}),o.jsx("span",{children:_("myAgents.deleteDraft")})]}),(Oe==null?void 0:Oe.canDelete)&&o.jsxs(It,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>void Dt(Oe),disabled:$t,"aria-label":_("agentWorkspace.deleteAgent"),title:_("agentWorkspace.deleteAgent"),children:[o.jsx(lg,{"aria-hidden":!0}),o.jsx("span",{children:_($t?"common.deleting":"agentWorkspace.deleteAgent")})]})]}):void 0,sections:gl.map(pe=>{var Be,tt,nt,Sn;return{key:pe.id,label:pe.label,disabled:ee,content:pe.id===L?o.jsxs(o.Fragment,{children:[Si&&ii&&o.jsx("div",{className:`aw-detail-deployment${ee?" is-running":""}`,children:o.jsx(oWt,{task:Si,onReturnToEdit:$e&&j?()=>j($e):void 0})}),o.jsxs("div",{className:"aw-content",children:[L==="basic"&&o.jsxs("div",{className:"aw-basic-stack",children:[Pe&&o.jsx(Ay,{className:"aw-detail-fetch-alert",color:"warning",variant:"soft",title:_("agentWorkspace.partialInfoUnavailable"),description:_("agentWorkspace.upgradeRuntimeForDetails")}),(ft&&!Pe||jt)&&o.jsx(Ay,{className:"aw-detail-fetch-alert",color:"danger",variant:"soft",title:_("agentWorkspace.detailLoadFailed"),description:_("agentWorkspace.detailLoadFailedDescription"),actions:o.jsx(It,{type:"button",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:()=>qe(ut=>ut+1),children:_("common.retry")})}),Oe&&Je&&!Je.canUpdate&&o.jsxs("div",{className:"aw-update-recovery-notice",role:Je.recoveryStatus==="preparing"?"status":"alert",children:[o.jsx("strong",{children:Je.recoveryStatus==="preparing"?_("agentWorkspace.restoringUpdateConfig"):_("agentWorkspace.updateConfigUnavailable")}),Pt&&o.jsx("span",{children:Pt}),An.map(ut=>o.jsx("span",{children:ut},ut))]}),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:_("agentWorkspace.deploymentConfig")}),o.jsx("p",{children:_("agentWorkspace.deploymentConfigDescription")})]})}),o.jsxs("dl",{className:"aw-readonly-config",children:[o.jsxs("div",{children:[o.jsx("dt",{children:_("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)||_("agentWorkspace.loading")]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:_("agentWorkspace.deploymentRegion")}),o.jsx("dd",{children:(q==null?void 0:q.region)||(Oe==null?void 0:Oe.region)||(Si==null?void 0:Si.region)||_("agentWorkspace.notAvailable")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:_("agentWorkspace.networkAccess")}),o.jsx("dd",{children:q!=null&&q.networkTypes.length?q.networkTypes.join(" / "):_("agentWorkspace.notAvailable")})]})]})]}),o.jsxs("section",{className:"aw-canvas-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:_("agentWorkspace.executionFlow")})}),o.jsx("div",{className:"aw-canvas",children:o.jsx(gE,{draft:wr,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},Le)})]}),o.jsxs("section",{className:"aw-details-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:_("agentWorkspace.details")})}),o.jsxs("dl",{className:"aw-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:_("agentSelector.model")}),o.jsx("dd",{children:Iz(wi==null?void 0:wi.model)||wr.modelName||_("agentWorkspace.notAvailable")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:_("agentWorkspace.agentCountLabel")}),o.jsx("dd",{children:wi!=null&&wi.graph?OFe(wi.graph):kFe(wr)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:_("agentSelector.tools")}),o.jsx("dd",{className:"aw-fact-badges",children:yu.length?yu.map(ut=>o.jsx("span",{children:ut},ut)):_("agentWorkspace.none")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:_("agentSelector.skills")}),o.jsx("dd",{className:"aw-fact-badges",children:ki===null?_("agentSelector.previewUnsupported"):ki.length?ki.map(ut=>o.jsx("span",{children:ut},ut)):_("agentWorkspace.none")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:_("systemInfo.currentVersion")}),o.jsx("dd",{children:Qt!=null?`v${Qt}`:_("agentWorkspace.notAvailable")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:_("agentSelector.status")}),o.jsx("dd",{children:fi?_("myAgents.draft"):(Si==null?void 0:Si.status)==="error"?_("agentWorkspace.deploymentFailed"):(Si==null?void 0:Si.status)==="cancelled"?_("agentWorkspace.cancelled"):ja?_("agentWorkspace.updatePending"):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-status-dot"}),_("skillCenter.status.available")]})})]})]})]}),o.jsxs("section",{className:"aw-sidecar-panel aw-settings-card","aria-label":_("agentWorkspace.selectedOptimizations"),children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:_("agentWorkspace.selectedOptimizations")}),o.jsx("p",{children:_("agentWorkspace.selectedOptimizationsDescription")})]})}),o.jsxs("dl",{className:"aw-readonly-config",children:[o.jsxs("div",{children:[o.jsx("dt",{children:_("agentWorkspace.configurationStatus")}),o.jsx("dd",{className:Ls!=null&&Ls.enabled?"is-ready":void 0,children:Ls?Ls.enabled?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-status-dot"}),_("skillCenter.status.enabled")]}):_("skillCenter.status.inactive"):_("agentWorkspace.notRecorded")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:_("agentWorkspace.optimizationProfile")}),o.jsx("dd",{children:Ls?Pxt(Ls.profile):_("agentWorkspace.legacyConfigMissing")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:_("agentWorkspace.selectedOptimizations")}),o.jsx("dd",{className:"aw-fact-badges",children:Ls?el.length?el.map(ut=>o.jsx("span",{children:nj(ut)},ut)):_("agentWorkspace.noneSelected"):_("agentWorkspace.legacyConfigMissing")})]})]})]})]}),L==="usage"&&(Oe==null?void 0:Oe.runtimeId)&&o.jsxs("section",{className:"aw-usage","aria-busy":Ps,children:[o.jsx("div",{className:"aw-usage-intro",children:o.jsx("h3",{children:_("agentWorkspace.usageOverview")})}),Ps&&!Ss&&o.jsx("div",{className:"aw-usage-state",role:"status","aria-live":"polite",children:o.jsx(bn,{as:"span",children:_("agentWorkspace.loadingUsage")})}),ws&&o.jsxs("div",{className:"aw-usage-state is-error",role:"alert",children:[o.jsx("span",{children:ws}),o.jsx("button",{type:"button",onClick:()=>gu(ut=>ut+1),children:_("common.retry")})]}),!Ps&&!ws&&!Ss&&!Ji&&o.jsx("div",{className:"aw-usage-state",children:_("agentWorkspace.usageUnavailable")}),Ss&&o.jsxs(o.Fragment,{children:[o.jsxs("dl",{className:"aw-usage-summary","aria-label":_("agentWorkspace.usageSummary"),children:[o.jsxs("div",{children:[o.jsx("dt",{children:_("agentWorkspace.totalCalls")}),o.jsx("dd",{children:Ss.totalInvocations.toLocaleString(I.resolvedLanguage??I.language)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:_("agentWorkspace.userCount")}),o.jsx("dd",{children:Ss.totalUsers.toLocaleString(I.resolvedLanguage??I.language)})]})]}),o.jsxs("div",{className:"aw-usage-users-head",children:[o.jsx("h3",{children:_("agentWorkspace.userDetails")}),Ps&&o.jsx(bn,{as:"span",role:"status","aria-live":"polite",children:_("agentWorkspace.refreshing")})]}),Ss.users.length===0?o.jsx("div",{className:"aw-usage-state",children:_("agentWorkspace.noUsage")}):o.jsx("div",{className:"aw-usage-table-wrap",children:o.jsxs("table",{className:"aw-usage-table",children:[o.jsx("caption",{children:_("agentWorkspace.usageUserList")}),o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:_("agentWorkspace.user")}),o.jsx("th",{scope:"col",children:_("agentWorkspace.callCount")}),o.jsx("th",{scope:"col",children:_("agentWorkspace.lastUsed")})]})}),o.jsx("tbody",{children:Ss.users.map(ut=>o.jsxs("tr",{children:[o.jsxs("td",{children:[o.jsx("strong",{children:ut.displayName||ut.userId||_("agentWorkspace.unknownUser")}),ut.displayName&&ut.userId&&o.jsx("small",{title:ut.userId,children:ut.userId})]}),o.jsx("td",{children:ut.invocationCount.toLocaleString(I.resolvedLanguage??I.language)}),o.jsx("td",{children:o.jsx("time",{dateTime:ut.lastUsedAt,children:Uqt(ut.lastUsedAt,I.resolvedLanguage??I.language,_)})})]},ut.userId))})]})}),Ss.totalPages>1&&o.jsxs("nav",{className:"aw-usage-pagination","aria-label":_("agentWorkspace.usagePagination"),children:[o.jsx("button",{type:"button",disabled:Ps||Ss.page<=1,onClick:()=>oa(ut=>Math.max(1,ut-1)),children:_("common.previousPage")}),o.jsx("span",{"aria-live":"polite",children:_("agentWorkspace.pageOf",{page:Ss.page,total:Ss.totalPages})}),o.jsx("button",{type:"button",disabled:Ps||Ss.page>=Ss.totalPages,onClick:()=>oa(ut=>ut+1),children:_("common.nextPage")})]})]})]}),L==="versions"&&o.jsxs("section",{className:"aw-version-stack",children:[o.jsxs("div",{className:"aw-integration-intro",children:[o.jsx("h3",{children:_("agentWorkspace.githubVersions")}),o.jsx("p",{children:(Be=ke==null?void 0:ke.cicd)!=null&&Be.enabled?_("agentWorkspace.githubVersionsDescription"):_("agentWorkspace.currentVersionOnly")})]}),re&&o.jsx("div",{className:"aw-case-empty",children:_("agentWorkspace.loadingVersions")}),be&&o.jsxs("div",{className:"aw-integration-error",role:"alert",children:[o.jsx("span",{children:be}),(Oe==null?void 0:Oe.runtimeId)&&o.jsx("button",{type:"button",onClick:()=>void F_(Oe.runtimeId??"").then(je),children:_("common.retry")})]}),!re&&!be&&o.jsxs("div",{className:"aw-version-list",children:[(ke==null?void 0:ke.githubSyncError)&&o.jsx("div",{className:"aw-integration-error",role:"alert",children:o.jsx("span",{children:ke.githubSyncError})}),(ke==null?void 0:ke.latestSourceRuntimeStatus)&&ke.latestSourceRuntimeStatus!=="published"&&((tt=ke.versions[0])==null?void 0:tt.commitSha)&&ke.versions[0].commitSha!==ke.currentCommitSha&&o.jsx("div",{className:"aw-integration-notice",role:"status",children:o.jsxs("span",{children:[_("agentWorkspace.sourceMergedRuntimeStill"),Bse(ke.latestSourceRuntimeStatus,_),_("agentWorkspace.currentProductionVersionHint")]})}),ke!=null&&ke.versions.length?ke.versions.map(ut=>{var xl;const Ei=ut.commitSha??"",uo=ut.runtimeStatus??ut.status,Ci=ut.changeType==="rollback",Xs=!!((xl=ke.cicd)!=null&&xl.enabled)&&!!Ei&&!Ci&&Ei!==ke.currentCommitSha;return o.jsxs("article",{className:"aw-version-row",children:[o.jsxs("div",{children:[o.jsx("strong",{children:zqt(ut,_)}),o.jsx("small",{children:ut.createdAt||_("agentWorkspace.noTime")})]}),o.jsxs("div",{children:[o.jsx("span",{children:_("agentWorkspace.prLink")}),ut.pullRequestUrl?o.jsx("a",{href:ut.pullRequestUrl,target:"_blank",rel:"noopener noreferrer",children:_("agentWorkspace.viewPr")}):o.jsx("em",{children:_("agentWorkspace.noPr")})]}),o.jsxs("div",{children:[o.jsx("span",{children:_("agentWorkspace.author")}),o.jsx("em",{children:ut.author||"Studio"})]}),o.jsxs("div",{children:[o.jsx("span",{children:_("agentWorkspace.publishStatus")}),o.jsx("em",{children:Bse(uo,_)})]}),o.jsxs("div",{className:"aw-version-actions",children:[o.jsx("button",{type:"button",disabled:!Xs||Ke===Ei,onClick:()=>void kn(ut),children:_(Ke===Ei?"agentWorkspace.rollingBack":"agentWorkspace.rollbackToVersion")}),ut.workflowRunUrl&&o.jsx("a",{href:ut.workflowRunUrl,target:"_blank",rel:"noopener noreferrer",children:_("agentWorkspace.viewRelease")})]})]},`${ut.version}-${Ei||ut.createdAt}`)}):o.jsxs("article",{className:"aw-version-row",children:[o.jsxs("div",{children:[o.jsx("strong",{children:Qt!=null?`v${Qt}`:_("agentWorkspace.noVersion")}),o.jsx("small",{children:(q==null?void 0:q.updatedAt)||_("agentWorkspace.noTime")})]}),o.jsx("p",{children:_("agentWorkspace.currentVersionOnly")})]})]})]}),L==="integrations"&&o.jsxs("div",{className:"aw-integration-stack",children:[o.jsxs("div",{className:"aw-integration-intro",children:[o.jsx("h3",{children:_("agentWorkspace.integrationMethods")}),o.jsx("p",{children:_("agentWorkspace.integrationDescription")})]}),ae&&o.jsxs("div",{className:"aw-integration-error",role:"alert",children:[o.jsx("span",{children:ae}),o.jsx("button",{type:"button",onClick:()=>G(ut=>ut+1),children:_("common.retry")})]}),!ae&&o.jsxs("div",{className:"aw-integration-body",children:[o.jsxs("div",{className:`aw-integration-protocol-tabs${te==="a2a"?" is-a2a":""}`,role:"tablist","aria-label":_("agentWorkspace.integrationProtocol"),children:[o.jsx("span",{className:"aw-integration-protocol-slider","aria-hidden":"true"}),jO.map((ut,Ei)=>o.jsx("button",{type:"button",id:`integration-${ut.id}-tab`,role:"tab","aria-selected":te===ut.id,"aria-controls":`integration-${ut.id}-panel`,tabIndex:te===ut.id?0:-1,onClick:()=>at(ut.id),onKeyDown:uo=>{var xl;if(!["ArrowLeft","ArrowRight","Home","End"].includes(uo.key))return;uo.preventDefault();const Ci=uo.key==="Home"?0:uo.key==="End"?jO.length-1:(Ei+(uo.key==="ArrowRight"?1:-1)+jO.length)%jO.length,Xs=jO[Ci];at(Xs.id),(xl=document.getElementById(`integration-${Xs.id}-tab`))==null||xl.focus()},children:ut.label},ut.id))]}),te==="api-server"?o.jsx(Qse,{protocol:"api-server",title:"API Server",available:Ro,fields:[{label:"Agent",value:Ro?((nt=ar==null?void 0:ar.apiApps)==null?void 0:nt.join("、"))??"":""},{label:_("agentWorkspace.discoveryEndpoint"),value:Ro?O4(Dn,"/list-apps"):""},{label:_("agentWorkspace.invocationEndpoint"),value:Ro?O4(Dn,"/run_sse"):""},{label:_("agentWorkspace.authentication"),value:Ro?Fse(q==null?void 0:q.authType,_):""},{label:"API Key",value:o.jsx(Use,{available:Ro,authType:q==null?void 0:q.authType,value:Ms,visible:fe&&!!Ms,loading:Te,error:we,onToggle:()=>void Ft()})}],example:Ro?Vqt(Dn,Ko,q==null?void 0:q.authType):""}):o.jsx(Qse,{protocol:"a2a",title:"A2A",available:bl,fields:[{label:"Agent",value:((Sn=ar==null?void 0:ar.a2a)==null?void 0:Sn.name)??""},{label:"Agent Card",value:bl?O4(Dn,"/.well-known/agent-card.json"):""},{label:_("agentWorkspace.invocationUrl"),value:yl},{label:_("agentWorkspace.authentication"),value:bl?Fse(q==null?void 0:q.authType,_):""},{label:"API Key",value:o.jsx(Use,{available:bl,authType:q==null?void 0:q.authType,value:Ms,visible:fe&&!!Ms,loading:Te,error:we,onToggle:()=>void Ft()})}],example:bl?Hqt(yl,q==null?void 0:q.authType):""})]})]}),L==="evaluations"&&o.jsxs("section",{className:"aw-cases",children:[(Oe==null?void 0:Oe.runtimeId)&&o.jsx("div",{className:"aw-case-summary",children:["good","bad"].map(ut=>{const Ei=Jqt(Ui,ut),uo=lo.filter(Xs=>Xs.kind===ut).length,Ci=Or?uo:(Ei==null?void 0:Ei.itemCount)??uo;return o.jsxs("button",{type:"button",onClick:()=>Yd(ut),children:[o.jsx("strong",{children:Ci}),o.jsx("span",{children:_(ut==="good"?"agentWorkspace.goodCases":"agentWorkspace.badCases")})]},ut)})}),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":_("agentWorkspace.caseResultFilter"),children:["good","bad"].map(ut=>o.jsx("button",{type:"button",className:gt===ut?"is-active":"","aria-pressed":gt===ut,onClick:()=>it(ut),children:_(ut==="good"?"agentWorkspace.goodCase":"agentWorkspace.badCase")},ut))}),o.jsx("div",{className:"aw-case-source-filters","aria-label":_("agentWorkspace.feedbackSourceFilter"),children:["auto","user"].map(ut=>o.jsx("button",{type:"button",className:Kt===ut?"is-active":"","aria-pressed":Kt===ut,onClick:()=>dn(ut),children:_(ut==="auto"?"agentWorkspace.automaticFeedback":"agentWorkspace.manualFeedback")},ut))})]}),o.jsxs("label",{className:"aw-case-search",children:[o.jsx(DN,{"aria-hidden":!0}),o.jsx("input",{type:"search",value:kt,onChange:ut=>ct(ut.currentTarget.value),placeholder:_("agentWorkspace.searchCasesPlaceholder"),"aria-label":_("agentWorkspace.searchCases")})]})]}),co&&o.jsx("div",{className:`aw-case-toolbar${ss?" is-active":""}`,children:ss?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-selection-count",children:_("agentWorkspace.selectedCaseCount",{count:Es.length})}),o.jsx("button",{type:"button",onClick:g0,disabled:Nr.length===0||Tr,children:_("agentWorkspace.selectAllVisible")}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void Vg(Es),disabled:Es.length===0||Tr,children:_(Tr?"common.deleting":"agentWorkspace.deleteSelected")}),o.jsx("button",{type:"button",onClick:b0,disabled:Tr,children:_("common.cancel")})]}):o.jsx("button",{type:"button",onClick:()=>{ur(""),or(!0)},disabled:Nr.length===0||Tr,children:_("agentWorkspace.selectCases")})}),Ja&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:Ja}),o.jsx("div",{ref:as,children:o.jsx(uWt,{cases:Nr,loading:Qi&&Nr.length===0,error:St,notice:Vn,runtimeBacked:!!(Oe!=null&&Oe.runtimeId),selectionMode:ss,selectedCaseIds:Aa,focusedCaseId:Wo,expandedCaseIds:aa,deleting:Tr,canDelete:co,onOpenCase:v0,onToggleCase:zg,onToggleExpanded:y0,onDeleteCase:ut=>void Vg([ut]),onRetry:()=>is(ut=>ut+1)})})]}),L==="optimizations"&&o.jsxs("section",{className:"aw-optimizations",children:[o.jsxs("div",{className:"aw-optimization-intro",children:[o.jsx("h3",{children:_("agentWorkspace.optimizations")}),o.jsx("p",{children:_("agentWorkspace.optimizationsDescription")})]}),di?o.jsxs("div",{className:"aw-optimization-state",role:"status",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsx("span",{children:_("agentWorkspace.loadingOptimizations")})]}):Qr?o.jsxs("div",{className:"aw-optimization-state is-error",role:"alert",children:[o.jsx("span",{children:Qr}),o.jsx("button",{type:"button",onClick:()=>rs(ut=>ut+1),children:_("common.retry")})]}):Ur.length>0?o.jsx(lWt,{groups:Ur}):o.jsx("div",{className:"aw-optimization-state",children:_("agentWorkspace.noOptimizations")})]})]}),L==="basic"&&(Oe||fi)&&o.jsxs("div",{className:"aw-basic-actions",children:[Oe&&o.jsxs("button",{type:"button",className:"aw-talk studio-update-action",onClick:()=>E==null?void 0:E(Oe),children:[o.jsx(frt,{"aria-hidden":!0}),o.jsx("span",{children:_("agentWorkspace.chat")})]}),o.jsxs("span",{className:`aw-update-wrap${ua?" is-disabled":""}`,tabIndex:ua?0:void 0,"aria-describedby":ua?da:void 0,children:[o.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:!!ua,"aria-busy":Ae||void 0,"aria-describedby":ua?da:void 0,onClick:()=>fi?j==null?void 0:j(fi):Je?T(Je):void 0,children:Ae?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"loading-gap-spinner aw-update-spinner","aria-hidden":"true"}),o.jsx("span",{children:_("agentWorkspace.preparing")})]}):_(fi||ja?"agentWorkspace.continueEditing":"agentWorkspace.update")}),ua&&o.jsx("span",{id:da,className:"aw-update-disabled-reason",role:"tooltip",children:ua})]})]})]}):null}}),activeSectionKey:L,navigationLabel:_("agentWorkspace.agentDetails"),onSectionChange:B})]})]}),D==="evaluation"&&o.jsx("div",{className:"aw-evaluation-glass",role:"status",children:o.jsx("span",{children:_("agentWorkspace.comingSoon")})})]})]}),vn&&o.jsx(Xu,{variant:"danger",title:vn.title,description:vn.description,confirmLabel:$t?_("common.deleting"):vn.confirmLabel,closeLabel:_("agentWorkspace.closeDeleteConfirmation"),busy:$t,onCancel:()=>si(null),onConfirm:()=>void Wg()})]})}function lWt({groups:e}){const{t}=_e("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:Xqt(n.priority,t)})}),o.jsx("td",{children:o.jsx("span",{className:"aw-optimization-module",children:Zqt(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 cWt(){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 uWt({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:m,onDeleteCase:g,onRetry:b}){const{t:v,i18n:y}=_e("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(w=>{var A,N;const x=w.id.startsWith("local:"),O=(a==null?void 0:a.has(w.id))??!1,S=(c==null?void 0:c.has(w.id))??!1,C=w.output.length+w.referenceOutput.length>220||(((A=w.reason)==null?void 0:A.length)??0)>120,E=d&&!x,R=!!(w.comment&&w.comment.trim()!==((N=w.reason)==null?void 0:N.trim()));return o.jsxs("div",{className:["aw-case-row",l===w.id?"is-focused":"",s?"is-selecting":"",O?"is-selected-for-delete":""].filter(Boolean).join(" "),role:"row",tabIndex:0,"aria-selected":s?O:void 0,onClick:()=>{if(s){E&&(h==null||h(w));return}f==null||f(w)},onKeyDown:T=>{T.target===T.currentTarget&&(T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),s?E&&(h==null||h(w)):f==null||f(w)))},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&&E&&o.jsx("span",{className:`aw-select-marker${O?" is-checked":""}`,"aria-hidden":"true"}),o.jsx("strong",{title:w.input,children:w.input||v("agentWorkspace.noUserInput")})]}),R&&o.jsxs("small",{title:w.comment,children:[v("agentWorkspace.note"),w.comment]}),o.jsx("small",{className:"aw-case-time",children:Kqt(w.createdAt,y.resolvedLanguage??y.language,v)}),(w.userId||w.sessionId)&&o.jsx("small",{title:[w.userId,w.sessionId].filter(Boolean).join(" · "),children:[w.userId,w.sessionId].filter(Boolean).join(" · ")})]}),o.jsxs("div",{className:`aw-case-output aw-case-cell${S?" is-expanded":""}`,"data-label":v("agentWorkspace.agentOutput"),children:[o.jsx("p",{className:"aw-case-output-preview",title:w.output,children:w.output||v("agentWorkspace.noVisibleResponse")}),w.referenceOutput&&o.jsxs("small",{className:"aw-case-output-preview",title:w.referenceOutput,children:[v("agentWorkspace.reference"),": ",w.referenceOutput]}),C&&o.jsx("button",{type:"button",className:"aw-case-expand",onClick:T=>{T.stopPropagation(),m==null||m(w.id)},children:v(S?"common.collapse":"common.expand")})]}),o.jsx("div",{className:"aw-case-score aw-case-cell","data-label":v("agentWorkspace.score"),children:Gqt(w,v)}),o.jsx("div",{className:`aw-case-reason aw-case-cell${S?" is-expanded":""}`,"data-label":v("agentWorkspace.scoreReason"),children:o.jsx("p",{title:w.reason||void 0,children:w.reason||"—"})}),o.jsx("div",{className:"aw-case-actions aw-case-cell","data-label":v("skillCenter.actions"),children:E&&o.jsx("button",{type:"button",className:"aw-case-delete",onClick:T=>{T.stopPropagation(),g==null||g(w)},disabled:u,title:v("agentWorkspace.deleteFeedbackCase"),"aria-label":v("agentWorkspace.deleteFeedbackCase"),children:o.jsx(cWt,{})})})]},w.id)})]})}function dWt({group:e,agents:t,cases:n,onChange:i,onRun:r}){const{t:s}=_e("ui"),[a,l]=p.useState("config"),c=e.agentIds.map(h=>t.find(m=>m.id===h)).filter(h=>!!h),u=["回答质量","事实准确性","工具调用","响应效率"];p.useEffect(()=>l("config"),[e.id]);const d=h=>{i({...e,agentIds:e.agentIds.includes(h)?e.agentIds.filter(m=>m!==h):[...e.agentIds,h]})},f=h=>{i({...e,metrics:e.metrics.includes(h)?e.metrics.filter(m=>m!==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:gk(e.name,s)}),o.jsx("span",{children:s("agentWorkspace.evaluationGroup")})]}),o.jsx("p",{children:s("agentWorkspace.evaluationGroupStats",{agents:c.length,caseSet:gk(e.caseSet,s),runs:e.history.length})})]}),o.jsxs("button",{type:"button",className:"aw-run",onClick:()=>r(e),disabled:!0,children:[o.jsx(srt,{"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:gk(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,m)=>o.jsxs("button",{type:"button",children:[o.jsxs("span",{children:[o.jsx("strong",{children:s("agentWorkspace.evaluationRun",{index:e.history.length-m})}),o.jsx("small",{children:s("agentWorkspace.evaluationRunMeta",{time:gk(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(Ud,{}),s("agentWorkspace.completed")]}),o.jsx(qk,{"aria-hidden":!0})]},h.id))})]})})]})}async function dq(e,t={}){const n=await fetch(ia(`/web/agent-reviews${e}`),{...t,headers:Fl(hu({"Content-Type":"application/json"})),signal:Xa(t.signal??void 0,6e4)});if(!n.ok)throw new Error(await n.text());return n.json()}function fWt(e,t){return dq(`?${new URLSearchParams({region:e})}`,{signal:t})}function hWt(e,t,n){return dq(`/${encodeURIComponent(e)}?${new URLSearchParams({region:t})}`,{signal:n})}function pWt(e,t,n){return dq(`/${encodeURIComponent(e)}/${t}`,{method:"POST",body:JSON.stringify(n)})}const mWt=20,Vse=256;function k4({label:e,value:t,onChange:n,limit:i,disabled:r,required:s=!1}){const{t:a}=_e("agentReviews");return o.jsxs("label",{children:[e,o.jsx("textarea",{"aria-label":e,value:t,onChange:l=>n(Array.from(l.target.value).slice(0,i).join("")),maxLength:i*2,disabled:r,required:s,rows:3}),o.jsx("span",{className:"agent-review-text-count",children:a("textCount",{count:Array.from(t).length,limit:i})})]})}function JR({person:e}){return o.jsxs("span",{className:"agent-review-person",title:e.email||e.name,children:[e.avatarUrl?o.jsx("img",{src:e.avatarUrl,alt:"",referrerPolicy:"no-referrer",onError:t=>{t.currentTarget.hidden=!0}}):null,o.jsx("span",{children:e.name||e.id})]})}function TFe({runtimeId:e,region:t,name:n,canPublish:i,onClose:r,onChanged:s}){const{t:a,i18n:l}=_e("agentReviews"),[c,u]=p.useState(null),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(""),[v,y]=p.useState(""),[w,x]=p.useState(""),[O,S]=p.useState(""),[k,C]=p.useState(0),[E,R]=p.useState(!1),[A,N]=p.useState(null);p.useEffect(()=>{const P=new AbortController;return f(!0),b(""),hWt(e,t,P.signal).then(L=>{P.signal.aborted||u(L.application)}).catch(L=>{P.signal.aborted||b(L instanceof Error?L.message:String(L))}).finally(()=>{P.signal.aborted||f(!1)}),()=>P.abort()},[e,t,k]);async function T(P,L){if(!h){m(!0),b("");try{const B=await pWt(e,P,{region:t,...P==="submit"?{message:v}:{},...P==="publish"||P==="decision"?{comment:w}:{},...P==="decision"?{applicationId:c==null?void 0:c.id,decision:L,reason:O}:{}});u(B),x(""),S(""),R(!1),N(null),s()}catch(B){b(B instanceof Error?B.message:String(B))}finally{m(!1)}}}const j=(c==null?void 0:c.status)==="pending",_=!!(c!=null&&c.published),I=!j&&!_,D=P=>new Date(P).toLocaleString(l.language);return o.jsx(k1,{open:!0,onOpenChange:P=>{!P&&!h&&r()},children:o.jsxs(O1,{children:[o.jsx(x1,{className:"agent-review-backdrop"}),o.jsxs(w1,{className:"agent-review-dialog",children:[o.jsxs("header",{className:"agent-review-dialog-header",children:[o.jsxs("div",{children:[o.jsx(S1,{children:n}),o.jsx(ET,{children:a("dialogDescription")})]}),o.jsx(GD,{className:"agent-review-close",disabled:h,"aria-label":a("close"),children:o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m6 6 12 12M6 18 18 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})})]}),o.jsxs("div",{className:"agent-review-dialog-body",children:[d?o.jsx(Ka,{}):null,g?o.jsxs("div",{className:"agent-review-error",role:"alert",children:[o.jsx("p",{children:g}),o.jsx("button",{type:"button",disabled:h||d,onClick:()=>C(P=>P+1),children:a("refresh")})]}):null,!d&&c?o.jsxs(o.Fragment,{children:[o.jsxs("dl",{className:"agent-review-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:a("statusTitle")}),o.jsxs("dd",{children:[a(`status.${c.status}`),c.status==="approved"&&!_?` · ${a("private")}`:""]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:a("submitter")}),o.jsx("dd",{children:o.jsx(JR,{person:c.submitter})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:a("submittedAt")}),o.jsx("dd",{children:D(c.submittedAt)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:a("version")}),o.jsx("dd",{children:c.agent.version??"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:a("model")}),o.jsx("dd",{children:c.agent.model||"—"})]}),c.reviewer?o.jsxs("div",{children:[o.jsx("dt",{children:a(c.status==="returned"?"returnedBy":"approvedBy")}),o.jsx("dd",{children:o.jsx(JR,{person:c.reviewer})})]}):null,c.reviewedAt?o.jsxs("div",{children:[o.jsx("dt",{children:a("reviewedAt")}),o.jsx("dd",{children:D(c.reviewedAt)})]}):null]}),o.jsxs("section",{children:[o.jsx("h3",{children:a("description")}),o.jsx("p",{children:c.agent.description||"—"})]}),c.message?o.jsxs("section",{children:[o.jsx("h3",{children:a("message")}),o.jsx("p",{children:c.message})]}):null,c.reason?o.jsxs("section",{children:[o.jsx("h3",{children:a("reason")}),o.jsx("p",{children:c.reason})]}):null,c.comment?o.jsxs("section",{children:[o.jsx("h3",{children:a("comment")}),o.jsx("p",{children:c.comment})]}):null,c.contentChanged?o.jsx("p",{role:"alert",className:"agent-review-warning",children:a("contentChanged")}):null]}):null,!d&&!g&&I&&!i?o.jsx(k4,{label:a("message"),value:v,onChange:y,limit:mWt,disabled:h}):null,!d&&!g&&i&&(j||I)?o.jsx(k4,{label:a("comment"),value:w,onChange:x,limit:Vse,disabled:h}):null,E?o.jsx(k4,{label:a("reasonRequired"),value:O,onChange:S,limit:Vse,disabled:h,required:!0}):null,A?o.jsx("p",{role:"status",children:a(`${A}Confirm`)}):null]}),o.jsxs("footer",{className:"agent-review-dialog-footer",children:[h?o.jsx("span",{role:"status",children:a("saving")}):null,!d&&(!g||c)?A?o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",disabled:h,onClick:()=>N(null),children:a("cancel")}),o.jsx("button",{type:"button",disabled:h,onClick:()=>void T(A),children:a("confirm")})]}):E?o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",disabled:h,onClick:()=>R(!1),children:a("cancel")}),o.jsx("button",{type:"button",disabled:h||!O.trim(),onClick:()=>void T("decision","returned"),children:a("return")})]}):o.jsxs(o.Fragment,{children:[_?o.jsx("button",{type:"button",disabled:h,onClick:()=>N("unpublish"),children:a("unpublish")}):null,j?o.jsx("button",{type:"button",disabled:h,onClick:()=>N("withdraw"),children:a("withdraw")}):null,j&&i?o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",disabled:h,onClick:()=>R(!0),children:a("return")}),o.jsx("button",{type:"button",className:"is-primary",disabled:h||(c==null?void 0:c.contentChanged),onClick:()=>void T("decision","approved"),children:a("approve")})]}):null,I?o.jsx("button",{type:"button",className:"is-primary",disabled:h,onClick:()=>void T(i?"publish":"submit"),children:a(i?"publish":"submit")}):null]}):null]})]})]})})}const gWt=5e3,bWt=4;let S4=0;const Hse=[];function qse(e){return e instanceof Error&&e.name==="AbortError"}function yWt(e){return e instanceof Error&&e.name==="TimeoutError"}function vWt(e){return yWt(e)||e instanceof LU&&[500,502,503,504].includes(e.status)}function xWt(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 wWt(e={},t={}){const n=t.request??zw,i=t.wait??xWt;try{return await n(e)}catch(r){if(!vWt(r))throw r;return await i(gWt,e.signal),n(e)}}async function AFe(e){var t;S4>=bWt&&await new Promise(n=>Hse.push(n)),S4+=1;try{return await e()}finally{S4-=1,(t=Hse.shift())==null||t()}}async function OWt(e,t){await Promise.allSettled(e.map(n=>AFe(()=>t(n))))}function Ib(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 Bh({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 kWt(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 SWt(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 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:"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 CWt(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 JE({kind:e,...t}){return e==="codex"?o.jsx(kWt,{...t}):e==="deepseek-harness"?o.jsx(CWt,{...t}):e==="openclaw"?o.jsx(SWt,{...t}):o.jsx(EWt,{...t})}const TWt=["general","codex","deepseek-harness","openclaw","hermes"],AWt=24,_Wt=3e4,jWt=7e3,NWt=2e4,RWt=6,IWt=2,PWt=250,Im=new Map,Ax=new Map,DWt=new Set;function cb(e){const t=e.runtime;return t?`${t.region}:${t.runtimeId}:${t.currentVersion??""}`:""}function Wse(e,t){const n=e instanceof Error&&e.message.trim()?e.message.trim():t("myAgents.compatibility.unknownError");return{status:e instanceof bo&&e.unsupported?"unsupported":"error",message:n}}function Cb(e){if(!e){Im.clear(),Ax.clear(),tF();return}const t=new Set(e);if(t.size!==0){for(const[n,i]of Ax)i.page.runtimes.some(r=>t.has(r.runtimeId))&&Ax.delete(n);for(const n of t)tF(n);Im.clear()}}function MWt(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 LWt(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 $Wt(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 FWt({type:e}){return e==="general"?o.jsx(Bh,{}):o.jsx(JE,{kind:e})}function BWt(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 Kse(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:IMe(e.author),isMine:e.isMine,runtime:{runtimeId:e.runtimeId,region:e.region,currentVersion:e.currentVersion,canDelete:e.canDelete,canManage:e.canManage,canPublish:e.canPublish,visibility:e.visibility,reviewStatus:e.reviewStatus}}}function UWt(e,t){const n=ZI(e.status);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:IMe(e.createdBy),isMine:e.isMine,region:e.region,sandbox:e}}function QWt(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 zWt(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 VWt(e,t){return e.trim()||Xi(t)}async function HWt(e,t,n,i,r,s){const a=`${e}:${t}:${n}`,l=Ax.get(a);if(l&&l.expiresAt>Date.now())return i(l.page.runtimes.map(d=>Kse(d,r))),l.page.nextToken;l&&Ax.delete(a);let c=Im.get(a);c||(c=wWt({scope:e,region:t,pageSize:AWt,nextToken:n,signal:s}),Im.set(a,c),c.then(()=>Im.delete(a),()=>Im.delete(a)));const u=await c;return Ax.set(a,{page:u,expiresAt:Date.now()+_Wt}),i(u.runtimes.map(d=>Kse(d,r))),u.nextToken}function qWt({agent:e,onReview:t,onUse:n,onViewDetails:i,onPrepareUpdate:r,compatibility:s,onRetryCompatibility:a,connecting:l,connectError:c,connected:u,deploymentTask:d,nowMs:f,onViewDeploymentTask:h,onEditDraft:m,onDeleteDraft:g}){var N,T,j,_;const{t:b,i18n:v}=_e("ui"),y=(N=e.sandbox)==null?void 0:N.status.toLowerCase(),w=((T=e.sandbox)==null?void 0:T.resourceType)==="snapshot",x=!!(e.runtime||y==="ready"||y==="wakeable"),O=(s==null?void 0:s.status)==="checking",S=(s==null?void 0:s.status)==="unsupported",k=(s==null?void 0:s.status)==="error",C=((j=e.sandbox)==null?void 0:j.resourceType)==="snapshot"?e.sandbox.sourceSessionId||e.sandbox.snapshotId:(_=e.sandbox)==null?void 0:_.id,E=()=>{if(e.draft){d?h==null||h(d):i==null||i(e);return}!x&&!e.sandbox||(d?h==null||h(d):i==null||i(e))},R=(e.draft||x||!!e.sandbox)&&!!(d?h:i),A=e.draft?d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.viewRuntimeDetails",{name:e.name}):d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.viewDetails",{name:e.name});return o.jsxs(Uz,{className:`my-agent-card${l?" is-connecting":""}${e.runtime?" has-review":""}`,activateLabel:R?A:void 0,onActivate:R?E:void 0,onPointerEnter:()=>r==null?void 0:r(e),onFocusCapture:()=>r==null?void 0:r(e),footer:o.jsxs("div",{className:"my-agent-card-footer",children:[o.jsx(DIe,{className:"my-agent-meta",items:[{label:e.specificationLabel,value:e.specification,hideLabel:!0,className:"my-agent-region"},{label:b("myAgents.time"),value:XD(e.createdAt,f,v.resolvedLanguage??v.language),hideLabel:!0,className:"my-agent-created-at"},...e.sandbox?[{label:b("myAgents.remainingTime"),value:e.sandbox.resourceType==="snapshot"||e.sandbox.persistent?b("myAgents.neverExpires"):BWt(e.sandbox.expireAt,f,b),className:`my-agent-expiry${e.sandbox.resourceType==="snapshot"||e.sandbox.persistent?"":" is-expiring"}`}]:[]]}),e.runtime?o.jsxs("div",{className:"agent-review-card-controls",children:[o.jsx("span",{className:"agent-review-card-status",children:b(e.runtime.visibility==="enterprise"?"enterprise":"private",{ns:"agentReviews"})}),e.runtime.canManage?o.jsxs(rj,{className:"agent-review-card-action",onClick:I=>{I.stopPropagation(),t==null||t(e)},children:[b(e.runtime.reviewStatus?"details":e.runtime.canPublish?"publish":"submit",{ns:"agentReviews"}),e.runtime.reviewStatus?` · ${b(`status.${e.runtime.reviewStatus}`,{ns:"agentReviews"})}`:""]}):null]}):null]}),actions:e.draft?o.jsxs(o.Fragment,{children:[o.jsx(rj,{"aria-label":d?b("myAgents.viewDeploymentProgress",{name:e.name}):b("myAgents.editDraftNamed",{name:e.name}),onClick:()=>d?h==null?void 0:h(d):m==null?void 0:m(e.draft),children:b(d?"myAgents.viewProgress":"common.edit")}),o.jsx(rj,{tone:"danger","aria-label":b("myAgents.deleteDraftNamed",{name:e.name}),onClick:()=>g==null?void 0:g(e.draft),children:b("common.delete")})]}):k||S?o.jsxs(It,{type:"button",color:"primary",size:"sm",pill:!1,"aria-label":b("myAgents.recheckCompatibility",{name:e.name}),onClick:()=>a==null?void 0:a(e),children:[o.jsx(mP,{}),b("common.retry")]}):o.jsx(d8,{className:u?"my-agent-use is-connected":"my-agent-use",disabled:!x||O||S||l||u,"aria-busy":l||void 0,label:u?b("myAgents.connectedNamed",{name:e.name}):w?b("myAgents.wakeAndChat",{name:e.name}):b("myAgents.chatWith",{name:e.name}),onClick:()=>void(n==null?void 0:n(e)),children:l?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-use-spinner","aria-hidden":"true"}),o.jsx("span",{className:"sr-only",children:b(w?"myAgents.waking":"agentSelector.connecting")})]}):o.jsx(LWt,{})}),children:[o.jsx(Qz,{leading:o.jsx(uw,{seed:e.name}),title:e.name,subtitle:e.sandbox?o.jsx("span",{className:"my-agent-session-id",title:C,children:C}):void 0,status:e.draft?d?o.jsx("span",{className:"my-agent-deploying-badge",children:b("myAgents.deploying")}):o.jsx("span",{className:"my-agent-draft-badge",children:b("myAgents.draft")}):e.sandbox?o.jsx("span",{className:"my-agent-status-label","data-ready":ZI(e.sandbox.status)==="ready"||void 0,children:e.description}):e.runtime&&d?o.jsx("span",{className:"my-agent-deploying-badge",children:b("myAgents.deploying")}):O?o.jsx(yo,{content:s==null?void 0:s.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(zo,{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:b("myAgents.checking")})]})})}):S?o.jsx(yo,{content:s==null?void 0:s.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(zo,{className:"my-agent-compatibility-status",color:"warning",variant:"soft",size:"sm",pill:!0,children:b("myAgents.chatUnsupported")})})}):k?o.jsx(yo,{content:s==null?void 0:s.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(zo,{className:"my-agent-compatibility-status",color:"danger",variant:"soft",size:"sm",pill:!0,children:b("myAgents.checkFailed")})})}):null}),c?o.jsx(yo,{content:c,contentClassName:"my-agent-error-tooltip",maxWidth:360,interactive:!0,children:o.jsx("p",{className:"my-agent-wake-note",role:"alert",tabIndex:0,children:c})}):null,w&&l?o.jsx("p",{className:"my-agent-wake-note",role:"status",children:o.jsx(bn,{children:b("myAgents.wakingHint")})}):null,e.sandbox?null:o.jsx(zz,{children:e.description})]})}function WWt({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:m,onActiveTypeChange:g,sandboxRefreshKey:b=0,connectedRuntimeId:v="",hiddenRuntimeIds:y=DWt,drafts:w=[],deploymentTasks:x=[],draftDeploymentTaskIds:O={},onViewDeploymentTask:S,onEditDraft:k,onDeleteDraft:C}){const{t:E}=_e("ui"),R=p.useRef(null),A=p.useRef(null),N=p.useRef(0),T=p.useRef(null),j=p.useRef(0),_=p.useRef(null),I=p.useRef(new Map),D=VWt(t,e),[P,L]=p.useState(null),[B,M]=p.useState(""),[H,K]=p.useState(s==="mine"?"mine":"all"),[F,q]=p.useState(D),[Q,X]=p.useState([]),[ne,z]=p.useState(""),[Y,ae]=p.useState(!0),[Ee,Z]=p.useState(""),[G,te]=p.useState([]),[de,Ce]=p.useState(!1),[le,fe]=p.useState(""),[ce,Te]=p.useState(""),[Me,we]=p.useState({}),[Ue,ke]=p.useState({}),[je,re]=p.useState(null),[ve,be]=p.useState(()=>Date.now()),xe=p.useMemo(()=>TWt.map(Ie=>({value:Ie,label:E(`myAgents.agentTypes.${Ie}`)})),[E]),Ke=p.useMemo(()=>{const Ie=nu(e);return Ie.some(We=>We.value===D)?Ie:[{value:D,label:D},...Ie]},[e,D]);p.useEffect(()=>{s==="mine"&&K("mine")},[s]),p.useEffect(()=>{q(D)},[D]),p.useEffect(()=>{be(Date.now());const Ie=window.setInterval(()=>be(Date.now()),1e3);return()=>window.clearInterval(Ie)},[]);const Ze=p.useMemo(()=>w.map(Ie=>QWt(Ie,E)),[w,E]),he=p.useMemo(()=>{const Ie=new Map,We=new Map,gt=new Map;for(const it of x){if(it.status!=="running")continue;if(Ie.set(it.id,it),it.draftId){const ct=We.get(it.draftId);(!ct||it.startedAt>ct.startedAt)&&We.set(it.draftId,it)}if(!it.runtimeId)continue;const kt=gt.get(it.runtimeId);(!kt||it.startedAt>kt.startedAt)&>.set(it.runtimeId,it)}return{byId:Ie,byDraftId:We,byRuntimeId:gt}},[x]),ye=p.useCallback(Ie=>{var gt;if(Ie.draft){const it=O[Ie.draft.id];return he.byDraftId.get(Ie.draft.id)??(it?he.byId.get(it):void 0)}const We=(gt=Ie.runtime)==null?void 0:gt.runtimeId;return We?he.byRuntimeId.get(We):void 0},[he,O]),Ae=p.useCallback((Ie,We)=>{var kt;(kt=T.current)==null||kt.abort(),Im.clear();const gt=new AbortController;T.current=gt;const it=++N.current;return ae(!0),Z(""),HWt(H,F,Ie,ct=>{N.current===it&&X(Kt=>We?ct:[...Kt,...ct])},E,gt.signal).then(ct=>{N.current===it&&z(ct)}).catch(ct=>{N.current===it&&(qse(ct)||Z(Ib(ct,E("myAgents.loadGeneralAgents"),"GET /web/runtimes")))}).finally(()=>{N.current===it&&ae(!1),T.current===gt&&(T.current=null)})},[H,F,E]);p.useEffect(()=>{if(m==="general")return X([]),z(""),Ae("",!0),()=>{var Ie;(Ie=T.current)==null||Ie.abort(),T.current=null,Im.clear(),N.current+=1}},[m,Ae]),p.useEffect(()=>{if(m!=="general"){for(const gt of I.current.values())gt.abort();I.current.clear();return}const Ie=new Set(Q.filter(gt=>{var it,kt;return((it=gt.runtime)==null?void 0:it.runtimeId)!==v&&((kt=gt.runtime)==null?void 0:kt.region)===F}).map(cb).filter(Boolean));for(const[gt,it]of I.current)Ie.has(gt)||(it.abort(),I.current.delete(gt));const We=Q.filter(gt=>{var Kt,dn,Xt;const it=(Kt=gt.runtime)==null?void 0:Kt.runtimeId;if(!it||it===v||((dn=gt.runtime)==null?void 0:dn.region)!==F)return!1;const kt=cb(gt),ct=(Xt=Ue[kt])==null?void 0:Xt.status;return!I.current.has(kt)&&(!ct||ct==="checking")});for(const gt of We)I.current.set(cb(gt),new AbortController);ke(gt=>{var ct,Kt;let it=!1;const kt={...gt};for(const dn of Q){const Xt=cb(dn);if(!Xt)continue;const Ge=((ct=dn.runtime)==null?void 0:ct.runtimeId)===v;Ge&&((Kt=kt[Xt])==null?void 0:Kt.status)!=="compatible"?(kt[Xt]={status:"compatible",message:E("myAgents.compatibility.supported")},it=!0):!Ge&&!kt[Xt]&&(kt[Xt]={status:"checking",message:E("myAgents.compatibility.checking")},it=!0)}return it?kt:gt}),OWt(We,async gt=>{const it=gt.runtime;if(!it)return;const kt=cb(gt),ct=I.current.get(kt);if(ct)try{const Kt=await Gx(it.runtimeId,it.region,{signal:ct.signal,preferCached:!0,timeoutMs:jWt,currentVersion:it.currentVersion});if(ct.signal.aborted)return;ke(dn=>({...dn,[kt]:Kt&&Kt.length>0?{status:"compatible",message:E("myAgents.compatibility.supported")}:{status:"unsupported",message:E("myAgents.compatibility.empty")}}))}catch(Kt){if(ct.signal.aborted||(Kt==null?void 0:Kt.name)==="AbortError")return;ke(dn=>({...dn,[kt]:Wse(Kt,E)}))}finally{I.current.get(kt)===ct&&I.current.delete(kt)}})},[m,v,F,Q,E]),p.useEffect(()=>()=>{var Ie;(Ie=T.current)==null||Ie.abort();for(const We of I.current.values())We.abort();I.current.clear()},[]);const He=p.useCallback(async Ie=>{var it;(it=_.current)==null||it.abort();const We=new AbortController;_.current=We;const gt=++j.current;Ce(!0),fe(""),te([]);try{const kt=Ie==="codex"?await Ar.listSessions({signal:We.signal,autoResumeSnapshots:!1}):await Ar.listAgentSessions(Ie,{signal:We.signal,autoResumeSnapshots:!1});if(j.current!==gt)return;te(kt.map(ct=>UWt(ct,E)))}catch(kt){if((kt==null?void 0:kt.name)==="AbortError"||j.current!==gt)return;fe(Ib(kt,E("myAgents.loadAgentType",{type:E(`myAgents.agentTypes.${Ie}`)}),`GET /web/${Ie==="codex"?"sandbox":Ie}/sessions`))}finally{_.current===We&&(_.current=null),j.current===gt&&Ce(!1)}},[E]);function De(Ie){var We;Ie!==m&&(Ie==="general"?(N.current+=1,X([]),z(""),Z(""),ae(!0)):((We=_.current)==null||We.abort(),_.current=null,j.current+=1,te([]),fe(""),Ce(!0)),g(Ie))}function At(){m==="general"&&(N.current+=1,X([]),z(""),Z(""),ae(!0))}function Nt(Ie){Ie!==H&&(At(),K(Ie))}function Ot(Ie){Ie!==F&&(At(),q(Ie))}p.useEffect(()=>{var Ie;if(m==="general"){(Ie=_.current)==null||Ie.abort(),_.current=null,j.current+=1;return}return He(m),()=>{var We;(We=_.current)==null||We.abort(),_.current=null,j.current+=1}},[m,He,b]),p.useEffect(()=>{const Ie=A.current,We=R.current;if(!Ie||!We||m!=="general"||!ne||Y)return;const gt=new IntersectionObserver(([it])=>{it.isIntersecting&&Ae(ne,!1)},{root:We,rootMargin:"240px 0px",threshold:.01});return gt.observe(Ie),()=>gt.disconnect()},[m,Ae,Y,ne]);const vt=p.useCallback(async Ie=>{if(!ce){Te(Ie.id),we(We=>({...We,[Ie.id]:""}));try{await new Promise(We=>requestAnimationFrame(()=>We())),Ie.sandbox?await f(Ie.sandbox):await c(Ie)}catch(We){we(gt=>({...gt,[Ie.id]:We instanceof Error?We.message:String(We)}))}finally{Te("")}}},[ce,c,f]),Tt=p.useCallback(async Ie=>{var kt;const We=Ie.runtime;if(!We)return;const gt=cb(Ie);ke(ct=>({...ct,[gt]:{status:"checking",message:E("myAgents.compatibility.checking")}})),(kt=I.current.get(gt))==null||kt.abort();const it=new AbortController;I.current.set(gt,it);try{const ct=await AFe(()=>Gx(We.runtimeId,We.region,{retryProbe:!0,signal:it.signal,timeoutMs:NWt,currentVersion:We.currentVersion}));if(it.signal.aborted)return;ke(Kt=>({...Kt,[gt]:ct&&ct.length>0?{status:"compatible",message:E("myAgents.compatibility.supported")}:{status:"unsupported",message:E("myAgents.compatibility.empty")}}))}catch(ct){if(it.signal.aborted||qse(ct))return;ke(Kt=>({...Kt,[gt]:Wse(ct,E)}))}finally{I.current.get(gt)===it&&I.current.delete(gt)}},[E]),ft=p.useCallback(Ie=>{const We=Ie.runtime;!r||!We||ye(Ie)||eF({runtimeId:We.runtimeId,region:We.region,appName:Ie.appName,currentVersion:We.currentVersion})},[r,ye]),pt=p.useMemo(()=>{const Ie=B.trim().toLocaleLowerCase(),We=m==="general"?[...Ze,...Q]:G,it=(H==="mine"?We.filter(dn=>dn.isMine):We).filter(dn=>{var Ge;const Xt=((Ge=dn.runtime)==null?void 0:Ge.region)??dn.region;return!Xt||Xt===F}),kt=Ie?it.filter(dn=>dn.name.toLocaleLowerCase().includes(Ie)):it;if(m!=="general")return kt;const ct=y.size>0?kt.filter(dn=>!dn.runtime||!y.has(dn.runtime.runtimeId)):kt,Kt=ct.findIndex(dn=>{var Xt;return((Xt=dn.runtime)==null?void 0:Xt.runtimeId)===v});return Kt<=0?ct:[ct[Kt],...ct.slice(0,Kt),...ct.slice(Kt+1)]},[m,v,Ze,y,B,H,F,Q,G]);p.useEffect(()=>{if(!r||m!=="general")return;const Ie=pt.filter(ct=>!!ct.runtime).filter(ct=>!ye(ct)).slice(0,RWt);if(Ie.length===0)return;let We=!1,gt=0;const it=async()=>{for(;!We;){const ct=Ie[gt];if(gt+=1,!(ct!=null&&ct.runtime)||(await eF({runtimeId:ct.runtime.runtimeId,region:ct.runtime.region,appName:ct.appName,currentVersion:ct.runtime.currentVersion}),We))return}},kt=window.setTimeout(()=>{for(let ct=0;ct{We=!0,window.clearTimeout(kt)}},[m,r,ye,pt]);const Pe=E(`myAgents.agentTypes.${m}`,{defaultValue:E("myAgents.agent")}),yt=m==="general"?Y&&Q.length===0&&Ze.length===0:de&&G.length===0,jt=!yt&&pt.length===0,ln=(m==="general"?n:i)?m==="general"?()=>a(F):()=>d(m):void 0,qe=m==="codex"&&i&&!!l;return o.jsxs(Bf,{className:"my-agents-page","aria-label":E("myAgents.agent"),children:[o.jsx(e0,{title:E("myAgents.agent"),className:"my-agents-header"}),o.jsxs(t0,{className:"my-agent-toolbar",children:[o.jsx(n0,{idPrefix:"my-agent-ownership",ariaLabel:E("myAgents.creatorFilter"),value:H,items:[{id:"all",label:E("common.all"),disabled:s==="mine"},{id:"mine",label:E("agentSelector.createdByMe")}],onChange:Nt}),o.jsxs("div",{className:"resource-toolbar__actions",children:[o.jsx(hg,{id:"my-agent-type-filter",ariaLabel:E("myAgents.agentType"),value:m,options:xe,onChange:De}),o.jsx(hg,{id:"my-agent-region-filter",ariaLabel:E("myAgents.region"),value:F,options:Ke,onChange:Ot}),o.jsx(hp,{className:"my-agent-search","aria-label":E("myAgents.searchAgents"),value:B,onChange:Ie=>M(Ie.target.value),placeholder:E("common.search")}),qe?o.jsxs("button",{type:"button",className:"my-agent-create-secondary",onClick:l,children:[o.jsx($Wt,{}),o.jsx("span",{children:E("myAgents.handoff")})]}):null]})]}),o.jsxs(Dg,{className:"my-agent-results",ref:R,"aria-label":E("myAgents.agentList",{type:Pe}),children:[yt?o.jsx(Ka,{}):(m==="general"?Ee:le)&&pt.length===0?o.jsxs("div",{className:"my-agent-empty",role:"alert",children:[o.jsx("p",{children:m==="general"?Ee:le}),o.jsx("button",{type:"button",onClick:()=>{m==="general"?Ae("",!0):He(m)},children:E("common.reload")})]}):jt&&!ln?B.trim()||H==="mine"||F!==D?o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(Rn,{fill:"none",children:[o.jsx(Rn.Icon,{children:o.jsx(Tit,{})}),o.jsx(Rn.Title,{children:E("myAgents.noMatchingAgents")}),o.jsx(Rn.Description,{children:E("myAgents.adjustSearch")})]})}):m!=="general"?o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(Rn,{fill:"none",children:[o.jsx(Rn.Icon,{children:o.jsx(FWt,{type:m})}),o.jsx(Rn.Title,{className:"my-agent-sandbox-empty-title",children:E("myAgents.noAgentType",{type:Pe})})]})}):o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(Rn,{fill:"none",children:[o.jsx(Rn.Icon,{children:o.jsx(Bh,{})}),o.jsx(Rn.Title,{children:E("myAgents.noGeneralAgents")}),o.jsx(Rn.Description,{children:E("myAgents.createGeneralAgentDescription")})]})}):o.jsxs(o.Fragment,{children:[m==="general"&&Ee?o.jsxs("div",{className:"my-agent-inline-error",role:"alert",children:[o.jsx("span",{children:Ee}),o.jsx("button",{type:"button",onClick:()=>void Ae("",!0),children:E("common.reload")})]}):null,o.jsxs(i0,{className:"my-agent-grid",children:[ln?o.jsx(pg,{className:"my-agent-create-card","aria-label":E("myAgents.createAgentType",{type:Pe}),onClick:ln,icon:o.jsx(MWt,{}),children:E("myAgents.createAgent")}):null,pt.map(Ie=>{var gt,it,kt,ct,Kt;const We=zWt(Ie,Q,E);return o.jsx(qWt,{agent:Ie,onReview:L,deploymentTask:ye(Ie),nowMs:ve,onViewDeploymentTask:S,onUse:vt,compatibility:Ie.runtime?Ue[cb(Ie)]??{status:"checking",message:E("myAgents.compatibility.checking")}:void 0,onRetryCompatibility:Tt,onPrepareUpdate:((gt=Ie.runtime)==null?void 0:gt.canManage)===!1||((it=Ie.runtime)==null?void 0:it.visibility)==="enterprise"||((kt=Ie.runtime)==null?void 0:kt.reviewStatus)==="pending"?void 0:ft,onViewDetails:We&&((ct=Ie.runtime)==null?void 0:ct.canManage)!==!1?()=>{We.sandbox?h(We.sandbox):u(We)}:void 0,connecting:Ie.id===ce,connectError:Me[Ie.id],connected:((Kt=Ie.runtime)==null?void 0:Kt.runtimeId)===v,onEditDraft:k,onDeleteDraft:re},Ie.id)})]})]}),m==="general"&&!Ee&&!yt&&(pt.length>0||!!ne)&&o.jsx("div",{className:"my-agent-load-more",ref:A,"aria-live":"polite",children:Y?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:E("myAgents.loadingMore")})]}):ne?o.jsx("span",{children:E("myAgents.scrollForMore")}):o.jsx("span",{children:E("myAgents.allLoaded")})})]}),P!=null&&P.runtime?o.jsx(TFe,{runtimeId:P.runtime.runtimeId,region:P.runtime.region,name:P.name,canPublish:P.runtime.canPublish===!0,onClose:()=>L(null),onChanged:()=>{Cb(),Ae("",!0)}},`${P.runtime.region}:${P.runtime.runtimeId}`):null,je?o.jsx(Xu,{title:E("myAgents.deleteDraftTitle"),description:E("myAgents.deleteDraftDescription",{name:je.draft.name||E("agentSelector.unnamedAgent")}),confirmLabel:E("myAgents.deleteDraft"),variant:"danger",onCancel:()=>re(null),onConfirm:()=>{C==null||C(je),re(null)}}):null]})}function fq({section:e,onWorkspace:t,onEnvironment:n,onProjects:i,actions:r,children:s,className:a=""}){const{t:l}=_e("ui"),c=l(e==="workspaces"?"workspace.title":e==="environments"?"common.environment":"workspace.codeProjects");return o.jsxs(Bf,{className:`workspace-center ${a}`,"aria-label":c,children:[o.jsx(e0,{title:c}),o.jsxs(t0,{children:[(t||n)&&o.jsx(n0,{items:[{id:"workspaces",label:l("workspace.title")},{id:"environments",label:l("common.environment")},...i?[{id:"projects",label:l("workspace.codeProjects")}]:[]],value:e,onChange:u=>{u==="workspaces"&&(t==null||t()),u==="environments"&&(n==null||n()),u==="projects"&&(i==null||i())},ariaLabel:l("workspace.resourceType"),idPrefix:"workspace-center"}),o.jsx("div",{className:"resource-toolbar__actions",children:r})]}),s]})}const KWt="_Container_13560_1",GWt="_Textarea_13560_174",Gse={Container:KWt,Textarea:GWt},Eg=e=>{const t=p.useRef(null),i=`search-ui-input-${p.useId()}`,{id:r,name:s,variant:a="outline",size:l="md",gutterSize:c,className:u,autoComplete:d,disabled:f=!1,readOnly:h=!1,invalid:m=!1,allowAutofillExtensions:g=!!s,onFocus:b,onBlur:v,onAnimationStart:y,onAutofill:w,autoSelect:x,rows:O=3,maxRows:S,autoResize:k,ref:C,onChange:E,...R}=e,[A,N]=p.useState(!1),T=k?Math.max(S??10,O):O;p.useEffect(()=>{var I;x&&((I=t.current)==null||I.select())},[x]);const j=I=>{y==null||y(I),I.animationName==="native-autofill-in"&&(w==null||w())},_=p.useCallback(()=>{if(!k||!t.current||T===void 0)return;t.current.style.height="0px";const I=t.current.scrollHeight;t.current.style.height=I+"px"},[k,T]);return p.useEffect(()=>{_()},[e.value,O,_]),o.jsx("div",{className:ji(Gse.Container,u),"data-variant":a,"data-size":l,"data-gutter-size":c,"data-focused":A,"data-disabled":f?"":void 0,"data-readonly":h?"":void 0,"data-invalid":m?"":void 0,style:Gy({"textarea-min-rows":`${O}`,"textarea-max-rows":`${T}`}),children:o.jsx("textarea",{...R,onChange:I=>{E==null||E(I),_()},ref:$C([t,C]),id:r||(g?void 0:i),className:Gse.Textarea,name:s,readOnly:h,disabled:f,rows:O,onFocus:I=>{N(!0),b==null||b(I)},onBlur:I=>{N(!1),v==null||v(I)},onAnimationStart:j,"data-lpignore":g?void 0:!0,"data-1p-ignore":g?void 0:!0})})},JD="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",XWt="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",YWt="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",ZWt="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",JWt="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",eKt="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",tKt="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",nKt="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",iKt="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",rKt="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 hq(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"})})}Ha.registerLanguage("bash",rD);const sKt=48;function oKt(e,t=sKt){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function aKt(e){return Ha.highlight(e,{language:"bash",ignoreIllegals:!0}).value}function lKt({status:e}){return e==="succeeded"?o.jsx(Ud,{"aria-hidden":!0}):e==="failed"?o.jsx(pF,{"aria-hidden":!0}):e==="running"?o.jsx(Bi,{className:"studio-build-progress__spinner","aria-hidden":!0}):o.jsx(Xit,{"aria-hidden":!0})}function Xse(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 cKt({steps:e,log:t,logError:n="",logTruncated:i=!1,logUpdatedAt:r,loading:s=!1}){const{t:a,i18n:l}=_e("ui"),c=p.useRef(null),u=p.useRef(!0),[d,f]=p.useState(!1),h=p.useMemo(()=>aKt(t),[t]);p.useEffect(()=>{const g=c.current;g&&t&&u.current&&(g.scrollTop=g.scrollHeight)},[t]);const m=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(lKt,{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"):"",Xse(r,l.resolvedLanguage??l.language)?` · ${Xse(r,l.resolvedLanguage??l.language)}`:""]})]}),o.jsxs(It,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:!t,onClick:()=>void m(),"aria-label":a(d?"studioBuildProgress.copiedLog":"studioBuildProgress.copyLog"),children:[d?o.jsx(Ud,{"aria-hidden":!0}):o.jsx(gP,{"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=oKt(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 Yse({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(jit,{}):o.jsx(Iit,{})})]})}function ub(e,t){return e[t]|e[t+1]<<8}function X0(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function uKt(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 _Fe(e,t={}){let i=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(X0(e,u)===101010256){i=u;break}if(i<0)throw new Error(Gt("helpers.zip.invalid"));const r=ub(e,i+10);if(t.maxEntries!==void 0&&r>t.maxEntries)throw new Error(Gt("helpers.zip.tooManyFiles",{count:t.maxEntries}));let s=X0(e,i+16);const a=new TextDecoder("utf-8"),l=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error(Gt("helpers.zip.tooLarge"));const w=ub(e,v+26),x=ub(e,v+28),O=v+30+w+x,S=e.subarray(O,O+f);let k;if(d===0)k=S;else if(d===8)k=await uKt(S);else{s+=46+m+g+b;continue}l.push({name:y,text:a.decode(k)}),s+=46+m+g+b}return l}const i9=/(^|\/)skill\.md$/i;function dKt(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 oKt(...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 aKt(e,t){return t.trim()||e}function kFe(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 lKt(e){const t=new Map,n=new Set;for(const i of e)if(i9.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=i9.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 cKt(e,t,n){const i=`${n}${e?"/"+e:""}`,r=t.find(c=>i9.test("/"+c.path));if(!r)return{hit:null,error:Wt("helpers.skills.missingManifest",{location:i})};const s=rKt(r.text),a=oKt(s.name,e,n.replace(/\.[^.]+$/,"")),l=[];for(const c of t){if(c.path.split("/").some(f=>f===".."))return{hit:null,error:Wt("helpers.skills.invalidParentPath",{location:i,path:c.path})};const d=`skills/${a}/${c.path}`;if(!d.startsWith(`skills/${a}/`))return{hit:null,error:Wt("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:aKt(a,s.name),description:s.description||Wt("helpers.skills.localDescription"),folder:a,localFiles:l},error:null}}async function uKt(e){const t=new Uint8Array(await e.arrayBuffer()),i=(await OFe(t)).map(r=>({path:r.name,text:r.text}));return SFe(kFe(i),e.name)}async function dKt(e,t=new Map){const n=[];for(let i=0;ie.file(t,n))}async function hKt(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 EFe(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await fKt(e),path:n}];if(!e.isDirectory)return[];const i=await hKt(e);return(await Promise.all(i.map(r=>EFe(r,n)))).flat()}function pKt({selected:e,onChange:t}){const{t:n}=je("create"),[i,r]=p.useState([]),[s,a]=p.useState([]),[l,c]=p.useState(!1),[u,d]=p.useState(!1),f=p.useRef(0),h=O=>e.some(S=>S.source==="local"&&S.folder===O),m=O=>{O.localFiles&&(h(O.folder||O.name)?t(e.filter(S=>!(S.source==="local"&&S.folder===(O.folder||O.name)))):t([...e,{source:"local",folder:O.folder||O.name,name:O.name,description:O.description,localFiles:O.localFiles}]))},g=p.useRef([]),b=p.useRef(e);p.useEffect(()=>{g.current=s},[s]),p.useEffect(()=>{b.current=e},[e]);const v=O=>{const S=new Set([...g.current.map(R=>R.folder||R.name),...b.current.filter(R=>R.source==="local").map(R=>R.folder)]),k=[],C=[];for(const R of O.hits){const A=R.folder||R.name;if(S.has(A)){k.push(R.name);continue}S.add(A),C.push(R)}a(R=>[...R,...C]);const E=[...O.errors];if(k.length>0&&E.push(n("skills.local.duplicatesSkipped",{names:k.join(", ")})),r(E),C.length===1&&O.errors.length===0&&k.length===0){const R=C[0];R.localFiles&&t([...b.current,{source:"local",folder:R.folder||R.name,name:R.name,description:R.description,localFiles:R.localFiles}])}},y=O=>{O.preventDefault(),f.current+=1,d(!0)},w=O=>{O.preventDefault(),f.current=Math.max(0,f.current-1),f.current===0&&d(!1)},x=async O=>{if(O.preventDefault(),f.current=0,d(!1),l)return;const S=Array.from(O.dataTransfer.items).map(k=>{var C;return(C=k.webkitGetAsEntry)==null?void 0:C.call(k)}).filter(k=>k!==null);if(S.length===0){r([n("skills.local.invalidDrop")]);return}c(!0);try{const k=(await Promise.all(S.map(R=>EFe(R)))).flat(),C=S.some(R=>R.isDirectory);if(!C&&k.length===1&&k[0].file.name.toLowerCase().endsWith(".zip")){v(await uKt(k[0].file));return}if(!C){r([n("skills.local.invalidDrop")]);return}const E=new Map(k.map(({file:R,path:A})=>[R,A]));v(await dKt(k.map(({file:R})=>R),E))}catch(k){r([n("skills.local.readError",{detail:k instanceof Error?k.message:String(k)})])}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:O=>O.preventDefault(),onDragLeave:w,onDrop:O=>void x(O),children:[o.jsx(bQ,{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(Hf,{className:"cw-i"}),o.jsx("span",{children:i.join(";")})]}),s.length>0&&o.jsx("div",{className:"cw-skill-results",children:s.map(O=>{var k;const S=h(O.folder||O.name);return o.jsxs("button",{type:"button",className:`cw-skill-result ${S?"is-on":""}`,onClick:()=>m(O),"aria-pressed":S,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:S?o.jsx(Bd,{className:"cw-i cw-i-sm"}):o.jsx(jl,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:O.name}),O.description&&o.jsx("span",{className:"cw-skill-result-desc",children:eC(O.description)}),o.jsx("span",{className:"cw-skill-result-repo",children:n("skills.local.fileCount",{count:((k=O.localFiles)==null?void 0:k.length)??0})})]})]},O.id)})})]})}const mKt="/harness/skills/findskill";async function gKt(e,t="public"){const n=e.trim(),i=new URLSearchParams({query:n,page_number:"1",page_size:"20"}),r=`${mKt}?${i.toString()}`,s=await fetch(r,{headers:{accept:"application/json"},signal:Wa(void 0,qa)});if(!s.ok)throw new Error(Wt("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 bKt({selected:e,onChange:t}){const{t:n}=je("create"),[i,r]=p.useState(""),[s,a]=p.useState([]),[l,c]=p.useState(!1),[u,d]=p.useState(null),[f,h]=p.useState(!1),m=v=>e.some(y=>y.source==="skillhub"&&y.slug===v),g=v=>{v.slug&&(m(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 gKt(v);a(y)}catch(y){d(y instanceof Error?y.message:n("skills.hub.searchError")),a([])}finally{c(!1)}};return p.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(PN,{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(Mi,{className:"cw-i cw-spin"}):o.jsx(PN,{className:"cw-i"}),n("skills.hub.search")]})]}),u&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(Hf,{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(Mi,{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=m(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(Bd,{className:"cw-i cw-i-sm"}):o.jsx(jl,{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:eC(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 yKt({selected:e,onChange:t,cloudProvider:n="volcengine"}){const{t:i}=je("create"),[r,s]=p.useState([]),[a,l]=p.useState([]),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(null);p.useEffect(()=>{let O=!1;return(async()=>{f(!0),b(null);try{const S=await $Me();O||(s(S),S.length>0&&u(S[0].id))}catch(S){O||b(S instanceof Error?S.message:i("skills.space.loadError"))}finally{O||f(!1)}})(),()=>{O=!0}},[i]),p.useEffect(()=>{if(!c){l([]);return}const O=r.find(k=>k.id===c);let S=!1;return(async()=>{m(!0),b(null);try{const k=await FMe(c,O==null?void 0:O.region);S||l(k)}catch(k){S||b(k instanceof Error?k.message:i("skills.space.loadError"))}finally{S||m(!1)}})(),()=>{S=!0}},[c,r,i]);const v=r.find(O=>O.id===c),y=v?hDt(v.id,v.region,n):"",w=(O,S)=>e.some(k=>k.source==="skillspace"&&k.skillId===O&&(k.version||"")===S),x=O=>{if(!v)return;const S=Fb(O);if(w(S,O.version))t(e.filter(k=>!(k.source==="skillspace"&&k.skillId===S&&(k.version||"")===O.version)));else{const k=fDt(v,O);t([...e,{source:"skillspace",folder:k.folder||O.skillName,name:k.name,description:k.description,skillSpaceId:k.skillSpaceId,skillSpaceName:k.skillSpaceName,skillSpaceRegion:k.skillSpaceRegion,skillId:k.skillId,version:k.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(Mi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSpaces")]}):g?o.jsxs("div",{className:"cw-banner",children:[o.jsx(Hf,{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:O=>u(O.target.value),"aria-label":i("skills.space.selectSpace"),children:r.map(O=>o.jsxs("option",{value:O.id,children:[oc(O)||O.id,O.description?` — ${eC(O.description)}`:""]},O.id))}),v&&o.jsxs(o.Fragment,{children:[v.region&&o.jsx("span",{className:"cw-skillspace-region-label",title:v.region,children:Lf(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(xy,{className:"cw-i cw-i-sm"})})]})]}),h?o.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[o.jsx(Mi,{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(O=>{const S=Fb(O),k=w(S,O.version);return o.jsxs("button",{type:"button",className:`cw-skill-result ${k?"is-on":""}`,onClick:()=>x(O),"aria-pressed":k,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:k?o.jsx(Bd,{className:"cw-i cw-i-sm"}):o.jsx(jl,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsxs("span",{className:"cw-skill-result-name",children:[O.skillName,O.version&&o.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",O.version]})]}),O.skillDescription&&o.jsx("span",{className:"cw-skill-result-desc",children:eC(O.skillDescription)}),o.jsxs("span",{className:"cw-skill-result-repo",children:[o.jsx(Vit,{className:"cw-i cw-i-sm"})," ",oc(v)||c]})]})]},`${S}/${O.version}`)})})]})})}function CFe({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 S4(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 vKt(e){return e.source==="runtime"?"skillSourcePicker.sources.runtime":e.source==="local"?"skillSourcePicker.sources.local":e.source==="skillspace"?"skillSourcePicker.sources.skillspace":"skillSourcePicker.sources.skillhub"}function xKt({skill:e,onRemove:t,disabled:n}){const{t:i}=je("ui");let r=ZS;e.source==="local"||e.source==="runtime"?r=bQ:e.source==="skillspace"&&(r=CFe);const s=`${i(vKt(e))}${e.description?` · ${eC(e.description)}`:""}`;return o.jsxs(cr.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(Oa,{className:"cw-i cw-i-sm"})})]})}const E4=[{id:"local",labelKey:"skillSourcePicker.tabs.local",shortLabelKey:"skillSourcePicker.tabs.localShort",icon:bQ},{id:"skillspace",labelKey:"skillSourcePicker.tabs.skillspace",shortLabelKey:"skillSourcePicker.tabs.skillspaceShort",icon:CFe},{id:"skillhub",labelKey:"skillSourcePicker.tabs.skillhub",shortLabelKey:"skillSourcePicker.tabs.skillhubShort",icon:bP}];function pq({selected:e,onChange:t,cloudProvider:n,disabled:i=!1,addLabel:r,showSelectedCount:s=!0}){const{t:a}=je("ui"),[l,c]=p.useState("local"),[u,d]=p.useState(!1),f=p.useId(),h=p.useId(),m=p.useRef(null),g=E4.findIndex(w=>w.id===l),b=r??a("skillSourcePicker.addSkill");p.useEffect(()=>{var S;if(!u)return;const w=document.body.style.overflow,x=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(S=m.current)==null||S.focus();const O=k=>{k.key==="Escape"&&d(!1)};return window.addEventListener("keydown",O),()=>{document.body.style.overflow=w,window.removeEventListener("keydown",O),x!=null&&x.isConnected&&x.focus()}},[u]);const v=(w,x)=>{x.source==="runtime"&&!window.confirm(a("skillSourcePicker.confirmRemoveRuntime",{name:x.name}))||t(e.filter(O=>S4(O)!==w))},y=w=>{const x=new Set(w.filter(O=>O.source!=="runtime").map(O=>O.folder));t(w.filter(O=>O.source!=="runtime"||!x.has(O.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(jl,{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(Ad,{initial:!1,children:e.map(w=>o.jsx(xKt,{skill:w,disabled:i,onRemove:()=>v(S4(w),w)},S4(w)))})})]}),si.createPortal(o.jsx(Ad,{children:u&&o.jsx(cr.div,{className:"cw-skill-dialog-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},onMouseDown:w=>{w.target===w.currentTarget&&d(!1)},children:o.jsxs(cr.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:m,type:"button",className:"cw-skill-dialog-close","aria-label":a("skillSourcePicker.close",{label:b}),onClick:()=>d(!1),children:o.jsx(Oa,{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) / ${E4.length})`,"--cw-active-skill-tab-offset":`calc(${g*100}% + ${g*4}px)`},children:[o.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":"true"}),E4.map(({id:w,labelKey:x,shortLabelKey:O,icon:S})=>o.jsxs("button",{type:"button",role:"tab",id:`${h}-${w}`,"aria-controls":h,"aria-selected":l===w,className:`cw-skill-pickertab ${l===w?"is-on":""}`,onClick:()=>c(w),children:[o.jsx(S,{className:"cw-i cw-i-sm"}),o.jsx("span",{className:"cw-skill-tab-label-full",children:a(x)}),o.jsx("span",{className:"cw-skill-tab-label-short",children:a(O)})]},w))]}),o.jsxs("div",{id:h,className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`${h}-${l}`,children:[l==="skillhub"&&o.jsx(bKt,{selected:e,onChange:y}),l==="local"&&o.jsx(pKt,{selected:e,onChange:y}),l==="skillspace"&&o.jsx(yKt,{selected:e,onChange:y,cloudProvider:n})]})]})]})})}),document.body)]})}const TFe=128*1024,wKt={baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"};function _x(e,t){return(t==null?void 0:t(`environmentCenter.dockerfileValidation.${e}`))??wKt[e]}function JD(e){return e.replace(/^\uFEFF/,"").replace(/\r\n?/g,` -`)}function AFe(e){return new TextEncoder().encode(e).byteLength}function OKt(e,t="ubuntu:22.04"){const n=JD(e).match(/^\s*FROM(?:\s+--platform=\S+)?\s+(\S+)/im);return(n==null?void 0:n[1])??t}function kKt(e){const t=JD(e).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 hKt(...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 pKt(e,t){return t.trim()||e}function jFe(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 mKt(e){const t=new Map,n=new Set;for(const i of e)if(i9.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=i9.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 gKt(e,t,n){const i=`${n}${e?"/"+e:""}`,r=t.find(c=>i9.test("/"+c.path));if(!r)return{hit:null,error:Gt("helpers.skills.missingManifest",{location:i})};const s=dKt(r.text),a=hKt(s.name,e,n.replace(/\.[^.]+$/,"")),l=[];for(const c of t){if(c.path.split("/").some(f=>f===".."))return{hit:null,error:Gt("helpers.skills.invalidParentPath",{location:i,path:c.path})};const d=`skills/${a}/${c.path}`;if(!d.startsWith(`skills/${a}/`))return{hit:null,error:Gt("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:pKt(a,s.name),description:s.description||Gt("helpers.skills.localDescription"),folder:a,localFiles:l},error:null}}async function bKt(e){const t=new Uint8Array(await e.arrayBuffer()),i=(await _Fe(t)).map(r=>({path:r.name,text:r.text}));return NFe(jFe(i),e.name)}async function yKt(e,t=new Map){const n=[];for(let i=0;ie.file(t,n))}async function xKt(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 RFe(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await vKt(e),path:n}];if(!e.isDirectory)return[];const i=await xKt(e);return(await Promise.all(i.map(r=>RFe(r,n)))).flat()}function wKt({selected:e,onChange:t}){const{t:n}=_e("create"),[i,r]=p.useState([]),[s,a]=p.useState([]),[l,c]=p.useState(!1),[u,d]=p.useState(!1),f=p.useRef(0),h=O=>e.some(S=>S.source==="local"&&S.folder===O),m=O=>{O.localFiles&&(h(O.folder||O.name)?t(e.filter(S=>!(S.source==="local"&&S.folder===(O.folder||O.name)))):t([...e,{source:"local",folder:O.folder||O.name,name:O.name,description:O.description,localFiles:O.localFiles}]))},g=p.useRef([]),b=p.useRef(e);p.useEffect(()=>{g.current=s},[s]),p.useEffect(()=>{b.current=e},[e]);const v=O=>{const S=new Set([...g.current.map(R=>R.folder||R.name),...b.current.filter(R=>R.source==="local").map(R=>R.folder)]),k=[],C=[];for(const R of O.hits){const A=R.folder||R.name;if(S.has(A)){k.push(R.name);continue}S.add(A),C.push(R)}a(R=>[...R,...C]);const E=[...O.errors];if(k.length>0&&E.push(n("skills.local.duplicatesSkipped",{names:k.join(", ")})),r(E),C.length===1&&O.errors.length===0&&k.length===0){const R=C[0];R.localFiles&&t([...b.current,{source:"local",folder:R.folder||R.name,name:R.name,description:R.description,localFiles:R.localFiles}])}},y=O=>{O.preventDefault(),f.current+=1,d(!0)},w=O=>{O.preventDefault(),f.current=Math.max(0,f.current-1),f.current===0&&d(!1)},x=async O=>{if(O.preventDefault(),f.current=0,d(!1),l)return;const S=Array.from(O.dataTransfer.items).map(k=>{var C;return(C=k.webkitGetAsEntry)==null?void 0:C.call(k)}).filter(k=>k!==null);if(S.length===0){r([n("skills.local.invalidDrop")]);return}c(!0);try{const k=(await Promise.all(S.map(R=>RFe(R)))).flat(),C=S.some(R=>R.isDirectory);if(!C&&k.length===1&&k[0].file.name.toLowerCase().endsWith(".zip")){v(await bKt(k[0].file));return}if(!C){r([n("skills.local.invalidDrop")]);return}const E=new Map(k.map(({file:R,path:A})=>[R,A]));v(await yKt(k.map(({file:R})=>R),E))}catch(k){r([n("skills.local.readError",{detail:k instanceof Error?k.message:String(k)})])}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:O=>O.preventDefault(),onDragLeave:w,onDrop:O=>void x(O),children:[o.jsx(bQ,{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(Tp,{className:"cw-i"}),o.jsx("span",{children:i.join(";")})]}),s.length>0&&o.jsx("div",{className:"cw-skill-results",children:s.map(O=>{var k;const S=h(O.folder||O.name);return o.jsxs("button",{type:"button",className:`cw-skill-result ${S?"is-on":""}`,onClick:()=>m(O),"aria-pressed":S,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:S?o.jsx(Ud,{className:"cw-i cw-i-sm"}):o.jsx(Rl,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:O.name}),O.description&&o.jsx("span",{className:"cw-skill-result-desc",children:eC(O.description)}),o.jsx("span",{className:"cw-skill-result-repo",children:n("skills.local.fileCount",{count:((k=O.localFiles)==null?void 0:k.length)??0})})]})]},O.id)})})]})}const OKt="/harness/skills/findskill";async function kKt(e,t="public"){const n=e.trim(),i=new URLSearchParams({query:n,page_number:"1",page_size:"20"}),r=`${OKt}?${i.toString()}`,s=await fetch(r,{headers:{accept:"application/json"},signal:Xa(void 0,Ga)});if(!s.ok)throw new Error(Gt("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 SKt({selected:e,onChange:t}){const{t:n}=_e("create"),[i,r]=p.useState(""),[s,a]=p.useState([]),[l,c]=p.useState(!1),[u,d]=p.useState(null),[f,h]=p.useState(!1),m=v=>e.some(y=>y.source==="skillhub"&&y.slug===v),g=v=>{v.slug&&(m(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 kKt(v);a(y)}catch(y){d(y instanceof Error?y.message:n("skills.hub.searchError")),a([])}finally{c(!1)}};return p.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(DN,{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(Bi,{className:"cw-i cw-spin"}):o.jsx(DN,{className:"cw-i"}),n("skills.hub.search")]})]}),u&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(Tp,{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(Bi,{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=m(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(Ud,{className:"cw-i cw-i-sm"}):o.jsx(Rl,{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:eC(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 EKt({selected:e,onChange:t,cloudProvider:n="volcengine"}){const{t:i}=_e("create"),[r,s]=p.useState([]),[a,l]=p.useState([]),[c,u]=p.useState(""),[d,f]=p.useState(!0),[h,m]=p.useState(!1),[g,b]=p.useState(null);p.useEffect(()=>{let O=!1;return(async()=>{f(!0),b(null);try{const S=await HMe();O||(s(S),S.length>0&&u(S[0].id))}catch(S){O||b(S instanceof Error?S.message:i("skills.space.loadError"))}finally{O||f(!1)}})(),()=>{O=!0}},[i]),p.useEffect(()=>{if(!c){l([]);return}const O=r.find(k=>k.id===c);let S=!1;return(async()=>{m(!0),b(null);try{const k=await qMe(c,O==null?void 0:O.region);S||l(k)}catch(k){S||b(k instanceof Error?k.message:i("skills.space.loadError"))}finally{S||m(!1)}})(),()=>{S=!0}},[c,r,i]);const v=r.find(O=>O.id===c),y=v?xDt(v.id,v.region,n):"",w=(O,S)=>e.some(k=>k.source==="skillspace"&&k.skillId===O&&(k.version||"")===S),x=O=>{if(!v)return;const S=Bb(O);if(w(S,O.version))t(e.filter(k=>!(k.source==="skillspace"&&k.skillId===S&&(k.version||"")===O.version)));else{const k=vDt(v,O);t([...e,{source:"skillspace",folder:k.folder||O.skillName,name:k.name,description:k.description,skillSpaceId:k.skillSpaceId,skillSpaceName:k.skillSpaceName,skillSpaceRegion:k.skillSpaceRegion,skillId:k.skillId,version:k.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(Bi,{className:"cw-i cw-spin"})," ",i("skills.space.loadingSpaces")]}):g?o.jsxs("div",{className:"cw-banner",children:[o.jsx(Tp,{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:O=>u(O.target.value),"aria-label":i("skills.space.selectSpace"),children:r.map(O=>o.jsxs("option",{value:O.id,children:[ac(O)||O.id,O.description?` — ${eC(O.description)}`:""]},O.id))}),v&&o.jsxs(o.Fragment,{children:[v.region&&o.jsx("span",{className:"cw-skillspace-region-label",title:v.region,children:$f(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(wy,{className:"cw-i cw-i-sm"})})]})]}),h?o.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[o.jsx(Bi,{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(O=>{const S=Bb(O),k=w(S,O.version);return o.jsxs("button",{type:"button",className:`cw-skill-result ${k?"is-on":""}`,onClick:()=>x(O),"aria-pressed":k,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:k?o.jsx(Ud,{className:"cw-i cw-i-sm"}):o.jsx(Rl,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsxs("span",{className:"cw-skill-result-name",children:[O.skillName,O.version&&o.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",O.version]})]}),O.skillDescription&&o.jsx("span",{className:"cw-skill-result-desc",children:eC(O.skillDescription)}),o.jsxs("span",{className:"cw-skill-result-repo",children:[o.jsx(Yit,{className:"cw-i cw-i-sm"})," ",ac(v)||c]})]})]},`${S}/${O.version}`)})})]})})}function IFe({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 E4(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 CKt(e){return e.source==="runtime"?"skillSourcePicker.sources.runtime":e.source==="local"?"skillSourcePicker.sources.local":e.source==="skillspace"?"skillSourcePicker.sources.skillspace":"skillSourcePicker.sources.skillhub"}function TKt({skill:e,onRemove:t,disabled:n}){const{t:i}=_e("ui");let r=ZS;e.source==="local"||e.source==="runtime"?r=bQ:e.source==="skillspace"&&(r=IFe);const s=`${i(CKt(e))}${e.description?` · ${eC(e.description)}`:""}`;return o.jsxs(mr.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(Ta,{className:"cw-i cw-i-sm"})})]})}const C4=[{id:"local",labelKey:"skillSourcePicker.tabs.local",shortLabelKey:"skillSourcePicker.tabs.localShort",icon:bQ},{id:"skillspace",labelKey:"skillSourcePicker.tabs.skillspace",shortLabelKey:"skillSourcePicker.tabs.skillspaceShort",icon:IFe},{id:"skillhub",labelKey:"skillSourcePicker.tabs.skillhub",shortLabelKey:"skillSourcePicker.tabs.skillhubShort",icon:yP}];function pq({selected:e,onChange:t,cloudProvider:n,disabled:i=!1,addLabel:r,showSelectedCount:s=!0}){const{t:a}=_e("ui"),[l,c]=p.useState("local"),[u,d]=p.useState(!1),f=p.useId(),h=p.useId(),m=p.useRef(null),g=C4.findIndex(w=>w.id===l),b=r??a("skillSourcePicker.addSkill");p.useEffect(()=>{var S;if(!u)return;const w=document.body.style.overflow,x=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(S=m.current)==null||S.focus();const O=k=>{k.key==="Escape"&&d(!1)};return window.addEventListener("keydown",O),()=>{document.body.style.overflow=w,window.removeEventListener("keydown",O),x!=null&&x.isConnected&&x.focus()}},[u]);const v=(w,x)=>{x.source==="runtime"&&!window.confirm(a("skillSourcePicker.confirmRemoveRuntime",{name:x.name}))||t(e.filter(O=>E4(O)!==w))},y=w=>{const x=new Set(w.filter(O=>O.source!=="runtime").map(O=>O.folder));t(w.filter(O=>O.source!=="runtime"||!x.has(O.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(Rl,{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(_d,{initial:!1,children:e.map(w=>o.jsx(TKt,{skill:w,disabled:i,onRemove:()=>v(E4(w),w)},E4(w)))})})]}),ri.createPortal(o.jsx(_d,{children:u&&o.jsx(mr.div,{className:"cw-skill-dialog-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},onMouseDown:w=>{w.target===w.currentTarget&&d(!1)},children:o.jsxs(mr.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:m,type:"button",className:"cw-skill-dialog-close","aria-label":a("skillSourcePicker.close",{label:b}),onClick:()=>d(!1),children:o.jsx(Ta,{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) / ${C4.length})`,"--cw-active-skill-tab-offset":`calc(${g*100}% + ${g*4}px)`},children:[o.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":"true"}),C4.map(({id:w,labelKey:x,shortLabelKey:O,icon:S})=>o.jsxs("button",{type:"button",role:"tab",id:`${h}-${w}`,"aria-controls":h,"aria-selected":l===w,className:`cw-skill-pickertab ${l===w?"is-on":""}`,onClick:()=>c(w),children:[o.jsx(S,{className:"cw-i cw-i-sm"}),o.jsx("span",{className:"cw-skill-tab-label-full",children:a(x)}),o.jsx("span",{className:"cw-skill-tab-label-short",children:a(O)})]},w))]}),o.jsxs("div",{id:h,className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`${h}-${l}`,children:[l==="skillhub"&&o.jsx(SKt,{selected:e,onChange:y}),l==="local"&&o.jsx(wKt,{selected:e,onChange:y}),l==="skillspace"&&o.jsx(EKt,{selected:e,onChange:y,cloudProvider:n})]})]})]})})}),document.body)]})}const PFe=128*1024,AKt={baseImageRequired:"请填写基础镜像。",duplicateFrom:"基础镜像已固定在第一行,请删除 Dockerfile 正文中的 FROM 指令。",tooLarge:"Dockerfile 不能超过 128 KiB。",empty:"Dockerfile 内容不能为空。",missingFrom:"Dockerfile 缺少 FROM 指令。"};function _x(e,t){return(t==null?void 0:t(`environmentCenter.dockerfileValidation.${e}`))??AKt[e]}function eM(e){return e.replace(/^\uFEFF/,"").replace(/\r\n?/g,` +`)}function DFe(e){return new TextEncoder().encode(e).byteLength}function _Kt(e,t="ubuntu:22.04"){const n=eM(e).match(/^\s*FROM(?:\s+--platform=\S+)?\s+(\S+)/im);return(n==null?void 0:n[1])??t}function jKt(e){const t=eM(e).split(` `),n=t.findIndex(i=>/^\s*FROM(?:\s|$)/i.test(i));return(n>=0?t.slice(n+1):t).join(` -`).replace(/^\n+/,"")}function jj(e,t){const n=`FROM ${e.trim()}`,i=JD(t).replace(/^\n+/,"");return i?`${n} -${i}`:n}function SKt(e,t,n){return t.trim()?/^\s*FROM(?:\s|$)/im.test(e)?_x("duplicateFrom",n):mq(jj(t,e),void 0,n):_x("baseImageRequired",n)}function mq(e,t=AFe(e),n){return t>TFe?_x("tooLarge",n):e.trim()?/^\s*FROM\s+\S+/im.test(e)?"":_x("missingFrom",n):_x("empty",n)}async function EKt(e,t){if(e.size>TFe)return{content:"",error:_x("tooLarge",t)};const n=JD(await e.text());return{content:n,error:mq(n,e.size,t)}}function CKt(e){return TD(e,{lineWidth:0})}function TKt(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 _Fe={tos:{mode:"auto"},cr:{mode:"auto"},codePipeline:{mode:"auto"}};function Ah(e){const[t,n]=p.useState([]),[i,r]=p.useState(""),[s,a]=p.useState(1),[l,c]=p.useState(0),[u,d]=p.useState(!1),[f,h]=p.useState(!1),[m,g]=p.useState(null),[b,v]=p.useState(""),[y,w]=p.useState(""),[x,O]=p.useState(""),[S,k]=p.useState(0),C=p.useRef(!1),E=p.useRef(null),R=e?JSON.stringify(e):"",A=e?JSON.stringify({...e,search:y}):"";p.useEffect(()=>{const D=window.setTimeout(()=>{w(b.trim())},250);return()=>window.clearTimeout(D)},[b]),p.useEffect(()=>{v(""),w("")},[R]);const j=p.useCallback((D,M)=>{var B;if(!A)return;(B=E.current)==null||B.abort();const P=new AbortController;E.current=P;const L=JSON.parse(A);M&&n([]),C.current=!0,h(!0),g(null),rCe({...L,pageNumber:D,pageSize:100},P.signal).then(I=>{n(z=>{if(M)return I.items;const K=new Set(z.map(F=>`${F.id}\0${F.name}`));return[...z,...I.items.filter(F=>!K.has(`${F.id}\0${F.name}`))]}),r(I.serviceRegion),a(I.pageNumber),c(I.totalCount),d(I.hasMore),O(A)}).catch(I=>{I instanceof DOMException&&I.name==="AbortError"||(O(A),g(I instanceof Error?I.message:String(I)))}).finally(()=>{E.current===P&&(E.current=null,C.current=!1,h(!1))})},[A]);p.useEffect(()=>{var D;if(!A){(D=E.current)==null||D.abort(),E.current=null,C.current=!1,n([]),r(""),a(1),c(0),d(!1),O(""),h(!1),g(null);return}return j(1,!0),()=>{var M;return(M=E.current)==null?void 0:M.abort()}},[j,A,S]);const T=!!A&&x===A&&b.trim()===y,N=p.useCallback(()=>{O(""),k(D=>D+1)},[]),_=p.useCallback(()=>{!T||C.current||!u||j(s+1,!1)},[u,j,s,T]);return{items:t,serviceRegion:i,totalCount:l,hasMore:T?u:!1,loading:!!A&&(!T||f),error:m,search:b,setSearch:v,reload:N,loadMore:_}}function AKt(e,t){return e.map(n=>({value:n[t],label:n.name,description:[n.status,n.region,n.id].filter(Boolean).join(" · ")}))}function _h({ariaLabel:e,value:t,valueLabel:n,state:i,disabled:r,disabledMessage:s,valueField:a="id",onChange:l}){const{t:c}=je("ui"),u=p.useMemo(()=>AKt(i.items,a),[i.items,a]);return o.jsxs("div",{className:"pp-resource-picker",children:[o.jsx(jg,{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 jFe({region:e,value:t,disabled:n=!1,onChange:i}){const{t:r}=je("ui"),s=Ah(e?{kind:"cr-registry",region:e}:null),a=Ah(e&&(t!=null&&t.registry)?{kind:"cr-namespace",region:e,registry:t.registry}:null),l=Ah(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(_h,{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(_h,{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(_h,{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 C4({resource:e,value:t,disabled:n,onChange:i}){const{t:r}=je("ui");return o.jsxs("label",{className:"pp-resource-field pp-resource-mode",children:[o.jsx("span",{children:r("deploymentResources.configurationMode")}),o.jsx(jg,{ariaLabel:r("deploymentResources.configurationModeAriaLabel",{resource:e}),value:t,placeholder:r("deploymentResources.selectConfigurationMode"),options:TKt(r),disabled:n,onChange:s=>i(s)})]})}function X0({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 T4({items:e,note:t}){const{t:n}=je("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 NFe(e){var t,n,i,r,s,a,l,c;return e.tos.mode!=="auto"&&!((t=e.tos.bucket)!=null&&t.trim())?hn.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()))?hn.t("ui:deploymentResources.validation.cr"):e.codePipeline.mode!=="auto"&&(!((s=e.codePipeline.workspaceName)!=null&&s.trim())||!((a=e.codePipeline.pipelineName)!=null&&a.trim()))?hn.t("ui:deploymentResources.validation.codePipeline"):e.codePipeline.mode==="existing"&&(!((l=e.codePipeline.workspaceId)!=null&&l.trim())||!((c=e.codePipeline.pipelineId)!=null&&c.trim()))?hn.t("ui:deploymentResources.validation.existingCodePipeline"):null}function RFe({value:e,agentName:t,runtimeName:n,region:i,disabled:r,validationError:s,onChange:a}){const{t:l}=je("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=Ah(e.tos.mode==="existing"?{kind:"tos-bucket",region:i}:null),h=Ah(e.cr.mode==="existing"?{kind:"cr-registry",region:i}:null),m=Ah(e.cr.mode==="existing"&&e.cr.instance?{kind:"cr-namespace",region:i,registry:e.cr.instance}:null),g=Ah(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=Ah(e.codePipeline.mode==="existing"?{kind:"cp-workspace",region:i}:null),v=Ah(e.codePipeline.mode==="existing"&&e.codePipeline.workspaceId?{kind:"cp-pipeline",region:i,workspaceId:e.codePipeline.workspaceId}:null),y=w=>a({...e,...w});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(C4,{resource:l("deploymentResources.tosBucket"),value:e.tos.mode,disabled:r,onChange:w=>y({tos:{mode:w}})}),e.tos.mode==="create"&&o.jsx(X0,{label:l("deploymentResources.bucketName"),value:e.tos.bucket??"",placeholder:l("deploymentResources.bucketNamePlaceholder"),disabled:r,onChange:w=>y({tos:{...e.tos,bucket:w}})}),e.tos.mode==="existing"&&o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.existingBucket")}),o.jsx(_h,{ariaLabel:l("deploymentResources.existingTosBucket"),value:e.tos.bucket??"",valueLabel:e.tos.bucket,state:f,disabled:r,onChange:w=>y({tos:{...e.tos,bucket:w.name}})})]}),e.tos.mode==="auto"&&o.jsx(T4,{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(C4,{resource:"CR",value:e.cr.mode,disabled:r,onChange:w=>y({cr:{mode:w}})}),e.cr.mode==="create"&&o.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[o.jsx(X0,{label:l("deploymentResources.instanceName"),value:e.cr.instance??"",placeholder:l("deploymentResources.crInstance"),disabled:r,onChange:w=>y({cr:{...e.cr,instance:w}})}),o.jsx(X0,{label:l("deploymentResources.namespace"),value:e.cr.namespace??"",placeholder:l("deploymentResources.namespace"),disabled:r,onChange:w=>y({cr:{...e.cr,namespace:w}})}),o.jsx(X0,{label:l("deploymentResources.repository"),value:e.cr.repository??"",placeholder:l("deploymentResources.repository"),disabled:r,onChange:w=>y({cr:{...e.cr,repository:w}})})]}),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(_h,{ariaLabel:l("deploymentResources.existingCrInstance"),value:e.cr.instance??"",valueLabel:e.cr.instance,state:h,disabled:r,valueField:"name",onChange:w=>y({cr:{mode:"existing",instance:w.name}})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.namespace")}),o.jsx(_h,{ariaLabel:l("deploymentResources.existingCrNamespace"),value:e.cr.namespace??"",valueLabel:e.cr.namespace,state:m,disabled:r||!e.cr.instance,valueField:"name",onChange:w=>y({cr:{...e.cr,namespace:w.name,repository:void 0}})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.repository")}),o.jsx(_h,{ariaLabel:l("deploymentResources.existingCrRepository"),value:e.cr.repository??"",valueLabel:e.cr.repository,state:g,disabled:r||!e.cr.namespace,valueField:"name",onChange:w=>y({cr:{...e.cr,repository:w.name}})})]})]}),e.cr.mode==="auto"&&o.jsx(T4,{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(C4,{resource:"CodePipeline",value:e.codePipeline.mode,disabled:r,onChange:w=>y({codePipeline:{mode:w}})}),e.codePipeline.mode==="create"&&o.jsxs("div",{className:"pp-resource-fields",children:[o.jsx(X0,{label:l("deploymentResources.workspaceName"),value:e.codePipeline.workspaceName??"",placeholder:l("deploymentResources.workspaceName"),disabled:r,onChange:w=>y({codePipeline:{...e.codePipeline,workspaceName:w}})}),o.jsx(X0,{label:l("deploymentResources.pipelineName"),value:e.codePipeline.pipelineName??"",placeholder:l("deploymentResources.pipelineName"),disabled:r,onChange:w=>y({codePipeline:{...e.codePipeline,pipelineName:w}})})]}),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(_h,{ariaLabel:l("deploymentResources.existingWorkspace"),value:e.codePipeline.workspaceId??"",valueLabel:e.codePipeline.workspaceName,state:b,disabled:r,onChange:w=>y({codePipeline:{mode:"existing",workspaceId:w.id,workspaceName:w.name}})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.compatiblePipeline")}),o.jsx(_h,{ariaLabel:l("deploymentResources.existingPipeline"),value:e.codePipeline.pipelineId??"",valueLabel:e.codePipeline.pipelineName,state:v,disabled:r||!e.codePipeline.workspaceId,onChange:w=>y({codePipeline:{...e.codePipeline,pipelineId:w.id,pipelineName:w.name}})})]})]}),e.codePipeline.mode==="auto"&&o.jsx(T4,{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 _Kt(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 jKt=lIe.map(e=>({value:e.id,label:e.label,description:e.description}));function NKt(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 RKt(e){const t=OKt(e,"");return t===Dz?"aio-sandbox":t.includes("/codexenv:")?"codex-sandbox":"none"}const IKt=JN.map(e=>({value:e.id,label:e.label})),Zse=uIe.map(e=>({value:e.id,label:e.label}));function PKt(e){return[{value:"managed",label:e("environmentCenter.repository.managed")},{value:"existing",label:e("environmentCenter.repository.existing")}]}const r9=20,Jse=new Set;async function DKt(){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 MKt={opencli:VWt,uv:HWt,playwright:qWt,chromium:WWt,git:KWt,curl:GWt,ffmpeg:XWt,imagemagick:YWt};function LKt(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 Od(){return o.jsx("span",{className:"environment-required-mark","aria-hidden":"true",children:"*"})}function $Kt(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 s9(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 eoe(e){return!!(e!=null&&e.region&&e.registry&&e.namespace&&e.repository)}function IFe(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 FKt(e){return(e instanceof Error?e.message:String(e)).split(` -原始响应:`,1)[0].trim()}function BKt(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 UKt({label:e}){return o.jsx("span",{className:"environment-package-fallback",children:e.slice(0,1).toUpperCase()})}function QKt({option:e}){if(e.id==="lark-cli")return o.jsx("img",{src:ZD,alt:""});if(e.id==="pandoc")return o.jsx("img",{src:zWt,alt:""});if(e.id==="github-cli")return o.jsx(hq,{});const t=MKt[e.id];return t?o.jsx("img",{src:t,alt:""}):o.jsx(UKt,{label:e.label})}function zKt(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===Lz(e,t)?void 0:e.dockerfile,gitSource:e.gitSource,containerRepository:e.containerRepository,imageSource:e.imageSource}:{...LL,optionIds:[...LL.optionIds],selectedSkills:[...LL.selectedSkills]}}const Hb=new Set(["preparing","queued","building","scanning"]),toe=3e3,A4={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 PFe(e,t){var i;const n=(i=e.latestVersion)==null?void 0:i.status;return n?n==="available"?{label:t(A4[n]),color:"success"}:n==="failed"?{label:t(A4[n]),color:"danger"}:{label:t(A4[n]),color:"warning"}:{label:t("environmentCenter.buildStatus.notBuilt"),color:"secondary"}}function VKt(e,t){return GD(e,Date.now(),t)}function HKt(e,t){const n=Date.parse(e);return Number.isNaN(n)?e:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"medium"}).format(n)}function qKt(e,t,n=Date.now()){const i=Date.parse(e.createdAt),s=Hb.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 WKt({environment:e,onClose:t}){var x;const{t:n}=je("ui"),i=((x=e.latestVersion)==null?void 0:x.versionId)??"",r=p.useId(),s=p.useRef(null),a=p.useRef(t),[l,c]=p.useState(null),[u,d]=p.useState(!0),[f,h]=p.useState(""),[m,g]=p.useState(0),[b,v]=p.useState("idle"),y=p.useMemo(()=>l?CKt(l):"",[l]);a.current=t,p.useEffect(()=>{var C;const O=document.body.style.overflow,S=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(C=s.current)==null||C.focus();const k=E=>{if(E.key==="Escape"){E.preventDefault(),a.current();return}if(E.key!=="Tab"||!s.current)return;const R=Array.from(s.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')).filter(T=>T.getClientRects().length>0);if(!R.length)return;const A=R[0],j=R[R.length-1];E.shiftKey&&document.activeElement===A?(E.preventDefault(),j.focus()):!E.shiftKey&&document.activeElement===j&&(E.preventDefault(),A.focus())};return window.addEventListener("keydown",k),()=>{document.body.style.overflow=O,window.removeEventListener("keydown",k),S!=null&&S.isConnected&&S.focus()}},[]),p.useEffect(()=>{const O=new AbortController;return d(!0),h(""),CCe(e.id,i,O.signal).then(c).catch(S=>{(S==null?void 0:S.name)!=="AbortError"&&h(S instanceof Error?S.message:String(S))}).finally(()=>{O.signal.aborted||d(!1)}),()=>O.abort()},[e.id,m,i]),p.useEffect(()=>{if(b!=="copied")return;const O=window.setTimeout(()=>v("idle"),1500);return()=>window.clearTimeout(O)},[b]);const w=async()=>{try{await navigator.clipboard.writeText(y),v("copied")}catch{v("error")}};return si.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:O=>{O.target===O.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(It,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":n("environmentCenter.manifest.closeLabel"),children:o.jsx(Oa,{"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(mn,{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(It,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>g(O=>O+1),children:n("common.reload")})]}):o.jsx("div",{className:"environment-manifest-dialog__editor","aria-label":n("environmentCenter.manifest.editorLabel"),children:o.jsx(ST,{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(It,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:n("common.close")}),o.jsx(It,{type:"button",color:"info",size:"sm",disabled:!y,onClick:()=>void w(),children:n(b==="copied"?"environmentCenter.manifest.copied":"environmentCenter.manifest.copy")})]})]})}),document.body)}function KKt({environment:e,onClose:t,onBuildUpdate:n,onRebuild:i}){var k,C;const{t:r}=je("ui"),s=e.latestVersion,[a,l]=p.useState(s),[c,u]=p.useState(!!s),[d,f]=p.useState(""),[h,m]=p.useState(Date.now()),[g,b]=p.useState(!1),v=p.useId(),y=p.useRef(null),w=p.useRef(t),x=p.useRef(n);p.useEffect(()=>{w.current=t,x.current=n},[n,t]),p.useEffect(()=>{var j;const E=document.body.style.overflow,R=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(j=y.current)==null||j.focus();const A=T=>{var M;if(T.key==="Escape"&&w.current(),T.key!=="Tab")return;const N=Array.from(((M=y.current)==null?void 0:M.querySelectorAll('button:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])'))??[]).filter(P=>P.getClientRects().length>0);if(!N.length)return;const _=N[0],D=N[N.length-1];T.shiftKey&&document.activeElement===_?(T.preventDefault(),D.focus()):!T.shiftKey&&document.activeElement===D&&(T.preventDefault(),_.focus())};return window.addEventListener("keydown",A),()=>{document.body.style.overflow=E,window.removeEventListener("keydown",A),R!=null&&R.isConnected&&R.focus()}},[]),p.useEffect(()=>{if(!s)return;let E=0;const R=new AbortController,A=async()=>{u(!0);try{const j=await ECe(e.id,s.versionId,{includeLogs:!0,signal:R.signal});l(j),f(""),x.current(j),Hb.has(j.status)&&(E=window.setTimeout(A,toe))}catch(j){if((j==null?void 0:j.name)==="AbortError")return;f(j instanceof Error?j.message:String(j)),E=window.setTimeout(A,toe)}finally{R.signal.aborted||u(!1)}};return A(),()=>{R.abort(),window.clearTimeout(E)}},[e.id,s==null?void 0:s.versionId]),p.useEffect(()=>{if(!a||!Hb.has(a.status))return;const E=window.setInterval(()=>m(Date.now()),1e3);return()=>window.clearInterval(E)},[a==null?void 0:a.status]);const O=a?PFe({...e,latestVersion:a},r):{label:r("environmentCenter.buildStatus.notBuilt"),color:"secondary"},S=e.imageSource||(C=(k=a==null?void 0:a.resources)==null?void 0:k.codePipeline)==null?void 0:C.consoleUrl;return si.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:E=>{E.target===E.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(Lo,{color:O.color,size:"sm",children:O.label})]}),o.jsx("p",{children:e.name})]}),o.jsx(It,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":r("environmentCenter.buildDetails.closeLabel"),children:o.jsx(Oa,{"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?qKt(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,S?o.jsxs("a",{href:S,target:"_blank",rel:"noreferrer",children:[r("environmentCenter.buildDetails.openCodePipeline")," ",o.jsx(xy,{"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(nKt,{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&&Hb.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(It,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:r("common.close")}),a&&!e.imageSource&&!Hb.has(a.status)?o.jsx(It,{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 DFe({cloudProvider:e,value:t,disabled:n,onChange:i}){const{t:r}=je("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(Od,{})]}),o.jsx(Js,{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 GKt({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}=je("ui"),[h,m]=p.useState(!1),[g,b]=p.useState(""),v=p.useRef(null),y=p.useRef(""),w=`${e.trim()}\0${t.trim()}`,x=r===w;p.useEffect(()=>()=>{const C=v.current;v.current=null,C==null||C.abort()},[]);const O=()=>{var C;(C=v.current)==null||C.abort(),v.current=null,m(!1),b(""),u(null),d(""),c(""),y.current=""},S=p.useCallback(async()=>{var R;const C=s9(e,f);if(C){b(C);return}y.current=w,(R=v.current)==null||R.abort();const E=new AbortController;v.current=E,m(!0),b("");try{const A=await bCe({repositoryUrl:e.trim(),...t.trim()?{ref:t.trim()}:{}},E.signal);if(v.current!==E)return;u(A),d(w),c(A.dockerfiles.length===1?A.dockerfiles[0]:"")}catch(A){if((A==null?void 0:A.name)==="AbortError")return;b(FKt(A)),u(null),d(""),c("")}finally{v.current===E&&(v.current=null,m(!1))}},[w,t,c,d,u,e,f]);p.useEffect(()=>{if(s||x||y.current===w||s9(e,f))return;const C=window.setTimeout(()=>void S(),600);return()=>window.clearTimeout(C)},[w,s,S,x,e,f]);const k=x?(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(Od,{})]}),o.jsx(fs,{size:"lg",type:"url",required:!0,value:e,placeholder:"https://github.com/owner/repository.git",autoComplete:"url",disabled:s,"aria-invalid":!!g,onChange:C=>{O(),a(C.currentTarget.value)}})]}),o.jsxs("label",{className:"environment-field",children:[o.jsx("span",{children:f("environmentCenter.git.ref")}),o.jsx(fs,{size:"lg",value:t,placeholder:f("environmentCenter.git.defaultBranch"),autoComplete:"off",disabled:s,onChange:C=>{O(),l(C.currentTarget.value)}})]})]}),o.jsxs("div",{className:"environment-inspection-status environment-form-feedback","aria-live":"polite",children:[h?o.jsx(mn,{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(It,{type:"button",color:"primary",size:"sm",pill:!1,disabled:s,onClick:()=>void S(),children:[o.jsx(pP,{}),f("common.retry")]})]}):null,!h&&!g&&x&&i?k.length>0?o.jsx("span",{children:i.commitSha?f("environmentCenter.git.foundDockerfiles",{commit:i.commitSha.slice(0,12),count:k.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 S(),children:f("environmentCenter.git.inspectAgain")})]}):null]}),k.length>0?o.jsxs("label",{className:"environment-field environment-dockerfile-picker",children:[o.jsxs("span",{children:["Dockerfile",o.jsx(Od,{})]}),o.jsx(jg,{ariaLabel:f("environmentCenter.git.selectDockerfile"),value:n,valueLabel:n,placeholder:f("environmentCenter.git.selectDockerfile"),options:k.map(C=>({value:C,label:C})),disabled:s||h,onChange:c})]}):null]})}function XKt({cloudProvider:e,mode:t,region:n,value:i,disabled:r,onModeChange:s,onRegionChange:a,onChange:l}){const{t:c}=je("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(Od,{})]}),o.jsx(Js,{id:"environment-repository-mode",value:t,options:PKt(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(DFe,{cloudProvider:e,value:n,disabled:r,onChange:a}),t==="existing"?o.jsx(jFe,{region:n,value:i,disabled:r,onChange:l}):o.jsx("p",{className:"environment-source-note environment-form-feedback",children:c("environmentCenter.repository.managedHint")})]})})}function YKt({cloudProvider:e,region:t,repository:n,reference:i,disabled:r,onRegionChange:s,onRepositoryChange:a,onReferenceChange:l}){const{t:c}=je("ui"),u=IFe(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(DFe,{cloudProvider:e,value:t,disabled:r,onChange:s}),o.jsx(jFe,{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(Od,{})]}),o.jsx(fs,{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 MFe(e,t,n,i){const r=p.useRef(n),s=p.useRef(i);r.current=n,s.current=i,p.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],m=f[f.length-1];d.shiftKey&&document.activeElement===h?(d.preventDefault(),m.focus()):!d.shiftKey&&document.activeElement===m&&(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 ZKt({environment:e,onClose:t}){const{t:n}=je("ui"),i=p.useId(),r=p.useId(),s=p.useRef(null),a=p.useRef(null),[l,c]=p.useState(""),[u,d]=p.useState("loading"),[f,h]=p.useState(""),m=u==="loading";MFe(s,a,t,m);const g=async(b="",v)=>{d("loading"),h("");try{const y=b||(await yCe(e.id,v)).shareCode;c(y),await aCe(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 p.useEffect(()=>{const b=new AbortController;return g("",b.signal),()=>b.abort()},[e.id]),si.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:b=>{b.target===b.currentTarget&&!m&&t()},children:o.jsxs("section",{ref:s,className:"environment-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":i,"aria-describedby":r,"aria-busy":m||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(It,{ref:a,type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:m,onClick:t,"aria-label":n("environmentCenter.share.closeLabel"),children:o.jsx(Oa,{"aria-hidden":!0})})]}),o.jsx("div",{className:"environment-share-dialog__body",children:u==="loading"?o.jsx(mn,{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(Sg,{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(It,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:m,onClick:t,children:n("common.close")}),u==="error"?o.jsx(It,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("common.retry")}):u==="copied"?o.jsx(It,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("environmentCenter.share.copyAgain")}):null]})]})}),document.body)}function JKt({initialValue:e,autoInspect:t,onClose:n,onImported:i}){const{t:r}=je("ui"),s=p.useId(),a=p.useId(),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(!1),[f,h]=p.useState(e),[m,g]=p.useState("editing"),[b,v]=p.useState([]),[y,w]=p.useState(""),[x,O]=p.useState([]),S=p.useMemo(()=>RU(f),[f]),k=S.length>r9,C=m==="inspecting"||m==="importing",E=b.filter(_=>_.status==="valid"),R=b.filter(_=>_.status==="invalid"),A=m==="ready"&&E.length>0;MFe(c,u,n,C);const j=p.useCallback(async()=>{if(!(!S.length||k)){g("inspecting"),w(""),O([]);try{const _=await vCe(S);v([..._].sort((D,M)=>D.index-M.index)),g("ready")}catch(_){w(_ instanceof Error?_.message:String(_)),g("editing")}}},[S,k]);p.useEffect(()=>{!t||d.current||(d.current=!0,j())},[t,j]);const T=async()=>{if(A){g("importing"),w(""),O([]);try{const _=E.map(F=>({code:S[F.index],name:F.name})).filter(F=>!!F.code),D=await xCe(_.map(F=>F.code)),M=D.filter(F=>F.status==="created").length,P=D.filter(F=>F.status==="duplicate").length,L=new Map(D.map(F=>[F.index,F])),B=_.flatMap(({code:F,name:q},H)=>{const X=L.get(H);return!X||X.status==="failed"?[{code:F,name:q,status:"valid",error:(X==null?void 0:X.error)||r("environmentCenter.import.noResult")}]:[]}),z=[...R.flatMap(F=>{const q=S[F.index];return q?[{code:q,name:"",status:"invalid",error:F.error||r("environmentCenter.import.invalidCode")}]:[]}),...B],K=new Map;if(D.forEach(F=>{F.environment&&K.set(F.environment.id,F.environment)}),i([...K.values()],M,P,z.length),!z.length){n();return}h(z.map(F=>F.code).join(` -`)),O(B),v(z.map((F,q)=>({index:q,status:F.status,name:F.name,error:F.status==="invalid"?F.error:""}))),w(r("environmentCenter.import.partial",{created:M,remaining:z.length})),g("ready")}catch(_){w(_ instanceof Error?_.message:String(_)),g("ready")}}},N=m==="inspecting"?r("environmentCenter.import.inspecting"):m==="importing"?r("environmentCenter.import.importing"):A?x.length?r("environmentCenter.import.retryImport"):r("environmentCenter.import.confirm"):r("environmentCenter.import.inspectCodes");return si.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:_=>{_.target===_.currentTarget&&!C&&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":C||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(It,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:C,onClick:n,"aria-label":r("environmentCenter.import.closeLabel"),children:o.jsx(Oa,{"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(Sg,{ref:u,size:"lg",rows:6,value:f,disabled:C,"aria-invalid":k||R.length>0||void 0,"aria-describedby":l,placeholder:"akenv://v1/...",onChange:_=>{h(_.currentTarget.value),g("editing"),v([]),w(""),O([])}})]}),o.jsx("p",{id:l,className:`environment-share-dialog__help${k?" is-error":""}`,children:k?r("environmentCenter.import.tooMany",{max:r9,count:S.length}):r("environmentCenter.import.multipleHint")}),o.jsx("p",{className:"environment-share-dialog__safety",children:r("environmentCenter.import.safety")}),m==="inspecting"?o.jsx(mn,{as:"p",children:r("environmentCenter.import.inspectingCodes")}):E.length?o.jsx("p",{className:"environment-share-dialog__summary",role:"status","aria-live":"polite",children:r("environmentCenter.import.found",{count:E.length,names:E.map(_=>_.name||r("environmentCenter.unnamed")).join(r("environmentCenter.listSeparator"))})}):null,R.length?o.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:R.map(_=>o.jsx("li",{children:r("environmentCenter.import.itemError",{index:_.index+1,error:_.error||r("environmentCenter.import.invalidCode")})},_.index))}):null,x.length?o.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:x.map((_,D)=>o.jsx("li",{children:r("environmentCenter.import.itemError",{index:D+1,error:_.error})},`${_.code}:${D}`))}):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(It,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:C,onClick:n,children:r("common.cancel")}),o.jsx(It,{type:"button",color:"info",size:"sm",loading:C,disabled:C||!S.length||k||m==="ready"&&!A,onClick:()=>A?void T():void j(),children:N})]})]})}),document.body)}function eGt({environment:e,cloudProvider:t,onCancel:n,onDelete:i,onShare:r,onSave:s}){var Ke,$e,At,Nt,vt,Ot,Tt;const{t:a,i18n:l}=je("ui"),c=_Kt(a),u=zKt(e,t),d=u.dockerfile!==void 0,[f,h]=p.useState(()=>({...u,dockerfile:d?void 0:u.dockerfile})),[m,g]=p.useState(u.gitSource?"git":u.imageSource?"image":d?"dockerfile":"custom"),[b,v]=p.useState(d?(e==null?void 0:e.dockerfile)??"":""),[y,w]=p.useState(""),x=p.useRef(null),[O,S]=p.useState(()=>d?RKt((e==null?void 0:e.dockerfile)??""):u.baseEnvironment==="aio-sandbox"||u.baseEnvironment==="codex-sandbox"?u.baseEnvironment:"none"),[k,C]=p.useState(((Ke=u.gitSource)==null?void 0:Ke.repositoryUrl)??""),[E,R]=p.useState((($e=u.gitSource)==null?void 0:$e.ref)??""),[A,j]=p.useState(((At=u.gitSource)==null?void 0:At.dockerfilePath)??""),[T,N]=p.useState(u.gitSource?{repositoryUrl:u.gitSource.repositoryUrl,ref:u.gitSource.ref??"",commitSha:"",dockerfiles:[u.gitSource.dockerfilePath]}:null),[_,D]=p.useState(u.gitSource?`${u.gitSource.repositoryUrl}\0${u.gitSource.ref??""}`:""),[M,P]=p.useState(u.containerRepository?"existing":"managed"),[L,B]=p.useState(((Nt=u.containerRepository)==null?void 0:Nt.region)??qi(t)),[I,z]=p.useState(u.containerRepository??void 0),[K,F]=p.useState(((vt=u.imageSource)==null?void 0:vt.region)??qi(t)),[q,H]=p.useState(u.imageSource?{region:u.imageSource.region,registry:u.imageSource.registry,namespace:u.imageSource.namespace,repository:u.imageSource.repository}:void 0),[X,ne]=p.useState(((Ot=u.imageSource)==null?void 0:Ot.reference)??""),[Q,Z]=p.useState(!1),ce=p.useMemo(()=>Lz(f,t),[t,f.baseEnvironment,f.operatingSystem,f.language,f.optionIds]),Ee=f.dockerfile??ce,Y=O!=="none",G=O==="aio-sandbox"?Dz:O==="codex-sandbox"?cIe[t]:"",te=Y?kKt(b):b,ue=Y?jj(G,""):"",Ce=Y?jj(G,te):b,se=y||(Y?SKt(te,G,a):mq(b,void 0,a)),he=!!e,ae="environment-editor-form",[Ae,De]=p.useState(!1),[ye,Qe]=p.useState(""),we=!!Ce.trim()&&!se,Ne=`${k.trim()}\0${E.trim()}`,ie=!s9(k,a)&&_===Ne&&!!A&&(M==="managed"||eoe(I)),fe=eoe(q)&&!!X.trim()&&!IFe(X,a),Se=!!f.name.trim()&&!Ae&&(m==="custom"||m==="dockerfile"&&we||m==="git"&&ie||m==="image"&&fe),ke=(ft,gt)=>{h(Me=>({...Me,optionIds:gt?[...Me.optionIds,ft]:Me.optionIds.filter(bt=>bt!==ft)}))},qe=ft=>{w(""),v(Y?jj(G,ft):ft)},it=async ft=>{if(!ft)return;const gt=await EKt(ft,a);w(gt.error),gt.content&&v(gt.content)},de=()=>{w(""),v(ue)},ve=async ft=>{if(ft.preventDefault(),!!Se){De(!0),Qe("");try{const gt=Yxt(Ce);await s({...f,name:f.name.trim(),description:f.description.trim(),optionIds:m==="custom"?f.optionIds:[],selectedSkills:m==="custom"?f.selectedSkills:[],dockerfile:m==="dockerfile"?Ce:m==="custom"?Ee:"",gitSource:m==="git"?{repositoryUrl:k.trim(),...E.trim()?{ref:E.trim()}:{},dockerfilePath:A}:null,containerRepository:m==="git"&&M==="existing"?I:null,imageSource:m==="image"&&q?{...q,reference:X.trim()}:null,...m==="dockerfile"?gt:{}})}catch(gt){Qe(gt instanceof Error?gt.message:String(gt)),De(!1)}}},Te=f.name.trim()||(he?(e==null?void 0:e.name)||a("environmentCenter.configure"):a("environmentCenter.create"));return o.jsx(Ff,{className:"environment-editor","aria-label":a(he?"environmentCenter.details":"environmentCenter.create"),children:o.jsx(XC,{title:Te,description:a("environmentCenter.editorDescription"),identitySeed:Te,backLabel:a("environmentCenter.backToList"),onBack:n,actions:o.jsxs(o.Fragment,{children:[i?o.jsx(It,{type:"button",color:"danger",variant:"ghost",size:"sm",onClick:i,disabled:Ae,children:a("common.delete")}):null,r?o.jsx(It,{color:"secondary",variant:"soft",size:"sm",onClick:r,disabled:Ae,children:a("environmentCenter.share.action")}):null,o.jsx(It,{color:"secondary",variant:"soft",size:"sm",onClick:n,disabled:Ae,children:a("common.cancel")}),o.jsx(It,{color:"info",size:"sm",type:"submit",form:ae,disabled:!Se,children:a(Ae?"common.saving":m==="image"?he?"environmentCenter.save":"environmentCenter.create":he?"environmentCenter.saveAndBuild":"environmentCenter.createAndBuild")})]}),children:o.jsxs("form",{id:ae,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(Od,{})]}),o.jsx(fs,{className:"environment-text-input",type:"text",size:"lg",required:!0,value:f.name,maxLength:60,placeholder:a("environmentCenter.namePlaceholder"),onChange:ft=>h(gt=>({...gt,name:ft.target.value}))})]}),o.jsxs("label",{className:"environment-field",children:[o.jsx("span",{children:a("common.description")}),o.jsx(Sg,{className:"environment-description-input",size:"lg",rows:3,value:f.description,maxLength:180,placeholder:a("environmentCenter.descriptionPlaceholder"),onChange:ft=>h(gt=>({...gt,description:ft.target.value}))})]})]}),o.jsxs("label",{className:"environment-field environment-creation-method",children:[o.jsxs("span",{children:[a("environmentCenter.creationMethod"),o.jsx(Od,{})]}),o.jsx(Js,{id:"environment-creation-method",value:m,options:c,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:ft=>{const gt=ft.value;g(gt),gt==="dockerfile"&&!b.trim()&&v(ue),Qe("")}}),o.jsx("small",{children:(Tt=c.find(ft=>ft.value===m))==null?void 0:Tt.description})]}),ye?o.jsx("p",{className:"environment-form-error",role:"alert",children:ye}):null,m==="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(Od,{})]}),o.jsx(Js,{id:"environment-base-environment",value:f.baseEnvironment,options:jKt.map(ft=>({...ft,description:a(`environmentCenter.baseDescriptions.${ft.value}`)})),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:ft=>{const gt=ft.value,Me=gt==="aio-sandbox"||gt==="codex-sandbox";h(bt=>({...bt,baseEnvironment:gt,operatingSystem:Me?"ubuntu-22.04":bt.operatingSystem,language:Me?"python-3.12":bt.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(Od,{})]}),o.jsx(Js,{id:"environment-operating-system",value:f.operatingSystem,options:IKt,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:ft=>h(gt=>({...gt,operatingSystem:ft.value}))}),o.jsx("small",{children:f.baseEnvironment!=="ubuntu"?a("environmentCenter.fixedByBase",{base:l8(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(Od,{})]}),o.jsx(Js,{id:"environment-python-version",value:f.language,options:f.baseEnvironment!=="ubuntu"?Zse.filter(ft=>ft.value==="python-3.12"):Zse,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:ft=>h(gt=>({...gt,language:ft.value}))}),o.jsx("small",{children:f.baseEnvironment!=="ubuntu"?a("environmentCenter.fixedByBase",{base:l8(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(Yse,{name:"VeADK",description:a("environmentCenter.veadkDescription"),selected:Q,disabled:Ae,onChange:Z,icon:o.jsx("img",{src:jP,alt:""})}),o.jsx(pq,{selected:f.selectedSkills,onChange:ft=>h(gt=>({...gt,selectedSkills:ft})),cloudProvider:t,disabled:Ae,addLabel:a("environmentCenter.addSkill"),showSelectedCount:!1})]})]}),Mz.map(ft=>o.jsxs("section",{className:"environment-section","aria-labelledby":`environment-${ft.id}-title`,children:[o.jsx("h2",{id:`environment-${ft.id}-title`,children:a(`environmentCenter.categories.${ft.id}`)}),o.jsx("div",{className:"environment-option-grid",children:ft.options.map(gt=>{const Me=f.optionIds.includes(gt.id);return o.jsx(Yse,{name:gt.label,description:a(`environmentCenter.options.${gt.id}`,{defaultValue:gt.description}),selected:Me,onChange:bt=>ke(gt.id,bt),icon:o.jsx(QKt,{option:gt})},gt.id)})})]},ft.id))]}):m==="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(Js,{id:"environment-dockerfile-base-environment",value:O,options:NKt(a),optionClassName:"environment-select-option",size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:ft=>{w(""),S(ft.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(Od,{})]}),o.jsxs("div",{className:"environment-upload__actions",children:[o.jsx("span",{className:"environment-upload__size",children:a("environmentCenter.dockerfileSize",{size:AFe(Ce).toLocaleString(l.resolvedLanguage??l.language),max:131072 .toLocaleString(l.resolvedLanguage??l.language)})}),o.jsx("input",{ref:x,className:"environment-upload__file-input",type:"file",accept:".dockerfile,text/plain",tabIndex:-1,hidden:!0,onChange:ft=>{var Me;const gt=ft.currentTarget;it((Me=gt.files)==null?void 0:Me[0]).finally(()=>{gt.value=""})}}),o.jsx(It,{className:"environment-upload__action",type:"button",color:"secondary",variant:"soft",size:"sm",pill:!1,disabled:Ae,onClick:()=>{var ft;return(ft=x.current)==null?void 0:ft.click()},children:a("environmentCenter.upload")}),o.jsx(It,{className:"environment-upload__action",type:"button",color:"secondary",variant:"ghost",size:"sm",pill:!1,disabled:Ae||!te,onClick:de,children:a("environmentCenter.reset")})]})]}),o.jsxs("div",{className:`environment-dockerfile-editor${Y?" has-fixed-base":""}${se?" is-invalid":""}`,children:[Y?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:G,children:G})]})]}):null,o.jsx("div",{className:"environment-dockerfile__editor environment-upload__editor","aria-label":a("environmentCenter.dockerfileContent"),children:o.jsx(ST,{value:te,path:"Dockerfile",lineNumberStart:Y?2:1,height:"auto",minHeight:"28px",maxHeight:"var(--environment-dockerfile-editor-max-height)",onChange:qe})})]})]}),se?o.jsx("p",{className:"environment-upload__error environment-upload__error--below",role:"alert",children:se}):null]}):m==="git"?o.jsxs("div",{className:"environment-source-workflow",children:[o.jsx(GKt,{repositoryUrl:k,gitRef:E,dockerfilePath:A,inspection:T,inspectedKey:_,disabled:Ae,onRepositoryUrlChange:C,onGitRefChange:R,onDockerfilePathChange:j,onInspectionChange:N,onInspectedKeyChange:D}),o.jsx(XKt,{cloudProvider:t,mode:M,region:L,value:I,disabled:Ae,onModeChange:ft=>{P(ft),Qe("")},onRegionChange:ft=>{B(ft),z(void 0),Qe("")},onChange:z})]}):o.jsx(YKt,{cloudProvider:t,region:K,repository:q,reference:X,disabled:Ae,onRegionChange:ft=>{F(ft),H(void 0),Qe("")},onRepositoryChange:H,onReferenceChange:ne})]})})})}function LFe({cloudProvider:e="volcengine",onWorkspace:t,onProjects:n,clipboardImport:i=null,clipboardReadError:r=""}){const{t:s,i18n:a}=je("ui"),[l,c]=p.useState([]),[u,d]=p.useState({kind:"list"}),[f,h]=p.useState(""),[m,g]=p.useState(null),[b,v]=p.useState(null),[y,w]=p.useState(null),[x,O]=p.useState(null),[S,k]=p.useState(null),C=p.useRef(0),[E,R]=p.useState(""),[A,j]=p.useState(!1),[T,N]=p.useState(r),[_,D]=p.useState(!0),[M,P]=p.useState(""),[L,B]=p.useState(0),[I,z]=p.useState(()=>new Set),K=p.useDeferredValue(f),F=p.useMemo(()=>{const Y=K.trim().toLocaleLowerCase();return Y?l.filter(G=>`${G.name} ${G.description} ${a8(G.operatingSystem)} ${Xh(G.language)} ${l8(G.baseEnvironment)}`.toLocaleLowerCase().includes(Y)):l},[K,l]),q=p.useCallback((Y="",G=!1)=>{C.current+=1,k({key:C.current,initialValue:Y,autoInspect:G})},[]),H=p.useCallback((Y,G=!1)=>{const te=Y.trim();if(!te.startsWith("akenv://")||!G&&Jse.has(te))return!1;const ue=RU(te);return!ue.length||ue.length>r9?!1:(Jse.add(te),N(""),q(te,!0),!0)},[q]),X=p.useCallback(async()=>{var Y;if(!(u.kind!=="list"||S)){if(typeof navigator>"u"||!((Y=navigator.clipboard)!=null&&Y.readText)){N(s("environmentCenter.clipboardUnsupported"));return}try{const G=await navigator.clipboard.readText();!H(G)&&!G.trim()&&await DKt()&&N(s("environmentCenter.clipboardReadError"))}catch{N(s("environmentCenter.clipboardReadError"))}}},[S,H,s,u.kind]);p.useEffect(()=>{const Y=new AbortController;return l.length===0&&D(!0),P(""),EC(Y.signal).then(G=>{c(G)}).catch(G=>{(G==null?void 0:G.name)!=="AbortError"&&P(G instanceof Error?G.message:String(G))}).finally(()=>{Y.signal.aborted||D(!1)}),()=>Y.abort()},[L]),p.useEffect(()=>{if(!l.some(G=>G.latestVersion&&Hb.has(G.latestVersion.status)))return;const Y=window.setTimeout(()=>B(G=>G+1),2500);return()=>window.clearTimeout(Y)},[l]),p.useEffect(()=>{if(!E||A)return;const Y=window.setTimeout(()=>R(""),2800);return()=>window.clearTimeout(Y)},[A,E]),p.useEffect(()=>{r&&N(r)},[r]),p.useEffect(()=>{i&&H(i.text)},[i,H]),p.useEffect(()=>{if(u.kind!=="list")return;const Y=()=>void X(),G=()=>{document.visibilityState==="visible"&&X()},te=ue=>{var he;const Ce=ue.target;if(Ce instanceof HTMLInputElement||Ce instanceof HTMLTextAreaElement||Ce instanceof HTMLElement&&Ce.isContentEditable)return;const se=((he=ue.clipboardData)==null?void 0:he.getData("text/plain"))??"";H(se,!0)&&ue.preventDefault()};return window.addEventListener("focus",Y),document.addEventListener("visibilitychange",G),window.addEventListener("paste",te),()=>{window.removeEventListener("focus",Y),document.removeEventListener("visibilitychange",G),window.removeEventListener("paste",te)}},[H,X,u.kind]);const ne=u.kind==="editor"&&u.environmentId?l.find(Y=>Y.id===u.environmentId):void 0,Q=async Y=>{const G={...Y,dockerfile:Y.dockerfile??Lz(Y,e)},te=ne?await kCe(ne.id,G):await OCe(G);if(c(ue=>[te,...ue.filter(Ce=>Ce.id!==te.id)]),d({kind:"list"}),j(!1),G.imageSource){R(s("environmentCenter.status.boundImage",{name:te.name}));return}try{const ue=await G$(te.id);c(Ce=>Ce.map(se=>se.id===te.id?{...se,latestVersion:ue}:se)),R(s("environmentCenter.status.queued",{name:te.name}))}catch(ue){j(!0),R(s("environmentCenter.status.savedBuildFailed",{error:ue instanceof Error?ue.message:String(ue)}))}},Z=async Y=>{if(!I.has(Y.id)){z(G=>new Set(G).add(Y.id)),j(!1);try{const G=await G$(Y.id);c(te=>te.map(ue=>ue.id===Y.id?{...ue,latestVersion:G}:ue)),R(s("environmentCenter.status.queued",{name:Y.name}))}catch(G){j(!0),R(G instanceof Error?G.message:String(G))}finally{z(G=>{const te=new Set(G);return te.delete(Y.id),te})}}},ce=(Y,G,te,ue)=>{Y.length&&c(Ce=>{const se=new Set(Y.map(he=>he.id));return[...Y,...Ce.filter(he=>!se.has(he.id))]}),j(ue>0),R(ue>0?s("environmentCenter.status.importedFailed",{created:G,failed:ue}):te>0?s("environmentCenter.status.importedDuplicate",{created:G,duplicate:te}):s("environmentCenter.status.imported",{count:G}))},Ee=m?o.jsx(Yu,{title:s("environmentCenter.deleteTitle"),description:s("environmentCenter.deleteDescription",{name:m.name}),confirmLabel:s("common.delete"),variant:"danger",onCancel:()=>g(null),onConfirm:()=>{const Y=m;g(null),d({kind:"list"}),SCe(Y.id).then(()=>{c(G=>G.filter(te=>te.id!==Y.id)),j(!1),R(s("environmentCenter.status.deleted",{name:Y.name}))}).catch(G=>{j(!0),R(G instanceof Error?G.message:String(G))})}}):null;return u.kind==="editor"?o.jsxs(o.Fragment,{children:[o.jsx(eGt,{environment:ne,cloudProvider:e,onCancel:()=>d({kind:"list"}),onDelete:ne?()=>g(ne):void 0,onShare:ne?()=>O(ne):void 0,onSave:Q},u.environmentId??"new"),x?o.jsx(ZKt,{environment:x,onClose:()=>O(null)}):null,Ee]}):o.jsxs(fq,{section:"environments",className:"environment-center",onWorkspace:t,onProjects:n,actions:o.jsxs(o.Fragment,{children:[E?o.jsx("span",{className:`environment-status${A?" is-error":""}`,role:A?"alert":"status","aria-live":"polite",children:E}):null,o.jsx(hp,{"aria-label":s("environmentCenter.search"),value:f,onChange:Y=>h(Y.target.value),placeholder:s("environmentCenter.search")})]}),children:[T?o.jsxs("div",{className:"environment-clipboard-notice",role:"alert",children:[o.jsx("span",{children:T}),o.jsx(It,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>{N(""),q()},children:s("environmentCenter.manualImport")})]}):null,o.jsx(Pg,{"aria-live":"polite",children:_?o.jsx(Ha,{}):M?o.jsxs("div",{className:"environment-load-error",role:"alert",children:[o.jsx("p",{children:da(M,a.resolvedLanguage||a.language)||s("environmentCenter.loadFailed")}),o.jsx(It,{color:"secondary",variant:"soft",size:"sm",onClick:()=>B(Y=>Y+1),children:s("common.reload")})]}):F.length===0&&f.trim()?o.jsx("div",{className:"environment-empty",children:o.jsxs(Rn,{fill:"none",children:[o.jsx(Rn.Icon,{children:o.jsx(BKt,{})}),o.jsx(Rn.Title,{children:s("environmentCenter.noMatches")}),o.jsx(Rn.Description,{children:s("environmentCenter.tryAnotherName")})]})}):o.jsxs(n0,{children:[f.trim()?null:o.jsxs(o.Fragment,{children:[o.jsx(hg,{"aria-label":s("environmentCenter.create"),icon:o.jsx(LKt,{}),onClick:()=>d({kind:"editor",environmentId:null}),children:s("environmentCenter.create")}),o.jsx(hg,{"aria-label":s("environmentCenter.import.title"),icon:o.jsx($Kt,{}),onClick:()=>q(),children:s("environmentCenter.import.title")})]}),F.map(Y=>{var Ce,se;const G=PFe(Y,s),te=!!(Y.latestVersion&&Hb.has(Y.latestVersion.status)),ue=I.has(Y.id);return o.jsx(r0,{className:"environment-card",title:Y.name,status:o.jsx(Lo,{color:G.color,size:"sm",children:G.label}),description:((Ce=Y.latestVersion)==null?void 0:Ce.error)||(te?(se=Y.latestVersion)==null?void 0:se.currentStep:"")||Y.description||s("common.noDescription"),metadata:[{label:s("workspace.updated"),value:VKt(Y.updatedAt,a.resolvedLanguage??a.language),title:HKt(Y.updatedAt,a.resolvedLanguage??a.language)}],action:{label:Y.latestVersion?s("environmentCenter.buildDetails.title"):s(ue?"environmentCenter.buildDetails.starting":"environmentCenter.startBuild"),icon:"play",title:s("environmentCenter.build"),disabled:ue,onClick:()=>Y.latestVersion?v(Y.id):void Z(Y)},auxiliaryAction:{label:s("environmentCenter.manifest.view"),icon:o.jsx(wit,{}),title:Y.latestVersion?s("environmentCenter.manifest.viewShort"):s("environmentCenter.manifest.unavailable"),disabled:!Y.latestVersion,onClick:()=>w(Y)},detailAction:{label:s("environmentCenter.configure"),onClick:()=>d({kind:"editor",environmentId:Y.id})}},Y.id)})]})}),b?(()=>{const Y=l.find(G=>G.id===b);return Y?o.jsx(KKt,{environment:Y,onClose:()=>v(null),onBuildUpdate:G=>{c(te=>te.map(ue=>ue.id===Y.id?{...ue,latestVersion:G}:ue))},onRebuild:()=>Z(Y)}):null})():null,y!=null&&y.latestVersion?o.jsx(WKt,{environment:y,onClose:()=>w(null)}):null,Ee,S?o.jsx(JKt,{initialValue:S.initialValue,autoInspect:S.autoInspect,onClose:()=>k(null),onImported:ce},S.key):null]})}function tGt(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 nGt(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 o9(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 iGt(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 rGt({workspace:e,environments:t,onBack:n,onSave:i,onDelete:r}){const{t:s,i18n:a}=je("ui"),[l,c]=p.useState((e==null?void 0:e.name)??""),[u,d]=p.useState((e==null?void 0:e.description)??""),[f,h]=p.useState((e==null?void 0:e.environmentIds)??[]),[m,g]=p.useState(""),[b,v]=p.useState(!1),[y,w]=p.useState(""),x=m.trim().toLocaleLowerCase(),O=t.filter(k=>`${k.name} ${k.description} ${Xh(k.language)}`.toLocaleLowerCase().includes(x)),S=async k=>{if(k.preventDefault(),!(!l.trim()||b)){v(!0),w("");try{await i({name:l.trim(),description:u.trim(),environmentIds:f})}catch(C){w(C instanceof Error?C.message:String(C)),v(!1)}}};return o.jsx(Ff,{className:"workspace-center","aria-label":s(e?"workspace.detail":"workspace.create"),children:o.jsxs(XC,{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(Fz,{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:o9(e.createdAt,a.resolvedLanguage??a.language)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("workspace.updatedAt")}),o.jsx("dd",{children:o9(e.updatedAt,a.resolvedLanguage??a.language)})]})]}):null,o.jsxs("form",{id:"workspace-form",className:"workspace-form",onSubmit:S,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(fs,{value:l,maxLength:128,autoFocus:!0,onChange:k=>c(k.target.value),placeholder:s("workspace.namePlaceholder")})]}),o.jsxs("label",{children:[o.jsx("span",{children:s("common.description")}),o.jsx(Sg,{value:u,maxLength:2e3,onChange:k=>d(k.target.value),placeholder:s("workspace.descriptionPlaceholder")})]})]}),o.jsxs("section",{className:"workspace-environments",children:[o.jsx(TIe,{title:s("common.environment"),description:s("workspace.selectedEnvironmentCount",{count:f.length}),actions:o.jsx(hp,{"aria-label":s("workspace.searchAvailableEnvironments"),value:m,onChange:k=>g(k.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")})]}):O.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:O.map(k=>{var R;const C=f.includes(k.id),E=((R=k.latestVersion)==null?void 0:R.status)==="available"?s("workspace.environmentStatus.available"):k.latestVersion?s("workspace.environmentStatus.building"):s("workspace.environmentStatus.notBuilt");return o.jsxs("label",{className:`workspace-environment-option${C?" is-selected":""}`,children:[o.jsx("input",{type:"checkbox",checked:C,onChange:()=>h(A=>C?A.filter(j=>j!==k.id):[...A,k.id])}),o.jsxs("span",{className:"workspace-environment-option__copy",children:[o.jsx("strong",{title:k.name,children:k.name}),o.jsxs("span",{children:[Xh(k.language)," · ",E]})]}),o.jsx("span",{className:"workspace-environment-option__action",children:s(C?"workspace.added":"common.add")})]},k.id)})})]}),y?o.jsx("p",{className:"workspace-form-error",role:"alert",children:y}):null]})]})})}function sGt({onEnvironment:e,onProjects:t}){const{t:n,i18n:i}=je("ui"),[r,s]=p.useState([]),[a,l]=p.useState([]),[c,u]=p.useState({kind:"list"}),[d,f]=p.useState(""),[h,m]=p.useState(!0),[g,b]=p.useState(""),[v,y]=p.useState(""),[w,x]=p.useState(!1),[O,S]=p.useState(null),[k,C]=p.useState(0),E=p.useDeferredValue(d);p.useEffect(()=>{const T=new AbortController;return m(!0),b(""),Promise.all([DU(T.signal),EC(T.signal)]).then(([N,_])=>{s(N),l(_)}).catch(N=>{(N==null?void 0:N.name)!=="AbortError"&&(console.warn("Unable to load Studio workspaces",N),b(n("workspace.loadFailed")))}).finally(()=>{T.signal.aborted||m(!1)}),()=>T.abort()},[k,n]),p.useEffect(()=>{if(!v||w)return;const T=window.setTimeout(()=>y(""),2800);return()=>window.clearTimeout(T)},[w,v]);const R=p.useMemo(()=>new Map(a.map(T=>[T.id,T])),[a]),A=p.useMemo(()=>{const T=E.trim().toLocaleLowerCase();return T?r.filter(N=>{const _=N.environmentIds.map(D=>{var M;return((M=R.get(D))==null?void 0:M.name)??""}).join(" ");return`${N.name} ${N.description} ${_}`.toLocaleLowerCase().includes(T)}):r},[E,R,r]),j=c.kind==="detail"&&c.workspaceId?r.find(T=>T.id===c.workspaceId):void 0;return c.kind==="detail"?o.jsx(rGt,{workspace:j,environments:a,onBack:()=>u({kind:"list"}),onDelete:j?()=>S(j):null,onSave:async T=>{const N=j?await mCe(j.id,T):await pCe(T);s(_=>[N,..._.filter(D=>D.id!==N.id)]),x(!1),y(n("workspace.saved",{name:N.name})),u({kind:"list"})}},c.workspaceId??"new"):o.jsxs(fq,{section:"workspaces",onEnvironment:e,onProjects:t,actions:o.jsxs(o.Fragment,{children:[v?o.jsx("span",{className:`workspace-status${w?" is-error":""}`,role:w?"alert":"status","aria-live":"polite",children:v}):null,o.jsx(hp,{"aria-label":n("workspace.searchWorkspaces"),value:d,onChange:T=>f(T.target.value),placeholder:n("workspace.searchWorkspaces")})]}),children:[o.jsx(Pg,{"aria-live":"polite",children:h?o.jsx(Ha,{}):g?o.jsxs("div",{className:"workspace-load-error",role:"alert",children:[o.jsx("p",{children:g}),o.jsx(It,{color:"secondary",variant:"soft",size:"sm",onClick:()=>C(T=>T+1),children:n("common.reload")})]}):A.length===0&&d.trim()?o.jsx("div",{className:"workspace-empty",children:o.jsxs(Rn,{fill:"none",children:[o.jsx(Rn.Icon,{children:o.jsx(nGt,{})}),o.jsx(Rn.Title,{children:n("workspace.noMatchingWorkspaces")}),o.jsx(Rn.Description,{children:n("workspace.tryAnotherNameOrEnvironment")})]})}):o.jsxs(n0,{children:[d.trim()?null:o.jsx(hg,{"aria-label":n("workspace.create"),icon:o.jsx(tGt,{}),onClick:()=>u({kind:"detail",workspaceId:null}),children:n("workspace.create")}),A.map(T=>{const N=iGt(T,R),_=T.environmentIds.filter(D=>!R.has(D)).length;return o.jsx(r0,{className:"workspace-card",title:T.name,status:o.jsx(Lo,{color:_?"danger":N===T.environmentIds.length&&N>0?"success":"secondary",size:"sm",children:T.environmentIds.length===0?n("workspace.noEnvironmentAdded"):_?n("workspace.environmentMissing"):n("workspace.availableFraction",{available:N,total:T.environmentIds.length})}),description:T.description||n("common.noDescription"),metadata:[{label:n("common.environment"),value:n("workspace.environmentCount",{count:T.environmentIds.length})},{label:n("workspace.available"),value:n("workspace.availableCount",{count:N})},{label:n("workspace.updated"),value:o9(T.updatedAt,i.resolvedLanguage??i.language)}],detailAction:{label:n("common.manage"),onClick:()=>u({kind:"detail",workspaceId:T.id})},action:{label:n("workspace.addEnvironment"),icon:"plus",onClick:()=>u({kind:"detail",workspaceId:T.id})}},T.id)})]})}),O?o.jsx(Yu,{title:n("workspace.deleteTitle"),description:n("workspace.deleteDescription",{name:O.name}),confirmLabel:n("common.delete"),variant:"danger",onCancel:()=>S(null),onConfirm:()=>{const T=O;S(null),gCe(T.id).then(()=>{s(N=>N.filter(_=>_.id!==T.id)),x(!1),y(n("workspace.deleted",{name:T.name})),u({kind:"list"})}).catch(N=>{x(!0),y(N instanceof Error?N.message:String(N))})}}):null]})}function oGt({cloudProvider:e,onProjects:t,initialSection:n="workspaces"}){const[i,r]=p.useState(n),{t:s}=je("ui"),[a,l]=p.useState(null),[c,u]=p.useState(""),d=p.useRef(0),f=()=>{var g;d.current+=1;const h=d.current;u("");let m=null;if(typeof navigator<"u"&&((g=navigator.clipboard)!=null&&g.readText))try{m=navigator.clipboard.readText()}catch{u(s("workspace.clipboardPermissionError"))}else u(s("workspace.clipboardUnsupported"));r("environments"),m&&m.then(async b=>{var v;if(d.current===h){if(b.trim()){l({key:h,text:b});return}try{const y=await((v=navigator.permissions)==null?void 0:v.query({name:"clipboard-read"}));d.current===h&&(y==null?void 0:y.state)==="denied"&&u(s("workspace.clipboardPermissionError"))}catch{}}}).catch(()=>{d.current===h&&u(s("workspace.clipboardPermissionError"))})};return i==="environments"?o.jsx(LFe,{cloudProvider:e,onWorkspace:()=>r("workspaces"),onProjects:t,clipboardImport:a,clipboardReadError:c}):o.jsx(sGt,{onEnvironment:f,onProjects:t})}function aGt(e){return e==="127.0.0.1"}const lGt={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."},cGt={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."},uGt={id:"gitlab-review",kind:"gitlab",category:"development",icon:"gitlab",name:"GitLab MR review",description:"Use a GitLab integration to review merge requests in an isolated Sandbox."};hn.hasResourceBundle("en-US","automations")||hn.addResourceBundle("en-US","automations",fue,!0,!0);hn.hasResourceBundle("zh-CN","automations")||hn.addResourceBundle("zh-CN","automations",pbe,!0,!0);function Qf(e,t={}){return hn.t(e,{...t,ns:"automations"})}const $Fe={name:"repository",label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL",required:!0},FFe={name:"baseBranch",label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base",required:!1},BFe={name:"runtimeName",label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration",required:!0},UFe={name:"runtimeId",label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates",required:!0},dGt="https://ark.cn-beijing.volces.com/api/coding/v3";function fGt(e){return e==="byteplus"?wa(e):dGt}function gq(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 QFe(e){const t=gq(e);return[Qf("github.secretPair",{accessKey:t.accessKey,secretKey:t.secretKey}),Qf("github.sessionToken",{sessionToken:t.sessionToken})]}function bq(e){return e==="byteplus"?"BytePlus":"Volcengine"}function yq(e,t={}){return{repository:"",baseBranch:"main",projectPath:".",runtimeName:"",runtimeId:"",modelName:"",modelBaseUrl:fGt(e),region:qi(e),token:"",...t}}function zFe(e){return{repository:e.repository.trim(),baseBranch:e.baseBranch.trim()||"main",region:e.region,token:e.token.trim()}}const hGt={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})=>yq(e),regionHelp:"",secrets:()=>[],async submit(){throw new Error("PR 自动评审已切换为 GitHub App 授权模式。")}},pGt="https://api.github.com",mGt=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,noe=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,199}$/,gGt=/^[A-Za-z0-9._/-]+$/;function bGt(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 ub(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(`${pGt}${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(bGt(i.status,r,t.token));return{status:i.status,payload:r}}function _4(e){return e.split("/").map(encodeURIComponent).join("/")}function yGt(e){const t=new TextEncoder().encode(e);let n="";const i=32768;for(let r=0;r({...h,path:xq(h.path,"")})),s=AbortSignal.any([t,AbortSignal.timeout(6e4)]),a=`/repos/${n}`;await ub(`${a}`,{token:e.token,expected:[200],signal:s});const c=(f=(await ub(`${a}/git/ref/heads/${_4(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=vGt(e.branchPrefix);await ub(`${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 m of r){const g=_4(m.path),b=await ub(`${a}/contents/${g}?ref=${encodeURIComponent(i)}`,{token:e.token,expected:[200,404],signal:s});if(m.mustBeNew&&b.status===200)throw new Error(V("github.fileAlreadyExists",{path:m.path}));if(b.status===200&&!b.payload.sha)throw new Error(V("github.pathNotUpdatable",{path:m.path}));await ub(`${a}/contents/${g}`,{token:e.token,expected:[200,201],signal:s,method:"PUT",body:{message:m.commitMessage,content:yGt(m.content),branch:u,...b.payload.sha?{sha:b.payload.sha}:{}}})}const h=await ub(`${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 ub(`${a}/git/refs/heads/${_4(u)}`,{token:e.token,expected:[204],signal:AbortSignal.timeout(15e3),method:"DELETE"}).catch(()=>{})}}async function xGt(e,t){const n=await pn("/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 TT(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 wGt(e){const t=await pn("/web/github/app/config",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await TT(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 OGt(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 pn(`/web/github/app/repositories?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await TT(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 kGt(e,t){const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)}),i=await pn(`/web/github/app/review-records?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await TT(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 SGt(e,t){const n=await pn("/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 TT(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 TT(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 EGt=/^[A-Za-z0-9_-]+$/,HFe=4,JR=64,eI=6,roe="agent-runtime";function qFe(e){const t=e.trim();if(!t)return roe;let n=t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,JR);return n?(n.lengthWt(`validation.runtimeName.${n}`)){return e?EGt.test(e)?e.lengthJR?t("length"):null:t("characters"):t("required")}const AGt=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,_Gt="cn-hongkong";function jGt(e){const t=C1(e.runtimeName,n=>Qf(`github.validation.runtimeName.${n}`));if(t)throw new Error(t);if(!AGt.test(e.runtimeId))throw new Error(Qf("github.validation.runtimeId"))}function WFe(e){jGt(e);const t=e.cloudProvider??"volcengine",n=gq(t),i=t==="byteplus"?` +`).replace(/^\n+/,"")}function _j(e,t){const n=`FROM ${e.trim()}`,i=eM(t).replace(/^\n+/,"");return i?`${n} +${i}`:n}function NKt(e,t,n){return t.trim()?/^\s*FROM(?:\s|$)/im.test(e)?_x("duplicateFrom",n):mq(_j(t,e),void 0,n):_x("baseImageRequired",n)}function mq(e,t=DFe(e),n){return t>PFe?_x("tooLarge",n):e.trim()?/^\s*FROM\s+\S+/im.test(e)?"":_x("missingFrom",n):_x("empty",n)}async function RKt(e,t){if(e.size>PFe)return{content:"",error:_x("tooLarge",t)};const n=eM(await e.text());return{content:n,error:mq(n,e.size,t)}}function IKt(e){return AD(e,{lineWidth:0})}function PKt(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 MFe={tos:{mode:"auto"},cr:{mode:"auto"},codePipeline:{mode:"auto"}};function Ah(e){const[t,n]=p.useState([]),[i,r]=p.useState(""),[s,a]=p.useState(1),[l,c]=p.useState(0),[u,d]=p.useState(!1),[f,h]=p.useState(!1),[m,g]=p.useState(null),[b,v]=p.useState(""),[y,w]=p.useState(""),[x,O]=p.useState(""),[S,k]=p.useState(0),C=p.useRef(!1),E=p.useRef(null),R=e?JSON.stringify(e):"",A=e?JSON.stringify({...e,search:y}):"";p.useEffect(()=>{const I=window.setTimeout(()=>{w(b.trim())},250);return()=>window.clearTimeout(I)},[b]),p.useEffect(()=>{v(""),w("")},[R]);const N=p.useCallback((I,D)=>{var B;if(!A)return;(B=E.current)==null||B.abort();const P=new AbortController;E.current=P;const L=JSON.parse(A);D&&n([]),C.current=!0,h(!0),g(null),dCe({...L,pageNumber:I,pageSize:100},P.signal).then(M=>{n(H=>{if(D)return M.items;const K=new Set(H.map(F=>`${F.id}\0${F.name}`));return[...H,...M.items.filter(F=>!K.has(`${F.id}\0${F.name}`))]}),r(M.serviceRegion),a(M.pageNumber),c(M.totalCount),d(M.hasMore),O(A)}).catch(M=>{M instanceof DOMException&&M.name==="AbortError"||(O(A),g(M instanceof Error?M.message:String(M)))}).finally(()=>{E.current===P&&(E.current=null,C.current=!1,h(!1))})},[A]);p.useEffect(()=>{var I;if(!A){(I=E.current)==null||I.abort(),E.current=null,C.current=!1,n([]),r(""),a(1),c(0),d(!1),O(""),h(!1),g(null);return}return N(1,!0),()=>{var D;return(D=E.current)==null?void 0:D.abort()}},[N,A,S]);const T=!!A&&x===A&&b.trim()===y,j=p.useCallback(()=>{O(""),k(I=>I+1)},[]),_=p.useCallback(()=>{!T||C.current||!u||N(s+1,!1)},[u,N,s,T]);return{items:t,serviceRegion:i,totalCount:l,hasMore:T?u:!1,loading:!!A&&(!T||f),error:m,search:b,setSearch:v,reload:j,loadMore:_}}function DKt(e,t){return e.map(n=>({value:n[t],label:n.name,description:[n.status,n.region,n.id].filter(Boolean).join(" · ")}))}function _h({ariaLabel:e,value:t,valueLabel:n,state:i,disabled:r,disabledMessage:s,valueField:a="id",onChange:l}){const{t:c}=_e("ui"),u=p.useMemo(()=>DKt(i.items,a),[i.items,a]);return o.jsxs("div",{className:"pp-resource-picker",children:[o.jsx(Ng,{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 LFe({region:e,value:t,disabled:n=!1,onChange:i}){const{t:r}=_e("ui"),s=Ah(e?{kind:"cr-registry",region:e}:null),a=Ah(e&&(t!=null&&t.registry)?{kind:"cr-namespace",region:e,registry:t.registry}:null),l=Ah(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(_h,{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(_h,{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(_h,{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 T4({resource:e,value:t,disabled:n,onChange:i}){const{t:r}=_e("ui");return o.jsxs("label",{className:"pp-resource-field pp-resource-mode",children:[o.jsx("span",{children:r("deploymentResources.configurationMode")}),o.jsx(Ng,{ariaLabel:r("deploymentResources.configurationModeAriaLabel",{resource:e}),value:t,placeholder:r("deploymentResources.selectConfigurationMode"),options:PKt(r),disabled:n,onChange:s=>i(s)})]})}function Y0({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 A4({items:e,note:t}){const{t:n}=_e("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 $Fe(e){var t,n,i,r,s,a,l,c;return e.tos.mode!=="auto"&&!((t=e.tos.bucket)!=null&&t.trim())?mn.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()))?mn.t("ui:deploymentResources.validation.cr"):e.codePipeline.mode!=="auto"&&(!((s=e.codePipeline.workspaceName)!=null&&s.trim())||!((a=e.codePipeline.pipelineName)!=null&&a.trim()))?mn.t("ui:deploymentResources.validation.codePipeline"):e.codePipeline.mode==="existing"&&(!((l=e.codePipeline.workspaceId)!=null&&l.trim())||!((c=e.codePipeline.pipelineId)!=null&&c.trim()))?mn.t("ui:deploymentResources.validation.existingCodePipeline"):null}function FFe({value:e,agentName:t,runtimeName:n,region:i,disabled:r,validationError:s,onChange:a}){const{t:l}=_e("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=Ah(e.tos.mode==="existing"?{kind:"tos-bucket",region:i}:null),h=Ah(e.cr.mode==="existing"?{kind:"cr-registry",region:i}:null),m=Ah(e.cr.mode==="existing"&&e.cr.instance?{kind:"cr-namespace",region:i,registry:e.cr.instance}:null),g=Ah(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=Ah(e.codePipeline.mode==="existing"?{kind:"cp-workspace",region:i}:null),v=Ah(e.codePipeline.mode==="existing"&&e.codePipeline.workspaceId?{kind:"cp-pipeline",region:i,workspaceId:e.codePipeline.workspaceId}:null),y=w=>a({...e,...w});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(T4,{resource:l("deploymentResources.tosBucket"),value:e.tos.mode,disabled:r,onChange:w=>y({tos:{mode:w}})}),e.tos.mode==="create"&&o.jsx(Y0,{label:l("deploymentResources.bucketName"),value:e.tos.bucket??"",placeholder:l("deploymentResources.bucketNamePlaceholder"),disabled:r,onChange:w=>y({tos:{...e.tos,bucket:w}})}),e.tos.mode==="existing"&&o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.existingBucket")}),o.jsx(_h,{ariaLabel:l("deploymentResources.existingTosBucket"),value:e.tos.bucket??"",valueLabel:e.tos.bucket,state:f,disabled:r,onChange:w=>y({tos:{...e.tos,bucket:w.name}})})]}),e.tos.mode==="auto"&&o.jsx(A4,{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(T4,{resource:"CR",value:e.cr.mode,disabled:r,onChange:w=>y({cr:{mode:w}})}),e.cr.mode==="create"&&o.jsxs("div",{className:"pp-resource-fields pp-resource-fields-three",children:[o.jsx(Y0,{label:l("deploymentResources.instanceName"),value:e.cr.instance??"",placeholder:l("deploymentResources.crInstance"),disabled:r,onChange:w=>y({cr:{...e.cr,instance:w}})}),o.jsx(Y0,{label:l("deploymentResources.namespace"),value:e.cr.namespace??"",placeholder:l("deploymentResources.namespace"),disabled:r,onChange:w=>y({cr:{...e.cr,namespace:w}})}),o.jsx(Y0,{label:l("deploymentResources.repository"),value:e.cr.repository??"",placeholder:l("deploymentResources.repository"),disabled:r,onChange:w=>y({cr:{...e.cr,repository:w}})})]}),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(_h,{ariaLabel:l("deploymentResources.existingCrInstance"),value:e.cr.instance??"",valueLabel:e.cr.instance,state:h,disabled:r,valueField:"name",onChange:w=>y({cr:{mode:"existing",instance:w.name}})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.namespace")}),o.jsx(_h,{ariaLabel:l("deploymentResources.existingCrNamespace"),value:e.cr.namespace??"",valueLabel:e.cr.namespace,state:m,disabled:r||!e.cr.instance,valueField:"name",onChange:w=>y({cr:{...e.cr,namespace:w.name,repository:void 0}})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.repository")}),o.jsx(_h,{ariaLabel:l("deploymentResources.existingCrRepository"),value:e.cr.repository??"",valueLabel:e.cr.repository,state:g,disabled:r||!e.cr.namespace,valueField:"name",onChange:w=>y({cr:{...e.cr,repository:w.name}})})]})]}),e.cr.mode==="auto"&&o.jsx(A4,{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(T4,{resource:"CodePipeline",value:e.codePipeline.mode,disabled:r,onChange:w=>y({codePipeline:{mode:w}})}),e.codePipeline.mode==="create"&&o.jsxs("div",{className:"pp-resource-fields",children:[o.jsx(Y0,{label:l("deploymentResources.workspaceName"),value:e.codePipeline.workspaceName??"",placeholder:l("deploymentResources.workspaceName"),disabled:r,onChange:w=>y({codePipeline:{...e.codePipeline,workspaceName:w}})}),o.jsx(Y0,{label:l("deploymentResources.pipelineName"),value:e.codePipeline.pipelineName??"",placeholder:l("deploymentResources.pipelineName"),disabled:r,onChange:w=>y({codePipeline:{...e.codePipeline,pipelineName:w}})})]}),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(_h,{ariaLabel:l("deploymentResources.existingWorkspace"),value:e.codePipeline.workspaceId??"",valueLabel:e.codePipeline.workspaceName,state:b,disabled:r,onChange:w=>y({codePipeline:{mode:"existing",workspaceId:w.id,workspaceName:w.name}})})]}),o.jsxs("label",{className:"pp-resource-field",children:[o.jsx("span",{children:l("deploymentResources.compatiblePipeline")}),o.jsx(_h,{ariaLabel:l("deploymentResources.existingPipeline"),value:e.codePipeline.pipelineId??"",valueLabel:e.codePipeline.pipelineName,state:v,disabled:r||!e.codePipeline.workspaceId,onChange:w=>y({codePipeline:{...e.codePipeline,pipelineId:w.id,pipelineName:w.name}})})]})]}),e.codePipeline.mode==="auto"&&o.jsx(A4,{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 MKt(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 LKt=mIe.map(e=>({value:e.id,label:e.label,description:e.description}));function $Kt(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 FKt(e){const t=_Kt(e,"");return t===Dz?"aio-sandbox":t.includes("/codexenv:")?"codex-sandbox":"none"}const BKt=eR.map(e=>({value:e.id,label:e.label})),Zse=bIe.map(e=>({value:e.id,label:e.label}));function UKt(e){return[{value:"managed",label:e("environmentCenter.repository.managed")},{value:"existing",label:e("environmentCenter.repository.existing")}]}const r9=20,Jse=new Set;async function QKt(){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 zKt={opencli:YWt,uv:ZWt,playwright:JWt,chromium:eKt,git:tKt,curl:nKt,ffmpeg:iKt,imagemagick:rKt};function VKt(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 kd(){return o.jsx("span",{className:"environment-required-mark","aria-hidden":"true",children:"*"})}function HKt(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 s9(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 eoe(e){return!!(e!=null&&e.region&&e.registry&&e.namespace&&e.repository)}function BFe(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 qKt(e){return(e instanceof Error?e.message:String(e)).split(` +原始响应:`,1)[0].trim()}function WKt(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 KKt({label:e}){return o.jsx("span",{className:"environment-package-fallback",children:e.slice(0,1).toUpperCase()})}function GKt({option:e}){if(e.id==="lark-cli")return o.jsx("img",{src:JD,alt:""});if(e.id==="pandoc")return o.jsx("img",{src:XWt,alt:""});if(e.id==="github-cli")return o.jsx(hq,{});const t=zKt[e.id];return t?o.jsx("img",{src:t,alt:""}):o.jsx(KKt,{label:e.label})}function XKt(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===Lz(e,t)?void 0:e.dockerfile,gitSource:e.gitSource,containerRepository:e.containerRepository,imageSource:e.imageSource}:{...$L,optionIds:[...$L.optionIds],selectedSkills:[...$L.selectedSkills]}}const qb=new Set(["preparing","queued","building","scanning"]),toe=3e3,_4={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 UFe(e,t){var i;const n=(i=e.latestVersion)==null?void 0:i.status;return n?n==="available"?{label:t(_4[n]),color:"success"}:n==="failed"?{label:t(_4[n]),color:"danger"}:{label:t(_4[n]),color:"warning"}:{label:t("environmentCenter.buildStatus.notBuilt"),color:"secondary"}}function YKt(e,t){return XD(e,Date.now(),t)}function ZKt(e,t){const n=Date.parse(e);return Number.isNaN(n)?e:new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"medium"}).format(n)}function JKt(e,t,n=Date.now()){const i=Date.parse(e.createdAt),s=qb.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 eGt({environment:e,onClose:t}){var x;const{t:n}=_e("ui"),i=((x=e.latestVersion)==null?void 0:x.versionId)??"",r=p.useId(),s=p.useRef(null),a=p.useRef(t),[l,c]=p.useState(null),[u,d]=p.useState(!0),[f,h]=p.useState(""),[m,g]=p.useState(0),[b,v]=p.useState("idle"),y=p.useMemo(()=>l?IKt(l):"",[l]);a.current=t,p.useEffect(()=>{var C;const O=document.body.style.overflow,S=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(C=s.current)==null||C.focus();const k=E=>{if(E.key==="Escape"){E.preventDefault(),a.current();return}if(E.key!=="Tab"||!s.current)return;const R=Array.from(s.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')).filter(T=>T.getClientRects().length>0);if(!R.length)return;const A=R[0],N=R[R.length-1];E.shiftKey&&document.activeElement===A?(E.preventDefault(),N.focus()):!E.shiftKey&&document.activeElement===N&&(E.preventDefault(),A.focus())};return window.addEventListener("keydown",k),()=>{document.body.style.overflow=O,window.removeEventListener("keydown",k),S!=null&&S.isConnected&&S.focus()}},[]),p.useEffect(()=>{const O=new AbortController;return d(!0),h(""),ICe(e.id,i,O.signal).then(c).catch(S=>{(S==null?void 0:S.name)!=="AbortError"&&h(S instanceof Error?S.message:String(S))}).finally(()=>{O.signal.aborted||d(!1)}),()=>O.abort()},[e.id,m,i]),p.useEffect(()=>{if(b!=="copied")return;const O=window.setTimeout(()=>v("idle"),1500);return()=>window.clearTimeout(O)},[b]);const w=async()=>{try{await navigator.clipboard.writeText(y),v("copied")}catch{v("error")}};return ri.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:O=>{O.target===O.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(It,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":n("environmentCenter.manifest.closeLabel"),children:o.jsx(Ta,{"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(bn,{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(It,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>g(O=>O+1),children:n("common.reload")})]}):o.jsx("div",{className:"environment-manifest-dialog__editor","aria-label":n("environmentCenter.manifest.editorLabel"),children:o.jsx(ST,{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(It,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:n("common.close")}),o.jsx(It,{type:"button",color:"info",size:"sm",disabled:!y,onClick:()=>void w(),children:n(b==="copied"?"environmentCenter.manifest.copied":"environmentCenter.manifest.copy")})]})]})}),document.body)}function tGt({environment:e,onClose:t,onBuildUpdate:n,onRebuild:i}){var k,C;const{t:r}=_e("ui"),s=e.latestVersion,[a,l]=p.useState(s),[c,u]=p.useState(!!s),[d,f]=p.useState(""),[h,m]=p.useState(Date.now()),[g,b]=p.useState(!1),v=p.useId(),y=p.useRef(null),w=p.useRef(t),x=p.useRef(n);p.useEffect(()=>{w.current=t,x.current=n},[n,t]),p.useEffect(()=>{var N;const E=document.body.style.overflow,R=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(N=y.current)==null||N.focus();const A=T=>{var D;if(T.key==="Escape"&&w.current(),T.key!=="Tab")return;const j=Array.from(((D=y.current)==null?void 0:D.querySelectorAll('button:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])'))??[]).filter(P=>P.getClientRects().length>0);if(!j.length)return;const _=j[0],I=j[j.length-1];T.shiftKey&&document.activeElement===_?(T.preventDefault(),I.focus()):!T.shiftKey&&document.activeElement===I&&(T.preventDefault(),_.focus())};return window.addEventListener("keydown",A),()=>{document.body.style.overflow=E,window.removeEventListener("keydown",A),R!=null&&R.isConnected&&R.focus()}},[]),p.useEffect(()=>{if(!s)return;let E=0;const R=new AbortController,A=async()=>{u(!0);try{const N=await RCe(e.id,s.versionId,{includeLogs:!0,signal:R.signal});l(N),f(""),x.current(N),qb.has(N.status)&&(E=window.setTimeout(A,toe))}catch(N){if((N==null?void 0:N.name)==="AbortError")return;f(N instanceof Error?N.message:String(N)),E=window.setTimeout(A,toe)}finally{R.signal.aborted||u(!1)}};return A(),()=>{R.abort(),window.clearTimeout(E)}},[e.id,s==null?void 0:s.versionId]),p.useEffect(()=>{if(!a||!qb.has(a.status))return;const E=window.setInterval(()=>m(Date.now()),1e3);return()=>window.clearInterval(E)},[a==null?void 0:a.status]);const O=a?UFe({...e,latestVersion:a},r):{label:r("environmentCenter.buildStatus.notBuilt"),color:"secondary"},S=e.imageSource||(C=(k=a==null?void 0:a.resources)==null?void 0:k.codePipeline)==null?void 0:C.consoleUrl;return ri.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:E=>{E.target===E.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(zo,{color:O.color,size:"sm",children:O.label})]}),o.jsx("p",{children:e.name})]}),o.jsx(It,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,onClick:t,"aria-label":r("environmentCenter.buildDetails.closeLabel"),children:o.jsx(Ta,{"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?JKt(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,S?o.jsxs("a",{href:S,target:"_blank",rel:"noreferrer",children:[r("environmentCenter.buildDetails.openCodePipeline")," ",o.jsx(wy,{"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(cKt,{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&&qb.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(It,{type:"button",color:"secondary",variant:"ghost",size:"sm",onClick:t,children:r("common.close")}),a&&!e.imageSource&&!qb.has(a.status)?o.jsx(It,{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 QFe({cloudProvider:e,value:t,disabled:n,onChange:i}){const{t:r}=_e("ui"),s=nu(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(kd,{})]}),o.jsx(no,{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 nGt({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}=_e("ui"),[h,m]=p.useState(!1),[g,b]=p.useState(""),v=p.useRef(null),y=p.useRef(""),w=`${e.trim()}\0${t.trim()}`,x=r===w;p.useEffect(()=>()=>{const C=v.current;v.current=null,C==null||C.abort()},[]);const O=()=>{var C;(C=v.current)==null||C.abort(),v.current=null,m(!1),b(""),u(null),d(""),c(""),y.current=""},S=p.useCallback(async()=>{var R;const C=s9(e,f);if(C){b(C);return}y.current=w,(R=v.current)==null||R.abort();const E=new AbortController;v.current=E,m(!0),b("");try{const A=await SCe({repositoryUrl:e.trim(),...t.trim()?{ref:t.trim()}:{}},E.signal);if(v.current!==E)return;u(A),d(w),c(A.dockerfiles.length===1?A.dockerfiles[0]:"")}catch(A){if((A==null?void 0:A.name)==="AbortError")return;b(qKt(A)),u(null),d(""),c("")}finally{v.current===E&&(v.current=null,m(!1))}},[w,t,c,d,u,e,f]);p.useEffect(()=>{if(s||x||y.current===w||s9(e,f))return;const C=window.setTimeout(()=>void S(),600);return()=>window.clearTimeout(C)},[w,s,S,x,e,f]);const k=x?(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(kd,{})]}),o.jsx(ms,{size:"lg",type:"url",required:!0,value:e,placeholder:"https://github.com/owner/repository.git",autoComplete:"url",disabled:s,"aria-invalid":!!g,onChange:C=>{O(),a(C.currentTarget.value)}})]}),o.jsxs("label",{className:"environment-field",children:[o.jsx("span",{children:f("environmentCenter.git.ref")}),o.jsx(ms,{size:"lg",value:t,placeholder:f("environmentCenter.git.defaultBranch"),autoComplete:"off",disabled:s,onChange:C=>{O(),l(C.currentTarget.value)}})]})]}),o.jsxs("div",{className:"environment-inspection-status environment-form-feedback","aria-live":"polite",children:[h?o.jsx(bn,{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(It,{type:"button",color:"primary",size:"sm",pill:!1,disabled:s,onClick:()=>void S(),children:[o.jsx(mP,{}),f("common.retry")]})]}):null,!h&&!g&&x&&i?k.length>0?o.jsx("span",{children:i.commitSha?f("environmentCenter.git.foundDockerfiles",{commit:i.commitSha.slice(0,12),count:k.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 S(),children:f("environmentCenter.git.inspectAgain")})]}):null]}),k.length>0?o.jsxs("label",{className:"environment-field environment-dockerfile-picker",children:[o.jsxs("span",{children:["Dockerfile",o.jsx(kd,{})]}),o.jsx(Ng,{ariaLabel:f("environmentCenter.git.selectDockerfile"),value:n,valueLabel:n,placeholder:f("environmentCenter.git.selectDockerfile"),options:k.map(C=>({value:C,label:C})),disabled:s||h,onChange:c})]}):null]})}function iGt({cloudProvider:e,mode:t,region:n,value:i,disabled:r,onModeChange:s,onRegionChange:a,onChange:l}){const{t:c}=_e("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(kd,{})]}),o.jsx(no,{id:"environment-repository-mode",value:t,options:UKt(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(QFe,{cloudProvider:e,value:n,disabled:r,onChange:a}),t==="existing"?o.jsx(LFe,{region:n,value:i,disabled:r,onChange:l}):o.jsx("p",{className:"environment-source-note environment-form-feedback",children:c("environmentCenter.repository.managedHint")})]})})}function rGt({cloudProvider:e,region:t,repository:n,reference:i,disabled:r,onRegionChange:s,onRepositoryChange:a,onReferenceChange:l}){const{t:c}=_e("ui"),u=BFe(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(QFe,{cloudProvider:e,value:t,disabled:r,onChange:s}),o.jsx(LFe,{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(kd,{})]}),o.jsx(ms,{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 zFe(e,t,n,i){const r=p.useRef(n),s=p.useRef(i);r.current=n,s.current=i,p.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],m=f[f.length-1];d.shiftKey&&document.activeElement===h?(d.preventDefault(),m.focus()):!d.shiftKey&&document.activeElement===m&&(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 sGt({environment:e,onClose:t}){const{t:n}=_e("ui"),i=p.useId(),r=p.useId(),s=p.useRef(null),a=p.useRef(null),[l,c]=p.useState(""),[u,d]=p.useState("loading"),[f,h]=p.useState(""),m=u==="loading";zFe(s,a,t,m);const g=async(b="",v)=>{d("loading"),h("");try{const y=b||(await ECe(e.id,v)).shareCode;c(y),await pCe(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 p.useEffect(()=>{const b=new AbortController;return g("",b.signal),()=>b.abort()},[e.id]),ri.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:b=>{b.target===b.currentTarget&&!m&&t()},children:o.jsxs("section",{ref:s,className:"environment-share-dialog",role:"dialog","aria-modal":"true","aria-labelledby":i,"aria-describedby":r,"aria-busy":m||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(It,{ref:a,type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:m,onClick:t,"aria-label":n("environmentCenter.share.closeLabel"),children:o.jsx(Ta,{"aria-hidden":!0})})]}),o.jsx("div",{className:"environment-share-dialog__body",children:u==="loading"?o.jsx(bn,{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(Eg,{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(It,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:m,onClick:t,children:n("common.close")}),u==="error"?o.jsx(It,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("common.retry")}):u==="copied"?o.jsx(It,{type:"button",color:"info",size:"sm",onClick:()=>void g(l),children:n("environmentCenter.share.copyAgain")}):null]})]})}),document.body)}function oGt({initialValue:e,autoInspect:t,onClose:n,onImported:i}){const{t:r}=_e("ui"),s=p.useId(),a=p.useId(),l=p.useId(),c=p.useRef(null),u=p.useRef(null),d=p.useRef(!1),[f,h]=p.useState(e),[m,g]=p.useState("editing"),[b,v]=p.useState([]),[y,w]=p.useState(""),[x,O]=p.useState([]),S=p.useMemo(()=>RU(f),[f]),k=S.length>r9,C=m==="inspecting"||m==="importing",E=b.filter(_=>_.status==="valid"),R=b.filter(_=>_.status==="invalid"),A=m==="ready"&&E.length>0;zFe(c,u,n,C);const N=p.useCallback(async()=>{if(!(!S.length||k)){g("inspecting"),w(""),O([]);try{const _=await CCe(S);v([..._].sort((I,D)=>I.index-D.index)),g("ready")}catch(_){w(_ instanceof Error?_.message:String(_)),g("editing")}}},[S,k]);p.useEffect(()=>{!t||d.current||(d.current=!0,N())},[t,N]);const T=async()=>{if(A){g("importing"),w(""),O([]);try{const _=E.map(F=>({code:S[F.index],name:F.name})).filter(F=>!!F.code),I=await TCe(_.map(F=>F.code)),D=I.filter(F=>F.status==="created").length,P=I.filter(F=>F.status==="duplicate").length,L=new Map(I.map(F=>[F.index,F])),B=_.flatMap(({code:F,name:q},Q)=>{const X=L.get(Q);return!X||X.status==="failed"?[{code:F,name:q,status:"valid",error:(X==null?void 0:X.error)||r("environmentCenter.import.noResult")}]:[]}),H=[...R.flatMap(F=>{const q=S[F.index];return q?[{code:q,name:"",status:"invalid",error:F.error||r("environmentCenter.import.invalidCode")}]:[]}),...B],K=new Map;if(I.forEach(F=>{F.environment&&K.set(F.environment.id,F.environment)}),i([...K.values()],D,P,H.length),!H.length){n();return}h(H.map(F=>F.code).join(` +`)),O(B),v(H.map((F,q)=>({index:q,status:F.status,name:F.name,error:F.status==="invalid"?F.error:""}))),w(r("environmentCenter.import.partial",{created:D,remaining:H.length})),g("ready")}catch(_){w(_ instanceof Error?_.message:String(_)),g("ready")}}},j=m==="inspecting"?r("environmentCenter.import.inspecting"):m==="importing"?r("environmentCenter.import.importing"):A?x.length?r("environmentCenter.import.retryImport"):r("environmentCenter.import.confirm"):r("environmentCenter.import.inspectCodes");return ri.createPortal(o.jsx("div",{className:"environment-build-dialog__backdrop",onMouseDown:_=>{_.target===_.currentTarget&&!C&&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":C||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(It,{type:"button",color:"secondary",variant:"ghost",size:"sm",uniform:!0,disabled:C,onClick:n,"aria-label":r("environmentCenter.import.closeLabel"),children:o.jsx(Ta,{"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(Eg,{ref:u,size:"lg",rows:6,value:f,disabled:C,"aria-invalid":k||R.length>0||void 0,"aria-describedby":l,placeholder:"akenv://v1/...",onChange:_=>{h(_.currentTarget.value),g("editing"),v([]),w(""),O([])}})]}),o.jsx("p",{id:l,className:`environment-share-dialog__help${k?" is-error":""}`,children:k?r("environmentCenter.import.tooMany",{max:r9,count:S.length}):r("environmentCenter.import.multipleHint")}),o.jsx("p",{className:"environment-share-dialog__safety",children:r("environmentCenter.import.safety")}),m==="inspecting"?o.jsx(bn,{as:"p",children:r("environmentCenter.import.inspectingCodes")}):E.length?o.jsx("p",{className:"environment-share-dialog__summary",role:"status","aria-live":"polite",children:r("environmentCenter.import.found",{count:E.length,names:E.map(_=>_.name||r("environmentCenter.unnamed")).join(r("environmentCenter.listSeparator"))})}):null,R.length?o.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:R.map(_=>o.jsx("li",{children:r("environmentCenter.import.itemError",{index:_.index+1,error:_.error||r("environmentCenter.import.invalidCode")})},_.index))}):null,x.length?o.jsx("ul",{className:"environment-share-dialog__failures",role:"alert",children:x.map((_,I)=>o.jsx("li",{children:r("environmentCenter.import.itemError",{index:I+1,error:_.error})},`${_.code}:${I}`))}):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(It,{type:"button",color:"secondary",variant:"ghost",size:"sm",disabled:C,onClick:n,children:r("common.cancel")}),o.jsx(It,{type:"button",color:"info",size:"sm",loading:C,disabled:C||!S.length||k||m==="ready"&&!A,onClick:()=>A?void T():void N(),children:j})]})]})}),document.body)}function aGt({environment:e,cloudProvider:t,onCancel:n,onDelete:i,onShare:r,onSave:s}){var He,De,At,Nt,Ot,vt,Tt;const{t:a,i18n:l}=_e("ui"),c=MKt(a),u=XKt(e,t),d=u.dockerfile!==void 0,[f,h]=p.useState(()=>({...u,dockerfile:d?void 0:u.dockerfile})),[m,g]=p.useState(u.gitSource?"git":u.imageSource?"image":d?"dockerfile":"custom"),[b,v]=p.useState(d?(e==null?void 0:e.dockerfile)??"":""),[y,w]=p.useState(""),x=p.useRef(null),[O,S]=p.useState(()=>d?FKt((e==null?void 0:e.dockerfile)??""):u.baseEnvironment==="aio-sandbox"||u.baseEnvironment==="codex-sandbox"?u.baseEnvironment:"none"),[k,C]=p.useState(((He=u.gitSource)==null?void 0:He.repositoryUrl)??""),[E,R]=p.useState(((De=u.gitSource)==null?void 0:De.ref)??""),[A,N]=p.useState(((At=u.gitSource)==null?void 0:At.dockerfilePath)??""),[T,j]=p.useState(u.gitSource?{repositoryUrl:u.gitSource.repositoryUrl,ref:u.gitSource.ref??"",commitSha:"",dockerfiles:[u.gitSource.dockerfilePath]}:null),[_,I]=p.useState(u.gitSource?`${u.gitSource.repositoryUrl}\0${u.gitSource.ref??""}`:""),[D,P]=p.useState(u.containerRepository?"existing":"managed"),[L,B]=p.useState(((Nt=u.containerRepository)==null?void 0:Nt.region)??Xi(t)),[M,H]=p.useState(u.containerRepository??void 0),[K,F]=p.useState(((Ot=u.imageSource)==null?void 0:Ot.region)??Xi(t)),[q,Q]=p.useState(u.imageSource?{region:u.imageSource.region,registry:u.imageSource.registry,namespace:u.imageSource.namespace,repository:u.imageSource.repository}:void 0),[X,ne]=p.useState(((vt=u.imageSource)==null?void 0:vt.reference)??""),[z,Y]=p.useState(!1),ae=p.useMemo(()=>Lz(f,t),[t,f.baseEnvironment,f.operatingSystem,f.language,f.optionIds]),Ee=f.dockerfile??ae,Z=O!=="none",G=O==="aio-sandbox"?Dz:O==="codex-sandbox"?gIe[t]:"",te=Z?jKt(b):b,de=Z?_j(G,""):"",Ce=Z?_j(G,te):b,le=y||(Z?NKt(te,G,a):mq(b,void 0,a)),fe=!!e,ce="environment-editor-form",[Te,Me]=p.useState(!1),[we,Ue]=p.useState(""),ke=!!Ce.trim()&&!le,je=`${k.trim()}\0${E.trim()}`,re=!s9(k,a)&&_===je&&!!A&&(D==="managed"||eoe(M)),ve=eoe(q)&&!!X.trim()&&!BFe(X,a),be=!!f.name.trim()&&!Te&&(m==="custom"||m==="dockerfile"&&ke||m==="git"&&re||m==="image"&&ve),xe=(ft,pt)=>{h(Pe=>({...Pe,optionIds:pt?[...Pe.optionIds,ft]:Pe.optionIds.filter(yt=>yt!==ft)}))},Ke=ft=>{w(""),v(Z?_j(G,ft):ft)},Ze=async ft=>{if(!ft)return;const pt=await RKt(ft,a);w(pt.error),pt.content&&v(pt.content)},he=()=>{w(""),v(de)},ye=async ft=>{if(ft.preventDefault(),!!be){Me(!0),Ue("");try{const pt=rwt(Ce);await s({...f,name:f.name.trim(),description:f.description.trim(),optionIds:m==="custom"?f.optionIds:[],selectedSkills:m==="custom"?f.selectedSkills:[],dockerfile:m==="dockerfile"?Ce:m==="custom"?Ee:"",gitSource:m==="git"?{repositoryUrl:k.trim(),...E.trim()?{ref:E.trim()}:{},dockerfilePath:A}:null,containerRepository:m==="git"&&D==="existing"?M:null,imageSource:m==="image"&&q?{...q,reference:X.trim()}:null,...m==="dockerfile"?pt:{}})}catch(pt){Ue(pt instanceof Error?pt.message:String(pt)),Me(!1)}}},Ae=f.name.trim()||(fe?(e==null?void 0:e.name)||a("environmentCenter.configure"):a("environmentCenter.create"));return o.jsx(Bf,{className:"environment-editor","aria-label":a(fe?"environmentCenter.details":"environmentCenter.create"),children:o.jsx(XC,{title:Ae,description:a("environmentCenter.editorDescription"),identitySeed:Ae,backLabel:a("environmentCenter.backToList"),onBack:n,actions:o.jsxs(o.Fragment,{children:[i?o.jsx(It,{type:"button",color:"danger",variant:"ghost",size:"sm",onClick:i,disabled:Te,children:a("common.delete")}):null,r?o.jsx(It,{color:"secondary",variant:"soft",size:"sm",onClick:r,disabled:Te,children:a("environmentCenter.share.action")}):null,o.jsx(It,{color:"secondary",variant:"soft",size:"sm",onClick:n,disabled:Te,children:a("common.cancel")}),o.jsx(It,{color:"info",size:"sm",type:"submit",form:ce,disabled:!be,children:a(Te?"common.saving":m==="image"?fe?"environmentCenter.save":"environmentCenter.create":fe?"environmentCenter.saveAndBuild":"environmentCenter.createAndBuild")})]}),children:o.jsxs("form",{id:ce,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(kd,{})]}),o.jsx(ms,{className:"environment-text-input",type:"text",size:"lg",required:!0,value:f.name,maxLength:60,placeholder:a("environmentCenter.namePlaceholder"),onChange:ft=>h(pt=>({...pt,name:ft.target.value}))})]}),o.jsxs("label",{className:"environment-field",children:[o.jsx("span",{children:a("common.description")}),o.jsx(Eg,{className:"environment-description-input",size:"lg",rows:3,value:f.description,maxLength:180,placeholder:a("environmentCenter.descriptionPlaceholder"),onChange:ft=>h(pt=>({...pt,description:ft.target.value}))})]})]}),o.jsxs("label",{className:"environment-field environment-creation-method",children:[o.jsxs("span",{children:[a("environmentCenter.creationMethod"),o.jsx(kd,{})]}),o.jsx(no,{id:"environment-creation-method",value:m,options:c,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:ft=>{const pt=ft.value;g(pt),pt==="dockerfile"&&!b.trim()&&v(de),Ue("")}}),o.jsx("small",{children:(Tt=c.find(ft=>ft.value===m))==null?void 0:Tt.description})]}),we?o.jsx("p",{className:"environment-form-error",role:"alert",children:we}):null,m==="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(kd,{})]}),o.jsx(no,{id:"environment-base-environment",value:f.baseEnvironment,options:LKt.map(ft=>({...ft,description:a(`environmentCenter.baseDescriptions.${ft.value}`)})),optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:ft=>{const pt=ft.value,Pe=pt==="aio-sandbox"||pt==="codex-sandbox";h(yt=>({...yt,baseEnvironment:pt,operatingSystem:Pe?"ubuntu-22.04":yt.operatingSystem,language:Pe?"python-3.12":yt.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(kd,{})]}),o.jsx(no,{id:"environment-operating-system",value:f.operatingSystem,options:BKt,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:ft=>h(pt=>({...pt,operatingSystem:ft.value}))}),o.jsx("small",{children:f.baseEnvironment!=="ubuntu"?a("environmentCenter.fixedByBase",{base:l8(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(kd,{})]}),o.jsx(no,{id:"environment-python-version",value:f.language,options:f.baseEnvironment!=="ubuntu"?Zse.filter(ft=>ft.value==="python-3.12"):Zse,optionClassName:"environment-select-option",required:!0,size:"lg",block:!0,pill:!1,disabled:f.baseEnvironment!=="ubuntu",triggerClassName:"environment-select-trigger",onChange:ft=>h(pt=>({...pt,language:ft.value}))}),o.jsx("small",{children:f.baseEnvironment!=="ubuntu"?a("environmentCenter.fixedByBase",{base:l8(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(Yse,{name:"VeADK",description:a("environmentCenter.veadkDescription"),selected:z,disabled:Te,onChange:Y,icon:o.jsx("img",{src:NP,alt:""})}),o.jsx(pq,{selected:f.selectedSkills,onChange:ft=>h(pt=>({...pt,selectedSkills:ft})),cloudProvider:t,disabled:Te,addLabel:a("environmentCenter.addSkill"),showSelectedCount:!1})]})]}),Mz.map(ft=>o.jsxs("section",{className:"environment-section","aria-labelledby":`environment-${ft.id}-title`,children:[o.jsx("h2",{id:`environment-${ft.id}-title`,children:a(`environmentCenter.categories.${ft.id}`)}),o.jsx("div",{className:"environment-option-grid",children:ft.options.map(pt=>{const Pe=f.optionIds.includes(pt.id);return o.jsx(Yse,{name:pt.label,description:a(`environmentCenter.options.${pt.id}`,{defaultValue:pt.description}),selected:Pe,onChange:yt=>xe(pt.id,yt),icon:o.jsx(GKt,{option:pt})},pt.id)})})]},ft.id))]}):m==="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(no,{id:"environment-dockerfile-base-environment",value:O,options:$Kt(a),optionClassName:"environment-select-option",size:"lg",block:!0,pill:!1,triggerClassName:"environment-select-trigger",onChange:ft=>{w(""),S(ft.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(kd,{})]}),o.jsxs("div",{className:"environment-upload__actions",children:[o.jsx("span",{className:"environment-upload__size",children:a("environmentCenter.dockerfileSize",{size:DFe(Ce).toLocaleString(l.resolvedLanguage??l.language),max:131072 .toLocaleString(l.resolvedLanguage??l.language)})}),o.jsx("input",{ref:x,className:"environment-upload__file-input",type:"file",accept:".dockerfile,text/plain",tabIndex:-1,hidden:!0,onChange:ft=>{var Pe;const pt=ft.currentTarget;Ze((Pe=pt.files)==null?void 0:Pe[0]).finally(()=>{pt.value=""})}}),o.jsx(It,{className:"environment-upload__action",type:"button",color:"secondary",variant:"soft",size:"sm",pill:!1,disabled:Te,onClick:()=>{var ft;return(ft=x.current)==null?void 0:ft.click()},children:a("environmentCenter.upload")}),o.jsx(It,{className:"environment-upload__action",type:"button",color:"secondary",variant:"ghost",size:"sm",pill:!1,disabled:Te||!te,onClick:he,children:a("environmentCenter.reset")})]})]}),o.jsxs("div",{className:`environment-dockerfile-editor${Z?" has-fixed-base":""}${le?" is-invalid":""}`,children:[Z?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:G,children:G})]})]}):null,o.jsx("div",{className:"environment-dockerfile__editor environment-upload__editor","aria-label":a("environmentCenter.dockerfileContent"),children:o.jsx(ST,{value:te,path:"Dockerfile",lineNumberStart:Z?2:1,height:"auto",minHeight:"28px",maxHeight:"var(--environment-dockerfile-editor-max-height)",onChange:Ke})})]})]}),le?o.jsx("p",{className:"environment-upload__error environment-upload__error--below",role:"alert",children:le}):null]}):m==="git"?o.jsxs("div",{className:"environment-source-workflow",children:[o.jsx(nGt,{repositoryUrl:k,gitRef:E,dockerfilePath:A,inspection:T,inspectedKey:_,disabled:Te,onRepositoryUrlChange:C,onGitRefChange:R,onDockerfilePathChange:N,onInspectionChange:j,onInspectedKeyChange:I}),o.jsx(iGt,{cloudProvider:t,mode:D,region:L,value:M,disabled:Te,onModeChange:ft=>{P(ft),Ue("")},onRegionChange:ft=>{B(ft),H(void 0),Ue("")},onChange:H})]}):o.jsx(rGt,{cloudProvider:t,region:K,repository:q,reference:X,disabled:Te,onRegionChange:ft=>{F(ft),Q(void 0),Ue("")},onRepositoryChange:Q,onReferenceChange:ne})]})})})}function VFe({cloudProvider:e="volcengine",onWorkspace:t,onProjects:n,clipboardImport:i=null,clipboardReadError:r=""}){const{t:s,i18n:a}=_e("ui"),[l,c]=p.useState([]),[u,d]=p.useState({kind:"list"}),[f,h]=p.useState(""),[m,g]=p.useState(null),[b,v]=p.useState(null),[y,w]=p.useState(null),[x,O]=p.useState(null),[S,k]=p.useState(null),C=p.useRef(0),[E,R]=p.useState(""),[A,N]=p.useState(!1),[T,j]=p.useState(r),[_,I]=p.useState(!0),[D,P]=p.useState(""),[L,B]=p.useState(0),[M,H]=p.useState(()=>new Set),K=p.useDeferredValue(f),F=p.useMemo(()=>{const Z=K.trim().toLocaleLowerCase();return Z?l.filter(G=>`${G.name} ${G.description} ${a8(G.operatingSystem)} ${Xh(G.language)} ${l8(G.baseEnvironment)}`.toLocaleLowerCase().includes(Z)):l},[K,l]),q=p.useCallback((Z="",G=!1)=>{C.current+=1,k({key:C.current,initialValue:Z,autoInspect:G})},[]),Q=p.useCallback((Z,G=!1)=>{const te=Z.trim();if(!te.startsWith("akenv://")||!G&&Jse.has(te))return!1;const de=RU(te);return!de.length||de.length>r9?!1:(Jse.add(te),j(""),q(te,!0),!0)},[q]),X=p.useCallback(async()=>{var Z;if(!(u.kind!=="list"||S)){if(typeof navigator>"u"||!((Z=navigator.clipboard)!=null&&Z.readText)){j(s("environmentCenter.clipboardUnsupported"));return}try{const G=await navigator.clipboard.readText();!Q(G)&&!G.trim()&&await QKt()&&j(s("environmentCenter.clipboardReadError"))}catch{j(s("environmentCenter.clipboardReadError"))}}},[S,Q,s,u.kind]);p.useEffect(()=>{const Z=new AbortController;return l.length===0&&I(!0),P(""),EC(Z.signal).then(G=>{c(G)}).catch(G=>{(G==null?void 0:G.name)!=="AbortError"&&P(G instanceof Error?G.message:String(G))}).finally(()=>{Z.signal.aborted||I(!1)}),()=>Z.abort()},[L]),p.useEffect(()=>{if(!l.some(G=>G.latestVersion&&qb.has(G.latestVersion.status)))return;const Z=window.setTimeout(()=>B(G=>G+1),2500);return()=>window.clearTimeout(Z)},[l]),p.useEffect(()=>{if(!E||A)return;const Z=window.setTimeout(()=>R(""),2800);return()=>window.clearTimeout(Z)},[A,E]),p.useEffect(()=>{r&&j(r)},[r]),p.useEffect(()=>{i&&Q(i.text)},[i,Q]),p.useEffect(()=>{if(u.kind!=="list")return;const Z=()=>void X(),G=()=>{document.visibilityState==="visible"&&X()},te=de=>{var fe;const Ce=de.target;if(Ce instanceof HTMLInputElement||Ce instanceof HTMLTextAreaElement||Ce instanceof HTMLElement&&Ce.isContentEditable)return;const le=((fe=de.clipboardData)==null?void 0:fe.getData("text/plain"))??"";Q(le,!0)&&de.preventDefault()};return window.addEventListener("focus",Z),document.addEventListener("visibilitychange",G),window.addEventListener("paste",te),()=>{window.removeEventListener("focus",Z),document.removeEventListener("visibilitychange",G),window.removeEventListener("paste",te)}},[Q,X,u.kind]);const ne=u.kind==="editor"&&u.environmentId?l.find(Z=>Z.id===u.environmentId):void 0,z=async Z=>{const G={...Z,dockerfile:Z.dockerfile??Lz(Z,e)},te=ne?await jCe(ne.id,G):await _Ce(G);if(c(de=>[te,...de.filter(Ce=>Ce.id!==te.id)]),d({kind:"list"}),N(!1),G.imageSource){R(s("environmentCenter.status.boundImage",{name:te.name}));return}try{const de=await G$(te.id);c(Ce=>Ce.map(le=>le.id===te.id?{...le,latestVersion:de}:le)),R(s("environmentCenter.status.queued",{name:te.name}))}catch(de){N(!0),R(s("environmentCenter.status.savedBuildFailed",{error:de instanceof Error?de.message:String(de)}))}},Y=async Z=>{if(!M.has(Z.id)){H(G=>new Set(G).add(Z.id)),N(!1);try{const G=await G$(Z.id);c(te=>te.map(de=>de.id===Z.id?{...de,latestVersion:G}:de)),R(s("environmentCenter.status.queued",{name:Z.name}))}catch(G){N(!0),R(G instanceof Error?G.message:String(G))}finally{H(G=>{const te=new Set(G);return te.delete(Z.id),te})}}},ae=(Z,G,te,de)=>{Z.length&&c(Ce=>{const le=new Set(Z.map(fe=>fe.id));return[...Z,...Ce.filter(fe=>!le.has(fe.id))]}),N(de>0),R(de>0?s("environmentCenter.status.importedFailed",{created:G,failed:de}):te>0?s("environmentCenter.status.importedDuplicate",{created:G,duplicate:te}):s("environmentCenter.status.imported",{count:G}))},Ee=m?o.jsx(Xu,{title:s("environmentCenter.deleteTitle"),description:s("environmentCenter.deleteDescription",{name:m.name}),confirmLabel:s("common.delete"),variant:"danger",onCancel:()=>g(null),onConfirm:()=>{const Z=m;g(null),d({kind:"list"}),NCe(Z.id).then(()=>{c(G=>G.filter(te=>te.id!==Z.id)),N(!1),R(s("environmentCenter.status.deleted",{name:Z.name}))}).catch(G=>{N(!0),R(G instanceof Error?G.message:String(G))})}}):null;return u.kind==="editor"?o.jsxs(o.Fragment,{children:[o.jsx(aGt,{environment:ne,cloudProvider:e,onCancel:()=>d({kind:"list"}),onDelete:ne?()=>g(ne):void 0,onShare:ne?()=>O(ne):void 0,onSave:z},u.environmentId??"new"),x?o.jsx(sGt,{environment:x,onClose:()=>O(null)}):null,Ee]}):o.jsxs(fq,{section:"environments",className:"environment-center",onWorkspace:t,onProjects:n,actions:o.jsxs(o.Fragment,{children:[E?o.jsx("span",{className:`environment-status${A?" is-error":""}`,role:A?"alert":"status","aria-live":"polite",children:E}):null,o.jsx(hp,{"aria-label":s("environmentCenter.search"),value:f,onChange:Z=>h(Z.target.value),placeholder:s("environmentCenter.search")})]}),children:[T?o.jsxs("div",{className:"environment-clipboard-notice",role:"alert",children:[o.jsx("span",{children:T}),o.jsx(It,{type:"button",color:"secondary",variant:"soft",size:"sm",onClick:()=>{j(""),q()},children:s("environmentCenter.manualImport")})]}):null,o.jsx(Dg,{"aria-live":"polite",children:_?o.jsx(Ka,{}):D?o.jsxs("div",{className:"environment-load-error",role:"alert",children:[o.jsx("p",{children:ga(D,a.resolvedLanguage||a.language)||s("environmentCenter.loadFailed")}),o.jsx(It,{color:"secondary",variant:"soft",size:"sm",onClick:()=>B(Z=>Z+1),children:s("common.reload")})]}):F.length===0&&f.trim()?o.jsx("div",{className:"environment-empty",children:o.jsxs(Rn,{fill:"none",children:[o.jsx(Rn.Icon,{children:o.jsx(WKt,{})}),o.jsx(Rn.Title,{children:s("environmentCenter.noMatches")}),o.jsx(Rn.Description,{children:s("environmentCenter.tryAnotherName")})]})}):o.jsxs(i0,{children:[f.trim()?null:o.jsxs(o.Fragment,{children:[o.jsx(pg,{"aria-label":s("environmentCenter.create"),icon:o.jsx(VKt,{}),onClick:()=>d({kind:"editor",environmentId:null}),children:s("environmentCenter.create")}),o.jsx(pg,{"aria-label":s("environmentCenter.import.title"),icon:o.jsx(HKt,{}),onClick:()=>q(),children:s("environmentCenter.import.title")})]}),F.map(Z=>{var Ce,le;const G=UFe(Z,s),te=!!(Z.latestVersion&&qb.has(Z.latestVersion.status)),de=M.has(Z.id);return o.jsx(s0,{className:"environment-card",title:Z.name,status:o.jsx(zo,{color:G.color,size:"sm",children:G.label}),description:((Ce=Z.latestVersion)==null?void 0:Ce.error)||(te?(le=Z.latestVersion)==null?void 0:le.currentStep:"")||Z.description||s("common.noDescription"),metadata:[{label:s("workspace.updated"),value:YKt(Z.updatedAt,a.resolvedLanguage??a.language),title:ZKt(Z.updatedAt,a.resolvedLanguage??a.language)}],action:{label:Z.latestVersion?s("environmentCenter.buildDetails.title"):s(de?"environmentCenter.buildDetails.starting":"environmentCenter.startBuild"),icon:"play",title:s("environmentCenter.build"),disabled:de,onClick:()=>Z.latestVersion?v(Z.id):void Y(Z)},auxiliaryAction:{label:s("environmentCenter.manifest.view"),icon:o.jsx(Ait,{}),title:Z.latestVersion?s("environmentCenter.manifest.viewShort"):s("environmentCenter.manifest.unavailable"),disabled:!Z.latestVersion,onClick:()=>w(Z)},detailAction:{label:s("environmentCenter.configure"),onClick:()=>d({kind:"editor",environmentId:Z.id})}},Z.id)})]})}),b?(()=>{const Z=l.find(G=>G.id===b);return Z?o.jsx(tGt,{environment:Z,onClose:()=>v(null),onBuildUpdate:G=>{c(te=>te.map(de=>de.id===Z.id?{...de,latestVersion:G}:de))},onRebuild:()=>Y(Z)}):null})():null,y!=null&&y.latestVersion?o.jsx(eGt,{environment:y,onClose:()=>w(null)}):null,Ee,S?o.jsx(oGt,{initialValue:S.initialValue,autoInspect:S.autoInspect,onClose:()=>k(null),onImported:ae},S.key):null]})}function lGt(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 cGt(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 o9(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 uGt(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 dGt({workspace:e,environments:t,onBack:n,onSave:i,onDelete:r}){const{t:s,i18n:a}=_e("ui"),[l,c]=p.useState((e==null?void 0:e.name)??""),[u,d]=p.useState((e==null?void 0:e.description)??""),[f,h]=p.useState((e==null?void 0:e.environmentIds)??[]),[m,g]=p.useState(""),[b,v]=p.useState(!1),[y,w]=p.useState(""),x=m.trim().toLocaleLowerCase(),O=t.filter(k=>`${k.name} ${k.description} ${Xh(k.language)}`.toLocaleLowerCase().includes(x)),S=async k=>{if(k.preventDefault(),!(!l.trim()||b)){v(!0),w("");try{await i({name:l.trim(),description:u.trim(),environmentIds:f})}catch(C){w(C instanceof Error?C.message:String(C)),v(!1)}}};return o.jsx(Bf,{className:"workspace-center","aria-label":s(e?"workspace.detail":"workspace.create"),children:o.jsxs(XC,{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(Fz,{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:o9(e.createdAt,a.resolvedLanguage??a.language)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("workspace.updatedAt")}),o.jsx("dd",{children:o9(e.updatedAt,a.resolvedLanguage??a.language)})]})]}):null,o.jsxs("form",{id:"workspace-form",className:"workspace-form",onSubmit:S,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(ms,{value:l,maxLength:128,autoFocus:!0,onChange:k=>c(k.target.value),placeholder:s("workspace.namePlaceholder")})]}),o.jsxs("label",{children:[o.jsx("span",{children:s("common.description")}),o.jsx(Eg,{value:u,maxLength:2e3,onChange:k=>d(k.target.value),placeholder:s("workspace.descriptionPlaceholder")})]})]}),o.jsxs("section",{className:"workspace-environments",children:[o.jsx(PIe,{title:s("common.environment"),description:s("workspace.selectedEnvironmentCount",{count:f.length}),actions:o.jsx(hp,{"aria-label":s("workspace.searchAvailableEnvironments"),value:m,onChange:k=>g(k.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")})]}):O.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:O.map(k=>{var R;const C=f.includes(k.id),E=((R=k.latestVersion)==null?void 0:R.status)==="available"?s("workspace.environmentStatus.available"):k.latestVersion?s("workspace.environmentStatus.building"):s("workspace.environmentStatus.notBuilt");return o.jsxs("label",{className:`workspace-environment-option${C?" is-selected":""}`,children:[o.jsx("input",{type:"checkbox",checked:C,onChange:()=>h(A=>C?A.filter(N=>N!==k.id):[...A,k.id])}),o.jsxs("span",{className:"workspace-environment-option__copy",children:[o.jsx("strong",{title:k.name,children:k.name}),o.jsxs("span",{children:[Xh(k.language)," · ",E]})]}),o.jsx("span",{className:"workspace-environment-option__action",children:s(C?"workspace.added":"common.add")})]},k.id)})})]}),y?o.jsx("p",{className:"workspace-form-error",role:"alert",children:y}):null]})]})})}function fGt({onEnvironment:e,onProjects:t}){const{t:n,i18n:i}=_e("ui"),[r,s]=p.useState([]),[a,l]=p.useState([]),[c,u]=p.useState({kind:"list"}),[d,f]=p.useState(""),[h,m]=p.useState(!0),[g,b]=p.useState(""),[v,y]=p.useState(""),[w,x]=p.useState(!1),[O,S]=p.useState(null),[k,C]=p.useState(0),E=p.useDeferredValue(d);p.useEffect(()=>{const T=new AbortController;return m(!0),b(""),Promise.all([DU(T.signal),EC(T.signal)]).then(([j,_])=>{s(j),l(_)}).catch(j=>{(j==null?void 0:j.name)!=="AbortError"&&(console.warn("Unable to load Studio workspaces",j),b(n("workspace.loadFailed")))}).finally(()=>{T.signal.aborted||m(!1)}),()=>T.abort()},[k,n]),p.useEffect(()=>{if(!v||w)return;const T=window.setTimeout(()=>y(""),2800);return()=>window.clearTimeout(T)},[w,v]);const R=p.useMemo(()=>new Map(a.map(T=>[T.id,T])),[a]),A=p.useMemo(()=>{const T=E.trim().toLocaleLowerCase();return T?r.filter(j=>{const _=j.environmentIds.map(I=>{var D;return((D=R.get(I))==null?void 0:D.name)??""}).join(" ");return`${j.name} ${j.description} ${_}`.toLocaleLowerCase().includes(T)}):r},[E,R,r]),N=c.kind==="detail"&&c.workspaceId?r.find(T=>T.id===c.workspaceId):void 0;return c.kind==="detail"?o.jsx(dGt,{workspace:N,environments:a,onBack:()=>u({kind:"list"}),onDelete:N?()=>S(N):null,onSave:async T=>{const j=N?await OCe(N.id,T):await wCe(T);s(_=>[j,..._.filter(I=>I.id!==j.id)]),x(!1),y(n("workspace.saved",{name:j.name})),u({kind:"list"})}},c.workspaceId??"new"):o.jsxs(fq,{section:"workspaces",onEnvironment:e,onProjects:t,actions:o.jsxs(o.Fragment,{children:[v?o.jsx("span",{className:`workspace-status${w?" is-error":""}`,role:w?"alert":"status","aria-live":"polite",children:v}):null,o.jsx(hp,{"aria-label":n("workspace.searchWorkspaces"),value:d,onChange:T=>f(T.target.value),placeholder:n("workspace.searchWorkspaces")})]}),children:[o.jsx(Dg,{"aria-live":"polite",children:h?o.jsx(Ka,{}):g?o.jsxs("div",{className:"workspace-load-error",role:"alert",children:[o.jsx("p",{children:g}),o.jsx(It,{color:"secondary",variant:"soft",size:"sm",onClick:()=>C(T=>T+1),children:n("common.reload")})]}):A.length===0&&d.trim()?o.jsx("div",{className:"workspace-empty",children:o.jsxs(Rn,{fill:"none",children:[o.jsx(Rn.Icon,{children:o.jsx(cGt,{})}),o.jsx(Rn.Title,{children:n("workspace.noMatchingWorkspaces")}),o.jsx(Rn.Description,{children:n("workspace.tryAnotherNameOrEnvironment")})]})}):o.jsxs(i0,{children:[d.trim()?null:o.jsx(pg,{"aria-label":n("workspace.create"),icon:o.jsx(lGt,{}),onClick:()=>u({kind:"detail",workspaceId:null}),children:n("workspace.create")}),A.map(T=>{const j=uGt(T,R),_=T.environmentIds.filter(I=>!R.has(I)).length;return o.jsx(s0,{className:"workspace-card",title:T.name,status:o.jsx(zo,{color:_?"danger":j===T.environmentIds.length&&j>0?"success":"secondary",size:"sm",children:T.environmentIds.length===0?n("workspace.noEnvironmentAdded"):_?n("workspace.environmentMissing"):n("workspace.availableFraction",{available:j,total:T.environmentIds.length})}),description:T.description||n("common.noDescription"),metadata:[{label:n("common.environment"),value:n("workspace.environmentCount",{count:T.environmentIds.length})},{label:n("workspace.available"),value:n("workspace.availableCount",{count:j})},{label:n("workspace.updated"),value:o9(T.updatedAt,i.resolvedLanguage??i.language)}],detailAction:{label:n("common.manage"),onClick:()=>u({kind:"detail",workspaceId:T.id})},action:{label:n("workspace.addEnvironment"),icon:"plus",onClick:()=>u({kind:"detail",workspaceId:T.id})}},T.id)})]})}),O?o.jsx(Xu,{title:n("workspace.deleteTitle"),description:n("workspace.deleteDescription",{name:O.name}),confirmLabel:n("common.delete"),variant:"danger",onCancel:()=>S(null),onConfirm:()=>{const T=O;S(null),kCe(T.id).then(()=>{s(j=>j.filter(_=>_.id!==T.id)),x(!1),y(n("workspace.deleted",{name:T.name})),u({kind:"list"})}).catch(j=>{x(!0),y(j instanceof Error?j.message:String(j))})}}):null]})}function hGt({cloudProvider:e,onProjects:t,initialSection:n="workspaces"}){const[i,r]=p.useState(n),{t:s}=_e("ui"),[a,l]=p.useState(null),[c,u]=p.useState(""),d=p.useRef(0),f=()=>{var g;d.current+=1;const h=d.current;u("");let m=null;if(typeof navigator<"u"&&((g=navigator.clipboard)!=null&&g.readText))try{m=navigator.clipboard.readText()}catch{u(s("workspace.clipboardPermissionError"))}else u(s("workspace.clipboardUnsupported"));r("environments"),m&&m.then(async b=>{var v;if(d.current===h){if(b.trim()){l({key:h,text:b});return}try{const y=await((v=navigator.permissions)==null?void 0:v.query({name:"clipboard-read"}));d.current===h&&(y==null?void 0:y.state)==="denied"&&u(s("workspace.clipboardPermissionError"))}catch{}}}).catch(()=>{d.current===h&&u(s("workspace.clipboardPermissionError"))})};return i==="environments"?o.jsx(VFe,{cloudProvider:e,onWorkspace:()=>r("workspaces"),onProjects:t,clipboardImport:a,clipboardReadError:c}):o.jsx(fGt,{onEnvironment:f,onProjects:t})}function pGt(e){return e==="127.0.0.1"}const mGt={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."},gGt={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."},bGt={id:"gitlab-review",kind:"gitlab",category:"development",icon:"gitlab",name:"GitLab MR review",description:"Use a GitLab integration to review merge requests in an isolated Sandbox."};mn.hasResourceBundle("en-US","automations")||mn.addResourceBundle("en-US","automations",bue,!0,!0);mn.hasResourceBundle("zh-CN","automations")||mn.addResourceBundle("zh-CN","automations",xbe,!0,!0);function zf(e,t={}){return mn.t(e,{...t,ns:"automations"})}const HFe={name:"repository",label:"GitHub Repo",placeholder:"owner/repository",help:"Enter owner/repository or a full github.com URL",required:!0},qFe={name:"baseBranch",label:"Target branch",placeholder:"main",help:"Defaults to main; the pull request will use this branch as its base",required:!1},WFe={name:"runtimeName",label:"Runtime name",placeholder:"support-agent",help:"Used by the AgentKit delivery configuration",required:!0},KFe={name:"runtimeId",label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"The AgentKit Runtime that will receive continuous updates",required:!0},yGt="https://ark.cn-beijing.volces.com/api/coding/v3";function vGt(e){return e==="byteplus"?Ca(e):yGt}function gq(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 GFe(e){const t=gq(e);return[zf("github.secretPair",{accessKey:t.accessKey,secretKey:t.secretKey}),zf("github.sessionToken",{sessionToken:t.sessionToken})]}function bq(e){return e==="byteplus"?"BytePlus":"Volcengine"}function yq(e,t={}){return{repository:"",baseBranch:"main",projectPath:".",runtimeName:"",runtimeId:"",modelName:"",modelBaseUrl:vGt(e),region:Xi(e),token:"",...t}}function XFe(e){return{repository:e.repository.trim(),baseBranch:e.baseBranch.trim()||"main",region:e.region,token:e.token.trim()}}const xGt={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})=>yq(e),regionHelp:"",secrets:()=>[],async submit(){throw new Error("PR 自动评审已切换为 GitHub App 授权模式。")}},wGt="https://api.github.com",OGt=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,noe=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,199}$/,kGt=/^[A-Za-z0-9._/-]+$/;function SGt(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 db(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(`${wGt}${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(SGt(i.status,r,t.token));return{status:i.status,payload:r}}function j4(e){return e.split("/").map(encodeURIComponent).join("/")}function EGt(e){const t=new TextEncoder().encode(e);let n="";const i=32768;for(let r=0;r({...h,path:xq(h.path,"")})),s=AbortSignal.any([t,AbortSignal.timeout(6e4)]),a=`/repos/${n}`;await db(`${a}`,{token:e.token,expected:[200],signal:s});const c=(f=(await db(`${a}/git/ref/heads/${j4(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=CGt(e.branchPrefix);await db(`${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 m of r){const g=j4(m.path),b=await db(`${a}/contents/${g}?ref=${encodeURIComponent(i)}`,{token:e.token,expected:[200,404],signal:s});if(m.mustBeNew&&b.status===200)throw new Error(V("github.fileAlreadyExists",{path:m.path}));if(b.status===200&&!b.payload.sha)throw new Error(V("github.pathNotUpdatable",{path:m.path}));await db(`${a}/contents/${g}`,{token:e.token,expected:[200,201],signal:s,method:"PUT",body:{message:m.commitMessage,content:EGt(m.content),branch:u,...b.payload.sha?{sha:b.payload.sha}:{}}})}const h=await db(`${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 db(`${a}/git/refs/heads/${j4(u)}`,{token:e.token,expected:[204],signal:AbortSignal.timeout(15e3),method:"DELETE"}).catch(()=>{})}}async function TGt(e,t){const n=await gn("/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 TT(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 AGt(e){const t=await gn("/web/github/app/config",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await TT(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 _Gt(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 gn(`/web/github/app/repositories?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await TT(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 jGt(e,t){const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)}),i=await gn(`/web/github/app/review-records?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await TT(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 NGt(e,t){const n=await gn("/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 TT(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 TT(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 RGt=/^[A-Za-z0-9_-]+$/,ZFe=4,eI=64,tI=6,roe="agent-runtime";function JFe(e){const t=e.trim();if(!t)return roe;let n=t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,eI);return n?(n.lengthGt(`validation.runtimeName.${n}`)){return e?RGt.test(e)?e.lengtheI?t("length"):null:t("characters"):t("required")}const DGt=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,MGt="cn-hongkong";function LGt(e){const t=C1(e.runtimeName,n=>zf(`github.validation.runtimeName.${n}`));if(t)throw new Error(t);if(!DGt.test(e.runtimeId))throw new Error(zf("github.validation.runtimeId"))}function e8e(e){LGt(e);const t=e.cloudProvider??"volcengine",n=gq(t),i=t==="byteplus"?` VOLCENGINE_ACCESS_KEY: \${{ secrets.${n.accessKey} }} VOLCENGINE_SECRET_KEY: \${{ secrets.${n.secretKey} }} VOLCENGINE_SESSION_TOKEN: \${{ secrets.${n.sessionToken} }} BYTEPLUS_REGION: ${JSON.stringify(e.region)}`:"",r=t==="byteplus"?` - "DATABASE_VIKING_REGION": ${JSON.stringify(_Gt)},`:"",s=`name: Publish to AgentKit Runtime + "DATABASE_VIKING_REGION": ${JSON.stringify(MGt)},`:"",s=`name: Publish to AgentKit Runtime on: push: @@ -947,25 +947,25 @@ jobs: if not result.success: raise SystemExit(f"AgentKit publish failed: {result.error}") PY -`,a={__BASE_BRANCH__:JSON.stringify(e.baseBranch),__PROJECT_PATH__:JSON.stringify(e.projectPath),__RUNTIME_NAME__:JSON.stringify(e.runtimeName),__RUNTIME_ID__:JSON.stringify(e.runtimeId),__REGION__:JSON.stringify(e.region),__CLOUD_PROVIDER__:JSON.stringify(t),__ACCESS_KEY_SECRET__:n.accessKey,__SECRET_KEY_SECRET__:n.secretKey,__SESSION_TOKEN_SECRET__:n.sessionToken,__BYTEPLUS_ENV__:i,__BYTEPLUS_RUNTIME_ENV__:r,__CONCURRENCY_GROUP__:JSON.stringify(`agentkit-runtime-${e.runtimeId}`)};return Object.entries(a).reduce((l,[c,u])=>l.split(c).join(u),s)}const NGt={id:"delivery",kind:"github",category:"development",icon:"github",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",fields:[$Fe,FFe,{name:"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",required:!1},BFe,UFe],initialValues:({cloudProvider:e})=>yq(e),regionHelp:"Must match the target Runtime region",secrets:({cloudProvider:e})=>QFe(e),submit(e,t,n){const i=zFe(e),r=xq(e.projectPath,"."),s=bq(t.cloudProvider);return VFe({...i,files:[{path:".github/workflows/publish-agentkit.yml",content:WFe({baseBranch:i.baseBranch,projectPath:r,runtimeName:e.runtimeName.trim(),runtimeId:e.runtimeId.trim(),region:i.region,cloudProvider:t.cloudProvider}),commitMessage:"feat: publish Agent to AgentKit Runtime"}],branchPrefix:"feat/agentkit-release",title:Qf("cards.delivery.pullRequest.title"),description:Qf("cards.delivery.pullRequest.description",{provider:s})},n)}};function RGt(e,t){return e==="."?t:`${e}/${t}`}function IGt(e){return`.github/workflows/publish-agentkit-${e.replace(/[^A-Za-z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()||"root"}.yml`}const PGt={volcengine:"agentkit-prod-public-cn-beijing.cr.volces.com/base/py-simple:python3.12-bookworm-slim-latest",byteplus:"agentkit-prod-public-ap-southeast-1.cr.bytepluses.com/base/py-simple:python3.12-bookworm-slim-latest"},DGt="1.1.13",MGt=["https://mirrors.cloud.tencent.com/pypi/simple","https://pypi.mirrors.ustc.edu.cn/simple","https://pypi.org/simple"];function LGt(e){return e!=="volcengine"?"RUN uv pip install -r requirements.txt":`RUN ${MGt.map(n=>`uv pip install --index-url ${n} -r requirements.txt`).join(` || \\ - `)}`}function $Gt(e){const t=gq(e);return`# Local ${bq(e)} credentials. Never commit real values. +`,a={__BASE_BRANCH__:JSON.stringify(e.baseBranch),__PROJECT_PATH__:JSON.stringify(e.projectPath),__RUNTIME_NAME__:JSON.stringify(e.runtimeName),__RUNTIME_ID__:JSON.stringify(e.runtimeId),__REGION__:JSON.stringify(e.region),__CLOUD_PROVIDER__:JSON.stringify(t),__ACCESS_KEY_SECRET__:n.accessKey,__SECRET_KEY_SECRET__:n.secretKey,__SESSION_TOKEN_SECRET__:n.sessionToken,__BYTEPLUS_ENV__:i,__BYTEPLUS_RUNTIME_ENV__:r,__CONCURRENCY_GROUP__:JSON.stringify(`agentkit-runtime-${e.runtimeId}`)};return Object.entries(a).reduce((l,[c,u])=>l.split(c).join(u),s)}const $Gt={id:"delivery",kind:"github",category:"development",icon:"github",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",fields:[HFe,qFe,{name:"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",required:!1},WFe,KFe],initialValues:({cloudProvider:e})=>yq(e),regionHelp:"Must match the target Runtime region",secrets:({cloudProvider:e})=>GFe(e),submit(e,t,n){const i=XFe(e),r=xq(e.projectPath,"."),s=bq(t.cloudProvider);return YFe({...i,files:[{path:".github/workflows/publish-agentkit.yml",content:e8e({baseBranch:i.baseBranch,projectPath:r,runtimeName:e.runtimeName.trim(),runtimeId:e.runtimeId.trim(),region:i.region,cloudProvider:t.cloudProvider}),commitMessage:"feat: publish Agent to AgentKit Runtime"}],branchPrefix:"feat/agentkit-release",title:zf("cards.delivery.pullRequest.title"),description:zf("cards.delivery.pullRequest.description",{provider:s})},n)}};function FGt(e,t){return e==="."?t:`${e}/${t}`}function BGt(e){return`.github/workflows/publish-agentkit-${e.replace(/[^A-Za-z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()||"root"}.yml`}const UGt={volcengine:"agentkit-prod-public-cn-beijing.cr.volces.com/base/py-simple:python3.12-bookworm-slim-latest",byteplus:"agentkit-prod-public-ap-southeast-1.cr.bytepluses.com/base/py-simple:python3.12-bookworm-slim-latest"},QGt="1.1.13",zGt=["https://mirrors.cloud.tencent.com/pypi/simple","https://pypi.mirrors.ustc.edu.cn/simple","https://pypi.org/simple"];function VGt(e){return e!=="volcengine"?"RUN uv pip install -r requirements.txt":`RUN ${zGt.map(n=>`uv pip install --index-url ${n} -r requirements.txt`).join(` || \\ + `)}`}function HGt(e){const t=gq(e);return`# Local ${bq(e)} credentials. Never commit real values. ${t.accessKey}= ${t.secretKey}= # ${t.sessionToken}= -${e==="byteplus"?"BYTEPLUS_REGION":"VOLCENGINE_REGION"}=${qi(e)} +${e==="byteplus"?"BYTEPLUS_REGION":"VOLCENGINE_REGION"}=${Xi(e)} CLOUD_PROVIDER=${e} AGENTKIT_CLOUD_PROVIDER=${e} # Optional model overrides. # MODEL_AGENT_PROVIDER=openai # MODEL_AGENT_NAME=${lp(e)} -# MODEL_AGENT_API_BASE=${wa(e)} +# MODEL_AGENT_API_BASE=${Ca(e)} # MODEL_AGENT_API_KEY= # Optional Feishu Channel credentials. Studio can create and bind these. FEISHU_APP_ID= FEISHU_APP_SECRET= -`}function FGt(e,t="volcengine"){const n={"app.py":`"""__PROJECT_NAME__ — a VeADK agent with the full Studio App Server.""" +`}function qGt(e,t="volcengine"){const n={"app.py":`"""__PROJECT_NAME__ — a VeADK agent with the full Studio App Server.""" from assistant import root_agent from veadk.integrations.agentkit import create_agentkit_app, run_agentkit_app @@ -1009,19 +1009,19 @@ root_agent = Agent( instruction="You are a helpful assistant. Use your tools when relevant.", tools=[get_city_weather], ) -`,"requirements.txt":`veadk-python==${DGt} +`,"requirements.txt":`veadk-python==${QGt} agentkit-sdk-python==0.8.4 google-adk==2.1.0 lark-channel-sdk==1.2.0 lark-oapi==1.7.3 starlette==0.52.1 -`,Dockerfile:`FROM ${PGt[t]} +`,Dockerfile:`FROM ${UGt[t]} ENV UV_SYSTEM_PYTHON=1 UV_COMPILE_BYTECODE=1 PYTHONUNBUFFERED=1 WORKDIR /app COPY requirements.txt ./ -${LGt(t)} +${VGt(t)} COPY . . @@ -1046,7 +1046,7 @@ and local short-term memory fallback. Pushes to the configured target branch are continuously published by the GitHub Actions workflow added with this project. -`,".env.example":$Gt(t),".gitignore":`__pycache__/ +`,".env.example":HGt(t),".gitignore":`__pycache__/ *.pyc .venv/ .env @@ -1060,32 +1060,32 @@ __pycache__/ Dockerfile .dockerignore README.md -`};return Object.fromEntries(Object.entries(n).map(([i,r])=>[i,r.split("__PROJECT_NAME__").join(e)]))}const BGt={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:[$Fe,FFe,{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},BFe,UFe],initialValues:({cloudProvider:e})=>yq(e,{projectPath:"agentkit-basic-agent"}),regionHelp:"Must match the target Runtime region",secrets:({cloudProvider:e})=>QFe(e),submit(e,t,n){const i=zFe(e),r=vq(i.repository),s=xq(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(FGt(a,t.cloudProvider)).map(([c,u])=>({path:RGt(s,c),content:u,commitMessage:"feat: import AgentKit basic template",mustBeNew:!0}));return l.push({path:IGt(s),content:WFe({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}),VFe({...i,repository:r,files:l,branchPrefix:"feat/agentkit-basic-template",title:Qf("cards.template.pullRequest.title"),description:Qf("cards.template.pullRequest.description",{provider:bq(t.cloudProvider)})},n)}},UGt={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."},soe=[{id:"development",label:"Development"},{id:"channels",label:"Messaging channels"}],KFe=[lGt,BGt,NGt,hGt,uGt,cGt,UGt],QGt=new Map(KFe.map(e=>[e.id,e]));function zGt(e){const t=QGt.get(e);if(!t)throw new Error(`Unknown automation: ${e}`);return t}function VGt(e){const t=zGt(e);if(t.kind!=="github")throw new Error(`Automation is not backed by GitHub: ${e}`);return t}function ooe(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 HGt(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 qGt(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 WGt(e){return o.jsxs("svg",{viewBox:"0 0 36 36",fill:"none","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M18 31 5.5 21.8 8.7 6.5 14 17.1h8L27.3 6.5l3.2 15.3L18 31Z",fill:"currentColor",opacity:"0.12"}),o.jsx("path",{d:"M18 31 5.5 21.8 8.7 6.5 14 17.1h8L27.3 6.5l3.2 15.3L18 31Z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),o.jsx("path",{d:"m14 17.1 4 13.9 4-13.9M5.5 21.8h25",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"})]})}function KGt({onOpen:e}){var d;const{t}=je("automations"),[n,i]=p.useState("development"),[r,s]=p.useState(""),a=p.useDeferredValue(r),l=p.useMemo(()=>{const f=a.trim().toLocaleLowerCase();return KFe.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=soe.find(f=>f.id===n))==null?void 0:d.id,u=aGt(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(ooe,{}),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:soe.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,m=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":m,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:ZD,alt:"","aria-hidden":"true"}):f.icon==="coding-agents"?o.jsx(HGt,{className:"application-card-icon"}):f.icon==="website-integration"?o.jsx(qGt,{className:"application-card-icon"}):f.icon==="gitlab"?o.jsx(WGt,{className:"application-card-icon"}):o.jsx(hq,{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:m,className:"application-card-tooltip",role:"tooltip",children:t("localOnly")}):null]},f.id)})}):o.jsxs("div",{className:"applications-empty",role:"status",children:[o.jsx(ooe,{}),o.jsx("h2",{children:t("emptyTitle")}),o.jsx("p",{children:t("emptyDescription")})]})})]})}const GGt="_Container_1bl61_1",XGt="_Track_1bl61_16",YGt="_Thumb_1bl61_56",ZGt="_Label_1bl61_78",XA={Container:GGt,Track:XGt,Thumb:YGt,Label:ZGt},a9=({className:e,label:t,id:n,disabled:i,labelPosition:r="end",...s})=>{const a=p.useId(),l=n??a;return o.jsxs("div",{className:Ti(XA.Container,e),"data-disabled":i?"":void 0,"data-has-label":t?"":void 0,"data-label-position":r,children:[o.jsx(yct,{id:l,className:XA.Track,disabled:i,...s,children:o.jsx(xct,{className:XA.Thumb})}),t&&o.jsx("label",{htmlFor:l,className:XA.Label,children:t})]})};function Eg({message:e,className:t="",onRetry:n,retryLabel:i,defaultExpanded:r=!0}){const{t:s}=je("ui"),a=i??s("deploymentError.retryDeployment"),[l,c]=p.useState(r),[u,d]=p.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(It,{type:"button",className:"deploy-error-retry",color:"danger",variant:"soft",size:"sm",pill:!1,loading:u,onClick:()=>void f(),children:[!u&&o.jsx(cit,{}),u?s("deploymentError.retrying"):a]}),o.jsx(It,{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(pit,{}):o.jsx(vit,{})}),o.jsx(rz,{copyValue:e,color:"secondary",variant:"ghost",size:"sm",uniform:!0,pill:!1,title:s("deploymentError.copy"),"aria-label":s("deploymentError.copy")})]})]})}const JGt={queued:"status.queued",pending:"status.pending",running:"status.running",retrying:"status.retrying",success:"status.success",failed:"status.failed",cancelled:"status.cancelled",skipped:"status.skipped"},GFe=["weekdays.sunday","weekdays.monday","weekdays.tuesday","weekdays.wednesday","weekdays.thursday","weekdays.friday","weekdays.saturday"];function l9(e){if(!e)return"-";const t=new Date(e);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat(hn.resolvedLanguage,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(t).replace(/\//g,"-")}function eXt(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 p.useLayoutEffect(()=>{r.current=s,s||u()},[s,u,e]),p.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(It,{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 u9="Asia/Shanghai",nXt=3e3,iXt=["Asia/Shanghai","Asia/Singapore","Asia/Tokyo","Europe/London","America/Los_Angeles","America/New_York","UTC"];function Mt(e,t){return hn.t(e,{ns:"cronjobs",...t})}function rXt(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||u9}catch{return u9}}function sXt(){const e=rXt(),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 oXt(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||u9,enabled:e.enabled}}function aXt({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(Lo,{className:"cronjobs-status",color:t,variant:"soft",size:"sm",pill:!0,children:Mt(e?JGt[e.status]:"status.notRun")})}function aoe({job:e,runtimes:t,cloudProvider:n,busy:i,onClose:r,onSubmit:s}){const[a,l]=p.useState(()=>e?oXt(e):sXt()),[c,u]=p.useState(""),[d,f]=p.useState(!1),h=p.useRef(null),m=p.useRef(null),g=p.useRef(null),b=i||d,v=p.useRef(b),y=p.useRef(r),w=p.useMemo(()=>Array.from(new Set([a.timezone,...iXt])),[a.timezone]),x=p.useMemo(()=>t.map(C=>({value:C.runtimeId,label:C.name,description:Lf(C.region,n)})),[n,t]),O=p.useMemo(()=>GFe.map((C,E)=>({value:String(E),label:Mt(C)})),[]),S=p.useMemo(()=>w.map(C=>({value:C,label:C})),[w]);p.useEffect(()=>{v.current=b,y.current=r},[b,r]),p.useEffect(()=>{var A;const C=document.body.style.overflow,E=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(A=m.current)==null||A.focus();const R=j=>{var M,P;if(j.key==="Escape"&&!v.current){y.current();return}if(j.key!=="Tab")return;const T=Array.from(((M=h.current)==null?void 0:M.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]).filter(L=>!L.hidden&&L.getClientRects().length>0);if(T.length===0){j.preventDefault();return}const N=T[0],_=T[T.length-1],D=document.activeElement;j.shiftKey&&(D===N||!((P=h.current)!=null&&P.contains(D)))?(j.preventDefault(),_.focus()):!j.shiftKey&&D===_&&(j.preventDefault(),N.focus())};return window.addEventListener("keydown",R),()=>{document.body.style.overflow=C,window.removeEventListener("keydown",R),E!=null&&E.isConnected&&E.focus()}},[]);const k=async C=>{C.preventDefault();const E=a.name.trim(),R=a.prompt.trim(),A=t.find(T=>T.runtimeId===a.runtimeId);if(!E)return u(Mt("validation.nameRequired"));if(!A)return u(Mt("validation.runtimeRequired"));if(!R)return u(Mt("validation.promptRequired"));if(a.scheduleType==="once"&&!a.onceAt||(a.scheduleType==="daily"||a.scheduleType==="weekly")&&!a.time)return u(Mt("validation.timeRequired"));const j=a.cron.trim().split(/\s+/);if(a.scheduleType==="cron"&&j.length!==5)return u(Mt("validation.cronFields"));u(""),f(!0);try{let T=(e==null?void 0:e.runtimeId)===A.runtimeId?e.agentName.trim():"";if(!T){const[N]=await SC("","",{runtimeId:A.runtimeId,region:A.region});T=(N==null?void 0:N.trim())??""}if(!T)throw new Error(Mt("validation.runtimeAppMissing"));await s({name:E,runtimeId:A.runtimeId,runtimeName:A.name,agentName:T,region:A.region,prompt:R,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(T){u(T instanceof Error?T.message:String(T)),window.requestAnimationFrame(()=>{var N;return(N=g.current)==null?void 0:N.focus()})}finally{f(!1)}};return o.jsx("div",{className:"cronjobs-drawer-backdrop",onMouseDown:C=>{C.target===C.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:Mt(e?"drawer.editTitle":"drawer.createTitle")}),o.jsx("p",{children:Mt("drawer.description")})]}),o.jsx(It,{type:"button",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:r,disabled:b,"aria-label":Mt("actions.closeDrawer"),children:o.jsx(mQ,{})})]}),o.jsxs("form",{className:"cronjobs-form",onSubmit:C=>void k(C),children:[o.jsxs("div",{className:"cronjobs-form-scroll",children:[o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:Mt("fields.name")}),o.jsx(fs,{ref:m,size:"lg",value:a.name,maxLength:80,invalid:!!c&&!a.name.trim(),onChange:C=>l({...a,name:C.target.value}),placeholder:Mt("fields.namePlaceholder")})]}),o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:Mt("fields.runtimeAgent")}),o.jsx(Js,{value:a.runtimeId,options:x,size:"lg",disabled:t.length===0,placeholder:Mt(t.length?"fields.runtimePlaceholder":"fields.noRuntime"),onChange:C=>l({...a,runtimeId:C.value})}),o.jsx("small",{children:Mt("fields.runtimeHelp")})]}),o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:Mt("fields.prompt")}),o.jsx(Sg,{value:a.prompt,rows:5,maxRows:10,autoResize:!0,maxLength:2e4,invalid:!!c&&!a.prompt.trim(),onChange:C=>l({...a,prompt:C.target.value}),placeholder:Mt("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:Mt("fields.schedule")}),o.jsxs(Pu,{className:"cronjobs-schedule-types",value:a.scheduleType,size:"lg",block:!0,"aria-label":Mt("fields.scheduleType"),onChange:C=>l({...a,scheduleType:C}),children:[o.jsx(Pu.Option,{value:"once",children:Mt("scheduleTypes.once")}),o.jsx(Pu.Option,{value:"daily",children:Mt("scheduleTypes.daily")}),o.jsx(Pu.Option,{value:"weekly",children:Mt("scheduleTypes.weekly")}),o.jsx(Pu.Option,{value:"cron",children:"Cron"})]}),a.scheduleType==="once"?o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:Mt("fields.runAt")}),o.jsx(fs,{size:"lg",type:"datetime-local",value:a.onceAt,onChange:C=>l({...a,onceAt:C.target.value})})]}):null,a.scheduleType==="daily"?o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:Mt("fields.dailyTime")}),o.jsx(fs,{size:"lg",type:"time",value:a.time,onChange:C=>l({...a,time:C.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:Mt("fields.weekday")}),o.jsx(Js,{value:String(a.weekday),options:O,size:"lg",onChange:C=>l({...a,weekday:Number(C.value)})})]}),o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:Mt("fields.runAt")}),o.jsx(fs,{size:"lg",type:"time",value:a.time,onChange:C=>l({...a,time:C.target.value})})]})]}):null,a.scheduleType==="cron"?o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:Mt("fields.cronExpression")}),o.jsx(fs,{size:"lg",value:a.cron,onChange:C=>l({...a,cron:C.target.value}),placeholder:"0 9 * * *"}),o.jsx("small",{children:Mt("fields.cronHelp")})]}):null,o.jsxs("label",{className:"cronjobs-field",children:[o.jsx("span",{children:Mt("fields.timezone")}),o.jsx(Js,{value:a.timezone,options:S,size:"lg",onChange:C=>l({...a,timezone:C.value})})]})]}),o.jsxs("div",{className:"cronjobs-switch-row",children:[o.jsxs("span",{children:[o.jsx("strong",{children:Mt("fields.enableAfterCreate")}),o.jsx("small",{children:Mt("fields.enableHelp")})]}),o.jsx(a9,{checked:a.enabled,onCheckedChange:C=>l({...a,enabled:C}),"aria-label":Mt("fields.enableAfterCreate")})]}),c?o.jsx("div",{ref:g,className:"cronjobs-inline-error",tabIndex:-1,children:o.jsx(Ty,{color:"danger",variant:"soft",description:c})}):null]}),o.jsxs("footer",{className:"cronjobs-drawer-actions",children:[o.jsx(It,{type:"button",color:"secondary",variant:"ghost",size:"lg",pill:!1,onClick:r,disabled:b,children:Mt("actions.cancel")}),o.jsx(It,{type:"submit",color:"primary",size:"lg",pill:!1,loading:b,disabled:t.length===0,"aria-busy":b||void 0,children:Mt(d?"actions.connectingRuntime":i?"actions.saving":e?"actions.saveChanges":"actions.createTask")})]})]})]})})}function lXt({jobs:e,canCreate:t,onCreate:n,onSelect:i}){return o.jsxs(n0,{children:[o.jsx(hg,{icon:o.jsx(nAe,{}),onClick:n,disabled:!t,title:Mt(t?"actions.createScheduledTask":"fields.noRuntime"),children:Mt("actions.createScheduledTask")}),e.map(r=>{const s=XFe(r.schedule);return o.jsx(r0,{className:"cronjobs-card",title:r.name,status:o.jsx(Lo,{color:r.enabled?"success":"secondary",variant:"soft",size:"sm",pill:!0,children:Mt(r.enabled?"status.enabled":"status.paused")}),description:r.prompt,metadata:[{label:Mt("fields.schedule"),value:s,title:s}],detailAction:{label:Mt("actions.viewDetails"),onClick:()=>i(r)}},r.jobId)})]})}function cXt({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 m=t.find(b=>b.status==="queued"||b.status==="running"||b.status==="retrying"||b.status==="pending")??(c9(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(It,{type:"button",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:s,"aria-label":Mt("actions.backToList"),children:o.jsx(ait,{})}),o.jsxs("div",{children:[o.jsx("h1",{children:e.name}),o.jsxs("p",{children:[e.runtimeName||e.agentName," · ",XFe(e.schedule)]})]})]}),o.jsxs("div",{className:"cronjobs-detail-actions",children:[o.jsxs(It,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:a,disabled:g,children:[o.jsx(yit,{}),Mt("actions.edit")]}),o.jsxs(It,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:l,disabled:g,children:[e.enabled?o.jsx(Sit,{}):o.jsx(sZ,{}),Mt(e.enabled?"actions.pause":"actions.enable")]}),m?o.jsxs(It,{type:"button",color:"danger",variant:"soft",size:"lg",pill:!1,onClick:()=>d(m),disabled:g||!!m.cancellationRequestedAt,children:[o.jsx(_it,{}),Mt(m.cancellationRequestedAt?m.status==="queued"?"actions.cancelling":"actions.stopping":m.status==="queued"?"actions.cancelQueue":"actions.stopRun")]}):o.jsxs(It,{type:"button",color:"primary",size:"lg",pill:!1,onClick:c,disabled:g||!e.enabled,children:[o.jsx(sZ,{}),Mt("actions.runNow")]}),o.jsx(mo,{compact:!0,content:Mt(m?m.status==="queued"?"actions.cancelQueueFirst":"actions.stopRunFirst":"actions.deleteTask"),children:o.jsxs(It,{type:"button",color:"danger",variant:"ghost",size:"lg",pill:!1,onClick:u,disabled:g||!!m,"aria-label":Mt("actions.deleteTask"),children:[o.jsx(mit,{}),Mt("actions.delete")]})})]})]}),o.jsxs("div",{className:"cronjobs-detail-scroll",children:[o.jsxs("section",{className:"cronjobs-summary-grid","aria-label":Mt("detail.configuration"),children:[o.jsxs("dl",{children:[o.jsxs("div",{children:[o.jsx("dt",{children:Mt("detail.status")}),o.jsx("dd",{children:Mt(e.enabled?"status.enabled":"status.paused")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:Mt("detail.nextRun")}),o.jsx("dd",{children:e.enabled?l9(e.nextRunAt):"-"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:Mt("detail.runtime")}),o.jsx("dd",{title:e.runtimeName,children:e.runtimeName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:Mt("detail.region")}),o.jsx("dd",{children:e.region})]})]}),o.jsxs("div",{className:"cronjobs-prompt",children:[o.jsx("span",{children:Mt("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:Mt("history.title")}),o.jsx("p",{children:Mt("history.description")})]}),o.jsx(mo,{compact:!0,content:Mt("actions.refresh"),children:o.jsx(It,{type:"button",color:"secondary",variant:"ghost",size:"lg",uniform:!0,pill:!1,onClick:h,disabled:n,"aria-label":Mt("actions.refreshHistory"),children:o.jsx(pP,{})})})]}),n&&t.length===0?o.jsx(Ha,{}):i?o.jsx(Ty,{className:"cronjobs-history-alert",color:"danger",variant:"soft",title:Mt("history.loadFailed"),description:i,actions:o.jsx(It,{type:"button",color:"danger",variant:"soft",size:"sm",pill:!1,onClick:h,children:Mt("actions.retry")})}):t.length===0?o.jsxs(Rn,{className:"cronjobs-history-state",fill:"none",children:[o.jsx(Rn.Icon,{children:o.jsx(pQ,{})}),o.jsx(Rn.Title,{children:Mt("history.emptyTitle")}),o.jsx(Rn.Description,{children:Mt("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(aXt,{run:b}),o.jsxs("div",{children:[o.jsx("strong",{children:l9(b.startedAt||b.scheduledAt)}),o.jsxs("span",{children:[Mt("history.duration",{duration:eXt(b)}),b.runtimeVersion?` · Runtime v${b.runtimeVersion}`:""]})]})]}),b.sessionId?o.jsxs("div",{className:"cronjobs-run-meta",children:[o.jsx("span",{children:Mt("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:Mt("history.finalAnswer")}),o.jsx(tXt,{output:b.output})]}):null,b.error?o.jsxs("div",{className:"cronjobs-run-output is-error",children:[o.jsx("span",{children:Mt("history.errorDetails")}),o.jsx(Eg,{message:b.error,className:"cronjobs-run-error-detail",defaultExpanded:!1,onRetry:b.status==="failed"?f:void 0,retryLabel:Mt("actions.rerun")})]}):null,b.status==="queued"||b.status==="running"||b.status==="retrying"||b.status==="pending"?o.jsx(It,{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:Mt(b.cancellationRequestedAt?"actions.stopping":b.status==="queued"?"actions.cancelQueue":"actions.stop")}):null]},b.runId))})]})]})]})}function uXt({cloudProvider:e}){je("cronjobs");const[t,n]=p.useState([]),[i,r]=p.useState([]),[s,a]=p.useState(!0),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(void 0),[m,g]=p.useState([]),[b,v]=p.useState(!1),[y,w]=p.useState(""),[x,O]=p.useState(""),[S,k]=p.useState("all"),[C,E]=p.useState(""),[R,A]=p.useState(null),[j,T]=p.useState(""),N=t.find(H=>H.jobId===u),_=S==="all"?t:t.filter(H=>S==="enabled"?H.enabled:!H.enabled),D=p.useCallback(async H=>{a(!0),c("");try{const[X,ne]=await Promise.all([Y$(H),zw({scope:"all",region:"all",pageSize:100})]);if(H!=null&&H.aborted)return;n(X),r(ne.runtimes.filter(Q=>Q.status.toLowerCase()==="ready"))}catch(X){if(H!=null&&H.aborted)return;console.warn("Unable to load scheduled tasks",X),c(Mt("page.loadFailedDescription"))}finally{H!=null&&H.aborted||a(!1)}},[]);p.useEffect(()=>{const H=new AbortController;return D(H.signal),()=>H.abort()},[D]);const M=p.useCallback(async(H,X)=>{v(!0),w("");try{const ne=await Z$(H,X);X!=null&&X.aborted||g(ne)}catch(ne){X!=null&&X.aborted||(console.warn("Unable to load scheduled-task history",ne),w(Mt("history.loadFailedDescription")))}finally{X!=null&&X.aborted||v(!1)}},[]);p.useEffect(()=>{if(!u){g([]),w("");return}const H=new AbortController;return M(u,H.signal),()=>H.abort()},[M,u]);const P=t.some(c9);p.useEffect(()=>{!P&&C===Mt("notices.queued")&&E("")},[P,C]),p.useEffect(()=>{if(!P)return;const H=new AbortController,X=async()=>{try{const[Q,Z]=await Promise.all([Y$(H.signal),u?Z$(u,H.signal):Promise.resolve(null)]);if(H.signal.aborted)return;n(Q),Z&&g(Z),Q.some(c9)||E("")}catch(Q){H.signal.aborted||E(Q instanceof Error?Q.message:String(Q))}},ne=window.setInterval(()=>void X(),nXt);return()=>{window.clearInterval(ne),H.abort()}},[P,u]);const L=H=>n(X=>X.some(ne=>ne.jobId===H.jobId)?X.map(ne=>ne.jobId===H.jobId?H:ne):[H,...X]),B=async(H,X,ne,Q=!1)=>{O(H),E("");try{await X(),E(ne)}catch(Z){const ce=Z instanceof Error?Z.message:String(Z);if(Q)throw new Error(ce);E(ce)}finally{O("")}},I=async H=>{const X=f??null;await B(`${(X==null?void 0:X.jobId)??"new"}:save`,async()=>{const ne=X?await zCe(X.jobId,H):await QCe(H);L(ne),h(void 0),X&&d(ne.jobId)},Mt(X?"notices.updated":"notices.created"),!0)},z=H=>void B(`${H.jobId}:toggle`,async()=>L(await VCe(H.jobId,!H.enabled)),Mt(H.enabled?"notices.paused":"notices.enabled")),K=(H,X)=>B(`${H.jobId}:run`,async()=>{const ne=await HCe(H.jobId);L({...H,latestRun:ne}),u===H.jobId&&g(Q=>[ne,...Q.filter(Z=>Z.runId!==ne.runId)])},X),F=H=>void K(H,Mt("notices.queued")),q=()=>{if(!R)return;T("");const H=R;H.kind==="delete"?B(`${H.job.jobId}:delete`,async()=>{await WCe(H.job.jobId),n(X=>X.filter(ne=>ne.jobId!==H.job.jobId)),d(""),A(null)},Mt("notices.deleted"),!0).catch(X=>{T(X instanceof Error?X.message:String(X))}):B(`${H.job.jobId}:cancel`,async()=>{var ne;const X=await qCe(H.job.jobId,H.run.runId);g(Q=>Q.map(Z=>Z.runId===X.runId?X:Z)),L({...H.job,latestRun:((ne=H.job.latestRun)==null?void 0:ne.runId)===X.runId?X:H.job.latestRun}),A(null)},Mt("notices.cancelRequested"),!0).catch(X=>{T(X instanceof Error?X.message:String(X))})};return N?o.jsxs(Ff,{className:"cronjobs-page","aria-label":Mt("detail.pageLabel"),children:[o.jsx(cXt,{job:N,runs:m,runsLoading:b,runsError:y,busyAction:x,onBack:()=>d(""),onEdit:()=>h(N),onToggle:()=>z(N),onRun:()=>F(N),onDelete:()=>{T(""),A({kind:"delete",job:N})},onCancel:H=>{T(""),A({kind:"cancel",job:N,run:H})},onRetryRun:()=>K(N,Mt("notices.requeued")),onRetryRuns:()=>void M(N.jobId)}),C?o.jsx("div",{className:"cronjobs-notice",role:"status",children:o.jsx(Ty,{color:"info",variant:"soft",description:C})}):null,f!==void 0?o.jsx(aoe,{job:f,runtimes:i,cloudProvider:e,busy:x.endsWith(":save"),onClose:()=>h(void 0),onSubmit:I}):null,R?o.jsx(Yu,{title:Mt(R.kind==="delete"?"confirm.deleteTitle":"confirm.cancelTitle"),description:R.kind==="delete"?Mt("confirm.deleteDescription",{name:R.job.name}):Mt("confirm.cancelDescription"),error:j,confirmLabel:Mt(R.kind==="delete"?"actions.deleteTask":"actions.stop"),variant:"danger",busy:x.endsWith(R.kind),onCancel:()=>{T(""),A(null)},onConfirm:q}):null]}):o.jsxs(Ff,{className:"cronjobs-page","aria-label":Mt("page.title"),children:[o.jsx(Jy,{className:"cronjobs-page-head",title:Mt("page.title")}),o.jsx(e0,{children:o.jsx(t0,{idPrefix:"cronjobs-filter",ariaLabel:Mt("page.filterLabel"),value:S,items:[{id:"all",label:Mt("filters.all")},{id:"enabled",label:Mt("status.enabled")},{id:"paused",label:Mt("status.paused")}],onChange:k})}),C?o.jsx("div",{className:"cronjobs-banner",role:"status",children:o.jsx(Ty,{color:"info",variant:"soft",description:C})}):null,o.jsx(Pg,{"aria-label":Mt("page.listLabel"),children:s&&t.length===0?o.jsx(Ha,{}):l?o.jsxs(Rn,{className:"cronjobs-state",fill:"none",children:[o.jsx(Rn.Icon,{color:"danger",children:o.jsx(pQ,{})}),o.jsx(Rn.Title,{color:"danger",children:Mt("page.loadFailed")}),o.jsx(Rn.Description,{children:l}),o.jsx(Rn.ActionRow,{children:o.jsxs(It,{type:"button",color:"secondary",variant:"outline",size:"lg",pill:!1,onClick:()=>void D(),children:[o.jsx(pP,{}),Mt("actions.retry")]})})]}):o.jsx(lXt,{jobs:_,canCreate:!s&&i.length>0,onCreate:()=>h(null),onSelect:H=>d(H.jobId)})}),f!==void 0?o.jsx(aoe,{job:f,runtimes:i,cloudProvider:e,busy:x.endsWith(":save"),onClose:()=>h(void 0),onSubmit:I}):null]})}const dXt={volcengine:"https://console.volcengine.com",byteplus:"https://console.byteplus.com"};function tC(e){return e.trim()}function Oq(e){return dXt[e]}function fXt(e){const t=tC(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 hXt(e,t){const n=fXt(t);if(!n)return null;const i=new URLSearchParams({id:n.bucket,region:n.region,type:"objects"});return`${Oq(e)}/tos/bucket/setting?${i.toString()}`}function pXt(e,t,n){const i=tC(t),r=tC(n);return!i||!r?null:`${Oq(e)}/agentkit/region:agentkit+${encodeURIComponent(i)}/builtintools/${encodeURIComponent(r)}/detail`}function mXt(e,t,n){const i=tC(t),r=tC(n);return!i||!r?null:`${Oq(e)}/identity/region:identity+${encodeURIComponent(i)}/user-pools/${encodeURIComponent(r)}/info`}function NO({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 gXt(e){return e instanceof Error&&e.message.includes("Volcengine credentials not found")}function bXt({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 yXt(){return{busy:!1,error:"",message:""}}function vXt({version:e,localMode:t,role:n,provider:i,region:r,onBack:s}){const{t:a}=je("ui"),l=n==="admin"||n==="super_admin",[c,u]=p.useState(""),[d,f]=p.useState([]),[h,m]=p.useState([]),[g,b]=p.useState(null),[v,y]=p.useState(!0),[w,x]=p.useState(""),[O,S]=p.useState(!0),[k,C]=p.useState(""),[E,R]=p.useState(!0),[A,j]=p.useState(""),[T,N]=p.useState(0),[_,D]=p.useState(0),[M,P]=p.useState(0),L=p.useRef(!1),[B,I]=p.useState({}),[z,K]=p.useState({}),[F,q]=p.useState(""),[H,X]=p.useState(!0),ne=p.useRef(new Set),Q=p.useRef(0),Z=`${i}:${r}`,ce=p.useRef(Z);ce.current=Z,p.useEffect(()=>{K({}),I({})},[Z]),p.useEffect(()=>(L.current=!0,()=>{L.current=!1}),[]);function Ee(G,te){I(ue=>({...ue,[G]:{...yXt(),...ue[G],...te}}))}async function Y(G){if(!G.toolId||ne.current.has(G.toolId))return;const te=Z;ne.current.add(G.toolId),Q.current+=1,Ee(G.toolId,{busy:!0,error:"",message:""});try{const ue=await cTe(G.kind);if(!L.current||ce.current!==te)return;Q.current+=1,K(Ce=>({...Ce,[G.toolId]:ue.state})),Ee(G.toolId,{busy:!1,error:"",message:ue.updated?a("systemInfo.modelEnvUpdated"):a("systemInfo.modelEnvAlreadyCurrent")})}catch{if(!L.current||ce.current!==te)return;Q.current+=1,Ee(G.toolId,{busy:!1,error:a("systemInfo.sandboxUpdateError"),message:""})}finally{ne.current.delete(G.toolId)}}return p.useEffect(()=>{if(!l)return;const G=new AbortController,te=++Q.current;return q(""),X(!0),lTe(G.signal).then(ue=>{G.signal.aborted||te!==Q.current||K(Object.fromEntries(ue.map(Ce=>[Ce.toolId,Ce])))}).catch(()=>{!G.signal.aborted&&te===Q.current&&q(a("systemInfo.versionCheckError"))}).finally(()=>{G.signal.aborted||X(!1)}),()=>G.abort()},[l,i,r,T]),p.useEffect(()=>{if(!Object.values(z).some(te=>te.status==="Updating"||te.status==="Creating"))return;const G=window.setTimeout(()=>N(te=>te+1),5e3);return()=>window.clearTimeout(G)},[z]),p.useEffect(()=>{if(!l){u(""),f([]),y(!1),x("");return}const G=new AbortController;return y(!0),x(""),lCe(G.signal).then(te=>{G.signal.aborted||(u(te.storage.tosAddress),f(te.sandboxTools))}).catch(te=>{(te==null?void 0:te.name)!=="AbortError"&&x(a("systemInfo.sandboxInfoError"))}).finally(()=>{G.signal.aborted||y(!1)}),()=>G.abort()},[l,i,r,T]),p.useEffect(()=>{if(!l){m([]),S(!1),C("");return}const G=new AbortController;return S(!0),C(""),GI(G.signal).then(te=>{m(te.filter(ue=>ue.isCurrent))}).catch(te=>{if((te==null?void 0:te.name)!=="AbortError"){if(t&&gXt(te)){m([]);return}C(a("systemInfo.userPoolError"))}}).finally(()=>{G.signal.aborted||S(!1)}),()=>G.abort()},[l,t,_]),p.useEffect(()=>{if(!l){b(null),R(!1),j("");return}const G=new AbortController;return R(!0),j(""),TCe(G.signal).then(b).catch(te=>{(te==null?void 0:te.name)!=="AbortError"&&j(a("systemInfo.environmentResourcesError"))}).finally(()=>{G.signal.aborted||R(!1)}),()=>G.abort()},[l,M]),o.jsxs("div",{className:"system-info-page",children:[o.jsxs("header",{className:"system-info-page-header",children:[o.jsx(hP,{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(mn,{as:"span",children:a("systemInfo.loadingStorage")})}):w?o.jsxs("div",{className:"system-info-error",role:"alert",children:[o.jsx("p",{children:w}),o.jsx("button",{type:"button",onClick:()=>N(G=>G+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(NO,{href:hXt(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")}),E?o.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:o.jsx(mn,{as:"span",children:a("systemInfo.loadingEnvironmentResources")})}):A?o.jsxs("div",{className:"system-info-error",role:"alert",children:[o.jsx("p",{children:A}),o.jsx("button",{type:"button",onClick:()=>P(G=>G+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(NO,{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(NO,{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:H,onClick:()=>N(G=>G+1),children:a(H?"systemInfo.checkingVersions":"systemInfo.checkUpdates")}),v?o.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:o.jsx(mn,{as:"span",children:a("systemInfo.loadingSandboxInfo")})}):w?o.jsxs("div",{className:"system-info-error",role:"alert",children:[o.jsx("p",{children:w}),o.jsx("button",{type:"button",onClick:()=>N(G=>G+1),children:a("common.reload")})]}):o.jsxs("div",{className:"system-info-tool-list",children:[F?o.jsx("span",{className:"system-info-inline-error",role:"alert",children:F}):null,d.map(G=>{var he;const te=z[G.toolId],ue=B[G.toolId],Ce=!!G.toolId&&!!(te!=null&&te.canUpdate),se=(ue==null?void 0:ue.error)||(te!=null&&te.error?a("systemInfo.versionCheckError"):te!=null&&te.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:G.label}),G.snapshot?o.jsx("span",{className:"system-info-tool-badge",children:a("systemInfo.snapshot")}):null]}),o.jsxs("dd",{className:`system-info-resource-value${G.toolId?"":" is-empty"}`,children:[o.jsx(NO,{href:pXt(i,(te==null?void 0:te.region)||r,G.toolId),label:a("systemInfo.openToolConsole",{name:G.label}),children:G.toolId||a("common.notConfigured")}),Ce?o.jsx("button",{type:"button",className:"system-info-resource-update",disabled:ue==null?void 0:ue.busy,"aria-busy":(ue==null?void 0:ue.busy)||void 0,"aria-label":a("systemInfo.updateSandbox",{name:G.label,variant:G.snapshot?a("systemInfo.snapshotWithSpace"):""}),title:a("systemInfo.updateSandbox",{name:G.label,variant:G.snapshot?a("systemInfo.snapshotWithSpace"):""}),onClick:()=>void Y(G),children:o.jsx(bXt,{spinning:(ue==null?void 0:ue.busy)||!1})}):null,te!=null&&te.currentImage?o.jsxs("span",{className:"system-info-inline-status",title:`${te.currentImage} → ${te.latestImage}`,children:[te.currentImage.split(":").pop(),te.needsImageUpdate?` → ${(he=te.latestImage)==null?void 0:he.split(":").pop()}`:"",te.status==="Updating"?` · ${a("systemInfo.updatingSandbox")}`:""]}):null,ue!=null&&ue.message?o.jsx("span",{className:"system-info-inline-status",role:"status",children:ue.message}):null,se?o.jsx("span",{className:"system-info-inline-error",role:"alert",children:se}):null]})]})},G.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")}),O?o.jsx("div",{className:"system-info-loading",role:"status","aria-live":"polite",children:o.jsx(mn,{as:"span",children:a("systemInfo.loadingUserPool")})}):k?o.jsxs("div",{className:"system-info-error",role:"alert",children:[o.jsx("p",{children:k}),o.jsx("button",{type:"button",onClick:()=>D(G=>G+1),children:a("common.reload")})]}):h.length>0?o.jsx("div",{className:"system-info-pool-list",children:h.map(G=>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(NO,{href:mXt(i,G.region||r,G.uid),label:a("systemInfo.openUserPoolConsole",{name:G.name||""}),children:G.name||a("systemInfo.unnamedUserPool")})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:a("systemInfo.id")}),o.jsx("dd",{children:G.uid||"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:a("systemInfo.domain")}),o.jsx("dd",{children:G.domain||"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:a("systemInfo.region")}),o.jsx("dd",{children:G.region||"—"})]})]},G.uid))}):o.jsx("p",{className:"system-info-empty",children:a(t?"systemInfo.noLocalUserPool":"systemInfo.noUserPool")})]})]}):null]})]})}const xXt="_TextLink_16uec_1",wXt={TextLink:xXt},YA=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=_je(),m=l||(f?"a":h),g={...d,className:Ti(wXt.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(m,{...b,children:t})},OXt="/assets/media/article-agent-workflow-GXPkXUjV.webp",kXt="/assets/media/article-tool-debugging-BxiMDz_8.webp",SXt="/assets/media/showcase-a2ui-BgBnE9RT.webp",EXt="/assets/media/showcase-customer-service-DNw0mUH1.webp",CXt="/assets/media/showcase-multimodal-BRTl8NLI.webp",TXt="/assets/media/showcase-research-assistant-CbfMFfhS.webp",AXt="/assets/media/showcase-web-search-D2kl1imN.webp",_Xt={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 jXt(e){return _Xt[e]}const NXt=[{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"}],RXt="https://volcengine.github.io/veadk-python/",IXt="https://volcengine.github.io/agentkit-sdk-python/content/2.agentkit-cli/1.overview.html",PXt=[{id:"veadk-development",titleKey:"developerResources.articles.veadkDevelopment.title",descriptionKey:"developerResources.articles.veadkDevelopment.description",meta:"AgentKit · VeADK",image:OXt,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:kXt,href:"https://docs.volcengine.com/docs/86681/1844871?lang=zh"}],DXt=[{id:"research-assistant",titleKey:"developerResources.showcases.researchAssistant.title",descriptionKey:"developerResources.showcases.researchAssistant.description",image:TXt,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:CXt,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:EXt,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:AXt,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:SXt,href:"https://github.com/volcengine/veadk-python/tree/main/examples/a2ui_agent"}];function MXt({cloudProvider:e}){const{t}=je("workspaceTools"),n=jXt(e);return o.jsxs(Ff,{className:"developer-resources","aria-label":t("developerResources.title"),children:[o.jsx(Jy,{title:t("developerResources.title")}),o.jsx("div",{className:"developer-resources__content",children:NXt.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(YA,{className:"developer-resources__link",primary:!0,underline:!0,href:RXt,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.veadkDocs"),o.jsx(P2,{"aria-hidden":"true"})]})}),o.jsx("li",{children:o.jsxs(YA,{className:"developer-resources__link",primary:!0,underline:!0,href:IXt,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.cliDocs"),o.jsx(P2,{"aria-hidden":"true"})]})}),o.jsx("li",{children:o.jsxs(YA,{className:"developer-resources__link",primary:!0,underline:!0,href:n.docs,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.platformDocs"),o.jsx(P2,{"aria-hidden":"true"})]})}),o.jsx("li",{children:o.jsxs(YA,{className:"developer-resources__link",primary:!0,underline:!0,href:n.console,target:"_blank",rel:"noreferrer",children:[t("developerResources.links.console"),o.jsx(P2,{"aria-hidden":"true"})]})})]}):i.id==="best-practices"?o.jsx("div",{className:"developer-resources__articles",children:PXt.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:DXt.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))})]})}function LXt({cloudProvider:e,onPendingCountChange:t,onChanged:n}){const{t:i,i18n:r}=je("agentReviews"),[s,a]=p.useState(qi(e)),[l,c]=p.useState([]),[u,d]=p.useState(!0),[f,h]=p.useState(""),[m,g]=p.useState(""),[b,v]=p.useState("all"),[y,w]=p.useState(0),[x,O]=p.useState(null);p.useEffect(()=>{a(qi(e))},[e]),p.useEffect(()=>{const C=new AbortController;return d(!0),h(""),sWt(s,C.signal).then(E=>{C.signal.aborted||(c(E.items),t(E.items.filter(R=>R.status==="pending").length))}).catch(E=>{C.signal.aborted||h(E instanceof Error?E.message:String(E))}).finally(()=>{C.signal.aborted||d(!1)}),()=>C.abort()},[s,y,t]);const S=p.useMemo(()=>l.filter(C=>(b==="all"||C.status===b)&&`${C.agent.name} ${C.submitter.name}`.toLocaleLowerCase().includes(m.trim().toLocaleLowerCase())),[l,m,b]),k=[{key:"name",header:i("agent"),className:"review-column-name",render:C=>o.jsx("button",{type:"button",className:"agent-review-name",onClick:()=>O(C),children:C.agent.name})},{key:"submitter",header:i("submitter"),render:C=>o.jsx(ZR,{person:C.submitter})},{key:"version",header:i("version"),render:C=>C.agent.version??"—"},{key:"submittedAt",header:i("submittedAt"),render:C=>o.jsx("time",{dateTime:C.submittedAt,children:new Date(C.submittedAt).toLocaleString(r.language)})},{key:"status",header:i("statusTitle"),render:C=>o.jsxs("div",{children:[i(`status.${C.status}`),C.reviewer?o.jsx(ZR,{person:C.reviewer}):null]})},{key:"actions",header:i("actions"),render:C=>o.jsx("button",{type:"button",onClick:()=>O(C),children:i(C.status==="pending"?"review":"details")})}];return o.jsxs("div",{className:"agent-review-center","aria-label":i("title"),children:[f?o.jsxs("div",{className:"agent-review-error",role:"alert",children:[o.jsx("p",{children:f}),o.jsx("button",{type:"button",onClick:()=>w(C=>C+1),children:i("refresh")})]}):null,o.jsx(Bz,{rows:S,rowKey:C=>`${C.region}:${C.id}`,columns:k,searchValue:m,onSearchChange:g,searchPlaceholder:i("search"),searchLabel:i("search"),toolbarActions:o.jsxs(o.Fragment,{children:[o.jsx(fg,{id:"agent-review-region",ariaLabel:i("region"),value:s,options:iu(e),onChange:C=>{a(C),c([]),O(null)}}),o.jsx(fg,{id:"agent-review-status",ariaLabel:i("statusTitle"),value:b,options:["all","pending","approved","returned","withdrawn"].map(C=>({value:C,label:i(C==="all"?"all":`status.${C}`)})),onChange:v}),o.jsx("button",{type:"button",disabled:u,onClick:()=>w(C=>C+1),children:i("refresh")})]}),emptyLabel:u?o.jsx(Ha,{}):f?null:o.jsx("p",{className:"agent-review-empty",children:i(m||b!=="all"?"noMatches":"empty")})}),x?o.jsx(xFe,{runtimeId:x.runtimeId,region:x.region,name:x.agent.name,canPublish:!0,onClose:()=>O(null),onChanged:()=>{n==null||n(),w(C=>C+1)}},`${x.region}:${x.id}`):null]})}function $Xt({application:e,decision:t,onClose:n,onDecided:i}){const{t:r}=je("reviews"),[s,a]=p.useState(""),[l,c]=p.useState(e.status==="approving"&&e.comment||""),[u,d]=p.useState(!1),[f,h]=p.useState(!1),m=p.useRef(!1),[g,b]=p.useState(null),v=t==="returned",y=v&&!s.trim(),w=p.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null),x=async()=>{if(!m.current&&(d(!0),!y)){m.current=!0,h(!0),b(null);try{const O=await nDt({id:e.id,region:e.region,decision:t,reason:s.trim(),comment:l.trim()});i(O)}catch(O){b(yr(O,r("decision.failed")))}finally{m.current=!1,h(!1)}}};return o.jsx(k1,{open:!0,onOpenChange:O=>{!O&&!m.current&&n()},children:o.jsxs(O1,{children:[o.jsx(x1,{className:"review-backdrop"}),o.jsxs(w1,{className:"confirm-box review-decision",finalFocus:()=>{var O;return(O=w.current)!=null&&O.isConnected?w.current:document.getElementById("review-skill-tab")},children:[o.jsx(S1,{className:"confirm-title",children:r(v?"decision.returnTitle":"decision.approveTitle")}),o.jsx(ET,{className:"confirm-text",children:r(v?"decision.returnDescription":"decision.approveDescription",{name:e.name,version:e.version})}),v?o.jsxs("div",{className:"review-decision__field",children:[o.jsx("label",{className:"cw-label",htmlFor:"review-return-reason",children:r("decision.reason")}),o.jsx("textarea",{id:"review-return-reason",className:"cw-input",rows:4,maxLength:256,required:!0,disabled:f,value:s,onChange:O=>a(O.target.value),onBlur:()=>d(!0),"aria-invalid":u&&y,"aria-describedby":"review-return-help"}),o.jsx("span",{id:"review-return-help",className:u&&y?"cw-error-text":"cw-help",role:u&&y?"alert":void 0,children:r(u&&y?"decision.reasonRequired":"decision.reasonHelp")})]}):null,o.jsxs("div",{className:"review-decision__field",children:[o.jsx("label",{className:"cw-label",htmlFor:"review-decision-comment",children:r("decision.comment")}),o.jsx("textarea",{id:"review-decision-comment",className:"cw-input",rows:3,maxLength:256,disabled:f||e.status==="approving",value:l,onChange:O=>c(O.target.value),"aria-describedby":"review-comment-help"}),o.jsx("span",{id:"review-comment-help",className:"cw-help",children:r("decision.commentHelp")})]}),g?o.jsx("div",{role:"alert",className:"review-decision__error",children:o.jsx(ps,{error:g})}):null,o.jsxs("div",{className:"confirm-actions",children:[o.jsx(It,{color:"secondary",variant:"outline",size:"md",pill:!1,disabled:f,onClick:n,children:r("actions.cancel")}),o.jsx(It,{color:"primary",size:"md",pill:!1,disabled:f||y,onClick:()=>void x(),children:r(f?"decision.saving":v?"actions.confirmReturn":"actions.confirmApprove")})]})]})]})})}const FXt=p.lazy(()=>Bs(()=>Promise.resolve().then(()=>THt),void 0).then(e=>({default:e.SkillFileTree})));function BXt({application:e,cloudProvider:t,onClose:n,onDecision:i,onScoreChanged:r}){var O;const{t:s,i18n:a}=je("reviews"),[l,c]=p.useState("overview"),[u,d]=p.useState([]),[f,h]=p.useState(!1),[m,g]=p.useState(null),[b,v]=p.useState(0),y=p.useRef(document.activeElement instanceof HTMLElement?document.activeElement:null);p.useEffect(()=>{if(l!=="files")return;const S=new AbortController;return h(!0),g(null),tDt({id:e.id,region:e.region,signal:S.signal}).then(k=>{S.signal.aborted||d(k.files)}).catch(k=>{S.signal.aborted||g(yr(k,s("detail.filesFailed")))}).finally(()=>{S.signal.aborted||h(!1)}),()=>S.abort()},[e.id,e.region,l,b,s]);const w=e.reviewedAt?new Date(e.reviewedAt).toLocaleString(a.language,{hour12:!1}):"—",x=e.submittedAt?new Date(e.submittedAt).toLocaleString(a.language,{hour12:!1}):"—";return o.jsx(k1,{open:!0,onOpenChange:S=>{S||n()},children:o.jsxs(O1,{children:[o.jsx(x1,{className:"review-backdrop"}),o.jsxs(w1,{className:"review-drawer",finalFocus:()=>{var S;return(S=y.current)!=null&&S.isConnected?y.current:document.getElementById("review-skill-tab")},children:[o.jsxs("header",{className:"review-drawer__header",children:[o.jsxs("div",{children:[o.jsx(S1,{children:s("detail.title")}),o.jsx(ET,{children:s("detail.versionFixed")})]}),o.jsx(KD,{className:"review-icon-button","aria-label":s("actions.close"),children:o.jsx(yD,{})})]}),o.jsxs("div",{className:"review-drawer__identity",children:[o.jsx("span",{className:"review-resource-icon",children:o.jsx(Fje,{})}),o.jsxs("div",{children:[o.jsx("h2",{children:e.name}),o.jsxs("span",{children:[s("kind.skill")," · ",e.version]})]}),o.jsx(CT,{status:e.status})]}),o.jsx(t0,{className:"review-drawer__tabs",idPrefix:"review-detail",ariaLabel:s("detail.sections"),value:l,items:[{id:"overview",label:s("detail.overview"),panelId:"review-detail-panel"},{id:"files",label:s("detail.filesTab"),panelId:"review-detail-panel"},{id:"score",label:s("score.title"),panelId:"review-detail-panel"}],onChange:c}),o.jsx("div",{className:"review-drawer__body",id:"review-detail-panel",role:"tabpanel","aria-labelledby":`review-detail-${l}-tab`,children:l==="score"?o.jsx(oFe,{application:e,canRetry:!0,onScoreChanged:r},`${e.region}:${e.id}`):l==="files"?f?o.jsx(Ha,{}):m?o.jsxs("div",{role:"alert",children:[o.jsx(ps,{error:m}),o.jsx("button",{type:"button",onClick:()=>v(S=>S+1),children:s("space.retry")})]}):o.jsx("div",{className:"review-files",children:o.jsx(p.Suspense,{fallback:o.jsx(Ha,{}),children:o.jsx(FXt,{files:u})})}):o.jsxs(o.Fragment,{children:[o.jsxs("dl",{className:"review-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:s("columns.submitter")}),o.jsx("dd",{children:e.author||s("detail.unknownAuthor")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("columns.submittedAt")}),o.jsx("dd",{children:x})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("columns.version")}),o.jsx("dd",{children:e.version})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("detail.source")}),o.jsx("dd",{children:s("detail.source_skill",{name:e.author})})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("detail.destination")}),o.jsx("dd",{children:s("detail.destination_skill")})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("detail.region")}),o.jsx("dd",{children:Lf(e.region,t)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:s("detail.visibility")}),o.jsx("dd",{children:s("detail.shared")})]})]}),o.jsxs("section",{className:"review-detail-section",children:[o.jsx("h3",{children:s("detail.description")}),o.jsx("p",{children:e.description||"—"})]}),o.jsxs("section",{className:"review-detail-section",children:[o.jsx("h3",{children:s("detail.result")}),o.jsx(lq,{application:e})]}),o.jsxs("section",{className:"review-detail-section review-history",children:[o.jsx("h3",{children:s("detail.history")}),o.jsxs("div",{children:[o.jsx("span",{className:"review-history__dot","aria-hidden":"true"}),o.jsxs("p",{children:[o.jsx("strong",{children:s("detail.submitted",{name:e.author})}),o.jsx("span",{children:x})]})]}),e.reviewedAt?o.jsxs("div",{children:[o.jsx("span",{className:"review-history__dot","aria-hidden":"true"}),o.jsxs("p",{children:[o.jsx("strong",{children:s(`detail.${e.status==="approved"?"approved":e.status==="returned"?"returned":"approving"}`,{name:((O=e.reviewer)==null?void 0:O.name)||e.reviewedBy||s("detail.unknownReviewer")})}),o.jsx("span",{children:w})]})]}):null]})]})}),o.jsxs("footer",{className:"review-drawer__footer",children:[e.status==="pending"?o.jsx(It,{color:"secondary",variant:"outline",size:"md",pill:!1,onClick:()=>i("returned"),children:s("actions.return")}):null,e.status==="pending"||e.status==="approving"?o.jsx(It,{color:"primary",size:"md",pill:!1,onClick:()=>i("approved"),children:s(e.status==="approving"?"actions.resumeApproval":"actions.approve")}):o.jsx("span",{children:s(`status.${e.status}`)})]})]})]})})}function UXt({cloudProvider:e,onAgentChanged:t}){const{t:n,i18n:i}=je("reviews"),[r,s]=p.useState([]),[a,l]=p.useState(null),[c,u]=p.useState("skill"),[d,f]=p.useState(qi(e)),[h,m]=p.useState(!0),[g,b]=p.useState(null),[v,y]=p.useState(0),[w,x]=p.useState("all"),[O,S]=p.useState(""),[k,C]=p.useState(null),[E,R]=p.useState(null),[A,j]=p.useState(""),T=(M,P,L=!1)=>{C(null),j(""),R({application:M,value:P,fromDetails:L})};p.useEffect(()=>{if(c!=="skill")return;const M=new AbortController;let P,L=!1,B=!1;m(!0),b(null);const I=async()=>{if(!(L||M.signal.aborted)){L=!0;try{const K=await eDt({region:d,signal:M.signal});if(M.signal.aborted)return;s(K.items),C(F=>F&&K.items.find(q=>q.id===F.id)||null),B=K.items.some(F=>sFe(F.aiReview)),B&&document.visibilityState!=="hidden"&&(P=setTimeout(()=>void I(),5e3))}catch(K){M.signal.aborted||b(yr(K,n("space.failed"))),B=!1}finally{L=!1,M.signal.aborted||m(!1)}}},z=()=>{clearTimeout(P),B&&document.visibilityState!=="hidden"&&I()};return I(),document.addEventListener("visibilitychange",z),()=>{M.abort(),clearTimeout(P),document.removeEventListener("visibilitychange",z)}},[d,c,v,n]);const N=FHt(r,c,w,O),_=!!O.trim()||w!=="all",D=[{key:"name",header:n("columns.application"),className:"review-column-name",render:M=>o.jsxs("div",{className:"review-name",children:[o.jsx("span",{className:"review-resource-icon",children:o.jsx(Fje,{})}),o.jsx("div",{children:o.jsx("button",{type:"button",title:M.name,onClick:()=>C(M),children:M.name})})]})},{key:"submitter",header:n("columns.submitter"),className:"review-column-submitter",render:M=>M.author||n("detail.unknownAuthor")},{key:"version",header:n("columns.version"),className:"review-column-version",render:M=>M.version},{key:"submitted",header:n("columns.submittedAt"),className:"review-column-time",render:M=>M.submittedAt?o.jsx("time",{dateTime:M.submittedAt,title:new Date(M.submittedAt).toLocaleString(i.language),children:new Date(M.submittedAt).toLocaleString(i.language,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})}):"—"},{key:"status",header:n("columns.status"),className:"review-column-status",render:M=>o.jsxs("div",{className:"review-table-outcome",children:[o.jsx(CT,{status:M.status}),M.reviewer||M.reviewedBy?o.jsx(aq,{compact:!0,person:M.reviewer,fallback:M.reviewedBy}):null]})},{key:"score",header:n("score.title"),className:"review-column-score",render:M=>o.jsx(oq,{score:M.aiReview})},{key:"actions",header:n("columns.actions"),className:"review-column-actions",render:M=>o.jsxs("div",{className:"review-row-actions",children:[o.jsx("button",{type:"button",onClick:()=>C(M),"aria-label":n("actions.detailsFor",{name:M.name}),children:n("actions.details")}),M.status==="pending"||M.status==="approving"?o.jsx("button",{type:"button",onClick:()=>T(M,"approved"),children:n(M.status==="approving"?"actions.resumeApproval":"actions.approve")}):null,M.status==="pending"?o.jsx("button",{type:"button",onClick:()=>T(M,"returned"),children:n("actions.return")}):null]})}];return o.jsxs(Ff,{className:"review-center","aria-label":n("title"),children:[o.jsx(Jy,{title:n("title")}),o.jsx(e0,{children:o.jsx(t0,{idPrefix:"review",ariaLabel:n("category"),value:c,items:["skill","agent"].map(M=>({id:M,label:o.jsxs(o.Fragment,{children:[n(`kind.${M}`),M==="agent"?a===null?null:o.jsx("span",{className:"review-tab-count",children:a}):o.jsx("span",{className:"review-tab-count",children:r.filter(P=>P.kind===M&&(P.status==="pending"||P.status==="approving")).length})]}),panelId:"review-requests-panel"})),onChange:M=>{u(M),x("all"),S(""),C(null)}})}),o.jsx("div",{className:"review-center__panel",id:"review-requests-panel",role:"tabpanel","aria-labelledby":`review-${c}-tab`,children:c==="agent"?o.jsx(LXt,{cloudProvider:e,onPendingCountChange:l,onChanged:t}):o.jsxs(o.Fragment,{children:[c==="skill"&&g?o.jsxs("div",{role:"alert",children:[o.jsx(ps,{error:g}),o.jsx("button",{type:"button",onClick:()=>y(M=>M+1),children:n("space.retry")})]}):null,A?o.jsx("p",{role:"status",className:"review-notice",children:A}):null,o.jsx(Bz,{rows:N,rowKey:M=>M.id,columns:D,searchValue:O,onSearchChange:S,searchPlaceholder:n("search"),searchLabel:n("search"),toolbarActions:o.jsxs(o.Fragment,{children:[c==="skill"?o.jsxs(o.Fragment,{children:[o.jsx(fg,{id:"review-region",ariaLabel:n("detail.region"),value:d,options:iu(e),onChange:M=>{s([]),C(null),f(M)}}),o.jsx("button",{type:"button",disabled:h,onClick:()=>y(M=>M+1),children:n("actions.refresh")})]}):null,o.jsx(fg,{id:"review-status",ariaLabel:n("filterStatus"),value:w,options:["all","pending","approving","approved","returned"].map(M=>({value:M,label:n(`status.${M}`)})),onChange:x})]}),emptyLabel:c==="skill"&&h?o.jsx(Ha,{}):c==="skill"&&g?null:o.jsxs("div",{className:"review-empty",children:[o.jsx("strong",{children:n(_?"empty.filteredTitle":"empty.title")}),o.jsx("span",{children:n(_?"empty.filteredDescription":"empty.description")}),_?o.jsx("button",{type:"button",onClick:()=>{S(""),x("all")},children:n("actions.clearFilters")}):null]})}),o.jsx("div",{className:"review-center__count",children:n("total",{count:N.length})})]})}),k?o.jsx(BXt,{application:k,cloudProvider:e,onClose:()=>C(null),onDecision:M=>T(k,M,!0),onScoreChanged:(M,P)=>{const L=YHt(M);s(B=>B.map(I=>I.id===k.id?{...I,aiReview:L}:I)),P&&y(B=>B+1)}},k.id):null,E?o.jsx($Xt,{application:E.application,decision:E.value,onClose:()=>{E.fromDetails&&C(E.application),R(null),y(M=>M+1)},onDecided:M=>{s(P=>P.map(L=>L.id===M.id?M:L)),E.fromDetails&&C(M),j(n(M.status==="approved"?"decision.approved":"decision.returned",{name:M.name})),R(null)}},`${E.application.id}:${E.value}`):null]})}function QXt({role:e,cloudProvider:t,onAgentChanged:n}){const{t:i}=je("reviews");return e!=="admin"&&e!=="super_admin"?o.jsxs(Ff,{className:"review-center",children:[o.jsx(Jy,{title:i("title")}),o.jsx("p",{role:"status",children:i("adminOnly")})]}):o.jsx(UXt,{cloudProvider:t,onAgentChanged:n},t)}const ZA=10;function zXt(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 VXt({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 db(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 HXt(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 qXt(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 RO(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 C1(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 WXt(e){try{return`https://github.com/${vq(e)}`}catch{return""}}function KXt(e){return e==="started"?"评审中":e==="completed"?"已完成":e==="ignored"?"已忽略":"失败"}function GXt(e){return e==="webhook"?"自动触发":"手动发起"}function XXt(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 YXt(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 loe(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 ZXt({automation:e,cloudProvider:t,onBack:n,onOpenSandboxSession:i}){const{t:r}=je("automations"),s=VGt(e),a=e==="review",l=iu(t),c=s.secrets({cloudProvider:t}),[u,d]=p.useState(()=>({...s.initialValues({cloudProvider:t})})),f=l.find(Xe=>Xe.value===u.region),[h,m]=p.useState({}),[g,b]=p.useState(""),[v,y]=p.useState(!1),[w,x]=p.useState(!1),[O,S]=p.useState(!1),[k,C]=p.useState(null),[E,R]=p.useState(""),[A,j]=p.useState(null),[T,N]=p.useState(""),[_,D]=p.useState(!1),[M,P]=p.useState(null),[L,B]=p.useState(""),[I,z]=p.useState(a),[K,F]=p.useState([]),[q,H]=p.useState(a),[X,ne]=p.useState(""),[Q,Z]=p.useState(null),[ce,Ee]=p.useState(1),[Y,G]=p.useState(!1),[te,ue]=p.useState(""),[Ce,se]=p.useState(""),[he,ae]=p.useState(""),[Ae,De]=p.useState([]),[ye,Qe]=p.useState(a),[we,Ne]=p.useState(""),[ie,fe]=p.useState(null),[Se,ke]=p.useState(1),[qe,it]=p.useState(!1),de=p.useRef(null),ve=p.useRef(null),Te=p.useRef(null),Ke=p.useRef(null),$e=p.useRef(null),At=WXt(u.repository),Nt=At.replace("https://github.com/",""),vt=At?`${At}/settings/secrets/actions`:"",Ot=(M==null?void 0:M.appSlug)||"agentkit-veadk-studio",Tt=(M==null?void 0:M.installUrl)||`https://github.com/apps/${Ot}/installations/new`,ft=ioe(E),gt=K.filter(Xe=>Xe.reviewEnabled),Me=ft?K.find(Xe=>Xe.fullName.toLowerCase()===ft.toLowerCase()):void 0,bt=ce>1||Y,jt=Se>1||qe;p.useEffect(()=>()=>{var Xe,mt,St,on,zt;(Xe=de.current)==null||Xe.abort(),(mt=ve.current)==null||mt.abort(),(St=Te.current)==null||St.abort(),(on=Ke.current)==null||on.abort(),(zt=$e.current)==null||zt.abort()},[]),p.useEffect(()=>{var Xe,mt,St;d({...s.initialValues({cloudProvider:t})}),m({}),b(""),C(null),S(!1),(Xe=de.current)==null||Xe.abort(),(mt=ve.current)==null||mt.abort(),(St=$e.current)==null||St.abort(),j(null),N(""),De([]),Ne(""),fe(null),Ee(1),G(!1),ue(""),se(""),ke(1),it(!1)},[e,t,s]),p.useEffect(()=>{var mt;if(!a)return;(mt=Te.current)==null||mt.abort();const Xe=new AbortController;Te.current=Xe,z(!0),B(""),wGt(Xe.signal).then(St=>{Te.current===Xe&&(P(St),St.configured||(H(!1),Qe(!1)))}).catch(St=>{Xe.signal.aborted||Te.current!==Xe||(B(St instanceof Error?St.message:String(St)),H(!1),Qe(!1))}).finally(()=>{Te.current===Xe&&(Te.current=null,z(!1))})},[a]);const Ct=(Xe=ce,mt=Ce)=>{var on;(on=Ke.current)==null||on.abort();const St=new AbortController;Ke.current=St,H(!0),ne(""),OGt(St.signal,{page:Xe,pageSize:ZA,query:mt}).then(zt=>{if(Ke.current===St){if(zt.repositories.length===0&&zt.page>1){Ee(zt.page-1),Ct(zt.page-1);return}F(zt.repositories),Ee(zt.page),G(zt.hasNextPage),Z({reviewSettingsConfigured:zt.reviewSettingsConfigured,reviewSettingsReason:zt.reviewSettingsReason})}}).catch(zt=>{St.signal.aborted||Ke.current!==St||ne(zt instanceof Error?zt.message:String(zt))}).finally(()=>{Ke.current===St&&(Ke.current=null,H(!1))})},sn=(Xe=Se)=>{var St;(St=$e.current)==null||St.abort();const mt=new AbortController;$e.current=mt,Qe(!0),Ne(""),kGt(mt.signal,{page:Xe,pageSize:ZA}).then(on=>{if($e.current===mt){if(on.records.length===0&&on.page>1){ke(on.page-1),sn(on.page-1);return}De(on.records),ke(on.page),it(on.hasNextPage),fe({reviewSettingsConfigured:on.reviewSettingsConfigured,reviewSettingsReason:on.reviewSettingsReason})}}).catch(on=>{mt.signal.aborted||$e.current!==mt||Ne(on instanceof Error?on.message:String(on))}).finally(()=>{$e.current===mt&&($e.current=null,Qe(!1))})};p.useEffect(()=>{!a||(M==null?void 0:M.configured)!==!0||(Ct(1),sn(1))},[M==null?void 0:M.configured,a]);const We=()=>{const Xe=te.trim();se(Xe),Ee(1),Ct(1,Xe)},Le=()=>{ue(""),se(""),Ee(1),Ct(1,"")},Ge=(Xe,mt)=>{if(!(mt<1)){if(Xe==="repositories"){Ee(mt),Ct(mt,Ce);return}ke(mt),sn(mt)}},pt=async Xe=>{if((Q==null?void 0:Q.reviewSettingsConfigured)!==!0||he)return;const mt=new AbortController;ae(Xe.fullName),ne("");try{const St=await SGt({repository:Xe.fullName,reviewEnabled:!Xe.reviewEnabled},mt.signal),on=new Set(St.map(zt=>zt.toLowerCase()));F(zt=>zt.map(Be=>({...Be,reviewEnabled:on.has(Be.fullName.toLowerCase())})))}catch(St){ne(St instanceof Error?St.message:String(St))}finally{ae("")}},ot=(Xe,mt)=>{d(St=>({...St,[Xe]:mt})),h[Xe]&&m(St=>({...St,[Xe]:""}))},kt=Xe=>{var zt;const mt=!a&&Xe==="token"||Xe==="pullRequestUrl"||((zt=s.fields.find(Be=>Be.name===Xe))==null?void 0:zt.required)===!0,St=Xe==="pullRequestUrl"?E:u[Xe],on=RO(Xe,St,mt);m(Be=>({...Be,[Xe]:on}))},rt=async Xe=>{var on;if(Xe.preventDefault(),a)return;const mt={};for(const zt of s.fields){const Be=RO(zt.name,u[zt.name],zt.required);Be&&(mt[zt.name]=Be)}if(!a){const zt=RO("token",u.token,!0);zt&&(mt.token=zt)}if(m(mt),Object.keys(mt).length)return;(on=de.current)==null||on.abort();const St=new AbortController;de.current=St,y(!0),b(""),C(null);try{const zt=await s.submit(u,{cloudProvider:t},St.signal);if(de.current!==St)return;C(zt),d(Be=>({...Be,token:""}))}catch(zt){if(St.signal.aborted||de.current!==St)return;b(zt instanceof Error?zt.message:String(zt))}finally{de.current===St&&(de.current=null,y(!1))}},qt=Xe=>{Xe.key==="Enter"&&(Xe.nativeEvent.isComposing||Xe.nativeEvent.keyCode===229)&&Xe.preventDefault()},cn=async()=>{var on;const Xe={},mt=RO("pullRequestUrl",E,!0);if(mt&&(Xe.pullRequestUrl=mt),!mt){const zt=ioe(E),Be=K.find(at=>at.fullName.toLowerCase()===zt.toLowerCase());Be?Be.reviewEnabled||(Xe.pullRequestUrl=`请先在下方开启 ${Be.fullName} 的评审`):Xe.pullRequestUrl="PR URL 所属仓库尚未安装 GitHub App"}if(m(Xe),Object.keys(Xe).length)return;(on=ve.current)==null||on.abort();const St=new AbortController;ve.current=St,D(!0),N(""),j(null);try{const zt=await xGt({pullRequestUrl:E.trim()},St.signal);if(ve.current!==St)return;j(zt),d(Be=>({...Be,token:""})),sn(),i==null||i(zt.sessionId)}catch(zt){if(St.signal.aborted||ve.current!==St)return;N(zt instanceof Error?zt.message:String(zt))}finally{ve.current===St&&(ve.current=null,D(!1))}},un=Xe=>{const{name:mt,placeholder:St,required:on}=Xe,zt=mt==="repository",Be=`cards.${e}.fields.${mt}`;return o.jsxs("div",{className:"github-field",children:[o.jsxs("div",{className:"github-field-label-row",children:[o.jsxs("label",{htmlFor:`github-${mt}`,children:[o.jsx("span",{children:r(`${Be}.label`)}),o.jsx("span",{className:`github-field-requirement${on?" is-required":""}`,children:r(on?"github.required":"github.optional")})]}),zt?o.jsxs("a",{className:"github-field-action",href:"https://github.com/",target:"_blank",rel:"noreferrer",children:["https://github.com/",o.jsx(db,{})]}):null]}),o.jsx("input",{id:`github-${mt}`,value:u[mt],onChange:at=>ot(mt,at.target.value),onBlur:()=>kt(mt),placeholder:r(`${Be}.placeholder`,{defaultValue:St}),required:on,"aria-invalid":!!h[mt],"aria-describedby":`github-${mt}-help${h[mt]?` github-${mt}-error`:""}`}),o.jsx("span",{id:`github-${mt}-help`,className:"github-field-help",children:zt&&Nt?a?r("github.repositoryReviewHelp",{repository:Nt}):r("github.repositoryConfigHelp",{repository:Nt}):r(`${Be}.help`)}),h[mt]?o.jsx("span",{id:`github-${mt}-error`,className:"github-field-error",role:"alert",children:r(h[mt])}):null]},mt)};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(zXt,{})}),o.jsx(hq,{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:rt,onKeyDown:qt,noValidate:!0,children:[a?null:o.jsxs("div",{className:"github-field-grid",children:[s.fields.map(un),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:Xe=>{Xe.key==="Escape"&&S(!1)},children:[o.jsxs("button",{type:"button",className:"pp-region-trigger","aria-labelledby":"github-region-label","aria-haspopup":"listbox","aria-expanded":O,onClick:()=>S(Xe=>!Xe),children:[o.jsx("span",{children:(f==null?void 0:f.label)??u.region}),o.jsx(HXt,{className:`pp-region-chevron${O?" is-open":""}`})]}),O?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>S(!1)}),o.jsx("div",{className:"pp-region-menu",role:"listbox","aria-label":r("github.region"),children:l.map(Xe=>{const mt=Xe.value===u.region;return o.jsxs("button",{type:"button",role:"option","aria-selected":mt,className:`pp-region-option${mt?" is-selected":""}`,onClick:()=>{ot("region",Xe.value),S(!1)},children:[o.jsx("span",{children:Xe.label}),mt?o.jsx(qXt,{}):null]},Xe.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${M!=null&&M.configured?" is-ready":""}`,children:[o.jsxs("div",{children:[o.jsx("strong",{children:"GitHub App 授权"}),o.jsx("span",{children:I?"正在检查中心服务配置...":M!=null&&M.configured?`安装 ${Ot} 到目标仓库后,可在下方开启自动评审。`:L||(M==null?void 0:M.reason)||"管理员未配置 GitHub App。"})]}),o.jsxs("a",{className:"github-app-install-link",href:Tt,target:"_blank",rel:"noreferrer",children:["安装 GitHub App",o.jsx(db,{})]})]}),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:()=>Ct(),disabled:!(M!=null&&M.configured)||q,children:q?"刷新中...":"刷新"})]}),X?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:X}):null,(Q==null?void 0:Q.reviewSettingsConfigured)===!1&&!X?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:Q.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法保存启用评审设置。"}):null,o.jsxs("div",{className:"github-app-repository-search",children:[o.jsx("input",{type:"search",value:te,onChange:Xe=>ue(Xe.target.value),onKeyDown:Xe=>{Xe.key==="Enter"&&(Xe.preventDefault(),We())},placeholder:"搜索 owner 或仓库名","aria-label":"搜索已安装仓库"}),o.jsx("button",{type:"button",onClick:We,disabled:!(M!=null&&M.configured)||q,children:"搜索"}),Ce?o.jsx("button",{type:"button",onClick:Le,disabled:q,children:"清除"}):null]}),q&&K.length===0?o.jsx("div",{className:"github-app-repository-empty",children:"正在读取 GitHub App 安装仓库..."}):null,!q&&K.length===0&&!X?o.jsx("div",{className:"github-app-repository-empty",children:Ce?`没有匹配 “${Ce}” 的已安装仓库。`:"GitHub App 尚未安装到任何仓库。"}):null,K.length>0?o.jsx("div",{className:"github-app-repository-list",children:K.map(Xe=>{const mt=he===Xe.fullName,St=(Q==null?void 0:Q.reviewSettingsConfigured)!==!0||!!he;return o.jsxs("div",{className:"github-app-repository-row",children:[o.jsxs("div",{className:"github-app-repository-main",children:[o.jsxs("a",{href:Xe.htmlUrl,target:"_blank",rel:"noreferrer",title:Xe.fullName,children:[Xe.fullName,o.jsx(db,{})]}),o.jsxs("span",{children:[Xe.private?"Private":"Public"," · Installation ",Xe.installationId]})]}),o.jsx("button",{type:"button",className:`github-review-switch${Xe.reviewEnabled?" is-on":""}`,role:"switch","aria-checked":Xe.reviewEnabled,disabled:St,onClick:()=>{pt(Xe)},children:o.jsx("span",{children:mt?"保存中":Xe.reviewEnabled?"已启用":"未启用"})})]},Xe.fullName)})}):null,bt?o.jsxs("div",{className:"github-list-pagination","aria-label":"已安装仓库分页",children:[o.jsx("span",{children:loe(ce,ZA,K.length,Y)}),o.jsxs("div",{children:[o.jsx("button",{type:"button",onClick:()=>Ge("repositories",ce-1),disabled:ce<=1||q,children:"上一页"}),o.jsx("button",{type:"button",onClick:()=>Ge("repositories",ce+1),disabled:!Y||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(db,{})]})]}),o.jsxs("div",{className:"github-token-input",children:[o.jsx("input",{id:"github-token",type:w?"text":"password",value:u.token,onChange:Xe=>ot("token",Xe.target.value),onBlur:()=>kt("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:()=>x(Xe=>!Xe),"aria-label":r(w?"github.hideToken":"github.showToken"),title:r(w?"github.hideToken":"github.showToken"),children:o.jsx(VXt,{hidden:w})})]}),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,k?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:k.number})}),o.jsx("span",{children:r("github.configPrNextStep")})]}),o.jsxs("a",{className:"github-result-link",href:k.url,target:"_blank",rel:"noreferrer",children:[r("github.viewConfigPr"),o.jsx(db,{})]})]}):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")}),vt?o.jsxs("a",{className:"github-secrets-link",href:vt,target:"_blank",rel:"noreferrer",children:[r("github.openSecrets"),o.jsx(db,{})]}):null]}),o.jsx("span",{className:"github-secrets-path",children:r("github.secretsPath")}),o.jsx("ul",{children:c.map(Xe=>{const[mt,...St]=Xe.split(":");return o.jsxs("li",{children:[o.jsx("code",{children:mt}),St.length?o.jsx("span",{children:St.join(":")}):null]},Xe)})})]}),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:E,onChange:Xe=>{R(Xe.target.value),h.pullRequestUrl&&m(mt=>({...mt,pullRequestUrl:""}))},onBlur:()=>m(Xe=>({...Xe,pullRequestUrl:RO("pullRequestUrl",E,!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&&ft?o.jsx("span",{className:"github-field-help",children:Me!=null&&Me.reviewEnabled?`将使用 GitHub App 评审 ${Me.fullName}`:Me?`请先在下方开启 ${Me.fullName} 的评审`:`PR URL 所属仓库 ${ft} 尚未安装 GitHub App`}):null,!h.pullRequestUrl&&!ft&>.length>0?o.jsxs("span",{className:"github-field-help",children:["已启用仓库:",gt.map(Xe=>Xe.fullName).join("、")]}):null]}),T?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:T}):null,A?o.jsx("div",{className:"github-submit-message is-success",role:"status",children:o.jsxs("span",{children:["已发起评审,Session ",A.sessionId," 正在运行。"]})}):null,o.jsx("div",{className:"github-review-section-actions",children:o.jsx("button",{type:"button",onClick:cn,disabled:_,children:_?"发起评审中…":"立即发起评审"})})]})]}),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:()=>sn(),disabled:!(M!=null&&M.configured)||ye,children:ye?"刷新中...":"刷新"})]}),we?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:we}):null,(ie==null?void 0:ie.reviewSettingsConfigured)===!1&&!we?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:ie.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法读取评审记录。"}):null,ye&&Ae.length===0?o.jsx("div",{className:"github-app-repository-empty",children:"正在读取 PR 评审记录..."}):null,!ye&&Ae.length===0&&!we?o.jsx("div",{className:"github-app-repository-empty",children:"暂无 PR 评审记录。"}):null,Ae.length>0?o.jsx("div",{className:"github-review-record-list",children:Ae.map(Xe=>{const mt=XXt(Xe),St=Xe.status==="completed"?"":Xe.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:Xe.pullRequestUrl,target:"_blank",rel:"noreferrer",children:[Xe.repository,"#",Xe.pullRequestNumber,o.jsx(db,{})]}),o.jsx("span",{className:`github-review-record-status is-${Xe.status}`,children:KXt(Xe.status)})]}),o.jsxs("span",{children:[GXt(Xe.trigger),Xe.action?` · ${Xe.action}`:""," · ",YXt(Xe.createdAt),mt?` · ${mt}`:""]})]}),o.jsx("div",{className:"github-review-record-actions",children:St&&i?o.jsx("button",{type:"button",onClick:()=>i(St),children:"打开 Session"}):null})]},Xe.id)})}):null,jt?o.jsxs("div",{className:"github-list-pagination","aria-label":"评审记录分页",children:[o.jsx("span",{children:loe(Se,ZA,Ae.length,qe)}),o.jsxs("div",{children:[o.jsx("button",{type:"button",onClick:()=>Ge("records",Se-1),disabled:Se<=1||ye,children:"上一页"}),o.jsx("button",{type:"button",onClick:()=>Ge("records",Se+1),disabled:!qe||ye,children:"下一页"})]})]}):null]})]}):null]})})]})}async function d0(e){var i;const t=await e.json().catch(()=>null),n=(i=t==null?void 0:t.detail)==null?void 0:i.message;return new Error(n||`GitLab MR 评审请求失败(HTTP ${e.status})。`)}function coe(e,t){const n=e.trim().replace(/\/+$/,"");if(!n)return"";const i=`${n}/`,r=t.trim();if(!r.startsWith(i))return"";const s=r.slice(i.length).replace(/\/+$/,""),a="/-/merge_requests/",l=s.indexOf(a);if(l<=0)return"";const c=s.slice(l+a.length);return/^[1-9][0-9]*$/.test(c)?s.slice(0,l):""}async function uoe(e){const t=await pn("/web/gitlab/app/config",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await d0(t);const n=await t.json();if(typeof n.configured!="boolean"||typeof n.baseUrl!="string"||typeof n.webhookUrl!="string"||typeof n.reason!="string"||typeof n.oauthConfigured!="boolean"||typeof n.oauthConnected!="boolean"||n.oauthUser!==null&&n.oauthUser!==void 0&&(typeof n.oauthUser!="object"||typeof n.oauthUser.credentialId!="string"||typeof n.oauthUser.ownerId!="string"||typeof n.oauthUser.baseUrl!="string"||typeof n.oauthUser.gitlabUserId!="number"||typeof n.oauthUser.gitlabUsername!="string"||typeof n.oauthUser.gitlabName!="string"||typeof n.oauthUser.expiresAt!="number"))throw new Error("GitLab 集成配置响应格式无效。");return n}async function JXt(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 pn(`/web/gitlab/app/projects?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await d0(i);const r=await i.json();if(!Array.isArray(r.projects)||typeof r.page!="number"||typeof r.pageSize!="number"||typeof r.hasNextPage!="boolean"||typeof r.reviewSettingsConfigured!="boolean"||typeof r.reviewSettingsReason!="string"||r.projects.some(a=>typeof a!="object"||a===null||typeof a.instanceId!="string"||typeof a.baseUrl!="string"||typeof a.projectId!="number"||typeof a.pathWithNamespace!="string"||typeof a.name!="string"||typeof a.namespace!="string"||typeof a.webUrl!="string"||typeof a.private!="boolean"||typeof a.reviewEnabled!="boolean"||typeof a.permissionsNote!="string"||typeof a.accessLevel!="number"||typeof a.canManageWebhooks!="boolean"||typeof a.reviewBindingStatus!="string"||typeof a.reviewBindingReason!="string"||typeof a.reviewCredentialOwner!="string"||typeof a.reviewCredentialType!="string"))throw new Error("GitLab 集成项目列表响应格式无效。");return r}async function eYt(e,t){const n=await pn("/web/gitlab/app/review-projects",{method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await d0(n);const i=await n.json();if(!Array.isArray(i.projects)||i.projects.some(r=>typeof r!="object"||r===null||typeof r.projectId!="number"))throw new Error("GitLab 集成评审项目保存响应格式无效。");return i.projects}async function tYt(e){const t=await pn("/web/gitlab/oauth/disconnect",{method:"POST",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await d0(t)}async function nYt(e){const t=await pn("/web/gitlab/oauth/start-url",{method:"GET",headers:{Accept:"application/json"},signal:e});if(!t.ok)throw await d0(t);const n=await t.json();if(typeof n.authorizationUrl!="string"||!n.authorizationUrl)throw new Error("GitLab OAuth 授权地址响应格式无效。");return n.authorizationUrl}async function iYt(e,t){const n=new URLSearchParams({page:String(t.page),pageSize:String(t.pageSize)}),i=await pn(`/web/gitlab/app/review-records?${n.toString()}`,{method:"GET",headers:{Accept:"application/json"},signal:e});if(!i.ok)throw await d0(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.projectId!="number"||typeof s.pathWithNamespace!="string"||typeof s.mergeRequestUrl!="string"||typeof s.mergeRequestIid!="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("GitLab MR 评审记录响应格式无效。");return r}async function rYt(e,t){const n=await pn("/web/gitlab/merge-request-reviews",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e),signal:t});if(!n.ok)throw await d0(n);const i=await n.json();if(i.status!=="started"||typeof i.sessionId!="string"||!i.sessionId||typeof i.displayName!="string")throw new Error("GitLab MR 评审服务返回了无效结果。");return i}const JA=10;function e_(){return o.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[o.jsx("path",{d:"M6.5 4H4a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1V9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),o.jsx("path",{d:"M9 3h4v4M8.5 7.5 13 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function sYt(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 oYt(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...e,children:o.jsx("path",{d:"m22.54 9.64-.03-.08-2.2-6.81a.76.76 0 0 0-1.43-.08l-2.1 4.31H7.22l-2.1-4.31a.76.76 0 0 0-1.43.08l-2.2 6.81-.03.08a5.15 5.15 0 0 0 1.7 5.79l.01.01.02.01 8.81 6.58 8.81-6.58.02-.01.01-.01a5.15 5.15 0 0 0 1.7-5.79ZM12 20.08 8.65 8.59h6.7L12 20.08Z"})})}function aYt(e){return e==="started"?"进行中":e==="completed"?"已完成":e==="ignored"?"已忽略":"失败"}function lYt(e){return e==="webhook"?"自动触发":"手动发起"}function cYt(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function uYt(e){return e.reason==="project-review-disabled"?"项目未启用":e.reason==="merge-request-not-reviewable"?"MR 不满足评审条件":e.reason}function doe(e,t,n,i){const r=(e-1)*t+1,s=(e-1)*t+n;return i?`${r}-${s}`:`${r}-${s} / ${s}`}function dYt({onBack:e,onOpenSandboxSession:t}){const[n,i]=p.useState(null),[r,s]=p.useState(""),[a,l]=p.useState(!0),[c,u]=p.useState([]),[d,f]=p.useState(!0),[h,m]=p.useState(""),[g,b]=p.useState(null),[v,y]=p.useState(1),[w,x]=p.useState(!1),[O,S]=p.useState(""),[k,C]=p.useState(""),[E,R]=p.useState(null),[A,j]=p.useState(""),[T,N]=p.useState(!1),[_,D]=p.useState(""),[M,P]=p.useState(null),[L,B]=p.useState([]),[I,z]=p.useState(!0),[K,F]=p.useState(""),[q,H]=p.useState(1),[X,ne]=p.useState(!1),[Q,Z]=p.useState(null),[ce,Ee]=p.useState(!1),[Y,G]=p.useState(!1),te=p.useRef(null),ue=p.useRef(null),Ce=p.useRef(null),se=n?coe(n.baseUrl,A):"",he=se?c.find(ke=>ke.pathWithNamespace.toLowerCase()===se.toLowerCase()):void 0,ae=v>1||w,Ae=q>1||X,De=(n==null?void 0:n.configured)===!0&&n.oauthConnected,ye=(ke=v,qe=k)=>{var de;(de=ue.current)==null||de.abort();const it=new AbortController;ue.current=it,f(!0),m(""),JXt(it.signal,{page:ke,pageSize:JA,query:qe}).then(ve=>{if(ue.current===it){if(ve.projects.length===0&&ve.page>1){y(ve.page-1),ye(ve.page-1,qe);return}u(ve.projects),y(ve.page),x(ve.hasNextPage),b({reviewSettingsConfigured:ve.reviewSettingsConfigured,reviewSettingsReason:ve.reviewSettingsReason})}}).catch(ve=>{it.signal.aborted||ue.current!==it||m(ve instanceof Error?ve.message:String(ve))}).finally(()=>{ue.current===it&&(ue.current=null,f(!1))})},Qe=(ke=q)=>{var it;(it=Ce.current)==null||it.abort();const qe=new AbortController;Ce.current=qe,z(!0),F(""),iYt(qe.signal,{page:ke,pageSize:JA}).then(de=>{if(Ce.current===qe){if(de.records.length===0&&de.page>1){H(de.page-1),Qe(de.page-1);return}B(de.records),H(de.page),ne(de.hasNextPage),Z({reviewSettingsConfigured:de.reviewSettingsConfigured,reviewSettingsReason:de.reviewSettingsReason})}}).catch(de=>{qe.signal.aborted||Ce.current!==qe||F(de instanceof Error?de.message:String(de))}).finally(()=>{Ce.current===qe&&(Ce.current=null,z(!1))})};p.useEffect(()=>{var qe;(qe=te.current)==null||qe.abort();const ke=new AbortController;return te.current=ke,l(!0),s(""),uoe(ke.signal).then(it=>{te.current===ke&&(i(it),(!it.configured||it.oauthConfigured&&!it.oauthConnected)&&(f(!1),z(!1)))}).catch(it=>{ke.signal.aborted||te.current!==ke||(s(it instanceof Error?it.message:String(it)),f(!1),z(!1))}).finally(()=>{te.current===ke&&(te.current=null,l(!1))}),()=>{var it,de;ke.abort(),(it=ue.current)==null||it.abort(),(de=Ce.current)==null||de.abort()}},[]),p.useEffect(()=>{De&&(ye(1,""),Qe(1))},[De]);const we=()=>{const ke=O.trim();C(ke),y(1),ye(1,ke)},Ne=async ke=>{if((g==null?void 0:g.reviewSettingsConfigured)!==!0||E!==null)return;if(!ke.reviewEnabled&&!De){m("请先连接 GitLab 后再启用自动评审。");return}const qe=new AbortController;R(ke.projectId),m("");try{await eYt({projectId:ke.projectId,reviewEnabled:!ke.reviewEnabled},qe.signal),u(it=>it.map(de=>de.projectId===ke.projectId?{...de,reviewEnabled:!ke.reviewEnabled}:de))}catch(it){m(it instanceof Error?it.message:String(it))}finally{R(null)}},ie=async()=>{const ke=new AbortController;G(!0),s("");try{await tYt(ke.signal);const qe=await uoe(ke.signal);i(qe),u([]),b(null)}catch(qe){s(qe instanceof Error?qe.message:String(qe))}finally{G(!1)}},fe=async()=>{const ke=new AbortController;Ee(!0),s("");try{window.location.href=await nYt(ke.signal)}catch(qe){s(qe instanceof Error?qe.message:String(qe)),Ee(!1)}},Se=async()=>{const ke=A.trim();if(!ke){D("请输入 GitLab Merge Request URL。");return}if(!(n!=null&&n.configured)){D("管理员未配置 GitLab OAuth。");return}if(!De){D("请先连接 GitLab 后再发起评审。");return}if(!coe(n.baseUrl,ke)){D("请输入当前 GitLab 实例下的完整 Merge Request URL。");return}N(!0),D(""),P(null);const qe=new AbortController;try{const it=await rYt({mergeRequestUrl:ke},qe.signal);P(it),Qe(1)}catch(it){D(it instanceof Error?it.message:String(it))}finally{N(!1)}};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:e,"aria-label":"返回自动化",children:o.jsx(sYt,{})}),o.jsx(oYt,{className:"github-integration-logo"}),o.jsxs("div",{children:[o.jsx("h1",{children:"GitLab MR Review"}),o.jsx("p",{children:"通过 GitLab webhook 触发 Sandbox 评审,并将结果写回 Merge Request。"})]})]}),o.jsx("div",{className:"github-integration-layout",children:o.jsxs("section",{className:"github-section-panel",children:[o.jsx("div",{className:"github-panel-heading",children:o.jsx("p",{children:"请先为目标项目开启自动评审,再通过 webhook 或手动 URL 发起 MR 评审。"})}),o.jsxs("div",{className:"github-release-form",children:[o.jsxs("div",{className:`github-app-card${n!=null&&n.configured?" is-ready":""}`,children:[o.jsxs("div",{children:[o.jsx("strong",{children:"GitLab 集成配置"}),o.jsx("span",{children:a?"正在检查中心服务配置...":n!=null&&n.configured?n.oauthConnected&&n.oauthUser?`已连接 ${n.oauthUser.gitlabName||n.oauthUser.gitlabUsername} · ${n.baseUrl}`:`当前实例:${n.baseUrl}`:r||(n==null?void 0:n.reason)||"管理员未配置 GitLab OAuth。"})]}),n!=null&&n.oauthConfigured&&!n.oauthConnected?o.jsxs("button",{type:"button",className:"github-app-install-link",onClick:()=>{fe()},disabled:ce,children:[ce?"连接中...":"连接 GitLab",o.jsx(e_,{})]}):n!=null&&n.oauthConnected?o.jsx("button",{type:"button",className:"github-app-install-link",onClick:()=>{ie()},disabled:Y,children:Y?"断开中...":"断开授权"}):n!=null&&n.webhookUrl?o.jsxs("a",{className:"github-app-install-link",href:n.webhookUrl,target:"_blank",rel:"noreferrer",children:["Webhook",o.jsx(e_,{})]}):null]}),o.jsxs("section",{className:"github-review-section github-app-repositories","aria-labelledby":"gitlab-projects-title",children:[o.jsxs("div",{className:"github-review-section-header",children:[o.jsxs("div",{children:[o.jsx("h2",{id:"gitlab-projects-title",children:"可访问项目"}),o.jsx("p",{children:"只有开启评审的项目会响应 GitLab webhook 自动触发。"})]}),o.jsx("button",{type:"button",onClick:()=>ye(),disabled:!De||d,children:d?"刷新中...":"刷新"})]}),h?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:h}):null,(g==null?void 0:g.reviewSettingsConfigured)===!1&&!h?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:g.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法保存启用评审设置。"}):null,o.jsxs("div",{className:"github-app-repository-search",children:[o.jsx("input",{type:"search",value:O,onChange:ke=>S(ke.target.value),onKeyDown:ke=>{ke.key==="Enter"&&(ke.preventDefault(),we())},placeholder:"搜索 group 或项目名","aria-label":"搜索 GitLab 项目"}),o.jsx("button",{type:"button",onClick:we,disabled:!De||d,children:"搜索"}),k?o.jsx("button",{type:"button",onClick:()=>{S(""),C(""),y(1),ye(1,"")},disabled:d||!De,children:"清除"}):null]}),!De&&!a?o.jsx("div",{className:"github-app-repository-empty",children:"请先连接 GitLab。"}):null,d&&c.length===0&&De?o.jsx("div",{className:"github-app-repository-empty",children:"正在读取 GitLab 项目..."}):null,!d&&c.length===0&&!h&&De?o.jsx("div",{className:"github-app-repository-empty",children:k?`没有匹配 “${k}” 的 GitLab 项目。`:"GitLab 集成暂无可访问项目。"}):null,c.length>0?o.jsx("div",{className:"github-app-repository-list",children:c.map(ke=>{const qe=E===ke.projectId,it=(g==null?void 0:g.reviewSettingsConfigured)!==!0||E!==null||!ke.reviewEnabled&&!De;return o.jsxs("div",{className:"github-app-repository-row",children:[o.jsxs("div",{className:"github-app-repository-main",children:[o.jsxs("a",{href:ke.webUrl,target:"_blank",rel:"noreferrer",title:ke.pathWithNamespace,children:[ke.pathWithNamespace,o.jsx(e_,{})]}),o.jsxs("span",{children:[ke.private?"Private":"Public"," · Project ",ke.projectId,ke.permissionsNote?` · ${ke.permissionsNote}`:"",ke.reviewBindingStatus&&ke.reviewBindingStatus!=="active"&&ke.reviewBindingStatus!=="disabled"?` · ${ke.reviewBindingReason||"授权失效"}`:""]})]}),o.jsx("button",{type:"button",className:`github-review-switch${ke.reviewEnabled?" is-on":""}`,role:"switch","aria-checked":ke.reviewEnabled,disabled:it,onClick:()=>{Ne(ke)},children:o.jsx("span",{children:qe?"保存中":ke.reviewEnabled?"已启用":"未启用"})})]},`${ke.instanceId}:${ke.projectId}`)})}):null,ae?o.jsxs("div",{className:"github-list-pagination","aria-label":"GitLab 项目分页",children:[o.jsx("span",{children:doe(v,JA,c.length,w)}),o.jsxs("div",{children:[o.jsx("button",{type:"button",onClick:()=>{y(v-1),ye(v-1,k)},disabled:v<=1||d,children:"上一页"}),o.jsx("button",{type:"button",onClick:()=>{y(v+1),ye(v+1,k)},disabled:!w||d,children:"下一页"})]})]}):null]})]}),o.jsxs("div",{className:"github-pr-review-sections",children:[o.jsxs("section",{className:"github-review-section github-review-now","aria-labelledby":"gitlab-review-now-title",children:[o.jsx("div",{className:"github-review-section-header",children:o.jsxs("div",{children:[o.jsx("h2",{id:"gitlab-review-now-title",children:"立刻评审"}),o.jsx("p",{children:"输入当前 GitLab 实例下的 MR URL,立即创建 Sandbox 评审任务。"})]})}),o.jsxs("div",{className:"github-review-section-body",children:[o.jsxs("div",{className:"github-field",children:[o.jsx("input",{"aria-label":"Merge Request URL",value:A,onChange:ke=>j(ke.target.value),placeholder:`${(n==null?void 0:n.baseUrl)||"https://gitlab.example.com"}/group/project/-/merge_requests/123`}),se?o.jsx("span",{className:"github-field-help",children:he?`将使用 GitLab 授权评审 ${he.pathWithNamespace}`:`MR URL 所属项目 ${se} 不在当前项目列表中`}):null]}),_?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:_}):null,M?o.jsx("div",{className:"github-submit-message is-success",role:"status",children:o.jsxs("span",{children:["已发起评审,Session ",M.sessionId," 正在运行。"]})}):null,o.jsx("div",{className:"github-review-section-actions",children:o.jsx("button",{type:"button",onClick:Se,disabled:T||!De,children:T?"发起评审中...":"立即发起评审"})})]})]}),o.jsxs("section",{className:"github-review-section github-review-records","aria-labelledby":"gitlab-review-records-title",children:[o.jsxs("div",{className:"github-review-section-header",children:[o.jsxs("div",{children:[o.jsx("h2",{id:"gitlab-review-records-title",children:"评审记录"}),o.jsx("p",{children:"展示最近自动触发和手动发起的评审任务。"})]}),o.jsx("button",{type:"button",onClick:()=>Qe(),disabled:!De||I,children:I?"刷新中...":"刷新"})]}),K?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:K}):null,(Q==null?void 0:Q.reviewSettingsConfigured)===!1&&!K?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:Q.reviewSettingsReason||"管理员未配置 Studio 持久化存储,无法读取评审记录。"}):null,I&&L.length===0?o.jsx("div",{className:"github-app-repository-empty",children:"正在读取 MR 评审记录..."}):null,!I&&L.length===0&&!K?o.jsx("div",{className:"github-app-repository-empty",children:"暂无 MR 评审记录。"}):null,L.length>0?o.jsx("div",{className:"github-review-record-list",children:L.map(ke=>{const qe=uYt(ke),it=ke.status==="completed"?"":ke.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:ke.mergeRequestUrl,target:"_blank",rel:"noreferrer",children:[ke.pathWithNamespace,"!",ke.mergeRequestIid,o.jsx(e_,{})]}),o.jsx("span",{className:`github-review-record-status is-${ke.status}`,children:aYt(ke.status)})]}),o.jsxs("span",{children:[lYt(ke.trigger),ke.action?` · ${ke.action}`:""," · ",cYt(ke.createdAt),qe?` · ${qe}`:""]})]}),o.jsx("div",{className:"github-review-record-actions",children:it&&t?o.jsx("button",{type:"button",onClick:()=>t(it),children:"打开 Session"}):null})]},ke.id)})}):null,Ae?o.jsxs("div",{className:"github-list-pagination","aria-label":"GitLab 评审记录分页",children:[o.jsx("span",{children:doe(q,JA,L.length,X)}),o.jsxs("div",{children:[o.jsx("button",{type:"button",onClick:()=>{H(q-1),Qe(q-1)},disabled:q<=1||I,children:"上一页"}),o.jsx("button",{type:"button",onClick:()=>{H(q+1),Qe(q+1)},disabled:!X||I,children:"下一页"})]})]}):null]})]})]})})]})}const fYt=1050062,foe="1.0",hYt="https://lf-static.applogcdn.com/obj/applog-sdk-static/log-sdk/collect/5/collect.js";class pYt{constructor(){Jt(this,"enabled",!1);Jt(this,"initialized",!1);Jt(this,"pending",[]);Jt(this,"userUniqueId","");Jt(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:fYt,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=hYt,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 mYt=256,YFe=1024,j4="[REDACTED]";function gYt(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 fh(e,t){return t===void 0?{errorKind:e}:{errorKind:e,errorCode:t}}function ZFe(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 bYt(e){return e.replace(/\b(Authorization\s*[:=]\s*)(Bearer\s+)?[^\s"',;&]+/gi,(t,n,i)=>`${n}${i??""}${j4}`).replace(/\bBearer\s+[A-Za-z0-9._~+/=-]+/gi,`Bearer ${j4}`).replace(/\b([\w.-]*(?:token|password|passwd|secret|api[_-]?key|access[_-]?key|secret[_-]?key|cookie)[\w.-]*\s*[:=]\s*)(["']?)[^\s"',;&]+/gi,(t,n,i)=>`${n}${i}${j4}`)}function qb(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 ZFe(bYt(r),YFe,t)}function Ia(e,t={}){const n=e!==null&&typeof e=="object"?e:{},i=gYt(n.code),r=typeof n.name=="string"?n.name:"";if(r==="RuntimeProbeError")return fh("runtime_probe_error",i);if(r==="AbortError")return fh("abort",i);if(r==="RuntimeAccessDeniedError"||r==="AuthError")return fh("auth",i);if(t.phase==="build")return fh("build_failed",i);if(r==="TimeoutError")return fh("timeout",i);if(r==="NetworkError"||r==="TypeError")return fh("network",i);if(r==="ValidationError")return fh("validation",i);if(r==="ServerError")return fh("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 fh("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 yYt=["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"],vYt={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 xYt(e){return typeof e=="string"||typeof e=="number"&&Number.isFinite(e)}function hoe(e,t){const n=new Set([...yYt,...vYt[e]]),i={};for(const[r,s]of Object.entries(t))!n.has(r)||!xYt(s)||(typeof s=="string"?i[r]=ZFe(s,r==="error_message"?YFe:mYt):i[r]=s);return i}function wYt(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}function OYt(){return typeof performance<"u"?performance.now():Date.now()}function Y0(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}class kYt{constructor(t){Jt(this,"sink");Jt(this,"createId");Jt(this,"now");Jt(this,"pageInstanceId");Jt(this,"context");Jt(this,"identity");Jt(this,"entryViewed",!1);Jt(this,"sessionStarted",!1);this.sink=t.sink,this.createId=t.createId??wYt,this.now=t.now??OYt,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=hoe("studio_entry_viewed",Y0({schema_version:foe,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=>Y0({runtime_region:n.runtimeRegion,runtime_is_mine:n.runtimeIsMine,sandbox_status:n.sandboxStatus}),n=>Y0({error_kind:n.errorKind,error_code:n.errorCode}))}beginAgentMessage(t){return this.beginOperation("studio_agent_message",Y0({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=>Y0({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=hoe(t,Y0({schema_version:foe,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 JFe=new pYt,Zf=new kYt({sink:JFe});function SYt(e){return JFe.init(e)}function EYt(e){Zf.setContext(e)}function CYt(e){Zf.identify(e)}function TYt(e){Zf.trackStudioEntryViewed(e)}function AYt(e){Zf.trackStudioSessionStarted(e)}function e8e(e){return Zf.beginAgentDeploy(e)}function _Yt(e){return Zf.beginSandboxCreate(e)}function jYt(e){return Zf.beginAgentDebug(e)}function t_(e){return Zf.beginAgentConnect(e)}function poe(e){return Zf.beginAgentMessage(e)}function t8e(e){return Zf.beginAgentSourceDownload(e)}const NYt=/^[A-Za-z_][A-Za-z0-9_]*$/;function AT(e,t=n=>Wt(`validation.agentName.${n}`)){return e.trim().length===0?t("required"):e==="user"?t("reserved"):NYt.test(e)?null:t("characters")}function RYt(e){const t=new Set,n=new Set,i=r=>{AT(r.name)===null&&(t.has(r.name)?n.add(r.name):t.add(r.name)),r.subAgents.forEach(i)};return i(e),n}function IYt(e){return{...ru(),name:e,description:Qf("feishu.generatedAgent.description"),instruction:Qf("feishu.generatedAgent.instruction"),deployment:{feishuEnabled:!0}}}async function PYt(e){const t=IYt(e.agentName),n=await Vk(t);return Wy(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 af=["cn-beijing","cn-shanghai"],n8e=["prepare","build","deploy","publish"];function DYt(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 MYt(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 moe(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 LYt(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 $Yt(e){if(!e||e==="upload")return 0;const t=n8e.findIndex(n=>n===e);return t<0?0:t}function N4(e){switch(e){case"prepare":case"upload":case"build":case"deploy":case"publish":case"update":case"evaluation":return e;default:return"unknown"}}function goe(e){const t=AT(e,n=>n);return t?`feishu.validation.agentName.${t}`:""}function FYt({onBack:e}){const{t}=je("automations"),[n,i]=p.useState("feishu_assistant"),[r,s]=p.useState(""),[a,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState("cn-beijing"),[h,m]=p.useState(!1),[g,b]=p.useState(""),[v,y]=p.useState(""),[w,x]=p.useState(""),[O,S]=p.useState("idle"),[k,C]=p.useState(null),[E,R]=p.useState(""),[A,j]=p.useState(null),T=p.useRef(null),N=p.useRef(null),_=p.useRef([]),D=p.useRef(0),M=p.useRef(null),P=p.useRef(null),L=p.useRef("prepare"),B=p.useRef(!1),I=p.useRef(!0),z=["preparing","running","cancelling"].includes(O);p.useEffect(()=>(I.current=!0,()=>{I.current=!1}),[]),p.useEffect(()=>{var Ee;if(!h)return;(Ee=_.current[D.current])==null||Ee.focus();const Z=Y=>{Y.target instanceof Node&&T.current&&!T.current.contains(Y.target)&&m(!1)},ce=Y=>{var G;Y.key==="Escape"&&(m(!1),(G=N.current)==null||G.focus())};return window.addEventListener("pointerdown",Z),window.addEventListener("keydown",ce),()=>{window.removeEventListener("pointerdown",Z),window.removeEventListener("keydown",ce)}},[h]);const K=Z=>{Z.key==="Enter"&&(Z.nativeEvent.isComposing||Z.nativeEvent.keyCode===229)&&Z.preventDefault()},F=()=>{const Z=goe(n.trim()),ce=r.trim()?"":"feishu.validation.appId",Ee=a.trim()?"":"feishu.validation.appSecret";return b(Z),y(ce),x(Ee),!Z&&!ce&&!Ee},q=async Z=>{if(Z.preventDefault(),!F()||z)return;const ce=crypto.randomUUID();M.current=ce,L.current="prepare",B.current=!1,S("preparing"),C(null),R(""),j(null);const Ee=e8e({agentId:String(n.trim()),deployAction:"create",deploySource:"feishu_automation",createMode:"feishu_template",aiAssisted:0,deployRegion:String(d),runtimeNetworkType:"public",feishuEnabled:1});P.current=Ee;try{const Y=await PYt({agentName:n.trim(),appId:r.trim(),appSecret:a.trim(),region:d,taskId:ce,onStage:G=>{L.current=G.phase||"deploy",!(!I.current||B.current)&&(S("running"),C(G))}});if(B.current){Ee.fail({failedPhase:N4(L.current),errorKind:"abort",errorMessage:qb("User cancelled deployment")});return}if(Ee.succeed({runtimeId:String(Y.runtimeId||"")}),!I.current)return;j(Y),l(""),u(!1),S("succeeded")}catch(Y){if(Ee.fail({failedPhase:N4(L.current),...B.current?{errorKind:"abort"}:Ia(Y,{phase:L.current}),errorMessage:qb(Y)}),!I.current||B.current)return;S("failed"),R(Y instanceof Error?Y.message:String(Y))}finally{M.current===ce&&(M.current=null),P.current===Ee&&(P.current=null)}},H=async()=>{var ce;const Z=M.current;if(!(!Z||O!=="running")&&window.confirm(t("feishu.confirmCancel"))){B.current=!0,S("cancelling"),R("");try{await PCe(Z),(ce=P.current)==null||ce.fail({failedPhase:N4(L.current),errorKind:"abort",errorMessage:qb("User cancelled deployment")}),I.current&&S("cancelled")}catch(Ee){if(B.current=!1,!I.current)return;S("failed"),R(Ee instanceof Error?Ee.message:String(Ee))}}},X=$Yt((k==null?void 0:k.phase)??null),ne=!!(n.trim()&&r.trim()&&a.trim()&&!z),Q=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:z,children:o.jsx(DYt,{})}),o.jsx("img",{className:"feishu-integration-logo",src:ZD,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:z,onChange:Z=>{i(Z.target.value),g&&b("")},onBlur:()=>b(goe(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:T,children:[o.jsxs("button",{ref:N,type:"button",className:"feishu-region-trigger",disabled:z,"aria-haspopup":"listbox","aria-expanded":h,"aria-labelledby":"feishu-region-label feishu-region-value",onClick:()=>{D.current=af.findIndex(Z=>Z===d),m(Z=>!Z)},onKeyDown:Z=>{Z.key!=="ArrowDown"&&Z.key!=="ArrowUp"||(Z.preventDefault(),D.current=Z.key==="ArrowUp"?af.length-1:af.findIndex(ce=>ce===d),m(!0))},children:[o.jsx("span",{id:"feishu-region-value",children:Q}),o.jsx(MYt,{})]}),h?o.jsx("div",{className:"feishu-region-menu",role:"listbox","aria-label":t("feishu.region"),onKeyDown:Z=>{var Y;const ce=_.current.findIndex(G=>G===document.activeElement);let Ee=null;Z.key==="ArrowDown"?Ee=(ce+1)%af.length:Z.key==="ArrowUp"?Ee=(ce-1+af.length)%af.length:Z.key==="Home"?Ee=0:Z.key==="End"?Ee=af.length-1:Z.key==="Tab"&&m(!1),Ee!==null&&(Z.preventDefault(),(Y=_.current[Ee])==null||Y.focus())},children:af.map(Z=>o.jsx("button",{ref:ce=>{const Ee=af.findIndex(Y=>Y===Z);_.current[Ee]=ce},type:"button",role:"option","aria-selected":d===Z,className:`feishu-region-option${d===Z?" is-selected":""}`,onClick:()=>{var ce;f(Z),m(!1),(ce=N.current)==null||ce.focus()},children:t(`feishu.regions.${Z}`)},Z))}):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:z,placeholder:"cli_xxxxxxxxxxxxxxxx",onChange:Z=>{s(Z.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:z,placeholder:t("feishu.appSecretPlaceholder"),onChange:Z=>{l(Z.target.value),w&&x("")},onBlur:()=>x(a.trim()?"":"feishu.validation.appSecret"),"aria-invalid":!!w,"aria-describedby":`feishu-app-secret-help${w?" feishu-app-secret-error":""}`}),o.jsx("button",{type:"button",disabled:z,onClick:()=>u(Z=>!Z),"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")}),w?o.jsx("span",{id:"feishu-app-secret-error",className:"feishu-field-error",role:"alert",children:t(w)}):null]})]}),O!=="idle"?o.jsxs("div",{className:`feishu-deployment-status is-${O}`,role:O==="failed"?"alert":"status",children:[o.jsxs("div",{className:"feishu-deployment-heading",children:[O==="preparing"?o.jsx(mn,{as:"strong",children:t("feishu.status.preparing")}):null,O==="running"?o.jsx(mn,{as:"strong",children:k?YD(k):t("feishu.status.running")}):null,O==="cancelling"?o.jsx(mn,{as:"strong",children:t("feishu.status.cancelling")}):null,O==="succeeded"?o.jsxs("strong",{children:[o.jsx(moe,{}),t("feishu.status.succeeded")]}):null,O==="cancelled"?o.jsx("strong",{children:t("feishu.status.cancelled")}):null,O==="failed"?o.jsx("strong",{children:t("feishu.status.failed")}):null]}),O==="preparing"||O==="running"||O==="cancelling"?o.jsx("ol",{className:"feishu-deployment-steps",children:n8e.map((Z,ce)=>{const Ee=O==="running"&&cevoid H(),children:t("feishu.cancelDeployment")}):null,o.jsx("button",{type:"submit",className:"feishu-submit",disabled:!ne,children:t(z?"feishu.creating":"feishu.create")})]})]})]})]})})]})}async function kq(e,t,n,i=qa){var s;const r=await pn(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 BYt(e){return kq("/web/coding-agents/capabilities",{method:"GET"},e,vU)}function UYt(e,t){return kq(`/web/coding-agents/skills/${encodeURIComponent(e)}/preview`,{method:"GET"},t)}function QYt(e,t){return kq("/web/coding-agents/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},t)}const zYt="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 VYt(){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 boe(){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 yoe(){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 HYt(e){return e instanceof DOMException&&e.name==="AbortError"}function qYt(e){return e instanceof Error&&e.message?e.message:""}function WYt(e){return e<1024?`${e} B`:`${(e/1024).toFixed(e<10*1024?1:0)} KB`}function KYt(e){const t=e.split("/");return t[t.length-1]??e}function GYt(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 XYt({skill:e,onClose:t}){const{t:n}=je("automations"),i=p.useRef(null),r=p.useRef(null),s=p.useId(),a=p.useId(),[l,c]=p.useState(null),[u,d]=p.useState(""),[f,h]=p.useState(!0),[m,g]=p.useState(""),[b,v]=p.useState(0);p.useEffect(()=>{r.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const O=i.current;return O&&!O.open&&O.showModal(),()=>{var S;O!=null&&O.open&&O.close(),(S=r.current)==null||S.focus()}},[]),p.useEffect(()=>{const O=new AbortController;return h(!0),g(""),c(null),d(""),UYt(e.id,O.signal).then(S=>{if(O.signal.aborted)return;c(S);const k=S.files.find(C=>C.path==="SKILL.md")??S.files[0];d((k==null?void 0:k.path)??"")}).catch(S=>{!O.signal.aborted&&!HYt(S)&&g(qYt(S))}).finally(()=>{O.signal.aborted||h(!1)}),()=>O.abort()},[b,e.id]);const y=p.useMemo(()=>GYt((l==null?void 0:l.files)??[]),[l]),w=(l==null?void 0:l.files.find(O=>O.path===u))??null,x=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:O=>{O.preventDefault(),t()},onMouseDown:O=>{const S=O.currentTarget.getBoundingClientRect();(O.clientXS.right||O.clientYS.bottom)&&t()},children:[o.jsxs("header",{className:"coding-agents-preview-header",children:[o.jsx("span",{className:"coding-agents-preview-mark",children:o.jsx(yoe,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:s,children:x}),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(VYt,{})})]}),f?o.jsxs("div",{className:"coding-agents-preview-state",children:[o.jsx("i",{}),n("codingAgents.preview.loading")]}):m?o.jsxs("div",{className:"coding-agents-preview-state is-error",role:"alert",children:[o.jsx("span",{children:m||n("codingAgents.preview.error")}),o.jsx("button",{type:"button",onClick:()=>v(O=>O+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:x}),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(O=>O.directory?o.jsxs("details",{open:!0,children:[o.jsxs("summary",{children:[o.jsx(yoe,{}),o.jsx("span",{children:O.directory})]}),o.jsx("div",{children:O.files.map(S=>o.jsxs("button",{type:"button",className:u===S.path?"is-selected":"","aria-current":u===S.path?"true":void 0,onClick:()=>d(S.path),children:[o.jsx(boe,{}),o.jsx("span",{children:KYt(S.path)})]},S.path))})]},O.directory):O.files.map(S=>o.jsxs("button",{type:"button",className:u===S.path?"is-selected":"","aria-current":u===S.path?"true":void 0,onClick:()=>d(S.path),children:[o.jsx(boe,{}),o.jsx("span",{children:S.path})]},S.path)))})]}),o.jsx("section",{className:"coding-agents-preview-file","aria-label":n("codingAgents.preview.fileContent"),children:w?o.jsxs(o.Fragment,{children:[o.jsxs("header",{children:[o.jsx("strong",{children:w.path}),o.jsx("span",{children:WYt(w.size)})]}),w.previewable&&w.content!==null?o.jsx("pre",{tabIndex:0,children:o.jsx("code",{children:w.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 YYt(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 ZYt(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 JYt(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 eZt(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 voe(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 tZt(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 nZt({agentId:e}){return e==="trae"?o.jsx("img",{src:zYt,alt:"","aria-hidden":"true"}):e==="claude-code"?o.jsx(JYt,{}):o.jsx(eZt,{})}function xoe(e){return e instanceof DOMException&&e.name==="AbortError"}function woe(e,t){return e instanceof Error&&e.message?e.message:t}function iZt({onBack:e}){var j;const{t}=je("automations"),[n,i]=p.useState(null),[r,s]=p.useState(!0),[a,l]=p.useState(null),[c,u]=p.useState(0),[d,f]=p.useState(new Set),[h,m]=p.useState(new Set),[g,b]=p.useState(null),[v,y]=p.useState(!1),[w,x]=p.useState(null),O=p.useRef(null);p.useEffect(()=>{const T=new AbortController;return s(!0),l(null),BYt(T.signal).then(N=>{if(T.signal.aborted)return;i(N);const _=N.agents.filter(D=>D.available);f(D=>{const M=_.filter(P=>D.has(P.id));return new Set((M.length?M:_.slice(0,1)).map(P=>P.id))}),m(D=>{const M=N.skills.filter(P=>D.has(P.id));return new Set((M.length?M:N.skills).map(P=>P.id))})}).catch(N=>{!xoe(N)&&!T.signal.aborted&&(i(null),l(woe(N,"")))}).finally(()=>{T.signal.aborted||s(!1)}),()=>T.abort()},[c]),p.useEffect(()=>()=>{var T;return(T=O.current)==null?void 0:T.abort()},[]);const S=p.useMemo(()=>(n==null?void 0:n.agents.filter(T=>T.available&&d.has(T.id)))||[],[n,d]),k=p.useMemo(()=>(n==null?void 0:n.skills.filter(T=>h.has(T.id)))||[],[n,h]),C=!!(!v&&S.length&&k.length),E=(T,N)=>{!N||v||(x(null),f(_=>{const D=new Set(_);return D.has(T)?D.delete(T):D.add(T),D}))},R=T=>{v||(x(null),m(N=>{const _=new Set(N);return _.has(T)?_.delete(T):_.add(T),_}))},A=async()=>{var N;if(!C)return;(N=O.current)==null||N.abort();const T=new AbortController;O.current=T,y(!0),x(null);try{const _=await QYt({agents:S.map(M=>M.id),skills:k.map(M=>M.id)},T.signal);if(T.signal.aborted)return;const D=_.installations;x({tone:"success",agentCount:S.length,skillCount:k.length,installations:D})}catch(_){!xoe(_)&&!T.signal.aborted&&x({tone:"error",message:woe(_,"")})}finally{O.current===T&&(O.current=null),T.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(YYt,{})}),o.jsx(ZYt,{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(T=>T+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(T=>T+1),children:t("codingAgents.retry")})]}):o.jsx("div",{className:"coding-agents-agent-grid",children:n==null?void 0:n.agents.map(T=>o.jsxs("button",{type:"button",className:`coding-agents-agent ${d.has(T.id)?"is-selected":""}`,"aria-pressed":d.has(T.id),disabled:!T.available||v,onClick:()=>E(T.id,T.available),title:T.available?T.name:T.reason,children:[o.jsx("span",{className:`coding-agents-agent-mark is-${T.id}`,children:o.jsx(nZt,{agentId:T.id})}),o.jsxs("span",{className:"coding-agents-agent-copy",children:[o.jsx("strong",{children:T.name}),o.jsx("small",{children:T.available?T.version||t("codingAgents.clients.detected"):T.reason})]}),o.jsx("span",{className:`coding-agents-status ${T.available?"is-ready":""}`,children:T.available?t("codingAgents.clients.available"):t("codingAgents.clients.unavailable")}),o.jsx("span",{className:"coding-agents-check",children:o.jsx(voe,{})})]},T.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(T=>o.jsxs("div",{className:`coding-agents-skill ${h.has(T.id)?"is-selected":""}`,children:[o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:h.has(T.id),onChange:()=>R(T.id),disabled:v}),o.jsx("span",{className:"coding-agents-skill-check","aria-hidden":"true",children:o.jsx(voe,{})}),o.jsxs("span",{children:[o.jsx("strong",{children:t(`codingAgents.skills.items.${T.id}.name`,{defaultValue:T.name})}),o.jsx("small",{children:t(`codingAgents.skills.items.${T.id}.description`,{defaultValue:T.description})})]})]}),o.jsx("button",{type:"button",onClick:()=>b(T),children:t("codingAgents.skills.viewFiles")})]},T.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(tZt,{}),o.jsxs("div",{children:[o.jsx("strong",{children:t("codingAgents.global.title")}),o.jsx("span",{children:t("codingAgents.global.description")})]})]}),S.length?o.jsx("dl",{children:S.map(T=>o.jsxs("div",{children:[o.jsx("dt",{children:T.name}),o.jsx("dd",{children:T.globalSkillsPath})]},T.id))}):o.jsx("p",{children:t("codingAgents.global.empty")})]})]}),w?o.jsxs("div",{className:`coding-agents-result is-${w.tone}`,role:w.tone==="error"?"alert":"status",children:[o.jsx("strong",{children:w.tone==="success"?t("codingAgents.success",{agentCount:w.agentCount,skillCount:w.skillCount}):w.message||t("codingAgents.errors.configure")}),(j=w.installations)!=null&&j.length?o.jsx("ul",{children:w.installations.map(T=>o.jsxs("li",{children:[T.agentName," · ",t(`codingAgents.skills.items.${T.skillId}.name`,{defaultValue:T.skill})," → ",T.displayPath]},`${T.agent}:${T.skillId}`))}):null]}):null,o.jsxs("div",{className:"coding-agents-actions",children:[o.jsx("span",{children:S.length?t("codingAgents.selection",{agentCount:S.length,skillCount:k.length}):t("codingAgents.selectClient")}),o.jsx("button",{type:"button",onClick:()=>void A(),disabled:!C,children:t(v?"codingAgents.configuring":"codingAgents.configure")})]})]})}),g?o.jsx(XYt,{skill:g,onClose:()=>b(null)}):null]})}async function Sq(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 rZt(e){const t=await pn("/web/website-integrations",{cache:"no-store",signal:e});if(!t.ok)throw await Sq(t,V("websiteIntegration.listFailed"));return(await t.json()).integrations??[]}async function sZt(e){const t=await pn("/web/website-integrations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await Sq(t,V("websiteIntegration.createFailed"));return t.json()}async function oZt(e){const t=await pn(`/web/website-integrations/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await Sq(t,V("websiteIntegration.deleteFailed"))}function aZt(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 Ooe(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 lZt(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 cZt(e){const t=[];let n="";for(let i=0;i<10;i+=1){const r=await zw({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 uZt({onBack:e}){const{t,i18n:n}=je("websiteIntegration"),[i,r]=p.useState([]),[s,a]=p.useState([]),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(!0),[b,v]=p.useState(!1),[y,w]=p.useState(""),[x,O]=p.useState("");p.useEffect(()=>{const j=new AbortController;return g(!0),O(""),Promise.all([rZt(j.signal),cZt(j.signal)]).then(([T,N])=>{var D;if(j.signal.aborted)return;r(T),a(N),d(((D=T[0])==null?void 0:D.id)??"");const _=N[0];_&&c(`${_.region}::${_.runtimeId}`)}).catch(T=>{j.signal.aborted||O(T instanceof Error?T.message:t("errors.load"))}).finally(()=>{j.signal.aborted||g(!1)}),()=>j.abort()},[t]);const S=p.useMemo(()=>s.map(j=>({value:`${j.region}::${j.runtimeId}`,label:j.name||j.runtimeId,description:`${j.region} · ${j.status}`,runtime:j})),[s]),k=p.useMemo(()=>new Map(S.map(j=>[j.value,j.runtime])),[S]),C=i.find(j=>j.id===u)??i[0],E=C?` - + +
diff --git a/veadk/webui/website-integration.js b/veadk/webui/website-integration.js index 68b468843..8175f5fb4 100644 --- a/veadk/webui/website-integration.js +++ b/veadk/webui/website-integration.js @@ -1,4 +1,4 @@ -var ifi=Object.defineProperty;var Yor=qa=>{throw TypeError(qa)};var afi=(qa,Fo,Ti)=>Fo in qa?ifi(qa,Fo,{enumerable:!0,configurable:!0,writable:!0,value:Ti}):qa[Fo]=Ti;var Pr=(qa,Fo,Ti)=>afi(qa,typeof Fo!="symbol"?Fo+"":Fo,Ti),qor=(qa,Fo,Ti)=>Fo.has(qa)||Yor("Cannot "+Ti);var yu=(qa,Fo,Ti)=>(qor(qa,Fo,"read from private field"),Ti?Ti.call(qa):Fo.get(qa)),jor=(qa,Fo,Ti)=>Fo.has(qa)?Yor("Cannot add the same private member more than once"):Fo instanceof WeakSet?Fo.add(qa):Fo.set(qa,Ti),WMe=(qa,Fo,Ti,wh)=>(qor(qa,Fo,"write to private field"),wh?wh.call(qa,Ti):Fo.set(qa,Ti),Ti);(function(){"use strict";var Hor,Ks,Cf,Wor,UD,VD,QD,GD,HD,WD,YD,qD,jD,XD,KD,ZD,JD,eL,sae,bk,tL,rL,nL,iL,aL,oL,pd,sL,lL,cL,uL,hL,dL,fL,pL,gL,mL,vL,yL,bL,xL,wL,AL,SL,TL,CL,OL,kL,EL,_L,RL,DL,LL,ML,IL,PL,NL,BL,$L,FL,zL,UL,VL,QL,GL,HL,WL,YL,qL,jL,XL,KL,ZL,JL,eM,tM,rM,nM,iM,aM,xk,oM,sM,lM,cM,uM,hM,dM,fM,pM,gM,mM,vM,wk,yM,bM,xM,wM,AM,SM,TM,CM,OM,kM,EM,Hw,_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,oI,sI,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,$I,FI,zI,UI,VI,QI,GI,HI,WI,YI,qI,jI,XI,KI,ZI,JI,eP,tP,rP,nP,iP,aP,oP,sP,lP,cP,uP,hP,dP,fP,Ww,Ak,pP,gP,mP,kb,vP,yP,bP,xP,wP,AP,SP;var qa=typeof document<"u"?document.currentScript:null;function Fo(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Ti=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ZMe={exports:{}},wU={};/** +var ofi=Object.defineProperty;var jor=qa=>{throw TypeError(qa)};var sfi=(qa,Fo,Ti)=>Fo in qa?ofi(qa,Fo,{enumerable:!0,configurable:!0,writable:!0,value:Ti}):qa[Fo]=Ti;var Pr=(qa,Fo,Ti)=>sfi(qa,typeof Fo!="symbol"?Fo+"":Fo,Ti),Xor=(qa,Fo,Ti)=>Fo.has(qa)||jor("Cannot "+Ti);var yu=(qa,Fo,Ti)=>(Xor(qa,Fo,"read from private field"),Ti?Ti.call(qa):Fo.get(qa)),Kor=(qa,Fo,Ti)=>Fo.has(qa)?jor("Cannot add the same private member more than once"):Fo instanceof WeakSet?Fo.add(qa):Fo.set(qa,Ti),WMe=(qa,Fo,Ti,wh)=>(Xor(qa,Fo,"write to private field"),wh?wh.call(qa,Ti):Fo.set(qa,Ti),Ti);(function(){"use strict";var Yor,Ks,Cf,qor,UD,VD,QD,GD,HD,WD,YD,qD,jD,XD,KD,ZD,JD,eL,sae,bk,tL,rL,nL,iL,aL,oL,pd,sL,lL,cL,uL,hL,dL,fL,pL,gL,mL,vL,yL,bL,xL,wL,AL,SL,TL,CL,OL,kL,EL,_L,RL,DL,LL,ML,IL,PL,NL,BL,$L,FL,zL,UL,VL,QL,GL,HL,WL,YL,qL,jL,XL,KL,ZL,JL,eM,tM,rM,nM,iM,aM,xk,oM,sM,lM,cM,uM,hM,dM,fM,pM,gM,mM,vM,wk,yM,bM,xM,wM,AM,SM,TM,CM,OM,kM,EM,Hw,_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,oI,sI,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,$I,FI,zI,UI,VI,QI,GI,HI,WI,YI,qI,jI,XI,KI,ZI,JI,eP,tP,rP,nP,iP,aP,oP,sP,lP,cP,uP,hP,dP,fP,Ww,Ak,pP,gP,mP,kb,vP,yP,bP,xP,wP,AP,SP;var qa=typeof document<"u"?document.currentScript:null;function Fo(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Ti=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ZMe={exports:{}},wU={};/** * @license React * react-jsx-runtime.production.js * @@ -6,7 +6,7 @@ var ifi=Object.defineProperty;var Yor=qa=>{throw TypeError(qa)};var afi=(qa,Fo,T * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Jor=Symbol.for("react.transitional.element"),esr=Symbol.for("react.fragment");function JMe(t,e,r){var n=null;if(r!==void 0&&(n=""+r),e.key!==void 0&&(n=""+e.key),"key"in e){r={};for(var i in e)i!=="key"&&(r[i]=e[i])}else r=e;return e=r.ref,{$$typeof:Jor,type:t,key:n,ref:e!==void 0?e:null,props:r}}wU.Fragment=esr,wU.jsx=JMe,wU.jsxs=JMe,ZMe.exports=wU;var H=ZMe.exports,eIe={exports:{}},AU={},tIe={exports:{}},rIe={};/** + */var tsr=Symbol.for("react.transitional.element"),rsr=Symbol.for("react.fragment");function JMe(t,e,r){var n=null;if(r!==void 0&&(n=""+r),e.key!==void 0&&(n=""+e.key),"key"in e){r={};for(var i in e)i!=="key"&&(r[i]=e[i])}else r=e;return e=r.ref,{$$typeof:tsr,type:t,key:n,ref:e!==void 0?e:null,props:r}}wU.Fragment=rsr,wU.jsx=JMe,wU.jsxs=JMe,ZMe.exports=wU;var H=ZMe.exports,eIe={exports:{}},AU={},tIe={exports:{}},rIe={};/** * @license React * scheduler.production.js * @@ -14,7 +14,7 @@ var ifi=Object.defineProperty;var Yor=qa=>{throw TypeError(qa)};var afi=(qa,Fo,T * * 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,I){var N=M.length;M.push(I);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 I}function i(M,I){var N=M.sortIndex-I.sortIndex;return N!==0?N:M.id-I.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 o=Date,s=o.now();t.unstable_now=function(){return o.now()-s}}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 I=r(u);I!==null;){if(I.callback===null)n(u);else if(I.startTime<=M)n(u),I.sortIndex=I.expirationTime,e(l,I);else break;I=r(u)}}function A(M){if(m=!1,w(M),!g)if(r(l)!==null)g=!0,S||(S=!0,P());else{var I=r(u);I!==null&&D(A,I.startTime-M)}}var S=!1,T=-1,C=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),I=!0;break t}d===r(l)&&n(l),w(M)}else n(l);d=r(l)}if(d!==null)I=!0;else{var V=r(u);V!==null&&D(A,V.startTime-M),I=!1}}break e}finally{d=null,f=N,p=!1}I=void 0}}finally{I?P():S=!1}}}var P;if(typeof x=="function")P=function(){x(_)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,R=L.port2;L.port1.onmessage=_,P=function(){R.postMessage(null)}}else P=function(){y(_,0)};function D(M,I){T=y(function(){M(t.unstable_now())},I)}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,P()))),M},t.unstable_shouldYield=E,t.unstable_wrapCallback=function(M){var I=f;return function(){var N=f;f=I;try{return M.apply(this,arguments)}finally{f=N}}}})(rIe),tIe.exports=rIe;var tsr=tIe.exports,nIe={exports:{}},zn={};/** + */(function(t){function e(M,I){var N=M.length;M.push(I);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 I}function i(M,I){var N=M.sortIndex-I.sortIndex;return N!==0?N:M.id-I.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 o=Date,s=o.now();t.unstable_now=function(){return o.now()-s}}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 I=r(u);I!==null;){if(I.callback===null)n(u);else if(I.startTime<=M)n(u),I.sortIndex=I.expirationTime,e(l,I);else break;I=r(u)}}function A(M){if(m=!1,w(M),!g)if(r(l)!==null)g=!0,S||(S=!0,P());else{var I=r(u);I!==null&&D(A,I.startTime-M)}}var S=!1,T=-1,C=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),I=!0;break t}d===r(l)&&n(l),w(M)}else n(l);d=r(l)}if(d!==null)I=!0;else{var V=r(u);V!==null&&D(A,V.startTime-M),I=!1}}break e}finally{d=null,f=N,p=!1}I=void 0}}finally{I?P():S=!1}}}var P;if(typeof x=="function")P=function(){x(_)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,R=L.port2;L.port1.onmessage=_,P=function(){R.postMessage(null)}}else P=function(){y(_,0)};function D(M,I){T=y(function(){M(t.unstable_now())},I)}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,P()))),M},t.unstable_shouldYield=E,t.unstable_wrapCallback=function(M){var I=f;return function(){var N=f;f=I;try{return M.apply(this,arguments)}finally{f=N}}}})(rIe),tIe.exports=rIe;var nsr=tIe.exports,nIe={exports:{}},zn={};/** * @license React * react.production.js * @@ -22,7 +22,7 @@ var ifi=Object.defineProperty;var Yor=qa=>{throw TypeError(qa)};var afi=(qa,Fo,T * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var cae=Symbol.for("react.transitional.element"),rsr=Symbol.for("react.portal"),nsr=Symbol.for("react.fragment"),isr=Symbol.for("react.strict_mode"),asr=Symbol.for("react.profiler"),osr=Symbol.for("react.consumer"),ssr=Symbol.for("react.context"),lsr=Symbol.for("react.forward_ref"),csr=Symbol.for("react.suspense"),usr=Symbol.for("react.memo"),iIe=Symbol.for("react.lazy"),hsr=Symbol.for("react.activity"),aIe=Symbol.iterator;function dsr(t){return t===null||typeof t!="object"?null:(t=aIe&&t[aIe]||t["@@iterator"],typeof t=="function"?t:null)}var oIe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},sIe=Object.assign,lIe={};function Ok(t,e,r){this.props=t,this.context=e,this.refs=lIe,this.updater=r||oIe}Ok.prototype.isReactComponent={},Ok.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")},Ok.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function cIe(){}cIe.prototype=Ok.prototype;function uae(t,e,r){this.props=t,this.context=e,this.refs=lIe,this.updater=r||oIe}var hae=uae.prototype=new cIe;hae.constructor=uae,sIe(hae,Ok.prototype),hae.isPureReactComponent=!0;var uIe=Array.isArray;function dae(){}var ja={H:null,A:null,T:null,S:null},hIe=Object.prototype.hasOwnProperty;function fae(t,e,r){var n=r.ref;return{$$typeof:cae,type:t,key:e,ref:n!==void 0?n:null,props:r}}function fsr(t,e){return fae(t.type,e,t.props)}function pae(t){return typeof t=="object"&&t!==null&&t.$$typeof===cae}function psr(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var dIe=/\/+/g;function gae(t,e){return typeof t=="object"&&t!==null&&t.key!=null?psr(""+t.key):e.toString(36)}function gsr(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(dae,dae):(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 kk(t,e,r,n,i){var a=typeof t;(a==="undefined"||a==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(a){case"bigint":case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case cae:case rsr:o=!0;break;case iIe:return o=t._init,kk(o(t._payload),e,r,n,i)}}if(o)return i=i(t),o=n===""?"."+gae(t,0):n,uIe(i)?(r="",o!=null&&(r=o.replace(dIe,"$&/")+"/"),kk(i,e,r,"",function(u){return u})):i!=null&&(pae(i)&&(i=fsr(i,r+(i.key==null||t&&t.key===i.key?"":(""+i.key).replace(dIe,"$&/")+"/")+o)),e.push(i)),1;o=0;var s=n===""?".":n+":";if(uIe(t))for(var l=0;l{throw TypeError(qa)};var afi=(qa,Fo,T * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ysr=j;function mIe(t){var e="https://react.dev/errors/"+t;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vIe)}catch(t){console.error(t)}}vIe(),gIe.exports=bu;var kf=gIe.exports;/** + */var xsr=j;function mIe(t){var e="https://react.dev/errors/"+t;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vIe)}catch(t){console.error(t)}}vIe(),gIe.exports=bu;var kf=gIe.exports;/** * @license React * react-dom-client.production.js * @@ -38,16 +38,16 @@ var ifi=Object.defineProperty;var Yor=qa=>{throw TypeError(qa)};var afi=(qa,Fo,T * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Js=tsr,yIe=j,wsr=kf;function Lt(t){var e="https://react.dev/errors/"+t;if(1_k||(t.current=Sae[_k],Sae[_k]=null,_k--)}function Ia(t,e){_k++,Sae[_k]=t.current,t.current=e}var cm=lm(null),RP=lm(null),Rb=lm(null),OU=lm(null);function kU(t,e){switch(Ia(Rb,e),Ia(RP,t),Ia(cm,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?KNe(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=KNe(e),t=ZNe(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}wl(cm),Ia(cm,t)}function Rk(){wl(cm),wl(RP),wl(Rb)}function Tae(t){t.memoizedState!==null&&Ia(OU,t);var e=cm.current,r=ZNe(e,t.type);e!==r&&(Ia(RP,t),Ia(cm,r))}function EU(t){RP.current===t&&(wl(cm),wl(RP)),OU.current===t&&(wl(OU),b6._currentValue=jw)}var Cae,kIe;function Xw(t){if(Cae===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);Cae=e&&e[1]||"",kIe=-1_k||(t.current=Sae[_k],Sae[_k]=null,_k--)}function Ia(t,e){_k++,Sae[_k]=t.current,t.current=e}var cm=lm(null),RP=lm(null),Rb=lm(null),OU=lm(null);function kU(t,e){switch(Ia(Rb,e),Ia(RP,t),Ia(cm,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?KNe(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=KNe(e),t=ZNe(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}wl(cm),Ia(cm,t)}function Rk(){wl(cm),wl(RP),wl(Rb)}function Tae(t){t.memoizedState!==null&&Ia(OU,t);var e=cm.current,r=ZNe(e,t.type);e!==r&&(Ia(RP,t),Ia(cm,r))}function EU(t){RP.current===t&&(wl(cm),wl(RP)),OU.current===t&&(wl(OU),b6._currentValue=jw)}var Cae,kIe;function Xw(t){if(Cae===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);Cae=e&&e[1]||"",kIe=-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{Oae=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?Xw(r):""}function Osr(t,e){switch(t.tag){case 26:case 27:case 5:return Xw(t.type);case 16:return Xw("Lazy");case 13:return t.child!==e&&e!==null?Xw("Suspense Fallback"):Xw("Suspense");case 19:return Xw("SuspenseList");case 0:case 15:return kae(t.type,!1);case 11:return kae(t.type.render,!1);case 1:return kae(t.type,!0);case 31:return Xw("Activity");default:return""}}function EIe(t){try{var e="",r=null;do e+=Osr(t,r),r=t,t=t.return;while(t);return e}catch(n){return` +`+l[n].replace(" at new "," at ");return t.displayName&&h.includes("")&&(h=h.replace("",t.displayName)),h}while(1<=n&&0<=i);break}}}finally{Oae=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?Xw(r):""}function Esr(t,e){switch(t.tag){case 26:case 27:case 5:return Xw(t.type);case 16:return Xw("Lazy");case 13:return t.child!==e&&e!==null?Xw("Suspense Fallback"):Xw("Suspense");case 19:return Xw("SuspenseList");case 0:case 15:return kae(t.type,!1);case 11:return kae(t.type.render,!1);case 1:return kae(t.type,!0);case 31:return Xw("Activity");default:return""}}function EIe(t){try{var e="",r=null;do e+=Esr(t,r),r=t,t=t.return;while(t);return e}catch(n){return` Error generating stack: `+n.message+` -`+n.stack}}var Eae=Object.prototype.hasOwnProperty,_ae=Js.unstable_scheduleCallback,Rae=Js.unstable_cancelCallback,ksr=Js.unstable_shouldYield,Esr=Js.unstable_requestPaint,yd=Js.unstable_now,_sr=Js.unstable_getCurrentPriorityLevel,_Ie=Js.unstable_ImmediatePriority,RIe=Js.unstable_UserBlockingPriority,_U=Js.unstable_NormalPriority,Rsr=Js.unstable_LowPriority,DIe=Js.unstable_IdlePriority,Dsr=Js.log,Lsr=Js.unstable_setDisableYieldValue,DP=null,bd=null;function Db(t){if(typeof Dsr=="function"&&Lsr(t),bd&&typeof bd.setStrictMode=="function")try{bd.setStrictMode(DP,t)}catch{}}var xd=Math.clz32?Math.clz32:Psr,Msr=Math.log,Isr=Math.LN2;function Psr(t){return t>>>=0,t===0?32:31-(Msr(t)/Isr|0)|0}var RU=256,DU=262144,LU=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 MU(t,e,r){var n=t.pendingLanes;if(n===0)return 0;var i=0,a=t.suspendedLanes,o=t.pingedLanes;t=t.warmLanes;var s=n&134217727;return s!==0?(n=s&~a,n!==0?i=Kw(n):(o&=s,o!==0?i=Kw(o):r||(r=s&~t,r!==0&&(i=Kw(r))))):(s=n&~a,s!==0?i=Kw(s):o!==0?i=Kw(o):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 LP(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function Nsr(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 LIe(){var t=LU;return LU<<=1,!(LU&62914560)&&(LU=4194304),t}function Dae(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function MP(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Bsr(t,e,r,n,i,a){var o=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 s=t.entanglements,l=t.expirationTimes,u=t.hiddenUpdates;for(r=o&~r;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Qsr=/[\n"\\]/g;function _f(t){return t.replace(Qsr,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Bae(t,e,r,n,i,a,o,s){t.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.type=o:t.removeAttribute("type"),e!=null?o==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+Ef(e)):t.value!==""+Ef(e)&&(t.value=""+Ef(e)):o!=="submit"&&o!=="reset"||t.removeAttribute("value"),e!=null?$ae(t,o,Ef(e)):r!=null?$ae(t,o,Ef(r)):n!=null&&t.removeAttribute("value"),i==null&&a!=null&&(t.defaultChecked=!!a),i!=null&&(t.checked=i&&typeof i!="function"&&typeof i!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.name=""+Ef(s):t.removeAttribute("name")}function HIe(t,e,r,n,i,a,o,s){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)){Nae(t);return}r=r!=null?""+Ef(r):"",e=e!=null?""+Ef(e):r,s||e===t.value||(t.value=e),t.defaultValue=e}n=n??i,n=typeof n!="function"&&typeof n!="symbol"&&!!n,t.checked=s?t.checked:!!n,t.defaultChecked=!!n,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.name=o),Nae(t)}function $ae(t,e,r){e==="number"&&NU(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function Nk(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"),Qae=!1;if(Rv)try{var BP={};Object.defineProperty(BP,"passive",{get:function(){Qae=!0}}),window.addEventListener("test",BP,BP),window.removeEventListener("test",BP,BP)}catch{Qae=!1}var Mb=null,Gae=null,$U=null;function ZIe(){if($U)return $U;var t,e=Gae,r=e.length,n,i="value"in Mb?Mb.value:Mb.textContent,a=i.length;for(t=0;t=zP),iPe=" ",aPe=!1;function oPe(t,e){switch(t){case"keyup":return vlr.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sPe(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var zk=!1;function blr(t,e){switch(t){case"compositionend":return sPe(e);case"keypress":return e.which!==32?null:(aPe=!0,iPe);case"textInput":return t=e.data,t===iPe&&aPe?null:t;default:return null}}function xlr(t,e){if(zk)return t==="compositionend"||!jae&&oPe(t,e)?(t=ZIe(),$U=Gae=Mb=null,zk=!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=gPe(r)}}function vPe(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?vPe(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function yPe(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=NU(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=NU(t.document)}return e}function Zae(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 Elr=Rv&&"documentMode"in document&&11>=document.documentMode,Uk=null,Jae=null,GP=null,eoe=!1;function bPe(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;eoe||Uk==null||Uk!==NU(n)||(n=Uk,"selectionStart"in n&&Zae(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}),GP&&QP(GP,n)||(GP=n,n=DV(Jae,"onSelect"),0>=o,i-=o,um=1<<32-xd(e)+i|r<C?(k=T,T=null):k=T.sibling;var E=f(y,T,x[C],w);if(E===null){T===null&&(T=k);break}t&&T&&E.alternate===null&&e(y,T),b=a(E,b,C),S===null?A=E:S.sibling=E,S=E,T=k}if(C===x.length)return r(y,T),Ci&&Lv(y,C),A;if(T===null){for(;CC?(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,C),S===null?A=_:S.sibling=_,S=_,T=k}if(E.done)return r(y,T),Ci&&Lv(y,C),A;if(T===null){for(;!E.done;C++,E=x.next())E=d(y,E.value,w),E!==null&&(b=a(E,b,C),S===null?A=E:S.sibling=E,S=E);return Ci&&Lv(y,C),A}for(T=n(T);!E.done;C++,E=x.next())E=p(T,y,C,E.value,w),E!==null&&(t&&E.alternate!==null&&T.delete(E.key===null?C:E.key),b=a(E,b,C),S===null?A=E:S.sibling=E,S=E);return t&&T.forEach(function(P){return e(y,P)}),Ci&&Lv(y,C),A}function v(y,b,x,w){if(typeof x=="object"&&x!==null&&x.type===Ek&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case CU:e:{for(var A=x.key;b!==null;){if(b.key===A){if(A=x.type,A===Ek){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===_b&&lA(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===Ek?(w=nA(x.props.children,y.mode,w,x.key),w.return=y,y=w):(w=qU(x.type,x.key,x.props,null,y.mode,w),XP(w,x),w.return=y,y=w)}return o(y);case kP: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=soe(x,y.mode,w),w.return=y,y=w}return o(y);case _b:return x=lA(x),v(y,b,x,w)}if(_P(x))return g(y,b,x,w);if(EP(x)){if(A=EP(x),typeof A!="function")throw Error(Lt(150));return x=A.call(x),m(y,b,x,w)}if(typeof x.then=="function")return v(y,b,tV(x),w);if(x.$$typeof===kv)return v(y,b,KU(y,x),w);rV(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=ooe(x,y.mode,w),w.return=y,y=w),o(y)):r(y,b)}return function(y,b,x,w){try{jP=0;var A=v(y,b,x,w);return Zk=null,A}catch(T){if(T===Kk||T===JU)throw T;var S=Ad(29,T,null,y.mode);return S.lanes=w,S.return=y,S}finally{}}}var uA=VPe(!0),QPe=VPe(!1),$b=!1;function boe(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xoe(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 Fb(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function zb(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,Wi&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,e=YU(t),OPe(t,null,r),e}return WU(t,n,e,r),YU(t)}function KP(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,IIe(t,r)}}function woe(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 o={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,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 Aoe=!1;function ZP(){if(Aoe){var t=Xk;if(t!==null)throw t}}function JP(t,e,r,n){Aoe=!1;var i=t.updateQueue;$b=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,o===null?a=u:o.next=u,o=l;var h=t.alternate;h!==null&&(h=h.updateQueue,s=h.lastBaseUpdate,s!==o&&(s===null?h.firstBaseUpdate=u:s.next=u,h.lastBaseUpdate=l))}if(a!==null){var d=i.baseState;o=0,h=u=l=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(vi&f)===f:(n&f)===f){f!==0&&f===jk&&(Aoe=!0),h!==null&&(h=h.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var g=t,m=s;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=Xa({},d,f);break e;case 2:$b=!0}}f=s.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:s.tag,payload:s.payload,callback:s.callback,next:null},h===null?(u=h=p,l=d):h=h.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=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),Hb|=o,t.lanes=o,t.memoizedState=d}}function GPe(t,e){if(typeof t!="function")throw Error(Lt(191,t));t.call(e)}function HPe(t,e){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;ta?a:8;var o=Tn.T,s={};Tn.T=s,Uoe(t,!1,e,r);try{var l=i(),u=Tn.S;if(u!==null&&u(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var h=Blr(l,n);r6(t,e,h,kd(t))}else r6(t,e,n,kd(t))}catch(d){r6(t,e,{then:function(){},status:"rejected",reason:d},kd())}finally{Hi.p=a,o!==null&&s.types!==null&&(o.types=s.types),Tn.T=o}}function Qlr(){}function Foe(t,e,r,n){if(t.tag!==5)throw Error(Lt(476));var i=S6e(t).queue;A6e(t,i,e,jw,r===null?Qlr:function(){return T6e(t),r(n)})}function S6e(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:jw,baseState:jw,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nv,lastRenderedState:jw},next:null};var r={};return e.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nv,lastRenderedState:r},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function T6e(t){var e=S6e(t);e.next===null&&(e=t.alternate.memoizedState),r6(t,e.next.queue,{},kd())}function zoe(){return rc(b6)}function C6e(){return ss().memoizedState}function O6e(){return ss().memoizedState}function Glr(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var r=kd();t=Fb(r);var n=zb(e,t,r);n!==null&&(Eh(n,e,r),KP(n,e,r)),e={cache:goe()},t.payload=e;return}e=e.return}}function Hlr(t,e,r){var n=kd();r={lane:n,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},dV(t)?E6e(e,r):(r=ioe(t,e,r,n),r!==null&&(Eh(r,t,n),_6e(r,e,n)))}function k6e(t,e,r){var n=kd();r6(t,e,r,n)}function r6(t,e,r,n){var i={lane:n,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(dV(t))E6e(e,i);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var o=e.lastRenderedState,s=a(o,r);if(i.hasEagerState=!0,i.eagerState=s,wd(s,o))return WU(t,e,i,0),Ca===null&&HU(),!1}catch{}finally{}if(r=ioe(t,e,i,n),r!==null)return Eh(r,t,n),_6e(r,e,n),!0}return!1}function Uoe(t,e,r,n){if(n={lane:2,revertLane:bse(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},dV(t)){if(e)throw Error(Lt(479))}else e=ioe(t,r,n,2),e!==null&&Eh(e,t,2)}function dV(t){var e=t.alternate;return t===Qn||e!==null&&e===Qn}function E6e(t,e){eE=aV=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function _6e(t,e,r){if(r&4194048){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,IIe(t,r)}}var n6={readContext:rc,use:lV,useCallback:zo,useContext:zo,useEffect:zo,useImperativeHandle:zo,useLayoutEffect:zo,useInsertionEffect:zo,useMemo:zo,useReducer:zo,useRef:zo,useState:zo,useDebugValue:zo,useDeferredValue:zo,useTransition:zo,useSyncExternalStore:zo,useId:zo,useHostTransitionStatus:zo,useFormState:zo,useActionState:zo,useOptimistic:zo,useMemoCache:zo,useCacheRefresh:zo};n6.useEffectEvent=zo;var R6e={readContext:rc,use:lV,useCallback:function(t,e){return wu().memoizedState=[t,e===void 0?null:e],t},useContext:rc,useEffect:f6e,useImperativeHandle:function(t,e,r){r=r!=null?r.concat([t]):null,uV(4194308,4,v6e.bind(null,e,t),r)},useLayoutEffect:function(t,e){return uV(4194308,4,t,e)},useInsertionEffect:function(t,e){uV(4,2,t,e)},useMemo:function(t,e){var r=wu();e=e===void 0?null:e;var n=t();if(hA){Db(!0);try{t()}finally{Db(!1)}}return r.memoizedState=[n,e],n},useReducer:function(t,e,r){var n=wu();if(r!==void 0){var i=r(e);if(hA){Db(!0);try{r(e)}finally{Db(!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=Hlr.bind(null,Qn,t),[n.memoizedState,t]},useRef:function(t){var e=wu();return t={current:t},e.memoizedState=t},useState:function(t){t=Ioe(t);var e=t.queue,r=k6e.bind(null,Qn,e);return e.dispatch=r,[t.memoizedState,r]},useDebugValue:Boe,useDeferredValue:function(t,e){var r=wu();return $oe(r,t,e)},useTransition:function(){var t=Ioe(!1);return t=A6e.bind(null,Qn,t.queue,!0,!1),wu().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,r){var n=Qn,i=wu();if(Ci){if(r===void 0)throw Error(Lt(407));r=r()}else{if(r=e(),Ca===null)throw Error(Lt(349));vi&127||KPe(n,e,r)}i.memoizedState=r;var a={value:r,getSnapshot:e};return i.queue=a,f6e(JPe.bind(null,n,a,t),[t]),n.flags|=2048,rE(9,{destroy:void 0},ZPe.bind(null,n,a,r,e),null),r},useId:function(){var t=wu(),e=Ca.identifierPrefix;if(Ci){var r=hm,n=um;r=(n&~(1<<32-xd(n)-1)).toString(32)+r,e="_"+e+"R_"+r,r=oV++,0<\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof n.is=="string"?o.createElement("select",{is:n.is}):o.createElement("select"),n.multiple?a.multiple=!0:n.size&&(a.size=n.size);break;default:a=typeof n.is=="string"?o.createElement(i,{is:n.is}):o.createElement(i)}}a[ec]=e,a[Ah]=n;e:for(o=e.child;o!==null;){if(o.tag===5||o.tag===6)a.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===e)break e;for(;o.sibling===null;){if(o.return===null||o.return===e)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}e.stateNode=a;e:switch(ic(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&&$v(e)}}return Za(e),tse(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,r),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==n&&$v(e);else{if(typeof n!="string"&&e.stateNode===null)throw Error(Lt(166));if(t=Rb.current,Yk(e)){if(t=e.stateNode,r=e.memoizedProps,n=null,i=tc,i!==null)switch(i.tag){case 27:case 5:n=i.memoizedProps}t[ec]=e,t=!!(t.nodeValue===r||n!==null&&n.suppressHydrationWarning===!0||jNe(t.nodeValue,r)),t||Nb(e,!0)}else t=LV(t).createTextNode(n),t[ec]=e,e.stateNode=t}return Za(e),null;case 31:if(r=e.memoizedState,t===null||t.memoizedState!==null){if(n=Yk(e),r!==null){if(t===null){if(!n)throw Error(Lt(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Lt(557));t[ec]=e}else iA(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Za(e),t=!1}else r=hoe(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),t=!0;if(!t)return e.flags&256?(Td(e),e):(Td(e),null);if(e.flags&128)throw Error(Lt(558))}return Za(e),null;case 13:if(n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(i=Yk(e),n!==null&&n.dehydrated!==null){if(t===null){if(!i)throw Error(Lt(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Lt(317));i[ec]=e}else iA(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Za(e),i=!1}else i=hoe(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),i=!0;if(!i)return e.flags&256?(Td(e),e):(Td(e),null)}return Td(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),vV(e,e.updateQueue),Za(e),null);case 4:return Rk(),t===null&&Sse(e.stateNode.containerInfo),Za(e),null;case 10:return Iv(e.type),Za(e),null;case 19:if(wl(os),n=e.memoizedState,n===null)return Za(e),null;if(i=(e.flags&128)!==0,a=n.rendering,a===null)if(i)a6(n,!1);else{if(Uo!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(a=iV(t),a!==null){for(e.flags|=128,a6(n,!1),t=a.updateQueue,e.updateQueue=t,vV(e,t),e.subtreeFlags=0,t=r,r=e.child;r!==null;)kPe(r,t),r=r.sibling;return Ia(os,os.current&1|2),Ci&&Lv(e,n.treeForkCount),e.child}t=t.sibling}n.tail!==null&&yd()>AV&&(e.flags|=128,i=!0,a6(n,!1),e.lanes=4194304)}else{if(!i)if(t=iV(a),t!==null){if(e.flags|=128,i=!0,t=t.updateQueue,e.updateQueue=t,vV(e,t),a6(n,!0),n.tail===null&&n.tailMode==="hidden"&&!a.alternate&&!Ci)return Za(e),null}else 2*yd()-n.renderingStartTime>AV&&r!==536870912&&(e.flags|=128,i=!0,a6(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=yd(),t.sibling=null,r=os.current,Ia(os,i?r&1|2:r&1),Ci&&Lv(e,n.treeForkCount),t):(Za(e),null);case 22:case 23:return Td(e),Toe(),n=e.memoizedState!==null,t!==null?t.memoizedState!==null!==n&&(e.flags|=8192):n&&(e.flags|=8192),n?r&536870912&&!(e.flags&128)&&(Za(e),e.subtreeFlags&6&&(e.flags|=8192)):Za(e),r=e.updateQueue,r!==null&&vV(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&&wl(sA),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),e.memoizedState.cache!==r&&(e.flags|=2048),Iv(Cs),Za(e),null;case 25:return null;case 30:return null}throw Error(Lt(156,e.tag))}function Xlr(t,e){switch(coe(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Iv(Cs),Rk(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return EU(e),null;case 31:if(e.memoizedState!==null){if(Td(e),e.alternate===null)throw Error(Lt(340));iA()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(Td(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Lt(340));iA()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return wl(os),null;case 4:return Rk(),null;case 10:return Iv(e.type),null;case 22:case 23:return Td(e),Toe(),t!==null&&wl(sA),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Iv(Cs),null;case 25:return null;default:return null}}function eNe(t,e){switch(coe(e),e.tag){case 3:Iv(Cs),Rk();break;case 26:case 27:case 5:EU(e);break;case 4:Rk();break;case 31:e.memoizedState!==null&&Td(e);break;case 13:Td(e);break;case 19:wl(os);break;case 10:Iv(e.type);break;case 22:case 23:Td(e),Toe(),t!==null&&wl(sA);break;case 24:Iv(Cs)}}function o6(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,o=r.inst;n=a(),o.destroy=n}r=r.next}while(r!==i)}}catch(s){la(e,e.return,s)}}function Qb(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 o=n.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=e;var l=r,u=s;try{u()}catch(h){la(i,l,h)}}}n=n.next}while(n!==a)}}catch(h){la(e,e.return,h)}}function tNe(t){var e=t.updateQueue;if(e!==null){var r=t.stateNode;try{HPe(e,r)}catch(n){la(t,t.return,n)}}}function rNe(t,e,r){r.props=dA(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(n){la(t,e,n)}}function s6(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){la(t,e,i)}}function dm(t,e){var r=t.ref,n=t.refCleanup;if(r!==null)if(typeof n=="function")try{n()}catch(i){la(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){la(t,e,i)}else r.current=null}function nNe(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){la(t,t.return,i)}}function rse(t,e,r){try{var n=t.stateNode;ycr(n,t.type,r,e),n[Ah]=e}catch(i){la(t,t.return,i)}}function iNe(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Xb(t.type)||t.tag===4}function nse(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||iNe(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&&Xb(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 ise(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=_v));else if(n!==4&&(n===27&&Xb(t.type)&&(r=t.stateNode,e=null),t=t.child,t!==null))for(ise(t,e,r),t=t.sibling;t!==null;)ise(t,e,r),t=t.sibling}function yV(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&&Xb(t.type)&&(r=t.stateNode),t=t.child,t!==null))for(yV(t,e,r),t=t.sibling;t!==null;)yV(t,e,r),t=t.sibling}function aNe(t){var e=t.stateNode,r=t.memoizedProps;try{for(var n=t.type,i=e.attributes;i.length;)e.removeAttributeNode(i[0]);ic(e,n,r),e[ec]=t,e[Ah]=r}catch(a){la(t,t.return,a)}}var Fv=!1,Es=!1,ase=!1,oNe=typeof WeakSet=="function"?WeakSet:Set,Sl=null;function Klr(t,e){if(t=t.containerInfo,Ose=FV,t=yPe(t),Zae(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 o=0,s=-1,l=-1,u=0,h=0,d=t,f=null;t:for(;;){for(var p;d!==r||i!==0&&d.nodeType!==3||(s=o+i),d!==a||n!==0&&d.nodeType!==3||(l=o+n),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===t)break t;if(f===r&&++u===i&&(s=o),f===a&&++h===n&&(l=o),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(kse={focusedElem:t,selectionRange:r},FV=!1,Sl=e;Sl!==null;)if(e=Sl,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Sl=t;else for(;Sl!==null;){switch(e=Sl,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"))),ic(a,n,r),a[ec]=t,Al(a),n=a;break e;case"link":var o=d8e("link","href",i).get(n+(r.href||""));if(o){for(var s=0;sv&&(o=v,v=m,m=o);var y=mPe(s,m),b=mPe(s,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=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;sr?32:r,Tn.T=null,r=dse,dse=null;var a=Yb,o=Gv;if(el=0,sE=Yb=null,Gv=0,Wi&6)throw Error(Lt(331));var s=Wi;if(Wi|=4,vNe(a.current),pNe(a,a.current,o,r),Wi=s,f6(0,!1),bd&&typeof bd.onPostCommitFiberRoot=="function")try{bd.onPostCommitFiberRoot(DP,a)}catch{}return!0}finally{Hi.p=i,Tn.T=n,PNe(t,e)}}function BNe(t,e,r){e=Df(r,e),e=Hoe(t.stateNode,e,2),t=zb(t,e,2),t!==null&&(MP(t,2),fm(t))}function la(t,e,r){if(t.tag===3)BNe(t,t,r);else for(;e!==null;){if(e.tag===3){BNe(e,t,r);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Wb===null||!Wb.has(n))){t=Df(r,t),r=$6e(2),n=zb(e,r,2),n!==null&&(F6e(r,n,e,t),MP(n,2),fm(n));break}}e=e.return}}function mse(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new ecr;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)||(lse=!0,i.add(r),t=acr.bind(null,t,e,r),e.then(t,t))}function acr(t,e,r){var n=t.pingCache;n!==null&&n.delete(e),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,Ca===t&&(vi&r)===r&&(Uo===4||Uo===3&&(vi&62914560)===vi&&300>yd()-wV?!(Wi&2)&&lE(t,0):cse|=r,oE===vi&&(oE=0)),fm(t)}function $Ne(t,e){e===0&&(e=LIe()),t=rA(t,e),t!==null&&(MP(t,e),fm(t))}function ocr(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),$Ne(t,r)}function scr(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(Lt(314))}n!==null&&n.delete(e),$Ne(t,r)}function lcr(t,e){return _ae(t,e)}var EV=null,uE=null,vse=!1,_V=!1,yse=!1,jb=0;function fm(t){t!==uE&&t.next===null&&(uE===null?EV=uE=t:uE=uE.next=t),_V=!0,vse||(vse=!0,ucr())}function f6(t,e){if(!yse&&_V){yse=!0;do for(var r=!1,n=EV;n!==null;){if(t!==0){var i=n.pendingLanes;if(i===0)var a=0;else{var o=n.suspendedLanes,s=n.pingedLanes;a=(1<<31-xd(42|t)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(r=!0,VNe(n,a))}else a=vi,a=MU(n,n===Ca?a:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),!(a&3)||LP(n,a)||(r=!0,VNe(n,a));n=n.next}while(r);yse=!1}}function ccr(){FNe()}function FNe(){_V=vse=!1;var t=0;jb!==0&&xcr()&&(t=jb);for(var e=yd(),r=null,n=EV;n!==null;){var i=n.next,a=zNe(n,e);a===0?(n.next=null,r===null?EV=i:r.next=i,i===null&&(uE=r)):(r=n,(t!==0||a&3)&&(_V=!0)),n=i}el!==0&&el!==5||f6(t),jb!==0&&(jb=0)}function zNe(t,e){for(var r=t.suspendedLanes,n=t.pingedLanes,i=t.expirationTimes,a=t.pendingLanes&-62914561;0s)break;var h=l.transferSize,d=l.initiatorType;h&&XNe(d)&&(l=l.responseEnd,o+=h*(l"u"?null:document;function l8e(t,e,r){var n=hE;if(n&&typeof e=="string"&&e){var i=_f(e);i='link[rel="'+t+'"][href="'+i+'"]',typeof r=="string"&&(i+='[crossorigin="'+r+'"]'),s8e.has(i)||(s8e.add(i),t={rel:t,crossOrigin:r,href:e},n.querySelector(i)===null&&(e=n.createElement("link"),ic(e,"link",t),Al(e),n.head.appendChild(e)))}}function _cr(t){Hv.D(t),l8e("dns-prefetch",t,null)}function Rcr(t,e){Hv.C(t,e),l8e("preconnect",t,e)}function Dcr(t,e,r){Hv.L(t,e,r);var n=hE;if(n&&t&&e){var i='link[rel="preload"][as="'+_f(e)+'"]';e==="image"&&r&&r.imageSrcSet?(i+='[imagesrcset="'+_f(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(i+='[imagesizes="'+_f(r.imageSizes)+'"]')):i+='[href="'+_f(t)+'"]';var a=i;switch(e){case"style":a=dE(t);break;case"script":a=fE(t)}Bf.has(a)||(t=Xa({rel:"preload",href:e==="image"&&r&&r.imageSrcSet?void 0:t,as:e},r),Bf.set(a,t),n.querySelector(i)!==null||e==="style"&&n.querySelector(v6(a))||e==="script"&&n.querySelector(y6(a))||(e=n.createElement("link"),ic(e,"link",t),Al(e),n.head.appendChild(e)))}}function Lcr(t,e){Hv.m(t,e);var r=hE;if(r&&t){var n=e&&typeof e.as=="string"?e.as:"script",i='link[rel="modulepreload"][as="'+_f(n)+'"][href="'+_f(t)+'"]',a=i;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=fE(t)}if(!Bf.has(a)&&(t=Xa({rel:"modulepreload",href:t},e),Bf.set(a,t),r.querySelector(i)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(y6(a)))return}n=r.createElement("link"),ic(n,"link",t),Al(n),r.head.appendChild(n)}}}function Mcr(t,e,r){Hv.S(t,e,r);var n=hE;if(n&&t){var i=Ik(n).hoistableStyles,a=dE(t);e=e||"default";var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=n.querySelector(v6(a)))s.loading=5;else{t=Xa({rel:"stylesheet",href:t,"data-precedence":e},r),(r=Bf.get(a))&&Ise(t,r);var l=o=n.createElement("link");Al(l),ic(l,"link",t),l._p=new Promise(function(u,h){l.onload=u,l.onerror=h}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,IV(o,e,n)}o={type:"stylesheet",instance:o,count:1,state:s},i.set(a,o)}}}function Icr(t,e){Hv.X(t,e);var r=hE;if(r&&t){var n=Ik(r).hoistableScripts,i=fE(t),a=n.get(i);a||(a=r.querySelector(y6(i)),a||(t=Xa({src:t,async:!0},e),(e=Bf.get(i))&&Pse(t,e),a=r.createElement("script"),Al(a),ic(a,"link",t),r.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},n.set(i,a))}}function Pcr(t,e){Hv.M(t,e);var r=hE;if(r&&t){var n=Ik(r).hoistableScripts,i=fE(t),a=n.get(i);a||(a=r.querySelector(y6(i)),a||(t=Xa({src:t,async:!0,type:"module"},e),(e=Bf.get(i))&&Pse(t,e),a=r.createElement("script"),Al(a),ic(a,"link",t),r.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},n.set(i,a))}}function c8e(t,e,r,n){var i=(i=Rb.current)?MV(i):null;if(!i)throw Error(Lt(446));switch(t){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(e=dE(r.href),r=Ik(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=dE(r.href);var a=Ik(i).hoistableStyles,o=a.get(t);if(o||(i=i.ownerDocument||i,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(t,o),(a=i.querySelector(v6(t)))&&!a._p&&(o.instance=a,o.state.loading=5),Bf.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},Bf.set(t,r),a||Ncr(i,t,r,o.state))),e&&n===null)throw Error(Lt(528,""));return o}if(e&&n!==null)throw Error(Lt(529,""));return null;case"script":return e=r.async,r=r.src,typeof r=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=fE(r),r=Ik(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(Lt(444,t))}}function dE(t){return'href="'+_f(t)+'"'}function v6(t){return'link[rel="stylesheet"]['+t+"]"}function u8e(t){return Xa({},t,{"data-precedence":t.precedence,precedence:null})}function Ncr(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}),ic(e,"link",r),Al(e),t.head.appendChild(e))}function fE(t){return'[src="'+_f(t)+'"]'}function y6(t){return"script[async]"+t}function h8e(t,e,r){if(e.count++,e.instance===null)switch(e.type){case"style":var n=t.querySelector('style[data-href~="'+_f(r.href)+'"]');if(n)return e.instance=n,Al(n),n;var i=Xa({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return n=(t.ownerDocument||t).createElement("style"),Al(n),ic(n,"style",i),IV(n,r.precedence,t),e.instance=n;case"stylesheet":i=dE(r.href);var a=t.querySelector(v6(i));if(a)return e.state.loading|=4,e.instance=a,Al(a),a;n=u8e(r),(i=Bf.get(i))&&Ise(n,i),a=(t.ownerDocument||t).createElement("link"),Al(a);var o=a;return o._p=new Promise(function(s,l){o.onload=s,o.onerror=l}),ic(a,"link",n),e.state.loading|=4,IV(a,r.precedence,t),e.instance=a;case"script":return a=fE(r.src),(i=t.querySelector(y6(a)))?(e.instance=i,Al(i),i):(n=r,(i=Bf.get(a))&&(n=Xa({},r),Pse(n,i)),t=t.ownerDocument||t,i=t.createElement("script"),Al(i),ic(i,"link",n),t.head.appendChild(i),e.instance=i);case"void":return null;default:throw Error(Lt(443,e.type))}else e.type==="stylesheet"&&!(e.state.loading&4)&&(n=e.instance,e.state.loading|=4,IV(n,r.precedence,t));return e.instance}function IV(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,o=0;o title"):null)}function Bcr(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 p8e(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}function $cr(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=dE(n.href),a=e.querySelector(v6(i));if(a){e=a._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=NV.bind(t),e.then(t,t)),r.state.loading|=4,r.instance=a,Al(a);return}a=e.ownerDocument||e,n=u8e(n),(i=Bf.get(i))&&Ise(n,i),a=a.createElement("link"),Al(a);var o=a;o._p=new Promise(function(s,l){o.onload=s,o.onerror=l}),ic(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=NV.bind(t),e.addEventListener("load",r),e.addEventListener("error",r))}}var Nse=0;function Fcr(t,e){return t.stylesheets&&t.count===0&&$V(t,t.stylesheets),0Nse?50:800)+e);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(n),clearTimeout(i)}}:null}function NV(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$V(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var BV=null;function $V(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,BV=new Map,e.forEach(zcr,t),BV=null,NV.call(t))}function zcr(t,e){if(!(e.state.loading&4)){var r=BV.get(t);if(r)var n=r.get(null);else{r=new Map,BV.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(E8e)}catch(t){console.error(t)}}E8e(),eIe.exports=AU;var qcr=eIe.exports;const _8e={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}})"},R8e={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."},D8e={cnBeijing:"China North 2 (Beijing)",cnShanghai:"China East 2 (Shanghai)"},L8e={runtimeUnsupported:"This Runtime does not currently support connections. Confirm that the service is running normally."},M8e={autoConfigureFailed:"Failed to configure the Feishu bot automatically"},I8e={actionFailed:"Failed to {{action}}",detail:"Details: {{detail}}",request:"Request: {{request}}"},P8e={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: Try again later, and review the Runtime, model, or gateway logs.",modelQuotaHint:"Tip: The model has reached its TPM/RPM quota. Try again later or increase the model quota.",rawResponseLabel:"Raw response: "},N8e={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"},B8e={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"},$8e={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",sharedSpaceFailed:"Shared space unavailable",reservedSpaceName:"This name is reserved for a system space; choose another name",reviewSpaceFailed:"The review space is unavailable",submitReviewFailed:"Could not submit the publication request",listReviewsFailed:"Could not load review requests",reviewFilesFailed:"Could not load submitted files",decideReviewFailed:"Review failed, please try again",listVersionsFailed:"Unable to load skill versions",uploadVersionFailed:"Unable to upload the new skill version"},F8e={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}}"},z8e={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."},U8e={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"},V8e={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"},Q8e={listFailed:"Failed to load website integrations",createFailed:"Failed to create the website integration",deleteFailed:"Failed to delete the website integration"},G8e={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}})"},H8e={invalidName:"Names must contain 1–128 characters, without control or invisible formatting characters, or < >.",renameProjectFailed:"Unable to update the project name",renameVersionFailed:"Unable to update the version name",invalidNameUpdateResponse:"The name update response does not match the request. Refresh and try again.",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."},W8e={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",evaluation:{datasetSaveFailed:"Failed to save evaluation cases",datasetLoadFailed:"Failed to load evaluation cases",statusLoadFailed:"Failed to load evaluation status",resumeFailed:"Failed to continue evaluation",retryFailed:"Failed to retry evaluation",reportLoadFailed:"Failed to load the evaluation report",reportDownloadFailed:"Failed to download the evaluation report"},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",evaluationAsset:"Evaluation asset",evaluation:"Evaluation status",evaluationCapabilities:"Evaluation capabilities",evaluationDimension:"Evaluation dimension",evaluationCase:"Evaluation case",evaluationCriteria:"Evaluation criteria",evaluationMessage:"Evaluation conversation",evaluationDataset:"Evaluation dataset",evaluationDimensionResult:"Evaluation dimension result",evaluationEvidence:"Evaluation evidence",evaluationReport:"Evaluation report",evaluationSummary:"Evaluation summary",evaluationCaseResult:"Evaluation case result",evaluationOutput:"Evaluation output",evaluationLimitations:"Evaluation limitations"}},Y8e={status:{ready:"Ready",wakeable:"Asleep",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 agent to wake was not found.",resumeSnapshotFailed:"Unable to wake the agent. Try again later.",deleteSnapshotFailed:"Unable to delete the agent. Try again later.",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."},q8e={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 Eae=Object.prototype.hasOwnProperty,_ae=Js.unstable_scheduleCallback,Rae=Js.unstable_cancelCallback,_sr=Js.unstable_shouldYield,Rsr=Js.unstable_requestPaint,yd=Js.unstable_now,Dsr=Js.unstable_getCurrentPriorityLevel,_Ie=Js.unstable_ImmediatePriority,RIe=Js.unstable_UserBlockingPriority,_U=Js.unstable_NormalPriority,Lsr=Js.unstable_LowPriority,DIe=Js.unstable_IdlePriority,Msr=Js.log,Isr=Js.unstable_setDisableYieldValue,DP=null,bd=null;function Db(t){if(typeof Msr=="function"&&Isr(t),bd&&typeof bd.setStrictMode=="function")try{bd.setStrictMode(DP,t)}catch{}}var xd=Math.clz32?Math.clz32:Bsr,Psr=Math.log,Nsr=Math.LN2;function Bsr(t){return t>>>=0,t===0?32:31-(Psr(t)/Nsr|0)|0}var RU=256,DU=262144,LU=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 MU(t,e,r){var n=t.pendingLanes;if(n===0)return 0;var i=0,a=t.suspendedLanes,o=t.pingedLanes;t=t.warmLanes;var s=n&134217727;return s!==0?(n=s&~a,n!==0?i=Kw(n):(o&=s,o!==0?i=Kw(o):r||(r=s&~t,r!==0&&(i=Kw(r))))):(s=n&~a,s!==0?i=Kw(s):o!==0?i=Kw(o):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 LP(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function $sr(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 LIe(){var t=LU;return LU<<=1,!(LU&62914560)&&(LU=4194304),t}function Dae(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function MP(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Fsr(t,e,r,n,i,a){var o=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 s=t.entanglements,l=t.expirationTimes,u=t.hiddenUpdates;for(r=o&~r;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Hsr=/[\n"\\]/g;function _f(t){return t.replace(Hsr,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Bae(t,e,r,n,i,a,o,s){t.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.type=o:t.removeAttribute("type"),e!=null?o==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+Ef(e)):t.value!==""+Ef(e)&&(t.value=""+Ef(e)):o!=="submit"&&o!=="reset"||t.removeAttribute("value"),e!=null?$ae(t,o,Ef(e)):r!=null?$ae(t,o,Ef(r)):n!=null&&t.removeAttribute("value"),i==null&&a!=null&&(t.defaultChecked=!!a),i!=null&&(t.checked=i&&typeof i!="function"&&typeof i!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?t.name=""+Ef(s):t.removeAttribute("name")}function HIe(t,e,r,n,i,a,o,s){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)){Nae(t);return}r=r!=null?""+Ef(r):"",e=e!=null?""+Ef(e):r,s||e===t.value||(t.value=e),t.defaultValue=e}n=n??i,n=typeof n!="function"&&typeof n!="symbol"&&!!n,t.checked=s?t.checked:!!n,t.defaultChecked=!!n,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.name=o),Nae(t)}function $ae(t,e,r){e==="number"&&NU(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function Nk(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"),Qae=!1;if(Rv)try{var BP={};Object.defineProperty(BP,"passive",{get:function(){Qae=!0}}),window.addEventListener("test",BP,BP),window.removeEventListener("test",BP,BP)}catch{Qae=!1}var Mb=null,Gae=null,$U=null;function ZIe(){if($U)return $U;var t,e=Gae,r=e.length,n,i="value"in Mb?Mb.value:Mb.textContent,a=i.length;for(t=0;t=zP),iPe=" ",aPe=!1;function oPe(t,e){switch(t){case"keyup":return blr.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sPe(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var zk=!1;function wlr(t,e){switch(t){case"compositionend":return sPe(e);case"keypress":return e.which!==32?null:(aPe=!0,iPe);case"textInput":return t=e.data,t===iPe&&aPe?null:t;default:return null}}function Alr(t,e){if(zk)return t==="compositionend"||!jae&&oPe(t,e)?(t=ZIe(),$U=Gae=Mb=null,zk=!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=gPe(r)}}function vPe(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?vPe(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function yPe(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=NU(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=NU(t.document)}return e}function Zae(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 Rlr=Rv&&"documentMode"in document&&11>=document.documentMode,Uk=null,Jae=null,GP=null,eoe=!1;function bPe(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;eoe||Uk==null||Uk!==NU(n)||(n=Uk,"selectionStart"in n&&Zae(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}),GP&&QP(GP,n)||(GP=n,n=DV(Jae,"onSelect"),0>=o,i-=o,um=1<<32-xd(e)+i|r<C?(k=T,T=null):k=T.sibling;var E=f(y,T,x[C],w);if(E===null){T===null&&(T=k);break}t&&T&&E.alternate===null&&e(y,T),b=a(E,b,C),S===null?A=E:S.sibling=E,S=E,T=k}if(C===x.length)return r(y,T),Ci&&Lv(y,C),A;if(T===null){for(;CC?(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,C),S===null?A=_:S.sibling=_,S=_,T=k}if(E.done)return r(y,T),Ci&&Lv(y,C),A;if(T===null){for(;!E.done;C++,E=x.next())E=d(y,E.value,w),E!==null&&(b=a(E,b,C),S===null?A=E:S.sibling=E,S=E);return Ci&&Lv(y,C),A}for(T=n(T);!E.done;C++,E=x.next())E=p(T,y,C,E.value,w),E!==null&&(t&&E.alternate!==null&&T.delete(E.key===null?C:E.key),b=a(E,b,C),S===null?A=E:S.sibling=E,S=E);return t&&T.forEach(function(P){return e(y,P)}),Ci&&Lv(y,C),A}function v(y,b,x,w){if(typeof x=="object"&&x!==null&&x.type===Ek&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case CU:e:{for(var A=x.key;b!==null;){if(b.key===A){if(A=x.type,A===Ek){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===_b&&lA(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===Ek?(w=nA(x.props.children,y.mode,w,x.key),w.return=y,y=w):(w=qU(x.type,x.key,x.props,null,y.mode,w),XP(w,x),w.return=y,y=w)}return o(y);case kP: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=soe(x,y.mode,w),w.return=y,y=w}return o(y);case _b:return x=lA(x),v(y,b,x,w)}if(_P(x))return g(y,b,x,w);if(EP(x)){if(A=EP(x),typeof A!="function")throw Error(Lt(150));return x=A.call(x),m(y,b,x,w)}if(typeof x.then=="function")return v(y,b,tV(x),w);if(x.$$typeof===kv)return v(y,b,KU(y,x),w);rV(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=ooe(x,y.mode,w),w.return=y,y=w),o(y)):r(y,b)}return function(y,b,x,w){try{jP=0;var A=v(y,b,x,w);return Zk=null,A}catch(T){if(T===Kk||T===JU)throw T;var S=Ad(29,T,null,y.mode);return S.lanes=w,S.return=y,S}finally{}}}var uA=VPe(!0),QPe=VPe(!1),$b=!1;function boe(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xoe(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 Fb(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function zb(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,Wi&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,e=YU(t),OPe(t,null,r),e}return WU(t,n,e,r),YU(t)}function KP(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,IIe(t,r)}}function woe(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 o={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,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 Aoe=!1;function ZP(){if(Aoe){var t=Xk;if(t!==null)throw t}}function JP(t,e,r,n){Aoe=!1;var i=t.updateQueue;$b=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,o===null?a=u:o.next=u,o=l;var h=t.alternate;h!==null&&(h=h.updateQueue,s=h.lastBaseUpdate,s!==o&&(s===null?h.firstBaseUpdate=u:s.next=u,h.lastBaseUpdate=l))}if(a!==null){var d=i.baseState;o=0,h=u=l=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(vi&f)===f:(n&f)===f){f!==0&&f===jk&&(Aoe=!0),h!==null&&(h=h.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var g=t,m=s;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=Xa({},d,f);break e;case 2:$b=!0}}f=s.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:s.tag,payload:s.payload,callback:s.callback,next:null},h===null?(u=h=p,l=d):h=h.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=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),Hb|=o,t.lanes=o,t.memoizedState=d}}function GPe(t,e){if(typeof t!="function")throw Error(Lt(191,t));t.call(e)}function HPe(t,e){var r=t.callbacks;if(r!==null)for(t.callbacks=null,t=0;ta?a:8;var o=Tn.T,s={};Tn.T=s,Uoe(t,!1,e,r);try{var l=i(),u=Tn.S;if(u!==null&&u(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var h=Flr(l,n);r6(t,e,h,kd(t))}else r6(t,e,n,kd(t))}catch(d){r6(t,e,{then:function(){},status:"rejected",reason:d},kd())}finally{Hi.p=a,o!==null&&s.types!==null&&(o.types=s.types),Tn.T=o}}function Hlr(){}function Foe(t,e,r,n){if(t.tag!==5)throw Error(Lt(476));var i=S6e(t).queue;A6e(t,i,e,jw,r===null?Hlr:function(){return T6e(t),r(n)})}function S6e(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:jw,baseState:jw,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nv,lastRenderedState:jw},next:null};var r={};return e.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nv,lastRenderedState:r},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function T6e(t){var e=S6e(t);e.next===null&&(e=t.alternate.memoizedState),r6(t,e.next.queue,{},kd())}function zoe(){return rc(b6)}function C6e(){return ss().memoizedState}function O6e(){return ss().memoizedState}function Wlr(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var r=kd();t=Fb(r);var n=zb(e,t,r);n!==null&&(Eh(n,e,r),KP(n,e,r)),e={cache:goe()},t.payload=e;return}e=e.return}}function Ylr(t,e,r){var n=kd();r={lane:n,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},dV(t)?E6e(e,r):(r=ioe(t,e,r,n),r!==null&&(Eh(r,t,n),_6e(r,e,n)))}function k6e(t,e,r){var n=kd();r6(t,e,r,n)}function r6(t,e,r,n){var i={lane:n,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(dV(t))E6e(e,i);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var o=e.lastRenderedState,s=a(o,r);if(i.hasEagerState=!0,i.eagerState=s,wd(s,o))return WU(t,e,i,0),Ca===null&&HU(),!1}catch{}finally{}if(r=ioe(t,e,i,n),r!==null)return Eh(r,t,n),_6e(r,e,n),!0}return!1}function Uoe(t,e,r,n){if(n={lane:2,revertLane:bse(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},dV(t)){if(e)throw Error(Lt(479))}else e=ioe(t,r,n,2),e!==null&&Eh(e,t,2)}function dV(t){var e=t.alternate;return t===Qn||e!==null&&e===Qn}function E6e(t,e){eE=aV=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function _6e(t,e,r){if(r&4194048){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,IIe(t,r)}}var n6={readContext:rc,use:lV,useCallback:zo,useContext:zo,useEffect:zo,useImperativeHandle:zo,useLayoutEffect:zo,useInsertionEffect:zo,useMemo:zo,useReducer:zo,useRef:zo,useState:zo,useDebugValue:zo,useDeferredValue:zo,useTransition:zo,useSyncExternalStore:zo,useId:zo,useHostTransitionStatus:zo,useFormState:zo,useActionState:zo,useOptimistic:zo,useMemoCache:zo,useCacheRefresh:zo};n6.useEffectEvent=zo;var R6e={readContext:rc,use:lV,useCallback:function(t,e){return wu().memoizedState=[t,e===void 0?null:e],t},useContext:rc,useEffect:f6e,useImperativeHandle:function(t,e,r){r=r!=null?r.concat([t]):null,uV(4194308,4,v6e.bind(null,e,t),r)},useLayoutEffect:function(t,e){return uV(4194308,4,t,e)},useInsertionEffect:function(t,e){uV(4,2,t,e)},useMemo:function(t,e){var r=wu();e=e===void 0?null:e;var n=t();if(hA){Db(!0);try{t()}finally{Db(!1)}}return r.memoizedState=[n,e],n},useReducer:function(t,e,r){var n=wu();if(r!==void 0){var i=r(e);if(hA){Db(!0);try{r(e)}finally{Db(!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=Ylr.bind(null,Qn,t),[n.memoizedState,t]},useRef:function(t){var e=wu();return t={current:t},e.memoizedState=t},useState:function(t){t=Ioe(t);var e=t.queue,r=k6e.bind(null,Qn,e);return e.dispatch=r,[t.memoizedState,r]},useDebugValue:Boe,useDeferredValue:function(t,e){var r=wu();return $oe(r,t,e)},useTransition:function(){var t=Ioe(!1);return t=A6e.bind(null,Qn,t.queue,!0,!1),wu().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,r){var n=Qn,i=wu();if(Ci){if(r===void 0)throw Error(Lt(407));r=r()}else{if(r=e(),Ca===null)throw Error(Lt(349));vi&127||KPe(n,e,r)}i.memoizedState=r;var a={value:r,getSnapshot:e};return i.queue=a,f6e(JPe.bind(null,n,a,t),[t]),n.flags|=2048,rE(9,{destroy:void 0},ZPe.bind(null,n,a,r,e),null),r},useId:function(){var t=wu(),e=Ca.identifierPrefix;if(Ci){var r=hm,n=um;r=(n&~(1<<32-xd(n)-1)).toString(32)+r,e="_"+e+"R_"+r,r=oV++,0<\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof n.is=="string"?o.createElement("select",{is:n.is}):o.createElement("select"),n.multiple?a.multiple=!0:n.size&&(a.size=n.size);break;default:a=typeof n.is=="string"?o.createElement(i,{is:n.is}):o.createElement(i)}}a[ec]=e,a[Ah]=n;e:for(o=e.child;o!==null;){if(o.tag===5||o.tag===6)a.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===e)break e;for(;o.sibling===null;){if(o.return===null||o.return===e)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}e.stateNode=a;e:switch(ic(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&&$v(e)}}return Za(e),tse(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,r),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==n&&$v(e);else{if(typeof n!="string"&&e.stateNode===null)throw Error(Lt(166));if(t=Rb.current,Yk(e)){if(t=e.stateNode,r=e.memoizedProps,n=null,i=tc,i!==null)switch(i.tag){case 27:case 5:n=i.memoizedProps}t[ec]=e,t=!!(t.nodeValue===r||n!==null&&n.suppressHydrationWarning===!0||jNe(t.nodeValue,r)),t||Nb(e,!0)}else t=LV(t).createTextNode(n),t[ec]=e,e.stateNode=t}return Za(e),null;case 31:if(r=e.memoizedState,t===null||t.memoizedState!==null){if(n=Yk(e),r!==null){if(t===null){if(!n)throw Error(Lt(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Lt(557));t[ec]=e}else iA(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Za(e),t=!1}else r=hoe(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),t=!0;if(!t)return e.flags&256?(Td(e),e):(Td(e),null);if(e.flags&128)throw Error(Lt(558))}return Za(e),null;case 13:if(n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(i=Yk(e),n!==null&&n.dehydrated!==null){if(t===null){if(!i)throw Error(Lt(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Lt(317));i[ec]=e}else iA(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Za(e),i=!1}else i=hoe(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),i=!0;if(!i)return e.flags&256?(Td(e),e):(Td(e),null)}return Td(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),vV(e,e.updateQueue),Za(e),null);case 4:return Rk(),t===null&&Sse(e.stateNode.containerInfo),Za(e),null;case 10:return Iv(e.type),Za(e),null;case 19:if(wl(os),n=e.memoizedState,n===null)return Za(e),null;if(i=(e.flags&128)!==0,a=n.rendering,a===null)if(i)a6(n,!1);else{if(Uo!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(a=iV(t),a!==null){for(e.flags|=128,a6(n,!1),t=a.updateQueue,e.updateQueue=t,vV(e,t),e.subtreeFlags=0,t=r,r=e.child;r!==null;)kPe(r,t),r=r.sibling;return Ia(os,os.current&1|2),Ci&&Lv(e,n.treeForkCount),e.child}t=t.sibling}n.tail!==null&&yd()>AV&&(e.flags|=128,i=!0,a6(n,!1),e.lanes=4194304)}else{if(!i)if(t=iV(a),t!==null){if(e.flags|=128,i=!0,t=t.updateQueue,e.updateQueue=t,vV(e,t),a6(n,!0),n.tail===null&&n.tailMode==="hidden"&&!a.alternate&&!Ci)return Za(e),null}else 2*yd()-n.renderingStartTime>AV&&r!==536870912&&(e.flags|=128,i=!0,a6(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=yd(),t.sibling=null,r=os.current,Ia(os,i?r&1|2:r&1),Ci&&Lv(e,n.treeForkCount),t):(Za(e),null);case 22:case 23:return Td(e),Toe(),n=e.memoizedState!==null,t!==null?t.memoizedState!==null!==n&&(e.flags|=8192):n&&(e.flags|=8192),n?r&536870912&&!(e.flags&128)&&(Za(e),e.subtreeFlags&6&&(e.flags|=8192)):Za(e),r=e.updateQueue,r!==null&&vV(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&&wl(sA),null;case 24:return r=null,t!==null&&(r=t.memoizedState.cache),e.memoizedState.cache!==r&&(e.flags|=2048),Iv(Cs),Za(e),null;case 25:return null;case 30:return null}throw Error(Lt(156,e.tag))}function Zlr(t,e){switch(coe(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Iv(Cs),Rk(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return EU(e),null;case 31:if(e.memoizedState!==null){if(Td(e),e.alternate===null)throw Error(Lt(340));iA()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(Td(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Lt(340));iA()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return wl(os),null;case 4:return Rk(),null;case 10:return Iv(e.type),null;case 22:case 23:return Td(e),Toe(),t!==null&&wl(sA),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Iv(Cs),null;case 25:return null;default:return null}}function eNe(t,e){switch(coe(e),e.tag){case 3:Iv(Cs),Rk();break;case 26:case 27:case 5:EU(e);break;case 4:Rk();break;case 31:e.memoizedState!==null&&Td(e);break;case 13:Td(e);break;case 19:wl(os);break;case 10:Iv(e.type);break;case 22:case 23:Td(e),Toe(),t!==null&&wl(sA);break;case 24:Iv(Cs)}}function o6(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,o=r.inst;n=a(),o.destroy=n}r=r.next}while(r!==i)}}catch(s){la(e,e.return,s)}}function Qb(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 o=n.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=e;var l=r,u=s;try{u()}catch(h){la(i,l,h)}}}n=n.next}while(n!==a)}}catch(h){la(e,e.return,h)}}function tNe(t){var e=t.updateQueue;if(e!==null){var r=t.stateNode;try{HPe(e,r)}catch(n){la(t,t.return,n)}}}function rNe(t,e,r){r.props=dA(t.type,t.memoizedProps),r.state=t.memoizedState;try{r.componentWillUnmount()}catch(n){la(t,e,n)}}function s6(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){la(t,e,i)}}function dm(t,e){var r=t.ref,n=t.refCleanup;if(r!==null)if(typeof n=="function")try{n()}catch(i){la(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){la(t,e,i)}else r.current=null}function nNe(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){la(t,t.return,i)}}function rse(t,e,r){try{var n=t.stateNode;xcr(n,t.type,r,e),n[Ah]=e}catch(i){la(t,t.return,i)}}function iNe(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Xb(t.type)||t.tag===4}function nse(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||iNe(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&&Xb(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 ise(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=_v));else if(n!==4&&(n===27&&Xb(t.type)&&(r=t.stateNode,e=null),t=t.child,t!==null))for(ise(t,e,r),t=t.sibling;t!==null;)ise(t,e,r),t=t.sibling}function yV(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&&Xb(t.type)&&(r=t.stateNode),t=t.child,t!==null))for(yV(t,e,r),t=t.sibling;t!==null;)yV(t,e,r),t=t.sibling}function aNe(t){var e=t.stateNode,r=t.memoizedProps;try{for(var n=t.type,i=e.attributes;i.length;)e.removeAttributeNode(i[0]);ic(e,n,r),e[ec]=t,e[Ah]=r}catch(a){la(t,t.return,a)}}var Fv=!1,Es=!1,ase=!1,oNe=typeof WeakSet=="function"?WeakSet:Set,Sl=null;function Jlr(t,e){if(t=t.containerInfo,Ose=FV,t=yPe(t),Zae(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 o=0,s=-1,l=-1,u=0,h=0,d=t,f=null;t:for(;;){for(var p;d!==r||i!==0&&d.nodeType!==3||(s=o+i),d!==a||n!==0&&d.nodeType!==3||(l=o+n),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===t)break t;if(f===r&&++u===i&&(s=o),f===a&&++h===n&&(l=o),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(kse={focusedElem:t,selectionRange:r},FV=!1,Sl=e;Sl!==null;)if(e=Sl,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Sl=t;else for(;Sl!==null;){switch(e=Sl,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"))),ic(a,n,r),a[ec]=t,Al(a),n=a;break e;case"link":var o=d8e("link","href",i).get(n+(r.href||""));if(o){for(var s=0;sv&&(o=v,v=m,m=o);var y=mPe(s,m),b=mPe(s,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=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;sr?32:r,Tn.T=null,r=dse,dse=null;var a=Yb,o=Gv;if(el=0,sE=Yb=null,Gv=0,Wi&6)throw Error(Lt(331));var s=Wi;if(Wi|=4,vNe(a.current),pNe(a,a.current,o,r),Wi=s,f6(0,!1),bd&&typeof bd.onPostCommitFiberRoot=="function")try{bd.onPostCommitFiberRoot(DP,a)}catch{}return!0}finally{Hi.p=i,Tn.T=n,PNe(t,e)}}function BNe(t,e,r){e=Df(r,e),e=Hoe(t.stateNode,e,2),t=zb(t,e,2),t!==null&&(MP(t,2),fm(t))}function la(t,e,r){if(t.tag===3)BNe(t,t,r);else for(;e!==null;){if(e.tag===3){BNe(e,t,r);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Wb===null||!Wb.has(n))){t=Df(r,t),r=$6e(2),n=zb(e,r,2),n!==null&&(F6e(r,n,e,t),MP(n,2),fm(n));break}}e=e.return}}function mse(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new rcr;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)||(lse=!0,i.add(r),t=scr.bind(null,t,e,r),e.then(t,t))}function scr(t,e,r){var n=t.pingCache;n!==null&&n.delete(e),t.pingedLanes|=t.suspendedLanes&r,t.warmLanes&=~r,Ca===t&&(vi&r)===r&&(Uo===4||Uo===3&&(vi&62914560)===vi&&300>yd()-wV?!(Wi&2)&&lE(t,0):cse|=r,oE===vi&&(oE=0)),fm(t)}function $Ne(t,e){e===0&&(e=LIe()),t=rA(t,e),t!==null&&(MP(t,e),fm(t))}function lcr(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),$Ne(t,r)}function ccr(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(Lt(314))}n!==null&&n.delete(e),$Ne(t,r)}function ucr(t,e){return _ae(t,e)}var EV=null,uE=null,vse=!1,_V=!1,yse=!1,jb=0;function fm(t){t!==uE&&t.next===null&&(uE===null?EV=uE=t:uE=uE.next=t),_V=!0,vse||(vse=!0,dcr())}function f6(t,e){if(!yse&&_V){yse=!0;do for(var r=!1,n=EV;n!==null;){if(t!==0){var i=n.pendingLanes;if(i===0)var a=0;else{var o=n.suspendedLanes,s=n.pingedLanes;a=(1<<31-xd(42|t)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(r=!0,VNe(n,a))}else a=vi,a=MU(n,n===Ca?a:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),!(a&3)||LP(n,a)||(r=!0,VNe(n,a));n=n.next}while(r);yse=!1}}function hcr(){FNe()}function FNe(){_V=vse=!1;var t=0;jb!==0&&Acr()&&(t=jb);for(var e=yd(),r=null,n=EV;n!==null;){var i=n.next,a=zNe(n,e);a===0?(n.next=null,r===null?EV=i:r.next=i,i===null&&(uE=r)):(r=n,(t!==0||a&3)&&(_V=!0)),n=i}el!==0&&el!==5||f6(t),jb!==0&&(jb=0)}function zNe(t,e){for(var r=t.suspendedLanes,n=t.pingedLanes,i=t.expirationTimes,a=t.pendingLanes&-62914561;0s)break;var h=l.transferSize,d=l.initiatorType;h&&XNe(d)&&(l=l.responseEnd,o+=h*(l"u"?null:document;function l8e(t,e,r){var n=hE;if(n&&typeof e=="string"&&e){var i=_f(e);i='link[rel="'+t+'"][href="'+i+'"]',typeof r=="string"&&(i+='[crossorigin="'+r+'"]'),s8e.has(i)||(s8e.add(i),t={rel:t,crossOrigin:r,href:e},n.querySelector(i)===null&&(e=n.createElement("link"),ic(e,"link",t),Al(e),n.head.appendChild(e)))}}function Dcr(t){Hv.D(t),l8e("dns-prefetch",t,null)}function Lcr(t,e){Hv.C(t,e),l8e("preconnect",t,e)}function Mcr(t,e,r){Hv.L(t,e,r);var n=hE;if(n&&t&&e){var i='link[rel="preload"][as="'+_f(e)+'"]';e==="image"&&r&&r.imageSrcSet?(i+='[imagesrcset="'+_f(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(i+='[imagesizes="'+_f(r.imageSizes)+'"]')):i+='[href="'+_f(t)+'"]';var a=i;switch(e){case"style":a=dE(t);break;case"script":a=fE(t)}Bf.has(a)||(t=Xa({rel:"preload",href:e==="image"&&r&&r.imageSrcSet?void 0:t,as:e},r),Bf.set(a,t),n.querySelector(i)!==null||e==="style"&&n.querySelector(v6(a))||e==="script"&&n.querySelector(y6(a))||(e=n.createElement("link"),ic(e,"link",t),Al(e),n.head.appendChild(e)))}}function Icr(t,e){Hv.m(t,e);var r=hE;if(r&&t){var n=e&&typeof e.as=="string"?e.as:"script",i='link[rel="modulepreload"][as="'+_f(n)+'"][href="'+_f(t)+'"]',a=i;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=fE(t)}if(!Bf.has(a)&&(t=Xa({rel:"modulepreload",href:t},e),Bf.set(a,t),r.querySelector(i)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(y6(a)))return}n=r.createElement("link"),ic(n,"link",t),Al(n),r.head.appendChild(n)}}}function Pcr(t,e,r){Hv.S(t,e,r);var n=hE;if(n&&t){var i=Ik(n).hoistableStyles,a=dE(t);e=e||"default";var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=n.querySelector(v6(a)))s.loading=5;else{t=Xa({rel:"stylesheet",href:t,"data-precedence":e},r),(r=Bf.get(a))&&Ise(t,r);var l=o=n.createElement("link");Al(l),ic(l,"link",t),l._p=new Promise(function(u,h){l.onload=u,l.onerror=h}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,IV(o,e,n)}o={type:"stylesheet",instance:o,count:1,state:s},i.set(a,o)}}}function Ncr(t,e){Hv.X(t,e);var r=hE;if(r&&t){var n=Ik(r).hoistableScripts,i=fE(t),a=n.get(i);a||(a=r.querySelector(y6(i)),a||(t=Xa({src:t,async:!0},e),(e=Bf.get(i))&&Pse(t,e),a=r.createElement("script"),Al(a),ic(a,"link",t),r.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},n.set(i,a))}}function Bcr(t,e){Hv.M(t,e);var r=hE;if(r&&t){var n=Ik(r).hoistableScripts,i=fE(t),a=n.get(i);a||(a=r.querySelector(y6(i)),a||(t=Xa({src:t,async:!0,type:"module"},e),(e=Bf.get(i))&&Pse(t,e),a=r.createElement("script"),Al(a),ic(a,"link",t),r.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},n.set(i,a))}}function c8e(t,e,r,n){var i=(i=Rb.current)?MV(i):null;if(!i)throw Error(Lt(446));switch(t){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(e=dE(r.href),r=Ik(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=dE(r.href);var a=Ik(i).hoistableStyles,o=a.get(t);if(o||(i=i.ownerDocument||i,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(t,o),(a=i.querySelector(v6(t)))&&!a._p&&(o.instance=a,o.state.loading=5),Bf.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},Bf.set(t,r),a||$cr(i,t,r,o.state))),e&&n===null)throw Error(Lt(528,""));return o}if(e&&n!==null)throw Error(Lt(529,""));return null;case"script":return e=r.async,r=r.src,typeof r=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=fE(r),r=Ik(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(Lt(444,t))}}function dE(t){return'href="'+_f(t)+'"'}function v6(t){return'link[rel="stylesheet"]['+t+"]"}function u8e(t){return Xa({},t,{"data-precedence":t.precedence,precedence:null})}function $cr(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}),ic(e,"link",r),Al(e),t.head.appendChild(e))}function fE(t){return'[src="'+_f(t)+'"]'}function y6(t){return"script[async]"+t}function h8e(t,e,r){if(e.count++,e.instance===null)switch(e.type){case"style":var n=t.querySelector('style[data-href~="'+_f(r.href)+'"]');if(n)return e.instance=n,Al(n),n;var i=Xa({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return n=(t.ownerDocument||t).createElement("style"),Al(n),ic(n,"style",i),IV(n,r.precedence,t),e.instance=n;case"stylesheet":i=dE(r.href);var a=t.querySelector(v6(i));if(a)return e.state.loading|=4,e.instance=a,Al(a),a;n=u8e(r),(i=Bf.get(i))&&Ise(n,i),a=(t.ownerDocument||t).createElement("link"),Al(a);var o=a;return o._p=new Promise(function(s,l){o.onload=s,o.onerror=l}),ic(a,"link",n),e.state.loading|=4,IV(a,r.precedence,t),e.instance=a;case"script":return a=fE(r.src),(i=t.querySelector(y6(a)))?(e.instance=i,Al(i),i):(n=r,(i=Bf.get(a))&&(n=Xa({},r),Pse(n,i)),t=t.ownerDocument||t,i=t.createElement("script"),Al(i),ic(i,"link",n),t.head.appendChild(i),e.instance=i);case"void":return null;default:throw Error(Lt(443,e.type))}else e.type==="stylesheet"&&!(e.state.loading&4)&&(n=e.instance,e.state.loading|=4,IV(n,r.precedence,t));return e.instance}function IV(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,o=0;o title"):null)}function Fcr(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 p8e(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}function zcr(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=dE(n.href),a=e.querySelector(v6(i));if(a){e=a._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=NV.bind(t),e.then(t,t)),r.state.loading|=4,r.instance=a,Al(a);return}a=e.ownerDocument||e,n=u8e(n),(i=Bf.get(i))&&Ise(n,i),a=a.createElement("link"),Al(a);var o=a;o._p=new Promise(function(s,l){o.onload=s,o.onerror=l}),ic(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=NV.bind(t),e.addEventListener("load",r),e.addEventListener("error",r))}}var Nse=0;function Ucr(t,e){return t.stylesheets&&t.count===0&&$V(t,t.stylesheets),0Nse?50:800)+e);return t.unsuspend=r,function(){t.unsuspend=null,clearTimeout(n),clearTimeout(i)}}:null}function NV(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$V(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var BV=null;function $V(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,BV=new Map,e.forEach(Vcr,t),BV=null,NV.call(t))}function Vcr(t,e){if(!(e.state.loading&4)){var r=BV.get(t);if(r)var n=r.get(null);else{r=new Map,BV.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(E8e)}catch(t){console.error(t)}}E8e(),eIe.exports=AU;var Xcr=eIe.exports;const _8e={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}})"},R8e={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."},D8e={cnBeijing:"China North 2 (Beijing)",cnShanghai:"China East 2 (Shanghai)"},L8e={runtimeUnsupported:"This Runtime does not currently support connections. Confirm that the service is running normally."},M8e={autoConfigureFailed:"Failed to configure the Feishu bot automatically"},I8e={actionFailed:"Failed to {{action}}",detail:"Details: {{detail}}",request:"Request: {{request}}"},P8e={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: Try again later, and review the Runtime, model, or gateway logs.",modelQuotaHint:"Tip: The model has reached its TPM/RPM quota. Try again later or increase the model quota.",rawResponseLabel:"Raw response: "},N8e={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"},B8e={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"},$8e={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",sharedSpaceFailed:"Shared space unavailable",reservedSpaceName:"This name is reserved for a system space; choose another name",reviewSpaceFailed:"The review space is unavailable",submitReviewFailed:"Could not submit the publication request",listReviewsFailed:"Could not load review requests",reviewFilesFailed:"Could not load submitted files",decideReviewFailed:"Review failed, please try again",listVersionsFailed:"Unable to load skill versions",uploadVersionFailed:"Unable to upload the new skill version"},F8e={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}}"},z8e={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."},U8e={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"},V8e={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"},Q8e={listFailed:"Failed to load website integrations",createFailed:"Failed to create the website integration",deleteFailed:"Failed to delete the website integration"},G8e={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}})"},H8e={invalidName:"Names must contain 1–128 characters, without control or invisible formatting characters, or < >.",renameProjectFailed:"Unable to update the project name",renameVersionFailed:"Unable to update the version name",invalidNameUpdateResponse:"The name update response does not match the request. Refresh and try again.",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."},W8e={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.",invalidPendingInput:"Analysis questions are not readable",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",loadEventsFailed:"Failed to follow the migration progress stream",invalidEventsResponse:"The migration progress stream returned an invalid frame.",reconnecting:"Connection lost. Reconnecting to the migration progress stream…",startFailed:"Failed to start the migration",submitAnswersFailed:"Failed to submit additional analysis information",submitInputFailed:"Could not submit the analysis answer",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",evaluation:{datasetSaveFailed:"Failed to save evaluation cases",datasetLoadFailed:"Failed to load evaluation cases",statusLoadFailed:"Failed to load evaluation status",resumeFailed:"Failed to continue evaluation",retryFailed:"Failed to retry evaluation",reportLoadFailed:"Failed to load the evaluation report",reportDownloadFailed:"Failed to download the evaluation report"},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",evaluationAsset:"Evaluation asset",evaluation:"Evaluation status",evaluationCapabilities:"Evaluation capabilities",evaluationDimension:"Evaluation dimension",evaluationCase:"Evaluation case",evaluationCriteria:"Evaluation criteria",evaluationMessage:"Evaluation conversation",evaluationDataset:"Evaluation dataset",evaluationDimensionResult:"Evaluation dimension result",evaluationEvidence:"Evaluation evidence",evaluationReport:"Evaluation report",evaluationSummary:"Evaluation summary",evaluationCaseResult:"Evaluation case result",evaluationOutput:"Evaluation output",evaluationLimitations:"Evaluation limitations",pendingInput:"Analysis question",pendingQuestion:"Analysis question item",pendingOption:"Analysis question option"}},Y8e={status:{ready:"Ready",wakeable:"Asleep",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 agent to wake was not found.",resumeSnapshotFailed:"Unable to wake the agent. Try again later.",deleteSnapshotFailed:"Unable to delete the agent. Try again later.",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."},q8e={invalidSandboxVersion:"Invalid sandbox version response",loadSandboxVersionsFailed:"Failed to check sandbox versions",updateSandboxFailed:"Failed to update sandbox",invalidSandboxUpdate:"Invalid sandbox update response",errorWithDetailAndRawResponse:`{{context}} {{detail}} Response details: {{response}}`,errorWithRawResponse:`{{context}} @@ -55,21 +55,21 @@ Response details: {{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 60 seconds. Try again later, and review the Runtime, model, or gateway logs.",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",loadMcpCredentialsFailed:"Failed to load MCP authentication",invalidMcpCredentials:"Studio returned invalid MCP authentication data",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",errorWithCloudResponse:`{{context}} Cloud API: {{action}} Original cloud response: -{{response}}`,emptyCloudResponse:"(empty response body)"},j8e={loadFailed:"Failed to load conversation mode capabilities (HTTP {{status}})",invalidResponse:"The conversation mode capabilities response has an invalid format"},X8e={nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, {{contentType}}){{detail}}"},K8e={busy:"The workspace is busy. Try again shortly",notFound:"Workspace not found",duplicates:"Multiple personal workspace sessions were found. Contact your administrator",timeout:"Workspace recovery timed out. Your projects are retained. Try again",unavailable:"The workspace cannot be restored right now. Your projects are retained. Try again",persistence:"Persistence is not enabled for this Sandbox. Check the workspace configuration",startup:"Workspace startup failed. Check the Sandbox status",exists:"This project already exists. Open it from the project list",directory:"Project directory not found",configuration:"Configure the workspace Sandbox image first",state:"Could not check workspace status. Try again",list:"Could not restore the workspace or load projects. Try again",create:"Project initialization failed. Check that the image is available and try again",open:"Could not restore the workspace or open the project. Try again",connection:"Could not connect to the workspace. Try again",invalidWorkspaceUrl:"The workspace returned an invalid URL",operation:"Project operation failed. Try again",invalidProjectUrl:"The project URL is invalid",listFallback:"Could not load projects",connectionState:"Could not connect to the workspace. Try again"},Z8e={reporting:"Completing delivery details",packaging:"Preparing artifacts",savingVersion:"Saving version",finishing:"Finishing request",submitResult:"Submit build result",requestFailed:"Task request failed. Please retry.",invalidResponse:"Invalid task state response.",eventGap:"Restoring missing task output.",reconnecting:"Reconnecting. Existing output is preserved.",input:{pending:"Queued",sending:"Confirming delivery",delivered:"Delivered",withdrawn:"Not sent"},plan:"Execution plan",diff:"File changes",preparing:"Preparing task",preparingEnvironment:"Preparing development environment…",connectingEnvironment:"Connecting to development environment…",processing:"Processing request",thinking:"Thinking",read:"Read file · {{target}}",listFiles:"List directory · {{target}}",search:"Search · {{target}}",command:"Run command · {{target}}",editFiles:"Edit files · {{target}}",webSearch:"Search web · {{target}}",processSummary:"Processed {{count}} items",duration:"{{seconds}}s",durationUnits:{milliseconds:"{{value}} ms",hours:"{{value}} h",minutes:"{{value}} min",seconds:"{{value}} s"},failedTools:"{{count}} tools failed",toolFailed:"Failed",toolCalls:"{{count}} tool calls",turnDuration:"Turn elapsed {{duration}}",toolDuration:"Tool time {{duration}}",toolDurationPartial:"Recorded tool time {{duration}}",toolDurationHelp:"Sum of tool durations. Parallel calls can exceed turn elapsed time.",turnStatus:{completed:"Completed",failed:"Failed",interrupted:"Interrupted",cancelled:"Interrupted",unavailable:"Task ended"},notReported:"Not reported",partial:"Recorded",partialHelp:"Usage for this turn may be incomplete.",tokenDetails:"Turn token usage",model:"Turn model",totalTokens:"Total",inputTokens:"Input",cachedInputTokens:"Cached input",uncachedInputTokens:"Uncached input",cacheWriteInputTokens:"Cache write",outputTokens:"Output",reasoningOutputTokens:"Reasoning output",cacheHitRate:"Input cache hit rate",tokenHelp:"Cached input and reasoning output are subsets of input and output. Uncached input = input − cached input."},J8e={common:_8e,agentkitCli:R8e,cloudRegion:D8e,connections:L8e,feishuBot:M8e,requestError:I8e,runSse:P8e,runtimeLogs:N8e,search:B8e,skills:$8e,sse:F8e,identity:z8e,github:U8e,video:V8e,websiteIntegration:Q8e,knowledge:G8e,intelligentDevelopment:H8e,migrations:W8e,sandbox:Y8e,client:q8e,newChatCapabilities:j8e,jsonResponse:X8e,workspaceProjects:K8e,developmentRuns:Z8e},jcr=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:R8e,client:q8e,cloudRegion:D8e,common:_8e,connections:L8e,default:J8e,developmentRuns:Z8e,feishuBot:M8e,github:U8e,identity:z8e,intelligentDevelopment:H8e,jsonResponse:X8e,knowledge:G8e,migrations:W8e,newChatCapabilities:j8e,requestError:I8e,runSse:P8e,runtimeLogs:N8e,sandbox:Y8e,search:B8e,skills:$8e,sse:F8e,video:V8e,websiteIntegration:Q8e,workspaceProjects:K8e},Symbol.toStringTag,{value:"Module"})),eBe="Agent reviews",tBe="Request access for everyone in your organization",rBe="Close",nBe="Refresh",iBe="Status",aBe="Applicant",oBe="Submitted",sBe="Current version",lBe="Model",cBe="Returned by",uBe="Approved by",hBe="Reviewed",dBe="Agent description",fBe="Application notes",pBe="Return reason",gBe="Review comment",mBe="Return reason (required)",vBe="Content changed after submission; return and submit again",yBe="Withdraw to edit this Agent, then submit a new request to publish it",bBe="Other users will lose access to this Agent. Unpublish it?",xBe="Cancel",wBe="Confirm",ABe="Saving",SBe="Unpublish",TBe="Withdraw request",CBe="Approve",OBe="Publish for everyone",kBe="Request publication",EBe="Everyone",_Be={pending:"Pending",approved:"Approved",returned:"Returned",withdrawn:"Withdrawn"},RBe="Search agents or applicants",DBe="Region",LBe="All statuses",MBe="Agent",IBe="Actions",PBe="Review application",NBe="Application details",BBe="No matching applications",$Be="No Agent review requests",FBe="{{count}} / {{limit}} characters",Xcr=Object.freeze(Object.defineProperty({__proto__:null,actions:IBe,agent:MBe,all:LBe,approve:CBe,approvedBy:uBe,cancel:xBe,close:rBe,comment:gBe,confirm:wBe,contentChanged:vBe,default:{title:eBe,dialogDescription:tBe,close:rBe,refresh:nBe,statusTitle:iBe,submitter:aBe,submittedAt:oBe,version:sBe,model:lBe,returnedBy:cBe,approvedBy:uBe,reviewedAt:hBe,description:dBe,message:fBe,reason:pBe,comment:gBe,reasonRequired:mBe,contentChanged:vBe,withdrawConfirm:yBe,unpublishConfirm:bBe,cancel:xBe,confirm:wBe,saving:ABe,unpublish:SBe,withdraw:TBe,return:"Return",approve:CBe,publish:OBe,submit:kBe,private:"Private",enterprise:EBe,status:_Be,search:RBe,region:DBe,all:LBe,agent:MBe,actions:IBe,review:PBe,details:NBe,noMatches:BBe,empty:$Be,textCount:FBe},description:dBe,details:NBe,dialogDescription:tBe,empty:$Be,enterprise:EBe,message:fBe,model:lBe,noMatches:BBe,publish:OBe,reason:pBe,reasonRequired:mBe,refresh:nBe,region:DBe,returnedBy:cBe,review:PBe,reviewedAt:hBe,saving:ABe,search:RBe,status:_Be,statusTitle:iBe,submit:kBe,submittedAt:oBe,submitter:aBe,textCount:FBe,title:eBe,unpublish:SBe,unpublishConfirm:bBe,version:sBe,withdraw:TBe,withdrawConfirm:yBe},Symbol.toStringTag,{value:"Module"})),zBe={backToEvaluationCase:"Back to evaluation case",cancel:"Cancel",copied:"Copied",copy:"Copy",exportConversation:"Export conversation",retry:"Retry"},UBe={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."}},VBe={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"}},QBe={noDescription:"No description",region:"Region",unknownAgent:"Unknown Agent"},GBe={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."},HBe={title:"Configure {{provider}} credentials",prefix:"Agent Workspace requires {{provider}} credentials. Set",and:"and",suffix:"in the runtime environment, then retry."},WBe={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"}},YBe={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."},qBe={like:"Like",removeLike:"Remove like",dislike:"Dislike",removeDislike:"Remove dislike",reportIssue:"Report an issue",traceFlameGraph:"Tracing flame graph"},jBe={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"},XBe={agentCapabilities:"Checking Agent capabilities…",session:"Loading session…"},KBe={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."},ZBe={volcengine:"Volcengine"},JBe={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"},e7e={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}}",codeProjects:"Code projects",reviewCenter:"Review center"},t7e={title:"Create from workspace",description:"Create and manage code projects, then develop and debug in VS Code"},r7e={actions:zBe,addAgent:UBe,approval:VBe,common:QBe,conversation:GBe,credentials:HBe,dialogs:WBe,errors:YBe,feedback:qBe,greetings:jBe,loading:XBe,oauth:KBe,providers:ZBe,sandbox:JBe,titles:e7e,workspaceProjectEntry:t7e},Kcr=Object.freeze(Object.defineProperty({__proto__:null,actions:zBe,addAgent:UBe,approval:VBe,common:QBe,conversation:GBe,credentials:HBe,default:r7e,dialogs:WBe,errors:YBe,feedback:qBe,greetings:jBe,loading:XBe,oauth:KBe,providers:ZBe,sandbox:JBe,titles:e7e,workspaceProjectEntry:t7e},Symbol.toStringTag,{value:"Module"})),n7e="Automations",i7e="Connect development tools and extend your Agents with automated workflows",a7e="Search automations",o7e="Automation categories",s7e={development:"Development",channels:"Messaging channels"},l7e="{{category}} automations",c7e="Open {{name}}",u7e="Available only in local deployments",h7e="No matching automations",d7e="Try searching for another name",f7e="Back to automations",p7e={"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"}}},"gitlab-review":{name:"GitLab MR review",description:"Use a GitLab integration to review merge requests in an isolated Sandbox."},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."}},g7e={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"}}},m7e={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."}},v7e={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."}},Zcr=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:f7e,cards:p7e,categories:s7e,categoriesLabel:o7e,codingAgents:m7e,default:{title:n7e,description:i7e,search:a7e,categoriesLabel:o7e,categories:s7e,resultsLabel:l7e,open:c7e,localOnly:u7e,emptyTitle:h7e,emptyDescription:d7e,backToAutomations:f7e,cards:p7e,github:g7e,codingAgents:m7e,feishu:v7e},description:i7e,emptyDescription:d7e,emptyTitle:h7e,feishu:v7e,github:g7e,localOnly:u7e,open:c7e,resultsLabel:l7e,search:a7e,title:n7e},Symbol.toStringTag,{value:"Module"})),y7e={"zh-CN":"简体中文","en-US":"English"},Jcr=Object.freeze(Object.defineProperty({__proto__:null,default:{languageNames:y7e},languageNames:y7e},Symbol.toStringTag,{value:"Module"})),b7e={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"},x7e={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}}"},w7e={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."},A7e={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"},S7e={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}}"},T7e={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",deployAgent:"Deploy Agent",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"}},C7e={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"},O7e={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"},k7e={placeholder:"Type a message…",inputAria:"Message",generating:"Generating",send:"Send"},E7e={ariaLabel:"Invocation context for this turn",removeSkill:"Remove skill {{name}}",removeAgent:"Remove agent {{name}}"},_7e={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"},R7e={playVideo:"Play video: {{name}}",enlargeImage:"Enlarge image preview: {{name}}",image:"image",enlargeVideo:"Enlarge video",videoPreview:"Video preview",downloadVideo:"Download video",close:"Close"},D7e={annotation:b7e,media:x7e,runtimeLogs:w7e,trace:A7e,share:S7e,blocks:T7e,tokenUsage:C7e,addAgentKit:O7e,composer:k7e,invocation:E7e,visualization:_7e,markdown:R7e},eur=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:O7e,annotation:b7e,blocks:T7e,composer:k7e,default:D7e,invocation:E7e,markdown:R7e,media:x7e,runtimeLogs:w7e,share:S7e,tokenUsage:C7e,trace:A7e,visualization:_7e},Symbol.toStringTag,{value:"Module"})),L7e={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"},M7e={heading:"VeADK agent structure configuration",importHint:"Reload this file from Import YAML on the Create Agent page."},I7e={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"}},P7e={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}}`,emptyCloudResponse:"(empty response body)"},j8e={loadFailed:"Failed to load conversation mode capabilities (HTTP {{status}})",invalidResponse:"The conversation mode capabilities response has an invalid format"},X8e={nonJson:"{{fallback}}: the server returned a non-JSON response (HTTP {{status}}, {{contentType}}){{detail}}"},K8e={busy:"The workspace is busy. Try again shortly",notFound:"Workspace not found",duplicates:"Multiple personal workspace sessions were found. Contact your administrator",timeout:"Workspace recovery timed out. Your projects are retained. Try again",unavailable:"The workspace cannot be restored right now. Your projects are retained. Try again",persistence:"Persistence is not enabled for this Sandbox. Check the workspace configuration",startup:"Workspace startup failed. Check the Sandbox status",exists:"This project already exists. Open it from the project list",directory:"Project directory not found",configuration:"Configure the workspace Sandbox image first",state:"Could not check workspace status. Try again",list:"Could not restore the workspace or load projects. Try again",create:"Project initialization failed. Check that the image is available and try again",open:"Could not restore the workspace or open the project. Try again",connection:"Could not connect to the workspace. Try again",invalidWorkspaceUrl:"The workspace returned an invalid URL",operation:"Project operation failed. Try again",invalidProjectUrl:"The project URL is invalid",listFallback:"Could not load projects",connectionState:"Could not connect to the workspace. Try again"},Z8e={reporting:"Completing delivery details",packaging:"Preparing artifacts",savingVersion:"Saving version",finishing:"Finishing request",submitResult:"Submit build result",requestFailed:"Task request failed. Please retry.",invalidResponse:"Invalid task state response.",eventGap:"Restoring missing task output.",reconnecting:"Reconnecting. Existing output is preserved.",input:{pending:"Queued",sending:"Confirming delivery",delivered:"Delivered",withdrawn:"Not sent"},plan:"Execution plan",diff:"File changes",preparing:"Preparing task",preparingEnvironment:"Preparing development environment…",connectingEnvironment:"Connecting to development environment…",processing:"Processing request",thinking:"Thinking",read:"Read file · {{target}}",listFiles:"List directory · {{target}}",search:"Search · {{target}}",command:"Run command · {{target}}",editFiles:"Edit files · {{target}}",webSearch:"Search web · {{target}}",processSummary:"Processed {{count}} items",duration:"{{seconds}}s",durationUnits:{milliseconds:"{{value}} ms",hours:"{{value}} h",minutes:"{{value}} min",seconds:"{{value}} s"},failedTools:"{{count}} tools failed",toolFailed:"Failed",toolCalls:"{{count}} tool calls",turnDuration:"Turn elapsed {{duration}}",toolDuration:"Tool time {{duration}}",toolDurationPartial:"Recorded tool time {{duration}}",toolDurationHelp:"Sum of tool durations. Parallel calls can exceed turn elapsed time.",turnStatus:{completed:"Completed",failed:"Failed",interrupted:"Interrupted",cancelled:"Interrupted",unavailable:"Task ended"},notReported:"Not reported",partial:"Recorded",partialHelp:"Usage for this turn may be incomplete.",tokenDetails:"Turn token usage",model:"Turn model",totalTokens:"Total",inputTokens:"Input",cachedInputTokens:"Cached input",uncachedInputTokens:"Uncached input",cacheWriteInputTokens:"Cache write",outputTokens:"Output",reasoningOutputTokens:"Reasoning output",cacheHitRate:"Input cache hit rate",tokenHelp:"Cached input and reasoning output are subsets of input and output. Uncached input = input − cached input."},J8e={common:_8e,agentkitCli:R8e,cloudRegion:D8e,connections:L8e,feishuBot:M8e,requestError:I8e,runSse:P8e,runtimeLogs:N8e,search:B8e,skills:$8e,sse:F8e,identity:z8e,github:U8e,video:V8e,websiteIntegration:Q8e,knowledge:G8e,intelligentDevelopment:H8e,migrations:W8e,sandbox:Y8e,client:q8e,newChatCapabilities:j8e,jsonResponse:X8e,workspaceProjects:K8e,developmentRuns:Z8e},Kcr=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:R8e,client:q8e,cloudRegion:D8e,common:_8e,connections:L8e,default:J8e,developmentRuns:Z8e,feishuBot:M8e,github:U8e,identity:z8e,intelligentDevelopment:H8e,jsonResponse:X8e,knowledge:G8e,migrations:W8e,newChatCapabilities:j8e,requestError:I8e,runSse:P8e,runtimeLogs:N8e,sandbox:Y8e,search:B8e,skills:$8e,sse:F8e,video:V8e,websiteIntegration:Q8e,workspaceProjects:K8e},Symbol.toStringTag,{value:"Module"})),eBe="Agent reviews",tBe="Request access for everyone in your organization",rBe="Close",nBe="Refresh",iBe="Status",aBe="Applicant",oBe="Submitted",sBe="Current version",lBe="Model",cBe="Returned by",uBe="Approved by",hBe="Reviewed",dBe="Agent description",fBe="Application notes",pBe="Return reason",gBe="Review comment",mBe="Return reason (required)",vBe="Content changed after submission; return and submit again",yBe="Withdraw to edit this Agent, then submit a new request to publish it",bBe="Other users will lose access to this Agent. Unpublish it?",xBe="Cancel",wBe="Confirm",ABe="Saving",SBe="Unpublish",TBe="Withdraw request",CBe="Approve",OBe="Publish for everyone",kBe="Request publication",EBe="Everyone",_Be={pending:"Pending",approved:"Approved",returned:"Returned",withdrawn:"Withdrawn"},RBe="Search agents or applicants",DBe="Region",LBe="All statuses",MBe="Agent",IBe="Actions",PBe="Review application",NBe="Application details",BBe="No matching applications",$Be="No Agent review requests",FBe="{{count}} / {{limit}} characters",Zcr=Object.freeze(Object.defineProperty({__proto__:null,actions:IBe,agent:MBe,all:LBe,approve:CBe,approvedBy:uBe,cancel:xBe,close:rBe,comment:gBe,confirm:wBe,contentChanged:vBe,default:{title:eBe,dialogDescription:tBe,close:rBe,refresh:nBe,statusTitle:iBe,submitter:aBe,submittedAt:oBe,version:sBe,model:lBe,returnedBy:cBe,approvedBy:uBe,reviewedAt:hBe,description:dBe,message:fBe,reason:pBe,comment:gBe,reasonRequired:mBe,contentChanged:vBe,withdrawConfirm:yBe,unpublishConfirm:bBe,cancel:xBe,confirm:wBe,saving:ABe,unpublish:SBe,withdraw:TBe,return:"Return",approve:CBe,publish:OBe,submit:kBe,private:"Private",enterprise:EBe,status:_Be,search:RBe,region:DBe,all:LBe,agent:MBe,actions:IBe,review:PBe,details:NBe,noMatches:BBe,empty:$Be,textCount:FBe},description:dBe,details:NBe,dialogDescription:tBe,empty:$Be,enterprise:EBe,message:fBe,model:lBe,noMatches:BBe,publish:OBe,reason:pBe,reasonRequired:mBe,refresh:nBe,region:DBe,returnedBy:cBe,review:PBe,reviewedAt:hBe,saving:ABe,search:RBe,status:_Be,statusTitle:iBe,submit:kBe,submittedAt:oBe,submitter:aBe,textCount:FBe,title:eBe,unpublish:SBe,unpublishConfirm:bBe,version:sBe,withdraw:TBe,withdrawConfirm:yBe},Symbol.toStringTag,{value:"Module"})),zBe={backToEvaluationCase:"Back to evaluation case",cancel:"Cancel",copied:"Copied",copy:"Copy",exportConversation:"Export conversation",retry:"Retry"},UBe={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."}},VBe={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"}},QBe={noDescription:"No description",region:"Region",unknownAgent:"Unknown Agent"},GBe={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."},HBe={title:"Configure {{provider}} credentials",prefix:"Agent Workspace requires {{provider}} credentials. Set",and:"and",suffix:"in the runtime environment, then retry."},WBe={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"}},YBe={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."},qBe={like:"Like",removeLike:"Remove like",dislike:"Dislike",removeDislike:"Remove dislike",reportIssue:"Report an issue",traceFlameGraph:"Tracing flame graph"},jBe={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"},XBe={agentCapabilities:"Checking Agent capabilities…",session:"Loading session…"},KBe={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."},ZBe={volcengine:"Volcengine"},JBe={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"},e7e={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}}",codeProjects:"Code projects",reviewCenter:"Review center"},t7e={title:"Create from workspace",description:"Create and manage code projects, then develop and debug in VS Code"},r7e={actions:zBe,addAgent:UBe,approval:VBe,common:QBe,conversation:GBe,credentials:HBe,dialogs:WBe,errors:YBe,feedback:qBe,greetings:jBe,loading:XBe,oauth:KBe,providers:ZBe,sandbox:JBe,titles:e7e,workspaceProjectEntry:t7e},Jcr=Object.freeze(Object.defineProperty({__proto__:null,actions:zBe,addAgent:UBe,approval:VBe,common:QBe,conversation:GBe,credentials:HBe,default:r7e,dialogs:WBe,errors:YBe,feedback:qBe,greetings:jBe,loading:XBe,oauth:KBe,providers:ZBe,sandbox:JBe,titles:e7e,workspaceProjectEntry:t7e},Symbol.toStringTag,{value:"Module"})),n7e="Automations",i7e="Connect development tools and extend your Agents with automated workflows",a7e="Search automations",o7e="Automation categories",s7e={development:"Development",channels:"Messaging channels"},l7e="{{category}} automations",c7e="Open {{name}}",u7e="Available only in local deployments",h7e="No matching automations",d7e="Try searching for another name",f7e="Back to automations",p7e={"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"}}},"gitlab-review":{name:"GitLab MR review",description:"Use a GitLab integration to review merge requests in an isolated Sandbox."},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."}},g7e={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"}}},m7e={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."}},v7e={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."}},eur=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:f7e,cards:p7e,categories:s7e,categoriesLabel:o7e,codingAgents:m7e,default:{title:n7e,description:i7e,search:a7e,categoriesLabel:o7e,categories:s7e,resultsLabel:l7e,open:c7e,localOnly:u7e,emptyTitle:h7e,emptyDescription:d7e,backToAutomations:f7e,cards:p7e,github:g7e,codingAgents:m7e,feishu:v7e},description:i7e,emptyDescription:d7e,emptyTitle:h7e,feishu:v7e,github:g7e,localOnly:u7e,open:c7e,resultsLabel:l7e,search:a7e,title:n7e},Symbol.toStringTag,{value:"Module"})),y7e={"zh-CN":"简体中文","en-US":"English"},tur=Object.freeze(Object.defineProperty({__proto__:null,default:{languageNames:y7e},languageNames:y7e},Symbol.toStringTag,{value:"Module"})),b7e={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"},x7e={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}}"},w7e={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."},A7e={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"},S7e={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}}"},T7e={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",deployAgent:"Deploy Agent",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"}},C7e={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"},O7e={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"},k7e={placeholder:"Type a message…",inputAria:"Message",generating:"Generating",send:"Send"},E7e={ariaLabel:"Invocation context for this turn",removeSkill:"Remove skill {{name}}",removeAgent:"Remove agent {{name}}"},_7e={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"},R7e={playVideo:"Play video: {{name}}",enlargeImage:"Enlarge image preview: {{name}}",image:"image",enlargeVideo:"Enlarge video",videoPreview:"Video preview",downloadVideo:"Download video",close:"Close"},D7e={annotation:b7e,media:x7e,runtimeLogs:w7e,trace:A7e,share:S7e,blocks:T7e,tokenUsage:C7e,addAgentKit:O7e,composer:k7e,invocation:E7e,visualization:_7e,markdown:R7e},rur=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:O7e,annotation:b7e,blocks:T7e,composer:k7e,default:D7e,invocation:E7e,markdown:R7e,media:x7e,runtimeLogs:w7e,share:S7e,tokenUsage:C7e,trace:A7e,visualization:_7e},Symbol.toStringTag,{value:"Module"})),L7e={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"},M7e={heading:"VeADK agent structure configuration",importHint:"Reload this file from Import YAML on the Create Agent page."},I7e={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"}},P7e={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.`},N7e={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",fallbackApiKeyLabel:"{{name}} fallback model {{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"}},B7e={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}}"}},$7e={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."}},F7e={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"}},z7e={title:"Intelligent build",subtitle:"Describe what you need. Build, debug, and validate your agent.",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."},tasks:{title:"Tasks in progress",hint:"Work continues when you leave. Return to follow progress or add instructions.",refresh:"Refresh tasks",loading:"Loading tasks…",empty:"No tasks in progress",emptyHint:"Once a build starts, you can return to it here.",loadError:"Unable to load tasks. Please retry.",openError:"Unable to open this task. Please retry.",startedAt:"Started {{time}}",open:"Open task",opening:"Connecting…",states:{queued:"Queued",running:"Building",recovering:"Reconnecting",waiting_user:"Awaiting your reply",stopping:"Stopping",succeeded:"Completed",failed:"Incomplete",cancelled:"Stopped"}}},U7e={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",defaultVersionName:"Version · {{time}}",rename:{projectTitle:"Edit project name",versionTitle:"Edit version name",projectLabel:"Project name",versionLabel:"Version name",hint:"Use letters, numbers and common punctuation, up to {{max}} characters.",required:"Enter a name.",tooLong:"Names can contain up to {{max}} characters.",invalidCharacters:"Names cannot contain line breaks, control or invisible formatting characters, or < >.",save:"Save name",saving:"Saving…",updated:"Name updated.",failed:"Unable to save the name. Try again."},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"}},V7e={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"}}},Q7e={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"}},G7e={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."}},H7e={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"}},W7e={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",fallbacks:"Fallback models",fallbackPlaceholder:"Fallback model name",addFallback:"Add fallback model",addProviderFallback:"Add other provider",removeFallback:"Remove",fallbackType:"Fallback model type",fallbackSameProvider:"Same provider",fallbackOtherProvider:"Other provider",apiKeyEnv:"API Key environment variable",invalidApiKeyEnv:"Use letters, numbers, and underscores only, and do not start with a number.",fallbackHelp:"Same-provider fallbacks reuse the primary connection. Other providers use separate provider, API base, and API Key settings.",fallbackIgnored:"Empty, duplicate, or primary-model entries will be ignored.",provider:"Provider",invalidApiBase:"Enter a valid http:// or https:// URL.",volcengineArk:"Volcano Ark",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",currentApiKey:"Current API Key",currentConfiguration:"Current configuration",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",apiKeyRequired:"Enter or select the model API Key",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"}},Y7e={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",mcpDuplicateName:"MCP names must be unique",mcpDuplicateUrl:"Remove the duplicate MCP endpoint before publishing",missingSubagent:"A subagent is required",missingPrompt:"System prompt is required",apiKeyRequired:"Enter or select the model API Key",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",fallbacks:"Fallback models",fallbackPlaceholder:"Fallback model name",addFallback:"Add fallback model",addProviderFallback:"Add other provider",removeFallback:"Remove",fallbackType:"Fallback model type",fallbackSameProvider:"Same provider",fallbackOtherProvider:"Other provider",apiKeyEnv:"API Key environment variable",invalidApiKeyEnv:"Use letters, numbers, and underscores only, and do not start with a number.",fallbackHelp:"Same-provider fallbacks reuse the primary connection. Other providers use separate provider, API base, and API Key settings.",fallbackIgnored:"Empty, duplicate, or primary-model entries will be ignored.",provider:"Provider",invalidApiBase:"Enter a valid http:// or https:// URL.",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 is a gateway root address. Use it only when the root path is the MCP endpoint; otherwise include the complete service path.",tokenPlaceholder:"Bearer token (optional)",showToken:"Show Bearer token",hideToken:"Hide Bearer token",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…"}},q7e={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"}},j7e={checkingExpiry:"Checking expiry",waitingRecovery:"Waiting for recovery",listFailed:"Could not load projects",recoveryFailed:"Could not restore the workspace. Try again",operationFailed:"Project operation failed. Try again",title:"Code projects",back:"Back to code projects",restart:"This development environment will restart in {{countdown}}. Save your work regularly",expiresAt:"Expires at {{date}}",exitFullscreen:"Exit full screen",fullscreen:"Full screen",exitFullscreenHint:"Exit full screen (Esc)",recovering:"Restoring your workspace. Your project will reopen automatically",retry:"Retry connection",search:"Search code projects",newTitle:"New code project",new:"New project",readingStats:"Loading project details",createdAt:"Created",opening:"Opening",unknownCreatedAt:"Creation time unknown",open:"Open project",empty:"No matching code projects",close:"Close new project",name:"Project name",placeholder:"e.g. my-agent",nameHelp:"Start with a letter and use letters, numbers, underscores or hyphens, up to 64 characters",cancel:"Cancel",create:"Create project",files_one:"{{count}} file",files_other:"{{count}} files",directories_one:"{{count}} directory",directories_other:"{{count}} directories",separator:", "},X7e={enabled:"Enabled",disabled:"Disabled",unknownStatus:"Unknown status",allPermissions:"All permissions",customPermissions:"Custom permissions",unknownPermissions:"Unknown permissions",unnamed:"Unnamed API Key",search:"Search name, status or permissions",noMatches:"No matching API Keys",noModelPermission:"Not permitted by this API Key",modelAvailable:"Available",permissionState:{Available:"Available for chat",Shutdown:"Shut down",VideoGeneration:"Video generation model",Unsupported:"Not a chat model",NotActivated:"Not activated",Unknown:"Model status unavailable"}},tur=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:F7e,codePackage:$7e,common:L7e,default:{common:L7e,yaml:M7e,validation:I7e,defaults:P7e,helpers:N7e,intelligentDeployment:B7e,codePackage:$7e,buildCanvas:F7e,intelligent:z7e,projectLibrary:U7e,modePicker:V7e,promptEditor:Q7e,skills:G7e,workflow:H7e,workbench:W7e,traditional:Y7e,template:q7e,workspace:j7e,modelApiKey:X7e},defaults:P7e,helpers:N7e,intelligent:z7e,intelligentDeployment:B7e,modePicker:V7e,modelApiKey:X7e,projectLibrary:U7e,promptEditor:Q7e,skills:G7e,template:q7e,traditional:Y7e,validation:I7e,workbench:W7e,workflow:H7e,workspace:j7e,yaml:M7e},Symbol.toStringTag,{value:"Module"})),K7e={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"},Z7e={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?"},J7e={configuration:"Task configuration",nextRun:"Next run",pageLabel:"Scheduled task details",region:"Region",runtime:"Runtime",status:"Task status"},e$e={createTitle:"Create scheduled task",description:"Each trigger creates a separate Session for the Runtime Agent.",editTitle:"Edit scheduled task"},t$e={minutesSeconds:"{{minutes}} min {{seconds}} sec",seconds:"{{count}} sec"},r$e={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"},n$e={all:"All"},i$e={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"},a$e={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."},o$e={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"},s$e={cron:"Cron {{cron}}{{zone}}",daily:"Daily at {{time}}{{zone}}",once:"Once · {{date}}{{zone}}",weekly:"{{weekday}} at {{time}}{{zone}}"},l$e={daily:"Daily",once:"Once",weekly:"Weekly"},c$e={cancelled:"Cancelled",enabled:"Enabled",failed:"Failed",notRun:"Not run yet",paused:"Paused",pending:"Preparing",queued:"Queued",retrying:"Retrying",running:"Running",skipped:"Skipped",success:"Succeeded"},u$e={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."},h$e={friday:"Friday",monday:"Monday",saturday:"Saturday",sunday:"Sunday",thursday:"Thursday",tuesday:"Tuesday",wednesday:"Wednesday"},rur=Object.freeze(Object.defineProperty({__proto__:null,actions:K7e,confirm:Z7e,default:{actions:K7e,confirm:Z7e,detail:J7e,drawer:e$e,duration:t$e,fields:r$e,filters:n$e,history:i$e,notices:a$e,page:o$e,schedule:s$e,scheduleTypes:l$e,status:c$e,validation:u$e,weekdays:h$e},detail:J7e,drawer:e$e,duration:t$e,fields:r$e,filters:n$e,history:i$e,notices:a$e,page:o$e,schedule:s$e,scheduleTypes:l$e,status:c$e,validation:u$e,weekdays:h$e},Symbol.toStringTag,{value:"Module"})),d$e="Quick-create Agent",f$e="Agent type",p$e="Close",g$e="Deploy",m$e="Preview",v$e="Configuration download started",y$e="Download failed — try again",b$e="Review {{count}} configuration issues",x$e="Custom",w$e="Custom {{field}}",A$e="Enter a custom value",S$e="This model declares no reasoning levels; the service settings apply",T$e="Add a model to this provider first",C$e="Select a provider first",O$e="Select an option",k$e="Optional",E$e="Default model, Agent preset and permissions apply to new sessions. The preset must exist in the deployed Harness",_$e="Enter an environment variable name only; supply its secret value at deployment",R$e="read-only allows reading; workspace-write allows workspace edits; danger-full-access allows full access without approval",D$e="allowedModels lists the models sub-agents may select. Enabling selection requires at least one provider/model pair",L$e="Add a custom model service using its endpoint, protocol and model IDs, including compatible Volcengine and BytePlus services",M$e="Covers common native settings. Other plugin parameters and preset files are not included yet",I$e="Native configuration reference",P$e="Provider {{index}}",N$e="Model {{index}}",B$e="Add provider",$$e="Remove provider {{index}}",F$e="Add model",z$e="Remove model {{index}}",U$e="Add allowed model",V$e="Remove allowed model {{index}}",Q$e="Remove",G$e="Enter the service’s model ID",H$e={provider:"Provider {{index}}",model:"Model {{index}}"},W$e={defaults:"Session defaults",deepseek:"DeepSeek model service",providers:"Custom model providers",shell:"Command execution",loop:"Tool calls",subagents:"Sub-agent model selection",search:"DeepSeek web search"},Y$e={id:"Provider ID",displayName:"Display name",baseURL:"Base URL",api:"API protocol",apiKeyEnv:"API key environment variable"},q$e={id:"e.g. company-models",displayName:"Optional; defaults to the provider ID",baseURL:"https://…/v1",api:"Select a protocol",apiKeyEnv:"e.g. MODEL_API_KEY"},j$e={id:"Model ID",name:"Display name",contextWindow:"Context capacity",maxTokens:"Maximum output capacity"},X$e={positive:"Enter a number greater than zero",integer:"Enter a valid positive integer",env:"Use letters, digits and underscores; do not start with a digit",url:"Enter an HTTP or HTTPS URL without credentials",option:"Select a supported native option",required:"Complete this field",duplicate:"This ID or model pair already exists",providerId:"Start with a lowercase letter; use lowercase letters, digits, dots, underscores or hyphens; reserved IDs are unavailable",routes:"Add at least one complete provider/model pair",modelPair:"Enter a model ID for this custom provider",unknownProvider:"Add this custom provider first",unknownModel:"Enter a model ID configured for this provider",timer:"Enter a timeout greater than 0 and no more than 2147483647 ms"},K$e={"agent-default-model_provider":"Default provider","agent-default-model_model":"Default model","agent-default-model_reasoningEffort":"Default reasoning effort","agent-presets_default":"Default Agent preset",permission_defaultPreset:"Default permission preset","llm-deepseek_apiKeyEnv":"API key environment variable","llm-deepseek_baseURL":"Base URL","llm-deepseek_thinking":"Thinking mode","llm-deepseek_reasoningEffort":"Reasoning effort","llm-deepseek_maxTokens":"Output limit per request","llm-deepseek_defaultContextWindow":"Default context capacity","llm-deepseek_streamIdleTimeoutMs":"Stream idle timeout (ms)",bash_timeoutMs:"Default execution timeout (ms)",bash_maxTimeoutMs:"Maximum execution timeout (ms)",bash_maxOutputBytes:"Output limit (bytes)","agent-loop_maxParallelToolCalls":"Parallel tool-call limit","subagent-model-selection_enabled":"Enable model selection","web-search-deepseek_apiKeyEnv":"API key environment variable","web-search-deepseek_baseURL":"Search base URL","web-search-deepseek_model":"Search model","web-search-deepseek_apiVersion":"API version","web-search-deepseek_maxTokens":"Search output limit","web-search-deepseek_maxUses":"Maximum search uses"},Z$e="Cancel",J$e="Back to creation methods",eFe="DeepSeek Harness configuration",nur=Object.freeze(Object.defineProperty({__proto__:null,addModel:F$e,addProvider:B$e,addRoute:U$e,agentType:f$e,back:J$e,cancel:Z$e,close:p$e,coverage:M$e,credentialHelp:_$e,customField:w$e,customValue:x$e,default:{title:d$e,agentType:f$e,close:p$e,continue:"Continue",deploy:g$e,preview:m$e,export:"Export configuration",downloaded:v$e,downloadFailed:y$e,validationSummary:b$e,customValue:x$e,customField:w$e,enterCustomValue:A$e,reasoningUnavailable:S$e,modelsUnavailable:T$e,selectProviderFirst:C$e,selectOption:O$e,optional:k$e,defaultsHelp:E$e,credentialHelp:_$e,permissionHelp:R$e,routesHelp:D$e,providersHelp:L$e,coverage:M$e,source:I$e,provider:P$e,model:N$e,addProvider:B$e,removeProvider:$$e,addModel:F$e,removeModel:z$e,addRoute:U$e,removeRoute:V$e,remove:Q$e,modelIdPlaceholder:G$e,route:H$e,sections:W$e,providerFields:Y$e,providerPlaceholders:q$e,modelFields:j$e,errors:X$e,fields:K$e,cancel:Z$e,back:J$e,pageTitle:eFe},defaultsHelp:E$e,deploy:g$e,downloadFailed:y$e,downloaded:v$e,enterCustomValue:A$e,errors:X$e,fields:K$e,model:N$e,modelFields:j$e,modelIdPlaceholder:G$e,modelsUnavailable:T$e,optional:k$e,pageTitle:eFe,permissionHelp:R$e,preview:m$e,provider:P$e,providerFields:Y$e,providerPlaceholders:q$e,providersHelp:L$e,reasoningUnavailable:S$e,remove:Q$e,removeModel:z$e,removeProvider:$$e,removeRoute:V$e,route:H$e,routesHelp:D$e,sections:W$e,selectOption:O$e,selectProviderFirst:C$e,source:I$e,title:d$e,validationSummary:b$e},Symbol.toStringTag,{value:"Module"})),tFe="Report an issue",rFe="Description",nFe="Common issues",iFe="Cancel",aFe="Done",oFe="Submit feedback",sFe="Submitting…",lFe={title:"Feedback submitted. Thank you.",description:"The AgentKit team will review your report as soon as possible."},cFe={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"}},uFe={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."},iur=Object.freeze(Object.defineProperty({__proto__:null,cancel:iFe,commonIssues:nFe,default:{title:tFe,descriptionLabel:rFe,commonIssues:nFe,cancel:iFe,done:aFe,submit:oFe,submitting:sFe,success:lFe,dialog:cFe,page:uFe},descriptionLabel:rFe,dialog:cFe,done:aFe,page:uFe,submit:oFe,submitting:sFe,success:lFe,title:tFe},Symbol.toStringTag,{value:"Module"})),hFe={back:"Back",close:"Close"},dFe={title:"Optimize migrated project",closeAria:"Close optimization dialog"},fFe={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."},pFe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any (universal migration)"},gFe={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"},mFe={evaluationPending:"Evaluation pending",evaluationRunning:"Evaluating",waitingDataset:"Evaluation cases pending",waitingEnvironment:"Environment variables required",evaluationFailed:"Migrated, evaluation incomplete",evaluationBlocked:"Migrated, evaluation needs attention",evaluationCancelled:"Migrated, evaluation cancelled",resultUnavailable:"Result unavailable",environmentExpired:"Environment expired"},vFe={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."},yFe={passed:"Output verification passed",failed:"Output verification failed",degraded:"Output verification incomplete"},bFe={session:"Create migration environment",upload:"Upload project",analysis:"Analyze project"},xFe={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"},wFe={seconds:"{{seconds}} sec",minutesSeconds:"{{minutes}} min {{seconds}} sec"},AFe={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."},SFe={recommended:"Recommended migration method",scope:"Migration scope",excluded:"Out of scope",viewEvidence:"View analysis evidence",viewAssumptions:"View key assumptions",viewSourceEvidence:"View source evidence"},TFe={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."},CFe={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…"},OFe={retiring:"Retiring soon",currentDefault:"Current default model",loadError:"Failed to load models",label:"Model",placeholder:"Select a model"},kFe={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:"Upload and analyze",inputAria:"Select a local project ZIP",retention:"The temporary migration environment is retained for 1 hour after creation. Successfully saved source versions are unaffected.",uploading:"Uploading…",sizeHint:"Project ZIP, up to {{size}}"},EFe={requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}",notReady:"Migration output is not ready yet.",back:"Back to migration results"},_Fe={backToAddAgent:"Back to Add Agent",title:"Migrate existing project",newMigration:"New migration",recent:"Recent migrations",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.",backToHome:"Migration home",navigation:"Migration navigation",showMore:"Show more",showLess:"Show less",projectName:"Project name",status:"Status",createdAt:"Created",actions:"Actions",openTask:"Open migration {{name}}",continueTask:"Continue",viewTask:"View"},RFe={stop:"Stop migration",stopping:"Stopping…",cancel:"Cancel",reload:"Reload",refreshStatus:"Refresh status"},DFe={unavailable:"Migration is currently unavailable",defaultReason:"Dev Sandbox is currently unavailable. Contact your administrator to check the configuration."},LFe={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."},MFe={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"},IFe={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"},PFe={setup:{title:"Migration effect evaluation",description:"Evaluation cases run automatically after migration.",on:"On",off:"Off",unavailable:"Migration effect evaluation is unavailable in this environment.",casesTitle:"Evaluation cases",casesDescription:"Add at least one case. Expected outcomes and criteria are optional.",configuredSummary:"{{count}} cases · {{preset}} · {{dimensions}}",incompleteSummary:"{{count}} cases need content · {{preset}} · {{dimensions}}",dimensionSummary:"{{count}} dimensions",editSettings:"Edit settings",viewSettings:"View settings",lockedTitle:"Evaluation cases",lockedDescription:"Cases cannot change after upload starts.",closeAria:"Close evaluation settings",done:"Finish setup",close:"Close"},tabs:{label:"Migration task content",migration:"Migration",evaluation:"Evaluation",waitingMigration:"Waiting for migration",waitingConfiguration:"Setup required",running:"Running",completed:"Completed",issue:"Needs attention"},bulk:{open:"Paste multiple",label:"Enter one case per line",placeholder:`Check the status of today's orders -Summarize the result in three points`,preview:"{{count}} cases will be added",confirm:"Add cases"},case:{title:"Case {{index}}",add:"Add case",moveUp:"Move case {{index}} up",moveDown:"Move case {{index}} down",copy:"Duplicate",delete:"Delete",userInput:"User input",userInputPlaceholder:"For example: Check the status of today's orders",expectedOutcome:"Expected outcome (optional)",expectedOutcomePlaceholder:"Describe what the Agent should accomplish; exact wording is not required",criteria:"Requirements (optional)",addCriterion:"Add requirement",criterionLabel:"Requirement {{index}}",criterionPlaceholder:"For example: Include the order ID and current status",removeCriterion:"Remove requirement {{index}}"},advanced:{title:"Advanced settings",standard:"Standard evaluation",standardDescription:"Uses 3 dimensions by default: semantic fidelity, output constraints, and workflow/tool fidelity.",custom:"Custom dimensions",customDescription:"Select one or more dimensions based on business risk.",lockedDescription:"The evaluation method and dimensions cannot change after upload starts."},dimension:{semantic_fidelity:"Semantic fidelity",output_contract:"Output contract",workflow_tool_fidelity:"Workflow and tool fidelity",context_memory_fidelity:"Context and memory fidelity",boundary_error_fidelity:"Boundary and error fidelity",safety_refusal_fidelity:"Safety and refusal fidelity"},dimensionDescription:{semantic_fidelity:"Checks whether intent, conclusions, and key facts remain consistent.",output_contract:"Checks required fields, structure, language, and formatting constraints.",workflow_tool_fidelity:"Checks observable workflow branches and tool-driven behavior.",context_memory_fidelity:"Checks supported multi-turn context and memory behavior.",boundary_error_fidelity:"Checks invalid input, missing information, and dependency failures.",safety_refusal_fidelity:"Checks existing authorization, refusal, and sensitive-data boundaries."},validation:{caseCount:"Keep between 1 and {{count}} cases.",dimensionRequired:"Select at least one evaluation dimension.",userInputRequired:"Enter case input.",userInputBytes:"A case cannot exceed 32 KiB.",expectedOutcomeBytes:"The expected outcome cannot exceed 16 KiB.",criteriaCount:"A case can contain at most {{count}} requirements.",criterionRequired:"Requirements cannot be empty.",criterionBytes:"One requirement cannot exceed 2 KiB.",datasetBytes:"All evaluation cases cannot exceed 10 MiB."},dataset:{invalidLockResponse:"The service did not confirm that evaluation cases were saved. Try again.",loadingSettings:"Loading evaluation settings…",loadSettingsFailed:"Evaluation settings could not be loaded.",retryLoadSettings:"Reload",missing:"No saved evaluation cases were found. Enter and save them again.",saveWarning:"Evaluation cases were not saved. Migration continues.",retrySave:"Save evaluation cases again",saving:"Saving…"},state:{disabled:"Evaluation is off",waiting_dataset:"Waiting for evaluation cases",pending:"Evaluation starts automatically after migration",preparing:"Preparing the evaluation environment…",waiting_environment:"Runtime environment variables are required",deploying:"Deploying a temporary Runtime…",executing:"Running evaluation cases…",judging:"Running evaluation analysis…",aggregating:"Aggregating evaluation results…",completed:"Evaluation completed",failed:"Evaluation incomplete",blocked:"Evaluation requires attention before it can continue",cancelled:"Evaluation cancelled"},progress:{label:"Migration and migration effect evaluation progress",migration:"Migration",evaluation:"Migration effect evaluation",notStarted:"Not started",inProgress:"In progress",completed:"Complete",waitingConfiguration:"Waiting for setup",issue:"Needs attention"},environment:{description:"Enter the environment variables required by the temporary Runtime.",security:"Used only for this evaluation.",optional:"Optional",submit:"Submit and continue evaluation",submitting:"Submitting…"},execution:{preparing:"Prepare evaluation",preparingDetail:"Validate migration output and {{count}} evaluation cases",deploying:"Start Runtime",deployingDetail:"Prepare {{runtime}}",runtimeFallback:"isolated runtime",executing:"Run cases",executingDetail:"Run {{count}} cases and capture output",judging:"Run evaluation analysis",judgingDetail:"Evaluate {{cases}} cases · {{dimensions}} dimensions",aggregating:"Generate evaluation report",aggregatingDetail:"Aggregate scores and evidence into an HTML report",waiting:"Waiting",running:"Running",failed:"Failed",complete:"Completed"},result:{title:"Execution progress",attempt:"Evaluation attempt {{attempt}}",pending:"Waiting for migration to complete",retry:"Run evaluation again",retrying:"Retrying…",failureStage:"Failed at",errorCode:"Error code",taskId:"Task ID",diagnosticAttempt:"Evaluation attempt",runtime:"Runtime",errorDetails:"Error details",diagnosticField:"{{label}}: {{value}}",diagnosticHeading:"{{label}}:",loadingReport:"Loading the evaluation report…",reportTitle:"HTML evaluation report",reportHtmlDescription:"View or download the HTML report.",viewReport:"View report",reportDrawerDescription:"Scores, differences, and evidence",closeReport:"Close",closeReportAria:"Close evaluation report",reportPreviewTitle:"Migration effect evaluation report preview",reportSummary:"Evaluation summary",reportVersion:"Dataset {{version}} · Prompt v{{prompt}}",downloadReport:"Download full report",downloadingReport:"Downloading…",overallScore:"Overall fidelity",scoreScale:"0–100; N/A when evidence is insufficient",evidenceCoverage:"Evidence coverage",coverageDetail:"{{scored}} of {{total}} dimensions evidenced",executionSuccess:"Execution success",executionDetail:"{{succeeded}} of {{total}} cases completed",naCount:"N/A count",naDescription:"Insufficient evidence; excluded from scores",gapDescription:"Migration gap summary",lowestScoringCases:"Lowest-scoring cases",executionFailures:"Execution issues",criticalEvidence:"Critical evidence",limitations:"Evaluation limitations",viewEvidence:"View results and evidence for {{count}} cases",outputTruncated:"Long output was truncated",executionState:{succeeded:"Execution completed",failed:"Execution issue"},severityLabel:"Severity: {{severity}}",severity:{none:"None",low:"Low",medium:"Medium",high:"High",critical:"Critical",unknown:"Unknown"},evidenceSource:{user_reference:"Expected outcome",user_criteria:"Provided requirements",source_contract:"Source contract",observed_output:"Observed output",runtime_observation:"Raw Runtime data",deterministic_assertion:"Deterministic assertion"},listSeparator:", "}},NFe={closeAria:"Dismiss error",loadFailed:"Could not load migration data. Try again.",refreshFailed:"Could not refresh the migration status. Try again."},BFe={title:"Stop the current migration?",description:"Stopping ends the current analysis or migration process. Completed steps will not continue."},aur=Object.freeze(Object.defineProperty({__proto__:null,actions:RFe,activity:TFe,analysis:SFe,artifact:CFe,capability:DFe,common:hFe,confirmation:IFe,conversation:LFe,default:{common:hFe,optimization:dFe,projects:fFe,framework:pFe,state:gFe,historyStatus:mFe,task:vFe,verification:yFe,transfer:bFe,validation:xFe,duration:wFe,expiry:AFe,analysis:SFe,activity:TFe,artifact:CFe,model:OFe,upload:kFe,deployment:EFe,workspace:_Fe,actions:RFe,capability:DFe,conversation:LFe,questions:MFe,confirmation:IFe,evaluation:PFe,errors:NFe,stopDialog:BFe},deployment:EFe,duration:wFe,errors:NFe,evaluation:PFe,expiry:AFe,framework:pFe,historyStatus:mFe,model:OFe,optimization:dFe,projects:fFe,questions:MFe,state:gFe,stopDialog:BFe,task:vFe,transfer:bFe,upload:kFe,validation:xFe,verification:yFe,workspace:_Fe},Symbol.toStringTag,{value:"Module"})),$Fe={loading:"Loading…",searchLabel:"Search {{label}}",searchPlaceholder:"Search {{label}}",retry:"Retry",noMatches:"No matches",noOptions:"No options available",selection:"{{label}}: {{value}}"},FFe={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."}},zFe={label:"New conversation workspace",agent:"Agent",skill:"Skill customization",video:"Video creation"},UFe={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"},VFe={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}}",wakingHint:"Waking the agent. This may take some time."},QFe={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"},GFe={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"}},our=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:VFe,compactSelect:$Fe,default:{compactSelect:$Fe,featureNotice:FFe,workspace:zFe,mode:UFe,agentPicker:VFe,skill:QFe,video:GFe},featureNotice:FFe,mode:UFe,skill:QFe,video:GFe,workspace:zFe},Symbol.toStringTag,{value:"Module"})),HFe="Review center",WFe="Resource type to review",YFe="Only administrators can access the review center",qFe="Search name, submitter or version",jFe="Review status",XFe="Pending: {{count}}",KFe="Requests: {{count}}",ZFe={skill:"Skills",agent:"Agents"},JFe={all:"All statuses",pending:"Pending",approved:"Approved",returned:"Returned",approving:"Publishing"},e9e={application:"Request",submitter:"Submitter",version:"Version",submittedAt:"Submitted at",status:"Status",actions:"Actions"},t9e={details:"Details",detailsFor:"View request for {{name}}",approve:"Approve",approveFor:"Approve request for {{name}}",return:"Return",returnFor:"Return request for {{name}}",close:"Close",backToDetails:"Back to details",confirmApprove:"Confirm approval",confirmReturn:"Confirm return",clearFilters:"Clear filters",refresh:"Refresh",cancel:"Cancel",resumeApproval:"Resume publishing"},r9e={title:"No review requests yet",description:"Submitted review requests will appear here",filteredTitle:"No matching requests",filteredDescription:"Try another search or change the review status"},n9e={title:"Request details",sections:"Request detail sections",overview:"Overview",files:"Submitted files · {{count}}",requestType:"Request type",update:"Version update",firstRelease:"First release",source:"Source",source_skill:"{{name}}’s personal skill space",source_agent:"{{name}}’s development environment",destination:"Publication target",destination_skill:"Shared skill space",destination_agent:"Shared agent",region:"Region",visibility:"Visibility after publication",shared:"Visible to everyone",description:"Description",changes:"Submission notes",example:"Usage example",history:"Review history",submitted:"{{name}} submitted this request",versionFixed:"Reviewing the submitted version only",instructions:"Instructions",filesTab:"Submitted files",filesFailed:"Could not load submitted files",unknownAuthor:"Unknown submitter",reviewer:"Reviewed by",reviewedAt:"Reviewed at",approved:"{{name}} approved the request",returned:"{{name}} returned the request",unknownReviewer:"Unknown reviewer",approvedBy:"Approved by",returnedBy:"Returned by",comment:"Review comment",result:"Review result",noHistory:"This skill has not been submitted for review",pendingHint:"Waiting for an administrator to review",approvingHint:"Approval is confirmed and publishing to the shared space is in progress",approving:"{{name}} confirmed approval; publishing is in progress"},i9e={failed:"The review space is unavailable",retry:"Retry"},a9e={approveTitle:"Approve request",returnTitle:"Return request",approveDescription:"Approving {{name}} {{version}} makes this version available to everyone in the enterprise shared space",returnDescription:"Return {{name}} {{version}} and explain what the applicant should change",reason:"Return reason",reasonRequired:"Enter a return reason",reasonHelp:"Up to 256 characters, visible to the applicant",saving:"Saving…",failed:"Review failed, please try again",approved:"{{name}} was approved and shared",returned:"{{name}} was returned",comment:"Comment (optional)",commentHelp:"Up to 256 characters, visible to the applicant"},o9e={title:"AI score",points:"{{score}} / 100",insufficient:"Insufficient evidence",status:{unscored:"Not scored",not_requested:"Not scored",queued:"Queued",running:"Scoring",completed:"Scored",failed:"Scoring failed"},loading:"Loading score…",starting:"Submitting for scoring…",loadFailed:"Could not load score",retryFailed:"Could not request scoring",failed:"Scoring failed, ask an administrator to retry",retry:"Score again",start:"Start scoring",reload:"Reload",download:"Download JSON",expand:"Expand",collapse:"Collapse",hint:"Scores apply to this submitted version and inform the administrator’s decision",dimensions:{safety:"Safety",usability:"Usability",completeness:"Completeness",reliability:"Reliability",maintainability:"Maintainability"},risks:"Risk flags",suggestions:"Suggestions",model:"Scoring model",rubric:"Rubric version",time:"Scored at",severity:{low:"Low risk",medium:"Medium risk",high:"High risk",critical:"Critical risk"},coverage:"Review coverage",coverageCount:"Reviewed {{included}} of {{total}} files",coverageIncomplete:"Some content was excluded, so scoring evidence is incomplete",omittedFile:"Not reviewed {{path}}: {{reason}}",truncatedFile:"Partially reviewed {{path}}: {{reason}}",originalError:"Original cloud error"},sur=Object.freeze(Object.defineProperty({__proto__:null,actions:t9e,adminOnly:YFe,category:WFe,columns:e9e,decision:a9e,default:{title:HFe,category:WFe,adminOnly:YFe,search:qFe,filterStatus:jFe,pendingCount:XFe,total:KFe,kind:ZFe,status:JFe,columns:e9e,actions:t9e,empty:r9e,detail:n9e,space:i9e,decision:a9e,score:o9e},detail:n9e,empty:r9e,filterStatus:jFe,kind:ZFe,pendingCount:XFe,score:o9e,search:qFe,space:i9e,status:JFe,title:HFe,total:KFe},Symbol.toStringTag,{value:"Module"})),s9e={cancel:"Cancel",close:"Close",retry:"Retry",tryAgain:"Try again",closeDialog:"Close {{title}}",agentFallback:"{{agent}} Agent",unknownSource:"Unknown source"},l9e={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}}"},c9e={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"},u9e={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."}}},h9e={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"},d9e={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"},f9e={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",stopping:"Confirming stop…",resume:"Resume task",steer:"Add instructions",steerPlaceholder:"Add instructions, or stop the task at any time…"},p9e={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"},g9e={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"}},m9e={back:"Back to Agents",subtitle:"{{agent}} agent 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:"Delete “{{name}}” and its saved data? This cannot be undone.",deleting:"Deleting…",confirmDelete:"Delete",sleepingHint:"This agent is asleep. Waking it before opening may take some time.",wakingHint:"Waking the agent. This may take some time.",agentId:"Agent ID"},v9e={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"},y9e={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.`},N7e={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",fallbackApiKeyLabel:"{{name}} fallback model {{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"}},B7e={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}}"}},$7e={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."}},F7e={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"}},z7e={title:"Intelligent build",subtitle:"Describe what you need. Build, debug, and validate your agent.",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."},tasks:{title:"Tasks in progress",hint:"Work continues when you leave. Return to follow progress or add instructions.",refresh:"Refresh tasks",loading:"Loading tasks…",empty:"No tasks in progress",emptyHint:"Once a build starts, you can return to it here.",loadError:"Unable to load tasks. Please retry.",openError:"Unable to open this task. Please retry.",startedAt:"Started {{time}}",open:"Open task",opening:"Connecting…",states:{queued:"Queued",running:"Building",recovering:"Reconnecting",waiting_user:"Awaiting your reply",stopping:"Stopping",succeeded:"Completed",failed:"Incomplete",cancelled:"Stopped"}}},U7e={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",defaultVersionName:"Version · {{time}}",rename:{projectTitle:"Edit project name",versionTitle:"Edit version name",projectLabel:"Project name",versionLabel:"Version name",hint:"Use letters, numbers and common punctuation, up to {{max}} characters.",required:"Enter a name.",tooLong:"Names can contain up to {{max}} characters.",invalidCharacters:"Names cannot contain line breaks, control or invisible formatting characters, or < >.",save:"Save name",saving:"Saving…",updated:"Name updated.",failed:"Unable to save the name. Try again."},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"}},V7e={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"}}},Q7e={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"}},G7e={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."}},H7e={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"}},W7e={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",fallbacks:"Fallback models",fallbackPlaceholder:"Fallback model name",addFallback:"Add fallback model",addProviderFallback:"Add other provider",removeFallback:"Remove",fallbackType:"Fallback model type",fallbackSameProvider:"Same provider",fallbackOtherProvider:"Other provider",apiKeyEnv:"API Key environment variable",invalidApiKeyEnv:"Use letters, numbers, and underscores only, and do not start with a number.",fallbackHelp:"Same-provider fallbacks reuse the primary connection. Other providers use separate provider, API base, and API Key settings.",fallbackIgnored:"Empty, duplicate, or primary-model entries will be ignored.",provider:"Provider",invalidApiBase:"Enter a valid http:// or https:// URL.",volcengineArk:"Volcano Ark",custom:"Custom",gateway:"Model gateway",comingSoon:"Coming soon",currentApiKey:"Current API Key",currentConfiguration:"Current configuration",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",apiKeyRequired:"Enter or select the model API Key",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"}},Y7e={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",mcpDuplicateName:"MCP names must be unique",mcpDuplicateUrl:"Remove the duplicate MCP endpoint before publishing",missingSubagent:"A subagent is required",missingPrompt:"System prompt is required",apiKeyRequired:"Enter or select the model API Key",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",fallbacks:"Fallback models",fallbackPlaceholder:"Fallback model name",addFallback:"Add fallback model",addProviderFallback:"Add other provider",removeFallback:"Remove",fallbackType:"Fallback model type",fallbackSameProvider:"Same provider",fallbackOtherProvider:"Other provider",apiKeyEnv:"API Key environment variable",invalidApiKeyEnv:"Use letters, numbers, and underscores only, and do not start with a number.",fallbackHelp:"Same-provider fallbacks reuse the primary connection. Other providers use separate provider, API base, and API Key settings.",fallbackIgnored:"Empty, duplicate, or primary-model entries will be ignored.",provider:"Provider",invalidApiBase:"Enter a valid http:// or https:// URL.",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 is a gateway root address. Use it only when the root path is the MCP endpoint; otherwise include the complete service path.",tokenPlaceholder:"Bearer token (optional)",showToken:"Show Bearer token",hideToken:"Hide Bearer token",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…"}},q7e={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"}},j7e={checkingExpiry:"Checking expiry",waitingRecovery:"Waiting for recovery",listFailed:"Could not load projects",recoveryFailed:"Could not restore the workspace. Try again",operationFailed:"Project operation failed. Try again",title:"Code projects",back:"Back to code projects",restart:"This development environment will restart in {{countdown}}. Save your work regularly",expiresAt:"Expires at {{date}}",exitFullscreen:"Exit full screen",fullscreen:"Full screen",exitFullscreenHint:"Exit full screen (Esc)",recovering:"Restoring your workspace. Your project will reopen automatically",retry:"Retry connection",search:"Search code projects",newTitle:"New code project",new:"New project",readingStats:"Loading project details",createdAt:"Created",opening:"Opening",unknownCreatedAt:"Creation time unknown",open:"Open project",empty:"No matching code projects",close:"Close new project",name:"Project name",placeholder:"e.g. my-agent",nameHelp:"Start with a letter and use letters, numbers, underscores or hyphens, up to 64 characters",cancel:"Cancel",create:"Create project",files_one:"{{count}} file",files_other:"{{count}} files",directories_one:"{{count}} directory",directories_other:"{{count}} directories",separator:", "},X7e={enabled:"Enabled",disabled:"Disabled",unknownStatus:"Unknown status",allPermissions:"All permissions",customPermissions:"Custom permissions",unknownPermissions:"Unknown permissions",unnamed:"Unnamed API Key",search:"Search name, status or permissions",noMatches:"No matching API Keys",noModelPermission:"Not permitted by this API Key",modelAvailable:"Available",permissionState:{Available:"Available for chat",Shutdown:"Shut down",VideoGeneration:"Video generation model",Unsupported:"Not a chat model",NotActivated:"Not activated",Unknown:"Model status unavailable"}},nur=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:F7e,codePackage:$7e,common:L7e,default:{common:L7e,yaml:M7e,validation:I7e,defaults:P7e,helpers:N7e,intelligentDeployment:B7e,codePackage:$7e,buildCanvas:F7e,intelligent:z7e,projectLibrary:U7e,modePicker:V7e,promptEditor:Q7e,skills:G7e,workflow:H7e,workbench:W7e,traditional:Y7e,template:q7e,workspace:j7e,modelApiKey:X7e},defaults:P7e,helpers:N7e,intelligent:z7e,intelligentDeployment:B7e,modePicker:V7e,modelApiKey:X7e,projectLibrary:U7e,promptEditor:Q7e,skills:G7e,template:q7e,traditional:Y7e,validation:I7e,workbench:W7e,workflow:H7e,workspace:j7e,yaml:M7e},Symbol.toStringTag,{value:"Module"})),K7e={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"},Z7e={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?"},J7e={configuration:"Task configuration",nextRun:"Next run",pageLabel:"Scheduled task details",region:"Region",runtime:"Runtime",status:"Task status"},e$e={createTitle:"Create scheduled task",description:"Each trigger creates a separate Session for the Runtime Agent.",editTitle:"Edit scheduled task"},t$e={minutesSeconds:"{{minutes}} min {{seconds}} sec",seconds:"{{count}} sec"},r$e={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"},n$e={all:"All"},i$e={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"},a$e={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."},o$e={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"},s$e={cron:"Cron {{cron}}{{zone}}",daily:"Daily at {{time}}{{zone}}",once:"Once · {{date}}{{zone}}",weekly:"{{weekday}} at {{time}}{{zone}}"},l$e={daily:"Daily",once:"Once",weekly:"Weekly"},c$e={cancelled:"Cancelled",enabled:"Enabled",failed:"Failed",notRun:"Not run yet",paused:"Paused",pending:"Preparing",queued:"Queued",retrying:"Retrying",running:"Running",skipped:"Skipped",success:"Succeeded"},u$e={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."},h$e={friday:"Friday",monday:"Monday",saturday:"Saturday",sunday:"Sunday",thursday:"Thursday",tuesday:"Tuesday",wednesday:"Wednesday"},iur=Object.freeze(Object.defineProperty({__proto__:null,actions:K7e,confirm:Z7e,default:{actions:K7e,confirm:Z7e,detail:J7e,drawer:e$e,duration:t$e,fields:r$e,filters:n$e,history:i$e,notices:a$e,page:o$e,schedule:s$e,scheduleTypes:l$e,status:c$e,validation:u$e,weekdays:h$e},detail:J7e,drawer:e$e,duration:t$e,fields:r$e,filters:n$e,history:i$e,notices:a$e,page:o$e,schedule:s$e,scheduleTypes:l$e,status:c$e,validation:u$e,weekdays:h$e},Symbol.toStringTag,{value:"Module"})),d$e="Quick-create Agent",f$e="Agent type",p$e="Close",g$e="Deploy",m$e="Preview",v$e="Configuration download started",y$e="Download failed — try again",b$e="Review {{count}} configuration issues",x$e="Custom",w$e="Custom {{field}}",A$e="Enter a custom value",S$e="This model declares no reasoning levels; the service settings apply",T$e="Add a model to this provider first",C$e="Select a provider first",O$e="Select an option",k$e="Optional",E$e="Default model, Agent preset and permissions apply to new sessions. The preset must exist in the deployed Harness",_$e="Enter an environment variable name only; supply its secret value at deployment",R$e="read-only allows reading; workspace-write allows workspace edits; danger-full-access allows full access without approval",D$e="allowedModels lists the models sub-agents may select. Enabling selection requires at least one provider/model pair",L$e="Add a custom model service using its endpoint, protocol and model IDs, including compatible Volcengine and BytePlus services",M$e="Covers common native settings. Other plugin parameters and preset files are not included yet",I$e="Native configuration reference",P$e="Provider {{index}}",N$e="Model {{index}}",B$e="Add provider",$$e="Remove provider {{index}}",F$e="Add model",z$e="Remove model {{index}}",U$e="Add allowed model",V$e="Remove allowed model {{index}}",Q$e="Remove",G$e="Enter the service’s model ID",H$e={provider:"Provider {{index}}",model:"Model {{index}}"},W$e={defaults:"Session defaults",deepseek:"DeepSeek model service",providers:"Custom model providers",shell:"Command execution",loop:"Tool calls",subagents:"Sub-agent model selection",search:"DeepSeek web search"},Y$e={id:"Provider ID",displayName:"Display name",baseURL:"Base URL",api:"API protocol",apiKeyEnv:"API key environment variable"},q$e={id:"e.g. company-models",displayName:"Optional; defaults to the provider ID",baseURL:"https://…/v1",api:"Select a protocol",apiKeyEnv:"e.g. MODEL_API_KEY"},j$e={id:"Model ID",name:"Display name",contextWindow:"Context capacity",maxTokens:"Maximum output capacity"},X$e={positive:"Enter a number greater than zero",integer:"Enter a valid positive integer",env:"Use letters, digits and underscores; do not start with a digit",url:"Enter an HTTP or HTTPS URL without credentials",option:"Select a supported native option",required:"Complete this field",duplicate:"This ID or model pair already exists",providerId:"Start with a lowercase letter; use lowercase letters, digits, dots, underscores or hyphens; reserved IDs are unavailable",routes:"Add at least one complete provider/model pair",modelPair:"Enter a model ID for this custom provider",unknownProvider:"Add this custom provider first",unknownModel:"Enter a model ID configured for this provider",timer:"Enter a timeout greater than 0 and no more than 2147483647 ms"},K$e={"agent-default-model_provider":"Default provider","agent-default-model_model":"Default model","agent-default-model_reasoningEffort":"Default reasoning effort","agent-presets_default":"Default Agent preset",permission_defaultPreset:"Default permission preset","llm-deepseek_apiKeyEnv":"API key environment variable","llm-deepseek_baseURL":"Base URL","llm-deepseek_thinking":"Thinking mode","llm-deepseek_reasoningEffort":"Reasoning effort","llm-deepseek_maxTokens":"Output limit per request","llm-deepseek_defaultContextWindow":"Default context capacity","llm-deepseek_streamIdleTimeoutMs":"Stream idle timeout (ms)",bash_timeoutMs:"Default execution timeout (ms)",bash_maxTimeoutMs:"Maximum execution timeout (ms)",bash_maxOutputBytes:"Output limit (bytes)","agent-loop_maxParallelToolCalls":"Parallel tool-call limit","subagent-model-selection_enabled":"Enable model selection","web-search-deepseek_apiKeyEnv":"API key environment variable","web-search-deepseek_baseURL":"Search base URL","web-search-deepseek_model":"Search model","web-search-deepseek_apiVersion":"API version","web-search-deepseek_maxTokens":"Search output limit","web-search-deepseek_maxUses":"Maximum search uses"},Z$e="Cancel",J$e="Back to creation methods",eFe="DeepSeek Harness configuration",aur=Object.freeze(Object.defineProperty({__proto__:null,addModel:F$e,addProvider:B$e,addRoute:U$e,agentType:f$e,back:J$e,cancel:Z$e,close:p$e,coverage:M$e,credentialHelp:_$e,customField:w$e,customValue:x$e,default:{title:d$e,agentType:f$e,close:p$e,continue:"Continue",deploy:g$e,preview:m$e,export:"Export configuration",downloaded:v$e,downloadFailed:y$e,validationSummary:b$e,customValue:x$e,customField:w$e,enterCustomValue:A$e,reasoningUnavailable:S$e,modelsUnavailable:T$e,selectProviderFirst:C$e,selectOption:O$e,optional:k$e,defaultsHelp:E$e,credentialHelp:_$e,permissionHelp:R$e,routesHelp:D$e,providersHelp:L$e,coverage:M$e,source:I$e,provider:P$e,model:N$e,addProvider:B$e,removeProvider:$$e,addModel:F$e,removeModel:z$e,addRoute:U$e,removeRoute:V$e,remove:Q$e,modelIdPlaceholder:G$e,route:H$e,sections:W$e,providerFields:Y$e,providerPlaceholders:q$e,modelFields:j$e,errors:X$e,fields:K$e,cancel:Z$e,back:J$e,pageTitle:eFe},defaultsHelp:E$e,deploy:g$e,downloadFailed:y$e,downloaded:v$e,enterCustomValue:A$e,errors:X$e,fields:K$e,model:N$e,modelFields:j$e,modelIdPlaceholder:G$e,modelsUnavailable:T$e,optional:k$e,pageTitle:eFe,permissionHelp:R$e,preview:m$e,provider:P$e,providerFields:Y$e,providerPlaceholders:q$e,providersHelp:L$e,reasoningUnavailable:S$e,remove:Q$e,removeModel:z$e,removeProvider:$$e,removeRoute:V$e,route:H$e,routesHelp:D$e,sections:W$e,selectOption:O$e,selectProviderFirst:C$e,source:I$e,title:d$e,validationSummary:b$e},Symbol.toStringTag,{value:"Module"})),tFe="Report an issue",rFe="Description",nFe="Common issues",iFe="Cancel",aFe="Done",oFe="Submit feedback",sFe="Submitting…",lFe={title:"Feedback submitted. Thank you.",description:"The AgentKit team will review your report as soon as possible."},cFe={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"}},uFe={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."},our=Object.freeze(Object.defineProperty({__proto__:null,cancel:iFe,commonIssues:nFe,default:{title:tFe,descriptionLabel:rFe,commonIssues:nFe,cancel:iFe,done:aFe,submit:oFe,submitting:sFe,success:lFe,dialog:cFe,page:uFe},descriptionLabel:rFe,dialog:cFe,done:aFe,page:uFe,submit:oFe,submitting:sFe,success:lFe,title:tFe},Symbol.toStringTag,{value:"Module"})),hFe={back:"Back",close:"Close"},dFe={title:"Optimize migrated project",closeAria:"Close optimization dialog"},fFe={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."},pFe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any (universal migration)"},gFe={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"},mFe={evaluationPending:"Evaluation pending",evaluationRunning:"Evaluating",waitingDataset:"Evaluation cases pending",waitingEnvironment:"Environment variables required",evaluationFailed:"Migrated, evaluation incomplete",evaluationBlocked:"Migrated, evaluation needs attention",evaluationCancelled:"Migrated, evaluation cancelled",resultUnavailable:"Result unavailable",environmentExpired:"Environment expired"},vFe={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."},yFe={passed:"Output verification passed",failed:"Output verification failed",degraded:"Output verification incomplete"},bFe={session:"Create migration environment",upload:"Upload project",analysis:"Analyze project"},xFe={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"},wFe={seconds:"{{seconds}} sec",minutesSeconds:"{{minutes}} min {{seconds}} sec"},AFe={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."},SFe={recommended:"Recommended migration method",scope:"Migration scope",excluded:"Out of scope",viewEvidence:"View analysis evidence",viewAssumptions:"View key assumptions",viewSourceEvidence:"View source evidence"},TFe={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.",liveAnalyzing:"Analyzing the project",liveMigrating:"Running the migration",liveValidating:"Verifying the migration",livePackaging:"Packaging the migration",liveDelivery:"Reviewing the delivery"},CFe={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…"},OFe={retiring:"Retiring soon",currentDefault:"Current default model",loadError:"Failed to load models",label:"Model",placeholder:"Select a model"},kFe={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:"Upload and analyze",inputAria:"Select a local project ZIP",retention:"The temporary migration environment is retained for 1 hour after creation. Successfully saved source versions are unaffected.",uploading:"Uploading…",sizeHint:"Project ZIP, up to {{size}}"},EFe={requiredPlaceholder:"Enter {{key}}",optionalPlaceholder:"Optional: {{key}}",notReady:"Migration output is not ready yet.",back:"Back to migration results"},_Fe={backToAddAgent:"Back to Add Agent",title:"Migrate existing project",newMigration:"New migration",recent:"Recent migrations",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.",backToHome:"Migration home",navigation:"Migration navigation",showMore:"Show more",showLess:"Show less",projectName:"Project name",status:"Status",createdAt:"Created",actions:"Actions",openTask:"Open migration {{name}}",continueTask:"Continue",viewTask:"View"},RFe={stop:"Stop migration",stopping:"Stopping…",cancel:"Cancel",reload:"Reload",refreshStatus:"Refresh status"},DFe={unavailable:"Migration is currently unavailable",defaultReason:"Dev Sandbox is currently unavailable. Contact your administrator to check the configuration."},LFe={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."},MFe={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"},IFe={ariaLabel:"Answer the questions the migration needs you to decide",title:"The migration needs your answer",description:"Your answer continues the current step instead of restarting it",other:"Other",otherPlaceholder:"Or type your own answer",submitting:"Submitting your answer…",submit:"Submit answer and continue"},PFe={ariaLabel:"Confirm migration method",title:"Confirm migration method",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"},NFe={setup:{title:"Migration effect evaluation",description:"Evaluation cases run automatically after migration.",on:"On",off:"Off",unavailable:"Migration effect evaluation is unavailable in this environment.",casesTitle:"Evaluation cases",casesDescription:"Add at least one case. Expected outcomes and criteria are optional.",configuredSummary:"{{count}} cases · {{preset}} · {{dimensions}}",incompleteSummary:"{{count}} cases need content · {{preset}} · {{dimensions}}",dimensionSummary:"{{count}} dimensions",editSettings:"Edit settings",viewSettings:"View settings",lockedTitle:"Evaluation cases",lockedDescription:"Cases cannot change after upload starts.",closeAria:"Close evaluation settings",done:"Finish setup",close:"Close"},tabs:{label:"Migration task content",migration:"Migration",evaluation:"Evaluation",waitingMigration:"Waiting for migration",waitingConfiguration:"Setup required",running:"Running",completed:"Completed",issue:"Needs attention"},bulk:{open:"Paste multiple",label:"Enter one case per line",placeholder:`Check the status of today's orders +Summarize the result in three points`,preview:"{{count}} cases will be added",confirm:"Add cases"},case:{title:"Case {{index}}",add:"Add case",moveUp:"Move case {{index}} up",moveDown:"Move case {{index}} down",copy:"Duplicate",delete:"Delete",userInput:"User input",userInputPlaceholder:"For example: Check the status of today's orders",expectedOutcome:"Expected outcome (optional)",expectedOutcomePlaceholder:"Describe what the Agent should accomplish; exact wording is not required",criteria:"Requirements (optional)",addCriterion:"Add requirement",criterionLabel:"Requirement {{index}}",criterionPlaceholder:"For example: Include the order ID and current status",removeCriterion:"Remove requirement {{index}}"},advanced:{title:"Advanced settings",standard:"Standard evaluation",standardDescription:"Uses 3 dimensions by default: semantic fidelity, output constraints, and workflow/tool fidelity.",custom:"Custom dimensions",customDescription:"Select one or more dimensions based on business risk.",lockedDescription:"The evaluation method and dimensions cannot change after upload starts."},dimension:{semantic_fidelity:"Semantic fidelity",output_contract:"Output contract",workflow_tool_fidelity:"Workflow and tool fidelity",context_memory_fidelity:"Context and memory fidelity",boundary_error_fidelity:"Boundary and error fidelity",safety_refusal_fidelity:"Safety and refusal fidelity"},dimensionDescription:{semantic_fidelity:"Checks whether intent, conclusions, and key facts remain consistent.",output_contract:"Checks required fields, structure, language, and formatting constraints.",workflow_tool_fidelity:"Checks observable workflow branches and tool-driven behavior.",context_memory_fidelity:"Checks supported multi-turn context and memory behavior.",boundary_error_fidelity:"Checks invalid input, missing information, and dependency failures.",safety_refusal_fidelity:"Checks existing authorization, refusal, and sensitive-data boundaries."},validation:{caseCount:"Keep between 1 and {{count}} cases.",dimensionRequired:"Select at least one evaluation dimension.",userInputRequired:"Enter case input.",userInputBytes:"A case cannot exceed 32 KiB.",expectedOutcomeBytes:"The expected outcome cannot exceed 16 KiB.",criteriaCount:"A case can contain at most {{count}} requirements.",criterionRequired:"Requirements cannot be empty.",criterionBytes:"One requirement cannot exceed 2 KiB.",datasetBytes:"All evaluation cases cannot exceed 10 MiB."},dataset:{invalidLockResponse:"The service did not confirm that evaluation cases were saved. Try again.",loadingSettings:"Loading evaluation settings…",loadSettingsFailed:"Evaluation settings could not be loaded.",retryLoadSettings:"Reload",missing:"No saved evaluation cases were found. Enter and save them again.",saveWarning:"Evaluation cases were not saved. Migration continues.",retrySave:"Save evaluation cases again",saving:"Saving…"},state:{disabled:"Evaluation is off",waiting_dataset:"Waiting for evaluation cases",pending:"Evaluation starts automatically after migration",preparing:"Preparing the evaluation environment…",waiting_environment:"Runtime environment variables are required",deploying:"Deploying a temporary Runtime…",executing:"Running evaluation cases…",judging:"Running evaluation analysis…",aggregating:"Aggregating evaluation results…",completed:"Evaluation completed",failed:"Evaluation incomplete",blocked:"Evaluation requires attention before it can continue",cancelled:"Evaluation cancelled"},progress:{label:"Migration and migration effect evaluation progress",migration:"Migration",evaluation:"Migration effect evaluation",notStarted:"Not started",inProgress:"In progress",completed:"Complete",waitingConfiguration:"Waiting for setup",issue:"Needs attention"},environment:{description:"Enter the environment variables required by the temporary Runtime.",security:"Used only for this evaluation.",optional:"Optional",submit:"Submit and continue evaluation",submitting:"Submitting…"},execution:{preparing:"Prepare evaluation",preparingDetail:"Validate migration output and {{count}} evaluation cases",deploying:"Start Runtime",deployingDetail:"Prepare {{runtime}}",runtimeFallback:"isolated runtime",executing:"Run cases",executingDetail:"Run {{count}} cases and capture output",judging:"Run evaluation analysis",judgingDetail:"Evaluate {{cases}} cases · {{dimensions}} dimensions",aggregating:"Generate evaluation report",aggregatingDetail:"Aggregate scores and evidence into an HTML report",waiting:"Waiting",running:"Running",failed:"Failed",complete:"Completed"},result:{title:"Execution progress",attempt:"Evaluation attempt {{attempt}}",pending:"Waiting for migration to complete",retry:"Run evaluation again",retrying:"Retrying…",failureStage:"Failed at",errorCode:"Error code",taskId:"Task ID",diagnosticAttempt:"Evaluation attempt",runtime:"Runtime",errorDetails:"Error details",diagnosticField:"{{label}}: {{value}}",diagnosticHeading:"{{label}}:",loadingReport:"Loading the evaluation report…",reportTitle:"HTML evaluation report",reportHtmlDescription:"View or download the HTML report.",viewReport:"View report",reportDrawerDescription:"Scores, differences, and evidence",closeReport:"Close",closeReportAria:"Close evaluation report",reportPreviewTitle:"Migration effect evaluation report preview",reportSummary:"Evaluation summary",reportVersion:"Dataset {{version}} · Prompt v{{prompt}}",downloadReport:"Download full report",downloadingReport:"Downloading…",overallScore:"Overall fidelity",scoreScale:"0–100; N/A when evidence is insufficient",evidenceCoverage:"Evidence coverage",coverageDetail:"{{scored}} of {{total}} dimensions evidenced",executionSuccess:"Execution success",executionDetail:"{{succeeded}} of {{total}} cases completed",naCount:"N/A count",naDescription:"Insufficient evidence; excluded from scores",gapDescription:"Migration gap summary",lowestScoringCases:"Lowest-scoring cases",executionFailures:"Execution issues",criticalEvidence:"Critical evidence",limitations:"Evaluation limitations",viewEvidence:"View results and evidence for {{count}} cases",outputTruncated:"Long output was truncated",executionState:{succeeded:"Execution completed",failed:"Execution issue"},severityLabel:"Severity: {{severity}}",severity:{none:"None",low:"Low",medium:"Medium",high:"High",critical:"Critical",unknown:"Unknown"},evidenceSource:{user_reference:"Expected outcome",user_criteria:"Provided requirements",source_contract:"Source contract",observed_output:"Observed output",runtime_observation:"Raw Runtime data",deterministic_assertion:"Deterministic assertion"},listSeparator:", "}},BFe={closeAria:"Dismiss error",loadFailed:"Could not load migration data. Try again.",refreshFailed:"Could not refresh the migration status. Try again."},$Fe={title:"Stop the current migration?",description:"Stopping ends the current analysis or migration process. Completed steps will not continue."},sur=Object.freeze(Object.defineProperty({__proto__:null,actions:RFe,activity:TFe,analysis:SFe,artifact:CFe,capability:DFe,common:hFe,confirmation:PFe,conversation:LFe,default:{common:hFe,optimization:dFe,projects:fFe,framework:pFe,state:gFe,historyStatus:mFe,task:vFe,verification:yFe,transfer:bFe,validation:xFe,duration:wFe,expiry:AFe,analysis:SFe,activity:TFe,artifact:CFe,model:OFe,upload:kFe,deployment:EFe,workspace:_Fe,actions:RFe,capability:DFe,conversation:LFe,questions:MFe,pendingInput:IFe,confirmation:PFe,evaluation:NFe,errors:BFe,stopDialog:$Fe},deployment:EFe,duration:wFe,errors:BFe,evaluation:NFe,expiry:AFe,framework:pFe,historyStatus:mFe,model:OFe,optimization:dFe,pendingInput:IFe,projects:fFe,questions:MFe,state:gFe,stopDialog:$Fe,task:vFe,transfer:bFe,upload:kFe,validation:xFe,verification:yFe,workspace:_Fe},Symbol.toStringTag,{value:"Module"})),FFe={loading:"Loading…",searchLabel:"Search {{label}}",searchPlaceholder:"Search {{label}}",retry:"Retry",noMatches:"No matches",noOptions:"No options available",selection:"{{label}}: {{value}}"},zFe={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."}},UFe={label:"New conversation workspace",agent:"Agent",skill:"Skill customization",video:"Video creation"},VFe={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"},QFe={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}}",wakingHint:"Waking the agent. This may take some time."},GFe={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"},HFe={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"}},lur=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:QFe,compactSelect:FFe,default:{compactSelect:FFe,featureNotice:zFe,workspace:UFe,mode:VFe,agentPicker:QFe,skill:GFe,video:HFe},featureNotice:zFe,mode:VFe,skill:GFe,video:HFe,workspace:UFe},Symbol.toStringTag,{value:"Module"})),WFe="Review center",YFe="Resource type to review",qFe="Only administrators can access the review center",jFe="Search name, submitter or version",XFe="Review status",KFe="Pending: {{count}}",ZFe="Requests: {{count}}",JFe={skill:"Skills",agent:"Agents"},e9e={all:"All statuses",pending:"Pending",approved:"Approved",returned:"Returned",approving:"Publishing"},t9e={application:"Request",submitter:"Submitter",version:"Version",submittedAt:"Submitted at",status:"Status",actions:"Actions"},r9e={details:"Details",detailsFor:"View request for {{name}}",approve:"Approve",approveFor:"Approve request for {{name}}",return:"Return",returnFor:"Return request for {{name}}",close:"Close",backToDetails:"Back to details",confirmApprove:"Confirm approval",confirmReturn:"Confirm return",clearFilters:"Clear filters",refresh:"Refresh",cancel:"Cancel",resumeApproval:"Resume publishing"},n9e={title:"No review requests yet",description:"Submitted review requests will appear here",filteredTitle:"No matching requests",filteredDescription:"Try another search or change the review status"},i9e={title:"Request details",sections:"Request detail sections",overview:"Overview",files:"Submitted files · {{count}}",requestType:"Request type",update:"Version update",firstRelease:"First release",source:"Source",source_skill:"{{name}}’s personal skill space",source_agent:"{{name}}’s development environment",destination:"Publication target",destination_skill:"Shared skill space",destination_agent:"Shared agent",region:"Region",visibility:"Visibility after publication",shared:"Visible to everyone",description:"Description",changes:"Submission notes",example:"Usage example",history:"Review history",submitted:"{{name}} submitted this request",versionFixed:"Reviewing the submitted version only",instructions:"Instructions",filesTab:"Submitted files",filesFailed:"Could not load submitted files",unknownAuthor:"Unknown submitter",reviewer:"Reviewed by",reviewedAt:"Reviewed at",approved:"{{name}} approved the request",returned:"{{name}} returned the request",unknownReviewer:"Unknown reviewer",approvedBy:"Approved by",returnedBy:"Returned by",comment:"Review comment",result:"Review result",noHistory:"This skill has not been submitted for review",pendingHint:"Waiting for an administrator to review",approvingHint:"Approval is confirmed and publishing to the shared space is in progress",approving:"{{name}} confirmed approval; publishing is in progress"},a9e={failed:"The review space is unavailable",retry:"Retry"},o9e={approveTitle:"Approve request",returnTitle:"Return request",approveDescription:"Approving {{name}} {{version}} makes this version available to everyone in the enterprise shared space",returnDescription:"Return {{name}} {{version}} and explain what the applicant should change",reason:"Return reason",reasonRequired:"Enter a return reason",reasonHelp:"Up to 256 characters, visible to the applicant",saving:"Saving…",failed:"Review failed, please try again",approved:"{{name}} was approved and shared",returned:"{{name}} was returned",comment:"Comment (optional)",commentHelp:"Up to 256 characters, visible to the applicant"},s9e={title:"AI score",points:"{{score}} / 100",insufficient:"Insufficient evidence",status:{unscored:"Not scored",not_requested:"Not scored",queued:"Queued",running:"Scoring",completed:"Scored",failed:"Scoring failed"},loading:"Loading score…",starting:"Submitting for scoring…",loadFailed:"Could not load score",retryFailed:"Could not request scoring",failed:"Scoring failed, ask an administrator to retry",retry:"Score again",start:"Start scoring",reload:"Reload",download:"Download JSON",expand:"Expand",collapse:"Collapse",hint:"Scores apply to this submitted version and inform the administrator’s decision",dimensions:{safety:"Safety",usability:"Usability",completeness:"Completeness",reliability:"Reliability",maintainability:"Maintainability"},risks:"Risk flags",suggestions:"Suggestions",model:"Scoring model",rubric:"Rubric version",time:"Scored at",severity:{low:"Low risk",medium:"Medium risk",high:"High risk",critical:"Critical risk"},coverage:"Review coverage",coverageCount:"Reviewed {{included}} of {{total}} files",coverageIncomplete:"Some content was excluded, so scoring evidence is incomplete",omittedFile:"Not reviewed {{path}}: {{reason}}",truncatedFile:"Partially reviewed {{path}}: {{reason}}",originalError:"Original cloud error"},cur=Object.freeze(Object.defineProperty({__proto__:null,actions:r9e,adminOnly:qFe,category:YFe,columns:t9e,decision:o9e,default:{title:WFe,category:YFe,adminOnly:qFe,search:jFe,filterStatus:XFe,pendingCount:KFe,total:ZFe,kind:JFe,status:e9e,columns:t9e,actions:r9e,empty:n9e,detail:i9e,space:a9e,decision:o9e,score:s9e},detail:i9e,empty:n9e,filterStatus:XFe,kind:JFe,pendingCount:KFe,score:s9e,search:jFe,space:a9e,status:e9e,title:WFe,total:ZFe},Symbol.toStringTag,{value:"Module"})),l9e={cancel:"Cancel",close:"Close",retry:"Retry",tryAgain:"Try again",closeDialog:"Close {{title}}",agentFallback:"{{agent}} Agent",unknownSource:"Unknown source"},c9e={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}}"},u9e={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"},h9e={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."}}},d9e={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"},f9e={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"},p9e={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",stopping:"Confirming stop…",resume:"Resume task",steer:"Add instructions",steerPlaceholder:"Add instructions, or stop the task at any time…"},g9e={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"},m9e={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"}},v9e={back:"Back to Agents",subtitle:"{{agent}} agent 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:"Delete “{{name}}” and its saved data? This cannot be undone.",deleting:"Deleting…",confirmDelete:"Delete",sleepingHint:"This agent is asleep. Waking it before opening may take some time.",wakingHint:"Waking the agent. This may take some time.",agentId:"Agent ID"},y9e={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"},b9e={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"}},b9e={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"}},x9e={label:"Build tasks",queued:"Build queued",running:"Build running in the background",recovering:"Recovering build",waiting_user:"Build needs attention",stopping:"Stopping build",succeeded:"Build completed",cancelled:"Build stopped",failed:"Build could not complete",open:"Return to task",hide:"Hide task notification",reconnecting:"Reconnecting to the task service. Existing tasks are retained."},lur=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:m9e,agentWorkspace:v9e,approval:d9e,commands:b9e,common:s9e,composer:f9e,default:{common:s9e,tool:l9e,threads:c9e,permissions:u9e,workspace:h9e,approval:d9e,composer:f9e,launch:p9e,session:g9e,agentDetails:m9e,agentWorkspace:v9e,handoff:y9e,commands:b9e,taskNotice:x9e},handoff:y9e,launch:p9e,permissions:u9e,session:g9e,taskNotice:x9e,threads:c9e,tool:l9e,workspace:h9e},Symbol.toStringTag,{value:"Module"})),w9e={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."},A9e={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"},S9e={breadcrumbs:"Breadcrumbs",selectAgent:"Select Agent",switchAgent:"Switch Agent"},T9e={cancel:"Cancel",close:"Close confirmation dialog"},cur=Object.freeze(Object.defineProperty({__proto__:null,authExpired:A9e,confirm:T9e,default:{login:w9e,authExpired:A9e,navbar:S9e,confirm:T9e},login:w9e,navbar:S9e},Symbol.toStringTag,{value:"Module"})),C9e={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",super_admin:"Super administrator"}},O9e={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",users:"User management",administration:"Administration",reviewCenter:"Review center"},k9e={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"},uur=Object.freeze(Object.defineProperty({__proto__:null,account:C9e,default:{account:C9e,navigation:O9e,history:k9e},history:k9e,navigation:O9e},Symbol.toStringTag,{value:"Module"})),E9e={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."},_9e={unsupportedActivity:"Unsupported Skill conversation activity",ariaLabel:"Skill generation conversation"},R9e={code:"Error code: {{code}}",type:"Error type: {{type}}",representation:"Exception representation: {{value}}",rawResponse:`Raw server response: -{{value}}`,original:"Original error: {{message}}",details:"Details"},D9e={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"},L9e={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)"},M9e={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."},I9e={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"},hur=Object.freeze(Object.defineProperty({__proto__:null,api:I9e,configSelect:E9e,conversation:_9e,default:{configSelect:E9e,conversation:_9e,errorDetails:R9e,fileTree:D9e,management:L9e,generation:M9e,api:I9e},errorDetails:R9e,fileTree:D9e,generation:M9e,management:L9e},Symbol.toStringTag,{value:"Module"})),P9e={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"},N9e={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"},B9e={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"},$9e={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"}},F9e={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."}},z9e={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},U9e={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},V9e={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"},Q9e={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."},G9e={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"},H9e={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"},W9e={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."},Y9e={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"},q9e={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."}},j9e={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.",codeProjects:"Code projects"},X9e={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},K9e={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"}},Z9e={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"},J9e={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"}},eze={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:"Asleep",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:"Asleep",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"},wakingHint:"Waking the agent. This may take some time."},tze={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"},sharedSpace:"Enterprise shared space",sharedDescription:"Skills available to everyone, published and maintained by administrators",sharedVisibility:"Everyone",sharedPreparing:"Preparing shared space",sharedLoadFailed:"Shared space unavailable",sharedEmpty:"No shared skills yet. Skills published by administrators will appear here",requestPublication:"Request publication",reviewSubmitting:"Submitting…",reviewSubmitted:"Submitted",reviewFailed:"Could not submit the publication request",reviewStatusFailed:"Failed to load review status",reviewRetry:"Apply again",reviewPending:"Pending review",reviewApproving:"Publishing",reviewApproved:"Shared",reviewReturned:"Returned",reviewHistory:"Review history",skillDetailSections:"Skill detail sections",versions:{title:"Version management",refresh:"Refresh",uploading:"Uploading…",upload:"Upload new version",close:"Close",hint:"New versions become public after approval and do not replace published versions; the skill name in the ZIP must match the original",loading:"Loading versions…",loadFailed:"Unable to load versions",filesFailed:"Unable to load version files",uploadFailed:"Unable to upload the new version",submitFailed:"Unable to submit for review",retry:"Retry",empty:"No versions yet",current:"Current version",notSubmitted:"Not submitted",submitting:"Submitting…",submit:"Request publication",processing:"Version status: {{status}}",filesLoading:"Loading files…",filesEmpty:"No files",history:"Review history",shared:"Published"},author:"Author",authorName:"Author: {{name}}"},rze={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"}},dur=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:N9e,agentSelector:J9e,agentWorkspace:$9e,cloudEnvironment:Q9e,common:P9e,composer:Z9e,default:{common:P9e,agentKitPromo:N9e,systemInfo:B9e,agentWorkspace:$9e,environmentCenter:F9e,deploymentSelect:z9e,deploymentError:U9e,studioBuildProgress:V9e,cloudEnvironment:Q9e,githubCicd:G9e,feishuDeployment:H9e,deploymentResources:W9e,studioUpdate:Y9e,projectPreview:q9e,workspace:j9e,resourceCollection:X9e,skillSourcePicker:K9e,composer:Z9e,agentSelector:J9e,myAgents:eze,skillCenter:tze,knowledge:rze},deploymentError:U9e,deploymentResources:W9e,deploymentSelect:z9e,environmentCenter:F9e,feishuDeployment:H9e,githubCicd:G9e,knowledge:rze,myAgents:eze,projectPreview:q9e,resourceCollection:X9e,skillCenter:tze,skillSourcePicker:K9e,studioBuildProgress:V9e,studioUpdate:Y9e,systemInfo:B9e,workspace:j9e},Symbol.toStringTag,{value:"Module"})),nze="User management",ize="{{count}} members",aze="User",oze="Role",sze="Account status",lze="Last sign-in",cze="Actions",uze="Change role",hze="Close",dze="Save role",fze="Saving…",pze="Cancel",gze="Back",mze="User pool",vze="Volcengine Identity",yze="Search name, email or user ID",bze="Search",xze="Filter by role",wze="All roles",Aze="Refresh",Sze="Loading users…",Tze="Updated at {{time}}",Cze="{{name}} is now {{role}}",Oze="Retry",kze="You",Eze="Initial super administrator",_ze="The initial super administrator cannot be demoted here",Rze="The new permissions apply when the user refreshes Studio",Dze="Role needs confirmation",Lze="No matching users",Mze="Try another search or role",Ize="Users appear here after signing in or joining this user pool",Pze="{{count}} users",Nze="Previous",Bze="Next",$ze="Not signed in yet",Fze="Not provided",zze={super_admin:"Super administrator",admin:"Administrator",developer:"Developer",user:"User"},Uze={super_admin:"Manage all resources, users and role assignments",admin:"Manage Studio resources",developer:"Develop agents and manage your own resources",user:"Use agents and personal features"},Vze={EXTERNAL_PROVIDER:"Active",CONFIRMED:"Active",NORMAL:"Active",ENABLED:"Active",ACTIVE:"Active",UNCONFIRMED:"Unverified",DISABLED:"Disabled",FORBIDDEN:"Disabled",LOCKED:"Locked",SUSPENDED:"Suspended",FORCE_CHANGE_PASSWORD:"Password change required"},Qze={request_failed:"The request did not finish. Refresh the list to confirm its current state before retrying",invalid_response:"The user service returned an invalid response. Refresh and try again",identity_unavailable:"Identity is unavailable. Try again later or check service permissions",identity_resource_missing:"The user or user pool no longer exists. Refresh the list",super_administrator_required:"Only super administrators can manage users",sign_in_required:"Sign in and try again",user_not_in_pool:"Your account does not belong to this user pool",user_disabled:"Your account is disabled",protected_administrator:"The initial super administrator cannot be demoted",cannot_demote_self:"You cannot demote your own super administrator role",role_change_conflict:"The role has changed. Close this dialog and refresh the list before retrying",cross_origin_request:"Change roles from the current Studio page"},fur=Object.freeze(Object.defineProperty({__proto__:null,actions:cze,allRoles:wze,back:gze,cancel:pze,changeRole:uze,close:hze,default:{title:nze,memberCount:ize,user:aze,role:oze,status:sze,lastLogin:lze,actions:cze,changeRole:uze,close:hze,save:dze,saving:fze,cancel:pze,back:gze,pool:mze,volcengineIdentity:vze,searchPlaceholder:yze,search:bze,filterRole:xze,allRoles:wze,refresh:Aze,loading:Sze,updatedAt:Tze,saved:Cze,retry:Oze,you:kze,initialAdministrator:Eze,protectedExplanation:_ze,effectiveAfterRefresh:Rze,roleConflict:Dze,noUsers:Lze,tryAnotherSearch:Mze,poolEmpty:Ize,resultCount:Pze,previous:Nze,next:Bze,neverLoggedIn:$ze,unknown:Fze,roles:zze,descriptions:Uze,states:Vze,errors:Qze},descriptions:Uze,effectiveAfterRefresh:Rze,errors:Qze,filterRole:xze,initialAdministrator:Eze,lastLogin:lze,loading:Sze,memberCount:ize,neverLoggedIn:$ze,next:Bze,noUsers:Lze,pool:mze,poolEmpty:Ize,previous:Nze,protectedExplanation:_ze,refresh:Aze,resultCount:Pze,retry:Oze,role:oze,roleConflict:Dze,roles:zze,save:dze,saved:Cze,saving:fze,search:bze,searchPlaceholder:yze,states:Vze,status:sze,title:nze,tryAnotherSearch:Mze,unknown:Fze,updatedAt:Tze,user:aze,volcengineIdentity:vze,you:kze},Symbol.toStringTag,{value:"Module"})),Gze="Website integration",Hze="Embed an AgentKit Runtime on your website as a floating chat window",Wze="Back to automations",Yze="Add website",qze="Loading Runtime",jze="Select Runtime",Xze="Website domain",Kze="For example, xxxx.com or localhost:5173",Zze="Generating",Jze="Generate token",eUe="Added websites",tUe="{{count}} website",rUe="{{count}} websites",nUe="Loading website integrations",iUe="No website integrations yet",aUe="Select a Runtime and enter a website domain to generate a token",oUe="Embed instructions",sUe="Place this code before the closing body tag on your website",lUe="Copied",cUe="Copy code",uUe="Embed code will appear here after you add a website.",hUe="Delete the website integration for {{domain}}?",dUe={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"},fUe={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"},pur=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:Yze,addedWebsites:eUe,backToAutomations:Wze,confirmDelete:hUe,copied:lUe,copyCode:cUe,default:{title:Gze,description:Hze,backToAutomations:Wze,addWebsite:Yze,loadingRuntime:qze,selectRuntime:jze,websiteDomain:Xze,domainPlaceholder:Kze,generating:Zze,generateToken:Jze,addedWebsites:eUe,websiteCount_one:tUe,websiteCount_other:rUe,loadingIntegrations:nUe,delete:"Delete",emptyTitle:iUe,emptyDescription:aUe,embedMethod:oUe,embedInstructions:sUe,copied:lUe,copyCode:cUe,embedHint:uUe,confirmDelete:hUe,errors:dUe,widget:fUe},description:Hze,domainPlaceholder:Kze,embedHint:uUe,embedInstructions:sUe,embedMethod:oUe,emptyDescription:aUe,emptyTitle:iUe,errors:dUe,generateToken:Jze,generating:Zze,loadingIntegrations:nUe,loadingRuntime:qze,selectRuntime:jze,title:Gze,websiteCount_one:tUe,websiteCount_other:rUe,websiteDomain:Xze,widget:fUe},Symbol.toStringTag,{value:"Module"})),pUe={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"}},gUe={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},mUe={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"},vUe={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"},yUe={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}}"},bUe={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}}"}},xUe={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},wUe={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)"},AUe={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."},SUe={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."},TUe={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"},CUe={labels:{coding:"Coding",get_city_weather:"City weather",get_location_weather:"Location weather",web_fetch:"Fetch web content",studio_write_artifact:"Save session artifact"},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"},OUe={artifactLibrary:pUe,resourceMetadata:gUe,artifactEdit:mUe,codeBrowser:vUe,search:yUe,developerResources:bUe,library:xUe,manageAgents:wUe,agentTopology:AUe,sessionEnvironment:SUe,agentKitCli:TUe,studioTools:CUe},gur=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:TUe,agentTopology:AUe,artifactEdit:mUe,artifactLibrary:pUe,codeBrowser:vUe,default:OUe,developerResources:bUe,library:xUe,manageAgents:wUe,resourceMetadata:gUe,search:yUe,sessionEnvironment:SUe,studioTools:CUe},Symbol.toStringTag,{value:"Module"})),kUe={requestFailed:"请求失败 ({{status}})",unknownError:"未知错误",contentTypeMissing:"Content-Type 缺失",response:"响应:{{response}}",fallbackWithDetail:"{{fallback}}:{{detail}}",fallbackWithHttpStatus:"{{fallback}}(HTTP {{status}})",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应({{contentType}})"},EUe={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 返回了无效的终端地址。"},_Ue={cnBeijing:"华北 2(北京)",cnShanghai:"华东 2(上海)"},RUe={runtimeUnsupported:"该 Runtime 暂不支持连接,请确认服务已正常运行。"},DUe={autoConfigureFailed:"飞书机器人自动配置失败"},LUe={actionFailed:"{{action}}失败",detail:"详细信息:{{detail}}",request:"请求:{{request}}"},MUe={persistentMemoryHint:"提示:会话已不存在。使用 in-memory 或 SQLite 短期记忆时,多实例、进程重启或滚动发布都可能导致会话丢失;建议改用基于数据库的持久化短期记忆存储。",unsupportedRouteHint:"提示:该 Runtime 未提供会话能力运行接口,可能是 Runtime 版本与当前 Studio 不兼容。",toolArgumentHint:"提示:模型生成的工具参数格式不完整,请重新发送一次。",resourceCollectionExpiredHint:"提示:本次资源清单已失效,请重新发送任务;系统会重新收集资源后再创建 Agent。",networkConfigurationHint:"提示:请稍后重试,查看 Runtime、模型或网关日志。",modelQuotaHint:"提示:模型当前触发了 TPM/RPM 配额限制,请稍后重试或提高模型配额。",rawResponseLabel:"原始响应:"},IUe={httpStatus:"HTTP 状态码:{{status}}",errorCode:"错误码:{{code}}",cloudResponseBody:`云端响应正文: -{{body}}`,loadFailedWithDetail:"读取实例日志失败:{{detail}}",invalidFormat:"读取实例日志失败:服务返回格式无效"},PUe={untitledSession:"未命名会话",webUnavailable:"网络搜索接口未就绪(后端未启用 /web/search)。",webFailed:"网络搜索失败:{{message}}",webNotMounted:"当前 Agent 未挂载 web_search 工具。",knowledgeNotMounted:"该 Agent 未挂载知识库。",memoryNotMounted:"该 Agent 未挂载长期记忆。",knowledge:"知识库",longTermMemory:"长期记忆"},NUe={listSpacesFailed:"读取 Skill 空间失败",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",deleteSpaceFailed:"删除 Skill 空间失败",uploadFailed:"上传 Skill 失败",validateFailed:"校验 Skill 失败",deleteFailed:"删除 Skill 失败",listFilesFailed:"读取 Skill 文件失败",downloadFailed:"下载 Skill 失败",sharedSpaceFailed:"共享空间加载失败",reservedSpaceName:"此名称由系统空间保留,请使用其他名称",reviewSpaceFailed:"待审核空间暂不可用",submitReviewFailed:"申请公开失败",listReviewsFailed:"加载审核申请失败",reviewFilesFailed:"加载提交文件失败",decideReviewFailed:"审批失败,请重试",listVersionsFailed:"无法加载技能版本",uploadVersionFailed:"上传技能新版本失败"},BUe={truncatedData:"{{data}}…(已截断,共 {{count}} 个字符)",incompleteEvent:"SSE 流在事件完整返回前已结束。原始数据:{{data}}",invalidEventJson:"无法解析 SSE 事件中的 JSON。原始数据:{{data}}"},$Ue={loadConfigNetworkFailed:"无法加载登录配置,请检查网络后重试。",configServiceFailed:"登录配置服务异常(HTTP {{status}}),请稍后重试。",invalidConfigResponse:"登录配置服务返回了无法解析的响应,请稍后重试。",serviceNetworkFailed:"无法连接身份服务,请检查网络后重试。",invalidServiceResponse:"身份服务返回了无法解析的响应,请稍后重试。",serviceFailed:"身份服务异常(HTTP {{status}}),请稍后重试。"},FUe={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"},zUe={loadCapabilitiesFailed:"加载视频模型能力失败",uploadAssetFailed:"上传{{fileName}}失败",enhancePromptFailed:"提示词优化失败",createTaskFailed:"创建视频生成任务失败",getTaskFailed:"查询视频生成任务失败",downloadFailed:"下载生成视频失败"},UUe={listFailed:"加载网站集成失败",createFailed:"创建网站集成失败",deleteFailed:"删除网站集成失败"},VUe={loadFailed:"读取知识库失败",htmlHidden:"[HTML 内容已隐藏]",redacted:"[已脱敏]",depthTruncated:"[内容过深,已截断]",circularReference:"[循环引用]",diagnosticsUnavailable:"[诊断信息无法显示]",statusCode:"状态码:{{status}}",errorCode:"错误码:{{code}}",requestId:"请求 ID:{{requestId}}",diagnostics:"诊断:{{diagnostics}}",detail:"详情:{{detail}}",signInRequired:"请先登录后再访问知识库",forbidden:"你没有权限操作这个知识库",notFound:"知识库或知识内容不存在",conflict:"知识库当前状态不允许执行此操作",requestFailed:"知识库请求失败 ({{status}})"},QUe={invalidName:"名称须为 1~128 个字符,不能包含控制字符、不可见格式字符或 < >。",renameProjectFailed:"修改项目名称失败",renameVersionFailed:"修改版本名称失败",invalidNameUpdateResponse:"名称更新响应与请求不一致,请刷新后重试。",invalidSourceSnapshot:"源码快照的响应格式无效。",invalidProjectList:"项目列表的响应格式无效。",invalidProjectVersion:"项目版本的响应格式无效。",loadProjectsFailed:"无法读取已保存项目",loadVersionsFailed:"无法读取项目版本",deleteVersionFailed:"删除项目版本失败",invalidDeleteVersionResponse:"删除项目版本的响应格式无效。",loadProjectSourceFailed:"无法读取项目源码",loadSnapshotFailed:"无法读取源码快照",restoreSnapshotFailed:"无法恢复当前源码快照",downloadSourceFailed:"下载源码失败",downloadNotZip:"源码下载响应不是 ZIP 文件。",downloadSizeMismatch:"源码压缩包大小与发布记录不一致,请重试。"},GUe={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:"下载迁移产物失败",evaluation:{datasetSaveFailed:"保存评测用例失败",datasetLoadFailed:"读取评测用例失败",statusLoadFailed:"读取评测状态失败",resumeFailed:"继续评测失败",retryFailed:"重新评测失败",reportLoadFailed:"读取评测报告失败",reportDownloadFailed:"下载评测报告失败"},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:"迁移会话列表",evaluationAsset:"评测资产",evaluation:"评测状态",evaluationCapabilities:"评测能力",evaluationDimension:"评测维度",evaluationCase:"评测用例",evaluationCriteria:"评测标准",evaluationMessage:"评测对话",evaluationDataset:"评测数据集",evaluationDimensionResult:"评测维度结果",evaluationEvidence:"评测证据",evaluationReport:"评测报告",evaluationSummary:"评测汇总",evaluationCaseResult:"评测用例结果",evaluationOutput:"评测输出",evaluationLimitations:"评测限制"}},HUe={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:"未找到要唤醒的智能体。",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}} 返回了不安全的地址。"},WUe={invalidSandboxVersion:"沙箱版本响应格式无效",loadSandboxVersionsFailed:"查询沙箱版本失败",updateSandboxFailed:"更新 Sandbox 失败",invalidSandboxUpdate:"沙箱更新响应格式无效",errorWithDetailAndRawResponse:`{{context}} +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"}},x9e={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"}},w9e={label:"Build tasks",queued:"Build queued",running:"Build running in the background",recovering:"Recovering build",waiting_user:"Build needs attention",stopping:"Stopping build",succeeded:"Build completed",cancelled:"Build stopped",failed:"Build could not complete",open:"Return to task",hide:"Hide task notification",reconnecting:"Reconnecting to the task service. Existing tasks are retained."},uur=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:v9e,agentWorkspace:y9e,approval:f9e,commands:x9e,common:l9e,composer:p9e,default:{common:l9e,tool:c9e,threads:u9e,permissions:h9e,workspace:d9e,approval:f9e,composer:p9e,launch:g9e,session:m9e,agentDetails:v9e,agentWorkspace:y9e,handoff:b9e,commands:x9e,taskNotice:w9e},handoff:b9e,launch:g9e,permissions:h9e,session:m9e,taskNotice:w9e,threads:u9e,tool:c9e,workspace:d9e},Symbol.toStringTag,{value:"Module"})),A9e={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."},S9e={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"},T9e={breadcrumbs:"Breadcrumbs",selectAgent:"Select Agent",switchAgent:"Switch Agent"},C9e={cancel:"Cancel",close:"Close confirmation dialog"},hur=Object.freeze(Object.defineProperty({__proto__:null,authExpired:S9e,confirm:C9e,default:{login:A9e,authExpired:S9e,navbar:T9e,confirm:C9e},login:A9e,navbar:T9e},Symbol.toStringTag,{value:"Module"})),O9e={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",super_admin:"Super administrator"}},k9e={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",users:"User management",administration:"Administration",reviewCenter:"Review center"},E9e={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"},dur=Object.freeze(Object.defineProperty({__proto__:null,account:O9e,default:{account:O9e,navigation:k9e,history:E9e},history:E9e,navigation:k9e},Symbol.toStringTag,{value:"Module"})),_9e={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."},R9e={unsupportedActivity:"Unsupported Skill conversation activity",ariaLabel:"Skill generation conversation"},D9e={code:"Error code: {{code}}",type:"Error type: {{type}}",representation:"Exception representation: {{value}}",rawResponse:`Raw server response: +{{value}}`,original:"Original error: {{message}}",details:"Details"},L9e={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"},M9e={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)"},I9e={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."},P9e={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"},fur=Object.freeze(Object.defineProperty({__proto__:null,api:P9e,configSelect:_9e,conversation:R9e,default:{configSelect:_9e,conversation:R9e,errorDetails:D9e,fileTree:L9e,management:M9e,generation:I9e,api:P9e},errorDetails:D9e,fileTree:L9e,generation:I9e,management:M9e},Symbol.toStringTag,{value:"Module"})),N9e={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"},B9e={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"},$9e={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"},F9e={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"}},z9e={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."}},U9e={searchPlaceholder:"Search resource names",emptyMessage:"No options available",searchAriaLabel:"Search {{label}}",loadingMore:"Loading more resources…"},V9e={retryDeployment:"Retry deployment",retrying:"Retrying…",collapse:"Collapse error details",expand:"Expand full error details",copy:"Copy full error details"},Q9e={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"},G9e={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."},H9e={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"},W9e={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"},Y9e={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."},q9e={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"},j9e={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."}},X9e={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.",codeProjects:"Code projects"},K9e={back:"Back",detailNavigation:"Detail navigation",noData:"No data",actions:"Actions",moreActions:"More actions for {{label}}",actionsFor:"Actions for {{label}}",loading:"Loading resources…"},Z9e={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"}},J9e={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"},eze={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"}},tze={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:"Asleep",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:"Asleep",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"},wakingHint:"Waking the agent. This may take some time."},rze={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"},sharedSpace:"Enterprise shared space",sharedDescription:"Skills available to everyone, published and maintained by administrators",sharedVisibility:"Everyone",sharedPreparing:"Preparing shared space",sharedLoadFailed:"Shared space unavailable",sharedEmpty:"No shared skills yet. Skills published by administrators will appear here",requestPublication:"Request publication",reviewSubmitting:"Submitting…",reviewSubmitted:"Submitted",reviewFailed:"Could not submit the publication request",reviewStatusFailed:"Failed to load review status",reviewRetry:"Apply again",reviewPending:"Pending review",reviewApproving:"Publishing",reviewApproved:"Shared",reviewReturned:"Returned",reviewHistory:"Review history",skillDetailSections:"Skill detail sections",versions:{title:"Version management",refresh:"Refresh",uploading:"Uploading…",upload:"Upload new version",close:"Close",hint:"New versions become public after approval and do not replace published versions; the skill name in the ZIP must match the original",loading:"Loading versions…",loadFailed:"Unable to load versions",filesFailed:"Unable to load version files",uploadFailed:"Unable to upload the new version",submitFailed:"Unable to submit for review",retry:"Retry",empty:"No versions yet",current:"Current version",notSubmitted:"Not submitted",submitting:"Submitting…",submit:"Request publication",processing:"Version status: {{status}}",filesLoading:"Loading files…",filesEmpty:"No files",history:"Review history",shared:"Published"},author:"Author",authorName:"Author: {{name}}"},nze={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"}},pur=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:B9e,agentSelector:eze,agentWorkspace:F9e,cloudEnvironment:G9e,common:N9e,composer:J9e,default:{common:N9e,agentKitPromo:B9e,systemInfo:$9e,agentWorkspace:F9e,environmentCenter:z9e,deploymentSelect:U9e,deploymentError:V9e,studioBuildProgress:Q9e,cloudEnvironment:G9e,githubCicd:H9e,feishuDeployment:W9e,deploymentResources:Y9e,studioUpdate:q9e,projectPreview:j9e,workspace:X9e,resourceCollection:K9e,skillSourcePicker:Z9e,composer:J9e,agentSelector:eze,myAgents:tze,skillCenter:rze,knowledge:nze},deploymentError:V9e,deploymentResources:Y9e,deploymentSelect:U9e,environmentCenter:z9e,feishuDeployment:W9e,githubCicd:H9e,knowledge:nze,myAgents:tze,projectPreview:j9e,resourceCollection:K9e,skillCenter:rze,skillSourcePicker:Z9e,studioBuildProgress:Q9e,studioUpdate:q9e,systemInfo:$9e,workspace:X9e},Symbol.toStringTag,{value:"Module"})),ize="User management",aze="{{count}} members",oze="User",sze="Role",lze="Account status",cze="Last sign-in",uze="Actions",hze="Change role",dze="Close",fze="Save role",pze="Saving…",gze="Cancel",mze="Back",vze="User pool",yze="Volcengine Identity",bze="Search name, email or user ID",xze="Search",wze="Filter by role",Aze="All roles",Sze="Refresh",Tze="Loading users…",Cze="Updated at {{time}}",Oze="{{name}} is now {{role}}",kze="Retry",Eze="You",_ze="Initial super administrator",Rze="The initial super administrator cannot be demoted here",Dze="The new permissions apply when the user refreshes Studio",Lze="Role needs confirmation",Mze="No matching users",Ize="Try another search or role",Pze="Users appear here after signing in or joining this user pool",Nze="{{count}} users",Bze="Previous",$ze="Next",Fze="Not signed in yet",zze="Not provided",Uze={super_admin:"Super administrator",admin:"Administrator",developer:"Developer",user:"User"},Vze={super_admin:"Manage all resources, users and role assignments",admin:"Manage Studio resources",developer:"Develop agents and manage your own resources",user:"Use agents and personal features"},Qze={EXTERNAL_PROVIDER:"Active",CONFIRMED:"Active",NORMAL:"Active",ENABLED:"Active",ACTIVE:"Active",UNCONFIRMED:"Unverified",DISABLED:"Disabled",FORBIDDEN:"Disabled",LOCKED:"Locked",SUSPENDED:"Suspended",FORCE_CHANGE_PASSWORD:"Password change required"},Gze={request_failed:"The request did not finish. Refresh the list to confirm its current state before retrying",invalid_response:"The user service returned an invalid response. Refresh and try again",identity_unavailable:"Identity is unavailable. Try again later or check service permissions",identity_resource_missing:"The user or user pool no longer exists. Refresh the list",super_administrator_required:"Only super administrators can manage users",sign_in_required:"Sign in and try again",user_not_in_pool:"Your account does not belong to this user pool",user_disabled:"Your account is disabled",protected_administrator:"The initial super administrator cannot be demoted",cannot_demote_self:"You cannot demote your own super administrator role",role_change_conflict:"The role has changed. Close this dialog and refresh the list before retrying",cross_origin_request:"Change roles from the current Studio page"},gur=Object.freeze(Object.defineProperty({__proto__:null,actions:uze,allRoles:Aze,back:mze,cancel:gze,changeRole:hze,close:dze,default:{title:ize,memberCount:aze,user:oze,role:sze,status:lze,lastLogin:cze,actions:uze,changeRole:hze,close:dze,save:fze,saving:pze,cancel:gze,back:mze,pool:vze,volcengineIdentity:yze,searchPlaceholder:bze,search:xze,filterRole:wze,allRoles:Aze,refresh:Sze,loading:Tze,updatedAt:Cze,saved:Oze,retry:kze,you:Eze,initialAdministrator:_ze,protectedExplanation:Rze,effectiveAfterRefresh:Dze,roleConflict:Lze,noUsers:Mze,tryAnotherSearch:Ize,poolEmpty:Pze,resultCount:Nze,previous:Bze,next:$ze,neverLoggedIn:Fze,unknown:zze,roles:Uze,descriptions:Vze,states:Qze,errors:Gze},descriptions:Vze,effectiveAfterRefresh:Dze,errors:Gze,filterRole:wze,initialAdministrator:_ze,lastLogin:cze,loading:Tze,memberCount:aze,neverLoggedIn:Fze,next:$ze,noUsers:Mze,pool:vze,poolEmpty:Pze,previous:Bze,protectedExplanation:Rze,refresh:Sze,resultCount:Nze,retry:kze,role:sze,roleConflict:Lze,roles:Uze,save:fze,saved:Oze,saving:pze,search:xze,searchPlaceholder:bze,states:Qze,status:lze,title:ize,tryAnotherSearch:Ize,unknown:zze,updatedAt:Cze,user:oze,volcengineIdentity:yze,you:Eze},Symbol.toStringTag,{value:"Module"})),Hze="Website integration",Wze="Embed an AgentKit Runtime on your website as a floating chat window",Yze="Back to automations",qze="Add website",jze="Loading Runtime",Xze="Select Runtime",Kze="Website domain",Zze="For example, xxxx.com or localhost:5173",Jze="Generating",eUe="Generate token",tUe="Added websites",rUe="{{count}} website",nUe="{{count}} websites",iUe="Loading website integrations",aUe="No website integrations yet",oUe="Select a Runtime and enter a website domain to generate a token",sUe="Embed instructions",lUe="Place this code before the closing body tag on your website",cUe="Copied",uUe="Copy code",hUe="Embed code will appear here after you add a website.",dUe="Delete the website integration for {{domain}}?",fUe={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"},pUe={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"},mur=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:qze,addedWebsites:tUe,backToAutomations:Yze,confirmDelete:dUe,copied:cUe,copyCode:uUe,default:{title:Hze,description:Wze,backToAutomations:Yze,addWebsite:qze,loadingRuntime:jze,selectRuntime:Xze,websiteDomain:Kze,domainPlaceholder:Zze,generating:Jze,generateToken:eUe,addedWebsites:tUe,websiteCount_one:rUe,websiteCount_other:nUe,loadingIntegrations:iUe,delete:"Delete",emptyTitle:aUe,emptyDescription:oUe,embedMethod:sUe,embedInstructions:lUe,copied:cUe,copyCode:uUe,embedHint:hUe,confirmDelete:dUe,errors:fUe,widget:pUe},description:Wze,domainPlaceholder:Zze,embedHint:hUe,embedInstructions:lUe,embedMethod:sUe,emptyDescription:oUe,emptyTitle:aUe,errors:fUe,generateToken:eUe,generating:Jze,loadingIntegrations:iUe,loadingRuntime:jze,selectRuntime:Xze,title:Hze,websiteCount_one:rUe,websiteCount_other:nUe,websiteDomain:Kze,widget:pUe},Symbol.toStringTag,{value:"Module"})),gUe={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"}},mUe={unknownSource:"Unknown source",unknownCreator:"Unknown creator"},vUe={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"},yUe={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"},bUe={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}}"},xUe={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}}"}},wUe={title:"Library",untitledSession:"Untitled session",categoryAria:"Library categories",regionAria:"Region",tabs:{skills:"Skills",knowledge:"Knowledge",artifacts:"Artifacts"}},AUe={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)"},SUe={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."},TUe={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."},CUe={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"},OUe={labels:{coding:"Coding",get_city_weather:"City weather",get_location_weather:"Location weather",web_fetch:"Fetch web content",studio_write_artifact:"Save session artifact"},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"},kUe={artifactLibrary:gUe,resourceMetadata:mUe,artifactEdit:vUe,codeBrowser:yUe,search:bUe,developerResources:xUe,library:wUe,manageAgents:AUe,agentTopology:SUe,sessionEnvironment:TUe,agentKitCli:CUe,studioTools:OUe},vur=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:CUe,agentTopology:SUe,artifactEdit:vUe,artifactLibrary:gUe,codeBrowser:yUe,default:kUe,developerResources:xUe,library:wUe,manageAgents:AUe,resourceMetadata:mUe,search:bUe,sessionEnvironment:TUe,studioTools:OUe},Symbol.toStringTag,{value:"Module"})),EUe={requestFailed:"请求失败 ({{status}})",unknownError:"未知错误",contentTypeMissing:"Content-Type 缺失",response:"响应:{{response}}",fallbackWithDetail:"{{fallback}}:{{detail}}",fallbackWithHttpStatus:"{{fallback}}(HTTP {{status}})",nonJsonResponse:"{{fallback}}:服务端返回非 JSON 响应({{contentType}})"},_Ue={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 返回了无效的终端地址。"},RUe={cnBeijing:"华北 2(北京)",cnShanghai:"华东 2(上海)"},DUe={runtimeUnsupported:"该 Runtime 暂不支持连接,请确认服务已正常运行。"},LUe={autoConfigureFailed:"飞书机器人自动配置失败"},MUe={actionFailed:"{{action}}失败",detail:"详细信息:{{detail}}",request:"请求:{{request}}"},IUe={persistentMemoryHint:"提示:会话已不存在。使用 in-memory 或 SQLite 短期记忆时,多实例、进程重启或滚动发布都可能导致会话丢失;建议改用基于数据库的持久化短期记忆存储。",unsupportedRouteHint:"提示:该 Runtime 未提供会话能力运行接口,可能是 Runtime 版本与当前 Studio 不兼容。",toolArgumentHint:"提示:模型生成的工具参数格式不完整,请重新发送一次。",resourceCollectionExpiredHint:"提示:本次资源清单已失效,请重新发送任务;系统会重新收集资源后再创建 Agent。",networkConfigurationHint:"提示:请稍后重试,查看 Runtime、模型或网关日志。",modelQuotaHint:"提示:模型当前触发了 TPM/RPM 配额限制,请稍后重试或提高模型配额。",rawResponseLabel:"原始响应:"},PUe={httpStatus:"HTTP 状态码:{{status}}",errorCode:"错误码:{{code}}",cloudResponseBody:`云端响应正文: +{{body}}`,loadFailedWithDetail:"读取实例日志失败:{{detail}}",invalidFormat:"读取实例日志失败:服务返回格式无效"},NUe={untitledSession:"未命名会话",webUnavailable:"网络搜索接口未就绪(后端未启用 /web/search)。",webFailed:"网络搜索失败:{{message}}",webNotMounted:"当前 Agent 未挂载 web_search 工具。",knowledgeNotMounted:"该 Agent 未挂载知识库。",memoryNotMounted:"该 Agent 未挂载长期记忆。",knowledge:"知识库",longTermMemory:"长期记忆"},BUe={listSpacesFailed:"读取 Skill 空间失败",createSpaceFailed:"创建 Skill 空间失败",updateSpaceFailed:"更新 Skill 空间失败",deleteSpaceFailed:"删除 Skill 空间失败",uploadFailed:"上传 Skill 失败",validateFailed:"校验 Skill 失败",deleteFailed:"删除 Skill 失败",listFilesFailed:"读取 Skill 文件失败",downloadFailed:"下载 Skill 失败",sharedSpaceFailed:"共享空间加载失败",reservedSpaceName:"此名称由系统空间保留,请使用其他名称",reviewSpaceFailed:"待审核空间暂不可用",submitReviewFailed:"申请公开失败",listReviewsFailed:"加载审核申请失败",reviewFilesFailed:"加载提交文件失败",decideReviewFailed:"审批失败,请重试",listVersionsFailed:"无法加载技能版本",uploadVersionFailed:"上传技能新版本失败"},$Ue={truncatedData:"{{data}}…(已截断,共 {{count}} 个字符)",incompleteEvent:"SSE 流在事件完整返回前已结束。原始数据:{{data}}",invalidEventJson:"无法解析 SSE 事件中的 JSON。原始数据:{{data}}"},FUe={loadConfigNetworkFailed:"无法加载登录配置,请检查网络后重试。",configServiceFailed:"登录配置服务异常(HTTP {{status}}),请稍后重试。",invalidConfigResponse:"登录配置服务返回了无法解析的响应,请稍后重试。",serviceNetworkFailed:"无法连接身份服务,请检查网络后重试。",invalidServiceResponse:"身份服务返回了无法解析的响应,请稍后重试。",serviceFailed:"身份服务异常(HTTP {{status}}),请稍后重试。"},zUe={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"},UUe={loadCapabilitiesFailed:"加载视频模型能力失败",uploadAssetFailed:"上传{{fileName}}失败",enhancePromptFailed:"提示词优化失败",createTaskFailed:"创建视频生成任务失败",getTaskFailed:"查询视频生成任务失败",downloadFailed:"下载生成视频失败"},VUe={listFailed:"加载网站集成失败",createFailed:"创建网站集成失败",deleteFailed:"删除网站集成失败"},QUe={loadFailed:"读取知识库失败",htmlHidden:"[HTML 内容已隐藏]",redacted:"[已脱敏]",depthTruncated:"[内容过深,已截断]",circularReference:"[循环引用]",diagnosticsUnavailable:"[诊断信息无法显示]",statusCode:"状态码:{{status}}",errorCode:"错误码:{{code}}",requestId:"请求 ID:{{requestId}}",diagnostics:"诊断:{{diagnostics}}",detail:"详情:{{detail}}",signInRequired:"请先登录后再访问知识库",forbidden:"你没有权限操作这个知识库",notFound:"知识库或知识内容不存在",conflict:"知识库当前状态不允许执行此操作",requestFailed:"知识库请求失败 ({{status}})"},GUe={invalidName:"名称须为 1~128 个字符,不能包含控制字符、不可见格式字符或 < >。",renameProjectFailed:"修改项目名称失败",renameVersionFailed:"修改版本名称失败",invalidNameUpdateResponse:"名称更新响应与请求不一致,请刷新后重试。",invalidSourceSnapshot:"源码快照的响应格式无效。",invalidProjectList:"项目列表的响应格式无效。",invalidProjectVersion:"项目版本的响应格式无效。",loadProjectsFailed:"无法读取已保存项目",loadVersionsFailed:"无法读取项目版本",deleteVersionFailed:"删除项目版本失败",invalidDeleteVersionResponse:"删除项目版本的响应格式无效。",loadProjectSourceFailed:"无法读取项目源码",loadSnapshotFailed:"无法读取源码快照",restoreSnapshotFailed:"无法恢复当前源码快照",downloadSourceFailed:"下载源码失败",downloadNotZip:"源码下载响应不是 ZIP 文件。",downloadSizeMismatch:"源码压缩包大小与发布记录不一致,请重试。"},HUe={invalidFormat:"{{label}}格式错误。",validationSeparator:";",invalidAnalysisResult:"迁移分析结果格式错误。",invalidFrameworkCandidate:"框架候选格式错误。",invalidAnalysisEvidence:"分析证据格式错误。",invalidEntryCandidate:"入口候选格式错误。",invalidQuestion:"待确认问题格式错误。",invalidPendingInput:"分析问题无法读取",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:"读取迁移执行动态失败",loadEventsFailed:"订阅迁移进度流失败",invalidEventsResponse:"迁移进度流返回了非法数据帧。",reconnecting:"连接已断开,正在重新连接迁移进度流…",startFailed:"启动迁移失败",submitAnswersFailed:"提交分析补充信息失败",submitInputFailed:"提交分析回答失败",stopFailed:"终止迁移失败",deleteTaskFailed:"删除迁移会话失败",loadArtifactFailed:"读取迁移产物失败",loadArtifactFileFailed:"读取迁移产物文件失败",downloadArtifactFailed:"下载迁移产物失败",evaluation:{datasetSaveFailed:"保存评测用例失败",datasetLoadFailed:"读取评测用例失败",statusLoadFailed:"读取评测状态失败",resumeFailed:"继续评测失败",retryFailed:"重新评测失败",reportLoadFailed:"读取评测报告失败",reportDownloadFailed:"下载评测报告失败"},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:"迁移会话列表",evaluationAsset:"评测资产",evaluation:"评测状态",evaluationCapabilities:"评测能力",evaluationDimension:"评测维度",evaluationCase:"评测用例",evaluationCriteria:"评测标准",evaluationMessage:"评测对话",evaluationDataset:"评测数据集",evaluationDimensionResult:"评测维度结果",evaluationEvidence:"评测证据",evaluationReport:"评测报告",evaluationSummary:"评测汇总",evaluationCaseResult:"评测用例结果",evaluationOutput:"评测输出",evaluationLimitations:"评测限制",pendingInput:"分析提问",pendingQuestion:"分析问题项",pendingOption:"分析问题选项"}},WUe={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:"未找到要唤醒的智能体。",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}} 返回了不安全的地址。"},YUe={invalidSandboxVersion:"沙箱版本响应格式无效",loadSandboxVersionsFailed:"查询沙箱版本失败",updateSandboxFailed:"更新 Sandbox 失败",invalidSandboxUpdate:"沙箱更新响应格式无效",errorWithDetailAndRawResponse:`{{context}} {{detail}} 响应详情: {{response}}`,errorWithRawResponse:`{{context}} @@ -77,20 +77,20 @@ Original error: {{message}}`,unavailable:"Connection unavailable",requestFailed: {{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:"60 秒内未收到首个 SSE 事件。请稍后重试,或查看 Runtime、模型、网关日志定位原因。",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",loadMcpCredentialsFailed:"读取 MCP 认证信息失败",invalidMcpCredentials:"Studio 返回的 MCP 认证信息格式无效",deleteFailed:"删除失败 ({{status}})",runtimeManageForbidden:"当前账号没有管理该 Runtime 的权限。",runtimeNotFound:"该 Runtime 不存在或已被删除。",runtimeUnavailable:"当前账号无法访问该 Runtime。",checkRuntimeUpdateFailed:"检查 Runtime 更新能力失败(HTTP {{status}}),请稍后重试。",loadRuntimeDetailFailed:"加载 Runtime 详情失败",generateProjectFailed:"生成项目失败",generateAgentConfigFailed:"生成 Agent 配置失败",createDebugRunFailed:"创建调试运行失败",createDebugSessionFailed:"创建调试会话失败",loadDebugTraceFailed:"加载调试调用链路失败",invalidDebugTrace:"加载调试调用链路失败:返回格式无效",debugRunFailed:"调试运行失败",cleanupDebugRunFailed:"清理调试运行失败",errorWithCloudResponse:`{{context}} 云接口:{{action}} 云服务原始响应: -{{response}}`,emptyCloudResponse:"(响应正文为空)"},YUe={loadFailed:"读取会话模式能力失败(HTTP {{status}})",invalidResponse:"会话模式能力响应格式错误"},qUe={nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},{{contentType}}){{detail}}"},jUe={busy:"工作区正在处理较多请求,请稍后重试",notFound:"工作区不存在",duplicates:"检测到多个个人工作区会话,请联系管理员处理",timeout:"工作区恢复超时,项目仍保留,请重试",unavailable:"工作区暂时无法恢复,原项目仍保留,请重试",persistence:"当前 Sandbox 未启用持久化快照,请检查工作区配置",startup:"个人工作区启动失败,请检查 Sandbox 状态",exists:"项目名称已存在,请从项目列表打开",directory:"项目目录不存在",configuration:"请先配置工作区 Sandbox 镜像",state:"暂时无法确认工作区状态,请重试",list:"恢复工作区或读取项目列表失败,请重试",create:"项目初始化失败,请确认镜像可用后重试",open:"恢复工作区或打开项目失败,请重试",connection:"工作区暂时无法连接,请重试",invalidWorkspaceUrl:"工作区返回了无效的访问地址",operation:"项目操作失败,请重试",invalidProjectUrl:"项目访问地址无效",listFallback:"读取项目列表失败",connectionState:"暂时无法连接工作区,请重试"},XUe={reporting:"正在补齐交付信息",packaging:"正在整理产物",savingVersion:"正在保存版本",finishing:"正在完成请求",submitResult:"提交构建结果",requestFailed:"任务请求失败,请重试。",invalidResponse:"任务状态响应无效。",eventGap:"正在补齐任务输出。",reconnecting:"连接暂时中断,正在重连。已有输出已保留。",input:{pending:"等待送达",sending:"正在确认送达",delivered:"已送达",withdrawn:"已停止发送"},plan:"执行计划",diff:"文件变更",preparing:"正在准备任务",preparingEnvironment:"正在准备开发环境…",connectingEnvironment:"正在连接开发环境…",processing:"正在处理请求",thinking:"正在思考",read:"读取文件 · {{target}}",listFiles:"查看目录 · {{target}}",search:"搜索 · {{target}}",command:"执行命令 · {{target}}",editFiles:"修改文件 · {{target}}",webSearch:"搜索网页 · {{target}}",processSummary:"已处理 {{count}} 项",duration:"{{seconds}} 秒",durationUnits:{milliseconds:"{{value}} 毫秒",hours:"{{value}} 小时",minutes:"{{value}} 分",seconds:"{{value}} 秒"},failedTools:"{{count}} 项执行失败",toolFailed:"执行失败",toolCalls:"{{count}} 次工具调用",turnDuration:"本轮耗时 {{duration}}",toolDuration:"工具累计耗时 {{duration}}",toolDurationPartial:"已记录工具耗时 {{duration}}",toolDurationHelp:"各工具执行耗时之和;并行调用可能使累计耗时超过本轮耗时。",turnStatus:{completed:"已完成",failed:"未完成",interrupted:"已中断",cancelled:"已中断",unavailable:"任务已结束"},notReported:"未上报",partial:"已记录",partialHelp:"本轮记录可能不完整。",tokenDetails:"本轮 Token 用量",model:"本轮模型",totalTokens:"总量",inputTokens:"输入",cachedInputTokens:"缓存命中输入",uncachedInputTokens:"未命中输入",cacheWriteInputTokens:"缓存写入",outputTokens:"输出",reasoningOutputTokens:"推理输出",cacheHitRate:"输入缓存命中率",tokenHelp:"缓存命中属于输入,推理输出属于输出,不重复计入总量。未命中输入 = 输入 − 缓存命中。"},KUe={common:kUe,agentkitCli:EUe,cloudRegion:_Ue,connections:RUe,feishuBot:DUe,requestError:LUe,runSse:MUe,runtimeLogs:IUe,search:PUe,skills:NUe,sse:BUe,identity:$Ue,github:FUe,video:zUe,websiteIntegration:UUe,knowledge:VUe,intelligentDevelopment:QUe,migrations:GUe,sandbox:HUe,client:WUe,newChatCapabilities:YUe,jsonResponse:qUe,workspaceProjects:jUe,developmentRuns:XUe},mur=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:EUe,client:WUe,cloudRegion:_Ue,common:kUe,connections:RUe,default:KUe,developmentRuns:XUe,feishuBot:DUe,github:FUe,identity:$Ue,intelligentDevelopment:QUe,jsonResponse:qUe,knowledge:VUe,migrations:GUe,newChatCapabilities:YUe,requestError:LUe,runSse:MUe,runtimeLogs:IUe,sandbox:HUe,search:PUe,skills:NUe,sse:BUe,video:zUe,websiteIntegration:UUe,workspaceProjects:jUe},Symbol.toStringTag,{value:"Module"})),ZUe="智能体审核",JUe="申请企业内全员使用,审批后生效",eVe="关闭",tVe="刷新",rVe="状态",nVe="申请人",iVe="申请时间",aVe="当前版本",oVe="模型",sVe="退回人",lVe="通过人",cVe="审批时间",uVe="智能体描述",hVe="申请说明",dVe="退回理由",fVe="审批意见",pVe="退回理由(必填)",gVe="提交后内容已变化,请退回并重新申请",mVe="撤回后可以修改 Agent,需要公开时重新申请",vVe="取消公开后其他用户将无法继续使用,确定取消公开吗?",yVe="取消",bVe="确认",xVe="正在保存",wVe="取消公开",AVe="撤回申请",SVe="通过",TVe="直接公开",CVe="申请公开",OVe="全员可见",kVe={pending:"待审核",approved:"已通过",returned:"已退回",withdrawn:"已撤回"},EVe="搜索智能体或申请人",_Ve="地域",RVe="全部状态",DVe="智能体",LVe="操作",MVe="查看并审批",IVe="申请详情",PVe="没有符合条件的申请",NVe="暂无智能体审核申请",BVe="{{count}} / {{limit}} 字",vur=Object.freeze(Object.defineProperty({__proto__:null,actions:LVe,agent:DVe,all:RVe,approve:SVe,approvedBy:lVe,cancel:yVe,close:eVe,comment:fVe,confirm:bVe,contentChanged:gVe,default:{title:ZUe,dialogDescription:JUe,close:eVe,refresh:tVe,statusTitle:rVe,submitter:nVe,submittedAt:iVe,version:aVe,model:oVe,returnedBy:sVe,approvedBy:lVe,reviewedAt:cVe,description:uVe,message:hVe,reason:dVe,comment:fVe,reasonRequired:pVe,contentChanged:gVe,withdrawConfirm:mVe,unpublishConfirm:vVe,cancel:yVe,confirm:bVe,saving:xVe,unpublish:wVe,withdraw:AVe,return:"退回",approve:SVe,publish:TVe,submit:CVe,private:"仅自己可见",enterprise:OVe,status:kVe,search:EVe,region:_Ve,all:RVe,agent:DVe,actions:LVe,review:MVe,details:IVe,noMatches:PVe,empty:NVe,textCount:BVe},description:uVe,details:IVe,dialogDescription:JUe,empty:NVe,enterprise:OVe,message:hVe,model:oVe,noMatches:PVe,publish:TVe,reason:dVe,reasonRequired:pVe,refresh:tVe,region:_Ve,returnedBy:sVe,review:MVe,reviewedAt:cVe,saving:xVe,search:EVe,status:kVe,statusTitle:rVe,submit:CVe,submittedAt:iVe,submitter:nVe,textCount:BVe,title:ZUe,unpublish:wVe,unpublishConfirm:vVe,version:aVe,withdraw:AVe,withdrawConfirm:mVe},Symbol.toStringTag,{value:"Module"})),$Ve={backToEvaluationCase:"返回评测案例",cancel:"取消",copied:"已复制",copy:"复制",exportConversation:"导出会话",retry:"重试"},FVe={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。"}},zVe={subject:{file:"文件修改",command:"命令执行"},decision:{accept:"已允许本次{{subject}}",acceptForSession:"已在本会话中允许{{subject}}",decline:"已拒绝{{subject}}",cancel:"已取消{{subject}}审批"},details:{command:"命令",grantRoot:"授权路径",cwd:"执行目录"}},UVe={noDescription:"暂无描述",region:"地域",unknownAgent:"未知 Agent"},VVe={agentTransfer:"智能体移交",annotationHint:"模型回复;选中文字后可添加批注",continueBranch:"继续“{{branch}}”这个方向",emptyResponse:"本次没有返回可显示的内容。",subagentDescription:"正在执行主 Agent 移交的任务。"},QVe={title:"需要配置 {{provider}} AK/SK",prefix:"智能体工作台需要 {{provider}} 凭据才能使用。请在运行环境中设置",and:"与",suffix:"后重试。"},GVe={buildRunning:{title:"当前构建仍在进行",description:"离开将停止本轮构建;当前会话仍会保留,可稍后从历史会话重新进入。",confirm:"停止并离开"},deleteThread:{title:"删除 Codex 历史会话",description:"将删除“{{name}}”,并从历史会话中移除。",confirm:"确认删除"},returnToCreate:{title:"返回创建首页?",description:"返回后当前填写的内容将会丢失,确定要返回吗?",confirm:"确定返回"}},HVe={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:"参考素材生视频需要至少添加一项参考图片或参考视频。"},WVe={like:"赞",removeLike:"取消点赞",dislike:"踩",removeDislike:"取消点踩",reportIssue:"问题反馈",traceFlameGraph:"Tracing 火焰图"},YVe={0:"今天想做点什么?",1:"有什么可以帮你的?",2:"需要我帮你查点什么吗?",3:"有问题尽管问我",4:"嗨,我们开始吧",5:"开始一段新对话吧",6:"今天想先解决哪件事?",7:"把你的想法告诉我吧",8:"我们从哪里开始?",9:"有什么任务交给我?",10:"准备好一起推进了吗?",11:"说说你现在最关心的问题",12:"今天也一起把事情做好",13:"我在,随时可以开始",intelligentDevelopment:"让灵感自由生长"},qVe={agentCapabilities:"正在检查 Agent 能力…",session:"加载会话…"},jVe={cancelled:"授权已取消。",pasteCallbackUrl:"授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:",popupBlocked:"弹窗被拦截,请允许弹窗后重试。",unsupportedUrl:"授权链接不是 http/https 地址,已阻止打开。"},XVe={volcengine:"火山引擎"},KVe={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:"已更新工作空间"},ZVe={addAgent:"添加智能体",addFromPackage:"从代码包添加",agent:"智能体",automations:"自动化",createAgent:"创建智能体",createSkill:"创建技能",cronJobs:"定时任务",issueFeedback:"问题反馈",library:"资源库",migrateAgent:"迁移智能体",newConversation:"新会话",optimizeSkill:"优化 {{name}}",search:"搜索",skill:"技能",skillLibrary:"技能库",systemInfo:"系统信息",updateAgent:"更新 {{name}}",codeProjects:"代码项目",reviewCenter:"审核中心"},JVe={title:"从工作区新建",description:"创建和管理代码项目,在 VS Code 中编写和调试"},eQe={actions:$Ve,addAgent:FVe,approval:zVe,common:UVe,conversation:VVe,credentials:QVe,dialogs:GVe,errors:HVe,feedback:WVe,greetings:YVe,loading:qVe,oauth:jVe,providers:XVe,sandbox:KVe,titles:ZVe,workspaceProjectEntry:JVe},yur=Object.freeze(Object.defineProperty({__proto__:null,actions:$Ve,addAgent:FVe,approval:zVe,common:UVe,conversation:VVe,credentials:QVe,default:eQe,dialogs:GVe,errors:HVe,feedback:WVe,greetings:YVe,loading:qVe,oauth:jVe,providers:XVe,sandbox:KVe,titles:ZVe,workspaceProjectEntry:JVe},Symbol.toStringTag,{value:"Module"})),tQe="自动化",rQe="连接研发工具,为智能体扩展自动化工作流",nQe="搜索自动化",iQe="自动化分类",aQe={development:"研发",channels:"消息渠道"},oQe="{{category}}自动化列表",sQe="打开{{name}}",lQe="仅本地部署可用",cQe="没有匹配的自动化",uQe="请尝试搜索其他名称",hQe="返回自动化列表",dQe={"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:"GitHub PR 自动评审",description:"通过 GitHub App 在隔离 Sandbox 中评审 Pull Request。",title:"GitHub 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 地址"}}},"gitlab-review":{name:"GitLab MR 自动评审",description:"通过 GitLab 集成在隔离 Sandbox 中评审 Merge Request。"},feishu:{name:"飞书机器人",badge:"Beta",description:"创建飞书机器人,并将消息直接接入 AgentKit Runtime。"},"website-integration":{name:"网站集成",description:"将 AgentKit Runtime 以悬浮聊天窗口嵌入网站。"}},fQe={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 个字符"}}},pQe={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:"没有可预览的文件。"}},gQe={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:"你是一个通过飞书为用户提供帮助的智能助手。准确理解用户问题,给出简洁、可靠的回答;信息不足时先提问澄清,不要臆造事实。"}},bur=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:hQe,cards:dQe,categories:aQe,categoriesLabel:iQe,codingAgents:pQe,default:{title:tQe,description:rQe,search:nQe,categoriesLabel:iQe,categories:aQe,resultsLabel:oQe,open:sQe,localOnly:lQe,emptyTitle:cQe,emptyDescription:uQe,backToAutomations:hQe,cards:dQe,github:fQe,codingAgents:pQe,feishu:gQe},description:rQe,emptyDescription:uQe,emptyTitle:cQe,feishu:gQe,github:fQe,localOnly:lQe,open:sQe,resultsLabel:oQe,search:nQe,title:tQe},Symbol.toStringTag,{value:"Module"})),mQe={"zh-CN":"简体中文","en-US":"English"},xur=Object.freeze(Object.defineProperty({__proto__:null,default:{languageNames:mQe},languageNames:mQe},Symbol.toStringTag,{value:"Module"})),vQe={selectedExcerptLabel:"选中片段",commentLabel:"批注",commentSeparator:":",successTitle:"已加入 Bad case 评测集",successDescription:"这条批注已关联当前问题和完整模型回复。",done:"完成",ariaLabel:"批注选中的模型回复",title:"添加批注",content:"批注内容",placeholder:"说明问题或期望的修改方式",retryError:"{{error}},请重试。",cancel:"取消",submit:"加入 Bad Case"},yQe={attachment:"附件",image:"图片",preview:"预览 {{name}}",uploading:"上传中",uploadFailed:"上传失败",remove:"移除 {{name}}",previewDialog:"{{name}}预览",download:"下载",close:"关闭",reading:"正在读取文档…",loadFailed:"文档加载失败:{{error}}"},bQe={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}} 行"},xQe={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:"选择左侧的一个调用查看详情"},wQe={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}}"},AQe={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",deployAgent:"部署 Agent",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 执行遇到错误"}},SQe={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 未提供模型信息"},TQe={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:"连接并添加"},CQe={placeholder:"输入消息…",inputAria:"输入消息",generating:"正在生成",send:"发送"},OQe={ariaLabel:"本轮调用上下文",removeSkill:"移除技能 {{name}}",removeAgent:"移除 Agent {{name}}"},kQe={cardAria:"{{label}} 图表",viewAria:"{{label}} 显示方式",preview:"预览",code:"代码",invalidEcharts:"ECharts 配置不是有效且安全的数据对象,请切换到代码检查内容。",renderFailed:"图表暂时无法渲染,请切换到代码检查内容。",echartsAria:"ECharts 图表预览",rendering:"正在渲染图表…",mermaidFailed:"图表暂时无法渲染,请切换到代码查看 Mermaid 内容。",mermaidAria:"Mermaid 图表预览"},EQe={playVideo:"点击播放视频:{{name}}",enlargeImage:"放大预览:{{name}}",image:"图片",enlargeVideo:"点击放大视频",videoPreview:"视频预览",downloadVideo:"下载视频",close:"关闭"},_Qe={annotation:vQe,media:yQe,runtimeLogs:bQe,trace:xQe,share:wQe,blocks:AQe,tokenUsage:SQe,addAgentKit:TQe,composer:CQe,invocation:OQe,visualization:kQe,markdown:EQe},wur=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:TQe,annotation:vQe,blocks:AQe,composer:CQe,default:_Qe,invocation:OQe,markdown:EQe,media:yQe,runtimeLogs:bQe,share:wQe,tokenUsage:SQe,trace:xQe,visualization:kQe},Symbol.toStringTag,{value:"Module"})),RQe={back:"返回",cancel:"取消",deploy:"部署",delete:"删除",loading:"读取中…",next:"下一步",notSupported:"暂不支持",previous:"上一步",required:"必填",retry:"重试",actions:"操作",value:"值",disabled:"关闭",enabled:"已开启",none:"无",close:"关闭",name:"名称",description:"描述",send:"发送"},DQe={heading:"VeADK Agent 结构配置",importHint:"可在「创建 Agent」页通过「导入 YAML」重新载入。"},LQe={agentName:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},runtimeName:{required:"Runtime 名称为必填项",characters:"Runtime 名称只能包含英文字母、数字、下划线和连字符",length:"Runtime 名称长度须为 4-64 个字符"}},MQe={description:"一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",instruction:`你是一个专业、可靠的智能助手。 +{{response}}`,emptyCloudResponse:"(响应正文为空)"},qUe={loadFailed:"读取会话模式能力失败(HTTP {{status}})",invalidResponse:"会话模式能力响应格式错误"},jUe={nonJson:"{{fallback}}:服务端返回非 JSON 响应(HTTP {{status}},{{contentType}}){{detail}}"},XUe={busy:"工作区正在处理较多请求,请稍后重试",notFound:"工作区不存在",duplicates:"检测到多个个人工作区会话,请联系管理员处理",timeout:"工作区恢复超时,项目仍保留,请重试",unavailable:"工作区暂时无法恢复,原项目仍保留,请重试",persistence:"当前 Sandbox 未启用持久化快照,请检查工作区配置",startup:"个人工作区启动失败,请检查 Sandbox 状态",exists:"项目名称已存在,请从项目列表打开",directory:"项目目录不存在",configuration:"请先配置工作区 Sandbox 镜像",state:"暂时无法确认工作区状态,请重试",list:"恢复工作区或读取项目列表失败,请重试",create:"项目初始化失败,请确认镜像可用后重试",open:"恢复工作区或打开项目失败,请重试",connection:"工作区暂时无法连接,请重试",invalidWorkspaceUrl:"工作区返回了无效的访问地址",operation:"项目操作失败,请重试",invalidProjectUrl:"项目访问地址无效",listFallback:"读取项目列表失败",connectionState:"暂时无法连接工作区,请重试"},KUe={reporting:"正在补齐交付信息",packaging:"正在整理产物",savingVersion:"正在保存版本",finishing:"正在完成请求",submitResult:"提交构建结果",requestFailed:"任务请求失败,请重试。",invalidResponse:"任务状态响应无效。",eventGap:"正在补齐任务输出。",reconnecting:"连接暂时中断,正在重连。已有输出已保留。",input:{pending:"等待送达",sending:"正在确认送达",delivered:"已送达",withdrawn:"已停止发送"},plan:"执行计划",diff:"文件变更",preparing:"正在准备任务",preparingEnvironment:"正在准备开发环境…",connectingEnvironment:"正在连接开发环境…",processing:"正在处理请求",thinking:"正在思考",read:"读取文件 · {{target}}",listFiles:"查看目录 · {{target}}",search:"搜索 · {{target}}",command:"执行命令 · {{target}}",editFiles:"修改文件 · {{target}}",webSearch:"搜索网页 · {{target}}",processSummary:"已处理 {{count}} 项",duration:"{{seconds}} 秒",durationUnits:{milliseconds:"{{value}} 毫秒",hours:"{{value}} 小时",minutes:"{{value}} 分",seconds:"{{value}} 秒"},failedTools:"{{count}} 项执行失败",toolFailed:"执行失败",toolCalls:"{{count}} 次工具调用",turnDuration:"本轮耗时 {{duration}}",toolDuration:"工具累计耗时 {{duration}}",toolDurationPartial:"已记录工具耗时 {{duration}}",toolDurationHelp:"各工具执行耗时之和;并行调用可能使累计耗时超过本轮耗时。",turnStatus:{completed:"已完成",failed:"未完成",interrupted:"已中断",cancelled:"已中断",unavailable:"任务已结束"},notReported:"未上报",partial:"已记录",partialHelp:"本轮记录可能不完整。",tokenDetails:"本轮 Token 用量",model:"本轮模型",totalTokens:"总量",inputTokens:"输入",cachedInputTokens:"缓存命中输入",uncachedInputTokens:"未命中输入",cacheWriteInputTokens:"缓存写入",outputTokens:"输出",reasoningOutputTokens:"推理输出",cacheHitRate:"输入缓存命中率",tokenHelp:"缓存命中属于输入,推理输出属于输出,不重复计入总量。未命中输入 = 输入 − 缓存命中。"},ZUe={common:EUe,agentkitCli:_Ue,cloudRegion:RUe,connections:DUe,feishuBot:LUe,requestError:MUe,runSse:IUe,runtimeLogs:PUe,search:NUe,skills:BUe,sse:$Ue,identity:FUe,github:zUe,video:UUe,websiteIntegration:VUe,knowledge:QUe,intelligentDevelopment:GUe,migrations:HUe,sandbox:WUe,client:YUe,newChatCapabilities:qUe,jsonResponse:jUe,workspaceProjects:XUe,developmentRuns:KUe},yur=Object.freeze(Object.defineProperty({__proto__:null,agentkitCli:_Ue,client:YUe,cloudRegion:RUe,common:EUe,connections:DUe,default:ZUe,developmentRuns:KUe,feishuBot:LUe,github:zUe,identity:FUe,intelligentDevelopment:GUe,jsonResponse:jUe,knowledge:QUe,migrations:HUe,newChatCapabilities:qUe,requestError:MUe,runSse:IUe,runtimeLogs:PUe,sandbox:WUe,search:NUe,skills:BUe,sse:$Ue,video:UUe,websiteIntegration:VUe,workspaceProjects:XUe},Symbol.toStringTag,{value:"Module"})),JUe="智能体审核",eVe="申请企业内全员使用,审批后生效",tVe="关闭",rVe="刷新",nVe="状态",iVe="申请人",aVe="申请时间",oVe="当前版本",sVe="模型",lVe="退回人",cVe="通过人",uVe="审批时间",hVe="智能体描述",dVe="申请说明",fVe="退回理由",pVe="审批意见",gVe="退回理由(必填)",mVe="提交后内容已变化,请退回并重新申请",vVe="撤回后可以修改 Agent,需要公开时重新申请",yVe="取消公开后其他用户将无法继续使用,确定取消公开吗?",bVe="取消",xVe="确认",wVe="正在保存",AVe="取消公开",SVe="撤回申请",TVe="通过",CVe="直接公开",OVe="申请公开",kVe="全员可见",EVe={pending:"待审核",approved:"已通过",returned:"已退回",withdrawn:"已撤回"},_Ve="搜索智能体或申请人",RVe="地域",DVe="全部状态",LVe="智能体",MVe="操作",IVe="查看并审批",PVe="申请详情",NVe="没有符合条件的申请",BVe="暂无智能体审核申请",$Ve="{{count}} / {{limit}} 字",bur=Object.freeze(Object.defineProperty({__proto__:null,actions:MVe,agent:LVe,all:DVe,approve:TVe,approvedBy:cVe,cancel:bVe,close:tVe,comment:pVe,confirm:xVe,contentChanged:mVe,default:{title:JUe,dialogDescription:eVe,close:tVe,refresh:rVe,statusTitle:nVe,submitter:iVe,submittedAt:aVe,version:oVe,model:sVe,returnedBy:lVe,approvedBy:cVe,reviewedAt:uVe,description:hVe,message:dVe,reason:fVe,comment:pVe,reasonRequired:gVe,contentChanged:mVe,withdrawConfirm:vVe,unpublishConfirm:yVe,cancel:bVe,confirm:xVe,saving:wVe,unpublish:AVe,withdraw:SVe,return:"退回",approve:TVe,publish:CVe,submit:OVe,private:"仅自己可见",enterprise:kVe,status:EVe,search:_Ve,region:RVe,all:DVe,agent:LVe,actions:MVe,review:IVe,details:PVe,noMatches:NVe,empty:BVe,textCount:$Ve},description:hVe,details:PVe,dialogDescription:eVe,empty:BVe,enterprise:kVe,message:dVe,model:sVe,noMatches:NVe,publish:CVe,reason:fVe,reasonRequired:gVe,refresh:rVe,region:RVe,returnedBy:lVe,review:IVe,reviewedAt:uVe,saving:wVe,search:_Ve,status:EVe,statusTitle:nVe,submit:OVe,submittedAt:aVe,submitter:iVe,textCount:$Ve,title:JUe,unpublish:AVe,unpublishConfirm:yVe,version:oVe,withdraw:SVe,withdrawConfirm:vVe},Symbol.toStringTag,{value:"Module"})),FVe={backToEvaluationCase:"返回评测案例",cancel:"取消",copied:"已复制",copy:"复制",exportConversation:"导出会话",retry:"重试"},zVe={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。"}},UVe={subject:{file:"文件修改",command:"命令执行"},decision:{accept:"已允许本次{{subject}}",acceptForSession:"已在本会话中允许{{subject}}",decline:"已拒绝{{subject}}",cancel:"已取消{{subject}}审批"},details:{command:"命令",grantRoot:"授权路径",cwd:"执行目录"}},VVe={noDescription:"暂无描述",region:"地域",unknownAgent:"未知 Agent"},QVe={agentTransfer:"智能体移交",annotationHint:"模型回复;选中文字后可添加批注",continueBranch:"继续“{{branch}}”这个方向",emptyResponse:"本次没有返回可显示的内容。",subagentDescription:"正在执行主 Agent 移交的任务。"},GVe={title:"需要配置 {{provider}} AK/SK",prefix:"智能体工作台需要 {{provider}} 凭据才能使用。请在运行环境中设置",and:"与",suffix:"后重试。"},HVe={buildRunning:{title:"当前构建仍在进行",description:"离开将停止本轮构建;当前会话仍会保留,可稍后从历史会话重新进入。",confirm:"停止并离开"},deleteThread:{title:"删除 Codex 历史会话",description:"将删除“{{name}}”,并从历史会话中移除。",confirm:"确认删除"},returnToCreate:{title:"返回创建首页?",description:"返回后当前填写的内容将会丢失,确定要返回吗?",confirm:"确定返回"}},WVe={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:"参考素材生视频需要至少添加一项参考图片或参考视频。"},YVe={like:"赞",removeLike:"取消点赞",dislike:"踩",removeDislike:"取消点踩",reportIssue:"问题反馈",traceFlameGraph:"Tracing 火焰图"},qVe={0:"今天想做点什么?",1:"有什么可以帮你的?",2:"需要我帮你查点什么吗?",3:"有问题尽管问我",4:"嗨,我们开始吧",5:"开始一段新对话吧",6:"今天想先解决哪件事?",7:"把你的想法告诉我吧",8:"我们从哪里开始?",9:"有什么任务交给我?",10:"准备好一起推进了吗?",11:"说说你现在最关心的问题",12:"今天也一起把事情做好",13:"我在,随时可以开始",intelligentDevelopment:"让灵感自由生长"},jVe={agentCapabilities:"正在检查 Agent 能力…",session:"加载会话…"},XVe={cancelled:"授权已取消。",pasteCallbackUrl:"授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:",popupBlocked:"弹窗被拦截,请允许弹窗后重试。",unsupportedUrl:"授权链接不是 http/https 地址,已阻止打开。"},KVe={volcengine:"火山引擎"},ZVe={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:"已更新工作空间"},JVe={addAgent:"添加智能体",addFromPackage:"从代码包添加",agent:"智能体",automations:"自动化",createAgent:"创建智能体",createSkill:"创建技能",cronJobs:"定时任务",issueFeedback:"问题反馈",library:"资源库",migrateAgent:"迁移智能体",newConversation:"新会话",optimizeSkill:"优化 {{name}}",search:"搜索",skill:"技能",skillLibrary:"技能库",systemInfo:"系统信息",updateAgent:"更新 {{name}}",codeProjects:"代码项目",reviewCenter:"审核中心"},eQe={title:"从工作区新建",description:"创建和管理代码项目,在 VS Code 中编写和调试"},tQe={actions:FVe,addAgent:zVe,approval:UVe,common:VVe,conversation:QVe,credentials:GVe,dialogs:HVe,errors:WVe,feedback:YVe,greetings:qVe,loading:jVe,oauth:XVe,providers:KVe,sandbox:ZVe,titles:JVe,workspaceProjectEntry:eQe},xur=Object.freeze(Object.defineProperty({__proto__:null,actions:FVe,addAgent:zVe,approval:UVe,common:VVe,conversation:QVe,credentials:GVe,default:tQe,dialogs:HVe,errors:WVe,feedback:YVe,greetings:qVe,loading:jVe,oauth:XVe,providers:KVe,sandbox:ZVe,titles:JVe,workspaceProjectEntry:eQe},Symbol.toStringTag,{value:"Module"})),rQe="自动化",nQe="连接研发工具,为智能体扩展自动化工作流",iQe="搜索自动化",aQe="自动化分类",oQe={development:"研发",channels:"消息渠道"},sQe="{{category}}自动化列表",lQe="打开{{name}}",cQe="仅本地部署可用",uQe="没有匹配的自动化",hQe="请尝试搜索其他名称",dQe="返回自动化列表",fQe={"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:"GitHub PR 自动评审",description:"通过 GitHub App 在隔离 Sandbox 中评审 Pull Request。",title:"GitHub 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 地址"}}},"gitlab-review":{name:"GitLab MR 自动评审",description:"通过 GitLab 集成在隔离 Sandbox 中评审 Merge Request。"},feishu:{name:"飞书机器人",badge:"Beta",description:"创建飞书机器人,并将消息直接接入 AgentKit Runtime。"},"website-integration":{name:"网站集成",description:"将 AgentKit Runtime 以悬浮聊天窗口嵌入网站。"}},pQe={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 个字符"}}},gQe={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:"没有可预览的文件。"}},mQe={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:"你是一个通过飞书为用户提供帮助的智能助手。准确理解用户问题,给出简洁、可靠的回答;信息不足时先提问澄清,不要臆造事实。"}},wur=Object.freeze(Object.defineProperty({__proto__:null,backToAutomations:dQe,cards:fQe,categories:oQe,categoriesLabel:aQe,codingAgents:gQe,default:{title:rQe,description:nQe,search:iQe,categoriesLabel:aQe,categories:oQe,resultsLabel:sQe,open:lQe,localOnly:cQe,emptyTitle:uQe,emptyDescription:hQe,backToAutomations:dQe,cards:fQe,github:pQe,codingAgents:gQe,feishu:mQe},description:nQe,emptyDescription:hQe,emptyTitle:uQe,feishu:mQe,github:pQe,localOnly:cQe,open:lQe,resultsLabel:sQe,search:iQe,title:rQe},Symbol.toStringTag,{value:"Module"})),vQe={"zh-CN":"简体中文","en-US":"English"},Aur=Object.freeze(Object.defineProperty({__proto__:null,default:{languageNames:vQe},languageNames:vQe},Symbol.toStringTag,{value:"Module"})),yQe={selectedExcerptLabel:"选中片段",commentLabel:"批注",commentSeparator:":",successTitle:"已加入 Bad case 评测集",successDescription:"这条批注已关联当前问题和完整模型回复。",done:"完成",ariaLabel:"批注选中的模型回复",title:"添加批注",content:"批注内容",placeholder:"说明问题或期望的修改方式",retryError:"{{error}},请重试。",cancel:"取消",submit:"加入 Bad Case"},bQe={attachment:"附件",image:"图片",preview:"预览 {{name}}",uploading:"上传中",uploadFailed:"上传失败",remove:"移除 {{name}}",previewDialog:"{{name}}预览",download:"下载",close:"关闭",reading:"正在读取文档…",loadFailed:"文档加载失败:{{error}}"},xQe={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}} 行"},wQe={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:"选择左侧的一个调用查看详情"},AQe={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}}"},SQe={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",deployAgent:"部署 Agent",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 执行遇到错误"}},TQe={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 未提供模型信息"},CQe={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:"连接并添加"},OQe={placeholder:"输入消息…",inputAria:"输入消息",generating:"正在生成",send:"发送"},kQe={ariaLabel:"本轮调用上下文",removeSkill:"移除技能 {{name}}",removeAgent:"移除 Agent {{name}}"},EQe={cardAria:"{{label}} 图表",viewAria:"{{label}} 显示方式",preview:"预览",code:"代码",invalidEcharts:"ECharts 配置不是有效且安全的数据对象,请切换到代码检查内容。",renderFailed:"图表暂时无法渲染,请切换到代码检查内容。",echartsAria:"ECharts 图表预览",rendering:"正在渲染图表…",mermaidFailed:"图表暂时无法渲染,请切换到代码查看 Mermaid 内容。",mermaidAria:"Mermaid 图表预览"},_Qe={playVideo:"点击播放视频:{{name}}",enlargeImage:"放大预览:{{name}}",image:"图片",enlargeVideo:"点击放大视频",videoPreview:"视频预览",downloadVideo:"下载视频",close:"关闭"},RQe={annotation:yQe,media:bQe,runtimeLogs:xQe,trace:wQe,share:AQe,blocks:SQe,tokenUsage:TQe,addAgentKit:CQe,composer:OQe,invocation:kQe,visualization:EQe,markdown:_Qe},Sur=Object.freeze(Object.defineProperty({__proto__:null,addAgentKit:CQe,annotation:yQe,blocks:SQe,composer:OQe,default:RQe,invocation:kQe,markdown:_Qe,media:bQe,runtimeLogs:xQe,share:AQe,tokenUsage:TQe,trace:wQe,visualization:EQe},Symbol.toStringTag,{value:"Module"})),DQe={back:"返回",cancel:"取消",deploy:"部署",delete:"删除",loading:"读取中…",next:"下一步",notSupported:"暂不支持",previous:"上一步",required:"必填",retry:"重试",actions:"操作",value:"值",disabled:"关闭",enabled:"已开启",none:"无",close:"关闭",name:"名称",description:"描述",send:"发送"},LQe={heading:"VeADK Agent 结构配置",importHint:"可在「创建 Agent」页通过「导入 YAML」重新载入。"},MQe={agentName:{required:"名称为必填项",reserved:"user 是 Google ADK 保留名称,请使用其他名称",characters:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"},runtimeName:{required:"Runtime 名称为必填项",characters:"Runtime 名称只能包含英文字母、数字、下划线和连字符",length:"Runtime 名称长度须为 4-64 个字符"}},IQe={description:"一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",instruction:`你是一个专业、可靠的智能助手。 你的目标是准确理解用户的需求,并给出条理清晰、简洁有用的回答。 约束: - 信息不足时主动提问澄清,不要臆造事实。 - 需要时合理调用可用的工具,并说明关键结论。 -- 保持礼貌、专业的语气。`},IQe={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",fallbackApiKeyLabel:"{{name}} 的备用模型 {{model}} 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 解压后的内容过大"}},PQe={back:"返回开发会话",runtimeName:"Runtime 名称",runtimeNameExists:"Runtime 名称已存在,请更换后重试",checkingRuntimeName:"正在检查 Runtime 名称",verifiedSource:"已验证源码",deployableSource:"可部署源码",verifiedByCodex:"已通过 Codex 云端验证",entryPoint:"入口",files:"文件",artifact:"构建产物",validationReport:"验证报告",verifiedHint:"源码由服务端从已验证交付物物化,浏览器文件不能替换。",unverifiedHint:"源码已由服务端安全物化,部署前请确认 Runtime 配置。",env:{requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}"}},NQe={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 中声明已有入口。"}},BQe={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:"添加到最后"}},$Qe={title:"智能构建",subtitle:"描述需求,完成 Agent 的构建、调试与验证。",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。"},tasks:{title:"进行中的任务",hint:"离开页面后仍会继续,可随时回来查看和补充要求。",refresh:"刷新任务列表",loading:"正在读取任务…",empty:"暂无进行中的任务",emptyHint:"开始构建后,可以从这里回到任务。",loadError:"暂时无法读取任务,请重试。",openError:"暂时无法打开任务,请重试。",startedAt:"开始于 {{time}}",open:"查看任务",opening:"正在连接…",states:{queued:"等待开始",running:"构建中",recovering:"正在重连",waiting_user:"等待你的回复",stopping:"正在停止",succeeded:"已完成",failed:"未完成",cancelled:"已停止"}}},FQe={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:"最新版本",defaultVersionName:"版本 · {{time}}",rename:{projectTitle:"修改项目名称",versionTitle:"修改版本名称",projectLabel:"项目名称",versionLabel:"版本名称",hint:"支持中英文、数字和常见标点,最多 {{max}} 个字符。",required:"请输入名称。",tooLong:"名称不能超过 {{max}} 个字符。",invalidCharacters:"名称不能包含换行、控制字符、不可见格式字符或 < >。",save:"保存名称",saving:"保存中…",updated:"名称已更新。",failed:"名称保存失败,请重试。"},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:"删除版本"}},zQe={title:"选择创建方式",subtitle:"以不同模式构建您的智能体",features:"特性",quick:{title:"快速模式",description:"动态派生子智能体自主完成任务",features:{dynamicSubagents:"动态派生子智能体",autonomousPlanning:"自主规划执行",collaboration:"多智能体协作",summary:"自动汇总结果",skills:"按需调用技能",trace:"任务过程可追踪"}},traditional:{title:"传统模式",description:"高度自定义您的智能体结构",features:{visualConfig:"可视化配置",migration:"存量智能体迁移",debugging:"实时调试",optimization:"可选性能优化",parameters:"精细参数控制"}}},UQe={placeholder:"输入系统提示词;键入 ## 加空格可创建二级标题…",toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",paragraph:"正文",quote:"引用",heading:"标题 {{level}}",selectBlockType:"选择文本类型",blockType:"文本类型",bold:"加粗",removeBold:"取消加粗",italic:"斜体",removeItalic:"取消斜体",bulletedList:"无序列表",numberedList:"有序列表"}},VQe={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 中心暂无技能。"}},QQe={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}} 条连线"}},GQe={ariaLabel:"快速模式创建",progress:"快速模式创建进度",steps:{agent:{label:"智能体",title:"基本信息",description:"设置智能体的名称、用途、行为方式与能力"},environment:{label:"执行环境",title:"配置执行环境",description:"选择默认环境或已构建的自定义环境"},deployment:{label:"部署偏好",title:"部署偏好",description:"定义 AgentKit 云上参数"}},model:{label:"模型",source:"模型来源",name:"模型名称",fallbacks:"Fallback 模型",fallbackPlaceholder:"备用模型名称",addFallback:"添加备用模型",addProviderFallback:"添加其他服务商",removeFallback:"移除",fallbackType:"备用模型类型",fallbackSameProvider:"同服务商",fallbackOtherProvider:"其他服务商",apiKeyEnv:"API Key 环境变量",invalidApiKeyEnv:"环境变量名只能包含字母、数字和下划线,且不能以数字开头。",fallbackHelp:"同服务商备用模型复用主模型连接;其他服务商会使用单独的 provider、API Base 和 API Key。",fallbackIgnored:"空值、重复值或与主模型相同的模型会被忽略。",provider:"服务商 Provider",invalidApiBase:"请输入合法的 http:// 或 https:// 链接。",volcengineArk:"火山方舟",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",currentApiKey:"当前 API Key",currentConfiguration:"当前配置",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:"请选择模型",apiKeyRequired:"请先填写或选择模型 API Key",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:"更新并发布"}},HQe={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:"描述为必填项",mcpDuplicateName:"MCP 名称重复,请为每个服务使用唯一名称",mcpDuplicateUrl:"MCP 地址重复,请删除重复服务后再发布",missingSubagent:"缺少子 Agent",missingPrompt:"系统提示词为必填项",apiKeyRequired:"请先填写或选择模型 API Key",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:"模型名称",fallbacks:"Fallback 模型",fallbackPlaceholder:"备用模型名称",addFallback:"添加备用模型",addProviderFallback:"添加其他服务商",removeFallback:"移除",fallbackType:"备用模型类型",fallbackSameProvider:"同服务商",fallbackOtherProvider:"其他服务商",apiKeyEnv:"API Key 环境变量",invalidApiKeyEnv:"环境变量名只能包含字母、数字和下划线,且不能以数字开头。",fallbackHelp:"同服务商备用模型复用主模型连接;其他服务商会使用单独的 provider、API Base 和 API Key。",fallbackIgnored:"空值、重复值或与主模型相同的模型会被忽略。",provider:"服务商 Provider",invalidApiBase:"请输入合法的 http:// 或 https:// 链接。",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 Endpoint 时可直接使用;否则请补充完整服务路径。",tokenPlaceholder:"Bearer Token(可选)",showToken:"显示 Bearer Token",hideToken:"隐藏 Bearer Token",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 结构并准备部署快照…"}},WQe={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:"长期"}},YQe={checkingExpiry:"确认有效期中",waitingRecovery:"等待恢复",listFailed:"读取项目列表失败",recoveryFailed:"工作区恢复失败,请重试",operationFailed:"项目操作失败,请重试",title:"代码项目",back:"返回代码项目",restart:"本开发环境将在 {{countdown}} 后重启,请随时保存数据",expiresAt:"有效期至 {{date}}",exitFullscreen:"退出全屏",fullscreen:"全屏",exitFullscreenHint:"退出全屏(Esc)",recovering:"正在恢复工作区,完成后将自动返回项目",retry:"重试连接",search:"搜索代码项目",newTitle:"新建代码项目",new:"新建项目",readingStats:"正在读取项目统计",createdAt:"创建时间",opening:"正在打开",unknownCreatedAt:"创建时间未知",open:"打开项目",empty:"没有匹配的代码项目",close:"关闭新建项目",name:"项目名称",placeholder:"例如 my-agent",nameHelp:"以英文字母开头,可包含字母、数字、下划线和连字符,最多 64 个字符",cancel:"取消",create:"创建项目",files_one:"{{count}} 个文件",files_other:"{{count}} 个文件",directories_one:"{{count}} 个目录",directories_other:"{{count}} 个目录",separator:","},qQe={enabled:"已启用",disabled:"已禁用",unknownStatus:"状态未知",allPermissions:"全部权限",customPermissions:"自定义权限",unknownPermissions:"权限未知",unnamed:"未命名 API Key",search:"搜索名称、状态或权限",noMatches:"没有匹配的 API Key",noModelPermission:"当前 API Key 无权限",modelAvailable:"可用",permissionState:{Available:"可用于对话",Shutdown:"已下线",VideoGeneration:"视频生成模型",Unsupported:"不支持作为对话模型",NotActivated:"尚未开通",Unknown:"未获取到模型状态"}},Aur=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:BQe,codePackage:NQe,common:RQe,default:{common:RQe,yaml:DQe,validation:LQe,defaults:MQe,helpers:IQe,intelligentDeployment:PQe,codePackage:NQe,buildCanvas:BQe,intelligent:$Qe,projectLibrary:FQe,modePicker:zQe,promptEditor:UQe,skills:VQe,workflow:QQe,workbench:GQe,traditional:HQe,template:WQe,workspace:YQe,modelApiKey:qQe},defaults:MQe,helpers:IQe,intelligent:$Qe,intelligentDeployment:PQe,modePicker:zQe,modelApiKey:qQe,projectLibrary:FQe,promptEditor:UQe,skills:VQe,template:WQe,traditional:HQe,validation:LQe,workbench:GQe,workflow:QQe,workspace:YQe,yaml:DQe},Symbol.toStringTag,{value:"Module"})),jQe={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:"查看详情"},XQe={cancelDescription:"本次 Session 将被取消,后续计划不会暂停。",cancelTitle:"终止本次执行?",deleteDescription:"“{{name}}”及其全部执行历史将被永久删除。",deleteTitle:"删除定时任务?"},KQe={configuration:"任务配置",nextRun:"下次执行",pageLabel:"定时任务详情",region:"地域",runtime:"运行时",status:"任务状态"},ZQe={createTitle:"创建定时任务",description:"每次触发都会为 Runtime Agent 创建独立 Session。",editTitle:"编辑定时任务"},JQe={minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",seconds:"{{count}} 秒"},eGe={cronExpression:"Cron 表达式",cronHelp:"依次填写分钟、小时、日期、月份、星期。",dailyTime:"每天执行时间",enableAfterCreate:"创建后启用",enableHelp:"启用后会从下一个计划时间开始执行。",name:"任务名称",namePlaceholder:"例如:每日生成运营摘要",noRuntime:"暂无可用 Runtime",prompt:"执行文本",promptPlaceholder:"输入每次执行时发送给 Agent 的固定文本",runAt:"执行时间",runtimeAgent:"运行时智能体",runtimeHelp:"任务始终跟随该 Runtime 当前生效版本。",runtimePlaceholder:"选择 Runtime Agent",schedule:"执行计划",scheduleType:"执行计划类型",timezone:"时区",weekday:"星期"},tGe={all:"全部"},rGe={description:"每次运行均使用独立 Session,结果与错误会永久保留。",duration:"耗时 {{duration}}",emptyDescription:"任务触发或立即执行后,记录会显示在这里。",emptyTitle:"暂无执行记录",errorDetails:"错误详情",finalAnswer:"最终回答",loadFailed:"无法加载执行历史",loadFailedDescription:"请检查 Studio 服务后重试。",session:"会话",title:"执行历史"},nGe={cancelRequested:"已提交终止请求。",created:"任务已创建。",deleted:"任务及其执行历史已删除。",enabled:"任务已启用。",paused:"任务已暂停。",queued:"任务已排队,将在一分钟内开始执行。",requeued:"任务已重新排队,将在一分钟内开始执行。",updated:"任务已更新。"},iGe={filterLabel:"定时任务状态筛选",listLabel:"定时任务列表",loadFailed:"无法加载定时任务",loadFailedDescription:"请检查 Studio 服务后重试。",title:"定时任务"},aGe={cron:"Cron {{cron}}{{zone}}",daily:"每天 {{time}}{{zone}}",once:"一次 · {{date}}{{zone}}",weekly:"{{weekday}} {{time}}{{zone}}"},oGe={daily:"每天",once:"一次性",weekly:"每周"},sGe={cancelled:"已取消",enabled:"已启用",failed:"失败",notRun:"尚未执行",paused:"已暂停",pending:"准备中",queued:"已排队",retrying:"自动重试中",running:"执行中",skipped:"已跳过",success:"成功"},lGe={cronFields:"Cron 表达式需要包含 5 个字段,例如 0 9 * * *。",nameRequired:"请输入任务名称。",promptRequired:"请输入每次执行时发送给 Agent 的文本。",runtimeAppMissing:"Runtime Agent 未返回可调用的 appName,请确认 Runtime 已就绪且版本兼容。",runtimeRequired:"请选择可用的 Runtime Agent。",timeRequired:"请选择执行时间。"},cGe={friday:"周五",monday:"周一",saturday:"周六",sunday:"周日",thursday:"周四",tuesday:"周二",wednesday:"周三"},Sur=Object.freeze(Object.defineProperty({__proto__:null,actions:jQe,confirm:XQe,default:{actions:jQe,confirm:XQe,detail:KQe,drawer:ZQe,duration:JQe,fields:eGe,filters:tGe,history:rGe,notices:nGe,page:iGe,schedule:aGe,scheduleTypes:oGe,status:sGe,validation:lGe,weekdays:cGe},detail:KQe,drawer:ZQe,duration:JQe,fields:eGe,filters:tGe,history:rGe,notices:nGe,page:iGe,schedule:aGe,scheduleTypes:oGe,status:sGe,validation:lGe,weekdays:cGe},Symbol.toStringTag,{value:"Module"})),uGe="快速创建 Agent",hGe="Agent 类型",dGe="关闭",fGe="部署",pGe="预览配置",gGe="已发起配置包下载",mGe="下载失败,请重试",vGe="有 {{count}} 处配置需要修改",yGe="自定义",bGe="自定义{{field}}",xGe="输入自定义值",wGe="该模型未声明推理强度,使用服务端设置",AGe="请先为该提供方添加模型",SGe="请先选择提供方",TGe="请选择",CGe="可选",OGe="默认模型、Agent 预设和权限用于新会话;预设需要存在于部署的 Harness 中",kGe="仅填写环境变量名称,实际密钥由部署环境提供",EGe="read-only 为只读,workspace-write 可写工作区,danger-full-access 允许完整访问且不请求确认",_Ge="allowedModels 是子 Agent 可选择的模型列表,启用后至少填写一组提供方和模型",RGe="添加自定义模型服务,填写它的端点、协议和模型 ID,支持火山引擎和 BytePlus 等兼容服务",DGe="当前覆盖常用原生设置,其他插件参数与预设文件尚未接入",LGe="查看原生配置文档",MGe="模型提供方 {{index}}",IGe="模型 {{index}}",PGe="添加模型提供方",NGe="移除提供方 {{index}}",BGe="添加模型",$Ge="移除模型 {{index}}",FGe="添加可选模型",zGe="移除可选模型 {{index}}",UGe="移除",VGe="填写服务端的模型 ID",QGe={provider:"提供方 {{index}}",model:"模型 {{index}}"},GGe={defaults:"会话默认设置",deepseek:"DeepSeek 模型服务",providers:"自定义模型提供方",shell:"命令执行",loop:"工具调用",subagents:"子 Agent 模型选择",search:"DeepSeek 网络搜索"},HGe={id:"提供方 ID",displayName:"显示名称",baseURL:"服务地址",api:"接口协议",apiKeyEnv:"密钥环境变量"},WGe={id:"例如 company-models",displayName:"可选,默认使用提供方 ID",baseURL:"https://…/v1",api:"选择接口协议",apiKeyEnv:"例如 MODEL_API_KEY"},YGe={id:"模型 ID",name:"显示名称",contextWindow:"上下文容量",maxTokens:"最大输出容量"},qGe={positive:"请输入大于 0 的数值",integer:"请输入有效的正整数",env:"请输入环境变量名,只能包含字母、数字和下划线,且不能以数字开头",url:"请输入 HTTP 或 HTTPS 地址,不要在地址中包含凭据",option:"请选择受支持的原生选项",required:"请补全此项",duplicate:"该 ID 或模型组合已存在",providerId:"以小写字母开头,可包含小写字母、数字、点、下划线和连字符,不能使用保留 ID",routes:"请至少填写一组完整的提供方和模型",modelPair:"请填写该自定义提供方下的模型 ID",unknownProvider:"请先添加该自定义模型提供方",unknownModel:"请填写该提供方下已配置的模型 ID",timer:"请输入大于 0 且不超过 2147483647 的毫秒数"},jGe={"agent-default-model_provider":"默认提供方","agent-default-model_model":"默认模型","agent-default-model_reasoningEffort":"默认推理强度","agent-presets_default":"默认 Agent 预设",permission_defaultPreset:"默认权限预设","llm-deepseek_apiKeyEnv":"密钥环境变量","llm-deepseek_baseURL":"服务地址","llm-deepseek_thinking":"思考模式","llm-deepseek_reasoningEffort":"推理强度","llm-deepseek_maxTokens":"每次请求的输出上限","llm-deepseek_defaultContextWindow":"默认上下文容量","llm-deepseek_streamIdleTimeoutMs":"流式空闲超时(毫秒)",bash_timeoutMs:"默认执行超时(毫秒)",bash_maxTimeoutMs:"最大执行超时(毫秒)",bash_maxOutputBytes:"输出上限(字节)","agent-loop_maxParallelToolCalls":"并行工具调用上限","subagent-model-selection_enabled":"启用模型选择","web-search-deepseek_apiKeyEnv":"密钥环境变量","web-search-deepseek_baseURL":"搜索服务地址","web-search-deepseek_model":"搜索模型","web-search-deepseek_apiVersion":"接口版本","web-search-deepseek_maxTokens":"搜索输出上限","web-search-deepseek_maxUses":"搜索次数上限"},XGe="取消",KGe="返回创建方式",ZGe="DeepSeek Harness 配置",Tur=Object.freeze(Object.defineProperty({__proto__:null,addModel:BGe,addProvider:PGe,addRoute:FGe,agentType:hGe,back:KGe,cancel:XGe,close:dGe,coverage:DGe,credentialHelp:kGe,customField:bGe,customValue:yGe,default:{title:uGe,agentType:hGe,close:dGe,continue:"继续配置",deploy:fGe,preview:pGe,export:"导出配置",downloaded:gGe,downloadFailed:mGe,validationSummary:vGe,customValue:yGe,customField:bGe,enterCustomValue:xGe,reasoningUnavailable:wGe,modelsUnavailable:AGe,selectProviderFirst:SGe,selectOption:TGe,optional:CGe,defaultsHelp:OGe,credentialHelp:kGe,permissionHelp:EGe,routesHelp:_Ge,providersHelp:RGe,coverage:DGe,source:LGe,provider:MGe,model:IGe,addProvider:PGe,removeProvider:NGe,addModel:BGe,removeModel:$Ge,addRoute:FGe,removeRoute:zGe,remove:UGe,modelIdPlaceholder:VGe,route:QGe,sections:GGe,providerFields:HGe,providerPlaceholders:WGe,modelFields:YGe,errors:qGe,fields:jGe,cancel:XGe,back:KGe,pageTitle:ZGe},defaultsHelp:OGe,deploy:fGe,downloadFailed:mGe,downloaded:gGe,enterCustomValue:xGe,errors:qGe,fields:jGe,model:IGe,modelFields:YGe,modelIdPlaceholder:VGe,modelsUnavailable:AGe,optional:CGe,pageTitle:ZGe,permissionHelp:EGe,preview:pGe,provider:MGe,providerFields:HGe,providerPlaceholders:WGe,providersHelp:RGe,reasoningUnavailable:wGe,remove:UGe,removeModel:$Ge,removeProvider:NGe,removeRoute:zGe,route:QGe,routesHelp:_Ge,sections:GGe,selectOption:TGe,selectProviderFirst:SGe,source:LGe,title:uGe,validationSummary:vGe},Symbol.toStringTag,{value:"Module"})),JGe="问题反馈",eHe="问题描述",tHe="常见问题",rHe="取消",nHe="完成",iHe="提交反馈",aHe="正在上报…",oHe={title:"上报成功,感谢您的反馈",description:"AgentKit 团队会尽快查看您提交的问题。"},sHe={close:"关闭问题反馈",intro:"请选择遇到的问题,也可以补充具体表现。",privacy:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。",descriptionPlaceholder:"请描述问题发生时的表现(选填)",issues:{slow:"执行速度慢",crash:"运行崩溃",incorrect:"结果不准确",tool_error:"工具调用失败",other:"其他问题"}},lHe={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 团队,请注意隐私保护。"},Cur=Object.freeze(Object.defineProperty({__proto__:null,cancel:rHe,commonIssues:tHe,default:{title:JGe,descriptionLabel:eHe,commonIssues:tHe,cancel:rHe,done:nHe,submit:iHe,submitting:aHe,success:oHe,dialog:sHe,page:lHe},descriptionLabel:eHe,dialog:sHe,done:nHe,page:lHe,submit:iHe,submitting:aHe,success:oHe,title:JGe},Symbol.toStringTag,{value:"Module"})),cHe={back:"返回",close:"关闭"},uHe={title:"优化迁移项目",closeAria:"关闭优化窗口"},hHe={title:"已迁移项目",description:"管理迁移后的源码版本,也可以选择任一版本继续优化。",libraryTitle:"项目与版本",libraryDescription:"查看、下载、部署或对比源码版本,也可以基于任一版本继续优化。",emptyTitle:"还没有已迁移的项目",emptyDescription:"迁移完成后,源码会自动保存在这里。"},dHe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any(通用迁移)"},fHe={awaitingUpload:"待上传",analyzing:"分析中",needsInput:"待补充",analysisReady:"待确认",migrating:"迁移中",validating:"校验中",packaging:"打包中",succeeded:"已完成",succeededWithWarnings:"已完成,有提示",partial:"部分完成",failed:"失败",cancelled:"已终止",expired:"已过期"},pHe={evaluationPending:"待评测",evaluationRunning:"评测中",waitingDataset:"待保存评测用例",waitingEnvironment:"待补充环境变量",evaluationFailed:"迁移完成,评测未完成",evaluationBlocked:"迁移完成,评测待处理",evaluationCancelled:"迁移完成,评测已取消",resultUnavailable:"结果不可用",environmentExpired:"环境已过期"},gHe={partialReady:"迁移产物已生成,但交付不完整,请查看迁移提示。",readyWithWarnings:"迁移产物已生成,请查看迁移提示。",ready:"迁移产物已生成。"},mHe={passed:"产物校验通过",failed:"产物校验未通过",degraded:"产物校验未完成"},vHe={session:"创建迁移环境",upload:"上传项目",analysis:"分析项目"},yHe={agentNameRequired:"请输入 Agent 名称",agentNameInvalid:"Agent 名称必须为 1-63 位,只能包含小写字母、数字和连字符,且必须以字母或数字开头和结尾"},bHe={seconds:"{{seconds}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},xHe={savedUnaffected:"已保存项目不受影响",savingUnaffected:"源码正在保存,完成后不受环境期限影响",activeDetail:"到期后任务记录和临时产物将无法访问",oneHour:"临时迁移环境保留 1 小时",ended:"临时迁移环境已结束",savedAvailable:"已保存项目仍可查看、下载、部署或优化",unavailable:"任务记录和临时产物已无法访问",countdown:"临时迁移环境将在 {{minutes}} 分 {{seconds}} 秒后结束",expiredSavedMessage:"临时迁移环境已结束,已保存项目不受影响。",expiredMessage:"临时迁移环境已结束,任务记录和临时产物无法继续访问。"},wHe={recommended:"建议迁移方式",scope:"迁移范围",excluded:"不在本次范围",viewEvidence:"查看分析证据",viewAssumptions:"查看关键假设",viewSourceEvidence:"查看源码证据"},AHe={ariaLabel:"Codex 执行动态",title:"Codex 执行动态",startingAnalysis:"Codex 正在开始分析…",startingMigration:"Codex 正在开始迁移…",loadError:"暂时无法读取 Codex 执行动态,不影响当前任务。"},SHe={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:"正在读取迁移产物…"},THe={retiring:"即将下线",currentDefault:"当前默认模型",loadError:"加载模型列表失败",label:"模型",placeholder:"选择模型"},CHe={zipOnly:"请选择 .zip 格式的本地项目文件。",invalidName:"ZIP 文件名无效,请重命名后重新选择。",tooLarge:"项目 ZIP 不能超过 {{size}}。",empty:"项目 ZIP 不能为空。",removeAria:"移除项目 ZIP",reselectPrompt:"重新选择项目 ZIP",selectPrompt:"选择或拖入本地项目 ZIP",reselect:"重新选择",selectZip:"选择 ZIP",continue:"继续上传",start:"上传并分析",inputAria:"选择本地项目 ZIP",retention:"临时迁移环境从创建完成起保留 1 小时;保存成功的源码版本不受影响。",uploading:"上传中…",sizeHint:"支持项目 ZIP,最大 {{size}}"},OHe={requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}",notReady:"迁移产物尚未准备完成。",back:"返回迁移结果"},kHe={backToAddAgent:"返回添加 Agent",title:"从存量迁移",newMigration:"新建迁移",recent:"最近迁移",loadingSessions:"正在读取迁移会话…",noSessions:"暂无迁移会话",heading:"迁移存量 Agent 项目",intro:"上传本地项目 ZIP,Codex 将先进行只读分析,再由你确认迁移方式。",backToHome:"迁移首页",navigation:"迁移导航",showMore:"查看更多",showLess:"收起",projectName:"项目名称",status:"状态",createdAt:"创建时间",actions:"操作",openTask:"查看迁移 {{name}}",continueTask:"继续",viewTask:"查看"},EHe={stop:"终止迁移",stopping:"正在终止…",cancel:"取消",reload:"重新读取",refreshStatus:"刷新状态"},_He={unavailable:"迁移能力暂不可用",defaultReason:"Dev Sandbox 暂不可用,请联系管理员检查配置。"},RHe={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:"当前迁移已终止。你可以新建迁移并重新上传项目。"},DHe={ariaLabel:"补充项目分析信息",title:"补充分析所需信息",description:"附件保持锁定,提交后仅继续只读分析",submitting:"正在继续分析…",submit:"提交并继续分析"},LHe={ariaLabel:"确认迁移方式",title:"确认迁移方式",description:"确认后才会执行实际迁移",framework:"迁移方式",frameworkPlaceholder:"选择迁移方式",agentName:"Agent 名称",entry:"项目入口",entryPlaceholder:"选择项目入口",entryExample:"例如 agent.py:agent",consent:"点击“确认并开始迁移”即确认上述迁移范围、排除项和关键假设。",starting:"正在启动迁移…",start:"确认并开始迁移"},MHe={setup:{title:"迁移效果评测",description:"迁移完成后自动执行评测用例。",on:"已开启",off:"未开启",unavailable:"当前环境暂不支持迁移效果评测。",casesTitle:"评测用例",casesDescription:"至少添加一个用例。期望结果和评测标准可选。",configuredSummary:"{{count}} 个用例 · {{preset}} · {{dimensions}}",incompleteSummary:"{{count}} 个用例待填写 · {{preset}} · {{dimensions}}",dimensionSummary:"{{count}} 个维度",editSettings:"编辑设置",viewSettings:"查看设置",lockedTitle:"评测用例",lockedDescription:"上传开始后不可修改。",closeAria:"关闭评测设置",done:"完成配置",close:"关闭"},tabs:{label:"迁移任务内容",migration:"迁移",evaluation:"效果评测",waitingMigration:"等待迁移",waitingConfiguration:"待配置",running:"评测中",completed:"已完成",issue:"需处理"},bulk:{open:"批量粘贴",label:"每行输入一个用例",placeholder:`帮我查询今天的订单状态 -把结果整理成三点`,preview:"将添加 {{count}} 个用例",confirm:"添加用例"},case:{title:"用例 {{index}}",add:"添加用例",moveUp:"上移用例 {{index}}",moveDown:"下移用例 {{index}}",copy:"复制",delete:"删除",userInput:"用户输入",userInputPlaceholder:"例如:请帮我查询今天的订单状态",expectedOutcome:"期望结果(可选)",expectedOutcomePlaceholder:"描述希望 Agent 完成什么,不要求逐字一致",criteria:"必须满足的要求(可选)",addCriterion:"添加要求",criterionLabel:"必须满足的要求 {{index}}",criterionPlaceholder:"例如:必须包含订单号和当前状态",removeCriterion:"删除要求 {{index}}"},advanced:{title:"高级设置",standard:"标准评测",standardDescription:"默认包含语义一致性、输出约束、工作流与工具一致性 3 个维度,适合多数迁移。",custom:"自定义维度",customDescription:"按业务风险选择一个或多个评测维度。",lockedDescription:"项目开始上传后,评测方式和维度不再修改。"},dimension:{semantic_fidelity:"语义一致性",output_contract:"输出约束",workflow_tool_fidelity:"工作流与工具一致性",context_memory_fidelity:"上下文与记忆一致性",boundary_error_fidelity:"边界与异常一致性",safety_refusal_fidelity:"安全与拒答一致性"},dimensionDescription:{semantic_fidelity:"检查意图理解、结论和关键事实是否保持一致。",output_contract:"检查字段、结构、语言和格式约束是否保持。",workflow_tool_fidelity:"检查可观察的工作流分支和工具行为是否保持。",context_memory_fidelity:"检查可验证的多轮上下文和记忆行为。",boundary_error_fidelity:"检查无效输入、信息缺失和依赖失败时的行为。",safety_refusal_fidelity:"检查已有授权、拒答和敏感信息边界是否保持。"},validation:{caseCount:"请保留 1–{{count}} 个用例。",dimensionRequired:"请至少选择一个评测维度。",userInputRequired:"请输入用例内容。",userInputBytes:"单个用例不能超过 32 KiB。",expectedOutcomeBytes:"期望结果不能超过 16 KiB。",criteriaCount:"单个用例最多包含 {{count}} 条要求。",criterionRequired:"要求不能为空。",criterionBytes:"单条要求不能超过 2 KiB。",datasetBytes:"全部评测用例不能超过 10 MiB。"},dataset:{invalidLockResponse:"服务未确认评测用例已保存,请重试。",loadingSettings:"正在读取评测设置…",loadSettingsFailed:"评测设置读取失败。",retryLoadSettings:"重新读取",missing:"未找到已保存的评测用例,请重新填写并保存。",saveWarning:"评测用例暂未保存,不影响迁移。",retrySave:"重新保存评测用例",saving:"正在保存…"},state:{disabled:"未开启评测",waiting_dataset:"等待填写评测用例",pending:"迁移完成后自动开始评测",preparing:"正在准备评测环境…",waiting_environment:"需要补充运行所需的环境变量",deploying:"正在部署临时 Runtime…",executing:"正在执行评测用例…",judging:"正在执行评测分析…",aggregating:"正在汇总评测结果…",completed:"评测已完成",failed:"评测未完成",blocked:"评测需要处理后才能继续",cancelled:"评测已取消"},progress:{label:"迁移与迁移效果评测进度",migration:"迁移",evaluation:"迁移效果评测",notStarted:"未开始",inProgress:"进行中",completed:"完成",waitingConfiguration:"等待配置",issue:"有问题"},environment:{description:"填写临时 Runtime 所需的环境变量。",security:"仅用于本次评测。",optional:"可选",submit:"提交并继续评测",submitting:"正在提交…"},execution:{preparing:"准备评测",preparingDetail:"校验迁移产物和 {{count}} 个评测用例",deploying:"启动 Runtime",deployingDetail:"准备 {{runtime}}",runtimeFallback:"隔离运行环境",executing:"执行用例",executingDetail:"执行 {{count}} 个用例并记录输出",judging:"执行评测分析",judgingDetail:"评测 {{cases}} 个用例 · {{dimensions}} 个维度",aggregating:"生成评测报告",aggregatingDetail:"汇总评分与证据,生成 HTML 报告",waiting:"等待中",running:"执行中",failed:"失败",complete:"已完成"},result:{title:"执行进度",attempt:"第 {{attempt}} 次评测",pending:"等待迁移完成",retry:"重新评测",retrying:"正在重试…",failureStage:"失败阶段",errorCode:"错误码",taskId:"任务 ID",diagnosticAttempt:"评测轮次",runtime:"Runtime",errorDetails:"错误详情",diagnosticField:"{{label}}:{{value}}",diagnosticHeading:"{{label}}:",loadingReport:"正在读取评测报告…",reportTitle:"HTML 评测报告",reportHtmlDescription:"查看或下载 HTML 报告。",viewReport:"查看报告",reportDrawerDescription:"评分、差异与证据",closeReport:"关闭",closeReportAria:"关闭评测报告",reportPreviewTitle:"迁移效果评测报告预览",reportSummary:"评测摘要",reportVersion:"评测集 {{version}} · Prompt v{{prompt}}",downloadReport:"下载完整报告",downloadingReport:"正在下载…",overallScore:"综合一致性",scoreScale:"0–100;证据不足时显示 N/A",evidenceCoverage:"证据覆盖率",coverageDetail:"{{scored}} / {{total}} 个维度有证据",executionSuccess:"执行成功率",executionDetail:"{{succeeded}} / {{total}} 个用例完成",naCount:"N/A 数量",naDescription:"证据不足,不计入分数",gapDescription:"迁移差距说明",lowestScoringCases:"低分用例",executionFailures:"执行异常",criticalEvidence:"Critical 证据",limitations:"评测限制",viewEvidence:"查看 {{count}} 个用例的结果与证据",outputTruncated:"输出过长,已截断",executionState:{succeeded:"执行完成",failed:"执行异常"},severityLabel:"严重度:{{severity}}",severity:{none:"无",low:"低",medium:"中",high:"高",critical:"Critical",unknown:"未知"},evidenceSource:{user_reference:"期望结果",user_criteria:"填写的要求",source_contract:"源项目约束",observed_output:"实际输出",runtime_observation:"Runtime 原始数据",deterministic_assertion:"确定性断言"},listSeparator:"、"}},IHe={closeAria:"关闭错误提示",loadFailed:"无法读取迁移数据,请重试。",refreshFailed:"无法刷新迁移状态,请重试。"},PHe={title:"终止当前迁移?",description:"终止后,当前分析或迁移进程将停止,已执行的步骤不会继续。"},Our=Object.freeze(Object.defineProperty({__proto__:null,actions:EHe,activity:AHe,analysis:wHe,artifact:SHe,capability:_He,common:cHe,confirmation:LHe,conversation:RHe,default:{common:cHe,optimization:uHe,projects:hHe,framework:dHe,state:fHe,historyStatus:pHe,task:gHe,verification:mHe,transfer:vHe,validation:yHe,duration:bHe,expiry:xHe,analysis:wHe,activity:AHe,artifact:SHe,model:THe,upload:CHe,deployment:OHe,workspace:kHe,actions:EHe,capability:_He,conversation:RHe,questions:DHe,confirmation:LHe,evaluation:MHe,errors:IHe,stopDialog:PHe},deployment:OHe,duration:bHe,errors:IHe,evaluation:MHe,expiry:xHe,framework:dHe,historyStatus:pHe,model:THe,optimization:uHe,projects:hHe,questions:DHe,state:fHe,stopDialog:PHe,task:gHe,transfer:vHe,upload:CHe,validation:yHe,verification:mHe,workspace:kHe},Symbol.toStringTag,{value:"Module"})),NHe={loading:"加载中…",searchLabel:"搜索{{label}}",searchPlaceholder:"搜索{{label}}",retry:"重试",noMatches:"没有匹配项",noOptions:"暂无可选项",selection:"{{label}}:{{value}}"},BHe={badge:"焕然一新",view:"查看新特性",title:"本次更新",defaultNotes:{multiRegion:"多地域智能体:并行加载北京与上海 Runtime,列表下滑即可继续加载。",switchAgent:"会话内切换:在输入框旁选择智能体,并直接开启一段新会话。",visualCanvas:"可视化执行画布:通过横向画布查看多智能体结构,并支持全屏浏览。"}},$He={label:"新会话模式",agent:"智能体",skill:"技能定制",video:"视频创作"},FHe={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:"暂不可用"},zHe={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}}",wakingHint:"正在唤醒智能体,可能需要一些时间。"},UHe={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"},VHe={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}}秒"}},kur=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:zHe,compactSelect:NHe,default:{compactSelect:NHe,featureNotice:BHe,workspace:$He,mode:FHe,agentPicker:zHe,skill:UHe,video:VHe},featureNotice:BHe,mode:FHe,skill:UHe,video:VHe,workspace:$He},Symbol.toStringTag,{value:"Module"})),QHe="审核中心",GHe="审核资源类型",HHe="仅管理员可以访问审核中心",WHe="搜索申请名称、提交人或版本",YHe="审核状态",qHe="{{count}} 条待审核",jHe="共 {{count}} 条申请",XHe={skill:"技能",agent:"智能体"},KHe={all:"全部状态",pending:"待审核",approved:"已通过",returned:"已退回",approving:"发布中"},ZHe={application:"申请名称",submitter:"提交人",version:"版本",submittedAt:"提交时间",status:"状态",actions:"操作"},JHe={details:"详情",detailsFor:"查看 {{name}} 的申请详情",approve:"通过",approveFor:"通过 {{name}} 的申请",return:"退回",returnFor:"退回 {{name}} 的申请",close:"关闭",backToDetails:"返回详情",confirmApprove:"确认通过",confirmReturn:"确认退回",clearFilters:"清除筛选",refresh:"刷新",cancel:"取消",resumeApproval:"继续发布"},eWe={title:"暂无审核申请",description:"提交的审核申请会显示在这里",filteredTitle:"没有匹配的申请",filteredDescription:"试试其他关键词,或调整审核状态"},tWe={title:"申请详情",sections:"申请详情内容",overview:"申请信息",files:"提交文件 · {{count}}",requestType:"申请类型",update:"版本更新",firstRelease:"首次发布",source:"来源",source_skill:"{{name}}的个人技能空间",source_agent:"{{name}}的开发环境",destination:"发布目标",destination_skill:"企业共享技能空间",destination_agent:"全员共享智能体",region:"区域",visibility:"发布后可见范围",shared:"全员可见",description:"功能说明",changes:"本次提交说明",example:"使用示例",history:"审核记录",submitted:"{{name}}提交申请",versionFixed:"仅审核本次提交的版本",instructions:"使用说明",filesTab:"提交文件",filesFailed:"加载提交文件失败",unknownAuthor:"未知申请人",reviewer:"审批人",reviewedAt:"审批时间",approved:"{{name}}通过申请",returned:"{{name}}退回申请",unknownReviewer:"未知审批人",approvedBy:"通过人",returnedBy:"退回人",comment:"审批评论",result:"审批结果",noHistory:"此技能尚未提交审核",pendingHint:"等待管理员审核",approvingHint:"管理员已确认通过,正在发布到企业共享空间",approving:"{{name}}确认通过,等待完成发布"},rWe={failed:"待审核空间暂不可用",retry:"重试"},nWe={approveTitle:"通过申请",returnTitle:"退回申请",approveDescription:"通过后,{{name}} 的 {{version}} 版本将在企业共享空间中向全员公开",returnDescription:"退回 {{name}} 的 {{version}} 版本,并向申请人说明原因",reason:"退回理由",reasonRequired:"请填写退回理由",reasonHelp:"最多 256 个字符,申请人可以看到此理由",saving:"处理中…",failed:"审批失败,请重试",approved:"{{name}} 已通过并公开",returned:"{{name}} 已退回",comment:"评论(可选)",commentHelp:"最多 256 个字符,申请人可以看到此评论"},iWe={title:"AI 评分",points:"{{score}} 分",insufficient:"依据不足",status:{unscored:"尚未评分",not_requested:"尚未评分",queued:"等待评分",running:"评分中",completed:"已评分",failed:"评分失败"},loading:"加载评分…",starting:"正在提交评分…",loadFailed:"加载评分失败",retryFailed:"提交评分失败",failed:"评分未完成,请管理员重试",retry:"重新评分",start:"开始评分",reload:"重新加载",download:"下载 JSON",expand:"展开",collapse:"收起",hint:"评分针对本次提交版本,供人工审批参考",dimensions:{safety:"安全性",usability:"易用性",completeness:"完整性",reliability:"可靠性",maintainability:"可维护性"},risks:"风险提示",suggestions:"改进建议",model:"评分模型",rubric:"评分标准版本",time:"评分时间",severity:{low:"低风险",medium:"中风险",high:"高风险",critical:"严重风险"},coverage:"评审范围",coverageCount:"已评审 {{included}} / {{total}} 个文件",coverageIncomplete:"部分内容未纳入评审,评分依据不完整",omittedFile:"未评审 {{path}}:{{reason}}",truncatedFile:"仅评审部分内容 {{path}}:{{reason}}",originalError:"云端原始错误"},Eur=Object.freeze(Object.defineProperty({__proto__:null,actions:JHe,adminOnly:HHe,category:GHe,columns:ZHe,decision:nWe,default:{title:QHe,category:GHe,adminOnly:HHe,search:WHe,filterStatus:YHe,pendingCount:qHe,total:jHe,kind:XHe,status:KHe,columns:ZHe,actions:JHe,empty:eWe,detail:tWe,space:rWe,decision:nWe,score:iWe},detail:tWe,empty:eWe,filterStatus:YHe,kind:XHe,pendingCount:qHe,score:iWe,search:WHe,space:rWe,status:KHe,title:QHe,total:jHe},Symbol.toStringTag,{value:"Module"})),aWe={cancel:"取消",close:"关闭",retry:"重试",tryAgain:"重新尝试",closeDialog:"关闭{{title}}",agentFallback:"{{agent}} 智能体",unknownSource:"未知来源"},oWe={terminalTitle:"终端",browserTitle:"沙箱浏览器",terminalSubtitle:"连接当前 AgentKit Session 的交互式终端",browserSubtitle:"在当前 AgentKit Session 中查看与操作浏览器",connecting:"正在连接…",connected:"已连接",notConnected:"尚未连接",opening:"正在打开 {{title}}",connectingSession:"工具正在连接当前 AgentKit Session。",openFailed:"{{title}} 打开失败"},sWe={title:"恢复 Codex 对话",subtitle:"选择当前 Sandbox Session 中最近更新的 Thread",loading:"正在读取历史对话",loadFailed:"历史对话读取失败",empty:"暂无可恢复的对话"},lWe={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 自动审查流程处理审批请求。"}}},cWe={title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",absolutePath:"绝对路径",browse:"浏览",parent:"上一级",empty:"当前目录没有子目录",locked:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。",useDirectory:"使用此目录"},uWe={fileTitle:"允许修改文件?",commandTitle:"允许执行命令?",subtitle:"Codex 正在等待你的决定",workingDirectory:"执行目录",decline:"拒绝",acceptOnce:"仅本次允许",acceptSession:"本会话允许"},hWe={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:"发送",stopping:"正在确认停止…",resume:"恢复任务",steer:"追加要求",steerPlaceholder:"可继续追加要求,或随时停止任务…"},dWe={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:"重新尝试"},fWe={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:"推理输出"}},pWe={back:"返回智能体列表",subtitle:"{{agent}} 智能体详情",type:"智能体类型",status:"状态",createdBy:"创建人",snapshotStatus:"快照状态",toolType:"工具类型",createdAt:"创建时间",snapshotReason:"快照原因",expiresAt:"过期时间",snapshotId:"快照 ID",sessionId:"会话 ID",sourceSessionId:"来源 Session ID",delete:"删除智能体",waking:"唤醒中…",opening:"打开中…",wake:"唤醒智能体",open:"打开智能体",deleteTitle:"删除智能体?",deleteDescription:"将删除“{{name}}”及其保存的数据,此操作无法撤销。",deleting:"删除中…",confirmDelete:"确认删除",sleepingHint:"该智能体已休眠,进入时需要唤醒,可能需要一些时间。",wakingHint:"正在唤醒智能体,可能需要一些时间。",agentId:"智能体 ID"},gWe={back:"返回智能体列表",createdBy:"创建人 {{creator}}",ariaLabel:"智能体工作区",main:"主界面",terminal:"终端",mainTitle:"{{agent}} 主界面",openingTerminal:"正在打开终端…",terminalTitle:"{{agent}} 终端"},mWe={prompt:`使用 AgentKit Studio Plugin 端云接力当前会话、项目和任务。请直接执行,不要让我手动打开终端。 +- 保持礼貌、专业的语气。`},PQe={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",fallbackApiKeyLabel:"{{name}} 的备用模型 {{model}} 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 解压后的内容过大"}},NQe={back:"返回开发会话",runtimeName:"Runtime 名称",runtimeNameExists:"Runtime 名称已存在,请更换后重试",checkingRuntimeName:"正在检查 Runtime 名称",verifiedSource:"已验证源码",deployableSource:"可部署源码",verifiedByCodex:"已通过 Codex 云端验证",entryPoint:"入口",files:"文件",artifact:"构建产物",validationReport:"验证报告",verifiedHint:"源码由服务端从已验证交付物物化,浏览器文件不能替换。",unverifiedHint:"源码已由服务端安全物化,部署前请确认 Runtime 配置。",env:{requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}"}},BQe={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 中声明已有入口。"}},$Qe={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:"添加到最后"}},FQe={title:"智能构建",subtitle:"描述需求,完成 Agent 的构建、调试与验证。",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。"},tasks:{title:"进行中的任务",hint:"离开页面后仍会继续,可随时回来查看和补充要求。",refresh:"刷新任务列表",loading:"正在读取任务…",empty:"暂无进行中的任务",emptyHint:"开始构建后,可以从这里回到任务。",loadError:"暂时无法读取任务,请重试。",openError:"暂时无法打开任务,请重试。",startedAt:"开始于 {{time}}",open:"查看任务",opening:"正在连接…",states:{queued:"等待开始",running:"构建中",recovering:"正在重连",waiting_user:"等待你的回复",stopping:"正在停止",succeeded:"已完成",failed:"未完成",cancelled:"已停止"}}},zQe={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:"最新版本",defaultVersionName:"版本 · {{time}}",rename:{projectTitle:"修改项目名称",versionTitle:"修改版本名称",projectLabel:"项目名称",versionLabel:"版本名称",hint:"支持中英文、数字和常见标点,最多 {{max}} 个字符。",required:"请输入名称。",tooLong:"名称不能超过 {{max}} 个字符。",invalidCharacters:"名称不能包含换行、控制字符、不可见格式字符或 < >。",save:"保存名称",saving:"保存中…",updated:"名称已更新。",failed:"名称保存失败,请重试。"},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:"删除版本"}},UQe={title:"选择创建方式",subtitle:"以不同模式构建您的智能体",features:"特性",quick:{title:"快速模式",description:"动态派生子智能体自主完成任务",features:{dynamicSubagents:"动态派生子智能体",autonomousPlanning:"自主规划执行",collaboration:"多智能体协作",summary:"自动汇总结果",skills:"按需调用技能",trace:"任务过程可追踪"}},traditional:{title:"传统模式",description:"高度自定义您的智能体结构",features:{visualConfig:"可视化配置",migration:"存量智能体迁移",debugging:"实时调试",optimization:"可选性能优化",parameters:"精细参数控制"}}},VQe={placeholder:"输入系统提示词;键入 ## 加空格可创建二级标题…",toolbar:{undo:"撤销 {{shortcut}}",redo:"重做 {{shortcut}}",paragraph:"正文",quote:"引用",heading:"标题 {{level}}",selectBlockType:"选择文本类型",blockType:"文本类型",bold:"加粗",removeBold:"取消加粗",italic:"斜体",removeItalic:"取消斜体",bulletedList:"无序列表",numberedList:"有序列表"}},QQe={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 中心暂无技能。"}},GQe={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}} 条连线"}},HQe={ariaLabel:"快速模式创建",progress:"快速模式创建进度",steps:{agent:{label:"智能体",title:"基本信息",description:"设置智能体的名称、用途、行为方式与能力"},environment:{label:"执行环境",title:"配置执行环境",description:"选择默认环境或已构建的自定义环境"},deployment:{label:"部署偏好",title:"部署偏好",description:"定义 AgentKit 云上参数"}},model:{label:"模型",source:"模型来源",name:"模型名称",fallbacks:"Fallback 模型",fallbackPlaceholder:"备用模型名称",addFallback:"添加备用模型",addProviderFallback:"添加其他服务商",removeFallback:"移除",fallbackType:"备用模型类型",fallbackSameProvider:"同服务商",fallbackOtherProvider:"其他服务商",apiKeyEnv:"API Key 环境变量",invalidApiKeyEnv:"环境变量名只能包含字母、数字和下划线,且不能以数字开头。",fallbackHelp:"同服务商备用模型复用主模型连接;其他服务商会使用单独的 provider、API Base 和 API Key。",fallbackIgnored:"空值、重复值或与主模型相同的模型会被忽略。",provider:"服务商 Provider",invalidApiBase:"请输入合法的 http:// 或 https:// 链接。",volcengineArk:"火山方舟",custom:"自定义",gateway:"模型网关",comingSoon:"待上线",currentApiKey:"当前 API Key",currentConfiguration:"当前配置",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:"请选择模型",apiKeyRequired:"请先填写或选择模型 API Key",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:"更新并发布"}},WQe={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:"描述为必填项",mcpDuplicateName:"MCP 名称重复,请为每个服务使用唯一名称",mcpDuplicateUrl:"MCP 地址重复,请删除重复服务后再发布",missingSubagent:"缺少子 Agent",missingPrompt:"系统提示词为必填项",apiKeyRequired:"请先填写或选择模型 API Key",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:"模型名称",fallbacks:"Fallback 模型",fallbackPlaceholder:"备用模型名称",addFallback:"添加备用模型",addProviderFallback:"添加其他服务商",removeFallback:"移除",fallbackType:"备用模型类型",fallbackSameProvider:"同服务商",fallbackOtherProvider:"其他服务商",apiKeyEnv:"API Key 环境变量",invalidApiKeyEnv:"环境变量名只能包含字母、数字和下划线,且不能以数字开头。",fallbackHelp:"同服务商备用模型复用主模型连接;其他服务商会使用单独的 provider、API Base 和 API Key。",fallbackIgnored:"空值、重复值或与主模型相同的模型会被忽略。",provider:"服务商 Provider",invalidApiBase:"请输入合法的 http:// 或 https:// 链接。",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 Endpoint 时可直接使用;否则请补充完整服务路径。",tokenPlaceholder:"Bearer Token(可选)",showToken:"显示 Bearer Token",hideToken:"隐藏 Bearer Token",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 结构并准备部署快照…"}},YQe={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:"长期"}},qQe={checkingExpiry:"确认有效期中",waitingRecovery:"等待恢复",listFailed:"读取项目列表失败",recoveryFailed:"工作区恢复失败,请重试",operationFailed:"项目操作失败,请重试",title:"代码项目",back:"返回代码项目",restart:"本开发环境将在 {{countdown}} 后重启,请随时保存数据",expiresAt:"有效期至 {{date}}",exitFullscreen:"退出全屏",fullscreen:"全屏",exitFullscreenHint:"退出全屏(Esc)",recovering:"正在恢复工作区,完成后将自动返回项目",retry:"重试连接",search:"搜索代码项目",newTitle:"新建代码项目",new:"新建项目",readingStats:"正在读取项目统计",createdAt:"创建时间",opening:"正在打开",unknownCreatedAt:"创建时间未知",open:"打开项目",empty:"没有匹配的代码项目",close:"关闭新建项目",name:"项目名称",placeholder:"例如 my-agent",nameHelp:"以英文字母开头,可包含字母、数字、下划线和连字符,最多 64 个字符",cancel:"取消",create:"创建项目",files_one:"{{count}} 个文件",files_other:"{{count}} 个文件",directories_one:"{{count}} 个目录",directories_other:"{{count}} 个目录",separator:","},jQe={enabled:"已启用",disabled:"已禁用",unknownStatus:"状态未知",allPermissions:"全部权限",customPermissions:"自定义权限",unknownPermissions:"权限未知",unnamed:"未命名 API Key",search:"搜索名称、状态或权限",noMatches:"没有匹配的 API Key",noModelPermission:"当前 API Key 无权限",modelAvailable:"可用",permissionState:{Available:"可用于对话",Shutdown:"已下线",VideoGeneration:"视频生成模型",Unsupported:"不支持作为对话模型",NotActivated:"尚未开通",Unknown:"未获取到模型状态"}},Tur=Object.freeze(Object.defineProperty({__proto__:null,buildCanvas:$Qe,codePackage:BQe,common:DQe,default:{common:DQe,yaml:LQe,validation:MQe,defaults:IQe,helpers:PQe,intelligentDeployment:NQe,codePackage:BQe,buildCanvas:$Qe,intelligent:FQe,projectLibrary:zQe,modePicker:UQe,promptEditor:VQe,skills:QQe,workflow:GQe,workbench:HQe,traditional:WQe,template:YQe,workspace:qQe,modelApiKey:jQe},defaults:IQe,helpers:PQe,intelligent:FQe,intelligentDeployment:NQe,modePicker:UQe,modelApiKey:jQe,projectLibrary:zQe,promptEditor:VQe,skills:QQe,template:YQe,traditional:WQe,validation:MQe,workbench:HQe,workflow:GQe,workspace:qQe,yaml:LQe},Symbol.toStringTag,{value:"Module"})),XQe={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:"查看详情"},KQe={cancelDescription:"本次 Session 将被取消,后续计划不会暂停。",cancelTitle:"终止本次执行?",deleteDescription:"“{{name}}”及其全部执行历史将被永久删除。",deleteTitle:"删除定时任务?"},ZQe={configuration:"任务配置",nextRun:"下次执行",pageLabel:"定时任务详情",region:"地域",runtime:"运行时",status:"任务状态"},JQe={createTitle:"创建定时任务",description:"每次触发都会为 Runtime Agent 创建独立 Session。",editTitle:"编辑定时任务"},eGe={minutesSeconds:"{{minutes}} 分 {{seconds}} 秒",seconds:"{{count}} 秒"},tGe={cronExpression:"Cron 表达式",cronHelp:"依次填写分钟、小时、日期、月份、星期。",dailyTime:"每天执行时间",enableAfterCreate:"创建后启用",enableHelp:"启用后会从下一个计划时间开始执行。",name:"任务名称",namePlaceholder:"例如:每日生成运营摘要",noRuntime:"暂无可用 Runtime",prompt:"执行文本",promptPlaceholder:"输入每次执行时发送给 Agent 的固定文本",runAt:"执行时间",runtimeAgent:"运行时智能体",runtimeHelp:"任务始终跟随该 Runtime 当前生效版本。",runtimePlaceholder:"选择 Runtime Agent",schedule:"执行计划",scheduleType:"执行计划类型",timezone:"时区",weekday:"星期"},rGe={all:"全部"},nGe={description:"每次运行均使用独立 Session,结果与错误会永久保留。",duration:"耗时 {{duration}}",emptyDescription:"任务触发或立即执行后,记录会显示在这里。",emptyTitle:"暂无执行记录",errorDetails:"错误详情",finalAnswer:"最终回答",loadFailed:"无法加载执行历史",loadFailedDescription:"请检查 Studio 服务后重试。",session:"会话",title:"执行历史"},iGe={cancelRequested:"已提交终止请求。",created:"任务已创建。",deleted:"任务及其执行历史已删除。",enabled:"任务已启用。",paused:"任务已暂停。",queued:"任务已排队,将在一分钟内开始执行。",requeued:"任务已重新排队,将在一分钟内开始执行。",updated:"任务已更新。"},aGe={filterLabel:"定时任务状态筛选",listLabel:"定时任务列表",loadFailed:"无法加载定时任务",loadFailedDescription:"请检查 Studio 服务后重试。",title:"定时任务"},oGe={cron:"Cron {{cron}}{{zone}}",daily:"每天 {{time}}{{zone}}",once:"一次 · {{date}}{{zone}}",weekly:"{{weekday}} {{time}}{{zone}}"},sGe={daily:"每天",once:"一次性",weekly:"每周"},lGe={cancelled:"已取消",enabled:"已启用",failed:"失败",notRun:"尚未执行",paused:"已暂停",pending:"准备中",queued:"已排队",retrying:"自动重试中",running:"执行中",skipped:"已跳过",success:"成功"},cGe={cronFields:"Cron 表达式需要包含 5 个字段,例如 0 9 * * *。",nameRequired:"请输入任务名称。",promptRequired:"请输入每次执行时发送给 Agent 的文本。",runtimeAppMissing:"Runtime Agent 未返回可调用的 appName,请确认 Runtime 已就绪且版本兼容。",runtimeRequired:"请选择可用的 Runtime Agent。",timeRequired:"请选择执行时间。"},uGe={friday:"周五",monday:"周一",saturday:"周六",sunday:"周日",thursday:"周四",tuesday:"周二",wednesday:"周三"},Cur=Object.freeze(Object.defineProperty({__proto__:null,actions:XQe,confirm:KQe,default:{actions:XQe,confirm:KQe,detail:ZQe,drawer:JQe,duration:eGe,fields:tGe,filters:rGe,history:nGe,notices:iGe,page:aGe,schedule:oGe,scheduleTypes:sGe,status:lGe,validation:cGe,weekdays:uGe},detail:ZQe,drawer:JQe,duration:eGe,fields:tGe,filters:rGe,history:nGe,notices:iGe,page:aGe,schedule:oGe,scheduleTypes:sGe,status:lGe,validation:cGe,weekdays:uGe},Symbol.toStringTag,{value:"Module"})),hGe="快速创建 Agent",dGe="Agent 类型",fGe="关闭",pGe="部署",gGe="预览配置",mGe="已发起配置包下载",vGe="下载失败,请重试",yGe="有 {{count}} 处配置需要修改",bGe="自定义",xGe="自定义{{field}}",wGe="输入自定义值",AGe="该模型未声明推理强度,使用服务端设置",SGe="请先为该提供方添加模型",TGe="请先选择提供方",CGe="请选择",OGe="可选",kGe="默认模型、Agent 预设和权限用于新会话;预设需要存在于部署的 Harness 中",EGe="仅填写环境变量名称,实际密钥由部署环境提供",_Ge="read-only 为只读,workspace-write 可写工作区,danger-full-access 允许完整访问且不请求确认",RGe="allowedModels 是子 Agent 可选择的模型列表,启用后至少填写一组提供方和模型",DGe="添加自定义模型服务,填写它的端点、协议和模型 ID,支持火山引擎和 BytePlus 等兼容服务",LGe="当前覆盖常用原生设置,其他插件参数与预设文件尚未接入",MGe="查看原生配置文档",IGe="模型提供方 {{index}}",PGe="模型 {{index}}",NGe="添加模型提供方",BGe="移除提供方 {{index}}",$Ge="添加模型",FGe="移除模型 {{index}}",zGe="添加可选模型",UGe="移除可选模型 {{index}}",VGe="移除",QGe="填写服务端的模型 ID",GGe={provider:"提供方 {{index}}",model:"模型 {{index}}"},HGe={defaults:"会话默认设置",deepseek:"DeepSeek 模型服务",providers:"自定义模型提供方",shell:"命令执行",loop:"工具调用",subagents:"子 Agent 模型选择",search:"DeepSeek 网络搜索"},WGe={id:"提供方 ID",displayName:"显示名称",baseURL:"服务地址",api:"接口协议",apiKeyEnv:"密钥环境变量"},YGe={id:"例如 company-models",displayName:"可选,默认使用提供方 ID",baseURL:"https://…/v1",api:"选择接口协议",apiKeyEnv:"例如 MODEL_API_KEY"},qGe={id:"模型 ID",name:"显示名称",contextWindow:"上下文容量",maxTokens:"最大输出容量"},jGe={positive:"请输入大于 0 的数值",integer:"请输入有效的正整数",env:"请输入环境变量名,只能包含字母、数字和下划线,且不能以数字开头",url:"请输入 HTTP 或 HTTPS 地址,不要在地址中包含凭据",option:"请选择受支持的原生选项",required:"请补全此项",duplicate:"该 ID 或模型组合已存在",providerId:"以小写字母开头,可包含小写字母、数字、点、下划线和连字符,不能使用保留 ID",routes:"请至少填写一组完整的提供方和模型",modelPair:"请填写该自定义提供方下的模型 ID",unknownProvider:"请先添加该自定义模型提供方",unknownModel:"请填写该提供方下已配置的模型 ID",timer:"请输入大于 0 且不超过 2147483647 的毫秒数"},XGe={"agent-default-model_provider":"默认提供方","agent-default-model_model":"默认模型","agent-default-model_reasoningEffort":"默认推理强度","agent-presets_default":"默认 Agent 预设",permission_defaultPreset:"默认权限预设","llm-deepseek_apiKeyEnv":"密钥环境变量","llm-deepseek_baseURL":"服务地址","llm-deepseek_thinking":"思考模式","llm-deepseek_reasoningEffort":"推理强度","llm-deepseek_maxTokens":"每次请求的输出上限","llm-deepseek_defaultContextWindow":"默认上下文容量","llm-deepseek_streamIdleTimeoutMs":"流式空闲超时(毫秒)",bash_timeoutMs:"默认执行超时(毫秒)",bash_maxTimeoutMs:"最大执行超时(毫秒)",bash_maxOutputBytes:"输出上限(字节)","agent-loop_maxParallelToolCalls":"并行工具调用上限","subagent-model-selection_enabled":"启用模型选择","web-search-deepseek_apiKeyEnv":"密钥环境变量","web-search-deepseek_baseURL":"搜索服务地址","web-search-deepseek_model":"搜索模型","web-search-deepseek_apiVersion":"接口版本","web-search-deepseek_maxTokens":"搜索输出上限","web-search-deepseek_maxUses":"搜索次数上限"},KGe="取消",ZGe="返回创建方式",JGe="DeepSeek Harness 配置",Our=Object.freeze(Object.defineProperty({__proto__:null,addModel:$Ge,addProvider:NGe,addRoute:zGe,agentType:dGe,back:ZGe,cancel:KGe,close:fGe,coverage:LGe,credentialHelp:EGe,customField:xGe,customValue:bGe,default:{title:hGe,agentType:dGe,close:fGe,continue:"继续配置",deploy:pGe,preview:gGe,export:"导出配置",downloaded:mGe,downloadFailed:vGe,validationSummary:yGe,customValue:bGe,customField:xGe,enterCustomValue:wGe,reasoningUnavailable:AGe,modelsUnavailable:SGe,selectProviderFirst:TGe,selectOption:CGe,optional:OGe,defaultsHelp:kGe,credentialHelp:EGe,permissionHelp:_Ge,routesHelp:RGe,providersHelp:DGe,coverage:LGe,source:MGe,provider:IGe,model:PGe,addProvider:NGe,removeProvider:BGe,addModel:$Ge,removeModel:FGe,addRoute:zGe,removeRoute:UGe,remove:VGe,modelIdPlaceholder:QGe,route:GGe,sections:HGe,providerFields:WGe,providerPlaceholders:YGe,modelFields:qGe,errors:jGe,fields:XGe,cancel:KGe,back:ZGe,pageTitle:JGe},defaultsHelp:kGe,deploy:pGe,downloadFailed:vGe,downloaded:mGe,enterCustomValue:wGe,errors:jGe,fields:XGe,model:PGe,modelFields:qGe,modelIdPlaceholder:QGe,modelsUnavailable:SGe,optional:OGe,pageTitle:JGe,permissionHelp:_Ge,preview:gGe,provider:IGe,providerFields:WGe,providerPlaceholders:YGe,providersHelp:DGe,reasoningUnavailable:AGe,remove:VGe,removeModel:FGe,removeProvider:BGe,removeRoute:UGe,route:GGe,routesHelp:RGe,sections:HGe,selectOption:CGe,selectProviderFirst:TGe,source:MGe,title:hGe,validationSummary:yGe},Symbol.toStringTag,{value:"Module"})),eHe="问题反馈",tHe="问题描述",rHe="常见问题",nHe="取消",iHe="完成",aHe="提交反馈",oHe="正在上报…",sHe={title:"上报成功,感谢您的反馈",description:"AgentKit 团队会尽快查看您提交的问题。"},lHe={close:"关闭问题反馈",intro:"请选择遇到的问题,也可以补充具体表现。",privacy:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。",descriptionPlaceholder:"请描述问题发生时的表现(选填)",issues:{slow:"执行速度慢",crash:"运行崩溃",incorrect:"结果不准确",tool_error:"工具调用失败",other:"其他问题"}},cHe={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 团队,请注意隐私保护。"},kur=Object.freeze(Object.defineProperty({__proto__:null,cancel:nHe,commonIssues:rHe,default:{title:eHe,descriptionLabel:tHe,commonIssues:rHe,cancel:nHe,done:iHe,submit:aHe,submitting:oHe,success:sHe,dialog:lHe,page:cHe},descriptionLabel:tHe,dialog:lHe,done:iHe,page:cHe,submit:aHe,submitting:oHe,success:sHe,title:eHe},Symbol.toStringTag,{value:"Module"})),uHe={back:"返回",close:"关闭"},hHe={title:"优化迁移项目",closeAria:"关闭优化窗口"},dHe={title:"已迁移项目",description:"管理迁移后的源码版本,也可以选择任一版本继续优化。",libraryTitle:"项目与版本",libraryDescription:"查看、下载、部署或对比源码版本,也可以基于任一版本继续优化。",emptyTitle:"还没有已迁移的项目",emptyDescription:"迁移完成后,源码会自动保存在这里。"},fHe={langchain:"LangChain",langgraph:"LangGraph",adk:"Google ADK",strands:"Strands",agentcore:"AgentCore",dify:"Dify",any:"Any(通用迁移)"},pHe={awaitingUpload:"待上传",analyzing:"分析中",needsInput:"待补充",analysisReady:"待确认",migrating:"迁移中",validating:"校验中",packaging:"打包中",succeeded:"已完成",succeededWithWarnings:"已完成,有提示",partial:"部分完成",failed:"失败",cancelled:"已终止",expired:"已过期"},gHe={evaluationPending:"待评测",evaluationRunning:"评测中",waitingDataset:"待保存评测用例",waitingEnvironment:"待补充环境变量",evaluationFailed:"迁移完成,评测未完成",evaluationBlocked:"迁移完成,评测待处理",evaluationCancelled:"迁移完成,评测已取消",resultUnavailable:"结果不可用",environmentExpired:"环境已过期"},mHe={partialReady:"迁移产物已生成,但交付不完整,请查看迁移提示。",readyWithWarnings:"迁移产物已生成,请查看迁移提示。",ready:"迁移产物已生成。"},vHe={passed:"产物校验通过",failed:"产物校验未通过",degraded:"产物校验未完成"},yHe={session:"创建迁移环境",upload:"上传项目",analysis:"分析项目"},bHe={agentNameRequired:"请输入 Agent 名称",agentNameInvalid:"Agent 名称必须为 1-63 位,只能包含小写字母、数字和连字符,且必须以字母或数字开头和结尾"},xHe={seconds:"{{seconds}} 秒",minutesSeconds:"{{minutes}} 分 {{seconds}} 秒"},wHe={savedUnaffected:"已保存项目不受影响",savingUnaffected:"源码正在保存,完成后不受环境期限影响",activeDetail:"到期后任务记录和临时产物将无法访问",oneHour:"临时迁移环境保留 1 小时",ended:"临时迁移环境已结束",savedAvailable:"已保存项目仍可查看、下载、部署或优化",unavailable:"任务记录和临时产物已无法访问",countdown:"临时迁移环境将在 {{minutes}} 分 {{seconds}} 秒后结束",expiredSavedMessage:"临时迁移环境已结束,已保存项目不受影响。",expiredMessage:"临时迁移环境已结束,任务记录和临时产物无法继续访问。"},AHe={recommended:"建议迁移方式",scope:"迁移范围",excluded:"不在本次范围",viewEvidence:"查看分析证据",viewAssumptions:"查看关键假设",viewSourceEvidence:"查看源码证据"},SHe={ariaLabel:"Codex 执行动态",title:"Codex 执行动态",startingAnalysis:"Codex 正在开始分析…",startingMigration:"Codex 正在开始迁移…",loadError:"暂时无法读取 Codex 执行动态,不影响当前任务。",liveAnalyzing:"正在分析项目",liveMigrating:"正在执行迁移",liveValidating:"正在校验迁移结果",livePackaging:"正在整理迁移产物",liveDelivery:"正在核对交付产物"},THe={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:"正在读取迁移产物…"},CHe={retiring:"即将下线",currentDefault:"当前默认模型",loadError:"加载模型列表失败",label:"模型",placeholder:"选择模型"},OHe={zipOnly:"请选择 .zip 格式的本地项目文件。",invalidName:"ZIP 文件名无效,请重命名后重新选择。",tooLarge:"项目 ZIP 不能超过 {{size}}。",empty:"项目 ZIP 不能为空。",removeAria:"移除项目 ZIP",reselectPrompt:"重新选择项目 ZIP",selectPrompt:"选择或拖入本地项目 ZIP",reselect:"重新选择",selectZip:"选择 ZIP",continue:"继续上传",start:"上传并分析",inputAria:"选择本地项目 ZIP",retention:"临时迁移环境从创建完成起保留 1 小时;保存成功的源码版本不受影响。",uploading:"上传中…",sizeHint:"支持项目 ZIP,最大 {{size}}"},kHe={requiredPlaceholder:"请输入 {{key}}",optionalPlaceholder:"可选:{{key}}",notReady:"迁移产物尚未准备完成。",back:"返回迁移结果"},EHe={backToAddAgent:"返回添加 Agent",title:"从存量迁移",newMigration:"新建迁移",recent:"最近迁移",loadingSessions:"正在读取迁移会话…",noSessions:"暂无迁移会话",heading:"迁移存量 Agent 项目",intro:"上传本地项目 ZIP,Codex 将先进行只读分析,再由你确认迁移方式。",backToHome:"迁移首页",navigation:"迁移导航",showMore:"查看更多",showLess:"收起",projectName:"项目名称",status:"状态",createdAt:"创建时间",actions:"操作",openTask:"查看迁移 {{name}}",continueTask:"继续",viewTask:"查看"},_He={stop:"终止迁移",stopping:"正在终止…",cancel:"取消",reload:"重新读取",refreshStatus:"刷新状态"},RHe={unavailable:"迁移能力暂不可用",defaultReason:"Dev Sandbox 暂不可用,请联系管理员检查配置。"},DHe={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:"当前迁移已终止。你可以新建迁移并重新上传项目。"},LHe={ariaLabel:"补充项目分析信息",title:"补充分析所需信息",description:"附件保持锁定,提交后仅继续只读分析",submitting:"正在继续分析…",submit:"提交并继续分析"},MHe={ariaLabel:"回答迁移需要你决定的问题",title:"迁移需要你的回答",description:"回答后会在当前这一步里继续,不需要重新开始",other:"其他",otherPlaceholder:"也可以直接输入你的答案",submitting:"正在提交回答…",submit:"提交回答并继续"},IHe={ariaLabel:"确认迁移方式",title:"确认迁移方式",framework:"迁移方式",frameworkPlaceholder:"选择迁移方式",agentName:"Agent 名称",entry:"项目入口",entryPlaceholder:"选择项目入口",entryExample:"例如 agent.py:agent",consent:"点击“确认并开始迁移”即确认上述迁移范围、排除项和关键假设。",starting:"正在启动迁移…",start:"确认并开始迁移"},PHe={setup:{title:"迁移效果评测",description:"迁移完成后自动执行评测用例。",on:"已开启",off:"未开启",unavailable:"当前环境暂不支持迁移效果评测。",casesTitle:"评测用例",casesDescription:"至少添加一个用例。期望结果和评测标准可选。",configuredSummary:"{{count}} 个用例 · {{preset}} · {{dimensions}}",incompleteSummary:"{{count}} 个用例待填写 · {{preset}} · {{dimensions}}",dimensionSummary:"{{count}} 个维度",editSettings:"编辑设置",viewSettings:"查看设置",lockedTitle:"评测用例",lockedDescription:"上传开始后不可修改。",closeAria:"关闭评测设置",done:"完成配置",close:"关闭"},tabs:{label:"迁移任务内容",migration:"迁移",evaluation:"效果评测",waitingMigration:"等待迁移",waitingConfiguration:"待配置",running:"评测中",completed:"已完成",issue:"需处理"},bulk:{open:"批量粘贴",label:"每行输入一个用例",placeholder:`帮我查询今天的订单状态 +把结果整理成三点`,preview:"将添加 {{count}} 个用例",confirm:"添加用例"},case:{title:"用例 {{index}}",add:"添加用例",moveUp:"上移用例 {{index}}",moveDown:"下移用例 {{index}}",copy:"复制",delete:"删除",userInput:"用户输入",userInputPlaceholder:"例如:请帮我查询今天的订单状态",expectedOutcome:"期望结果(可选)",expectedOutcomePlaceholder:"描述希望 Agent 完成什么,不要求逐字一致",criteria:"必须满足的要求(可选)",addCriterion:"添加要求",criterionLabel:"必须满足的要求 {{index}}",criterionPlaceholder:"例如:必须包含订单号和当前状态",removeCriterion:"删除要求 {{index}}"},advanced:{title:"高级设置",standard:"标准评测",standardDescription:"默认包含语义一致性、输出约束、工作流与工具一致性 3 个维度,适合多数迁移。",custom:"自定义维度",customDescription:"按业务风险选择一个或多个评测维度。",lockedDescription:"项目开始上传后,评测方式和维度不再修改。"},dimension:{semantic_fidelity:"语义一致性",output_contract:"输出约束",workflow_tool_fidelity:"工作流与工具一致性",context_memory_fidelity:"上下文与记忆一致性",boundary_error_fidelity:"边界与异常一致性",safety_refusal_fidelity:"安全与拒答一致性"},dimensionDescription:{semantic_fidelity:"检查意图理解、结论和关键事实是否保持一致。",output_contract:"检查字段、结构、语言和格式约束是否保持。",workflow_tool_fidelity:"检查可观察的工作流分支和工具行为是否保持。",context_memory_fidelity:"检查可验证的多轮上下文和记忆行为。",boundary_error_fidelity:"检查无效输入、信息缺失和依赖失败时的行为。",safety_refusal_fidelity:"检查已有授权、拒答和敏感信息边界是否保持。"},validation:{caseCount:"请保留 1–{{count}} 个用例。",dimensionRequired:"请至少选择一个评测维度。",userInputRequired:"请输入用例内容。",userInputBytes:"单个用例不能超过 32 KiB。",expectedOutcomeBytes:"期望结果不能超过 16 KiB。",criteriaCount:"单个用例最多包含 {{count}} 条要求。",criterionRequired:"要求不能为空。",criterionBytes:"单条要求不能超过 2 KiB。",datasetBytes:"全部评测用例不能超过 10 MiB。"},dataset:{invalidLockResponse:"服务未确认评测用例已保存,请重试。",loadingSettings:"正在读取评测设置…",loadSettingsFailed:"评测设置读取失败。",retryLoadSettings:"重新读取",missing:"未找到已保存的评测用例,请重新填写并保存。",saveWarning:"评测用例暂未保存,不影响迁移。",retrySave:"重新保存评测用例",saving:"正在保存…"},state:{disabled:"未开启评测",waiting_dataset:"等待填写评测用例",pending:"迁移完成后自动开始评测",preparing:"正在准备评测环境…",waiting_environment:"需要补充运行所需的环境变量",deploying:"正在部署临时 Runtime…",executing:"正在执行评测用例…",judging:"正在执行评测分析…",aggregating:"正在汇总评测结果…",completed:"评测已完成",failed:"评测未完成",blocked:"评测需要处理后才能继续",cancelled:"评测已取消"},progress:{label:"迁移与迁移效果评测进度",migration:"迁移",evaluation:"迁移效果评测",notStarted:"未开始",inProgress:"进行中",completed:"完成",waitingConfiguration:"等待配置",issue:"有问题"},environment:{description:"填写临时 Runtime 所需的环境变量。",security:"仅用于本次评测。",optional:"可选",submit:"提交并继续评测",submitting:"正在提交…"},execution:{preparing:"准备评测",preparingDetail:"校验迁移产物和 {{count}} 个评测用例",deploying:"启动 Runtime",deployingDetail:"准备 {{runtime}}",runtimeFallback:"隔离运行环境",executing:"执行用例",executingDetail:"执行 {{count}} 个用例并记录输出",judging:"执行评测分析",judgingDetail:"评测 {{cases}} 个用例 · {{dimensions}} 个维度",aggregating:"生成评测报告",aggregatingDetail:"汇总评分与证据,生成 HTML 报告",waiting:"等待中",running:"执行中",failed:"失败",complete:"已完成"},result:{title:"执行进度",attempt:"第 {{attempt}} 次评测",pending:"等待迁移完成",retry:"重新评测",retrying:"正在重试…",failureStage:"失败阶段",errorCode:"错误码",taskId:"任务 ID",diagnosticAttempt:"评测轮次",runtime:"Runtime",errorDetails:"错误详情",diagnosticField:"{{label}}:{{value}}",diagnosticHeading:"{{label}}:",loadingReport:"正在读取评测报告…",reportTitle:"HTML 评测报告",reportHtmlDescription:"查看或下载 HTML 报告。",viewReport:"查看报告",reportDrawerDescription:"评分、差异与证据",closeReport:"关闭",closeReportAria:"关闭评测报告",reportPreviewTitle:"迁移效果评测报告预览",reportSummary:"评测摘要",reportVersion:"评测集 {{version}} · Prompt v{{prompt}}",downloadReport:"下载完整报告",downloadingReport:"正在下载…",overallScore:"综合一致性",scoreScale:"0–100;证据不足时显示 N/A",evidenceCoverage:"证据覆盖率",coverageDetail:"{{scored}} / {{total}} 个维度有证据",executionSuccess:"执行成功率",executionDetail:"{{succeeded}} / {{total}} 个用例完成",naCount:"N/A 数量",naDescription:"证据不足,不计入分数",gapDescription:"迁移差距说明",lowestScoringCases:"低分用例",executionFailures:"执行异常",criticalEvidence:"Critical 证据",limitations:"评测限制",viewEvidence:"查看 {{count}} 个用例的结果与证据",outputTruncated:"输出过长,已截断",executionState:{succeeded:"执行完成",failed:"执行异常"},severityLabel:"严重度:{{severity}}",severity:{none:"无",low:"低",medium:"中",high:"高",critical:"Critical",unknown:"未知"},evidenceSource:{user_reference:"期望结果",user_criteria:"填写的要求",source_contract:"源项目约束",observed_output:"实际输出",runtime_observation:"Runtime 原始数据",deterministic_assertion:"确定性断言"},listSeparator:"、"}},NHe={closeAria:"关闭错误提示",loadFailed:"无法读取迁移数据,请重试。",refreshFailed:"无法刷新迁移状态,请重试。"},BHe={title:"终止当前迁移?",description:"终止后,当前分析或迁移进程将停止,已执行的步骤不会继续。"},Eur=Object.freeze(Object.defineProperty({__proto__:null,actions:_He,activity:SHe,analysis:AHe,artifact:THe,capability:RHe,common:uHe,confirmation:IHe,conversation:DHe,default:{common:uHe,optimization:hHe,projects:dHe,framework:fHe,state:pHe,historyStatus:gHe,task:mHe,verification:vHe,transfer:yHe,validation:bHe,duration:xHe,expiry:wHe,analysis:AHe,activity:SHe,artifact:THe,model:CHe,upload:OHe,deployment:kHe,workspace:EHe,actions:_He,capability:RHe,conversation:DHe,questions:LHe,pendingInput:MHe,confirmation:IHe,evaluation:PHe,errors:NHe,stopDialog:BHe},deployment:kHe,duration:xHe,errors:NHe,evaluation:PHe,expiry:wHe,framework:fHe,historyStatus:gHe,model:CHe,optimization:hHe,pendingInput:MHe,projects:dHe,questions:LHe,state:pHe,stopDialog:BHe,task:mHe,transfer:yHe,upload:OHe,validation:bHe,verification:vHe,workspace:EHe},Symbol.toStringTag,{value:"Module"})),$He={loading:"加载中…",searchLabel:"搜索{{label}}",searchPlaceholder:"搜索{{label}}",retry:"重试",noMatches:"没有匹配项",noOptions:"暂无可选项",selection:"{{label}}:{{value}}"},FHe={badge:"焕然一新",view:"查看新特性",title:"本次更新",defaultNotes:{multiRegion:"多地域智能体:并行加载北京与上海 Runtime,列表下滑即可继续加载。",switchAgent:"会话内切换:在输入框旁选择智能体,并直接开启一段新会话。",visualCanvas:"可视化执行画布:通过横向画布查看多智能体结构,并支持全屏浏览。"}},zHe={label:"新会话模式",agent:"智能体",skill:"技能定制",video:"视频创作"},UHe={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:"暂不可用"},VHe={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}}",wakingHint:"正在唤醒智能体,可能需要一些时间。"},QHe={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"},GHe={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}}秒"}},_ur=Object.freeze(Object.defineProperty({__proto__:null,agentPicker:VHe,compactSelect:$He,default:{compactSelect:$He,featureNotice:FHe,workspace:zHe,mode:UHe,agentPicker:VHe,skill:QHe,video:GHe},featureNotice:FHe,mode:UHe,skill:QHe,video:GHe,workspace:zHe},Symbol.toStringTag,{value:"Module"})),HHe="审核中心",WHe="审核资源类型",YHe="仅管理员可以访问审核中心",qHe="搜索申请名称、提交人或版本",jHe="审核状态",XHe="{{count}} 条待审核",KHe="共 {{count}} 条申请",ZHe={skill:"技能",agent:"智能体"},JHe={all:"全部状态",pending:"待审核",approved:"已通过",returned:"已退回",approving:"发布中"},eWe={application:"申请名称",submitter:"提交人",version:"版本",submittedAt:"提交时间",status:"状态",actions:"操作"},tWe={details:"详情",detailsFor:"查看 {{name}} 的申请详情",approve:"通过",approveFor:"通过 {{name}} 的申请",return:"退回",returnFor:"退回 {{name}} 的申请",close:"关闭",backToDetails:"返回详情",confirmApprove:"确认通过",confirmReturn:"确认退回",clearFilters:"清除筛选",refresh:"刷新",cancel:"取消",resumeApproval:"继续发布"},rWe={title:"暂无审核申请",description:"提交的审核申请会显示在这里",filteredTitle:"没有匹配的申请",filteredDescription:"试试其他关键词,或调整审核状态"},nWe={title:"申请详情",sections:"申请详情内容",overview:"申请信息",files:"提交文件 · {{count}}",requestType:"申请类型",update:"版本更新",firstRelease:"首次发布",source:"来源",source_skill:"{{name}}的个人技能空间",source_agent:"{{name}}的开发环境",destination:"发布目标",destination_skill:"企业共享技能空间",destination_agent:"全员共享智能体",region:"区域",visibility:"发布后可见范围",shared:"全员可见",description:"功能说明",changes:"本次提交说明",example:"使用示例",history:"审核记录",submitted:"{{name}}提交申请",versionFixed:"仅审核本次提交的版本",instructions:"使用说明",filesTab:"提交文件",filesFailed:"加载提交文件失败",unknownAuthor:"未知申请人",reviewer:"审批人",reviewedAt:"审批时间",approved:"{{name}}通过申请",returned:"{{name}}退回申请",unknownReviewer:"未知审批人",approvedBy:"通过人",returnedBy:"退回人",comment:"审批评论",result:"审批结果",noHistory:"此技能尚未提交审核",pendingHint:"等待管理员审核",approvingHint:"管理员已确认通过,正在发布到企业共享空间",approving:"{{name}}确认通过,等待完成发布"},iWe={failed:"待审核空间暂不可用",retry:"重试"},aWe={approveTitle:"通过申请",returnTitle:"退回申请",approveDescription:"通过后,{{name}} 的 {{version}} 版本将在企业共享空间中向全员公开",returnDescription:"退回 {{name}} 的 {{version}} 版本,并向申请人说明原因",reason:"退回理由",reasonRequired:"请填写退回理由",reasonHelp:"最多 256 个字符,申请人可以看到此理由",saving:"处理中…",failed:"审批失败,请重试",approved:"{{name}} 已通过并公开",returned:"{{name}} 已退回",comment:"评论(可选)",commentHelp:"最多 256 个字符,申请人可以看到此评论"},oWe={title:"AI 评分",points:"{{score}} 分",insufficient:"依据不足",status:{unscored:"尚未评分",not_requested:"尚未评分",queued:"等待评分",running:"评分中",completed:"已评分",failed:"评分失败"},loading:"加载评分…",starting:"正在提交评分…",loadFailed:"加载评分失败",retryFailed:"提交评分失败",failed:"评分未完成,请管理员重试",retry:"重新评分",start:"开始评分",reload:"重新加载",download:"下载 JSON",expand:"展开",collapse:"收起",hint:"评分针对本次提交版本,供人工审批参考",dimensions:{safety:"安全性",usability:"易用性",completeness:"完整性",reliability:"可靠性",maintainability:"可维护性"},risks:"风险提示",suggestions:"改进建议",model:"评分模型",rubric:"评分标准版本",time:"评分时间",severity:{low:"低风险",medium:"中风险",high:"高风险",critical:"严重风险"},coverage:"评审范围",coverageCount:"已评审 {{included}} / {{total}} 个文件",coverageIncomplete:"部分内容未纳入评审,评分依据不完整",omittedFile:"未评审 {{path}}:{{reason}}",truncatedFile:"仅评审部分内容 {{path}}:{{reason}}",originalError:"云端原始错误"},Rur=Object.freeze(Object.defineProperty({__proto__:null,actions:tWe,adminOnly:YHe,category:WHe,columns:eWe,decision:aWe,default:{title:HHe,category:WHe,adminOnly:YHe,search:qHe,filterStatus:jHe,pendingCount:XHe,total:KHe,kind:ZHe,status:JHe,columns:eWe,actions:tWe,empty:rWe,detail:nWe,space:iWe,decision:aWe,score:oWe},detail:nWe,empty:rWe,filterStatus:jHe,kind:ZHe,pendingCount:XHe,score:oWe,search:qHe,space:iWe,status:JHe,title:HHe,total:KHe},Symbol.toStringTag,{value:"Module"})),sWe={cancel:"取消",close:"关闭",retry:"重试",tryAgain:"重新尝试",closeDialog:"关闭{{title}}",agentFallback:"{{agent}} 智能体",unknownSource:"未知来源"},lWe={terminalTitle:"终端",browserTitle:"沙箱浏览器",terminalSubtitle:"连接当前 AgentKit Session 的交互式终端",browserSubtitle:"在当前 AgentKit Session 中查看与操作浏览器",connecting:"正在连接…",connected:"已连接",notConnected:"尚未连接",opening:"正在打开 {{title}}",connectingSession:"工具正在连接当前 AgentKit Session。",openFailed:"{{title}} 打开失败"},cWe={title:"恢复 Codex 对话",subtitle:"选择当前 Sandbox Session 中最近更新的 Thread",loading:"正在读取历史对话",loadFailed:"历史对话读取失败",empty:"暂无可恢复的对话"},uWe={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 自动审查流程处理审批请求。"}}},hWe={title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",absolutePath:"绝对路径",browse:"浏览",parent:"上一级",empty:"当前目录没有子目录",locked:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。",useDirectory:"使用此目录"},dWe={fileTitle:"允许修改文件?",commandTitle:"允许执行命令?",subtitle:"Codex 正在等待你的决定",workingDirectory:"执行目录",decline:"拒绝",acceptOnce:"仅本次允许",acceptSession:"本会话允许"},fWe={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:"发送",stopping:"正在确认停止…",resume:"恢复任务",steer:"追加要求",steerPlaceholder:"可继续追加要求,或随时停止任务…"},pWe={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:"重新尝试"},gWe={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:"推理输出"}},mWe={back:"返回智能体列表",subtitle:"{{agent}} 智能体详情",type:"智能体类型",status:"状态",createdBy:"创建人",snapshotStatus:"快照状态",toolType:"工具类型",createdAt:"创建时间",snapshotReason:"快照原因",expiresAt:"过期时间",snapshotId:"快照 ID",sessionId:"会话 ID",sourceSessionId:"来源 Session ID",delete:"删除智能体",waking:"唤醒中…",opening:"打开中…",wake:"唤醒智能体",open:"打开智能体",deleteTitle:"删除智能体?",deleteDescription:"将删除“{{name}}”及其保存的数据,此操作无法撤销。",deleting:"删除中…",confirmDelete:"确认删除",sleepingHint:"该智能体已休眠,进入时需要唤醒,可能需要一些时间。",wakingHint:"正在唤醒智能体,可能需要一些时间。",agentId:"智能体 ID"},vWe={back:"返回智能体列表",createdBy:"创建人 {{creator}}",ariaLabel:"智能体工作区",main:"主界面",terminal:"终端",mainTitle:"{{agent}} 主界面",openingTerminal:"正在打开终端…",terminalTitle:"{{agent}} 终端"},yWe={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:"接力失败"}},vWe={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 快捷命令"}},yWe={label:"智能构建任务",queued:"构建任务已排队",running:"构建任务正在后台运行",recovering:"正在恢复构建任务",waiting_user:"构建任务需要继续处理",stopping:"正在停止构建任务",succeeded:"构建任务已完成",cancelled:"构建任务已停止",failed:"构建任务未完成",open:"返回任务",hide:"隐藏任务通知",reconnecting:"正在重新连接任务服务,已有任务继续保留。"},_ur=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:pWe,agentWorkspace:gWe,approval:uWe,commands:vWe,common:aWe,composer:hWe,default:{common:aWe,tool:oWe,threads:sWe,permissions:lWe,workspace:cWe,approval:uWe,composer:hWe,launch:dWe,session:fWe,agentDetails:pWe,agentWorkspace:gWe,handoff:mWe,commands:vWe,taskNotice:yWe},handoff:mWe,launch:dWe,permissions:lWe,session:fWe,taskNotice:yWe,threads:sWe,tool:oWe,workspace:cWe},Symbol.toStringTag,{value:"Module"})),bWe={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。保留所有权利。"},xWe={title:"登录状态已过期",description:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。",waiting:"等待登录完成…",signInAgain:"重新登录"},wWe={breadcrumbs:"面包屑",selectAgent:"选择 Agent",switchAgent:"切换智能体"},AWe={cancel:"取消",close:"关闭确认框"},Rur=Object.freeze(Object.defineProperty({__proto__:null,authExpired:xWe,confirm:AWe,default:{login:bWe,authExpired:xWe,navbar:wWe,confirm:AWe},login:bWe,navbar:wWe},Symbol.toStringTag,{value:"Module"})),SWe={defaultUser:"用户",shortcuts:"快捷入口",tryCli:"体验 AgentKit CLI",developerResources:"开发者资源",systemInfo:"系统信息",language:"语言",issueFeedback:"问题反馈",logout:"退出登录",roles:{admin:"管理员",developer:"开发者",user:"普通用户",super_admin:"超级管理员"}},TWe={home:"返回首页",expand:"展开侧边栏",collapse:"收起侧边栏",label:"主导航",newChat:"新会话",agents:"智能体",workspaces:"工作区",library:"资源库",cronjobs:"定时任务",automations:"自动化",users:"用户管理",administration:"管控",reviewCenter:"审核中心"},CWe={title:"历史会话",newConversation:"新会话",create:"新建会话",loading:"正在加载历史会话…",empty:"暂无会话",current:"当前",manage:"管理历史会话:{{title}}",more:"更多",delete:"删除",loadingMore:"加载中…",loadMore:"加载更多",evaluatingTitle:"正在自动评测",evaluating:"评测中",generating:"正在生成"},Dur=Object.freeze(Object.defineProperty({__proto__:null,account:SWe,default:{account:SWe,navigation:TWe,history:CWe},history:CWe,navigation:TWe},Symbol.toStringTag,{value:"Module"})),OWe={placeholder:"请选择",collapseOptions:"收起模型选项",expandOptions:"展开模型选项",noOptions:"暂无可用选项",noMatches:"没有匹配项,可直接使用当前模型 ID"},kWe={unsupportedActivity:"不支持的 Skill 对话活动",ariaLabel:"Skill 生成对话"},EWe={code:"错误码:{{code}}",type:"错误类型:{{type}}",representation:"异常表示:{{value}}",rawResponse:`服务端原始响应: -{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},_We={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},RWe={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}} 个文件"},DWe={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:"所有方案均创建失败,可分别重试。"},LWe={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 失败"},Lur=Object.freeze(Object.defineProperty({__proto__:null,api:LWe,configSelect:OWe,conversation:kWe,default:{configSelect:OWe,conversation:kWe,errorDetails:EWe,fileTree:_We,management:RWe,generation:DWe,api:LWe},errorDetails:EWe,fileTree:_We,generation:DWe,management:RWe},Symbol.toStringTag,{value:"Module"})),MWe={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:"无"},IWe={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},PWe={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 未配置用户池"},NWe={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 不匹配"}},BWe={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,不要重复填写镜像仓库路径。"}},$We={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},FWe={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},zWe={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},UWe={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:"当前没有可选择的自定义环境。"},VWe={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:"日志"},QWe={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"},GWe={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 名称一致。"},HWe={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:"重新尝试"},WWe={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。"}},YWe={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:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",codeProjects:"代码项目"},qWe={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},jWe={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"}},XWe={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:"查看日志"},KWe={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:"已删除"}},ZWe={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:"未知状态"},wakingHint:"正在唤醒智能体,可能需要一些时间。"},JWe={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:"未知"},sharedSpace:"企业共享空间",sharedDescription:"面向企业全员开放的技能,由管理员统一发布和维护",sharedVisibility:"全员可见",sharedPreparing:"正在准备共享空间",sharedLoadFailed:"共享空间加载失败",sharedEmpty:"暂无共享技能,管理员发布后会显示在这里",requestPublication:"申请公开",reviewSubmitting:"提交中…",reviewSubmitted:"已申请",reviewFailed:"申请公开失败",reviewStatusFailed:"审核状态加载失败",reviewRetry:"重新申请",reviewPending:"待审核",reviewApproving:"发布中",reviewApproved:"已公开",reviewReturned:"已退回",reviewHistory:"审核记录",skillDetailSections:"技能详情内容",versions:{title:"版本管理",refresh:"刷新",uploading:"上传中…",upload:"上传新版本",close:"关闭",hint:"新版本不会替换已公开版本,审核通过后才会公开;ZIP 中的技能名称需与原技能一致",loading:"正在加载版本…",loadFailed:"无法加载版本",filesFailed:"无法加载版本文件",uploadFailed:"上传新版本失败",submitFailed:"提交申请失败",retry:"重试",empty:"暂无版本",current:"当前版本",notSubmitted:"未申请公开",submitting:"提交中…",submit:"申请公开",processing:"版本状态:{{status}}",filesLoading:"正在加载文件…",filesEmpty:"暂无文件",history:"历史审核记录",shared:"已公开"},author:"作者",authorName:"作者:{{name}}"},eYe={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:"删除知识失败"}},Mur=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:IWe,agentSelector:KWe,agentWorkspace:NWe,cloudEnvironment:UWe,common:MWe,composer:XWe,default:{common:MWe,agentKitPromo:IWe,systemInfo:PWe,agentWorkspace:NWe,environmentCenter:BWe,deploymentSelect:$We,deploymentError:FWe,studioBuildProgress:zWe,cloudEnvironment:UWe,githubCicd:VWe,feishuDeployment:QWe,deploymentResources:GWe,studioUpdate:HWe,projectPreview:WWe,workspace:YWe,resourceCollection:qWe,skillSourcePicker:jWe,composer:XWe,agentSelector:KWe,myAgents:ZWe,skillCenter:JWe,knowledge:eYe},deploymentError:FWe,deploymentResources:GWe,deploymentSelect:$We,environmentCenter:BWe,feishuDeployment:QWe,githubCicd:VWe,knowledge:eYe,myAgents:ZWe,projectPreview:WWe,resourceCollection:qWe,skillCenter:JWe,skillSourcePicker:jWe,studioBuildProgress:zWe,studioUpdate:HWe,systemInfo:PWe,workspace:YWe},Symbol.toStringTag,{value:"Module"})),tYe="用户管理",rYe="{{count}} 位成员",nYe="用户",iYe="角色",aYe="账号状态",oYe="最近登录",sYe="操作",lYe="更改角色",cYe="关闭",uYe="保存角色",hYe="正在保存…",dYe="取消",fYe="返回",pYe="用户池",gYe="火山引擎 Identity",mYe="搜索姓名、邮箱或用户 ID",vYe="搜索",yYe="筛选角色",bYe="全部角色",xYe="刷新",wYe="正在读取用户…",AYe="更新于 {{time}}",SYe="已将 {{name}} 设置为{{role}}",TYe="重试",CYe="你",OYe="初始超级管理员",kYe="初始超级管理员受保护,不能在此降级",EYe="保存后,对方刷新 Studio 即可使用新的权限",_Ye="角色需要重新确认",RYe="没有匹配的用户",DYe="尝试其他关键词或角色",LYe="用户登录或加入当前用户池后会显示在这里",MYe="共 {{count}} 位用户",IYe="上一页",PYe="下一页",NYe="尚未登录",BYe="未提供",$Ye={super_admin:"超级管理员",admin:"管理员",developer:"开发者",user:"普通用户"},FYe={super_admin:"管理所有资源,并管理用户和分配角色",admin:"管理 Studio 资源",developer:"开发智能体并管理自己的资源",user:"使用智能体和个人功能"},zYe={EXTERNAL_PROVIDER:"正常",CONFIRMED:"正常",NORMAL:"正常",ENABLED:"正常",ACTIVE:"正常",UNCONFIRMED:"待验证",DISABLED:"已停用",FORBIDDEN:"已禁用",LOCKED:"已锁定",SUSPENDED:"已暂停",FORCE_CHANGE_PASSWORD:"需要修改密码"},UYe={request_failed:"请求未完成,请刷新列表确认当前状态后重试",invalid_response:"用户服务返回异常,请刷新后重试",identity_unavailable:"暂时无法访问 Identity,请稍后重试或检查服务权限",identity_resource_missing:"用户或用户池已不存在,请刷新列表",super_administrator_required:"只有超级管理员可以管理用户",sign_in_required:"请登录后重试",user_not_in_pool:"当前账号不属于此用户池",user_disabled:"当前账号已停用",protected_administrator:"不能降低初始超级管理员的权限",cannot_demote_self:"不能降低自己的超级管理员权限",role_change_conflict:"角色已发生变化,请关闭弹窗并刷新列表后重试",cross_origin_request:"请在当前 Studio 页面内修改角色"},Iur=Object.freeze(Object.defineProperty({__proto__:null,actions:sYe,allRoles:bYe,back:fYe,cancel:dYe,changeRole:lYe,close:cYe,default:{title:tYe,memberCount:rYe,user:nYe,role:iYe,status:aYe,lastLogin:oYe,actions:sYe,changeRole:lYe,close:cYe,save:uYe,saving:hYe,cancel:dYe,back:fYe,pool:pYe,volcengineIdentity:gYe,searchPlaceholder:mYe,search:vYe,filterRole:yYe,allRoles:bYe,refresh:xYe,loading:wYe,updatedAt:AYe,saved:SYe,retry:TYe,you:CYe,initialAdministrator:OYe,protectedExplanation:kYe,effectiveAfterRefresh:EYe,roleConflict:_Ye,noUsers:RYe,tryAnotherSearch:DYe,poolEmpty:LYe,resultCount:MYe,previous:IYe,next:PYe,neverLoggedIn:NYe,unknown:BYe,roles:$Ye,descriptions:FYe,states:zYe,errors:UYe},descriptions:FYe,effectiveAfterRefresh:EYe,errors:UYe,filterRole:yYe,initialAdministrator:OYe,lastLogin:oYe,loading:wYe,memberCount:rYe,neverLoggedIn:NYe,next:PYe,noUsers:RYe,pool:pYe,poolEmpty:LYe,previous:IYe,protectedExplanation:kYe,refresh:xYe,resultCount:MYe,retry:TYe,role:iYe,roleConflict:_Ye,roles:$Ye,save:uYe,saved:SYe,saving:hYe,search:vYe,searchPlaceholder:mYe,states:zYe,status:aYe,title:tYe,tryAnotherSearch:DYe,unknown:BYe,updatedAt:AYe,user:nYe,volcengineIdentity:gYe,you:CYe},Symbol.toStringTag,{value:"Module"})),VYe="网站集成",QYe="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",GYe="返回自动化列表",HYe="添加网站",WYe="正在加载 Runtime",YYe="选择 Runtime",qYe="网站域名",jYe="例如 xxxx.com 或 localhost:5173",XYe="正在生成",KYe="生成 Token",ZYe="已添加网站",JYe="{{count}} 个",eqe="{{count}} 个",tqe="正在加载网站集成",rqe="还没有网站集成",nqe="选择 Runtime 并输入网站域名即可生成 Token",iqe="引入方法",aqe="将下面代码放到网页的 body 结束标签前",oqe="已复制",sqe="复制代码",lqe="添加网站后会在这里生成引入代码。",cqe="确定删除 {{domain}} 的网站集成吗?",uqe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},hqe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},Pur=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:HYe,addedWebsites:ZYe,backToAutomations:GYe,confirmDelete:cqe,copied:oqe,copyCode:sqe,default:{title:VYe,description:QYe,backToAutomations:GYe,addWebsite:HYe,loadingRuntime:WYe,selectRuntime:YYe,websiteDomain:qYe,domainPlaceholder:jYe,generating:XYe,generateToken:KYe,addedWebsites:ZYe,websiteCount_one:JYe,websiteCount_other:eqe,loadingIntegrations:tqe,delete:"删除",emptyTitle:rqe,emptyDescription:nqe,embedMethod:iqe,embedInstructions:aqe,copied:oqe,copyCode:sqe,embedHint:lqe,confirmDelete:cqe,errors:uqe,widget:hqe},description:QYe,domainPlaceholder:jYe,embedHint:lqe,embedInstructions:aqe,embedMethod:iqe,emptyDescription:nqe,emptyTitle:rqe,errors:uqe,generateToken:KYe,generating:XYe,loadingIntegrations:tqe,loadingRuntime:WYe,selectRuntime:YYe,title:VYe,websiteCount_one:JYe,websiteCount_other:eqe,websiteDomain:qYe,widget:hqe},Symbol.toStringTag,{value:"Module"})),dqe={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:"下载产物失败"}},fqe={unknownSource:"未知来源",unknownCreator:"未知创建者"},pqe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},gqe={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:"查看和编辑项目源码"},mqe={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}}"},vqe={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}}界面预览"}},yqe={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},bqe={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:"(未命名)"},xqe={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 信息。"},wqe={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 环境。"},Aqe={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 终端"},Sqe={labels:{coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取",studio_write_artifact:"保存会话产物"},closeDialog:"关闭弹窗",title:"添加 Studio 工具",description:"由 Studio BFF 为 {{agentName}} 的当前会话执行,Runtime 无需预装",close:"关闭添加 Studio 工具",searchAria:"搜索 Studio 工具",searchPlaceholder:"搜索名称或工具标识",availableAria:"可用 Studio 工具",loading:"正在读取 Studio 工具…",noMatch:"没有匹配的 Studio 工具",remove:"移除",add:"添加"},Tqe={artifactLibrary:dqe,resourceMetadata:fqe,artifactEdit:pqe,codeBrowser:gqe,search:mqe,developerResources:vqe,library:yqe,manageAgents:bqe,agentTopology:xqe,sessionEnvironment:wqe,agentKitCli:Aqe,studioTools:Sqe},Nur=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:Aqe,agentTopology:xqe,artifactEdit:pqe,artifactLibrary:dqe,codeBrowser:gqe,default:Tqe,developerResources:vqe,library:yqe,manageAgents:bqe,resourceMetadata:fqe,search:mqe,sessionEnvironment:wqe,studioTools:Sqe},Symbol.toStringTag,{value:"Module"})),Cqe=["zh-CN","en-US"],Qse="en-US",Bur="agentkit.studio.locale",$ur={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function Gse(t){if(!t)return null;const e=t.trim().replace(/_/g,"-").toLowerCase(),r=Cqe.find(n=>n.toLowerCase()===e);return r||(e==="zh"||e.startsWith("zh-")?"zh-CN":e==="en"||e.startsWith("en-")?"en-US":null)}function Fur(){if(typeof window>"u")return null;try{return Gse(window.localStorage.getItem(Bur))}catch{return null}}function zur(){if(typeof window>"u")return[];const t=window.navigator;return t?t.languages.length>0?t.languages:t.language?[t.language]:[]:[]}function Uur(){const t=Fur();if(t)return t;for(const e of zur()){const r=Gse(e);if(r)return r}return Qse}function Oqe(t){typeof document>"u"||(document.documentElement.lang=t,document.documentElement.dir=$ur[t].dir)}const vn=t=>typeof t=="string",S6=()=>{let t,e;const r=new Promise((n,i)=>{t=n,e=i});return r.resolve=t,r.reject=e,r},Hse=t=>t==null?"":String(t),Vur=(t,e,r)=>{t.forEach(n=>{e[n]&&(r[n]=e[n])})},Qur=/###/g,kqe=t=>t&&t.includes("###")?t.replace(Qur,"."):t,Eqe=t=>!t||vn(t),T6=(t,e,r)=>{const n=vn(e)?e.split("."):e;let i=0;for(;i{const{obj:n,k:i}=T6(t,e,Object);if(n!==void 0||e.length===1){n[i]=r;return}let a=e[e.length-1],o=e.slice(0,e.length-1),s=T6(t,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=T6(t,o,Object),s!=null&&s.obj&&typeof s.obj[`${s.k}.${a}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=r},Gur=(t,e,r,n)=>{const{obj:i,k:a}=T6(t,e,Object);i[a]=i[a]||[],i[a].push(r)},WV=(t,e)=>{const{obj:r,k:n}=T6(t,e);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},Hur=(t,e,r)=>{const n=WV(t,r);return n!==void 0?n:WV(e,r)},Rqe=(t,e,r)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(Object.prototype.hasOwnProperty.call(t,n)?vn(t[n])||t[n]instanceof String||vn(e[n])||e[n]instanceof String?r&&(t[n]=e[n]):Rqe(t[n],e[n],r):t[n]=e[n]);return t},Wv=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),Wur={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},Yur=t=>vn(t)?t.replace(/[&<>"'\/]/g,e=>Wur[e]):t;class qur{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 jur=[" ",",","?","!",";"],Xur=new qur(20),Kur=(t,e,r)=>{e=e||"",r=r||"";const n=jur.filter(o=>!e.includes(o)&&!r.includes(o));if(n.length===0)return!0;const i=Xur.getRegExp(`(${n.map(o=>o==="?"?"\\?":o).join("|")})`);let a=!i.test(t);if(!a){const o=t.indexOf(r);o>0&&!i.test(t.substring(0,o))&&(a=!0)}return a},Wse=(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,"-"),Zur={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 YV{constructor(e,r={}){this.init(e,r)}init(e,r={}){this.prefix=r.prefix||"i18next:",this.logger=e||Zur,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=>vn(a)?a.replace(/[\r\n\x00-\x1F\x7F]/g," "):a),vn(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[r](e))}create(e){return new YV(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new YV(this.logger,e)}}var pm=new YV;class qV{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 o=0;o{for(let o=0;o-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,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.includes(".")?s=e.split("."):(s=[e,r],n&&(Array.isArray(n)?s.push(...n):vn(n)&&a?s.push(...n.split(a)):s.push(n)));const l=WV(this.data,s);return!l&&!r&&!n&&e.includes(".")&&(e=s[0],r=s[1],n=s.slice(2).join(".")),l||!o||!vn(n)?l:Wse((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 o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let s=[e,r];n&&(s=s.concat(o?n.split(o):n)),e.includes(".")&&(s=e.split("."),i=r,r=s[1]),this.addNamespaces(r),_qe(this.data,s,i),a.silent||this.emit("added",e,r,n,i)}addResources(e,r,n,i={silent:!1}){for(const a in n)(vn(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,o={silent:!1,skipCopy:!1}){let s=[e,r];e.includes(".")&&(s=e.split("."),i=n,n=r,r=s[1]),this.addNamespaces(r);let l=WV(this.data,s)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?Rqe(l,n,a):l={...l,...n},_qe(this.data,s,l),o.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 Lqe={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,r,n,i){return t.forEach(a=>{var o;e=((o=this.processors[a])==null?void 0:o.process(e,r,n,i))??e}),e}};const Mqe=Symbol("i18next/PATH_KEY");function Jur(){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===Mqe?t:(t.push(i),r=Proxy.revocable(n,e),r.proxy)},Proxy.revocable(Object.create(null),e).proxy}function gA(t,e){const{[Mqe]:r}=t(Jur()),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 o=e==null?void 0:e.ns,s=a?Array.isArray(o)?o:o?[o]:null:Array.isArray(o)?o:null;if(s&&(a?s:s.length>1?s.slice(1):[]).includes(r[0]))return`${r[0]}${i}${r.slice(1).join(n)}`}return r.join(n)}const Yse=t=>!vn(t)&&typeof t!="boolean"&&typeof t!="number";class jV extends qV{constructor(e,r={}){super(),Vur(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=pm.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=Yse(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 o=n&&e.includes(n),s=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!Kur(e,n,i);if(o&&!s){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:vn(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:vn(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=gA(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]),e=e.map(L=>typeof L=="function"?gA(L,{...this.options,...i}):String(L));const a=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:s,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}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:`${u}${h}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:s;const p=this.resolve(e,i);let g=p==null?void 0:p.res;const m=(p==null?void 0:p.usedKey)||s,v=(p==null?void 0:p.exactUsedKey)||s,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&&!vn(i.count),A=jV.hasDefaultValue(i),S=w?this.pluralResolver.getSuffix(d,i.count,i):"",T=i.ordinal&&w?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):"",C=w&&!i.ordinal&&i.count===0,k=C&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${T}`]||i.defaultValue;let E=g;x&&!g&&A&&(E=k);const _=Yse(E),P=Object.prototype.toString.apply(E);if(x&&E&&_&&!y.includes(P)&&!(vn(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 '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=L,p.usedParams=this.getUsedParamsDetails(i),p):L}if(o){const L=Array.isArray(E),R=L?[]:{},D=L?v:m;for(const M in E)if(Object.prototype.hasOwnProperty.call(E,M)){const I=`${D}${o}${M}`;A&&!g?R[M]=this.translate(I,{...i,defaultValue:Yse(k)?k[M]:void 0,joinArrays:!1,ns:l}):R[M]=this.translate(I,{...i,joinArrays:!1,ns:l}),R[M]===I&&(R[M]=E[M])}g=R}}else if(x&&vn(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=s);const M=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&R?void 0:g,I=A&&k!==g&&this.options.updateMissing;if(R||L||I){if(this.logger.log(I?"updateKey":"missingKey",d,u,w&&!I?`${s}${this.pluralResolver.getSuffix(d,i.count,i)}`:s,I?k:g),o){const V=this.resolve(s,{...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,I,i):(G=this.backendConnector)!=null&&G.saveMissing&&this.backendConnector.saveMissing(V,u,z,Q,I,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);C&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!z.includes(`${this.options.pluralSeparator}zero`)&&z.push(`${this.options.pluralSeparator}zero`),z.forEach(U=>{B([V],s+U,i[`defaultValue${U}`]||k)})}):B(N,s,k))}g=this.extendTranslation(g,e,i,p,n),R&&g===s&&this.options.appendNamespaceToMissingKey&&(g=`${u}${h}${s}`),(R||L)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${h}${s}`:s,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=vn(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&&!vn(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 o=n.postProcess||this.options.postProcess,s=vn(o)?[o]:o;return e!=null&&(s!=null&&s.length)&&n.applyPostProcessor!==!1&&(e=Lqe.handle(s,e,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,r={}){let n,i,a,o,s;return vn(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(l=>typeof l=="function"?gA(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&&!vn(r.count),p=f&&!r.ordinal&&r.count===0,g=r.context!==void 0&&(vn(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)||(s=v,!this.checkedLoadedFor[`${m[0]}-${v}`]&&((y=this.utils)!=null&&y.hasLoadedNamespace)&&!((b=this.utils)!=null&&b.hasLoadedNamespace(s))&&(this.checkedLoadedFor[`${m[0]}-${v}`]=!0,this.logger.warn(`key "${i}" for languages "${m.join(", ")}" won't get resolved as namespace "${s}" 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;o=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 C=`${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+C)),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+C))}}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:o,usedNS:s}}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&&!vn(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 Iqe{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=pm.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(e=C6(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=C6(e),!e||!e.includes("-"))return e;const r=e.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(e){if(vn(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(o=>o===a?!0:!o.includes("-")&&!a.includes("-")?!1:!!(o.includes("-")&&!a.includes("-")&&o.slice(0,o.indexOf("-"))===a||o.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)),vn(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||vn(r),o=r===void 0&&typeof this.options.fallbackLng=="function",s=vn(e)&&a&&!o;let l=null;if(s){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 vn(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))):vn(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 Pqe={zero:0,one:1,two:2,few:3,many:4,other:5},Nqe={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class ehr{constructor(e,r={}){this.languageUtils=e,this.options=r,this.logger=pm.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,r={}){const n=C6(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 o;try{o=new Intl.PluralRules(n,{type:i})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Nqe;if(!e.match(/-|_/))return Nqe;const l=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(l,r)}return this.pluralRulesCache[a]=o,o}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)=>Pqe[i]-Pqe[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 Bqe=(t,e,r,n=".",i=!0)=>{let a=Hur(t,e,r);return!a&&i&&vn(r)&&(a=Wse(t,r,n),a===void 0&&(a=Wse(e,r,n))),a},$qe=t=>t.replace(/\$/g,"$$$$");class Fqe{constructor(e={}){var r;this.logger=pm.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:o,suffix:s,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:Yur,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=a?Wv(a):o||"{{",this.suffix=s?Wv(s):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=h?"":d?Wv(d):"-",this.unescapeSuffix=this.unescapePrefix?"":h?Wv(h):"",this.nestingPrefix=f?Wv(f):p||Wv("$t("),this.nestingSuffix=g?Wv(g):m||Wv(")"),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,o,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const b=Bqe(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(Bqe(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(s=0;a=g.regex.exec(e);){const m=a[1].trim();if(o=u(m),o===void 0)if(typeof h=="function"){const y=h(e,a,i);o=vn(y)?y:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))o="";else if(d){o=a[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`),o="";else!vn(o)&&!this.useRawValueToEscape&&(o=Hse(o));const v=g.safeValue(o);if(e=e.replace(a[0],$qe(v)),d?(g.regex.lastIndex+=v.length,g.regex.lastIndex-=a[0].length):g.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),e}nest(e,r,n={}){let i,a,o;const s=(l,u)=>{const h=this.nestingOptionsSeparator;if(!l.includes(h))return l;const d=l.split(new RegExp(`${Wv(h)}[ ]*{`));let f=`{${d[1]}`;l=d[0],f=this.interpolate(f,o);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{o=JSON.parse(f),u&&(o={...u,...o})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,m),`${l}${h}${f}`}return o.defaultValue&&o.defaultValue.includes(this.prefix)&&delete o.defaultValue,l};for(;i=this.nestingRegexp.exec(e);){let l=[];o={...n},o=o.replace&&!vn(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.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(s.call(this,i[1].trim(),o),o),a&&i[0]===e&&!vn(a))return a;vn(a)||(a=Hse(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],$qe(Hse(a))),this.regexp.lastIndex=0}return e}}const thr=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(o=>{if(o){const[s,...l]=o.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),h=s.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}},zqe=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 o=n+JSON.stringify(a);let s=e[o];return s||(s=t(C6(n),i),e[o]=s),s(r)}},rhr=t=>(e,r,n)=>t(C6(r),n)(e);class nhr{constructor(e={}){this.logger=pm.create("formatter"),this.options=e,this.init(e)}init(e,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const n=r.cacheInBuiltFormats?zqe:rhr;this.formats={number:n((i,a)=>{const o=new Intl.NumberFormat(i,{...a});return s=>o.format(s)}),currency:n((i,a)=>{const o=new Intl.NumberFormat(i,{...a,style:"currency"});return s=>o.format(s)}),datetime:n((i,a)=>{const o=new Intl.DateTimeFormat(i,{...a});return s=>o.format(s)}),relativetime:n((i,a)=>{const o=new Intl.RelativeTimeFormat(i,{...a});return s=>o.format(s,a.range||"day")}),list:n((i,a)=>{const o=new Intl.ListFormat(i,{...a});return s=>o.format(s)})}}add(e,r){this.formats[e.toLowerCase().trim()]=r}addCached(e,r){this.formats[e.toLowerCase().trim()]=zqe(r)}format(e,r,n,i={}){if(!r||e==null)return e;const a=r.split(this.formatSeparator),o=[];for(let l=0;l-1&&!u.includes(")")&&l+1{var f;const{formatName:h,formatOptions:d}=thr(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 ihr=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class ahr extends qV{constructor(e,r,n,i={}){var a,o;super(),this.backend=e,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=pm.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=[],(o=(a=this.backend)==null?void 0:a.init)==null||o.call(a,n,i.backend,i)}queueLoad(e,r,n,i){const a={},o={},s={},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?o[f]===void 0&&(o[f]=!0):(this.state[f]=1,h=!1,o[f]===void 0&&(o[f]=!0),a[f]===void 0&&(a[f]=!0),l[d]===void 0&&(l[d]=!0)))}),h||(s[u]=!0)}),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(e,r,n){const i=e.split("|"),a=i[0],o=i[1];r&&this.emit("failedLoading",a,o,r),!r&&n&&this.store.addResourceBundle(a,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=r?-1:2,r&&n&&(this.state[e]=0);const s={};this.queue.forEach(l=>{Gur(l.loaded,[a],o),ihr(l,e),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{s[u]||(s[u]={});const h=l.loaded[u];h.length&&h.forEach(d=>{s[u][d]===void 0&&(s[u][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(e,r,n,i=0,a=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:r,fcName:n,tried:i,wait:a,callback:o});return}this.readingCalls++;const s=(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,o)},a);return}o(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=>s(null,h)).catch(s):s(null,u)}catch(u){s(u)}return}return l(e,r,s)}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();vn(e)&&(e=this.languageUtils.toResolveHierarchy(e)),vn(r)&&(r=[r]);const a=this.queueLoad(e,r,n,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach(o=>{this.loadOne(o)})}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,(o,s)=>{o&&this.logger.warn(`${r}loading namespace ${a} for language ${i} failed`,o),!o&&s&&this.logger.log(`${r}loaded namespace ${a} for language ${i}`,s),this.loaded(e,o,s)})}saveMissing(e,r,n,i,a,o={},s=()=>{}){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={...o,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=>s(null,v)).catch(s):s(null,m)}catch(m){s(m)}else g(e,r,n,i,s,p)}!e||!e[0]||this.store.addResource(e[0],r,n,i)}}}const qse=()=>({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]),vn(t[1])&&(e.defaultValue=t[1]),vn(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}),Uqe=t=>(vn(t.ns)&&(t.ns=[t.ns]),vn(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),vn(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&!t.supportedLngs.includes("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),XV=()=>{},ohr=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(r=>{typeof t[r]=="function"&&(t[r]=t[r].bind(t))})};class O6 extends qV{constructor(e={},r){if(super(),this.options=Uqe(e),this.services={},this.logger=pm,this.modules={external:[]},ohr(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&&(vn(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const n=qse();this.options={...n,...this.options,...Uqe(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?pm.init(i(this.modules.logger),this.options):pm.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=nhr;const h=new Iqe(this.options);this.store=new Dqe(this.options.resources,this.options);const d=this.services;d.logger=pm,d.resourceStore=this.store,d.languageUtils=h,d.pluralResolver=new ehr(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 Fqe(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new ahr(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 jV(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=XV),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 s=S6(),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),s.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),s}loadResources(e,r=XV){var a,o;let n=r;const i=vn(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 s=[],l=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(d=>{d!=="cimode"&&(s.includes(d)||s.push(d))})};i?l(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(h=>l(h)),(o=(a=this.options.preload)==null?void 0:a.forEach)==null||o.call(a,u=>l(u)),this.services.backendConnector.load(s,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(u)})}else n(null)}reloadResources(e,r,n){const i=S6();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=XV),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"&&Lqe.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=s,this.languages=this.services.languageUtils.toResolveHierarchy(s),this.resolvedLanguage=void 0,this.setResolvedLanguage(s)},a=(s,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(s,(...u)=>this.t(...u))},o=s=>{var h,d;!e&&!s&&this.services.languageDetector&&(s=[]);const l=vn(s)?s:s&&s[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(vn(s)?[s]:s);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?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),n}getFixedT(e,r,n,i){const a=i==null?void 0:i.scopeNs,o=(s,l,...u)=>{let h;typeof l!="object"?h=this.options.overloadTranslationOptionHandler([s,l].concat(u)):h={...l},h.lng=h.lng||o.lng,h.lngs=h.lngs||o.lngs;const d=h.ns!==void 0&&h.ns!==null;h.ns=h.ns||o.ns,h.keyPrefix!==""&&(h.keyPrefix=h.keyPrefix||n||o.keyPrefix);const f={...this.options,...h};Array.isArray(a)&&!d&&(f.ns=a),typeof h.keyPrefix=="function"&&(h.keyPrefix=gA(h.keyPrefix,f));const p=this.options.keySeparator||".";let g;return h.keyPrefix&&Array.isArray(s)?g=s.map(m=>(typeof m=="function"&&(m=gA(m,f)),`${h.keyPrefix}${p}${m}`)):(typeof s=="function"&&(s=gA(s,f)),g=h.keyPrefix?`${h.keyPrefix}${p}${s}`:s),this.t(g,h)};return vn(e)?o.lng=e:o.lngs=e,o.ns=r,o.keyPrefix=n,o}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 o=(s,l)=>{const u=this.services.backendConnector.state[`${s}|${l}`];return u===-1||u===0||u===2};if(r.precheck){const s=r.precheck(this,o);if(s!==void 0)return s}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(n,e)&&(!i||o(a,e)))}loadNamespaces(e,r){const n=S6();return this.options.ns?(vn(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=S6();vn(e)&&(e=[e]);const i=this.options.preload||[],a=e.filter(o=>!i.includes(o)&&this.services.languageUtils.isSupportedCode(o));return a.length?(this.options.preload=i.concat(a),this.loadResources(o=>{n.resolve(),r&&r(o)}),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 o=new Intl.Locale(e);if(o&&o.getTextInfo){const s=o.getTextInfo();if(s&&s.direction)return s.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 Iqe(qse());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 O6(e,r);return n.createInstance=O6.createInstance,n}cloneInstance(e={},r=XV){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},a=new O6(i);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(s=>{a[s]=this[s]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const s=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 Dqe(s,i),a.services.resourceStore=a.store}if(e.interpolation){const l={...qse().interpolation,...this.options.interpolation,...e.interpolation},u={...i,interpolation:l};a.services.interpolator=new Fqe(u)}return a.translator=new jV(a.services,i),a.translator.on("*",(s,...l)=>{a.emit(s,...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 Au=O6.createInstance();Au.createInstance,Au.dir,Au.init,Au.loadResources,Au.reloadResources,Au.use,Au.changeLanguage,Au.getFixedT,Au.t,Au.exists,Au.setDefaultNamespace,Au.hasLoadedNamespace,Au.loadNamespaces,Au.loadLanguages;const shr={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},lhr=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function Vqe(t){const e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},r=t.match(/<\/?([^\s]+?)[/\s>]/);if(r&&(e.name=r[1],(shr[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(lhr);let i=null;for(;i=n.exec(t),i!==null;)if(i[0].trim())if(i[1]){const a=i[1].trim();let o=[a,null];const s=a.indexOf("=");s>-1&&(o=[a.slice(0,s),a.slice(s+1)]),e.attrs[o[0]]=o[1],n.lastIndex--}else i[2]&&(e.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return e}const KV=/|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,chr=/<\/?([^\s]+?)[/\s>]/,uhr=/^\s*$/,hhr=/^(script|style)$/i,k6="\0",dhr=Object.create(null);function Qqe(t){t.forEach(function(e){if(e.type==="text"){e.content=e.content.split(k6).join("<");return}if(e.type==="comment"){e.comment=e.comment.split(k6).join("<");return}for(const r in e.attrs){const n=e.attrs[r];typeof n=="string"&&n.indexOf(k6)>-1&&(e.attrs[r]=n.split(k6).join("<"))}e.children.length&&Qqe(e.children)})}function fhr(t,e){const r=e&&e.components||dhr,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;KV.lastIndex=0;let y;for(;y=KV.exec(t);){const b=y[0];m+=t.slice(v,y.index);const x=b.match(chr);b.startsWith("",t}}function ghr(t){return t.reduce(function(e,r){return e+Gqe("",r)},"")}var mhr={parse:fhr,stringify:ghr};const ZV=(t,e,r,n)=>{var a,o,s,l;const i=[r,{code:e,...n||{}}];if((o=(a=t==null?void 0:t.services)==null?void 0:a.logger)!=null&&o.forward)return t.services.logger.forward(i,"warn","react-i18next::",!0);_h(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),(l=(s=t==null?void 0:t.services)==null?void 0:s.logger)!=null&&l.warn?t.services.logger.warn(...i):console!=null&&console.warn&&console.warn(...i)},Hqe={},gE=(t,e,r,n)=>{_h(r)&&Hqe[r]||(_h(r)&&(Hqe[r]=new Date),ZV(t,e,r,n))},Wqe=(t,e)=>()=>{if(t.isInitialized)e();else{const r=()=>{setTimeout(()=>{t.off("initialized",r)},0),e()};t.on("initialized",r)}},jse=(t,e,r)=>{t.loadNamespaces(e,Wqe(t,r))},Yqe=(t,e,r,n)=>{if(_h(r)&&(r=[r]),t.options.preload&&t.options.preload.indexOf(e)>-1)return jse(t,r,n);r.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,Wqe(t,n))},vhr=(t,e,r={})=>!e.languages||!e.languages.length?(gE(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}}),_h=t=>typeof t=="string",Yv=t=>typeof t=="object"&&t!==null,yhr=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,bhr={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},xhr=t=>bhr[t],qqe=t=>t.replace(yhr,xhr);let Xse={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:qqe,transDefaultProps:void 0};const whr=(t={})=>{Xse={...Xse,...t}},Kse=()=>Xse;let jqe;const Ahr=t=>{jqe=t},Zse=()=>jqe,JV=(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},E6=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?tx(e):e},Shr=t=>Array.isArray(t)&&t.every(j.isValidElement),tx=t=>Array.isArray(t)?t:[t],Thr=(t,e)=>{const r={...e};return r.props={...e.props,...t.props},r},Chr=t=>{const e={};if(!t)return e;const r=n=>{tx(n).forEach(a=>{_h(a)||(JV(a)?r(E6(a)):Yv(a)&&!j.isValidElement(a)&&Object.assign(e,a))})};return r(t),e},Jse=(t,e,r,n)=>{if(!t)return"";let i="";const a=tx(t),o=e!=null&&e.transSupportBasicHtmlNodes?e.transKeepBasicHtmlNodesFor??[]:[];return a.forEach((s,l)=>{if(_h(s)){i+=`${s}`;return}if(j.isValidElement(s)){const{props:u,type:h}=s,d=Object.keys(u).length,f=o.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=_h(p)?p:Jse(p,e,r,n);i+=`<${h}>${m}`;return}const g=Jse(p,e,r,n);i+=`<${l}>${g}`;return}if(s===null){ZV(r,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:n});return}if(Yv(s)){const{format:u,...h}=s,d=Object.keys(h);if(d.length===1){const f=u?`${d[0]}, ${u}`:d[0];i+=`{{${f}}}`;return}ZV(r,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:n,child:s});return}ZV(r,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:n,child:s})}),i},Ohr=(t,e,r,n,i,a,o)=>{if(r==="")return[];const s=i.transKeepBasicHtmlNodesFor||[],l=r&&new RegExp(s.map(x=>`<${x}`).join("|")).test(r);if(!t&&!e&&!l&&!o)return[r];const u=e??{},h=x=>{tx(x).forEach(A=>{_h(A)||(JV(A)?h(E6(A)):Yv(A)&&!j.isValidElement(A)&&Object.assign(u,A))})};h(t);const d=Object.keys(u),f=x=>/^\d+$/.test(x)||s.indexOf(x)>-1||d.indexOf(x)>-1,p=mhr.parse(`<0>${r}`,{allowedTags:f}),g={...u,...a},m=(x,w,A)=>{var C;const S=E6(x),T=y(S,w.children,A);return Shr(S)&&T.length===0||(C=x.props)!=null&&C.i18nIsDynamicList?S:T},v=(x,w,A,S,T)=>{x.dummy?(x.children=w,A.push(j.cloneElement(x,{key:S},T?void 0:w))):A.push(...j.Children.map([x],C=>{var E;if(C.type===j.Fragment||((E=C.props)==null?void 0:E.i18nIsDynamicList)!==void 0){const _={key:S};return C&&C.props&&Object.keys(C.props).forEach(P=>{P==="children"||P==="i18nIsDynamicList"||(_[P]=C.props[P])}),j.createElement(C.type,_,T?null:w)}const k={key:S};return C&&C.props&&Object.keys(C.props).forEach(_=>{_==="ref"||_==="children"||(k[_]=C.props[_])}),j.cloneElement(C,k,T?null:w)}))},y=(x,w,A)=>{const S=tx(x),T=tx(w),C={};return T.reduce((k,E,_)=>{var L,R;const P=((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};o&&Object.keys(M).forEach(z=>{const U=M[z];_h(U)&&(M[z]=qqe(U))});const I=Object.keys(M).length!==0?Thr({props:M},D):D,N=j.isValidElement(I),F=N&&JV(E,!0)&&!E.voidElement,B=l&&Yv(I)&&I.dummy&&!N,V=Yv(e)&&Object.hasOwnProperty.call(e,E.name);if(_h(I)){const z=n.services.interpolator.interpolate(I,g,n.language);k.push(z)}else if(JV(I)||F){const z=m(I,E,A);v(I,z,k,_)}else if(B){const z=y(S,E.children,A);v(I,z,k,_)}else if(Number.isNaN(parseFloat(E.name)))if(V){const z=m(I,E,A);v(I,z,k,_,E.voidElement)}else if(i.transSupportBasicHtmlNodes&&s.indexOf(E.name)>-1)if(E.voidElement)k.push(j.createElement(E.name,{key:`${E.name}-${_}`}));else{const z=C[E.name]||0;C[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(Yv(I)&&!N){const z=E.children[0]?P:null;z&&k.push(z)}else v(I,P,k,_,E.children.length!==1||!P)}else if(E.type==="text"){const D=i.transWrapTextNodes,M=typeof i.unescape=="function"?i.unescape:Kse().unescape,I=o?M(n.services.interpolator.interpolate(E.content,g,n.language)):n.services.interpolator.interpolate(E.content,g,n.language);D?k.push(j.createElement(D,{key:`${E.name}-${_}`},I)):k.push(I)}return k},[])},b=y([{dummy:!0,children:t||[]}],p,tx(t||[]));return E6(b[0])},Xqe=(t,e,r)=>{const n=t.key||e,i=j.cloneElement(t,{key:n});if(!i.props||!i.props.children||r.indexOf(`${e}/>`)<0&&r.indexOf(`${e} />`)<0)return i;function a(){return j.createElement(j.Fragment,null,i)}return j.createElement(a,{key:n})},khr=(t,e)=>t.map((r,n)=>Xqe(r,n,e)),Ehr=(t,e)=>{const r={};return Object.keys(t).forEach(n=>{Object.assign(r,{[n]:Xqe(t[n],n,e)})}),r},_hr=(t,e,r,n)=>t?Array.isArray(t)?khr(t,e):Yv(t)?Ehr(t,e):(gE(r,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:n}),null):null,Rhr=t=>!Yv(t)||Array.isArray(t)?!1:Object.keys(t).reduce((e,r)=>e&&Number.isNaN(Number.parseFloat(r)),!0);function Dhr({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a={},values:o,defaults:s,components:l,ns:u,i18n:h,t:d,shouldUnescape:f,...p}){var B,V,z,U,Q,G;const g=h||Zse();if(!g)return gE(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)||(q=>q),v={...Kse(),...(B=g.options)==null?void 0:B.react};let y=u||m.ns||((V=g.options)==null?void 0:V.defaultNS);y=_h(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,...o}:o,S=b!=null&&b.components?{...b.components,...l}:l,T=Jse(t,v,g,n),C=s||(x==null?void 0:x.defaultValue)||T||v.transEmptyNodeValue||(typeof n=="function"?gA(n):n),{hashTransKey:k}=v,E=n||(k?k(T||C):T||C);(U=(z=g.options)==null?void 0:z.interpolation)!=null&&U.defaultVariables?o=A&&Object.keys(A).length>0?{...A,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables}:o=A;const _=Chr(t);_&&typeof _.count=="number"&&e===void 0&&(e=_.count);const P=o||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,...o,...P,defaultValue:C,ns:y};let R=E?m(E,L):C;R===E&&C&&(R=C);const D=_hr(S,R,g,n);let M=D||t,I=null;Rhr(D)&&(I=D,M=t);const N=Ohr(M,I,R,g,v,L,w),F=r??v.defaultTransParent;return F?j.createElement(F,p,N):N}const Lhr={type:"3rdParty",init(t){whr(t.options.react),Ahr(t)}},Kqe=j.createContext();class Mhr{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function eQ({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a={},values:o,defaults:s,components:l,ns:u,i18n:h,t:d,shouldUnescape:f,...p}){var b;const{i18n:g,defaultNS:m}=j.useContext(Kqe)||{},v=h||g||Zse(),y=d||(v==null?void 0:v.t.bind(v));return Dhr({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a,values:o,defaults:s,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 Zqe={exports:{}},Jqe={};/** +安装命令:{{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:"接力失败"}},bWe={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 快捷命令"}},xWe={label:"智能构建任务",queued:"构建任务已排队",running:"构建任务正在后台运行",recovering:"正在恢复构建任务",waiting_user:"构建任务需要继续处理",stopping:"正在停止构建任务",succeeded:"构建任务已完成",cancelled:"构建任务已停止",failed:"构建任务未完成",open:"返回任务",hide:"隐藏任务通知",reconnecting:"正在重新连接任务服务,已有任务继续保留。"},Dur=Object.freeze(Object.defineProperty({__proto__:null,agentDetails:mWe,agentWorkspace:vWe,approval:dWe,commands:bWe,common:sWe,composer:fWe,default:{common:sWe,tool:lWe,threads:cWe,permissions:uWe,workspace:hWe,approval:dWe,composer:fWe,launch:pWe,session:gWe,agentDetails:mWe,agentWorkspace:vWe,handoff:yWe,commands:bWe,taskNotice:xWe},handoff:yWe,launch:pWe,permissions:uWe,session:gWe,taskNotice:xWe,threads:cWe,tool:lWe,workspace:hWe},Symbol.toStringTag,{value:"Module"})),wWe={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。保留所有权利。"},AWe={title:"登录状态已过期",description:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。",waiting:"等待登录完成…",signInAgain:"重新登录"},SWe={breadcrumbs:"面包屑",selectAgent:"选择 Agent",switchAgent:"切换智能体"},TWe={cancel:"取消",close:"关闭确认框"},Lur=Object.freeze(Object.defineProperty({__proto__:null,authExpired:AWe,confirm:TWe,default:{login:wWe,authExpired:AWe,navbar:SWe,confirm:TWe},login:wWe,navbar:SWe},Symbol.toStringTag,{value:"Module"})),CWe={defaultUser:"用户",shortcuts:"快捷入口",tryCli:"体验 AgentKit CLI",developerResources:"开发者资源",systemInfo:"系统信息",language:"语言",issueFeedback:"问题反馈",logout:"退出登录",roles:{admin:"管理员",developer:"开发者",user:"普通用户",super_admin:"超级管理员"}},OWe={home:"返回首页",expand:"展开侧边栏",collapse:"收起侧边栏",label:"主导航",newChat:"新会话",agents:"智能体",workspaces:"工作区",library:"资源库",cronjobs:"定时任务",automations:"自动化",users:"用户管理",administration:"管控",reviewCenter:"审核中心"},kWe={title:"历史会话",newConversation:"新会话",create:"新建会话",loading:"正在加载历史会话…",empty:"暂无会话",current:"当前",manage:"管理历史会话:{{title}}",more:"更多",delete:"删除",loadingMore:"加载中…",loadMore:"加载更多",evaluatingTitle:"正在自动评测",evaluating:"评测中",generating:"正在生成"},Mur=Object.freeze(Object.defineProperty({__proto__:null,account:CWe,default:{account:CWe,navigation:OWe,history:kWe},history:kWe,navigation:OWe},Symbol.toStringTag,{value:"Module"})),EWe={placeholder:"请选择",collapseOptions:"收起模型选项",expandOptions:"展开模型选项",noOptions:"暂无可用选项",noMatches:"没有匹配项,可直接使用当前模型 ID"},_We={unsupportedActivity:"不支持的 Skill 对话活动",ariaLabel:"Skill 生成对话"},RWe={code:"错误码:{{code}}",type:"错误类型:{{type}}",representation:"异常表示:{{value}}",rawResponse:`服务端原始响应: +{{value}}`,original:"原始错误:{{message}}",details:"详细信息"},DWe={ariaLabel:"Skill 文件树",viewSource:"查看源码",viewPreview:"查看预览",download:"下载",binaryFile:"二进制文件",bytes:"{{value}} 字节",binaryDescription:"当前接口仅返回文件元数据,可单独下载原文件。",metadata:"Skill 元数据",noFiles:"暂无文件"},LWe={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}} 个文件"},MWe={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:"所有方案均创建失败,可分别重试。"},IWe={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 失败"},Iur=Object.freeze(Object.defineProperty({__proto__:null,api:IWe,configSelect:EWe,conversation:_We,default:{configSelect:EWe,conversation:_We,errorDetails:RWe,fileTree:DWe,management:LWe,generation:MWe,api:IWe},errorDetails:RWe,fileTree:DWe,generation:MWe,management:LWe},Symbol.toStringTag,{value:"Module"})),PWe={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:"无"},NWe={ariaLabel:"AgentKit 快速入口",closeAriaLabel:"关闭 AgentKit 欢迎卡片",title:"欢迎使用 AgentKit",description:"通过 AgentKit 平台快速构建与托管您的企业级智能体",docsAriaLabel:"打开 AgentKit 文档,在新窗口打开",docs:"文档",consoleAriaLabel:"打开 AgentKit 控制台,在新窗口打开",console:"控制台"},BWe={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 未配置用户池"},$We={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 不匹配"}},FWe={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,不要重复填写镜像仓库路径。"}},zWe={searchPlaceholder:"搜索资源名称",emptyMessage:"暂无可用选项",searchAriaLabel:"搜索{{label}}",loadingMore:"正在加载更多资源…"},UWe={retryDeployment:"重试部署",retrying:"正在重试…",collapse:"收起错误信息",expand:"展开完整错误信息",copy:"复制完整错误信息"},VWe={steps:"构建步骤",log:"构建日志",syncing:"同步中",loadFailed:"读取失败",synced:"已同步",recentOnly:" · 仅显示最近日志",copiedLog:"已复制构建日志",copyLog:"复制构建日志",copied:"已复制",copy:"复制",logContent:"构建日志内容",waiting:"正在等待 CodePipeline 输出日志…",empty:"暂无构建日志"},QWe={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:"当前没有可选择的自定义环境。"},GWe={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:"日志"},HWe={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"},WWe={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 名称一致。"},YWe={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:"重新尝试"},qWe={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。"}},jWe={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:"当前浏览器无法自动读取剪贴板;请点击“导入环境”后手动粘贴分享码。",codeProjects:"代码项目"},XWe={back:"返回",detailNavigation:"详情导航",noData:"暂无数据",actions:"操作",moreActions:"更多操作 {{label}}",actionsFor:"{{label}} 操作",loading:"资源加载中,请稍候"},KWe={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"}},ZWe={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:"查看日志"},JWe={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:"已删除"}},eYe={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:"未知状态"},wakingHint:"正在唤醒智能体,可能需要一些时间。"},tYe={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:"未知"},sharedSpace:"企业共享空间",sharedDescription:"面向企业全员开放的技能,由管理员统一发布和维护",sharedVisibility:"全员可见",sharedPreparing:"正在准备共享空间",sharedLoadFailed:"共享空间加载失败",sharedEmpty:"暂无共享技能,管理员发布后会显示在这里",requestPublication:"申请公开",reviewSubmitting:"提交中…",reviewSubmitted:"已申请",reviewFailed:"申请公开失败",reviewStatusFailed:"审核状态加载失败",reviewRetry:"重新申请",reviewPending:"待审核",reviewApproving:"发布中",reviewApproved:"已公开",reviewReturned:"已退回",reviewHistory:"审核记录",skillDetailSections:"技能详情内容",versions:{title:"版本管理",refresh:"刷新",uploading:"上传中…",upload:"上传新版本",close:"关闭",hint:"新版本不会替换已公开版本,审核通过后才会公开;ZIP 中的技能名称需与原技能一致",loading:"正在加载版本…",loadFailed:"无法加载版本",filesFailed:"无法加载版本文件",uploadFailed:"上传新版本失败",submitFailed:"提交申请失败",retry:"重试",empty:"暂无版本",current:"当前版本",notSubmitted:"未申请公开",submitting:"提交中…",submit:"申请公开",processing:"版本状态:{{status}}",filesLoading:"正在加载文件…",filesEmpty:"暂无文件",history:"历史审核记录",shared:"已公开"},author:"作者",authorName:"作者:{{name}}"},rYe={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:"删除知识失败"}},Pur=Object.freeze(Object.defineProperty({__proto__:null,agentKitPromo:NWe,agentSelector:JWe,agentWorkspace:$We,cloudEnvironment:QWe,common:PWe,composer:ZWe,default:{common:PWe,agentKitPromo:NWe,systemInfo:BWe,agentWorkspace:$We,environmentCenter:FWe,deploymentSelect:zWe,deploymentError:UWe,studioBuildProgress:VWe,cloudEnvironment:QWe,githubCicd:GWe,feishuDeployment:HWe,deploymentResources:WWe,studioUpdate:YWe,projectPreview:qWe,workspace:jWe,resourceCollection:XWe,skillSourcePicker:KWe,composer:ZWe,agentSelector:JWe,myAgents:eYe,skillCenter:tYe,knowledge:rYe},deploymentError:UWe,deploymentResources:WWe,deploymentSelect:zWe,environmentCenter:FWe,feishuDeployment:HWe,githubCicd:GWe,knowledge:rYe,myAgents:eYe,projectPreview:qWe,resourceCollection:XWe,skillCenter:tYe,skillSourcePicker:KWe,studioBuildProgress:VWe,studioUpdate:YWe,systemInfo:BWe,workspace:jWe},Symbol.toStringTag,{value:"Module"})),nYe="用户管理",iYe="{{count}} 位成员",aYe="用户",oYe="角色",sYe="账号状态",lYe="最近登录",cYe="操作",uYe="更改角色",hYe="关闭",dYe="保存角色",fYe="正在保存…",pYe="取消",gYe="返回",mYe="用户池",vYe="火山引擎 Identity",yYe="搜索姓名、邮箱或用户 ID",bYe="搜索",xYe="筛选角色",wYe="全部角色",AYe="刷新",SYe="正在读取用户…",TYe="更新于 {{time}}",CYe="已将 {{name}} 设置为{{role}}",OYe="重试",kYe="你",EYe="初始超级管理员",_Ye="初始超级管理员受保护,不能在此降级",RYe="保存后,对方刷新 Studio 即可使用新的权限",DYe="角色需要重新确认",LYe="没有匹配的用户",MYe="尝试其他关键词或角色",IYe="用户登录或加入当前用户池后会显示在这里",PYe="共 {{count}} 位用户",NYe="上一页",BYe="下一页",$Ye="尚未登录",FYe="未提供",zYe={super_admin:"超级管理员",admin:"管理员",developer:"开发者",user:"普通用户"},UYe={super_admin:"管理所有资源,并管理用户和分配角色",admin:"管理 Studio 资源",developer:"开发智能体并管理自己的资源",user:"使用智能体和个人功能"},VYe={EXTERNAL_PROVIDER:"正常",CONFIRMED:"正常",NORMAL:"正常",ENABLED:"正常",ACTIVE:"正常",UNCONFIRMED:"待验证",DISABLED:"已停用",FORBIDDEN:"已禁用",LOCKED:"已锁定",SUSPENDED:"已暂停",FORCE_CHANGE_PASSWORD:"需要修改密码"},QYe={request_failed:"请求未完成,请刷新列表确认当前状态后重试",invalid_response:"用户服务返回异常,请刷新后重试",identity_unavailable:"暂时无法访问 Identity,请稍后重试或检查服务权限",identity_resource_missing:"用户或用户池已不存在,请刷新列表",super_administrator_required:"只有超级管理员可以管理用户",sign_in_required:"请登录后重试",user_not_in_pool:"当前账号不属于此用户池",user_disabled:"当前账号已停用",protected_administrator:"不能降低初始超级管理员的权限",cannot_demote_self:"不能降低自己的超级管理员权限",role_change_conflict:"角色已发生变化,请关闭弹窗并刷新列表后重试",cross_origin_request:"请在当前 Studio 页面内修改角色"},Nur=Object.freeze(Object.defineProperty({__proto__:null,actions:cYe,allRoles:wYe,back:gYe,cancel:pYe,changeRole:uYe,close:hYe,default:{title:nYe,memberCount:iYe,user:aYe,role:oYe,status:sYe,lastLogin:lYe,actions:cYe,changeRole:uYe,close:hYe,save:dYe,saving:fYe,cancel:pYe,back:gYe,pool:mYe,volcengineIdentity:vYe,searchPlaceholder:yYe,search:bYe,filterRole:xYe,allRoles:wYe,refresh:AYe,loading:SYe,updatedAt:TYe,saved:CYe,retry:OYe,you:kYe,initialAdministrator:EYe,protectedExplanation:_Ye,effectiveAfterRefresh:RYe,roleConflict:DYe,noUsers:LYe,tryAnotherSearch:MYe,poolEmpty:IYe,resultCount:PYe,previous:NYe,next:BYe,neverLoggedIn:$Ye,unknown:FYe,roles:zYe,descriptions:UYe,states:VYe,errors:QYe},descriptions:UYe,effectiveAfterRefresh:RYe,errors:QYe,filterRole:xYe,initialAdministrator:EYe,lastLogin:lYe,loading:SYe,memberCount:iYe,neverLoggedIn:$Ye,next:BYe,noUsers:LYe,pool:mYe,poolEmpty:IYe,previous:NYe,protectedExplanation:_Ye,refresh:AYe,resultCount:PYe,retry:OYe,role:oYe,roleConflict:DYe,roles:zYe,save:dYe,saved:CYe,saving:fYe,search:bYe,searchPlaceholder:yYe,states:VYe,status:sYe,title:nYe,tryAnotherSearch:MYe,unknown:FYe,updatedAt:TYe,user:aYe,volcengineIdentity:vYe,you:kYe},Symbol.toStringTag,{value:"Module"})),GYe="网站集成",HYe="将 AgentKit Runtime 以悬浮聊天窗口嵌入网站",WYe="返回自动化列表",YYe="添加网站",qYe="正在加载 Runtime",jYe="选择 Runtime",XYe="网站域名",KYe="例如 xxxx.com 或 localhost:5173",ZYe="正在生成",JYe="生成 Token",eqe="已添加网站",tqe="{{count}} 个",rqe="{{count}} 个",nqe="正在加载网站集成",iqe="还没有网站集成",aqe="选择 Runtime 并输入网站域名即可生成 Token",oqe="引入方法",sqe="将下面代码放到网页的 body 结束标签前",lqe="已复制",cqe="复制代码",uqe="添加网站后会在这里生成引入代码。",hqe="确定删除 {{domain}} 的网站集成吗?",dqe={load:"加载网站集成失败",create:"创建网站集成失败",delete:"删除网站集成失败",noConversationalAgent:"该 Runtime 暂未发现可对话的 Agent"},fqe={requestFailed:"请求失败 ({{status}})",greeting:"您好,有什么可以帮您?",sessionFailed:"无法建立对话会话",unauthorized:"当前网站未获得对话授权",conversationFailed:"对话请求失败,请稍后重试",open:"打开智能体对话",close:"关闭智能体对话",panelLabel:"智能体对话面板",assistant:"智能体助手",online:"在线对话"},Bur=Object.freeze(Object.defineProperty({__proto__:null,addWebsite:YYe,addedWebsites:eqe,backToAutomations:WYe,confirmDelete:hqe,copied:lqe,copyCode:cqe,default:{title:GYe,description:HYe,backToAutomations:WYe,addWebsite:YYe,loadingRuntime:qYe,selectRuntime:jYe,websiteDomain:XYe,domainPlaceholder:KYe,generating:ZYe,generateToken:JYe,addedWebsites:eqe,websiteCount_one:tqe,websiteCount_other:rqe,loadingIntegrations:nqe,delete:"删除",emptyTitle:iqe,emptyDescription:aqe,embedMethod:oqe,embedInstructions:sqe,copied:lqe,copyCode:cqe,embedHint:uqe,confirmDelete:hqe,errors:dqe,widget:fqe},description:HYe,domainPlaceholder:KYe,embedHint:uqe,embedInstructions:sqe,embedMethod:oqe,emptyDescription:aqe,emptyTitle:iqe,errors:dqe,generateToken:JYe,generating:ZYe,loadingIntegrations:nqe,loadingRuntime:qYe,selectRuntime:jYe,title:GYe,websiteCount_one:tqe,websiteCount_other:rqe,websiteDomain:XYe,widget:fqe},Symbol.toStringTag,{value:"Module"})),pqe={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:"下载产物失败"}},gqe={unknownSource:"未知来源",unknownCreator:"未知创建者"},mqe={nameRequired:"请输入产物名称",tooManyTags:"标签最多 {{max}} 个",tagTooLong:"单个标签不能超过 {{max}} 个字符",title:"编辑产物信息",subtitle:"内容文件不会被修改",close:"关闭编辑框",name:"名称",description:"描述",descriptionPlaceholder:"补充用途、版本或使用说明",tags:"标签",tagsPlaceholder:"使用逗号分隔,最多 {{max}} 个",cancel:"取消",saving:"保存中",save:"保存"},vqe={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:"查看和编辑项目源码"},yqe={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}}"},bqe={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}}界面预览"}},xqe={title:"资源库",untitledSession:"未命名会话",categoryAria:"资源库分类",regionAria:"区域",tabs:{skills:"技能库",knowledge:"知识库",artifacts:"产物"}},wqe={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:"(未命名)"},Aqe={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 信息。"},Sqe={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 环境。"},Tqe={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 终端"},Cqe={labels:{coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取",studio_write_artifact:"保存会话产物"},closeDialog:"关闭弹窗",title:"添加 Studio 工具",description:"由 Studio BFF 为 {{agentName}} 的当前会话执行,Runtime 无需预装",close:"关闭添加 Studio 工具",searchAria:"搜索 Studio 工具",searchPlaceholder:"搜索名称或工具标识",availableAria:"可用 Studio 工具",loading:"正在读取 Studio 工具…",noMatch:"没有匹配的 Studio 工具",remove:"移除",add:"添加"},Oqe={artifactLibrary:pqe,resourceMetadata:gqe,artifactEdit:mqe,codeBrowser:vqe,search:yqe,developerResources:bqe,library:xqe,manageAgents:wqe,agentTopology:Aqe,sessionEnvironment:Sqe,agentKitCli:Tqe,studioTools:Cqe},$ur=Object.freeze(Object.defineProperty({__proto__:null,agentKitCli:Tqe,agentTopology:Aqe,artifactEdit:mqe,artifactLibrary:pqe,codeBrowser:vqe,default:Oqe,developerResources:bqe,library:xqe,manageAgents:wqe,resourceMetadata:gqe,search:yqe,sessionEnvironment:Sqe,studioTools:Cqe},Symbol.toStringTag,{value:"Module"})),kqe=["zh-CN","en-US"],Qse="en-US",Fur="agentkit.studio.locale",zur={"zh-CN":{dir:"ltr",nativeName:"简体中文"},"en-US":{dir:"ltr",nativeName:"English"}};function Gse(t){if(!t)return null;const e=t.trim().replace(/_/g,"-").toLowerCase(),r=kqe.find(n=>n.toLowerCase()===e);return r||(e==="zh"||e.startsWith("zh-")?"zh-CN":e==="en"||e.startsWith("en-")?"en-US":null)}function Uur(){if(typeof window>"u")return null;try{return Gse(window.localStorage.getItem(Fur))}catch{return null}}function Vur(){if(typeof window>"u")return[];const t=window.navigator;return t?t.languages.length>0?t.languages:t.language?[t.language]:[]:[]}function Qur(){const t=Uur();if(t)return t;for(const e of Vur()){const r=Gse(e);if(r)return r}return Qse}function Eqe(t){typeof document>"u"||(document.documentElement.lang=t,document.documentElement.dir=zur[t].dir)}const vn=t=>typeof t=="string",S6=()=>{let t,e;const r=new Promise((n,i)=>{t=n,e=i});return r.resolve=t,r.reject=e,r},Hse=t=>t==null?"":String(t),Gur=(t,e,r)=>{t.forEach(n=>{e[n]&&(r[n]=e[n])})},Hur=/###/g,_qe=t=>t&&t.includes("###")?t.replace(Hur,"."):t,Rqe=t=>!t||vn(t),T6=(t,e,r)=>{const n=vn(e)?e.split("."):e;let i=0;for(;i{const{obj:n,k:i}=T6(t,e,Object);if(n!==void 0||e.length===1){n[i]=r;return}let a=e[e.length-1],o=e.slice(0,e.length-1),s=T6(t,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=T6(t,o,Object),s!=null&&s.obj&&typeof s.obj[`${s.k}.${a}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=r},Wur=(t,e,r,n)=>{const{obj:i,k:a}=T6(t,e,Object);i[a]=i[a]||[],i[a].push(r)},WV=(t,e)=>{const{obj:r,k:n}=T6(t,e);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},Yur=(t,e,r)=>{const n=WV(t,r);return n!==void 0?n:WV(e,r)},Lqe=(t,e,r)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(Object.prototype.hasOwnProperty.call(t,n)?vn(t[n])||t[n]instanceof String||vn(e[n])||e[n]instanceof String?r&&(t[n]=e[n]):Lqe(t[n],e[n],r):t[n]=e[n]);return t},Wv=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),qur={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},jur=t=>vn(t)?t.replace(/[&<>"'\/]/g,e=>qur[e]):t;class Xur{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 Kur=[" ",",","?","!",";"],Zur=new Xur(20),Jur=(t,e,r)=>{e=e||"",r=r||"";const n=Kur.filter(o=>!e.includes(o)&&!r.includes(o));if(n.length===0)return!0;const i=Zur.getRegExp(`(${n.map(o=>o==="?"?"\\?":o).join("|")})`);let a=!i.test(t);if(!a){const o=t.indexOf(r);o>0&&!i.test(t.substring(0,o))&&(a=!0)}return a},Wse=(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,"-"),ehr={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 YV{constructor(e,r={}){this.init(e,r)}init(e,r={}){this.prefix=r.prefix||"i18next:",this.logger=e||ehr,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=>vn(a)?a.replace(/[\r\n\x00-\x1F\x7F]/g," "):a),vn(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[r](e))}create(e){return new YV(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new YV(this.logger,e)}}var pm=new YV;class qV{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 o=0;o{for(let o=0;o-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,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.includes(".")?s=e.split("."):(s=[e,r],n&&(Array.isArray(n)?s.push(...n):vn(n)&&a?s.push(...n.split(a)):s.push(n)));const l=WV(this.data,s);return!l&&!r&&!n&&e.includes(".")&&(e=s[0],r=s[1],n=s.slice(2).join(".")),l||!o||!vn(n)?l:Wse((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 o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let s=[e,r];n&&(s=s.concat(o?n.split(o):n)),e.includes(".")&&(s=e.split("."),i=r,r=s[1]),this.addNamespaces(r),Dqe(this.data,s,i),a.silent||this.emit("added",e,r,n,i)}addResources(e,r,n,i={silent:!1}){for(const a in n)(vn(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,o={silent:!1,skipCopy:!1}){let s=[e,r];e.includes(".")&&(s=e.split("."),i=n,n=r,r=s[1]),this.addNamespaces(r);let l=WV(this.data,s)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?Lqe(l,n,a):l={...l,...n},Dqe(this.data,s,l),o.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 Iqe={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,r,n,i){return t.forEach(a=>{var o;e=((o=this.processors[a])==null?void 0:o.process(e,r,n,i))??e}),e}};const Pqe=Symbol("i18next/PATH_KEY");function thr(){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===Pqe?t:(t.push(i),r=Proxy.revocable(n,e),r.proxy)},Proxy.revocable(Object.create(null),e).proxy}function gA(t,e){const{[Pqe]:r}=t(thr()),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 o=e==null?void 0:e.ns,s=a?Array.isArray(o)?o:o?[o]:null:Array.isArray(o)?o:null;if(s&&(a?s:s.length>1?s.slice(1):[]).includes(r[0]))return`${r[0]}${i}${r.slice(1).join(n)}`}return r.join(n)}const Yse=t=>!vn(t)&&typeof t!="boolean"&&typeof t!="number";class jV extends qV{constructor(e,r={}){super(),Gur(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=pm.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=Yse(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 o=n&&e.includes(n),s=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!Jur(e,n,i);if(o&&!s){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:vn(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:vn(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=gA(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]),e=e.map(L=>typeof L=="function"?gA(L,{...this.options,...i}):String(L));const a=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:s,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}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:`${u}${h}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:s;const p=this.resolve(e,i);let g=p==null?void 0:p.res;const m=(p==null?void 0:p.usedKey)||s,v=(p==null?void 0:p.exactUsedKey)||s,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&&!vn(i.count),A=jV.hasDefaultValue(i),S=w?this.pluralResolver.getSuffix(d,i.count,i):"",T=i.ordinal&&w?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):"",C=w&&!i.ordinal&&i.count===0,k=C&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${T}`]||i.defaultValue;let E=g;x&&!g&&A&&(E=k);const _=Yse(E),P=Object.prototype.toString.apply(E);if(x&&E&&_&&!y.includes(P)&&!(vn(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 '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=L,p.usedParams=this.getUsedParamsDetails(i),p):L}if(o){const L=Array.isArray(E),R=L?[]:{},D=L?v:m;for(const M in E)if(Object.prototype.hasOwnProperty.call(E,M)){const I=`${D}${o}${M}`;A&&!g?R[M]=this.translate(I,{...i,defaultValue:Yse(k)?k[M]:void 0,joinArrays:!1,ns:l}):R[M]=this.translate(I,{...i,joinArrays:!1,ns:l}),R[M]===I&&(R[M]=E[M])}g=R}}else if(x&&vn(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=s);const M=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&R?void 0:g,I=A&&k!==g&&this.options.updateMissing;if(R||L||I){if(this.logger.log(I?"updateKey":"missingKey",d,u,w&&!I?`${s}${this.pluralResolver.getSuffix(d,i.count,i)}`:s,I?k:g),o){const V=this.resolve(s,{...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,I,i):(G=this.backendConnector)!=null&&G.saveMissing&&this.backendConnector.saveMissing(V,u,z,Q,I,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);C&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!z.includes(`${this.options.pluralSeparator}zero`)&&z.push(`${this.options.pluralSeparator}zero`),z.forEach(U=>{B([V],s+U,i[`defaultValue${U}`]||k)})}):B(N,s,k))}g=this.extendTranslation(g,e,i,p,n),R&&g===s&&this.options.appendNamespaceToMissingKey&&(g=`${u}${h}${s}`),(R||L)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${h}${s}`:s,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=vn(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&&!vn(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 o=n.postProcess||this.options.postProcess,s=vn(o)?[o]:o;return e!=null&&(s!=null&&s.length)&&n.applyPostProcessor!==!1&&(e=Iqe.handle(s,e,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,r={}){let n,i,a,o,s;return vn(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(l=>typeof l=="function"?gA(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&&!vn(r.count),p=f&&!r.ordinal&&r.count===0,g=r.context!==void 0&&(vn(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)||(s=v,!this.checkedLoadedFor[`${m[0]}-${v}`]&&((y=this.utils)!=null&&y.hasLoadedNamespace)&&!((b=this.utils)!=null&&b.hasLoadedNamespace(s))&&(this.checkedLoadedFor[`${m[0]}-${v}`]=!0,this.logger.warn(`key "${i}" for languages "${m.join(", ")}" won't get resolved as namespace "${s}" 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;o=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 C=`${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+C)),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+C))}}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:o,usedNS:s}}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&&!vn(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 Nqe{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=pm.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(e=C6(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=C6(e),!e||!e.includes("-"))return e;const r=e.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(e){if(vn(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(o=>o===a?!0:!o.includes("-")&&!a.includes("-")?!1:!!(o.includes("-")&&!a.includes("-")&&o.slice(0,o.indexOf("-"))===a||o.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)),vn(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||vn(r),o=r===void 0&&typeof this.options.fallbackLng=="function",s=vn(e)&&a&&!o;let l=null;if(s){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 vn(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))):vn(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 Bqe={zero:0,one:1,two:2,few:3,many:4,other:5},$qe={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class rhr{constructor(e,r={}){this.languageUtils=e,this.options=r,this.logger=pm.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,r={}){const n=C6(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 o;try{o=new Intl.PluralRules(n,{type:i})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),$qe;if(!e.match(/-|_/))return $qe;const l=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(l,r)}return this.pluralRulesCache[a]=o,o}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)=>Bqe[i]-Bqe[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 Fqe=(t,e,r,n=".",i=!0)=>{let a=Yur(t,e,r);return!a&&i&&vn(r)&&(a=Wse(t,r,n),a===void 0&&(a=Wse(e,r,n))),a},zqe=t=>t.replace(/\$/g,"$$$$");class Uqe{constructor(e={}){var r;this.logger=pm.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:o,suffix:s,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:jur,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=a?Wv(a):o||"{{",this.suffix=s?Wv(s):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=h?"":d?Wv(d):"-",this.unescapeSuffix=this.unescapePrefix?"":h?Wv(h):"",this.nestingPrefix=f?Wv(f):p||Wv("$t("),this.nestingSuffix=g?Wv(g):m||Wv(")"),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,o,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const b=Fqe(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(Fqe(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(s=0;a=g.regex.exec(e);){const m=a[1].trim();if(o=u(m),o===void 0)if(typeof h=="function"){const y=h(e,a,i);o=vn(y)?y:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))o="";else if(d){o=a[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`),o="";else!vn(o)&&!this.useRawValueToEscape&&(o=Hse(o));const v=g.safeValue(o);if(e=e.replace(a[0],zqe(v)),d?(g.regex.lastIndex+=v.length,g.regex.lastIndex-=a[0].length):g.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),e}nest(e,r,n={}){let i,a,o;const s=(l,u)=>{const h=this.nestingOptionsSeparator;if(!l.includes(h))return l;const d=l.split(new RegExp(`${Wv(h)}[ ]*{`));let f=`{${d[1]}`;l=d[0],f=this.interpolate(f,o);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{o=JSON.parse(f),u&&(o={...u,...o})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,m),`${l}${h}${f}`}return o.defaultValue&&o.defaultValue.includes(this.prefix)&&delete o.defaultValue,l};for(;i=this.nestingRegexp.exec(e);){let l=[];o={...n},o=o.replace&&!vn(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.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(s.call(this,i[1].trim(),o),o),a&&i[0]===e&&!vn(a))return a;vn(a)||(a=Hse(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],zqe(Hse(a))),this.regexp.lastIndex=0}return e}}const nhr=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(o=>{if(o){const[s,...l]=o.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),h=s.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}},Vqe=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 o=n+JSON.stringify(a);let s=e[o];return s||(s=t(C6(n),i),e[o]=s),s(r)}},ihr=t=>(e,r,n)=>t(C6(r),n)(e);class ahr{constructor(e={}){this.logger=pm.create("formatter"),this.options=e,this.init(e)}init(e,r={interpolation:{}}){this.formatSeparator=r.interpolation.formatSeparator||",";const n=r.cacheInBuiltFormats?Vqe:ihr;this.formats={number:n((i,a)=>{const o=new Intl.NumberFormat(i,{...a});return s=>o.format(s)}),currency:n((i,a)=>{const o=new Intl.NumberFormat(i,{...a,style:"currency"});return s=>o.format(s)}),datetime:n((i,a)=>{const o=new Intl.DateTimeFormat(i,{...a});return s=>o.format(s)}),relativetime:n((i,a)=>{const o=new Intl.RelativeTimeFormat(i,{...a});return s=>o.format(s,a.range||"day")}),list:n((i,a)=>{const o=new Intl.ListFormat(i,{...a});return s=>o.format(s)})}}add(e,r){this.formats[e.toLowerCase().trim()]=r}addCached(e,r){this.formats[e.toLowerCase().trim()]=Vqe(r)}format(e,r,n,i={}){if(!r||e==null)return e;const a=r.split(this.formatSeparator),o=[];for(let l=0;l-1&&!u.includes(")")&&l+1{var f;const{formatName:h,formatOptions:d}=nhr(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 ohr=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class shr extends qV{constructor(e,r,n,i={}){var a,o;super(),this.backend=e,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=pm.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=[],(o=(a=this.backend)==null?void 0:a.init)==null||o.call(a,n,i.backend,i)}queueLoad(e,r,n,i){const a={},o={},s={},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?o[f]===void 0&&(o[f]=!0):(this.state[f]=1,h=!1,o[f]===void 0&&(o[f]=!0),a[f]===void 0&&(a[f]=!0),l[d]===void 0&&(l[d]=!0)))}),h||(s[u]=!0)}),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(e,r,n){const i=e.split("|"),a=i[0],o=i[1];r&&this.emit("failedLoading",a,o,r),!r&&n&&this.store.addResourceBundle(a,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=r?-1:2,r&&n&&(this.state[e]=0);const s={};this.queue.forEach(l=>{Wur(l.loaded,[a],o),ohr(l,e),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{s[u]||(s[u]={});const h=l.loaded[u];h.length&&h.forEach(d=>{s[u][d]===void 0&&(s[u][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(e,r,n,i=0,a=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:r,fcName:n,tried:i,wait:a,callback:o});return}this.readingCalls++;const s=(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,o)},a);return}o(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=>s(null,h)).catch(s):s(null,u)}catch(u){s(u)}return}return l(e,r,s)}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();vn(e)&&(e=this.languageUtils.toResolveHierarchy(e)),vn(r)&&(r=[r]);const a=this.queueLoad(e,r,n,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach(o=>{this.loadOne(o)})}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,(o,s)=>{o&&this.logger.warn(`${r}loading namespace ${a} for language ${i} failed`,o),!o&&s&&this.logger.log(`${r}loaded namespace ${a} for language ${i}`,s),this.loaded(e,o,s)})}saveMissing(e,r,n,i,a,o={},s=()=>{}){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={...o,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=>s(null,v)).catch(s):s(null,m)}catch(m){s(m)}else g(e,r,n,i,s,p)}!e||!e[0]||this.store.addResource(e[0],r,n,i)}}}const qse=()=>({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]),vn(t[1])&&(e.defaultValue=t[1]),vn(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}),Qqe=t=>(vn(t.ns)&&(t.ns=[t.ns]),vn(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),vn(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&!t.supportedLngs.includes("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),XV=()=>{},lhr=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(r=>{typeof t[r]=="function"&&(t[r]=t[r].bind(t))})};class O6 extends qV{constructor(e={},r){if(super(),this.options=Qqe(e),this.services={},this.logger=pm,this.modules={external:[]},lhr(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&&(vn(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const n=qse();this.options={...n,...this.options,...Qqe(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?pm.init(i(this.modules.logger),this.options):pm.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=ahr;const h=new Nqe(this.options);this.store=new Mqe(this.options.resources,this.options);const d=this.services;d.logger=pm,d.resourceStore=this.store,d.languageUtils=h,d.pluralResolver=new rhr(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 Uqe(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new shr(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 jV(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=XV),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 s=S6(),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),s.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),s}loadResources(e,r=XV){var a,o;let n=r;const i=vn(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 s=[],l=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(d=>{d!=="cimode"&&(s.includes(d)||s.push(d))})};i?l(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(h=>l(h)),(o=(a=this.options.preload)==null?void 0:a.forEach)==null||o.call(a,u=>l(u)),this.services.backendConnector.load(s,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(u)})}else n(null)}reloadResources(e,r,n){const i=S6();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=XV),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"&&Iqe.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=s,this.languages=this.services.languageUtils.toResolveHierarchy(s),this.resolvedLanguage=void 0,this.setResolvedLanguage(s)},a=(s,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(s,(...u)=>this.t(...u))},o=s=>{var h,d;!e&&!s&&this.services.languageDetector&&(s=[]);const l=vn(s)?s:s&&s[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(vn(s)?[s]:s);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?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),n}getFixedT(e,r,n,i){const a=i==null?void 0:i.scopeNs,o=(s,l,...u)=>{let h;typeof l!="object"?h=this.options.overloadTranslationOptionHandler([s,l].concat(u)):h={...l},h.lng=h.lng||o.lng,h.lngs=h.lngs||o.lngs;const d=h.ns!==void 0&&h.ns!==null;h.ns=h.ns||o.ns,h.keyPrefix!==""&&(h.keyPrefix=h.keyPrefix||n||o.keyPrefix);const f={...this.options,...h};Array.isArray(a)&&!d&&(f.ns=a),typeof h.keyPrefix=="function"&&(h.keyPrefix=gA(h.keyPrefix,f));const p=this.options.keySeparator||".";let g;return h.keyPrefix&&Array.isArray(s)?g=s.map(m=>(typeof m=="function"&&(m=gA(m,f)),`${h.keyPrefix}${p}${m}`)):(typeof s=="function"&&(s=gA(s,f)),g=h.keyPrefix?`${h.keyPrefix}${p}${s}`:s),this.t(g,h)};return vn(e)?o.lng=e:o.lngs=e,o.ns=r,o.keyPrefix=n,o}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 o=(s,l)=>{const u=this.services.backendConnector.state[`${s}|${l}`];return u===-1||u===0||u===2};if(r.precheck){const s=r.precheck(this,o);if(s!==void 0)return s}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(n,e)&&(!i||o(a,e)))}loadNamespaces(e,r){const n=S6();return this.options.ns?(vn(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=S6();vn(e)&&(e=[e]);const i=this.options.preload||[],a=e.filter(o=>!i.includes(o)&&this.services.languageUtils.isSupportedCode(o));return a.length?(this.options.preload=i.concat(a),this.loadResources(o=>{n.resolve(),r&&r(o)}),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 o=new Intl.Locale(e);if(o&&o.getTextInfo){const s=o.getTextInfo();if(s&&s.direction)return s.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 Nqe(qse());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 O6(e,r);return n.createInstance=O6.createInstance,n}cloneInstance(e={},r=XV){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},a=new O6(i);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(s=>{a[s]=this[s]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const s=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 Mqe(s,i),a.services.resourceStore=a.store}if(e.interpolation){const l={...qse().interpolation,...this.options.interpolation,...e.interpolation},u={...i,interpolation:l};a.services.interpolator=new Uqe(u)}return a.translator=new jV(a.services,i),a.translator.on("*",(s,...l)=>{a.emit(s,...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 Au=O6.createInstance();Au.createInstance,Au.dir,Au.init,Au.loadResources,Au.reloadResources,Au.use,Au.changeLanguage,Au.getFixedT,Au.t,Au.exists,Au.setDefaultNamespace,Au.hasLoadedNamespace,Au.loadNamespaces,Au.loadLanguages;const chr={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},uhr=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g;function Gqe(t){const e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},r=t.match(/<\/?([^\s]+?)[/\s>]/);if(r&&(e.name=r[1],(chr[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(uhr);let i=null;for(;i=n.exec(t),i!==null;)if(i[0].trim())if(i[1]){const a=i[1].trim();let o=[a,null];const s=a.indexOf("=");s>-1&&(o=[a.slice(0,s),a.slice(s+1)]),e.attrs[o[0]]=o[1],n.lastIndex--}else i[2]&&(e.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return e}const KV=/|<[a-zA-Z0-9\-!/](?:"[^"]*"|'[^']*'|[^'">])*>/g,hhr=/<\/?([^\s]+?)[/\s>]/,dhr=/^\s*$/,fhr=/^(script|style)$/i,k6="\0",phr=Object.create(null);function Hqe(t){t.forEach(function(e){if(e.type==="text"){e.content=e.content.split(k6).join("<");return}if(e.type==="comment"){e.comment=e.comment.split(k6).join("<");return}for(const r in e.attrs){const n=e.attrs[r];typeof n=="string"&&n.indexOf(k6)>-1&&(e.attrs[r]=n.split(k6).join("<"))}e.children.length&&Hqe(e.children)})}function ghr(t,e){const r=e&&e.components||phr,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;KV.lastIndex=0;let y;for(;y=KV.exec(t);){const b=y[0];m+=t.slice(v,y.index);const x=b.match(hhr);b.startsWith("",t}}function vhr(t){return t.reduce(function(e,r){return e+Wqe("",r)},"")}var yhr={parse:ghr,stringify:vhr};const ZV=(t,e,r,n)=>{var a,o,s,l;const i=[r,{code:e,...n||{}}];if((o=(a=t==null?void 0:t.services)==null?void 0:a.logger)!=null&&o.forward)return t.services.logger.forward(i,"warn","react-i18next::",!0);_h(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),(l=(s=t==null?void 0:t.services)==null?void 0:s.logger)!=null&&l.warn?t.services.logger.warn(...i):console!=null&&console.warn&&console.warn(...i)},Yqe={},gE=(t,e,r,n)=>{_h(r)&&Yqe[r]||(_h(r)&&(Yqe[r]=new Date),ZV(t,e,r,n))},qqe=(t,e)=>()=>{if(t.isInitialized)e();else{const r=()=>{setTimeout(()=>{t.off("initialized",r)},0),e()};t.on("initialized",r)}},jse=(t,e,r)=>{t.loadNamespaces(e,qqe(t,r))},jqe=(t,e,r,n)=>{if(_h(r)&&(r=[r]),t.options.preload&&t.options.preload.indexOf(e)>-1)return jse(t,r,n);r.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,qqe(t,n))},bhr=(t,e,r={})=>!e.languages||!e.languages.length?(gE(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}}),_h=t=>typeof t=="string",Yv=t=>typeof t=="object"&&t!==null,xhr=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,whr={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Ahr=t=>whr[t],Xqe=t=>t.replace(xhr,Ahr);let Xse={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Xqe,transDefaultProps:void 0};const Shr=(t={})=>{Xse={...Xse,...t}},Kse=()=>Xse;let Kqe;const Thr=t=>{Kqe=t},Zse=()=>Kqe,JV=(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},E6=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?tx(e):e},Chr=t=>Array.isArray(t)&&t.every(j.isValidElement),tx=t=>Array.isArray(t)?t:[t],Ohr=(t,e)=>{const r={...e};return r.props={...e.props,...t.props},r},khr=t=>{const e={};if(!t)return e;const r=n=>{tx(n).forEach(a=>{_h(a)||(JV(a)?r(E6(a)):Yv(a)&&!j.isValidElement(a)&&Object.assign(e,a))})};return r(t),e},Jse=(t,e,r,n)=>{if(!t)return"";let i="";const a=tx(t),o=e!=null&&e.transSupportBasicHtmlNodes?e.transKeepBasicHtmlNodesFor??[]:[];return a.forEach((s,l)=>{if(_h(s)){i+=`${s}`;return}if(j.isValidElement(s)){const{props:u,type:h}=s,d=Object.keys(u).length,f=o.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=_h(p)?p:Jse(p,e,r,n);i+=`<${h}>${m}`;return}const g=Jse(p,e,r,n);i+=`<${l}>${g}`;return}if(s===null){ZV(r,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:n});return}if(Yv(s)){const{format:u,...h}=s,d=Object.keys(h);if(d.length===1){const f=u?`${d[0]}, ${u}`:d[0];i+=`{{${f}}}`;return}ZV(r,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:n,child:s});return}ZV(r,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:n,child:s})}),i},Ehr=(t,e,r,n,i,a,o)=>{if(r==="")return[];const s=i.transKeepBasicHtmlNodesFor||[],l=r&&new RegExp(s.map(x=>`<${x}`).join("|")).test(r);if(!t&&!e&&!l&&!o)return[r];const u=e??{},h=x=>{tx(x).forEach(A=>{_h(A)||(JV(A)?h(E6(A)):Yv(A)&&!j.isValidElement(A)&&Object.assign(u,A))})};h(t);const d=Object.keys(u),f=x=>/^\d+$/.test(x)||s.indexOf(x)>-1||d.indexOf(x)>-1,p=yhr.parse(`<0>${r}`,{allowedTags:f}),g={...u,...a},m=(x,w,A)=>{var C;const S=E6(x),T=y(S,w.children,A);return Chr(S)&&T.length===0||(C=x.props)!=null&&C.i18nIsDynamicList?S:T},v=(x,w,A,S,T)=>{x.dummy?(x.children=w,A.push(j.cloneElement(x,{key:S},T?void 0:w))):A.push(...j.Children.map([x],C=>{var E;if(C.type===j.Fragment||((E=C.props)==null?void 0:E.i18nIsDynamicList)!==void 0){const _={key:S};return C&&C.props&&Object.keys(C.props).forEach(P=>{P==="children"||P==="i18nIsDynamicList"||(_[P]=C.props[P])}),j.createElement(C.type,_,T?null:w)}const k={key:S};return C&&C.props&&Object.keys(C.props).forEach(_=>{_==="ref"||_==="children"||(k[_]=C.props[_])}),j.cloneElement(C,k,T?null:w)}))},y=(x,w,A)=>{const S=tx(x),T=tx(w),C={};return T.reduce((k,E,_)=>{var L,R;const P=((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};o&&Object.keys(M).forEach(z=>{const U=M[z];_h(U)&&(M[z]=Xqe(U))});const I=Object.keys(M).length!==0?Ohr({props:M},D):D,N=j.isValidElement(I),F=N&&JV(E,!0)&&!E.voidElement,B=l&&Yv(I)&&I.dummy&&!N,V=Yv(e)&&Object.hasOwnProperty.call(e,E.name);if(_h(I)){const z=n.services.interpolator.interpolate(I,g,n.language);k.push(z)}else if(JV(I)||F){const z=m(I,E,A);v(I,z,k,_)}else if(B){const z=y(S,E.children,A);v(I,z,k,_)}else if(Number.isNaN(parseFloat(E.name)))if(V){const z=m(I,E,A);v(I,z,k,_,E.voidElement)}else if(i.transSupportBasicHtmlNodes&&s.indexOf(E.name)>-1)if(E.voidElement)k.push(j.createElement(E.name,{key:`${E.name}-${_}`}));else{const z=C[E.name]||0;C[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(Yv(I)&&!N){const z=E.children[0]?P:null;z&&k.push(z)}else v(I,P,k,_,E.children.length!==1||!P)}else if(E.type==="text"){const D=i.transWrapTextNodes,M=typeof i.unescape=="function"?i.unescape:Kse().unescape,I=o?M(n.services.interpolator.interpolate(E.content,g,n.language)):n.services.interpolator.interpolate(E.content,g,n.language);D?k.push(j.createElement(D,{key:`${E.name}-${_}`},I)):k.push(I)}return k},[])},b=y([{dummy:!0,children:t||[]}],p,tx(t||[]));return E6(b[0])},Zqe=(t,e,r)=>{const n=t.key||e,i=j.cloneElement(t,{key:n});if(!i.props||!i.props.children||r.indexOf(`${e}/>`)<0&&r.indexOf(`${e} />`)<0)return i;function a(){return j.createElement(j.Fragment,null,i)}return j.createElement(a,{key:n})},_hr=(t,e)=>t.map((r,n)=>Zqe(r,n,e)),Rhr=(t,e)=>{const r={};return Object.keys(t).forEach(n=>{Object.assign(r,{[n]:Zqe(t[n],n,e)})}),r},Dhr=(t,e,r,n)=>t?Array.isArray(t)?_hr(t,e):Yv(t)?Rhr(t,e):(gE(r,"TRANS_INVALID_COMPONENTS",' "components" prop expects an object or array',{i18nKey:n}),null):null,Lhr=t=>!Yv(t)||Array.isArray(t)?!1:Object.keys(t).reduce((e,r)=>e&&Number.isNaN(Number.parseFloat(r)),!0);function Mhr({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a={},values:o,defaults:s,components:l,ns:u,i18n:h,t:d,shouldUnescape:f,...p}){var B,V,z,U,Q,G;const g=h||Zse();if(!g)return gE(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)||(q=>q),v={...Kse(),...(B=g.options)==null?void 0:B.react};let y=u||m.ns||((V=g.options)==null?void 0:V.defaultNS);y=_h(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,...o}:o,S=b!=null&&b.components?{...b.components,...l}:l,T=Jse(t,v,g,n),C=s||(x==null?void 0:x.defaultValue)||T||v.transEmptyNodeValue||(typeof n=="function"?gA(n):n),{hashTransKey:k}=v,E=n||(k?k(T||C):T||C);(U=(z=g.options)==null?void 0:z.interpolation)!=null&&U.defaultVariables?o=A&&Object.keys(A).length>0?{...A,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables}:o=A;const _=khr(t);_&&typeof _.count=="number"&&e===void 0&&(e=_.count);const P=o||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,...o,...P,defaultValue:C,ns:y};let R=E?m(E,L):C;R===E&&C&&(R=C);const D=Dhr(S,R,g,n);let M=D||t,I=null;Lhr(D)&&(I=D,M=t);const N=Ehr(M,I,R,g,v,L,w),F=r??v.defaultTransParent;return F?j.createElement(F,p,N):N}const Ihr={type:"3rdParty",init(t){Shr(t.options.react),Thr(t)}},Jqe=j.createContext();class Phr{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function eQ({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a={},values:o,defaults:s,components:l,ns:u,i18n:h,t:d,shouldUnescape:f,...p}){var b;const{i18n:g,defaultNS:m}=j.useContext(Jqe)||{},v=h||g||Zse(),y=d||(v==null?void 0:v.t.bind(v));return Mhr({children:t,count:e,parent:r,i18nKey:n,context:i,tOptions:a,values:o,defaults:s,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 eje={exports:{}},tje={};/** * @license React * use-sync-external-store-shim.production.js * @@ -98,7 +98,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 mE=j;function Ihr(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Phr=typeof Object.is=="function"?Object.is:Ihr,Nhr=mE.useState,Bhr=mE.useEffect,$hr=mE.useLayoutEffect,Fhr=mE.useDebugValue;function zhr(t,e){var r=e(),n=Nhr({inst:{value:r,getSnapshot:e}}),i=n[0].inst,a=n[1];return $hr(function(){i.value=r,i.getSnapshot=e,ele(i)&&a({inst:i})},[t,r,e]),Bhr(function(){return ele(i)&&a({inst:i}),t(function(){ele(i)&&a({inst:i})})},[t]),Fhr(r),r}function ele(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!Phr(t,r)}catch{return!0}}function Uhr(t,e){return e()}var Vhr=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Uhr:zhr;Jqe.useSyncExternalStore=mE.useSyncExternalStore!==void 0?mE.useSyncExternalStore:Vhr,Zqe.exports=Jqe;var tQ=Zqe.exports;const Qhr={t:(t,e)=>{if(_h(e))return e;if(Yv(e)&&_h(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},Ghr=()=>()=>{},ca=(t,e={})=>{var k,E,_;const{i18n:r}=e,{i18n:n,defaultNS:i}=j.useContext(Kqe)||{},a=r||n||Zse();a&&!a.reportNamespaces&&(a.reportNamespaces=new Mhr),a||gE(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 o=j.useMemo(()=>{var P;return{...Kse(),...(P=a==null?void 0:a.options)==null?void 0:P.react,...e}},[a,e]),{useSuspense:s,keyPrefix:l}=o,u=t||i||((k=a==null?void 0:a.options)==null?void 0:k.defaultNS),h=_h(u)?[u]:u||["translation"],d=j.useMemo(()=>h,h);(_=(E=a==null?void 0:a.reportNamespaces)==null?void 0:E.addUsedNamespaces)==null||_.call(E,d);const f=j.useRef(0),p=j.useCallback(P=>{if(!a)return Ghr;const{bindI18n:L,bindI18nStore:R}=o,D=()=>{f.current+=1,P()};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,o]),g=j.useRef(),m=j.useCallback(()=>{if(!a)return Qhr;const P=!!(a.isInitialized||a.initializedStoreOnce)&&d.every(N=>vhr(N,a,o)),L=e.lng||a.language,R=f.current,D=g.current;if(D&&D.ready===P&&D.lng===L&&D.keyPrefix===l&&D.revision===R)return D;const I={t:a.getFixedT(L,o.nsMode==="fallback"?d:d[0],l,{scopeNs:d}),ready:P,lng:L,keyPrefix:l,revision:R};return g.current=I,I},[a,d,l,o,e.lng]),[v,y]=j.useState(0),{t:b,ready:x}=tQ.useSyncExternalStore(p,m,m);j.useEffect(()=>{if(a&&!x&&!s){const P=()=>y(L=>L+1);e.lng?Yqe(a,e.lng,d,P):jse(a,d,P)}},[a,e.lng,d,x,s,v]);const w=a||{},A=j.useRef(null),S=j.useRef(),T=P=>{const L=Object.getOwnPropertyDescriptors(P);L.__original&&delete L.__original;const R=Object.create(Object.getPrototypeOf(P),L);if(!Object.prototype.hasOwnProperty.call(R,"__original"))try{Object.defineProperty(R,"__original",{value:P,writable:!1,enumerable:!1,configurable:!1})}catch{}return R},C=j.useMemo(()=>{const P=w,L=P==null?void 0:P.language;let R=P;P&&(A.current&&A.current.__original===P?S.current!==L?(R=T(P),A.current=R,S.current=L):R=A.current:(R=T(P),A.current=R,S.current=L));const D=!x&&!s?(...I)=>(gE(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(...I)):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&&s&&!x){let P=!1;try{P=!1}catch{}throw P&&gE(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?Yqe(a,e.lng,d,R):jse(a,d,R)})}return C},eje=Uur(),$f=Au.createInstance();$f.use(Lhr).init({resources:{"en-US":{adk:J8e,app:r7e,conversation:D7e},"zh-CN":{adk:KUe,app:eQe,conversation:_Qe}},lng:eje,fallbackLng:Qse,supportedLngs:[...Cqe],defaultNS:"common",interpolation:{escapeValue:!1},initAsync:!1}),Oqe(eje),$f.on("languageChanged",t=>{const e=Gse(t)??Qse;Oqe(e)});const Hhr=Object.assign({"./resources/en-US/adk.json":jcr,"./resources/en-US/agentReviews.json":Xcr,"./resources/en-US/app.json":Kcr,"./resources/en-US/automations.json":Zcr,"./resources/en-US/common.json":Jcr,"./resources/en-US/conversation.json":eur,"./resources/en-US/create.json":tur,"./resources/en-US/cronjobs.json":rur,"./resources/en-US/deepseek.json":nur,"./resources/en-US/feedback.json":iur,"./resources/en-US/migrations.json":aur,"./resources/en-US/newChat.json":our,"./resources/en-US/reviews.json":sur,"./resources/en-US/sandbox.json":lur,"./resources/en-US/shell.json":cur,"./resources/en-US/sidebar.json":uur,"./resources/en-US/skills.json":hur,"./resources/en-US/ui.json":dur,"./resources/en-US/users.json":fur,"./resources/en-US/websiteIntegration.json":pur,"./resources/en-US/workspaceTools.json":gur,"./resources/zh-CN/adk.json":mur,"./resources/zh-CN/agentReviews.json":vur,"./resources/zh-CN/app.json":yur,"./resources/zh-CN/automations.json":bur,"./resources/zh-CN/common.json":xur,"./resources/zh-CN/conversation.json":wur,"./resources/zh-CN/create.json":Aur,"./resources/zh-CN/cronjobs.json":Sur,"./resources/zh-CN/deepseek.json":Tur,"./resources/zh-CN/feedback.json":Cur,"./resources/zh-CN/migrations.json":Our,"./resources/zh-CN/newChat.json":kur,"./resources/zh-CN/reviews.json":Eur,"./resources/zh-CN/sandbox.json":_ur,"./resources/zh-CN/shell.json":Rur,"./resources/zh-CN/sidebar.json":Dur,"./resources/zh-CN/skills.json":Lur,"./resources/zh-CN/ui.json":Mur,"./resources/zh-CN/users.json":Iur,"./resources/zh-CN/websiteIntegration.json":Pur,"./resources/zh-CN/workspaceTools.json":Nur});function Whr(){const t={};for(const[e,r]of Object.entries(Hhr)){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(Whr()))for(const[r,n]of Object.entries(e??{}))$f.addResourceBundle(t,r,n,!0,!0);const Yhr=`pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*! + */var mE=j;function Nhr(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Bhr=typeof Object.is=="function"?Object.is:Nhr,$hr=mE.useState,Fhr=mE.useEffect,zhr=mE.useLayoutEffect,Uhr=mE.useDebugValue;function Vhr(t,e){var r=e(),n=$hr({inst:{value:r,getSnapshot:e}}),i=n[0].inst,a=n[1];return zhr(function(){i.value=r,i.getSnapshot=e,ele(i)&&a({inst:i})},[t,r,e]),Fhr(function(){return ele(i)&&a({inst:i}),t(function(){ele(i)&&a({inst:i})})},[t]),Uhr(r),r}function ele(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!Bhr(t,r)}catch{return!0}}function Qhr(t,e){return e()}var Ghr=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Qhr:Vhr;tje.useSyncExternalStore=mE.useSyncExternalStore!==void 0?mE.useSyncExternalStore:Ghr,eje.exports=tje;var tQ=eje.exports;const Hhr={t:(t,e)=>{if(_h(e))return e;if(Yv(e)&&_h(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},Whr=()=>()=>{},ca=(t,e={})=>{var k,E,_;const{i18n:r}=e,{i18n:n,defaultNS:i}=j.useContext(Jqe)||{},a=r||n||Zse();a&&!a.reportNamespaces&&(a.reportNamespaces=new Phr),a||gE(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 o=j.useMemo(()=>{var P;return{...Kse(),...(P=a==null?void 0:a.options)==null?void 0:P.react,...e}},[a,e]),{useSuspense:s,keyPrefix:l}=o,u=t||i||((k=a==null?void 0:a.options)==null?void 0:k.defaultNS),h=_h(u)?[u]:u||["translation"],d=j.useMemo(()=>h,h);(_=(E=a==null?void 0:a.reportNamespaces)==null?void 0:E.addUsedNamespaces)==null||_.call(E,d);const f=j.useRef(0),p=j.useCallback(P=>{if(!a)return Whr;const{bindI18n:L,bindI18nStore:R}=o,D=()=>{f.current+=1,P()};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,o]),g=j.useRef(),m=j.useCallback(()=>{if(!a)return Hhr;const P=!!(a.isInitialized||a.initializedStoreOnce)&&d.every(N=>bhr(N,a,o)),L=e.lng||a.language,R=f.current,D=g.current;if(D&&D.ready===P&&D.lng===L&&D.keyPrefix===l&&D.revision===R)return D;const I={t:a.getFixedT(L,o.nsMode==="fallback"?d:d[0],l,{scopeNs:d}),ready:P,lng:L,keyPrefix:l,revision:R};return g.current=I,I},[a,d,l,o,e.lng]),[v,y]=j.useState(0),{t:b,ready:x}=tQ.useSyncExternalStore(p,m,m);j.useEffect(()=>{if(a&&!x&&!s){const P=()=>y(L=>L+1);e.lng?jqe(a,e.lng,d,P):jse(a,d,P)}},[a,e.lng,d,x,s,v]);const w=a||{},A=j.useRef(null),S=j.useRef(),T=P=>{const L=Object.getOwnPropertyDescriptors(P);L.__original&&delete L.__original;const R=Object.create(Object.getPrototypeOf(P),L);if(!Object.prototype.hasOwnProperty.call(R,"__original"))try{Object.defineProperty(R,"__original",{value:P,writable:!1,enumerable:!1,configurable:!1})}catch{}return R},C=j.useMemo(()=>{const P=w,L=P==null?void 0:P.language;let R=P;P&&(A.current&&A.current.__original===P?S.current!==L?(R=T(P),A.current=R,S.current=L):R=A.current:(R=T(P),A.current=R,S.current=L));const D=!x&&!s?(...I)=>(gE(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(...I)):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&&s&&!x){let P=!1;try{P=!1}catch{}throw P&&gE(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?jqe(a,e.lng,d,R):jse(a,d,R)})}return C},rje=Qur(),$f=Au.createInstance();$f.use(Ihr).init({resources:{"en-US":{adk:J8e,app:r7e,conversation:D7e},"zh-CN":{adk:ZUe,app:tQe,conversation:RQe}},lng:rje,fallbackLng:Qse,supportedLngs:[...kqe],defaultNS:"common",interpolation:{escapeValue:!1},initAsync:!1}),Eqe(rje),$f.on("languageChanged",t=>{const e=Gse(t)??Qse;Eqe(e)});const Yhr=Object.assign({"./resources/en-US/adk.json":Kcr,"./resources/en-US/agentReviews.json":Zcr,"./resources/en-US/app.json":Jcr,"./resources/en-US/automations.json":eur,"./resources/en-US/common.json":tur,"./resources/en-US/conversation.json":rur,"./resources/en-US/create.json":nur,"./resources/en-US/cronjobs.json":iur,"./resources/en-US/deepseek.json":aur,"./resources/en-US/feedback.json":our,"./resources/en-US/migrations.json":sur,"./resources/en-US/newChat.json":lur,"./resources/en-US/reviews.json":cur,"./resources/en-US/sandbox.json":uur,"./resources/en-US/shell.json":hur,"./resources/en-US/sidebar.json":dur,"./resources/en-US/skills.json":fur,"./resources/en-US/ui.json":pur,"./resources/en-US/users.json":gur,"./resources/en-US/websiteIntegration.json":mur,"./resources/en-US/workspaceTools.json":vur,"./resources/zh-CN/adk.json":yur,"./resources/zh-CN/agentReviews.json":bur,"./resources/zh-CN/app.json":xur,"./resources/zh-CN/automations.json":wur,"./resources/zh-CN/common.json":Aur,"./resources/zh-CN/conversation.json":Sur,"./resources/zh-CN/create.json":Tur,"./resources/zh-CN/cronjobs.json":Cur,"./resources/zh-CN/deepseek.json":Our,"./resources/zh-CN/feedback.json":kur,"./resources/zh-CN/migrations.json":Eur,"./resources/zh-CN/newChat.json":_ur,"./resources/zh-CN/reviews.json":Rur,"./resources/zh-CN/sandbox.json":Dur,"./resources/zh-CN/shell.json":Lur,"./resources/zh-CN/sidebar.json":Mur,"./resources/zh-CN/skills.json":Iur,"./resources/zh-CN/ui.json":Pur,"./resources/zh-CN/users.json":Nur,"./resources/zh-CN/websiteIntegration.json":Bur,"./resources/zh-CN/workspaceTools.json":$ur});function qhr(){const t={};for(const[e,r]of Object.entries(Yhr)){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(qhr()))for(const[r,n]of Object.entries(e??{}))$f.addResourceBundle(t,r,n,!0,!0);const jhr=`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 @@ -107,38 +107,38 @@ 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}`,qhr=".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)}",jhr=".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}}",Xhr=".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}}",Khr='/*! 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}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.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:4px;min-width:0;display:grid}.delivery-card-header strong{overflow-wrap:anywhere;text-wrap:balance;font-size:16px;font-weight:600;line-height:1.4}.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;flex:0 0 36px;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:12px 20px;margin:0;display:grid}.delivery-card-grid div{min-width:0}.delivery-card-grid dt{color:hsl(var(--muted-foreground));font-size:12px}.delivery-card-grid dd{text-overflow:ellipsis;white-space:nowrap;margin:2px 0 0;font-size:12px;overflow:hidden}.delivery-card-grid .delivery-card-entry,.delivery-card-grid .delivery-card-time{grid-column:1/-1}.delivery-card-grid .delivery-card-entry dd{white-space:normal;overflow-wrap:anywhere;line-height:1.5}.delivery-card-grid .delivery-card-time{flex-wrap:wrap;align-items:baseline;gap:4px 12px;display:flex}.delivery-card-grid .delivery-card-time dd{white-space:normal;font-variant-numeric:tabular-nums;margin:0}.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{border-top:1px solid hsl(var(--border));flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;padding-top:12px;display:flex}.delivery-card-secondary-actions{flex-wrap:wrap;gap:4px;min-width:0;display:flex}.delivery-card-primary{margin-left:auto}.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{color:hsl(var(--foreground));background:0 0;border-color:#0000;padding:0 8px;font-weight:400}.delivery-card-actions .delivery-card-secondary:hover:not(:disabled){background:hsl(var(--muted))}.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-secondary-actions{justify-content:space-between;display:flex}.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}',Zhr=".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}}",Jhr="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 Rh(t,e={}){return $f.t(t,{...e,ns:"adk"})}function tje(){return $f.resolvedLanguage||$f.language}async function*edr(t){if(!t.body)throw new Error("Response has no body");const e=t.body.getReader(),r=new TextDecoder;let n="";const i=o=>o.length>500?Rh("sse.truncatedData",{data:o.slice(0,500),count:o.length}):o,a=(o,s=!1)=>{const l=o.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 s?new Error(Rh("sse.incompleteEvent",{data:u})):new Error(Rh("sse.invalidEventJson",{data:u}))}};try{for(;;){const{done:o,value:s}=await e.read();if(o)break;n+=r.decode(s,{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 o=a(n,!0);o!==void 0&&(yield o)}}finally{try{await e.cancel()}catch{}finally{e.releaseLock()}}}function mA(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function rx(t){return typeof t=="string"?t:""}function rje(t,e){return t==="pending"||t==="running"||t==="completed"||t==="failed"?t:e}function tdr(t){let e=t;if(typeof e=="string")try{e=JSON.parse(e)}catch{return{}}const r=mA(e)??{};return mA(r.result)??r}function rdr(t){var r;const e=(r=mA(t))==null?void 0:r.branches;return Array.isArray(e)?e.map(n=>{var i;return rx((i=mA(n))==null?void 0:i.label)}):[]}function nje(t,e,r){const n=rdr(t),i=tdr(e),a=Array.isArray(i.branches)?i.branches:[],o=r==="running"?"running":"pending";return{branches:[0,1].map(l=>{const u=mA(a[l])??{};return{label:rx(u.label)||n[l]||`方向 ${l+1}`,content:rx(u.content),status:rje(u.status,o),error:rx(u.error)}})}}function ndr(t){const e=mA(t),r=mA(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:rx(r.requestId),branchIndex:r.branchIndex,label:rx(r.label),delta:rx(r.delta),status:rje(r.status,"running"),error:rx(r.error)||void 0}}function idr(t,e,r){return{branches:nje(t,e,"running").branches.map((a,o)=>o===r.branchIndex?{...a,label:r.label||a.label,content:a.content+r.delta,status:r.status,error:r.error??a.error}:a)}}function ac(t,e){return $f.t(`blocks.codexProgress.${t}`,{ns:"conversation",...e})}const ije=28e4;function aje(t){try{return JSON.stringify(t).length}catch{return ije}}function adr(t){const e=t.slice(-200);let r=e.reduce((n,i)=>n+aje(i),0);for(;e.length>1&&r>ije;)r-=aje(e.shift());return e}function Ed(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function yi(t){return typeof t=="string"?t:""}function tle(t,e=""){const r=yi(t).toLowerCase();return e.endsWith(".failed")||["failed","error","declined","cancelled"].includes(r)?"failed":e.endsWith(".completed")||["completed","done","success"].includes(r)?"completed":"running"}function oje(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 sje(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=yi(t.command),r=yi(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 vA(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 lje(t){const e=yi(t.id||t.itemId||t.item_id),r=yi(t.kind);if(!e||!r)return null;const n=tle(t.status),i=yi(t.text||t.detail||t.delta),a=!yi(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 o=Array.isArray(t.plan)?t.plan:[];return{id:e,block:{kind:"plan",title:yi(t.title)||ac("planTitle"),summary:i||void 0,items:o.flatMap(s=>{const l=Ed(s),u=yi(l==null?void 0:l.text);if(!u)return[];const h=yi(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 o=ac(r==="file_change"||r==="fileChange"?"fallback.fileChange":r==="approval"?"fallback.approval":r==="status"?"fallback.status":"fallback.command"),s=sje(t),l=oje(t)??(r==="status"&&i||void 0);return{id:e,block:vA(yi(t.name||t.title)||o,e,n,s,l)}}return null}function cje(t){const e=yi(t.type),r=Ed(t.item),n=yi(r==null?void 0:r.type),i=yi((r==null?void 0:r.id)||t.id)||(e==="turn.failed"?"turn":"");if(!i)return null;const a=tle(r==null?void 0:r.status,e);if(n==="reasoning"||n==="agent_message"){const o=yi(r==null?void 0:r.text);return o?{id:i,block:n==="reasoning"?{kind:"thinking",text:o,done:a!=="running"}:{kind:"text",text:o},...n==="agent_message"&&(r==null?void 0:r.phase)!=="commentary"?{finalAnswer:!0}:{}}:null}if(n==="todo_list"){const s=(Array.isArray(r==null?void 0:r.items)?r.items:[]).flatMap(l=>{const u=Ed(l),h=yi(u==null?void 0:u.text);if(!h)return[];const d=yi(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 s.length?{id:i,block:{kind:"plan",title:ac("planTitle"),summary:ac("planSummary",{completed:s.filter(l=>l.status==="completed").length,total:s.length}),items:s,done:a!=="running"}}:null}if(n==="command_execution"){const o=ac(`command.${a}`);return{id:i,block:vA(o,i,a,sje(r??{}),oje(r??{}))}}if(n==="file_change"){const o=Array.isArray(r==null?void 0:r.changes)?r.changes:[],s=o.length?ac("projectFiles",{count:o.length}):ac("projectFile"),l=ac(`fileChange.${a}`,{subject:s});return{id:i,block:vA(l,i,a,o.length?{changes:o}:void 0)}}if(n==="mcp_tool_call"){const o=[yi(r==null?void 0:r.server),yi(r==null?void 0:r.tool)].filter(Boolean).join("/")||ac("externalTool"),s=ac(`mcp.${a}`,{tool:o}),l=Ed(r==null?void 0:r.error),u=(r==null?void 0:r.result)!==void 0?r.result:yi(l==null?void 0:l.message)||void 0;return{id:i,block:vA(s,i,a,r==null?void 0:r.arguments,u)}}if(n==="collab_tool_call"){const o=yi(r==null?void 0:r.tool),s=["spawn_agent","send_input","wait","close_agent"].includes(o)?o:"default",l=ac(`collaboration.${s}.${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:vA(l,i,a,Object.keys(u).length?u:void 0,r==null?void 0:r.agents_states)}}if(n==="web_search"){const o=ac(`webSearch.${a}`),s=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:vA(o,i,a,Object.keys(s).length?s:void 0)}}if(n==="error"||e==="error"||e==="turn.failed"){const o=Ed(t.error),s=yi((r==null?void 0:r.message)||t.message||(o==null?void 0:o.message))||ac("errorDetail");return{id:i,block:vA(ac("errorTitle"),i,"failed",void 0,s)}}return null}function odr(t){const e=Ed(t),r=Ed(e==null?void 0:e.veadkStudioToolProgress);if(!r||r.kind!=="codex")return null;const n=yi(r.toolName),i=yi(r.requestId);if(!n||!i)return null;const a=Ed(r.event??r.activity);if(!a)return null;const o=Ed(a.item)||yi(a.type)?cje(a):lje(a);if(!o)return null;const s=yi(r.title||r.label),l=yi(a.agentSessionId??a.agent_session_id),u=yi(a.sandboxSessionId??a.sandbox_session_id),h=yi(a.threadId??a.thread_id),d=tle(a.status,yi(a.type)),p=yi(a.kind)==="status"&&d!=="running"?d:void 0;return{toolName:n,requestId:i,...s?{title:s}:{},...l?{agentSessionId:l}:{},...u?{sandboxSessionId:u}:{},...h?{threadId:h}:{},...p?{terminalStatus:p}:{},event:o}}function sdr(t,e){const r=Ed(e),n=Ed((r==null?void 0:r.codexActivity)??(r==null?void 0:r.codex_activity));if(!n)return t;const i=yi(n.title)||(t==null?void 0:t.title)||"Codex Sandbox",a=yi(n.agentSessionId??n.agent_session_id)||(t==null?void 0:t.agentSessionId),o=yi(n.sandboxSessionId??n.sandbox_session_id)||(t==null?void 0:t.sandboxSessionId),s=yi(n.threadId??n.thread_id)||(t==null?void 0:t.threadId);let l={title:i,...a?{agentSessionId:a}:{},...o?{sandboxSessionId:o}:{},...s?{threadId:s}:{},items:(t==null?void 0:t.items.slice())??[]};const u=Array.isArray(n.events)?n.events:[];for(const h of u){const d=Ed(h);if(!d)continue;const f=Ed(d.item)||yi(d.type)?cje(d):lje(d);f&&(f.finalAnswer||(l=rle(l,{title:i,...a?{agentSessionId:a}:{},...o?{sandboxSessionId:o}:{},...s?{threadId:s}:{},event:f})))}return l}function rle(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:adr(r)}}const ldr="send_a2ui_json_to_client",cdr="validated_a2ui_json",uje="adk_request_credential",hje="transfer_to_agent";function udr(t){var n,i,a,o;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)??((o=e==null?void 0:e.raw_auth_credential)==null?void 0:o.oauth2);return(r==null?void 0:r.authUri)??(r==null?void 0:r.auth_uri)}function hdr(){return{blocks:[],liveStart:0,pendingCodexProgress:[]}}function dje(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=rle(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=rle(n.codexActivity,e),n.status=e.terminalStatus??"running",e.terminalStatus&&(n.done=!0),"applied")}return"unmatched"}function ddr(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 fje(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 pje=t=>t.functionCall??t.function_call,gje=t=>t.functionResponse??t.function_response;function fdr(t){if(!t||typeof t!="object")return"";const e=t,r=e.agentName??e.agent_name;return typeof r=="string"?r:""}function pdr(t){return t.replace(/-/g,"+").replace(/_/g,"/")}function gdr(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 o=i==null?void 0:i.veadkMedia;if(typeof(o==null?void 0:o.uri)=="string"){e.push({id:String(o.id??o.uri),mimeType:typeof o.mimeType=="string"?o.mimeType:void 0,uri:o.uri,name:typeof o.name=="string"?o.name:void 0,sizeBytes:typeof o.sizeBytes=="number"?o.sizeBytes:void 0});continue}const s=n.inlineData??n.inline_data;if(s&&s.data){e.push({id:`inline-${r}-${s.displayName??s.display_name??"media"}`,mimeType:s.mimeType??s.mime_type,data:pdr(s.data),name:s.displayName??s.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 mje(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 mdr(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 vdr(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 nle(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 rQ(t){for(const e of t)e.kind==="thinking"&&(e.done=!0)}function ydr(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)??[],o=a.flatMap(v=>{const y=ndr(v.partMetadata??v.part_metadata);return y?[y]:[]}),s=a.flatMap(v=>{const y=odr(v.partMetadata??v.part_metadata);return y?[y]:[]});if(o.length>0||s.length>0){for(const v of o)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=idr(b.args,b.response,v),b.status="running";break}}for(const v of s)dje(r,v)==="unmatched"&&(i=[...i,v].slice(-64));return{blocks:r,liveStart:n,pendingCodexProgress:i}}const l=a.some(v=>pje(v)||gje(v));if(e.partial&&!l){for(const v of a){const y=mje(v);typeof y=="string"&&y&&nle(r,v.thought?"thinking":"text",y)}return{blocks:r,liveStart:n,pendingCodexProgress:i}}r.length=n;for(const v of a){const y=pje(v),b=gje(v),x=gdr([v]),w=mje(v);if(typeof w=="string"&&w)nle(r,v.thought?"thinking":"text",w);else if(x.length)rQ(r),mdr(r,x);else if(y)if(rQ(r),y.name===hje){const A=fdr(y.args)||((d=e.actions)==null?void 0:d.transferToAgent)||((f=e.actions)==null?void 0:f.transfer_to_agent)||$f.t("app:common.unknownAgent");r.push({kind:"agent-transfer",agentName:A,done:!1})}else if(y.name===uje){const A=y.args??{},S=A.authConfig??A.auth_config??A,C=String(A.functionCallId??A.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;r.push({kind:"auth",callId:y.id??"",label:C,authUri:udr(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?dje(r,T):S.push(T);i=S}}else if(b){if(rQ(r),b.name===hje)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===uje)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 C=T?fje(S.response):"";if(S.done=!0,S.response=b.response,T){S.codexActivity=sdr(S.codexActivity,b.response),S.status=ddr(b.response);const k=fje(b.response);k&&k!==C&&nle(r,"text",k)}break}}if(b.name===ldr){const A=((p=b.response)==null?void 0:p[cdr])??[];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&&vdr(r,Object.entries(u).map(([v,y])=>({filename:v,version:y}))),rQ(r),n=r.length,{blocks:r,liveStart:n,pendingCodexProgress:i}}/** +*/.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}`,Xhr=".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)}",Khr=".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}}",Zhr=".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}}",Jhr='/*! 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}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.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:4px;min-width:0;display:grid}.delivery-card-header strong{overflow-wrap:anywhere;text-wrap:balance;font-size:16px;font-weight:600;line-height:1.4}.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;flex:0 0 36px;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:12px 20px;margin:0;display:grid}.delivery-card-grid div{min-width:0}.delivery-card-grid dt{color:hsl(var(--muted-foreground));font-size:12px}.delivery-card-grid dd{text-overflow:ellipsis;white-space:nowrap;margin:2px 0 0;font-size:12px;overflow:hidden}.delivery-card-grid .delivery-card-entry,.delivery-card-grid .delivery-card-time{grid-column:1/-1}.delivery-card-grid .delivery-card-entry dd{white-space:normal;overflow-wrap:anywhere;line-height:1.5}.delivery-card-grid .delivery-card-time{flex-wrap:wrap;align-items:baseline;gap:4px 12px;display:flex}.delivery-card-grid .delivery-card-time dd{white-space:normal;font-variant-numeric:tabular-nums;margin:0}.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{border-top:1px solid hsl(var(--border));flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;padding-top:12px;display:flex}.delivery-card-secondary-actions{flex-wrap:wrap;gap:4px;min-width:0;display:flex}.delivery-card-primary{margin-left:auto}.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{color:hsl(var(--foreground));background:0 0;border-color:#0000;padding:0 8px;font-weight:400}.delivery-card-actions .delivery-card-secondary:hover:not(:disabled){background:hsl(var(--muted))}.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-secondary-actions{justify-content:space-between;display:flex}.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}',edr=".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}}",tdr="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 Rh(t,e={}){return $f.t(t,{...e,ns:"adk"})}function nje(){return $f.resolvedLanguage||$f.language}async function*rdr(t){if(!t.body)throw new Error("Response has no body");const e=t.body.getReader(),r=new TextDecoder;let n="";const i=o=>o.length>500?Rh("sse.truncatedData",{data:o.slice(0,500),count:o.length}):o,a=(o,s=!1)=>{const l=o.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 s?new Error(Rh("sse.incompleteEvent",{data:u})):new Error(Rh("sse.invalidEventJson",{data:u}))}};try{for(;;){const{done:o,value:s}=await e.read();if(o)break;n+=r.decode(s,{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 o=a(n,!0);o!==void 0&&(yield o)}}finally{try{await e.cancel()}catch{}finally{e.releaseLock()}}}function mA(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function rx(t){return typeof t=="string"?t:""}function ije(t,e){return t==="pending"||t==="running"||t==="completed"||t==="failed"?t:e}function ndr(t){let e=t;if(typeof e=="string")try{e=JSON.parse(e)}catch{return{}}const r=mA(e)??{};return mA(r.result)??r}function idr(t){var r;const e=(r=mA(t))==null?void 0:r.branches;return Array.isArray(e)?e.map(n=>{var i;return rx((i=mA(n))==null?void 0:i.label)}):[]}function aje(t,e,r){const n=idr(t),i=ndr(e),a=Array.isArray(i.branches)?i.branches:[],o=r==="running"?"running":"pending";return{branches:[0,1].map(l=>{const u=mA(a[l])??{};return{label:rx(u.label)||n[l]||`方向 ${l+1}`,content:rx(u.content),status:ije(u.status,o),error:rx(u.error)}})}}function adr(t){const e=mA(t),r=mA(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:rx(r.requestId),branchIndex:r.branchIndex,label:rx(r.label),delta:rx(r.delta),status:ije(r.status,"running"),error:rx(r.error)||void 0}}function odr(t,e,r){return{branches:aje(t,e,"running").branches.map((a,o)=>o===r.branchIndex?{...a,label:r.label||a.label,content:a.content+r.delta,status:r.status,error:r.error??a.error}:a)}}function ac(t,e){return $f.t(`blocks.codexProgress.${t}`,{ns:"conversation",...e})}const oje=28e4;function sje(t){try{return JSON.stringify(t).length}catch{return oje}}function sdr(t){const e=t.slice(-200);let r=e.reduce((n,i)=>n+sje(i),0);for(;e.length>1&&r>oje;)r-=sje(e.shift());return e}function Ed(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function yi(t){return typeof t=="string"?t:""}function tle(t,e=""){const r=yi(t).toLowerCase();return e.endsWith(".failed")||["failed","error","declined","cancelled"].includes(r)?"failed":e.endsWith(".completed")||["completed","done","success"].includes(r)?"completed":"running"}function lje(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 cje(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=yi(t.command),r=yi(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 vA(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 uje(t){const e=yi(t.id||t.itemId||t.item_id),r=yi(t.kind);if(!e||!r)return null;const n=tle(t.status),i=yi(t.text||t.detail||t.delta),a=!yi(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 o=Array.isArray(t.plan)?t.plan:[];return{id:e,block:{kind:"plan",title:yi(t.title)||ac("planTitle"),summary:i||void 0,items:o.flatMap(s=>{const l=Ed(s),u=yi(l==null?void 0:l.text);if(!u)return[];const h=yi(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 o=ac(r==="file_change"||r==="fileChange"?"fallback.fileChange":r==="approval"?"fallback.approval":r==="status"?"fallback.status":"fallback.command"),s=cje(t),l=lje(t)??(r==="status"&&i||void 0);return{id:e,block:vA(yi(t.name||t.title)||o,e,n,s,l)}}return null}function hje(t){const e=yi(t.type),r=Ed(t.item),n=yi(r==null?void 0:r.type),i=yi((r==null?void 0:r.id)||t.id)||(e==="turn.failed"?"turn":"");if(!i)return null;const a=tle(r==null?void 0:r.status,e);if(n==="reasoning"||n==="agent_message"){const o=yi(r==null?void 0:r.text);return o?{id:i,block:n==="reasoning"?{kind:"thinking",text:o,done:a!=="running"}:{kind:"text",text:o},...n==="agent_message"&&(r==null?void 0:r.phase)!=="commentary"?{finalAnswer:!0}:{}}:null}if(n==="todo_list"){const s=(Array.isArray(r==null?void 0:r.items)?r.items:[]).flatMap(l=>{const u=Ed(l),h=yi(u==null?void 0:u.text);if(!h)return[];const d=yi(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 s.length?{id:i,block:{kind:"plan",title:ac("planTitle"),summary:ac("planSummary",{completed:s.filter(l=>l.status==="completed").length,total:s.length}),items:s,done:a!=="running"}}:null}if(n==="command_execution"){const o=ac(`command.${a}`);return{id:i,block:vA(o,i,a,cje(r??{}),lje(r??{}))}}if(n==="file_change"){const o=Array.isArray(r==null?void 0:r.changes)?r.changes:[],s=o.length?ac("projectFiles",{count:o.length}):ac("projectFile"),l=ac(`fileChange.${a}`,{subject:s});return{id:i,block:vA(l,i,a,o.length?{changes:o}:void 0)}}if(n==="mcp_tool_call"){const o=[yi(r==null?void 0:r.server),yi(r==null?void 0:r.tool)].filter(Boolean).join("/")||ac("externalTool"),s=ac(`mcp.${a}`,{tool:o}),l=Ed(r==null?void 0:r.error),u=(r==null?void 0:r.result)!==void 0?r.result:yi(l==null?void 0:l.message)||void 0;return{id:i,block:vA(s,i,a,r==null?void 0:r.arguments,u)}}if(n==="collab_tool_call"){const o=yi(r==null?void 0:r.tool),s=["spawn_agent","send_input","wait","close_agent"].includes(o)?o:"default",l=ac(`collaboration.${s}.${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:vA(l,i,a,Object.keys(u).length?u:void 0,r==null?void 0:r.agents_states)}}if(n==="web_search"){const o=ac(`webSearch.${a}`),s=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:vA(o,i,a,Object.keys(s).length?s:void 0)}}if(n==="error"||e==="error"||e==="turn.failed"){const o=Ed(t.error),s=yi((r==null?void 0:r.message)||t.message||(o==null?void 0:o.message))||ac("errorDetail");return{id:i,block:vA(ac("errorTitle"),i,"failed",void 0,s)}}return null}function ldr(t){const e=Ed(t),r=Ed(e==null?void 0:e.veadkStudioToolProgress);if(!r||r.kind!=="codex")return null;const n=yi(r.toolName),i=yi(r.requestId);if(!n||!i)return null;const a=Ed(r.event??r.activity);if(!a)return null;const o=Ed(a.item)||yi(a.type)?hje(a):uje(a);if(!o)return null;const s=yi(r.title||r.label),l=yi(a.agentSessionId??a.agent_session_id),u=yi(a.sandboxSessionId??a.sandbox_session_id),h=yi(a.threadId??a.thread_id),d=tle(a.status,yi(a.type)),p=yi(a.kind)==="status"&&d!=="running"?d:void 0;return{toolName:n,requestId:i,...s?{title:s}:{},...l?{agentSessionId:l}:{},...u?{sandboxSessionId:u}:{},...h?{threadId:h}:{},...p?{terminalStatus:p}:{},event:o}}function cdr(t,e){const r=Ed(e),n=Ed((r==null?void 0:r.codexActivity)??(r==null?void 0:r.codex_activity));if(!n)return t;const i=yi(n.title)||(t==null?void 0:t.title)||"Codex Sandbox",a=yi(n.agentSessionId??n.agent_session_id)||(t==null?void 0:t.agentSessionId),o=yi(n.sandboxSessionId??n.sandbox_session_id)||(t==null?void 0:t.sandboxSessionId),s=yi(n.threadId??n.thread_id)||(t==null?void 0:t.threadId);let l={title:i,...a?{agentSessionId:a}:{},...o?{sandboxSessionId:o}:{},...s?{threadId:s}:{},items:(t==null?void 0:t.items.slice())??[]};const u=Array.isArray(n.events)?n.events:[];for(const h of u){const d=Ed(h);if(!d)continue;const f=Ed(d.item)||yi(d.type)?hje(d):uje(d);f&&(f.finalAnswer||(l=rle(l,{title:i,...a?{agentSessionId:a}:{},...o?{sandboxSessionId:o}:{},...s?{threadId:s}:{},event:f})))}return l}function rle(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:sdr(r)}}const udr="send_a2ui_json_to_client",hdr="validated_a2ui_json",dje="adk_request_credential",fje="transfer_to_agent";function ddr(t){var n,i,a,o;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)??((o=e==null?void 0:e.raw_auth_credential)==null?void 0:o.oauth2);return(r==null?void 0:r.authUri)??(r==null?void 0:r.auth_uri)}function fdr(){return{blocks:[],liveStart:0,pendingCodexProgress:[]}}function pje(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=rle(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=rle(n.codexActivity,e),n.status=e.terminalStatus??"running",e.terminalStatus&&(n.done=!0),"applied")}return"unmatched"}function pdr(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 gje(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 mje=t=>t.functionCall??t.function_call,vje=t=>t.functionResponse??t.function_response;function gdr(t){if(!t||typeof t!="object")return"";const e=t,r=e.agentName??e.agent_name;return typeof r=="string"?r:""}function mdr(t){return t.replace(/-/g,"+").replace(/_/g,"/")}function vdr(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 o=i==null?void 0:i.veadkMedia;if(typeof(o==null?void 0:o.uri)=="string"){e.push({id:String(o.id??o.uri),mimeType:typeof o.mimeType=="string"?o.mimeType:void 0,uri:o.uri,name:typeof o.name=="string"?o.name:void 0,sizeBytes:typeof o.sizeBytes=="number"?o.sizeBytes:void 0});continue}const s=n.inlineData??n.inline_data;if(s&&s.data){e.push({id:`inline-${r}-${s.displayName??s.display_name??"media"}`,mimeType:s.mimeType??s.mime_type,data:mdr(s.data),name:s.displayName??s.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 yje(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 ydr(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 bdr(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 nle(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 rQ(t){for(const e of t)e.kind==="thinking"&&(e.done=!0)}function xdr(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)??[],o=a.flatMap(v=>{const y=adr(v.partMetadata??v.part_metadata);return y?[y]:[]}),s=a.flatMap(v=>{const y=ldr(v.partMetadata??v.part_metadata);return y?[y]:[]});if(o.length>0||s.length>0){for(const v of o)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=odr(b.args,b.response,v),b.status="running";break}}for(const v of s)pje(r,v)==="unmatched"&&(i=[...i,v].slice(-64));return{blocks:r,liveStart:n,pendingCodexProgress:i}}const l=a.some(v=>mje(v)||vje(v));if(e.partial&&!l){for(const v of a){const y=yje(v);typeof y=="string"&&y&&nle(r,v.thought?"thinking":"text",y)}return{blocks:r,liveStart:n,pendingCodexProgress:i}}r.length=n;for(const v of a){const y=mje(v),b=vje(v),x=vdr([v]),w=yje(v);if(typeof w=="string"&&w)nle(r,v.thought?"thinking":"text",w);else if(x.length)rQ(r),ydr(r,x);else if(y)if(rQ(r),y.name===fje){const A=gdr(y.args)||((d=e.actions)==null?void 0:d.transferToAgent)||((f=e.actions)==null?void 0:f.transfer_to_agent)||$f.t("app:common.unknownAgent");r.push({kind:"agent-transfer",agentName:A,done:!1})}else if(y.name===dje){const A=y.args??{},S=A.authConfig??A.auth_config??A,C=String(A.functionCallId??A.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;r.push({kind:"auth",callId:y.id??"",label:C,authUri:ddr(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?pje(r,T):S.push(T);i=S}}else if(b){if(rQ(r),b.name===fje)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===dje)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 C=T?gje(S.response):"";if(S.done=!0,S.response=b.response,T){S.codexActivity=cdr(S.codexActivity,b.response),S.status=pdr(b.response);const k=gje(b.response);k&&k!==C&&nle(r,"text",k)}break}}if(b.name===udr){const A=((p=b.response)==null?void 0:p[hdr])??[];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&&bdr(r,Object.entries(u).map(([v,y])=>({filename:v,version:y}))),rQ(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 bdr=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),vje=(...t)=>t.filter((e,r,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===r).join(" ").trim();/** + */const wdr=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),bje=(...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. * See the LICENSE file in the root directory of this source tree. - */var xdr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + */var Adr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wdr=j.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:a,iconNode:o,...s},l)=>j.createElement("svg",{ref:l,...xdr,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:vje("lucide",i),...s},[...o.map(([u,h])=>j.createElement(u,h)),...Array.isArray(a)?a:[a]]));/** + */const Sdr=j.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:a,iconNode:o,...s},l)=>j.createElement("svg",{ref:l,...Adr,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:bje("lucide",i),...s},[...o.map(([u,h])=>j.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 Dh=(t,e)=>{const r=j.forwardRef(({className:n,...i},a)=>j.createElement(wdr,{ref:a,iconNode:e,className:vje(`lucide-${bdr(t)}`,n),...i}));return r.displayName=`${t}`,r};/** + */const Dh=(t,e)=>{const r=j.forwardRef(({className:n,...i},a)=>j.createElement(Sdr,{ref:a,iconNode:e,className:bje(`lucide-${wdr(t)}`,n),...i}));return r.displayName=`${t}`,r};/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Adr=Dh("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);/** + */const Tdr=Dh("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Sdr=Dh("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const Cdr=Dh("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -148,27 +148,27 @@ Studio:{{studioUrl}} * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Tdr=Dh("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const Odr=Dh("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yje=Dh("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 xje=Dh("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Cdr=Dh("FileType2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 13v-1h6v1",key:"1dh9dg"}],["path",{d:"M5 12v6",key:"150t9c"}],["path",{d:"M4 18h2",key:"1xrofg"}]]);/** + */const kdr=Dh("FileType2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 13v-1h6v1",key:"1dh9dg"}],["path",{d:"M5 12v6",key:"150t9c"}],["path",{d:"M4 18h2",key:"1xrofg"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Odr=Dh("FileVideo2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["rect",{width:"8",height:"6",x:"2",y:"12",rx:"1",key:"1a6c1e"}],["path",{d:"m10 15.5 4 2.5v-6l-4 2.5",key:"t7cp39"}]]);/** + */const Edr=Dh("FileVideo2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["rect",{width:"8",height:"6",x:"2",y:"12",rx:"1",key:"1a6c1e"}],["path",{d:"m10 15.5 4 2.5v-6l-4 2.5",key:"t7cp39"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kdr=Dh("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** + */const _dr=Dh("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -183,22 +183,22 @@ Studio:{{studioUrl}} * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Edr=Dh("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + */const Rdr=Dh("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bje=Dh("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + */const wje=Dh("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _dr=Dh("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** + */const Ddr=Dh("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vE=Dh("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ale=j.createContext({});function ole(t){const e=j.useRef(null);return e.current===null&&(e.current=t()),e.current}const iQ=j.createContext(null),sle=j.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class Rdr extends j.Component{getSnapshotBeforeUpdate(e){const r=this.props.childRef.current;if(r&&e.isPresent&&!this.props.isPresent){const n=this.props.sizeRef.current;n.height=r.offsetHeight||0,n.width=r.offsetWidth||0,n.top=r.offsetTop,n.left=r.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Ddr({children:t,isPresent:e}){const r=j.useId(),n=j.useRef(null),i=j.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=j.useContext(sle);return j.useInsertionEffect(()=>{const{width:o,height:s,top:l,left:u}=i.current;if(e||!n.current||!o||!s)return;n.current.dataset.motionPopId=r;const h=document.createElement("style");return a&&(h.nonce=a),document.head.appendChild(h),h.sheet&&h.sheet.insertRule(` + */const vE=Dh("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ale=j.createContext({});function ole(t){const e=j.useRef(null);return e.current===null&&(e.current=t()),e.current}const iQ=j.createContext(null),sle=j.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class Ldr extends j.Component{getSnapshotBeforeUpdate(e){const r=this.props.childRef.current;if(r&&e.isPresent&&!this.props.isPresent){const n=this.props.sizeRef.current;n.height=r.offsetHeight||0,n.width=r.offsetWidth||0,n.top=r.offsetTop,n.left=r.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Mdr({children:t,isPresent:e}){const r=j.useId(),n=j.useRef(null),i=j.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=j.useContext(sle);return j.useInsertionEffect(()=>{const{width:o,height:s,top:l,left:u}=i.current;if(e||!n.current||!o||!s)return;n.current.dataset.motionPopId=r;const h=document.createElement("style");return a&&(h.nonce=a),document.head.appendChild(h),h.sheet&&h.sheet.insertRule(` [data-motion-pop-id="${r}"] { position: absolute !important; width: ${o}px !important; @@ -206,7 +206,7 @@ Studio:{{studioUrl}} top: ${l}px !important; left: ${u}px !important; } - `),()=>{document.head.removeChild(h)}},[e]),H.jsx(Rdr,{isPresent:e,childRef:n,sizeRef:i,children:j.cloneElement(t,{ref:n})})}const Ldr=({children:t,initial:e,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:a,mode:o})=>{const s=ole(Mdr),l=j.useId(),u=j.useCallback(d=>{s.set(d,!0);for(const f of s.values())if(!f)return;n&&n()},[s,n]),h=j.useMemo(()=>({id:l,initial:e,isPresent:r,custom:i,onExitComplete:u,register:d=>(s.set(d,!1),()=>s.delete(d))}),a?[Math.random(),u]:[r,u]);return j.useMemo(()=>{s.forEach((d,f)=>s.set(f,!1))},[r]),j.useEffect(()=>{!r&&!s.size&&n&&n()},[r]),o==="popLayout"&&(t=H.jsx(Ddr,{isPresent:r,children:t})),H.jsx(iQ.Provider,{value:h,children:t})};function Mdr(){return new Map}function xje(t=!0){const e=j.useContext(iQ);if(e===null)return[!0,null];const{isPresent:r,onExitComplete:n,register:i}=e,a=j.useId();j.useEffect(()=>{t&&i(a)},[t]);const o=j.useCallback(()=>t&&n&&n(a),[a,n,t]);return!r&&n?[!1,o]:[!0]}const aQ=t=>t.key||"";function wje(t){const e=[];return j.Children.forEach(t,r=>{j.isValidElement(r)&&e.push(r)}),e}const lle=typeof window<"u",Aje=lle?j.useLayoutEffect:j.useEffect,Idr=({children:t,custom:e,initial:r=!0,onExitComplete:n,presenceAffectsLayout:i=!0,mode:a="sync",propagate:o=!1})=>{const[s,l]=xje(o),u=j.useMemo(()=>wje(t),[t]),h=o&&!s?[]:u.map(aQ),d=j.useRef(!0),f=j.useRef(u),p=ole(()=>new Map),[g,m]=j.useState(u),[v,y]=j.useState(u);Aje(()=>{d.current=!1,f.current=u;for(let w=0;w{const A=aQ(w),S=o&&!s?!1:u===v||h.includes(A),T=()=>{if(p.has(A))p.set(A,!0);else return;let C=!0;p.forEach(k=>{k||(C=!1)}),C&&(x==null||x(),y(f.current),o&&(l==null||l()),n&&n())};return H.jsx(Ldr,{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)})})},_d=t=>t;let Sje=_d;const Pdr={useManualTiming:!1};function Ndr(t){let e=new Set,r=new Set,n=!1,i=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function s(u){a.has(u)&&(l.schedule(u),t()),u(o)}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(o=u,n){i=!0;return}n=!0,[e,r]=[r,e],e.forEach(s),e.clear(),n=!1,i&&(i=!1,l.process(u))}};return l}const oQ=["read","resolveKeyframes","update","preRender","render","postRender"],Bdr=40;function Tje(t,e){let r=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,o=oQ.reduce((y,b)=>(y[b]=Ndr(a),y),{}),{read:s,resolveKeyframes:l,update:u,preRender:h,render:d,postRender:f}=o,p=()=>{const y=performance.now();r=!1,i.delta=n?1e3/60:Math.max(Math.min(y-i.timestamp,Bdr),1),i.timestamp=y,i.isProcessing=!0,s.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:oQ.reduce((y,b)=>{const x=o[b];return y[b]=(w,A=!1,S=!1)=>(r||g(),x.schedule(w,A,S)),y},{}),cancel:y=>{for(let b=0;bOje[t].some(r=>!!e[r])};function $dr(t){for(const e in t)yE[e]={...yE[e],...t[e]}}const Fdr=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 sQ(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Fdr.has(t)}let kje=t=>!sQ(t);function zdr(t){t&&(kje=e=>e.startsWith("on")?!sQ(e):t(e))}try{zdr(require("@emotion/is-prop-valid").default)}catch{}function Udr(t,e,r){const n={};for(const i in t)i==="values"&&typeof t.values=="object"||(kje(i)||r===!0&&sQ(i)||!e&&!sQ(i)||t.draggable&&i.startsWith("onDrag"))&&(n[i]=t[i]);return n}function Vdr(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 lQ=j.createContext({});function _6(t){return typeof t=="string"||Array.isArray(t)}function cQ(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const ule=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],hle=["initial",...ule];function uQ(t){return cQ(t.animate)||hle.some(e=>_6(t[e]))}function Eje(t){return!!(uQ(t)||t.variants)}function Qdr(t,e){if(uQ(t)){const{initial:r,animate:n}=t;return{initial:r===!1||_6(r)?r:void 0,animate:_6(n)?n:void 0}}return t.inherit!==!1?e:{}}function Gdr(t){const{initial:e,animate:r}=Qdr(t,j.useContext(lQ));return j.useMemo(()=>({initial:e,animate:r}),[_je(e),_je(r)])}function _je(t){return Array.isArray(t)?t.join(" "):t}const Hdr=Symbol.for("motionComponentSymbol");function bE(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Wdr(t,e,r){return j.useCallback(n=>{n&&t.onMount&&t.onMount(n),e&&(n?e.mount(n):e.unmount()),r&&(typeof r=="function"?r(n):bE(r)&&(r.current=n))},[e])}const dle=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Rje="data-"+dle("framerAppearId"),{schedule:fle}=Tje(queueMicrotask,!1),Dje=j.createContext({});function Ydr(t,e,r,n,i){var a,o;const{visualElement:s}=j.useContext(lQ),l=j.useContext(Cje),u=j.useContext(iQ),h=j.useContext(sle).reducedMotion,d=j.useRef(null);n=n||l.renderer,!d.current&&n&&(d.current=n(t,{visualState:e,parent:s,props:r,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:h}));const f=d.current,p=j.useContext(Dje);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&qdr(d.current,r,i,p);const g=j.useRef(!1);j.useInsertionEffect(()=>{f&&g.current&&f.update(r,u)});const m=r[Rje],v=j.useRef(!!m&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,m))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,m)));return Aje(()=>{f&&(g.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),fle.render(f.render),v.current&&f.animationState&&f.animationState.animateChanges())}),j.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 qdr(t,e,r,n){const{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:l,layoutRoot:u}=e;t.projection=new r(t.latestValues,e["data-framer-portal-id"]?void 0:Lje(t.parent)),t.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&bE(s),visualElement:t,animationType:typeof a=="string"?a:"both",initialPromotionConfig:n,layoutScroll:l,layoutRoot:u})}function Lje(t){if(t)return t.options.allowProjection!==!1?t.projection:Lje(t.parent)}function jdr({preloadedFeatures:t,createVisualElement:e,useRender:r,useVisualState:n,Component:i}){var a,o;t&&$dr(t);function s(u,h){let d;const f={...j.useContext(sle),...u,layoutId:Xdr(u)},{isStatic:p}=f,g=Gdr(u),m=n(u,p);if(!p&&lle){Kdr();const v=Zdr(f);d=v.MeasureLayout,g.visualElement=Ydr(i,m,f,e,v.ProjectionNode)}return H.jsxs(lQ.Provider,{value:g,children:[d&&g.visualElement?H.jsx(d,{visualElement:g.visualElement,...f}):null,r(i,u,Wdr(m,g.visualElement,h),m,p,g.visualElement)]})}s.displayName=`motion.${typeof i=="string"?i:`create(${(o=(a=i.displayName)!==null&&a!==void 0?a:i.name)!==null&&o!==void 0?o:""})`}`;const l=j.forwardRef(s);return l[Hdr]=i,l}function Xdr({layoutId:t}){const e=j.useContext(ale).id;return e&&t!==void 0?e+"-"+t:t}function Kdr(t,e){j.useContext(Cje).strict}function Zdr(t){const{drag:e,layout:r}=yE;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 Jdr=["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 ple(t){return typeof t!="string"||t.includes("-")?!1:!!(Jdr.indexOf(t)>-1||/[A-Z]/u.test(t))}function Mje(t){const e=[{},{}];return t==null||t.values.forEach((r,n)=>{e[0][n]=r.get(),e[1][n]=r.getVelocity()}),e}function gle(t,e,r,n){if(typeof e=="function"){const[i,a]=Mje(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]=Mje(n);e=e(r!==void 0?r:t.custom,i,a)}return e}const mle=t=>Array.isArray(t),efr=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),tfr=t=>mle(t)?t[t.length-1]||0:t,Fc=t=>!!(t&&t.getVelocity);function hQ(t){const e=Fc(t)?t.get():t;return efr(e)?e.toValue():e}function rfr({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:r},n,i,a){const o={latestValues:nfr(n,i,a,t),renderState:e()};return r&&(o.onMount=s=>r({props:n,current:s,...o}),o.onUpdate=s=>r(s)),o}const Ije=t=>(e,r)=>{const n=j.useContext(lQ),i=j.useContext(iQ),a=()=>rfr(t,e,n,i);return r?a():ole(a)};function nfr(t,e,r,n){const i={},a=n(t,{});for(const f in a)i[f]=hQ(a[f]);let{initial:o,animate:s}=t;const l=uQ(t),u=Eje(t);e&&u&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),s===void 0&&(s=e.animate));let h=r?r.initial===!1:!1;h=h||o===!1;const d=h?s:o;if(d&&typeof d!="boolean"&&!cQ(d)){const f=Array.isArray(d)?d:[d];for(let p=0;pe=>typeof e=="string"&&e.startsWith(t),Nje=Pje("--"),ifr=Pje("var(--"),vle=t=>ifr(t)?afr.test(t.split("/*")[0].trim()):!1,afr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Bje=(t,e)=>e&&typeof t=="number"?e.transform(t):t,jv=(t,e,r)=>r>e?e:rtypeof t=="number",parse:parseFloat,transform:t=>t},R6={...wE,transform:t=>jv(0,1,t)},dQ={...wE,default:1},D6=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ix=D6("deg"),gm=D6("%"),fn=D6("px"),ofr=D6("vh"),sfr=D6("vw"),$je={...gm,parse:t=>gm.parse(t)/100,transform:t=>gm.transform(t*100)},lfr={borderWidth:fn,borderTopWidth:fn,borderRightWidth:fn,borderBottomWidth:fn,borderLeftWidth:fn,borderRadius:fn,radius:fn,borderTopLeftRadius:fn,borderTopRightRadius:fn,borderBottomRightRadius:fn,borderBottomLeftRadius:fn,width:fn,maxWidth:fn,height:fn,maxHeight:fn,top:fn,right:fn,bottom:fn,left:fn,padding:fn,paddingTop:fn,paddingRight:fn,paddingBottom:fn,paddingLeft:fn,margin:fn,marginTop:fn,marginRight:fn,marginBottom:fn,marginLeft:fn,backgroundPositionX:fn,backgroundPositionY:fn},cfr={rotate:ix,rotateX:ix,rotateY:ix,rotateZ:ix,scale:dQ,scaleX:dQ,scaleY:dQ,scaleZ:dQ,skew:ix,skewX:ix,skewY:ix,distance:fn,translateX:fn,translateY:fn,translateZ:fn,x:fn,y:fn,z:fn,perspective:fn,transformPerspective:fn,opacity:R6,originX:$je,originY:$je,originZ:fn},Fje={...wE,transform:Math.round},yle={...lfr,...cfr,zIndex:Fje,size:fn,fillOpacity:R6,strokeOpacity:R6,numOctaves:Fje},ufr={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},hfr=xE.length;function dfr(t,e,r){let n="",i=!0;for(let a=0;a({style:{},transform:{},transformOrigin:{},vars:{}}),Uje=()=>({...wle(),attrs:{}}),Ale=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Vje(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 Qje=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 Gje(t,e,r,n){Vje(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(Qje.has(i)?i:dle(i),e.attrs[i])}const fQ={};function vfr(t){Object.assign(fQ,t)}function Hje(t,{layout:e,layoutId:r}){return yA.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!fQ[t]||t==="opacity")}function Sle(t,e,r){var n;const{style:i}=t,a={};for(const o in i)(Fc(i[o])||e.style&&Fc(e.style[o])||Hje(o,t)||((n=r==null?void 0:r.getValue(o))===null||n===void 0?void 0:n.liveStyle)!==void 0)&&(a[o]=i[o]);return a}function Wje(t,e,r){const n=Sle(t,e,r);for(const i in t)if(Fc(t[i])||Fc(e[i])){const a=xE.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[a]=t[i]}return n}function yfr(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 Yje=["x","y","width","height","cx","cy","r"],bfr={useVisualState:Ije({scrapeMotionValuesFromProps:Wje,createRenderState:Uje,onUpdate:({props:t,prevProps:e,current:r,renderState:n,latestValues:i})=>{if(!r)return;let a=!!t.drag;if(!a){for(const s in i)if(yA.has(s)){a=!0;break}}if(!a)return;let o=!e;if(e)for(let s=0;s{yfr(r,n),Ja.render(()=>{xle(n,i,Ale(r.tagName),t.transformTemplate),Gje(r,n)})})}})},xfr={useVisualState:Ije({scrapeMotionValuesFromProps:Sle,createRenderState:wle})};function qje(t,e,r){for(const n in e)!Fc(e[n])&&!Hje(n,r)&&(t[n]=e[n])}function wfr({transformTemplate:t},e){return j.useMemo(()=>{const r=wle();return ble(r,e,t),Object.assign({},r.vars,r.style)},[e])}function Afr(t,e){const r=t.style||{},n={};return qje(n,r,t),Object.assign(n,wfr(t,e)),n}function Sfr(t,e){const r={},n=Afr(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 Tfr(t,e,r,n){const i=j.useMemo(()=>{const a=Uje();return xle(a,e,Ale(n),t.transformTemplate),{...a.attrs,style:{...a.style}}},[e]);if(t.style){const a={};qje(a,t.style,t),i.style={...a,...i.style}}return i}function Cfr(t=!1){return(r,n,i,{latestValues:a},o)=>{const l=(ple(r)?Tfr:Sfr)(n,a,o,r),u=Udr(n,typeof r=="string",t),h=r!==j.Fragment?{...u,...l,ref:i}:{},{children:d}=n,f=j.useMemo(()=>Fc(d)?d.get():d,[d]);return j.createElement(r,{...h,children:f})}}function Ofr(t,e){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...ple(n)?bfr:xfr,preloadedFeatures:t,useRender:Cfr(i),createVisualElement:e,Component:n};return jdr(o)}}function jje(t,e){if(!Array.isArray(e))return!1;const r=e.length;if(r!==t.length)return!1;for(let n=0;n(gQ===void 0&&mm.set(oc.isProcessing||Pdr.useManualTiming?oc.timestamp:performance.now()),gQ),set:t=>{gQ=t,queueMicrotask(kfr)}};function Cle(t,e){t.indexOf(e)===-1&&t.push(e)}function Ole(t,e){const r=t.indexOf(e);r>-1&&t.splice(r,1)}class kle{constructor(){this.subscriptions=[]}add(e){return Cle(this.subscriptions,e),()=>Ole(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 _fr{constructor(e,r={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(n,i=!0)=>{const a=mm.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=mm.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Efr(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 kle);const n=this.events[e].add(r);return e==="change"?()=>{n(),Ja.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=mm.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Zje)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,Zje);return Kje(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 L6(t,e){return new _fr(t,e)}function Rfr(t,e,r){t.hasValue(e)?t.getValue(e).set(r):t.addValue(e,L6(r))}function Dfr(t,e){const r=pQ(t,e);let{transitionEnd:n={},transition:i={},...a}=r||{};a={...a,...n};for(const o in a){const s=tfr(a[o]);Rfr(t,o,s)}}function Lfr(t){return!!(Fc(t)&&t.add)}function Ele(t,e){const r=t.getValue("willChange");if(Lfr(r))return r.add(e)}function Jje(t){return t.props[Rje]}function _le(t){let e;return()=>(e===void 0&&(e=t()),e)}const Mfr=_le(()=>window.ScrollTimeline!==void 0);class Ifr{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(Mfr()&&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 Pfr extends Ifr{then(e,r){return Promise.all(this.animations).then(e).catch(r)}}const Xv=t=>t*1e3,Kv=t=>t/1e3;function Rle(t){return typeof t=="function"}function eXe(t,e){t.timeline=e,t.onfinish=null}const Dle=t=>Array.isArray(t)&&typeof t[0]=="number",Nfr={linearEasing:void 0};function Bfr(t,e){const r=_le(t);return()=>{var n;return(n=Nfr[e])!==null&&n!==void 0?n:r()}}const mQ=Bfr(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),AE=(t,e,r)=>{const n=e-t;return n===0?1:(r-t)/n},tXe=(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})`,Lle={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:M6([0,.65,.55,1]),circOut:M6([.55,0,1,.45]),backIn:M6([.31,.01,.66,-.59]),backOut:M6([.33,1.53,.69,.99])};function nXe(t,e){if(t)return typeof t=="function"&&mQ()?tXe(t,e):Dle(t)?M6(t):Array.isArray(t)?t.map(r=>nXe(r,e)||Lle.easeOut):Lle[t]}const iXe=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,$fr=1e-7,Ffr=12;function zfr(t,e,r,n,i){let a,o,s=0;do o=e+(r-e)/2,a=iXe(o,n,i)-t,a>0?r=o:e=o;while(Math.abs(a)>$fr&&++szfr(a,0,1,t,r);return a=>a===0||a===1?a:iXe(i(a),e,n)}const aXe=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,oXe=t=>e=>1-t(1-e),sXe=I6(.33,1.53,.69,.99),Mle=oXe(sXe),lXe=aXe(Mle),cXe=t=>(t*=2)<1?.5*Mle(t):.5*(2-Math.pow(2,-10*(t-1))),Ile=t=>1-Math.sin(Math.acos(t)),uXe=oXe(Ile),hXe=aXe(Ile),dXe=t=>/^0[^.\s]+$/u.test(t);function Ufr(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||dXe(t):!0}const P6=t=>Math.round(t*1e5)/1e5,Ple=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Vfr(t){return t==null}const Qfr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Nle=(t,e)=>r=>!!(typeof r=="string"&&Qfr.test(r)&&r.startsWith(t)||e&&!Vfr(r)&&Object.prototype.hasOwnProperty.call(r,e)),fXe=(t,e,r)=>n=>{if(typeof n!="string")return n;const[i,a,o,s]=n.match(Ple);return{[t]:parseFloat(i),[e]:parseFloat(a),[r]:parseFloat(o),alpha:s!==void 0?parseFloat(s):1}},Gfr=t=>jv(0,255,t),Ble={...wE,transform:t=>Math.round(Gfr(t))},bA={test:Nle("rgb","red"),parse:fXe("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+Ble.transform(t)+", "+Ble.transform(e)+", "+Ble.transform(r)+", "+P6(R6.transform(n))+")"};function Hfr(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 $le={test:Nle("#"),parse:Hfr,transform:bA.transform},SE={test:Nle("hsl","hue"),parse:fXe("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+gm.transform(P6(e))+", "+gm.transform(P6(r))+", "+P6(R6.transform(n))+")"},zc={test:t=>bA.test(t)||$le.test(t)||SE.test(t),parse:t=>bA.test(t)?bA.parse(t):SE.test(t)?SE.parse(t):$le.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?bA.transform(t):SE.transform(t)},Wfr=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Yfr(t){var e,r;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Ple))===null||e===void 0?void 0:e.length)||0)+(((r=t.match(Wfr))===null||r===void 0?void 0:r.length)||0)>0}const pXe="number",gXe="color",qfr="var",jfr="var(",mXe="${}",Xfr=/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 N6(t){const e=t.toString(),r=[],n={color:[],number:[],var:[]},i=[];let a=0;const s=e.replace(Xfr,l=>(zc.test(l)?(n.color.push(a),i.push(gXe),r.push(zc.parse(l))):l.startsWith(jfr)?(n.var.push(a),i.push(qfr),r.push(l)):(n.number.push(a),i.push(pXe),r.push(parseFloat(l))),++a,mXe)).split(mXe);return{values:r,split:s,indexes:n,types:i}}function vXe(t){return N6(t).values}function yXe(t){const{split:e,types:r}=N6(t),n=e.length;return i=>{let a="";for(let o=0;otypeof t=="number"?0:t;function Zfr(t){const e=vXe(t);return yXe(t)(e.map(Kfr))}const ax={test:Yfr,parse:vXe,createTransformer:yXe,getAnimatableNone:Zfr},Jfr=new Set(["brightness","contrast","saturate","opacity"]);function epr(t){const[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=r.match(Ple)||[];if(!n)return t;const i=r.replace(n,"");let a=Jfr.has(e)?1:0;return n!==r&&(a*=100),e+"("+a+i+")"}const tpr=/\b([a-z-]*)\(.*?\)/gu,Fle={...ax,getAnimatableNone:t=>{const e=t.match(tpr);return e?e.map(epr).join(" "):t}},rpr={...yle,color:zc,backgroundColor:zc,outlineColor:zc,fill:zc,stroke:zc,borderColor:zc,borderTopColor:zc,borderRightColor:zc,borderBottomColor:zc,borderLeftColor:zc,filter:Fle,WebkitFilter:Fle},zle=t=>rpr[t];function bXe(t,e){let r=zle(t);return r!==Fle&&(r=ax),r.getAnimatableNone?r.getAnimatableNone(e):void 0}const npr=new Set(["auto","none","0"]);function ipr(t,e,r){let n=0,i;for(;nt===wE||t===fn,wXe=(t,e)=>parseFloat(t.split(", ")[e]),AXe=(t,e)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/u);if(i)return wXe(i[1],e);{const a=n.match(/^matrix\((.+)\)$/u);return a?wXe(a[1],t):0}},apr=new Set(["x","y","z"]),opr=xE.filter(t=>!apr.has(t));function spr(t){const e=[];return opr.forEach(r=>{const n=t.getValue(r);n!==void 0&&(e.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),e}const TE={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:AXe(4,13),y:AXe(5,14)};TE.translateX=TE.x,TE.translateY=TE.y;const xA=new Set;let Ule=!1,Vle=!1;function SXe(){if(Vle){const t=Array.from(xA).filter(n=>n.needsMeasurement),e=new Set(t.map(n=>n.element)),r=new Map;e.forEach(n=>{const i=spr(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,o])=>{var s;(s=n.getValue(a))===null||s===void 0||s.set(o)})}),t.forEach(n=>n.measureEndState()),t.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}Vle=!1,Ule=!1,xA.forEach(t=>t.complete()),xA.clear()}function TXe(){xA.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Vle=!0)})}function lpr(){TXe(),SXe()}class Qle{constructor(e,r,n,i,a,o=!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=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(xA.add(this),Ule||(Ule=!0,Ja.read(TXe),Ja.resolveKeyframes(SXe))):(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),cpr=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function upr(t){const e=cpr.exec(t);if(!e)return[,];const[,r,n,i]=e;return[`--${r??n}`,i]}function OXe(t,e,r=1){const[n,i]=upr(t);if(!n)return;const a=window.getComputedStyle(e).getPropertyValue(n);if(a){const o=a.trim();return CXe(o)?parseFloat(o):o}return vle(i)?OXe(i,e,r+1):i}const kXe=t=>e=>e.test(t),EXe=[wE,fn,gm,ix,sfr,ofr,{test:t=>t==="auto",parse:t=>t}],_Xe=t=>EXe.find(kXe(t));class RXe extends Qle{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 DXe=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(ax.test(t)||t==="0")&&!t.startsWith("url("));function hpr(t){const e=t[0];if(t.length===1)return!0;for(let r=0;rt!==null;function vQ(t,{repeat:e,repeatType:r="loop"},n){const i=t.filter(fpr),a=e&&r!=="loop"&&e%2===1?0:i.length-1;return!a||n===void 0?i[a]:n}const ppr=40;class LXe{constructor({autoplay:e=!0,delay:r=0,type:n="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=mm.now(),this.options={autoplay:e,delay:r,type:n,repeat:i,repeatDelay:a,repeatType:o,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>ppr?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&lpr(),this._resolved}onKeyframesResolved(e,r){this.resolvedAt=mm.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:a,delay:o,onComplete:s,onUpdate:l,isGenerator:u}=this.options;if(!u&&!dpr(e,n,i,a))if(o)this.options.duration=0;else{l&&l(vQ(e,this.options,r)),s&&s(),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 Gle=2e4;function MXe(t){let e=0;const r=50;let n=t.next(e);for(;!n.done&&e=Gle?1/0:e}const ko=(t,e,r)=>t+(e-t)*r;function Hle(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 gpr({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,a=0,o=0;if(!e)i=a=o=r;else{const s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;i=Hle(l,s,t+1/3),a=Hle(l,s,t),o=Hle(l,s,t-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:n}}function yQ(t,e){return r=>r>0?e:t}const Wle=(t,e,r)=>{const n=t*t,i=r*(e*e-n)+n;return i<0?0:Math.sqrt(i)},mpr=[$le,bA,SE],vpr=t=>mpr.find(e=>e.test(t));function IXe(t){const e=vpr(t);if(!e)return!1;let r=e.parse(t);return e===SE&&(r=gpr(r)),r}const PXe=(t,e)=>{const r=IXe(t),n=IXe(e);if(!r||!n)return yQ(t,e);const i={...r};return a=>(i.red=Wle(r.red,n.red,a),i.green=Wle(r.green,n.green,a),i.blue=Wle(r.blue,n.blue,a),i.alpha=ko(r.alpha,n.alpha,a),bA.transform(i))},ypr=(t,e)=>r=>e(t(r)),B6=(...t)=>t.reduce(ypr),Yle=new Set(["none","hidden"]);function bpr(t,e){return Yle.has(t)?r=>r<=0?t:e:r=>r>=1?e:t}function xpr(t,e){return r=>ko(t,e,r)}function qle(t){return typeof t=="number"?xpr:typeof t=="string"?vle(t)?yQ:zc.test(t)?PXe:Spr:Array.isArray(t)?NXe:typeof t=="object"?zc.test(t)?PXe:wpr:yQ}function NXe(t,e){const r=[...t],n=r.length,i=t.map((a,o)=>qle(a)(a,e[o]));return a=>{for(let o=0;o{for(const a in n)r[a]=n[a](i);return r}}function Apr(t,e){var r;const n=[],i={color:0,var:0,number:0};for(let a=0;a{const r=ax.createTransformer(e),n=N6(t),i=N6(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?Yle.has(t)&&!i.values.length||Yle.has(e)&&!n.values.length?bpr(t,e):B6(NXe(Apr(n,i),i.values),r):yQ(t,e)};function BXe(t,e,r){return typeof t=="number"&&typeof e=="number"&&typeof r=="number"?ko(t,e,r):qle(t)(t,e)}const Tpr=5;function $Xe(t,e,r){const n=Math.max(e-Tpr,0);return Kje(r-t(n),e-n)}const Vo={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},jle=.001;function Cpr({duration:t=Vo.duration,bounce:e=Vo.bounce,velocity:r=Vo.velocity,mass:n=Vo.mass}){let i,a,o=1-e;o=jv(Vo.minDamping,Vo.maxDamping,o),t=jv(Vo.minDuration,Vo.maxDuration,Kv(t)),o<1?(i=u=>{const h=u*o,d=h*t,f=h-r,p=Xle(u,o),g=Math.exp(-d);return jle-f/p*g},a=u=>{const d=u*o*t,f=d*r+r,p=Math.pow(o,2)*Math.pow(u,2)*t,g=Math.exp(-d),m=Xle(Math.pow(u,2),o);return(-i(u)+jle>0?-1:1)*((f-p)*g)/m}):(i=u=>{const h=Math.exp(-u*t),d=(u-r)*t+1;return-jle+h*d},a=u=>{const h=Math.exp(-u*t),d=(r-u)*(t*t);return h*d});const s=5/t,l=kpr(i,a,s);if(t=Xv(t),isNaN(l))return{stiffness:Vo.stiffness,damping:Vo.damping,duration:t};{const u=Math.pow(l,2)*n;return{stiffness:u,damping:o*2*Math.sqrt(n*u),duration:t}}}const Opr=12;function kpr(t,e,r){let n=r;for(let i=1;it[r]!==void 0)}function Rpr(t){let e={velocity:Vo.velocity,stiffness:Vo.stiffness,damping:Vo.damping,mass:Vo.mass,isResolvedFromDuration:!1,...t};if(!FXe(t,_pr)&&FXe(t,Epr))if(t.visualDuration){const r=t.visualDuration,n=2*Math.PI/(r*1.2),i=n*n,a=2*jv(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:Vo.mass,stiffness:i,damping:a}}else{const r=Cpr(t);e={...e,...r,mass:Vo.mass},e.isResolvedFromDuration=!0}return e}function zXe(t=Vo.visualDuration,e=Vo.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],o=r.keyframes[r.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:u,mass:h,duration:d,velocity:f,isResolvedFromDuration:p}=Rpr({...r,velocity:-Kv(r.velocity||0)}),g=f||0,m=u/(2*Math.sqrt(l*h)),v=o-a,y=Kv(Math.sqrt(l/h)),b=Math.abs(v)<5;n||(n=b?Vo.restSpeed.granular:Vo.restSpeed.default),i||(i=b?Vo.restDelta.granular:Vo.restDelta.default);let x;if(m<1){const A=Xle(y,m);x=S=>{const T=Math.exp(-m*y*S);return o-T*((g+m*y*v)/A*Math.sin(A*S)+v*Math.cos(A*S))}}else if(m===1)x=A=>o-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),C=Math.min(A*S,300);return o-T*((g+m*y*v)*Math.sinh(C)+A*v*Math.cosh(C))/A}}const w={calculatedDuration:p&&d||null,next:A=>{const S=x(A);if(p)s.done=A>=d;else{let T=0;m<1&&(T=A===0?Xv(g):$Xe(x,A,S));const C=Math.abs(T)<=n,k=Math.abs(o-S)<=i;s.done=C&&k}return s.value=s.done?o:S,s},toString:()=>{const A=Math.min(MXe(w),Gle),S=tXe(T=>w.next(A*T).value,A,30);return A+"ms "+S}};return w}function UXe({keyframes:t,velocity:e=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:l,restDelta:u=.5,restSpeed:h}){const d=t[0],f={done:!1,value:d},p=C=>s!==void 0&&Cl,g=C=>s===void 0?l:l===void 0||Math.abs(s-C)-m*Math.exp(-C/n),x=C=>y+b(C),w=C=>{const k=b(C),E=x(C);f.done=Math.abs(k)<=u,f.value=f.done?y:E};let A,S;const T=C=>{p(f.value)&&(A=C,S=zXe({keyframes:[f.value,g(f.value)],velocity:$Xe(x,C,f.value),damping:i,stiffness:a,restDelta:u,restSpeed:h}))};return T(0),{calculatedDuration:null,next:C=>{let k=!1;return!S&&A===void 0&&(k=!0,w(C),T(C)),A!==void 0&&C>=A?S.next(C-A):(!k&&w(C),f)}}}const Dpr=I6(.42,0,1,1),Lpr=I6(0,0,.58,1),VXe=I6(.42,0,.58,1),Mpr=t=>Array.isArray(t)&&typeof t[0]!="number",Ipr={linear:_d,easeIn:Dpr,easeInOut:VXe,easeOut:Lpr,circIn:Ile,circInOut:hXe,circOut:uXe,backIn:Mle,backInOut:lXe,backOut:sXe,anticipate:cXe},QXe=t=>{if(Dle(t)){Sje(t.length===4);const[e,r,n,i]=t;return I6(e,r,n,i)}else if(typeof t=="string")return Ipr[t];return t};function Ppr(t,e,r){const n=[],i=r||BXe,a=t.length-1;for(let o=0;oe[0];if(a===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[a-1]&&(t=[...t].reverse(),e=[...e].reverse());const s=Ppr(e,n,i),l=s.length,u=h=>{if(o&&h1)for(;du(jv(t[0],t[a-1],h)):u}function Bpr(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=AE(0,e,n);t.push(ko(r,1,i))}}function $pr(t){const e=[0];return Bpr(e,t.length-1),e}function Fpr(t,e){return t.map(r=>r*e)}function zpr(t,e){return t.map(()=>e||VXe).splice(0,t.length-1)}function bQ({duration:t=300,keyframes:e,times:r,ease:n="easeInOut"}){const i=Mpr(n)?n.map(QXe):QXe(n),a={done:!1,value:e[0]},o=Fpr(r&&r.length===e.length?r:$pr(e),t),s=Npr(o,e,{ease:Array.isArray(i)?i:zpr(e,i)});return{calculatedDuration:t,next:l=>(a.value=s(l),a.done=l>=t,a)}}const Upr=t=>{const e=({timestamp:r})=>t(r);return{start:()=>Ja.update(e,!0),stop:()=>nx(e),now:()=>oc.isProcessing?oc.timestamp:mm.now()}},Vpr={decay:UXe,inertia:UXe,tween:bQ,keyframes:bQ,spring:zXe},Qpr=t=>t/100;class Kle extends LXe{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,o=(i==null?void 0:i.KeyframeResolver)||Qle,s=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new o(a,s,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:o=0}=this.options,s=Rle(r)?r:Vpr[r]||bQ;let l,u;s!==bQ&&typeof e[0]!="number"&&(l=B6(Qpr,BXe(e[0],e[1])),e=[0,100]);const h=s({...this.options,keyframes:e});a==="mirror"&&(u=s({...this.options,keyframes:[...e].reverse(),velocity:-o})),h.calculatedDuration===null&&(h.calculatedDuration=MXe(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:C}=this.options;return{done:!0,value:C[C.length-1]}}const{finalKeyframe:i,generator:a,mirroredGenerator:o,mapPercentToKeyframes:s,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 C=Math.min(this.currentTime,h)/d;let k=Math.floor(C),E=C%1;!E&&C>=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=o)),x=jv(0,1,E)*d}const A=b?{done:!1,value:l[0]}:w.next(x);s&&(A.value=s(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=vQ(l,this.options,i)),v&&v(A.value),T&&this.finish(),A}get duration(){const{resolved:e}=this;return e?Kv(e.calculatedDuration):0}get time(){return Kv(this.currentTime)}set time(e){e=Xv(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=Kv(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Upr,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 Gpr=new Set(["opacity","clipPath","filter","transform"]);function Hpr(t,e,r,{delay:n=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:s="easeInOut",times:l}={}){const u={[e]:r};l&&(u.offset=l);const h=nXe(s,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:o==="reverse"?"alternate":"normal"})}const Wpr=_le(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),xQ=10,Ypr=2e4;function qpr(t){return Rle(t.type)||t.type==="spring"||!rXe(t.ease)}function jpr(t,e){const r=new Kle({...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(o,s),r,n,i),this.resolver.scheduleResolve()}initPlayback(e,r){let{duration:n=300,times:i,ease:a,type:o,motionValue:s,name:l,startTime:u}=this.options;if(!s.owner||!s.owner.current)return!1;if(typeof a=="string"&&mQ()&&Xpr(a)&&(a=GXe[a]),qpr(this.options)){const{onComplete:d,onUpdate:f,motionValue:p,element:g,...m}=this.options,v=jpr(e,m);e=v.keyframes,e.length===1&&(e[1]=e[0]),n=v.duration,i=v.times,a=v.ease,o="keyframes"}const h=Hpr(s.owner.current,l,e,{...this.options,duration:n,times:i,ease:a});return h.startTime=u??this.calcStartTime(),this.pendingTimeline?(eXe(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:d}=this.options;s.set(vQ(e,this.options,r)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:n,times:i,type:o,ease:a,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:r}=e;return Kv(r)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:r}=e;return Kv(r.currentTime||0)}set time(e){const{resolved:r}=this;if(!r)return;const{animation:n}=r;n.currentTime=Xv(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 _d;const{animation:n}=r;eXe(n,e)}return _d}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:o,times:s}=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 Kle({...p,keyframes:n,duration:i,type:a,ease:o,times:s,isGenerator:!0}),m=Xv(this.time);u.setWithVelocity(g.sample(m-xQ).value,g.sample(m).value,xQ)}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:o,type:s}=e;if(!r||!r.owner||!(r.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=r.owner.getProps();return Wpr()&&n&&Gpr.has(n)&&!l&&!u&&!i&&a!=="mirror"&&o!==0&&s!=="inertia"}}const Kpr={type:"spring",stiffness:500,damping:25,restSpeed:10},Zpr=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Jpr={type:"keyframes",duration:.8},egr={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},tgr=(t,{keyframes:e})=>e.length>2?Jpr:yA.has(t)?t.startsWith("scale")?Zpr(e[1]):Kpr:egr;function rgr({when:t,delay:e,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:l,elapsed:u,...h}){return!!Object.keys(h).length}const Zle=(t,e,r,n={},i,a)=>o=>{const s=Tle(n,t)||{},l=s.delay||n.delay||0;let{elapsed:u=0}=n;u=u-Xv(l);let h={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:e.getVelocity(),...s,delay:-u,onUpdate:f=>{e.set(f),s.onUpdate&&s.onUpdate(f)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:t,motionValue:e,element:a?void 0:i};rgr(s)||(h={...h,...tgr(t,h)}),h.duration&&(h.duration=Xv(h.duration)),h.repeatDelay&&(h.repeatDelay=Xv(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=vQ(h.keyframes,s);if(f!==void 0)return Ja.update(()=>{h.onUpdate(f),h.onComplete()}),new Pfr([])}return!a&&HXe.supports(h)?new HXe(h):new Kle(h)};function ngr({protectedKeys:t,needsAnimating:e},r){const n=t.hasOwnProperty(r)&&e[r]!==!0;return e[r]=!1,n}function WXe(t,e,{delay:r=0,transitionOverride:n,type:i}={}){var a;let{transition:o=t.getDefaultTransition(),transitionEnd:s,...l}=e;n&&(o=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&&ngr(h,d))continue;const g={delay:r,...Tle(o||{},d)};let m=!1;if(window.MotionHandoffAnimation){const y=Jje(t);if(y){const b=window.MotionHandoffAnimation(y,d,Ja);b!==null&&(g.startTime=b,m=!0)}}Ele(t,d),f.start(Zle(d,f,p,t.shouldReduceMotion&&Xje.has(d)?{type:!1}:g,t,m));const v=f.animation;v&&u.push(v)}return s&&Promise.all(u).then(()=>{Ja.update(()=>{s&&Dfr(t,s)})}),u}function Jle(t,e,r={}){var n;const i=pQ(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 o=i?()=>Promise.all(WXe(t,i,r)):()=>Promise.resolve(),s=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:h=0,staggerChildren:d,staggerDirection:f}=a;return igr(t,e,h+u,d,f,r)}:()=>Promise.resolve(),{when:l}=a;if(l){const[u,h]=l==="beforeChildren"?[o,s]:[s,o];return u().then(()=>h())}else return Promise.all([o(),s(r.delay)])}function igr(t,e,r=0,n=0,i=1,a){const o=[],s=(t.variantChildren.size-1)*n,l=i===1?(u=0)=>u*n:(u=0)=>s-u*n;return Array.from(t.variantChildren).sort(agr).forEach((u,h)=>{u.notify("AnimationStart",e),o.push(Jle(u,e,{...a,delay:r+l(h)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(o)}function agr(t,e){return t.sortNodePosition(e)}function ogr(t,e,r={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const i=e.map(a=>Jle(t,a,r));n=Promise.all(i)}else if(typeof e=="string")n=Jle(t,e,r);else{const i=typeof e=="function"?pQ(t,e,r.custom):e;n=Promise.all(WXe(t,i,r))}return n.then(()=>{t.notify("AnimationComplete",e)})}const sgr=hle.length;function YXe(t){if(!t)return;if(!t.isControllingVariants){const r=t.parent?YXe(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})=>ogr(t,r,n)))}function hgr(t){let e=ugr(t),r=qXe(),n=!0;const i=l=>(u,h)=>{var d;const f=pQ(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 o(l){const{props:u}=t,h=YXe(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:P={}}=b,L={...P,..._},R=I=>{C=!0,f.has(I)&&(k=!0,f.delete(I)),b.needsAnimating[I]=!0;const N=t.getValue(I);N&&(N.liveStyle=!1)};for(const I in L){const N=_[I],F=P[I];if(p.hasOwnProperty(I))continue;let B=!1;mle(N)&&mle(F)?B=!jje(N,F):B=N!==F,B?N!=null?R(I):f.add(I):N!==void 0&&f.has(I)?R(I):b.protectedKeys[I]=!0}b.prevProp=x,b.prevResolvedValues=_,b.isActive&&(p={...p,..._}),n&&t.blockInitialAnimation&&(C=!1),C&&(!(S&&T)||k)&&d.push(...E.map(I=>({animation:I,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 s(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=o(l);for(const f in r)r[f].protectedKeys={};return d}return{animateChanges:o,setActive:s,setAnimateFunction:a,getState:()=>r,reset:()=>{r=qXe(),n=!0}}}function dgr(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!jje(e,t):!1}function wA(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function qXe(){return{animate:wA(!0),whileInView:wA(),whileHover:wA(),whileTap:wA(),whileDrag:wA(),whileFocus:wA(),exit:wA()}}class ox{constructor(e){this.isMounted=!1,this.node=e}update(){}}class fgr extends ox{constructor(e){super(e),e.animationState||(e.animationState=hgr(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();cQ(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 pgr=0;class ggr extends ox{constructor(){super(...arguments),this.id=pgr++}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 mgr={animation:{Feature:fgr},exit:{Feature:ggr}},Xp={x:!1,y:!1};function jXe(){return Xp.x||Xp.y}function vgr(t){return t==="x"||t==="y"?Xp[t]?null:(Xp[t]=!0,()=>{Xp[t]=!1}):Xp.x||Xp.y?null:(Xp.x=Xp.y=!0,()=>{Xp.x=Xp.y=!1})}const ece=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function $6(t,e,r,n={passive:!0}){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r)}function F6(t){return{point:{x:t.pageX,y:t.pageY}}}const ygr=t=>e=>ece(e)&&t(e,F6(e));function z6(t,e,r,n){return $6(t,e,ygr(r),n)}const XXe=(t,e)=>Math.abs(t-e);function bgr(t,e){const r=XXe(t.x,e.x),n=XXe(t.y,e.y);return Math.sqrt(r**2+n**2)}class KXe{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=rce(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=bgr(d.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:g}=d,{timestamp:m}=oc;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=tce(f,this.transformPagePoint),Ja.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=rce(d.type==="pointercancel"?this.lastMoveEventInfo:tce(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,v),g&&g(d,v)},!ece(e))return;this.dragSnapToOrigin=a,this.handlers=r,this.transformPagePoint=n,this.contextWindow=i||window;const o=F6(e),s=tce(o,this.transformPagePoint),{point:l}=s,{timestamp:u}=oc;this.history=[{...l,timestamp:u}];const{onSessionStart:h}=r;h&&h(e,rce(s,this.history)),this.removeListeners=B6(z6(this.contextWindow,"pointermove",this.handlePointerMove),z6(this.contextWindow,"pointerup",this.handlePointerUp),z6(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),nx(this.updatePoint)}}function tce(t,e){return e?{point:e(t.point)}:t}function ZXe(t,e){return{x:t.x-e.x,y:t.y-e.y}}function rce({point:t},e){return{point:t,delta:ZXe(t,JXe(e)),offset:ZXe(t,xgr(e)),velocity:wgr(e,.1)}}function xgr(t){return t[0]}function JXe(t){return t[t.length-1]}function wgr(t,e){if(t.length<2)return{x:0,y:0};let r=t.length-1,n=null;const i=JXe(t);for(;r>=0&&(n=t[r],!(i.timestamp-n.timestamp>Xv(e)));)r--;if(!n)return{x:0,y:0};const a=Kv(i.timestamp-n.timestamp);if(a===0)return{x:0,y:0};const o={x:(i.x-n.x)/a,y:(i.y-n.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const eKe=1e-4,Agr=1-eKe,Sgr=1+eKe,tKe=.01,Tgr=0-tKe,Cgr=0+tKe;function Rd(t){return t.max-t.min}function Ogr(t,e,r){return Math.abs(t-e)<=r}function rKe(t,e,r,n=.5){t.origin=n,t.originPoint=ko(e.min,e.max,t.origin),t.scale=Rd(r)/Rd(e),t.translate=ko(r.min,r.max,t.origin)-t.originPoint,(t.scale>=Agr&&t.scale<=Sgr||isNaN(t.scale))&&(t.scale=1),(t.translate>=Tgr&&t.translate<=Cgr||isNaN(t.translate))&&(t.translate=0)}function U6(t,e,r,n){rKe(t.x,e.x,r.x,n?n.originX:void 0),rKe(t.y,e.y,r.y,n?n.originY:void 0)}function nKe(t,e,r){t.min=r.min+e.min,t.max=t.min+Rd(e)}function kgr(t,e,r){nKe(t.x,e.x,r.x),nKe(t.y,e.y,r.y)}function iKe(t,e,r){t.min=e.min-r.min,t.max=t.min+Rd(e)}function V6(t,e,r){iKe(t.x,e.x,r.x),iKe(t.y,e.y,r.y)}function Egr(t,{min:e,max:r},n){return e!==void 0&&tr&&(t=n?ko(r,t,n.max):Math.min(t,r)),t}function aKe(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 _gr(t,{top:e,left:r,bottom:n,right:i}){return{x:aKe(t.x,r,i),y:aKe(t.y,e,n)}}function oKe(t,e){let r=e.min-t.min,n=e.max-t.max;return e.max-e.minn?r=AE(e.min,e.max-n,t.min):n>i&&(r=AE(t.min,t.max-i,e.min)),jv(0,1,r)}function Lgr(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 nce=.35;function Mgr(t=nce){return t===!1?t=0:t===!0&&(t=nce),{x:sKe(t,"left","right"),y:sKe(t,"top","bottom")}}function sKe(t,e,r){return{min:lKe(t,e),max:lKe(t,r)}}function lKe(t,e){return typeof t=="number"?t:t[e]||0}const cKe=()=>({translate:0,scale:1,origin:0,originPoint:0}),CE=()=>({x:cKe(),y:cKe()}),uKe=()=>({min:0,max:0}),ls=()=>({x:uKe(),y:uKe()});function Ff(t){return[t("x"),t("y")]}function hKe({top:t,left:e,right:r,bottom:n}){return{x:{min:e,max:r},y:{min:t,max:n}}}function Igr({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Pgr(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 ice(t){return t===void 0||t===1}function ace({scale:t,scaleX:e,scaleY:r}){return!ice(t)||!ice(e)||!ice(r)}function AA(t){return ace(t)||dKe(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function dKe(t){return fKe(t.x)||fKe(t.y)}function fKe(t){return t&&t!=="0%"}function wQ(t,e,r){const n=t-r,i=e*n;return r+i}function pKe(t,e,r,n,i){return i!==void 0&&(t=wQ(t,i,n)),wQ(t,r,n)+e}function oce(t,e=0,r=1,n,i){t.min=pKe(t.min,e,r,n,i),t.max=pKe(t.max,e,r,n,i)}function gKe(t,{x:e,y:r}){oce(t.x,e.translate,e.scale,e.originPoint),oce(t.y,r.translate,r.scale,r.originPoint)}const mKe=.999999999999,vKe=1.0000000000001;function Ngr(t,e,r,n=!1){const i=r.length;if(!i)return;e.x=e.y=1;let a,o;for(let s=0;smKe&&(e.x=1),e.ymKe&&(e.y=1)}function OE(t,e){t.min=t.min+e,t.max=t.max+e}function yKe(t,e,r,n,i=.5){const a=ko(t.min,t.max,i);oce(t,e,r,a,n)}function kE(t,e){yKe(t.x,e.x,e.scaleX,e.scale,e.originX),yKe(t.y,e.y,e.scaleY,e.scale,e.originY)}function bKe(t,e){return hKe(Pgr(t.getBoundingClientRect(),e))}function Bgr(t,e,r){const n=bKe(t,r),{scroll:i}=e;return i&&(OE(n.x,i.offset.x),OE(n.y,i.offset.y)),n}const xKe=({current:t})=>t?t.ownerDocument.defaultView:null,$gr=new WeakMap;class Fgr{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=ls(),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(F6(h).point)},a=(h,d)=>{const{drag:f,dragPropagation:p,onDragStart:g}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=vgr(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),Ff(v=>{let y=this.getAxisMotionValue(v).get()||0;if(gm.test(y)){const{projection:b}=this.visualElement;if(b&&b.layout){const x=b.layout.layoutBox[v];x&&(y=Rd(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),g&&Ja.postRender(()=>g(h,d)),Ele(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},o=(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=zgr(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)},s=(h,d)=>this.stop(h,d),l=()=>Ff(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 KXe(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:xKe(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&&Ja.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||!AQ(e,i,this.currentDirection))return;const a=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=Egr(o,this.constraints[e],this.elastic[e])),a.set(o)}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&&bE(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&i?this.constraints=_gr(i.layoutBox,r):this.constraints=!1,this.elastic=Mgr(n),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Ff(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Lgr(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:r}=this.getProps();if(!e||!bE(e))return!1;const n=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=Bgr(n,i.root,this.visualElement.getTransformPagePoint());let o=Rgr(i.layout.layoutBox,a);if(r){const s=r(Igr(o));this.hasMutatedConstraints=!!s,s&&(o=hKe(s))}return o}startAnimation(e){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=Ff(h=>{if(!AQ(h,r,this.currentDirection))return;let d=l&&l[h]||{};o&&(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(s)}startAxisValueAnimation(e,r){const n=this.getAxisMotionValue(e);return Ele(this.visualElement,e),n.start(Zle(e,n,0,r,this.visualElement,!1))}stopAnimation(){Ff(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Ff(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){Ff(r=>{const{drag:n}=this.getProps();if(!AQ(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(r);if(i&&i.layout){const{min:o,max:s}=i.layout.layoutBox[r];a.set(e[r]-ko(o,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!bE(r)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ff(o=>{const s=this.getAxisMotionValue(o);if(s&&this.constraints!==!1){const l=s.get();i[o]=Dgr({min:l,max:l},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Ff(o=>{if(!AQ(o,e,null))return;const s=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];s.set(ko(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;$gr.set(this.visualElement,this);const e=this.visualElement.current,r=z6(e,"pointerdown",l=>{const{drag:u,dragListener:h=!0}=this.getProps();u&&h&&this.start(l)}),n=()=>{const{dragConstraints:l}=this.getProps();bE(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()),Ja.read(n);const o=$6(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ff(h=>{const d=this.getAxisMotionValue(h);d&&(this.originPoint[h]+=l[h].translate,d.set(d.get()+l[h].translate))}),this.visualElement.render())});return()=>{o(),r(),a(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:o=nce,dragMomentum:s=!0}=e;return{...e,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:a,dragElastic:o,dragMomentum:s}}}function AQ(t,e,r){return(e===!0||e===t)&&(r===null||r===t)}function zgr(t,e=10){let r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}class Ugr extends ox{constructor(e){super(e),this.removeGroupControls=_d,this.removeListeners=_d,this.controls=new Fgr(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_d}unmount(){this.removeGroupControls(),this.removeListeners()}}const wKe=t=>(e,r)=>{t&&Ja.postRender(()=>t(e,r))};class Vgr extends ox{constructor(){super(...arguments),this.removePointerDownListener=_d}onPointerDown(e){this.session=new KXe(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:xKe(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:wKe(e),onStart:wKe(r),onMove:n,onEnd:(a,o)=>{delete this.session,i&&Ja.postRender(()=>i(a,o))}}}mount(){this.removePointerDownListener=z6(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 SQ={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function AKe(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Q6={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(fn.test(t))t=parseFloat(t);else return t;const r=AKe(t,e.target.x),n=AKe(t,e.target.y);return`${r}% ${n}%`}},Qgr={correct:(t,{treeScale:e,projectionDelta:r})=>{const n=t,i=ax.parse(t);if(i.length>5)return n;const a=ax.createTransformer(t),o=typeof i[0]!="number"?1:0,s=r.x.scale*e.x,l=r.y.scale*e.y;i[0+o]/=s,i[1+o]/=l;const u=ko(s,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),a(i)}};class Ggr extends j.Component{componentDidMount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:a}=e;vfr(Hgr),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()})),SQ.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:r,visualElement:n,drag:i,isPresent:a}=this.props,o=n.projection;return o&&(o.isPresent=a,i||e.layoutDependency!==r||r===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||Ja.postRender(()=>{const s=o.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),fle.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 SKe(t){const[e,r]=xje(),n=j.useContext(ale);return H.jsx(Ggr,{...t,layoutGroup:n,switchLayoutGroup:j.useContext(Dje),isPresent:e,safeToRemove:r})}const Hgr={borderRadius:{...Q6,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Q6,borderTopRightRadius:Q6,borderBottomLeftRadius:Q6,borderBottomRightRadius:Q6,boxShadow:Qgr};function Wgr(t,e,r){const n=Fc(t)?t:L6(t);return n.start(Zle("",n,e,r)),n.animation}function Ygr(t){return t instanceof SVGElement&&t.tagName!=="svg"}const qgr=(t,e)=>t.depth-e.depth;class jgr{constructor(){this.children=[],this.isDirty=!1}add(e){Cle(this.children,e),this.isDirty=!0}remove(e){Ole(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(qgr),this.isDirty=!1,this.children.forEach(e)}}function Xgr(t,e){const r=mm.now(),n=({timestamp:i})=>{const a=i-r;a>=e&&(nx(n),t(a-e))};return Ja.read(n,!0),()=>nx(n)}const TKe=["TopLeft","TopRight","BottomLeft","BottomRight"],Kgr=TKe.length,CKe=t=>typeof t=="string"?parseFloat(t):t,OKe=t=>typeof t=="number"||fn.test(t);function Zgr(t,e,r,n,i,a){i?(t.opacity=ko(0,r.opacity!==void 0?r.opacity:1,Jgr(n)),t.opacityExit=ko(e.opacity!==void 0?e.opacity:1,0,emr(n))):a&&(t.opacity=ko(e.opacity!==void 0?e.opacity:1,r.opacity!==void 0?r.opacity:1,n));for(let o=0;one?1:r(AE(t,e,n))}function _Ke(t,e){t.min=e.min,t.max=e.max}function zf(t,e){_Ke(t.x,e.x),_Ke(t.y,e.y)}function RKe(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function DKe(t,e,r,n,i){return t-=e,t=wQ(t,1/r,n),i!==void 0&&(t=wQ(t,1/i,n)),t}function tmr(t,e=0,r=1,n=.5,i,a=t,o=t){if(gm.test(e)&&(e=parseFloat(e),e=ko(o.min,o.max,e/100)-o.min),typeof e!="number")return;let s=ko(a.min,a.max,n);t===a&&(s-=e),t.min=DKe(t.min,e,r,s,i),t.max=DKe(t.max,e,r,s,i)}function LKe(t,e,[r,n,i],a,o){tmr(t,e[r],e[n],e[i],e.scale,a,o)}const rmr=["x","scaleX","originX"],nmr=["y","scaleY","originY"];function MKe(t,e,r,n){LKe(t.x,e,rmr,r?r.x:void 0,n?n.x:void 0),LKe(t.y,e,nmr,r?r.y:void 0,n?n.y:void 0)}function IKe(t){return t.translate===0&&t.scale===1}function PKe(t){return IKe(t.x)&&IKe(t.y)}function NKe(t,e){return t.min===e.min&&t.max===e.max}function imr(t,e){return NKe(t.x,e.x)&&NKe(t.y,e.y)}function BKe(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function $Ke(t,e){return BKe(t.x,e.x)&&BKe(t.y,e.y)}function FKe(t){return Rd(t.x)/Rd(t.y)}function zKe(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class amr{constructor(){this.members=[]}add(e){Cle(this.members,e),e.scheduleRender()}remove(e){if(Ole(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 omr(t,e,r){let n="";const i=t.x.translate/e.x,a=t.y.translate/e.y,o=(r==null?void 0:r.z)||0;if((i||a||o)&&(n=`translate3d(${i}px, ${a}px, ${o}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 s=t.x.scale*e.x,l=t.y.scale*e.y;return(s!==1||l!==1)&&(n+=`scale(${s}, ${l})`),n||"none"}const SA={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},G6=typeof window<"u"&&window.MotionDebug!==void 0,sce=["","X","Y","Z"],smr={visibility:"hidden"},UKe=1e3;let lmr=0;function lce(t,e,r,n){const{latestValues:i}=e;i[t]&&(r[t]=i[t],e.setStaticValue(t,0),n&&(n[t]=0))}function VKe(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const r=Jje(e);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:i,layoutId:a}=t.options;window.MotionCancelOptimisedAnimation(r,"transform",Ja,!(i||a))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&VKe(n)}function QKe({attachResizeListener:t,defaultParent:e,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o={},s=e==null?void 0:e()){this.id=lmr++,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,G6&&(SA.totalNodes=SA.resolvedTargetDeltas=SA.recalculatedProjection=0),this.nodes.forEach(hmr),this.nodes.forEach(mmr),this.nodes.forEach(vmr),this.nodes.forEach(dmr),G6&&window.MotionDebug.record(SA)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=Xgr(f,250),SQ.hasAnimatedSinceResize&&(SQ.hasAnimatedSinceResize=!1,this.nodes.forEach(HKe))})}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()||Amr,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=h.getProps(),b=!this.targetLayout||!$Ke(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={...Tle(m,"layout"),onPlay:v,onComplete:y};(h.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else f||HKe(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,nx(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(ymr),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&VKe(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;WKe(d.x,o.x,A),WKe(d.y,o.y,A),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(V6(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),xmr(this.relativeTarget,this.relativeTargetOrigin,f,A),x&&imr(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=ls()),zf(x,this.relativeTarget)),m&&(this.animationValues=h,Zgr(h,u,this.latestValues,A,b,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=A},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(nx(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ja.update(()=>{SQ.hasAnimatedSinceResize=!0,this.currentAnimation=Wgr(0,UKe,{...o,onUpdate:s=>{this.mixTargetDelta(s),o.onUpdate&&o.onUpdate(s)},onComplete:()=>{o.onComplete&&o.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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(UKe),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:h}=o;if(!(!s||!l||!u)){if(this!==o&&this.layout&&u&&KKe(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||ls();const d=Rd(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const f=Rd(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}zf(s,l),kE(s,h),U6(this.projectionDeltaWithTransform,this.layoutCorrected,s,h)}}registerSharedNode(o,s){this.sharedNodes.has(o)||this.sharedNodes.set(o,new amr),this.sharedNodes.get(o).add(s);const u=s.options.initialPromotionConfig;s.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(s):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:s}=this.options;return s?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:s}=this.options;return s?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let s=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(s=!0),!s)return;const u={};l.z&&lce("z",o,u,this.animationValues);for(let h=0;h{var s;return(s=o.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(GKe),this.root.sharedNodes.clear()}}}function cmr(t){t.updateLayout()}function umr(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,o=r.source!==t.layout.source;a==="size"?Ff(d=>{const f=o?r.measuredBox[d]:r.layoutBox[d],p=Rd(f);f.min=n[d].min,f.max=f.min+p}):KKe(a,r.layoutBox,n)&&Ff(d=>{const f=o?r.measuredBox[d]:r.layoutBox[d],p=Rd(n[d]);f.max=f.min+p,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[d].max=t.relativeTarget[d].min+p)});const s=CE();U6(s,n,r.layoutBox);const l=CE();o?U6(l,t.applyTransform(i,!0),r.measuredBox):U6(l,n,r.layoutBox);const u=!PKe(s);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=ls();V6(g,r.layoutBox,f.layoutBox);const m=ls();V6(m,n,p.layoutBox),$Ke(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:s,hasLayoutChanged:u,hasRelativeTargetChanged:h})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function hmr(t){G6&&SA.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 dmr(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function fmr(t){t.clearSnapshot()}function GKe(t){t.clearMeasurements()}function pmr(t){t.isLayoutDirty=!1}function gmr(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function HKe(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function mmr(t){t.resolveTargetDelta()}function vmr(t){t.calcProjection()}function ymr(t){t.resetSkewAndRotation()}function bmr(t){t.removeLeadSnapshot()}function WKe(t,e,r){t.translate=ko(e.translate,0,r),t.scale=ko(e.scale,1,r),t.origin=e.origin,t.originPoint=e.originPoint}function YKe(t,e,r,n){t.min=ko(e.min,r.min,n),t.max=ko(e.max,r.max,n)}function xmr(t,e,r,n){YKe(t.x,e.x,r.x,n),YKe(t.y,e.y,r.y,n)}function wmr(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Amr={duration:.45,ease:[.4,0,.1,1]},qKe=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),jKe=qKe("applewebkit/")&&!qKe("chrome/")?Math.round:_d;function XKe(t){t.min=jKe(t.min),t.max=jKe(t.max)}function Smr(t){XKe(t.x),XKe(t.y)}function KKe(t,e,r){return t==="position"||t==="preserve-aspect"&&!Ogr(FKe(e),FKe(r),.2)}function Tmr(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const Cmr=QKe({attachResizeListener:(t,e)=>$6(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),cce={current:void 0},ZKe=QKe({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!cce.current){const t=new Cmr({});t.mount(window),t.setOptions({layoutScroll:!0}),cce.current=t}return cce.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Omr={pan:{Feature:Vgr},drag:{Feature:Ugr,ProjectionNode:ZKe,MeasureLayout:SKe}};function kmr(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 JKe(t,e){const r=kmr(t),n=new AbortController,i={passive:!0,...e,signal:n.signal};return[r,i,()=>n.abort()]}function eZe(t){return e=>{e.pointerType==="touch"||jXe()||t(e)}}function Emr(t,e,r={}){const[n,i,a]=JKe(t,r),o=eZe(s=>{const{target:l}=s,u=e(s);if(typeof u!="function"||!l)return;const h=eZe(d=>{u(d),l.removeEventListener("pointerleave",h)});l.addEventListener("pointerleave",h,i)});return n.forEach(s=>{s.addEventListener("pointerenter",o,i)}),a}function tZe(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&&Ja.postRender(()=>a(e,F6(e)))}class _mr extends ox{mount(){const{current:e}=this.node;e&&(this.unmount=Emr(e,r=>(tZe(this.node,r,"Start"),n=>tZe(this.node,n,"End"))))}unmount(){}}class Rmr extends ox{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=B6($6(this.node.current,"focus",()=>this.onFocus()),$6(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const rZe=(t,e)=>e?t===e?!0:rZe(t,e.parentElement):!1,Dmr=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Lmr(t){return Dmr.has(t.tagName)||t.tabIndex!==-1}const H6=new WeakSet;function nZe(t){return e=>{e.key==="Enter"&&t(e)}}function uce(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Mmr=(t,e)=>{const r=t.currentTarget;if(!r)return;const n=nZe(()=>{if(H6.has(r))return;uce(r,"down");const i=nZe(()=>{uce(r,"up")}),a=()=>uce(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 iZe(t){return ece(t)&&!jXe()}function Imr(t,e,r={}){const[n,i,a]=JKe(t,r),o=s=>{const l=s.currentTarget;if(!iZe(s)||H6.has(l))return;H6.add(l);const u=e(s),h=(p,g)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),!(!iZe(p)||!H6.has(l))&&(H6.delete(l),typeof u=="function"&&u(p,{success:g}))},d=p=>{h(p,r.useGlobalTarget||rZe(l,p.target))},f=p=>{h(p,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",f,i)};return n.forEach(s=>{!Lmr(s)&&s.getAttribute("tabindex")===null&&(s.tabIndex=0),(r.useGlobalTarget?window:s).addEventListener("pointerdown",o,i),s.addEventListener("focus",u=>Mmr(u,i),i)}),a}function aZe(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&&Ja.postRender(()=>a(e,F6(e)))}class Pmr extends ox{mount(){const{current:e}=this.node;e&&(this.unmount=Imr(e,r=>(aZe(this.node,r,"Start"),(n,{success:i})=>aZe(this.node,n,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const hce=new WeakMap,dce=new WeakMap,Nmr=t=>{const e=hce.get(t.target);e&&e(t)},Bmr=t=>{t.forEach(Nmr)};function $mr({root:t,...e}){const r=t||document;dce.has(r)||dce.set(r,{});const n=dce.get(r),i=JSON.stringify(e);return n[i]||(n[i]=new IntersectionObserver(Bmr,{root:t,...e})),n[i]}function Fmr(t,e,r){const n=$mr(e);return hce.set(t,r),n.observe(t),()=>{hce.delete(t),n.unobserve(t)}}const zmr={some:0,all:1};class Umr extends ox{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,o={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:zmr[i]},s=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 Fmr(this.node.current,o,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:r}=this.node;["amount","margin","root"].some(Vmr(e,r))&&this.startObserver()}unmount(){}}function Vmr({viewport:t={}},{viewport:e={}}={}){return r=>t[r]!==e[r]}const Qmr={inView:{Feature:Umr},tap:{Feature:Pmr},focus:{Feature:Rmr},hover:{Feature:_mr}},Gmr={layout:{ProjectionNode:ZKe,MeasureLayout:SKe}},fce={current:null},oZe={current:!1};function Hmr(){if(oZe.current=!0,!!lle)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>fce.current=t.matches;t.addListener(e),e()}else fce.current=!1}const Wmr=[...EXe,zc,ax],Ymr=t=>Wmr.find(kXe(t)),sZe=new WeakMap;function qmr(t,e,r){for(const n in e){const i=e[n],a=r[n];if(Fc(i))t.addValue(n,i);else if(Fc(a))t.addValue(n,L6(i,{owner:t}));else if(a!==i)if(t.hasValue(n)){const o=t.getValue(n);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(n);t.addValue(n,L6(o!==void 0?o:i,{owner:t}))}}for(const n in r)e[n]===void 0&&t.removeValue(n);return e}const lZe=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class jmr{scrapeMotionValuesFromProps(e,r,n){return{}}constructor({parent:e,props:r,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Qle,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=mm.now();this.renderScheduledAtthis.bindToMotionValue(n,r)),oZe.current||Hmr(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:fce.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){sZe.delete(this.current),this.projection&&this.projection.unmount(),nx(this.notifyUpdate),nx(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=yA.has(e),i=r.on("change",s=>{this.latestValues[e]=s,this.props.onUpdate&&Ja.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),a=r.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,r)),this.valueSubscriptions.set(e,()=>{i(),a(),o&&o(),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 yE){const r=yE[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):ls()}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=L6(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"&&(CXe(i)||dXe(i))?i=parseFloat(i):!Ymr(i)&&ax.test(r)&&(i=bXe(e,r)),this.setBaseTarget(e,Fc(i)?i.get():i)),Fc(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 o=gle(this.props,n,(r=this.presenceContext)===null||r===void 0?void 0:r.custom);o&&(i=o[e])}if(n&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,e);return a!==void 0&&!Fc(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 kle),this.events[e].add(r)}notify(e,...r){this.events[e]&&this.events[e].notify(...r)}}class cZe extends jmr{constructor(){super(...arguments),this.KeyframeResolver=RXe}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;Fc(e)&&(this.childSubscription=e.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}function Xmr(t){return window.getComputedStyle(t)}class Kmr extends cZe{constructor(){super(...arguments),this.type="html",this.renderInstance=Vje}readValueFromInstance(e,r){if(yA.has(r)){const n=zle(r);return n&&n.default||0}else{const n=Xmr(e),i=(Nje(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:r}){return bKe(e,r)}build(e,r,n){ble(e,r,n.transformTemplate)}scrapeMotionValuesFromProps(e,r,n){return Sle(e,r,n)}}class Zmr extends cZe{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ls}getBaseTargetFromProps(e,r){return e[r]}readValueFromInstance(e,r){if(yA.has(r)){const n=zle(r);return n&&n.default||0}return r=Qje.has(r)?r:dle(r),e.getAttribute(r)}scrapeMotionValuesFromProps(e,r,n){return Wje(e,r,n)}build(e,r,n){xle(e,r,this.isSVGTag,n.transformTemplate)}renderInstance(e,r,n,i){Gje(e,r,n,i)}mount(e){this.isSVGTag=Ale(e.tagName),super.mount(e)}}const Jmr=(t,e)=>ple(t)?new Zmr(e):new Kmr(e,{allowProjection:t!==j.Fragment}),e0r=Ofr({...mgr,...Qmr,...Omr,...Gmr},Jmr),TA=Vdr(e0r),uZe={};function Kp(t,e){const r=j.useRef(uZe);return r.current===uZe&&(r.current=t(e)),r}function pce(){}const t0r=Object.freeze([]),Su=Object.freeze({});function gce(t){j.useEffect(t,t0r)}const W6=0;class Zp{constructor(){Pr(this,"currentId",W6);Pr(this,"clear",()=>{this.currentId!==W6&&(clearTimeout(this.currentId),this.currentId=W6)});Pr(this,"disposeEffect",()=>this.clear)}static create(){return new Zp}start(e,r){this.clear(),this.currentId=setTimeout(()=>{this.currentId=W6,r()},e)}isStarted(){return this.currentId!==W6}}function EE(){const t=Kp(Zp.create).current;return gce(t.disposeEffect),t}const Bn=typeof document<"u"?j.useLayoutEffect:()=>{};function r0r(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:n0r,platform:i0r,maxTouchPoints:a0r}=r0r(),TQ=n0r.toLowerCase(),Y6=i0r.toLowerCase(),CQ=/^i(os$|p)/.test(Y6)||Y6==="macintel"&&a0r>1,hZe="android",mce=Y6===hZe||TQ.includes(hZe),o0r=!CQ&&Y6.startsWith("mac");Y6.startsWith("win");const s0r=o0r||CQ,_E=typeof CSS<"u"&&!!((Hor=CSS.supports)!=null&&Hor.call(CSS,"-webkit-backdrop-filter:none"));!_E&&TQ.includes("firefox"),!_E&&TQ.includes("chrom");const l0r=s0r,c0r=/jsdom|happydom/.test(TQ);function u0r(t){t.preventDefault(),t.stopPropagation()}function h0r(t){return"nativeEvent"in t}function d0r(t){return t.pointerType===""&&t.isTrusted?!0:mce&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function dZe(t){return c0r?!1:!mce&&t.width===0&&t.height===0||mce&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function RE(t,e){const r=["mouse","pen"];return e||r.push("",void 0),r.includes(t)}function f0r(t){const e=t.type;return e==="click"||e==="mousedown"||e==="keydown"||e==="keyup"}function OQ(){return typeof window<"u"}function sc(t){return vce(t)?(t.nodeName||"").toLowerCase():"#document"}function cs(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Zv(t){var e;return(e=(vce(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function vce(t){return OQ()?t instanceof Node||t instanceof cs(t).Node:!1}function Yi(t){return OQ()?t instanceof Element||t instanceof cs(t).Element:!1}function Eo(t){return OQ()?t instanceof HTMLElement||t instanceof cs(t).HTMLElement:!1}function DE(t){return!OQ()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof cs(t).ShadowRoot}function q6(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=Dd(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&i!=="inline"&&i!=="contents"}function p0r(t){return/^(table|td|th)$/.test(sc(t))}function kQ(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const g0r=/transform|translate|scale|rotate|perspective|filter/,m0r=/paint|layout|strict|content/,CA=t=>!!t&&t!=="none";let yce;function bce(t){const e=Yi(t)?Dd(t):t;return CA(e.transform)||CA(e.translate)||CA(e.scale)||CA(e.rotate)||CA(e.perspective)||!xce()&&(CA(e.backdropFilter)||CA(e.filter))||g0r.test(e.willChange||"")||m0r.test(e.contain||"")}function v0r(t){let e=lx(t);for(;Eo(e)&&!sx(e);){if(bce(e))return e;if(kQ(e))return null;e=lx(e)}return null}function xce(){return yce==null&&(yce=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),yce}function sx(t){return/^(html|body|#document)$/.test(sc(t))}function Dd(t){return cs(t).getComputedStyle(t)}function EQ(t){return Yi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function lx(t){if(sc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||DE(t)&&t.host||Zv(t);return DE(e)?e.host:e}function fZe(t){const e=lx(t);return sx(e)?(t.ownerDocument||t).body:Eo(e)&&q6(e)?e:fZe(e)}function j6(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=fZe(t),a=i===((n=t.ownerDocument)==null?void 0:n.body),o=cs(i);if(a){const s=wce(o);return e.concat(o,o.visualViewport||[],q6(i)?i:[],s&&r?j6(s):[])}else return e.concat(i,j6(i,[],r))}function wce(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const Ace="data-base-ui-focusable",pZe="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Jv(t){var r;let e=t.activeElement;for(;((r=e==null?void 0:e.shadowRoot)==null?void 0:r.activeElement)!=null;)e=e.shadowRoot.activeElement;return e}function Hn(t,e){var n;if(!t||!e)return!1;const r=(n=e.getRootNode)==null?void 0:n.call(e);if(t.contains(e))return!0;if(r&&DE(r)){let i=e;for(;i;){if(t===i)return!0;i=i.parentNode||i.host}}return!1}function Jp(t){return"composedPath"in t?t.composedPath()[0]:t.target}function gZe(t,e){if(!Yi(t))return!1;const r=t;if(e.hasElement(r))return!r.hasAttribute("data-trigger-disabled");for(const[,n]of e.entries())if(Hn(n,r))return!n.hasAttribute("data-trigger-disabled");return!1}function Sce(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const r=t;return r.target!=null&&e.contains(r.target)}function y0r(t){return t.matches("html,body")}function Tce(t){return Eo(t)&&t.matches(pZe)}function b0r(t){return(t==null?void 0:t.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${pZe}`))!=null}function mZe(t){return t?t.getAttribute("role")==="combobox"&&Tce(t):!1}function vZe(t){return t?t.hasAttribute(Ace)?t:t.querySelector(`[${Ace}]`)||t:null}function x0r(t,e){return e!=null&&!RE(e)?0:typeof t=="function"?t():t}function Cce(t,e,r){const n=x0r(t,r);return typeof n=="number"?n:n==null?void 0:n[e]}function yZe(t){return typeof t=="function"?t():t}function bZe(t,e){return e||t==="click"||t==="mousedown"}function w0r(t){return(t==null?void 0:t.includes("mouse"))&&t!=="mousedown"}const xZe="none",LE="trigger-press",Ld="trigger-hover",wZe="outside-press",A0r="close-press",X6="focus-out",AZe="escape-key",S0r="imperative-action";function _s(t,e,r,n){let i=!1,a=!1;const o=Su;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,...o}}function bi(t,e,r,n){return t.addEventListener(e,r,n),()=>{t.removeEventListener(e,r,n)}}function ey(...t){return()=>{for(let e=0;er!==e[n])}function TZe(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{e.current=e.next}};return e}const Oce={...qw},kce=Oce.useInsertionEffect,E0r=kce&&kce!==Oce.useLayoutEffect?kce:t=>t();function Pn(t){const e=Kp(_0r).current;return e.next=t,E0r(e.effect),e.trampoline}function _0r(){const t={next:void 0,callback:R0r,trampoline:(...e)=>{var r;return(r=t.callback)==null?void 0:r.call(t,...e)},effect:()=>{t.callback=t.next}};return t}function R0r(){}const _Q=null;let D0r=class{constructor(){Pr(this,"callbacks",[]);Pr(this,"callbacksCount",0);Pr(this,"nextId",1);Pr(this,"startId",1);Pr(this,"isScheduled",!1);Pr(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)}},RQ=new D0r;class Lh{constructor(){Pr(this,"currentId",_Q);Pr(this,"cancel",()=>{this.currentId!==_Q&&(RQ.cancel(this.currentId),this.currentId=_Q)});Pr(this,"disposeEffect",()=>this.cancel)}static create(){return new Lh}static request(e){return RQ.request(e)}static cancel(e){return RQ.cancel(e)}request(e){this.cancel(),this.currentId=RQ.request(()=>{this.currentId=_Q,e()})}}function Ece(){const t=Kp(Lh.create).current;return gce(t.disposeEffect),t}function eo(t){return(t==null?void 0:t.ownerDocument)||document}const L0r={...{clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},position:"fixed",top:0,left:0},IE=j.forwardRef(function(e,r){const[n,i]=j.useState();Bn(()=>{l0r&&_E&&i("button")},[]);const a={tabIndex:0,role:n};return H.jsx("span",{...e,ref:r,style:L0r,"aria-hidden":n?void 0:!0,...a,"data-base-ui-focus-guard":""})}),M0r=["top","right","bottom","left"],cx=Math.min,ty=Math.max,DQ=Math.round,LQ=Math.floor,ry=t=>({x:t,y:t}),I0r={left:"right",right:"left",bottom:"top",top:"bottom"};function _ce(t,e,r){return ty(t,cx(e,r))}function vm(t,e){return typeof t=="function"?t(e):t}function Uf(t){return t.split("-")[0]}function ny(t){return t.split("-")[1]}function Rce(t){return t==="x"?"y":"x"}function MQ(t){return t==="y"?"height":"width"}function Vf(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function IQ(t){return Rce(Vf(t))}function P0r(t,e,r){r===void 0&&(r=!1);const n=ny(t),i=IQ(t),a=MQ(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(o=PQ(o)),[o,PQ(o)]}function N0r(t){const e=PQ(t);return[Dce(t),e,Dce(e)]}function Dce(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const CZe=["left","right"],OZe=["right","left"],B0r=["top","bottom"],$0r=["bottom","top"];function F0r(t,e,r){switch(t){case"top":case"bottom":return r?e?OZe:CZe:e?CZe:OZe;case"left":case"right":return e?B0r:$0r;default:return[]}}function z0r(t,e,r,n){const i=ny(t);let a=F0r(Uf(t),r==="start",n);return i&&(a=a.map(o=>o+"-"+i),e&&(a=a.concat(a.map(Dce)))),a}function PQ(t){const e=Uf(t);return I0r[e]+t.slice(e.length)}function U0r(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 Lce(t){return typeof t!="number"?U0r(t):{top:t,right:t,bottom:t,left:t}}function NQ(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 V0r(t){return t.visibility==="hidden"||t.visibility==="collapse"}function kZe(t,e=t?Dd(t):null){return!t||!t.isConnected||!e||V0r(e)?!1:typeof t.checkVisibility=="function"?t.checkVisibility():e.display!=="none"&&e.display!=="contents"}const Q0r='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function G0r(t){const e=t.assignedSlot;if(e)return e;if(t.parentElement)return t.parentElement;const r=t.getRootNode();return DE(r)?r.host:null}function Mce(t){for(const e of Array.from(t.children))if(sc(e)==="summary")return e;return null}function H0r(t,e){const r=Mce(e);return!!r&&(t===r||Hn(r,t))}function EZe(t){const e=t?sc(t):"";return t!=null&&t.matches(Q0r)&&(e!=="summary"||t.parentElement!=null&&sc(t.parentElement)==="details"&&Mce(t.parentElement)===t)&&(e!=="details"||Mce(t)==null)&&(e!=="input"||t.type!=="hidden")}function _Ze(t){if(!EZe(t)||!t.isConnected||t.matches(":disabled"))return!1;for(let e=t;e;e=G0r(e)){const r=e!==t,n=sc(e)==="slot";if(e.hasAttribute("inert")||r&&sc(e)==="details"&&!e.open&&!H0r(t,e)||e.hasAttribute("hidden")||!n&&!W0r(e,r))return!1}return!0}function W0r(t,e){const r=Dd(t);return e?r.display!=="none":kZe(t,r)}function RZe(t){const e=t.tabIndex;if(e<0){const r=sc(t);if(r==="details"||r==="audio"||r==="video"||Eo(t)&&t.isContentEditable)return 0}return e}function Ice(t){if(sc(t)!=="input")return null;const e=t;return e.type==="radio"&&e.name!==""?e:null}function Y0r(t,e){const r=Ice(t);if(!r)return!0;const n=e.find(i=>{const a=Ice(i);return(a==null?void 0:a.name)===r.name&&a.form===r.form&&a.checked});return n?n===r:e.find(i=>{const a=Ice(i);return(a==null?void 0:a.name)===r.name&&a.form===r.form})===r}function DZe(t){if(Eo(t)&&sc(t)==="slot"){const e=t.assignedElements({flatten:!0});if(e.length>0)return e}return Eo(t)&&t.shadowRoot?Array.from(t.shadowRoot.children):Array.from(t.children)}function LZe(t,e){DZe(t).forEach(r=>{EZe(r)&&e.push(r),LZe(r,e)})}function MZe(t,e,r){DZe(t).forEach(n=>{Eo(n)&&n.matches(e)&&r.push(n),MZe(n,e,r)})}function Pce(t){return _Ze(t)&&RZe(t)>=0}function IZe(t){const e=[];return LZe(t,e),e.filter(_Ze)}function K6(t){const e=IZe(t);return e.filter(r=>RZe(r)>=0&&Y0r(r,e))}function PZe(t,e){const r=K6(t),n=r.length;if(n===0)return;const i=Jv(eo(t)),a=r.indexOf(i),o=a===-1?e===1?0:n-1:a+e;return r[o]}function Nce(t){return PZe(eo(t).body,1)||t}function NZe(t){return PZe(eo(t).body,-1)||t}function BZe(t,e){if(!t)return null;const r=K6(eo(t).body),n=r.length;if(n===0)return null;const i=r.indexOf(t);if(i===-1)return null;const a=(i+e+n)%n;return r[a]}function q0r(t){return BZe(t,1)}function j0r(t){return BZe(t,-1)}function PE(t,e){const r=e||t.currentTarget,n=t.relatedTarget;return!n||!Hn(r,n)}function X0r(t){K6(t).forEach(r=>{r.dataset.tabindex=r.getAttribute("tabindex")||"",r.setAttribute("tabindex","-1")})}function $Ze(t){const e=[];MZe(t,"[data-tabindex]",e),e.forEach(r=>{const n=r.dataset.tabindex;delete r.dataset.tabindex,n?r.setAttribute("tabindex",n):r.removeAttribute("tabindex")})}function ux(t,e,r=!0){return t.filter(i=>i.parentId===e).flatMap(i=>{var a;return[...!r||(a=i.context)!=null&&a.open?[i]:[],...ux(t,i.id,r)]})}function FZe(t,e){var i;let r=[],n=(i=t.find(a=>a.id===e))==null?void 0:i.parentId;for(;n;){const a=t.find(o=>o.id===n);n=a==null?void 0:a.parentId,a&&(r=r.concat(a))}return r}function BQ(t){return`data-base-ui-${t}`}let $Q=0;function Bce(t,e={}){const{preventScroll:r=!1,sync:n=!1,shouldFocus:i}=e;cancelAnimationFrame($Q);function a(){i&&!i()||t==null||t.focus({preventScroll:r})}if(n)return a(),pce;const o=requestAnimationFrame(a);return $Q=o,()=>{$Q===o&&(cancelAnimationFrame(o),$Q=0)}}const $ce={inert:new WeakMap,"aria-hidden":new WeakMap},zZe="data-base-ui-inert",Fce={inert:new WeakSet,"aria-hidden":new WeakSet};let Z6=new WeakMap,zce=0;function K0r(t){return Fce[t]}function UZe(t){return t?DE(t)?t.host:UZe(t.parentNode):null}const VZe=(t,e)=>e.map(r=>{if(t.contains(r))return r;const n=UZe(r);return t.contains(n)?n:null}).filter(r=>r!=null),QZe=t=>{const e=new Set;return t.forEach(r=>{let n=r;for(;n&&!e.has(n);)e.add(n),n=n.parentNode}),e},GZe=(t,e,r)=>{const n=[],i=a=>{!a||r.has(a)||Array.from(a.children).forEach(o=>{sc(o)!=="script"&&(e.has(o)?i(o):n.push(o))})};return i(t),n};function Z0r(t,e,r,n,{mark:i=!0}){let a=null;n?a="inert":r&&(a="aria-hidden");let o=null,s=null;const l=VZe(e,t),u=i?GZe(e,QZe(l),new Set(l)):[],h=[],d=[];if(a){const f=$ce[a],p=K0r(a);s=p,o=f;const g=VZe(e,Array.from(e.querySelectorAll("[aria-live]"))),m=l.concat(g);GZe(e,QZe(m),new Set(m)).forEach(y=>{const b=y.getAttribute(a),x=b!==null&&b!=="false",w=(f.get(y)||0)+1;f.set(y,w),h.push(y),w===1&&x&&p.add(y),x||y.setAttribute(a,a==="inert"?"":"true")})}return i&&u.forEach(f=>{const p=(Z6.get(f)||0)+1;Z6.set(f,p),d.push(f),p===1&&f.setAttribute(zZe,"")}),zce+=1,()=>{o&&h.forEach(f=>{const g=(o.get(f)||0)-1;o.set(f,g),g||(!(s!=null&&s.has(f))&&a&&f.removeAttribute(a),s==null||s.delete(f))}),i&&d.forEach(f=>{const p=(Z6.get(f)||0)-1;Z6.set(f,p),p||f.removeAttribute(zZe)}),zce-=1,zce||($ce.inert=new WeakMap,$ce["aria-hidden"]=new WeakMap,Fce.inert=new WeakSet,Fce["aria-hidden"]=new WeakSet,Z6=new WeakMap)}}function HZe(t,e={}){const{ariaHidden:r=!1,inert:n=!1,mark:i=!0}=e,a=eo(t[0]).body;return Z0r(t,a,r,n,{mark:i})}let WZe=0;function J0r(t,e="mui"){const[r,n]=j.useState(t),i=t||r;return j.useEffect(()=>{r==null&&(WZe+=1,n(`${e}-${WZe}`))},[r,e]),i}const YZe=Oce.useId;function FQ(t,e){if(YZe!==void 0){const r=YZe();return t??(e?`${e}-${r}`:r)}return J0r(t,e)}function evr(t,e){return function(n,...i){const a=new URL(t);return a.searchParams.set("code",n.toString()),i.forEach(o=>a.searchParams.append("args[]",o)),`${e} error #${n}; visit ${a} for the full message.`}}const iy=evr("https://base-ui.com/production-error","Base UI"),tvr=parseInt(j.version,10);function Uce(t){return tvr>=t}function qZe(t){if(!j.isValidElement(t))return null;const e=t,r=e.props;return(Uce(19)?r==null?void 0:r.ref:e.ref)??null}function Vce(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}function rvr(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 nvr(t,e){return typeof t=="function"?t(e):t}function jZe(t,e){return typeof t=="function"?t(e):t}const Qce={};function Gce(t,e,r,n,i){if(!r&&!n&&!t)return zQ(e);let a=zQ(t);return e&&(a=UQ(a,e)),r&&(a=UQ(a,r)),n&&(a=UQ(a,n)),a}function ivr(t){if(t.length===0)return Qce;if(t.length===1)return zQ(t[0]);let e=zQ(t[0]);for(let r=1;r=65&&i<=90&&(typeof e=="function"||typeof e>"u")}function Hce(t){return typeof t=="function"}function KZe(t,e){return Hce(t)?t(e):t??Qce}function svr(t,e){return e?t?(...r)=>{const n=r[0];if(eJe(n)){const a=n;VQ(a);const o=e(...r);return a.baseUIHandlerPrevented||t==null||t(...r),o}const i=e(...r);return t==null||t(...r),i}:ZZe(e):t}function ZZe(t){return t&&((...e)=>{const r=e[0];return eJe(r)&&VQ(r),t(...e)})}function VQ(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function JZe(t,e){return e?t?e+" "+t:e:t}function eJe(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function eg(t,e,r={}){const n=e.render,i=lvr(e,r);if(r.enabled===!1)return null;const a=r.state??Su;return hvr(t,n,i,a)}function lvr(t,e={}){const{className:r,style:n,render:i}=t,{state:a=Su,ref:o,props:s,stateAttributesMapping:l,enabled:u=!0}=e,h=u?nvr(r,a):void 0,d=u?jZe(n,a):void 0,f=u?rvr(a,l):Su,p=u&&s?cvr(s):void 0,g=u?Vce(f,p)??{}:Su;return typeof document<"u"&&(u?Array.isArray(o)?g.ref=T0r([g.ref,qZe(i),...o]):g.ref=ME(g.ref,qZe(i),o):ME(null,null)),u?(h!==void 0&&(g.className=JZe(g.className,h)),d!==void 0&&(g.style=Vce(g.style,d)),g):Su}function cvr(t){return Array.isArray(t)?ivr(t):Gce(void 0,t)}const uvr=Symbol.for("react.lazy");function hvr(t,e,r,n){if(e){if(typeof e=="function")return e(r,n);const i=Gce(r,e.props);i.ref=r.ref;let a=e;return(a==null?void 0:a.$$typeof)===uvr&&(a=j.Children.toArray(e)[0]),j.cloneElement(a,i)}if(t&&typeof t=="string")return dvr(t,r);throw new Error(iy(8))}function dvr(t,e){return t==="button"?j.createElement("button",{type:"button",...e,key:e.key}):t==="img"?j.createElement("img",{alt:"",...e,key:e.key}):j.createElement(t,e)}const fvr=500,pvr={style:{transition:"none"}},tJe="data-base-ui-click-trigger",gvr={fallbackAxisSide:"end"},mvr={clipPath:"inset(50%)",position:"fixed",top:0,left:0},rJe=j.createContext(null),nJe=()=>j.useContext(rJe),vvr=BQ("portal");function yvr(t={}){const{ref:e,container:r,componentProps:n=Su,elementProps:i}=t,a=FQ(),o=nJe(),s=o==null?void 0:o.portalNode,[l,u]=j.useState(null),[h,d]=j.useState(null),f=Pn(v=>{v!==null&&d(v)}),p=j.useRef(null);Bn(()=>{if(r===null){p.current&&(p.current=null,d(null),u(null));return}const v=(r&&(vce(r)?r:r.current))??s??document.body;if(v==null){p.current&&(p.current=null,d(null),u(null));return}p.current!==v&&(p.current=v,d(null),u(v))},[r,s]);const g=eg("div",n,{ref:[e,f],props:[{id:a,[vvr]:""},i]}),m=l&&g?kf.createPortal(g,l):null;return{node:h,nodeId:j.isValidElement(g)?g.props.id:void 0,subtree:m}}const bvr=j.forwardRef(function(e,r){const{render:n,className:i,style:a,children:o,container:s,...l}=e,{node:u,nodeId:h,subtree:d}=yvr({container:s,ref:r,componentProps:e,elementProps:l}),f=j.useRef(null),p=j.useRef(null),g=j.useRef(null),m=j.useRef(null),[v,y]=j.useState(null),b=j.useRef(!1),x=v==null?void 0:v.modal,w=v==null?void 0:v.open,A=!!v&&!v.modal&&v.open&&!!u;j.useEffect(()=>{if(!u||x)return;function T(C){u&&C.relatedTarget&&PE(C)&&(C.type==="focusin"?b.current&&($Ze(u),b.current=!1):(X0r(u),b.current=!0))}return ey(bi(u,"focusin",T,!0),bi(u,"focusout",T,!0))},[u,x]),Bn(()=>{!u||w!==!0||!b.current||($Ze(u),b.current=!1)},[w,u]);const S=j.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:g,afterInsideRef:m,portalNode:u,setFocusManagerState:y}),[u]);return H.jsxs(j.Fragment,{children:[d,H.jsxs(rJe.Provider,{value:S,children:[A&&u&&H.jsx(IE,{"data-type":"outside",ref:f,onFocus:T=>{var C;if(PE(T,u))(C=g.current)==null||C.focus();else{const k=v?v.domReference:null,E=NZe(k);E==null||E.focus()}}}),A&&u&&H.jsx("span",{"aria-owns":h,style:mvr}),u&&kf.createPortal(o,u),A&&u&&H.jsx(IE,{"data-type":"outside",ref:p,onFocus:T=>{var C;if(PE(T,u))(C=m.current)==null||C.focus();else{const k=v?v.domReference:null,E=Nce(k);E==null||E.focus(),v!=null&&v.closeOnFocusOut&&(v==null||v.onOpenChange(!1,_s(X6,T.nativeEvent)))}}})]})]})});function iJe(){const t=new Map;return{emit(e,r){var n;(n=t.get(e))==null||n.forEach(i=>i(r))},on(e,r){t.has(e)||t.set(e,new Set),t.get(e).add(r)},off(e,r){var n;(n=t.get(e))==null||n.delete(r)}}}class xvr{constructor(){Pr(this,"nodesRef",{current:[]});Pr(this,"events",iJe())}addNode(e){this.nodesRef.current.push(e)}removeNode(e){const r=this.nodesRef.current.findIndex(n=>n===e);r!==-1&&this.nodesRef.current.splice(r,1)}}const aJe=j.createContext(null),oJe=j.createContext(null),QQ=()=>{var t;return((t=j.useContext(aJe))==null?void 0:t.id)||null},NE=t=>{const e=j.useContext(oJe);return t??e};function wvr(t){const e=FQ(),r=NE(t),n=QQ();return Bn(()=>{if(!e)return;const i={id:e,parentId:n};return r==null||r.addNode(i),()=>{r==null||r.removeNode(i)}},[r,e,n]),e}function Avr(t){const{children:e,id:r}=t,n=QQ();return H.jsx(aJe.Provider,{value:j.useMemo(()=>({id:r,parentId:n}),[r,n]),children:e})}function Svr(t){const{children:e,externalTree:r}=t,n=Kp(()=>r??new xvr).current;return H.jsx(oJe.Provider,{value:n,children:e})}function ay(t){return t==null?t:"current"in t?t.current:t}function Tvr(t,e){const r=cs(Jp(t));return t instanceof r.KeyboardEvent?"keyboard":t instanceof r.FocusEvent?e||"keyboard":"pointerType"in t?t.pointerType||"keyboard":"touches"in t?"touch":t instanceof r.MouseEvent?e||(t.detail===0?"keyboard":"mouse"):""}const sJe=20;let hx=[];function Wce(){hx=hx.filter(t=>{var e;return(e=t.deref())==null?void 0:e.isConnected})}function lJe(t){Wce(),t&&sc(t)!=="body"&&(hx.push(new WeakRef(t)),hx.length>sJe&&(hx=hx.slice(-sJe)))}function cJe(){var t;return Wce(),(t=hx[hx.length-1])==null?void 0:t.deref()}function Cvr(t){return t?Pce(t)?t:K6(t)[0]||t:null}function uJe(t){var i;if(t.hasAttribute("tabindex")&&!t.hasAttribute("data-tabindex")||!((i=t.getAttribute("role"))!=null&&i.includes("dialog")))return;const r=IZe(t).filter(a=>{const o=a.getAttribute("data-tabindex")||"";return Pce(a)||a.hasAttribute("data-tabindex")&&!o.startsWith("-")}),n=t.getAttribute("tabindex");r.length===0?n!=="0"&&(t.setAttribute("tabindex","0"),t.setAttribute("data-tabindex","0")):(n!=="-1"||t.hasAttribute("data-tabindex")&&t.getAttribute("data-tabindex")!=="-1")&&(t.setAttribute("tabindex","-1"),t.setAttribute("data-tabindex","-1"))}function Ovr(t){const{context:e,children:r,disabled:n=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:l=!0,openInteractionType:u="",nextFocusableElement:h,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:g}=t,m="rootStore"in e?e.rootStore:e,v=m.useState("open"),y=m.useState("domReferenceElement"),b=m.useState("floatingElement"),{events:x,dataRef:w}=m.context,A=Pn(()=>{var te;return(te=w.current.floatingContext)==null?void 0:te.nodeId}),S=i===!1,T=mZe(y)&&S,C=Tu(i),k=Tu(a),E=Tu(u),_=Tu(v),P=NE(p),L=nJe(),R=j.useRef(!1),D=j.useRef(!1),M=j.useRef(!1),I=j.useRef(null),N=j.useRef(""),F=j.useRef(""),B=j.useRef(null),V=j.useRef(null),z=ME(B,f,L==null?void 0:L.beforeInsideRef),U=ME(V,L==null?void 0:L.afterInsideRef),Q=EE(),G=EE(),q=Ece(),Y=L!=null,ne=vZe(b),X=Pn((te=ne)=>te?K6(te):[]),J=Pn(()=>(g==null?void 0:g().filter(te=>te!=null))??[]);j.useEffect(()=>{if(n||!s)return;function te(ie){ie.key==="Tab"&&Hn(ne,Jv(eo(ne)))&&X().length===0&&!T&&u0r(ie)}const pe=eo(ne);return bi(pe,"keydown",te)},[n,ne,s,T,X]),j.useEffect(()=>{if(n||!v)return;const te=eo(ne);function pe(){M.current=!1}function ie(ke){const Ee=Jp(ke),ue=J(),de=Hn(b,Ee)||Hn(y,Ee)||Hn(L==null?void 0:L.portalNode,Ee)||ue.some(xe=>xe===Ee||Hn(xe,Ee));M.current=!de,F.current=ke.pointerType||"keyboard",Ee!=null&&Ee.closest(`[${tJe}]`)&&(D.current=!0,G.start(0,()=>{D.current=!1}))}function Ce(){F.current="keyboard"}return ey(bi(te,"pointerdown",ie,!0),bi(te,"pointerup",pe,!0),bi(te,"pointercancel",pe,!0),bi(te,"keydown",Ce,!0),pe)},[n,b,y,ne,v,L,G,J]),j.useEffect(()=>{if(n||!l)return;const te=eo(ne);function pe(){D.current=!0,G.start(0,()=>{D.current=!1})}function ie(ue){const de=Jp(ue);Pce(de)&&(I.current=de)}function Ce(ue){const de=ue.relatedTarget,xe=ue.currentTarget,ge=Jp(ue);s&&de==null&&ge!=null&&Hn(b,ge)&&lJe(ge),queueMicrotask(()=>{const ze=A(),we=m.context.triggerElements,Oe=J(),Be=(de==null?void 0:de.hasAttribute(BQ("focus-guard")))&&[B.current,V.current,L==null?void 0:L.beforeInsideRef.current,L==null?void 0:L.afterInsideRef.current,L==null?void 0:L.beforeOutsideRef.current,L==null?void 0:L.afterOutsideRef.current,ay(d),ay(h)].includes(de),Z=!(Hn(y,de)||Hn(b,de)||Hn(de,b)||Hn(L==null?void 0:L.portalNode,de)||Oe.some(le=>le===de||Hn(le,de))||we.hasMatchingElement(le=>Hn(le,de))||Be||P&&(ux(P.nodesRef.current,ze).find(le=>{var be,ae;return Hn((be=le.context)==null?void 0:be.elements.floating,de)||Hn((ae=le.context)==null?void 0:ae.elements.domReference,de)})||FZe(P.nodesRef.current,ze).find(le=>{var be,ae,K;return[(be=le.context)==null?void 0:be.elements.floating,vZe((ae=le.context)==null?void 0:ae.elements.floating)].includes(de)||((K=le.context)==null?void 0:K.elements.domReference)===de})));if(xe===y&&ne&&uJe(ne),o&&xe!==y&&!kZe(ge)&&Jv(te)===te.body){if(Eo(ne)&&(ne.focus(),o==="popup")){q.request(()=>{ne.focus()});return}const le=X(),be=I.current,ae=(be&&le.includes(be)?be:null)||le[le.length-1]||ne;Eo(ae)&&ae.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(T||!s)&&de&&Z&&!D.current&&(T||de!==cJe())&&(R.current=!0,m.setOpen(!1,_s(X6,ue)))})}function ke(){M.current||(w.current.insideReactTree=!0,Q.start(0,()=>{w.current.insideReactTree=!1}))}const Ee=Eo(y)?y:null;if(!(!b&&!Ee))return ey(Ee&&bi(Ee,"focusout",Ce),Ee&&bi(Ee,"pointerdown",pe),b&&bi(b,"focusin",ie),b&&bi(b,"focusout",Ce),b&&L&&bi(b,"focusout",ke,!0))},[n,y,b,ne,s,P,L,m,l,o,X,T,A,w,Q,G,q,h,d,J]),j.useEffect(()=>{var xe,ge,ze;if(n||!b||!v)return;const te=Array.from(((xe=L==null?void 0:L.portalNode)==null?void 0:xe.querySelectorAll(`[${BQ("portal")}]`))||[]),ie=(ze=(ge=(P?FZe(P.nodesRef.current,A()):[]).find(we=>{var Oe;return mZe(((Oe=we.context)==null?void 0:Oe.elements.domReference)||null)}))==null?void 0:ge.context)==null?void 0:ze.elements.domReference,ke=[...[b,...te,B.current,V.current,L==null?void 0:L.beforeOutsideRef.current,L==null?void 0:L.afterOutsideRef.current,...J()],ie,ay(d),ay(h),T?y:null].filter(we=>we!=null),Ee=HZe(ke,{ariaHidden:s||T,mark:!1}),ue=[b,...te].filter(we=>we!=null),de=HZe(ue);return()=>{de(),Ee()}},[v,n,y,b,s,L,T,P,A,h,d,J]),Bn(()=>{if(!v||n||!Eo(ne))return;N.current="",F.current="";const te=eo(ne),pe=Jv(te);queueMicrotask(()=>{const ie=C.current,Ce=typeof ie=="function"?ie(E.current||""):ie;if(Ce===void 0||Ce===!1||Hn(ne,pe))return;let Ee=null;const ue=()=>(Ee==null&&(Ee=X(ne)),Ee[0]||ne);let de;Ce===!0||Ce===null?de=ue():de=ay(Ce),de=de||ue();const xe=Hn(ne,Jv(te));Bce(de,{preventScroll:de===ne,shouldFocus(){if(!_.current)return!1;if(xe)return!0;const ge=Jv(te);return!(ge!==de&&Hn(ne,ge))}})})},[n,v,ne,X,C,E,_]),Bn(()=>{if(n||!ne)return;const te=eo(ne),pe=Jv(te),ie=E.current==null;lJe(pe);function Ce(Ee){if(Ee.open||(N.current=Tvr(Ee.nativeEvent,F.current)),Ee.reason===Ld&&Ee.nativeEvent.type==="mouseleave"&&(R.current=!0),Ee.reason===wZe)if(Ee.nested)R.current=!1;else if(d0r(Ee.nativeEvent)||dZe(Ee.nativeEvent))R.current=!1;else{let ue=!1;eo(ne).createElement("div").focus({get preventScroll(){return ue=!0,!1}}),ue?R.current=!1:R.current=!0}}x.on("openchange",Ce);function ke(Ee){const ue=k.current;let de=typeof ue=="function"?ue(Ee):ue;if(de===void 0||de===!1)return null;de===null&&(de=!0);const xe=y!=null&&y.isConnected?y:null,ge=pe!=null&&pe.isConnected&&sc(pe)!=="body"?pe:null;let ze=ie?ge||xe:xe||ge;return ze||(ze=cJe()||null),typeof de=="boolean"?ze:ay(de)||ze||null}return()=>{x.off("openchange",Ce);const Ee=Jv(te),ue=J(),de=Hn(b,Ee)||ue.some(we=>we===Ee||Hn(we,Ee))||P&&ux(P.nodesRef.current,A(),!1).some(we=>{var Oe;return Hn((Oe=we.context)==null?void 0:Oe.elements.floating,Ee)}),xe=k.current,ge=N.current,ze=ke(ge);queueMicrotask(()=>{const we=Cvr(ze),Oe=typeof xe!="boolean";if(xe&&!R.current&&Eo(we)&&(!(!Oe&&we!==Ee&&Ee!==te.body)||de)){const Be={preventScroll:!0};ge==="keyboard"&&(Be.focusVisible=!0),we.focus(Be)}R.current=!1})}},[n,b,ne,k,E,x,P,y,A,J]),Bn(()=>{if(!_E||v||!b)return;const te=Jv(eo(b));!Eo(te)||!Tce(te)||Hn(b,te)&&te.blur()},[v,b]),Bn(()=>{if(!(n||!L))return L.setFocusManagerState({modal:s,closeOnFocusOut:l,open:v,onOpenChange:m.setOpen,domReference:y}),()=>{L.setFocusManagerState(null)}},[n,L,s,v,m,l,y]),Bn(()=>{if(!(n||!ne))return uJe(ne),()=>{queueMicrotask(Wce)}},[n,ne]);const ee=!n&&(s?!T:!0)&&(Y||s);return H.jsxs(j.Fragment,{children:[ee&&H.jsx(IE,{"data-type":"inside",ref:z,onFocus:te=>{var pe;if(s){const ie=X();Bce(ie[ie.length-1])}else if(L!=null&&L.portalNode)if(R.current=!1,PE(te,L.portalNode)){const ie=Nce(y);ie==null||ie.focus()}else(pe=ay(d??L.beforeOutsideRef))==null||pe.focus()}}),r,ee&&H.jsx(IE,{"data-type":"inside",ref:U,onFocus:te=>{var pe;if(s)Bce(X()[0]);else if(L!=null&&L.portalNode)if(l&&(R.current=!0),PE(te,L.portalNode)){const ie=NZe(y);ie==null||ie.focus()}else(pe=ay(h??L.afterOutsideRef))==null||pe.focus()}})]})}function kvr(t,e={}){const{enabled:r=!0,event:n="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:l=LE}=e,u="rootStore"in t?t.rootStore:t,h=u.context.dataRef,d=j.useRef(void 0),f=Ece(),p=EE(),g=j.useMemo(()=>{function m(y,b,x,w){const A=_s(l,b,x);y&&w==="touch"&&s>0?p.start(s,()=>{u.setOpen(!0,A)}):u.setOpen(y,A)}function v(y,b,x){const w=h.current.openEvent,A=u.select("domReferenceElement")!==b;return y&&A||!y||!i?!0:w&&o?!x(w.type):!1}return{onPointerDown(y){d.current=RE(y.pointerType,!0)&&dZe(y.nativeEvent)?"virtual":y.pointerType},onMouseDown(y){const b=d.current,x=y.nativeEvent,w=u.select("open");if(y.button!==0||n==="click"||RE(b,!0)&&a)return;const A=v(w,y.currentTarget,C=>C==="click"||C==="mousedown"),S=Jp(x);if(Tce(S)){m(A,x,S,b);return}const T=y.currentTarget;f.request(()=>{m(A,x,T,b)})},onClick(y){if(n==="mousedown-only")return;const b=d.current;if(n==="mousedown"&&b){d.current=void 0;return}if(RE(b,!0)&&a)return;const x=u.select("open"),w=v(x,y.currentTarget,A=>A==="click"||A==="mousedown"||A==="keydown"||A==="keyup");m(w,y.nativeEvent,y.currentTarget,b)},onKeyDown(){d.current=void 0}}},[h,n,a,l,u,o,i,f,p,s]);return j.useMemo(()=>r?{reference:g}:Su,[r,g])}function Evr(){return!1}function _vr(t){return{escapeKey:typeof t=="boolean"?t:(t==null?void 0:t.escapeKey)??!1,outsidePress:typeof t=="boolean"?t:(t==null?void 0:t.outsidePress)??!0}}function Rvr(t,e={}){const{enabled:r=!0,escapeKey:n=!0,outsidePress:i=!0,outsidePressEvent:a="sloppy",referencePress:o=Evr,bubbles:s,externalTree:l}=e,u="rootStore"in t?t.rootStore:t,h=u.useState("open"),d=u.useState("floatingElement"),{dataRef:f}=u.context,p=NE(l),g=Pn(typeof i=="function"?i:()=>!1),m=typeof i=="function"?g:i,v=m!==!1,y=Pn(()=>a),{escapeKey:b,outsidePress:x}=_vr(s),w=j.useRef(!1),A=j.useRef(!1),S=j.useRef(!1),T=j.useRef(!1),C=j.useRef(""),k=j.useRef(null),E=EE(),_=EE(),P=Pn(()=>{_.clear(),f.current.insideReactTree=!1}),L=Pn(z=>{var G;const U=(G=f.current.floatingContext)==null?void 0:G.nodeId;return(p?ux(p.nodesRef.current,U):[]).some(q=>{var Y;return((Y=q.context)==null?void 0:Y.open)&&!q.context.dataRef.current[z]})}),R=Pn(z=>Sce(z,u.select("floatingElement"))||Sce(z,u.select("domReferenceElement"))),D=Pn(z=>{o()&&u.setOpen(!1,_s(LE,z.nativeEvent))}),M=Pn(z=>{if(!h||!r||!n||z.key!=="Escape"||T.current||!b&&L("__escapeKeyBubbles"))return;const U=h0r(z)?z.nativeEvent:z,Q=_s(AZe,U);u.setOpen(!1,Q),Q.isCanceled||z.preventDefault(),!b&&!Q.isPropagationAllowed&&z.stopPropagation()}),I=Pn(()=>{f.current.insideReactTree=!0,_.start(0,P)}),N=Pn(z=>{if(!h||!r||z.button!==0)return;const U=Jp(z.nativeEvent);Hn(u.select("floatingElement"),U)&&(w.current||(w.current=!0,A.current=!1))}),F=Pn(z=>{!h||!r||(z.defaultPrevented||z.nativeEvent.defaultPrevented)&&w.current&&(A.current=!0)});j.useEffect(()=>{if(!h||!r)return P;f.current.__escapeKeyBubbles=b,f.current.__outsidePressBubbles=x;const z=new Zp,U=new Zp;function Q(){z.clear(),T.current=!0}function G(){z.start(_E?5:0,()=>{T.current=!1})}function q(){S.current=!0,U.start(0,()=>{S.current=!1})}function Y(){w.current=!1,A.current=!1}function ne(){const Oe=C.current,Be=Oe==="pen"||!Oe?"mouse":Oe,Z=y(),le=typeof Z=="function"?Z():Z;return typeof le=="string"?le:le[Be]}function X(Oe){const Be=ne();return Be==="intentional"&&Oe.type!=="click"||Be==="sloppy"&&Oe.type==="click"}function J(Oe){var le;const Be=(le=f.current.floatingContext)==null?void 0:le.nodeId,Z=p&&ux(p.nodesRef.current,Be).some(be=>{var ae;return Sce(Oe,(ae=be.context)==null?void 0:ae.elements.floating)});return R(Oe)||Z}function ee(Oe){if(X(Oe)){Oe.type!=="click"&&!R(Oe)&&(U.clear(),S.current=!1),P();return}if(f.current.insideReactTree){P();return}const Be=Jp(Oe),Z=`[${BQ("inert")}]`,le=Yi(Be)?Be.getRootNode():null,be=Array.from((DE(le)?le:eo(u.select("floatingElement"))).querySelectorAll(Z)),ae=u.context.triggerElements;if(Be&&(ae.hasElement(Be)||ae.hasMatchingElement(se=>Hn(se,Be))))return;let K=Yi(Be)?Be:null;for(;K&&!sx(K);){const se=lx(K);if(sx(se)||!Yi(se))break;K=se}if(!(be.length&&Yi(Be)&&!y0r(Be)&&!Hn(Be,u.select("floatingElement"))&&be.every(se=>!Hn(K,se)))){if(Eo(Be)&&!("touches"in Oe)){const se=sx(Be),me=Dd(Be),oe=/auto|scroll/,ve=se||oe.test(me.overflowX),ce=se||oe.test(me.overflowY),De=ve&&Be.clientWidth>0&&Be.scrollWidth>Be.clientWidth,Le=ce&&Be.clientHeight>0&&Be.scrollHeight>Be.clientHeight,We=me.direction==="rtl",Ne=Le&&(We?Oe.offsetX<=Be.offsetWidth-Be.clientWidth:Oe.offsetX>Be.clientWidth),je=De&&Oe.offsetY>Be.clientHeight;if(Ne||je)return}if(!J(Oe)){if(ne()==="intentional"&&S.current){U.clear(),S.current=!1;return}typeof m=="function"&&!m(Oe)||L("__outsidePressBubbles")||(u.setOpen(!1,_s(wZe,Oe)),P())}}}function te(Oe){ne()!=="sloppy"||Oe.pointerType==="touch"||!u.select("open")||!r||R(Oe)||ee(Oe)}function pe(Oe){if(ne()!=="sloppy"||!u.select("open")||!r||R(Oe))return;const Be=Oe.touches[0];Be&&(k.current={startTime:Date.now(),startX:Be.clientX,startY:Be.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},E.start(1e3,()=>{k.current&&(k.current.dismissOnTouchEnd=!1,k.current.dismissOnMouseDown=!1)}))}function ie(Oe,Be){const Z=Jp(Oe);if(!Z)return;const le=bi(Z,Oe.type,()=>{Be(Oe),le()})}function Ce(Oe){C.current="touch",ie(Oe,pe)}function ke(Oe){E.clear(),Oe.type==="pointerdown"&&(C.current=Oe.pointerType),!(Oe.type==="mousedown"&&k.current&&!k.current.dismissOnMouseDown)&&ie(Oe,Be=>{Be.type==="pointerdown"?te(Be):ee(Be)})}function Ee(Oe){if(!w.current)return;const Be=A.current;if(Y(),ne()==="intentional"){if(Oe.type==="pointercancel"){Be&&q();return}if(!J(Oe)){if(Be){q();return}typeof m=="function"&&!m(Oe)||(U.clear(),S.current=!0,P())}}}function ue(Oe){if(ne()!=="sloppy"||!k.current||R(Oe))return;const Be=Oe.touches[0];if(!Be)return;const Z=Math.abs(Be.clientX-k.current.startX),le=Math.abs(Be.clientY-k.current.startY),be=Math.sqrt(Z*Z+le*le);be>5&&(k.current.dismissOnTouchEnd=!0),be>10&&(ee(Oe),E.clear(),k.current=null)}function de(Oe){ie(Oe,ue)}function xe(Oe){ne()!=="sloppy"||!k.current||R(Oe)||(k.current.dismissOnTouchEnd&&ee(Oe),E.clear(),k.current=null)}function ge(Oe){ie(Oe,xe)}const ze=eo(d),we=ey(n&&ey(bi(ze,"keydown",M),bi(ze,"compositionstart",Q),bi(ze,"compositionend",G)),v&&ey(bi(ze,"click",ke,!0),bi(ze,"pointerdown",ke,!0),bi(ze,"pointerup",Ee,!0),bi(ze,"pointercancel",Ee,!0),bi(ze,"mousedown",ke,!0),bi(ze,"mouseup",Ee,!0),bi(ze,"touchstart",Ce,!0),bi(ze,"touchmove",de,!0),bi(ze,"touchend",ge,!0)));return()=>{we(),z.clear(),U.clear(),Y(),S.current=!1,P()}},[f,d,n,v,m,h,r,b,x,M,P,y,L,R,p,u,E]);const B=j.useMemo(()=>({onKeyDown:M,onPointerDown:D,onClick:D}),[M,D]),V=j.useMemo(()=>({onKeyDown:M,onPointerDown:F,onMouseDown:F,onClickCapture:I,onMouseDownCapture(z){I(),N(z)},onPointerDownCapture(z){I(),N(z)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[M,I,N,F]);return j.useMemo(()=>r?{reference:B,floating:V,trigger:B}:{},[r,B,V])}function hJe(t,e,r){let{reference:n,floating:i}=t;const a=Vf(e),o=IQ(e),s=MQ(o),l=Uf(e),u=a==="y",h=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,f=n[s]/2-i[s]/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=ny(e);return g&&(p[o]+=f*(g==="end"?1:-1)*(r&&u?-1:1)),p}async function Dvr(t,e){var r;e===void 0&&(e={});const{x:n,y:i,platform:a,rects:o,elements:s,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=vm(e,t),g=Lce(p),v=s[f?d==="floating"?"reference":"floating":d],y=NQ(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(s.floating)),boundary:u,rootBoundary:h,strategy:l})),b=d==="floating"?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,x=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.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=NQ(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,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 Lvr=50,Mvr=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:a=[],platform:o}=r,s=o.detectOverflow?o:{...o,detectOverflow:Dvr},l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:d}=hJe(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:o,elements:s,middlewareData:l}=e,{element:u,padding:h=0}=vm(t,e)||{};if(u==null)return{};const d=Lce(h),f={x:r,y:n},p=IQ(i),g=MQ(p),m=await o.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(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let T=S?S[x]:0;(!T||!await(o.isElement==null?void 0:o.isElement(S)))&&(T=s.floating[x]||a.floating[g]);const C=w/2-A/2,k=T/2-m[g]/2-1,E=cx(d[y],k),_=cx(d[b],k),P=T-m[g]-_,L=T/2-m[g]/2+C,R=_ce(E,L,P),D=!l.arrow&&ny(i)!=null&&L!==R&&a.reference[g]/2-(LR<=0)){var _,P;const R=(((_=a.flip)==null?void 0:_.index)||0)+1,D=T[R];if(D&&(!(d==="alignment"?b!==Vf(D):!1)||E.every(N=>Vf(N.placement)===b?N.overflows[0]>0:!0)))return{data:{index:R,overflows:E},reset:{placement:D}};let M=(P=E.filter(I=>I.overflows[0]<=0).sort((I,N)=>I.overflows[1]-N.overflows[1])[0])==null?void 0:P.placement;if(!M)switch(p){case"bestFit":{var L;const I=(L=E.filter(N=>{if(S){const F=Vf(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];I&&(M=I);break}case"initialPlacement":M=s;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function dJe(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function fJe(t){return M0r.some(e=>t[e]>=0)}const Nvr=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r,platform:n}=e,{strategy:i="referenceHidden",...a}=vm(t,e);switch(i){case"referenceHidden":{const o=await n.detectOverflow(e,{...a,elementContext:"reference"}),s=dJe(o,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:fJe(s)}}}case"escaped":{const o=await n.detectOverflow(e,{...a,altBoundary:!0}),s=dJe(o,r.floating);return{data:{escapedOffsets:s,escaped:fJe(s)}}}default:return{}}}}},pJe=new Set(["left","top"]);async function Bvr(t,e){const{placement:r,platform:n,elements:i}=t,a=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=Uf(r),s=ny(r),l=Vf(r)==="y",u=pJe.has(o)?-1:1,h=a&&l?-1:1,d=vm(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 s&&typeof g=="number"&&(p=s==="end"?g*-1:g),l?{x:p*h,y:f*u}:{x:f*u,y:p*h}}const $vr=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:i,y:a,placement:o,middlewareData:s}=e,l=await Bvr(e,t);return o===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},Fvr=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:o=!0,crossAxis:s=!1,limiter:l={fn:b=>{let{x,y:w}=b;return{x,y:w}}},...u}=vm(t,e),h={x:r,y:n},d=await a.detectOverflow(e,u),f=Vf(i),p=Rce(f);let g=h[p],m=h[f];const v=(b,x)=>_ce(x+d[b==="y"?"top":"left"],x,x-d[b==="y"?"bottom":"right"]);o&&(g=v(p,g)),s&&(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]:o,[f]:s}}}}}},zvr=function(t){return t===void 0&&(t={}),{options:t,fn(e){var r,n;const{x:i,y:a,placement:o,rects:s,middlewareData:l}=e,{offset:u=0,mainAxis:h=!0,crossAxis:d=!0}=vm(t,e),f={x:i,y:a},p=Vf(o),g=Rce(p);let m=f[g],v=f[p];const y=vm(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=s.reference[g]-s.floating[A]+b.mainAxis,T=s.reference[g]+s.reference[A]-b.mainAxis;mT&&(m=T)}if(d){var x,w;const A=g==="y"?"width":"height",S=pJe.has(Uf(o)),T=s.reference[p]-s.floating[A]+(S&&((x=l.offset)==null?void 0:x[p])||0)+(S?0:b.crossAxis),C=s.reference[p]+s.reference[A]+(S?0:((w=l.offset)==null?void 0:w[p])||0)-(S?b.crossAxis:0);vC&&(v=C)}return{[g]:m,[p]:v}}}},Uvr=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:o=()=>{},...s}=vm(t,e),l=await i.detectOverflow(e,s),u=Uf(r),h=ny(r),d=Vf(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=cx(p-l[g],v),x=cx(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*ty(l.left,l.right):S=p-2*ty(l.top,l.bottom)),await o({...e,availableWidth:T,availableHeight:S});const C=await i.getDimensions(a.floating);return f!==C.width||p!==C.height?{reset:{rects:!0}}:{}}}};function gJe(t){const e=Dd(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=Eo(t),a=i?t.offsetWidth:r,o=i?t.offsetHeight:n,s=DQ(r)!==a||DQ(n)!==o;return s&&(r=a,n=o),{width:r,height:n,$:s}}function Yce(t){return Yi(t)?t:t.contextElement}function BE(t){const e=Yce(t);if(!Eo(e))return ry(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:a}=gJe(e);let o=(a?DQ(r.width):r.width)/n,s=(a?DQ(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const Vvr=ry(0);function mJe(t){const e=cs(t);return!xce()||!e.visualViewport?Vvr:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Qvr(t,e,r){return e===void 0&&(e=!1),!!r&&e&&r===cs(t)}function OA(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),a=Yce(t);let o=ry(1);e&&(n?Yi(n)&&(o=BE(n)):o=BE(t));const s=Qvr(a,r,n)?mJe(a):ry(0);let l=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,h=i.width/o.x,d=i.height/o.y;if(a&&n){const f=cs(a),p=Yi(n)?cs(n):n;let g=f,m=wce(g);for(;m&&p!==g;){const v=BE(m),y=m.getBoundingClientRect(),b=Dd(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=cs(m),m=wce(g)}}return NQ({width:h,height:d,x:l,y:u})}function GQ(t,e){const r=EQ(t).scrollLeft;return e?e.left+r:OA(Zv(t)).left+r}function vJe(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-GQ(t,r),i=r.top+e.scrollTop;return{x:n,y:i}}function Gvr(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t;const a=i==="fixed",o=Zv(n),s=e?kQ(e.floating):!1;if(n===o||s&&a)return r;let l={scrollLeft:0,scrollTop:0},u=ry(1);const h=ry(0),d=Eo(n);if((d||!a)&&((sc(n)!=="body"||q6(o))&&(l=EQ(n)),d)){const p=OA(n);u=BE(n),h.x=p.x+n.clientLeft,h.y=p.y+n.clientTop}const f=o&&!d&&!a?vJe(o,l):ry(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 Hvr(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function Wvr(t){const e=EQ(t),r=t.ownerDocument.body,n=ty(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ty(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-e.scrollLeft+GQ(t);const o=-e.scrollTop;return Dd(r).direction==="rtl"&&(a+=ty(t.clientWidth,r.clientWidth)-n),{width:n,height:i,x:a,y:o}}const Yvr=25;function qvr(t,e,r){r===void 0&&(r="viewport");const n=r==="layoutViewport",i=cs(t),a=Zv(t),o=i.visualViewport;let s=a.clientWidth,l=a.clientHeight,u=0,h=0;if(o){const f=!xce()||e==="fixed";n?f||(u=-o.offsetLeft,h=-o.offsetTop):(s=o.width,l=o.height,f&&(u=o.offsetLeft,h=o.offsetTop))}if(GQ(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<=Yvr&&(s-=y)}return{width:s,height:l,x:u,y:h}}function jvr(t,e){const r=OA(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,a=BE(t),o=t.clientWidth*a.x,s=t.clientHeight*a.y,l=i*a.x,u=n*a.y;return{width:o,height:s,x:l,y:u}}function yJe(t,e,r){let n;if(e==="viewport"||e==="layoutViewport")n=qvr(t,r,e);else if(e==="document")n=Wvr(Zv(t));else if(Yi(e))n=jvr(e,r);else{const i=mJe(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return NQ(n)}function Xvr(t,e){const r=e.get(t);if(r)return r;let n=j6(t,[],!1).filter(s=>Yi(s)&&sc(s)!=="body"),i=null;const a=Dd(t).position==="fixed";let o=a?lx(t):t;for(;Yi(o)&&!sx(o);){const s=Dd(o),l=bce(o),u=i?i.position:a?"fixed":"";!l&&(u==="fixed"||u==="absolute"&&s.position==="static")?n=n.filter(d=>d!==o):i=s,o=lx(o)}return e.set(t,n),n}function Kvr(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?kQ(e)?[]:Xvr(e,this._c):[].concat(r),n],s=yJe(e,o[0],i);let l=s.top,u=s.right,h=s.bottom,d=s.left;for(let f=1;f{s(!1,1e-7)},1e3)}T=!1}try{n=new IntersectionObserver(C,{...S,root:a.ownerDocument})}catch{n=new IntersectionObserver(C,S)}n.observe(t)}const l=cs(t),u=()=>s(r);return l.addEventListener("resize",u),s(!0),()=>{l.removeEventListener("resize",u),o()}}function jce(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=Yce(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&&s?nyr(u,r,a):null;let f=-1,p=null;o&&(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?OA(t):null;l&&v();function v(){const y=OA(t);m&&!wJe(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 iyr=$vr,ayr=Fvr,oyr=Pvr,syr=Uvr,lyr=Nvr,AJe=Ivr,cyr=zvr,uyr=(t,e,r)=>{const n=new Map,i=r??{},a={...ryr,...i.platform,_c:n};return Mvr(t,e,{...i,platform:a})};var hyr=typeof document<"u",dyr=function(){},HQ=hyr?j.useLayoutEffect:dyr;function WQ(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(!WQ(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)&&!WQ(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function SJe(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function TJe(t,e){const r=SJe(t);return Math.round(e*r)/r}function Xce(t){const e=j.useRef(t);return HQ(()=>{e.current=t}),e}function CJe(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:l,open:u}=t,[h,d]=j.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[f,p]=j.useState(n);WQ(f,n)||p(n);const[g,m]=j.useState(null),[v,y]=j.useState(null),b=j.useCallback(N=>{N!==S.current&&(S.current=N,m(N))},[]),x=j.useCallback(N=>{N!==T.current&&(T.current=N,y(N))},[]),w=a||g,A=o||v,S=j.useRef(null),T=j.useRef(null),C=j.useRef(h),k=l!=null,E=Xce(l),_=Xce(i),P=Xce(u),L=j.useCallback(()=>{if(!S.current||!T.current)return;const N={placement:e,strategy:r,middleware:f};_.current&&(N.platform=_.current),uyr(S.current,T.current,N).then(F=>{const B={...F,isPositioned:P.current!==!1};R.current&&!WQ(C.current,B)&&(C.current=B,kf.flushSync(()=>{d(B)}))})},[f,e,r,_,P]);HQ(()=>{u===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,d(N=>({...N,isPositioned:!1})))},[u]);const R=j.useRef(!1);HQ(()=>(R.current=!0,()=>{R.current=!1}),[]),HQ(()=>{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=j.useMemo(()=>({reference:S,floating:T,setReference:b,setFloating:x}),[b,x]),M=j.useMemo(()=>({reference:w,floating:A}),[w,A]),I=j.useMemo(()=>{const N={position:r,left:0,top:0};if(!M.floating)return N;const F=TJe(M.floating,h.x),B=TJe(M.floating,h.y);return s?{...N,transform:"translate("+F+"px, "+B+"px)",...SJe(M.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:F,top:B}},[r,s,M.floating,h.x,h.y]);return j.useMemo(()=>({...h,update:L,refs:D,elements:M,floatingStyles:I}),[h,L,D,M,I])}const fyr=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?AJe({element:n.current,padding:i}).fn(r):{}:n?AJe({element:n,padding:i}).fn(r):{}}}},OJe=(t,e)=>{const r=iyr(t);return{name:r.name,fn:r.fn,options:[t,e]}},kJe=(t,e)=>{const r=ayr(t);return{name:r.name,fn:r.fn,options:[t,e]}},EJe=(t,e)=>({fn:cyr(t).fn,options:[t,e]}),_Je=(t,e)=>{const r=oyr(t);return{name:r.name,fn:r.fn,options:[t,e]}},RJe=(t,e)=>{const r=syr(t);return{name:r.name,fn:r.fn,options:[t,e]}},pyr=(t,e)=>{const r=lyr(t);return{name:r.name,fn:r.fn,options:[t,e]}},gyr=(t,e)=>{const r=fyr(t);return{name:r.name,fn:r.fn,options:[t,e]}};var DJe={exports:{}},LJe={};/** + `),()=>{document.head.removeChild(h)}},[e]),H.jsx(Ldr,{isPresent:e,childRef:n,sizeRef:i,children:j.cloneElement(t,{ref:n})})}const Idr=({children:t,initial:e,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:a,mode:o})=>{const s=ole(Pdr),l=j.useId(),u=j.useCallback(d=>{s.set(d,!0);for(const f of s.values())if(!f)return;n&&n()},[s,n]),h=j.useMemo(()=>({id:l,initial:e,isPresent:r,custom:i,onExitComplete:u,register:d=>(s.set(d,!1),()=>s.delete(d))}),a?[Math.random(),u]:[r,u]);return j.useMemo(()=>{s.forEach((d,f)=>s.set(f,!1))},[r]),j.useEffect(()=>{!r&&!s.size&&n&&n()},[r]),o==="popLayout"&&(t=H.jsx(Mdr,{isPresent:r,children:t})),H.jsx(iQ.Provider,{value:h,children:t})};function Pdr(){return new Map}function Aje(t=!0){const e=j.useContext(iQ);if(e===null)return[!0,null];const{isPresent:r,onExitComplete:n,register:i}=e,a=j.useId();j.useEffect(()=>{t&&i(a)},[t]);const o=j.useCallback(()=>t&&n&&n(a),[a,n,t]);return!r&&n?[!1,o]:[!0]}const aQ=t=>t.key||"";function Sje(t){const e=[];return j.Children.forEach(t,r=>{j.isValidElement(r)&&e.push(r)}),e}const lle=typeof window<"u",Tje=lle?j.useLayoutEffect:j.useEffect,Ndr=({children:t,custom:e,initial:r=!0,onExitComplete:n,presenceAffectsLayout:i=!0,mode:a="sync",propagate:o=!1})=>{const[s,l]=Aje(o),u=j.useMemo(()=>Sje(t),[t]),h=o&&!s?[]:u.map(aQ),d=j.useRef(!0),f=j.useRef(u),p=ole(()=>new Map),[g,m]=j.useState(u),[v,y]=j.useState(u);Tje(()=>{d.current=!1,f.current=u;for(let w=0;w{const A=aQ(w),S=o&&!s?!1:u===v||h.includes(A),T=()=>{if(p.has(A))p.set(A,!0);else return;let C=!0;p.forEach(k=>{k||(C=!1)}),C&&(x==null||x(),y(f.current),o&&(l==null||l()),n&&n())};return H.jsx(Idr,{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)})})},_d=t=>t;let Cje=_d;const Bdr={useManualTiming:!1};function $dr(t){let e=new Set,r=new Set,n=!1,i=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function s(u){a.has(u)&&(l.schedule(u),t()),u(o)}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(o=u,n){i=!0;return}n=!0,[e,r]=[r,e],e.forEach(s),e.clear(),n=!1,i&&(i=!1,l.process(u))}};return l}const oQ=["read","resolveKeyframes","update","preRender","render","postRender"],Fdr=40;function Oje(t,e){let r=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,o=oQ.reduce((y,b)=>(y[b]=$dr(a),y),{}),{read:s,resolveKeyframes:l,update:u,preRender:h,render:d,postRender:f}=o,p=()=>{const y=performance.now();r=!1,i.delta=n?1e3/60:Math.max(Math.min(y-i.timestamp,Fdr),1),i.timestamp=y,i.isProcessing=!0,s.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:oQ.reduce((y,b)=>{const x=o[b];return y[b]=(w,A=!1,S=!1)=>(r||g(),x.schedule(w,A,S)),y},{}),cancel:y=>{for(let b=0;bEje[t].some(r=>!!e[r])};function zdr(t){for(const e in t)yE[e]={...yE[e],...t[e]}}const Udr=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 sQ(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Udr.has(t)}let _je=t=>!sQ(t);function Vdr(t){t&&(_je=e=>e.startsWith("on")?!sQ(e):t(e))}try{Vdr(require("@emotion/is-prop-valid").default)}catch{}function Qdr(t,e,r){const n={};for(const i in t)i==="values"&&typeof t.values=="object"||(_je(i)||r===!0&&sQ(i)||!e&&!sQ(i)||t.draggable&&i.startsWith("onDrag"))&&(n[i]=t[i]);return n}function Gdr(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 lQ=j.createContext({});function _6(t){return typeof t=="string"||Array.isArray(t)}function cQ(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const ule=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],hle=["initial",...ule];function uQ(t){return cQ(t.animate)||hle.some(e=>_6(t[e]))}function Rje(t){return!!(uQ(t)||t.variants)}function Hdr(t,e){if(uQ(t)){const{initial:r,animate:n}=t;return{initial:r===!1||_6(r)?r:void 0,animate:_6(n)?n:void 0}}return t.inherit!==!1?e:{}}function Wdr(t){const{initial:e,animate:r}=Hdr(t,j.useContext(lQ));return j.useMemo(()=>({initial:e,animate:r}),[Dje(e),Dje(r)])}function Dje(t){return Array.isArray(t)?t.join(" "):t}const Ydr=Symbol.for("motionComponentSymbol");function bE(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function qdr(t,e,r){return j.useCallback(n=>{n&&t.onMount&&t.onMount(n),e&&(n?e.mount(n):e.unmount()),r&&(typeof r=="function"?r(n):bE(r)&&(r.current=n))},[e])}const dle=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Lje="data-"+dle("framerAppearId"),{schedule:fle}=Oje(queueMicrotask,!1),Mje=j.createContext({});function jdr(t,e,r,n,i){var a,o;const{visualElement:s}=j.useContext(lQ),l=j.useContext(kje),u=j.useContext(iQ),h=j.useContext(sle).reducedMotion,d=j.useRef(null);n=n||l.renderer,!d.current&&n&&(d.current=n(t,{visualState:e,parent:s,props:r,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:h}));const f=d.current,p=j.useContext(Mje);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&Xdr(d.current,r,i,p);const g=j.useRef(!1);j.useInsertionEffect(()=>{f&&g.current&&f.update(r,u)});const m=r[Lje],v=j.useRef(!!m&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,m))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,m)));return Tje(()=>{f&&(g.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),fle.render(f.render),v.current&&f.animationState&&f.animationState.animateChanges())}),j.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 Xdr(t,e,r,n){const{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:l,layoutRoot:u}=e;t.projection=new r(t.latestValues,e["data-framer-portal-id"]?void 0:Ije(t.parent)),t.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&bE(s),visualElement:t,animationType:typeof a=="string"?a:"both",initialPromotionConfig:n,layoutScroll:l,layoutRoot:u})}function Ije(t){if(t)return t.options.allowProjection!==!1?t.projection:Ije(t.parent)}function Kdr({preloadedFeatures:t,createVisualElement:e,useRender:r,useVisualState:n,Component:i}){var a,o;t&&zdr(t);function s(u,h){let d;const f={...j.useContext(sle),...u,layoutId:Zdr(u)},{isStatic:p}=f,g=Wdr(u),m=n(u,p);if(!p&&lle){Jdr();const v=efr(f);d=v.MeasureLayout,g.visualElement=jdr(i,m,f,e,v.ProjectionNode)}return H.jsxs(lQ.Provider,{value:g,children:[d&&g.visualElement?H.jsx(d,{visualElement:g.visualElement,...f}):null,r(i,u,qdr(m,g.visualElement,h),m,p,g.visualElement)]})}s.displayName=`motion.${typeof i=="string"?i:`create(${(o=(a=i.displayName)!==null&&a!==void 0?a:i.name)!==null&&o!==void 0?o:""})`}`;const l=j.forwardRef(s);return l[Ydr]=i,l}function Zdr({layoutId:t}){const e=j.useContext(ale).id;return e&&t!==void 0?e+"-"+t:t}function Jdr(t,e){j.useContext(kje).strict}function efr(t){const{drag:e,layout:r}=yE;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 tfr=["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 ple(t){return typeof t!="string"||t.includes("-")?!1:!!(tfr.indexOf(t)>-1||/[A-Z]/u.test(t))}function Pje(t){const e=[{},{}];return t==null||t.values.forEach((r,n)=>{e[0][n]=r.get(),e[1][n]=r.getVelocity()}),e}function gle(t,e,r,n){if(typeof e=="function"){const[i,a]=Pje(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]=Pje(n);e=e(r!==void 0?r:t.custom,i,a)}return e}const mle=t=>Array.isArray(t),rfr=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),nfr=t=>mle(t)?t[t.length-1]||0:t,Fc=t=>!!(t&&t.getVelocity);function hQ(t){const e=Fc(t)?t.get():t;return rfr(e)?e.toValue():e}function ifr({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:r},n,i,a){const o={latestValues:afr(n,i,a,t),renderState:e()};return r&&(o.onMount=s=>r({props:n,current:s,...o}),o.onUpdate=s=>r(s)),o}const Nje=t=>(e,r)=>{const n=j.useContext(lQ),i=j.useContext(iQ),a=()=>ifr(t,e,n,i);return r?a():ole(a)};function afr(t,e,r,n){const i={},a=n(t,{});for(const f in a)i[f]=hQ(a[f]);let{initial:o,animate:s}=t;const l=uQ(t),u=Rje(t);e&&u&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),s===void 0&&(s=e.animate));let h=r?r.initial===!1:!1;h=h||o===!1;const d=h?s:o;if(d&&typeof d!="boolean"&&!cQ(d)){const f=Array.isArray(d)?d:[d];for(let p=0;pe=>typeof e=="string"&&e.startsWith(t),$je=Bje("--"),ofr=Bje("var(--"),vle=t=>ofr(t)?sfr.test(t.split("/*")[0].trim()):!1,sfr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Fje=(t,e)=>e&&typeof t=="number"?e.transform(t):t,jv=(t,e,r)=>r>e?e:rtypeof t=="number",parse:parseFloat,transform:t=>t},R6={...wE,transform:t=>jv(0,1,t)},dQ={...wE,default:1},D6=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ix=D6("deg"),gm=D6("%"),fn=D6("px"),lfr=D6("vh"),cfr=D6("vw"),zje={...gm,parse:t=>gm.parse(t)/100,transform:t=>gm.transform(t*100)},ufr={borderWidth:fn,borderTopWidth:fn,borderRightWidth:fn,borderBottomWidth:fn,borderLeftWidth:fn,borderRadius:fn,radius:fn,borderTopLeftRadius:fn,borderTopRightRadius:fn,borderBottomRightRadius:fn,borderBottomLeftRadius:fn,width:fn,maxWidth:fn,height:fn,maxHeight:fn,top:fn,right:fn,bottom:fn,left:fn,padding:fn,paddingTop:fn,paddingRight:fn,paddingBottom:fn,paddingLeft:fn,margin:fn,marginTop:fn,marginRight:fn,marginBottom:fn,marginLeft:fn,backgroundPositionX:fn,backgroundPositionY:fn},hfr={rotate:ix,rotateX:ix,rotateY:ix,rotateZ:ix,scale:dQ,scaleX:dQ,scaleY:dQ,scaleZ:dQ,skew:ix,skewX:ix,skewY:ix,distance:fn,translateX:fn,translateY:fn,translateZ:fn,x:fn,y:fn,z:fn,perspective:fn,transformPerspective:fn,opacity:R6,originX:zje,originY:zje,originZ:fn},Uje={...wE,transform:Math.round},yle={...ufr,...hfr,zIndex:Uje,size:fn,fillOpacity:R6,strokeOpacity:R6,numOctaves:Uje},dfr={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ffr=xE.length;function pfr(t,e,r){let n="",i=!0;for(let a=0;a({style:{},transform:{},transformOrigin:{},vars:{}}),Qje=()=>({...wle(),attrs:{}}),Ale=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Gje(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 Hje=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 Wje(t,e,r,n){Gje(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(Hje.has(i)?i:dle(i),e.attrs[i])}const fQ={};function bfr(t){Object.assign(fQ,t)}function Yje(t,{layout:e,layoutId:r}){return yA.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!fQ[t]||t==="opacity")}function Sle(t,e,r){var n;const{style:i}=t,a={};for(const o in i)(Fc(i[o])||e.style&&Fc(e.style[o])||Yje(o,t)||((n=r==null?void 0:r.getValue(o))===null||n===void 0?void 0:n.liveStyle)!==void 0)&&(a[o]=i[o]);return a}function qje(t,e,r){const n=Sle(t,e,r);for(const i in t)if(Fc(t[i])||Fc(e[i])){const a=xE.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[a]=t[i]}return n}function xfr(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 jje=["x","y","width","height","cx","cy","r"],wfr={useVisualState:Nje({scrapeMotionValuesFromProps:qje,createRenderState:Qje,onUpdate:({props:t,prevProps:e,current:r,renderState:n,latestValues:i})=>{if(!r)return;let a=!!t.drag;if(!a){for(const s in i)if(yA.has(s)){a=!0;break}}if(!a)return;let o=!e;if(e)for(let s=0;s{xfr(r,n),Ja.render(()=>{xle(n,i,Ale(r.tagName),t.transformTemplate),Wje(r,n)})})}})},Afr={useVisualState:Nje({scrapeMotionValuesFromProps:Sle,createRenderState:wle})};function Xje(t,e,r){for(const n in e)!Fc(e[n])&&!Yje(n,r)&&(t[n]=e[n])}function Sfr({transformTemplate:t},e){return j.useMemo(()=>{const r=wle();return ble(r,e,t),Object.assign({},r.vars,r.style)},[e])}function Tfr(t,e){const r=t.style||{},n={};return Xje(n,r,t),Object.assign(n,Sfr(t,e)),n}function Cfr(t,e){const r={},n=Tfr(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 Ofr(t,e,r,n){const i=j.useMemo(()=>{const a=Qje();return xle(a,e,Ale(n),t.transformTemplate),{...a.attrs,style:{...a.style}}},[e]);if(t.style){const a={};Xje(a,t.style,t),i.style={...a,...i.style}}return i}function kfr(t=!1){return(r,n,i,{latestValues:a},o)=>{const l=(ple(r)?Ofr:Cfr)(n,a,o,r),u=Qdr(n,typeof r=="string",t),h=r!==j.Fragment?{...u,...l,ref:i}:{},{children:d}=n,f=j.useMemo(()=>Fc(d)?d.get():d,[d]);return j.createElement(r,{...h,children:f})}}function Efr(t,e){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...ple(n)?wfr:Afr,preloadedFeatures:t,useRender:kfr(i),createVisualElement:e,Component:n};return Kdr(o)}}function Kje(t,e){if(!Array.isArray(e))return!1;const r=e.length;if(r!==t.length)return!1;for(let n=0;n(gQ===void 0&&mm.set(oc.isProcessing||Bdr.useManualTiming?oc.timestamp:performance.now()),gQ),set:t=>{gQ=t,queueMicrotask(_fr)}};function Cle(t,e){t.indexOf(e)===-1&&t.push(e)}function Ole(t,e){const r=t.indexOf(e);r>-1&&t.splice(r,1)}class kle{constructor(){this.subscriptions=[]}add(e){return Cle(this.subscriptions,e),()=>Ole(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 Dfr{constructor(e,r={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(n,i=!0)=>{const a=mm.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=mm.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Rfr(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 kle);const n=this.events[e].add(r);return e==="change"?()=>{n(),Ja.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=mm.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>eXe)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,eXe);return Jje(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 L6(t,e){return new Dfr(t,e)}function Lfr(t,e,r){t.hasValue(e)?t.getValue(e).set(r):t.addValue(e,L6(r))}function Mfr(t,e){const r=pQ(t,e);let{transitionEnd:n={},transition:i={},...a}=r||{};a={...a,...n};for(const o in a){const s=nfr(a[o]);Lfr(t,o,s)}}function Ifr(t){return!!(Fc(t)&&t.add)}function Ele(t,e){const r=t.getValue("willChange");if(Ifr(r))return r.add(e)}function tXe(t){return t.props[Lje]}function _le(t){let e;return()=>(e===void 0&&(e=t()),e)}const Pfr=_le(()=>window.ScrollTimeline!==void 0);class Nfr{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(Pfr()&&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 Bfr extends Nfr{then(e,r){return Promise.all(this.animations).then(e).catch(r)}}const Xv=t=>t*1e3,Kv=t=>t/1e3;function Rle(t){return typeof t=="function"}function rXe(t,e){t.timeline=e,t.onfinish=null}const Dle=t=>Array.isArray(t)&&typeof t[0]=="number",$fr={linearEasing:void 0};function Ffr(t,e){const r=_le(t);return()=>{var n;return(n=$fr[e])!==null&&n!==void 0?n:r()}}const mQ=Ffr(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),AE=(t,e,r)=>{const n=e-t;return n===0?1:(r-t)/n},nXe=(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})`,Lle={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:M6([0,.65,.55,1]),circOut:M6([.55,0,1,.45]),backIn:M6([.31,.01,.66,-.59]),backOut:M6([.33,1.53,.69,.99])};function aXe(t,e){if(t)return typeof t=="function"&&mQ()?nXe(t,e):Dle(t)?M6(t):Array.isArray(t)?t.map(r=>aXe(r,e)||Lle.easeOut):Lle[t]}const oXe=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,zfr=1e-7,Ufr=12;function Vfr(t,e,r,n,i){let a,o,s=0;do o=e+(r-e)/2,a=oXe(o,n,i)-t,a>0?r=o:e=o;while(Math.abs(a)>zfr&&++sVfr(a,0,1,t,r);return a=>a===0||a===1?a:oXe(i(a),e,n)}const sXe=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,lXe=t=>e=>1-t(1-e),cXe=I6(.33,1.53,.69,.99),Mle=lXe(cXe),uXe=sXe(Mle),hXe=t=>(t*=2)<1?.5*Mle(t):.5*(2-Math.pow(2,-10*(t-1))),Ile=t=>1-Math.sin(Math.acos(t)),dXe=lXe(Ile),fXe=sXe(Ile),pXe=t=>/^0[^.\s]+$/u.test(t);function Qfr(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||pXe(t):!0}const P6=t=>Math.round(t*1e5)/1e5,Ple=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Gfr(t){return t==null}const Hfr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Nle=(t,e)=>r=>!!(typeof r=="string"&&Hfr.test(r)&&r.startsWith(t)||e&&!Gfr(r)&&Object.prototype.hasOwnProperty.call(r,e)),gXe=(t,e,r)=>n=>{if(typeof n!="string")return n;const[i,a,o,s]=n.match(Ple);return{[t]:parseFloat(i),[e]:parseFloat(a),[r]:parseFloat(o),alpha:s!==void 0?parseFloat(s):1}},Wfr=t=>jv(0,255,t),Ble={...wE,transform:t=>Math.round(Wfr(t))},bA={test:Nle("rgb","red"),parse:gXe("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+Ble.transform(t)+", "+Ble.transform(e)+", "+Ble.transform(r)+", "+P6(R6.transform(n))+")"};function Yfr(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 $le={test:Nle("#"),parse:Yfr,transform:bA.transform},SE={test:Nle("hsl","hue"),parse:gXe("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+gm.transform(P6(e))+", "+gm.transform(P6(r))+", "+P6(R6.transform(n))+")"},zc={test:t=>bA.test(t)||$le.test(t)||SE.test(t),parse:t=>bA.test(t)?bA.parse(t):SE.test(t)?SE.parse(t):$le.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?bA.transform(t):SE.transform(t)},qfr=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function jfr(t){var e,r;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Ple))===null||e===void 0?void 0:e.length)||0)+(((r=t.match(qfr))===null||r===void 0?void 0:r.length)||0)>0}const mXe="number",vXe="color",Xfr="var",Kfr="var(",yXe="${}",Zfr=/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 N6(t){const e=t.toString(),r=[],n={color:[],number:[],var:[]},i=[];let a=0;const s=e.replace(Zfr,l=>(zc.test(l)?(n.color.push(a),i.push(vXe),r.push(zc.parse(l))):l.startsWith(Kfr)?(n.var.push(a),i.push(Xfr),r.push(l)):(n.number.push(a),i.push(mXe),r.push(parseFloat(l))),++a,yXe)).split(yXe);return{values:r,split:s,indexes:n,types:i}}function bXe(t){return N6(t).values}function xXe(t){const{split:e,types:r}=N6(t),n=e.length;return i=>{let a="";for(let o=0;otypeof t=="number"?0:t;function epr(t){const e=bXe(t);return xXe(t)(e.map(Jfr))}const ax={test:jfr,parse:bXe,createTransformer:xXe,getAnimatableNone:epr},tpr=new Set(["brightness","contrast","saturate","opacity"]);function rpr(t){const[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=r.match(Ple)||[];if(!n)return t;const i=r.replace(n,"");let a=tpr.has(e)?1:0;return n!==r&&(a*=100),e+"("+a+i+")"}const npr=/\b([a-z-]*)\(.*?\)/gu,Fle={...ax,getAnimatableNone:t=>{const e=t.match(npr);return e?e.map(rpr).join(" "):t}},ipr={...yle,color:zc,backgroundColor:zc,outlineColor:zc,fill:zc,stroke:zc,borderColor:zc,borderTopColor:zc,borderRightColor:zc,borderBottomColor:zc,borderLeftColor:zc,filter:Fle,WebkitFilter:Fle},zle=t=>ipr[t];function wXe(t,e){let r=zle(t);return r!==Fle&&(r=ax),r.getAnimatableNone?r.getAnimatableNone(e):void 0}const apr=new Set(["auto","none","0"]);function opr(t,e,r){let n=0,i;for(;nt===wE||t===fn,SXe=(t,e)=>parseFloat(t.split(", ")[e]),TXe=(t,e)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/u);if(i)return SXe(i[1],e);{const a=n.match(/^matrix\((.+)\)$/u);return a?SXe(a[1],t):0}},spr=new Set(["x","y","z"]),lpr=xE.filter(t=>!spr.has(t));function cpr(t){const e=[];return lpr.forEach(r=>{const n=t.getValue(r);n!==void 0&&(e.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),e}const TE={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:TXe(4,13),y:TXe(5,14)};TE.translateX=TE.x,TE.translateY=TE.y;const xA=new Set;let Ule=!1,Vle=!1;function CXe(){if(Vle){const t=Array.from(xA).filter(n=>n.needsMeasurement),e=new Set(t.map(n=>n.element)),r=new Map;e.forEach(n=>{const i=cpr(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,o])=>{var s;(s=n.getValue(a))===null||s===void 0||s.set(o)})}),t.forEach(n=>n.measureEndState()),t.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}Vle=!1,Ule=!1,xA.forEach(t=>t.complete()),xA.clear()}function OXe(){xA.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Vle=!0)})}function upr(){OXe(),CXe()}class Qle{constructor(e,r,n,i,a,o=!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=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(xA.add(this),Ule||(Ule=!0,Ja.read(OXe),Ja.resolveKeyframes(CXe))):(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),hpr=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function dpr(t){const e=hpr.exec(t);if(!e)return[,];const[,r,n,i]=e;return[`--${r??n}`,i]}function EXe(t,e,r=1){const[n,i]=dpr(t);if(!n)return;const a=window.getComputedStyle(e).getPropertyValue(n);if(a){const o=a.trim();return kXe(o)?parseFloat(o):o}return vle(i)?EXe(i,e,r+1):i}const _Xe=t=>e=>e.test(t),RXe=[wE,fn,gm,ix,cfr,lfr,{test:t=>t==="auto",parse:t=>t}],DXe=t=>RXe.find(_Xe(t));class LXe extends Qle{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 MXe=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(ax.test(t)||t==="0")&&!t.startsWith("url("));function fpr(t){const e=t[0];if(t.length===1)return!0;for(let r=0;rt!==null;function vQ(t,{repeat:e,repeatType:r="loop"},n){const i=t.filter(gpr),a=e&&r!=="loop"&&e%2===1?0:i.length-1;return!a||n===void 0?i[a]:n}const mpr=40;class IXe{constructor({autoplay:e=!0,delay:r=0,type:n="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=mm.now(),this.options={autoplay:e,delay:r,type:n,repeat:i,repeatDelay:a,repeatType:o,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>mpr?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&upr(),this._resolved}onKeyframesResolved(e,r){this.resolvedAt=mm.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:a,delay:o,onComplete:s,onUpdate:l,isGenerator:u}=this.options;if(!u&&!ppr(e,n,i,a))if(o)this.options.duration=0;else{l&&l(vQ(e,this.options,r)),s&&s(),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 Gle=2e4;function PXe(t){let e=0;const r=50;let n=t.next(e);for(;!n.done&&e=Gle?1/0:e}const ko=(t,e,r)=>t+(e-t)*r;function Hle(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 vpr({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,a=0,o=0;if(!e)i=a=o=r;else{const s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;i=Hle(l,s,t+1/3),a=Hle(l,s,t),o=Hle(l,s,t-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:n}}function yQ(t,e){return r=>r>0?e:t}const Wle=(t,e,r)=>{const n=t*t,i=r*(e*e-n)+n;return i<0?0:Math.sqrt(i)},ypr=[$le,bA,SE],bpr=t=>ypr.find(e=>e.test(t));function NXe(t){const e=bpr(t);if(!e)return!1;let r=e.parse(t);return e===SE&&(r=vpr(r)),r}const BXe=(t,e)=>{const r=NXe(t),n=NXe(e);if(!r||!n)return yQ(t,e);const i={...r};return a=>(i.red=Wle(r.red,n.red,a),i.green=Wle(r.green,n.green,a),i.blue=Wle(r.blue,n.blue,a),i.alpha=ko(r.alpha,n.alpha,a),bA.transform(i))},xpr=(t,e)=>r=>e(t(r)),B6=(...t)=>t.reduce(xpr),Yle=new Set(["none","hidden"]);function wpr(t,e){return Yle.has(t)?r=>r<=0?t:e:r=>r>=1?e:t}function Apr(t,e){return r=>ko(t,e,r)}function qle(t){return typeof t=="number"?Apr:typeof t=="string"?vle(t)?yQ:zc.test(t)?BXe:Cpr:Array.isArray(t)?$Xe:typeof t=="object"?zc.test(t)?BXe:Spr:yQ}function $Xe(t,e){const r=[...t],n=r.length,i=t.map((a,o)=>qle(a)(a,e[o]));return a=>{for(let o=0;o{for(const a in n)r[a]=n[a](i);return r}}function Tpr(t,e){var r;const n=[],i={color:0,var:0,number:0};for(let a=0;a{const r=ax.createTransformer(e),n=N6(t),i=N6(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?Yle.has(t)&&!i.values.length||Yle.has(e)&&!n.values.length?wpr(t,e):B6($Xe(Tpr(n,i),i.values),r):yQ(t,e)};function FXe(t,e,r){return typeof t=="number"&&typeof e=="number"&&typeof r=="number"?ko(t,e,r):qle(t)(t,e)}const Opr=5;function zXe(t,e,r){const n=Math.max(e-Opr,0);return Jje(r-t(n),e-n)}const Vo={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},jle=.001;function kpr({duration:t=Vo.duration,bounce:e=Vo.bounce,velocity:r=Vo.velocity,mass:n=Vo.mass}){let i,a,o=1-e;o=jv(Vo.minDamping,Vo.maxDamping,o),t=jv(Vo.minDuration,Vo.maxDuration,Kv(t)),o<1?(i=u=>{const h=u*o,d=h*t,f=h-r,p=Xle(u,o),g=Math.exp(-d);return jle-f/p*g},a=u=>{const d=u*o*t,f=d*r+r,p=Math.pow(o,2)*Math.pow(u,2)*t,g=Math.exp(-d),m=Xle(Math.pow(u,2),o);return(-i(u)+jle>0?-1:1)*((f-p)*g)/m}):(i=u=>{const h=Math.exp(-u*t),d=(u-r)*t+1;return-jle+h*d},a=u=>{const h=Math.exp(-u*t),d=(r-u)*(t*t);return h*d});const s=5/t,l=_pr(i,a,s);if(t=Xv(t),isNaN(l))return{stiffness:Vo.stiffness,damping:Vo.damping,duration:t};{const u=Math.pow(l,2)*n;return{stiffness:u,damping:o*2*Math.sqrt(n*u),duration:t}}}const Epr=12;function _pr(t,e,r){let n=r;for(let i=1;it[r]!==void 0)}function Lpr(t){let e={velocity:Vo.velocity,stiffness:Vo.stiffness,damping:Vo.damping,mass:Vo.mass,isResolvedFromDuration:!1,...t};if(!UXe(t,Dpr)&&UXe(t,Rpr))if(t.visualDuration){const r=t.visualDuration,n=2*Math.PI/(r*1.2),i=n*n,a=2*jv(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:Vo.mass,stiffness:i,damping:a}}else{const r=kpr(t);e={...e,...r,mass:Vo.mass},e.isResolvedFromDuration=!0}return e}function VXe(t=Vo.visualDuration,e=Vo.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],o=r.keyframes[r.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:u,mass:h,duration:d,velocity:f,isResolvedFromDuration:p}=Lpr({...r,velocity:-Kv(r.velocity||0)}),g=f||0,m=u/(2*Math.sqrt(l*h)),v=o-a,y=Kv(Math.sqrt(l/h)),b=Math.abs(v)<5;n||(n=b?Vo.restSpeed.granular:Vo.restSpeed.default),i||(i=b?Vo.restDelta.granular:Vo.restDelta.default);let x;if(m<1){const A=Xle(y,m);x=S=>{const T=Math.exp(-m*y*S);return o-T*((g+m*y*v)/A*Math.sin(A*S)+v*Math.cos(A*S))}}else if(m===1)x=A=>o-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),C=Math.min(A*S,300);return o-T*((g+m*y*v)*Math.sinh(C)+A*v*Math.cosh(C))/A}}const w={calculatedDuration:p&&d||null,next:A=>{const S=x(A);if(p)s.done=A>=d;else{let T=0;m<1&&(T=A===0?Xv(g):zXe(x,A,S));const C=Math.abs(T)<=n,k=Math.abs(o-S)<=i;s.done=C&&k}return s.value=s.done?o:S,s},toString:()=>{const A=Math.min(PXe(w),Gle),S=nXe(T=>w.next(A*T).value,A,30);return A+"ms "+S}};return w}function QXe({keyframes:t,velocity:e=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:l,restDelta:u=.5,restSpeed:h}){const d=t[0],f={done:!1,value:d},p=C=>s!==void 0&&Cl,g=C=>s===void 0?l:l===void 0||Math.abs(s-C)-m*Math.exp(-C/n),x=C=>y+b(C),w=C=>{const k=b(C),E=x(C);f.done=Math.abs(k)<=u,f.value=f.done?y:E};let A,S;const T=C=>{p(f.value)&&(A=C,S=VXe({keyframes:[f.value,g(f.value)],velocity:zXe(x,C,f.value),damping:i,stiffness:a,restDelta:u,restSpeed:h}))};return T(0),{calculatedDuration:null,next:C=>{let k=!1;return!S&&A===void 0&&(k=!0,w(C),T(C)),A!==void 0&&C>=A?S.next(C-A):(!k&&w(C),f)}}}const Mpr=I6(.42,0,1,1),Ipr=I6(0,0,.58,1),GXe=I6(.42,0,.58,1),Ppr=t=>Array.isArray(t)&&typeof t[0]!="number",Npr={linear:_d,easeIn:Mpr,easeInOut:GXe,easeOut:Ipr,circIn:Ile,circInOut:fXe,circOut:dXe,backIn:Mle,backInOut:uXe,backOut:cXe,anticipate:hXe},HXe=t=>{if(Dle(t)){Cje(t.length===4);const[e,r,n,i]=t;return I6(e,r,n,i)}else if(typeof t=="string")return Npr[t];return t};function Bpr(t,e,r){const n=[],i=r||FXe,a=t.length-1;for(let o=0;oe[0];if(a===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[a-1]&&(t=[...t].reverse(),e=[...e].reverse());const s=Bpr(e,n,i),l=s.length,u=h=>{if(o&&h1)for(;du(jv(t[0],t[a-1],h)):u}function Fpr(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const i=AE(0,e,n);t.push(ko(r,1,i))}}function zpr(t){const e=[0];return Fpr(e,t.length-1),e}function Upr(t,e){return t.map(r=>r*e)}function Vpr(t,e){return t.map(()=>e||GXe).splice(0,t.length-1)}function bQ({duration:t=300,keyframes:e,times:r,ease:n="easeInOut"}){const i=Ppr(n)?n.map(HXe):HXe(n),a={done:!1,value:e[0]},o=Upr(r&&r.length===e.length?r:zpr(e),t),s=$pr(o,e,{ease:Array.isArray(i)?i:Vpr(e,i)});return{calculatedDuration:t,next:l=>(a.value=s(l),a.done=l>=t,a)}}const Qpr=t=>{const e=({timestamp:r})=>t(r);return{start:()=>Ja.update(e,!0),stop:()=>nx(e),now:()=>oc.isProcessing?oc.timestamp:mm.now()}},Gpr={decay:QXe,inertia:QXe,tween:bQ,keyframes:bQ,spring:VXe},Hpr=t=>t/100;class Kle extends IXe{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,o=(i==null?void 0:i.KeyframeResolver)||Qle,s=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new o(a,s,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:o=0}=this.options,s=Rle(r)?r:Gpr[r]||bQ;let l,u;s!==bQ&&typeof e[0]!="number"&&(l=B6(Hpr,FXe(e[0],e[1])),e=[0,100]);const h=s({...this.options,keyframes:e});a==="mirror"&&(u=s({...this.options,keyframes:[...e].reverse(),velocity:-o})),h.calculatedDuration===null&&(h.calculatedDuration=PXe(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:C}=this.options;return{done:!0,value:C[C.length-1]}}const{finalKeyframe:i,generator:a,mirroredGenerator:o,mapPercentToKeyframes:s,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 C=Math.min(this.currentTime,h)/d;let k=Math.floor(C),E=C%1;!E&&C>=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=o)),x=jv(0,1,E)*d}const A=b?{done:!1,value:l[0]}:w.next(x);s&&(A.value=s(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=vQ(l,this.options,i)),v&&v(A.value),T&&this.finish(),A}get duration(){const{resolved:e}=this;return e?Kv(e.calculatedDuration):0}get time(){return Kv(this.currentTime)}set time(e){e=Xv(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=Kv(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Qpr,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 Wpr=new Set(["opacity","clipPath","filter","transform"]);function Ypr(t,e,r,{delay:n=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:s="easeInOut",times:l}={}){const u={[e]:r};l&&(u.offset=l);const h=aXe(s,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:o==="reverse"?"alternate":"normal"})}const qpr=_le(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),xQ=10,jpr=2e4;function Xpr(t){return Rle(t.type)||t.type==="spring"||!iXe(t.ease)}function Kpr(t,e){const r=new Kle({...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(o,s),r,n,i),this.resolver.scheduleResolve()}initPlayback(e,r){let{duration:n=300,times:i,ease:a,type:o,motionValue:s,name:l,startTime:u}=this.options;if(!s.owner||!s.owner.current)return!1;if(typeof a=="string"&&mQ()&&Zpr(a)&&(a=WXe[a]),Xpr(this.options)){const{onComplete:d,onUpdate:f,motionValue:p,element:g,...m}=this.options,v=Kpr(e,m);e=v.keyframes,e.length===1&&(e[1]=e[0]),n=v.duration,i=v.times,a=v.ease,o="keyframes"}const h=Ypr(s.owner.current,l,e,{...this.options,duration:n,times:i,ease:a});return h.startTime=u??this.calcStartTime(),this.pendingTimeline?(rXe(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:d}=this.options;s.set(vQ(e,this.options,r)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:n,times:i,type:o,ease:a,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:r}=e;return Kv(r)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:r}=e;return Kv(r.currentTime||0)}set time(e){const{resolved:r}=this;if(!r)return;const{animation:n}=r;n.currentTime=Xv(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 _d;const{animation:n}=r;rXe(n,e)}return _d}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:o,times:s}=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 Kle({...p,keyframes:n,duration:i,type:a,ease:o,times:s,isGenerator:!0}),m=Xv(this.time);u.setWithVelocity(g.sample(m-xQ).value,g.sample(m).value,xQ)}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:o,type:s}=e;if(!r||!r.owner||!(r.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=r.owner.getProps();return qpr()&&n&&Wpr.has(n)&&!l&&!u&&!i&&a!=="mirror"&&o!==0&&s!=="inertia"}}const Jpr={type:"spring",stiffness:500,damping:25,restSpeed:10},egr=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),tgr={type:"keyframes",duration:.8},rgr={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ngr=(t,{keyframes:e})=>e.length>2?tgr:yA.has(t)?t.startsWith("scale")?egr(e[1]):Jpr:rgr;function igr({when:t,delay:e,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:l,elapsed:u,...h}){return!!Object.keys(h).length}const Zle=(t,e,r,n={},i,a)=>o=>{const s=Tle(n,t)||{},l=s.delay||n.delay||0;let{elapsed:u=0}=n;u=u-Xv(l);let h={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:e.getVelocity(),...s,delay:-u,onUpdate:f=>{e.set(f),s.onUpdate&&s.onUpdate(f)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:t,motionValue:e,element:a?void 0:i};igr(s)||(h={...h,...ngr(t,h)}),h.duration&&(h.duration=Xv(h.duration)),h.repeatDelay&&(h.repeatDelay=Xv(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=vQ(h.keyframes,s);if(f!==void 0)return Ja.update(()=>{h.onUpdate(f),h.onComplete()}),new Bfr([])}return!a&&YXe.supports(h)?new YXe(h):new Kle(h)};function agr({protectedKeys:t,needsAnimating:e},r){const n=t.hasOwnProperty(r)&&e[r]!==!0;return e[r]=!1,n}function qXe(t,e,{delay:r=0,transitionOverride:n,type:i}={}){var a;let{transition:o=t.getDefaultTransition(),transitionEnd:s,...l}=e;n&&(o=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&&agr(h,d))continue;const g={delay:r,...Tle(o||{},d)};let m=!1;if(window.MotionHandoffAnimation){const y=tXe(t);if(y){const b=window.MotionHandoffAnimation(y,d,Ja);b!==null&&(g.startTime=b,m=!0)}}Ele(t,d),f.start(Zle(d,f,p,t.shouldReduceMotion&&Zje.has(d)?{type:!1}:g,t,m));const v=f.animation;v&&u.push(v)}return s&&Promise.all(u).then(()=>{Ja.update(()=>{s&&Mfr(t,s)})}),u}function Jle(t,e,r={}){var n;const i=pQ(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 o=i?()=>Promise.all(qXe(t,i,r)):()=>Promise.resolve(),s=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:h=0,staggerChildren:d,staggerDirection:f}=a;return ogr(t,e,h+u,d,f,r)}:()=>Promise.resolve(),{when:l}=a;if(l){const[u,h]=l==="beforeChildren"?[o,s]:[s,o];return u().then(()=>h())}else return Promise.all([o(),s(r.delay)])}function ogr(t,e,r=0,n=0,i=1,a){const o=[],s=(t.variantChildren.size-1)*n,l=i===1?(u=0)=>u*n:(u=0)=>s-u*n;return Array.from(t.variantChildren).sort(sgr).forEach((u,h)=>{u.notify("AnimationStart",e),o.push(Jle(u,e,{...a,delay:r+l(h)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(o)}function sgr(t,e){return t.sortNodePosition(e)}function lgr(t,e,r={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const i=e.map(a=>Jle(t,a,r));n=Promise.all(i)}else if(typeof e=="string")n=Jle(t,e,r);else{const i=typeof e=="function"?pQ(t,e,r.custom):e;n=Promise.all(qXe(t,i,r))}return n.then(()=>{t.notify("AnimationComplete",e)})}const cgr=hle.length;function jXe(t){if(!t)return;if(!t.isControllingVariants){const r=t.parent?jXe(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})=>lgr(t,r,n)))}function fgr(t){let e=dgr(t),r=XXe(),n=!0;const i=l=>(u,h)=>{var d;const f=pQ(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 o(l){const{props:u}=t,h=jXe(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:P={}}=b,L={...P,..._},R=I=>{C=!0,f.has(I)&&(k=!0,f.delete(I)),b.needsAnimating[I]=!0;const N=t.getValue(I);N&&(N.liveStyle=!1)};for(const I in L){const N=_[I],F=P[I];if(p.hasOwnProperty(I))continue;let B=!1;mle(N)&&mle(F)?B=!Kje(N,F):B=N!==F,B?N!=null?R(I):f.add(I):N!==void 0&&f.has(I)?R(I):b.protectedKeys[I]=!0}b.prevProp=x,b.prevResolvedValues=_,b.isActive&&(p={...p,..._}),n&&t.blockInitialAnimation&&(C=!1),C&&(!(S&&T)||k)&&d.push(...E.map(I=>({animation:I,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 s(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=o(l);for(const f in r)r[f].protectedKeys={};return d}return{animateChanges:o,setActive:s,setAnimateFunction:a,getState:()=>r,reset:()=>{r=XXe(),n=!0}}}function pgr(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Kje(e,t):!1}function wA(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function XXe(){return{animate:wA(!0),whileInView:wA(),whileHover:wA(),whileTap:wA(),whileDrag:wA(),whileFocus:wA(),exit:wA()}}class ox{constructor(e){this.isMounted=!1,this.node=e}update(){}}class ggr extends ox{constructor(e){super(e),e.animationState||(e.animationState=fgr(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();cQ(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 mgr=0;class vgr extends ox{constructor(){super(...arguments),this.id=mgr++}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 ygr={animation:{Feature:ggr},exit:{Feature:vgr}},Xp={x:!1,y:!1};function KXe(){return Xp.x||Xp.y}function bgr(t){return t==="x"||t==="y"?Xp[t]?null:(Xp[t]=!0,()=>{Xp[t]=!1}):Xp.x||Xp.y?null:(Xp.x=Xp.y=!0,()=>{Xp.x=Xp.y=!1})}const ece=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function $6(t,e,r,n={passive:!0}){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r)}function F6(t){return{point:{x:t.pageX,y:t.pageY}}}const xgr=t=>e=>ece(e)&&t(e,F6(e));function z6(t,e,r,n){return $6(t,e,xgr(r),n)}const ZXe=(t,e)=>Math.abs(t-e);function wgr(t,e){const r=ZXe(t.x,e.x),n=ZXe(t.y,e.y);return Math.sqrt(r**2+n**2)}class JXe{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=rce(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=wgr(d.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:g}=d,{timestamp:m}=oc;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=tce(f,this.transformPagePoint),Ja.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=rce(d.type==="pointercancel"?this.lastMoveEventInfo:tce(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,v),g&&g(d,v)},!ece(e))return;this.dragSnapToOrigin=a,this.handlers=r,this.transformPagePoint=n,this.contextWindow=i||window;const o=F6(e),s=tce(o,this.transformPagePoint),{point:l}=s,{timestamp:u}=oc;this.history=[{...l,timestamp:u}];const{onSessionStart:h}=r;h&&h(e,rce(s,this.history)),this.removeListeners=B6(z6(this.contextWindow,"pointermove",this.handlePointerMove),z6(this.contextWindow,"pointerup",this.handlePointerUp),z6(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),nx(this.updatePoint)}}function tce(t,e){return e?{point:e(t.point)}:t}function eKe(t,e){return{x:t.x-e.x,y:t.y-e.y}}function rce({point:t},e){return{point:t,delta:eKe(t,tKe(e)),offset:eKe(t,Agr(e)),velocity:Sgr(e,.1)}}function Agr(t){return t[0]}function tKe(t){return t[t.length-1]}function Sgr(t,e){if(t.length<2)return{x:0,y:0};let r=t.length-1,n=null;const i=tKe(t);for(;r>=0&&(n=t[r],!(i.timestamp-n.timestamp>Xv(e)));)r--;if(!n)return{x:0,y:0};const a=Kv(i.timestamp-n.timestamp);if(a===0)return{x:0,y:0};const o={x:(i.x-n.x)/a,y:(i.y-n.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const rKe=1e-4,Tgr=1-rKe,Cgr=1+rKe,nKe=.01,Ogr=0-nKe,kgr=0+nKe;function Rd(t){return t.max-t.min}function Egr(t,e,r){return Math.abs(t-e)<=r}function iKe(t,e,r,n=.5){t.origin=n,t.originPoint=ko(e.min,e.max,t.origin),t.scale=Rd(r)/Rd(e),t.translate=ko(r.min,r.max,t.origin)-t.originPoint,(t.scale>=Tgr&&t.scale<=Cgr||isNaN(t.scale))&&(t.scale=1),(t.translate>=Ogr&&t.translate<=kgr||isNaN(t.translate))&&(t.translate=0)}function U6(t,e,r,n){iKe(t.x,e.x,r.x,n?n.originX:void 0),iKe(t.y,e.y,r.y,n?n.originY:void 0)}function aKe(t,e,r){t.min=r.min+e.min,t.max=t.min+Rd(e)}function _gr(t,e,r){aKe(t.x,e.x,r.x),aKe(t.y,e.y,r.y)}function oKe(t,e,r){t.min=e.min-r.min,t.max=t.min+Rd(e)}function V6(t,e,r){oKe(t.x,e.x,r.x),oKe(t.y,e.y,r.y)}function Rgr(t,{min:e,max:r},n){return e!==void 0&&tr&&(t=n?ko(r,t,n.max):Math.min(t,r)),t}function sKe(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 Dgr(t,{top:e,left:r,bottom:n,right:i}){return{x:sKe(t.x,r,i),y:sKe(t.y,e,n)}}function lKe(t,e){let r=e.min-t.min,n=e.max-t.max;return e.max-e.minn?r=AE(e.min,e.max-n,t.min):n>i&&(r=AE(t.min,t.max-i,e.min)),jv(0,1,r)}function Igr(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 nce=.35;function Pgr(t=nce){return t===!1?t=0:t===!0&&(t=nce),{x:cKe(t,"left","right"),y:cKe(t,"top","bottom")}}function cKe(t,e,r){return{min:uKe(t,e),max:uKe(t,r)}}function uKe(t,e){return typeof t=="number"?t:t[e]||0}const hKe=()=>({translate:0,scale:1,origin:0,originPoint:0}),CE=()=>({x:hKe(),y:hKe()}),dKe=()=>({min:0,max:0}),ls=()=>({x:dKe(),y:dKe()});function Ff(t){return[t("x"),t("y")]}function fKe({top:t,left:e,right:r,bottom:n}){return{x:{min:e,max:r},y:{min:t,max:n}}}function Ngr({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Bgr(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 ice(t){return t===void 0||t===1}function ace({scale:t,scaleX:e,scaleY:r}){return!ice(t)||!ice(e)||!ice(r)}function AA(t){return ace(t)||pKe(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function pKe(t){return gKe(t.x)||gKe(t.y)}function gKe(t){return t&&t!=="0%"}function wQ(t,e,r){const n=t-r,i=e*n;return r+i}function mKe(t,e,r,n,i){return i!==void 0&&(t=wQ(t,i,n)),wQ(t,r,n)+e}function oce(t,e=0,r=1,n,i){t.min=mKe(t.min,e,r,n,i),t.max=mKe(t.max,e,r,n,i)}function vKe(t,{x:e,y:r}){oce(t.x,e.translate,e.scale,e.originPoint),oce(t.y,r.translate,r.scale,r.originPoint)}const yKe=.999999999999,bKe=1.0000000000001;function $gr(t,e,r,n=!1){const i=r.length;if(!i)return;e.x=e.y=1;let a,o;for(let s=0;syKe&&(e.x=1),e.yyKe&&(e.y=1)}function OE(t,e){t.min=t.min+e,t.max=t.max+e}function xKe(t,e,r,n,i=.5){const a=ko(t.min,t.max,i);oce(t,e,r,a,n)}function kE(t,e){xKe(t.x,e.x,e.scaleX,e.scale,e.originX),xKe(t.y,e.y,e.scaleY,e.scale,e.originY)}function wKe(t,e){return fKe(Bgr(t.getBoundingClientRect(),e))}function Fgr(t,e,r){const n=wKe(t,r),{scroll:i}=e;return i&&(OE(n.x,i.offset.x),OE(n.y,i.offset.y)),n}const AKe=({current:t})=>t?t.ownerDocument.defaultView:null,zgr=new WeakMap;class Ugr{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=ls(),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(F6(h).point)},a=(h,d)=>{const{drag:f,dragPropagation:p,onDragStart:g}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=bgr(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),Ff(v=>{let y=this.getAxisMotionValue(v).get()||0;if(gm.test(y)){const{projection:b}=this.visualElement;if(b&&b.layout){const x=b.layout.layoutBox[v];x&&(y=Rd(x)*(parseFloat(y)/100))}}this.originPoint[v]=y}),g&&Ja.postRender(()=>g(h,d)),Ele(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},o=(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=Vgr(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)},s=(h,d)=>this.stop(h,d),l=()=>Ff(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 JXe(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:AKe(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&&Ja.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||!AQ(e,i,this.currentDirection))return;const a=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=Rgr(o,this.constraints[e],this.elastic[e])),a.set(o)}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&&bE(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&i?this.constraints=Dgr(i.layoutBox,r):this.constraints=!1,this.elastic=Pgr(n),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Ff(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Igr(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:r}=this.getProps();if(!e||!bE(e))return!1;const n=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=Fgr(n,i.root,this.visualElement.getTransformPagePoint());let o=Lgr(i.layout.layoutBox,a);if(r){const s=r(Ngr(o));this.hasMutatedConstraints=!!s,s&&(o=fKe(s))}return o}startAnimation(e){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=Ff(h=>{if(!AQ(h,r,this.currentDirection))return;let d=l&&l[h]||{};o&&(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(s)}startAxisValueAnimation(e,r){const n=this.getAxisMotionValue(e);return Ele(this.visualElement,e),n.start(Zle(e,n,0,r,this.visualElement,!1))}stopAnimation(){Ff(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Ff(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){Ff(r=>{const{drag:n}=this.getProps();if(!AQ(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(r);if(i&&i.layout){const{min:o,max:s}=i.layout.layoutBox[r];a.set(e[r]-ko(o,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!bE(r)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ff(o=>{const s=this.getAxisMotionValue(o);if(s&&this.constraints!==!1){const l=s.get();i[o]=Mgr({min:l,max:l},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Ff(o=>{if(!AQ(o,e,null))return;const s=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];s.set(ko(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;zgr.set(this.visualElement,this);const e=this.visualElement.current,r=z6(e,"pointerdown",l=>{const{drag:u,dragListener:h=!0}=this.getProps();u&&h&&this.start(l)}),n=()=>{const{dragConstraints:l}=this.getProps();bE(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()),Ja.read(n);const o=$6(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ff(h=>{const d=this.getAxisMotionValue(h);d&&(this.originPoint[h]+=l[h].translate,d.set(d.get()+l[h].translate))}),this.visualElement.render())});return()=>{o(),r(),a(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:o=nce,dragMomentum:s=!0}=e;return{...e,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:a,dragElastic:o,dragMomentum:s}}}function AQ(t,e,r){return(e===!0||e===t)&&(r===null||r===t)}function Vgr(t,e=10){let r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}class Qgr extends ox{constructor(e){super(e),this.removeGroupControls=_d,this.removeListeners=_d,this.controls=new Ugr(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||_d}unmount(){this.removeGroupControls(),this.removeListeners()}}const SKe=t=>(e,r)=>{t&&Ja.postRender(()=>t(e,r))};class Ggr extends ox{constructor(){super(...arguments),this.removePointerDownListener=_d}onPointerDown(e){this.session=new JXe(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:AKe(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:SKe(e),onStart:SKe(r),onMove:n,onEnd:(a,o)=>{delete this.session,i&&Ja.postRender(()=>i(a,o))}}}mount(){this.removePointerDownListener=z6(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 SQ={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function TKe(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Q6={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(fn.test(t))t=parseFloat(t);else return t;const r=TKe(t,e.target.x),n=TKe(t,e.target.y);return`${r}% ${n}%`}},Hgr={correct:(t,{treeScale:e,projectionDelta:r})=>{const n=t,i=ax.parse(t);if(i.length>5)return n;const a=ax.createTransformer(t),o=typeof i[0]!="number"?1:0,s=r.x.scale*e.x,l=r.y.scale*e.y;i[0+o]/=s,i[1+o]/=l;const u=ko(s,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),a(i)}};class Wgr extends j.Component{componentDidMount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:a}=e;bfr(Ygr),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()})),SQ.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:r,visualElement:n,drag:i,isPresent:a}=this.props,o=n.projection;return o&&(o.isPresent=a,i||e.layoutDependency!==r||r===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||Ja.postRender(()=>{const s=o.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),fle.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 CKe(t){const[e,r]=Aje(),n=j.useContext(ale);return H.jsx(Wgr,{...t,layoutGroup:n,switchLayoutGroup:j.useContext(Mje),isPresent:e,safeToRemove:r})}const Ygr={borderRadius:{...Q6,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Q6,borderTopRightRadius:Q6,borderBottomLeftRadius:Q6,borderBottomRightRadius:Q6,boxShadow:Hgr};function qgr(t,e,r){const n=Fc(t)?t:L6(t);return n.start(Zle("",n,e,r)),n.animation}function jgr(t){return t instanceof SVGElement&&t.tagName!=="svg"}const Xgr=(t,e)=>t.depth-e.depth;class Kgr{constructor(){this.children=[],this.isDirty=!1}add(e){Cle(this.children,e),this.isDirty=!0}remove(e){Ole(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Xgr),this.isDirty=!1,this.children.forEach(e)}}function Zgr(t,e){const r=mm.now(),n=({timestamp:i})=>{const a=i-r;a>=e&&(nx(n),t(a-e))};return Ja.read(n,!0),()=>nx(n)}const OKe=["TopLeft","TopRight","BottomLeft","BottomRight"],Jgr=OKe.length,kKe=t=>typeof t=="string"?parseFloat(t):t,EKe=t=>typeof t=="number"||fn.test(t);function emr(t,e,r,n,i,a){i?(t.opacity=ko(0,r.opacity!==void 0?r.opacity:1,tmr(n)),t.opacityExit=ko(e.opacity!==void 0?e.opacity:1,0,rmr(n))):a&&(t.opacity=ko(e.opacity!==void 0?e.opacity:1,r.opacity!==void 0?r.opacity:1,n));for(let o=0;one?1:r(AE(t,e,n))}function DKe(t,e){t.min=e.min,t.max=e.max}function zf(t,e){DKe(t.x,e.x),DKe(t.y,e.y)}function LKe(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function MKe(t,e,r,n,i){return t-=e,t=wQ(t,1/r,n),i!==void 0&&(t=wQ(t,1/i,n)),t}function nmr(t,e=0,r=1,n=.5,i,a=t,o=t){if(gm.test(e)&&(e=parseFloat(e),e=ko(o.min,o.max,e/100)-o.min),typeof e!="number")return;let s=ko(a.min,a.max,n);t===a&&(s-=e),t.min=MKe(t.min,e,r,s,i),t.max=MKe(t.max,e,r,s,i)}function IKe(t,e,[r,n,i],a,o){nmr(t,e[r],e[n],e[i],e.scale,a,o)}const imr=["x","scaleX","originX"],amr=["y","scaleY","originY"];function PKe(t,e,r,n){IKe(t.x,e,imr,r?r.x:void 0,n?n.x:void 0),IKe(t.y,e,amr,r?r.y:void 0,n?n.y:void 0)}function NKe(t){return t.translate===0&&t.scale===1}function BKe(t){return NKe(t.x)&&NKe(t.y)}function $Ke(t,e){return t.min===e.min&&t.max===e.max}function omr(t,e){return $Ke(t.x,e.x)&&$Ke(t.y,e.y)}function FKe(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function zKe(t,e){return FKe(t.x,e.x)&&FKe(t.y,e.y)}function UKe(t){return Rd(t.x)/Rd(t.y)}function VKe(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class smr{constructor(){this.members=[]}add(e){Cle(this.members,e),e.scheduleRender()}remove(e){if(Ole(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 lmr(t,e,r){let n="";const i=t.x.translate/e.x,a=t.y.translate/e.y,o=(r==null?void 0:r.z)||0;if((i||a||o)&&(n=`translate3d(${i}px, ${a}px, ${o}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 s=t.x.scale*e.x,l=t.y.scale*e.y;return(s!==1||l!==1)&&(n+=`scale(${s}, ${l})`),n||"none"}const SA={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},G6=typeof window<"u"&&window.MotionDebug!==void 0,sce=["","X","Y","Z"],cmr={visibility:"hidden"},QKe=1e3;let umr=0;function lce(t,e,r,n){const{latestValues:i}=e;i[t]&&(r[t]=i[t],e.setStaticValue(t,0),n&&(n[t]=0))}function GKe(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const r=tXe(e);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:i,layoutId:a}=t.options;window.MotionCancelOptimisedAnimation(r,"transform",Ja,!(i||a))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&GKe(n)}function HKe({attachResizeListener:t,defaultParent:e,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o={},s=e==null?void 0:e()){this.id=umr++,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,G6&&(SA.totalNodes=SA.resolvedTargetDeltas=SA.recalculatedProjection=0),this.nodes.forEach(fmr),this.nodes.forEach(ymr),this.nodes.forEach(bmr),this.nodes.forEach(pmr),G6&&window.MotionDebug.record(SA)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=Zgr(f,250),SQ.hasAnimatedSinceResize&&(SQ.hasAnimatedSinceResize=!1,this.nodes.forEach(YKe))})}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()||Tmr,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=h.getProps(),b=!this.targetLayout||!zKe(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={...Tle(m,"layout"),onPlay:v,onComplete:y};(h.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else f||YKe(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,nx(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(xmr),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&GKe(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;qKe(d.x,o.x,A),qKe(d.y,o.y,A),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(V6(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Amr(this.relativeTarget,this.relativeTargetOrigin,f,A),x&&omr(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=ls()),zf(x,this.relativeTarget)),m&&(this.animationValues=h,emr(h,u,this.latestValues,A,b,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=A},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(nx(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ja.update(()=>{SQ.hasAnimatedSinceResize=!0,this.currentAnimation=qgr(0,QKe,{...o,onUpdate:s=>{this.mixTargetDelta(s),o.onUpdate&&o.onUpdate(s)},onComplete:()=>{o.onComplete&&o.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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(QKe),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:h}=o;if(!(!s||!l||!u)){if(this!==o&&this.layout&&u&&JKe(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||ls();const d=Rd(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const f=Rd(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}zf(s,l),kE(s,h),U6(this.projectionDeltaWithTransform,this.layoutCorrected,s,h)}}registerSharedNode(o,s){this.sharedNodes.has(o)||this.sharedNodes.set(o,new smr),this.sharedNodes.get(o).add(s);const u=s.options.initialPromotionConfig;s.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(s):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:s}=this.options;return s?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:s}=this.options;return s?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let s=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(s=!0),!s)return;const u={};l.z&&lce("z",o,u,this.animationValues);for(let h=0;h{var s;return(s=o.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(WKe),this.root.sharedNodes.clear()}}}function hmr(t){t.updateLayout()}function dmr(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,o=r.source!==t.layout.source;a==="size"?Ff(d=>{const f=o?r.measuredBox[d]:r.layoutBox[d],p=Rd(f);f.min=n[d].min,f.max=f.min+p}):JKe(a,r.layoutBox,n)&&Ff(d=>{const f=o?r.measuredBox[d]:r.layoutBox[d],p=Rd(n[d]);f.max=f.min+p,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[d].max=t.relativeTarget[d].min+p)});const s=CE();U6(s,n,r.layoutBox);const l=CE();o?U6(l,t.applyTransform(i,!0),r.measuredBox):U6(l,n,r.layoutBox);const u=!BKe(s);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=ls();V6(g,r.layoutBox,f.layoutBox);const m=ls();V6(m,n,p.layoutBox),zKe(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:s,hasLayoutChanged:u,hasRelativeTargetChanged:h})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function fmr(t){G6&&SA.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 pmr(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function gmr(t){t.clearSnapshot()}function WKe(t){t.clearMeasurements()}function mmr(t){t.isLayoutDirty=!1}function vmr(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function YKe(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ymr(t){t.resolveTargetDelta()}function bmr(t){t.calcProjection()}function xmr(t){t.resetSkewAndRotation()}function wmr(t){t.removeLeadSnapshot()}function qKe(t,e,r){t.translate=ko(e.translate,0,r),t.scale=ko(e.scale,1,r),t.origin=e.origin,t.originPoint=e.originPoint}function jKe(t,e,r,n){t.min=ko(e.min,r.min,n),t.max=ko(e.max,r.max,n)}function Amr(t,e,r,n){jKe(t.x,e.x,r.x,n),jKe(t.y,e.y,r.y,n)}function Smr(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Tmr={duration:.45,ease:[.4,0,.1,1]},XKe=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),KKe=XKe("applewebkit/")&&!XKe("chrome/")?Math.round:_d;function ZKe(t){t.min=KKe(t.min),t.max=KKe(t.max)}function Cmr(t){ZKe(t.x),ZKe(t.y)}function JKe(t,e,r){return t==="position"||t==="preserve-aspect"&&!Egr(UKe(e),UKe(r),.2)}function Omr(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const kmr=HKe({attachResizeListener:(t,e)=>$6(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),cce={current:void 0},eZe=HKe({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!cce.current){const t=new kmr({});t.mount(window),t.setOptions({layoutScroll:!0}),cce.current=t}return cce.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Emr={pan:{Feature:Ggr},drag:{Feature:Qgr,ProjectionNode:eZe,MeasureLayout:CKe}};function _mr(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 tZe(t,e){const r=_mr(t),n=new AbortController,i={passive:!0,...e,signal:n.signal};return[r,i,()=>n.abort()]}function rZe(t){return e=>{e.pointerType==="touch"||KXe()||t(e)}}function Rmr(t,e,r={}){const[n,i,a]=tZe(t,r),o=rZe(s=>{const{target:l}=s,u=e(s);if(typeof u!="function"||!l)return;const h=rZe(d=>{u(d),l.removeEventListener("pointerleave",h)});l.addEventListener("pointerleave",h,i)});return n.forEach(s=>{s.addEventListener("pointerenter",o,i)}),a}function nZe(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&&Ja.postRender(()=>a(e,F6(e)))}class Dmr extends ox{mount(){const{current:e}=this.node;e&&(this.unmount=Rmr(e,r=>(nZe(this.node,r,"Start"),n=>nZe(this.node,n,"End"))))}unmount(){}}class Lmr extends ox{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=B6($6(this.node.current,"focus",()=>this.onFocus()),$6(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const iZe=(t,e)=>e?t===e?!0:iZe(t,e.parentElement):!1,Mmr=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Imr(t){return Mmr.has(t.tagName)||t.tabIndex!==-1}const H6=new WeakSet;function aZe(t){return e=>{e.key==="Enter"&&t(e)}}function uce(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Pmr=(t,e)=>{const r=t.currentTarget;if(!r)return;const n=aZe(()=>{if(H6.has(r))return;uce(r,"down");const i=aZe(()=>{uce(r,"up")}),a=()=>uce(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 oZe(t){return ece(t)&&!KXe()}function Nmr(t,e,r={}){const[n,i,a]=tZe(t,r),o=s=>{const l=s.currentTarget;if(!oZe(s)||H6.has(l))return;H6.add(l);const u=e(s),h=(p,g)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),!(!oZe(p)||!H6.has(l))&&(H6.delete(l),typeof u=="function"&&u(p,{success:g}))},d=p=>{h(p,r.useGlobalTarget||iZe(l,p.target))},f=p=>{h(p,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",f,i)};return n.forEach(s=>{!Imr(s)&&s.getAttribute("tabindex")===null&&(s.tabIndex=0),(r.useGlobalTarget?window:s).addEventListener("pointerdown",o,i),s.addEventListener("focus",u=>Pmr(u,i),i)}),a}function sZe(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&&Ja.postRender(()=>a(e,F6(e)))}class Bmr extends ox{mount(){const{current:e}=this.node;e&&(this.unmount=Nmr(e,r=>(sZe(this.node,r,"Start"),(n,{success:i})=>sZe(this.node,n,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const hce=new WeakMap,dce=new WeakMap,$mr=t=>{const e=hce.get(t.target);e&&e(t)},Fmr=t=>{t.forEach($mr)};function zmr({root:t,...e}){const r=t||document;dce.has(r)||dce.set(r,{});const n=dce.get(r),i=JSON.stringify(e);return n[i]||(n[i]=new IntersectionObserver(Fmr,{root:t,...e})),n[i]}function Umr(t,e,r){const n=zmr(e);return hce.set(t,r),n.observe(t),()=>{hce.delete(t),n.unobserve(t)}}const Vmr={some:0,all:1};class Qmr extends ox{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,o={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:Vmr[i]},s=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 Umr(this.node.current,o,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:r}=this.node;["amount","margin","root"].some(Gmr(e,r))&&this.startObserver()}unmount(){}}function Gmr({viewport:t={}},{viewport:e={}}={}){return r=>t[r]!==e[r]}const Hmr={inView:{Feature:Qmr},tap:{Feature:Bmr},focus:{Feature:Lmr},hover:{Feature:Dmr}},Wmr={layout:{ProjectionNode:eZe,MeasureLayout:CKe}},fce={current:null},lZe={current:!1};function Ymr(){if(lZe.current=!0,!!lle)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>fce.current=t.matches;t.addListener(e),e()}else fce.current=!1}const qmr=[...RXe,zc,ax],jmr=t=>qmr.find(_Xe(t)),cZe=new WeakMap;function Xmr(t,e,r){for(const n in e){const i=e[n],a=r[n];if(Fc(i))t.addValue(n,i);else if(Fc(a))t.addValue(n,L6(i,{owner:t}));else if(a!==i)if(t.hasValue(n)){const o=t.getValue(n);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(n);t.addValue(n,L6(o!==void 0?o:i,{owner:t}))}}for(const n in r)e[n]===void 0&&t.removeValue(n);return e}const uZe=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Kmr{scrapeMotionValuesFromProps(e,r,n){return{}}constructor({parent:e,props:r,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Qle,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=mm.now();this.renderScheduledAtthis.bindToMotionValue(n,r)),lZe.current||Ymr(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:fce.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){cZe.delete(this.current),this.projection&&this.projection.unmount(),nx(this.notifyUpdate),nx(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=yA.has(e),i=r.on("change",s=>{this.latestValues[e]=s,this.props.onUpdate&&Ja.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),a=r.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,r)),this.valueSubscriptions.set(e,()=>{i(),a(),o&&o(),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 yE){const r=yE[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):ls()}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=L6(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"&&(kXe(i)||pXe(i))?i=parseFloat(i):!jmr(i)&&ax.test(r)&&(i=wXe(e,r)),this.setBaseTarget(e,Fc(i)?i.get():i)),Fc(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 o=gle(this.props,n,(r=this.presenceContext)===null||r===void 0?void 0:r.custom);o&&(i=o[e])}if(n&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,e);return a!==void 0&&!Fc(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 kle),this.events[e].add(r)}notify(e,...r){this.events[e]&&this.events[e].notify(...r)}}class hZe extends Kmr{constructor(){super(...arguments),this.KeyframeResolver=LXe}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;Fc(e)&&(this.childSubscription=e.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}function Zmr(t){return window.getComputedStyle(t)}class Jmr extends hZe{constructor(){super(...arguments),this.type="html",this.renderInstance=Gje}readValueFromInstance(e,r){if(yA.has(r)){const n=zle(r);return n&&n.default||0}else{const n=Zmr(e),i=($je(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:r}){return wKe(e,r)}build(e,r,n){ble(e,r,n.transformTemplate)}scrapeMotionValuesFromProps(e,r,n){return Sle(e,r,n)}}class e0r extends hZe{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ls}getBaseTargetFromProps(e,r){return e[r]}readValueFromInstance(e,r){if(yA.has(r)){const n=zle(r);return n&&n.default||0}return r=Hje.has(r)?r:dle(r),e.getAttribute(r)}scrapeMotionValuesFromProps(e,r,n){return qje(e,r,n)}build(e,r,n){xle(e,r,this.isSVGTag,n.transformTemplate)}renderInstance(e,r,n,i){Wje(e,r,n,i)}mount(e){this.isSVGTag=Ale(e.tagName),super.mount(e)}}const t0r=(t,e)=>ple(t)?new e0r(e):new Jmr(e,{allowProjection:t!==j.Fragment}),r0r=Efr({...ygr,...Hmr,...Emr,...Wmr},t0r),TA=Gdr(r0r),dZe={};function Kp(t,e){const r=j.useRef(dZe);return r.current===dZe&&(r.current=t(e)),r}function pce(){}const n0r=Object.freeze([]),Su=Object.freeze({});function gce(t){j.useEffect(t,n0r)}const W6=0;class Zp{constructor(){Pr(this,"currentId",W6);Pr(this,"clear",()=>{this.currentId!==W6&&(clearTimeout(this.currentId),this.currentId=W6)});Pr(this,"disposeEffect",()=>this.clear)}static create(){return new Zp}start(e,r){this.clear(),this.currentId=setTimeout(()=>{this.currentId=W6,r()},e)}isStarted(){return this.currentId!==W6}}function EE(){const t=Kp(Zp.create).current;return gce(t.disposeEffect),t}const Bn=typeof document<"u"?j.useLayoutEffect:()=>{};function i0r(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:a0r,platform:o0r,maxTouchPoints:s0r}=i0r(),TQ=a0r.toLowerCase(),Y6=o0r.toLowerCase(),CQ=/^i(os$|p)/.test(Y6)||Y6==="macintel"&&s0r>1,fZe="android",mce=Y6===fZe||TQ.includes(fZe),l0r=!CQ&&Y6.startsWith("mac");Y6.startsWith("win");const c0r=l0r||CQ,_E=typeof CSS<"u"&&!!((Yor=CSS.supports)!=null&&Yor.call(CSS,"-webkit-backdrop-filter:none"));!_E&&TQ.includes("firefox"),!_E&&TQ.includes("chrom");const u0r=c0r,h0r=/jsdom|happydom/.test(TQ);function d0r(t){t.preventDefault(),t.stopPropagation()}function f0r(t){return"nativeEvent"in t}function p0r(t){return t.pointerType===""&&t.isTrusted?!0:mce&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function pZe(t){return h0r?!1:!mce&&t.width===0&&t.height===0||mce&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function RE(t,e){const r=["mouse","pen"];return e||r.push("",void 0),r.includes(t)}function g0r(t){const e=t.type;return e==="click"||e==="mousedown"||e==="keydown"||e==="keyup"}function OQ(){return typeof window<"u"}function sc(t){return vce(t)?(t.nodeName||"").toLowerCase():"#document"}function cs(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Zv(t){var e;return(e=(vce(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function vce(t){return OQ()?t instanceof Node||t instanceof cs(t).Node:!1}function Yi(t){return OQ()?t instanceof Element||t instanceof cs(t).Element:!1}function Eo(t){return OQ()?t instanceof HTMLElement||t instanceof cs(t).HTMLElement:!1}function DE(t){return!OQ()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof cs(t).ShadowRoot}function q6(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=Dd(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&i!=="inline"&&i!=="contents"}function m0r(t){return/^(table|td|th)$/.test(sc(t))}function kQ(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const v0r=/transform|translate|scale|rotate|perspective|filter/,y0r=/paint|layout|strict|content/,CA=t=>!!t&&t!=="none";let yce;function bce(t){const e=Yi(t)?Dd(t):t;return CA(e.transform)||CA(e.translate)||CA(e.scale)||CA(e.rotate)||CA(e.perspective)||!xce()&&(CA(e.backdropFilter)||CA(e.filter))||v0r.test(e.willChange||"")||y0r.test(e.contain||"")}function b0r(t){let e=lx(t);for(;Eo(e)&&!sx(e);){if(bce(e))return e;if(kQ(e))return null;e=lx(e)}return null}function xce(){return yce==null&&(yce=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),yce}function sx(t){return/^(html|body|#document)$/.test(sc(t))}function Dd(t){return cs(t).getComputedStyle(t)}function EQ(t){return Yi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function lx(t){if(sc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||DE(t)&&t.host||Zv(t);return DE(e)?e.host:e}function gZe(t){const e=lx(t);return sx(e)?(t.ownerDocument||t).body:Eo(e)&&q6(e)?e:gZe(e)}function j6(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=gZe(t),a=i===((n=t.ownerDocument)==null?void 0:n.body),o=cs(i);if(a){const s=wce(o);return e.concat(o,o.visualViewport||[],q6(i)?i:[],s&&r?j6(s):[])}else return e.concat(i,j6(i,[],r))}function wce(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const Ace="data-base-ui-focusable",mZe="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Jv(t){var r;let e=t.activeElement;for(;((r=e==null?void 0:e.shadowRoot)==null?void 0:r.activeElement)!=null;)e=e.shadowRoot.activeElement;return e}function Hn(t,e){var n;if(!t||!e)return!1;const r=(n=e.getRootNode)==null?void 0:n.call(e);if(t.contains(e))return!0;if(r&&DE(r)){let i=e;for(;i;){if(t===i)return!0;i=i.parentNode||i.host}}return!1}function Jp(t){return"composedPath"in t?t.composedPath()[0]:t.target}function vZe(t,e){if(!Yi(t))return!1;const r=t;if(e.hasElement(r))return!r.hasAttribute("data-trigger-disabled");for(const[,n]of e.entries())if(Hn(n,r))return!n.hasAttribute("data-trigger-disabled");return!1}function Sce(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const r=t;return r.target!=null&&e.contains(r.target)}function x0r(t){return t.matches("html,body")}function Tce(t){return Eo(t)&&t.matches(mZe)}function w0r(t){return(t==null?void 0:t.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${mZe}`))!=null}function yZe(t){return t?t.getAttribute("role")==="combobox"&&Tce(t):!1}function bZe(t){return t?t.hasAttribute(Ace)?t:t.querySelector(`[${Ace}]`)||t:null}function A0r(t,e){return e!=null&&!RE(e)?0:typeof t=="function"?t():t}function Cce(t,e,r){const n=A0r(t,r);return typeof n=="number"?n:n==null?void 0:n[e]}function xZe(t){return typeof t=="function"?t():t}function wZe(t,e){return e||t==="click"||t==="mousedown"}function S0r(t){return(t==null?void 0:t.includes("mouse"))&&t!=="mousedown"}const AZe="none",LE="trigger-press",Ld="trigger-hover",SZe="outside-press",T0r="close-press",X6="focus-out",TZe="escape-key",C0r="imperative-action";function _s(t,e,r,n){let i=!1,a=!1;const o=Su;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,...o}}function bi(t,e,r,n){return t.addEventListener(e,r,n),()=>{t.removeEventListener(e,r,n)}}function ey(...t){return()=>{for(let e=0;er!==e[n])}function OZe(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{e.current=e.next}};return e}const Oce={...qw},kce=Oce.useInsertionEffect,R0r=kce&&kce!==Oce.useLayoutEffect?kce:t=>t();function Pn(t){const e=Kp(D0r).current;return e.next=t,R0r(e.effect),e.trampoline}function D0r(){const t={next:void 0,callback:L0r,trampoline:(...e)=>{var r;return(r=t.callback)==null?void 0:r.call(t,...e)},effect:()=>{t.callback=t.next}};return t}function L0r(){}const _Q=null;let M0r=class{constructor(){Pr(this,"callbacks",[]);Pr(this,"callbacksCount",0);Pr(this,"nextId",1);Pr(this,"startId",1);Pr(this,"isScheduled",!1);Pr(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)}},RQ=new M0r;class Lh{constructor(){Pr(this,"currentId",_Q);Pr(this,"cancel",()=>{this.currentId!==_Q&&(RQ.cancel(this.currentId),this.currentId=_Q)});Pr(this,"disposeEffect",()=>this.cancel)}static create(){return new Lh}static request(e){return RQ.request(e)}static cancel(e){return RQ.cancel(e)}request(e){this.cancel(),this.currentId=RQ.request(()=>{this.currentId=_Q,e()})}}function Ece(){const t=Kp(Lh.create).current;return gce(t.disposeEffect),t}function eo(t){return(t==null?void 0:t.ownerDocument)||document}const I0r={...{clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},position:"fixed",top:0,left:0},IE=j.forwardRef(function(e,r){const[n,i]=j.useState();Bn(()=>{u0r&&_E&&i("button")},[]);const a={tabIndex:0,role:n};return H.jsx("span",{...e,ref:r,style:I0r,"aria-hidden":n?void 0:!0,...a,"data-base-ui-focus-guard":""})}),P0r=["top","right","bottom","left"],cx=Math.min,ty=Math.max,DQ=Math.round,LQ=Math.floor,ry=t=>({x:t,y:t}),N0r={left:"right",right:"left",bottom:"top",top:"bottom"};function _ce(t,e,r){return ty(t,cx(e,r))}function vm(t,e){return typeof t=="function"?t(e):t}function Uf(t){return t.split("-")[0]}function ny(t){return t.split("-")[1]}function Rce(t){return t==="x"?"y":"x"}function MQ(t){return t==="y"?"height":"width"}function Vf(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function IQ(t){return Rce(Vf(t))}function B0r(t,e,r){r===void 0&&(r=!1);const n=ny(t),i=IQ(t),a=MQ(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(o=PQ(o)),[o,PQ(o)]}function $0r(t){const e=PQ(t);return[Dce(t),e,Dce(e)]}function Dce(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const kZe=["left","right"],EZe=["right","left"],F0r=["top","bottom"],z0r=["bottom","top"];function U0r(t,e,r){switch(t){case"top":case"bottom":return r?e?EZe:kZe:e?kZe:EZe;case"left":case"right":return e?F0r:z0r;default:return[]}}function V0r(t,e,r,n){const i=ny(t);let a=U0r(Uf(t),r==="start",n);return i&&(a=a.map(o=>o+"-"+i),e&&(a=a.concat(a.map(Dce)))),a}function PQ(t){const e=Uf(t);return N0r[e]+t.slice(e.length)}function Q0r(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 Lce(t){return typeof t!="number"?Q0r(t):{top:t,right:t,bottom:t,left:t}}function NQ(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 G0r(t){return t.visibility==="hidden"||t.visibility==="collapse"}function _Ze(t,e=t?Dd(t):null){return!t||!t.isConnected||!e||G0r(e)?!1:typeof t.checkVisibility=="function"?t.checkVisibility():e.display!=="none"&&e.display!=="contents"}const H0r='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function W0r(t){const e=t.assignedSlot;if(e)return e;if(t.parentElement)return t.parentElement;const r=t.getRootNode();return DE(r)?r.host:null}function Mce(t){for(const e of Array.from(t.children))if(sc(e)==="summary")return e;return null}function Y0r(t,e){const r=Mce(e);return!!r&&(t===r||Hn(r,t))}function RZe(t){const e=t?sc(t):"";return t!=null&&t.matches(H0r)&&(e!=="summary"||t.parentElement!=null&&sc(t.parentElement)==="details"&&Mce(t.parentElement)===t)&&(e!=="details"||Mce(t)==null)&&(e!=="input"||t.type!=="hidden")}function DZe(t){if(!RZe(t)||!t.isConnected||t.matches(":disabled"))return!1;for(let e=t;e;e=W0r(e)){const r=e!==t,n=sc(e)==="slot";if(e.hasAttribute("inert")||r&&sc(e)==="details"&&!e.open&&!Y0r(t,e)||e.hasAttribute("hidden")||!n&&!q0r(e,r))return!1}return!0}function q0r(t,e){const r=Dd(t);return e?r.display!=="none":_Ze(t,r)}function LZe(t){const e=t.tabIndex;if(e<0){const r=sc(t);if(r==="details"||r==="audio"||r==="video"||Eo(t)&&t.isContentEditable)return 0}return e}function Ice(t){if(sc(t)!=="input")return null;const e=t;return e.type==="radio"&&e.name!==""?e:null}function j0r(t,e){const r=Ice(t);if(!r)return!0;const n=e.find(i=>{const a=Ice(i);return(a==null?void 0:a.name)===r.name&&a.form===r.form&&a.checked});return n?n===r:e.find(i=>{const a=Ice(i);return(a==null?void 0:a.name)===r.name&&a.form===r.form})===r}function MZe(t){if(Eo(t)&&sc(t)==="slot"){const e=t.assignedElements({flatten:!0});if(e.length>0)return e}return Eo(t)&&t.shadowRoot?Array.from(t.shadowRoot.children):Array.from(t.children)}function IZe(t,e){MZe(t).forEach(r=>{RZe(r)&&e.push(r),IZe(r,e)})}function PZe(t,e,r){MZe(t).forEach(n=>{Eo(n)&&n.matches(e)&&r.push(n),PZe(n,e,r)})}function Pce(t){return DZe(t)&&LZe(t)>=0}function NZe(t){const e=[];return IZe(t,e),e.filter(DZe)}function K6(t){const e=NZe(t);return e.filter(r=>LZe(r)>=0&&j0r(r,e))}function BZe(t,e){const r=K6(t),n=r.length;if(n===0)return;const i=Jv(eo(t)),a=r.indexOf(i),o=a===-1?e===1?0:n-1:a+e;return r[o]}function Nce(t){return BZe(eo(t).body,1)||t}function $Ze(t){return BZe(eo(t).body,-1)||t}function FZe(t,e){if(!t)return null;const r=K6(eo(t).body),n=r.length;if(n===0)return null;const i=r.indexOf(t);if(i===-1)return null;const a=(i+e+n)%n;return r[a]}function X0r(t){return FZe(t,1)}function K0r(t){return FZe(t,-1)}function PE(t,e){const r=e||t.currentTarget,n=t.relatedTarget;return!n||!Hn(r,n)}function Z0r(t){K6(t).forEach(r=>{r.dataset.tabindex=r.getAttribute("tabindex")||"",r.setAttribute("tabindex","-1")})}function zZe(t){const e=[];PZe(t,"[data-tabindex]",e),e.forEach(r=>{const n=r.dataset.tabindex;delete r.dataset.tabindex,n?r.setAttribute("tabindex",n):r.removeAttribute("tabindex")})}function ux(t,e,r=!0){return t.filter(i=>i.parentId===e).flatMap(i=>{var a;return[...!r||(a=i.context)!=null&&a.open?[i]:[],...ux(t,i.id,r)]})}function UZe(t,e){var i;let r=[],n=(i=t.find(a=>a.id===e))==null?void 0:i.parentId;for(;n;){const a=t.find(o=>o.id===n);n=a==null?void 0:a.parentId,a&&(r=r.concat(a))}return r}function BQ(t){return`data-base-ui-${t}`}let $Q=0;function Bce(t,e={}){const{preventScroll:r=!1,sync:n=!1,shouldFocus:i}=e;cancelAnimationFrame($Q);function a(){i&&!i()||t==null||t.focus({preventScroll:r})}if(n)return a(),pce;const o=requestAnimationFrame(a);return $Q=o,()=>{$Q===o&&(cancelAnimationFrame(o),$Q=0)}}const $ce={inert:new WeakMap,"aria-hidden":new WeakMap},VZe="data-base-ui-inert",Fce={inert:new WeakSet,"aria-hidden":new WeakSet};let Z6=new WeakMap,zce=0;function J0r(t){return Fce[t]}function QZe(t){return t?DE(t)?t.host:QZe(t.parentNode):null}const GZe=(t,e)=>e.map(r=>{if(t.contains(r))return r;const n=QZe(r);return t.contains(n)?n:null}).filter(r=>r!=null),HZe=t=>{const e=new Set;return t.forEach(r=>{let n=r;for(;n&&!e.has(n);)e.add(n),n=n.parentNode}),e},WZe=(t,e,r)=>{const n=[],i=a=>{!a||r.has(a)||Array.from(a.children).forEach(o=>{sc(o)!=="script"&&(e.has(o)?i(o):n.push(o))})};return i(t),n};function evr(t,e,r,n,{mark:i=!0}){let a=null;n?a="inert":r&&(a="aria-hidden");let o=null,s=null;const l=GZe(e,t),u=i?WZe(e,HZe(l),new Set(l)):[],h=[],d=[];if(a){const f=$ce[a],p=J0r(a);s=p,o=f;const g=GZe(e,Array.from(e.querySelectorAll("[aria-live]"))),m=l.concat(g);WZe(e,HZe(m),new Set(m)).forEach(y=>{const b=y.getAttribute(a),x=b!==null&&b!=="false",w=(f.get(y)||0)+1;f.set(y,w),h.push(y),w===1&&x&&p.add(y),x||y.setAttribute(a,a==="inert"?"":"true")})}return i&&u.forEach(f=>{const p=(Z6.get(f)||0)+1;Z6.set(f,p),d.push(f),p===1&&f.setAttribute(VZe,"")}),zce+=1,()=>{o&&h.forEach(f=>{const g=(o.get(f)||0)-1;o.set(f,g),g||(!(s!=null&&s.has(f))&&a&&f.removeAttribute(a),s==null||s.delete(f))}),i&&d.forEach(f=>{const p=(Z6.get(f)||0)-1;Z6.set(f,p),p||f.removeAttribute(VZe)}),zce-=1,zce||($ce.inert=new WeakMap,$ce["aria-hidden"]=new WeakMap,Fce.inert=new WeakSet,Fce["aria-hidden"]=new WeakSet,Z6=new WeakMap)}}function YZe(t,e={}){const{ariaHidden:r=!1,inert:n=!1,mark:i=!0}=e,a=eo(t[0]).body;return evr(t,a,r,n,{mark:i})}let qZe=0;function tvr(t,e="mui"){const[r,n]=j.useState(t),i=t||r;return j.useEffect(()=>{r==null&&(qZe+=1,n(`${e}-${qZe}`))},[r,e]),i}const jZe=Oce.useId;function FQ(t,e){if(jZe!==void 0){const r=jZe();return t??(e?`${e}-${r}`:r)}return tvr(t,e)}function rvr(t,e){return function(n,...i){const a=new URL(t);return a.searchParams.set("code",n.toString()),i.forEach(o=>a.searchParams.append("args[]",o)),`${e} error #${n}; visit ${a} for the full message.`}}const iy=rvr("https://base-ui.com/production-error","Base UI"),nvr=parseInt(j.version,10);function Uce(t){return nvr>=t}function XZe(t){if(!j.isValidElement(t))return null;const e=t,r=e.props;return(Uce(19)?r==null?void 0:r.ref:e.ref)??null}function Vce(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}function ivr(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 avr(t,e){return typeof t=="function"?t(e):t}function KZe(t,e){return typeof t=="function"?t(e):t}const Qce={};function Gce(t,e,r,n,i){if(!r&&!n&&!t)return zQ(e);let a=zQ(t);return e&&(a=UQ(a,e)),r&&(a=UQ(a,r)),n&&(a=UQ(a,n)),a}function ovr(t){if(t.length===0)return Qce;if(t.length===1)return zQ(t[0]);let e=zQ(t[0]);for(let r=1;r=65&&i<=90&&(typeof e=="function"||typeof e>"u")}function Hce(t){return typeof t=="function"}function JZe(t,e){return Hce(t)?t(e):t??Qce}function cvr(t,e){return e?t?(...r)=>{const n=r[0];if(rJe(n)){const a=n;VQ(a);const o=e(...r);return a.baseUIHandlerPrevented||t==null||t(...r),o}const i=e(...r);return t==null||t(...r),i}:eJe(e):t}function eJe(t){return t&&((...e)=>{const r=e[0];return rJe(r)&&VQ(r),t(...e)})}function VQ(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function tJe(t,e){return e?t?e+" "+t:e:t}function rJe(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function eg(t,e,r={}){const n=e.render,i=uvr(e,r);if(r.enabled===!1)return null;const a=r.state??Su;return fvr(t,n,i,a)}function uvr(t,e={}){const{className:r,style:n,render:i}=t,{state:a=Su,ref:o,props:s,stateAttributesMapping:l,enabled:u=!0}=e,h=u?avr(r,a):void 0,d=u?KZe(n,a):void 0,f=u?ivr(a,l):Su,p=u&&s?hvr(s):void 0,g=u?Vce(f,p)??{}:Su;return typeof document<"u"&&(u?Array.isArray(o)?g.ref=O0r([g.ref,XZe(i),...o]):g.ref=ME(g.ref,XZe(i),o):ME(null,null)),u?(h!==void 0&&(g.className=tJe(g.className,h)),d!==void 0&&(g.style=Vce(g.style,d)),g):Su}function hvr(t){return Array.isArray(t)?ovr(t):Gce(void 0,t)}const dvr=Symbol.for("react.lazy");function fvr(t,e,r,n){if(e){if(typeof e=="function")return e(r,n);const i=Gce(r,e.props);i.ref=r.ref;let a=e;return(a==null?void 0:a.$$typeof)===dvr&&(a=j.Children.toArray(e)[0]),j.cloneElement(a,i)}if(t&&typeof t=="string")return pvr(t,r);throw new Error(iy(8))}function pvr(t,e){return t==="button"?j.createElement("button",{type:"button",...e,key:e.key}):t==="img"?j.createElement("img",{alt:"",...e,key:e.key}):j.createElement(t,e)}const gvr=500,mvr={style:{transition:"none"}},nJe="data-base-ui-click-trigger",vvr={fallbackAxisSide:"end"},yvr={clipPath:"inset(50%)",position:"fixed",top:0,left:0},iJe=j.createContext(null),aJe=()=>j.useContext(iJe),bvr=BQ("portal");function xvr(t={}){const{ref:e,container:r,componentProps:n=Su,elementProps:i}=t,a=FQ(),o=aJe(),s=o==null?void 0:o.portalNode,[l,u]=j.useState(null),[h,d]=j.useState(null),f=Pn(v=>{v!==null&&d(v)}),p=j.useRef(null);Bn(()=>{if(r===null){p.current&&(p.current=null,d(null),u(null));return}const v=(r&&(vce(r)?r:r.current))??s??document.body;if(v==null){p.current&&(p.current=null,d(null),u(null));return}p.current!==v&&(p.current=v,d(null),u(v))},[r,s]);const g=eg("div",n,{ref:[e,f],props:[{id:a,[bvr]:""},i]}),m=l&&g?kf.createPortal(g,l):null;return{node:h,nodeId:j.isValidElement(g)?g.props.id:void 0,subtree:m}}const wvr=j.forwardRef(function(e,r){const{render:n,className:i,style:a,children:o,container:s,...l}=e,{node:u,nodeId:h,subtree:d}=xvr({container:s,ref:r,componentProps:e,elementProps:l}),f=j.useRef(null),p=j.useRef(null),g=j.useRef(null),m=j.useRef(null),[v,y]=j.useState(null),b=j.useRef(!1),x=v==null?void 0:v.modal,w=v==null?void 0:v.open,A=!!v&&!v.modal&&v.open&&!!u;j.useEffect(()=>{if(!u||x)return;function T(C){u&&C.relatedTarget&&PE(C)&&(C.type==="focusin"?b.current&&(zZe(u),b.current=!1):(Z0r(u),b.current=!0))}return ey(bi(u,"focusin",T,!0),bi(u,"focusout",T,!0))},[u,x]),Bn(()=>{!u||w!==!0||!b.current||(zZe(u),b.current=!1)},[w,u]);const S=j.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:g,afterInsideRef:m,portalNode:u,setFocusManagerState:y}),[u]);return H.jsxs(j.Fragment,{children:[d,H.jsxs(iJe.Provider,{value:S,children:[A&&u&&H.jsx(IE,{"data-type":"outside",ref:f,onFocus:T=>{var C;if(PE(T,u))(C=g.current)==null||C.focus();else{const k=v?v.domReference:null,E=$Ze(k);E==null||E.focus()}}}),A&&u&&H.jsx("span",{"aria-owns":h,style:yvr}),u&&kf.createPortal(o,u),A&&u&&H.jsx(IE,{"data-type":"outside",ref:p,onFocus:T=>{var C;if(PE(T,u))(C=m.current)==null||C.focus();else{const k=v?v.domReference:null,E=Nce(k);E==null||E.focus(),v!=null&&v.closeOnFocusOut&&(v==null||v.onOpenChange(!1,_s(X6,T.nativeEvent)))}}})]})]})});function oJe(){const t=new Map;return{emit(e,r){var n;(n=t.get(e))==null||n.forEach(i=>i(r))},on(e,r){t.has(e)||t.set(e,new Set),t.get(e).add(r)},off(e,r){var n;(n=t.get(e))==null||n.delete(r)}}}class Avr{constructor(){Pr(this,"nodesRef",{current:[]});Pr(this,"events",oJe())}addNode(e){this.nodesRef.current.push(e)}removeNode(e){const r=this.nodesRef.current.findIndex(n=>n===e);r!==-1&&this.nodesRef.current.splice(r,1)}}const sJe=j.createContext(null),lJe=j.createContext(null),QQ=()=>{var t;return((t=j.useContext(sJe))==null?void 0:t.id)||null},NE=t=>{const e=j.useContext(lJe);return t??e};function Svr(t){const e=FQ(),r=NE(t),n=QQ();return Bn(()=>{if(!e)return;const i={id:e,parentId:n};return r==null||r.addNode(i),()=>{r==null||r.removeNode(i)}},[r,e,n]),e}function Tvr(t){const{children:e,id:r}=t,n=QQ();return H.jsx(sJe.Provider,{value:j.useMemo(()=>({id:r,parentId:n}),[r,n]),children:e})}function Cvr(t){const{children:e,externalTree:r}=t,n=Kp(()=>r??new Avr).current;return H.jsx(lJe.Provider,{value:n,children:e})}function ay(t){return t==null?t:"current"in t?t.current:t}function Ovr(t,e){const r=cs(Jp(t));return t instanceof r.KeyboardEvent?"keyboard":t instanceof r.FocusEvent?e||"keyboard":"pointerType"in t?t.pointerType||"keyboard":"touches"in t?"touch":t instanceof r.MouseEvent?e||(t.detail===0?"keyboard":"mouse"):""}const cJe=20;let hx=[];function Wce(){hx=hx.filter(t=>{var e;return(e=t.deref())==null?void 0:e.isConnected})}function uJe(t){Wce(),t&&sc(t)!=="body"&&(hx.push(new WeakRef(t)),hx.length>cJe&&(hx=hx.slice(-cJe)))}function hJe(){var t;return Wce(),(t=hx[hx.length-1])==null?void 0:t.deref()}function kvr(t){return t?Pce(t)?t:K6(t)[0]||t:null}function dJe(t){var i;if(t.hasAttribute("tabindex")&&!t.hasAttribute("data-tabindex")||!((i=t.getAttribute("role"))!=null&&i.includes("dialog")))return;const r=NZe(t).filter(a=>{const o=a.getAttribute("data-tabindex")||"";return Pce(a)||a.hasAttribute("data-tabindex")&&!o.startsWith("-")}),n=t.getAttribute("tabindex");r.length===0?n!=="0"&&(t.setAttribute("tabindex","0"),t.setAttribute("data-tabindex","0")):(n!=="-1"||t.hasAttribute("data-tabindex")&&t.getAttribute("data-tabindex")!=="-1")&&(t.setAttribute("tabindex","-1"),t.setAttribute("data-tabindex","-1"))}function Evr(t){const{context:e,children:r,disabled:n=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:l=!0,openInteractionType:u="",nextFocusableElement:h,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:g}=t,m="rootStore"in e?e.rootStore:e,v=m.useState("open"),y=m.useState("domReferenceElement"),b=m.useState("floatingElement"),{events:x,dataRef:w}=m.context,A=Pn(()=>{var te;return(te=w.current.floatingContext)==null?void 0:te.nodeId}),S=i===!1,T=yZe(y)&&S,C=Tu(i),k=Tu(a),E=Tu(u),_=Tu(v),P=NE(p),L=aJe(),R=j.useRef(!1),D=j.useRef(!1),M=j.useRef(!1),I=j.useRef(null),N=j.useRef(""),F=j.useRef(""),B=j.useRef(null),V=j.useRef(null),z=ME(B,f,L==null?void 0:L.beforeInsideRef),U=ME(V,L==null?void 0:L.afterInsideRef),Q=EE(),G=EE(),q=Ece(),Y=L!=null,ne=bZe(b),X=Pn((te=ne)=>te?K6(te):[]),J=Pn(()=>(g==null?void 0:g().filter(te=>te!=null))??[]);j.useEffect(()=>{if(n||!s)return;function te(ie){ie.key==="Tab"&&Hn(ne,Jv(eo(ne)))&&X().length===0&&!T&&d0r(ie)}const pe=eo(ne);return bi(pe,"keydown",te)},[n,ne,s,T,X]),j.useEffect(()=>{if(n||!v)return;const te=eo(ne);function pe(){M.current=!1}function ie(ke){const Ee=Jp(ke),ue=J(),de=Hn(b,Ee)||Hn(y,Ee)||Hn(L==null?void 0:L.portalNode,Ee)||ue.some(xe=>xe===Ee||Hn(xe,Ee));M.current=!de,F.current=ke.pointerType||"keyboard",Ee!=null&&Ee.closest(`[${nJe}]`)&&(D.current=!0,G.start(0,()=>{D.current=!1}))}function Ce(){F.current="keyboard"}return ey(bi(te,"pointerdown",ie,!0),bi(te,"pointerup",pe,!0),bi(te,"pointercancel",pe,!0),bi(te,"keydown",Ce,!0),pe)},[n,b,y,ne,v,L,G,J]),j.useEffect(()=>{if(n||!l)return;const te=eo(ne);function pe(){D.current=!0,G.start(0,()=>{D.current=!1})}function ie(ue){const de=Jp(ue);Pce(de)&&(I.current=de)}function Ce(ue){const de=ue.relatedTarget,xe=ue.currentTarget,ge=Jp(ue);s&&de==null&&ge!=null&&Hn(b,ge)&&uJe(ge),queueMicrotask(()=>{const ze=A(),we=m.context.triggerElements,Oe=J(),Be=(de==null?void 0:de.hasAttribute(BQ("focus-guard")))&&[B.current,V.current,L==null?void 0:L.beforeInsideRef.current,L==null?void 0:L.afterInsideRef.current,L==null?void 0:L.beforeOutsideRef.current,L==null?void 0:L.afterOutsideRef.current,ay(d),ay(h)].includes(de),Z=!(Hn(y,de)||Hn(b,de)||Hn(de,b)||Hn(L==null?void 0:L.portalNode,de)||Oe.some(le=>le===de||Hn(le,de))||we.hasMatchingElement(le=>Hn(le,de))||Be||P&&(ux(P.nodesRef.current,ze).find(le=>{var be,ae;return Hn((be=le.context)==null?void 0:be.elements.floating,de)||Hn((ae=le.context)==null?void 0:ae.elements.domReference,de)})||UZe(P.nodesRef.current,ze).find(le=>{var be,ae,K;return[(be=le.context)==null?void 0:be.elements.floating,bZe((ae=le.context)==null?void 0:ae.elements.floating)].includes(de)||((K=le.context)==null?void 0:K.elements.domReference)===de})));if(xe===y&&ne&&dJe(ne),o&&xe!==y&&!_Ze(ge)&&Jv(te)===te.body){if(Eo(ne)&&(ne.focus(),o==="popup")){q.request(()=>{ne.focus()});return}const le=X(),be=I.current,ae=(be&&le.includes(be)?be:null)||le[le.length-1]||ne;Eo(ae)&&ae.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(T||!s)&&de&&Z&&!D.current&&(T||de!==hJe())&&(R.current=!0,m.setOpen(!1,_s(X6,ue)))})}function ke(){M.current||(w.current.insideReactTree=!0,Q.start(0,()=>{w.current.insideReactTree=!1}))}const Ee=Eo(y)?y:null;if(!(!b&&!Ee))return ey(Ee&&bi(Ee,"focusout",Ce),Ee&&bi(Ee,"pointerdown",pe),b&&bi(b,"focusin",ie),b&&bi(b,"focusout",Ce),b&&L&&bi(b,"focusout",ke,!0))},[n,y,b,ne,s,P,L,m,l,o,X,T,A,w,Q,G,q,h,d,J]),j.useEffect(()=>{var xe,ge,ze;if(n||!b||!v)return;const te=Array.from(((xe=L==null?void 0:L.portalNode)==null?void 0:xe.querySelectorAll(`[${BQ("portal")}]`))||[]),ie=(ze=(ge=(P?UZe(P.nodesRef.current,A()):[]).find(we=>{var Oe;return yZe(((Oe=we.context)==null?void 0:Oe.elements.domReference)||null)}))==null?void 0:ge.context)==null?void 0:ze.elements.domReference,ke=[...[b,...te,B.current,V.current,L==null?void 0:L.beforeOutsideRef.current,L==null?void 0:L.afterOutsideRef.current,...J()],ie,ay(d),ay(h),T?y:null].filter(we=>we!=null),Ee=YZe(ke,{ariaHidden:s||T,mark:!1}),ue=[b,...te].filter(we=>we!=null),de=YZe(ue);return()=>{de(),Ee()}},[v,n,y,b,s,L,T,P,A,h,d,J]),Bn(()=>{if(!v||n||!Eo(ne))return;N.current="",F.current="";const te=eo(ne),pe=Jv(te);queueMicrotask(()=>{const ie=C.current,Ce=typeof ie=="function"?ie(E.current||""):ie;if(Ce===void 0||Ce===!1||Hn(ne,pe))return;let Ee=null;const ue=()=>(Ee==null&&(Ee=X(ne)),Ee[0]||ne);let de;Ce===!0||Ce===null?de=ue():de=ay(Ce),de=de||ue();const xe=Hn(ne,Jv(te));Bce(de,{preventScroll:de===ne,shouldFocus(){if(!_.current)return!1;if(xe)return!0;const ge=Jv(te);return!(ge!==de&&Hn(ne,ge))}})})},[n,v,ne,X,C,E,_]),Bn(()=>{if(n||!ne)return;const te=eo(ne),pe=Jv(te),ie=E.current==null;uJe(pe);function Ce(Ee){if(Ee.open||(N.current=Ovr(Ee.nativeEvent,F.current)),Ee.reason===Ld&&Ee.nativeEvent.type==="mouseleave"&&(R.current=!0),Ee.reason===SZe)if(Ee.nested)R.current=!1;else if(p0r(Ee.nativeEvent)||pZe(Ee.nativeEvent))R.current=!1;else{let ue=!1;eo(ne).createElement("div").focus({get preventScroll(){return ue=!0,!1}}),ue?R.current=!1:R.current=!0}}x.on("openchange",Ce);function ke(Ee){const ue=k.current;let de=typeof ue=="function"?ue(Ee):ue;if(de===void 0||de===!1)return null;de===null&&(de=!0);const xe=y!=null&&y.isConnected?y:null,ge=pe!=null&&pe.isConnected&&sc(pe)!=="body"?pe:null;let ze=ie?ge||xe:xe||ge;return ze||(ze=hJe()||null),typeof de=="boolean"?ze:ay(de)||ze||null}return()=>{x.off("openchange",Ce);const Ee=Jv(te),ue=J(),de=Hn(b,Ee)||ue.some(we=>we===Ee||Hn(we,Ee))||P&&ux(P.nodesRef.current,A(),!1).some(we=>{var Oe;return Hn((Oe=we.context)==null?void 0:Oe.elements.floating,Ee)}),xe=k.current,ge=N.current,ze=ke(ge);queueMicrotask(()=>{const we=kvr(ze),Oe=typeof xe!="boolean";if(xe&&!R.current&&Eo(we)&&(!(!Oe&&we!==Ee&&Ee!==te.body)||de)){const Be={preventScroll:!0};ge==="keyboard"&&(Be.focusVisible=!0),we.focus(Be)}R.current=!1})}},[n,b,ne,k,E,x,P,y,A,J]),Bn(()=>{if(!_E||v||!b)return;const te=Jv(eo(b));!Eo(te)||!Tce(te)||Hn(b,te)&&te.blur()},[v,b]),Bn(()=>{if(!(n||!L))return L.setFocusManagerState({modal:s,closeOnFocusOut:l,open:v,onOpenChange:m.setOpen,domReference:y}),()=>{L.setFocusManagerState(null)}},[n,L,s,v,m,l,y]),Bn(()=>{if(!(n||!ne))return dJe(ne),()=>{queueMicrotask(Wce)}},[n,ne]);const ee=!n&&(s?!T:!0)&&(Y||s);return H.jsxs(j.Fragment,{children:[ee&&H.jsx(IE,{"data-type":"inside",ref:z,onFocus:te=>{var pe;if(s){const ie=X();Bce(ie[ie.length-1])}else if(L!=null&&L.portalNode)if(R.current=!1,PE(te,L.portalNode)){const ie=Nce(y);ie==null||ie.focus()}else(pe=ay(d??L.beforeOutsideRef))==null||pe.focus()}}),r,ee&&H.jsx(IE,{"data-type":"inside",ref:U,onFocus:te=>{var pe;if(s)Bce(X()[0]);else if(L!=null&&L.portalNode)if(l&&(R.current=!0),PE(te,L.portalNode)){const ie=$Ze(y);ie==null||ie.focus()}else(pe=ay(h??L.afterOutsideRef))==null||pe.focus()}})]})}function _vr(t,e={}){const{enabled:r=!0,event:n="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:l=LE}=e,u="rootStore"in t?t.rootStore:t,h=u.context.dataRef,d=j.useRef(void 0),f=Ece(),p=EE(),g=j.useMemo(()=>{function m(y,b,x,w){const A=_s(l,b,x);y&&w==="touch"&&s>0?p.start(s,()=>{u.setOpen(!0,A)}):u.setOpen(y,A)}function v(y,b,x){const w=h.current.openEvent,A=u.select("domReferenceElement")!==b;return y&&A||!y||!i?!0:w&&o?!x(w.type):!1}return{onPointerDown(y){d.current=RE(y.pointerType,!0)&&pZe(y.nativeEvent)?"virtual":y.pointerType},onMouseDown(y){const b=d.current,x=y.nativeEvent,w=u.select("open");if(y.button!==0||n==="click"||RE(b,!0)&&a)return;const A=v(w,y.currentTarget,C=>C==="click"||C==="mousedown"),S=Jp(x);if(Tce(S)){m(A,x,S,b);return}const T=y.currentTarget;f.request(()=>{m(A,x,T,b)})},onClick(y){if(n==="mousedown-only")return;const b=d.current;if(n==="mousedown"&&b){d.current=void 0;return}if(RE(b,!0)&&a)return;const x=u.select("open"),w=v(x,y.currentTarget,A=>A==="click"||A==="mousedown"||A==="keydown"||A==="keyup");m(w,y.nativeEvent,y.currentTarget,b)},onKeyDown(){d.current=void 0}}},[h,n,a,l,u,o,i,f,p,s]);return j.useMemo(()=>r?{reference:g}:Su,[r,g])}function Rvr(){return!1}function Dvr(t){return{escapeKey:typeof t=="boolean"?t:(t==null?void 0:t.escapeKey)??!1,outsidePress:typeof t=="boolean"?t:(t==null?void 0:t.outsidePress)??!0}}function Lvr(t,e={}){const{enabled:r=!0,escapeKey:n=!0,outsidePress:i=!0,outsidePressEvent:a="sloppy",referencePress:o=Rvr,bubbles:s,externalTree:l}=e,u="rootStore"in t?t.rootStore:t,h=u.useState("open"),d=u.useState("floatingElement"),{dataRef:f}=u.context,p=NE(l),g=Pn(typeof i=="function"?i:()=>!1),m=typeof i=="function"?g:i,v=m!==!1,y=Pn(()=>a),{escapeKey:b,outsidePress:x}=Dvr(s),w=j.useRef(!1),A=j.useRef(!1),S=j.useRef(!1),T=j.useRef(!1),C=j.useRef(""),k=j.useRef(null),E=EE(),_=EE(),P=Pn(()=>{_.clear(),f.current.insideReactTree=!1}),L=Pn(z=>{var G;const U=(G=f.current.floatingContext)==null?void 0:G.nodeId;return(p?ux(p.nodesRef.current,U):[]).some(q=>{var Y;return((Y=q.context)==null?void 0:Y.open)&&!q.context.dataRef.current[z]})}),R=Pn(z=>Sce(z,u.select("floatingElement"))||Sce(z,u.select("domReferenceElement"))),D=Pn(z=>{o()&&u.setOpen(!1,_s(LE,z.nativeEvent))}),M=Pn(z=>{if(!h||!r||!n||z.key!=="Escape"||T.current||!b&&L("__escapeKeyBubbles"))return;const U=f0r(z)?z.nativeEvent:z,Q=_s(TZe,U);u.setOpen(!1,Q),Q.isCanceled||z.preventDefault(),!b&&!Q.isPropagationAllowed&&z.stopPropagation()}),I=Pn(()=>{f.current.insideReactTree=!0,_.start(0,P)}),N=Pn(z=>{if(!h||!r||z.button!==0)return;const U=Jp(z.nativeEvent);Hn(u.select("floatingElement"),U)&&(w.current||(w.current=!0,A.current=!1))}),F=Pn(z=>{!h||!r||(z.defaultPrevented||z.nativeEvent.defaultPrevented)&&w.current&&(A.current=!0)});j.useEffect(()=>{if(!h||!r)return P;f.current.__escapeKeyBubbles=b,f.current.__outsidePressBubbles=x;const z=new Zp,U=new Zp;function Q(){z.clear(),T.current=!0}function G(){z.start(_E?5:0,()=>{T.current=!1})}function q(){S.current=!0,U.start(0,()=>{S.current=!1})}function Y(){w.current=!1,A.current=!1}function ne(){const Oe=C.current,Be=Oe==="pen"||!Oe?"mouse":Oe,Z=y(),le=typeof Z=="function"?Z():Z;return typeof le=="string"?le:le[Be]}function X(Oe){const Be=ne();return Be==="intentional"&&Oe.type!=="click"||Be==="sloppy"&&Oe.type==="click"}function J(Oe){var le;const Be=(le=f.current.floatingContext)==null?void 0:le.nodeId,Z=p&&ux(p.nodesRef.current,Be).some(be=>{var ae;return Sce(Oe,(ae=be.context)==null?void 0:ae.elements.floating)});return R(Oe)||Z}function ee(Oe){if(X(Oe)){Oe.type!=="click"&&!R(Oe)&&(U.clear(),S.current=!1),P();return}if(f.current.insideReactTree){P();return}const Be=Jp(Oe),Z=`[${BQ("inert")}]`,le=Yi(Be)?Be.getRootNode():null,be=Array.from((DE(le)?le:eo(u.select("floatingElement"))).querySelectorAll(Z)),ae=u.context.triggerElements;if(Be&&(ae.hasElement(Be)||ae.hasMatchingElement(se=>Hn(se,Be))))return;let K=Yi(Be)?Be:null;for(;K&&!sx(K);){const se=lx(K);if(sx(se)||!Yi(se))break;K=se}if(!(be.length&&Yi(Be)&&!x0r(Be)&&!Hn(Be,u.select("floatingElement"))&&be.every(se=>!Hn(K,se)))){if(Eo(Be)&&!("touches"in Oe)){const se=sx(Be),me=Dd(Be),oe=/auto|scroll/,ve=se||oe.test(me.overflowX),ce=se||oe.test(me.overflowY),De=ve&&Be.clientWidth>0&&Be.scrollWidth>Be.clientWidth,Le=ce&&Be.clientHeight>0&&Be.scrollHeight>Be.clientHeight,We=me.direction==="rtl",Ne=Le&&(We?Oe.offsetX<=Be.offsetWidth-Be.clientWidth:Oe.offsetX>Be.clientWidth),je=De&&Oe.offsetY>Be.clientHeight;if(Ne||je)return}if(!J(Oe)){if(ne()==="intentional"&&S.current){U.clear(),S.current=!1;return}typeof m=="function"&&!m(Oe)||L("__outsidePressBubbles")||(u.setOpen(!1,_s(SZe,Oe)),P())}}}function te(Oe){ne()!=="sloppy"||Oe.pointerType==="touch"||!u.select("open")||!r||R(Oe)||ee(Oe)}function pe(Oe){if(ne()!=="sloppy"||!u.select("open")||!r||R(Oe))return;const Be=Oe.touches[0];Be&&(k.current={startTime:Date.now(),startX:Be.clientX,startY:Be.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},E.start(1e3,()=>{k.current&&(k.current.dismissOnTouchEnd=!1,k.current.dismissOnMouseDown=!1)}))}function ie(Oe,Be){const Z=Jp(Oe);if(!Z)return;const le=bi(Z,Oe.type,()=>{Be(Oe),le()})}function Ce(Oe){C.current="touch",ie(Oe,pe)}function ke(Oe){E.clear(),Oe.type==="pointerdown"&&(C.current=Oe.pointerType),!(Oe.type==="mousedown"&&k.current&&!k.current.dismissOnMouseDown)&&ie(Oe,Be=>{Be.type==="pointerdown"?te(Be):ee(Be)})}function Ee(Oe){if(!w.current)return;const Be=A.current;if(Y(),ne()==="intentional"){if(Oe.type==="pointercancel"){Be&&q();return}if(!J(Oe)){if(Be){q();return}typeof m=="function"&&!m(Oe)||(U.clear(),S.current=!0,P())}}}function ue(Oe){if(ne()!=="sloppy"||!k.current||R(Oe))return;const Be=Oe.touches[0];if(!Be)return;const Z=Math.abs(Be.clientX-k.current.startX),le=Math.abs(Be.clientY-k.current.startY),be=Math.sqrt(Z*Z+le*le);be>5&&(k.current.dismissOnTouchEnd=!0),be>10&&(ee(Oe),E.clear(),k.current=null)}function de(Oe){ie(Oe,ue)}function xe(Oe){ne()!=="sloppy"||!k.current||R(Oe)||(k.current.dismissOnTouchEnd&&ee(Oe),E.clear(),k.current=null)}function ge(Oe){ie(Oe,xe)}const ze=eo(d),we=ey(n&&ey(bi(ze,"keydown",M),bi(ze,"compositionstart",Q),bi(ze,"compositionend",G)),v&&ey(bi(ze,"click",ke,!0),bi(ze,"pointerdown",ke,!0),bi(ze,"pointerup",Ee,!0),bi(ze,"pointercancel",Ee,!0),bi(ze,"mousedown",ke,!0),bi(ze,"mouseup",Ee,!0),bi(ze,"touchstart",Ce,!0),bi(ze,"touchmove",de,!0),bi(ze,"touchend",ge,!0)));return()=>{we(),z.clear(),U.clear(),Y(),S.current=!1,P()}},[f,d,n,v,m,h,r,b,x,M,P,y,L,R,p,u,E]);const B=j.useMemo(()=>({onKeyDown:M,onPointerDown:D,onClick:D}),[M,D]),V=j.useMemo(()=>({onKeyDown:M,onPointerDown:F,onMouseDown:F,onClickCapture:I,onMouseDownCapture(z){I(),N(z)},onPointerDownCapture(z){I(),N(z)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[M,I,N,F]);return j.useMemo(()=>r?{reference:B,floating:V,trigger:B}:{},[r,B,V])}function fJe(t,e,r){let{reference:n,floating:i}=t;const a=Vf(e),o=IQ(e),s=MQ(o),l=Uf(e),u=a==="y",h=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,f=n[s]/2-i[s]/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=ny(e);return g&&(p[o]+=f*(g==="end"?1:-1)*(r&&u?-1:1)),p}async function Mvr(t,e){var r;e===void 0&&(e={});const{x:n,y:i,platform:a,rects:o,elements:s,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=vm(e,t),g=Lce(p),v=s[f?d==="floating"?"reference":"floating":d],y=NQ(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(s.floating)),boundary:u,rootBoundary:h,strategy:l})),b=d==="floating"?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,x=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.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=NQ(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,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 Ivr=50,Pvr=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:a=[],platform:o}=r,s=o.detectOverflow?o:{...o,detectOverflow:Mvr},l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:d}=fJe(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:o,elements:s,middlewareData:l}=e,{element:u,padding:h=0}=vm(t,e)||{};if(u==null)return{};const d=Lce(h),f={x:r,y:n},p=IQ(i),g=MQ(p),m=await o.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(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let T=S?S[x]:0;(!T||!await(o.isElement==null?void 0:o.isElement(S)))&&(T=s.floating[x]||a.floating[g]);const C=w/2-A/2,k=T/2-m[g]/2-1,E=cx(d[y],k),_=cx(d[b],k),P=T-m[g]-_,L=T/2-m[g]/2+C,R=_ce(E,L,P),D=!l.arrow&&ny(i)!=null&&L!==R&&a.reference[g]/2-(LR<=0)){var _,P;const R=(((_=a.flip)==null?void 0:_.index)||0)+1,D=T[R];if(D&&(!(d==="alignment"?b!==Vf(D):!1)||E.every(N=>Vf(N.placement)===b?N.overflows[0]>0:!0)))return{data:{index:R,overflows:E},reset:{placement:D}};let M=(P=E.filter(I=>I.overflows[0]<=0).sort((I,N)=>I.overflows[1]-N.overflows[1])[0])==null?void 0:P.placement;if(!M)switch(p){case"bestFit":{var L;const I=(L=E.filter(N=>{if(S){const F=Vf(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];I&&(M=I);break}case"initialPlacement":M=s;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function pJe(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function gJe(t){return P0r.some(e=>t[e]>=0)}const $vr=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r,platform:n}=e,{strategy:i="referenceHidden",...a}=vm(t,e);switch(i){case"referenceHidden":{const o=await n.detectOverflow(e,{...a,elementContext:"reference"}),s=pJe(o,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:gJe(s)}}}case"escaped":{const o=await n.detectOverflow(e,{...a,altBoundary:!0}),s=pJe(o,r.floating);return{data:{escapedOffsets:s,escaped:gJe(s)}}}default:return{}}}}},mJe=new Set(["left","top"]);async function Fvr(t,e){const{placement:r,platform:n,elements:i}=t,a=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=Uf(r),s=ny(r),l=Vf(r)==="y",u=mJe.has(o)?-1:1,h=a&&l?-1:1,d=vm(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 s&&typeof g=="number"&&(p=s==="end"?g*-1:g),l?{x:p*h,y:f*u}:{x:f*u,y:p*h}}const zvr=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:i,y:a,placement:o,middlewareData:s}=e,l=await Fvr(e,t);return o===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},Uvr=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:o=!0,crossAxis:s=!1,limiter:l={fn:b=>{let{x,y:w}=b;return{x,y:w}}},...u}=vm(t,e),h={x:r,y:n},d=await a.detectOverflow(e,u),f=Vf(i),p=Rce(f);let g=h[p],m=h[f];const v=(b,x)=>_ce(x+d[b==="y"?"top":"left"],x,x-d[b==="y"?"bottom":"right"]);o&&(g=v(p,g)),s&&(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]:o,[f]:s}}}}}},Vvr=function(t){return t===void 0&&(t={}),{options:t,fn(e){var r,n;const{x:i,y:a,placement:o,rects:s,middlewareData:l}=e,{offset:u=0,mainAxis:h=!0,crossAxis:d=!0}=vm(t,e),f={x:i,y:a},p=Vf(o),g=Rce(p);let m=f[g],v=f[p];const y=vm(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=s.reference[g]-s.floating[A]+b.mainAxis,T=s.reference[g]+s.reference[A]-b.mainAxis;mT&&(m=T)}if(d){var x,w;const A=g==="y"?"width":"height",S=mJe.has(Uf(o)),T=s.reference[p]-s.floating[A]+(S&&((x=l.offset)==null?void 0:x[p])||0)+(S?0:b.crossAxis),C=s.reference[p]+s.reference[A]+(S?0:((w=l.offset)==null?void 0:w[p])||0)-(S?b.crossAxis:0);vC&&(v=C)}return{[g]:m,[p]:v}}}},Qvr=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:o=()=>{},...s}=vm(t,e),l=await i.detectOverflow(e,s),u=Uf(r),h=ny(r),d=Vf(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=cx(p-l[g],v),x=cx(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*ty(l.left,l.right):S=p-2*ty(l.top,l.bottom)),await o({...e,availableWidth:T,availableHeight:S});const C=await i.getDimensions(a.floating);return f!==C.width||p!==C.height?{reset:{rects:!0}}:{}}}};function vJe(t){const e=Dd(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=Eo(t),a=i?t.offsetWidth:r,o=i?t.offsetHeight:n,s=DQ(r)!==a||DQ(n)!==o;return s&&(r=a,n=o),{width:r,height:n,$:s}}function Yce(t){return Yi(t)?t:t.contextElement}function BE(t){const e=Yce(t);if(!Eo(e))return ry(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:a}=vJe(e);let o=(a?DQ(r.width):r.width)/n,s=(a?DQ(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const Gvr=ry(0);function yJe(t){const e=cs(t);return!xce()||!e.visualViewport?Gvr:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Hvr(t,e,r){return e===void 0&&(e=!1),!!r&&e&&r===cs(t)}function OA(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),a=Yce(t);let o=ry(1);e&&(n?Yi(n)&&(o=BE(n)):o=BE(t));const s=Hvr(a,r,n)?yJe(a):ry(0);let l=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,h=i.width/o.x,d=i.height/o.y;if(a&&n){const f=cs(a),p=Yi(n)?cs(n):n;let g=f,m=wce(g);for(;m&&p!==g;){const v=BE(m),y=m.getBoundingClientRect(),b=Dd(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=cs(m),m=wce(g)}}return NQ({width:h,height:d,x:l,y:u})}function GQ(t,e){const r=EQ(t).scrollLeft;return e?e.left+r:OA(Zv(t)).left+r}function bJe(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-GQ(t,r),i=r.top+e.scrollTop;return{x:n,y:i}}function Wvr(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t;const a=i==="fixed",o=Zv(n),s=e?kQ(e.floating):!1;if(n===o||s&&a)return r;let l={scrollLeft:0,scrollTop:0},u=ry(1);const h=ry(0),d=Eo(n);if((d||!a)&&((sc(n)!=="body"||q6(o))&&(l=EQ(n)),d)){const p=OA(n);u=BE(n),h.x=p.x+n.clientLeft,h.y=p.y+n.clientTop}const f=o&&!d&&!a?bJe(o,l):ry(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 Yvr(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function qvr(t){const e=EQ(t),r=t.ownerDocument.body,n=ty(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ty(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-e.scrollLeft+GQ(t);const o=-e.scrollTop;return Dd(r).direction==="rtl"&&(a+=ty(t.clientWidth,r.clientWidth)-n),{width:n,height:i,x:a,y:o}}const jvr=25;function Xvr(t,e,r){r===void 0&&(r="viewport");const n=r==="layoutViewport",i=cs(t),a=Zv(t),o=i.visualViewport;let s=a.clientWidth,l=a.clientHeight,u=0,h=0;if(o){const f=!xce()||e==="fixed";n?f||(u=-o.offsetLeft,h=-o.offsetTop):(s=o.width,l=o.height,f&&(u=o.offsetLeft,h=o.offsetTop))}if(GQ(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<=jvr&&(s-=y)}return{width:s,height:l,x:u,y:h}}function Kvr(t,e){const r=OA(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,a=BE(t),o=t.clientWidth*a.x,s=t.clientHeight*a.y,l=i*a.x,u=n*a.y;return{width:o,height:s,x:l,y:u}}function xJe(t,e,r){let n;if(e==="viewport"||e==="layoutViewport")n=Xvr(t,r,e);else if(e==="document")n=qvr(Zv(t));else if(Yi(e))n=Kvr(e,r);else{const i=yJe(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return NQ(n)}function Zvr(t,e){const r=e.get(t);if(r)return r;let n=j6(t,[],!1).filter(s=>Yi(s)&&sc(s)!=="body"),i=null;const a=Dd(t).position==="fixed";let o=a?lx(t):t;for(;Yi(o)&&!sx(o);){const s=Dd(o),l=bce(o),u=i?i.position:a?"fixed":"";!l&&(u==="fixed"||u==="absolute"&&s.position==="static")?n=n.filter(d=>d!==o):i=s,o=lx(o)}return e.set(t,n),n}function Jvr(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?kQ(e)?[]:Zvr(e,this._c):[].concat(r),n],s=xJe(e,o[0],i);let l=s.top,u=s.right,h=s.bottom,d=s.left;for(let f=1;f{s(!1,1e-7)},1e3)}T=!1}try{n=new IntersectionObserver(C,{...S,root:a.ownerDocument})}catch{n=new IntersectionObserver(C,S)}n.observe(t)}const l=cs(t),u=()=>s(r);return l.addEventListener("resize",u),s(!0),()=>{l.removeEventListener("resize",u),o()}}function jce(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=Yce(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&&s?ayr(u,r,a):null;let f=-1,p=null;o&&(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?OA(t):null;l&&v();function v(){const y=OA(t);m&&!SJe(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 oyr=zvr,syr=Uvr,lyr=Bvr,cyr=Qvr,uyr=$vr,TJe=Nvr,hyr=Vvr,dyr=(t,e,r)=>{const n=new Map,i=r??{},a={...iyr,...i.platform,_c:n};return Pvr(t,e,{...i,platform:a})};var fyr=typeof document<"u",pyr=function(){},HQ=fyr?j.useLayoutEffect:pyr;function WQ(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(!WQ(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)&&!WQ(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function CJe(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function OJe(t,e){const r=CJe(t);return Math.round(e*r)/r}function Xce(t){const e=j.useRef(t);return HQ(()=>{e.current=t}),e}function kJe(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:l,open:u}=t,[h,d]=j.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[f,p]=j.useState(n);WQ(f,n)||p(n);const[g,m]=j.useState(null),[v,y]=j.useState(null),b=j.useCallback(N=>{N!==S.current&&(S.current=N,m(N))},[]),x=j.useCallback(N=>{N!==T.current&&(T.current=N,y(N))},[]),w=a||g,A=o||v,S=j.useRef(null),T=j.useRef(null),C=j.useRef(h),k=l!=null,E=Xce(l),_=Xce(i),P=Xce(u),L=j.useCallback(()=>{if(!S.current||!T.current)return;const N={placement:e,strategy:r,middleware:f};_.current&&(N.platform=_.current),dyr(S.current,T.current,N).then(F=>{const B={...F,isPositioned:P.current!==!1};R.current&&!WQ(C.current,B)&&(C.current=B,kf.flushSync(()=>{d(B)}))})},[f,e,r,_,P]);HQ(()=>{u===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,d(N=>({...N,isPositioned:!1})))},[u]);const R=j.useRef(!1);HQ(()=>(R.current=!0,()=>{R.current=!1}),[]),HQ(()=>{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=j.useMemo(()=>({reference:S,floating:T,setReference:b,setFloating:x}),[b,x]),M=j.useMemo(()=>({reference:w,floating:A}),[w,A]),I=j.useMemo(()=>{const N={position:r,left:0,top:0};if(!M.floating)return N;const F=OJe(M.floating,h.x),B=OJe(M.floating,h.y);return s?{...N,transform:"translate("+F+"px, "+B+"px)",...CJe(M.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:F,top:B}},[r,s,M.floating,h.x,h.y]);return j.useMemo(()=>({...h,update:L,refs:D,elements:M,floatingStyles:I}),[h,L,D,M,I])}const gyr=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?TJe({element:n.current,padding:i}).fn(r):{}:n?TJe({element:n,padding:i}).fn(r):{}}}},EJe=(t,e)=>{const r=oyr(t);return{name:r.name,fn:r.fn,options:[t,e]}},_Je=(t,e)=>{const r=syr(t);return{name:r.name,fn:r.fn,options:[t,e]}},RJe=(t,e)=>({fn:hyr(t).fn,options:[t,e]}),DJe=(t,e)=>{const r=lyr(t);return{name:r.name,fn:r.fn,options:[t,e]}},LJe=(t,e)=>{const r=cyr(t);return{name:r.name,fn:r.fn,options:[t,e]}},myr=(t,e)=>{const r=uyr(t);return{name:r.name,fn:r.fn,options:[t,e]}},vyr=(t,e)=>{const r=gyr(t);return{name:r.name,fn:r.fn,options:[t,e]}};var MJe={exports:{}},IJe={};/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -214,58 +214,58 @@ 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 YQ=j,myr=tQ;function vyr(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var yyr=typeof Object.is=="function"?Object.is:vyr,byr=myr.useSyncExternalStore,xyr=YQ.useRef,wyr=YQ.useEffect,Ayr=YQ.useMemo,Syr=YQ.useDebugValue;LJe.useSyncExternalStoreWithSelector=function(t,e,r,n,i){var a=xyr(null);if(a.current===null){var o={hasValue:!1,value:null};a.current=o}else o=a.current;a=Ayr(function(){function l(p){if(!u){if(u=!0,h=p,p=n(p),i!==void 0&&o.hasValue){var g=o.value;if(i(g,p))return d=g}return d=p}if(g=d,yyr(h,p))return g;var m=n(p);return i!==void 0&&i(g,m)?(h=p,g):(h=p,d=m)}var u=!1,h,d,f=r===void 0?null:r;return[function(){return l(e())},f===null?void 0:function(){return l(f())}]},[e,r,n,i]);var s=byr(t,a[0],a[1]);return wyr(function(){o.hasValue=!0,o.value=s},[s]),Syr(s),s},DJe.exports=LJe;var Tyr=DJe.exports;const Cyr=Uce(19)?kyr:Eyr;function MJe(t,e,r,n,i){return Cyr(t,e,r,n,i)}function Oyr(t,e,r,n,i){const a=j.useCallback(()=>e(t.getSnapshot(),r,n,i),[t,e,r,n,i]);return tQ.useSyncExternalStore(t.subscribe,a,a)}function kyr(t,e,r,n,i){return Oyr(t,e,r,n,i)}function Eyr(t,e,r,n,i){return Tyr.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getSnapshot,a=>e(a,r,n,i))}class _yr{constructor(e){Pr(this,"subscribe",e=>(this.listeners.add(e),()=>{this.listeners.delete(e)}));Pr(this,"getSnapshot",()=>this.state);this.state=e,this.listeners=new Set,this.updateTick=0}setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;const r=this.updateTick;for(const n of this.listeners){if(r!==this.updateTick)return;n(e)}}update(e){for(const r in e)if(!Object.is(this.state[r],e[r])){this.setState({...this.state,...e});return}}set(e,r){Object.is(this.state[e],r)||this.setState({...this.state,[e]:r})}notifyAll(){const e={...this.state};this.setState(e)}use(e,r,n,i){return MJe(this,e,r,n,i)}}class IJe extends _yr{constructor(e,r={},n){super(e),this.context=r,this.selectors=n}useSyncedValue(e,r){j.useDebugValue(e);const n=this;Bn(()=>{n.state[e]!==r&&n.set(e,r)},[n,e,r])}useSyncedValueWithCleanup(e,r){const n=this;Bn(()=>(n.state[e]!==r&&n.set(e,r),()=>{n.set(e,void 0)}),[n,e,r])}useSyncedValues(e){const r=this,n=Object.values(e);Bn(()=>{r.update(e)},[r,...n])}useControlledProp(e,r){j.useDebugValue(e);const n=this,i=r!==void 0;Bn(()=>{i&&!Object.is(n.state[e],r)&&n.setState({...n.state,[e]:r})},[n,e,r,i])}select(e,r,n,i){const a=this.selectors[e];return a(this.state,r,n,i)}useState(e,r,n,i){return j.useDebugValue(e),MJe(this,this.selectors[e],r,n,i)}useContextCallback(e,r){j.useDebugValue(e);const n=Pn(r??pce);this.context[e]=n}useStateSetter(e){const r=j.useRef(void 0);return r.current===void 0&&(r.current=n=>{this.set(e,n)}),r.current}observe(e,r){let n;typeof e=="function"?n=e:n=this.selectors[e];let i=n(this.state);return r(i,i,this),this.subscribe(a=>{const o=n(a);if(!Object.is(i,o)){const s=i;i=o,r(o,s,this)}})}}const Ryr={open:t=>t.open,transitionStatus:t=>t.transitionStatus,domReferenceElement:t=>t.domReferenceElement,referenceElement:t=>t.positionReference??t.referenceElement,floatingElement:t=>t.floatingElement,floatingId:t=>t.floatingId};class Kce extends IJe{constructor(r){const{syncOnly:n,nested:i,onOpenChange:a,triggerElements:o,...s}=r;super({...s,positionReference:s.referenceElement,domReferenceElement:s.referenceElement},{onOpenChange:a,dataRef:{current:{}},events:iJe(),nested:i,triggerElements:o},Ryr);Pr(this,"syncOpenEvent",(r,n)=>{(!r||!this.state.open||n!=null&&f0r(n))&&(this.context.dataRef.current.openEvent=r?n:void 0)});Pr(this,"dispatchOpenChange",(r,n)=>{this.syncOpenEvent(r,n.event);const i={open:r,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",i)});Pr(this,"setOpen",(r,n)=>{var i,a,o,s;if(this.syncOnly){(a=(i=this.context).onOpenChange)==null||a.call(i,r,n);return}this.dispatchOpenChange(r,n),(s=(o=this.context).onOpenChange)==null||s.call(o,r,n)});this.syncOnly=n}}function Dyr(t){const{popupStore:e,treatPopupAsFloatingElement:r=!1,floatingRootContext:n,floatingId:i,nested:a,onOpenChange:o}=t,s=e.useState("open"),l=e.useState("activeTriggerElement"),u=e.useState(r?"popupElement":"positionerElement"),h=e.context.triggerElements,d=o,f=j.useRef(null);n===void 0&&f.current===null&&(f.current=new Kce({open:s,transitionStatus:void 0,referenceElement:l,floatingElement:u,triggerElements:h,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));const p=n??f.current;return e.useSyncedValue("floatingId",i),Bn(()=>{const g={open:s,floatingId:i,referenceElement:l,floatingElement:u};Yi(l)&&(g.domReferenceElement=l),p.state.positionReference===p.state.referenceElement&&(g.positionReference=l),p.update(g)},[s,i,l,u,p]),p.context.onOpenChange=d,p.context.nested=a,p}function PJe(t,e=!1,r=!1){const[n,i]=j.useState(t&&e?"idle":void 0),[a,o]=j.useState(t);return t&&!a&&(o(!0),i("starting")),!t&&a&&n!=="ending"&&!r&&i("ending"),!t&&!a&&n==="ending"&&i(void 0),Bn(()=>{if(!t&&a&&n!=="ending"&&r){const s=Lh.request(()=>{i("ending")});return()=>{Lh.cancel(s)}}},[t,a,n,r]),Bn(()=>{if(!t||e)return;const s=Lh.request(()=>{i(void 0)});return()=>{Lh.cancel(s)}},[e,t]),Bn(()=>{if(!t||!e)return;t&&a&&n!=="idle"&&i("starting");const s=Lh.request(()=>{i("idle")});return()=>{Lh.cancel(s)}},[e,t,a,n]),{mounted:a,setMounted:o,transitionStatus:n}}function Zce(t,e=!1){const r=Ece();return Pn((n,i=null)=>{r.cancel();const a=ay(t);if(a==null)return;const o=a,s=()=>{kf.flushSync(n)};if(typeof o.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){n();return}function l(){Promise.all(o.getAnimations().map(u=>u.finished)).then(()=>{i!=null&&i.aborted||s()},()=>{if(i!=null&&i.aborted)return;if(o.getAnimations().some(h=>h.pending||h.playState!=="finished")){l();return}s()})}if(e){const u="data-starting-style";if(!o.hasAttribute(u)){r.request(l);return}const h=new MutationObserver(()=>{o.hasAttribute(u)||(h.disconnect(),l())});h.observe(o,{attributes:!0,attributeFilter:[u]}),i==null||i.addEventListener("abort",()=>h.disconnect(),{once:!0});return}r.request(l)})}function Jce(t){const{enabled:e=!0,open:r,ref:n,onComplete:i}=t,a=Pn(i),o=Zce(n,r);j.useEffect(()=>{if(!e)return;const s=new AbortController;return o(a,s.signal),()=>{s.abort()}},[e,r,a,o])}const Lyr={tabIndex:-1,[Ace]:""};function Myr(t){return e=>e==="touch"?t.current:!0}function Iyr(t,e=!1){const r=FQ(),n=QQ()!=null,i=Kp(()=>t(r,n)).current;return Dyr({popupStore:i,treatPopupAsFloatingElement:e,floatingRootContext:i.state.floatingRootContext,floatingId:r,nested:n,onOpenChange:i.setOpen}),i}function Pyr({handle:t,store:e}){return Bn(()=>t.attachStore(e),[t,e]),null}function Nyr(t,e){const r=j.useRef(null),n=j.useRef(null);return j.useCallback(i=>{if(t===void 0)return;let a=!1;if(r.current!==null){const o=r.current,s=n.current,l=e.context.triggerElements.getById(o);s&&l===s&&(e.context.triggerElements.delete(o),a=!0),r.current=null,n.current=null}if(i!==null&&(r.current=t,n.current=i,e.context.triggerElements.add(t,i),a=!0),a){const o=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==o&&e.set("triggerCount",o)}},[e,t])}function Byr(t,e,r,n=!1){e?t.preventUnmountingOnClose=!1:n&&(t.preventUnmountingOnClose=!0);const i=(r==null?void 0:r.id)??null;(i||e)&&(t.activeTriggerId=i,t.activeTriggerElement=r??null)}function $yr(t){let e=!1;return t.preventUnmountOnClose=()=>{e=!0},()=>e}function Fyr(t,e,r,n){const i=r.useState("isMountedByTrigger",t),a=Nyr(t,r),o=Pn(l=>{const u=r.select("open"),h=r.select("activeTriggerId");if(h===t){r.update({activeTriggerElement:l,...u?n:null});return}h==null&&u&&r.update({activeTriggerId:t,activeTriggerElement:l,...n})}),s=j.useCallback(l=>{a(l),l&&o(l)},[a,o]);return Bn(()=>{i&&r.update({activeTriggerElement:e.current,...n})},[i,r,e,...Object.values(n)]),{registerTrigger:s,isMountedByThisTrigger:i}}function zyr(t,e={}){const{closeOnActiveTriggerUnmount:r=!1}=e,n=j.useRef(null),i=t.useState("open"),a=t.useState("triggerCount"),o=t.useState("activeTriggerId"),s=t.useState("activeTriggerElement");Bn(()=>{if(!i){n.current=null,t.state.triggerCount!==0&&t.set("triggerCount",0);return}const l=t.context.triggerElements.size,u={};t.state.triggerCount!==l&&(u.triggerCount=l);const h=t.select("activeTriggerId");let d=null;if(h){const f=t.context.triggerElements.getById(h);if(f)n.current=h,f!==t.state.activeTriggerElement&&(u.activeTriggerElement=f);else{for(const[p,g]of t.context.triggerElements.entries())if(g===t.state.activeTriggerElement){u.activeTriggerId=p,u.activeTriggerElement=g,n.current=p;break}u.activeTriggerId===void 0&&(n.current===h?d=h:n.current=null)}}else n.current=null;if(!d&&!h&&l===1){const f=t.context.triggerElements.entries().next();if(!f.done){const[p,g]=f.value;u.activeTriggerId=p,u.activeTriggerElement=g,n.current=p}}(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)&&t.update(u),d&&r&&queueMicrotask(()=>{if(t.select("open")&&t.select("activeTriggerId")===d&&!t.context.triggerElements.getById(d)){const f=_s(xZe);t.setOpen(!1,f),f.isCanceled||t.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,t,a,o,s,r])}function Uyr(t,e,r){const{mounted:n,setMounted:i,transitionStatus:a}=PJe(t),o=e.useState("preventUnmountingOnClose"),s=t?!1:o;e.useSyncedValues({mounted:n,transitionStatus:a,preventUnmountingOnClose:s});const l=Pn(()=>{var u,h;i(!1),e.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),r==null||r(),(h=(u=e.context).onOpenChangeComplete)==null||h.call(u,!1)});return Jce({enabled:n&&!t&&!s,open:t,ref:e.context.popupRef,onComplete(){t||l()}}),{forceUnmount:l,transitionStatus:a}}function Vyr(t,e){t.useSyncedValues(e),Bn(()=>()=>{t.update({activeTriggerProps:Su,inactiveTriggerProps:Su,popupProps:Su})},[t])}function Qyr(t,e){Bn(()=>{!e&&t.state.openMethod!==null&&t.set("openMethod",null)},[e,t]),Bn(()=>()=>{t.state.openMethod!==null&&t.set("openMethod",null)},[t])}class NJe{constructor(){this.idMap=new Map}add(e,r){this.idMap.set(e,r)}delete(e){this.idMap.delete(e)}hasElement(e){for(const r of this.idMap.values())if(r===e)return!0;return!1}hasMatchingElement(e){for(const r of this.idMap.values())if(e(r))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function Gyr(){return new Kce({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new NJe,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Hyr(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Gyr(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Su,inactiveTriggerProps:Su,popupProps:Su}}function Wyr(t,e,r=!1){return new Kce({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:t,floatingId:e,syncOnly:!0,nested:r,onOpenChange:void 0})}const J6=t=>t.triggerIdProp??t.activeTriggerId,eue=t=>t.openProp??t.open,BJe=t=>{var r;return(((r=t.popupElement)==null?void 0:r.id)??t.floatingId)||void 0};function $Je(t,e){return e!==void 0&&eue(t)&&J6(t)===e}function Yyr(t,e){return $Je(t,e)?!0:e!==void 0&&eue(t)&&J6(t)==null&&t.triggerCount===1}const qyr={open:eue,mounted:t=>t.mounted,transitionStatus:t=>t.transitionStatus,floatingRootContext:t=>t.floatingRootContext,triggerCount:t=>t.triggerCount,preventUnmountingOnClose:t=>t.preventUnmountingOnClose,payload:t=>t.payload,activeTriggerId:J6,activeTriggerElement:t=>t.mounted?t.activeTriggerElement:null,popupId:BJe,isTriggerActive:(t,e)=>e!==void 0&&J6(t)===e,isOpenedByTrigger:(t,e)=>$Je(t,e),isMountedByTrigger:(t,e)=>e!==void 0&&J6(t)===e&&t.mounted,triggerProps:(t,e)=>e?t.activeTriggerProps:t.inactiveTriggerProps,triggerPopupId:(t,e)=>Yyr(t,e)?BJe(t):void 0,popupProps:t=>t.popupProps,popupElement:t=>t.popupElement,positionerElement:t=>t.positionerElement};function jyr(t){const e=j.useCallback(n=>t===void 0?pce:t.subscribeStore(n),[t]),r=j.useCallback(()=>t===void 0?void 0:t.store,[t]);return tQ.useSyncExternalStore(e,r,()=>t==null?void 0:t.serverStore)}function Xyr(t){return Kyr(t,t.rootContext)}function Kyr(t,e){const{nodeId:r,externalTree:n}=t,i=e.useState("referenceElement"),a=e.useState("floatingElement"),o=e.useState("domReferenceElement"),s=e.useState("open"),l=e.useState("floatingId"),[u,h]=j.useState(null),[d,f]=j.useState(void 0),[p,g]=j.useState(void 0),m=j.useRef(null),v=NE(n),y=j.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),b=CJe({...t,elements:{...y,...u&&{reference:u}}}),x=Yi(d)?d:null,w=p===void 0?e.state.floatingElement:p;e.useSyncedValue("referenceElement",d??null),e.useSyncedValue("domReferenceElement",d===void 0?o:x),e.useSyncedValue("floatingElement",w);const A=j.useCallback(_=>{const P=Yi(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),getClientRects:()=>_.getClientRects(),contextElement:_}:_;h(P),b.refs.setReference(P)},[b.refs]),S=j.useCallback(_=>{(Yi(_)||_===null)&&(m.current=_,f(_)),(Yi(b.refs.reference.current)||b.refs.reference.current===null||_!==null&&!Yi(_))&&b.refs.setReference(_)},[b.refs,f]),T=j.useCallback(_=>{g(_),b.refs.setFloating(_)},[b.refs]),C=j.useMemo(()=>({...b.refs,setReference:S,setFloating:T,setPositionReference:A,domReference:m}),[b.refs,S,T,A]),k=j.useMemo(()=>({...b.elements,domReference:o}),[b.elements,o]),E=j.useMemo(()=>({...b,dataRef:e.context.dataRef,open:s,onOpenChange:e.setOpen,events:e.context.events,floatingId:l,refs:C,elements:k,nodeId:r,rootStore:e}),[b,C,k,r,e,s,l]);return Bn(()=>{o&&(m.current=o)},[o]),Bn(()=>{e.context.dataRef.current.floatingContext=E;const _=v==null?void 0:v.nodesRef.current.find(P=>P.id===r);_&&(_.context=E)}),j.useMemo(()=>({...b,context:E,refs:C,elements:k,rootStore:e}),[b,C,k,E,e])}class tue{constructor(){Pr(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});Pr(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Zp,this.restTimeout=new Zp,this.handleCloseOptions=void 0}static create(){return new tue}}const qQ=new WeakMap;function jQ(t){var r,n,i;if(!t.performedPointerEventsMutation)return;const e=t.pointerEventsScopeElement;e&&qQ.get(e)===t&&((r=t.pointerEventsScopeElement)==null||r.style.removeProperty("pointer-events"),(n=t.pointerEventsReferenceElement)==null||n.style.removeProperty("pointer-events"),(i=t.pointerEventsFloatingElement)==null||i.style.removeProperty("pointer-events"),qQ.delete(e)),t.performedPointerEventsMutation=!1,t.pointerEventsScopeElement=null,t.pointerEventsReferenceElement=null,t.pointerEventsFloatingElement=null}function FJe(t,e){const{scopeElement:r,referenceElement:n,floatingElement:i}=e,a=qQ.get(r);a&&a!==t&&jQ(a),jQ(t),t.performedPointerEventsMutation=!0,t.pointerEventsScopeElement=r,t.pointerEventsReferenceElement=n,t.pointerEventsFloatingElement=i,qQ.set(r,t),r.style.pointerEvents="none",n.style.pointerEvents="auto",i.style.pointerEvents="auto"}function zJe(t){const e=t.context.dataRef.current,r=Kp(()=>e.hoverInteractionState??tue.create()).current;return e.hoverInteractionState||(e.hoverInteractionState=r),gce(e.hoverInteractionState.disposeEffect),e.hoverInteractionState}function Zyr(t,e={}){const{enabled:r=!0,closeDelay:n=0,nodeId:i}=e,a="rootStore"in t?t.rootStore:t,o=a.useState("open"),s=a.useState("floatingElement"),l=a.useState("domReferenceElement"),{dataRef:u}=a.context,h=NE(),d=QQ(),f=zJe(a),p=EE(),g=Pn(()=>{var y;return bZe((y=u.current.openEvent)==null?void 0:y.type,f.interactedInside)}),m=Pn(()=>{var y;return w0r((y=u.current.openEvent)==null?void 0:y.type)}),v=Pn(()=>{jQ(f)});Bn(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,v())},[o,f,v]),j.useEffect(()=>v,[v]),Bn(()=>{var y,b,x,w,A;if(r&&o&&(y=f.handleCloseOptions)!=null&&y.blockPointerEvents&&m()&&Yi(l)&&s){const S=l,T=s,C=eo(s),k=(x=(b=h==null?void 0:h.nodesRef.current.find(L=>L.id===d))==null?void 0:b.context)==null?void 0:x.elements.floating;k&&(k.style.pointerEvents="");const E=f.pointerEventsScopeElement!==T?f.pointerEventsScopeElement:null,_=k!==T?k:null,P=((A=(w=f.handleCloseOptions)==null?void 0:w.getScope)==null?void 0:A.call(w))??E??_??S.closest("[data-rootownerid]")??C.body;return FJe(f,{scopeElement:P,referenceElement:S,floatingElement:T}),()=>{v()}}},[r,o,l,s,f,m,h,d,v]),j.useEffect(()=>{if(!r)return;function y(){return!!(h&&d&&ux(h.nodesRef.current,d).length>0)}function b(C){const k=Cce(n,"close",f.pointerType),E=()=>{a.setOpen(!1,_s(Ld,C)),h==null||h.events.emit("floating.closed",C)};k?f.openChangeTimeout.start(k,E):(f.openChangeTimeout.clear(),E())}function x(C){const k=Jp(C);if(!b0r(k)){f.interactedInside=!1;return}f.interactedInside=(k==null?void 0:k.closest("[aria-haspopup]"))!=null}function w(){f.openChangeTimeout.clear(),p.clear(),h==null||h.events.off("floating.closed",S),v()}function A(C){var P;if(y()&&h){h.events.on("floating.closed",S);return}if(gZe(C.relatedTarget,a.context.triggerElements))return;const k=((P=u.current.floatingContext)==null?void 0:P.nodeId)??i,E=C.relatedTarget;if(!(h&&k&&Yi(E)&&ux(h.nodesRef.current,k,!1).some(L=>{var R;return Hn((R=L.context)==null?void 0:R.elements.floating,E)}))){if(f.handler){f.handler(C);return}v(),m()&&!g()&&b(C)}}function S(C){!h||!d||y()||p.start(0,()=>{h.events.off("floating.closed",S),a.setOpen(!1,_s(Ld,C)),h.events.emit("floating.closed",C)})}const T=s;return ey(T&&bi(T,"mouseenter",w),T&&bi(T,"mouseleave",A),T&&bi(T,"pointerdown",x,!0),()=>{h==null||h.events.off("floating.closed",S)})},[r,s,a,u,n,i,m,g,v,f,h,d,p])}const Jyr={current:null};function e1r(t,e={}){var M;const{enabled:r=!0,delay:n=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:l=Jyr,externalTree:u,isActiveTrigger:h=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:g=!1}=e,m="rootStore"in t?t.rootStore:t,{dataRef:v,events:y}=m.context,b=NE(u),x=zJe(m),w=j.useRef(!1),A=Tu(i),S=Tu(n),T=Tu(o),C=Tu(r),k=Tu(p),E=Tu(f),_=Pn(()=>{var I;return bZe((I=v.current.openEvent)==null?void 0:I.type,x.interactedInside)}),P=Pn(()=>{var I;return((I=k.current)==null?void 0:I.call(k))!==!1}),L=Pn((I,N,F)=>{const B=m.context.triggerElements;if(B.hasElement(N))return!I||!Hn(I,N);if(!Yi(F))return!1;const V=F;return B.hasMatchingElement(z=>Hn(z,V))&&(!I||!Hn(I,V))}),R=Pn(()=>{if(!x.handler)return;eo(m.select("domReferenceElement")).removeEventListener("mousemove",x.handler),x.handler=void 0}),D=Pn(()=>{jQ(x)});return h&&(x.handleCloseOptions=(M=A.current)==null?void 0:M.__options),j.useEffect(()=>R,[R]),j.useEffect(()=>{if(!r)return;function I(N){N.open?w.current=!1:(w.current=N.reason===Ld,R(),x.openChangeTimeout.clear(),x.restTimeout.clear(),x.blockMouseMove=!0,x.restTimeoutPending=!1)}return y.on("openchange",I),()=>{y.off("openchange",I)}},[r,y,x,R]),j.useEffect(()=>{if(!r)return;function I(U,Q=!0){const G=Cce(S.current,"close",x.pointerType);G?x.openChangeTimeout.start(G,()=>{m.setOpen(!1,_s(Ld,U)),b==null||b.events.emit("floating.closed",U)}):Q&&(x.openChangeTimeout.clear(),m.setOpen(!1,_s(Ld,U)),b==null||b.events.emit("floating.closed",U))}const N=l.current??(h?m.select("domReferenceElement"):null);if(!Yi(N))return;function F(U){var ue;if(x.openChangeTimeout.clear(),x.blockMouseMove=!1,a&&!RE(x.pointerType))return;const Q=yZe(T.current),G=Cce(S.current,"open",x.pointerType),q=Jp(U),Y=U.currentTarget??null,ne=m.select("domReferenceElement");let X=Y;if(Yi(q)&&!m.context.triggerElements.hasElement(q)){for(const de of m.context.triggerElements.elements())if(Hn(de,q)){X=de;break}}Yi(Y)&&Yi(ne)&&!m.context.triggerElements.hasElement(Y)&&Hn(Y,ne)&&(X=ne);const J=X==null?!1:L(ne,X,q),ee=m.select("open"),te=((ue=E.current)==null?void 0:ue.call(E))??m.select("transitionStatus")==="ending",pe=!ee&&te&&w.current,ie=!J&&Yi(X)&&Yi(ne)&&Hn(ne,X)&&pe,Ce=Q>0&&!G,ke=J&&(ee||pe)||ie,Ee=!ee||J;if(ke){P()&&m.setOpen(!0,_s(Ld,U,X));return}Ce||(G?x.openChangeTimeout.start(G,()=>{Ee&&P()&&m.setOpen(!0,_s(Ld,U,X))}):Ee&&P()&&m.setOpen(!0,_s(Ld,U,X)))}function B(U){if(_()){D();return}R();const Q=m.select("domReferenceElement"),G=eo(Q);x.restTimeout.clear(),x.restTimeoutPending=!1;const q=v.current.floatingContext??(d==null?void 0:d());if(gZe(U.relatedTarget,m.context.triggerElements))return;if(A.current&&q){m.select("open")||x.openChangeTimeout.clear();const ne=l.current;x.handler=A.current({...q,tree:b,x:U.clientX,y:U.clientY,onClose(){D(),R(),C.current&&!_()&&ne===m.select("domReferenceElement")&&I(U,!0)}}),G.addEventListener("mousemove",x.handler),x.handler(U);return}(x.pointerType==="touch"?!Hn(m.select("floatingElement"),U.relatedTarget):!0)&&I(U)}function V(U){Hn(N,U.relatedTarget)||(x.openChangeTimeout.clear(),x.restTimeout.clear(),x.restTimeoutPending=!1)}const z=g?bi(N,"mouseout",V):void 0;return s?ey(bi(N,"mousemove",F,{once:!0}),bi(N,"mouseenter",F),bi(N,"mouseleave",B),z):ey(bi(N,"mouseenter",F),bi(N,"mouseleave",B),z)},[R,D,v,S,m,r,A,x,h,L,_,a,s,T,l,b,C,d,E,P,g]),j.useMemo(()=>{if(!r)return;function I(N){x.pointerType=N.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(N){var q,Y,ne;const{nativeEvent:F}=N,B=N.currentTarget,V=m.select("domReferenceElement"),z=m.select("open"),U=L(V,B,N.target);if(a&&!RE(x.pointerType))return;if(z&&U&&((q=x.handleCloseOptions)!=null&&q.blockPointerEvents)){const X=m.select("floatingElement");if(X){const J=((ne=(Y=x.handleCloseOptions)==null?void 0:Y.getScope)==null?void 0:ne.call(Y))??B.ownerDocument.body;FJe(x,{scopeElement:J,referenceElement:B,floatingElement:X})}}const Q=yZe(T.current);if(z&&!U||Q===0||!U&&x.restTimeoutPending&&N.movementX**2+N.movementY**2<2)return;x.restTimeout.clear();function G(){if(x.restTimeoutPending=!1,_())return;const X=m.select("open");!x.blockMouseMove&&(!X||U)&&P()&&m.setOpen(!0,_s(Ld,F,B))}x.pointerType==="touch"?kf.flushSync(()=>{G()}):U&&z?G():(x.restTimeoutPending=!0,x.restTimeout.start(Q,G))}}},[r,x,_,L,a,m,T,P])}const UJe=.1,t1r=UJe*UJe,ma=.5;function XQ(t,e,r,n,i,a){return n>=e!=a>=e&&t<=(i-r)*(e-n)/(a-n)+r}function KQ(t,e,r,n,i,a,o,s,l,u){let h=!1;return XQ(t,e,r,n,i,a)&&(h=!h),XQ(t,e,i,a,o,s)&&(h=!h),XQ(t,e,o,s,l,u)&&(h=!h),XQ(t,e,l,u,r,n)&&(h=!h),h}function r1r(t,e,r){return t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height}function ZQ(t,e,r,n,i,a){const o=Math.min(r,i),s=Math.max(r,i),l=Math.min(n,a),u=Math.max(n,a);return t>=o&&t<=s&&e>=l&&e<=u}function n1r(t={}){const{blockPointerEvents:e=!1}=t,r=new Zp,n=({x:i,y:a,placement:o,elements:s,onClose:l,nodeId:u,tree:h})=>{const d=o==null?void 0:o.split("-")[0];let f=!1,p=null,g=null,m=typeof performance<"u"?performance.now():0;function v(b,x){const w=performance.now(),A=w-m;if(p===null||g===null||A===0)return p=b,g=x,m=w,!1;const S=b-p,T=x-g,C=S*S+T*T,k=A*A*t1r;return p=b,g=x,m=w,C0)}function L(){P()||y()}if(P())return;const R=w.getBoundingClientRect(),D=A.getBoundingClientRect(),M=i>D.right-D.width/2,I=a>D.bottom-D.height/2,N=D.width>R.width,F=D.height>R.height,B=(N?R:D).left,V=(N?R:D).right,z=(F?R:D).top,U=(F?R:D).bottom;if(d==="top"&&a>=R.bottom-1||d==="bottom"&&a<=R.top+1||d==="left"&&i>=R.right-1||d==="right"&&i<=R.left+1){L();return}let Q=!1;switch(d){case"top":Q=ZQ(S,T,B,R.top+1,V,D.bottom-1);break;case"bottom":Q=ZQ(S,T,B,D.top+1,V,R.bottom-1);break;case"left":Q=ZQ(S,T,D.right-1,U,R.left+1,z);break;case"right":Q=ZQ(S,T,R.right-1,U,D.left+1,z);break}if(Q)return;if(f&&!r1r(S,T,R)){L();return}if(!k&&v(S,T)){L();return}let G=!1;switch(d){case"top":{const q=N?ma/2:ma*4,Y=N||M?i+q:i-q,ne=N?i-q:M?i+q:i-q,X=a+ma+1,J=M||N?D.bottom-ma:D.top,ee=M?N?D.bottom-ma:D.top:D.bottom-ma;G=KQ(S,T,Y,X,ne,X,D.left,J,D.right,ee);break}case"bottom":{const q=N?ma/2:ma*4,Y=N||M?i+q:i-q,ne=N?i-q:M?i+q:i-q,X=a-ma,J=M||N?D.top+ma:D.bottom,ee=M?N?D.top+ma:D.bottom:D.top+ma;G=KQ(S,T,Y,X,ne,X,D.left,J,D.right,ee);break}case"left":{const q=F?ma/2:ma*4,Y=F||I?a+q:a-q,ne=F?a-q:I?a+q:a-q,X=i+ma+1,J=I||F?D.right-ma:D.left,ee=I?F?D.right-ma:D.left:D.right-ma;G=KQ(S,T,J,D.top,ee,D.bottom,X,Y,X,ne);break}case"right":{const q=F?ma/2:ma*4,Y=F||I?a+q:a-q,ne=F?a-q:I?a+q:a-q,X=i-ma,J=I||F?D.left+ma:D.right,ee=I?F?D.left+ma:D.right:D.left+ma;G=KQ(S,T,X,Y,X,ne,J,D.top,ee,D.bottom);break}}G?f||r.start(40,L):L()}};return n.__options={...t,blockPointerEvents:e},n}const VJe=j.createContext(void 0);function kA(t){const e=j.useContext(VJe);if(e===void 0&&!t)throw new Error(iy(47));return e}const i1r={...qyr,disabled:t=>t.disabled,instantType:t=>t.instantType,openMethod:t=>t.openMethod,openChangeReason:t=>t.openChangeReason,modal:t=>t.modal,focusManagerModal:t=>t.focusManagerModal,stickIfOpen:t=>t.stickIfOpen,titleElementId:t=>t.titleElementId,descriptionElementId:t=>t.descriptionElementId,openOnHover:t=>t.openOnHover,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin};class a1r extends IJe{constructor(r,n,i){const a=new NJe;super(o1r(r,a,n,i),s1r(a),i1r);Pr(this,"setOpen",(r,n)=>{var d,f;const i=n.reason===Ld,a=n.reason===LE&&n.event.detail===0,o=!r&&(n.reason===AZe||n.reason==null),s=$yr(n),l=this.select("activeTriggerId");if(!r&&n.reason===A0r&&n.trigger==null&&l!=null&&(n.trigger=this.context.triggerElements.getById(l)??this.select("activeTriggerElement")??void 0),(f=(d=this.context).onOpenChange)==null||f.call(d,r,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(r,n);const u=()=>{const p={open:r,openChangeReason:n.reason};Byr(p,r,n.trigger,s()),this.update(p)};i?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(fvr,()=>{this.set("stickIfOpen",!1)}),kf.flushSync(u)):u();let h;a?h="click":o?h="dismiss":n.reason===X6&&(h="focus"),this.set("instantType",h)})}}function o1r(t,e,r,n=!1){const i={...Hyr(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...t};return i.open&&(t==null?void 0:t.mounted)===void 0&&(i.mounted=!0),i.floatingRootContext=Wyr(e,r,n),i}function s1r(t){return{popupRef:j.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:j.createRef(),beforeContentFocusGuardRef:j.createRef(),stickIfOpenTimeout:new Zp,triggerElements:t}}function QJe({props:t}){const{children:e,open:r,defaultOpen:n=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:l,defaultTriggerId:u=null}=t,h=c1r(s,{modal:o,open:n,openProp:r,activeTriggerId:u,triggerIdProp:l});h.useControlledProp("openProp",r),h.useControlledProp("triggerIdProp",l);const d=h.useState("open"),f=h.useState("mounted"),p=h.useState("payload");h.useContextCallback("onOpenChange",i),h.useContextCallback("onOpenChangeComplete",a),Qyr(h,d),zyr(h);const{forceUnmount:g}=Uyr(d,h,()=>{h.update({stickIfOpen:!0,openChangeReason:null})});h.useSyncedValues({modal:o}),j.useEffect(()=>{d||h.context.stickIfOpenTimeout.clear()},[h,d]),j.useImperativeHandle(t.actionsRef,()=>({unmount:g,close:()=>h.setOpen(!1,_s(S0r))}),[g,h]);const m=d||f;return H.jsxs(VJe.Provider,{value:h,children:[s&&H.jsx(Pyr,{handle:s,store:h}),m&&H.jsx(u1r,{store:h,modal:o}),typeof e=="function"?e({payload:p}):e]})}function l1r(t){return kA(!0)?H.jsx(QJe,{props:t}):H.jsx(Svr,{children:H.jsx(QJe,{props:t})})}function c1r(t,e){const r=Iyr((n,i)=>new a1r(e,n,i));return j.useEffect(()=>r.context.stickIfOpenTimeout.disposeEffect(),[r]),r}function u1r({store:t,modal:e}){const r=t.useState("floatingRootContext"),n=Rvr(r,{outsidePressEvent:{mouse:e==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),i=n.reference,a=n.floating;return Vyr(t,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:a}),null}const h1r=j.createContext(void 0);function d1r(t=!1){const e=j.useContext(h1r);if(e===void 0&&!t)throw new Error(iy(16));return e}function f1r(t){const{focusableWhenDisabled:e,disabled:r,composite:n=!1,tabIndex:i=0,isNativeButton:a}=t,o=n&&e!==!1,s=n&&e===!1;return{props:j.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||o)||!a&&r)&&(u["aria-disabled"]=r),a&&(!e||s)&&(u.disabled=r),u},[n,r,e,o,s,a,i])}}function rue(t,e,{detail:r=0}={}){t.dispatchEvent(new(cs(t)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:r,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}function GJe(t={}){const{disabled:e=!1,focusableWhenDisabled:r,tabIndex:n=0,native:i=!0,composite:a}=t,o=j.useRef(null),s=d1r(!0),l=a??s!==void 0,{props:u}=f1r({focusableWhenDisabled:r,disabled:e,composite:l,tabIndex:n,isNativeButton:i}),h=j.useCallback(()=>{const p=o.current;nue(p)&&l&&e&&u.disabled===void 0&&p.disabled&&(p.disabled=!1)},[e,u.disabled,l]);Bn(h,[h]);const d=j.useCallback((p={})=>{const{onClick:g,onMouseDown:m,onKeyUp:v,onKeyDown:y,onPointerDown:b,...x}=p;return Gce({onClick(w){if(e){w.preventDefault();return}g==null||g(w)},onMouseDown(w){e||m==null||m(w)},onKeyDown(w){if(e||(VQ(w),y==null||y(w),w.baseUIHandlerPrevented))return;const A=w.target===w.currentTarget,S=w.currentTarget,T=nue(S),C=!i&&p1r(S),k=A&&(i?T:!C),E=w.key==="Enter",_=w.key===" ",P=S.getAttribute("role"),L=(P==null?void 0:P.startsWith("menuitem"))||P==="option"||P==="gridcell";if(A&&l&&_){if(w.defaultPrevented&&L)return;w.preventDefault(),(!i||T)&&(w.preventBaseUIHandler(),rue(S,w));return}if(!k||i||!_&&!E){A&&C&&_&&w.preventDefault();return}w.defaultPrevented||(w.preventDefault(),E&&(w.preventBaseUIHandler(),rue(S,w)))},onKeyUp(w){if(!e){if(VQ(w),v==null||v(w),w.target===w.currentTarget&&i&&l&&nue(w.currentTarget)&&w.key===" "){w.preventDefault();return}w.baseUIHandlerPrevented||w.target===w.currentTarget&&!i&&!l&&!w.defaultPrevented&&w.key===" "&&(w.preventBaseUIHandler(),rue(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=Pn(p=>{o.current=p,h()});return{getButtonProps:d,buttonRef:f}}function nue(t){return Eo(t)&&t.tagName==="BUTTON"}function p1r(t){return Eo(t)&&t.tagName==="A"&&!!t.href}let JQ=function(t){return t.startingStyle="data-starting-style",t.endingStyle="data-ending-style",t}({});const g1r={"data-starting-style":""},m1r={"data-ending-style":""},HJe={transitionStatus(t){return t==="starting"?g1r:t==="ending"?m1r:null}};(function(t){return t.open="data-open",t.closed="data-closed",t[t.startingStyle=JQ.startingStyle]="startingStyle",t[t.endingStyle=JQ.endingStyle]="endingStyle",t.anchorHidden="data-anchor-hidden",t.side="data-side",t.align="data-align",t})({});const v1r={"data-popup-open":""},y1r={"data-popup-open":"","data-pressed":""},b1r={"data-open":""},x1r={"data-closed":""},w1r={"data-anchor-hidden":""},A1r={open(t){return t?v1r:null}},S1r={open(t){return t?y1r:null}},WJe={open(t){return t?b1r:x1r},anchorHidden(t){return t?w1r:null}},T1r={...WJe,...HJe},C1r=300;function $E(t){return FQ(t,"base-ui")}function O1r(t,e){const r=j.useRef(null);function n(a){kf.flushSync(()=>{t.setOpen(!1,_s(X6,a.nativeEvent,a.currentTarget))});const o=j0r(r.current);o==null||o.focus()}function i(a){var s;const o=t.select("positionerElement");if(o&&PE(a,o))(s=t.context.beforeContentFocusGuardRef.current)==null||s.focus();else{kf.flushSync(()=>{t.setOpen(!1,_s(X6,a.nativeEvent,a.currentTarget))});let l=q0r(t.context.triggerFocusTargetRef.current||e.current);for(;l!==null&&Hn(o,l);){const u=l;if(l=Nce(l),l===u)break}l==null||l.focus()}}return{preFocusGuardRef:r,handlePreFocusGuardFocus:n,handleFocusTargetFocus:i}}function k1r(t){const e=j.useRef(""),r=j.useCallback(i=>{i.defaultPrevented||(e.current=i.pointerType,t(i,i.pointerType))},[t]);return{onClick:j.useCallback(i=>{if(i.detail===0){t(i,"keyboard");return}"pointerType"in i?t(i,i.pointerType):t(i,e.current),e.current=""},[t]),onPointerDown:r}}function E1r(t,e){const r=Pn((a,o)=>{(typeof t=="function"?t():t)||e(o||(CQ?"touch":""))}),{onClick:n,onPointerDown:i}=k1r(r);return j.useMemo(()=>({onClick:n,onPointerDown:i}),[n,i])}const _1r=j.forwardRef(function(e,r){const{render:n,className:i,style:a,disabled:o=!1,nativeButton:s=!0,handle:l,payload:u,openOnHover:h=!1,delay:d=C1r,closeDelay:f=0,id:p,...g}=e,m=kA(!0),y=jyr(l)??m;if(!y)throw new Error(iy(74));const b=$E(p),x=y.useState("isTriggerActive",b),w=y.useState("floatingRootContext"),A=y.useState("isOpenedByTrigger",b),S=y.useState("triggerPopupId",b),T=j.useRef(null),{registerTrigger:C,isMountedByThisTrigger:k}=Fyr(b,T,y,{payload:u,disabled:o,openOnHover:h,closeDelay:f}),E=y.useState("openChangeReason"),_=y.useState("stickIfOpen"),P=y.useState("openMethod"),L=y.useState("focusManagerModal"),R=e1r(w,{enabled:!o&&h&&(P!=="touch"||E!==LE),mouseOnly:!0,move:!1,handleClose:n1r(),restMs:d,delay:{close:f},triggerElementRef:T,isActiveTrigger:x,isClosing:()=>y.select("transitionStatus")==="ending"}),D=kvr(w,{stickIfOpen:_}),M=E1r(()=>y.select("open"),Y=>{y.set("openMethod",Y)}),I=y.useState("triggerProps",k),{getButtonProps:N,buttonRef:F}=GJe({disabled:o,native:s}),B={open(Y){return Y&&E===LE?S1r.open(Y):A1r.open(Y)}},{preFocusGuardRef:V,handlePreFocusGuardFocus:z,handleFocusTargetFocus:U}=O1r(y,T),G=eg("button",e,{state:{disabled:o,open:A},ref:[F,r,C,T],props:[D.reference,R,I,M,{[tJe]:"",id:b,"aria-haspopup":"dialog","aria-expanded":A,"aria-controls":S},g,N],stateAttributesMapping:B}),q=H.jsx(j.Fragment,{children:G},b);return k&&!L?H.jsxs(j.Fragment,{children:[H.jsx(IE,{ref:V,onFocus:z}),q,H.jsx(IE,{ref:y.context.triggerFocusTargetRef,onFocus:U})]}):q}),YJe=j.createContext(void 0);function R1r(){const t=j.useContext(YJe);if(t===void 0)throw new Error(iy(45));return t}const D1r=j.forwardRef(function(e,r){const{keepMounted:n=!1,...i}=e;return kA().useState("mounted")||n?H.jsx(YJe.Provider,{value:n,children:H.jsx(bvr,{ref:r,...i})}):null});function L1r(t){return Uce(19)?t:t?"true":void 0}const qJe=j.createContext(void 0);function M1r(){const t=j.useContext(qJe);if(!t)throw new Error(iy(46));return t}const I1r=j.createContext(void 0);function P1r(){const t=j.useContext(I1r);return(t==null?void 0:t.direction)??"ltr"}const N1r=t=>({name:"arrow",options:t,async fn(e){var F,B;const{x:r,y:n,placement:i,rects:a,platform:o,elements:s,middlewareData:l}=e,{element:u,padding:h=0,offsetParent:d="real"}=vm(t,e)||{};if(u==null)return{};const f=Lce(h),p={x:r,y:n},g=IQ(i),m=MQ(g),v=await o.getDimensions(u),y=g==="y",b=y?"top":"left",x=y?"bottom":"right",w=y?"clientHeight":"clientWidth",A=a.reference[m]+a.reference[g]-p[g]-a.floating[m],S=p[g]-a.reference[g],T=d==="real"?await((F=o.getOffsetParent)==null?void 0:F.call(o,u)):s.floating;let C=s.floating[w]||a.floating[m];(!C||!await((B=o.isElement)==null?void 0:B.call(o,T)))&&(C=s.floating[w]||a.floating[m]);const k=A/2-S/2,E=C/2-v[m]/2-1,_=Math.min(f[b],E),P=Math.min(f[x],E),L=_,R=C-v[m]-P,D=C/2-v[m]/2+k,M=_ce(L,D,R),I=!l.arrow&&ny(i)!=null&&D!==M&&a.reference[m]/2-(D({...N1r(t),options:[t,e]}),$1r={name:"hide",async fn(t){const{width:e,height:r,x:n,y:i}=t.rects.reference,a=e===0&&r===0&&n===0&&i===0,o=await t.platform.detectOverflow(t,{elementContext:"reference"});return{data:{referenceHidden:o.top-r>=0||o.right-e>=0||o.bottom-r>=0||o.left-e>=0||a}}}},F1r={sideX:"left",sideY:"top"},jJe="--available-width",XJe="--available-height";function KJe(t,e,r){const n=t==="inline-start"||t==="inline-end";return{top:"top",right:n?r?"inline-start":"inline-end":"right",bottom:"bottom",left:n?r?"inline-end":"inline-start":"left"}[e]}function ZJe(t,e,r){const{rects:n,placement:i}=t;return{side:KJe(e,Uf(i),r),align:ny(i)||"center",anchor:{width:n.reference.width,height:n.reference.height},positioner:{width:n.floating.width,height:n.floating.height}}}function z1r(t){return U1r(t,Xyr)}function U1r(t,e){var Ze,He;const{anchor:r,positionMethod:n="absolute",side:i="bottom",sideOffset:a=0,align:o="center",alignOffset:s=0,collisionBoundary:l,collisionPadding:u=5,sticky:h=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:g=!1,floatingRootContext:m,mounted:v,collisionAvoidance:y,shift:b,nodeId:x,adaptiveOrigin:w,lazyFlip:A=!1,externalTree:S}=t,[T,C]=j.useState(null);!v&&T!==null&&C(null);const k=y.side||"flip",E=y.align||"flip",_=y.fallbackAxisSide||"end",P=(b==null?void 0:b.crossAxis)??!1,L=b==null?void 0:b.rootBoundary,R=typeof r=="function"?r:void 0,D=Pn(R),M=R?D:r,I=Tu(r),N=Tu(v),B=P1r()==="rtl",V=T||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":B?"left":"right","inline-start":B?"right":"left"}[i],z=o==="center"?V:`${V}-${o}`;let U=u;typeof U=="number"?U={top:U,right:U,bottom:U,left:U}:U&&(U={top:U.top||0,right:U.right||0,bottom:U.bottom||0,left:U.left||0});const Q=1,G=i==="bottom"?Q:0,q=i==="top"?Q:0,Y=i==="right"?Q:0,ne=i==="left"?Q:0,X={boundary:l==="clipping-ancestors"?"clippingAncestors":l,padding:U},J=j.useRef(null),ee=Tu(a),te=Tu(s),pe=typeof a!="function"?a:0,ie=typeof s!="function"?s:0,Ce=[];p&&Ce.push(p),Ce.push(OJe(et=>{const Pe=ZJe(et,i,B),yt=typeof ee.current=="function"?ee.current(Pe):ee.current,Ie=typeof te.current=="function"?te.current(Pe):te.current;return{mainAxis:yt,crossAxis:Ie,alignmentAxis:Ie}},[pe,ie,B,i]));const ke=E==="none"&&k!=="shift",Ee=!ke&&(h||P||k==="shift"),ue=k==="none"?null:_Je({...X,padding:{top:U.top+Q+G,right:U.right+Q+ne,bottom:U.bottom+Q+q,left:U.left+Q+Y},mainAxis:!P&&k==="flip",crossAxis:E==="flip"?"alignment":!1,fallbackAxisSideDirection:_}),de=ke?null:kJe({...X,rootBoundary:L,mainAxis:E!=="none",crossAxis:Ee,limiter:h||P?void 0:EJe(et=>{if(!J.current)return{};const{width:Pe,height:yt}=J.current.getBoundingClientRect(),Ie=Vf(Uf(et.placement)),St=Ie==="y"?Pe:yt,kt=Ie==="y"?U.left+U.right:U.top+U.bottom;return{offset:St/2+kt/2}})},[X,h,P,L,U,E]);k==="shift"||E==="shift"||o==="center"?Ce.push(de,ue):Ce.push(ue,de),Ce.push(RJe({...X,apply({elements:{floating:et},availableWidth:Pe,availableHeight:yt,rects:Ie}){if(!N.current)return;const St=et.style;St.setProperty(jJe,`${Pe}px`),St.setProperty(XJe,`${yt}px`);const kt=cs(et).devicePixelRatio||1,{x:ut,y:Gt,width:It,height:gt}=Ie.reference,Te=(Math.round((ut+It)*kt)-Math.round(ut*kt))/kt,Bt=(Math.round((Gt+gt)*kt)-Math.round(Gt*kt))/kt;St.setProperty("--anchor-width",`${Te}px`),St.setProperty("--anchor-height",`${Bt}px`)}}),B1r(et=>({element:J.current||eo(et.elements.floating).createElement("div"),padding:d,offsetParent:"floating"}),[d]),{name:"transformOrigin",fn(et){var jr,Ir,Zr;const{elements:Pe,middlewareData:yt,placement:Ie,rects:St,y:kt}=et,ut=Uf(Ie),Gt=Vf(ut),It=J.current,gt=((jr=yt.arrow)==null?void 0:jr.x)||0,Te=((Ir=yt.arrow)==null?void 0:Ir.y)||0,Bt=(It==null?void 0:It.clientWidth)||0,Et=(It==null?void 0:It.clientHeight)||0,At=gt+Bt/2,Mt=Te+Et/2,qr=Math.abs(((Zr=yt.shift)==null?void 0:Zr.y)||0),Me=St.reference.height/2,at=typeof a=="function"?a(ZJe(et,i,B)):a,wt=qr>at,Tt={top:`${At}px calc(100% + ${at}px)`,bottom:`${At}px ${-at}px`,left:`calc(100% + ${at}px) ${Mt}px`,right:`${-at}px ${Mt}px`}[ut],dr=`${At}px ${St.reference.y+Me-kt}px`;return Pe.floating.style.setProperty("--transform-origin",Ee&&Gt==="y"&&wt?dr:Tt),{}}},$1r,w),Bn(()=>{!v&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[v,m]);const xe=j.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:ge,elements:ze,x:we,y:Oe,middlewareData:Be,update:Z,placement:le,context:be,isPositioned:ae,floatingStyles:K}=e({rootContext:m,open:g?v:void 0,placement:z,middleware:Ce,strategy:n,whileElementsMounted:g?void 0:(...et)=>jce(...et,xe),nodeId:x,externalTree:S}),{sideX:se,sideY:me}=Be.adaptiveOrigin||F1r,oe=ae?n:"fixed",ve=j.useMemo(()=>{let et;return ae?w?et={position:oe,[se]:we,[me]:Oe}:et={...K,position:oe}:et={position:oe,top:0,left:0},et[jJe]="100vw",et[XJe]="100vh",ae||(et.opacity=0),et},[w,oe,se,we,me,Oe,K,ae]),ce=j.useRef(null);Bn(()=>{if(!v)return;const et=I.current,Pe=typeof et=="function"?et():et,Ie=(JJe(Pe)?Pe.current:Pe)||null||null;Ie!==ce.current&&(ge.setPositionReference(Ie),ce.current=Ie)},[v,ge,M,I]),j.useEffect(()=>{if(!v)return;const et=I.current;typeof et!="function"&&JJe(et)&&et.current!==ce.current&&(ge.setPositionReference(et.current),ce.current=et.current)},[v,ge,M,I]),j.useEffect(()=>{if(g&&v&&ze.reference&&ze.floating)return jce(ze.reference,ze.floating,Z,xe)},[g,v,ze,Z,xe]);const De=Uf(le),Le=KJe(i,De,B),We=ny(le)||"center",Ne=!!((Ze=Be.hide)!=null&&Ze.referenceHidden);Bn(()=>{A&&v&&ae&&De!==V&&C(De)},[A,v,ae,De,V]);const je=j.useMemo(()=>{var et,Pe;return{position:"absolute",top:(et=Be.arrow)==null?void 0:et.y,left:(Pe=Be.arrow)==null?void 0:Pe.x}},[Be.arrow]),$e=((He=Be.arrow)==null?void 0:He.centerOffset)!==0;return j.useMemo(()=>({positionerStyles:ve,arrowStyles:je,arrowRef:J,arrowUncentered:$e,side:Le,align:We,physicalSide:De,anchorHidden:Ne,refs:ge,context:be,isPositioned:ae,update:Z}),[ve,je,J,$e,Le,We,De,Ne,ge,be,ae,Z])}function JJe(t){return t!=null&&"current"in t}const V1r=j.forwardRef(function(e,r){const{cutout:n,...i}=e;let a;if(n){const o=n.getBoundingClientRect();a=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${o.left}px ${o.top}px,${o.left}px ${o.bottom}px,${o.right}px ${o.bottom}px,${o.right}px ${o.top}px,${o.left}px ${o.top}px)`}return H.jsx("div",{ref:r,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})});function eet(t){return t==="starting"?pvr:Su}function Q1r(t,e,{styles:r,transitionStatus:n,props:i,refs:a,hidden:o,inert:s=!1}){const l={...r};return s&&(l.pointerEvents="none"),eg("div",t,{state:e,ref:a,props:[{role:"presentation",hidden:o,style:l},eet(n),i],stateAttributesMapping:WJe})}let tet={},ret={},net="";function eG(t,e){return q6(t)?t:e}function iet(t,e,r){return/hidden|clip/.test(t.getComputedStyle(eG(e,r)).overflowY)}function G1r(t){if(typeof document>"u")return!1;const e=eo(t);return cs(e).innerWidth-e.documentElement.clientWidth>0}function H1r(t){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const r=eo(t),n=r.documentElement,i=r.body,a=eG(n,i),o=a.style.overflowY,s=n.style.scrollbarGutter;n.style.scrollbarGutter="stable",a.style.overflowY="scroll";const l=a.offsetWidth;a.style.overflowY="hidden";const u=a.offsetWidth;return a.style.overflowY=o,n.style.scrollbarGutter=s,l===u}function W1r(t){const e=eo(t),r=e.documentElement,n=e.body,i=eG(r,n),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,a)}}function Y1r(t){var p;const e=eo(t),r=e.documentElement,n=e.body,i=cs(r);let a=0,o=0,s=!1;const l=Lh.create();if(_E&&(((p=i.visualViewport)==null?void 0:p.scale)??1)!==1)return()=>{};function u(){const g=i.getComputedStyle(r),m=i.getComputedStyle(n),b=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=r.scrollTop,o=r.scrollLeft,tet={scrollbarGutter:r.style.scrollbarGutter,overflowY:r.style.overflowY,overflowX:r.style.overflowX},net=r.style.scrollBehavior,ret={position:n.style.position,height:n.style.height,width:n.style.width,boxSizing:n.style.boxSizing,overflowY:n.style.overflowY,overflowX:n.style.overflowX,scrollBehavior:n.style.scrollBehavior};const x=r.scrollHeight>r.clientHeight,w=r.scrollWidth>r.clientWidth,A=g.overflowY==="scroll"||m.overflowY==="scroll",S=g.overflowX==="scroll"||m.overflowX==="scroll",T=Math.max(0,i.innerWidth-n.clientWidth),C=Math.max(0,i.innerHeight-n.clientHeight),k=parseFloat(m.marginTop)+parseFloat(m.marginBottom),E=parseFloat(m.marginLeft)+parseFloat(m.marginRight),_=eG(r,n);if(s=H1r(t),s){r.style.scrollbarGutter=b,_.style.overflowY="hidden",_.style.overflowX="hidden";return}Object.assign(r.style,{scrollbarGutter:b,overflowY:"hidden",overflowX:"hidden"}),(x||A)&&(r.style.overflowY="scroll"),(w||S)&&(r.style.overflowX="scroll"),Object.assign(n.style,{position:"relative",height:k||C?`calc(100dvh - ${k+C}px)`:"100dvh",width:E||T?`calc(100vw - ${E+T}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),n.scrollTop=a,n.scrollLeft=o,r.setAttribute("data-base-ui-scroll-locked",""),r.style.scrollBehavior="unset"}function h(){Object.assign(r.style,tet),Object.assign(n.style,ret),s||(r.scrollTop=a,r.scrollLeft=o,r.removeAttribute("data-base-ui-scroll-locked"),r.style.scrollBehavior=net)}function d(){h(),l.request(u)}u();const f=bi(i,"resize",d);return()=>{l.cancel(),h(),typeof i.removeEventListener=="function"&&f()}}class q1r{constructor(){Pr(this,"lockCount",0);Pr(this,"restore",null);Pr(this,"timeoutLock",Zp.create());Pr(this,"timeoutUnlock",Zp.create());Pr(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Pr(this,"unlock",()=>{var e;this.lockCount===0&&this.restore&&((e=this.restore)==null||e.call(this),this.restore=null)})}acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}lock(e){if(this.lockCount===0||this.restore!==null)return;const r=eo(e),n=r.documentElement,i=r.body,a=cs(n);if(iet(a,n,i)){const s=new a.MutationObserver(()=>{iet(a,n,i)||(s.disconnect(),this.restore=null,this.lock(e))}),l={attributes:!0};s.observe(n,l),s.observe(i,l),this.restore=()=>s.disconnect();return}const o=CQ||!G1r(e);this.restore=o?W1r(e):Y1r(e)}}const j1r=new q1r;function X1r(t=!0,e=null){Bn(()=>{if(t)return j1r.acquire(e)},[t,e])}const K1r=20;function Z1r(t,e,r,n){const[i,a]=j.useState(!1);Bn(()=>{if(!t||!e||r==null){a(!1);return}const o=eo(r).documentElement.clientWidth,s=r.offsetWidth;a(o>0&&s>0&&s>=o-K1r)},[t,e,r]),X1r(t&&(!e||i),n)}const J1r=j.forwardRef(function(e,r){const{render:n,className:i,style:a,anchor:o,positionMethod:s,side:l,align:u,sideOffset:h,alignOffset:d,collisionBoundary:f="clipping-ancestors",collisionPadding:p,arrowPadding:g,sticky:m,disableAnchorTracking:v=!1,collisionAvoidance:y=gvr,...b}=e,x=kA(),w=R1r(),A=wvr(),S=x.useState("floatingRootContext"),T=x.useState("mounted"),C=x.useState("open"),k=x.useState("openChangeReason"),E=x.useState("activeTriggerElement"),_=x.useState("modal"),P=x.useState("openMethod"),L=x.useState("positionerElement"),R=x.useState("instantType"),D=x.useState("transitionStatus"),M=x.useState("adaptiveOrigin"),I=j.useRef(null),N=Zce(L),F=z1r({anchor:o,floatingRootContext:S,positionMethod:s,mounted:T,side:l,sideOffset:h,align:u,alignOffset:d,arrowPadding:g,collisionBoundary:f,collisionPadding:p,sticky:m,disableAnchorTracking:v,keepMounted:w,nodeId:A,collisionAvoidance:y,adaptiveOrigin:M}),B=S.useState("domReferenceElement");Bn(()=>{const G=B,q=I.current;if(G&&(I.current=G),q&&G&&G!==q){x.set("instantType",void 0);const Y=new AbortController;return N(()=>{x.set("instantType","trigger-change")},Y.signal),()=>{Y.abort()}}},[B,N,x]);const V=_===!0&&k!==Ld;Z1r(C&&V,P==="touch",L,E);const z=x.useStateSetter("positionerElement"),U={open:C,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:R},Q=Q1r(e,U,{styles:F.positionerStyles,transitionStatus:D,props:b,refs:[r,z],hidden:!T,inert:!C});return H.jsxs(qJe.Provider,{value:F,children:[T&&V&&H.jsx(V1r,{inert:L1r(!C),cutout:E}),H.jsx(Avr,{id:A,children:Q})]})}),ebr="ArrowUp",tbr="ArrowDown",rbr="ArrowLeft",nbr="ArrowRight",ibr="Home",abr="End",obr=new Set([ebr,tbr,rbr,nbr,ibr,abr]),sbr=j.createContext(void 0);function lbr(t){return j.useContext(sbr)}const cbr=j.createContext(void 0);function ubr(){const[t,e]=j.useState(0),r=Pn(()=>(e(i=>i+1),()=>{e(i=>Math.max(0,i-1))}));return{context:j.useMemo(()=>({register:r}),[r]),hasClosePart:t>0}}const hbr=j.forwardRef(function(e,r){const{render:n,className:i,style:a,initialFocus:o,finalFocus:s,...l}=e,u=kA(),h=M1r(),d=lbr()!=null,{context:f,hasClosePart:p}=ubr(),g=u.useState("open"),m=u.useState("openMethod"),v=u.useState("instantType"),y=u.useState("transitionStatus"),b=u.useState("popupProps"),x=u.useState("titleElementId"),w=u.useState("descriptionElementId"),A=u.useState("modal"),S=u.useState("mounted"),T=u.useState("openChangeReason"),C=u.useState("activeTriggerElement"),k=u.useState("floatingRootContext"),E=k.useState("floatingId"),_=u.useState("disabled"),P=u.useState("openOnHover"),L=u.useState("closeDelay");Jce({open:g,ref:u.context.popupRef,onComplete(){var F,B;g&&((B=(F=u.context).onOpenChangeComplete)==null||B.call(F,!0))}}),Zyr(k,{enabled:P&&!_,closeDelay:L});const R=o===void 0?Myr(u.context.popupRef):o,D=A!==!1&&p;u.useSyncedValue("focusManagerModal",D);const M=u.useStateSetter("popupElement"),I={open:g,side:h.side,align:h.align,instant:v,transitionStatus:y},N=eg("div",e,{state:I,ref:[r,u.context.popupRef,M],props:[b,{id:E,role:"dialog",...Lyr,"aria-labelledby":x,"aria-describedby":w,onKeyDown(F){d&&obr.has(F.key)&&F.stopPropagation()}},eet(y),l],stateAttributesMapping:T1r});return H.jsx(Ovr,{context:k,openInteractionType:m,modal:D,disabled:!S||T===Ld,initialFocus:R,returnFocus:s,restoreFocus:"popup",previousFocusableElement:Eo(C)?C:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:H.jsx(cbr.Provider,{value:f,children:N})})}),dbr=j.forwardRef(function(e,r){const{render:n,className:i,style:a,...o}=e,s=kA(),l=$E(o.id);return s.useSyncedValueWithCleanup("titleElementId",l),eg("h2",e,{ref:r,props:[{id:l},o]})}),fbr=j.forwardRef(function(e,r){const{render:n,className:i,style:a,...o}=e,s=kA(),l=$E(o.id);return s.useSyncedValueWithCleanup("descriptionElementId",l),eg("p",e,{ref:r,props:[{id:l},o]})});function aet(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),H.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 pbr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),H.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),H.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),H.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 gbr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.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"}),H.jsxs("g",{className:"video-generate-icon__clapper",children:[H.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"}),H.jsx("path",{d:"M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"})]}),H.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function mbr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),H.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),H.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function vbr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.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"}),H.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"}),H.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function ybr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),H.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),H.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),H.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function bbr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.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"}),H.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"}),H.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 xbr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),H.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),H.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"}),H.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function wbr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.jsx("circle",{cx:"6",cy:"6.25",r:"2.25"}),H.jsx("circle",{cx:"18",cy:"6.25",r:"2.25"}),H.jsx("circle",{cx:"12",cy:"17.75",r:"2.25"}),H.jsx("path",{d:"m7.7 7.75 2.7 7.55M16.3 7.75l-2.7 7.55M8.25 6.25h7.5"})]})}function oet(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.jsx("circle",{cx:"9",cy:"8",r:"3"}),H.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"}),H.jsx("path",{d:"M17.75 4.25v5.5M15 7h5.5M16 13.25h4.25M18.125 11.125v4.25"})]})}function Abr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.jsx("rect",{x:"4",y:"4.25",width:"16",height:"5",rx:"1.5"}),H.jsx("rect",{x:"4",y:"14.75",width:"16",height:"5",rx:"1.5"}),H.jsx("path",{d:"M7.25 6.75h.01M7.25 17.25h.01M10 6.75h6.5M10 17.25h6.5"})]})}function Sbr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.jsx("path",{d:"M6 3.75h8l4 4v12.5H6V3.75Z"}),H.jsx("path",{d:"M14 3.75v4h4M8.75 11h6.5M8.75 14.25h6.5M8.75 17.5h4"})]})}function set(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.jsx("rect",{x:"3.75",y:"4.5",width:"16.5",height:"15",rx:"2.5"}),H.jsx("path",{d:"m7.5 9 2.75 2.5L7.5 14M12.5 14h4"}),H.jsx("path",{d:"M3.75 7.5h16.5",opacity:".62"})]})}function FE(t){return H.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:H.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function cet(t){if(t==null||!Number.isFinite(t)||t<0)return Rh("developmentRuns.notReported");const e=Math.round(t);if(e===0)return`<${Rh("developmentRuns.durationUnits.milliseconds",{value:"1"})}`;if(e<1e3)return Rh("developmentRuns.durationUnits.milliseconds",{value:e.toLocaleString(tje())});const r=Math.round(e/100);return[["hours",Math.floor(r/36e3)],["minutes",Math.floor(r%36e3/600)],["seconds",r%600/10]].filter(([,i])=>i>0).map(([i,a])=>Rh(`developmentRuns.durationUnits.${i}`,{value:a.toLocaleString(tje(),{maximumFractionDigits:1})})).join(" ")}const iue=t=>t&&typeof t=="object"&&!Array.isArray(t)?t:{},uet=t=>typeof t=="string"?t.replace(/\s+/g," ").trim().slice(0,160):"";function het(t){var r;const e=iue(t.args);if(t.itemType==="dynamicToolCall"&&t.name==="submit_build_result")return Rh("developmentRuns.submitResult");if(t.itemType==="commandExecution"){const n=Array.isArray(e.commandActions)?e.commandActions.map(iue):[],i=new Set(n.map(l=>l.type));if(n.length&&i.size===1){if(i.has("read"))return Rh("developmentRuns.read",{target:"Read project files"});if(i.has("listFiles"))return Rh("developmentRuns.listFiles",{target:"List directory"});if(i.has("search"))return Rh("developmentRuns.search",{target:"Search project files"})}const a=typeof e.command=="string"?e.command:"",s=((r=[[/\b(?:pytest|vitest|jest)\b|\b(?:npm|pnpm|yarn) (?:run )?test\b/,"Run tests"],[/\b(?:npm|pnpm|yarn) (?:ci|install|add)\b|\b(?:pip|pip3|uv pip) install\b|\buv sync\b/,"Install dependencies"],[/\b(?:ruff|eslint|prettier|pyright|tsc)\b/,"Check code quality"],[/\b(?:npm|pnpm|yarn) (?:run )?build\b|\bpython[^;]* -m build\b/,"Build project"],[/\bgit (?:status|diff|log|show)\b/,"Inspect Git changes"],[/\bgit (?:add|commit)\b/,"Save Git changes"],[/\b(?:curl|wget)\b/,"Send HTTP request"],[/\bcompileall\b/,"Check Python syntax"]].find(([l])=>l.test(a)))==null?void 0:r[1])||"Run shell command";return Rh("developmentRuns.command",{target:s})}if(t.itemType==="fileChange"){const n=Array.isArray(e.changes)?e.changes.map(i=>uet(iue(i).path)).filter(Boolean):[];return Rh("developmentRuns.editFiles",{target:n.join(", ")})}return t.itemType==="webSearch"?Rh("developmentRuns.webSearch",{target:uet(e.query)}):t.name}const Tbr=t=>["tool","thinking","plan","diff"].includes(t.kind);function Cbr(t){const e=[];return t.forEach((r,n)=>{if(r.kind==="progress")return;const i=Tbr(r),a=e[e.length-1];i&&(a!=null&&a.process)?a.blocks.push(r):e.push({id:r.id||`${r.kind}:${n}`,process:i,blocks:[r]})}),e}function Obr({value:t}){const{t:e,i18n:r}=ca("adk"),[n,i]=j.useState(!1),a=d=>d==null?e("developmentRuns.notReported"):d.toLocaleString(r.resolvedLanguage||r.language),o=cet,s=t.usage,l=(s==null?void 0:s.inputTokens)!=null&&s.cachedInputTokens!=null&&s.cachedInputTokens<=s.inputTokens?s.inputTokens-s.cachedInputTokens:void 0,u=s!=null&&s.inputTokens&&s.cachedInputTokens!=null&&l!=null?`${(s.cachedInputTokens/s.inputTokens*100).toFixed(1)}%`:void 0,h=[["inputTokens",s==null?void 0:s.inputTokens],["cachedInputTokens",s==null?void 0:s.cachedInputTokens],["uncachedInputTokens",l],["cacheWriteInputTokens",s==null?void 0:s.cacheWriteInputTokens],["outputTokens",s==null?void 0:s.outputTokens],["reasoningOutputTokens",s==null?void 0:s.reasoningOutputTokens]];return H.jsxs("div",{className:"development-turn-summary","data-turn-id":t.turnId,children:[H.jsx("span",{children:e(`developmentRuns.turnStatus.${t.status}`)}),H.jsx("span",{children:e("developmentRuns.toolCalls",{count:t.toolCalls})}),H.jsx("span",{children:e("developmentRuns.turnDuration",{duration:o(t.durationMs)})}),H.jsx("span",{title:e("developmentRuns.toolDurationHelp"),children:e(t.toolDurationComplete?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:o(t.toolDurationMs)})}),H.jsxs(l1r,{open:n,onOpenChange:i,children:[H.jsxs(_1r,{className:"development-token-trigger",openOnHover:!0,delay:150,closeDelay:150,onFocus:d=>{d.currentTarget.matches(":focus-visible")&&i(!0)},children:[H.jsx("span",{children:"Tokens"}),H.jsx("span",{className:"development-token-value",children:a(s==null?void 0:s.totalTokens)}),t.usageIncomplete&&H.jsxs("span",{children:["· ",e("developmentRuns.partial")]}),H.jsx(FE,{className:"development-token-chevron"})]}),H.jsx(D1r,{children:H.jsx(J1r,{side:"top",align:"end",sideOffset:8,className:"development-token-positioner",children:H.jsxs(hbr,{className:"development-token-popup",initialFocus:!1,finalFocus:!1,children:[H.jsx(dbr,{className:"development-token-title",children:e("developmentRuns.tokenDetails")}),H.jsxs("dl",{children:[H.jsxs("div",{children:[H.jsx("dt",{children:e("developmentRuns.model")}),H.jsx("dd",{children:t.model||e("developmentRuns.notReported")})]}),H.jsxs("div",{children:[H.jsx("dt",{children:e("developmentRuns.totalTokens")}),H.jsx("dd",{children:a(s==null?void 0:s.totalTokens)})]}),h.map(([d,f])=>H.jsxs("div",{children:[H.jsx("dt",{children:e(`developmentRuns.${d}`)}),H.jsx("dd",{children:a(f)})]},d)),H.jsxs("div",{children:[H.jsx("dt",{children:e("developmentRuns.cacheHitRate")}),H.jsx("dd",{children:u||e("developmentRuns.notReported")})]})]}),H.jsxs(fbr,{className:"development-token-note",children:[e("developmentRuns.tokenHelp"),t.usageIncomplete?` ${e("developmentRuns.partialHelp")}`:""]})]})})})]})]})}function aue(t){return H.jsx("svg",{viewBox:"0 0 111 117",fill:"none","aria-hidden":"true",...t,children:H.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 tG({kind:t,...e}){return t==="thinking"?H.jsx(aue,{...e}):H.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:t==="tool"?H.jsxs(H.Fragment,{children:[H.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"3"}),H.jsx("path",{d:"m7 9 3 3-3 3m6 0h4"})]}):t==="plan"?H.jsxs(H.Fragment,{children:[H.jsx("path",{d:"m4 7 1.5 1.5L8 6m-4 7 1.5 1.5L8 12M11 7h9m-9 6h9m-9 6h9"}),H.jsx("circle",{cx:"6",cy:"19",r:"1"})]}):H.jsx(H.Fragment,{children:H.jsx("path",{d:"M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9zM14 3v6h6M8 13h8m-4-3v6M8 18h8"})})})}function ym({as:t="span",className:e="",duration:r=4,spread:n=20,children:i,style:a,...o}){const s=Math.min(Math.max(n,5),45);return H.jsx(t,{className:`text-shimmer${e?` ${e}`:""}`,style:{...a,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-s}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+s}%)`,animationDuration:`${r}s`},...o,children:i})}function kbr({blocks:t,active:e,status:r,render:n}){const{t:i}=ca("adk"),[a,o]=j.useState(!1),s=[...t].reverse().find(f=>"done"in f&&!f.done),l=t.filter(f=>f.kind==="tool"),u=l.filter(f=>f.durationMs!=null),h=u.reduce((f,p)=>f+(p.durationMs||0),0);let d=i("developmentRuns.processSummary",{count:t.length});return e&&(d=r||((s==null?void 0:s.kind)==="thinking"?i("developmentRuns.thinking"):(s==null?void 0:s.kind)==="tool"?het(s):(s==null?void 0:s.kind)==="plan"?i("developmentRuns.plan"):(s==null?void 0:s.kind)==="diff"?i("developmentRuns.diff"):i("developmentRuns.processing"))),H.jsxs("section",{className:"development-process",children:[H.jsxs("button",{type:"button",className:"development-process__toggle","aria-expanded":a,onClick:()=>o(!a),children:[H.jsx(FE,{className:`tool-chevron${a?" is-open":""}`}),H.jsx("span",{className:"tool-icon",children:H.jsx(tG,{kind:(s==null?void 0:s.kind)==="thinking"||(s==null?void 0:s.kind)==="plan"||(s==null?void 0:s.kind)==="diff"?s.kind:"tool"})}),e?H.jsx(ym,{className:"development-process__title","aria-live":"polite",children:d}):H.jsx("span",{className:"development-process__title",children:d}),!e&&l.length>0&&H.jsxs("span",{className:"development-process__duration",children:[i("developmentRuns.toolCalls",{count:l.length}),u.length>0?` · ${i(u.length===l.length?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:cet(h)})}`:""]})]}),H.jsx("div",{className:"development-process__items",hidden:!a,children:n(t)})]})}function Ebr({blocks:t,active:e,status:r="",render:n}){const{t:i}=ca("adk"),a=Cbr(t),o=a[a.length-1],s=[...t].reverse().find(u=>u.kind==="progress"),l=r||((s==null?void 0:s.kind)==="progress"?s.text:"");return H.jsxs(H.Fragment,{children:[a.map(u=>u.process?H.jsx(kbr,{blocks:u.blocks,active:e&&u===o,status:l,render:n},u.id):H.jsx("div",{"data-assistant-phase":u.blocks[0].phase,children:n(u.blocks)},u.id)),e&&!(o!=null&&o.process)&&H.jsxs("div",{className:"development-process__status",role:"status",children:[H.jsx("span",{className:"tool-icon",children:H.jsx(tG,{kind:"thinking"})}),H.jsx(ym,{children:l||i("developmentRuns.processing")})]})]})}const _br={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 Rbr(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 Dbr(t){return typeof t=="object"&&t!==null&&typeof t.path=="string"}function Lbr(t){return typeof t=="object"&&t!==null&&typeof t.call=="string"}function oue(t,e){if(Dbr(t))return Rbr(e,t.path);if(Lbr(t)){const r=_br[t.call],n={};for(const[i,a]of Object.entries(t.args??{}))n[i]=oue(a,e);return r?r(n):`[unknown fn: ${t.call}]`}return t}function Mbr(t,e){const r=oue(t,e);return r==null?"":typeof r=="string"?r:String(r)}const Ibr=new Map;function Pbr(t){return Ibr.get(t)}function Nbr(t,e,r){const n=e.replace(/^\//,"").split("/").map(a=>a.replace(/~1/g,"/").replace(/~0/g,"~"));let i=t;for(let a=0;aoue(n,t.dataModel),resolveString:n=>Mbr(n,t.dataModel),dispatchAction:e,render:n=>{if(!n)return null;const i=t.components[n];if(!i)return null;const a=Pbr(i.component)??$br;return H.jsx(a,{node:i,ctx:r},n)}};return H.jsx("div",{className:"a2ui-surface","data-a2ui-surface":t.surfaceId,children:r.render(t.rootId)})}function zbr(t){const e=j.useRef(null),r=j.useRef(!0),n=28,i=j.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 Wfi(){}function Yfi(){}function det(t){const e=[],r=String(t||"");let n=r.indexOf(","),i=0,a=!1;for(;!a;){n===-1&&(n=r.length,a=!0);const o=r.slice(i,n).trim();(o||!a)&&e.push(o),i=n+1,n=r.indexOf(",",i)}return e}function fet(t,e){const r={};return(t[t.length-1]===""?[...t,""]:t).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const Ubr=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Vbr=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Qbr={};function pet(t,e){return(Qbr.jsx?Vbr:Ubr).test(t)}const Gbr=/[ \t\n\f\r]/g;function Hbr(t){return typeof t=="object"?t.type==="text"?get(t.value):!1:get(t)}function get(t){return t.replace(Gbr,"")===""}let eN=class{constructor(e,r,n){this.normal=r,this.property=e,n&&(this.space=n)}};eN.prototype.normal={},eN.prototype.property={},eN.prototype.space=void 0;function met(t,e){const r={},n={};for(const i of t)Object.assign(r,i.property),Object.assign(n,i.normal);return new eN(r,n,e)}function tN(t){return t.toLowerCase()}let Mh=class{constructor(e,r){this.attribute=r,this.property=e}};Mh.prototype.attribute="",Mh.prototype.booleanish=!1,Mh.prototype.boolean=!1,Mh.prototype.commaOrSpaceSeparated=!1,Mh.prototype.commaSeparated=!1,Mh.prototype.defined=!1,Mh.prototype.mustUseProperty=!1,Mh.prototype.number=!1,Mh.prototype.overloadedBoolean=!1,Mh.prototype.property="",Mh.prototype.spaceSeparated=!1,Mh.prototype.space=void 0;let Wbr=0;const Wn=EA(),Rs=EA(),sue=EA(),rr=EA(),Pa=EA(),zE=EA(),Md=EA();function EA(){return 2**++Wbr}const lue=Object.freeze(Object.defineProperty({__proto__:null,boolean:Wn,booleanish:Rs,commaOrSpaceSeparated:Md,commaSeparated:zE,number:rr,overloadedBoolean:sue,spaceSeparated:Pa},Symbol.toStringTag,{value:"Module"})),cue=Object.keys(lue);class uue extends Mh{constructor(e,r,n,i){let a=-1;if(super(e,r),vet(this,"space",i),typeof n=="number")for(;++a4&&r.slice(0,4)==="data"&&Kbr.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(Cet,Jbr);n="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!Cet.test(a)){let o=a.replace(Xbr,Zbr);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}i=uue}return new i(n,e)}function Zbr(t){return"-"+t.toLowerCase()}function Jbr(t){return t.charAt(1).toUpperCase()}const rN=met([yet,Ybr,wet,Aet,Tet],"html"),dx=met([yet,qbr,wet,Aet,Tet],"svg");function Oet(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function ket(t){return t.join(" ").trim()}var hue={},Eet=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,exr=/\n/g,txr=/^\s*/,rxr=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,nxr=/^:\s*/,ixr=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,axr=/^[;\s]*/,oxr=/^\s+|\s+$/g,sxr=` -`,_et="/",Ret="*",_A="",lxr="comment",cxr="declaration";function uxr(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(exr);m&&(r+=m.length);var v=g.lastIndexOf(sxr);n=~v?g.length-v:n+g.length}function a(){var g={line:r,column:n};return function(m){return m.position=new o(g),u(),m}}function o(g){this.start=g,this.end={line:r,column:n},this.source=e.source}o.prototype.content=t;function s(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(txr)}function h(g){var m;for(g=g||[];m=d();)m!==!1&&g.push(m);return g}function d(){var g=a();if(!(_et!=t.charAt(0)||Ret!=t.charAt(1))){for(var m=2;_A!=t.charAt(m)&&(Ret!=t.charAt(m)||_et!=t.charAt(m+1));)++m;if(m+=2,_A===t.charAt(m-1))return s("End of comment missing");var v=t.slice(2,m-2);return n+=2,i(v),t=t.slice(m),n+=2,g({type:lxr,comment:v})}}function f(){var g=a(),m=l(rxr);if(m){if(d(),!l(nxr))return s("property missing ':'");var v=l(ixr),y=g({type:cxr,property:Det(m[0].replace(Eet,_A)),value:v?Det(v[0].replace(Eet,_A)):_A});return l(axr),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 Det(t){return t?t.replace(oxr,_A):_A}var hxr=uxr,dxr=Ti&&Ti.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hue,"__esModule",{value:!0}),hue.default=pxr;const fxr=dxr(hxr);function pxr(t,e){let r=null;if(!t||typeof t!="string")return r;const n=(0,fxr.default)(t),i=typeof e=="function";return n.forEach(a=>{if(a.type!=="declaration")return;const{property:o,value:s}=a;i?e(o,s,a):s&&(r=r||{},r[o]=s)}),r}var nG={};Object.defineProperty(nG,"__esModule",{value:!0}),nG.camelCase=void 0;var gxr=/^--[a-zA-Z0-9_-]+$/,mxr=/-([a-z])/g,vxr=/^[^-]+$/,yxr=/^-(webkit|moz|ms|o|khtml)-/,bxr=/^-(ms)-/,xxr=function(t){return!t||vxr.test(t)||gxr.test(t)},wxr=function(t,e){return e.toUpperCase()},Let=function(t,e){return"".concat(e,"-")},Axr=function(t,e){return e===void 0&&(e={}),xxr(t)?t:(t=t.toLowerCase(),e.reactCompat?t=t.replace(bxr,Let):t=t.replace(yxr,Let),t.replace(mxr,wxr))};nG.camelCase=Axr;var Sxr=Ti&&Ti.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Txr=Sxr(hue),Cxr=nG;function due(t,e){var r={};return!t||typeof t!="string"||(0,Txr.default)(t,function(n,i){n&&i&&(r[(0,Cxr.camelCase)(n,e)]=i)}),r}due.default=due;var Oxr=due;const kxr=wh(Oxr),iG=Met("end"),bm=Met("start");function Met(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 Exr(t){const e=bm(t),r=iG(t);if(e&&r)return{start:e,end:r}}function nN(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Iet(t.position):"start"in t||"end"in t?Iet(t):"line"in t||"column"in t?fue(t):""}function fue(t){return Pet(t&&t.line)+":"+Pet(t&&t.column)}function Iet(t){return fue(t&&t.start)+"-"+fue(t&&t.end)}function Pet(t){return t&&typeof t=="number"?t:1}class Uc extends Error{constructor(e,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let i="",a={},o=!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&&(o=!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 s=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=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=nN(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=o&&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}}Uc.prototype.file="",Uc.prototype.name="",Uc.prototype.reason="",Uc.prototype.message="",Uc.prototype.stack="",Uc.prototype.column=void 0,Uc.prototype.line=void 0,Uc.prototype.ancestors=void 0,Uc.prototype.cause=void 0,Uc.prototype.fatal=void 0,Uc.prototype.place=void 0,Uc.prototype.ruleId=void 0,Uc.prototype.source=void 0;const pue={}.hasOwnProperty,_xr=new Map,Rxr=/[A-Z]/g,Dxr=new Set(["table","tbody","thead","tfoot","tr"]),Lxr=new Set(["td","th"]),Net="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Mxr(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=Uxr(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=zxr(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"?dx:rN,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},a=Bet(i,t,void 0);return a&&typeof a!="string"?a:i.create(t,i.Fragment,{children:a||void 0},void 0)}function Bet(t,e,r){if(e.type==="element")return Ixr(t,e,r);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return Pxr(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Bxr(t,e,r);if(e.type==="mdxjsEsm")return Nxr(t,e);if(e.type==="root")return $xr(t,e,r);if(e.type==="text")return Fxr(t,e)}function Ixr(t,e,r){const n=t.schema;let i=n;e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(i=dx,t.schema=i),t.ancestors.push(e);const a=Fet(t,e.tagName,!1),o=Vxr(t,e);let s=mue(t,e);return Dxr.has(e.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!Hbr(l):!0})),$et(t,o,a,e),gue(o,s),t.ancestors.pop(),t.schema=n,t.create(e,a,o,r)}function Pxr(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)}iN(t,e.position)}function Nxr(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);iN(t,e.position)}function Bxr(t,e,r){const n=t.schema;let i=n;e.name==="svg"&&n.space==="html"&&(i=dx,t.schema=i),t.ancestors.push(e);const a=e.name===null?t.Fragment:Fet(t,e.name,!0),o=Qxr(t,e),s=mue(t,e);return $et(t,o,a,e),gue(o,s),t.ancestors.pop(),t.schema=n,t.create(e,a,o,r)}function $xr(t,e,r){const n={};return gue(n,mue(t,e)),t.create(e,t.Fragment,n,r)}function Fxr(t,e){return e.value}function $et(t,e,r,n){typeof r!="string"&&r!==t.Fragment&&t.passNode&&(e.node=n)}function gue(t,e){if(e.length>0){const r=e.length>1?e:e[0];r&&(t.children=r)}}function zxr(t,e,r){return n;function n(i,a,o,s){const u=Array.isArray(o.children)?r:e;return s?u(a,o,s):u(a,o)}}function Uxr(t,e){return r;function r(n,i,a,o){const s=Array.isArray(a.children),l=bm(n);return e(i,a,o,s,{columnNumber:l?l.column-1:void 0,fileName:t,lineNumber:l?l.line:void 0},void 0)}}function Vxr(t,e){const r={};let n,i;for(i in e.properties)if(i!=="children"&&pue.call(e.properties,i)){const a=Gxr(t,i,e.properties[i]);if(a){const[o,s]=a;t.tableCellAlignToStyle&&o==="align"&&typeof s=="string"&&Lxr.has(e.tagName)?n=s:r[o]=s}}if(n){const a=r.style||(r.style={});a[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function Qxr(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 o=a.expression;o.type;const s=o.properties[0];s.type,Object.assign(r,t.evaluater.evaluateExpression(s.argument))}else iN(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 s=n.value.data.estree.body[0];s.type,a=t.evaluater.evaluateExpression(s.expression)}else iN(t,e.position);else a=n.value===null?!0:n.value;r[i]=a}return r}function mue(t,e){const r=[];let n=-1;const i=t.passKeys?new Map:_xr;for(;++ni?0:i+e:e=e>i?i:e,r=r>0?r:0,n.length<1e4)o=Array.from(n),o.unshift(e,r),t.splice(...o);else for(r&&t.splice(e,r);a0?(Id(t,t.length,0,e),t):e}const Qet={}.hasOwnProperty;function Get(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 tg(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Cu=fx(/[A-Za-z]/),Vc=fx(/[\dA-Za-z]/),Jxr=fx(/[#-'*+\--9=?A-Z^-~]/);function aG(t){return t!==null&&(t<32||t===127)}const xue=fx(/\d/),e2r=fx(/[\dA-Fa-f]/),t2r=fx(/[!-/:-@[-`{-~]/);function en(t){return t!==null&&t<-2}function Oa(t){return t!==null&&(t<0||t===32)}function gi(t){return t===-2||t===-1||t===32}const oG=fx(new RegExp("\\p{P}|\\p{S}","u")),RA=fx(/\s/);function fx(t){return e;function e(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function VE(t){const e=[];let r=-1,n=0,i=0;for(;++r55295&&a<57344){const s=t.charCodeAt(r+1);a<56320&&s>56319&&s<57344?(o=String.fromCharCode(a,s),i=1):o="�"}else o=String.fromCharCode(a);o&&(e.push(t.slice(n,r),encodeURIComponent(o)),n=r+i+1,o=""),i&&(r+=i,i=0)}return e.join("")+t.slice(n)}function Di(t,e,r,n){const i=n?n-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(l){return gi(l)?(t.enter(r),s(l)):e(l)}function s(l){return gi(l)&&a++o))return;const T=e.events.length;let C=T,k,E;for(;C--;)if(e.events[C][0]==="exit"&&e.events[C][1].type==="chunkFlow"){if(k){E=e.events[C][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 o2r(t,e,r){return Di(t,t.attempt(this.parser.constructs.document,e,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function QE(t){if(t===null||Oa(t)||RA(t))return 1;if(oG(t))return 2}function sG(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};Yet(d,-l),Yet(f,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...t[n][1].end}},s={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:{...o.start},end:{...s.end}},t[n][1].end={...o.start},t[r][1].start={...s.end},u=[],t[n][1].end.offset-t[n][1].start.offset&&(u=Qf(u,[["enter",t[n][1],e],["exit",t[n][1],e]])),u=Qf(u,[["enter",i,e],["enter",o,e],["exit",o,e],["enter",a,e]]),u=Qf(u,sG(e.parser.constructs.insideSpan.null,t.slice(n+1,r),e)),u=Qf(u,[["exit",a,e],["enter",s,e],["exit",s,e],["exit",i,e]]),t[r][1].end.offset-t[r][1].start.offset?(h=2,u=Qf(u,[["enter",t[r][1],e],["exit",t[r][1],e]])):h=0,Id(t,n-1,r-n+3,u),r=n+u.length-h-2;break}}for(r=-1;++r0&&gi(S)?Di(t,b,"linePrefix",a+1)(S):b(S)}function b(S){return S===null||en(S)?t.check(Ket,m,w)(S):(t.enter("codeFlowValue"),x(S))}function x(S){return S===null||en(S)?(t.exit("codeFlowValue"),b(S)):(t.consume(S),x)}function w(S){return t.exit("codeFenced"),e(S)}function A(S,T,C){let k=0;return E;function E(D){return S.enter("lineEnding"),S.consume(D),S.exit("lineEnding"),_}function _(D){return S.enter("codeFencedFence"),gi(D)?Di(S,P,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):P(D)}function P(D){return D===s?(S.enter("codeFencedFenceSequence"),L(D)):C(D)}function L(D){return D===s?(k++,S.consume(D),L):k>=o?(S.exit("codeFencedFenceSequence"),gi(D)?Di(S,R,"whitespace")(D):R(D)):C(D)}function R(D){return D===null||en(D)?(S.exit("codeFencedFence"),T(D)):C(D)}}}function y2r(t,e,r){const n=this;return i;function i(o){return o===null?r(o):(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),a)}function a(o){return n.parser.lazy[n.now().line]?r(o):e(o)}}const Aue={name:"codeIndented",tokenize:x2r},b2r={partial:!0,tokenize:w2r};function x2r(t,e,r){const n=this;return i;function i(u){return t.enter("codeIndented"),Di(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?o(u):r(u)}function o(u){return u===null?l(u):en(u)?t.attempt(b2r,o,l)(u):(t.enter("codeFlowValue"),s(u))}function s(u){return u===null||en(u)?(t.exit("codeFlowValue"),o(u)):(t.consume(u),s)}function l(u){return t.exit("codeIndented"),e(u)}}function w2r(t,e,r){const n=this;return i;function i(o){return n.parser.lazy[n.now().line]?r(o):en(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),i):Di(t,a,"linePrefix",5)(o)}function a(o){const s=n.events[n.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(o):en(o)?i(o):r(o)}}const A2r={name:"codeText",previous:T2r,resolve:S2r,tokenize:C2r};function S2r(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&&oN(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),oN(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),oN(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(o):t.interrupt(n.parser.constructs.flow,r,e)(o)}}function ett(t,e,r,n,i,a,o,s,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||aG(y)?r(y):(t.enter(n),t.enter(o),t.enter(s),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(s),t.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(t.exit("chunkString"),t.exit(s),f(y)):y===null||y===60||en(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||Oa(y))?(t.exit("chunkString"),t.exit(s),t.exit(o),t.exit(n),e(y)):h999||p===null||p===91||p===93&&!l||p===94&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?r(p):p===93?(t.exit(a),t.enter(i),t.consume(p),t.exit(i),t.exit(n),e):en(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||en(p)||s++>999?(t.exit("chunkString"),h(p)):(t.consume(p),l||(l=!gi(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(t.consume(p),s++,d):d(p)}}function rtt(t,e,r,n,i,a){let o;return s;function s(f){return f===34||f===39||f===40?(t.enter(n),t.enter(i),t.consume(f),t.exit(i),o=f===40?41:f,l):r(f)}function l(f){return f===o?(t.enter(i),t.consume(f),t.exit(i),t.exit(n),e):(t.enter(a),u(f))}function u(f){return f===o?(t.exit(a),l(o)):f===null?r(f):en(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),Di(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===o||f===null||en(f)?(t.exit("chunkString"),u(f)):(t.consume(f),f===92?d:h)}function d(f){return f===o||f===92?(t.consume(f),h):h(f)}}function sN(t,e){let r;return n;function n(i){return en(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),r=!0,n):gi(i)?Di(t,n,r?"linePrefix":"lineSuffix")(i):e(i)}}const M2r={name:"definition",tokenize:P2r},I2r={partial:!0,tokenize:N2r};function P2r(t,e,r){const n=this;let i;return a;function a(p){return t.enter("definition"),o(p)}function o(p){return ttt.call(n,t,s,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function s(p){return i=tg(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 Oa(p)?sN(t,u)(p):u(p)}function u(p){return ett(t,h,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function h(p){return t.attempt(I2r,d,d)(p)}function d(p){return gi(p)?Di(t,f,"whitespace")(p):f(p)}function f(p){return p===null||en(p)?(t.exit("definition"),n.parser.defined.push(i),e(p)):r(p)}}function N2r(t,e,r){return n;function n(s){return Oa(s)?sN(t,i)(s):r(s)}function i(s){return rtt(t,a,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return gi(s)?Di(t,o,"whitespace")(s):o(s)}function o(s){return s===null||en(s)?e(s):r(s)}}const B2r={name:"hardBreakEscape",tokenize:$2r};function $2r(t,e,r){return n;function n(a){return t.enter("hardBreakEscape"),t.consume(a),i}function i(a){return en(a)?(t.exit("hardBreakEscape"),e(a)):r(a)}}const F2r={name:"headingAtx",resolve:z2r,tokenize:U2r};function z2r(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"},Id(t,n,r-n+1,[["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e]])),t}function U2r(t,e,r){let n=0;return i;function i(h){return t.enter("atxHeading"),a(h)}function a(h){return t.enter("atxHeadingSequence"),o(h)}function o(h){return h===35&&n++<6?(t.consume(h),o):h===null||Oa(h)?(t.exit("atxHeadingSequence"),s(h)):r(h)}function s(h){return h===35?(t.enter("atxHeadingSequence"),l(h)):h===null||en(h)?(t.exit("atxHeading"),e(h)):gi(h)?Di(t,s,"whitespace")(h):(t.enter("atxHeadingText"),u(h))}function l(h){return h===35?(t.consume(h),l):(t.exit("atxHeadingSequence"),s(h))}function u(h){return h===null||h===35||Oa(h)?(t.exit("atxHeadingText"),s(h)):(t.consume(h),u)}}const V2r=["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"],ntt=["pre","script","style","textarea"],Q2r={concrete:!0,name:"htmlFlow",resolveTo:W2r,tokenize:Y2r},G2r={partial:!0,tokenize:j2r},H2r={partial:!0,tokenize:q2r};function W2r(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 Y2r(t,e,r){const n=this;let i,a,o,s,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):Cu(U)?(t.consume(U),o=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,s=0,g):Cu(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(s++)?(t.consume(U),s===Q.length?n.interrupt?e:P:g):r(U)}function m(U){return Cu(U)?(t.consume(U),o=String.fromCharCode(U),v):r(U)}function v(U){if(U===null||U===47||U===62||Oa(U)){const Q=U===47,G=o.toLowerCase();return!Q&&!a&&ntt.includes(G)?(i=1,n.interrupt?e(U):P(U)):V2r.includes(o.toLowerCase())?(i=6,Q?(t.consume(U),y):n.interrupt?e(U):P(U)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(U):a?b(U):x(U))}return U===45||Vc(U)?(t.consume(U),o+=String.fromCharCode(U),v):r(U)}function y(U){return U===62?(t.consume(U),n.interrupt?e:P):r(U)}function b(U){return gi(U)?(t.consume(U),b):E(U)}function x(U){return U===47?(t.consume(U),E):U===58||U===95||Cu(U)?(t.consume(U),w):gi(U)?(t.consume(U),x):E(U)}function w(U){return U===45||U===46||U===58||U===95||Vc(U)?(t.consume(U),w):A(U)}function A(U){return U===61?(t.consume(U),S):gi(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):gi(U)?(t.consume(U),S):C(U)}function T(U){return U===l?(t.consume(U),l=null,k):U===null||en(U)?r(U):(t.consume(U),T)}function C(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||Oa(U)?A(U):(t.consume(U),C)}function k(U){return U===47||U===62||gi(U)?x(U):r(U)}function E(U){return U===62?(t.consume(U),_):r(U)}function _(U){return U===null||en(U)?P(U):gi(U)?(t.consume(U),_):r(U)}function P(U){return U===45&&i===2?(t.consume(U),M):U===60&&i===1?(t.consume(U),I):U===62&&i===4?(t.consume(U),V):U===63&&i===3?(t.consume(U),B):U===93&&i===5?(t.consume(U),F):en(U)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(G2r,z,L)(U)):U===null||en(U)?(t.exit("htmlFlowData"),L(U)):(t.consume(U),P)}function L(U){return t.check(H2r,R,z)(U)}function R(U){return t.enter("lineEnding"),t.consume(U),t.exit("lineEnding"),D}function D(U){return U===null||en(U)?L(U):(t.enter("htmlFlowData"),P(U))}function M(U){return U===45?(t.consume(U),B):P(U)}function I(U){return U===47?(t.consume(U),o="",N):P(U)}function N(U){if(U===62){const Q=o.toLowerCase();return ntt.includes(Q)?(t.consume(U),V):P(U)}return Cu(U)&&o.length<8?(t.consume(U),o+=String.fromCharCode(U),N):P(U)}function F(U){return U===93?(t.consume(U),B):P(U)}function B(U){return U===62?(t.consume(U),V):U===45&&i===2?(t.consume(U),B):P(U)}function V(U){return U===null||en(U)?(t.exit("htmlFlowData"),z(U)):(t.consume(U),V)}function z(U){return t.exit("htmlFlow"),e(U)}}function q2r(t,e,r){const n=this;return i;function i(o){return en(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),a):r(o)}function a(o){return n.parser.lazy[n.now().line]?r(o):e(o)}}function j2r(t,e,r){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(aN,e,r)}}const X2r={name:"htmlText",tokenize:K2r};function K2r(t,e,r){const n=this;let i,a,o;return s;function s(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):Cu(B)?(t.consume(B),C):r(B)}function u(B){return B===45?(t.consume(B),h):B===91?(t.consume(B),a=0,g):Cu(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):en(B)?(o=d,I(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):en(B)?(o=m,I(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):en(B)?(o=b,I(B)):(t.consume(B),b)}function x(B){return B===null?r(B):B===63?(t.consume(B),w):en(B)?(o=x,I(B)):(t.consume(B),x)}function w(B){return B===62?M(B):x(B)}function A(B){return Cu(B)?(t.consume(B),S):r(B)}function S(B){return B===45||Vc(B)?(t.consume(B),S):T(B)}function T(B){return en(B)?(o=T,I(B)):gi(B)?(t.consume(B),T):M(B)}function C(B){return B===45||Vc(B)?(t.consume(B),C):B===47||B===62||Oa(B)?k(B):r(B)}function k(B){return B===47?(t.consume(B),M):B===58||B===95||Cu(B)?(t.consume(B),E):en(B)?(o=k,I(B)):gi(B)?(t.consume(B),k):M(B)}function E(B){return B===45||B===46||B===58||B===95||Vc(B)?(t.consume(B),E):_(B)}function _(B){return B===61?(t.consume(B),P):en(B)?(o=_,I(B)):gi(B)?(t.consume(B),_):k(B)}function P(B){return B===null||B===60||B===61||B===62||B===96?r(B):B===34||B===39?(t.consume(B),i=B,L):en(B)?(o=P,I(B)):gi(B)?(t.consume(B),P):(t.consume(B),R)}function L(B){return B===i?(t.consume(B),i=void 0,D):B===null?r(B):en(B)?(o=L,I(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||Oa(B)?k(B):(t.consume(B),R)}function D(B){return B===47||B===62||Oa(B)?k(B):r(B)}function M(B){return B===62?(t.consume(B),t.exit("htmlTextData"),t.exit("htmlText"),e):r(B)}function I(B){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(B),t.exit("lineEnding"),N}function N(B){return gi(B)?Di(t,F,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):F(B)}function F(B){return t.enter("htmlTextData"),o(B)}}const Sue={name:"labelEnd",resolveAll:twr,resolveTo:rwr,tokenize:nwr},Z2r={tokenize:iwr},J2r={tokenize:awr},ewr={tokenize:owr};function twr(t){let e=-1;const r=[];for(;++e=3&&(u===null||en(u))?(t.exit("thematicBreak"),e(u)):r(u)}function l(u){return u===i?(t.consume(u),n++,l):(t.exit("thematicBreakSequence"),gi(u)?Di(t,s,"whitespace")(u):s(u))}}const Ih={continuation:{tokenize:mwr},exit:ywr,name:"list",tokenize:gwr},fwr={partial:!0,tokenize:bwr},pwr={partial:!0,tokenize:vwr};function gwr(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,o=0;return s;function s(p){const g=n.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!n.containerState.marker||p===n.containerState.marker:xue(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(lG,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 xue(p)&&++o<10?(t.consume(p),l):(!n.interrupt||o<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(aN,n.interrupt?r:h,t.attempt(fwr,f,d))}function h(p){return n.containerState.initialBlankLine=!0,a++,f(p)}function d(p){return gi(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 mwr(t,e,r){const n=this;return n.containerState._closeFlow=void 0,t.check(aN,i,a);function i(s){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,Di(t,e,"listItemIndent",n.containerState.size+1)(s)}function a(s){return n.containerState.furtherBlankLines||!gi(s)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,o(s)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,t.attempt(pwr,e,o)(s))}function o(s){return n.containerState._closeFlow=!0,n.interrupt=void 0,Di(t,t.attempt(Ih,e,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function vwr(t,e,r){const n=this;return Di(t,i,"listItemIndent",n.containerState.size+1);function i(a){const o=n.events[n.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===n.containerState.size?e(a):r(a)}}function ywr(t){t.exit(this.containerState.type)}function bwr(t,e,r){const n=this;return Di(t,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=n.events[n.events.length-1];return!gi(a)&&o&&o[1].type==="listItemPrefixWhitespace"?e(a):r(a)}}const itt={name:"setextUnderline",resolveTo:xwr,tokenize:wwr};function xwr(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 o={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",o,e]),t.splice(a+1,0,["exit",t[n][1],e]),t[n][1].end={...t[a][1].end}):t[n][1]=o,t.push(["exit",o,e]),t}function wwr(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,o(u)):r(u)}function o(u){return t.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(t.consume(u),s):(t.exit("setextHeadingLineSequence"),gi(u)?Di(t,l,"lineSuffix")(u):l(u))}function l(u){return u===null||en(u)?(t.exit("setextHeadingLine"),e(u)):r(u)}}const Awr={tokenize:Swr};function Swr(t){const e=this,r=t.attempt(aN,n,t.attempt(this.parser.constructs.flowInitial,i,Di(t,t.attempt(this.parser.constructs.flow,i,t.attempt(E2r,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 Twr={resolveAll:ott()},Cwr=att("string"),Owr=att("text");function att(t){return{resolveAll:ott(t==="text"?kwr:void 0),tokenize:e};function e(r){const n=this,i=this.parser.constructs[t],a=r.attempt(i,o,s);return o;function o(h){return u(h)?a(h):s(h)}function s(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 s=o[0];typeof s=="string"?o[0]=s.slice(n):o.shift()}a>0&&o.push(t[i].slice(0,a))}return o}function Dwr(t,e){let r=-1;const n=[];let i;for(;++re(t.getSnapshot(),r,n,i),[t,e,r,n,i]);return tQ.useSyncExternalStore(t.subscribe,a,a)}function _yr(t,e,r,n,i){return Eyr(t,e,r,n,i)}function Ryr(t,e,r,n,i){return Oyr.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getSnapshot,a=>e(a,r,n,i))}class Dyr{constructor(e){Pr(this,"subscribe",e=>(this.listeners.add(e),()=>{this.listeners.delete(e)}));Pr(this,"getSnapshot",()=>this.state);this.state=e,this.listeners=new Set,this.updateTick=0}setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;const r=this.updateTick;for(const n of this.listeners){if(r!==this.updateTick)return;n(e)}}update(e){for(const r in e)if(!Object.is(this.state[r],e[r])){this.setState({...this.state,...e});return}}set(e,r){Object.is(this.state[e],r)||this.setState({...this.state,[e]:r})}notifyAll(){const e={...this.state};this.setState(e)}use(e,r,n,i){return PJe(this,e,r,n,i)}}class NJe extends Dyr{constructor(e,r={},n){super(e),this.context=r,this.selectors=n}useSyncedValue(e,r){j.useDebugValue(e);const n=this;Bn(()=>{n.state[e]!==r&&n.set(e,r)},[n,e,r])}useSyncedValueWithCleanup(e,r){const n=this;Bn(()=>(n.state[e]!==r&&n.set(e,r),()=>{n.set(e,void 0)}),[n,e,r])}useSyncedValues(e){const r=this,n=Object.values(e);Bn(()=>{r.update(e)},[r,...n])}useControlledProp(e,r){j.useDebugValue(e);const n=this,i=r!==void 0;Bn(()=>{i&&!Object.is(n.state[e],r)&&n.setState({...n.state,[e]:r})},[n,e,r,i])}select(e,r,n,i){const a=this.selectors[e];return a(this.state,r,n,i)}useState(e,r,n,i){return j.useDebugValue(e),PJe(this,this.selectors[e],r,n,i)}useContextCallback(e,r){j.useDebugValue(e);const n=Pn(r??pce);this.context[e]=n}useStateSetter(e){const r=j.useRef(void 0);return r.current===void 0&&(r.current=n=>{this.set(e,n)}),r.current}observe(e,r){let n;typeof e=="function"?n=e:n=this.selectors[e];let i=n(this.state);return r(i,i,this),this.subscribe(a=>{const o=n(a);if(!Object.is(i,o)){const s=i;i=o,r(o,s,this)}})}}const Lyr={open:t=>t.open,transitionStatus:t=>t.transitionStatus,domReferenceElement:t=>t.domReferenceElement,referenceElement:t=>t.positionReference??t.referenceElement,floatingElement:t=>t.floatingElement,floatingId:t=>t.floatingId};class Kce extends NJe{constructor(r){const{syncOnly:n,nested:i,onOpenChange:a,triggerElements:o,...s}=r;super({...s,positionReference:s.referenceElement,domReferenceElement:s.referenceElement},{onOpenChange:a,dataRef:{current:{}},events:oJe(),nested:i,triggerElements:o},Lyr);Pr(this,"syncOpenEvent",(r,n)=>{(!r||!this.state.open||n!=null&&g0r(n))&&(this.context.dataRef.current.openEvent=r?n:void 0)});Pr(this,"dispatchOpenChange",(r,n)=>{this.syncOpenEvent(r,n.event);const i={open:r,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",i)});Pr(this,"setOpen",(r,n)=>{var i,a,o,s;if(this.syncOnly){(a=(i=this.context).onOpenChange)==null||a.call(i,r,n);return}this.dispatchOpenChange(r,n),(s=(o=this.context).onOpenChange)==null||s.call(o,r,n)});this.syncOnly=n}}function Myr(t){const{popupStore:e,treatPopupAsFloatingElement:r=!1,floatingRootContext:n,floatingId:i,nested:a,onOpenChange:o}=t,s=e.useState("open"),l=e.useState("activeTriggerElement"),u=e.useState(r?"popupElement":"positionerElement"),h=e.context.triggerElements,d=o,f=j.useRef(null);n===void 0&&f.current===null&&(f.current=new Kce({open:s,transitionStatus:void 0,referenceElement:l,floatingElement:u,triggerElements:h,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));const p=n??f.current;return e.useSyncedValue("floatingId",i),Bn(()=>{const g={open:s,floatingId:i,referenceElement:l,floatingElement:u};Yi(l)&&(g.domReferenceElement=l),p.state.positionReference===p.state.referenceElement&&(g.positionReference=l),p.update(g)},[s,i,l,u,p]),p.context.onOpenChange=d,p.context.nested=a,p}function BJe(t,e=!1,r=!1){const[n,i]=j.useState(t&&e?"idle":void 0),[a,o]=j.useState(t);return t&&!a&&(o(!0),i("starting")),!t&&a&&n!=="ending"&&!r&&i("ending"),!t&&!a&&n==="ending"&&i(void 0),Bn(()=>{if(!t&&a&&n!=="ending"&&r){const s=Lh.request(()=>{i("ending")});return()=>{Lh.cancel(s)}}},[t,a,n,r]),Bn(()=>{if(!t||e)return;const s=Lh.request(()=>{i(void 0)});return()=>{Lh.cancel(s)}},[e,t]),Bn(()=>{if(!t||!e)return;t&&a&&n!=="idle"&&i("starting");const s=Lh.request(()=>{i("idle")});return()=>{Lh.cancel(s)}},[e,t,a,n]),{mounted:a,setMounted:o,transitionStatus:n}}function Zce(t,e=!1){const r=Ece();return Pn((n,i=null)=>{r.cancel();const a=ay(t);if(a==null)return;const o=a,s=()=>{kf.flushSync(n)};if(typeof o.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){n();return}function l(){Promise.all(o.getAnimations().map(u=>u.finished)).then(()=>{i!=null&&i.aborted||s()},()=>{if(i!=null&&i.aborted)return;if(o.getAnimations().some(h=>h.pending||h.playState!=="finished")){l();return}s()})}if(e){const u="data-starting-style";if(!o.hasAttribute(u)){r.request(l);return}const h=new MutationObserver(()=>{o.hasAttribute(u)||(h.disconnect(),l())});h.observe(o,{attributes:!0,attributeFilter:[u]}),i==null||i.addEventListener("abort",()=>h.disconnect(),{once:!0});return}r.request(l)})}function Jce(t){const{enabled:e=!0,open:r,ref:n,onComplete:i}=t,a=Pn(i),o=Zce(n,r);j.useEffect(()=>{if(!e)return;const s=new AbortController;return o(a,s.signal),()=>{s.abort()}},[e,r,a,o])}const Iyr={tabIndex:-1,[Ace]:""};function Pyr(t){return e=>e==="touch"?t.current:!0}function Nyr(t,e=!1){const r=FQ(),n=QQ()!=null,i=Kp(()=>t(r,n)).current;return Myr({popupStore:i,treatPopupAsFloatingElement:e,floatingRootContext:i.state.floatingRootContext,floatingId:r,nested:n,onOpenChange:i.setOpen}),i}function Byr({handle:t,store:e}){return Bn(()=>t.attachStore(e),[t,e]),null}function $yr(t,e){const r=j.useRef(null),n=j.useRef(null);return j.useCallback(i=>{if(t===void 0)return;let a=!1;if(r.current!==null){const o=r.current,s=n.current,l=e.context.triggerElements.getById(o);s&&l===s&&(e.context.triggerElements.delete(o),a=!0),r.current=null,n.current=null}if(i!==null&&(r.current=t,n.current=i,e.context.triggerElements.add(t,i),a=!0),a){const o=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==o&&e.set("triggerCount",o)}},[e,t])}function Fyr(t,e,r,n=!1){e?t.preventUnmountingOnClose=!1:n&&(t.preventUnmountingOnClose=!0);const i=(r==null?void 0:r.id)??null;(i||e)&&(t.activeTriggerId=i,t.activeTriggerElement=r??null)}function zyr(t){let e=!1;return t.preventUnmountOnClose=()=>{e=!0},()=>e}function Uyr(t,e,r,n){const i=r.useState("isMountedByTrigger",t),a=$yr(t,r),o=Pn(l=>{const u=r.select("open"),h=r.select("activeTriggerId");if(h===t){r.update({activeTriggerElement:l,...u?n:null});return}h==null&&u&&r.update({activeTriggerId:t,activeTriggerElement:l,...n})}),s=j.useCallback(l=>{a(l),l&&o(l)},[a,o]);return Bn(()=>{i&&r.update({activeTriggerElement:e.current,...n})},[i,r,e,...Object.values(n)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Vyr(t,e={}){const{closeOnActiveTriggerUnmount:r=!1}=e,n=j.useRef(null),i=t.useState("open"),a=t.useState("triggerCount"),o=t.useState("activeTriggerId"),s=t.useState("activeTriggerElement");Bn(()=>{if(!i){n.current=null,t.state.triggerCount!==0&&t.set("triggerCount",0);return}const l=t.context.triggerElements.size,u={};t.state.triggerCount!==l&&(u.triggerCount=l);const h=t.select("activeTriggerId");let d=null;if(h){const f=t.context.triggerElements.getById(h);if(f)n.current=h,f!==t.state.activeTriggerElement&&(u.activeTriggerElement=f);else{for(const[p,g]of t.context.triggerElements.entries())if(g===t.state.activeTriggerElement){u.activeTriggerId=p,u.activeTriggerElement=g,n.current=p;break}u.activeTriggerId===void 0&&(n.current===h?d=h:n.current=null)}}else n.current=null;if(!d&&!h&&l===1){const f=t.context.triggerElements.entries().next();if(!f.done){const[p,g]=f.value;u.activeTriggerId=p,u.activeTriggerElement=g,n.current=p}}(u.triggerCount!==void 0||u.activeTriggerId!==void 0||u.activeTriggerElement!==void 0)&&t.update(u),d&&r&&queueMicrotask(()=>{if(t.select("open")&&t.select("activeTriggerId")===d&&!t.context.triggerElements.getById(d)){const f=_s(AZe);t.setOpen(!1,f),f.isCanceled||t.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,t,a,o,s,r])}function Qyr(t,e,r){const{mounted:n,setMounted:i,transitionStatus:a}=BJe(t),o=e.useState("preventUnmountingOnClose"),s=t?!1:o;e.useSyncedValues({mounted:n,transitionStatus:a,preventUnmountingOnClose:s});const l=Pn(()=>{var u,h;i(!1),e.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),r==null||r(),(h=(u=e.context).onOpenChangeComplete)==null||h.call(u,!1)});return Jce({enabled:n&&!t&&!s,open:t,ref:e.context.popupRef,onComplete(){t||l()}}),{forceUnmount:l,transitionStatus:a}}function Gyr(t,e){t.useSyncedValues(e),Bn(()=>()=>{t.update({activeTriggerProps:Su,inactiveTriggerProps:Su,popupProps:Su})},[t])}function Hyr(t,e){Bn(()=>{!e&&t.state.openMethod!==null&&t.set("openMethod",null)},[e,t]),Bn(()=>()=>{t.state.openMethod!==null&&t.set("openMethod",null)},[t])}class $Je{constructor(){this.idMap=new Map}add(e,r){this.idMap.set(e,r)}delete(e){this.idMap.delete(e)}hasElement(e){for(const r of this.idMap.values())if(r===e)return!0;return!1}hasMatchingElement(e){for(const r of this.idMap.values())if(e(r))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function Wyr(){return new Kce({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new $Je,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Yyr(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Wyr(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Su,inactiveTriggerProps:Su,popupProps:Su}}function qyr(t,e,r=!1){return new Kce({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:t,floatingId:e,syncOnly:!0,nested:r,onOpenChange:void 0})}const J6=t=>t.triggerIdProp??t.activeTriggerId,eue=t=>t.openProp??t.open,FJe=t=>{var r;return(((r=t.popupElement)==null?void 0:r.id)??t.floatingId)||void 0};function zJe(t,e){return e!==void 0&&eue(t)&&J6(t)===e}function jyr(t,e){return zJe(t,e)?!0:e!==void 0&&eue(t)&&J6(t)==null&&t.triggerCount===1}const Xyr={open:eue,mounted:t=>t.mounted,transitionStatus:t=>t.transitionStatus,floatingRootContext:t=>t.floatingRootContext,triggerCount:t=>t.triggerCount,preventUnmountingOnClose:t=>t.preventUnmountingOnClose,payload:t=>t.payload,activeTriggerId:J6,activeTriggerElement:t=>t.mounted?t.activeTriggerElement:null,popupId:FJe,isTriggerActive:(t,e)=>e!==void 0&&J6(t)===e,isOpenedByTrigger:(t,e)=>zJe(t,e),isMountedByTrigger:(t,e)=>e!==void 0&&J6(t)===e&&t.mounted,triggerProps:(t,e)=>e?t.activeTriggerProps:t.inactiveTriggerProps,triggerPopupId:(t,e)=>jyr(t,e)?FJe(t):void 0,popupProps:t=>t.popupProps,popupElement:t=>t.popupElement,positionerElement:t=>t.positionerElement};function Kyr(t){const e=j.useCallback(n=>t===void 0?pce:t.subscribeStore(n),[t]),r=j.useCallback(()=>t===void 0?void 0:t.store,[t]);return tQ.useSyncExternalStore(e,r,()=>t==null?void 0:t.serverStore)}function Zyr(t){return Jyr(t,t.rootContext)}function Jyr(t,e){const{nodeId:r,externalTree:n}=t,i=e.useState("referenceElement"),a=e.useState("floatingElement"),o=e.useState("domReferenceElement"),s=e.useState("open"),l=e.useState("floatingId"),[u,h]=j.useState(null),[d,f]=j.useState(void 0),[p,g]=j.useState(void 0),m=j.useRef(null),v=NE(n),y=j.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),b=kJe({...t,elements:{...y,...u&&{reference:u}}}),x=Yi(d)?d:null,w=p===void 0?e.state.floatingElement:p;e.useSyncedValue("referenceElement",d??null),e.useSyncedValue("domReferenceElement",d===void 0?o:x),e.useSyncedValue("floatingElement",w);const A=j.useCallback(_=>{const P=Yi(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),getClientRects:()=>_.getClientRects(),contextElement:_}:_;h(P),b.refs.setReference(P)},[b.refs]),S=j.useCallback(_=>{(Yi(_)||_===null)&&(m.current=_,f(_)),(Yi(b.refs.reference.current)||b.refs.reference.current===null||_!==null&&!Yi(_))&&b.refs.setReference(_)},[b.refs,f]),T=j.useCallback(_=>{g(_),b.refs.setFloating(_)},[b.refs]),C=j.useMemo(()=>({...b.refs,setReference:S,setFloating:T,setPositionReference:A,domReference:m}),[b.refs,S,T,A]),k=j.useMemo(()=>({...b.elements,domReference:o}),[b.elements,o]),E=j.useMemo(()=>({...b,dataRef:e.context.dataRef,open:s,onOpenChange:e.setOpen,events:e.context.events,floatingId:l,refs:C,elements:k,nodeId:r,rootStore:e}),[b,C,k,r,e,s,l]);return Bn(()=>{o&&(m.current=o)},[o]),Bn(()=>{e.context.dataRef.current.floatingContext=E;const _=v==null?void 0:v.nodesRef.current.find(P=>P.id===r);_&&(_.context=E)}),j.useMemo(()=>({...b,context:E,refs:C,elements:k,rootStore:e}),[b,C,k,E,e])}class tue{constructor(){Pr(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});Pr(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Zp,this.restTimeout=new Zp,this.handleCloseOptions=void 0}static create(){return new tue}}const qQ=new WeakMap;function jQ(t){var r,n,i;if(!t.performedPointerEventsMutation)return;const e=t.pointerEventsScopeElement;e&&qQ.get(e)===t&&((r=t.pointerEventsScopeElement)==null||r.style.removeProperty("pointer-events"),(n=t.pointerEventsReferenceElement)==null||n.style.removeProperty("pointer-events"),(i=t.pointerEventsFloatingElement)==null||i.style.removeProperty("pointer-events"),qQ.delete(e)),t.performedPointerEventsMutation=!1,t.pointerEventsScopeElement=null,t.pointerEventsReferenceElement=null,t.pointerEventsFloatingElement=null}function UJe(t,e){const{scopeElement:r,referenceElement:n,floatingElement:i}=e,a=qQ.get(r);a&&a!==t&&jQ(a),jQ(t),t.performedPointerEventsMutation=!0,t.pointerEventsScopeElement=r,t.pointerEventsReferenceElement=n,t.pointerEventsFloatingElement=i,qQ.set(r,t),r.style.pointerEvents="none",n.style.pointerEvents="auto",i.style.pointerEvents="auto"}function VJe(t){const e=t.context.dataRef.current,r=Kp(()=>e.hoverInteractionState??tue.create()).current;return e.hoverInteractionState||(e.hoverInteractionState=r),gce(e.hoverInteractionState.disposeEffect),e.hoverInteractionState}function e1r(t,e={}){const{enabled:r=!0,closeDelay:n=0,nodeId:i}=e,a="rootStore"in t?t.rootStore:t,o=a.useState("open"),s=a.useState("floatingElement"),l=a.useState("domReferenceElement"),{dataRef:u}=a.context,h=NE(),d=QQ(),f=VJe(a),p=EE(),g=Pn(()=>{var y;return wZe((y=u.current.openEvent)==null?void 0:y.type,f.interactedInside)}),m=Pn(()=>{var y;return S0r((y=u.current.openEvent)==null?void 0:y.type)}),v=Pn(()=>{jQ(f)});Bn(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,v())},[o,f,v]),j.useEffect(()=>v,[v]),Bn(()=>{var y,b,x,w,A;if(r&&o&&(y=f.handleCloseOptions)!=null&&y.blockPointerEvents&&m()&&Yi(l)&&s){const S=l,T=s,C=eo(s),k=(x=(b=h==null?void 0:h.nodesRef.current.find(L=>L.id===d))==null?void 0:b.context)==null?void 0:x.elements.floating;k&&(k.style.pointerEvents="");const E=f.pointerEventsScopeElement!==T?f.pointerEventsScopeElement:null,_=k!==T?k:null,P=((A=(w=f.handleCloseOptions)==null?void 0:w.getScope)==null?void 0:A.call(w))??E??_??S.closest("[data-rootownerid]")??C.body;return UJe(f,{scopeElement:P,referenceElement:S,floatingElement:T}),()=>{v()}}},[r,o,l,s,f,m,h,d,v]),j.useEffect(()=>{if(!r)return;function y(){return!!(h&&d&&ux(h.nodesRef.current,d).length>0)}function b(C){const k=Cce(n,"close",f.pointerType),E=()=>{a.setOpen(!1,_s(Ld,C)),h==null||h.events.emit("floating.closed",C)};k?f.openChangeTimeout.start(k,E):(f.openChangeTimeout.clear(),E())}function x(C){const k=Jp(C);if(!w0r(k)){f.interactedInside=!1;return}f.interactedInside=(k==null?void 0:k.closest("[aria-haspopup]"))!=null}function w(){f.openChangeTimeout.clear(),p.clear(),h==null||h.events.off("floating.closed",S),v()}function A(C){var P;if(y()&&h){h.events.on("floating.closed",S);return}if(vZe(C.relatedTarget,a.context.triggerElements))return;const k=((P=u.current.floatingContext)==null?void 0:P.nodeId)??i,E=C.relatedTarget;if(!(h&&k&&Yi(E)&&ux(h.nodesRef.current,k,!1).some(L=>{var R;return Hn((R=L.context)==null?void 0:R.elements.floating,E)}))){if(f.handler){f.handler(C);return}v(),m()&&!g()&&b(C)}}function S(C){!h||!d||y()||p.start(0,()=>{h.events.off("floating.closed",S),a.setOpen(!1,_s(Ld,C)),h.events.emit("floating.closed",C)})}const T=s;return ey(T&&bi(T,"mouseenter",w),T&&bi(T,"mouseleave",A),T&&bi(T,"pointerdown",x,!0),()=>{h==null||h.events.off("floating.closed",S)})},[r,s,a,u,n,i,m,g,v,f,h,d,p])}const t1r={current:null};function r1r(t,e={}){var M;const{enabled:r=!0,delay:n=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:l=t1r,externalTree:u,isActiveTrigger:h=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:g=!1}=e,m="rootStore"in t?t.rootStore:t,{dataRef:v,events:y}=m.context,b=NE(u),x=VJe(m),w=j.useRef(!1),A=Tu(i),S=Tu(n),T=Tu(o),C=Tu(r),k=Tu(p),E=Tu(f),_=Pn(()=>{var I;return wZe((I=v.current.openEvent)==null?void 0:I.type,x.interactedInside)}),P=Pn(()=>{var I;return((I=k.current)==null?void 0:I.call(k))!==!1}),L=Pn((I,N,F)=>{const B=m.context.triggerElements;if(B.hasElement(N))return!I||!Hn(I,N);if(!Yi(F))return!1;const V=F;return B.hasMatchingElement(z=>Hn(z,V))&&(!I||!Hn(I,V))}),R=Pn(()=>{if(!x.handler)return;eo(m.select("domReferenceElement")).removeEventListener("mousemove",x.handler),x.handler=void 0}),D=Pn(()=>{jQ(x)});return h&&(x.handleCloseOptions=(M=A.current)==null?void 0:M.__options),j.useEffect(()=>R,[R]),j.useEffect(()=>{if(!r)return;function I(N){N.open?w.current=!1:(w.current=N.reason===Ld,R(),x.openChangeTimeout.clear(),x.restTimeout.clear(),x.blockMouseMove=!0,x.restTimeoutPending=!1)}return y.on("openchange",I),()=>{y.off("openchange",I)}},[r,y,x,R]),j.useEffect(()=>{if(!r)return;function I(U,Q=!0){const G=Cce(S.current,"close",x.pointerType);G?x.openChangeTimeout.start(G,()=>{m.setOpen(!1,_s(Ld,U)),b==null||b.events.emit("floating.closed",U)}):Q&&(x.openChangeTimeout.clear(),m.setOpen(!1,_s(Ld,U)),b==null||b.events.emit("floating.closed",U))}const N=l.current??(h?m.select("domReferenceElement"):null);if(!Yi(N))return;function F(U){var ue;if(x.openChangeTimeout.clear(),x.blockMouseMove=!1,a&&!RE(x.pointerType))return;const Q=xZe(T.current),G=Cce(S.current,"open",x.pointerType),q=Jp(U),Y=U.currentTarget??null,ne=m.select("domReferenceElement");let X=Y;if(Yi(q)&&!m.context.triggerElements.hasElement(q)){for(const de of m.context.triggerElements.elements())if(Hn(de,q)){X=de;break}}Yi(Y)&&Yi(ne)&&!m.context.triggerElements.hasElement(Y)&&Hn(Y,ne)&&(X=ne);const J=X==null?!1:L(ne,X,q),ee=m.select("open"),te=((ue=E.current)==null?void 0:ue.call(E))??m.select("transitionStatus")==="ending",pe=!ee&&te&&w.current,ie=!J&&Yi(X)&&Yi(ne)&&Hn(ne,X)&&pe,Ce=Q>0&&!G,ke=J&&(ee||pe)||ie,Ee=!ee||J;if(ke){P()&&m.setOpen(!0,_s(Ld,U,X));return}Ce||(G?x.openChangeTimeout.start(G,()=>{Ee&&P()&&m.setOpen(!0,_s(Ld,U,X))}):Ee&&P()&&m.setOpen(!0,_s(Ld,U,X)))}function B(U){if(_()){D();return}R();const Q=m.select("domReferenceElement"),G=eo(Q);x.restTimeout.clear(),x.restTimeoutPending=!1;const q=v.current.floatingContext??(d==null?void 0:d());if(vZe(U.relatedTarget,m.context.triggerElements))return;if(A.current&&q){m.select("open")||x.openChangeTimeout.clear();const ne=l.current;x.handler=A.current({...q,tree:b,x:U.clientX,y:U.clientY,onClose(){D(),R(),C.current&&!_()&&ne===m.select("domReferenceElement")&&I(U,!0)}}),G.addEventListener("mousemove",x.handler),x.handler(U);return}(x.pointerType==="touch"?!Hn(m.select("floatingElement"),U.relatedTarget):!0)&&I(U)}function V(U){Hn(N,U.relatedTarget)||(x.openChangeTimeout.clear(),x.restTimeout.clear(),x.restTimeoutPending=!1)}const z=g?bi(N,"mouseout",V):void 0;return s?ey(bi(N,"mousemove",F,{once:!0}),bi(N,"mouseenter",F),bi(N,"mouseleave",B),z):ey(bi(N,"mouseenter",F),bi(N,"mouseleave",B),z)},[R,D,v,S,m,r,A,x,h,L,_,a,s,T,l,b,C,d,E,P,g]),j.useMemo(()=>{if(!r)return;function I(N){x.pointerType=N.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(N){var q,Y,ne;const{nativeEvent:F}=N,B=N.currentTarget,V=m.select("domReferenceElement"),z=m.select("open"),U=L(V,B,N.target);if(a&&!RE(x.pointerType))return;if(z&&U&&((q=x.handleCloseOptions)!=null&&q.blockPointerEvents)){const X=m.select("floatingElement");if(X){const J=((ne=(Y=x.handleCloseOptions)==null?void 0:Y.getScope)==null?void 0:ne.call(Y))??B.ownerDocument.body;UJe(x,{scopeElement:J,referenceElement:B,floatingElement:X})}}const Q=xZe(T.current);if(z&&!U||Q===0||!U&&x.restTimeoutPending&&N.movementX**2+N.movementY**2<2)return;x.restTimeout.clear();function G(){if(x.restTimeoutPending=!1,_())return;const X=m.select("open");!x.blockMouseMove&&(!X||U)&&P()&&m.setOpen(!0,_s(Ld,F,B))}x.pointerType==="touch"?kf.flushSync(()=>{G()}):U&&z?G():(x.restTimeoutPending=!0,x.restTimeout.start(Q,G))}}},[r,x,_,L,a,m,T,P])}const QJe=.1,n1r=QJe*QJe,ma=.5;function XQ(t,e,r,n,i,a){return n>=e!=a>=e&&t<=(i-r)*(e-n)/(a-n)+r}function KQ(t,e,r,n,i,a,o,s,l,u){let h=!1;return XQ(t,e,r,n,i,a)&&(h=!h),XQ(t,e,i,a,o,s)&&(h=!h),XQ(t,e,o,s,l,u)&&(h=!h),XQ(t,e,l,u,r,n)&&(h=!h),h}function i1r(t,e,r){return t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height}function ZQ(t,e,r,n,i,a){const o=Math.min(r,i),s=Math.max(r,i),l=Math.min(n,a),u=Math.max(n,a);return t>=o&&t<=s&&e>=l&&e<=u}function a1r(t={}){const{blockPointerEvents:e=!1}=t,r=new Zp,n=({x:i,y:a,placement:o,elements:s,onClose:l,nodeId:u,tree:h})=>{const d=o==null?void 0:o.split("-")[0];let f=!1,p=null,g=null,m=typeof performance<"u"?performance.now():0;function v(b,x){const w=performance.now(),A=w-m;if(p===null||g===null||A===0)return p=b,g=x,m=w,!1;const S=b-p,T=x-g,C=S*S+T*T,k=A*A*n1r;return p=b,g=x,m=w,C0)}function L(){P()||y()}if(P())return;const R=w.getBoundingClientRect(),D=A.getBoundingClientRect(),M=i>D.right-D.width/2,I=a>D.bottom-D.height/2,N=D.width>R.width,F=D.height>R.height,B=(N?R:D).left,V=(N?R:D).right,z=(F?R:D).top,U=(F?R:D).bottom;if(d==="top"&&a>=R.bottom-1||d==="bottom"&&a<=R.top+1||d==="left"&&i>=R.right-1||d==="right"&&i<=R.left+1){L();return}let Q=!1;switch(d){case"top":Q=ZQ(S,T,B,R.top+1,V,D.bottom-1);break;case"bottom":Q=ZQ(S,T,B,D.top+1,V,R.bottom-1);break;case"left":Q=ZQ(S,T,D.right-1,U,R.left+1,z);break;case"right":Q=ZQ(S,T,R.right-1,U,D.left+1,z);break}if(Q)return;if(f&&!i1r(S,T,R)){L();return}if(!k&&v(S,T)){L();return}let G=!1;switch(d){case"top":{const q=N?ma/2:ma*4,Y=N||M?i+q:i-q,ne=N?i-q:M?i+q:i-q,X=a+ma+1,J=M||N?D.bottom-ma:D.top,ee=M?N?D.bottom-ma:D.top:D.bottom-ma;G=KQ(S,T,Y,X,ne,X,D.left,J,D.right,ee);break}case"bottom":{const q=N?ma/2:ma*4,Y=N||M?i+q:i-q,ne=N?i-q:M?i+q:i-q,X=a-ma,J=M||N?D.top+ma:D.bottom,ee=M?N?D.top+ma:D.bottom:D.top+ma;G=KQ(S,T,Y,X,ne,X,D.left,J,D.right,ee);break}case"left":{const q=F?ma/2:ma*4,Y=F||I?a+q:a-q,ne=F?a-q:I?a+q:a-q,X=i+ma+1,J=I||F?D.right-ma:D.left,ee=I?F?D.right-ma:D.left:D.right-ma;G=KQ(S,T,J,D.top,ee,D.bottom,X,Y,X,ne);break}case"right":{const q=F?ma/2:ma*4,Y=F||I?a+q:a-q,ne=F?a-q:I?a+q:a-q,X=i-ma,J=I||F?D.left+ma:D.right,ee=I?F?D.left+ma:D.right:D.left+ma;G=KQ(S,T,X,Y,X,ne,J,D.top,ee,D.bottom);break}}G?f||r.start(40,L):L()}};return n.__options={...t,blockPointerEvents:e},n}const GJe=j.createContext(void 0);function kA(t){const e=j.useContext(GJe);if(e===void 0&&!t)throw new Error(iy(47));return e}const o1r={...Xyr,disabled:t=>t.disabled,instantType:t=>t.instantType,openMethod:t=>t.openMethod,openChangeReason:t=>t.openChangeReason,modal:t=>t.modal,focusManagerModal:t=>t.focusManagerModal,stickIfOpen:t=>t.stickIfOpen,titleElementId:t=>t.titleElementId,descriptionElementId:t=>t.descriptionElementId,openOnHover:t=>t.openOnHover,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin};class s1r extends NJe{constructor(r,n,i){const a=new $Je;super(l1r(r,a,n,i),c1r(a),o1r);Pr(this,"setOpen",(r,n)=>{var d,f;const i=n.reason===Ld,a=n.reason===LE&&n.event.detail===0,o=!r&&(n.reason===TZe||n.reason==null),s=zyr(n),l=this.select("activeTriggerId");if(!r&&n.reason===T0r&&n.trigger==null&&l!=null&&(n.trigger=this.context.triggerElements.getById(l)??this.select("activeTriggerElement")??void 0),(f=(d=this.context).onOpenChange)==null||f.call(d,r,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(r,n);const u=()=>{const p={open:r,openChangeReason:n.reason};Fyr(p,r,n.trigger,s()),this.update(p)};i?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(gvr,()=>{this.set("stickIfOpen",!1)}),kf.flushSync(u)):u();let h;a?h="click":o?h="dismiss":n.reason===X6&&(h="focus"),this.set("instantType",h)})}}function l1r(t,e,r,n=!1){const i={...Yyr(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...t};return i.open&&(t==null?void 0:t.mounted)===void 0&&(i.mounted=!0),i.floatingRootContext=qyr(e,r,n),i}function c1r(t){return{popupRef:j.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:j.createRef(),beforeContentFocusGuardRef:j.createRef(),stickIfOpenTimeout:new Zp,triggerElements:t}}function HJe({props:t}){const{children:e,open:r,defaultOpen:n=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:l,defaultTriggerId:u=null}=t,h=h1r(s,{modal:o,open:n,openProp:r,activeTriggerId:u,triggerIdProp:l});h.useControlledProp("openProp",r),h.useControlledProp("triggerIdProp",l);const d=h.useState("open"),f=h.useState("mounted"),p=h.useState("payload");h.useContextCallback("onOpenChange",i),h.useContextCallback("onOpenChangeComplete",a),Hyr(h,d),Vyr(h);const{forceUnmount:g}=Qyr(d,h,()=>{h.update({stickIfOpen:!0,openChangeReason:null})});h.useSyncedValues({modal:o}),j.useEffect(()=>{d||h.context.stickIfOpenTimeout.clear()},[h,d]),j.useImperativeHandle(t.actionsRef,()=>({unmount:g,close:()=>h.setOpen(!1,_s(C0r))}),[g,h]);const m=d||f;return H.jsxs(GJe.Provider,{value:h,children:[s&&H.jsx(Byr,{handle:s,store:h}),m&&H.jsx(d1r,{store:h,modal:o}),typeof e=="function"?e({payload:p}):e]})}function u1r(t){return kA(!0)?H.jsx(HJe,{props:t}):H.jsx(Cvr,{children:H.jsx(HJe,{props:t})})}function h1r(t,e){const r=Nyr((n,i)=>new s1r(e,n,i));return j.useEffect(()=>r.context.stickIfOpenTimeout.disposeEffect(),[r]),r}function d1r({store:t,modal:e}){const r=t.useState("floatingRootContext"),n=Lvr(r,{outsidePressEvent:{mouse:e==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),i=n.reference,a=n.floating;return Gyr(t,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:a}),null}const f1r=j.createContext(void 0);function p1r(t=!1){const e=j.useContext(f1r);if(e===void 0&&!t)throw new Error(iy(16));return e}function g1r(t){const{focusableWhenDisabled:e,disabled:r,composite:n=!1,tabIndex:i=0,isNativeButton:a}=t,o=n&&e!==!1,s=n&&e===!1;return{props:j.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||o)||!a&&r)&&(u["aria-disabled"]=r),a&&(!e||s)&&(u.disabled=r),u},[n,r,e,o,s,a,i])}}function rue(t,e,{detail:r=0}={}){t.dispatchEvent(new(cs(t)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:r,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}function WJe(t={}){const{disabled:e=!1,focusableWhenDisabled:r,tabIndex:n=0,native:i=!0,composite:a}=t,o=j.useRef(null),s=p1r(!0),l=a??s!==void 0,{props:u}=g1r({focusableWhenDisabled:r,disabled:e,composite:l,tabIndex:n,isNativeButton:i}),h=j.useCallback(()=>{const p=o.current;nue(p)&&l&&e&&u.disabled===void 0&&p.disabled&&(p.disabled=!1)},[e,u.disabled,l]);Bn(h,[h]);const d=j.useCallback((p={})=>{const{onClick:g,onMouseDown:m,onKeyUp:v,onKeyDown:y,onPointerDown:b,...x}=p;return Gce({onClick(w){if(e){w.preventDefault();return}g==null||g(w)},onMouseDown(w){e||m==null||m(w)},onKeyDown(w){if(e||(VQ(w),y==null||y(w),w.baseUIHandlerPrevented))return;const A=w.target===w.currentTarget,S=w.currentTarget,T=nue(S),C=!i&&m1r(S),k=A&&(i?T:!C),E=w.key==="Enter",_=w.key===" ",P=S.getAttribute("role"),L=(P==null?void 0:P.startsWith("menuitem"))||P==="option"||P==="gridcell";if(A&&l&&_){if(w.defaultPrevented&&L)return;w.preventDefault(),(!i||T)&&(w.preventBaseUIHandler(),rue(S,w));return}if(!k||i||!_&&!E){A&&C&&_&&w.preventDefault();return}w.defaultPrevented||(w.preventDefault(),E&&(w.preventBaseUIHandler(),rue(S,w)))},onKeyUp(w){if(!e){if(VQ(w),v==null||v(w),w.target===w.currentTarget&&i&&l&&nue(w.currentTarget)&&w.key===" "){w.preventDefault();return}w.baseUIHandlerPrevented||w.target===w.currentTarget&&!i&&!l&&!w.defaultPrevented&&w.key===" "&&(w.preventBaseUIHandler(),rue(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=Pn(p=>{o.current=p,h()});return{getButtonProps:d,buttonRef:f}}function nue(t){return Eo(t)&&t.tagName==="BUTTON"}function m1r(t){return Eo(t)&&t.tagName==="A"&&!!t.href}let JQ=function(t){return t.startingStyle="data-starting-style",t.endingStyle="data-ending-style",t}({});const v1r={"data-starting-style":""},y1r={"data-ending-style":""},YJe={transitionStatus(t){return t==="starting"?v1r:t==="ending"?y1r:null}};(function(t){return t.open="data-open",t.closed="data-closed",t[t.startingStyle=JQ.startingStyle]="startingStyle",t[t.endingStyle=JQ.endingStyle]="endingStyle",t.anchorHidden="data-anchor-hidden",t.side="data-side",t.align="data-align",t})({});const b1r={"data-popup-open":""},x1r={"data-popup-open":"","data-pressed":""},w1r={"data-open":""},A1r={"data-closed":""},S1r={"data-anchor-hidden":""},T1r={open(t){return t?b1r:null}},C1r={open(t){return t?x1r:null}},qJe={open(t){return t?w1r:A1r},anchorHidden(t){return t?S1r:null}},O1r={...qJe,...YJe},k1r=300;function $E(t){return FQ(t,"base-ui")}function E1r(t,e){const r=j.useRef(null);function n(a){kf.flushSync(()=>{t.setOpen(!1,_s(X6,a.nativeEvent,a.currentTarget))});const o=K0r(r.current);o==null||o.focus()}function i(a){var s;const o=t.select("positionerElement");if(o&&PE(a,o))(s=t.context.beforeContentFocusGuardRef.current)==null||s.focus();else{kf.flushSync(()=>{t.setOpen(!1,_s(X6,a.nativeEvent,a.currentTarget))});let l=X0r(t.context.triggerFocusTargetRef.current||e.current);for(;l!==null&&Hn(o,l);){const u=l;if(l=Nce(l),l===u)break}l==null||l.focus()}}return{preFocusGuardRef:r,handlePreFocusGuardFocus:n,handleFocusTargetFocus:i}}function _1r(t){const e=j.useRef(""),r=j.useCallback(i=>{i.defaultPrevented||(e.current=i.pointerType,t(i,i.pointerType))},[t]);return{onClick:j.useCallback(i=>{if(i.detail===0){t(i,"keyboard");return}"pointerType"in i?t(i,i.pointerType):t(i,e.current),e.current=""},[t]),onPointerDown:r}}function R1r(t,e){const r=Pn((a,o)=>{(typeof t=="function"?t():t)||e(o||(CQ?"touch":""))}),{onClick:n,onPointerDown:i}=_1r(r);return j.useMemo(()=>({onClick:n,onPointerDown:i}),[n,i])}const D1r=j.forwardRef(function(e,r){const{render:n,className:i,style:a,disabled:o=!1,nativeButton:s=!0,handle:l,payload:u,openOnHover:h=!1,delay:d=k1r,closeDelay:f=0,id:p,...g}=e,m=kA(!0),y=Kyr(l)??m;if(!y)throw new Error(iy(74));const b=$E(p),x=y.useState("isTriggerActive",b),w=y.useState("floatingRootContext"),A=y.useState("isOpenedByTrigger",b),S=y.useState("triggerPopupId",b),T=j.useRef(null),{registerTrigger:C,isMountedByThisTrigger:k}=Uyr(b,T,y,{payload:u,disabled:o,openOnHover:h,closeDelay:f}),E=y.useState("openChangeReason"),_=y.useState("stickIfOpen"),P=y.useState("openMethod"),L=y.useState("focusManagerModal"),R=r1r(w,{enabled:!o&&h&&(P!=="touch"||E!==LE),mouseOnly:!0,move:!1,handleClose:a1r(),restMs:d,delay:{close:f},triggerElementRef:T,isActiveTrigger:x,isClosing:()=>y.select("transitionStatus")==="ending"}),D=_vr(w,{stickIfOpen:_}),M=R1r(()=>y.select("open"),Y=>{y.set("openMethod",Y)}),I=y.useState("triggerProps",k),{getButtonProps:N,buttonRef:F}=WJe({disabled:o,native:s}),B={open(Y){return Y&&E===LE?C1r.open(Y):T1r.open(Y)}},{preFocusGuardRef:V,handlePreFocusGuardFocus:z,handleFocusTargetFocus:U}=E1r(y,T),G=eg("button",e,{state:{disabled:o,open:A},ref:[F,r,C,T],props:[D.reference,R,I,M,{[nJe]:"",id:b,"aria-haspopup":"dialog","aria-expanded":A,"aria-controls":S},g,N],stateAttributesMapping:B}),q=H.jsx(j.Fragment,{children:G},b);return k&&!L?H.jsxs(j.Fragment,{children:[H.jsx(IE,{ref:V,onFocus:z}),q,H.jsx(IE,{ref:y.context.triggerFocusTargetRef,onFocus:U})]}):q}),jJe=j.createContext(void 0);function L1r(){const t=j.useContext(jJe);if(t===void 0)throw new Error(iy(45));return t}const M1r=j.forwardRef(function(e,r){const{keepMounted:n=!1,...i}=e;return kA().useState("mounted")||n?H.jsx(jJe.Provider,{value:n,children:H.jsx(wvr,{ref:r,...i})}):null});function I1r(t){return Uce(19)?t:t?"true":void 0}const XJe=j.createContext(void 0);function P1r(){const t=j.useContext(XJe);if(!t)throw new Error(iy(46));return t}const N1r=j.createContext(void 0);function B1r(){const t=j.useContext(N1r);return(t==null?void 0:t.direction)??"ltr"}const $1r=t=>({name:"arrow",options:t,async fn(e){var F,B;const{x:r,y:n,placement:i,rects:a,platform:o,elements:s,middlewareData:l}=e,{element:u,padding:h=0,offsetParent:d="real"}=vm(t,e)||{};if(u==null)return{};const f=Lce(h),p={x:r,y:n},g=IQ(i),m=MQ(g),v=await o.getDimensions(u),y=g==="y",b=y?"top":"left",x=y?"bottom":"right",w=y?"clientHeight":"clientWidth",A=a.reference[m]+a.reference[g]-p[g]-a.floating[m],S=p[g]-a.reference[g],T=d==="real"?await((F=o.getOffsetParent)==null?void 0:F.call(o,u)):s.floating;let C=s.floating[w]||a.floating[m];(!C||!await((B=o.isElement)==null?void 0:B.call(o,T)))&&(C=s.floating[w]||a.floating[m]);const k=A/2-S/2,E=C/2-v[m]/2-1,_=Math.min(f[b],E),P=Math.min(f[x],E),L=_,R=C-v[m]-P,D=C/2-v[m]/2+k,M=_ce(L,D,R),I=!l.arrow&&ny(i)!=null&&D!==M&&a.reference[m]/2-(D({...$1r(t),options:[t,e]}),z1r={name:"hide",async fn(t){const{width:e,height:r,x:n,y:i}=t.rects.reference,a=e===0&&r===0&&n===0&&i===0,o=await t.platform.detectOverflow(t,{elementContext:"reference"});return{data:{referenceHidden:o.top-r>=0||o.right-e>=0||o.bottom-r>=0||o.left-e>=0||a}}}},U1r={sideX:"left",sideY:"top"},KJe="--available-width",ZJe="--available-height";function JJe(t,e,r){const n=t==="inline-start"||t==="inline-end";return{top:"top",right:n?r?"inline-start":"inline-end":"right",bottom:"bottom",left:n?r?"inline-end":"inline-start":"left"}[e]}function eet(t,e,r){const{rects:n,placement:i}=t;return{side:JJe(e,Uf(i),r),align:ny(i)||"center",anchor:{width:n.reference.width,height:n.reference.height},positioner:{width:n.floating.width,height:n.floating.height}}}function V1r(t){return Q1r(t,Zyr)}function Q1r(t,e){var Ze,He;const{anchor:r,positionMethod:n="absolute",side:i="bottom",sideOffset:a=0,align:o="center",alignOffset:s=0,collisionBoundary:l,collisionPadding:u=5,sticky:h=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:g=!1,floatingRootContext:m,mounted:v,collisionAvoidance:y,shift:b,nodeId:x,adaptiveOrigin:w,lazyFlip:A=!1,externalTree:S}=t,[T,C]=j.useState(null);!v&&T!==null&&C(null);const k=y.side||"flip",E=y.align||"flip",_=y.fallbackAxisSide||"end",P=(b==null?void 0:b.crossAxis)??!1,L=b==null?void 0:b.rootBoundary,R=typeof r=="function"?r:void 0,D=Pn(R),M=R?D:r,I=Tu(r),N=Tu(v),B=B1r()==="rtl",V=T||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":B?"left":"right","inline-start":B?"right":"left"}[i],z=o==="center"?V:`${V}-${o}`;let U=u;typeof U=="number"?U={top:U,right:U,bottom:U,left:U}:U&&(U={top:U.top||0,right:U.right||0,bottom:U.bottom||0,left:U.left||0});const Q=1,G=i==="bottom"?Q:0,q=i==="top"?Q:0,Y=i==="right"?Q:0,ne=i==="left"?Q:0,X={boundary:l==="clipping-ancestors"?"clippingAncestors":l,padding:U},J=j.useRef(null),ee=Tu(a),te=Tu(s),pe=typeof a!="function"?a:0,ie=typeof s!="function"?s:0,Ce=[];p&&Ce.push(p),Ce.push(EJe(et=>{const Pe=eet(et,i,B),yt=typeof ee.current=="function"?ee.current(Pe):ee.current,Ie=typeof te.current=="function"?te.current(Pe):te.current;return{mainAxis:yt,crossAxis:Ie,alignmentAxis:Ie}},[pe,ie,B,i]));const ke=E==="none"&&k!=="shift",Ee=!ke&&(h||P||k==="shift"),ue=k==="none"?null:DJe({...X,padding:{top:U.top+Q+G,right:U.right+Q+ne,bottom:U.bottom+Q+q,left:U.left+Q+Y},mainAxis:!P&&k==="flip",crossAxis:E==="flip"?"alignment":!1,fallbackAxisSideDirection:_}),de=ke?null:_Je({...X,rootBoundary:L,mainAxis:E!=="none",crossAxis:Ee,limiter:h||P?void 0:RJe(et=>{if(!J.current)return{};const{width:Pe,height:yt}=J.current.getBoundingClientRect(),Ie=Vf(Uf(et.placement)),St=Ie==="y"?Pe:yt,kt=Ie==="y"?U.left+U.right:U.top+U.bottom;return{offset:St/2+kt/2}})},[X,h,P,L,U,E]);k==="shift"||E==="shift"||o==="center"?Ce.push(de,ue):Ce.push(ue,de),Ce.push(LJe({...X,apply({elements:{floating:et},availableWidth:Pe,availableHeight:yt,rects:Ie}){if(!N.current)return;const St=et.style;St.setProperty(KJe,`${Pe}px`),St.setProperty(ZJe,`${yt}px`);const kt=cs(et).devicePixelRatio||1,{x:ut,y:Gt,width:It,height:gt}=Ie.reference,Te=(Math.round((ut+It)*kt)-Math.round(ut*kt))/kt,Bt=(Math.round((Gt+gt)*kt)-Math.round(Gt*kt))/kt;St.setProperty("--anchor-width",`${Te}px`),St.setProperty("--anchor-height",`${Bt}px`)}}),F1r(et=>({element:J.current||eo(et.elements.floating).createElement("div"),padding:d,offsetParent:"floating"}),[d]),{name:"transformOrigin",fn(et){var jr,Ir,Zr;const{elements:Pe,middlewareData:yt,placement:Ie,rects:St,y:kt}=et,ut=Uf(Ie),Gt=Vf(ut),It=J.current,gt=((jr=yt.arrow)==null?void 0:jr.x)||0,Te=((Ir=yt.arrow)==null?void 0:Ir.y)||0,Bt=(It==null?void 0:It.clientWidth)||0,Et=(It==null?void 0:It.clientHeight)||0,At=gt+Bt/2,Mt=Te+Et/2,qr=Math.abs(((Zr=yt.shift)==null?void 0:Zr.y)||0),Me=St.reference.height/2,at=typeof a=="function"?a(eet(et,i,B)):a,wt=qr>at,Tt={top:`${At}px calc(100% + ${at}px)`,bottom:`${At}px ${-at}px`,left:`calc(100% + ${at}px) ${Mt}px`,right:`${-at}px ${Mt}px`}[ut],dr=`${At}px ${St.reference.y+Me-kt}px`;return Pe.floating.style.setProperty("--transform-origin",Ee&&Gt==="y"&&wt?dr:Tt),{}}},z1r,w),Bn(()=>{!v&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[v,m]);const xe=j.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<"u",layoutShift:!f&&typeof IntersectionObserver<"u"}),[f]),{refs:ge,elements:ze,x:we,y:Oe,middlewareData:Be,update:Z,placement:le,context:be,isPositioned:ae,floatingStyles:K}=e({rootContext:m,open:g?v:void 0,placement:z,middleware:Ce,strategy:n,whileElementsMounted:g?void 0:(...et)=>jce(...et,xe),nodeId:x,externalTree:S}),{sideX:se,sideY:me}=Be.adaptiveOrigin||U1r,oe=ae?n:"fixed",ve=j.useMemo(()=>{let et;return ae?w?et={position:oe,[se]:we,[me]:Oe}:et={...K,position:oe}:et={position:oe,top:0,left:0},et[KJe]="100vw",et[ZJe]="100vh",ae||(et.opacity=0),et},[w,oe,se,we,me,Oe,K,ae]),ce=j.useRef(null);Bn(()=>{if(!v)return;const et=I.current,Pe=typeof et=="function"?et():et,Ie=(tet(Pe)?Pe.current:Pe)||null||null;Ie!==ce.current&&(ge.setPositionReference(Ie),ce.current=Ie)},[v,ge,M,I]),j.useEffect(()=>{if(!v)return;const et=I.current;typeof et!="function"&&tet(et)&&et.current!==ce.current&&(ge.setPositionReference(et.current),ce.current=et.current)},[v,ge,M,I]),j.useEffect(()=>{if(g&&v&&ze.reference&&ze.floating)return jce(ze.reference,ze.floating,Z,xe)},[g,v,ze,Z,xe]);const De=Uf(le),Le=JJe(i,De,B),We=ny(le)||"center",Ne=!!((Ze=Be.hide)!=null&&Ze.referenceHidden);Bn(()=>{A&&v&&ae&&De!==V&&C(De)},[A,v,ae,De,V]);const je=j.useMemo(()=>{var et,Pe;return{position:"absolute",top:(et=Be.arrow)==null?void 0:et.y,left:(Pe=Be.arrow)==null?void 0:Pe.x}},[Be.arrow]),$e=((He=Be.arrow)==null?void 0:He.centerOffset)!==0;return j.useMemo(()=>({positionerStyles:ve,arrowStyles:je,arrowRef:J,arrowUncentered:$e,side:Le,align:We,physicalSide:De,anchorHidden:Ne,refs:ge,context:be,isPositioned:ae,update:Z}),[ve,je,J,$e,Le,We,De,Ne,ge,be,ae,Z])}function tet(t){return t!=null&&"current"in t}const G1r=j.forwardRef(function(e,r){const{cutout:n,...i}=e;let a;if(n){const o=n.getBoundingClientRect();a=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${o.left}px ${o.top}px,${o.left}px ${o.bottom}px,${o.right}px ${o.bottom}px,${o.right}px ${o.top}px,${o.left}px ${o.top}px)`}return H.jsx("div",{ref:r,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})});function ret(t){return t==="starting"?mvr:Su}function H1r(t,e,{styles:r,transitionStatus:n,props:i,refs:a,hidden:o,inert:s=!1}){const l={...r};return s&&(l.pointerEvents="none"),eg("div",t,{state:e,ref:a,props:[{role:"presentation",hidden:o,style:l},ret(n),i],stateAttributesMapping:qJe})}let net={},iet={},aet="";function eG(t,e){return q6(t)?t:e}function oet(t,e,r){return/hidden|clip/.test(t.getComputedStyle(eG(e,r)).overflowY)}function W1r(t){if(typeof document>"u")return!1;const e=eo(t);return cs(e).innerWidth-e.documentElement.clientWidth>0}function Y1r(t){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const r=eo(t),n=r.documentElement,i=r.body,a=eG(n,i),o=a.style.overflowY,s=n.style.scrollbarGutter;n.style.scrollbarGutter="stable",a.style.overflowY="scroll";const l=a.offsetWidth;a.style.overflowY="hidden";const u=a.offsetWidth;return a.style.overflowY=o,n.style.scrollbarGutter=s,l===u}function q1r(t){const e=eo(t),r=e.documentElement,n=e.body,i=eG(r,n),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,a)}}function j1r(t){var p;const e=eo(t),r=e.documentElement,n=e.body,i=cs(r);let a=0,o=0,s=!1;const l=Lh.create();if(_E&&(((p=i.visualViewport)==null?void 0:p.scale)??1)!==1)return()=>{};function u(){const g=i.getComputedStyle(r),m=i.getComputedStyle(n),b=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=r.scrollTop,o=r.scrollLeft,net={scrollbarGutter:r.style.scrollbarGutter,overflowY:r.style.overflowY,overflowX:r.style.overflowX},aet=r.style.scrollBehavior,iet={position:n.style.position,height:n.style.height,width:n.style.width,boxSizing:n.style.boxSizing,overflowY:n.style.overflowY,overflowX:n.style.overflowX,scrollBehavior:n.style.scrollBehavior};const x=r.scrollHeight>r.clientHeight,w=r.scrollWidth>r.clientWidth,A=g.overflowY==="scroll"||m.overflowY==="scroll",S=g.overflowX==="scroll"||m.overflowX==="scroll",T=Math.max(0,i.innerWidth-n.clientWidth),C=Math.max(0,i.innerHeight-n.clientHeight),k=parseFloat(m.marginTop)+parseFloat(m.marginBottom),E=parseFloat(m.marginLeft)+parseFloat(m.marginRight),_=eG(r,n);if(s=Y1r(t),s){r.style.scrollbarGutter=b,_.style.overflowY="hidden",_.style.overflowX="hidden";return}Object.assign(r.style,{scrollbarGutter:b,overflowY:"hidden",overflowX:"hidden"}),(x||A)&&(r.style.overflowY="scroll"),(w||S)&&(r.style.overflowX="scroll"),Object.assign(n.style,{position:"relative",height:k||C?`calc(100dvh - ${k+C}px)`:"100dvh",width:E||T?`calc(100vw - ${E+T}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),n.scrollTop=a,n.scrollLeft=o,r.setAttribute("data-base-ui-scroll-locked",""),r.style.scrollBehavior="unset"}function h(){Object.assign(r.style,net),Object.assign(n.style,iet),s||(r.scrollTop=a,r.scrollLeft=o,r.removeAttribute("data-base-ui-scroll-locked"),r.style.scrollBehavior=aet)}function d(){h(),l.request(u)}u();const f=bi(i,"resize",d);return()=>{l.cancel(),h(),typeof i.removeEventListener=="function"&&f()}}class X1r{constructor(){Pr(this,"lockCount",0);Pr(this,"restore",null);Pr(this,"timeoutLock",Zp.create());Pr(this,"timeoutUnlock",Zp.create());Pr(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Pr(this,"unlock",()=>{var e;this.lockCount===0&&this.restore&&((e=this.restore)==null||e.call(this),this.restore=null)})}acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}lock(e){if(this.lockCount===0||this.restore!==null)return;const r=eo(e),n=r.documentElement,i=r.body,a=cs(n);if(oet(a,n,i)){const s=new a.MutationObserver(()=>{oet(a,n,i)||(s.disconnect(),this.restore=null,this.lock(e))}),l={attributes:!0};s.observe(n,l),s.observe(i,l),this.restore=()=>s.disconnect();return}const o=CQ||!W1r(e);this.restore=o?q1r(e):j1r(e)}}const K1r=new X1r;function Z1r(t=!0,e=null){Bn(()=>{if(t)return K1r.acquire(e)},[t,e])}const J1r=20;function ebr(t,e,r,n){const[i,a]=j.useState(!1);Bn(()=>{if(!t||!e||r==null){a(!1);return}const o=eo(r).documentElement.clientWidth,s=r.offsetWidth;a(o>0&&s>0&&s>=o-J1r)},[t,e,r]),Z1r(t&&(!e||i),n)}const tbr=j.forwardRef(function(e,r){const{render:n,className:i,style:a,anchor:o,positionMethod:s,side:l,align:u,sideOffset:h,alignOffset:d,collisionBoundary:f="clipping-ancestors",collisionPadding:p,arrowPadding:g,sticky:m,disableAnchorTracking:v=!1,collisionAvoidance:y=vvr,...b}=e,x=kA(),w=L1r(),A=Svr(),S=x.useState("floatingRootContext"),T=x.useState("mounted"),C=x.useState("open"),k=x.useState("openChangeReason"),E=x.useState("activeTriggerElement"),_=x.useState("modal"),P=x.useState("openMethod"),L=x.useState("positionerElement"),R=x.useState("instantType"),D=x.useState("transitionStatus"),M=x.useState("adaptiveOrigin"),I=j.useRef(null),N=Zce(L),F=V1r({anchor:o,floatingRootContext:S,positionMethod:s,mounted:T,side:l,sideOffset:h,align:u,alignOffset:d,arrowPadding:g,collisionBoundary:f,collisionPadding:p,sticky:m,disableAnchorTracking:v,keepMounted:w,nodeId:A,collisionAvoidance:y,adaptiveOrigin:M}),B=S.useState("domReferenceElement");Bn(()=>{const G=B,q=I.current;if(G&&(I.current=G),q&&G&&G!==q){x.set("instantType",void 0);const Y=new AbortController;return N(()=>{x.set("instantType","trigger-change")},Y.signal),()=>{Y.abort()}}},[B,N,x]);const V=_===!0&&k!==Ld;ebr(C&&V,P==="touch",L,E);const z=x.useStateSetter("positionerElement"),U={open:C,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:R},Q=H1r(e,U,{styles:F.positionerStyles,transitionStatus:D,props:b,refs:[r,z],hidden:!T,inert:!C});return H.jsxs(XJe.Provider,{value:F,children:[T&&V&&H.jsx(G1r,{inert:I1r(!C),cutout:E}),H.jsx(Tvr,{id:A,children:Q})]})}),rbr="ArrowUp",nbr="ArrowDown",ibr="ArrowLeft",abr="ArrowRight",obr="Home",sbr="End",lbr=new Set([rbr,nbr,ibr,abr,obr,sbr]),cbr=j.createContext(void 0);function ubr(t){return j.useContext(cbr)}const hbr=j.createContext(void 0);function dbr(){const[t,e]=j.useState(0),r=Pn(()=>(e(i=>i+1),()=>{e(i=>Math.max(0,i-1))}));return{context:j.useMemo(()=>({register:r}),[r]),hasClosePart:t>0}}const fbr=j.forwardRef(function(e,r){const{render:n,className:i,style:a,initialFocus:o,finalFocus:s,...l}=e,u=kA(),h=P1r(),d=ubr()!=null,{context:f,hasClosePart:p}=dbr(),g=u.useState("open"),m=u.useState("openMethod"),v=u.useState("instantType"),y=u.useState("transitionStatus"),b=u.useState("popupProps"),x=u.useState("titleElementId"),w=u.useState("descriptionElementId"),A=u.useState("modal"),S=u.useState("mounted"),T=u.useState("openChangeReason"),C=u.useState("activeTriggerElement"),k=u.useState("floatingRootContext"),E=k.useState("floatingId"),_=u.useState("disabled"),P=u.useState("openOnHover"),L=u.useState("closeDelay");Jce({open:g,ref:u.context.popupRef,onComplete(){var F,B;g&&((B=(F=u.context).onOpenChangeComplete)==null||B.call(F,!0))}}),e1r(k,{enabled:P&&!_,closeDelay:L});const R=o===void 0?Pyr(u.context.popupRef):o,D=A!==!1&&p;u.useSyncedValue("focusManagerModal",D);const M=u.useStateSetter("popupElement"),I={open:g,side:h.side,align:h.align,instant:v,transitionStatus:y},N=eg("div",e,{state:I,ref:[r,u.context.popupRef,M],props:[b,{id:E,role:"dialog",...Iyr,"aria-labelledby":x,"aria-describedby":w,onKeyDown(F){d&&lbr.has(F.key)&&F.stopPropagation()}},ret(y),l],stateAttributesMapping:O1r});return H.jsx(Evr,{context:k,openInteractionType:m,modal:D,disabled:!S||T===Ld,initialFocus:R,returnFocus:s,restoreFocus:"popup",previousFocusableElement:Eo(C)?C:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:H.jsx(hbr.Provider,{value:f,children:N})})}),pbr=j.forwardRef(function(e,r){const{render:n,className:i,style:a,...o}=e,s=kA(),l=$E(o.id);return s.useSyncedValueWithCleanup("titleElementId",l),eg("h2",e,{ref:r,props:[{id:l},o]})}),gbr=j.forwardRef(function(e,r){const{render:n,className:i,style:a,...o}=e,s=kA(),l=$E(o.id);return s.useSyncedValueWithCleanup("descriptionElementId",l),eg("p",e,{ref:r,props:[{id:l},o]})});function set(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),H.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 mbr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),H.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),H.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),H.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 vbr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.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"}),H.jsxs("g",{className:"video-generate-icon__clapper",children:[H.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"}),H.jsx("path",{d:"M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"})]}),H.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function ybr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),H.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),H.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function bbr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.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"}),H.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"}),H.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function xbr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),H.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),H.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),H.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function wbr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.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"}),H.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"}),H.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 Abr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),H.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),H.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"}),H.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function Sbr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.jsx("circle",{cx:"6",cy:"6.25",r:"2.25"}),H.jsx("circle",{cx:"18",cy:"6.25",r:"2.25"}),H.jsx("circle",{cx:"12",cy:"17.75",r:"2.25"}),H.jsx("path",{d:"m7.7 7.75 2.7 7.55M16.3 7.75l-2.7 7.55M8.25 6.25h7.5"})]})}function cet(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.jsx("circle",{cx:"9",cy:"8",r:"3"}),H.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"}),H.jsx("path",{d:"M17.75 4.25v5.5M15 7h5.5M16 13.25h4.25M18.125 11.125v4.25"})]})}function Tbr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.jsx("rect",{x:"4",y:"4.25",width:"16",height:"5",rx:"1.5"}),H.jsx("rect",{x:"4",y:"14.75",width:"16",height:"5",rx:"1.5"}),H.jsx("path",{d:"M7.25 6.75h.01M7.25 17.25h.01M10 6.75h6.5M10 17.25h6.5"})]})}function Cbr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.jsx("path",{d:"M6 3.75h8l4 4v12.5H6V3.75Z"}),H.jsx("path",{d:"M14 3.75v4h4M8.75 11h6.5M8.75 14.25h6.5M8.75 17.5h4"})]})}function uet(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.jsx("rect",{x:"3.75",y:"4.5",width:"16.5",height:"15",rx:"2.5"}),H.jsx("path",{d:"m7.5 9 2.75 2.5L7.5 14M12.5 14h4"}),H.jsx("path",{d:"M3.75 7.5h16.5",opacity:".62"})]})}function FE(t){return H.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:H.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function het(t){if(t==null||!Number.isFinite(t)||t<0)return Rh("developmentRuns.notReported");const e=Math.round(t);if(e===0)return`<${Rh("developmentRuns.durationUnits.milliseconds",{value:"1"})}`;if(e<1e3)return Rh("developmentRuns.durationUnits.milliseconds",{value:e.toLocaleString(nje())});const r=Math.round(e/100);return[["hours",Math.floor(r/36e3)],["minutes",Math.floor(r%36e3/600)],["seconds",r%600/10]].filter(([,i])=>i>0).map(([i,a])=>Rh(`developmentRuns.durationUnits.${i}`,{value:a.toLocaleString(nje(),{maximumFractionDigits:1})})).join(" ")}const iue=t=>t&&typeof t=="object"&&!Array.isArray(t)?t:{},det=t=>typeof t=="string"?t.replace(/\s+/g," ").trim().slice(0,160):"";function fet(t){var r;const e=iue(t.args);if(t.itemType==="dynamicToolCall"&&t.name==="submit_build_result")return Rh("developmentRuns.submitResult");if(t.itemType==="commandExecution"){const n=Array.isArray(e.commandActions)?e.commandActions.map(iue):[],i=new Set(n.map(l=>l.type));if(n.length&&i.size===1){if(i.has("read"))return Rh("developmentRuns.read",{target:"Read project files"});if(i.has("listFiles"))return Rh("developmentRuns.listFiles",{target:"List directory"});if(i.has("search"))return Rh("developmentRuns.search",{target:"Search project files"})}const a=typeof e.command=="string"?e.command:"",s=(r=[[/\b(?:pytest|vitest|jest)\b|\b(?:npm|pnpm|yarn) (?:run )?test\b/,"Run tests"],[/\b(?:npm|pnpm|yarn) (?:ci|install|add)\b|\b(?:pip|pip3|uv pip) install\b|\buv sync\b/,"Install dependencies"],[/\b(?:ruff|eslint|prettier|pyright|tsc)\b/,"Check code quality"],[/\b(?:npm|pnpm|yarn) (?:run )?build\b|\bpython[^;]* -m build\b/,"Build project"],[/\bgit (?:status|diff|log|show)\b/,"Inspect Git changes"],[/\bgit (?:add|commit)\b/,"Save Git changes"],[/\b(?:curl|wget)\b/,"Send HTTP request"],[/\bcompileall\b/,"Check Python syntax"]].find(([l])=>l.test(a)))==null?void 0:r[1];return s?Rh("developmentRuns.command",{target:s}):t.name}if(t.itemType==="fileChange"){const n=Array.isArray(e.changes)?e.changes.map(i=>det(iue(i).path)).filter(Boolean):[];return Rh("developmentRuns.editFiles",{target:n.join(", ")})}return t.itemType==="webSearch"?Rh("developmentRuns.webSearch",{target:det(e.query)}):t.name}const Obr=t=>["tool","thinking","plan","diff"].includes(t.kind);function kbr(t){const e=[];return t.forEach((r,n)=>{if(r.kind==="progress")return;const i=Obr(r),a=e[e.length-1];i&&(a!=null&&a.process)?a.blocks.push(r):e.push({id:r.id||`${r.kind}:${n}`,process:i,blocks:[r]})}),e}function Ebr({value:t}){const{t:e,i18n:r}=ca("adk"),[n,i]=j.useState(!1),a=d=>d==null?e("developmentRuns.notReported"):d.toLocaleString(r.resolvedLanguage||r.language),o=het,s=t.usage,l=(s==null?void 0:s.inputTokens)!=null&&s.cachedInputTokens!=null&&s.cachedInputTokens<=s.inputTokens?s.inputTokens-s.cachedInputTokens:void 0,u=s!=null&&s.inputTokens&&s.cachedInputTokens!=null&&l!=null?`${(s.cachedInputTokens/s.inputTokens*100).toFixed(1)}%`:void 0,h=[["inputTokens",s==null?void 0:s.inputTokens],["cachedInputTokens",s==null?void 0:s.cachedInputTokens],["uncachedInputTokens",l],["cacheWriteInputTokens",s==null?void 0:s.cacheWriteInputTokens],["outputTokens",s==null?void 0:s.outputTokens],["reasoningOutputTokens",s==null?void 0:s.reasoningOutputTokens]];return H.jsxs("div",{className:"development-turn-summary","data-turn-id":t.turnId,children:[H.jsx("span",{children:e(`developmentRuns.turnStatus.${t.status}`)}),H.jsx("span",{children:e("developmentRuns.toolCalls",{count:t.toolCalls})}),H.jsx("span",{children:e("developmentRuns.turnDuration",{duration:o(t.durationMs)})}),H.jsx("span",{title:e("developmentRuns.toolDurationHelp"),children:e(t.toolDurationComplete?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:o(t.toolDurationMs)})}),H.jsxs(u1r,{open:n,onOpenChange:i,children:[H.jsxs(D1r,{className:"development-token-trigger",openOnHover:!0,delay:150,closeDelay:150,onFocus:d=>{d.currentTarget.matches(":focus-visible")&&i(!0)},children:[H.jsx("span",{children:"Tokens"}),H.jsx("span",{className:"development-token-value",children:a(s==null?void 0:s.totalTokens)}),t.usageIncomplete&&H.jsxs("span",{children:["· ",e("developmentRuns.partial")]}),H.jsx(FE,{className:"development-token-chevron"})]}),H.jsx(M1r,{children:H.jsx(tbr,{side:"top",align:"end",sideOffset:8,className:"development-token-positioner",children:H.jsxs(fbr,{className:"development-token-popup",initialFocus:!1,finalFocus:!1,children:[H.jsx(pbr,{className:"development-token-title",children:e("developmentRuns.tokenDetails")}),H.jsxs("dl",{children:[H.jsxs("div",{children:[H.jsx("dt",{children:e("developmentRuns.model")}),H.jsx("dd",{children:t.model||e("developmentRuns.notReported")})]}),H.jsxs("div",{children:[H.jsx("dt",{children:e("developmentRuns.totalTokens")}),H.jsx("dd",{children:a(s==null?void 0:s.totalTokens)})]}),h.map(([d,f])=>H.jsxs("div",{children:[H.jsx("dt",{children:e(`developmentRuns.${d}`)}),H.jsx("dd",{children:a(f)})]},d)),H.jsxs("div",{children:[H.jsx("dt",{children:e("developmentRuns.cacheHitRate")}),H.jsx("dd",{children:u||e("developmentRuns.notReported")})]})]}),H.jsxs(gbr,{className:"development-token-note",children:[e("developmentRuns.tokenHelp"),t.usageIncomplete?` ${e("developmentRuns.partialHelp")}`:""]})]})})})]})]})}function aue(t){return H.jsx("svg",{viewBox:"0 0 111 117",fill:"none","aria-hidden":"true",...t,children:H.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 tG({kind:t,...e}){return t==="thinking"?H.jsx(aue,{...e}):H.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:t==="tool"?H.jsxs(H.Fragment,{children:[H.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"3"}),H.jsx("path",{d:"m7 9 3 3-3 3m6 0h4"})]}):t==="plan"?H.jsxs(H.Fragment,{children:[H.jsx("path",{d:"m4 7 1.5 1.5L8 6m-4 7 1.5 1.5L8 12M11 7h9m-9 6h9m-9 6h9"}),H.jsx("circle",{cx:"6",cy:"19",r:"1"})]}):H.jsx(H.Fragment,{children:H.jsx("path",{d:"M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9zM14 3v6h6M8 13h8m-4-3v6M8 18h8"})})})}function ym({as:t="span",className:e="",duration:r=4,spread:n=20,children:i,style:a,...o}){const s=Math.min(Math.max(n,5),45);return H.jsx(t,{className:`text-shimmer${e?` ${e}`:""}`,style:{...a,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-s}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+s}%)`,animationDuration:`${r}s`},...o,children:i})}function _br({blocks:t,active:e,status:r,render:n}){const{t:i}=ca("adk"),[a,o]=j.useState(!1),s=[...t].reverse().find(f=>"done"in f&&!f.done),l=t.filter(f=>f.kind==="tool"),u=l.filter(f=>f.durationMs!=null),h=u.reduce((f,p)=>f+(p.durationMs||0),0);let d=i("developmentRuns.processSummary",{count:t.length});return e&&(d=r||((s==null?void 0:s.kind)==="thinking"?i("developmentRuns.thinking"):(s==null?void 0:s.kind)==="tool"?fet(s):(s==null?void 0:s.kind)==="plan"?i("developmentRuns.plan"):(s==null?void 0:s.kind)==="diff"?i("developmentRuns.diff"):i("developmentRuns.processing"))),H.jsxs("section",{className:"development-process",children:[H.jsxs("button",{type:"button",className:"development-process__toggle","aria-expanded":a,onClick:()=>o(!a),children:[H.jsx(FE,{className:`tool-chevron${a?" is-open":""}`}),H.jsx("span",{className:"tool-icon",children:H.jsx(tG,{kind:(s==null?void 0:s.kind)==="thinking"||(s==null?void 0:s.kind)==="plan"||(s==null?void 0:s.kind)==="diff"?s.kind:"tool"})}),e?H.jsx(ym,{className:"development-process__title","aria-live":"polite",children:d}):H.jsx("span",{className:"development-process__title",children:d}),!e&&l.length>0&&H.jsxs("span",{className:"development-process__duration",children:[i("developmentRuns.toolCalls",{count:l.length}),u.length>0?` · ${i(u.length===l.length?"developmentRuns.toolDuration":"developmentRuns.toolDurationPartial",{duration:het(h)})}`:""]})]}),H.jsx("div",{className:"development-process__items",hidden:!a,children:n(t)})]})}function Rbr({blocks:t,active:e,status:r="",render:n}){const{t:i}=ca("adk"),a=kbr(t),o=a[a.length-1],s=[...t].reverse().find(u=>u.kind==="progress"),l=r||((s==null?void 0:s.kind)==="progress"?s.text:"");return H.jsxs(H.Fragment,{children:[a.map(u=>u.process?H.jsx(_br,{blocks:u.blocks,active:e&&u===o,status:l,render:n},u.id):H.jsx("div",{"data-assistant-phase":u.blocks[0].phase,children:n(u.blocks)},u.id)),e&&!(o!=null&&o.process)&&H.jsxs("div",{className:"development-process__status",role:"status",children:[H.jsx("span",{className:"tool-icon",children:H.jsx(tG,{kind:"thinking"})}),H.jsx(ym,{children:l||i("developmentRuns.processing")})]})]})}const Dbr={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 Lbr(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 Mbr(t){return typeof t=="object"&&t!==null&&typeof t.path=="string"}function Ibr(t){return typeof t=="object"&&t!==null&&typeof t.call=="string"}function oue(t,e){if(Mbr(t))return Lbr(e,t.path);if(Ibr(t)){const r=Dbr[t.call],n={};for(const[i,a]of Object.entries(t.args??{}))n[i]=oue(a,e);return r?r(n):`[unknown fn: ${t.call}]`}return t}function Pbr(t,e){const r=oue(t,e);return r==null?"":typeof r=="string"?r:String(r)}const Nbr=new Map;function Bbr(t){return Nbr.get(t)}function $br(t,e,r){const n=e.replace(/^\//,"").split("/").map(a=>a.replace(/~1/g,"/").replace(/~0/g,"~"));let i=t;for(let a=0;aoue(n,t.dataModel),resolveString:n=>Pbr(n,t.dataModel),dispatchAction:e,render:n=>{if(!n)return null;const i=t.components[n];if(!i)return null;const a=Bbr(i.component)??zbr;return H.jsx(a,{node:i,ctx:r},n)}};return H.jsx("div",{className:"a2ui-surface","data-a2ui-surface":t.surfaceId,children:r.render(t.rootId)})}function Vbr(t){const e=j.useRef(null),r=j.useRef(!0),n=28,i=j.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 qfi(){}function jfi(){}function pet(t){const e=[],r=String(t||"");let n=r.indexOf(","),i=0,a=!1;for(;!a;){n===-1&&(n=r.length,a=!0);const o=r.slice(i,n).trim();(o||!a)&&e.push(o),i=n+1,n=r.indexOf(",",i)}return e}function get(t,e){const r={};return(t[t.length-1]===""?[...t,""]:t).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const Qbr=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gbr=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Hbr={};function met(t,e){return(Hbr.jsx?Gbr:Qbr).test(t)}const Wbr=/[ \t\n\f\r]/g;function Ybr(t){return typeof t=="object"?t.type==="text"?vet(t.value):!1:vet(t)}function vet(t){return t.replace(Wbr,"")===""}let eN=class{constructor(e,r,n){this.normal=r,this.property=e,n&&(this.space=n)}};eN.prototype.normal={},eN.prototype.property={},eN.prototype.space=void 0;function yet(t,e){const r={},n={};for(const i of t)Object.assign(r,i.property),Object.assign(n,i.normal);return new eN(r,n,e)}function tN(t){return t.toLowerCase()}let Mh=class{constructor(e,r){this.attribute=r,this.property=e}};Mh.prototype.attribute="",Mh.prototype.booleanish=!1,Mh.prototype.boolean=!1,Mh.prototype.commaOrSpaceSeparated=!1,Mh.prototype.commaSeparated=!1,Mh.prototype.defined=!1,Mh.prototype.mustUseProperty=!1,Mh.prototype.number=!1,Mh.prototype.overloadedBoolean=!1,Mh.prototype.property="",Mh.prototype.spaceSeparated=!1,Mh.prototype.space=void 0;let qbr=0;const Wn=EA(),Rs=EA(),sue=EA(),rr=EA(),Pa=EA(),zE=EA(),Md=EA();function EA(){return 2**++qbr}const lue=Object.freeze(Object.defineProperty({__proto__:null,boolean:Wn,booleanish:Rs,commaOrSpaceSeparated:Md,commaSeparated:zE,number:rr,overloadedBoolean:sue,spaceSeparated:Pa},Symbol.toStringTag,{value:"Module"})),cue=Object.keys(lue);class uue extends Mh{constructor(e,r,n,i){let a=-1;if(super(e,r),bet(this,"space",i),typeof n=="number")for(;++a4&&r.slice(0,4)==="data"&&Jbr.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(ket,txr);n="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!ket.test(a)){let o=a.replace(Zbr,exr);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}i=uue}return new i(n,e)}function exr(t){return"-"+t.toLowerCase()}function txr(t){return t.charAt(1).toUpperCase()}const rN=yet([xet,jbr,Tet,Cet,Oet],"html"),dx=yet([xet,Xbr,Tet,Cet,Oet],"svg");function Eet(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function _et(t){return t.join(" ").trim()}var hue={},Ret=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,rxr=/\n/g,nxr=/^\s*/,ixr=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,axr=/^:\s*/,oxr=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,sxr=/^[;\s]*/,lxr=/^\s+|\s+$/g,cxr=` +`,Det="/",Let="*",_A="",uxr="comment",hxr="declaration";function dxr(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(rxr);m&&(r+=m.length);var v=g.lastIndexOf(cxr);n=~v?g.length-v:n+g.length}function a(){var g={line:r,column:n};return function(m){return m.position=new o(g),u(),m}}function o(g){this.start=g,this.end={line:r,column:n},this.source=e.source}o.prototype.content=t;function s(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(nxr)}function h(g){var m;for(g=g||[];m=d();)m!==!1&&g.push(m);return g}function d(){var g=a();if(!(Det!=t.charAt(0)||Let!=t.charAt(1))){for(var m=2;_A!=t.charAt(m)&&(Let!=t.charAt(m)||Det!=t.charAt(m+1));)++m;if(m+=2,_A===t.charAt(m-1))return s("End of comment missing");var v=t.slice(2,m-2);return n+=2,i(v),t=t.slice(m),n+=2,g({type:uxr,comment:v})}}function f(){var g=a(),m=l(ixr);if(m){if(d(),!l(axr))return s("property missing ':'");var v=l(oxr),y=g({type:hxr,property:Met(m[0].replace(Ret,_A)),value:v?Met(v[0].replace(Ret,_A)):_A});return l(sxr),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 Met(t){return t?t.replace(lxr,_A):_A}var fxr=dxr,pxr=Ti&&Ti.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hue,"__esModule",{value:!0}),hue.default=mxr;const gxr=pxr(fxr);function mxr(t,e){let r=null;if(!t||typeof t!="string")return r;const n=(0,gxr.default)(t),i=typeof e=="function";return n.forEach(a=>{if(a.type!=="declaration")return;const{property:o,value:s}=a;i?e(o,s,a):s&&(r=r||{},r[o]=s)}),r}var nG={};Object.defineProperty(nG,"__esModule",{value:!0}),nG.camelCase=void 0;var vxr=/^--[a-zA-Z0-9_-]+$/,yxr=/-([a-z])/g,bxr=/^[^-]+$/,xxr=/^-(webkit|moz|ms|o|khtml)-/,wxr=/^-(ms)-/,Axr=function(t){return!t||bxr.test(t)||vxr.test(t)},Sxr=function(t,e){return e.toUpperCase()},Iet=function(t,e){return"".concat(e,"-")},Txr=function(t,e){return e===void 0&&(e={}),Axr(t)?t:(t=t.toLowerCase(),e.reactCompat?t=t.replace(wxr,Iet):t=t.replace(xxr,Iet),t.replace(yxr,Sxr))};nG.camelCase=Txr;var Cxr=Ti&&Ti.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Oxr=Cxr(hue),kxr=nG;function due(t,e){var r={};return!t||typeof t!="string"||(0,Oxr.default)(t,function(n,i){n&&i&&(r[(0,kxr.camelCase)(n,e)]=i)}),r}due.default=due;var Exr=due;const _xr=wh(Exr),iG=Pet("end"),bm=Pet("start");function Pet(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 Rxr(t){const e=bm(t),r=iG(t);if(e&&r)return{start:e,end:r}}function nN(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Net(t.position):"start"in t||"end"in t?Net(t):"line"in t||"column"in t?fue(t):""}function fue(t){return Bet(t&&t.line)+":"+Bet(t&&t.column)}function Net(t){return fue(t&&t.start)+"-"+fue(t&&t.end)}function Bet(t){return t&&typeof t=="number"?t:1}class Uc extends Error{constructor(e,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let i="",a={},o=!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&&(o=!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 s=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=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=nN(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=o&&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}}Uc.prototype.file="",Uc.prototype.name="",Uc.prototype.reason="",Uc.prototype.message="",Uc.prototype.stack="",Uc.prototype.column=void 0,Uc.prototype.line=void 0,Uc.prototype.ancestors=void 0,Uc.prototype.cause=void 0,Uc.prototype.fatal=void 0,Uc.prototype.place=void 0,Uc.prototype.ruleId=void 0,Uc.prototype.source=void 0;const pue={}.hasOwnProperty,Dxr=new Map,Lxr=/[A-Z]/g,Mxr=new Set(["table","tbody","thead","tfoot","tr"]),Ixr=new Set(["td","th"]),$et="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Pxr(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=Qxr(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=Vxr(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"?dx:rN,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},a=Fet(i,t,void 0);return a&&typeof a!="string"?a:i.create(t,i.Fragment,{children:a||void 0},void 0)}function Fet(t,e,r){if(e.type==="element")return Nxr(t,e,r);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return Bxr(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Fxr(t,e,r);if(e.type==="mdxjsEsm")return $xr(t,e);if(e.type==="root")return zxr(t,e,r);if(e.type==="text")return Uxr(t,e)}function Nxr(t,e,r){const n=t.schema;let i=n;e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(i=dx,t.schema=i),t.ancestors.push(e);const a=Uet(t,e.tagName,!1),o=Gxr(t,e);let s=mue(t,e);return Mxr.has(e.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!Ybr(l):!0})),zet(t,o,a,e),gue(o,s),t.ancestors.pop(),t.schema=n,t.create(e,a,o,r)}function Bxr(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)}iN(t,e.position)}function $xr(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);iN(t,e.position)}function Fxr(t,e,r){const n=t.schema;let i=n;e.name==="svg"&&n.space==="html"&&(i=dx,t.schema=i),t.ancestors.push(e);const a=e.name===null?t.Fragment:Uet(t,e.name,!0),o=Hxr(t,e),s=mue(t,e);return zet(t,o,a,e),gue(o,s),t.ancestors.pop(),t.schema=n,t.create(e,a,o,r)}function zxr(t,e,r){const n={};return gue(n,mue(t,e)),t.create(e,t.Fragment,n,r)}function Uxr(t,e){return e.value}function zet(t,e,r,n){typeof r!="string"&&r!==t.Fragment&&t.passNode&&(e.node=n)}function gue(t,e){if(e.length>0){const r=e.length>1?e:e[0];r&&(t.children=r)}}function Vxr(t,e,r){return n;function n(i,a,o,s){const u=Array.isArray(o.children)?r:e;return s?u(a,o,s):u(a,o)}}function Qxr(t,e){return r;function r(n,i,a,o){const s=Array.isArray(a.children),l=bm(n);return e(i,a,o,s,{columnNumber:l?l.column-1:void 0,fileName:t,lineNumber:l?l.line:void 0},void 0)}}function Gxr(t,e){const r={};let n,i;for(i in e.properties)if(i!=="children"&&pue.call(e.properties,i)){const a=Wxr(t,i,e.properties[i]);if(a){const[o,s]=a;t.tableCellAlignToStyle&&o==="align"&&typeof s=="string"&&Ixr.has(e.tagName)?n=s:r[o]=s}}if(n){const a=r.style||(r.style={});a[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function Hxr(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 o=a.expression;o.type;const s=o.properties[0];s.type,Object.assign(r,t.evaluater.evaluateExpression(s.argument))}else iN(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 s=n.value.data.estree.body[0];s.type,a=t.evaluater.evaluateExpression(s.expression)}else iN(t,e.position);else a=n.value===null?!0:n.value;r[i]=a}return r}function mue(t,e){const r=[];let n=-1;const i=t.passKeys?new Map:Dxr;for(;++ni?0:i+e:e=e>i?i:e,r=r>0?r:0,n.length<1e4)o=Array.from(n),o.unshift(e,r),t.splice(...o);else for(r&&t.splice(e,r);a0?(Id(t,t.length,0,e),t):e}const Het={}.hasOwnProperty;function Wet(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 tg(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Cu=fx(/[A-Za-z]/),Vc=fx(/[\dA-Za-z]/),t2r=fx(/[#-'*+\--9=?A-Z^-~]/);function aG(t){return t!==null&&(t<32||t===127)}const xue=fx(/\d/),r2r=fx(/[\dA-Fa-f]/),n2r=fx(/[!-/:-@[-`{-~]/);function en(t){return t!==null&&t<-2}function Oa(t){return t!==null&&(t<0||t===32)}function gi(t){return t===-2||t===-1||t===32}const oG=fx(new RegExp("\\p{P}|\\p{S}","u")),RA=fx(/\s/);function fx(t){return e;function e(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function VE(t){const e=[];let r=-1,n=0,i=0;for(;++r55295&&a<57344){const s=t.charCodeAt(r+1);a<56320&&s>56319&&s<57344?(o=String.fromCharCode(a,s),i=1):o="�"}else o=String.fromCharCode(a);o&&(e.push(t.slice(n,r),encodeURIComponent(o)),n=r+i+1,o=""),i&&(r+=i,i=0)}return e.join("")+t.slice(n)}function Di(t,e,r,n){const i=n?n-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(l){return gi(l)?(t.enter(r),s(l)):e(l)}function s(l){return gi(l)&&a++o))return;const T=e.events.length;let C=T,k,E;for(;C--;)if(e.events[C][0]==="exit"&&e.events[C][1].type==="chunkFlow"){if(k){E=e.events[C][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 l2r(t,e,r){return Di(t,t.attempt(this.parser.constructs.document,e,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function QE(t){if(t===null||Oa(t)||RA(t))return 1;if(oG(t))return 2}function sG(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};jet(d,-l),jet(f,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...t[n][1].end}},s={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:{...o.start},end:{...s.end}},t[n][1].end={...o.start},t[r][1].start={...s.end},u=[],t[n][1].end.offset-t[n][1].start.offset&&(u=Qf(u,[["enter",t[n][1],e],["exit",t[n][1],e]])),u=Qf(u,[["enter",i,e],["enter",o,e],["exit",o,e],["enter",a,e]]),u=Qf(u,sG(e.parser.constructs.insideSpan.null,t.slice(n+1,r),e)),u=Qf(u,[["exit",a,e],["enter",s,e],["exit",s,e],["exit",i,e]]),t[r][1].end.offset-t[r][1].start.offset?(h=2,u=Qf(u,[["enter",t[r][1],e],["exit",t[r][1],e]])):h=0,Id(t,n-1,r-n+3,u),r=n+u.length-h-2;break}}for(r=-1;++r0&&gi(S)?Di(t,b,"linePrefix",a+1)(S):b(S)}function b(S){return S===null||en(S)?t.check(Jet,m,w)(S):(t.enter("codeFlowValue"),x(S))}function x(S){return S===null||en(S)?(t.exit("codeFlowValue"),b(S)):(t.consume(S),x)}function w(S){return t.exit("codeFenced"),e(S)}function A(S,T,C){let k=0;return E;function E(D){return S.enter("lineEnding"),S.consume(D),S.exit("lineEnding"),_}function _(D){return S.enter("codeFencedFence"),gi(D)?Di(S,P,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):P(D)}function P(D){return D===s?(S.enter("codeFencedFenceSequence"),L(D)):C(D)}function L(D){return D===s?(k++,S.consume(D),L):k>=o?(S.exit("codeFencedFenceSequence"),gi(D)?Di(S,R,"whitespace")(D):R(D)):C(D)}function R(D){return D===null||en(D)?(S.exit("codeFencedFence"),T(D)):C(D)}}}function x2r(t,e,r){const n=this;return i;function i(o){return o===null?r(o):(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),a)}function a(o){return n.parser.lazy[n.now().line]?r(o):e(o)}}const Aue={name:"codeIndented",tokenize:A2r},w2r={partial:!0,tokenize:S2r};function A2r(t,e,r){const n=this;return i;function i(u){return t.enter("codeIndented"),Di(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?o(u):r(u)}function o(u){return u===null?l(u):en(u)?t.attempt(w2r,o,l)(u):(t.enter("codeFlowValue"),s(u))}function s(u){return u===null||en(u)?(t.exit("codeFlowValue"),o(u)):(t.consume(u),s)}function l(u){return t.exit("codeIndented"),e(u)}}function S2r(t,e,r){const n=this;return i;function i(o){return n.parser.lazy[n.now().line]?r(o):en(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),i):Di(t,a,"linePrefix",5)(o)}function a(o){const s=n.events[n.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(o):en(o)?i(o):r(o)}}const T2r={name:"codeText",previous:O2r,resolve:C2r,tokenize:k2r};function C2r(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&&oN(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),oN(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),oN(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(o):t.interrupt(n.parser.constructs.flow,r,e)(o)}}function rtt(t,e,r,n,i,a,o,s,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||aG(y)?r(y):(t.enter(n),t.enter(o),t.enter(s),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(s),t.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(t.exit("chunkString"),t.exit(s),f(y)):y===null||y===60||en(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||Oa(y))?(t.exit("chunkString"),t.exit(s),t.exit(o),t.exit(n),e(y)):h999||p===null||p===91||p===93&&!l||p===94&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?r(p):p===93?(t.exit(a),t.enter(i),t.consume(p),t.exit(i),t.exit(n),e):en(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||en(p)||s++>999?(t.exit("chunkString"),h(p)):(t.consume(p),l||(l=!gi(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(t.consume(p),s++,d):d(p)}}function itt(t,e,r,n,i,a){let o;return s;function s(f){return f===34||f===39||f===40?(t.enter(n),t.enter(i),t.consume(f),t.exit(i),o=f===40?41:f,l):r(f)}function l(f){return f===o?(t.enter(i),t.consume(f),t.exit(i),t.exit(n),e):(t.enter(a),u(f))}function u(f){return f===o?(t.exit(a),l(o)):f===null?r(f):en(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),Di(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===o||f===null||en(f)?(t.exit("chunkString"),u(f)):(t.consume(f),f===92?d:h)}function d(f){return f===o||f===92?(t.consume(f),h):h(f)}}function sN(t,e){let r;return n;function n(i){return en(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),r=!0,n):gi(i)?Di(t,n,r?"linePrefix":"lineSuffix")(i):e(i)}}const P2r={name:"definition",tokenize:B2r},N2r={partial:!0,tokenize:$2r};function B2r(t,e,r){const n=this;let i;return a;function a(p){return t.enter("definition"),o(p)}function o(p){return ntt.call(n,t,s,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function s(p){return i=tg(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 Oa(p)?sN(t,u)(p):u(p)}function u(p){return rtt(t,h,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function h(p){return t.attempt(N2r,d,d)(p)}function d(p){return gi(p)?Di(t,f,"whitespace")(p):f(p)}function f(p){return p===null||en(p)?(t.exit("definition"),n.parser.defined.push(i),e(p)):r(p)}}function $2r(t,e,r){return n;function n(s){return Oa(s)?sN(t,i)(s):r(s)}function i(s){return itt(t,a,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return gi(s)?Di(t,o,"whitespace")(s):o(s)}function o(s){return s===null||en(s)?e(s):r(s)}}const F2r={name:"hardBreakEscape",tokenize:z2r};function z2r(t,e,r){return n;function n(a){return t.enter("hardBreakEscape"),t.consume(a),i}function i(a){return en(a)?(t.exit("hardBreakEscape"),e(a)):r(a)}}const U2r={name:"headingAtx",resolve:V2r,tokenize:Q2r};function V2r(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"},Id(t,n,r-n+1,[["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e]])),t}function Q2r(t,e,r){let n=0;return i;function i(h){return t.enter("atxHeading"),a(h)}function a(h){return t.enter("atxHeadingSequence"),o(h)}function o(h){return h===35&&n++<6?(t.consume(h),o):h===null||Oa(h)?(t.exit("atxHeadingSequence"),s(h)):r(h)}function s(h){return h===35?(t.enter("atxHeadingSequence"),l(h)):h===null||en(h)?(t.exit("atxHeading"),e(h)):gi(h)?Di(t,s,"whitespace")(h):(t.enter("atxHeadingText"),u(h))}function l(h){return h===35?(t.consume(h),l):(t.exit("atxHeadingSequence"),s(h))}function u(h){return h===null||h===35||Oa(h)?(t.exit("atxHeadingText"),s(h)):(t.consume(h),u)}}const G2r=["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"],att=["pre","script","style","textarea"],H2r={concrete:!0,name:"htmlFlow",resolveTo:q2r,tokenize:j2r},W2r={partial:!0,tokenize:K2r},Y2r={partial:!0,tokenize:X2r};function q2r(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 j2r(t,e,r){const n=this;let i,a,o,s,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):Cu(U)?(t.consume(U),o=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,s=0,g):Cu(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(s++)?(t.consume(U),s===Q.length?n.interrupt?e:P:g):r(U)}function m(U){return Cu(U)?(t.consume(U),o=String.fromCharCode(U),v):r(U)}function v(U){if(U===null||U===47||U===62||Oa(U)){const Q=U===47,G=o.toLowerCase();return!Q&&!a&&att.includes(G)?(i=1,n.interrupt?e(U):P(U)):G2r.includes(o.toLowerCase())?(i=6,Q?(t.consume(U),y):n.interrupt?e(U):P(U)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(U):a?b(U):x(U))}return U===45||Vc(U)?(t.consume(U),o+=String.fromCharCode(U),v):r(U)}function y(U){return U===62?(t.consume(U),n.interrupt?e:P):r(U)}function b(U){return gi(U)?(t.consume(U),b):E(U)}function x(U){return U===47?(t.consume(U),E):U===58||U===95||Cu(U)?(t.consume(U),w):gi(U)?(t.consume(U),x):E(U)}function w(U){return U===45||U===46||U===58||U===95||Vc(U)?(t.consume(U),w):A(U)}function A(U){return U===61?(t.consume(U),S):gi(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):gi(U)?(t.consume(U),S):C(U)}function T(U){return U===l?(t.consume(U),l=null,k):U===null||en(U)?r(U):(t.consume(U),T)}function C(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||Oa(U)?A(U):(t.consume(U),C)}function k(U){return U===47||U===62||gi(U)?x(U):r(U)}function E(U){return U===62?(t.consume(U),_):r(U)}function _(U){return U===null||en(U)?P(U):gi(U)?(t.consume(U),_):r(U)}function P(U){return U===45&&i===2?(t.consume(U),M):U===60&&i===1?(t.consume(U),I):U===62&&i===4?(t.consume(U),V):U===63&&i===3?(t.consume(U),B):U===93&&i===5?(t.consume(U),F):en(U)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(W2r,z,L)(U)):U===null||en(U)?(t.exit("htmlFlowData"),L(U)):(t.consume(U),P)}function L(U){return t.check(Y2r,R,z)(U)}function R(U){return t.enter("lineEnding"),t.consume(U),t.exit("lineEnding"),D}function D(U){return U===null||en(U)?L(U):(t.enter("htmlFlowData"),P(U))}function M(U){return U===45?(t.consume(U),B):P(U)}function I(U){return U===47?(t.consume(U),o="",N):P(U)}function N(U){if(U===62){const Q=o.toLowerCase();return att.includes(Q)?(t.consume(U),V):P(U)}return Cu(U)&&o.length<8?(t.consume(U),o+=String.fromCharCode(U),N):P(U)}function F(U){return U===93?(t.consume(U),B):P(U)}function B(U){return U===62?(t.consume(U),V):U===45&&i===2?(t.consume(U),B):P(U)}function V(U){return U===null||en(U)?(t.exit("htmlFlowData"),z(U)):(t.consume(U),V)}function z(U){return t.exit("htmlFlow"),e(U)}}function X2r(t,e,r){const n=this;return i;function i(o){return en(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),a):r(o)}function a(o){return n.parser.lazy[n.now().line]?r(o):e(o)}}function K2r(t,e,r){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(aN,e,r)}}const Z2r={name:"htmlText",tokenize:J2r};function J2r(t,e,r){const n=this;let i,a,o;return s;function s(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):Cu(B)?(t.consume(B),C):r(B)}function u(B){return B===45?(t.consume(B),h):B===91?(t.consume(B),a=0,g):Cu(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):en(B)?(o=d,I(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):en(B)?(o=m,I(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):en(B)?(o=b,I(B)):(t.consume(B),b)}function x(B){return B===null?r(B):B===63?(t.consume(B),w):en(B)?(o=x,I(B)):(t.consume(B),x)}function w(B){return B===62?M(B):x(B)}function A(B){return Cu(B)?(t.consume(B),S):r(B)}function S(B){return B===45||Vc(B)?(t.consume(B),S):T(B)}function T(B){return en(B)?(o=T,I(B)):gi(B)?(t.consume(B),T):M(B)}function C(B){return B===45||Vc(B)?(t.consume(B),C):B===47||B===62||Oa(B)?k(B):r(B)}function k(B){return B===47?(t.consume(B),M):B===58||B===95||Cu(B)?(t.consume(B),E):en(B)?(o=k,I(B)):gi(B)?(t.consume(B),k):M(B)}function E(B){return B===45||B===46||B===58||B===95||Vc(B)?(t.consume(B),E):_(B)}function _(B){return B===61?(t.consume(B),P):en(B)?(o=_,I(B)):gi(B)?(t.consume(B),_):k(B)}function P(B){return B===null||B===60||B===61||B===62||B===96?r(B):B===34||B===39?(t.consume(B),i=B,L):en(B)?(o=P,I(B)):gi(B)?(t.consume(B),P):(t.consume(B),R)}function L(B){return B===i?(t.consume(B),i=void 0,D):B===null?r(B):en(B)?(o=L,I(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||Oa(B)?k(B):(t.consume(B),R)}function D(B){return B===47||B===62||Oa(B)?k(B):r(B)}function M(B){return B===62?(t.consume(B),t.exit("htmlTextData"),t.exit("htmlText"),e):r(B)}function I(B){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(B),t.exit("lineEnding"),N}function N(B){return gi(B)?Di(t,F,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):F(B)}function F(B){return t.enter("htmlTextData"),o(B)}}const Sue={name:"labelEnd",resolveAll:nwr,resolveTo:iwr,tokenize:awr},ewr={tokenize:owr},twr={tokenize:swr},rwr={tokenize:lwr};function nwr(t){let e=-1;const r=[];for(;++e=3&&(u===null||en(u))?(t.exit("thematicBreak"),e(u)):r(u)}function l(u){return u===i?(t.consume(u),n++,l):(t.exit("thematicBreakSequence"),gi(u)?Di(t,s,"whitespace")(u):s(u))}}const Ih={continuation:{tokenize:ywr},exit:xwr,name:"list",tokenize:vwr},gwr={partial:!0,tokenize:wwr},mwr={partial:!0,tokenize:bwr};function vwr(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,o=0;return s;function s(p){const g=n.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!n.containerState.marker||p===n.containerState.marker:xue(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(lG,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 xue(p)&&++o<10?(t.consume(p),l):(!n.interrupt||o<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(aN,n.interrupt?r:h,t.attempt(gwr,f,d))}function h(p){return n.containerState.initialBlankLine=!0,a++,f(p)}function d(p){return gi(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 ywr(t,e,r){const n=this;return n.containerState._closeFlow=void 0,t.check(aN,i,a);function i(s){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,Di(t,e,"listItemIndent",n.containerState.size+1)(s)}function a(s){return n.containerState.furtherBlankLines||!gi(s)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,o(s)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,t.attempt(mwr,e,o)(s))}function o(s){return n.containerState._closeFlow=!0,n.interrupt=void 0,Di(t,t.attempt(Ih,e,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function bwr(t,e,r){const n=this;return Di(t,i,"listItemIndent",n.containerState.size+1);function i(a){const o=n.events[n.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===n.containerState.size?e(a):r(a)}}function xwr(t){t.exit(this.containerState.type)}function wwr(t,e,r){const n=this;return Di(t,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=n.events[n.events.length-1];return!gi(a)&&o&&o[1].type==="listItemPrefixWhitespace"?e(a):r(a)}}const ott={name:"setextUnderline",resolveTo:Awr,tokenize:Swr};function Awr(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 o={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",o,e]),t.splice(a+1,0,["exit",t[n][1],e]),t[n][1].end={...t[a][1].end}):t[n][1]=o,t.push(["exit",o,e]),t}function Swr(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,o(u)):r(u)}function o(u){return t.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(t.consume(u),s):(t.exit("setextHeadingLineSequence"),gi(u)?Di(t,l,"lineSuffix")(u):l(u))}function l(u){return u===null||en(u)?(t.exit("setextHeadingLine"),e(u)):r(u)}}const Twr={tokenize:Cwr};function Cwr(t){const e=this,r=t.attempt(aN,n,t.attempt(this.parser.constructs.flowInitial,i,Di(t,t.attempt(this.parser.constructs.flow,i,t.attempt(R2r,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 Owr={resolveAll:ltt()},kwr=stt("string"),Ewr=stt("text");function stt(t){return{resolveAll:ltt(t==="text"?_wr:void 0),tokenize:e};function e(r){const n=this,i=this.parser.constructs[t],a=r.attempt(i,o,s);return o;function o(h){return u(h)?a(h):s(h)}function s(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 s=o[0];typeof s=="string"?o[0]=s.slice(n):o.shift()}a>0&&o.push(t[i].slice(0,a))}return o}function Mwr(t,e){let r=-1;const n=[];let i;for(;++r0){const se=be.tokenStack[be.tokenStack.length-1];(se[1]||utt).call(be,void 0,se[0])}for(le.position={start:px(Z.length>0?Z[0][1].start:{line:1,column:1,offset:0}),end:px(Z.length>0?Z[Z.length-2][1].end:{line:1,column:1,offset:0})},K=-1;++K0&&(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 Hwr(t,e){const r={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function Wwr(t,e){const r={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function Ywr(t,e){const r=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=String(e.identifier).toUpperCase(),i=VE(n.toLowerCase()),a=t.footnoteOrder.indexOf(n);let o,s=t.footnoteCounts.get(n);s===void 0?(s=0,t.footnoteOrder.push(n),o=t.footnoteOrder.length):o=a+1,s+=1,t.footnoteCounts.set(n,s);const l={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+i,id:r+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};t.patch(e,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,u),t.applyData(e,u)}function qwr(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 jwr(t,e){if(t.options.allowDangerousHtml){const r={type:"raw",value:e.value};return t.patch(e,r),t.applyData(e,r)}}function htt(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 o=i[i.length-1];return o&&o.type==="text"?o.value+=n:i.push({type:"text",value:n}),i}function Xwr(t,e){const r=String(e.identifier).toUpperCase(),n=t.definitionById.get(r);if(!n)return htt(t,e);const i={src:VE(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 Kwr(t,e){const r={src:VE(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 Zwr(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 Jwr(t,e){const r=String(e.identifier).toUpperCase(),n=t.definitionById.get(r);if(!n)return htt(t,e);const i={href:VE(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 eAr(t,e){const r={href:VE(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 tAr(t,e,r){const n=t.all(e),i=r?rAr(r):dtt(e),a={},o=[];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 s=-1;for(;++s0){const se=be.tokenStack[be.tokenStack.length-1];(se[1]||dtt).call(be,void 0,se[0])}for(le.position={start:px(Z.length>0?Z[0][1].start:{line:1,column:1,offset:0}),end:px(Z.length>0?Z[Z.length-2][1].end:{line:1,column:1,offset:0})},K=-1;++K0&&(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 Ywr(t,e){const r={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function qwr(t,e){const r={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function jwr(t,e){const r=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=String(e.identifier).toUpperCase(),i=VE(n.toLowerCase()),a=t.footnoteOrder.indexOf(n);let o,s=t.footnoteCounts.get(n);s===void 0?(s=0,t.footnoteOrder.push(n),o=t.footnoteOrder.length):o=a+1,s+=1,t.footnoteCounts.set(n,s);const l={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+i,id:r+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};t.patch(e,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,u),t.applyData(e,u)}function Xwr(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 Kwr(t,e){if(t.options.allowDangerousHtml){const r={type:"raw",value:e.value};return t.patch(e,r),t.applyData(e,r)}}function ftt(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 o=i[i.length-1];return o&&o.type==="text"?o.value+=n:i.push({type:"text",value:n}),i}function Zwr(t,e){const r=String(e.identifier).toUpperCase(),n=t.definitionById.get(r);if(!n)return ftt(t,e);const i={src:VE(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 Jwr(t,e){const r={src:VE(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 eAr(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 tAr(t,e){const r=String(e.identifier).toUpperCase(),n=t.definitionById.get(r);if(!n)return ftt(t,e);const i={href:VE(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 rAr(t,e){const r={href:VE(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 nAr(t,e,r){const n=t.all(e),i=r?iAr(r):ptt(e),a={},o=[];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 s=-1;for(;++s1}function nAr(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 o={type:"element",tagName:"tbody",properties:{},children:t.wrap(r,!0)},s=bm(e.children[1]),l=iG(e.children[e.children.length-1]);s&&l&&(o.position={start:s,end:l}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,a),t.applyData(e,a)}function lAr(t,e,r){const n=r?r.children:void 0,a=(n?n.indexOf(e):1)===0?"th":"td",o=r&&r.type==="table"?r.align:void 0,s=o?o.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(gtt(e.slice(i),i>0,!1)),a.join("")}function gtt(t,e,r){let n=0,i=t.length;if(e){let a=t.codePointAt(n);for(;a===ftt||a===ptt;)n++,a=t.codePointAt(n)}if(r){let a=t.codePointAt(i-1);for(;a===ftt||a===ptt;)i--,a=t.codePointAt(i-1)}return i>n?t.slice(n,i):""}function hAr(t,e){const r={type:"text",value:uAr(String(e.value))};return t.patch(e,r),t.applyData(e,r)}function dAr(t,e){const r={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,r),t.applyData(e,r)}const fAr={blockquote:Vwr,break:Qwr,code:Gwr,delete:Hwr,emphasis:Wwr,footnoteReference:Ywr,heading:qwr,html:jwr,imageReference:Xwr,image:Kwr,inlineCode:Zwr,linkReference:Jwr,link:eAr,listItem:tAr,list:nAr,paragraph:iAr,root:aAr,strong:oAr,table:sAr,tableCell:cAr,tableRow:lAr,text:hAr,thematicBreak:dAr,toml:cG,yaml:cG,definition:cG,footnoteDefinition:cG};function cG(){}const mtt=-1,uG=0,lN=1,hG=2,Cue=3,Oue=4,kue=5,Eue=6,vtt=7,ytt=8,pAr=typeof self=="object"?self:globalThis,btt=(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 pAr[t](e)},gAr=(t,e)=>{const r=(i,a)=>(t.set(a,i),i),n=i=>{if(t.has(i))return t.get(i);const[a,o]=e[i];switch(a){case uG:case mtt:return r(o,i);case lN:{const s=r([],i);for(const l of o)s.push(n(l));return s}case hG:{const s=r({},i);for(const[l,u]of o)s[n(l)]=n(u);return s}case Cue:return r(new Date(o),i);case Oue:{const{source:s,flags:l}=o;return r(new RegExp(s,l),i)}case kue:{const s=r(new Map,i);for(const[l,u]of o)s.set(n(l),n(u));return s}case Eue:{const s=r(new Set,i);for(const l of o)s.add(n(l));return s}case vtt:{const{name:s,message:l}=o;return r(btt(s,l),i)}case ytt:return r(BigInt(o),i);case"BigInt":return r(Object(BigInt(o)),i);case"ArrayBuffer":return r(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:s}=new Uint8Array(o);return r(new DataView(s),o)}}return r(btt(a,o),i)};return n},xtt=t=>gAr(new Map,t)(0),GE="",{toString:mAr}={},{keys:vAr}=Object,cN=t=>{const e=typeof t;if(e!=="object"||!t)return[uG,e];const r=mAr.call(t).slice(8,-1);switch(r){case"Array":return[lN,GE];case"Object":return[hG,GE];case"Date":return[Cue,GE];case"RegExp":return[Oue,GE];case"Map":return[kue,GE];case"Set":return[Eue,GE];case"DataView":return[lN,r]}return r.includes("Array")?[lN,r]:r.includes("Error")?[vtt,r]:[hG,r]},dG=([t,e])=>t===uG&&(e==="function"||e==="symbol"),yAr=(t,e,r,n)=>{const i=(o,s)=>{const l=n.push(o)-1;return r.set(s,l),l},a=o=>{if(r.has(o))return r.get(o);let[s,l]=cN(o);switch(s){case uG:{let h=o;switch(l){case"bigint":s=ytt,h=o.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);h=null;break;case"undefined":return i([mtt],o)}return i([s,h],o)}case lN:{if(l){let f=o;return l==="DataView"?f=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(f=new Uint8Array(o)),i([l,[...f]],o)}const h=[],d=i([s,h],o);for(const f of o)h.push(a(f));return d}case hG:{if(l)switch(l){case"BigInt":return i([l,o.toString()],o);case"Boolean":case"Number":case"String":return i([l,o.valueOf()],o)}if(e&&"toJSON"in o)return a(o.toJSON());const h=[],d=i([s,h],o);for(const f of vAr(o))(t||!dG(cN(o[f])))&&h.push([a(f),a(o[f])]);return d}case Cue:return i([s,o.toISOString()],o);case Oue:{const{source:h,flags:d}=o;return i([s,{source:h,flags:d}],o)}case kue:{const h=[],d=i([s,h],o);for(const[f,p]of o)(t||!(dG(cN(f))||dG(cN(p))))&&h.push([a(f),a(p)]);return d}case Eue:{const h=[],d=i([s,h],o);for(const f of o)(t||!dG(cN(f)))&&h.push(a(f));return d}}const{message:u}=o;return i([s,{name:l,message:u}],o)};return a},wtt=(t,{json:e,lossy:r}={})=>{const n=[];return yAr(!(e||r),!!e,new Map,n)(t),n},HE=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?xtt(wtt(t,e)):structuredClone(t):(t,e)=>xtt(wtt(t,e));function bAr(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 xAr(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function wAr(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=t.options.footnoteBackContent||bAr,n=t.options.footnoteBackLabel||xAr,i=t.options.footnoteLabel||"Footnotes",a=t.options.footnoteLabelTagName||"h2",o=t.options.footnoteLabelProperties||{className:["sr-only"]},s=[];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),s.push(y)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...HE(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`});const u={type:"element",tagName:"li",properties:a,children:o};return t.patch(e,u),t.applyData(e,u)}function iAr(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const r=t.children;let n=-1;for(;!e&&++n1}function aAr(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 o={type:"element",tagName:"tbody",properties:{},children:t.wrap(r,!0)},s=bm(e.children[1]),l=iG(e.children[e.children.length-1]);s&&l&&(o.position={start:s,end:l}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,a),t.applyData(e,a)}function uAr(t,e,r){const n=r?r.children:void 0,a=(n?n.indexOf(e):1)===0?"th":"td",o=r&&r.type==="table"?r.align:void 0,s=o?o.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(vtt(e.slice(i),i>0,!1)),a.join("")}function vtt(t,e,r){let n=0,i=t.length;if(e){let a=t.codePointAt(n);for(;a===gtt||a===mtt;)n++,a=t.codePointAt(n)}if(r){let a=t.codePointAt(i-1);for(;a===gtt||a===mtt;)i--,a=t.codePointAt(i-1)}return i>n?t.slice(n,i):""}function fAr(t,e){const r={type:"text",value:dAr(String(e.value))};return t.patch(e,r),t.applyData(e,r)}function pAr(t,e){const r={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,r),t.applyData(e,r)}const gAr={blockquote:Gwr,break:Hwr,code:Wwr,delete:Ywr,emphasis:qwr,footnoteReference:jwr,heading:Xwr,html:Kwr,imageReference:Zwr,image:Jwr,inlineCode:eAr,linkReference:tAr,link:rAr,listItem:nAr,list:aAr,paragraph:oAr,root:sAr,strong:lAr,table:cAr,tableCell:hAr,tableRow:uAr,text:fAr,thematicBreak:pAr,toml:cG,yaml:cG,definition:cG,footnoteDefinition:cG};function cG(){}const ytt=-1,uG=0,lN=1,hG=2,Cue=3,Oue=4,kue=5,Eue=6,btt=7,xtt=8,mAr=typeof self=="object"?self:globalThis,wtt=(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 mAr[t](e)},vAr=(t,e)=>{const r=(i,a)=>(t.set(a,i),i),n=i=>{if(t.has(i))return t.get(i);const[a,o]=e[i];switch(a){case uG:case ytt:return r(o,i);case lN:{const s=r([],i);for(const l of o)s.push(n(l));return s}case hG:{const s=r({},i);for(const[l,u]of o)s[n(l)]=n(u);return s}case Cue:return r(new Date(o),i);case Oue:{const{source:s,flags:l}=o;return r(new RegExp(s,l),i)}case kue:{const s=r(new Map,i);for(const[l,u]of o)s.set(n(l),n(u));return s}case Eue:{const s=r(new Set,i);for(const l of o)s.add(n(l));return s}case btt:{const{name:s,message:l}=o;return r(wtt(s,l),i)}case xtt:return r(BigInt(o),i);case"BigInt":return r(Object(BigInt(o)),i);case"ArrayBuffer":return r(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:s}=new Uint8Array(o);return r(new DataView(s),o)}}return r(wtt(a,o),i)};return n},Att=t=>vAr(new Map,t)(0),GE="",{toString:yAr}={},{keys:bAr}=Object,cN=t=>{const e=typeof t;if(e!=="object"||!t)return[uG,e];const r=yAr.call(t).slice(8,-1);switch(r){case"Array":return[lN,GE];case"Object":return[hG,GE];case"Date":return[Cue,GE];case"RegExp":return[Oue,GE];case"Map":return[kue,GE];case"Set":return[Eue,GE];case"DataView":return[lN,r]}return r.includes("Array")?[lN,r]:r.includes("Error")?[btt,r]:[hG,r]},dG=([t,e])=>t===uG&&(e==="function"||e==="symbol"),xAr=(t,e,r,n)=>{const i=(o,s)=>{const l=n.push(o)-1;return r.set(s,l),l},a=o=>{if(r.has(o))return r.get(o);let[s,l]=cN(o);switch(s){case uG:{let h=o;switch(l){case"bigint":s=xtt,h=o.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);h=null;break;case"undefined":return i([ytt],o)}return i([s,h],o)}case lN:{if(l){let f=o;return l==="DataView"?f=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(f=new Uint8Array(o)),i([l,[...f]],o)}const h=[],d=i([s,h],o);for(const f of o)h.push(a(f));return d}case hG:{if(l)switch(l){case"BigInt":return i([l,o.toString()],o);case"Boolean":case"Number":case"String":return i([l,o.valueOf()],o)}if(e&&"toJSON"in o)return a(o.toJSON());const h=[],d=i([s,h],o);for(const f of bAr(o))(t||!dG(cN(o[f])))&&h.push([a(f),a(o[f])]);return d}case Cue:return i([s,o.toISOString()],o);case Oue:{const{source:h,flags:d}=o;return i([s,{source:h,flags:d}],o)}case kue:{const h=[],d=i([s,h],o);for(const[f,p]of o)(t||!(dG(cN(f))||dG(cN(p))))&&h.push([a(f),a(p)]);return d}case Eue:{const h=[],d=i([s,h],o);for(const f of o)(t||!dG(cN(f)))&&h.push(a(f));return d}}const{message:u}=o;return i([s,{name:l,message:u}],o)};return a},Stt=(t,{json:e,lossy:r}={})=>{const n=[];return xAr(!(e||r),!!e,new Map,n)(t),n},HE=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?Att(Stt(t,e)):structuredClone(t):(t,e)=>Att(Stt(t,e));function wAr(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 AAr(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function SAr(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=t.options.footnoteBackContent||wAr,n=t.options.footnoteBackLabel||AAr,i=t.options.footnoteLabel||"Footnotes",a=t.options.footnoteLabelTagName||"h2",o=t.options.footnoteLabelProperties||{className:["sr-only"]},s=[];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),s.push(y)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...HE(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:t.wrap(s,!0)},{type:"text",value:` -`}]}}const uN=function(t){if(t==null)return CAr;if(typeof t=="function")return fG(t);if(typeof t=="object")return Array.isArray(t)?AAr(t):SAr(t);if(typeof t=="string")return TAr(t);throw new Error("Expected function, string, or object as test")};function AAr(t){const e=[];let r=-1;for(;++r":""))+")"})}return f;function f(){let p=Att,g,m,v;if((!e||a(l,u,h[h.length-1]||void 0))&&(p=_Ar(r(l,h)),p[0]===_ue))return p;if("children"in l&&l.children){const y=l;if(y.children&&p[0]!==EAr)for(m=(n?y.children.length:-1)+o,v=h.concat(y);m>-1&&m":""))+")"})}return f;function f(){let p=Ttt,g,m,v;if((!e||a(l,u,h[h.length-1]||void 0))&&(p=DAr(r(l,h)),p[0]===_ue))return p;if("children"in l&&l.children){const y=l;if(y.children&&p[0]!==RAr)for(m=(n?y.children.length:-1)+o,v=h.concat(y);m>-1&&m0&&r.push({type:"text",value:` -`}),r}function Ttt(t){let e=0,r=t.charCodeAt(e);for(;r===9||r===32;)e++,r=t.charCodeAt(e);return t.slice(e)}function Ctt(t,e){const r=DAr(t,e),n=r.one(t,void 0),i=wAr(r),a=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return i&&a.children.push({type:"text",value:` -`},i),a}function NAr(t,e){return t&&"run"in t?async function(r,n){const i=Ctt(r,{file:n,...e});await t.run(i,n)}:function(r,n){return Ctt(r,{file:n,...t||e})}}function Ott(t){if(t)throw t}var pG=Object.prototype.hasOwnProperty,ktt=Object.prototype.toString,Ett=Object.defineProperty,_tt=Object.getOwnPropertyDescriptor,Rtt=function(e){return typeof Array.isArray=="function"?Array.isArray(e):ktt.call(e)==="[object Array]"},Dtt=function(e){if(!e||ktt.call(e)!=="[object Object]")return!1;var r=pG.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&pG.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||pG.call(e,i)},Ltt=function(e,r){Ett&&r.name==="__proto__"?Ett(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},Mtt=function(e,r){if(r==="__proto__")if(pG.call(e,r)){if(_tt)return _tt(e,r).value}else return;return e[r]},BAr=function t(){var e,r,n,i,a,o,s=arguments[0],l=1,u=arguments.length,h=!1;for(typeof s=="boolean"&&(h=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});lo.length;let l;s&&o.push(i);try{l=t.apply(this,o)}catch(u){const h=u;if(s&&r)throw h;return i(h)}s||(l&&l.then&&typeof l.then=="function"?l.then(a,i):l instanceof Error?i(l):a(l))}function i(o,...s){r||(r=!0,e(o,...s))}function a(o){i(null,o)}}const xm={basename:zAr,dirname:UAr,extname:VAr,join:QAr,sep:"/"};function zAr(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');dN(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 o=-1,s=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(a){r=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(t.codePointAt(i)===e.codePointAt(s--)?s<0&&(n=i):(s=-1,n=o));return r===n?n=o:n<0&&(n=t.length),t.slice(r,n)}function UAr(t){if(dN(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 VAr(t){dN(t);let e=t.length,r=-1,n=0,i=-1,a=0,o;for(;e--;){const s=t.codePointAt(e);if(s===47){if(o){n=e+1;break}continue}r<0&&(o=!0,r=e+1),s===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 QAr(...t){let e=-1,r;for(;++e0&&t.codePointAt(t.length-1)===47&&(r+="/"),e?"/"+r:r}function HAr(t,e){let r="",n=0,i=-1,a=0,o=-1,s,l;for(;++o<=t.length;){if(o2){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=o,a=0;continue}}else if(r.length>0){r="",n=0,i=o,a=0;continue}}e&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+t.slice(i+1,o):r=t.slice(i+1,o),n=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return r}function dN(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const WAr={cwd:YAr};function YAr(){return"/"}function Mue(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function qAr(t){if(typeof t=="string")t=new URL(t);else if(!Mue(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 jAr(t)}function jAr(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];Lue(m)&&Lue(p)&&(p=Due(!0,m,p)),n[f]=[u,p,...g]}}}}const JAr=new Bue().freeze();function $ue(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Fue(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function zue(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 Ntt(t){if(!Lue(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Btt(t,e,r){if(!r)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function gG(t){return eSr(t)?t:new Itt(t)}function eSr(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function tSr(t){return typeof t=="string"||rSr(t)}function rSr(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const nSr="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",$tt=[],Ftt={allowDangerousHtml:!0},iSr=/^(https?|ircs?|mailto|xmpp)$/i,aSr=[{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 oSr(t){const e=sSr(t),r=lSr(t);return cSr(e.runSync(e.parse(r),r),t)}function sSr(t){const e=t.rehypePlugins||$tt,r=t.remarkPlugins||$tt,n=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Ftt}:Ftt;return JAr().use(Uwr).use(r).use(NAr,n).use(e)}function lSr(t){const e=t.children||"",r=new Itt;return typeof e=="string"&&(r.value=e),r}function cSr(t,e){const r=e.allowedElements,n=e.allowElement,i=e.components,a=e.disallowedElements,o=e.skipHtml,s=e.unwrapDisallowed,l=e.urlTransform||uSr;for(const h of aSr)Object.hasOwn(e,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+nSr+h.id,void 0);return e.className&&(t={type:"element",tagName:"div",properties:{className:e.className},children:t.type==="root"?t.children:[t]}),hN(t,u),Mxr(t,{Fragment:H.Fragment,components:i,ignoreInvalidStyle:!0,jsx:H.jsx,jsxs:H.jsxs,passKeys:!0,passNode:!0});function u(h,d,f){if(h.type==="raw"&&f&&typeof d=="number")return o?f.children.splice(d,1):f.children[d]={type:"text",value:h.value},d;if(h.type==="element"){let p;for(p in vue)if(Object.hasOwn(vue,p)&&Object.hasOwn(h.properties,p)){const g=h.properties[p],m=vue[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 s&&h.children?f.children.splice(d,1,...h.children):f.children.splice(d,1),d}}}function uSr(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||iSr.test(t.slice(0,e))?t:""}function Uue(){return Uue=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=Utt(t,"(");let a=Utt(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 Vtt(t,e){const r=t.input.charCodeAt(t.index-1);return(t.index===0||RA(r)||oG(r))&&(!e||r!==47)}Qtt.peek=$Sr;function RSr(){this.buffer()}function DSr(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function LSr(){this.buffer()}function MSr(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function ISr(t){const e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=tg(this.sliceSerialize(t)).toLowerCase(),r.label=e}function PSr(t){this.exit(t)}function NSr(t){const e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=tg(this.sliceSerialize(t)).toLowerCase(),r.label=e}function BSr(t){this.exit(t)}function $Sr(){return"["}function Qtt(t,e,r,n){const i=r.createTracker(n);let a=i.move("[^");const o=r.enter("footnoteReference"),s=r.enter("reference");return a+=i.move(r.safe(r.associationId(t),{after:"]",before:a})),s(),o(),a+=i.move("]"),a}function FSr(){return{enter:{gfmFootnoteCallString:RSr,gfmFootnoteCall:DSr,gfmFootnoteDefinitionLabelString:LSr,gfmFootnoteDefinition:MSr},exit:{gfmFootnoteCallString:ISr,gfmFootnoteCall:PSr,gfmFootnoteDefinitionLabelString:NSr,gfmFootnoteDefinition:BSr}}}function zSr(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:r,footnoteReference:Qtt},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(n,i,a,o){const s=a.createTracker(o);let l=s.move("[^");const u=a.enter("footnoteDefinition"),h=a.enter("label");return l+=s.move(a.safe(a.associationId(n),{before:l,after:"]"})),h(),l+=s.move("]:"),n.children&&n.children.length>0&&(s.shift(4),l+=s.move((e?` -`:" ")+a.indentLines(a.containerFlow(n,s.current()),e?Gtt:USr))),u(),l}}function USr(t,e,r){return e===0?t:Gtt(t,e,r)}function Gtt(t,e,r){return(r?"":" ")+t}const VSr=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Htt.peek=YSr;function QSr(){return{canContainEols:["delete"],enter:{strikethrough:HSr},exit:{strikethrough:WSr}}}function GSr(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:VSr}],handlers:{delete:Htt}}}function HSr(t){this.enter({type:"delete",children:[]},t)}function WSr(t){this.exit(t)}function Htt(t,e,r,n){const i=r.createTracker(n),a=r.enter("strikethrough");let o=i.move("~~");return o+=r.containerPhrasing(t,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),a(),o}function YSr(){return"~"}function qSr(t){return t.length}function jSr(t,e){const r=e||{},n=(r.align||[]).concat(),i=r.stringLength||qSr,a=[],o=[],s=[],l=[];let u=0,h=-1;for(;++hu&&(u=t[h].length);++yl[y])&&(l[y]=x)}m.push(b)}o[h]=m,s[h]=v}let d=-1;if(typeof n=="object"&&"length"in n)for(;++dl[d]&&(l[d]=b),p[d]=b),f[d]=x}o.splice(1,0,f),s.splice(1,0,p),h=-1;const g=[];for(;++h "),a.shift(2);const o=r.indentLines(r.containerFlow(t,a.current()),ZSr);return i(),o}function ZSr(t,e,r){return">"+(r?"":" ")+t}function JSr(t,e){return jtt(t,e.inConstruct,!0)&&!jtt(t,e.notInConstruct,!1)}function jtt(t,e,r){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return r;let n=-1;for(;++no&&(o=a):a=1,i=n+e.length,n=r.indexOf(e,i);return o}function tTr(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 rTr(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 nTr(t,e,r,n){const i=rTr(r),a=t.value||"",o=i==="`"?"GraveAccent":"Tilde";if(tTr(t,r)){const d=r.enter("codeIndented"),f=r.indentLines(a,iTr);return d(),f}const s=r.createTracker(n),l=i.repeat(Math.max(eTr(a,i)+1,3)),u=r.enter("codeFenced");let h=s.move(l);if(t.lang){const d=r.enter(`codeFencedLang${o}`);h+=s.move(r.safe(t.lang,{before:h,after:" ",encode:["`"],...s.current()})),d()}if(t.lang&&t.meta){const d=r.enter(`codeFencedMeta${o}`);h+=s.move(" "),h+=s.move(r.safe(t.meta,{before:h,after:` +`}),r}function Ott(t){let e=0,r=t.charCodeAt(e);for(;r===9||r===32;)e++,r=t.charCodeAt(e);return t.slice(e)}function ktt(t,e){const r=MAr(t,e),n=r.one(t,void 0),i=SAr(r),a=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return i&&a.children.push({type:"text",value:` +`},i),a}function $Ar(t,e){return t&&"run"in t?async function(r,n){const i=ktt(r,{file:n,...e});await t.run(i,n)}:function(r,n){return ktt(r,{file:n,...t||e})}}function Ett(t){if(t)throw t}var pG=Object.prototype.hasOwnProperty,_tt=Object.prototype.toString,Rtt=Object.defineProperty,Dtt=Object.getOwnPropertyDescriptor,Ltt=function(e){return typeof Array.isArray=="function"?Array.isArray(e):_tt.call(e)==="[object Array]"},Mtt=function(e){if(!e||_tt.call(e)!=="[object Object]")return!1;var r=pG.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&pG.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||pG.call(e,i)},Itt=function(e,r){Rtt&&r.name==="__proto__"?Rtt(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},Ptt=function(e,r){if(r==="__proto__")if(pG.call(e,r)){if(Dtt)return Dtt(e,r).value}else return;return e[r]},FAr=function t(){var e,r,n,i,a,o,s=arguments[0],l=1,u=arguments.length,h=!1;for(typeof s=="boolean"&&(h=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});lo.length;let l;s&&o.push(i);try{l=t.apply(this,o)}catch(u){const h=u;if(s&&r)throw h;return i(h)}s||(l&&l.then&&typeof l.then=="function"?l.then(a,i):l instanceof Error?i(l):a(l))}function i(o,...s){r||(r=!0,e(o,...s))}function a(o){i(null,o)}}const xm={basename:VAr,dirname:QAr,extname:GAr,join:HAr,sep:"/"};function VAr(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');dN(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 o=-1,s=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(a){r=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(t.codePointAt(i)===e.codePointAt(s--)?s<0&&(n=i):(s=-1,n=o));return r===n?n=o:n<0&&(n=t.length),t.slice(r,n)}function QAr(t){if(dN(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 GAr(t){dN(t);let e=t.length,r=-1,n=0,i=-1,a=0,o;for(;e--;){const s=t.codePointAt(e);if(s===47){if(o){n=e+1;break}continue}r<0&&(o=!0,r=e+1),s===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 HAr(...t){let e=-1,r;for(;++e0&&t.codePointAt(t.length-1)===47&&(r+="/"),e?"/"+r:r}function YAr(t,e){let r="",n=0,i=-1,a=0,o=-1,s,l;for(;++o<=t.length;){if(o2){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=o,a=0;continue}}else if(r.length>0){r="",n=0,i=o,a=0;continue}}e&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+t.slice(i+1,o):r=t.slice(i+1,o),n=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return r}function dN(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const qAr={cwd:jAr};function jAr(){return"/"}function Mue(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function XAr(t){if(typeof t=="string")t=new URL(t);else if(!Mue(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 KAr(t)}function KAr(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];Lue(m)&&Lue(p)&&(p=Due(!0,m,p)),n[f]=[u,p,...g]}}}}const tSr=new Bue().freeze();function $ue(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Fue(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function zue(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 $tt(t){if(!Lue(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Ftt(t,e,r){if(!r)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function gG(t){return rSr(t)?t:new Ntt(t)}function rSr(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function nSr(t){return typeof t=="string"||iSr(t)}function iSr(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const aSr="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ztt=[],Utt={allowDangerousHtml:!0},oSr=/^(https?|ircs?|mailto|xmpp)$/i,sSr=[{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 lSr(t){const e=cSr(t),r=uSr(t);return hSr(e.runSync(e.parse(r),r),t)}function cSr(t){const e=t.rehypePlugins||ztt,r=t.remarkPlugins||ztt,n=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Utt}:Utt;return tSr().use(Qwr).use(r).use($Ar,n).use(e)}function uSr(t){const e=t.children||"",r=new Ntt;return typeof e=="string"&&(r.value=e),r}function hSr(t,e){const r=e.allowedElements,n=e.allowElement,i=e.components,a=e.disallowedElements,o=e.skipHtml,s=e.unwrapDisallowed,l=e.urlTransform||dSr;for(const h of sSr)Object.hasOwn(e,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+aSr+h.id,void 0);return e.className&&(t={type:"element",tagName:"div",properties:{className:e.className},children:t.type==="root"?t.children:[t]}),hN(t,u),Pxr(t,{Fragment:H.Fragment,components:i,ignoreInvalidStyle:!0,jsx:H.jsx,jsxs:H.jsxs,passKeys:!0,passNode:!0});function u(h,d,f){if(h.type==="raw"&&f&&typeof d=="number")return o?f.children.splice(d,1):f.children[d]={type:"text",value:h.value},d;if(h.type==="element"){let p;for(p in vue)if(Object.hasOwn(vue,p)&&Object.hasOwn(h.properties,p)){const g=h.properties[p],m=vue[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 s&&h.children?f.children.splice(d,1,...h.children):f.children.splice(d,1),d}}}function dSr(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||oSr.test(t.slice(0,e))?t:""}function Uue(){return Uue=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=Qtt(t,"(");let a=Qtt(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 Gtt(t,e){const r=t.input.charCodeAt(t.index-1);return(t.index===0||RA(r)||oG(r))&&(!e||r!==47)}Htt.peek=zSr;function LSr(){this.buffer()}function MSr(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function ISr(){this.buffer()}function PSr(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function NSr(t){const e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=tg(this.sliceSerialize(t)).toLowerCase(),r.label=e}function BSr(t){this.exit(t)}function $Sr(t){const e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=tg(this.sliceSerialize(t)).toLowerCase(),r.label=e}function FSr(t){this.exit(t)}function zSr(){return"["}function Htt(t,e,r,n){const i=r.createTracker(n);let a=i.move("[^");const o=r.enter("footnoteReference"),s=r.enter("reference");return a+=i.move(r.safe(r.associationId(t),{after:"]",before:a})),s(),o(),a+=i.move("]"),a}function USr(){return{enter:{gfmFootnoteCallString:LSr,gfmFootnoteCall:MSr,gfmFootnoteDefinitionLabelString:ISr,gfmFootnoteDefinition:PSr},exit:{gfmFootnoteCallString:NSr,gfmFootnoteCall:BSr,gfmFootnoteDefinitionLabelString:$Sr,gfmFootnoteDefinition:FSr}}}function VSr(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:r,footnoteReference:Htt},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(n,i,a,o){const s=a.createTracker(o);let l=s.move("[^");const u=a.enter("footnoteDefinition"),h=a.enter("label");return l+=s.move(a.safe(a.associationId(n),{before:l,after:"]"})),h(),l+=s.move("]:"),n.children&&n.children.length>0&&(s.shift(4),l+=s.move((e?` +`:" ")+a.indentLines(a.containerFlow(n,s.current()),e?Wtt:QSr))),u(),l}}function QSr(t,e,r){return e===0?t:Wtt(t,e,r)}function Wtt(t,e,r){return(r?"":" ")+t}const GSr=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ytt.peek=jSr;function HSr(){return{canContainEols:["delete"],enter:{strikethrough:YSr},exit:{strikethrough:qSr}}}function WSr(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:GSr}],handlers:{delete:Ytt}}}function YSr(t){this.enter({type:"delete",children:[]},t)}function qSr(t){this.exit(t)}function Ytt(t,e,r,n){const i=r.createTracker(n),a=r.enter("strikethrough");let o=i.move("~~");return o+=r.containerPhrasing(t,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),a(),o}function jSr(){return"~"}function XSr(t){return t.length}function KSr(t,e){const r=e||{},n=(r.align||[]).concat(),i=r.stringLength||XSr,a=[],o=[],s=[],l=[];let u=0,h=-1;for(;++hu&&(u=t[h].length);++yl[y])&&(l[y]=x)}m.push(b)}o[h]=m,s[h]=v}let d=-1;if(typeof n=="object"&&"length"in n)for(;++dl[d]&&(l[d]=b),p[d]=b),f[d]=x}o.splice(1,0,f),s.splice(1,0,p),h=-1;const g=[];for(;++h "),a.shift(2);const o=r.indentLines(r.containerFlow(t,a.current()),eTr);return i(),o}function eTr(t,e,r){return">"+(r?"":" ")+t}function tTr(t,e){return Ktt(t,e.inConstruct,!0)&&!Ktt(t,e.notInConstruct,!1)}function Ktt(t,e,r){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return r;let n=-1;for(;++no&&(o=a):a=1,i=n+e.length,n=r.indexOf(e,i);return o}function nTr(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 iTr(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 aTr(t,e,r,n){const i=iTr(r),a=t.value||"",o=i==="`"?"GraveAccent":"Tilde";if(nTr(t,r)){const d=r.enter("codeIndented"),f=r.indentLines(a,oTr);return d(),f}const s=r.createTracker(n),l=i.repeat(Math.max(rTr(a,i)+1,3)),u=r.enter("codeFenced");let h=s.move(l);if(t.lang){const d=r.enter(`codeFencedLang${o}`);h+=s.move(r.safe(t.lang,{before:h,after:" ",encode:["`"],...s.current()})),d()}if(t.lang&&t.meta){const d=r.enter(`codeFencedMeta${o}`);h+=s.move(" "),h+=s.move(r.safe(t.meta,{before:h,after:` `,encode:["`"],...s.current()})),d()}return h+=s.move(` `),a&&(h+=s.move(a+` -`)),h+=s.move(l),u(),h}function iTr(t,e,r){return(r?"":" ")+t}function Hue(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function aTr(t,e,r,n){const i=Hue(r),a=i==='"'?"Quote":"Apostrophe",o=r.enter("definition");let s=r.enter("label");const l=r.createTracker(n);let u=l.move("[");return u+=l.move(r.safe(r.associationId(t),{before:u,after:"]",...l.current()})),u+=l.move("]: "),s(),!t.url||/[\0- \u007F]/.test(t.url)?(s=r.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(r.safe(t.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(s=r.enter("destinationRaw"),u+=l.move(r.safe(t.url,{before:u,after:t.title?" ":` -`,...l.current()}))),s(),t.title&&(s=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),s()),o(),u}function oTr(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function fN(t){return"&#x"+t.toString(16).toUpperCase()+";"}function mG(t,e,r){const n=QE(t),i=QE(e);return n===void 0?i===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ktt.peek=sTr;function Ktt(t,e,r,n){const i=oTr(r),a=r.enter("emphasis"),o=r.createTracker(n),s=o.move(i);let l=o.move(r.containerPhrasing(t,{after:i,before:s,...o.current()}));const u=l.charCodeAt(0),h=mG(n.before.charCodeAt(n.before.length-1),u,i);h.inside&&(l=fN(u)+l.slice(1));const d=l.charCodeAt(l.length-1),f=mG(n.after.charCodeAt(0),d,i);f.inside&&(l=l.slice(0,-1)+fN(d));const p=o.move(i);return a(),r.attentionEncodeSurroundingInfo={after:f.outside,before:h.outside},s+l+p}function sTr(t,e,r){return r.options.emphasis||"*"}function lTr(t,e){let r=!1;return hN(t,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return r=!0,_ue}),!!((!t.depth||t.depth<3)&&yue(t)&&(e.options.setext||r))}function cTr(t,e,r,n){const i=Math.max(Math.min(6,t.depth||1),1),a=r.createTracker(n);if(lTr(t,r)){const h=r.enter("headingSetext"),d=r.enter("phrasing"),f=r.containerPhrasing(t,{...a.current(),before:` +`)),h+=s.move(l),u(),h}function oTr(t,e,r){return(r?"":" ")+t}function Hue(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function sTr(t,e,r,n){const i=Hue(r),a=i==='"'?"Quote":"Apostrophe",o=r.enter("definition");let s=r.enter("label");const l=r.createTracker(n);let u=l.move("[");return u+=l.move(r.safe(r.associationId(t),{before:u,after:"]",...l.current()})),u+=l.move("]: "),s(),!t.url||/[\0- \u007F]/.test(t.url)?(s=r.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(r.safe(t.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(s=r.enter("destinationRaw"),u+=l.move(r.safe(t.url,{before:u,after:t.title?" ":` +`,...l.current()}))),s(),t.title&&(s=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),s()),o(),u}function lTr(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function fN(t){return"&#x"+t.toString(16).toUpperCase()+";"}function mG(t,e,r){const n=QE(t),i=QE(e);return n===void 0?i===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Jtt.peek=cTr;function Jtt(t,e,r,n){const i=lTr(r),a=r.enter("emphasis"),o=r.createTracker(n),s=o.move(i);let l=o.move(r.containerPhrasing(t,{after:i,before:s,...o.current()}));const u=l.charCodeAt(0),h=mG(n.before.charCodeAt(n.before.length-1),u,i);h.inside&&(l=fN(u)+l.slice(1));const d=l.charCodeAt(l.length-1),f=mG(n.after.charCodeAt(0),d,i);f.inside&&(l=l.slice(0,-1)+fN(d));const p=o.move(i);return a(),r.attentionEncodeSurroundingInfo={after:f.outside,before:h.outside},s+l+p}function cTr(t,e,r){return r.options.emphasis||"*"}function uTr(t,e){let r=!1;return hN(t,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return r=!0,_ue}),!!((!t.depth||t.depth<3)&&yue(t)&&(e.options.setext||r))}function hTr(t,e,r,n){const i=Math.max(Math.min(6,t.depth||1),1),a=r.createTracker(n);if(uTr(t,r)){const h=r.enter("headingSetext"),d=r.enter("phrasing"),f=r.containerPhrasing(t,{...a.current(),before:` `,after:` `});return d(),h(),f+` `+(i===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(` `))+1))}const o="#".repeat(i),s=r.enter("headingAtx"),l=r.enter("phrasing");a.move(o+" ");let u=r.containerPhrasing(t,{before:"# ",after:` -`,...a.current()});return/^[\t ]/.test(u)&&(u=fN(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,r.options.closeAtx&&(u+=" "+o),l(),s(),u}Ztt.peek=uTr;function Ztt(t){return t.value||""}function uTr(){return"<"}Jtt.peek=hTr;function Jtt(t,e,r,n){const i=Hue(r),a=i==='"'?"Quote":"Apostrophe",o=r.enter("image");let s=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("]("),s(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(s=r.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(r.safe(t.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(s=r.enter("destinationRaw"),u+=l.move(r.safe(t.url,{before:u,after:t.title?" ":")",...l.current()}))),s(),t.title&&(s=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),s()),u+=l.move(")"),o(),u}function hTr(){return"!"}ert.peek=dTr;function ert(t,e,r,n){const i=t.referenceType,a=r.enter("imageReference");let o=r.enter("label");const s=r.createTracker(n);let l=s.move("![");const u=r.safe(t.alt,{before:l,after:"]",...s.current()});l+=s.move(u+"]["),o();const h=r.stack;r.stack=[],o=r.enter("reference");const d=r.safe(r.associationId(t),{before:l,after:"]",...s.current()});return o(),r.stack=h,a(),i==="full"||!u||u!==d?l+=s.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function dTr(){return"!"}trt.peek=fTr;function trt(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))}nrt.peek=pTr;function nrt(t,e,r,n){const i=Hue(r),a=i==='"'?"Quote":"Apostrophe",o=r.createTracker(n);let s,l;if(rrt(t,r)){const h=r.stack;r.stack=[],s=r.enter("autolink");let d=o.move("<");return d+=o.move(r.containerPhrasing(t,{before:d,after:">",...o.current()})),d+=o.move(">"),s(),r.stack=h,d}s=r.enter("link"),l=r.enter("label");let u=o.move("[");return u+=o.move(r.containerPhrasing(t,{before:u,after:"](",...o.current()})),u+=o.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=r.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(r.safe(t.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(l=r.enter("destinationRaw"),u+=o.move(r.safe(t.url,{before:u,after:t.title?" ":")",...o.current()}))),l(),t.title&&(l=r.enter(`title${a}`),u+=o.move(" "+i),u+=o.move(r.safe(t.title,{before:u,after:i,...o.current()})),u+=o.move(i),l()),u+=o.move(")"),s(),u}function pTr(t,e,r){return rrt(t,r)?"<":"["}irt.peek=gTr;function irt(t,e,r,n){const i=t.referenceType,a=r.enter("linkReference");let o=r.enter("label");const s=r.createTracker(n);let l=s.move("[");const u=r.containerPhrasing(t,{before:l,after:"]",...s.current()});l+=s.move(u+"]["),o();const h=r.stack;r.stack=[],o=r.enter("reference");const d=r.safe(r.associationId(t),{before:l,after:"]",...s.current()});return o(),r.stack=h,a(),i==="full"||!u||u!==d?l+=s.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function gTr(){return"["}function Wue(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 mTr(t){const e=Wue(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 vTr(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 art(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 yTr(t,e,r,n){const i=r.enter("list"),a=r.bulletCurrent;let o=t.ordered?vTr(r):Wue(r);const s=t.ordered?o==="."?")":".":mTr(r);let l=e&&r.bulletLastUsed?o===r.bulletLastUsed:!1;if(!t.ordered){const h=t.children?t.children[0]:void 0;if((o==="*"||o==="-")&&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),art(r)===o&&h){let d=-1;for(;++d-1?e.start:1)+(r.options.incrementListMarker===!1?0:e.children.indexOf(t))+a);let o=a.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(o=Math.ceil(o/4)*4);const s=r.createTracker(n);s.move(a+" ".repeat(o-a.length)),s.shift(o);const l=r.enter("listItem"),u=r.indentLines(r.containerFlow(t,s.current()),h);return l(),u;function h(d,f,p){return f?(p?"":" ".repeat(o))+d:(p?a:a+" ".repeat(o-a.length))+d}}function wTr(t,e,r,n){const i=r.enter("paragraph"),a=r.enter("phrasing"),o=r.containerPhrasing(t,n);return a(),i(),o}const ATr=uN(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function STr(t,e,r,n){return(t.children.some(function(o){return ATr(o)})?r.containerPhrasing:r.containerFlow).call(r,t,n)}function TTr(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}ort.peek=CTr;function ort(t,e,r,n){const i=TTr(r),a=r.enter("strong"),o=r.createTracker(n),s=o.move(i+i);let l=o.move(r.containerPhrasing(t,{after:i,before:s,...o.current()}));const u=l.charCodeAt(0),h=mG(n.before.charCodeAt(n.before.length-1),u,i);h.inside&&(l=fN(u)+l.slice(1));const d=l.charCodeAt(l.length-1),f=mG(n.after.charCodeAt(0),d,i);f.inside&&(l=l.slice(0,-1)+fN(d));const p=o.move(i+i);return a(),r.attentionEncodeSurroundingInfo={after:f.outside,before:h.outside},s+l+p}function CTr(t,e,r){return r.options.strong||"*"}function OTr(t,e,r,n){return r.safe(t.value,n)}function kTr(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 ETr(t,e,r){const n=(art(r)+(r.options.ruleSpaces?" ":"")).repeat(kTr(r));return r.options.ruleSpaces?n.slice(0,-1):n}const srt={blockquote:KSr,break:Xtt,code:nTr,definition:aTr,emphasis:Ktt,hardBreak:Xtt,heading:cTr,html:Ztt,image:Jtt,imageReference:ert,inlineCode:trt,link:nrt,linkReference:irt,list:yTr,listItem:xTr,paragraph:wTr,root:STr,strong:ort,text:OTr,thematicBreak:ETr};function _Tr(){return{enter:{table:RTr,tableData:lrt,tableHeader:lrt,tableRow:LTr},exit:{codeText:MTr,table:DTr,tableData:Yue,tableHeader:Yue,tableRow:Yue}}}function RTr(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 DTr(t){this.exit(t),this.data.inTable=void 0}function LTr(t){this.enter({type:"tableRow",children:[]},t)}function Yue(t){this.exit(t)}function lrt(t){this.enter({type:"tableCell",children:[]},t)}function MTr(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,ITr));const r=this.stack[this.stack.length-1];r.type,r.value=e,this.exit(t)}function ITr(t,e){return e==="|"?e:t}function PTr(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=fN(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,r.options.closeAtx&&(u+=" "+o),l(),s(),u}ert.peek=dTr;function ert(t){return t.value||""}function dTr(){return"<"}trt.peek=fTr;function trt(t,e,r,n){const i=Hue(r),a=i==='"'?"Quote":"Apostrophe",o=r.enter("image");let s=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("]("),s(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(s=r.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(r.safe(t.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(s=r.enter("destinationRaw"),u+=l.move(r.safe(t.url,{before:u,after:t.title?" ":")",...l.current()}))),s(),t.title&&(s=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),s()),u+=l.move(")"),o(),u}function fTr(){return"!"}rrt.peek=pTr;function rrt(t,e,r,n){const i=t.referenceType,a=r.enter("imageReference");let o=r.enter("label");const s=r.createTracker(n);let l=s.move("![");const u=r.safe(t.alt,{before:l,after:"]",...s.current()});l+=s.move(u+"]["),o();const h=r.stack;r.stack=[],o=r.enter("reference");const d=r.safe(r.associationId(t),{before:l,after:"]",...s.current()});return o(),r.stack=h,a(),i==="full"||!u||u!==d?l+=s.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function pTr(){return"!"}nrt.peek=gTr;function nrt(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))}art.peek=mTr;function art(t,e,r,n){const i=Hue(r),a=i==='"'?"Quote":"Apostrophe",o=r.createTracker(n);let s,l;if(irt(t,r)){const h=r.stack;r.stack=[],s=r.enter("autolink");let d=o.move("<");return d+=o.move(r.containerPhrasing(t,{before:d,after:">",...o.current()})),d+=o.move(">"),s(),r.stack=h,d}s=r.enter("link"),l=r.enter("label");let u=o.move("[");return u+=o.move(r.containerPhrasing(t,{before:u,after:"](",...o.current()})),u+=o.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=r.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(r.safe(t.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(l=r.enter("destinationRaw"),u+=o.move(r.safe(t.url,{before:u,after:t.title?" ":")",...o.current()}))),l(),t.title&&(l=r.enter(`title${a}`),u+=o.move(" "+i),u+=o.move(r.safe(t.title,{before:u,after:i,...o.current()})),u+=o.move(i),l()),u+=o.move(")"),s(),u}function mTr(t,e,r){return irt(t,r)?"<":"["}ort.peek=vTr;function ort(t,e,r,n){const i=t.referenceType,a=r.enter("linkReference");let o=r.enter("label");const s=r.createTracker(n);let l=s.move("[");const u=r.containerPhrasing(t,{before:l,after:"]",...s.current()});l+=s.move(u+"]["),o();const h=r.stack;r.stack=[],o=r.enter("reference");const d=r.safe(r.associationId(t),{before:l,after:"]",...s.current()});return o(),r.stack=h,a(),i==="full"||!u||u!==d?l+=s.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function vTr(){return"["}function Wue(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 yTr(t){const e=Wue(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 bTr(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 srt(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 xTr(t,e,r,n){const i=r.enter("list"),a=r.bulletCurrent;let o=t.ordered?bTr(r):Wue(r);const s=t.ordered?o==="."?")":".":yTr(r);let l=e&&r.bulletLastUsed?o===r.bulletLastUsed:!1;if(!t.ordered){const h=t.children?t.children[0]:void 0;if((o==="*"||o==="-")&&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),srt(r)===o&&h){let d=-1;for(;++d-1?e.start:1)+(r.options.incrementListMarker===!1?0:e.children.indexOf(t))+a);let o=a.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(o=Math.ceil(o/4)*4);const s=r.createTracker(n);s.move(a+" ".repeat(o-a.length)),s.shift(o);const l=r.enter("listItem"),u=r.indentLines(r.containerFlow(t,s.current()),h);return l(),u;function h(d,f,p){return f?(p?"":" ".repeat(o))+d:(p?a:a+" ".repeat(o-a.length))+d}}function STr(t,e,r,n){const i=r.enter("paragraph"),a=r.enter("phrasing"),o=r.containerPhrasing(t,n);return a(),i(),o}const TTr=uN(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function CTr(t,e,r,n){return(t.children.some(function(o){return TTr(o)})?r.containerPhrasing:r.containerFlow).call(r,t,n)}function OTr(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}lrt.peek=kTr;function lrt(t,e,r,n){const i=OTr(r),a=r.enter("strong"),o=r.createTracker(n),s=o.move(i+i);let l=o.move(r.containerPhrasing(t,{after:i,before:s,...o.current()}));const u=l.charCodeAt(0),h=mG(n.before.charCodeAt(n.before.length-1),u,i);h.inside&&(l=fN(u)+l.slice(1));const d=l.charCodeAt(l.length-1),f=mG(n.after.charCodeAt(0),d,i);f.inside&&(l=l.slice(0,-1)+fN(d));const p=o.move(i+i);return a(),r.attentionEncodeSurroundingInfo={after:f.outside,before:h.outside},s+l+p}function kTr(t,e,r){return r.options.strong||"*"}function ETr(t,e,r,n){return r.safe(t.value,n)}function _Tr(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 RTr(t,e,r){const n=(srt(r)+(r.options.ruleSpaces?" ":"")).repeat(_Tr(r));return r.options.ruleSpaces?n.slice(0,-1):n}const crt={blockquote:JSr,break:Ztt,code:aTr,definition:sTr,emphasis:Jtt,hardBreak:Ztt,heading:hTr,html:ert,image:trt,imageReference:rrt,inlineCode:nrt,link:art,linkReference:ort,list:xTr,listItem:ATr,paragraph:STr,root:CTr,strong:lrt,text:ETr,thematicBreak:RTr};function DTr(){return{enter:{table:LTr,tableData:urt,tableHeader:urt,tableRow:ITr},exit:{codeText:PTr,table:MTr,tableData:Yue,tableHeader:Yue,tableRow:Yue}}}function LTr(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 MTr(t){this.exit(t),this.data.inTable=void 0}function ITr(t){this.enter({type:"tableRow",children:[]},t)}function Yue(t){this.exit(t)}function urt(t){this.enter({type:"tableCell",children:[]},t)}function PTr(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,NTr));const r=this.stack[this.stack.length-1];r.type,r.value=e,this.exit(t)}function NTr(t,e){return e==="|"?e:t}function BTr(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:o,tableCell:l,tableRow:s}};function o(p,g,m,v){return u(h(p,m,v),p.align)}function s(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 jSr(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 JTr={tokenize:sCr,partial:!0};function eCr(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:iCr,continuation:{tokenize:aCr},exit:oCr}},text:{91:{name:"gfmFootnoteCall",tokenize:nCr},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:tCr,resolveTo:rCr}}}}function tCr(t,e,r){const n=this;let i=n.events.length;const a=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let o;for(;i--;){const l=n.events[i][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!o||!o._balanced)return r(l);const u=tg(n.sliceSerialize({start:o.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 rCr(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)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[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",o,e],["exit",o,e],["exit",a,e],t[t.length-2],t[t.length-1],["exit",n,e]];return t.splice(r,t.length-r+1,...s),t}function nCr(t,e,r){const n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let a=0,o;return s;function s(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&&!o||d===null||d===91||Oa(d))return r(d);if(d===93){t.exit("chunkString");const f=t.exit("gfmFootnoteCallString");return i.includes(tg(n.sliceSerialize(f)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):r(d)}return Oa(d)||(o=!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 iCr(t,e,r){const n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let a,o=0,s;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(o>999||g===93&&!s||g===null||g===91||Oa(g))return r(g);if(g===93){t.exit("chunkString");const m=t.exit("gfmFootnoteDefinitionLabelString");return a=tg(n.sliceSerialize(m)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),f}return Oa(g)||(s=!0),o++,t.consume(g),g===92?d:h}function d(g){return g===91||g===92||g===93?(t.consume(g),o++,h):h(g)}function f(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),i.includes(a)||i.push(a),Di(t,p,"gfmFootnoteDefinitionWhitespace")):r(g)}function p(g){return e(g)}}function aCr(t,e,r){return t.check(aN,e,t.attempt(JTr,e,r))}function oCr(t){t.exit("gfmFootnoteDefinition")}function sCr(t,e,r){const n=this;return Di(t,i,"gfmFootnoteDefinitionIndent",5);function i(a){const o=n.events[n.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?e(a):r(a)}}function lCr(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(o,s){let l=-1;for(;++l1?l(g):(o.consume(g),d++,p);if(d<2&&!r)return l(g);const v=o.exit("strikethroughSequenceTemporary"),y=QE(g);return v._open=!y||y===2&&!!m,v._close=!m||m===2&&!!y,s(g)}}}class cCr{constructor(){this.map=[]}add(e,r,n){uCr(this,e,r,n)}consume(e){if(this.map.sort(function(a,o){return a[0]-o[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 uCr(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 P=_>-1?n.events[_][1].type:null,L=P==="tableHead"||P==="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||(o=!0,a+=1),h(E)}function h(E){return E===null?r(E):en(E)?a>1?(a=0,n.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(E),t.exit("lineEnding"),p):r(E):gi(E)?Di(t,h,"whitespace")(E):(a+=1,o&&(o=!1,i+=1),E===124?(t.enter("tableCellDivider"),t.consume(E),t.exit("tableCellDivider"),o=!0,h):(t.enter("data"),d(E)))}function d(E){return E===null||E===124||Oa(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"),o=!1,gi(E)?Di(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?(o=!0,t.enter("tableCellDivider"),t.consume(E),t.exit("tableCellDivider"),m):A(E)}function m(E){return gi(E)?Di(t,v,"whitespace")(E):v(E)}function v(E){return E===58?(a+=1,o=!0,t.enter("tableDelimiterMarker"),t.consume(E),t.exit("tableDelimiterMarker"),y):E===45?(a+=1,y(E)):E===null||en(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?(o=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(E),t.exit("tableDelimiterMarker"),x):(t.exit("tableDelimiterFiller"),x(E))}function x(E){return gi(E)?Di(t,w,"whitespace")(E):w(E)}function w(E){return E===124?g(E):E===null||en(E)?!o||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||en(E)?(t.exit("tableRow"),e(E)):gi(E)?Di(t,T,"whitespace")(E):(t.enter("data"),C(E))}function C(E){return E===null||E===124||Oa(E)?(t.exit("data"),T(E)):(t.consume(E),E===92?k:C)}function k(E){return E===92||E===124?(t.consume(E),C):C(E)}}function pCr(t,e){let r=-1,n=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,l=0,u,h,d;const f=new cCr;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({},WE(e.events,i)),t.add(i,0,[["exit",a,e]]),a=void 0),a}function yrt(t,e,r,n,i){const a=[],o=WE(e.events,r);i&&(i.end=Object.assign({},o),a.push(["exit",i,e])),n.end=Object.assign({},o),a.push(["exit",n,e]),t.add(r+1,0,a)}function WE(t,e){const r=t[e],n=r[0]==="enter"?"start":"end";return r[1][n]}const gCr={name:"tasklistCheck",tokenize:vCr};function mCr(){return{text:{91:gCr}}}function vCr(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 Oa(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),o):r(l)}function o(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),s):r(l)}function s(l){return en(l)?e(l):gi(l)?t.check({tokenize:yCr},e,r)(l):r(l)}}function yCr(t,e,r){return Di(t,n,"whitespace");function n(i){return i===null?r(i):e(i)}}function bCr(t){return Get([GTr(),eCr(),lCr(t),dCr(),mCr()])}const xCr={};function wCr(t){const e=this,r=t||xCr,n=e.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),a=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),o=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(bCr(r)),a.push(zTr()),o.push(UTr(r))}const brt=function(t,e,r){const n=uN(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 Crt(t,e,r){return t.type==="element"?_Cr(t,e,r):t.type==="text"?r.whitespace==="normal"?Ort(t,r):RCr(t):[]}function _Cr(t,e,r){const n=krt(t,r),i=t.children||[];let a=-1,o=[];if(kCr(t))return o;let s,l;for(Kue(t)||Srt(t)&&brt(e,t,Srt)?l=` -`:OCr(t)?(s=2,l=2):Trt(t)&&(s=1,l=1);++a]+>")+")",s={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,s,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},C={className:"function",begin:"("+o+"[\\*&\\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,s,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,u,h,s]}]},s,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",s]},{begin:t.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function NCr(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=PCr(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 BCr(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"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,r,i]};i.contains.push(s);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,o,y,s,l,u,h,r]}}function $Cr(t){const e=t.regex,r=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="("+n+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",s={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,s,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:"("+o+"[\\*&\\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,s,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,u,h,s]}]},s,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 FCr(t){const e=t.regex,r=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+n+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",s={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,s,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},C={className:"function",begin:"("+o+"[\\*&\\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,s,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,u,h,s]}]},s,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",s]},{begin:t.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function zCr(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"],o={keyword:i.concat(a),built_in:e,literal:n},s=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:o},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"},s]},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:o,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"},s,b,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[s,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[s,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:o,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:o,relevance:0,contains:[y,l,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},w]}}const UCr=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_-]*/}}),VCr=["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"],QCr=["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"],GCr=[...VCr,...QCr],HCr=["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(),WCr=["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(),YCr=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),qCr=["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 jCr(t){const e=t.regex,r=UCr(t),n={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",a=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",s=[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:"\\."+o,relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+WCr.join("|")+")"},{begin:":(:)?("+YCr.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+qCr.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.CSS_NUMBER_MODE,...s,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...s,{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:HCr.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...s,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+GCr.join("|")+")\\b"}]}}function XCr(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 KCr(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:"_rt(t,e,r-1))}function eOr(t){const e=t.regex,r="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",n=r+_rt("(?:<"+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,Ert,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Ert,u]}}const Rrt="[A-Za-z$_][0-9A-Za-z$_]*",tOr=["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"],rOr=["true","false","null","undefined","NaN","Infinity"],Drt=["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"],Lrt=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Mrt=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],nOr=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],iOr=[].concat(Mrt,Drt,Lrt);function aOr(t){const e=t.regex,r=(N,{after:F})=>{const B="",end:""},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={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}}},s={$pattern:Rrt,keyword:tOr,literal:rOr,built_in:iOr,"variable.language":nOr},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:s,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:s,contains:["self"].concat(x)});const w=[].concat(b,f.contains),A=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(w)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,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"}}]},C={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:{_:[...Drt,...Lrt]}},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 P(N){return e.concat("(?!",N.join("|"),")")}const L={match:e.concat(/\b/,P([...Mrt,"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*=>",I={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:s,exports:{PARAMS_CONTAINS:A,CLASS_REFERENCE:C},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,C,{scope:"attr",match:n+e.lookahead(":"),relevance:0},I,{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:s,contains:A}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.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 oOr(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 qE="[0-9](_*[0-9])*",xG=`\\.(${qE})`,wG="[0-9a-fA-F](_*[0-9a-fA-F])*",sOr={className:"number",variants:[{begin:`(\\b(${qE})((${xG})|\\.)?|(${xG}))[eE][+-]?(${qE})[fFdD]?\\b`},{begin:`\\b(${qE})((${xG})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${xG})[fFdD]?\\b`},{begin:`\\b(${qE})[fFdD]\\b`},{begin:`\\b0[xX]((${wG})\\.?|(${wG})?\\.(${wG}))[pP][+-]?(${qE})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${wG})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function lOr(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},o={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(o);const s={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(o,{className:"string"}),"self"]}]},u=sOr,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,s,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,s,l,o,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},s,l]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` -`},u]}}const cOr=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_-]*/}}),uOr=["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"],hOr=["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"],dOr=[...uOr,...hOr],fOr=["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(),Irt=["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(),Prt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),pOr=["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(),gOr=Irt.concat(Prt).sort().reverse();function mOr(t){const e=cOr(t),r=gOr,n="and or not only",i="[\\w-]+",a="("+i+"|@\\{"+i+"\\})",o=[],s=[],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:fOr.join(" ")},d={begin:"\\(",end:"\\)",contains:s,keywords:h,relevance:0};s.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=s.concat({begin:/\{/,end:/\}/,contains:o}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},g={begin:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+pOr.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}]},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:s,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("+dOr.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:":("+Irt.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Prt.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:f},{begin:"!important"},e.FUNCTION_DISPATCH]},b={begin:i+`:(:)?(${r.join("|")})`,returnBegin:!0,contains:[y]};return o.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:o}}function vOr(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 yOr(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},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},s=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,s,/:\/\/.*?\)/),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,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function xOr(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_]*/,s={"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:s,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 wOr(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},o={begin:/->\{/,end:/\}/},s={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:[s]},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}),o,{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,s]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,s,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return a.contains=g,o.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:g}}function AOr(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),o={scope:"variable",match:"\\$+"+n},s={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(?!\\()"),C={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,o,C,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 P=[k,C,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",...P]},...P,{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}]}},s,{scope:"variable.language",match:/\$this\b/},o,_,C,{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,o,C,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 SOr(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 TOr(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function COr(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"],s={$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:s,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:s,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:s,contains:["self",l,m,d,t.HASH_COMMENT_MODE]}]};return u.contains=[d,m,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:s,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 OOr(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function kOr(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 EOr(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+)*/),o={"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"]},s={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},u=[t.COMMENT("#","$",{contains:[s]}),t.COMMENT("^=begin","^=end",{contains:[s],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],h={className:"subst",begin:/#\{/,end:/\}/,keywords:o},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:o}]},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:o},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:o},{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:o},{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:o,contains:S}}];return u.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(E).concat(u).concat(S)}}function _Or(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*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",s=["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:s,literal:l,built_in:u},illegal:""},a]}}const ROr=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_-]*/}}),DOr=["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"],LOr=["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"],MOr=[...DOr,...LOr],IOr=["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(),POr=["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(),NOr=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),BOr=["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 $Or(t){const e=ROr(t),r=NOr,n=POr,i="@[a-z-]+",a="and or not only",s={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("+MOr.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+n.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+r.join("|")+")"},s,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+BOr.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,s,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:IOr.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},s,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function FOr(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function zOr(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"],o=["double precision","large object","with timezone","without timezone"],s=["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 C=T;return S=S||[],A.map(k=>k.match(/\|\d+$/)||S.includes(k)?k:C(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:s,built_in:d},contains:[{scope:"type",match:b(o)},x,y,m,n,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,r,v]}}function Nrt(t){return t?typeof t=="string"?t:t.source:null}function pN(t){return va("(?=",t,")")}function va(...t){return t.map(r=>Nrt(r)).join("")}function UOr(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Ou(...t){return"("+(UOr(t).capture?"":"?:")+t.map(n=>Nrt(n)).join("|")+")"}const Zue=t=>va(/\b/,t,/\w$/.test(t)?/\b/:/\B/),VOr=["Protocol","Type"].map(Zue),Brt=["init","self"].map(Zue),QOr=["Any","Self"],Jue=["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"],$rt=["false","nil","true"],GOr=["assignment","associativity","higherThan","left","lowerThan","none","right"],HOr=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Frt=["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"],zrt=Ou(/[/=\-+!*%<>&|^~?]/,/[\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]/),Urt=Ou(zrt,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),ehe=va(zrt,Urt,"*"),Vrt=Ou(/[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]/),AG=Ou(Vrt,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Am=va(Vrt,AG,"*"),SG=va(/[A-Z]/,AG,"*"),WOr=["attached","autoclosure",va(/convention\(/,Ou("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",va(/objc\(/,Am,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],YOr=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function qOr(t){const e={match:/\s+/,relevance:0},r=t.COMMENT("/\\*","\\*/",{contains:["self"]}),n=[t.C_LINE_COMMENT_MODE,r],i={match:[/\./,Ou(...VOr,...Brt)],className:{2:"keyword"}},a={match:va(/\./,Ou(...Jue)),relevance:0},o=Jue.filter(ke=>typeof ke=="string").concat(["_|0"]),s=Jue.filter(ke=>typeof ke!="string").concat(QOr).map(Zue),l={variants:[{className:"keyword",match:Ou(...s,...Brt)}]},u={$pattern:Ou(/\b\w+/,/#\w+/),keyword:o.concat(HOr),literal:$rt},h=[i,a,l],d={match:va(/\./,Ou(...Frt)),relevance:0},f={className:"built_in",match:va(/\b/,Ou(...Frt),/(?=\()/)},p=[d,f],g={match:/->/,relevance:0},m={className:"operator",relevance:0,variants:[{match:ehe},{match:`\\.(\\.|${Urt})+`}]},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=(ke="")=>({className:"subst",variants:[{match:va(/\\/,ke,/[0\\tnr"']/)},{match:va(/\\/,ke,/u\{[0-9a-fA-F]{1,8}\}/)}]}),A=(ke="")=>({className:"subst",match:va(/\\/,ke,/[\t ]*(?:[\r\n]|\r\n)/)}),S=(ke="")=>({className:"subst",label:"interpol",begin:va(/\\/,ke,/\(/),end:/\)/}),T=(ke="")=>({begin:va(ke,/"""/),end:va(/"""/,ke),contains:[w(ke),A(ke),S(ke)]}),C=(ke="")=>({begin:va(ke,/"/),end:va(/"/,ke),contains:[w(ke),S(ke)]}),k={className:"string",variants:[T(),T("#"),T("##"),T("###"),C(),C("#"),C("##"),C("###")]},E=[t.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[t.BACKSLASH_ESCAPE]}],_={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:E},P=ke=>{const Ee=va(ke,/\//),ue=va(/\//,ke);return{begin:Ee,end:ue,contains:[...E,{scope:"comment",begin:`#(?!.*${ue})`,end:/$/}]}},L={scope:"regexp",variants:[P("###"),P("##"),P("#"),_]},R={match:va(/`/,Am,/`/)},D={className:"variable",match:/\$\d+/},M={className:"variable",match:`\\$${AG}+`},I=[R,D,M],N={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:YOr,contains:[...v,x,k]}]}},F={scope:"keyword",match:va(/@/,Ou(...WOr),pN(Ou(/\(/,/\s+/)))},B={scope:"meta",match:va(/@/,Am)},V=[N,F,B],z={match:pN(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:va(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,AG,"+")},{className:"type",match:SG,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:va(/\s+&\s+/,pN(SG)),relevance:0}]},U={begin://,keywords:u,contains:[...n,...h,...V,g,z]};z.contains.push(U);const Q={match:va(Am,/\s*:/),keywords:"_|0",relevance:0},G={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",Q,...n,L,...h,...p,...v,x,k,...I,...V,z]},q={begin://,keywords:"repeat each",contains:[...n,z]},Y={begin:Ou(pN(va(Am,/\s*:/)),pN(va(Am,/\s+/,Am,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Am}]},ne={begin:/\(/,end:/\)/,keywords:u,contains:[Y,...n,...h,...v,x,k,...V,z,G],endsParent:!0,illegal:/["']/},X={match:[/(func|macro)/,/\s+/,Ou(R.match,Am,ehe)],className:{1:"keyword",3:"title.function"},contains:[q,ne,e],illegal:[/\[/,/%/]},J={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[q,ne,e],illegal:/\[|%/},ee={match:[/operator/,/\s+/,ehe],className:{1:"keyword",3:"title"}},te={begin:[/precedencegroup/,/\s+/,SG],className:{1:"keyword",3:"title"},contains:[z],keywords:[...GOr,...$rt],end:/}/},pe={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},ie={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ce={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Am,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[q,...h,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:SG},...h],relevance:0}]};for(const ke of k.variants){const Ee=ke.contains.find(de=>de.label==="interpol");Ee.keywords=u;const ue=[...h,...p,...v,x,k,...I];Ee.contains=[...ue,{begin:/\(/,end:/\)/,contains:["self",...ue]}]}return{name:"Swift",keywords:u,contains:[...n,X,J,pe,ie,Ce,ee,te,{beginKeywords:"import",end:/$/,contains:[...n],relevance:0},L,...h,...p,...v,x,k,...I,...V,z,G]}}const TG="[A-Za-z$_][0-9A-Za-z$_]*",Qrt=["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"],Grt=["true","false","null","undefined","NaN","Infinity"],Hrt=["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"],Wrt=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Yrt=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],qrt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],jrt=[].concat(Yrt,Hrt,Wrt);function jOr(t){const e=t.regex,r=(N,{after:F})=>{const B="",end:""},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={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}}},s={$pattern:TG,keyword:Qrt,literal:Grt,built_in:jrt,"variable.language":qrt},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:s,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:s,contains:["self"].concat(x)});const w=[].concat(b,f.contains),A=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(w)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,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"}}]},C={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:{_:[...Hrt,...Wrt]}},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 P(N){return e.concat("(?!",N.join("|"),")")}const L={match:e.concat(/\b/,P([...Yrt,"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*=>",I={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:s,exports:{PARAMS_CONTAINS:A,CLASS_REFERENCE:C},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,C,{scope:"attr",match:n+e.lookahead(":"),relevance:0},I,{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:s,contains:A}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.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 XOr(t){const e=t.regex,r=jOr(t),n=TG,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[r.exports.CLASS_REFERENCE]},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:TG,keyword:Qrt.concat(l),literal:Grt,built_in:jrt.concat(i),"variable.language":qrt},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,o,p]),d(r,"shebang",t.SHEBANG()),d(r,"use_strict",s);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 KOr(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}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,s=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:e.concat(/# */,e.either(a,i),/ *#/)},{begin:e.concat(/# */,s,/ *#/)},{begin:e.concat(/# */,o,/ *#/)},{begin:e.concat(/# */,e.either(a,i),/ +/,e.either(o,s),/ *#/)}]},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 ZOr(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_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},s={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,o,i,t.QUOTE_STRING_MODE,l,u,s]}}function JOr(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/}]},o=t.inherit(a,{begin:/\(/,end:/\)/}),s=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,s,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[a,o,l,s]}]}]},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 ekr(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}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},s=t.inherit(o,{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,o],y=[...v];return y.pop(),y.push(s),p.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const tkr={arduino:NCr,bash:BCr,c:$Cr,cpp:FCr,csharp:zCr,css:jCr,diff:XCr,go:KCr,graphql:ZCr,ini:JCr,java:eOr,javascript:aOr,json:oOr,kotlin:lOr,less:mOr,lua:vOr,makefile:yOr,markdown:bOr,objectivec:xOr,perl:wOr,php:AOr,"php-template":SOr,plaintext:TOr,python:COr,"python-repl":OOr,r:kOr,ruby:EOr,rust:_Or,scss:$Or,shell:FOr,sql:zOr,swift:qOr,typescript:XOr,vbnet:KOr,wasm:ZOr,xml:JOr,yaml:ekr};function Xrt(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)&&Xrt(r)}),t}class Krt{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Zrt(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function gx(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 rkr="
",Jrt=t=>!!t.scope,nkr=(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 ikr{constructor(e,r){this.buffer="",this.classPrefix=r.classPrefix,e.walk(this)}addText(e){this.buffer+=Zrt(e)}openNode(e){if(!Jrt(e))return;const r=nkr(e.scope,{prefix:this.classPrefix});this.span(r)}closeNode(e){Jrt(e)&&(this.buffer+=rkr)}value(){return this.buffer}span(e){this.buffer+=``}}const ent=(t={})=>{const e={children:[]};return Object.assign(e,t),e};class the{constructor(){this.rootNode=ent(),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=ent({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=>{the._collapse(r)}))}}class akr extends the{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 ikr(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function gN(t){return t?typeof t=="string"?t:t.source:null}function tnt(t){return MA("(?=",t,")")}function okr(t){return MA("(?:",t,")*")}function skr(t){return MA("(?:",t,")?")}function MA(...t){return t.map(r=>gN(r)).join("")}function lkr(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function rhe(...t){return"("+(lkr(t).capture?"":"?:")+t.map(n=>gN(n)).join("|")+")"}function rnt(t){return new RegExp(t.toString()+"|").exec("").length-1}function ckr(t,e){const r=t&&t.exec(e);return r&&r.index===0}const ukr=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function nhe(t,{joinWith:e}){let r=0;return t.map(n=>{r+=1;const i=r;let a=gN(n),o="";for(;a.length>0;){const s=ukr.exec(a);if(!s){o+=a;break}o+=a.substring(0,s.index),a=a.substring(s.index+s[0].length),s[0][0]==="\\"&&s[1]?o+="\\"+String(Number(s[1])+i):(o+=s[0],s[0]==="("&&r++)}return o}).map(n=>`(${n})`).join(e)}const hkr=/\b\B/,nnt="[a-zA-Z]\\w*",ihe="[a-zA-Z_]\\w*",int="\\b\\d+(\\.\\d+)?",ant="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",ont="\\b(0b[01]+)",dkr="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",fkr=(t={})=>{const e=/^#![ ]*\//;return t.binary&&(t.begin=MA(e,/.*\b/,t.binary,/\b.*/)),gx({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(r,n)=>{r.index!==0&&n.ignoreMatch()}},t)},mN={begin:"\\\\[\\s\\S]",relevance:0},pkr={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[mN]},gkr={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[mN]},mkr={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/},CG=function(t,e,r={}){const n=gx({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=rhe("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:MA(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},vkr=CG("//","$"),ykr=CG("/\\*","\\*/"),bkr=CG("#","$"),xkr={scope:"number",begin:int,relevance:0},wkr={scope:"number",begin:ant,relevance:0},Akr={scope:"number",begin:ont,relevance:0},Skr={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[mN,{begin:/\[/,end:/\]/,relevance:0,contains:[mN]}]},Tkr={scope:"title",begin:nnt,relevance:0},Ckr={scope:"title",begin:ihe,relevance:0},Okr={begin:"\\.\\s*"+ihe,relevance:0};var OG=Object.freeze({__proto__:null,APOS_STRING_MODE:pkr,BACKSLASH_ESCAPE:mN,BINARY_NUMBER_MODE:Akr,BINARY_NUMBER_RE:ont,COMMENT:CG,C_BLOCK_COMMENT_MODE:ykr,C_LINE_COMMENT_MODE:vkr,C_NUMBER_MODE:wkr,C_NUMBER_RE:ant,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:bkr,IDENT_RE:nnt,MATCH_NOTHING_RE:hkr,METHOD_GUARD:Okr,NUMBER_MODE:xkr,NUMBER_RE:int,PHRASAL_WORDS_MODE:mkr,QUOTE_STRING_MODE:gkr,REGEXP_MODE:Skr,RE_STARTERS_RE:dkr,SHEBANG:fkr,TITLE_MODE:Tkr,UNDERSCORE_IDENT_RE:ihe,UNDERSCORE_TITLE_MODE:Ckr});function kkr(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function Ekr(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function _kr(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=kkr,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Rkr(t,e){Array.isArray(t.illegal)&&(t.illegal=rhe(...t.illegal))}function Dkr(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 Lkr(t,e){t.relevance===void 0&&(t.relevance=1)}const Mkr=(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=MA(r.beforeMatch,tnt(r.begin)),t.starts={relevance:0,contains:[Object.assign(r,{endsParent:!0})]},t.relevance=0,delete r.beforeMatch},Ikr=["of","and","for","in","not","or","if","then","parent","list","value"],Pkr="keyword";function snt(t,e,r=Pkr){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,snt(t[a],e,a))}),n;function i(a,o){e&&(o=o.map(s=>s.toLowerCase())),o.forEach(function(s){const l=s.split("|");n[l[0]]=[a,Nkr(l[0],l[1])]})}}function Nkr(t,e){return e?Number(e):Bkr(t)?0:1}function Bkr(t){return Ikr.includes(t.toLowerCase())}const lnt={},IA=t=>{console.error(t)},cnt=(t,...e)=>{console.log(`WARN: ${t}`,...e)},jE=(t,e)=>{lnt[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),lnt[`${t}/${e}`]=!0)},kG=new Error;function unt(t,e,{key:r}){let n=0;const i=t[r],a={},o={};for(let s=1;s<=e.length;s++)o[s+n]=i[s],a[s+n]=!0,n+=rnt(e[s-1]);t[r]=o,t[r]._emit=a,t[r]._multi=!0}function $kr(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw IA("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),kG;if(typeof t.beginScope!="object"||t.beginScope===null)throw IA("beginScope must be object"),kG;unt(t,t.begin,{key:"beginScope"}),t.begin=nhe(t.begin,{joinWith:""})}}function Fkr(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw IA("skip, excludeEnd, returnEnd not compatible with endScope: {}"),kG;if(typeof t.endScope!="object"||t.endScope===null)throw IA("endScope must be object"),kG;unt(t,t.end,{key:"endScope"}),t.end=nhe(t.end,{joinWith:""})}}function zkr(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function Ukr(t){zkr(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),$kr(t),Fkr(t)}function Vkr(t){function e(o,s){return new RegExp(gN(o),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(s?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(s,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,s]),this.matchAt+=rnt(s)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const s=this.regexes.map(l=>l[1]);this.matcherRe=e(nhe(s,{joinWith:"|"}),!0),this.lastIndex=0}exec(s){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(s);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(s){if(this.multiRegexes[s])return this.multiRegexes[s];const l=new r;return this.rules.slice(s).forEach(([u,h])=>l.addRule(u,h)),l.compile(),this.multiRegexes[s]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(s,l){this.rules.push([s,l]),l.type==="begin"&&this.count++}exec(s){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(s);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const h=this.getMatcher(0);h.lastIndex=this.lastIndex+1,u=h.exec(s)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function i(o){const s=new n;return o.contains.forEach(l=>s.addRule(l.begin,{rule:l,type:"begin"})),o.terminatorEnd&&s.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&s.addRule(o.illegal,{type:"illegal"}),s}function a(o,s){const l=o;if(o.isCompiled)return l;[Ekr,Dkr,Ukr,Mkr].forEach(h=>h(o,s)),t.compilerExtensions.forEach(h=>h(o,s)),o.__beforeBegin=null,[_kr,Rkr,Lkr].forEach(h=>h(o,s)),o.isCompiled=!0;let u=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),u=o.keywords.$pattern,delete o.keywords.$pattern),u=u||/\w+/,o.keywords&&(o.keywords=snt(o.keywords,t.case_insensitive)),l.keywordPatternRe=e(u,!0),s&&(o.begin||(o.begin=/\B|\b/),l.beginRe=e(l.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(l.endRe=e(l.end)),l.terminatorEnd=gN(l.end)||"",o.endsWithParent&&s.terminatorEnd&&(l.terminatorEnd+=(o.end?"|":"")+s.terminatorEnd)),o.illegal&&(l.illegalRe=e(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(h){return Qkr(h==="self"?o:h)})),o.contains.forEach(function(h){a(h,l)}),o.starts&&a(o.starts,s),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=gx(t.classNameAliases||{}),a(t)}function hnt(t){return t?t.endsWithParent||hnt(t.starts):!1}function Qkr(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return gx(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:hnt(t)?gx(t,{starts:t.starts?gx(t.starts):null}):Object.isFrozen(t)?gx(t):t}var Gkr="11.11.1";class Hkr extends Error{constructor(e,r){super(e),this.name="HTMLInjectionError",this.html=r}}const ahe=Zrt,dnt=gx,fnt=Symbol("nomatch"),Wkr=7,pnt=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?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:akr};function l(M){return s.noHighlightRe.test(M)}function u(M){let I=M.className+" ";I+=M.parentNode?M.parentNode.className:"";const N=s.languageDetectRe.exec(I);if(N){const F=C(N[1]);return F||(cnt(a.replace("{}",N[1])),cnt("Falling back to no-highlight mode for this block.",M)),F?N[1]:"no-highlight"}return I.split(/\s+/).find(F=>l(F)||C(F))}function h(M,I,N){let F="",B="";typeof I=="object"?(F=M,N=I.ignoreIllegals,B=I.language):(jE("10.7.0","highlight(lang, code, ...args) has been deprecated."),jE("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),B=M,F=I),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,I,N,F){const B=Object.create(null);function V(Z,le){return Z.keywords[le]}function z(){if(!ue.keywords){xe.addText(ge);return}let Z=0;ue.keywordPatternRe.lastIndex=0;let le=ue.keywordPatternRe.exec(ge),be="";for(;le;){be+=ge.substring(Z,le.index);const ae=Ce.case_insensitive?le[0].toLowerCase():le[0],K=V(ue,ae);if(K){const[se,me]=K;if(xe.addText(be),be="",B[ae]=(B[ae]||0)+1,B[ae]<=Wkr&&(ze+=me),se.startsWith("_"))be+=le[0];else{const oe=Ce.classNameAliases[se]||se;G(le[0],oe)}}else be+=le[0];Z=ue.keywordPatternRe.lastIndex,le=ue.keywordPatternRe.exec(ge)}be+=ge.substring(Z),xe.addText(be)}function U(){if(ge==="")return;let Z=null;if(typeof ue.subLanguage=="string"){if(!e[ue.subLanguage]){xe.addText(ge);return}Z=d(ue.subLanguage,ge,!0,de[ue.subLanguage]),de[ue.subLanguage]=Z._top}else Z=p(ge,ue.subLanguage.length?ue.subLanguage:null);ue.relevance>0&&(ze+=Z.relevance),xe.__addSublanguage(Z._emitter,Z.language)}function Q(){ue.subLanguage!=null?U():z(),ge=""}function G(Z,le){Z!==""&&(xe.startScope(le),xe.addText(Z),xe.endScope())}function q(Z,le){let be=1;const ae=le.length-1;for(;be<=ae;){if(!Z._emit[be]){be++;continue}const K=Ce.classNameAliases[Z[be]]||Z[be],se=le[be];K?G(se,K):(ge=se,z(),ge=""),be++}}function Y(Z,le){return Z.scope&&typeof Z.scope=="string"&&xe.openNode(Ce.classNameAliases[Z.scope]||Z.scope),Z.beginScope&&(Z.beginScope._wrap?(G(ge,Ce.classNameAliases[Z.beginScope._wrap]||Z.beginScope._wrap),ge=""):Z.beginScope._multi&&(q(Z.beginScope,le),ge="")),ue=Object.create(Z,{parent:{value:ue}}),ue}function ne(Z,le,be){let ae=ckr(Z.endRe,be);if(ae){if(Z["on:end"]){const K=new Krt(Z);Z["on:end"](le,K),K.isMatchIgnored&&(ae=!1)}if(ae){for(;Z.endsParent&&Z.parent;)Z=Z.parent;return Z}}if(Z.endsWithParent)return ne(Z.parent,le,be)}function X(Z){return ue.matcher.regexIndex===0?(ge+=Z[0],1):(Be=!0,0)}function J(Z){const le=Z[0],be=Z.rule,ae=new Krt(be),K=[be.__beforeBegin,be["on:begin"]];for(const se of K)if(se&&(se(Z,ae),ae.isMatchIgnored))return X(le);return be.skip?ge+=le:(be.excludeBegin&&(ge+=le),Q(),!be.returnBegin&&!be.excludeBegin&&(ge=le)),Y(be,Z),be.returnBegin?0:le.length}function ee(Z){const le=Z[0],be=I.substring(Z.index),ae=ne(ue,Z,be);if(!ae)return fnt;const K=ue;ue.endScope&&ue.endScope._wrap?(Q(),G(le,ue.endScope._wrap)):ue.endScope&&ue.endScope._multi?(Q(),q(ue.endScope,Z)):K.skip?ge+=le:(K.returnEnd||K.excludeEnd||(ge+=le),Q(),K.excludeEnd&&(ge=le));do ue.scope&&xe.closeNode(),!ue.skip&&!ue.subLanguage&&(ze+=ue.relevance),ue=ue.parent;while(ue!==ae.parent);return ae.starts&&Y(ae.starts,Z),K.returnEnd?0:le.length}function te(){const Z=[];for(let le=ue;le!==Ce;le=le.parent)le.scope&&Z.unshift(le.scope);Z.forEach(le=>xe.openNode(le))}let pe={};function ie(Z,le){const be=le&&le[0];if(ge+=Z,be==null)return Q(),0;if(pe.type==="begin"&&le.type==="end"&&pe.index===le.index&&be===""){if(ge+=I.slice(le.index,le.index+1),!i){const ae=new Error(`0 width match regex (${M})`);throw ae.languageName=M,ae.badRule=pe.rule,ae}return 1}if(pe=le,le.type==="begin")return J(le);if(le.type==="illegal"&&!N){const ae=new Error('Illegal lexeme "'+be+'" for mode "'+(ue.scope||"")+'"');throw ae.mode=ue,ae}else if(le.type==="end"){const ae=ee(le);if(ae!==fnt)return ae}if(le.type==="illegal"&&be==="")return ge+=` -`,1;if(Oe>1e5&&Oe>le.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ge+=be,be.length}const Ce=C(M);if(!Ce)throw IA(a.replace("{}",M)),new Error('Unknown language: "'+M+'"');const ke=Vkr(Ce);let Ee="",ue=F||ke;const de={},xe=new s.__emitter(s);te();let ge="",ze=0,we=0,Oe=0,Be=!1;try{if(Ce.__emitTokens)Ce.__emitTokens(I,xe);else{for(ue.matcher.considerAll();;){Oe++,Be?Be=!1:ue.matcher.considerAll(),ue.matcher.lastIndex=we;const Z=ue.matcher.exec(I);if(!Z)break;const le=I.substring(we,Z.index),be=ie(le,Z);we=Z.index+be}ie(I.substring(we))}return xe.finalize(),Ee=xe.toHTML(),{language:M,value:Ee,relevance:ze,illegal:!1,_emitter:xe,_top:ue}}catch(Z){if(Z.message&&Z.message.includes("Illegal"))return{language:M,value:ahe(I),illegal:!0,relevance:0,_illegalBy:{message:Z.message,index:we,context:I.slice(we-100,we+100),mode:Z.mode,resultSoFar:Ee},_emitter:xe};if(i)return{language:M,value:ahe(I),illegal:!1,relevance:0,errorRaised:Z,_emitter:xe,_top:ue};throw Z}}function f(M){const I={value:ahe(M),illegal:!1,relevance:0,_top:o,_emitter:new s.__emitter(s)};return I._emitter.addText(M),I}function p(M,I){I=I||s.languages||Object.keys(e);const N=f(M),F=I.filter(C).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(C(Q.language).supersetOf===G.language)return 1;if(C(G.language).supersetOf===Q.language)return-1}return 0}),[V,z]=B,U=V;return U.secondBest=z,U}function g(M,I,N){const F=I&&r[I]||N;M.classList.add("hljs"),M.classList.add(`language-${F}`)}function m(M){let I=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&&(s.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)),s.throwUnescapedHTML))throw new Hkr("One of your code blocks includes unescaped HTML.",M.innerHTML);I=M;const F=I.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){s=dnt(s,M)}const y=()=>{w(),jE("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){w(),jE("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(s.cssSelector).forEach(m)}function A(M,I){let N=null;try{N=I(t)}catch(F){if(IA("Language definition for '{}' could not be registered.".replace("{}",M)),i)IA(F);else throw F;N=o}N.name||(N.name=M),e[M]=N,N.rawDefinition=I.bind(null,t),N.aliases&&k(N.aliases,{languageName:M})}function S(M){delete e[M];for(const I of Object.keys(r))r[I]===M&&delete r[I]}function T(){return Object.keys(e)}function C(M){return M=(M||"").toLowerCase(),e[M]||e[r[M]]}function k(M,{languageName:I}){typeof M=="string"&&(M=[M]),M.forEach(N=>{r[N.toLowerCase()]=I})}function E(M){const I=C(M);return I&&!I.disableAutodetect}function _(M){M["before:highlightBlock"]&&!M["before:highlightElement"]&&(M["before:highlightElement"]=I=>{M["before:highlightBlock"](Object.assign({block:I.el},I))}),M["after:highlightBlock"]&&!M["after:highlightElement"]&&(M["after:highlightElement"]=I=>{M["after:highlightBlock"](Object.assign({block:I.el},I))})}function P(M){_(M),n.push(M)}function L(M){const I=n.indexOf(M);I!==-1&&n.splice(I,1)}function R(M,I){const N=M;n.forEach(function(F){F[N]&&F[N](I)})}function D(M){return jE("10.7.0","highlightBlock will be removed entirely in v12.0"),jE("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:C,registerAliases:k,autoDetection:E,inherit:dnt,addPlugin:P,removePlugin:L}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=Gkr,t.regex={concat:MA,lookahead:tnt,either:rhe,optional:skr,anyNumberOfTimes:okr};for(const M in OG)typeof OG[M]=="object"&&Xrt(OG[M]);return Object.assign(t,OG),t},XE=pnt({});XE.newInstance=()=>pnt({});var Ykr=XE;XE.HighlightJS=XE,XE.default=XE;const qkr=wh(Ykr),gnt={},jkr="hljs-";function Xkr(t){const e=qkr.newInstance();return t&&a(t),{highlight:r,highlightAuto:n,listLanguages:i,register:a,registerAlias:o,registered:s};function r(l,u,h){const d=h||gnt,f=typeof d.prefix=="string"?d.prefix:jkr;if(!e.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");e.configure({__emitter:Kkr,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||gnt).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 o(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 s(l){return!!e.getLanguage(l)}}class Kkr{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(o,s){return s?o+"_".repeat(s):r.options.classPrefix+o}),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 Zkr={};function mnt(t){const e=t||Zkr,r=e.aliases,n=e.detect||!1,i=e.languages||tkr,a=e.plainText,o=e.prefix,s=e.subset;let l="hljs";const u=Xkr(i);if(r&&u.registerAlias(r),o){const h=o.indexOf("-");l=h===-1?o:o.slice(0,h)}return function(h,d){hN(h,"element",function(f,p,g){if(f.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const m=Jkr(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=ECr(f,{whitespace:"pre"});let y;try{y=m?u.highlight(m,v,{prefix:o}):u.highlightAuto(v,{prefix:o,subset:s})}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 Jkr(t){const e=t.properties.className;let r=-1;if(!Array.isArray(e))return;let n;for(;++r-1&&a<=e.length){let o=0;for(;;){let s=r[o];if(s===void 0){const l=xnt(e,r[o-1]);s=l===-1?e.length+1:l+1,r[o]=s}if(s>a)return{line:o+1,column:a-(o>0?r[o-1]:0)+1,offset:a};o++}}}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(o=55296&&t<=57343}function CEr(t){return t>=56320&&t<=57343}function OEr(t,e){return(t-55296)*1024+9216+e}function Ont(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function knt(t){return t>=64976&&t<=65007||TEr.has(t)}var bt;(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"})(bt||(bt={}));const kEr=65536;class EEr{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=kEr,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,o=i+r,s=a+r;return{code:e,startLine:n,endLine:n,startCol:o,endCol:o,startOffset:s,endOffset:s}}_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(CEr(r))return this.pos++,this._addGap(),OEr(e,r)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,Ue.EOF;return this._err(bt.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,Ue.EOF;const n=this.html.charCodeAt(r);return n===Ue.CARRIAGE_RETURN?Ue.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,Ue.EOF;let e=this.html.charCodeAt(this.pos);return e===Ue.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,Ue.LINE_FEED):e===Ue.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Cnt(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===Ue.LINE_FEED||e===Ue.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){Ont(e)?this._err(bt.controlCharacterInInputStream):knt(e)&&this._err(bt.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 _Er=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))),REr=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 DEr(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=REr.get(t))!==null&&e!==void 0?e:t}var Tl;(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"})(Tl||(Tl={}));const LEr=32;var mx;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(mx||(mx={}));function che(t){return t>=Tl.ZERO&&t<=Tl.NINE}function MEr(t){return t>=Tl.UPPER_A&&t<=Tl.UPPER_F||t>=Tl.LOWER_A&&t<=Tl.LOWER_F}function IEr(t){return t>=Tl.UPPER_A&&t<=Tl.UPPER_Z||t>=Tl.LOWER_A&&t<=Tl.LOWER_Z||che(t)}function PEr(t){return t===Tl.EQUALS||IEr(t)}var Cl;(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"})(Cl||(Cl={}));var sy;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(sy||(sy={}));class NEr{constructor(e,r,n){this.decodeTree=e,this.emitCodePoint=r,this.errors=n,this.state=Cl.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=sy.Strict}startEntity(e){this.decodeMode=e,this.state=Cl.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,r){switch(this.state){case Cl.EntityStart:return e.charCodeAt(r)===Tl.NUM?(this.state=Cl.NumericStart,this.consumed+=1,this.stateNumericStart(e,r+1)):(this.state=Cl.NamedEntity,this.stateNamedEntity(e,r));case Cl.NumericStart:return this.stateNumericStart(e,r);case Cl.NumericDecimal:return this.stateNumericDecimal(e,r);case Cl.NumericHex:return this.stateNumericHex(e,r);case Cl.NamedEntity:return this.stateNamedEntity(e,r)}}stateNumericStart(e,r){return r>=e.length?-1:(e.charCodeAt(r)|LEr)===Tl.LOWER_X?(this.state=Cl.NumericHex,this.consumed+=1,this.stateNumericHex(e,r+1)):(this.state=Cl.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(o===Tl.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==sy.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]&mx.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]&~mx.VALUE_LENGTH:i[e+1],n),r===3&&this.emitCodePoint(i[e+2],n),n}end(){var e;switch(this.state){case Cl.NamedEntity:return this.result!==0&&(this.decodeMode!==sy.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Cl.NumericDecimal:return this.emitNumericEntity(0,2);case Cl.NumericHex:return this.emitNumericEntity(0,3);case Cl.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Cl.EntityStart:return 0}}}function BEr(t,e,r,n){const i=(e&mx.BRANCH_LENGTH)>>7,a=e&mx.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 o=r,s=o+i-1;for(;o<=s;){const l=o+s>>>1,u=t[l];if(un)s=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 NA;(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"})(NA||(NA={}));var Gf;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(Gf||(Gf={}));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 W;(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"})(W||(W={}));const $Er=new Map([[st.A,W.A],[st.ADDRESS,W.ADDRESS],[st.ANNOTATION_XML,W.ANNOTATION_XML],[st.APPLET,W.APPLET],[st.AREA,W.AREA],[st.ARTICLE,W.ARTICLE],[st.ASIDE,W.ASIDE],[st.B,W.B],[st.BASE,W.BASE],[st.BASEFONT,W.BASEFONT],[st.BGSOUND,W.BGSOUND],[st.BIG,W.BIG],[st.BLOCKQUOTE,W.BLOCKQUOTE],[st.BODY,W.BODY],[st.BR,W.BR],[st.BUTTON,W.BUTTON],[st.CAPTION,W.CAPTION],[st.CENTER,W.CENTER],[st.CODE,W.CODE],[st.COL,W.COL],[st.COLGROUP,W.COLGROUP],[st.DD,W.DD],[st.DESC,W.DESC],[st.DETAILS,W.DETAILS],[st.DIALOG,W.DIALOG],[st.DIR,W.DIR],[st.DIV,W.DIV],[st.DL,W.DL],[st.DT,W.DT],[st.EM,W.EM],[st.EMBED,W.EMBED],[st.FIELDSET,W.FIELDSET],[st.FIGCAPTION,W.FIGCAPTION],[st.FIGURE,W.FIGURE],[st.FONT,W.FONT],[st.FOOTER,W.FOOTER],[st.FOREIGN_OBJECT,W.FOREIGN_OBJECT],[st.FORM,W.FORM],[st.FRAME,W.FRAME],[st.FRAMESET,W.FRAMESET],[st.H1,W.H1],[st.H2,W.H2],[st.H3,W.H3],[st.H4,W.H4],[st.H5,W.H5],[st.H6,W.H6],[st.HEAD,W.HEAD],[st.HEADER,W.HEADER],[st.HGROUP,W.HGROUP],[st.HR,W.HR],[st.HTML,W.HTML],[st.I,W.I],[st.IMG,W.IMG],[st.IMAGE,W.IMAGE],[st.INPUT,W.INPUT],[st.IFRAME,W.IFRAME],[st.KEYGEN,W.KEYGEN],[st.LABEL,W.LABEL],[st.LI,W.LI],[st.LINK,W.LINK],[st.LISTING,W.LISTING],[st.MAIN,W.MAIN],[st.MALIGNMARK,W.MALIGNMARK],[st.MARQUEE,W.MARQUEE],[st.MATH,W.MATH],[st.MENU,W.MENU],[st.META,W.META],[st.MGLYPH,W.MGLYPH],[st.MI,W.MI],[st.MO,W.MO],[st.MN,W.MN],[st.MS,W.MS],[st.MTEXT,W.MTEXT],[st.NAV,W.NAV],[st.NOBR,W.NOBR],[st.NOFRAMES,W.NOFRAMES],[st.NOEMBED,W.NOEMBED],[st.NOSCRIPT,W.NOSCRIPT],[st.OBJECT,W.OBJECT],[st.OL,W.OL],[st.OPTGROUP,W.OPTGROUP],[st.OPTION,W.OPTION],[st.P,W.P],[st.PARAM,W.PARAM],[st.PLAINTEXT,W.PLAINTEXT],[st.PRE,W.PRE],[st.RB,W.RB],[st.RP,W.RP],[st.RT,W.RT],[st.RTC,W.RTC],[st.RUBY,W.RUBY],[st.S,W.S],[st.SCRIPT,W.SCRIPT],[st.SEARCH,W.SEARCH],[st.SECTION,W.SECTION],[st.SELECT,W.SELECT],[st.SOURCE,W.SOURCE],[st.SMALL,W.SMALL],[st.SPAN,W.SPAN],[st.STRIKE,W.STRIKE],[st.STRONG,W.STRONG],[st.STYLE,W.STYLE],[st.SUB,W.SUB],[st.SUMMARY,W.SUMMARY],[st.SUP,W.SUP],[st.TABLE,W.TABLE],[st.TBODY,W.TBODY],[st.TEMPLATE,W.TEMPLATE],[st.TEXTAREA,W.TEXTAREA],[st.TFOOT,W.TFOOT],[st.TD,W.TD],[st.TH,W.TH],[st.THEAD,W.THEAD],[st.TITLE,W.TITLE],[st.TR,W.TR],[st.TRACK,W.TRACK],[st.TT,W.TT],[st.U,W.U],[st.UL,W.UL],[st.SVG,W.SVG],[st.VAR,W.VAR],[st.WBR,W.WBR],[st.XMP,W.XMP]]);function JE(t){var e;return(e=$Er.get(t))!==null&&e!==void 0?e:W.UNKNOWN}const jt=W,FEr={[Ut.HTML]:new Set([jt.ADDRESS,jt.APPLET,jt.AREA,jt.ARTICLE,jt.ASIDE,jt.BASE,jt.BASEFONT,jt.BGSOUND,jt.BLOCKQUOTE,jt.BODY,jt.BR,jt.BUTTON,jt.CAPTION,jt.CENTER,jt.COL,jt.COLGROUP,jt.DD,jt.DETAILS,jt.DIR,jt.DIV,jt.DL,jt.DT,jt.EMBED,jt.FIELDSET,jt.FIGCAPTION,jt.FIGURE,jt.FOOTER,jt.FORM,jt.FRAME,jt.FRAMESET,jt.H1,jt.H2,jt.H3,jt.H4,jt.H5,jt.H6,jt.HEAD,jt.HEADER,jt.HGROUP,jt.HR,jt.HTML,jt.IFRAME,jt.IMG,jt.INPUT,jt.LI,jt.LINK,jt.LISTING,jt.MAIN,jt.MARQUEE,jt.MENU,jt.META,jt.NAV,jt.NOEMBED,jt.NOFRAMES,jt.NOSCRIPT,jt.OBJECT,jt.OL,jt.P,jt.PARAM,jt.PLAINTEXT,jt.PRE,jt.SCRIPT,jt.SECTION,jt.SELECT,jt.SOURCE,jt.STYLE,jt.SUMMARY,jt.TABLE,jt.TBODY,jt.TD,jt.TEMPLATE,jt.TEXTAREA,jt.TFOOT,jt.TH,jt.THEAD,jt.TITLE,jt.TR,jt.TRACK,jt.UL,jt.WBR,jt.XMP]),[Ut.MATHML]:new Set([jt.MI,jt.MO,jt.MN,jt.MS,jt.MTEXT,jt.ANNOTATION_XML]),[Ut.SVG]:new Set([jt.TITLE,jt.FOREIGN_OBJECT,jt.DESC]),[Ut.XLINK]:new Set,[Ut.XML]:new Set,[Ut.XMLNS]:new Set},uhe=new Set([jt.H1,jt.H2,jt.H3,jt.H4,jt.H5,jt.H6]);st.STYLE,st.SCRIPT,st.XMP,st.IFRAME,st.NOEMBED,st.NOFRAMES,st.PLAINTEXT;var Ge;(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"})(Ge||(Ge={}));const us={DATA:Ge.DATA,RCDATA:Ge.RCDATA,RAWTEXT:Ge.RAWTEXT,SCRIPT_DATA:Ge.SCRIPT_DATA,PLAINTEXT:Ge.PLAINTEXT,CDATA_SECTION:Ge.CDATA_SECTION};function zEr(t){return t>=Ue.DIGIT_0&&t<=Ue.DIGIT_9}function vN(t){return t>=Ue.LATIN_CAPITAL_A&&t<=Ue.LATIN_CAPITAL_Z}function UEr(t){return t>=Ue.LATIN_SMALL_A&&t<=Ue.LATIN_SMALL_Z}function vx(t){return UEr(t)||vN(t)}function _nt(t){return vx(t)||zEr(t)}function _G(t){return t+32}function Rnt(t){return t===Ue.SPACE||t===Ue.LINE_FEED||t===Ue.TABULATION||t===Ue.FORM_FEED}function Dnt(t){return Rnt(t)||t===Ue.SOLIDUS||t===Ue.GREATER_THAN_SIGN}function VEr(t){return t===Ue.NULL?bt.nullCharacterReference:t>1114111?bt.characterReferenceOutsideUnicodeRange:Cnt(t)?bt.surrogateCharacterReference:knt(t)?bt.noncharacterCharacterReference:Ont(t)||t===Ue.CARRIAGE_RETURN?bt.controlCharacterReference:null}class QEr{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=Ge.DATA,this.returnState=Ge.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new EEr(r),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new NEr(_Er,(n,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(n)},r.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(bt.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:n=>{this._err(bt.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+n)},validateNumericCharacterReference:n=>{const i=VEr(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(bt.endTagWithAttributes),e.selfClosing&&this._err(bt.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 ai.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case ai.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case ai.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:ai.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=Rnt(e)?ai.WHITESPACE_CHARACTER:e===Ue.NULL?ai.NULL_CHARACTER:ai.CHARACTER;this._appendCharToCurrentCharacterToken(r,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(ai.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=Ge.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?sy.Attribute:sy.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Ge.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Ge.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Ge.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case Ge.DATA:{this._stateData(e);break}case Ge.RCDATA:{this._stateRcdata(e);break}case Ge.RAWTEXT:{this._stateRawtext(e);break}case Ge.SCRIPT_DATA:{this._stateScriptData(e);break}case Ge.PLAINTEXT:{this._statePlaintext(e);break}case Ge.TAG_OPEN:{this._stateTagOpen(e);break}case Ge.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case Ge.TAG_NAME:{this._stateTagName(e);break}case Ge.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case Ge.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case Ge.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case Ge.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case Ge.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case Ge.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case Ge.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case Ge.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case Ge.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case Ge.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case Ge.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case Ge.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case Ge.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case Ge.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case Ge.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case Ge.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case Ge.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case Ge.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case Ge.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case Ge.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case Ge.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case Ge.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case Ge.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case Ge.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case Ge.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case Ge.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case Ge.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case Ge.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case Ge.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case Ge.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case Ge.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case Ge.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case Ge.BOGUS_COMMENT:{this._stateBogusComment(e);break}case Ge.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case Ge.COMMENT_START:{this._stateCommentStart(e);break}case Ge.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case Ge.COMMENT:{this._stateComment(e);break}case Ge.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case Ge.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case Ge.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case Ge.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case Ge.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case Ge.COMMENT_END:{this._stateCommentEnd(e);break}case Ge.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case Ge.DOCTYPE:{this._stateDoctype(e);break}case Ge.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case Ge.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case Ge.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case Ge.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case Ge.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case Ge.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case Ge.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case Ge.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case Ge.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case Ge.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case Ge.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case Ge.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case Ge.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case Ge.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case Ge.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case Ge.CDATA_SECTION:{this._stateCdataSection(e);break}case Ge.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case Ge.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case Ge.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Ge.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case Ue.LESS_THAN_SIGN:{this.state=Ge.TAG_OPEN;break}case Ue.AMPERSAND:{this._startCharacterReference();break}case Ue.NULL:{this._err(bt.unexpectedNullCharacter),this._emitCodePoint(e);break}case Ue.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case Ue.AMPERSAND:{this._startCharacterReference();break}case Ue.LESS_THAN_SIGN:{this.state=Ge.RCDATA_LESS_THAN_SIGN;break}case Ue.NULL:{this._err(bt.unexpectedNullCharacter),this._emitChars(bo);break}case Ue.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case Ue.LESS_THAN_SIGN:{this.state=Ge.RAWTEXT_LESS_THAN_SIGN;break}case Ue.NULL:{this._err(bt.unexpectedNullCharacter),this._emitChars(bo);break}case Ue.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case Ue.LESS_THAN_SIGN:{this.state=Ge.SCRIPT_DATA_LESS_THAN_SIGN;break}case Ue.NULL:{this._err(bt.unexpectedNullCharacter),this._emitChars(bo);break}case Ue.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case Ue.NULL:{this._err(bt.unexpectedNullCharacter),this._emitChars(bo);break}case Ue.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(vx(e))this._createStartTagToken(),this.state=Ge.TAG_NAME,this._stateTagName(e);else switch(e){case Ue.EXCLAMATION_MARK:{this.state=Ge.MARKUP_DECLARATION_OPEN;break}case Ue.SOLIDUS:{this.state=Ge.END_TAG_OPEN;break}case Ue.QUESTION_MARK:{this._err(bt.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Ge.BOGUS_COMMENT,this._stateBogusComment(e);break}case Ue.EOF:{this._err(bt.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(bt.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Ge.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(vx(e))this._createEndTagToken(),this.state=Ge.TAG_NAME,this._stateTagName(e);else switch(e){case Ue.GREATER_THAN_SIGN:{this._err(bt.missingEndTagName),this.state=Ge.DATA;break}case Ue.EOF:{this._err(bt.eofBeforeTagName),this._emitChars("");break}case Ue.NULL:{this._err(bt.unexpectedNullCharacter),this.state=Ge.SCRIPT_DATA_ESCAPED,this._emitChars(bo);break}case Ue.EOF:{this._err(bt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Ge.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===Ue.SOLIDUS?this.state=Ge.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:vx(e)?(this._emitChars("<"),this.state=Ge.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=Ge.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){vx(e)?(this.state=Ge.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("");break}case Ue.NULL:{this._err(bt.unexpectedNullCharacter),this.state=Ge.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(bo);break}case Ue.EOF:{this._err(bt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Ge.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===Ue.SOLIDUS?(this.state=Ge.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Ge.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Ph.SCRIPT,!1)&&Dnt(this.preprocessor.peek(Ph.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(qEr,Ut.HTML)}clearBackToTableBodyContext(){this.clearBackTo(YEr,Ut.HTML)}clearBackToTableRowContext(){this.clearBackTo(WEr,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]===W.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]===W.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(Pnt.has(i))return!1;break}case Ut.MATHML:{if(Int.has(i))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,RG)}hasInListItemScope(e){return this.hasInDynamicScope(e,GEr)}hasInButtonScope(e){return this.hasInDynamicScope(e,HEr)}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(uhe.has(r))return!0;if(RG.has(r))return!1;break}case Ut.SVG:{if(Pnt.has(r))return!1;break}case Ut.MATHML:{if(Int.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 W.TABLE:case W.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 W.TBODY:case W.THEAD:case W.TFOOT:return!0;case W.TABLE:case W.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 W.OPTION:case W.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Lnt.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Mnt.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&Mnt.has(this.currentTagId);)this.pop()}}const hhe=3;var Sm;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(Sm||(Sm={}));const Nnt={type:Sm.Marker};class KEr{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,r){const n=[],i=r.length,a=this.treeAdapter.getTagName(e),o=this.treeAdapter.getNamespaceURI(e);for(let s=0;s[o.name,o.value]));let a=0;for(let o=0;oi.get(l.name)===l.value)&&(a+=1,a>=hhe&&this.entries.splice(s.idx,1))}}insertMarker(){this.entries.unshift(Nnt)}pushElement(e,r){this._ensureNoahArkCondition(e),this.entries.unshift({type:Sm.Element,element:e,token:r})}insertElementAfterBookmark(e,r){const n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:Sm.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(Nnt);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const r=this.entries.find(n=>n.type===Sm.Marker||this.treeAdapter.getTagName(n.element)===e);return r&&r.type===Sm.Element?r:null}getElementEntry(e){return this.entries.find(r=>r.type===Sm.Element&&r.element===e)}}const yx={createDocument(){return{nodeName:"#document",mode:Gf.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};yx.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(yx.isTextNode(r)){r.value+=e;return}}yx.appendChild(t,yx.createTextNode(e))},insertTextBefore(t,e,r){const n=t.childNodes[t.childNodes.indexOf(r)-1];n&&yx.isTextNode(n)?n.value+=e:yx.insertBefore(t,yx.createTextNode(e),r)},adoptAttributes(t,e){const r=new Set(t.attrs.map(n=>n.name));for(let n=0;nt.startsWith(r))}function n_r(t){return t.name===Bnt&&t.publicId===null&&(t.systemId===null||t.systemId===ZEr)}function i_r(t){if(t.name!==Bnt)return Gf.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===JEr)return Gf.QUIRKS;let{publicId:r}=t;if(r!==null){if(r=r.toLowerCase(),t_r.has(r))return Gf.QUIRKS;let n=e===null?e_r:$nt;if(znt(r,n))return Gf.QUIRKS;if(n=e===null?Fnt:r_r,znt(r,n))return Gf.LIMITED_QUIRKS}return Gf.NO_QUIRKS}const Unt={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},a_r="definitionurl",o_r="definitionURL",s_r=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])),l_r=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}]]),c_r=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])),u_r=new Set([W.B,W.BIG,W.BLOCKQUOTE,W.BODY,W.BR,W.CENTER,W.CODE,W.DD,W.DIV,W.DL,W.DT,W.EM,W.EMBED,W.H1,W.H2,W.H3,W.H4,W.H5,W.H6,W.HEAD,W.HR,W.I,W.IMG,W.LI,W.LISTING,W.MENU,W.META,W.NOBR,W.OL,W.P,W.PRE,W.RUBY,W.S,W.SMALL,W.SPAN,W.STRONG,W.STRIKE,W.SUB,W.SUP,W.TABLE,W.TT,W.U,W.UL,W.VAR]);function h_r(t){const e=t.tagID;return e===W.FONT&&t.attrs.some(({name:n})=>n===NA.COLOR||n===NA.SIZE||n===NA.FACE)||u_r.has(e)}function Vnt(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,o;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,o=this.fragmentContextID):{current:a,currentTagId:o}=this.openElements,this._setContextModes(a,o)}}_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=us.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 W.TITLE:case W.TEXTAREA:{this.tokenizer.state=us.RCDATA;break}case W.STYLE:case W.XMP:case W.IFRAME:case W.NOEMBED:case W.NOFRAMES:case W.NOSCRIPT:{this.tokenizer.state=us.RAWTEXT;break}case W.SCRIPT:{this.tokenizer.state=us.SCRIPT_DATA;break}case W.PLAINTEXT:{this.tokenizer.state=us.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 o=this.treeAdapter.getChildNodes(this.document).find(s=>this.treeAdapter.isDocumentTypeNode(s));o&&this.treeAdapter.setNodeSourceCodeLocation(o,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,W.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,o=i[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:l,endCol:u,endOffset:h}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:l,endCol:u,endOffset:h})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,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===ai.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===W.SVG&&this.treeAdapter.getTagName(r)===st.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(r)===Ut.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===W.MGLYPH||e.tagID===W.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,r,Ut.HTML)}_processToken(e){switch(e.type){case ai.CHARACTER:{this.onCharacter(e);break}case ai.NULL_CHARACTER:{this.onNullCharacter(e);break}case ai.COMMENT:{this.onComment(e);break}case ai.DOCTYPE:{this.onDoctype(e);break}case ai.START_TAG:{this._processStartTag(e);break}case ai.END_TAG:{this.onEndTag(e);break}case ai.EOF:{this.onEof(e);break}case ai.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,r,n){const i=this.treeAdapter.getNamespaceURI(r),a=this.treeAdapter.getAttrList(r);return g_r(e,i,a,n)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const r=this.activeFormattingElements.entries.findIndex(i=>i.type===Sm.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(W.P),this.openElements.popUntilTagNamePopped(W.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case W.TR:{this.insertionMode=Ke.IN_ROW;return}case W.TBODY:case W.THEAD:case W.TFOOT:{this.insertionMode=Ke.IN_TABLE_BODY;return}case W.CAPTION:{this.insertionMode=Ke.IN_CAPTION;return}case W.COLGROUP:{this.insertionMode=Ke.IN_COLUMN_GROUP;return}case W.TABLE:{this.insertionMode=Ke.IN_TABLE;return}case W.BODY:{this.insertionMode=Ke.IN_BODY;return}case W.FRAMESET:{this.insertionMode=Ke.IN_FRAMESET;return}case W.SELECT:{this._resetInsertionModeForSelect(e);return}case W.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case W.HTML:{this.insertionMode=this.headElement?Ke.AFTER_HEAD:Ke.BEFORE_HEAD;return}case W.TD:case W.TH:{if(e>0){this.insertionMode=Ke.IN_CELL;return}break}case W.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===W.TEMPLATE)break;if(n===W.TABLE){this.insertionMode=Ke.IN_SELECT_IN_TABLE;return}}this.insertionMode=Ke.IN_SELECT}_isElementCausesFosterParenting(e){return Gnt.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 W.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(r)===Ut.HTML)return{parent:this.treeAdapter.getTemplateContent(r),beforeElement:null};break}case W.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 FEr[n].has(r)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){j5r(this,e);return}switch(this.insertionMode){case Ke.INITIAL:{yN(this,e);break}case Ke.BEFORE_HTML:{bN(this,e);break}case Ke.BEFORE_HEAD:{xN(this,e);break}case Ke.IN_HEAD:{wN(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{AN(this,e);break}case Ke.AFTER_HEAD:{SN(this,e);break}case Ke.IN_BODY:case Ke.IN_CAPTION:case Ke.IN_CELL:case Ke.IN_TEMPLATE:{qnt(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:{mhe(this,e);break}case Ke.IN_TABLE_TEXT:{rit(this,e);break}case Ke.IN_COLUMN_GROUP:{MG(this,e);break}case Ke.AFTER_BODY:{NG(this,e);break}case Ke.AFTER_AFTER_BODY:{BG(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){q5r(this,e);return}switch(this.insertionMode){case Ke.INITIAL:{yN(this,e);break}case Ke.BEFORE_HTML:{bN(this,e);break}case Ke.BEFORE_HEAD:{xN(this,e);break}case Ke.IN_HEAD:{wN(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{AN(this,e);break}case Ke.AFTER_HEAD:{SN(this,e);break}case Ke.TEXT:{this._insertCharacters(e);break}case Ke.IN_TABLE:case Ke.IN_TABLE_BODY:case Ke.IN_ROW:{mhe(this,e);break}case Ke.IN_COLUMN_GROUP:{MG(this,e);break}case Ke.AFTER_BODY:{NG(this,e);break}case Ke.AFTER_AFTER_BODY:{BG(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){phe(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:{phe(this,e);break}case Ke.IN_TABLE_TEXT:{ON(this,e);break}case Ke.AFTER_BODY:{O_r(this,e);break}case Ke.AFTER_AFTER_BODY:case Ke.AFTER_AFTER_FRAMESET:{k_r(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case Ke.INITIAL:{E_r(this,e);break}case Ke.BEFORE_HEAD:case Ke.IN_HEAD:case Ke.IN_HEAD_NO_SCRIPT:case Ke.AFTER_HEAD:{this._err(e,bt.misplacedDoctype);break}case Ke.IN_TABLE_TEXT:{ON(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,bt.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?X5r(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case Ke.INITIAL:{yN(this,e);break}case Ke.BEFORE_HTML:{__r(this,e);break}case Ke.BEFORE_HEAD:{D_r(this,e);break}case Ke.IN_HEAD:{rg(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{I_r(this,e);break}case Ke.AFTER_HEAD:{N_r(this,e);break}case Ke.IN_BODY:{Qc(this,e);break}case Ke.IN_TABLE:{e_(this,e);break}case Ke.IN_TABLE_TEXT:{ON(this,e);break}case Ke.IN_CAPTION:{L5r(this,e);break}case Ke.IN_COLUMN_GROUP:{vhe(this,e);break}case Ke.IN_TABLE_BODY:{IG(this,e);break}case Ke.IN_ROW:{PG(this,e);break}case Ke.IN_CELL:{P5r(this,e);break}case Ke.IN_SELECT:{ait(this,e);break}case Ke.IN_SELECT_IN_TABLE:{B5r(this,e);break}case Ke.IN_TEMPLATE:{F5r(this,e);break}case Ke.AFTER_BODY:{U5r(this,e);break}case Ke.IN_FRAMESET:{V5r(this,e);break}case Ke.AFTER_FRAMESET:{G5r(this,e);break}case Ke.AFTER_AFTER_BODY:{W5r(this,e);break}case Ke.AFTER_AFTER_FRAMESET:{Y5r(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?K5r(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case Ke.INITIAL:{yN(this,e);break}case Ke.BEFORE_HTML:{R_r(this,e);break}case Ke.BEFORE_HEAD:{L_r(this,e);break}case Ke.IN_HEAD:{M_r(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{P_r(this,e);break}case Ke.AFTER_HEAD:{B_r(this,e);break}case Ke.IN_BODY:{LG(this,e);break}case Ke.TEXT:{A5r(this,e);break}case Ke.IN_TABLE:{TN(this,e);break}case Ke.IN_TABLE_TEXT:{ON(this,e);break}case Ke.IN_CAPTION:{M5r(this,e);break}case Ke.IN_COLUMN_GROUP:{I5r(this,e);break}case Ke.IN_TABLE_BODY:{yhe(this,e);break}case Ke.IN_ROW:{iit(this,e);break}case Ke.IN_CELL:{N5r(this,e);break}case Ke.IN_SELECT:{oit(this,e);break}case Ke.IN_SELECT_IN_TABLE:{$5r(this,e);break}case Ke.IN_TEMPLATE:{z5r(this,e);break}case Ke.AFTER_BODY:{lit(this,e);break}case Ke.IN_FRAMESET:{Q5r(this,e);break}case Ke.AFTER_FRAMESET:{H5r(this,e);break}case Ke.AFTER_AFTER_BODY:{BG(this,e);break}}}onEof(e){switch(this.insertionMode){case Ke.INITIAL:{yN(this,e);break}case Ke.BEFORE_HTML:{bN(this,e);break}case Ke.BEFORE_HEAD:{xN(this,e);break}case Ke.IN_HEAD:{wN(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{AN(this,e);break}case Ke.AFTER_HEAD:{SN(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:{eit(this,e);break}case Ke.TEXT:{S5r(this,e);break}case Ke.IN_TABLE_TEXT:{ON(this,e);break}case Ke.IN_TEMPLATE:{sit(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:{ghe(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===Ue.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:{Ynt(this,e);break}case Ke.IN_TABLE:case Ke.IN_TABLE_BODY:case Ke.IN_ROW:{mhe(this,e);break}case Ke.IN_TABLE_TEXT:{tit(this,e);break}}}};function x_r(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):Jnt(t,e),r}function w_r(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 A_r(t,e,r){let n=e,i=t.openElements.getCommonAncestor(e);for(let a=0,o=i;o!==r;a++,o=i){i=t.openElements.getCommonAncestor(o);const s=t.activeFormattingElements.getElementEntry(o),l=s&&a>=y_r;!s||l?(l&&t.activeFormattingElements.removeEntry(s),t.openElements.remove(o)):(o=S_r(t,s),n===e&&(t.activeFormattingElements.bookmark=s),t.treeAdapter.detachNode(n),t.treeAdapter.appendChild(o,n),n=o)}return n}function S_r(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 T_r(t,e,r){const n=t.treeAdapter.getTagName(e),i=JE(n);if(t._isElementCausesFosterParenting(i))t._fosterParentElement(r);else{const a=t.treeAdapter.getNamespaceURI(e);i===W.TEMPLATE&&a===Ut.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,r)}}function C_r(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 fhe(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],o=t.treeAdapter.getNodeSourceCodeLocation(a);o&&!o.endTag&&t._setEndLocation(a,e)}}}}function E_r(t,e){t._setDocumentType(e);const r=e.forceQuirks?Gf.QUIRKS:i_r(e);n_r(e)||t._err(e,bt.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,r),t.insertionMode=Ke.BEFORE_HTML}function yN(t,e){t._err(e,bt.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,Gf.QUIRKS),t.insertionMode=Ke.BEFORE_HTML,t._processToken(e)}function __r(t,e){e.tagID===W.HTML?(t._insertElement(e,Ut.HTML),t.insertionMode=Ke.BEFORE_HEAD):bN(t,e)}function R_r(t,e){const r=e.tagID;(r===W.HTML||r===W.HEAD||r===W.BODY||r===W.BR)&&bN(t,e)}function bN(t,e){t._insertFakeRootElement(),t.insertionMode=Ke.BEFORE_HEAD,t._processToken(e)}function D_r(t,e){switch(e.tagID){case W.HTML:{Qc(t,e);break}case W.HEAD:{t._insertElement(e,Ut.HTML),t.headElement=t.openElements.current,t.insertionMode=Ke.IN_HEAD;break}default:xN(t,e)}}function L_r(t,e){const r=e.tagID;r===W.HEAD||r===W.BODY||r===W.HTML||r===W.BR?xN(t,e):t._err(e,bt.endTagWithoutMatchingOpenElement)}function xN(t,e){t._insertFakeElement(st.HEAD,W.HEAD),t.headElement=t.openElements.current,t.insertionMode=Ke.IN_HEAD,t._processToken(e)}function rg(t,e){switch(e.tagID){case W.HTML:{Qc(t,e);break}case W.BASE:case W.BASEFONT:case W.BGSOUND:case W.LINK:case W.META:{t._appendElement(e,Ut.HTML),e.ackSelfClosing=!0;break}case W.TITLE:{t._switchToTextParsing(e,us.RCDATA);break}case W.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,us.RAWTEXT):(t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_HEAD_NO_SCRIPT);break}case W.NOFRAMES:case W.STYLE:{t._switchToTextParsing(e,us.RAWTEXT);break}case W.SCRIPT:{t._switchToTextParsing(e,us.SCRIPT_DATA);break}case W.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=Ke.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(Ke.IN_TEMPLATE);break}case W.HEAD:{t._err(e,bt.misplacedStartTagForHeadElement);break}default:wN(t,e)}}function M_r(t,e){switch(e.tagID){case W.HEAD:{t.openElements.pop(),t.insertionMode=Ke.AFTER_HEAD;break}case W.BODY:case W.BR:case W.HTML:{wN(t,e);break}case W.TEMPLATE:{BA(t,e);break}default:t._err(e,bt.endTagWithoutMatchingOpenElement)}}function BA(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==W.TEMPLATE&&t._err(e,bt.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(W.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,bt.endTagWithoutMatchingOpenElement)}function wN(t,e){t.openElements.pop(),t.insertionMode=Ke.AFTER_HEAD,t._processToken(e)}function I_r(t,e){switch(e.tagID){case W.HTML:{Qc(t,e);break}case W.BASEFONT:case W.BGSOUND:case W.HEAD:case W.LINK:case W.META:case W.NOFRAMES:case W.STYLE:{rg(t,e);break}case W.NOSCRIPT:{t._err(e,bt.nestedNoscriptInHead);break}default:AN(t,e)}}function P_r(t,e){switch(e.tagID){case W.NOSCRIPT:{t.openElements.pop(),t.insertionMode=Ke.IN_HEAD;break}case W.BR:{AN(t,e);break}default:t._err(e,bt.endTagWithoutMatchingOpenElement)}}function AN(t,e){const r=e.type===ai.EOF?bt.openElementsLeftAfterEof:bt.disallowedContentInNoscriptInHead;t._err(e,r),t.openElements.pop(),t.insertionMode=Ke.IN_HEAD,t._processToken(e)}function N_r(t,e){switch(e.tagID){case W.HTML:{Qc(t,e);break}case W.BODY:{t._insertElement(e,Ut.HTML),t.framesetOk=!1,t.insertionMode=Ke.IN_BODY;break}case W.FRAMESET:{t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_FRAMESET;break}case W.BASE:case W.BASEFONT:case W.BGSOUND:case W.LINK:case W.META:case W.NOFRAMES:case W.SCRIPT:case W.STYLE:case W.TEMPLATE:case W.TITLE:{t._err(e,bt.abandonedHeadElementChild),t.openElements.push(t.headElement,W.HEAD),rg(t,e),t.openElements.remove(t.headElement);break}case W.HEAD:{t._err(e,bt.misplacedStartTagForHeadElement);break}default:SN(t,e)}}function B_r(t,e){switch(e.tagID){case W.BODY:case W.HTML:case W.BR:{SN(t,e);break}case W.TEMPLATE:{BA(t,e);break}default:t._err(e,bt.endTagWithoutMatchingOpenElement)}}function SN(t,e){t._insertFakeElement(st.BODY,W.BODY),t.insertionMode=Ke.IN_BODY,DG(t,e)}function DG(t,e){switch(e.type){case ai.CHARACTER:{qnt(t,e);break}case ai.WHITESPACE_CHARACTER:{Ynt(t,e);break}case ai.COMMENT:{phe(t,e);break}case ai.START_TAG:{Qc(t,e);break}case ai.END_TAG:{LG(t,e);break}case ai.EOF:{eit(t,e);break}}}function Ynt(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function qnt(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function $_r(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function F_r(t,e){const r=t.openElements.tryPeekProperlyNestedBodyElement();r&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(r,e.attrs))}function z_r(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 U_r(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._insertElement(e,Ut.HTML)}function V_r(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&uhe.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,Ut.HTML)}function Q_r(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._insertElement(e,Ut.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function G_r(t,e){const r=t.openElements.tmplCount>0;(!t.formElement||r)&&(t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._insertElement(e,Ut.HTML),r||(t.formElement=t.openElements.current))}function H_r(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===W.LI&&i===W.LI||(r===W.DD||r===W.DT)&&(i===W.DD||i===W.DT)){t.openElements.generateImpliedEndTagsWithExclusion(i),t.openElements.popUntilTagNamePopped(i);break}if(i!==W.ADDRESS&&i!==W.DIV&&i!==W.P&&t._isSpecialElement(t.openElements.items[n],i))break}t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._insertElement(e,Ut.HTML)}function W_r(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._insertElement(e,Ut.HTML),t.tokenizer.state=us.PLAINTEXT}function Y_r(t,e){t.openElements.hasInScope(W.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(W.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML),t.framesetOk=!1}function q_r(t,e){const r=t.activeFormattingElements.getElementEntryInScopeWithTagName(st.A);r&&(fhe(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 j_r(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function X_r(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(W.NOBR)&&(fhe(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,Ut.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function K_r(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function Z_r(t,e){t.treeAdapter.getDocumentMode(t.document)!==Gf.QUIRKS&&t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._insertElement(e,Ut.HTML),t.framesetOk=!1,t.insertionMode=Ke.IN_TABLE}function jnt(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ut.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function Xnt(t){const e=Ent(t,NA.TYPE);return e!=null&&e.toLowerCase()===m_r}function J_r(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ut.HTML),Xnt(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function e5r(t,e){t._appendElement(e,Ut.HTML),e.ackSelfClosing=!0}function t5r(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._appendElement(e,Ut.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function r5r(t,e){e.tagName=st.IMG,e.tagID=W.IMG,jnt(t,e)}function n5r(t,e){t._insertElement(e,Ut.HTML),t.skipNextNewLine=!0,t.tokenizer.state=us.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=Ke.TEXT}function i5r(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,us.RAWTEXT)}function a5r(t,e){t.framesetOk=!1,t._switchToTextParsing(e,us.RAWTEXT)}function Knt(t,e){t._switchToTextParsing(e,us.RAWTEXT)}function o5r(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 s5r(t,e){t.openElements.currentTagId===W.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML)}function l5r(t,e){t.openElements.hasInScope(W.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,Ut.HTML)}function c5r(t,e){t.openElements.hasInScope(W.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(W.RTC),t._insertElement(e,Ut.HTML)}function u5r(t,e){t._reconstructActiveFormattingElements(),Vnt(e),dhe(e),e.selfClosing?t._appendElement(e,Ut.MATHML):t._insertElement(e,Ut.MATHML),e.ackSelfClosing=!0}function h5r(t,e){t._reconstructActiveFormattingElements(),Qnt(e),dhe(e),e.selfClosing?t._appendElement(e,Ut.SVG):t._insertElement(e,Ut.SVG),e.ackSelfClosing=!0}function Znt(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML)}function Qc(t,e){switch(e.tagID){case W.I:case W.S:case W.B:case W.U:case W.EM:case W.TT:case W.BIG:case W.CODE:case W.FONT:case W.SMALL:case W.STRIKE:case W.STRONG:{j_r(t,e);break}case W.A:{q_r(t,e);break}case W.H1:case W.H2:case W.H3:case W.H4:case W.H5:case W.H6:{V_r(t,e);break}case W.P:case W.DL:case W.OL:case W.UL:case W.DIV:case W.DIR:case W.NAV:case W.MAIN:case W.MENU:case W.ASIDE:case W.CENTER:case W.FIGURE:case W.FOOTER:case W.HEADER:case W.HGROUP:case W.DIALOG:case W.DETAILS:case W.ADDRESS:case W.ARTICLE:case W.SEARCH:case W.SECTION:case W.SUMMARY:case W.FIELDSET:case W.BLOCKQUOTE:case W.FIGCAPTION:{U_r(t,e);break}case W.LI:case W.DD:case W.DT:{H_r(t,e);break}case W.BR:case W.IMG:case W.WBR:case W.AREA:case W.EMBED:case W.KEYGEN:{jnt(t,e);break}case W.HR:{t5r(t,e);break}case W.RB:case W.RTC:{l5r(t,e);break}case W.RT:case W.RP:{c5r(t,e);break}case W.PRE:case W.LISTING:{Q_r(t,e);break}case W.XMP:{i5r(t,e);break}case W.SVG:{h5r(t,e);break}case W.HTML:{$_r(t,e);break}case W.BASE:case W.LINK:case W.META:case W.STYLE:case W.TITLE:case W.SCRIPT:case W.BGSOUND:case W.BASEFONT:case W.TEMPLATE:{rg(t,e);break}case W.BODY:{F_r(t,e);break}case W.FORM:{G_r(t,e);break}case W.NOBR:{X_r(t,e);break}case W.MATH:{u5r(t,e);break}case W.TABLE:{Z_r(t,e);break}case W.INPUT:{J_r(t,e);break}case W.PARAM:case W.TRACK:case W.SOURCE:{e5r(t,e);break}case W.IMAGE:{r5r(t,e);break}case W.BUTTON:{Y_r(t,e);break}case W.APPLET:case W.OBJECT:case W.MARQUEE:{K_r(t,e);break}case W.IFRAME:{a5r(t,e);break}case W.SELECT:{o5r(t,e);break}case W.OPTION:case W.OPTGROUP:{s5r(t,e);break}case W.NOEMBED:case W.NOFRAMES:{Knt(t,e);break}case W.FRAMESET:{z_r(t,e);break}case W.TEXTAREA:{n5r(t,e);break}case W.NOSCRIPT:{t.options.scriptingEnabled?Knt(t,e):Znt(t,e);break}case W.PLAINTEXT:{W_r(t,e);break}case W.COL:case W.TH:case W.TD:case W.TR:case W.HEAD:case W.FRAME:case W.TBODY:case W.TFOOT:case W.THEAD:case W.CAPTION:case W.COLGROUP:break;default:Znt(t,e)}}function d5r(t,e){if(t.openElements.hasInScope(W.BODY)&&(t.insertionMode=Ke.AFTER_BODY,t.options.sourceCodeLocationInfo)){const r=t.openElements.tryPeekProperlyNestedBodyElement();r&&t._setEndLocation(r,e)}}function f5r(t,e){t.openElements.hasInScope(W.BODY)&&(t.insertionMode=Ke.AFTER_BODY,lit(t,e))}function p5r(t,e){const r=e.tagID;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(r))}function g5r(t){const e=t.openElements.tmplCount>0,{formElement:r}=t;e||(t.formElement=null),(r||e)&&t.openElements.hasInScope(W.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(W.FORM):r&&t.openElements.remove(r))}function m5r(t){t.openElements.hasInButtonScope(W.P)||t._insertFakeElement(st.P,W.P),t._closePElement()}function v5r(t){t.openElements.hasInListItemScope(W.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(W.LI),t.openElements.popUntilTagNamePopped(W.LI))}function y5r(t,e){const r=e.tagID;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.popUntilTagNamePopped(r))}function b5r(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function x5r(t,e){const r=e.tagID;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(r),t.activeFormattingElements.clearToLastMarker())}function w5r(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(st.BR,W.BR),t.openElements.pop(),t.framesetOk=!1}function Jnt(t,e){const r=e.tagName,n=e.tagID;for(let i=t.openElements.stackTop;i>0;i--){const a=t.openElements.items[i],o=t.openElements.tagIDs[i];if(n===o&&(n!==W.UNKNOWN||t.treeAdapter.getTagName(a)===r)){t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.stackTop>=i&&t.openElements.shortenToLength(i);break}if(t._isSpecialElement(a,o))break}}function LG(t,e){switch(e.tagID){case W.A:case W.B:case W.I:case W.S:case W.U:case W.EM:case W.TT:case W.BIG:case W.CODE:case W.FONT:case W.NOBR:case W.SMALL:case W.STRIKE:case W.STRONG:{fhe(t,e);break}case W.P:{m5r(t);break}case W.DL:case W.UL:case W.OL:case W.DIR:case W.DIV:case W.NAV:case W.PRE:case W.MAIN:case W.MENU:case W.ASIDE:case W.BUTTON:case W.CENTER:case W.FIGURE:case W.FOOTER:case W.HEADER:case W.HGROUP:case W.DIALOG:case W.ADDRESS:case W.ARTICLE:case W.DETAILS:case W.SEARCH:case W.SECTION:case W.SUMMARY:case W.LISTING:case W.FIELDSET:case W.BLOCKQUOTE:case W.FIGCAPTION:{p5r(t,e);break}case W.LI:{v5r(t);break}case W.DD:case W.DT:{y5r(t,e);break}case W.H1:case W.H2:case W.H3:case W.H4:case W.H5:case W.H6:{b5r(t);break}case W.BR:{w5r(t);break}case W.BODY:{d5r(t,e);break}case W.HTML:{f5r(t,e);break}case W.FORM:{g5r(t);break}case W.APPLET:case W.OBJECT:case W.MARQUEE:{x5r(t,e);break}case W.TEMPLATE:{BA(t,e);break}default:Jnt(t,e)}}function eit(t,e){t.tmplInsertionModeStack.length>0?sit(t,e):ghe(t,e)}function A5r(t,e){var r;e.tagID===W.SCRIPT&&((r=t.scriptHandler)===null||r===void 0||r.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function S5r(t,e){t._err(e,bt.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function mhe(t,e){if(t.openElements.currentTagId!==void 0&&Gnt.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 ai.CHARACTER:{rit(t,e);break}case ai.WHITESPACE_CHARACTER:{tit(t,e);break}}else CN(t,e)}function T5r(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_CAPTION}function C5r(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_COLUMN_GROUP}function O5r(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(st.COLGROUP,W.COLGROUP),t.insertionMode=Ke.IN_COLUMN_GROUP,vhe(t,e)}function k5r(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_TABLE_BODY}function E5r(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(st.TBODY,W.TBODY),t.insertionMode=Ke.IN_TABLE_BODY,IG(t,e)}function _5r(t,e){t.openElements.hasInTableScope(W.TABLE)&&(t.openElements.popUntilTagNamePopped(W.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function R5r(t,e){Xnt(e)?t._appendElement(e,Ut.HTML):CN(t,e),e.ackSelfClosing=!0}function D5r(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,Ut.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function e_(t,e){switch(e.tagID){case W.TD:case W.TH:case W.TR:{E5r(t,e);break}case W.STYLE:case W.SCRIPT:case W.TEMPLATE:{rg(t,e);break}case W.COL:{O5r(t,e);break}case W.FORM:{D5r(t,e);break}case W.TABLE:{_5r(t,e);break}case W.TBODY:case W.TFOOT:case W.THEAD:{k5r(t,e);break}case W.INPUT:{R5r(t,e);break}case W.CAPTION:{T5r(t,e);break}case W.COLGROUP:{C5r(t,e);break}default:CN(t,e)}}function TN(t,e){switch(e.tagID){case W.TABLE:{t.openElements.hasInTableScope(W.TABLE)&&(t.openElements.popUntilTagNamePopped(W.TABLE),t._resetInsertionMode());break}case W.TEMPLATE:{BA(t,e);break}case W.BODY:case W.CAPTION:case W.COL:case W.COLGROUP:case W.HTML:case W.TBODY:case W.TD:case W.TFOOT:case W.TH:case W.THEAD:case W.TR:break;default:CN(t,e)}}function CN(t,e){const r=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,DG(t,e),t.fosterParentingEnabled=r}function tit(t,e){t.pendingCharacterTokens.push(e)}function rit(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function ON(t,e){let r=0;if(t.hasNonWhitespacePendingCharacterToken)for(;r0&&t.openElements.currentTagId===W.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===W.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===W.OPTGROUP&&t.openElements.pop();break}case W.OPTION:{t.openElements.currentTagId===W.OPTION&&t.openElements.pop();break}case W.SELECT:{t.openElements.hasInSelectScope(W.SELECT)&&(t.openElements.popUntilTagNamePopped(W.SELECT),t._resetInsertionMode());break}case W.TEMPLATE:{BA(t,e);break}}}function B5r(t,e){const r=e.tagID;r===W.CAPTION||r===W.TABLE||r===W.TBODY||r===W.TFOOT||r===W.THEAD||r===W.TR||r===W.TD||r===W.TH?(t.openElements.popUntilTagNamePopped(W.SELECT),t._resetInsertionMode(),t._processStartTag(e)):ait(t,e)}function $5r(t,e){const r=e.tagID;r===W.CAPTION||r===W.TABLE||r===W.TBODY||r===W.TFOOT||r===W.THEAD||r===W.TR||r===W.TD||r===W.TH?t.openElements.hasInTableScope(r)&&(t.openElements.popUntilTagNamePopped(W.SELECT),t._resetInsertionMode(),t.onEndTag(e)):oit(t,e)}function F5r(t,e){switch(e.tagID){case W.BASE:case W.BASEFONT:case W.BGSOUND:case W.LINK:case W.META:case W.NOFRAMES:case W.SCRIPT:case W.STYLE:case W.TEMPLATE:case W.TITLE:{rg(t,e);break}case W.CAPTION:case W.COLGROUP:case W.TBODY:case W.TFOOT:case W.THEAD:{t.tmplInsertionModeStack[0]=Ke.IN_TABLE,t.insertionMode=Ke.IN_TABLE,e_(t,e);break}case W.COL:{t.tmplInsertionModeStack[0]=Ke.IN_COLUMN_GROUP,t.insertionMode=Ke.IN_COLUMN_GROUP,vhe(t,e);break}case W.TR:{t.tmplInsertionModeStack[0]=Ke.IN_TABLE_BODY,t.insertionMode=Ke.IN_TABLE_BODY,IG(t,e);break}case W.TD:case W.TH:{t.tmplInsertionModeStack[0]=Ke.IN_ROW,t.insertionMode=Ke.IN_ROW,PG(t,e);break}default:t.tmplInsertionModeStack[0]=Ke.IN_BODY,t.insertionMode=Ke.IN_BODY,Qc(t,e)}}function z5r(t,e){e.tagID===W.TEMPLATE&&BA(t,e)}function sit(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(W.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):ghe(t,e)}function U5r(t,e){e.tagID===W.HTML?Qc(t,e):NG(t,e)}function lit(t,e){var r;if(e.tagID===W.HTML){if(t.fragmentContext||(t.insertionMode=Ke.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===W.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 NG(t,e)}function NG(t,e){t.insertionMode=Ke.IN_BODY,DG(t,e)}function V5r(t,e){switch(e.tagID){case W.HTML:{Qc(t,e);break}case W.FRAMESET:{t._insertElement(e,Ut.HTML);break}case W.FRAME:{t._appendElement(e,Ut.HTML),e.ackSelfClosing=!0;break}case W.NOFRAMES:{rg(t,e);break}}}function Q5r(t,e){e.tagID===W.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==W.FRAMESET&&(t.insertionMode=Ke.AFTER_FRAMESET))}function G5r(t,e){switch(e.tagID){case W.HTML:{Qc(t,e);break}case W.NOFRAMES:{rg(t,e);break}}}function H5r(t,e){e.tagID===W.HTML&&(t.insertionMode=Ke.AFTER_AFTER_FRAMESET)}function W5r(t,e){e.tagID===W.HTML?Qc(t,e):BG(t,e)}function BG(t,e){t.insertionMode=Ke.IN_BODY,DG(t,e)}function Y5r(t,e){switch(e.tagID){case W.HTML:{Qc(t,e);break}case W.NOFRAMES:{rg(t,e);break}}}function q5r(t,e){e.chars=bo,t._insertCharacters(e)}function j5r(t,e){t._insertCharacters(e),t.framesetOk=!1}function cit(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 X5r(t,e){if(h_r(e))cit(t),t._startTagOutsideForeignContent(e);else{const r=t._getAdjustedCurrentElement(),n=t.treeAdapter.getNamespaceURI(r);n===Ut.MATHML?Vnt(e):n===Ut.SVG&&(d_r(e),Qnt(e)),dhe(e),e.selfClosing?t._appendElement(e,n):t._insertElement(e,n),e.ackSelfClosing=!0}}function K5r(t,e){if(e.tagID===W.P||e.tagID===W.BR){cit(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 Z5r=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,J5r=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),uit={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function hit(t,e){const r=cRr(t),n=qtt("type",{handlers:{root:eRr,element:tRr,text:rRr,comment:fit,doctype:nRr,raw:aRr},unknown:oRr}),i={parser:r?new Wnt(uit):Wnt.getFragmentParser(void 0,uit),handle(s){n(s,i)},stitches:!1,options:e||{}};n(t,i),t_(i,bm());const a=r?i.parser.document:i.parser.getFragment(),o=uEr(a,{file:i.options.file});return i.stitches&&hN(o,"comment",function(s,l,u){const h=s;if(h.value.stitch&&u&&l!==void 0){const d=u.children;return d[l]=h.value.stitch,l}}),o.type==="root"&&o.children.length===1&&o.children[0].type===t.type?o.children[0]:o}function dit(t,e){let r=-1;if(t)for(;++r4&&(e.parser.tokenizer.state=0);const r={type:ai.CHARACTER,chars:t.value,location:kN(t)};t_(e,bm(t)),e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken)}function nRr(t,e){const r={type:ai.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:kN(t)};t_(e,bm(t)),e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken)}function iRr(t,e){e.stitches=!0;const r=uRr(t);if("children"in t&&"children"in r){const n=hit({type:"root",children:t.children},e.options);r.children=n.children}fit({type:"comment",value:{stitch:r}},e)}function fit(t,e){const r=t.value,n={type:ai.COMMENT,data:r,location:kN(t)};t_(e,bm(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function aRr(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,pit(e,bm(t)),e.parser.tokenizer.write(e.options.tagfilter?t.value.replace(Z5r,"<$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 oRr(t,e){const r=t;if(e.options.passThrough&&e.options.passThrough.includes(r.type))iRr(r,e);else{let n="";throw J5r.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 t_(t,e){pit(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=us.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 pit(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 sRr(t,e){const r=t.tagName.toLowerCase();if(e.parser.tokenizer.state===us.PLAINTEXT)return;t_(e,bm(t));const n=e.parser.openElements.current;let i="namespaceURI"in n?n.namespaceURI:PA.html;i===PA.html&&r==="svg"&&(i=PA.svg);const a=gEr({...t,children:[]},{space:i===PA.svg?"svg":"html"}),o={type:ai.START_TAG,tagName:r,tagID:JE(r),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:kN(t)};e.parser.currentToken=o,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=r}function lRr(t,e){const r=t.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&SEr.includes(r)||e.parser.tokenizer.state===us.PLAINTEXT)return;t_(e,iG(t));const n={type:ai.END_TAG,tagName:r,tagID:JE(r),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:kN(t)};e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken),r===e.parser.tokenizer.lastStartTagName&&(e.parser.tokenizer.state===us.RCDATA||e.parser.tokenizer.state===us.RAWTEXT||e.parser.tokenizer.state===us.SCRIPT_DATA)&&(e.parser.tokenizer.state=us.DATA)}function cRr(t){const e=t.type==="root"?t.children[0]:t;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function kN(t){const e=bm(t)||{line:void 0,column:void 0,offset:void 0},r=iG(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 uRr(t){return"children"in t?HE({...t,children:[]}):HE(t)}function hRr(t){return function(e,r){return hit(e,{...t,file:r})}}var dRr=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,fRr=/[\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]/,pRr=/[\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]/,bhe={Space_Separator:dRr,ID_Start:fRr,ID_Continue:pRr},hs={isSpaceSeparator(t){return typeof t=="string"&&bhe.Space_Separator.test(t)},isIdStartChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="$"||t==="_"||bhe.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==="‍"||bhe.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 xhe,ku,ly,$G,bx,ng,Ol,whe,EN;var gRr=function(e,r){xhe=String(e),ku="start",ly=[],$G=0,bx=1,ng=0,Ol=void 0,whe=void 0,EN=void 0;do Ol=mRr(),bRr[ku]();while(Ol.type!=="eof");return typeof r=="function"?Ahe({"":EN},"",r):EN};function Ahe(t,e,r){const n=t[e];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let i=0;i0&&!r&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const tCr={tokenize:cCr,partial:!0};function rCr(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:oCr,continuation:{tokenize:sCr},exit:lCr}},text:{91:{name:"gfmFootnoteCall",tokenize:aCr},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:nCr,resolveTo:iCr}}}}function nCr(t,e,r){const n=this;let i=n.events.length;const a=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let o;for(;i--;){const l=n.events[i][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!o||!o._balanced)return r(l);const u=tg(n.sliceSerialize({start:o.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 iCr(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)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[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",o,e],["exit",o,e],["exit",a,e],t[t.length-2],t[t.length-1],["exit",n,e]];return t.splice(r,t.length-r+1,...s),t}function aCr(t,e,r){const n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let a=0,o;return s;function s(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&&!o||d===null||d===91||Oa(d))return r(d);if(d===93){t.exit("chunkString");const f=t.exit("gfmFootnoteCallString");return i.includes(tg(n.sliceSerialize(f)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(d),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):r(d)}return Oa(d)||(o=!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 oCr(t,e,r){const n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let a,o=0,s;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(o>999||g===93&&!s||g===null||g===91||Oa(g))return r(g);if(g===93){t.exit("chunkString");const m=t.exit("gfmFootnoteDefinitionLabelString");return a=tg(n.sliceSerialize(m)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),f}return Oa(g)||(s=!0),o++,t.consume(g),g===92?d:h}function d(g){return g===91||g===92||g===93?(t.consume(g),o++,h):h(g)}function f(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),i.includes(a)||i.push(a),Di(t,p,"gfmFootnoteDefinitionWhitespace")):r(g)}function p(g){return e(g)}}function sCr(t,e,r){return t.check(aN,e,t.attempt(tCr,e,r))}function lCr(t){t.exit("gfmFootnoteDefinition")}function cCr(t,e,r){const n=this;return Di(t,i,"gfmFootnoteDefinitionIndent",5);function i(a){const o=n.events[n.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?e(a):r(a)}}function uCr(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(o,s){let l=-1;for(;++l1?l(g):(o.consume(g),d++,p);if(d<2&&!r)return l(g);const v=o.exit("strikethroughSequenceTemporary"),y=QE(g);return v._open=!y||y===2&&!!m,v._close=!m||m===2&&!!y,s(g)}}}class hCr{constructor(){this.map=[]}add(e,r,n){dCr(this,e,r,n)}consume(e){if(this.map.sort(function(a,o){return a[0]-o[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 dCr(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 P=_>-1?n.events[_][1].type:null,L=P==="tableHead"||P==="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||(o=!0,a+=1),h(E)}function h(E){return E===null?r(E):en(E)?a>1?(a=0,n.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(E),t.exit("lineEnding"),p):r(E):gi(E)?Di(t,h,"whitespace")(E):(a+=1,o&&(o=!1,i+=1),E===124?(t.enter("tableCellDivider"),t.consume(E),t.exit("tableCellDivider"),o=!0,h):(t.enter("data"),d(E)))}function d(E){return E===null||E===124||Oa(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"),o=!1,gi(E)?Di(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?(o=!0,t.enter("tableCellDivider"),t.consume(E),t.exit("tableCellDivider"),m):A(E)}function m(E){return gi(E)?Di(t,v,"whitespace")(E):v(E)}function v(E){return E===58?(a+=1,o=!0,t.enter("tableDelimiterMarker"),t.consume(E),t.exit("tableDelimiterMarker"),y):E===45?(a+=1,y(E)):E===null||en(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?(o=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(E),t.exit("tableDelimiterMarker"),x):(t.exit("tableDelimiterFiller"),x(E))}function x(E){return gi(E)?Di(t,w,"whitespace")(E):w(E)}function w(E){return E===124?g(E):E===null||en(E)?!o||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||en(E)?(t.exit("tableRow"),e(E)):gi(E)?Di(t,T,"whitespace")(E):(t.enter("data"),C(E))}function C(E){return E===null||E===124||Oa(E)?(t.exit("data"),T(E)):(t.consume(E),E===92?k:C)}function k(E){return E===92||E===124?(t.consume(E),C):C(E)}}function mCr(t,e){let r=-1,n=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,l=0,u,h,d;const f=new hCr;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({},WE(e.events,i)),t.add(i,0,[["exit",a,e]]),a=void 0),a}function xrt(t,e,r,n,i){const a=[],o=WE(e.events,r);i&&(i.end=Object.assign({},o),a.push(["exit",i,e])),n.end=Object.assign({},o),a.push(["exit",n,e]),t.add(r+1,0,a)}function WE(t,e){const r=t[e],n=r[0]==="enter"?"start":"end";return r[1][n]}const vCr={name:"tasklistCheck",tokenize:bCr};function yCr(){return{text:{91:vCr}}}function bCr(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 Oa(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),o):r(l)}function o(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),s):r(l)}function s(l){return en(l)?e(l):gi(l)?t.check({tokenize:xCr},e,r)(l):r(l)}}function xCr(t,e,r){return Di(t,n,"whitespace");function n(i){return i===null?r(i):e(i)}}function wCr(t){return Wet([WTr(),rCr(),uCr(t),pCr(),yCr()])}const ACr={};function SCr(t){const e=this,r=t||ACr,n=e.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),a=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),o=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(wCr(r)),a.push(VTr()),o.push(QTr(r))}const wrt=function(t,e,r){const n=uN(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 krt(t,e,r){return t.type==="element"?DCr(t,e,r):t.type==="text"?r.whitespace==="normal"?Ert(t,r):LCr(t):[]}function DCr(t,e,r){const n=_rt(t,r),i=t.children||[];let a=-1,o=[];if(_Cr(t))return o;let s,l;for(Kue(t)||Crt(t)&&wrt(e,t,Crt)?l=` +`:ECr(t)?(s=2,l=2):Ort(t)&&(s=1,l=1);++a]+>")+")",s={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,s,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},C={className:"function",begin:"("+o+"[\\*&\\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,s,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,u,h,s]}]},s,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",s]},{begin:t.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function $Cr(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=BCr(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 FCr(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"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,r,i]};i.contains.push(s);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,o,y,s,l,u,h,r]}}function zCr(t){const e=t.regex,r=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="("+n+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",s={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,s,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:"("+o+"[\\*&\\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,s,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,u,h,s]}]},s,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 UCr(t){const e=t.regex,r=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+n+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",s={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,s,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},C={className:"function",begin:"("+o+"[\\*&\\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,s,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,u,h,s]}]},s,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",s]},{begin:t.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function VCr(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"],o={keyword:i.concat(a),built_in:e,literal:n},s=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:o},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"},s]},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:o,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"},s,b,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[s,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[s,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:o,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:o,relevance:0,contains:[y,l,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},w]}}const QCr=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_-]*/}}),GCr=["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"],HCr=["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"],WCr=[...GCr,...HCr],YCr=["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(),qCr=["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(),jCr=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),XCr=["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 KCr(t){const e=t.regex,r=QCr(t),n={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",a=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",s=[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:"\\."+o,relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+qCr.join("|")+")"},{begin:":(:)?("+jCr.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+XCr.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.CSS_NUMBER_MODE,...s,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...s,{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:YCr.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...s,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+WCr.join("|")+")\\b"}]}}function ZCr(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 JCr(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:"Drt(t,e,r-1))}function rOr(t){const e=t.regex,r="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",n=r+Drt("(?:<"+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,Rrt,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Rrt,u]}}const Lrt="[A-Za-z$_][0-9A-Za-z$_]*",nOr=["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"],iOr=["true","false","null","undefined","NaN","Infinity"],Mrt=["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"],Irt=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Prt=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],aOr=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],oOr=[].concat(Prt,Mrt,Irt);function sOr(t){const e=t.regex,r=(N,{after:F})=>{const B="",end:""},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={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}}},s={$pattern:Lrt,keyword:nOr,literal:iOr,built_in:oOr,"variable.language":aOr},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:s,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:s,contains:["self"].concat(x)});const w=[].concat(b,f.contains),A=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(w)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,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"}}]},C={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:{_:[...Mrt,...Irt]}},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 P(N){return e.concat("(?!",N.join("|"),")")}const L={match:e.concat(/\b/,P([...Prt,"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*=>",I={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:s,exports:{PARAMS_CONTAINS:A,CLASS_REFERENCE:C},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,C,{scope:"attr",match:n+e.lookahead(":"),relevance:0},I,{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:s,contains:A}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.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 lOr(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 qE="[0-9](_*[0-9])*",xG=`\\.(${qE})`,wG="[0-9a-fA-F](_*[0-9a-fA-F])*",cOr={className:"number",variants:[{begin:`(\\b(${qE})((${xG})|\\.)?|(${xG}))[eE][+-]?(${qE})[fFdD]?\\b`},{begin:`\\b(${qE})((${xG})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${xG})[fFdD]?\\b`},{begin:`\\b(${qE})[fFdD]\\b`},{begin:`\\b0[xX]((${wG})\\.?|(${wG})?\\.(${wG}))[pP][+-]?(${qE})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${wG})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function uOr(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},o={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(o);const s={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(o,{className:"string"}),"self"]}]},u=cOr,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,s,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,s,l,o,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},s,l]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},u]}}const hOr=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_-]*/}}),dOr=["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"],fOr=["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"],pOr=[...dOr,...fOr],gOr=["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(),Nrt=["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(),Brt=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),mOr=["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(),vOr=Nrt.concat(Brt).sort().reverse();function yOr(t){const e=hOr(t),r=vOr,n="and or not only",i="[\\w-]+",a="("+i+"|@\\{"+i+"\\})",o=[],s=[],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:gOr.join(" ")},d={begin:"\\(",end:"\\)",contains:s,keywords:h,relevance:0};s.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=s.concat({begin:/\{/,end:/\}/,contains:o}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},g={begin:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+mOr.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}]},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:s,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("+pOr.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:":("+Nrt.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Brt.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:f},{begin:"!important"},e.FUNCTION_DISPATCH]},b={begin:i+`:(:)?(${r.join("|")})`,returnBegin:!0,contains:[y]};return o.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:o}}function bOr(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 xOr(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},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},s=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,s,/:\/\/.*?\)/),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,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function AOr(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_]*/,s={"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:s,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 SOr(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},o={begin:/->\{/,end:/\}/},s={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:[s]},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}),o,{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,s]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,s,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return a.contains=g,o.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:g}}function TOr(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),o={scope:"variable",match:"\\$+"+n},s={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(?!\\()"),C={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,o,C,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 P=[k,C,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",...P]},...P,{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}]}},s,{scope:"variable.language",match:/\$this\b/},o,_,C,{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,o,C,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 COr(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 OOr(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function kOr(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"],s={$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:s,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:s,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:s,contains:["self",l,m,d,t.HASH_COMMENT_MODE]}]};return u.contains=[d,m,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:s,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 EOr(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function _Or(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 ROr(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+)*/),o={"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"]},s={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},u=[t.COMMENT("#","$",{contains:[s]}),t.COMMENT("^=begin","^=end",{contains:[s],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],h={className:"subst",begin:/#\{/,end:/\}/,keywords:o},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:o}]},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:o},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:o},{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:o},{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:o,contains:S}}];return u.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(E).concat(u).concat(S)}}function DOr(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*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",s=["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:s,literal:l,built_in:u},illegal:""},a]}}const LOr=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_-]*/}}),MOr=["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"],IOr=["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"],POr=[...MOr,...IOr],NOr=["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(),BOr=["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(),$Or=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),FOr=["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 zOr(t){const e=LOr(t),r=$Or,n=BOr,i="@[a-z-]+",a="and or not only",s={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("+POr.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+n.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+r.join("|")+")"},s,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+FOr.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,s,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:NOr.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},s,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function UOr(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function VOr(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"],o=["double precision","large object","with timezone","without timezone"],s=["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 C=T;return S=S||[],A.map(k=>k.match(/\|\d+$/)||S.includes(k)?k:C(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:s,built_in:d},contains:[{scope:"type",match:b(o)},x,y,m,n,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,r,v]}}function $rt(t){return t?typeof t=="string"?t:t.source:null}function pN(t){return va("(?=",t,")")}function va(...t){return t.map(r=>$rt(r)).join("")}function QOr(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Ou(...t){return"("+(QOr(t).capture?"":"?:")+t.map(n=>$rt(n)).join("|")+")"}const Zue=t=>va(/\b/,t,/\w$/.test(t)?/\b/:/\B/),GOr=["Protocol","Type"].map(Zue),Frt=["init","self"].map(Zue),HOr=["Any","Self"],Jue=["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"],zrt=["false","nil","true"],WOr=["assignment","associativity","higherThan","left","lowerThan","none","right"],YOr=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Urt=["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"],Vrt=Ou(/[/=\-+!*%<>&|^~?]/,/[\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]/),Qrt=Ou(Vrt,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),ehe=va(Vrt,Qrt,"*"),Grt=Ou(/[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]/),AG=Ou(Grt,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Am=va(Grt,AG,"*"),SG=va(/[A-Z]/,AG,"*"),qOr=["attached","autoclosure",va(/convention\(/,Ou("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",va(/objc\(/,Am,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],jOr=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function XOr(t){const e={match:/\s+/,relevance:0},r=t.COMMENT("/\\*","\\*/",{contains:["self"]}),n=[t.C_LINE_COMMENT_MODE,r],i={match:[/\./,Ou(...GOr,...Frt)],className:{2:"keyword"}},a={match:va(/\./,Ou(...Jue)),relevance:0},o=Jue.filter(ke=>typeof ke=="string").concat(["_|0"]),s=Jue.filter(ke=>typeof ke!="string").concat(HOr).map(Zue),l={variants:[{className:"keyword",match:Ou(...s,...Frt)}]},u={$pattern:Ou(/\b\w+/,/#\w+/),keyword:o.concat(YOr),literal:zrt},h=[i,a,l],d={match:va(/\./,Ou(...Urt)),relevance:0},f={className:"built_in",match:va(/\b/,Ou(...Urt),/(?=\()/)},p=[d,f],g={match:/->/,relevance:0},m={className:"operator",relevance:0,variants:[{match:ehe},{match:`\\.(\\.|${Qrt})+`}]},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=(ke="")=>({className:"subst",variants:[{match:va(/\\/,ke,/[0\\tnr"']/)},{match:va(/\\/,ke,/u\{[0-9a-fA-F]{1,8}\}/)}]}),A=(ke="")=>({className:"subst",match:va(/\\/,ke,/[\t ]*(?:[\r\n]|\r\n)/)}),S=(ke="")=>({className:"subst",label:"interpol",begin:va(/\\/,ke,/\(/),end:/\)/}),T=(ke="")=>({begin:va(ke,/"""/),end:va(/"""/,ke),contains:[w(ke),A(ke),S(ke)]}),C=(ke="")=>({begin:va(ke,/"/),end:va(/"/,ke),contains:[w(ke),S(ke)]}),k={className:"string",variants:[T(),T("#"),T("##"),T("###"),C(),C("#"),C("##"),C("###")]},E=[t.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[t.BACKSLASH_ESCAPE]}],_={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:E},P=ke=>{const Ee=va(ke,/\//),ue=va(/\//,ke);return{begin:Ee,end:ue,contains:[...E,{scope:"comment",begin:`#(?!.*${ue})`,end:/$/}]}},L={scope:"regexp",variants:[P("###"),P("##"),P("#"),_]},R={match:va(/`/,Am,/`/)},D={className:"variable",match:/\$\d+/},M={className:"variable",match:`\\$${AG}+`},I=[R,D,M],N={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:jOr,contains:[...v,x,k]}]}},F={scope:"keyword",match:va(/@/,Ou(...qOr),pN(Ou(/\(/,/\s+/)))},B={scope:"meta",match:va(/@/,Am)},V=[N,F,B],z={match:pN(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:va(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,AG,"+")},{className:"type",match:SG,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:va(/\s+&\s+/,pN(SG)),relevance:0}]},U={begin://,keywords:u,contains:[...n,...h,...V,g,z]};z.contains.push(U);const Q={match:va(Am,/\s*:/),keywords:"_|0",relevance:0},G={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",Q,...n,L,...h,...p,...v,x,k,...I,...V,z]},q={begin://,keywords:"repeat each",contains:[...n,z]},Y={begin:Ou(pN(va(Am,/\s*:/)),pN(va(Am,/\s+/,Am,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Am}]},ne={begin:/\(/,end:/\)/,keywords:u,contains:[Y,...n,...h,...v,x,k,...V,z,G],endsParent:!0,illegal:/["']/},X={match:[/(func|macro)/,/\s+/,Ou(R.match,Am,ehe)],className:{1:"keyword",3:"title.function"},contains:[q,ne,e],illegal:[/\[/,/%/]},J={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[q,ne,e],illegal:/\[|%/},ee={match:[/operator/,/\s+/,ehe],className:{1:"keyword",3:"title"}},te={begin:[/precedencegroup/,/\s+/,SG],className:{1:"keyword",3:"title"},contains:[z],keywords:[...WOr,...zrt],end:/}/},pe={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},ie={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ce={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Am,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[q,...h,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:SG},...h],relevance:0}]};for(const ke of k.variants){const Ee=ke.contains.find(de=>de.label==="interpol");Ee.keywords=u;const ue=[...h,...p,...v,x,k,...I];Ee.contains=[...ue,{begin:/\(/,end:/\)/,contains:["self",...ue]}]}return{name:"Swift",keywords:u,contains:[...n,X,J,pe,ie,Ce,ee,te,{beginKeywords:"import",end:/$/,contains:[...n],relevance:0},L,...h,...p,...v,x,k,...I,...V,z,G]}}const TG="[A-Za-z$_][0-9A-Za-z$_]*",Hrt=["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"],Wrt=["true","false","null","undefined","NaN","Infinity"],Yrt=["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"],qrt=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],jrt=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Xrt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Krt=[].concat(jrt,Yrt,qrt);function KOr(t){const e=t.regex,r=(N,{after:F})=>{const B="",end:""},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={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}}},s={$pattern:TG,keyword:Hrt,literal:Wrt,built_in:Krt,"variable.language":Xrt},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:s,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:s,contains:["self"].concat(x)});const w=[].concat(b,f.contains),A=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:["self"].concat(w)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,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"}}]},C={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:{_:[...Yrt,...qrt]}},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 P(N){return e.concat("(?!",N.join("|"),")")}const L={match:e.concat(/\b/,P([...jrt,"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*=>",I={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:s,exports:{PARAMS_CONTAINS:A,CLASS_REFERENCE:C},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,C,{scope:"attr",match:n+e.lookahead(":"),relevance:0},I,{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:s,contains:A}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.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 ZOr(t){const e=t.regex,r=KOr(t),n=TG,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[r.exports.CLASS_REFERENCE]},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:TG,keyword:Hrt.concat(l),literal:Wrt,built_in:Krt.concat(i),"variable.language":Xrt},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,o,p]),d(r,"shebang",t.SHEBANG()),d(r,"use_strict",s);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 JOr(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}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,s=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:e.concat(/# */,e.either(a,i),/ *#/)},{begin:e.concat(/# */,s,/ *#/)},{begin:e.concat(/# */,o,/ *#/)},{begin:e.concat(/# */,e.either(a,i),/ +/,e.either(o,s),/ *#/)}]},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 ekr(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_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},s={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,o,i,t.QUOTE_STRING_MODE,l,u,s]}}function tkr(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/}]},o=t.inherit(a,{begin:/\(/,end:/\)/}),s=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,s,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[a,o,l,s]}]}]},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 rkr(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}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},s=t.inherit(o,{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,o],y=[...v];return y.pop(),y.push(s),p.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const nkr={arduino:$Cr,bash:FCr,c:zCr,cpp:UCr,csharp:VCr,css:KCr,diff:ZCr,go:JCr,graphql:eOr,ini:tOr,java:rOr,javascript:sOr,json:lOr,kotlin:uOr,less:yOr,lua:bOr,makefile:xOr,markdown:wOr,objectivec:AOr,perl:SOr,php:TOr,"php-template":COr,plaintext:OOr,python:kOr,"python-repl":EOr,r:_Or,ruby:ROr,rust:DOr,scss:zOr,shell:UOr,sql:VOr,swift:XOr,typescript:ZOr,vbnet:JOr,wasm:ekr,xml:tkr,yaml:rkr};function Zrt(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)&&Zrt(r)}),t}class Jrt{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function ent(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function gx(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 ikr="",tnt=t=>!!t.scope,akr=(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 okr{constructor(e,r){this.buffer="",this.classPrefix=r.classPrefix,e.walk(this)}addText(e){this.buffer+=ent(e)}openNode(e){if(!tnt(e))return;const r=akr(e.scope,{prefix:this.classPrefix});this.span(r)}closeNode(e){tnt(e)&&(this.buffer+=ikr)}value(){return this.buffer}span(e){this.buffer+=``}}const rnt=(t={})=>{const e={children:[]};return Object.assign(e,t),e};class the{constructor(){this.rootNode=rnt(),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=rnt({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=>{the._collapse(r)}))}}class skr extends the{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 okr(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function gN(t){return t?typeof t=="string"?t:t.source:null}function nnt(t){return MA("(?=",t,")")}function lkr(t){return MA("(?:",t,")*")}function ckr(t){return MA("(?:",t,")?")}function MA(...t){return t.map(r=>gN(r)).join("")}function ukr(t){const e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function rhe(...t){return"("+(ukr(t).capture?"":"?:")+t.map(n=>gN(n)).join("|")+")"}function int(t){return new RegExp(t.toString()+"|").exec("").length-1}function hkr(t,e){const r=t&&t.exec(e);return r&&r.index===0}const dkr=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function nhe(t,{joinWith:e}){let r=0;return t.map(n=>{r+=1;const i=r;let a=gN(n),o="";for(;a.length>0;){const s=dkr.exec(a);if(!s){o+=a;break}o+=a.substring(0,s.index),a=a.substring(s.index+s[0].length),s[0][0]==="\\"&&s[1]?o+="\\"+String(Number(s[1])+i):(o+=s[0],s[0]==="("&&r++)}return o}).map(n=>`(${n})`).join(e)}const fkr=/\b\B/,ant="[a-zA-Z]\\w*",ihe="[a-zA-Z_]\\w*",ont="\\b\\d+(\\.\\d+)?",snt="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",lnt="\\b(0b[01]+)",pkr="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",gkr=(t={})=>{const e=/^#![ ]*\//;return t.binary&&(t.begin=MA(e,/.*\b/,t.binary,/\b.*/)),gx({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(r,n)=>{r.index!==0&&n.ignoreMatch()}},t)},mN={begin:"\\\\[\\s\\S]",relevance:0},mkr={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[mN]},vkr={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[mN]},ykr={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/},CG=function(t,e,r={}){const n=gx({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=rhe("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:MA(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},bkr=CG("//","$"),xkr=CG("/\\*","\\*/"),wkr=CG("#","$"),Akr={scope:"number",begin:ont,relevance:0},Skr={scope:"number",begin:snt,relevance:0},Tkr={scope:"number",begin:lnt,relevance:0},Ckr={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[mN,{begin:/\[/,end:/\]/,relevance:0,contains:[mN]}]},Okr={scope:"title",begin:ant,relevance:0},kkr={scope:"title",begin:ihe,relevance:0},Ekr={begin:"\\.\\s*"+ihe,relevance:0};var OG=Object.freeze({__proto__:null,APOS_STRING_MODE:mkr,BACKSLASH_ESCAPE:mN,BINARY_NUMBER_MODE:Tkr,BINARY_NUMBER_RE:lnt,COMMENT:CG,C_BLOCK_COMMENT_MODE:xkr,C_LINE_COMMENT_MODE:bkr,C_NUMBER_MODE:Skr,C_NUMBER_RE:snt,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:wkr,IDENT_RE:ant,MATCH_NOTHING_RE:fkr,METHOD_GUARD:Ekr,NUMBER_MODE:Akr,NUMBER_RE:ont,PHRASAL_WORDS_MODE:ykr,QUOTE_STRING_MODE:vkr,REGEXP_MODE:Ckr,RE_STARTERS_RE:pkr,SHEBANG:gkr,TITLE_MODE:Okr,UNDERSCORE_IDENT_RE:ihe,UNDERSCORE_TITLE_MODE:kkr});function _kr(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function Rkr(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function Dkr(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=_kr,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Lkr(t,e){Array.isArray(t.illegal)&&(t.illegal=rhe(...t.illegal))}function Mkr(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 Ikr(t,e){t.relevance===void 0&&(t.relevance=1)}const Pkr=(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=MA(r.beforeMatch,nnt(r.begin)),t.starts={relevance:0,contains:[Object.assign(r,{endsParent:!0})]},t.relevance=0,delete r.beforeMatch},Nkr=["of","and","for","in","not","or","if","then","parent","list","value"],Bkr="keyword";function cnt(t,e,r=Bkr){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,cnt(t[a],e,a))}),n;function i(a,o){e&&(o=o.map(s=>s.toLowerCase())),o.forEach(function(s){const l=s.split("|");n[l[0]]=[a,$kr(l[0],l[1])]})}}function $kr(t,e){return e?Number(e):Fkr(t)?0:1}function Fkr(t){return Nkr.includes(t.toLowerCase())}const unt={},IA=t=>{console.error(t)},hnt=(t,...e)=>{console.log(`WARN: ${t}`,...e)},jE=(t,e)=>{unt[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),unt[`${t}/${e}`]=!0)},kG=new Error;function dnt(t,e,{key:r}){let n=0;const i=t[r],a={},o={};for(let s=1;s<=e.length;s++)o[s+n]=i[s],a[s+n]=!0,n+=int(e[s-1]);t[r]=o,t[r]._emit=a,t[r]._multi=!0}function zkr(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw IA("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),kG;if(typeof t.beginScope!="object"||t.beginScope===null)throw IA("beginScope must be object"),kG;dnt(t,t.begin,{key:"beginScope"}),t.begin=nhe(t.begin,{joinWith:""})}}function Ukr(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw IA("skip, excludeEnd, returnEnd not compatible with endScope: {}"),kG;if(typeof t.endScope!="object"||t.endScope===null)throw IA("endScope must be object"),kG;dnt(t,t.end,{key:"endScope"}),t.end=nhe(t.end,{joinWith:""})}}function Vkr(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function Qkr(t){Vkr(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),zkr(t),Ukr(t)}function Gkr(t){function e(o,s){return new RegExp(gN(o),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(s?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(s,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,s]),this.matchAt+=int(s)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const s=this.regexes.map(l=>l[1]);this.matcherRe=e(nhe(s,{joinWith:"|"}),!0),this.lastIndex=0}exec(s){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(s);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(s){if(this.multiRegexes[s])return this.multiRegexes[s];const l=new r;return this.rules.slice(s).forEach(([u,h])=>l.addRule(u,h)),l.compile(),this.multiRegexes[s]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(s,l){this.rules.push([s,l]),l.type==="begin"&&this.count++}exec(s){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(s);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const h=this.getMatcher(0);h.lastIndex=this.lastIndex+1,u=h.exec(s)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function i(o){const s=new n;return o.contains.forEach(l=>s.addRule(l.begin,{rule:l,type:"begin"})),o.terminatorEnd&&s.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&s.addRule(o.illegal,{type:"illegal"}),s}function a(o,s){const l=o;if(o.isCompiled)return l;[Rkr,Mkr,Qkr,Pkr].forEach(h=>h(o,s)),t.compilerExtensions.forEach(h=>h(o,s)),o.__beforeBegin=null,[Dkr,Lkr,Ikr].forEach(h=>h(o,s)),o.isCompiled=!0;let u=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),u=o.keywords.$pattern,delete o.keywords.$pattern),u=u||/\w+/,o.keywords&&(o.keywords=cnt(o.keywords,t.case_insensitive)),l.keywordPatternRe=e(u,!0),s&&(o.begin||(o.begin=/\B|\b/),l.beginRe=e(l.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(l.endRe=e(l.end)),l.terminatorEnd=gN(l.end)||"",o.endsWithParent&&s.terminatorEnd&&(l.terminatorEnd+=(o.end?"|":"")+s.terminatorEnd)),o.illegal&&(l.illegalRe=e(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(h){return Hkr(h==="self"?o:h)})),o.contains.forEach(function(h){a(h,l)}),o.starts&&a(o.starts,s),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=gx(t.classNameAliases||{}),a(t)}function fnt(t){return t?t.endsWithParent||fnt(t.starts):!1}function Hkr(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return gx(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:fnt(t)?gx(t,{starts:t.starts?gx(t.starts):null}):Object.isFrozen(t)?gx(t):t}var Wkr="11.11.1";class Ykr extends Error{constructor(e,r){super(e),this.name="HTMLInjectionError",this.html=r}}const ahe=ent,pnt=gx,gnt=Symbol("nomatch"),qkr=7,mnt=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?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:skr};function l(M){return s.noHighlightRe.test(M)}function u(M){let I=M.className+" ";I+=M.parentNode?M.parentNode.className:"";const N=s.languageDetectRe.exec(I);if(N){const F=C(N[1]);return F||(hnt(a.replace("{}",N[1])),hnt("Falling back to no-highlight mode for this block.",M)),F?N[1]:"no-highlight"}return I.split(/\s+/).find(F=>l(F)||C(F))}function h(M,I,N){let F="",B="";typeof I=="object"?(F=M,N=I.ignoreIllegals,B=I.language):(jE("10.7.0","highlight(lang, code, ...args) has been deprecated."),jE("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),B=M,F=I),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,I,N,F){const B=Object.create(null);function V(Z,le){return Z.keywords[le]}function z(){if(!ue.keywords){xe.addText(ge);return}let Z=0;ue.keywordPatternRe.lastIndex=0;let le=ue.keywordPatternRe.exec(ge),be="";for(;le;){be+=ge.substring(Z,le.index);const ae=Ce.case_insensitive?le[0].toLowerCase():le[0],K=V(ue,ae);if(K){const[se,me]=K;if(xe.addText(be),be="",B[ae]=(B[ae]||0)+1,B[ae]<=qkr&&(ze+=me),se.startsWith("_"))be+=le[0];else{const oe=Ce.classNameAliases[se]||se;G(le[0],oe)}}else be+=le[0];Z=ue.keywordPatternRe.lastIndex,le=ue.keywordPatternRe.exec(ge)}be+=ge.substring(Z),xe.addText(be)}function U(){if(ge==="")return;let Z=null;if(typeof ue.subLanguage=="string"){if(!e[ue.subLanguage]){xe.addText(ge);return}Z=d(ue.subLanguage,ge,!0,de[ue.subLanguage]),de[ue.subLanguage]=Z._top}else Z=p(ge,ue.subLanguage.length?ue.subLanguage:null);ue.relevance>0&&(ze+=Z.relevance),xe.__addSublanguage(Z._emitter,Z.language)}function Q(){ue.subLanguage!=null?U():z(),ge=""}function G(Z,le){Z!==""&&(xe.startScope(le),xe.addText(Z),xe.endScope())}function q(Z,le){let be=1;const ae=le.length-1;for(;be<=ae;){if(!Z._emit[be]){be++;continue}const K=Ce.classNameAliases[Z[be]]||Z[be],se=le[be];K?G(se,K):(ge=se,z(),ge=""),be++}}function Y(Z,le){return Z.scope&&typeof Z.scope=="string"&&xe.openNode(Ce.classNameAliases[Z.scope]||Z.scope),Z.beginScope&&(Z.beginScope._wrap?(G(ge,Ce.classNameAliases[Z.beginScope._wrap]||Z.beginScope._wrap),ge=""):Z.beginScope._multi&&(q(Z.beginScope,le),ge="")),ue=Object.create(Z,{parent:{value:ue}}),ue}function ne(Z,le,be){let ae=hkr(Z.endRe,be);if(ae){if(Z["on:end"]){const K=new Jrt(Z);Z["on:end"](le,K),K.isMatchIgnored&&(ae=!1)}if(ae){for(;Z.endsParent&&Z.parent;)Z=Z.parent;return Z}}if(Z.endsWithParent)return ne(Z.parent,le,be)}function X(Z){return ue.matcher.regexIndex===0?(ge+=Z[0],1):(Be=!0,0)}function J(Z){const le=Z[0],be=Z.rule,ae=new Jrt(be),K=[be.__beforeBegin,be["on:begin"]];for(const se of K)if(se&&(se(Z,ae),ae.isMatchIgnored))return X(le);return be.skip?ge+=le:(be.excludeBegin&&(ge+=le),Q(),!be.returnBegin&&!be.excludeBegin&&(ge=le)),Y(be,Z),be.returnBegin?0:le.length}function ee(Z){const le=Z[0],be=I.substring(Z.index),ae=ne(ue,Z,be);if(!ae)return gnt;const K=ue;ue.endScope&&ue.endScope._wrap?(Q(),G(le,ue.endScope._wrap)):ue.endScope&&ue.endScope._multi?(Q(),q(ue.endScope,Z)):K.skip?ge+=le:(K.returnEnd||K.excludeEnd||(ge+=le),Q(),K.excludeEnd&&(ge=le));do ue.scope&&xe.closeNode(),!ue.skip&&!ue.subLanguage&&(ze+=ue.relevance),ue=ue.parent;while(ue!==ae.parent);return ae.starts&&Y(ae.starts,Z),K.returnEnd?0:le.length}function te(){const Z=[];for(let le=ue;le!==Ce;le=le.parent)le.scope&&Z.unshift(le.scope);Z.forEach(le=>xe.openNode(le))}let pe={};function ie(Z,le){const be=le&&le[0];if(ge+=Z,be==null)return Q(),0;if(pe.type==="begin"&&le.type==="end"&&pe.index===le.index&&be===""){if(ge+=I.slice(le.index,le.index+1),!i){const ae=new Error(`0 width match regex (${M})`);throw ae.languageName=M,ae.badRule=pe.rule,ae}return 1}if(pe=le,le.type==="begin")return J(le);if(le.type==="illegal"&&!N){const ae=new Error('Illegal lexeme "'+be+'" for mode "'+(ue.scope||"")+'"');throw ae.mode=ue,ae}else if(le.type==="end"){const ae=ee(le);if(ae!==gnt)return ae}if(le.type==="illegal"&&be==="")return ge+=` +`,1;if(Oe>1e5&&Oe>le.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ge+=be,be.length}const Ce=C(M);if(!Ce)throw IA(a.replace("{}",M)),new Error('Unknown language: "'+M+'"');const ke=Gkr(Ce);let Ee="",ue=F||ke;const de={},xe=new s.__emitter(s);te();let ge="",ze=0,we=0,Oe=0,Be=!1;try{if(Ce.__emitTokens)Ce.__emitTokens(I,xe);else{for(ue.matcher.considerAll();;){Oe++,Be?Be=!1:ue.matcher.considerAll(),ue.matcher.lastIndex=we;const Z=ue.matcher.exec(I);if(!Z)break;const le=I.substring(we,Z.index),be=ie(le,Z);we=Z.index+be}ie(I.substring(we))}return xe.finalize(),Ee=xe.toHTML(),{language:M,value:Ee,relevance:ze,illegal:!1,_emitter:xe,_top:ue}}catch(Z){if(Z.message&&Z.message.includes("Illegal"))return{language:M,value:ahe(I),illegal:!0,relevance:0,_illegalBy:{message:Z.message,index:we,context:I.slice(we-100,we+100),mode:Z.mode,resultSoFar:Ee},_emitter:xe};if(i)return{language:M,value:ahe(I),illegal:!1,relevance:0,errorRaised:Z,_emitter:xe,_top:ue};throw Z}}function f(M){const I={value:ahe(M),illegal:!1,relevance:0,_top:o,_emitter:new s.__emitter(s)};return I._emitter.addText(M),I}function p(M,I){I=I||s.languages||Object.keys(e);const N=f(M),F=I.filter(C).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(C(Q.language).supersetOf===G.language)return 1;if(C(G.language).supersetOf===Q.language)return-1}return 0}),[V,z]=B,U=V;return U.secondBest=z,U}function g(M,I,N){const F=I&&r[I]||N;M.classList.add("hljs"),M.classList.add(`language-${F}`)}function m(M){let I=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&&(s.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)),s.throwUnescapedHTML))throw new Ykr("One of your code blocks includes unescaped HTML.",M.innerHTML);I=M;const F=I.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){s=pnt(s,M)}const y=()=>{w(),jE("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){w(),jE("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(s.cssSelector).forEach(m)}function A(M,I){let N=null;try{N=I(t)}catch(F){if(IA("Language definition for '{}' could not be registered.".replace("{}",M)),i)IA(F);else throw F;N=o}N.name||(N.name=M),e[M]=N,N.rawDefinition=I.bind(null,t),N.aliases&&k(N.aliases,{languageName:M})}function S(M){delete e[M];for(const I of Object.keys(r))r[I]===M&&delete r[I]}function T(){return Object.keys(e)}function C(M){return M=(M||"").toLowerCase(),e[M]||e[r[M]]}function k(M,{languageName:I}){typeof M=="string"&&(M=[M]),M.forEach(N=>{r[N.toLowerCase()]=I})}function E(M){const I=C(M);return I&&!I.disableAutodetect}function _(M){M["before:highlightBlock"]&&!M["before:highlightElement"]&&(M["before:highlightElement"]=I=>{M["before:highlightBlock"](Object.assign({block:I.el},I))}),M["after:highlightBlock"]&&!M["after:highlightElement"]&&(M["after:highlightElement"]=I=>{M["after:highlightBlock"](Object.assign({block:I.el},I))})}function P(M){_(M),n.push(M)}function L(M){const I=n.indexOf(M);I!==-1&&n.splice(I,1)}function R(M,I){const N=M;n.forEach(function(F){F[N]&&F[N](I)})}function D(M){return jE("10.7.0","highlightBlock will be removed entirely in v12.0"),jE("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:C,registerAliases:k,autoDetection:E,inherit:pnt,addPlugin:P,removePlugin:L}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=Wkr,t.regex={concat:MA,lookahead:nnt,either:rhe,optional:ckr,anyNumberOfTimes:lkr};for(const M in OG)typeof OG[M]=="object"&&Zrt(OG[M]);return Object.assign(t,OG),t},XE=mnt({});XE.newInstance=()=>mnt({});var jkr=XE;XE.HighlightJS=XE,XE.default=XE;const Xkr=wh(jkr),vnt={},Kkr="hljs-";function Zkr(t){const e=Xkr.newInstance();return t&&a(t),{highlight:r,highlightAuto:n,listLanguages:i,register:a,registerAlias:o,registered:s};function r(l,u,h){const d=h||vnt,f=typeof d.prefix=="string"?d.prefix:Kkr;if(!e.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");e.configure({__emitter:Jkr,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||vnt).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 o(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 s(l){return!!e.getLanguage(l)}}class Jkr{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(o,s){return s?o+"_".repeat(s):r.options.classPrefix+o}),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 eEr={};function ynt(t){const e=t||eEr,r=e.aliases,n=e.detect||!1,i=e.languages||nkr,a=e.plainText,o=e.prefix,s=e.subset;let l="hljs";const u=Zkr(i);if(r&&u.registerAlias(r),o){const h=o.indexOf("-");l=h===-1?o:o.slice(0,h)}return function(h,d){hN(h,"element",function(f,p,g){if(f.tagName!=="code"||!g||g.type!=="element"||g.tagName!=="pre")return;const m=tEr(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=RCr(f,{whitespace:"pre"});let y;try{y=m?u.highlight(m,v,{prefix:o}):u.highlightAuto(v,{prefix:o,subset:s})}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 tEr(t){const e=t.properties.className;let r=-1;if(!Array.isArray(e))return;let n;for(;++r-1&&a<=e.length){let o=0;for(;;){let s=r[o];if(s===void 0){const l=Ant(e,r[o-1]);s=l===-1?e.length+1:l+1,r[o]=s}if(s>a)return{line:o+1,column:a-(o>0?r[o-1]:0)+1,offset:a};o++}}}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(o=55296&&t<=57343}function kEr(t){return t>=56320&&t<=57343}function EEr(t,e){return(t-55296)*1024+9216+e}function Ent(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function _nt(t){return t>=64976&&t<=65007||OEr.has(t)}var bt;(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"})(bt||(bt={}));const _Er=65536;class REr{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=_Er,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,o=i+r,s=a+r;return{code:e,startLine:n,endLine:n,startCol:o,endCol:o,startOffset:s,endOffset:s}}_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(kEr(r))return this.pos++,this._addGap(),EEr(e,r)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,Ue.EOF;return this._err(bt.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,Ue.EOF;const n=this.html.charCodeAt(r);return n===Ue.CARRIAGE_RETURN?Ue.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,Ue.EOF;let e=this.html.charCodeAt(this.pos);return e===Ue.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,Ue.LINE_FEED):e===Ue.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,knt(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===Ue.LINE_FEED||e===Ue.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){Ent(e)?this._err(bt.controlCharacterInInputStream):_nt(e)&&this._err(bt.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 DEr=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))),LEr=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 MEr(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=LEr.get(t))!==null&&e!==void 0?e:t}var Tl;(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"})(Tl||(Tl={}));const IEr=32;var mx;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(mx||(mx={}));function che(t){return t>=Tl.ZERO&&t<=Tl.NINE}function PEr(t){return t>=Tl.UPPER_A&&t<=Tl.UPPER_F||t>=Tl.LOWER_A&&t<=Tl.LOWER_F}function NEr(t){return t>=Tl.UPPER_A&&t<=Tl.UPPER_Z||t>=Tl.LOWER_A&&t<=Tl.LOWER_Z||che(t)}function BEr(t){return t===Tl.EQUALS||NEr(t)}var Cl;(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"})(Cl||(Cl={}));var sy;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(sy||(sy={}));class $Er{constructor(e,r,n){this.decodeTree=e,this.emitCodePoint=r,this.errors=n,this.state=Cl.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=sy.Strict}startEntity(e){this.decodeMode=e,this.state=Cl.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,r){switch(this.state){case Cl.EntityStart:return e.charCodeAt(r)===Tl.NUM?(this.state=Cl.NumericStart,this.consumed+=1,this.stateNumericStart(e,r+1)):(this.state=Cl.NamedEntity,this.stateNamedEntity(e,r));case Cl.NumericStart:return this.stateNumericStart(e,r);case Cl.NumericDecimal:return this.stateNumericDecimal(e,r);case Cl.NumericHex:return this.stateNumericHex(e,r);case Cl.NamedEntity:return this.stateNamedEntity(e,r)}}stateNumericStart(e,r){return r>=e.length?-1:(e.charCodeAt(r)|IEr)===Tl.LOWER_X?(this.state=Cl.NumericHex,this.consumed+=1,this.stateNumericHex(e,r+1)):(this.state=Cl.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(o===Tl.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==sy.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]&mx.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]&~mx.VALUE_LENGTH:i[e+1],n),r===3&&this.emitCodePoint(i[e+2],n),n}end(){var e;switch(this.state){case Cl.NamedEntity:return this.result!==0&&(this.decodeMode!==sy.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Cl.NumericDecimal:return this.emitNumericEntity(0,2);case Cl.NumericHex:return this.emitNumericEntity(0,3);case Cl.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Cl.EntityStart:return 0}}}function FEr(t,e,r,n){const i=(e&mx.BRANCH_LENGTH)>>7,a=e&mx.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 o=r,s=o+i-1;for(;o<=s;){const l=o+s>>>1,u=t[l];if(un)s=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 NA;(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"})(NA||(NA={}));var Gf;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(Gf||(Gf={}));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 W;(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"})(W||(W={}));const zEr=new Map([[st.A,W.A],[st.ADDRESS,W.ADDRESS],[st.ANNOTATION_XML,W.ANNOTATION_XML],[st.APPLET,W.APPLET],[st.AREA,W.AREA],[st.ARTICLE,W.ARTICLE],[st.ASIDE,W.ASIDE],[st.B,W.B],[st.BASE,W.BASE],[st.BASEFONT,W.BASEFONT],[st.BGSOUND,W.BGSOUND],[st.BIG,W.BIG],[st.BLOCKQUOTE,W.BLOCKQUOTE],[st.BODY,W.BODY],[st.BR,W.BR],[st.BUTTON,W.BUTTON],[st.CAPTION,W.CAPTION],[st.CENTER,W.CENTER],[st.CODE,W.CODE],[st.COL,W.COL],[st.COLGROUP,W.COLGROUP],[st.DD,W.DD],[st.DESC,W.DESC],[st.DETAILS,W.DETAILS],[st.DIALOG,W.DIALOG],[st.DIR,W.DIR],[st.DIV,W.DIV],[st.DL,W.DL],[st.DT,W.DT],[st.EM,W.EM],[st.EMBED,W.EMBED],[st.FIELDSET,W.FIELDSET],[st.FIGCAPTION,W.FIGCAPTION],[st.FIGURE,W.FIGURE],[st.FONT,W.FONT],[st.FOOTER,W.FOOTER],[st.FOREIGN_OBJECT,W.FOREIGN_OBJECT],[st.FORM,W.FORM],[st.FRAME,W.FRAME],[st.FRAMESET,W.FRAMESET],[st.H1,W.H1],[st.H2,W.H2],[st.H3,W.H3],[st.H4,W.H4],[st.H5,W.H5],[st.H6,W.H6],[st.HEAD,W.HEAD],[st.HEADER,W.HEADER],[st.HGROUP,W.HGROUP],[st.HR,W.HR],[st.HTML,W.HTML],[st.I,W.I],[st.IMG,W.IMG],[st.IMAGE,W.IMAGE],[st.INPUT,W.INPUT],[st.IFRAME,W.IFRAME],[st.KEYGEN,W.KEYGEN],[st.LABEL,W.LABEL],[st.LI,W.LI],[st.LINK,W.LINK],[st.LISTING,W.LISTING],[st.MAIN,W.MAIN],[st.MALIGNMARK,W.MALIGNMARK],[st.MARQUEE,W.MARQUEE],[st.MATH,W.MATH],[st.MENU,W.MENU],[st.META,W.META],[st.MGLYPH,W.MGLYPH],[st.MI,W.MI],[st.MO,W.MO],[st.MN,W.MN],[st.MS,W.MS],[st.MTEXT,W.MTEXT],[st.NAV,W.NAV],[st.NOBR,W.NOBR],[st.NOFRAMES,W.NOFRAMES],[st.NOEMBED,W.NOEMBED],[st.NOSCRIPT,W.NOSCRIPT],[st.OBJECT,W.OBJECT],[st.OL,W.OL],[st.OPTGROUP,W.OPTGROUP],[st.OPTION,W.OPTION],[st.P,W.P],[st.PARAM,W.PARAM],[st.PLAINTEXT,W.PLAINTEXT],[st.PRE,W.PRE],[st.RB,W.RB],[st.RP,W.RP],[st.RT,W.RT],[st.RTC,W.RTC],[st.RUBY,W.RUBY],[st.S,W.S],[st.SCRIPT,W.SCRIPT],[st.SEARCH,W.SEARCH],[st.SECTION,W.SECTION],[st.SELECT,W.SELECT],[st.SOURCE,W.SOURCE],[st.SMALL,W.SMALL],[st.SPAN,W.SPAN],[st.STRIKE,W.STRIKE],[st.STRONG,W.STRONG],[st.STYLE,W.STYLE],[st.SUB,W.SUB],[st.SUMMARY,W.SUMMARY],[st.SUP,W.SUP],[st.TABLE,W.TABLE],[st.TBODY,W.TBODY],[st.TEMPLATE,W.TEMPLATE],[st.TEXTAREA,W.TEXTAREA],[st.TFOOT,W.TFOOT],[st.TD,W.TD],[st.TH,W.TH],[st.THEAD,W.THEAD],[st.TITLE,W.TITLE],[st.TR,W.TR],[st.TRACK,W.TRACK],[st.TT,W.TT],[st.U,W.U],[st.UL,W.UL],[st.SVG,W.SVG],[st.VAR,W.VAR],[st.WBR,W.WBR],[st.XMP,W.XMP]]);function JE(t){var e;return(e=zEr.get(t))!==null&&e!==void 0?e:W.UNKNOWN}const jt=W,UEr={[Ut.HTML]:new Set([jt.ADDRESS,jt.APPLET,jt.AREA,jt.ARTICLE,jt.ASIDE,jt.BASE,jt.BASEFONT,jt.BGSOUND,jt.BLOCKQUOTE,jt.BODY,jt.BR,jt.BUTTON,jt.CAPTION,jt.CENTER,jt.COL,jt.COLGROUP,jt.DD,jt.DETAILS,jt.DIR,jt.DIV,jt.DL,jt.DT,jt.EMBED,jt.FIELDSET,jt.FIGCAPTION,jt.FIGURE,jt.FOOTER,jt.FORM,jt.FRAME,jt.FRAMESET,jt.H1,jt.H2,jt.H3,jt.H4,jt.H5,jt.H6,jt.HEAD,jt.HEADER,jt.HGROUP,jt.HR,jt.HTML,jt.IFRAME,jt.IMG,jt.INPUT,jt.LI,jt.LINK,jt.LISTING,jt.MAIN,jt.MARQUEE,jt.MENU,jt.META,jt.NAV,jt.NOEMBED,jt.NOFRAMES,jt.NOSCRIPT,jt.OBJECT,jt.OL,jt.P,jt.PARAM,jt.PLAINTEXT,jt.PRE,jt.SCRIPT,jt.SECTION,jt.SELECT,jt.SOURCE,jt.STYLE,jt.SUMMARY,jt.TABLE,jt.TBODY,jt.TD,jt.TEMPLATE,jt.TEXTAREA,jt.TFOOT,jt.TH,jt.THEAD,jt.TITLE,jt.TR,jt.TRACK,jt.UL,jt.WBR,jt.XMP]),[Ut.MATHML]:new Set([jt.MI,jt.MO,jt.MN,jt.MS,jt.MTEXT,jt.ANNOTATION_XML]),[Ut.SVG]:new Set([jt.TITLE,jt.FOREIGN_OBJECT,jt.DESC]),[Ut.XLINK]:new Set,[Ut.XML]:new Set,[Ut.XMLNS]:new Set},uhe=new Set([jt.H1,jt.H2,jt.H3,jt.H4,jt.H5,jt.H6]);st.STYLE,st.SCRIPT,st.XMP,st.IFRAME,st.NOEMBED,st.NOFRAMES,st.PLAINTEXT;var Ge;(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"})(Ge||(Ge={}));const us={DATA:Ge.DATA,RCDATA:Ge.RCDATA,RAWTEXT:Ge.RAWTEXT,SCRIPT_DATA:Ge.SCRIPT_DATA,PLAINTEXT:Ge.PLAINTEXT,CDATA_SECTION:Ge.CDATA_SECTION};function VEr(t){return t>=Ue.DIGIT_0&&t<=Ue.DIGIT_9}function vN(t){return t>=Ue.LATIN_CAPITAL_A&&t<=Ue.LATIN_CAPITAL_Z}function QEr(t){return t>=Ue.LATIN_SMALL_A&&t<=Ue.LATIN_SMALL_Z}function vx(t){return QEr(t)||vN(t)}function Dnt(t){return vx(t)||VEr(t)}function _G(t){return t+32}function Lnt(t){return t===Ue.SPACE||t===Ue.LINE_FEED||t===Ue.TABULATION||t===Ue.FORM_FEED}function Mnt(t){return Lnt(t)||t===Ue.SOLIDUS||t===Ue.GREATER_THAN_SIGN}function GEr(t){return t===Ue.NULL?bt.nullCharacterReference:t>1114111?bt.characterReferenceOutsideUnicodeRange:knt(t)?bt.surrogateCharacterReference:_nt(t)?bt.noncharacterCharacterReference:Ent(t)||t===Ue.CARRIAGE_RETURN?bt.controlCharacterReference:null}class HEr{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=Ge.DATA,this.returnState=Ge.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new REr(r),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new $Er(DEr,(n,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(n)},r.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(bt.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:n=>{this._err(bt.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+n)},validateNumericCharacterReference:n=>{const i=GEr(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(bt.endTagWithAttributes),e.selfClosing&&this._err(bt.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 ai.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case ai.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case ai.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:ai.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=Lnt(e)?ai.WHITESPACE_CHARACTER:e===Ue.NULL?ai.NULL_CHARACTER:ai.CHARACTER;this._appendCharToCurrentCharacterToken(r,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(ai.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=Ge.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?sy.Attribute:sy.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===Ge.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===Ge.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===Ge.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case Ge.DATA:{this._stateData(e);break}case Ge.RCDATA:{this._stateRcdata(e);break}case Ge.RAWTEXT:{this._stateRawtext(e);break}case Ge.SCRIPT_DATA:{this._stateScriptData(e);break}case Ge.PLAINTEXT:{this._statePlaintext(e);break}case Ge.TAG_OPEN:{this._stateTagOpen(e);break}case Ge.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case Ge.TAG_NAME:{this._stateTagName(e);break}case Ge.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case Ge.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case Ge.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case Ge.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case Ge.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case Ge.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case Ge.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case Ge.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case Ge.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case Ge.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case Ge.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case Ge.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case Ge.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case Ge.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case Ge.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case Ge.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case Ge.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case Ge.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case Ge.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case Ge.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case Ge.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case Ge.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case Ge.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case Ge.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case Ge.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case Ge.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case Ge.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case Ge.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case Ge.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case Ge.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case Ge.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case Ge.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case Ge.BOGUS_COMMENT:{this._stateBogusComment(e);break}case Ge.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case Ge.COMMENT_START:{this._stateCommentStart(e);break}case Ge.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case Ge.COMMENT:{this._stateComment(e);break}case Ge.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case Ge.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case Ge.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case Ge.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case Ge.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case Ge.COMMENT_END:{this._stateCommentEnd(e);break}case Ge.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case Ge.DOCTYPE:{this._stateDoctype(e);break}case Ge.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case Ge.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case Ge.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case Ge.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case Ge.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case Ge.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case Ge.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case Ge.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case Ge.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case Ge.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case Ge.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case Ge.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case Ge.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case Ge.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case Ge.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case Ge.CDATA_SECTION:{this._stateCdataSection(e);break}case Ge.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case Ge.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case Ge.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case Ge.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case Ue.LESS_THAN_SIGN:{this.state=Ge.TAG_OPEN;break}case Ue.AMPERSAND:{this._startCharacterReference();break}case Ue.NULL:{this._err(bt.unexpectedNullCharacter),this._emitCodePoint(e);break}case Ue.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case Ue.AMPERSAND:{this._startCharacterReference();break}case Ue.LESS_THAN_SIGN:{this.state=Ge.RCDATA_LESS_THAN_SIGN;break}case Ue.NULL:{this._err(bt.unexpectedNullCharacter),this._emitChars(bo);break}case Ue.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case Ue.LESS_THAN_SIGN:{this.state=Ge.RAWTEXT_LESS_THAN_SIGN;break}case Ue.NULL:{this._err(bt.unexpectedNullCharacter),this._emitChars(bo);break}case Ue.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case Ue.LESS_THAN_SIGN:{this.state=Ge.SCRIPT_DATA_LESS_THAN_SIGN;break}case Ue.NULL:{this._err(bt.unexpectedNullCharacter),this._emitChars(bo);break}case Ue.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case Ue.NULL:{this._err(bt.unexpectedNullCharacter),this._emitChars(bo);break}case Ue.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(vx(e))this._createStartTagToken(),this.state=Ge.TAG_NAME,this._stateTagName(e);else switch(e){case Ue.EXCLAMATION_MARK:{this.state=Ge.MARKUP_DECLARATION_OPEN;break}case Ue.SOLIDUS:{this.state=Ge.END_TAG_OPEN;break}case Ue.QUESTION_MARK:{this._err(bt.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=Ge.BOGUS_COMMENT,this._stateBogusComment(e);break}case Ue.EOF:{this._err(bt.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(bt.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=Ge.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(vx(e))this._createEndTagToken(),this.state=Ge.TAG_NAME,this._stateTagName(e);else switch(e){case Ue.GREATER_THAN_SIGN:{this._err(bt.missingEndTagName),this.state=Ge.DATA;break}case Ue.EOF:{this._err(bt.eofBeforeTagName),this._emitChars("");break}case Ue.NULL:{this._err(bt.unexpectedNullCharacter),this.state=Ge.SCRIPT_DATA_ESCAPED,this._emitChars(bo);break}case Ue.EOF:{this._err(bt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Ge.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===Ue.SOLIDUS?this.state=Ge.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:vx(e)?(this._emitChars("<"),this.state=Ge.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=Ge.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){vx(e)?(this.state=Ge.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("");break}case Ue.NULL:{this._err(bt.unexpectedNullCharacter),this.state=Ge.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(bo);break}case Ue.EOF:{this._err(bt.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=Ge.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===Ue.SOLIDUS?(this.state=Ge.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=Ge.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Ph.SCRIPT,!1)&&Mnt(this.preprocessor.peek(Ph.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(XEr,Ut.HTML)}clearBackToTableBodyContext(){this.clearBackTo(jEr,Ut.HTML)}clearBackToTableRowContext(){this.clearBackTo(qEr,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]===W.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]===W.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(Bnt.has(i))return!1;break}case Ut.MATHML:{if(Nnt.has(i))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,RG)}hasInListItemScope(e){return this.hasInDynamicScope(e,WEr)}hasInButtonScope(e){return this.hasInDynamicScope(e,YEr)}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(uhe.has(r))return!0;if(RG.has(r))return!1;break}case Ut.SVG:{if(Bnt.has(r))return!1;break}case Ut.MATHML:{if(Nnt.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 W.TABLE:case W.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 W.TBODY:case W.THEAD:case W.TFOOT:return!0;case W.TABLE:case W.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 W.OPTION:case W.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Int.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Pnt.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&Pnt.has(this.currentTagId);)this.pop()}}const hhe=3;var Sm;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(Sm||(Sm={}));const $nt={type:Sm.Marker};class JEr{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,r){const n=[],i=r.length,a=this.treeAdapter.getTagName(e),o=this.treeAdapter.getNamespaceURI(e);for(let s=0;s[o.name,o.value]));let a=0;for(let o=0;oi.get(l.name)===l.value)&&(a+=1,a>=hhe&&this.entries.splice(s.idx,1))}}insertMarker(){this.entries.unshift($nt)}pushElement(e,r){this._ensureNoahArkCondition(e),this.entries.unshift({type:Sm.Element,element:e,token:r})}insertElementAfterBookmark(e,r){const n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:Sm.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($nt);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const r=this.entries.find(n=>n.type===Sm.Marker||this.treeAdapter.getTagName(n.element)===e);return r&&r.type===Sm.Element?r:null}getElementEntry(e){return this.entries.find(r=>r.type===Sm.Element&&r.element===e)}}const yx={createDocument(){return{nodeName:"#document",mode:Gf.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};yx.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(yx.isTextNode(r)){r.value+=e;return}}yx.appendChild(t,yx.createTextNode(e))},insertTextBefore(t,e,r){const n=t.childNodes[t.childNodes.indexOf(r)-1];n&&yx.isTextNode(n)?n.value+=e:yx.insertBefore(t,yx.createTextNode(e),r)},adoptAttributes(t,e){const r=new Set(t.attrs.map(n=>n.name));for(let n=0;nt.startsWith(r))}function a_r(t){return t.name===Fnt&&t.publicId===null&&(t.systemId===null||t.systemId===e_r)}function o_r(t){if(t.name!==Fnt)return Gf.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===t_r)return Gf.QUIRKS;let{publicId:r}=t;if(r!==null){if(r=r.toLowerCase(),n_r.has(r))return Gf.QUIRKS;let n=e===null?r_r:znt;if(Vnt(r,n))return Gf.QUIRKS;if(n=e===null?Unt:i_r,Vnt(r,n))return Gf.LIMITED_QUIRKS}return Gf.NO_QUIRKS}const Qnt={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},s_r="definitionurl",l_r="definitionURL",c_r=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])),u_r=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}]]),h_r=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])),d_r=new Set([W.B,W.BIG,W.BLOCKQUOTE,W.BODY,W.BR,W.CENTER,W.CODE,W.DD,W.DIV,W.DL,W.DT,W.EM,W.EMBED,W.H1,W.H2,W.H3,W.H4,W.H5,W.H6,W.HEAD,W.HR,W.I,W.IMG,W.LI,W.LISTING,W.MENU,W.META,W.NOBR,W.OL,W.P,W.PRE,W.RUBY,W.S,W.SMALL,W.SPAN,W.STRONG,W.STRIKE,W.SUB,W.SUP,W.TABLE,W.TT,W.U,W.UL,W.VAR]);function f_r(t){const e=t.tagID;return e===W.FONT&&t.attrs.some(({name:n})=>n===NA.COLOR||n===NA.SIZE||n===NA.FACE)||d_r.has(e)}function Gnt(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,o;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,o=this.fragmentContextID):{current:a,currentTagId:o}=this.openElements,this._setContextModes(a,o)}}_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=us.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 W.TITLE:case W.TEXTAREA:{this.tokenizer.state=us.RCDATA;break}case W.STYLE:case W.XMP:case W.IFRAME:case W.NOEMBED:case W.NOFRAMES:case W.NOSCRIPT:{this.tokenizer.state=us.RAWTEXT;break}case W.SCRIPT:{this.tokenizer.state=us.SCRIPT_DATA;break}case W.PLAINTEXT:{this.tokenizer.state=us.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 o=this.treeAdapter.getChildNodes(this.document).find(s=>this.treeAdapter.isDocumentTypeNode(s));o&&this.treeAdapter.setNodeSourceCodeLocation(o,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,W.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,o=i[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(o)){const{endLine:l,endCol:u,endOffset:h}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(o,{endLine:l,endCol:u,endOffset:h})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(o,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===ai.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===W.SVG&&this.treeAdapter.getTagName(r)===st.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(r)===Ut.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===W.MGLYPH||e.tagID===W.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,r,Ut.HTML)}_processToken(e){switch(e.type){case ai.CHARACTER:{this.onCharacter(e);break}case ai.NULL_CHARACTER:{this.onNullCharacter(e);break}case ai.COMMENT:{this.onComment(e);break}case ai.DOCTYPE:{this.onDoctype(e);break}case ai.START_TAG:{this._processStartTag(e);break}case ai.END_TAG:{this.onEndTag(e);break}case ai.EOF:{this.onEof(e);break}case ai.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,r,n){const i=this.treeAdapter.getNamespaceURI(r),a=this.treeAdapter.getAttrList(r);return v_r(e,i,a,n)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const r=this.activeFormattingElements.entries.findIndex(i=>i.type===Sm.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(W.P),this.openElements.popUntilTagNamePopped(W.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case W.TR:{this.insertionMode=Ke.IN_ROW;return}case W.TBODY:case W.THEAD:case W.TFOOT:{this.insertionMode=Ke.IN_TABLE_BODY;return}case W.CAPTION:{this.insertionMode=Ke.IN_CAPTION;return}case W.COLGROUP:{this.insertionMode=Ke.IN_COLUMN_GROUP;return}case W.TABLE:{this.insertionMode=Ke.IN_TABLE;return}case W.BODY:{this.insertionMode=Ke.IN_BODY;return}case W.FRAMESET:{this.insertionMode=Ke.IN_FRAMESET;return}case W.SELECT:{this._resetInsertionModeForSelect(e);return}case W.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case W.HTML:{this.insertionMode=this.headElement?Ke.AFTER_HEAD:Ke.BEFORE_HEAD;return}case W.TD:case W.TH:{if(e>0){this.insertionMode=Ke.IN_CELL;return}break}case W.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===W.TEMPLATE)break;if(n===W.TABLE){this.insertionMode=Ke.IN_SELECT_IN_TABLE;return}}this.insertionMode=Ke.IN_SELECT}_isElementCausesFosterParenting(e){return Wnt.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 W.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(r)===Ut.HTML)return{parent:this.treeAdapter.getTemplateContent(r),beforeElement:null};break}case W.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 UEr[n].has(r)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){K5r(this,e);return}switch(this.insertionMode){case Ke.INITIAL:{yN(this,e);break}case Ke.BEFORE_HTML:{bN(this,e);break}case Ke.BEFORE_HEAD:{xN(this,e);break}case Ke.IN_HEAD:{wN(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{AN(this,e);break}case Ke.AFTER_HEAD:{SN(this,e);break}case Ke.IN_BODY:case Ke.IN_CAPTION:case Ke.IN_CELL:case Ke.IN_TEMPLATE:{Xnt(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:{mhe(this,e);break}case Ke.IN_TABLE_TEXT:{iit(this,e);break}case Ke.IN_COLUMN_GROUP:{MG(this,e);break}case Ke.AFTER_BODY:{NG(this,e);break}case Ke.AFTER_AFTER_BODY:{BG(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){X5r(this,e);return}switch(this.insertionMode){case Ke.INITIAL:{yN(this,e);break}case Ke.BEFORE_HTML:{bN(this,e);break}case Ke.BEFORE_HEAD:{xN(this,e);break}case Ke.IN_HEAD:{wN(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{AN(this,e);break}case Ke.AFTER_HEAD:{SN(this,e);break}case Ke.TEXT:{this._insertCharacters(e);break}case Ke.IN_TABLE:case Ke.IN_TABLE_BODY:case Ke.IN_ROW:{mhe(this,e);break}case Ke.IN_COLUMN_GROUP:{MG(this,e);break}case Ke.AFTER_BODY:{NG(this,e);break}case Ke.AFTER_AFTER_BODY:{BG(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){phe(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:{phe(this,e);break}case Ke.IN_TABLE_TEXT:{ON(this,e);break}case Ke.AFTER_BODY:{E_r(this,e);break}case Ke.AFTER_AFTER_BODY:case Ke.AFTER_AFTER_FRAMESET:{__r(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case Ke.INITIAL:{R_r(this,e);break}case Ke.BEFORE_HEAD:case Ke.IN_HEAD:case Ke.IN_HEAD_NO_SCRIPT:case Ke.AFTER_HEAD:{this._err(e,bt.misplacedDoctype);break}case Ke.IN_TABLE_TEXT:{ON(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,bt.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?Z5r(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case Ke.INITIAL:{yN(this,e);break}case Ke.BEFORE_HTML:{D_r(this,e);break}case Ke.BEFORE_HEAD:{M_r(this,e);break}case Ke.IN_HEAD:{rg(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{N_r(this,e);break}case Ke.AFTER_HEAD:{$_r(this,e);break}case Ke.IN_BODY:{Qc(this,e);break}case Ke.IN_TABLE:{e_(this,e);break}case Ke.IN_TABLE_TEXT:{ON(this,e);break}case Ke.IN_CAPTION:{I5r(this,e);break}case Ke.IN_COLUMN_GROUP:{vhe(this,e);break}case Ke.IN_TABLE_BODY:{IG(this,e);break}case Ke.IN_ROW:{PG(this,e);break}case Ke.IN_CELL:{B5r(this,e);break}case Ke.IN_SELECT:{sit(this,e);break}case Ke.IN_SELECT_IN_TABLE:{F5r(this,e);break}case Ke.IN_TEMPLATE:{U5r(this,e);break}case Ke.AFTER_BODY:{Q5r(this,e);break}case Ke.IN_FRAMESET:{G5r(this,e);break}case Ke.AFTER_FRAMESET:{W5r(this,e);break}case Ke.AFTER_AFTER_BODY:{q5r(this,e);break}case Ke.AFTER_AFTER_FRAMESET:{j5r(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?J5r(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case Ke.INITIAL:{yN(this,e);break}case Ke.BEFORE_HTML:{L_r(this,e);break}case Ke.BEFORE_HEAD:{I_r(this,e);break}case Ke.IN_HEAD:{P_r(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{B_r(this,e);break}case Ke.AFTER_HEAD:{F_r(this,e);break}case Ke.IN_BODY:{LG(this,e);break}case Ke.TEXT:{T5r(this,e);break}case Ke.IN_TABLE:{TN(this,e);break}case Ke.IN_TABLE_TEXT:{ON(this,e);break}case Ke.IN_CAPTION:{P5r(this,e);break}case Ke.IN_COLUMN_GROUP:{N5r(this,e);break}case Ke.IN_TABLE_BODY:{yhe(this,e);break}case Ke.IN_ROW:{oit(this,e);break}case Ke.IN_CELL:{$5r(this,e);break}case Ke.IN_SELECT:{lit(this,e);break}case Ke.IN_SELECT_IN_TABLE:{z5r(this,e);break}case Ke.IN_TEMPLATE:{V5r(this,e);break}case Ke.AFTER_BODY:{uit(this,e);break}case Ke.IN_FRAMESET:{H5r(this,e);break}case Ke.AFTER_FRAMESET:{Y5r(this,e);break}case Ke.AFTER_AFTER_BODY:{BG(this,e);break}}}onEof(e){switch(this.insertionMode){case Ke.INITIAL:{yN(this,e);break}case Ke.BEFORE_HTML:{bN(this,e);break}case Ke.BEFORE_HEAD:{xN(this,e);break}case Ke.IN_HEAD:{wN(this,e);break}case Ke.IN_HEAD_NO_SCRIPT:{AN(this,e);break}case Ke.AFTER_HEAD:{SN(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:{rit(this,e);break}case Ke.TEXT:{C5r(this,e);break}case Ke.IN_TABLE_TEXT:{ON(this,e);break}case Ke.IN_TEMPLATE:{cit(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:{ghe(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===Ue.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:{jnt(this,e);break}case Ke.IN_TABLE:case Ke.IN_TABLE_BODY:case Ke.IN_ROW:{mhe(this,e);break}case Ke.IN_TABLE_TEXT:{nit(this,e);break}}}};function A_r(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):tit(t,e),r}function S_r(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 T_r(t,e,r){let n=e,i=t.openElements.getCommonAncestor(e);for(let a=0,o=i;o!==r;a++,o=i){i=t.openElements.getCommonAncestor(o);const s=t.activeFormattingElements.getElementEntry(o),l=s&&a>=x_r;!s||l?(l&&t.activeFormattingElements.removeEntry(s),t.openElements.remove(o)):(o=C_r(t,s),n===e&&(t.activeFormattingElements.bookmark=s),t.treeAdapter.detachNode(n),t.treeAdapter.appendChild(o,n),n=o)}return n}function C_r(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 O_r(t,e,r){const n=t.treeAdapter.getTagName(e),i=JE(n);if(t._isElementCausesFosterParenting(i))t._fosterParentElement(r);else{const a=t.treeAdapter.getNamespaceURI(e);i===W.TEMPLATE&&a===Ut.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,r)}}function k_r(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 fhe(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],o=t.treeAdapter.getNodeSourceCodeLocation(a);o&&!o.endTag&&t._setEndLocation(a,e)}}}}function R_r(t,e){t._setDocumentType(e);const r=e.forceQuirks?Gf.QUIRKS:o_r(e);a_r(e)||t._err(e,bt.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,r),t.insertionMode=Ke.BEFORE_HTML}function yN(t,e){t._err(e,bt.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,Gf.QUIRKS),t.insertionMode=Ke.BEFORE_HTML,t._processToken(e)}function D_r(t,e){e.tagID===W.HTML?(t._insertElement(e,Ut.HTML),t.insertionMode=Ke.BEFORE_HEAD):bN(t,e)}function L_r(t,e){const r=e.tagID;(r===W.HTML||r===W.HEAD||r===W.BODY||r===W.BR)&&bN(t,e)}function bN(t,e){t._insertFakeRootElement(),t.insertionMode=Ke.BEFORE_HEAD,t._processToken(e)}function M_r(t,e){switch(e.tagID){case W.HTML:{Qc(t,e);break}case W.HEAD:{t._insertElement(e,Ut.HTML),t.headElement=t.openElements.current,t.insertionMode=Ke.IN_HEAD;break}default:xN(t,e)}}function I_r(t,e){const r=e.tagID;r===W.HEAD||r===W.BODY||r===W.HTML||r===W.BR?xN(t,e):t._err(e,bt.endTagWithoutMatchingOpenElement)}function xN(t,e){t._insertFakeElement(st.HEAD,W.HEAD),t.headElement=t.openElements.current,t.insertionMode=Ke.IN_HEAD,t._processToken(e)}function rg(t,e){switch(e.tagID){case W.HTML:{Qc(t,e);break}case W.BASE:case W.BASEFONT:case W.BGSOUND:case W.LINK:case W.META:{t._appendElement(e,Ut.HTML),e.ackSelfClosing=!0;break}case W.TITLE:{t._switchToTextParsing(e,us.RCDATA);break}case W.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,us.RAWTEXT):(t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_HEAD_NO_SCRIPT);break}case W.NOFRAMES:case W.STYLE:{t._switchToTextParsing(e,us.RAWTEXT);break}case W.SCRIPT:{t._switchToTextParsing(e,us.SCRIPT_DATA);break}case W.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=Ke.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(Ke.IN_TEMPLATE);break}case W.HEAD:{t._err(e,bt.misplacedStartTagForHeadElement);break}default:wN(t,e)}}function P_r(t,e){switch(e.tagID){case W.HEAD:{t.openElements.pop(),t.insertionMode=Ke.AFTER_HEAD;break}case W.BODY:case W.BR:case W.HTML:{wN(t,e);break}case W.TEMPLATE:{BA(t,e);break}default:t._err(e,bt.endTagWithoutMatchingOpenElement)}}function BA(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==W.TEMPLATE&&t._err(e,bt.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(W.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,bt.endTagWithoutMatchingOpenElement)}function wN(t,e){t.openElements.pop(),t.insertionMode=Ke.AFTER_HEAD,t._processToken(e)}function N_r(t,e){switch(e.tagID){case W.HTML:{Qc(t,e);break}case W.BASEFONT:case W.BGSOUND:case W.HEAD:case W.LINK:case W.META:case W.NOFRAMES:case W.STYLE:{rg(t,e);break}case W.NOSCRIPT:{t._err(e,bt.nestedNoscriptInHead);break}default:AN(t,e)}}function B_r(t,e){switch(e.tagID){case W.NOSCRIPT:{t.openElements.pop(),t.insertionMode=Ke.IN_HEAD;break}case W.BR:{AN(t,e);break}default:t._err(e,bt.endTagWithoutMatchingOpenElement)}}function AN(t,e){const r=e.type===ai.EOF?bt.openElementsLeftAfterEof:bt.disallowedContentInNoscriptInHead;t._err(e,r),t.openElements.pop(),t.insertionMode=Ke.IN_HEAD,t._processToken(e)}function $_r(t,e){switch(e.tagID){case W.HTML:{Qc(t,e);break}case W.BODY:{t._insertElement(e,Ut.HTML),t.framesetOk=!1,t.insertionMode=Ke.IN_BODY;break}case W.FRAMESET:{t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_FRAMESET;break}case W.BASE:case W.BASEFONT:case W.BGSOUND:case W.LINK:case W.META:case W.NOFRAMES:case W.SCRIPT:case W.STYLE:case W.TEMPLATE:case W.TITLE:{t._err(e,bt.abandonedHeadElementChild),t.openElements.push(t.headElement,W.HEAD),rg(t,e),t.openElements.remove(t.headElement);break}case W.HEAD:{t._err(e,bt.misplacedStartTagForHeadElement);break}default:SN(t,e)}}function F_r(t,e){switch(e.tagID){case W.BODY:case W.HTML:case W.BR:{SN(t,e);break}case W.TEMPLATE:{BA(t,e);break}default:t._err(e,bt.endTagWithoutMatchingOpenElement)}}function SN(t,e){t._insertFakeElement(st.BODY,W.BODY),t.insertionMode=Ke.IN_BODY,DG(t,e)}function DG(t,e){switch(e.type){case ai.CHARACTER:{Xnt(t,e);break}case ai.WHITESPACE_CHARACTER:{jnt(t,e);break}case ai.COMMENT:{phe(t,e);break}case ai.START_TAG:{Qc(t,e);break}case ai.END_TAG:{LG(t,e);break}case ai.EOF:{rit(t,e);break}}}function jnt(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function Xnt(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function z_r(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function U_r(t,e){const r=t.openElements.tryPeekProperlyNestedBodyElement();r&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(r,e.attrs))}function V_r(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 Q_r(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._insertElement(e,Ut.HTML)}function G_r(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&uhe.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,Ut.HTML)}function H_r(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._insertElement(e,Ut.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function W_r(t,e){const r=t.openElements.tmplCount>0;(!t.formElement||r)&&(t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._insertElement(e,Ut.HTML),r||(t.formElement=t.openElements.current))}function Y_r(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===W.LI&&i===W.LI||(r===W.DD||r===W.DT)&&(i===W.DD||i===W.DT)){t.openElements.generateImpliedEndTagsWithExclusion(i),t.openElements.popUntilTagNamePopped(i);break}if(i!==W.ADDRESS&&i!==W.DIV&&i!==W.P&&t._isSpecialElement(t.openElements.items[n],i))break}t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._insertElement(e,Ut.HTML)}function q_r(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._insertElement(e,Ut.HTML),t.tokenizer.state=us.PLAINTEXT}function j_r(t,e){t.openElements.hasInScope(W.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(W.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML),t.framesetOk=!1}function X_r(t,e){const r=t.activeFormattingElements.getElementEntryInScopeWithTagName(st.A);r&&(fhe(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 K_r(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Z_r(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(W.NOBR)&&(fhe(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,Ut.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function J_r(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function e5r(t,e){t.treeAdapter.getDocumentMode(t.document)!==Gf.QUIRKS&&t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._insertElement(e,Ut.HTML),t.framesetOk=!1,t.insertionMode=Ke.IN_TABLE}function Knt(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ut.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function Znt(t){const e=Rnt(t,NA.TYPE);return e!=null&&e.toLowerCase()===y_r}function t5r(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,Ut.HTML),Znt(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function r5r(t,e){t._appendElement(e,Ut.HTML),e.ackSelfClosing=!0}function n5r(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._appendElement(e,Ut.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function i5r(t,e){e.tagName=st.IMG,e.tagID=W.IMG,Knt(t,e)}function a5r(t,e){t._insertElement(e,Ut.HTML),t.skipNextNewLine=!0,t.tokenizer.state=us.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=Ke.TEXT}function o5r(t,e){t.openElements.hasInButtonScope(W.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,us.RAWTEXT)}function s5r(t,e){t.framesetOk=!1,t._switchToTextParsing(e,us.RAWTEXT)}function Jnt(t,e){t._switchToTextParsing(e,us.RAWTEXT)}function l5r(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 c5r(t,e){t.openElements.currentTagId===W.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML)}function u5r(t,e){t.openElements.hasInScope(W.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,Ut.HTML)}function h5r(t,e){t.openElements.hasInScope(W.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(W.RTC),t._insertElement(e,Ut.HTML)}function d5r(t,e){t._reconstructActiveFormattingElements(),Gnt(e),dhe(e),e.selfClosing?t._appendElement(e,Ut.MATHML):t._insertElement(e,Ut.MATHML),e.ackSelfClosing=!0}function f5r(t,e){t._reconstructActiveFormattingElements(),Hnt(e),dhe(e),e.selfClosing?t._appendElement(e,Ut.SVG):t._insertElement(e,Ut.SVG),e.ackSelfClosing=!0}function eit(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,Ut.HTML)}function Qc(t,e){switch(e.tagID){case W.I:case W.S:case W.B:case W.U:case W.EM:case W.TT:case W.BIG:case W.CODE:case W.FONT:case W.SMALL:case W.STRIKE:case W.STRONG:{K_r(t,e);break}case W.A:{X_r(t,e);break}case W.H1:case W.H2:case W.H3:case W.H4:case W.H5:case W.H6:{G_r(t,e);break}case W.P:case W.DL:case W.OL:case W.UL:case W.DIV:case W.DIR:case W.NAV:case W.MAIN:case W.MENU:case W.ASIDE:case W.CENTER:case W.FIGURE:case W.FOOTER:case W.HEADER:case W.HGROUP:case W.DIALOG:case W.DETAILS:case W.ADDRESS:case W.ARTICLE:case W.SEARCH:case W.SECTION:case W.SUMMARY:case W.FIELDSET:case W.BLOCKQUOTE:case W.FIGCAPTION:{Q_r(t,e);break}case W.LI:case W.DD:case W.DT:{Y_r(t,e);break}case W.BR:case W.IMG:case W.WBR:case W.AREA:case W.EMBED:case W.KEYGEN:{Knt(t,e);break}case W.HR:{n5r(t,e);break}case W.RB:case W.RTC:{u5r(t,e);break}case W.RT:case W.RP:{h5r(t,e);break}case W.PRE:case W.LISTING:{H_r(t,e);break}case W.XMP:{o5r(t,e);break}case W.SVG:{f5r(t,e);break}case W.HTML:{z_r(t,e);break}case W.BASE:case W.LINK:case W.META:case W.STYLE:case W.TITLE:case W.SCRIPT:case W.BGSOUND:case W.BASEFONT:case W.TEMPLATE:{rg(t,e);break}case W.BODY:{U_r(t,e);break}case W.FORM:{W_r(t,e);break}case W.NOBR:{Z_r(t,e);break}case W.MATH:{d5r(t,e);break}case W.TABLE:{e5r(t,e);break}case W.INPUT:{t5r(t,e);break}case W.PARAM:case W.TRACK:case W.SOURCE:{r5r(t,e);break}case W.IMAGE:{i5r(t,e);break}case W.BUTTON:{j_r(t,e);break}case W.APPLET:case W.OBJECT:case W.MARQUEE:{J_r(t,e);break}case W.IFRAME:{s5r(t,e);break}case W.SELECT:{l5r(t,e);break}case W.OPTION:case W.OPTGROUP:{c5r(t,e);break}case W.NOEMBED:case W.NOFRAMES:{Jnt(t,e);break}case W.FRAMESET:{V_r(t,e);break}case W.TEXTAREA:{a5r(t,e);break}case W.NOSCRIPT:{t.options.scriptingEnabled?Jnt(t,e):eit(t,e);break}case W.PLAINTEXT:{q_r(t,e);break}case W.COL:case W.TH:case W.TD:case W.TR:case W.HEAD:case W.FRAME:case W.TBODY:case W.TFOOT:case W.THEAD:case W.CAPTION:case W.COLGROUP:break;default:eit(t,e)}}function p5r(t,e){if(t.openElements.hasInScope(W.BODY)&&(t.insertionMode=Ke.AFTER_BODY,t.options.sourceCodeLocationInfo)){const r=t.openElements.tryPeekProperlyNestedBodyElement();r&&t._setEndLocation(r,e)}}function g5r(t,e){t.openElements.hasInScope(W.BODY)&&(t.insertionMode=Ke.AFTER_BODY,uit(t,e))}function m5r(t,e){const r=e.tagID;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(r))}function v5r(t){const e=t.openElements.tmplCount>0,{formElement:r}=t;e||(t.formElement=null),(r||e)&&t.openElements.hasInScope(W.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(W.FORM):r&&t.openElements.remove(r))}function y5r(t){t.openElements.hasInButtonScope(W.P)||t._insertFakeElement(st.P,W.P),t._closePElement()}function b5r(t){t.openElements.hasInListItemScope(W.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(W.LI),t.openElements.popUntilTagNamePopped(W.LI))}function x5r(t,e){const r=e.tagID;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.popUntilTagNamePopped(r))}function w5r(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function A5r(t,e){const r=e.tagID;t.openElements.hasInScope(r)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(r),t.activeFormattingElements.clearToLastMarker())}function S5r(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(st.BR,W.BR),t.openElements.pop(),t.framesetOk=!1}function tit(t,e){const r=e.tagName,n=e.tagID;for(let i=t.openElements.stackTop;i>0;i--){const a=t.openElements.items[i],o=t.openElements.tagIDs[i];if(n===o&&(n!==W.UNKNOWN||t.treeAdapter.getTagName(a)===r)){t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.stackTop>=i&&t.openElements.shortenToLength(i);break}if(t._isSpecialElement(a,o))break}}function LG(t,e){switch(e.tagID){case W.A:case W.B:case W.I:case W.S:case W.U:case W.EM:case W.TT:case W.BIG:case W.CODE:case W.FONT:case W.NOBR:case W.SMALL:case W.STRIKE:case W.STRONG:{fhe(t,e);break}case W.P:{y5r(t);break}case W.DL:case W.UL:case W.OL:case W.DIR:case W.DIV:case W.NAV:case W.PRE:case W.MAIN:case W.MENU:case W.ASIDE:case W.BUTTON:case W.CENTER:case W.FIGURE:case W.FOOTER:case W.HEADER:case W.HGROUP:case W.DIALOG:case W.ADDRESS:case W.ARTICLE:case W.DETAILS:case W.SEARCH:case W.SECTION:case W.SUMMARY:case W.LISTING:case W.FIELDSET:case W.BLOCKQUOTE:case W.FIGCAPTION:{m5r(t,e);break}case W.LI:{b5r(t);break}case W.DD:case W.DT:{x5r(t,e);break}case W.H1:case W.H2:case W.H3:case W.H4:case W.H5:case W.H6:{w5r(t);break}case W.BR:{S5r(t);break}case W.BODY:{p5r(t,e);break}case W.HTML:{g5r(t,e);break}case W.FORM:{v5r(t);break}case W.APPLET:case W.OBJECT:case W.MARQUEE:{A5r(t,e);break}case W.TEMPLATE:{BA(t,e);break}default:tit(t,e)}}function rit(t,e){t.tmplInsertionModeStack.length>0?cit(t,e):ghe(t,e)}function T5r(t,e){var r;e.tagID===W.SCRIPT&&((r=t.scriptHandler)===null||r===void 0||r.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function C5r(t,e){t._err(e,bt.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function mhe(t,e){if(t.openElements.currentTagId!==void 0&&Wnt.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 ai.CHARACTER:{iit(t,e);break}case ai.WHITESPACE_CHARACTER:{nit(t,e);break}}else CN(t,e)}function O5r(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_CAPTION}function k5r(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_COLUMN_GROUP}function E5r(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(st.COLGROUP,W.COLGROUP),t.insertionMode=Ke.IN_COLUMN_GROUP,vhe(t,e)}function _5r(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,Ut.HTML),t.insertionMode=Ke.IN_TABLE_BODY}function R5r(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(st.TBODY,W.TBODY),t.insertionMode=Ke.IN_TABLE_BODY,IG(t,e)}function D5r(t,e){t.openElements.hasInTableScope(W.TABLE)&&(t.openElements.popUntilTagNamePopped(W.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function L5r(t,e){Znt(e)?t._appendElement(e,Ut.HTML):CN(t,e),e.ackSelfClosing=!0}function M5r(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,Ut.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function e_(t,e){switch(e.tagID){case W.TD:case W.TH:case W.TR:{R5r(t,e);break}case W.STYLE:case W.SCRIPT:case W.TEMPLATE:{rg(t,e);break}case W.COL:{E5r(t,e);break}case W.FORM:{M5r(t,e);break}case W.TABLE:{D5r(t,e);break}case W.TBODY:case W.TFOOT:case W.THEAD:{_5r(t,e);break}case W.INPUT:{L5r(t,e);break}case W.CAPTION:{O5r(t,e);break}case W.COLGROUP:{k5r(t,e);break}default:CN(t,e)}}function TN(t,e){switch(e.tagID){case W.TABLE:{t.openElements.hasInTableScope(W.TABLE)&&(t.openElements.popUntilTagNamePopped(W.TABLE),t._resetInsertionMode());break}case W.TEMPLATE:{BA(t,e);break}case W.BODY:case W.CAPTION:case W.COL:case W.COLGROUP:case W.HTML:case W.TBODY:case W.TD:case W.TFOOT:case W.TH:case W.THEAD:case W.TR:break;default:CN(t,e)}}function CN(t,e){const r=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,DG(t,e),t.fosterParentingEnabled=r}function nit(t,e){t.pendingCharacterTokens.push(e)}function iit(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function ON(t,e){let r=0;if(t.hasNonWhitespacePendingCharacterToken)for(;r0&&t.openElements.currentTagId===W.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===W.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===W.OPTGROUP&&t.openElements.pop();break}case W.OPTION:{t.openElements.currentTagId===W.OPTION&&t.openElements.pop();break}case W.SELECT:{t.openElements.hasInSelectScope(W.SELECT)&&(t.openElements.popUntilTagNamePopped(W.SELECT),t._resetInsertionMode());break}case W.TEMPLATE:{BA(t,e);break}}}function F5r(t,e){const r=e.tagID;r===W.CAPTION||r===W.TABLE||r===W.TBODY||r===W.TFOOT||r===W.THEAD||r===W.TR||r===W.TD||r===W.TH?(t.openElements.popUntilTagNamePopped(W.SELECT),t._resetInsertionMode(),t._processStartTag(e)):sit(t,e)}function z5r(t,e){const r=e.tagID;r===W.CAPTION||r===W.TABLE||r===W.TBODY||r===W.TFOOT||r===W.THEAD||r===W.TR||r===W.TD||r===W.TH?t.openElements.hasInTableScope(r)&&(t.openElements.popUntilTagNamePopped(W.SELECT),t._resetInsertionMode(),t.onEndTag(e)):lit(t,e)}function U5r(t,e){switch(e.tagID){case W.BASE:case W.BASEFONT:case W.BGSOUND:case W.LINK:case W.META:case W.NOFRAMES:case W.SCRIPT:case W.STYLE:case W.TEMPLATE:case W.TITLE:{rg(t,e);break}case W.CAPTION:case W.COLGROUP:case W.TBODY:case W.TFOOT:case W.THEAD:{t.tmplInsertionModeStack[0]=Ke.IN_TABLE,t.insertionMode=Ke.IN_TABLE,e_(t,e);break}case W.COL:{t.tmplInsertionModeStack[0]=Ke.IN_COLUMN_GROUP,t.insertionMode=Ke.IN_COLUMN_GROUP,vhe(t,e);break}case W.TR:{t.tmplInsertionModeStack[0]=Ke.IN_TABLE_BODY,t.insertionMode=Ke.IN_TABLE_BODY,IG(t,e);break}case W.TD:case W.TH:{t.tmplInsertionModeStack[0]=Ke.IN_ROW,t.insertionMode=Ke.IN_ROW,PG(t,e);break}default:t.tmplInsertionModeStack[0]=Ke.IN_BODY,t.insertionMode=Ke.IN_BODY,Qc(t,e)}}function V5r(t,e){e.tagID===W.TEMPLATE&&BA(t,e)}function cit(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(W.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):ghe(t,e)}function Q5r(t,e){e.tagID===W.HTML?Qc(t,e):NG(t,e)}function uit(t,e){var r;if(e.tagID===W.HTML){if(t.fragmentContext||(t.insertionMode=Ke.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===W.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 NG(t,e)}function NG(t,e){t.insertionMode=Ke.IN_BODY,DG(t,e)}function G5r(t,e){switch(e.tagID){case W.HTML:{Qc(t,e);break}case W.FRAMESET:{t._insertElement(e,Ut.HTML);break}case W.FRAME:{t._appendElement(e,Ut.HTML),e.ackSelfClosing=!0;break}case W.NOFRAMES:{rg(t,e);break}}}function H5r(t,e){e.tagID===W.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==W.FRAMESET&&(t.insertionMode=Ke.AFTER_FRAMESET))}function W5r(t,e){switch(e.tagID){case W.HTML:{Qc(t,e);break}case W.NOFRAMES:{rg(t,e);break}}}function Y5r(t,e){e.tagID===W.HTML&&(t.insertionMode=Ke.AFTER_AFTER_FRAMESET)}function q5r(t,e){e.tagID===W.HTML?Qc(t,e):BG(t,e)}function BG(t,e){t.insertionMode=Ke.IN_BODY,DG(t,e)}function j5r(t,e){switch(e.tagID){case W.HTML:{Qc(t,e);break}case W.NOFRAMES:{rg(t,e);break}}}function X5r(t,e){e.chars=bo,t._insertCharacters(e)}function K5r(t,e){t._insertCharacters(e),t.framesetOk=!1}function hit(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 Z5r(t,e){if(f_r(e))hit(t),t._startTagOutsideForeignContent(e);else{const r=t._getAdjustedCurrentElement(),n=t.treeAdapter.getNamespaceURI(r);n===Ut.MATHML?Gnt(e):n===Ut.SVG&&(p_r(e),Hnt(e)),dhe(e),e.selfClosing?t._appendElement(e,n):t._insertElement(e,n),e.ackSelfClosing=!0}}function J5r(t,e){if(e.tagID===W.P||e.tagID===W.BR){hit(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 eRr=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,tRr=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),dit={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function fit(t,e){const r=hRr(t),n=Xtt("type",{handlers:{root:rRr,element:nRr,text:iRr,comment:git,doctype:aRr,raw:sRr},unknown:lRr}),i={parser:r?new qnt(dit):qnt.getFragmentParser(void 0,dit),handle(s){n(s,i)},stitches:!1,options:e||{}};n(t,i),t_(i,bm());const a=r?i.parser.document:i.parser.getFragment(),o=dEr(a,{file:i.options.file});return i.stitches&&hN(o,"comment",function(s,l,u){const h=s;if(h.value.stitch&&u&&l!==void 0){const d=u.children;return d[l]=h.value.stitch,l}}),o.type==="root"&&o.children.length===1&&o.children[0].type===t.type?o.children[0]:o}function pit(t,e){let r=-1;if(t)for(;++r4&&(e.parser.tokenizer.state=0);const r={type:ai.CHARACTER,chars:t.value,location:kN(t)};t_(e,bm(t)),e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken)}function aRr(t,e){const r={type:ai.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:kN(t)};t_(e,bm(t)),e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken)}function oRr(t,e){e.stitches=!0;const r=dRr(t);if("children"in t&&"children"in r){const n=fit({type:"root",children:t.children},e.options);r.children=n.children}git({type:"comment",value:{stitch:r}},e)}function git(t,e){const r=t.value,n={type:ai.COMMENT,data:r,location:kN(t)};t_(e,bm(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function sRr(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,mit(e,bm(t)),e.parser.tokenizer.write(e.options.tagfilter?t.value.replace(eRr,"<$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 lRr(t,e){const r=t;if(e.options.passThrough&&e.options.passThrough.includes(r.type))oRr(r,e);else{let n="";throw tRr.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 t_(t,e){mit(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=us.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 mit(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 cRr(t,e){const r=t.tagName.toLowerCase();if(e.parser.tokenizer.state===us.PLAINTEXT)return;t_(e,bm(t));const n=e.parser.openElements.current;let i="namespaceURI"in n?n.namespaceURI:PA.html;i===PA.html&&r==="svg"&&(i=PA.svg);const a=vEr({...t,children:[]},{space:i===PA.svg?"svg":"html"}),o={type:ai.START_TAG,tagName:r,tagID:JE(r),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:kN(t)};e.parser.currentToken=o,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=r}function uRr(t,e){const r=t.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&CEr.includes(r)||e.parser.tokenizer.state===us.PLAINTEXT)return;t_(e,iG(t));const n={type:ai.END_TAG,tagName:r,tagID:JE(r),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:kN(t)};e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken),r===e.parser.tokenizer.lastStartTagName&&(e.parser.tokenizer.state===us.RCDATA||e.parser.tokenizer.state===us.RAWTEXT||e.parser.tokenizer.state===us.SCRIPT_DATA)&&(e.parser.tokenizer.state=us.DATA)}function hRr(t){const e=t.type==="root"?t.children[0]:t;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function kN(t){const e=bm(t)||{line:void 0,column:void 0,offset:void 0},r=iG(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 dRr(t){return"children"in t?HE({...t,children:[]}):HE(t)}function fRr(t){return function(e,r){return fit(e,{...t,file:r})}}var pRr=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,gRr=/[\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]/,mRr=/[\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]/,bhe={Space_Separator:pRr,ID_Start:gRr,ID_Continue:mRr},hs={isSpaceSeparator(t){return typeof t=="string"&&bhe.Space_Separator.test(t)},isIdStartChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="$"||t==="_"||bhe.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==="‍"||bhe.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 xhe,ku,ly,$G,bx,ng,Ol,whe,EN;var vRr=function(e,r){xhe=String(e),ku="start",ly=[],$G=0,bx=1,ng=0,Ol=void 0,whe=void 0,EN=void 0;do Ol=yRr(),wRr[ku]();while(Ol.type!=="eof");return typeof r=="function"?Ahe({"":EN},"",r):EN};function Ahe(t,e,r){const n=t[e];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let i=0;i0;){const r=uy();if(!hs.isHexDigit(r))throw ro(Pt());t+=Pt()}return String.fromCodePoint(parseInt(t,16))}const bRr={start(){if(Ol.type==="eof")throw FA();The()},beforePropertyName(){switch(Ol.type){case"identifier":case"string":whe=Ol.value,ku="afterPropertyName";return;case"punctuator":FG();return;case"eof":throw FA()}},afterPropertyName(){if(Ol.type==="eof")throw FA();ku="beforePropertyValue"},beforePropertyValue(){if(Ol.type==="eof")throw FA();The()},beforeArrayValue(){if(Ol.type==="eof")throw FA();if(Ol.type==="punctuator"&&Ol.value==="]"){FG();return}The()},afterPropertyValue(){if(Ol.type==="eof")throw FA();switch(Ol.value){case",":ku="beforePropertyName";return;case"}":FG()}},afterArrayValue(){if(Ol.type==="eof")throw FA();switch(Ol.value){case",":ku="beforeArrayValue";return;case"]":FG()}},end(){}};function The(){let t;switch(Ol.type){case"punctuator":switch(Ol.value){case"{":t={};break;case"[":t=[];break}break;case"null":case"boolean":case"numeric":case"string":t=Ol.value;break}if(EN===void 0)EN=t;else{const e=ly[ly.length-1];Array.isArray(e)?e.push(t):Object.defineProperty(e,whe,{value:t,writable:!0,enumerable:!0,configurable:!0})}if(t!==null&&typeof t=="object")ly.push(t),Array.isArray(t)?ku="beforeArrayValue":ku="beforePropertyName";else{const e=ly[ly.length-1];e==null?ku="end":Array.isArray(e)?ku="afterArrayValue":ku="afterPropertyValue"}}function FG(){ly.pop();const t=ly[ly.length-1];t==null?ku="end":Array.isArray(t)?ku="afterArrayValue":ku="afterPropertyValue"}function ro(t){return zG(t===void 0?`JSON5: invalid end of input at ${bx}:${ng}`:`JSON5: invalid character '${vit(t)}' at ${bx}:${ng}`)}function FA(){return zG(`JSON5: invalid end of input at ${bx}:${ng}`)}function mit(){return ng-=5,zG(`JSON5: invalid identifier character at ${bx}:${ng}`)}function xRr(t){console.warn(`JSON5: '${vit(t)}' in strings is not valid ECMAScript; consider escaping`)}function vit(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 zG(t){const e=new SyntaxError(t);return e.lineNumber=bx,e.columnNumber=ng,e}var wRr=function(e,r,n){const i=[];let a="",o,s,l="",u;if(r!=null&&typeof r=="object"&&!Array.isArray(r)&&(n=r.space,u=r.quote,r=r.replacer),typeof r=="function")s=r;else if(Array.isArray(r)){o=[];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&&o.indexOf(v)<0&&o.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))),s&&(y=s.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=o||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=`, +`&&Pt(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw ro(Pt());case void 0:throw ro(Pt())}return Pt()}function xRr(){let t="",e=uy();if(!hs.isHexDigit(e)||(t+=Pt(),e=uy(),!hs.isHexDigit(e)))throw ro(Pt());return t+=Pt(),String.fromCodePoint(parseInt(t,16))}function She(){let t="",e=4;for(;e-- >0;){const r=uy();if(!hs.isHexDigit(r))throw ro(Pt());t+=Pt()}return String.fromCodePoint(parseInt(t,16))}const wRr={start(){if(Ol.type==="eof")throw FA();The()},beforePropertyName(){switch(Ol.type){case"identifier":case"string":whe=Ol.value,ku="afterPropertyName";return;case"punctuator":FG();return;case"eof":throw FA()}},afterPropertyName(){if(Ol.type==="eof")throw FA();ku="beforePropertyValue"},beforePropertyValue(){if(Ol.type==="eof")throw FA();The()},beforeArrayValue(){if(Ol.type==="eof")throw FA();if(Ol.type==="punctuator"&&Ol.value==="]"){FG();return}The()},afterPropertyValue(){if(Ol.type==="eof")throw FA();switch(Ol.value){case",":ku="beforePropertyName";return;case"}":FG()}},afterArrayValue(){if(Ol.type==="eof")throw FA();switch(Ol.value){case",":ku="beforeArrayValue";return;case"]":FG()}},end(){}};function The(){let t;switch(Ol.type){case"punctuator":switch(Ol.value){case"{":t={};break;case"[":t=[];break}break;case"null":case"boolean":case"numeric":case"string":t=Ol.value;break}if(EN===void 0)EN=t;else{const e=ly[ly.length-1];Array.isArray(e)?e.push(t):Object.defineProperty(e,whe,{value:t,writable:!0,enumerable:!0,configurable:!0})}if(t!==null&&typeof t=="object")ly.push(t),Array.isArray(t)?ku="beforeArrayValue":ku="beforePropertyName";else{const e=ly[ly.length-1];e==null?ku="end":Array.isArray(e)?ku="afterArrayValue":ku="afterPropertyValue"}}function FG(){ly.pop();const t=ly[ly.length-1];t==null?ku="end":Array.isArray(t)?ku="afterArrayValue":ku="afterPropertyValue"}function ro(t){return zG(t===void 0?`JSON5: invalid end of input at ${bx}:${ng}`:`JSON5: invalid character '${bit(t)}' at ${bx}:${ng}`)}function FA(){return zG(`JSON5: invalid end of input at ${bx}:${ng}`)}function yit(){return ng-=5,zG(`JSON5: invalid identifier character at ${bx}:${ng}`)}function ARr(t){console.warn(`JSON5: '${bit(t)}' in strings is not valid ECMAScript; consider escaping`)}function bit(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 zG(t){const e=new SyntaxError(t);return e.lineNumber=bx,e.columnNumber=ng,e}var SRr=function(e,r,n){const i=[];let a="",o,s,l="",u;if(r!=null&&typeof r=="object"&&!Array.isArray(r)&&(n=r.space,u=r.quote,r=r.replacer),typeof r=="function")s=r;else if(Array.isArray(r)){o=[];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&&o.indexOf(v)<0&&o.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))),s&&(y=s.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=o||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(!hs.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"&&TRr.test(t.trim()))throw new Error("ECharts option contains an external resource");if(Array.isArray(t)){for(const r of t)UG(r,e+1);return}if(RN(t))for(const[r,n]of Object.entries(t)){if(SRr.has(r))throw new Error("ECharts option contains an unsafe key");UG(n,e+1)}}function CRr(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 ORr(t,e){let r=1,n="",i=!1,a=!1,o=!1;for(let s=e+1;sn+2)throw new Error("Invalid ECharts gradient argument count");const i=r.slice(0,n).map(kRr),a=r[n],o=r[n+1]??!1;if(!Array.isArray(a)||typeof o!="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:o}:{type:t,x:i[0],y:i[1],r:i[2],colorStops:a,global:o}}function _Rr(t,e){const r=/^(?:new\s+)?echarts\.graphic\.(LinearGradient|RadialGradient)\s*\(/;let n="",i=!1,a=!1,o=!1;for(let s=e;sARr)throw new Error("ECharts option is too large");const r=RRr(CRr(t));let n;try{n=yit.parse(r)}catch(o){throw/\bfunction\s*\(|=>/.test(r)?new Error("ECharts function callbacks are not supported"):o}if(!RN(n))throw new Error("ECharts option must be a data object");UG(n);const i={...n};i.aria={...RN(i.aria)?i.aria:{},enabled:!0};const a=i.tooltip;return RN(a)?i.tooltip={...a,renderMode:"richText"}:Array.isArray(a)&&(i.tooltip=a.map(o=>RN(o)?{...o,renderMode:"richText"}:o)),e&&(i.animation=!1),i}let Che;function LRr(){return Che??(Che=Promise.resolve().then(()=>ztn).catch(t=>{throw Che=void 0,t})),Che}function MRr({source:t}){const{t:e}=ca("conversation"),r=j.useRef(null),[n,i]=j.useState(!1),[a,o]=j.useState("");return j.useEffect(()=>{let s=!1,l,u,h;i(!1);try{h=DRr(t,window.matchMedia("(prefers-reduced-motion: reduce)").matches),o("")}catch{o("invalid");return}return LRr().then(d=>{const f=r.current;s||!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,s||o("render")}),()=>{s=!0,u==null||u.disconnect(),l==null||l.dispose()}},[t]),H.jsxs("div",{className:`echarts-diagram${a?" echarts-diagram--error":""}`,role:"img","aria-label":e("visualization.echartsAria"),"aria-busy":!n&&!a,children:[H.jsx("div",{ref:r,className:"echarts-diagram__canvas",hidden:!!a}),!n&&!a?H.jsx("div",{className:"echarts-diagram__state","aria-live":"polite",children:H.jsx(ym,{duration:2.2,spread:15,children:e("visualization.rendering")})}):null,a?H.jsx("p",{className:"echarts-diagram__error",role:"alert",children:e(a==="invalid"?"visualization.invalidEcharts":"visualization.renderFailed")}):null]})}const IRr=j.memo(MRr);let bit,xit=Promise.resolve(),PRr=0;function NRr(){return bit??(bit=Promise.resolve().then(()=>K0n).then(({default:t})=>(t.initialize({startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,theme:"neutral"}),t))),bit}function BRr(t){const e=xit.then(async()=>{const r=await NRr(),n=`mermaid-diagram-${PRr+=1}`;return r.render(n,t)});return xit=e.then(()=>{},()=>{}),e}function $Rr({source:t}){const{t:e}=ca("conversation"),r=j.useRef(null),[n,i]=j.useState(null),[a,o]=j.useState(!1);return j.useEffect(()=>{let s=!1;return i(null),o(!1),BRr(t).then(l=>{s||i(l)}).catch(()=>{s||o(!0)}),()=>{s=!0}},[t]),j.useEffect(()=>{!(n!=null&&n.bindFunctions)||!r.current||n.bindFunctions(r.current)},[n]),a?H.jsx("div",{className:"mermaid-diagram mermaid-diagram--error",children:H.jsx("p",{className:"mermaid-diagram__error",role:"alert",children:e("visualization.mermaidFailed")})}):n?H.jsx("div",{ref:r,className:"mermaid-diagram",role:"img","aria-label":e("visualization.mermaidAria"),dangerouslySetInnerHTML:{__html:n.svg}}):H.jsx("div",{className:"mermaid-diagram mermaid-diagram--loading","aria-live":"polite",children:H.jsx(ym,{duration:2.2,spread:15,children:e("visualization.rendering")})})}const FRr=j.memo($Rr);function wit(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;ezRr(t,"name",{value:e,configurable:!0});function khe(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Ohe(khe,"setRef");function Ait(...t){return e=>{let r=!1;const n=t.map(i=>{const a=khe(i,e);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let i=0;iURr(t,"name",{value:e,configurable:!0});function zA(t){const e=j.forwardRef((r,n)=>{let{children:i,...a}=r,o=null,s=!1;const l=[];Ehe(i)&&typeof VG=="function"&&(i=VG(i._payload)),j.Children.forEach(i,f=>{var p;if(Oit(f)){s=!0;const g=f;let m="child"in g.props?g.props.child:g.props.children;Ehe(m)&&typeof VG=="function"&&(m=VG(m._payload)),o=QRr(g,m),l.push((p=o==null?void 0:o.props)==null?void 0:p.children)}else l.push(f)}),o?o=j.cloneElement(o,void 0,l):!s&&j.Children.count(i)===1&&j.isValidElement(i)&&(o=i);const u=o?Cit(o):void 0,h=Nh(n,u);if(!o){if(i||i===0)throw new Error(s?WRr(t):HRr(t));return i}const d=Tit(a,o.props??{});return o.type!==j.Fragment&&(d.ref=n?h:u),j.cloneElement(o,d)});return e.displayName=`${t}.Slot`,e}ig(zA,"createSlot");var Sit=Symbol.for("radix.slottable");function VRr(t){const e=ig(r=>"child"in r?r.children(r.child):r.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=Sit,e}ig(VRr,"createSlottable");var QRr=ig((t,e)=>{if("child"in t.props){const r=t.props.child;return j.isValidElement(r)?j.cloneElement(r,void 0,t.props.children(r.props.children)):null}return j.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function Tit(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]=(...s)=>{const l=a(...s);return i(...s),l}:i&&(r[n]=i):n==="style"?r[n]={...i,...a}:n==="className"&&(r[n]=[i,a].filter(Boolean).join(" "))}return{...t,...r}}ig(Tit,"mergeProps");function Cit(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)}ig(Cit,"getElementRef");function Oit(t){return j.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Sit}ig(Oit,"isSlottable");var GRr=Symbol.for("react.lazy");function Ehe(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===GRr&&"_payload"in t&&kit(t._payload)}ig(Ehe,"isLazyComponent");function kit(t){return typeof t=="object"&&t!==null&&"then"in t}ig(kit,"isPromiseLike");var HRr=ig(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),WRr=ig(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),VG=qw[" use ".trim().toString()],YRr=Object.defineProperty,qRr=(t,e)=>YRr(t,"name",{value:e,configurable:!0}),jRr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ag=jRr.reduce((t,e)=>{const r=zA(`Primitive.${e}`),n=j.forwardRef((i,a)=>{const{asChild:o,...s}=i,l=o?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),H.jsx(l,{...s,ref:a})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Eit(t,e){t&&kf.flushSync(()=>t.dispatchEvent(e))}qRr(Eit,"dispatchDiscreteCustomEvent");var XRr=Object.defineProperty,Hf=(t,e)=>XRr(t,"name",{value:e,configurable:!0});function KRr(t,e){const r=j.createContext(e);r.displayName=t+"Context";const n=Hf(a=>{const{children:o,...s}=a,l=j.useMemo(()=>s,Object.values(s));return H.jsx(r.Provider,{value:l,children:o})},"Provider");n.displayName=t+"Provider";function i(a,o={}){const{optional:s=!1}=o,l=j.useContext(r);if(l)return l;if(e!==void 0)return e;if(!s)throw new Error(`\`${a}\` must be used within \`${t}\``)}return Hf(i,"useContext"),[n,i]}Hf(KRr,"createContext");function UA(t,e=[]){let r=[];function n(a,o){const s=j.createContext(o);s.displayName=a+"Context";const l=r.length;r=[...r,o];const u=Hf(d=>{var y;const{scope:f,children:p,...g}=d,m=((y=f==null?void 0:f[t])==null?void 0:y[l])||s,v=j.useMemo(()=>g,Object.values(g));return H.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])||s,v=j.useContext(m);if(v)return v;if(o!==void 0)return o;if(!g)throw new Error(`\`${d}\` must be used within \`${a}\``)}return Hf(h,"useContext"),[u,h]}Hf(n,"createContext");const i=Hf(()=>{const a=r.map(o=>j.createContext(o));return Hf(function(s){const l=(s==null?void 0:s[t])||a;return j.useMemo(()=>({[`__scope${t}`]:{...s,[t]:l}}),[s,l])},"useScope")},"createScope");return i.scopeName=t,[n,_it(i,...e)]}Hf(UA,"createContextScope");function _it(...t){const e=t[0];if(t.length===1)return e;const r=Hf(()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return Hf(function(a){const o=n.reduce((s,{useScope:l,scopeName:u})=>{const d=l(a)[`__scope${u}`];return{...s,...d}},{});return j.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return r.scopeName=e.scopeName,r}Hf(_it,"composeContextScopes");var ZRr=Object.defineProperty,kl=(t,e)=>ZRr(t,"name",{value:e,configurable:!0});function Rit(t){const e=t+"CollectionProvider",[r,n]=UA(e),[i,a]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=kl(m=>{const{scope:v,children:y}=m,b=j.useRef(null),x=j.useRef(new Map).current;return H.jsx(i,{scope:v,itemMap:x,collectionRef:b,children:y})},"CollectionProvider");o.displayName=e;const s=t+"CollectionSlot",l=zA(s),u=j.forwardRef((m,v)=>{const{scope:y,children:b}=m,x=a(s,y),w=Nh(v,x.collectionRef);return H.jsx(l,{ref:w,children:b})});u.displayName=s;const h=t+"CollectionItemSlot",d="data-radix-collection-item",f=zA(h),p=j.forwardRef((m,v)=>{const{scope:y,children:b,...x}=m,w=j.useRef(null),A=Nh(v,w),S=a(h,y);return j.useEffect(()=>(S.itemMap.set(w,{ref:w,...x}),()=>void S.itemMap.delete(w))),H.jsx(f,{[d]:"",ref:A,children:b})});p.displayName=h;function g(m){const v=a(t+"CollectionConsumer",m);return j.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 kl(g,"useCollection"),[{Provider:o,Slot:u,ItemSlot:p},g,n]}kl(Rit,"createCollection");var Dit=new WeakMap,_he=(Cf=class extends Map{constructor(r){super(r);jor(this,Ks);WMe(this,Ks,[...super.keys()]),Dit.set(this,!0)}set(r,n){return Dit.get(this)&&(this.has(r)?yu(this,Ks)[yu(this,Ks).indexOf(r)]=r:yu(this,Ks).push(r)),super.set(r,n),this}insert(r,n,i){const a=this.has(n),o=yu(this,Ks).length,s=Rhe(r);let l=s>=0?s:o+s;const u=l<0||l>=o?-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);s<0&&l++;const d=[...yu(this,Ks)];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 o of this)Reflect.apply(r,n,[o,a,this])&&i.push(o),a++;return new Cf(i)}map(r,n){const i=[];let a=0;for(const o of this)i.push([o[0],Reflect.apply(r,n,[o,a,this])]),a++;return new Cf(i)}reduce(...r){const[n,i]=r;let a=0,o=i??this.at(0);for(const s of this)a===0&&r.length===1?o=s:o=Reflect.apply(n,this,[o,s,a,this]),a++;return o}reduceRight(...r){const[n,i]=r;let a=i??this.at(-1);for(let o=this.size-1;o>=0;o--){const s=this.at(o);o===this.size-1&&r.length===1?a=s:a=Reflect.apply(n,this,[a,s,o,this])}return a}toSorted(r){const n=[...this.entries()].sort(r);return new Cf(n)}toReversed(){const r=new Cf;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 Cf(n)}slice(r,n){const i=new Cf;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 o=r;o<=a;o++){const s=this.keyAt(o),l=this.get(s);i.set(s,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}},Ks=new WeakMap,kl(Cf,"OrderedDict"),Cf);function QG(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const r=Lit(t,e);return r===-1?void 0:t[r]}kl(QG,"at");function Lit(t,e){const r=t.length,n=Rhe(e),i=n>=0?n:r+n;return i<0||i>=r?-1:i}kl(Lit,"toSafeIndex");function Rhe(t){return t!==t||t===0?0:Math.trunc(t)}kl(Rhe,"toSafeInteger");function JRr(t){const e=t+"CollectionProvider",[r,n]=UA(e),[i,a]=r(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new _he,setItemMap:kl(()=>{},"setItemMap")}),o=kl(({state:x,...w})=>x?H.jsx(l,{...w,state:x}):H.jsx(s,{...w}),"CollectionProvider");o.displayName=e;const s=kl(x=>{const w=v();return H.jsx(l,{...x,state:w})},"CollectionInit");s.displayName=e+"Init";const l=kl(x=>{const{scope:w,children:A,state:S}=x,T=j.useRef(null),[C,k]=j.useState(null),E=Nh(T,k),[_,P]=S;return j.useEffect(()=>{if(!C)return;const L=Pit(()=>{});return L.observe(C,{childList:!0,subtree:!0}),()=>{L.disconnect()}},[C]),H.jsx(i,{scope:w,itemMap:_,setItemMap:P,collectionRef:E,collectionRefObject:T,collectionElement:C,children:A})},"CollectionProviderImpl");l.displayName=e+"Impl";const u=t+"CollectionSlot",h=zA(u),d=j.forwardRef((x,w)=>{const{scope:A,children:S}=x,T=a(u,A),C=Nh(w,T.collectionRef);return H.jsx(h,{ref:C,children:S})});d.displayName=u;const f=t+"CollectionItemSlot",p="data-radix-collection-item",g=zA(f),m=j.forwardRef((x,w)=>{const{scope:A,children:S,...T}=x,C=j.useRef(null),[k,E]=j.useState(null),_=Nh(w,C,E),P=a(f,A),{setItemMap:L}=P,R=j.useRef(T);Mit(R.current,T)||(R.current=T);const D=R.current;return j.useEffect(()=>{const M=D;return L(I=>k?I.has(k)?I.set(k,{...M,element:k}).toSorted(Dhe):(I.set(k,{...M,element:k}),I.toSorted(Dhe)):I),()=>{L(I=>!k||!I.has(k)?I:(I.delete(k),new _he(I)))}},[k,D,L]),H.jsx(g,{[p]:"",ref:_,children:S})});m.displayName=f;function v(){return j.useState(new _he)}kl(v,"useInitCollection");function y(x){const{itemMap:w}=a(t+"CollectionConsumer",x);return w}return kl(y,"useCollection"),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:n,useCollection:y,useInitCollection:v}]}kl(JRr,"createCollection");function Mit(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}kl(Mit,"shallowEqual");function Iit(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}kl(Iit,"isElementPreceding");function Dhe(t,e){return!t[1].element||!e[1].element?0:Iit(t[1].element,e[1].element)?-1:1}kl(Dhe,"sortByDocumentPosition");function Pit(t){return new MutationObserver(r=>{for(const n of r)if(n.type==="childList"){t();return}})}kl(Pit,"getChildListObserver");var e4r=Object.defineProperty,n_=(t,e)=>e4r(t,"name",{value:e,configurable:!0}),Nit=!!(typeof window<"u"&&window.document&&window.document.createElement);function Eu(t,e,{checkForDefaultPrevented:r=!0}={}){return n_(function(i){if(t==null||t(i),r===!1||!i||!i.defaultPrevented)return e==null?void 0:e(i)},"handleEvent")}n_(Eu,"composeEventHandlers");function t4r(t){var e;if(!Nit)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}n_(t4r,"getOwnerWindow");function Lhe(t){if(!Nit)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}n_(Lhe,"getOwnerDocument");function Bit(t,e=!1){const{activeElement:r}=Lhe(t);if(!(r!=null&&r.nodeName))return null;if($it(r)&&r.contentDocument)return Bit(r.contentDocument.body,e);if(e){const n=r.getAttribute("aria-activedescendant");if(n){const i=Lhe(r).getElementById(n);if(i)return i}}return r}n_(Bit,"getActiveElement");function $it(t){return t.tagName==="IFRAME"}n_($it,"isFrame");var og=globalThis!=null&&globalThis.document?j.useLayoutEffect:()=>{},r4r=Object.defineProperty,n4r=(t,e)=>r4r(t,"name",{value:e,configurable:!0}),Fit=qw[" useEffectEvent ".trim().toString()],zit=qw[" useInsertionEffect ".trim().toString()];function Uit(t){if(typeof Fit=="function")return Fit(t);const e=j.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof zit=="function"?zit(()=>{e.current=t}):og(()=>{e.current=t}),j.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}n4r(Uit,"useEffectEvent");var i4r=Object.defineProperty,DN=(t,e)=>i4r(t,"name",{value:e,configurable:!0}),a4r=qw[" useInsertionEffect ".trim().toString()]||og;function i_({prop:t,defaultProp:e,onChange:r=DN(()=>{},"onChange"),caller:n}){const[i,a,o]=Vit({defaultProp:e,onChange:r}),s=t!==void 0,l=s?t:i,u=j.useCallback(h=>{var d;if(s){const f=Qit(h)?h(t):h;f!==t&&((d=o.current)==null||d.call(o,f))}else a(h)},[s,t,a,o]);return[l,u]}DN(i_,"useControllableState");function Vit({defaultProp:t,onChange:e}){const[r,n]=j.useState(t),i=j.useRef(r),a=j.useRef(e);return a4r(()=>{a.current=e},[e]),j.useEffect(()=>{var o;i.current!==r&&((o=a.current)==null||o.call(a,r),i.current=r)},[r,i]),[r,n,a]}DN(Vit,"useUncontrolledState");function Qit(t){return typeof t=="function"}DN(Qit,"isFunction");var Git=Symbol("RADIX:SYNC_STATE");function o4r(t,e,r,n){const{prop:i,defaultProp:a,onChange:o,caller:s}=e,l=i!==void 0,u=Uit(o),h=[{...r,state:a}];n&&h.push(n);const[d,f]=j.useReducer((v,y)=>{if(y.type===Git)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=j.useRef(p);j.useEffect(()=>{g.current!==p&&(g.current=p,l||u(p))},[p,g,l]);const m=j.useMemo(()=>i!==void 0?{...d,state:i}:d,[d,i]);return j.useEffect(()=>{l&&!Object.is(i,d.state)&&f({type:Git,state:i})},[i,d.state,l]),[m,f]}DN(o4r,"useControllableStateReducer");var s4r=Object.defineProperty,hy=(t,e)=>s4r(t,"name",{value:e,configurable:!0});function Hit(t,e){return j.useReducer((r,n)=>e[r][n]??r,t)}hy(Hit,"useStateMachine");var Wit=hy(t=>{const{present:e,children:r}=t,n=Yit(e),i=typeof r=="function"?r({present:n.isPresent}):j.Children.only(r),a=qit(n.ref,jit(i));return typeof r=="function"||n.isPresent?j.cloneElement(i,{ref:a}):null},"Presence");function Yit(t){const[e,r]=j.useState(),n=j.useRef(null),i=j.useRef(t),a=j.useRef("none"),o=j.useRef(void 0),s=t?"mounted":"unmounted",[l,u]=Hit(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return j.useEffect(()=>{l==="mounted"?(a.current=o.current??a_(n.current),o.current=void 0):a.current="none"},[l]),og(()=>{const h=n.current,d=i.current;if(d!==t){const p=a.current,g=a_(h);t?(o.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]),og(()=>{if(e){let h;const d=e.ownerDocument.defaultView??window,f=hy(g=>{const v=a_(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=hy(g=>{g.target===e&&(a.current=a_(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:j.useCallback(h=>{if(h){const d=getComputedStyle(h);n.current=d,o.current=a_(d)}else n.current=null;r(h)},[])}}hy(Yit,"usePresence");function Mhe(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}hy(Mhe,"setRef");function qit(...t){const e=j.useRef(t);return e.current=t,j.useCallback(r=>{const n=e.current;let i=!1;const a=n.map(o=>{const s=Mhe(o,r);return!i&&typeof s=="function"&&(i=!0),s});if(i)return()=>{for(let o=0;ol4r(t,"name",{value:e,configurable:!0}),u4r=qw[" useId ".trim().toString()]||(()=>{}),h4r=0;function Ihe(t){const[e,r]=j.useState(u4r());return og(()=>{t||r(n=>n??String(h4r++))},[t]),t||(e?`radix-${e}`:"")}c4r(Ihe,"useId");var d4r=Object.defineProperty,f4r=(t,e)=>d4r(t,"name",{value:e,configurable:!0}),p4r=j.createContext(void 0);function Phe(t){const e=j.useContext(p4r);return t||e||"ltr"}f4r(Phe,"useDirection");var g4r=Object.defineProperty,m4r=(t,e)=>g4r(t,"name",{value:e,configurable:!0});function xx(t){const e=j.useRef(t);return j.useEffect(()=>{e.current=t}),j.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}m4r(xx,"useCallbackRef");var v4r=Object.defineProperty,El=(t,e)=>v4r(t,"name",{value:e,configurable:!0}),Nhe="dismissableLayer.update",y4r="dismissableLayer.pointerDownOutside",b4r="dismissableLayer.focusOutside",Xit,Kit=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),x4r=j.forwardRef(El(function(e,r){const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:l,onDismiss:u,...h}=e,d=j.useContext(Kit),[f,p]=j.useState(null),g=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=j.useState({}),v=Nh(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=j.useRef(!1),C=Zit(P=>{o==null||o(P),l==null||l(P),P.defaultPrevented||u==null||u()},{ownerDocument:g,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:j.useCallback(P=>{if(!(P instanceof Node))return!1;const L=[...d.branches].some(R=>R.contains(P));return S&&!L},[d.branches,S])}),k=Jit(P=>{if(i&&T.current)return;const L=P.target;[...d.branches].some(D=>D.contains(L))||(s==null||s(P),l==null||l(P),P.defaultPrevented||u==null||u())},g),E=f?w===y.length-1:!1,_=xx(P=>{P.key==="Escape"&&(a==null||a(P),!P.defaultPrevented&&u&&(P.preventDefault(),u()))});return j.useEffect(()=>{if(E)return g.addEventListener("keydown",_,{capture:!0}),()=>g.removeEventListener("keydown",_,{capture:!0})},[g,E,_]),j.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Xit=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Bhe(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=Xit))}},[f,g,n,d]),j.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Bhe())},[f,d]),j.useEffect(()=>{const P=El(()=>m({}),"handleUpdate");return document.addEventListener(Nhe,P),()=>document.removeEventListener(Nhe,P)},[]),H.jsx(ag.div,{...h,ref:v,style:{pointerEvents:A?S?"auto":"none":void 0,...e.style},onFocusCapture:Eu(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Eu(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Eu(e.onPointerDownCapture,C.onPointerDownCapture)})},"DismissableLayer"));function w4r(){const t=j.useContext(Kit),[e,r]=j.useState(null);return j.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),r}El(w4r,"useDismissableLayerSurface");var A4r=El(()=>!0,"IS_TRUE");function Zit(t,e){const{ownerDocument:r=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:n=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=A4r}=e,s=xx(t),l=j.useRef(!1),u=j.useRef(!1),h=j.useRef(new Map),d=j.useRef(()=>{});return j.useEffect(()=>{function f(){u.current=!1,i.current=!1,h.current.clear()}El(f,"resetOutsideInteraction");function p(){return Array.from(h.current.values()).some(Boolean)}El(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)}El(g,"handleInteractionCapture");function m(x){u.current&&h.current.set(x.type,!1)}El(m,"handleInteractionBubble");const v=El(x=>{if(x.target&&!l.current){let w=function(){r.removeEventListener("click",d.current);const S=p();f(),S||$he(y4r,s,A,{discrete:!0})};if(El(w,"handleAndDispatchPointerDownOutsideEvent"),!o(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,s,n,i,a,o]),{onPointerDownCapture:El(()=>l.current=!0,"onPointerDownCapture")}}El(Zit,"usePointerDownOutside");function Jit(t,e=globalThis==null?void 0:globalThis.document){const r=xx(t),n=j.useRef(!1);return j.useEffect(()=>{const i=El(a=>{a.target&&!n.current&&$he(b4r,r,{originalEvent:a},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:El(()=>n.current=!0,"onFocusCapture"),onBlurCapture:El(()=>n.current=!1,"onBlurCapture")}}El(Jit,"useFocusOutside");function Bhe(){const t=new CustomEvent(Nhe);document.dispatchEvent(t)}El(Bhe,"dispatchUpdate");function $he(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?Eit(i,a):i.dispatchEvent(a)}El($he,"handleAndDispatchCustomEvent");var S4r=Object.defineProperty,_u=(t,e)=>S4r(t,"name",{value:e,configurable:!0}),Fhe="focusScope.autoFocusOnMount",zhe="focusScope.autoFocusOnUnmount",eat={bubbles:!1,cancelable:!0},T4r=j.forwardRef(_u(function(e,r){const{loop:n=!1,trapped:i=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[l,u]=j.useState(null),h=xx(a),d=xx(o),f=j.useRef(null),p=Nh(r,u),g=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(i){let v=function(w){if(g.paused||!l)return;const A=w.target;l.contains(A)?f.current=A:dy(f.current,{select:!0})},y=function(w){if(g.paused||!l)return;const A=w.relatedTarget;A!==null&&(l.contains(A)||dy(f.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&dy(l)};_u(v,"handleFocusIn"),_u(y,"handleFocusOut"),_u(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]),j.useEffect(()=>{if(l){aat.add(g);const v=document.activeElement;if(!l.contains(v)){const b=new CustomEvent(Fhe,eat);l.addEventListener(Fhe,h),l.dispatchEvent(b),b.defaultPrevented||(tat(sat(Uhe(l)),{select:!0}),document.activeElement===v&&dy(l))}return()=>{l.removeEventListener(Fhe,h),setTimeout(()=>{const b=new CustomEvent(zhe,eat);l.addEventListener(zhe,d),l.dispatchEvent(b),b.defaultPrevented||dy(v??document.body,{select:!0}),l.removeEventListener(zhe,d),aat.remove(g)},0)}}},[l,h,d,g]);const m=j.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]=rat(x);w&&A?!v.shiftKey&&b===A?(v.preventDefault(),n&&dy(w,{select:!0})):v.shiftKey&&b===w&&(v.preventDefault(),n&&dy(A,{select:!0})):b===x&&v.preventDefault()}},[n,i,g.paused]);return H.jsx(ag.div,{tabIndex:-1,...s,ref:p,onKeyDown:m})},"FocusScope"));function tat(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(dy(n,{select:e}),document.activeElement!==r)return}_u(tat,"focusFirst");function rat(t){const e=Uhe(t),r=Vhe(e,t),n=Vhe(e.reverse(),t);return[r,n]}_u(rat,"getTabbableEdges");function Uhe(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:_u(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}_u(Uhe,"getTabbableCandidates");function Vhe(t,e){const r=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const n of t)if(!(r?!n.checkVisibility({checkVisibilityCSS:!0}):nat(n,{upTo:e})))return n}_u(Vhe,"findVisible");function nat(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}_u(nat,"isHidden");function iat(t){return t instanceof HTMLInputElement&&"select"in t}_u(iat,"isSelectableInput");function dy(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&iat(t)&&e&&t.select()}}_u(dy,"focus");var aat=oat();function oat(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=Qhe(t,e),t.unshift(e)},remove(e){var r;t=Qhe(t,e),(r=t[0])==null||r.resume()}}}_u(oat,"createFocusScopesStack");function Qhe(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}_u(Qhe,"arrayRemove");function sat(t){return t.filter(e=>e.tagName!=="A")}_u(sat,"removeLinks");var C4r=Object.defineProperty,O4r=(t,e)=>C4r(t,"name",{value:e,configurable:!0}),k4r=j.forwardRef(O4r(function(e,r){var l;const{container:n,...i}=e,[a,o]=j.useState(!1);og(()=>o(!0),[]);const s=n||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return s?kf.createPortal(H.jsx(ag.div,{...i,ref:r}),s):null},"Portal")),E4r=Object.defineProperty,Ghe=(t,e)=>E4r(t,"name",{value:e,configurable:!0}),GG=0,Tm=null;function _4r(t){return Hhe(),t.children}Ghe(_4r,"FocusGuards");function Hhe(){j.useEffect(()=>{Tm||(Tm={start:Whe(),end:Whe()});const{start:t,end:e}=Tm;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),GG++,()=>{GG===1&&(Tm==null||Tm.start.remove(),Tm==null||Tm.end.remove(),Tm=null),GG=Math.max(0,GG-1)}},[])}Ghe(Hhe,"useFocusGuards");function Whe(){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}Ghe(Whe,"createFocusGuard");var Cm=function(){return Cm=Object.assign||function(e){for(var r,n=1,i=arguments.length;n"u")return W4r;var e=Y4r(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])}},j4r=dat(),o_="data-scroll-locked",X4r=function(t,e,r,n){var i=t.left,a=t.top,o=t.right,s=t.gap;return r===void 0&&(r="margin"),` - .`.concat(D4r,` { +`+v+"]"}return i.pop(),a=v,b}},xit={parse:vRr,stringify:SRr};const TRr=2e5,CRr=new Set(["__proto__","constructor","prototype"]),ORr=/^(?:https?:|data:|blob:|file:|javascript:|image:\/\/)/i;function RN(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function UG(t,e=0){if(e>30)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"&&ORr.test(t.trim()))throw new Error("ECharts option contains an external resource");if(Array.isArray(t)){for(const r of t)UG(r,e+1);return}if(RN(t))for(const[r,n]of Object.entries(t)){if(CRr.has(r))throw new Error("ECharts option contains an unsafe key");UG(n,e+1)}}function kRr(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 ERr(t,e){let r=1,n="",i=!1,a=!1,o=!1;for(let s=e+1;sn+2)throw new Error("Invalid ECharts gradient argument count");const i=r.slice(0,n).map(_Rr),a=r[n],o=r[n+1]??!1;if(!Array.isArray(a)||typeof o!="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:o}:{type:t,x:i[0],y:i[1],r:i[2],colorStops:a,global:o}}function DRr(t,e){const r=/^(?:new\s+)?echarts\.graphic\.(LinearGradient|RadialGradient)\s*\(/;let n="",i=!1,a=!1,o=!1;for(let s=e;sTRr)throw new Error("ECharts option is too large");const r=LRr(kRr(t));let n;try{n=xit.parse(r)}catch(o){throw/\bfunction\s*\(|=>/.test(r)?new Error("ECharts function callbacks are not supported"):o}if(!RN(n))throw new Error("ECharts option must be a data object");UG(n);const i={...n};i.aria={...RN(i.aria)?i.aria:{},enabled:!0};const a=i.tooltip;return RN(a)?i.tooltip={...a,renderMode:"richText"}:Array.isArray(a)&&(i.tooltip=a.map(o=>RN(o)?{...o,renderMode:"richText"}:o)),e&&(i.animation=!1),i}let Che;function IRr(){return Che??(Che=Promise.resolve().then(()=>Vtn).catch(t=>{throw Che=void 0,t})),Che}function PRr({source:t}){const{t:e}=ca("conversation"),r=j.useRef(null),[n,i]=j.useState(!1),[a,o]=j.useState("");return j.useEffect(()=>{let s=!1,l,u,h;i(!1);try{h=MRr(t,window.matchMedia("(prefers-reduced-motion: reduce)").matches),o("")}catch{o("invalid");return}return IRr().then(d=>{const f=r.current;s||!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,s||o("render")}),()=>{s=!0,u==null||u.disconnect(),l==null||l.dispose()}},[t]),H.jsxs("div",{className:`echarts-diagram${a?" echarts-diagram--error":""}`,role:"img","aria-label":e("visualization.echartsAria"),"aria-busy":!n&&!a,children:[H.jsx("div",{ref:r,className:"echarts-diagram__canvas",hidden:!!a}),!n&&!a?H.jsx("div",{className:"echarts-diagram__state","aria-live":"polite",children:H.jsx(ym,{duration:2.2,spread:15,children:e("visualization.rendering")})}):null,a?H.jsx("p",{className:"echarts-diagram__error",role:"alert",children:e(a==="invalid"?"visualization.invalidEcharts":"visualization.renderFailed")}):null]})}const NRr=j.memo(PRr);let wit,Ait=Promise.resolve(),BRr=0;function $Rr(){return wit??(wit=Promise.resolve().then(()=>J0n).then(({default:t})=>(t.initialize({startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,theme:"neutral"}),t))),wit}function FRr(t){const e=Ait.then(async()=>{const r=await $Rr(),n=`mermaid-diagram-${BRr+=1}`;return r.render(n,t)});return Ait=e.then(()=>{},()=>{}),e}function zRr({source:t}){const{t:e}=ca("conversation"),r=j.useRef(null),[n,i]=j.useState(null),[a,o]=j.useState(!1);return j.useEffect(()=>{let s=!1;return i(null),o(!1),FRr(t).then(l=>{s||i(l)}).catch(()=>{s||o(!0)}),()=>{s=!0}},[t]),j.useEffect(()=>{!(n!=null&&n.bindFunctions)||!r.current||n.bindFunctions(r.current)},[n]),a?H.jsx("div",{className:"mermaid-diagram mermaid-diagram--error",children:H.jsx("p",{className:"mermaid-diagram__error",role:"alert",children:e("visualization.mermaidFailed")})}):n?H.jsx("div",{ref:r,className:"mermaid-diagram",role:"img","aria-label":e("visualization.mermaidAria"),dangerouslySetInnerHTML:{__html:n.svg}}):H.jsx("div",{className:"mermaid-diagram mermaid-diagram--loading","aria-live":"polite",children:H.jsx(ym,{duration:2.2,spread:15,children:e("visualization.rendering")})})}const URr=j.memo(zRr);function Sit(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;eVRr(t,"name",{value:e,configurable:!0});function khe(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Ohe(khe,"setRef");function Tit(...t){return e=>{let r=!1;const n=t.map(i=>{const a=khe(i,e);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let i=0;iQRr(t,"name",{value:e,configurable:!0});function zA(t){const e=j.forwardRef((r,n)=>{let{children:i,...a}=r,o=null,s=!1;const l=[];Ehe(i)&&typeof VG=="function"&&(i=VG(i._payload)),j.Children.forEach(i,f=>{var p;if(Eit(f)){s=!0;const g=f;let m="child"in g.props?g.props.child:g.props.children;Ehe(m)&&typeof VG=="function"&&(m=VG(m._payload)),o=HRr(g,m),l.push((p=o==null?void 0:o.props)==null?void 0:p.children)}else l.push(f)}),o?o=j.cloneElement(o,void 0,l):!s&&j.Children.count(i)===1&&j.isValidElement(i)&&(o=i);const u=o?kit(o):void 0,h=Nh(n,u);if(!o){if(i||i===0)throw new Error(s?qRr(t):YRr(t));return i}const d=Oit(a,o.props??{});return o.type!==j.Fragment&&(d.ref=n?h:u),j.cloneElement(o,d)});return e.displayName=`${t}.Slot`,e}ig(zA,"createSlot");var Cit=Symbol.for("radix.slottable");function GRr(t){const e=ig(r=>"child"in r?r.children(r.child):r.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=Cit,e}ig(GRr,"createSlottable");var HRr=ig((t,e)=>{if("child"in t.props){const r=t.props.child;return j.isValidElement(r)?j.cloneElement(r,void 0,t.props.children(r.props.children)):null}return j.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function Oit(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]=(...s)=>{const l=a(...s);return i(...s),l}:i&&(r[n]=i):n==="style"?r[n]={...i,...a}:n==="className"&&(r[n]=[i,a].filter(Boolean).join(" "))}return{...t,...r}}ig(Oit,"mergeProps");function kit(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)}ig(kit,"getElementRef");function Eit(t){return j.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Cit}ig(Eit,"isSlottable");var WRr=Symbol.for("react.lazy");function Ehe(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===WRr&&"_payload"in t&&_it(t._payload)}ig(Ehe,"isLazyComponent");function _it(t){return typeof t=="object"&&t!==null&&"then"in t}ig(_it,"isPromiseLike");var YRr=ig(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),qRr=ig(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),VG=qw[" use ".trim().toString()],jRr=Object.defineProperty,XRr=(t,e)=>jRr(t,"name",{value:e,configurable:!0}),KRr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ag=KRr.reduce((t,e)=>{const r=zA(`Primitive.${e}`),n=j.forwardRef((i,a)=>{const{asChild:o,...s}=i,l=o?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),H.jsx(l,{...s,ref:a})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Rit(t,e){t&&kf.flushSync(()=>t.dispatchEvent(e))}XRr(Rit,"dispatchDiscreteCustomEvent");var ZRr=Object.defineProperty,Hf=(t,e)=>ZRr(t,"name",{value:e,configurable:!0});function JRr(t,e){const r=j.createContext(e);r.displayName=t+"Context";const n=Hf(a=>{const{children:o,...s}=a,l=j.useMemo(()=>s,Object.values(s));return H.jsx(r.Provider,{value:l,children:o})},"Provider");n.displayName=t+"Provider";function i(a,o={}){const{optional:s=!1}=o,l=j.useContext(r);if(l)return l;if(e!==void 0)return e;if(!s)throw new Error(`\`${a}\` must be used within \`${t}\``)}return Hf(i,"useContext"),[n,i]}Hf(JRr,"createContext");function UA(t,e=[]){let r=[];function n(a,o){const s=j.createContext(o);s.displayName=a+"Context";const l=r.length;r=[...r,o];const u=Hf(d=>{var y;const{scope:f,children:p,...g}=d,m=((y=f==null?void 0:f[t])==null?void 0:y[l])||s,v=j.useMemo(()=>g,Object.values(g));return H.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])||s,v=j.useContext(m);if(v)return v;if(o!==void 0)return o;if(!g)throw new Error(`\`${d}\` must be used within \`${a}\``)}return Hf(h,"useContext"),[u,h]}Hf(n,"createContext");const i=Hf(()=>{const a=r.map(o=>j.createContext(o));return Hf(function(s){const l=(s==null?void 0:s[t])||a;return j.useMemo(()=>({[`__scope${t}`]:{...s,[t]:l}}),[s,l])},"useScope")},"createScope");return i.scopeName=t,[n,Dit(i,...e)]}Hf(UA,"createContextScope");function Dit(...t){const e=t[0];if(t.length===1)return e;const r=Hf(()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return Hf(function(a){const o=n.reduce((s,{useScope:l,scopeName:u})=>{const d=l(a)[`__scope${u}`];return{...s,...d}},{});return j.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return r.scopeName=e.scopeName,r}Hf(Dit,"composeContextScopes");var e4r=Object.defineProperty,kl=(t,e)=>e4r(t,"name",{value:e,configurable:!0});function Lit(t){const e=t+"CollectionProvider",[r,n]=UA(e),[i,a]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=kl(m=>{const{scope:v,children:y}=m,b=j.useRef(null),x=j.useRef(new Map).current;return H.jsx(i,{scope:v,itemMap:x,collectionRef:b,children:y})},"CollectionProvider");o.displayName=e;const s=t+"CollectionSlot",l=zA(s),u=j.forwardRef((m,v)=>{const{scope:y,children:b}=m,x=a(s,y),w=Nh(v,x.collectionRef);return H.jsx(l,{ref:w,children:b})});u.displayName=s;const h=t+"CollectionItemSlot",d="data-radix-collection-item",f=zA(h),p=j.forwardRef((m,v)=>{const{scope:y,children:b,...x}=m,w=j.useRef(null),A=Nh(v,w),S=a(h,y);return j.useEffect(()=>(S.itemMap.set(w,{ref:w,...x}),()=>void S.itemMap.delete(w))),H.jsx(f,{[d]:"",ref:A,children:b})});p.displayName=h;function g(m){const v=a(t+"CollectionConsumer",m);return j.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 kl(g,"useCollection"),[{Provider:o,Slot:u,ItemSlot:p},g,n]}kl(Lit,"createCollection");var Mit=new WeakMap,_he=(Cf=class extends Map{constructor(r){super(r);Kor(this,Ks);WMe(this,Ks,[...super.keys()]),Mit.set(this,!0)}set(r,n){return Mit.get(this)&&(this.has(r)?yu(this,Ks)[yu(this,Ks).indexOf(r)]=r:yu(this,Ks).push(r)),super.set(r,n),this}insert(r,n,i){const a=this.has(n),o=yu(this,Ks).length,s=Rhe(r);let l=s>=0?s:o+s;const u=l<0||l>=o?-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);s<0&&l++;const d=[...yu(this,Ks)];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 o of this)Reflect.apply(r,n,[o,a,this])&&i.push(o),a++;return new Cf(i)}map(r,n){const i=[];let a=0;for(const o of this)i.push([o[0],Reflect.apply(r,n,[o,a,this])]),a++;return new Cf(i)}reduce(...r){const[n,i]=r;let a=0,o=i??this.at(0);for(const s of this)a===0&&r.length===1?o=s:o=Reflect.apply(n,this,[o,s,a,this]),a++;return o}reduceRight(...r){const[n,i]=r;let a=i??this.at(-1);for(let o=this.size-1;o>=0;o--){const s=this.at(o);o===this.size-1&&r.length===1?a=s:a=Reflect.apply(n,this,[a,s,o,this])}return a}toSorted(r){const n=[...this.entries()].sort(r);return new Cf(n)}toReversed(){const r=new Cf;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 Cf(n)}slice(r,n){const i=new Cf;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 o=r;o<=a;o++){const s=this.keyAt(o),l=this.get(s);i.set(s,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}},Ks=new WeakMap,kl(Cf,"OrderedDict"),Cf);function QG(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const r=Iit(t,e);return r===-1?void 0:t[r]}kl(QG,"at");function Iit(t,e){const r=t.length,n=Rhe(e),i=n>=0?n:r+n;return i<0||i>=r?-1:i}kl(Iit,"toSafeIndex");function Rhe(t){return t!==t||t===0?0:Math.trunc(t)}kl(Rhe,"toSafeInteger");function t4r(t){const e=t+"CollectionProvider",[r,n]=UA(e),[i,a]=r(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new _he,setItemMap:kl(()=>{},"setItemMap")}),o=kl(({state:x,...w})=>x?H.jsx(l,{...w,state:x}):H.jsx(s,{...w}),"CollectionProvider");o.displayName=e;const s=kl(x=>{const w=v();return H.jsx(l,{...x,state:w})},"CollectionInit");s.displayName=e+"Init";const l=kl(x=>{const{scope:w,children:A,state:S}=x,T=j.useRef(null),[C,k]=j.useState(null),E=Nh(T,k),[_,P]=S;return j.useEffect(()=>{if(!C)return;const L=Bit(()=>{});return L.observe(C,{childList:!0,subtree:!0}),()=>{L.disconnect()}},[C]),H.jsx(i,{scope:w,itemMap:_,setItemMap:P,collectionRef:E,collectionRefObject:T,collectionElement:C,children:A})},"CollectionProviderImpl");l.displayName=e+"Impl";const u=t+"CollectionSlot",h=zA(u),d=j.forwardRef((x,w)=>{const{scope:A,children:S}=x,T=a(u,A),C=Nh(w,T.collectionRef);return H.jsx(h,{ref:C,children:S})});d.displayName=u;const f=t+"CollectionItemSlot",p="data-radix-collection-item",g=zA(f),m=j.forwardRef((x,w)=>{const{scope:A,children:S,...T}=x,C=j.useRef(null),[k,E]=j.useState(null),_=Nh(w,C,E),P=a(f,A),{setItemMap:L}=P,R=j.useRef(T);Pit(R.current,T)||(R.current=T);const D=R.current;return j.useEffect(()=>{const M=D;return L(I=>k?I.has(k)?I.set(k,{...M,element:k}).toSorted(Dhe):(I.set(k,{...M,element:k}),I.toSorted(Dhe)):I),()=>{L(I=>!k||!I.has(k)?I:(I.delete(k),new _he(I)))}},[k,D,L]),H.jsx(g,{[p]:"",ref:_,children:S})});m.displayName=f;function v(){return j.useState(new _he)}kl(v,"useInitCollection");function y(x){const{itemMap:w}=a(t+"CollectionConsumer",x);return w}return kl(y,"useCollection"),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:n,useCollection:y,useInitCollection:v}]}kl(t4r,"createCollection");function Pit(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}kl(Pit,"shallowEqual");function Nit(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}kl(Nit,"isElementPreceding");function Dhe(t,e){return!t[1].element||!e[1].element?0:Nit(t[1].element,e[1].element)?-1:1}kl(Dhe,"sortByDocumentPosition");function Bit(t){return new MutationObserver(r=>{for(const n of r)if(n.type==="childList"){t();return}})}kl(Bit,"getChildListObserver");var r4r=Object.defineProperty,n_=(t,e)=>r4r(t,"name",{value:e,configurable:!0}),$it=!!(typeof window<"u"&&window.document&&window.document.createElement);function Eu(t,e,{checkForDefaultPrevented:r=!0}={}){return n_(function(i){if(t==null||t(i),r===!1||!i||!i.defaultPrevented)return e==null?void 0:e(i)},"handleEvent")}n_(Eu,"composeEventHandlers");function n4r(t){var e;if(!$it)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}n_(n4r,"getOwnerWindow");function Lhe(t){if(!$it)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}n_(Lhe,"getOwnerDocument");function Fit(t,e=!1){const{activeElement:r}=Lhe(t);if(!(r!=null&&r.nodeName))return null;if(zit(r)&&r.contentDocument)return Fit(r.contentDocument.body,e);if(e){const n=r.getAttribute("aria-activedescendant");if(n){const i=Lhe(r).getElementById(n);if(i)return i}}return r}n_(Fit,"getActiveElement");function zit(t){return t.tagName==="IFRAME"}n_(zit,"isFrame");var og=globalThis!=null&&globalThis.document?j.useLayoutEffect:()=>{},i4r=Object.defineProperty,a4r=(t,e)=>i4r(t,"name",{value:e,configurable:!0}),Uit=qw[" useEffectEvent ".trim().toString()],Vit=qw[" useInsertionEffect ".trim().toString()];function Qit(t){if(typeof Uit=="function")return Uit(t);const e=j.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Vit=="function"?Vit(()=>{e.current=t}):og(()=>{e.current=t}),j.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}a4r(Qit,"useEffectEvent");var o4r=Object.defineProperty,DN=(t,e)=>o4r(t,"name",{value:e,configurable:!0}),s4r=qw[" useInsertionEffect ".trim().toString()]||og;function i_({prop:t,defaultProp:e,onChange:r=DN(()=>{},"onChange"),caller:n}){const[i,a,o]=Git({defaultProp:e,onChange:r}),s=t!==void 0,l=s?t:i,u=j.useCallback(h=>{var d;if(s){const f=Hit(h)?h(t):h;f!==t&&((d=o.current)==null||d.call(o,f))}else a(h)},[s,t,a,o]);return[l,u]}DN(i_,"useControllableState");function Git({defaultProp:t,onChange:e}){const[r,n]=j.useState(t),i=j.useRef(r),a=j.useRef(e);return s4r(()=>{a.current=e},[e]),j.useEffect(()=>{var o;i.current!==r&&((o=a.current)==null||o.call(a,r),i.current=r)},[r,i]),[r,n,a]}DN(Git,"useUncontrolledState");function Hit(t){return typeof t=="function"}DN(Hit,"isFunction");var Wit=Symbol("RADIX:SYNC_STATE");function l4r(t,e,r,n){const{prop:i,defaultProp:a,onChange:o,caller:s}=e,l=i!==void 0,u=Qit(o),h=[{...r,state:a}];n&&h.push(n);const[d,f]=j.useReducer((v,y)=>{if(y.type===Wit)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=j.useRef(p);j.useEffect(()=>{g.current!==p&&(g.current=p,l||u(p))},[p,g,l]);const m=j.useMemo(()=>i!==void 0?{...d,state:i}:d,[d,i]);return j.useEffect(()=>{l&&!Object.is(i,d.state)&&f({type:Wit,state:i})},[i,d.state,l]),[m,f]}DN(l4r,"useControllableStateReducer");var c4r=Object.defineProperty,hy=(t,e)=>c4r(t,"name",{value:e,configurable:!0});function Yit(t,e){return j.useReducer((r,n)=>e[r][n]??r,t)}hy(Yit,"useStateMachine");var qit=hy(t=>{const{present:e,children:r}=t,n=jit(e),i=typeof r=="function"?r({present:n.isPresent}):j.Children.only(r),a=Xit(n.ref,Kit(i));return typeof r=="function"||n.isPresent?j.cloneElement(i,{ref:a}):null},"Presence");function jit(t){const[e,r]=j.useState(),n=j.useRef(null),i=j.useRef(t),a=j.useRef("none"),o=j.useRef(void 0),s=t?"mounted":"unmounted",[l,u]=Yit(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return j.useEffect(()=>{l==="mounted"?(a.current=o.current??a_(n.current),o.current=void 0):a.current="none"},[l]),og(()=>{const h=n.current,d=i.current;if(d!==t){const p=a.current,g=a_(h);t?(o.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]),og(()=>{if(e){let h;const d=e.ownerDocument.defaultView??window,f=hy(g=>{const v=a_(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=hy(g=>{g.target===e&&(a.current=a_(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:j.useCallback(h=>{if(h){const d=getComputedStyle(h);n.current=d,o.current=a_(d)}else n.current=null;r(h)},[])}}hy(jit,"usePresence");function Mhe(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}hy(Mhe,"setRef");function Xit(...t){const e=j.useRef(t);return e.current=t,j.useCallback(r=>{const n=e.current;let i=!1;const a=n.map(o=>{const s=Mhe(o,r);return!i&&typeof s=="function"&&(i=!0),s});if(i)return()=>{for(let o=0;ou4r(t,"name",{value:e,configurable:!0}),d4r=qw[" useId ".trim().toString()]||(()=>{}),f4r=0;function Ihe(t){const[e,r]=j.useState(d4r());return og(()=>{t||r(n=>n??String(f4r++))},[t]),t||(e?`radix-${e}`:"")}h4r(Ihe,"useId");var p4r=Object.defineProperty,g4r=(t,e)=>p4r(t,"name",{value:e,configurable:!0}),m4r=j.createContext(void 0);function Phe(t){const e=j.useContext(m4r);return t||e||"ltr"}g4r(Phe,"useDirection");var v4r=Object.defineProperty,y4r=(t,e)=>v4r(t,"name",{value:e,configurable:!0});function xx(t){const e=j.useRef(t);return j.useEffect(()=>{e.current=t}),j.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}y4r(xx,"useCallbackRef");var b4r=Object.defineProperty,El=(t,e)=>b4r(t,"name",{value:e,configurable:!0}),Nhe="dismissableLayer.update",x4r="dismissableLayer.pointerDownOutside",w4r="dismissableLayer.focusOutside",Zit,Jit=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),A4r=j.forwardRef(El(function(e,r){const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:l,onDismiss:u,...h}=e,d=j.useContext(Jit),[f,p]=j.useState(null),g=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=j.useState({}),v=Nh(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=j.useRef(!1),C=eat(P=>{o==null||o(P),l==null||l(P),P.defaultPrevented||u==null||u()},{ownerDocument:g,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:j.useCallback(P=>{if(!(P instanceof Node))return!1;const L=[...d.branches].some(R=>R.contains(P));return S&&!L},[d.branches,S])}),k=tat(P=>{if(i&&T.current)return;const L=P.target;[...d.branches].some(D=>D.contains(L))||(s==null||s(P),l==null||l(P),P.defaultPrevented||u==null||u())},g),E=f?w===y.length-1:!1,_=xx(P=>{P.key==="Escape"&&(a==null||a(P),!P.defaultPrevented&&u&&(P.preventDefault(),u()))});return j.useEffect(()=>{if(E)return g.addEventListener("keydown",_,{capture:!0}),()=>g.removeEventListener("keydown",_,{capture:!0})},[g,E,_]),j.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Zit=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Bhe(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=Zit))}},[f,g,n,d]),j.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Bhe())},[f,d]),j.useEffect(()=>{const P=El(()=>m({}),"handleUpdate");return document.addEventListener(Nhe,P),()=>document.removeEventListener(Nhe,P)},[]),H.jsx(ag.div,{...h,ref:v,style:{pointerEvents:A?S?"auto":"none":void 0,...e.style},onFocusCapture:Eu(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Eu(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Eu(e.onPointerDownCapture,C.onPointerDownCapture)})},"DismissableLayer"));function S4r(){const t=j.useContext(Jit),[e,r]=j.useState(null);return j.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),r}El(S4r,"useDismissableLayerSurface");var T4r=El(()=>!0,"IS_TRUE");function eat(t,e){const{ownerDocument:r=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:n=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=T4r}=e,s=xx(t),l=j.useRef(!1),u=j.useRef(!1),h=j.useRef(new Map),d=j.useRef(()=>{});return j.useEffect(()=>{function f(){u.current=!1,i.current=!1,h.current.clear()}El(f,"resetOutsideInteraction");function p(){return Array.from(h.current.values()).some(Boolean)}El(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)}El(g,"handleInteractionCapture");function m(x){u.current&&h.current.set(x.type,!1)}El(m,"handleInteractionBubble");const v=El(x=>{if(x.target&&!l.current){let w=function(){r.removeEventListener("click",d.current);const S=p();f(),S||$he(x4r,s,A,{discrete:!0})};if(El(w,"handleAndDispatchPointerDownOutsideEvent"),!o(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,s,n,i,a,o]),{onPointerDownCapture:El(()=>l.current=!0,"onPointerDownCapture")}}El(eat,"usePointerDownOutside");function tat(t,e=globalThis==null?void 0:globalThis.document){const r=xx(t),n=j.useRef(!1);return j.useEffect(()=>{const i=El(a=>{a.target&&!n.current&&$he(w4r,r,{originalEvent:a},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:El(()=>n.current=!0,"onFocusCapture"),onBlurCapture:El(()=>n.current=!1,"onBlurCapture")}}El(tat,"useFocusOutside");function Bhe(){const t=new CustomEvent(Nhe);document.dispatchEvent(t)}El(Bhe,"dispatchUpdate");function $he(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?Rit(i,a):i.dispatchEvent(a)}El($he,"handleAndDispatchCustomEvent");var C4r=Object.defineProperty,_u=(t,e)=>C4r(t,"name",{value:e,configurable:!0}),Fhe="focusScope.autoFocusOnMount",zhe="focusScope.autoFocusOnUnmount",rat={bubbles:!1,cancelable:!0},O4r=j.forwardRef(_u(function(e,r){const{loop:n=!1,trapped:i=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[l,u]=j.useState(null),h=xx(a),d=xx(o),f=j.useRef(null),p=Nh(r,u),g=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(i){let v=function(w){if(g.paused||!l)return;const A=w.target;l.contains(A)?f.current=A:dy(f.current,{select:!0})},y=function(w){if(g.paused||!l)return;const A=w.relatedTarget;A!==null&&(l.contains(A)||dy(f.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const S of w)S.removedNodes.length>0&&dy(l)};_u(v,"handleFocusIn"),_u(y,"handleFocusOut"),_u(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]),j.useEffect(()=>{if(l){sat.add(g);const v=document.activeElement;if(!l.contains(v)){const b=new CustomEvent(Fhe,rat);l.addEventListener(Fhe,h),l.dispatchEvent(b),b.defaultPrevented||(nat(cat(Uhe(l)),{select:!0}),document.activeElement===v&&dy(l))}return()=>{l.removeEventListener(Fhe,h),setTimeout(()=>{const b=new CustomEvent(zhe,rat);l.addEventListener(zhe,d),l.dispatchEvent(b),b.defaultPrevented||dy(v??document.body,{select:!0}),l.removeEventListener(zhe,d),sat.remove(g)},0)}}},[l,h,d,g]);const m=j.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]=iat(x);w&&A?!v.shiftKey&&b===A?(v.preventDefault(),n&&dy(w,{select:!0})):v.shiftKey&&b===w&&(v.preventDefault(),n&&dy(A,{select:!0})):b===x&&v.preventDefault()}},[n,i,g.paused]);return H.jsx(ag.div,{tabIndex:-1,...s,ref:p,onKeyDown:m})},"FocusScope"));function nat(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(dy(n,{select:e}),document.activeElement!==r)return}_u(nat,"focusFirst");function iat(t){const e=Uhe(t),r=Vhe(e,t),n=Vhe(e.reverse(),t);return[r,n]}_u(iat,"getTabbableEdges");function Uhe(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:_u(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}_u(Uhe,"getTabbableCandidates");function Vhe(t,e){const r=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const n of t)if(!(r?!n.checkVisibility({checkVisibilityCSS:!0}):aat(n,{upTo:e})))return n}_u(Vhe,"findVisible");function aat(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}_u(aat,"isHidden");function oat(t){return t instanceof HTMLInputElement&&"select"in t}_u(oat,"isSelectableInput");function dy(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&oat(t)&&e&&t.select()}}_u(dy,"focus");var sat=lat();function lat(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=Qhe(t,e),t.unshift(e)},remove(e){var r;t=Qhe(t,e),(r=t[0])==null||r.resume()}}}_u(lat,"createFocusScopesStack");function Qhe(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}_u(Qhe,"arrayRemove");function cat(t){return t.filter(e=>e.tagName!=="A")}_u(cat,"removeLinks");var k4r=Object.defineProperty,E4r=(t,e)=>k4r(t,"name",{value:e,configurable:!0}),_4r=j.forwardRef(E4r(function(e,r){var l;const{container:n,...i}=e,[a,o]=j.useState(!1);og(()=>o(!0),[]);const s=n||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return s?kf.createPortal(H.jsx(ag.div,{...i,ref:r}),s):null},"Portal")),R4r=Object.defineProperty,Ghe=(t,e)=>R4r(t,"name",{value:e,configurable:!0}),GG=0,Tm=null;function D4r(t){return Hhe(),t.children}Ghe(D4r,"FocusGuards");function Hhe(){j.useEffect(()=>{Tm||(Tm={start:Whe(),end:Whe()});const{start:t,end:e}=Tm;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),GG++,()=>{GG===1&&(Tm==null||Tm.start.remove(),Tm==null||Tm.end.remove(),Tm=null),GG=Math.max(0,GG-1)}},[])}Ghe(Hhe,"useFocusGuards");function Whe(){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}Ghe(Whe,"createFocusGuard");var Cm=function(){return Cm=Object.assign||function(e){for(var r,n=1,i=arguments.length;n"u")return q4r;var e=j4r(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])}},K4r=pat(),o_="data-scroll-locked",Z4r=function(t,e,r,n){var i=t.left,a=t.top,o=t.right,s=t.gap;return r===void 0&&(r="margin"),` + .`.concat(M4r,` { overflow: hidden `).concat(n,`; padding-right: `).concat(s,"px ").concat(n,`; } @@ -299,18 +299,18 @@ https://github.com/highlightjs/highlight.js/issues/2277`),B=M,F=I),N===void 0&&( } body[`).concat(o_,`] { - `).concat(L4r,": ").concat(s,`px; + `).concat(I4r,": ").concat(s,`px; } -`)},fat=function(){var t=parseInt(document.body.getAttribute(o_)||"0",10);return isFinite(t)?t:0},K4r=function(){j.useEffect(function(){return document.body.setAttribute(o_,(fat()+1).toString()),function(){var t=fat()-1;t<=0?document.body.removeAttribute(o_):document.body.setAttribute(o_,t.toString())}},[])},Z4r=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n;K4r();var a=j.useMemo(function(){return q4r(i)},[i]);return j.createElement(j4r,{styles:X4r(a,!e,i,r?"":"!important")})},Xhe=!1;if(typeof window<"u")try{var qG=Object.defineProperty({},"passive",{get:function(){return Xhe=!0,!0}});window.addEventListener("test",qG,qG),window.removeEventListener("test",qG,qG)}catch{Xhe=!1}var s_=Xhe?{passive:!1}:!1,J4r=function(t){return t.tagName==="TEXTAREA"},pat=function(t,e){if(!(t instanceof Element))return!1;var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!J4r(t)&&r[e]==="visible")},e3r=function(t){return pat(t,"overflowY")},t3r=function(t){return pat(t,"overflowX")},gat=function(t,e){var r=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=mat(t,n);if(i){var a=vat(t,n),o=a[1],s=a[2];if(o>s)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},r3r=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},n3r=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},mat=function(t,e){return t==="v"?e3r(e):t3r(e)},vat=function(t,e){return t==="v"?r3r(e):n3r(e)},i3r=function(t,e){return t==="h"&&e==="rtl"?-1:1},a3r=function(t,e,r,n,i){var a=i3r(t,window.getComputedStyle(e).direction),o=a*n,s=r.target,l=e.contains(s),u=!1,h=o>0,d=0,f=0;do{if(!s)break;var p=vat(t,s),g=p[0],m=p[1],v=p[2],y=m-v-a*g;(g||y)&&mat(t,s)&&(d+=y,f+=g);var b=s.parentNode;s=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!l&&s!==document.body||l&&(e.contains(s)||e===s));return(h&&Math.abs(d)<1||!h&&Math.abs(f)<1)&&(u=!0),u},jG=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},yat=function(t){return[t.deltaX,t.deltaY]},bat=function(t){return t&&"current"in t?t.current:t},o3r=function(t,e){return t[0]===e[0]&&t[1]===e[1]},s3r=function(t){return` +`)},gat=function(){var t=parseInt(document.body.getAttribute(o_)||"0",10);return isFinite(t)?t:0},J4r=function(){j.useEffect(function(){return document.body.setAttribute(o_,(gat()+1).toString()),function(){var t=gat()-1;t<=0?document.body.removeAttribute(o_):document.body.setAttribute(o_,t.toString())}},[])},e3r=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n;J4r();var a=j.useMemo(function(){return X4r(i)},[i]);return j.createElement(K4r,{styles:Z4r(a,!e,i,r?"":"!important")})},Xhe=!1;if(typeof window<"u")try{var qG=Object.defineProperty({},"passive",{get:function(){return Xhe=!0,!0}});window.addEventListener("test",qG,qG),window.removeEventListener("test",qG,qG)}catch{Xhe=!1}var s_=Xhe?{passive:!1}:!1,t3r=function(t){return t.tagName==="TEXTAREA"},mat=function(t,e){if(!(t instanceof Element))return!1;var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!t3r(t)&&r[e]==="visible")},r3r=function(t){return mat(t,"overflowY")},n3r=function(t){return mat(t,"overflowX")},vat=function(t,e){var r=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=yat(t,n);if(i){var a=bat(t,n),o=a[1],s=a[2];if(o>s)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},i3r=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},a3r=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},yat=function(t,e){return t==="v"?r3r(e):n3r(e)},bat=function(t,e){return t==="v"?i3r(e):a3r(e)},o3r=function(t,e){return t==="h"&&e==="rtl"?-1:1},s3r=function(t,e,r,n,i){var a=o3r(t,window.getComputedStyle(e).direction),o=a*n,s=r.target,l=e.contains(s),u=!1,h=o>0,d=0,f=0;do{if(!s)break;var p=bat(t,s),g=p[0],m=p[1],v=p[2],y=m-v-a*g;(g||y)&&yat(t,s)&&(d+=y,f+=g);var b=s.parentNode;s=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!l&&s!==document.body||l&&(e.contains(s)||e===s));return(h&&Math.abs(d)<1||!h&&Math.abs(f)<1)&&(u=!0),u},jG=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},xat=function(t){return[t.deltaX,t.deltaY]},wat=function(t){return t&&"current"in t?t.current:t},l3r=function(t,e){return t[0]===e[0]&&t[1]===e[1]},c3r=function(t){return` .block-interactivity-`.concat(t,` {pointer-events: none;} .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},l3r=0,l_=[];function c3r(t){var e=j.useRef([]),r=j.useRef([0,0]),n=j.useRef(),i=j.useState(l3r++)[0],a=j.useState(dat)[0],o=j.useRef(t);j.useEffect(function(){o.current=t},[t]),j.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var m=R4r([t.lockRef.current],(t.shards||[]).map(bat),!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 s=j.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!o.current.allowPinchZoom;var y=jG(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 C=window.getSelection(),k=C&&C.anchorNode,E=k?k===S||k.contains(S):!1;if(E)return!1;var _=gat(T,S);if(!_)return!0;if(_?A=T:(A=T==="v"?"h":"v",_=gat(T,S)),!_)return!1;if(!n.current&&"changedTouches"in m&&(x||w)&&(n.current=A),!A)return!0;var P=n.current||A;return a3r(P,v,m,P==="h"?x:w)},[]),l=j.useCallback(function(m){var v=m;if(!(!l_.length||l_[l_.length-1]!==a)){var y="deltaY"in v?yat(v):jG(v),b=e.current.filter(function(A){return A.name===v.type&&(A.target===v.target||v.target===A.shadowParent)&&o3r(A.delta,y)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}if(!b){var x=(o.current.shards||[]).map(bat).filter(Boolean).filter(function(A){return A.contains(v.target)}),w=x.length>0?s(v,x[0]):!o.current.noIsolation;w&&v.cancelable&&v.preventDefault()}}},[]),u=j.useCallback(function(m,v,y,b){var x={name:m,delta:v,target:y,should:b,shadowParent:u3r(y)};e.current.push(x),setTimeout(function(){e.current=e.current.filter(function(w){return w!==x})},1)},[]),h=j.useCallback(function(m){r.current=jG(m),n.current=void 0},[]),d=j.useCallback(function(m){u(m.type,yat(m),m.target,s(m,t.lockRef.current))},[]),f=j.useCallback(function(m){u(m.type,jG(m),m.target,s(m,t.lockRef.current))},[]);j.useEffect(function(){return l_.push(a),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,s_),document.addEventListener("touchmove",l,s_),document.addEventListener("touchstart",h,s_),function(){l_=l_.filter(function(m){return m!==a}),document.removeEventListener("wheel",l,s_),document.removeEventListener("touchmove",l,s_),document.removeEventListener("touchstart",h,s_)}},[]);var p=t.removeScrollBar,g=t.inert;return j.createElement(j.Fragment,null,g?j.createElement(a,{styles:s3r(i)}):null,p?j.createElement(Z4r,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function u3r(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const h3r=F4r(hat,c3r);var xat=j.forwardRef(function(t,e){return j.createElement(YG,Cm({},t,{ref:e,sideCar:h3r}))});xat.classNames=YG.classNames;var d3r=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},c_=new WeakMap,XG=new WeakMap,KG={},Khe=0,wat=function(t){return t&&(t.host||wat(t.parentNode))},f3r=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=wat(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})},p3r=function(t,e,r,n){var i=f3r(e,Array.isArray(t)?t:[t]);KG[r]||(KG[r]=new WeakMap);var a=KG[r],o=[],s=new Set,l=new Set(i),u=function(d){!d||s.has(d)||(s.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(s.has(f))h(f);else try{var p=f.getAttribute(n),g=p!==null&&p!=="false",m=(c_.get(f)||0)+1,v=(a.get(f)||0)+1;c_.set(f,m),a.set(f,v),o.push(f),m===1&&g&&XG.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),s.clear(),Khe++,function(){o.forEach(function(d){var f=c_.get(d)-1,p=a.get(d)-1;c_.set(d,f),a.set(d,p),f||(XG.has(d)||d.removeAttribute(n),XG.delete(d)),p||d.removeAttribute(r)}),Khe--,Khe||(c_=new WeakMap,c_=new WeakMap,XG=new WeakMap,KG={})}},g3r=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=d3r(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live], script"))),p3r(n,i,r,"aria-hidden")):function(){return null}},m3r=Object.defineProperty,v3r=(t,e)=>m3r(t,"name",{value:e,configurable:!0});function Aat(t){const[e,r]=j.useState(void 0);return og(()=>{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 o,s;if("borderBoxSize"in a){const l=a.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,s=u.blockSize}else o=t.offsetWidth,s=t.offsetHeight;r({width:o,height:s})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}v3r(Aat,"useSize");var y3r=Object.defineProperty,Ax=(t,e)=>y3r(t,"name",{value:e,configurable:!0}),Sat="Popper",[Tat,Cat]=UA(Sat),[b3r,Oat]=Tat(Sat),x3r=Ax(t=>{const{__scopePopper:e,children:r}=t,[n,i]=j.useState(null),[a,o]=j.useState(void 0);return H.jsx(b3r,{scope:e,anchor:n,onAnchorChange:i,placementState:a,setPlacementState:o,children:r})},"Popper"),w3r="PopperAnchor",A3r=j.forwardRef(Ax(function(e,r){const{__scopePopper:n,virtualRef:i,...a}=e,o=Oat(w3r,n),s=j.useRef(null),l=o.onAnchorChange,u=j.useCallback(m=>{s.current=m,m&&l(m)},[l]),h=Nh(r,u),d=j.useRef(null);j.useEffect(()=>{if(!i)return;const m=d.current;d.current=i.current,m!==d.current&&l(d.current)});const f=o.placementState&&ZG(o.placementState),p=f==null?void 0:f[0],g=f==null?void 0:f[1];return i?null:H.jsx(ag.div,{"data-radix-popper-side":p,"data-radix-popper-align":g,...a,ref:h})},"PopperAnchor")),kat="PopperContent",[S3r,opi]=Tat(kat),T3r=j.forwardRef(Ax(function(e,r){var X,J,ee,te,pe,ie,Ce;const{__scopePopper:n,side:i="bottom",sideOffset:a=0,align:o="center",alignOffset:s=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=Oat(kat,n),[b,x]=j.useState(null),w=Nh(r,x),[A,S]=j.useState(null),T=Aat(A),C=(T==null?void 0:T.width)??0,k=(T==null?void 0:T.height)??0,E=i+(o!=="center"?"-"+o:""),_=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},P=Array.isArray(h)?h:[h],L=P.length>0,R={padding:_,boundary:P.filter(Eat),altBoundary:L},{refs:D,floatingStyles:M,placement:I,isPositioned:N,middlewareData:F}=CJe({strategy:"fixed",placement:E,whileElementsMounted:Ax((...ke)=>jce(...ke,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:y.anchor},middleware:[OJe({mainAxis:a+k,alignmentAxis:s}),u&&kJe({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?EJe():void 0,...R}),u&&_Je({...R}),RJe({...R,apply:Ax(({elements:ke,rects:Ee,availableWidth:ue,availableHeight:de})=>{const{width:xe,height:ge}=Ee.reference,ze=ke.floating.style;ze.setProperty("--radix-popper-available-width",`${ue}px`),ze.setProperty("--radix-popper-available-height",`${de}px`),ze.setProperty("--radix-popper-anchor-width",`${xe}px`),ze.setProperty("--radix-popper-anchor-height",`${ge}px`)},"apply")}),A&&gyr({element:A,padding:l}),C3r({arrowWidth:C,arrowHeight:k}),p&&pyr({strategy:"referenceHidden",...R,boundary:L?R.boundary:void 0})]}),B=y.setPlacementState;og(()=>(B(I),()=>{B(void 0)}),[I,B]);const[V,z]=ZG(I),U=xx(m);og(()=>{N&&(U==null||U())},[N,U]);const Q=(X=F.arrow)==null?void 0:X.x,G=(J=F.arrow)==null?void 0:J.y,q=((ee=F.arrow)==null?void 0:ee.centerOffset)!==0,[Y,ne]=j.useState();return og(()=>{b&&ne(window.getComputedStyle(b).zIndex)},[b]),H.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":[(te=F.transformOrigin)==null?void 0:te.x,(pe=F.transformOrigin)==null?void 0:pe.y].join(" "),...((ie=F.hide)==null?void 0:ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:H.jsx(S3r,{scope:n,placedSide:V,placedAlign:z,onArrowChange:S,arrowX:Q,arrowY:G,shouldHideArrow:q,children:H.jsx(ag.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 Eat(t){return t!==null}Ax(Eat,"isNotNull");var C3r=Ax(t=>({name:"transformOrigin",options:t,fn(e){var v,y,b;const{placement:r,rects:n,middlewareData:i}=e,o=((v=i.arrow)==null?void 0:v.centerOffset)!==0,s=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[u,h]=ZG(r),d={start:"0%",center:"50%",end:"100%"}[h],f=(((y=i.arrow)==null?void 0:y.x)??0)+s/2,p=(((b=i.arrow)==null?void 0:b.y)??0)+l/2;let g="",m="";return u==="bottom"?(g=o?d:`${f}px`,m=`${-l}px`):u==="top"?(g=o?d:`${f}px`,m=`${n.floating.height+l}px`):u==="right"?(g=`${-l}px`,m=o?d:`${p}px`):u==="left"&&(g=`${n.floating.width+l}px`,m=o?d:`${p}px`),{data:{x:g,y:m}}}}),"transformOrigin");function ZG(t){const[e,r="center"]=t.split("-");return[e,r]}Ax(ZG,"getSideAndAlignFromPlacement");var O3r=x3r,k3r=A3r,E3r=T3r,_3r=Object.defineProperty,Zhe=(t,e)=>_3r(t,"name",{value:e,configurable:!0}),Jhe=!1;function _at(){const[t,e]=j.useState(Jhe);return j.useEffect(()=>{Jhe||(Jhe=!0,e(!0))},[]),t}Zhe(_at,"useIsHydrated");var Rat=qw[" useSyncExternalStore ".trim().toString()];function Dat(){return()=>{}}Zhe(Dat,"subscribe");function Lat(){return Rat(Dat,()=>!0,()=>!1)}Zhe(Lat,"useIsHydratedModern");var R3r=typeof Rat=="function"?Lat:_at,D3r=Object.defineProperty,VA=(t,e)=>D3r(t,"name",{value:e,configurable:!0}),ede="rovingFocusGroup.onEntryFocus",L3r={bubbles:!1,cancelable:!0},JG="RovingFocusGroup",[tde,Mat,M3r]=Rit(JG),[I3r,Iat]=UA(JG,[M3r]),[P3r,N3r]=I3r(JG),B3r=j.forwardRef(VA(function(e,r){return H.jsx(tde.Provider,{scope:e.__scopeRovingFocusGroup,children:H.jsx(tde.Slot,{scope:e.__scopeRovingFocusGroup,children:H.jsx($3r,{...e,ref:r})})})},"RovingFocusGroup")),$3r=j.forwardRef(VA(function(e,r){const{__scopeRovingFocusGroup:n,orientation:i,loop:a=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:h,preventScrollOnEntryFocus:d=!1,...f}=e,p=j.useRef(null),g=Nh(r,p),m=Phe(o),[v,y]=i_({prop:s,defaultProp:l??null,onChange:u,caller:JG}),[b,x]=j.useState(!1),w=xx(h),A=Mat(n),S=j.useRef(!1),[T,C]=j.useState(0);return j.useEffect(()=>{const k=p.current;if(k)return k.addEventListener(ede,w),()=>k.removeEventListener(ede,w)},[w]),H.jsx(P3r,{scope:n,orientation:i,dir:m,loop:a,currentTabStopId:v,onItemFocus:j.useCallback(k=>y(k),[y]),onItemShiftTab:j.useCallback(()=>x(!0),[]),onFocusableItemAdd:j.useCallback(()=>C(k=>k+1),[]),onFocusableItemRemove:j.useCallback(()=>C(k=>k-1),[]),children:H.jsx(ag.div,{tabIndex:b||T===0?-1:0,"data-orientation":i,...f,ref:g,style:{outline:"none",...e.style},onMouseDown:Eu(e.onMouseDown,()=>{S.current=!0}),onFocus:Eu(e.onFocus,k=>{const E=!S.current;if(k.target===k.currentTarget&&E&&!b){const _=new CustomEvent(ede,L3r);if(k.currentTarget.dispatchEvent(_),!_.defaultPrevented){const P=A().filter(I=>I.focusable),L=P.find(I=>I.active),R=P.find(I=>I.id===v),M=[L,R,...P].filter(Boolean).map(I=>I.ref.current);rde(M,d)}}S.current=!1}),onBlur:Eu(e.onBlur,()=>x(!1))})})},"RovingFocusGroupImpl")),F3r="RovingFocusGroupItem",z3r=j.forwardRef(VA(function(e,r){const{__scopeRovingFocusGroup:n,focusable:i=!0,active:a=!1,tabStopId:o,children:s,...l}=e,u=Ihe(),h=o||u,d=N3r(F3r,n),f=d.currentTabStopId===h,p=Mat(n),{onFocusableItemAdd:g,onFocusableItemRemove:m,currentTabStopId:v}=d,y=R3r();return og(()=>{if(!(!y||!i))return g(),()=>m()},[y,i,g,m]),j.useEffect(()=>{if(!(y||!i))return g(),()=>m()},[y,i,g,m]),H.jsx(tde.ItemSlot,{scope:n,id:h,focusable:i,active:a,children:H.jsx(ag.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...l,ref:r,onMouseDown:Eu(e.onMouseDown,b=>{i?d.onItemFocus(h):b.preventDefault()}),onFocus:Eu(e.onFocus,()=>d.onItemFocus(h)),onKeyDown:Eu(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){d.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const x=Nat(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?Bat(A,S+1):A.slice(S+1)}setTimeout(()=>rde(A))}}),children:typeof s=="function"?s({isCurrentTabStop:f,hasTabStop:v!=null}):s})})},"RovingFocusGroupItem")),U3r={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Pat(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}VA(Pat,"getDirectionAwareKey");function Nat(t,e,r){const n=Pat(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return U3r[n]}VA(Nat,"getFocusIntent");function rde(t,e=!1){const r=document.activeElement;for(const n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}VA(rde,"focusFirst");function Bat(t,e){return t.map((r,n)=>t[(e+n)%t.length])}VA(Bat,"wrapArray");var V3r=B3r,Q3r=z3r,G3r=Object.defineProperty,Sx=(t,e)=>G3r(t,"name",{value:e,configurable:!0}),nde="Popover",[$at,spi]=UA(nde,[Cat]),ide=Cat(),[H3r,u_]=$at(nde),W3r=Sx(t=>{const{__scopePopover:e,children:r,open:n,defaultOpen:i,onOpenChange:a,modal:o=!1}=t,s=ide(e),l=j.useRef(null),[u,h]=j.useState(!1),[d,f]=i_({prop:n,defaultProp:i??!1,onChange:a,caller:nde});return H.jsx(O3r,{...s,children:H.jsx(H3r,{scope:e,contentId:Ihe(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:j.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:u,onCustomAnchorAdd:j.useCallback(()=>h(!0),[]),onCustomAnchorRemove:j.useCallback(()=>h(!1),[]),modal:o,children:r})})},"Popover"),Y3r="PopoverTrigger",q3r=j.forwardRef(Sx(function(e,r){const{__scopePopover:n,...i}=e,a=u_(Y3r,n),o=ide(n),s=Nh(r,a.triggerRef),l=H.jsx(ag.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":ade(a.open),...i,ref:s,onClick:Eu(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:H.jsx(k3r,{asChild:!0,...o,children:l})},"PopoverTrigger")),Fat="PopoverPortal",[j3r,X3r]=$at(Fat,{forceMount:void 0}),K3r=Sx(t=>{const{__scopePopover:e,forceMount:r,children:n,container:i}=t,a=u_(Fat,e);return H.jsx(j3r,{scope:e,forceMount:r,children:H.jsx(Wit,{present:r||a.open,children:H.jsx(k4r,{asChild:!0,container:i,children:n})})})},"PopoverPortal"),LN="PopoverContent",Z3r=j.forwardRef(Sx(function(e,r){const n=X3r(LN,e.__scopePopover),{forceMount:i=n.forceMount,...a}=e,o=u_(LN,e.__scopePopover);return H.jsx(Wit,{present:i||o.open,children:o.modal?H.jsx(eDr,{...a,ref:r}):H.jsx(tDr,{...a,ref:r})})},"PopoverContent")),J3r=zA("PopoverContent.RemoveScroll"),eDr=j.forwardRef(Sx(function(e,r){const n=u_(LN,e.__scopePopover),i=j.useRef(null),a=Nh(r,i),o=j.useRef(!1);return j.useEffect(()=>{const s=i.current;if(s)return g3r(s)},[]),H.jsx(xat,{as:J3r,allowPinchZoom:!0,children:H.jsx(zat,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Eu(e.onCloseAutoFocus,s=>{var l;s.preventDefault(),o.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Eu(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,h=l.button===2||u;o.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Eu(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),tDr=j.forwardRef(Sx(function(e,r){const n=u_(LN,e.__scopePopover),i=j.useRef(!1),a=j.useRef(!1);return H.jsx(zat,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,l;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(i.current||(l=n.triggerRef.current)==null||l.focus(),o.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:o=>{var u,h;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(i.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const s=o.target;((h=n.triggerRef.current)==null?void 0:h.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})},"PopoverContentNonModal")),zat=j.forwardRef(Sx(function(e,r){const{__scopePopover:n,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:d,...f}=e,p=u_(LN,n),g=ide(n);return Hhe(),H.jsx(T4r,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:a,onUnmountAutoFocus:o,children:H.jsx(x4r,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:h,onDismiss:()=>p.onOpenChange(!1),deferPointerDownOutside:!0,children:H.jsx(E3r,{"data-state":ade(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 ade(t){return t?"open":"closed"}Sx(ade,"getState");var rDr=W3r,nDr=q3r,iDr=K3r,aDr=Z3r,oDr=Object.defineProperty,sDr=(t,e)=>oDr(t,"name",{value:e,configurable:!0}),lDr="Toggle",cDr=j.forwardRef(sDr(function(e,r){const{pressed:n,defaultPressed:i,onPressedChange:a,...o}=e,[s,l]=i_({prop:n,onChange:a,defaultProp:i??!1,caller:lDr});return H.jsx(ag.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:r,onClick:Eu(e.onClick,()=>{e.disabled||l(!s)})})},"Toggle")),uDr=Object.defineProperty,Tx=(t,e)=>uDr(t,"name",{value:e,configurable:!0}),h_="ToggleGroup",[Uat,lpi]=UA(h_,[Iat]),Vat=Iat(),hDr=j.forwardRef(Tx(function(e,r){const{type:n,...i}=e;if(n==="single"){const a=i;return H.jsx(dDr,{role:"radiogroup",...a,ref:r})}if(n==="multiple"){const a=i;return H.jsx(fDr,{role:"toolbar",...a,ref:r})}throw new Error(`Missing prop \`type\` expected on \`${h_}\``)},"ToggleGroup")),[Qat,Gat]=Uat(h_),dDr=j.forwardRef(Tx(function(e,r){const{value:n,defaultValue:i,onValueChange:a=Tx(()=>{},"onValueChange"),...o}=e,[s,l]=i_({prop:n,defaultProp:i??"",onChange:a,caller:h_});return H.jsx(Qat,{scope:e.__scopeToggleGroup,type:"single",value:j.useMemo(()=>s?[s]:[],[s]),onItemActivate:l,onItemDeactivate:j.useCallback(()=>l(""),[l]),children:H.jsx(Hat,{...o,ref:r})})},"ToggleGroupImplSingle")),fDr=j.forwardRef(Tx(function(e,r){const{value:n,defaultValue:i,onValueChange:a=Tx(()=>{},"onValueChange"),...o}=e,[s,l]=i_({prop:n,defaultProp:i??[],onChange:a,caller:h_}),u=j.useCallback(d=>l((f=[])=>[...f,d]),[l]),h=j.useCallback(d=>l((f=[])=>f.filter(p=>p!==d)),[l]);return H.jsx(Qat,{scope:e.__scopeToggleGroup,type:"multiple",value:s,onItemActivate:u,onItemDeactivate:h,children:H.jsx(Hat,{...o,ref:r})})},"ToggleGroupImplMultiple")),[pDr,gDr]=Uat(h_),Hat=j.forwardRef(Tx(function(e,r){const{__scopeToggleGroup:n,disabled:i=!1,rovingFocus:a=!0,orientation:o,dir:s,loop:l=!0,...u}=e,h=Vat(n),d=Phe(s),f={dir:d,...u};return H.jsx(pDr,{scope:n,rovingFocus:a,disabled:i,children:a?H.jsx(V3r,{asChild:!0,...h,orientation:o,dir:d,loop:l,children:H.jsx(ag.div,{...f,ref:r})}):H.jsx(ag.div,{...f,ref:r})})},"ToggleGroupImpl")),ode="ToggleGroupItem",mDr=j.forwardRef(Tx(function(e,r){const n=Gat(ode,e.__scopeToggleGroup),i=gDr(ode,e.__scopeToggleGroup),a=Vat(e.__scopeToggleGroup),o=n.value.includes(e.value),s=i.disabled||e.disabled,l={...e,pressed:o,disabled:s},u=j.useRef(null);return i.rovingFocus?H.jsx(Q3r,{asChild:!0,...a,focusable:!s,active:o,ref:u,children:H.jsx(Wat,{...l,ref:r})}):H.jsx(Wat,{...l,ref:r})},"ToggleGroupItem")),Wat=j.forwardRef(Tx(function(e,r){const{__scopeToggleGroup:n,value:i,...a}=e,o=Gat(ode,n),s={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},l=o.type==="single"?s:void 0;return H.jsx(cDr,{...l,...a,ref:r,onPressedChange:u=>{u?o.onItemActivate(i):o.onItemDeactivate(i)}})},"ToggleGroupItemImpl")),vDr=typeof Ti=="object"&&Ti&&Ti.Object===Object&&Ti,yDr=typeof self=="object"&&self&&self.Object===Object&&self;vDr||yDr||Function("return this")();var bDr=typeof window<"u"?j.useLayoutEffect:j.useEffect;function xDr(){const t=j.useRef(!1);return j.useEffect(()=>(t.current=!0,()=>{t.current=!1}),[]),j.useCallback(()=>t.current,[])}var Yat={width:void 0,height:void 0};function wDr(t){const{ref:e,box:r="content-box"}=t,[{width:n,height:i},a]=j.useState(Yat),o=xDr(),s=j.useRef({...Yat}),l=j.useRef(void 0);return l.current=t.onResize,j.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=qat(h,d,"inlineSize"),p=qat(h,d,"blockSize");if(s.current.width!==f||s.current.height!==p){const m={width:f,height:p};s.current.width=f,s.current.height=p,l.current?l.current(m):o()&&a(m)}});return u.observe(e.current,{box:r}),()=>{u.disconnect()}},[r,e,o]),{width:n,height:i}}function qat(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 jat(t,e){const r=j.useRef(t);bDr(()=>{r.current=t},[t]),j.useEffect(()=>{if(!e&&e!==0)return;const n=setTimeout(()=>{r.current()},e);return()=>{clearTimeout(n)}},[e])}const ADr={DEV:!1,MODE:"production"},d_=typeof{url:qa&&qa.tagName.toUpperCase()==="SCRIPT"&&qa.src||new URL("website-integration.js",document.baseURI).href}<"u"?ADr:void 0,SDr=!!(d_!=null&&d_.DEV),TDr=typeof navigator<"u"&&/(jsdom|happy-dom)/i.test(navigator.userAgent)||typeof globalThis.happyDOM=="object",Xat=(d_==null?void 0:d_.MODE)==="test"||TDr,CDr=typeof window<"u",Kat=typeof document<"u",ODr=CDr&&Kat,Zat=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())},sde=(t,e)=>{const r=()=>{const o=setTimeout(t);return()=>{clearTimeout(o)}};if(!ODr||typeof window.requestAnimationFrame!="function"||Kat&&document.visibilityState==="hidden")return r();let i=2,a=window.requestAnimationFrame(function o(){i-=1,i===0?t():a=window.requestAnimationFrame(o)});return()=>{typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(a)}},Jat=t=>Object.keys(t).reduce((r,n)=>{const i=t[n];if(i||i===0){const a=n.startsWith("--")?"":"--",o=typeof i=="number"?`${i}px`:i;r[`${a}${n}`]=o}return r},{}),lde=t=>{t.preventDefault()},eot=t=>t.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]'),cde={SegmentedControl:"_SegmentedControl_1sl7d_1",SegmentedControlOption:"_SegmentedControlOption_1sl7d_140",SegmentedControlThumb:"_SegmentedControlThumb_1sl7d_219"},eH=({value:t,onChange:e,children:r,block:n,pill:i=!0,size:a="md",gutterSize:o,className:s,onClick:l,...u})=>{const h=j.useRef(null),d=j.useRef(null),f=j.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,C=T+x;(TS+b-A)&&g&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);wDr({ref:h,onResize:()=>{const g=d.current;if(!g)return;const m=g.style.transition;g.style.transition="",f(!1),g.style.transition=m}}),j.useLayoutEffect(()=>{const g=h.current,m=d.current;!g||!m||(f(!!m.style.transition),m.style.transition||sde(()=>{m.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[f,t,a,o,i]);const p=g=>{g&&e&&e(g)};return H.jsxs(hDr,{ref:h,className:r_(cde.SegmentedControl,s),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":o,...u,children:[H.jsx("div",{className:cde.SegmentedControlThumb,ref:d}),r]})},kDr=({children:t,...e})=>H.jsx(mDr,{className:cde.SegmentedControlOption,...e,onPointerEnter:Zat,children:H.jsx("span",{className:"relative",children:t})});eH.Option=kDr;function EDr({children:t,label:e,language:r,source:n,streaming:i=!1}){const{t:a}=ca("conversation"),[o,s]=j.useState("preview"),l=i?"code":o;return H.jsxs("section",{className:"visualization-card","aria-label":a("visualization.cardAria",{label:e}),children:[H.jsx("div",{className:"visualization-card__toolbar",children:H.jsxs(eH,{className:"visualization-card__tabs",value:l,size:"sm",gutterSize:"sm",pill:!1,"aria-label":a("visualization.viewAria",{label:e}),onChange:u=>{i||s(u)},children:[H.jsx(eH.Option,{value:"preview",disabled:i,children:a("visualization.preview")}),H.jsx(eH.Option,{value:"code",children:a("visualization.code")})]})}),H.jsx("div",{className:"visualization-card__body",children:l==="code"?H.jsx("pre",{className:"visualization-card__code",children:H.jsx("code",{className:`language-${r}`,children:n})}):t})]})}const _Dr=j.memo(EDr);function RDr(t){const e=t==null?void 0:t.trim().toLowerCase();if(e==="mermaid")return"mermaid";if(e==="echart"||e==="echarts")return"echarts"}const tot=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function ude(t){return typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(ude).join(""):j.isValidElement(t)?ude(t.props.children):""}function DDr(t){var n;const e=j.Children.toArray(t)[0];if(!j.isValidElement(e))return;const r=(n=e.props.className)==null?void 0:n.split(/\s+/).find(i=>i.startsWith("language-"));return RDr(r==null?void 0:r.slice(9))}function rot(t){if(!t)return!1;try{const e=t.toLowerCase();return tot.some(r=>e.includes(r))}catch{return!1}}function LDr(t){var n;const e=(n=t==null?void 0:t.properties)==null?void 0:n.href;if(!e)return!1;if(rot(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 tot.some(a=>i.includes(a))}return!1}function MDr({text:t,className:e,allowRawHtml:r=!0,streaming:n=!1}){const{t:i}=ca("conversation"),[a,o]=j.useState(null),s=(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 H.jsxs("div",{className:e?`md ${e}`:"md",children:[H.jsx(oSr,{remarkPlugins:[wCr],rehypePlugins:r?[hRr,mnt]:[mnt],components:{pre:({node:h,children:d,...f})=>{const p=DDr(d);if(p==="mermaid"||p==="echarts"){const g=ude(d).replace(/\n$/,"");return H.jsx(_Dr,{label:p==="mermaid"?"Mermaid":"ECharts",language:p,source:g,streaming:n,children:p==="mermaid"?H.jsx(FRr,{source:g}):H.jsx(IRr,{source:g})})}return H.jsx("pre",{...f,children:d})},a:({node:h,...d})=>{const f=d.href;if(f&&(rot(f)||LDr(h))){const p=f,g=u(h==null?void 0:h.children);return H.jsxs("div",{className:"video-container",children:[H.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":i("markdown.playVideo",{name:g}),onClick:()=>o({src:p,title:g}),children:[H.jsx("video",{src:p,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),H.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:H.jsx(nQ,{})})]}),H.jsx("div",{className:"video-caption",children:H.jsx("a",{href:p,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:g})})]})}return H.jsx("a",{...d,target:"_blank",rel:"noopener noreferrer"})},img:({node:h,src:d,alt:f,...p})=>{const g=H.jsx("img",{...p,src:d,alt:f??"",loading:"lazy"});return d?H.jsx(ztt,{src:d,children:H.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":i("markdown.enlargeImage",{name:f||i("markdown.image")}),children:[g,H.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:H.jsx(nQ,{})})]})}):g},video:({node:h,src:d,children:f,...p})=>{const g=s({src:d},f);return g?H.jsx("div",{className:"video-container",children:H.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":i("markdown.enlargeVideo"),onClick:()=>o({src:g}),children:[H.jsx("video",{src:g,...p,playsInline:!0,className:"video-thumbnail",children:f}),H.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:H.jsx(nQ,{})})]})}):H.jsx("video",{src:d,controls:!0,playsInline:!0,className:"video-inline",...p,children:f})}},children:t}),a&&H.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":i("markdown.videoPreview"),onClick:()=>o(null),children:H.jsxs("div",{className:"video-viewer",onClick:h=>h.stopPropagation(),children:[H.jsxs("div",{className:"video-viewer-header",children:[H.jsx("div",{className:"video-viewer-title",children:a.title||l(a.src)}),H.jsxs("nav",{className:"video-viewer-nav",children:[H.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:H.jsx(ile,{})}),H.jsx("button",{type:"button",className:"video-viewer-close","aria-label":i("markdown.close"),onClick:()=>o(null),children:H.jsx(vE,{})})]})]}),H.jsx("div",{className:"video-viewer-body",children:H.jsx("video",{src:a.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const tH=j.memo(MDr);function IDr({value:t,skillPrefix:e="/",onRemoveSkill:r,onRemoveAgent:n}){const{t:i}=ca("conversation");return t.skills.length===0&&!t.targetAgent?null:H.jsxs("div",{className:"invocation-chips","aria-label":i("invocation.ariaLabel"),children:[t.skills.map(a=>H.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:a.description,children:[H.jsx(_dr,{"aria-hidden":!0}),H.jsxs("span",{children:[e,a.name]}),r?H.jsx("button",{type:"button",onClick:()=>r(a.name),"aria-label":i("invocation.removeSkill",{name:a.name}),children:H.jsx(vE,{})}):null]},a.name)),t.targetAgent?H.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:t.targetAgent.description,children:[H.jsx(Adr,{"aria-hidden":!0}),H.jsx("span",{children:t.targetAgent.name}),n?H.jsx("button",{type:"button",onClick:n,"aria-label":i("invocation.removeAgent",{name:t.targetAgent.name}),children:H.jsx(vE,{})}):null]}):null]})}const not="veadk_auth_qs",PDr=new Set(["view","source","sessionId","artifactSha256","validationReportSha256","projectId","versionId"]);let MN=null;function NDr(){if(MN!==null)return MN;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,o)=>{(n&&PDr.has(o)?r:e).append(o,a)});const i=e.toString();if(i?(sessionStorage.setItem(not,i),MN=i):MN=sessionStorage.getItem(not)??"",i){const a=r.toString();window.history.replaceState(null,"",window.location.pathname+(a?`?${a}`:"")+window.location.hash)}return MN}function BDr(t){const e=NDr();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 $Dr="";function FDr(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 zDr(t,e){if(e.startsWith("data:")||e.startsWith("blob:")||/^https?:/.test(e))return e;const r=FDr(e);if(!r)return e;const n=`${r}/content`;return BDr(`${$Dr}${n}`)}function hde(t=""){return t.startsWith("image/")?"image":t.startsWith("video/")?"video":t==="application/pdf"?"pdf":t==="text/markdown"?"markdown":"text"}function iot(t){var r,n,i,a;const e=hde(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 aot(t){return t?t<1024?`${t} B`:t<1024*1024?`${Math.round(t/1024)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`:""}function oot(t,e){return t.previewUrl?t.previewUrl:t.data?`data:${t.mimeType??"application/octet-stream"};base64,${t.data}`:t.uri?zDr(e,t.uri):""}function UDr({kind:t}){return t==="image"?H.jsx(kdr,{}):t==="video"?H.jsx(Odr,{}):t==="pdf"?H.jsx(Cdr,{}):H.jsx(yje,{})}function VDr({appName:t,items:e,compact:r=!1,onRemove:n}){const{t:i}=ca("conversation"),[a,o]=j.useState(null);return H.jsxs(H.Fragment,{children:[H.jsx("div",{className:`media-grid${r?" media-grid--compact":""}`,children:e.map(s=>{const l=hde(s.mimeType),u=oot(s,t),h=s.status==="uploading"||s.status==="error"||!u,d=H.jsxs("button",{type:"button",className:"media-card-main",disabled:h,onClick:l==="image"?void 0:()=>o(s),"aria-label":i("media.preview",{name:s.name??i("media.attachment")}),children:[l==="image"&&u?H.jsx("img",{className:"media-card-image",src:u,alt:s.name??i("media.image"),loading:"lazy"}):l==="video"&&u?H.jsxs("div",{className:"media-card-video-container",children:[H.jsx("video",{className:"media-card-video",src:u,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),H.jsx("span",{className:"media-card-video-play",children:H.jsx(Edr,{})})]}):H.jsx("span",{className:"media-card-icon",children:H.jsx(UDr,{kind:l})}),H.jsxs("span",{className:"media-card-copy",children:[H.jsx("span",{className:"media-card-name",children:s.name??i("media.attachment")}),H.jsxs("span",{className:"media-card-meta",children:[H.jsx("span",{className:"media-card-type",children:iot(s)}),s.status==="uploading"?H.jsxs(H.Fragment,{children:[H.jsx(qv,{className:"media-card-spinner"})," ",i("media.uploading")]}):s.status==="error"?s.error??i("media.uploadFailed"):aot(s.sizeBytes)]})]}),!r&&s.status!=="uploading"&&s.status!=="error"?H.jsx(nQ,{className:"media-card-open"}):null]});return H.jsxs(TA.div,{className:`media-card media-card--${l}${s.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?H.jsx(ztt,{src:u,children:d}):d,n?H.jsx("button",{type:"button",className:"media-card-remove","aria-label":i("media.remove",{name:s.name??i("media.attachment")}),onClick:()=>n(s.id),children:H.jsx(vE,{})}):null]},s.id)})}),H.jsx(Idr,{children:a?H.jsx(QDr,{appName:t,item:a,onClose:()=>o(null)}):null})]})}function QDr({appName:t,item:e,onClose:r}){const{t:n}=ca("conversation"),i=j.useMemo(()=>oot(e,t),[t,e]),a=hde(e.mimeType),[o,s]=j.useState(""),[l,u]=j.useState(a==="text"||a==="markdown"),[h,d]=j.useState("");return j.useEffect(()=>{const f=p=>{p.key==="Escape"&&r()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[r]),j.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(s).catch(p=>{f.signal.aborted||d(p instanceof Error?p.message:String(p))}).finally(()=>{f.signal.aborted||u(!1)}),()=>f.abort()},[a,i]),H.jsx(TA.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:H.jsxs(TA.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:[H.jsxs("header",{className:"media-viewer-header",children:[H.jsxs("div",{children:[H.jsx("strong",{children:e.name??n("media.attachment")}),H.jsxs("span",{children:[iot(e),e.sizeBytes?` · ${aot(e.sizeBytes)}`:""]})]}),H.jsxs("nav",{children:[H.jsx("a",{href:i,download:e.name,"aria-label":n("media.download"),children:H.jsx(ile,{})}),H.jsx("button",{type:"button",onClick:r,"aria-label":n("media.close"),children:H.jsx(vE,{})})]})]}),H.jsxs("div",{className:`media-viewer-body media-viewer-body--${a}`,children:[a==="image"?H.jsx("img",{src:i,alt:e.name??n("media.image")}):null,a==="video"?H.jsx("div",{className:"media-viewer-video-wrapper",children:H.jsx("video",{src:i,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,a==="pdf"?H.jsx("iframe",{src:i,title:e.name??"PDF"}):null,l?H.jsxs("div",{className:"media-viewer-loading",children:[H.jsx(qv,{})," ",n("media.reading")]}):null,!l&&h?H.jsx("div",{className:"media-viewer-loading",children:n("media.loadFailed",{error:h})}):null,!l&&a==="markdown"?H.jsx("div",{className:"media-document",children:H.jsx(tH,{text:o})}):null,!l&&a==="text"?H.jsx("pre",{className:"media-document media-document--plain",children:o}):null]})]})})}function GDr({definition:t,label:e,done:r,open:n,onToggle:i}){const{t:a}=ca("conversation"),o=t.icon,s=r?t.doneLabel:t.runningLabel,l=e??a(`blocks.tools.${t.name}.${r?"done":"running"}`,{defaultValue:s});return H.jsxs("button",{type:"button",className:`builtin-tool-head${r?" is-done":" is-running"}`,"data-tool-tone":t.tone,onClick:i,"aria-expanded":n,children:[H.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:H.jsx(o,{})}),r?H.jsx("span",{className:"builtin-tool-label",children:l}):H.jsx(ym,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:l}),H.jsx(FE,{className:`builtin-tool-chevron${n?" is-open":""}`})]})}function Pd(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function tn(t){return typeof t=="string"?t:""}function sot(t){return typeof t=="number"&&Number.isFinite(t)?t:0}function Wf(t){return Array.isArray(t)?t:[]}function dde(t){let e=t;if(typeof e=="string")try{e=JSON.parse(e)}catch{return{}}const r=Pd(e)??{};return Pd(r.result)??r}function rH(t){if(typeof t=="string")try{return rH(JSON.parse(t))}catch{return t}const e=Pd(t);if(!e)return"";const r=Pd(e.result);return tn(e.error)||tn(e.message)||tn(r==null?void 0:r.error)||tn(r==null?void 0:r.message)}function HDr(t){if(t.kind==="tool")return"tool";if(t.kind==="knowledge_base")return"knowledge_base";const e=Pd(t.metadata),r=tn(e==null?void 0:e.source_type).toLowerCase(),n=tn(t.source).toLowerCase();return r==="skillhub"||n.startsWith("skill_hub:")?"skill_hub":"skill_space"}const lot={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function WDr(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 YDr(t){return t==="veadk_builtin_tools"?"tool":t==="agentkit_knowledge"?"knowledge_base":t.startsWith("skill_hub:")?"skill_hub":"skill_space"}function qDr(t,e=lot){const r=dde(t),n=Pd(r.capabilities)??{},i=Wf(r.resources).flatMap(o=>{const s=Pd(o);if(!s)return[];const l=s.kind==="tool"?"tool":s.kind==="knowledge_base"?"knowledge_base":"skill";return[{ref:tn(s.ref),kind:l,category:HDr(s),name:tn(s.name)||tn(s.ref)||e.unnamedResource,description:tn(s.description),source:tn(s.source),version:tn(s.version)}]}),a=Wf(r.sources).flatMap(o=>{const s=Pd(o);if(!s)return[];const l=tn(s.source),u=tn(s.status),h=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:l,category:YDr(l),label:WDr(l,e),status:h,count:sot(s.count),message:tn(s.message),searchKeywords:Wf(s.search_keywords).map(tn).filter(Boolean)}]});return{collectionId:tn(r.collection_id),capabilities:{googleAdkVersion:tn(n.google_adk_version),agentTypes:Wf(n.agent_types).map(tn).filter(Boolean),maxOrchestrationDepth:sot(n.max_orchestration_depth)},resources:i,sources:a,counts:{all:i.length,skill_hub:i.filter(o=>o.category==="skill_hub").length,skill_space:i.filter(o=>o.category==="skill_space").length,knowledge_base:i.filter(o=>o.category==="knowledge_base").length,tool:i.filter(o=>o.category==="tool").length}}}function jDr(t,e){return{resources:t.resources.filter(r=>r.category===e),sources:t.sources.filter(r=>r.category===e)}}function cot(t,e,r=lot){const n=dde(t),i=dde(e),a=new Map(Wf(i.results).flatMap(h=>{const d=Pd(h),f=tn(d==null?void 0:d.name);return d&&f?[[f,d]]:[]})),o=Wf(n.agents).flatMap(h=>{const d=Pd(h),f=tn(d==null?void 0:d.name);return d&&f?[d]:[]}),s=new Set(o.map(h=>tn(h.name))),l=[...a.entries()].filter(([h])=>!s.has(h)).map(([h])=>({name:h})),u=[...o,...l].map(h=>{const d=tn(h.name),f=Wf(h.nodes).flatMap(T=>{const C=Pd(T);return C?[C]:[]}),p=tn(h.root_node),g=f.find(T=>tn(T.id)===p),m=f.filter(T=>tn(T.id)!==p).map(T=>({id:tn(T.id)||r.unnamedAgent,type:tn(T.type)||"llm",description:tn(T.description)})),v=a.get(d),y=tn(v==null?void 0:v.status),b=y==="failed"?"failed":y==="completed"?"completed":"running",x=uot(v==null?void 0:v.resources),w=x.length>0?x:uot(f.flatMap(T=>Wf(T.resources))),A=hot(v==null?void 0:v.python_tools),S=A.length>0?A:hot(f.flatMap(T=>Wf(T.python_tools)));return{name:d,description:tn(v==null?void 0:v.description)||tn(g==null?void 0:g.description)||tn(h.task),task:tn(h.task),rootType:tn(v==null?void 0:v.root_type)||tn(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:tn(v==null?void 0:v.output),error:tn(v==null?void 0:v.error)}});return{collectionId:tn(i.collection_id)||tn(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 XDr(t,e){return!!rH(e)||cot(t,e).failedCount>0}function uot(t){const e=new Set;return Wf(t).flatMap(r=>{const n=Pd(r),i=tn(n?n.ref:r);if(!i||e.has(i))return[];e.add(i);const a=tn(n==null?void 0:n.kind),o=a==="tool"||i.startsWith("veadk_tool:")?"tool":a==="knowledge_base"||i.startsWith("agentkit_kb:")?"knowledge_base":"skill",s=i.split(":");return[{ref:i,kind:o,name:tn(n==null?void 0:n.name)||s[s.length-1]||i,description:tn(n==null?void 0:n.description),version:tn(n==null?void 0:n.version),source:tn(n==null?void 0:n.source)}]})}function hot(t){const e=new Set;return Wf(t).flatMap(r=>{const n=Pd(r),i=tn(n==null?void 0:n.name),a=tn(n==null?void 0:n.code),o=`${i}\0${a}`;return!n||!i||e.has(o)?[]:(e.add(o),[{name:i,description:tn(n.description),code:a,entrypoint:tn(n.entrypoint)||i,dependencies:Wf(n.dependencies).map(tn).filter(Boolean)}])})}const KDr=t=>{const e=j.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},fde=t=>{const e=KDr(t),r=j.Children.count(e);return j.Children.map(e,n=>{if(typeof n=="string"&&n.trim())return r<=1?n:H.jsx("span",{children:n});if(j.isValidElement(n)){const i=n,{children:a,...o}=i.props;return a!=null?j.cloneElement(i,o,fde(a)):i}return n})},ZDr={Badge:"_Badge_1viyg_1"},Cx=({children:t,className:e,variant:r="soft",color:n="secondary",size:i="sm",pill:a,...o})=>H.jsx("div",{className:r_(ZDr.Badge,e),"data-color":n,"data-size":i,"data-pill":a?"":void 0,"data-variant":r,...o,children:fde(t)});j.createContext(null);const JDr={LoadingIndicator:"_LoadingIndicator_7yl6f_1"},eLr=({className:t,size:e,strokeWidth:r,style:n,...i})=>H.jsx("div",{...i,className:r_(JDr.LoadingIndicator,t),style:n||Jat({"indicator-size":e,"indicator-stroke":r})});function tLr(t){return e=>{t.forEach(r=>{typeof r=="function"?r(e):r!=null&&(r.current=e)})}}const rLr=()=>Xat,dot=(t,e=!1,r="TransitionGroup")=>{const n=[];return j.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},f_=()=>{},p_=t=>{const e=j.useRef(t);return e.current=t,j.useCallback(r=>e.current(r),[])};function nLr(t,e,r,n){const i=t.reduce((l,u)=>({...l,[u.key]:1}),{}),a=e.reduce((l,u)=>({...l,[u.component.key]:1}),{}),o=t.filter(l=>!a[l.key]).map(r),s=e.map(l=>({...l,component:t.find(({key:u})=>u===l.component.key)||l.component,shouldRender:!!i[l.component.key]}));return n==="append"?s.concat(o):o.concat(s)}function iLr(t,e,r){if((Xat||SDr)&&e&&r>1)throw new Error(`Cannot use forwardRef with multiple children in <${t} />`)}const aLr={TransitionGroupChild:"_TransitionGroupChild_1hv1z_1"},fot={enter:!1,enterActive:!1,exit:!1,exitActive:!1,interrupted:!1},oLr=t=>({...fot,enter:!t}),sLr=(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 fot}},lLr=({ref:t,as:e,children:r,className:n,transitionId:i,style:a,preventMountTransition:o,shouldRender:s,enterDuration:l,exitDuration:u,removeChild:h,onEnter:d,onEnterActive:f,onEnterComplete:p,onExit:g,onExitActive:m,onExitComplete:v})=>{const[y,b]=j.useReducer(sLr,oLr(o||!1)),x=j.useRef(!1),w=j.useRef(null),A=j.useRef(l);A.current=l;const S=j.useRef(u);S.current=u;const T=j.useRef(null),C=j.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 pIe.useLayoutEffect(()=>{if(!s){let _;b({type:"exit-before"}),C("exit");const P=sde(()=>{b({type:"exit-active"}),C("exit-active"),_=window.setTimeout(()=>{C("exit-complete"),h()},S.current)});return()=>{P(),_!==void 0&&clearTimeout(_)}}if(o&&!x.current){x.current=!0;return}let k;b({type:"enter-before"}),C("enter");const E=sde(()=>{b({type:"enter-active"}),C("enter-active"),k=window.setTimeout(()=>{b({type:"done"}),C("enter-complete")},A.current)});return()=>{E(),k!==void 0&&clearTimeout(k)}},[s,o,h,C]),j.useEffect(()=>()=>{x.current=!1},[]),H.jsx(e,{ref:tLr([w,t]),className:r_(n,aLr.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})},cLr=t=>{const{enterMountDelay:e,preventMountTransition:r}=t,n=!r&&e!=null?e:null,[i,a]=j.useState(n==null);return jat(()=>a(!0),i?null:n),i?H.jsx(lLr,{...t}):null},pot=t=>{const{ref:e,as:r="span",children:n,className:i,transitionId:a,style:o,enterDuration:s=0,exitDuration:l=0,preventInitialTransition:u=!0,enterMountDelay:h,insertMethod:d="append",disableAnimations:f=rLr()}=t,p=p_(t.onEnter??f_),g=p_(t.onEnterActive??f_),m=p_(t.onEnterComplete??f_),v=p_(t.onExit??f_),y=p_(t.onExitActive??f_),b=p_(t.onExitComplete??f_);j.Children.forEach(n,S=>{if(S&&!S.key)throw new Error("Child elements of must include a `key`")});const x=j.useCallback(S=>({component:S,shouldRender:!0,removeChild:()=>{A(T=>T.filter(C=>S.key!==C.component.key))},onEnter:p,onEnterActive:g,onEnterComplete:m,onExit:v,onExitActive:y,onExitComplete:b}),[p,g,m,v,y,b]),[w,A]=j.useState(()=>dot(n).map(S=>({...x(S),preventMountTransition:u})));return j.useLayoutEffect(()=>{A(S=>{const T=dot(n);return nLr(T,S,x,d)})},[n,d,x]),iLr("TransitionGroup",e,j.Children.count(n)),f?H.jsx(H.Fragment,{children:j.Children.map(n,S=>H.jsx(r,{ref:e,className:i,style:o,"data-transition-id":a,children:S}))}):H.jsx(H.Fragment,{children:w.map(({component:S,...T})=>H.jsx(cLr,{...T,as:r,className:i,transitionId:a,enterDuration:s,exitDuration:l,enterMountDelay:h,style:o,ref:e,children:S},S.key))})},pde={Button:"_Button_1864l_1",ButtonInner:"_ButtonInner_1864l_4",ButtonLoader:"_ButtonLoader_1864l_749"},uLr=t=>{const{type:e="button",color:r="primary",variant:n="solid",pill:i=!0,uniform:a=!1,size:o="md",iconSize:s,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=j.useCallback(S=>{v||m==null||m(S)},[m,v]);return H.jsxs("button",{type:e,className:r_(pde.Button,g),"data-color":r,"data-variant":n,"data-pill":i?"":void 0,"data-uniform":a?"":void 0,"data-size":o,"data-gutter-size":l,"data-icon-size":s,"data-loading":u?"":void 0,"data-selected":h?"":void 0,"data-block":d?"":void 0,"data-optically-align":f,onPointerEnter:Zat,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:[H.jsx(pot,{className:pde.ButtonLoader,enterDuration:250,exitDuration:150,children:u&&H.jsx(eLr,{},"loader")}),H.jsx("span",{className:pde.ButtonInner,children:fde(p)})]})},hLr=t=>H.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...t,children:H.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"})}),dLr=t=>H.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...t,children:H.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"})}),fLr=t=>H.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...t,children:H.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 pLr({branch:t}){return H.jsxs("div",{className:`branch-compare__body${t.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[t.content?H.jsx(tH,{text:t.content,streaming:t.status==="running"}):null,t.status==="running"?H.jsx("span",{className:"branch-compare__caret","aria-hidden":"true"}):null,t.error?H.jsx("p",{className:"branch-compare__error",children:t.error}):null]})}function gLr({args:t,response:e,status:r,onBranchSelect:n}){const{t:i}=ca("conversation"),a=j.useMemo(()=>nje(t,e,r),[t,e,r]),[o,s]=j.useState(0);return H.jsxs("section",{className:"branch-compare","aria-label":i("blocks.branchCompare.ariaLabel"),children:[H.jsx("div",{className:"branch-compare__tabs",role:"tablist","aria-label":i("blocks.branchCompare.selectDirection"),children:a.branches.map((l,u)=>H.jsx("button",{className:`branch-compare__tab${o===u?" is-active":""}`,type:"button",role:"tab","aria-selected":o===u,"aria-controls":`branch-compare-panel-${u}`,onClick:()=>s(u),children:H.jsx(Cx,{color:"info",size:"sm",variant:"soft",children:l.label})},`${l.label}:${u}`))}),H.jsx("div",{className:"branch-compare__branches",children:a.branches.map((l,u)=>H.jsxs("article",{className:`branch-compare__branch${o===u?" is-active":""}`,id:`branch-compare-panel-${u}`,role:"tabpanel",children:[H.jsx("header",{className:"branch-compare__head",children:H.jsx(Cx,{color:"info",size:"sm",variant:"soft",children:l.label})}),H.jsx(pLr,{branch:l}),H.jsx("footer",{className:"branch-compare__footer",children:H.jsx(uLr,{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 got({controlled:t,default:e,name:r,state:n="value"}){const{current:i}=j.useRef(t!==void 0),[a,o]=j.useState(e),s=i?t:a,l=j.useCallback(u=>{i||o(u)},[]);return[s,l]}const mot=j.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function mLr(){return j.useContext(mot)}function vLr(t){const{children:e,elementsRef:r,labelsRef:n,onMapChange:i}=t,a=Pn(i),[,o]=j.useState(!1),s=Kp(bLr).current,l=Kp(yLr).current,u=j.useRef(0),h=j.useRef(!0),d=j.useRef([]),f=j.useRef(null),p=Pn(()=>{h.current||(h.current=!0,o(A=>!A))}),g=Pn((A,S)=>{l.set(A,S),p()}),m=Pn(A=>{l.delete(A),p()}),v=Pn(A=>{const S=new Map;return r.current.length=0,n&&(n.current.length=0),A.forEach(T=>{var C,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=(C=T.registration.textRef)==null?void 0:C.current)==null?void 0:k.textContent)??T.element.textContent)}),u.current=r.current.length,S});function y(A){var C;if((C=f.current)==null||C.disconnect(),f.current=null,typeof MutationObserver!="function"||A.length<2)return;const S=new MutationObserver(k=>{if(!ALr(k))return;let E=null;for(const _ of A)if(_.isConnected){if(E&&vot(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=Pn(()=>{const[A,S]=xLr(l),T=v(A);y(S),d.current=A,h.current=!1,s.forEach(C=>C(T)),a(T)});Bn(()=>(h.current||v(d.current),()=>{r.current=[],n&&(n.current=[])}),[r,n,v]),Bn(()=>{h.current&&b()}),Bn(()=>()=>{var A;(A=f.current)==null||A.disconnect(),h.current=!0},[]);const x=Pn(A=>(s.add(A),()=>{s.delete(A)})),w=j.useMemo(()=>({register:g,unregister:m,subscribeMapChange:x,nextIndexRef:u}),[g,m,x,u]);return H.jsx(mot.Provider,{value:w,children:e})}function yLr(){return new Map}function bLr(){return new Set}function xLr(t){const e=new Set,r=[],n=[];t.forEach((a,o)=>{if(!o.isConnected)return;const s=a.index,l={index:s??-1,element:o,registration:a};s===null?n.push(l):s>=0&&(e.add(s),r.push(l))});let i=0;return n.sort((a,o)=>vot(a.element,o.element)),n.forEach(a=>{for(;e.has(i);)i+=1;a.index=i,r.push(a),i+=1}),e.size>0&&r.sort((a,o)=>a.index-o.index),[r,n.map(a=>a.element)]}function wLr(t,e){let r=t.parentElement;for(;r&&!r.contains(e);)r=r.parentElement;return r}function ALr(t){for(const e of t)for(let r=0;rnull},xot=j.forwardRef(function(e,r){const{render:n,className:i,disabled:a=!1,hiddenUntilFound:o,keepMounted:s,loopFocus:l,onValueChange:u,multiple:h=!1,orientation:d="vertical",value:f,defaultValue:p,style:g,...m}=e,v=j.useMemo(()=>{if(f===void 0)return p??[]},[f,p]),y=j.useRef([]),[b,x]=got({controlled:f,default:v,name:"Accordion",state:"value"}),w=Pn((C,k,E)=>{if(h)if(k){const _=b.slice();if(_.push(C),u==null||u(_,E),E.isCanceled)return;x(_)}else{const _=b.filter(P=>P!==C);if(u==null||u(_,E),E.isCanceled)return;x(_)}else{const _=b[0]===C?[]:[C];if(u==null||u(_,E),E.isCanceled)return;x(_)}}),A=j.useMemo(()=>({value:b,disabled:a,orientation:d}),[b,a,d]),S=j.useMemo(()=>({disabled:a,handleValueChange:w,hiddenUntilFound:o??!1,keepMounted:s??!1,state:A,value:b}),[a,w,o,s,A,b]),T=eg("div",e,{state:A,ref:r,props:m,stateAttributesMapping:SLr});return H.jsx(yot.Provider,{value:S,children:H.jsx(vLr,{elementsRef:y,children:T})})});function TLr(t){const{open:e,defaultOpen:r,onOpenChange:n,disabled:i}=t,[a,o]=got({controlled:e,default:r,name:"Collapsible",state:"open"}),{mounted:s,setMounted:l,transitionStatus:u}=PJe(a,!0,!0),h=$E(),[d,f]=j.useState(),p=d===null?void 0:d??h,g=Pn(m=>{const v=!a,y=_s(LE,m.nativeEvent);n(v,y),!y.isCanceled&&o(v)});return j.useMemo(()=>({defaultPanelId:h,disabled:i,handleTrigger:g,mounted:s,open:a,panelId:p,setMounted:l,setOpen:o,setPanelIdState:f,transitionStatus:u}),[h,i,g,s,a,p,l,o,f,u])}const wot=j.createContext(void 0);function Aot(){const t=j.useContext(wot);if(t===void 0)throw new Error(iy(15));return t}function CLr(t={}){const{guess:e,label:r,metadata:n,textRef:i,index:a}=t,{register:o,unregister:s,subscribeMapChange:l,nextIndexRef:u}=mLr(),h=j.useRef(-1),[d,f]=j.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=j.useRef(null),m=j.useCallback(v=>{const y=g.current;y&&s(y),g.current=v,v&&o(v,{metadata:n??null,index:a??null,label:r,textRef:i})},[a,o,s,n,r,i]);return Bn(()=>{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 Sot=j.createContext(void 0);function gde(){const t=j.useContext(Sot);if(t===void 0)throw new Error(iy(9));return t}let mde=function(t){return t.open="data-open",t.closed="data-closed",t[t.startingStyle=JQ.startingStyle]="startingStyle",t[t.endingStyle=JQ.endingStyle]="endingStyle",t}({}),OLr=function(t){return t.panelOpen="data-panel-open",t}({});const kLr={[mde.open]:""},ELr={[mde.closed]:""},_Lr={open(t){return t?{[OLr.panelOpen]:""}:null}},RLr={open(t){return t?kLr:ELr}};let DLr=function(t){return t.index="data-index",t.disabled="data-disabled",t.open="data-open",t}({});const vde={...RLr,index:t=>({[DLr.index]:String(t)}),...HJe,value:()=>null},Tot=j.forwardRef(function(e,r){const{className:n,disabled:i=!1,onOpenChange:a,render:o,value:s,style:l,...u}=e,{ref:h,index:d}=CLr(),f=ME(r,h),{disabled:p,handleValueChange:g,state:m,value:v}=bot(),y=$E(),b=s??y,x=i||p,w=v.indexOf(b)!==-1,A=Pn((M,I)=>{a==null||a(M,I),!I.isCanceled&&g(b,M,I)}),S=TLr({open:w,onOpenChange:A,disabled:x}),T=j.useMemo(()=>({open:S.open,disabled:S.disabled,transitionStatus:S.transitionStatus}),[S.open,S.disabled,S.transitionStatus]),C=j.useMemo(()=>({...S,onOpenChange:A,state:T}),[S,T,A]),k=j.useMemo(()=>({...m,hidden:!w&&!S.mounted,index:d,disabled:x,open:w}),[S.mounted,x,d,w,m]),E=$E(),[_,P]=j.useState(),L=_===null?void 0:_??E,R=j.useMemo(()=>({defaultTriggerId:E,open:w,state:k,setTriggerId:P,triggerId:L}),[E,w,k,P,L]),D=eg("div",e,{state:k,ref:f,props:u,stateAttributesMapping:vde});return H.jsx(wot.Provider,{value:C,children:H.jsx(Sot.Provider,{value:R,children:D})})}),Cot=j.forwardRef(function(e,r){const{render:n,className:i,style:a,...o}=e,{state:s}=gde();return eg("h3",e,{state:s,ref:r,props:o,stateAttributesMapping:vde})}),Oot=j.forwardRef(function(e,r){const{disabled:n,className:i,id:a,render:o,nativeButton:s=!0,style:l,...u}=e,{panelId:h,open:d,handleTrigger:f,disabled:p}=Aot(),g=n||p,{getButtonProps:m,buttonRef:v}=GJe({disabled:g,focusableWhenDisabled:!0,native:s}),{defaultTriggerId:y,state:b,setTriggerId:x}=gde(),w=a||void 0,A=w??y;return Bn(()=>(x(C=>w??(C===null?void 0:C)),()=>{x(C=>C===w?null:C)}),[w,x]),eg("button",e,{state:b,ref:[r,v],props:[{"aria-controls":d?h:void 0,"aria-expanded":d,id:A,onClick:f},u,m],stateAttributesMapping:_Lr})}),IN={height:void 0,width:void 0};function LLr(t){const{externalRef:e,hiddenUntilFound:r,id:n,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:l,setOpen:u,transitionStatus:h}=t,d=j.useRef(null),f=j.useRef(null),[p,g]=j.useState(IN),m=j.useRef(IN),v=j.useRef(!1),y=j.useRef(s),b=j.useRef(!1),[x,w]=j.useState(!1),A=j.useRef(null),S=ME(e,d),T=Tu(s),C=Zce(d),k=!s&&!a,E=x?"idle":h,_=s&&(y.current||b.current),P=!s&&a&&f.current==="css-animation"&&p.height===void 0&&p.width===void 0?m.current:p,L=r&&k&&f.current!=="css-animation",R=Pn((F,B=!0)=>{B&&(m.current=F),g(F)}),D=Pn(()=>{var F;(F=A.current)==null||F.call(A),A.current=null}),M=Pn(F=>{D(),A.current=()=>{A.current=null,F()}}),I=Pn(()=>{s&&a&&f.current==="css-animation"&&(b.current=!0)});Bn(()=>{!x||h==="starting"||w(!1)},[x,h]),j.useEffect(()=>()=>{I(),D()},[I,D]),Bn(()=>{const F=d.current;if(!F)return;!s&&A.current&&D();const B=MLr(F,_);if(f.current=B,s&&h==="idle"&&y.current&&B==="css-animation"){m.current=g_(F);return}if(s&&h==="starting"){const U=v.current;if(v.current=!1,B==="none"){R(g_(F)),w(!0);return}if(B==="css-transition"){const q=ILr(F);if(R(g_(F)),!U)return q;const Y=nH(F,"transition-duration","0s");return M(Y),w(!0),q}R(g_(F));const Q=nH(F,"animation-name","none");if(!U){Q();return}const G=nH(F,"animation-duration","0s");Q(),M(G),w(!0);return}if(!s&&a&&(h==="idle"||h==="starting")){if(y.current=!1,b.current=!1,B==="none"){R(IN,!1),l(!1);return}R(g_(F));return}if(h!=="ending")return;if(B==="none"){l(!1);return}const V=g_(F);if(!(V.height>0||V.width>0)){l(!1);return}R(V),B==="css-animation"&&nH(F,"animation-name","none")()},[a,s,D,R,l,M,_,h]),Jce({enabled:s&&a&&E==="idle",open:!0,ref:d,onComplete(){s&&R(IN,!1)}}),j.useEffect(()=>{if(s||!a||E!=="ending"||!d.current)return;const B=new AbortController;let V=-1;function z(){T.current||(l(!1),R(IN,!1))}return V=Lh.request(()=>{C(z,B.signal)}),()=>{Lh.cancel(V),B.abort()}},[T,a,s,E,C,R,l]),Bn(()=>{const F=d.current;!F||!r||!k||F.setAttribute("hidden","until-found")},[k,r]),j.useEffect(function(){const B=d.current;if(!B)return;function V(z){const U=_s(xZe,z);o(!0,U),!U.isCanceled&&(v.current=!0,u(!0))}return bi(B,"beforematch",V)},[o,u]);const N=i||r||a||s;return{height:P.height,props:{...L?{[mde.startingStyle]:""}:void 0,hidden:k,id:n},ref:S,shouldPreventOpenAnimation:_,shouldRender:N,transitionStatus:E,width:P.width}}function g_(t){return{height:t.scrollHeight,width:t.scrollWidth}}function MLr(t,e){const r=cs(t).getComputedStyle(t),n=(r.animationName.split(",").map(a=>a.trim()).some(a=>a!==""&&a!=="none")||e)&&kot(r.animationDuration),i=kot(r.transitionDuration);return n&&i||i?"css-transition":n?"css-animation":"none"}function kot(t){return t.split(",").map(e=>e.trim()).some(e=>e!==""&&Number.parseFloat(e)>0)}function nH(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 ILr(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=Lh.request(r);return()=>{Lh.cancel(n),r()}}let Eot=function(t){return t.accordionPanelHeight="--accordion-panel-height",t.accordionPanelWidth="--accordion-panel-width",t}({});const _ot=j.forwardRef(function(e,r){const{className:n,hiddenUntilFound:i,keepMounted:a,id:o,render:s,style:l,...u}=e,{hiddenUntilFound:h,keepMounted:d}=bot(),{defaultPanelId:f,mounted:p,onOpenChange:g,open:m,setMounted:v,setOpen:y,setPanelIdState:b,transitionStatus:x}=Aot(),w=i??h,A=a??d,S=o||void 0,T=o??f;Bn(()=>(b(B=>S??(B===null?void 0:B)),()=>{b(B=>B===S?null:B)}),[S,b]);const{height:C,props:k,ref:E,shouldPreventOpenAnimation:_,shouldRender:P,transitionStatus:L,width:R}=LLr({externalRef:r,hiddenUntilFound:w,id:T,keepMounted:A,mounted:p,onOpenChange:g,open:m,setMounted:v,setOpen:y,transitionStatus:x}),{state:D,triggerId:M}=gde(),I={...D,transitionStatus:L},N=jZe(l,I),F=eg("div",{...e,style:void 0},{state:I,ref:E,props:[k,{"aria-labelledby":M,role:"region",style:{[Eot.accordionPanelHeight]:C===void 0?"auto":`${C}px`,[Eot.accordionPanelWidth]:R===void 0?"auto":`${R}px`}},u,N?{style:N}:void 0,_?{style:{animationName:"none"}}:void 0],stateAttributesMapping:vde});return P?F:null});function yde(t){const e=j.useRef(t);return e.current=t,e}let m_=[],iH=!1;const Rot=t=>{var e,r;if(t.key==="Escape"){const[n]=m_;n&&(t.preventDefault(),(r=(e=n.callback).current)==null||r.call(e))}},Dot=()=>{m_.length>0&&!iH?(document.body.addEventListener("keydown",Rot),iH=!0):m_.length===0&&iH&&(document.body.removeEventListener("keydown",Rot),iH=!1)},PLr=t=>{m_.unshift(t),Dot()},NLr=({id:t})=>{m_=m_.filter(e=>e.id!==t),Dot()},BLr=(t,e)=>{const r=j.useId(),n=yde(e);j.useEffect(()=>{if(!t)return;const i={id:r,callback:n};return PLr(i),()=>NLr(i)},[r,t,n])},$Lr=(t,e)=>{const r=t.currentTarget,n={x:t.clientX,y:t.clientY},i=FLr(n,r.getBoundingClientRect()),a=zLr(n,i),o=ULr(e.getBoundingClientRect());return QLr([...a,...o])};function FLr(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 zLr(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 ULr(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 VLr(t,e){const{x:r,y:n}=t;let i=!1;for(let a=0,o=e.length-1;an!=f>n&&r<(d-u)*(n-h)/(f-h)+u&&(i=!i)}return i}function QLr(t){const e=t.slice();return e.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),GLr(e)}function GLr(t){if(t.length<=1)return t.slice();const e=[];for(let n=0;n=2;){const a=e[e.length-1],o=e[e.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.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],o=r[r.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.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 Lot={Transition:"_Transition_1wdpp_1",Popover:"_Popover_1wdpp_3"},Mot=j.createContext(null),aH=()=>{const t=j.use(Mot);if(!t)throw new Error("Popover components must be wrapped in ");return t},PN=({open:t,onOpenChange:e,showOnHover:r=!1,hoverOpenDelay:n=150,children:i})=>{const[a,o]=j.useState(!1),[s,l]=j.useState(!1),u=j.useRef(null),h=j.useRef(null),d=j.useRef(void 0),f=j.useRef(!1),p=j.useRef(!1),g=t??a,[m,v]=j.useState(!1);jat(()=>v(!1),m?500:null);const y=yde(e),b=yde(T=>{var C,k;clearTimeout(d.current),g!==T&&(T||(l(!1),r&&f.current&&((C=u.current)==null||C.focus()),f.current=!1),(k=y.current)==null||k.call(y,T),o(T),r&&v(T))}),x=j.useCallback(T=>{b.current(T)},[b]),w=j.useCallback(()=>{d.current=setTimeout(()=>x(!0),n)},[x,n]),A=j.useCallback(()=>{clearTimeout(d.current)},[]);j.useEffect(()=>()=>{clearTimeout(d.current)},[]);const S=j.useMemo(()=>({open:g,setOpen:x,shake:s,setShake:l,showOnHover:r,temporarilyPreventClickToClose:m,onTriggerEnter:w,onTriggerLeave:A,isPointerInTransitRef:p,triggerRef:u,contentRef:h,hoverOpenFocusedWithTab:f}),[g,x,s,l,r,m,f,p,w,A]);return H.jsx(Mot,{value:S,children:H.jsx(rDr,{open:g,onOpenChange:x,modal:!1,children:i})})},HLr=({children:t,onPointerDown:e,onClick:r})=>{const{setOpen:n,showOnHover:i,temporarilyPreventClickToClose:a,onTriggerEnter:o,onTriggerLeave:s,isPointerInTransitRef:l,triggerRef:u,contentRef:h}=aH(),d=j.useRef(!1),f=m=>{!(m.currentTarget.nodeName.toLocaleLowerCase()==="a")&&a&&(m.preventDefault(),m.stopPropagation())},p=m=>{m.pointerType!=="touch"&&!d.current&&!l.current&&(o(),d.current=!0)},g=()=>{d.current&&(s(),d.current=!1)};return H.jsx(nDr,{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})},Iot=({children:t,avoidCollisions:e,width:r,minWidth:n,maxWidth:i,side:a,sideOffset:o=8,align:s,alignOffset:l,translucent:u,className:h,autoFocus:d=!0})=>{const{showOnHover:f,shake:p,contentRef:g}=aH(),m=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const b=eot(y),x=b[b.length-1];x==null||x.focus()}};return j.useEffect(()=>{const v=g.current;!v||!d||v!=null&&v.contains(document.activeElement)||f||v.focus({preventScroll:!0})},[g,f,d]),H.jsx(aDr,{forceMount:!0,ref:g,className:r_(Lot.Popover,h),style:Jat({"popover-width":r,"popover-min-width":n,"popover-max-width":i}),onCloseAutoFocus:f?lde:void 0,"data-animate":p?"shake":void 0,"data-translucent":u?"true":void 0,side:a,sideOffset:o,align:s,alignOffset:l??(s==="center"?0:-5),avoidCollisions:e??!0,hideWhenDetached:!0,collisionPadding:20,onOpenAutoFocus:lde,onEscapeKeyDown:lde,onKeyDown:m,children:t})},WLr=t=>{const{setOpen:e,triggerRef:r,contentRef:n,isPointerInTransitRef:i,hoverOpenFocusedWithTab:a}=aH(),[o,s]=j.useState(null),l=j.useCallback(()=>{s(null),i.current=!1},[i]),u=j.useCallback((h,d)=>{const f=$Lr(h,d);s(f),i.current=!0},[i]);return j.useEffect(()=>()=>l(),[l]),j.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]),j.useEffect(()=>{if(!o)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=!VLr(m,o),b=g.hasAttribute("aria-haspopup");v?l():(y||b)&&(l(),e(!1))};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)},[o,e,l,r,n]),j.useEffect(()=>{const h=d=>{if(n.current&&d.key==="Tab"&&!d.shiftKey){const[f]=eot(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]),H.jsx(Iot,{...t})},YLr=t=>{const{open:e,showOnHover:r,setOpen:n}=aH();return BLr(e,()=>{n(!1)}),H.jsx(iDr,{forceMount:!0,children:H.jsx(pot,{enterDuration:600,exitDuration:300,className:Lot.Transition,disableAnimations:!0,children:e&&(r?H.jsx(WLr,{...t},"popover-hover"):H.jsx(Iot,{...t},"popover"))})})};PN.Trigger=HLr,PN.Content=YLr,j.createContext(null),j.createContext(null),j.createContext(null),j.createContext(null);function bde(...t){return t.filter(Boolean).join(" ")}const Pot=[["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 qLr(t){let e=2166136261;for(const o of t)e^=o.charCodeAt(0),e=Math.imul(e,16777619);const r=e>>>0,[n,i,a]=Pot[r%Pot.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 jLr({seed:t,className:e}){return H.jsx("span",{className:bde("resource-card__identity-mark",e),style:qLr(t),"aria-hidden":"true"})}j.forwardRef(function({className:e,...r},n){return H.jsx("section",{ref:n,className:bde("resource-results",e),...r})});function XLr({className:t,footer:e,actions:r,activateLabel:n,onActivate:i,children:a,...o}){return H.jsxs("article",{className:bde("resource-card",i&&"is-interactive",t),...o,children:[i&&n?H.jsx("button",{type:"button",className:"resource-card__target","aria-label":n,title:n,onClick:i}):null,H.jsx("div",{className:"resource-card__content",children:a}),e||r?H.jsxs("footer",{className:"resource-card__footer",children:[e,r?H.jsx("div",{className:"resource-card__actions",children:r}):null]}):null]})}function KLr({leading:t,title:e,titleText:r,subtitle:n,status:i}){return H.jsxs("div",{className:"resource-card__header",children:[H.jsxs("div",{className:"resource-card__identity",children:[t,H.jsxs("div",{className:"resource-card__title-copy",children:[H.jsx("h3",{title:r,children:e}),n]})]}),i]})}function ZLr({children:t,title:e}){return H.jsx("p",{className:"resource-card__description",title:e,children:t})}function JLr(t){return H.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...t,children:[H.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"}),H.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"}),H.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 eMr=["skill_hub","skill_space","knowledge_base","tool"];function Not(t){return H.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:H.jsx("path",{d:"m4 6 4 4 4-4"})})}function Bot({label:t}){return H.jsx("div",{className:"create-agent-card__loading",role:"status","aria-label":t,children:[0,1,2].map(e=>H.jsxs("div",{className:"create-agent-card__skeleton-row","aria-hidden":"true",children:[H.jsx("span",{}),H.jsx("span",{})]},e))})}function tMr(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 xde({label:t,resources:e}){const{t:r}=ca("conversation");return e.length===0?null:H.jsxs("section",{className:"create-agent-card__popover-section",children:[H.jsx("h4",{children:t}),H.jsx("div",{className:"create-agent-card__popover-list",children:e.map(n=>H.jsxs("div",{className:"create-agent-card__popover-item",children:[H.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[H.jsx("strong",{children:n.name}),H.jsx(Cx,{color:"secondary",size:"sm",variant:"soft",children:tMr(n,r)})]}),n.description?H.jsx("p",{children:n.description}):null]},n.ref))})]})}function rMr({tools:t}){const{t:e}=ca("conversation");return t.length===0?null:H.jsxs("section",{className:"create-agent-card__popover-section",children:[H.jsx("h4",{children:e("blocks.createAgents.selfAuthoredTools")}),H.jsx(xot,{children:t.map((r,n)=>H.jsxs(Tot,{className:"create-agent-card__python-tool",value:`${r.name}:${n}`,children:[H.jsx(Cot,{className:"create-agent-card__python-tool-header",children:H.jsxs(Oot,{className:"create-agent-card__python-tool-trigger",children:[H.jsxs("span",{children:[H.jsx("strong",{children:r.name}),r.description?H.jsx("small",{children:r.description}):null]}),H.jsxs("span",{className:"create-agent-card__python-tool-meta",children:[H.jsx(Cx,{color:"secondary",size:"sm",variant:"soft",children:e("blocks.createAgents.selfAuthoredTools")}),H.jsx(Not,{className:"create-agent-card__python-tool-chevron"})]})]})}),H.jsxs(_ot,{className:"create-agent-card__python-tool-panel",children:[r.dependencies.length>0?H.jsx("div",{className:"create-agent-card__python-tool-dependencies",children:e("blocks.createAgents.dependencies",{items:r.dependencies.join(", ")})}):null,H.jsx("pre",{tabIndex:0,"aria-label":e("blocks.createAgents.fullCode",{name:r.name}),children:H.jsx("code",{children:r.code})})]})]},`${r.name}:${n}`))})]})}function nMr({agents:t}){const{t:e}=ca("conversation");return t.length===0?null:H.jsxs("section",{className:"create-agent-card__popover-section",children:[H.jsx("h4",{children:e("blocks.createAgents.subAgents")}),H.jsx("div",{className:"create-agent-card__popover-list",children:t.map(r=>H.jsxs("div",{className:"create-agent-card__popover-item",children:[H.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[H.jsx("strong",{children:r.id}),H.jsx(Cx,{color:"secondary",size:"sm",variant:"soft",children:e(`blocks.createAgents.agentTypes.${r.type}`,{defaultValue:r.type})})]}),r.description?H.jsx("p",{children:r.description}):null]},r.id))})]})}function oH({label:t,count:e,icon:r,children:n}){const{t:i}=ca("conversation"),a=H.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,H.jsx("span",{children:e})]});return e===0?a:H.jsxs(PN,{showOnHover:!0,hoverOpenDelay:120,children:[H.jsx(PN.Trigger,{children:a}),H.jsx(PN.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:n})]})}function iMr({response:t,status:e}){const{t:r}=ca("conversation"),n=j.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=j.useMemo(()=>qDr(t,n),[n,t]),a=j.useMemo(()=>eMr.map(l=>{const u=jDr(i,l);return{value:l,label:r(`blocks.createAgents.categories.${l}`),...u,searchKeywords:[...new Set(u.sources.flatMap(h=>h.searchKeywords))]}}),[i,r]),o=e==="failed",s=o?rH(t):"";return H.jsx("section",{className:"create-agent-tool-card","aria-label":r("blocks.createAgents.collectionAria"),children:e==="running"?H.jsx(Bot,{label:r("blocks.createAgents.retrieving")}):o?H.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[H.jsx("span",{className:"create-agent-card__message-title",children:r("blocks.createAgents.retrievalFailed")}),H.jsx("span",{children:s||r("blocks.createAgents.checkConfig")})]}):H.jsx(xot,{className:"create-agent-card__accordion",children:a.map(l=>H.jsxs(Tot,{className:"create-agent-card__accordion-item",value:l.value,children:[H.jsx(Cot,{className:"create-agent-card__accordion-header",children:H.jsxs(Oot,{className:"create-agent-card__accordion-trigger",children:[H.jsx("span",{children:l.label}),H.jsxs("span",{className:"create-agent-card__accordion-meta",children:[H.jsx(Cx,{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}),H.jsx(Not,{className:"create-agent-card__accordion-chevron"})]})]})}),H.jsx(_ot,{className:"create-agent-card__accordion-content",children:H.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?H.jsxs("div",{className:"create-agent-card__search-keywords",children:[H.jsx("span",{children:r("blocks.createAgents.searchKeywords")}),H.jsx("span",{children:l.searchKeywords.join("、")})]}):null,l.resources.length>0?H.jsx("div",{className:"create-agent-card__resource-list",children:l.resources.map(u=>H.jsx("div",{className:"create-agent-card__resource",children:H.jsxs("div",{className:"create-agent-card__resource-main",children:[H.jsxs("div",{className:"create-agent-card__resource-title",children:[H.jsx("span",{className:"create-agent-card__resource-name",children:u.name}),u.version?H.jsx(Cx,{className:"create-agent-card__resource-version",color:"secondary",size:"sm",variant:"soft",children:u.version}):null]}),u.description?H.jsx("p",{children:u.description}):null]})},u.ref))}):H.jsxs("div",{className:"create-agent-card__empty-category",children:[H.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=>H.jsx("p",{className:"create-agent-card__raw-source-error",children:u.message},u.source))]})]})})]},l.value))},i.collectionId||"collected-resources")})}function aMr({args:t,response:e,status:r}){const{t:n}=ca("conversation"),i=j.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=j.useMemo(()=>cot(t,e,i),[t,i,e]),o=r==="failed"?rH(e):"";return H.jsxs("section",{className:"create-agent-tool-card is-agent-results","aria-label":n("blocks.createAgents.resultAria"),children:[o?H.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[H.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.creationFailed")}),H.jsx("span",{children:o})]}):null,a.agents.length>0?H.jsx("div",{className:"create-agent-card__agent-grid",children:a.agents.map(s=>{const l=r==="failed"?"failed":s.status,u=s.error||l==="failed"&&o,h=s.builtinTools.length+s.pythonTools.length;return H.jsxs(XLr,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[H.jsx(KLr,{leading:H.jsx(jLr,{seed:s.name}),title:s.name,titleText:s.name,status:H.jsx(Cx,{color:"secondary",size:"sm",variant:"soft",children:n(`blocks.createAgents.agentTypes.${s.rootType}`,{defaultValue:s.rootType})})}),s.description?H.jsx(ZLr,{children:s.description}):null,u?H.jsx("div",{className:"create-agent-card__agent-result is-error",role:"alert",children:u}):null,H.jsxs("div",{className:"create-agent-card__agent-resources","aria-label":n("blocks.createAgents.agentResources",{name:s.name}),children:[H.jsx(oH,{label:n("blocks.createAgents.skill"),count:s.skills.length,icon:H.jsx(dLr,{"aria-hidden":"true"}),children:H.jsx(xde,{label:n("blocks.createAgents.skill"),resources:s.skills})}),H.jsx(oH,{label:n("blocks.createAgents.knowledgeBase"),count:s.knowledgeBases.length,icon:H.jsx(JLr,{"aria-hidden":"true"}),children:H.jsx(xde,{label:n("blocks.createAgents.knowledgeBase"),resources:s.knowledgeBases})}),H.jsxs(oH,{label:n("blocks.createAgents.toolsLabel"),count:h,icon:H.jsx(hLr,{"aria-hidden":"true"}),children:[H.jsx(xde,{label:n("blocks.createAgents.builtinTool"),resources:s.builtinTools}),H.jsx(rMr,{tools:s.pythonTools})]}),H.jsx(oH,{label:n("blocks.createAgents.subAgents"),count:s.subAgentCount,icon:H.jsx(fLr,{"aria-hidden":"true"}),children:H.jsx(nMr,{agents:s.subAgents})})]})]},s.name)})}):r==="running"?H.jsx(Bot,{label:n("blocks.createAgents.creating")}):H.jsxs("div",{className:"create-agent-card__message",children:[H.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.noAgents")}),H.jsx("span",{children:n("blocks.createAgents.noAgentResult")})]})]})}const oMr={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:aet},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:aet},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:xbr},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:Abr},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:Sbr},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:set},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:set},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:pbr},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:gbr},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:mbr},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:vbr},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:ybr},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:bbr},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:wbr,detailRenderer:iMr},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:oet,detailRenderer:aMr},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:oet,detailRenderer:gLr,hideHeader:!0}};function sMr(t){return oMr[t]}function lMr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.jsx("path",{d:"M6 3h8l4 4v14H6Z"}),H.jsx("path",{d:"M14 3v5h5"}),H.jsx("path",{d:"m10 12-2 2 2 2M14 12l2 2-2 2"})]})}function cMr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.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"}),H.jsx("path",{d:"m9 12 2 2 4-4"})]})}$f.hasResourceBundle("en-US","workspaceTools")||$f.addResourceBundle("en-US","workspaceTools",OUe,!0,!0),$f.hasResourceBundle("zh-CN","workspaceTools")||$f.addResourceBundle("zh-CN","workspaceTools",Tqe,!0,!0);function uMr(t,e){const r=new Map(t.map(o=>[o.path,o.content])),n=new Map(e.map(o=>[o.path,o.content])),i=new Set([...r.keys(),...n.keys()]),a=[];for(const o of[...i].sort((s,l)=>s.localeCompare(l))){const s=r.get(o),l=n.get(o);s!==l&&a.push({path:o,status:s===void 0?"added":l===void 0?"deleted":"modified",before:s??"",after:l??""})}return a}function QA(t){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...t}}function hMr(t){return H.jsx("svg",{...QA(t),children:H.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function wde(t){return H.jsx("svg",{...QA(t),children:H.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function dMr(t){return H.jsx("svg",{...QA(t),children:H.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function fMr(t){return H.jsx("svg",{...QA(t),children:H.jsx("path",{d:"m9 5 7 7-7 7"})})}function pMr(t){return H.jsx("svg",{...QA(t),children:H.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function gMr(t){return H.jsxs("svg",{...QA(t),children:[H.jsx("circle",{cx:"12",cy:"12",r:"3.25"}),H.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 mMr(t){return H.jsx("svg",{...QA(t),children:H.jsx("path",{d:"M19.25 15.25A8 8 0 0 1 8.75 4.75a8 8 0 1 0 10.5 10.5Z"})})}const vMr=j.lazy(()=>Promise.resolve().then(()=>jkn)),yMr=j.lazy(()=>Promise.resolve().then(()=>kEn)),$ot="veadk-code-workspace-theme";function bMr(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,o)=>{let s=i.children.get(a);s||(s={name:a,children:new Map},i.children.set(a,s)),o===n.length-1&&(s.path=r.path),i=s})}return e}function xMr(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 wMr(){if(typeof window>"u")return"light";try{return window.localStorage.getItem($ot)==="dark"?"dark":"light"}catch{return"light"}}function AMr(t){return t===""?0:t.split(` -`).length}function Fot({project:t,open:e,onClose:r,onChange:n,readOnly:i=!1,comparison:a}){var L;const{t:o}=ca("workspaceTools"),s=j.useId(),l=j.useRef(null),u=j.useRef(null),h=j.useRef(r),[d,f]=j.useState(wMr),p=j.useMemo(()=>a?uMr(a.baseProject.files,t.files):[],[a,t.files]),g=j.useMemo(()=>a?p.map(R=>({path:R.path,content:R.status==="deleted"?R.before:R.after})):t.files,[p,a,t.files]),m=j.useMemo(()=>new Map(p.map(R=>[R.path,R.status])),[p]),[v,y]=j.useState(((L=g[0])==null?void 0:L.path)??null),[b,x]=j.useState(new Set),w=j.useMemo(()=>bMr(g),[g]),A=g.find(R=>R.path===v)??null,S=p.find(R=>R.path===v)??null;if(h.current=r,j.useEffect(()=>{try{window.localStorage.setItem($ot,d)}catch{}},[d]),j.useEffect(()=>{var I;if(!e)return;const R=document.body.style.overflow,D=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(I=u.current)==null||I.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]),j.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 C(R){return R?H.jsx("span",{className:`code-browser-change is-${R}`,children:o(`codeBrowser.change.${R}`)}):null}function k(R,D,M){return xMr(R,D===0).map(I=>{const N=M?`${M}/${I.name}`:I.name;if(!(I.children.size>0&&I.path===void 0)&&I.path){const V=m.get(I.path);return H.jsxs("button",{type:"button",className:`code-browser-file${v===I.path?" is-active":""}`,style:{paddingLeft:`${12+D*16}px`},onClick:()=>y(I.path??null),title:I.path,"aria-pressed":v===I.path,children:[H.jsx(wde,{}),H.jsx("span",{children:I.name}),C(V)]},N)}const B=b.has(N);return H.jsxs("div",{children:[H.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+D*16}px`},onClick:()=>T(N),"aria-expanded":!B,children:[H.jsx(fMr,{className:B?"":"is-open"}),H.jsx(dMr,{}),H.jsx("span",{children:I.name})]}),!B&&k(I,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",P=o(a?"codeBrowser.noChanges":"codeBrowser.chooseFile");return kf.createPortal(H.jsx("div",{className:"code-browser-backdrop",onMouseDown:R=>{R.target===R.currentTarget&&r()},children:H.jsxs("section",{ref:l,className:`code-browser-dialog is-${d}`,role:"dialog","aria-modal":"true","aria-labelledby":s,children:[H.jsxs("header",{className:"code-browser-head",children:[H.jsxs("div",{className:"code-browser-title-wrap",children:[H.jsx("span",{className:"code-browser-title-icon",children:H.jsx(hMr,{})}),H.jsxs("div",{children:[H.jsx("h2",{id:s,children:o(a?"codeBrowser.compareTitle":"codeBrowser.workspaceTitle")}),H.jsx("p",{title:t.name,children:t.name||o("codeBrowser.projectFallback")})]})]}),H.jsxs("div",{className:"code-browser-head-actions",children:[H.jsx("button",{type:"button",className:"code-browser-icon-button",onClick:()=>f(_),"aria-label":o("codeBrowser.switchTheme"),title:o("codeBrowser.switchThemeTitle",{theme:o(`codeBrowser.themes.${_}`)}),children:d==="light"?H.jsx(mMr,{}):H.jsx(gMr,{})}),H.jsx("button",{ref:u,type:"button",className:"code-browser-icon-button",onClick:r,"aria-label":o("codeBrowser.closeWorkspace"),title:o("codeBrowser.close"),children:H.jsx(pMr,{})})]})]}),H.jsxs("div",{className:"code-browser-workspace",children:[H.jsxs("aside",{className:"code-browser-sidebar","aria-label":o(a?"codeBrowser.changedFiles":"codeBrowser.projectFiles"),children:[H.jsxs("div",{className:"code-browser-sidebar-head",children:[H.jsx("span",{children:o(a?"codeBrowser.changes":"codeBrowser.files")}),H.jsx("span",{children:g.length})]}),H.jsx("div",{className:"code-browser-tree",children:g.length>0?k(w,0,""):H.jsx("div",{className:"code-browser-empty",children:P})})]}),H.jsxs("main",{className:"code-browser-main",children:[H.jsx("div",{className:"code-browser-tabs",role:"tablist","aria-label":o("codeBrowser.openFiles"),children:A?H.jsxs("div",{className:"code-browser-tab",role:"tab","aria-selected":"true",children:[H.jsx(wde,{}),H.jsx("span",{children:A.path.split("/").pop()}),C(S==null?void 0:S.status)]}):null}),H.jsxs("div",{className:"code-browser-path",children:[H.jsx(wde,{}),H.jsx("span",{children:(A==null?void 0:A.path)??o("codeBrowser.noFileSelected")})]}),a?H.jsxs("div",{className:"code-browser-diff-labels","aria-label":o("codeBrowser.comparisonDirection"),children:[H.jsx("span",{children:a.baseLabel??o("codeBrowser.before")}),H.jsx("span",{children:a.targetLabel??o("codeBrowser.after")})]}):null,H.jsx("div",{className:"code-browser-editor",children:A?H.jsx(j.Suspense,{fallback:H.jsx("div",{className:"code-browser-empty",children:o("codeBrowser.loadingEditor")}),children:S?H.jsx(yMr,{before:S.before,after:S.after,path:S.path,theme:d}):H.jsx(vMr,{value:A.content,path:A.path,onChange:E,readOnly:i,theme:d})}):H.jsx("div",{className:"code-browser-empty",children:P})}),H.jsxs("footer",{className:"code-browser-statusbar",children:[H.jsx("span",{children:a?o("codeBrowser.changedFileCount",{count:p.length}):o("codeBrowser.fileCount",{count:t.files.length})}),H.jsx("span",{children:A?o("codeBrowser.lineCount",{count:AMr(A.content)}):"UTF-8"})]})]})]})]})}),document.body)}const zot="send_a2ui_json_to_client",SMr=28,TMr=3e3;function CMr(t,e,r){let n=e;for(let i=0;i65535?2:1}return n}function OMr(t){return t<=4?1:Math.min(18,Math.max(2,Math.ceil(t/6)))}function Uot(t,e,r,n){const[i,a]=j.useState(()=>e?"":t),o=j.useRef(i),s=j.useRef(t),l=j.useRef(null),u=j.useRef(0),h=j.useRef(r);return s.current=t,h.current=r,j.useEffect(()=>{const d=o.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&&(o.current=t,a(t));return}if(d===t||l.current!==null)return;const p=g=>{const m=s.current,v=o.current;if(!m.startsWith(v)){o.current=m,a(m),l.current=null;return}if(g-u.current{var d;(d=h.current)==null||d.call(h)},[i]),j.useEffect(()=>{i===t&&(n==null||n())},[i,n,t]),j.useEffect(()=>()=>{l.current!==null&&(window.cancelAnimationFrame(l.current),l.current=null)},[]),i}function kMr(){return H.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:H.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 EMr(){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[H.jsx("path",{d:"m4.5 7 1.8 1.8L9.5 5.5"}),H.jsx("path",{d:"M12 7h7.5"}),H.jsx("path",{d:"m4.5 13 1.8 1.8 3.2-3.3"}),H.jsx("path",{d:"M12 13h7.5"}),H.jsx("path",{d:"M5 19h4"}),H.jsx("path",{d:"M12 19h7.5"})]})}function _Mr(){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[H.jsx("path",{d:"M5 5v7.25A3.75 3.75 0 0 0 8.75 16H19"}),H.jsx("path",{d:"m15.5 12.5 3.5 3.5-3.5 3.5"})]})}function RMr({activity:t}){const{t:e}=ca("conversation"),r=[["Agent Session",t.agentSessionId],["Sandbox Session",t.sandboxSessionId],["Codex Thread",t.threadId]].filter(n=>!!n[1]);return r.length?H.jsx("dl",{className:"codex-sandbox-run__identity","aria-label":e("blocks.sandboxIdentity"),children:r.map(([n,i])=>H.jsxs("div",{children:[H.jsx("dt",{children:n}),H.jsx("dd",{title:i,children:i})]},n))}):null}function DMr(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 Vot({text:t,done:e,answerStarted:r=!1,streaming:n=!1,onStreamFrame:i}){const{t:a}=ca("conversation"),[o,s]=j.useState(!(e||r)),l=j.useRef(!1);j.useEffect(()=>{l.current||s(!(e||r))},[r,e]);const u=()=>{l.current=!0,s(g=>!g)},h=t.replace(/\r\n?/g,` +`)},u3r=0,l_=[];function h3r(t){var e=j.useRef([]),r=j.useRef([0,0]),n=j.useRef(),i=j.useState(u3r++)[0],a=j.useState(pat)[0],o=j.useRef(t);j.useEffect(function(){o.current=t},[t]),j.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var m=L4r([t.lockRef.current],(t.shards||[]).map(wat),!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 s=j.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!o.current.allowPinchZoom;var y=jG(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 C=window.getSelection(),k=C&&C.anchorNode,E=k?k===S||k.contains(S):!1;if(E)return!1;var _=vat(T,S);if(!_)return!0;if(_?A=T:(A=T==="v"?"h":"v",_=vat(T,S)),!_)return!1;if(!n.current&&"changedTouches"in m&&(x||w)&&(n.current=A),!A)return!0;var P=n.current||A;return s3r(P,v,m,P==="h"?x:w)},[]),l=j.useCallback(function(m){var v=m;if(!(!l_.length||l_[l_.length-1]!==a)){var y="deltaY"in v?xat(v):jG(v),b=e.current.filter(function(A){return A.name===v.type&&(A.target===v.target||v.target===A.shadowParent)&&l3r(A.delta,y)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}if(!b){var x=(o.current.shards||[]).map(wat).filter(Boolean).filter(function(A){return A.contains(v.target)}),w=x.length>0?s(v,x[0]):!o.current.noIsolation;w&&v.cancelable&&v.preventDefault()}}},[]),u=j.useCallback(function(m,v,y,b){var x={name:m,delta:v,target:y,should:b,shadowParent:d3r(y)};e.current.push(x),setTimeout(function(){e.current=e.current.filter(function(w){return w!==x})},1)},[]),h=j.useCallback(function(m){r.current=jG(m),n.current=void 0},[]),d=j.useCallback(function(m){u(m.type,xat(m),m.target,s(m,t.lockRef.current))},[]),f=j.useCallback(function(m){u(m.type,jG(m),m.target,s(m,t.lockRef.current))},[]);j.useEffect(function(){return l_.push(a),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,s_),document.addEventListener("touchmove",l,s_),document.addEventListener("touchstart",h,s_),function(){l_=l_.filter(function(m){return m!==a}),document.removeEventListener("wheel",l,s_),document.removeEventListener("touchmove",l,s_),document.removeEventListener("touchstart",h,s_)}},[]);var p=t.removeScrollBar,g=t.inert;return j.createElement(j.Fragment,null,g?j.createElement(a,{styles:c3r(i)}):null,p?j.createElement(e3r,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function d3r(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const f3r=U4r(fat,h3r);var Aat=j.forwardRef(function(t,e){return j.createElement(YG,Cm({},t,{ref:e,sideCar:f3r}))});Aat.classNames=YG.classNames;var p3r=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},c_=new WeakMap,XG=new WeakMap,KG={},Khe=0,Sat=function(t){return t&&(t.host||Sat(t.parentNode))},g3r=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=Sat(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})},m3r=function(t,e,r,n){var i=g3r(e,Array.isArray(t)?t:[t]);KG[r]||(KG[r]=new WeakMap);var a=KG[r],o=[],s=new Set,l=new Set(i),u=function(d){!d||s.has(d)||(s.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(s.has(f))h(f);else try{var p=f.getAttribute(n),g=p!==null&&p!=="false",m=(c_.get(f)||0)+1,v=(a.get(f)||0)+1;c_.set(f,m),a.set(f,v),o.push(f),m===1&&g&&XG.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),s.clear(),Khe++,function(){o.forEach(function(d){var f=c_.get(d)-1,p=a.get(d)-1;c_.set(d,f),a.set(d,p),f||(XG.has(d)||d.removeAttribute(n),XG.delete(d)),p||d.removeAttribute(r)}),Khe--,Khe||(c_=new WeakMap,c_=new WeakMap,XG=new WeakMap,KG={})}},v3r=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=p3r(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live], script"))),m3r(n,i,r,"aria-hidden")):function(){return null}},y3r=Object.defineProperty,b3r=(t,e)=>y3r(t,"name",{value:e,configurable:!0});function Tat(t){const[e,r]=j.useState(void 0);return og(()=>{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 o,s;if("borderBoxSize"in a){const l=a.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,s=u.blockSize}else o=t.offsetWidth,s=t.offsetHeight;r({width:o,height:s})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}b3r(Tat,"useSize");var x3r=Object.defineProperty,Ax=(t,e)=>x3r(t,"name",{value:e,configurable:!0}),Cat="Popper",[Oat,kat]=UA(Cat),[w3r,Eat]=Oat(Cat),A3r=Ax(t=>{const{__scopePopper:e,children:r}=t,[n,i]=j.useState(null),[a,o]=j.useState(void 0);return H.jsx(w3r,{scope:e,anchor:n,onAnchorChange:i,placementState:a,setPlacementState:o,children:r})},"Popper"),S3r="PopperAnchor",T3r=j.forwardRef(Ax(function(e,r){const{__scopePopper:n,virtualRef:i,...a}=e,o=Eat(S3r,n),s=j.useRef(null),l=o.onAnchorChange,u=j.useCallback(m=>{s.current=m,m&&l(m)},[l]),h=Nh(r,u),d=j.useRef(null);j.useEffect(()=>{if(!i)return;const m=d.current;d.current=i.current,m!==d.current&&l(d.current)});const f=o.placementState&&ZG(o.placementState),p=f==null?void 0:f[0],g=f==null?void 0:f[1];return i?null:H.jsx(ag.div,{"data-radix-popper-side":p,"data-radix-popper-align":g,...a,ref:h})},"PopperAnchor")),_at="PopperContent",[C3r,lpi]=Oat(_at),O3r=j.forwardRef(Ax(function(e,r){var X,J,ee,te,pe,ie,Ce;const{__scopePopper:n,side:i="bottom",sideOffset:a=0,align:o="center",alignOffset:s=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=Eat(_at,n),[b,x]=j.useState(null),w=Nh(r,x),[A,S]=j.useState(null),T=Tat(A),C=(T==null?void 0:T.width)??0,k=(T==null?void 0:T.height)??0,E=i+(o!=="center"?"-"+o:""),_=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},P=Array.isArray(h)?h:[h],L=P.length>0,R={padding:_,boundary:P.filter(Rat),altBoundary:L},{refs:D,floatingStyles:M,placement:I,isPositioned:N,middlewareData:F}=kJe({strategy:"fixed",placement:E,whileElementsMounted:Ax((...ke)=>jce(...ke,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:y.anchor},middleware:[EJe({mainAxis:a+k,alignmentAxis:s}),u&&_Je({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?RJe():void 0,...R}),u&&DJe({...R}),LJe({...R,apply:Ax(({elements:ke,rects:Ee,availableWidth:ue,availableHeight:de})=>{const{width:xe,height:ge}=Ee.reference,ze=ke.floating.style;ze.setProperty("--radix-popper-available-width",`${ue}px`),ze.setProperty("--radix-popper-available-height",`${de}px`),ze.setProperty("--radix-popper-anchor-width",`${xe}px`),ze.setProperty("--radix-popper-anchor-height",`${ge}px`)},"apply")}),A&&vyr({element:A,padding:l}),k3r({arrowWidth:C,arrowHeight:k}),p&&myr({strategy:"referenceHidden",...R,boundary:L?R.boundary:void 0})]}),B=y.setPlacementState;og(()=>(B(I),()=>{B(void 0)}),[I,B]);const[V,z]=ZG(I),U=xx(m);og(()=>{N&&(U==null||U())},[N,U]);const Q=(X=F.arrow)==null?void 0:X.x,G=(J=F.arrow)==null?void 0:J.y,q=((ee=F.arrow)==null?void 0:ee.centerOffset)!==0,[Y,ne]=j.useState();return og(()=>{b&&ne(window.getComputedStyle(b).zIndex)},[b]),H.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":[(te=F.transformOrigin)==null?void 0:te.x,(pe=F.transformOrigin)==null?void 0:pe.y].join(" "),...((ie=F.hide)==null?void 0:ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:H.jsx(C3r,{scope:n,placedSide:V,placedAlign:z,onArrowChange:S,arrowX:Q,arrowY:G,shouldHideArrow:q,children:H.jsx(ag.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 Rat(t){return t!==null}Ax(Rat,"isNotNull");var k3r=Ax(t=>({name:"transformOrigin",options:t,fn(e){var v,y,b;const{placement:r,rects:n,middlewareData:i}=e,o=((v=i.arrow)==null?void 0:v.centerOffset)!==0,s=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[u,h]=ZG(r),d={start:"0%",center:"50%",end:"100%"}[h],f=(((y=i.arrow)==null?void 0:y.x)??0)+s/2,p=(((b=i.arrow)==null?void 0:b.y)??0)+l/2;let g="",m="";return u==="bottom"?(g=o?d:`${f}px`,m=`${-l}px`):u==="top"?(g=o?d:`${f}px`,m=`${n.floating.height+l}px`):u==="right"?(g=`${-l}px`,m=o?d:`${p}px`):u==="left"&&(g=`${n.floating.width+l}px`,m=o?d:`${p}px`),{data:{x:g,y:m}}}}),"transformOrigin");function ZG(t){const[e,r="center"]=t.split("-");return[e,r]}Ax(ZG,"getSideAndAlignFromPlacement");var E3r=A3r,_3r=T3r,R3r=O3r,D3r=Object.defineProperty,Zhe=(t,e)=>D3r(t,"name",{value:e,configurable:!0}),Jhe=!1;function Dat(){const[t,e]=j.useState(Jhe);return j.useEffect(()=>{Jhe||(Jhe=!0,e(!0))},[]),t}Zhe(Dat,"useIsHydrated");var Lat=qw[" useSyncExternalStore ".trim().toString()];function Mat(){return()=>{}}Zhe(Mat,"subscribe");function Iat(){return Lat(Mat,()=>!0,()=>!1)}Zhe(Iat,"useIsHydratedModern");var L3r=typeof Lat=="function"?Iat:Dat,M3r=Object.defineProperty,VA=(t,e)=>M3r(t,"name",{value:e,configurable:!0}),ede="rovingFocusGroup.onEntryFocus",I3r={bubbles:!1,cancelable:!0},JG="RovingFocusGroup",[tde,Pat,P3r]=Lit(JG),[N3r,Nat]=UA(JG,[P3r]),[B3r,$3r]=N3r(JG),F3r=j.forwardRef(VA(function(e,r){return H.jsx(tde.Provider,{scope:e.__scopeRovingFocusGroup,children:H.jsx(tde.Slot,{scope:e.__scopeRovingFocusGroup,children:H.jsx(z3r,{...e,ref:r})})})},"RovingFocusGroup")),z3r=j.forwardRef(VA(function(e,r){const{__scopeRovingFocusGroup:n,orientation:i,loop:a=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:h,preventScrollOnEntryFocus:d=!1,...f}=e,p=j.useRef(null),g=Nh(r,p),m=Phe(o),[v,y]=i_({prop:s,defaultProp:l??null,onChange:u,caller:JG}),[b,x]=j.useState(!1),w=xx(h),A=Pat(n),S=j.useRef(!1),[T,C]=j.useState(0);return j.useEffect(()=>{const k=p.current;if(k)return k.addEventListener(ede,w),()=>k.removeEventListener(ede,w)},[w]),H.jsx(B3r,{scope:n,orientation:i,dir:m,loop:a,currentTabStopId:v,onItemFocus:j.useCallback(k=>y(k),[y]),onItemShiftTab:j.useCallback(()=>x(!0),[]),onFocusableItemAdd:j.useCallback(()=>C(k=>k+1),[]),onFocusableItemRemove:j.useCallback(()=>C(k=>k-1),[]),children:H.jsx(ag.div,{tabIndex:b||T===0?-1:0,"data-orientation":i,...f,ref:g,style:{outline:"none",...e.style},onMouseDown:Eu(e.onMouseDown,()=>{S.current=!0}),onFocus:Eu(e.onFocus,k=>{const E=!S.current;if(k.target===k.currentTarget&&E&&!b){const _=new CustomEvent(ede,I3r);if(k.currentTarget.dispatchEvent(_),!_.defaultPrevented){const P=A().filter(I=>I.focusable),L=P.find(I=>I.active),R=P.find(I=>I.id===v),M=[L,R,...P].filter(Boolean).map(I=>I.ref.current);rde(M,d)}}S.current=!1}),onBlur:Eu(e.onBlur,()=>x(!1))})})},"RovingFocusGroupImpl")),U3r="RovingFocusGroupItem",V3r=j.forwardRef(VA(function(e,r){const{__scopeRovingFocusGroup:n,focusable:i=!0,active:a=!1,tabStopId:o,children:s,...l}=e,u=Ihe(),h=o||u,d=$3r(U3r,n),f=d.currentTabStopId===h,p=Pat(n),{onFocusableItemAdd:g,onFocusableItemRemove:m,currentTabStopId:v}=d,y=L3r();return og(()=>{if(!(!y||!i))return g(),()=>m()},[y,i,g,m]),j.useEffect(()=>{if(!(y||!i))return g(),()=>m()},[y,i,g,m]),H.jsx(tde.ItemSlot,{scope:n,id:h,focusable:i,active:a,children:H.jsx(ag.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...l,ref:r,onMouseDown:Eu(e.onMouseDown,b=>{i?d.onItemFocus(h):b.preventDefault()}),onFocus:Eu(e.onFocus,()=>d.onItemFocus(h)),onKeyDown:Eu(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){d.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const x=$at(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?Fat(A,S+1):A.slice(S+1)}setTimeout(()=>rde(A))}}),children:typeof s=="function"?s({isCurrentTabStop:f,hasTabStop:v!=null}):s})})},"RovingFocusGroupItem")),Q3r={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Bat(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}VA(Bat,"getDirectionAwareKey");function $at(t,e,r){const n=Bat(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Q3r[n]}VA($at,"getFocusIntent");function rde(t,e=!1){const r=document.activeElement;for(const n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}VA(rde,"focusFirst");function Fat(t,e){return t.map((r,n)=>t[(e+n)%t.length])}VA(Fat,"wrapArray");var G3r=F3r,H3r=V3r,W3r=Object.defineProperty,Sx=(t,e)=>W3r(t,"name",{value:e,configurable:!0}),nde="Popover",[zat,cpi]=UA(nde,[kat]),ide=kat(),[Y3r,u_]=zat(nde),q3r=Sx(t=>{const{__scopePopover:e,children:r,open:n,defaultOpen:i,onOpenChange:a,modal:o=!1}=t,s=ide(e),l=j.useRef(null),[u,h]=j.useState(!1),[d,f]=i_({prop:n,defaultProp:i??!1,onChange:a,caller:nde});return H.jsx(E3r,{...s,children:H.jsx(Y3r,{scope:e,contentId:Ihe(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:j.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:u,onCustomAnchorAdd:j.useCallback(()=>h(!0),[]),onCustomAnchorRemove:j.useCallback(()=>h(!1),[]),modal:o,children:r})})},"Popover"),j3r="PopoverTrigger",X3r=j.forwardRef(Sx(function(e,r){const{__scopePopover:n,...i}=e,a=u_(j3r,n),o=ide(n),s=Nh(r,a.triggerRef),l=H.jsx(ag.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":ade(a.open),...i,ref:s,onClick:Eu(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:H.jsx(_3r,{asChild:!0,...o,children:l})},"PopoverTrigger")),Uat="PopoverPortal",[K3r,Z3r]=zat(Uat,{forceMount:void 0}),J3r=Sx(t=>{const{__scopePopover:e,forceMount:r,children:n,container:i}=t,a=u_(Uat,e);return H.jsx(K3r,{scope:e,forceMount:r,children:H.jsx(qit,{present:r||a.open,children:H.jsx(_4r,{asChild:!0,container:i,children:n})})})},"PopoverPortal"),LN="PopoverContent",eDr=j.forwardRef(Sx(function(e,r){const n=Z3r(LN,e.__scopePopover),{forceMount:i=n.forceMount,...a}=e,o=u_(LN,e.__scopePopover);return H.jsx(qit,{present:i||o.open,children:o.modal?H.jsx(rDr,{...a,ref:r}):H.jsx(nDr,{...a,ref:r})})},"PopoverContent")),tDr=zA("PopoverContent.RemoveScroll"),rDr=j.forwardRef(Sx(function(e,r){const n=u_(LN,e.__scopePopover),i=j.useRef(null),a=Nh(r,i),o=j.useRef(!1);return j.useEffect(()=>{const s=i.current;if(s)return v3r(s)},[]),H.jsx(Aat,{as:tDr,allowPinchZoom:!0,children:H.jsx(Vat,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Eu(e.onCloseAutoFocus,s=>{var l;s.preventDefault(),o.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Eu(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,h=l.button===2||u;o.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Eu(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),nDr=j.forwardRef(Sx(function(e,r){const n=u_(LN,e.__scopePopover),i=j.useRef(!1),a=j.useRef(!1);return H.jsx(Vat,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,l;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(i.current||(l=n.triggerRef.current)==null||l.focus(),o.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:o=>{var u,h;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(i.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const s=o.target;((h=n.triggerRef.current)==null?void 0:h.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})},"PopoverContentNonModal")),Vat=j.forwardRef(Sx(function(e,r){const{__scopePopover:n,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:d,...f}=e,p=u_(LN,n),g=ide(n);return Hhe(),H.jsx(O4r,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:a,onUnmountAutoFocus:o,children:H.jsx(A4r,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:h,onDismiss:()=>p.onOpenChange(!1),deferPointerDownOutside:!0,children:H.jsx(R3r,{"data-state":ade(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 ade(t){return t?"open":"closed"}Sx(ade,"getState");var iDr=q3r,aDr=X3r,oDr=J3r,sDr=eDr,lDr=Object.defineProperty,cDr=(t,e)=>lDr(t,"name",{value:e,configurable:!0}),uDr="Toggle",hDr=j.forwardRef(cDr(function(e,r){const{pressed:n,defaultPressed:i,onPressedChange:a,...o}=e,[s,l]=i_({prop:n,onChange:a,defaultProp:i??!1,caller:uDr});return H.jsx(ag.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:r,onClick:Eu(e.onClick,()=>{e.disabled||l(!s)})})},"Toggle")),dDr=Object.defineProperty,Tx=(t,e)=>dDr(t,"name",{value:e,configurable:!0}),h_="ToggleGroup",[Qat,upi]=UA(h_,[Nat]),Gat=Nat(),fDr=j.forwardRef(Tx(function(e,r){const{type:n,...i}=e;if(n==="single"){const a=i;return H.jsx(pDr,{role:"radiogroup",...a,ref:r})}if(n==="multiple"){const a=i;return H.jsx(gDr,{role:"toolbar",...a,ref:r})}throw new Error(`Missing prop \`type\` expected on \`${h_}\``)},"ToggleGroup")),[Hat,Wat]=Qat(h_),pDr=j.forwardRef(Tx(function(e,r){const{value:n,defaultValue:i,onValueChange:a=Tx(()=>{},"onValueChange"),...o}=e,[s,l]=i_({prop:n,defaultProp:i??"",onChange:a,caller:h_});return H.jsx(Hat,{scope:e.__scopeToggleGroup,type:"single",value:j.useMemo(()=>s?[s]:[],[s]),onItemActivate:l,onItemDeactivate:j.useCallback(()=>l(""),[l]),children:H.jsx(Yat,{...o,ref:r})})},"ToggleGroupImplSingle")),gDr=j.forwardRef(Tx(function(e,r){const{value:n,defaultValue:i,onValueChange:a=Tx(()=>{},"onValueChange"),...o}=e,[s,l]=i_({prop:n,defaultProp:i??[],onChange:a,caller:h_}),u=j.useCallback(d=>l((f=[])=>[...f,d]),[l]),h=j.useCallback(d=>l((f=[])=>f.filter(p=>p!==d)),[l]);return H.jsx(Hat,{scope:e.__scopeToggleGroup,type:"multiple",value:s,onItemActivate:u,onItemDeactivate:h,children:H.jsx(Yat,{...o,ref:r})})},"ToggleGroupImplMultiple")),[mDr,vDr]=Qat(h_),Yat=j.forwardRef(Tx(function(e,r){const{__scopeToggleGroup:n,disabled:i=!1,rovingFocus:a=!0,orientation:o,dir:s,loop:l=!0,...u}=e,h=Gat(n),d=Phe(s),f={dir:d,...u};return H.jsx(mDr,{scope:n,rovingFocus:a,disabled:i,children:a?H.jsx(G3r,{asChild:!0,...h,orientation:o,dir:d,loop:l,children:H.jsx(ag.div,{...f,ref:r})}):H.jsx(ag.div,{...f,ref:r})})},"ToggleGroupImpl")),ode="ToggleGroupItem",yDr=j.forwardRef(Tx(function(e,r){const n=Wat(ode,e.__scopeToggleGroup),i=vDr(ode,e.__scopeToggleGroup),a=Gat(e.__scopeToggleGroup),o=n.value.includes(e.value),s=i.disabled||e.disabled,l={...e,pressed:o,disabled:s},u=j.useRef(null);return i.rovingFocus?H.jsx(H3r,{asChild:!0,...a,focusable:!s,active:o,ref:u,children:H.jsx(qat,{...l,ref:r})}):H.jsx(qat,{...l,ref:r})},"ToggleGroupItem")),qat=j.forwardRef(Tx(function(e,r){const{__scopeToggleGroup:n,value:i,...a}=e,o=Wat(ode,n),s={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},l=o.type==="single"?s:void 0;return H.jsx(hDr,{...l,...a,ref:r,onPressedChange:u=>{u?o.onItemActivate(i):o.onItemDeactivate(i)}})},"ToggleGroupItemImpl")),bDr=typeof Ti=="object"&&Ti&&Ti.Object===Object&&Ti,xDr=typeof self=="object"&&self&&self.Object===Object&&self;bDr||xDr||Function("return this")();var wDr=typeof window<"u"?j.useLayoutEffect:j.useEffect;function ADr(){const t=j.useRef(!1);return j.useEffect(()=>(t.current=!0,()=>{t.current=!1}),[]),j.useCallback(()=>t.current,[])}var jat={width:void 0,height:void 0};function SDr(t){const{ref:e,box:r="content-box"}=t,[{width:n,height:i},a]=j.useState(jat),o=ADr(),s=j.useRef({...jat}),l=j.useRef(void 0);return l.current=t.onResize,j.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=Xat(h,d,"inlineSize"),p=Xat(h,d,"blockSize");if(s.current.width!==f||s.current.height!==p){const m={width:f,height:p};s.current.width=f,s.current.height=p,l.current?l.current(m):o()&&a(m)}});return u.observe(e.current,{box:r}),()=>{u.disconnect()}},[r,e,o]),{width:n,height:i}}function Xat(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 Kat(t,e){const r=j.useRef(t);wDr(()=>{r.current=t},[t]),j.useEffect(()=>{if(!e&&e!==0)return;const n=setTimeout(()=>{r.current()},e);return()=>{clearTimeout(n)}},[e])}const TDr={DEV:!1,MODE:"production"},d_=typeof{url:qa&&qa.tagName.toUpperCase()==="SCRIPT"&&qa.src||new URL("website-integration.js",document.baseURI).href}<"u"?TDr:void 0,CDr=!!(d_!=null&&d_.DEV),ODr=typeof navigator<"u"&&/(jsdom|happy-dom)/i.test(navigator.userAgent)||typeof globalThis.happyDOM=="object",Zat=(d_==null?void 0:d_.MODE)==="test"||ODr,kDr=typeof window<"u",Jat=typeof document<"u",EDr=kDr&&Jat,eot=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())},sde=(t,e)=>{const r=()=>{const o=setTimeout(t);return()=>{clearTimeout(o)}};if(!EDr||typeof window.requestAnimationFrame!="function"||Jat&&document.visibilityState==="hidden")return r();let i=2,a=window.requestAnimationFrame(function o(){i-=1,i===0?t():a=window.requestAnimationFrame(o)});return()=>{typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(a)}},tot=t=>Object.keys(t).reduce((r,n)=>{const i=t[n];if(i||i===0){const a=n.startsWith("--")?"":"--",o=typeof i=="number"?`${i}px`:i;r[`${a}${n}`]=o}return r},{}),lde=t=>{t.preventDefault()},rot=t=>t.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex^="-"]), [contenteditable]'),cde={SegmentedControl:"_SegmentedControl_1sl7d_1",SegmentedControlOption:"_SegmentedControlOption_1sl7d_140",SegmentedControlThumb:"_SegmentedControlThumb_1sl7d_219"},eH=({value:t,onChange:e,children:r,block:n,pill:i=!0,size:a="md",gutterSize:o,className:s,onClick:l,...u})=>{const h=j.useRef(null),d=j.useRef(null),f=j.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,C=T+x;(TS+b-A)&&g&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);SDr({ref:h,onResize:()=>{const g=d.current;if(!g)return;const m=g.style.transition;g.style.transition="",f(!1),g.style.transition=m}}),j.useLayoutEffect(()=>{const g=h.current,m=d.current;!g||!m||(f(!!m.style.transition),m.style.transition||sde(()=>{m.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[f,t,a,o,i]);const p=g=>{g&&e&&e(g)};return H.jsxs(fDr,{ref:h,className:r_(cde.SegmentedControl,s),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":o,...u,children:[H.jsx("div",{className:cde.SegmentedControlThumb,ref:d}),r]})},_Dr=({children:t,...e})=>H.jsx(yDr,{className:cde.SegmentedControlOption,...e,onPointerEnter:eot,children:H.jsx("span",{className:"relative",children:t})});eH.Option=_Dr;function RDr({children:t,label:e,language:r,source:n,streaming:i=!1}){const{t:a}=ca("conversation"),[o,s]=j.useState("preview"),l=i?"code":o;return H.jsxs("section",{className:"visualization-card","aria-label":a("visualization.cardAria",{label:e}),children:[H.jsx("div",{className:"visualization-card__toolbar",children:H.jsxs(eH,{className:"visualization-card__tabs",value:l,size:"sm",gutterSize:"sm",pill:!1,"aria-label":a("visualization.viewAria",{label:e}),onChange:u=>{i||s(u)},children:[H.jsx(eH.Option,{value:"preview",disabled:i,children:a("visualization.preview")}),H.jsx(eH.Option,{value:"code",children:a("visualization.code")})]})}),H.jsx("div",{className:"visualization-card__body",children:l==="code"?H.jsx("pre",{className:"visualization-card__code",children:H.jsx("code",{className:`language-${r}`,children:n})}):t})]})}const DDr=j.memo(RDr);function LDr(t){const e=t==null?void 0:t.trim().toLowerCase();if(e==="mermaid")return"mermaid";if(e==="echart"||e==="echarts")return"echarts"}const not=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function ude(t){return typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(ude).join(""):j.isValidElement(t)?ude(t.props.children):""}function MDr(t){var n;const e=j.Children.toArray(t)[0];if(!j.isValidElement(e))return;const r=(n=e.props.className)==null?void 0:n.split(/\s+/).find(i=>i.startsWith("language-"));return LDr(r==null?void 0:r.slice(9))}function iot(t){if(!t)return!1;try{const e=t.toLowerCase();return not.some(r=>e.includes(r))}catch{return!1}}function IDr(t){var n;const e=(n=t==null?void 0:t.properties)==null?void 0:n.href;if(!e)return!1;if(iot(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 not.some(a=>i.includes(a))}return!1}function PDr({text:t,className:e,allowRawHtml:r=!0,streaming:n=!1}){const{t:i}=ca("conversation"),[a,o]=j.useState(null),s=(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 H.jsxs("div",{className:e?`md ${e}`:"md",children:[H.jsx(lSr,{remarkPlugins:[SCr],rehypePlugins:r?[fRr,ynt]:[ynt],components:{pre:({node:h,children:d,...f})=>{const p=MDr(d);if(p==="mermaid"||p==="echarts"){const g=ude(d).replace(/\n$/,"");return H.jsx(DDr,{label:p==="mermaid"?"Mermaid":"ECharts",language:p,source:g,streaming:n,children:p==="mermaid"?H.jsx(URr,{source:g}):H.jsx(NRr,{source:g})})}return H.jsx("pre",{...f,children:d})},a:({node:h,...d})=>{const f=d.href;if(f&&(iot(f)||IDr(h))){const p=f,g=u(h==null?void 0:h.children);return H.jsxs("div",{className:"video-container",children:[H.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":i("markdown.playVideo",{name:g}),onClick:()=>o({src:p,title:g}),children:[H.jsx("video",{src:p,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),H.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:H.jsx(nQ,{})})]}),H.jsx("div",{className:"video-caption",children:H.jsx("a",{href:p,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:g})})]})}return H.jsx("a",{...d,target:"_blank",rel:"noopener noreferrer"})},img:({node:h,src:d,alt:f,...p})=>{const g=H.jsx("img",{...p,src:d,alt:f??"",loading:"lazy"});return d?H.jsx(Vtt,{src:d,children:H.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":i("markdown.enlargeImage",{name:f||i("markdown.image")}),children:[g,H.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:H.jsx(nQ,{})})]})}):g},video:({node:h,src:d,children:f,...p})=>{const g=s({src:d},f);return g?H.jsx("div",{className:"video-container",children:H.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":i("markdown.enlargeVideo"),onClick:()=>o({src:g}),children:[H.jsx("video",{src:g,...p,playsInline:!0,className:"video-thumbnail",children:f}),H.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:H.jsx(nQ,{})})]})}):H.jsx("video",{src:d,controls:!0,playsInline:!0,className:"video-inline",...p,children:f})}},children:t}),a&&H.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":i("markdown.videoPreview"),onClick:()=>o(null),children:H.jsxs("div",{className:"video-viewer",onClick:h=>h.stopPropagation(),children:[H.jsxs("div",{className:"video-viewer-header",children:[H.jsx("div",{className:"video-viewer-title",children:a.title||l(a.src)}),H.jsxs("nav",{className:"video-viewer-nav",children:[H.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:H.jsx(ile,{})}),H.jsx("button",{type:"button",className:"video-viewer-close","aria-label":i("markdown.close"),onClick:()=>o(null),children:H.jsx(vE,{})})]})]}),H.jsx("div",{className:"video-viewer-body",children:H.jsx("video",{src:a.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const tH=j.memo(PDr);function NDr({value:t,skillPrefix:e="/",onRemoveSkill:r,onRemoveAgent:n}){const{t:i}=ca("conversation");return t.skills.length===0&&!t.targetAgent?null:H.jsxs("div",{className:"invocation-chips","aria-label":i("invocation.ariaLabel"),children:[t.skills.map(a=>H.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:a.description,children:[H.jsx(Ddr,{"aria-hidden":!0}),H.jsxs("span",{children:[e,a.name]}),r?H.jsx("button",{type:"button",onClick:()=>r(a.name),"aria-label":i("invocation.removeSkill",{name:a.name}),children:H.jsx(vE,{})}):null]},a.name)),t.targetAgent?H.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:t.targetAgent.description,children:[H.jsx(Tdr,{"aria-hidden":!0}),H.jsx("span",{children:t.targetAgent.name}),n?H.jsx("button",{type:"button",onClick:n,"aria-label":i("invocation.removeAgent",{name:t.targetAgent.name}),children:H.jsx(vE,{})}):null]}):null]})}const aot="veadk_auth_qs",BDr=new Set(["view","source","sessionId","artifactSha256","validationReportSha256","projectId","versionId"]);let MN=null;function $Dr(){if(MN!==null)return MN;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,o)=>{(n&&BDr.has(o)?r:e).append(o,a)});const i=e.toString();if(i?(sessionStorage.setItem(aot,i),MN=i):MN=sessionStorage.getItem(aot)??"",i){const a=r.toString();window.history.replaceState(null,"",window.location.pathname+(a?`?${a}`:"")+window.location.hash)}return MN}function FDr(t){const e=$Dr();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 zDr="";function UDr(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 VDr(t,e){if(e.startsWith("data:")||e.startsWith("blob:")||/^https?:/.test(e))return e;const r=UDr(e);if(!r)return e;const n=`${r}/content`;return FDr(`${zDr}${n}`)}function hde(t=""){return t.startsWith("image/")?"image":t.startsWith("video/")?"video":t==="application/pdf"?"pdf":t==="text/markdown"?"markdown":"text"}function oot(t){var r,n,i,a;const e=hde(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 sot(t){return t?t<1024?`${t} B`:t<1024*1024?`${Math.round(t/1024)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`:""}function lot(t,e){return t.previewUrl?t.previewUrl:t.data?`data:${t.mimeType??"application/octet-stream"};base64,${t.data}`:t.uri?VDr(e,t.uri):""}function QDr({kind:t}){return t==="image"?H.jsx(_dr,{}):t==="video"?H.jsx(Edr,{}):t==="pdf"?H.jsx(kdr,{}):H.jsx(xje,{})}function GDr({appName:t,items:e,compact:r=!1,onRemove:n}){const{t:i}=ca("conversation"),[a,o]=j.useState(null);return H.jsxs(H.Fragment,{children:[H.jsx("div",{className:`media-grid${r?" media-grid--compact":""}`,children:e.map(s=>{const l=hde(s.mimeType),u=lot(s,t),h=s.status==="uploading"||s.status==="error"||!u,d=H.jsxs("button",{type:"button",className:"media-card-main",disabled:h,onClick:l==="image"?void 0:()=>o(s),"aria-label":i("media.preview",{name:s.name??i("media.attachment")}),children:[l==="image"&&u?H.jsx("img",{className:"media-card-image",src:u,alt:s.name??i("media.image"),loading:"lazy"}):l==="video"&&u?H.jsxs("div",{className:"media-card-video-container",children:[H.jsx("video",{className:"media-card-video",src:u,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),H.jsx("span",{className:"media-card-video-play",children:H.jsx(Rdr,{})})]}):H.jsx("span",{className:"media-card-icon",children:H.jsx(QDr,{kind:l})}),H.jsxs("span",{className:"media-card-copy",children:[H.jsx("span",{className:"media-card-name",children:s.name??i("media.attachment")}),H.jsxs("span",{className:"media-card-meta",children:[H.jsx("span",{className:"media-card-type",children:oot(s)}),s.status==="uploading"?H.jsxs(H.Fragment,{children:[H.jsx(qv,{className:"media-card-spinner"})," ",i("media.uploading")]}):s.status==="error"?s.error??i("media.uploadFailed"):sot(s.sizeBytes)]})]}),!r&&s.status!=="uploading"&&s.status!=="error"?H.jsx(nQ,{className:"media-card-open"}):null]});return H.jsxs(TA.div,{className:`media-card media-card--${l}${s.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?H.jsx(Vtt,{src:u,children:d}):d,n?H.jsx("button",{type:"button",className:"media-card-remove","aria-label":i("media.remove",{name:s.name??i("media.attachment")}),onClick:()=>n(s.id),children:H.jsx(vE,{})}):null]},s.id)})}),H.jsx(Ndr,{children:a?H.jsx(HDr,{appName:t,item:a,onClose:()=>o(null)}):null})]})}function HDr({appName:t,item:e,onClose:r}){const{t:n}=ca("conversation"),i=j.useMemo(()=>lot(e,t),[t,e]),a=hde(e.mimeType),[o,s]=j.useState(""),[l,u]=j.useState(a==="text"||a==="markdown"),[h,d]=j.useState("");return j.useEffect(()=>{const f=p=>{p.key==="Escape"&&r()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[r]),j.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(s).catch(p=>{f.signal.aborted||d(p instanceof Error?p.message:String(p))}).finally(()=>{f.signal.aborted||u(!1)}),()=>f.abort()},[a,i]),H.jsx(TA.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:H.jsxs(TA.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:[H.jsxs("header",{className:"media-viewer-header",children:[H.jsxs("div",{children:[H.jsx("strong",{children:e.name??n("media.attachment")}),H.jsxs("span",{children:[oot(e),e.sizeBytes?` · ${sot(e.sizeBytes)}`:""]})]}),H.jsxs("nav",{children:[H.jsx("a",{href:i,download:e.name,"aria-label":n("media.download"),children:H.jsx(ile,{})}),H.jsx("button",{type:"button",onClick:r,"aria-label":n("media.close"),children:H.jsx(vE,{})})]})]}),H.jsxs("div",{className:`media-viewer-body media-viewer-body--${a}`,children:[a==="image"?H.jsx("img",{src:i,alt:e.name??n("media.image")}):null,a==="video"?H.jsx("div",{className:"media-viewer-video-wrapper",children:H.jsx("video",{src:i,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,a==="pdf"?H.jsx("iframe",{src:i,title:e.name??"PDF"}):null,l?H.jsxs("div",{className:"media-viewer-loading",children:[H.jsx(qv,{})," ",n("media.reading")]}):null,!l&&h?H.jsx("div",{className:"media-viewer-loading",children:n("media.loadFailed",{error:h})}):null,!l&&a==="markdown"?H.jsx("div",{className:"media-document",children:H.jsx(tH,{text:o})}):null,!l&&a==="text"?H.jsx("pre",{className:"media-document media-document--plain",children:o}):null]})]})})}function WDr({definition:t,label:e,done:r,open:n,onToggle:i}){const{t:a}=ca("conversation"),o=t.icon,s=r?t.doneLabel:t.runningLabel,l=e??a(`blocks.tools.${t.name}.${r?"done":"running"}`,{defaultValue:s});return H.jsxs("button",{type:"button",className:`builtin-tool-head${r?" is-done":" is-running"}`,"data-tool-tone":t.tone,onClick:i,"aria-expanded":n,children:[H.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:H.jsx(o,{})}),r?H.jsx("span",{className:"builtin-tool-label",children:l}):H.jsx(ym,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:l}),H.jsx(FE,{className:`builtin-tool-chevron${n?" is-open":""}`})]})}function Pd(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function tn(t){return typeof t=="string"?t:""}function cot(t){return typeof t=="number"&&Number.isFinite(t)?t:0}function Wf(t){return Array.isArray(t)?t:[]}function dde(t){let e=t;if(typeof e=="string")try{e=JSON.parse(e)}catch{return{}}const r=Pd(e)??{};return Pd(r.result)??r}function rH(t){if(typeof t=="string")try{return rH(JSON.parse(t))}catch{return t}const e=Pd(t);if(!e)return"";const r=Pd(e.result);return tn(e.error)||tn(e.message)||tn(r==null?void 0:r.error)||tn(r==null?void 0:r.message)}function YDr(t){if(t.kind==="tool")return"tool";if(t.kind==="knowledge_base")return"knowledge_base";const e=Pd(t.metadata),r=tn(e==null?void 0:e.source_type).toLowerCase(),n=tn(t.source).toLowerCase();return r==="skillhub"||n.startsWith("skill_hub:")?"skill_hub":"skill_space"}const uot={tool:"Tools",knowledge:"AgentKit Knowledge Base",skillCenter:"AgentKit Skill Center",unknownSource:"Unknown source",unnamedResource:"Unnamed resource",unnamedAgent:"Unnamed agent"};function qDr(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 jDr(t){return t==="veadk_builtin_tools"?"tool":t==="agentkit_knowledge"?"knowledge_base":t.startsWith("skill_hub:")?"skill_hub":"skill_space"}function XDr(t,e=uot){const r=dde(t),n=Pd(r.capabilities)??{},i=Wf(r.resources).flatMap(o=>{const s=Pd(o);if(!s)return[];const l=s.kind==="tool"?"tool":s.kind==="knowledge_base"?"knowledge_base":"skill";return[{ref:tn(s.ref),kind:l,category:YDr(s),name:tn(s.name)||tn(s.ref)||e.unnamedResource,description:tn(s.description),source:tn(s.source),version:tn(s.version)}]}),a=Wf(r.sources).flatMap(o=>{const s=Pd(o);if(!s)return[];const l=tn(s.source),u=tn(s.status),h=u==="error"?"error":u==="skipped"?"skipped":"ok";return[{source:l,category:jDr(l),label:qDr(l,e),status:h,count:cot(s.count),message:tn(s.message),searchKeywords:Wf(s.search_keywords).map(tn).filter(Boolean)}]});return{collectionId:tn(r.collection_id),capabilities:{googleAdkVersion:tn(n.google_adk_version),agentTypes:Wf(n.agent_types).map(tn).filter(Boolean),maxOrchestrationDepth:cot(n.max_orchestration_depth)},resources:i,sources:a,counts:{all:i.length,skill_hub:i.filter(o=>o.category==="skill_hub").length,skill_space:i.filter(o=>o.category==="skill_space").length,knowledge_base:i.filter(o=>o.category==="knowledge_base").length,tool:i.filter(o=>o.category==="tool").length}}}function KDr(t,e){return{resources:t.resources.filter(r=>r.category===e),sources:t.sources.filter(r=>r.category===e)}}function hot(t,e,r=uot){const n=dde(t),i=dde(e),a=new Map(Wf(i.results).flatMap(h=>{const d=Pd(h),f=tn(d==null?void 0:d.name);return d&&f?[[f,d]]:[]})),o=Wf(n.agents).flatMap(h=>{const d=Pd(h),f=tn(d==null?void 0:d.name);return d&&f?[d]:[]}),s=new Set(o.map(h=>tn(h.name))),l=[...a.entries()].filter(([h])=>!s.has(h)).map(([h])=>({name:h})),u=[...o,...l].map(h=>{const d=tn(h.name),f=Wf(h.nodes).flatMap(T=>{const C=Pd(T);return C?[C]:[]}),p=tn(h.root_node),g=f.find(T=>tn(T.id)===p),m=f.filter(T=>tn(T.id)!==p).map(T=>({id:tn(T.id)||r.unnamedAgent,type:tn(T.type)||"llm",description:tn(T.description)})),v=a.get(d),y=tn(v==null?void 0:v.status),b=y==="failed"?"failed":y==="completed"?"completed":"running",x=dot(v==null?void 0:v.resources),w=x.length>0?x:dot(f.flatMap(T=>Wf(T.resources))),A=fot(v==null?void 0:v.python_tools),S=A.length>0?A:fot(f.flatMap(T=>Wf(T.python_tools)));return{name:d,description:tn(v==null?void 0:v.description)||tn(g==null?void 0:g.description)||tn(h.task),task:tn(h.task),rootType:tn(v==null?void 0:v.root_type)||tn(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:tn(v==null?void 0:v.output),error:tn(v==null?void 0:v.error)}});return{collectionId:tn(i.collection_id)||tn(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 ZDr(t,e){return!!rH(e)||hot(t,e).failedCount>0}function dot(t){const e=new Set;return Wf(t).flatMap(r=>{const n=Pd(r),i=tn(n?n.ref:r);if(!i||e.has(i))return[];e.add(i);const a=tn(n==null?void 0:n.kind),o=a==="tool"||i.startsWith("veadk_tool:")?"tool":a==="knowledge_base"||i.startsWith("agentkit_kb:")?"knowledge_base":"skill",s=i.split(":");return[{ref:i,kind:o,name:tn(n==null?void 0:n.name)||s[s.length-1]||i,description:tn(n==null?void 0:n.description),version:tn(n==null?void 0:n.version),source:tn(n==null?void 0:n.source)}]})}function fot(t){const e=new Set;return Wf(t).flatMap(r=>{const n=Pd(r),i=tn(n==null?void 0:n.name),a=tn(n==null?void 0:n.code),o=`${i}\0${a}`;return!n||!i||e.has(o)?[]:(e.add(o),[{name:i,description:tn(n.description),code:a,entrypoint:tn(n.entrypoint)||i,dependencies:Wf(n.dependencies).map(tn).filter(Boolean)}])})}const JDr=t=>{const e=j.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},fde=t=>{const e=JDr(t),r=j.Children.count(e);return j.Children.map(e,n=>{if(typeof n=="string"&&n.trim())return r<=1?n:H.jsx("span",{children:n});if(j.isValidElement(n)){const i=n,{children:a,...o}=i.props;return a!=null?j.cloneElement(i,o,fde(a)):i}return n})},eLr={Badge:"_Badge_1viyg_1"},Cx=({children:t,className:e,variant:r="soft",color:n="secondary",size:i="sm",pill:a,...o})=>H.jsx("div",{className:r_(eLr.Badge,e),"data-color":n,"data-size":i,"data-pill":a?"":void 0,"data-variant":r,...o,children:fde(t)});j.createContext(null);const tLr={LoadingIndicator:"_LoadingIndicator_7yl6f_1"},rLr=({className:t,size:e,strokeWidth:r,style:n,...i})=>H.jsx("div",{...i,className:r_(tLr.LoadingIndicator,t),style:n||tot({"indicator-size":e,"indicator-stroke":r})});function nLr(t){return e=>{t.forEach(r=>{typeof r=="function"?r(e):r!=null&&(r.current=e)})}}const iLr=()=>Zat,pot=(t,e=!1,r="TransitionGroup")=>{const n=[];return j.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},f_=()=>{},p_=t=>{const e=j.useRef(t);return e.current=t,j.useCallback(r=>e.current(r),[])};function aLr(t,e,r,n){const i=t.reduce((l,u)=>({...l,[u.key]:1}),{}),a=e.reduce((l,u)=>({...l,[u.component.key]:1}),{}),o=t.filter(l=>!a[l.key]).map(r),s=e.map(l=>({...l,component:t.find(({key:u})=>u===l.component.key)||l.component,shouldRender:!!i[l.component.key]}));return n==="append"?s.concat(o):o.concat(s)}function oLr(t,e,r){if((Zat||CDr)&&e&&r>1)throw new Error(`Cannot use forwardRef with multiple children in <${t} />`)}const sLr={TransitionGroupChild:"_TransitionGroupChild_1hv1z_1"},got={enter:!1,enterActive:!1,exit:!1,exitActive:!1,interrupted:!1},lLr=t=>({...got,enter:!t}),cLr=(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 got}},uLr=({ref:t,as:e,children:r,className:n,transitionId:i,style:a,preventMountTransition:o,shouldRender:s,enterDuration:l,exitDuration:u,removeChild:h,onEnter:d,onEnterActive:f,onEnterComplete:p,onExit:g,onExitActive:m,onExitComplete:v})=>{const[y,b]=j.useReducer(cLr,lLr(o||!1)),x=j.useRef(!1),w=j.useRef(null),A=j.useRef(l);A.current=l;const S=j.useRef(u);S.current=u;const T=j.useRef(null),C=j.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 pIe.useLayoutEffect(()=>{if(!s){let _;b({type:"exit-before"}),C("exit");const P=sde(()=>{b({type:"exit-active"}),C("exit-active"),_=window.setTimeout(()=>{C("exit-complete"),h()},S.current)});return()=>{P(),_!==void 0&&clearTimeout(_)}}if(o&&!x.current){x.current=!0;return}let k;b({type:"enter-before"}),C("enter");const E=sde(()=>{b({type:"enter-active"}),C("enter-active"),k=window.setTimeout(()=>{b({type:"done"}),C("enter-complete")},A.current)});return()=>{E(),k!==void 0&&clearTimeout(k)}},[s,o,h,C]),j.useEffect(()=>()=>{x.current=!1},[]),H.jsx(e,{ref:nLr([w,t]),className:r_(n,sLr.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})},hLr=t=>{const{enterMountDelay:e,preventMountTransition:r}=t,n=!r&&e!=null?e:null,[i,a]=j.useState(n==null);return Kat(()=>a(!0),i?null:n),i?H.jsx(uLr,{...t}):null},mot=t=>{const{ref:e,as:r="span",children:n,className:i,transitionId:a,style:o,enterDuration:s=0,exitDuration:l=0,preventInitialTransition:u=!0,enterMountDelay:h,insertMethod:d="append",disableAnimations:f=iLr()}=t,p=p_(t.onEnter??f_),g=p_(t.onEnterActive??f_),m=p_(t.onEnterComplete??f_),v=p_(t.onExit??f_),y=p_(t.onExitActive??f_),b=p_(t.onExitComplete??f_);j.Children.forEach(n,S=>{if(S&&!S.key)throw new Error("Child elements of must include a `key`")});const x=j.useCallback(S=>({component:S,shouldRender:!0,removeChild:()=>{A(T=>T.filter(C=>S.key!==C.component.key))},onEnter:p,onEnterActive:g,onEnterComplete:m,onExit:v,onExitActive:y,onExitComplete:b}),[p,g,m,v,y,b]),[w,A]=j.useState(()=>pot(n).map(S=>({...x(S),preventMountTransition:u})));return j.useLayoutEffect(()=>{A(S=>{const T=pot(n);return aLr(T,S,x,d)})},[n,d,x]),oLr("TransitionGroup",e,j.Children.count(n)),f?H.jsx(H.Fragment,{children:j.Children.map(n,S=>H.jsx(r,{ref:e,className:i,style:o,"data-transition-id":a,children:S}))}):H.jsx(H.Fragment,{children:w.map(({component:S,...T})=>H.jsx(hLr,{...T,as:r,className:i,transitionId:a,enterDuration:s,exitDuration:l,enterMountDelay:h,style:o,ref:e,children:S},S.key))})},pde={Button:"_Button_1864l_1",ButtonInner:"_ButtonInner_1864l_4",ButtonLoader:"_ButtonLoader_1864l_749"},dLr=t=>{const{type:e="button",color:r="primary",variant:n="solid",pill:i=!0,uniform:a=!1,size:o="md",iconSize:s,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=j.useCallback(S=>{v||m==null||m(S)},[m,v]);return H.jsxs("button",{type:e,className:r_(pde.Button,g),"data-color":r,"data-variant":n,"data-pill":i?"":void 0,"data-uniform":a?"":void 0,"data-size":o,"data-gutter-size":l,"data-icon-size":s,"data-loading":u?"":void 0,"data-selected":h?"":void 0,"data-block":d?"":void 0,"data-optically-align":f,onPointerEnter:eot,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:[H.jsx(mot,{className:pde.ButtonLoader,enterDuration:250,exitDuration:150,children:u&&H.jsx(rLr,{},"loader")}),H.jsx("span",{className:pde.ButtonInner,children:fde(p)})]})},fLr=t=>H.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...t,children:H.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"})}),pLr=t=>H.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...t,children:H.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"})}),gLr=t=>H.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...t,children:H.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 mLr({branch:t}){return H.jsxs("div",{className:`branch-compare__body${t.status==="running"?" is-streaming":""}`,"aria-live":"polite",children:[t.content?H.jsx(tH,{text:t.content,streaming:t.status==="running"}):null,t.status==="running"?H.jsx("span",{className:"branch-compare__caret","aria-hidden":"true"}):null,t.error?H.jsx("p",{className:"branch-compare__error",children:t.error}):null]})}function vLr({args:t,response:e,status:r,onBranchSelect:n}){const{t:i}=ca("conversation"),a=j.useMemo(()=>aje(t,e,r),[t,e,r]),[o,s]=j.useState(0);return H.jsxs("section",{className:"branch-compare","aria-label":i("blocks.branchCompare.ariaLabel"),children:[H.jsx("div",{className:"branch-compare__tabs",role:"tablist","aria-label":i("blocks.branchCompare.selectDirection"),children:a.branches.map((l,u)=>H.jsx("button",{className:`branch-compare__tab${o===u?" is-active":""}`,type:"button",role:"tab","aria-selected":o===u,"aria-controls":`branch-compare-panel-${u}`,onClick:()=>s(u),children:H.jsx(Cx,{color:"info",size:"sm",variant:"soft",children:l.label})},`${l.label}:${u}`))}),H.jsx("div",{className:"branch-compare__branches",children:a.branches.map((l,u)=>H.jsxs("article",{className:`branch-compare__branch${o===u?" is-active":""}`,id:`branch-compare-panel-${u}`,role:"tabpanel",children:[H.jsx("header",{className:"branch-compare__head",children:H.jsx(Cx,{color:"info",size:"sm",variant:"soft",children:l.label})}),H.jsx(mLr,{branch:l}),H.jsx("footer",{className:"branch-compare__footer",children:H.jsx(dLr,{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 vot({controlled:t,default:e,name:r,state:n="value"}){const{current:i}=j.useRef(t!==void 0),[a,o]=j.useState(e),s=i?t:a,l=j.useCallback(u=>{i||o(u)},[]);return[s,l]}const yot=j.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function yLr(){return j.useContext(yot)}function bLr(t){const{children:e,elementsRef:r,labelsRef:n,onMapChange:i}=t,a=Pn(i),[,o]=j.useState(!1),s=Kp(wLr).current,l=Kp(xLr).current,u=j.useRef(0),h=j.useRef(!0),d=j.useRef([]),f=j.useRef(null),p=Pn(()=>{h.current||(h.current=!0,o(A=>!A))}),g=Pn((A,S)=>{l.set(A,S),p()}),m=Pn(A=>{l.delete(A),p()}),v=Pn(A=>{const S=new Map;return r.current.length=0,n&&(n.current.length=0),A.forEach(T=>{var C,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=(C=T.registration.textRef)==null?void 0:C.current)==null?void 0:k.textContent)??T.element.textContent)}),u.current=r.current.length,S});function y(A){var C;if((C=f.current)==null||C.disconnect(),f.current=null,typeof MutationObserver!="function"||A.length<2)return;const S=new MutationObserver(k=>{if(!TLr(k))return;let E=null;for(const _ of A)if(_.isConnected){if(E&&bot(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=Pn(()=>{const[A,S]=ALr(l),T=v(A);y(S),d.current=A,h.current=!1,s.forEach(C=>C(T)),a(T)});Bn(()=>(h.current||v(d.current),()=>{r.current=[],n&&(n.current=[])}),[r,n,v]),Bn(()=>{h.current&&b()}),Bn(()=>()=>{var A;(A=f.current)==null||A.disconnect(),h.current=!0},[]);const x=Pn(A=>(s.add(A),()=>{s.delete(A)})),w=j.useMemo(()=>({register:g,unregister:m,subscribeMapChange:x,nextIndexRef:u}),[g,m,x,u]);return H.jsx(yot.Provider,{value:w,children:e})}function xLr(){return new Map}function wLr(){return new Set}function ALr(t){const e=new Set,r=[],n=[];t.forEach((a,o)=>{if(!o.isConnected)return;const s=a.index,l={index:s??-1,element:o,registration:a};s===null?n.push(l):s>=0&&(e.add(s),r.push(l))});let i=0;return n.sort((a,o)=>bot(a.element,o.element)),n.forEach(a=>{for(;e.has(i);)i+=1;a.index=i,r.push(a),i+=1}),e.size>0&&r.sort((a,o)=>a.index-o.index),[r,n.map(a=>a.element)]}function SLr(t,e){let r=t.parentElement;for(;r&&!r.contains(e);)r=r.parentElement;return r}function TLr(t){for(const e of t)for(let r=0;rnull},Aot=j.forwardRef(function(e,r){const{render:n,className:i,disabled:a=!1,hiddenUntilFound:o,keepMounted:s,loopFocus:l,onValueChange:u,multiple:h=!1,orientation:d="vertical",value:f,defaultValue:p,style:g,...m}=e,v=j.useMemo(()=>{if(f===void 0)return p??[]},[f,p]),y=j.useRef([]),[b,x]=vot({controlled:f,default:v,name:"Accordion",state:"value"}),w=Pn((C,k,E)=>{if(h)if(k){const _=b.slice();if(_.push(C),u==null||u(_,E),E.isCanceled)return;x(_)}else{const _=b.filter(P=>P!==C);if(u==null||u(_,E),E.isCanceled)return;x(_)}else{const _=b[0]===C?[]:[C];if(u==null||u(_,E),E.isCanceled)return;x(_)}}),A=j.useMemo(()=>({value:b,disabled:a,orientation:d}),[b,a,d]),S=j.useMemo(()=>({disabled:a,handleValueChange:w,hiddenUntilFound:o??!1,keepMounted:s??!1,state:A,value:b}),[a,w,o,s,A,b]),T=eg("div",e,{state:A,ref:r,props:m,stateAttributesMapping:CLr});return H.jsx(xot.Provider,{value:S,children:H.jsx(bLr,{elementsRef:y,children:T})})});function OLr(t){const{open:e,defaultOpen:r,onOpenChange:n,disabled:i}=t,[a,o]=vot({controlled:e,default:r,name:"Collapsible",state:"open"}),{mounted:s,setMounted:l,transitionStatus:u}=BJe(a,!0,!0),h=$E(),[d,f]=j.useState(),p=d===null?void 0:d??h,g=Pn(m=>{const v=!a,y=_s(LE,m.nativeEvent);n(v,y),!y.isCanceled&&o(v)});return j.useMemo(()=>({defaultPanelId:h,disabled:i,handleTrigger:g,mounted:s,open:a,panelId:p,setMounted:l,setOpen:o,setPanelIdState:f,transitionStatus:u}),[h,i,g,s,a,p,l,o,f,u])}const Sot=j.createContext(void 0);function Tot(){const t=j.useContext(Sot);if(t===void 0)throw new Error(iy(15));return t}function kLr(t={}){const{guess:e,label:r,metadata:n,textRef:i,index:a}=t,{register:o,unregister:s,subscribeMapChange:l,nextIndexRef:u}=yLr(),h=j.useRef(-1),[d,f]=j.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=j.useRef(null),m=j.useCallback(v=>{const y=g.current;y&&s(y),g.current=v,v&&o(v,{metadata:n??null,index:a??null,label:r,textRef:i})},[a,o,s,n,r,i]);return Bn(()=>{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 Cot=j.createContext(void 0);function gde(){const t=j.useContext(Cot);if(t===void 0)throw new Error(iy(9));return t}let mde=function(t){return t.open="data-open",t.closed="data-closed",t[t.startingStyle=JQ.startingStyle]="startingStyle",t[t.endingStyle=JQ.endingStyle]="endingStyle",t}({}),ELr=function(t){return t.panelOpen="data-panel-open",t}({});const _Lr={[mde.open]:""},RLr={[mde.closed]:""},DLr={open(t){return t?{[ELr.panelOpen]:""}:null}},LLr={open(t){return t?_Lr:RLr}};let MLr=function(t){return t.index="data-index",t.disabled="data-disabled",t.open="data-open",t}({});const vde={...LLr,index:t=>({[MLr.index]:String(t)}),...YJe,value:()=>null},Oot=j.forwardRef(function(e,r){const{className:n,disabled:i=!1,onOpenChange:a,render:o,value:s,style:l,...u}=e,{ref:h,index:d}=kLr(),f=ME(r,h),{disabled:p,handleValueChange:g,state:m,value:v}=wot(),y=$E(),b=s??y,x=i||p,w=v.indexOf(b)!==-1,A=Pn((M,I)=>{a==null||a(M,I),!I.isCanceled&&g(b,M,I)}),S=OLr({open:w,onOpenChange:A,disabled:x}),T=j.useMemo(()=>({open:S.open,disabled:S.disabled,transitionStatus:S.transitionStatus}),[S.open,S.disabled,S.transitionStatus]),C=j.useMemo(()=>({...S,onOpenChange:A,state:T}),[S,T,A]),k=j.useMemo(()=>({...m,hidden:!w&&!S.mounted,index:d,disabled:x,open:w}),[S.mounted,x,d,w,m]),E=$E(),[_,P]=j.useState(),L=_===null?void 0:_??E,R=j.useMemo(()=>({defaultTriggerId:E,open:w,state:k,setTriggerId:P,triggerId:L}),[E,w,k,P,L]),D=eg("div",e,{state:k,ref:f,props:u,stateAttributesMapping:vde});return H.jsx(Sot.Provider,{value:C,children:H.jsx(Cot.Provider,{value:R,children:D})})}),kot=j.forwardRef(function(e,r){const{render:n,className:i,style:a,...o}=e,{state:s}=gde();return eg("h3",e,{state:s,ref:r,props:o,stateAttributesMapping:vde})}),Eot=j.forwardRef(function(e,r){const{disabled:n,className:i,id:a,render:o,nativeButton:s=!0,style:l,...u}=e,{panelId:h,open:d,handleTrigger:f,disabled:p}=Tot(),g=n||p,{getButtonProps:m,buttonRef:v}=WJe({disabled:g,focusableWhenDisabled:!0,native:s}),{defaultTriggerId:y,state:b,setTriggerId:x}=gde(),w=a||void 0,A=w??y;return Bn(()=>(x(C=>w??(C===null?void 0:C)),()=>{x(C=>C===w?null:C)}),[w,x]),eg("button",e,{state:b,ref:[r,v],props:[{"aria-controls":d?h:void 0,"aria-expanded":d,id:A,onClick:f},u,m],stateAttributesMapping:DLr})}),IN={height:void 0,width:void 0};function ILr(t){const{externalRef:e,hiddenUntilFound:r,id:n,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:l,setOpen:u,transitionStatus:h}=t,d=j.useRef(null),f=j.useRef(null),[p,g]=j.useState(IN),m=j.useRef(IN),v=j.useRef(!1),y=j.useRef(s),b=j.useRef(!1),[x,w]=j.useState(!1),A=j.useRef(null),S=ME(e,d),T=Tu(s),C=Zce(d),k=!s&&!a,E=x?"idle":h,_=s&&(y.current||b.current),P=!s&&a&&f.current==="css-animation"&&p.height===void 0&&p.width===void 0?m.current:p,L=r&&k&&f.current!=="css-animation",R=Pn((F,B=!0)=>{B&&(m.current=F),g(F)}),D=Pn(()=>{var F;(F=A.current)==null||F.call(A),A.current=null}),M=Pn(F=>{D(),A.current=()=>{A.current=null,F()}}),I=Pn(()=>{s&&a&&f.current==="css-animation"&&(b.current=!0)});Bn(()=>{!x||h==="starting"||w(!1)},[x,h]),j.useEffect(()=>()=>{I(),D()},[I,D]),Bn(()=>{const F=d.current;if(!F)return;!s&&A.current&&D();const B=PLr(F,_);if(f.current=B,s&&h==="idle"&&y.current&&B==="css-animation"){m.current=g_(F);return}if(s&&h==="starting"){const U=v.current;if(v.current=!1,B==="none"){R(g_(F)),w(!0);return}if(B==="css-transition"){const q=NLr(F);if(R(g_(F)),!U)return q;const Y=nH(F,"transition-duration","0s");return M(Y),w(!0),q}R(g_(F));const Q=nH(F,"animation-name","none");if(!U){Q();return}const G=nH(F,"animation-duration","0s");Q(),M(G),w(!0);return}if(!s&&a&&(h==="idle"||h==="starting")){if(y.current=!1,b.current=!1,B==="none"){R(IN,!1),l(!1);return}R(g_(F));return}if(h!=="ending")return;if(B==="none"){l(!1);return}const V=g_(F);if(!(V.height>0||V.width>0)){l(!1);return}R(V),B==="css-animation"&&nH(F,"animation-name","none")()},[a,s,D,R,l,M,_,h]),Jce({enabled:s&&a&&E==="idle",open:!0,ref:d,onComplete(){s&&R(IN,!1)}}),j.useEffect(()=>{if(s||!a||E!=="ending"||!d.current)return;const B=new AbortController;let V=-1;function z(){T.current||(l(!1),R(IN,!1))}return V=Lh.request(()=>{C(z,B.signal)}),()=>{Lh.cancel(V),B.abort()}},[T,a,s,E,C,R,l]),Bn(()=>{const F=d.current;!F||!r||!k||F.setAttribute("hidden","until-found")},[k,r]),j.useEffect(function(){const B=d.current;if(!B)return;function V(z){const U=_s(AZe,z);o(!0,U),!U.isCanceled&&(v.current=!0,u(!0))}return bi(B,"beforematch",V)},[o,u]);const N=i||r||a||s;return{height:P.height,props:{...L?{[mde.startingStyle]:""}:void 0,hidden:k,id:n},ref:S,shouldPreventOpenAnimation:_,shouldRender:N,transitionStatus:E,width:P.width}}function g_(t){return{height:t.scrollHeight,width:t.scrollWidth}}function PLr(t,e){const r=cs(t).getComputedStyle(t),n=(r.animationName.split(",").map(a=>a.trim()).some(a=>a!==""&&a!=="none")||e)&&_ot(r.animationDuration),i=_ot(r.transitionDuration);return n&&i||i?"css-transition":n?"css-animation":"none"}function _ot(t){return t.split(",").map(e=>e.trim()).some(e=>e!==""&&Number.parseFloat(e)>0)}function nH(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 NLr(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=Lh.request(r);return()=>{Lh.cancel(n),r()}}let Rot=function(t){return t.accordionPanelHeight="--accordion-panel-height",t.accordionPanelWidth="--accordion-panel-width",t}({});const Dot=j.forwardRef(function(e,r){const{className:n,hiddenUntilFound:i,keepMounted:a,id:o,render:s,style:l,...u}=e,{hiddenUntilFound:h,keepMounted:d}=wot(),{defaultPanelId:f,mounted:p,onOpenChange:g,open:m,setMounted:v,setOpen:y,setPanelIdState:b,transitionStatus:x}=Tot(),w=i??h,A=a??d,S=o||void 0,T=o??f;Bn(()=>(b(B=>S??(B===null?void 0:B)),()=>{b(B=>B===S?null:B)}),[S,b]);const{height:C,props:k,ref:E,shouldPreventOpenAnimation:_,shouldRender:P,transitionStatus:L,width:R}=ILr({externalRef:r,hiddenUntilFound:w,id:T,keepMounted:A,mounted:p,onOpenChange:g,open:m,setMounted:v,setOpen:y,transitionStatus:x}),{state:D,triggerId:M}=gde(),I={...D,transitionStatus:L},N=KZe(l,I),F=eg("div",{...e,style:void 0},{state:I,ref:E,props:[k,{"aria-labelledby":M,role:"region",style:{[Rot.accordionPanelHeight]:C===void 0?"auto":`${C}px`,[Rot.accordionPanelWidth]:R===void 0?"auto":`${R}px`}},u,N?{style:N}:void 0,_?{style:{animationName:"none"}}:void 0],stateAttributesMapping:vde});return P?F:null});function yde(t){const e=j.useRef(t);return e.current=t,e}let m_=[],iH=!1;const Lot=t=>{var e,r;if(t.key==="Escape"){const[n]=m_;n&&(t.preventDefault(),(r=(e=n.callback).current)==null||r.call(e))}},Mot=()=>{m_.length>0&&!iH?(document.body.addEventListener("keydown",Lot),iH=!0):m_.length===0&&iH&&(document.body.removeEventListener("keydown",Lot),iH=!1)},BLr=t=>{m_.unshift(t),Mot()},$Lr=({id:t})=>{m_=m_.filter(e=>e.id!==t),Mot()},FLr=(t,e)=>{const r=j.useId(),n=yde(e);j.useEffect(()=>{if(!t)return;const i={id:r,callback:n};return BLr(i),()=>$Lr(i)},[r,t,n])},zLr=(t,e)=>{const r=t.currentTarget,n={x:t.clientX,y:t.clientY},i=ULr(n,r.getBoundingClientRect()),a=VLr(n,i),o=QLr(e.getBoundingClientRect());return HLr([...a,...o])};function ULr(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 VLr(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 QLr(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 GLr(t,e){const{x:r,y:n}=t;let i=!1;for(let a=0,o=e.length-1;an!=f>n&&r<(d-u)*(n-h)/(f-h)+u&&(i=!i)}return i}function HLr(t){const e=t.slice();return e.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),WLr(e)}function WLr(t){if(t.length<=1)return t.slice();const e=[];for(let n=0;n=2;){const a=e[e.length-1],o=e[e.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.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],o=r[r.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.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 Iot={Transition:"_Transition_1wdpp_1",Popover:"_Popover_1wdpp_3"},Pot=j.createContext(null),aH=()=>{const t=j.use(Pot);if(!t)throw new Error("Popover components must be wrapped in ");return t},PN=({open:t,onOpenChange:e,showOnHover:r=!1,hoverOpenDelay:n=150,children:i})=>{const[a,o]=j.useState(!1),[s,l]=j.useState(!1),u=j.useRef(null),h=j.useRef(null),d=j.useRef(void 0),f=j.useRef(!1),p=j.useRef(!1),g=t??a,[m,v]=j.useState(!1);Kat(()=>v(!1),m?500:null);const y=yde(e),b=yde(T=>{var C,k;clearTimeout(d.current),g!==T&&(T||(l(!1),r&&f.current&&((C=u.current)==null||C.focus()),f.current=!1),(k=y.current)==null||k.call(y,T),o(T),r&&v(T))}),x=j.useCallback(T=>{b.current(T)},[b]),w=j.useCallback(()=>{d.current=setTimeout(()=>x(!0),n)},[x,n]),A=j.useCallback(()=>{clearTimeout(d.current)},[]);j.useEffect(()=>()=>{clearTimeout(d.current)},[]);const S=j.useMemo(()=>({open:g,setOpen:x,shake:s,setShake:l,showOnHover:r,temporarilyPreventClickToClose:m,onTriggerEnter:w,onTriggerLeave:A,isPointerInTransitRef:p,triggerRef:u,contentRef:h,hoverOpenFocusedWithTab:f}),[g,x,s,l,r,m,f,p,w,A]);return H.jsx(Pot,{value:S,children:H.jsx(iDr,{open:g,onOpenChange:x,modal:!1,children:i})})},YLr=({children:t,onPointerDown:e,onClick:r})=>{const{setOpen:n,showOnHover:i,temporarilyPreventClickToClose:a,onTriggerEnter:o,onTriggerLeave:s,isPointerInTransitRef:l,triggerRef:u,contentRef:h}=aH(),d=j.useRef(!1),f=m=>{!(m.currentTarget.nodeName.toLocaleLowerCase()==="a")&&a&&(m.preventDefault(),m.stopPropagation())},p=m=>{m.pointerType!=="touch"&&!d.current&&!l.current&&(o(),d.current=!0)},g=()=>{d.current&&(s(),d.current=!1)};return H.jsx(aDr,{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})},Not=({children:t,avoidCollisions:e,width:r,minWidth:n,maxWidth:i,side:a,sideOffset:o=8,align:s,alignOffset:l,translucent:u,className:h,autoFocus:d=!0})=>{const{showOnHover:f,shake:p,contentRef:g}=aH(),m=v=>{const y=g.current;if(y&&v.target===y&&v.key==="Tab"&&v.shiftKey){v.preventDefault(),v.stopPropagation();const b=rot(y),x=b[b.length-1];x==null||x.focus()}};return j.useEffect(()=>{const v=g.current;!v||!d||v!=null&&v.contains(document.activeElement)||f||v.focus({preventScroll:!0})},[g,f,d]),H.jsx(sDr,{forceMount:!0,ref:g,className:r_(Iot.Popover,h),style:tot({"popover-width":r,"popover-min-width":n,"popover-max-width":i}),onCloseAutoFocus:f?lde:void 0,"data-animate":p?"shake":void 0,"data-translucent":u?"true":void 0,side:a,sideOffset:o,align:s,alignOffset:l??(s==="center"?0:-5),avoidCollisions:e??!0,hideWhenDetached:!0,collisionPadding:20,onOpenAutoFocus:lde,onEscapeKeyDown:lde,onKeyDown:m,children:t})},qLr=t=>{const{setOpen:e,triggerRef:r,contentRef:n,isPointerInTransitRef:i,hoverOpenFocusedWithTab:a}=aH(),[o,s]=j.useState(null),l=j.useCallback(()=>{s(null),i.current=!1},[i]),u=j.useCallback((h,d)=>{const f=zLr(h,d);s(f),i.current=!0},[i]);return j.useEffect(()=>()=>l(),[l]),j.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]),j.useEffect(()=>{if(!o)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=!GLr(m,o),b=g.hasAttribute("aria-haspopup");v?l():(y||b)&&(l(),e(!1))};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)},[o,e,l,r,n]),j.useEffect(()=>{const h=d=>{if(n.current&&d.key==="Tab"&&!d.shiftKey){const[f]=rot(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]),H.jsx(Not,{...t})},jLr=t=>{const{open:e,showOnHover:r,setOpen:n}=aH();return FLr(e,()=>{n(!1)}),H.jsx(oDr,{forceMount:!0,children:H.jsx(mot,{enterDuration:600,exitDuration:300,className:Iot.Transition,disableAnimations:!0,children:e&&(r?H.jsx(qLr,{...t},"popover-hover"):H.jsx(Not,{...t},"popover"))})})};PN.Trigger=YLr,PN.Content=jLr,j.createContext(null),j.createContext(null),j.createContext(null),j.createContext(null);function bde(...t){return t.filter(Boolean).join(" ")}const Bot=[["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 XLr(t){let e=2166136261;for(const o of t)e^=o.charCodeAt(0),e=Math.imul(e,16777619);const r=e>>>0,[n,i,a]=Bot[r%Bot.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 KLr({seed:t,className:e}){return H.jsx("span",{className:bde("resource-card__identity-mark",e),style:XLr(t),"aria-hidden":"true"})}j.forwardRef(function({className:e,...r},n){return H.jsx("section",{ref:n,className:bde("resource-results",e),...r})});function ZLr({className:t,footer:e,actions:r,activateLabel:n,onActivate:i,children:a,...o}){return H.jsxs("article",{className:bde("resource-card",i&&"is-interactive",t),...o,children:[i&&n?H.jsx("button",{type:"button",className:"resource-card__target","aria-label":n,title:n,onClick:i}):null,H.jsx("div",{className:"resource-card__content",children:a}),e||r?H.jsxs("footer",{className:"resource-card__footer",children:[e,r?H.jsx("div",{className:"resource-card__actions",children:r}):null]}):null]})}function JLr({leading:t,title:e,titleText:r,subtitle:n,status:i}){return H.jsxs("div",{className:"resource-card__header",children:[H.jsxs("div",{className:"resource-card__identity",children:[t,H.jsxs("div",{className:"resource-card__title-copy",children:[H.jsx("h3",{title:r,children:e}),n]})]}),i]})}function eMr({children:t,title:e}){return H.jsx("p",{className:"resource-card__description",title:e,children:t})}function tMr(t){return H.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...t,children:[H.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"}),H.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"}),H.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 rMr=["skill_hub","skill_space","knowledge_base","tool"];function $ot(t){return H.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:H.jsx("path",{d:"m4 6 4 4 4-4"})})}function Fot({label:t}){return H.jsx("div",{className:"create-agent-card__loading",role:"status","aria-label":t,children:[0,1,2].map(e=>H.jsxs("div",{className:"create-agent-card__skeleton-row","aria-hidden":"true",children:[H.jsx("span",{}),H.jsx("span",{})]},e))})}function nMr(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 xde({label:t,resources:e}){const{t:r}=ca("conversation");return e.length===0?null:H.jsxs("section",{className:"create-agent-card__popover-section",children:[H.jsx("h4",{children:t}),H.jsx("div",{className:"create-agent-card__popover-list",children:e.map(n=>H.jsxs("div",{className:"create-agent-card__popover-item",children:[H.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[H.jsx("strong",{children:n.name}),H.jsx(Cx,{color:"secondary",size:"sm",variant:"soft",children:nMr(n,r)})]}),n.description?H.jsx("p",{children:n.description}):null]},n.ref))})]})}function iMr({tools:t}){const{t:e}=ca("conversation");return t.length===0?null:H.jsxs("section",{className:"create-agent-card__popover-section",children:[H.jsx("h4",{children:e("blocks.createAgents.selfAuthoredTools")}),H.jsx(Aot,{children:t.map((r,n)=>H.jsxs(Oot,{className:"create-agent-card__python-tool",value:`${r.name}:${n}`,children:[H.jsx(kot,{className:"create-agent-card__python-tool-header",children:H.jsxs(Eot,{className:"create-agent-card__python-tool-trigger",children:[H.jsxs("span",{children:[H.jsx("strong",{children:r.name}),r.description?H.jsx("small",{children:r.description}):null]}),H.jsxs("span",{className:"create-agent-card__python-tool-meta",children:[H.jsx(Cx,{color:"secondary",size:"sm",variant:"soft",children:e("blocks.createAgents.selfAuthoredTools")}),H.jsx($ot,{className:"create-agent-card__python-tool-chevron"})]})]})}),H.jsxs(Dot,{className:"create-agent-card__python-tool-panel",children:[r.dependencies.length>0?H.jsx("div",{className:"create-agent-card__python-tool-dependencies",children:e("blocks.createAgents.dependencies",{items:r.dependencies.join(", ")})}):null,H.jsx("pre",{tabIndex:0,"aria-label":e("blocks.createAgents.fullCode",{name:r.name}),children:H.jsx("code",{children:r.code})})]})]},`${r.name}:${n}`))})]})}function aMr({agents:t}){const{t:e}=ca("conversation");return t.length===0?null:H.jsxs("section",{className:"create-agent-card__popover-section",children:[H.jsx("h4",{children:e("blocks.createAgents.subAgents")}),H.jsx("div",{className:"create-agent-card__popover-list",children:t.map(r=>H.jsxs("div",{className:"create-agent-card__popover-item",children:[H.jsxs("div",{className:"create-agent-card__popover-item-heading",children:[H.jsx("strong",{children:r.id}),H.jsx(Cx,{color:"secondary",size:"sm",variant:"soft",children:e(`blocks.createAgents.agentTypes.${r.type}`,{defaultValue:r.type})})]}),r.description?H.jsx("p",{children:r.description}):null]},r.id))})]})}function oH({label:t,count:e,icon:r,children:n}){const{t:i}=ca("conversation"),a=H.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,H.jsx("span",{children:e})]});return e===0?a:H.jsxs(PN,{showOnHover:!0,hoverOpenDelay:120,children:[H.jsx(PN.Trigger,{children:a}),H.jsx(PN.Content,{side:"top",align:"start",minWidth:"auto",maxWidth:360,className:"create-agent-card__resource-popover",children:n})]})}function oMr({response:t,status:e}){const{t:r}=ca("conversation"),n=j.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=j.useMemo(()=>XDr(t,n),[n,t]),a=j.useMemo(()=>rMr.map(l=>{const u=KDr(i,l);return{value:l,label:r(`blocks.createAgents.categories.${l}`),...u,searchKeywords:[...new Set(u.sources.flatMap(h=>h.searchKeywords))]}}),[i,r]),o=e==="failed",s=o?rH(t):"";return H.jsx("section",{className:"create-agent-tool-card","aria-label":r("blocks.createAgents.collectionAria"),children:e==="running"?H.jsx(Fot,{label:r("blocks.createAgents.retrieving")}):o?H.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[H.jsx("span",{className:"create-agent-card__message-title",children:r("blocks.createAgents.retrievalFailed")}),H.jsx("span",{children:s||r("blocks.createAgents.checkConfig")})]}):H.jsx(Aot,{className:"create-agent-card__accordion",children:a.map(l=>H.jsxs(Oot,{className:"create-agent-card__accordion-item",value:l.value,children:[H.jsx(kot,{className:"create-agent-card__accordion-header",children:H.jsxs(Eot,{className:"create-agent-card__accordion-trigger",children:[H.jsx("span",{children:l.label}),H.jsxs("span",{className:"create-agent-card__accordion-meta",children:[H.jsx(Cx,{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}),H.jsx($ot,{className:"create-agent-card__accordion-chevron"})]})]})}),H.jsx(Dot,{className:"create-agent-card__accordion-content",children:H.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?H.jsxs("div",{className:"create-agent-card__search-keywords",children:[H.jsx("span",{children:r("blocks.createAgents.searchKeywords")}),H.jsx("span",{children:l.searchKeywords.join("、")})]}):null,l.resources.length>0?H.jsx("div",{className:"create-agent-card__resource-list",children:l.resources.map(u=>H.jsx("div",{className:"create-agent-card__resource",children:H.jsxs("div",{className:"create-agent-card__resource-main",children:[H.jsxs("div",{className:"create-agent-card__resource-title",children:[H.jsx("span",{className:"create-agent-card__resource-name",children:u.name}),u.version?H.jsx(Cx,{className:"create-agent-card__resource-version",color:"secondary",size:"sm",variant:"soft",children:u.version}):null]}),u.description?H.jsx("p",{children:u.description}):null]})},u.ref))}):H.jsxs("div",{className:"create-agent-card__empty-category",children:[H.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=>H.jsx("p",{className:"create-agent-card__raw-source-error",children:u.message},u.source))]})]})})]},l.value))},i.collectionId||"collected-resources")})}function sMr({args:t,response:e,status:r}){const{t:n}=ca("conversation"),i=j.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=j.useMemo(()=>hot(t,e,i),[t,i,e]),o=r==="failed"?rH(e):"";return H.jsxs("section",{className:"create-agent-tool-card is-agent-results","aria-label":n("blocks.createAgents.resultAria"),children:[o?H.jsxs("div",{className:"create-agent-card__message is-error",role:"alert",children:[H.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.creationFailed")}),H.jsx("span",{children:o})]}):null,a.agents.length>0?H.jsx("div",{className:"create-agent-card__agent-grid",children:a.agents.map(s=>{const l=r==="failed"?"failed":s.status,u=s.error||l==="failed"&&o,h=s.builtinTools.length+s.pythonTools.length;return H.jsxs(ZLr,{className:`create-agent-card__agent-card${u?" is-error":""}`,children:[H.jsx(JLr,{leading:H.jsx(KLr,{seed:s.name}),title:s.name,titleText:s.name,status:H.jsx(Cx,{color:"secondary",size:"sm",variant:"soft",children:n(`blocks.createAgents.agentTypes.${s.rootType}`,{defaultValue:s.rootType})})}),s.description?H.jsx(eMr,{children:s.description}):null,u?H.jsx("div",{className:"create-agent-card__agent-result is-error",role:"alert",children:u}):null,H.jsxs("div",{className:"create-agent-card__agent-resources","aria-label":n("blocks.createAgents.agentResources",{name:s.name}),children:[H.jsx(oH,{label:n("blocks.createAgents.skill"),count:s.skills.length,icon:H.jsx(pLr,{"aria-hidden":"true"}),children:H.jsx(xde,{label:n("blocks.createAgents.skill"),resources:s.skills})}),H.jsx(oH,{label:n("blocks.createAgents.knowledgeBase"),count:s.knowledgeBases.length,icon:H.jsx(tMr,{"aria-hidden":"true"}),children:H.jsx(xde,{label:n("blocks.createAgents.knowledgeBase"),resources:s.knowledgeBases})}),H.jsxs(oH,{label:n("blocks.createAgents.toolsLabel"),count:h,icon:H.jsx(fLr,{"aria-hidden":"true"}),children:[H.jsx(xde,{label:n("blocks.createAgents.builtinTool"),resources:s.builtinTools}),H.jsx(iMr,{tools:s.pythonTools})]}),H.jsx(oH,{label:n("blocks.createAgents.subAgents"),count:s.subAgentCount,icon:H.jsx(gLr,{"aria-hidden":"true"}),children:H.jsx(aMr,{agents:s.subAgents})})]})]},s.name)})}):r==="running"?H.jsx(Fot,{label:n("blocks.createAgents.creating")}):H.jsxs("div",{className:"create-agent-card__message",children:[H.jsx("span",{className:"create-agent-card__message-title",children:n("blocks.createAgents.noAgents")}),H.jsx("span",{children:n("blocks.createAgents.noAgentResult")})]})]})}const lMr={web_search:{name:"web_search",runningLabel:"Searching the web",doneLabel:"Web search complete",tone:"search",icon:set},link_reader:{name:"link_reader",runningLabel:"Reading webpage",doneLabel:"Webpage read complete",tone:"search",icon:set},run_code:{name:"run_code",runningLabel:"Running code in the AgentKit sandbox",doneLabel:"Code execution completed in the AgentKit sandbox",tone:"sandbox",icon:Abr},list_envs:{name:"list_envs",runningLabel:"Checking available environments",doneLabel:"Available environments loaded",tone:"resources",icon:Tbr},get_env_manifest:{name:"get_env_manifest",runningLabel:"Loading the environment manifest",doneLabel:"Environment manifest loaded",tone:"knowledge",icon:Cbr},execute_in_sandbox:{name:"execute_in_sandbox",runningLabel:"Running a command in the environment",doneLabel:"Command completed in the environment",tone:"sandbox",icon:uet},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:uet},image_generate:{name:"image_generate",runningLabel:"Generating image",doneLabel:"Image generated",tone:"image",icon:mbr},video_generate:{name:"video_generate",runningLabel:"Generating video",doneLabel:"Video generated",tone:"video",icon:vbr},ppt_generate:{name:"ppt_generate",runningLabel:"Generating presentation",doneLabel:"Presentation generated",tone:"presentation",icon:ybr},load_memory:{name:"load_memory",runningLabel:"Searching long-term memory",doneLabel:"Memory search complete",tone:"memory",icon:bbr},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"Searching the knowledge base",doneLabel:"Knowledge base search complete",tone:"knowledge",icon:xbr},load_skill:{name:"load_skill",runningLabel:"Loading skill",doneLabel:"Skill loaded",tone:"skill",icon:wbr},collect_resources:{name:"collect_resources",runningLabel:"Collecting available resources",doneLabel:"Resource collection complete",failedLabel:"Resource collection failed",tone:"resources",icon:Sbr,detailRenderer:oMr},create_agents:{name:"create_agents",runningLabel:"Creating and running agents",doneLabel:"Agent creation complete",failedLabel:"Agent creation failed",tone:"agent",icon:cet,detailRenderer:sMr},branch_compare:{name:"branch_compare",runningLabel:"",doneLabel:"",failedLabel:"",tone:"search",icon:cet,detailRenderer:vLr,hideHeader:!0}};function cMr(t){return lMr[t]}function uMr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.jsx("path",{d:"M6 3h8l4 4v14H6Z"}),H.jsx("path",{d:"M14 3v5h5"}),H.jsx("path",{d:"m10 12-2 2 2 2M14 12l2 2-2 2"})]})}function hMr(t){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[H.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"}),H.jsx("path",{d:"m9 12 2 2 4-4"})]})}$f.hasResourceBundle("en-US","workspaceTools")||$f.addResourceBundle("en-US","workspaceTools",kUe,!0,!0),$f.hasResourceBundle("zh-CN","workspaceTools")||$f.addResourceBundle("zh-CN","workspaceTools",Oqe,!0,!0);function dMr(t,e){const r=new Map(t.map(o=>[o.path,o.content])),n=new Map(e.map(o=>[o.path,o.content])),i=new Set([...r.keys(),...n.keys()]),a=[];for(const o of[...i].sort((s,l)=>s.localeCompare(l))){const s=r.get(o),l=n.get(o);s!==l&&a.push({path:o,status:s===void 0?"added":l===void 0?"deleted":"modified",before:s??"",after:l??""})}return a}function QA(t){return{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,...t}}function fMr(t){return H.jsx("svg",{...QA(t),children:H.jsx("path",{d:"m9 7-5 5 5 5M15 7l5 5-5 5M13.5 4l-3 16"})})}function wde(t){return H.jsx("svg",{...QA(t),children:H.jsx("path",{d:"M6.5 3.75h7l4 4V20.25h-11zM13.5 3.75v4h4M9 12h6M9 15.5h4.5"})})}function pMr(t){return H.jsx("svg",{...QA(t),children:H.jsx("path",{d:"M3.75 7.25h6l1.75 2h8.75v9.25H3.75zM3.75 7.25V5.5h5l1.5 1.75"})})}function gMr(t){return H.jsx("svg",{...QA(t),children:H.jsx("path",{d:"m9 5 7 7-7 7"})})}function mMr(t){return H.jsx("svg",{...QA(t),children:H.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function vMr(t){return H.jsxs("svg",{...QA(t),children:[H.jsx("circle",{cx:"12",cy:"12",r:"3.25"}),H.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 yMr(t){return H.jsx("svg",{...QA(t),children:H.jsx("path",{d:"M19.25 15.25A8 8 0 0 1 8.75 4.75a8 8 0 1 0 10.5 10.5Z"})})}const bMr=j.lazy(()=>Promise.resolve().then(()=>Kkn)),xMr=j.lazy(()=>Promise.resolve().then(()=>_En)),zot="veadk-code-workspace-theme";function wMr(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,o)=>{let s=i.children.get(a);s||(s={name:a,children:new Map},i.children.set(a,s)),o===n.length-1&&(s.path=r.path),i=s})}return e}function AMr(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 SMr(){if(typeof window>"u")return"light";try{return window.localStorage.getItem(zot)==="dark"?"dark":"light"}catch{return"light"}}function TMr(t){return t===""?0:t.split(` +`).length}function Uot({project:t,open:e,onClose:r,onChange:n,readOnly:i=!1,comparison:a}){var L;const{t:o}=ca("workspaceTools"),s=j.useId(),l=j.useRef(null),u=j.useRef(null),h=j.useRef(r),[d,f]=j.useState(SMr),p=j.useMemo(()=>a?dMr(a.baseProject.files,t.files):[],[a,t.files]),g=j.useMemo(()=>a?p.map(R=>({path:R.path,content:R.status==="deleted"?R.before:R.after})):t.files,[p,a,t.files]),m=j.useMemo(()=>new Map(p.map(R=>[R.path,R.status])),[p]),[v,y]=j.useState(((L=g[0])==null?void 0:L.path)??null),[b,x]=j.useState(new Set),w=j.useMemo(()=>wMr(g),[g]),A=g.find(R=>R.path===v)??null,S=p.find(R=>R.path===v)??null;if(h.current=r,j.useEffect(()=>{try{window.localStorage.setItem(zot,d)}catch{}},[d]),j.useEffect(()=>{var I;if(!e)return;const R=document.body.style.overflow,D=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(I=u.current)==null||I.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]),j.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 C(R){return R?H.jsx("span",{className:`code-browser-change is-${R}`,children:o(`codeBrowser.change.${R}`)}):null}function k(R,D,M){return AMr(R,D===0).map(I=>{const N=M?`${M}/${I.name}`:I.name;if(!(I.children.size>0&&I.path===void 0)&&I.path){const V=m.get(I.path);return H.jsxs("button",{type:"button",className:`code-browser-file${v===I.path?" is-active":""}`,style:{paddingLeft:`${12+D*16}px`},onClick:()=>y(I.path??null),title:I.path,"aria-pressed":v===I.path,children:[H.jsx(wde,{}),H.jsx("span",{children:I.name}),C(V)]},N)}const B=b.has(N);return H.jsxs("div",{children:[H.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+D*16}px`},onClick:()=>T(N),"aria-expanded":!B,children:[H.jsx(gMr,{className:B?"":"is-open"}),H.jsx(pMr,{}),H.jsx("span",{children:I.name})]}),!B&&k(I,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",P=o(a?"codeBrowser.noChanges":"codeBrowser.chooseFile");return kf.createPortal(H.jsx("div",{className:"code-browser-backdrop",onMouseDown:R=>{R.target===R.currentTarget&&r()},children:H.jsxs("section",{ref:l,className:`code-browser-dialog is-${d}`,role:"dialog","aria-modal":"true","aria-labelledby":s,children:[H.jsxs("header",{className:"code-browser-head",children:[H.jsxs("div",{className:"code-browser-title-wrap",children:[H.jsx("span",{className:"code-browser-title-icon",children:H.jsx(fMr,{})}),H.jsxs("div",{children:[H.jsx("h2",{id:s,children:o(a?"codeBrowser.compareTitle":"codeBrowser.workspaceTitle")}),H.jsx("p",{title:t.name,children:t.name||o("codeBrowser.projectFallback")})]})]}),H.jsxs("div",{className:"code-browser-head-actions",children:[H.jsx("button",{type:"button",className:"code-browser-icon-button",onClick:()=>f(_),"aria-label":o("codeBrowser.switchTheme"),title:o("codeBrowser.switchThemeTitle",{theme:o(`codeBrowser.themes.${_}`)}),children:d==="light"?H.jsx(yMr,{}):H.jsx(vMr,{})}),H.jsx("button",{ref:u,type:"button",className:"code-browser-icon-button",onClick:r,"aria-label":o("codeBrowser.closeWorkspace"),title:o("codeBrowser.close"),children:H.jsx(mMr,{})})]})]}),H.jsxs("div",{className:"code-browser-workspace",children:[H.jsxs("aside",{className:"code-browser-sidebar","aria-label":o(a?"codeBrowser.changedFiles":"codeBrowser.projectFiles"),children:[H.jsxs("div",{className:"code-browser-sidebar-head",children:[H.jsx("span",{children:o(a?"codeBrowser.changes":"codeBrowser.files")}),H.jsx("span",{children:g.length})]}),H.jsx("div",{className:"code-browser-tree",children:g.length>0?k(w,0,""):H.jsx("div",{className:"code-browser-empty",children:P})})]}),H.jsxs("main",{className:"code-browser-main",children:[H.jsx("div",{className:"code-browser-tabs",role:"tablist","aria-label":o("codeBrowser.openFiles"),children:A?H.jsxs("div",{className:"code-browser-tab",role:"tab","aria-selected":"true",children:[H.jsx(wde,{}),H.jsx("span",{children:A.path.split("/").pop()}),C(S==null?void 0:S.status)]}):null}),H.jsxs("div",{className:"code-browser-path",children:[H.jsx(wde,{}),H.jsx("span",{children:(A==null?void 0:A.path)??o("codeBrowser.noFileSelected")})]}),a?H.jsxs("div",{className:"code-browser-diff-labels","aria-label":o("codeBrowser.comparisonDirection"),children:[H.jsx("span",{children:a.baseLabel??o("codeBrowser.before")}),H.jsx("span",{children:a.targetLabel??o("codeBrowser.after")})]}):null,H.jsx("div",{className:"code-browser-editor",children:A?H.jsx(j.Suspense,{fallback:H.jsx("div",{className:"code-browser-empty",children:o("codeBrowser.loadingEditor")}),children:S?H.jsx(xMr,{before:S.before,after:S.after,path:S.path,theme:d}):H.jsx(bMr,{value:A.content,path:A.path,onChange:E,readOnly:i,theme:d})}):H.jsx("div",{className:"code-browser-empty",children:P})}),H.jsxs("footer",{className:"code-browser-statusbar",children:[H.jsx("span",{children:a?o("codeBrowser.changedFileCount",{count:p.length}):o("codeBrowser.fileCount",{count:t.files.length})}),H.jsx("span",{children:A?o("codeBrowser.lineCount",{count:TMr(A.content)}):"UTF-8"})]})]})]})]})}),document.body)}const Vot="send_a2ui_json_to_client",CMr=28,OMr=3e3;function kMr(t,e,r){let n=e;for(let i=0;i65535?2:1}return n}function EMr(t){return t<=4?1:Math.min(18,Math.max(2,Math.ceil(t/6)))}function Qot(t,e,r,n){const[i,a]=j.useState(()=>e?"":t),o=j.useRef(i),s=j.useRef(t),l=j.useRef(null),u=j.useRef(0),h=j.useRef(r);return s.current=t,h.current=r,j.useEffect(()=>{const d=o.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&&(o.current=t,a(t));return}if(d===t||l.current!==null)return;const p=g=>{const m=s.current,v=o.current;if(!m.startsWith(v)){o.current=m,a(m),l.current=null;return}if(g-u.current{var d;(d=h.current)==null||d.call(h)},[i]),j.useEffect(()=>{i===t&&(n==null||n())},[i,n,t]),j.useEffect(()=>()=>{l.current!==null&&(window.cancelAnimationFrame(l.current),l.current=null)},[]),i}function _Mr(){return H.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:H.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 RMr(){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[H.jsx("path",{d:"m4.5 7 1.8 1.8L9.5 5.5"}),H.jsx("path",{d:"M12 7h7.5"}),H.jsx("path",{d:"m4.5 13 1.8 1.8 3.2-3.3"}),H.jsx("path",{d:"M12 13h7.5"}),H.jsx("path",{d:"M5 19h4"}),H.jsx("path",{d:"M12 19h7.5"})]})}function DMr(){return H.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[H.jsx("path",{d:"M5 5v7.25A3.75 3.75 0 0 0 8.75 16H19"}),H.jsx("path",{d:"m15.5 12.5 3.5 3.5-3.5 3.5"})]})}function LMr({activity:t}){const{t:e}=ca("conversation"),r=[["Agent Session",t.agentSessionId],["Sandbox Session",t.sandboxSessionId],["Codex Thread",t.threadId]].filter(n=>!!n[1]);return r.length?H.jsx("dl",{className:"codex-sandbox-run__identity","aria-label":e("blocks.sandboxIdentity"),children:r.map(([n,i])=>H.jsxs("div",{children:[H.jsx("dt",{children:n}),H.jsx("dd",{title:i,children:i})]},n))}):null}function MMr(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 Got({text:t,done:e,answerStarted:r=!1,streaming:n=!1,onStreamFrame:i}){const{t:a}=ca("conversation"),[o,s]=j.useState(!(e||r)),l=j.useRef(!1);j.useEffect(()=>{l.current||s(!(e||r))},[r,e]);const u=()=>{l.current=!0,s(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=Uot(h,!e||n,i),{ref:f,onScroll:p}=zbr(d);return H.jsxs("div",{className:"block-thinking",children:[H.jsxs("button",{className:"think-head",onClick:u,type:"button",children:[H.jsx("span",{className:"think-icon","aria-hidden":"true",children:H.jsx(aue,{className:`thinking-logo ${e?"":"is-active"}`})}),e?H.jsx("span",{className:"think-label think-label--done",children:a("blocks.thinkingDone")}):H.jsx(ym,{className:"think-label",duration:2.4,spread:18,children:a("blocks.thinking")}),H.jsx(Sdr,{className:`chev ${o?"open":""}`})]}),H.jsx("div",{className:`think-collapse ${o&&d?"open":""}`,children:H.jsx("div",{className:"think-collapse-inner",children:H.jsx("div",{className:"think-body scroll",ref:f,onScroll:p,children:d})})})]})}function LMr({text:t}){return H.jsx("div",{className:"block-progress",role:"status","aria-live":"polite","aria-atomic":"true",children:H.jsxs("div",{className:"think-head progress-head",children:[H.jsx("span",{className:"think-icon","aria-hidden":"true",children:H.jsx(aue,{className:"thinking-logo is-active"})}),H.jsx(ym,{className:"think-label",duration:2.4,spread:18,children:t})]})})}function MMr({value:t,onResolve:e,onResolveComparison:r,onDownload:n,onDeploy:i}){const{t:a,i18n:o}=ca("conversation"),s=L=>L.split(new RegExp("(?<=[/_-])")).map((R,D)=>H.jsxs(j.Fragment,{children:[R,H.jsx("wbr",{})]},`${D}:${R}`)),[l,u]=j.useState(t.files?t:null),[h,d]=j.useState(!1),[f,p]=j.useState(!1),[g,m]=j.useState(null),[v,y]=j.useState(null),[b,x]=j.useState(""),[w,A]=j.useState(null),S=new Date(t.validatedAt),T=t.validatedAt?Number.isNaN(S.getTime())?t.validatedAt:S.toLocaleString(o.resolvedLanguage??o.language,{hour12:!1}):a("blocks.justNow");j.useEffect(()=>{if(!w)return;const L=window.setTimeout(()=>A(null),TMr);return()=>window.clearTimeout(L)},[w]);async function C(){if(l)return l;if(!e)throw new Error(a("blocks.sourceUnavailable"));const L=await e(t);return u(L),L}async function k(){y("source"),x(""),A(null);try{await C(),d(!0)}catch(L){x(L instanceof Error?L.message:String(L))}finally{y(null)}}async function E(){if(n){y("download"),x(""),A(null);try{await n(t),A({message:a("blocks.downloadStarted")})}catch(L){x(L instanceof Error?L.message:String(L))}finally{y(null)}}}async function _(){if(r){y("compare"),x(""),A(null);try{const L=g??await r(t);m(L),p(!0)}catch(L){x(L instanceof Error?L.message:String(L))}finally{y(null)}}}async function P(){y("deploy"),x(""),A(null);try{i==null||i(await C())}catch(L){x(L instanceof Error?L.message:String(L))}finally{y(null)}}return H.jsxs(H.Fragment,{children:[H.jsxs("section",{className:`delivery-card${t.verified?" is-verified":" is-unverified"}`,"aria-label":t.verified?a("blocks.verifiedDelivery"):a("blocks.generatedSource"),children:[H.jsxs("header",{className:"delivery-card-header",children:[H.jsx("span",{className:"delivery-card-icon",children:t.verified?H.jsx(cMr,{}):H.jsx(lMr,{})}),H.jsxs("div",{className:"delivery-card-heading",children:[H.jsx("strong",{children:s(t.agentName)}),H.jsx("span",{children:t.verified?a("blocks.verifiedDelivery"):a("blocks.generatedSource")})]})]}),H.jsxs("dl",{className:"delivery-card-grid",children:[H.jsxs("div",{className:"delivery-card-entry",children:[H.jsx("dt",{children:a("blocks.entryPoint")}),H.jsx("dd",{children:H.jsx("code",{children:s(t.entryPoint)})})]}),H.jsxs("div",{children:[H.jsx("dt",{children:a("blocks.fileCount")}),H.jsx("dd",{children:t.fileCount})]}),H.jsxs("div",{children:[H.jsx("dt",{children:a("blocks.size")}),H.jsxs("dd",{children:[(t.artifactSize/1024).toFixed(1)," KiB"]})]}),H.jsxs("div",{className:"delivery-card-time",children:[H.jsx("dt",{children:t.verified?a("blocks.validationTime"):a("blocks.generationTime")}),H.jsx("dd",{children:T})]})]}),H.jsxs("p",{className:"delivery-card-gates",children:[t.verified?a("blocks.checksPassed",{count:t.gateSummary.length}):a("blocks.sourceReady")," ","· ",H.jsx("code",{children:t.artifactSha256.slice(0,12)})]}),t.verified?null:H.jsx("p",{className:"delivery-card-guidance",children:a("blocks.sourceGuidance")}),H.jsxs("div",{className:"delivery-card-actions",children:[H.jsxs("div",{className:"delivery-card-secondary-actions",children:[H.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void k(),disabled:!e||v!==null,children:[v==="source"?H.jsx(qv,{className:"spin","aria-hidden":"true"}):null,a("blocks.viewSource")]}),t.projectId&&t.versionId&&t.parentVersionId?H.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void _(),disabled:!r||v!==null,children:[v==="compare"?H.jsx(qv,{className:"spin","aria-hidden":"true"}):null,a(v==="compare"?"blocks.preparing":"blocks.viewChanges")]}):null,H.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void E(),disabled:!n||v!==null,"aria-busy":v==="download",children:[v==="download"?H.jsx(qv,{className:"spin","aria-hidden":"true"}):null,a(v==="download"?"blocks.preparing":"blocks.downloadSource")]})]}),H.jsxs("button",{type:"button",className:"delivery-card-primary",onClick:()=>void P(),disabled:!t.deployable||!i||!e||v!==null,title:t.deployable?a("blocks.manualDeploy"):a("blocks.sourceNotReady"),children:[v==="deploy"?H.jsx(qv,{className:"spin","aria-hidden":"true"}):null,a("blocks.deployAgent")]})]}),b?H.jsx("p",{className:"delivery-card-error",role:"alert",children:b}):null,w?H.jsx("p",{className:"delivery-card-status",role:"status","aria-live":"polite",children:w.message}):null]}),H.jsx(Fot,{project:{name:t.agentName,files:(l==null?void 0:l.files)??[]},open:h,onClose:()=>d(!1),onChange:()=>{},readOnly:!0}),H.jsx(Fot,{project:{name:(g==null?void 0:g.target.agentName)??t.agentName,files:(g==null?void 0:g.target.files)??[]},comparison:g?{baseProject:{name:g.base.agentName,files:g.base.files??[]},baseLabel:a("blocks.beforeOptimization"),targetLabel:a("blocks.afterOptimization")}:void 0,open:f,onClose:()=>p(!1),onChange:()=>{},readOnly:!0})]})}function IMr(){return H.jsx(Vot,{text:"",done:!1})}const PMr=j.memo(function({text:e,streaming:r,onStreamFrame:n,onStreamComplete:i}){const a=Uot(e,r,n,i);return a?H.jsx("div",{className:"bubble",children:H.jsx(tH,{text:a,streaming:r})}):null});function NMr({title:t,summary:e,items:r,done:n}){const{t:i}=ca("conversation"),[a,o]=j.useState(!n),s=j.useRef(!1);j.useEffect(()=>{s.current||o(!n)},[n]);const l=()=>{s.current=!0,o(u=>!u)};return H.jsxs("div",{className:"block-plan",children:[H.jsxs("button",{className:"plan-head",type:"button",onClick:l,"aria-expanded":r.length>0?a:void 0,disabled:r.length===0,children:[H.jsx("span",{className:"plan-icon","aria-hidden":"true",children:H.jsx(EMr,{})}),n?H.jsx("span",{className:"plan-title",children:t}):H.jsx(ym,{className:"plan-title",duration:2.2,spread:15,children:t}),e?H.jsx("span",{className:"plan-summary",children:e}):null,r.length>0?H.jsx(FE,{className:`plan-chevron${a?" is-open":""}`}):null]}),H.jsx("div",{className:`think-collapse ${a&&r.length>0?"open":""}`,children:H.jsx("div",{className:"think-collapse-inner",children:r.length>0?H.jsx("ol",{className:"plan-items",children:r.map((u,h)=>H.jsxs("li",{"data-status":u.status,children:[H.jsx("span",{className:"plan-item-marker","aria-hidden":"true"}),H.jsx("span",{className:"plan-item-text",children:u.text}),H.jsx("small",{children:i(`blocks.planStatuses.${u.status}`)})]},`${h}:${u.text}`))}):null})})]})}function BMr(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 $Mr({name:t,args:e,response:r,done:n,status:i,defaultOpen:a=!1,retrying:o=!1,codexActivity:s,native:l=!1,progressText:u,onBranchSelect:h,onAction:d}){const{t:f}=ca("conversation"),g=t==="create_agents"&&n&&XDr(e,r)?"failed":i??(n?"completed":"running"),m=t==="create_agents"&&g==="failed"&&o,v=sMr(t),y=v==null?void 0:v.detailRenderer,b=(v==null?void 0:v.hideHeader)===!0,x=b||a||!!y||!!s,[w,A]=j.useState(x),S=j.useRef(!1);j.useEffect(()=>{!S.current&&x&&A(!0)},[x]);const T=()=>{S.current=!0,A(P=>!P)},C=t===zot?f("blocks.renderUi"):t,k=BMr(r),E=r==null?null:typeof r=="string"?r:JSON.stringify(r,null,2),_=!l&&E&&E.length>2e3?`${E.slice(0,2e3)} -${f("blocks.truncated")}`:E;return H.jsxs(TA.div,{className:`block-tool${v?" block-tool--builtin":""}`,"data-status":g,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[v&&!b?H.jsx(GDr,{definition:v,label:m?f("blocks.agentAdjusting"):g==="failed"?f(`blocks.tools.${v.name}.failed`,{defaultValue:v.failedLabel??v.doneLabel}):DMr(t,e,f),done:n,open:w,onToggle:T}):v?null:H.jsxs("button",{className:"tool-head tool-head--generic",onClick:T,type:"button","aria-expanded":w,children:[H.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:l?H.jsx(tG,{kind:"tool"}):H.jsx(kMr,{})}),n?H.jsx("span",{className:"tool-name",children:C}):H.jsx(ym,{className:"tool-name",duration:2.2,spread:15,children:C}),l&&g==="failed"&&H.jsx("span",{className:"development-tool-failure",children:H.jsx(eQ,{ns:"adk",i18nKey:"developmentRuns.toolFailed"})}),H.jsx(FE,{className:`tool-chevron${w?" is-open":""}`})]}),H.jsx("div",{className:`${b?"":"think-collapse "}${w?"open":""}`,children:H.jsxs("div",{className:"think-collapse-inner",children:[s?H.jsxs("section",{className:"codex-sandbox-run","aria-label":f("blocks.sandboxDetails"),children:[H.jsxs("div",{className:"codex-sandbox-run__label",children:[H.jsxs("span",{className:"codex-sandbox-run__badge",children:[H.jsx(_Mr,{}),H.jsx("span",{children:"Codex Sandbox"})]}),H.jsx("span",{className:"codex-sandbox-run__title",children:s.title})]}),H.jsx(RMr,{activity:s}),H.jsx("div",{className:"codex-sandbox-run__stream",children:s.items.length>0?H.jsx(Ade,{blocks:s.items.map(P=>P.block),streaming:!n,onAction:d}):H.jsx(ym,{className:"codex-sandbox-run__empty",children:f("blocks.waitingCodex")})})]}):null,y?H.jsx(y,{args:e,response:r,status:g,onBranchSelect:h}):s?null:H.jsxs("div",{className:"tool-detail",children:[u&&H.jsx("div",{className:"development-tool-meta",children:u}),e!=null&&H.jsxs("div",{className:"tool-section",children:[H.jsx("div",{className:"tool-section-label",children:f("blocks.arguments")}),H.jsx("pre",{className:"tool-args",children:JSON.stringify(e,null,2)})]}),_!=null&&H.jsxs("div",{className:"tool-section",children:[H.jsx("div",{className:"tool-section-label",children:f("blocks.result")}),H.jsx("pre",{className:"tool-args tool-result",children:_})]}),k.length>0&&H.jsxs("div",{className:"tool-section",children:[H.jsx("div",{className:"tool-section-label",children:f("blocks.artifacts")}),H.jsx("div",{className:"studio-tool-artifacts",children:k.map(P=>H.jsx("a",{href:P.contentUrl,download:P.name,children:f("blocks.downloadNamed",{name:P.name})},`${P.contentUrl}:${P.name}`))})]})]})]})})]})}function FMr({block:t,onDownload:e,onPreview:r}){const{t:n}=ca("conversation"),[i,a]=j.useState(""),[o,s]=j.useState(""),[l,u]=j.useState(null);j.useEffect(()=>()=>{l&&URL.revokeObjectURL(l.url)},[l]);const h=()=>u(null),d=async(g,m)=>{if(e){a(`download:${g}`),s("");try{await e(g,m)}catch(v){s(v instanceof Error?v.message:String(v))}finally{a("")}}},f=async(g,m,v)=>{if(r){a(`preview:${v}`),s("");try{const y=await r(g,m);u({name:v,url:y})}catch(y){s(y instanceof Error?y.message:String(y))}finally{a("")}}},p=t.files.filter(g=>!g.filename.endsWith(".preview.webp"));return H.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 H.jsxs("div",{className:"artifact-card",children:[H.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:H.jsx(yje,{})}),H.jsxs("span",{className:"artifact-card__copy",children:[H.jsx("span",{className:"artifact-card__name",children:g.filename}),H.jsx("span",{className:"artifact-card__hint",children:n("blocks.powerpoint")})]}),H.jsxs("span",{className:"artifact-card__actions",children:[v&&H.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}`?H.jsx(qv,{className:"spin"}):H.jsx(Tdr,{}),n("blocks.preview")]}),H.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}`?H.jsx(qv,{className:"spin"}):H.jsx(ile,{}),n("blocks.download")]})]})]},`${g.filename}:${g.version}`)}),o&&H.jsx("div",{className:"artifact-card__error",children:o}),l&&H.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":n("blocks.previewDialog",{name:l.name}),children:[H.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":n("blocks.closePreview"),onClick:h}),H.jsxs("div",{className:"artifact-preview__panel",children:[H.jsxs("div",{className:"artifact-preview__header",children:[H.jsx("span",{children:l.name}),H.jsx("button",{type:"button","aria-label":n("blocks.closePreview"),onClick:h,children:H.jsx(vE,{})})]}),H.jsx("div",{className:"artifact-preview__canvas",children:H.jsx("img",{src:l.url,alt:n("blocks.slidePreview",{name:l.name})})})]})]})]})}function zMr({block:t,onAuth:e}){const{t:r}=ca("conversation"),[n,i]=j.useState(t.done?"done":"idle"),[a,o]=j.useState(""),s=t.label||r("blocks.mcpToolset"),l=(()=>{try{return t.authUri?new URL(t.authUri).host:""}catch{return""}})(),u=async()=>{if(e){o(""),i("authorizing");try{await e(t),i("done")}catch(d){o(d instanceof Error?d.message:String(d)),i("idle")}}};return t.done||n==="done"?H.jsxs(TA.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[H.jsx(bje,{className:"auth-card-icon auth-card-icon--done"}),H.jsx("span",{children:r("blocks.authorized",{tool:s})})]}):H.jsxs(TA.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[H.jsxs("div",{className:"auth-card-head",children:[H.jsx(bje,{className:"auth-card-icon"}),H.jsx("span",{className:"auth-card-title",children:r("blocks.authorizationRequired",{tool:s})})]}),H.jsxs("p",{className:"auth-card-desc",children:[H.jsx(eQ,{t:r,i18nKey:"blocks.oauthDescription",values:{tool:s},components:{code:H.jsx("code",{className:"auth-card-code"})}}),l&&H.jsxs(H.Fragment,{children:[" ",H.jsx(eQ,{t:r,i18nKey:"blocks.oauthProvider",values:{provider:l},components:{code:H.jsx("code",{className:"auth-card-code"})}})," "]}),r("blocks.oauthContinue")]}),H.jsx("button",{className:"auth-card-btn",onClick:u,disabled:n==="authorizing"||!t.authUri,children:n==="authorizing"?H.jsxs(H.Fragment,{children:[H.jsx(qv,{className:"cw-i spin"})," ",r("blocks.waitingAuthorization")]}):H.jsx(H.Fragment,{children:r("blocks.authorize")})}),!t.authUri&&H.jsx("div",{className:"auth-card-err",children:r("blocks.missingAuthorizationUrl")}),a&&H.jsx("div",{className:"auth-card-err",children:a})]})}function Ade({groupProcess:t=!1,liveStatus:e,blocks:r,appName:n="",streaming:i=!1,onStreamFrame:a,onStreamComplete:o,onAction:s,onAuth:l,onArtifactDownload:u,onArtifactPreview:h,onResolveDelivery:d,onResolveDeliveryComparison:f,onDownloadDelivery:p,onDeployDelivery:g,onBranchSelect:m}){if(t)return H.jsx(Ebr,{blocks:r,active:i,status:e,render:y=>H.jsx(Ade,{blocks:y,appName:n,streaming:i,onStreamFrame:a,onStreamComplete:o,onAction:s,onAuth:l,onArtifactDownload:u,onArtifactPreview:h,onResolveDelivery:d,onResolveDeliveryComparison:f,onDownloadDelivery:p,onDeployDelivery:g,onBranchSelect:m})});const v=r.reduce((y,b,x)=>b.kind==="text"?x:y,-1);return H.jsx(H.Fragment,{children:r.map((y,b)=>{switch(y.kind){case"turn-summary":return H.jsx(Obr,{value:y.value},y.id||b);case"diff":return H.jsxs("details",{className:"development-diff",children:[H.jsxs("summary",{children:[H.jsx("span",{className:"tool-icon",children:H.jsx(tG,{kind:"diff"})}),H.jsx("span",{children:H.jsx(eQ,{ns:"adk",i18nKey:"developmentRuns.diff"})}),H.jsx(FE,{className:"tool-chevron"})]}),H.jsx("pre",{children:y.text})]},y.id??b);case"progress":return H.jsx(LMr,{text:y.text},"build-progress");case"thinking":{const x=r.slice(b+1).some(w=>w.kind==="text"&&!!w.text.trim());return H.jsx(Vot,{text:y.text,done:y.done,answerStarted:x,streaming:i,onStreamFrame:a},y.id??b)}case"text":{const x=y.text.replace(/^\s+/,"");return x?H.jsx(PMr,{text:x,streaming:i,onStreamFrame:a,onStreamComplete:b===v?o:void 0},y.id??b):null}case"plan":return H.jsx(NMr,{title:y.title,summary:y.summary,items:y.items,done:y.done},y.id??b);case"attachment":return H.jsx(VDr,{appName:n,items:y.files},y.id??b);case"artifact":return H.jsx(FMr,{block:y,onDownload:u,onPreview:h},y.id??b);case"delivery":return H.jsx(MMr,{value:y.value,onResolve:d,onResolveComparison:f,onDownload:p,onDeploy:g},y.id??b);case"invocation":return H.jsx(IDr,{value:y.value},y.id??b);case"tool":{if(y.name===zot&&y.done)return null;const x=y.name==="create_agents"&&r.slice(b+1).some(w=>w.kind==="tool"&&w.name==="create_agents");return H.jsx($Mr,{name:y.itemType?het(y):y.name,native:!!y.itemType,progressText:y.progressText,args:y.args,response:y.response,done:y.done,status:y.status,defaultOpen:y.defaultOpen,retrying:y.name==="create_agents"&&(i||x),codexActivity:y.codexActivity,onBranchSelect:m,onAction:s},y.id??b)}case"agent-transfer":return null;case"auth":return H.jsx(zMr,{block:y,onAuth:l},y.id??b);case"a2ui":return Bbr(y.messages).filter(x=>x.components[x.rootId]).map(x=>H.jsx(TA.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:H.jsx(Fbr,{surface:x,onAction:s})},`${b}-${x.surfaceId}`));default:return null}})})}function UMr(t){return t.isComposing||t.keyCode===229}function VMr(t){return H.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:H.jsx("path",{d:"m6.5 11.5 5.5-5.5 5.5 5.5M12 6v12"})})}function QMr({value:t,placeholder:e,busy:r=!1,disabled:n=!1,onChange:i,onSubmit:a}){const{t:o}=ca("conversation"),s=j.useRef(null),l=!!t.trim()&&!r&&!n;return j.useLayoutEffect(()=>{const u=s.current;u&&(u.style.height="auto",u.style.height=`${Math.min(u.scrollHeight,144)}px`)},[t]),H.jsx("form",{className:"composer compact-composer",onSubmit:u=>{u.preventDefault(),l&&a()},children:H.jsxs("div",{className:"composer-box",children:[H.jsx("div",{className:"composer-input-stack",children:H.jsx("textarea",{ref:s,className:"comp-input scroll",rows:1,value:t,disabled:n,placeholder:e??o("composer.placeholder"),"aria-label":o("composer.inputAria"),onChange:u=>i(u.target.value),onKeyDown:u=>{UMr(u.nativeEvent)||u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),l&&a())}})}),H.jsx("div",{className:"composer-submit-actions",children:H.jsx("button",{type:"submit",className:"comp-send",disabled:!l,"aria-label":o(r?"composer.generating":"composer.send"),children:H.jsx(VMr,{className:"icon"})})})]})})}const GMr=5,Om=12,Sde=12;function NN(t,e,r){return Math.min(Math.max(t,e),Math.max(e,r))}function HMr(){return H.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",children:H.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function Qot({studioOrigin:t,className:e=""}){const[r,n]=j.useState(!1);return H.jsx("img",{className:e,src:r?Jhr:`${t}/web/site-logo`,alt:"",onError:()=>n(!0)})}function Tde(t,e){return{role:e,blocks:[{kind:"text",text:t}],meta:{ts:Date.now()/1e3}}}function Got(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 WMr({studioOrigin:t,token:e}){const{t:r,i18n:n}=ca("websiteIntegration"),[i,a]=j.useState(!1),[o,s]=j.useState(""),[l,u]=j.useState([Tde(r("widget.greeting"),"assistant")]),[h,d]=j.useState(""),[f,p]=j.useState(""),[g,m]=j.useState(!1),v=j.useRef(null),y=j.useRef(null),b=j.useRef(null),x=j.useRef(null),w=j.useRef(null),A=j.useRef(!1),S=j.useRef(null),T=j.useRef(`website-${crypto.randomUUID()}`),C=j.useRef(crypto.randomUUID()),k=j.useCallback(()=>{const D=y.current,M=b.current;if(!D||!M||!x.current)return;const I=D.getBoundingClientRect(),N=M.offsetWidth,F=M.offsetHeight,B=window.innerWidth,V=window.innerHeight,z=I.left+I.width/2,U=I.top-Om,Q=V-I.bottom-Om,G=U>=F+Sde||U>=Q?I.top-F-Sde:I.bottom+Sde,q=z>=B/2?I.right-N:I.left,Y=NN(q,Om,B-N-Om),ne=NN(G,Om,V-F-Om);M.style.left=`${Y}px`,M.style.top=`${ne}px`,M.style.right="auto",M.style.bottom="auto",M.style.transformOrigin=`${NN(z-Y,0,N)}px ${I.top>=ne+F?F:0}px`},[]),E=j.useCallback((D,M)=>{const I=y.current;if(!I)return;const N={x:NN(D,Om,window.innerWidth-I.offsetWidth-Om),y:NN(M,Om,window.innerHeight-I.offsetHeight-Om)};x.current=N,I.style.left=`${N.x}px`,I.style.top=`${N.y}px`,I.style.right="auto",I.style.bottom="auto",k()},[k]),_=j.useCallback(D=>{var F;const M=w.current;if(!M||M.pointerId!==D.pointerId)return;D.preventDefault();const I=D.clientX-M.start.x,N=D.clientY-M.start.y;!M.moved&&Math.hypot(I,N){var I;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,(I=y.current)==null||I.classList.remove("is-dragging"))},[]),L=j.useCallback(()=>{requestAnimationFrame(()=>{const D=v.current;D&&(D.scrollTop=D.scrollHeight)})},[]);j.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 Got(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]),j.useEffect(L,[g,L,l]),j.useEffect(()=>{if(!i||!x.current)return;const D=requestAnimationFrame(k);return()=>cancelAnimationFrame(D)},[i,k]),j.useEffect(()=>{var M;const D=()=>{const I=x.current;I&&E(I.x,I.y)};return window.addEventListener("resize",D),(M=window.visualViewport)==null||M.addEventListener("resize",D),()=>{var I;window.removeEventListener("resize",D),(I=window.visualViewport)==null||I.removeEventListener("resize",D)}},[E]),j.useEffect(()=>(window.addEventListener("pointermove",_,{passive:!1}),window.addEventListener("pointerup",P),window.addEventListener("pointercancel",P),()=>{window.removeEventListener("pointermove",_),window.removeEventListener("pointerup",P),window.removeEventListener("pointercancel",P)}),[P,_]),j.useEffect(()=>()=>{S.current!=null&&window.clearTimeout(S.current)},[]);const R=async()=>{const D=o.trim();if(!(!D||!h||g)){s(""),m(!0),u(M=>[...M,Tde(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:C.current})});if(!M.ok||!M.body)throw new Error(await Got(M,r("widget.requestFailed",{status:M.status})));let I=hdr(),N={ts:Date.now()/1e3};for await(const F of edr(M)){const B=F,V=B.error??B.errorMessage??B.error_message;if(typeof V=="string"&&V)throw new Error(V);I=ydr(I,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:I.blocks,meta:N};u(U=>[...U.slice(0,-1),z])}}catch(M){const I=M instanceof Error?M.message:r("widget.conversationFailed");u(N=>[...N.slice(0,-1),Tde(I,"assistant")])}finally{m(!1)}}};return H.jsxs("div",{className:"website-widget",children:[H.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:H.jsx(Qot,{studioOrigin:t,className:"website-widget__launcher-logo"})}),H.jsxs("section",{ref:b,className:`website-widget__panel${i?" is-open":""}`,"aria-label":r("widget.panelLabel"),"aria-hidden":!i,children:[H.jsxs("header",{className:"website-widget__header",children:[H.jsxs("div",{className:"website-widget__identity",children:[H.jsx("span",{className:"website-widget__identity-logo",children:H.jsx(Qot,{studioOrigin:t})}),H.jsxs("span",{className:"website-widget__identity-copy",children:[H.jsx("strong",{children:r("widget.assistant")}),H.jsx("span",{children:r("widget.online")})]})]}),H.jsx("button",{type:"button",className:"website-widget__close","aria-label":r("widget.close"),onClick:()=>a(!1),children:H.jsx(HMr,{})})]}),H.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 H.jsx("div",{className:"turn turn--user",children:H.jsx("div",{className:"bubble",children:H.jsx(tH,{text:F,allowRawHtml:!1})})},`user-${M}`)}const I=D.blocks.length===0,N=g&&M===l.length-1;return H.jsx("div",{className:"turn turn--assistant",children:I&&N?H.jsx(IMr,{}):H.jsx(Ade,{blocks:D.blocks,streaming:N,onStreamFrame:L,onAction:()=>{}})},`assistant-${M}`)}),f?H.jsx("div",{className:"website-widget__error",role:"alert",children:f}):null]}),H.jsx("div",{className:"website-widget__composer-slot",children:H.jsx(QMr,{value:o,busy:g,disabled:!h||!!f,onChange:s,onSubmit:()=>void R()})})]})]})}function YMr(){return window.__VEADK_WEBSITE_INTEGRATION_SCRIPT__??(document.currentScript instanceof HTMLScriptElement?document.currentScript:null)}const BN=YMr(),Hot=((Wor=BN==null?void 0:BN.dataset.token)==null?void 0:Wor.trim())??"";if(BN&&Hot&&!document.querySelector("[data-veadk-website-integration]")){const t=new URL(BN.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=[Khr,Yhr,Xhr,qhr,jhr,Zhr].join(` -`);const i=document.createElement("div");r.append(n,i),qcr.createRoot(i).render(H.jsx(WMr,{studioOrigin:t,token:Hot}))}/*! ***************************************************************************** +`),d=Qot(h,!e||n,i),{ref:f,onScroll:p}=Vbr(d);return H.jsxs("div",{className:"block-thinking",children:[H.jsxs("button",{className:"think-head",onClick:u,type:"button",children:[H.jsx("span",{className:"think-icon","aria-hidden":"true",children:H.jsx(aue,{className:`thinking-logo ${e?"":"is-active"}`})}),e?H.jsx("span",{className:"think-label think-label--done",children:a("blocks.thinkingDone")}):H.jsx(ym,{className:"think-label",duration:2.4,spread:18,children:a("blocks.thinking")}),H.jsx(Cdr,{className:`chev ${o?"open":""}`})]}),H.jsx("div",{className:`think-collapse ${o&&d?"open":""}`,children:H.jsx("div",{className:"think-collapse-inner",children:H.jsx("div",{className:"think-body scroll",ref:f,onScroll:p,children:d})})})]})}function IMr({text:t}){return H.jsx("div",{className:"block-progress",role:"status","aria-live":"polite","aria-atomic":"true",children:H.jsxs("div",{className:"think-head progress-head",children:[H.jsx("span",{className:"think-icon","aria-hidden":"true",children:H.jsx(aue,{className:"thinking-logo is-active"})}),H.jsx(ym,{className:"think-label",duration:2.4,spread:18,children:t})]})})}function PMr({value:t,onResolve:e,onResolveComparison:r,onDownload:n,onDeploy:i}){const{t:a,i18n:o}=ca("conversation"),s=L=>L.split(new RegExp("(?<=[/_-])")).map((R,D)=>H.jsxs(j.Fragment,{children:[R,H.jsx("wbr",{})]},`${D}:${R}`)),[l,u]=j.useState(t.files?t:null),[h,d]=j.useState(!1),[f,p]=j.useState(!1),[g,m]=j.useState(null),[v,y]=j.useState(null),[b,x]=j.useState(""),[w,A]=j.useState(null),S=new Date(t.validatedAt),T=t.validatedAt?Number.isNaN(S.getTime())?t.validatedAt:S.toLocaleString(o.resolvedLanguage??o.language,{hour12:!1}):a("blocks.justNow");j.useEffect(()=>{if(!w)return;const L=window.setTimeout(()=>A(null),OMr);return()=>window.clearTimeout(L)},[w]);async function C(){if(l)return l;if(!e)throw new Error(a("blocks.sourceUnavailable"));const L=await e(t);return u(L),L}async function k(){y("source"),x(""),A(null);try{await C(),d(!0)}catch(L){x(L instanceof Error?L.message:String(L))}finally{y(null)}}async function E(){if(n){y("download"),x(""),A(null);try{await n(t),A({message:a("blocks.downloadStarted")})}catch(L){x(L instanceof Error?L.message:String(L))}finally{y(null)}}}async function _(){if(r){y("compare"),x(""),A(null);try{const L=g??await r(t);m(L),p(!0)}catch(L){x(L instanceof Error?L.message:String(L))}finally{y(null)}}}async function P(){y("deploy"),x(""),A(null);try{i==null||i(await C())}catch(L){x(L instanceof Error?L.message:String(L))}finally{y(null)}}return H.jsxs(H.Fragment,{children:[H.jsxs("section",{className:`delivery-card${t.verified?" is-verified":" is-unverified"}`,"aria-label":t.verified?a("blocks.verifiedDelivery"):a("blocks.generatedSource"),children:[H.jsxs("header",{className:"delivery-card-header",children:[H.jsx("span",{className:"delivery-card-icon",children:t.verified?H.jsx(hMr,{}):H.jsx(uMr,{})}),H.jsxs("div",{className:"delivery-card-heading",children:[H.jsx("strong",{children:s(t.agentName)}),H.jsx("span",{children:t.verified?a("blocks.verifiedDelivery"):a("blocks.generatedSource")})]})]}),H.jsxs("dl",{className:"delivery-card-grid",children:[H.jsxs("div",{className:"delivery-card-entry",children:[H.jsx("dt",{children:a("blocks.entryPoint")}),H.jsx("dd",{children:H.jsx("code",{children:s(t.entryPoint)})})]}),H.jsxs("div",{children:[H.jsx("dt",{children:a("blocks.fileCount")}),H.jsx("dd",{children:t.fileCount})]}),H.jsxs("div",{children:[H.jsx("dt",{children:a("blocks.size")}),H.jsxs("dd",{children:[(t.artifactSize/1024).toFixed(1)," KiB"]})]}),H.jsxs("div",{className:"delivery-card-time",children:[H.jsx("dt",{children:t.verified?a("blocks.validationTime"):a("blocks.generationTime")}),H.jsx("dd",{children:T})]})]}),H.jsxs("p",{className:"delivery-card-gates",children:[t.verified?a("blocks.checksPassed",{count:t.gateSummary.length}):a("blocks.sourceReady")," ","· ",H.jsx("code",{children:t.artifactSha256.slice(0,12)})]}),t.verified?null:H.jsx("p",{className:"delivery-card-guidance",children:a("blocks.sourceGuidance")}),H.jsxs("div",{className:"delivery-card-actions",children:[H.jsxs("div",{className:"delivery-card-secondary-actions",children:[H.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void k(),disabled:!e||v!==null,children:[v==="source"?H.jsx(qv,{className:"spin","aria-hidden":"true"}):null,a("blocks.viewSource")]}),t.projectId&&t.versionId&&t.parentVersionId?H.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void _(),disabled:!r||v!==null,children:[v==="compare"?H.jsx(qv,{className:"spin","aria-hidden":"true"}):null,a(v==="compare"?"blocks.preparing":"blocks.viewChanges")]}):null,H.jsxs("button",{type:"button",className:"delivery-card-secondary",onClick:()=>void E(),disabled:!n||v!==null,"aria-busy":v==="download",children:[v==="download"?H.jsx(qv,{className:"spin","aria-hidden":"true"}):null,a(v==="download"?"blocks.preparing":"blocks.downloadSource")]})]}),H.jsxs("button",{type:"button",className:"delivery-card-primary",onClick:()=>void P(),disabled:!t.deployable||!i||!e||v!==null,title:t.deployable?a("blocks.manualDeploy"):a("blocks.sourceNotReady"),children:[v==="deploy"?H.jsx(qv,{className:"spin","aria-hidden":"true"}):null,a("blocks.deployAgent")]})]}),b?H.jsx("p",{className:"delivery-card-error",role:"alert",children:b}):null,w?H.jsx("p",{className:"delivery-card-status",role:"status","aria-live":"polite",children:w.message}):null]}),H.jsx(Uot,{project:{name:t.agentName,files:(l==null?void 0:l.files)??[]},open:h,onClose:()=>d(!1),onChange:()=>{},readOnly:!0}),H.jsx(Uot,{project:{name:(g==null?void 0:g.target.agentName)??t.agentName,files:(g==null?void 0:g.target.files)??[]},comparison:g?{baseProject:{name:g.base.agentName,files:g.base.files??[]},baseLabel:a("blocks.beforeOptimization"),targetLabel:a("blocks.afterOptimization")}:void 0,open:f,onClose:()=>p(!1),onChange:()=>{},readOnly:!0})]})}function NMr(){return H.jsx(Got,{text:"",done:!1})}const BMr=j.memo(function({text:e,streaming:r,onStreamFrame:n,onStreamComplete:i}){const a=Qot(e,r,n,i);return a?H.jsx("div",{className:"bubble",children:H.jsx(tH,{text:a,streaming:r})}):null});function $Mr({title:t,summary:e,items:r,done:n}){const{t:i}=ca("conversation"),[a,o]=j.useState(!n),s=j.useRef(!1);j.useEffect(()=>{s.current||o(!n)},[n]);const l=()=>{s.current=!0,o(u=>!u)};return H.jsxs("div",{className:"block-plan",children:[H.jsxs("button",{className:"plan-head",type:"button",onClick:l,"aria-expanded":r.length>0?a:void 0,disabled:r.length===0,children:[H.jsx("span",{className:"plan-icon","aria-hidden":"true",children:H.jsx(RMr,{})}),n?H.jsx("span",{className:"plan-title",children:t}):H.jsx(ym,{className:"plan-title",duration:2.2,spread:15,children:t}),e?H.jsx("span",{className:"plan-summary",children:e}):null,r.length>0?H.jsx(FE,{className:`plan-chevron${a?" is-open":""}`}):null]}),H.jsx("div",{className:`think-collapse ${a&&r.length>0?"open":""}`,children:H.jsx("div",{className:"think-collapse-inner",children:r.length>0?H.jsx("ol",{className:"plan-items",children:r.map((u,h)=>H.jsxs("li",{"data-status":u.status,children:[H.jsx("span",{className:"plan-item-marker","aria-hidden":"true"}),H.jsx("span",{className:"plan-item-text",children:u.text}),H.jsx("small",{children:i(`blocks.planStatuses.${u.status}`)})]},`${h}:${u.text}`))}):null})})]})}function FMr(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 zMr({name:t,args:e,response:r,done:n,status:i,defaultOpen:a=!1,retrying:o=!1,codexActivity:s,native:l=!1,progressText:u,onBranchSelect:h,onAction:d}){const{t:f}=ca("conversation"),g=t==="create_agents"&&n&&ZDr(e,r)?"failed":i??(n?"completed":"running"),m=t==="create_agents"&&g==="failed"&&o,v=cMr(t),y=v==null?void 0:v.detailRenderer,b=(v==null?void 0:v.hideHeader)===!0,x=b||a||!!y||!!s,[w,A]=j.useState(x),S=j.useRef(!1);j.useEffect(()=>{!S.current&&x&&A(!0)},[x]);const T=()=>{S.current=!0,A(P=>!P)},C=t===Vot?f("blocks.renderUi"):t,k=FMr(r),E=r==null?null:typeof r=="string"?r:JSON.stringify(r,null,2),_=!l&&E&&E.length>2e3?`${E.slice(0,2e3)} +${f("blocks.truncated")}`:E;return H.jsxs(TA.div,{className:`block-tool${v?" block-tool--builtin":""}`,"data-status":g,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[v&&!b?H.jsx(WDr,{definition:v,label:m?f("blocks.agentAdjusting"):g==="failed"?f(`blocks.tools.${v.name}.failed`,{defaultValue:v.failedLabel??v.doneLabel}):MMr(t,e,f),done:n,open:w,onToggle:T}):v?null:H.jsxs("button",{className:"tool-head tool-head--generic",onClick:T,type:"button","aria-expanded":w,children:[H.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:l?H.jsx(tG,{kind:"tool"}):H.jsx(_Mr,{})}),n?H.jsx("span",{className:"tool-name",children:C}):H.jsx(ym,{className:"tool-name",duration:2.2,spread:15,children:C}),l&&g==="failed"&&H.jsx("span",{className:"development-tool-failure",children:H.jsx(eQ,{ns:"adk",i18nKey:"developmentRuns.toolFailed"})}),H.jsx(FE,{className:`tool-chevron${w?" is-open":""}`})]}),H.jsx("div",{className:`${b?"":"think-collapse "}${w?"open":""}`,children:H.jsxs("div",{className:"think-collapse-inner",children:[s?H.jsxs("section",{className:"codex-sandbox-run","aria-label":f("blocks.sandboxDetails"),children:[H.jsxs("div",{className:"codex-sandbox-run__label",children:[H.jsxs("span",{className:"codex-sandbox-run__badge",children:[H.jsx(DMr,{}),H.jsx("span",{children:"Codex Sandbox"})]}),H.jsx("span",{className:"codex-sandbox-run__title",children:s.title})]}),H.jsx(LMr,{activity:s}),H.jsx("div",{className:"codex-sandbox-run__stream",children:s.items.length>0?H.jsx(Ade,{blocks:s.items.map(P=>P.block),streaming:!n,onAction:d}):H.jsx(ym,{className:"codex-sandbox-run__empty",children:f("blocks.waitingCodex")})})]}):null,y?H.jsx(y,{args:e,response:r,status:g,onBranchSelect:h}):s?null:H.jsxs("div",{className:"tool-detail",children:[u&&H.jsx("div",{className:"development-tool-meta",children:u}),e!=null&&H.jsxs("div",{className:"tool-section",children:[H.jsx("div",{className:"tool-section-label",children:f("blocks.arguments")}),H.jsx("pre",{className:"tool-args",children:JSON.stringify(e,null,2)})]}),_!=null&&H.jsxs("div",{className:"tool-section",children:[H.jsx("div",{className:"tool-section-label",children:f("blocks.result")}),H.jsx("pre",{className:"tool-args tool-result",children:_})]}),k.length>0&&H.jsxs("div",{className:"tool-section",children:[H.jsx("div",{className:"tool-section-label",children:f("blocks.artifacts")}),H.jsx("div",{className:"studio-tool-artifacts",children:k.map(P=>H.jsx("a",{href:P.contentUrl,download:P.name,children:f("blocks.downloadNamed",{name:P.name})},`${P.contentUrl}:${P.name}`))})]})]})]})})]})}function UMr({block:t,onDownload:e,onPreview:r}){const{t:n}=ca("conversation"),[i,a]=j.useState(""),[o,s]=j.useState(""),[l,u]=j.useState(null);j.useEffect(()=>()=>{l&&URL.revokeObjectURL(l.url)},[l]);const h=()=>u(null),d=async(g,m)=>{if(e){a(`download:${g}`),s("");try{await e(g,m)}catch(v){s(v instanceof Error?v.message:String(v))}finally{a("")}}},f=async(g,m,v)=>{if(r){a(`preview:${v}`),s("");try{const y=await r(g,m);u({name:v,url:y})}catch(y){s(y instanceof Error?y.message:String(y))}finally{a("")}}},p=t.files.filter(g=>!g.filename.endsWith(".preview.webp"));return H.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 H.jsxs("div",{className:"artifact-card",children:[H.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:H.jsx(xje,{})}),H.jsxs("span",{className:"artifact-card__copy",children:[H.jsx("span",{className:"artifact-card__name",children:g.filename}),H.jsx("span",{className:"artifact-card__hint",children:n("blocks.powerpoint")})]}),H.jsxs("span",{className:"artifact-card__actions",children:[v&&H.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}`?H.jsx(qv,{className:"spin"}):H.jsx(Odr,{}),n("blocks.preview")]}),H.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}`?H.jsx(qv,{className:"spin"}):H.jsx(ile,{}),n("blocks.download")]})]})]},`${g.filename}:${g.version}`)}),o&&H.jsx("div",{className:"artifact-card__error",children:o}),l&&H.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":n("blocks.previewDialog",{name:l.name}),children:[H.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":n("blocks.closePreview"),onClick:h}),H.jsxs("div",{className:"artifact-preview__panel",children:[H.jsxs("div",{className:"artifact-preview__header",children:[H.jsx("span",{children:l.name}),H.jsx("button",{type:"button","aria-label":n("blocks.closePreview"),onClick:h,children:H.jsx(vE,{})})]}),H.jsx("div",{className:"artifact-preview__canvas",children:H.jsx("img",{src:l.url,alt:n("blocks.slidePreview",{name:l.name})})})]})]})]})}function VMr({block:t,onAuth:e}){const{t:r}=ca("conversation"),[n,i]=j.useState(t.done?"done":"idle"),[a,o]=j.useState(""),s=t.label||r("blocks.mcpToolset"),l=(()=>{try{return t.authUri?new URL(t.authUri).host:""}catch{return""}})(),u=async()=>{if(e){o(""),i("authorizing");try{await e(t),i("done")}catch(d){o(d instanceof Error?d.message:String(d)),i("idle")}}};return t.done||n==="done"?H.jsxs(TA.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[H.jsx(wje,{className:"auth-card-icon auth-card-icon--done"}),H.jsx("span",{children:r("blocks.authorized",{tool:s})})]}):H.jsxs(TA.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[H.jsxs("div",{className:"auth-card-head",children:[H.jsx(wje,{className:"auth-card-icon"}),H.jsx("span",{className:"auth-card-title",children:r("blocks.authorizationRequired",{tool:s})})]}),H.jsxs("p",{className:"auth-card-desc",children:[H.jsx(eQ,{t:r,i18nKey:"blocks.oauthDescription",values:{tool:s},components:{code:H.jsx("code",{className:"auth-card-code"})}}),l&&H.jsxs(H.Fragment,{children:[" ",H.jsx(eQ,{t:r,i18nKey:"blocks.oauthProvider",values:{provider:l},components:{code:H.jsx("code",{className:"auth-card-code"})}})," "]}),r("blocks.oauthContinue")]}),H.jsx("button",{className:"auth-card-btn",onClick:u,disabled:n==="authorizing"||!t.authUri,children:n==="authorizing"?H.jsxs(H.Fragment,{children:[H.jsx(qv,{className:"cw-i spin"})," ",r("blocks.waitingAuthorization")]}):H.jsx(H.Fragment,{children:r("blocks.authorize")})}),!t.authUri&&H.jsx("div",{className:"auth-card-err",children:r("blocks.missingAuthorizationUrl")}),a&&H.jsx("div",{className:"auth-card-err",children:a})]})}function Ade({groupProcess:t=!1,liveStatus:e,blocks:r,appName:n="",streaming:i=!1,onStreamFrame:a,onStreamComplete:o,onAction:s,onAuth:l,onArtifactDownload:u,onArtifactPreview:h,onResolveDelivery:d,onResolveDeliveryComparison:f,onDownloadDelivery:p,onDeployDelivery:g,onBranchSelect:m}){if(t)return H.jsx(Rbr,{blocks:r,active:i,status:e,render:y=>H.jsx(Ade,{blocks:y,appName:n,streaming:i,onStreamFrame:a,onStreamComplete:o,onAction:s,onAuth:l,onArtifactDownload:u,onArtifactPreview:h,onResolveDelivery:d,onResolveDeliveryComparison:f,onDownloadDelivery:p,onDeployDelivery:g,onBranchSelect:m})});const v=r.reduce((y,b,x)=>b.kind==="text"?x:y,-1);return H.jsx(H.Fragment,{children:r.map((y,b)=>{switch(y.kind){case"turn-summary":return H.jsx(Ebr,{value:y.value},y.id||b);case"diff":return H.jsxs("details",{className:"development-diff",children:[H.jsxs("summary",{children:[H.jsx("span",{className:"tool-icon",children:H.jsx(tG,{kind:"diff"})}),H.jsx("span",{children:H.jsx(eQ,{ns:"adk",i18nKey:"developmentRuns.diff"})}),H.jsx(FE,{className:"tool-chevron"})]}),H.jsx("pre",{children:y.text})]},y.id??b);case"progress":return H.jsx(IMr,{text:y.text},"build-progress");case"thinking":{const x=r.slice(b+1).some(w=>w.kind==="text"&&!!w.text.trim());return H.jsx(Got,{text:y.text,done:y.done,answerStarted:x,streaming:i,onStreamFrame:a},y.id??b)}case"text":{const x=y.text.replace(/^\s+/,"");return x?H.jsx(BMr,{text:x,streaming:i,onStreamFrame:a,onStreamComplete:b===v?o:void 0},y.id??b):null}case"plan":return H.jsx($Mr,{title:y.title,summary:y.summary,items:y.items,done:y.done},y.id??b);case"attachment":return H.jsx(GDr,{appName:n,items:y.files},y.id??b);case"artifact":return H.jsx(UMr,{block:y,onDownload:u,onPreview:h},y.id??b);case"delivery":return H.jsx(PMr,{value:y.value,onResolve:d,onResolveComparison:f,onDownload:p,onDeploy:g},y.id??b);case"invocation":return H.jsx(NDr,{value:y.value},y.id??b);case"tool":{if(y.name===Vot&&y.done)return null;const x=y.name==="create_agents"&&r.slice(b+1).some(w=>w.kind==="tool"&&w.name==="create_agents");return H.jsx(zMr,{name:y.itemType?fet(y):y.name,native:!!y.itemType,progressText:y.progressText,args:y.args,response:y.response,done:y.done,status:y.status,defaultOpen:y.defaultOpen,retrying:y.name==="create_agents"&&(i||x),codexActivity:y.codexActivity,onBranchSelect:m,onAction:s},y.id??b)}case"agent-transfer":return null;case"auth":return H.jsx(VMr,{block:y,onAuth:l},y.id??b);case"a2ui":return Fbr(y.messages).filter(x=>x.components[x.rootId]).map(x=>H.jsx(TA.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:H.jsx(Ubr,{surface:x,onAction:s})},`${b}-${x.surfaceId}`));default:return null}})})}function QMr(t){return t.isComposing||t.keyCode===229}function GMr(t){return H.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:H.jsx("path",{d:"m6.5 11.5 5.5-5.5 5.5 5.5M12 6v12"})})}function HMr({value:t,placeholder:e,busy:r=!1,disabled:n=!1,onChange:i,onSubmit:a}){const{t:o}=ca("conversation"),s=j.useRef(null),l=!!t.trim()&&!r&&!n;return j.useLayoutEffect(()=>{const u=s.current;u&&(u.style.height="auto",u.style.height=`${Math.min(u.scrollHeight,144)}px`)},[t]),H.jsx("form",{className:"composer compact-composer",onSubmit:u=>{u.preventDefault(),l&&a()},children:H.jsxs("div",{className:"composer-box",children:[H.jsx("div",{className:"composer-input-stack",children:H.jsx("textarea",{ref:s,className:"comp-input scroll",rows:1,value:t,disabled:n,placeholder:e??o("composer.placeholder"),"aria-label":o("composer.inputAria"),onChange:u=>i(u.target.value),onKeyDown:u=>{QMr(u.nativeEvent)||u.key==="Enter"&&!u.shiftKey&&(u.preventDefault(),l&&a())}})}),H.jsx("div",{className:"composer-submit-actions",children:H.jsx("button",{type:"submit",className:"comp-send",disabled:!l,"aria-label":o(r?"composer.generating":"composer.send"),children:H.jsx(GMr,{className:"icon"})})})]})})}const WMr=5,Om=12,Sde=12;function NN(t,e,r){return Math.min(Math.max(t,e),Math.max(e,r))}function YMr(){return H.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",children:H.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function Hot({studioOrigin:t,className:e=""}){const[r,n]=j.useState(!1);return H.jsx("img",{className:e,src:r?tdr:`${t}/web/site-logo`,alt:"",onError:()=>n(!0)})}function Tde(t,e){return{role:e,blocks:[{kind:"text",text:t}],meta:{ts:Date.now()/1e3}}}function Wot(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 qMr({studioOrigin:t,token:e}){const{t:r,i18n:n}=ca("websiteIntegration"),[i,a]=j.useState(!1),[o,s]=j.useState(""),[l,u]=j.useState([Tde(r("widget.greeting"),"assistant")]),[h,d]=j.useState(""),[f,p]=j.useState(""),[g,m]=j.useState(!1),v=j.useRef(null),y=j.useRef(null),b=j.useRef(null),x=j.useRef(null),w=j.useRef(null),A=j.useRef(!1),S=j.useRef(null),T=j.useRef(`website-${crypto.randomUUID()}`),C=j.useRef(crypto.randomUUID()),k=j.useCallback(()=>{const D=y.current,M=b.current;if(!D||!M||!x.current)return;const I=D.getBoundingClientRect(),N=M.offsetWidth,F=M.offsetHeight,B=window.innerWidth,V=window.innerHeight,z=I.left+I.width/2,U=I.top-Om,Q=V-I.bottom-Om,G=U>=F+Sde||U>=Q?I.top-F-Sde:I.bottom+Sde,q=z>=B/2?I.right-N:I.left,Y=NN(q,Om,B-N-Om),ne=NN(G,Om,V-F-Om);M.style.left=`${Y}px`,M.style.top=`${ne}px`,M.style.right="auto",M.style.bottom="auto",M.style.transformOrigin=`${NN(z-Y,0,N)}px ${I.top>=ne+F?F:0}px`},[]),E=j.useCallback((D,M)=>{const I=y.current;if(!I)return;const N={x:NN(D,Om,window.innerWidth-I.offsetWidth-Om),y:NN(M,Om,window.innerHeight-I.offsetHeight-Om)};x.current=N,I.style.left=`${N.x}px`,I.style.top=`${N.y}px`,I.style.right="auto",I.style.bottom="auto",k()},[k]),_=j.useCallback(D=>{var F;const M=w.current;if(!M||M.pointerId!==D.pointerId)return;D.preventDefault();const I=D.clientX-M.start.x,N=D.clientY-M.start.y;!M.moved&&Math.hypot(I,N){var I;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,(I=y.current)==null||I.classList.remove("is-dragging"))},[]),L=j.useCallback(()=>{requestAnimationFrame(()=>{const D=v.current;D&&(D.scrollTop=D.scrollHeight)})},[]);j.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 Wot(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]),j.useEffect(L,[g,L,l]),j.useEffect(()=>{if(!i||!x.current)return;const D=requestAnimationFrame(k);return()=>cancelAnimationFrame(D)},[i,k]),j.useEffect(()=>{var M;const D=()=>{const I=x.current;I&&E(I.x,I.y)};return window.addEventListener("resize",D),(M=window.visualViewport)==null||M.addEventListener("resize",D),()=>{var I;window.removeEventListener("resize",D),(I=window.visualViewport)==null||I.removeEventListener("resize",D)}},[E]),j.useEffect(()=>(window.addEventListener("pointermove",_,{passive:!1}),window.addEventListener("pointerup",P),window.addEventListener("pointercancel",P),()=>{window.removeEventListener("pointermove",_),window.removeEventListener("pointerup",P),window.removeEventListener("pointercancel",P)}),[P,_]),j.useEffect(()=>()=>{S.current!=null&&window.clearTimeout(S.current)},[]);const R=async()=>{const D=o.trim();if(!(!D||!h||g)){s(""),m(!0),u(M=>[...M,Tde(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:C.current})});if(!M.ok||!M.body)throw new Error(await Wot(M,r("widget.requestFailed",{status:M.status})));let I=fdr(),N={ts:Date.now()/1e3};for await(const F of rdr(M)){const B=F,V=B.error??B.errorMessage??B.error_message;if(typeof V=="string"&&V)throw new Error(V);I=xdr(I,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:I.blocks,meta:N};u(U=>[...U.slice(0,-1),z])}}catch(M){const I=M instanceof Error?M.message:r("widget.conversationFailed");u(N=>[...N.slice(0,-1),Tde(I,"assistant")])}finally{m(!1)}}};return H.jsxs("div",{className:"website-widget",children:[H.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:H.jsx(Hot,{studioOrigin:t,className:"website-widget__launcher-logo"})}),H.jsxs("section",{ref:b,className:`website-widget__panel${i?" is-open":""}`,"aria-label":r("widget.panelLabel"),"aria-hidden":!i,children:[H.jsxs("header",{className:"website-widget__header",children:[H.jsxs("div",{className:"website-widget__identity",children:[H.jsx("span",{className:"website-widget__identity-logo",children:H.jsx(Hot,{studioOrigin:t})}),H.jsxs("span",{className:"website-widget__identity-copy",children:[H.jsx("strong",{children:r("widget.assistant")}),H.jsx("span",{children:r("widget.online")})]})]}),H.jsx("button",{type:"button",className:"website-widget__close","aria-label":r("widget.close"),onClick:()=>a(!1),children:H.jsx(YMr,{})})]}),H.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 H.jsx("div",{className:"turn turn--user",children:H.jsx("div",{className:"bubble",children:H.jsx(tH,{text:F,allowRawHtml:!1})})},`user-${M}`)}const I=D.blocks.length===0,N=g&&M===l.length-1;return H.jsx("div",{className:"turn turn--assistant",children:I&&N?H.jsx(NMr,{}):H.jsx(Ade,{blocks:D.blocks,streaming:N,onStreamFrame:L,onAction:()=>{}})},`assistant-${M}`)}),f?H.jsx("div",{className:"website-widget__error",role:"alert",children:f}):null]}),H.jsx("div",{className:"website-widget__composer-slot",children:H.jsx(HMr,{value:o,busy:g,disabled:!h||!!f,onChange:s,onSubmit:()=>void R()})})]})]})}function jMr(){return window.__VEADK_WEBSITE_INTEGRATION_SCRIPT__??(document.currentScript instanceof HTMLScriptElement?document.currentScript:null)}const BN=jMr(),Yot=((qor=BN==null?void 0:BN.dataset.token)==null?void 0:qor.trim())??"";if(BN&&Yot&&!document.querySelector("[data-veadk-website-integration]")){const t=new URL(BN.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=[Jhr,jhr,Zhr,Xhr,Khr,edr].join(` +`);const i=document.createElement("div");r.append(n,i),Xcr.createRoot(i).render(H.jsx(qMr,{studioOrigin:t,token:Yot}))}/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -323,7 +323,7 @@ ${f("blocks.truncated")}`:E;return H.jsxs(TA.div,{className:`block-tool${v?" 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 Cde=function(t,e){return Cde=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])},Cde(t,e)};function nt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Cde(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var qMr=function(){function t(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return t}(),jMr=function(){function t(){this.browser=new qMr,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}(),Dn=new jMr;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(Dn.wxa=!0,Dn.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?Dn.worker=!0:!Dn.hasGlobalWindow||"Deno"in window||typeof navigator<"u"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(Dn.node=!0,Dn.svgSupported=!0):XMr(navigator.userAgent,Dn);function XMr(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.]+)/),o=/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),o&&(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 s=e.domSupported=typeof document<"u";if(s){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 Ode=12,Wot="sans-serif",fy=Ode+"px "+Wot,KMr=20,ZMr=100,JMr="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function eIr(t){var e={};if(typeof JSON>"u")return e;for(var r=0;r=0)s=o*r.length;else for(var l=0;l=aIr&&(_de=0),_de++}function cH(){for(var t=[],e=0;e"u"&&typeof self<"u"?Dn.worker=!0:!Dn.hasGlobalWindow||"Deno"in window||typeof navigator<"u"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(Dn.node=!0,Dn.svgSupported=!0):ZMr(navigator.userAgent,Dn);function ZMr(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.]+)/),o=/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),o&&(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 s=e.domSupported=typeof document<"u";if(s){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 Ode=12,qot="sans-serif",fy=Ode+"px "+qot,JMr=20,eIr=100,tIr="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function rIr(t){var e={};if(typeof JSON>"u")return e;for(var r=0;r=0)s=o*r.length;else for(var l=0;l=sIr&&(_de=0),_de++}function cH(){for(var t=[],e=0;e>1)%2;s.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(o),r.push(o)}return e.clearMarkers=function(){fe(r,function(h){h.parentNode&&h.parentNode.removeChild(h)})},r}function TIr(t,e,r){for(var n=r?"invTrans":"trans",i=e[n],a=e.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var h=t[u].getBoundingClientRect(),d=2*u,f=h.left,p=h.top;o.push(f,p),l=l&&a&&f===a[d]&&p===a[d+1],s.push(t[u].offsetLeft,t[u].offsetTop)}return l&&i?i:(e.srcCoords=o,e[n]=r?ist(s,o):ist(o,s))}function ast(t){return t.nodeName.toUpperCase()==="CANVAS"}var CIr=/([&<>"'])/g,OIr={"&":"&","<":"<",">":">",'"':""","'":"'"};function Hc(t){return t==null?"":(t+"").replace(CIr,function(e,r){return OIr[r]})}var kIr=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,zde=[],EIr=Dn.browser.firefox&&+Dn.browser.version.split(".")[0]<39;function Ude(t,e,r,n){return r=r||{},n?ost(t,e,r):EIr&&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):ost(t,e,r),r}function ost(t,e,r){if(Dn.domSupported&&t.getBoundingClientRect){var n=e.clientX,i=e.clientY;if(ast(t)){var a=t.getBoundingClientRect();r.zrX=n-a.left,r.zrY=i-a.top;return}else if(Fde(zde,t,n,i)){r.zrX=zde[0],r.zrY=zde[1];return}}r.zrX=r.zrY=0}function Vde(t){return t||window.event}function jf(t,e,r){if(e=Vde(e),e.zrX!=null)return e;var n=e.type,i=n&&n.indexOf("touch")>=0;if(i){var o=n!=="touchend"?e.targetTouches[0]:e.changedTouches[0];o&&Ude(t,o,e,r)}else{Ude(t,e,e,r);var a=_Ir(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var s=e.button;return e.which==null&&s!==void 0&&kIr.test(e.type)&&(e.which=s&1?1:s&2?3:s&4?2:0),e}function _Ir(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 Qde(t,e,r,n){t.addEventListener(e,r,n)}function RIr(t,e,r,n){t.removeEventListener(e,r,n)}var by=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0};function sst(t){return t.which===2||t.which===3}var DIr=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},o=0,s=i.length;o1&&n&&n.length>1){var a=lst(n)/lst(i);!isFinite(a)&&(a=1),e.pinchScale=a;var o=LIr(n);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:t[0].target,event:e}}}}};function ka(){return[1,0,0,1,0,0]}function WA(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function _x(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 Bd(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],o=e[1]*r[2]+e[3]*r[3],s=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]=o,t[4]=s,t[5]=l,t}function sg(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 xy(t,e,r,n){n===void 0&&(n=[0,0]);var i=e[0],a=e[2],o=e[4],s=e[1],l=e[3],u=e[5],h=Math.sin(r),d=Math.cos(r);return t[0]=i*d+s*h,t[1]=-i*h+s*d,t[2]=a*d+l*h,t[3]=-a*h+d*l,t[4]=d*(o-n[0])+h*(u-n[1])+n[0],t[5]=d*(u-n[1])-h*(o-n[0])+n[1],t}function mH(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 $d(t,e){var r=e[0],n=e[2],i=e[4],a=e[1],o=e[3],s=e[5],l=r*o-a*n;return l?(l=1/l,t[0]=o*l,t[1]=-a*l,t[2]=-n*l,t[3]=r*l,t[4]=(n*s-o*i)*l,t[5]=(a*i-r*s)*l,t):null}function cst(t){var e=ka();return _x(e,t),e}const MIr=Object.freeze(Object.defineProperty({__proto__:null,clone:cst,copy:_x,create:ka,identity:WA,invert:$d,mul:Bd,rotate:xy,scale:mH,translate:sg},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}(),YA=Math.min,w_=Math.max,Hde=Math.abs,ust=["x","y"],IIr=["width","height"],qA=new wr,jA=new wr,XA=new wr,KA=new wr,Fd=pst(),WN=Fd.minTv,Wde=Fd.maxTv,YN=[0,0],pr=function(){function t(e,r,n,i){Yde(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=YA(e.x,this.x),n=YA(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=w_(e.x+e.width,this.x+this.width)-r:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=w_(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 hst(ka(),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,o=i&&i.clamp;if(a&&(a.x=a.y=a.width=a.height=NaN),!e||!r)return!1;e instanceof t||(e=Yde(NIr,e.x,e.y,e.width,e.height)),r instanceof t||(r=Yde(BIr,r.x,r.y,r.width,r.height));var s=!!n;Fd.reset(i,s);var l=Fd.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){A_(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&&A_(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],o=n[4],s=n[5];e.x=r.x*i+o,e.y=r.y*a+s,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}qA.x=XA.x=r.x,qA.y=KA.y=r.y,jA.x=KA.x=r.x+r.width,jA.y=XA.y=r.y+r.height,qA.transform(n),KA.transform(n),jA.transform(n),XA.transform(n),e.x=YA(qA.x,jA.x,XA.x,KA.x),e.y=YA(qA.y,jA.y,XA.y,KA.y);var l=w_(qA.x,jA.x,XA.x,KA.x),u=w_(qA.y,jA.y,XA.y,KA.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=WA(e||[]),sg(e,e,gy(qde,-r.x,-r.y)),mH(e,e,gy(qde,i,a)),sg(e,e,gy(qde,n.x,n.y)),e},t}(),vH=pr.create,Yde=pr.set,A_=pr.copy,hst=pr.calculateTransform,dst=pr.applyTransform,PIr=pr.contain,NIr=new pr(0,0,0,0),BIr=new pr(0,0,0,0),qde=[];function fst(t,e,r,n,i,a,o,s){var l=Hde(e-r),u=Hde(n-t),h=YA(l,u),d=ust[i],f=ust[1-i],p=IIr[i];e=u||!Fd.bidirectional)&&(WN[d]=-u,WN[f]=0,Fd.useDir&&Fd.calcDirMTV())))}function pst(){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,o){n.touchThreshold=0,a&&a.touchThreshold!=null&&(n.touchThreshold=w_(0,a.touchThreshold)),n.negativeSize=!1,o&&(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,o=n.dirMinTv,s=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)&&o.set(0,0);return}if(r.x=s*u/h,r.y=s*l/h,i(r.x)&&i(r.y)){o.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)&&(jde.copy(f.getBoundingRect()),f.transform&&jde.applyTransform(f.transform),jde.intersect(h)&&s.push(f))}if(s.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 VIr(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 o=n.getClipPath();if(o&&!o.contain(e,r))return!1}n.silent&&(i=!0);var s=n.__hostTarget;n=s?n.ignoreHostSilent?null:s:n.parent}return i?gst:!0}return!1}function vst(t,e,r,n,i){for(var a=t.length-1;a>=0;a--){var o=t[a],s=void 0;if(o!==i&&!o.ignore&&(s=VIr(o,r,n))&&(!e.topTarget&&(e.topTarget=o),s!==gst)){e.target=o;break}}}function yst(t,e,r){var n=t.painter;return e<0||e>n.getWidth()||r<0||r>n.getHeight()}var bst=32,jN=7;function QIr(t){for(var e=0;t>=bst;)e|=t&1,t>>=1;return t+e}function xst(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 GIr(t,e,r){for(r--;e>>1,i(a,t[l])<0?s=l:o=l+1;var u=n-o;switch(u){case 3:t[o+3]=t[o+2];case 2:t[o+2]=t[o+1];case 1:t[o+1]=t[o];break;default:for(;u>0;)t[o+u]=t[o+u-1],u--}t[o]=a}}function Xde(t,e,r,n,i,a){var o=0,s=0,l=1;if(a(t,e[r+i])>0){for(s=n-i;l0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}else{for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}for(o++;o>>1);a(t,e[r+h])>0?o=h+1:l=h}return l}function Kde(t,e,r,n,i,a){var o=0,s=0,l=1;if(a(t,e[r+i])<0){for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}else{for(s=n-i;l=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}for(o++;o>>1);a(t,e[r+h])<0?l=h:o=h+1}return l}function HIr(t,e){var r=jN,n,i,a=0,o=[];n=[],i=[];function s(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]=jN||T>=jN);if(C)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]=o[x];return}for(var T=r;;){var C=0,k=0,E=!1;do if(e(o[x],t[b])<0){if(t[w--]=t[b--],C++,k=0,--g===0){E=!0;break}}else if(t[w--]=o[x--],k++,C=0,--v===1){E=!0;break}while((C|k)=0;y--)t[S+y]=t[A+y];if(g===0){E=!0;break}}if(t[w--]=o[x--],--v===1){E=!0;break}if(k=v-Xde(t[b],o,0,v,v-1,e),k!==0){for(w-=k,x-=k,v-=k,S=w+1,A=x+1,y=0;y=jN||k>=jN);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]=o[x]}else{if(v===0)throw new Error;for(A=w-(v-1),y=0;ys&&(l=s),wst(t,r,r+l,r+a,e),a=l}o.pushRun(r,a),o.mergeRuns(),i-=a,r+=a}while(i!==0);o.forceMergeRuns()}}var $h=1,XN=2,S_=4,Ast=!1;function Zde(){Ast||(Ast=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Sst(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var WIr=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Sst}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}(),bH;bH=Dn.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};var KN={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-KN.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?KN.bounceIn(t*2)*.5:KN.bounceOut(t*2-1)*.5+.5}},xH=Math.pow,Rx=Math.sqrt,wH=1e-8,Tst=1e-4,Cst=Rx(3),AH=1/3,Em=Ox(),Xf=Ox(),T_=Ox();function Dx(t){return t>-wH&&twH||t<-wH}function rl(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 kst(t,e,r,n,i){var a=1-i;return 3*(((e-t)*a+2*(r-e)*i)*a+(n-r)*i*i)}function SH(t,e,r,n,i,a){var o=n+3*(e-r)-t,s=3*(r-e*2+t),l=3*(e-t),u=t-i,h=s*s-3*o*l,d=s*l-9*o*u,f=l*l-3*s*u,p=0;if(Dx(h)&&Dx(d))if(Dx(s))a[0]=0;else{var g=-l/s;g>=0&&g<=1&&(a[p++]=g)}else{var m=d*d-4*h*f;if(Dx(m)){var v=d/h,g=-s/o+v,y=-v/2;g>=0&&g<=1&&(a[p++]=g),y>=0&&y<=1&&(a[p++]=y)}else if(m>0){var b=Rx(m),x=h*s+1.5*o*(-d+b),w=h*s+1.5*o*(-d-b);x<0?x=-xH(-x,AH):x=xH(x,AH),w<0?w=-xH(-w,AH):w=xH(w,AH);var g=(-s-(x+w))/(3*o);g>=0&&g<=1&&(a[p++]=g)}else{var A=(2*h*s-3*o*d)/(2*Rx(h*h*h)),S=Math.acos(A)/3,T=Rx(h),C=Math.cos(S),g=(-s-2*T*C)/(3*o),y=(-s+T*(C+Cst*Math.sin(S)))/(3*o),k=(-s+T*(C-Cst*Math.sin(S)))/(3*o);g>=0&&g<=1&&(a[p++]=g),y>=0&&y<=1&&(a[p++]=y),k>=0&&k<=1&&(a[p++]=k)}}return p}function Est(t,e,r,n,i){var a=6*r-12*e+6*t,o=9*e+3*n-3*t-9*r,s=3*e-3*t,l=0;if(Dx(o)){if(Ost(a)){var u=-s/a;u>=0&&u<=1&&(i[l++]=u)}}else{var h=a*a-4*o*s;if(Dx(h))i[0]=-a/(2*o);else if(h>0){var d=Rx(h),u=(-a+d)/(2*o),f=(-a-d)/(2*o);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function Lx(t,e,r,n,i,a){var o=(e-t)*i+t,s=(r-e)*i+e,l=(n-r)*i+r,u=(s-o)*i+o,h=(l-s)*i+s,d=(h-u)*i+u;a[0]=t,a[1]=o,a[2]=u,a[3]=d,a[4]=d,a[5]=h,a[6]=l,a[7]=n}function _st(t,e,r,n,i,a,o,s,l,u,h){var d,f=.005,p=1/0,g,m,v,y;Em[0]=l,Em[1]=u;for(var b=0;b<1;b+=.05)Xf[0]=rl(t,r,i,o,b),Xf[1]=rl(e,n,a,s,b),v=Ex(Em,Xf),v=0&&v=0&&u<=1&&(i[l++]=u)}}else{var h=o*o-4*a*s;if(Dx(h)){var u=-o/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(h>0){var d=Rx(h),u=(-o+d)/(2*a),f=(-o-d)/(2*a);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function Rst(t,e,r){var n=t+r-2*e;return n===0?.5:(t-e)/n}function ZN(t,e,r,n,i){var a=(e-t)*n+t,o=(r-e)*n+e,s=(o-a)*n+a;i[0]=t,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=r}function Dst(t,e,r,n,i,a,o,s,l){var u,h=.005,d=1/0;Em[0]=o,Em[1]=s;for(var f=0;f<1;f+=.05){Xf[0]=_l(t,r,i,f),Xf[1]=_l(e,n,a,f);var p=Ex(Em,Xf);p=0&&p=1?1:SH(0,n,a,1,l,s)&&rl(0,i,o,1,s[0])}}}var KIr=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||no,this.ondestroy=e.ondestroy||no,this.onrestart=e.onrestart||no,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 o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),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:KN[e]||efe(e)},t}(),Lst=function(){function t(e){this.value=e}return t}(),ZIr=function(){function t(){this._len=0}return t.prototype.insert=function(e){var r=new Lst(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}(),C_=function(){function t(e){this._list=new ZIr,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 o=n.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=n.head;n.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=r:s=new Lst(r),s.key=e,n.insertEntry(s),i[e]=s}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}(),Mst={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 lg(t){return t=Math.round(t),t<0?0:t>255?255:t}function JIr(t){return t=Math.round(t),t<0?0:t>360?360:t}function JN(t){return t<0?0:t>1?1:t}function TH(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?lg(parseFloat(e)/100*255):lg(parseInt(e,10))}function wy(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?JN(parseFloat(e)/100):JN(parseFloat(e))}function tfe(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 Mx(t,e,r){return t+(e-t)*r}function Kf(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function rfe(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var Ist=new C_(20),CH=null;function O_(t,e){CH&&rfe(CH,e),CH=Ist.put(t,CH||e.slice())}function Wc(t,e){if(t){e=e||[];var r=Ist.get(t);if(r)return rfe(e,r);t=t+"";var n=t.replace(/ /g,"").toLowerCase();if(n in Mst)return rfe(e,Mst[n]),O_(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)){Kf(e,0,0,0,1);return}return Kf(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),O_(t,e),e}else if(i===7||i===9){var a=parseInt(n.slice(1,7),16);if(!(a>=0&&a<=16777215)){Kf(e,0,0,0,1);return}return Kf(e,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(n.slice(7),16)/255:1),O_(t,e),e}return}var o=n.indexOf("("),s=n.indexOf(")");if(o!==-1&&s+1===i){var l=n.substr(0,o),u=n.substr(o+1,s-(o+1)).split(","),h=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?Kf(e,+u[0],+u[1],+u[2],1):Kf(e,0,0,0,1);h=wy(u.pop());case"rgb":if(u.length>=3)return Kf(e,TH(u[0]),TH(u[1]),TH(u[2]),u.length===3?h:wy(u[3])),O_(t,e),e;Kf(e,0,0,0,1);return;case"hsla":if(u.length!==4){Kf(e,0,0,0,1);return}return u[3]=wy(u[3]),nfe(u,e),O_(t,e),e;case"hsl":if(u.length!==3){Kf(e,0,0,0,1);return}return nfe(u,e),O_(t,e),e;default:return}}Kf(e,0,0,0,1)}}function nfe(t,e){var r=(parseFloat(t[0])%360+360)%360/360,n=wy(t[1]),i=wy(t[2]),a=i<=.5?i*(n+1):i+n-i*n,o=i*2-a;return e=e||[],Kf(e,lg(tfe(o,a,r+1/3)*255),lg(tfe(o,a,r)*255),lg(tfe(o,a,r-1/3)*255),1),t.length===4&&(e[3]=t[3]),e}function ePr(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),o=a-i,s=(a+i)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+i):u=o/(2-a-i);var h=((a-e)/6+o/2)/o,d=((a-r)/6+o/2)/o,f=((a-n)/6+o/2)/o;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,s];return t[3]!=null&&p.push(t[3]),p}}function OH(t,e){var r=Wc(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 Zf(r,r.length===4?"rgba":"rgb")}}function tPr(t){var e=Wc(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function e8(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),o=e[i],s=e[a],l=n-i;return r[0]=lg(Mx(o[0],s[0],l)),r[1]=lg(Mx(o[1],s[1],l)),r[2]=lg(Mx(o[2],s[2],l)),r[3]=JN(Mx(o[3],s[3],l)),r}}var rPr=e8;function ife(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),o=Wc(e[i]),s=Wc(e[a]),l=n-i,u=Zf([lg(Mx(o[0],s[0],l)),lg(Mx(o[1],s[1],l)),lg(Mx(o[2],s[2],l)),JN(Mx(o[3],s[3],l))],"rgba");return r?{color:u,leftIndex:i,rightIndex:a,value:n}:u}}var nPr=ife;function Ay(t,e,r,n){var i=Wc(t);if(t)return i=ePr(i),e!=null&&(i[0]=JIr(ur(e)?e(i[0]):e)),r!=null&&(i[1]=wy(ur(r)?r(i[1]):r)),n!=null&&(i[2]=wy(ur(n)?n(i[2]):n)),Zf(nfe(i),"rgba")}function t8(t,e){var r=Wc(t);if(r&&e!=null)return r[3]=JN(e),Zf(r,"rgba")}function Zf(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 r8(t,e){var r=Wc(t);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*e:0}function iPr(){return Zf([Math.round(Math.random()*255),Math.round(Math.random()*255),Math.round(Math.random()*255)],"rgb")}var Pst=new C_(100);function kH(t){if($t(t)){var e=Pst.get(t);return e||(e=OH(t,-.1),Pst.put(t,e)),e}else if($N(t)){var r=lt({},t);return r.colorStops=vt(t.colorStops,function(n){return{offset:n.offset,color:OH(n.color,-.1)}}),r}return t}const aPr=Object.freeze(Object.defineProperty({__proto__:null,fastLerp:e8,fastMapToColor:rPr,lerp:ife,lift:OH,liftColor:kH,lum:r8,mapToColor:nPr,modifyAlpha:t8,modifyHSL:Ay,parse:Wc,parseCssFloat:wy,parseCssInt:TH,random:iPr,stringify:Zf,toHex:tPr},Symbol.toStringTag,{value:"Module"}));var EH=Math.round;function n8(t){var e;if(!t||t==="transparent")t="none";else if(typeof t=="string"&&t.indexOf("rgba")>-1){var r=Wc(t);r&&(t="rgb("+r[0]+","+r[1]+","+r[2]+")",e=r[3])}return{color:t,opacity:e??1}}var Nst=1e-4;function Ix(t){return t-Nst}function _H(t){return EH(t*1e3)/1e3}function afe(t){return EH(t*1e4)/1e4}function oPr(t){return"matrix("+_H(t[0])+","+_H(t[1])+","+_H(t[2])+","+_H(t[3])+","+afe(t[4])+","+afe(t[5])+")"}var sPr={left:"start",right:"end",center:"middle",middle:"middle"};function lPr(t,e,r){return r==="top"?t+=e/2:r==="bottom"&&(t-=e/2),t}function cPr(t){return t&&(t.shadowBlur||t.shadowOffsetX||t.shadowOffsetY)}function uPr(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 Bst(t){return t&&!!t.image}function hPr(t){return t&&!!t.svgElement}function ofe(t){return Bst(t)||hPr(t)}function $st(t){return t.type==="linear"}function Fst(t){return t.type==="radial"}function zst(t){return t&&(t.type==="linear"||t.type==="radial")}function RH(t){return"url(#"+t+")"}function Ust(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 Vst(t){var e=t.x||0,r=t.y||0,n=(t.rotation||0)*VN,i=Jt(t.scaleX,1),a=Jt(t.scaleY,1),o=t.skewX||0,s=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+")"),(o||s)&&l.push("skew("+EH(o*VN)+"deg, "+EH(s*VN)+"deg)"),l.join(" ")}var dPr=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}}(),sfe=Array.prototype.slice;function Sy(t,e,r){return(e-t)*r+t}function lfe(t,e,r,n){for(var i=e.length,a=0;an?e:t,a=Math.min(r,n),o=i[a-1]||{color:[0,0,0,0],offset:0},s=a;so;if(s)n.length=o;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,o=!1,s=Hst,l=r;if(lc(r)){var u=mPr(r);s=u,(u===1&&!Vn(r[0])||u===2&&!Vn(r[0][0]))&&(o=!0)}else if(Vn(r)&&!cc(r))s=MH;else if($t(r))if(!isNaN(+r))s=MH;else{var h=Wc(r);h&&(l=h,s=a8)}else if($N(r)){var d=lt({},l);d.colorStops=vt(r.colorStops,function(p){return{offset:p.offset,color:Wc(p.color)}}),$st(r)?s=cfe:Fst(r)&&(s=ufe),l=d}a===0?this.valType=s:(s!==this.valType||s===Hst)&&(o=!0),this.discrete=this.discrete||o;var f={time:e,value:l,rawValue:r,percent:0};return n&&(f.easing=n,f.easingFunc=ur(n)?n:KN[n]||efe(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,o=n[a-1],s=this.discrete,l=PH(i),u=Wst(i),h=0;h=0&&!(o[h].percent<=r);h--);h=f(h,s-2)}else{for(h=d;hr);h++);h=f(h-1,s-2)}g=o[h+1],p=o[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?o8:e[l];if((PH(a)||u)&&!b&&(b=this._additiveValue=[]),this.discrete)e[l]=y<1?p.rawValue:g.rawValue;else if(PH(a))a===IH?lfe(b,p[i],g[i],y):fPr(b,p[i],g[i],y);else if(Wst(a)){var x=p[i],w=g[i],A=a===cfe;e[l]={type:A?"linear":"radial",x:Sy(x.x,w.x,y),y:Sy(x.y,w.y,y),colorStops:vt(x.colorStops,function(T,C){var k=w.colorStops[C];return{offset:Sy(T.offset,k.offset,y),color:LH(lfe([],T.color,k.color,y))}}),global:w.global},A?(e[l].x2=Sy(x.x2,w.x2,y),e[l].y2=Sy(x.y2,w.y2,y)):e[l].r=Sy(x.r,w.r,y)}else if(u)lfe(b,p[i],g[i],y),n||(e[l]=LH(b));else{var S=Sy(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===MH?e[n]=e[n]+i:r===a8?(Wc(e[n],o8),DH(o8,o8,i,1),e[n]=LH(o8)):r===IH?DH(e[n],e[n],i,1):r===Gst&&Qst(e[n],e[n],i,1)},t}(),hfe=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){cH("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,En(r),n)},t.prototype.whenWithKeys=function(e,r,n,i){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,i8(u),i),this._trackKeys.push(s)}l.addKeyframe(e,i8(r[s]),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 s=o.pop();a.addKeyframe(s.time,e[i]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},t}();function k_(){return new Date().getTime()}var yPr=function(t){ya(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=k_()-this._pausedTime,i=n-this._time,a=this._head;a;){var o=a.next,s=a.step(n,i);s&&(a.ondestroy(),this.removeClip(a)),a=o}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&&(bH(n),!r._paused&&r.update())}bH(n)},e.prototype.start=function(){this._running||(this._time=k_(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=k_(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=k_()-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 hfe(r,n.loop);return this.addAnimator(i),i},e}(qf),bPr=300,dfe=Dn.domSupported,ffe=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}}(),Yst={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},qst=!1;function pfe(t){var e=t.pointerType;return e==="pen"||e==="touch"}function xPr(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 gfe(t){t&&(t.zrByTouch=!0)}function wPr(t,e){return jf(t.dom,new APr(t,e),!0)}function jst(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 APr=function(){function t(e,r){this.stopPropagation=no,this.stopImmediatePropagation=no,this.preventDefault=no,this.type=r.type,this.target=this.currentTarget=e.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return t}(),cg={mousedown:function(t){t=jf(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=jf(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=jf(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){t=jf(this.dom,t);var e=t.toElement||t.relatedTarget;jst(this,e)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){qst=!0,t=jf(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){qst||(t=jf(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){t=jf(this.dom,t),gfe(t),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),cg.mousemove.call(this,t),cg.mousedown.call(this,t)},touchmove:function(t){t=jf(this.dom,t),gfe(t),this.handler.processGesture(t,"change"),cg.mousemove.call(this,t)},touchend:function(t){t=jf(this.dom,t),gfe(t),this.handler.processGesture(t,"end"),cg.mouseup.call(this,t),+new Date-+this.__lastTouchMomentJst||t<-Jst}var JA=[],E_=[],wfe=ka(),Afe=Math.abs,_m=function(){function t(){}return t.prototype.getLocalTransform=function(e){return Px(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 ZA(this.rotation)||ZA(this.x)||ZA(this.y)||ZA(this.scaleX-1)||ZA(this.scaleY-1)||ZA(this.skewX)||ZA(this.skewY)},t.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,r=this.needLocalTransform(),n=this.transform;if(!(r||e)){n&&(Zst(n),this.invTransform=null);return}n=n||ka(),r?this.getLocalTransform(n):Zst(n),e&&(r?Bd(n,e,n):_x(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n),this.invTransform=this.invTransform||ka(),$d(this.invTransform,n)},t.prototype._resolveGlobalScaleRatio=function(e){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(JA);var n=JA[0]<0?-1:1,i=JA[1]<0?-1:1,a=((JA[0]-n)*r+n)/JA[0]||0,o=((JA[1]-i)*r+i)/JA[1]||0;e[0]*=a,e[1]*=a,e[2]*=o,e[3]*=o}},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||ka(),Bd(E_,e.invTransform,r),r=E_);var n=this.originX,i=this.originY;(n||i)&&(wfe[4]=n,wfe[5]=i,Bd(E_,r,wfe),E_[4]-=n,E_[5]-=i,r=E_),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&&io(n,n,i),n},t.prototype.transformCoordToGlobal=function(e,r){var n=[e,r],i=this.transform;return i&&io(n,n,i),n},t.prototype.getLineScale=function(){var e=this.transform;return e&&Afe(e[0]-1)>1e-10&&Afe(e[3]-1)>1e-10?Math.sqrt(Afe(e[0]*e[3]-e[2]*e[1])):1},t.prototype.copyTransform=function(e){Rm(this,e)},t.getLocalTransform=function(e,r){r=r||[];var n=e.originX||0,i=e.originY||0,a=e.scaleX,o=e.scaleY,s=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||s||l){var g=n+s,m=i+l;r[4]=-g*a-f*m*o,r[5]=-m*o-p*g*a}else r[4]=r[5]=0;return r[0]=a,r[3]=o,r[1]=p*a,r[2]=f*o,u&&xy(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}(),Px=_m.getLocalTransform;function __(){return new _m}var Ty=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function Rm(t,e){return Kot(t,e,Ty)}function Dm(t){$H||($H=new C_(100)),t=t||fy;var e=$H.get(t);return e||(e={font:t,strWidthCache:new C_(500),asciiWidthMap:null,asciiWidthMapTried:!1,stWideCharWidth:tl.measureText("国",t).width,asciiCharWidth:tl.measureText("a",t).width},$H.put(t,e)),e}var $H;function kPr(t){if(!(Sfe>=elt)){t=t||fy;for(var e=[],r=+new Date,n=0;n<=127;n++)e[n]=tl.measureText(String.fromCharCode(n),t).width;var i=+new Date-r;return i>16?Sfe=elt:i>2&&Sfe++,e}}var Sfe=0,elt=5;function tlt(t,e){return t.asciiWidthMapTried||(t.asciiWidthMap=kPr(t.font),t.asciiWidthMapTried=!0),0<=e&&e<=127?t.asciiWidthMap!=null?t.asciiWidthMap[e]:t.asciiCharWidth:t.stWideCharWidth}function Lm(t,e){var r=t.strWidthCache,n=r.get(e);return n==null&&(n=tl.measureText(e,t.font).width,r.put(e,n)),n}function rlt(t,e,r,n){var i=Lm(Dm(e),t),a=s8(e),o=R_(0,i,r),s=eS(0,a,n),l=new pr(o,s,i,a);return l}function FH(t,e,r,n){var i=((t||"")+"").split(` -`),a=i.length;if(a===1)return rlt(i[0],e,r,n);for(var o=new pr(0,0,0,0),s=0;s=0?parseFloat(t)/100*e:parseFloat(t):t}function zH(t,e,r){var n=e.position||"inside",i=e.distance!=null?e.distance:5,a=r.height,o=r.width,s=a/2,l=r.x,u=r.y,h="left",d="top";if(n instanceof Array)l+=Mm(n[0],r.width),u+=Mm(n[1],r.height),h=null,d=null;else switch(n){case"left":l-=i,u+=s,h="right",d="middle";break;case"right":l+=i+o,u+=s,d="middle";break;case"top":l+=o/2,u-=i,h="center",d="bottom";break;case"bottom":l+=o/2,u+=a+i,h="center";break;case"inside":l+=o/2,u+=s,h="center",d="middle";break;case"insideLeft":l+=i,u+=s,d="middle";break;case"insideRight":l+=o-i,u+=s,h="right",d="middle";break;case"insideTop":l+=o/2,u+=i,h="center";break;case"insideBottom":l+=o/2,u+=a-i,h="center",d="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=o-i,u+=i,h="right";break;case"insideBottomLeft":l+=i,u+=a-i,d="bottom";break;case"insideBottomRight":l+=o-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 Tfe="__zr_normal__",Cfe=Ty.concat(["ignore"]),EPr=Yf(Ty,function(t,e){return t[e]=!0,t},{ignore:!1}),D_={},_Pr=new pr(0,0,0,0),UH=[],VH=0,QH=1,GH=function(){function t(e){this.id=Rde(),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,o=void 0,s=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=_Pr,n.layoutRect?f.copy(n.layoutRect):f.copy(this.getBoundingRect()),i||f.applyTransform(this.transform)),h){this.calculateTextPosition?this.calculateTextPosition(D_,n,f):zH(D_,n,f),a.x=D_.x,a.y=D_.y,o=D_.align,s=D_.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=Mm(p[0],f.width),m=Mm(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 pr(0,0,0,0);a.getLocalTransform(UH),$d(UH,UH),pr.copy(b,f),b.applyTransform(UH)}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||o!==y.align||s!==y.verticalAlign)&&(l=!0,y.fill=w,y.stroke=A,y.autoStroke=S,y.align=o,y.verticalAlign=s,r.setDefaultTextStyle(y)),r.__dirty|=$h,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()?xfe:bfe},t.prototype.getOutsideStroke=function(e){var r=this.__zr&&this.__zr.getBackgroundColor(),n=typeof r=="string"&&Wc(r);n||(n=[255,255,255,1]);for(var i=n[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*i+(a?0:255)*(1-i);return n[3]=1,Zf(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||{},lt(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=En(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(Tfe,!1,e)},t.prototype.useState=function(e,r,n,i){var a=e===Tfe,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(Nr(s,e)>=0&&(r||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(e)),u||(u=this.states&&this.states[e]),!u&&!a){cH("State "+e+" not exists.");return}a||this.saveCurrentToNormalState(u);var h=this._textContent,d=ilt(this,h,u,i);d&&!this.__inHover&&(this.__inHover=d),this._applyStateObj(e,u,this._normalState,r,olt(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=VH,this.__dirty&=~$h),u}}},t.prototype.useStates=function(e,r,n){if(!e.length)this.clearStates();else{var i=[],a=this.currentStates,o=e.length,s=o===a.length;if(s){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=Nr(i,e),o=Nr(i,r)>=0;a>=0?o?i.splice(a,1):i[a]=r:n&&!o&&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(o,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=[],o=0;o0&&r.during&&a[0].during(function(g,m){r.during(m)});for(var f=0;f0||i.force&&!o.length){var C=void 0,k=void 0,E=void 0;if(s){k={},f&&(C={});for(var w=0;w0}var gr=function(t){ya(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=Nr(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 o=this.__zr;o&&a.removeSelfFromZr(o),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=Nr(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;s.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(o),r.push(o)}return e.clearMarkers=function(){fe(r,function(h){h.parentNode&&h.parentNode.removeChild(h)})},r}function OIr(t,e,r){for(var n=r?"invTrans":"trans",i=e[n],a=e.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var h=t[u].getBoundingClientRect(),d=2*u,f=h.left,p=h.top;o.push(f,p),l=l&&a&&f===a[d]&&p===a[d+1],s.push(t[u].offsetLeft,t[u].offsetTop)}return l&&i?i:(e.srcCoords=o,e[n]=r?ost(s,o):ost(o,s))}function sst(t){return t.nodeName.toUpperCase()==="CANVAS"}var kIr=/([&<>"'])/g,EIr={"&":"&","<":"<",">":">",'"':""","'":"'"};function Hc(t){return t==null?"":(t+"").replace(kIr,function(e,r){return EIr[r]})}var _Ir=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,zde=[],RIr=Dn.browser.firefox&&+Dn.browser.version.split(".")[0]<39;function Ude(t,e,r,n){return r=r||{},n?lst(t,e,r):RIr&&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):lst(t,e,r),r}function lst(t,e,r){if(Dn.domSupported&&t.getBoundingClientRect){var n=e.clientX,i=e.clientY;if(sst(t)){var a=t.getBoundingClientRect();r.zrX=n-a.left,r.zrY=i-a.top;return}else if(Fde(zde,t,n,i)){r.zrX=zde[0],r.zrY=zde[1];return}}r.zrX=r.zrY=0}function Vde(t){return t||window.event}function jf(t,e,r){if(e=Vde(e),e.zrX!=null)return e;var n=e.type,i=n&&n.indexOf("touch")>=0;if(i){var o=n!=="touchend"?e.targetTouches[0]:e.changedTouches[0];o&&Ude(t,o,e,r)}else{Ude(t,e,e,r);var a=DIr(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var s=e.button;return e.which==null&&s!==void 0&&_Ir.test(e.type)&&(e.which=s&1?1:s&2?3:s&4?2:0),e}function DIr(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 Qde(t,e,r,n){t.addEventListener(e,r,n)}function LIr(t,e,r,n){t.removeEventListener(e,r,n)}var by=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0};function cst(t){return t.which===2||t.which===3}var MIr=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},o=0,s=i.length;o1&&n&&n.length>1){var a=ust(n)/ust(i);!isFinite(a)&&(a=1),e.pinchScale=a;var o=IIr(n);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:t[0].target,event:e}}}}};function ka(){return[1,0,0,1,0,0]}function WA(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function _x(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 Bd(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],o=e[1]*r[2]+e[3]*r[3],s=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]=o,t[4]=s,t[5]=l,t}function sg(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 xy(t,e,r,n){n===void 0&&(n=[0,0]);var i=e[0],a=e[2],o=e[4],s=e[1],l=e[3],u=e[5],h=Math.sin(r),d=Math.cos(r);return t[0]=i*d+s*h,t[1]=-i*h+s*d,t[2]=a*d+l*h,t[3]=-a*h+d*l,t[4]=d*(o-n[0])+h*(u-n[1])+n[0],t[5]=d*(u-n[1])-h*(o-n[0])+n[1],t}function mH(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 $d(t,e){var r=e[0],n=e[2],i=e[4],a=e[1],o=e[3],s=e[5],l=r*o-a*n;return l?(l=1/l,t[0]=o*l,t[1]=-a*l,t[2]=-n*l,t[3]=r*l,t[4]=(n*s-o*i)*l,t[5]=(a*i-r*s)*l,t):null}function hst(t){var e=ka();return _x(e,t),e}const PIr=Object.freeze(Object.defineProperty({__proto__:null,clone:hst,copy:_x,create:ka,identity:WA,invert:$d,mul:Bd,rotate:xy,scale:mH,translate:sg},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}(),YA=Math.min,w_=Math.max,Hde=Math.abs,dst=["x","y"],NIr=["width","height"],qA=new wr,jA=new wr,XA=new wr,KA=new wr,Fd=mst(),WN=Fd.minTv,Wde=Fd.maxTv,YN=[0,0],pr=function(){function t(e,r,n,i){Yde(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=YA(e.x,this.x),n=YA(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=w_(e.x+e.width,this.x+this.width)-r:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=w_(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 fst(ka(),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,o=i&&i.clamp;if(a&&(a.x=a.y=a.width=a.height=NaN),!e||!r)return!1;e instanceof t||(e=Yde($Ir,e.x,e.y,e.width,e.height)),r instanceof t||(r=Yde(FIr,r.x,r.y,r.width,r.height));var s=!!n;Fd.reset(i,s);var l=Fd.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){A_(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&&A_(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],o=n[4],s=n[5];e.x=r.x*i+o,e.y=r.y*a+s,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}qA.x=XA.x=r.x,qA.y=KA.y=r.y,jA.x=KA.x=r.x+r.width,jA.y=XA.y=r.y+r.height,qA.transform(n),KA.transform(n),jA.transform(n),XA.transform(n),e.x=YA(qA.x,jA.x,XA.x,KA.x),e.y=YA(qA.y,jA.y,XA.y,KA.y);var l=w_(qA.x,jA.x,XA.x,KA.x),u=w_(qA.y,jA.y,XA.y,KA.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=WA(e||[]),sg(e,e,gy(qde,-r.x,-r.y)),mH(e,e,gy(qde,i,a)),sg(e,e,gy(qde,n.x,n.y)),e},t}(),vH=pr.create,Yde=pr.set,A_=pr.copy,fst=pr.calculateTransform,pst=pr.applyTransform,BIr=pr.contain,$Ir=new pr(0,0,0,0),FIr=new pr(0,0,0,0),qde=[];function gst(t,e,r,n,i,a,o,s){var l=Hde(e-r),u=Hde(n-t),h=YA(l,u),d=dst[i],f=dst[1-i],p=NIr[i];e=u||!Fd.bidirectional)&&(WN[d]=-u,WN[f]=0,Fd.useDir&&Fd.calcDirMTV())))}function mst(){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,o){n.touchThreshold=0,a&&a.touchThreshold!=null&&(n.touchThreshold=w_(0,a.touchThreshold)),n.negativeSize=!1,o&&(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,o=n.dirMinTv,s=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)&&o.set(0,0);return}if(r.x=s*u/h,r.y=s*l/h,i(r.x)&&i(r.y)){o.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)&&(jde.copy(f.getBoundingRect()),f.transform&&jde.applyTransform(f.transform),jde.intersect(h)&&s.push(f))}if(s.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 GIr(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 o=n.getClipPath();if(o&&!o.contain(e,r))return!1}n.silent&&(i=!0);var s=n.__hostTarget;n=s?n.ignoreHostSilent?null:s:n.parent}return i?vst:!0}return!1}function bst(t,e,r,n,i){for(var a=t.length-1;a>=0;a--){var o=t[a],s=void 0;if(o!==i&&!o.ignore&&(s=GIr(o,r,n))&&(!e.topTarget&&(e.topTarget=o),s!==vst)){e.target=o;break}}}function xst(t,e,r){var n=t.painter;return e<0||e>n.getWidth()||r<0||r>n.getHeight()}var wst=32,jN=7;function HIr(t){for(var e=0;t>=wst;)e|=t&1,t>>=1;return t+e}function Ast(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 WIr(t,e,r){for(r--;e>>1,i(a,t[l])<0?s=l:o=l+1;var u=n-o;switch(u){case 3:t[o+3]=t[o+2];case 2:t[o+2]=t[o+1];case 1:t[o+1]=t[o];break;default:for(;u>0;)t[o+u]=t[o+u-1],u--}t[o]=a}}function Xde(t,e,r,n,i,a){var o=0,s=0,l=1;if(a(t,e[r+i])>0){for(s=n-i;l0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}else{for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}for(o++;o>>1);a(t,e[r+h])>0?o=h+1:l=h}return l}function Kde(t,e,r,n,i,a){var o=0,s=0,l=1;if(a(t,e[r+i])<0){for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}else{for(s=n-i;l=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}for(o++;o>>1);a(t,e[r+h])<0?l=h:o=h+1}return l}function YIr(t,e){var r=jN,n,i,a=0,o=[];n=[],i=[];function s(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]=jN||T>=jN);if(C)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]=o[x];return}for(var T=r;;){var C=0,k=0,E=!1;do if(e(o[x],t[b])<0){if(t[w--]=t[b--],C++,k=0,--g===0){E=!0;break}}else if(t[w--]=o[x--],k++,C=0,--v===1){E=!0;break}while((C|k)=0;y--)t[S+y]=t[A+y];if(g===0){E=!0;break}}if(t[w--]=o[x--],--v===1){E=!0;break}if(k=v-Xde(t[b],o,0,v,v-1,e),k!==0){for(w-=k,x-=k,v-=k,S=w+1,A=x+1,y=0;y=jN||k>=jN);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]=o[x]}else{if(v===0)throw new Error;for(A=w-(v-1),y=0;ys&&(l=s),Sst(t,r,r+l,r+a,e),a=l}o.pushRun(r,a),o.mergeRuns(),i-=a,r+=a}while(i!==0);o.forceMergeRuns()}}var $h=1,XN=2,S_=4,Tst=!1;function Zde(){Tst||(Tst=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Cst(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var qIr=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Cst}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}(),bH;bH=Dn.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};var KN={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-KN.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?KN.bounceIn(t*2)*.5:KN.bounceOut(t*2-1)*.5+.5}},xH=Math.pow,Rx=Math.sqrt,wH=1e-8,Ost=1e-4,kst=Rx(3),AH=1/3,Em=Ox(),Xf=Ox(),T_=Ox();function Dx(t){return t>-wH&&twH||t<-wH}function rl(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 _st(t,e,r,n,i){var a=1-i;return 3*(((e-t)*a+2*(r-e)*i)*a+(n-r)*i*i)}function SH(t,e,r,n,i,a){var o=n+3*(e-r)-t,s=3*(r-e*2+t),l=3*(e-t),u=t-i,h=s*s-3*o*l,d=s*l-9*o*u,f=l*l-3*s*u,p=0;if(Dx(h)&&Dx(d))if(Dx(s))a[0]=0;else{var g=-l/s;g>=0&&g<=1&&(a[p++]=g)}else{var m=d*d-4*h*f;if(Dx(m)){var v=d/h,g=-s/o+v,y=-v/2;g>=0&&g<=1&&(a[p++]=g),y>=0&&y<=1&&(a[p++]=y)}else if(m>0){var b=Rx(m),x=h*s+1.5*o*(-d+b),w=h*s+1.5*o*(-d-b);x<0?x=-xH(-x,AH):x=xH(x,AH),w<0?w=-xH(-w,AH):w=xH(w,AH);var g=(-s-(x+w))/(3*o);g>=0&&g<=1&&(a[p++]=g)}else{var A=(2*h*s-3*o*d)/(2*Rx(h*h*h)),S=Math.acos(A)/3,T=Rx(h),C=Math.cos(S),g=(-s-2*T*C)/(3*o),y=(-s+T*(C+kst*Math.sin(S)))/(3*o),k=(-s+T*(C-kst*Math.sin(S)))/(3*o);g>=0&&g<=1&&(a[p++]=g),y>=0&&y<=1&&(a[p++]=y),k>=0&&k<=1&&(a[p++]=k)}}return p}function Rst(t,e,r,n,i){var a=6*r-12*e+6*t,o=9*e+3*n-3*t-9*r,s=3*e-3*t,l=0;if(Dx(o)){if(Est(a)){var u=-s/a;u>=0&&u<=1&&(i[l++]=u)}}else{var h=a*a-4*o*s;if(Dx(h))i[0]=-a/(2*o);else if(h>0){var d=Rx(h),u=(-a+d)/(2*o),f=(-a-d)/(2*o);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function Lx(t,e,r,n,i,a){var o=(e-t)*i+t,s=(r-e)*i+e,l=(n-r)*i+r,u=(s-o)*i+o,h=(l-s)*i+s,d=(h-u)*i+u;a[0]=t,a[1]=o,a[2]=u,a[3]=d,a[4]=d,a[5]=h,a[6]=l,a[7]=n}function Dst(t,e,r,n,i,a,o,s,l,u,h){var d,f=.005,p=1/0,g,m,v,y;Em[0]=l,Em[1]=u;for(var b=0;b<1;b+=.05)Xf[0]=rl(t,r,i,o,b),Xf[1]=rl(e,n,a,s,b),v=Ex(Em,Xf),v=0&&v=0&&u<=1&&(i[l++]=u)}}else{var h=o*o-4*a*s;if(Dx(h)){var u=-o/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(h>0){var d=Rx(h),u=(-o+d)/(2*a),f=(-o-d)/(2*a);u>=0&&u<=1&&(i[l++]=u),f>=0&&f<=1&&(i[l++]=f)}}return l}function Lst(t,e,r){var n=t+r-2*e;return n===0?.5:(t-e)/n}function ZN(t,e,r,n,i){var a=(e-t)*n+t,o=(r-e)*n+e,s=(o-a)*n+a;i[0]=t,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=r}function Mst(t,e,r,n,i,a,o,s,l){var u,h=.005,d=1/0;Em[0]=o,Em[1]=s;for(var f=0;f<1;f+=.05){Xf[0]=_l(t,r,i,f),Xf[1]=_l(e,n,a,f);var p=Ex(Em,Xf);p=0&&p=1?1:SH(0,n,a,1,l,s)&&rl(0,i,o,1,s[0])}}}var JIr=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||no,this.ondestroy=e.ondestroy||no,this.onrestart=e.onrestart||no,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 o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),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:KN[e]||efe(e)},t}(),Ist=function(){function t(e){this.value=e}return t}(),ePr=function(){function t(){this._len=0}return t.prototype.insert=function(e){var r=new Ist(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}(),C_=function(){function t(e){this._list=new ePr,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 o=n.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=n.head;n.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=r:s=new Ist(r),s.key=e,n.insertEntry(s),i[e]=s}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}(),Pst={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 lg(t){return t=Math.round(t),t<0?0:t>255?255:t}function tPr(t){return t=Math.round(t),t<0?0:t>360?360:t}function JN(t){return t<0?0:t>1?1:t}function TH(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?lg(parseFloat(e)/100*255):lg(parseInt(e,10))}function wy(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?JN(parseFloat(e)/100):JN(parseFloat(e))}function tfe(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 Mx(t,e,r){return t+(e-t)*r}function Kf(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function rfe(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var Nst=new C_(20),CH=null;function O_(t,e){CH&&rfe(CH,e),CH=Nst.put(t,CH||e.slice())}function Wc(t,e){if(t){e=e||[];var r=Nst.get(t);if(r)return rfe(e,r);t=t+"";var n=t.replace(/ /g,"").toLowerCase();if(n in Pst)return rfe(e,Pst[n]),O_(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)){Kf(e,0,0,0,1);return}return Kf(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),O_(t,e),e}else if(i===7||i===9){var a=parseInt(n.slice(1,7),16);if(!(a>=0&&a<=16777215)){Kf(e,0,0,0,1);return}return Kf(e,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(n.slice(7),16)/255:1),O_(t,e),e}return}var o=n.indexOf("("),s=n.indexOf(")");if(o!==-1&&s+1===i){var l=n.substr(0,o),u=n.substr(o+1,s-(o+1)).split(","),h=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?Kf(e,+u[0],+u[1],+u[2],1):Kf(e,0,0,0,1);h=wy(u.pop());case"rgb":if(u.length>=3)return Kf(e,TH(u[0]),TH(u[1]),TH(u[2]),u.length===3?h:wy(u[3])),O_(t,e),e;Kf(e,0,0,0,1);return;case"hsla":if(u.length!==4){Kf(e,0,0,0,1);return}return u[3]=wy(u[3]),nfe(u,e),O_(t,e),e;case"hsl":if(u.length!==3){Kf(e,0,0,0,1);return}return nfe(u,e),O_(t,e),e;default:return}}Kf(e,0,0,0,1)}}function nfe(t,e){var r=(parseFloat(t[0])%360+360)%360/360,n=wy(t[1]),i=wy(t[2]),a=i<=.5?i*(n+1):i+n-i*n,o=i*2-a;return e=e||[],Kf(e,lg(tfe(o,a,r+1/3)*255),lg(tfe(o,a,r)*255),lg(tfe(o,a,r-1/3)*255),1),t.length===4&&(e[3]=t[3]),e}function rPr(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),o=a-i,s=(a+i)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+i):u=o/(2-a-i);var h=((a-e)/6+o/2)/o,d=((a-r)/6+o/2)/o,f=((a-n)/6+o/2)/o;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,s];return t[3]!=null&&p.push(t[3]),p}}function OH(t,e){var r=Wc(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 Zf(r,r.length===4?"rgba":"rgb")}}function nPr(t){var e=Wc(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function e8(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),o=e[i],s=e[a],l=n-i;return r[0]=lg(Mx(o[0],s[0],l)),r[1]=lg(Mx(o[1],s[1],l)),r[2]=lg(Mx(o[2],s[2],l)),r[3]=JN(Mx(o[3],s[3],l)),r}}var iPr=e8;function ife(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),o=Wc(e[i]),s=Wc(e[a]),l=n-i,u=Zf([lg(Mx(o[0],s[0],l)),lg(Mx(o[1],s[1],l)),lg(Mx(o[2],s[2],l)),JN(Mx(o[3],s[3],l))],"rgba");return r?{color:u,leftIndex:i,rightIndex:a,value:n}:u}}var aPr=ife;function Ay(t,e,r,n){var i=Wc(t);if(t)return i=rPr(i),e!=null&&(i[0]=tPr(ur(e)?e(i[0]):e)),r!=null&&(i[1]=wy(ur(r)?r(i[1]):r)),n!=null&&(i[2]=wy(ur(n)?n(i[2]):n)),Zf(nfe(i),"rgba")}function t8(t,e){var r=Wc(t);if(r&&e!=null)return r[3]=JN(e),Zf(r,"rgba")}function Zf(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 r8(t,e){var r=Wc(t);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*e:0}function oPr(){return Zf([Math.round(Math.random()*255),Math.round(Math.random()*255),Math.round(Math.random()*255)],"rgb")}var Bst=new C_(100);function kH(t){if($t(t)){var e=Bst.get(t);return e||(e=OH(t,-.1),Bst.put(t,e)),e}else if($N(t)){var r=lt({},t);return r.colorStops=vt(t.colorStops,function(n){return{offset:n.offset,color:OH(n.color,-.1)}}),r}return t}const sPr=Object.freeze(Object.defineProperty({__proto__:null,fastLerp:e8,fastMapToColor:iPr,lerp:ife,lift:OH,liftColor:kH,lum:r8,mapToColor:aPr,modifyAlpha:t8,modifyHSL:Ay,parse:Wc,parseCssFloat:wy,parseCssInt:TH,random:oPr,stringify:Zf,toHex:nPr},Symbol.toStringTag,{value:"Module"}));var EH=Math.round;function n8(t){var e;if(!t||t==="transparent")t="none";else if(typeof t=="string"&&t.indexOf("rgba")>-1){var r=Wc(t);r&&(t="rgb("+r[0]+","+r[1]+","+r[2]+")",e=r[3])}return{color:t,opacity:e??1}}var $st=1e-4;function Ix(t){return t<$st&&t>-$st}function _H(t){return EH(t*1e3)/1e3}function afe(t){return EH(t*1e4)/1e4}function lPr(t){return"matrix("+_H(t[0])+","+_H(t[1])+","+_H(t[2])+","+_H(t[3])+","+afe(t[4])+","+afe(t[5])+")"}var cPr={left:"start",right:"end",center:"middle",middle:"middle"};function uPr(t,e,r){return r==="top"?t+=e/2:r==="bottom"&&(t-=e/2),t}function hPr(t){return t&&(t.shadowBlur||t.shadowOffsetX||t.shadowOffsetY)}function dPr(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 Fst(t){return t&&!!t.image}function fPr(t){return t&&!!t.svgElement}function ofe(t){return Fst(t)||fPr(t)}function zst(t){return t.type==="linear"}function Ust(t){return t.type==="radial"}function Vst(t){return t&&(t.type==="linear"||t.type==="radial")}function RH(t){return"url(#"+t+")"}function Qst(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 Gst(t){var e=t.x||0,r=t.y||0,n=(t.rotation||0)*VN,i=Jt(t.scaleX,1),a=Jt(t.scaleY,1),o=t.skewX||0,s=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+")"),(o||s)&&l.push("skew("+EH(o*VN)+"deg, "+EH(s*VN)+"deg)"),l.join(" ")}var pPr=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}}(),sfe=Array.prototype.slice;function Sy(t,e,r){return(e-t)*r+t}function lfe(t,e,r,n){for(var i=e.length,a=0;an?e:t,a=Math.min(r,n),o=i[a-1]||{color:[0,0,0,0],offset:0},s=a;so;if(s)n.length=o;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,o=!1,s=Yst,l=r;if(lc(r)){var u=yPr(r);s=u,(u===1&&!Vn(r[0])||u===2&&!Vn(r[0][0]))&&(o=!0)}else if(Vn(r)&&!cc(r))s=MH;else if($t(r))if(!isNaN(+r))s=MH;else{var h=Wc(r);h&&(l=h,s=a8)}else if($N(r)){var d=lt({},l);d.colorStops=vt(r.colorStops,function(p){return{offset:p.offset,color:Wc(p.color)}}),zst(r)?s=cfe:Ust(r)&&(s=ufe),l=d}a===0?this.valType=s:(s!==this.valType||s===Yst)&&(o=!0),this.discrete=this.discrete||o;var f={time:e,value:l,rawValue:r,percent:0};return n&&(f.easing=n,f.easingFunc=ur(n)?n:KN[n]||efe(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,o=n[a-1],s=this.discrete,l=PH(i),u=qst(i),h=0;h=0&&!(o[h].percent<=r);h--);h=f(h,s-2)}else{for(h=d;hr);h++);h=f(h-1,s-2)}g=o[h+1],p=o[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?o8:e[l];if((PH(a)||u)&&!b&&(b=this._additiveValue=[]),this.discrete)e[l]=y<1?p.rawValue:g.rawValue;else if(PH(a))a===IH?lfe(b,p[i],g[i],y):gPr(b,p[i],g[i],y);else if(qst(a)){var x=p[i],w=g[i],A=a===cfe;e[l]={type:A?"linear":"radial",x:Sy(x.x,w.x,y),y:Sy(x.y,w.y,y),colorStops:vt(x.colorStops,function(T,C){var k=w.colorStops[C];return{offset:Sy(T.offset,k.offset,y),color:LH(lfe([],T.color,k.color,y))}}),global:w.global},A?(e[l].x2=Sy(x.x2,w.x2,y),e[l].y2=Sy(x.y2,w.y2,y)):e[l].r=Sy(x.r,w.r,y)}else if(u)lfe(b,p[i],g[i],y),n||(e[l]=LH(b));else{var S=Sy(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===MH?e[n]=e[n]+i:r===a8?(Wc(e[n],o8),DH(o8,o8,i,1),e[n]=LH(o8)):r===IH?DH(e[n],e[n],i,1):r===Wst&&Hst(e[n],e[n],i,1)},t}(),hfe=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){cH("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,En(r),n)},t.prototype.whenWithKeys=function(e,r,n,i){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,i8(u),i),this._trackKeys.push(s)}l.addKeyframe(e,i8(r[s]),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 s=o.pop();a.addKeyframe(s.time,e[i]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},t}();function k_(){return new Date().getTime()}var xPr=function(t){ya(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=k_()-this._pausedTime,i=n-this._time,a=this._head;a;){var o=a.next,s=a.step(n,i);s&&(a.ondestroy(),this.removeClip(a)),a=o}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&&(bH(n),!r._paused&&r.update())}bH(n)},e.prototype.start=function(){this._running||(this._time=k_(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=k_(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=k_()-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 hfe(r,n.loop);return this.addAnimator(i),i},e}(qf),wPr=300,dfe=Dn.domSupported,ffe=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}}(),jst={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},Xst=!1;function pfe(t){var e=t.pointerType;return e==="pen"||e==="touch"}function APr(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 gfe(t){t&&(t.zrByTouch=!0)}function SPr(t,e){return jf(t.dom,new TPr(t,e),!0)}function Kst(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 TPr=function(){function t(e,r){this.stopPropagation=no,this.stopImmediatePropagation=no,this.preventDefault=no,this.type=r.type,this.target=this.currentTarget=e.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return t}(),cg={mousedown:function(t){t=jf(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=jf(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=jf(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){t=jf(this.dom,t);var e=t.toElement||t.relatedTarget;Kst(this,e)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){Xst=!0,t=jf(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){Xst||(t=jf(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){t=jf(this.dom,t),gfe(t),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),cg.mousemove.call(this,t),cg.mousedown.call(this,t)},touchmove:function(t){t=jf(this.dom,t),gfe(t),this.handler.processGesture(t,"change"),cg.mousemove.call(this,t)},touchend:function(t){t=jf(this.dom,t),gfe(t),this.handler.processGesture(t,"end"),cg.mouseup.call(this,t),+new Date-+this.__lastTouchMomenttlt||t<-tlt}var JA=[],E_=[],wfe=ka(),Afe=Math.abs,_m=function(){function t(){}return t.prototype.getLocalTransform=function(e){return Px(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 ZA(this.rotation)||ZA(this.x)||ZA(this.y)||ZA(this.scaleX-1)||ZA(this.scaleY-1)||ZA(this.skewX)||ZA(this.skewY)},t.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,r=this.needLocalTransform(),n=this.transform;if(!(r||e)){n&&(elt(n),this.invTransform=null);return}n=n||ka(),r?this.getLocalTransform(n):elt(n),e&&(r?Bd(n,e,n):_x(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n),this.invTransform=this.invTransform||ka(),$d(this.invTransform,n)},t.prototype._resolveGlobalScaleRatio=function(e){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(JA);var n=JA[0]<0?-1:1,i=JA[1]<0?-1:1,a=((JA[0]-n)*r+n)/JA[0]||0,o=((JA[1]-i)*r+i)/JA[1]||0;e[0]*=a,e[1]*=a,e[2]*=o,e[3]*=o}},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||ka(),Bd(E_,e.invTransform,r),r=E_);var n=this.originX,i=this.originY;(n||i)&&(wfe[4]=n,wfe[5]=i,Bd(E_,r,wfe),E_[4]-=n,E_[5]-=i,r=E_),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&&io(n,n,i),n},t.prototype.transformCoordToGlobal=function(e,r){var n=[e,r],i=this.transform;return i&&io(n,n,i),n},t.prototype.getLineScale=function(){var e=this.transform;return e&&Afe(e[0]-1)>1e-10&&Afe(e[3]-1)>1e-10?Math.sqrt(Afe(e[0]*e[3]-e[2]*e[1])):1},t.prototype.copyTransform=function(e){Rm(this,e)},t.getLocalTransform=function(e,r){r=r||[];var n=e.originX||0,i=e.originY||0,a=e.scaleX,o=e.scaleY,s=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||s||l){var g=n+s,m=i+l;r[4]=-g*a-f*m*o,r[5]=-m*o-p*g*a}else r[4]=r[5]=0;return r[0]=a,r[3]=o,r[1]=p*a,r[2]=f*o,u&&xy(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}(),Px=_m.getLocalTransform;function __(){return new _m}var Ty=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function Rm(t,e){return Jot(t,e,Ty)}function Dm(t){$H||($H=new C_(100)),t=t||fy;var e=$H.get(t);return e||(e={font:t,strWidthCache:new C_(500),asciiWidthMap:null,asciiWidthMapTried:!1,stWideCharWidth:tl.measureText("国",t).width,asciiCharWidth:tl.measureText("a",t).width},$H.put(t,e)),e}var $H;function _Pr(t){if(!(Sfe>=rlt)){t=t||fy;for(var e=[],r=+new Date,n=0;n<=127;n++)e[n]=tl.measureText(String.fromCharCode(n),t).width;var i=+new Date-r;return i>16?Sfe=rlt:i>2&&Sfe++,e}}var Sfe=0,rlt=5;function nlt(t,e){return t.asciiWidthMapTried||(t.asciiWidthMap=_Pr(t.font),t.asciiWidthMapTried=!0),0<=e&&e<=127?t.asciiWidthMap!=null?t.asciiWidthMap[e]:t.asciiCharWidth:t.stWideCharWidth}function Lm(t,e){var r=t.strWidthCache,n=r.get(e);return n==null&&(n=tl.measureText(e,t.font).width,r.put(e,n)),n}function ilt(t,e,r,n){var i=Lm(Dm(e),t),a=s8(e),o=R_(0,i,r),s=eS(0,a,n),l=new pr(o,s,i,a);return l}function FH(t,e,r,n){var i=((t||"")+"").split(` +`),a=i.length;if(a===1)return ilt(i[0],e,r,n);for(var o=new pr(0,0,0,0),s=0;s=0?parseFloat(t)/100*e:parseFloat(t):t}function zH(t,e,r){var n=e.position||"inside",i=e.distance!=null?e.distance:5,a=r.height,o=r.width,s=a/2,l=r.x,u=r.y,h="left",d="top";if(n instanceof Array)l+=Mm(n[0],r.width),u+=Mm(n[1],r.height),h=null,d=null;else switch(n){case"left":l-=i,u+=s,h="right",d="middle";break;case"right":l+=i+o,u+=s,d="middle";break;case"top":l+=o/2,u-=i,h="center",d="bottom";break;case"bottom":l+=o/2,u+=a+i,h="center";break;case"inside":l+=o/2,u+=s,h="center",d="middle";break;case"insideLeft":l+=i,u+=s,d="middle";break;case"insideRight":l+=o-i,u+=s,h="right",d="middle";break;case"insideTop":l+=o/2,u+=i,h="center";break;case"insideBottom":l+=o/2,u+=a-i,h="center",d="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=o-i,u+=i,h="right";break;case"insideBottomLeft":l+=i,u+=a-i,d="bottom";break;case"insideBottomRight":l+=o-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 Tfe="__zr_normal__",Cfe=Ty.concat(["ignore"]),RPr=Yf(Ty,function(t,e){return t[e]=!0,t},{ignore:!1}),D_={},DPr=new pr(0,0,0,0),UH=[],VH=0,QH=1,GH=function(){function t(e){this.id=Rde(),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,o=void 0,s=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=DPr,n.layoutRect?f.copy(n.layoutRect):f.copy(this.getBoundingRect()),i||f.applyTransform(this.transform)),h){this.calculateTextPosition?this.calculateTextPosition(D_,n,f):zH(D_,n,f),a.x=D_.x,a.y=D_.y,o=D_.align,s=D_.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=Mm(p[0],f.width),m=Mm(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 pr(0,0,0,0);a.getLocalTransform(UH),$d(UH,UH),pr.copy(b,f),b.applyTransform(UH)}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||o!==y.align||s!==y.verticalAlign)&&(l=!0,y.fill=w,y.stroke=A,y.autoStroke=S,y.align=o,y.verticalAlign=s,r.setDefaultTextStyle(y)),r.__dirty|=$h,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()?xfe:bfe},t.prototype.getOutsideStroke=function(e){var r=this.__zr&&this.__zr.getBackgroundColor(),n=typeof r=="string"&&Wc(r);n||(n=[255,255,255,1]);for(var i=n[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*i+(a?0:255)*(1-i);return n[3]=1,Zf(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||{},lt(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=En(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(Tfe,!1,e)},t.prototype.useState=function(e,r,n,i){var a=e===Tfe,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(Nr(s,e)>=0&&(r||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(e)),u||(u=this.states&&this.states[e]),!u&&!a){cH("State "+e+" not exists.");return}a||this.saveCurrentToNormalState(u);var h=this._textContent,d=olt(this,h,u,i);d&&!this.__inHover&&(this.__inHover=d),this._applyStateObj(e,u,this._normalState,r,llt(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=VH,this.__dirty&=~$h),u}}},t.prototype.useStates=function(e,r,n){if(!e.length)this.clearStates();else{var i=[],a=this.currentStates,o=e.length,s=o===a.length;if(s){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=Nr(i,e),o=Nr(i,r)>=0;a>=0?o?i.splice(a,1):i[a]=r:n&&!o&&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(o,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=[],o=0;o0&&r.during&&a[0].during(function(g,m){r.during(m)});for(var f=0;f0||i.force&&!o.length){var C=void 0,k=void 0,E=void 0;if(s){k={},f&&(C={});for(var w=0;w0}var gr=function(t){ya(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=Nr(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 o=this.__zr;o&&a.removeSelfFromZr(o),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=Nr(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 o;if(t>=a)return s}else{if(t>=i)return o;if(t<=a)return s}else{if(t===i)return o;if(t===a)return s}return(t-i)/l*u+o}var Qt=HPr;function HPr(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 qH(t,e,r)}function qH(t,e,r){return $t(t)?hlt(t)?parseFloat(t)/100*e+(r||0):parseFloat(t):t==null?NaN:+t}function WPr(t){return $t(t)&&hlt(t)}function hlt(t){return!!QPr(t).match(/%$/)}function Yn(t,e,r){return isNaN(e)?r?""+t:+t:(e=Oi(rn(0,e),WH),t=(+t).toFixed(e),r?t:+t)}function YPr(t,e,r){return e==null&&(e=10),Yn(t,e,r)}function Rl(t){return t.sort(function(e,r){return e-r}),t}function Pm(t){if(t=+t,isNaN(t))return 0;if(t>1e-14){for(var e=1,r=0;r<15;r++,e*=10)if(Im(t*e)/e===t)return r}return dlt(t)}function dlt(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("."),o=a<0?0:i-1-a;return rn(0,o-n)}function qPr(t,e){var r=Jf(iS(t[1]-t[0])/l8),n=Im(iS(ao(e[1]-e[0]))/l8),i=Oi(rn(-r+n,0),WH);return isFinite(i)?i:WH}function Rfe(t,e,r){var n=ao(t[1]-t[0]);if(!isFinite(n)||n===0)return NaN;var i=iS(2*ao(r||1)*ao(n))/l8,a=iS(ao(e))/l8,o=rn(0,rS(-i+a));return isFinite(o)||(o=NaN),o}function jPr(t,e,r){if(!t[e])return 0;var n=flt(t,r);return n[e]||0}function flt(t,e){var r=Yf(t,function(p,g){return p+(isNaN(g)?0:g)},0);if(r===0)return[];for(var n=nS(10,e),i=vt(t,function(p){return(isNaN(p)?0:p)/r*n*100}),a=n*100,o=vt(i,function(p){return Jf(p)}),s=Yf(o,function(p,g){return p+g},0),l=vt(i,function(p,g){return p-o[g]});su&&(u=l[d],h=d);++o[h],l[h]=0,++s}return vt(o,function(p){return p/n})}function aS(t,e){var r=rn(Pm(t),Pm(e)),n=t+e;return r>WH?n:Yn(n,r)}var c8=nS(2,53)-1;function Dfe(t){var e=YH*2;return(t%e+e)%e}function oS(t){return t>-ult&&t=10&&e++,e}var plt=2;function XH(t,e){var r=jH(t),n=nS(10,r),i=t/n,a;return e===plt?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,Yn(t,-r)}function KH(t,e){var r=(t.length-1)*e+1,n=Jf(r),i=+t[n-1],a=r-n;return a?i+a*(t[n]-i):i}function Mfe(t){t.sort(function(l,u){return s(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 zfe(t){t.option=t.parentModel=t.ecModel=null}function dc(){return[1/0,-1/0]}function Ufe(t,e){Cy(e)&&(et[1]&&(t[1]=e))}function Olt(t,e){Cy(e)&&et[1]&&(t[1]=e)}function g6r(t,e){cS(e[0],e[1])&&(e[0]t[1]&&(t[1]=e[1]))}function Cy(t){return t!=null&&isFinite(t)}function cS(t,e){return Cy(t)&&Cy(e)&&t<=e}function m6r(t){var e=t[1]-t[0];return isFinite(e)&&e>=0}function ZH(t){cS(t[0],t[1])&&t[0]>t[1]&&(t[0]=t[1])}function P_(){var t="__ec_once_"+v6r++;return function(e,r){Kt(e,t)||(e[t]=1,r())}}var v6r=Pfe();function JH(t,e,r){var n=qt(),i=0;fe(t,function(a){var o=e(a),s=n.get(o)||0;r&&r(a,s),!s&&!r&&(t[i++]=a),n.set(o,s+1)}),r||(t.length=i)}function y6r(t){return t.value+""}function b6r(t){return t+""}function $m(t,e){return Jt(e,!0)?t.seriesIndex+2:0}function Elt(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 Ls(t,e){return{seriesType:t,overallReset:e}}function d8(t){return{overallReset:t}}var x6r=".",uS="___EC__COMPONENT__CONTAINER___",_lt="___EC__EXTENDED_CLASS___";function Fm(t){var e={main:"",sub:""};if(t){var r=t.split(x6r);e.main=r[0]||"",e.sub=r[1]||""}return e}function w6r(t){uc(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}function A6r(t){return!!(t&&t[_lt])}function Vfe(t,e){t.$constructor=t,t.extend=function(r){var n=this,i;return S6r(n)?i=function(a){nt(o,a);function o(){return a.apply(this,arguments)||this}return o}(n):(i=function(){(r.$constructor||n).apply(this,arguments)},Dde(i,this)),lt(i.prototype,r),i[_lt]=!0,i.extend=this.extend,i.superCall=O6r,i.superApply=k6r,i.superClass=n,i}}function S6r(t){return ur(t)&&/^class\s/.test(Function.prototype.toString.call(t))}function Rlt(t,e){t.extend=e.extend}var T6r=Math.round(Math.random()*10);function C6r(t){var e=["__\0is_clz",T6r++].join("_");t.prototype[e]=!0,t.isInstance=function(r){return!!(r&&r[e])}}function O6r(t,e){for(var r=[],n=2;n=0||a&&Nr(a,l)<0)){var u=n.getShallow(l,e);u!=null&&(o[t[s][0]]=u)}}return o}}var E6r=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],_6r=hS(E6r),R6r=function(){function t(){}return t.prototype.getAreaStyle=function(e,r){return _6r(this,e,r)},t}(),Qfe=new C_(50);function D6r(t){if(typeof t=="string"){var e=Qfe.get(t);return e&&e.image}else return t}function Gfe(t,e,r,n,i){if(t)if(typeof t=="string"){if(e&&e.__zrImageSrc===t||!r)return e;var a=Qfe.get(t),o={hostEl:r,cb:n,cbPayload:i};return a?(e=a.image,!tW(e)&&a.pending.push(o)):(e=tl.loadImage(t,Dlt,Dlt),e.__zrImageSrc=t,Qfe.put(t,e.__cachedImgObj={image:e,pending:[o]})),e}else return t;else return e}function Dlt(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=s;u++)l-=s;var h=Lm(o,r);return h>l&&(r="",h=0),l=t-h,i.ellipsis=r,i.ellipsisWidth=h,i.contentWidth=l,i.containerWidth=t,i}function Ilt(t,e,r){var n=r.containerWidth,i=r.contentWidth,a=r.fontMeasureInfo;if(!n){t.textLine="",t.isTruncated=!1;return}var o=Lm(a,e);if(o<=n){t.textLine=e,t.isTruncated=!1;return}for(var s=0;;s++){if(o<=i||s>=r.maxIterations){e+=r.ellipsis;break}var l=s===0?M6r(e,i,a):o>0?Math.floor(e.length*i/o):0;e=e.substr(0,l),o=Lm(a,e)}e===""&&(e=r.placeholder),t.textLine=e,t.isTruncated=!0}function M6r(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=Mlt(m,u,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),A={},S=0;Sg&&Wfe(a,o.substring(g,v),e,p),Wfe(a,m[2],e,p,m[1]),g=Hfe.lastIndex}gd){var F=a.lines.length;P>0?(k.tokens=k.tokens.slice(0,P),T(k,_,E),a.lines=a.lines.slice(0,C+1)):a.lines=a.lines.slice(0,C),a.isTruncated=a.isTruncated||a.lines.length0&&g+n.accumWidth>n.width&&(h=e.split(` -`),u=!0),n.accumWidth=g}else{var m=Nlt(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=Dm(l),y=0;y=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var F6r=Yf(",&?/;] ".split(""),function(t,e){return t[e]=!0,t},{});function z6r(t){return $6r(t)?!!F6r[t]:!0}function Nlt(t,e,r,n,i){for(var a=[],o=[],s="",l="",u=0,h=0,d=Dm(e),f=0;fr:i+h+g>r){h?(s||l)&&(m?(s||(s=l,l="",u=0,h=u),a.push(s),o.push(h-u),l+=p,u+=g,s="",h=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(h),s=p,h=g)):m?(a.push(l),o.push(u),l=p,u=g):(a.push(p),o.push(g));continue}h+=g,m?(l+=p,u+=g):(l&&(s+=l,l="",u=0),s+=p)}return l&&(s+=l),s&&(a.push(s),o.push(h)),a.length===1&&(h+=i),{accumWidth:h,lines:a,linesWidths:o}}function Blt(t,e,r,n,i,a){if(t.baseX=r,t.baseY=n,t.outerWidth=t.outerHeight=null,!!e){var o=e.width*2,s=e.height*2;pr.set($lt,R_(r,o,i),eS(n,s,a),o,s),pr.intersect(e,$lt,null,Flt);var l=Flt.outIntersectRect;t.outerWidth=l.width,t.outerHeight=l.height,t.baseX=R_(l.x,l.width,i,!0),t.baseY=eS(l.y,l.height,a,!0)}}var $lt=new pr(0,0,0,0),Flt={outIntersectRect:{},clamp:!0};function Yfe(t){return t!=null?t+="":t=""}function U6r(t){var e=Yfe(t.text),r=t.font,n=Lm(Dm(r),e),i=s8(r);return qfe(t,n,i,null)}function qfe(t,e,r,n){var i=new pr(R_(t.x||0,e,t.textAlign),eS(t.y||0,r,t.textBaseline),e,r),a=n??(zlt(t)?t.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function zlt(t){var e=t.stroke;return e!=null&&e!=="none"&&t.lineWidth>0}var jfe="__zr_style_"+Math.round(Math.random()*10),dS={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},rW={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};dS[jfe]=!0;var Ult=["z","z2","invisible"],V6r=["invisible"],tp=function(t){ya(e,t);function e(r){return t.call(this,r)||this}return e.prototype._init=function(r){for(var n=En(r),i=0;i1e-4){s[0]=t-r,s[1]=e-n,l[0]=t+r,l[1]=e+n;return}if(nW[0]=Jfe(i)*r+t,nW[1]=Zfe(i)*n+e,iW[0]=Jfe(a)*r+t,iW[1]=Zfe(a)*n+e,u(s,nW,iW),h(l,nW,iW),i=i%fS,i<0&&(i=i+fS),a=a%fS,a<0&&(a=a+fS),i>a&&!o?a+=fS:ii&&(aW[0]=Jfe(p)*r+t,aW[1]=Zfe(p)*n+e,u(s,aW,s),h(l,aW,l))}var ra={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},pS=[],gS=[],zm=[],Bx=[],Um=[],Vm=[],epe=Math.min,tpe=Math.max,mS=Math.cos,vS=Math.sin,Oy=Math.abs,rpe=Math.PI,$x=rpe*2,npe=typeof Float32Array<"u",f8=[];function ipe(t){var e=Math.round(t/rpe*1e8)/1e8;return e%2*rpe}function sW(t,e){var r=ipe(t[0]);r<0&&(r+=$x);var n=r-t[0],i=t[1];i+=n,!e&&i-r>=$x?i=r+$x:e&&r-i>=$x?i=r-$x:!e&&r>i?i=r+($x-ipe(r-i)):e&&r0&&(this._ux=Oy(n/BH/e)||0,this._uy=Oy(n/BH/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(ra.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=Oy(e-this._xi),i=Oy(r-this._yi),a=n>this._ux||i>this._uy;if(this.addData(ra.L,e,r),this._ctx&&a&&this._ctx.lineTo(e,r),a)this._xi=e,this._yi=r,this._pendingPtDist=0;else{var o=n*n+i*i;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=r,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(e,r,n,i,a,o){return this._drawPendingPt(),this.addData(ra.C,e,r,n,i,a,o),this._ctx&&this._ctx.bezierCurveTo(e,r,n,i,a,o),this._xi=a,this._yi=o,this},t.prototype.quadraticCurveTo=function(e,r,n,i){return this._drawPendingPt(),this.addData(ra.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,o){this._drawPendingPt(),f8[0]=i,f8[1]=a,sW(f8,o),i=f8[0],a=f8[1];var s=a-i;return this.addData(ra.A,e,r,n,n,i,s,0,o?0:1),this._ctx&&this._ctx.arc(e,r,n,i,a,o),this._xi=mS(a)*n+e,this._yi=vS(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(ra.R,e,r,n,i),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(ra.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)&&npe&&(this.data=new Float32Array(r));for(var n=0;n0&&o))for(var s=0;sh.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(){zm[0]=zm[1]=Um[0]=Um[1]=Number.MAX_VALUE,Bx[0]=Bx[1]=Vm[0]=Vm[1]=-Number.MAX_VALUE;var e=this.data,r=0,n=0,i=0,a=0,o;for(o=0;on||Oy(x)>i||f===r-1)&&(m=Math.sqrt(b*b+x*x),a=v,o=y);break}case ra.C:{var w=e[f++],A=e[f++],v=e[f++],y=e[f++],S=e[f++],T=e[f++];m=YIr(a,o,w,A,v,y,S,T,10),a=S,o=T;break}case ra.Q:{var w=e[f++],A=e[f++],v=e[f++],y=e[f++];m=jIr(a,o,w,A,v,y,10),a=v,o=y;break}case ra.A:var C=e[f++],k=e[f++],E=e[f++],_=e[f++],P=e[f++],L=e[f++],R=L+P;f+=1,g&&(s=mS(P)*E+C,l=vS(P)*_+k),m=tpe(E,_)*epe($x,Math.abs(L)),a=mS(R)*E+C,o=vS(R)*_+k;break;case ra.R:{s=a=e[f++],l=o=e[f++];var D=e[f++],M=e[f++];m=D*2+M*2;break}case ra.Z:{var b=s-a,x=l-o;m=Math.sqrt(b*b+x*x),a=s,o=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,o=this._len,s,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 ra.M:s=u=n[S++],l=h=n[S++],e.moveTo(u,h);break;case ra.L:{d=n[S++],f=n[S++];var k=Oy(d-u),E=Oy(f-h);if(k>i||E>a){if(p){var _=g[y++];if(v+_>b){var P=(b-v)/_;e.lineTo(u*(1-P)+d*P,h*(1-P)+f*P);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 ra.C:{var R=n[S++],D=n[S++],M=n[S++],I=n[S++],N=n[S++],F=n[S++];if(p){var _=g[y++];if(v+_>b){var P=(b-v)/_;Lx(u,R,M,N,P,pS),Lx(h,D,I,F,P,gS),e.bezierCurveTo(pS[1],gS[1],pS[2],gS[2],pS[3],gS[3]);break e}v+=_}e.bezierCurveTo(R,D,M,I,N,F),u=N,h=F;break}case ra.Q:{var R=n[S++],D=n[S++],M=n[S++],I=n[S++];if(p){var _=g[y++];if(v+_>b){var P=(b-v)/_;ZN(u,R,M,P,pS),ZN(h,D,I,P,gS),e.quadraticCurveTo(pS[1],gS[1],pS[2],gS[2]);break e}v+=_}e.quadraticCurveTo(R,D,M,I),u=M,h=I;break}case ra.A:var B=n[S++],V=n[S++],z=n[S++],U=n[S++],Q=n[S++],G=n[S++],q=n[S++],Y=!n[S++],ne=z>U?z:U,X=Oy(z-U)>.001,J=Q+G,ee=!1;if(p){var _=g[y++];v+_>b&&(J=Q+G*(b-v)/_,ee=!0),v+=_}if(X&&e.ellipse?e.ellipse(B,V,z,U,q,Q,J,Y):e.arc(B,V,ne,Q,J,Y),ee)break e;C&&(s=mS(Q)*z+B,l=vS(Q)*U+V),u=mS(J)*z+B,h=vS(J)*U+V;break;case ra.R:s=u=n[S],l=h=n[S+1],d=n[S++],f=n[S++];var te=n[S++],pe=n[S++];if(p){var _=g[y++];if(v+_>b){var ie=b-v;e.moveTo(d,f),e.lineTo(d+epe(ie,te),f),ie-=te,ie>0&&e.lineTo(d+te,f+epe(ie,pe)),ie-=pe,ie>0&&e.lineTo(d+tpe(te-ie,0),f+pe),ie-=te,ie>0&&e.lineTo(d,f+tpe(pe-ie,0));break e}v+=_}e.rect(d,f,te,pe);break;case ra.Z:if(p){var _=g[y++];if(v+_>b){var P=(b-v)/_;e.lineTo(u*(1-P)+s*P,h*(1-P)+l*P);break e}v+=_}e.closePath(),u=s,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=ra,t.initDefaultProps=function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),t}();function Fx(t,e,r,n,i,a,o){if(i===0)return!1;var s=i,l=0,u=t;if(o>e+s&&o>n+s||ot+s&&a>r+s||ae+d&&h>n+d&&h>a+d&&h>s+d||ht+d&&u>r+d&&u>i+d&&u>o+d||ue+u&&l>n+u&&l>a+u||lt+u&&s>r+u&&s>i+u||sr||h+ui&&(i+=p8);var f=Math.atan2(l,s);return f<0&&(f+=p8),f>=n&&f<=i||f+p8>=n&&f+p8<=i}function ky(t,e,r,n,i,a){if(a>e&&a>n||ai?s:0}var zx=Qm.CMD,yS=Math.PI*2,j6r=1e-4;function X6r(t,e){return Math.abs(t-e)e&&u>n&&u>a&&u>s||u1&&K6r(),p=rl(e,n,a,s,rp[0]),f>1&&(g=rl(e,n,a,s,rp[1]))),f===2?ve&&s>n&&s>a||s=0&&u<=1){for(var h=0,d=_l(e,n,a,u),f=0;fr||s<-r)return 0;var l=Math.sqrt(r*r-s*s);Du[0]=-l,Du[1]=l;var u=Math.abs(n-i);if(u<1e-4)return 0;if(u>=yS-1e-4){n=0,i=yS;var h=a?1:-1;return o>=Du[0]+t&&o<=Du[1]+t?h:0}if(n>i){var d=n;n=i,i=d}n<0&&(n+=yS,i+=yS);for(var f=0,p=0;p<2;p++){var g=Du[p];if(g+t>o){var m=Math.atan2(s,g),h=a?1:-1;m<0&&(m=yS+m),(m>=n&&m<=i||m+yS>=n&&m+yS<=i)&&(m>Math.PI/2&&m1&&(r||(s+=ky(l,u,h,d,n,i))),v&&(l=a[g],u=a[g+1],h=l,d=u),m){case zx.M:h=a[g++],d=a[g++],l=h,u=d;break;case zx.L:if(r){if(Fx(l,u,a[g],a[g+1],e,n,i))return!0}else s+=ky(l,u,a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case zx.C:if(r){if(Y6r(l,u,a[g++],a[g++],a[g++],a[g++],a[g],a[g+1],e,n,i))return!0}else s+=Z6r(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 zx.Q:if(r){if(Hlt(l,u,a[g++],a[g++],a[g],a[g+1],e,n,i))return!0}else s+=J6r(l,u,a[g++],a[g++],a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case zx.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):s+=ky(l,u,f,p,n,i);var C=(n-y)*w/x+y;if(r){if(q6r(y,b,w,A,A+S,T,e,C,i))return!0}else s+=eNr(y,b,w,A,A+S,T,C,i);l=Math.cos(A+S)*x+y,u=Math.sin(A+S)*w+b;break;case zx.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(Fx(h,d,f,d,e,n,i)||Fx(f,d,f,p,e,n,i)||Fx(f,p,h,p,e,n,i)||Fx(h,p,h,d,e,n,i))return!0}else s+=ky(f,d,f,p,n,i),s+=ky(h,p,h,d,n,i);break;case zx.Z:if(r){if(Fx(l,u,h,d,e,n,i))return!0}else s+=ky(l,u,h,d,n,i);l=h,u=d;break}}return!r&&!X6r(u,d)&&(s+=ky(l,u,h,d,n,i)||0),s!==0}function tNr(t,e,r){return Ylt(t,0,!1,e,r)}function rNr(t,e,r,n){return Ylt(t,e,!0,r,n)}var lW=mr({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},dS),nNr={style:mr({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},rW.style)},ape=Ty.concat(["invisible","culling","z","z2","zlevel","parent"]),yn=function(t){ya(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 o in n)a[o]!==n[o]&&(a[o]=n[o]);a.fill=n.fill?n.decal:null,a.decal=null,a.shadowColor=null,n.strokeFirst&&(a.stroke=null);for(var s=0;s.5?bfe:n>.2?OPr:xfe}else if(r)return xfe}return bfe},e.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if($t(n)){var i=this.__zr,a=!!(i&&i.isDarkMode()),o=r8(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 o=this.path;(a||this.__dirty&S_)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),r=o.getBoundingRect()}if(this._rect=r,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=r.clone());if(this.__dirty||i){s.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&&(s.width+=u/l,s.height+=u/l,s.x-=u/l/2,s.y-=u/l/2)}return s}return r},e.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect(),o=this.style;if(r=i[0],n=i[1],a.contain(r,n)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),rNr(s,l/u,r,n)))return!0}if(this.hasFill())return tNr(s,r,n)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=S_,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:lt(i,r),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&S_)},e.prototype.createStyle=function(r){return UN(lW,r)},e.prototype._innerSaveToNormal=function(r){t.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.shape&&!n.shape&&(n.shape=lt({},this.shape))},e.prototype._applyStateObj=function(r,n,i,a,o,s){if(t.prototype._applyStateObj.call(this,r,n,i,a,o,s),this.__inHover!==QH){var l=!(n&&a),u;if(n&&n.shape?o?a?u=n.shape:(u=lt({},i.shape),lt(u,n.shape)):(u=lt({},a?this.shape:i.shape),lt(u,n.shape)):l&&(u=i.shape),u)if(o){this.shape=lt({},this.shape);for(var h={},d=En(u),f=0;fi&&(d=s+l,s*=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),s+h>a&&(d=s+h,s*=a/d,h*=a/d),t.moveTo(r+s,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+s),s!==0&&t.arc(r+s,n+s,s,Math.PI,Math.PI*1.5),t.closePath()}var B_=Math.round;function cW(t,e,r){if(e){var n=e.x1,i=e.x2,a=e.y1,o=e.y2;t.x1=n,t.x2=i,t.y1=a,t.y2=o;var s=r&&r.lineWidth;return s&&(B_(n*2)===B_(i*2)&&(t.x1=t.x2=Ud(n,s,!0)),B_(a*2)===B_(o*2)&&(t.y1=t.y2=Ud(a,s,!0))),t}}function qlt(t,e,r){if(e){var n=e.x,i=e.y,a=e.width,o=e.height;t.x=n,t.y=i,t.width=a,t.height=o;var s=r&&r.lineWidth;return s&&(t.x=Ud(n,s,!0),t.y=Ud(i,s,!0),t.width=Math.max(Ud(n+a,s,!1)-t.x,a===0?0:1),t.height=Math.max(Ud(i+o,s,!1)-t.y,o===0?0:1)),t}}function Ud(t,e,r){if(!e)return t;var n=B_(t*2);return(n+B_(e))%2===0?n/2:(n+(r?1:-1))/2}var cNr=function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0}return t}(),uNr={},nn=function(t){ya(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new cNr},e.prototype.buildPath=function(r,n){var i,a,o,s;if(this.subPixelOptimize){var l=qlt(uNr,n,this.style);i=l.x,a=l.y,o=l.width,s=l.height,l.r=n.r,n=l}else i=n.x,a=n.y,o=n.width,s=n.height;n.r?lNr(r,n):r.rect(i,a,o,s)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(yn);nn.prototype.type="rect";var jlt={fill:"#000"},Xlt=2,Gm={},hNr={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},rW.style)},$n=function(t){ya(e,t);function e(r){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=jlt,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,P=0;P=0&&(R=S[L],R.align==="right");)this._placeToken(R,r,C,y,P,"right",x),k-=R.width,P-=R.width,L--;for(_+=(h-(_-v)-(b-P)-k)/2;E<=L;)R=S[E],this._placeToken(R,r,C,y,_+R.width/2,"center",x),_+=R.width,E++;y+=C}},e.prototype._placeToken=function(r,n,i,a,o,s,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&&ope(u);f&&this._renderBackground(u,n,s==="right"?o-r.width:s==="center"?o-r.width/2:o,d-r.height/2,r.width,r.height);var p=!!u.backgroundColor,g=r.textPadding;g&&(o=ict(o,s,g),d-=r.height/2-g[0]-r.innerHeight/2);var m=this._getOrCreateChild(N_),v=m.createStyle();m.useStyle(v);var y=this._defaultStyle,b=!1,x=0,w=!1,A=nct("fill"in u?u.fill:"fill"in n?n.fill:(b=!0,y.fill)),S=rct("stroke"in u?u.stroke:"stroke"in n?n.stroke:!p&&!l&&(!y.autoStroke||b)?(x=Xlt,w=!0,y.stroke):null),T=u.textShadowBlur>0||n.textShadowBlur>0;v.text=r.text,v.x=o,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=s,v.textBaseline="middle",v.font=r.font||fy,v.opacity=Bh(u.opacity,n.opacity,1),Jlt(v,u),S&&(v.lineWidth=Bh(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(qfe(v,r.contentWidth,r.contentHeight,w?0:null))},e.prototype._renderBackground=function(r,n,i,a,o,s){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(nn),m.useStyle(m.createStyle()),m.style.fill=null;var y=m.shape;y.x=i,y.y=a,y.width=o,y.height=s,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(nl),v.onload=function(){g.dirtyStyle()};var x=v.style;x.image=l.image,x.x=i,x.y=a,x.width=o,x.height=s}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=Bh(r.opacity,n.opacity,1)},e.makeFont=function(r){var n="";return ect(r)&&(n=[r.fontStyle,r.fontWeight,Zlt(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&Nd(n)||r.textFont||r.font},e}(tp),dNr={left:!0,right:1,center:1},fNr={top:1,bottom:1,middle:1},Klt=["fontStyle","fontWeight","fontSize","fontFamily"];function Zlt(t){return typeof t=="string"&&(t.indexOf("px")!==-1||t.indexOf("rem")!==-1||t.indexOf("em")!==-1)?t:isNaN(+t)?Ode+"px":t+"px"}function Jlt(t,e){for(var r=0;r=0,a=!1;if(t instanceof yn){var o=fct(t),s=i&&o.selectFill||o.normalFill,l=i&&o.selectStroke||o.normalStroke;if(z_(s)||z_(l)){n=n||{};var u=n.style||{};u.fill==="inherit"?(a=!0,n=lt({},n),u=lt({},u),u.fill=s):!z_(u.fill)&&z_(s)?(a=!0,n=lt({},n),u=lt({},u),u.fill=kH(s)):!z_(u.stroke)&&z_(l)&&(a||(n=lt({},n),u=lt({},u)),u.stroke=kH(l)),n.style=u}}if(n&&n.z2==null){a||(n=lt({},n));var h=t.z2EmphasisLift;n.z2=t.z2+(h??F_)}return n}function wNr(t,e,r){if(r&&r.z2==null){r=lt({},r);var n=t.z2SelectLift;r.z2=t.z2+(n??mNr)}return r}function ANr(t,e,r){var n=Nr(t.currentStates,e)>=0,i=t.style.opacity,a=n?null:bNr(t,["opacity"],e,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=lt({},r),o=lt({opacity:n?i:a.opacity*.1},o),r.style=o),r}function fpe(t,e){var r=this.states[t];if(this.style){if(t==="emphasis")return xNr(this,t,e,r);if(t==="blur")return ANr(this,t,r);if(t==="select")return wNr(this,t,r)}return r}function wS(t){t.stateProxy=fpe;var e=t.getTextContent(),r=t.getTextGuideLine();e&&(e.stateProxy=fpe),r&&(r.stateProxy=fpe)}function yct(t,e){!Sct(t,e)&&!t.__highByOuter&&Ey(t,pct)}function bct(t,e){!Sct(t,e)&&!t.__highByOuter&&Ey(t,gct)}function _y(t,e){t.__highByOuter|=1<<(e||0),Ey(t,pct)}function Ry(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&Ey(t,gct)}function xct(t){Ey(t,dpe)}function ppe(t){Ey(t,mct)}function wct(t){Ey(t,vNr)}function Act(t){Ey(t,yNr)}function Sct(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function Tct(t){var e=t.getModel(),r=[],n=[];e.eachComponent(function(i,a){var o=lpe(a),s=uct(t,a),l=i==="series";!l&&n.push(s),o.isBlured&&(s.group.traverse(function(u){mct(u)}),l&&r.push(a)),o.isBlured=!1}),fe(n,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(r,!1,e)})}function gpe(t,e,r,n){var i=n.getModel();r=r||"coordinateSystem";function a(u,h){for(var d=0;d0){var s={dataIndex:o,seriesIndex:r.seriesIndex};a!=null&&(s.dataType=a),e.push(s)}})}),e}function Vx(t,e,r){AS(t,!0),Ey(t,wS),ype(t,e,r)}function ENr(t){AS(t,!1)}function Ea(t,e,r,n){n?ENr(t):Vx(t,e,r)}function ype(t,e,r){var n=Cr(t);e!=null?(n.focus=e,n.blurScope=r):n.focus&&(n.focus=null)}var Oct=["emphasis","blur","select"],_Nr={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Ms(t,e,r,n){r=r||"itemStyle";for(var i=0;i1&&(o*=xpe(g),s*=xpe(g));var m=(i===a?-1:1)*xpe((o*o*(s*s)-o*o*(p*p)-s*s*(f*f))/(o*o*(p*p)+s*s*(f*f)))||0,v=m*o*p/s,y=m*-s*f/o,b=(t+r)/2+vW(d)*v-mW(d)*y,x=(e+n)/2+mW(d)*v+vW(d)*y,w=Dct([1,0],[(f-v)/o,(p-y)/s]),A=[(f-v)/o,(p-y)/s],S=[(-1*f-v)/o,(-1*p-y)/s],T=Dct(A,S);if(wpe(A,S)<=-1&&(T=y8),wpe(A,S)>=1&&(T=0),T<0){var C=Math.round(T/y8*1e6)/1e6;T=y8*2+C%2*y8}h.addData(u,b,x,o,s,w,T,d,a)}var PNr=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,NNr=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function BNr(t){var e=new Qm;if(!t)return e;var r=0,n=0,i=r,a=n,o,s=Qm.CMD,l=t.match(PNr);if(!l)return e;for(var u=0;uR*R+D*D&&(C=E,k=_),{cx:C,cy:k,x0:-h,y0:-d,x1:C*(i/A-1),y1:k*(i/A-1)}}function GNr(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 HNr(t,e){var r,n=w8(e.r,0),i=w8(e.r0||0,0),a=n>0,o=i>0;if(!(!a&&!o)){if(a||(n=i,i=0),i>n){var s=n;n=i,i=s}var l=e.startAngle,u=e.endAngle;if(!(isNaN(l)||isNaN(u))){var h=e.cx,d=e.cy,f=!!e.clockwise,p=$ct(u-l),g=p>Spe&&p%Spe;if(g>dg&&(p=g),!(n>dg))t.moveTo(h,d);else if(p>Spe-dg)t.moveTo(h+n*V_(l),d+n*SS(l)),t.arc(h,d,n,l,u,!f),i>dg&&(t.moveTo(h+i*V_(u),d+i*SS(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,C=void 0,k=void 0,E=void 0,_=void 0,P=void 0,L=void 0,R=void 0,D=n*V_(l),M=n*SS(l),I=i*V_(u),N=i*SS(u),F=p>dg;if(F){var B=e.cornerRadius;B&&(r=GNr(B),m=r[0],v=r[1],y=r[2],b=r[3]);var V=$ct(n-i)/2;if(x=Ym(V,y),w=Ym(V,b),A=Ym(V,m),S=Ym(V,v),k=T=w8(x,w),E=C=w8(A,S),(T>dg||C>dg)&&(_=n*V_(u),P=n*SS(u),L=i*V_(l),R=i*SS(l),pdg){var X=Ym(y,k),J=Ym(b,k),ee=yW(L,R,D,M,n,X,f),te=yW(_,P,I,N,n,J,f);t.moveTo(h+ee.cx+ee.x0,d+ee.cy+ee.y0),k0&&t.arc(h+ee.cx,d+ee.cy,X,Yc(ee.y0,ee.x0),Yc(ee.y1,ee.x1),!f),t.arc(h,d,n,Yc(ee.cy+ee.y1,ee.cx+ee.x1),Yc(te.cy+te.y1,te.cx+te.x1),!f),J>0&&t.arc(h+te.cx,d+te.cy,J,Yc(te.y1,te.x1),Yc(te.y0,te.x0),!f))}else t.moveTo(h+D,d+M),t.arc(h,d,n,l,u,!f);if(!(i>dg)||!F)t.lineTo(h+I,d+N);else if(E>dg){var X=Ym(m,E),J=Ym(v,E),ee=yW(I,N,_,P,i,-J,f),te=yW(D,M,L,R,i,-X,f);t.lineTo(h+ee.cx+ee.x0,d+ee.cy+ee.y0),E0&&t.arc(h+ee.cx,d+ee.cy,J,Yc(ee.y0,ee.x0),Yc(ee.y1,ee.x1),!f),t.arc(h,d,i,Yc(ee.cy+ee.y1,ee.cx+ee.x1),Yc(te.cy+te.y1,te.cx+te.x1),f),X>0&&t.arc(h+te.cx,d+te.cy,X,Yc(te.y1,te.x1),Yc(te.y0,te.x0),!f))}else t.lineTo(h+I,d+N),t.arc(h,d,i,u,l,f)}t.closePath()}}}var WNr=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}(),fc=function(t){ya(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new WNr},e.prototype.buildPath=function(r,n){HNr(r,n)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(yn);fc.prototype.type="sector";var YNr=function(){function t(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return t}(),Q_=function(t){ya(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new YNr},e.prototype.buildPath=function(r,n){var i=n.cx,a=n.cy,o=Math.PI*2;r.moveTo(i+n.r,a),r.arc(i,a,n.r,0,o,!1),r.moveTo(i+n.r0,a),r.arc(i,a,n.r0,0,o,!0)},e}(yn);Q_.prototype.type="ring";function qNr(t,e,r,n){var i=[],a=[],o=[],s=[],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=qNr(i,n,r,e.smoothConstraint);t.moveTo(i[0][0],i[0][1]);for(var o=i.length,s=0;s<(r?o:o-1);s++){var l=a[s*2],u=a[s*2+1],h=i[(s+1)%o];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 s=1,d=i.length;sOS[1]){if(a=!1,Ml.negativeSize||n)return a;var l=bW(OS[0]-CS[1]),u=bW(CS[0]-OS[1]);Cpe(l,u)>wW.len()&&(l=u||!Ml.bidirectional)&&(wr.scale(xW,s,-u*i),Ml.useDir&&Ml.calcDirMTV()))}}return a},t.prototype._getProjMinMaxOnAxis=function(e,r,n){for(var i=this._axes[e],a=this._origin,o=r[0].dot(i)+a[e],s=o,l=o,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||!!o,setToFinal:!u,scope:t,during:o};s?e.animateFrom(r,g):e.animateTo(r,g)}else e.stopAnimation(),!s&&e.attr(r),o&&o(1),a&&a()}function qn(t,e,r,n,i,a){Ope("update",t,e,r,n,i,a)}function ua(t,e,r,n,i,a){Ope("enter",t,e,r,n,i,a)}function W_(t){if(!t.__zr)return!0;for(var e=0;eao(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function Zct(t){return!t.isGroup}function c8r(t){return t.shape!=null}function C8(t,e,r){if(!t||!e)return;function n(o){var s={};return o.traverse(function(l){Zct(l)&&l.anid&&(s[l.anid]=l)}),s}function i(o){var s={x:o.x,y:o.y,rotation:o.rotation};return c8r(o)&&(s.shape=lr(o.shape)),s}var a=n(t);e.traverse(function(o){if(Zct(o)&&o.anid){var s=a[o.anid];if(s){var l=i(o);o.attr(i(s)),qn(o,l,r,Cr(o).dataIndex)}}})}function Rpe(t,e){return vt(t,function(r){var n=r[0];n=rn(n,e.x),n=Oi(n,e.x+e.width);var i=r[1];return i=rn(i,e.y),i=Oi(i,e.y+e.height),[n,i]})}function Jct(t,e){var r=rn(t.x,e.x),n=Oi(t.x+t.width,e.x+e.width),i=rn(t.y,e.y),a=Oi(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=lt({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 nl(n)):q_(t.replace("path://",""),n,r,"center")}function O8(t,e,r,n,i){for(var a=0,o=i[i.length-1];a1)return!1;var v=Dpe(p,g,h,d)/f;return!(v<0||v>1)}function Dpe(t,e,r,n){return t*n-r*e}function u8r(t){return t<=1e-6&&t>=-1e-6}function ES(t,e,r,n,i){return e==null||(Vn(e)?Na[0]=Na[1]=Na[2]=Na[3]=e:(Na[0]=e[0],Na[1]=e[1],Na[2]=e[2],Na[3]=e[3]),n&&(Na[0]=rn(0,Na[0]),Na[1]=rn(0,Na[1]),Na[2]=rn(0,Na[2]),Na[3]=rn(0,Na[3])),r&&(Na[0]=-Na[0],Na[1]=-Na[1],Na[2]=-Na[2],Na[3]=-Na[3]),tut(t,Na,"x","width",3,1,i&&i[0]||0),tut(t,Na,"y","height",0,2,i&&i[1]||0)),t}var Na=[0,0,0,0];function tut(t,e,r,n,i,a,o){var s=e[a]+e[i],l=t[n];t[n]+=s,o=rn(0,Oi(o,l)),t[n]=0?-e[i]:e[a]>=0?l+e[a]:ao(s)>1e-8?(l-o)*e[i]/s:0):t[r]-=e[i]}function Ly(t){var e=t.itemTooltipOption,r=t.componentModel,n=t.itemName,i=$t(e)?{formatter:e}:e,a=r.mainType,o=r.componentIndex,s={componentType:a,name:n,$vars:["name"]};s[a+"Index"]=o;var l=t.formatterParamsExtra;l&&fe(En(l),function(h){Kt(s,h)||(s[h]=l[h],s.$vars.push(h))});var u=Cr(t.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:n,option:mr({content:n,encodeHTMLContent:!0,formatterParams:s},i)}}function Lpe(t,e){var r;t.isGroup&&(r=e(t)),r||t.traverse(e)}function Gx(t,e){if(t)if(ft(t))for(var r=0;re&&(e=o),oe&&(r=e=0),{min:r,max:e}}function OW(t,e,r){nut(t,e,r,-1/0)}function nut(t,e,r,n){if(t.ignoreModelZ)return n;var i=t.getTextContent(),a=t.getTextGuideLine(),o=t.isGroup;if(o)for(var s=t.childrenRef(),l=0;l=0&&s.push(l)}),s}}function Hx(t,e){return Qr(Qr({},t,!0),e,!0)}const A8r={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:". "}}}},S8r={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 RW="ZH",Upe="EN",J_=Upe,DW={},Vpe={},fut=Dn.domSupported?function(){var t=(document.documentElement.lang||navigator.language||navigator.browserLanguage||J_).toUpperCase();return t.indexOf(RW)>-1?RW:J_}():J_;function Qpe(t,e){t=t.toUpperCase(),Vpe[t]=new bn(e),DW[t]=e}function T8r(t){if($t(t)){var e=DW[t.toUpperCase()]||{};return t===RW||t===Upe?lr(e):Qr(lr(e),lr(DW[J_]),!1)}else return Qr(lr(t),lr(DW[J_]),!1)}function Gpe(t){return Vpe[t]}function C8r(){return Vpe[J_]}Qpe(Upe,A8r),Qpe(RW,S8r);var Hpe=null;function O8r(t){Hpe||(Hpe=t)}function Ho(){return Hpe}function put(t,e){var r=Ho(),n=e.breakOption,i=e.breakParsed;return!i&&r&&(i=r.parseAxisBreakOption(n,t)),i}function LW(t){var e=t.brk;return e?e.breaks:[]}function MW(t){var e=t.brk;return e?e.hasBreaks():!1}var Wpe=1e3,Ype=Wpe*60,_8=Ype*60,ap=_8*24,gut=ap*365,k8r={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})/},IW={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},E8r="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}",PW="{yyyy}-{MM}-{dd}",mut={year:"{yyyy}",month:"{yyyy}-{MM}",day:PW,hour:PW+" "+IW.hour,minute:PW+" "+IW.minute,second:PW+" "+IW.second,millisecond:E8r},Hd=["year","month","day","hour","minute","second","millisecond"],_8r=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function R8r(t){return!$t(t)&&!ur(t)?D8r(t):t}function D8r(t){t=t||{};var e={},r=!0;return fe(Hd,function(n){r&&(r=t[n]==null)}),fe(Hd,function(n,i){var a=t[n];e[n]={};for(var o=null,s=i;s>=0;s--){var l=Hd[s],u=yr(a)&&!ft(a)?a[l]:a,h=void 0;ft(u)?(h=u.slice(),o=h[0]||""):$t(u)?(o=u,h=[o]):(o==null?o=IW[n]:k8r[l].test(o)||(o=e[l][l][0]+" "+o),h=[o],r&&(h[1]="{primary|"+o+"}")),e[n][l]=h}}),e}function Mu(t,e){return t+="","0000".substr(0,e-t.length)+t}function R8(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 L8r(t){return t===R8(t)}function M8r(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function D8(t,e,r,n){var i=Nm(t),a=i[vut(r)](),o=i[qpe(r)]()+1,s=Math.floor((o-1)/3)+1,l=i[jpe(r)](),u=i["get"+(r?"UTC":"")+"Day"](),h=i[Xpe(r)](),d=(h-1)%12+1,f=i[Kpe(r)](),p=i[Zpe(r)](),g=i[Jpe(r)](),m=h>=12?"pm":"am",v=m.toUpperCase(),y=n instanceof bn?n:Gpe(n||fut)||C8r(),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,Mu(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,x[o-1]).replace(/{MMM}/g,w[o-1]).replace(/{MM}/g,Mu(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,Mu(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,A[u]).replace(/{ee}/g,S[u]).replace(/{e}/g,u+"").replace(/{HH}/g,Mu(h,2)).replace(/{H}/g,h+"").replace(/{hh}/g,Mu(d+"",2)).replace(/{h}/g,d+"").replace(/{mm}/g,Mu(f,2)).replace(/{m}/g,f+"").replace(/{ss}/g,Mu(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,Mu(g,3)).replace(/{S}/g,g+"")}function I8r(t,e,r,n,i){var a=null;if($t(r))a=r;else if(ur(r)){var o={time:t.time,level:t.time?t.time.level:0},s=Ho();s&&s.makeAxisLabelFormatterParamBreak(o,t.break),a=r(t.value,e,o)}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=e5(t.value,i);a=r[h][h][0]}}return D8(new Date(t.value),a,i,n)}function e5(t,e){var r=Nm(t),n=r[qpe(e)]()+1,i=r[jpe(e)](),a=r[Xpe(e)](),o=r[Kpe(e)](),s=r[Zpe(e)](),l=r[Jpe(e)](),u=l===0,h=u&&s===0,d=h&&o===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 NW(t,e,r){switch(e){case"year":t[yut(r)](0);case"month":t[but(r)](1);case"day":t[xut(r)](0);case"hour":t[wut(r)](0);case"minute":t[Aut(r)](0);case"second":t[Sut(r)](0)}return t}function vut(t){return t?"getUTCFullYear":"getFullYear"}function qpe(t){return t?"getUTCMonth":"getMonth"}function jpe(t){return t?"getUTCDate":"getDate"}function Xpe(t){return t?"getUTCHours":"getHours"}function Kpe(t){return t?"getUTCMinutes":"getMinutes"}function Zpe(t){return t?"getUTCSeconds":"getSeconds"}function Jpe(t){return t?"getUTCMilliseconds":"getMilliseconds"}function P8r(t){return t?"setUTCFullYear":"setFullYear"}function yut(t){return t?"setUTCMonth":"setMonth"}function but(t){return t?"setUTCDate":"setDate"}function xut(t){return t?"setUTCHours":"setHours"}function wut(t){return t?"setUTCMinutes":"setMinutes"}function Aut(t){return t?"setUTCSeconds":"setSeconds"}function Sut(t){return t?"setUTCMilliseconds":"setMilliseconds"}function N8r(t,e,r,n,i,a,o,s){var l=new $n({style:{text:t,font:e,align:r,verticalAlign:n,padding:i,rich:a,overflow:o?"truncate":null,lineHeight:s}});return l.getBoundingRect()}function ege(t){if(!Ife(t))return $t(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function tge(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 t5=FN;function rge(t,e,r){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(h){return h&&Nd(h)?h:"-"}function a(h){return ep(h)}var o=e==="time",s=t instanceof Date;if(o||s){var l=o?Nm(t):t;if(isNaN(+l)){if(s)return"-"}else return D8(l,n,r)}if(e==="ordinal")return hH(t)?i(t):Vn(t)&&a(t)?t+"":"-";var u=Bm(t);return a(u)?ege(u):hH(t)?i(t):typeof t=="boolean"?t+"":"-"}var Tut=["a","b","c","d","e","f","g"],nge=function(t,e){return"{"+t+(e??"")+"}"};function ige(t,e,r){ft(e)||(e=[e]);var n=e.length;if(!n)return"";for(var i=e[0].$vars||[],a=0;a':'';var o=r.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:i==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:n}:{width:10,height:10,borderRadius:5,backgroundColor:n}}}function B8r(t,e,r){(t==="week"||t==="month"||t==="quarter"||t==="half-year"||t==="year")&&(t=`MM-dd -yyyy`);var n=Nm(e),i=r?"getUTC":"get",a=n[i+"FullYear"](),o=n[i+"Month"]()+1,s=n[i+"Date"](),l=n[i+"Hours"](),u=n[i+"Minutes"](),h=n[i+"Seconds"](),d=n[i+"Milliseconds"]();return t=t.replace("MM",Mu(o,2)).replace("M",o).replace("yyyy",a).replace("yy",Mu(a%100+"",2)).replace("dd",Mu(s,2)).replace("d",s).replace("hh",Mu(l,2)).replace("h",l).replace("mm",Mu(u,2)).replace("m",u).replace("ss",Mu(h,2)).replace("s",h).replace("SSS",Mu(d,3)),t}function $8r(t){return t&&t.charAt(0).toUpperCase()+t.substr(1)}function LS(t,e){return e=e||"transparent",$t(t)?t:yr(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}function BW(t,e){if(e==="_blank"||e==="blank"){var r=window.open();r.opener=null,r.location.href=t}else window.open(t,e)}var $W={},age={},r5=function(){function t(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return t.prototype.create=function(e,r){this._nonSeriesBoxMasterList=n($W),this._normalMasterList=n(age);function n(i,a){var o=[];return fe(i,function(s,l){var u=s.create(e,r);o=o.concat(u||[])}),o}},t.prototype.update=function(e,r){fe(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"){$W[e]=r;return}age[e]=r},t.get=function(e){return age[e]||$W[e]},t}();function F8r(t){return!!$W[t]}var z8r=1,kut=2;function U8r(t){Eut.set(t.fullType,{getCoord2:void 0}).getCoord2=t.getCoord2}var Eut=qt();function _ut(t){var e=t.getShallow("coord",!0),r=z8r;if(e==null){var n=Eut.get(t.type);n&&n.getCoord2&&(r=kut,e=n.getCoord2(t))}return{coord:e,from:r}}var n5=0,FW=1,Rut=2;function Dut(t,e){var r=t.getShallow("coordinateSystem"),n=t.getShallow("coordinateSystemUsage",!0),i=n5;if(r){var a=t.mainType==="series";n==null&&(n=a?"data":"box"),n==="data"?(i=FW,a||(i=n5)):n==="box"&&(i=Rut,!a&&!F8r(r)&&(i=n5))}return{coordSysType:r,kind:i}}function L8(t){var e=t.targetModel,r=t.coordSysType,n=t.coordSysProvider,i=t.isDefaultDataCoordSys;t.allowNotFound;var a=Dut(e),o=a.kind,s=a.coordSysType;if(i&&o!==FW&&(o=FW,s=r),o===n5||s!==r)return n5;var l=n(r,e);return l?(o===FW?e.coordinateSystem=l:e.boxCoordinateSystem=l,o):n5}var Lut=function(t,e){var r=e.getReferringComponents(t,xo).models[0];return r&&r.coordinateSystem},zW=fe,Mut=["left","right","top","bottom","width","height"],MS=[["width","left","right"],["height","top","bottom"]];function oge(t,e,r,n,i){var a=0,o=0;n==null&&(n=1/0),i==null&&(i=1/0);var s=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,o+=s+r,s=h.height):s=Math.max(s,h.height)}else{var v=h.height+(f?-f.y+h.y:0);g=o+v,g>i||l.newline?(a+=s+r,o=0,g=v,s=h.width):s=Math.max(s,h.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),t==="horizontal"?a=p+r:o=g+r)})}var IS=oge;Kr(oge,"vertical"),Kr(oge,"horizontal");function Iut(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 V8r(t,e){var r=Ps(t,e,{enableLayoutOnlyByCenter:!0}),n=t.getBoxLayoutParams(),i,a;if(r.type===M8.point)a=r.refPoint,i=ba(n,{width:e.getWidth(),height:e.getHeight()});else{var o=t.get("center"),s=ft(o)?o:[o,o];i=ba(n,r.refContainer),a=r.boxCoordFrom===kut?r.refPoint:[Qt(s[0],i.width)+i.x,Qt(s[1],i.height)+i.y]}return{viewRect:i,center:a}}function Put(t,e){var r=V8r(t,e),n=r.viewRect,i=r.center,a=t.get("radius");ft(a)||(a=[0,a]);var o=Qt(n.width,e.getWidth()),s=Qt(n.height,e.getHeight()),l=Math.min(o,s),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 ba(t,e,r){r=t5(r||0);var n=e.width,i=e.height,a=Qt(t.left,n),o=Qt(t.top,i),s=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-s-f-a),isNaN(h)&&(h=i-l-d-o),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-s-u-f),isNaN(o)&&(o=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":o=i/2-h/2-r[0];break;case"bottom":o=i-h-d;break}a=a||0,o=o||0,isNaN(u)&&(u=n-f-a-(s||0)),isNaN(h)&&(h=i-d-o-(l||0));var g=new pr((e.x||0)+a+r[3],(e.y||0)+o+r[0],u,h);return g.margin=r,g}function Nut(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),o=t.getShallow("preserveAspectVerticalAlign",!0),s={width:e.width,height:e.height},l=n==="cover";return i>r&&!l||i=m)return d;for(var v=0;v=0;l--)s=Qr(s,i[l],!0);n.defaultOption=s}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 Iut(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}(bn);Rlt(pn,bn),eW(pn),x8r(pn),w8r(pn,H8r);function H8r(t){var e=[];return fe(pn.getClassesByMainType(t),function(r){e=e.concat(r.dependencies||r.prototype.dependencies||[])}),e=vt(e,function(r){return Fm(r).main}),t!=="dataset"&&Nr(e,"dataset")<=0&&e.unshift("dataset"),e}var tt={color:{},darkColor:{},size:{}},Wo=tt.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)"};lt(Wo,{primary:Wo.neutral80,secondary:Wo.neutral70,tertiary:Wo.neutral60,quaternary:Wo.neutral50,disabled:Wo.neutral20,border:Wo.neutral30,borderTint:Wo.neutral20,borderShade:Wo.neutral40,background:Wo.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:Wo.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:Wo.neutral70,axisLineTint:Wo.neutral40,axisTick:Wo.neutral70,axisTickMinor:Wo.neutral60,axisLabel:Wo.neutral70,axisSplitLine:Wo.neutral15,axisMinorSplitLine:Wo.neutral05});for(var NS in Wo)if(Wo.hasOwnProperty(NS)){var $ut=Wo[NS];NS==="theme"?tt.darkColor.theme=Wo.theme.slice():NS==="highlight"?tt.darkColor.highlight="rgba(255,231,130,0.4)":NS.indexOf("accent")===0?tt.darkColor[NS]=Ay($ut,null,function(t){return t*.5},function(t){return Math.min(1,1.3-t)}):tt.darkColor[NS]=Ay($ut,null,function(t){return t*.9},function(t){return 1-Math.pow(t,1.5)})}tt.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};var Fut="";typeof navigator<"u"&&(Fut=navigator.platform||"");var i5="rgba(0, 0, 0, 0.2)",zut=tt.color.theme[0],W8r=Ay(zut,null,null,.9);const Uut={darkMode:"auto",colorBy:"series",color:tt.color.theme,gradientColor:[W8r,zut],aria:{decal:{decals:[{color:i5,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:i5,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:i5,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:i5,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:i5,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:i5,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Fut.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 gc={Must:1,Might:2,Not:3},Vut=Gr();function Y8r(t){Vut(t).datasetMap=qt()}function Qut(t,e,r){var n={},i=lge(e);if(!i||!t)return n;var a=[],o=[],s=e.ecModel,l=Vut(s).datasetMap,u=i.uid+"_"+r.seriesLayoutBy,h,d;t=t.slice(),fe(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});fe(t,function(m,v){var y=m.name,b=g(m);if(h==null){var x=f.valueWayDim;p(n[y],x,b),p(o,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(o,x,b),f.categoryWayDim+=b}});function p(m,v,y){for(var b=0;be)return t[n];return t[r-1]}function Yut(t,e,r,n,i,a,o){a=a||t;var s=e(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(i))return u[i];var h=o==null||!n?r:Z8r(n,o);if(h=h||r,!(!h||!h.length)){var d=h[l];return i&&(u[i]=d),s.paletteIdx=(l+1)%h.length,d}}function J8r(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}var VW,P8,qut,jut="\0_ec_inner",eBr=1,dge=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(r,n,i,a,o,s){a=a||{},this.option=null,this._theme=new bn(a),this._locale=new bn(o),this._optionManager=s},e.prototype.setOption=function(r,n,i){var a=Zut(n);this._optionManager.setOption(r,i,a),this._resetOption(null,a)},e.prototype.resetOption=function(r,n){return this._resetOption(r,Zut(n))},e.prototype._resetOption=function(r,n){var i=!1,a=this._optionManager;if(!r||r==="recreate"){var o=a.mountOption(r==="recreate");!this.option||r==="recreate"?qut(this,o):(this.restoreData(),this._mergeOption(o,n)),i=!0}if((r==="timeline"||r==="media")&&this.restoreData(),!r||r==="recreate"||r==="timeline"){var s=a.getTimelineOption(this);s&&(i=!0,this._mergeOption(s,n))}if(!r||r==="recreate"||r==="media"){var l=a.getMediaOption(this);l.length&&fe(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,o=this._componentsCount,s=[],l=qt(),u=n&&n.replaceMergeMainTypeMap;Y8r(this),fe(r,function(d,f){d!=null&&(pn.hasClass(f)?f&&(s.push(f),l.set(f,!0)):i[f]=i[f]==null?lr(d):Qr(i[f],d,!0))}),u&&u.each(function(d,f){pn.hasClass(f)&&!l.get(f)&&(s.push(f),l.set(f,!0))}),pn.topologicalTravel(s,pn.getAllClassMainTypes(),h,this);function h(d){var f=X8r(this,d,qi(r[d])),p=a.get(d),g=p?u&&u.get(d)?"replaceMerge":"normalMerge":"replaceAll",m=Alt(p,f,g);l6r(m,d,pn),i[d]=null,a.set(d,null),o.set(d,0);var v=[],y=[],b=0,x;fe(m,function(w,A){var S=w.existing,T=w.newOption;if(!T)S&&(S.mergeOption({},this),S.optionUpdated({},!1));else{var C=d==="series",k=pn.getClass(d,w.keyInfo.subType,!C);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=lt({componentIndex:A},w.keyInfo);S=new k(T,this,this,E),lt(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),o.set(d,b),d==="series"&&VW(this)}this._seriesIndices||VW(this)},e.prototype.getOption=function(){var r=lr(this.option);return fe(r,function(n,i){if(pn.hasClass(i)){for(var a=qi(n),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!h8(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,r[i]=a}}),delete r[jut],r},e.prototype.setTheme=function(r){this._theme=new bn(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 o=0;o=e:r==="max"?t<=e:t===e}function lBr(t,e){return t.join(",")===e.join(",")}var pg=fe,N8=yr,Jut=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function fge(t){var e=t&&t.itemStyle;if(e)for(var r=0,n=Jut.length;r0?r[o-1].seriesModel:null)}),yBr(r)}})}function yBr(t){fe(t,function(e,r){var n=[],i=[NaN,NaN],a=[e.stackResultDimension,e.stackedOverDimension],o=e.data,s=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";o.modify(a,function(u,h,d){var f=o.get(e.stackedDimension,d);if(isNaN(f))return i;var p,g;s?g=o.getRawIndex(d):p=o.get(e.stackedByDimension,d);for(var m=NaN,v=r-1;v>=0;v--){var y=t[v];if(s||(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=aS(f,b),m=b;break}}}return n[0]=f,n[1]=m,n})})}var QW=function(){function t(e){this.data=e.data||(e.sourceFormat===ug?{}:[]),this.sourceFormat=e.sourceFormat||sct,this.seriesLayoutBy=e.seriesLayoutBy||hg,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};uht=(e={},e[Dl+"_"+hg]={pure:!0,appendData:a},e[Dl+"_"+bS]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[Qd]={pure:!0,appendData:a},e[ug]={pure:!0,appendData:function(o){var s=this._data;fe(o,function(l,u){for(var h=s[u]||(s[u]=[]),d=0;d<(l||[]).length;d++)h.push(l[d])})}},e[Vd]={appendData:a},e[Ux]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},e);function a(o){for(var s=0;s=0&&(m=o.interpolatedValue[v])}return m!=null?m+"":""})}},t.prototype.getRawValue=function(e,r){return a5(this.getData(r),e)},t.prototype.formatTooltip=function(e,r,n){},t}();function yht(t){var e,r;return yr(t)?t.type&&(r=t):e=t,{text:e,frag:r}}function F8(t){return new OBr(t)}var OBr=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 o=h(this._modBy),s=this._modDataCount||0,l=h(e&&e.modBy),u=e&&e.modDataCount||0;(o!==l||s!==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?s:o}};return a;function o(){return e=t?null:le},gte:function(t,e){return t>=e}},EBr=function(){function t(e,r){if(!Vn(r)){var n="";si(n)}this._opFn=wht[e],this._rvalFloat=Bm(r)}return t.prototype.evaluate=function(e){return Vn(e)?this._opFn(e,this._rvalFloat):this._opFn(Bm(e),this._rvalFloat)},t}(),Aht=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=Vn(e)?e:Bm(e),i=Vn(r)?r:Bm(r),a=isNaN(n),o=isNaN(i);if(a&&(n=this._incomparable),o&&(i=this._incomparable),a&&o){var s=$t(e),l=$t(r);s&&(n=l?e:0),l&&(i=s?r:0)}return ni?-this._resultLT:0},t}(),_Br=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 RBr(t,e){return t==="eq"||t==="ne"?new _Br(t==="eq",e):Kt(wht,t)?new EBr(t,e):null}function Sht(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 Tht(t,e){return e>t.g&&e>=t.ge&&e65535?zBr:UBr}function VBr(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function _ht(t,e,r,n,i){var a=Eht[r||"float"];if(i){var o=t[e],s=o&&o.length;if(s!==n){for(var l=new a(n),u=0;uv[1]&&(v[1]=m)}return this._rawCount=this._count=l,{start:s,end:l}},t.prototype._initDataFromProvider=function(e,r,n){for(var i=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=vt(o,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=o-1;else return o}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])&&(C=!1)}C&&(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],o=this.count(),s=0,l=Math.floor(1/r),u=this.getRawIndex(0),h,d,f,p=new(o5(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));p[s++]=u;for(var g=1;gh&&(h=d,f=w)}_>0&&_s&&(m=s-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,s.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,o=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 Wx(r[a],this._dimensions[a])}wge={arrayRows:e,objectRows:function(r,n,i,a){return Wx(r[n],this._dimensions[a])},keyedColumns:e,original:function(r,n,i,a){var o=r&&(r.value==null?r:r.value);return Wx(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(r,n,i,a){return r[a]}}}(),t}(),Rht=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(WW(e)){var o=e,s=void 0,l=void 0,u=void 0;if(n){var h=r[0];h.prepareSource(),u=h.getSource(),s=u.data,l=u.sourceFormat,a=[h._getVersionSign()]}else s=o.get("data",!0),l=Ru(s)?Ux:Vd,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?[mge(s,{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=[mge(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&&Lht(a)}var o,s=[],l=[];return fe(e,function(u){u.prepareSource();var h=u.getSource(i||0),d="";i!=null&&!h&&Lht(d),s.push(h),l.push(u._getVersionSign())}),n?o=$Br(n,s,{datasetIndex:r.componentIndex}):i!=null&&(o=[bBr(s[0])]),{sourceList:o,upstreamSignList:l}},t.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),r=0;r0&&(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 o;if(t>=a)return s}else{if(t>=i)return o;if(t<=a)return s}else{if(t===i)return o;if(t===a)return s}return(t-i)/l*u+o}var Qt=YPr;function YPr(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 qH(t,e,r)}function qH(t,e,r){return $t(t)?flt(t)?parseFloat(t)/100*e+(r||0):parseFloat(t):t==null?NaN:+t}function qPr(t){return $t(t)&&flt(t)}function flt(t){return!!HPr(t).match(/%$/)}function Yn(t,e,r){return isNaN(e)?r?""+t:+t:(e=Oi(rn(0,e),WH),t=(+t).toFixed(e),r?t:+t)}function jPr(t,e,r){return e==null&&(e=10),Yn(t,e,r)}function Rl(t){return t.sort(function(e,r){return e-r}),t}function Pm(t){if(t=+t,isNaN(t))return 0;if(t>1e-14){for(var e=1,r=0;r<15;r++,e*=10)if(Im(t*e)/e===t)return r}return plt(t)}function plt(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("."),o=a<0?0:i-1-a;return rn(0,o-n)}function XPr(t,e){var r=Jf(iS(t[1]-t[0])/l8),n=Im(iS(ao(e[1]-e[0]))/l8),i=Oi(rn(-r+n,0),WH);return isFinite(i)?i:WH}function Rfe(t,e,r){var n=ao(t[1]-t[0]);if(!isFinite(n)||n===0)return NaN;var i=iS(2*ao(r||1)*ao(n))/l8,a=iS(ao(e))/l8,o=rn(0,rS(-i+a));return isFinite(o)||(o=NaN),o}function KPr(t,e,r){if(!t[e])return 0;var n=glt(t,r);return n[e]||0}function glt(t,e){var r=Yf(t,function(p,g){return p+(isNaN(g)?0:g)},0);if(r===0)return[];for(var n=nS(10,e),i=vt(t,function(p){return(isNaN(p)?0:p)/r*n*100}),a=n*100,o=vt(i,function(p){return Jf(p)}),s=Yf(o,function(p,g){return p+g},0),l=vt(i,function(p,g){return p-o[g]});su&&(u=l[d],h=d);++o[h],l[h]=0,++s}return vt(o,function(p){return p/n})}function aS(t,e){var r=rn(Pm(t),Pm(e)),n=t+e;return r>WH?n:Yn(n,r)}var c8=nS(2,53)-1;function Dfe(t){var e=YH*2;return(t%e+e)%e}function oS(t){return t>-dlt&&t=10&&e++,e}var mlt=2;function XH(t,e){var r=jH(t),n=nS(10,r),i=t/n,a;return e===mlt?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,Yn(t,-r)}function KH(t,e){var r=(t.length-1)*e+1,n=Jf(r),i=+t[n-1],a=r-n;return a?i+a*(t[n]-i):i}function Mfe(t){t.sort(function(l,u){return s(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 zfe(t){t.option=t.parentModel=t.ecModel=null}function dc(){return[1/0,-1/0]}function Ufe(t,e){Cy(e)&&(et[1]&&(t[1]=e))}function Elt(t,e){Cy(e)&&et[1]&&(t[1]=e)}function v6r(t,e){cS(e[0],e[1])&&(e[0]t[1]&&(t[1]=e[1]))}function Cy(t){return t!=null&&isFinite(t)}function cS(t,e){return Cy(t)&&Cy(e)&&t<=e}function y6r(t){var e=t[1]-t[0];return isFinite(e)&&e>=0}function ZH(t){cS(t[0],t[1])&&t[0]>t[1]&&(t[0]=t[1])}function P_(){var t="__ec_once_"+b6r++;return function(e,r){Kt(e,t)||(e[t]=1,r())}}var b6r=Pfe();function JH(t,e,r){var n=qt(),i=0;fe(t,function(a){var o=e(a),s=n.get(o)||0;r&&r(a,s),!s&&!r&&(t[i++]=a),n.set(o,s+1)}),r||(t.length=i)}function x6r(t){return t.value+""}function w6r(t){return t+""}function $m(t,e){return Jt(e,!0)?t.seriesIndex+2:0}function Rlt(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 Ls(t,e){return{seriesType:t,overallReset:e}}function d8(t){return{overallReset:t}}var A6r=".",uS="___EC__COMPONENT__CONTAINER___",Dlt="___EC__EXTENDED_CLASS___";function Fm(t){var e={main:"",sub:""};if(t){var r=t.split(A6r);e.main=r[0]||"",e.sub=r[1]||""}return e}function S6r(t){uc(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}function T6r(t){return!!(t&&t[Dlt])}function Vfe(t,e){t.$constructor=t,t.extend=function(r){var n=this,i;return C6r(n)?i=function(a){nt(o,a);function o(){return a.apply(this,arguments)||this}return o}(n):(i=function(){(r.$constructor||n).apply(this,arguments)},Dde(i,this)),lt(i.prototype,r),i[Dlt]=!0,i.extend=this.extend,i.superCall=E6r,i.superApply=_6r,i.superClass=n,i}}function C6r(t){return ur(t)&&/^class\s/.test(Function.prototype.toString.call(t))}function Llt(t,e){t.extend=e.extend}var O6r=Math.round(Math.random()*10);function k6r(t){var e=["__\0is_clz",O6r++].join("_");t.prototype[e]=!0,t.isInstance=function(r){return!!(r&&r[e])}}function E6r(t,e){for(var r=[],n=2;n=0||a&&Nr(a,l)<0)){var u=n.getShallow(l,e);u!=null&&(o[t[s][0]]=u)}}return o}}var R6r=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],D6r=hS(R6r),L6r=function(){function t(){}return t.prototype.getAreaStyle=function(e,r){return D6r(this,e,r)},t}(),Qfe=new C_(50);function M6r(t){if(typeof t=="string"){var e=Qfe.get(t);return e&&e.image}else return t}function Gfe(t,e,r,n,i){if(t)if(typeof t=="string"){if(e&&e.__zrImageSrc===t||!r)return e;var a=Qfe.get(t),o={hostEl:r,cb:n,cbPayload:i};return a?(e=a.image,!tW(e)&&a.pending.push(o)):(e=tl.loadImage(t,Mlt,Mlt),e.__zrImageSrc=t,Qfe.put(t,e.__cachedImgObj={image:e,pending:[o]})),e}else return t;else return e}function Mlt(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=s;u++)l-=s;var h=Lm(o,r);return h>l&&(r="",h=0),l=t-h,i.ellipsis=r,i.ellipsisWidth=h,i.contentWidth=l,i.containerWidth=t,i}function Nlt(t,e,r){var n=r.containerWidth,i=r.contentWidth,a=r.fontMeasureInfo;if(!n){t.textLine="",t.isTruncated=!1;return}var o=Lm(a,e);if(o<=n){t.textLine=e,t.isTruncated=!1;return}for(var s=0;;s++){if(o<=i||s>=r.maxIterations){e+=r.ellipsis;break}var l=s===0?P6r(e,i,a):o>0?Math.floor(e.length*i/o):0;e=e.substr(0,l),o=Lm(a,e)}e===""&&(e=r.placeholder),t.textLine=e,t.isTruncated=!0}function P6r(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=Plt(m,u,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),A={},S=0;Sg&&Wfe(a,o.substring(g,v),e,p),Wfe(a,m[2],e,p,m[1]),g=Hfe.lastIndex}gd){var F=a.lines.length;P>0?(k.tokens=k.tokens.slice(0,P),T(k,_,E),a.lines=a.lines.slice(0,C+1)):a.lines=a.lines.slice(0,C),a.isTruncated=a.isTruncated||a.lines.length0&&g+n.accumWidth>n.width&&(h=e.split(` +`),u=!0),n.accumWidth=g}else{var m=$lt(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=Dm(l),y=0;y=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var U6r=Yf(",&?/;] ".split(""),function(t,e){return t[e]=!0,t},{});function V6r(t){return z6r(t)?!!U6r[t]:!0}function $lt(t,e,r,n,i){for(var a=[],o=[],s="",l="",u=0,h=0,d=Dm(e),f=0;fr:i+h+g>r){h?(s||l)&&(m?(s||(s=l,l="",u=0,h=u),a.push(s),o.push(h-u),l+=p,u+=g,s="",h=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(h),s=p,h=g)):m?(a.push(l),o.push(u),l=p,u=g):(a.push(p),o.push(g));continue}h+=g,m?(l+=p,u+=g):(l&&(s+=l,l="",u=0),s+=p)}return l&&(s+=l),s&&(a.push(s),o.push(h)),a.length===1&&(h+=i),{accumWidth:h,lines:a,linesWidths:o}}function Flt(t,e,r,n,i,a){if(t.baseX=r,t.baseY=n,t.outerWidth=t.outerHeight=null,!!e){var o=e.width*2,s=e.height*2;pr.set(zlt,R_(r,o,i),eS(n,s,a),o,s),pr.intersect(e,zlt,null,Ult);var l=Ult.outIntersectRect;t.outerWidth=l.width,t.outerHeight=l.height,t.baseX=R_(l.x,l.width,i,!0),t.baseY=eS(l.y,l.height,a,!0)}}var zlt=new pr(0,0,0,0),Ult={outIntersectRect:{},clamp:!0};function Yfe(t){return t!=null?t+="":t=""}function Q6r(t){var e=Yfe(t.text),r=t.font,n=Lm(Dm(r),e),i=s8(r);return qfe(t,n,i,null)}function qfe(t,e,r,n){var i=new pr(R_(t.x||0,e,t.textAlign),eS(t.y||0,r,t.textBaseline),e,r),a=n??(Vlt(t)?t.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function Vlt(t){var e=t.stroke;return e!=null&&e!=="none"&&t.lineWidth>0}var jfe="__zr_style_"+Math.round(Math.random()*10),dS={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},rW={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};dS[jfe]=!0;var Qlt=["z","z2","invisible"],G6r=["invisible"],tp=function(t){ya(e,t);function e(r){return t.call(this,r)||this}return e.prototype._init=function(r){for(var n=En(r),i=0;i1e-4){s[0]=t-r,s[1]=e-n,l[0]=t+r,l[1]=e+n;return}if(nW[0]=Jfe(i)*r+t,nW[1]=Zfe(i)*n+e,iW[0]=Jfe(a)*r+t,iW[1]=Zfe(a)*n+e,u(s,nW,iW),h(l,nW,iW),i=i%fS,i<0&&(i=i+fS),a=a%fS,a<0&&(a=a+fS),i>a&&!o?a+=fS:ii&&(aW[0]=Jfe(p)*r+t,aW[1]=Zfe(p)*n+e,u(s,aW,s),h(l,aW,l))}var ra={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},pS=[],gS=[],zm=[],Bx=[],Um=[],Vm=[],epe=Math.min,tpe=Math.max,mS=Math.cos,vS=Math.sin,Oy=Math.abs,rpe=Math.PI,$x=rpe*2,npe=typeof Float32Array<"u",f8=[];function ipe(t){var e=Math.round(t/rpe*1e8)/1e8;return e%2*rpe}function sW(t,e){var r=ipe(t[0]);r<0&&(r+=$x);var n=r-t[0],i=t[1];i+=n,!e&&i-r>=$x?i=r+$x:e&&r-i>=$x?i=r-$x:!e&&r>i?i=r+($x-ipe(r-i)):e&&r0&&(this._ux=Oy(n/BH/e)||0,this._uy=Oy(n/BH/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(ra.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=Oy(e-this._xi),i=Oy(r-this._yi),a=n>this._ux||i>this._uy;if(this.addData(ra.L,e,r),this._ctx&&a&&this._ctx.lineTo(e,r),a)this._xi=e,this._yi=r,this._pendingPtDist=0;else{var o=n*n+i*i;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=r,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(e,r,n,i,a,o){return this._drawPendingPt(),this.addData(ra.C,e,r,n,i,a,o),this._ctx&&this._ctx.bezierCurveTo(e,r,n,i,a,o),this._xi=a,this._yi=o,this},t.prototype.quadraticCurveTo=function(e,r,n,i){return this._drawPendingPt(),this.addData(ra.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,o){this._drawPendingPt(),f8[0]=i,f8[1]=a,sW(f8,o),i=f8[0],a=f8[1];var s=a-i;return this.addData(ra.A,e,r,n,n,i,s,0,o?0:1),this._ctx&&this._ctx.arc(e,r,n,i,a,o),this._xi=mS(a)*n+e,this._yi=vS(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(ra.R,e,r,n,i),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(ra.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)&&npe&&(this.data=new Float32Array(r));for(var n=0;n0&&o))for(var s=0;sh.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(){zm[0]=zm[1]=Um[0]=Um[1]=Number.MAX_VALUE,Bx[0]=Bx[1]=Vm[0]=Vm[1]=-Number.MAX_VALUE;var e=this.data,r=0,n=0,i=0,a=0,o;for(o=0;on||Oy(x)>i||f===r-1)&&(m=Math.sqrt(b*b+x*x),a=v,o=y);break}case ra.C:{var w=e[f++],A=e[f++],v=e[f++],y=e[f++],S=e[f++],T=e[f++];m=jIr(a,o,w,A,v,y,S,T,10),a=S,o=T;break}case ra.Q:{var w=e[f++],A=e[f++],v=e[f++],y=e[f++];m=KIr(a,o,w,A,v,y,10),a=v,o=y;break}case ra.A:var C=e[f++],k=e[f++],E=e[f++],_=e[f++],P=e[f++],L=e[f++],R=L+P;f+=1,g&&(s=mS(P)*E+C,l=vS(P)*_+k),m=tpe(E,_)*epe($x,Math.abs(L)),a=mS(R)*E+C,o=vS(R)*_+k;break;case ra.R:{s=a=e[f++],l=o=e[f++];var D=e[f++],M=e[f++];m=D*2+M*2;break}case ra.Z:{var b=s-a,x=l-o;m=Math.sqrt(b*b+x*x),a=s,o=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,o=this._len,s,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 ra.M:s=u=n[S++],l=h=n[S++],e.moveTo(u,h);break;case ra.L:{d=n[S++],f=n[S++];var k=Oy(d-u),E=Oy(f-h);if(k>i||E>a){if(p){var _=g[y++];if(v+_>b){var P=(b-v)/_;e.lineTo(u*(1-P)+d*P,h*(1-P)+f*P);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 ra.C:{var R=n[S++],D=n[S++],M=n[S++],I=n[S++],N=n[S++],F=n[S++];if(p){var _=g[y++];if(v+_>b){var P=(b-v)/_;Lx(u,R,M,N,P,pS),Lx(h,D,I,F,P,gS),e.bezierCurveTo(pS[1],gS[1],pS[2],gS[2],pS[3],gS[3]);break e}v+=_}e.bezierCurveTo(R,D,M,I,N,F),u=N,h=F;break}case ra.Q:{var R=n[S++],D=n[S++],M=n[S++],I=n[S++];if(p){var _=g[y++];if(v+_>b){var P=(b-v)/_;ZN(u,R,M,P,pS),ZN(h,D,I,P,gS),e.quadraticCurveTo(pS[1],gS[1],pS[2],gS[2]);break e}v+=_}e.quadraticCurveTo(R,D,M,I),u=M,h=I;break}case ra.A:var B=n[S++],V=n[S++],z=n[S++],U=n[S++],Q=n[S++],G=n[S++],q=n[S++],Y=!n[S++],ne=z>U?z:U,X=Oy(z-U)>.001,J=Q+G,ee=!1;if(p){var _=g[y++];v+_>b&&(J=Q+G*(b-v)/_,ee=!0),v+=_}if(X&&e.ellipse?e.ellipse(B,V,z,U,q,Q,J,Y):e.arc(B,V,ne,Q,J,Y),ee)break e;C&&(s=mS(Q)*z+B,l=vS(Q)*U+V),u=mS(J)*z+B,h=vS(J)*U+V;break;case ra.R:s=u=n[S],l=h=n[S+1],d=n[S++],f=n[S++];var te=n[S++],pe=n[S++];if(p){var _=g[y++];if(v+_>b){var ie=b-v;e.moveTo(d,f),e.lineTo(d+epe(ie,te),f),ie-=te,ie>0&&e.lineTo(d+te,f+epe(ie,pe)),ie-=pe,ie>0&&e.lineTo(d+tpe(te-ie,0),f+pe),ie-=te,ie>0&&e.lineTo(d,f+tpe(pe-ie,0));break e}v+=_}e.rect(d,f,te,pe);break;case ra.Z:if(p){var _=g[y++];if(v+_>b){var P=(b-v)/_;e.lineTo(u*(1-P)+s*P,h*(1-P)+l*P);break e}v+=_}e.closePath(),u=s,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=ra,t.initDefaultProps=function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),t}();function Fx(t,e,r,n,i,a,o){if(i===0)return!1;var s=i,l=0,u=t;if(o>e+s&&o>n+s||ot+s&&a>r+s||ae+d&&h>n+d&&h>a+d&&h>s+d||ht+d&&u>r+d&&u>i+d&&u>o+d||ue+u&&l>n+u&&l>a+u||lt+u&&s>r+u&&s>i+u||sr||h+ui&&(i+=p8);var f=Math.atan2(l,s);return f<0&&(f+=p8),f>=n&&f<=i||f+p8>=n&&f+p8<=i}function ky(t,e,r,n,i,a){if(a>e&&a>n||ai?s:0}var zx=Qm.CMD,yS=Math.PI*2,K6r=1e-4;function Z6r(t,e){return Math.abs(t-e)e&&u>n&&u>a&&u>s||u1&&J6r(),p=rl(e,n,a,s,rp[0]),f>1&&(g=rl(e,n,a,s,rp[1]))),f===2?ve&&s>n&&s>a||s=0&&u<=1){for(var h=0,d=_l(e,n,a,u),f=0;fr||s<-r)return 0;var l=Math.sqrt(r*r-s*s);Du[0]=-l,Du[1]=l;var u=Math.abs(n-i);if(u<1e-4)return 0;if(u>=yS-1e-4){n=0,i=yS;var h=a?1:-1;return o>=Du[0]+t&&o<=Du[1]+t?h:0}if(n>i){var d=n;n=i,i=d}n<0&&(n+=yS,i+=yS);for(var f=0,p=0;p<2;p++){var g=Du[p];if(g+t>o){var m=Math.atan2(s,g),h=a?1:-1;m<0&&(m=yS+m),(m>=n&&m<=i||m+yS>=n&&m+yS<=i)&&(m>Math.PI/2&&m1&&(r||(s+=ky(l,u,h,d,n,i))),v&&(l=a[g],u=a[g+1],h=l,d=u),m){case zx.M:h=a[g++],d=a[g++],l=h,u=d;break;case zx.L:if(r){if(Fx(l,u,a[g],a[g+1],e,n,i))return!0}else s+=ky(l,u,a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case zx.C:if(r){if(j6r(l,u,a[g++],a[g++],a[g++],a[g++],a[g],a[g+1],e,n,i))return!0}else s+=eNr(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 zx.Q:if(r){if(Ylt(l,u,a[g++],a[g++],a[g],a[g+1],e,n,i))return!0}else s+=tNr(l,u,a[g++],a[g++],a[g],a[g+1],n,i)||0;l=a[g++],u=a[g++];break;case zx.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):s+=ky(l,u,f,p,n,i);var C=(n-y)*w/x+y;if(r){if(X6r(y,b,w,A,A+S,T,e,C,i))return!0}else s+=rNr(y,b,w,A,A+S,T,C,i);l=Math.cos(A+S)*x+y,u=Math.sin(A+S)*w+b;break;case zx.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(Fx(h,d,f,d,e,n,i)||Fx(f,d,f,p,e,n,i)||Fx(f,p,h,p,e,n,i)||Fx(h,p,h,d,e,n,i))return!0}else s+=ky(f,d,f,p,n,i),s+=ky(h,p,h,d,n,i);break;case zx.Z:if(r){if(Fx(l,u,h,d,e,n,i))return!0}else s+=ky(l,u,h,d,n,i);l=h,u=d;break}}return!r&&!Z6r(u,d)&&(s+=ky(l,u,h,d,n,i)||0),s!==0}function nNr(t,e,r){return jlt(t,0,!1,e,r)}function iNr(t,e,r,n){return jlt(t,e,!0,r,n)}var lW=mr({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},dS),aNr={style:mr({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},rW.style)},ape=Ty.concat(["invisible","culling","z","z2","zlevel","parent"]),yn=function(t){ya(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 o in n)a[o]!==n[o]&&(a[o]=n[o]);a.fill=n.fill?n.decal:null,a.decal=null,a.shadowColor=null,n.strokeFirst&&(a.stroke=null);for(var s=0;s.5?bfe:n>.2?EPr:xfe}else if(r)return xfe}return bfe},e.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if($t(n)){var i=this.__zr,a=!!(i&&i.isDarkMode()),o=r8(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 o=this.path;(a||this.__dirty&S_)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),r=o.getBoundingRect()}if(this._rect=r,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=r.clone());if(this.__dirty||i){s.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&&(s.width+=u/l,s.height+=u/l,s.x-=u/l/2,s.y-=u/l/2)}return s}return r},e.prototype.contain=function(r,n){var i=this.transformCoordToLocal(r,n),a=this.getBoundingRect(),o=this.style;if(r=i[0],n=i[1],a.contain(r,n)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),iNr(s,l/u,r,n)))return!0}if(this.hasFill())return nNr(s,r,n)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=S_,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:lt(i,r),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&S_)},e.prototype.createStyle=function(r){return UN(lW,r)},e.prototype._innerSaveToNormal=function(r){t.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.shape&&!n.shape&&(n.shape=lt({},this.shape))},e.prototype._applyStateObj=function(r,n,i,a,o,s){if(t.prototype._applyStateObj.call(this,r,n,i,a,o,s),this.__inHover!==QH){var l=!(n&&a),u;if(n&&n.shape?o?a?u=n.shape:(u=lt({},i.shape),lt(u,n.shape)):(u=lt({},a?this.shape:i.shape),lt(u,n.shape)):l&&(u=i.shape),u)if(o){this.shape=lt({},this.shape);for(var h={},d=En(u),f=0;fi&&(d=s+l,s*=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),s+h>a&&(d=s+h,s*=a/d,h*=a/d),t.moveTo(r+s,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+s),s!==0&&t.arc(r+s,n+s,s,Math.PI,Math.PI*1.5),t.closePath()}var B_=Math.round;function cW(t,e,r){if(e){var n=e.x1,i=e.x2,a=e.y1,o=e.y2;t.x1=n,t.x2=i,t.y1=a,t.y2=o;var s=r&&r.lineWidth;return s&&(B_(n*2)===B_(i*2)&&(t.x1=t.x2=Ud(n,s,!0)),B_(a*2)===B_(o*2)&&(t.y1=t.y2=Ud(a,s,!0))),t}}function Xlt(t,e,r){if(e){var n=e.x,i=e.y,a=e.width,o=e.height;t.x=n,t.y=i,t.width=a,t.height=o;var s=r&&r.lineWidth;return s&&(t.x=Ud(n,s,!0),t.y=Ud(i,s,!0),t.width=Math.max(Ud(n+a,s,!1)-t.x,a===0?0:1),t.height=Math.max(Ud(i+o,s,!1)-t.y,o===0?0:1)),t}}function Ud(t,e,r){if(!e)return t;var n=B_(t*2);return(n+B_(e))%2===0?n/2:(n+(r?1:-1))/2}var hNr=function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0}return t}(),dNr={},nn=function(t){ya(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new hNr},e.prototype.buildPath=function(r,n){var i,a,o,s;if(this.subPixelOptimize){var l=Xlt(dNr,n,this.style);i=l.x,a=l.y,o=l.width,s=l.height,l.r=n.r,n=l}else i=n.x,a=n.y,o=n.width,s=n.height;n.r?uNr(r,n):r.rect(i,a,o,s)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(yn);nn.prototype.type="rect";var Klt={fill:"#000"},Zlt=2,Gm={},fNr={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},rW.style)},$n=function(t){ya(e,t);function e(r){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=Klt,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,P=0;P=0&&(R=S[L],R.align==="right");)this._placeToken(R,r,C,y,P,"right",x),k-=R.width,P-=R.width,L--;for(_+=(h-(_-v)-(b-P)-k)/2;E<=L;)R=S[E],this._placeToken(R,r,C,y,_+R.width/2,"center",x),_+=R.width,E++;y+=C}},e.prototype._placeToken=function(r,n,i,a,o,s,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&&ope(u);f&&this._renderBackground(u,n,s==="right"?o-r.width:s==="center"?o-r.width/2:o,d-r.height/2,r.width,r.height);var p=!!u.backgroundColor,g=r.textPadding;g&&(o=oct(o,s,g),d-=r.height/2-g[0]-r.innerHeight/2);var m=this._getOrCreateChild(N_),v=m.createStyle();m.useStyle(v);var y=this._defaultStyle,b=!1,x=0,w=!1,A=act("fill"in u?u.fill:"fill"in n?n.fill:(b=!0,y.fill)),S=ict("stroke"in u?u.stroke:"stroke"in n?n.stroke:!p&&!l&&(!y.autoStroke||b)?(x=Zlt,w=!0,y.stroke):null),T=u.textShadowBlur>0||n.textShadowBlur>0;v.text=r.text,v.x=o,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=s,v.textBaseline="middle",v.font=r.font||fy,v.opacity=Bh(u.opacity,n.opacity,1),tct(v,u),S&&(v.lineWidth=Bh(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(qfe(v,r.contentWidth,r.contentHeight,w?0:null))},e.prototype._renderBackground=function(r,n,i,a,o,s){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(nn),m.useStyle(m.createStyle()),m.style.fill=null;var y=m.shape;y.x=i,y.y=a,y.width=o,y.height=s,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(nl),v.onload=function(){g.dirtyStyle()};var x=v.style;x.image=l.image,x.x=i,x.y=a,x.width=o,x.height=s}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=Bh(r.opacity,n.opacity,1)},e.makeFont=function(r){var n="";return rct(r)&&(n=[r.fontStyle,r.fontWeight,ect(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&Nd(n)||r.textFont||r.font},e}(tp),pNr={left:!0,right:1,center:1},gNr={top:1,bottom:1,middle:1},Jlt=["fontStyle","fontWeight","fontSize","fontFamily"];function ect(t){return typeof t=="string"&&(t.indexOf("px")!==-1||t.indexOf("rem")!==-1||t.indexOf("em")!==-1)?t:isNaN(+t)?Ode+"px":t+"px"}function tct(t,e){for(var r=0;r=0,a=!1;if(t instanceof yn){var o=gct(t),s=i&&o.selectFill||o.normalFill,l=i&&o.selectStroke||o.normalStroke;if(z_(s)||z_(l)){n=n||{};var u=n.style||{};u.fill==="inherit"?(a=!0,n=lt({},n),u=lt({},u),u.fill=s):!z_(u.fill)&&z_(s)?(a=!0,n=lt({},n),u=lt({},u),u.fill=kH(s)):!z_(u.stroke)&&z_(l)&&(a||(n=lt({},n),u=lt({},u)),u.stroke=kH(l)),n.style=u}}if(n&&n.z2==null){a||(n=lt({},n));var h=t.z2EmphasisLift;n.z2=t.z2+(h??F_)}return n}function SNr(t,e,r){if(r&&r.z2==null){r=lt({},r);var n=t.z2SelectLift;r.z2=t.z2+(n??yNr)}return r}function TNr(t,e,r){var n=Nr(t.currentStates,e)>=0,i=t.style.opacity,a=n?null:wNr(t,["opacity"],e,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=lt({},r),o=lt({opacity:n?i:a.opacity*.1},o),r.style=o),r}function fpe(t,e){var r=this.states[t];if(this.style){if(t==="emphasis")return ANr(this,t,e,r);if(t==="blur")return TNr(this,t,r);if(t==="select")return SNr(this,t,r)}return r}function wS(t){t.stateProxy=fpe;var e=t.getTextContent(),r=t.getTextGuideLine();e&&(e.stateProxy=fpe),r&&(r.stateProxy=fpe)}function xct(t,e){!Cct(t,e)&&!t.__highByOuter&&Ey(t,mct)}function wct(t,e){!Cct(t,e)&&!t.__highByOuter&&Ey(t,vct)}function _y(t,e){t.__highByOuter|=1<<(e||0),Ey(t,mct)}function Ry(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&Ey(t,vct)}function Act(t){Ey(t,dpe)}function ppe(t){Ey(t,yct)}function Sct(t){Ey(t,bNr)}function Tct(t){Ey(t,xNr)}function Cct(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function Oct(t){var e=t.getModel(),r=[],n=[];e.eachComponent(function(i,a){var o=lpe(a),s=dct(t,a),l=i==="series";!l&&n.push(s),o.isBlured&&(s.group.traverse(function(u){yct(u)}),l&&r.push(a)),o.isBlured=!1}),fe(n,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(r,!1,e)})}function gpe(t,e,r,n){var i=n.getModel();r=r||"coordinateSystem";function a(u,h){for(var d=0;d0){var s={dataIndex:o,seriesIndex:r.seriesIndex};a!=null&&(s.dataType=a),e.push(s)}})}),e}function Vx(t,e,r){AS(t,!0),Ey(t,wS),ype(t,e,r)}function RNr(t){AS(t,!1)}function Ea(t,e,r,n){n?RNr(t):Vx(t,e,r)}function ype(t,e,r){var n=Cr(t);e!=null?(n.focus=e,n.blurScope=r):n.focus&&(n.focus=null)}var Ect=["emphasis","blur","select"],DNr={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Ms(t,e,r,n){r=r||"itemStyle";for(var i=0;i1&&(o*=xpe(g),s*=xpe(g));var m=(i===a?-1:1)*xpe((o*o*(s*s)-o*o*(p*p)-s*s*(f*f))/(o*o*(p*p)+s*s*(f*f)))||0,v=m*o*p/s,y=m*-s*f/o,b=(t+r)/2+vW(d)*v-mW(d)*y,x=(e+n)/2+mW(d)*v+vW(d)*y,w=Mct([1,0],[(f-v)/o,(p-y)/s]),A=[(f-v)/o,(p-y)/s],S=[(-1*f-v)/o,(-1*p-y)/s],T=Mct(A,S);if(wpe(A,S)<=-1&&(T=y8),wpe(A,S)>=1&&(T=0),T<0){var C=Math.round(T/y8*1e6)/1e6;T=y8*2+C%2*y8}h.addData(u,b,x,o,s,w,T,d,a)}var BNr=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,$Nr=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function FNr(t){var e=new Qm;if(!t)return e;var r=0,n=0,i=r,a=n,o,s=Qm.CMD,l=t.match(BNr);if(!l)return e;for(var u=0;uR*R+D*D&&(C=E,k=_),{cx:C,cy:k,x0:-h,y0:-d,x1:C*(i/A-1),y1:k*(i/A-1)}}function WNr(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 YNr(t,e){var r,n=w8(e.r,0),i=w8(e.r0||0,0),a=n>0,o=i>0;if(!(!a&&!o)){if(a||(n=i,i=0),i>n){var s=n;n=i,i=s}var l=e.startAngle,u=e.endAngle;if(!(isNaN(l)||isNaN(u))){var h=e.cx,d=e.cy,f=!!e.clockwise,p=zct(u-l),g=p>Spe&&p%Spe;if(g>dg&&(p=g),!(n>dg))t.moveTo(h,d);else if(p>Spe-dg)t.moveTo(h+n*V_(l),d+n*SS(l)),t.arc(h,d,n,l,u,!f),i>dg&&(t.moveTo(h+i*V_(u),d+i*SS(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,C=void 0,k=void 0,E=void 0,_=void 0,P=void 0,L=void 0,R=void 0,D=n*V_(l),M=n*SS(l),I=i*V_(u),N=i*SS(u),F=p>dg;if(F){var B=e.cornerRadius;B&&(r=WNr(B),m=r[0],v=r[1],y=r[2],b=r[3]);var V=zct(n-i)/2;if(x=Ym(V,y),w=Ym(V,b),A=Ym(V,m),S=Ym(V,v),k=T=w8(x,w),E=C=w8(A,S),(T>dg||C>dg)&&(_=n*V_(u),P=n*SS(u),L=i*V_(l),R=i*SS(l),pdg){var X=Ym(y,k),J=Ym(b,k),ee=yW(L,R,D,M,n,X,f),te=yW(_,P,I,N,n,J,f);t.moveTo(h+ee.cx+ee.x0,d+ee.cy+ee.y0),k0&&t.arc(h+ee.cx,d+ee.cy,X,Yc(ee.y0,ee.x0),Yc(ee.y1,ee.x1),!f),t.arc(h,d,n,Yc(ee.cy+ee.y1,ee.cx+ee.x1),Yc(te.cy+te.y1,te.cx+te.x1),!f),J>0&&t.arc(h+te.cx,d+te.cy,J,Yc(te.y1,te.x1),Yc(te.y0,te.x0),!f))}else t.moveTo(h+D,d+M),t.arc(h,d,n,l,u,!f);if(!(i>dg)||!F)t.lineTo(h+I,d+N);else if(E>dg){var X=Ym(m,E),J=Ym(v,E),ee=yW(I,N,_,P,i,-J,f),te=yW(D,M,L,R,i,-X,f);t.lineTo(h+ee.cx+ee.x0,d+ee.cy+ee.y0),E0&&t.arc(h+ee.cx,d+ee.cy,J,Yc(ee.y0,ee.x0),Yc(ee.y1,ee.x1),!f),t.arc(h,d,i,Yc(ee.cy+ee.y1,ee.cx+ee.x1),Yc(te.cy+te.y1,te.cx+te.x1),f),X>0&&t.arc(h+te.cx,d+te.cy,X,Yc(te.y1,te.x1),Yc(te.y0,te.x0),!f))}else t.lineTo(h+I,d+N),t.arc(h,d,i,u,l,f)}t.closePath()}}}var qNr=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}(),fc=function(t){ya(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new qNr},e.prototype.buildPath=function(r,n){YNr(r,n)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(yn);fc.prototype.type="sector";var jNr=function(){function t(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return t}(),Q_=function(t){ya(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new jNr},e.prototype.buildPath=function(r,n){var i=n.cx,a=n.cy,o=Math.PI*2;r.moveTo(i+n.r,a),r.arc(i,a,n.r,0,o,!1),r.moveTo(i+n.r0,a),r.arc(i,a,n.r0,0,o,!0)},e}(yn);Q_.prototype.type="ring";function XNr(t,e,r,n){var i=[],a=[],o=[],s=[],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=XNr(i,n,r,e.smoothConstraint);t.moveTo(i[0][0],i[0][1]);for(var o=i.length,s=0;s<(r?o:o-1);s++){var l=a[s*2],u=a[s*2+1],h=i[(s+1)%o];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 s=1,d=i.length;sOS[1]){if(a=!1,Ml.negativeSize||n)return a;var l=bW(OS[0]-CS[1]),u=bW(CS[0]-OS[1]);Cpe(l,u)>wW.len()&&(l=u||!Ml.bidirectional)&&(wr.scale(xW,s,-u*i),Ml.useDir&&Ml.calcDirMTV()))}}return a},t.prototype._getProjMinMaxOnAxis=function(e,r,n){for(var i=this._axes[e],a=this._origin,o=r[0].dot(i)+a[e],s=o,l=o,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||!!o,setToFinal:!u,scope:t,during:o};s?e.animateFrom(r,g):e.animateTo(r,g)}else e.stopAnimation(),!s&&e.attr(r),o&&o(1),a&&a()}function qn(t,e,r,n,i,a){Ope("update",t,e,r,n,i,a)}function ua(t,e,r,n,i,a){Ope("enter",t,e,r,n,i,a)}function W_(t){if(!t.__zr)return!0;for(var e=0;eao(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function eut(t){return!t.isGroup}function h8r(t){return t.shape!=null}function C8(t,e,r){if(!t||!e)return;function n(o){var s={};return o.traverse(function(l){eut(l)&&l.anid&&(s[l.anid]=l)}),s}function i(o){var s={x:o.x,y:o.y,rotation:o.rotation};return h8r(o)&&(s.shape=lr(o.shape)),s}var a=n(t);e.traverse(function(o){if(eut(o)&&o.anid){var s=a[o.anid];if(s){var l=i(o);o.attr(i(s)),qn(o,l,r,Cr(o).dataIndex)}}})}function Rpe(t,e){return vt(t,function(r){var n=r[0];n=rn(n,e.x),n=Oi(n,e.x+e.width);var i=r[1];return i=rn(i,e.y),i=Oi(i,e.y+e.height),[n,i]})}function tut(t,e){var r=rn(t.x,e.x),n=Oi(t.x+t.width,e.x+e.width),i=rn(t.y,e.y),a=Oi(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=lt({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 nl(n)):q_(t.replace("path://",""),n,r,"center")}function O8(t,e,r,n,i){for(var a=0,o=i[i.length-1];a1)return!1;var v=Dpe(p,g,h,d)/f;return!(v<0||v>1)}function Dpe(t,e,r,n){return t*n-r*e}function d8r(t){return t<=1e-6&&t>=-1e-6}function ES(t,e,r,n,i){return e==null||(Vn(e)?Na[0]=Na[1]=Na[2]=Na[3]=e:(Na[0]=e[0],Na[1]=e[1],Na[2]=e[2],Na[3]=e[3]),n&&(Na[0]=rn(0,Na[0]),Na[1]=rn(0,Na[1]),Na[2]=rn(0,Na[2]),Na[3]=rn(0,Na[3])),r&&(Na[0]=-Na[0],Na[1]=-Na[1],Na[2]=-Na[2],Na[3]=-Na[3]),nut(t,Na,"x","width",3,1,i&&i[0]||0),nut(t,Na,"y","height",0,2,i&&i[1]||0)),t}var Na=[0,0,0,0];function nut(t,e,r,n,i,a,o){var s=e[a]+e[i],l=t[n];t[n]+=s,o=rn(0,Oi(o,l)),t[n]=0?-e[i]:e[a]>=0?l+e[a]:ao(s)>1e-8?(l-o)*e[i]/s:0):t[r]-=e[i]}function Ly(t){var e=t.itemTooltipOption,r=t.componentModel,n=t.itemName,i=$t(e)?{formatter:e}:e,a=r.mainType,o=r.componentIndex,s={componentType:a,name:n,$vars:["name"]};s[a+"Index"]=o;var l=t.formatterParamsExtra;l&&fe(En(l),function(h){Kt(s,h)||(s[h]=l[h],s.$vars.push(h))});var u=Cr(t.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:n,option:mr({content:n,encodeHTMLContent:!0,formatterParams:s},i)}}function Lpe(t,e){var r;t.isGroup&&(r=e(t)),r||t.traverse(e)}function Gx(t,e){if(t)if(ft(t))for(var r=0;re&&(e=o),oe&&(r=e=0),{min:r,max:e}}function OW(t,e,r){aut(t,e,r,-1/0)}function aut(t,e,r,n){if(t.ignoreModelZ)return n;var i=t.getTextContent(),a=t.getTextGuideLine(),o=t.isGroup;if(o)for(var s=t.childrenRef(),l=0;l=0&&s.push(l)}),s}}function Hx(t,e){return Qr(Qr({},t,!0),e,!0)}const T8r={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:". "}}}},C8r={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 RW="ZH",Upe="EN",J_=Upe,DW={},Vpe={},gut=Dn.domSupported?function(){var t=(document.documentElement.lang||navigator.language||navigator.browserLanguage||J_).toUpperCase();return t.indexOf(RW)>-1?RW:J_}():J_;function Qpe(t,e){t=t.toUpperCase(),Vpe[t]=new bn(e),DW[t]=e}function O8r(t){if($t(t)){var e=DW[t.toUpperCase()]||{};return t===RW||t===Upe?lr(e):Qr(lr(e),lr(DW[J_]),!1)}else return Qr(lr(t),lr(DW[J_]),!1)}function Gpe(t){return Vpe[t]}function k8r(){return Vpe[J_]}Qpe(Upe,T8r),Qpe(RW,C8r);var Hpe=null;function E8r(t){Hpe||(Hpe=t)}function Ho(){return Hpe}function mut(t,e){var r=Ho(),n=e.breakOption,i=e.breakParsed;return!i&&r&&(i=r.parseAxisBreakOption(n,t)),i}function LW(t){var e=t.brk;return e?e.breaks:[]}function MW(t){var e=t.brk;return e?e.hasBreaks():!1}var Wpe=1e3,Ype=Wpe*60,_8=Ype*60,ap=_8*24,vut=ap*365,_8r={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})/},IW={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},R8r="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}",PW="{yyyy}-{MM}-{dd}",yut={year:"{yyyy}",month:"{yyyy}-{MM}",day:PW,hour:PW+" "+IW.hour,minute:PW+" "+IW.minute,second:PW+" "+IW.second,millisecond:R8r},Hd=["year","month","day","hour","minute","second","millisecond"],D8r=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function L8r(t){return!$t(t)&&!ur(t)?M8r(t):t}function M8r(t){t=t||{};var e={},r=!0;return fe(Hd,function(n){r&&(r=t[n]==null)}),fe(Hd,function(n,i){var a=t[n];e[n]={};for(var o=null,s=i;s>=0;s--){var l=Hd[s],u=yr(a)&&!ft(a)?a[l]:a,h=void 0;ft(u)?(h=u.slice(),o=h[0]||""):$t(u)?(o=u,h=[o]):(o==null?o=IW[n]:_8r[l].test(o)||(o=e[l][l][0]+" "+o),h=[o],r&&(h[1]="{primary|"+o+"}")),e[n][l]=h}}),e}function Mu(t,e){return t+="","0000".substr(0,e-t.length)+t}function R8(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 I8r(t){return t===R8(t)}function P8r(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function D8(t,e,r,n){var i=Nm(t),a=i[but(r)](),o=i[qpe(r)]()+1,s=Math.floor((o-1)/3)+1,l=i[jpe(r)](),u=i["get"+(r?"UTC":"")+"Day"](),h=i[Xpe(r)](),d=(h-1)%12+1,f=i[Kpe(r)](),p=i[Zpe(r)](),g=i[Jpe(r)](),m=h>=12?"pm":"am",v=m.toUpperCase(),y=n instanceof bn?n:Gpe(n||gut)||k8r(),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,Mu(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,x[o-1]).replace(/{MMM}/g,w[o-1]).replace(/{MM}/g,Mu(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,Mu(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,A[u]).replace(/{ee}/g,S[u]).replace(/{e}/g,u+"").replace(/{HH}/g,Mu(h,2)).replace(/{H}/g,h+"").replace(/{hh}/g,Mu(d+"",2)).replace(/{h}/g,d+"").replace(/{mm}/g,Mu(f,2)).replace(/{m}/g,f+"").replace(/{ss}/g,Mu(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,Mu(g,3)).replace(/{S}/g,g+"")}function N8r(t,e,r,n,i){var a=null;if($t(r))a=r;else if(ur(r)){var o={time:t.time,level:t.time?t.time.level:0},s=Ho();s&&s.makeAxisLabelFormatterParamBreak(o,t.break),a=r(t.value,e,o)}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=e5(t.value,i);a=r[h][h][0]}}return D8(new Date(t.value),a,i,n)}function e5(t,e){var r=Nm(t),n=r[qpe(e)]()+1,i=r[jpe(e)](),a=r[Xpe(e)](),o=r[Kpe(e)](),s=r[Zpe(e)](),l=r[Jpe(e)](),u=l===0,h=u&&s===0,d=h&&o===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 NW(t,e,r){switch(e){case"year":t[xut(r)](0);case"month":t[wut(r)](1);case"day":t[Aut(r)](0);case"hour":t[Sut(r)](0);case"minute":t[Tut(r)](0);case"second":t[Cut(r)](0)}return t}function but(t){return t?"getUTCFullYear":"getFullYear"}function qpe(t){return t?"getUTCMonth":"getMonth"}function jpe(t){return t?"getUTCDate":"getDate"}function Xpe(t){return t?"getUTCHours":"getHours"}function Kpe(t){return t?"getUTCMinutes":"getMinutes"}function Zpe(t){return t?"getUTCSeconds":"getSeconds"}function Jpe(t){return t?"getUTCMilliseconds":"getMilliseconds"}function B8r(t){return t?"setUTCFullYear":"setFullYear"}function xut(t){return t?"setUTCMonth":"setMonth"}function wut(t){return t?"setUTCDate":"setDate"}function Aut(t){return t?"setUTCHours":"setHours"}function Sut(t){return t?"setUTCMinutes":"setMinutes"}function Tut(t){return t?"setUTCSeconds":"setSeconds"}function Cut(t){return t?"setUTCMilliseconds":"setMilliseconds"}function $8r(t,e,r,n,i,a,o,s){var l=new $n({style:{text:t,font:e,align:r,verticalAlign:n,padding:i,rich:a,overflow:o?"truncate":null,lineHeight:s}});return l.getBoundingRect()}function ege(t){if(!Ife(t))return $t(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function tge(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 t5=FN;function rge(t,e,r){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(h){return h&&Nd(h)?h:"-"}function a(h){return ep(h)}var o=e==="time",s=t instanceof Date;if(o||s){var l=o?Nm(t):t;if(isNaN(+l)){if(s)return"-"}else return D8(l,n,r)}if(e==="ordinal")return hH(t)?i(t):Vn(t)&&a(t)?t+"":"-";var u=Bm(t);return a(u)?ege(u):hH(t)?i(t):typeof t=="boolean"?t+"":"-"}var Out=["a","b","c","d","e","f","g"],nge=function(t,e){return"{"+t+(e??"")+"}"};function ige(t,e,r){ft(e)||(e=[e]);var n=e.length;if(!n)return"";for(var i=e[0].$vars||[],a=0;a':'';var o=r.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:i==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:n}:{width:10,height:10,borderRadius:5,backgroundColor:n}}}function F8r(t,e,r){(t==="week"||t==="month"||t==="quarter"||t==="half-year"||t==="year")&&(t=`MM-dd +yyyy`);var n=Nm(e),i=r?"getUTC":"get",a=n[i+"FullYear"](),o=n[i+"Month"]()+1,s=n[i+"Date"](),l=n[i+"Hours"](),u=n[i+"Minutes"](),h=n[i+"Seconds"](),d=n[i+"Milliseconds"]();return t=t.replace("MM",Mu(o,2)).replace("M",o).replace("yyyy",a).replace("yy",Mu(a%100+"",2)).replace("dd",Mu(s,2)).replace("d",s).replace("hh",Mu(l,2)).replace("h",l).replace("mm",Mu(u,2)).replace("m",u).replace("ss",Mu(h,2)).replace("s",h).replace("SSS",Mu(d,3)),t}function z8r(t){return t&&t.charAt(0).toUpperCase()+t.substr(1)}function LS(t,e){return e=e||"transparent",$t(t)?t:yr(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}function BW(t,e){if(e==="_blank"||e==="blank"){var r=window.open();r.opener=null,r.location.href=t}else window.open(t,e)}var $W={},age={},r5=function(){function t(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return t.prototype.create=function(e,r){this._nonSeriesBoxMasterList=n($W),this._normalMasterList=n(age);function n(i,a){var o=[];return fe(i,function(s,l){var u=s.create(e,r);o=o.concat(u||[])}),o}},t.prototype.update=function(e,r){fe(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"){$W[e]=r;return}age[e]=r},t.get=function(e){return age[e]||$W[e]},t}();function U8r(t){return!!$W[t]}var V8r=1,_ut=2;function Q8r(t){Rut.set(t.fullType,{getCoord2:void 0}).getCoord2=t.getCoord2}var Rut=qt();function Dut(t){var e=t.getShallow("coord",!0),r=V8r;if(e==null){var n=Rut.get(t.type);n&&n.getCoord2&&(r=_ut,e=n.getCoord2(t))}return{coord:e,from:r}}var n5=0,FW=1,Lut=2;function Mut(t,e){var r=t.getShallow("coordinateSystem"),n=t.getShallow("coordinateSystemUsage",!0),i=n5;if(r){var a=t.mainType==="series";n==null&&(n=a?"data":"box"),n==="data"?(i=FW,a||(i=n5)):n==="box"&&(i=Lut,!a&&!U8r(r)&&(i=n5))}return{coordSysType:r,kind:i}}function L8(t){var e=t.targetModel,r=t.coordSysType,n=t.coordSysProvider,i=t.isDefaultDataCoordSys;t.allowNotFound;var a=Mut(e),o=a.kind,s=a.coordSysType;if(i&&o!==FW&&(o=FW,s=r),o===n5||s!==r)return n5;var l=n(r,e);return l?(o===FW?e.coordinateSystem=l:e.boxCoordinateSystem=l,o):n5}var Iut=function(t,e){var r=e.getReferringComponents(t,xo).models[0];return r&&r.coordinateSystem},zW=fe,Put=["left","right","top","bottom","width","height"],MS=[["width","left","right"],["height","top","bottom"]];function oge(t,e,r,n,i){var a=0,o=0;n==null&&(n=1/0),i==null&&(i=1/0);var s=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,o+=s+r,s=h.height):s=Math.max(s,h.height)}else{var v=h.height+(f?-f.y+h.y:0);g=o+v,g>i||l.newline?(a+=s+r,o=0,g=v,s=h.width):s=Math.max(s,h.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),t==="horizontal"?a=p+r:o=g+r)})}var IS=oge;Kr(oge,"vertical"),Kr(oge,"horizontal");function Nut(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 G8r(t,e){var r=Ps(t,e,{enableLayoutOnlyByCenter:!0}),n=t.getBoxLayoutParams(),i,a;if(r.type===M8.point)a=r.refPoint,i=ba(n,{width:e.getWidth(),height:e.getHeight()});else{var o=t.get("center"),s=ft(o)?o:[o,o];i=ba(n,r.refContainer),a=r.boxCoordFrom===_ut?r.refPoint:[Qt(s[0],i.width)+i.x,Qt(s[1],i.height)+i.y]}return{viewRect:i,center:a}}function But(t,e){var r=G8r(t,e),n=r.viewRect,i=r.center,a=t.get("radius");ft(a)||(a=[0,a]);var o=Qt(n.width,e.getWidth()),s=Qt(n.height,e.getHeight()),l=Math.min(o,s),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 ba(t,e,r){r=t5(r||0);var n=e.width,i=e.height,a=Qt(t.left,n),o=Qt(t.top,i),s=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-s-f-a),isNaN(h)&&(h=i-l-d-o),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-s-u-f),isNaN(o)&&(o=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":o=i/2-h/2-r[0];break;case"bottom":o=i-h-d;break}a=a||0,o=o||0,isNaN(u)&&(u=n-f-a-(s||0)),isNaN(h)&&(h=i-d-o-(l||0));var g=new pr((e.x||0)+a+r[3],(e.y||0)+o+r[0],u,h);return g.margin=r,g}function $ut(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),o=t.getShallow("preserveAspectVerticalAlign",!0),s={width:e.width,height:e.height},l=n==="cover";return i>r&&!l||i=m)return d;for(var v=0;v=0;l--)s=Qr(s,i[l],!0);n.defaultOption=s}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 Nut(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}(bn);Llt(pn,bn),eW(pn),A8r(pn),S8r(pn,Y8r);function Y8r(t){var e=[];return fe(pn.getClassesByMainType(t),function(r){e=e.concat(r.dependencies||r.prototype.dependencies||[])}),e=vt(e,function(r){return Fm(r).main}),t!=="dataset"&&Nr(e,"dataset")<=0&&e.unshift("dataset"),e}var tt={color:{},darkColor:{},size:{}},Wo=tt.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)"};lt(Wo,{primary:Wo.neutral80,secondary:Wo.neutral70,tertiary:Wo.neutral60,quaternary:Wo.neutral50,disabled:Wo.neutral20,border:Wo.neutral30,borderTint:Wo.neutral20,borderShade:Wo.neutral40,background:Wo.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:Wo.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:Wo.neutral70,axisLineTint:Wo.neutral40,axisTick:Wo.neutral70,axisTickMinor:Wo.neutral60,axisLabel:Wo.neutral70,axisSplitLine:Wo.neutral15,axisMinorSplitLine:Wo.neutral05});for(var NS in Wo)if(Wo.hasOwnProperty(NS)){var zut=Wo[NS];NS==="theme"?tt.darkColor.theme=Wo.theme.slice():NS==="highlight"?tt.darkColor.highlight="rgba(255,231,130,0.4)":NS.indexOf("accent")===0?tt.darkColor[NS]=Ay(zut,null,function(t){return t*.5},function(t){return Math.min(1,1.3-t)}):tt.darkColor[NS]=Ay(zut,null,function(t){return t*.9},function(t){return 1-Math.pow(t,1.5)})}tt.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};var Uut="";typeof navigator<"u"&&(Uut=navigator.platform||"");var i5="rgba(0, 0, 0, 0.2)",Vut=tt.color.theme[0],q8r=Ay(Vut,null,null,.9);const Qut={darkMode:"auto",colorBy:"series",color:tt.color.theme,gradientColor:[q8r,Vut],aria:{decal:{decals:[{color:i5,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:i5,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:i5,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:i5,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:i5,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:i5,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:Uut.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 gc={Must:1,Might:2,Not:3},Gut=Gr();function j8r(t){Gut(t).datasetMap=qt()}function Hut(t,e,r){var n={},i=lge(e);if(!i||!t)return n;var a=[],o=[],s=e.ecModel,l=Gut(s).datasetMap,u=i.uid+"_"+r.seriesLayoutBy,h,d;t=t.slice(),fe(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});fe(t,function(m,v){var y=m.name,b=g(m);if(h==null){var x=f.valueWayDim;p(n[y],x,b),p(o,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(o,x,b),f.categoryWayDim+=b}});function p(m,v,y){for(var b=0;be)return t[n];return t[r-1]}function jut(t,e,r,n,i,a,o){a=a||t;var s=e(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(i))return u[i];var h=o==null||!n?r:eBr(n,o);if(h=h||r,!(!h||!h.length)){var d=h[l];return i&&(u[i]=d),s.paletteIdx=(l+1)%h.length,d}}function tBr(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}var VW,P8,Xut,Kut="\0_ec_inner",rBr=1,dge=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(r,n,i,a,o,s){a=a||{},this.option=null,this._theme=new bn(a),this._locale=new bn(o),this._optionManager=s},e.prototype.setOption=function(r,n,i){var a=eht(n);this._optionManager.setOption(r,i,a),this._resetOption(null,a)},e.prototype.resetOption=function(r,n){return this._resetOption(r,eht(n))},e.prototype._resetOption=function(r,n){var i=!1,a=this._optionManager;if(!r||r==="recreate"){var o=a.mountOption(r==="recreate");!this.option||r==="recreate"?Xut(this,o):(this.restoreData(),this._mergeOption(o,n)),i=!0}if((r==="timeline"||r==="media")&&this.restoreData(),!r||r==="recreate"||r==="timeline"){var s=a.getTimelineOption(this);s&&(i=!0,this._mergeOption(s,n))}if(!r||r==="recreate"||r==="media"){var l=a.getMediaOption(this);l.length&&fe(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,o=this._componentsCount,s=[],l=qt(),u=n&&n.replaceMergeMainTypeMap;j8r(this),fe(r,function(d,f){d!=null&&(pn.hasClass(f)?f&&(s.push(f),l.set(f,!0)):i[f]=i[f]==null?lr(d):Qr(i[f],d,!0))}),u&&u.each(function(d,f){pn.hasClass(f)&&!l.get(f)&&(s.push(f),l.set(f,!0))}),pn.topologicalTravel(s,pn.getAllClassMainTypes(),h,this);function h(d){var f=Z8r(this,d,qi(r[d])),p=a.get(d),g=p?u&&u.get(d)?"replaceMerge":"normalMerge":"replaceAll",m=Tlt(p,f,g);u6r(m,d,pn),i[d]=null,a.set(d,null),o.set(d,0);var v=[],y=[],b=0,x;fe(m,function(w,A){var S=w.existing,T=w.newOption;if(!T)S&&(S.mergeOption({},this),S.optionUpdated({},!1));else{var C=d==="series",k=pn.getClass(d,w.keyInfo.subType,!C);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=lt({componentIndex:A},w.keyInfo);S=new k(T,this,this,E),lt(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),o.set(d,b),d==="series"&&VW(this)}this._seriesIndices||VW(this)},e.prototype.getOption=function(){var r=lr(this.option);return fe(r,function(n,i){if(pn.hasClass(i)){for(var a=qi(n),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!h8(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,r[i]=a}}),delete r[Kut],r},e.prototype.setTheme=function(r){this._theme=new bn(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 o=0;o=e:r==="max"?t<=e:t===e}function uBr(t,e){return t.join(",")===e.join(",")}var pg=fe,N8=yr,tht=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function fge(t){var e=t&&t.itemStyle;if(e)for(var r=0,n=tht.length;r0?r[o-1].seriesModel:null)}),xBr(r)}})}function xBr(t){fe(t,function(e,r){var n=[],i=[NaN,NaN],a=[e.stackResultDimension,e.stackedOverDimension],o=e.data,s=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";o.modify(a,function(u,h,d){var f=o.get(e.stackedDimension,d);if(isNaN(f))return i;var p,g;s?g=o.getRawIndex(d):p=o.get(e.stackedByDimension,d);for(var m=NaN,v=r-1;v>=0;v--){var y=t[v];if(s||(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=aS(f,b),m=b;break}}}return n[0]=f,n[1]=m,n})})}var QW=function(){function t(e){this.data=e.data||(e.sourceFormat===ug?{}:[]),this.sourceFormat=e.sourceFormat||cct,this.seriesLayoutBy=e.seriesLayoutBy||hg,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};dht=(e={},e[Dl+"_"+hg]={pure:!0,appendData:a},e[Dl+"_"+bS]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[Qd]={pure:!0,appendData:a},e[ug]={pure:!0,appendData:function(o){var s=this._data;fe(o,function(l,u){for(var h=s[u]||(s[u]=[]),d=0;d<(l||[]).length;d++)h.push(l[d])})}},e[Vd]={appendData:a},e[Ux]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},e);function a(o){for(var s=0;s=0&&(m=o.interpolatedValue[v])}return m!=null?m+"":""})}},t.prototype.getRawValue=function(e,r){return a5(this.getData(r),e)},t.prototype.formatTooltip=function(e,r,n){},t}();function xht(t){var e,r;return yr(t)?t.type&&(r=t):e=t,{text:e,frag:r}}function F8(t){return new EBr(t)}var EBr=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 o=h(this._modBy),s=this._modDataCount||0,l=h(e&&e.modBy),u=e&&e.modDataCount||0;(o!==l||s!==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?s:o}};return a;function o(){return e=t?null:le},gte:function(t,e){return t>=e}},RBr=function(){function t(e,r){if(!Vn(r)){var n="";si(n)}this._opFn=Sht[e],this._rvalFloat=Bm(r)}return t.prototype.evaluate=function(e){return Vn(e)?this._opFn(e,this._rvalFloat):this._opFn(Bm(e),this._rvalFloat)},t}(),Tht=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=Vn(e)?e:Bm(e),i=Vn(r)?r:Bm(r),a=isNaN(n),o=isNaN(i);if(a&&(n=this._incomparable),o&&(i=this._incomparable),a&&o){var s=$t(e),l=$t(r);s&&(n=l?e:0),l&&(i=s?r:0)}return ni?-this._resultLT:0},t}(),DBr=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 LBr(t,e){return t==="eq"||t==="ne"?new DBr(t==="eq",e):Kt(Sht,t)?new RBr(t,e):null}function Cht(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 Oht(t,e){return e>t.g&&e>=t.ge&&e65535?VBr:QBr}function GBr(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function Dht(t,e,r,n,i){var a=Rht[r||"float"];if(i){var o=t[e],s=o&&o.length;if(s!==n){for(var l=new a(n),u=0;uv[1]&&(v[1]=m)}return this._rawCount=this._count=l,{start:s,end:l}},t.prototype._initDataFromProvider=function(e,r,n){for(var i=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=vt(o,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=o-1;else return o}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])&&(C=!1)}C&&(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],o=this.count(),s=0,l=Math.floor(1/r),u=this.getRawIndex(0),h,d,f,p=new(o5(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));p[s++]=u;for(var g=1;gh&&(h=d,f=w)}_>0&&_s&&(m=s-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,s.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,o=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 Wx(r[a],this._dimensions[a])}wge={arrayRows:e,objectRows:function(r,n,i,a){return Wx(r[n],this._dimensions[a])},keyedColumns:e,original:function(r,n,i,a){var o=r&&(r.value==null?r:r.value);return Wx(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(r,n,i,a){return r[a]}}}(),t}(),Lht=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(WW(e)){var o=e,s=void 0,l=void 0,u=void 0;if(n){var h=r[0];h.prepareSource(),u=h.getSource(),s=u.data,l=u.sourceFormat,a=[h._getVersionSign()]}else s=o.get("data",!0),l=Ru(s)?Ux:Vd,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?[mge(s,{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=[mge(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&&Iht(a)}var o,s=[],l=[];return fe(e,function(u){u.prepareSource();var h=u.getSource(i||0),d="";i!=null&&!h&&Iht(d),s.push(h),l.push(u._getVersionSign())}),n?o=zBr(n,s,{datasetIndex:r.componentIndex}):i!=null&&(o=[wBr(s[0])]),{sourceList:o,upstreamSignList:l}},t.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),r=0;r1||r>0&&!t.noHeader;return fe(t.blocks,function(i){var a=Nht(i);a>=e&&(e=a+ +(n&&(!a||Sge(i)&&!i.noHeader)))}),e}return 0}function WBr(t,e,r,n){var i=e.noHeader,a=qBr(Nht(e)),o=[],s=e.blocks||[];uc(!s||ft(s)),s=s||[];var l=t.orderMode;if(e.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(Kt(u,l)){var h=new Aht(u[l],null);s.sort(function(m,v){return h.evaluate(m.sortParam,v.sortParam)})}else l==="seriesDesc"&&s.reverse()}fe(s,function(m,v){var y=e.valueFormatter,b=Pht(m)(y?lt(lt({},t),{valueFormatter:y}):t,m,v>0?a.html:0,n);b!=null&&o.push(b)});var d=t.renderMode==="richText"?o.join(a.richText):Tge(n,o.join(""),i?r:a.html);if(i)return d;var f=rge(e.header,"ordinal",t.useUTC),p=Iht(n,t.renderMode).nameStyle,g=Mht(n);return t.renderMode==="richText"?$ht(t,f,p)+a.richText+d:Tge(n,'
'+Hc(f)+"
"+d,r)}function YBr(t,e,r,n){var i=t.renderMode,a=e.noName,o=e.noValue,s=!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 rge(A,ft(p)?p[S]:p,u)})};if(!(a&&o)){var d=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||tt.color.secondary,i),f=a?"":rge(l,"ordinal",u),p=e.valueType,g=o?[]:h(e.value,e.rawDataIndex),m=!s||!a,v=!s&&a,y=Iht(n,i),b=y.nameStyle,x=y.valueStyle;return i==="richText"?(s?"":d)+(a?"":$ht(t,f,b))+(o?"":KBr(t,g,m,v,x)):Tge(n,(s?"":d)+(a?"":jBr(f,!s,b))+(o?"":XBr(g,m,v,x)),r)}}function Bht(t,e,r,n,i,a){if(t){var o=Pht(t),s={useUTC:i,renderMode:r,orderMode:n,markupStyleCreator:e,valueFormatter:t.valueFormatter};return o(s,t,0,a)}}function qBr(t){return{html:GBr[t],richText:HBr[t]}}function Tge(t,e,r){var n='
',i="margin: "+r+"px 0 0",a=Mht(t);return'
'+e+n+"
"}function jBr(t,e,r){var n=e?"margin-left:2px":"";return''+Hc(t)+""}function XBr(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(o){return Hc(o)}).join("  ")+""}function $ht(t,e,r){return t.markupStyleCreator.wrapRichTextStyle(e,r)}function KBr(t,e,r,n,i){var a=[i],o=n?10:20;return r&&a.push({padding:[0,0,0,o],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(ft(e)?e.join(" "):e,a)}function Fht(t,e){var r=t.getData().getItemVisual(e,"style"),n=r[t.visualDrawType];return LS(n)}function zht(t,e){var r=t.get("padding");return r??(e==="richText"?[8,10]:10)}var Cge=function(){function t(){this.richTextStyles={},this._nextStyleNameId=Pfe()}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=Out({color:r,type:e,renderMode:n,markerId:i});return $t(a)?a:(this.richTextStyles[i]=a.style,a.content)},t.prototype.wrapRichTextStyle=function(e,r){var n={};ft(r)?fe(r,function(a){return lt(n,a)}):lt(n,r);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+e+"}"},t}();function Uht(t){var e=t.series,r=t.dataIndex,n=t.multipleSeries,i=e.getData(),a=i.mapDimensionsAll("defaultedTooltip"),o=a.length,s=e.getRawValue(r),l=ft(s),u=Fht(e,r),h,d,f,p;if(o>1||l&&!o){var g=ZBr(s,e,r,a,u);h=g.inlineValues,d=g.inlineValueTypes,f=g.blocks,p=g.inlineValues[0]}else if(o){var m=i.getDimensionInfo(a[0]);p=h=a5(i,r,a[0]),d=m.type}else p=h=l?s[0]:s;var v=Nfe(e),y=v&&e.name||"",b=i.getName(r),x=n?y:b;return fs("section",{header:y,noHeader:n||!v,sortParam:p,blocks:[fs("nameValue",{markerType:"item",markerColor:u,name:x,noName:!Nd(x),value:h,valueType:d,rawDataIndex:i.getRawIndex(r)})].concat(f||[])})}function ZBr(t,e,r,n,i){var a=e.getData(),o=Yf(t,function(d,f,p){var g=a.getDimensionInfo(p);return d=d||g&&g.tooltip!==!1&&g.displayName!=null},!1),s=[],l=[],u=[];n.length?fe(n,function(d){h(a5(a,r,d),d)}):fe(t,h);function h(d,f){var p=a.getDimensionInfo(f);!p||p.otherDims.tooltip===!1||(o?u.push(fs("nameValue",{markerType:"subItem",markerColor:i,name:p.displayName,value:d,valueType:p.type})):(s.push(d),l.push(p.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var Yx=Gr();function YW(t,e){return t.getName(e)||t.getId(e)}var qW="__universalTransitionEnabled",Ii=function(t){nt(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=F8({count:e7r,reset:t7r}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,i);var a=Yx(this).sourceManager=new Rht(this);a.prepareSource();var o=this.getInitialData(r,i);Qht(o,this),this.dataTask.context.data=o,Yx(this).dataBeforeProcessed=o,Vht(this),this._initSelectedMapFromData(o)},e.prototype.mergeDefaultAndTheme=function(r,n){var i=I8(this),a=i?PS(r):{},o=this.subType;pn.hasClass(o)&&(o+="Series"),Qr(r,n.getTheme().get(this.subType)),Qr(r,this.getDefaultOption()),sS(r,"label",["show"]),this.fillDataTextStyle(r.data),i&&qm(r,a,i)},e.prototype.mergeOption=function(r,n){r=Qr(this.option,r,!0),this.fillDataTextStyle(r.data);var i=I8(this);i&&qm(this.option,r,i);var a=Yx(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(r,n);Qht(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,Yx(this).dataBeforeProcessed=o,Vht(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(r){if(r&&!Ru(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 Uht({series:this,dataIndex:r,multipleSeries:n})},e.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(Dn.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,o=uge.prototype.getColorFromPalette.call(this,r,n,i);return o||(o=a.getColorFromPalette(r,n,i)),o},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,o=this.getData(n);if(a==="series"||i==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s=0&&i.push(o)}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[YW(a,r)])&&!a.getItemModel(r).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[qW])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,o=this.option,s=o.selectedMode,l=n.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){yr(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,h=0;h0&&this._innerSelect(r,n)}},e.registerClass=function(r){return pn.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}(pn);Qo(Ii,HW),Qo(Ii,uge),Rlt(Ii,pn);function Vht(t){var e=t.name;Nfe(t)||(t.name=JBr(t)||e)}function JBr(t){var e=t.getRawData(),r=e.mapDimensionsAll("seriesName"),n=[];return fe(r,function(i){var a=e.getDimensionInfo(i);a.displayName&&n.push(a.displayName)}),n.join(" ")}function e7r(t){return t.model.getRawData().count()}function t7r(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),r7r}function r7r(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Qht(t,e){fe(b_(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(r){t.wrapMethod(r,Kr(n7r,e))})}function n7r(t,e){var r=Oge(t);return r&&r.setOutputEnd((e||this).count()),e}function Oge(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 Xi=function(){function t(){this.group=new gr,this.uid=DS("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}();Vfe(Xi),eW(Xi);function US(){var t=Gr();return function(e){var r=t(e),n=e.pipelineContext,i=!!r.large,a=!!r.progressiveRender,o=r.large=!!(n&&n.large),s=r.progressiveRender=!!(n&&n.progressiveRender);return(i!==o||a!==s)&&"reset"}}var Ght=Gr(),i7r=US(),ki=function(){function t(){this.group=new gr,this.uid=DS("viewChart"),this.renderTask=F8({plan:a7r,reset:o7r}),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&&Wht(a,i,"emphasis")},t.prototype.downplay=function(e,r,n,i){var a=e.getData(i&&i.dataType);a&&Wht(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){Gx(this.group,e)},t.markUpdateMethod=function(e,r){Ght(e).updateMethod=r},t.protoInitialize=function(){var e=t.prototype;e.type="chart"}(),t}();function Hht(t,e,r){t&&v8(t)&&(e==="emphasis"?_y:Ry)(t,r)}function Wht(t,e,r){var n=lS(t,e),i=e&&e.highlightKey!=null?DNr(e.highlightKey):null;n!=null?fe(qi(n),function(a){Hht(t.getItemGraphicEl(a),r,i)}):t.eachItemGraphicEl(function(a){Hht(a,r,i)})}Vfe(ki),eW(ki);function a7r(t){return i7r(t.model)}function o7r(t){var e=t.model,r=t.ecModel,n=t.api,i=t.payload,a=e.pipelineContext.progressiveRender,o=t.view,s=i&&Ght(i).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](e,r,n,i),s7r[l]}var s7r={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)}}},jW="\0__throttleOriginMethod",Yht="\0__throttleRate",qht="\0__throttleType";function XW(t,e,r){var n,i=0,a=0,o=null,s,l,u,h;e=e||0;function d(){a=new Date().getTime(),o=null,t.apply(l,u||[])}var f=function(){for(var p=[],g=0;g=0?d():o=setTimeout(d,-s),i=n};return f.clear=function(){o&&(clearTimeout(o),o=null)},f.debounceNextCall=function(p){h=p},f}function s5(t,e,r,n){var i=t[e];if(i){var a=i[jW]||i,o=i[qht],s=i[Yht];if(s!==r||o!==n){if(r==null||!n)return t[e]=a;i=t[e]=XW(a,r,n==="debounce"),i[jW]=a,i[qht]=n,i[Yht]=r}return i}}function z8(t,e){var r=t[e];r&&r[jW]&&(r.clear&&r.clear(),t[e]=r[jW])}var jht=Gr(),Xht={itemStyle:hS(dut,!0),lineStyle:hS(hut,!0)},l7r={lineStyle:"stroke",itemStyle:"fill"};function Kht(t,e){var r=t.visualStyleMapper||Xht[e];return r||(console.warn("Unknown style type '"+e+"'."),Xht.itemStyle)}function Zht(t,e){var r=t.visualDrawType||l7r[e];return r||(console.warn("Unknown style type '"+e+"'."),"fill")}var c7r={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",i=t.getModel(n),a=Kht(t,n),o=a(i),s=i.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=Zht(t,n),u=o[l],h=ur(u)?u:null,d=o.fill==="auto"||o.stroke==="auto";if(!o[l]||h||d){var f=t.getColorFromPalette(t.name,null,e.getSeriesCount());o[l]||(o[l]=f,r.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||ur(o.fill)?f:o.fill,o.stroke=o.stroke==="auto"||ur(o.stroke)?f:o.stroke}if(r.setVisual("style",o),r.setVisual("drawType",l),!e.isSeriesFiltered(t)&&h)return r.setVisual("colorFromPalette",!1),{dataEach:function(p,g){var m=t.getDataParams(g),v=lt({},o);v[l]=h(m),p.setItemVisual(g,"style",v)}}}},U8=new bn,u7r={createOnAllSeries:!0,reset:function(t,e){if(!t.ignoreStyleOnData){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",i=Kht(t,n),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){U8.option=l[n];var u=i(U8),h=o.ensureUniqueItemVisual(s,"style");lt(h,u),U8.option.decal&&(o.setItemVisual(s,"decal",U8.option.decal),U8.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},h7r={performRawSeries:!0,overallReset:function(t){var e=qt();t.eachSeries(function(r){if(!r.isColorBySeries()){var n=r.type+"-"+r.getColorBy();jht(r).scope=e.get(n)||e.set(n,{})}}),t.eachSeries(function(r){if(!r.isColorBySeries()){var n=r.getRawData(),i={},a=r.getData(),o=jht(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=Zht(r,s);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,o,g)}})}})}},KW=Math.PI;function d7r(t,e){e=e||{},mr(e,{text:"loading",textColor:tt.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:tt.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var r=new gr,n=new nn({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});r.add(n);var i=new $n({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 nn({style:{fill:"none"},textContent:i,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});r.add(a);var o;return e.showSpinner&&(o=new A8({shape:{startAngle:-KW/2,endAngle:-KW/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:KW*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:KW*3/2}).delay(300).start("circularInOut"),r.add(o)),r.resize=function(){var s=i.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,u=(t.getWidth()-l*2-(e.showSpinner&&s?10:0)-s)/2-(e.showSpinner&&s?0:5+s/2)+(e.showSpinner?0:s/2)+(s?0:l),h=t.getHeight()/2;e.showSpinner&&o.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 Jht=function(){function t(e,r,n,i){this._stageTaskMap=qt(),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,o=a?n.step:null,s=i&&i.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},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):Elt(e,r,n);e.pipelineContext=n.context=i},t.prototype.restorePipelines=function(e,r){var n=this,i=n._pipelineMap=qt();r.eachSeries(function(a){var o=e.painter.type==="canvas"&&a.getProgressive(),s=a.uid;i.set(s,{id:s,head:null,tail:null,threshold:a.getProgressiveThreshold(),progressiveEnabled:o&&!(a.preventIncremental&&a.preventIncremental()),blockIndex:-1,step:Math.round(o||700),count:0}),n._pipe(a,a.dataTask)})},t.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,r=this.api.getModel(),n=this.api;fe(this._allHandlers,function(i){var a=e.get(i.uid)||e.set(i.uid,{}),o="";uc(!(i.reset&&i.overallReset),o),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,o=a.context;o.model=r,o.ecModel=n,o.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,o=this;fe(e,function(l,u){if(!(i.visualType&&i.visualType!==l.visualType)){var h=o._stageTaskMap.get(l.uid),d=h.seriesTaskMap,f=h.overallTask;if(f){var p,g=f.agentStubMap;g.each(function(v){s(i,v)&&(v.dirty(),p=!0)}),p&&f.dirty(),o.updatePayload(f,n);var m=o.getPerformArgs(f,i.block);g.each(function(v){v.perform(m)}),f.perform(m)&&(a=!0)}else d&&d.each(function(v,y){s(i,v)&&v.dirty();var b=o.getPerformArgs(v,i.block);b.skip=!l.performRawSeries&&r.isSeriesFiltered(v.context.model),o.updatePayload(v,n),v.perform(b)&&(a=!0)})}});function s(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,o=r.seriesTaskMap,s=r.seriesTaskMap=qt(),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=s.set(f,o&&o.get(f)||F8({plan:v7r,reset:y7r,count:x7r}));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,o=r.overallTask=r.overallTask||F8({reset:f7r});o.context={ecModel:n,api:i,overallReset:e.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=qt(),u=e.seriesType,h=e.getTargetSeries,d=e.dirtyOnOverallProgress,f=!1,p="";uc(!e.createOnAllSeries,p),u?n.eachRawSeriesByType(u,g):h?h(n,i).each(g):fe(n.getSeries(),g);function g(m){var v=m.uid,y=l.set(v,s&&s.get(v)||(f=!0,F8({reset:p7r,onDirty:m7r})));y.context={model:m,dirtyOnOverallProgress:d},y.agent=o,y.__block=d,a._pipe(m,y)}f&&o.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:w7r(e)}),e.uid=DS("stageHandler"),r&&(e.visualType=r),e},t}();function f7r(t){t.overallReset(t.ecModel,t.api,t.payload)}function p7r(t){return t.dirtyOnOverallProgress&&g7r}function g7r(){this.agent.dirty(),this.getDownstream().dirty()}function m7r(){this.agent&&this.agent.dirty()}function v7r(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function y7r(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 edt(n)}):b7r}var b7r=edt(0);function edt(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)}}s.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,o=n.model,s=n.view;if(!o||!s)return!0;var l=r.cptQuery,u=r.dataQuery;return h(l,o,"mainType")&&h(l,o,"subType")&&h(l,o,"index","componentIndex")&&h(l,o,"name")&&h(l,o,"id")&&h(u,a,"name")&&h(u,a,"dataIndex")&&h(u,a,"dataType")&&(!s.filterForExposedEvent||s.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}(),kge=["symbol","symbolSize","symbolRotate","symbolOffset"],odt=kge.concat(["symbolKeepAspect"]),S7r={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,o=0;o=0&&GS(l)?l:.5;var u=t.createRadialGradient(o,s,0,o,s,l);return u}function _ge(t,e,r){for(var n=e.type==="radial"?V7r(t,e,r):U7r(t,e,r),i=e.colorStops,a=0;a0)?null:t==="dashed"?[4*e,2*e]:t==="dotted"?[e]:Vn(t)?[t]:ft(t)?t:null}function Rge(t){var e=t.style,r=e.lineDash&&e.lineWidth>0&&G7r(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 H7r=new Qm(!0);function rY(t){var e=t.stroke;return!(e==null||e==="none"||!(t.lineWidth>0))}function pdt(t){return typeof t=="string"&&t!=="none"}function nY(t){var e=t.fill;return e!=null&&e!=="none"}function gdt(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 mdt(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 Dge(t,e,r){var n=Gfe(e.image,e.__image,r);if(tW(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)*VN),a.scaleSelf(e.scaleX||1,e.scaleY||1),i.setTransform(a)}return i}}function W7r(t,e,r,n,i){var a,o=rY(r),s=nY(r),l=r.strokePercent,u=l<1,h=!e.path;(!e.silent||u)&&h&&e.createPathProxy();var d=e.path||H7r,f=e.__dirty;if(!n){var p=r.fill,g=r.stroke,m=s&&!!p.colorStops,v=o&&!!g.colorStops,y=s&&!!p.image,b=o&&!!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?_ge(t,p,T):e.__canvasFillGradient,e.__canvasFillGradient=x),v&&(w=f?_ge(t,g,T):e.__canvasStrokeGradient,e.__canvasStrokeGradient=w),y&&(A=f||!e.__canvasFillPattern?Dge(t,p,e):e.__canvasFillPattern,e.__canvasFillPattern=A),b&&(S=f||!e.__canvasStrokePattern?Dge(t,g,e):e.__canvasStrokePattern,e.__canvasStrokePattern=S),m?t.fillStyle=x:y&&(A?t.fillStyle=A:s=!1),v?t.strokeStyle=w:b&&(S?t.strokeStyle=S:o=!1)}var C=e.getGlobalScale();d.setScale(C[0],C[1],e.segmentIgnoreThreshold);var k,E;t.setLineDash&&r.lineDash&&(a=Rge(e),k=a[0],E=a[1]);var _=!0;(h||f&S_)&&(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=s,i.batchStroke=o):r.strokeFirst?(o&&mdt(t,r),s&&gdt(t,r)):(s&&gdt(t,r),o&&mdt(t,r)),k&&t.setLineDash([])}function Y7r(t,e,r){var n=e.__image=Gfe(r.image,e.__image,e,e.onload);if(!(!n||!tW(n))){var i=r.x||0,a=r.y||0,o=e.getWidth(),s=e.getHeight(),l=n.width/n.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=n.width,s=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,o,s)}else if(r.sx&&r.sy){var u=r.sx,h=r.sy,d=o-u,f=s-h;t.drawImage(n,u,h,d,f,i,a,o,s)}else t.drawImage(n,i,a,o,s)}}function q7r(t,e,r){var n,i=r.text;if(i!=null&&(i+=""),i){t.font=r.font||fy,t.textAlign=r.textAlign,t.textBaseline=r.textBaseline;var a=void 0,o=void 0;t.setLineDash&&r.lineDash&&(n=Rge(e),a=n[0],o=n[1]),a&&(t.setLineDash(a),t.lineDashOffset=o),r.strokeFirst?(rY(r)&&t.strokeText(i,r.x,r.y),nY(r)&&t.fillText(i,r.x,r.y)):(nY(r)&&t.fillText(i,r.x,r.y),rY(r)&&t.strokeText(i,r.x,r.y)),a&&t.setLineDash([])}}var vdt=["shadowBlur","shadowOffsetX","shadowOffsetY"],ydt=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function bdt(t,e,r,n,i){var a=!1;if(!n&&(r=r||{},e===r))return!1;if(n||e.opacity!==r.opacity){Iu(t,i),a=!0;var o=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(o)?dS.opacity:o}(n||e.blend!==r.blend)&&(a||(Iu(t,i),a=!0),t.globalCompositeOperation=e.blend||dS.blend);for(var s=0;s0&&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[Ns]){if(this._disposed){this.id;return}var a,o,s;if(yr(n)&&(i=n.lazyUpdate,a=n.silent,o=n.replaceMerge,s=n.transition,n=n.notMerge),this[Ns]=!0,m5(this),!this._model||n){var l=new iBr(this._api),u=this._theme,h=this._model=new dge;h.scheduler=this._scheduler,h.ssr=this._ssr,h.init(null,null,null,u,this._locale,l)}this._model.setOption(r,{replaceMerge:o},Hge);var d={seriesTransition:s,optionChanged:!0};if(i)this[Il]={silent:a,updateParams:d},this[Ns]=!1,this.getZr().wakeUp();else{try{WS(this),Iy.update.call(this,null,d)}catch(f){throw this[Il]=null,this[Ns]=!1,f}this._ssr||this._zr.flush(),this[Il]=null,this[Ns]=!1,p5.call(this,a),g5.call(this,a)}}},e.prototype.setTheme=function(r,n){if(!this[Ns]){if(this._disposed){this.id;return}var i=this._model;if(i){var a=n&&n.silent,o=null;this[Il]&&(a==null&&(a=this[Il].silent),o=this[Il].updateParams,this[Il]=null),this[Ns]=!0,m5(this);try{this._updateTheme(r),i.setTheme(this._theme),WS(this),Iy.update.call(this,{type:"setTheme"},o)}catch(s){throw this[Ns]=!1,s}this[Ns]=!1,p5.call(this,a),g5.call(this,a)}}},e.prototype._updateTheme=function(r){$t(r)&&(r=jdt[r]),r&&(r=lr(r),r&&aht(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||Dn.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 fe(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=[],o=this;fe(n,function(l){i.eachComponent({mainType:l},function(u){var h=o._componentsMap[u.__viewId];h.group.ignore||(a.push(h),h.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(r).toDataURL("image/"+(r&&r.type||"png"));return fe(a,function(l){l.group.ignore=!1}),s},e.prototype.getConnectedDataURL=function(r){if(this._disposed){this.id;return}var n=r.type==="svg",i=this.group,a=Math.min,o=Math.max,s=1/0;if(dY[i]){var l=s,u=s,h=-s,d=-s,f=[],p=r&&r.pixelRatio||this.getDevicePixelRatio();fe(YS,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=o(S.right,h),d=o(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=tl.createCanvas(),y=Efe(v,{renderer:n?"svg":"canvas"});if(y.resize({width:g,height:m}),n){var b="";return fe(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 nn({shape:{x:0,y:0,width:g,height:m},style:{fill:r.connectedBackgroundColor}})),fe(f,function(x){var w=new nl({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 sY(this,"convertToPixel",r,n,i)},e.prototype.convertToLayout=function(r,n,i){return sY(this,"convertToLayout",r,n,i)},e.prototype.convertFromPixel=function(r,n,i){return sY(this,"convertFromPixel",r,n,i)},e.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var i=this._model,a,o=M_(i,r);return fe(o,function(s,l){l.indexOf("Models")>=0&&fe(s,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=M_(i,r,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?Ege(s,l,n):G8(s,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;fe(b$r,function(i){var a=function(o){var s=r.getModel(),l=o.target,u,h=i==="globalout";if(h?u={}:l&&VS(l,function(m){var v=Cr(m);if(v&&v.dataIndex!=null){var y=v.dataModel||s.getSeriesByIndex(v.seriesIndex);return u=y&&y.getDataParams(v.dataIndex,v.dataType,l)||{},!0}else if(v.eventData)return u=lt({},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&&s.getComponent(d,f),g=p&&r[p.mainType==="series"?"_chartsMap":"_componentsMap"][p.__viewId];u.event=o,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;fe(Qge,function(i,a){n.on(a,function(o){r.trigger(a,o)})}),C7r(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&&Tlt(this.getDom(),Yge,"");var n=this,i=n._api,a=n._model;fe(n._componentsViews,function(o){o.dispose(a,i)}),fe(n._chartsViews,function(o){o.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 YS[n.id]},e.prototype.resize=function(r){if(!this[Ns]){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[Il]&&(a==null&&(a=this[Il].silent),i=!0,this[Il]=null),this[Ns]=!0,m5(this);try{i&&WS(this),Iy.update.call(this,{type:"resize",animation:lt({duration:0},r&&r.animation)})}catch(o){throw this[Ns]=!1,o}this[Ns]=!1,p5.call(this,a),g5.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(),!!Wge[r]){var i=Wge[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=lt({},r);return n.type=Vge[r.type],n},e.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(yr(n)||(n={silent:!!n}),!!uY[r.type]&&this._model){if(this[Ns]){this._pendingActions.push(r);return}var i=n.silent;Fge.call(this,r,i);var a=n.flush;a?this._zr.flush():a!==!1&&Dn.browser.weChat&&this._throttledZrFlush(),p5.call(this,i),g5.call(this,i)}},e.prototype.updateLabelLayout=function(){sp.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(){WS=function(d){E7r(d._model);var f=d._scheduler;f.restorePipelines(d._zr,d._model),f.prepareStageTasks(),Bge(d,!0),Bge(d,!1),f.plan()},Bge=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"),Uut.hoverLayerThreshold)&&!Dn.node&&!Dn.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!==Y_&&(w.hoverLayer=v?qct:Yct)})}}),d._usingTHL=v)}}function s(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=_S(d);f.eachRendered(function(g){return OW(g,p.z,p.zlevel),!0})}}function u(d,f){f.eachRendered(function(p){if(!W_(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(W_(y))return;if(y instanceof yn&&LNr(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)}})}Wdt=function(d){return new(function(f){nt(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){_y(g,m),lp(d)},p.prototype.leaveEmphasis=function(g,m){Ry(g,m),lp(d)},p.prototype.enterBlur=function(g){xct(g),lp(d)},p.prototype.leaveBlur=function(g){ppe(g),lp(d)},p.prototype.enterSelect=function(g){wct(g),lp(d)},p.prototype.leaveSelect=function(g){Act(g),lp(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[aY]},p.prototype.usingTHL=function(){return d._usingTHL},p}(cct))(d)},Ydt=function(d){function f(p,g){for(var m=0;m=0)){tft.push(r);var o=Jht.wrapStageHandler(r,i);o.__prio=e,o.__raw=r,t.push(o)}}function Jge(t,e){Wge[t]=e}function _$r(t){Yot({createCanvas:t})}function rft(t,e,r){var n=udt("registerMap");n&&n(t,e,r)}function R$r(t){var e=udt("getMap");return e&&e(t)}var nft=BBr;qx(Ige,c7r),qx(iY,u7r),qx(iY,h7r),qx(Ige,S7r),qx(iY,T7r),qx(Idt,r$r),Xge(aht),Kge(l$r,mBr),Jge("default",d7r),gg({type:xS,event:xS,update:xS},no),gg({type:hW,event:hW,update:hW},no),gg({type:dW,event:hpe,update:dW,action:no,refineEvent:eme,publishNonRefinedEvent:!0}),gg({type:upe,event:hpe,update:upe,action:no,refineEvent:eme,publishNonRefinedEvent:!0}),gg({type:fW,event:hpe,update:fW,action:no,refineEvent:eme,publishNonRefinedEvent:!0});function eme(t,e,r,n){return{eventContent:{selected:kNr(r),isFromClick:e.isFromClick||!1}}}jge("default",{}),jge("dark",adt);var D$r={},ift=[],L$r={registerPreprocessor:Xge,registerProcessor:Kge,registerPostInit:Kdt,registerPostUpdate:Zdt,registerUpdateLifecycle:fY,registerAction:gg,registerCoordinateSystem:Jdt,registerLayout:eft,registerVisual:qx,registerTransform:nft,registerLoading:Jge,registerMap:rft,registerImpl:O7r,PRIORITY:Pdt,ComponentModel:pn,ComponentView:Xi,SeriesModel:Ii,ChartView:ki,registerComponentModel:function(t){pn.registerClass(t)},registerComponentView:function(t){Xi.registerClass(t)},registerSeriesModel:function(t){Ii.registerClass(t)},registerChartView:function(t){ki.registerClass(t)},registerCustomSeries:function(t,e){ddt(t,e)},registerSubTypeDefaulter:function(t,e){pn.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){slt(t,e)}};function Xr(t){if(ft(t)){fe(t,function(e){Xr(e)});return}Nr(ift,t)>=0||(ift.push(t),ur(t)&&(t={install:t}),t.install(L$r))}function H8(t){return t==null?0:t.length||1}function aft(t){return t}var Py=function(){function t(e,r,n,i,a,o){this._old=e,this._new=r,this._oldKeyGetter=n||aft,this._newKeyGetter=i||aft,this.context=a,this._diffModeMultiple=o==="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 o=0;o1){var h=l.shift();l.length===1&&(n[s]=l[0]),this._update&&this._update(h,o)}else u===1?(n[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,n)},t.prototype._executeMultiple=function(){var e=this._old,r=this._new,n={},i={},a=[],o=[];this._initIndexMap(e,n,a,"_oldKeyGetter"),this._initIndexMap(r,i,o,"_newKeyGetter");for(var s=0;s1&&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 s=0;s30}var W8=yr,jx=vt,$$r=typeof Int32Array>"u"?Array:Int32Array,F$r="e\0\0",uft=-1,z$r=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],U$r=["_approximateExtent"],hft,mY,Y8,q8,nme,j8,ime,jc=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;sft(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(i=!0,n=e),n=n||["x","y"];for(var a={},o=[],s={},l=!1,u={},h=0;h=r)){var n=this._store,i=n.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=i.getSource().sourceFormat,l=s===Vd;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():W8(a)&&(a=lt({},a)),i[r]=a),a},t.prototype.setItemVisual=function(e,r,n){var i=this._itemVisuals[e]||{};this._itemVisuals[e]=i,W8(r)?lt(i,r):i[r]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(e,r){W8(e)?lt(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?lt(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;spe(n,this.dataType,e,r),this._graphicEls[e]=r},t.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},t.prototype.eachItemGraphicEl=function(e,r){fe(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:jx(this.dimensions,this._getDimInfo,this),this.hostModel)),nme(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(dH(arguments)))})},t.internalField=function(){hft=function(e){var r=e._invertedIndicesMap;fe(r,function(n,i){var a=e._dimInfos[i],o=a.ordinalMeta,s=e._store;if(o){n=r[i]=new $$r(o.categories.length);for(var l=0;l1&&(l+="__ec__"+h),i[r]=l}}}(),t}();function V$r(t,e){return v5(t,e).dimensions}function v5(t,e){gge(t)||(t=vge(t)),e=e||{};var r=e.coordDimensions||[],n=e.dimensionsDefine||t.dimensionsDefine||[],i=qt(),a=[],o=Q$r(t,r,n,e.dimensionsCount),s=e.canOmitUnusedDimensions&&cft(o),l=n===t.dimensionsDefine,u=l?lft(t):rme(n),h=e.encodeDefine;!h&&e.encodeDefaulter&&(h=e.encodeDefaulter(t,o));for(var d=qt(h),f=new Oht(o),p=0;p0&&(k.name=k.name+(E-1))}),new oft({source:t,dimensions:a,fullDimensionCount:o,dimensionOmitted:s})}function Q$r(t,e,r,n){var i=Math.max(t.dimensionsDetectedCount||1,e.length,r.length,n||0);return fe(e,function(a){var o;yr(a)&&(o=a.dimsDef)&&(i=Math.max(i,o.length))}),i}function G$r(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 H$r=function(){function t(e){this.coordSysDims=[],this.axisMap=qt(),this.categoryAxisMap=qt(),this.coordSysName=e}return t}();function W$r(t){var e=t.get("coordinateSystem"),r=new H$r(e),n=Y$r[e];if(n)return n(t,r,r.axisMap,r.categoryAxisMap),r}var Y$r={cartesian2d:function(t,e,r,n){var i=t.getReferringComponents("xAxis",xo).models[0],a=t.getReferringComponents("yAxis",xo).models[0];e.coordSysDims=["x","y"],r.set("x",i),r.set("y",a),y5(i)&&(n.set("x",i),e.firstCategoryDimIndex=0),y5(a)&&(n.set("y",a),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,r,n){var i=t.getReferringComponents("singleAxis",xo).models[0];e.coordSysDims=["single"],r.set("single",i),y5(i)&&(n.set("single",i),e.firstCategoryDimIndex=0)},polar:function(t,e,r,n){var i=t.getReferringComponents("polar",xo).models[0],a=i.findAxisModel("radiusAxis"),o=i.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],r.set("radius",a),r.set("angle",o),y5(a)&&(n.set("radius",a),e.firstCategoryDimIndex=0),y5(o)&&(n.set("angle",o),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")),o=e.coordSysDims=a.dimensions.slice();fe(a.parallelAxisIndex,function(s,l){var u=i.getComponent("parallelAxis",s),h=o[l];r.set(h,u),y5(u)&&(n.set(h,u),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})},matrix:function(t,e,r,n){var i=t.getReferringComponents("matrix",xo).models[0];e.coordSysDims=["x","y"];var a=i.getDimensionModel("x"),o=i.getDimensionModel("y");r.set("x",a),r.set("y",o),n.set("x",a),n.set("y",o)}};function y5(t){return t.get("type")==="category"}function dft(t,e,r){r=r||{};var n=r.byIndex,i=r.stackedCoordDimension,a,o,s;q$r(e)?a=e:(o=e.schema,a=o.dimensions,s=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(fe(a,function(w,A){$t(w)&&(a[A]=w={name:w}),g(w)||(p=!1)}),fe(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;fe(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};o?(s&&(b.storeDimIndex=s.ensureCalculationDimension(f,v),x.storeDimIndex=s.ensureCalculationDimension(d,v)),o.appendCalculationDimension(b),o.appendCalculationDimension(x)):(a.push(b),a.push(x))}return{stackedDimension:h&&h.name,stackedByDimension:u&&u.name,isStackedByIndex:n,stackedOverDimension:f,stackResultDimension:d}}function q$r(t){return!sft(t.schema)}function Ny(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function ame(t,e){return Ny(t,e)?t.getCalculationInfo("stackResultDimension"):e}function j$r(t,e){var r=t.get("coordinateSystem"),n=r5.get(r),i;return e&&e.coordSysDims&&(i=vt(e.coordSysDims,function(a){var o={name:a},s=e.axisMap.get(a);if(s){var l=s.get("type");o.type=pY(l)}return o})),i||(i=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),i}function X$r(t,e,r){var n,i;return r&&fe(t,function(a,o){var s=a.coordDim,l=r.categoryAxisMap.get(s);l&&(n==null&&(n=o),a.ordinalMeta=l.getOrdinalMeta(),e&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(i=!0)}),!i&&n!=null&&(t[n].otherDims.itemName=0),n}function jm(t,e,r){r=r||{};var n=e.getSourceManager(),i,a=!1;t?(a=!0,i=vge(t)):(i=n.getSource(),a=i.sourceFormat===Vd);var o=W$r(e),s=j$r(e,o),l=r.useEncodeDefaulter,u=ur(l)?l:l?Kr(Qut,s,e):null,h={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},d=v5(i,h),f=X$r(d.dimensions,r.createInvertedIndices,o),p=a?null:n.getSharedDataStore(d),g=dft(e,{schema:d,store:p}),m=new jc(d,e);m.setCalculationInfo(g);var v=f!=null&&K$r(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 K$r(t){if(t.sourceFormat===Vd){var e=Z$r(t.data||[]);return!ft(L_(e))}}function Z$r(t){for(var e=0;e=e[0]&&t<=e[1]},getExtent:function(){return this._extents[Vh].slice()},getExtentUnsafe:function(t){return this._extents[t]},setExtent:function(t,e){gft(this._extents,Vh,t,e)},setExtent2:function(t,e,r){var n=this._extents;n[t]||(n[t]=n[Vh].slice()),gft(n,t,e,r)},freeze:function(){}};function gft(t,e,r,n){cS(r,n)&&(t[e][0]=r,t[e][1]=n)}function mft(t){return bY(t)||b5(t)}function bY(t){return t.type==="interval"}function J8(t){return t.type==="time"}function b5(t){return t.type==="log"}function Xc(t){return t.type==="ordinal"}function iFr(t){var e=jH(t),r=nS(10,e),n=Im(t/r);return n?n===2?n=3:n===3?n=5:n*=2:n=1,Yn(n*r,-e)}function qS(t){return Pm(t)+2}function xY(t,e){return iS(t)/iS(e)}function ume(t,e,r){var n=r&&r.lookup;if(n){for(var i=0;i1&&a/o>2&&(i=Math.round(Math.ceil(i/o)*o)),i!==n[0]&&l(n[0],!0,!0);for(var s=i;s<=n[1];s+=o)l(s,!1,s===n[0]||s===n[1]);s-o!==n[1]&&l(n[1],!0,!0);function l(u,h,d){r({value:u,offInterval:h},d)}}var eB=function(t){nt(e,t);function e(r){var n=t.call(this)||this;n.type="ordinal",n.parse=e.parse,sme(n,e.decoratedMethods);var i=r.ordinalMeta;i||(i=new X8({})),ft(i)&&(i=new X8({categories:vt(i,function(o){return yr(o)?o.value:o})})),n._ordinalMeta=i;var a=ome(null,null,r.extent||[0,i.categories.length-1]);return n._mapper=a.mapper,lme(n),n}return e.parse=function(r){return r==null?r=NaN:$t(r)?(r=this._ordinalMeta.getOrdinal(r),r==null&&(r=NaN)):r=Im(r),r},e.prototype.getTicks=function(){var r=[];return yft(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=[],o=0,s=this._ordinalMeta.categories.length,l=Oi(s,n.length);o=0&&r=0&&r=0&&ro[0]&&mo[1]||!isFinite(m)||!isFinite(o[1]))break}else{if(v>g)break;m=Oi(m,o[1]),v===g&&(m=o[1])}if(d.push({value:m}),m=Yn(m+i,s),u){var y=u.calcNiceTickMultiple(m,p);y>=0&&(m=Yn(m+y*i,s))}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:o[1];return a[1]>b&&d.push({value:r.expandToNicedExtent?Yn(b+i,s):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 hme(this,r,LW(this),this._cfg.interval)},e.prototype.getLabel=function(r,n){if(r==null)return"";var i=n&&n.precision;i==null?i=Pm(r.value)||0:i==="auto"&&(i=this._cfg.intervalPrecision);var a=Yn(r.value,i,!0);return ege(a)},e.type="interval",e}(mg);mg.registerClass(Xx);var oFr=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 lFr(t){var e=30*ap;return t/=e,t>6?6:t>3?3:t>2?2:1}function cFr(t){return t/=_8,t>12?12:t>6?6:t>3.5?4:t>2?2:1}function wft(t,e){return t/=e?Ype:Wpe,t>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function uFr(t){return rn(XH(t,!0),1)}function hFr(t,e,r){var n=Math.max(0,Nr(Hd,e)-1);return NW(new Date(t),Hd[n],r).getTime()}function dFr(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,o){return Math.max(0,Math.round((o-a)/i))}}function fFr(t,e,r,n,i,a){var o=3e3,s=_8r,l=0;function u(M,I,N,F,B,V,z){for(var U=dFr(B,M),Q=I,G=new Date(Q);Qo));)if(G[B](G[F]()+M),Q=G.getTime(),a){var q=a.calcNiceTickMultiple(Q,U);q>0&&(G[B](G[F]()+q*M),Q=G.getTime())}z.push({value:Q,notAdd:Q>n[1]})}function h(M,I,N){var F=[],B=!I.length;if(!xft(R8(M),n[0],n[1],r)){B&&(I=[{value:hFr(n[0],M,r)},{value:n[1]}]);for(var V=0;V=n[0]&&z<=n[1]&&u(Q,z,U,G,q,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===s[m]))break}f=[]}}}for(var S=oi(vt(d,function(M){return oi(M,function(I){return I.value>=n[0]&&I.value<=n[1]&&!I.notAdd})}),function(M){return M.length>0}),T=S.length-1,C=[],m=0;mn[0])&&C.unshift({value:n[0],time:{level:0,upperTimeUnit:R,lowerTimeUnit:R},notNice:!0}),(!L||L.values&&(a=s);var l=AY.length,u=Math.min(oFr(AY,a,0,l),l-1),h=AY[u][1],d=AY[Math.max(u-1,0)][0];t.setTimeInterval({approxInterval:a,interval:h,minLevelUnit:d})};mg.registerClass(bft);var SY=0,TY=1,gFr=2,Aft=function(t){nt(e,t);function e(r){var n=t.call(this)||this;n.type="log",n.parse=Xx.parse,n.base=r.logBase||10;var i=[],a=[],o=n._lookup={from:i,to:a};i[SY]=i[TY]=a[SY]=a[TY]=NaN,sme(n,e.mapperMethods);var s=Ho(),l=r.breakOption,u={lookup:o};return s&&s.parseAxisBreakOptionInwardTransform(l,n,{noNegative:!0},gFr,u),n.powStub=new Xx({breakParsed:u.original}),n.intervalStub=new Xx({breakParsed:u.transformed}),lme(n,n.intervalStub),n}return e.prototype.getTicks=function(r){var n=this.base,i=this.powStub,a=Ho(),o=this.intervalStub,s=o.getExtent(),l=i.getExtent(),u={lookup:{from:s,to:l}};return vt(o.getTicks(r||{}),function(h){var d=h.value,f=ume(d,n,u),p;if(a){var g=a.getTicksBreakOutwardTransform(this,h,LW(i),this._lookup);g&&(p=g.vBreak,f=g.tickVal)}return{value:f,break:p}},this)},e.prototype.getMinorTicks=function(r){return hme(this,r,LW(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(xY(r,this.base))},scale:function(r){return ume(this.intervalStub.scale(r),this.base,null)},transformIn:function(r,n){return r=xY(r,this.base),n&&n.depth===By?r:this.intervalStub.transformIn(r,n)},transformOut:function(r,n){var i=n?n.depth:null;return Sft.depth=i,Tft.lookup=this._lookup,ume(i===By?r:this.intervalStub.transformOut(r,Sft),this.base,Tft)},contain:function(r){return this.powStub.contain(r)},setExtent:function(r,n){this.setExtent2(Vh,r,n)},setExtent2:function(r,n,i){if(!(!cS(n,i)||n<=0||i<=0)){var a=Cft,o=Cft;if(r===Vh){var s=this._lookup;a=s.to,o=s.from}this.powStub.setExtent2(r,a[SY]=n,a[TY]=i);var l=this.base;this.intervalStub.setExtent2(r,o[SY]=xY(n,l),o[TY]=xY(i,l))}},getFilter:function(){return{g:0}},sanitize:function(r,n){return cS(n[0],n[1])&&ep(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}(mg);mg.registerClass(Aft);var Sft={},Tft={},Cft=[],Oft={value:1,category:1,time:1,log:1},kft=Gr();function tB(t){var e=t.get("type");return(e==null||!Kt(Oft,e)&&!mg.getClass(e))&&(e="value"),e}function x5(t,e,r){var n=Ho(),i;switch(n&&(i=Eft(t,e,r)),e){case"category":return new eB({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:dc()});case"time":return new bft({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC"),breakOption:i});case"log":return new Aft({logBase:t.get("logBase"),breakOption:i});case"value":return new Xx({breakOption:i});default:return new(mg.getClass(e)||Xx)({})}}function mFr(t,e,r){var n=t.getExtentUnsafe(Vh,null),i=n[0],a=n[1];return cS(i,a)?i===e||a===e?yFr:ie?vFr:dme:dme}var vFr=1,yFr=2,dme=3;function bFr(t){kft(t).noOnMyZero=!0}function xFr(t){return kft(t).noOnMyZero}function rB(t){var e=t.getLabelModel().get("formatter");if(t.type==="time"){var r=R8r(e);return function(i,a){return t.scale.getFormattedLabel(i,a,r)}}else{if($t(e))return function(i){var a=t.scale.getLabel(i),o=e.replace("{value}",a??"");return o};if(ur(e)){if(t.type==="category")return function(i,a){return e(CY(t,i),i.value-t.scale.getExtent()[0],null)};var n=Ho();return function(i,a){var o=null;return n&&(o=n.makeAxisLabelFormatterParamBreak(o,i.break)),e(CY(t,i),a,o)}}else return function(i){return t.scale.getLabel(i)}}}function CY(t,e){var r=t.scale;return Xc(r)?r.getLabel(e):e.value}function fme(t){var e=t.get("interval");return e??"auto"}function wFr(t){return t.type==="category"&&fme(t.getLabelModel())===0}function AFr(t,e){var r={};return fe(t.mapDimensionsAll(e),function(n){r[ame(t,n)]=!0}),En(r)}function w5(t){return t==="middle"||t==="center"}function nB(t){return t.getShallow("show")}function Eft(t,e,r){var n=t.get("breaks",!0);if(n!=null)return!Ho()||!r||!SFr(e)?void 0:n}function SFr(t){return t!=="category"}function _ft(t,e,r,n,i,a){var o=b5(t),s=o?t.intervalStub:t;if(s.setExtent(n[0],n[1]),o){var l=t.powStub,u={depth:By},h=t.transformOut(n[0],u),d=t.transformOut(n[1],u),f=aFr(r,n);e[0]&&!f[0]&&(h=i[0]),e[1]&&!f[1]&&(d=i[1]),l.setExtent(h,d)}s.setConfig(a)}function A5(t,e){return Xc(t)?t.getRawOrdinalNumber(e.value):e.value}function iB(t,e){return Xc(t)&&!!e.get("boundaryGap")}var S5=function(){function t(){}return t.prototype.needIncludeZero=function(){return!this.option.scale},t.prototype.getCoordSysModel=function(){},t}(),TFr=P_(),OY="|&",T5=Gr(),Rft=-2,CFr=-1,OFr=Gr();function pme(t,e){var r=t.model,n=T5(c5(r.ecModel)).keyed,i=n&&n.get(e);return i&&i.get(r.uid)}function kFr(t,e){return Lft(pme(t,e))}function EFr(t,e){var r=[];return Dft(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=aB(e,r.get("startValue",!0)),S=A!=null;!ep(A)&&i&&(A=e.getDefaultStartValue?e.getDefaultStartValue():0),ep(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};Nft(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,o={fixMM:a,zoomFixMM:i,isBlank:e.isBlank,incl0:e.incl0,tggAxInv:e.tggAxInv,ctnShp:e.ctnShp,effMM:n.slice()},s=o.effMM;return r[0]!=null&&(s[0]=r[0],a[0]=i[0]=!0),r[1]!=null&&(s[1]=r[1],a[1]=i[1]=!0),Nft(e,s),o},t.prototype.makeRenderInfo=function(){return{startValue:this._i.startValue}},t.prototype.setZoomMM=function(e,r){this._i.zoomMM[e]=r},t}();function Nft(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),ZH(e))}function aB(t,e){return e==null?null:cc(e)?NaN:t.parse(e)}function NFr(t,e){var r;if(Xc(t))r=[0,0];else{var n=e.get("boundaryGap");typeof n=="boolean"&&(n=null),r=ft(n)?n:[n,n]}return[Bft(r[0]),Bft(r[1])]}function Bft(t){return Mm(typeof t=="boolean"?0:t,1)||0}function $ft(t){var e=MFr(t.scale);return e.extent||(e.extent=dc()),e}function BFr(t,e){$ft(t).dimIdxInCoord=e.get(t.dim)}function KS(t,e){var r=t.scale,n=t.model,i=t.dim;r.rawExtentInfo||$Fr(r,t,i,n,e)}function $Fr(t,e,r,n,i){var a=$ft(e),o=a.extent,s=!1;_Fr(e,function(h){if(h.boxCoordinateSystem){var d=_ut(h).coord,f=a.dimIdxInCoord;if(f>=0){if(ft(d)){var p=d[f];p!=null&&!ft(p)&&Ufe(o,t.parse(p))}}}else if(h.coordinateSystem){var g=h.getData();if(g){var m=t.getFilter?t.getFilter():null;fe(AFr(g,r),function(v){g6r(o,g.getApproximateExtent(v,m))})}h.__requireStartValue&&h.__requireStartValue(e)&&(s=!0)}});var l=zFr(t,e,n),u=new Pft(t,n,o,s,l);Fft(t,u,i),a.extent=null}function FFr(t,e){var r=t.scale;Fft(r,new Pft(r,t.model,e,!1,!1),PFr)}function Fft(t,e,r){t.rawExtentInfo=e,e.from=r}function EY(t,e){bme.set(t,e)}var bme=qt();function zft(t,e,r,n,i){t.rawExtentInfo||FFr({scale:t,model:e},i||dc());var a=t.rawExtentInfo.makeFinal(),o=a.effMM;return t.setExtent(o[0],o[1]),t.setBlank(a.isBlank),n&&a.tggAxInv&&r&&!r.get("legacyMinMaxDontInverseAxis")&&(n.inverse=!n.inverse),a}function zFr(t,e,r){var n=iB(t,r),i=r.get("containShape",!0);if(i==null&&!n&&(i=!0),!i)return!1;var a=!1;return Mft(e,function(o){a=!!bme.get(o)||a}),a}function UFr(t,e,r,n){if(r.ctnShp){var i;if(Mft(t,function(s){var l=bme.get(s);if(l){var u=l(t,n);u&&(i=i||[0,0],Olt(i,u[0]),klt(i,u[1]),bFr(t))}}),!!i){var a=e.getExtent();if(Xc(e))t.onBand||e.setExtent2(K8,Oi(a[0],a[0]+i[0]),rn(a[1],a[1]+i[1]));else{var o=a.slice();r.zoomFixMM[0]||(o[0]=Oi(o[0],e.transformOut(e.transformIn(o[0],null)+i[0],null))),r.zoomFixMM[1]||(o[1]=rn(o[1],e.transformOut(e.transformIn(o[1],null)+i[1],null))),(o[0]a[1])&&e.setExtent2(K8,o[0],o[1])}}}}function Uft(t,e){var r=b5(t),n=r?t.intervalStub:t,i=e.fixMinMax||[],a=r?t.getExtent():null,o=n.getExtent(),s=vft(o,i,e.rawExtentResult);n.setExtent(s[0],s[1]),s=n.getExtent();var l=r?QFr(n,e):VFr(n,e),u=l.intervalPrecision,h=l.interval,d=e.userInterval;d!=null&&(l.interval=d,l.intervalPrecision=qS(d)),i[0]||(s[0]=Yn(Jf(s[0]/h)*h,u)),i[1]||(s[1]=Yn(rS(s[1]/h)*h,u)),d!=null&&(l.niceExtent=s.slice()),_ft(t,i,o,s,a,l)}function VFr(t,e){var r=wY(e.splitNumber,5),n=yY(t),i=e.minInterval,a=e.maxInterval,o=XH(n/r,!0);i!=null&&oa&&(o=a);var s=qS(o),l=t.getExtent(),u=[Yn(rS(l[0]/o)*o,s),Yn(Jf(l[1]/o)*o,s)];return{interval:o,intervalPrecision:s,niceExtent:u}}function QFr(t,e){var r=wY(e.splitNumber,10),n=t.getExtent(),i=yY(t),a=rn(Lfe(i),1),o=r/i*a;o<=.5&&(a*=10);var s=qS(a),l=[Yn(rS(n[0]/a)*a,s),Yn(Jf(n[1]/a)*a,s)];return{intervalPrecision:s,interval:a,niceExtent:l}}function O5(t){var e=t.scale,r=t.model,n=r.axis,i=r.ecModel;Vft(e,r,n,i,null)}function Vft(t,e,r,n,i){var a=zft(t,e,n,r,i),o=bY(t)||J8(t);Qft(t,{splitNumber:e.get("splitNumber"),fixMinMax:a.fixMM,userInterval:e.get("interval"),minInterval:o?e.get("minInterval"):null,maxInterval:o?e.get("maxInterval"):null,rawExtentResult:a}),r&&n&&UFr(r,t,a,n)}function Qft(t,e){GFr[t.type](t,e)}var GFr={interval:Uft,log:Uft,time:pFr,ordinal:no};function HFr(t){return jm(null,t)}var WFr={isDimensionStacked:Ny,enableDataStack:dft,getStackedDimension:ame};function YFr(t,e){var r=e;e instanceof bn||(r=new bn(e));var n=tB(r),i=x5(r,n,!1);return t[1]i&&(n=o,i=l)}if(n)return JFr(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],o=this.geometries;return fe(o,function(s){s.type==="polygon"?Hft(s.exterior,i,a,r):fe(s.points,function(l){Hft(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 pr(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,o=i.length;a>1^-(s&1),l=l>>1^-(l&1),s+=i,l+=a,i=s,a=l,n.push([s/r,l/r])}return n}function Ame(t,e){return t=t9r(t),vt(oi(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 o=i.coordinates;a.push(new Yft(o[0],o.slice(1)));break;case"MultiPolygon":fe(i.coordinates,function(l){l[0]&&a.push(new Yft(l[0],l.slice(1)))});break;case"LineString":a.push(new qft([i.coordinates]));break;case"MultiLineString":a.push(new qft(i.coordinates))}var s=new jft(n[e||"name"],a,n.cp);return s.properties=n,s})}const r9r=Object.freeze(Object.defineProperty({__proto__:null,MAX_SAFE_INTEGER:c8,asc:Rl,getPercentWithPrecision:jPr,getPixelPrecision:qPr,getPrecision:Pm,getPrecisionSafe:dlt,isNumeric:Ife,isRadianAroundZero:oS,linearMap:Zn,nice:XH,numericToNumber:Bm,parseDate:Nm,parsePercent:Qt,quantile:KH,quantity:Lfe,quantityExponent:jH,reformIntervals:Mfe,remRadian:Dfe,round:YPr},Symbol.toStringTag,{value:"Module"})),n9r=Object.freeze(Object.defineProperty({__proto__:null,format:D8,parse:Nm,roundTime:NW},Symbol.toStringTag,{value:"Module"})),i9r=Object.freeze(Object.defineProperty({__proto__:null,Arc:A8,BezierCurve:G_,BoundingRect:pr,Circle:Wm,CompoundPath:S8,Ellipse:b8,Group:gr,Image:nl,IncrementalDisplayable:Gct,Line:Go,LinearGradient:TS,Polygon:pc,Polyline:Ll,RadialGradient:Tpe,Rect:nn,Ring:Q_,Sector:fc,Text:$n,clipPointsByRect:Rpe,clipRectByRect:Jct,createIcon:X_,extendPath:Xct,extendShape:jct,getShapeClass:T8,getTransform:kS,initProps:ua,makeImage:Epe,makePath:q_,mergePath:Gd,registerShape:ip,resizePath:_pe,updateProps:qn},Symbol.toStringTag,{value:"Module"})),a9r=Object.freeze(Object.defineProperty({__proto__:null,addCommas:ege,capitalFirst:$8r,encodeHTML:Hc,formatTime:B8r,formatTpl:ige,getTextRect:N8r,getTooltipMarker:Out,normalizeCssArray:t5,toCamelCase:tge,truncateText:L6r},Symbol.toStringTag,{value:"Module"})),o9r=Object.freeze(Object.defineProperty({__proto__:null,bind:Wt,clone:lr,curry:Kr,defaults:mr,each:fe,extend:lt,filter:oi,indexOf:Nr,inherits:Dde,isArray:ft,isFunction:ur,isObject:yr,isString:$t,map:vt,merge:Qr,reduce:Yf},Symbol.toStringTag,{value:"Module"}));var s9r=Gr(),oB=Gr(),vg={estimate:1,determine:2};function _Y(t){return{out:{noPxChangeTryDetermine:[]},kind:t}}function l9r(t,e){var r=t.getLabelModel().get("customValues");if(r){var n=t.scale;return{labels:vt(Kft(r,n),function(i,a){return{formattedLabel:rB(t)(i,a),rawLabel:n.getLabel(i),tick:i}})}}return t.type==="category"?u9r(t,e):d9r(t)}function c9r(t,e,r){var n=t.scale,i=t.getTickModel().get("customValues");return i?{ticks:Kft(i,n)}:t.type==="category"?h9r(t,e):{ticks:n.getTicks(r)}}function Kft(t,e){var r=e.getExtent(),n=[];return fe(t,function(i){i=e.parse(i),i>=r[0]&&i<=r[1]&&n.push(i)}),JH(n,b6r,null),Rl(n),vt(n,function(i){return{value:i}})}function u9r(t,e){var r=t.getLabelModel(),n=Zft(t,r,e);return!r.get("show")||t.scale.isBlank()?{labels:[]}:n}function Zft(t,e,r){var n=p9r(t),i=fme(e),a=r.kind===vg.estimate;if(!a){var o=ept(n,i);if(o)return o}var s,l;ur(i)?s=RY(t,i,!1):(l=i==="auto"?g9r(t,r):i,s=RY(t,l,!1));var u={labels:s,labelCategoryInterval:l};return a?r.out.noPxChangeTryDetermine.push(function(){return Sme(n,i,u),!0}):Sme(n,i,u),u}function h9r(t,e){var r=f9r(t),n=fme(e),i=ept(r,n);if(i)return i;var a,o;if((!e.get("show")||t.scale.isBlank())&&(a=[]),ur(n))a=RY(t,n,!0);else if(n==="auto"){var s=Zft(t,t.getLabelModel(),_Y(vg.determine));o=s.labelCategoryInterval,a=vt(s.labels,function(l){return l.tick})}else o=n,a=RY(t,o,!0);return Sme(r,n,{ticks:a,tickCategoryInterval:o})}function d9r(t){var e=t.scale.getTicks(),r=rB(t);return{labels:vt(e,function(n,i){return{formattedLabel:r(n,i),rawLabel:t.scale.getLabel(n),tick:n}})}}var f9r=Jft("axisTick"),p9r=Jft("axisLabel");function Jft(t){return function(r){return oB(r)[t]||(oB(r)[t]={list:[]})}}function ept(t,e){for(var r=0;rh&&(u=Math.max(1,Math.floor(l/h)));for(var d=s[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<=s[1];d+=u){var y=0,b=0,x=FH(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===vg.estimate)return e.out.noPxChangeTryDetermine.push(Wt(v9r,null,t,S,l)),S;var T=tpt(t,S,l);return T??S}function v9r(t,e,r){return tpt(t,e,r)==null}function tpt(t,e,r){var n=s9r(t.model),i=t.getExtent(),a=n.lastAutoInterval,o=n.lastTickCount;if(a!=null&&o!=null&&Math.abs(a-e)<=1&&Math.abs(o-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 y9r(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 RY(t,e,r){var n=rB(t),i=t.scale,a=[],o=ur(e);return yft(i,o?0:e,function(s,l){var u=i.getLabel(s);if(o){var h=!!e(s.value,u);if(s.offInterval=!h,!h&&!l)return}a.push(r?s:{formattedLabel:n(s),rawLabel:u,tick:s})}),a}var b9r=.8;function mc(t,e){e=e||{};var r={w:NaN,w2:NaN},n=t.scale,i=e.fromStat,a=e.min,o=rFr(n);ep(o)||(o=NaN);var s=t.getExtent(),l=ao(s[1]-s[0]);return Xc(n)?x9r(r,t,o,l):i&&w9r(r,t,o,l,i),a!=null&&(r.w=ep(r.w)?rn(a,r.w):a),r}function x9r(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 w9r(t,e,r,n,i){var a=!1,o=-1/0;fe(i.key?[kFr(e,i.key)]:EFr(e,i.sers||[]),function(s){var l=s.liPosMinGap;l!=null&&(l>0?(l>o&&(o=l),a=!1):l===Rft&&(a=!0))}),ep(r)&&r>0&&ep(o)?(t.w=n/r*o,t.w2=o):a&&(t.w=n*b9r,t.w2=t.w*r/n)}var rpt=[0,1],cp=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)),Zn(e,rpt,npt(this),r)},t.prototype.coordToData=function(e,r){var n=Zn(e,npt(this),rpt,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=c9r(this,r,{breakTicks:e.breakTicks,pruneByBreak:e.pruneByBreak}),i=vt(n.ticks,function(s){return{coord:this.dataToCoord(A5(this.scale,s)),tick:s}},this),a=r.get("alignWithLabel"),o=A9r(this,i,a);return vt(i,function(s){return{coord:s.coord,tickValue:s.tick.value,onBand:o}})},t.prototype.getMinorTicksCoords=function(){if(Xc(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(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return i},t.prototype.getViewLabels=function(e){return e=e||_Y(vg.determine),l9r(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 mc(this,{min:1}).w},t.prototype.calculateCategoryInterval=function(e){return e=e||_Y(vg.determine),m9r(this,e)},t}();function npt(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 A9r(t,e,r){var n=e.length;if(!t.onBand||r||!n)return!1;var i=mc(t).w;if(!i)return!1;fe(e,function(s){s.coord-=i/2});var a=t.scale.getExtent(),o=e[n-1];return o.tick.offInterval&&e.pop(),e.push({coord:o.coord+i,tick:{value:a[1]+1}}),!0}function S9r(t){var e=pn.extend(t);return pn.registerClass(e),e}function T9r(t){var e=Xi.extend(t);return Xi.registerClass(e),e}function C9r(t){var e=Ii.extend(t);return Ii.registerClass(e),e}function O9r(t){var e=ki.extend(t);return ki.registerClass(e),e}var sB=Math.PI*2,JS=Qm.CMD,k9r=["top","right","bottom","left"];function E9r(t,e,r,n,i){var a=r.width,o=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+o+e),i.set(0,1);break;case"left":n.set(r.x-e,r.y+o/2),i.set(-1,0);break;case"right":n.set(r.x+a+e,r.y+o/2),i.set(1,0);break}}function _9r(t,e,r,n,i,a,o,s,l){o-=t,s-=e;var u=Math.sqrt(o*o+s*s);o/=u,s/=u;var h=o*r+t,d=s*r+e;if(Math.abs(n-i)%sB<1e-4)return l[0]=h,l[1]=d,u-r;if(a){var f=n;n=zd(i),i=zd(f)}else n=zd(n),i=zd(i);n>i&&(i+=sB);var p=Math.atan2(s,o);if(p<0&&(p+=sB),p>=n&&p<=i||p+sB>=n&&p+sB<=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-o)*(g-o)+(m-s)*(m-s),x=(v-o)*(v-o)+(y-s)*(y-s);return b0){e=e/180*Math.PI,bg.fromArray(t[0]),ha.fromArray(t[1]),qo.fromArray(t[2]),wr.sub(Xm,bg,ha),wr.sub(Km,qo,ha);var r=Xm.len(),n=Km.len();if(!(r<.001||n<.001)){Xm.scale(1/r),Km.scale(1/n);var i=Xm.dot(Km),a=Math.cos(e);if(a1&&wr.copy(Pu,qo),Pu.toArray(t[1])}}}}function L9r(t,e,r){if(r<=180&&r>0){r=r/180*Math.PI,bg.fromArray(t[0]),ha.fromArray(t[1]),qo.fromArray(t[2]),wr.sub(Xm,ha,bg),wr.sub(Km,qo,ha);var n=Xm.len(),i=Km.len();if(!(n<.001||i<.001)){Xm.scale(1/n),Km.scale(1/i);var a=Xm.dot(e),o=Math.cos(r);if(a=l)wr.copy(Pu,qo);else{Pu.scaleAndAdd(Km,s/Math.tan(Math.PI/2-h));var d=qo.x!==ha.x?(Pu.x-ha.x)/(qo.x-ha.x):(Pu.y-ha.y)/(qo.y-ha.y);if(isNaN(d))return;d<0?wr.copy(Pu,ha):d>1&&wr.copy(Pu,qo)}Pu.toArray(t[1])}}}}function Tme(t,e,r,n){var i=r==="normal",a=i?t:t.ensureState(r);a.ignore=e;var o=n.get("smooth");o=o===!0?.3:Math.max(+o,0)||0,a.shape=a.shape||{},a.shape.smooth=o;var s=n.getModel("lineStyle").getLineStyle();i?t.useStyle(s):a.style=s}function M9r(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=my(n[0],n[1]),a=my(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 o=Math.min(i,a)*r,s=HN([],n[1],n[0],o/i),l=HN([],n[1],n[2],o/a),u=HN([],s,l,.5);t.bezierCurveTo(s[0],s[1],s[0],s[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,C,k){T!==0&&(h=!0);for(var E=C;E0)for(var _=0;_0;_--){var D=k[_-1]*R;w(-D,_,a)}}}function S(T){var C=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 N9r(t){for(var e=0;e=0&&n.attr(a.oldLayoutSelect),Nr(f,"emphasis")>=0&&n.attr(a.oldLayoutEmphasis)),qn(n,u,r,l)}else if(n.attr(u),!K_(n).valueAnimation){var d=Jt(n.style.opacity,1);n.style.opacity=0,ua(n,{style:{opacity:d}},r,l)}if(a.oldLayout=u,n.states.select){var p=a.oldLayoutSelect={};NY(p,u,BY),NY(p,n.states.select,BY)}if(n.states.emphasis){var g=a.oldLayoutEmphasis={};NY(g,u,BY),NY(g,n.states.emphasis,BY)}uut(n,l,h,r,r)}if(i&&!i.ignore&&!i.invisible){var a=F9r(i),o=a.oldLayout,m={points:i.shape.points};o?(i.attr({shape:o}),qn(i,{shape:m},r)):(i.setShape(m),i.style.strokePercent=0,ua(i,{style:{strokePercent:1}},r)),a.oldLayout=m}},t}(),Lme=Gr();function U9r(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){var i=Lme(r).labelManager;i||(i=Lme(r).labelManager=new z9r),i.clearLabels()}),t.registerUpdateLifecycle("series:layoutlabels",function(e,r,n){var i=Lme(r).labelManager;fe(n.updatedSeries,function(a){i.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),i.updateLayoutConfig(r),i.layout(r),i.processLabelsOverall()})}var Mme=Math.sin,Ime=Math.cos,ppt=Math.PI,eT=Math.PI*2,V9r=180/ppt,gpt=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,o){this._add("C",e,r,n,i,a,o)},t.prototype.quadraticCurveTo=function(e,r,n,i){this._add("Q",e,r,n,i)},t.prototype.arc=function(e,r,n,i,a,o){this.ellipse(e,r,n,n,0,i,a,o)},t.prototype.ellipse=function(e,r,n,i,a,o,s,l){var u=s-o,h=!l,d=Math.abs(u),f=Ix(d-eT)||(h?u>=eT:-u>=eT),p=u>0?u%eT:u%eT+eT,g=!1;f?g=!0:Ix(d)?g=!1:g=p>=ppt==!!h;var m=e+n*Ime(o),v=r+i*Mme(o);this._start&&this._add("M",m,v);var y=Math.round(a*V9r);if(f){var b=1/this._p,x=(h?1:-1)*(eT-b);this._add("A",n,i,y,1,+h,e+n*Ime(o+x),r+i*Mme(o+x)),b>.01&&this._add("A",n,i,y,0,+h,m,v)}else{var w=e+n*Ime(s),A=r+i*Mme(s);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,o,s,l,u){for(var h=[],d=this._p,f=1;f"}function K9r(t){return""}function Bme(t,e){e=e||{};var r=e.newline?` -`:"";function n(i){var a=i.children,o=i.tag,s=i.attrs,l=i.text;return X9r(o,s)+(o!=="style"?Hc(l):l||"")+(a?""+r+vt(a,function(u){return n(u)}).join(r)+r:"")+K9r(o)}return n(t)}function Z9r(t,e,r){r=r||{};var n=r.newline?` -`:"",i=" {"+n,a=n+"}",o=vt(En(t),function(l){return l+i+vt(En(t[l]),function(u){return u+":"+t[l][u]+";"}).join(n)+a}).join(n),s=vt(En(e),function(l){return"@keyframes "+l+i+vt(En(e[l]),function(u){return u+i+vt(En(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!o&&!s?"":[""].join(n)}function $me(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function xpt(t,e,r,n){return al("svg","root",{width:t,height:e,xmlns:mpt,"xmlns:xlink":vpt,version:"1.1",baseProfile:"full",viewBox:n?"0 0 "+t+" "+e:!1},r)}var J9r=0;function wpt(){return J9r++}var Apt={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"},tT="transform-origin";function ezr(t,e,r){var n=lt({},t.shape);lt(n,e),t.buildPath(r,n);var i=new gpt;return i.reset(Ust(t)),r.rebuildPath(i,1),i.generateStr(),i.getStr()}function tzr(t,e){var r=e.originX,n=e.originY;(r||n)&&(t[tT]=r+"px "+n+"px")}var rzr={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function Spt(t,e){var r=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[r]=t,r}function nzr(t,e,r){var n=t.shape.paths,i={},a,o;if(fe(n,function(l){var u=$me(r.zrId);u.animation=!0,$Y(l,{},u,!0);var h=u.cssAnims,d=u.cssNodes,f=En(h),p=f.length;if(p){o=f[p-1];var g=h[o];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(o)>=0&&(a=b)}}}),!!a){e.d=!1;var s=Spt(i,r);return a.replace(o,s)}}function Tpt(t){return $t(t)?Apt[t]?"cubic-bezier("+Apt[t]+")":efe(t)?t:"":""}function $Y(t,e,r,n){var i=t.animators,a=i.length,o=[];if(t instanceof S8){var s=nzr(t,e,r);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var Y=Spt(T,r);return Y+" "+b[0]+" both"}}for(var v in l){var s=m(l[v]);s&&o.push(s)}if(o.length){var y=r.zrId+"-cls-"+wpt();r.cssNodes["."+y]={animation:o.join(",")},e.class=y}}function izr(t,e,r){if(!t.ignore)if(t.isSilent()){var n={"pointer-events":"none"};Cpt(n,e,r)}else{var i=t.states.emphasis&&t.states.emphasis.style?t.states.emphasis.style:{},a=i.fill;if(!a){var o=t.style&&t.style.fill,s=t.states.select&&t.states.select.style&&t.states.select.style.fill,l=t.currentStates.indexOf("select")>=0&&s||o;l&&(a=kH(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),Cpt(n,e,r)}}function Cpt(t,e,r,n){var i=JSON.stringify(t),a=r.cssStyleCache[i];a||(a=r.zrId+"-cls-"+wpt(),r.cssStyleCache[i]=a,r.cssNodes["."+a+":hover"]=t),e.class=e.class?e.class+" "+a:a}var lB=Math.round;function Opt(t){return t&&$t(t.src)}function kpt(t){return t&&ur(t.toDataURL)}function Fme(t,e,r,n){Y9r(function(i,a){var o=i==="fill"||i==="stroke";o&&zst(a)?Mpt(e,t,i,n):o&&ofe(a)?Ipt(r,t,i,n):t[i]=a,o&&n.ssr&&a==="none"&&(t["pointer-events"]="visible")},e,r,!1),hzr(r,t,n)}function zme(t,e){var r=llt(e);r&&(r.each(function(n,i){n!=null&&(t[(ypt+i).toLowerCase()]=n+"")}),e.isSilent()&&(t[ypt+"silent"]="true"))}function Ept(t){return Ix(t[0]-1)&&Ix(t[1])&&Ix(t[2])&&Ix(t[3]-1)}function azr(t){return Ix(t[4])&&Ix(t[5])}function Ume(t,e,r){if(e&&!(azr(e)&&Ept(e))){var n=1e4;t.transform=Ept(e)?"translate("+lB(e[4]*n)/n+" "+lB(e[5]*n)/n+")":oPr(e)}}function _pt(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.";uc(f,v),uc(p,v)}else if(f==null||p==null){var y=function(E,_){if(E){var P=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,P&&(P.setAttribute("width",L),P.setAttribute("height",R))}},b=Gfe(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=al("image","img",{href:g,width:f,height:p}),o.width=f,o.height=p}else i.svgElement&&(d=lr(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(d){var x,w;l?x=w=1:u?(w=1,x=o.width/a.width):h?(x=1,w=o.height/a.height):o.patternUnits="userSpaceOnUse",x!=null&&!isNaN(x)&&(o.width=x),w!=null&&!isNaN(w)&&(o.height=w);var A=Vst(i);A&&(o.patternTransform=A);var S=al("pattern","",o,[d]),T=Bme(S),C=n.patternCache,k=C[T];k||(k=n.zrId+"-p"+n.patternIdx++,C[T]=k,o.id=k,S=n.defs[k]=al("pattern",k,o,[d])),e[r]=RH(k)}}function dzr(t,e,r){var n=r.clipPathCache,i=r.defs,a=n[t.id];if(!a){a=r.zrId+"-c"+r.clipPathIdx++;var o={id:a};n[t.id]=a,i[a]=al("clipPath",a,o,[Dpt(t,r)])}e["clip-path"]=RH(a)}function Ppt(t){return document.createTextNode(t)}function rT(t,e,r){t.insertBefore(e,r)}function Npt(t,e){t.removeChild(e)}function Bpt(t,e){t.appendChild(e)}function $pt(t){return t.parentNode}function Fpt(t){return t.nextSibling}function Vme(t,e){t.textContent=e}var zpt=58,fzr=120,pzr=al("","");function Qme(t){return t===void 0}function Jm(t){return t!==void 0}function gzr(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 cB(t,e){var r=t.key===e.key,n=t.tag===e.tag;return n&&r}function uB(t){var e,r=t.children,n=t.tag;if(Jm(n)){var i=t.elm=bpt(n);if(Gme(pzr,t),ft(r))for(e=0;ea?(g=r[l+1]==null?null:r[l+1].elm,Upt(t,g,r,i,l)):FY(t,e,n,a))}function k5(t,e){var r=e.elm=t.elm,n=t.children,i=e.children;t!==e&&(Gme(t,e),Qme(e.text)?Jm(n)&&Jm(i)?n!==i&&mzr(r,n,i):Jm(i)?(Jm(t.text)&&Vme(r,""),Upt(r,null,i,0,i.length-1)):Jm(n)?FY(r,n,0,n.length-1):Jm(t.text)&&Vme(r,""):t.text!==e.text&&(Jm(n)&&FY(r,n,0,n.length-1),Vme(r,e.text)))}function vzr(t,e){if(cB(t,e))k5(t,e);else{var r=t.elm,n=$pt(r);uB(e),n!==null&&(rT(n,e.elm,Fpt(r)),FY(n,[t],0,0))}return e}var yzr=0,bzr=function(){function t(e,r,n){if(this.type="svg",this.configLayer=xzr(),this.storage=r,this._opts=n=lt({},n),this.root=e,this._id="zr"+yzr++,this._oldVNode=xpt(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=bpt("svg");Gme(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",vzr(this._oldVNode,e),this._oldVNode=e}},t.prototype.renderOneToVNode=function(e){return Lpt(e,$me(this._id))},t.prototype.renderToVNode=function(e){e=e||{};var r=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=$me(this._id);a.animation=e.animation,a.willUpdate=e.willUpdate,a.compress=e.compress,a.emphasis=e.emphasis,a.ssr=this._opts.ssr;var o=[],s=this._bgVNode=wzr(n,i,this._backgroundColor,a);s&&o.push(s);var l=e.compress?null:this._mainVNode=al("g","main",{},[]);this._paintList(r,a,l?l.children:o),l&&o.push(l);var u=vt(En(a.defs),function(f){return a.defs[f]});if(u.length&&o.push(al("defs","defs",{},u)),e.animation){var h=Z9r(a.cssNodes,a.cssAnims,{newline:!0});if(h){var d=al("style","stl",{},[],h);o.push(d)}}return xpt(n,i,o,e.useViewBox)},t.prototype.renderToString=function(e){return e=e||{},Bme(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=[],o=0,s,l,u=0,h=0;h=0&&!(f&&l&&f[m]===l[m]);m--);for(var v=g-1;v>m;v--)o--,s=a[o-1];for(var y=m+1;y=s)}}for(var d=Qpt(this),f=d.startIdx;f=0)&&(o=!0)}),!(!o&&!a.__dirty)){var s=n._opts.useDirtyRect&&!Hme(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,s)}zY(a,function(d){var f=n._paintPerCursor(a,d,e,s,u);i=i&&f})}},UY),Dn.wxa&&Kc(this._i,function(a){a&&a.ctx&&a.ctx.draw&&a.ctx.draw()}),i},t.prototype._paintPerCursor=function(e,r,n,i,a){var o=e.ctx;if(i)if(!i.length)r.drawIdx=r.endIdx;else for(var s=this.dpr,l=0;l=r.endIdx},t.prototype._paintPerCursorInRect=function(e,r,n,i,a){for(var o={inHover:!1,allClipped:!1,prevEl:null,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{contentRetained:a}},s=e.ctx,l=Hme(e),u=l&&tl.getTime(),h=r.drawIdx,d=r.notClearIdx,f=d>=0?Math.min(d,h):h;f15){f++;break}}}}d5(s,o),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=nT,r=0);var a=qme(this._i,e)[r];return a||(a=Wpt("zr_"+e+"."+r,this,e,r),this._layerConfig[e]&&Qr(a,this._layerConfig[e],!0),(n||i&&e!==nT)&&(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,o=a.layers,s=a.layerStack,l=this._domRoot,u=null;if(!(o[r]&&o[r][n])&&Tzr(e)){for(var h=s.length,d=0;d0&&(u=qme(a,s[d-1].zl)[s[d-1].zl2]),s.splice(d,0,{zl:r,zl2:n}),qme(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 Kc(this._i,function(n,i){e.call(r,n,i)})},t.prototype.eachBuiltinLayer=function(e,r){return Kc(this._i,function(n,i){e.call(r,n,i)},hB)},t.prototype.eachOtherLayer=function(e,r){return Kc(this._i,function(n,i){e.call(r,n,i)},jme)},t.prototype.getLayers=function(){var e={};return Kc(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;(Hme(v)?A=0;i--){var a=r[i];if(a.zl===e){var o=n[e][a.zl2];if(o.__builtin__)continue;if(r.splice(i,1),n[e][a.zl2]=void 0,!o.virtual){var s=o.dom.parentNode;s&&s.removeChild(o.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=h5(a,0,i),r=h5(a,1,i),n.style.display="",(this._width!==e||r!==this._height)&&(n.style.width=e+"px",n.style.height=r+"px",Kc(this._i,function(o){o.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(nT).resize(e,r)}return this},t.prototype.clearLayer=function(e){fe(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[nT][0].dom;var r=new Gpt("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;Kc(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 o={inHover:!1,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{}},s=this.storage.getDisplayList(!0),l=0,u=s.length;l-1&&(u.style.stroke=u.style.fill,u.style.fill=tt.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}(Ii);function E5(t,e){var r=t.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var i=a5(t,e,r[0]);return i!=null?i+"":null}else if(n){for(var a=[],o=0;o=0&&n.push(e[a])}return n.join(" ")}var dB=function(t){nt(e,t);function e(r,n,i,a){var o=t.call(this)||this;return o.updateData(r,n,i,a),o}return e.prototype._createSymbol=function(r,n,i,a,o,s){this.removeAll();var l=Yo(r,-1,-1,2,2,null,s);l.attr({z2:Jt(o,100),culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),l.drift=Dzr,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(){_y(this.childAt(0))},e.prototype.downplay=function(){Ry(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 o=r.getItemVisual(n,"symbol")||"circle",s=r.hostModel,l=e.getSymbolSize(r,n),u=e.getSymbolZ2(r,n),h=o!==this._symbolType,d=a&&a.disableAnimation;if(h){var f=r.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,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):qn(p,g,s,n),np(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,ua(p,g,s,n)}}d&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(r,n,i,a,o){var s=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=Is(b),v=x.getShallow("scale"),y=b.getShallow("cursor")}var w=r.getItemVisual(n,"symbolRotate");s.attr("rotation",(w||0)*Math.PI/180||0);var A=QS(r.getItemVisual(n,"symbolOffset"),i);A&&(s.x=A[0],s.y=A[1]),y&&s.attr("cursor",y);var S=r.getItemVisual(n,"style"),T=S.fill;if(s instanceof nl){var C=s.style;s.useStyle(lt({image:C.image,x:C.x,y:C.y,width:C.width,height:C.height},S))}else s.__isEmptyBrush?s.useStyle(lt({},S)):s.useStyle(S),s.style.decal=null,s.setColor(T,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var k=r.getItemVisual(n,"liftZ"),E=this._z2;k!=null?E==null&&(this._z2=s.z2,s.z2+=k):E!=null&&(s.z2=E,this._z2=null);var _=o&&o.useNameLabel;il(s,m,{labelFetcher:l,labelDataIndex:n,defaultText:P,inheritColor:T,defaultOpacity:S.opacity});function P(D){return _?r.getName(D):E5(r,D)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var L=s.ensureState("emphasis");L.style=u,s.ensureState("select").style=d,s.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),Ea(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),o=Cr(this).dataIndex,s=i&&i.animation;if(this.silent=a.silent=!0,i&&i.fadeLabel){var l=a.getTextContent();l&&Qx(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();Qx(a,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:r,removeOpt:s})},e.getSymbolSize=function(r,n){return u5(r.getItemVisual(n,"symbolSize"))},e.getSymbolZ2=function(r,n){return r.getItemVisual(n,"z2")},e}(gr);function Dzr(t,e){this.parent.drift(t,e)}function VY(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 Xpt(t){return t!=null&&!yr(t)&&(t={isIgnore:t}),t||{}}function Kpt(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:Is(e),cursorStyle:e.get("cursor")}}function Zpt(t,e,r,n,i,a,o){var s=new t(e,r,n,i);return s.setPosition(a),e.setItemGraphicEl(r,s),o.add(s),s}var fB=function(){function t(e){this.group=new gr,this._SymbolCtor=e||dB}return t.prototype.updateData=function(e,r){this._progressiveEls=null,r=Xpt(r);var n=this.group,i=e.hostModel,a=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=this._seriesScope=Kpt(e),u={disableAnimation:s},h=r.getSymbolPoint||function(d){return e.getItemLayout(d)};a||n.removeAll(),e.diff(a).add(function(d){var f=h(d);VY(e,f,d,r)&&Zpt(o,e,d,l,u,f,n)}).update(function(d,f){var p=a.getItemGraphicEl(f),g=h(d);if(!VY(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 o(e,d,l,u),p.setPosition(g);else{p.updateData(e,d,l,u);var y={x:g[0],y:g[1]};s?p.attr(y):qn(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,o=i.count();a0?r=n[0]:n[1]<0&&(r=n[1]),r}function egt(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,o=[];return o[a]=r.get(t.baseDim,n),o[1-a]=i,e.dataToPoint(o)}function up(t,e){return!isFinite(t)||!isFinite(e)}var Mzr=typeof Float32Array!==$_?Float32Array:void 0,Izr=typeof Float64Array!==$_?Float64Array:void 0;function e0(t){return Xme({ctor:Mzr},t).arr}function Xme(t,e){var r=t.arr,n=t.ctor;if(e>c8&&(e=c8),!r||t.typed&&r.length=i||m<0)break;if(up(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(o>0){for(var A=m+a,S=e[A*2],T=e[A*2+1];S===y&&T===b&&v=n||up(S,T))p=y,g=b;else{E=S-u,_=T-h;var R=y-u,D=S-y,M=b-h,I=T-b,N=void 0,F=void 0;if(s==="x"){N=Math.abs(R),F=Math.abs(D);var B=E>0?1:-1;p=y-B*N*o,g=b,P=y+B*F*o,L=b}else if(s==="y"){N=Math.abs(M),F=Math.abs(I);var V=_>0?1:-1;p=y,g=b-V*N*o,P=y,L=b+V*F*o}else N=Math.sqrt(R*R+M*M),F=Math.sqrt(D*D+I*I),k=F/(F+N),p=y-E*o*(1-k),g=b-_*o*(1-k),P=y+E*o*k,L=b+_*o*k,P=Kx(P,Zx(S,y)),L=Kx(L,Zx(T,b)),P=Zx(P,Kx(S,y)),L=Zx(L,Kx(T,b)),E=P-y,_=L-b,p=y-E*N/F,g=b-_*N/F,p=Kx(p,Zx(u,y)),g=Kx(g,Zx(h,b)),p=Zx(p,Kx(u,y)),g=Zx(g,Kx(h,b)),E=y-p,_=b-g,P=y+E*F/N,L=b+_*F/N}t.bezierCurveTo(d,f,p,g,y,b),d=P,f=L}else t.lineTo(y,b)}u=y,h=b,m+=a}return v}var tgt=function(){function t(){this.smooth=0,this.smoothConstraint=!0}return t}(),Bzr=function(t){nt(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:tt.color.neutral99,fill:null}},e.prototype.getDefaultShape=function(){return new tgt},e.prototype.buildPath=function(r,n){var i=n.points,a=0,o=i.length/2;if(n.connectNulls){for(;o>0&&up(i[o*2-2],i[o*2-1]);o--);for(;a=0){var w=u?(g-l)*x+l:(p-s)*x+s;return u?[r,w]:[w,r]}s=p,l=g;break;case o.C:p=a[d++],g=a[d++],m=a[d++],v=a[d++],y=a[d++],b=a[d++];var A=u?SH(s,p,m,y,r,h):SH(l,g,v,b,r,h);if(A>0)for(var S=0;S=0){var w=u?rl(l,g,v,b,T):rl(s,p,m,y,T);return u?[r,w]:[w,r]}}s=y,l=b;break}}},e}(yn),$zr=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(tgt),rgt=function(t){nt(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 $zr},e.prototype.buildPath=function(r,n){var i=n.points,a=n.stackedOnPoints,o=0,s=i.length/2,l=n.smoothMonotone;if(n.connectNulls){for(;s>0&&up(i[s*2-2],i[s*2-1]);s--);for(;o=0,a=t.fill||tt.color.neutral99;hgt(n,e);var o=n.textFill==null;return i?o&&(n.textFill=r.insideFill||tt.color.neutral00,!n.textStroke&&r.insideStroke&&(n.textStroke=r.insideStroke),!n.textStroke&&(n.textStroke=a),n.textStrokeWidth==null&&(n.textStrokeWidth=2)):(o&&(n.textFill=t.fill||r.outsideFill||tt.color.neutral00),!n.textStroke&&r.outsideStroke&&(n.textStroke=r.outsideStroke)),n.text=e.text,n.rich=e.rich,fe(e.rich,function(s){hgt(s,s)}),n}function hgt(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 dgt(t,e){if(t.length===e.length){for(var r=0;re){a?r.push(o(a,l,e)):i&&r.push(o(i,l,0),o(i,l,e));break}else i&&(r.push(o(i,l,0)),i=null),r.push(l),a=l}return r}function Uzr(t,e,r){var n=t.getVisual("visualMeta");if(!(!n||!n.length||!t.count())&&e.type==="cartesian2d"){for(var i,a,o=n.length-1;o>=0;o--){var s=t.getDimensionInfo(n[o].dimension);if(i=s&&s.coordDim,i==="x"||i==="y"){a=n[o];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=zzr(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";fe(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 Vzr(t,e,r){var n=t.get("showAllSymbol"),i=n==="auto";if(!(n&&!i)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(i&&Qzr(a,e))){var o=e.mapDimension(a.dim),s={};return fe(a.getViewLabels(),function(l){l.tick.offInterval||(s[A5(a.scale,l.tick)]=1)}),function(l){return!s.hasOwnProperty(e.get(o,l))}}}}function Qzr(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)),o=0;on)return!1;return!0}function Gzr(t){for(var e=t.length/2;e>0&&up(t[e*2-2],t[e*2-1]);e--);return e-1}function mgt(t,e){return[t[e*2],t[e*2+1]]}function Hzr(t,e,r){for(var n=t.length/2,i=r==="x"?0:1,a,o,s=0,l=-1,u=0;u=e||a>=e&&o<=e){l=u;break}s=u,a=o}return{range:[s,l],t:(e-a)/(o-a)}}function vgt(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,Ea(g,M,I,N);var B=ggt(r.get("smooth")),V=r.get("smoothMonotone");if(g.setShape({smooth:B,smoothMonotone:V,connectNulls:T}),m){var z=s.getCalculationInfo("stackedOnSeries"),U=0;m.useStyle(mr(u.getAreaStyle(),{fill:P,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),z&&(U=ggt(z.get("smooth"))),m.setShape({smooth:B,stackedOnSmooth:U,smoothMonotone:V,connectNulls:T}),Ms(m,r,"areaStyle"),Cr(m).seriesIndex=r.seriesIndex,Ea(m,M,I,N)}var Q=this._changePolyState;s.eachItemGraphicEl(function(X){X&&(X.onHoverStateChange=Q)}),this._polyline.onHoverStateChange=Q,this._data=s,this._coordSys=a,this._stackedOnPoints=A,this._points=h,this._step=E,this._valueOrigin=x;var G=r.get("triggerEvent"),q=r.get("triggerLineEvent"),Y=q===!0||G===!0||G==="line",ne=q===!0||G===!0||G==="area";this.packEventData(r,g,Y),m&&this.packEventData(r,m,ne)},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 o=r.getData(),s=lS(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var h=l[s*2],d=l[s*2+1];if(up(h,d)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(h,d))return;var f=r.get("zlevel")||0,p=r.get("z")||0;u=new dB(o,s),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,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else ki.prototype.highlight.call(this,r,n,i,a)},e.prototype.downplay=function(r,n,i,a){var o=r.getData(),s=lS(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else ki.prototype.downplay.call(this,r,n,i,a)},e.prototype._changePolyState=function(r){var n=this._polygon;gW(this._polyline,r),n&&gW(n,r)},e.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new Bzr({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 rgt({shape:{points:r,stackedOnPoints:n},segmentIgnoreThreshold:2}),this._lineGroup.add(i),this._polygon=i,i},e.prototype._initSymbolLabelAnimation=function(r,n,i){var a,o,s=n.getBaseAxis(),l=s.inverse;n.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):n.type==="polar"&&(a=s.dim==="angle",o=!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(o){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 C=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:C}),E&&E.animateFrom({style:{opacity:0}},{duration:300,delay:C}),k.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(r,n,i){var a=r.getModel("endLabel");if(vgt(r)){var o=r.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new $n({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var h=Gzr(l);h>=0&&(il(s,Is(r,"endLabel"),{inheritColor:i,labelFetcher:r,labelDataIndex:h,defaultText:function(d,f,p){return p!=null?jpt(o,p):E5(o,d)},enableTextSetter:!0},Wzr(a,n)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(r,n,i,a,o,s,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=s.get("precision"),m=s.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",C=Hzr(d,w,T),k=C.range,E=k[1]-k[0],_=void 0;if(E>=1){if(E>1&&!p){var P=mgt(d,k[0]);u.attr({x:P[0]+A,y:P[1]+S}),o&&(_=f.getRawValue(k[0]))}else{var P=h.getPointOn(w,T);P&&u.attr({x:P[0]+A,y:P[1]+S});var L=f.getRawValue(k[0]),R=f.getRawValue(k[1]);o&&(_=Clt(i,g,L,R,C.t))}a.lastFrameIndex=k[0]}else{var D=r===1||a.lastFrameIndex>0?k[0]:0,P=mgt(d,D);o&&(_=f.getRawValue(D)),u.attr({x:P[0]+A,y:P[1]+S})}if(o){var M=K_(u);typeof M.setLabelText=="function"&&M.setLabelText(_)}}},e.prototype._doUpdateAnimation=function(r,n,i,a,o,s,l){var u=this._polyline,h=this._polygon,d=r.hostModel,f=Nzr(this._data,r,this._stackedOnPoints,n,this._coordSys,i,this._valueOrigin),p=f.current,g=f.stackedOnCurrent,m=f.next,v=f.stackedOnNext;if(o&&(g=Jx(f.stackedOnCurrent,f.current,i,o,l),p=Jx(f.current,null,i,o,l),v=Jx(f.stackedOnNext,f.next,i,o,l),m=Jx(f.next,null,i,o,l)),pgt(p,m)>3e3||h&&pgt(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(),qn(u,y,d),h&&(h.setShape({points:p,stackedOnPoints:g}),h.stopAnimation(),qn(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&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),h=l.getExtent(),d=n.getDevicePixelRatio(),f=Math.abs(h[1]-h[0])*(d||1),p=Math.round(s/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;$t(a)?g=qzr[a]:ur(a)&&(g=a),g&&e.setData(i.downSample(i.mapDimension(u.dim),1/p,g,jzr))}}}}}function Xzr(t){t.registerChartView(Yzr),t.registerSeriesModel(Rzr),t.registerLayout(vB("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,ygt("line"))}var bgt=function(t){nt(e,t);function e(r,n,i,a,o){var s=t.call(this,r,n,i)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}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}(cp),Jme=null;function Kzr(t){Jme||(Jme=t)}function yB(){return Jme}var QY="expandAxisBreak",xgt="collapseAxisBreak",wgt="toggleAxisBreak",e0e="axisbreakchanged",Zzr={type:QY,event:e0e,update:"update",refineEvent:t0e},Jzr={type:xgt,event:e0e,update:"update",refineEvent:t0e},eUr={type:wgt,event:e0e,update:"update",refineEvent:t0e};function t0e(t,e,r,n){var i=[];return fe(t,function(a){i=i.concat(a.eventBreaks)}),{eventContent:{breaks:i}}}function tUr(t){t.registerAction(Zzr,e),t.registerAction(Jzr,e),t.registerAction(eUr,e);function e(r,n){var i=[],a=M_(n,r);function o(s,l){fe(a[s],function(u){var h=u.updateAxisBreaks(r);fe(h.breaks,function(d){var f;i.push(mr((f={},f[l]=u.componentIndex,f),d))})})}return o("xAxisModels","xAxisIndex"),o("yAxisModels","yAxisIndex"),o("singleAxisModels","singleAxisIndex"),{eventBreaks:i}}}var e2=Math.PI,rUr=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],nUr=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],oT=Gr(),Agt=Gr(),Sgt=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 iUr(t,e,r,n){var i=r.axis,a=e.ensureRecord(r),o=[],s,l=n0e(t.axisName)&&w5(t.nameLocation);fe(n,function(g){var m=Zm(g);if(!(!m||m.label.ignore)){o.push(m);var v=a.transGroup;l&&(v.transform?$d(bB,v.transform):WA(bB),m.transform&&Bd(bB,bB,m.transform),pr.copy(GY,m.localRect),GY.applyTransform(bB),s?s.union(GY):pr.copy(s=new pr(0,0,0,0),GY))}});var u=Math.abs(a.dirVec.x)>.1?"x":"y",h=a.transGroup[u];if(o.sort(function(g,m){return Math.abs(g.label[u]-h)-Math.abs(m.label[u]-h)}),l&&s){var d=i.getExtent(),f=Math.min(d[0],d[1]),p=Math.max(d[0],d[1])-f;s.union(new pr(f,0,p,1))}a.stOccupiedRect=s,a.labelInfoList=o}var bB=ka(),GY=new pr(0,0,0,0),Tgt=function(t,e,r,n,i,a){if(w5(t.nameLocation)){var o=a.stOccupiedRect;o&&Cgt(P9r({},o,a.transGroup.transform),n,i)}else Ogt(a.labelInfoList,a.dirVec,n,i)};function Cgt(t,e,r){var n=new wr;PY(t,e,n,{direction:Math.atan2(r.y,r.x),bidirectional:!1,touchThreshold:.05})&&Eme(e,n)}function Ogt(t,e,r,n){for(var i=wr.dot(n,e)>=0,a=0,o=t.length;a0?"top":"bottom",a="center"):oS(i-e2)?(o=n>0?"bottom":"top",a="center"):(o="middle",i>0&&i0?"right":"left":a=n>0?"left":"right"),{rotation:i,textAlign:a,textVerticalAlign:o}},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}(),aUr=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],oUr={axisLine:function(t,e,r,n,i,a,o){var s=n.get(["axisLine","show"]);if(s==="auto"&&(s=!0,t.raw.axisLineAutoShow!=null&&(s=!!t.raw.axisLineAutoShow)),!!s){var l=n.axis.getExtent(),u=a.transform,h=[l[0],0],d=[l[1],0],f=h[0]>d[0];u&&(io(h,h,u),io(d,d,u));var p=lt({lineCap:"round"},n.getModel(["axisLine","lineStyle"]).getLineStyle()),g={strokeContainThreshold:t.raw.strokeContainThreshold||5,silent:!0,z2:1,style:p};if(n.get(["axisLine","breakLine"])&&MW(n.axis.scale))yB().buildAxisBreakLine(n,i,a,g);else{var m=new Go(lt({shape:{x1:h[0],y1:h[1],x2:d[0],y2:d[1]}},g));j_(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"]);$t(v)&&(v=[v,v]),($t(y)||Vn(y))&&(y=[y,y]);var b=QS(n.get(["axisLine","symbolOffset"])||0,y),x=y[0],w=y[1];fe([{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=Yo(v[S],-x/2,-w/2,x,w,p.stroke,!0),C=A.r+A.offset,k=f?d:h;T.attr({rotation:A.rotate,x:k[0]+C*Math.cos(t.rotation),y:k[1]-C*Math.sin(t.rotation),silent:!0,z2:11}),i.add(T)}})}}},axisTickLabelEstimate:function(t,e,r,n,i,a,o,s){var l=_gt(e,i,s);l&&kgt(t,e,r,n,i,a,o,vg.estimate)},axisTickLabelDetermine:function(t,e,r,n,i,a,o,s){var l=_gt(e,i,s);l&&kgt(t,e,r,n,i,a,o,vg.determine);var u=uUr(t,i,a,n);cUr(t,e.labelLayoutList,u),hUr(t,i,a,n,t.tickDirection)},axisName:function(t,e,r,n,i,a,o,s){var l=r.ensureRecord(n);e.nameEl&&(i.remove(e.nameEl),e.nameEl=l.nameLayout=l.nameLocation=null);var u=t.axisName;if(n0e(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=ka();y.transform(xy(b,b,t.rotation));var x=n.get("nameRotate");x!=null&&(x=x*e2/180);var w,A;w5(h)?w=Bu.innerTextLayout(t.rotation,x??t.rotation,d):(w=sUr(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)||{},C=T.ellipsis,k=Gc(t.raw.nameTruncateMaxWidth,T.maxWidth,A),E=s.nameMarginLevel||0,_=new $n({x:v.x,y:v.y,rotation:w.rotation,silent:Bu.isLabelSilent(n),style:ji(f,{text:u,font:S,overflow:"truncate",width:k,ellipsis:C,fill:f.getTextColor()||n.get(["axisLine","lineStyle","color"]),align:f.get("align")||w.textAlign,verticalAlign:f.get("verticalAlign")||w.textVerticalAlign}),z2:1});if(Ly({el:_,componentModel:n,itemName:u}),_.__fullText=u,_.anid="name",n.get("triggerEvent")){var P=Bu.makeAxisEventDataBase(n);P.targetType="axisName",P.name=u,Cr(_).eventData=P}a.add(_),_.updateTransform(),e.nameEl=_;var L=l.nameLayout=Zm({label:_,priority:_.z2,defaultAttr:{ignore:_.ignore},marginDefault:w5(h)?rUr[E]:nUr[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 kgt(t,e,r,n,i,a,o,s){Rgt(e)||dUr(t,e,i,s,n,o);var l=e.labelLayoutList;fUr(t,n,l,a),mUr(n,t.rotation,l);var u=t.optionHideOverlap;lUr(n,l,u),u&&dpt(oi(l,function(h){return h&&!h.label.ignore})),iUr(t,r,n,l)}function sUr(t,e,r,n){var i=Dfe(r-t),a,o,s=n[0]>n[1],l=e==="start"&&!s||e!=="start"&&s;return oS(i-e2/2)?(o=l?"bottom":"top",a="center"):oS(i-e2*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",ie2/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:o}}function lUr(t,e,r){var n=t.axis,i=t.get(["axisLabel","customValues"]);if(wFr(n))return;function a(u,h,d){var f=Zm(e[h]),p=Zm(e[d]),g=n.scale;if(!(!f||!p)){if(u==null){if(!r&&i)return;var m=oT(f.label).labelInfo.tick;if(J8(g)&&m.notNice||Xc(g)&&m.offInterval){R5(f.label);return}}if(u===!1||f.suggestIgnore){R5(f.label);return}if(p.suggestIgnore){R5(p.label);return}var v=.1;if(!r){var y=[0,0,0,0];f=_me({marginForce:y},f),p=_me({marginForce:y},p)}PY(f,p,null,{touchThreshold:v})&&R5(u?p.label:f.label)}}var o=t.get(["axisLabel","showMinLabel"]),s=t.get(["axisLabel","showMaxLabel"]),l=e.length;a(o,0,1),a(s,l-1,l-2)}function cUr(t,e,r){t.showMinorTicks||fe(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))&&(o=!0),p+=A.count()}),(!i||i.keys().length!==n.keys().length)&&(o=!0),!o&&a!=null){e.liPosMinGap=a;return}Xme(sT,p);var g=0;f(function(x,w,A){for(var S=0,T=A.count();S0&&b0?Rft:CFr,r.serUids=n}var sT=Xme({ctor:Izr},50);function WY(t){return function(e,r){var n=mc(e,{fromStat:{key:t}});if(ep(n.w2))return[-n.w2/2,n.w2/2]}}function lT(t){return t+OY}function cT(t,e){return t+OY+e}function i0e(t){return AUr(),{liPosMinGap:!Xc(t.scale)}}var t0="bar",xB="pictorialBar";function Dgt(t,e,r,n){vme(t,{key:e,seriesType:r,coordSysType:n,getMetrics:i0e})}function Lgt(t){var e=t.scale.rawExtentInfo.makeRenderInfo().startValue;return e}var Mgt={left:0,right:0,top:0,bottom:0},YY=["25%","25%"],xg="cartesian2d",TUr=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.mergeDefaultAndTheme=function(r,n){var i=PS(r.outerBounds);t.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&r.outerBounds&&qm(r.outerBounds,i)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&r.outerBounds&&qm(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:Mgt,outerBoundsContain:"all",outerBoundsClampWidth:YY[0],outerBoundsClampHeight:YY[1],backgroundColor:tt.color.transparent,borderWidth:1,borderColor:tt.color.neutral30},e}(pn),CUr=P_(),a0e="__ec_stack_";function Igt(t){return t.get("stack")||a0e+t.seriesIndex}function OUr(t){if(Xc(t.axis.scale)){for(var e=mc(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=rn(h,0);var d=0,f;fe(o,function(m){var v=s[m];v.width||(v.width=h),f=v,d+=v.width*(1+u)}),f&&(d-=f.width*u);var p={},g=-d/2;return fe(o,function(m){var v=s[m];p[m]=p[m]||{bandWidth:e,offset:g,width:v.width},g+=v.width*(1+u)}),p}function Ngt(t){return{seriesType:t,overallReset:function(e){var r=cT(t,xg);gme(e,r,function(n){var i=kUr(n,t);jS(n,r,function(a){var o=i.columnMap[Igt(a)];a.getData().setLayout({bandWidth:o.bandWidth,offset:o.offset,size:o.width})})})}}}function Bgt(t){return{seriesType:t,plan:US(),reset:function(e){if(vUr(e)){var r=e.getData(),n=e.coordinateSystem,i=n.getBaseAxis(),a=n.getOtherAxis(i),o=r.getDimensionIndex(r.mapDimension(a.dim)),s=r.getDimensionIndex(r.mapDimension(i.dim)),l=e.get("showBackground",!0),u=r.mapDimension(a.dim),h=r.getCalculationInfo("stackResultDimension"),d=Ny(r,u)&&!!r.getCalculationInfo("stackedOnSeries"),f=a.isHorizontal(),p=a.toGlobalCoord(a.dataToCoord(Lgt(a))),g=$gt(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&&e0(A*3),T=g&&l&&e0(A*3),C=g&&e0(A),k=n.master.getRect(),E=f?k.width:k.height,_,P=w.getStore(),L=0;(_=x.next())!=null;){var R=P.get(d?v:o,_),D=P.get(s,_),M=p,I=void 0;d&&(I=+R-P.get(o,_));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([I,D])[0]),N=M,F=z[1]+b,B=z[0]-M,V=y,ao(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),s[p]=f.toGlobalCoord(x)}});else{var l=this.getData(),u=l.getLayout("offset"),h=l.getLayout("size"),d=a.getBaseAxis().isHorizontal()?0:1;s[d]+=u+h/2}return s}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}(Ii);Ii.registerClass(wB);var RUr=function(t){nt(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 jm(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=Elt(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."+t0,e.dependencies=["grid","polar"],e.defaultOption=Hx(wB.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:tt.color.primary,borderWidth:2}},realtimeSort:!1}),e}(wB),DUr=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}(),qY=function(t){nt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="sausage",n}return e.prototype.getDefaultShape=function(){return new DUr},e.prototype.buildPath=function(r,n){var i=n.cx,a=n.cy,o=Math.max(n.r0||0,0),s=Math.max(n.r,0),l=(s-o)*.5,u=o+l,h=n.startAngle,d=n.endAngle,f=n.clockwise,p=Math.PI*2,g=f?d-hMath.PI/2&&hs)return!0;s=d}return!1},e.prototype._isOrderDifferentInView=function(r,n){for(var i=n.scale,a=i.getExtent(),o=Math.max(0,a[0]),s=Math.min(a[1],i.getOrdinalMeta().categories.length-1);o<=s;++o)if(r.ordinalNumbers[o]!==i.getRawOrdinalNumber(o))return!0},e.prototype._updateSortWithinSameData=function(r,n,i,a){if(this._isOrderChangedWithinSameData(r,n,i)){var o=this._dataSort(r,i,n);this._isOrderDifferentInView(o,i)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",axisId:i.index,sortInfo:o}))}},e.prototype._dispatchInitSort=function(r,n,i){var a=n.baseAxis,o=this._dataSort(r,a,function(s){return r.get(r.mapDimension(n.otherAxis.dim),s)});i.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:o})},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){Dy(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=t0,e}(ki),zgt={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,o=o0e(e.x,t.x),s=s0e(e.x+e.width,i),l=o0e(e.y,t.y),u=s0e(e.y+e.height,a),h=si?s:o,e.y=d&&l>a?u:l,e.width=h?0:s-o,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=s0e(e.r,t.r),a=o0e(e.r0,t.r0);e.r=i,e.r0=a;var o=i-a<0;if(r<0){var n=e.r;e.r=e.r0,e.r0=n}return o}},Ugt={cartesian2d:function(t,e,r,n,i,a,o,s,l){var u=new nn({shape:lt({},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,o,s,l){var u=!i&&l?qY:fc,h=new u({shape:n,z2:1});h.name="item";var d=Hgt(i);if(h.calculateTextPosition=LUr(d,{isRoundCap:u===qY}),a){var f=h.shape,p=i?"r":"endAngle",g={};f[p]=i?n.r0:n.startAngle,g[p]=n[p],(s?qn:ua)(h,{shape:g},a)}return h}};function PUr(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 Vgt(t,e,r,n,i,a,o,s){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}),s||(o?qn:ua)(r,{shape:l},e,i,null);var h=e?t.baseAxis.model:null;(o?qn:ua)(r,{shape:u},h,i)}function Qgt(t,e){for(var r=0;r0?1:-1,o=n.height>0?1:-1;return{x:n.x+a*i/2,y:n.y+o*i/2,width:n.width-a*i,height:n.height-o*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 $Ur(t){return t.startAngle!=null&&t.endAngle!=null&&t.startAngle===t.endAngle}function Hgt(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 Wgt(t,e,r,n,i,a,o,s){var l=e.getItemVisual(r,"style");if(s){if(!a.get("roundCap")){var h=t.shape,d=r0(n.getModel("itemStyle"),h,!0);lt(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=s?o?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":o?QUr(i,a.coordinateSystem):GUr(i,a.coordinateSystem),g=Is(n);il(t,g,{labelFetcher:a,labelDataIndex:r,defaultText:E5(a.getData(),r),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:p});var m=t.getTextContent();if(s&&m){var v=n.get(["label","position"]);t.textConfig.inside=v==="middle"?!0:null,MUr(t,v==="outside"?p:v,Hgt(o),n.get(["label","rotate"]))}cut(m,g,a.getRawValue(r),function(b){return jpt(e,b)});var y=n.getModel(["emphasis"]);Ea(t,y.get("focus"),y.get("blurScope"),y.get("disabled")),Ms(t,n),$Ur(i)&&(t.style.fill="none",t.style.stroke="none",fe(t.states,function(b){b.style&&(b.style.fill=b.style.stroke="none")}))}function FUr(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 zUr=function(){function t(){}return t}(),Ygt=function(t){nt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="largeBar",n}return e.prototype.getDefaultShape=function(){return new zUr},e.prototype.buildPath=function(r,n){for(var i=n.points,a=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,h=0;h=0?r:null},30,!1);function UUr(t,e,r){for(var n=t.baseDimIdx,i=1-n,a=t.shape.points,o=t.largeDataIndices,s=[],l=[],u=t.barWidth,h=0,d=a.length/3;h=s[0]&&e<=s[0]+l[0]&&r>=s[1]&&r<=s[1]+l[1])return o[h]}return-1}function Xgt(t,e,r){if(aT(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 VUr(t,e,r){var n=t.type==="polar"?fc:nn;return new n({shape:Xgt(e,r,t),silent:!0,z2:0})}function QUr(t,e){if(t.height===0){var r=e.getOtherAxis(e.getBaseAxis());return r.inverse?"bottom":"top"}return t.height>0?"bottom":"top"}function GUr(t,e){if(t.width===0){var r=e.getOtherAxis(e.getBaseAxis());return r.inverse?"left":"right"}return t.width>=0?"right":"left"}function HUr(t){t.registerChartView(IUr),t.registerSeriesModel(RUr),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,Ngt(t0)),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,Bgt(t0)),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,ygt(t0)),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)})}),Fgt(t)}function AB(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 o=i.getName(a),s=0;s=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}(),t2="pie",WUr=Gr(),Kgt=function(t){nt(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 L5(Wt(this.getData,this),Wt(this.getRawData,this)),this._defaultLabelLine(r)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return D5(this,{coordDimensions:["value"],encodeDefaulter:Kr(sge,this)})},e.prototype.getDataParams=function(r){var n=this.getData(),i=WUr(n),a=i.seats;if(!a){var o=[];n.each(n.mapDimension("value"),function(l){o.push(l)}),a=i.seats=flt(o,n.hostModel.get("percentPrecision"))}var s=t.prototype.getDataParams.call(this,r);return s.percent=a[r]||0,s.$vars.push("percent"),s},e.prototype._defaultLabelLine=function(r){sS(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."+t2,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}(Ii);U8r({fullType:Kgt.type,getCoord2:function(t){return t.getShallow("center")}});var YUr=Math.PI/180;function Zgt(t,e,r,n,i,a,o,s,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,C=Math.abs(S)t.unconstrainedWidth?null:f:null;n.setStyle("width",p)}emt(a,n)}}}function emt(t,e){tmt.rect=t,upt(tmt,e,jUr)}var jUr={minMarginForce:[null,0,null,0],marginDefault:[1,0,1,0]},tmt={};function l0e(t){return t.position==="center"}function XUr(t){var e=t.getData(),r=[],n,i,a=!1,o=(t.get("minShowLabelAngle")||0)*YUr,s=e.getLayout("viewRect"),l=e.getLayout("r"),u=s.width,h=s.x,d=s.y,f=s.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),C=T.shape,k=T.getTextContent(),E=T.getTextGuideLine(),_=e.getItemModel(S),P=_.getModel("label"),L=P.get("position")||_.get(["emphasis","label","position"]),R=P.get("distanceToLabelLine"),D=P.get("alignTo"),M=Qt(P.get("edgeDistance"),u),I=P.get("bleedMargin");I==null&&(I=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(C.endAngle-C.startAngle)0?"right":"left":z>0?"left":"right"}var Ce=Math.PI,ke=0,Ee=P.get("rotate");if(Vn(Ee))ke=Ee*(Ce/180);else if(L==="center")ke=0;else if(Ee==="radial"||Ee===!0){var ue=z<0?-V+Ce:-V;ke=ue}else if(Ee==="tangential"||Ee==="tangential-noflip"&&L!=="outside"&&L!=="outer"){var de=Math.atan2(z,U);de<0&&(de=Ce*2+de);var xe=U>0;xe&&Ee!=="tangential-noflip"&&(de=Ce+de),ke=de-Ce}if(a=!!ke,k.x=Q,k.y=G,k.rotation=ke,k.setStyle({verticalAlign:"middle"}),ne){k.setStyle({align:Y});var ze=k.states.select;ze&&(ze.x+=k.x,ze.y+=k.y)}else{var ge=new pr(0,0,0,0);emt(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:q,textAlign:Y,labelDistance:R,labelAlignTo:D,edgeDistance:M,bleedMargin:I,rect:ge,unconstrainedWidth:ge.width,labelStyleWidth:k.style.width})}T.setTextConfig({inside:ne})}}),!a&&t.get("avoidLabelOverlap")&&qUr(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(I,{angle:N,startAngle:B,endAngle:V,clockwise:x,cx:o,cy:s,r0:u,r:w?Zn(M,S,[u,l]):l}),R=F}),P0){for(var h=o.getItemLayout(0),d=1;isNaN(h&&h.startAngle)&&d=a.r0}},e.type=t2,e}(ki);function tVr(t){return{seriesType:t,reset:function(e,r){var n=e.getData();n.filterSelf(function(i){var a=n.mapDimension("value"),o=n.get(a,i);return!(Vn(o)&&!isNaN(o)&&o<0)})}}}function rVr(t){t.registerChartView(eVr),t.registerSeriesModel(Kgt),ldt(t2,t.registerAction),t.registerLayout(KUr),t.registerProcessor(AB(t2)),t.registerProcessor(tVr(t2))}var nVr=function(t){nt(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 jm(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:tt.color.primary}},universalTransition:{divideShape:"clone"}},e}(Ii),imt=4,iVr=function(){function t(){}return t}(),aVr=function(t){nt(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 iVr},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,o=this.symbolProxy,s=o.shape,l=r.getContext?r.getContext():r,u=l&&a[0]=0;u--){var h=u*2,d=a[h]-s/2,f=a[h+1]-l/2;if(r>=d&&n>=f&&r<=d+s&&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 o=this.hoverDataIdx=this.findDataIndex(r,n);return o>=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,o=a[0],s=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}(),sVr=function(t){nt(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(),o=this._updateSymbolDraw(a,r);o.updateData(a,c0e(r)),this._finished=!0},e.prototype.incrementalPrepareRender=function(r,n,i){var a=r.getData(),o=this._updateSymbolDraw(a,r);o.incrementalPrepareUpdate(a),this._finished=!1},e.prototype.incrementalRender=function(r,n,i){this._symbolDraw.incrementalUpdate(r,n.getData(),$m(n),c0e(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 o=vB("").reset(r,n,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(c0e(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,o=a.large;return(!i||o!==this._isLargeDraw)&&(i&&i.remove(),i=this._symbolDraw=o?new oVr:new fB,this._isLargeDraw=o,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}(ki);function c0e(t){return{clipShape:agt(t)}}var u0e=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",xo).models[0]},e.type="cartesian2dAxis",e}(pn);Qo(u0e,S5);var amt={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:tt.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:tt.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:tt.color.axisSplitLine,width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:[tt.color.backgroundTint,tt.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:tt.color.neutral00,borderColor:tt.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:"auto"}},lVr=Qr({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},amt),h0e=Qr({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:tt.color.axisMinorSplitLine,width:1}}},amt),cVr=Qr({splitNumber:6,axisLabel:{rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},h0e),uVr=mr({logBase:10},h0e);const omt={category:lVr,value:h0e,time:cVr,log:uVr};function M5(t,e,r,n){fe(Oft,function(i,a){var o=Qr(Qr({},omt[a],!0),n,!0),s=function(l){nt(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=I8(this),p=f?PS(h):{},g=d.getTheme();Qr(h,g.get(a+"Axis")),Qr(h,this.getDefaultOption()),h.type=smt(h),f&&qm(h,p,f)},u.prototype.optionUpdated=function(){var h=this.option;h.type==="category"&&(this.__ordinalMeta=X8.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=yB();return d?d.updateModelAxisBreak(this,h):{breaks:[]}},u.type=e+"Axis."+a,u.defaultOption=o,u}(r);t.registerComponentModel(s)}),t.registerSubTypeDefaulter(e+"Axis",smt)}function smt(t){return t.type||(t.data?"category":"value")}var hVr=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(),oi(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}(),JY=["x","y"];function lmt(t){return(t.type==="interval"||t.type==="time")&&!MW(t)}var dVr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=xg,r.dimensions=JY,r}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!lmt(r)||!lmt(n))){var i=vY(r,null),a=vY(n,null),o=this.dataToPoint([i[0],a[0]]),s=this.dataToPoint([i[1],a[1]]),l=i[1]-i[0],u=a[1]-a[0];if(!(!l||!u)){var h=(s[0]-o[0])/l,d=(s[1]-o[1])/u,f=o[0]-i[0]*h,p=o[1]-a[0]*d,g=this._transform=[h,0,0,d,f,p];this._invTransform=$d([],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),o=this.getArea(),s=new pr(i[0],i[1],a[0]-i[0],a[1]-i[1]);return o.intersect(s)},e.prototype.dataToPoint=function(r,n,i){i=i||[];var a=r[0],o=r[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return io(i,r,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return i[0]=s.toGlobalCoord(s.dataToCoord(a,n)),i[1]=l.toGlobalCoord(l.dataToCoord(o,n)),i},e.prototype.clampData=function(r,n){var i=this.getAxis("x").scale,a=this.getAxis("y").scale,o=i.getExtent(),s=a.getExtent(),l=i.parse(r[0]),u=a.parse(r[1]);return n=n||[],n[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),n[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),n},e.prototype.pointToData=function(r,n,i){if(i=i||[],this._invTransform)return io(i,r,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return i[0]=a.coordToData(a.toLocalCoord(r[0]),n),i[1]=o.coordToData(o.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,o=Math.min(i[0],i[1])-r,s=Math.max(n[0],n[1])-a+r,l=Math.max(i[0],i[1])-o+r;return new pr(a,o,s,l)},e}(hVr);function cmt(t,e){var r=t.scale,n=t.model,i=zft(r,n,n.ecModel,t,null),a=b5(r),o=b5(e)?e.intervalStub:e,s=a?r.intervalStub:r,l=r.base,u=o.getTicks(),h=o.getTicks({expandToNicedExtent:!0}),d=u.length-1,f,p,g;if(d===1)f=p=0,g=1;else if(d===2){var m=ao(u[0].value-u[1].value),v=ao(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=Yn(P-E*g,_),D(),C<=T[0])return!0})):R(function(){L=Yn(rS(T[0]/E)*E,_),P=Yn(Jf(T[1]/E)*E,_);var z=Im((P-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 q=Jf(U/2);Q=U%2===0?[q,q]:C+k=T[1])return!0}})}_ft(r,w,S,[C,k],A,{interval:E,intervalCount:g,intervalPrecision:_,niceExtent:[L,P]})}var umt=[[3,1],[0,2]],fVr=function(){function t(e,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=JY,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;fe(this._axesList,function(o){KS(o,C5);var s=o.scale;Xc(s)&&s.setSortInfo(o.model.get("categorySortInfo"))});function i(o){for(var s=En(o),l=[],u=s.length-1;u>=0;u--){var h=o[+s[u]];h.__alignTo?l.push(h):O5(h)}fe(l,function(d){gVr(d,d.__alignTo)?O5(d):cmt(d,d.__alignTo.scale)})}i(n.x),i(n.y);var a={};fe(n.x,function(o){hmt(n,"y",o,a)}),fe(n.y,function(o){hmt(n,"x",o,a)}),this.resize(this.model,r)},t.prototype.resize=function(e,r,n){var i=Ps(e,r),a=this._rect=ba(e.getBoxLayoutParams(),i.refContainer),o=this._axesMap,s=this._coordsList,l=e.get("containLabel");if(d0e(o,a),!n){var u=yVr(a,s,o,l,r),h=void 0;if(l)f0e?(f0e(this._axesList,a),d0e(o,a)):h=gmt(a.clone(),"axisLabel",null,a,o,u,i);else{var d=bVr(e,a,i),f=d.outerBoundsRect,p=d.parsedOuterBoundsContain,g=d.outerBoundsClamp;f&&(h=gmt(f,p,g,a,o,u,i))}mmt(a,o,vg.determine,null,h,i),fe(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]];mft(a.scale)&&Eft(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&&fe(n,function(o){o.__alignTo=r})}function gVr(t,e){return MW(t.scale)||MW(e.scale)||e.scale.getTicks().length<2}function mVr(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 d0e(t,e){fe(t.x,function(r){return pmt(r,e.x,e.width)}),fe(t.y,function(r){return pmt(r,e.y,e.height)})}function pmt(t,e,r){var n=[0,r],i=t.inverse?1:0;t.setExtent(n[i],n[1-i]),mVr(t,e)}var f0e;function vVr(t){f0e=t}function gmt(t,e,r,n,i,a,o){mmt(n,i,vg.estimate,e,!1,o);var s=[0,0,0,0];u(0),u(1),h(n,0,NaN),h(n,1,NaN);var l=py(s,function(f){return f>0})==null;return ES(n,s,!0,!0,r),d0e(i,n),l;function u(f){fe(i[Mr[f]],function(p){if(nB(p.model)){var g=a.ensureRecord(p.model),m=g.labelInfoList;if(m)for(var v=0;v0&&!cc(p)&&p>1e-4&&(f/=p),f}}function yVr(t,e,r,n,i){var a=new Sgt(xVr);return fe(r,function(o){return fe(o,function(s){if(nB(s.model)){var l=!n;s.axisBuilder=bUr(t,e,s.model,i,a,l)}})}),a}function mmt(t,e,r,n,i,a){var o=r===vg.determine;fe(e,function(u){return fe(u,function(h){nB(h.model)&&(xUr(h.axisBuilder,t,h.model),h.axisBuilder.build(o?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:i}))})});var s={x:0,y:0};l(0),l(1);function l(u){s[Mr[1-u]]=t[_o[u]]<=a.refContainer[_o[u]]*.5?0:1-u===1?2:1}fe(e,function(u,h){return fe(u,function(d){nB(d.model)&&((n==="all"||o)&&d.axisBuilder.build({axisName:!0},{nameMarginLevel:s[h]}),o&&d.axisBuilder.build({axisLine:!0}))})})}function bVr(t,e,r){var n,i=t.get("outerBoundsMode",!0);i==="same"?n=e.clone():(i==null||i==="auto")&&(n=ba(t.get("outerBounds",!0)||Mgt,r.refContainer));var a=t.get("outerBoundsContain",!0),o;a==null||a==="auto"||Nr(["all","axisLabel"],a)<0?o="all":o=a;var s=[qH(Jt(t.get("outerBoundsClampWidth",!0),YY[0]),e.width),qH(Jt(t.get("outerBoundsClampHeight",!0),YY[1]),e.height)];return{outerBoundsRect:n,parsedOuterBoundsContain:o,outerBoundsClamp:s}}var xVr=function(t,e,r,n,i,a){var o=r.axis.dim==="x"?"y":"x";Tgt(t,e,r,n,i,a),w5(t.nameLocation)||fe(e.recordMap[o],function(s){s&&s.labelInfoList&&s.dirVec&&Ogt(s.labelInfoList,s.dirVec,n,i)})};function wVr(t,e){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return AVr(r,t,e),r.seriesInvolved&&TVr(r,t),r}function AVr(t,e,r){var n=e.getComponent("tooltip"),i=e.getComponent("axisPointer"),a=i.get("link",!0)||[],o=[];fe(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=SB(s.model),u=t.coordSysAxesInfo[l]={};t.coordSysMap[l]=s;var h=s.model,d=h.getModel("tooltip",n);if(fe(s.getAxes(),Kr(m,!1,null)),s.getTooltipAxes&&n&&d.get("show")){var f=d.get("trigger")==="axis",p=d.get(["axisPointer","type"])==="cross",g=s.getTooltipAxes(d.get(["axisPointer","axis"]));(f||p)&&fe(g.baseAxes,Kr(m,p?"cross":!0,f)),p&&fe(g.otherAxes,Kr(m,"cross",!1))}function m(v,y,b){var x=b.model.getModel("axisPointer",i),w=x.get("show");if(!(!w||w==="auto"&&!v&&!m0e(x))){y==null&&(y=x.get("triggerTooltip")),x=v?SVr(b,d,i,e,v,y):x;var A=x.get("snap"),S=x.get("triggerEmphasis"),T=SB(b.model),C=y||A||b.type==="category",k=t.axesInfo[T]={key:T,axis:b,coordSys:s,axisPointerModel:x,triggerTooltip:y,triggerEmphasis:S,involveSeries:C,snap:A,useHandle:m0e(x),seriesModels:[],linkGroup:null};u[T]=k,t.seriesInvolved=t.seriesInvolved||C;var E=CVr(a,b);if(E!=null){var _=o[E]||(o[E]={axesInfo:{}});_.axesInfo[T]=k,_.mapper=a[E].mapper,k.linkGroup=_}}}})}function SVr(t,e,r,n,i,a){var o=e.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};fe(s,function(f){l[f]=lr(o.get(f))}),l.snap=t.type!=="category"&&!!a,o.get("type")==="cross"&&(l.type="line");var u=l.label||(l.label={});if(u.show==null&&(u.show=!1),i==="cross"){var h=o.get(["label","show"]);if(u.show=h??!0,!a){var d=l.lineStyle=o.get("crossStyle");d&&mr(u,d.textStyle)}}return t.model.getModel("axisPointer",new bn(l,r,n))}function TVr(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||fe(t.coordSysAxesInfo[SB(n.model)],function(o){var s=o.axis;n.getAxis(s.dim)===s&&(o.seriesModels.push(r),o.seriesDataCount==null&&(o.seriesDataCount=0),o.seriesDataCount+=r.getData().count())})})}function CVr(t,e){for(var r=e.model,n=e.dim,i=0;i=0||t===e}function OVr(t){var e=g0e(t);if(e){var r=e.axisPointerModel,n=e.axis.scale,i=r.option,a=r.get("status"),o=r.get("value");o!=null&&(o=n.parse(o));var s=m0e(r);a==null&&(i.status=s?"show":"hide");var l=n.getExtent();(o==null||o>l[1])&&(o=l[1]),o0;return o&&s}var IVr=Gr();function Tmt(t,e,r,n){if(t instanceof bgt){var i=t.scale.type;if(i!=="ordinal")return r}var a=t.model,o=a.get("jitter");if(!(o>0))return r;var s=a.get("jitterOverlap"),l=a.get("jitterMargin")||0,u=Xc(t.scale)?mc(t).w:null;return s?Cmt(r,o,u,n):PVr(t,e,r,n,o,l)}function Cmt(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 PVr(t,e,r,n,i,a){var o=IVr(t);o.items||(o.items=[]);var s=o.items,l=Omt(s,e,r,n,i,a,1),u=Omt(s,e,r,n,i,a,-1),h=Math.abs(l-r)i/2||d&&f>d/2-n?Cmt(r,i,d,n):(s.push({fixedCoord:e,floatCoord:h,r:n}),h)}function Omt(t,e,r,n,i,a,o){for(var s=r,l=0;li/2)return Number.MAX_VALUE;if(o===1&&g>s||o===-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=Qr(lr(m),{boundaryGap:r,splitNumber:n,clockwise:i,scale:a,axisLine:o,axisTick:s,axisLabel:l,name:m.text,showName:h,nameLocation:"end",nameGap:f,nameTextStyle:v,triggerEvent:p},!1);if($t(d)){var b=y.name;y.name=d.replace("{value}",b??"")}else ur(d)&&(y.name=d(y.name,y));var x=new bn(y,null,this.ecModel);return Qo(x,S5.prototype),x.mainType="radar",x.componentIndex=this.componentIndex,x.uid=DS("ec_radar"),x},this);this._indicatorModels=g},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type=kmt,e.defaultOption={z:0,center:["50%","50%"],radius:"50%",startAngle:90,clockwise:!1,axisName:{show:!0,color:tt.color.axisLabel},boundaryGap:[0,0],splitNumber:Emt,axisNameGap:15,scale:!1,shape:"polygon",axisLine:Qr({lineStyle:{color:tt.color.neutral20}},CB.axisLine),axisLabel:rq(CB.axisLabel,!1),axisTick:rq(CB.axisTick,!1),splitLine:rq(CB.splitLine,!0),splitArea:rq(CB.splitArea,!0),indicator:[]},e}(pn),GVr=function(t){nt(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(),o=vt(a,function(s){var l=s.model.get("showName")?s.name:"",u=new Bu(s.model,n,{axisName:l,position:[i.cx,i.cy],rotation:s.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return u});fe(o,function(s){s.build(),this.group.add(s.group)},this)},e.prototype._buildSplitLineAndArea=function(r){var n=r.coordinateSystem,i=n.getIndicatorAxes();if(!i.length)return;var a=r.get("shape"),o=r.getModel("splitLine"),s=r.getModel("splitArea"),l=o.getModel("lineStyle"),u=s.getModel("areaStyle"),h=o.get("show"),d=s.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,I){var N=I%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:o>1?1.2:1.1,h=a>0?u:1/u;this._checkTriggerMoveZoom(this,"zoom","zoomOnMouseWheel",r,{scale:h,originX:s,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:s,originY:l,isAvailableBehavior:null})}}}},e.prototype._pinchHandler=function(r){if(!(Dmt(this._zr,"globalPan")||kB(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,o){r._checkPointer(a,o.originX,o.originY)&&(by(a.event),a.__ecRoamConsumed=!0,Mmt(r,n,i,a,o))},e}(qf);function kB(t){return t.__ecRoamConsumed}var eQr=Gr();function nq(t){var e=eQr(t);return e.roam=e.roam||{},e.uniform=e.uniform||{},e}function EB(t,e,r,n){for(var i=nq(t),a=i.roam,o=a[e]=a[e]||[],s=0;s=4&&(h={x:parseFloat(f[0]||0),y:parseFloat(f[1]||0),width:parseFloat(f[2]),height:parseFloat(f[3])})}if(h&&s!=null&&l!=null&&(d=Gmt(h,{x:0,y:0,width:s,height:l}),!r.ignoreViewBox)){var p=i;i=new gr,i.add(p),p.scaleX=p.scaleY=d.scale,p.x=d.x,p.y=d.y}return!r.ignoreRootClip&&s!=null&&l!=null&&i.setClipPath(new nn({shape:{x:0,y:0,width:s,height:l}})),{root:i,width:s,height:l,viewBoxRect:h,viewBoxTransform:d,named:a}},t.prototype._parseNode=function(e,r,n,i,a,o){var s=e.nodeName.toLowerCase(),l,u=i;if(s==="defs"&&(a=!0),s==="text"&&(o=!0),s==="defs"||s==="switch")l=r;else{if(!a){var h=x0e[s];if(h&&Kt(x0e,s)){l=h.call(this,e,r);var d=e.getAttribute("name");if(d){var f={name:d,namedFrom:null,svgNodeTagLower:s,el:l};n.push(f),s==="g"&&(u=f)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:l});r.add(l)}}var p=Bmt[s];if(p&&Kt(Bmt,s)){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,o):v.nodeType===3&&o&&this._parseText(v,l),v=v.nextSibling},t.prototype._parseText=function(e,r){var n=new N_({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});hp(r,n),Wd(e,n,this._defsUsePending,!1,!1),iQr(n,r);var i=n.style,a=i.fontSize;a&&a<9&&(i.fontSize=9,n.scaleX*=a/9,n.scaleY*=a/9);var o=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=o;var s=n.getBoundingRect();return this._textX+=s.width,r.add(n),n},t.internalField=function(){x0e={g:function(e,r){var n=new gr;return hp(r,n),Wd(e,n,this._defsUsePending,!1,!1),n},rect:function(e,r){var n=new nn;return hp(r,n),Wd(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 Wm;return hp(r,n),Wd(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 Go;return hp(r,n),Wd(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 b8;return hp(r,n),Wd(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=zmt(n));var a=new pc({shape:{points:i||[]},silent:!0});return hp(r,a),Wd(e,a,this._defsUsePending,!1,!1),a},polyline:function(e,r){var n=e.getAttribute("points"),i;n&&(i=zmt(n));var a=new Ll({shape:{points:i||[]},silent:!0});return hp(r,a),Wd(e,a,this._defsUsePending,!1,!1),a},image:function(e,r){var n=new nl;return hp(r,n),Wd(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",o=e.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(a),this._textY=parseFloat(i)+parseFloat(o);var s=new gr;return hp(r,s),Wd(e,s,this._defsUsePending,!1,!0),s},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",o=e.getAttribute("dy")||"0",s=new gr;return hp(r,s),Wd(e,s,this._defsUsePending,!1,!0),this._textX+=parseFloat(a),this._textY+=parseFloat(o),s},path:function(e,r){var n=e.getAttribute("d")||"",i=Nct(n);return hp(r,i),Wd(e,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),t}(),Bmt={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 $mt(t,a),Fmt(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 Tpe(e,r,n);return $mt(t,i),Fmt(t,i),i}};function $mt(t,e){var r=t.getAttribute("gradientUnits");r==="userSpaceOnUse"&&(e.global=!0)}function Fmt(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={};Qmt(r,a,a);var o=a.stopColor||r.getAttribute("stop-color")||"#000000",s=a.stopOpacity||r.getAttribute("stop-opacity");if(s){var l=Wc(o),u=l&&l[3];u&&(l[3]*=wy(s),o=Zf(l,"rgba"))}e.colorStops.push({offset:i,color:o})}r=r.nextSibling}}function hp(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),mr(e.__inheritedStyle,t.__inheritedStyle))}function zmt(t){for(var e=sq(t),r=[],n=0;n0;a-=2){var o=n[a],s=n[a-1],l=sq(o);switch(i=i||ka(),s){case"translate":sg(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":mH(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":xy(i,i,-parseFloat(l[0])*w0e,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*w0e);Bd(i,[1,0,u,1,0,0],i);break;case"skewY":var h=Math.tan(parseFloat(l[0])*w0e);Bd(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 Vmt=/([^\s:;]+)\s*:\s*([^:;]+)/g;function Qmt(t,e,r){var n=t.getAttribute("style");if(n){Vmt.lastIndex=0;for(var i;(i=Vmt.exec(n))!=null;){var a=i[1],o=Kt(aq,a)?aq[a]:null;o&&(e[o]=i[2]);var s=Kt(oq,a)?oq[a]:null;s&&(r[s]=i[2])}}}function uQr(t,e,r){for(var n=0;n1e-6;LB[0]=o?(i[0]-n.x)/a:i[0],LB[1]=o?(i[1]-n.y)/a:i[1],io(LB,LB,t.mtRawInv);var s=PQr(t,LB);o0t(e,s,a),fe(r,function(l){l!==e&&o0t(l,s.slice(),a)})}var LB=[];function o0t(t,e,r){var n=t.option;n.center=e,n.zoom=r}function R0e(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 s0t(t,e){var r=e.getShallow("nodeScaleRatio",!0)||1,n=t;return((n.zoom-1)*r+1)/(n.trans[n0].scaleX||1)}function mq(t,e,r,n,i,a,o,s){var l=gq(t);if(!l){r.disable();return}r.enable(Jt(t.get("roam"),o),{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=Ppe(mr({type:c0t(d,t.subType,lct)},h));s&&(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 l0t(t){return function(e,r,n){return D0e.copy(t.getBoundingRect()),D0e.applyTransform(t.getComputedTransform()),D0e.contain(r,n)}}var D0e=new pr(0,0,0,0);function L0e(t,e,r){var n=c0t(e,r,lct);t.registerAction({type:n,event:n,update:"none"},function(i,a,o){a.eachComponent($fe(i,e,r),function(s){t0t(i,s),r0t(i,s,a,o)})})}function c0t(t,e,r){return(t!==Hm?t:e==="map"?"geo":e)+r}function u0t(t){return t.zoom!=null}function M0e(t,e,r,n,i,a,o){var s=new lq(null,a0t(t.ecModel,e));return dq(s,r,n,i,a),o?fq(s,o.x,o.y,o.width,o.height):fq(s,r,n,i,a),C0e(s,t),s}var I0e=["rect","circle","line","ellipse","polygon","polyline","path"],BQr=qt(I0e),$Qr=qt(I0e.concat(["g"])),FQr=qt(I0e.concat(["g"])),h0t=Gr();function vq(t){var e=t.getItemStyle(),r=t.get("areaColor");return r!=null&&(e.fill=r),e}function d0t(t){var e=t.style;e&&(e.stroke=e.stroke||e.fill,e.fill=null)}var f0t=function(){function t(e){var r=this.group=new gr,n=this._transformGroup=new gr;r.add(n),this.uid=DS("ec_map_draw"),this._controller=new hT(e.getZr()),n.add(this._regionsGroup=new gr),n.add(this._svgGroup=new gr)}return t.prototype.draw=function(e,r,n,i,a){var o=this,s=e.getData&&e.getData();P5(e)&&r.eachComponent({mainType:"series",subType:"map"},function(m){!s&&m.getHostGeoModel()===e&&(s=m.getData())});var l=e.coordinateSystem,u=l.view,h=this._regionsGroup,d=this._transformGroup,f=!h.childAt(0)||a,p;l.shouldClip()?(p=S0e(null,u),this.group.setClipPath(new nn({shape:p.clone()}))):this.group.removeClipPath(),r2(d,gT,u,f?null:e);var g=s&&s.getVisual("visualMeta")&&s.getVisual("visualMeta").length>0;l.resourceType==="geoJSON"?this._buildGeoJSON(u,n,l,e,s,g):l.resourceType==="geoSVG"&&this._buildSVG(u,n,l,e,s,g),mq(e,n,this._controller,function(m,v,y){return e.coordinateSystem.containPoint([v,y])},p,function(){o._mouseDownFlag=!1},!1,!0),this._updateMapSelectHandler(e,h,n,i)},t.prototype.__updateOnOwnRoam=function(e){r2(this._transformGroup,gT,e.coordinateSystem.view,null)},t.prototype._buildGeoJSON=function(e,r,n,i,a,o){var s=this._regionsGroupByName=qt(),l=qt(),u=this._regionsGroup,h=n.projection,d=h&&h.stream,f=Px(DB(null,e,pT));function p(v,y){return y&&(v=y(v)),v&&io([],v,f)}function g(v){for(var y=[],b=!d&&h&&h.project,x=0;x=0)&&(h=t);var d=o?{normal:{align:"center",verticalAlign:"middle"}}:null;il(r,Is(i),{labelFetcher:h,labelDataIndex:u,defaultText:n},d);var f=r.getTextContent();if(f&&(h0t(f).ignore=f.ignore,r.textConfig&&o)){var p=r.getBoundingRect().clone();r.textConfig.layoutRect=p,r.textConfig.position=[(o[0]-p.x)/p.width*100+"%",(o[1]-p.y)/p.height*100+"%"]}r.disableLabelAnimation=!0}else r.removeTextContent(),r.removeTextConfig(),r.disableLabelAnimation=null}function m0t(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 v0t(t,e,r,n,i){e||Ly({el:r,componentModel:t,itemName:n,itemTooltipOption:i.get("tooltip")})}function y0t(t,e,r,n){e.highDownSilentOnTouch=!!t.get("selectedMode");var i=n.getModel("emphasis"),a=i.get("focus");return Ea(e,a,i.get("blurScope"),i.get("disabled")),P5(t)&&RNr(e,t,r),a}function b0t(t,e,r){var n=[],i;function a(){i=[]}function o(){i.length&&(n.push(i),i=[])}var s=e({polygonStart:a,polygonEnd:o,lineStart:a,lineEnd:o,point:function(l,u){isFinite(l)&&isFinite(u)&&i.push([l,u])},sphere:function(){}});return!r&&s.polygonStart(),fe(t,function(l){s.lineStart();for(var u=0;u-1&&(i.style.stroke=i.style.fill,i.style.fill=tt.color.neutral00,i.style.lineWidth=2),i},e.prototype.__ownRoamView=function(){return yq(this)?this.coordinateSystem.view:null},e.type="series."+mT,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:tt.color.tertiary},itemStyle:{borderWidth:.5,borderColor:tt.color.border,areaColor:tt.color.background},emphasis:{label:{show:!0,color:tt.color.primary},itemStyle:{areaColor:tt.color.highlight}},select:{label:{show:!0,color:tt.color.primary},itemStyle:{color:tt.color.highlight}},nameProperty:"name"},e}(Ii);function x0t(t){return t.indexOf("i")===0}function yq(t){return MB(t.seriesGroup)===t&&!t.getHostGeoModel()}function MB(t){return t.f[0]}function P0e(t,e){var r={};return t.eachRawSeriesByType(mT,function(n){var i=n.getHostGeoModel(),a=i?"o"+i.id:"i"+n.getMapType(),o=r[a]=r[a]||{f:[],r:[]};!t.isSeriesFiltered(n)&&!e&&o.f.push(n),o.r.push(n)}),r}var UQr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=mT,r}return e.prototype.render=function(r,n,i,a){if(!(a&&a.type==="mapToggleSelect"&&a.from===this.uid)){var o=this.group;if(o.removeAll(),!r.getHostGeoModel()){var s=this._mapDraw;s&&a&&a.type==="geoRoam"&&s.resetForLabelLayout(),a&&a.type==="geoRoam"&&a.componentType==="series"&&a.seriesId===r.id?s&&o.add(s.group):yq(r)?(s=s||(this._mapDraw=new f0t(i)),o.add(s.group),s.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;yq(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,o){if(!isNaN(a)){var s=n.getItemLayout(o);if(!(!s||!s.point)){var l=s.point,u=s.offset,h=new Wm({style:{fill:r.getData().getVisual("style").fill},shape:{cx:l[0]+u*9,cy:l[1],r:3},silent:!0,z2:8+(u?0:F_+1)});if(!u){var d=MB(r.seriesGroup).getData(),f=n.getName(o),p=d.indexOfName(f),g=n.getItemModel(o),m=g.getModel("label"),v=d.getItemGraphicEl(p);il(h,Is(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){gW(h,y)}}i.add(h)}}})},e.type=mT,e}(ki),VQr={geoJSON:{aspectScale:.75,invertLongitute:!0},geoSVG:{aspectScale:1,invertLongitute:!1}},w0t=["lng","lat"],A0t=function(t){nt(e,t);function e(r,n,i){var a=t.call(this)||this;a.dimensions=w0t,a.type="geo",a._nameCoordMap=qt(),a.name=r;var o=i.projection,s=Fy.load(n,i.nameMap,i.nameProperty),l=Fy.getGeoResource(n);a.resourceType=l?l.type:null;var u=a.regions=s.regions,h=VQr[l.type];a._clip=i.clip;var d=o?!1:h.invertLongitute;a.view=new lq(d,a0t(i.ecModel,i.api),a),a.map=n,a._regionsMap=s.regionsMap,a.regions=s.regions,a.projection=o;var f;if(o)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=ba(A,m),w=Nut(t,w,v)}fq(r,w.x,w.y,w.width,w.height),C0e(r,t)}function QQr(t,e){fe(e.get("geoCoord"),function(r,n){t.addGeoCoord(n,r)})}var GQr=function(){function t(){this.dimensions=w0t}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,o){var s=a.get("map"),l=new A0t(s+o,s,lt({nameMap:a.get("nameMap"),api:r,ecModel:e},i(a)));n.push(l),a.coordinateSystem=l,l.model=a,l.resize=T0t,l.resize(a,r)}),e.eachSeries(function(a){L8({targetModel:a,coordSysType:"geo",coordSysProvider:function(){var o=a.subType===mT?a.getHostGeoModel():a.getReferringComponents("geo",xo).models[0];return o&&o.coordinateSystem},allowNotFound:!0})}),fe(P0e(e,!0),function(a,o){if(x0t(o)){var s=a.r[0],l=[];fe(a.r,function(f){l.push(f.get("nameMap")),f.seriesGroup=null});var u=o.slice(1),h=new A0t(u,u,lt({nameMap:uH(l),api:r,ecModel:e},i(s))),d;fe(a.r,function(f){d=Jt(d,f.get("scaleLimit"))}),n.push(h),h.resize=T0t,h.resize(s,r),fe(a.r,function(f){f.coordinateSystem=h,QQr(h,f)})}}),n},t.prototype.getFilledRegions=function(e,r,n,i){for(var a=(e||[]).slice(),o=qt(),s=0;s=0;o--){var s=i[o];s.hierNode={defaultAncestor:null,ancestor:s,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},r.push(s)}}function tGr(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){nGr(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=iGr(t,i,t.parentNode.hierNode.defaultAncestor||n[0],e)}function rGr(t){var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function k0t(t){return arguments.length?t:sGr}function IB(t,e){return t-=Math.PI/2,{x:e*Math.cos(t),y:e*Math.sin(t)}}function nGr(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 iGr(t,e,r,n){if(e){for(var i=t,a=t,o=a.parentNode.children[0],s=e,l=i.hierNode.modifier,u=a.hierNode.modifier,h=o.hierNode.modifier,d=s.hierNode.modifier;s=N0e(s),a=B0e(a),s&&a;){i=N0e(i),o=B0e(o),i.hierNode.ancestor=t;var f=s.hierNode.prelim+d-a.hierNode.prelim-u+n(s,a);f>0&&(oGr(aGr(s,t,r),t,f),u+=f,l+=f),d+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=i.hierNode.modifier,h+=o.hierNode.modifier}s&&!N0e(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=d-l),a&&!B0e(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-h,r=t)}return r}function N0e(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}function B0e(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}function aGr(t,e,r){return t.hierNode.ancestor.parentNode===e.parentNode?t.hierNode.ancestor:r}function oGr(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 sGr(t,e){return t.parentNode===e.parentNode?1:2}var dp=Gr();function E0t(t){var e=t.mainData,r=t.datas;r||(r={main:e},t.datasAttr={main:"data"}),t.datas=t.mainData=null,_0t(e,r,t),fe(r,function(n){fe(e.TRANSFERABLE_METHODS,function(i){n.wrapMethod(i,Kr(lGr,t))})}),e.wrapMethod("cloneShallow",Kr(uGr,t)),fe(e.CHANGABLE_METHODS,function(n){e.wrapMethod(n,Kr(cGr,t))}),uc(r[e.dataType]===e)}function lGr(t,e){if(fGr(this)){var r=lt({},dp(this).datas);r[this.dataType]=e,_0t(e,r,t)}else $0e(e,this.dataType,dp(this).mainData,t);return e}function cGr(t,e){return t.struct&&t.struct.update(),e}function uGr(t,e){return fe(dp(e).datas,function(r,n){r!==e&&$0e(r.cloneShallow(),n,e,t)}),e}function hGr(t){var e=dp(this).mainData;return t==null||e==null?e:dp(e).datas[t]}function dGr(){var t=dp(this).mainData;return t==null?[{data:t}]:vt(En(dp(t).datas),function(e){return{type:e,data:dp(t).datas[e]}})}function fGr(t){return dp(t).mainData===t}function _0t(t,e,r){dp(t).datas={},fe(e,function(n,i){$0e(n,i,t,r)})}function $0e(t,e,r,n){dp(r).datas[e]=t,dp(t).mainData=r,t.dataType=e,n.struct&&(t[n.structAttr]=n.struct,n.struct[n.datasAttr[e]]=t),t.getLinkedData=hGr,t.getLinkedDataAll=dGr}var pGr=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||{},$t(e)&&(e={order:e});var i=e.order||"preorder",a=this[e.attr||"children"],o;i==="preorder"&&(o=r.call(n,this));for(var s=0;!o&&sr&&(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($t(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 R0t(t){for(var e=[];t;)t=t.parentNode,t&&e.push(t);return e.reverse()}function z0e(t,e){var r=R0t(t);return Nr(r,e)>=0}function bq(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 vT="tree",mGr=function(t){nt(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 bn(i,this,this.ecModel),o=F0e.createTree(n,this,s);function s(d){d.wrapMethod("getItemModel",function(f,p){var g=o.getNodeByDataIndex(p);return g&&g.children.length&&g.isExpand||(f.parentModel=a),f})}var l=0;o.eachNode("preorder",function(d){d.depth>l&&(l=d.depth)});var u=r.expandAndCollapse,h=u&&r.initialTreeDepth>=0?r.initialTreeDepth:l;return o.root.eachNode("preorder",function(d){var f=d.hostTree.data.getRawDataItem(d.dataIndex);d.isExpand=f&&f.collapsed!=null?!f.collapsed:d.depth<=h}),o.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,o=a.root.children[0],s=a.getNodeByDataIndex(r),l=s.getValue(),u=s.name;s&&s!==o;)u=s.parentNode.name+"."+u,s=s.parentNode;return fs("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=bq(i,this),n.collapsed=!i.isExpand,n},e.prototype.__ownRoamView=function(){return this.coordinateSystem},e.type="series."+vT,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:tt.color.borderTint,width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},e}(Ii),vGr=function(){function t(){this.parentPoint=[],this.childPoints=[]}return t}(),yGr=function(t){nt(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:tt.color.neutral99,fill:null}},e.prototype.getDefaultShape=function(){return new vGr},e.prototype.buildPath=function(r,n){var i=n.childPoints,a=i.length,o=n.parentPoint,s=i[0],l=i[a-1];if(a===1){r.moveTo(o[0],o[1]),r.lineTo(s[0],s[1]);return}var u=n.orient,h=u==="TB"||u==="BT"?0:1,d=1-h,f=Qt(n.forkPosition,1),p=[];p[h]=o[h],p[d]=o[d]+(l[d]-o[d])*f,r.moveTo(o[0],o[1]),r.lineTo(p[0],p[1]),r.moveTo(s[0],s[1]),p[h]=s[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",C=s.getModel("label"),k=C.get("rotate"),E=k*(Math.PI/180),_=v.getTextContent();_&&(v.setTextConfig({position:C.get("position")||T,rotation:k==null?-w:E,origin:"center"}),_.setStyle("verticalAlign","middle"))}var P=s.get(["emphasis","focus"]),L=P==="relative"?b_(o.getAncestorsIndices(),o.getDescendantIndices()):P==="ancestor"?o.getAncestorsIndices():P==="descendant"?o.getDescendantIndices():null;L&&(Cr(r).focus=L),xGr(i,o,h,r,g,p,m,n),r.__edge&&(r.onHoverStateChange=function(R){if(R!=="blur"){var D=o.parentNode&&t.getItemGraphicEl(o.parentNode.dataIndex);D&&D.hoverState===g8||gW(r.__edge,R)}})}function xGr(t,e,r,n,i,a,o,s){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 G_({shape:U0e(h,d,f,i,i)})),qn(m,{shape:U0e(h,d,f,a,o)},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 AGr(t,e){t.eachSeriesByType("tree",function(r){SGr(r,e)})}function SGr(t,e){var r=Ps(t,e).refContainer,n=ba(t.getBoxLayoutParams(),r);t.layoutInfo=n;var i=t.get("layout"),a=0,o=0,s=null;i==="radial"?(a=2*Math.PI,o=Math.min(n.height,n.width)/2,s=k0t(function(w,A){return(w.parentNode===A.parentNode?1:2)/w.depth})):(a=n.width,o=n.height,s=k0t());var l=t.getData().tree.root,u=l.children[0];if(u){eGr(l),wGr(u,tGr,s),l.hierNode.modifier=-u.hierNode.prelim,NB(u,rGr);var h=u,d=u,f=u;NB(u,function(w){var A=w.getLayout().x;Ad.getLayout().x&&(d=w),w.depth>f.depth&&(f=w)});var p=h===d?1:s(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=o/(f.depth-1||1),NB(u,function(w){y=(w.getLayout().x+g)*m,b=(w.depth-1)*v;var A=IB(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=o/(d.getLayout().x+p+g),m=a/(f.depth-1||1),NB(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=o/(f.depth-1||1),NB(u,function(w){y=(w.getLayout().x+g)*m,b=x==="TB"?(w.depth-1)*v:o-(w.depth-1)*v,w.setLayout({x:y,y:b},!0)}))}}}function TGr(t){t.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(e,r){r.eachComponent({mainType:Hm,subType:vT,query:e},function(n){var i=e.dataIndex,a=n.getData().tree,o=a.getNodeByDataIndex(i);o.isExpand=!o.isExpand})}),L0e(t,Hm,vT)}var CGr=Ls(vT,OGr);function OGr(t){t.eachSeriesByType(vT,function(e){var r=e.getData(),n=r.tree;n.eachNode(function(i){var a=i.getModel(),o=a.getModel("itemStyle").getItemStyle(),s=r.ensureUniqueItemVisual(i.dataIndex,"style");lt(s,o)})})}function kGr(t){t.registerChartView(bGr),t.registerSeriesModel(mGr),t.registerLayout(AGr),t.registerVisual(CGr),TGr(t)}var N0t=["treemapZoomToNode","treemapRender","treemapMove"];function EGr(t){for(var e=0;e1;)a=a.parentNode;var o=hge(t.ecModel,a.name||a.dataIndex+"",n);i.setVisual("decal",o)})}var _Gr=function(t){nt(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};$0t(i);var a=r.levels||[],o=this.designatedVisualItemStyle={},s=new bn({itemStyle:o},this,n);a=r.levels=RGr(a,n);var l=vt(a||[],function(d){return new bn(d,s,n)},this),u=F0e.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||s,f})}return u.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.formatTooltip=function(r,n,i){var a=this.getData(),o=this.getRawValue(r),s=a.getName(r);return fs("nameValue",{name:s,value:o})},e.prototype.getDataParams=function(r){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(r);return n.treeAncestors=bq(i,this),n.treePathInfo=n.treeAncestors,n},e.prototype.setLayoutInfo=function(r){this.layoutInfo=this.layoutInfo||{},lt(this.layoutInfo,r)},e.prototype.mapIdToIndex=function(r){var n=this._idIndexMap;n||(n=this._idIndexMap=qt(),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(){B0t(this)},e.type="series.treemap",e.layoutMode="box",e.defaultOption={progressive:0,coordinateSystemUsage:"box",left:tt.size.l,top:tt.size.xxxl,right:tt.size.l,bottom:tt.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:tt.size.m,emptyItemWidth:25,itemStyle:{color:tt.color.backgroundShade,textStyle:{color:tt.color.secondary}},emphasis:{itemStyle:{color:tt.color.background}}},label:{show:!0,distance:0,padding:5,position:"inside",color:tt.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:tt.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}(Ii);function $0t(t){var e=0;fe(t.children,function(n){$0t(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 RGr(t,e){var r=qi(e.get("color")),n=qi(e.get(["aria","decal","decals"]));if(r){t=t||[];var i,a;fe(t,function(s){var l=new bn(s),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 o=t[0]||(t[0]={});return i||(o.color=r.slice()),!a&&n&&(o.decal=n.slice()),t}}var DGr=8,F0t=8,V0e=5,LGr=function(){function t(e){this.group=new gr,e.add(this.group)}return t.prototype.render=function(e,r,n,i){var a=e.getModel("breadcrumb"),o=this.group;if(o.removeAll(),!(!a.get("show")||!n)){var s=a.getModel("itemStyle"),l=a.getModel("emphasis"),u=s.getModel("textStyle"),h=l.getModel(["itemStyle","textStyle"]),d=Ps(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=ba(f,d);this._prepare(n,p,u),this._renderContent(e,p,g,s,l,u,h,i),UW(o,f,d)}},t.prototype._prepare=function(e,r,n){for(var i=e;i;i=i.parentNode){var a=Ds(i.getModel().get("name"),""),o=n.getTextRect(a),s=Math.max(o.width+DGr*2,r.emptyItemWidth);r.totalWidth+=s+F0t,r.renderList.push({node:i,text:a,width:s})}},t.prototype._renderContent=function(e,r,n,i,a,o,s,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 pc({shape:{points:MGr(u,0,b,d,m===p.length-1,m===0)},style:mr(i.getItemStyle(),{lineJoin:"bevel"}),textContent:new $n({style:ji(o,{text:x})}),textConfig:{position:"inside"},z2:F_*1e4,onclick:Kr(l,y)});w.disableLabelAnimation=!0,w.getTextContent().ensureState("emphasis").style=ji(s,{text:x}),w.ensureState("emphasis").style=g,Ea(w,a.get("focus"),a.get("blurScope"),a.get("disabled")),this.group.add(w),IGr(w,e,y),u+=b+F0t}},t.prototype.remove=function(){this.group.removeAll()},t}();function MGr(t,e,r,n,i,a){var o=[[i?t:t-V0e,e],[t+r,e],[t+r,e+n],[i?t:t-V0e,e+n]];return!a&&o.splice(2,0,[t+r+V0e,e+n/2]),!i&&o.push([t,e+n/2]),o}function IGr(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&&bq(r,e)}}var PGr=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"?o-l-1:l].getValue();u/r*es[1]&&(s[1]=u)})),{sum:n,dataExtent:s}}function HGr(t,e,r){for(var n=0,i=1/0,a=0,o=void 0,s=t.length;an&&(n=o));var l=t.area*t.area,u=e*e*r;return l?BB(u*n/l,l/(u*i)):1/0}function V0t(t,e,r,n,i){var a=e===r.width?0:1,o=1-a,s=["x","y"],l=["width","height"],u=r[s[a]],h=e?t.area/e:0;(i||h>r[l[o]])&&(h=r[l[o]]);for(var d=0,f=t.length;dc8&&(h=c8),i=l}hq0t||Math.abs(r.dy)>q0t)){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,o=this.seriesModel;if(this._state!=="animating"){var s=o.getData().tree.root;if(!s)return;var l=s.getLayout();if(!l)return;var u=new pr(l.x,l.y,l.width,l.height),h=o.layoutInfo,d=H0t(h,l),f=d*a;f=W0t(f,o);var p=f/d;n-=h.x,i-=h.y;var g=ka();sg(g,g,[-n,-i]),mH(g,g,[p,p]),sg(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 o=n.findTarget(i.offsetX,i.offsetY);if(o){var s=o.node;if(s.getLayout().isLeafRoot)n._rootToNode(o);else if(a==="zoomToNode")n._zoomToNode(o);else if(a==="link"){var l=s.hostTree.data.getItemModel(s.dataIndex),u=l.get("link",!0),h=l.get("target",!0)||"blank";u&&BW(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 LGr(this.group))).render(r,n,i.node,function(o){a._state!=="animating"&&(z0e(r.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=$B(),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(o){var s=this._storage.background[o.getRawIndex()];if(s){var l=s.transformCoordToLocal(r,n),u=s.shape;if(u.x<=l[0]&&l[0]<=u.x+u.width&&u.y<=l[1]&&l[1]<=u.y+u.height)i={node:o,offsetX:l[0],offsetY:l[1]};else return!1}},this),i},e.type="treemap",e}(ki);function $B(){return{nodeGroup:[],background:[],content:[]}}function ZGr(t,e,r,n,i,a,o,s,l,u){if(!o)return;var h=o.getLayout(),d=t.getData(),f=o.getModel();if(d.setItemGraphicEl(o.dataIndex,null),!h||!h.isInView)return;var p=h.width,g=h.height,m=h.borderWidth,v=h.invisible,y=o.getRawIndex(),b=s&&s.getRawIndex(),x=o.viewChildren,w=h.upperHeight,A=x&&x.length,S=f.getModel("itemStyle"),T=f.getModel(["emphasis","itemStyle"]),C=f.getModel(["blur","itemStyle"]),k=f.getModel(["select","itemStyle"]),E=S.get("borderRadius")||0,_=G("nodeGroup",G0e);if(!_)return;if(l.add(_),_.x=h.x||0,_.y=h.y||0,_.markRedraw(),wq(_).nodeWidth=p,wq(_).nodeHeight=g,h.isAboveViewRoot)return _;var P=G("background",Y0t,u,jGr);P&&B(_,P,A&&h.upperLabelHeight);var L=f.getModel("emphasis"),R=L.get("focus"),D=L.get("blurScope"),M=L.get("disabled"),I=R==="ancestor"?o.getAncestorsIndices():R==="descendant"?o.getDescendantIndices():R;if(A)v8(_)&&AS(_,!1),P&&(AS(P,!M),d.setItemGraphicEl(o.dataIndex,P),ype(P,I,D));else{var N=G("content",Y0t,u,XGr);N&&V(_,N),P.disableMorphing=!0,P&&v8(P)&&AS(P,!1),AS(_,!M),d.setItemGraphicEl(o.dataIndex,_);var F=f.getShallow("cursor");F&&N.attr("cursor",F),ype(_,I,D)}return _;function B(ne,X,J){var ee=Cr(X);if(ee.dataIndex=o.dataIndex,ee.seriesIndex=t.seriesIndex,X.setShape({x:0,y:0,width:p,height:g,r:E}),v)z(X);else{X.invisible=!1;var te=o.getVisual("style"),pe=te.stroke,ie=K0t(S);ie.fill=pe;var Ce=yT(T);Ce.fill=T.get("borderColor");var ke=yT(C);ke.fill=C.get("borderColor");var Ee=yT(k);if(Ee.fill=k.get("borderColor"),J){var ue=p-2*m;U(X,pe,te.opacity,{x:m,y:0,width:ue,height:w})}else X.removeTextContent();X.setStyle(ie),X.ensureState("emphasis").style=Ce,X.ensureState("blur").style=ke,X.ensureState("select").style=Ee,wS(X)}ne.add(X)}function V(ne,X){var J=Cr(X);J.dataIndex=o.dataIndex,J.seriesIndex=t.seriesIndex;var ee=Math.max(p-2*m,0),te=Math.max(g-2*m,0);if(X.culling=!0,X.setShape({x:m,y:m,width:ee,height:te,r:E}),v)z(X);else{X.invisible=!1;var pe=o.getVisual("style"),ie=pe.fill,Ce=K0t(S);Ce.fill=ie,Ce.decal=pe.decal;var ke=yT(T),Ee=yT(C),ue=yT(k);U(X,ie,pe.opacity,null),X.setStyle(Ce),X.ensureState("emphasis").style=ke,X.ensureState("blur").style=Ee,X.ensureState("select").style=ue,wS(X)}ne.add(X)}function z(ne){!ne.invisible&&a.push(ne)}function U(ne,X,J,ee){var te=f.getModel(ee?X0t:j0t),pe=Ds(f.get("name"),null),ie=te.getShallow("show");il(ne,Is(f,ee?X0t:j0t),{defaultText:ie?pe:null,inheritColor:X,defaultOpacity:J,labelFetcher:t,labelDataIndex:o.dataIndex});var Ce=ne.getTextContent();if(Ce){var ke=Ce.style,Ee=FN(ke.padding||0);ee&&(ne.setTextConfig({layoutRect:ee}),Ce.disableLabelLayout=!0),Ce.beforeUpdate=function(){var de=Math.max((ee?ee.width:ne.shape.width)-Ee[1]-Ee[3],0),xe=Math.max((ee?ee.height:ne.shape.height)-Ee[0]-Ee[2],0);(ke.width!==de||ke.height!==xe)&&Ce.setStyle({width:de,height:xe})},ke.truncateMinChar=2,ke.lineOverflow="truncate",Q(ke,ee,h);var ue=Ce.getState("emphasis");Q(ue?ue.style:null,ee,h)}}function Q(ne,X,J){var ee=ne?ne.text:null;if(!X&&J.isLeafRoot&&ee!=null){var te=t.get("drillDownIcon",!0);ne.text=te?te+" "+ee:ee}}function G(ne,X,J,ee){var te=b!=null&&r[ne][b],pe=i[ne];return te?(r[ne][b]=null,q(pe,te)):v||(te=new X,te instanceof tp&&(te.z2=JGr(J,ee)),Y(pe,te)),e[ne][y]=te}function q(ne,X){var J=ne[y]={};X instanceof G0e?(J.oldX=X.x,J.oldY=X.y):J.oldShape=lt({},X.shape)}function Y(ne,X){var J=ne[y]={},ee=o.parentNode,te=X instanceof gr;if(ee&&(!n||n.direction==="drillDown")){var pe=0,ie=0,Ce=i.background[ee.getRawIndex()];!n&&Ce&&Ce.oldShape&&(pe=Ce.oldShape.width,ie=Ce.oldShape.height),te?(J.oldX=0,J.oldY=ie):J.oldShape={x:pe,y:ie,width:0,height:0}}J.fadein=!te}}function JGr(t,e){return t*qGr+e}var FB=fe,eHr=yr,Aq=-1,ol=function(){function t(e){var r=e.mappingMethod,n=e.type,i=this.option=lr(e);this.type=n,this.mappingMethod=r,this._normalizeData=nHr[r];var a=t.visualHandlers[n];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[r],r==="piecewise"?(H0e(i),tHr(i)):r==="category"?i.categories?rHr(i):H0e(i,!0):(uc(r!=="linear"||i.dataExtent),H0e(i))}return t.prototype.mapValueToVisual=function(e){var r=this._normalizeData(e);return this._normalizedToVisual(r,e)},t.prototype.getNormalizer=function(){return Wt(this._normalizeData,this)},t.listVisualTypes=function(){return En(t.visualHandlers)},t.isValidType=function(e){return t.visualHandlers.hasOwnProperty(e)},t.eachVisual=function(e,r,n){yr(e)?fe(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(o,s){var l=r.call(n,o,s);i?a=l:a[s]=l}),a},t.retrieveVisuals=function(e){var r={},n;return e&&FB(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(eHr(e)){var r=[];FB(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,o=0,s=r.length;o=0;a--)n[a]==null&&(delete r[e[a]],e.pop())}function H0e(t,e){var r=t.visual,n=[];yr(r)?FB(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]),J0t(t,n)}function Sq(t){return{applyVisual:function(e,r,n){var i=this.mapValueToVisual(e);n("color",t(r("color"),i))},_normalizedToVisual:W0e([0,1])}}function Z0t(t){var e=this.option.visual;return e[Math.round(Zn(t,[0,1],[0,e.length-1],!0))]||{}}function zB(t){return function(e,r,n){n(t,this.mapValueToVisual(e))}}function UB(t){var e=this.option.visual;return e[this.option.loop&&t!==Aq?t%e.length:t]}function bT(){return this.option.visual[0]}function W0e(t){return{linear:function(e){return Zn(e,t,this.option.visual,!0)},category:UB,piecewise:function(e,r){var n=Y0e.call(this,r);return n==null&&(n=Zn(e,t,this.option.visual,!0)),n},fixed:bT}}function Y0e(t){var e=this.option,r=e.pieceList;if(e.hasSpecialVisual){var n=ol.findPieceIndex(t,r),i=r[n];if(i&&i.visual)return i.visual[this.type]}}function J0t(t,e){return t.visual=e,t.type==="color"&&(t.parsedVisual=vt(e,function(r){var n=Wc(r);return n||[0,0,0,1]})),e}var nHr={linear:function(t){return Zn(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,r=ol.findPieceIndex(t,e,!0);if(r!=null)return Zn(r,[0,e.length-1],[0,1],!0)},category:function(t){var e=this.option.categories?this.option.categoryMap[t]:t;return e??Aq},fixed:no};function Tq(t,e,r){return t?e<=r:e=r.length||m===r[m.depth]){var y=cHr(i,l,m,v,g,n);tvt(m,y,r,n)}})}}}function oHr(t,e,r){var n=lt({},e),i=r.designatedVisualItemStyle;return fe(["color","colorAlpha","colorSaturation"],function(a){i[a]=e[a];var o=t.get(a);i[a]=null,o!=null&&(n[a]=o)}),n}function rvt(t){var e=q0e(t,"color");if(e){var r=q0e(t,"colorAlpha"),n=q0e(t,"colorSaturation");return n&&(e=Ay(e,null,null,n)),r&&(e=t8(e,r)),e}}function sHr(t,e){return e!=null?Ay(e,null,null,t):null}function q0e(t,e){var r=t[e];if(r!=null&&r!=="none")return r}function lHr(t,e,r,n,i,a){if(!(!a||!a.length)){var o=j0e(e,"color")||i.color!=null&&i.color!=="none"&&(j0e(e,"colorAlpha")||j0e(e,"colorSaturation"));if(o){var s=e.get("visualMin"),l=e.get("visualMax"),u=r.dataExtent.slice();s!=null&&su[1]&&(u[1]=l);var h=e.get("colorMappingBy"),d={type:o.name,dataExtent:u,visual:o.range};d.type==="color"&&(h==="index"||h==="id")?(d.mappingMethod="category",d.loop=!0):d.mappingMethod="linear";var f=new ol(d);return evt(f).drColorMappingBy=h,f}}}function j0e(t,e){var r=t.get(e);return ft(r)&&r.length?{name:e,range:r}:null}function cHr(t,e,r,n,i,a){var o=lt({},e);if(i){var s=i.type,l=s==="color"&&evt(i).drColorMappingBy,u=l==="index"?n:l==="id"?a.mapIdToIndex(r.getId()):r.getValue(t.get("visualDimension"));o[s]=i.mapValueToVisual(u)}return o}function uHr(t){t.registerSeriesModel(_Gr),t.registerChartView(KGr),t.registerVisual(aHr),t.registerLayout(zGr),EGr(t)}function N5(t){return"_EC_"+t}var hHr=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[N5(e)]){var i=new xT(e,r);return i.hostGraph=this,this.nodes.push(i),n[N5(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[N5(e)]},t.prototype.addEdge=function(e,r,n){var i=this._nodesMap,a=this._edgesMap;if(Vn(e)&&(e=this.nodes[e]),Vn(r)&&(r=this.nodes[r]),e instanceof xT||(e=i[N5(e)]),r instanceof xT||(r=i[N5(r)]),!(!e||!r)){var o=e.id+"-"+r.id,s=new nvt(e,r,n);return s.hostGraph=this,this._directed&&(e.outEdges.push(s),r.inEdges.push(s)),e.edges.push(s),e!==r&&r.edges.push(s),this.edges.push(s),a[o]=s,s}},t.prototype.getEdgeByIndex=function(e){var r=this.edgeData.getRawIndex(e);return this.edges[r]},t.prototype.getEdge=function(e,r){e instanceof xT&&(e=e.id),r instanceof xT&&(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 xT||(r=this._nodesMap[N5(r)]),!!r){for(var a=n==="out"?"outEdges":n==="in"?"inEdges":"edges",o=0;o=0&&l.node2.dataIndex>=0});for(var a=0,o=i.length;a=0&&!e.hasKey(g)&&(e.set(g,!0),o.push(p.node1))}for(l=0;l=0&&!e.hasKey(x)&&(e.set(x,!0),s.push(b.node2))}}}return{edge:e.keys(),node:r.keys()}},t}(),nvt=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=qt(),r=qt();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 ivt(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)}}}Qo(xT,ivt("hostGraph","data")),Qo(nvt,ivt("hostGraph","edgeData"));function X0e(t,e,r,n,i){for(var a=new hHr(n),o=0;o "+f)),u++)}var p=r.get("coordinateSystem"),g;if(p==="cartesian2d"||p==="polar"||p==="matrix")g=jm(t,r);else{var m=r5.get(p),v=m?m.dimensions||[]:[];Nr(v,"value")<0&&v.concat(["value"]);var y=v5(t,{coordDimensions:v,encodeDefine:r.getEncode()}).dimensions;g=new jc(y,r),g.initData(t)}var b=new jc(["value"],r);return b.initData(l,s),i&&i(g,b),E0t({mainData:g,struct:a,structAttr:"graph",datas:{node:g,edge:b},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var K0e="-->",Cq=function(t){return t.get("autoCurveness")||null},avt=function(t,e){var r=Cq(t),n=20,i=[];if(Vn(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 o=0;o "),value:o.value,noValue:o.value==null})}var d=Uht({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:lt({value:0},i)}),n=new jc(["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 e0t(r)&&r},e.type="series."+$u,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:tt.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:tt.color.primary}}},e}(Ii);function Oq(t){return t instanceof Array||(t=[t,t]),t}var vHr=Ls($u,yHr);function yHr(t){t.eachSeriesByType($u,function(e){var r=e.getGraph(),n=e.getEdgeData(),i=Oq(e.get("edgeSymbol")),a=Oq(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(o){var s=n.getItemModel(o),l=r.getEdgeByIndex(o),u=Oq(s.getShallow("symbol",!0)),h=Oq(s.getShallow("symbolSize",!0)),d=s.getModel("lineStyle").getLineStyle(),f=n.ensureUniqueItemVisual(o,"style");switch(lt(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 svt(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")])}),eve(r,t)}}function eve(t,e){t.eachEdge(function(r,n){var i=Bh(r.getModel().get(["lineStyle","curveness"]),-J0e(r,e,n,!0),0),a=km(r.node1.getLayout()),o=km(r.node2.getLayout()),s=[a,o];+i&&s.push([(a[0]+o[0])/2-(a[1]-o[1])*i,(a[1]+o[1])/2-(o[0]-a[0])*i]),r.setLayout(s)})}var bHr=Ls($u,xHr);function xHr(t,e){t.eachSeriesByType($u,function(r){var n=r.get("layout"),i=r.coordinateSystem;if(i&&i.type!=="view"){var a=r.getData(),o=[];fe(i.dimensions,function(f){o=o.concat(a.mapDimensionsAll(f))});for(var s=0;s0&&(A[0]=-A[0],A[1]=-A[1]);var T=w[0]<0?-1:1;if(a.__position!=="start"&&a.__position!=="end"){var C=-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=o,a.setStyle({verticalAlign:a.__verticalAlign||m,align:a.__align||g})}},e}(gr),lve=function(){function t(e){this.group=new gr,this._LineCtor=e||sve}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 o=mvt(e);e.diff(a).add(function(s){r._doAdd(e,s,o)}).update(function(s,l){r._doUpdate(a,e,l,s,o)}).remove(function(s){i.remove(a.getItemGraphicEl(s))}).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=mvt(e),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(e,r,n){this._progressiveEls=[];function i(l){!l.isGroup&&!RHr(l)&&(l.incremental=n,l.ensureState("emphasis").hoverLayer=Y_)}for(var a=e.start;a0}function mvt(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:Is(e)}}function vvt(t){return isNaN(t[0])||isNaN(t[1])}function cve(t){return t&&!vvt(t[0])&&!vvt(t[1])}var uve=[],hve=[],dve=[],$5=_l,fve=Ex,yvt=Math.abs;function bvt(t,e,r){for(var n=t[0],i=t[1],a=t[2],o=1/0,s,l=r*r,u=.1,h=.1;h<=.9;h+=.1){uve[0]=$5(n[0],i[0],a[0],h),uve[1]=$5(n[1],i[1],a[1],h);var d=yvt(fve(uve,e)-l);d=0?s=s+u:s=s-u:g>=0?s=s-u:s=s+u}return s}function pve(t,e){var r=[],n=ZN,i=[[],[],[]],a=[[],[]],o=[];e/=2,t.eachEdge(function(s,l){var u=s.getLayout(),h=s.getVisual("fromSymbol"),d=s.getVisual("toSymbol");u.__original||(u.__original=[km(u[0]),km(u[1])],u[2]&&u.__original.push(km(u[2])));var f=u.__original;if(u[2]!=null){if(hc(i[0],f[0]),hc(i[1],f[2]),hc(i[2],f[1]),h&&h!=="none"){var p=GB(s.node1),g=bvt(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=GB(s.node2),g=bvt(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]}hc(u[0],i[0]),hc(u[1],i[2]),hc(u[2],i[1])}else{if(hc(a[0],f[0]),hc(a[1],f[1]),kx(o,a[1],a[0]),HA(o,o),h&&h!=="none"){var p=GB(s.node1);fH(a[0],a[0],o,p*e)}if(d&&d!=="none"){var p=GB(s.node2);fH(a[1],a[1],o,-p*e)}hc(u[0],a[0]),hc(u[1],a[1])}})}var xvt=Gr();function DHr(t){if(t)return xvt(t).bridge}function wvt(t,e){t&&(xvt(t).bridge=e)}var LHr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=$u,r}return e.prototype.init=function(r,n){var i=new fB,a=new lve,o=this.group,s=new gr;this._controller=new hT(n.getZr()),s.add(i.group),s.add(a.group),o.add(s),this._symbolDraw=i,this._lineDraw=a,this._mainGroup=s,this._firstRender=!0},e.prototype.render=function(r,n,i){var a=this,o=gq(r),s=!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;o&&r2(l,n0,o,this._firstRender?null:r),pve(r.getGraph(),QB(r));var f=r.getData();h.updateData(f);var p=r.getEdgeData();d.updateData(p),this._updateNodeAndLinkScale(),o&&mq(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&&(s=!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 C=T.get("draggable");C&&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),rve(r,"symbolSize",w,[E.offsetX,E.offsetY]),a.updateLayout(r);break;case"none":default:f.setItemLayout(A,[S.x,S.y]),eve(r.getGraph(),r),a.updateLayout(r);break}}).on("dragend",function(){g&&g.setUnfixed(A)}),S.setDraggable(C,!!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){cvt(w,y,b,x)}),this._firstRender=!1,s||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,o=!1;(function s(){r.step(function(l){a.updateLayout(a._model),(l||!o)&&(o=!0,a._renderThumbnail(a._model,n,a._symbolDraw,a._lineDraw)),(a._layouting=!l)&&(i?a._layoutTimeout=setTimeout(s,16):s())})})()},e.prototype.__updateOnOwnRoam=function(r,n,i){var a=gq(n);!this._active||!a||(r2(this._mainGroup,n0,a,null),u0t(r)&&(this._updateNodeAndLinkScale(),pve(n.getGraph(),QB(n)),this._lineDraw.updateLayout(),i.updateLabelLayout()),this._updateThumbnailWindow())},e.prototype._updateNodeAndLinkScale=function(){var r=this._model,n=r.getData(),i=QB(r);n.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(i)})},e.prototype.updateLayout=function(r){this._active&&(pve(r.getGraph(),QB(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=DHr(r);if(i)return{bridge:i,coordSys:n}}},e.prototype._updateThumbnailWindow=function(){var r=this._getThumbnailInfo();r&&r.bridge.updateWindow(uq(null,r.coordSys),this._api)},e.prototype._renderThumbnail=function(r,n,i,a){var o=this._getThumbnailInfo();if(o){var s=new gr,l=i.group.children(),u=a.group.children(),h=new gr,d=new gr;s.add(d),s.add(h);for(var f=0;f "),value:a.value,noValue:a.value==null})}return fs("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(),o=this.getGraph().getNodeByIndex(r);if(i.name==null&&(i.name=a.getName(r)),i.value==null){var s=o.getLayout().value;i.value=s}}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}(Ii),Avt=function(t){nt(e,t);function e(r,n,i){var a=t.call(this)||this;Cr(a).dataType="node",a.z2=2;var o=new $n;return a.setTextContent(o),a.updateData(r,n,i,!0),a}return e.prototype.updateData=function(r,n,i,a){var o=this,s=r.graph.getNodeByIndex(n),l=r.hostModel,u=s.getModel(),h=u.getModel("emphasis"),d=r.getItemLayout(n),f=lt(r0(u.getModel("itemStyle"),d,!0),d),p=this;if(isNaN(f.startAngle)){p.setShape(f);return}a?p.setShape(f):qn(p,{shape:f},l,n);var g=lt(r0(u.getModel("itemStyle"),d,!0),d);o.setShape(g),o.useStyle(r.getItemVisual(n,"style")),Ms(o,u),this._updateLabel(l,u,s),r.setItemGraphicEl(n,p),Ms(p,u,"itemStyle");var m=h.get("focus");Ea(this,m==="adjacency"?s.getAdjacentDataIndices():m,h.get("blurScope"),h.get("disabled"))},e.prototype._updateLabel=function(r,n,i){var a=this.getTextContent(),o=i.getLayout(),s=(o.startAngle+o.endAngle)/2,l=Math.cos(s),u=Math.sin(s),h=n.getModel("label");a.ignore=!h.get("show");var d=Is(n),f=i.getVisual("style");il(a,d,{labelFetcher:{getFormattedLabel:function(b,x,w,A,S,T){return r.getFormattedLabel(b,x,"node",A,Bh(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=o.r+g:m=(o.r+o.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+o.cx,y:u*m+o.cy,rotation:0,style:{align:v,verticalAlign:y}})},e}(fc),FHr=function(t){nt(e,t);function e(r,n,i,a){var o=t.call(this)||this;return Cr(o).dataType="edge",o.updateData(r,n,i,a,!0),o}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,o){var s=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=lt(r0(h.getModel("itemStyle"),u,!0),u),v=this;if(isNaN(m.sStartAngle)||isNaN(m.tStartAngle)){v.setShape(m);return}o?(v.setShape(m),Svt(v,l,r,f)):(np(v),Svt(v,l,r,f),qn(v,{shape:m},s,i)),Ea(this,g==="adjacency"?l.getAdjacentDataIndices():g,p.get("blurScope"),p.get("disabled")),Ms(v,d,"lineStyle"),n.setItemGraphicEl(l.dataIndex,v)},e}(yn);function Svt(t,e,r,n){var i=e.node1,a=e.node2,o=t.style;t.setStyle(n.getLineStyle());var s=n.get("color");switch(s){case"source":o.fill=r.getItemVisual(i.dataIndex,"style").fill,o.decal=i.getVisual("style").decal;break;case"target":o.fill=r.getItemVisual(a.dataIndex,"style").fill,o.decal=a.getVisual("style").decal;break;case"gradient":var l=r.getItemVisual(i.dataIndex,"style").fill,u=r.getItemVisual(a.dataIndex,"style").fill;if($t(l)&&$t(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;o.fill=new TS(d,f,p,g,[{offset:0,color:l},{offset:1,color:u}],!0)}break}}var zHr=Math.PI/180,UHr=function(t){nt(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(),o=this._data,s=this.group,l=-r.get("startAngle")*zHr;if(a.diff(o).add(function(h){var d=a.getItemLayout(h);if(d){var f=new Avt(a,h,l);Cr(f).dataIndex=h,s.add(f)}}).update(function(h,d){var f=o.getItemGraphicEl(d),p=a.getItemLayout(h);if(!p){f&&Dy(f,r,d);return}f?f.updateData(a,h,l):f=new Avt(a,h,l),s.add(f)}).remove(function(h){var d=o.getItemGraphicEl(h);d&&Dy(d,r,h)}).execute(),!o){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()),ua(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(),o=this._edgeData,s=this.group;a.diff(o).add(function(l){var u=new FHr(i,a,l,n);Cr(u).dataIndex=l,s.add(u)}).update(function(l,u){var h=o.getItemGraphicEl(u);h.updateData(i,a,l,n),s.add(h)}).remove(function(l){var u=o.getItemGraphicEl(l);u&&Dy(u,r,l)}).execute(),this._edgeData=a},e.prototype.dispose=function(){},e.type=HB,e}(ki),gve=Math.PI/180,VHr=Ls(HB,QHr);function QHr(t,e){t.eachSeriesByType(HB,function(r){GHr(r,e)})}function GHr(t,e){var r=t.getData(),n=r.graph,i=t.getEdgeData(),a=i.count();if(a){var o=Put(t,e),s=o.cx,l=o.cy,u=o.r,h=o.r0,d=Math.max((t.get("padAngle")||0)*gve,0),f=Math.max((t.get("minAngle")||0)*gve,0),p=-t.get("startAngle")*gve,g=p+Math.PI*2,m=t.get("clockwise"),v=m?1:-1,y=[p,g];sW(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 C=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++,C+=S[N.dataIndex]||0}),!(T===0||C===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)/C,E=0,_=0,P=0;n.eachNode(function(N){var F=S[N.dataIndex]||0,B=k*(C?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/P,1),V=B*E;F-Vf&&f>0){var B=L?1:Math.min(F/P,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,I=[];n.eachNode(function(N){var F=Math.max(N.getLayout().angle,f);N.setLayout({cx:s,cy:l,r0:h,r:u,startAngle:M,endAngle:M+F*v,clockwise:m},!0),I[N.dataIndex]=M,M+=(F+d)*v}),n.eachEdge(function(N){var F=A?1:N.getValue("value"),B=k*(C?F:1)*v,V=N.node1.dataIndex,z=I[V]||0,U=Math.abs((N.node1.getLayout().ratio||1)*B),Q=z+U*v,G=[s+h*Math.cos(z),l+h*Math.sin(z)],q=[s+h*Math.cos(Q),l+h*Math.sin(Q)],Y=N.node2.dataIndex,ne=I[Y]||0,X=Math.abs((N.node2.getLayout().ratio||1)*B),J=ne+X*v,ee=[s+h*Math.cos(ne),l+h*Math.sin(ne)],te=[s+h*Math.cos(J),l+h*Math.sin(J)];N.setLayout({s1:G,s2:q,sStartAngle:z,sEndAngle:Q,t1:ee,t2:te,tStartAngle:ne,tEndAngle:J,cx:s,cy:l,r:h,value:F,clockwise:m}),I[V]=Q,I[Y]=J})}}}function HHr(t){t.registerChartView(UHr),t.registerSeriesModel($Hr),t.registerLayout(t.PRIORITY.VISUAL.POST_CHART_LAYOUT,VHr),t.registerProcessor(AB("chord"))}var WHr=function(){function t(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return t}(),YHr=function(t){nt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="pointer",n}return e.prototype.getDefaultShape=function(){return new WHr},e.prototype.buildPath=function(r,n){var i=Math.cos,a=Math.sin,o=n.r,s=n.width,l=n.angle,u=n.x-i(l)*s*(s>=o/3?1:2),h=n.y-a(l)*s*(s>=o/3?1:2);l=n.angle-Math.PI/2,r.moveTo(u,h),r.lineTo(n.x+i(l)*s,n.y+a(l)*s),r.lineTo(n.x+i(n.angle)*o,n.y+a(n.angle)*o),r.lineTo(n.x-i(l)*s,n.y-a(l)*s),r.lineTo(u,h)},e}(yn);function qHr(t,e){var r=t.get("center"),n=e.getWidth(),i=e.getHeight(),a=Math.min(n,i),o=Qt(r[0],e.getWidth()),s=Qt(r[1],e.getHeight()),l=Qt(t.get("radius"),a/2);return{cx:o,cy:s,r:l}}function kq(t,e){var r=t==null?"":t+"";return e&&($t(e)?r=e.replace("{value}",r):ur(e)&&(r=e(t))),r}var jHr=function(t){nt(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"]),o=qHr(r,i);this._renderMain(r,n,i,a,o),this._data=r.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(r,n,i,a,o){var s=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?qY:fc,g=d.get("show"),m=d.getModel("lineStyle"),v=m.get("width"),y=[u,h];sW(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=-C-Math.PI/2:Vn(U)&&(Q=U*Math.PI/180),Q===0?d.add(new $n({style:ji(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 $n({style:ji(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 I=b.get("distance");I=I?I+h:h;for(var G=0;G<=A;G++){R=Math.cos(C),D=Math.sin(C);var q=new Go({shape:{x1:R*(g-I)+f,y1:D*(g-I)+p,x2:R*(g-T-I)+f,y2:D*(g-T-I)+p},silent:!0,style:P});P.stroke==="auto"&&q.setStyle({stroke:a((M+G/A)/w)}),d.add(q),C+=E}C-=E}else C+=k}},e.prototype._renderPointer=function(r,n,i,a,o,s,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=[s,l];function C(E,_){var P=b.getItemModel(E),L=P.getModel("pointer"),R=Qt(L.get("width"),o.r),D=Qt(L.get("length"),o.r),M=r.get(["pointer","icon"]),I=L.get("offsetCenter"),N=Qt(I[0],o.r),F=Qt(I[1],o.r),B=L.get("keepAspect"),V;return M?V=Yo(M,N-R/2,F-D,R,D,null,B):V=new YHr({shape:{angle:-Math.PI/2,width:R,r:D,x:N,y:F}}),V.rotation=-(_+Math.PI/2),V.x=o.cx,V.y=o.cy,V}function k(E,_){var P=v.get("roundCap"),L=P?qY:fc,R=v.get("overlap"),D=R?v.get("width"):h/b.count(),M=R?o.r-D:o.r-(E+1)*D,I=R?o.r:o.r-E*D,N=new L({shape:{startAngle:s,endAngle:_,cx:o.cx,cy:o.cy,clockwise:u,r0:M,r:I}});return R&&(N.z2=Zn(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 P=C(E,s);ua(P,{rotation:-((isNaN(+_)?T[0]:Zn(_,S,T,!0))+Math.PI/2)},r),d.add(P),b.setItemGraphicEl(E,P)}if(y){var L=k(E,s),R=v.get("clip");ua(L,{shape:{endAngle:Zn(_,S,T,R)}},r),d.add(L),spe(r.seriesIndex,b.dataType,E,L),g[E]=L}}).update(function(E,_){var P=b.get(x,E);if(m){var L=f.getItemGraphicEl(_),R=L?L.rotation:s,D=C(E,R);D.rotation=R,qn(D,{rotation:-((isNaN(+P)?T[0]:Zn(P,S,T,!0))+Math.PI/2)},r),d.add(D),b.setItemGraphicEl(E,D)}if(y){var M=p[_],I=M?M.shape.endAngle:s,N=k(E,I),F=v.get("clip");qn(N,{shape:{endAngle:Zn(P,S,T,F)}},r),d.add(N),spe(r.seriesIndex,b.dataType,E,N),g[E]=N}}).execute(),b.each(function(E){var _=b.getItemModel(E),P=_.getModel("emphasis"),L=P.get("focus"),R=P.get("blurScope"),D=P.get("disabled"),M=a(Zn(b.get(x,E),S,[0,1],!0));if(m){var I=b.getItemGraphicEl(E),N=b.getItemVisual(E,"style"),F=N.fill;if(I instanceof nl){var B=I.style;I.useStyle(lt({image:B.image,x:B.x,y:B.y,width:B.width,height:B.height},N))}else I.useStyle(N),I.type!=="pointer"&&I.setColor(F);I.setStyle(_.getModel(["pointer","itemStyle"]).getItemStyle()),I.style.fill==="auto"&&I.setStyle("fill",M),I.z2EmphasisLift=0,Ms(I,_),Ea(I,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,Ms(V,_),Ea(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 o=i.get("size"),s=i.get("icon"),l=i.get("offsetCenter"),u=i.get("keepAspect"),h=Yo(s,n.cx-o/2+Qt(l[0],n.r),n.cy-o/2+Qt(l[1],n.r),o,o,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,o){var s=this,l=r.getData(),u=l.mapDimension("value"),h=+r.get("min"),d=+r.get("max"),f=new gr,p=[],g=[],m=r.isAnimationEnabled(),v=r.get(["pointer","showAbove"]);l.diff(this._data).add(function(y){p[y]=new $n({silent:!0}),g[y]=new $n({silent:!0})}).update(function(y,b){p[y]=s._titleEls[b],g[y]=s._detailEls[b]}).execute(),l.each(function(y){var b=l.getItemModel(y),x=l.get(u,y),w=new gr,A=a(Zn(x,[h,d],[0,1],!0)),S=b.getModel("title");if(S.get("show")){var T=S.get("offsetCenter"),C=o.cx+Qt(T[0],o.r),k=o.cy+Qt(T[1],o.r),E=p[y];E.attr({z2:v?0:2,style:ji(S,{x:C,y:k,text:l.getName(y),align:"center",verticalAlign:"middle"},{inheritColor:A})}),w.add(E)}var _=b.getModel("detail");if(_.get("show")){var P=_.get("offsetCenter"),L=o.cx+Qt(P[0],o.r),R=o.cy+Qt(P[1],o.r),D=Qt(_.get("width"),o.r),M=Qt(_.get("height"),o.r),I=r.get(["progress","show"])?l.getItemVisual(y,"style").fill:A,E=g[y],N=_.get("formatter");E.attr({z2:v?0:2,style:ji(_,{x:L,y:R,text:kq(x,N),width:isNaN(D)?null:D,height:isNaN(M)?null:M,align:"center",verticalAlign:"middle"},{inheritColor:I})}),cut(E,{normal:_},x,function(B){return kq(B,N)}),m&&uut(E,y,l,r,{getFormattedLabel:function(B,V,z,U,Q,G){return kq(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}(ki),XHr=function(t){nt(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 D5(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,tt.color.neutral10]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:tt.color.axisTick,width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:tt.color.axisTickMinor,width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:tt.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:tt.color.neutral00,borderWidth:0,borderColor:tt.color.theme[0]}},title:{show:!0,offsetCenter:[0,"20%"],color:tt.color.secondary,fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:tt.color.transparent,borderWidth:0,borderColor:tt.color.neutral40,width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:tt.color.primary,fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},e}(Ii);function KHr(t){t.registerChartView(jHr),t.registerSeriesModel(XHr)}var F5="funnel",ZHr=function(t){nt(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 L5(Wt(this.getData,this),Wt(this.getRawData,this)),this._defaultLabelLine(r)},e.prototype.getInitialData=function(r,n){return D5(this,{coordDimensions:["value"],encodeDefaulter:Kr(sge,this)})},e.prototype._defaultLabelLine=function(r){sS(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"),o=n.getSum(a);return i.percent=o?+(n.get(a,r)/o*100).toFixed(2):0,i.$vars.push("percent"),i},e.type="series."+F5,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:tt.color.neutral00,borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:tt.color.primary}}},e}(Ii),JHr=["itemStyle","opacity"],eWr=function(t){nt(e,t);function e(r,n){var i=t.call(this)||this,a=i,o=new Ll,s=new $n;return a.setTextContent(s),i.setTextGuideLine(o),i.updateData(r,n,!0),i}return e.prototype.updateData=function(r,n,i){var a=this,o=r.hostModel,s=r.getItemModel(n),l=r.getItemLayout(n),u=s.getModel("emphasis"),h=s.get(JHr);h=h??1,i||np(a),a.useStyle(r.getItemVisual(n,"style")),a.style.lineJoin="round",i?(a.setShape({points:l.points}),a.style.opacity=0,ua(a,{style:{opacity:h}},o,n)):qn(a,{style:{opacity:h},shape:{points:l.points}},o,n),Ms(a,s),this._updateLabel(r,n),Ea(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(r,n){var i=this,a=this.getTextGuideLine(),o=i.getTextContent(),s=r.hostModel,l=r.getItemModel(n),u=r.getItemLayout(n),h=u.label,d=r.getItemVisual(n,"style"),f=d.fill;il(o,Is(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},qn(o,{style:{x:h.x,y:h.y}},s,n),o.attr({rotation:h.rotation,originX:h.x,originY:h.y,z2:10}),Cme(i,Ome(l),{stroke:f})},e}(pc),tWr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=F5,r.ignoreLabelLineUpdate=!0,r}return e.prototype.render=function(r,n,i){var a=r.getData(),o=this._data,s=this.group;a.diff(o).add(function(l){var u=new eWr(a,l);a.setItemGraphicEl(l,u),s.add(u)}).update(function(l,u){var h=o.getItemGraphicEl(u);h.updateData(a,l),s.add(h),a.setItemGraphicEl(l,h)}).remove(function(l){var u=o.getItemGraphicEl(l);Dy(u,r,l)}).execute(),this._data=a},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type=F5,e}(ki);function rWr(t,e){for(var r=t.mapDimension("value"),n=t.mapArray(r,function(l){return l}),i=[],a=e==="ascending",o=0,s=t.count();o-1&&(o="left"),r&&Nr(["left","right"],o)>-1&&(o="bottom")),o==="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"):o==="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"):o==="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"):o==="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"):o==="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")):o==="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")):o==="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")):o==="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 iWr=Ls(F5,aWr);function aWr(t,e){t.eachSeriesByType(F5,function(r){var n=r.getData(),i=n.mapDimension("value"),a=r.get("sort"),o=Ps(r,e),s=ba(r.getBoxLayoutParams(),o.refContainer),l=Tvt(r),u=s.width,h=s.height,d=rWr(n,a),f=s.x,p=s.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 I=n.get(i,D)||0,N=Zn(I,[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=Zn(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;TbWr)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||!vve(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 vve(t,e){var r=t._model;return r.get("axisExpandable")&&r.get("axisExpandTriggerOn")===e}var Eq="parallel",yve=Eq,AWr=function(t){nt(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&&Qr(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){fe(["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=oi(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(a){return(a.get("parallelIndex")||0)===this.componentIndex},this);fe(i,function(a){r.push("dim"+a.get("dim")),n.push(a.componentIndex)})},e.type=yve,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}(pn),SWr=function(t){nt(e,t);function e(r,n,i,a,o){var s=t.call(this,r,n,i)||this;return s.type=a||"value",s.axisIndex=o,s}return e.prototype.isHorizontal=function(){return this.coordinateSystem.getModel().get("layout")!=="horizontal"},e}(cp);function i2(t,e,r,n,i,a){t=t||0;var o=aS(r[1],-r[0]);if(i!=null&&(i=z5(i,[0,o])),a!=null&&(a=Math.max(a,i??0)),n==="all"){var s=Math.abs(aS(e[1],-e[0]));s=z5(s,[0,o]),i=a=z5(s,[i,a]),n=0}e[0]=z5(e[0],r),e[1]=z5(e[1],r);var l=bve(e,n);e[n]+=t;var u=i||0,h=r.slice();l.sign<0?h[0]=aS(h[0],u):h[1]=aS(h[1],-u),e[n]=z5(e[n],h);var d;return d=bve(e,n),i!=null&&(d.sign!==l.sign||d.spana&&(e[1-n]=aS(e[n],d.sign*a)),e}function bve(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 z5(t,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,t))}var TWr=function(){function t(e,r,n){this.type=Eq,this._axesMap=qt(),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;fe(i,function(o,s){var l=a[s],u=r.getComponent("parallelAxis",l),h=tB(u),d=this._axesMap.set(o,new SWr(o,x5(u,h,!1),[0,0],h,l));d.onBand=iB(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){fe(this.dimensions,function(n){var i=this._axesMap.get(n);KS(i,C5),O5(i)},this)},t.prototype.containPoint=function(e){var r=this._makeLayoutInfo(),n=r.axisBase,i=r.layoutBase,a=r.pixelDimIndex,o=e[1-a],s=e[a];return o>=n&&o<=n+r.axisLength&&s>=i&&s<=i+r.layoutLength},t.prototype.getModel=function(){return this._model},t.prototype.resize=function(e,r){var n=Ps(e,r).refContainer;this._rect=ba(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"),o=a==="horizontal"?0:1,s=r[i[o]],l=[0,s],u=this.dimensions.length,h=_q(e.get("axisExpandWidth"),l),d=_q(e.get("axisExpandCount")||0,[0,u]),f=e.get("axisExpandable")&&u>3&&u>d&&d>1&&h>0&&s>0,p=e.get("axisExpandWindow"),g;if(p)g=_q(p[1]-p[0],l),p[1]=p[0]+g;else{g=_q(h*(d-1),l);var m=e.get("axisExpandCenter")||Jf(u/2);p=[h*m-g/2],p[1]=p[0]+g}var v=(s-g)/(u-d);v<3&&(v=0);var y=[Jf(Yn(p[0]/h,1))+1,rS(Yn(p[1]/h,1))-1],b=v/h*p[0];return{layout:a,pixelDimIndex:o,layoutBase:r[n[o]],layoutLength:s,axisBase:r[n[1-o]],axisLength:r[i[1-o]],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(o){var s=[0,i.axisLength],l=o.inverse?1:0;o.setExtent(s[l],s[1-l])}),fe(n,function(o,s){var l=(i.axisExpandable?OWr:CWr)(s,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},h={horizontal:YH/2,vertical:0},d=[u[a].x+e.x,u[a].y+e.y],f=h[a],p=ka();xy(p,p,f),sg(p,p,d),this._axesLayout[o]={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,o=this.dimensions,s=[],l=[];fe(o,function(v){s.push(e.mapDimension(v)),l.push(a.get(v).model)});for(var u=this.hasAxisBrushed(),h=n;ha*(1-d[0])?(u="jump",l=s-a*(1-d[2])):(l=s-a*d[1])>=0&&(l=s-a*(1-d[1]))<=0&&(l=0),l*=r.axisExpandWidth/h,l?i2(l,i,o,"all"):u="none";else{var p=i[1]-i[0],g=o[1]*s/p;i=[rn(0,g-p/2)],i[1]=Oi(o[1],i[0]+p),i[0]=i[1]-p}return{axisExpandWindow:i,behavior:u}},t}();function _q(t,e){return Oi(rn(t,e[0]),e[1])}function CWr(t,e){var r=e.layoutLength/(e.axisCount-1);return{position:r*t,axisNameAvailableWidth:r,axisLabelShow:!0}}function OWr(t,e){var r=e.layoutLength,n=e.axisExpandWidth,i=e.axisCount,a=e.axisCollapseWidth,o=e.winInnerIndices,s,l=a,u=!1,h;return t=0;i--)Rl(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,o=n.length;aDWr}function Pvt(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function Nvt(t,e,r,n){var i=new gr;return i.add(new nn({name:"main",style:kve(r),silent:!0,draggable:!0,cursor:"move",drift:Kr(Fvt,t,e,i,["n","s","w","e"]),ondragend:Kr(AT,e,{isEnd:!0})})),fe(n,function(a){i.add(new nn({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:Kr(Fvt,t,e,i,a),ondragend:Kr(AT,e,{isEnd:!0})}))}),i}function Bvt(t,e,r,n){var i=n.brushStyle.lineWidth||0,a=U5(i,LWr),o=r[0][0],s=r[1][0],l=o-i/2,u=s-i/2,h=r[0][1],d=r[1][1],f=h-a+i/2,p=d-a+i/2,g=h-o,m=d-s,v=g+i,y=m+i;zy(t,e,"main",o,s,g,m),n.transformable&&(zy(t,e,"w",l,u,a,y),zy(t,e,"e",f,u,a,y),zy(t,e,"n",l,u,v,a),zy(t,e,"s",l,p,v,a),zy(t,e,"nw",l,u,a,a),zy(t,e,"ne",f,u,a,a),zy(t,e,"sw",l,p,a,a),zy(t,e,"se",f,p,a,a))}function Ove(t,e){var r=e.__brushOption,n=r.transformable,i=e.childAt(0);i.useStyle(kve(r)),i.attr({silent:!n,cursor:n?"move":"default"}),fe([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=e.childOfName(a.join("")),s=a.length===1?Eve(t,a[0]):$Wr(t,a);o&&o.attr({silent:!n,invisible:!n,cursor:n?IWr[s]+"-resize":null})})}function zy(t,e,r,n,i,a,o){var s=e.childOfName(r);s&&s.setShape(zWr(_ve(t,e,[[n,i],[n+a,i+o]])))}function kve(t){return mr({strokeNoScale:!0},t.brushStyle)}function $vt(t,e,r,n){var i=[WB(t,r),WB(e,n)],a=[U5(t,r),U5(e,n)];return[[i[0],a[0]],[i[1],a[1]]]}function BWr(t){return kS(t.group)}function Eve(t,e){var r={w:"left",e:"right",n:"top",s:"bottom"},n={left:"w",right:"e",top:"n",bottom:"s"},i=TW(r[e],BWr(t));return n[i]}function $Wr(t,e){var r=[Eve(t,e[0]),Eve(t,e[1])];return(r[0]==="e"||r[0]==="w")&&r.reverse(),r.join("")}function Fvt(t,e,r,n,i,a){var o=r.__brushOption,s=t.toRectRange(o.range),l=zvt(e,i,a);fe(n,function(u){var h=MWr[u];s[h[0]][h[1]]+=l[h[0]]}),o.range=t.fromRectRange($vt(s[0][0],s[1][0],s[0][1],s[1][1])),Ave(e,r),AT(e,{isEnd:!1})}function FWr(t,e,r,n){var i=e.__brushOption.range,a=zvt(t,r,n);fe(i,function(o){o[0]+=a[0],o[1]+=a[1]}),Ave(t,e),AT(t,{isEnd:!1})}function zvt(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 _ve(t,e,r){var n=Ivt(t,e);return n&&n!==wT?n.clipPath(r,t._transform):lr(r)}function zWr(t){var e=WB(t[0][0],t[1][0]),r=WB(t[0][1],t[1][1]),n=U5(t[0][0],t[1][0]),i=U5(t[0][1],t[1][1]);return{x:e,y:r,width:n-e,height:i-r}}function UWr(t,e,r){if(!(!t._brushType||QWr(t,e.offsetX,e.offsetY))){var n=t._zr,i=t._covers,a=Tve(t,e,r);if(!t._dragging)for(var o=0;on.getWidth()||r<0||r>n.getHeight()}var Rq={lineX:Gvt(0),lineY:Gvt(1),rect:{createCover:function(t,e){function r(n){return n}return Nvt({toRectRange:r,fromRectRange:r},t,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(t){var e=Pvt(t);return $vt(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(t,e,r,n){Bvt(t,e,r,n)},updateCommon:Ove,contain:Dve},polygon:{createCover:function(t,e){var r=new gr;return r.add(new Ll({name:"main",style:kve(e),silent:!0})),r},getCreatingRange:function(t){return t},endCreating:function(t,e){e.remove(e.childAt(0)),e.add(new pc({name:"main",draggable:!0,drift:Kr(FWr,t,e),ondragend:Kr(AT,t,{isEnd:!0})}))},updateCoverShape:function(t,e,r,n){e.childAt(0).setShape({points:_ve(t,e,r)})},updateCommon:Ove,contain:Dve}};function Gvt(t){return{createCover:function(e,r){return Nvt({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=Pvt(e),n=WB(r[0][t],r[1][t]),i=U5(r[0][t],r[1][t]);return[n,i]},updateCoverShape:function(e,r,n,i){var a,o=Ivt(e,r);if(o!==wT&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(t);else{var s=e._zr;a=[0,[s.getWidth(),s.getHeight()][1-t]]}var l=[n,a];t&&l.reverse(),Bvt(e,r,l,i)},updateCommon:Ove,contain:Dve}}function Hvt(t){return t=Lve(t),function(e){return Rpe(e,t)}}function Wvt(t,e){return t=Lve(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 Yvt(t,e,r){var n=Lve(t);return function(i,a){return n.contain(a[0],a[1])&&!Lmt(i,e,r)}}function Lve(t){return pr.create(t)}var GWr=function(t){nt(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 wve(n.getZr())).on("brush",Wt(this._onBrush,this))},e.prototype.render=function(r,n,i,a){if(!HWr(r,n,a)){this.axisModel=r,this.api=i,this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new gr,this.group.add(this._axisGroup),!!r.get("show")){var s=YWr(r,n),l=s.coordinateSystem,u=r.getAreaSelectStyle(),h=u.width,d=r.axis.dim,f=l.getAxisLayout(d),p=lt({strokeContainThreshold:h},f),g=new Bu(r,i,p);g.build(),this._axisGroup.add(g.group),this._refreshBrushController(p,u,r,s,h,i),C8(o,this._axisGroup,r)}}},e.prototype._refreshBrushController=function(r,n,i,a,o,s){var l=i.axis.getExtent(),u=l[1]-l[0],h=Math.min(30,Math.abs(u)*.1),d=pr.create({x:l[0],y:-o/2,width:u,height:o});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:Hvt(d),isTargetByCursor:Yvt(d,s,a),getLinearBrushOtherExtent:Wvt(d,0)}]).enableBrush({brushType:"lineX",brushStyle:n,removeOnClick:!0}).updateCovers(WWr(i))},e.prototype._onBrush=function(r){var n=r.areas,i=this.axisModel,a=i.axis,o=vt(n,function(s){return[a.coordToData(s.range[0],!0),a.coordToData(s.range[1],!0)]});(!i.option.realtime===r.isEnd||r.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:o})},e.prototype.dispose=function(){this._brushController.dispose()},e.type="parallelAxis",e}(Xi);function HWr(t,e,r){return r&&r.type==="axisAreaSelect"&&e.findComponents({mainType:"parallelAxis",query:r})[0]===t}function WWr(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 YWr(t,e){return e.getComponent("parallel",t.get("parallelIndex"))}var qWr={type:"axisAreaSelect",event:"axisAreaSelected"};function jWr(t){t.registerAction(qWr,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 XWr={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function qvt(t){t.registerComponentView(xWr),t.registerComponentModel(AWr),t.registerCoordinateSystem("parallel",EWr),t.registerPreprocessor(mWr),t.registerComponentModel(xve),t.registerComponentView(GWr),M5(t,"parallel",xve,XWr),jWr(t)}function KWr(t){Xr(qvt),t.registerChartView(lWr),t.registerSeriesModel(hWr),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,gWr)}var Uy="sankey",ZWr=function(t){nt(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||[],o=r.levels||[];this.levelModels=[];for(var s=this.levelModels,l=0;l=0&&(s[o[l].depth]=new bn(o[l],this,n));var u=X0e(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 o=this.getDataParams(r,i),s=o.data,l=o.value,u=s.source+" -- "+s.target;return fs("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 fs("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),o=a.getLayout().value;i.value=o}return i},e.prototype.__ownRoamView=function(){return this.coordinateSystem},e.type="series."+Uy,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:tt.color.neutral50,opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:tt.color.primary}},animationEasing:"linear",animationDuration:1e3},e}(Ii),JWr=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}(),eYr=function(t){nt(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new JWr},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(){_y(this)},e.prototype.downplay=function(){Ry(this)},e}(yn),tYr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=Uy,r._mainGroup=new gr,r}return e.prototype.init=function(r,n){this._controller=new hT(n.getZr()),this.group.add(this._mainGroup),this._firstRender=!0},e.prototype.render=function(r,n,i){var a=r.getGraph(),o=this._mainGroup,s=r.layoutInfo,l=s.width,u=s.height,h=r.getData(),d=r.getData("edge"),f=r.get("orient");o.removeAll(),o.x=s.x,o.y=s.y,this._updateViewCoordSys(r,i),mq(r,i,this._controller,l0t(o),null),a.eachEdge(function(p){var g=new eYr,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(),C=p.node2.getModel(),k=C.get("localX"),E=C.get("localY"),_=p.getLayout(),P,L,R,D,M,I,N,F;g.shape.extent=Math.max(1,_.dy),g.shape.orient=f,f==="vertical"?(P=(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=P,I=L*(1-b)+D*b,N=R,F=L*b+D*(1-b)):(P=(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=P*(1-b)+R*b,I=L,N=P*b+R*(1-b),F=D),g.setShape({x1:P,y1:L,x2:R,y2:D,cpx1:M,cpy1:I,cpx2:N,cpy2:F}),g.useStyle(y.getItemStyle()),jvt(g.style,f,p);var B=""+v.get("value"),V=Is(v,"edgeLabel");il(g,V,{labelFetcher:{getFormattedLabel:function(Q,G,q,Y,ne,X){return r.getFormattedLabel(Q,G,"edge",Y,Bh(ne,V.normal&&V.normal.get("formatter"),B),X)}},labelDataIndex:p.dataIndex,defaultText:B}),g.setTextConfig({position:"inside"});var z=v.getModel("emphasis");Ms(g,v,"lineStyle",function(Q){var G=Q.getItemStyle();return jvt(G,f,p),G}),o.add(g),d.setItemGraphicEl(p.dataIndex,g);var U=z.get("focus");Ea(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 nn({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});il(w,Is(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),Ms(w,m),o.add(w),h.setItemGraphicEl(p.dataIndex,w),Cr(w).dataType="node";var A=b.get("focus");Ea(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()&&o.setClipPath(rYr(o.getBoundingRect(),r,function(){o.removeClipPath()})),this._data=r.getData(),this._firstRender=!1},e.prototype.__updateOnOwnRoam=function(r,n,i){r2(this.group,n0,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=M0e(r,n,i.x,i.y,i.width,i.height);r2(this.group,n0,a,this._firstRender?null:r)},e.type=Uy,e}(ki);function jvt(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");$t(n)&&$t(i)&&(t.fill=new TS(0,0,+(e==="horizontal"),+(e==="vertical"),[{color:n,offset:0},{color:i,offset:1}]))}}function rYr(t,e,r){var n=new nn({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return ua(n,{shape:{width:t.width+20}},e,r),n}var nYr=Ls(Uy,iYr);function iYr(t,e){t.eachSeriesByType(Uy,function(r){var n=r.get("nodeWidth"),i=r.get("nodeGap"),a=Ps(r,e).refContainer,o=ba(r.getBoxLayoutParams(),a);r.layoutInfo=o;var s=o.width,l=o.height,u=r.getGraph(),h=u.nodes,d=u.edges;oYr(h);var f=oi(h,function(v){return v.getLayout().value===0}),p=f.length!==0?0:r.get("layoutIterations"),g=r.get("orient"),m=r.get("nodeAlign");aYr(h,d,n,i,s,l,p,g,m)})}function aYr(t,e,r,n,i,a,o,s,l){sYr(t,e,r,i,a,s,l),hYr(t,e,a,i,n,o,s),xYr(t,s)}function oYr(t){fe(t,function(e){var r=o2(e.outEdges,Dq),n=o2(e.inEdges,Dq),i=e.getValue()||0,a=Math.max(r,n,i);e.setLayout({value:a},!0)})}function sYr(t,e,r,n,i,a,o){for(var s=[],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;o&&o!=="left"&&lYr(t,o,a,T);var C=a==="vertical"?(i-r)/T:(n-r)/T;uYr(t,C,a)}function Xvt(t){var e=t.hostGraph.data.getRawDataItem(t.dataIndex);return e.depth!=null&&e.depth>=0}function lYr(t,e,r,n){if(e==="right"){for(var i=[],a=t,o=0;a.length;){for(var s=0;s0;a--)l*=.99,pYr(s,l,o),Mve(s,i,r,n,o),bYr(s,l,o),Mve(s,i,r,n,o)}function dYr(t,e){var r=[],n=e==="vertical"?"y":"x",i=Ffe(t,function(a){return a.getLayout()[n]});return Rl(i.keys),fe(i.keys,function(a){r.push(i.buckets.get(a))}),r}function fYr(t,e,r,n,i,a){var o=1/0;fe(t,function(s){var l=s.length,u=0;fe(s,function(d){u+=d.getLayout().value});var h=a==="vertical"?(n-(l-1)*i)/u:(r-(l-1)*i)/u;h0&&(s=l.getLayout()[a]+u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),h=l.getLayout()[a]+l.getLayout()[f]+e;var g=i==="vertical"?n:r;if(u=h-e-g,u>0){s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0),h=s;for(var p=d-2;p>=0;--p)l=o[p],u=l.getLayout()[a]+l.getLayout()[f]+e-h,u>0&&(s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),h=l.getLayout()[a]}})}function pYr(t,e,r){fe(t.slice().reverse(),function(n){fe(n,function(i){if(i.outEdges.length){var a=o2(i.outEdges,gYr,r)/o2(i.outEdges,Dq);if(isNaN(a)){var o=i.outEdges.length;a=o?o2(i.outEdges,mYr,r)/o:0}if(r==="vertical"){var s=i.getLayout().x+(a-a2(i,r))*e;i.setLayout({x:s},!0)}else{var l=i.getLayout().y+(a-a2(i,r))*e;i.setLayout({y:l},!0)}}})})}function gYr(t,e){return a2(t.node2,e)*t.getValue()}function mYr(t,e){return a2(t.node2,e)}function vYr(t,e){return a2(t.node1,e)*t.getValue()}function yYr(t,e){return a2(t.node1,e)}function a2(t,e){return e==="vertical"?t.getLayout().x+t.getLayout().dx/2:t.getLayout().y+t.getLayout().dy/2}function Dq(t){return t.getValue()}function o2(t,e,r){for(var n=0,i=t.length,a=-1;++ao&&(o=l)}),fe(n,function(s){var l=new ol({type:"color",mappingMethod:"linear",dataExtent:[a,o],visual:e.get("color")}),u=l.mapValueToVisual(s.getLayout().value),h=s.getModel().get(["itemStyle","color"]);h!=null?(s.setVisual("color",h),s.setVisual("style",{fill:h})):(s.setVisual("color",u),s.setVisual("style",{fill:u}))})}i.length&&fe(i,function(s){var l=s.getModel().get("lineStyle");s.setVisual("style",l)})})}function SYr(t){t.registerChartView(tYr),t.registerSeriesModel(ZWr),t.registerLayout(nYr),t.registerVisual(wYr),t.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(e,r){r.eachComponent({mainType:Hm,subType:Uy,query:e},function(n){n.setNodePosition(e.dataIndex,[e.localX,e.localY])})}),L0e(t,Hm,Uy)}var Kvt=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")),o=i.get("type"),s=a.get("type"),l,u=e.layout;o==="category"?(u="horizontal",n=i.getOrdinalMeta(),l=!this._hasEncodeRule("x")):s==="category"&&(u="vertical",n=a.getOrdinalMeta(),l=!this._hasEncodeRule("y")),u||(u=s==="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=[];fe(y,function(A,S){var T;ft(A)?(T=A.slice(),A.unshift(S)):ft(A.value)?(T=lt({},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:pY(m),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:p,type:pY(v),dimsDef:x.slice()}];return D5(this,{coordDimensions:w,dimensionsCount:x.length+1,encodeDefaulter:Kr(Qut,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 Lq(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 PYr={type:"echarts:boxplot",transform:function(e){var r=e.upstream;if(r.sourceFormat!==Dl){var n="";si(n)}var i=IYr(r.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function NYr(t){t.registerSeriesModel(Zvt),t.registerChartView(TYr),t.registerLayout(_Yr),t.registerTransform(PYr),MYr(t)}var s2="candlestick",tyt=function(t){nt(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."+s2,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}(Ii);Qo(tyt,Kvt,!0);var BYr=["itemStyle","borderColor"],$Yr=["itemStyle","borderColor0"],FYr=["itemStyle","borderColorDoji"],zYr=["itemStyle","color"],UYr=["itemStyle","color0"];function Ive(t,e){return e.get(t>0?zYr:UYr)}function Pve(t,e){return e.get(t===0?FYr:t>0?BYr:$Yr)}var VYr={seriesType:s2,plan:US(),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 o=i.getItemModel(a),s=i.getItemLayout(a).sign,l=o.getItemStyle();l.fill=Ive(s,o),l.stroke=Pve(s,o)||l.fill;var u=i.ensureUniqueItemVisual(a,"style");lt(u,l)}}}}}},QYr=["color","borderColor"],GYr=function(t){nt(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){Gx(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,o=n.getLayout("isSimpleBox"),s=r.get("clip",!0),l=r.coordinateSystem,u=l.getArea&&l.getArea(),h=s&&iT(l,!1,r);this._data||a.removeAll();var d=ryt(r);n.diff(i).add(function(f){if(n.hasValue(f)){var p=n.getItemLayout(f),g=s?Lq(u,p):pB;if(g===mB)return;var m=Nve(p,f,d,!0);ua(m,{shape:{points:p.ends}},r,f),_5(g===gB,m,h),Bve(m,n,f,o),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=s?Lq(u,m):pB;if(v===mB){a.remove(g);return}g?(qn(g,{shape:{points:m.ends}},r,f),np(g)):g=Nve(m,f,d),Bve(g,n,f,o),_5(v===gB,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(),nyt(r,this.group);var n=r.get("clip",!0)?iT(r.coordinateSystem,!1,r):null;_5(!!n,this.group,n)},e.prototype._incrementalRenderNormal=function(r,n){for(var i=n.getData(),a=i.getLayout("isSimpleBox"),o=ryt(n),s;(s=r.next())!=null;){var l=i.getItemLayout(s),u=Nve(l,s,o);Bve(u,i,s,a),u.incremental=$m(n),this.group.add(u),this._progressiveEls.push(u)}},e.prototype._incrementalRenderLarge=function(r,n){nyt(n,this.group,this._progressiveEls,!0)},e.prototype.remove=function(r){this._clear()},e.prototype._clear=function(){this.group.removeAll(),_5(!1,this.group,null),this._data=null},e.type=s2,e}(ki),HYr=function(){function t(){}return t}(),WYr=function(t){nt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="normalCandlestickBox",n}return e.prototype.getDefaultShape=function(){return new HYr},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}(yn);function Nve(t,e,r,n){var i=t.ends;return new WYr({shape:{points:n?YYr(i,r,t):i},z2:100})}function Bve(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,Ms(t,i);var o=e.getItemLayout(r).sign;fe(t.states,function(l,u){var h=i.getModel(u),d=Ive(o,h),f=Pve(o,h)||d,p=l.style||(l.style={});d&&(p.fill=d),f&&(p.stroke=f)});var s=i.getModel("emphasis");Ea(t,s.get("focus"),s.get("blurScope"),s.get("disabled"))}function YYr(t,e,r){return vt(t,function(n){return n=n.slice(),n[e]=r.initBaseline,n})}function ryt(t){return t.getWhiskerBoxesLayout()==="horizontal"?1:0}var qYr=function(){function t(){}return t}(),$ve=function(t){nt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="largeCandlestickBox",n}return e.prototype.getDefaultShape=function(){return new qYr},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 I(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]=SW(Q[i]+n/2,1,!1),G[i]=SW(G[i]-n/2,1,!0),U?V.push(Q,G):V.push(G,Q)}function F(V,z,U){var Q=I(V,U),G=I(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]=SW(V[i],1),V}}function g(m,v){for(var y=e0(m.count*4),b=0,x,w=[],A=[],S,T=v.getStore(),C=!!t.get(["itemStyle","borderColorDoji"]);(S=m.next())!=null;){var k=T.get(s,S),E=T.get(u,S),_=T.get(h,S),P=T.get(d,S),L=T.get(f,S);if(isNaN(k)||isNaN(P)||isNaN(L)){y[b++]=NaN,b+=3;continue}y[b++]=iyt(T,S,E,_,h,C),w[i]=k,w[a]=P,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 iyt(t,e,r,n,i,a){var o;return r>n?o=-1:r0?t.get(i,e-1)<=n?1:-1:1,o}function ZYr(t,e){var r=t.getBaseAxis(),n=mc(r,{fromStat:{key:lT(s2)},min:1}).w,i=Qt(Jt(t.get("barMaxWidth"),n),n),a=Qt(Jt(t.get("barMinWidth"),1),n),o=t.get("barWidth");return o!=null?Qt(o,n):rn(Oi(n/2,i),a)}function JYr(t){XYr(t,function(){var e=lT(s2);vme(t,{key:e,seriesType:s2,getMetrics:i0e}),EY(e,WY(e))})}function eqr(t){t.registerChartView(GYr),t.registerSeriesModel(tyt),t.registerPreprocessor(jYr),t.registerVisual(VYr),t.registerLayout(KYr),JYr(t)}function ayt(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 tqr=function(t){nt(e,t);function e(r,n){var i=t.call(this)||this,a=new dB(r,n),o=new gr;return i.add(a),i.add(o),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,o=this.childAt(1),s=0;s0&&(s=this._getLineLength(a)/h*1e3),s!==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=-s*a.__t),this._animateSymbol(a,s,f,l,u)}this._period=s,this._loop=l,this._roundTrip=u}},e.prototype._animateSymbol=function(r,n,i,a,o){if(n>0){r.__t=0;var s=this,l=r.animate("",a).when(o?n*2:n,{__t:o?2:1}).delay(i).during(function(){s._updateSymbolPosition(r)});a||l.done(function(){s.remove(r)}),l.start()}},e.prototype._getLineLength=function(r){return my(r.__p1,r.__cp1)+my(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,o=r.__t<=1?r.__t:2-r.__t,s=[r.x,r.y],l=s.slice(),u=_l,h=Jde;s[0]=u(n[0],a[0],i[0],o),s[1]=u(n[1],a[1],i[1],o);var d=r.__t<=1?h(n[0],a[0],i[0],o):h(i[0],a[0],n[0],1-o),f=r.__t<=1?h(n[1],a[1],i[1],o):h(i[1],a[1],n[1],1-o);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,o-2)}else{for(l=s;ln);l++);l=Math.min(l-1,o-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}(syt),oqr=function(){function t(){this.polyline=!1,this.curveness=0,this.segs=[]}return t}(),sqr=function(t){nt(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:tt.color.neutral99,fill:null}},e.prototype.getDefaultShape=function(){return new oqr},e.prototype.buildPath=function(r,n){var i=n.segs,a=n.curveness,o;if(n.polyline)for(o=this._off;o0){r.moveTo(i[o++],i[o++]);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=o,this.notClear=!0)},e.prototype.findDataIndex=function(r,n){var i=this.shape,a=i.segs,o=i.curveness,s=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)*o,y=(f+m)/2-(g-d)*o;if(Hlt(d,f,v,y,g,m,s,r,n))return l}else if(Fx(d,f,g,m,s,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 o=this.hoverDataIdx=this.findDataIndex(r,n);return o>=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,o=1/0,s=-1/0,l=-1/0,u=0;u0&&(o.dataIndex=l+e.__startIndex)})},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}(),cyt={seriesType:"lines",plan:US(),reset:function(t){var e=t.coordinateSystem;if(e){var r=t.get("polyline"),n=t.pipelineContext.large;return{progress:function(i,a){var o=[];if(n){var s=void 0,l=i.end-i.start;if(r){for(var u=0,h=i.start;h0&&h&&u.configLayer(s,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(l/10+.9,1),0)}),o.updateData(a);var d=r.get("clip",!0)&&iT(r.coordinateSystem,!1,r);d?this.group.setClipPath(d):this.group.removeClipPath(),this._lastZlevel=s,this._finished=!0},e.prototype.incrementalPrepareRender=function(r,n,i){var a=r.getData(),o=this._updateLineDraw(a,r);o.incrementalPrepareUpdate(a),this._clearLayer(i),this._finished=!1},e.prototype.incrementalRender=function(r,n,i){this._lineDraw.incrementalUpdate(r,n.getData(),$m(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(),o=this._lineDraw;if(!this._finished||!o||!o.updateLayout)return{update:!0};var s=cyt.reset(r,n,i);s.progress&&s.progress({start:0,end:a.count(),count:a.count()},a),o.updateLayout(),this._clearLayer(i)},e.prototype._updateLineDraw=function(r,n){var i=this._lineDraw,a=this._showEffect(n),o=!!n.get("polyline"),s=n.pipelineContext,l=s.large;return(!i||a!==this._hasEffet||o!==this._isPolyline||l!==this._isLargeDraw)&&(i&&i.remove(),i=this._lineDraw=l?new lqr:new lve(o?a?aqr:lyt:a?syt:sve),this._hasEffet=a,this._isPolyline=o,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=Npe(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}(ki),uqr=typeof Uint32Array>"u"?Array:Uint32Array,hqr=typeof Float64Array>"u"?Array:Float64Array;function uyt(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),uH([i,r[0],r[1]])}))}var dqr=function(t){nt(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||[],uyt(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(uyt(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=b_(this._flatCoords,n.flatCoords),this._flatCoordsOffset=b_(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],o=0;o ")}return fs("nameValue",{name:l,value:o,noValue:o==null||isNaN(o)})},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}(Ii);function Mq(t){return t instanceof Array||(t=[t,t]),t}var fqr={seriesType:"lines",reset:function(t){var e=Mq(t.get("symbol")),r=Mq(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,o){var s=a.getItemModel(o),l=Mq(s.getShallow("symbol",!0)),u=Mq(s.getShallow("symbolSize",!0));l[0]&&a.setItemVisual(o,"fromSymbol",l[0]),l[1]&&a.setItemVisual(o,"toSymbol",l[1]),u[0]&&a.setItemVisual(o,"fromSymbolSize",u[0]),u[1]&&a.setItemVisual(o,"toSymbolSize",u[1])}return{dataEach:n.hasItemOption?i:null}}};function pqr(t){t.registerChartView(cqr),t.registerSeriesModel(dqr),t.registerLayout(cyt),t.registerVisual(fqr)}var gqr=256,mqr=function(){function t(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=tl.createCanvas();this.canvas=e}return t.prototype.update=function(e,r,n,i,a,o){var s=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 P=o(x)?l:u;x>0&&(x=x*E+C),A[S++]=P[_],A[S++]=P[_+1],A[S++]=P[_+2],A[S++]=P[_+3]*x*256}else S+=4}return f.putImageData(w,0,0),d},t.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=tl.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=tt.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],o=0,s=0;s<256;s++)e[r](s/255,!0,a),i[o++]=a[0],i[o++]=a[1],i[o++]=a[2],i[o++]=a[3];return i},t}();function vqr(t,e,r){var n=t[1]-t[0];e=vt(e,function(o){return{interval:[(o.interval[0]-t[0])/n,(o.interval[1]-t[0])/n]}});var i=e.length,a=0;return function(o){var s;for(s=a;s=0;s--){var l=e[s].interval;if(l[0]<=o&&o<=l[1]){a=s;break}}return s>=0&&s=e[0]&&n<=e[1]}}var bqr=function(t){nt(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(s){s.eachTargetSeries(function(l){l===r&&(a=s)})}),this._progressiveEls=null,this.group.removeAll();var o=r.coordinateSystem;o.type==="cartesian2d"||o.type==="calendar"||o.type==="matrix"?this._renderOnGridLike(r,i,0,r.getData().count()):ogt(o)&&this._renderOnGeo(o,r,a,i)},e.prototype.incrementalPrepareRender=function(r,n,i){this.group.removeAll()},e.prototype.incrementalRender=function(r,n,i,a){var o=n.coordinateSystem;o&&(ogt(o)?this.render(n,i,a):(this._progressiveEls=[],this._renderOnGridLike(n,a,r.start,r.end,!0)))},e.prototype.eachRendered=function(r){Gx(this._progressiveEls||this.group,r)},e.prototype._renderOnGridLike=function(r,n,i,a,o){var s=r.coordinateSystem,l=aT(s,"cartesian2d"),u=aT(s,"matrix"),h,d,f,p;if(l){var g=s.getAxis("x"),m=s.getAxis("y");h=mc(g).w+.5,d=mc(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=Is(r),T=r.getModel("emphasis"),C=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")],P=i;Pf[1]||Mp[1])continue;var I=s.dataToPoint([D,M]);L=new nn({shape:{x:I[0]-h/2,y:I[1]-d/2,width:h,height:d},style:R})}else if(u){var N=s.dataToLayout([y.get(_[0],P),y.get(_[1],P)]).rect;if(cc(N.x))continue;L=new nn({z2:1,shape:N,style:R})}else{if(isNaN(y.get(_[1],P)))continue;var F=s.dataToLayout([y.get(_[0],P)]),N=F.contentRect||F.rect;if(cc(N.x)||cc(N.y))continue;L=new nn({z2:1,shape:N,style:R})}if(y.hasItemOption){var B=y.getItemModel(P),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"]),C=V.get("focus"),k=V.get("blurScope"),E=V.get("disabled"),S=Is(B)}L.shape.r=A;var z=r.getRawValue(P),U="-";z&&z[2]!=null&&(U=z[2]+""),il(L,S,{labelFetcher:r,labelDataIndex:P,defaultOpacity:R.opacity,defaultText:U}),L.ensureState("emphasis").style=b,L.ensureState("blur").style=x,L.ensureState("select").style=w,Ea(L,C,k,E),L.incremental=$m(r,o),o&&(L.states.emphasis.hoverLayer=Y_),v.add(L),y.setItemGraphicEl(P,L),this._progressiveEls&&this._progressiveEls.push(L)}},e.prototype._renderOnGeo=function(r,n,i,a){var o=i.targetVisuals.inRange,s=i.targetVisuals.outOfRange,l=n.getData(),u=this._hmLayer||this._hmLayer||new mqr;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,C,k){var E=r.dataToPoint([T,C]);return E[0]-=f,E[1]-=p,E.push(k),E}),w=i.getExtent(),A=i.type==="visualMap.continuous"?yqr(w,i.option.range):vqr(w,i.getPieceList(),i.option.selected);u.update(x,v,y,o.color.getNormalizer(),{inRange:o.color.getColorMapper(),outOfRange:s.color.getColorMapper()},A);var S=new nl({style:{width:v,height:y,x:f,y:p,image:u.canvas},silent:!0});this.group.add(S)},e.type="heatmap",e}(ki),xqr=function(t){nt(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 jm(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var r=r5.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:tt.color.primary}}},e}(Ii);function wqr(t){t.registerChartView(bqr),t.registerSeriesModel(xqr)}var Aqr=["itemStyle","borderWidth"],hyt=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],zve=new Wm,Sqr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=xB,r}return e.prototype.render=function(r,n,i){var a=this.group,o=r.getData(),s=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:hyt[+h],categoryDim:hyt[1-+h]};o.diff(s).add(function(g){if(o.hasValue(g)){var m=yyt(o,g),v=dyt(o,g,m,f),y=byt(o,f,v);o.setItemGraphicEl(g,y),a.add(y),Ayt(y,f,v)}}).update(function(g,m){var v=s.getItemGraphicEl(m);if(!o.hasValue(g)){a.remove(v);return}var y=yyt(o,g),b=dyt(o,g,y,f),x=wyt(o,b);v&&x!==v.__pictorialShapeStr&&(a.remove(v),o.setItemGraphicEl(g,null),v=null),v?Rqr(v,f,b):v=byt(o,f,b,!0),o.setItemGraphicEl(g,v),v.__pictorialSymbolMeta=b,a.add(v),Ayt(v,f,b)}).remove(function(g){var m=s.getItemGraphicEl(g);m&&xyt(s,g,m.__pictorialSymbolMeta.animationModel,m)}).execute();var p=r.get("clip",!0)?iT(r.coordinateSystem,!1,r):null;return p?a.setClipPath(p):a.removeClipPath(),this._data=o,this.group},e.prototype.remove=function(r,n){var i=this.group,a=this._data;r.get("animation")?a&&a.eachItemGraphicEl(function(o){xyt(a,Cr(o).dataIndex,r,o)}):i.removeAll()},e.type=xB,e}(ki);function dyt(t,e,r,n){var i=t.getItemLayout(e),a=r.get("symbolRepeat"),o=r.get("symbolClip"),s=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:o,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};Tqr(r,a,i,n,f),Cqr(t,e,i,a,o,f.boundingLength,f.pxSign,h,n,f),Oqr(r,f.symbolScale,u,n,f);var p=f.symbolSize,g=QS(r.get("symbolOffset"),p);return kqr(r,p,i,a,o,g,s,f.valueLineWidth,f.boundingLength,f.repeatCutLength,n,f),f}function Tqr(t,e,r,n,i){var a=n.valueDim,o=t.get("symbolBoundingData"),s=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),l=s.toGlobalCoord(s.dataToCoord(0)),u=1-+(r[a.wh]<=0),h;if(ft(o)){var d=[Uve(s,o[0])-l,Uve(s,o[1])-l];d[1]=0?1:-1:h>0?1:-1}function Uve(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function Cqr(t,e,r,n,i,a,o,s,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]/s,g[1]/s];m[h.index]*=(l.isHorizontal?-1:1)*o}function Oqr(t,e,r,n,i){var a=t.get(Aqr)||0;a&&(zve.attr({scaleX:e[0],scaleY:e[1],rotation:r}),zve.updateTransform(),a/=zve.getLineScale(),a*=e[n.valueDim.index]),i.valueLineWidth=a||0}function kqr(t,e,r,n,i,a,o,s,l,u,h,d){var f=h.categoryDim,p=h.valueDim,g=d.pxSign,m=Math.max(e[p.index]+s,0),v=m;if(n){var y=Math.abs(l),b=Gc(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=Ife(n),C=T?n:Syt((y+S)/A),k=y-C*m;w=k/2/(x?C:Math.max(C-1,1)),A=m+w*2,S=x?0:w*2,!T&&n!=="fixed"&&(C=u?Syt((Math.abs(u)+S)/A):0),v=C*A-S,d.repeatTimes=C,d.symbolMargin=w}var E=g*(v/2),_=d.pathPosition=[];_[f.index]=r[f.wh]/2,_[p.index]=o==="start"?E:o==="end"?l-E:l/2,a&&(_[0]+=a[0],_[1]+=a[1]);var P=d.bundlePosition=[];P[f.index]=r[f.xy],P[p.index]=r[p.xy];var L=d.barRectShape=lt({},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 fyt(t){var e=t.symbolPatternSize,r=Yo(t.symbolType,-e/2,-e/2,e,e);return r.attr({culling:!0}),r.type!=="image"&&r.setStyle({strokeNoScale:!0}),r}function pyt(t,e,r,n){var i=t.__pictorialBundle,a=r.symbolSize,o=r.valueLineWidth,s=r.pathPosition,l=e.valueDim,u=r.repeatTimes||0,h=0,d=a[e.valueDim.index]+o+r.symbolMargin*2;for(Vve(t,function(m){m.__pictorialAnimationIndex=h,m.__pictorialRepeatTimes=u,h0:y<0)&&(b=u-1-m),v[l.index]=d*(b-u/2+.5)+s[l.index],{x:v[0],y:v[1],scaleX:r.symbolScale[0],scaleY:r.symbolScale[1],rotation:r.rotation}}}function gyt(t,e,r,n){var i=t.__pictorialBundle,a=t.__pictorialMainPath;a?V5(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=fyt(r),i.add(a),V5(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 myt(t,e,r){var n=lt({},e.barRectShape),i=t.__pictorialBarRect;i?V5(i,null,{shape:n},e,r):(i=t.__pictorialBarRect=new nn({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),i.disableMorphing=!0,t.add(i))}function vyt(t,e,r,n){if(r.symbolClip){var i=t.__pictorialClipPath,a=lt({},r.clipShape),o=e.valueDim,s=r.animationModel,l=r.dataIndex;if(i)qn(i,{shape:a},s,l);else{a[o.wh]=0,i=new nn({shape:a}),t.__pictorialBundle.setClipPath(i),t.__pictorialClipPath=i;var u={};u[o.wh]=r.clipShape[o.wh],RS[n?"updateProps":"initProps"](i,{shape:u},s,l)}}}function yyt(t,e){var r=t.getItemModel(e);return r.getAnimationDelayParams=Eqr,r.isAnimationEnabled=_qr,r}function Eqr(t){return{index:t.__pictorialAnimationIndex,count:t.__pictorialRepeatTimes}}function _qr(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function byt(t,e,r,n){var i=new gr,a=new gr;return i.add(a),i.__pictorialBundle=a,a.x=r.bundlePosition[0],a.y=r.bundlePosition[1],r.symbolRepeat?pyt(i,e,r):gyt(i,e,r),myt(i,r,n),vyt(i,e,r,n),i.__pictorialShapeStr=wyt(t,r),i.__pictorialSymbolMeta=r,i}function Rqr(t,e,r){var n=r.animationModel,i=r.dataIndex,a=t.__pictorialBundle;qn(a,{x:r.bundlePosition[0],y:r.bundlePosition[1]},n,i),r.symbolRepeat?pyt(t,e,r,!0):gyt(t,e,r,!0),myt(t,r,!0),vyt(t,e,r,!0)}function xyt(t,e,r,n){var i=n.__pictorialBarRect;i&&i.removeTextContent();var a=[];Vve(n,function(o){a.push(o)}),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(r=null),fe(a,function(o){Qx(o,{scaleX:0,scaleY:0},r,e,function(){n.parent&&n.parent.remove(n)})}),t.setItemGraphicEl(e,null)}function wyt(t,e){return[t.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function Vve(t,e,r){fe(t.__pictorialBundle.children(),function(n){n!==t.__pictorialBarRect&&e.call(r,n)})}function V5(t,e,r,n,i,a){e&&t.attr(e),n.symbolClip&&!i?r&&t.attr(r):r&&RS[i?"updateProps":"initProps"](t,r,n.animationModel,n.dataIndex,a)}function Ayt(t,e,r){var n=r.dataIndex,i=r.itemModel,a=i.getModel("emphasis"),o=a.getModel("itemStyle").getItemStyle(),s=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");Vve(t,function(m){if(m instanceof nl){var v=m.style;m.useStyle(lt({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=o,f&&(y.scaleX=m.scaleX*1.1,y.scaleY=m.scaleY*1.1),m.ensureState("blur").style=s,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,il(g,Is(i),{labelFetcher:e.seriesModel,labelDataIndex:n,defaultText:E5(e.seriesModel.getData(),n),inheritColor:r.style.fill,defaultOpacity:r.style.opacity,defaultOutsidePosition:p}),Ea(t,h,d,a.get("disabled"))}function Syt(t){var e=Math.round(t);return Math.abs(t-e)<1e-4?e:Math.ceil(t)}var Dqr=function(t){nt(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."+xB,e.dependencies=["grid"],e.defaultOption=Hx(wB.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:tt.color.primary}}}),e}(wB);function Lqr(t){t.registerChartView(Sqr),t.registerSeriesModel(Dqr),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,Ngt(xB)),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,Bgt(xB)),Fgt(t)}var Qve=2,Q5="themeRiver",Mqr=function(t){nt(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 L5(Wt(this.getData,this),Wt(this.getRawData,this))},e.prototype.fixData=function(r){var n=r.length,i={},a=Ffe(r,function(f){return i.hasOwnProperty(f[0]+"")||(i[f[0]+""]=-1),f[2]}),o=[];a.buckets.each(function(f,p){o.push({name:p,dataList:f})});for(var s=o.length,l=0;la&&(a=s),n.push(s)}for(var u=0;ua&&(a=d)}return{y0:i,max:a}}function Fqr(t){t.registerChartView(Iqr),t.registerSeriesModel(Mqr),t.registerLayout(Nqr),t.registerProcessor(AB(Q5))}var zqr=2,Uqr=4,Cyt=function(t){nt(e,t);function e(r,n,i,a){var o=t.call(this)||this;o.z2=zqr,o.textConfig={inside:!0},Cr(o).seriesIndex=n.seriesIndex;var s=new $n({z2:Uqr,silent:r.getModel().get(["label","silent"])});return o.setTextContent(s),o.updateData(!0,r,n,i,a),o}return e.prototype.updateData=function(r,n,i,a,o){this.node=n,n.piece=this,i=i||this._seriesModel,a=a||this._ecModel;var s=this;Cr(s).dataIndex=n.dataIndex;var l=n.getModel(),u=l.getModel("emphasis"),h=n.getLayout(),d=lt({},h);d.label=null;var f=n.getVisual("style");f.lineJoin="bevel";var p=n.getVisual("decal");p&&(f.decal=f5(p,o));var g=r0(l.getModel("itemStyle"),d,!0);lt(d,g),fe(Lu,function(b){var x=s.ensureState(b),w=l.getModel([b,"itemStyle"]);x.style=w.getItemStyle();var A=r0(w,d);A&&(x.shape=A)}),r?(s.setShape(d),s.shape.r=h.r0,ua(s,{shape:{r:h.r}},i,n.dataIndex)):(qn(s,{shape:d},i),np(s)),s.useStyle(f),this._updateLabel(i);var m=l.getShallow("cursor");m&&s.attr("cursor",m),this._seriesModel=i||this._seriesModel,this._ecModel=a||this._ecModel;var v=u.get("focus"),y=v==="relative"?b_(n.getAncestorsIndices(),n.getDescendantIndices()):v==="ancestor"?n.getAncestorsIndices():v==="descendant"?n.getDescendantIndices():v;Ea(this,y,u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(r){var n=this,i=this.node.getModel(),a=i.getModel("label"),o=this.node.getLayout(),s=o.endAngle-o.startAngle,l=(o.startAngle+o.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(s)R&&!oS(M-R)&&M0?(o.virtualPiece?o.virtualPiece.updateData(!1,b,r,n,i):(o.virtualPiece=new Cyt(b,r,n,i),h.add(o.virtualPiece)),x.piece.off("click"),o.virtualPiece.on("click",function(w){o._rootToNode(x.parentNode)})):o.virtualPiece&&(h.remove(o.virtualPiece),o.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(o){if(!i&&o.piece&&o.piece===n.target){var s=o.getModel().get("nodeClick");if(s==="rootToNode")r._rootToNode(o);else if(s==="link"){var l=o.getModel(),u=l.get("link");if(u){var h=l.get("target",!0)||"_blank";BW(u,h)}}i=!0}})})},e.prototype._rootToNode=function(r){r!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:Gve,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 o=r[0]-a.cx,s=r[1]-a.cy,l=Math.sqrt(o*o+s*s);return l<=a.r&&l>=a.r0}},e.type=ST,e}(ki),Wqr=Ls(ST,Yqr);function Yqr(t){var e={};function r(n,i,a){if(n.depth===0)return tt.color.neutral50;for(var o=n;o&&o.depth>1;)o=o.parentNode;var s=i.getColorFromPalette(o.name||o.dataIndex+"",e);return n.depth>1&&$t(s)&&(s=OH(s,(n.depth-1)/(a-1)*.5)),s}t.eachSeriesByType(ST,function(n){var i=n.getData(),a=i.tree;a.eachNode(function(o){var s=o.getModel(),l=s.getModel("itemStyle").getItemStyle();l.fill||(l.fill=r(o,n,a.root.height));var u=i.ensureUniqueItemVisual(o.dataIndex,"style");lt(u,l)})})}var Eyt=Math.PI/180,qqr=Ls(ST,jqr);function jqr(t,e){t.eachSeriesByType(ST,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(),o=e.getHeight(),s=Math.min(a,o),l=Qt(n[0],a),u=Qt(n[1],o),h=Qt(i[0],s/2),d=Qt(i[1],s/2),f=-r.get("startAngle")*Eyt,p=r.get("minAngle")*Eyt,g=r.getData().tree.root,m=r.getViewRoot(),v=m.depth,y=r.get("sort");y!=null&&_yt(m,y);var b=0;fe(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),C=r.get("clockwise"),k=r.get("stillShowZeroSum"),E=C?1:-1,_=function(D,M){if(D){var I=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]),o=r.dataToAngle(i[1]),s=t.coordToPoint([a,o]);return s.push(a,o*Math.PI/180),s},size:Wt(ojr,t)}}}function ljr(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 cjr(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 Dyt={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},Lyt=En(Dyt);Yf(Ty,function(t,e){return t[e]=1,t},{}),Ty.join(", ");var Iq=["","style","shape","extra"],G5=Gr();function Hve(t,e,r,n,i){var a=t+"Animation",o=H_(t,n,i)||{},s=G5(e).userDuring;return o.duration>0&&(o.during=s?Wt(pjr,{el:e,userDuring:s}):null,o.setToFinal=!0,o.scope=t),lt(o,r[a]),o}function Pq(t,e,r,n){n=n||{};var i=n.dataIndex,a=n.isInit,o=n.clearStyle,s=r.isAnimationEnabled(),l=G5(t),u=e.style;l.userDuring=e.during;var h={},d={};if(mjr(t,e,d),t.type==="compound")for(var f=t.shape.paths,p=e.shape.paths,g=0;g0&&t.animateFrom(v,y)}else hjr(t,e,i||0,r,h);Myt(t,e),u?t.dirty():t.markRedraw()}function Myt(t,e){for(var r=G5(t).leaveToProps,n=0;n0&&t.animateFrom(i,a)}}function djr(t,e){Kt(e,"silent")&&(t.silent=e.silent),Kt(e,"ignore")&&(t.ignore=e.ignore),t instanceof tp&&Kt(e,"invisible")&&(t.invisible=e.invisible),t instanceof yn&&Kt(e,"autoBatch")&&(t.autoBatch=e.autoBatch)}var a0={},fjr={setTransform:function(t,e){return a0.el[t]=e,this},getTransform:function(t){return a0.el[t]},setShape:function(t,e){var r=a0.el,n=r.shape||(r.shape={});return n[t]=e,r.dirtyShape&&r.dirtyShape(),this},getShape:function(t){var e=a0.el.shape;if(e)return e[t]},setStyle:function(t,e){var r=a0.el,n=r.style;return n&&(n[t]=e,r.dirtyStyle&&r.dirtyStyle()),this},getStyle:function(t){var e=a0.el.style;if(e)return e[t]},setExtra:function(t,e){var r=a0.el.extra||(a0.el.extra={});return r[t]=e,this},getExtra:function(t){var e=a0.el.extra;if(e)return e[t]}};function pjr(){var t=this,e=t.el;if(e){var r=G5(e).userDuring,n=t.userDuring;if(r!==n){t.el=t.userDuring=null;return}a0.el=e,n(fjr)}}function Iyt(t,e,r,n){var i=r[t];if(i){var a=e[t],o;if(a){var s=r.transition,l=i.transition;if(l)if(!o&&(o=n[t]={}),TT(l))lt(o,a);else for(var u=qi(l),h=0;h=0){!o&&(o=n[t]={});for(var p=En(a),h=0;h=0)){var f=t.getAnimationStyleProps(),p=f?f.style:null;if(p){!a&&(a=n.style={});for(var g=En(r),u=0;u=0?e.getStore().get(N,M):void 0}var F=e.get(I.name,M),B=I&&I.ordinalMeta;return B?B.categories[F]:F}function T(D,M){M==null&&(M=h);var I=e.getItemVisual(M,"style"),N=I&&I.fill,F=I&&I.opacity,B=x(M,l2).getItemStyle();N!=null&&(B.fill=N),F!=null&&(B.opacity=F);var V={inheritColor:$t(N)?N:tt.color.neutral99},z=w(M,l2),U=ji(z,null,V,!1,!0);U.text=z.getShallow("show")?Jt(t.getFormattedLabel(M,l2),E5(e,M)):null;var Q=_W(z,V,!1);return E(D,B),B=ugt(B,U,Q),D&&k(B,D),B.legacy=!0,B}function C(D,M){M==null&&(M=h);var I=x(M,Qy).getItemStyle(),N=w(M,Qy),F=ji(N,null,null,!0,!0);F.text=N.getShallow("show")?Bh(t.getFormattedLabel(M,Qy),t.getFormattedLabel(M,l2),E5(e,M)):null;var B=_W(N,null,!0);return E(D,I),I=ugt(I,F,B),D&&k(I,D),I.legacy=!0,I}function k(D,M){for(var I in M)Kt(M,I)&&(D[I]=M[I])}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(Ryt,D)){var I=e.getItemVisual(M,"style");return I?I[Ryt[D]]:null}if(Kt(Zqr,D))return e.getItemVisual(M,D)}function P(D){if(o.type==="cartesian2d"){var M=o.getBaseAxis();return OUr(mr({axis:M},D))}}function L(){return r.getCurrentSeriesIndices()}function R(D){return $pe(D,r)}}function kjr(t){var e={};return fe(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 tye(t,e,r,n,i,a,o){if(!n){a.remove(e);return}var s=rye(t,e,r,n,i,a);return s&&o.setItemGraphicEl(r,s),s&&Ea(s,n.focus,n.blurScope,n.emphasisDisabled),s}function rye(t,e,r,n,i,a){var o=-1,s=e;e&&Fyt(e,n,i)&&(o=Nr(a.childrenRef(),e),e=null);var l=!e,u=e;u?u.clearStates():(u=Jve(n),s&&Sjr(s,u)),n.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),n.tooltipDisabled&&(u.tooltipDisabled=!0),fp.normal.cfg=fp.normal.conOpt=fp.emphasis.cfg=fp.emphasis.conOpt=fp.blur.cfg=fp.blur.conOpt=fp.select.cfg=fp.select.conOpt=null,fp.isLegacy=!1,_jr(u,r,n,i,l,fp),Ejr(u,r,n,i,l),eye(t,u,r,n,fp,i,l),Kt(n,"info")&&(Vy(u).info=n.info);for(var h=0;h=0?a.replaceAt(u,o):a.add(u),u}function Fyt(t,e,r){var n=Vy(t),i=e.type,a=e.shape,o=e.style;return r.isUniversalTransitionEnabled()||i!=null&&i!==n.customGraphicType||i==="path"&&Ijr(a)&&Qyt(a)!==n.customPathData||i==="image"&&Kt(o,"image")&&o.image!==n.customImagePath}function Ejr(t,e,r,n,i){var a=r.clipPath;if(a===!1)t&&t.getClipPath()&&t.removeClipPath();else if(a){var o=t.getClipPath();o&&Fyt(o,a,n)&&(o=null),o||(o=Jve(a),t.setClipPath(o)),eye(null,o,e,a,null,n,i)}}function _jr(t,e,r,n,i,a){if(!(t.isGroup||t.type==="compoundPath")){zyt(r,null,a),zyt(r,Qy,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,l=a.blur.conOpt,u=a.select.conOpt;if(o!=null||s!=null||u!=null||l!=null){var h=t.getTextContent();if(o===!1)h&&t.removeTextContent();else{o=a.normal.conOpt=o||{type:"text"},h?h.clearStates():(h=Jve(o),t.setTextContent(h)),eye(null,h,e,o,null,n,i);for(var d=o&&o.style,f=0;f=h;p--){var g=e.childAt(p);Djr(e,g,i)}}}function Djr(t,e,r){e&&Nq(e,Vy(t).option,r)}function Ljr(t){new Py(t.oldChildren,t.newChildren,Uyt,Uyt,t).add(Vyt).update(Vyt).remove(Mjr).execute()}function Uyt(t,e){var r=t&&t.name;return r??wjr+e}function Vyt(t,e){var r=this.context,n=t!=null?r.newChildren[t]:null,i=e!=null?r.oldChildren[e]:null;rye(r.api,i,r.dataIndex,n,r.seriesModel,r.group)}function Mjr(t){var e=this.context,r=e.oldChildren[t];r&&Nq(r,Vy(r).option,e.seriesModel)}function Qyt(t){return t&&(t.pathData||t.d)}function Ijr(t){return t&&(Kt(t,"pathData")||Kt(t,"d"))}function Pjr(t){t.registerChartView(Tjr),t.registerSeriesModel(Jqr)}var CT=Gr(),Gyt=lr,iye=Wt,aye=function(){function t(){this._dragging=!1,this.animationThreshold=15}return t.prototype.render=function(e,r,n,i){var a=r.get("value"),o=r.get("status");if(this._axisModel=e,this._axisPointerModel=r,this._api=n,!(!i&&this._lastValue===a&&this._lastStatus===o)){this._lastValue=a,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.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(!s)s=this._group=new gr,this.createPointerEl(s,u,e,r),this.createLabelEl(s,u,e,r),n.getZr().add(s);else{var f=Kr(Hyt,r,d);this.updatePointerEl(s,u,f),this.updateLabelEl(s,u,f,r)}qyt(s,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",o=r.get("snap");if(!o&&!a)return!1;if(n==="auto"||n==null){var s=this.animationThreshold;if(a&&mc(i).w>s)return!0;if(o){var l=g0e(e).seriesDataCount,u=i.getExtent();return Math.abs(u[0]-u[1])/l>s}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 o=CT(e).pointerEl=new RS[a.type](Gyt(r.pointer));e.add(o)}},t.prototype.createLabelEl=function(e,r,n,i){if(r.label){var a=CT(e).labelEl=new $n(Gyt(r.label));e.add(a),Yyt(a,i)}},t.prototype.updatePointerEl=function(e,r,n){var i=CT(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=CT(e).labelEl;a&&(a.setStyle(r.label.style),n(a,{x:r.label.x,y:r.label.y}),Yyt(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"),o=r.get("status");if(!a.get("show")||!o||o==="hide"){i&&n.remove(i),this._handle=null;return}var s;this._handle||(s=!0,i=this._handle=X_(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){by(u.event)},onmousedown:iye(this._onHandleDragMove,this,0,0),drift:iye(this._onHandleDragMove,this),ondragend:iye(this._onHandleDragEnd,this)}),n.add(i)),qyt(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,s5(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},t.prototype._moveHandleToValue=function(e,r){Hyt(this._axisPointerModel,!r&&this._moveAnimation,this._handle,oye(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(oye(n),[e,r],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(oye(i)),CT(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),z8(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 Hyt(t,e,r,n){Wyt(CT(r).lastProp,n)||(CT(r).lastProp=n,e?qn(r,n,t):(r.stopAnimation(),r.attr(n)))}function Wyt(t,e){if(yr(t)&&yr(e)){var r=!0;return fe(e,function(n,i){r=r&&Wyt(t[i],n)}),!!r}else return t===e}function Yyt(t,e){t[e.get(["label","show"])?"show":"hide"]()}function oye(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function qyt(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 sye(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 jyt(t,e,r,n,i){var a=r.get("value"),o=Xyt(a,e.axis,e.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=t5(s.get("padding")||0),u=s.getFont(),h=FH(o,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),Njr(d,f,p,n);var v=s.get("backgroundColor");(!v||v==="auto")&&(v=e.get(["axisLine","lineStyle","color"])),t.label={x:d[0],y:d[1],style:ji(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:v}),z2:10}}function Njr(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 Xyt(t,e,r,n,i){t=e.scale.parse(t);var a=e.scale.getLabel({value:t},{precision:i.precision}),o=i.formatter;if(o){var s={value:CY(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};fe(n,function(l){var u=r.getSeriesByIndex(l.seriesIndex),h=l.dataIndexInside,d=u&&u.getDataParams(h);d&&s.seriesData.push(d)}),$t(o)?a=o.replace("{value}",a):ur(o)&&(a=o(s))}return a}function lye(t,e,r){var n=ka();return xy(n,n,r.rotation),sg(n,n,r.position),fg([t.dataToCoord(e),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function Kyt(t,e,r,n,i,a){var o=Bu.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=i.get(["label","margin"]),jyt(e,n,i,a,{position:lye(n.axis,t,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function cye(t,e,r){return r=r||0,{x1:t[r],y1:t[1-r],x2:e[r],y2:e[1-r]}}function Zyt(t,e,r){return r=r||0,{x:t[r],y:t[1-r],width:e[r],height:e[1-r]}}function Jyt(t,e,r,n,i,a){return{cx:t,cy:e,r0:r,r:n,startAngle:i,endAngle:a,clockwise:!0}}function uye(t,e,r){return mc(t,{fromStat:{sers:vt(e,function(n){return r.getSeriesByIndex(n.seriesIndex)})},min:1}).w}function hye(t,e,r){return[rn(Oi(e[0],e[1]),t-r/2),Oi(t+r/2,rn(e[0],e[1]))]}var Bjr=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis,l=s.grid,u=a.get("type"),h=s.getGlobalExtent(),d=e1t(l,s).getOtherAxis(s).getGlobalExtent(),f=s.toGlobalCoord(s.dataToCoord(n,!0));if(u&&u!=="none"){var p=sye(a),g=$jr[u](s,f,h,d,a.get("seriesDataIndices"),a.ecModel);g.style=p,r.graphicKey=g.type,r.pointer=g}var m=HY(l.getRect(),i);Kyt(n,r,m,i,a,o)},e.prototype.getHandleTransform=function(r,n,i){var a=HY(n.axis.grid.getRect(),n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=lye(n.axis,r,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(r,n,i,a){var o=i.axis,s=o.grid,l=o.getGlobalExtent(!0),u=e1t(s,o).getOtherAxis(o).getGlobalExtent(),h=o.dim==="x"?0:1,d=[r.x,r.y];d[h]+=n[h],d[h]=Oi(l[1],d[h]),d[h]=rn(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}(aye);function e1t(t,e){var r={};return r[e.dim+"AxisIndex"]=e.index,t.getCartesian(r)}var $jr={line:function(t,e,r,n){var i=cye([e,n[0]],[e,n[1]],t1t(t));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(t,e,r,n,i,a){var o=uye(t,i,a),s=n[1]-n[0],l=hye(e,r,o),u=l[0],h=l[1];return{type:"Rect",shape:Zyt([u,n[0]],[h-u,s],t1t(t))}}};function t1t(t){return t.dim==="x"?0:1}var Fjr=function(t){nt(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:tt.color.border,width:1,type:"dashed"},shadowStyle:{color:tt.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:tt.color.neutral00,padding:[5,7,5,7],backgroundColor:tt.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:tt.color.accent40,throttle:40}},e}(pn),Gy=Gr(),zjr=fe;function r1t(t,e,r){if(!Dn.node){var n=e.getZr();Gy(n).records||(Gy(n).records={}),Ujr(n,e);var i=Gy(n).records[t]||(Gy(n).records[t]={});i.handler=r}}function Ujr(t,e){if(Gy(t).initialized)return;Gy(t).initialized=!0,r("click",Kr(dye,"click")),r("mousemove",Kr(dye,"mousemove")),r("mousewheel",Kr(dye,"mousewheel")),r("globalout",Qjr);function r(n,i){t.on(n,function(a){var o=Gjr(e);zjr(Gy(t).records,function(s){s&&i(s,a,o.dispatchAction)}),Vjr(o.pendings,e)})}}function Vjr(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 Qjr(t,e,r){t.handler("leave",null,r)}function dye(t,e,r,n){e.handler(t,r,n)}function Gjr(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 fye(t,e){if(!Dn.node){var r=e.getZr(),n=(Gy(r).records||{})[t];n&&(Gy(r).records[t]=null)}}var Hjr=function(t){nt(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"),o=r.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click|mousewheel";r1t("axisPointer",i,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(r,n){fye("axisPointer",n)},e.prototype.dispose=function(r,n){fye("axisPointer",n)},e.type="axisPointer",e}(Xi);function n1t(t,e){var r=[],n=t.seriesIndex,i;if(n==null||!(i=e.getSeriesByIndex(n)))return{point:[]};var a=i.getData(),o=lS(a,t);if(o==null||o<0||ft(o))return{point:[]};var s=a.getItemGraphicEl(o),l=i.coordinateSystem;if(i.getTooltipPosition)r=i.getTooltipPosition(o)||[];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,o),m[1-p]=a.get(a.getCalculationInfo("stackResultDimension"),o),r=l.dataToPoint(m)||[]}else r=l.dataToPoint(a.getValues(vt(l.dimensions,function(y){return a.mapDimension(y)}),o))||[];else if(s){var v=s.getBoundingRect().clone();v.applyTransform(s.transform),r=[v.x+v.width/2,v.y+v.height/2]}return{point:r,el:s}}var i1t=Gr();function Wjr(t,e,r){var n=t.currTrigger,i=[t.x,t.y],a=t,o=t.dispatchAction||Wt(r.dispatchAction,r),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){Fq(i)&&(i=n1t({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=Fq(i),u=a.axesInfo,h=s.axesInfo,d=n==="leave"||Fq(i),f={},p={},g={list:[],map:{}},m={showPointer:Kr(qjr,p),showTooltip:Kr(jjr,g)};fe(s.coordSysMap,function(y,b){var x=l||y.containPoint(i);fe(s.coordSysAxesInfo[b],function(w,A){var S=w.axis,T=Jjr(u,w);if(!d&&x&&(!u||T)){var C=T&&T.value;C==null&&!l&&(C=S.pointToData(i)),C!=null&&a1t(w,C,m,!1,f)}})});var v={};return fe(h,function(y,b){var x=y.linkGroup;x&&!p[b]&&fe(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,o1t(w),o1t(y)))),v[y.key]=T}})}),fe(v,function(y,b){a1t(h[b],y,m,!0,f)}),Xjr(p,h,f),Kjr(g,i,t,o),Zjr(h,o,r),f}}function a1t(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 o=Yjr(e,t),s=o.payloadBatch,l=o.snapToValue;s[0]&&i.seriesIndex==null&<(i,s[0]),!n&&t.snap&&a.containData(l)&&l!=null&&(e=l),r.showPointer(t,e,s),r.showTooltip(t,o,l)}}function Yjr(t,e){var r=e.axis,n=r.dim,i=t,a=[],o=Number.MAX_VALUE,s=-1;return fe(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(ep(d)){var g=t-d,m=Math.abs(g);m<=o&&((m=0&&s<0)&&(o=m,s=g,i=d,a.length=0),fe(f,function(v){a.push({seriesIndex:l.seriesIndex,dataIndexInside:v,dataIndex:l.getData().getRawIndex(v)})}))}}),{payloadBatch:a,snapToValue:i}}function qjr(t,e,r,n){t[e.key]={value:r,payloadBatch:n}}function jjr(t,e,r,n){var i=r.payloadBatch,a=e.axis,o=a.model,s=e.axisPointerModel;if(!(!e.triggerTooltip||!i.length)){var l=e.coordSys.model,u=SB(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:o.componentIndex,axisType:o.type,axisId:o.id,value:n,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function Xjr(t,e,r){var n=r.axesInfo=[];fe(e,function(i,a){var o=i.axisPointerModel.option,s=t[a];s?(!i.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!i.useHandle&&(o.status="hide"),o.status==="show"&&n.push({axisDim:i.axis.dim,axisIndex:i.axis.model.componentIndex,value:o.value})})}function Kjr(t,e,r,n){if(Fq(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 Zjr(t,e,r){var n=r.getZr(),i="axisPointerLastHighlights",a=i1t(n)[i]||{},o=i1t(n)[i]={};fe(t,function(h,d){var f=h.axisPointerModel.option;f.status==="show"&&h.triggerEmphasis&&fe(f.seriesDataIndices,function(p){o[p.seriesIndex+"|"+p.dataIndex]=p})});var s=[],l=[];function u(h){return{seriesIndex:h.seriesIndex,dataIndex:h.dataIndex}}fe(a,function(h,d){!o[d]&&l.push(u(h))}),fe(o,function(h,d){!a[d]&&s.push(u(h))}),l.length&&r.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&r.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function Jjr(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 o1t(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 Fq(t){return!t||t[0]==null||isNaN(t[0])||t[1]==null||isNaN(t[1])}function YB(t){uT.registerAxisPointerClass("CartesianAxisPointer",Bjr),t.registerComponentModel(Fjr),t.registerComponentView(Hjr),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=wVr(e,r)}}),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},Wjr)}function eXr(t){Xr(Smt),Xr(YB)}var tXr=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis;s.dim==="angle"&&(this.animationThreshold=Math.PI/18);var l=s.polar,u=s.getExtent(),h=l.getOtherAxis(s).getExtent(),d=s.dataToCoord(n),f=a.get("type");if(f&&f!=="none"){var p=sye(a),g=nXr[f](s,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=rXr(n,i,a,l,m);jyt(r,i,a,o,v)},e}(aye);function rXr(t,e,r,n,i){var a=e.axis,o=a.dataToCoord(t),s=n.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l=n.getRadiusAxis().getExtent(),u,h,d;if(a.dim==="radius"){var f=ka();xy(f,f,s),sg(f,f,[n.cx,n.cy]),u=fg([o,-i],f);var p=e.getModel("axisLabel").get("rotate")||0,g=Bu.innerTextLayout(s,p*Math.PI/180,-1);h=g.textAlign,d=g.textVerticalAlign}else{var m=l[1];u=n.coordToPoint([m+i,o]);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 nXr={line:function(t,e,r,n,i){return t.dim==="angle"?{type:"Line",shape:cye(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,o){var s=Math.PI/180,l=uye(t,a,o),u;if(t.dim==="angle")u=Jyt(e.cx,e.cy,i[0],i[1],(-r-l/2)*s,(-r+l/2)*s);else{var h=hye(r,n,l),d=h[0],f=h[1];u=Jyt(e.cx,e.cy,d,f,0,Math.PI*2)}return{type:"Sector",shape:u}}},o0="polar",s1t=o0,iXr=function(t){nt(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=o0,e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={z:0,center:["50%","50%"],radius:"80%"},e}(pn),pye=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",xo).models[0]},e.type="polarAxis",e}(pn);Qo(pye,S5);var aXr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="angleAxis",e}(pye),oXr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="radiusAxis",e}(pye),gye=function(t){nt(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}(cp);gye.prototype.dataToRadius=cp.prototype.dataToCoord,gye.prototype.radiusToData=cp.prototype.coordToData;var sXr=Gr(),mye=function(t){nt(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(),o=i.count();if(a[1]-a[0]<1)return 0;var s=a[0],l=r.dataToCoord(s+1)-r.dataToCoord(s),u=Math.abs(l),h=FH(s==null?"":s+"",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=sXr(r.model),m=g.lastAutoInterval,v=g.lastTickCount;return m!=null&&v!=null&&Math.abs(m-p)<=1&&Math.abs(v-o)<=1&&m>p?p=m:(g.lastTickCount=o,g.lastAutoInterval=p),p},e}(cp);mye.prototype.dataToAngle=cp.prototype.dataToCoord,mye.prototype.angleToData=cp.prototype.coordToData;var l1t=["radius","angle"],lXr=function(){function t(e){this.dimensions=l1t,this.type=o0,this.cx=0,this.cy=0,this._radiusAxis=new gye,this._angleAxis=new mye,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(),o=Math.min(a[0],a[1]),s=Math.max(a[0],a[1]);i.inverse?o=s-360:s=o+360;var l=Math.sqrt(r*r+n*n);r/=l,n/=l;for(var u=Math.atan2(-n,r)/Math.PI*180,h=us;)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,o=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(s,l){var u=s-this.cx,h=l-this.cy,d=u*u+h*h,f=this.r,p=this.r0;return f!==p&&d-o<=f*f&&d+o>=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=c1t(r);return i===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,r,n){var i=c1t(r);return i===this?this.pointToData(n):null},t}();function c1t(t){var e=t.seriesModel,r=t.polarModel;return r&&r.coordinateSystem||e&&e.coordinateSystem}function cXr(t,e,r){var n=e.get("center"),i=Ps(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(),o=Math.min(i.width,i.height)/2,s=e.get("radius");s==null?s=[0,"100%"]:ft(s)||(s=[0,s]);var l=[Qt(s[0],o),Qt(s[1],o)];a.inverse?a.setExtent(l[1],l[0]):a.setExtent(l[0],l[1])}function uXr(t,e){var r=this,n=r.getAngleAxis(),i=r.getRadiusAxis();if(KS(n,C5),KS(i,C5),O5(n),O5(i),n.type==="category"&&!n.onBand){var a=n.getExtent(),o=360/n.scale.count();n.inverse?a[1]+=o:a[1]-=o,n.setExtent(a[0],a[1])}}function hXr(t){return t.mainType==="angleAxis"}function u1t(t,e){var r;if(t.type=tB(e),t.scale=x5(e,t.type,!1),t.onBand=iB(t.scale,e),t.inverse=e.get("inverse"),hXr(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 dXr={dimensions:l1t,create:function(t,e){var r=[];return t.eachComponent(s1t,function(n,i){var a=new lXr(i+"");a.update=uXr;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=n.findAxisModel("radiusAxis"),u=n.findAxisModel("angleAxis");u1t(o,l),u1t(s,u),cXr(a,n,e),r.push(a),n.coordinateSystem=a,a.model=n}),t.eachSeries(function(n){if(n.get("coordinateSystem")===o0){var i=n.getReferringComponents(s1t,xo).models[0],a=n.coordinateSystem=i.coordinateSystem;a&&(XS(a.getRadiusAxis(),n,o0),XS(a.getAngleAxis(),n,o0))}}),r}},fXr=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function zq(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 Uq(t){var e=t.getRadiusAxis();return e.inverse?0:1}function h1t(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 pXr=function(t){nt(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,o=a.getRadiusAxis().getExtent(),s=i.getTicksCoords({breakTicks:"none"}),l=i.getMinorTicksCoords(),u=[];fe(i.getViewLabels(),function(h){if(!h.tick.offInterval){h=lr(h);var d=i.scale;h.coord=i.dataToCoord(A5(d,h.tick)),u.push(h)}}),h1t(u),h1t(s),fe(fXr,function(h){r.get([h,"show"])&&(!i.scale.isBlank()||h==="axisLine")&&gXr[h](this.group,r,a,s,l,o,u)},this)}},e.type="angleAxis",e}(uT),gXr={axisLine:function(t,e,r,n,i,a){var o=e.getModel(["axisLine","lineStyle"]),s=r.getAngleAxis(),l=Math.PI/180,u=s.getExtent(),h=Uq(r),d=h?0:1,f,p=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[d]===0?f=new RS[p]({shape:{cx:r.cx,cy:r.cy,r:a[h],startAngle:-u[0]*l,endAngle:-u[1]*l,clockwise:s.inverse},style:o.getLineStyle(),z2:1,silent:!0}):f=new Q_({shape:{cx:r.cx,cy:r.cy,r:a[h],r0:a[d]},style:o.getLineStyle(),z2:1,silent:!0}),f.style.fill=null,t.add(f)},axisTick:function(t,e,r,n,i,a){var o=e.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[Uq(r)],u=vt(n,function(h){return new Go({shape:zq(r,[l,l+s],h.coord)})});t.add(Gd(u,{style:mr(o.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(t,e,r,n,i,a){if(i.length){for(var o=e.getModel("axisTick"),s=e.getModel("minorTick"),l=(o.get("inside")?-1:1)*s.get("length"),u=a[Uq(r)],h=[],d=0;dy?"left":"right",w=Math.abs(v[1]-b)/m<.3?"middle":v[1]>b?"top":"bottom";if(s&&s[g]){var A=s[g];yr(A)&&A.textStyle&&(p=new bn(A.textStyle,l,l.ecModel))}var S=new $n({silent:Bu.isLabelSilent(e),style:ji(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),Ly({el:S,componentModel:e,itemName:d.formattedLabel,formatterParamsExtra:{isTruncated:function(){return S.isTruncated},value:d.rawLabel,tickIndex:f}}),h){var T=Bu.makeAxisEventDataBase(e);T.targetType="axisLabel",T.value=d.rawLabel,Cr(S).eventData=T}},this)},splitLine:function(t,e,r,n,i,a){var o=e.getModel("splitLine"),s=o.getModel("lineStyle"),l=s.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][C]);var E=void 0,_=void 0,P=void 0,L=void 0;if(h.dim==="radius"){var R=h.dataToCoord(S)-x,D=t.dataToCoord(T);ao(R)=L})}}function TXr(t,e){var r=cT(e,o0),n=mc(t,{fromStat:{key:r},min:1}).w,i=n,a=0,o="20%",s="30%",l={};jS(t,r,function(v){var y=d1t(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=Oi(i,b),l[y].width=b,i-=b),x&&(l[y].maxWidth=x),w!=null&&(s=w),A!=null&&(o=A)});var u={},h=Qt(o,n),d=Qt(s,1),f=(i-h)/(a+(a-1)*d);f=rn(f,0),fe(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 o=i.orient==="horizontal"?0:1;return e instanceof Array&&(e=e[0]),n[o]=i.toGlobalCoord(i.dataToCoord(+e)),n[1-o]=o===0?a.y+a.height/2:a.x+a.width/2,n},t.prototype.convertToPixel=function(e,r,n){var i=p1t(r);return i===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,r,n){var i=p1t(r);return i===this?this.pointToData(n):null},t}();function p1t(t){var e=t.seriesModel,r=t.singleAxisModel;return r&&r.coordinateSystem||e&&e.coordinateSystem}function PXr(t,e){var r=[];return t.eachComponent(y0e,function(n,i){var a=new IXr(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")===LVr){var i=n.getReferringComponents(y0e,xo).models[0],a=n.coordinateSystem=i&&i.coordinateSystem;a&&XS(a.getAxis(),n,eq)}}),r}var NXr={create:PXr,dimensions:f1t},g1t=["x","y"],BXr=["width","height"],$Xr=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis,l=s.coordinateSystem,u=Vq(s),h=Qq(l,u),d=Qq(l,1-u),f=l.dataToPoint(n)[0],p=a.get("type");if(p&&p!=="none"){var g=sye(a),m=FXr[p](s,f,h,d,a.get("seriesDataIndices"),a.ecModel);m.style=g,r.graphicKey=m.type,r.pointer=m}var v=vye(i);Kyt(n,r,v,i,a,o)},e.prototype.getHandleTransform=function(r,n,i){var a=vye(n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=lye(n.axis,r,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(r,n,i,a){var o=i.axis,s=o.coordinateSystem,l=Vq(o),u=Qq(s,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=Qq(s,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}(aye),FXr={line:function(t,e,r,n){var i=cye([e,n[0]],[e,n[1]],Vq(t));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(t,e,r,n,i,a){var o=uye(t,i,a),s=n[1]-n[0],l=hye(e,r,o),u=l[0],h=l[1];return{type:"Rect",shape:Zyt([u,n[0]],[h-u,s],Vq(t))}}};function Vq(t){return t.isHorizontal()?0:1}function Qq(t,e){var r=t.getRect();return[r[g1t[e]],r[g1t[e]]+r[BXr[e]]]}var zXr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="single",e}(Xi);function UXr(t){Xr(YB),uT.registerAxisPointerClass("SingleAxisPointer",$Xr),t.registerComponentView(zXr),t.registerComponentView(DXr),t.registerComponentModel(tq),M5(t,"single",tq,tq.defaultOption),t.registerCoordinateSystem("single",NXr)}var VXr=function(t){nt(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=PS(r);t.prototype.init.apply(this,arguments),m1t(r,a)},e.prototype.mergeOption=function(r){t.prototype.mergeOption.apply(this,arguments),m1t(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:tt.color.axisLine,width:1,type:"solid"}},itemStyle:{color:tt.color.neutral00,borderWidth:1,borderColor:tt.color.neutral10},dayLabel:{show:!0,firstDay:0,position:"start",margin:tt.size.s,color:tt.color.secondary},monthLabel:{show:!0,position:"start",margin:tt.size.s,align:"center",formatter:null,color:tt.color.secondary},yearLabel:{show:!0,position:null,margin:tt.size.xl,formatter:null,color:tt.color.quaternary,fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},e}(pn);function m1t(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 Q8r(e,a)&&(n[a]="auto"),n[a]!=null&&n[a]!=="auto"});qm(t,e,{type:"box",ignoreSize:i})}var QXr=function(t){nt(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 o=r.coordinateSystem,s=o.getRangeInfo(),l=o.getOrient(),u=n.getLocaleModel();this._renderDayRect(r,s,a),this._renderLines(r,s,l,a),this._renderYearText(r,s,l,a),this._renderMonthText(r,u,l,a),this._renderWeekText(r,u,s,l,a)},e.prototype._renderDayRect=function(r,n,i){for(var a=r.coordinateSystem,o=r.getModel("itemStyle").getItemStyle(),s=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 nn({shape:{x:h[0],y:h[1],width:s,height:l},cursor:"default",style:o});i.add(d)}},e.prototype._renderLines=function(r,n,i,a){var o=this,s=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=s.getDateInfo(n.start.y+"-"+n.start.m));var p=d.date;p.setMonth(p.getMonth()+1),d=s.getDateInfo(p)}g(s.getNextNDay(n.end.time,1).formatedDate);function g(m){o._firstDayOfMonth.push(s.getDateInfo(m)),o._firstDayPoints.push(s.dataToCalendarLayout([m],!1).tl);var v=o._getLinePointsOfOneWeek(r,m,i);o._tlpoints.push(v[0]),o._blpoints.push(v[v.length-1]),u&&o._drawSplitline(v,l,a)}u&&this._drawSplitline(o._getEdgesPoints(o._tlpoints,h,i),l,a),u&&this._drawSplitline(o._getEdgesPoints(o._blpoints,h,i),l,a)},e.prototype._getEdgesPoints=function(r,n,i){var a=[r[0].slice(),r[r.length-1].slice()],o=i==="horizontal"?0:1;return a[0][o]=a[0][o]-n/2,a[1][o]=a[1][o]+n/2,a},e.prototype._drawSplitline=function(r,n,i){var a=new Ll({z2:20,shape:{points:r},style:n});i.add(a)},e.prototype._getLinePointsOfOneWeek=function(r,n,i){for(var a=r.coordinateSystem,o=a.getDateInfo(n),s=[],l=0;l<7;l++){var u=a.getNextNDay(o.time,l),h=a.dataToCalendarLayout([u.time],!1);s[2*u.day]=h.tl,s[2*u.day+1]=h[i==="horizontal"?"bl":"tr"]}return s},e.prototype._formatterLabel=function(r,n){return $t(r)&&r?Cut(r,n):ur(r)?r(n):n.nameMap},e.prototype._yearTextPositionControl=function(r,n,i,a,o){var s=n[0],l=n[1],u=["center","bottom"];a==="bottom"?(l+=o,u=["center","top"]):a==="left"?s-=o:a==="right"?(s+=o,u=["center","top"]):l-=o;var h=0;return(a==="left"||a==="right")&&(h=Math.PI/2),{rotation:h,x:s,y:l,style:{align:u[0],verticalAlign:u[1]}}},e.prototype._renderYearText=function(r,n,i,a){var o=r.getModel("yearLabel");if(o.get("show")){var s=o.get("margin"),l=o.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=o.get("formatter"),v={start:n.start.y,end:n.end.y,nameMap:g},y=this._formatterLabel(m,v),b=new $n({z2:30,style:ji(o,{text:y}),silent:o.get("silent")});b.attr(this._yearTextPositionControl(b,p[l],i,l,s)),a.add(b)}},e.prototype._monthTextPositionControl=function(r,n,i,a,o){var s="left",l="top",u=r[0],h=r[1];return i==="horizontal"?(h=h+o,n&&(s="center"),a==="start"&&(l="bottom")):(u=u+o,n&&(l="middle"),a==="start"&&(s="right")),{x:u,y:h,align:s,verticalAlign:l}},e.prototype._renderMonthText=function(r,n,i,a){var o=r.getModel("monthLabel");if(o.get("show")){var s=o.get("nameMap"),l=o.get("margin"),u=o.get("position"),h=o.get("align"),d=[this._tlpoints,this._blpoints];(!s||$t(s))&&(s&&(n=Gpe(s)||n),s=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=o.get("silent"),v=0;v=a.start.time&&i.times.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/yye)-Math.floor(r[0].time/yye)+1,a=new Date(r[0].time),o=a.getDate(),s=r[1].date.getDate();a.setDate(o+i-1);var l=a.getDate();if(l!==s)for(var u=a.getTime()-r[1].time>0?1:-1;(l=a.getDate())!==s&&(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,o=new Date(i.start.time);return o.setDate(+i.start.d+a),this.getDateInfo(o)},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){L8({targetModel:a,coordSysType:"calendar",coordSysProvider:Lut})}),n},t.dimensions=["time","value"],t}();function bye(t){var e=t.calendarModel,r=t.seriesModel,n=e?e.coordinateSystem:r?r.coordinateSystem:null;return n}function HXr(t){t.registerComponentModel(VXr),t.registerComponentView(QXr),t.registerCoordinateSystem("calendar",GXr)}var Hy={level:1,leaf:2,nonLeaf:3},Wy={none:0,all:1,body:2,corner:3};function xye(t,e,r){var n=e[Mr[r]].getCell(t);return!n&&Vn(t)&&t<0&&(n=e[Mr[1-r]].getUnitLayoutInfo(r,Math.round(t))),n}function v1t(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 y1t(t,e,r,n,i){b1t(t[0],e,i,r,n,0),b1t(t[1],e,i,r,n,1)}function b1t(t,e,r,n,i,a){t[0]=1/0,t[1]=-1/0;var o=n[a],s=ft(o)?o:[o],l=s.length,u=!!r;if(l>=1?(x1t(t,e,s,u,i,a,0),l>1&&x1t(t,e,s,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===Wy.body?h=rn(0,h):r===Wy.corner&&(d=Oi(-1,d)),d=e[0]&&t[0]<=e[1]}function S1t(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 qXr(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 T1t(t,e,r,n){var i=xye(e[n][0],r,n),a=xye(e[n][1],r,n);t[Mr[n]]=t[_o[n]]=NaN,i&&a&&(t[Mr[n]]=i.xy,t[_o[n]]=a.xy+a.wh-i.xy)}function qB(t,e,r,n){return t[Mr[e]]=r,t[Mr[1-e]]=n,t}function jXr(t){return t&&(t.type===Hy.leaf||t.type===Hy.nonLeaf)?t:null}function Hq(){return{x:NaN,y:NaN,width:NaN,height:NaN}}var C1t=function(){function t(e,r){this._cells=[],this._levels=[],this.dim=e,this.dimIdx=e==="x"?0:1,this._model=r,this._uniqueValueGen=XXr(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 Nx;for(o.resetLayoutIterator(A,n);A.next();)S(A.item);for(a.resetLayoutIterator(A,n);A.next();)S(A.item);function S(T){cc(T.wh)&&(T.wh=y),T.xy=x,T.id[Mr[n]]===w&&!b&&(T.wh=r[Mr[n]]+r[_o[n]]-T.xy),x+=T.wh}}function M1t(t,e){for(var r=e[Mr[t]].resetCellIterator();r.next();){var n=r.item;Xq(n.rect,t,n.id,n.span,e),Xq(n.rect,1-t,n.id,n.span,e),n.type===Hy.nonLeaf&&(n.xy=n.rect[Mr[t]],n.wh=n.rect[_o[t]])}}function I1t(t,e){t.travelExistingCells(function(r){var n=r.span;if(n){var i=r.spanRect,a=r.id;Xq(i,0,a,n,e),Xq(i,1,a,n,e)}})}function Xq(t,e,r,n,i){t[_o[e]]=0;var a=r[Mr[e]],o=a<0?i[Mr[1-e]]:i[Mr[e]],s=o.getUnitLayoutInfo(e,r[Mr[e]]);if(t[Mr[e]]=s.xy,t[_o[e]]=s.wh,n[Mr[e]]>1){var l=o.getUnitLayoutInfo(e,r[Mr[e]]+n[Mr[e]]-1);t[_o[e]]=l.xy+l.wh-s.xy}}function cKr(t,e,r){var n=qH(t,r[_o[e]]);return Oye(n,r[_o[e]])}function Oye(t,e){return Math.max(Math.min(t,Jt(e,1/0)),0)}function kye(t){var e=t.matrixModel,r=t.seriesModel,n=e?e.coordinateSystem:r?r.coordinateSystem:null;return n}var vc={inBody:1,inCorner:2,outside:3},s0={x:null,y:null,point:[]};function P1t(t,e,r,n,i){var a=r[Mr[e]],o=r[Mr[1-e]],s=a.getUnitLayoutInfo(e,a.getLocatorCount(e)-1),l=a.getUnitLayoutInfo(e,0),u=o.getUnitLayoutInfo(e,-o.getLocatorCount(e)),h=o.shouldShow()?o.getUnitLayoutInfo(e,-1):null,d=t.point[e]=n[e];if(!l&&!h){t[Mr[e]]=vc.outside;return}if(i===Wy.body){l?(t[Mr[e]]=vc.inBody,d=Oi(s.xy+s.wh,rn(l.xy,d)),t.point[e]=d):t[Mr[e]]=vc.outside;return}else if(i===Wy.corner){h?(t[Mr[e]]=vc.inCorner,d=Oi(h.xy+h.wh,rn(u.xy,d)),t.point[e]=d):t[Mr[e]]=vc.outside;return}var f=l?l.xy:h?h.xy+h.wh:NaN,p=u?u.xy:f,g=s?s.xy+s.wh:f;if(dg){if(!i){t[Mr[e]]=vc.outside;return}d=g}t.point[e]=d,t[Mr[e]]=f<=d&&d<=g?vc.inBody:p<=d&&d<=f?vc.inCorner:vc.outside}function N1t(t,e,r,n){var i=1-r;if(t[Mr[r]]!==vc.outside)for(n[Mr[r]].resetCellIterator(Cye);Cye.next();){var a=Cye.item;if($1t(t.point[r],a.rect,r)&&$1t(t.point[i],a.rect,i)){e[r]=a.ordinal,e[i]=a.id[Mr[i]];return}}}function B1t(t,e,r,n){if(t[Mr[r]]!==vc.outside){var i=t[Mr[r]]===vc.inCorner?n[Mr[1-r]]:n[Mr[r]];for(i.resetLayoutIterator(jq,r);jq.next();)if(uKr(t.point[r],jq.item)){e[r]=jq.item.id[Mr[r]];return}}}function uKr(t,e){return e.xy<=t&&t<=e.xy+e.wh}function $1t(t,e,r){return e[Mr[r]]<=t&&t<=e[Mr[r]]+e[_o[r]]}function hKr(t){t.registerComponentModel(eKr),t.registerComponentView(aKr),t.registerCoordinateSystem("matrix",lKr)}function dKr(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 F1t(t,e){var r;return fe(e,function(n){t[n]!=null&&t[n]!=="auto"&&(r=!0)}),r}function fKr(t,e,r){var n=lt({},r),i=t[e],a=r.$action||"merge";a==="merge"?i?(Qr(i,n,!0),qm(i,n,{ignoreSize:!0}),But(r,i),Kq(r,i),Kq(r,i,"shape"),Kq(r,i,"style"),Kq(r,i,"extra"),r.clipPath=i.clipPath):t[e]=n:a==="replace"?t[e]=n:a==="remove"&&i&&(t[e]=null)}var z1t=["transition","enterFrom","leaveTo"],pKr=z1t.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function Kq(t,e,r){if(r&&(!t[r]&&e[r]&&(t[r]={}),t=t[r],e=e[r]),!(!t||!e))for(var n=r?z1t:pKr,i=0;i=0;h--){var d=i[h],f=Ds(d.id,null),p=f!=null?o.get(f):null;if(p){var g=p.parent,y=pp(g),b=g===a?{width:s,height:l}:{width:y.width,height:y.height},x={},w=UW(p,d,b,null,{hv:d.hv,boundingMode:d.bounding},x);if(!pp(p).isNew&&w){for(var A=d.transition,S={},T=0;T=0)?S[C]=k:p[C]=k}qn(p,S,r,0)}else p.attr(x)}}},e.prototype._clear=function(){var r=this,n=this._elMap;n.each(function(i){Zq(i,pp(i).option,n,r._lastGraphicModel)}),this._elMap=qt()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(Xi);function Eye(t){var e=Kt(U1t,t)?U1t[t]:T8(t),r=new e({});return pp(r).type=t,r}function V1t(t,e,r,n){var i=Eye(r);return e.add(i),n.set(t,i),pp(i).id=t,pp(i).isNew=!0,i}function Zq(t,e,r,n){var i=t&&t.parent;i&&(t.type==="group"&&t.traverse(function(a){Zq(a,e,r,n)}),Nq(t,e,n),r.removeKey(pp(t).id))}function Q1t(t,e,r,n){t.isGroup||fe([["cursor",tp.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])}),fe(En(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 yKr(t){return t=lt({},t),fe(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(Mut),function(e){delete t[e]}),t}function bKr(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 xKr(t){t.registerComponentModel(mKr),t.registerComponentView(vKr),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 G1t=["x","y","radius","angle","single"],wKr=Gr(),AKr=["cartesian2d","polar","singleAxis"];function SKr(t){var e=t.get("coordinateSystem");return Nr(AKr,e)>=0}function u2(t){return t+"Axis"}function TKr(t,e){var r=qt(),n=[],i=qt();t.eachComponent({mainType:"dataZoom",query:e},function(h){i.get(h.uid)||s(h)});var a;do a=!1,t.eachComponent("dataZoom",o);while(a);function o(h){!i.get(h.uid)&&l(h)&&(s(h),a=!0)}function s(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 H1t(t){var e=t.ecModel,r={infoList:[],infoMap:qt()};return t.eachTargetAxis(function(n,i){var a=e.getComponent(u2(n),i);if(a){var o=a.getCoordSysModel();if(o){var s=o.uid,l=r.infoMap.get(s);l||(l={model:o,axisModels:[]},r.infoList.push(l),r.infoMap.set(s,l)),l.axisModels.push(a)}}}),r}function W1t(t){var e=wKr(fdt(t));return e.axisProxyMap||(e.axisProxyMap=qt())}function Jq(t){if(t)return W1t(t.ecModel).get(t.uid)}function CKr(t,e){W1t(t.ecModel).set(t.uid,e)}function Y1t(t,e){var r=e.getAxisModel().axis.__alignTo;return r&&t.getAxisProxy(r.dim,r.model.componentIndex)?Jq(r.model):null}var _ye=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}(),XB=function(t){nt(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=q1t(r);this.settledOption=a,this.mergeDefaultAndTheme(r,i),this._doInit(a)},e.prototype.mergeOption=function(r){var n=q1t(r);Qr(this.option,r,!0),Qr(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;fe([["start","startValue"],["end","endValue"]],function(a,o){this._rangePropMode[o]==="value"&&(n[a[0]]=i[a[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var r=this.get("orient",!0),n=this._targetAxisInfoMap=qt(),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 fe(G1t,function(i){var a=this.getReferringComponents(u2(i),d6r);if(a.specified){n=!0;var o=new _ye;fe(a.models,function(s){o.add(s.componentIndex)}),r.set(i,o)}},this),n},e.prototype._fillAutoTargetAxisByOrient=function(r,n){var i=this.ecModel,a=!0;if(a){var o=n==="vertical"?"y":"x",s=i.findComponents({mainType:o+"Axis"});l(s,o)}if(a){var s=i.findComponents({mainType:"singleAxis",filter:function(h){return h.get("orient",!0)===n}});l(s,"single")}function l(u,h){var d=u[0];if(d){var f=new _ye;if(f.add(d.componentIndex),r.set(h,f),a=!1,h==="x"||h==="y"){var p=d.getReferringComponents("grid",xo).models[0];p&&fe(u,function(g){d.componentIndex!==g.componentIndex&&p===g.getReferringComponents("grid",xo).models[0]&&f.add(g.componentIndex)})}}}a&&fe(G1t,function(u){if(a){var h=i.findComponents({mainType:u2(u),filter:function(f){return f.get("type",!0)==="category"}});if(h[0]){var d=new _ye;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");fe([["start","startValue"],["end","endValue"]],function(a,o){var s=r[a[0]]!=null,l=r[a[1]]!=null;s&&!l?n[o]="percent":!s&&l?n[o]="value":i?n[o]=i[o]:s&&(n[o]="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(u2(n),i))},this),r},e.prototype.eachTargetAxis=function(r,n){this._targetAxisInfoMap.each(function(i,a){fe(i.indexList,function(o){r.call(n,a,o)})})},e.prototype.getAxisProxy=function(r,n){return Jq(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(u2(r),n)},e.prototype.setRawRange=function(r){var n=this.option,i=this.settledOption;fe([["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;fe(["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 Jq(r);for(var n,i=this._targetAxisInfoMap.keys(),a=0;ao[1];if(x&&!w&&!A)return!0;x&&(v=!0),w&&(g=!0),A&&(m=!0)}return v&&g&&m})}else fe(h,function(p){if(a==="empty")l.setData(u=u.map(p,function(m){return s(m)?m:NaN}));else{var g={};g[p]=o,u.selectRange(g)}});fe(h,function(p){u.setApproximateExtent(o,p)})}});function s(l){return l>=o[0]&&l<=o[1]}},t.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},r=this._dataZoomModel,n=this._extent;fe(["min","max"],function(i){var a=r.get(i+"Span"),o=r.get(i+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?a=Zn(n[0]+o,n,[0,100],!0):a!=null&&(o=Zn(a,[0,100],n,!0)-n[0]),e[i+"Span"]=a,e[i+"ValueSpan"]=o},this)},t}(),_Kr={dirtyOnOverallProgress:!0,getTargetSeries:function(t){function e(i){t.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=t.getComponent(u2(o),s);i(o,s,l,a)})})}var r=[];e(function(i,a,o,s){if(!Jq(o)){var l=new EKr(i,a,s,t);r.push(l),CKr(o,l)}});var n=qt();return fe(r,function(i){fe(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 o=r.getAxisProxy(i,a),s=Y1t(r,o);s?n.push([o,s]):o.reset(r,null)}),fe(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,o=i.value;r.setCalculatedRange({start:a[0],end:a[1],startValue:o[0],endValue:o[1]})}})}};function RKr(t){t.registerAction("dataZoom",function(e,r){var n=TKr(r,e);fe(n,function(i){i.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var DKr=P_();function Dye(t){DKr(t,function(){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,_Kr),RKr(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"})})}function LKr(t){t.registerComponentModel(OKr),t.registerComponentView(kKr),Dye(t)}var l0=function(){function t(){}return t}(),j1t={};function W5(t,e){j1t[t]=e}function X1t(t){return j1t[t]}var MKr=function(t){nt(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"),o=a?a.feature:null;o&&(this._themeFeatureOption=lt({},o),a.feature={}),t.prototype.init.call(this,r,n,i),o&&(a.feature=o)},e.prototype.optionUpdated=function(){fe(this.option.feature,function(r,n){var i=this._themeFeatureOption,a=X1t(n);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(this.ecModel)),i&&i[n]&&(Qr(r,i[n]),i[n]=null),Qr(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:tt.color.border,borderRadius:0,borderWidth:0,padding:tt.size.m,itemSize:15,itemGap:tt.size.s,showTitle:!0,iconStyle:{borderColor:tt.color.accent50,color:"none"},emphasis:{iconStyle:{borderColor:tt.color.accent70}},tooltip:{show:!1,position:"bottom"}},e}(pn);function K1t(t,e){var r=t5(e.get("padding")),n=e.getItemStyle(["color","opacity"]);n.fill=e.get("backgroundColor");var i=new nn({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 IKr=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(r,n,i,a){var o=this.group;if(o.removeAll(),!r.get("show"))return;var s=+r.get("itemSize"),l=r.get("orient")==="vertical",u=r.get("feature")||{},h=this._features||(this._features=qt()),d=[];fe(u,function(b,x){d.push(x)}),new Py(this._featureNames||[],d).add(f).update(f).remove(Kr(f,null)).execute(),this._featureNames=oi(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],C=u[T],k=w||A?new bn(C,r,n):null,E=k&&k.get("show"),_;if(w){if(!E)return;if(PKr(T))_={onclick:k.option.onclick,featureName:T};else{var P=X1t(T);if(!P)return;_=new P}h.set(T,_)}else _=h.get(T);if(S||!E){Z1t(_)&&_.dispose&&_.dispose(n,i),h.removeKey(T);return}a&&a.newTitle!=null&&a.featureName===T&&(C.title=a.newTitle),w&&(_.uid=DS("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"?_y:Ry)(M[L])},Z1t(_)&&_.render&&_.render(k,n,i,a)}function p(b,x,w){var A=b.getModel("iconStyle"),S=b.getModel(["emphasis","iconStyle"]),T=x instanceof l0&&x.getIcons?x.getIcons():b.get("icon"),C=b.get("title")||{},k,E;$t(T)?(k={},k[w]=T):k=T,$t(C)?(E={},E[w]=C):E=C;var _=b.iconPaths={};fe(k,function(P,L){var R=X_(P,{},{x:-s/2,y:-s/2,width:s,height:s});R.setStyle(A.getItemStyle());var D=R.ensureState("emphasis");D.style=S.getItemStyle();var M=new $n({style:{text:E[L],align:S.get("textAlign"),borderRadius:S.get("textBorderRadius"),padding:S.get("textPadding"),fill:null,font:$pe({fontStyle:S.get("textFontStyle"),fontFamily:S.get("textFontFamily"),fontSize:S.get("textFontSize"),fontWeight:S.get("textFontWeight")},n)},ignore:!0});R.setTextContent(M),Ly({el:R,componentModel:r,itemName:L,formatterParamsExtra:{title:E[L]}}),R.__title=E[L],R.on("mouseover",function(){var I=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")||I.fill||I.stroke||tt.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"?_y:Ry)(R),o.add(R),R.on("click",Wt(x.onclick,x,n,i,L)),_[L]=R})}var g=Ps(r,i).refContainer,m=r.getBoxLayoutParams(),v=r.get("padding"),y=ba(m,g,v);IS(r.get("orient"),o,r.get("itemGap"),y.width,y.height),UW(o,m,g,v),o.add(K1t(o.getBoundingRect(),r)),l||o.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 C=T.style||(T.style={}),k=FH(x,$n.makeFont(C)),E=b.x+o.x,_=b.y+o.y+s,P=!1;_+k.height>i.getHeight()&&(A.position="top",P=!0);var L=P?-5-k.height:s+10;E+k.width/2>i.getWidth()?(A.position=["100%",L],C.align="right"):E-k.width/2<0&&(A.position=[0,L],C.align="left")}})},e.prototype.updateView=function(r,n,i,a){fe(this._features,function(o){o&&o instanceof l0&&o.updateView&&o.updateView(o.model,n,i,a)})},e.prototype.dispose=function(r,n){fe(this._features,function(i){i&&i instanceof l0&&i.dispose&&i.dispose(r,n)})},e.type="toolbox",e}(Xi);function PKr(t){return t.indexOf("my")===0}function Z1t(t){return t instanceof l0}var NKr=function(t){nt(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",o=n.getZr().painter.getType()==="svg",s=o?"svg":i.get("type",!0)||"png",l=n.getConnectedDataURL({type:s,backgroundColor:i.get("backgroundColor",!0)||r.get("backgroundColor")||tt.color.neutral00,connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")}),u=Dn.browser;if(typeof MouseEvent=="function"&&(u.newEdge||!u.ie&&!u.edge)){var h=document.createElement("a");h.download=a+"."+s,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||o){var f=l.split(","),p=f[0].indexOf("base64")>-1,g=o?decodeURIComponent(f[1]):f[1];p&&(g=window.atob(g));var m=a+"."+s;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='',C=window.open();C.document.write(T),C.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:tt.color.neutral00,name:"",excludeComponents:["toolbox"],lang:r.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return n},e}(l0),J1t="__ec_magicType_stack__",BKr=[["line","bar"],["stack"]],$Kr=function(t){nt(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 fe(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,o=a.get(["seriesIndex",i]);if(ebt[i]){var s={series:[]},l=function(d){var f=d.subType,p=d.id,g=ebt[i](f,p,d,a);g&&(mr(g,d.option),s.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,xo).models[0],w=x.componentIndex;s[b]=s[b]||[];for(var A=0;A<=w;A++)s[b][w]=s[b][w]||{};s[b][w].boundaryGap=i==="bar"}}};fe(BKr,function(d){Nr(d,i)>=0&&fe(d,function(f){a.setIconStatus(f,"normal")})}),a.setIconStatus(i,"emphasis"),r.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var u,h=i;i==="stack"&&(u=Qr({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:s,newTitle:u,featureName:"magicType"})}},e}(l0),ebt={line:function(t,e,r,n){if(t==="bar")return Qr({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 Qr({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")===J1t;if(t==="line"||t==="bar")return n.setIconStatus("stack",i?"normal":"emphasis"),Qr({id:e,stack:i?"":J1t},n.get(["option","stack"])||{},!0)}};gg({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)});var ej=new Array(60).join("-"),Y5=" ";function FKr(t){var e={},r=[],n=[];return t.eachRawSeries(function(i){var a=i.coordinateSystem;if(a&&(a.type==="cartesian2d"||a.type==="polar")){var o=a.getBaseAxis();if(o.type==="category"){var s=wUr(o);e[s]||(e[s]={categoryAxis:o,valueAxis:a.getOtherAxis(o),series:[]},n.push({axisDim:o.dim,axisIndex:o.index})),e[s].series.push(i)}else r.push(i)}else r.push(i)}),{seriesGroupByCategoryAxis:e,other:r,meta:n}}function zKr(t){var e=[];return fe(t,function(r,n){var i=r.categoryAxis,a=r.valueAxis,o=a.dim,s=[" "].concat(vt(r.series,function(p){return p.name})),l=[i.model.getCategories()];fe(r.series,function(p){var g=p.getRawData();l.push(p.getRawData().mapArray(g.mapDimension(o),function(m){return m}))});for(var u=[s.join(Y5)],h=0;h1||r>0&&!t.noHeader;return fe(t.blocks,function(i){var a=$ht(i);a>=e&&(e=a+ +(n&&(!a||Sge(i)&&!i.noHeader)))}),e}return 0}function qBr(t,e,r,n){var i=e.noHeader,a=XBr($ht(e)),o=[],s=e.blocks||[];uc(!s||ft(s)),s=s||[];var l=t.orderMode;if(e.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(Kt(u,l)){var h=new Tht(u[l],null);s.sort(function(m,v){return h.evaluate(m.sortParam,v.sortParam)})}else l==="seriesDesc"&&s.reverse()}fe(s,function(m,v){var y=e.valueFormatter,b=Bht(m)(y?lt(lt({},t),{valueFormatter:y}):t,m,v>0?a.html:0,n);b!=null&&o.push(b)});var d=t.renderMode==="richText"?o.join(a.richText):Tge(n,o.join(""),i?r:a.html);if(i)return d;var f=rge(e.header,"ordinal",t.useUTC),p=Nht(n,t.renderMode).nameStyle,g=Pht(n);return t.renderMode==="richText"?zht(t,f,p)+a.richText+d:Tge(n,'
'+Hc(f)+"
"+d,r)}function jBr(t,e,r,n){var i=t.renderMode,a=e.noName,o=e.noValue,s=!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 rge(A,ft(p)?p[S]:p,u)})};if(!(a&&o)){var d=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||tt.color.secondary,i),f=a?"":rge(l,"ordinal",u),p=e.valueType,g=o?[]:h(e.value,e.rawDataIndex),m=!s||!a,v=!s&&a,y=Nht(n,i),b=y.nameStyle,x=y.valueStyle;return i==="richText"?(s?"":d)+(a?"":zht(t,f,b))+(o?"":JBr(t,g,m,v,x)):Tge(n,(s?"":d)+(a?"":KBr(f,!s,b))+(o?"":ZBr(g,m,v,x)),r)}}function Fht(t,e,r,n,i,a){if(t){var o=Bht(t),s={useUTC:i,renderMode:r,orderMode:n,markupStyleCreator:e,valueFormatter:t.valueFormatter};return o(s,t,0,a)}}function XBr(t){return{html:WBr[t],richText:YBr[t]}}function Tge(t,e,r){var n='
',i="margin: "+r+"px 0 0",a=Pht(t);return'
'+e+n+"
"}function KBr(t,e,r){var n=e?"margin-left:2px":"";return''+Hc(t)+""}function ZBr(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(o){return Hc(o)}).join("  ")+""}function zht(t,e,r){return t.markupStyleCreator.wrapRichTextStyle(e,r)}function JBr(t,e,r,n,i){var a=[i],o=n?10:20;return r&&a.push({padding:[0,0,0,o],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(ft(e)?e.join(" "):e,a)}function Uht(t,e){var r=t.getData().getItemVisual(e,"style"),n=r[t.visualDrawType];return LS(n)}function Vht(t,e){var r=t.get("padding");return r??(e==="richText"?[8,10]:10)}var Cge=function(){function t(){this.richTextStyles={},this._nextStyleNameId=Pfe()}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=Eut({color:r,type:e,renderMode:n,markerId:i});return $t(a)?a:(this.richTextStyles[i]=a.style,a.content)},t.prototype.wrapRichTextStyle=function(e,r){var n={};ft(r)?fe(r,function(a){return lt(n,a)}):lt(n,r);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+e+"}"},t}();function Qht(t){var e=t.series,r=t.dataIndex,n=t.multipleSeries,i=e.getData(),a=i.mapDimensionsAll("defaultedTooltip"),o=a.length,s=e.getRawValue(r),l=ft(s),u=Uht(e,r),h,d,f,p;if(o>1||l&&!o){var g=e7r(s,e,r,a,u);h=g.inlineValues,d=g.inlineValueTypes,f=g.blocks,p=g.inlineValues[0]}else if(o){var m=i.getDimensionInfo(a[0]);p=h=a5(i,r,a[0]),d=m.type}else p=h=l?s[0]:s;var v=Nfe(e),y=v&&e.name||"",b=i.getName(r),x=n?y:b;return fs("section",{header:y,noHeader:n||!v,sortParam:p,blocks:[fs("nameValue",{markerType:"item",markerColor:u,name:x,noName:!Nd(x),value:h,valueType:d,rawDataIndex:i.getRawIndex(r)})].concat(f||[])})}function e7r(t,e,r,n,i){var a=e.getData(),o=Yf(t,function(d,f,p){var g=a.getDimensionInfo(p);return d=d||g&&g.tooltip!==!1&&g.displayName!=null},!1),s=[],l=[],u=[];n.length?fe(n,function(d){h(a5(a,r,d),d)}):fe(t,h);function h(d,f){var p=a.getDimensionInfo(f);!p||p.otherDims.tooltip===!1||(o?u.push(fs("nameValue",{markerType:"subItem",markerColor:i,name:p.displayName,value:d,valueType:p.type})):(s.push(d),l.push(p.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var Yx=Gr();function YW(t,e){return t.getName(e)||t.getId(e)}var qW="__universalTransitionEnabled",Ii=function(t){nt(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=F8({count:r7r,reset:n7r}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,i);var a=Yx(this).sourceManager=new Lht(this);a.prepareSource();var o=this.getInitialData(r,i);Hht(o,this),this.dataTask.context.data=o,Yx(this).dataBeforeProcessed=o,Ght(this),this._initSelectedMapFromData(o)},e.prototype.mergeDefaultAndTheme=function(r,n){var i=I8(this),a=i?PS(r):{},o=this.subType;pn.hasClass(o)&&(o+="Series"),Qr(r,n.getTheme().get(this.subType)),Qr(r,this.getDefaultOption()),sS(r,"label",["show"]),this.fillDataTextStyle(r.data),i&&qm(r,a,i)},e.prototype.mergeOption=function(r,n){r=Qr(this.option,r,!0),this.fillDataTextStyle(r.data);var i=I8(this);i&&qm(this.option,r,i);var a=Yx(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(r,n);Hht(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,Yx(this).dataBeforeProcessed=o,Ght(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(r){if(r&&!Ru(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 Qht({series:this,dataIndex:r,multipleSeries:n})},e.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(Dn.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,o=uge.prototype.getColorFromPalette.call(this,r,n,i);return o||(o=a.getColorFromPalette(r,n,i)),o},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,o=this.getData(n);if(a==="series"||i==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s=0&&i.push(o)}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[YW(a,r)])&&!a.getItemModel(r).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[qW])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,o=this.option,s=o.selectedMode,l=n.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){yr(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,h=0;h0&&this._innerSelect(r,n)}},e.registerClass=function(r){return pn.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}(pn);Qo(Ii,HW),Qo(Ii,uge),Llt(Ii,pn);function Ght(t){var e=t.name;Nfe(t)||(t.name=t7r(t)||e)}function t7r(t){var e=t.getRawData(),r=e.mapDimensionsAll("seriesName"),n=[];return fe(r,function(i){var a=e.getDimensionInfo(i);a.displayName&&n.push(a.displayName)}),n.join(" ")}function r7r(t){return t.model.getRawData().count()}function n7r(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),i7r}function i7r(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Hht(t,e){fe(b_(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(r){t.wrapMethod(r,Kr(a7r,e))})}function a7r(t,e){var r=Oge(t);return r&&r.setOutputEnd((e||this).count()),e}function Oge(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 Xi=function(){function t(){this.group=new gr,this.uid=DS("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}();Vfe(Xi),eW(Xi);function US(){var t=Gr();return function(e){var r=t(e),n=e.pipelineContext,i=!!r.large,a=!!r.progressiveRender,o=r.large=!!(n&&n.large),s=r.progressiveRender=!!(n&&n.progressiveRender);return(i!==o||a!==s)&&"reset"}}var Wht=Gr(),o7r=US(),ki=function(){function t(){this.group=new gr,this.uid=DS("viewChart"),this.renderTask=F8({plan:s7r,reset:l7r}),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&&qht(a,i,"emphasis")},t.prototype.downplay=function(e,r,n,i){var a=e.getData(i&&i.dataType);a&&qht(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){Gx(this.group,e)},t.markUpdateMethod=function(e,r){Wht(e).updateMethod=r},t.protoInitialize=function(){var e=t.prototype;e.type="chart"}(),t}();function Yht(t,e,r){t&&v8(t)&&(e==="emphasis"?_y:Ry)(t,r)}function qht(t,e,r){var n=lS(t,e),i=e&&e.highlightKey!=null?MNr(e.highlightKey):null;n!=null?fe(qi(n),function(a){Yht(t.getItemGraphicEl(a),r,i)}):t.eachItemGraphicEl(function(a){Yht(a,r,i)})}Vfe(ki),eW(ki);function s7r(t){return o7r(t.model)}function l7r(t){var e=t.model,r=t.ecModel,n=t.api,i=t.payload,a=e.pipelineContext.progressiveRender,o=t.view,s=i&&Wht(i).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](e,r,n,i),c7r[l]}var c7r={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)}}},jW="\0__throttleOriginMethod",jht="\0__throttleRate",Xht="\0__throttleType";function XW(t,e,r){var n,i=0,a=0,o=null,s,l,u,h;e=e||0;function d(){a=new Date().getTime(),o=null,t.apply(l,u||[])}var f=function(){for(var p=[],g=0;g=0?d():o=setTimeout(d,-s),i=n};return f.clear=function(){o&&(clearTimeout(o),o=null)},f.debounceNextCall=function(p){h=p},f}function s5(t,e,r,n){var i=t[e];if(i){var a=i[jW]||i,o=i[Xht],s=i[jht];if(s!==r||o!==n){if(r==null||!n)return t[e]=a;i=t[e]=XW(a,r,n==="debounce"),i[jW]=a,i[Xht]=n,i[jht]=r}return i}}function z8(t,e){var r=t[e];r&&r[jW]&&(r.clear&&r.clear(),t[e]=r[jW])}var Kht=Gr(),Zht={itemStyle:hS(put,!0),lineStyle:hS(fut,!0)},u7r={lineStyle:"stroke",itemStyle:"fill"};function Jht(t,e){var r=t.visualStyleMapper||Zht[e];return r||(console.warn("Unknown style type '"+e+"'."),Zht.itemStyle)}function edt(t,e){var r=t.visualDrawType||u7r[e];return r||(console.warn("Unknown style type '"+e+"'."),"fill")}var h7r={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",i=t.getModel(n),a=Jht(t,n),o=a(i),s=i.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=edt(t,n),u=o[l],h=ur(u)?u:null,d=o.fill==="auto"||o.stroke==="auto";if(!o[l]||h||d){var f=t.getColorFromPalette(t.name,null,e.getSeriesCount());o[l]||(o[l]=f,r.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||ur(o.fill)?f:o.fill,o.stroke=o.stroke==="auto"||ur(o.stroke)?f:o.stroke}if(r.setVisual("style",o),r.setVisual("drawType",l),!e.isSeriesFiltered(t)&&h)return r.setVisual("colorFromPalette",!1),{dataEach:function(p,g){var m=t.getDataParams(g),v=lt({},o);v[l]=h(m),p.setItemVisual(g,"style",v)}}}},U8=new bn,d7r={createOnAllSeries:!0,reset:function(t,e){if(!t.ignoreStyleOnData){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",i=Jht(t,n),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){U8.option=l[n];var u=i(U8),h=o.ensureUniqueItemVisual(s,"style");lt(h,u),U8.option.decal&&(o.setItemVisual(s,"decal",U8.option.decal),U8.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},f7r={performRawSeries:!0,overallReset:function(t){var e=qt();t.eachSeries(function(r){if(!r.isColorBySeries()){var n=r.type+"-"+r.getColorBy();Kht(r).scope=e.get(n)||e.set(n,{})}}),t.eachSeries(function(r){if(!r.isColorBySeries()){var n=r.getRawData(),i={},a=r.getData(),o=Kht(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=edt(r,s);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,o,g)}})}})}},KW=Math.PI;function p7r(t,e){e=e||{},mr(e,{text:"loading",textColor:tt.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:tt.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var r=new gr,n=new nn({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});r.add(n);var i=new $n({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 nn({style:{fill:"none"},textContent:i,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});r.add(a);var o;return e.showSpinner&&(o=new A8({shape:{startAngle:-KW/2,endAngle:-KW/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:KW*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:KW*3/2}).delay(300).start("circularInOut"),r.add(o)),r.resize=function(){var s=i.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,u=(t.getWidth()-l*2-(e.showSpinner&&s?10:0)-s)/2-(e.showSpinner&&s?0:5+s/2)+(e.showSpinner?0:s/2)+(s?0:l),h=t.getHeight()/2;e.showSpinner&&o.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 tdt=function(){function t(e,r,n,i){this._stageTaskMap=qt(),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,o=a?n.step:null,s=i&&i.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},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):Rlt(e,r,n);e.pipelineContext=n.context=i},t.prototype.restorePipelines=function(e,r){var n=this,i=n._pipelineMap=qt();r.eachSeries(function(a){var o=e.painter.type==="canvas"&&a.getProgressive(),s=a.uid;i.set(s,{id:s,head:null,tail:null,threshold:a.getProgressiveThreshold(),progressiveEnabled:o&&!(a.preventIncremental&&a.preventIncremental()),blockIndex:-1,step:Math.round(o||700),count:0}),n._pipe(a,a.dataTask)})},t.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,r=this.api.getModel(),n=this.api;fe(this._allHandlers,function(i){var a=e.get(i.uid)||e.set(i.uid,{}),o="";uc(!(i.reset&&i.overallReset),o),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,o=a.context;o.model=r,o.ecModel=n,o.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,o=this;fe(e,function(l,u){if(!(i.visualType&&i.visualType!==l.visualType)){var h=o._stageTaskMap.get(l.uid),d=h.seriesTaskMap,f=h.overallTask;if(f){var p,g=f.agentStubMap;g.each(function(v){s(i,v)&&(v.dirty(),p=!0)}),p&&f.dirty(),o.updatePayload(f,n);var m=o.getPerformArgs(f,i.block);g.each(function(v){v.perform(m)}),f.perform(m)&&(a=!0)}else d&&d.each(function(v,y){s(i,v)&&v.dirty();var b=o.getPerformArgs(v,i.block);b.skip=!l.performRawSeries&&r.isSeriesFiltered(v.context.model),o.updatePayload(v,n),v.perform(b)&&(a=!0)})}});function s(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,o=r.seriesTaskMap,s=r.seriesTaskMap=qt(),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=s.set(f,o&&o.get(f)||F8({plan:b7r,reset:x7r,count:A7r}));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,o=r.overallTask=r.overallTask||F8({reset:g7r});o.context={ecModel:n,api:i,overallReset:e.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=qt(),u=e.seriesType,h=e.getTargetSeries,d=e.dirtyOnOverallProgress,f=!1,p="";uc(!e.createOnAllSeries,p),u?n.eachRawSeriesByType(u,g):h?h(n,i).each(g):fe(n.getSeries(),g);function g(m){var v=m.uid,y=l.set(v,s&&s.get(v)||(f=!0,F8({reset:m7r,onDirty:y7r})));y.context={model:m,dirtyOnOverallProgress:d},y.agent=o,y.__block=d,a._pipe(m,y)}f&&o.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:S7r(e)}),e.uid=DS("stageHandler"),r&&(e.visualType=r),e},t}();function g7r(t){t.overallReset(t.ecModel,t.api,t.payload)}function m7r(t){return t.dirtyOnOverallProgress&&v7r}function v7r(){this.agent.dirty(),this.getDownstream().dirty()}function y7r(){this.agent&&this.agent.dirty()}function b7r(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function x7r(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 rdt(n)}):w7r}var w7r=rdt(0);function rdt(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)}}s.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,o=n.model,s=n.view;if(!o||!s)return!0;var l=r.cptQuery,u=r.dataQuery;return h(l,o,"mainType")&&h(l,o,"subType")&&h(l,o,"index","componentIndex")&&h(l,o,"name")&&h(l,o,"id")&&h(u,a,"name")&&h(u,a,"dataIndex")&&h(u,a,"dataType")&&(!s.filterForExposedEvent||s.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}(),kge=["symbol","symbolSize","symbolRotate","symbolOffset"],ldt=kge.concat(["symbolKeepAspect"]),C7r={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,o=0;o=0&&GS(l)?l:.5;var u=t.createRadialGradient(o,s,0,o,s,l);return u}function _ge(t,e,r){for(var n=e.type==="radial"?G7r(t,e,r):Q7r(t,e,r),i=e.colorStops,a=0;a0)?null:t==="dashed"?[4*e,2*e]:t==="dotted"?[e]:Vn(t)?[t]:ft(t)?t:null}function Rge(t){var e=t.style,r=e.lineDash&&e.lineWidth>0&&W7r(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 Y7r=new Qm(!0);function rY(t){var e=t.stroke;return!(e==null||e==="none"||!(t.lineWidth>0))}function mdt(t){return typeof t=="string"&&t!=="none"}function nY(t){var e=t.fill;return e!=null&&e!=="none"}function vdt(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 ydt(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 Dge(t,e,r){var n=Gfe(e.image,e.__image,r);if(tW(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)*VN),a.scaleSelf(e.scaleX||1,e.scaleY||1),i.setTransform(a)}return i}}function q7r(t,e,r,n,i){var a,o=rY(r),s=nY(r),l=r.strokePercent,u=l<1,h=!e.path;(!e.silent||u)&&h&&e.createPathProxy();var d=e.path||Y7r,f=e.__dirty;if(!n){var p=r.fill,g=r.stroke,m=s&&!!p.colorStops,v=o&&!!g.colorStops,y=s&&!!p.image,b=o&&!!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?_ge(t,p,T):e.__canvasFillGradient,e.__canvasFillGradient=x),v&&(w=f?_ge(t,g,T):e.__canvasStrokeGradient,e.__canvasStrokeGradient=w),y&&(A=f||!e.__canvasFillPattern?Dge(t,p,e):e.__canvasFillPattern,e.__canvasFillPattern=A),b&&(S=f||!e.__canvasStrokePattern?Dge(t,g,e):e.__canvasStrokePattern,e.__canvasStrokePattern=S),m?t.fillStyle=x:y&&(A?t.fillStyle=A:s=!1),v?t.strokeStyle=w:b&&(S?t.strokeStyle=S:o=!1)}var C=e.getGlobalScale();d.setScale(C[0],C[1],e.segmentIgnoreThreshold);var k,E;t.setLineDash&&r.lineDash&&(a=Rge(e),k=a[0],E=a[1]);var _=!0;(h||f&S_)&&(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=s,i.batchStroke=o):r.strokeFirst?(o&&ydt(t,r),s&&vdt(t,r)):(s&&vdt(t,r),o&&ydt(t,r)),k&&t.setLineDash([])}function j7r(t,e,r){var n=e.__image=Gfe(r.image,e.__image,e,e.onload);if(!(!n||!tW(n))){var i=r.x||0,a=r.y||0,o=e.getWidth(),s=e.getHeight(),l=n.width/n.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=n.width,s=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,o,s)}else if(r.sx&&r.sy){var u=r.sx,h=r.sy,d=o-u,f=s-h;t.drawImage(n,u,h,d,f,i,a,o,s)}else t.drawImage(n,i,a,o,s)}}function X7r(t,e,r){var n,i=r.text;if(i!=null&&(i+=""),i){t.font=r.font||fy,t.textAlign=r.textAlign,t.textBaseline=r.textBaseline;var a=void 0,o=void 0;t.setLineDash&&r.lineDash&&(n=Rge(e),a=n[0],o=n[1]),a&&(t.setLineDash(a),t.lineDashOffset=o),r.strokeFirst?(rY(r)&&t.strokeText(i,r.x,r.y),nY(r)&&t.fillText(i,r.x,r.y)):(nY(r)&&t.fillText(i,r.x,r.y),rY(r)&&t.strokeText(i,r.x,r.y)),a&&t.setLineDash([])}}var bdt=["shadowBlur","shadowOffsetX","shadowOffsetY"],xdt=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function wdt(t,e,r,n,i){var a=!1;if(!n&&(r=r||{},e===r))return!1;if(n||e.opacity!==r.opacity){Iu(t,i),a=!0;var o=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(o)?dS.opacity:o}(n||e.blend!==r.blend)&&(a||(Iu(t,i),a=!0),t.globalCompositeOperation=e.blend||dS.blend);for(var s=0;s0&&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[Ns]){if(this._disposed){this.id;return}var a,o,s;if(yr(n)&&(i=n.lazyUpdate,a=n.silent,o=n.replaceMerge,s=n.transition,n=n.notMerge),this[Ns]=!0,m5(this),!this._model||n){var l=new oBr(this._api),u=this._theme,h=this._model=new dge;h.scheduler=this._scheduler,h.ssr=this._ssr,h.init(null,null,null,u,this._locale,l)}this._model.setOption(r,{replaceMerge:o},Hge);var d={seriesTransition:s,optionChanged:!0};if(i)this[Il]={silent:a,updateParams:d},this[Ns]=!1,this.getZr().wakeUp();else{try{WS(this),Iy.update.call(this,null,d)}catch(f){throw this[Il]=null,this[Ns]=!1,f}this._ssr||this._zr.flush(),this[Il]=null,this[Ns]=!1,p5.call(this,a),g5.call(this,a)}}},e.prototype.setTheme=function(r,n){if(!this[Ns]){if(this._disposed){this.id;return}var i=this._model;if(i){var a=n&&n.silent,o=null;this[Il]&&(a==null&&(a=this[Il].silent),o=this[Il].updateParams,this[Il]=null),this[Ns]=!0,m5(this);try{this._updateTheme(r),i.setTheme(this._theme),WS(this),Iy.update.call(this,{type:"setTheme"},o)}catch(s){throw this[Ns]=!1,s}this[Ns]=!1,p5.call(this,a),g5.call(this,a)}}},e.prototype._updateTheme=function(r){$t(r)&&(r=Kdt[r]),r&&(r=lr(r),r&&sht(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||Dn.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 fe(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=[],o=this;fe(n,function(l){i.eachComponent({mainType:l},function(u){var h=o._componentsMap[u.__viewId];h.group.ignore||(a.push(h),h.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(r).toDataURL("image/"+(r&&r.type||"png"));return fe(a,function(l){l.group.ignore=!1}),s},e.prototype.getConnectedDataURL=function(r){if(this._disposed){this.id;return}var n=r.type==="svg",i=this.group,a=Math.min,o=Math.max,s=1/0;if(dY[i]){var l=s,u=s,h=-s,d=-s,f=[],p=r&&r.pixelRatio||this.getDevicePixelRatio();fe(YS,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=o(S.right,h),d=o(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=tl.createCanvas(),y=Efe(v,{renderer:n?"svg":"canvas"});if(y.resize({width:g,height:m}),n){var b="";return fe(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 nn({shape:{x:0,y:0,width:g,height:m},style:{fill:r.connectedBackgroundColor}})),fe(f,function(x){var w=new nl({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 sY(this,"convertToPixel",r,n,i)},e.prototype.convertToLayout=function(r,n,i){return sY(this,"convertToLayout",r,n,i)},e.prototype.convertFromPixel=function(r,n,i){return sY(this,"convertFromPixel",r,n,i)},e.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var i=this._model,a,o=M_(i,r);return fe(o,function(s,l){l.indexOf("Models")>=0&&fe(s,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=M_(i,r,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?Ege(s,l,n):G8(s,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;fe(w$r,function(i){var a=function(o){var s=r.getModel(),l=o.target,u,h=i==="globalout";if(h?u={}:l&&VS(l,function(m){var v=Cr(m);if(v&&v.dataIndex!=null){var y=v.dataModel||s.getSeriesByIndex(v.seriesIndex);return u=y&&y.getDataParams(v.dataIndex,v.dataType,l)||{},!0}else if(v.eventData)return u=lt({},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&&s.getComponent(d,f),g=p&&r[p.mainType==="series"?"_chartsMap":"_componentsMap"][p.__viewId];u.event=o,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;fe(Qge,function(i,a){n.on(a,function(o){r.trigger(a,o)})}),k7r(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&&Olt(this.getDom(),Yge,"");var n=this,i=n._api,a=n._model;fe(n._componentsViews,function(o){o.dispose(a,i)}),fe(n._chartsViews,function(o){o.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 YS[n.id]},e.prototype.resize=function(r){if(!this[Ns]){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[Il]&&(a==null&&(a=this[Il].silent),i=!0,this[Il]=null),this[Ns]=!0,m5(this);try{i&&WS(this),Iy.update.call(this,{type:"resize",animation:lt({duration:0},r&&r.animation)})}catch(o){throw this[Ns]=!1,o}this[Ns]=!1,p5.call(this,a),g5.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(),!!Wge[r]){var i=Wge[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=lt({},r);return n.type=Vge[r.type],n},e.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(yr(n)||(n={silent:!!n}),!!uY[r.type]&&this._model){if(this[Ns]){this._pendingActions.push(r);return}var i=n.silent;Fge.call(this,r,i);var a=n.flush;a?this._zr.flush():a!==!1&&Dn.browser.weChat&&this._throttledZrFlush(),p5.call(this,i),g5.call(this,i)}},e.prototype.updateLabelLayout=function(){sp.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(){WS=function(d){R7r(d._model);var f=d._scheduler;f.restorePipelines(d._zr,d._model),f.prepareStageTasks(),Bge(d,!0),Bge(d,!1),f.plan()},Bge=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"),Qut.hoverLayerThreshold)&&!Dn.node&&!Dn.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!==Y_&&(w.hoverLayer=v?Xct:jct)})}}),d._usingTHL=v)}}function s(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=_S(d);f.eachRendered(function(g){return OW(g,p.z,p.zlevel),!0})}}function u(d,f){f.eachRendered(function(p){if(!W_(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(W_(y))return;if(y instanceof yn&&INr(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)}})}qdt=function(d){return new(function(f){nt(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){_y(g,m),lp(d)},p.prototype.leaveEmphasis=function(g,m){Ry(g,m),lp(d)},p.prototype.enterBlur=function(g){Act(g),lp(d)},p.prototype.leaveBlur=function(g){ppe(g),lp(d)},p.prototype.enterSelect=function(g){Sct(g),lp(d)},p.prototype.leaveSelect=function(g){Tct(g),lp(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[aY]},p.prototype.usingTHL=function(){return d._usingTHL},p}(hct))(d)},jdt=function(d){function f(p,g){for(var m=0;m=0)){nft.push(r);var o=tdt.wrapStageHandler(r,i);o.__prio=e,o.__raw=r,t.push(o)}}function Jge(t,e){Wge[t]=e}function D$r(t){jot({createCanvas:t})}function ift(t,e,r){var n=ddt("registerMap");n&&n(t,e,r)}function L$r(t){var e=ddt("getMap");return e&&e(t)}var aft=FBr;qx(Ige,h7r),qx(iY,d7r),qx(iY,f7r),qx(Ige,C7r),qx(iY,O7r),qx(Ndt,i$r),Xge(sht),Kge(u$r,yBr),Jge("default",p7r),gg({type:xS,event:xS,update:xS},no),gg({type:hW,event:hW,update:hW},no),gg({type:dW,event:hpe,update:dW,action:no,refineEvent:eme,publishNonRefinedEvent:!0}),gg({type:upe,event:hpe,update:upe,action:no,refineEvent:eme,publishNonRefinedEvent:!0}),gg({type:fW,event:hpe,update:fW,action:no,refineEvent:eme,publishNonRefinedEvent:!0});function eme(t,e,r,n){return{eventContent:{selected:_Nr(r),isFromClick:e.isFromClick||!1}}}jge("default",{}),jge("dark",sdt);var M$r={},oft=[],I$r={registerPreprocessor:Xge,registerProcessor:Kge,registerPostInit:Jdt,registerPostUpdate:eft,registerUpdateLifecycle:fY,registerAction:gg,registerCoordinateSystem:tft,registerLayout:rft,registerVisual:qx,registerTransform:aft,registerLoading:Jge,registerMap:ift,registerImpl:E7r,PRIORITY:Bdt,ComponentModel:pn,ComponentView:Xi,SeriesModel:Ii,ChartView:ki,registerComponentModel:function(t){pn.registerClass(t)},registerComponentView:function(t){Xi.registerClass(t)},registerSeriesModel:function(t){Ii.registerClass(t)},registerChartView:function(t){ki.registerClass(t)},registerCustomSeries:function(t,e){pdt(t,e)},registerSubTypeDefaulter:function(t,e){pn.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){clt(t,e)}};function Xr(t){if(ft(t)){fe(t,function(e){Xr(e)});return}Nr(oft,t)>=0||(oft.push(t),ur(t)&&(t={install:t}),t.install(I$r))}function H8(t){return t==null?0:t.length||1}function sft(t){return t}var Py=function(){function t(e,r,n,i,a,o){this._old=e,this._new=r,this._oldKeyGetter=n||sft,this._newKeyGetter=i||sft,this.context=a,this._diffModeMultiple=o==="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 o=0;o1){var h=l.shift();l.length===1&&(n[s]=l[0]),this._update&&this._update(h,o)}else u===1?(n[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,n)},t.prototype._executeMultiple=function(){var e=this._old,r=this._new,n={},i={},a=[],o=[];this._initIndexMap(e,n,a,"_oldKeyGetter"),this._initIndexMap(r,i,o,"_newKeyGetter");for(var s=0;s1&&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 s=0;s30}var W8=yr,jx=vt,z$r=typeof Int32Array>"u"?Array:Int32Array,U$r="e\0\0",dft=-1,V$r=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],Q$r=["_approximateExtent"],fft,mY,Y8,q8,nme,j8,ime,jc=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;cft(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(i=!0,n=e),n=n||["x","y"];for(var a={},o=[],s={},l=!1,u={},h=0;h=r)){var n=this._store,i=n.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=i.getSource().sourceFormat,l=s===Vd;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():W8(a)&&(a=lt({},a)),i[r]=a),a},t.prototype.setItemVisual=function(e,r,n){var i=this._itemVisuals[e]||{};this._itemVisuals[e]=i,W8(r)?lt(i,r):i[r]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(e,r){W8(e)?lt(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?lt(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;spe(n,this.dataType,e,r),this._graphicEls[e]=r},t.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},t.prototype.eachItemGraphicEl=function(e,r){fe(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:jx(this.dimensions,this._getDimInfo,this),this.hostModel)),nme(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(dH(arguments)))})},t.internalField=function(){fft=function(e){var r=e._invertedIndicesMap;fe(r,function(n,i){var a=e._dimInfos[i],o=a.ordinalMeta,s=e._store;if(o){n=r[i]=new z$r(o.categories.length);for(var l=0;l1&&(l+="__ec__"+h),i[r]=l}}}(),t}();function G$r(t,e){return v5(t,e).dimensions}function v5(t,e){gge(t)||(t=vge(t)),e=e||{};var r=e.coordDimensions||[],n=e.dimensionsDefine||t.dimensionsDefine||[],i=qt(),a=[],o=H$r(t,r,n,e.dimensionsCount),s=e.canOmitUnusedDimensions&&hft(o),l=n===t.dimensionsDefine,u=l?uft(t):rme(n),h=e.encodeDefine;!h&&e.encodeDefaulter&&(h=e.encodeDefaulter(t,o));for(var d=qt(h),f=new Eht(o),p=0;p0&&(k.name=k.name+(E-1))}),new lft({source:t,dimensions:a,fullDimensionCount:o,dimensionOmitted:s})}function H$r(t,e,r,n){var i=Math.max(t.dimensionsDetectedCount||1,e.length,r.length,n||0);return fe(e,function(a){var o;yr(a)&&(o=a.dimsDef)&&(i=Math.max(i,o.length))}),i}function W$r(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 Y$r=function(){function t(e){this.coordSysDims=[],this.axisMap=qt(),this.categoryAxisMap=qt(),this.coordSysName=e}return t}();function q$r(t){var e=t.get("coordinateSystem"),r=new Y$r(e),n=j$r[e];if(n)return n(t,r,r.axisMap,r.categoryAxisMap),r}var j$r={cartesian2d:function(t,e,r,n){var i=t.getReferringComponents("xAxis",xo).models[0],a=t.getReferringComponents("yAxis",xo).models[0];e.coordSysDims=["x","y"],r.set("x",i),r.set("y",a),y5(i)&&(n.set("x",i),e.firstCategoryDimIndex=0),y5(a)&&(n.set("y",a),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,r,n){var i=t.getReferringComponents("singleAxis",xo).models[0];e.coordSysDims=["single"],r.set("single",i),y5(i)&&(n.set("single",i),e.firstCategoryDimIndex=0)},polar:function(t,e,r,n){var i=t.getReferringComponents("polar",xo).models[0],a=i.findAxisModel("radiusAxis"),o=i.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],r.set("radius",a),r.set("angle",o),y5(a)&&(n.set("radius",a),e.firstCategoryDimIndex=0),y5(o)&&(n.set("angle",o),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")),o=e.coordSysDims=a.dimensions.slice();fe(a.parallelAxisIndex,function(s,l){var u=i.getComponent("parallelAxis",s),h=o[l];r.set(h,u),y5(u)&&(n.set(h,u),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})},matrix:function(t,e,r,n){var i=t.getReferringComponents("matrix",xo).models[0];e.coordSysDims=["x","y"];var a=i.getDimensionModel("x"),o=i.getDimensionModel("y");r.set("x",a),r.set("y",o),n.set("x",a),n.set("y",o)}};function y5(t){return t.get("type")==="category"}function pft(t,e,r){r=r||{};var n=r.byIndex,i=r.stackedCoordDimension,a,o,s;X$r(e)?a=e:(o=e.schema,a=o.dimensions,s=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(fe(a,function(w,A){$t(w)&&(a[A]=w={name:w}),g(w)||(p=!1)}),fe(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;fe(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};o?(s&&(b.storeDimIndex=s.ensureCalculationDimension(f,v),x.storeDimIndex=s.ensureCalculationDimension(d,v)),o.appendCalculationDimension(b),o.appendCalculationDimension(x)):(a.push(b),a.push(x))}return{stackedDimension:h&&h.name,stackedByDimension:u&&u.name,isStackedByIndex:n,stackedOverDimension:f,stackResultDimension:d}}function X$r(t){return!cft(t.schema)}function Ny(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function ame(t,e){return Ny(t,e)?t.getCalculationInfo("stackResultDimension"):e}function K$r(t,e){var r=t.get("coordinateSystem"),n=r5.get(r),i;return e&&e.coordSysDims&&(i=vt(e.coordSysDims,function(a){var o={name:a},s=e.axisMap.get(a);if(s){var l=s.get("type");o.type=pY(l)}return o})),i||(i=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),i}function Z$r(t,e,r){var n,i;return r&&fe(t,function(a,o){var s=a.coordDim,l=r.categoryAxisMap.get(s);l&&(n==null&&(n=o),a.ordinalMeta=l.getOrdinalMeta(),e&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(i=!0)}),!i&&n!=null&&(t[n].otherDims.itemName=0),n}function jm(t,e,r){r=r||{};var n=e.getSourceManager(),i,a=!1;t?(a=!0,i=vge(t)):(i=n.getSource(),a=i.sourceFormat===Vd);var o=q$r(e),s=K$r(e,o),l=r.useEncodeDefaulter,u=ur(l)?l:l?Kr(Hut,s,e):null,h={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},d=v5(i,h),f=Z$r(d.dimensions,r.createInvertedIndices,o),p=a?null:n.getSharedDataStore(d),g=pft(e,{schema:d,store:p}),m=new jc(d,e);m.setCalculationInfo(g);var v=f!=null&&J$r(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 J$r(t){if(t.sourceFormat===Vd){var e=eFr(t.data||[]);return!ft(L_(e))}}function eFr(t){for(var e=0;e=e[0]&&t<=e[1]},getExtent:function(){return this._extents[Vh].slice()},getExtentUnsafe:function(t){return this._extents[t]},setExtent:function(t,e){vft(this._extents,Vh,t,e)},setExtent2:function(t,e,r){var n=this._extents;n[t]||(n[t]=n[Vh].slice()),vft(n,t,e,r)},freeze:function(){}};function vft(t,e,r,n){cS(r,n)&&(t[e][0]=r,t[e][1]=n)}function yft(t){return bY(t)||b5(t)}function bY(t){return t.type==="interval"}function J8(t){return t.type==="time"}function b5(t){return t.type==="log"}function Xc(t){return t.type==="ordinal"}function oFr(t){var e=jH(t),r=nS(10,e),n=Im(t/r);return n?n===2?n=3:n===3?n=5:n*=2:n=1,Yn(n*r,-e)}function qS(t){return Pm(t)+2}function xY(t,e){return iS(t)/iS(e)}function ume(t,e,r){var n=r&&r.lookup;if(n){for(var i=0;i1&&a/o>2&&(i=Math.round(Math.ceil(i/o)*o)),i!==n[0]&&l(n[0],!0,!0);for(var s=i;s<=n[1];s+=o)l(s,!1,s===n[0]||s===n[1]);s-o!==n[1]&&l(n[1],!0,!0);function l(u,h,d){r({value:u,offInterval:h},d)}}var eB=function(t){nt(e,t);function e(r){var n=t.call(this)||this;n.type="ordinal",n.parse=e.parse,sme(n,e.decoratedMethods);var i=r.ordinalMeta;i||(i=new X8({})),ft(i)&&(i=new X8({categories:vt(i,function(o){return yr(o)?o.value:o})})),n._ordinalMeta=i;var a=ome(null,null,r.extent||[0,i.categories.length-1]);return n._mapper=a.mapper,lme(n),n}return e.parse=function(r){return r==null?r=NaN:$t(r)?(r=this._ordinalMeta.getOrdinal(r),r==null&&(r=NaN)):r=Im(r),r},e.prototype.getTicks=function(){var r=[];return xft(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=[],o=0,s=this._ordinalMeta.categories.length,l=Oi(s,n.length);o=0&&r=0&&r=0&&ro[0]&&mo[1]||!isFinite(m)||!isFinite(o[1]))break}else{if(v>g)break;m=Oi(m,o[1]),v===g&&(m=o[1])}if(d.push({value:m}),m=Yn(m+i,s),u){var y=u.calcNiceTickMultiple(m,p);y>=0&&(m=Yn(m+y*i,s))}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:o[1];return a[1]>b&&d.push({value:r.expandToNicedExtent?Yn(b+i,s):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 hme(this,r,LW(this),this._cfg.interval)},e.prototype.getLabel=function(r,n){if(r==null)return"";var i=n&&n.precision;i==null?i=Pm(r.value)||0:i==="auto"&&(i=this._cfg.intervalPrecision);var a=Yn(r.value,i,!0);return ege(a)},e.type="interval",e}(mg);mg.registerClass(Xx);var lFr=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 uFr(t){var e=30*ap;return t/=e,t>6?6:t>3?3:t>2?2:1}function hFr(t){return t/=_8,t>12?12:t>6?6:t>3.5?4:t>2?2:1}function Sft(t,e){return t/=e?Ype:Wpe,t>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function dFr(t){return rn(XH(t,!0),1)}function fFr(t,e,r){var n=Math.max(0,Nr(Hd,e)-1);return NW(new Date(t),Hd[n],r).getTime()}function pFr(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,o){return Math.max(0,Math.round((o-a)/i))}}function gFr(t,e,r,n,i,a){var o=3e3,s=D8r,l=0;function u(M,I,N,F,B,V,z){for(var U=pFr(B,M),Q=I,G=new Date(Q);Qo));)if(G[B](G[F]()+M),Q=G.getTime(),a){var q=a.calcNiceTickMultiple(Q,U);q>0&&(G[B](G[F]()+q*M),Q=G.getTime())}z.push({value:Q,notAdd:Q>n[1]})}function h(M,I,N){var F=[],B=!I.length;if(!Aft(R8(M),n[0],n[1],r)){B&&(I=[{value:fFr(n[0],M,r)},{value:n[1]}]);for(var V=0;V=n[0]&&z<=n[1]&&u(Q,z,U,G,q,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===s[m]))break}f=[]}}}for(var S=oi(vt(d,function(M){return oi(M,function(I){return I.value>=n[0]&&I.value<=n[1]&&!I.notAdd})}),function(M){return M.length>0}),T=S.length-1,C=[],m=0;mn[0])&&C.unshift({value:n[0],time:{level:0,upperTimeUnit:R,lowerTimeUnit:R},notNice:!0}),(!L||L.values&&(a=s);var l=AY.length,u=Math.min(lFr(AY,a,0,l),l-1),h=AY[u][1],d=AY[Math.max(u-1,0)][0];t.setTimeInterval({approxInterval:a,interval:h,minLevelUnit:d})};mg.registerClass(wft);var SY=0,TY=1,vFr=2,Tft=function(t){nt(e,t);function e(r){var n=t.call(this)||this;n.type="log",n.parse=Xx.parse,n.base=r.logBase||10;var i=[],a=[],o=n._lookup={from:i,to:a};i[SY]=i[TY]=a[SY]=a[TY]=NaN,sme(n,e.mapperMethods);var s=Ho(),l=r.breakOption,u={lookup:o};return s&&s.parseAxisBreakOptionInwardTransform(l,n,{noNegative:!0},vFr,u),n.powStub=new Xx({breakParsed:u.original}),n.intervalStub=new Xx({breakParsed:u.transformed}),lme(n,n.intervalStub),n}return e.prototype.getTicks=function(r){var n=this.base,i=this.powStub,a=Ho(),o=this.intervalStub,s=o.getExtent(),l=i.getExtent(),u={lookup:{from:s,to:l}};return vt(o.getTicks(r||{}),function(h){var d=h.value,f=ume(d,n,u),p;if(a){var g=a.getTicksBreakOutwardTransform(this,h,LW(i),this._lookup);g&&(p=g.vBreak,f=g.tickVal)}return{value:f,break:p}},this)},e.prototype.getMinorTicks=function(r){return hme(this,r,LW(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(xY(r,this.base))},scale:function(r){return ume(this.intervalStub.scale(r),this.base,null)},transformIn:function(r,n){return r=xY(r,this.base),n&&n.depth===By?r:this.intervalStub.transformIn(r,n)},transformOut:function(r,n){var i=n?n.depth:null;return Cft.depth=i,Oft.lookup=this._lookup,ume(i===By?r:this.intervalStub.transformOut(r,Cft),this.base,Oft)},contain:function(r){return this.powStub.contain(r)},setExtent:function(r,n){this.setExtent2(Vh,r,n)},setExtent2:function(r,n,i){if(!(!cS(n,i)||n<=0||i<=0)){var a=kft,o=kft;if(r===Vh){var s=this._lookup;a=s.to,o=s.from}this.powStub.setExtent2(r,a[SY]=n,a[TY]=i);var l=this.base;this.intervalStub.setExtent2(r,o[SY]=xY(n,l),o[TY]=xY(i,l))}},getFilter:function(){return{g:0}},sanitize:function(r,n){return cS(n[0],n[1])&&ep(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}(mg);mg.registerClass(Tft);var Cft={},Oft={},kft=[],Eft={value:1,category:1,time:1,log:1},_ft=Gr();function tB(t){var e=t.get("type");return(e==null||!Kt(Eft,e)&&!mg.getClass(e))&&(e="value"),e}function x5(t,e,r){var n=Ho(),i;switch(n&&(i=Rft(t,e,r)),e){case"category":return new eB({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:dc()});case"time":return new wft({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC"),breakOption:i});case"log":return new Tft({logBase:t.get("logBase"),breakOption:i});case"value":return new Xx({breakOption:i});default:return new(mg.getClass(e)||Xx)({})}}function yFr(t,e,r){var n=t.getExtentUnsafe(Vh,null),i=n[0],a=n[1];return cS(i,a)?i===e||a===e?xFr:ie?bFr:dme:dme}var bFr=1,xFr=2,dme=3;function wFr(t){_ft(t).noOnMyZero=!0}function AFr(t){return _ft(t).noOnMyZero}function rB(t){var e=t.getLabelModel().get("formatter");if(t.type==="time"){var r=L8r(e);return function(i,a){return t.scale.getFormattedLabel(i,a,r)}}else{if($t(e))return function(i){var a=t.scale.getLabel(i),o=e.replace("{value}",a??"");return o};if(ur(e)){if(t.type==="category")return function(i,a){return e(CY(t,i),i.value-t.scale.getExtent()[0],null)};var n=Ho();return function(i,a){var o=null;return n&&(o=n.makeAxisLabelFormatterParamBreak(o,i.break)),e(CY(t,i),a,o)}}else return function(i){return t.scale.getLabel(i)}}}function CY(t,e){var r=t.scale;return Xc(r)?r.getLabel(e):e.value}function fme(t){var e=t.get("interval");return e??"auto"}function SFr(t){return t.type==="category"&&fme(t.getLabelModel())===0}function TFr(t,e){var r={};return fe(t.mapDimensionsAll(e),function(n){r[ame(t,n)]=!0}),En(r)}function w5(t){return t==="middle"||t==="center"}function nB(t){return t.getShallow("show")}function Rft(t,e,r){var n=t.get("breaks",!0);if(n!=null)return!Ho()||!r||!CFr(e)?void 0:n}function CFr(t){return t!=="category"}function Dft(t,e,r,n,i,a){var o=b5(t),s=o?t.intervalStub:t;if(s.setExtent(n[0],n[1]),o){var l=t.powStub,u={depth:By},h=t.transformOut(n[0],u),d=t.transformOut(n[1],u),f=sFr(r,n);e[0]&&!f[0]&&(h=i[0]),e[1]&&!f[1]&&(d=i[1]),l.setExtent(h,d)}s.setConfig(a)}function A5(t,e){return Xc(t)?t.getRawOrdinalNumber(e.value):e.value}function iB(t,e){return Xc(t)&&!!e.get("boundaryGap")}var S5=function(){function t(){}return t.prototype.needIncludeZero=function(){return!this.option.scale},t.prototype.getCoordSysModel=function(){},t}(),OFr=P_(),OY="|&",T5=Gr(),Lft=-2,kFr=-1,EFr=Gr();function pme(t,e){var r=t.model,n=T5(c5(r.ecModel)).keyed,i=n&&n.get(e);return i&&i.get(r.uid)}function _Fr(t,e){return Ift(pme(t,e))}function RFr(t,e){var r=[];return Mft(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=aB(e,r.get("startValue",!0)),S=A!=null;!ep(A)&&i&&(A=e.getDefaultStartValue?e.getDefaultStartValue():0),ep(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};$ft(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,o={fixMM:a,zoomFixMM:i,isBlank:e.isBlank,incl0:e.incl0,tggAxInv:e.tggAxInv,ctnShp:e.ctnShp,effMM:n.slice()},s=o.effMM;return r[0]!=null&&(s[0]=r[0],a[0]=i[0]=!0),r[1]!=null&&(s[1]=r[1],a[1]=i[1]=!0),$ft(e,s),o},t.prototype.makeRenderInfo=function(){return{startValue:this._i.startValue}},t.prototype.setZoomMM=function(e,r){this._i.zoomMM[e]=r},t}();function $ft(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),ZH(e))}function aB(t,e){return e==null?null:cc(e)?NaN:t.parse(e)}function $Fr(t,e){var r;if(Xc(t))r=[0,0];else{var n=e.get("boundaryGap");typeof n=="boolean"&&(n=null),r=ft(n)?n:[n,n]}return[Fft(r[0]),Fft(r[1])]}function Fft(t){return Mm(typeof t=="boolean"?0:t,1)||0}function zft(t){var e=PFr(t.scale);return e.extent||(e.extent=dc()),e}function FFr(t,e){zft(t).dimIdxInCoord=e.get(t.dim)}function KS(t,e){var r=t.scale,n=t.model,i=t.dim;r.rawExtentInfo||zFr(r,t,i,n,e)}function zFr(t,e,r,n,i){var a=zft(e),o=a.extent,s=!1;DFr(e,function(h){if(h.boxCoordinateSystem){var d=Dut(h).coord,f=a.dimIdxInCoord;if(f>=0){if(ft(d)){var p=d[f];p!=null&&!ft(p)&&Ufe(o,t.parse(p))}}}else if(h.coordinateSystem){var g=h.getData();if(g){var m=t.getFilter?t.getFilter():null;fe(TFr(g,r),function(v){v6r(o,g.getApproximateExtent(v,m))})}h.__requireStartValue&&h.__requireStartValue(e)&&(s=!0)}});var l=VFr(t,e,n),u=new Bft(t,n,o,s,l);Uft(t,u,i),a.extent=null}function UFr(t,e){var r=t.scale;Uft(r,new Bft(r,t.model,e,!1,!1),BFr)}function Uft(t,e,r){t.rawExtentInfo=e,e.from=r}function EY(t,e){bme.set(t,e)}var bme=qt();function Vft(t,e,r,n,i){t.rawExtentInfo||UFr({scale:t,model:e},i||dc());var a=t.rawExtentInfo.makeFinal(),o=a.effMM;return t.setExtent(o[0],o[1]),t.setBlank(a.isBlank),n&&a.tggAxInv&&r&&!r.get("legacyMinMaxDontInverseAxis")&&(n.inverse=!n.inverse),a}function VFr(t,e,r){var n=iB(t,r),i=r.get("containShape",!0);if(i==null&&!n&&(i=!0),!i)return!1;var a=!1;return Pft(e,function(o){a=!!bme.get(o)||a}),a}function QFr(t,e,r,n){if(r.ctnShp){var i;if(Pft(t,function(s){var l=bme.get(s);if(l){var u=l(t,n);u&&(i=i||[0,0],Elt(i,u[0]),_lt(i,u[1]),wFr(t))}}),!!i){var a=e.getExtent();if(Xc(e))t.onBand||e.setExtent2(K8,Oi(a[0],a[0]+i[0]),rn(a[1],a[1]+i[1]));else{var o=a.slice();r.zoomFixMM[0]||(o[0]=Oi(o[0],e.transformOut(e.transformIn(o[0],null)+i[0],null))),r.zoomFixMM[1]||(o[1]=rn(o[1],e.transformOut(e.transformIn(o[1],null)+i[1],null))),(o[0]a[1])&&e.setExtent2(K8,o[0],o[1])}}}}function Qft(t,e){var r=b5(t),n=r?t.intervalStub:t,i=e.fixMinMax||[],a=r?t.getExtent():null,o=n.getExtent(),s=bft(o,i,e.rawExtentResult);n.setExtent(s[0],s[1]),s=n.getExtent();var l=r?HFr(n,e):GFr(n,e),u=l.intervalPrecision,h=l.interval,d=e.userInterval;d!=null&&(l.interval=d,l.intervalPrecision=qS(d)),i[0]||(s[0]=Yn(Jf(s[0]/h)*h,u)),i[1]||(s[1]=Yn(rS(s[1]/h)*h,u)),d!=null&&(l.niceExtent=s.slice()),Dft(t,i,o,s,a,l)}function GFr(t,e){var r=wY(e.splitNumber,5),n=yY(t),i=e.minInterval,a=e.maxInterval,o=XH(n/r,!0);i!=null&&oa&&(o=a);var s=qS(o),l=t.getExtent(),u=[Yn(rS(l[0]/o)*o,s),Yn(Jf(l[1]/o)*o,s)];return{interval:o,intervalPrecision:s,niceExtent:u}}function HFr(t,e){var r=wY(e.splitNumber,10),n=t.getExtent(),i=yY(t),a=rn(Lfe(i),1),o=r/i*a;o<=.5&&(a*=10);var s=qS(a),l=[Yn(rS(n[0]/a)*a,s),Yn(Jf(n[1]/a)*a,s)];return{intervalPrecision:s,interval:a,niceExtent:l}}function O5(t){var e=t.scale,r=t.model,n=r.axis,i=r.ecModel;Gft(e,r,n,i,null)}function Gft(t,e,r,n,i){var a=Vft(t,e,n,r,i),o=bY(t)||J8(t);Hft(t,{splitNumber:e.get("splitNumber"),fixMinMax:a.fixMM,userInterval:e.get("interval"),minInterval:o?e.get("minInterval"):null,maxInterval:o?e.get("maxInterval"):null,rawExtentResult:a}),r&&n&&QFr(r,t,a,n)}function Hft(t,e){WFr[t.type](t,e)}var WFr={interval:Qft,log:Qft,time:mFr,ordinal:no};function YFr(t){return jm(null,t)}var qFr={isDimensionStacked:Ny,enableDataStack:pft,getStackedDimension:ame};function jFr(t,e){var r=e;e instanceof bn||(r=new bn(e));var n=tB(r),i=x5(r,n,!1);return t[1]i&&(n=o,i=l)}if(n)return t9r(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],o=this.geometries;return fe(o,function(s){s.type==="polygon"?Yft(s.exterior,i,a,r):fe(s.points,function(l){Yft(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 pr(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,o=i.length;a>1^-(s&1),l=l>>1^-(l&1),s+=i,l+=a,i=s,a=l,n.push([s/r,l/r])}return n}function Ame(t,e){return t=n9r(t),vt(oi(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 o=i.coordinates;a.push(new jft(o[0],o.slice(1)));break;case"MultiPolygon":fe(i.coordinates,function(l){l[0]&&a.push(new jft(l[0],l.slice(1)))});break;case"LineString":a.push(new Xft([i.coordinates]));break;case"MultiLineString":a.push(new Xft(i.coordinates))}var s=new Kft(n[e||"name"],a,n.cp);return s.properties=n,s})}const i9r=Object.freeze(Object.defineProperty({__proto__:null,MAX_SAFE_INTEGER:c8,asc:Rl,getPercentWithPrecision:KPr,getPixelPrecision:XPr,getPrecision:Pm,getPrecisionSafe:plt,isNumeric:Ife,isRadianAroundZero:oS,linearMap:Zn,nice:XH,numericToNumber:Bm,parseDate:Nm,parsePercent:Qt,quantile:KH,quantity:Lfe,quantityExponent:jH,reformIntervals:Mfe,remRadian:Dfe,round:jPr},Symbol.toStringTag,{value:"Module"})),a9r=Object.freeze(Object.defineProperty({__proto__:null,format:D8,parse:Nm,roundTime:NW},Symbol.toStringTag,{value:"Module"})),o9r=Object.freeze(Object.defineProperty({__proto__:null,Arc:A8,BezierCurve:G_,BoundingRect:pr,Circle:Wm,CompoundPath:S8,Ellipse:b8,Group:gr,Image:nl,IncrementalDisplayable:Wct,Line:Go,LinearGradient:TS,Polygon:pc,Polyline:Ll,RadialGradient:Tpe,Rect:nn,Ring:Q_,Sector:fc,Text:$n,clipPointsByRect:Rpe,clipRectByRect:tut,createIcon:X_,extendPath:Zct,extendShape:Kct,getShapeClass:T8,getTransform:kS,initProps:ua,makeImage:Epe,makePath:q_,mergePath:Gd,registerShape:ip,resizePath:_pe,updateProps:qn},Symbol.toStringTag,{value:"Module"})),s9r=Object.freeze(Object.defineProperty({__proto__:null,addCommas:ege,capitalFirst:z8r,encodeHTML:Hc,formatTime:F8r,formatTpl:ige,getTextRect:$8r,getTooltipMarker:Eut,normalizeCssArray:t5,toCamelCase:tge,truncateText:I6r},Symbol.toStringTag,{value:"Module"})),l9r=Object.freeze(Object.defineProperty({__proto__:null,bind:Wt,clone:lr,curry:Kr,defaults:mr,each:fe,extend:lt,filter:oi,indexOf:Nr,inherits:Dde,isArray:ft,isFunction:ur,isObject:yr,isString:$t,map:vt,merge:Qr,reduce:Yf},Symbol.toStringTag,{value:"Module"}));var c9r=Gr(),oB=Gr(),vg={estimate:1,determine:2};function _Y(t){return{out:{noPxChangeTryDetermine:[]},kind:t}}function u9r(t,e){var r=t.getLabelModel().get("customValues");if(r){var n=t.scale;return{labels:vt(Jft(r,n),function(i,a){return{formattedLabel:rB(t)(i,a),rawLabel:n.getLabel(i),tick:i}})}}return t.type==="category"?d9r(t,e):p9r(t)}function h9r(t,e,r){var n=t.scale,i=t.getTickModel().get("customValues");return i?{ticks:Jft(i,n)}:t.type==="category"?f9r(t,e):{ticks:n.getTicks(r)}}function Jft(t,e){var r=e.getExtent(),n=[];return fe(t,function(i){i=e.parse(i),i>=r[0]&&i<=r[1]&&n.push(i)}),JH(n,w6r,null),Rl(n),vt(n,function(i){return{value:i}})}function d9r(t,e){var r=t.getLabelModel(),n=ept(t,r,e);return!r.get("show")||t.scale.isBlank()?{labels:[]}:n}function ept(t,e,r){var n=m9r(t),i=fme(e),a=r.kind===vg.estimate;if(!a){var o=rpt(n,i);if(o)return o}var s,l;ur(i)?s=RY(t,i,!1):(l=i==="auto"?v9r(t,r):i,s=RY(t,l,!1));var u={labels:s,labelCategoryInterval:l};return a?r.out.noPxChangeTryDetermine.push(function(){return Sme(n,i,u),!0}):Sme(n,i,u),u}function f9r(t,e){var r=g9r(t),n=fme(e),i=rpt(r,n);if(i)return i;var a,o;if((!e.get("show")||t.scale.isBlank())&&(a=[]),ur(n))a=RY(t,n,!0);else if(n==="auto"){var s=ept(t,t.getLabelModel(),_Y(vg.determine));o=s.labelCategoryInterval,a=vt(s.labels,function(l){return l.tick})}else o=n,a=RY(t,o,!0);return Sme(r,n,{ticks:a,tickCategoryInterval:o})}function p9r(t){var e=t.scale.getTicks(),r=rB(t);return{labels:vt(e,function(n,i){return{formattedLabel:r(n,i),rawLabel:t.scale.getLabel(n),tick:n}})}}var g9r=tpt("axisTick"),m9r=tpt("axisLabel");function tpt(t){return function(r){return oB(r)[t]||(oB(r)[t]={list:[]})}}function rpt(t,e){for(var r=0;rh&&(u=Math.max(1,Math.floor(l/h)));for(var d=s[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<=s[1];d+=u){var y=0,b=0,x=FH(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===vg.estimate)return e.out.noPxChangeTryDetermine.push(Wt(b9r,null,t,S,l)),S;var T=npt(t,S,l);return T??S}function b9r(t,e,r){return npt(t,e,r)==null}function npt(t,e,r){var n=c9r(t.model),i=t.getExtent(),a=n.lastAutoInterval,o=n.lastTickCount;if(a!=null&&o!=null&&Math.abs(a-e)<=1&&Math.abs(o-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 x9r(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 RY(t,e,r){var n=rB(t),i=t.scale,a=[],o=ur(e);return xft(i,o?0:e,function(s,l){var u=i.getLabel(s);if(o){var h=!!e(s.value,u);if(s.offInterval=!h,!h&&!l)return}a.push(r?s:{formattedLabel:n(s),rawLabel:u,tick:s})}),a}var w9r=.8;function mc(t,e){e=e||{};var r={w:NaN,w2:NaN},n=t.scale,i=e.fromStat,a=e.min,o=iFr(n);ep(o)||(o=NaN);var s=t.getExtent(),l=ao(s[1]-s[0]);return Xc(n)?A9r(r,t,o,l):i&&S9r(r,t,o,l,i),a!=null&&(r.w=ep(r.w)?rn(a,r.w):a),r}function A9r(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 S9r(t,e,r,n,i){var a=!1,o=-1/0;fe(i.key?[_Fr(e,i.key)]:RFr(e,i.sers||[]),function(s){var l=s.liPosMinGap;l!=null&&(l>0?(l>o&&(o=l),a=!1):l===Lft&&(a=!0))}),ep(r)&&r>0&&ep(o)?(t.w=n/r*o,t.w2=o):a&&(t.w=n*w9r,t.w2=t.w*r/n)}var ipt=[0,1],cp=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)),Zn(e,ipt,apt(this),r)},t.prototype.coordToData=function(e,r){var n=Zn(e,apt(this),ipt,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=h9r(this,r,{breakTicks:e.breakTicks,pruneByBreak:e.pruneByBreak}),i=vt(n.ticks,function(s){return{coord:this.dataToCoord(A5(this.scale,s)),tick:s}},this),a=r.get("alignWithLabel"),o=T9r(this,i,a);return vt(i,function(s){return{coord:s.coord,tickValue:s.tick.value,onBand:o}})},t.prototype.getMinorTicksCoords=function(){if(Xc(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(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return i},t.prototype.getViewLabels=function(e){return e=e||_Y(vg.determine),u9r(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 mc(this,{min:1}).w},t.prototype.calculateCategoryInterval=function(e){return e=e||_Y(vg.determine),y9r(this,e)},t}();function apt(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 T9r(t,e,r){var n=e.length;if(!t.onBand||r||!n)return!1;var i=mc(t).w;if(!i)return!1;fe(e,function(s){s.coord-=i/2});var a=t.scale.getExtent(),o=e[n-1];return o.tick.offInterval&&e.pop(),e.push({coord:o.coord+i,tick:{value:a[1]+1}}),!0}function C9r(t){var e=pn.extend(t);return pn.registerClass(e),e}function O9r(t){var e=Xi.extend(t);return Xi.registerClass(e),e}function k9r(t){var e=Ii.extend(t);return Ii.registerClass(e),e}function E9r(t){var e=ki.extend(t);return ki.registerClass(e),e}var sB=Math.PI*2,JS=Qm.CMD,_9r=["top","right","bottom","left"];function R9r(t,e,r,n,i){var a=r.width,o=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+o+e),i.set(0,1);break;case"left":n.set(r.x-e,r.y+o/2),i.set(-1,0);break;case"right":n.set(r.x+a+e,r.y+o/2),i.set(1,0);break}}function D9r(t,e,r,n,i,a,o,s,l){o-=t,s-=e;var u=Math.sqrt(o*o+s*s);o/=u,s/=u;var h=o*r+t,d=s*r+e;if(Math.abs(n-i)%sB<1e-4)return l[0]=h,l[1]=d,u-r;if(a){var f=n;n=zd(i),i=zd(f)}else n=zd(n),i=zd(i);n>i&&(i+=sB);var p=Math.atan2(s,o);if(p<0&&(p+=sB),p>=n&&p<=i||p+sB>=n&&p+sB<=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-o)*(g-o)+(m-s)*(m-s),x=(v-o)*(v-o)+(y-s)*(y-s);return b0){e=e/180*Math.PI,bg.fromArray(t[0]),ha.fromArray(t[1]),qo.fromArray(t[2]),wr.sub(Xm,bg,ha),wr.sub(Km,qo,ha);var r=Xm.len(),n=Km.len();if(!(r<.001||n<.001)){Xm.scale(1/r),Km.scale(1/n);var i=Xm.dot(Km),a=Math.cos(e);if(a1&&wr.copy(Pu,qo),Pu.toArray(t[1])}}}}function I9r(t,e,r){if(r<=180&&r>0){r=r/180*Math.PI,bg.fromArray(t[0]),ha.fromArray(t[1]),qo.fromArray(t[2]),wr.sub(Xm,ha,bg),wr.sub(Km,qo,ha);var n=Xm.len(),i=Km.len();if(!(n<.001||i<.001)){Xm.scale(1/n),Km.scale(1/i);var a=Xm.dot(e),o=Math.cos(r);if(a=l)wr.copy(Pu,qo);else{Pu.scaleAndAdd(Km,s/Math.tan(Math.PI/2-h));var d=qo.x!==ha.x?(Pu.x-ha.x)/(qo.x-ha.x):(Pu.y-ha.y)/(qo.y-ha.y);if(isNaN(d))return;d<0?wr.copy(Pu,ha):d>1&&wr.copy(Pu,qo)}Pu.toArray(t[1])}}}}function Tme(t,e,r,n){var i=r==="normal",a=i?t:t.ensureState(r);a.ignore=e;var o=n.get("smooth");o=o===!0?.3:Math.max(+o,0)||0,a.shape=a.shape||{},a.shape.smooth=o;var s=n.getModel("lineStyle").getLineStyle();i?t.useStyle(s):a.style=s}function P9r(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=my(n[0],n[1]),a=my(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 o=Math.min(i,a)*r,s=HN([],n[1],n[0],o/i),l=HN([],n[1],n[2],o/a),u=HN([],s,l,.5);t.bezierCurveTo(s[0],s[1],s[0],s[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,C,k){T!==0&&(h=!0);for(var E=C;E0)for(var _=0;_0;_--){var D=k[_-1]*R;w(-D,_,a)}}}function S(T){var C=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 $9r(t){for(var e=0;e=0&&n.attr(a.oldLayoutSelect),Nr(f,"emphasis")>=0&&n.attr(a.oldLayoutEmphasis)),qn(n,u,r,l)}else if(n.attr(u),!K_(n).valueAnimation){var d=Jt(n.style.opacity,1);n.style.opacity=0,ua(n,{style:{opacity:d}},r,l)}if(a.oldLayout=u,n.states.select){var p=a.oldLayoutSelect={};NY(p,u,BY),NY(p,n.states.select,BY)}if(n.states.emphasis){var g=a.oldLayoutEmphasis={};NY(g,u,BY),NY(g,n.states.emphasis,BY)}dut(n,l,h,r,r)}if(i&&!i.ignore&&!i.invisible){var a=U9r(i),o=a.oldLayout,m={points:i.shape.points};o?(i.attr({shape:o}),qn(i,{shape:m},r)):(i.setShape(m),i.style.strokePercent=0,ua(i,{style:{strokePercent:1}},r)),a.oldLayout=m}},t}(),Lme=Gr();function Q9r(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){var i=Lme(r).labelManager;i||(i=Lme(r).labelManager=new V9r),i.clearLabels()}),t.registerUpdateLifecycle("series:layoutlabels",function(e,r,n){var i=Lme(r).labelManager;fe(n.updatedSeries,function(a){i.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),i.updateLayoutConfig(r),i.layout(r),i.processLabelsOverall()})}var Mme=Math.sin,Ime=Math.cos,mpt=Math.PI,eT=Math.PI*2,G9r=180/mpt,vpt=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,o){this._add("C",e,r,n,i,a,o)},t.prototype.quadraticCurveTo=function(e,r,n,i){this._add("Q",e,r,n,i)},t.prototype.arc=function(e,r,n,i,a,o){this.ellipse(e,r,n,n,0,i,a,o)},t.prototype.ellipse=function(e,r,n,i,a,o,s,l){var u=s-o,h=!l,d=Math.abs(u),f=Ix(d-eT)||(h?u>=eT:-u>=eT),p=u>0?u%eT:u%eT+eT,g=!1;f?g=!0:Ix(d)?g=!1:g=p>=mpt==!!h;var m=e+n*Ime(o),v=r+i*Mme(o);this._start&&this._add("M",m,v);var y=Math.round(a*G9r);if(f){var b=1/this._p,x=(h?1:-1)*(eT-b);this._add("A",n,i,y,1,+h,e+n*Ime(o+x),r+i*Mme(o+x)),b>.01&&this._add("A",n,i,y,0,+h,m,v)}else{var w=e+n*Ime(s),A=r+i*Mme(s);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,o,s,l,u){for(var h=[],d=this._p,f=1;f"}function J9r(t){return""}function Bme(t,e){e=e||{};var r=e.newline?` +`:"";function n(i){var a=i.children,o=i.tag,s=i.attrs,l=i.text;return Z9r(o,s)+(o!=="style"?Hc(l):l||"")+(a?""+r+vt(a,function(u){return n(u)}).join(r)+r:"")+J9r(o)}return n(t)}function ezr(t,e,r){r=r||{};var n=r.newline?` +`:"",i=" {"+n,a=n+"}",o=vt(En(t),function(l){return l+i+vt(En(t[l]),function(u){return u+":"+t[l][u]+";"}).join(n)+a}).join(n),s=vt(En(e),function(l){return"@keyframes "+l+i+vt(En(e[l]),function(u){return u+i+vt(En(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!o&&!s?"":[""].join(n)}function $me(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function Apt(t,e,r,n){return al("svg","root",{width:t,height:e,xmlns:ypt,"xmlns:xlink":bpt,version:"1.1",baseProfile:"full",viewBox:n?"0 0 "+t+" "+e:!1},r)}var tzr=0;function Spt(){return tzr++}var Tpt={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"},tT="transform-origin";function rzr(t,e,r){var n=lt({},t.shape);lt(n,e),t.buildPath(r,n);var i=new vpt;return i.reset(Qst(t)),r.rebuildPath(i,1),i.generateStr(),i.getStr()}function nzr(t,e){var r=e.originX,n=e.originY;(r||n)&&(t[tT]=r+"px "+n+"px")}var izr={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function Cpt(t,e){var r=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[r]=t,r}function azr(t,e,r){var n=t.shape.paths,i={},a,o;if(fe(n,function(l){var u=$me(r.zrId);u.animation=!0,$Y(l,{},u,!0);var h=u.cssAnims,d=u.cssNodes,f=En(h),p=f.length;if(p){o=f[p-1];var g=h[o];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(o)>=0&&(a=b)}}}),!!a){e.d=!1;var s=Cpt(i,r);return a.replace(o,s)}}function Opt(t){return $t(t)?Tpt[t]?"cubic-bezier("+Tpt[t]+")":efe(t)?t:"":""}function $Y(t,e,r,n){var i=t.animators,a=i.length,o=[];if(t instanceof S8){var s=azr(t,e,r);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var Y=Cpt(T,r);return Y+" "+b[0]+" both"}}for(var v in l){var s=m(l[v]);s&&o.push(s)}if(o.length){var y=r.zrId+"-cls-"+Spt();r.cssNodes["."+y]={animation:o.join(",")},e.class=y}}function ozr(t,e,r){if(!t.ignore)if(t.isSilent()){var n={"pointer-events":"none"};kpt(n,e,r)}else{var i=t.states.emphasis&&t.states.emphasis.style?t.states.emphasis.style:{},a=i.fill;if(!a){var o=t.style&&t.style.fill,s=t.states.select&&t.states.select.style&&t.states.select.style.fill,l=t.currentStates.indexOf("select")>=0&&s||o;l&&(a=kH(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),kpt(n,e,r)}}function kpt(t,e,r,n){var i=JSON.stringify(t),a=r.cssStyleCache[i];a||(a=r.zrId+"-cls-"+Spt(),r.cssStyleCache[i]=a,r.cssNodes["."+a+":hover"]=t),e.class=e.class?e.class+" "+a:a}var lB=Math.round;function Ept(t){return t&&$t(t.src)}function _pt(t){return t&&ur(t.toDataURL)}function Fme(t,e,r,n){j9r(function(i,a){var o=i==="fill"||i==="stroke";o&&Vst(a)?Ppt(e,t,i,n):o&&ofe(a)?Npt(r,t,i,n):t[i]=a,o&&n.ssr&&a==="none"&&(t["pointer-events"]="visible")},e,r,!1),fzr(r,t,n)}function zme(t,e){var r=ult(e);r&&(r.each(function(n,i){n!=null&&(t[(xpt+i).toLowerCase()]=n+"")}),e.isSilent()&&(t[xpt+"silent"]="true"))}function Rpt(t){return Ix(t[0]-1)&&Ix(t[1])&&Ix(t[2])&&Ix(t[3]-1)}function szr(t){return Ix(t[4])&&Ix(t[5])}function Ume(t,e,r){if(e&&!(szr(e)&&Rpt(e))){var n=1e4;t.transform=Rpt(e)?"translate("+lB(e[4]*n)/n+" "+lB(e[5]*n)/n+")":lPr(e)}}function Dpt(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.";uc(f,v),uc(p,v)}else if(f==null||p==null){var y=function(E,_){if(E){var P=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,P&&(P.setAttribute("width",L),P.setAttribute("height",R))}},b=Gfe(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=al("image","img",{href:g,width:f,height:p}),o.width=f,o.height=p}else i.svgElement&&(d=lr(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(d){var x,w;l?x=w=1:u?(w=1,x=o.width/a.width):h?(x=1,w=o.height/a.height):o.patternUnits="userSpaceOnUse",x!=null&&!isNaN(x)&&(o.width=x),w!=null&&!isNaN(w)&&(o.height=w);var A=Gst(i);A&&(o.patternTransform=A);var S=al("pattern","",o,[d]),T=Bme(S),C=n.patternCache,k=C[T];k||(k=n.zrId+"-p"+n.patternIdx++,C[T]=k,o.id=k,S=n.defs[k]=al("pattern",k,o,[d])),e[r]=RH(k)}}function pzr(t,e,r){var n=r.clipPathCache,i=r.defs,a=n[t.id];if(!a){a=r.zrId+"-c"+r.clipPathIdx++;var o={id:a};n[t.id]=a,i[a]=al("clipPath",a,o,[Mpt(t,r)])}e["clip-path"]=RH(a)}function Bpt(t){return document.createTextNode(t)}function rT(t,e,r){t.insertBefore(e,r)}function $pt(t,e){t.removeChild(e)}function Fpt(t,e){t.appendChild(e)}function zpt(t){return t.parentNode}function Upt(t){return t.nextSibling}function Vme(t,e){t.textContent=e}var Vpt=58,gzr=120,mzr=al("","");function Qme(t){return t===void 0}function Jm(t){return t!==void 0}function vzr(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 cB(t,e){var r=t.key===e.key,n=t.tag===e.tag;return n&&r}function uB(t){var e,r=t.children,n=t.tag;if(Jm(n)){var i=t.elm=wpt(n);if(Gme(mzr,t),ft(r))for(e=0;ea?(g=r[l+1]==null?null:r[l+1].elm,Qpt(t,g,r,i,l)):FY(t,e,n,a))}function k5(t,e){var r=e.elm=t.elm,n=t.children,i=e.children;t!==e&&(Gme(t,e),Qme(e.text)?Jm(n)&&Jm(i)?n!==i&&yzr(r,n,i):Jm(i)?(Jm(t.text)&&Vme(r,""),Qpt(r,null,i,0,i.length-1)):Jm(n)?FY(r,n,0,n.length-1):Jm(t.text)&&Vme(r,""):t.text!==e.text&&(Jm(n)&&FY(r,n,0,n.length-1),Vme(r,e.text)))}function bzr(t,e){if(cB(t,e))k5(t,e);else{var r=t.elm,n=zpt(r);uB(e),n!==null&&(rT(n,e.elm,Upt(r)),FY(n,[t],0,0))}return e}var xzr=0,wzr=function(){function t(e,r,n){if(this.type="svg",this.configLayer=Azr(),this.storage=r,this._opts=n=lt({},n),this.root=e,this._id="zr"+xzr++,this._oldVNode=Apt(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=wpt("svg");Gme(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",bzr(this._oldVNode,e),this._oldVNode=e}},t.prototype.renderOneToVNode=function(e){return Ipt(e,$me(this._id))},t.prototype.renderToVNode=function(e){e=e||{};var r=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=$me(this._id);a.animation=e.animation,a.willUpdate=e.willUpdate,a.compress=e.compress,a.emphasis=e.emphasis,a.ssr=this._opts.ssr;var o=[],s=this._bgVNode=Szr(n,i,this._backgroundColor,a);s&&o.push(s);var l=e.compress?null:this._mainVNode=al("g","main",{},[]);this._paintList(r,a,l?l.children:o),l&&o.push(l);var u=vt(En(a.defs),function(f){return a.defs[f]});if(u.length&&o.push(al("defs","defs",{},u)),e.animation){var h=ezr(a.cssNodes,a.cssAnims,{newline:!0});if(h){var d=al("style","stl",{},[],h);o.push(d)}}return Apt(n,i,o,e.useViewBox)},t.prototype.renderToString=function(e){return e=e||{},Bme(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=[],o=0,s,l,u=0,h=0;h=0&&!(f&&l&&f[m]===l[m]);m--);for(var v=g-1;v>m;v--)o--,s=a[o-1];for(var y=m+1;y=s)}}for(var d=Hpt(this),f=d.startIdx;f=0)&&(o=!0)}),!(!o&&!a.__dirty)){var s=n._opts.useDirtyRect&&!Hme(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,s)}zY(a,function(d){var f=n._paintPerCursor(a,d,e,s,u);i=i&&f})}},UY),Dn.wxa&&Kc(this._i,function(a){a&&a.ctx&&a.ctx.draw&&a.ctx.draw()}),i},t.prototype._paintPerCursor=function(e,r,n,i,a){var o=e.ctx;if(i)if(!i.length)r.drawIdx=r.endIdx;else for(var s=this.dpr,l=0;l=r.endIdx},t.prototype._paintPerCursorInRect=function(e,r,n,i,a){for(var o={inHover:!1,allClipped:!1,prevEl:null,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{contentRetained:a}},s=e.ctx,l=Hme(e),u=l&&tl.getTime(),h=r.drawIdx,d=r.notClearIdx,f=d>=0?Math.min(d,h):h;f15){f++;break}}}}d5(s,o),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=nT,r=0);var a=qme(this._i,e)[r];return a||(a=qpt("zr_"+e+"."+r,this,e,r),this._layerConfig[e]&&Qr(a,this._layerConfig[e],!0),(n||i&&e!==nT)&&(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,o=a.layers,s=a.layerStack,l=this._domRoot,u=null;if(!(o[r]&&o[r][n])&&Ozr(e)){for(var h=s.length,d=0;d0&&(u=qme(a,s[d-1].zl)[s[d-1].zl2]),s.splice(d,0,{zl:r,zl2:n}),qme(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 Kc(this._i,function(n,i){e.call(r,n,i)})},t.prototype.eachBuiltinLayer=function(e,r){return Kc(this._i,function(n,i){e.call(r,n,i)},hB)},t.prototype.eachOtherLayer=function(e,r){return Kc(this._i,function(n,i){e.call(r,n,i)},jme)},t.prototype.getLayers=function(){var e={};return Kc(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;(Hme(v)?A=0;i--){var a=r[i];if(a.zl===e){var o=n[e][a.zl2];if(o.__builtin__)continue;if(r.splice(i,1),n[e][a.zl2]=void 0,!o.virtual){var s=o.dom.parentNode;s&&s.removeChild(o.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=h5(a,0,i),r=h5(a,1,i),n.style.display="",(this._width!==e||r!==this._height)&&(n.style.width=e+"px",n.style.height=r+"px",Kc(this._i,function(o){o.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(nT).resize(e,r)}return this},t.prototype.clearLayer=function(e){fe(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[nT][0].dom;var r=new Wpt("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;Kc(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 o={inHover:!1,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{}},s=this.storage.getDisplayList(!0),l=0,u=s.length;l-1&&(u.style.stroke=u.style.fill,u.style.fill=tt.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}(Ii);function E5(t,e){var r=t.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var i=a5(t,e,r[0]);return i!=null?i+"":null}else if(n){for(var a=[],o=0;o=0&&n.push(e[a])}return n.join(" ")}var dB=function(t){nt(e,t);function e(r,n,i,a){var o=t.call(this)||this;return o.updateData(r,n,i,a),o}return e.prototype._createSymbol=function(r,n,i,a,o,s){this.removeAll();var l=Yo(r,-1,-1,2,2,null,s);l.attr({z2:Jt(o,100),culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),l.drift=Mzr,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(){_y(this.childAt(0))},e.prototype.downplay=function(){Ry(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 o=r.getItemVisual(n,"symbol")||"circle",s=r.hostModel,l=e.getSymbolSize(r,n),u=e.getSymbolZ2(r,n),h=o!==this._symbolType,d=a&&a.disableAnimation;if(h){var f=r.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,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):qn(p,g,s,n),np(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,ua(p,g,s,n)}}d&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(r,n,i,a,o){var s=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=Is(b),v=x.getShallow("scale"),y=b.getShallow("cursor")}var w=r.getItemVisual(n,"symbolRotate");s.attr("rotation",(w||0)*Math.PI/180||0);var A=QS(r.getItemVisual(n,"symbolOffset"),i);A&&(s.x=A[0],s.y=A[1]),y&&s.attr("cursor",y);var S=r.getItemVisual(n,"style"),T=S.fill;if(s instanceof nl){var C=s.style;s.useStyle(lt({image:C.image,x:C.x,y:C.y,width:C.width,height:C.height},S))}else s.__isEmptyBrush?s.useStyle(lt({},S)):s.useStyle(S),s.style.decal=null,s.setColor(T,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var k=r.getItemVisual(n,"liftZ"),E=this._z2;k!=null?E==null&&(this._z2=s.z2,s.z2+=k):E!=null&&(s.z2=E,this._z2=null);var _=o&&o.useNameLabel;il(s,m,{labelFetcher:l,labelDataIndex:n,defaultText:P,inheritColor:T,defaultOpacity:S.opacity});function P(D){return _?r.getName(D):E5(r,D)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var L=s.ensureState("emphasis");L.style=u,s.ensureState("select").style=d,s.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),Ea(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),o=Cr(this).dataIndex,s=i&&i.animation;if(this.silent=a.silent=!0,i&&i.fadeLabel){var l=a.getTextContent();l&&Qx(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();Qx(a,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:r,removeOpt:s})},e.getSymbolSize=function(r,n){return u5(r.getItemVisual(n,"symbolSize"))},e.getSymbolZ2=function(r,n){return r.getItemVisual(n,"z2")},e}(gr);function Mzr(t,e){this.parent.drift(t,e)}function VY(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 Zpt(t){return t!=null&&!yr(t)&&(t={isIgnore:t}),t||{}}function Jpt(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:Is(e),cursorStyle:e.get("cursor")}}function egt(t,e,r,n,i,a,o){var s=new t(e,r,n,i);return s.setPosition(a),e.setItemGraphicEl(r,s),o.add(s),s}var fB=function(){function t(e){this.group=new gr,this._SymbolCtor=e||dB}return t.prototype.updateData=function(e,r){this._progressiveEls=null,r=Zpt(r);var n=this.group,i=e.hostModel,a=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=this._seriesScope=Jpt(e),u={disableAnimation:s},h=r.getSymbolPoint||function(d){return e.getItemLayout(d)};a||n.removeAll(),e.diff(a).add(function(d){var f=h(d);VY(e,f,d,r)&&egt(o,e,d,l,u,f,n)}).update(function(d,f){var p=a.getItemGraphicEl(f),g=h(d);if(!VY(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 o(e,d,l,u),p.setPosition(g);else{p.updateData(e,d,l,u);var y={x:g[0],y:g[1]};s?p.attr(y):qn(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,o=i.count();a0?r=n[0]:n[1]<0&&(r=n[1]),r}function rgt(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,o=[];return o[a]=r.get(t.baseDim,n),o[1-a]=i,e.dataToPoint(o)}function up(t,e){return!isFinite(t)||!isFinite(e)}var Pzr=typeof Float32Array!==$_?Float32Array:void 0,Nzr=typeof Float64Array!==$_?Float64Array:void 0;function e0(t){return Xme({ctor:Pzr},t).arr}function Xme(t,e){var r=t.arr,n=t.ctor;if(e>c8&&(e=c8),!r||t.typed&&r.length=i||m<0)break;if(up(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(o>0){for(var A=m+a,S=e[A*2],T=e[A*2+1];S===y&&T===b&&v=n||up(S,T))p=y,g=b;else{E=S-u,_=T-h;var R=y-u,D=S-y,M=b-h,I=T-b,N=void 0,F=void 0;if(s==="x"){N=Math.abs(R),F=Math.abs(D);var B=E>0?1:-1;p=y-B*N*o,g=b,P=y+B*F*o,L=b}else if(s==="y"){N=Math.abs(M),F=Math.abs(I);var V=_>0?1:-1;p=y,g=b-V*N*o,P=y,L=b+V*F*o}else N=Math.sqrt(R*R+M*M),F=Math.sqrt(D*D+I*I),k=F/(F+N),p=y-E*o*(1-k),g=b-_*o*(1-k),P=y+E*o*k,L=b+_*o*k,P=Kx(P,Zx(S,y)),L=Kx(L,Zx(T,b)),P=Zx(P,Kx(S,y)),L=Zx(L,Kx(T,b)),E=P-y,_=L-b,p=y-E*N/F,g=b-_*N/F,p=Kx(p,Zx(u,y)),g=Kx(g,Zx(h,b)),p=Zx(p,Kx(u,y)),g=Zx(g,Kx(h,b)),E=y-p,_=b-g,P=y+E*F/N,L=b+_*F/N}t.bezierCurveTo(d,f,p,g,y,b),d=P,f=L}else t.lineTo(y,b)}u=y,h=b,m+=a}return v}var ngt=function(){function t(){this.smooth=0,this.smoothConstraint=!0}return t}(),Fzr=function(t){nt(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:tt.color.neutral99,fill:null}},e.prototype.getDefaultShape=function(){return new ngt},e.prototype.buildPath=function(r,n){var i=n.points,a=0,o=i.length/2;if(n.connectNulls){for(;o>0&&up(i[o*2-2],i[o*2-1]);o--);for(;a=0){var w=u?(g-l)*x+l:(p-s)*x+s;return u?[r,w]:[w,r]}s=p,l=g;break;case o.C:p=a[d++],g=a[d++],m=a[d++],v=a[d++],y=a[d++],b=a[d++];var A=u?SH(s,p,m,y,r,h):SH(l,g,v,b,r,h);if(A>0)for(var S=0;S=0){var w=u?rl(l,g,v,b,T):rl(s,p,m,y,T);return u?[r,w]:[w,r]}}s=y,l=b;break}}},e}(yn),zzr=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(ngt),igt=function(t){nt(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 zzr},e.prototype.buildPath=function(r,n){var i=n.points,a=n.stackedOnPoints,o=0,s=i.length/2,l=n.smoothMonotone;if(n.connectNulls){for(;s>0&&up(i[s*2-2],i[s*2-1]);s--);for(;o=0,a=t.fill||tt.color.neutral99;fgt(n,e);var o=n.textFill==null;return i?o&&(n.textFill=r.insideFill||tt.color.neutral00,!n.textStroke&&r.insideStroke&&(n.textStroke=r.insideStroke),!n.textStroke&&(n.textStroke=a),n.textStrokeWidth==null&&(n.textStrokeWidth=2)):(o&&(n.textFill=t.fill||r.outsideFill||tt.color.neutral00),!n.textStroke&&r.outsideStroke&&(n.textStroke=r.outsideStroke)),n.text=e.text,n.rich=e.rich,fe(e.rich,function(s){fgt(s,s)}),n}function fgt(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 pgt(t,e){if(t.length===e.length){for(var r=0;re){a?r.push(o(a,l,e)):i&&r.push(o(i,l,0),o(i,l,e));break}else i&&(r.push(o(i,l,0)),i=null),r.push(l),a=l}return r}function Qzr(t,e,r){var n=t.getVisual("visualMeta");if(!(!n||!n.length||!t.count())&&e.type==="cartesian2d"){for(var i,a,o=n.length-1;o>=0;o--){var s=t.getDimensionInfo(n[o].dimension);if(i=s&&s.coordDim,i==="x"||i==="y"){a=n[o];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=Vzr(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";fe(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 Gzr(t,e,r){var n=t.get("showAllSymbol"),i=n==="auto";if(!(n&&!i)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(i&&Hzr(a,e))){var o=e.mapDimension(a.dim),s={};return fe(a.getViewLabels(),function(l){l.tick.offInterval||(s[A5(a.scale,l.tick)]=1)}),function(l){return!s.hasOwnProperty(e.get(o,l))}}}}function Hzr(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)),o=0;on)return!1;return!0}function Wzr(t){for(var e=t.length/2;e>0&&up(t[e*2-2],t[e*2-1]);e--);return e-1}function ygt(t,e){return[t[e*2],t[e*2+1]]}function Yzr(t,e,r){for(var n=t.length/2,i=r==="x"?0:1,a,o,s=0,l=-1,u=0;u=e||a>=e&&o<=e){l=u;break}s=u,a=o}return{range:[s,l],t:(e-a)/(o-a)}}function bgt(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,Ea(g,M,I,N);var B=vgt(r.get("smooth")),V=r.get("smoothMonotone");if(g.setShape({smooth:B,smoothMonotone:V,connectNulls:T}),m){var z=s.getCalculationInfo("stackedOnSeries"),U=0;m.useStyle(mr(u.getAreaStyle(),{fill:P,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),z&&(U=vgt(z.get("smooth"))),m.setShape({smooth:B,stackedOnSmooth:U,smoothMonotone:V,connectNulls:T}),Ms(m,r,"areaStyle"),Cr(m).seriesIndex=r.seriesIndex,Ea(m,M,I,N)}var Q=this._changePolyState;s.eachItemGraphicEl(function(X){X&&(X.onHoverStateChange=Q)}),this._polyline.onHoverStateChange=Q,this._data=s,this._coordSys=a,this._stackedOnPoints=A,this._points=h,this._step=E,this._valueOrigin=x;var G=r.get("triggerEvent"),q=r.get("triggerLineEvent"),Y=q===!0||G===!0||G==="line",ne=q===!0||G===!0||G==="area";this.packEventData(r,g,Y),m&&this.packEventData(r,m,ne)},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 o=r.getData(),s=lS(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var h=l[s*2],d=l[s*2+1];if(up(h,d)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(h,d))return;var f=r.get("zlevel")||0,p=r.get("z")||0;u=new dB(o,s),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,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else ki.prototype.highlight.call(this,r,n,i,a)},e.prototype.downplay=function(r,n,i,a){var o=r.getData(),s=lS(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else ki.prototype.downplay.call(this,r,n,i,a)},e.prototype._changePolyState=function(r){var n=this._polygon;gW(this._polyline,r),n&&gW(n,r)},e.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new Fzr({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 igt({shape:{points:r,stackedOnPoints:n},segmentIgnoreThreshold:2}),this._lineGroup.add(i),this._polygon=i,i},e.prototype._initSymbolLabelAnimation=function(r,n,i){var a,o,s=n.getBaseAxis(),l=s.inverse;n.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):n.type==="polar"&&(a=s.dim==="angle",o=!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(o){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 C=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:C}),E&&E.animateFrom({style:{opacity:0}},{duration:300,delay:C}),k.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(r,n,i){var a=r.getModel("endLabel");if(bgt(r)){var o=r.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new $n({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var h=Wzr(l);h>=0&&(il(s,Is(r,"endLabel"),{inheritColor:i,labelFetcher:r,labelDataIndex:h,defaultText:function(d,f,p){return p!=null?Kpt(o,p):E5(o,d)},enableTextSetter:!0},qzr(a,n)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(r,n,i,a,o,s,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=s.get("precision"),m=s.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",C=Yzr(d,w,T),k=C.range,E=k[1]-k[0],_=void 0;if(E>=1){if(E>1&&!p){var P=ygt(d,k[0]);u.attr({x:P[0]+A,y:P[1]+S}),o&&(_=f.getRawValue(k[0]))}else{var P=h.getPointOn(w,T);P&&u.attr({x:P[0]+A,y:P[1]+S});var L=f.getRawValue(k[0]),R=f.getRawValue(k[1]);o&&(_=klt(i,g,L,R,C.t))}a.lastFrameIndex=k[0]}else{var D=r===1||a.lastFrameIndex>0?k[0]:0,P=ygt(d,D);o&&(_=f.getRawValue(D)),u.attr({x:P[0]+A,y:P[1]+S})}if(o){var M=K_(u);typeof M.setLabelText=="function"&&M.setLabelText(_)}}},e.prototype._doUpdateAnimation=function(r,n,i,a,o,s,l){var u=this._polyline,h=this._polygon,d=r.hostModel,f=$zr(this._data,r,this._stackedOnPoints,n,this._coordSys,i,this._valueOrigin),p=f.current,g=f.stackedOnCurrent,m=f.next,v=f.stackedOnNext;if(o&&(g=Jx(f.stackedOnCurrent,f.current,i,o,l),p=Jx(f.current,null,i,o,l),v=Jx(f.stackedOnNext,f.next,i,o,l),m=Jx(f.next,null,i,o,l)),mgt(p,m)>3e3||h&&mgt(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(),qn(u,y,d),h&&(h.setShape({points:p,stackedOnPoints:g}),h.stopAnimation(),qn(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&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),h=l.getExtent(),d=n.getDevicePixelRatio(),f=Math.abs(h[1]-h[0])*(d||1),p=Math.round(s/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;$t(a)?g=Xzr[a]:ur(a)&&(g=a),g&&e.setData(i.downSample(i.mapDimension(u.dim),1/p,g,Kzr))}}}}}function Zzr(t){t.registerChartView(jzr),t.registerSeriesModel(Lzr),t.registerLayout(vB("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,xgt("line"))}var wgt=function(t){nt(e,t);function e(r,n,i,a,o){var s=t.call(this,r,n,i)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}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}(cp),Jme=null;function Jzr(t){Jme||(Jme=t)}function yB(){return Jme}var QY="expandAxisBreak",Agt="collapseAxisBreak",Sgt="toggleAxisBreak",e0e="axisbreakchanged",eUr={type:QY,event:e0e,update:"update",refineEvent:t0e},tUr={type:Agt,event:e0e,update:"update",refineEvent:t0e},rUr={type:Sgt,event:e0e,update:"update",refineEvent:t0e};function t0e(t,e,r,n){var i=[];return fe(t,function(a){i=i.concat(a.eventBreaks)}),{eventContent:{breaks:i}}}function nUr(t){t.registerAction(eUr,e),t.registerAction(tUr,e),t.registerAction(rUr,e);function e(r,n){var i=[],a=M_(n,r);function o(s,l){fe(a[s],function(u){var h=u.updateAxisBreaks(r);fe(h.breaks,function(d){var f;i.push(mr((f={},f[l]=u.componentIndex,f),d))})})}return o("xAxisModels","xAxisIndex"),o("yAxisModels","yAxisIndex"),o("singleAxisModels","singleAxisIndex"),{eventBreaks:i}}}var e2=Math.PI,iUr=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],aUr=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],oT=Gr(),Tgt=Gr(),Cgt=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 oUr(t,e,r,n){var i=r.axis,a=e.ensureRecord(r),o=[],s,l=n0e(t.axisName)&&w5(t.nameLocation);fe(n,function(g){var m=Zm(g);if(!(!m||m.label.ignore)){o.push(m);var v=a.transGroup;l&&(v.transform?$d(bB,v.transform):WA(bB),m.transform&&Bd(bB,bB,m.transform),pr.copy(GY,m.localRect),GY.applyTransform(bB),s?s.union(GY):pr.copy(s=new pr(0,0,0,0),GY))}});var u=Math.abs(a.dirVec.x)>.1?"x":"y",h=a.transGroup[u];if(o.sort(function(g,m){return Math.abs(g.label[u]-h)-Math.abs(m.label[u]-h)}),l&&s){var d=i.getExtent(),f=Math.min(d[0],d[1]),p=Math.max(d[0],d[1])-f;s.union(new pr(f,0,p,1))}a.stOccupiedRect=s,a.labelInfoList=o}var bB=ka(),GY=new pr(0,0,0,0),Ogt=function(t,e,r,n,i,a){if(w5(t.nameLocation)){var o=a.stOccupiedRect;o&&kgt(B9r({},o,a.transGroup.transform),n,i)}else Egt(a.labelInfoList,a.dirVec,n,i)};function kgt(t,e,r){var n=new wr;PY(t,e,n,{direction:Math.atan2(r.y,r.x),bidirectional:!1,touchThreshold:.05})&&Eme(e,n)}function Egt(t,e,r,n){for(var i=wr.dot(n,e)>=0,a=0,o=t.length;a0?"top":"bottom",a="center"):oS(i-e2)?(o=n>0?"bottom":"top",a="center"):(o="middle",i>0&&i0?"right":"left":a=n>0?"left":"right"),{rotation:i,textAlign:a,textVerticalAlign:o}},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}(),sUr=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],lUr={axisLine:function(t,e,r,n,i,a,o){var s=n.get(["axisLine","show"]);if(s==="auto"&&(s=!0,t.raw.axisLineAutoShow!=null&&(s=!!t.raw.axisLineAutoShow)),!!s){var l=n.axis.getExtent(),u=a.transform,h=[l[0],0],d=[l[1],0],f=h[0]>d[0];u&&(io(h,h,u),io(d,d,u));var p=lt({lineCap:"round"},n.getModel(["axisLine","lineStyle"]).getLineStyle()),g={strokeContainThreshold:t.raw.strokeContainThreshold||5,silent:!0,z2:1,style:p};if(n.get(["axisLine","breakLine"])&&MW(n.axis.scale))yB().buildAxisBreakLine(n,i,a,g);else{var m=new Go(lt({shape:{x1:h[0],y1:h[1],x2:d[0],y2:d[1]}},g));j_(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"]);$t(v)&&(v=[v,v]),($t(y)||Vn(y))&&(y=[y,y]);var b=QS(n.get(["axisLine","symbolOffset"])||0,y),x=y[0],w=y[1];fe([{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=Yo(v[S],-x/2,-w/2,x,w,p.stroke,!0),C=A.r+A.offset,k=f?d:h;T.attr({rotation:A.rotate,x:k[0]+C*Math.cos(t.rotation),y:k[1]-C*Math.sin(t.rotation),silent:!0,z2:11}),i.add(T)}})}}},axisTickLabelEstimate:function(t,e,r,n,i,a,o,s){var l=Dgt(e,i,s);l&&_gt(t,e,r,n,i,a,o,vg.estimate)},axisTickLabelDetermine:function(t,e,r,n,i,a,o,s){var l=Dgt(e,i,s);l&&_gt(t,e,r,n,i,a,o,vg.determine);var u=dUr(t,i,a,n);hUr(t,e.labelLayoutList,u),fUr(t,i,a,n,t.tickDirection)},axisName:function(t,e,r,n,i,a,o,s){var l=r.ensureRecord(n);e.nameEl&&(i.remove(e.nameEl),e.nameEl=l.nameLayout=l.nameLocation=null);var u=t.axisName;if(n0e(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=ka();y.transform(xy(b,b,t.rotation));var x=n.get("nameRotate");x!=null&&(x=x*e2/180);var w,A;w5(h)?w=Bu.innerTextLayout(t.rotation,x??t.rotation,d):(w=cUr(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)||{},C=T.ellipsis,k=Gc(t.raw.nameTruncateMaxWidth,T.maxWidth,A),E=s.nameMarginLevel||0,_=new $n({x:v.x,y:v.y,rotation:w.rotation,silent:Bu.isLabelSilent(n),style:ji(f,{text:u,font:S,overflow:"truncate",width:k,ellipsis:C,fill:f.getTextColor()||n.get(["axisLine","lineStyle","color"]),align:f.get("align")||w.textAlign,verticalAlign:f.get("verticalAlign")||w.textVerticalAlign}),z2:1});if(Ly({el:_,componentModel:n,itemName:u}),_.__fullText=u,_.anid="name",n.get("triggerEvent")){var P=Bu.makeAxisEventDataBase(n);P.targetType="axisName",P.name=u,Cr(_).eventData=P}a.add(_),_.updateTransform(),e.nameEl=_;var L=l.nameLayout=Zm({label:_,priority:_.z2,defaultAttr:{ignore:_.ignore},marginDefault:w5(h)?iUr[E]:aUr[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 _gt(t,e,r,n,i,a,o,s){Lgt(e)||pUr(t,e,i,s,n,o);var l=e.labelLayoutList;gUr(t,n,l,a),yUr(n,t.rotation,l);var u=t.optionHideOverlap;uUr(n,l,u),u&&ppt(oi(l,function(h){return h&&!h.label.ignore})),oUr(t,r,n,l)}function cUr(t,e,r,n){var i=Dfe(r-t),a,o,s=n[0]>n[1],l=e==="start"&&!s||e!=="start"&&s;return oS(i-e2/2)?(o=l?"bottom":"top",a="center"):oS(i-e2*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",ie2/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:o}}function uUr(t,e,r){var n=t.axis,i=t.get(["axisLabel","customValues"]);if(SFr(n))return;function a(u,h,d){var f=Zm(e[h]),p=Zm(e[d]),g=n.scale;if(!(!f||!p)){if(u==null){if(!r&&i)return;var m=oT(f.label).labelInfo.tick;if(J8(g)&&m.notNice||Xc(g)&&m.offInterval){R5(f.label);return}}if(u===!1||f.suggestIgnore){R5(f.label);return}if(p.suggestIgnore){R5(p.label);return}var v=.1;if(!r){var y=[0,0,0,0];f=_me({marginForce:y},f),p=_me({marginForce:y},p)}PY(f,p,null,{touchThreshold:v})&&R5(u?p.label:f.label)}}var o=t.get(["axisLabel","showMinLabel"]),s=t.get(["axisLabel","showMaxLabel"]),l=e.length;a(o,0,1),a(s,l-1,l-2)}function hUr(t,e,r){t.showMinorTicks||fe(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))&&(o=!0),p+=A.count()}),(!i||i.keys().length!==n.keys().length)&&(o=!0),!o&&a!=null){e.liPosMinGap=a;return}Xme(sT,p);var g=0;f(function(x,w,A){for(var S=0,T=A.count();S0&&b0?Lft:kFr,r.serUids=n}var sT=Xme({ctor:Nzr},50);function WY(t){return function(e,r){var n=mc(e,{fromStat:{key:t}});if(ep(n.w2))return[-n.w2/2,n.w2/2]}}function lT(t){return t+OY}function cT(t,e){return t+OY+e}function i0e(t){return TUr(),{liPosMinGap:!Xc(t.scale)}}var t0="bar",xB="pictorialBar";function Mgt(t,e,r,n){vme(t,{key:e,seriesType:r,coordSysType:n,getMetrics:i0e})}function Igt(t){var e=t.scale.rawExtentInfo.makeRenderInfo().startValue;return e}var Pgt={left:0,right:0,top:0,bottom:0},YY=["25%","25%"],xg="cartesian2d",OUr=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.mergeDefaultAndTheme=function(r,n){var i=PS(r.outerBounds);t.prototype.mergeDefaultAndTheme.apply(this,arguments),i&&r.outerBounds&&qm(r.outerBounds,i)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&r.outerBounds&&qm(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:Pgt,outerBoundsContain:"all",outerBoundsClampWidth:YY[0],outerBoundsClampHeight:YY[1],backgroundColor:tt.color.transparent,borderWidth:1,borderColor:tt.color.neutral30},e}(pn),kUr=P_(),a0e="__ec_stack_";function Ngt(t){return t.get("stack")||a0e+t.seriesIndex}function EUr(t){if(Xc(t.axis.scale)){for(var e=mc(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=rn(h,0);var d=0,f;fe(o,function(m){var v=s[m];v.width||(v.width=h),f=v,d+=v.width*(1+u)}),f&&(d-=f.width*u);var p={},g=-d/2;return fe(o,function(m){var v=s[m];p[m]=p[m]||{bandWidth:e,offset:g,width:v.width},g+=v.width*(1+u)}),p}function $gt(t){return{seriesType:t,overallReset:function(e){var r=cT(t,xg);gme(e,r,function(n){var i=_Ur(n,t);jS(n,r,function(a){var o=i.columnMap[Ngt(a)];a.getData().setLayout({bandWidth:o.bandWidth,offset:o.offset,size:o.width})})})}}}function Fgt(t){return{seriesType:t,plan:US(),reset:function(e){if(bUr(e)){var r=e.getData(),n=e.coordinateSystem,i=n.getBaseAxis(),a=n.getOtherAxis(i),o=r.getDimensionIndex(r.mapDimension(a.dim)),s=r.getDimensionIndex(r.mapDimension(i.dim)),l=e.get("showBackground",!0),u=r.mapDimension(a.dim),h=r.getCalculationInfo("stackResultDimension"),d=Ny(r,u)&&!!r.getCalculationInfo("stackedOnSeries"),f=a.isHorizontal(),p=a.toGlobalCoord(a.dataToCoord(Igt(a))),g=zgt(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&&e0(A*3),T=g&&l&&e0(A*3),C=g&&e0(A),k=n.master.getRect(),E=f?k.width:k.height,_,P=w.getStore(),L=0;(_=x.next())!=null;){var R=P.get(d?v:o,_),D=P.get(s,_),M=p,I=void 0;d&&(I=+R-P.get(o,_));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([I,D])[0]),N=M,F=z[1]+b,B=z[0]-M,V=y,ao(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),s[p]=f.toGlobalCoord(x)}});else{var l=this.getData(),u=l.getLayout("offset"),h=l.getLayout("size"),d=a.getBaseAxis().isHorizontal()?0:1;s[d]+=u+h/2}return s}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}(Ii);Ii.registerClass(wB);var LUr=function(t){nt(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 jm(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=Rlt(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."+t0,e.dependencies=["grid","polar"],e.defaultOption=Hx(wB.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:tt.color.primary,borderWidth:2}},realtimeSort:!1}),e}(wB),MUr=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}(),qY=function(t){nt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="sausage",n}return e.prototype.getDefaultShape=function(){return new MUr},e.prototype.buildPath=function(r,n){var i=n.cx,a=n.cy,o=Math.max(n.r0||0,0),s=Math.max(n.r,0),l=(s-o)*.5,u=o+l,h=n.startAngle,d=n.endAngle,f=n.clockwise,p=Math.PI*2,g=f?d-hMath.PI/2&&hs)return!0;s=d}return!1},e.prototype._isOrderDifferentInView=function(r,n){for(var i=n.scale,a=i.getExtent(),o=Math.max(0,a[0]),s=Math.min(a[1],i.getOrdinalMeta().categories.length-1);o<=s;++o)if(r.ordinalNumbers[o]!==i.getRawOrdinalNumber(o))return!0},e.prototype._updateSortWithinSameData=function(r,n,i,a){if(this._isOrderChangedWithinSameData(r,n,i)){var o=this._dataSort(r,i,n);this._isOrderDifferentInView(o,i)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",axisId:i.index,sortInfo:o}))}},e.prototype._dispatchInitSort=function(r,n,i){var a=n.baseAxis,o=this._dataSort(r,a,function(s){return r.get(r.mapDimension(n.otherAxis.dim),s)});i.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:o})},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){Dy(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=t0,e}(ki),Vgt={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,o=o0e(e.x,t.x),s=s0e(e.x+e.width,i),l=o0e(e.y,t.y),u=s0e(e.y+e.height,a),h=si?s:o,e.y=d&&l>a?u:l,e.width=h?0:s-o,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=s0e(e.r,t.r),a=o0e(e.r0,t.r0);e.r=i,e.r0=a;var o=i-a<0;if(r<0){var n=e.r;e.r=e.r0,e.r0=n}return o}},Qgt={cartesian2d:function(t,e,r,n,i,a,o,s,l){var u=new nn({shape:lt({},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,o,s,l){var u=!i&&l?qY:fc,h=new u({shape:n,z2:1});h.name="item";var d=Ygt(i);if(h.calculateTextPosition=IUr(d,{isRoundCap:u===qY}),a){var f=h.shape,p=i?"r":"endAngle",g={};f[p]=i?n.r0:n.startAngle,g[p]=n[p],(s?qn:ua)(h,{shape:g},a)}return h}};function BUr(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 Ggt(t,e,r,n,i,a,o,s){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}),s||(o?qn:ua)(r,{shape:l},e,i,null);var h=e?t.baseAxis.model:null;(o?qn:ua)(r,{shape:u},h,i)}function Hgt(t,e){for(var r=0;r0?1:-1,o=n.height>0?1:-1;return{x:n.x+a*i/2,y:n.y+o*i/2,width:n.width-a*i,height:n.height-o*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 zUr(t){return t.startAngle!=null&&t.endAngle!=null&&t.startAngle===t.endAngle}function Ygt(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 qgt(t,e,r,n,i,a,o,s){var l=e.getItemVisual(r,"style");if(s){if(!a.get("roundCap")){var h=t.shape,d=r0(n.getModel("itemStyle"),h,!0);lt(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=s?o?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":o?HUr(i,a.coordinateSystem):WUr(i,a.coordinateSystem),g=Is(n);il(t,g,{labelFetcher:a,labelDataIndex:r,defaultText:E5(a.getData(),r),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:p});var m=t.getTextContent();if(s&&m){var v=n.get(["label","position"]);t.textConfig.inside=v==="middle"?!0:null,PUr(t,v==="outside"?p:v,Ygt(o),n.get(["label","rotate"]))}hut(m,g,a.getRawValue(r),function(b){return Kpt(e,b)});var y=n.getModel(["emphasis"]);Ea(t,y.get("focus"),y.get("blurScope"),y.get("disabled")),Ms(t,n),zUr(i)&&(t.style.fill="none",t.style.stroke="none",fe(t.states,function(b){b.style&&(b.style.fill=b.style.stroke="none")}))}function UUr(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 VUr=function(){function t(){}return t}(),jgt=function(t){nt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="largeBar",n}return e.prototype.getDefaultShape=function(){return new VUr},e.prototype.buildPath=function(r,n){for(var i=n.points,a=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,h=0;h=0?r:null},30,!1);function QUr(t,e,r){for(var n=t.baseDimIdx,i=1-n,a=t.shape.points,o=t.largeDataIndices,s=[],l=[],u=t.barWidth,h=0,d=a.length/3;h=s[0]&&e<=s[0]+l[0]&&r>=s[1]&&r<=s[1]+l[1])return o[h]}return-1}function Zgt(t,e,r){if(aT(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 GUr(t,e,r){var n=t.type==="polar"?fc:nn;return new n({shape:Zgt(e,r,t),silent:!0,z2:0})}function HUr(t,e){if(t.height===0){var r=e.getOtherAxis(e.getBaseAxis());return r.inverse?"bottom":"top"}return t.height>0?"bottom":"top"}function WUr(t,e){if(t.width===0){var r=e.getOtherAxis(e.getBaseAxis());return r.inverse?"left":"right"}return t.width>=0?"right":"left"}function YUr(t){t.registerChartView(NUr),t.registerSeriesModel(LUr),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,$gt(t0)),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,Fgt(t0)),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,xgt(t0)),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)})}),Ugt(t)}function AB(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 o=i.getName(a),s=0;s=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}(),t2="pie",qUr=Gr(),Jgt=function(t){nt(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 L5(Wt(this.getData,this),Wt(this.getRawData,this)),this._defaultLabelLine(r)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return D5(this,{coordDimensions:["value"],encodeDefaulter:Kr(sge,this)})},e.prototype.getDataParams=function(r){var n=this.getData(),i=qUr(n),a=i.seats;if(!a){var o=[];n.each(n.mapDimension("value"),function(l){o.push(l)}),a=i.seats=glt(o,n.hostModel.get("percentPrecision"))}var s=t.prototype.getDataParams.call(this,r);return s.percent=a[r]||0,s.$vars.push("percent"),s},e.prototype._defaultLabelLine=function(r){sS(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."+t2,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}(Ii);Q8r({fullType:Jgt.type,getCoord2:function(t){return t.getShallow("center")}});var jUr=Math.PI/180;function emt(t,e,r,n,i,a,o,s,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,C=Math.abs(S)t.unconstrainedWidth?null:f:null;n.setStyle("width",p)}rmt(a,n)}}}function rmt(t,e){nmt.rect=t,dpt(nmt,e,KUr)}var KUr={minMarginForce:[null,0,null,0],marginDefault:[1,0,1,0]},nmt={};function l0e(t){return t.position==="center"}function ZUr(t){var e=t.getData(),r=[],n,i,a=!1,o=(t.get("minShowLabelAngle")||0)*jUr,s=e.getLayout("viewRect"),l=e.getLayout("r"),u=s.width,h=s.x,d=s.y,f=s.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),C=T.shape,k=T.getTextContent(),E=T.getTextGuideLine(),_=e.getItemModel(S),P=_.getModel("label"),L=P.get("position")||_.get(["emphasis","label","position"]),R=P.get("distanceToLabelLine"),D=P.get("alignTo"),M=Qt(P.get("edgeDistance"),u),I=P.get("bleedMargin");I==null&&(I=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(C.endAngle-C.startAngle)0?"right":"left":z>0?"left":"right"}var Ce=Math.PI,ke=0,Ee=P.get("rotate");if(Vn(Ee))ke=Ee*(Ce/180);else if(L==="center")ke=0;else if(Ee==="radial"||Ee===!0){var ue=z<0?-V+Ce:-V;ke=ue}else if(Ee==="tangential"||Ee==="tangential-noflip"&&L!=="outside"&&L!=="outer"){var de=Math.atan2(z,U);de<0&&(de=Ce*2+de);var xe=U>0;xe&&Ee!=="tangential-noflip"&&(de=Ce+de),ke=de-Ce}if(a=!!ke,k.x=Q,k.y=G,k.rotation=ke,k.setStyle({verticalAlign:"middle"}),ne){k.setStyle({align:Y});var ze=k.states.select;ze&&(ze.x+=k.x,ze.y+=k.y)}else{var ge=new pr(0,0,0,0);rmt(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:q,textAlign:Y,labelDistance:R,labelAlignTo:D,edgeDistance:M,bleedMargin:I,rect:ge,unconstrainedWidth:ge.width,labelStyleWidth:k.style.width})}T.setTextConfig({inside:ne})}}),!a&&t.get("avoidLabelOverlap")&&XUr(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(I,{angle:N,startAngle:B,endAngle:V,clockwise:x,cx:o,cy:s,r0:u,r:w?Zn(M,S,[u,l]):l}),R=F}),P0){for(var h=o.getItemLayout(0),d=1;isNaN(h&&h.startAngle)&&d=a.r0}},e.type=t2,e}(ki);function nVr(t){return{seriesType:t,reset:function(e,r){var n=e.getData();n.filterSelf(function(i){var a=n.mapDimension("value"),o=n.get(a,i);return!(Vn(o)&&!isNaN(o)&&o<0)})}}}function iVr(t){t.registerChartView(rVr),t.registerSeriesModel(Jgt),udt(t2,t.registerAction),t.registerLayout(JUr),t.registerProcessor(AB(t2)),t.registerProcessor(nVr(t2))}var aVr=function(t){nt(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 jm(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:tt.color.primary}},universalTransition:{divideShape:"clone"}},e}(Ii),omt=4,oVr=function(){function t(){}return t}(),sVr=function(t){nt(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 oVr},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,o=this.symbolProxy,s=o.shape,l=r.getContext?r.getContext():r,u=l&&a[0]=0;u--){var h=u*2,d=a[h]-s/2,f=a[h+1]-l/2;if(r>=d&&n>=f&&r<=d+s&&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 o=this.hoverDataIdx=this.findDataIndex(r,n);return o>=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,o=a[0],s=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}(),cVr=function(t){nt(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(),o=this._updateSymbolDraw(a,r);o.updateData(a,c0e(r)),this._finished=!0},e.prototype.incrementalPrepareRender=function(r,n,i){var a=r.getData(),o=this._updateSymbolDraw(a,r);o.incrementalPrepareUpdate(a),this._finished=!1},e.prototype.incrementalRender=function(r,n,i){this._symbolDraw.incrementalUpdate(r,n.getData(),$m(n),c0e(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 o=vB("").reset(r,n,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(c0e(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,o=a.large;return(!i||o!==this._isLargeDraw)&&(i&&i.remove(),i=this._symbolDraw=o?new lVr:new fB,this._isLargeDraw=o,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}(ki);function c0e(t){return{clipShape:sgt(t)}}var u0e=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",xo).models[0]},e.type="cartesian2dAxis",e}(pn);Qo(u0e,S5);var smt={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:tt.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:tt.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:tt.color.axisSplitLine,width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:[tt.color.backgroundTint,tt.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:tt.color.neutral00,borderColor:tt.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:"auto"}},uVr=Qr({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},smt),h0e=Qr({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:tt.color.axisMinorSplitLine,width:1}}},smt),hVr=Qr({splitNumber:6,axisLabel:{rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},h0e),dVr=mr({logBase:10},h0e);const lmt={category:uVr,value:h0e,time:hVr,log:dVr};function M5(t,e,r,n){fe(Eft,function(i,a){var o=Qr(Qr({},lmt[a],!0),n,!0),s=function(l){nt(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=I8(this),p=f?PS(h):{},g=d.getTheme();Qr(h,g.get(a+"Axis")),Qr(h,this.getDefaultOption()),h.type=cmt(h),f&&qm(h,p,f)},u.prototype.optionUpdated=function(){var h=this.option;h.type==="category"&&(this.__ordinalMeta=X8.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=yB();return d?d.updateModelAxisBreak(this,h):{breaks:[]}},u.type=e+"Axis."+a,u.defaultOption=o,u}(r);t.registerComponentModel(s)}),t.registerSubTypeDefaulter(e+"Axis",cmt)}function cmt(t){return t.type||(t.data?"category":"value")}var fVr=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(),oi(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}(),JY=["x","y"];function umt(t){return(t.type==="interval"||t.type==="time")&&!MW(t)}var pVr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=xg,r.dimensions=JY,r}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!umt(r)||!umt(n))){var i=vY(r,null),a=vY(n,null),o=this.dataToPoint([i[0],a[0]]),s=this.dataToPoint([i[1],a[1]]),l=i[1]-i[0],u=a[1]-a[0];if(!(!l||!u)){var h=(s[0]-o[0])/l,d=(s[1]-o[1])/u,f=o[0]-i[0]*h,p=o[1]-a[0]*d,g=this._transform=[h,0,0,d,f,p];this._invTransform=$d([],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),o=this.getArea(),s=new pr(i[0],i[1],a[0]-i[0],a[1]-i[1]);return o.intersect(s)},e.prototype.dataToPoint=function(r,n,i){i=i||[];var a=r[0],o=r[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return io(i,r,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return i[0]=s.toGlobalCoord(s.dataToCoord(a,n)),i[1]=l.toGlobalCoord(l.dataToCoord(o,n)),i},e.prototype.clampData=function(r,n){var i=this.getAxis("x").scale,a=this.getAxis("y").scale,o=i.getExtent(),s=a.getExtent(),l=i.parse(r[0]),u=a.parse(r[1]);return n=n||[],n[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),n[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),n},e.prototype.pointToData=function(r,n,i){if(i=i||[],this._invTransform)return io(i,r,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return i[0]=a.coordToData(a.toLocalCoord(r[0]),n),i[1]=o.coordToData(o.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,o=Math.min(i[0],i[1])-r,s=Math.max(n[0],n[1])-a+r,l=Math.max(i[0],i[1])-o+r;return new pr(a,o,s,l)},e}(fVr);function hmt(t,e){var r=t.scale,n=t.model,i=Vft(r,n,n.ecModel,t,null),a=b5(r),o=b5(e)?e.intervalStub:e,s=a?r.intervalStub:r,l=r.base,u=o.getTicks(),h=o.getTicks({expandToNicedExtent:!0}),d=u.length-1,f,p,g;if(d===1)f=p=0,g=1;else if(d===2){var m=ao(u[0].value-u[1].value),v=ao(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=Yn(P-E*g,_),D(),C<=T[0])return!0})):R(function(){L=Yn(rS(T[0]/E)*E,_),P=Yn(Jf(T[1]/E)*E,_);var z=Im((P-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 q=Jf(U/2);Q=U%2===0?[q,q]:C+k=T[1])return!0}})}Dft(r,w,S,[C,k],A,{interval:E,intervalCount:g,intervalPrecision:_,niceExtent:[L,P]})}var dmt=[[3,1],[0,2]],gVr=function(){function t(e,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=JY,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;fe(this._axesList,function(o){KS(o,C5);var s=o.scale;Xc(s)&&s.setSortInfo(o.model.get("categorySortInfo"))});function i(o){for(var s=En(o),l=[],u=s.length-1;u>=0;u--){var h=o[+s[u]];h.__alignTo?l.push(h):O5(h)}fe(l,function(d){vVr(d,d.__alignTo)?O5(d):hmt(d,d.__alignTo.scale)})}i(n.x),i(n.y);var a={};fe(n.x,function(o){fmt(n,"y",o,a)}),fe(n.y,function(o){fmt(n,"x",o,a)}),this.resize(this.model,r)},t.prototype.resize=function(e,r,n){var i=Ps(e,r),a=this._rect=ba(e.getBoxLayoutParams(),i.refContainer),o=this._axesMap,s=this._coordsList,l=e.get("containLabel");if(d0e(o,a),!n){var u=xVr(a,s,o,l,r),h=void 0;if(l)f0e?(f0e(this._axesList,a),d0e(o,a)):h=vmt(a.clone(),"axisLabel",null,a,o,u,i);else{var d=wVr(e,a,i),f=d.outerBoundsRect,p=d.parsedOuterBoundsContain,g=d.outerBoundsClamp;f&&(h=vmt(f,p,g,a,o,u,i))}ymt(a,o,vg.determine,null,h,i),fe(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]];yft(a.scale)&&Rft(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&&fe(n,function(o){o.__alignTo=r})}function vVr(t,e){return MW(t.scale)||MW(e.scale)||e.scale.getTicks().length<2}function yVr(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 d0e(t,e){fe(t.x,function(r){return mmt(r,e.x,e.width)}),fe(t.y,function(r){return mmt(r,e.y,e.height)})}function mmt(t,e,r){var n=[0,r],i=t.inverse?1:0;t.setExtent(n[i],n[1-i]),yVr(t,e)}var f0e;function bVr(t){f0e=t}function vmt(t,e,r,n,i,a,o){ymt(n,i,vg.estimate,e,!1,o);var s=[0,0,0,0];u(0),u(1),h(n,0,NaN),h(n,1,NaN);var l=py(s,function(f){return f>0})==null;return ES(n,s,!0,!0,r),d0e(i,n),l;function u(f){fe(i[Mr[f]],function(p){if(nB(p.model)){var g=a.ensureRecord(p.model),m=g.labelInfoList;if(m)for(var v=0;v0&&!cc(p)&&p>1e-4&&(f/=p),f}}function xVr(t,e,r,n,i){var a=new Cgt(AVr);return fe(r,function(o){return fe(o,function(s){if(nB(s.model)){var l=!n;s.axisBuilder=wUr(t,e,s.model,i,a,l)}})}),a}function ymt(t,e,r,n,i,a){var o=r===vg.determine;fe(e,function(u){return fe(u,function(h){nB(h.model)&&(AUr(h.axisBuilder,t,h.model),h.axisBuilder.build(o?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:i}))})});var s={x:0,y:0};l(0),l(1);function l(u){s[Mr[1-u]]=t[_o[u]]<=a.refContainer[_o[u]]*.5?0:1-u===1?2:1}fe(e,function(u,h){return fe(u,function(d){nB(d.model)&&((n==="all"||o)&&d.axisBuilder.build({axisName:!0},{nameMarginLevel:s[h]}),o&&d.axisBuilder.build({axisLine:!0}))})})}function wVr(t,e,r){var n,i=t.get("outerBoundsMode",!0);i==="same"?n=e.clone():(i==null||i==="auto")&&(n=ba(t.get("outerBounds",!0)||Pgt,r.refContainer));var a=t.get("outerBoundsContain",!0),o;a==null||a==="auto"||Nr(["all","axisLabel"],a)<0?o="all":o=a;var s=[qH(Jt(t.get("outerBoundsClampWidth",!0),YY[0]),e.width),qH(Jt(t.get("outerBoundsClampHeight",!0),YY[1]),e.height)];return{outerBoundsRect:n,parsedOuterBoundsContain:o,outerBoundsClamp:s}}var AVr=function(t,e,r,n,i,a){var o=r.axis.dim==="x"?"y":"x";Ogt(t,e,r,n,i,a),w5(t.nameLocation)||fe(e.recordMap[o],function(s){s&&s.labelInfoList&&s.dirVec&&Egt(s.labelInfoList,s.dirVec,n,i)})};function SVr(t,e){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return TVr(r,t,e),r.seriesInvolved&&OVr(r,t),r}function TVr(t,e,r){var n=e.getComponent("tooltip"),i=e.getComponent("axisPointer"),a=i.get("link",!0)||[],o=[];fe(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=SB(s.model),u=t.coordSysAxesInfo[l]={};t.coordSysMap[l]=s;var h=s.model,d=h.getModel("tooltip",n);if(fe(s.getAxes(),Kr(m,!1,null)),s.getTooltipAxes&&n&&d.get("show")){var f=d.get("trigger")==="axis",p=d.get(["axisPointer","type"])==="cross",g=s.getTooltipAxes(d.get(["axisPointer","axis"]));(f||p)&&fe(g.baseAxes,Kr(m,p?"cross":!0,f)),p&&fe(g.otherAxes,Kr(m,"cross",!1))}function m(v,y,b){var x=b.model.getModel("axisPointer",i),w=x.get("show");if(!(!w||w==="auto"&&!v&&!m0e(x))){y==null&&(y=x.get("triggerTooltip")),x=v?CVr(b,d,i,e,v,y):x;var A=x.get("snap"),S=x.get("triggerEmphasis"),T=SB(b.model),C=y||A||b.type==="category",k=t.axesInfo[T]={key:T,axis:b,coordSys:s,axisPointerModel:x,triggerTooltip:y,triggerEmphasis:S,involveSeries:C,snap:A,useHandle:m0e(x),seriesModels:[],linkGroup:null};u[T]=k,t.seriesInvolved=t.seriesInvolved||C;var E=kVr(a,b);if(E!=null){var _=o[E]||(o[E]={axesInfo:{}});_.axesInfo[T]=k,_.mapper=a[E].mapper,k.linkGroup=_}}}})}function CVr(t,e,r,n,i,a){var o=e.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};fe(s,function(f){l[f]=lr(o.get(f))}),l.snap=t.type!=="category"&&!!a,o.get("type")==="cross"&&(l.type="line");var u=l.label||(l.label={});if(u.show==null&&(u.show=!1),i==="cross"){var h=o.get(["label","show"]);if(u.show=h??!0,!a){var d=l.lineStyle=o.get("crossStyle");d&&mr(u,d.textStyle)}}return t.model.getModel("axisPointer",new bn(l,r,n))}function OVr(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||fe(t.coordSysAxesInfo[SB(n.model)],function(o){var s=o.axis;n.getAxis(s.dim)===s&&(o.seriesModels.push(r),o.seriesDataCount==null&&(o.seriesDataCount=0),o.seriesDataCount+=r.getData().count())})})}function kVr(t,e){for(var r=e.model,n=e.dim,i=0;i=0||t===e}function EVr(t){var e=g0e(t);if(e){var r=e.axisPointerModel,n=e.axis.scale,i=r.option,a=r.get("status"),o=r.get("value");o!=null&&(o=n.parse(o));var s=m0e(r);a==null&&(i.status=s?"show":"hide");var l=n.getExtent();(o==null||o>l[1])&&(o=l[1]),o0;return o&&s}var NVr=Gr();function Omt(t,e,r,n){if(t instanceof wgt){var i=t.scale.type;if(i!=="ordinal")return r}var a=t.model,o=a.get("jitter");if(!(o>0))return r;var s=a.get("jitterOverlap"),l=a.get("jitterMargin")||0,u=Xc(t.scale)?mc(t).w:null;return s?kmt(r,o,u,n):BVr(t,e,r,n,o,l)}function kmt(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 BVr(t,e,r,n,i,a){var o=NVr(t);o.items||(o.items=[]);var s=o.items,l=Emt(s,e,r,n,i,a,1),u=Emt(s,e,r,n,i,a,-1),h=Math.abs(l-r)i/2||d&&f>d/2-n?kmt(r,i,d,n):(s.push({fixedCoord:e,floatCoord:h,r:n}),h)}function Emt(t,e,r,n,i,a,o){for(var s=r,l=0;li/2)return Number.MAX_VALUE;if(o===1&&g>s||o===-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=Qr(lr(m),{boundaryGap:r,splitNumber:n,clockwise:i,scale:a,axisLine:o,axisTick:s,axisLabel:l,name:m.text,showName:h,nameLocation:"end",nameGap:f,nameTextStyle:v,triggerEvent:p},!1);if($t(d)){var b=y.name;y.name=d.replace("{value}",b??"")}else ur(d)&&(y.name=d(y.name,y));var x=new bn(y,null,this.ecModel);return Qo(x,S5.prototype),x.mainType="radar",x.componentIndex=this.componentIndex,x.uid=DS("ec_radar"),x},this);this._indicatorModels=g},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type=_mt,e.defaultOption={z:0,center:["50%","50%"],radius:"50%",startAngle:90,clockwise:!1,axisName:{show:!0,color:tt.color.axisLabel},boundaryGap:[0,0],splitNumber:Rmt,axisNameGap:15,scale:!1,shape:"polygon",axisLine:Qr({lineStyle:{color:tt.color.neutral20}},CB.axisLine),axisLabel:rq(CB.axisLabel,!1),axisTick:rq(CB.axisTick,!1),splitLine:rq(CB.splitLine,!0),splitArea:rq(CB.splitArea,!0),indicator:[]},e}(pn),WVr=function(t){nt(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(),o=vt(a,function(s){var l=s.model.get("showName")?s.name:"",u=new Bu(s.model,n,{axisName:l,position:[i.cx,i.cy],rotation:s.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return u});fe(o,function(s){s.build(),this.group.add(s.group)},this)},e.prototype._buildSplitLineAndArea=function(r){var n=r.coordinateSystem,i=n.getIndicatorAxes();if(!i.length)return;var a=r.get("shape"),o=r.getModel("splitLine"),s=r.getModel("splitArea"),l=o.getModel("lineStyle"),u=s.getModel("areaStyle"),h=o.get("show"),d=s.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,I){var N=I%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:o>1?1.2:1.1,h=a>0?u:1/u;this._checkTriggerMoveZoom(this,"zoom","zoomOnMouseWheel",r,{scale:h,originX:s,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:s,originY:l,isAvailableBehavior:null})}}}},e.prototype._pinchHandler=function(r){if(!(Mmt(this._zr,"globalPan")||kB(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,o){r._checkPointer(a,o.originX,o.originY)&&(by(a.event),a.__ecRoamConsumed=!0,Pmt(r,n,i,a,o))},e}(qf);function kB(t){return t.__ecRoamConsumed}var rQr=Gr();function nq(t){var e=rQr(t);return e.roam=e.roam||{},e.uniform=e.uniform||{},e}function EB(t,e,r,n){for(var i=nq(t),a=i.roam,o=a[e]=a[e]||[],s=0;s=4&&(h={x:parseFloat(f[0]||0),y:parseFloat(f[1]||0),width:parseFloat(f[2]),height:parseFloat(f[3])})}if(h&&s!=null&&l!=null&&(d=Wmt(h,{x:0,y:0,width:s,height:l}),!r.ignoreViewBox)){var p=i;i=new gr,i.add(p),p.scaleX=p.scaleY=d.scale,p.x=d.x,p.y=d.y}return!r.ignoreRootClip&&s!=null&&l!=null&&i.setClipPath(new nn({shape:{x:0,y:0,width:s,height:l}})),{root:i,width:s,height:l,viewBoxRect:h,viewBoxTransform:d,named:a}},t.prototype._parseNode=function(e,r,n,i,a,o){var s=e.nodeName.toLowerCase(),l,u=i;if(s==="defs"&&(a=!0),s==="text"&&(o=!0),s==="defs"||s==="switch")l=r;else{if(!a){var h=x0e[s];if(h&&Kt(x0e,s)){l=h.call(this,e,r);var d=e.getAttribute("name");if(d){var f={name:d,namedFrom:null,svgNodeTagLower:s,el:l};n.push(f),s==="g"&&(u=f)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:l});r.add(l)}}var p=Fmt[s];if(p&&Kt(Fmt,s)){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,o):v.nodeType===3&&o&&this._parseText(v,l),v=v.nextSibling},t.prototype._parseText=function(e,r){var n=new N_({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});hp(r,n),Wd(e,n,this._defsUsePending,!1,!1),oQr(n,r);var i=n.style,a=i.fontSize;a&&a<9&&(i.fontSize=9,n.scaleX*=a/9,n.scaleY*=a/9);var o=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=o;var s=n.getBoundingRect();return this._textX+=s.width,r.add(n),n},t.internalField=function(){x0e={g:function(e,r){var n=new gr;return hp(r,n),Wd(e,n,this._defsUsePending,!1,!1),n},rect:function(e,r){var n=new nn;return hp(r,n),Wd(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 Wm;return hp(r,n),Wd(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 Go;return hp(r,n),Wd(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 b8;return hp(r,n),Wd(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=Vmt(n));var a=new pc({shape:{points:i||[]},silent:!0});return hp(r,a),Wd(e,a,this._defsUsePending,!1,!1),a},polyline:function(e,r){var n=e.getAttribute("points"),i;n&&(i=Vmt(n));var a=new Ll({shape:{points:i||[]},silent:!0});return hp(r,a),Wd(e,a,this._defsUsePending,!1,!1),a},image:function(e,r){var n=new nl;return hp(r,n),Wd(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",o=e.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(a),this._textY=parseFloat(i)+parseFloat(o);var s=new gr;return hp(r,s),Wd(e,s,this._defsUsePending,!1,!0),s},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",o=e.getAttribute("dy")||"0",s=new gr;return hp(r,s),Wd(e,s,this._defsUsePending,!1,!0),this._textX+=parseFloat(a),this._textY+=parseFloat(o),s},path:function(e,r){var n=e.getAttribute("d")||"",i=$ct(n);return hp(r,i),Wd(e,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),t}(),Fmt={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 zmt(t,a),Umt(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 Tpe(e,r,n);return zmt(t,i),Umt(t,i),i}};function zmt(t,e){var r=t.getAttribute("gradientUnits");r==="userSpaceOnUse"&&(e.global=!0)}function Umt(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={};Hmt(r,a,a);var o=a.stopColor||r.getAttribute("stop-color")||"#000000",s=a.stopOpacity||r.getAttribute("stop-opacity");if(s){var l=Wc(o),u=l&&l[3];u&&(l[3]*=wy(s),o=Zf(l,"rgba"))}e.colorStops.push({offset:i,color:o})}r=r.nextSibling}}function hp(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),mr(e.__inheritedStyle,t.__inheritedStyle))}function Vmt(t){for(var e=sq(t),r=[],n=0;n0;a-=2){var o=n[a],s=n[a-1],l=sq(o);switch(i=i||ka(),s){case"translate":sg(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":mH(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":xy(i,i,-parseFloat(l[0])*w0e,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*w0e);Bd(i,[1,0,u,1,0,0],i);break;case"skewY":var h=Math.tan(parseFloat(l[0])*w0e);Bd(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 Gmt=/([^\s:;]+)\s*:\s*([^:;]+)/g;function Hmt(t,e,r){var n=t.getAttribute("style");if(n){Gmt.lastIndex=0;for(var i;(i=Gmt.exec(n))!=null;){var a=i[1],o=Kt(aq,a)?aq[a]:null;o&&(e[o]=i[2]);var s=Kt(oq,a)?oq[a]:null;s&&(r[s]=i[2])}}}function dQr(t,e,r){for(var n=0;n1e-6;LB[0]=o?(i[0]-n.x)/a:i[0],LB[1]=o?(i[1]-n.y)/a:i[1],io(LB,LB,t.mtRawInv);var s=BQr(t,LB);l0t(e,s,a),fe(r,function(l){l!==e&&l0t(l,s.slice(),a)})}var LB=[];function l0t(t,e,r){var n=t.option;n.center=e,n.zoom=r}function R0e(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 c0t(t,e){var r=e.getShallow("nodeScaleRatio",!0)||1,n=t;return((n.zoom-1)*r+1)/(n.trans[n0].scaleX||1)}function mq(t,e,r,n,i,a,o,s){var l=gq(t);if(!l){r.disable();return}r.enable(Jt(t.get("roam"),o),{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=Ppe(mr({type:h0t(d,t.subType,uct)},h));s&&(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 u0t(t){return function(e,r,n){return D0e.copy(t.getBoundingRect()),D0e.applyTransform(t.getComputedTransform()),D0e.contain(r,n)}}var D0e=new pr(0,0,0,0);function L0e(t,e,r){var n=h0t(e,r,uct);t.registerAction({type:n,event:n,update:"none"},function(i,a,o){a.eachComponent($fe(i,e,r),function(s){n0t(i,s),i0t(i,s,a,o)})})}function h0t(t,e,r){return(t!==Hm?t:e==="map"?"geo":e)+r}function d0t(t){return t.zoom!=null}function M0e(t,e,r,n,i,a,o){var s=new lq(null,s0t(t.ecModel,e));return dq(s,r,n,i,a),o?fq(s,o.x,o.y,o.width,o.height):fq(s,r,n,i,a),C0e(s,t),s}var I0e=["rect","circle","line","ellipse","polygon","polyline","path"],FQr=qt(I0e),zQr=qt(I0e.concat(["g"])),UQr=qt(I0e.concat(["g"])),f0t=Gr();function vq(t){var e=t.getItemStyle(),r=t.get("areaColor");return r!=null&&(e.fill=r),e}function p0t(t){var e=t.style;e&&(e.stroke=e.stroke||e.fill,e.fill=null)}var g0t=function(){function t(e){var r=this.group=new gr,n=this._transformGroup=new gr;r.add(n),this.uid=DS("ec_map_draw"),this._controller=new hT(e.getZr()),n.add(this._regionsGroup=new gr),n.add(this._svgGroup=new gr)}return t.prototype.draw=function(e,r,n,i,a){var o=this,s=e.getData&&e.getData();P5(e)&&r.eachComponent({mainType:"series",subType:"map"},function(m){!s&&m.getHostGeoModel()===e&&(s=m.getData())});var l=e.coordinateSystem,u=l.view,h=this._regionsGroup,d=this._transformGroup,f=!h.childAt(0)||a,p;l.shouldClip()?(p=S0e(null,u),this.group.setClipPath(new nn({shape:p.clone()}))):this.group.removeClipPath(),r2(d,gT,u,f?null:e);var g=s&&s.getVisual("visualMeta")&&s.getVisual("visualMeta").length>0;l.resourceType==="geoJSON"?this._buildGeoJSON(u,n,l,e,s,g):l.resourceType==="geoSVG"&&this._buildSVG(u,n,l,e,s,g),mq(e,n,this._controller,function(m,v,y){return e.coordinateSystem.containPoint([v,y])},p,function(){o._mouseDownFlag=!1},!1,!0),this._updateMapSelectHandler(e,h,n,i)},t.prototype.__updateOnOwnRoam=function(e){r2(this._transformGroup,gT,e.coordinateSystem.view,null)},t.prototype._buildGeoJSON=function(e,r,n,i,a,o){var s=this._regionsGroupByName=qt(),l=qt(),u=this._regionsGroup,h=n.projection,d=h&&h.stream,f=Px(DB(null,e,pT));function p(v,y){return y&&(v=y(v)),v&&io([],v,f)}function g(v){for(var y=[],b=!d&&h&&h.project,x=0;x=0)&&(h=t);var d=o?{normal:{align:"center",verticalAlign:"middle"}}:null;il(r,Is(i),{labelFetcher:h,labelDataIndex:u,defaultText:n},d);var f=r.getTextContent();if(f&&(f0t(f).ignore=f.ignore,r.textConfig&&o)){var p=r.getBoundingRect().clone();r.textConfig.layoutRect=p,r.textConfig.position=[(o[0]-p.x)/p.width*100+"%",(o[1]-p.y)/p.height*100+"%"]}r.disableLabelAnimation=!0}else r.removeTextContent(),r.removeTextConfig(),r.disableLabelAnimation=null}function y0t(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 b0t(t,e,r,n,i){e||Ly({el:r,componentModel:t,itemName:n,itemTooltipOption:i.get("tooltip")})}function x0t(t,e,r,n){e.highDownSilentOnTouch=!!t.get("selectedMode");var i=n.getModel("emphasis"),a=i.get("focus");return Ea(e,a,i.get("blurScope"),i.get("disabled")),P5(t)&&LNr(e,t,r),a}function w0t(t,e,r){var n=[],i;function a(){i=[]}function o(){i.length&&(n.push(i),i=[])}var s=e({polygonStart:a,polygonEnd:o,lineStart:a,lineEnd:o,point:function(l,u){isFinite(l)&&isFinite(u)&&i.push([l,u])},sphere:function(){}});return!r&&s.polygonStart(),fe(t,function(l){s.lineStart();for(var u=0;u-1&&(i.style.stroke=i.style.fill,i.style.fill=tt.color.neutral00,i.style.lineWidth=2),i},e.prototype.__ownRoamView=function(){return yq(this)?this.coordinateSystem.view:null},e.type="series."+mT,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:tt.color.tertiary},itemStyle:{borderWidth:.5,borderColor:tt.color.border,areaColor:tt.color.background},emphasis:{label:{show:!0,color:tt.color.primary},itemStyle:{areaColor:tt.color.highlight}},select:{label:{show:!0,color:tt.color.primary},itemStyle:{color:tt.color.highlight}},nameProperty:"name"},e}(Ii);function A0t(t){return t.indexOf("i")===0}function yq(t){return MB(t.seriesGroup)===t&&!t.getHostGeoModel()}function MB(t){return t.f[0]}function P0e(t,e){var r={};return t.eachRawSeriesByType(mT,function(n){var i=n.getHostGeoModel(),a=i?"o"+i.id:"i"+n.getMapType(),o=r[a]=r[a]||{f:[],r:[]};!t.isSeriesFiltered(n)&&!e&&o.f.push(n),o.r.push(n)}),r}var QQr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=mT,r}return e.prototype.render=function(r,n,i,a){if(!(a&&a.type==="mapToggleSelect"&&a.from===this.uid)){var o=this.group;if(o.removeAll(),!r.getHostGeoModel()){var s=this._mapDraw;s&&a&&a.type==="geoRoam"&&s.resetForLabelLayout(),a&&a.type==="geoRoam"&&a.componentType==="series"&&a.seriesId===r.id?s&&o.add(s.group):yq(r)?(s=s||(this._mapDraw=new g0t(i)),o.add(s.group),s.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;yq(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,o){if(!isNaN(a)){var s=n.getItemLayout(o);if(!(!s||!s.point)){var l=s.point,u=s.offset,h=new Wm({style:{fill:r.getData().getVisual("style").fill},shape:{cx:l[0]+u*9,cy:l[1],r:3},silent:!0,z2:8+(u?0:F_+1)});if(!u){var d=MB(r.seriesGroup).getData(),f=n.getName(o),p=d.indexOfName(f),g=n.getItemModel(o),m=g.getModel("label"),v=d.getItemGraphicEl(p);il(h,Is(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){gW(h,y)}}i.add(h)}}})},e.type=mT,e}(ki),GQr={geoJSON:{aspectScale:.75,invertLongitute:!0},geoSVG:{aspectScale:1,invertLongitute:!1}},S0t=["lng","lat"],T0t=function(t){nt(e,t);function e(r,n,i){var a=t.call(this)||this;a.dimensions=S0t,a.type="geo",a._nameCoordMap=qt(),a.name=r;var o=i.projection,s=Fy.load(n,i.nameMap,i.nameProperty),l=Fy.getGeoResource(n);a.resourceType=l?l.type:null;var u=a.regions=s.regions,h=GQr[l.type];a._clip=i.clip;var d=o?!1:h.invertLongitute;a.view=new lq(d,s0t(i.ecModel,i.api),a),a.map=n,a._regionsMap=s.regionsMap,a.regions=s.regions,a.projection=o;var f;if(o)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=ba(A,m),w=$ut(t,w,v)}fq(r,w.x,w.y,w.width,w.height),C0e(r,t)}function HQr(t,e){fe(e.get("geoCoord"),function(r,n){t.addGeoCoord(n,r)})}var WQr=function(){function t(){this.dimensions=S0t}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,o){var s=a.get("map"),l=new T0t(s+o,s,lt({nameMap:a.get("nameMap"),api:r,ecModel:e},i(a)));n.push(l),a.coordinateSystem=l,l.model=a,l.resize=O0t,l.resize(a,r)}),e.eachSeries(function(a){L8({targetModel:a,coordSysType:"geo",coordSysProvider:function(){var o=a.subType===mT?a.getHostGeoModel():a.getReferringComponents("geo",xo).models[0];return o&&o.coordinateSystem},allowNotFound:!0})}),fe(P0e(e,!0),function(a,o){if(A0t(o)){var s=a.r[0],l=[];fe(a.r,function(f){l.push(f.get("nameMap")),f.seriesGroup=null});var u=o.slice(1),h=new T0t(u,u,lt({nameMap:uH(l),api:r,ecModel:e},i(s))),d;fe(a.r,function(f){d=Jt(d,f.get("scaleLimit"))}),n.push(h),h.resize=O0t,h.resize(s,r),fe(a.r,function(f){f.coordinateSystem=h,HQr(h,f)})}}),n},t.prototype.getFilledRegions=function(e,r,n,i){for(var a=(e||[]).slice(),o=qt(),s=0;s=0;o--){var s=i[o];s.hierNode={defaultAncestor:null,ancestor:s,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},r.push(s)}}function nGr(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){aGr(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=oGr(t,i,t.parentNode.hierNode.defaultAncestor||n[0],e)}function iGr(t){var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function _0t(t){return arguments.length?t:cGr}function IB(t,e){return t-=Math.PI/2,{x:e*Math.cos(t),y:e*Math.sin(t)}}function aGr(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 oGr(t,e,r,n){if(e){for(var i=t,a=t,o=a.parentNode.children[0],s=e,l=i.hierNode.modifier,u=a.hierNode.modifier,h=o.hierNode.modifier,d=s.hierNode.modifier;s=N0e(s),a=B0e(a),s&&a;){i=N0e(i),o=B0e(o),i.hierNode.ancestor=t;var f=s.hierNode.prelim+d-a.hierNode.prelim-u+n(s,a);f>0&&(lGr(sGr(s,t,r),t,f),u+=f,l+=f),d+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=i.hierNode.modifier,h+=o.hierNode.modifier}s&&!N0e(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=d-l),a&&!B0e(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-h,r=t)}return r}function N0e(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}function B0e(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}function sGr(t,e,r){return t.hierNode.ancestor.parentNode===e.parentNode?t.hierNode.ancestor:r}function lGr(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 cGr(t,e){return t.parentNode===e.parentNode?1:2}var dp=Gr();function R0t(t){var e=t.mainData,r=t.datas;r||(r={main:e},t.datasAttr={main:"data"}),t.datas=t.mainData=null,D0t(e,r,t),fe(r,function(n){fe(e.TRANSFERABLE_METHODS,function(i){n.wrapMethod(i,Kr(uGr,t))})}),e.wrapMethod("cloneShallow",Kr(dGr,t)),fe(e.CHANGABLE_METHODS,function(n){e.wrapMethod(n,Kr(hGr,t))}),uc(r[e.dataType]===e)}function uGr(t,e){if(gGr(this)){var r=lt({},dp(this).datas);r[this.dataType]=e,D0t(e,r,t)}else $0e(e,this.dataType,dp(this).mainData,t);return e}function hGr(t,e){return t.struct&&t.struct.update(),e}function dGr(t,e){return fe(dp(e).datas,function(r,n){r!==e&&$0e(r.cloneShallow(),n,e,t)}),e}function fGr(t){var e=dp(this).mainData;return t==null||e==null?e:dp(e).datas[t]}function pGr(){var t=dp(this).mainData;return t==null?[{data:t}]:vt(En(dp(t).datas),function(e){return{type:e,data:dp(t).datas[e]}})}function gGr(t){return dp(t).mainData===t}function D0t(t,e,r){dp(t).datas={},fe(e,function(n,i){$0e(n,i,t,r)})}function $0e(t,e,r,n){dp(r).datas[e]=t,dp(t).mainData=r,t.dataType=e,n.struct&&(t[n.structAttr]=n.struct,n.struct[n.datasAttr[e]]=t),t.getLinkedData=fGr,t.getLinkedDataAll=pGr}var mGr=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||{},$t(e)&&(e={order:e});var i=e.order||"preorder",a=this[e.attr||"children"],o;i==="preorder"&&(o=r.call(n,this));for(var s=0;!o&&sr&&(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($t(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 L0t(t){for(var e=[];t;)t=t.parentNode,t&&e.push(t);return e.reverse()}function z0e(t,e){var r=L0t(t);return Nr(r,e)>=0}function bq(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 vT="tree",yGr=function(t){nt(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 bn(i,this,this.ecModel),o=F0e.createTree(n,this,s);function s(d){d.wrapMethod("getItemModel",function(f,p){var g=o.getNodeByDataIndex(p);return g&&g.children.length&&g.isExpand||(f.parentModel=a),f})}var l=0;o.eachNode("preorder",function(d){d.depth>l&&(l=d.depth)});var u=r.expandAndCollapse,h=u&&r.initialTreeDepth>=0?r.initialTreeDepth:l;return o.root.eachNode("preorder",function(d){var f=d.hostTree.data.getRawDataItem(d.dataIndex);d.isExpand=f&&f.collapsed!=null?!f.collapsed:d.depth<=h}),o.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,o=a.root.children[0],s=a.getNodeByDataIndex(r),l=s.getValue(),u=s.name;s&&s!==o;)u=s.parentNode.name+"."+u,s=s.parentNode;return fs("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=bq(i,this),n.collapsed=!i.isExpand,n},e.prototype.__ownRoamView=function(){return this.coordinateSystem},e.type="series."+vT,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:tt.color.borderTint,width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},e}(Ii),bGr=function(){function t(){this.parentPoint=[],this.childPoints=[]}return t}(),xGr=function(t){nt(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:tt.color.neutral99,fill:null}},e.prototype.getDefaultShape=function(){return new bGr},e.prototype.buildPath=function(r,n){var i=n.childPoints,a=i.length,o=n.parentPoint,s=i[0],l=i[a-1];if(a===1){r.moveTo(o[0],o[1]),r.lineTo(s[0],s[1]);return}var u=n.orient,h=u==="TB"||u==="BT"?0:1,d=1-h,f=Qt(n.forkPosition,1),p=[];p[h]=o[h],p[d]=o[d]+(l[d]-o[d])*f,r.moveTo(o[0],o[1]),r.lineTo(p[0],p[1]),r.moveTo(s[0],s[1]),p[h]=s[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",C=s.getModel("label"),k=C.get("rotate"),E=k*(Math.PI/180),_=v.getTextContent();_&&(v.setTextConfig({position:C.get("position")||T,rotation:k==null?-w:E,origin:"center"}),_.setStyle("verticalAlign","middle"))}var P=s.get(["emphasis","focus"]),L=P==="relative"?b_(o.getAncestorsIndices(),o.getDescendantIndices()):P==="ancestor"?o.getAncestorsIndices():P==="descendant"?o.getDescendantIndices():null;L&&(Cr(r).focus=L),AGr(i,o,h,r,g,p,m,n),r.__edge&&(r.onHoverStateChange=function(R){if(R!=="blur"){var D=o.parentNode&&t.getItemGraphicEl(o.parentNode.dataIndex);D&&D.hoverState===g8||gW(r.__edge,R)}})}function AGr(t,e,r,n,i,a,o,s){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 G_({shape:U0e(h,d,f,i,i)})),qn(m,{shape:U0e(h,d,f,a,o)},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 TGr(t,e){t.eachSeriesByType("tree",function(r){CGr(r,e)})}function CGr(t,e){var r=Ps(t,e).refContainer,n=ba(t.getBoxLayoutParams(),r);t.layoutInfo=n;var i=t.get("layout"),a=0,o=0,s=null;i==="radial"?(a=2*Math.PI,o=Math.min(n.height,n.width)/2,s=_0t(function(w,A){return(w.parentNode===A.parentNode?1:2)/w.depth})):(a=n.width,o=n.height,s=_0t());var l=t.getData().tree.root,u=l.children[0];if(u){rGr(l),SGr(u,nGr,s),l.hierNode.modifier=-u.hierNode.prelim,NB(u,iGr);var h=u,d=u,f=u;NB(u,function(w){var A=w.getLayout().x;Ad.getLayout().x&&(d=w),w.depth>f.depth&&(f=w)});var p=h===d?1:s(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=o/(f.depth-1||1),NB(u,function(w){y=(w.getLayout().x+g)*m,b=(w.depth-1)*v;var A=IB(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=o/(d.getLayout().x+p+g),m=a/(f.depth-1||1),NB(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=o/(f.depth-1||1),NB(u,function(w){y=(w.getLayout().x+g)*m,b=x==="TB"?(w.depth-1)*v:o-(w.depth-1)*v,w.setLayout({x:y,y:b},!0)}))}}}function OGr(t){t.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(e,r){r.eachComponent({mainType:Hm,subType:vT,query:e},function(n){var i=e.dataIndex,a=n.getData().tree,o=a.getNodeByDataIndex(i);o.isExpand=!o.isExpand})}),L0e(t,Hm,vT)}var kGr=Ls(vT,EGr);function EGr(t){t.eachSeriesByType(vT,function(e){var r=e.getData(),n=r.tree;n.eachNode(function(i){var a=i.getModel(),o=a.getModel("itemStyle").getItemStyle(),s=r.ensureUniqueItemVisual(i.dataIndex,"style");lt(s,o)})})}function _Gr(t){t.registerChartView(wGr),t.registerSeriesModel(yGr),t.registerLayout(TGr),t.registerVisual(kGr),OGr(t)}var $0t=["treemapZoomToNode","treemapRender","treemapMove"];function RGr(t){for(var e=0;e<$0t.length;e++)t.registerAction({type:$0t[e],update:"updateView"},no);t.registerAction({type:"treemapRootToNode",update:"updateView"},function(r,n){n.eachComponent({mainType:"series",subType:"treemap",query:r},i);function i(a,o){var s=["treemapZoomToNode","treemapRootToNode"],l=PB(r,s,a);if(l){var u=a.getViewRoot();u&&(r.direction=z0e(u,l.node)?"rollUp":"drillDown"),a.resetViewRoot(l.node)}}})}function F0t(t){var e=t.getData(),r=e.tree,n={};r.eachNode(function(i){for(var a=i;a&&a.depth>1;)a=a.parentNode;var o=hge(t.ecModel,a.name||a.dataIndex+"",n);i.setVisual("decal",o)})}var DGr=function(t){nt(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};z0t(i);var a=r.levels||[],o=this.designatedVisualItemStyle={},s=new bn({itemStyle:o},this,n);a=r.levels=LGr(a,n);var l=vt(a||[],function(d){return new bn(d,s,n)},this),u=F0e.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||s,f})}return u.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.formatTooltip=function(r,n,i){var a=this.getData(),o=this.getRawValue(r),s=a.getName(r);return fs("nameValue",{name:s,value:o})},e.prototype.getDataParams=function(r){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(r);return n.treeAncestors=bq(i,this),n.treePathInfo=n.treeAncestors,n},e.prototype.setLayoutInfo=function(r){this.layoutInfo=this.layoutInfo||{},lt(this.layoutInfo,r)},e.prototype.mapIdToIndex=function(r){var n=this._idIndexMap;n||(n=this._idIndexMap=qt(),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(){F0t(this)},e.type="series.treemap",e.layoutMode="box",e.defaultOption={progressive:0,coordinateSystemUsage:"box",left:tt.size.l,top:tt.size.xxxl,right:tt.size.l,bottom:tt.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:tt.size.m,emptyItemWidth:25,itemStyle:{color:tt.color.backgroundShade,textStyle:{color:tt.color.secondary}},emphasis:{itemStyle:{color:tt.color.background}}},label:{show:!0,distance:0,padding:5,position:"inside",color:tt.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:tt.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}(Ii);function z0t(t){var e=0;fe(t.children,function(n){z0t(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 LGr(t,e){var r=qi(e.get("color")),n=qi(e.get(["aria","decal","decals"]));if(r){t=t||[];var i,a;fe(t,function(s){var l=new bn(s),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 o=t[0]||(t[0]={});return i||(o.color=r.slice()),!a&&n&&(o.decal=n.slice()),t}}var MGr=8,U0t=8,V0e=5,IGr=function(){function t(e){this.group=new gr,e.add(this.group)}return t.prototype.render=function(e,r,n,i){var a=e.getModel("breadcrumb"),o=this.group;if(o.removeAll(),!(!a.get("show")||!n)){var s=a.getModel("itemStyle"),l=a.getModel("emphasis"),u=s.getModel("textStyle"),h=l.getModel(["itemStyle","textStyle"]),d=Ps(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=ba(f,d);this._prepare(n,p,u),this._renderContent(e,p,g,s,l,u,h,i),UW(o,f,d)}},t.prototype._prepare=function(e,r,n){for(var i=e;i;i=i.parentNode){var a=Ds(i.getModel().get("name"),""),o=n.getTextRect(a),s=Math.max(o.width+MGr*2,r.emptyItemWidth);r.totalWidth+=s+U0t,r.renderList.push({node:i,text:a,width:s})}},t.prototype._renderContent=function(e,r,n,i,a,o,s,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 pc({shape:{points:PGr(u,0,b,d,m===p.length-1,m===0)},style:mr(i.getItemStyle(),{lineJoin:"bevel"}),textContent:new $n({style:ji(o,{text:x})}),textConfig:{position:"inside"},z2:F_*1e4,onclick:Kr(l,y)});w.disableLabelAnimation=!0,w.getTextContent().ensureState("emphasis").style=ji(s,{text:x}),w.ensureState("emphasis").style=g,Ea(w,a.get("focus"),a.get("blurScope"),a.get("disabled")),this.group.add(w),NGr(w,e,y),u+=b+U0t}},t.prototype.remove=function(){this.group.removeAll()},t}();function PGr(t,e,r,n,i,a){var o=[[i?t:t-V0e,e],[t+r,e],[t+r,e+n],[i?t:t-V0e,e+n]];return!a&&o.splice(2,0,[t+r+V0e,e+n/2]),!i&&o.push([t,e+n/2]),o}function NGr(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&&bq(r,e)}}var BGr=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"?o-l-1:l].getValue();u/r*es[1]&&(s[1]=u)})),{sum:n,dataExtent:s}}function YGr(t,e,r){for(var n=0,i=1/0,a=0,o=void 0,s=t.length;an&&(n=o));var l=t.area*t.area,u=e*e*r;return l?BB(u*n/l,l/(u*i)):1/0}function G0t(t,e,r,n,i){var a=e===r.width?0:1,o=1-a,s=["x","y"],l=["width","height"],u=r[s[a]],h=e?t.area/e:0;(i||h>r[l[o]])&&(h=r[l[o]]);for(var d=0,f=t.length;dc8&&(h=c8),i=l}hX0t||Math.abs(r.dy)>X0t)){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,o=this.seriesModel;if(this._state!=="animating"){var s=o.getData().tree.root;if(!s)return;var l=s.getLayout();if(!l)return;var u=new pr(l.x,l.y,l.width,l.height),h=o.layoutInfo,d=Y0t(h,l),f=d*a;f=q0t(f,o);var p=f/d;n-=h.x,i-=h.y;var g=ka();sg(g,g,[-n,-i]),mH(g,g,[p,p]),sg(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 o=n.findTarget(i.offsetX,i.offsetY);if(o){var s=o.node;if(s.getLayout().isLeafRoot)n._rootToNode(o);else if(a==="zoomToNode")n._zoomToNode(o);else if(a==="link"){var l=s.hostTree.data.getItemModel(s.dataIndex),u=l.get("link",!0),h=l.get("target",!0)||"blank";u&&BW(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 IGr(this.group))).render(r,n,i.node,function(o){a._state!=="animating"&&(z0e(r.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=$B(),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(o){var s=this._storage.background[o.getRawIndex()];if(s){var l=s.transformCoordToLocal(r,n),u=s.shape;if(u.x<=l[0]&&l[0]<=u.x+u.width&&u.y<=l[1]&&l[1]<=u.y+u.height)i={node:o,offsetX:l[0],offsetY:l[1]};else return!1}},this),i},e.type="treemap",e}(ki);function $B(){return{nodeGroup:[],background:[],content:[]}}function eHr(t,e,r,n,i,a,o,s,l,u){if(!o)return;var h=o.getLayout(),d=t.getData(),f=o.getModel();if(d.setItemGraphicEl(o.dataIndex,null),!h||!h.isInView)return;var p=h.width,g=h.height,m=h.borderWidth,v=h.invisible,y=o.getRawIndex(),b=s&&s.getRawIndex(),x=o.viewChildren,w=h.upperHeight,A=x&&x.length,S=f.getModel("itemStyle"),T=f.getModel(["emphasis","itemStyle"]),C=f.getModel(["blur","itemStyle"]),k=f.getModel(["select","itemStyle"]),E=S.get("borderRadius")||0,_=G("nodeGroup",G0e);if(!_)return;if(l.add(_),_.x=h.x||0,_.y=h.y||0,_.markRedraw(),wq(_).nodeWidth=p,wq(_).nodeHeight=g,h.isAboveViewRoot)return _;var P=G("background",j0t,u,KGr);P&&B(_,P,A&&h.upperLabelHeight);var L=f.getModel("emphasis"),R=L.get("focus"),D=L.get("blurScope"),M=L.get("disabled"),I=R==="ancestor"?o.getAncestorsIndices():R==="descendant"?o.getDescendantIndices():R;if(A)v8(_)&&AS(_,!1),P&&(AS(P,!M),d.setItemGraphicEl(o.dataIndex,P),ype(P,I,D));else{var N=G("content",j0t,u,ZGr);N&&V(_,N),P.disableMorphing=!0,P&&v8(P)&&AS(P,!1),AS(_,!M),d.setItemGraphicEl(o.dataIndex,_);var F=f.getShallow("cursor");F&&N.attr("cursor",F),ype(_,I,D)}return _;function B(ne,X,J){var ee=Cr(X);if(ee.dataIndex=o.dataIndex,ee.seriesIndex=t.seriesIndex,X.setShape({x:0,y:0,width:p,height:g,r:E}),v)z(X);else{X.invisible=!1;var te=o.getVisual("style"),pe=te.stroke,ie=J0t(S);ie.fill=pe;var Ce=yT(T);Ce.fill=T.get("borderColor");var ke=yT(C);ke.fill=C.get("borderColor");var Ee=yT(k);if(Ee.fill=k.get("borderColor"),J){var ue=p-2*m;U(X,pe,te.opacity,{x:m,y:0,width:ue,height:w})}else X.removeTextContent();X.setStyle(ie),X.ensureState("emphasis").style=Ce,X.ensureState("blur").style=ke,X.ensureState("select").style=Ee,wS(X)}ne.add(X)}function V(ne,X){var J=Cr(X);J.dataIndex=o.dataIndex,J.seriesIndex=t.seriesIndex;var ee=Math.max(p-2*m,0),te=Math.max(g-2*m,0);if(X.culling=!0,X.setShape({x:m,y:m,width:ee,height:te,r:E}),v)z(X);else{X.invisible=!1;var pe=o.getVisual("style"),ie=pe.fill,Ce=J0t(S);Ce.fill=ie,Ce.decal=pe.decal;var ke=yT(T),Ee=yT(C),ue=yT(k);U(X,ie,pe.opacity,null),X.setStyle(Ce),X.ensureState("emphasis").style=ke,X.ensureState("blur").style=Ee,X.ensureState("select").style=ue,wS(X)}ne.add(X)}function z(ne){!ne.invisible&&a.push(ne)}function U(ne,X,J,ee){var te=f.getModel(ee?Z0t:K0t),pe=Ds(f.get("name"),null),ie=te.getShallow("show");il(ne,Is(f,ee?Z0t:K0t),{defaultText:ie?pe:null,inheritColor:X,defaultOpacity:J,labelFetcher:t,labelDataIndex:o.dataIndex});var Ce=ne.getTextContent();if(Ce){var ke=Ce.style,Ee=FN(ke.padding||0);ee&&(ne.setTextConfig({layoutRect:ee}),Ce.disableLabelLayout=!0),Ce.beforeUpdate=function(){var de=Math.max((ee?ee.width:ne.shape.width)-Ee[1]-Ee[3],0),xe=Math.max((ee?ee.height:ne.shape.height)-Ee[0]-Ee[2],0);(ke.width!==de||ke.height!==xe)&&Ce.setStyle({width:de,height:xe})},ke.truncateMinChar=2,ke.lineOverflow="truncate",Q(ke,ee,h);var ue=Ce.getState("emphasis");Q(ue?ue.style:null,ee,h)}}function Q(ne,X,J){var ee=ne?ne.text:null;if(!X&&J.isLeafRoot&&ee!=null){var te=t.get("drillDownIcon",!0);ne.text=te?te+" "+ee:ee}}function G(ne,X,J,ee){var te=b!=null&&r[ne][b],pe=i[ne];return te?(r[ne][b]=null,q(pe,te)):v||(te=new X,te instanceof tp&&(te.z2=tHr(J,ee)),Y(pe,te)),e[ne][y]=te}function q(ne,X){var J=ne[y]={};X instanceof G0e?(J.oldX=X.x,J.oldY=X.y):J.oldShape=lt({},X.shape)}function Y(ne,X){var J=ne[y]={},ee=o.parentNode,te=X instanceof gr;if(ee&&(!n||n.direction==="drillDown")){var pe=0,ie=0,Ce=i.background[ee.getRawIndex()];!n&&Ce&&Ce.oldShape&&(pe=Ce.oldShape.width,ie=Ce.oldShape.height),te?(J.oldX=0,J.oldY=ie):J.oldShape={x:pe,y:ie,width:0,height:0}}J.fadein=!te}}function tHr(t,e){return t*XGr+e}var FB=fe,rHr=yr,Aq=-1,ol=function(){function t(e){var r=e.mappingMethod,n=e.type,i=this.option=lr(e);this.type=n,this.mappingMethod=r,this._normalizeData=aHr[r];var a=t.visualHandlers[n];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[r],r==="piecewise"?(H0e(i),nHr(i)):r==="category"?i.categories?iHr(i):H0e(i,!0):(uc(r!=="linear"||i.dataExtent),H0e(i))}return t.prototype.mapValueToVisual=function(e){var r=this._normalizeData(e);return this._normalizedToVisual(r,e)},t.prototype.getNormalizer=function(){return Wt(this._normalizeData,this)},t.listVisualTypes=function(){return En(t.visualHandlers)},t.isValidType=function(e){return t.visualHandlers.hasOwnProperty(e)},t.eachVisual=function(e,r,n){yr(e)?fe(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(o,s){var l=r.call(n,o,s);i?a=l:a[s]=l}),a},t.retrieveVisuals=function(e){var r={},n;return e&&FB(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(rHr(e)){var r=[];FB(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,o=0,s=r.length;o=0;a--)n[a]==null&&(delete r[e[a]],e.pop())}function H0e(t,e){var r=t.visual,n=[];yr(r)?FB(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]),tvt(t,n)}function Sq(t){return{applyVisual:function(e,r,n){var i=this.mapValueToVisual(e);n("color",t(r("color"),i))},_normalizedToVisual:W0e([0,1])}}function evt(t){var e=this.option.visual;return e[Math.round(Zn(t,[0,1],[0,e.length-1],!0))]||{}}function zB(t){return function(e,r,n){n(t,this.mapValueToVisual(e))}}function UB(t){var e=this.option.visual;return e[this.option.loop&&t!==Aq?t%e.length:t]}function bT(){return this.option.visual[0]}function W0e(t){return{linear:function(e){return Zn(e,t,this.option.visual,!0)},category:UB,piecewise:function(e,r){var n=Y0e.call(this,r);return n==null&&(n=Zn(e,t,this.option.visual,!0)),n},fixed:bT}}function Y0e(t){var e=this.option,r=e.pieceList;if(e.hasSpecialVisual){var n=ol.findPieceIndex(t,r),i=r[n];if(i&&i.visual)return i.visual[this.type]}}function tvt(t,e){return t.visual=e,t.type==="color"&&(t.parsedVisual=vt(e,function(r){var n=Wc(r);return n||[0,0,0,1]})),e}var aHr={linear:function(t){return Zn(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,r=ol.findPieceIndex(t,e,!0);if(r!=null)return Zn(r,[0,e.length-1],[0,1],!0)},category:function(t){var e=this.option.categories?this.option.categoryMap[t]:t;return e??Aq},fixed:no};function Tq(t,e,r){return t?e<=r:e=r.length||m===r[m.depth]){var y=hHr(i,l,m,v,g,n);nvt(m,y,r,n)}})}}}function lHr(t,e,r){var n=lt({},e),i=r.designatedVisualItemStyle;return fe(["color","colorAlpha","colorSaturation"],function(a){i[a]=e[a];var o=t.get(a);i[a]=null,o!=null&&(n[a]=o)}),n}function ivt(t){var e=q0e(t,"color");if(e){var r=q0e(t,"colorAlpha"),n=q0e(t,"colorSaturation");return n&&(e=Ay(e,null,null,n)),r&&(e=t8(e,r)),e}}function cHr(t,e){return e!=null?Ay(e,null,null,t):null}function q0e(t,e){var r=t[e];if(r!=null&&r!=="none")return r}function uHr(t,e,r,n,i,a){if(!(!a||!a.length)){var o=j0e(e,"color")||i.color!=null&&i.color!=="none"&&(j0e(e,"colorAlpha")||j0e(e,"colorSaturation"));if(o){var s=e.get("visualMin"),l=e.get("visualMax"),u=r.dataExtent.slice();s!=null&&su[1]&&(u[1]=l);var h=e.get("colorMappingBy"),d={type:o.name,dataExtent:u,visual:o.range};d.type==="color"&&(h==="index"||h==="id")?(d.mappingMethod="category",d.loop=!0):d.mappingMethod="linear";var f=new ol(d);return rvt(f).drColorMappingBy=h,f}}}function j0e(t,e){var r=t.get(e);return ft(r)&&r.length?{name:e,range:r}:null}function hHr(t,e,r,n,i,a){var o=lt({},e);if(i){var s=i.type,l=s==="color"&&rvt(i).drColorMappingBy,u=l==="index"?n:l==="id"?a.mapIdToIndex(r.getId()):r.getValue(t.get("visualDimension"));o[s]=i.mapValueToVisual(u)}return o}function dHr(t){t.registerSeriesModel(DGr),t.registerChartView(JGr),t.registerVisual(sHr),t.registerLayout(VGr),RGr(t)}function N5(t){return"_EC_"+t}var fHr=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[N5(e)]){var i=new xT(e,r);return i.hostGraph=this,this.nodes.push(i),n[N5(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[N5(e)]},t.prototype.addEdge=function(e,r,n){var i=this._nodesMap,a=this._edgesMap;if(Vn(e)&&(e=this.nodes[e]),Vn(r)&&(r=this.nodes[r]),e instanceof xT||(e=i[N5(e)]),r instanceof xT||(r=i[N5(r)]),!(!e||!r)){var o=e.id+"-"+r.id,s=new avt(e,r,n);return s.hostGraph=this,this._directed&&(e.outEdges.push(s),r.inEdges.push(s)),e.edges.push(s),e!==r&&r.edges.push(s),this.edges.push(s),a[o]=s,s}},t.prototype.getEdgeByIndex=function(e){var r=this.edgeData.getRawIndex(e);return this.edges[r]},t.prototype.getEdge=function(e,r){e instanceof xT&&(e=e.id),r instanceof xT&&(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 xT||(r=this._nodesMap[N5(r)]),!!r){for(var a=n==="out"?"outEdges":n==="in"?"inEdges":"edges",o=0;o=0&&l.node2.dataIndex>=0});for(var a=0,o=i.length;a=0&&!e.hasKey(g)&&(e.set(g,!0),o.push(p.node1))}for(l=0;l=0&&!e.hasKey(x)&&(e.set(x,!0),s.push(b.node2))}}}return{edge:e.keys(),node:r.keys()}},t}(),avt=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=qt(),r=qt();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 ovt(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)}}}Qo(xT,ovt("hostGraph","data")),Qo(avt,ovt("hostGraph","edgeData"));function X0e(t,e,r,n,i){for(var a=new fHr(n),o=0;o "+f)),u++)}var p=r.get("coordinateSystem"),g;if(p==="cartesian2d"||p==="polar"||p==="matrix")g=jm(t,r);else{var m=r5.get(p),v=m?m.dimensions||[]:[];Nr(v,"value")<0&&v.concat(["value"]);var y=v5(t,{coordDimensions:v,encodeDefine:r.getEncode()}).dimensions;g=new jc(y,r),g.initData(t)}var b=new jc(["value"],r);return b.initData(l,s),i&&i(g,b),R0t({mainData:g,struct:a,structAttr:"graph",datas:{node:g,edge:b},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var K0e="-->",Cq=function(t){return t.get("autoCurveness")||null},svt=function(t,e){var r=Cq(t),n=20,i=[];if(Vn(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 o=0;o "),value:o.value,noValue:o.value==null})}var d=Qht({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:lt({value:0},i)}),n=new jc(["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 r0t(r)&&r},e.type="series."+$u,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:tt.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:tt.color.primary}}},e}(Ii);function Oq(t){return t instanceof Array||(t=[t,t]),t}var bHr=Ls($u,xHr);function xHr(t){t.eachSeriesByType($u,function(e){var r=e.getGraph(),n=e.getEdgeData(),i=Oq(e.get("edgeSymbol")),a=Oq(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(o){var s=n.getItemModel(o),l=r.getEdgeByIndex(o),u=Oq(s.getShallow("symbol",!0)),h=Oq(s.getShallow("symbolSize",!0)),d=s.getModel("lineStyle").getLineStyle(),f=n.ensureUniqueItemVisual(o,"style");switch(lt(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 cvt(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")])}),eve(r,t)}}function eve(t,e){t.eachEdge(function(r,n){var i=Bh(r.getModel().get(["lineStyle","curveness"]),-J0e(r,e,n,!0),0),a=km(r.node1.getLayout()),o=km(r.node2.getLayout()),s=[a,o];+i&&s.push([(a[0]+o[0])/2-(a[1]-o[1])*i,(a[1]+o[1])/2-(o[0]-a[0])*i]),r.setLayout(s)})}var wHr=Ls($u,AHr);function AHr(t,e){t.eachSeriesByType($u,function(r){var n=r.get("layout"),i=r.coordinateSystem;if(i&&i.type!=="view"){var a=r.getData(),o=[];fe(i.dimensions,function(f){o=o.concat(a.mapDimensionsAll(f))});for(var s=0;s0&&(A[0]=-A[0],A[1]=-A[1]);var T=w[0]<0?-1:1;if(a.__position!=="start"&&a.__position!=="end"){var C=-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=o,a.setStyle({verticalAlign:a.__verticalAlign||m,align:a.__align||g})}},e}(gr),lve=function(){function t(e){this.group=new gr,this._LineCtor=e||sve}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 o=yvt(e);e.diff(a).add(function(s){r._doAdd(e,s,o)}).update(function(s,l){r._doUpdate(a,e,l,s,o)}).remove(function(s){i.remove(a.getItemGraphicEl(s))}).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=yvt(e),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(e,r,n){this._progressiveEls=[];function i(l){!l.isGroup&&!LHr(l)&&(l.incremental=n,l.ensureState("emphasis").hoverLayer=Y_)}for(var a=e.start;a0}function yvt(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:Is(e)}}function bvt(t){return isNaN(t[0])||isNaN(t[1])}function cve(t){return t&&!bvt(t[0])&&!bvt(t[1])}var uve=[],hve=[],dve=[],$5=_l,fve=Ex,xvt=Math.abs;function wvt(t,e,r){for(var n=t[0],i=t[1],a=t[2],o=1/0,s,l=r*r,u=.1,h=.1;h<=.9;h+=.1){uve[0]=$5(n[0],i[0],a[0],h),uve[1]=$5(n[1],i[1],a[1],h);var d=xvt(fve(uve,e)-l);d=0?s=s+u:s=s-u:g>=0?s=s-u:s=s+u}return s}function pve(t,e){var r=[],n=ZN,i=[[],[],[]],a=[[],[]],o=[];e/=2,t.eachEdge(function(s,l){var u=s.getLayout(),h=s.getVisual("fromSymbol"),d=s.getVisual("toSymbol");u.__original||(u.__original=[km(u[0]),km(u[1])],u[2]&&u.__original.push(km(u[2])));var f=u.__original;if(u[2]!=null){if(hc(i[0],f[0]),hc(i[1],f[2]),hc(i[2],f[1]),h&&h!=="none"){var p=GB(s.node1),g=wvt(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=GB(s.node2),g=wvt(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]}hc(u[0],i[0]),hc(u[1],i[2]),hc(u[2],i[1])}else{if(hc(a[0],f[0]),hc(a[1],f[1]),kx(o,a[1],a[0]),HA(o,o),h&&h!=="none"){var p=GB(s.node1);fH(a[0],a[0],o,p*e)}if(d&&d!=="none"){var p=GB(s.node2);fH(a[1],a[1],o,-p*e)}hc(u[0],a[0]),hc(u[1],a[1])}})}var Avt=Gr();function MHr(t){if(t)return Avt(t).bridge}function Svt(t,e){t&&(Avt(t).bridge=e)}var IHr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=$u,r}return e.prototype.init=function(r,n){var i=new fB,a=new lve,o=this.group,s=new gr;this._controller=new hT(n.getZr()),s.add(i.group),s.add(a.group),o.add(s),this._symbolDraw=i,this._lineDraw=a,this._mainGroup=s,this._firstRender=!0},e.prototype.render=function(r,n,i){var a=this,o=gq(r),s=!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;o&&r2(l,n0,o,this._firstRender?null:r),pve(r.getGraph(),QB(r));var f=r.getData();h.updateData(f);var p=r.getEdgeData();d.updateData(p),this._updateNodeAndLinkScale(),o&&mq(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&&(s=!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 C=T.get("draggable");C&&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),rve(r,"symbolSize",w,[E.offsetX,E.offsetY]),a.updateLayout(r);break;case"none":default:f.setItemLayout(A,[S.x,S.y]),eve(r.getGraph(),r),a.updateLayout(r);break}}).on("dragend",function(){g&&g.setUnfixed(A)}),S.setDraggable(C,!!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){hvt(w,y,b,x)}),this._firstRender=!1,s||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,o=!1;(function s(){r.step(function(l){a.updateLayout(a._model),(l||!o)&&(o=!0,a._renderThumbnail(a._model,n,a._symbolDraw,a._lineDraw)),(a._layouting=!l)&&(i?a._layoutTimeout=setTimeout(s,16):s())})})()},e.prototype.__updateOnOwnRoam=function(r,n,i){var a=gq(n);!this._active||!a||(r2(this._mainGroup,n0,a,null),d0t(r)&&(this._updateNodeAndLinkScale(),pve(n.getGraph(),QB(n)),this._lineDraw.updateLayout(),i.updateLabelLayout()),this._updateThumbnailWindow())},e.prototype._updateNodeAndLinkScale=function(){var r=this._model,n=r.getData(),i=QB(r);n.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(i)})},e.prototype.updateLayout=function(r){this._active&&(pve(r.getGraph(),QB(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=MHr(r);if(i)return{bridge:i,coordSys:n}}},e.prototype._updateThumbnailWindow=function(){var r=this._getThumbnailInfo();r&&r.bridge.updateWindow(uq(null,r.coordSys),this._api)},e.prototype._renderThumbnail=function(r,n,i,a){var o=this._getThumbnailInfo();if(o){var s=new gr,l=i.group.children(),u=a.group.children(),h=new gr,d=new gr;s.add(d),s.add(h);for(var f=0;f "),value:a.value,noValue:a.value==null})}return fs("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(),o=this.getGraph().getNodeByIndex(r);if(i.name==null&&(i.name=a.getName(r)),i.value==null){var s=o.getLayout().value;i.value=s}}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}(Ii),Tvt=function(t){nt(e,t);function e(r,n,i){var a=t.call(this)||this;Cr(a).dataType="node",a.z2=2;var o=new $n;return a.setTextContent(o),a.updateData(r,n,i,!0),a}return e.prototype.updateData=function(r,n,i,a){var o=this,s=r.graph.getNodeByIndex(n),l=r.hostModel,u=s.getModel(),h=u.getModel("emphasis"),d=r.getItemLayout(n),f=lt(r0(u.getModel("itemStyle"),d,!0),d),p=this;if(isNaN(f.startAngle)){p.setShape(f);return}a?p.setShape(f):qn(p,{shape:f},l,n);var g=lt(r0(u.getModel("itemStyle"),d,!0),d);o.setShape(g),o.useStyle(r.getItemVisual(n,"style")),Ms(o,u),this._updateLabel(l,u,s),r.setItemGraphicEl(n,p),Ms(p,u,"itemStyle");var m=h.get("focus");Ea(this,m==="adjacency"?s.getAdjacentDataIndices():m,h.get("blurScope"),h.get("disabled"))},e.prototype._updateLabel=function(r,n,i){var a=this.getTextContent(),o=i.getLayout(),s=(o.startAngle+o.endAngle)/2,l=Math.cos(s),u=Math.sin(s),h=n.getModel("label");a.ignore=!h.get("show");var d=Is(n),f=i.getVisual("style");il(a,d,{labelFetcher:{getFormattedLabel:function(b,x,w,A,S,T){return r.getFormattedLabel(b,x,"node",A,Bh(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=o.r+g:m=(o.r+o.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+o.cx,y:u*m+o.cy,rotation:0,style:{align:v,verticalAlign:y}})},e}(fc),UHr=function(t){nt(e,t);function e(r,n,i,a){var o=t.call(this)||this;return Cr(o).dataType="edge",o.updateData(r,n,i,a,!0),o}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,o){var s=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=lt(r0(h.getModel("itemStyle"),u,!0),u),v=this;if(isNaN(m.sStartAngle)||isNaN(m.tStartAngle)){v.setShape(m);return}o?(v.setShape(m),Cvt(v,l,r,f)):(np(v),Cvt(v,l,r,f),qn(v,{shape:m},s,i)),Ea(this,g==="adjacency"?l.getAdjacentDataIndices():g,p.get("blurScope"),p.get("disabled")),Ms(v,d,"lineStyle"),n.setItemGraphicEl(l.dataIndex,v)},e}(yn);function Cvt(t,e,r,n){var i=e.node1,a=e.node2,o=t.style;t.setStyle(n.getLineStyle());var s=n.get("color");switch(s){case"source":o.fill=r.getItemVisual(i.dataIndex,"style").fill,o.decal=i.getVisual("style").decal;break;case"target":o.fill=r.getItemVisual(a.dataIndex,"style").fill,o.decal=a.getVisual("style").decal;break;case"gradient":var l=r.getItemVisual(i.dataIndex,"style").fill,u=r.getItemVisual(a.dataIndex,"style").fill;if($t(l)&&$t(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;o.fill=new TS(d,f,p,g,[{offset:0,color:l},{offset:1,color:u}],!0)}break}}var VHr=Math.PI/180,QHr=function(t){nt(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(),o=this._data,s=this.group,l=-r.get("startAngle")*VHr;if(a.diff(o).add(function(h){var d=a.getItemLayout(h);if(d){var f=new Tvt(a,h,l);Cr(f).dataIndex=h,s.add(f)}}).update(function(h,d){var f=o.getItemGraphicEl(d),p=a.getItemLayout(h);if(!p){f&&Dy(f,r,d);return}f?f.updateData(a,h,l):f=new Tvt(a,h,l),s.add(f)}).remove(function(h){var d=o.getItemGraphicEl(h);d&&Dy(d,r,h)}).execute(),!o){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()),ua(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(),o=this._edgeData,s=this.group;a.diff(o).add(function(l){var u=new UHr(i,a,l,n);Cr(u).dataIndex=l,s.add(u)}).update(function(l,u){var h=o.getItemGraphicEl(u);h.updateData(i,a,l,n),s.add(h)}).remove(function(l){var u=o.getItemGraphicEl(l);u&&Dy(u,r,l)}).execute(),this._edgeData=a},e.prototype.dispose=function(){},e.type=HB,e}(ki),gve=Math.PI/180,GHr=Ls(HB,HHr);function HHr(t,e){t.eachSeriesByType(HB,function(r){WHr(r,e)})}function WHr(t,e){var r=t.getData(),n=r.graph,i=t.getEdgeData(),a=i.count();if(a){var o=But(t,e),s=o.cx,l=o.cy,u=o.r,h=o.r0,d=Math.max((t.get("padAngle")||0)*gve,0),f=Math.max((t.get("minAngle")||0)*gve,0),p=-t.get("startAngle")*gve,g=p+Math.PI*2,m=t.get("clockwise"),v=m?1:-1,y=[p,g];sW(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 C=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++,C+=S[N.dataIndex]||0}),!(T===0||C===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)/C,E=0,_=0,P=0;n.eachNode(function(N){var F=S[N.dataIndex]||0,B=k*(C?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/P,1),V=B*E;F-Vf&&f>0){var B=L?1:Math.min(F/P,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,I=[];n.eachNode(function(N){var F=Math.max(N.getLayout().angle,f);N.setLayout({cx:s,cy:l,r0:h,r:u,startAngle:M,endAngle:M+F*v,clockwise:m},!0),I[N.dataIndex]=M,M+=(F+d)*v}),n.eachEdge(function(N){var F=A?1:N.getValue("value"),B=k*(C?F:1)*v,V=N.node1.dataIndex,z=I[V]||0,U=Math.abs((N.node1.getLayout().ratio||1)*B),Q=z+U*v,G=[s+h*Math.cos(z),l+h*Math.sin(z)],q=[s+h*Math.cos(Q),l+h*Math.sin(Q)],Y=N.node2.dataIndex,ne=I[Y]||0,X=Math.abs((N.node2.getLayout().ratio||1)*B),J=ne+X*v,ee=[s+h*Math.cos(ne),l+h*Math.sin(ne)],te=[s+h*Math.cos(J),l+h*Math.sin(J)];N.setLayout({s1:G,s2:q,sStartAngle:z,sEndAngle:Q,t1:ee,t2:te,tStartAngle:ne,tEndAngle:J,cx:s,cy:l,r:h,value:F,clockwise:m}),I[V]=Q,I[Y]=J})}}}function YHr(t){t.registerChartView(QHr),t.registerSeriesModel(zHr),t.registerLayout(t.PRIORITY.VISUAL.POST_CHART_LAYOUT,GHr),t.registerProcessor(AB("chord"))}var qHr=function(){function t(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return t}(),jHr=function(t){nt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="pointer",n}return e.prototype.getDefaultShape=function(){return new qHr},e.prototype.buildPath=function(r,n){var i=Math.cos,a=Math.sin,o=n.r,s=n.width,l=n.angle,u=n.x-i(l)*s*(s>=o/3?1:2),h=n.y-a(l)*s*(s>=o/3?1:2);l=n.angle-Math.PI/2,r.moveTo(u,h),r.lineTo(n.x+i(l)*s,n.y+a(l)*s),r.lineTo(n.x+i(n.angle)*o,n.y+a(n.angle)*o),r.lineTo(n.x-i(l)*s,n.y-a(l)*s),r.lineTo(u,h)},e}(yn);function XHr(t,e){var r=t.get("center"),n=e.getWidth(),i=e.getHeight(),a=Math.min(n,i),o=Qt(r[0],e.getWidth()),s=Qt(r[1],e.getHeight()),l=Qt(t.get("radius"),a/2);return{cx:o,cy:s,r:l}}function kq(t,e){var r=t==null?"":t+"";return e&&($t(e)?r=e.replace("{value}",r):ur(e)&&(r=e(t))),r}var KHr=function(t){nt(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"]),o=XHr(r,i);this._renderMain(r,n,i,a,o),this._data=r.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(r,n,i,a,o){var s=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?qY:fc,g=d.get("show"),m=d.getModel("lineStyle"),v=m.get("width"),y=[u,h];sW(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=-C-Math.PI/2:Vn(U)&&(Q=U*Math.PI/180),Q===0?d.add(new $n({style:ji(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 $n({style:ji(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 I=b.get("distance");I=I?I+h:h;for(var G=0;G<=A;G++){R=Math.cos(C),D=Math.sin(C);var q=new Go({shape:{x1:R*(g-I)+f,y1:D*(g-I)+p,x2:R*(g-T-I)+f,y2:D*(g-T-I)+p},silent:!0,style:P});P.stroke==="auto"&&q.setStyle({stroke:a((M+G/A)/w)}),d.add(q),C+=E}C-=E}else C+=k}},e.prototype._renderPointer=function(r,n,i,a,o,s,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=[s,l];function C(E,_){var P=b.getItemModel(E),L=P.getModel("pointer"),R=Qt(L.get("width"),o.r),D=Qt(L.get("length"),o.r),M=r.get(["pointer","icon"]),I=L.get("offsetCenter"),N=Qt(I[0],o.r),F=Qt(I[1],o.r),B=L.get("keepAspect"),V;return M?V=Yo(M,N-R/2,F-D,R,D,null,B):V=new jHr({shape:{angle:-Math.PI/2,width:R,r:D,x:N,y:F}}),V.rotation=-(_+Math.PI/2),V.x=o.cx,V.y=o.cy,V}function k(E,_){var P=v.get("roundCap"),L=P?qY:fc,R=v.get("overlap"),D=R?v.get("width"):h/b.count(),M=R?o.r-D:o.r-(E+1)*D,I=R?o.r:o.r-E*D,N=new L({shape:{startAngle:s,endAngle:_,cx:o.cx,cy:o.cy,clockwise:u,r0:M,r:I}});return R&&(N.z2=Zn(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 P=C(E,s);ua(P,{rotation:-((isNaN(+_)?T[0]:Zn(_,S,T,!0))+Math.PI/2)},r),d.add(P),b.setItemGraphicEl(E,P)}if(y){var L=k(E,s),R=v.get("clip");ua(L,{shape:{endAngle:Zn(_,S,T,R)}},r),d.add(L),spe(r.seriesIndex,b.dataType,E,L),g[E]=L}}).update(function(E,_){var P=b.get(x,E);if(m){var L=f.getItemGraphicEl(_),R=L?L.rotation:s,D=C(E,R);D.rotation=R,qn(D,{rotation:-((isNaN(+P)?T[0]:Zn(P,S,T,!0))+Math.PI/2)},r),d.add(D),b.setItemGraphicEl(E,D)}if(y){var M=p[_],I=M?M.shape.endAngle:s,N=k(E,I),F=v.get("clip");qn(N,{shape:{endAngle:Zn(P,S,T,F)}},r),d.add(N),spe(r.seriesIndex,b.dataType,E,N),g[E]=N}}).execute(),b.each(function(E){var _=b.getItemModel(E),P=_.getModel("emphasis"),L=P.get("focus"),R=P.get("blurScope"),D=P.get("disabled"),M=a(Zn(b.get(x,E),S,[0,1],!0));if(m){var I=b.getItemGraphicEl(E),N=b.getItemVisual(E,"style"),F=N.fill;if(I instanceof nl){var B=I.style;I.useStyle(lt({image:B.image,x:B.x,y:B.y,width:B.width,height:B.height},N))}else I.useStyle(N),I.type!=="pointer"&&I.setColor(F);I.setStyle(_.getModel(["pointer","itemStyle"]).getItemStyle()),I.style.fill==="auto"&&I.setStyle("fill",M),I.z2EmphasisLift=0,Ms(I,_),Ea(I,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,Ms(V,_),Ea(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 o=i.get("size"),s=i.get("icon"),l=i.get("offsetCenter"),u=i.get("keepAspect"),h=Yo(s,n.cx-o/2+Qt(l[0],n.r),n.cy-o/2+Qt(l[1],n.r),o,o,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,o){var s=this,l=r.getData(),u=l.mapDimension("value"),h=+r.get("min"),d=+r.get("max"),f=new gr,p=[],g=[],m=r.isAnimationEnabled(),v=r.get(["pointer","showAbove"]);l.diff(this._data).add(function(y){p[y]=new $n({silent:!0}),g[y]=new $n({silent:!0})}).update(function(y,b){p[y]=s._titleEls[b],g[y]=s._detailEls[b]}).execute(),l.each(function(y){var b=l.getItemModel(y),x=l.get(u,y),w=new gr,A=a(Zn(x,[h,d],[0,1],!0)),S=b.getModel("title");if(S.get("show")){var T=S.get("offsetCenter"),C=o.cx+Qt(T[0],o.r),k=o.cy+Qt(T[1],o.r),E=p[y];E.attr({z2:v?0:2,style:ji(S,{x:C,y:k,text:l.getName(y),align:"center",verticalAlign:"middle"},{inheritColor:A})}),w.add(E)}var _=b.getModel("detail");if(_.get("show")){var P=_.get("offsetCenter"),L=o.cx+Qt(P[0],o.r),R=o.cy+Qt(P[1],o.r),D=Qt(_.get("width"),o.r),M=Qt(_.get("height"),o.r),I=r.get(["progress","show"])?l.getItemVisual(y,"style").fill:A,E=g[y],N=_.get("formatter");E.attr({z2:v?0:2,style:ji(_,{x:L,y:R,text:kq(x,N),width:isNaN(D)?null:D,height:isNaN(M)?null:M,align:"center",verticalAlign:"middle"},{inheritColor:I})}),hut(E,{normal:_},x,function(B){return kq(B,N)}),m&&dut(E,y,l,r,{getFormattedLabel:function(B,V,z,U,Q,G){return kq(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}(ki),ZHr=function(t){nt(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 D5(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,tt.color.neutral10]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:tt.color.axisTick,width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:tt.color.axisTickMinor,width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:tt.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:tt.color.neutral00,borderWidth:0,borderColor:tt.color.theme[0]}},title:{show:!0,offsetCenter:[0,"20%"],color:tt.color.secondary,fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:tt.color.transparent,borderWidth:0,borderColor:tt.color.neutral40,width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:tt.color.primary,fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},e}(Ii);function JHr(t){t.registerChartView(KHr),t.registerSeriesModel(ZHr)}var F5="funnel",eWr=function(t){nt(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 L5(Wt(this.getData,this),Wt(this.getRawData,this)),this._defaultLabelLine(r)},e.prototype.getInitialData=function(r,n){return D5(this,{coordDimensions:["value"],encodeDefaulter:Kr(sge,this)})},e.prototype._defaultLabelLine=function(r){sS(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"),o=n.getSum(a);return i.percent=o?+(n.get(a,r)/o*100).toFixed(2):0,i.$vars.push("percent"),i},e.type="series."+F5,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:tt.color.neutral00,borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:tt.color.primary}}},e}(Ii),tWr=["itemStyle","opacity"],rWr=function(t){nt(e,t);function e(r,n){var i=t.call(this)||this,a=i,o=new Ll,s=new $n;return a.setTextContent(s),i.setTextGuideLine(o),i.updateData(r,n,!0),i}return e.prototype.updateData=function(r,n,i){var a=this,o=r.hostModel,s=r.getItemModel(n),l=r.getItemLayout(n),u=s.getModel("emphasis"),h=s.get(tWr);h=h??1,i||np(a),a.useStyle(r.getItemVisual(n,"style")),a.style.lineJoin="round",i?(a.setShape({points:l.points}),a.style.opacity=0,ua(a,{style:{opacity:h}},o,n)):qn(a,{style:{opacity:h},shape:{points:l.points}},o,n),Ms(a,s),this._updateLabel(r,n),Ea(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(r,n){var i=this,a=this.getTextGuideLine(),o=i.getTextContent(),s=r.hostModel,l=r.getItemModel(n),u=r.getItemLayout(n),h=u.label,d=r.getItemVisual(n,"style"),f=d.fill;il(o,Is(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},qn(o,{style:{x:h.x,y:h.y}},s,n),o.attr({rotation:h.rotation,originX:h.x,originY:h.y,z2:10}),Cme(i,Ome(l),{stroke:f})},e}(pc),nWr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=F5,r.ignoreLabelLineUpdate=!0,r}return e.prototype.render=function(r,n,i){var a=r.getData(),o=this._data,s=this.group;a.diff(o).add(function(l){var u=new rWr(a,l);a.setItemGraphicEl(l,u),s.add(u)}).update(function(l,u){var h=o.getItemGraphicEl(u);h.updateData(a,l),s.add(h),a.setItemGraphicEl(l,h)}).remove(function(l){var u=o.getItemGraphicEl(l);Dy(u,r,l)}).execute(),this._data=a},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type=F5,e}(ki);function iWr(t,e){for(var r=t.mapDimension("value"),n=t.mapArray(r,function(l){return l}),i=[],a=e==="ascending",o=0,s=t.count();o-1&&(o="left"),r&&Nr(["left","right"],o)>-1&&(o="bottom")),o==="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"):o==="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"):o==="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"):o==="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"):o==="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")):o==="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")):o==="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")):o==="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 oWr=Ls(F5,sWr);function sWr(t,e){t.eachSeriesByType(F5,function(r){var n=r.getData(),i=n.mapDimension("value"),a=r.get("sort"),o=Ps(r,e),s=ba(r.getBoxLayoutParams(),o.refContainer),l=Ovt(r),u=s.width,h=s.height,d=iWr(n,a),f=s.x,p=s.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 I=n.get(i,D)||0,N=Zn(I,[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=Zn(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;TwWr)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||!vve(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 vve(t,e){var r=t._model;return r.get("axisExpandable")&&r.get("axisExpandTriggerOn")===e}var Eq="parallel",yve=Eq,TWr=function(t){nt(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&&Qr(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){fe(["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=oi(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(a){return(a.get("parallelIndex")||0)===this.componentIndex},this);fe(i,function(a){r.push("dim"+a.get("dim")),n.push(a.componentIndex)})},e.type=yve,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}(pn),CWr=function(t){nt(e,t);function e(r,n,i,a,o){var s=t.call(this,r,n,i)||this;return s.type=a||"value",s.axisIndex=o,s}return e.prototype.isHorizontal=function(){return this.coordinateSystem.getModel().get("layout")!=="horizontal"},e}(cp);function i2(t,e,r,n,i,a){t=t||0;var o=aS(r[1],-r[0]);if(i!=null&&(i=z5(i,[0,o])),a!=null&&(a=Math.max(a,i??0)),n==="all"){var s=Math.abs(aS(e[1],-e[0]));s=z5(s,[0,o]),i=a=z5(s,[i,a]),n=0}e[0]=z5(e[0],r),e[1]=z5(e[1],r);var l=bve(e,n);e[n]+=t;var u=i||0,h=r.slice();l.sign<0?h[0]=aS(h[0],u):h[1]=aS(h[1],-u),e[n]=z5(e[n],h);var d;return d=bve(e,n),i!=null&&(d.sign!==l.sign||d.spana&&(e[1-n]=aS(e[n],d.sign*a)),e}function bve(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 z5(t,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,t))}var OWr=function(){function t(e,r,n){this.type=Eq,this._axesMap=qt(),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;fe(i,function(o,s){var l=a[s],u=r.getComponent("parallelAxis",l),h=tB(u),d=this._axesMap.set(o,new CWr(o,x5(u,h,!1),[0,0],h,l));d.onBand=iB(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){fe(this.dimensions,function(n){var i=this._axesMap.get(n);KS(i,C5),O5(i)},this)},t.prototype.containPoint=function(e){var r=this._makeLayoutInfo(),n=r.axisBase,i=r.layoutBase,a=r.pixelDimIndex,o=e[1-a],s=e[a];return o>=n&&o<=n+r.axisLength&&s>=i&&s<=i+r.layoutLength},t.prototype.getModel=function(){return this._model},t.prototype.resize=function(e,r){var n=Ps(e,r).refContainer;this._rect=ba(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"),o=a==="horizontal"?0:1,s=r[i[o]],l=[0,s],u=this.dimensions.length,h=_q(e.get("axisExpandWidth"),l),d=_q(e.get("axisExpandCount")||0,[0,u]),f=e.get("axisExpandable")&&u>3&&u>d&&d>1&&h>0&&s>0,p=e.get("axisExpandWindow"),g;if(p)g=_q(p[1]-p[0],l),p[1]=p[0]+g;else{g=_q(h*(d-1),l);var m=e.get("axisExpandCenter")||Jf(u/2);p=[h*m-g/2],p[1]=p[0]+g}var v=(s-g)/(u-d);v<3&&(v=0);var y=[Jf(Yn(p[0]/h,1))+1,rS(Yn(p[1]/h,1))-1],b=v/h*p[0];return{layout:a,pixelDimIndex:o,layoutBase:r[n[o]],layoutLength:s,axisBase:r[n[1-o]],axisLength:r[i[1-o]],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(o){var s=[0,i.axisLength],l=o.inverse?1:0;o.setExtent(s[l],s[1-l])}),fe(n,function(o,s){var l=(i.axisExpandable?EWr:kWr)(s,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},h={horizontal:YH/2,vertical:0},d=[u[a].x+e.x,u[a].y+e.y],f=h[a],p=ka();xy(p,p,f),sg(p,p,d),this._axesLayout[o]={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,o=this.dimensions,s=[],l=[];fe(o,function(v){s.push(e.mapDimension(v)),l.push(a.get(v).model)});for(var u=this.hasAxisBrushed(),h=n;ha*(1-d[0])?(u="jump",l=s-a*(1-d[2])):(l=s-a*d[1])>=0&&(l=s-a*(1-d[1]))<=0&&(l=0),l*=r.axisExpandWidth/h,l?i2(l,i,o,"all"):u="none";else{var p=i[1]-i[0],g=o[1]*s/p;i=[rn(0,g-p/2)],i[1]=Oi(o[1],i[0]+p),i[0]=i[1]-p}return{axisExpandWindow:i,behavior:u}},t}();function _q(t,e){return Oi(rn(t,e[0]),e[1])}function kWr(t,e){var r=e.layoutLength/(e.axisCount-1);return{position:r*t,axisNameAvailableWidth:r,axisLabelShow:!0}}function EWr(t,e){var r=e.layoutLength,n=e.axisExpandWidth,i=e.axisCount,a=e.axisCollapseWidth,o=e.winInnerIndices,s,l=a,u=!1,h;return t=0;i--)Rl(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,o=n.length;aMWr}function Bvt(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function $vt(t,e,r,n){var i=new gr;return i.add(new nn({name:"main",style:kve(r),silent:!0,draggable:!0,cursor:"move",drift:Kr(Uvt,t,e,i,["n","s","w","e"]),ondragend:Kr(AT,e,{isEnd:!0})})),fe(n,function(a){i.add(new nn({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:Kr(Uvt,t,e,i,a),ondragend:Kr(AT,e,{isEnd:!0})}))}),i}function Fvt(t,e,r,n){var i=n.brushStyle.lineWidth||0,a=U5(i,IWr),o=r[0][0],s=r[1][0],l=o-i/2,u=s-i/2,h=r[0][1],d=r[1][1],f=h-a+i/2,p=d-a+i/2,g=h-o,m=d-s,v=g+i,y=m+i;zy(t,e,"main",o,s,g,m),n.transformable&&(zy(t,e,"w",l,u,a,y),zy(t,e,"e",f,u,a,y),zy(t,e,"n",l,u,v,a),zy(t,e,"s",l,p,v,a),zy(t,e,"nw",l,u,a,a),zy(t,e,"ne",f,u,a,a),zy(t,e,"sw",l,p,a,a),zy(t,e,"se",f,p,a,a))}function Ove(t,e){var r=e.__brushOption,n=r.transformable,i=e.childAt(0);i.useStyle(kve(r)),i.attr({silent:!n,cursor:n?"move":"default"}),fe([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=e.childOfName(a.join("")),s=a.length===1?Eve(t,a[0]):zWr(t,a);o&&o.attr({silent:!n,invisible:!n,cursor:n?NWr[s]+"-resize":null})})}function zy(t,e,r,n,i,a,o){var s=e.childOfName(r);s&&s.setShape(VWr(_ve(t,e,[[n,i],[n+a,i+o]])))}function kve(t){return mr({strokeNoScale:!0},t.brushStyle)}function zvt(t,e,r,n){var i=[WB(t,r),WB(e,n)],a=[U5(t,r),U5(e,n)];return[[i[0],a[0]],[i[1],a[1]]]}function FWr(t){return kS(t.group)}function Eve(t,e){var r={w:"left",e:"right",n:"top",s:"bottom"},n={left:"w",right:"e",top:"n",bottom:"s"},i=TW(r[e],FWr(t));return n[i]}function zWr(t,e){var r=[Eve(t,e[0]),Eve(t,e[1])];return(r[0]==="e"||r[0]==="w")&&r.reverse(),r.join("")}function Uvt(t,e,r,n,i,a){var o=r.__brushOption,s=t.toRectRange(o.range),l=Vvt(e,i,a);fe(n,function(u){var h=PWr[u];s[h[0]][h[1]]+=l[h[0]]}),o.range=t.fromRectRange(zvt(s[0][0],s[1][0],s[0][1],s[1][1])),Ave(e,r),AT(e,{isEnd:!1})}function UWr(t,e,r,n){var i=e.__brushOption.range,a=Vvt(t,r,n);fe(i,function(o){o[0]+=a[0],o[1]+=a[1]}),Ave(t,e),AT(t,{isEnd:!1})}function Vvt(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 _ve(t,e,r){var n=Nvt(t,e);return n&&n!==wT?n.clipPath(r,t._transform):lr(r)}function VWr(t){var e=WB(t[0][0],t[1][0]),r=WB(t[0][1],t[1][1]),n=U5(t[0][0],t[1][0]),i=U5(t[0][1],t[1][1]);return{x:e,y:r,width:n-e,height:i-r}}function QWr(t,e,r){if(!(!t._brushType||HWr(t,e.offsetX,e.offsetY))){var n=t._zr,i=t._covers,a=Tve(t,e,r);if(!t._dragging)for(var o=0;on.getWidth()||r<0||r>n.getHeight()}var Rq={lineX:Wvt(0),lineY:Wvt(1),rect:{createCover:function(t,e){function r(n){return n}return $vt({toRectRange:r,fromRectRange:r},t,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(t){var e=Bvt(t);return zvt(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(t,e,r,n){Fvt(t,e,r,n)},updateCommon:Ove,contain:Dve},polygon:{createCover:function(t,e){var r=new gr;return r.add(new Ll({name:"main",style:kve(e),silent:!0})),r},getCreatingRange:function(t){return t},endCreating:function(t,e){e.remove(e.childAt(0)),e.add(new pc({name:"main",draggable:!0,drift:Kr(UWr,t,e),ondragend:Kr(AT,t,{isEnd:!0})}))},updateCoverShape:function(t,e,r,n){e.childAt(0).setShape({points:_ve(t,e,r)})},updateCommon:Ove,contain:Dve}};function Wvt(t){return{createCover:function(e,r){return $vt({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=Bvt(e),n=WB(r[0][t],r[1][t]),i=U5(r[0][t],r[1][t]);return[n,i]},updateCoverShape:function(e,r,n,i){var a,o=Nvt(e,r);if(o!==wT&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(t);else{var s=e._zr;a=[0,[s.getWidth(),s.getHeight()][1-t]]}var l=[n,a];t&&l.reverse(),Fvt(e,r,l,i)},updateCommon:Ove,contain:Dve}}function Yvt(t){return t=Lve(t),function(e){return Rpe(e,t)}}function qvt(t,e){return t=Lve(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 jvt(t,e,r){var n=Lve(t);return function(i,a){return n.contain(a[0],a[1])&&!Imt(i,e,r)}}function Lve(t){return pr.create(t)}var WWr=function(t){nt(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 wve(n.getZr())).on("brush",Wt(this._onBrush,this))},e.prototype.render=function(r,n,i,a){if(!YWr(r,n,a)){this.axisModel=r,this.api=i,this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new gr,this.group.add(this._axisGroup),!!r.get("show")){var s=jWr(r,n),l=s.coordinateSystem,u=r.getAreaSelectStyle(),h=u.width,d=r.axis.dim,f=l.getAxisLayout(d),p=lt({strokeContainThreshold:h},f),g=new Bu(r,i,p);g.build(),this._axisGroup.add(g.group),this._refreshBrushController(p,u,r,s,h,i),C8(o,this._axisGroup,r)}}},e.prototype._refreshBrushController=function(r,n,i,a,o,s){var l=i.axis.getExtent(),u=l[1]-l[0],h=Math.min(30,Math.abs(u)*.1),d=pr.create({x:l[0],y:-o/2,width:u,height:o});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:Yvt(d),isTargetByCursor:jvt(d,s,a),getLinearBrushOtherExtent:qvt(d,0)}]).enableBrush({brushType:"lineX",brushStyle:n,removeOnClick:!0}).updateCovers(qWr(i))},e.prototype._onBrush=function(r){var n=r.areas,i=this.axisModel,a=i.axis,o=vt(n,function(s){return[a.coordToData(s.range[0],!0),a.coordToData(s.range[1],!0)]});(!i.option.realtime===r.isEnd||r.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:o})},e.prototype.dispose=function(){this._brushController.dispose()},e.type="parallelAxis",e}(Xi);function YWr(t,e,r){return r&&r.type==="axisAreaSelect"&&e.findComponents({mainType:"parallelAxis",query:r})[0]===t}function qWr(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 jWr(t,e){return e.getComponent("parallel",t.get("parallelIndex"))}var XWr={type:"axisAreaSelect",event:"axisAreaSelected"};function KWr(t){t.registerAction(XWr,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 ZWr={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function Xvt(t){t.registerComponentView(AWr),t.registerComponentModel(TWr),t.registerCoordinateSystem("parallel",RWr),t.registerPreprocessor(yWr),t.registerComponentModel(xve),t.registerComponentView(WWr),M5(t,"parallel",xve,ZWr),KWr(t)}function JWr(t){Xr(Xvt),t.registerChartView(uWr),t.registerSeriesModel(fWr),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,vWr)}var Uy="sankey",eYr=function(t){nt(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||[],o=r.levels||[];this.levelModels=[];for(var s=this.levelModels,l=0;l=0&&(s[o[l].depth]=new bn(o[l],this,n));var u=X0e(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 o=this.getDataParams(r,i),s=o.data,l=o.value,u=s.source+" -- "+s.target;return fs("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 fs("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),o=a.getLayout().value;i.value=o}return i},e.prototype.__ownRoamView=function(){return this.coordinateSystem},e.type="series."+Uy,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:tt.color.neutral50,opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:tt.color.primary}},animationEasing:"linear",animationDuration:1e3},e}(Ii),tYr=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}(),rYr=function(t){nt(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new tYr},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(){_y(this)},e.prototype.downplay=function(){Ry(this)},e}(yn),nYr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=Uy,r._mainGroup=new gr,r}return e.prototype.init=function(r,n){this._controller=new hT(n.getZr()),this.group.add(this._mainGroup),this._firstRender=!0},e.prototype.render=function(r,n,i){var a=r.getGraph(),o=this._mainGroup,s=r.layoutInfo,l=s.width,u=s.height,h=r.getData(),d=r.getData("edge"),f=r.get("orient");o.removeAll(),o.x=s.x,o.y=s.y,this._updateViewCoordSys(r,i),mq(r,i,this._controller,u0t(o),null),a.eachEdge(function(p){var g=new rYr,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(),C=p.node2.getModel(),k=C.get("localX"),E=C.get("localY"),_=p.getLayout(),P,L,R,D,M,I,N,F;g.shape.extent=Math.max(1,_.dy),g.shape.orient=f,f==="vertical"?(P=(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=P,I=L*(1-b)+D*b,N=R,F=L*b+D*(1-b)):(P=(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=P*(1-b)+R*b,I=L,N=P*b+R*(1-b),F=D),g.setShape({x1:P,y1:L,x2:R,y2:D,cpx1:M,cpy1:I,cpx2:N,cpy2:F}),g.useStyle(y.getItemStyle()),Kvt(g.style,f,p);var B=""+v.get("value"),V=Is(v,"edgeLabel");il(g,V,{labelFetcher:{getFormattedLabel:function(Q,G,q,Y,ne,X){return r.getFormattedLabel(Q,G,"edge",Y,Bh(ne,V.normal&&V.normal.get("formatter"),B),X)}},labelDataIndex:p.dataIndex,defaultText:B}),g.setTextConfig({position:"inside"});var z=v.getModel("emphasis");Ms(g,v,"lineStyle",function(Q){var G=Q.getItemStyle();return Kvt(G,f,p),G}),o.add(g),d.setItemGraphicEl(p.dataIndex,g);var U=z.get("focus");Ea(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 nn({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});il(w,Is(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),Ms(w,m),o.add(w),h.setItemGraphicEl(p.dataIndex,w),Cr(w).dataType="node";var A=b.get("focus");Ea(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()&&o.setClipPath(iYr(o.getBoundingRect(),r,function(){o.removeClipPath()})),this._data=r.getData(),this._firstRender=!1},e.prototype.__updateOnOwnRoam=function(r,n,i){r2(this.group,n0,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=M0e(r,n,i.x,i.y,i.width,i.height);r2(this.group,n0,a,this._firstRender?null:r)},e.type=Uy,e}(ki);function Kvt(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");$t(n)&&$t(i)&&(t.fill=new TS(0,0,+(e==="horizontal"),+(e==="vertical"),[{color:n,offset:0},{color:i,offset:1}]))}}function iYr(t,e,r){var n=new nn({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return ua(n,{shape:{width:t.width+20}},e,r),n}var aYr=Ls(Uy,oYr);function oYr(t,e){t.eachSeriesByType(Uy,function(r){var n=r.get("nodeWidth"),i=r.get("nodeGap"),a=Ps(r,e).refContainer,o=ba(r.getBoxLayoutParams(),a);r.layoutInfo=o;var s=o.width,l=o.height,u=r.getGraph(),h=u.nodes,d=u.edges;lYr(h);var f=oi(h,function(v){return v.getLayout().value===0}),p=f.length!==0?0:r.get("layoutIterations"),g=r.get("orient"),m=r.get("nodeAlign");sYr(h,d,n,i,s,l,p,g,m)})}function sYr(t,e,r,n,i,a,o,s,l){cYr(t,e,r,i,a,s,l),fYr(t,e,a,i,n,o,s),AYr(t,s)}function lYr(t){fe(t,function(e){var r=o2(e.outEdges,Dq),n=o2(e.inEdges,Dq),i=e.getValue()||0,a=Math.max(r,n,i);e.setLayout({value:a},!0)})}function cYr(t,e,r,n,i,a,o){for(var s=[],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;o&&o!=="left"&&uYr(t,o,a,T);var C=a==="vertical"?(i-r)/T:(n-r)/T;dYr(t,C,a)}function Zvt(t){var e=t.hostGraph.data.getRawDataItem(t.dataIndex);return e.depth!=null&&e.depth>=0}function uYr(t,e,r,n){if(e==="right"){for(var i=[],a=t,o=0;a.length;){for(var s=0;s0;a--)l*=.99,mYr(s,l,o),Mve(s,i,r,n,o),wYr(s,l,o),Mve(s,i,r,n,o)}function pYr(t,e){var r=[],n=e==="vertical"?"y":"x",i=Ffe(t,function(a){return a.getLayout()[n]});return Rl(i.keys),fe(i.keys,function(a){r.push(i.buckets.get(a))}),r}function gYr(t,e,r,n,i,a){var o=1/0;fe(t,function(s){var l=s.length,u=0;fe(s,function(d){u+=d.getLayout().value});var h=a==="vertical"?(n-(l-1)*i)/u:(r-(l-1)*i)/u;h0&&(s=l.getLayout()[a]+u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),h=l.getLayout()[a]+l.getLayout()[f]+e;var g=i==="vertical"?n:r;if(u=h-e-g,u>0){s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0),h=s;for(var p=d-2;p>=0;--p)l=o[p],u=l.getLayout()[a]+l.getLayout()[f]+e-h,u>0&&(s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),h=l.getLayout()[a]}})}function mYr(t,e,r){fe(t.slice().reverse(),function(n){fe(n,function(i){if(i.outEdges.length){var a=o2(i.outEdges,vYr,r)/o2(i.outEdges,Dq);if(isNaN(a)){var o=i.outEdges.length;a=o?o2(i.outEdges,yYr,r)/o:0}if(r==="vertical"){var s=i.getLayout().x+(a-a2(i,r))*e;i.setLayout({x:s},!0)}else{var l=i.getLayout().y+(a-a2(i,r))*e;i.setLayout({y:l},!0)}}})})}function vYr(t,e){return a2(t.node2,e)*t.getValue()}function yYr(t,e){return a2(t.node2,e)}function bYr(t,e){return a2(t.node1,e)*t.getValue()}function xYr(t,e){return a2(t.node1,e)}function a2(t,e){return e==="vertical"?t.getLayout().x+t.getLayout().dx/2:t.getLayout().y+t.getLayout().dy/2}function Dq(t){return t.getValue()}function o2(t,e,r){for(var n=0,i=t.length,a=-1;++ao&&(o=l)}),fe(n,function(s){var l=new ol({type:"color",mappingMethod:"linear",dataExtent:[a,o],visual:e.get("color")}),u=l.mapValueToVisual(s.getLayout().value),h=s.getModel().get(["itemStyle","color"]);h!=null?(s.setVisual("color",h),s.setVisual("style",{fill:h})):(s.setVisual("color",u),s.setVisual("style",{fill:u}))})}i.length&&fe(i,function(s){var l=s.getModel().get("lineStyle");s.setVisual("style",l)})})}function CYr(t){t.registerChartView(nYr),t.registerSeriesModel(eYr),t.registerLayout(aYr),t.registerVisual(SYr),t.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(e,r){r.eachComponent({mainType:Hm,subType:Uy,query:e},function(n){n.setNodePosition(e.dataIndex,[e.localX,e.localY])})}),L0e(t,Hm,Uy)}var Jvt=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")),o=i.get("type"),s=a.get("type"),l,u=e.layout;o==="category"?(u="horizontal",n=i.getOrdinalMeta(),l=!this._hasEncodeRule("x")):s==="category"&&(u="vertical",n=a.getOrdinalMeta(),l=!this._hasEncodeRule("y")),u||(u=s==="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=[];fe(y,function(A,S){var T;ft(A)?(T=A.slice(),A.unshift(S)):ft(A.value)?(T=lt({},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:pY(m),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:p,type:pY(v),dimsDef:x.slice()}];return D5(this,{coordDimensions:w,dimensionsCount:x.length+1,encodeDefaulter:Kr(Hut,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 Lq(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 BYr={type:"echarts:boxplot",transform:function(e){var r=e.upstream;if(r.sourceFormat!==Dl){var n="";si(n)}var i=NYr(r.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function $Yr(t){t.registerSeriesModel(eyt),t.registerChartView(OYr),t.registerLayout(DYr),t.registerTransform(BYr),PYr(t)}var s2="candlestick",nyt=function(t){nt(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."+s2,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}(Ii);Qo(nyt,Jvt,!0);var FYr=["itemStyle","borderColor"],zYr=["itemStyle","borderColor0"],UYr=["itemStyle","borderColorDoji"],VYr=["itemStyle","color"],QYr=["itemStyle","color0"];function Ive(t,e){return e.get(t>0?VYr:QYr)}function Pve(t,e){return e.get(t===0?UYr:t>0?FYr:zYr)}var GYr={seriesType:s2,plan:US(),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 o=i.getItemModel(a),s=i.getItemLayout(a).sign,l=o.getItemStyle();l.fill=Ive(s,o),l.stroke=Pve(s,o)||l.fill;var u=i.ensureUniqueItemVisual(a,"style");lt(u,l)}}}}}},HYr=["color","borderColor"],WYr=function(t){nt(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){Gx(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,o=n.getLayout("isSimpleBox"),s=r.get("clip",!0),l=r.coordinateSystem,u=l.getArea&&l.getArea(),h=s&&iT(l,!1,r);this._data||a.removeAll();var d=iyt(r);n.diff(i).add(function(f){if(n.hasValue(f)){var p=n.getItemLayout(f),g=s?Lq(u,p):pB;if(g===mB)return;var m=Nve(p,f,d,!0);ua(m,{shape:{points:p.ends}},r,f),_5(g===gB,m,h),Bve(m,n,f,o),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=s?Lq(u,m):pB;if(v===mB){a.remove(g);return}g?(qn(g,{shape:{points:m.ends}},r,f),np(g)):g=Nve(m,f,d),Bve(g,n,f,o),_5(v===gB,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(),ayt(r,this.group);var n=r.get("clip",!0)?iT(r.coordinateSystem,!1,r):null;_5(!!n,this.group,n)},e.prototype._incrementalRenderNormal=function(r,n){for(var i=n.getData(),a=i.getLayout("isSimpleBox"),o=iyt(n),s;(s=r.next())!=null;){var l=i.getItemLayout(s),u=Nve(l,s,o);Bve(u,i,s,a),u.incremental=$m(n),this.group.add(u),this._progressiveEls.push(u)}},e.prototype._incrementalRenderLarge=function(r,n){ayt(n,this.group,this._progressiveEls,!0)},e.prototype.remove=function(r){this._clear()},e.prototype._clear=function(){this.group.removeAll(),_5(!1,this.group,null),this._data=null},e.type=s2,e}(ki),YYr=function(){function t(){}return t}(),qYr=function(t){nt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="normalCandlestickBox",n}return e.prototype.getDefaultShape=function(){return new YYr},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}(yn);function Nve(t,e,r,n){var i=t.ends;return new qYr({shape:{points:n?jYr(i,r,t):i},z2:100})}function Bve(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,Ms(t,i);var o=e.getItemLayout(r).sign;fe(t.states,function(l,u){var h=i.getModel(u),d=Ive(o,h),f=Pve(o,h)||d,p=l.style||(l.style={});d&&(p.fill=d),f&&(p.stroke=f)});var s=i.getModel("emphasis");Ea(t,s.get("focus"),s.get("blurScope"),s.get("disabled"))}function jYr(t,e,r){return vt(t,function(n){return n=n.slice(),n[e]=r.initBaseline,n})}function iyt(t){return t.getWhiskerBoxesLayout()==="horizontal"?1:0}var XYr=function(){function t(){}return t}(),$ve=function(t){nt(e,t);function e(r){var n=t.call(this,r)||this;return n.type="largeCandlestickBox",n}return e.prototype.getDefaultShape=function(){return new XYr},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 I(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]=SW(Q[i]+n/2,1,!1),G[i]=SW(G[i]-n/2,1,!0),U?V.push(Q,G):V.push(G,Q)}function F(V,z,U){var Q=I(V,U),G=I(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]=SW(V[i],1),V}}function g(m,v){for(var y=e0(m.count*4),b=0,x,w=[],A=[],S,T=v.getStore(),C=!!t.get(["itemStyle","borderColorDoji"]);(S=m.next())!=null;){var k=T.get(s,S),E=T.get(u,S),_=T.get(h,S),P=T.get(d,S),L=T.get(f,S);if(isNaN(k)||isNaN(P)||isNaN(L)){y[b++]=NaN,b+=3;continue}y[b++]=oyt(T,S,E,_,h,C),w[i]=k,w[a]=P,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 oyt(t,e,r,n,i,a){var o;return r>n?o=-1:r0?t.get(i,e-1)<=n?1:-1:1,o}function eqr(t,e){var r=t.getBaseAxis(),n=mc(r,{fromStat:{key:lT(s2)},min:1}).w,i=Qt(Jt(t.get("barMaxWidth"),n),n),a=Qt(Jt(t.get("barMinWidth"),1),n),o=t.get("barWidth");return o!=null?Qt(o,n):rn(Oi(n/2,i),a)}function tqr(t){ZYr(t,function(){var e=lT(s2);vme(t,{key:e,seriesType:s2,getMetrics:i0e}),EY(e,WY(e))})}function rqr(t){t.registerChartView(WYr),t.registerSeriesModel(nyt),t.registerPreprocessor(KYr),t.registerVisual(GYr),t.registerLayout(JYr),tqr(t)}function syt(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 nqr=function(t){nt(e,t);function e(r,n){var i=t.call(this)||this,a=new dB(r,n),o=new gr;return i.add(a),i.add(o),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,o=this.childAt(1),s=0;s0&&(s=this._getLineLength(a)/h*1e3),s!==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=-s*a.__t),this._animateSymbol(a,s,f,l,u)}this._period=s,this._loop=l,this._roundTrip=u}},e.prototype._animateSymbol=function(r,n,i,a,o){if(n>0){r.__t=0;var s=this,l=r.animate("",a).when(o?n*2:n,{__t:o?2:1}).delay(i).during(function(){s._updateSymbolPosition(r)});a||l.done(function(){s.remove(r)}),l.start()}},e.prototype._getLineLength=function(r){return my(r.__p1,r.__cp1)+my(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,o=r.__t<=1?r.__t:2-r.__t,s=[r.x,r.y],l=s.slice(),u=_l,h=Jde;s[0]=u(n[0],a[0],i[0],o),s[1]=u(n[1],a[1],i[1],o);var d=r.__t<=1?h(n[0],a[0],i[0],o):h(i[0],a[0],n[0],1-o),f=r.__t<=1?h(n[1],a[1],i[1],o):h(i[1],a[1],n[1],1-o);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,o-2)}else{for(l=s;ln);l++);l=Math.min(l-1,o-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}(cyt),lqr=function(){function t(){this.polyline=!1,this.curveness=0,this.segs=[]}return t}(),cqr=function(t){nt(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:tt.color.neutral99,fill:null}},e.prototype.getDefaultShape=function(){return new lqr},e.prototype.buildPath=function(r,n){var i=n.segs,a=n.curveness,o;if(n.polyline)for(o=this._off;o0){r.moveTo(i[o++],i[o++]);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=o,this.notClear=!0)},e.prototype.findDataIndex=function(r,n){var i=this.shape,a=i.segs,o=i.curveness,s=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)*o,y=(f+m)/2-(g-d)*o;if(Ylt(d,f,v,y,g,m,s,r,n))return l}else if(Fx(d,f,g,m,s,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 o=this.hoverDataIdx=this.findDataIndex(r,n);return o>=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,o=1/0,s=-1/0,l=-1/0,u=0;u0&&(o.dataIndex=l+e.__startIndex)})},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}(),hyt={seriesType:"lines",plan:US(),reset:function(t){var e=t.coordinateSystem;if(e){var r=t.get("polyline"),n=t.pipelineContext.large;return{progress:function(i,a){var o=[];if(n){var s=void 0,l=i.end-i.start;if(r){for(var u=0,h=i.start;h0&&h&&u.configLayer(s,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(l/10+.9,1),0)}),o.updateData(a);var d=r.get("clip",!0)&&iT(r.coordinateSystem,!1,r);d?this.group.setClipPath(d):this.group.removeClipPath(),this._lastZlevel=s,this._finished=!0},e.prototype.incrementalPrepareRender=function(r,n,i){var a=r.getData(),o=this._updateLineDraw(a,r);o.incrementalPrepareUpdate(a),this._clearLayer(i),this._finished=!1},e.prototype.incrementalRender=function(r,n,i){this._lineDraw.incrementalUpdate(r,n.getData(),$m(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(),o=this._lineDraw;if(!this._finished||!o||!o.updateLayout)return{update:!0};var s=hyt.reset(r,n,i);s.progress&&s.progress({start:0,end:a.count(),count:a.count()},a),o.updateLayout(),this._clearLayer(i)},e.prototype._updateLineDraw=function(r,n){var i=this._lineDraw,a=this._showEffect(n),o=!!n.get("polyline"),s=n.pipelineContext,l=s.large;return(!i||a!==this._hasEffet||o!==this._isPolyline||l!==this._isLargeDraw)&&(i&&i.remove(),i=this._lineDraw=l?new uqr:new lve(o?a?sqr:uyt:a?cyt:sve),this._hasEffet=a,this._isPolyline=o,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=Npe(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}(ki),dqr=typeof Uint32Array>"u"?Array:Uint32Array,fqr=typeof Float64Array>"u"?Array:Float64Array;function dyt(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),uH([i,r[0],r[1]])}))}var pqr=function(t){nt(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||[],dyt(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(dyt(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=b_(this._flatCoords,n.flatCoords),this._flatCoordsOffset=b_(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],o=0;o ")}return fs("nameValue",{name:l,value:o,noValue:o==null||isNaN(o)})},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}(Ii);function Mq(t){return t instanceof Array||(t=[t,t]),t}var gqr={seriesType:"lines",reset:function(t){var e=Mq(t.get("symbol")),r=Mq(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,o){var s=a.getItemModel(o),l=Mq(s.getShallow("symbol",!0)),u=Mq(s.getShallow("symbolSize",!0));l[0]&&a.setItemVisual(o,"fromSymbol",l[0]),l[1]&&a.setItemVisual(o,"toSymbol",l[1]),u[0]&&a.setItemVisual(o,"fromSymbolSize",u[0]),u[1]&&a.setItemVisual(o,"toSymbolSize",u[1])}return{dataEach:n.hasItemOption?i:null}}};function mqr(t){t.registerChartView(hqr),t.registerSeriesModel(pqr),t.registerLayout(hyt),t.registerVisual(gqr)}var vqr=256,yqr=function(){function t(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=tl.createCanvas();this.canvas=e}return t.prototype.update=function(e,r,n,i,a,o){var s=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 P=o(x)?l:u;x>0&&(x=x*E+C),A[S++]=P[_],A[S++]=P[_+1],A[S++]=P[_+2],A[S++]=P[_+3]*x*256}else S+=4}return f.putImageData(w,0,0),d},t.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=tl.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=tt.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],o=0,s=0;s<256;s++)e[r](s/255,!0,a),i[o++]=a[0],i[o++]=a[1],i[o++]=a[2],i[o++]=a[3];return i},t}();function bqr(t,e,r){var n=t[1]-t[0];e=vt(e,function(o){return{interval:[(o.interval[0]-t[0])/n,(o.interval[1]-t[0])/n]}});var i=e.length,a=0;return function(o){var s;for(s=a;s=0;s--){var l=e[s].interval;if(l[0]<=o&&o<=l[1]){a=s;break}}return s>=0&&s=e[0]&&n<=e[1]}}var wqr=function(t){nt(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(s){s.eachTargetSeries(function(l){l===r&&(a=s)})}),this._progressiveEls=null,this.group.removeAll();var o=r.coordinateSystem;o.type==="cartesian2d"||o.type==="calendar"||o.type==="matrix"?this._renderOnGridLike(r,i,0,r.getData().count()):lgt(o)&&this._renderOnGeo(o,r,a,i)},e.prototype.incrementalPrepareRender=function(r,n,i){this.group.removeAll()},e.prototype.incrementalRender=function(r,n,i,a){var o=n.coordinateSystem;o&&(lgt(o)?this.render(n,i,a):(this._progressiveEls=[],this._renderOnGridLike(n,a,r.start,r.end,!0)))},e.prototype.eachRendered=function(r){Gx(this._progressiveEls||this.group,r)},e.prototype._renderOnGridLike=function(r,n,i,a,o){var s=r.coordinateSystem,l=aT(s,"cartesian2d"),u=aT(s,"matrix"),h,d,f,p;if(l){var g=s.getAxis("x"),m=s.getAxis("y");h=mc(g).w+.5,d=mc(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=Is(r),T=r.getModel("emphasis"),C=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")],P=i;Pf[1]||Mp[1])continue;var I=s.dataToPoint([D,M]);L=new nn({shape:{x:I[0]-h/2,y:I[1]-d/2,width:h,height:d},style:R})}else if(u){var N=s.dataToLayout([y.get(_[0],P),y.get(_[1],P)]).rect;if(cc(N.x))continue;L=new nn({z2:1,shape:N,style:R})}else{if(isNaN(y.get(_[1],P)))continue;var F=s.dataToLayout([y.get(_[0],P)]),N=F.contentRect||F.rect;if(cc(N.x)||cc(N.y))continue;L=new nn({z2:1,shape:N,style:R})}if(y.hasItemOption){var B=y.getItemModel(P),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"]),C=V.get("focus"),k=V.get("blurScope"),E=V.get("disabled"),S=Is(B)}L.shape.r=A;var z=r.getRawValue(P),U="-";z&&z[2]!=null&&(U=z[2]+""),il(L,S,{labelFetcher:r,labelDataIndex:P,defaultOpacity:R.opacity,defaultText:U}),L.ensureState("emphasis").style=b,L.ensureState("blur").style=x,L.ensureState("select").style=w,Ea(L,C,k,E),L.incremental=$m(r,o),o&&(L.states.emphasis.hoverLayer=Y_),v.add(L),y.setItemGraphicEl(P,L),this._progressiveEls&&this._progressiveEls.push(L)}},e.prototype._renderOnGeo=function(r,n,i,a){var o=i.targetVisuals.inRange,s=i.targetVisuals.outOfRange,l=n.getData(),u=this._hmLayer||this._hmLayer||new yqr;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,C,k){var E=r.dataToPoint([T,C]);return E[0]-=f,E[1]-=p,E.push(k),E}),w=i.getExtent(),A=i.type==="visualMap.continuous"?xqr(w,i.option.range):bqr(w,i.getPieceList(),i.option.selected);u.update(x,v,y,o.color.getNormalizer(),{inRange:o.color.getColorMapper(),outOfRange:s.color.getColorMapper()},A);var S=new nl({style:{width:v,height:y,x:f,y:p,image:u.canvas},silent:!0});this.group.add(S)},e.type="heatmap",e}(ki),Aqr=function(t){nt(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 jm(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var r=r5.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:tt.color.primary}}},e}(Ii);function Sqr(t){t.registerChartView(wqr),t.registerSeriesModel(Aqr)}var Tqr=["itemStyle","borderWidth"],fyt=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],zve=new Wm,Cqr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=xB,r}return e.prototype.render=function(r,n,i){var a=this.group,o=r.getData(),s=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:fyt[+h],categoryDim:fyt[1-+h]};o.diff(s).add(function(g){if(o.hasValue(g)){var m=xyt(o,g),v=pyt(o,g,m,f),y=wyt(o,f,v);o.setItemGraphicEl(g,y),a.add(y),Tyt(y,f,v)}}).update(function(g,m){var v=s.getItemGraphicEl(m);if(!o.hasValue(g)){a.remove(v);return}var y=xyt(o,g),b=pyt(o,g,y,f),x=Syt(o,b);v&&x!==v.__pictorialShapeStr&&(a.remove(v),o.setItemGraphicEl(g,null),v=null),v?Lqr(v,f,b):v=wyt(o,f,b,!0),o.setItemGraphicEl(g,v),v.__pictorialSymbolMeta=b,a.add(v),Tyt(v,f,b)}).remove(function(g){var m=s.getItemGraphicEl(g);m&&Ayt(s,g,m.__pictorialSymbolMeta.animationModel,m)}).execute();var p=r.get("clip",!0)?iT(r.coordinateSystem,!1,r):null;return p?a.setClipPath(p):a.removeClipPath(),this._data=o,this.group},e.prototype.remove=function(r,n){var i=this.group,a=this._data;r.get("animation")?a&&a.eachItemGraphicEl(function(o){Ayt(a,Cr(o).dataIndex,r,o)}):i.removeAll()},e.type=xB,e}(ki);function pyt(t,e,r,n){var i=t.getItemLayout(e),a=r.get("symbolRepeat"),o=r.get("symbolClip"),s=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:o,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};Oqr(r,a,i,n,f),kqr(t,e,i,a,o,f.boundingLength,f.pxSign,h,n,f),Eqr(r,f.symbolScale,u,n,f);var p=f.symbolSize,g=QS(r.get("symbolOffset"),p);return _qr(r,p,i,a,o,g,s,f.valueLineWidth,f.boundingLength,f.repeatCutLength,n,f),f}function Oqr(t,e,r,n,i){var a=n.valueDim,o=t.get("symbolBoundingData"),s=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),l=s.toGlobalCoord(s.dataToCoord(0)),u=1-+(r[a.wh]<=0),h;if(ft(o)){var d=[Uve(s,o[0])-l,Uve(s,o[1])-l];d[1]=0?1:-1:h>0?1:-1}function Uve(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function kqr(t,e,r,n,i,a,o,s,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]/s,g[1]/s];m[h.index]*=(l.isHorizontal?-1:1)*o}function Eqr(t,e,r,n,i){var a=t.get(Tqr)||0;a&&(zve.attr({scaleX:e[0],scaleY:e[1],rotation:r}),zve.updateTransform(),a/=zve.getLineScale(),a*=e[n.valueDim.index]),i.valueLineWidth=a||0}function _qr(t,e,r,n,i,a,o,s,l,u,h,d){var f=h.categoryDim,p=h.valueDim,g=d.pxSign,m=Math.max(e[p.index]+s,0),v=m;if(n){var y=Math.abs(l),b=Gc(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=Ife(n),C=T?n:Cyt((y+S)/A),k=y-C*m;w=k/2/(x?C:Math.max(C-1,1)),A=m+w*2,S=x?0:w*2,!T&&n!=="fixed"&&(C=u?Cyt((Math.abs(u)+S)/A):0),v=C*A-S,d.repeatTimes=C,d.symbolMargin=w}var E=g*(v/2),_=d.pathPosition=[];_[f.index]=r[f.wh]/2,_[p.index]=o==="start"?E:o==="end"?l-E:l/2,a&&(_[0]+=a[0],_[1]+=a[1]);var P=d.bundlePosition=[];P[f.index]=r[f.xy],P[p.index]=r[p.xy];var L=d.barRectShape=lt({},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 gyt(t){var e=t.symbolPatternSize,r=Yo(t.symbolType,-e/2,-e/2,e,e);return r.attr({culling:!0}),r.type!=="image"&&r.setStyle({strokeNoScale:!0}),r}function myt(t,e,r,n){var i=t.__pictorialBundle,a=r.symbolSize,o=r.valueLineWidth,s=r.pathPosition,l=e.valueDim,u=r.repeatTimes||0,h=0,d=a[e.valueDim.index]+o+r.symbolMargin*2;for(Vve(t,function(m){m.__pictorialAnimationIndex=h,m.__pictorialRepeatTimes=u,h0:y<0)&&(b=u-1-m),v[l.index]=d*(b-u/2+.5)+s[l.index],{x:v[0],y:v[1],scaleX:r.symbolScale[0],scaleY:r.symbolScale[1],rotation:r.rotation}}}function vyt(t,e,r,n){var i=t.__pictorialBundle,a=t.__pictorialMainPath;a?V5(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=gyt(r),i.add(a),V5(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 yyt(t,e,r){var n=lt({},e.barRectShape),i=t.__pictorialBarRect;i?V5(i,null,{shape:n},e,r):(i=t.__pictorialBarRect=new nn({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),i.disableMorphing=!0,t.add(i))}function byt(t,e,r,n){if(r.symbolClip){var i=t.__pictorialClipPath,a=lt({},r.clipShape),o=e.valueDim,s=r.animationModel,l=r.dataIndex;if(i)qn(i,{shape:a},s,l);else{a[o.wh]=0,i=new nn({shape:a}),t.__pictorialBundle.setClipPath(i),t.__pictorialClipPath=i;var u={};u[o.wh]=r.clipShape[o.wh],RS[n?"updateProps":"initProps"](i,{shape:u},s,l)}}}function xyt(t,e){var r=t.getItemModel(e);return r.getAnimationDelayParams=Rqr,r.isAnimationEnabled=Dqr,r}function Rqr(t){return{index:t.__pictorialAnimationIndex,count:t.__pictorialRepeatTimes}}function Dqr(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function wyt(t,e,r,n){var i=new gr,a=new gr;return i.add(a),i.__pictorialBundle=a,a.x=r.bundlePosition[0],a.y=r.bundlePosition[1],r.symbolRepeat?myt(i,e,r):vyt(i,e,r),yyt(i,r,n),byt(i,e,r,n),i.__pictorialShapeStr=Syt(t,r),i.__pictorialSymbolMeta=r,i}function Lqr(t,e,r){var n=r.animationModel,i=r.dataIndex,a=t.__pictorialBundle;qn(a,{x:r.bundlePosition[0],y:r.bundlePosition[1]},n,i),r.symbolRepeat?myt(t,e,r,!0):vyt(t,e,r,!0),yyt(t,r,!0),byt(t,e,r,!0)}function Ayt(t,e,r,n){var i=n.__pictorialBarRect;i&&i.removeTextContent();var a=[];Vve(n,function(o){a.push(o)}),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(r=null),fe(a,function(o){Qx(o,{scaleX:0,scaleY:0},r,e,function(){n.parent&&n.parent.remove(n)})}),t.setItemGraphicEl(e,null)}function Syt(t,e){return[t.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function Vve(t,e,r){fe(t.__pictorialBundle.children(),function(n){n!==t.__pictorialBarRect&&e.call(r,n)})}function V5(t,e,r,n,i,a){e&&t.attr(e),n.symbolClip&&!i?r&&t.attr(r):r&&RS[i?"updateProps":"initProps"](t,r,n.animationModel,n.dataIndex,a)}function Tyt(t,e,r){var n=r.dataIndex,i=r.itemModel,a=i.getModel("emphasis"),o=a.getModel("itemStyle").getItemStyle(),s=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");Vve(t,function(m){if(m instanceof nl){var v=m.style;m.useStyle(lt({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=o,f&&(y.scaleX=m.scaleX*1.1,y.scaleY=m.scaleY*1.1),m.ensureState("blur").style=s,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,il(g,Is(i),{labelFetcher:e.seriesModel,labelDataIndex:n,defaultText:E5(e.seriesModel.getData(),n),inheritColor:r.style.fill,defaultOpacity:r.style.opacity,defaultOutsidePosition:p}),Ea(t,h,d,a.get("disabled"))}function Cyt(t){var e=Math.round(t);return Math.abs(t-e)<1e-4?e:Math.ceil(t)}var Mqr=function(t){nt(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."+xB,e.dependencies=["grid"],e.defaultOption=Hx(wB.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:tt.color.primary}}}),e}(wB);function Iqr(t){t.registerChartView(Cqr),t.registerSeriesModel(Mqr),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,$gt(xB)),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,Fgt(xB)),Ugt(t)}var Qve=2,Q5="themeRiver",Pqr=function(t){nt(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 L5(Wt(this.getData,this),Wt(this.getRawData,this))},e.prototype.fixData=function(r){var n=r.length,i={},a=Ffe(r,function(f){return i.hasOwnProperty(f[0]+"")||(i[f[0]+""]=-1),f[2]}),o=[];a.buckets.each(function(f,p){o.push({name:p,dataList:f})});for(var s=o.length,l=0;la&&(a=s),n.push(s)}for(var u=0;ua&&(a=d)}return{y0:i,max:a}}function Uqr(t){t.registerChartView(Nqr),t.registerSeriesModel(Pqr),t.registerLayout($qr),t.registerProcessor(AB(Q5))}var Vqr=2,Qqr=4,kyt=function(t){nt(e,t);function e(r,n,i,a){var o=t.call(this)||this;o.z2=Vqr,o.textConfig={inside:!0},Cr(o).seriesIndex=n.seriesIndex;var s=new $n({z2:Qqr,silent:r.getModel().get(["label","silent"])});return o.setTextContent(s),o.updateData(!0,r,n,i,a),o}return e.prototype.updateData=function(r,n,i,a,o){this.node=n,n.piece=this,i=i||this._seriesModel,a=a||this._ecModel;var s=this;Cr(s).dataIndex=n.dataIndex;var l=n.getModel(),u=l.getModel("emphasis"),h=n.getLayout(),d=lt({},h);d.label=null;var f=n.getVisual("style");f.lineJoin="bevel";var p=n.getVisual("decal");p&&(f.decal=f5(p,o));var g=r0(l.getModel("itemStyle"),d,!0);lt(d,g),fe(Lu,function(b){var x=s.ensureState(b),w=l.getModel([b,"itemStyle"]);x.style=w.getItemStyle();var A=r0(w,d);A&&(x.shape=A)}),r?(s.setShape(d),s.shape.r=h.r0,ua(s,{shape:{r:h.r}},i,n.dataIndex)):(qn(s,{shape:d},i),np(s)),s.useStyle(f),this._updateLabel(i);var m=l.getShallow("cursor");m&&s.attr("cursor",m),this._seriesModel=i||this._seriesModel,this._ecModel=a||this._ecModel;var v=u.get("focus"),y=v==="relative"?b_(n.getAncestorsIndices(),n.getDescendantIndices()):v==="ancestor"?n.getAncestorsIndices():v==="descendant"?n.getDescendantIndices():v;Ea(this,y,u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(r){var n=this,i=this.node.getModel(),a=i.getModel("label"),o=this.node.getLayout(),s=o.endAngle-o.startAngle,l=(o.startAngle+o.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(s)R&&!oS(M-R)&&M0?(o.virtualPiece?o.virtualPiece.updateData(!1,b,r,n,i):(o.virtualPiece=new kyt(b,r,n,i),h.add(o.virtualPiece)),x.piece.off("click"),o.virtualPiece.on("click",function(w){o._rootToNode(x.parentNode)})):o.virtualPiece&&(h.remove(o.virtualPiece),o.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(o){if(!i&&o.piece&&o.piece===n.target){var s=o.getModel().get("nodeClick");if(s==="rootToNode")r._rootToNode(o);else if(s==="link"){var l=o.getModel(),u=l.get("link");if(u){var h=l.get("target",!0)||"_blank";BW(u,h)}}i=!0}})})},e.prototype._rootToNode=function(r){r!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:Gve,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 o=r[0]-a.cx,s=r[1]-a.cy,l=Math.sqrt(o*o+s*s);return l<=a.r&&l>=a.r0}},e.type=ST,e}(ki),qqr=Ls(ST,jqr);function jqr(t){var e={};function r(n,i,a){if(n.depth===0)return tt.color.neutral50;for(var o=n;o&&o.depth>1;)o=o.parentNode;var s=i.getColorFromPalette(o.name||o.dataIndex+"",e);return n.depth>1&&$t(s)&&(s=OH(s,(n.depth-1)/(a-1)*.5)),s}t.eachSeriesByType(ST,function(n){var i=n.getData(),a=i.tree;a.eachNode(function(o){var s=o.getModel(),l=s.getModel("itemStyle").getItemStyle();l.fill||(l.fill=r(o,n,a.root.height));var u=i.ensureUniqueItemVisual(o.dataIndex,"style");lt(u,l)})})}var Ryt=Math.PI/180,Xqr=Ls(ST,Kqr);function Kqr(t,e){t.eachSeriesByType(ST,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(),o=e.getHeight(),s=Math.min(a,o),l=Qt(n[0],a),u=Qt(n[1],o),h=Qt(i[0],s/2),d=Qt(i[1],s/2),f=-r.get("startAngle")*Ryt,p=r.get("minAngle")*Ryt,g=r.getData().tree.root,m=r.getViewRoot(),v=m.depth,y=r.get("sort");y!=null&&Dyt(m,y);var b=0;fe(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),C=r.get("clockwise"),k=r.get("stillShowZeroSum"),E=C?1:-1,_=function(D,M){if(D){var I=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]),o=r.dataToAngle(i[1]),s=t.coordToPoint([a,o]);return s.push(a,o*Math.PI/180),s},size:Wt(ljr,t)}}}function ujr(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 hjr(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 Myt={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},Iyt=En(Myt);Yf(Ty,function(t,e){return t[e]=1,t},{}),Ty.join(", ");var Iq=["","style","shape","extra"],G5=Gr();function Hve(t,e,r,n,i){var a=t+"Animation",o=H_(t,n,i)||{},s=G5(e).userDuring;return o.duration>0&&(o.during=s?Wt(mjr,{el:e,userDuring:s}):null,o.setToFinal=!0,o.scope=t),lt(o,r[a]),o}function Pq(t,e,r,n){n=n||{};var i=n.dataIndex,a=n.isInit,o=n.clearStyle,s=r.isAnimationEnabled(),l=G5(t),u=e.style;l.userDuring=e.during;var h={},d={};if(yjr(t,e,d),t.type==="compound")for(var f=t.shape.paths,p=e.shape.paths,g=0;g0&&t.animateFrom(v,y)}else fjr(t,e,i||0,r,h);Pyt(t,e),u?t.dirty():t.markRedraw()}function Pyt(t,e){for(var r=G5(t).leaveToProps,n=0;n0&&t.animateFrom(i,a)}}function pjr(t,e){Kt(e,"silent")&&(t.silent=e.silent),Kt(e,"ignore")&&(t.ignore=e.ignore),t instanceof tp&&Kt(e,"invisible")&&(t.invisible=e.invisible),t instanceof yn&&Kt(e,"autoBatch")&&(t.autoBatch=e.autoBatch)}var a0={},gjr={setTransform:function(t,e){return a0.el[t]=e,this},getTransform:function(t){return a0.el[t]},setShape:function(t,e){var r=a0.el,n=r.shape||(r.shape={});return n[t]=e,r.dirtyShape&&r.dirtyShape(),this},getShape:function(t){var e=a0.el.shape;if(e)return e[t]},setStyle:function(t,e){var r=a0.el,n=r.style;return n&&(n[t]=e,r.dirtyStyle&&r.dirtyStyle()),this},getStyle:function(t){var e=a0.el.style;if(e)return e[t]},setExtra:function(t,e){var r=a0.el.extra||(a0.el.extra={});return r[t]=e,this},getExtra:function(t){var e=a0.el.extra;if(e)return e[t]}};function mjr(){var t=this,e=t.el;if(e){var r=G5(e).userDuring,n=t.userDuring;if(r!==n){t.el=t.userDuring=null;return}a0.el=e,n(gjr)}}function Nyt(t,e,r,n){var i=r[t];if(i){var a=e[t],o;if(a){var s=r.transition,l=i.transition;if(l)if(!o&&(o=n[t]={}),TT(l))lt(o,a);else for(var u=qi(l),h=0;h=0){!o&&(o=n[t]={});for(var p=En(a),h=0;h=0)){var f=t.getAnimationStyleProps(),p=f?f.style:null;if(p){!a&&(a=n.style={});for(var g=En(r),u=0;u=0?e.getStore().get(N,M):void 0}var F=e.get(I.name,M),B=I&&I.ordinalMeta;return B?B.categories[F]:F}function T(D,M){M==null&&(M=h);var I=e.getItemVisual(M,"style"),N=I&&I.fill,F=I&&I.opacity,B=x(M,l2).getItemStyle();N!=null&&(B.fill=N),F!=null&&(B.opacity=F);var V={inheritColor:$t(N)?N:tt.color.neutral99},z=w(M,l2),U=ji(z,null,V,!1,!0);U.text=z.getShallow("show")?Jt(t.getFormattedLabel(M,l2),E5(e,M)):null;var Q=_W(z,V,!1);return E(D,B),B=dgt(B,U,Q),D&&k(B,D),B.legacy=!0,B}function C(D,M){M==null&&(M=h);var I=x(M,Qy).getItemStyle(),N=w(M,Qy),F=ji(N,null,null,!0,!0);F.text=N.getShallow("show")?Bh(t.getFormattedLabel(M,Qy),t.getFormattedLabel(M,l2),E5(e,M)):null;var B=_W(N,null,!0);return E(D,I),I=dgt(I,F,B),D&&k(I,D),I.legacy=!0,I}function k(D,M){for(var I in M)Kt(M,I)&&(D[I]=M[I])}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(Lyt,D)){var I=e.getItemVisual(M,"style");return I?I[Lyt[D]]:null}if(Kt(ejr,D))return e.getItemVisual(M,D)}function P(D){if(o.type==="cartesian2d"){var M=o.getBaseAxis();return EUr(mr({axis:M},D))}}function L(){return r.getCurrentSeriesIndices()}function R(D){return $pe(D,r)}}function _jr(t){var e={};return fe(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 tye(t,e,r,n,i,a,o){if(!n){a.remove(e);return}var s=rye(t,e,r,n,i,a);return s&&o.setItemGraphicEl(r,s),s&&Ea(s,n.focus,n.blurScope,n.emphasisDisabled),s}function rye(t,e,r,n,i,a){var o=-1,s=e;e&&Uyt(e,n,i)&&(o=Nr(a.childrenRef(),e),e=null);var l=!e,u=e;u?u.clearStates():(u=Jve(n),s&&Cjr(s,u)),n.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),n.tooltipDisabled&&(u.tooltipDisabled=!0),fp.normal.cfg=fp.normal.conOpt=fp.emphasis.cfg=fp.emphasis.conOpt=fp.blur.cfg=fp.blur.conOpt=fp.select.cfg=fp.select.conOpt=null,fp.isLegacy=!1,Djr(u,r,n,i,l,fp),Rjr(u,r,n,i,l),eye(t,u,r,n,fp,i,l),Kt(n,"info")&&(Vy(u).info=n.info);for(var h=0;h=0?a.replaceAt(u,o):a.add(u),u}function Uyt(t,e,r){var n=Vy(t),i=e.type,a=e.shape,o=e.style;return r.isUniversalTransitionEnabled()||i!=null&&i!==n.customGraphicType||i==="path"&&Njr(a)&&Hyt(a)!==n.customPathData||i==="image"&&Kt(o,"image")&&o.image!==n.customImagePath}function Rjr(t,e,r,n,i){var a=r.clipPath;if(a===!1)t&&t.getClipPath()&&t.removeClipPath();else if(a){var o=t.getClipPath();o&&Uyt(o,a,n)&&(o=null),o||(o=Jve(a),t.setClipPath(o)),eye(null,o,e,a,null,n,i)}}function Djr(t,e,r,n,i,a){if(!(t.isGroup||t.type==="compoundPath")){Vyt(r,null,a),Vyt(r,Qy,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,l=a.blur.conOpt,u=a.select.conOpt;if(o!=null||s!=null||u!=null||l!=null){var h=t.getTextContent();if(o===!1)h&&t.removeTextContent();else{o=a.normal.conOpt=o||{type:"text"},h?h.clearStates():(h=Jve(o),t.setTextContent(h)),eye(null,h,e,o,null,n,i);for(var d=o&&o.style,f=0;f=h;p--){var g=e.childAt(p);Mjr(e,g,i)}}}function Mjr(t,e,r){e&&Nq(e,Vy(t).option,r)}function Ijr(t){new Py(t.oldChildren,t.newChildren,Qyt,Qyt,t).add(Gyt).update(Gyt).remove(Pjr).execute()}function Qyt(t,e){var r=t&&t.name;return r??Sjr+e}function Gyt(t,e){var r=this.context,n=t!=null?r.newChildren[t]:null,i=e!=null?r.oldChildren[e]:null;rye(r.api,i,r.dataIndex,n,r.seriesModel,r.group)}function Pjr(t){var e=this.context,r=e.oldChildren[t];r&&Nq(r,Vy(r).option,e.seriesModel)}function Hyt(t){return t&&(t.pathData||t.d)}function Njr(t){return t&&(Kt(t,"pathData")||Kt(t,"d"))}function Bjr(t){t.registerChartView(Ojr),t.registerSeriesModel(tjr)}var CT=Gr(),Wyt=lr,iye=Wt,aye=function(){function t(){this._dragging=!1,this.animationThreshold=15}return t.prototype.render=function(e,r,n,i){var a=r.get("value"),o=r.get("status");if(this._axisModel=e,this._axisPointerModel=r,this._api=n,!(!i&&this._lastValue===a&&this._lastStatus===o)){this._lastValue=a,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.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(!s)s=this._group=new gr,this.createPointerEl(s,u,e,r),this.createLabelEl(s,u,e,r),n.getZr().add(s);else{var f=Kr(Yyt,r,d);this.updatePointerEl(s,u,f),this.updateLabelEl(s,u,f,r)}Xyt(s,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",o=r.get("snap");if(!o&&!a)return!1;if(n==="auto"||n==null){var s=this.animationThreshold;if(a&&mc(i).w>s)return!0;if(o){var l=g0e(e).seriesDataCount,u=i.getExtent();return Math.abs(u[0]-u[1])/l>s}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 o=CT(e).pointerEl=new RS[a.type](Wyt(r.pointer));e.add(o)}},t.prototype.createLabelEl=function(e,r,n,i){if(r.label){var a=CT(e).labelEl=new $n(Wyt(r.label));e.add(a),jyt(a,i)}},t.prototype.updatePointerEl=function(e,r,n){var i=CT(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=CT(e).labelEl;a&&(a.setStyle(r.label.style),n(a,{x:r.label.x,y:r.label.y}),jyt(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"),o=r.get("status");if(!a.get("show")||!o||o==="hide"){i&&n.remove(i),this._handle=null;return}var s;this._handle||(s=!0,i=this._handle=X_(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){by(u.event)},onmousedown:iye(this._onHandleDragMove,this,0,0),drift:iye(this._onHandleDragMove,this),ondragend:iye(this._onHandleDragEnd,this)}),n.add(i)),Xyt(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,s5(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},t.prototype._moveHandleToValue=function(e,r){Yyt(this._axisPointerModel,!r&&this._moveAnimation,this._handle,oye(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(oye(n),[e,r],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(oye(i)),CT(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),z8(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 Yyt(t,e,r,n){qyt(CT(r).lastProp,n)||(CT(r).lastProp=n,e?qn(r,n,t):(r.stopAnimation(),r.attr(n)))}function qyt(t,e){if(yr(t)&&yr(e)){var r=!0;return fe(e,function(n,i){r=r&&qyt(t[i],n)}),!!r}else return t===e}function jyt(t,e){t[e.get(["label","show"])?"show":"hide"]()}function oye(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function Xyt(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 sye(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 Kyt(t,e,r,n,i){var a=r.get("value"),o=Zyt(a,e.axis,e.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=t5(s.get("padding")||0),u=s.getFont(),h=FH(o,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),$jr(d,f,p,n);var v=s.get("backgroundColor");(!v||v==="auto")&&(v=e.get(["axisLine","lineStyle","color"])),t.label={x:d[0],y:d[1],style:ji(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:v}),z2:10}}function $jr(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 Zyt(t,e,r,n,i){t=e.scale.parse(t);var a=e.scale.getLabel({value:t},{precision:i.precision}),o=i.formatter;if(o){var s={value:CY(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};fe(n,function(l){var u=r.getSeriesByIndex(l.seriesIndex),h=l.dataIndexInside,d=u&&u.getDataParams(h);d&&s.seriesData.push(d)}),$t(o)?a=o.replace("{value}",a):ur(o)&&(a=o(s))}return a}function lye(t,e,r){var n=ka();return xy(n,n,r.rotation),sg(n,n,r.position),fg([t.dataToCoord(e),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function Jyt(t,e,r,n,i,a){var o=Bu.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=i.get(["label","margin"]),Kyt(e,n,i,a,{position:lye(n.axis,t,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function cye(t,e,r){return r=r||0,{x1:t[r],y1:t[1-r],x2:e[r],y2:e[1-r]}}function e1t(t,e,r){return r=r||0,{x:t[r],y:t[1-r],width:e[r],height:e[1-r]}}function t1t(t,e,r,n,i,a){return{cx:t,cy:e,r0:r,r:n,startAngle:i,endAngle:a,clockwise:!0}}function uye(t,e,r){return mc(t,{fromStat:{sers:vt(e,function(n){return r.getSeriesByIndex(n.seriesIndex)})},min:1}).w}function hye(t,e,r){return[rn(Oi(e[0],e[1]),t-r/2),Oi(t+r/2,rn(e[0],e[1]))]}var Fjr=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis,l=s.grid,u=a.get("type"),h=s.getGlobalExtent(),d=r1t(l,s).getOtherAxis(s).getGlobalExtent(),f=s.toGlobalCoord(s.dataToCoord(n,!0));if(u&&u!=="none"){var p=sye(a),g=zjr[u](s,f,h,d,a.get("seriesDataIndices"),a.ecModel);g.style=p,r.graphicKey=g.type,r.pointer=g}var m=HY(l.getRect(),i);Jyt(n,r,m,i,a,o)},e.prototype.getHandleTransform=function(r,n,i){var a=HY(n.axis.grid.getRect(),n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=lye(n.axis,r,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(r,n,i,a){var o=i.axis,s=o.grid,l=o.getGlobalExtent(!0),u=r1t(s,o).getOtherAxis(o).getGlobalExtent(),h=o.dim==="x"?0:1,d=[r.x,r.y];d[h]+=n[h],d[h]=Oi(l[1],d[h]),d[h]=rn(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}(aye);function r1t(t,e){var r={};return r[e.dim+"AxisIndex"]=e.index,t.getCartesian(r)}var zjr={line:function(t,e,r,n){var i=cye([e,n[0]],[e,n[1]],n1t(t));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(t,e,r,n,i,a){var o=uye(t,i,a),s=n[1]-n[0],l=hye(e,r,o),u=l[0],h=l[1];return{type:"Rect",shape:e1t([u,n[0]],[h-u,s],n1t(t))}}};function n1t(t){return t.dim==="x"?0:1}var Ujr=function(t){nt(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:tt.color.border,width:1,type:"dashed"},shadowStyle:{color:tt.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:tt.color.neutral00,padding:[5,7,5,7],backgroundColor:tt.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:tt.color.accent40,throttle:40}},e}(pn),Gy=Gr(),Vjr=fe;function i1t(t,e,r){if(!Dn.node){var n=e.getZr();Gy(n).records||(Gy(n).records={}),Qjr(n,e);var i=Gy(n).records[t]||(Gy(n).records[t]={});i.handler=r}}function Qjr(t,e){if(Gy(t).initialized)return;Gy(t).initialized=!0,r("click",Kr(dye,"click")),r("mousemove",Kr(dye,"mousemove")),r("mousewheel",Kr(dye,"mousewheel")),r("globalout",Hjr);function r(n,i){t.on(n,function(a){var o=Wjr(e);Vjr(Gy(t).records,function(s){s&&i(s,a,o.dispatchAction)}),Gjr(o.pendings,e)})}}function Gjr(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 Hjr(t,e,r){t.handler("leave",null,r)}function dye(t,e,r,n){e.handler(t,r,n)}function Wjr(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 fye(t,e){if(!Dn.node){var r=e.getZr(),n=(Gy(r).records||{})[t];n&&(Gy(r).records[t]=null)}}var Yjr=function(t){nt(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"),o=r.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click|mousewheel";i1t("axisPointer",i,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(r,n){fye("axisPointer",n)},e.prototype.dispose=function(r,n){fye("axisPointer",n)},e.type="axisPointer",e}(Xi);function a1t(t,e){var r=[],n=t.seriesIndex,i;if(n==null||!(i=e.getSeriesByIndex(n)))return{point:[]};var a=i.getData(),o=lS(a,t);if(o==null||o<0||ft(o))return{point:[]};var s=a.getItemGraphicEl(o),l=i.coordinateSystem;if(i.getTooltipPosition)r=i.getTooltipPosition(o)||[];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,o),m[1-p]=a.get(a.getCalculationInfo("stackResultDimension"),o),r=l.dataToPoint(m)||[]}else r=l.dataToPoint(a.getValues(vt(l.dimensions,function(y){return a.mapDimension(y)}),o))||[];else if(s){var v=s.getBoundingRect().clone();v.applyTransform(s.transform),r=[v.x+v.width/2,v.y+v.height/2]}return{point:r,el:s}}var o1t=Gr();function qjr(t,e,r){var n=t.currTrigger,i=[t.x,t.y],a=t,o=t.dispatchAction||Wt(r.dispatchAction,r),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){Fq(i)&&(i=a1t({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=Fq(i),u=a.axesInfo,h=s.axesInfo,d=n==="leave"||Fq(i),f={},p={},g={list:[],map:{}},m={showPointer:Kr(Xjr,p),showTooltip:Kr(Kjr,g)};fe(s.coordSysMap,function(y,b){var x=l||y.containPoint(i);fe(s.coordSysAxesInfo[b],function(w,A){var S=w.axis,T=tXr(u,w);if(!d&&x&&(!u||T)){var C=T&&T.value;C==null&&!l&&(C=S.pointToData(i)),C!=null&&s1t(w,C,m,!1,f)}})});var v={};return fe(h,function(y,b){var x=y.linkGroup;x&&!p[b]&&fe(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,l1t(w),l1t(y)))),v[y.key]=T}})}),fe(v,function(y,b){s1t(h[b],y,m,!0,f)}),Zjr(p,h,f),Jjr(g,i,t,o),eXr(h,o,r),f}}function s1t(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 o=jjr(e,t),s=o.payloadBatch,l=o.snapToValue;s[0]&&i.seriesIndex==null&<(i,s[0]),!n&&t.snap&&a.containData(l)&&l!=null&&(e=l),r.showPointer(t,e,s),r.showTooltip(t,o,l)}}function jjr(t,e){var r=e.axis,n=r.dim,i=t,a=[],o=Number.MAX_VALUE,s=-1;return fe(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(ep(d)){var g=t-d,m=Math.abs(g);m<=o&&((m=0&&s<0)&&(o=m,s=g,i=d,a.length=0),fe(f,function(v){a.push({seriesIndex:l.seriesIndex,dataIndexInside:v,dataIndex:l.getData().getRawIndex(v)})}))}}),{payloadBatch:a,snapToValue:i}}function Xjr(t,e,r,n){t[e.key]={value:r,payloadBatch:n}}function Kjr(t,e,r,n){var i=r.payloadBatch,a=e.axis,o=a.model,s=e.axisPointerModel;if(!(!e.triggerTooltip||!i.length)){var l=e.coordSys.model,u=SB(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:o.componentIndex,axisType:o.type,axisId:o.id,value:n,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function Zjr(t,e,r){var n=r.axesInfo=[];fe(e,function(i,a){var o=i.axisPointerModel.option,s=t[a];s?(!i.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!i.useHandle&&(o.status="hide"),o.status==="show"&&n.push({axisDim:i.axis.dim,axisIndex:i.axis.model.componentIndex,value:o.value})})}function Jjr(t,e,r,n){if(Fq(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 eXr(t,e,r){var n=r.getZr(),i="axisPointerLastHighlights",a=o1t(n)[i]||{},o=o1t(n)[i]={};fe(t,function(h,d){var f=h.axisPointerModel.option;f.status==="show"&&h.triggerEmphasis&&fe(f.seriesDataIndices,function(p){o[p.seriesIndex+"|"+p.dataIndex]=p})});var s=[],l=[];function u(h){return{seriesIndex:h.seriesIndex,dataIndex:h.dataIndex}}fe(a,function(h,d){!o[d]&&l.push(u(h))}),fe(o,function(h,d){!a[d]&&s.push(u(h))}),l.length&&r.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&r.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function tXr(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 l1t(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 Fq(t){return!t||t[0]==null||isNaN(t[0])||t[1]==null||isNaN(t[1])}function YB(t){uT.registerAxisPointerClass("CartesianAxisPointer",Fjr),t.registerComponentModel(Ujr),t.registerComponentView(Yjr),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=SVr(e,r)}}),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},qjr)}function rXr(t){Xr(Cmt),Xr(YB)}var nXr=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis;s.dim==="angle"&&(this.animationThreshold=Math.PI/18);var l=s.polar,u=s.getExtent(),h=l.getOtherAxis(s).getExtent(),d=s.dataToCoord(n),f=a.get("type");if(f&&f!=="none"){var p=sye(a),g=aXr[f](s,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=iXr(n,i,a,l,m);Kyt(r,i,a,o,v)},e}(aye);function iXr(t,e,r,n,i){var a=e.axis,o=a.dataToCoord(t),s=n.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l=n.getRadiusAxis().getExtent(),u,h,d;if(a.dim==="radius"){var f=ka();xy(f,f,s),sg(f,f,[n.cx,n.cy]),u=fg([o,-i],f);var p=e.getModel("axisLabel").get("rotate")||0,g=Bu.innerTextLayout(s,p*Math.PI/180,-1);h=g.textAlign,d=g.textVerticalAlign}else{var m=l[1];u=n.coordToPoint([m+i,o]);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 aXr={line:function(t,e,r,n,i){return t.dim==="angle"?{type:"Line",shape:cye(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,o){var s=Math.PI/180,l=uye(t,a,o),u;if(t.dim==="angle")u=t1t(e.cx,e.cy,i[0],i[1],(-r-l/2)*s,(-r+l/2)*s);else{var h=hye(r,n,l),d=h[0],f=h[1];u=t1t(e.cx,e.cy,d,f,0,Math.PI*2)}return{type:"Sector",shape:u}}},o0="polar",c1t=o0,oXr=function(t){nt(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=o0,e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={z:0,center:["50%","50%"],radius:"80%"},e}(pn),pye=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",xo).models[0]},e.type="polarAxis",e}(pn);Qo(pye,S5);var sXr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="angleAxis",e}(pye),lXr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="radiusAxis",e}(pye),gye=function(t){nt(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}(cp);gye.prototype.dataToRadius=cp.prototype.dataToCoord,gye.prototype.radiusToData=cp.prototype.coordToData;var cXr=Gr(),mye=function(t){nt(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(),o=i.count();if(a[1]-a[0]<1)return 0;var s=a[0],l=r.dataToCoord(s+1)-r.dataToCoord(s),u=Math.abs(l),h=FH(s==null?"":s+"",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=cXr(r.model),m=g.lastAutoInterval,v=g.lastTickCount;return m!=null&&v!=null&&Math.abs(m-p)<=1&&Math.abs(v-o)<=1&&m>p?p=m:(g.lastTickCount=o,g.lastAutoInterval=p),p},e}(cp);mye.prototype.dataToAngle=cp.prototype.dataToCoord,mye.prototype.angleToData=cp.prototype.coordToData;var u1t=["radius","angle"],uXr=function(){function t(e){this.dimensions=u1t,this.type=o0,this.cx=0,this.cy=0,this._radiusAxis=new gye,this._angleAxis=new mye,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(),o=Math.min(a[0],a[1]),s=Math.max(a[0],a[1]);i.inverse?o=s-360:s=o+360;var l=Math.sqrt(r*r+n*n);r/=l,n/=l;for(var u=Math.atan2(-n,r)/Math.PI*180,h=us;)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,o=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(s,l){var u=s-this.cx,h=l-this.cy,d=u*u+h*h,f=this.r,p=this.r0;return f!==p&&d-o<=f*f&&d+o>=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=h1t(r);return i===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,r,n){var i=h1t(r);return i===this?this.pointToData(n):null},t}();function h1t(t){var e=t.seriesModel,r=t.polarModel;return r&&r.coordinateSystem||e&&e.coordinateSystem}function hXr(t,e,r){var n=e.get("center"),i=Ps(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(),o=Math.min(i.width,i.height)/2,s=e.get("radius");s==null?s=[0,"100%"]:ft(s)||(s=[0,s]);var l=[Qt(s[0],o),Qt(s[1],o)];a.inverse?a.setExtent(l[1],l[0]):a.setExtent(l[0],l[1])}function dXr(t,e){var r=this,n=r.getAngleAxis(),i=r.getRadiusAxis();if(KS(n,C5),KS(i,C5),O5(n),O5(i),n.type==="category"&&!n.onBand){var a=n.getExtent(),o=360/n.scale.count();n.inverse?a[1]+=o:a[1]-=o,n.setExtent(a[0],a[1])}}function fXr(t){return t.mainType==="angleAxis"}function d1t(t,e){var r;if(t.type=tB(e),t.scale=x5(e,t.type,!1),t.onBand=iB(t.scale,e),t.inverse=e.get("inverse"),fXr(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 pXr={dimensions:u1t,create:function(t,e){var r=[];return t.eachComponent(c1t,function(n,i){var a=new uXr(i+"");a.update=dXr;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=n.findAxisModel("radiusAxis"),u=n.findAxisModel("angleAxis");d1t(o,l),d1t(s,u),hXr(a,n,e),r.push(a),n.coordinateSystem=a,a.model=n}),t.eachSeries(function(n){if(n.get("coordinateSystem")===o0){var i=n.getReferringComponents(c1t,xo).models[0],a=n.coordinateSystem=i.coordinateSystem;a&&(XS(a.getRadiusAxis(),n,o0),XS(a.getAngleAxis(),n,o0))}}),r}},gXr=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function zq(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 Uq(t){var e=t.getRadiusAxis();return e.inverse?0:1}function f1t(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 mXr=function(t){nt(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,o=a.getRadiusAxis().getExtent(),s=i.getTicksCoords({breakTicks:"none"}),l=i.getMinorTicksCoords(),u=[];fe(i.getViewLabels(),function(h){if(!h.tick.offInterval){h=lr(h);var d=i.scale;h.coord=i.dataToCoord(A5(d,h.tick)),u.push(h)}}),f1t(u),f1t(s),fe(gXr,function(h){r.get([h,"show"])&&(!i.scale.isBlank()||h==="axisLine")&&vXr[h](this.group,r,a,s,l,o,u)},this)}},e.type="angleAxis",e}(uT),vXr={axisLine:function(t,e,r,n,i,a){var o=e.getModel(["axisLine","lineStyle"]),s=r.getAngleAxis(),l=Math.PI/180,u=s.getExtent(),h=Uq(r),d=h?0:1,f,p=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[d]===0?f=new RS[p]({shape:{cx:r.cx,cy:r.cy,r:a[h],startAngle:-u[0]*l,endAngle:-u[1]*l,clockwise:s.inverse},style:o.getLineStyle(),z2:1,silent:!0}):f=new Q_({shape:{cx:r.cx,cy:r.cy,r:a[h],r0:a[d]},style:o.getLineStyle(),z2:1,silent:!0}),f.style.fill=null,t.add(f)},axisTick:function(t,e,r,n,i,a){var o=e.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[Uq(r)],u=vt(n,function(h){return new Go({shape:zq(r,[l,l+s],h.coord)})});t.add(Gd(u,{style:mr(o.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(t,e,r,n,i,a){if(i.length){for(var o=e.getModel("axisTick"),s=e.getModel("minorTick"),l=(o.get("inside")?-1:1)*s.get("length"),u=a[Uq(r)],h=[],d=0;dy?"left":"right",w=Math.abs(v[1]-b)/m<.3?"middle":v[1]>b?"top":"bottom";if(s&&s[g]){var A=s[g];yr(A)&&A.textStyle&&(p=new bn(A.textStyle,l,l.ecModel))}var S=new $n({silent:Bu.isLabelSilent(e),style:ji(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),Ly({el:S,componentModel:e,itemName:d.formattedLabel,formatterParamsExtra:{isTruncated:function(){return S.isTruncated},value:d.rawLabel,tickIndex:f}}),h){var T=Bu.makeAxisEventDataBase(e);T.targetType="axisLabel",T.value=d.rawLabel,Cr(S).eventData=T}},this)},splitLine:function(t,e,r,n,i,a){var o=e.getModel("splitLine"),s=o.getModel("lineStyle"),l=s.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][C]);var E=void 0,_=void 0,P=void 0,L=void 0;if(h.dim==="radius"){var R=h.dataToCoord(S)-x,D=t.dataToCoord(T);ao(R)=L})}}function OXr(t,e){var r=cT(e,o0),n=mc(t,{fromStat:{key:r},min:1}).w,i=n,a=0,o="20%",s="30%",l={};jS(t,r,function(v){var y=p1t(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=Oi(i,b),l[y].width=b,i-=b),x&&(l[y].maxWidth=x),w!=null&&(s=w),A!=null&&(o=A)});var u={},h=Qt(o,n),d=Qt(s,1),f=(i-h)/(a+(a-1)*d);f=rn(f,0),fe(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 o=i.orient==="horizontal"?0:1;return e instanceof Array&&(e=e[0]),n[o]=i.toGlobalCoord(i.dataToCoord(+e)),n[1-o]=o===0?a.y+a.height/2:a.x+a.width/2,n},t.prototype.convertToPixel=function(e,r,n){var i=m1t(r);return i===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,r,n){var i=m1t(r);return i===this?this.pointToData(n):null},t}();function m1t(t){var e=t.seriesModel,r=t.singleAxisModel;return r&&r.coordinateSystem||e&&e.coordinateSystem}function BXr(t,e){var r=[];return t.eachComponent(y0e,function(n,i){var a=new NXr(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")===IVr){var i=n.getReferringComponents(y0e,xo).models[0],a=n.coordinateSystem=i&&i.coordinateSystem;a&&XS(a.getAxis(),n,eq)}}),r}var $Xr={create:BXr,dimensions:g1t},v1t=["x","y"],FXr=["width","height"],zXr=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeElOption=function(r,n,i,a,o){var s=i.axis,l=s.coordinateSystem,u=Vq(s),h=Qq(l,u),d=Qq(l,1-u),f=l.dataToPoint(n)[0],p=a.get("type");if(p&&p!=="none"){var g=sye(a),m=UXr[p](s,f,h,d,a.get("seriesDataIndices"),a.ecModel);m.style=g,r.graphicKey=m.type,r.pointer=m}var v=vye(i);Jyt(n,r,v,i,a,o)},e.prototype.getHandleTransform=function(r,n,i){var a=vye(n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=lye(n.axis,r,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(r,n,i,a){var o=i.axis,s=o.coordinateSystem,l=Vq(o),u=Qq(s,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=Qq(s,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}(aye),UXr={line:function(t,e,r,n){var i=cye([e,n[0]],[e,n[1]],Vq(t));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(t,e,r,n,i,a){var o=uye(t,i,a),s=n[1]-n[0],l=hye(e,r,o),u=l[0],h=l[1];return{type:"Rect",shape:e1t([u,n[0]],[h-u,s],Vq(t))}}};function Vq(t){return t.isHorizontal()?0:1}function Qq(t,e){var r=t.getRect();return[r[v1t[e]],r[v1t[e]]+r[FXr[e]]]}var VXr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="single",e}(Xi);function QXr(t){Xr(YB),uT.registerAxisPointerClass("SingleAxisPointer",zXr),t.registerComponentView(VXr),t.registerComponentView(MXr),t.registerComponentModel(tq),M5(t,"single",tq,tq.defaultOption),t.registerCoordinateSystem("single",$Xr)}var GXr=function(t){nt(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=PS(r);t.prototype.init.apply(this,arguments),y1t(r,a)},e.prototype.mergeOption=function(r){t.prototype.mergeOption.apply(this,arguments),y1t(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:tt.color.axisLine,width:1,type:"solid"}},itemStyle:{color:tt.color.neutral00,borderWidth:1,borderColor:tt.color.neutral10},dayLabel:{show:!0,firstDay:0,position:"start",margin:tt.size.s,color:tt.color.secondary},monthLabel:{show:!0,position:"start",margin:tt.size.s,align:"center",formatter:null,color:tt.color.secondary},yearLabel:{show:!0,position:null,margin:tt.size.xl,formatter:null,color:tt.color.quaternary,fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},e}(pn);function y1t(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 H8r(e,a)&&(n[a]="auto"),n[a]!=null&&n[a]!=="auto"});qm(t,e,{type:"box",ignoreSize:i})}var HXr=function(t){nt(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 o=r.coordinateSystem,s=o.getRangeInfo(),l=o.getOrient(),u=n.getLocaleModel();this._renderDayRect(r,s,a),this._renderLines(r,s,l,a),this._renderYearText(r,s,l,a),this._renderMonthText(r,u,l,a),this._renderWeekText(r,u,s,l,a)},e.prototype._renderDayRect=function(r,n,i){for(var a=r.coordinateSystem,o=r.getModel("itemStyle").getItemStyle(),s=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 nn({shape:{x:h[0],y:h[1],width:s,height:l},cursor:"default",style:o});i.add(d)}},e.prototype._renderLines=function(r,n,i,a){var o=this,s=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=s.getDateInfo(n.start.y+"-"+n.start.m));var p=d.date;p.setMonth(p.getMonth()+1),d=s.getDateInfo(p)}g(s.getNextNDay(n.end.time,1).formatedDate);function g(m){o._firstDayOfMonth.push(s.getDateInfo(m)),o._firstDayPoints.push(s.dataToCalendarLayout([m],!1).tl);var v=o._getLinePointsOfOneWeek(r,m,i);o._tlpoints.push(v[0]),o._blpoints.push(v[v.length-1]),u&&o._drawSplitline(v,l,a)}u&&this._drawSplitline(o._getEdgesPoints(o._tlpoints,h,i),l,a),u&&this._drawSplitline(o._getEdgesPoints(o._blpoints,h,i),l,a)},e.prototype._getEdgesPoints=function(r,n,i){var a=[r[0].slice(),r[r.length-1].slice()],o=i==="horizontal"?0:1;return a[0][o]=a[0][o]-n/2,a[1][o]=a[1][o]+n/2,a},e.prototype._drawSplitline=function(r,n,i){var a=new Ll({z2:20,shape:{points:r},style:n});i.add(a)},e.prototype._getLinePointsOfOneWeek=function(r,n,i){for(var a=r.coordinateSystem,o=a.getDateInfo(n),s=[],l=0;l<7;l++){var u=a.getNextNDay(o.time,l),h=a.dataToCalendarLayout([u.time],!1);s[2*u.day]=h.tl,s[2*u.day+1]=h[i==="horizontal"?"bl":"tr"]}return s},e.prototype._formatterLabel=function(r,n){return $t(r)&&r?kut(r,n):ur(r)?r(n):n.nameMap},e.prototype._yearTextPositionControl=function(r,n,i,a,o){var s=n[0],l=n[1],u=["center","bottom"];a==="bottom"?(l+=o,u=["center","top"]):a==="left"?s-=o:a==="right"?(s+=o,u=["center","top"]):l-=o;var h=0;return(a==="left"||a==="right")&&(h=Math.PI/2),{rotation:h,x:s,y:l,style:{align:u[0],verticalAlign:u[1]}}},e.prototype._renderYearText=function(r,n,i,a){var o=r.getModel("yearLabel");if(o.get("show")){var s=o.get("margin"),l=o.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=o.get("formatter"),v={start:n.start.y,end:n.end.y,nameMap:g},y=this._formatterLabel(m,v),b=new $n({z2:30,style:ji(o,{text:y}),silent:o.get("silent")});b.attr(this._yearTextPositionControl(b,p[l],i,l,s)),a.add(b)}},e.prototype._monthTextPositionControl=function(r,n,i,a,o){var s="left",l="top",u=r[0],h=r[1];return i==="horizontal"?(h=h+o,n&&(s="center"),a==="start"&&(l="bottom")):(u=u+o,n&&(l="middle"),a==="start"&&(s="right")),{x:u,y:h,align:s,verticalAlign:l}},e.prototype._renderMonthText=function(r,n,i,a){var o=r.getModel("monthLabel");if(o.get("show")){var s=o.get("nameMap"),l=o.get("margin"),u=o.get("position"),h=o.get("align"),d=[this._tlpoints,this._blpoints];(!s||$t(s))&&(s&&(n=Gpe(s)||n),s=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=o.get("silent"),v=0;v=a.start.time&&i.times.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/yye)-Math.floor(r[0].time/yye)+1,a=new Date(r[0].time),o=a.getDate(),s=r[1].date.getDate();a.setDate(o+i-1);var l=a.getDate();if(l!==s)for(var u=a.getTime()-r[1].time>0?1:-1;(l=a.getDate())!==s&&(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,o=new Date(i.start.time);return o.setDate(+i.start.d+a),this.getDateInfo(o)},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){L8({targetModel:a,coordSysType:"calendar",coordSysProvider:Iut})}),n},t.dimensions=["time","value"],t}();function bye(t){var e=t.calendarModel,r=t.seriesModel,n=e?e.coordinateSystem:r?r.coordinateSystem:null;return n}function YXr(t){t.registerComponentModel(GXr),t.registerComponentView(HXr),t.registerCoordinateSystem("calendar",WXr)}var Hy={level:1,leaf:2,nonLeaf:3},Wy={none:0,all:1,body:2,corner:3};function xye(t,e,r){var n=e[Mr[r]].getCell(t);return!n&&Vn(t)&&t<0&&(n=e[Mr[1-r]].getUnitLayoutInfo(r,Math.round(t))),n}function b1t(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 x1t(t,e,r,n,i){w1t(t[0],e,i,r,n,0),w1t(t[1],e,i,r,n,1)}function w1t(t,e,r,n,i,a){t[0]=1/0,t[1]=-1/0;var o=n[a],s=ft(o)?o:[o],l=s.length,u=!!r;if(l>=1?(A1t(t,e,s,u,i,a,0),l>1&&A1t(t,e,s,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===Wy.body?h=rn(0,h):r===Wy.corner&&(d=Oi(-1,d)),d=e[0]&&t[0]<=e[1]}function C1t(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 XXr(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 O1t(t,e,r,n){var i=xye(e[n][0],r,n),a=xye(e[n][1],r,n);t[Mr[n]]=t[_o[n]]=NaN,i&&a&&(t[Mr[n]]=i.xy,t[_o[n]]=a.xy+a.wh-i.xy)}function qB(t,e,r,n){return t[Mr[e]]=r,t[Mr[1-e]]=n,t}function KXr(t){return t&&(t.type===Hy.leaf||t.type===Hy.nonLeaf)?t:null}function Hq(){return{x:NaN,y:NaN,width:NaN,height:NaN}}var k1t=function(){function t(e,r){this._cells=[],this._levels=[],this.dim=e,this.dimIdx=e==="x"?0:1,this._model=r,this._uniqueValueGen=ZXr(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 Nx;for(o.resetLayoutIterator(A,n);A.next();)S(A.item);for(a.resetLayoutIterator(A,n);A.next();)S(A.item);function S(T){cc(T.wh)&&(T.wh=y),T.xy=x,T.id[Mr[n]]===w&&!b&&(T.wh=r[Mr[n]]+r[_o[n]]-T.xy),x+=T.wh}}function P1t(t,e){for(var r=e[Mr[t]].resetCellIterator();r.next();){var n=r.item;Xq(n.rect,t,n.id,n.span,e),Xq(n.rect,1-t,n.id,n.span,e),n.type===Hy.nonLeaf&&(n.xy=n.rect[Mr[t]],n.wh=n.rect[_o[t]])}}function N1t(t,e){t.travelExistingCells(function(r){var n=r.span;if(n){var i=r.spanRect,a=r.id;Xq(i,0,a,n,e),Xq(i,1,a,n,e)}})}function Xq(t,e,r,n,i){t[_o[e]]=0;var a=r[Mr[e]],o=a<0?i[Mr[1-e]]:i[Mr[e]],s=o.getUnitLayoutInfo(e,r[Mr[e]]);if(t[Mr[e]]=s.xy,t[_o[e]]=s.wh,n[Mr[e]]>1){var l=o.getUnitLayoutInfo(e,r[Mr[e]]+n[Mr[e]]-1);t[_o[e]]=l.xy+l.wh-s.xy}}function hKr(t,e,r){var n=qH(t,r[_o[e]]);return Oye(n,r[_o[e]])}function Oye(t,e){return Math.max(Math.min(t,Jt(e,1/0)),0)}function kye(t){var e=t.matrixModel,r=t.seriesModel,n=e?e.coordinateSystem:r?r.coordinateSystem:null;return n}var vc={inBody:1,inCorner:2,outside:3},s0={x:null,y:null,point:[]};function B1t(t,e,r,n,i){var a=r[Mr[e]],o=r[Mr[1-e]],s=a.getUnitLayoutInfo(e,a.getLocatorCount(e)-1),l=a.getUnitLayoutInfo(e,0),u=o.getUnitLayoutInfo(e,-o.getLocatorCount(e)),h=o.shouldShow()?o.getUnitLayoutInfo(e,-1):null,d=t.point[e]=n[e];if(!l&&!h){t[Mr[e]]=vc.outside;return}if(i===Wy.body){l?(t[Mr[e]]=vc.inBody,d=Oi(s.xy+s.wh,rn(l.xy,d)),t.point[e]=d):t[Mr[e]]=vc.outside;return}else if(i===Wy.corner){h?(t[Mr[e]]=vc.inCorner,d=Oi(h.xy+h.wh,rn(u.xy,d)),t.point[e]=d):t[Mr[e]]=vc.outside;return}var f=l?l.xy:h?h.xy+h.wh:NaN,p=u?u.xy:f,g=s?s.xy+s.wh:f;if(dg){if(!i){t[Mr[e]]=vc.outside;return}d=g}t.point[e]=d,t[Mr[e]]=f<=d&&d<=g?vc.inBody:p<=d&&d<=f?vc.inCorner:vc.outside}function $1t(t,e,r,n){var i=1-r;if(t[Mr[r]]!==vc.outside)for(n[Mr[r]].resetCellIterator(Cye);Cye.next();){var a=Cye.item;if(z1t(t.point[r],a.rect,r)&&z1t(t.point[i],a.rect,i)){e[r]=a.ordinal,e[i]=a.id[Mr[i]];return}}}function F1t(t,e,r,n){if(t[Mr[r]]!==vc.outside){var i=t[Mr[r]]===vc.inCorner?n[Mr[1-r]]:n[Mr[r]];for(i.resetLayoutIterator(jq,r);jq.next();)if(dKr(t.point[r],jq.item)){e[r]=jq.item.id[Mr[r]];return}}}function dKr(t,e){return e.xy<=t&&t<=e.xy+e.wh}function z1t(t,e,r){return e[Mr[r]]<=t&&t<=e[Mr[r]]+e[_o[r]]}function fKr(t){t.registerComponentModel(rKr),t.registerComponentView(sKr),t.registerCoordinateSystem("matrix",uKr)}function pKr(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 U1t(t,e){var r;return fe(e,function(n){t[n]!=null&&t[n]!=="auto"&&(r=!0)}),r}function gKr(t,e,r){var n=lt({},r),i=t[e],a=r.$action||"merge";a==="merge"?i?(Qr(i,n,!0),qm(i,n,{ignoreSize:!0}),Fut(r,i),Kq(r,i),Kq(r,i,"shape"),Kq(r,i,"style"),Kq(r,i,"extra"),r.clipPath=i.clipPath):t[e]=n:a==="replace"?t[e]=n:a==="remove"&&i&&(t[e]=null)}var V1t=["transition","enterFrom","leaveTo"],mKr=V1t.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function Kq(t,e,r){if(r&&(!t[r]&&e[r]&&(t[r]={}),t=t[r],e=e[r]),!(!t||!e))for(var n=r?V1t:mKr,i=0;i=0;h--){var d=i[h],f=Ds(d.id,null),p=f!=null?o.get(f):null;if(p){var g=p.parent,y=pp(g),b=g===a?{width:s,height:l}:{width:y.width,height:y.height},x={},w=UW(p,d,b,null,{hv:d.hv,boundingMode:d.bounding},x);if(!pp(p).isNew&&w){for(var A=d.transition,S={},T=0;T=0)?S[C]=k:p[C]=k}qn(p,S,r,0)}else p.attr(x)}}},e.prototype._clear=function(){var r=this,n=this._elMap;n.each(function(i){Zq(i,pp(i).option,n,r._lastGraphicModel)}),this._elMap=qt()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(Xi);function Eye(t){var e=Kt(Q1t,t)?Q1t[t]:T8(t),r=new e({});return pp(r).type=t,r}function G1t(t,e,r,n){var i=Eye(r);return e.add(i),n.set(t,i),pp(i).id=t,pp(i).isNew=!0,i}function Zq(t,e,r,n){var i=t&&t.parent;i&&(t.type==="group"&&t.traverse(function(a){Zq(a,e,r,n)}),Nq(t,e,n),r.removeKey(pp(t).id))}function H1t(t,e,r,n){t.isGroup||fe([["cursor",tp.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])}),fe(En(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 xKr(t){return t=lt({},t),fe(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(Put),function(e){delete t[e]}),t}function wKr(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 AKr(t){t.registerComponentModel(yKr),t.registerComponentView(bKr),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 W1t=["x","y","radius","angle","single"],SKr=Gr(),TKr=["cartesian2d","polar","singleAxis"];function CKr(t){var e=t.get("coordinateSystem");return Nr(TKr,e)>=0}function u2(t){return t+"Axis"}function OKr(t,e){var r=qt(),n=[],i=qt();t.eachComponent({mainType:"dataZoom",query:e},function(h){i.get(h.uid)||s(h)});var a;do a=!1,t.eachComponent("dataZoom",o);while(a);function o(h){!i.get(h.uid)&&l(h)&&(s(h),a=!0)}function s(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 Y1t(t){var e=t.ecModel,r={infoList:[],infoMap:qt()};return t.eachTargetAxis(function(n,i){var a=e.getComponent(u2(n),i);if(a){var o=a.getCoordSysModel();if(o){var s=o.uid,l=r.infoMap.get(s);l||(l={model:o,axisModels:[]},r.infoList.push(l),r.infoMap.set(s,l)),l.axisModels.push(a)}}}),r}function q1t(t){var e=SKr(gdt(t));return e.axisProxyMap||(e.axisProxyMap=qt())}function Jq(t){if(t)return q1t(t.ecModel).get(t.uid)}function kKr(t,e){q1t(t.ecModel).set(t.uid,e)}function j1t(t,e){var r=e.getAxisModel().axis.__alignTo;return r&&t.getAxisProxy(r.dim,r.model.componentIndex)?Jq(r.model):null}var _ye=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}(),XB=function(t){nt(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=X1t(r);this.settledOption=a,this.mergeDefaultAndTheme(r,i),this._doInit(a)},e.prototype.mergeOption=function(r){var n=X1t(r);Qr(this.option,r,!0),Qr(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;fe([["start","startValue"],["end","endValue"]],function(a,o){this._rangePropMode[o]==="value"&&(n[a[0]]=i[a[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var r=this.get("orient",!0),n=this._targetAxisInfoMap=qt(),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 fe(W1t,function(i){var a=this.getReferringComponents(u2(i),p6r);if(a.specified){n=!0;var o=new _ye;fe(a.models,function(s){o.add(s.componentIndex)}),r.set(i,o)}},this),n},e.prototype._fillAutoTargetAxisByOrient=function(r,n){var i=this.ecModel,a=!0;if(a){var o=n==="vertical"?"y":"x",s=i.findComponents({mainType:o+"Axis"});l(s,o)}if(a){var s=i.findComponents({mainType:"singleAxis",filter:function(h){return h.get("orient",!0)===n}});l(s,"single")}function l(u,h){var d=u[0];if(d){var f=new _ye;if(f.add(d.componentIndex),r.set(h,f),a=!1,h==="x"||h==="y"){var p=d.getReferringComponents("grid",xo).models[0];p&&fe(u,function(g){d.componentIndex!==g.componentIndex&&p===g.getReferringComponents("grid",xo).models[0]&&f.add(g.componentIndex)})}}}a&&fe(W1t,function(u){if(a){var h=i.findComponents({mainType:u2(u),filter:function(f){return f.get("type",!0)==="category"}});if(h[0]){var d=new _ye;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");fe([["start","startValue"],["end","endValue"]],function(a,o){var s=r[a[0]]!=null,l=r[a[1]]!=null;s&&!l?n[o]="percent":!s&&l?n[o]="value":i?n[o]=i[o]:s&&(n[o]="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(u2(n),i))},this),r},e.prototype.eachTargetAxis=function(r,n){this._targetAxisInfoMap.each(function(i,a){fe(i.indexList,function(o){r.call(n,a,o)})})},e.prototype.getAxisProxy=function(r,n){return Jq(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(u2(r),n)},e.prototype.setRawRange=function(r){var n=this.option,i=this.settledOption;fe([["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;fe(["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 Jq(r);for(var n,i=this._targetAxisInfoMap.keys(),a=0;ao[1];if(x&&!w&&!A)return!0;x&&(v=!0),w&&(g=!0),A&&(m=!0)}return v&&g&&m})}else fe(h,function(p){if(a==="empty")l.setData(u=u.map(p,function(m){return s(m)?m:NaN}));else{var g={};g[p]=o,u.selectRange(g)}});fe(h,function(p){u.setApproximateExtent(o,p)})}});function s(l){return l>=o[0]&&l<=o[1]}},t.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},r=this._dataZoomModel,n=this._extent;fe(["min","max"],function(i){var a=r.get(i+"Span"),o=r.get(i+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?a=Zn(n[0]+o,n,[0,100],!0):a!=null&&(o=Zn(a,[0,100],n,!0)-n[0]),e[i+"Span"]=a,e[i+"ValueSpan"]=o},this)},t}(),DKr={dirtyOnOverallProgress:!0,getTargetSeries:function(t){function e(i){t.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=t.getComponent(u2(o),s);i(o,s,l,a)})})}var r=[];e(function(i,a,o,s){if(!Jq(o)){var l=new RKr(i,a,s,t);r.push(l),kKr(o,l)}});var n=qt();return fe(r,function(i){fe(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 o=r.getAxisProxy(i,a),s=j1t(r,o);s?n.push([o,s]):o.reset(r,null)}),fe(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,o=i.value;r.setCalculatedRange({start:a[0],end:a[1],startValue:o[0],endValue:o[1]})}})}};function LKr(t){t.registerAction("dataZoom",function(e,r){var n=OKr(r,e);fe(n,function(i){i.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var MKr=P_();function Dye(t){MKr(t,function(){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,DKr),LKr(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"})})}function IKr(t){t.registerComponentModel(EKr),t.registerComponentView(_Kr),Dye(t)}var l0=function(){function t(){}return t}(),K1t={};function W5(t,e){K1t[t]=e}function Z1t(t){return K1t[t]}var PKr=function(t){nt(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"),o=a?a.feature:null;o&&(this._themeFeatureOption=lt({},o),a.feature={}),t.prototype.init.call(this,r,n,i),o&&(a.feature=o)},e.prototype.optionUpdated=function(){fe(this.option.feature,function(r,n){var i=this._themeFeatureOption,a=Z1t(n);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(this.ecModel)),i&&i[n]&&(Qr(r,i[n]),i[n]=null),Qr(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:tt.color.border,borderRadius:0,borderWidth:0,padding:tt.size.m,itemSize:15,itemGap:tt.size.s,showTitle:!0,iconStyle:{borderColor:tt.color.accent50,color:"none"},emphasis:{iconStyle:{borderColor:tt.color.accent70}},tooltip:{show:!1,position:"bottom"}},e}(pn);function J1t(t,e){var r=t5(e.get("padding")),n=e.getItemStyle(["color","opacity"]);n.fill=e.get("backgroundColor");var i=new nn({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 NKr=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(r,n,i,a){var o=this.group;if(o.removeAll(),!r.get("show"))return;var s=+r.get("itemSize"),l=r.get("orient")==="vertical",u=r.get("feature")||{},h=this._features||(this._features=qt()),d=[];fe(u,function(b,x){d.push(x)}),new Py(this._featureNames||[],d).add(f).update(f).remove(Kr(f,null)).execute(),this._featureNames=oi(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],C=u[T],k=w||A?new bn(C,r,n):null,E=k&&k.get("show"),_;if(w){if(!E)return;if(BKr(T))_={onclick:k.option.onclick,featureName:T};else{var P=Z1t(T);if(!P)return;_=new P}h.set(T,_)}else _=h.get(T);if(S||!E){ebt(_)&&_.dispose&&_.dispose(n,i),h.removeKey(T);return}a&&a.newTitle!=null&&a.featureName===T&&(C.title=a.newTitle),w&&(_.uid=DS("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"?_y:Ry)(M[L])},ebt(_)&&_.render&&_.render(k,n,i,a)}function p(b,x,w){var A=b.getModel("iconStyle"),S=b.getModel(["emphasis","iconStyle"]),T=x instanceof l0&&x.getIcons?x.getIcons():b.get("icon"),C=b.get("title")||{},k,E;$t(T)?(k={},k[w]=T):k=T,$t(C)?(E={},E[w]=C):E=C;var _=b.iconPaths={};fe(k,function(P,L){var R=X_(P,{},{x:-s/2,y:-s/2,width:s,height:s});R.setStyle(A.getItemStyle());var D=R.ensureState("emphasis");D.style=S.getItemStyle();var M=new $n({style:{text:E[L],align:S.get("textAlign"),borderRadius:S.get("textBorderRadius"),padding:S.get("textPadding"),fill:null,font:$pe({fontStyle:S.get("textFontStyle"),fontFamily:S.get("textFontFamily"),fontSize:S.get("textFontSize"),fontWeight:S.get("textFontWeight")},n)},ignore:!0});R.setTextContent(M),Ly({el:R,componentModel:r,itemName:L,formatterParamsExtra:{title:E[L]}}),R.__title=E[L],R.on("mouseover",function(){var I=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")||I.fill||I.stroke||tt.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"?_y:Ry)(R),o.add(R),R.on("click",Wt(x.onclick,x,n,i,L)),_[L]=R})}var g=Ps(r,i).refContainer,m=r.getBoxLayoutParams(),v=r.get("padding"),y=ba(m,g,v);IS(r.get("orient"),o,r.get("itemGap"),y.width,y.height),UW(o,m,g,v),o.add(J1t(o.getBoundingRect(),r)),l||o.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 C=T.style||(T.style={}),k=FH(x,$n.makeFont(C)),E=b.x+o.x,_=b.y+o.y+s,P=!1;_+k.height>i.getHeight()&&(A.position="top",P=!0);var L=P?-5-k.height:s+10;E+k.width/2>i.getWidth()?(A.position=["100%",L],C.align="right"):E-k.width/2<0&&(A.position=[0,L],C.align="left")}})},e.prototype.updateView=function(r,n,i,a){fe(this._features,function(o){o&&o instanceof l0&&o.updateView&&o.updateView(o.model,n,i,a)})},e.prototype.dispose=function(r,n){fe(this._features,function(i){i&&i instanceof l0&&i.dispose&&i.dispose(r,n)})},e.type="toolbox",e}(Xi);function BKr(t){return t.indexOf("my")===0}function ebt(t){return t instanceof l0}var $Kr=function(t){nt(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",o=n.getZr().painter.getType()==="svg",s=o?"svg":i.get("type",!0)||"png",l=n.getConnectedDataURL({type:s,backgroundColor:i.get("backgroundColor",!0)||r.get("backgroundColor")||tt.color.neutral00,connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")}),u=Dn.browser;if(typeof MouseEvent=="function"&&(u.newEdge||!u.ie&&!u.edge)){var h=document.createElement("a");h.download=a+"."+s,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||o){var f=l.split(","),p=f[0].indexOf("base64")>-1,g=o?decodeURIComponent(f[1]):f[1];p&&(g=window.atob(g));var m=a+"."+s;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='',C=window.open();C.document.write(T),C.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:tt.color.neutral00,name:"",excludeComponents:["toolbox"],lang:r.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return n},e}(l0),tbt="__ec_magicType_stack__",FKr=[["line","bar"],["stack"]],zKr=function(t){nt(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 fe(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,o=a.get(["seriesIndex",i]);if(rbt[i]){var s={series:[]},l=function(d){var f=d.subType,p=d.id,g=rbt[i](f,p,d,a);g&&(mr(g,d.option),s.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,xo).models[0],w=x.componentIndex;s[b]=s[b]||[];for(var A=0;A<=w;A++)s[b][w]=s[b][w]||{};s[b][w].boundaryGap=i==="bar"}}};fe(FKr,function(d){Nr(d,i)>=0&&fe(d,function(f){a.setIconStatus(f,"normal")})}),a.setIconStatus(i,"emphasis"),r.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var u,h=i;i==="stack"&&(u=Qr({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:s,newTitle:u,featureName:"magicType"})}},e}(l0),rbt={line:function(t,e,r,n){if(t==="bar")return Qr({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 Qr({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")===tbt;if(t==="line"||t==="bar")return n.setIconStatus("stack",i?"normal":"emphasis"),Qr({id:e,stack:i?"":tbt},n.get(["option","stack"])||{},!0)}};gg({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)});var ej=new Array(60).join("-"),Y5=" ";function UKr(t){var e={},r=[],n=[];return t.eachRawSeries(function(i){var a=i.coordinateSystem;if(a&&(a.type==="cartesian2d"||a.type==="polar")){var o=a.getBaseAxis();if(o.type==="category"){var s=SUr(o);e[s]||(e[s]={categoryAxis:o,valueAxis:a.getOtherAxis(o),series:[]},n.push({axisDim:o.dim,axisIndex:o.index})),e[s].series.push(i)}else r.push(i)}else r.push(i)}),{seriesGroupByCategoryAxis:e,other:r,meta:n}}function VKr(t){var e=[];return fe(t,function(r,n){var i=r.categoryAxis,a=r.valueAxis,o=a.dim,s=[" "].concat(vt(r.series,function(p){return p.name})),l=[i.model.getCategories()];fe(r.series,function(p){var g=p.getRawData();l.push(p.getRawData().mapArray(g.mapDimension(o),function(m){return m}))});for(var u=[s.join(Y5)],h=0;h=0)return!0}var Lye=new RegExp("["+Y5+"]+","g");function GKr(t){for(var e=t.split(/\n+/g),r=tj(e.shift()).split(Lye),n=[],i=vt(r,function(l){return{name:l,data:[]}}),a=0;a=0)return!0}var Lye=new RegExp("["+Y5+"]+","g");function WKr(t){for(var e=t.split(/\n+/g),r=tj(e.shift()).split(Lye),n=[],i=vt(r,function(l){return{name:l,data:[]}}),a=0;a=0;a--){var o=r[a];if(o[i])break}if(a<0){var s=t.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(s){var l=s.getPercentRange();r[0][i]={dataZoomId:i,start:l[0],end:l[1]}}}}),r.push(e)}function XKr(t){var e=Mye(t),r=e[e.length-1];e.length>1&&e.pop();var n={};return tbt(r,function(i,a){for(var o=e.length-1;o>=0;o--)if(i=e[o][a],i){n[a]=i;break}}),n}function KKr(t){rbt(t).snapshots=null}function ZKr(t){return Mye(t).length}function Mye(t){var e=rbt(t);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var JKr=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.onclick=function(r,n){KKr(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}(l0);gg({type:"restore",event:"restore",update:"prepareAndUpdate"},function(t,e){e.resetOption("recreate")});var eZr=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],Iye=function(){function t(e,r,n){var i=this;this._targetInfoList=[];var a=nbt(r,e);fe(tZr,function(o,s){(!n||!n.include||Nr(n.include,s)>=0)&&o(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 o=Nye[n.brushType](0,a,i);n.__rangeOffset={offset:sbt[n.brushType](o.values,n.range,[1,1]),xyMinMax:o.xyMinMax}}}),e},t.prototype.matchOutputRanges=function(e,r,n){fe(e,function(i){var a=this.findTargetInfo(i,r);a&&a!==!0&&fe(a.coordSyses,function(o){var s=Nye[i.brushType](1,o,i.range,!0);n(i,s.values,o,r)})},this)},t.prototype.setInputRanges=function(e,r){fe(e,function(n){var i=this.findTargetInfo(n,r);if(n.range=n.range||[],i&&i!==!0){n.panelId=i.panelId;var a=Nye[n.brushType](0,i.coordSys,n.coordRange),o=n.__rangeOffset;n.range=o?sbt[n.brushType](a.values,o.offset,rZr(a.xyMinMax,o.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:Hvt(i),isTargetByCursor:Yvt(i,e,n.coordSysModel),getLinearBrushOtherExtent:Wvt(i)}})},t.prototype.controlSeries=function(e,r,n){var i=this.findTargetInfo(e,n);return i===!0||i&&Nr(i.coordSyses,r.coordinateSystem)>=0},t.prototype.findTargetInfo=function(e,r){for(var n=this._targetInfoList,i=nbt(r,e),a=0;at[1]&&t.reverse(),t}function nbt(t,e){return M_(t,e,{includeMainTypes:eZr})}var tZr={grid:function(t,e){var r=t.xAxisModels,n=t.yAxisModels,i=t.gridModels,a=qt(),o={},s={};!r&&!n&&!i||(fe(r,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),fe(n,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),fe(i,function(l){a.set(l.id,l),o[l.id]=!0,s[l.id]=!0}),a.each(function(l){var u=l.coordinateSystem,h=[];fe(u.getCartesians(),function(d,f){(Nr(r,d.getAxis("x").model)>=0||Nr(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:abt.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(t,e){fe(t.geoModels,function(r){var n=r.coordinateSystem;e.push({panelId:"geo--"+r.id,geoModel:r,coordSysModel:r,coordSys:n,coordSyses:[n],getPanelRect:abt.geo})})}},ibt=[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}],abt={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys.view,e=Wmt(null,t);return dst(e,e,uq(null,t)),e}},Nye={lineX:Kr(obt,0),lineY:Kr(obt,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),o=[Pye([i[0],a[0]]),Pye([i[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(t,e,r,n){var i=[dc(),dc()],a=vt(r,function(o){var s=t?e.pointToData(o,n):e.dataToPoint(o,n);return i[0][0]=Math.min(i[0][0],s[0]),i[1][0]=Math.min(i[1][0],s[1]),i[0][1]=Math.max(i[0][1],s[0]),i[1][1]=Math.max(i[1][1],s[1]),s});return{values:a,xyMinMax:i}}};function obt(t,e,r,n){var i=r.getAxis(["x","y"][t]),a=Pye(vt([0,1],function(s){return e?i.coordToData(i.toLocalCoord(n[s]),!0):i.toGlobalCoord(i.dataToCoord(n[s]))})),o=[];return o[t]=a,o[1-t]=[NaN,NaN],{values:a,xyMinMax:o}}var sbt={lineX:Kr(lbt,0),lineY:Kr(lbt,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 lbt(t,e,r,n){return[e[0]-n[t]*r[0],e[1]-n[t]*r[1]]}function rZr(t,e){var r=cbt(t),n=cbt(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 cbt(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}var Bye=fe,nZr=s6r("toolbox-dataZoom_"),iZr={x:"width",y:"height"},aZr=function(t){nt(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 wve(i.getZr()),this._brushController.on("brush",Wt(this._onBrush,this)).mount()),lZr(r,n,this,a,i),sZr(r,n)},e.prototype.onclick=function(r,n,i){oZr[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 o=new Iye($ye(this.model),a,{include:["grid"]});o.matchOutputRanges(n,a,function(u,h,d){if(d.type==="cartesian2d"){var f=d.master.getRect().clone(),p=u.brushType;p==="rect"?(s("x",d,f,h[0]),s("y",d,f,h[1])):s({lineX:"x",lineY:"y"}[p],d,f,h)}}),jKr(a,i),this._dispatchZoomAction(i);function s(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=i2(0,f.slice(),y,0,v.minValueSpan,v.maxValueSpan));var b=Rfe(y,d[iZr[u]],.5);m&&(i[m.id]={dataZoomId:m.id,startValue:isFinite(b)?Yn(f[0],b):f[0],endValue:isFinite(b)?Yn(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=[];Bye(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:tt.color.backgroundTint}};return n},e}(l0),oZr={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(XKr(this.ecModel))}};function $ye(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 sZr(t,e){t.setIconStatus("back",ZKr(e)>1?"emphasis":"normal")}function lZr(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 o=new Iye($ye(t),e,{include:["grid"]}),s=o.makePanelOpts(i,function(l){return l.xAxisDeclared&&!l.yAxisDeclared?"lineX":!l.xAxisDeclared&&l.yAxisDeclared?"lineY":"rect"});r._brushController.setPanels(s).enableBrush(a&&s.length?{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()}:!1)}j8r("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=$ye(n),o=M_(t,a);Bye(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),Bye(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,h){var d=l.componentIndex,f={type:"select",$fromToolbox:!0,filterMode:n.get("filterMode",!0)||"filter",id:nZr+u+d};f[h]=d,i.push(f)}return i});function cZr(t){t.registerComponentModel(MKr),t.registerComponentView(IKr),W5("saveAsImage",NKr),W5("magicType",$Kr),W5("dataView",YKr),W5("dataZoom",aZr),W5("restore",JKr),Xr(LKr)}var uZr=function(t){nt(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:tt.color.neutral00,shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:tt.color.border,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:tt.color.borderShade,width:1,type:"dashed",textStyle:{}}},textStyle:{color:tt.color.tertiary,fontSize:14}},e}(pn);function ubt(t){var e=t.get("confine");return e!=null?!!e:t.get("renderMode")==="richText"}function hbt(t){if(Dn.domSupported){for(var e=document.documentElement.style,r=0,n=t.length;r-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var h=u*Math.PI/180,d=o+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;s+=";"+a+":-"+p+"px";var g=e+" solid "+i+"px;",m=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+g,"border-right:"+g,"background-color:"+n+";"];return'
'}function vZr(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?",":"")+(Dn.transformSupported?""+Fye+i:",left"+i+",top"+i)),fZr+":"+a}function pbt(t,e,r){var n=t.toFixed(0)+"px",i=e.toFixed(0)+"px";if(!Dn.transformSupported)return r?"top:"+i+";left:"+n+";":[["top",i],["left",n]];var a=Dn.transform3dSupported,o="translate"+(a?"3d":"")+"("+n+","+i+(a?",0":"")+")";return r?"top:0;left:0;"+Fye+":"+o+";":[["top",0],["left",0],[dbt,o]]}function yZr(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"),o=t.get("textShadowBlur")||0,s=t.get("textShadowOffsetX")||0,l=t.get("textShadowOffsetY")||0;return a&&o&&e.push("text-shadow:"+s+"px "+l+"px "+o+"px "+a),fe(["decoration","align"],function(u){var h=t.get(u);h&&e.push("text-"+u+":"+h)}),e.join(";")}function bZr(t,e,r,n){var i=[],a=t.get("transitionDuration"),o=t.get("backgroundColor"),s=t.get("shadowBlur"),l=t.get("shadowColor"),u=t.get("shadowOffsetX"),h=t.get("shadowOffsetY"),d=t.getModel("textStyle"),f=zht(t,"html"),p=u+"px "+h+"px "+s+"px "+l;return i.push("box-shadow:"+p),e&&a>0&&i.push(vZr(a,r,n)),o&&i.push("background-color:"+o),fe(["width","color","radius"],function(g){var m="border-"+g,v=tge(m),y=t.get(v);y!=null&&i.push(m+":"+y+(g==="color"?"":"px"))}),i.push(yZr(d)),f!=null&&i.push("padding:"+t5(f).join("px ")+"px"),i.join(";")+";"}function gbt(t,e,r,n,i){var a=e&&e.painter;if(r){var o=a&&a.getViewportRoot();o&&wIr(t,o,r,n,i)}else{t[0]=n,t[1]=i;var s=a&&a.getViewportRootOffset();s&&(t[0]+=s.offsetLeft,t[1]+=s.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var xZr=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,Dn.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var i=this._zr=e.getZr(),a=r.appendTo,o=a&&($t(a)?document.querySelector(a):GA(a)?a:ur(a)&&a(e.getDom()));gbt(this._styleCoord,i,o,e.getWidth()/2,e.getHeight()/2),(o||e.getDom()).appendChild(n),this._api=e,this._container=o;var s=this;n.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},n.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=i.handler,h=i.painter.getViewportRoot();jf(h,l,!0),u.dispatch("mousemove",l)}},n.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return t.prototype.update=function(e){if(!this._container){var r=this._api.getDom(),n=dZr(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=pZr+bZr(e,!this._firstShow,this._longHide,this._enableDisplayTransition)+pbt(a[0],a[1],!0)+("border-color:"+LS(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 o=this.el;if(e==null){o.innerHTML="";return}var s="";if($t(a)&&n.get("trigger")==="item"&&!ubt(n)&&(s=mZr(n,i,a)),$t(e))o.innerHTML=e+s;else if(e){o.innerHTML="",ft(e)||(e=[e]);for(var l=0;l=0?this._tryShow(a,o):i==="leave"&&this._hide(o))},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 o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!i.isDisposed()&&o.manuallyShowTip(r,n,i,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(r,n,i,a){if(!(a.from===this.uid||Dn.node||!i.getDom())){var o=ybt(a,i);this._ticket="";var s=a.dataByCoordSys,l=kZr(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"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var h=AZr;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},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(r,n,i,a))return;var d=n1t(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"},o)}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},o))}},e.prototype.manuallyHideTip=function(r,n,i,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,this._cbParamsList=null,a.from!==this.uid&&this._hide(ybt(a,i))},e.prototype._manuallyAxisShowTip=function(r,n,i,a){var o=a.seriesIndex,s=a.dataIndex,l=n.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=n.getSeriesByIndex(o);if(u){var h=u.getData(),d=KB([h.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(d.get("trigger")==="axis")return i.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,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 o=r.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,r);else if(i){var s=Cr(i);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null,this._cbParamsList=null;var l,u;VS(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=Wt(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,o=[n.offsetX,n.offsetY],s=KB([n.tooltipOption],a),l=this._renderMode,u=[],h=fs("section",{blocks:[],noHeader:!0}),d=[],f=new Cge;fe(r,function(b){fe(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 C=Xyt(A,S,i,x.seriesDataIndices,x.valueLabelOpt),k=fs("section",{header:C,noHeader:!Nd(C),sortBlocks:!0,blocks:[]});h.blocks.push(k),fe(x.seriesDataIndices,function(E){var _=i.getSeriesByIndex(E.seriesIndex),P=E.dataIndexInside,L=_.getDataParams(P);if(!(L.dataIndex<0)){L.axisDim=x.axisDim,L.axisIndex=x.axisIndex,L.axisType=x.axisType,L.axisId=x.axisId,L.axisValue=CY(w.axis,{value:T}),L.axisValueLabel=C,L.marker=f.makeTooltipMarker("item",LS(L.color),l);var R=yht(_.formatTooltip(P,!0,null)),D=R.frag;if(D){var M=KB([_],a).get("valueFormatter");k.blocks.push(M?lt({valueFormatter:M},D):D)}R.text&&d.push(R.text),u.push(L)}})}})}),h.blocks.reverse(),d.reverse();var p=n.position,g=s.get("order"),m=Bht(h,f,l,g,i.get("useUTC"),s.get("textStyle"));m&&d.unshift(m);var v=l==="richText"?` - -`:"
",y=d.join(v);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(r,u)?this._updatePosition(s,p,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,y,u,Math.random()+"",o[0],o[1],p,null,f)})},e.prototype._showSeriesItemTooltip=function(r,n,i){var a=this._ecModel,o=Cr(n),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,h=o.dataIndex,d=o.dataType,f=u.getData(d),p=this._renderMode,g=r.positionDefault,m=KB([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 Cge;y.marker=b.makeTooltipMarker("item",LS(y.color),p);var x=yht(u.formatTooltip(h,!1,d)),w=m.get("order"),A=m.get("valueFormatter"),S=x.frag,T=S?Bht(A?lt({valueFormatter:A},S):S,b,p,w,a.get("useUTC"),m.get("textStyle")):x.text,C="item_"+u.name+"_"+h;this._showOrMove(m,function(){this._showTooltipContent(m,T,y,C,r.offsetX,r.offsetY,r.position,r.target,b)}),i({type:"showTip",dataIndexInside:h,dataIndex:f.getRawIndex(h),seriesIndex:s,from:this.uid})}},e.prototype._showComponentItemTooltip=function(r,n,i){var a=this._renderMode==="html",o=Cr(n),s=o.tooltipConfig,l=s.option||{},u=l.encodeHTMLContent;if($t(l)){var h=l;l={content:h,formatter:h},u=!0}u&&a&&l.content&&(l=lr(l),l.content=Hc(l.content));var d=[l],f=this._ecModel.getComponent(o.componentMainType,o.componentIndex);f&&d.push(f),d.push({formatter:l.content});var p=r.positionDefault,g=KB(d,this._tooltipModel,p?{position:p}:null),m=g.get("content"),v=Math.random()+"",y=new Cge;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,o,s,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([o,s],i,r.get("trigger"),r.get("borderColor"),r.get("defaultBorderColor",!0)),m=g.color;if(f)if($t(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=D8(y.axisValue,p,v)),p=ige(p,i,!0)}else if(ur(f)){var x=Wt(function(w,A){w===this._ticket&&(d.setContent(A,h,r,m,l),this._updatePosition(r,l,o,s,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,o,s,d,i,u)}},e.prototype._getNearestPoint=function(r,n,i,a,o){if(i==="axis"||ft(n))return{color:a||o};if(!ft(n))return{color:a||n.color||n.borderColor}},e.prototype._updatePosition=function(r,n,i,a,o,s,l){var u=this._api.getWidth(),h=this._api.getHeight();n=n||r.get("position");var d=o.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],s,o.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=ba(m,{width:u,height:h});i=v.x,a=v.y,f=null,p=null}else if($t(n)&&l){var y=OZr(n,g,d,r.get("borderWidth"));i=y[0],a=y[1]}else{var y=TZr(i,a,o,u,h,f?null:20,p?null:20);i=y[0],a=y[1]}if(f&&(i-=bbt(f)?d[0]/2:f==="right"?d[0]:0),p&&(a-=bbt(p)?d[1]/2:p==="bottom"?d[1]:0),ubt(r)){var y=CZr(i,a,o,u,h);i=y[0],a=y[1]}o.moveTo(i,a)},e.prototype._updateContentNotChangedOnAxis=function(r,n){var i=this._lastDataByCoordSys,a=this._cbParamsList,o=!!i&&i.length===r.length;return o&&fe(i,function(s,l){var u=s.dataByAxis||[],h=r[l]||{},d=h.dataByAxis||[];o=o&&u.length===d.length,o&&fe(u,function(f,p){var g=d[p]||{},m=f.seriesDataIndices||[],v=g.seriesDataIndices||[];o=o&&f.value===g.value&&f.axisType===g.axisType&&f.axisId===g.axisId&&m.length===v.length,o&&fe(m,function(y,b){var x=v[b];o=o&&y.seriesIndex===x.seriesIndex&&y.dataIndex===x.dataIndex}),a&&fe(f.seriesDataIndices,function(y){var b=y.seriesIndex,x=n[b],w=a[b];x&&w&&w.data!==x.data&&(o=!1)})})}),this._lastDataByCoordSys=r,this._cbParamsList=n,!!o},e.prototype._hide=function(r){this._lastDataByCoordSys=null,this._cbParamsList=null,r({type:"hideTip",from:this.uid})},e.prototype.dispose=function(r,n){Dn.node||!n.getDom()||(z8(this,"_updatePosition"),this._tooltipContent.dispose(),fye("itemTooltip",n),this._tooltipContent=null,this._tooltipModel=null,this._lastDataByCoordSys=null,this._cbParamsList=null)},e.type="tooltip",e}(Xi);function KB(t,e,r){var n=e.ecModel,i;r?(i=new bn(r,n,n),i=new bn(e.option,i,n)):i=e;for(var a=t.length-1;a>=0;a--){var o=t[a];o&&(o instanceof bn&&(o=o.get("tooltip",!0)),$t(o)&&(o={formatter:o}),o&&(i=new bn(o,i,n)))}return i}function ybt(t,e){return t.dispatchAction||Wt(e.dispatchAction,e)}function TZr(t,e,r,n,i,a,o){var s=r.getSize(),l=s[0],u=s[1];return a!=null&&(t+l+a+2>n?t-=l+a:t+=a),o!=null&&(e+u+o>i?e-=u+o:e+=o),[t,e]}function CZr(t,e,r,n,i){var a=r.getSize(),o=a[0],s=a[1];return t=Math.min(t+o,n)-o,e=Math.min(e+s,i)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function OZr(t,e,r,n){var i=r[0],a=r[1],o=Math.ceil(Math.SQRT2*n)+8,s=0,l=0,u=e.width,h=e.height;switch(t){case"inside":s=e.x+u/2-i/2,l=e.y+h/2-a/2;break;case"top":s=e.x+u/2-i/2,l=e.y-a-o;break;case"bottom":s=e.x+u/2-i/2,l=e.y+h+o;break;case"left":s=e.x-i-o,l=e.y+h/2-a/2;break;case"right":s=e.x+u+o,l=e.y+h/2-a/2}return[s,l]}function bbt(t){return t==="center"||t==="middle"}function kZr(t,e,r){var n=Bfe(t).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=I_(e,i,n.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=r.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var h=Cr(u).tooltipConfig;if(h&&h.name===t.name)return l=u,!0}),l)return{componentMainType:i,componentIndex:o.componentIndex,el:l}}}}function EZr(t){Xr(YB),t.registerComponentModel(uZr),t.registerComponentView(SZr),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},no),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},no)}var _Zr=["rect","polygon","keep","clear"];function RZr(t,e){var r=qi(t?t.brush:[]);if(r.length){var n=[];fe(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={}),o=a.brush||(a.brush={}),s=o.type||(o.type=[]);s.push.apply(s,n),JH(s,function(l){return l+""},null),e&&!s.length&&s.push.apply(s,_Zr)}}var xbt=fe;function wbt(t){if(t){for(var e in t)if(t.hasOwnProperty(e))return!0}}function zye(t,e,r){var n={};return xbt(e,function(a){var o=n[a]=i();xbt(t[a],function(s,l){if(ol.isValidType(l)){var u={type:l,visual:s};r&&r(u,a),o[l]=new ol(u),l==="opacity"&&(u=lr(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new ol(u))}})}),n;function i(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function Abt(t,e,r){var n;fe(r,function(i){e.hasOwnProperty(i)&&wbt(e[i])&&(n=!0)}),n&&fe(r,function(i){e.hasOwnProperty(i)&&wbt(e[i])?t[i]=lr(e[i]):delete t[i]})}function DZr(t,e,r,n,i,a){var o={};fe(t,function(d){var f=ol.prepareVisualTypes(e[d]);o[d]=f});var s;function l(d){return Ege(r,s,d)}function u(d,f){sdt(r,s,d,f)}r.each(h);function h(d,f){s=d;var p=r.getRawDataItem(s);if(!(p&&p.visualMap===!1))for(var g=n.call(i,d),m=e[g],v=o[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&&Ebt(e)}};function Ebt(t){return new pr(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}var zZr=function(t){nt(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 wve(n.getZr())).on("brush",Wt(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){Obt(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}(Xi),UZr=function(t){nt(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&&Abt(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 _bt(this.option,n)},this))},e.prototype.setBrushOption=function(r){this.brushOption=_bt(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:tt.color.backgroundTint,borderColor:tt.color.borderTint},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4,defaultOutOfBrushColor:tt.color.disabled},e}(pn);function _bt(t,e){return Qr({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new bn(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}var VZr=["rect","polygon","lineX","lineY","keep","clear"],QZr=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(r,n,i){var a,o,s;n.eachComponent({mainType:"brush"},function(l){a=l.brushType,o=l.brushOption.brushMode||"single",s=s||!!l.areas.length}),this._brushType=a,this._brushMode=o,fe(r.get("type",!0),function(l){r.setIconStatus(l,(l==="keep"?o==="multiple":l==="clear"?s: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 fe(r.get("type",!0),function(a){n[a]&&(i[a]=n[a])}),i},e.prototype.onclick=function(r,n,i){var a=this._brushType,o=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"?o==="multiple"?"single":"multiple":o}})},e.getDefaultOption=function(r){var n={show:!0,type:VZr.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}(l0);function GZr(t){t.registerComponentView(zZr),t.registerComponentModel(UZr),t.registerPreprocessor(RZr),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,IZr),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"},no),t.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},no),W5("brush",QZr)}var HZr=function(t){nt(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:tt.size.m,backgroundColor:tt.color.transparent,borderColor:tt.color.primary,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:tt.color.primary},subtextStyle:{fontSize:12,color:tt.color.quaternary}},e}(pn),WZr=function(t){nt(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,o=r.getModel("textStyle"),s=r.getModel("subtextStyle"),l=r.get("textAlign"),u=Jt(r.get("textBaseline"),r.get("textVerticalAlign")),h=new $n({style:ji(o,{text:r.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),d=h.getBoundingRect(),f=r.get("subtext"),p=new $n({style:ji(s,{text:f,fill:s.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(){BW(g,"_"+r.get("target"))}),m&&p.on("click",function(){BW(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=Ps(r,i),w=ba(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 C=new nn({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(C)}},e.type="title",e}(Xi);function YZr(t){t.registerComponentModel(HZr),t.registerComponentView(WZr)}var Rbt=function(t){nt(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=[],o;i==="category"?(o=[],fe(n,function(u,h){var d=Ds(L_(u),""),f;yr(u)?(f=lr(u),f.value=h):f=h,o.push(f),a.push(d)})):o=n;var s={category:"ordinal",time:"time",value:"number"}[i]||"number",l=this._data=new jc([{name:"value",type:s}],this);l.initData(o,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:tt.size.m,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:tt.color.secondary},data:[]},e}(pn),Dbt=function(t){nt(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=Hx(Rbt.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:tt.color.border,borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:tt.color.accent10},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:tt.color.tertiary},itemStyle:{color:tt.color.accent20,borderWidth:0},checkpointStyle:{symbol:"circle",symbolSize:15,color:tt.color.accent50,borderColor:tt.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:tt.color.accent50,borderColor:tt.color.accent50,borderWidth:0},emphasis:{label:{show:!0,color:tt.color.accent60},itemStyle:{color:tt.color.accent60,borderColor:tt.color.accent60},controlStyle:{color:tt.color.accent70,borderColor:tt.color.accent70}},progress:{lineStyle:{color:tt.color.accent30},itemStyle:{color:tt.color.accent40}},data:[]}),e}(Rbt);Qo(Dbt,HW.prototype);var qZr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="timeline",e}(Xi),jZr=function(t){nt(e,t);function e(r,n,i,a){var o=t.call(this,r,n,i)||this;return o.type=a||"value",o}return e.prototype.getLabelModel=function(){return this.model.getModel("label")},e.prototype.isHorizontal=function(){return this.model.get("orient")==="horizontal"},e}(cp),Qye=Math.PI,Lbt=Gr(),XZr=function(t){nt(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),o=this._createGroup("_mainGroup"),s=this._createGroup("_labelGroup"),l=this._axis=this._createAxis(a,r);r.formatTooltip=function(u){var h=l.scale.getLabel({value:u});return fs("nameValue",{noName:!0,value:h})},fe(["AxisLine","AxisTick","Control","CurrentPointer"],function(u){this["_render"+u](a,o,l,r)},this),this._renderAxisLabel(a,s,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"),o=KZr(r,n),s;i==null||i==="auto"?s=a==="horizontal"?o.y+o.height/2=0||s==="+"?"left":"right"},u={horizontal:s>=0||s==="+"?"top":"bottom",vertical:"middle"},h={horizontal:0,vertical:Qye/2},d=a==="vertical"?o.height:o.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*Qye/180;var b,x,w,A=f.get("position",!0),S=p&&f.get("showPlayBtn",!0),T=p&&f.get("showPrevBtn",!0),C=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),C&&(w=[E-g,0],E-=v)):(S&&(b=[E-g,0],E-=v),T&&(x=[0,0],k+=v),C&&(w=[E-g,0],E-=v));var _=[k,E];return r.get("inverse")&&_.reverse(),{viewRect:o,mainLength:d,orient:a,rotation:h[a],labelRotation:y,labelPosOpt:s,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,o=r.viewRect;if(r.orient==="vertical"){var s=ka(),l=o.x,u=o.y+o.height;sg(s,s,[-l,-u]),xy(s,s,-Qye/2),sg(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var h=b(o),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||$t(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,C){w[T]+=S[T][C]-A[T][C]}},e.prototype._createAxis=function(r,n){var i=n.getData(),a=n.get("axisType")||n.get("type");a!=="category"&&a!=="time"&&(a="value");var o=x5(n,a,!1);o.getTicks=function(){return i.mapArray(["value"],function(u){return{value:u}})};var s=i.getDataExtent("value");o.setExtent(s[0],s[1]),Qft(o,{fixMinMax:[!0,!0]});var l=new jZr("value",o,r.axisExtent,a);return l.model=n,l},e.prototype._createGroup=function(r){var n=this[r]=new gr;return this.group.add(n),n},e.prototype._renderAxisLine=function(r,n,i,a){var o=i.getExtent();if(a.get(["lineStyle","show"])){var s=new Go({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:lt({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});n.add(s);var l=this._progressLine=new Go({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:mr({lineCap:"round",lineWidth:s.style.lineWidth},a.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});n.add(l)}},e.prototype._renderAxisTick=function(r,n,i,a){var o=this,s=a.getData(),l=i.scale.getTicks();this._tickSymbols=[],fe(l,function(u){var h=i.dataToCoord(u.value),d=s.getItemModel(u.value),f=d.getModel("itemStyle"),p=d.getModel(["emphasis","itemStyle"]),g=d.getModel(["progress","itemStyle"]),m={x:h,y:0,onclick:Wt(o._changeTimeline,o,u.value)},v=Mbt(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,o._tickSymbols.push(v)})},e.prototype._renderAxisLabel=function(r,n,i,a){var o=this,s=i.getLabelModel();if(s.get("show")){var l=a.getData(),u=i.getViewLabels();this._tickLabels=[],fe(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 $n({x:v,y:0,rotation:r.labelRotation-r.rotation,onclick:Wt(o._changeTimeline,o,d),silent:!1,style:ji(p,{text:h.formattedLabel,align:r.labelAlign,verticalAlign:r.labelBaseline})});y.ensureState("emphasis").style=ji(g),y.ensureState("progress").style=ji(m),n.add(y),Vx(y),Lbt(y).dataIndex=d,o._tickLabels.push(y)}})}},e.prototype._renderControl=function(r,n,i,a){var o=r.controlSize,s=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",Wt(this._changeTimeline,this,d?"-":"+")),f(r.prevBtnPosition,"prev",Wt(this._changeTimeline,this,d?"+":"-")),f(r.playPosition,h?"stop":"play",Wt(this._handlePlayClick,this,!h),!0);function f(p,g,m,v){if(p){var y=Mm(Jt(a.get(["controlStyle",g+"BtnSize"]),o),o),b=[0,-y/2,y,y],x=ZZr(a,g+"Icon",b,{x:p[0],y:p[1],originX:o/2,originY:0,rotation:v?-s: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 o=a.getData(),s=a.getCurrentIndex(),l=o.getItemModel(s).getModel("checkpointStyle"),u=this,h={onCreate:function(d){d.draggable=!0,d.drift=Wt(u._handlePointerDrag,u),d.ondragend=Wt(u._handlePointerDragend,u),Ibt(d,u._progressLine,s,i,a,!0)},onUpdate:function(d){Ibt(d,u._progressLine,s,i,a)}};this._currentPointer=Mbt(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,o=Rl(a.getExtent().slice());i>o[1]&&(i=o[1]),i=0&&(s[o]=+s[o].toFixed(g)),[s,p]}var aj={min:Kr(ij,"min"),max:Kr(ij,"max"),average:Kr(ij,"average"),median:Kr(ij,"median")};function JB(t,e){if(e){var r=t.getData(),n=t.coordinateSystem,i=n&&n.dimensions;if(!iJr(e)&&!ft(e.coord)&&ft(i)){var a=Nbt(e,r,n,t);if(e=lr(e),e.type&&aj[e.type]&&a.baseAxis&&a.valueAxis){var o=Nr(i,a.baseAxis.dim),s=Nr(i,a.valueAxis.dim),l=aj[e.type](r,a.valueAxis.dim,a.baseDataDim,a.valueDataDim,o,s);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&&aj[e.type]){var h=n.getOtherAxis(u);h&&(e.value=oj(r,r.mapDimension(h.dim),e.type))}}else for(var d=e.coord,f=0;f<2;f++)aj[d[f]]&&(d[f]=oj(r,r.mapDimension(i[f]),d[f]));return e}}function Nbt(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(aJr(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 aJr(t,e){var r=t.getData().getDimensionInfo(e);return r&&r.coordDim}function e7(t,e){return t&&t.containData&&e.coord&&!Hye(e)?t.containData(e.coord):!0}function oJr(t,e,r){return t&&t.containZone&&e.coord&&r.coord&&!Hye(e)&&!Hye(r)?t.containZone(e.coord,r.coord):!0}function Bbt(t,e){return t?function(r,n,i,a){var o=a<2?r.coord&&r.coord[a]:r.value;return Wx(o,e[a])}:function(r,n,i,a){return Wx(r.value,e[a])}}function oj(t,e,r){if(r==="average"){var n=0,i=0;return t.each(e,function(a,o){isNaN(a)||(n+=a,i++)}),n/i}else return r==="median"?t.getMedian(e):t.getDataExtent(e)[r==="max"?1:0]}var Wye=Gr(),Yye=function(t){nt(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=qt()},e.prototype.render=function(r,n,i){var a=this,o=this.markerGroupMap;o.each(function(s){Wye(s).keep=!1}),n.eachSeries(function(s){var l=c0.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,n,i)}),o.each(function(s){!Wye(s).keep&&a.group.remove(s.group)}),sJr(n,o,this.type)},e.prototype.markKeep=function(r){Wye(r).keep=!0},e.prototype.toggleBlurSeries=function(r,n){var i=this;fe(r,function(a){var o=c0.getMarkerModelFromSeries(a,i.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(n?xct(l):ppe(l))})}})},e.type="marker",e}(Xi);function sJr(t,e,r){t.eachSeries(function(n){var i=c0.getMarkerModelFromSeries(n,r),a=e.get(n.id);if(i&&a&&a.group){var o=_S(i),s=o.z,l=o.zlevel;OW(a.group,s,l)}})}function $bt(t,e,r){var n=e.coordinateSystem,i=r.getWidth(),a=r.getHeight(),o=n&&n.getArea&&n.getArea();t.each(function(s){var l=t.getItemModel(s),u=l.get("relativeTo")==="coordinate",h=u?o?o.width:0:i,d=u?o?o.height:0:a,f=u&&o?o.x:0,p=u&&o?o.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,s));else if(n){var y=t.get(n.dimensions[0],s),b=t.get(n.dimensions[1],s);g=n.dataToPoint([y,b])}isNaN(m)||(g[0]=m),isNaN(v)||(g[1]=v),t.setItemLayout(s,g)})}var lJr=function(t){nt(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 o=c0.getMarkerModelFromSeries(a,"markPoint");o&&($bt(o.getData(),a,i),this.markerGroupMap.get(a.id).updateLayout())},this)},e.prototype.renderSeries=function(r,n,i,a){var o=r.coordinateSystem,s=r.id,l=r.getData(),u=this.markerGroupMap,h=u.get(s)||u.set(s,new fB),d=cJr(o,r,n);n.setData(d),$bt(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=G8(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}(Yye);function cJr(t,e,r){var n;t?n=vt(t&&t.dimensions,function(s){var l=e.getData(),u=l.getDimensionInfo(l.mapDimension(s))||{};return lt(lt({},u),{name:s,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new jc(n,r),a=vt(r.get("data"),Kr(JB,e));t&&(a=oi(a,Kr(e7,t)));var o=Bbt(!!t,n);return i.initData(a,null,o),i}function uJr(t){t.registerComponentModel(nJr),t.registerComponentView(lJr),t.registerPreprocessor(function(e){Gye(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}var hJr=function(t){nt(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}(c0),sj=Gr(),dJr=function(t,e,r,n){var i=t.getData(),a;if(ft(n))a=n;else{var o=n.type;if(o==="min"||o==="max"||o==="average"||o==="median"||n.xAxis!=null||n.yAxis!=null){var s=void 0,l=void 0;if(n.yAxis!=null||n.xAxis!=null)s=e.getAxis(n.yAxis!=null?"y":"x"),l=Gc(n.yAxis,n.xAxis);else{var u=Nbt(n,i,e,t);s=u.valueAxis;var h=ame(i,u.valueDataDim);l=oj(i,h,o)}var d=s.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&&Vn(l)&&(l=+l.toFixed(Math.min(m,20))),p.coord[d]=g.coord[d]=l,a=[p,g,{type:o,valueIndex:n.valueIndex,value:l}]}else a=[]}var v=[JB(t,a[0]),JB(t,a[1]),lt({},a[2])];return v[2].type=v[2].type||null,Qr(v[2],v[0]),Qr(v[2],v[1]),v};function lj(t){return!isNaN(t)&&!isFinite(t)}function Fbt(t,e,r,n){var i=1-t,a=n.dimensions[t];return lj(e[i])&&lj(r[i])&&e[t]===r[t]&&n.getAxis(a).containData(e[t])}function fJr(t,e){if(t.type==="cartesian2d"){var r=e[0].coord,n=e[1].coord;if(r&&n&&(Fbt(1,r,n,t)||Fbt(0,r,n,t)))return!0}return e7(t,e[0])&&e7(t,e[1])}function qye(t,e,r,n,i){var a=n.coordinateSystem,o=t.getItemModel(e),s,l=Qt(o.get("x"),i.getWidth()),u=Qt(o.get("y"),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(n.getMarkerPosition)s=n.getMarkerPosition(t.getValues(t.dimensions,e));else{var h=a.dimensions,d=t.get(h[0],e),f=t.get(h[1],e);s=a.dataToPoint([d,f])}if(aT(a,"cartesian2d")){var p=a.getAxis("x"),g=a.getAxis("y"),h=a.dimensions;lj(t.get(h[0],e))?s[0]=p.toGlobalCoord(p.getExtent()[r?0:1]):lj(t.get(h[1],e))&&(s[1]=g.toGlobalCoord(g.getExtent()[r?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}t.setItemLayout(e,s)}var pJr=function(t){nt(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 o=c0.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=sj(o).from,u=sj(o).to;l.each(function(h){qye(l,h,!0,a,i),qye(u,h,!1,a,i)}),s.each(function(h){s.setItemLayout(h,[l.getItemLayout(h),u.getItemLayout(h)])}),this.markerGroupMap.get(a.id).updateLayout()}},this)},e.prototype.renderSeries=function(r,n,i,a){var o=r.coordinateSystem,s=r.id,l=r.getData(),u=this.markerGroupMap,h=u.get(s)||u.set(s,new lve);this.group.add(h.group);var d=gJr(o,r,n),f=d.from,p=d.to,g=d.line;sj(n).from=f,sj(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);qye(w,A,S,r,a);var C=T.getModel("itemStyle").getItemStyle();C.fill==null&&(C.fill=G8(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:C})}this.markKeep(h),h.group.silent=n.get("silent")||r.get("silent")},e.type="markLine",e}(Yye);function gJr(t,e,r){var n;t?n=vt(t&&t.dimensions,function(u){var h=e.getData(),d=h.getDimensionInfo(h.mapDimension(u))||{};return lt(lt({},d),{name:u,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new jc(n,r),a=new jc(n,r),o=new jc([],r),s=vt(r.get("data"),Kr(dJr,e,t,r));t&&(s=oi(s,Kr(fJr,t)));var l=Bbt(!!t,n);return i.initData(vt(s,function(u){return u[0]}),null,l),a.initData(vt(s,function(u){return u[1]}),null,l),o.initData(vt(s,function(u){return u[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}function mJr(t){t.registerComponentModel(hJr),t.registerComponentView(pJr),t.registerPreprocessor(function(e){Gye(e.series,"markLine")&&(e.markLine=e.markLine||{})})}var vJr=function(t){nt(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}(c0),cj=Gr(),yJr=function(t,e,r,n){var i=n[0],a=n[1];if(!(!i||!a)){var o=JB(t,i),s=JB(t,a),l=o.coord,u=s.coord;l[0]=Gc(l[0],-1/0),l[1]=Gc(l[1],-1/0),u[0]=Gc(u[0],1/0),u[1]=Gc(u[1],1/0);var h=uH([{},o,s]);return h.coord=[o.coord,s.coord],h.x0=o.x,h.y0=o.y,h.x1=s.x,h.y1=s.y,h}};function uj(t){return!isNaN(t)&&!isFinite(t)}function zbt(t,e,r,n){var i=1-t;return uj(e[i])&&uj(r[i])}function bJr(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 aT(t,"cartesian2d")?r&&n&&(zbt(1,r,n)||zbt(0,r,n))?!0:oJr(t,i,a):e7(t,i)||e7(t,a)}function Ubt(t,e,r,n,i){var a=n.coordinateSystem,o=t.getItemModel(e),s,l=Qt(o.get(r[0]),i.getWidth()),u=Qt(o.get(r[1]),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[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],s=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),s=a.dataToPoint(y,!0)}if(aT(a,"cartesian2d")){var b=a.getAxis("x"),x=a.getAxis("y"),m=t.get(r[0],e),v=t.get(r[1],e);uj(m)?s[0]=b.toGlobalCoord(b.getExtent()[r[0]==="x0"?0:1]):uj(v)&&(s[1]=x.toGlobalCoord(x.getExtent()[r[1]==="y0"?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}return s}var Vbt=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],xJr=function(t){nt(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 o=c0.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=vt(Vbt,function(d){return Ubt(s,l,d,a,i)});s.setItemLayout(l,u);var h=s.getItemGraphicEl(l);h.setShape("points",u)})}},this)},e.prototype.renderSeries=function(r,n,i,a){var o=r.coordinateSystem,s=r.id,l=r.getData(),u=this.markerGroupMap,h=u.get(s)||u.set(s,{group:new gr});this.group.add(h.group),this.markKeep(h);var d=wJr(o,r,n);n.setData(d),d.each(function(f){var p=vt(Vbt,function(E){return Ubt(d,f,E,r,a)}),g=o.getAxis("x").scale,m=o.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))];Rl(b),Rl(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:tt.size.m,align:"auto",backgroundColor:tt.color.transparent,borderColor:tt.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:tt.color.disabled,inactiveBorderColor:tt.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:tt.color.disabled,inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:tt.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:tt.color.tertiary,borderWidth:1,borderColor:tt.color.border},emphasis:{selectorLabel:{show:!0,color:tt.color.quaternary}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},e}(pn),q5=Kr,Xye=fe,hj=gr,Qbt=function(t){nt(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 hj),this.group.add(this._selectorGroup=new hj),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 o=r.get("align"),s=r.get("orient");(!o||o==="auto")&&(o=r.get("left")==="right"&&s==="vertical"?"right":"left");var l=r.get("selector",!0),u=r.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,r,n,i,l,s,u);var h=Ps(r,i).refContainer,d=r.getBoxLayoutParams(),f=r.get("padding"),p=ba(d,h,f),g=this.layoutInner(r,o,p,a,l,u),m=ba(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=K1t(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,o,s,l){var u=this.getContentGroup(),h=qt(),d=n.get("selectedMode"),f=n.get("triggerEvent"),p=[];i.eachRawSeries(function(g){!g.get("legendHoverLink")&&p.push(g.id)}),Xye(n.getData(),function(g,m){var v=this,y=g.get("name");if(!this.newlineDisabled&&(y===""||y===` -`)){var b=new hj;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"),C=this._createItem(x,y,m,g,n,r,A,T,S,d,a);C.on("click",q5(Gbt,y,null,a,p)).on("mouseover",q5(Kye,x.name,null,a,p)).on("mouseout",q5(Zye,x.name,null,a,p)),i.ssr&&C.eachChild(function(k){var E=Cr(k);E.seriesIndex=x.seriesIndex,E.dataIndex=m,E.ssrType="legend"}),f&&C.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 P=_.indexOfName(y),L=_.getItemVisual(P,"style"),R=_.getItemVisual(P,"legendIcon"),D=Wc(L.fill);D&&D[3]===0&&(D[3]=.2,L=lt(lt({},L),{fill:Zf(D,"rgba")}));var M=this._createItem(k,y,m,g,n,r,{},L,R,d,a);M.on("click",q5(Gbt,null,y,a,p)).on("mouseover",q5(Kye,null,y,a,p)).on("mouseout",q5(Zye,null,y,a,p)),i.ssr&&M.eachChild(function(I){var N=Cr(I);N.seriesIndex=k.seriesIndex,N.dataIndex=m,N.ssrType="legend"}),f&&M.eachChild(function(I){E.packEventData(I,n,k,m,y)}),h.set(y,!0)}},this)},this),o&&this._createSelector(o,n,a,s,l)},e.prototype.packEventData=function(r,n,i,a,o){var s={componentType:"legend",componentIndex:n.componentIndex,dataIndex:a,value:o,seriesIndex:i.seriesIndex};Cr(r).eventData=s},e.prototype._createSelector=function(r,n,i,a,o){var s=this.getSelectorGroup();Xye(r,function(u){var h=u.type,d=new $n({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:h==="all"?"legendAllSelect":"legendInverseSelect",legendId:n.id})}});s.add(d);var f=n.getModel("selectorLabel"),p=n.getModel(["emphasis","selectorLabel"]);il(d,{normal:f,emphasis:p},{defaultText:u.title}),Vx(d)})},e.prototype._createItem=function(r,n,i,a,o,s,l,u,h,d,f){var p=r.visualDrawType,g=o.get("itemWidth"),m=o.get("itemHeight"),v=o.isSelected(n),y=a.get("symbolRotate"),b=a.get("symbolKeepAspect"),x=a.get("icon");h=x||h||"roundRect";var w=TJr(h,a,l,u,p,v,f),A=new hj,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(CJr({itemWidth:g,itemHeight:m,icon:h,iconRotate:T,itemStyle:w.itemStyle,symbolKeepAspect:b}))}var C=s==="left"?g+5:-5,k=s,E=o.get("formatter"),_=n;$t(E)&&E?_=E.replace("{name}",n??""):ur(E)&&(_=E(n));var P=v?S.getTextColor():a.get("inactiveColor");A.add(new $n({style:ji(S,{text:_,x:C,y:m/2,fill:P,align:k,verticalAlign:"middle"},{inheritColor:P})}));var L=new nn({shape:A.getBoundingRect(),style:{fill:"transparent"}}),R=a.getModel("tooltip");return R.get("show")&&Ly({el:L,componentModel:o,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,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();IS(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(),o){IS("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";s==="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}(Xi);function TJr(t,e,r,n,i,a,o){function s(v,y){v.lineWidth==="auto"&&(v.lineWidth=y.lineWidth>0?2:0),Xye(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:f5(d,o),u.fill==="inherit"&&(u.fill=n[i]),u.stroke==="inherit"&&(u.stroke=n[h]),u.opacity==="inherit"&&(u.opacity=(i==="fill"?n:r).opacity),s(u,n);var f=e.getModel("lineStyle"),p=f.getLineStyle();if(s(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 CJr(t){var e=t.icon||"roundRect",r=Yo(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=tt.color.neutral00,r.style.lineWidth=2),r}function Gbt(t,e,r,n){Zye(t,e,r,n),r.dispatchAction({type:"legendToggleSelect",name:t??e}),Kye(t,e,r,n)}function Kye(t,e,r,n){r.usingTHL()||r.dispatchAction({type:"highlight",seriesName:t,name:e,excludeSeriesId:n})}function Zye(t,e,r,n){r.usingTHL()||r.dispatchAction({type:"downplay",seriesName:t,name:e,excludeSeriesId:n})}function t7(t,e,r){var n=t==="allSelect"||t==="inverseSelect",i={},a=[];r.eachComponent({mainType:"legend",query:e},function(s){n?s[t]():s[t](e.name),Hbt(s,i),a.push(s.componentIndex)});var o={};return r.eachComponent("legend",function(s){fe(i,function(l,u){s[l?"select":"unSelect"](u)}),Hbt(s,o)}),n?{selected:o,legendIndex:a}:{name:e.name,selected:o}}function Hbt(t,e){var r=e||{};return fe(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 OJr(t){t.registerAction("legendToggleSelect","legendselectchanged",Kr(t7,"toggleSelected")),t.registerAction("legendAllSelect","legendselectall",Kr(t7,"allSelect")),t.registerAction("legendInverseSelect","legendinverseselect",Kr(t7,"inverseSelect")),t.registerAction("legendSelect","legendselected",Kr(t7,"select")),t.registerAction("legendUnSelect","legendunselected",Kr(t7,"unSelect"))}var kJr=d8(EJr);function EJr(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.filterSeries(function(r){for(var n=0;ni[o],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[o]-g[o]:y[a]+=g[o]+x}b[1-a]+=p[s]/2-g[s]/2,h.setPosition(v),d.setPosition(y),f.setPosition(b);var A={x:0,y:0};if(A[o]=m?i[o]:p[o],A[s]=Math.max(p[s],g[s]),A[l]=Math.min(0,g[l]+b[1-a]),d.__rectSize=i[o],m){var S={x:0,y:0};S[o]=Math.max(i[o]-g[o]-x,0),S[s]=A[s],d.setClipPath(new nn({shape:S})),d.__rectSize=S[o]}else f.eachChild(function(C){C.attr({invisible:!0,silent:!0})});var T=this._getPageInfo(r);return T.pageIndex!=null&&qn(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;fe(["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"),o=r.get("pageFormatter"),s=n.pageIndex,l=s!=null?s+1:0,u=n.pageCount;a&&o&&a.setStyle("text",$t(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},e.prototype._getPageInfo=function(r){var n=r.get("scrollDataIndex",!0),i=this.getContentGroup(),a=this._containerGroup.__rectSize,o=r.getOrient().index,s=Jye[o],l=e1e[o],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[o]=-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(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===r&&(n=s)}),n??a},e.type="legend.scroll",e}(Qbt);function DJr(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 LJr(t){Xr(Wbt),t.registerComponentModel(_Jr),t.registerComponentView(RJr),DJr(t)}function MJr(t){Xr(Wbt),Xr(LJr)}var IJr=function(t){nt(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=Hx(XB.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(XB),t1e=Gr();function PJr(t,e,r){t1e(t).coordSysRecordMap.each(function(n){var i=n.dataZoomInfoMap.get(e.uid);i&&(i.getRange=r)})}function NJr(t,e){for(var r=t1e(t).coordSysRecordMap,n=r.keys(),i=0;ia[i+n]&&(n=d),o=o&&h.get("preventDefaultMouseMove",!0),s=Jt(h.get("cursorGrab",!0),s),l=Jt(h.get("cursorGrabbing",!0),l)}),{controlType:n,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o,api:r,zInfo:{component:e.model},triggerInfo:{roamTrigger:null,isInSelf:e.containsPoint},cursorGrab:s,cursorGrabbing:l}}}function UJr(t){t.registerUpdateLifecycle("coordsys:aftercreate",function(e,r){var n=t1e(r),i=n.coordSysRecordMap||(n.coordSysRecordMap=qt());i.each(function(a){a.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=H1t(a);fe(o.infoList,function(s){var l=s.model.uid,u=i.get(l)||i.set(l,BJr(r,s.model)),h=u.dataZoomInfoMap||(u.dataZoomInfoMap=qt());h.set(a.uid,{dzReferCoordSysInfo:s,model:a,getRange:null})})}),i.each(function(a){var o=a.controller,s,l=a.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(s=l.get(u))}if(!s){jbt(i,a);return}var h=zJr(l,a,r);o.enable(h.controlType,h.opt),s5(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var VJr=function(t){nt(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(),PJr(i,r,{pan:Wt(r1e.pan,this),zoom:Wt(r1e.zoom,this),scrollMove:Wt(r1e.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){NJr(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(Rye),r1e={zoom:function(t,e,r,n){var i=this.range,a=i.slice(),o=t.axisModels[0];if(o){var s=n1e[e](null,[n.originX,n.originY],o,r,t),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.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(i2(0,a,[0,100],0,h.minSpan,h.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:Xbt(function(t,e,r,n,i,a){var o=n1e[n]([a.oldX,a.oldY],[a.newX,a.newY],e,i,r);return o.signal*(t[1]-t[0])*o.pixel/o.pixelLength}),scrollMove:Xbt(function(t,e,r,n,i,a){var o=n1e[n]([0,0],[a.scrollDelta,a.scrollDelta],e,i,r);return o.signal*(t[1]-t[0])*a.scrollDelta})};function Xbt(t){return function(e,r,n,i){var a=this.range,o=a.slice(),s=e.axisModels[0];if(s){var l=t(o,s,e,r,n,i);if(i2(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var n1e={grid:function(t,e,r,n,i){var a=r.axis,o={},s=i.model.coordinateSystem.getRect();return t=t||[0,0],a.dim==="x"?(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},polar:function(t,e,r,n,i){var a=r.axis,o={},s=i.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),r.mainType==="radiusAxis"?(o.pixel=e[0]-t[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=e[1]-t[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(t,e,r,n,i){var a=r.axis,o=i.model.coordinateSystem.getRect(),s={};return t=t||[0,0],a.orient==="horizontal"?(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}};function Kbt(t){Dye(t),t.registerComponentModel(IJr),t.registerComponentView(VJr),UJr(t)}var QJr=function(t){nt(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=Hx(XB.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:tt.color.accent10,borderRadius:0,backgroundColor:tt.color.transparent,dataBackground:{lineStyle:{color:tt.color.accent30,width:.5},areaStyle:{color:tt.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:tt.color.accent40,width:.5},areaStyle:{color:tt.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:tt.color.neutral00,borderColor:tt.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:tt.color.accent40,opacity:.5},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:tt.color.tertiary},brushSelect:!0,brushStyle:{color:tt.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:tt.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),e}(XB),r7=nn,GJr=1,i1e=30,HJr=7,n7="horizontal",Zbt="vertical",WJr=5,YJr=["line","bar","candlestick","scatter"],qJr={easing:"cubicOut",duration:100,delay:0},jJr=function(t){nt(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=Wt(this._onBrush,this),this._onBrushEnd=Wt(this._onBrushEnd,this)},e.prototype.render=function(r,n,i,a){if(t.prototype.render.apply(this,arguments),s5(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(){z8(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 gr;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?HJr:0,o=Ps(r,n).refContainer,s=this._findCoordRect(),l=r.get("defaultLocationEdgeGap",!0)||0,u=this._orient===n7?{right:o.width-s.x-s.width,top:o.height-i1e-l-a,width:s.width,height:i1e}:{right:l,top:s.y,width:i1e,height:s.height},h=PS(r.option);fe(["right","top","width","height"],function(f){h[f]==="ph"&&(h[f]=u[f])});var d=ba(h,o);this._location={x:d.x,y:d.y},this._size=[d.width,d.height],this._orient===Zbt&&this._size.reverse()},e.prototype._positionGroup=function(){var r=this.group,n=this._location,i=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),o=a&&a.get("inverse"),s=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;s.attr(i===n7&&!o?{scaleY:l?1:-1,scaleX:1}:i===n7&&o?{scaleY:l?1:-1,scaleX:-1}:i===Zbt&&!o?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=r.getBoundingRect([s]),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 r7({silent:!0,shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:r.get("backgroundColor")},z2:-40}));var o=new r7({shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:"transparent"},z2:0,onclick:Wt(this._onClickPanel,this)}),s=this.api.getZr();a?(o.on("mousedown",this._onBrushStart,this),o.cursor="crosshair",s.on("mousemove",this._onBrush),s.on("mouseup",this._onBrushEnd)):(s.off("mousemove",this._onBrush),s.off("mouseup",this._onBrushEnd)),i.add(o)},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,o=a.getRawData(),s=a.getShadowDim&&a.getShadowDim(),l=s&&o.getDimensionInfo(s)?a.getShadowDim():r.otherDim;if(l==null)return;var u=this._shadowPolygonPts,h=this._shadowPolylinePts;if(o!==this._shadowData||l!==this._shadowDim||n[0]!==i[0]||n[1]!==i[1]){var d=o.getDataExtent(r.thisDim),f=o.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,o.count()-1),x=n[0]/(d[1]-d[0]),w=r.thisAxis.type==="time",A=-b,S=Math.round(o.count()/n[0]),T;o.each([r.thisDim,l],function(P,L,R){if(S>0&&R%S){w||(A+=b);return}A=w?(+P-d[0])*x:A+b;var D=L==null||isNaN(L)||L==="",M=D?0:Zn(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=o,this._shadowDim=l,this._shadowSize=[n[0],n[1]];var C=this.dataZoomModel;function k(P){var L=C.getModel(P?"selectedDataBackground":"dataBackground"),R=new gr,D=new pc({shape:{points:u},segmentIgnoreThreshold:1,style:L.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),M=new Ll({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(o,s){var l=r.getAxisProxy(o,s).getTargetSeriesModels();fe(l,function(u){if(!i&&!(n!==!0&&Nr(YJr,u.get("type"))<0)){var h=a.getComponent(u2(o),s).axis,d=XJr(o),f,p=u.coordinateSystem;d!=null&&p.getOtherAxis&&(f=p.getOtherAxis(h).inverse),d=u.getData().mapDimension(d);var g=u.getData().mapDimension(o);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],o=this._displayables.sliderGroup,s=this._size,l=this.dataZoomModel,u=this.api,h=l.get("borderRadius")||0,d=l.get("brushSelect"),f=n.filler=new r7({silent:d,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(f),o.add(new r7({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:h},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:GJr,fill:tt.color.transparent}})),fe([0,1],function(x){var w=l.get("handleIcon");!eY[w]&&w.indexOf("path://")<0&&w.indexOf("image://")<0&&(w="path://"+w);var A=Yo(w,-1,0,2,2,null,!0);A.attr({cursor:KJr(this._orient),draggable:!0,drift:Wt(this._onDragMove,this,x),ondragend:Wt(this._onDragEnd,this),onmouseover:Wt(this._onOverDataInfoTriggerArea,this,!0),onmouseout:Wt(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 C=l.get("handleColor");C!=null&&(A.style.fill=C),o.add(i[x]=A);var k=l.getModel("textStyle"),E=l.get("handleLabel")||{},_=E.show||!1;r.add(a[x]=new $n({silent:!0,invisible:!_,style:ji(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"),s[1]),m=n.moveHandle=new nn({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:g}}),v=g*.8,y=n.moveHandleIcon=Yo(l.get("moveHandleIcon"),-v/2,-v/2,v,v,tt.color.neutral00,!0);y.silent=!0,y.y=s[1]+g/2-.5,m.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var b=Math.min(s[1]/2,Math.max(g,10));p=n.moveZone=new nn({invisible:!0,shape:{y:s[1]-b,height:g+b}}),p.on("mouseover",function(){u.enterEmphasis(m)}).on("mouseout",function(){u.leaveEmphasis(m)}),o.add(m),o.add(y),o.add(p)}p.attr({draggable:!0,cursor:"grab",drift:Wt(this._onActualMoveZoneDrift,this),ondragstart:Wt(this._onActualMoveZoneDragStart,this),ondragend:Wt(this._onActualMoveZoneDragEnd,this),onmouseover:Wt(this._onOverDataInfoTriggerArea,this,!0),onmouseout:Wt(this._onOverDataInfoTriggerArea,this,!1)})},e.prototype._resetInterval=function(){var r=this._range=this.dataZoomModel.getPercentRange(),n=this._getViewExtent();this._handleEnds=[Zn(r[0],[0,100],n,!0),Zn(r[1],[0,100],n,!0)]},e.prototype._updateInterval=function(r,n){var i=this.dataZoomModel,a=this._handleEnds,o=this._getViewExtent(),s=i.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];i2(n,a,o,i.get("zoomLock")?"all":r,s.minSpan!=null?Zn(s.minSpan,l,o,!0):null,s.maxSpan!=null?Zn(s.maxSpan,l,o,!0):null);var u=this._range,h=this._range=Rl([Zn(a[0],o,l,!0),Zn(a[1],o,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=Rl(i.slice()),o=this._size;fe([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:o[1]/2-m/2})},this),n.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:o[1]});var s={x:a[0],width:a[1]-a[0]};n.moveHandle&&(n.moveHandle.setShape(s),n.moveZone.setShape(s),n.moveZone.getBoundingRect(),n.moveHandleIcon&&n.moveHandleIcon.attr("x",s.x+s.width/2));for(var l=n.dataShadowSegs,u=[0,a[0],a[1],o[0]],h=0;hn[0]||i[1]<0||i[1]>n[1])){var a=this._handleEnds,o=(a[0]+a[1])/2,s=this._updateInterval("all",i[0]-o);this._updateView(),s&&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 o=this._getViewExtent(),s=[0,100],l=this._handleEnds=[i.x,i.x+i.width],u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();i2(0,l,o,0,u.minSpan!=null?Zn(u.minSpan,s,o,!0):null,u.maxSpan!=null?Zn(u.maxSpan,s,o,!0):null),this._range=Rl([Zn(l[0],o,s,!0),Zn(l[1],o,s,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(r){this._brushing&&(by(r.event),this._updateBrushRect(r.offsetX,r.offsetY))},e.prototype._updateBrushRect=function(r,n){var i=this._displayables,a=this.dataZoomModel,o=i.brushRect;o||(o=i.brushRect=new r7({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),i.sliderGroup.add(o)),o.attr("ignore",!1);var s=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(r,n),h=l.transformCoordToLocal(s.x,s.y),d=this._size;u[0]=Math.max(Math.min(d[0],u[0]),0),o.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?qJr:null,start:n[0],end:n[1]})},e.prototype._findCoordRect=function(){var r,n=H1t(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(),o=this.api.getHeight();r={x:a*.2,y:o*.2,width:a*.6,height:o*.6}}return r},e.type="dataZoom.slider",e}(Rye);function Jbt(t,e,r,n){var i=t.get("labelFormatter"),a=t.get("labelPrecision");(a==null||a==="auto")&&(a=r.valuePrecision);var o=r.value[e],s=o==null||isNaN(o)?"":Xc(n)||J8(n)?n.getLabel({value:Math.round(o)}):isFinite(a)?Yn(o,a,!0):o+"";return ur(i)?i(o,s):$t(i)?i.replace("{value}",s):s}function XJr(t){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[t]}function KJr(t){return t==="vertical"?"ns-resize":"ew-resize"}function ext(t){t.registerComponentModel(QJr),t.registerComponentView(jJr),Dye(t)}function ZJr(t){Xr(Kbt),Xr(ext)}var txt={get:function(t,e,r){var n=lr((JJr[t]||{})[e]);return r&&ft(n)?n[n.length-1]:n}},JJr={color:{active:["#006edd","#e0ffff"],inactive:[tt.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]}},rxt=ol.mapVisual,een=ol.eachVisual,ten=ft,a1e=fe,ren=Rl,nen=Zn,dj=function(t){nt(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&&Abt(i,r,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(r){var n=this.stateList;r=Wt(r,this),this.controllerVisuals=zye(this.option.controller,n,r),this.targetVisuals=zye(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 a1e(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,o=this.option.seriesIndex;o==null&&a==null&&(o="all");var s=I_(this.ecModel,"series",{index:o,id:a},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return vt(s,function(l){return l.componentIndex})},e.prototype.eachTargetSeries=function(r,n){fe(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,o=a.precision,s=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($t(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]===s[0]?i[0]+" "+h[1]:r[1]===s[1]?i[1]+" "+h[0]:h[0]+" - "+h[1];return h;function d(f){return f===s[0]?"min":f===s[1]?"max":(+f).toFixed(Math.min(o,20))}},e.prototype.resetExtent=function(){var r=this.option,n=ren([r.min,r.max]);this._dataExtent=n},e.prototype.getDimension=function(r){var n=this,i=this.option.seriesTargets;if(i){var a=py(i,function(o){return o.seriesIndex!=null&&o.seriesIndex===r||o.seriesId!=null&&o.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,o=a.length-1;o>=0;o--){var s=a[o],l=r.getDimensionInfo(s);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={}),o=n.controller||(n.controller={});Qr(a,i),Qr(o,i);var s=this.isCategory();l.call(this,a),l.call(this,o),u.call(this,a,"inRange","outOfRange"),h.call(this,o);function l(d){ten(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]={},a1e(g,function(v,y){if(ol.isValidType(y)){var b=txt.get(y,"inactive",s);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";a1e(this.stateList,function(y){var b=this.itemSize,x=d[y];x||(x=d[y]={color:s?g:[g]}),x.symbol==null&&(x.symbol=f&&lr(f)||(s?v:[v])),x.symbolSize==null&&(x.symbolSize=p&&lr(p)||(s?b[0]:[b[0],b[0]])),x.symbol=rxt(x.symbol,function(S){return S==="none"?v:S});var w=x.symbolSize;if(w!=null){var A=-1/0;een(w,function(S){S>A&&(A=S)}),x.symbolSize=rxt(w,function(S){return nen(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:tt.color.transparent,borderColor:tt.color.borderTint,contentColor:tt.color.theme[0],inactiveColor:tt.color.disabled,borderWidth:0,padding:tt.size.m,textGap:10,precision:0,textStyle:{color:tt.color.secondary}},e}(pn),nxt=[20,140],ien=function(t){nt(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]=nxt[0]),(r[1]==null||isNaN(r[1]))&&(r[1]=nxt[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),fe(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=Rl((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=[],o=i.getData();o.each(this.getDataDimensionIndex(o),function(s,l){r[0]<=s&&s<=r[1]&&a.push(l)},this),n.push({seriesId:i.id,dataIndex:a})},this),n},e.prototype.getVisualMeta=function(r){var n=ixt(this,"outOfRange",this.getExtent()),i=ixt(this,"inRange",this.option.range.slice()),a=[];function o(p,g){a.push({value:p,color:r(p,g)})}for(var s=0,l=0,u=i.length,h=n.length;lr[1])break;a.push({color:this.getControllerVisual(l,"color",n),offset:s/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 gr(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,o=i.handleThumbs,s=i.handleLabels,l=a.itemSize,u=a.getExtent(),h=this._applyTransform("left",i.mainGroup);aen([0,1],function(d){var f=o[d];f.setStyle("fill",n.handlesColor[d]),f.y=r[d];var p=u0(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=fg(i.handleLabelPoints[d],kS(f,this.group));if(this._orient==="horizontal"){var v=h==="left"||h==="top"?(l[0]-g)/2:(l[0]-g)/-2;m[1]+=v}s[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 o=this.visualMapModel,s=o.getExtent(),l=o.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=u0(r,s,u,!0),v=l[0]-g/2,y={x:d.x,y:d.y};d.y=m,d.x=v;var b=fg(h.indicatorLabelPoint,kS(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||"")+o.formatValueText(n),verticalAlign:S?w:"middle",align:S?"center":w});var T={x:v,y:m,style:{fill:p}},C={style:{x:b[0],y:b[1]}};if(o.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(C,k)}else d.attr(T),x.attr(C);this._firstShowIndicator=!1;var E=this._shapes.handleLabels;if(E)for(var _=0;_o[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||uxt(i))&&(p=this._hoverLinkDataIndices=i.findTargetDataIndices(d));var g=u6r(f,p);this._dispatchHighDown("downplay",fj(g[0],i)),this._dispatchHighDown("highlight",fj(g[1],i))}},e.prototype._hoverLinkFromSeriesMouseOver=function(r){var n;if(VS(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 o=i.getData(n.dataType),s=o.getStore().get(a.getDataDimensionIndex(o),n.dataIndex);isNaN(s)||this._showIndicator(s,s)}}},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=o,n.push(a))}}),t.getData().setVisual("visualMeta",n)}}];function fen(t,e,r,n){for(var i=e.targetVisuals[n],a=ol.prepareVisualTypes(i),o={color:G8(t.getData(),"color")},s=0,l=a.length;s0:e.splitNumber>0)||e.calculable)?"continuous":"piecewise"}),t.registerAction(uen,hen),fe(den,function(e){t.registerVisual(t.PRIORITY.VISUAL.COMPONENT,e)}),t.registerPreprocessor(pen))}function gxt(t){t.registerComponentModel(ien),t.registerComponentView(len),pxt(t)}var gen=function(t){nt(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=[],men[this._mode].call(this,this._pieceList),this._resetSelected(r,n);var a=this.option.categories;this.resetVisual(function(o,s){i==="categories"?(o.mappingMethod="category",o.categories=lr(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=vt(this._pieceList,function(l){return l=lr(l),s!=="inRange"&&(l.visual=null),l}))})},e.prototype.completeVisualOption=function(){var r=this.option,n={},i=ol.listVisualTypes(),a=this.isCategory();fe(r.pieces,function(s){fe(i,function(l){s.hasOwnProperty(l)&&(n[l]=1)})}),fe(n,function(s,l){var u=!1;fe(this.stateList,function(h){u=u||o(r,h,l)||o(r.target,h,l)},this),!u&&fe(this.stateList,function(h){(r[h]||(r[h]={}))[l]=txt.get(l,h==="inRange"?"active":"inactive",a)})},this);function o(s,l,u){return s&&s[l]&&s[l].hasOwnProperty(u)}t.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(r,n){var i=this.option,a=this._pieceList,o=(n?i:r).selected||{};if(i.selected=o,fe(a,function(l,u){var h=this.getSelectedMapKey(l);o.hasOwnProperty(h)||(o[h]=!0)},this),i.selectedMode==="single"){var s=!1;fe(a,function(l,u){var h=this.getSelectedMapKey(l);o[h]&&(s?o[h]=!1:s=!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=ol.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 o=[],s=a.getData();s.each(this.getDataDimensionIndex(s),function(l,u){var h=ol.findPieceIndex(l,i);h===r&&o.push(u)},this),n.push({seriesId:a.id,dataIndex:o})},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 o(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 s=this._pieceList.slice();if(!s.length)s.push({interval:[-1/0,1/0]});else{var l=s[0].interval[0];l!==-1/0&&s.unshift({interval:[-1/0,l]}),l=s[s.length-1].interval[1],l!==1/0&&s.push({interval:[l,1/0]})}var u=-1/0;return fe(s,function(h){var d=h.interval;d&&(d[0]>u&&o([u,d[0]],"outOfRange"),o(d.slice()),u=d[1])},this),{stops:n,outerColors:i}},e.type="visualMap.piecewise",e.defaultOption=Hx(dj.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}(dj),men={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 o=0,s=n[0];o","≥"][n[0]]];r.text=r.text||this.formatValueText(r.value!=null?r.value:r.interval,!1,i)},this)}};function mxt(t,e){var r=t.inverse;(t.orient==="vertical"?!r:r)&&e.reverse()}var ven=function(t){nt(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,o=this._getItemAlign(),s=n.itemSize,l=this._getViewData(),u=l.endsText,h=Gc(n.get("showLabel",!0),!u),d=!n.get("selectedMode");u&&this._renderEndsText(r,u[0],s,h,o),fe(l.viewPieceList,function(f){var p=f.piece,g=new gr;g.onclick=Wt(this._onItemClick,this,p),this._enableHoverLink(g,f.indexInModelPieceList);var m=n.getRepresentValue(p);if(this._createItemSymbol(g,m,[0,0,s[0],s[1]],d),h){var v=this.visualMapModel.getValueState(m),y=a.get("align")||o;g.add(new $n({style:ji(a,{x:y==="right"?-i:s[0]+i,y:s[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],s,h,o),IS(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(o){var s=i.visualMapModel;s.option.hoverLink&&i.api.dispatchAction({type:o,batch:fj(s.findTargetDataIndices(n),s)})}},e.prototype._getItemAlign=function(){var r=this.visualMapModel,n=r.option;if(n.orient==="vertical")return sxt(r,this.api,r.itemSize);var i=n.align;return(!i||i==="auto")&&(i="left"),i},e.prototype._renderEndsText=function(r,n,i,a,o){if(n){var s=new gr,l=this.visualMapModel.textStyleModel;s.add(new $n({style:ji(l,{x:a?o==="right"?i[0]:0:i[0]/2,y:i[1]/2,verticalAlign:"middle",align:a?o:"center",text:n})})),r.add(s)}},e.prototype._getViewData=function(){var r=this.visualMapModel,n=vt(r.getPieceList(),function(s,l){return{piece:s,indexInModelPieceList:l}}),i=r.get("text"),a=r.get("orient"),o=r.get("inverse");return(a==="horizontal"?o:!o)?n.reverse():i&&(i=i.slice().reverse()),{viewPieceList:n,endsText:i}},e.prototype._createItemSymbol=function(r,n,i,a){var o=Yo(this.getControllerVisual(n,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(n,"color"));o.silent=a,r.add(o)},e.prototype._onItemClick=function(r){var n=this.visualMapModel,i=n.option,a=i.selectedMode;if(a){var o=lr(i.selected),s=n.getSelectedMapKey(r);a==="single"||a===!0?(o[s]=!0,fe(o,function(l,u){o[u]=u===s})):o[s]=!o[s],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}},e.type="visualMap.piecewise",e}(axt);function vxt(t){t.registerComponentModel(gen),t.registerComponentView(ven),pxt(t)}function yen(t){Xr(gxt),Xr(vxt)}var ben=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:rut(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}(),xen=function(t){nt(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 ben(this);if(this._target=null,this.ecModel.eachSeries(function(i){wvt(i,null)}),this.shouldShow()){var n=this.getTarget();wvt(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:tt.color.border,borderWidth:2},windowStyle:{borderWidth:1,color:tt.color.neutral30,borderColor:tt.color.neutral40,opacity:.3},z:10},e}(pn),wen=function(t){nt(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 lq),!this._isEnabled()){this._clear();return}this._renderVersion=i.getECUpdateCycleVersion();var a=this.group;a.removeAll();var o=r.getModel("itemStyle"),s=o.getItemStyle();s.fill==null&&(s.fill=n.get("backgroundColor")||tt.color.neutral00);var l=Ps(r,i).refContainer,u=ba(Iut(r,!0),l),h=s.lineWidth||0,d=this._contentRect=ES(u.clone(),h/2,!0,!0),f=new gr;a.add(f),f.setClipPath(new nn({shape:d.plain()}));var p=this._targetGroup=new gr;f.add(p);var g=u.plain();g.r=o.getShallow("borderRadius",!0),a.add(this._bgRect=new nn({style:s,shape:g,silent:!1,cursor:"grab"}));var m=r.getModel("windowStyle"),v=m.getShallow("borderRadius",!0);f.add(this._windowRect=new nn({shape:{x:0,y:0,width:0,height:0,r:v},style:m.getItemStyle(),silent:!1,cursor:"grab"})),this._dealRenderContent(),this._dealUpdateWindow(),bxt(r,this)},e.prototype.renderContent=function(r){this._bridgeRendered=r,this._isEnabled()&&(this._dealRenderContent(),this._dealUpdateWindow(),bxt(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 o=r.group,s=o.getBoundingRect();n.add(o),this._bgRect.z2=r.z2Range.min-10,dq(i,s.x,s.y,s.width,s.height);var l=ba({left:"center",top:"center",aspect:s.width/s.height},a);fq(i,l.x,l.y,l.width,l.height),DB(o,i,pT),o.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=$d([],r.targetTrans),i=Bd([],uq(null,this._coordSys),n);this._transThisToTarget=$d([],i);var a=r.viewportRect;a?a=a.clone():a=new pr(0,0,this._api.getWidth(),this._api.getHeight()),a.applyTransform(i);var o=this._windowRect,s=o.shape.r;o.setShape(mr({r:s},a))}},e.prototype._resetRoamController=function(r){var n=this,i=this._api,a=this._roamController;if(a||(a=this._roamController=new hT(i.getZr())),!r||!this._isEnabled()){a.disable();return}a.enable(r,{api:i,zInfo:{component:this._model},triggerInfo:{roamTrigger:null,isInSelf:function(o,s,l){return n._contentRect.contain(s,l)}}}),a.off("pan").off("zoom").on("pan",Wt(this._onPan,this)).on("zoom",Wt(this._onZoom,this))},e.prototype._onPan=function(r){var n=this._transThisToTarget;if(!(!this._isEnabled()||!n)){var i=io([],[r.oldX,r.oldY],n),a=io([],[r.oldX-r.dx,r.oldY-r.dy],n);this._api.dispatchAction(yxt(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=io([],[r.originX,r.originY],n);this._api.dispatchAction(yxt(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}(Xi);function yxt(t,e){var r=t.mainType==="series"?t.subType+"Roam":t.mainType+"Roam",n={type:r};return n[t.mainType+"Id"]=t.id,lt(n,e),n}function bxt(t,e){var r=_S(t);OW(e.group,r.z,r.zlevel)}function Aen(t){t.registerComponentModel(xen),t.registerComponentView(wen)}var Sen={label:{enabled:!0},decal:{show:!1}},xxt=Gr(),wxt=Gr(),Ten=d8(Cen);function Cen(t,e){var r=t.getModel("aria");if(!r.get("enabled"))return;var n=wxt(t).scope||(wxt(t).scope={}),i=lr(Sen);Qr(i.label,t.getLocaleModel().get("aria"),!1),Qr(r.option,i,!1),a(),o();function a(){var h=r.getModel("decal"),d=h.get("show");if(d){var f=qt();t.eachSeries(function(p){p.isColorBySeries()||(xxt(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=hge(p.ecModel,p.name,n,t.getSeriesCount()),w=g.getVisual("decal");g.setVisual("decal",A(w,x))}else{var m=p.getRawData(),v={},y=xxt(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],C=m.getName(S)||S+"",k=hge(p.ecModel,C,y,b),E=g.getItemVisual(T,"decal");g.setItemVisual(T,"decal",A(E,k))})}function A(S,T){var C=S?lt(lt({},T),S):T;return C.dirty=!0,C}})}}function o(){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=s(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+=s(A,{seriesCount:p}),t.eachSeries(function(k,E){if(E1?f.get(["series","multiple",L]):f.get(["series","single",L]),_=s(_,{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"]);_+=s(D,{displayCnt:g})}else _+=f.get(["data","allData"]);for(var M=f.get(["data","separator","middle"]),I=f.get(["data","separator","end"]),N=f.get(["data","excludeDimensionId"]),F=[],B=0;B":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},Een=function(){function t(e){var r=this._condVal=$t(e)?new RegExp(e):Jot(e)?e:null;if(r==null){var n="";si(n)}}return t.prototype.evaluate=function(e){var r=typeof e;return $t(r)?this._condVal.test(e):Vn(r)?this._condVal.test(e+""):!1},t}(),_en=function(){function t(){}return t.prototype.evaluate=function(){return this.value},t}(),Ren=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,I,N){var F=Math.abs(R-L),B=Math.tan(F/4)*4/3,V=RC:_2&&n.push(i),n}function c1e(t,e,r,n,i,a,o,s,l,u){if(X5(t,r)&&X5(e,n)&&X5(i,o)&&X5(a,s)){l.push(o,s);return}var h=2/u,d=h*h,f=o-t,p=s-e,g=Math.sqrt(f*f+p*p);f/=g,p/=g;var m=r-t,v=n-e,y=i-o,b=a-s,x=m*m+v*v,w=y*y+b*b;if(x=0&&C=0){l.push(o,s);return}var k=[],E=[];Lx(t,r,i,o,.5,k),Lx(e,n,a,s,.5,E),c1e(k[0],E[0],k[1],E[1],k[2],E[2],k[3],E[3],l,u),c1e(k[4],E[4],k[5],E[5],k[6],E[6],k[7],E[7],l,u)}function Gen(t,e){var r=l1e(t),n=[];e=e||1;for(var i=0;i0)for(var u=0;uMath.abs(u),d=Cxt([l,u],h?0:1,e),f=(h?s:u)/d.length,p=0;pi,o=Cxt([n,i],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",h=a?"y":"x",d=t[s]/o.length,f=0;f1?null:new wr(m*l+t,m*u+e)}function Yen(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 K5(t,e){var r=t[t.length-1];r&&r[0]===e[0]&&r[1]===e[1]||t.push(e)}function qen(t,e,r){for(var n=t.length,i=[],a=0;ao?(u.x=h.x=s+a/2,u.y=l,h.y=l+o):(u.y=h.y=l+o/2,u.x=s,h.x=s+a),qen(e,u,h)}function pj(t,e,r,n){if(r===1)n.push(e);else{var i=Math.floor(r/2),a=t(e);pj(t,a[0],i,n),pj(t,a[1],r-i,n)}return n}function jen(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),s+=u*u*(3*h^d),d===0&&(h===1&&(t=u-1-t,e=u-1-e),l=t,t=e,e=l)}return s}function vj(t){var e=1/0,r=1/0,n=-1/0,i=-1/0,a=vt(t,function(s){var l=s.getBoundingRect(),u=s.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]}),o=vt(a,function(s,l){return{cp:s,z:itn(s[0],s[1],e,r,n,i),path:t[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function Ixt(t){return Zen(t.path,t.count)}function h1e(){return{fromIndividuals:[],toIndividuals:[],count:0}}function atn(t,e,r){var n=[];function i(A){for(var S=0;S=0;i--)if(!r[i].many.length){var l=r[s].many;if(l.length<=1)if(s)s=0;else return r;var a=l.length,u=Math.ceil(a/2);r[i].many=l.slice(u,a),r[s].many=l.slice(0,u),s++}return r}var stn={clone:function(t){for(var e=[],r=1-Math.pow(1-t.path.style.opacity,1/t.count),n=0;n0))return;var s=n.getModel("universalTransition").get("delay"),l=lt({setToFinal:!0},o),u,h;Pxt(t)&&(u=t,h=e),Pxt(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 C=b?S[0]:T,k=b?T:S[0];if(gj(C))d({many:[C],one:k},!0,x,w,!0);else{var E=s?mr({delay:s(x,w)},l):l;u1e(C,k,E),a(C,k,C,k,E)}}else for(var _=mr({dividePath:stn[r],individualDelay:s&&function(I,N,F,B){return s(I+x,w)}},l),P=b?atn(S,T,_):otn(T,S,_),L=P.fromIndividuals,R=P.toIndividuals,D=L.length,M=0;Me.length,p=u?Nxt(h,u):Nxt(f?e:t,[f?t:e]),g=0,m=0;mBxt))for(var a=n.getIndices(),o=0;o0&&S.group.traverse(function(C){C instanceof yn&&!C.animators.length&&C.animateFrom({style:{opacity:0}},T)})})}function Qxt(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function Gxt(t){return ft(t)?t.sort().join(","):t}function d2(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function ptn(t,e){var r=qt(),n=qt(),i=qt();return fe(t.oldSeries,function(a,o){var s=t.oldDataGroupIds[o],l=t.oldData[o],u=Qxt(a),h=Gxt(u);n.set(h,{dataGroupId:s,data:l}),ft(u)&&fe(u,function(d){i.set(d,{key:h,dataGroupId:s,data:l})})}),fe(e.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var o=a.get("dataGroupId"),s=a.getData(),l=Qxt(a),u=Gxt(l),h=n.get(u);if(h)r.set(u,{oldSeries:[{dataGroupId:h.dataGroupId,divide:d2(h.data),data:h.data}],newSeries:[{dataGroupId:o,divide:d2(s),data:s}]});else if(ft(l)){var d=[];fe(l,function(g){var m=n.get(g);m.data&&d.push({dataGroupId:m.dataGroupId,divide:d2(m.data),data:m.data})}),d.length&&r.set(u,{oldSeries:d,newSeries:[{dataGroupId:o,data:s,divide:d2(s)}]})}else{var f=i.get(l);if(f){var p=r.get(f.key);p||(p={oldSeries:[{dataGroupId:f.dataGroupId,data:f.data,divide:d2(f.data)}],newSeries:[]},r.set(f.key,p)),p.newSeries.push({dataGroupId:o,data:s,divide:d2(s)})}}}}),r}function Hxt(t,e){for(var r=0;r=0&&i.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:d2(e.oldData[s]),groupIdDim:o.dimension})}),fe(qi(t.to),function(o){var s=Hxt(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:d2(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&Vxt(i,a,n)}function mtn(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){fe(qi(n.seriesTransition),function(i){fe(qi(i.to),function(a){for(var o=n.updatedSeries,s=0;ss.vmin?n+=s.vmin-i+(e-s.vmin)/(s.vmax-s.vmin)*s.gapReal:n+=e-i,i=s.vmax,a=!1;break}n+=s.vmin-i+s.gapReal,i=s.vmax}return a&&(n+=e-i),n},transformOut:function(e,r){if(r&&r.depth===By)return e;for(var n=Wxt,i=Yxt,a=!0,o=0,s=0;su?o=l.vmin+(e-u)/(h-u)*(l.vmax-l.vmin):o=i+e-n,i=l.vmax,a=!1;break}n=h,i=l.vmax}return a&&(o=i+e-n),o}},t}();function ytn(t,e){return new vtn(t,e)}var Wxt=0,Yxt=0;function btn(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()}};fe(t.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(r+=l.val);var u=g1e(s,e);if(u){var h=u.vmin!==s.vmin,d=u.vmax!==s.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/(s.vmax-s.vmin),a[p][l.type].val=l.val}else n[l.type].span+=f,n[l.type].val+=l.val}});var o=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));fe(t.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(s.gapReal=r!==0?rn(o,0)*l.val/r:0),l.type==="tpAbs"&&(s.gapReal=l.val),s.gapReal==null&&(s.gapReal=0)})}function xtn(t,e,r,n,i,a){t!=="no"&&fe(r,function(o){var s=g1e(o,a);if(s)for(var l=e.length-1;l>=0;l--){var u=e[l],h=n(u),d=i*3/4;h>s.vmin-d&&he[0]&&r=0&&o<1-1e-5}fe(t,function(o){if(!(!o||o.start==null||o.end==null)&&!o.isExpanded){var s={breakOption:lr(o),vmin:e.parse(o.start),vmax:e.parse(o.end),gapParsed:{type:"tpAbs",val:0},gapReal:null};if(o.gap!=null){var l=!1;if($t(o.gap)){var u=Nd(o.gap);if(u.match(/%$/)){var h=parseFloat(u)/100;i(h)||(h=0),s.gapParsed.type="tpPrct",s.gapParsed.val=h,l=!0}}if(!l){var d=e.parse(o.gap);(!isFinite(d)||d<0)&&(d=0),s.gapParsed.type="tpAbs",s.gapParsed.val=d}}if(s.vmin===s.vmax&&(s.gapParsed.type="tpAbs",s.gapParsed.val=0),r&&r.noNegative&&fe(["vmin","vmax"],function(p){s[p]<0&&(s[p]=0)}),s.vmin>s.vmax){var f=s.vmax;s.vmax=s.vmin,s.vmin=f}n.push(s)}}),n.sort(function(o,s){return o.vmin-s.vmin});var a=-1/0;return fe(n,function(o,s){a>o.vmin&&(n[s]=null),a=o.vmax}),{breaks:oi(n,function(o){return!!o})}}function v1e(t,e){return y1e(e)===y1e(t)}function y1e(t){return t.start+"_\0_"+t.end}function Atn(t,e,r){var n=[];fe(t,function(a,o){var s=e(a);s&&s.type==="vmin"&&n.push([o])}),fe(t,function(a,o){var s=e(a);if(s&&s.type==="vmax"){var l=py(n,function(u){return v1e(e(t[u[0]]).parsedBreak.breakOption,s.parsedBreak.breakOption)});l&&l.push(o)}});var i=[];return fe(n,function(a){a.length===2&&i.push(r?a:[t[a[0]],t[a[1]]])}),i}function Stn(t,e,r,n){if(e.break){var i=e.break.parsedBreak,a=py(r,function(h){return v1e(h.breakOption,e.break.parsedBreak.breakOption)}),o={lookup:n,depth:By},s=t.transformOut(i.vmin,o),l=t.transformOut(i.vmax,o),u={vmin:s,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 Ttn(t,e,r,n,i){i.original=m1e(t,e,r);var a=i.transformed=m1e(t,e,r),o=i.lookup;a.breaks=vt(a.breaks,function(s,l){var u={depth:By},h=e.transformIn(s.vmin,u),d=e.transformIn(s.vmax,u),f={type:s.gapParsed.type,val:s.gapParsed.type==="tpAbs"?e.transformIn(s.vmin+s.gapParsed.val,u)-h:s.gapParsed.val};return o.from[n+l]=h,o.to[n+l]=s.vmin,o.from[n+l+1]=d,o.to[n+l+1]=s.vmax,{vmin:h,vmax:d,gapParsed:f,gapReal:s.gapReal,breakOption:s.breakOption}})}var Ctn={vmin:"start",vmax:"end"};function Otn(t,e){return e&&(t=t||{},t.break={type:Ctn[e.type],start:e.parsedBreak.vmin,end:e.parsedBreak.vmax}),t}function ktn(){O8r({createBreakScaleMapper:ytn,pruneTicksByBreak:xtn,addBreaksToTicks:wtn,parseAxisBreakOption:m1e,identifyAxisBreak:v1e,serializeAxisBreakIdentifier:y1e,retrieveAxisBreakPairs:Atn,getTicksBreakOutwardTransform:Stn,parseAxisBreakOptionInwardTransform:Ttn,makeAxisLabelFormatterParamBreak:Otn})}var qxt=Gr();function Etn(t,e){var r=py(t,function(n){return Ho().identifyAxisBreak(n.parsedBreak.breakOption,e.breakOption)});return r||t.push(r={zigzagRandomList:[],parsedBreak:e,shouldRemove:!1}),r}function _tn(t){fe(t,function(e){return e.shouldRemove=!0})}function Rtn(t){for(var e=t.length-1;e>=0;e--)t[e].shouldRemove&&t.splice(e,1)}function Dtn(t,e,r,n,i){var a=r.axis;if(a.scale.isBlank()||!Ho())return;var o=Ho().retrieveAxisBreakPairs(a.scale.getTicks({breakTicks:"only_break"}),function(k){return k.break},!1);if(!o.length)return;var s=r.getModel("breakArea"),l=s.get("zigzagAmplitude"),u=s.get("zigzagMinSpan"),h=s.get("zigzagMaxSpan");u=Math.max(2,u||0),h=Math.max(u,h||0);var d=s.get("expandOnClick"),f=s.get("zigzagZ"),p=s.getModel("itemStyle"),g=p.getItemStyle(),m=g.stroke,v=g.lineWidth,y=g.lineDash,b=g.fill,x=new gr({ignoreModelZ:!0}),w=a.isHorizontal(),A=qxt(e).visualList||(qxt(e).visualList=[]);_tn(A);for(var S=function(k){var E=o[k][0].break.parsedBreak,_=[];_[0]=a.toGlobalCoord(a.dataToCoord(E.vmin,!0)),_[1]=a.toGlobalCoord(a.dataToCoord(E.vmax,!0)),_[1]<_[0]&&_.reverse();var P=Etn(A,E);P.shouldRemove=!1;var L=new gr;C(P.zigzagRandomList,L,_[0],_[1],w,E),d&&L.on("click",function(){var R={type:QY,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;q&&(U=N);var Y=[],ne=[];Y[M]=_,ne[M]=P,!G&&!q&&(Y[M]+=z?-l:l,ne[M]-=z?l:-l),Y[I]=U,ne[I]=U,B.push(Y),V.push(ne);var X=void 0;if(Qb[1]&&b.reverse(),{coordPair:b,brkId:Ho().serializeAxisBreakIdentifier(y.breakOption)}});l.sort(function(v,y){return v.coordPair[0]-y.coordPair[0]});for(var u=o[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;s=(f-m)/h.x}var v=new wr,y=new wr;wr.scale(v,n,-s),wr.scale(y,n,1-s),Eme(r[0],v),Eme(r[1],y)}function Itn(t,e){var r={breaks:[]};return fe(e.breaks,function(n){if(n){var i=py(t.get("breaks",!0),function(s){return Ho().identifyAxisBreak(s,n)});if(i){var a=e.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===QY?!0:a===xgt?!1:a===wgt?!i.isExpanded:i.isExpanded,r.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}}),r}function Ptn(){Kzr({adjustBreakLabelPair:Mtn,buildAxisBreakLine:Ltn,rectCoordBuildBreakAxis:Dtn,updateModelAxisBreak:Itn})}function Ntn(t){tUr(t),ktn(),Ptn()}function Btn(){vVr($tn)}function $tn(t,e){fe(t,function(r){if(!r.model.get(["axisLabel","inside"])){var n=Ftn(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 Ftn(t){var e=t.model,r=t.scale;if(!e.get(["axisLabel","show"])||r.isBlank())return;var n,i,a=r.getExtent();r instanceof eB?i=r.count():(n=r.getTicks(),i=n.length);var o=t.getLabelModel(),s=rB(t),l,u=1;i>40&&(u=Math.ceil(i/40));for(var h=0;hjxt(t,"name",{value:e,configurable:!0}),yj=(t,e)=>{for(var r in e)jxt(t,r,{get:e[r],enumerable:!0})},Xxt={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Ti,function(){var r=1e3,n=6e4,i=36e5,a="millisecond",o="second",s="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 I=String(R);return!I||I.length>=D?R:""+Array(D+1-I.length).join(M)+R},w={s:x,z:function(R){var D=-R.utcOffset(),M=Math.abs(D),I=Math.floor(M/60),N=M%60;return(D<=0?"+":"-")+x(I,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!I&&N&&(A=N),N||!I&&A},E=function(R,D){if(C(R))return R.clone();var M=typeof D=="object"?D:{};return M.date=R,M.args=arguments,new P(M)},_=w;_.l=k,_.i=C,_.w=function(R,D){return E(R,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var P=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(I){var N=I.date,F=I.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,I){var N=E(M);return this.startOf(I)<=N&&N<=this.endOf(I)},D.isAfter=function(M,I){return E(M){},"trace"),debug:O((...t)=>{},"debug"),info:O((...t)=>{},"info"),warn:O((...t)=>{},"warn"),error:O((...t)=>{},"error"),fatal:O((...t)=>{},"fatal")},b1e=O(function(t="fatal"){let e=Yy.fatal;typeof t=="string"?t.toLowerCase()in Yy&&(e=Yy[t]):typeof t=="number"&&(e=t),ye.trace=()=>{},ye.debug=()=>{},ye.info=()=>{},ye.warn=()=>{},ye.error=()=>{},ye.fatal=()=>{},e<=Yy.fatal&&(ye.fatal=console.error?console.error.bind(console,gp("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",gp("FATAL"))),e<=Yy.error&&(ye.error=console.error?console.error.bind(console,gp("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",gp("ERROR"))),e<=Yy.warn&&(ye.warn=console.warn?console.warn.bind(console,gp("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",gp("WARN"))),e<=Yy.info&&(ye.info=console.info?console.info.bind(console,gp("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",gp("INFO"))),e<=Yy.debug&&(ye.debug=console.debug?console.debug.bind(console,gp("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",gp("DEBUG"))),e<=Yy.trace&&(ye.trace=console.debug?console.debug.bind(console,gp("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",gp("TRACE")))},"setLogLevel"),gp=O(t=>`%c${Pl().format("ss.SSS")} : ${t} : `,"format");const bj={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 bj.hue2rgb(a,i,t+1/3)*255;case"g":return bj.hue2rgb(a,i,t)*255;case"b":return bj.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),o=(i+a)/2;if(n==="l")return o*100;if(i===a)return 0;const s=i-a,l=o>.5?s/(2-i-a):s/(i+a);if(n==="s")return l*100;switch(i){case t:return((e-r)/s+(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}`}}},f2={};for(let t=0;t<=255;t++)f2[t]=Cn.unit.dec2hex(t);const Zc={ALL:0,RGB:1,HSL:2};let Vtn=class{constructor(){this.type=Zc.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=Zc.ALL}is(e){return this.type===e}};class Qtn{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new Vtn}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=Zc.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=Cn.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=Cn.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=Cn.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=Cn.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=Cn.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=Cn.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(Zc.HSL)&&r!==void 0?r:(this._ensureHSL(),Cn.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(Zc.HSL)&&r!==void 0?r:(this._ensureHSL(),Cn.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(Zc.HSL)&&r!==void 0?r:(this._ensureHSL(),Cn.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(Zc.RGB)&&r!==void 0?r:(this._ensureRGB(),Cn.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(Zc.RGB)&&r!==void 0?r:(this._ensureRGB(),Cn.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(Zc.RGB)&&r!==void 0?r:(this._ensureRGB(),Cn.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(Zc.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(Zc.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(Zc.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(Zc.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(Zc.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(Zc.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const xj=new Qtn({r:0,g:0,b:0,a:0},"transparent"),J5={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(J5.re);if(!e)return;const r=e[1],n=parseInt(r,16),i=r.length,a=i%4===0,o=i>4,s=o?1:17,l=o?8:4,u=a?0:-1,h=o?255:15;return xj.set({r:(n>>l*(u+3)&h)*s,g:(n>>l*(u+2)&h)*s,b:(n>>l*(u+1)&h)*s,a:a?(n&h)*s/255:1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${f2[Math.round(e)]}${f2[Math.round(r)]}${f2[Math.round(n)]}${f2[Math.round(i*255)]}`:`#${f2[Math.round(e)]}${f2[Math.round(r)]}${f2[Math.round(n)]}`}},_T={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(_T.hueRe);if(e){const[,r,n]=e;switch(n){case"grad":return Cn.channel.clamp.h(parseFloat(r)*.9);case"rad":return Cn.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return Cn.channel.clamp.h(parseFloat(r)*360)}}return Cn.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(_T.re);if(!r)return;const[,n,i,a,o,s]=r;return xj.set({h:_T._hue2deg(n),s:Cn.channel.clamp.s(parseFloat(i)),l:Cn.channel.clamp.l(parseFloat(a)),a:o?Cn.channel.clamp.a(s?parseFloat(o)/100:parseFloat(o)):1},t)},stringify:t=>{const{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${Cn.lang.round(e)}, ${Cn.lang.round(r)}%, ${Cn.lang.round(n)}%, ${i})`:`hsl(${Cn.lang.round(e)}, ${Cn.lang.round(r)}%, ${Cn.lang.round(n)}%)`}},a7={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=a7.colors[t];if(e)return J5.parse(e)},stringify:t=>{const e=J5.stringify(t);for(const r in a7.colors)if(a7.colors[r]===e)return r}},o7={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(o7.re);if(!r)return;const[,n,i,a,o,s,l,u,h]=r;return xj.set({r:Cn.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:Cn.channel.clamp.g(o?parseFloat(a)*2.55:parseFloat(a)),b:Cn.channel.clamp.b(l?parseFloat(s)*2.55:parseFloat(s)),a:u?Cn.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(${Cn.lang.round(e)}, ${Cn.lang.round(r)}, ${Cn.lang.round(n)}, ${Cn.lang.round(i)})`:`rgb(${Cn.lang.round(e)}, ${Cn.lang.round(r)}, ${Cn.lang.round(n)})`}},wg={format:{keyword:a7,hex:J5,rgb:o7,rgba:o7,hsl:_T,hsla:_T},parse:t=>{if(typeof t!="string")return t;const e=J5.parse(t)||o7.parse(t)||_T.parse(t)||a7.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(Zc.HSL)||t.data.r===void 0?_T.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?o7.stringify(t):J5.stringify(t)},Kxt=(t,e)=>{const r=wg.parse(t);for(const n in e)r[n]=Cn.channel.clamp[n](e[n]);return wg.stringify(r)},Ag=(t,e,r=0,n=1)=>{if(typeof t!="number")return Kxt(t,{a:e});const i=xj.set({r:Cn.channel.clamp.r(t),g:Cn.channel.clamp.g(e),b:Cn.channel.clamp.b(r),a:Cn.channel.clamp.a(n)});return wg.stringify(i)},x1e=(t,e)=>Cn.lang.round(wg.parse(t)[e]),Gtn=t=>{const{r:e,g:r,b:n}=wg.parse(t),i=.2126*Cn.channel.toLinear(e)+.7152*Cn.channel.toLinear(r)+.0722*Cn.channel.toLinear(n);return Cn.lang.round(i)},Htn=t=>Gtn(t)>=.5,Fu=t=>!Htn(t),w1e=(t,e,r)=>{const n=wg.parse(t),i=n[e],a=Cn.channel.clamp[e](i+r);return i!==a&&(n[e]=a),wg.stringify(n)},ht=(t,e)=>w1e(t,"l",e),dt=(t,e)=>w1e(t,"l",-e),Zxt=(t,e)=>w1e(t,"a",-e),Ae=(t,e)=>{const r=wg.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return Kxt(t,n)},Wtn=(t,e,r=50)=>{const{r:n,g:i,b:a,a:o}=wg.parse(t),{r:s,g:l,b:u,a:h}=wg.parse(e),d=r/100,f=d*2-1,p=o-h,m=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,v=1-m,y=n*m+s*v,b=i*m+l*v,x=a*m+u*v,w=o*d+h*(1-d);return Ag(y,b,x,w)},it=(t,e=100)=>{const r=wg.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,Wtn(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 Jxt(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:Bs(BigInt.prototype.toString),s2t=typeof Symbol>"u"?null:Bs(Symbol.prototype.toString),Qh=Bs(Object.prototype.hasOwnProperty),u7=Bs(Object.prototype.toString),Jc=Bs(RegExp.prototype.test),DT=orn(TypeError);function Bs(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]:l7;if(t2t&&t2t(t,null),!tR(e))return t;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=r(i);a!==i&&(Ztn(e)||(e[n]=a),i=a)}t[i]=!0}return t}function srn(t){for(let e=0;e/g),prn=Nl(/\${[\w\W]*/g),grn=Nl(/^data-[\-\w.\u00B7-\uFFFF]+$/),mrn=Nl(/^aria-[\-\w]+$/),d2t=Nl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vrn=Nl(/^(?:\w+script|data):/i),yrn=Nl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),brn=Nl(/^html$/i),xrn=Nl(/^[a-z][.\w]*(-[.\w]+)+$/i),f2t=Nl(/<[/\w!]/g),p2t=Nl(/<[/\w]/g),wrn=Nl(/<\/no(script|embed|frames)/i),Arn=Nl(/\/>/i),qd={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},g2t=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Srn=sl(Pi({},g2t)),Trn=function(){const t={};return RT(g2t,e=>{t[e]=Nl(new RegExp("])","i"))}),sl(t)}(),Crn=function(){return typeof window>"u"?null:window},Orn=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(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},m2t=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},p2=function(e,r,n,i){return Qh(e,r)&&tR(e[r])?Pi(i.base?Yd(i.base):{},e[r],i.transform):n},_1e=function(e,r,n){const i=Qh(e,r)?e[r]:void 0;return i&&typeof i=="object"?Yd(i):n()};function v2t(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Crn();const e=Ht=>v2t(Ht);if(e.version="3.4.14",e.removed=[],!t||!t.document||t.document.nodeType!==qd.document||!t.Element)return e.isSupported=!1,e;let r=t.document;const n=r,i=n.currentScript;t.DocumentFragment;const a=t.HTMLTemplateElement,o=t.Node,s=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=s.prototype,p=Sg(f,"cloneNode"),g=Sg(f,"remove"),m=Sg(f,"nextSibling"),v=Sg(f,"childNodes"),y=Sg(f,"parentNode"),b=Sg(f,"shadowRoot"),x=Sg(f,"attributes"),w=o&&o.prototype?Sg(o.prototype,"nodeType"):null,A=o&&o.prototype?Sg(o.prototype,"nodeName"):null,S=o&&o.prototype?Sg(o.prototype,"ownerDocument"):null,T=function(Ve){return w?w(Ve):Ve.nodeType},C=function(Ve){return A?A(Ve):Ve.nodeName};if(typeof a=="function"){const Ht=r.createElement("template");Ht.content&&Ht.content.ownerDocument&&(r=Ht.content.ownerDocument)}let k,E="",_,P=!1,L=0;const R=function(){if(L>0)throw DT('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(Ve){R(),L++;try{return k.createHTML(Ve)}finally{L--}},M=function(Ve){R(),L++;try{return k.createScriptURL(Ve)}finally{L--}},I=function(){return P||(_=Orn(d,i),P=!0),_},N=r,F=N.implementation,B=N.createNodeIterator,V=N.createDocumentFragment,z=N.getElementsByTagName,U=n.importNode;let Q=m2t();e.isSupported=typeof e2t=="function"&&typeof y=="function"&&F&&F.createHTMLDocument!==void 0;const G=drn,q=frn,Y=prn,ne=grn,X=mrn,J=vrn,ee=yrn,te=xrn;let pe=d2t,ie=null;const Ce=Pi({},[...l2t,...C1e,...O1e,...k1e,...c2t]);let ke=null;const Ee=Pi({},[...u2t,...E1e,...h2t,...wj]);let ue=Object.seal(eR(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}})),de=null,xe=null;const ge=Object.seal(eR(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ze=!0,we=!0,Oe=!1,Be=!0,Z=!1,le=!0,be=!1,ae=!1,K=null,se=null,me=!1,oe=!1,ve=!1,ce=!1,De=!0,Le=!1;const We="user-content-";let Ne=!0,je=!1,$e={},Ze=null;const He=Pi({},["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 et=null;const Pe=Pi({},["audio","video","img","source","image","track"]);let yt=null;const Ie=Pi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),St="http://www.w3.org/1998/Math/MathML",kt="http://www.w3.org/2000/svg",ut="http://www.w3.org/1999/xhtml";let Gt=ut,It=!1,gt=null;const Te=Pi({},[St,kt,ut],T1e),Bt=sl(["mi","mo","mn","ms","mtext"]);let Et=Pi({},Bt);const At=sl(["annotation-xml"]);let Mt=Pi({},At);const qr=Pi({},["title","style","font","a","script"]);let Me=null;const at=["application/xhtml+xml","text/html"],wt="text/html";let Tt=null,dr=null;const jr=r.createElement("form"),Ir=function(Ve){return Ve instanceof RegExp||Ve instanceof Function},Zr=function(){let Ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(dr&&dr===Ve)return;(!Ve||typeof Ve!="object")&&(Ve={}),Ve=Yd(Ve),Me=at.indexOf(Ve.PARSER_MEDIA_TYPE)===-1?wt:Ve.PARSER_MEDIA_TYPE,Tt=Me==="application/xhtml+xml"?T1e:l7,ie=p2(Ve,"ALLOWED_TAGS",Ce,{transform:Tt}),ke=p2(Ve,"ALLOWED_ATTR",Ee,{transform:Tt}),gt=p2(Ve,"ALLOWED_NAMESPACES",Te,{transform:T1e}),yt=p2(Ve,"ADD_URI_SAFE_ATTR",Ie,{transform:Tt,base:Ie}),et=p2(Ve,"ADD_DATA_URI_TAGS",Pe,{transform:Tt,base:Pe}),Ze=p2(Ve,"FORBID_CONTENTS",He,{transform:Tt}),de=p2(Ve,"FORBID_TAGS",Yd({}),{transform:Tt}),xe=p2(Ve,"FORBID_ATTR",Yd({}),{transform:Tt}),$e=Qh(Ve,"USE_PROFILES")?Ve.USE_PROFILES&&typeof Ve.USE_PROFILES=="object"?Yd(Ve.USE_PROFILES):Ve.USE_PROFILES:!1,ze=Ve.ALLOW_ARIA_ATTR!==!1,we=Ve.ALLOW_DATA_ATTR!==!1,Oe=Ve.ALLOW_UNKNOWN_PROTOCOLS||!1,Be=Ve.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Z=Ve.SAFE_FOR_TEMPLATES||!1,le=Ve.SAFE_FOR_XML!==!1,be=Ve.WHOLE_DOCUMENT||!1,oe=Ve.RETURN_DOM||!1,ve=Ve.RETURN_DOM_FRAGMENT||!1,ce=Ve.RETURN_TRUSTED_TYPE||!1,me=Ve.FORCE_BODY||!1,De=Ve.SANITIZE_DOM!==!1,Le=Ve.SANITIZE_NAMED_PROPS||!1,Ne=Ve.KEEP_CONTENT!==!1,je=Ve.IN_PLACE||!1,pe=crn(Ve.ALLOWED_URI_REGEXP)?Ve.ALLOWED_URI_REGEXP:d2t,Gt=typeof Ve.NAMESPACE=="string"?Ve.NAMESPACE:ut,Et=_1e(Ve,"MATHML_TEXT_INTEGRATION_POINTS",()=>Pi({},Bt)),Mt=_1e(Ve,"HTML_INTEGRATION_POINTS",()=>Pi({},At));const ot=_1e(Ve,"CUSTOM_ELEMENT_HANDLING",()=>eR(null));if(ue=eR(null),Qh(ot,"tagNameCheck")&&Ir(ot.tagNameCheck)&&(ue.tagNameCheck=ot.tagNameCheck),Qh(ot,"attributeNameCheck")&&Ir(ot.attributeNameCheck)&&(ue.attributeNameCheck=ot.attributeNameCheck),Qh(ot,"allowCustomizedBuiltInElements")&&typeof ot.allowCustomizedBuiltInElements=="boolean"&&(ue.allowCustomizedBuiltInElements=ot.allowCustomizedBuiltInElements),Nl(ue),Z&&(we=!1),ve&&(oe=!0),$e&&(ie=Pi({},c2t),ke=eR(null),$e.html===!0&&(Pi(ie,l2t),Pi(ke,u2t)),$e.svg===!0&&(Pi(ie,C1e),Pi(ke,E1e),Pi(ke,wj)),$e.svgFilters===!0&&(Pi(ie,O1e),Pi(ke,E1e),Pi(ke,wj)),$e.mathMl===!0&&(Pi(ie,k1e),Pi(ke,h2t),Pi(ke,wj))),ge.tagCheck=null,ge.attributeCheck=null,Qh(Ve,"ADD_TAGS")&&(typeof Ve.ADD_TAGS=="function"?ge.tagCheck=Ve.ADD_TAGS:tR(Ve.ADD_TAGS)&&(ie===Ce&&(ie=Yd(ie)),Pi(ie,Ve.ADD_TAGS,Tt))),Qh(Ve,"ADD_ATTR")&&(typeof Ve.ADD_ATTR=="function"?ge.attributeCheck=Ve.ADD_ATTR:tR(Ve.ADD_ATTR)&&(ke===Ee&&(ke=Yd(ke)),Pi(ke,Ve.ADD_ATTR,Tt))),Qh(Ve,"ADD_FORBID_CONTENTS")&&tR(Ve.ADD_FORBID_CONTENTS)&&(Ze===He&&(Ze=Yd(Ze)),Pi(Ze,Ve.ADD_FORBID_CONTENTS,Tt)),Ne&&(ie["#text"]=!0),be&&Pi(ie,["html","head","body"]),ie.table&&(Pi(ie,["tbody"]),delete de.tbody),Ve.TRUSTED_TYPES_POLICY){if(typeof Ve.TRUSTED_TYPES_POLICY.createHTML!="function")throw DT('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ve.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw DT('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Nt=k;k=Ve.TRUSTED_TYPES_POLICY;try{E=D("")}catch(ar){throw k=Nt,ar}}else Ve.TRUSTED_TYPES_POLICY===null?(k=void 0,E=""):(k===void 0&&(k=I()),k&&typeof E=="string"&&(E=D("")));sl&&sl(Ve),dr=Ve},Ur=Pi({},[...C1e,...O1e,...urn]),kn=Pi({},[...k1e,...hrn]),$r=function(Ve,ot,Nt){return ot.namespaceURI===ut?Ve==="svg":ot.namespaceURI===St?Ve==="svg"&&(Nt==="annotation-xml"||Et[Nt]):!!Ur[Ve]},dn=function(Ve,ot,Nt){return ot.namespaceURI===ut?Ve==="math":ot.namespaceURI===kt?Ve==="math"&&Mt[Nt]:!!kn[Ve]},ii=function(Ve,ot,Nt){return ot.namespaceURI===kt&&!Mt[Nt]||ot.namespaceURI===St&&!Et[Nt]?!1:!kn[Ve]&&(qr[Ve]||!Ur[Ve])},pt=function(Ve){let ot=y(Ve);(!ot||!ot.tagName)&&(ot={namespaceURI:Gt,tagName:"template"});const Nt=l7(Ve.tagName),ar=l7(ot.tagName);return gt[Ve.namespaceURI]?Ve.namespaceURI===kt?$r(Nt,ot,ar):Ve.namespaceURI===St?dn(Nt,ot,ar):Ve.namespaceURI===ut?ii(Nt,ot,ar):!!(Me==="application/xhtml+xml"&>[Ve.namespaceURI]):!1},Ct=function(Ve){s7(e.removed,{element:Ve});try{y(Ve).removeChild(Ve)}catch{if(g(Ve),!y(Ve))throw DT("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},or=function(Ve,ot,Nt){try{Ve.removeAttributeNode(ot)}catch{try{Ve.removeAttribute(Nt)}catch{}}},Jr=function(Ve){Ot(Ve);const ot=v(Ve);if(ot){const ar=[];RT(ot,Vr=>{s7(ar,Vr)}),RT(ar,Vr=>{try{g(Vr)}catch{}})}const Nt=x(Ve);if(Nt)for(let ar=Nt.length-1;ar>=0;--ar){const Vr=Nt[ar],Rn=Vr&&Vr.name;typeof Rn=="string"&&or(Ve,Vr,Rn)}},Mn=function(Ve,ot,Nt){if(!Nt)try{Nt=ot.getAttributeNode(Ve)}catch{Nt=null}s7(e.removed,{attribute:Nt||null,from:ot});try{Nt?ot.removeAttributeNode(Nt):ot.removeAttribute(Ve)}catch{try{ot.removeAttribute(Ve)}catch{}}if(Ve==="is")if(oe||ve)try{Ct(ot)}catch{}else try{ot.setAttribute(Ve,"")}catch{}},Rt=function(Ve){const ot=x(Ve);if(ot)for(let Nt=ot.length-1;Nt>=0;--Nt){const ar=ot[Nt],Vr=ar&&ar.name;typeof Vr!="string"||ke[Tt(Vr)]||or(Ve,ar,Vr)}},Ot=function(Ve){const ot=[Ve];for(;ot.length>0;){const Nt=ot.pop();T(Nt)===qd.element&&Rt(Nt);const Vr=v(Nt);if(Vr)for(let Rn=Vr.length-1;Rn>=0;--Rn)ot.push(Vr[Rn])}},Vt=function(Ve,ot){return le?Ve==="patchsrc"?!0:Ve==="for"&&ot!=="label"&&ot!=="output":!1},mt=function(Ve){if(!le)return;const ot=[Ve];for(;ot.length>0;){const Nt=ot.pop(),ar=T(Nt);if(ar===qd.processingInstruction||ar===qd.comment&&Jc(p2t,Nt.data)){try{g(Nt)}catch{}continue}if(ar===qd.element){const Rn=Nt,Ya=Tt(C(Nt));try{Rn.hasAttribute&&Rn.hasAttribute("patchsrc")&&Rn.removeAttribute("patchsrc"),Rn.hasAttribute&&Rn.hasAttribute("for")&&Vt("for",Ya)&&Rn.removeAttribute("for")}catch{}}const Vr=v(Nt);if(Vr)for(let Rn=Vr.length-1;Rn>=0;--Rn)ot.push(Vr[Rn])}},Tr=function(Ve){let ot=null,Nt=null;if(me)Ve=""+Ve;else{const Rn=i2t(Ve,/^[\r\n\t ]+/);Nt=Rn&&Rn[0]}Me==="application/xhtml+xml"&&Gt===ut&&(Ve=''+Ve+"");const ar=k?D(Ve):Ve;if(Gt===ut)try{ot=new h().parseFromString(ar,Me)}catch{}if(!ot||!ot.documentElement){ot=F.createDocument(Gt,"template",null);try{ot.documentElement.innerHTML=It?E:ar}catch{}}const Vr=ot.body||ot.documentElement;return Ve&&Nt&&Vr.insertBefore(r.createTextNode(Nt),Vr.childNodes[0]||null),Gt===ut?z.call(ot,be?"html":"body")[0]:be?ot.documentElement:Vr},Fe=function(Ve){const ot=S?S(Ve):Ve.ownerDocument;return B.call(ot||Ve,Ve,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},ta=function(Ve){return Ve=c7(Ve,G," "),Ve=c7(Ve,q," "),Ve=c7(Ve,Y," "),Ve},Qe=function(Ve){var ot;Ve.normalize();const Nt=S?S(Ve):Ve.ownerDocument,ar=B.call(Nt||Ve,Ve,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let Vr=ar.nextNode();for(;Vr;)Vr.data=ta(Vr.data),Vr=ar.nextNode();const Rn=(ot=Ve.querySelectorAll)===null||ot===void 0?void 0:ot.call(Ve,"template");Rn&&RT(Rn,Ya=>{hi(Ya.content)&&Qe(Ya.content)})},In=function(Ve){const ot=A?A(Ve):null;return typeof ot!="string"||Tt(ot)!=="form"?!1:typeof Ve.nodeName!="string"||typeof Ve.textContent!="string"||typeof Ve.removeChild!="function"||Ve.attributes!==x(Ve)||typeof Ve.removeAttribute!="function"||typeof Ve.setAttribute!="function"||typeof Ve.namespaceURI!="string"||typeof Ve.insertBefore!="function"||typeof Ve.hasChildNodes!="function"||Ve.nodeType!==w(Ve)||Ve.childNodes!==v(Ve)},hi=function(Ve){if(!w||typeof Ve!="object"||Ve===null)return!1;try{return w(Ve)===qd.documentFragment}catch{return!1}},Bo=function(Ve){if(!w||typeof Ve!="object"||Ve===null)return!1;try{return typeof w(Ve)=="number"}catch{return!1}};function Gn(Ht,Ve,ot){Ht.length!==0&&RT(Ht,Nt=>{Nt.call(e,Ve,ot,dr)})}const fa=function(Ve,ot){return!!(le&&Ve.hasChildNodes()&&!Bo(Ve.firstElementChild)&&Jc(f2t,Ve.textContent)&&Jc(f2t,Ve.innerHTML)||le&&Ve.namespaceURI===ut&&Srn[ot]&&(Bo(Ve.firstElementChild)||typeof Ve.textContent=="string"&&Jc(Trn[ot],Ve.textContent))||Ve.nodeType===qd.processingInstruction||le&&Ve.nodeType===qd.comment&&Jc(p2t,Ve.data))},di=function(Ve,ot){if(Ve instanceof RegExp)return Jc(Ve,ot);if(Ve instanceof Function){for(var Nt=arguments.length,ar=new Array(Nt>2?Nt-2:0),Vr=2;Vr=0;--Ya){const $o=Ve===Nt?p(Vr[Ya],!0):Vr[Ya];ar.insertBefore($o,m(Ve))}}}return Ct(Ve),!0},sm=function(Ve,ot,Nt,ar){return Ve.length===0?ot:ot===Nt||ot===ar?Yd(ot):ot},Ov=function(Ve,ot){return Ve===ot||y(Ve)!==null?!1:(je&&Ot(Ve),!0)},Sk=function(Ve,ot){if(Gn(Q.beforeSanitizeElements,Ve,null),Ov(Ve,ot))return!0;if(In(Ve))return Ct(Ve),!0;const Nt=Tt(C(Ve));if(ie=sm(Q.uponSanitizeElement,ie,Ce,K),Gn(Q.uponSanitizeElement,Ve,{tagName:Nt,allowedTags:ie}),Ov(Ve,ot))return!0;if(fa(Ve,Nt))return Ct(Ve),!0;if(de[Nt]||!(ge.tagCheck instanceof Function&&ge.tagCheck(Nt))&&!ie[Nt]){const Vr=vu(Ve,Nt,ot);return Vr===!1&&Gn(Q.afterSanitizeElements,Ve,null),Vr}if(T(Ve)===qd.element&&!pt(Ve)||(Nt==="noscript"||Nt==="noembed"||Nt==="noframes")&&Jc(wrn,Ve.innerHTML))return Ct(Ve),!0;if(Z&&Ve.nodeType===qd.text){const Vr=ta(Ve.textContent);Ve.textContent!==Vr&&(s7(e.removed,{element:Ve.cloneNode()}),Ve.textContent=Vr)}return Gn(Q.afterSanitizeElements,Ve,null),!1},Tk=function(Ve,ot,Nt){if(xe[ot]||Vt(ot,Ve)||De&&(ot==="id"||ot==="name")&&(Nt in r||Nt in jr))return!1;const ar=ke[ot]||ge.attributeCheck instanceof Function&&ge.attributeCheck(ot,Ve);return we&&Jc(ne,ot)||ze&&Jc(X,ot)?!0:ar?yt[ot]||Jc(pe,c7(Nt,ee,""))||(ot==="src"||ot==="xlink:href"||ot==="href")&&Ve!=="script"&&a2t(Nt,"data:")===0&&et[Ve]||Oe&&!Jc(J,c7(Nt,ee,""))?!0:!Nt:xl(Ve)&&di(ue.tagNameCheck,Ve)&&di(ue.attributeNameCheck,ot,Ve)||ot==="is"&&ue.allowCustomizedBuiltInElements&&di(ue.tagNameCheck,Nt)},Ck=Pi({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),xl=function(Ve){return!Ck[l7(Ve)]&&Jc(te,Ve)},gd=function(Ve,ot,Nt,ar){if(k&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!Nt)switch(d.getAttributeType(Ve,ot)){case"TrustedHTML":return D(ar);case"TrustedScriptURL":return M(ar)}return ar},$c=function(Ve,ot,Nt,ar){try{Nt?Ve.setAttributeNS(Nt,ot,ar):Ve.setAttribute(ot,ar),In(Ve)?Ct(Ve):n2t(e.removed)}catch{Mn(ot,Ve)}},Zs=function(Ve){Gn(Q.beforeSanitizeAttributes,Ve,null);const ot=Ve.attributes;if(!ot||In(Ve))return;ke=sm(Q.uponSanitizeAttribute,ke,Ee,se);const Nt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ke,forceKeepAttr:void 0};let ar=ot.length;const Vr=Tt(Ve.nodeName);for(;ar--;){const Rn=ot[ar],Ya=Rn.name,$o=Rn.namespaceURI,md=Rn.value,vd=Tt(Ya),HMe=md;let xh=Ya==="value"?HMe:nrn(HMe);if(Nt.attrName=vd,Nt.attrValue=xh,Nt.keepAttr=!0,Nt.forceKeepAttr=void 0,Gn(Q.uponSanitizeAttribute,Ve,Nt),xh=Nt.attrValue,Le&&(vd==="id"||vd==="name")&&a2t(xh,We)!==0&&(Mn(Ya,Ve,Rn),xh=We+xh),le&&Jc(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,xh)){Mn(Ya,Ve,Rn);continue}if(vd==="attributename"&&i2t(xh,"href")){Mn(Ya,Ve,Rn);continue}if(!Nt.forceKeepAttr){if(!Nt.keepAttr){Mn(Ya,Ve,Rn);continue}if(!Be&&Jc(Arn,xh)){Mn(Ya,Ve,Rn);continue}if(Z&&(xh=ta(xh)),!Tk(Vr,vd,xh)){Mn(Ya,Ve,Rn);continue}xh=gd(Vr,vd,$o,xh),xh!==HMe&&$c(Ve,Ya,$o,xh)}}Gn(Q.afterSanitizeAttributes,Ve,null)},Of=function(Ve){let ot=null;const Nt=Fe(Ve);for(Gn(Q.beforeSanitizeShadowDOM,Ve,null);ot=Nt.nextNode();)if(Gn(Q.uponSanitizeShadowNode,ot,null),Sk(ot,Ve),Zs(ot),hi(ot.content)&&Of(ot.content),T(ot)===qd.element){const ar=b(ot);hi(ar)&&(Yw(ar),Of(ar))}Gn(Q.afterSanitizeShadowDOM,Ve,null)},Yw=function(Ve){const ot=[{node:Ve,shadow:null}];for(;ot.length>0;){const Nt=ot.pop();if(Nt.shadow){Of(Nt.shadow);continue}const ar=Nt.node,Rn=T(ar)===qd.element,Ya=v(ar);if(Ya)for(let $o=Ya.length-1;$o>=0;--$o)ot.push({node:Ya[$o],shadow:null});if(Rn){const $o=A?A(ar):null;if(typeof $o=="string"&&Tt($o)==="template"){const md=ar.content;hi(md)&&ot.push({node:md,shadow:null})}}if(Rn){const $o=b(ar);hi($o)&&ot.push({node:null,shadow:$o},{node:$o,shadow:null})}}};return e.sanitize=function(Ht){let Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ot=null,Nt=null,ar=null,Vr=null;if(It=!Ht,It&&(Ht=""),typeof Ht!="string"&&!Bo(Ht)&&(Ht=lrn(Ht),typeof Ht!="string"))throw DT("dirty is not a string, aborting");if(!e.isSupported)return Ht;ae?(ie=K,ke=se):Zr(Ve),(Q.uponSanitizeElement.length>0||Q.uponSanitizeAttribute.length>0)&&(ie=Yd(ie)),Q.uponSanitizeAttribute.length>0&&(ke=Yd(ke)),e.removed=[];const Rn=je&&typeof Ht!="string"&&Bo(Ht);if(Rn){mt(Ht);const md=C(Ht);if(typeof md=="string"){const vd=Tt(md);if(!ie[vd]||de[vd])throw Jr(Ht),DT("root node is forbidden and cannot be sanitized in-place")}if(In(Ht))throw Jr(Ht),DT("root node is clobbered and cannot be sanitized in-place");try{Yw(Ht)}catch(vd){throw Jr(Ht),vd}}else if(Bo(Ht))ot=Tr(""),Nt=ot.ownerDocument.importNode(Ht,!0),Nt.nodeType===qd.element&&Nt.nodeName==="BODY"||Nt.nodeName==="HTML"?ot=Nt:ot.appendChild(Nt),Yw(Nt);else{if(!oe&&!Z&&!be&&Ht.indexOf("<")===-1)return k&&ce?D(Ht):Ht;if(ot=Tr(Ht),!ot)return oe?null:ce?E:""}ot&&me&&Ct(ot.firstChild);const Ya=Rn?Ht:ot;try{const md=Fe(Ya);for(;ar=md.nextNode();)Sk(ar,Ya),Zs(ar),hi(ar.content)&&Of(ar.content)}catch(md){throw Rn&&(Jr(Ht),RT(e.removed,vd=>{vd.element&&Ot(vd.element)})),md}if(Rn)return RT(e.removed,md=>{md.element&&Ot(md.element)}),Z&&Qe(Ht),Ht;if(oe){if(Z&&Qe(ot),ve)for(Vr=V.call(ot.ownerDocument);ot.firstChild;)Vr.appendChild(ot.firstChild);else Vr=ot;return(ke.shadowroot||ke.shadowrootmode)&&(Vr=U.call(n,Vr,!0)),Vr}let $o=be?ot.outerHTML:ot.innerHTML;return be&&ie["!doctype"]&&ot.ownerDocument&&ot.ownerDocument.doctype&&ot.ownerDocument.doctype.name&&Jc(brn,ot.ownerDocument.doctype.name)&&($o=" -`+$o),Z&&($o=ta($o)),k&&ce?D($o):$o},e.setConfig=function(){let Ht=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zr(Ht),ae=!0,K=ie,se=ke},e.clearConfig=function(){dr=null,ae=!1,K=null,se=null,k=_,E=""},e.isValidAttribute=function(Ht,Ve,ot){dr||Zr({});const Nt=Tt(Ht),ar=Tt(Ve);return Tk(Nt,ar,ot)},e.addHook=function(Ht,Ve){typeof Ve=="function"&&Qh(Q,Ht)&&s7(Q[Ht],Ve)},e.removeHook=function(Ht,Ve){if(Qh(Q,Ht)){if(Ve!==void 0){const ot=trn(Q[Ht],Ve);return ot===-1?void 0:rrn(Q[Ht],ot,1)[0]}return n2t(Q[Ht])}},e.removeHooks=function(Ht){Qh(Q,Ht)&&(Q[Ht]=[])},e.removeAllHooks=function(){Q=m2t()},e}var qy=v2t(),R1e=O((t,e,{depth:r=2}={})=>{const n={depth:r};if(Array.isArray(e)&&!Array.isArray(t))return e.forEach(i=>R1e(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,o])=>{if(typeof o=="object"){if(o===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(o)?[]:{}),typeof i[a]=="object"&&(i[a]=R1e(i[a],o,{depth:r-1}))}else typeof i[a]!="object"&&(Object.hasOwn(t,a)?i[a]=o:Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}))})}return t},"assignWithDepth"),$s=R1e,d0="#ffffff",f0="#f2f2f2",xn=O((t,e)=>e?Ae(t,{s:-40,l:10}):Ae(t,{s:-40,l:-10}),"mkBorder"),krn=(UD=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,o,s,l,u,h,d,f,p,g,m,v,y,b,x,w,A,S,T,C,k,E,_,P,L,R,D,M,I,N,F,B,V,z,U,Q,G,q,Y,ne,X,J,ee,te,pe,ie;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||Ae(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Ae(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||xn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||xn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||xn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||it(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||it(this.tertiaryColor),this.lineColor=this.lineColor||it(this.background),this.arrowheadColor=this.arrowheadColor||it(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||it(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||Ae(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Ae(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Ae(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Ae(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Ae(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Ae(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||Ae(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Ae(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Ae(this.primaryColor,{h:330}),this.darkMode)for(let Ce=0;Ce{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},O(UD,"Theme"),UD),Ern=O(t=>{const e=new krn;return e.calculate(t),e},"getThemeVariables"),_rn=(VD=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ht(this.primaryColor,16),this.tertiaryColor=Ae(this.primaryColor,{h:-160}),this.primaryBorderColor=it(this.background),this.secondaryBorderColor=xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=xn(this.tertiaryColor,this.darkMode),this.primaryTextColor=it(this.primaryColor),this.secondaryTextColor=it(this.secondaryColor),this.tertiaryTextColor=it(this.tertiaryColor),this.lineColor=it(this.background),this.textColor=it(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ht(it("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Ag(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=Ag(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Ag(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,o,s,l,u,h,d,f,p,g,m,v,y,b,x,w,A,S,T,C,k,E,_,P,L,R,D,M,I,N,F,B,V,z,U,Q,G,q,Y,ne,X,J,ee,te,pe;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=it(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=Ae(this.primaryColor,{h:64}),this.fillType3=Ae(this.secondaryColor,{h:64}),this.fillType4=Ae(this.primaryColor,{h:-64}),this.fillType5=Ae(this.secondaryColor,{h:-64}),this.fillType6=Ae(this.primaryColor,{h:128}),this.fillType7=Ae(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||Ae(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Ae(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Ae(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Ae(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Ae(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Ae(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Ae(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Ae(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Ae(this.primaryColor,{h:330});for(let ie=0;ie{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},O(VD,"Theme"),VD),Rrn=O(t=>{const e=new _rn;return e.calculate(t),e},"getThemeVariables"),Drn=(QD=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=Ae(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=Ae(this.primaryColor,{h:-160}),this.primaryBorderColor=xn(this.primaryColor,this.darkMode),this.secondaryBorderColor=xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=xn(this.tertiaryColor,this.darkMode),this.primaryTextColor=it(this.primaryColor),this.secondaryTextColor=it(this.secondaryColor),this.tertiaryTextColor=it(this.tertiaryColor),this.lineColor=it(this.background),this.textColor=it(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=xn(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=Ag(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,o,s,l,u,h,d,f,p,g,m,v,y,b,x,w,A,S,T,C,k,E,_,P,L,R,D,M,I,N,F,B,V,z,U,Q,G,q,Y,ne,X,J,ee,te,pe;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Ae(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Ae(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Ae(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Ae(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Ae(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Ae(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Ae(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Ae(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Ae(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||dt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||dt(this.tertiaryColor,40);for(let ie=0;ie{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]})}},O(QD,"Theme"),QD),jy=O(t=>{const e=new Drn;return e.calculate(t),e},"getThemeVariables"),Lrn=(GD=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=xn(this.primaryColor,this.darkMode),this.secondaryBorderColor=xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=xn(this.tertiaryColor,this.darkMode),this.primaryTextColor=it(this.primaryColor),this.secondaryTextColor=it(this.secondaryColor),this.tertiaryTextColor=it(this.primaryColor),this.lineColor=it(this.background),this.textColor=it(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,o,s,l,u,h,d,f,p,g,m,v,y,b,x,w,A,S,T,C,k,E,_,P,L,R,D,M,I,N,F,B,V,z,U,Q,G,q,Y,ne,X,J,ee,te,pe;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||Ae(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Ae(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Ae(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Ae(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Ae(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Ae(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Ae(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Ae(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Ae(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||dt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||dt(this.tertiaryColor,40);for(let ie=0;ie{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},O(GD,"Theme"),GD),Mrn=O(t=>{const e=new Lrn;return e.calculate(t),e},"getThemeVariables"),Irn=(HD=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=ht(this.contrast,55),this.background="#ffffff",this.tertiaryColor=Ae(this.primaryColor,{h:-160}),this.primaryBorderColor=xn(this.primaryColor,this.darkMode),this.secondaryBorderColor=xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=xn(this.tertiaryColor,this.darkMode),this.primaryTextColor=it(this.primaryColor),this.secondaryTextColor=it(this.secondaryColor),this.tertiaryTextColor=it(this.tertiaryColor),this.lineColor=it(this.background),this.textColor=it(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,o,s,l,u,h,d,f,p,g,m,v,y,b,x,w,A,S,T,C,k,E,_,P,L,R,D,M,I,N,F,B,V,z,U,Q,G,q,Y,ne,X,J,ee,te,pe;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 ie=0;ie{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},O(HD,"Theme"),HD),Prn=O(t=>{const e=new Irn;return e.calculate(t),e},"getThemeVariables"),Nrn=(WD=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=xn(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,o,s,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||Ae(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Ae(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||xn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||xn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||xn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||it(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||it(this.tertiaryColor),this.lineColor=this.lineColor||it(this.background),this.arrowheadColor=this.arrowheadColor||it(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||it(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=Ae(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||Ae(e,{h:30}),this.cScale4=this.cScale4||Ae(e,{h:60}),this.cScale5=this.cScale5||Ae(e,{h:90}),this.cScale6=this.cScale6||Ae(e,{h:120}),this.cScale7=this.cScale7||Ae(e,{h:150}),this.cScale8=this.cScale8||Ae(e,{h:210,l:150}),this.cScale9=this.cScale9||Ae(e,{h:270}),this.cScale10=this.cScale10||Ae(e,{h:300}),this.cScale11=this.cScale11||Ae(e,{h:330}),this.darkMode)for(let v=0;v{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},O(WD,"Theme"),WD),Brn=O(t=>{const e=new Nrn;return e.calculate(t),e},"getThemeVariables"),$rn=(YD=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ht(this.primaryColor,16),this.tertiaryColor=Ae(this.primaryColor,{h:-160}),this.primaryBorderColor=it(this.background),this.secondaryBorderColor=xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=xn(this.tertiaryColor,this.darkMode),this.primaryTextColor=it(this.primaryColor),this.secondaryTextColor=it(this.secondaryColor),this.tertiaryTextColor=it(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ht(it("#323D47"),10),this.border1="#ccc",this.border2=Ag(255,255,255,.25),this.arrowheadColor=it(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,o,s,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||Ae(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Ae(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||xn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||xn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||xn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||it(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||it(this.tertiaryColor),this.lineColor=this.lineColor||it(this.background),this.arrowheadColor=this.arrowheadColor||it(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||it(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||Ae(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Ae(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Ae(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Ae(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Ae(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Ae(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||Ae(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Ae(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Ae(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},O(YD,"Theme"),YD),Frn=O(t=>{const e=new $rn;return e.calculate(t),e},"getThemeVariables"),zrn=(qD=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=xn("#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,o,s,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||Ae(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Ae(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||xn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||xn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||xn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||it(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||it(this.tertiaryColor),this.lineColor=this.lineColor||it(this.background),this.arrowheadColor=this.arrowheadColor||it(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||it(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=Ae(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]})}},O(qD,"Theme"),qD),Urn=O(t=>{const e=new zrn;return e.calculate(t),e},"getThemeVariables"),Vrn=(jD=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ht(this.primaryColor,16),this.tertiaryColor=Ae(this.primaryColor,{h:-160}),this.primaryBorderColor=it(this.background),this.secondaryBorderColor=xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=xn(this.tertiaryColor,this.darkMode),this.primaryTextColor=it(this.primaryColor),this.secondaryTextColor=it(this.secondaryColor),this.tertiaryTextColor=it(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ht(it("#323D47"),10),this.border1="#ccc",this.border2=Ag(255,255,255,.25),this.arrowheadColor=it(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,o,s,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||Ae(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Ae(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||xn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||xn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||xn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||it(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||it(this.tertiaryColor),this.lineColor=this.lineColor||it(this.background),this.arrowheadColor=this.arrowheadColor||it(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||it(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||Ae(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Ae(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Ae(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Ae(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Ae(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Ae(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||Ae(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Ae(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Ae(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},O(jD,"Theme"),jD),Qrn=O(t=>{const e=new Vrn;return e.calculate(t),e},"getThemeVariables"),Grn=(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=xn(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,o,s,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||Ae(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Ae(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||xn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||xn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||xn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||it(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||it(this.tertiaryColor),this.lineColor=this.lineColor||it(this.background),this.arrowheadColor=this.arrowheadColor||it(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||it(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=Ae(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]})}},O(XD,"Theme"),XD),Hrn=O(t=>{const e=new Grn;return e.calculate(t),e},"getThemeVariables"),Wrn=(KD=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ht(this.primaryColor,16),this.tertiaryColor=Ae(this.primaryColor,{h:-160}),this.primaryBorderColor=it(this.background),this.secondaryBorderColor=xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=xn(this.tertiaryColor,this.darkMode),this.primaryTextColor=it(this.primaryColor),this.secondaryTextColor=it(this.secondaryColor),this.tertiaryTextColor=it(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ht(it("#323D47"),10),this.border1="#ccc",this.border2=Ag(255,255,255,.25),this.arrowheadColor=it(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,o,s,l,u,h,d,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||Ae(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Ae(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||xn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||xn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||xn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||it(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||it(this.tertiaryColor),this.lineColor=this.lineColor||it(this.background),this.arrowheadColor=this.arrowheadColor||it(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||it(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]})}},O(KD,"Theme"),KD),Yrn=O(t=>{const e=new Wrn;return e.calculate(t),e},"getThemeVariables"),Xy={base:{getThemeVariables:Ern},dark:{getThemeVariables:Rrn},default:{getThemeVariables:jy},forest:{getThemeVariables:Mrn},neutral:{getThemeVariables:Prn},neo:{getThemeVariables:Brn},"neo-dark":{getThemeVariables:Frn},redux:{getThemeVariables:Urn},"redux-dark":{getThemeVariables:Qrn},"redux-color":{getThemeVariables:Hrn},"redux-dark-color":{getThemeVariables:Yrn}},yc={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},y2t={...yc,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:Xy.default.getThemeVariables(),sequence:{...yc.sequence,messageFont:O(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:O(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:O(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...yc.gantt,tickInterval:void 0,useWidth:void 0},c4:{...yc.c4,useWidth:void 0,personFont:O(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...yc.flowchart,inheritDir:!1},external_personFont:O(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:O(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:O(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:O(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:O(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:O(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:O(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:O(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:O(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:O(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:O(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:O(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:O(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:O(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:O(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:O(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:O(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:O(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:O(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:O(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:O(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...yc.pie,useWidth:984},xyChart:{...yc.xyChart,useWidth:void 0},requirement:{...yc.requirement,useWidth:void 0},packet:{...yc.packet},eventmodeling:{...yc.eventmodeling},treeView:{...yc.treeView,useWidth:void 0},radar:{...yc.radar},railroad:{...yc.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:{...yc.ishikawa},sankey:{...yc.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:{...yc.venn},cynefin:{...yc.cynefin}},b2t=O((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...b2t(t[n],"")]:[...r,e+n],[]),"keyify"),qrn=new Set(b2t(y2t,"")),Jn=y2t,jrn={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},Xrn=O((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))&&(ye.debug("sanitize deleting dictionary entry:",r,n),delete t[r])}},"sanitizeDictionaryConfig"),Aj=O(t=>{if(ye.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>Aj(e));return}for(const e of Object.keys(t)){if(ye.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!qrn.has(e)||t[e]==null){ye.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){const n=jrn[e];n?Xrn(t[e],n):(ye.debug("sanitizing object",e),Aj(t[e]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(ye.debug("sanitizing css option",e),t[e]=x2t(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]="")}ye.debug("After sanitization",t)}},"sanitizeDirective"),x2t=O(t=>{let e=0,r=0;for(const n of t){if(e!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),Gh=$s({},rR),Sj,LT=[],h7=$s({},rR),d7=O((t,e)=>{let r=$s({},t),n={};for(const i of e)S2t(i),n=$s(n,i);if(r=$s(r,n),n.theme&&n.theme in Xy){const i=$s({},Sj),a=$s(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in Xy&&(r.themeVariables=Xy[r.theme].getThemeVariables(a))}return h7=r,rnn(h7),h7},"updateCurrentConfig"),Krn=O(t=>(Gh=$s({},rR),Gh=$s(Gh,t),t.theme&&Xy[t.theme]&&(Gh.themeVariables=Xy[t.theme].getThemeVariables(t.themeVariables)),d7(Gh,LT),Gh),"setSiteConfig"),Zrn=O(t=>{Sj=$s({},t)},"saveConfigFromInitialize"),Jrn=O(t=>(Gh=$s(Gh,t),d7(Gh,LT),Gh),"updateSiteConfig"),w2t=O(()=>$s({},Gh),"getSiteConfig"),A2t=O(t=>(d7(h7,[t]),Dr()),"setConfig"),Dr=O(()=>$s({},h7),"getConfig"),S2t=O(t=>{t&&(["secure",...Gh.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(ye.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"&&S2t(t[e])}))},"sanitize"),enn=O(t=>{var e;Aj(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),LT.push(t),d7(Gh,LT)},"addDirective"),Tj=O((t=Gh)=>{LT=[],d7(t,LT)},"reset"),tnn={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."},T2t={},C2t=O(t=>{T2t[t]||(ye.warn(tnn[t]),T2t[t]=!0)},"issueWarning"),rnn=O(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&C2t("LAZY_LOAD_DEPRECATED")},"checkConfig"),O2t=O(()=>{let t={};Sj&&(t=$s(t,Sj));for(const e of LT)t=$s(t,e);return t},"getUserDefinedConfig"),na=O(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&C2t("FLOWCHART_HTML_LABELS_DEPRECATED"),p0(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),k2t=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,f7=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,nnn=/\s*%%.*\n/gm,E2t=(ZD=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},O(ZD,"UnknownDiagramError"),ZD),MT={},D1e=O(function(t,e){t=t.replace(k2t,"").replace(f7,"").replace(nnn,` -`);for(const[r,{detector:n}]of Object.entries(MT))if(n(t,e))return r;throw new E2t(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),L1e=O((...t)=>{for(const{id:e,detector:r,loader:n}of t)_2t(e,r,n)},"registerLazyLoadedDiagrams"),_2t=O((t,e,r)=>{MT[t]&&ye.warn(`Detector with key ${t} already exists. Overwriting.`),MT[t]={detector:e,loader:r},ye.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),inn=O(t=>MT[t].loader,"getDiagramLoader"),nR=//gi,ann=O(t=>t?M2t(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),onn=(()=>{let t=!1;return()=>{t||(R2t(),t=!0)}})();function R2t(){const t="data-temp-href-target";qy.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),qy.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"))})}O(R2t,"setupDompurifyHooks");var D2t=O(t=>(onn(),qy.sanitize(t)),"removeScript"),L2t=O((t,e)=>{if(na(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=D2t(t):r!=="loose"&&(t=M2t(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=unn(t))}return t},"sanitizeMore"),li=O((t,e)=>t&&(e.dompurifyConfig?t=qy.sanitize(L2t(t,e),e.dompurifyConfig).toString():t=qy.sanitize(L2t(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),snn=O((t,e)=>typeof t=="string"?li(t,e):t.flat().map(r=>li(r,e)),"sanitizeTextOrArray"),lnn=O(t=>nR.test(t),"hasBreaks"),cnn=O(t=>t.split(nR),"splitBreaks"),unn=O(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),M2t=O(t=>t.replace(nR,"#br#"),"breakToPlaceholder"),Cj=O(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),hnn=O(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),dnn=O(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),g2=O(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),fnn=O((t,e)=>{const r=M1e(t,"~"),n=M1e(e,"~");return r===1&&n===1},"shouldCombineSets"),pnn=O(t=>{const e=M1e(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"),I2t=O(()=>window.MathMLElement!==void 0,"isMathMLSupported"),I1e=/\$\$(.*?)\$\$/g,ps=O(t=>{var e;return(((e=t.match(I1e))==null?void 0:e.length)??0)>0},"hasKatex"),p7=O(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await Oj(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"),gnn=O(async(t,e)=>{if(!ps(t))return t;if(!(I2t()||e.legacyMathML||e.forceLegacyMathML))return t.replace(I1e,"MathML is unsupported in this environment.");{const{default:r}=await Promise.resolve().then(()=>x5n),n=e.forceLegacyMathML||!I2t()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(nR).map(i=>ps(i)?`
${i}
`:`
${i}
`).join("").replace(I1e,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),Oj=O(async(t,e)=>li(await gnn(t,e),e),"renderKatexSanitized"),Xt={getRows:ann,sanitizeText:li,sanitizeTextOrArray:snn,hasBreaks:lnn,splitBreaks:cnn,lineBreakRegex:nR,removeScript:D2t,getUrl:Cj,evaluate:p0,getMax:hnn,getMin:dnn},mnn=O(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),vnn=O(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"),jo=O(function(t,e,r,n){const i=vnn(e,r,n);mnn(t,i)},"configureSvgSize"),iR=O(function(t,e,r,n){const i=e.node().getBBox(),a=i.width,o=i.height;ye.info(`SVG bounds: ${a}x${o}`,i);let s=0,l=0;ye.info(`Graph bounds: ${s}x${l}`,t),s=a+r*2,l=o+r*2,ye.info(`Calculated bounds: ${s}x${l}`),jo(e,l,s,n);const u=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",u)},"setupGraphViewbox"),kj={};function P1e(t){return[...t.cssRules].map(e=>e.cssText).join(` -`)}O(P1e,"cssStyleSheetToString");var ynn=O((t,e,r,n)=>{let i="";return t in kj&&kj[t]?i=kj[t]({...r,svgId:n}):ye.warn(`No theme found for ${t}`),`& { +*`,"g")),n={series:[]};return fe(r,function(i,a){if(HKr(i)){var o=WKr(i),s=e[a],l=s.axisDim+"Axis";s&&(n[l]=n[l]||[],n[l][s.axisIndex]={data:o.categories},n.series=n.series.concat(o.series))}else{var o=YKr(i);n.series.push(o)}}),n}var jKr=function(t){nt(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 o=document.createElement("div");o.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",o.style.backgroundColor=a.get("backgroundColor")||tt.color.neutral00;var s=document.createElement("h4"),l=a.get("lang")||[];s.innerHTML=l[0]||a.get("title"),s.style.cssText="margin:10px 20px",s.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=GKr(r);if(ur(d)){var g=d(n.getOption());$t(g)?u.innerHTML=g:GA(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(o),A._dom=null}Qde(x,"click",S),Qde(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=qKr(h.value,v)}catch(C){throw S(),new Error("Data view format error "+C)}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),o.appendChild(s),o.appendChild(u),o.appendChild(y),u.style.height=i.clientHeight-80+"px",i.appendChild(o),this._dom=o},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:tt.color.background,textColor:tt.color.primary,textareaColor:tt.color.background,textareaBorderColor:tt.color.border,buttonColor:tt.color.accent50,buttonTextColor:tt.color.neutral00};return n},e}(l0);function XKr(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 o=i.name!=null&&r.name==null;return r=mr(r,i),o&&delete r.name,r}else return r})}gg({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(t,e){var r=[];fe(t.newOption.series,function(n){var i=e.getSeriesByName(n.name)[0];if(!i)r.push(lt({type:"scatter"},n));else{var a=i.get("data");r.push({name:n.name,data:XKr(n.data,a)})}}),e.mergeOption(mr({series:r},t.newOption))});var nbt=fe,ibt=Gr();function KKr(t,e){var r=Mye(t);nbt(e,function(n,i){for(var a=r.length-1;a>=0;a--){var o=r[a];if(o[i])break}if(a<0){var s=t.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(s){var l=s.getPercentRange();r[0][i]={dataZoomId:i,start:l[0],end:l[1]}}}}),r.push(e)}function ZKr(t){var e=Mye(t),r=e[e.length-1];e.length>1&&e.pop();var n={};return nbt(r,function(i,a){for(var o=e.length-1;o>=0;o--)if(i=e[o][a],i){n[a]=i;break}}),n}function JKr(t){ibt(t).snapshots=null}function eZr(t){return Mye(t).length}function Mye(t){var e=ibt(t);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var tZr=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.onclick=function(r,n){JKr(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}(l0);gg({type:"restore",event:"restore",update:"prepareAndUpdate"},function(t,e){e.resetOption("recreate")});var rZr=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],Iye=function(){function t(e,r,n){var i=this;this._targetInfoList=[];var a=abt(r,e);fe(nZr,function(o,s){(!n||!n.include||Nr(n.include,s)>=0)&&o(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 o=Nye[n.brushType](0,a,i);n.__rangeOffset={offset:cbt[n.brushType](o.values,n.range,[1,1]),xyMinMax:o.xyMinMax}}}),e},t.prototype.matchOutputRanges=function(e,r,n){fe(e,function(i){var a=this.findTargetInfo(i,r);a&&a!==!0&&fe(a.coordSyses,function(o){var s=Nye[i.brushType](1,o,i.range,!0);n(i,s.values,o,r)})},this)},t.prototype.setInputRanges=function(e,r){fe(e,function(n){var i=this.findTargetInfo(n,r);if(n.range=n.range||[],i&&i!==!0){n.panelId=i.panelId;var a=Nye[n.brushType](0,i.coordSys,n.coordRange),o=n.__rangeOffset;n.range=o?cbt[n.brushType](a.values,o.offset,iZr(a.xyMinMax,o.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:Yvt(i),isTargetByCursor:jvt(i,e,n.coordSysModel),getLinearBrushOtherExtent:qvt(i)}})},t.prototype.controlSeries=function(e,r,n){var i=this.findTargetInfo(e,n);return i===!0||i&&Nr(i.coordSyses,r.coordinateSystem)>=0},t.prototype.findTargetInfo=function(e,r){for(var n=this._targetInfoList,i=abt(r,e),a=0;at[1]&&t.reverse(),t}function abt(t,e){return M_(t,e,{includeMainTypes:rZr})}var nZr={grid:function(t,e){var r=t.xAxisModels,n=t.yAxisModels,i=t.gridModels,a=qt(),o={},s={};!r&&!n&&!i||(fe(r,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),fe(n,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),fe(i,function(l){a.set(l.id,l),o[l.id]=!0,s[l.id]=!0}),a.each(function(l){var u=l.coordinateSystem,h=[];fe(u.getCartesians(),function(d,f){(Nr(r,d.getAxis("x").model)>=0||Nr(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:sbt.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(t,e){fe(t.geoModels,function(r){var n=r.coordinateSystem;e.push({panelId:"geo--"+r.id,geoModel:r,coordSysModel:r,coordSys:n,coordSyses:[n],getPanelRect:sbt.geo})})}},obt=[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}],sbt={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys.view,e=qmt(null,t);return pst(e,e,uq(null,t)),e}},Nye={lineX:Kr(lbt,0),lineY:Kr(lbt,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),o=[Pye([i[0],a[0]]),Pye([i[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(t,e,r,n){var i=[dc(),dc()],a=vt(r,function(o){var s=t?e.pointToData(o,n):e.dataToPoint(o,n);return i[0][0]=Math.min(i[0][0],s[0]),i[1][0]=Math.min(i[1][0],s[1]),i[0][1]=Math.max(i[0][1],s[0]),i[1][1]=Math.max(i[1][1],s[1]),s});return{values:a,xyMinMax:i}}};function lbt(t,e,r,n){var i=r.getAxis(["x","y"][t]),a=Pye(vt([0,1],function(s){return e?i.coordToData(i.toLocalCoord(n[s]),!0):i.toGlobalCoord(i.dataToCoord(n[s]))})),o=[];return o[t]=a,o[1-t]=[NaN,NaN],{values:a,xyMinMax:o}}var cbt={lineX:Kr(ubt,0),lineY:Kr(ubt,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 ubt(t,e,r,n){return[e[0]-n[t]*r[0],e[1]-n[t]*r[1]]}function iZr(t,e){var r=hbt(t),n=hbt(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 hbt(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}var Bye=fe,aZr=c6r("toolbox-dataZoom_"),oZr={x:"width",y:"height"},sZr=function(t){nt(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 wve(i.getZr()),this._brushController.on("brush",Wt(this._onBrush,this)).mount()),uZr(r,n,this,a,i),cZr(r,n)},e.prototype.onclick=function(r,n,i){lZr[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 o=new Iye($ye(this.model),a,{include:["grid"]});o.matchOutputRanges(n,a,function(u,h,d){if(d.type==="cartesian2d"){var f=d.master.getRect().clone(),p=u.brushType;p==="rect"?(s("x",d,f,h[0]),s("y",d,f,h[1])):s({lineX:"x",lineY:"y"}[p],d,f,h)}}),KKr(a,i),this._dispatchZoomAction(i);function s(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=i2(0,f.slice(),y,0,v.minValueSpan,v.maxValueSpan));var b=Rfe(y,d[oZr[u]],.5);m&&(i[m.id]={dataZoomId:m.id,startValue:isFinite(b)?Yn(f[0],b):f[0],endValue:isFinite(b)?Yn(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=[];Bye(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:tt.color.backgroundTint}};return n},e}(l0),lZr={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(ZKr(this.ecModel))}};function $ye(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 cZr(t,e){t.setIconStatus("back",eZr(e)>1?"emphasis":"normal")}function uZr(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 o=new Iye($ye(t),e,{include:["grid"]}),s=o.makePanelOpts(i,function(l){return l.xAxisDeclared&&!l.yAxisDeclared?"lineX":!l.xAxisDeclared&&l.yAxisDeclared?"lineY":"rect"});r._brushController.setPanels(s).enableBrush(a&&s.length?{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()}:!1)}K8r("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=$ye(n),o=M_(t,a);Bye(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),Bye(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,h){var d=l.componentIndex,f={type:"select",$fromToolbox:!0,filterMode:n.get("filterMode",!0)||"filter",id:aZr+u+d};f[h]=d,i.push(f)}return i});function hZr(t){t.registerComponentModel(PKr),t.registerComponentView(NKr),W5("saveAsImage",$Kr),W5("magicType",zKr),W5("dataView",jKr),W5("dataZoom",sZr),W5("restore",tZr),Xr(IKr)}var dZr=function(t){nt(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:tt.color.neutral00,shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:tt.color.border,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:tt.color.borderShade,width:1,type:"dashed",textStyle:{}}},textStyle:{color:tt.color.tertiary,fontSize:14}},e}(pn);function dbt(t){var e=t.get("confine");return e!=null?!!e:t.get("renderMode")==="richText"}function fbt(t){if(Dn.domSupported){for(var e=document.documentElement.style,r=0,n=t.length;r-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var h=u*Math.PI/180,d=o+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;s+=";"+a+":-"+p+"px";var g=e+" solid "+i+"px;",m=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+g,"border-right:"+g,"background-color:"+n+";"];return'
'}function bZr(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?",":"")+(Dn.transformSupported?""+Fye+i:",left"+i+",top"+i)),gZr+":"+a}function mbt(t,e,r){var n=t.toFixed(0)+"px",i=e.toFixed(0)+"px";if(!Dn.transformSupported)return r?"top:"+i+";left:"+n+";":[["top",i],["left",n]];var a=Dn.transform3dSupported,o="translate"+(a?"3d":"")+"("+n+","+i+(a?",0":"")+")";return r?"top:0;left:0;"+Fye+":"+o+";":[["top",0],["left",0],[pbt,o]]}function xZr(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"),o=t.get("textShadowBlur")||0,s=t.get("textShadowOffsetX")||0,l=t.get("textShadowOffsetY")||0;return a&&o&&e.push("text-shadow:"+s+"px "+l+"px "+o+"px "+a),fe(["decoration","align"],function(u){var h=t.get(u);h&&e.push("text-"+u+":"+h)}),e.join(";")}function wZr(t,e,r,n){var i=[],a=t.get("transitionDuration"),o=t.get("backgroundColor"),s=t.get("shadowBlur"),l=t.get("shadowColor"),u=t.get("shadowOffsetX"),h=t.get("shadowOffsetY"),d=t.getModel("textStyle"),f=Vht(t,"html"),p=u+"px "+h+"px "+s+"px "+l;return i.push("box-shadow:"+p),e&&a>0&&i.push(bZr(a,r,n)),o&&i.push("background-color:"+o),fe(["width","color","radius"],function(g){var m="border-"+g,v=tge(m),y=t.get(v);y!=null&&i.push(m+":"+y+(g==="color"?"":"px"))}),i.push(xZr(d)),f!=null&&i.push("padding:"+t5(f).join("px ")+"px"),i.join(";")+";"}function vbt(t,e,r,n,i){var a=e&&e.painter;if(r){var o=a&&a.getViewportRoot();o&&SIr(t,o,r,n,i)}else{t[0]=n,t[1]=i;var s=a&&a.getViewportRootOffset();s&&(t[0]+=s.offsetLeft,t[1]+=s.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var AZr=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,Dn.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var i=this._zr=e.getZr(),a=r.appendTo,o=a&&($t(a)?document.querySelector(a):GA(a)?a:ur(a)&&a(e.getDom()));vbt(this._styleCoord,i,o,e.getWidth()/2,e.getHeight()/2),(o||e.getDom()).appendChild(n),this._api=e,this._container=o;var s=this;n.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},n.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=i.handler,h=i.painter.getViewportRoot();jf(h,l,!0),u.dispatch("mousemove",l)}},n.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return t.prototype.update=function(e){if(!this._container){var r=this._api.getDom(),n=pZr(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=mZr+wZr(e,!this._firstShow,this._longHide,this._enableDisplayTransition)+mbt(a[0],a[1],!0)+("border-color:"+LS(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 o=this.el;if(e==null){o.innerHTML="";return}var s="";if($t(a)&&n.get("trigger")==="item"&&!dbt(n)&&(s=yZr(n,i,a)),$t(e))o.innerHTML=e+s;else if(e){o.innerHTML="",ft(e)||(e=[e]);for(var l=0;l=0?this._tryShow(a,o):i==="leave"&&this._hide(o))},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 o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!i.isDisposed()&&o.manuallyShowTip(r,n,i,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(r,n,i,a){if(!(a.from===this.uid||Dn.node||!i.getDom())){var o=xbt(a,i);this._ticket="";var s=a.dataByCoordSys,l=_Zr(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"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var h=TZr;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},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(r,n,i,a))return;var d=a1t(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"},o)}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},o))}},e.prototype.manuallyHideTip=function(r,n,i,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,this._cbParamsList=null,a.from!==this.uid&&this._hide(xbt(a,i))},e.prototype._manuallyAxisShowTip=function(r,n,i,a){var o=a.seriesIndex,s=a.dataIndex,l=n.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=n.getSeriesByIndex(o);if(u){var h=u.getData(),d=KB([h.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(d.get("trigger")==="axis")return i.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,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 o=r.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,r);else if(i){var s=Cr(i);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null,this._cbParamsList=null;var l,u;VS(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=Wt(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,o=[n.offsetX,n.offsetY],s=KB([n.tooltipOption],a),l=this._renderMode,u=[],h=fs("section",{blocks:[],noHeader:!0}),d=[],f=new Cge;fe(r,function(b){fe(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 C=Zyt(A,S,i,x.seriesDataIndices,x.valueLabelOpt),k=fs("section",{header:C,noHeader:!Nd(C),sortBlocks:!0,blocks:[]});h.blocks.push(k),fe(x.seriesDataIndices,function(E){var _=i.getSeriesByIndex(E.seriesIndex),P=E.dataIndexInside,L=_.getDataParams(P);if(!(L.dataIndex<0)){L.axisDim=x.axisDim,L.axisIndex=x.axisIndex,L.axisType=x.axisType,L.axisId=x.axisId,L.axisValue=CY(w.axis,{value:T}),L.axisValueLabel=C,L.marker=f.makeTooltipMarker("item",LS(L.color),l);var R=xht(_.formatTooltip(P,!0,null)),D=R.frag;if(D){var M=KB([_],a).get("valueFormatter");k.blocks.push(M?lt({valueFormatter:M},D):D)}R.text&&d.push(R.text),u.push(L)}})}})}),h.blocks.reverse(),d.reverse();var p=n.position,g=s.get("order"),m=Fht(h,f,l,g,i.get("useUTC"),s.get("textStyle"));m&&d.unshift(m);var v=l==="richText"?` + +`:"
",y=d.join(v);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(r,u)?this._updatePosition(s,p,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,y,u,Math.random()+"",o[0],o[1],p,null,f)})},e.prototype._showSeriesItemTooltip=function(r,n,i){var a=this._ecModel,o=Cr(n),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,h=o.dataIndex,d=o.dataType,f=u.getData(d),p=this._renderMode,g=r.positionDefault,m=KB([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 Cge;y.marker=b.makeTooltipMarker("item",LS(y.color),p);var x=xht(u.formatTooltip(h,!1,d)),w=m.get("order"),A=m.get("valueFormatter"),S=x.frag,T=S?Fht(A?lt({valueFormatter:A},S):S,b,p,w,a.get("useUTC"),m.get("textStyle")):x.text,C="item_"+u.name+"_"+h;this._showOrMove(m,function(){this._showTooltipContent(m,T,y,C,r.offsetX,r.offsetY,r.position,r.target,b)}),i({type:"showTip",dataIndexInside:h,dataIndex:f.getRawIndex(h),seriesIndex:s,from:this.uid})}},e.prototype._showComponentItemTooltip=function(r,n,i){var a=this._renderMode==="html",o=Cr(n),s=o.tooltipConfig,l=s.option||{},u=l.encodeHTMLContent;if($t(l)){var h=l;l={content:h,formatter:h},u=!0}u&&a&&l.content&&(l=lr(l),l.content=Hc(l.content));var d=[l],f=this._ecModel.getComponent(o.componentMainType,o.componentIndex);f&&d.push(f),d.push({formatter:l.content});var p=r.positionDefault,g=KB(d,this._tooltipModel,p?{position:p}:null),m=g.get("content"),v=Math.random()+"",y=new Cge;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,o,s,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([o,s],i,r.get("trigger"),r.get("borderColor"),r.get("defaultBorderColor",!0)),m=g.color;if(f)if($t(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=D8(y.axisValue,p,v)),p=ige(p,i,!0)}else if(ur(f)){var x=Wt(function(w,A){w===this._ticket&&(d.setContent(A,h,r,m,l),this._updatePosition(r,l,o,s,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,o,s,d,i,u)}},e.prototype._getNearestPoint=function(r,n,i,a,o){if(i==="axis"||ft(n))return{color:a||o};if(!ft(n))return{color:a||n.color||n.borderColor}},e.prototype._updatePosition=function(r,n,i,a,o,s,l){var u=this._api.getWidth(),h=this._api.getHeight();n=n||r.get("position");var d=o.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],s,o.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=ba(m,{width:u,height:h});i=v.x,a=v.y,f=null,p=null}else if($t(n)&&l){var y=EZr(n,g,d,r.get("borderWidth"));i=y[0],a=y[1]}else{var y=OZr(i,a,o,u,h,f?null:20,p?null:20);i=y[0],a=y[1]}if(f&&(i-=wbt(f)?d[0]/2:f==="right"?d[0]:0),p&&(a-=wbt(p)?d[1]/2:p==="bottom"?d[1]:0),dbt(r)){var y=kZr(i,a,o,u,h);i=y[0],a=y[1]}o.moveTo(i,a)},e.prototype._updateContentNotChangedOnAxis=function(r,n){var i=this._lastDataByCoordSys,a=this._cbParamsList,o=!!i&&i.length===r.length;return o&&fe(i,function(s,l){var u=s.dataByAxis||[],h=r[l]||{},d=h.dataByAxis||[];o=o&&u.length===d.length,o&&fe(u,function(f,p){var g=d[p]||{},m=f.seriesDataIndices||[],v=g.seriesDataIndices||[];o=o&&f.value===g.value&&f.axisType===g.axisType&&f.axisId===g.axisId&&m.length===v.length,o&&fe(m,function(y,b){var x=v[b];o=o&&y.seriesIndex===x.seriesIndex&&y.dataIndex===x.dataIndex}),a&&fe(f.seriesDataIndices,function(y){var b=y.seriesIndex,x=n[b],w=a[b];x&&w&&w.data!==x.data&&(o=!1)})})}),this._lastDataByCoordSys=r,this._cbParamsList=n,!!o},e.prototype._hide=function(r){this._lastDataByCoordSys=null,this._cbParamsList=null,r({type:"hideTip",from:this.uid})},e.prototype.dispose=function(r,n){Dn.node||!n.getDom()||(z8(this,"_updatePosition"),this._tooltipContent.dispose(),fye("itemTooltip",n),this._tooltipContent=null,this._tooltipModel=null,this._lastDataByCoordSys=null,this._cbParamsList=null)},e.type="tooltip",e}(Xi);function KB(t,e,r){var n=e.ecModel,i;r?(i=new bn(r,n,n),i=new bn(e.option,i,n)):i=e;for(var a=t.length-1;a>=0;a--){var o=t[a];o&&(o instanceof bn&&(o=o.get("tooltip",!0)),$t(o)&&(o={formatter:o}),o&&(i=new bn(o,i,n)))}return i}function xbt(t,e){return t.dispatchAction||Wt(e.dispatchAction,e)}function OZr(t,e,r,n,i,a,o){var s=r.getSize(),l=s[0],u=s[1];return a!=null&&(t+l+a+2>n?t-=l+a:t+=a),o!=null&&(e+u+o>i?e-=u+o:e+=o),[t,e]}function kZr(t,e,r,n,i){var a=r.getSize(),o=a[0],s=a[1];return t=Math.min(t+o,n)-o,e=Math.min(e+s,i)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function EZr(t,e,r,n){var i=r[0],a=r[1],o=Math.ceil(Math.SQRT2*n)+8,s=0,l=0,u=e.width,h=e.height;switch(t){case"inside":s=e.x+u/2-i/2,l=e.y+h/2-a/2;break;case"top":s=e.x+u/2-i/2,l=e.y-a-o;break;case"bottom":s=e.x+u/2-i/2,l=e.y+h+o;break;case"left":s=e.x-i-o,l=e.y+h/2-a/2;break;case"right":s=e.x+u+o,l=e.y+h/2-a/2}return[s,l]}function wbt(t){return t==="center"||t==="middle"}function _Zr(t,e,r){var n=Bfe(t).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=I_(e,i,n.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=r.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var h=Cr(u).tooltipConfig;if(h&&h.name===t.name)return l=u,!0}),l)return{componentMainType:i,componentIndex:o.componentIndex,el:l}}}}function RZr(t){Xr(YB),t.registerComponentModel(dZr),t.registerComponentView(CZr),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},no),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},no)}var DZr=["rect","polygon","keep","clear"];function LZr(t,e){var r=qi(t?t.brush:[]);if(r.length){var n=[];fe(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={}),o=a.brush||(a.brush={}),s=o.type||(o.type=[]);s.push.apply(s,n),JH(s,function(l){return l+""},null),e&&!s.length&&s.push.apply(s,DZr)}}var Abt=fe;function Sbt(t){if(t){for(var e in t)if(t.hasOwnProperty(e))return!0}}function zye(t,e,r){var n={};return Abt(e,function(a){var o=n[a]=i();Abt(t[a],function(s,l){if(ol.isValidType(l)){var u={type:l,visual:s};r&&r(u,a),o[l]=new ol(u),l==="opacity"&&(u=lr(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new ol(u))}})}),n;function i(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function Tbt(t,e,r){var n;fe(r,function(i){e.hasOwnProperty(i)&&Sbt(e[i])&&(n=!0)}),n&&fe(r,function(i){e.hasOwnProperty(i)&&Sbt(e[i])?t[i]=lr(e[i]):delete t[i]})}function MZr(t,e,r,n,i,a){var o={};fe(t,function(d){var f=ol.prepareVisualTypes(e[d]);o[d]=f});var s;function l(d){return Ege(r,s,d)}function u(d,f){cdt(r,s,d,f)}r.each(h);function h(d,f){s=d;var p=r.getRawDataItem(s);if(!(p&&p.visualMap===!1))for(var g=n.call(i,d),m=e[g],v=o[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&&Rbt(e)}};function Rbt(t){return new pr(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}var VZr=function(t){nt(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 wve(n.getZr())).on("brush",Wt(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){Ebt(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}(Xi),QZr=function(t){nt(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&&Tbt(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 Dbt(this.option,n)},this))},e.prototype.setBrushOption=function(r){this.brushOption=Dbt(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:tt.color.backgroundTint,borderColor:tt.color.borderTint},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4,defaultOutOfBrushColor:tt.color.disabled},e}(pn);function Dbt(t,e){return Qr({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new bn(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}var GZr=["rect","polygon","lineX","lineY","keep","clear"],HZr=function(t){nt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(r,n,i){var a,o,s;n.eachComponent({mainType:"brush"},function(l){a=l.brushType,o=l.brushOption.brushMode||"single",s=s||!!l.areas.length}),this._brushType=a,this._brushMode=o,fe(r.get("type",!0),function(l){r.setIconStatus(l,(l==="keep"?o==="multiple":l==="clear"?s: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 fe(r.get("type",!0),function(a){n[a]&&(i[a]=n[a])}),i},e.prototype.onclick=function(r,n,i){var a=this._brushType,o=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"?o==="multiple"?"single":"multiple":o}})},e.getDefaultOption=function(r){var n={show:!0,type:GZr.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}(l0);function WZr(t){t.registerComponentView(VZr),t.registerComponentModel(QZr),t.registerPreprocessor(LZr),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,NZr),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"},no),t.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},no),W5("brush",HZr)}var YZr=function(t){nt(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:tt.size.m,backgroundColor:tt.color.transparent,borderColor:tt.color.primary,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:tt.color.primary},subtextStyle:{fontSize:12,color:tt.color.quaternary}},e}(pn),qZr=function(t){nt(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,o=r.getModel("textStyle"),s=r.getModel("subtextStyle"),l=r.get("textAlign"),u=Jt(r.get("textBaseline"),r.get("textVerticalAlign")),h=new $n({style:ji(o,{text:r.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),d=h.getBoundingRect(),f=r.get("subtext"),p=new $n({style:ji(s,{text:f,fill:s.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(){BW(g,"_"+r.get("target"))}),m&&p.on("click",function(){BW(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=Ps(r,i),w=ba(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 C=new nn({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(C)}},e.type="title",e}(Xi);function jZr(t){t.registerComponentModel(YZr),t.registerComponentView(qZr)}var Lbt=function(t){nt(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=[],o;i==="category"?(o=[],fe(n,function(u,h){var d=Ds(L_(u),""),f;yr(u)?(f=lr(u),f.value=h):f=h,o.push(f),a.push(d)})):o=n;var s={category:"ordinal",time:"time",value:"number"}[i]||"number",l=this._data=new jc([{name:"value",type:s}],this);l.initData(o,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:tt.size.m,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:tt.color.secondary},data:[]},e}(pn),Mbt=function(t){nt(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=Hx(Lbt.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:tt.color.border,borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:tt.color.accent10},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:tt.color.tertiary},itemStyle:{color:tt.color.accent20,borderWidth:0},checkpointStyle:{symbol:"circle",symbolSize:15,color:tt.color.accent50,borderColor:tt.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:tt.color.accent50,borderColor:tt.color.accent50,borderWidth:0},emphasis:{label:{show:!0,color:tt.color.accent60},itemStyle:{color:tt.color.accent60,borderColor:tt.color.accent60},controlStyle:{color:tt.color.accent70,borderColor:tt.color.accent70}},progress:{lineStyle:{color:tt.color.accent30},itemStyle:{color:tt.color.accent40}},data:[]}),e}(Lbt);Qo(Mbt,HW.prototype);var XZr=function(t){nt(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="timeline",e}(Xi),KZr=function(t){nt(e,t);function e(r,n,i,a){var o=t.call(this,r,n,i)||this;return o.type=a||"value",o}return e.prototype.getLabelModel=function(){return this.model.getModel("label")},e.prototype.isHorizontal=function(){return this.model.get("orient")==="horizontal"},e}(cp),Qye=Math.PI,Ibt=Gr(),ZZr=function(t){nt(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),o=this._createGroup("_mainGroup"),s=this._createGroup("_labelGroup"),l=this._axis=this._createAxis(a,r);r.formatTooltip=function(u){var h=l.scale.getLabel({value:u});return fs("nameValue",{noName:!0,value:h})},fe(["AxisLine","AxisTick","Control","CurrentPointer"],function(u){this["_render"+u](a,o,l,r)},this),this._renderAxisLabel(a,s,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"),o=JZr(r,n),s;i==null||i==="auto"?s=a==="horizontal"?o.y+o.height/2=0||s==="+"?"left":"right"},u={horizontal:s>=0||s==="+"?"top":"bottom",vertical:"middle"},h={horizontal:0,vertical:Qye/2},d=a==="vertical"?o.height:o.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*Qye/180;var b,x,w,A=f.get("position",!0),S=p&&f.get("showPlayBtn",!0),T=p&&f.get("showPrevBtn",!0),C=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),C&&(w=[E-g,0],E-=v)):(S&&(b=[E-g,0],E-=v),T&&(x=[0,0],k+=v),C&&(w=[E-g,0],E-=v));var _=[k,E];return r.get("inverse")&&_.reverse(),{viewRect:o,mainLength:d,orient:a,rotation:h[a],labelRotation:y,labelPosOpt:s,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,o=r.viewRect;if(r.orient==="vertical"){var s=ka(),l=o.x,u=o.y+o.height;sg(s,s,[-l,-u]),xy(s,s,-Qye/2),sg(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var h=b(o),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||$t(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,C){w[T]+=S[T][C]-A[T][C]}},e.prototype._createAxis=function(r,n){var i=n.getData(),a=n.get("axisType")||n.get("type");a!=="category"&&a!=="time"&&(a="value");var o=x5(n,a,!1);o.getTicks=function(){return i.mapArray(["value"],function(u){return{value:u}})};var s=i.getDataExtent("value");o.setExtent(s[0],s[1]),Hft(o,{fixMinMax:[!0,!0]});var l=new KZr("value",o,r.axisExtent,a);return l.model=n,l},e.prototype._createGroup=function(r){var n=this[r]=new gr;return this.group.add(n),n},e.prototype._renderAxisLine=function(r,n,i,a){var o=i.getExtent();if(a.get(["lineStyle","show"])){var s=new Go({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:lt({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});n.add(s);var l=this._progressLine=new Go({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:mr({lineCap:"round",lineWidth:s.style.lineWidth},a.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});n.add(l)}},e.prototype._renderAxisTick=function(r,n,i,a){var o=this,s=a.getData(),l=i.scale.getTicks();this._tickSymbols=[],fe(l,function(u){var h=i.dataToCoord(u.value),d=s.getItemModel(u.value),f=d.getModel("itemStyle"),p=d.getModel(["emphasis","itemStyle"]),g=d.getModel(["progress","itemStyle"]),m={x:h,y:0,onclick:Wt(o._changeTimeline,o,u.value)},v=Pbt(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,o._tickSymbols.push(v)})},e.prototype._renderAxisLabel=function(r,n,i,a){var o=this,s=i.getLabelModel();if(s.get("show")){var l=a.getData(),u=i.getViewLabels();this._tickLabels=[],fe(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 $n({x:v,y:0,rotation:r.labelRotation-r.rotation,onclick:Wt(o._changeTimeline,o,d),silent:!1,style:ji(p,{text:h.formattedLabel,align:r.labelAlign,verticalAlign:r.labelBaseline})});y.ensureState("emphasis").style=ji(g),y.ensureState("progress").style=ji(m),n.add(y),Vx(y),Ibt(y).dataIndex=d,o._tickLabels.push(y)}})}},e.prototype._renderControl=function(r,n,i,a){var o=r.controlSize,s=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",Wt(this._changeTimeline,this,d?"-":"+")),f(r.prevBtnPosition,"prev",Wt(this._changeTimeline,this,d?"+":"-")),f(r.playPosition,h?"stop":"play",Wt(this._handlePlayClick,this,!h),!0);function f(p,g,m,v){if(p){var y=Mm(Jt(a.get(["controlStyle",g+"BtnSize"]),o),o),b=[0,-y/2,y,y],x=eJr(a,g+"Icon",b,{x:p[0],y:p[1],originX:o/2,originY:0,rotation:v?-s: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 o=a.getData(),s=a.getCurrentIndex(),l=o.getItemModel(s).getModel("checkpointStyle"),u=this,h={onCreate:function(d){d.draggable=!0,d.drift=Wt(u._handlePointerDrag,u),d.ondragend=Wt(u._handlePointerDragend,u),Nbt(d,u._progressLine,s,i,a,!0)},onUpdate:function(d){Nbt(d,u._progressLine,s,i,a)}};this._currentPointer=Pbt(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,o=Rl(a.getExtent().slice());i>o[1]&&(i=o[1]),i=0&&(s[o]=+s[o].toFixed(g)),[s,p]}var aj={min:Kr(ij,"min"),max:Kr(ij,"max"),average:Kr(ij,"average"),median:Kr(ij,"median")};function JB(t,e){if(e){var r=t.getData(),n=t.coordinateSystem,i=n&&n.dimensions;if(!oJr(e)&&!ft(e.coord)&&ft(i)){var a=$bt(e,r,n,t);if(e=lr(e),e.type&&aj[e.type]&&a.baseAxis&&a.valueAxis){var o=Nr(i,a.baseAxis.dim),s=Nr(i,a.valueAxis.dim),l=aj[e.type](r,a.valueAxis.dim,a.baseDataDim,a.valueDataDim,o,s);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&&aj[e.type]){var h=n.getOtherAxis(u);h&&(e.value=oj(r,r.mapDimension(h.dim),e.type))}}else for(var d=e.coord,f=0;f<2;f++)aj[d[f]]&&(d[f]=oj(r,r.mapDimension(i[f]),d[f]));return e}}function $bt(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(sJr(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 sJr(t,e){var r=t.getData().getDimensionInfo(e);return r&&r.coordDim}function e7(t,e){return t&&t.containData&&e.coord&&!Hye(e)?t.containData(e.coord):!0}function lJr(t,e,r){return t&&t.containZone&&e.coord&&r.coord&&!Hye(e)&&!Hye(r)?t.containZone(e.coord,r.coord):!0}function Fbt(t,e){return t?function(r,n,i,a){var o=a<2?r.coord&&r.coord[a]:r.value;return Wx(o,e[a])}:function(r,n,i,a){return Wx(r.value,e[a])}}function oj(t,e,r){if(r==="average"){var n=0,i=0;return t.each(e,function(a,o){isNaN(a)||(n+=a,i++)}),n/i}else return r==="median"?t.getMedian(e):t.getDataExtent(e)[r==="max"?1:0]}var Wye=Gr(),Yye=function(t){nt(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=qt()},e.prototype.render=function(r,n,i){var a=this,o=this.markerGroupMap;o.each(function(s){Wye(s).keep=!1}),n.eachSeries(function(s){var l=c0.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,n,i)}),o.each(function(s){!Wye(s).keep&&a.group.remove(s.group)}),cJr(n,o,this.type)},e.prototype.markKeep=function(r){Wye(r).keep=!0},e.prototype.toggleBlurSeries=function(r,n){var i=this;fe(r,function(a){var o=c0.getMarkerModelFromSeries(a,i.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(n?Act(l):ppe(l))})}})},e.type="marker",e}(Xi);function cJr(t,e,r){t.eachSeries(function(n){var i=c0.getMarkerModelFromSeries(n,r),a=e.get(n.id);if(i&&a&&a.group){var o=_S(i),s=o.z,l=o.zlevel;OW(a.group,s,l)}})}function zbt(t,e,r){var n=e.coordinateSystem,i=r.getWidth(),a=r.getHeight(),o=n&&n.getArea&&n.getArea();t.each(function(s){var l=t.getItemModel(s),u=l.get("relativeTo")==="coordinate",h=u?o?o.width:0:i,d=u?o?o.height:0:a,f=u&&o?o.x:0,p=u&&o?o.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,s));else if(n){var y=t.get(n.dimensions[0],s),b=t.get(n.dimensions[1],s);g=n.dataToPoint([y,b])}isNaN(m)||(g[0]=m),isNaN(v)||(g[1]=v),t.setItemLayout(s,g)})}var uJr=function(t){nt(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 o=c0.getMarkerModelFromSeries(a,"markPoint");o&&(zbt(o.getData(),a,i),this.markerGroupMap.get(a.id).updateLayout())},this)},e.prototype.renderSeries=function(r,n,i,a){var o=r.coordinateSystem,s=r.id,l=r.getData(),u=this.markerGroupMap,h=u.get(s)||u.set(s,new fB),d=hJr(o,r,n);n.setData(d),zbt(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=G8(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}(Yye);function hJr(t,e,r){var n;t?n=vt(t&&t.dimensions,function(s){var l=e.getData(),u=l.getDimensionInfo(l.mapDimension(s))||{};return lt(lt({},u),{name:s,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new jc(n,r),a=vt(r.get("data"),Kr(JB,e));t&&(a=oi(a,Kr(e7,t)));var o=Fbt(!!t,n);return i.initData(a,null,o),i}function dJr(t){t.registerComponentModel(aJr),t.registerComponentView(uJr),t.registerPreprocessor(function(e){Gye(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}var fJr=function(t){nt(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}(c0),sj=Gr(),pJr=function(t,e,r,n){var i=t.getData(),a;if(ft(n))a=n;else{var o=n.type;if(o==="min"||o==="max"||o==="average"||o==="median"||n.xAxis!=null||n.yAxis!=null){var s=void 0,l=void 0;if(n.yAxis!=null||n.xAxis!=null)s=e.getAxis(n.yAxis!=null?"y":"x"),l=Gc(n.yAxis,n.xAxis);else{var u=$bt(n,i,e,t);s=u.valueAxis;var h=ame(i,u.valueDataDim);l=oj(i,h,o)}var d=s.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&&Vn(l)&&(l=+l.toFixed(Math.min(m,20))),p.coord[d]=g.coord[d]=l,a=[p,g,{type:o,valueIndex:n.valueIndex,value:l}]}else a=[]}var v=[JB(t,a[0]),JB(t,a[1]),lt({},a[2])];return v[2].type=v[2].type||null,Qr(v[2],v[0]),Qr(v[2],v[1]),v};function lj(t){return!isNaN(t)&&!isFinite(t)}function Ubt(t,e,r,n){var i=1-t,a=n.dimensions[t];return lj(e[i])&&lj(r[i])&&e[t]===r[t]&&n.getAxis(a).containData(e[t])}function gJr(t,e){if(t.type==="cartesian2d"){var r=e[0].coord,n=e[1].coord;if(r&&n&&(Ubt(1,r,n,t)||Ubt(0,r,n,t)))return!0}return e7(t,e[0])&&e7(t,e[1])}function qye(t,e,r,n,i){var a=n.coordinateSystem,o=t.getItemModel(e),s,l=Qt(o.get("x"),i.getWidth()),u=Qt(o.get("y"),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(n.getMarkerPosition)s=n.getMarkerPosition(t.getValues(t.dimensions,e));else{var h=a.dimensions,d=t.get(h[0],e),f=t.get(h[1],e);s=a.dataToPoint([d,f])}if(aT(a,"cartesian2d")){var p=a.getAxis("x"),g=a.getAxis("y"),h=a.dimensions;lj(t.get(h[0],e))?s[0]=p.toGlobalCoord(p.getExtent()[r?0:1]):lj(t.get(h[1],e))&&(s[1]=g.toGlobalCoord(g.getExtent()[r?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}t.setItemLayout(e,s)}var mJr=function(t){nt(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 o=c0.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=sj(o).from,u=sj(o).to;l.each(function(h){qye(l,h,!0,a,i),qye(u,h,!1,a,i)}),s.each(function(h){s.setItemLayout(h,[l.getItemLayout(h),u.getItemLayout(h)])}),this.markerGroupMap.get(a.id).updateLayout()}},this)},e.prototype.renderSeries=function(r,n,i,a){var o=r.coordinateSystem,s=r.id,l=r.getData(),u=this.markerGroupMap,h=u.get(s)||u.set(s,new lve);this.group.add(h.group);var d=vJr(o,r,n),f=d.from,p=d.to,g=d.line;sj(n).from=f,sj(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);qye(w,A,S,r,a);var C=T.getModel("itemStyle").getItemStyle();C.fill==null&&(C.fill=G8(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:C})}this.markKeep(h),h.group.silent=n.get("silent")||r.get("silent")},e.type="markLine",e}(Yye);function vJr(t,e,r){var n;t?n=vt(t&&t.dimensions,function(u){var h=e.getData(),d=h.getDimensionInfo(h.mapDimension(u))||{};return lt(lt({},d),{name:u,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new jc(n,r),a=new jc(n,r),o=new jc([],r),s=vt(r.get("data"),Kr(pJr,e,t,r));t&&(s=oi(s,Kr(gJr,t)));var l=Fbt(!!t,n);return i.initData(vt(s,function(u){return u[0]}),null,l),a.initData(vt(s,function(u){return u[1]}),null,l),o.initData(vt(s,function(u){return u[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}function yJr(t){t.registerComponentModel(fJr),t.registerComponentView(mJr),t.registerPreprocessor(function(e){Gye(e.series,"markLine")&&(e.markLine=e.markLine||{})})}var bJr=function(t){nt(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}(c0),cj=Gr(),xJr=function(t,e,r,n){var i=n[0],a=n[1];if(!(!i||!a)){var o=JB(t,i),s=JB(t,a),l=o.coord,u=s.coord;l[0]=Gc(l[0],-1/0),l[1]=Gc(l[1],-1/0),u[0]=Gc(u[0],1/0),u[1]=Gc(u[1],1/0);var h=uH([{},o,s]);return h.coord=[o.coord,s.coord],h.x0=o.x,h.y0=o.y,h.x1=s.x,h.y1=s.y,h}};function uj(t){return!isNaN(t)&&!isFinite(t)}function Vbt(t,e,r,n){var i=1-t;return uj(e[i])&&uj(r[i])}function wJr(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 aT(t,"cartesian2d")?r&&n&&(Vbt(1,r,n)||Vbt(0,r,n))?!0:lJr(t,i,a):e7(t,i)||e7(t,a)}function Qbt(t,e,r,n,i){var a=n.coordinateSystem,o=t.getItemModel(e),s,l=Qt(o.get(r[0]),i.getWidth()),u=Qt(o.get(r[1]),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[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],s=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),s=a.dataToPoint(y,!0)}if(aT(a,"cartesian2d")){var b=a.getAxis("x"),x=a.getAxis("y"),m=t.get(r[0],e),v=t.get(r[1],e);uj(m)?s[0]=b.toGlobalCoord(b.getExtent()[r[0]==="x0"?0:1]):uj(v)&&(s[1]=x.toGlobalCoord(x.getExtent()[r[1]==="y0"?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}return s}var Gbt=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],AJr=function(t){nt(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 o=c0.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=vt(Gbt,function(d){return Qbt(s,l,d,a,i)});s.setItemLayout(l,u);var h=s.getItemGraphicEl(l);h.setShape("points",u)})}},this)},e.prototype.renderSeries=function(r,n,i,a){var o=r.coordinateSystem,s=r.id,l=r.getData(),u=this.markerGroupMap,h=u.get(s)||u.set(s,{group:new gr});this.group.add(h.group),this.markKeep(h);var d=SJr(o,r,n);n.setData(d),d.each(function(f){var p=vt(Gbt,function(E){return Qbt(d,f,E,r,a)}),g=o.getAxis("x").scale,m=o.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))];Rl(b),Rl(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:tt.size.m,align:"auto",backgroundColor:tt.color.transparent,borderColor:tt.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:tt.color.disabled,inactiveBorderColor:tt.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:tt.color.disabled,inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:tt.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:tt.color.tertiary,borderWidth:1,borderColor:tt.color.border},emphasis:{selectorLabel:{show:!0,color:tt.color.quaternary}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},e}(pn),q5=Kr,Xye=fe,hj=gr,Hbt=function(t){nt(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 hj),this.group.add(this._selectorGroup=new hj),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 o=r.get("align"),s=r.get("orient");(!o||o==="auto")&&(o=r.get("left")==="right"&&s==="vertical"?"right":"left");var l=r.get("selector",!0),u=r.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,r,n,i,l,s,u);var h=Ps(r,i).refContainer,d=r.getBoxLayoutParams(),f=r.get("padding"),p=ba(d,h,f),g=this.layoutInner(r,o,p,a,l,u),m=ba(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=J1t(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,o,s,l){var u=this.getContentGroup(),h=qt(),d=n.get("selectedMode"),f=n.get("triggerEvent"),p=[];i.eachRawSeries(function(g){!g.get("legendHoverLink")&&p.push(g.id)}),Xye(n.getData(),function(g,m){var v=this,y=g.get("name");if(!this.newlineDisabled&&(y===""||y===` +`)){var b=new hj;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"),C=this._createItem(x,y,m,g,n,r,A,T,S,d,a);C.on("click",q5(Wbt,y,null,a,p)).on("mouseover",q5(Kye,x.name,null,a,p)).on("mouseout",q5(Zye,x.name,null,a,p)),i.ssr&&C.eachChild(function(k){var E=Cr(k);E.seriesIndex=x.seriesIndex,E.dataIndex=m,E.ssrType="legend"}),f&&C.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 P=_.indexOfName(y),L=_.getItemVisual(P,"style"),R=_.getItemVisual(P,"legendIcon"),D=Wc(L.fill);D&&D[3]===0&&(D[3]=.2,L=lt(lt({},L),{fill:Zf(D,"rgba")}));var M=this._createItem(k,y,m,g,n,r,{},L,R,d,a);M.on("click",q5(Wbt,null,y,a,p)).on("mouseover",q5(Kye,null,y,a,p)).on("mouseout",q5(Zye,null,y,a,p)),i.ssr&&M.eachChild(function(I){var N=Cr(I);N.seriesIndex=k.seriesIndex,N.dataIndex=m,N.ssrType="legend"}),f&&M.eachChild(function(I){E.packEventData(I,n,k,m,y)}),h.set(y,!0)}},this)},this),o&&this._createSelector(o,n,a,s,l)},e.prototype.packEventData=function(r,n,i,a,o){var s={componentType:"legend",componentIndex:n.componentIndex,dataIndex:a,value:o,seriesIndex:i.seriesIndex};Cr(r).eventData=s},e.prototype._createSelector=function(r,n,i,a,o){var s=this.getSelectorGroup();Xye(r,function(u){var h=u.type,d=new $n({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:h==="all"?"legendAllSelect":"legendInverseSelect",legendId:n.id})}});s.add(d);var f=n.getModel("selectorLabel"),p=n.getModel(["emphasis","selectorLabel"]);il(d,{normal:f,emphasis:p},{defaultText:u.title}),Vx(d)})},e.prototype._createItem=function(r,n,i,a,o,s,l,u,h,d,f){var p=r.visualDrawType,g=o.get("itemWidth"),m=o.get("itemHeight"),v=o.isSelected(n),y=a.get("symbolRotate"),b=a.get("symbolKeepAspect"),x=a.get("icon");h=x||h||"roundRect";var w=OJr(h,a,l,u,p,v,f),A=new hj,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(kJr({itemWidth:g,itemHeight:m,icon:h,iconRotate:T,itemStyle:w.itemStyle,symbolKeepAspect:b}))}var C=s==="left"?g+5:-5,k=s,E=o.get("formatter"),_=n;$t(E)&&E?_=E.replace("{name}",n??""):ur(E)&&(_=E(n));var P=v?S.getTextColor():a.get("inactiveColor");A.add(new $n({style:ji(S,{text:_,x:C,y:m/2,fill:P,align:k,verticalAlign:"middle"},{inheritColor:P})}));var L=new nn({shape:A.getBoundingRect(),style:{fill:"transparent"}}),R=a.getModel("tooltip");return R.get("show")&&Ly({el:L,componentModel:o,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,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();IS(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(),o){IS("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";s==="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}(Xi);function OJr(t,e,r,n,i,a,o){function s(v,y){v.lineWidth==="auto"&&(v.lineWidth=y.lineWidth>0?2:0),Xye(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:f5(d,o),u.fill==="inherit"&&(u.fill=n[i]),u.stroke==="inherit"&&(u.stroke=n[h]),u.opacity==="inherit"&&(u.opacity=(i==="fill"?n:r).opacity),s(u,n);var f=e.getModel("lineStyle"),p=f.getLineStyle();if(s(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 kJr(t){var e=t.icon||"roundRect",r=Yo(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=tt.color.neutral00,r.style.lineWidth=2),r}function Wbt(t,e,r,n){Zye(t,e,r,n),r.dispatchAction({type:"legendToggleSelect",name:t??e}),Kye(t,e,r,n)}function Kye(t,e,r,n){r.usingTHL()||r.dispatchAction({type:"highlight",seriesName:t,name:e,excludeSeriesId:n})}function Zye(t,e,r,n){r.usingTHL()||r.dispatchAction({type:"downplay",seriesName:t,name:e,excludeSeriesId:n})}function t7(t,e,r){var n=t==="allSelect"||t==="inverseSelect",i={},a=[];r.eachComponent({mainType:"legend",query:e},function(s){n?s[t]():s[t](e.name),Ybt(s,i),a.push(s.componentIndex)});var o={};return r.eachComponent("legend",function(s){fe(i,function(l,u){s[l?"select":"unSelect"](u)}),Ybt(s,o)}),n?{selected:o,legendIndex:a}:{name:e.name,selected:o}}function Ybt(t,e){var r=e||{};return fe(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 EJr(t){t.registerAction("legendToggleSelect","legendselectchanged",Kr(t7,"toggleSelected")),t.registerAction("legendAllSelect","legendselectall",Kr(t7,"allSelect")),t.registerAction("legendInverseSelect","legendinverseselect",Kr(t7,"inverseSelect")),t.registerAction("legendSelect","legendselected",Kr(t7,"select")),t.registerAction("legendUnSelect","legendunselected",Kr(t7,"unSelect"))}var _Jr=d8(RJr);function RJr(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.filterSeries(function(r){for(var n=0;ni[o],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[o]-g[o]:y[a]+=g[o]+x}b[1-a]+=p[s]/2-g[s]/2,h.setPosition(v),d.setPosition(y),f.setPosition(b);var A={x:0,y:0};if(A[o]=m?i[o]:p[o],A[s]=Math.max(p[s],g[s]),A[l]=Math.min(0,g[l]+b[1-a]),d.__rectSize=i[o],m){var S={x:0,y:0};S[o]=Math.max(i[o]-g[o]-x,0),S[s]=A[s],d.setClipPath(new nn({shape:S})),d.__rectSize=S[o]}else f.eachChild(function(C){C.attr({invisible:!0,silent:!0})});var T=this._getPageInfo(r);return T.pageIndex!=null&&qn(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;fe(["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"),o=r.get("pageFormatter"),s=n.pageIndex,l=s!=null?s+1:0,u=n.pageCount;a&&o&&a.setStyle("text",$t(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},e.prototype._getPageInfo=function(r){var n=r.get("scrollDataIndex",!0),i=this.getContentGroup(),a=this._containerGroup.__rectSize,o=r.getOrient().index,s=Jye[o],l=e1e[o],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[o]=-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(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===r&&(n=s)}),n??a},e.type="legend.scroll",e}(Hbt);function MJr(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 IJr(t){Xr(qbt),t.registerComponentModel(DJr),t.registerComponentView(LJr),MJr(t)}function PJr(t){Xr(qbt),Xr(IJr)}var NJr=function(t){nt(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=Hx(XB.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(XB),t1e=Gr();function BJr(t,e,r){t1e(t).coordSysRecordMap.each(function(n){var i=n.dataZoomInfoMap.get(e.uid);i&&(i.getRange=r)})}function $Jr(t,e){for(var r=t1e(t).coordSysRecordMap,n=r.keys(),i=0;ia[i+n]&&(n=d),o=o&&h.get("preventDefaultMouseMove",!0),s=Jt(h.get("cursorGrab",!0),s),l=Jt(h.get("cursorGrabbing",!0),l)}),{controlType:n,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o,api:r,zInfo:{component:e.model},triggerInfo:{roamTrigger:null,isInSelf:e.containsPoint},cursorGrab:s,cursorGrabbing:l}}}function QJr(t){t.registerUpdateLifecycle("coordsys:aftercreate",function(e,r){var n=t1e(r),i=n.coordSysRecordMap||(n.coordSysRecordMap=qt());i.each(function(a){a.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=Y1t(a);fe(o.infoList,function(s){var l=s.model.uid,u=i.get(l)||i.set(l,FJr(r,s.model)),h=u.dataZoomInfoMap||(u.dataZoomInfoMap=qt());h.set(a.uid,{dzReferCoordSysInfo:s,model:a,getRange:null})})}),i.each(function(a){var o=a.controller,s,l=a.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(s=l.get(u))}if(!s){Kbt(i,a);return}var h=VJr(l,a,r);o.enable(h.controlType,h.opt),s5(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var GJr=function(t){nt(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(),BJr(i,r,{pan:Wt(r1e.pan,this),zoom:Wt(r1e.zoom,this),scrollMove:Wt(r1e.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){$Jr(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(Rye),r1e={zoom:function(t,e,r,n){var i=this.range,a=i.slice(),o=t.axisModels[0];if(o){var s=n1e[e](null,[n.originX,n.originY],o,r,t),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.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(i2(0,a,[0,100],0,h.minSpan,h.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:Zbt(function(t,e,r,n,i,a){var o=n1e[n]([a.oldX,a.oldY],[a.newX,a.newY],e,i,r);return o.signal*(t[1]-t[0])*o.pixel/o.pixelLength}),scrollMove:Zbt(function(t,e,r,n,i,a){var o=n1e[n]([0,0],[a.scrollDelta,a.scrollDelta],e,i,r);return o.signal*(t[1]-t[0])*a.scrollDelta})};function Zbt(t){return function(e,r,n,i){var a=this.range,o=a.slice(),s=e.axisModels[0];if(s){var l=t(o,s,e,r,n,i);if(i2(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var n1e={grid:function(t,e,r,n,i){var a=r.axis,o={},s=i.model.coordinateSystem.getRect();return t=t||[0,0],a.dim==="x"?(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},polar:function(t,e,r,n,i){var a=r.axis,o={},s=i.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),r.mainType==="radiusAxis"?(o.pixel=e[0]-t[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=e[1]-t[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(t,e,r,n,i){var a=r.axis,o=i.model.coordinateSystem.getRect(),s={};return t=t||[0,0],a.orient==="horizontal"?(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}};function Jbt(t){Dye(t),t.registerComponentModel(NJr),t.registerComponentView(GJr),QJr(t)}var HJr=function(t){nt(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=Hx(XB.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:tt.color.accent10,borderRadius:0,backgroundColor:tt.color.transparent,dataBackground:{lineStyle:{color:tt.color.accent30,width:.5},areaStyle:{color:tt.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:tt.color.accent40,width:.5},areaStyle:{color:tt.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:tt.color.neutral00,borderColor:tt.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:tt.color.accent40,opacity:.5},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:tt.color.tertiary},brushSelect:!0,brushStyle:{color:tt.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:tt.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),e}(XB),r7=nn,WJr=1,i1e=30,YJr=7,n7="horizontal",ext="vertical",qJr=5,jJr=["line","bar","candlestick","scatter"],XJr={easing:"cubicOut",duration:100,delay:0},KJr=function(t){nt(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=Wt(this._onBrush,this),this._onBrushEnd=Wt(this._onBrushEnd,this)},e.prototype.render=function(r,n,i,a){if(t.prototype.render.apply(this,arguments),s5(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(){z8(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 gr;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?YJr:0,o=Ps(r,n).refContainer,s=this._findCoordRect(),l=r.get("defaultLocationEdgeGap",!0)||0,u=this._orient===n7?{right:o.width-s.x-s.width,top:o.height-i1e-l-a,width:s.width,height:i1e}:{right:l,top:s.y,width:i1e,height:s.height},h=PS(r.option);fe(["right","top","width","height"],function(f){h[f]==="ph"&&(h[f]=u[f])});var d=ba(h,o);this._location={x:d.x,y:d.y},this._size=[d.width,d.height],this._orient===ext&&this._size.reverse()},e.prototype._positionGroup=function(){var r=this.group,n=this._location,i=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),o=a&&a.get("inverse"),s=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;s.attr(i===n7&&!o?{scaleY:l?1:-1,scaleX:1}:i===n7&&o?{scaleY:l?1:-1,scaleX:-1}:i===ext&&!o?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=r.getBoundingRect([s]),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 r7({silent:!0,shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:r.get("backgroundColor")},z2:-40}));var o=new r7({shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:"transparent"},z2:0,onclick:Wt(this._onClickPanel,this)}),s=this.api.getZr();a?(o.on("mousedown",this._onBrushStart,this),o.cursor="crosshair",s.on("mousemove",this._onBrush),s.on("mouseup",this._onBrushEnd)):(s.off("mousemove",this._onBrush),s.off("mouseup",this._onBrushEnd)),i.add(o)},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,o=a.getRawData(),s=a.getShadowDim&&a.getShadowDim(),l=s&&o.getDimensionInfo(s)?a.getShadowDim():r.otherDim;if(l==null)return;var u=this._shadowPolygonPts,h=this._shadowPolylinePts;if(o!==this._shadowData||l!==this._shadowDim||n[0]!==i[0]||n[1]!==i[1]){var d=o.getDataExtent(r.thisDim),f=o.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,o.count()-1),x=n[0]/(d[1]-d[0]),w=r.thisAxis.type==="time",A=-b,S=Math.round(o.count()/n[0]),T;o.each([r.thisDim,l],function(P,L,R){if(S>0&&R%S){w||(A+=b);return}A=w?(+P-d[0])*x:A+b;var D=L==null||isNaN(L)||L==="",M=D?0:Zn(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=o,this._shadowDim=l,this._shadowSize=[n[0],n[1]];var C=this.dataZoomModel;function k(P){var L=C.getModel(P?"selectedDataBackground":"dataBackground"),R=new gr,D=new pc({shape:{points:u},segmentIgnoreThreshold:1,style:L.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),M=new Ll({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(o,s){var l=r.getAxisProxy(o,s).getTargetSeriesModels();fe(l,function(u){if(!i&&!(n!==!0&&Nr(jJr,u.get("type"))<0)){var h=a.getComponent(u2(o),s).axis,d=ZJr(o),f,p=u.coordinateSystem;d!=null&&p.getOtherAxis&&(f=p.getOtherAxis(h).inverse),d=u.getData().mapDimension(d);var g=u.getData().mapDimension(o);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],o=this._displayables.sliderGroup,s=this._size,l=this.dataZoomModel,u=this.api,h=l.get("borderRadius")||0,d=l.get("brushSelect"),f=n.filler=new r7({silent:d,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(f),o.add(new r7({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:h},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:WJr,fill:tt.color.transparent}})),fe([0,1],function(x){var w=l.get("handleIcon");!eY[w]&&w.indexOf("path://")<0&&w.indexOf("image://")<0&&(w="path://"+w);var A=Yo(w,-1,0,2,2,null,!0);A.attr({cursor:JJr(this._orient),draggable:!0,drift:Wt(this._onDragMove,this,x),ondragend:Wt(this._onDragEnd,this),onmouseover:Wt(this._onOverDataInfoTriggerArea,this,!0),onmouseout:Wt(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 C=l.get("handleColor");C!=null&&(A.style.fill=C),o.add(i[x]=A);var k=l.getModel("textStyle"),E=l.get("handleLabel")||{},_=E.show||!1;r.add(a[x]=new $n({silent:!0,invisible:!_,style:ji(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"),s[1]),m=n.moveHandle=new nn({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:g}}),v=g*.8,y=n.moveHandleIcon=Yo(l.get("moveHandleIcon"),-v/2,-v/2,v,v,tt.color.neutral00,!0);y.silent=!0,y.y=s[1]+g/2-.5,m.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var b=Math.min(s[1]/2,Math.max(g,10));p=n.moveZone=new nn({invisible:!0,shape:{y:s[1]-b,height:g+b}}),p.on("mouseover",function(){u.enterEmphasis(m)}).on("mouseout",function(){u.leaveEmphasis(m)}),o.add(m),o.add(y),o.add(p)}p.attr({draggable:!0,cursor:"grab",drift:Wt(this._onActualMoveZoneDrift,this),ondragstart:Wt(this._onActualMoveZoneDragStart,this),ondragend:Wt(this._onActualMoveZoneDragEnd,this),onmouseover:Wt(this._onOverDataInfoTriggerArea,this,!0),onmouseout:Wt(this._onOverDataInfoTriggerArea,this,!1)})},e.prototype._resetInterval=function(){var r=this._range=this.dataZoomModel.getPercentRange(),n=this._getViewExtent();this._handleEnds=[Zn(r[0],[0,100],n,!0),Zn(r[1],[0,100],n,!0)]},e.prototype._updateInterval=function(r,n){var i=this.dataZoomModel,a=this._handleEnds,o=this._getViewExtent(),s=i.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];i2(n,a,o,i.get("zoomLock")?"all":r,s.minSpan!=null?Zn(s.minSpan,l,o,!0):null,s.maxSpan!=null?Zn(s.maxSpan,l,o,!0):null);var u=this._range,h=this._range=Rl([Zn(a[0],o,l,!0),Zn(a[1],o,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=Rl(i.slice()),o=this._size;fe([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:o[1]/2-m/2})},this),n.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:o[1]});var s={x:a[0],width:a[1]-a[0]};n.moveHandle&&(n.moveHandle.setShape(s),n.moveZone.setShape(s),n.moveZone.getBoundingRect(),n.moveHandleIcon&&n.moveHandleIcon.attr("x",s.x+s.width/2));for(var l=n.dataShadowSegs,u=[0,a[0],a[1],o[0]],h=0;hn[0]||i[1]<0||i[1]>n[1])){var a=this._handleEnds,o=(a[0]+a[1])/2,s=this._updateInterval("all",i[0]-o);this._updateView(),s&&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 o=this._getViewExtent(),s=[0,100],l=this._handleEnds=[i.x,i.x+i.width],u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();i2(0,l,o,0,u.minSpan!=null?Zn(u.minSpan,s,o,!0):null,u.maxSpan!=null?Zn(u.maxSpan,s,o,!0):null),this._range=Rl([Zn(l[0],o,s,!0),Zn(l[1],o,s,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(r){this._brushing&&(by(r.event),this._updateBrushRect(r.offsetX,r.offsetY))},e.prototype._updateBrushRect=function(r,n){var i=this._displayables,a=this.dataZoomModel,o=i.brushRect;o||(o=i.brushRect=new r7({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),i.sliderGroup.add(o)),o.attr("ignore",!1);var s=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(r,n),h=l.transformCoordToLocal(s.x,s.y),d=this._size;u[0]=Math.max(Math.min(d[0],u[0]),0),o.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?XJr:null,start:n[0],end:n[1]})},e.prototype._findCoordRect=function(){var r,n=Y1t(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(),o=this.api.getHeight();r={x:a*.2,y:o*.2,width:a*.6,height:o*.6}}return r},e.type="dataZoom.slider",e}(Rye);function txt(t,e,r,n){var i=t.get("labelFormatter"),a=t.get("labelPrecision");(a==null||a==="auto")&&(a=r.valuePrecision);var o=r.value[e],s=o==null||isNaN(o)?"":Xc(n)||J8(n)?n.getLabel({value:Math.round(o)}):isFinite(a)?Yn(o,a,!0):o+"";return ur(i)?i(o,s):$t(i)?i.replace("{value}",s):s}function ZJr(t){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[t]}function JJr(t){return t==="vertical"?"ns-resize":"ew-resize"}function rxt(t){t.registerComponentModel(HJr),t.registerComponentView(KJr),Dye(t)}function een(t){Xr(Jbt),Xr(rxt)}var nxt={get:function(t,e,r){var n=lr((ten[t]||{})[e]);return r&&ft(n)?n[n.length-1]:n}},ten={color:{active:["#006edd","#e0ffff"],inactive:[tt.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]}},ixt=ol.mapVisual,ren=ol.eachVisual,nen=ft,a1e=fe,ien=Rl,aen=Zn,dj=function(t){nt(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&&Tbt(i,r,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(r){var n=this.stateList;r=Wt(r,this),this.controllerVisuals=zye(this.option.controller,n,r),this.targetVisuals=zye(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 a1e(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,o=this.option.seriesIndex;o==null&&a==null&&(o="all");var s=I_(this.ecModel,"series",{index:o,id:a},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return vt(s,function(l){return l.componentIndex})},e.prototype.eachTargetSeries=function(r,n){fe(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,o=a.precision,s=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($t(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]===s[0]?i[0]+" "+h[1]:r[1]===s[1]?i[1]+" "+h[0]:h[0]+" - "+h[1];return h;function d(f){return f===s[0]?"min":f===s[1]?"max":(+f).toFixed(Math.min(o,20))}},e.prototype.resetExtent=function(){var r=this.option,n=ien([r.min,r.max]);this._dataExtent=n},e.prototype.getDimension=function(r){var n=this,i=this.option.seriesTargets;if(i){var a=py(i,function(o){return o.seriesIndex!=null&&o.seriesIndex===r||o.seriesId!=null&&o.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,o=a.length-1;o>=0;o--){var s=a[o],l=r.getDimensionInfo(s);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={}),o=n.controller||(n.controller={});Qr(a,i),Qr(o,i);var s=this.isCategory();l.call(this,a),l.call(this,o),u.call(this,a,"inRange","outOfRange"),h.call(this,o);function l(d){nen(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]={},a1e(g,function(v,y){if(ol.isValidType(y)){var b=nxt.get(y,"inactive",s);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";a1e(this.stateList,function(y){var b=this.itemSize,x=d[y];x||(x=d[y]={color:s?g:[g]}),x.symbol==null&&(x.symbol=f&&lr(f)||(s?v:[v])),x.symbolSize==null&&(x.symbolSize=p&&lr(p)||(s?b[0]:[b[0],b[0]])),x.symbol=ixt(x.symbol,function(S){return S==="none"?v:S});var w=x.symbolSize;if(w!=null){var A=-1/0;ren(w,function(S){S>A&&(A=S)}),x.symbolSize=ixt(w,function(S){return aen(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:tt.color.transparent,borderColor:tt.color.borderTint,contentColor:tt.color.theme[0],inactiveColor:tt.color.disabled,borderWidth:0,padding:tt.size.m,textGap:10,precision:0,textStyle:{color:tt.color.secondary}},e}(pn),axt=[20,140],oen=function(t){nt(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]=axt[0]),(r[1]==null||isNaN(r[1]))&&(r[1]=axt[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),fe(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=Rl((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=[],o=i.getData();o.each(this.getDataDimensionIndex(o),function(s,l){r[0]<=s&&s<=r[1]&&a.push(l)},this),n.push({seriesId:i.id,dataIndex:a})},this),n},e.prototype.getVisualMeta=function(r){var n=oxt(this,"outOfRange",this.getExtent()),i=oxt(this,"inRange",this.option.range.slice()),a=[];function o(p,g){a.push({value:p,color:r(p,g)})}for(var s=0,l=0,u=i.length,h=n.length;lr[1])break;a.push({color:this.getControllerVisual(l,"color",n),offset:s/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 gr(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,o=i.handleThumbs,s=i.handleLabels,l=a.itemSize,u=a.getExtent(),h=this._applyTransform("left",i.mainGroup);sen([0,1],function(d){var f=o[d];f.setStyle("fill",n.handlesColor[d]),f.y=r[d];var p=u0(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=fg(i.handleLabelPoints[d],kS(f,this.group));if(this._orient==="horizontal"){var v=h==="left"||h==="top"?(l[0]-g)/2:(l[0]-g)/-2;m[1]+=v}s[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 o=this.visualMapModel,s=o.getExtent(),l=o.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=u0(r,s,u,!0),v=l[0]-g/2,y={x:d.x,y:d.y};d.y=m,d.x=v;var b=fg(h.indicatorLabelPoint,kS(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||"")+o.formatValueText(n),verticalAlign:S?w:"middle",align:S?"center":w});var T={x:v,y:m,style:{fill:p}},C={style:{x:b[0],y:b[1]}};if(o.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(C,k)}else d.attr(T),x.attr(C);this._firstShowIndicator=!1;var E=this._shapes.handleLabels;if(E)for(var _=0;_o[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||dxt(i))&&(p=this._hoverLinkDataIndices=i.findTargetDataIndices(d));var g=d6r(f,p);this._dispatchHighDown("downplay",fj(g[0],i)),this._dispatchHighDown("highlight",fj(g[1],i))}},e.prototype._hoverLinkFromSeriesMouseOver=function(r){var n;if(VS(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 o=i.getData(n.dataType),s=o.getStore().get(a.getDataDimensionIndex(o),n.dataIndex);isNaN(s)||this._showIndicator(s,s)}}},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=o,n.push(a))}}),t.getData().setVisual("visualMeta",n)}}];function gen(t,e,r,n){for(var i=e.targetVisuals[n],a=ol.prepareVisualTypes(i),o={color:G8(t.getData(),"color")},s=0,l=a.length;s0:e.splitNumber>0)||e.calculable)?"continuous":"piecewise"}),t.registerAction(den,fen),fe(pen,function(e){t.registerVisual(t.PRIORITY.VISUAL.COMPONENT,e)}),t.registerPreprocessor(men))}function vxt(t){t.registerComponentModel(oen),t.registerComponentView(uen),mxt(t)}var ven=function(t){nt(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=[],yen[this._mode].call(this,this._pieceList),this._resetSelected(r,n);var a=this.option.categories;this.resetVisual(function(o,s){i==="categories"?(o.mappingMethod="category",o.categories=lr(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=vt(this._pieceList,function(l){return l=lr(l),s!=="inRange"&&(l.visual=null),l}))})},e.prototype.completeVisualOption=function(){var r=this.option,n={},i=ol.listVisualTypes(),a=this.isCategory();fe(r.pieces,function(s){fe(i,function(l){s.hasOwnProperty(l)&&(n[l]=1)})}),fe(n,function(s,l){var u=!1;fe(this.stateList,function(h){u=u||o(r,h,l)||o(r.target,h,l)},this),!u&&fe(this.stateList,function(h){(r[h]||(r[h]={}))[l]=nxt.get(l,h==="inRange"?"active":"inactive",a)})},this);function o(s,l,u){return s&&s[l]&&s[l].hasOwnProperty(u)}t.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(r,n){var i=this.option,a=this._pieceList,o=(n?i:r).selected||{};if(i.selected=o,fe(a,function(l,u){var h=this.getSelectedMapKey(l);o.hasOwnProperty(h)||(o[h]=!0)},this),i.selectedMode==="single"){var s=!1;fe(a,function(l,u){var h=this.getSelectedMapKey(l);o[h]&&(s?o[h]=!1:s=!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=ol.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 o=[],s=a.getData();s.each(this.getDataDimensionIndex(s),function(l,u){var h=ol.findPieceIndex(l,i);h===r&&o.push(u)},this),n.push({seriesId:a.id,dataIndex:o})},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 o(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 s=this._pieceList.slice();if(!s.length)s.push({interval:[-1/0,1/0]});else{var l=s[0].interval[0];l!==-1/0&&s.unshift({interval:[-1/0,l]}),l=s[s.length-1].interval[1],l!==1/0&&s.push({interval:[l,1/0]})}var u=-1/0;return fe(s,function(h){var d=h.interval;d&&(d[0]>u&&o([u,d[0]],"outOfRange"),o(d.slice()),u=d[1])},this),{stops:n,outerColors:i}},e.type="visualMap.piecewise",e.defaultOption=Hx(dj.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}(dj),yen={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 o=0,s=n[0];o","≥"][n[0]]];r.text=r.text||this.formatValueText(r.value!=null?r.value:r.interval,!1,i)},this)}};function yxt(t,e){var r=t.inverse;(t.orient==="vertical"?!r:r)&&e.reverse()}var ben=function(t){nt(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,o=this._getItemAlign(),s=n.itemSize,l=this._getViewData(),u=l.endsText,h=Gc(n.get("showLabel",!0),!u),d=!n.get("selectedMode");u&&this._renderEndsText(r,u[0],s,h,o),fe(l.viewPieceList,function(f){var p=f.piece,g=new gr;g.onclick=Wt(this._onItemClick,this,p),this._enableHoverLink(g,f.indexInModelPieceList);var m=n.getRepresentValue(p);if(this._createItemSymbol(g,m,[0,0,s[0],s[1]],d),h){var v=this.visualMapModel.getValueState(m),y=a.get("align")||o;g.add(new $n({style:ji(a,{x:y==="right"?-i:s[0]+i,y:s[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],s,h,o),IS(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(o){var s=i.visualMapModel;s.option.hoverLink&&i.api.dispatchAction({type:o,batch:fj(s.findTargetDataIndices(n),s)})}},e.prototype._getItemAlign=function(){var r=this.visualMapModel,n=r.option;if(n.orient==="vertical")return cxt(r,this.api,r.itemSize);var i=n.align;return(!i||i==="auto")&&(i="left"),i},e.prototype._renderEndsText=function(r,n,i,a,o){if(n){var s=new gr,l=this.visualMapModel.textStyleModel;s.add(new $n({style:ji(l,{x:a?o==="right"?i[0]:0:i[0]/2,y:i[1]/2,verticalAlign:"middle",align:a?o:"center",text:n})})),r.add(s)}},e.prototype._getViewData=function(){var r=this.visualMapModel,n=vt(r.getPieceList(),function(s,l){return{piece:s,indexInModelPieceList:l}}),i=r.get("text"),a=r.get("orient"),o=r.get("inverse");return(a==="horizontal"?o:!o)?n.reverse():i&&(i=i.slice().reverse()),{viewPieceList:n,endsText:i}},e.prototype._createItemSymbol=function(r,n,i,a){var o=Yo(this.getControllerVisual(n,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(n,"color"));o.silent=a,r.add(o)},e.prototype._onItemClick=function(r){var n=this.visualMapModel,i=n.option,a=i.selectedMode;if(a){var o=lr(i.selected),s=n.getSelectedMapKey(r);a==="single"||a===!0?(o[s]=!0,fe(o,function(l,u){o[u]=u===s})):o[s]=!o[s],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}},e.type="visualMap.piecewise",e}(sxt);function bxt(t){t.registerComponentModel(ven),t.registerComponentView(ben),mxt(t)}function xen(t){Xr(vxt),Xr(bxt)}var wen=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:iut(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}(),Aen=function(t){nt(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 wen(this);if(this._target=null,this.ecModel.eachSeries(function(i){Svt(i,null)}),this.shouldShow()){var n=this.getTarget();Svt(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:tt.color.border,borderWidth:2},windowStyle:{borderWidth:1,color:tt.color.neutral30,borderColor:tt.color.neutral40,opacity:.3},z:10},e}(pn),Sen=function(t){nt(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 lq),!this._isEnabled()){this._clear();return}this._renderVersion=i.getECUpdateCycleVersion();var a=this.group;a.removeAll();var o=r.getModel("itemStyle"),s=o.getItemStyle();s.fill==null&&(s.fill=n.get("backgroundColor")||tt.color.neutral00);var l=Ps(r,i).refContainer,u=ba(Nut(r,!0),l),h=s.lineWidth||0,d=this._contentRect=ES(u.clone(),h/2,!0,!0),f=new gr;a.add(f),f.setClipPath(new nn({shape:d.plain()}));var p=this._targetGroup=new gr;f.add(p);var g=u.plain();g.r=o.getShallow("borderRadius",!0),a.add(this._bgRect=new nn({style:s,shape:g,silent:!1,cursor:"grab"}));var m=r.getModel("windowStyle"),v=m.getShallow("borderRadius",!0);f.add(this._windowRect=new nn({shape:{x:0,y:0,width:0,height:0,r:v},style:m.getItemStyle(),silent:!1,cursor:"grab"})),this._dealRenderContent(),this._dealUpdateWindow(),wxt(r,this)},e.prototype.renderContent=function(r){this._bridgeRendered=r,this._isEnabled()&&(this._dealRenderContent(),this._dealUpdateWindow(),wxt(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 o=r.group,s=o.getBoundingRect();n.add(o),this._bgRect.z2=r.z2Range.min-10,dq(i,s.x,s.y,s.width,s.height);var l=ba({left:"center",top:"center",aspect:s.width/s.height},a);fq(i,l.x,l.y,l.width,l.height),DB(o,i,pT),o.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=$d([],r.targetTrans),i=Bd([],uq(null,this._coordSys),n);this._transThisToTarget=$d([],i);var a=r.viewportRect;a?a=a.clone():a=new pr(0,0,this._api.getWidth(),this._api.getHeight()),a.applyTransform(i);var o=this._windowRect,s=o.shape.r;o.setShape(mr({r:s},a))}},e.prototype._resetRoamController=function(r){var n=this,i=this._api,a=this._roamController;if(a||(a=this._roamController=new hT(i.getZr())),!r||!this._isEnabled()){a.disable();return}a.enable(r,{api:i,zInfo:{component:this._model},triggerInfo:{roamTrigger:null,isInSelf:function(o,s,l){return n._contentRect.contain(s,l)}}}),a.off("pan").off("zoom").on("pan",Wt(this._onPan,this)).on("zoom",Wt(this._onZoom,this))},e.prototype._onPan=function(r){var n=this._transThisToTarget;if(!(!this._isEnabled()||!n)){var i=io([],[r.oldX,r.oldY],n),a=io([],[r.oldX-r.dx,r.oldY-r.dy],n);this._api.dispatchAction(xxt(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=io([],[r.originX,r.originY],n);this._api.dispatchAction(xxt(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}(Xi);function xxt(t,e){var r=t.mainType==="series"?t.subType+"Roam":t.mainType+"Roam",n={type:r};return n[t.mainType+"Id"]=t.id,lt(n,e),n}function wxt(t,e){var r=_S(t);OW(e.group,r.z,r.zlevel)}function Ten(t){t.registerComponentModel(Aen),t.registerComponentView(Sen)}var Cen={label:{enabled:!0},decal:{show:!1}},Axt=Gr(),Sxt=Gr(),Oen=d8(ken);function ken(t,e){var r=t.getModel("aria");if(!r.get("enabled"))return;var n=Sxt(t).scope||(Sxt(t).scope={}),i=lr(Cen);Qr(i.label,t.getLocaleModel().get("aria"),!1),Qr(r.option,i,!1),a(),o();function a(){var h=r.getModel("decal"),d=h.get("show");if(d){var f=qt();t.eachSeries(function(p){p.isColorBySeries()||(Axt(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=hge(p.ecModel,p.name,n,t.getSeriesCount()),w=g.getVisual("decal");g.setVisual("decal",A(w,x))}else{var m=p.getRawData(),v={},y=Axt(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],C=m.getName(S)||S+"",k=hge(p.ecModel,C,y,b),E=g.getItemVisual(T,"decal");g.setItemVisual(T,"decal",A(E,k))})}function A(S,T){var C=S?lt(lt({},T),S):T;return C.dirty=!0,C}})}}function o(){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=s(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+=s(A,{seriesCount:p}),t.eachSeries(function(k,E){if(E1?f.get(["series","multiple",L]):f.get(["series","single",L]),_=s(_,{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"]);_+=s(D,{displayCnt:g})}else _+=f.get(["data","allData"]);for(var M=f.get(["data","separator","middle"]),I=f.get(["data","separator","end"]),N=f.get(["data","excludeDimensionId"]),F=[],B=0;B":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},Ren=function(){function t(e){var r=this._condVal=$t(e)?new RegExp(e):tst(e)?e:null;if(r==null){var n="";si(n)}}return t.prototype.evaluate=function(e){var r=typeof e;return $t(r)?this._condVal.test(e):Vn(r)?this._condVal.test(e+""):!1},t}(),Den=function(){function t(){}return t.prototype.evaluate=function(){return this.value},t}(),Len=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,I,N){var F=Math.abs(R-L),B=Math.tan(F/4)*4/3,V=RC:_2&&n.push(i),n}function c1e(t,e,r,n,i,a,o,s,l,u){if(X5(t,r)&&X5(e,n)&&X5(i,o)&&X5(a,s)){l.push(o,s);return}var h=2/u,d=h*h,f=o-t,p=s-e,g=Math.sqrt(f*f+p*p);f/=g,p/=g;var m=r-t,v=n-e,y=i-o,b=a-s,x=m*m+v*v,w=y*y+b*b;if(x=0&&C=0){l.push(o,s);return}var k=[],E=[];Lx(t,r,i,o,.5,k),Lx(e,n,a,s,.5,E),c1e(k[0],E[0],k[1],E[1],k[2],E[2],k[3],E[3],l,u),c1e(k[4],E[4],k[5],E[5],k[6],E[6],k[7],E[7],l,u)}function Wen(t,e){var r=l1e(t),n=[];e=e||1;for(var i=0;i0)for(var u=0;uMath.abs(u),d=kxt([l,u],h?0:1,e),f=(h?s:u)/d.length,p=0;pi,o=kxt([n,i],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",h=a?"y":"x",d=t[s]/o.length,f=0;f1?null:new wr(m*l+t,m*u+e)}function jen(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 K5(t,e){var r=t[t.length-1];r&&r[0]===e[0]&&r[1]===e[1]||t.push(e)}function Xen(t,e,r){for(var n=t.length,i=[],a=0;ao?(u.x=h.x=s+a/2,u.y=l,h.y=l+o):(u.y=h.y=l+o/2,u.x=s,h.x=s+a),Xen(e,u,h)}function pj(t,e,r,n){if(r===1)n.push(e);else{var i=Math.floor(r/2),a=t(e);pj(t,a[0],i,n),pj(t,a[1],r-i,n)}return n}function Ken(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),s+=u*u*(3*h^d),d===0&&(h===1&&(t=u-1-t,e=u-1-e),l=t,t=e,e=l)}return s}function vj(t){var e=1/0,r=1/0,n=-1/0,i=-1/0,a=vt(t,function(s){var l=s.getBoundingRect(),u=s.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]}),o=vt(a,function(s,l){return{cp:s,z:otn(s[0],s[1],e,r,n,i),path:t[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function Nxt(t){return etn(t.path,t.count)}function h1e(){return{fromIndividuals:[],toIndividuals:[],count:0}}function stn(t,e,r){var n=[];function i(A){for(var S=0;S=0;i--)if(!r[i].many.length){var l=r[s].many;if(l.length<=1)if(s)s=0;else return r;var a=l.length,u=Math.ceil(a/2);r[i].many=l.slice(u,a),r[s].many=l.slice(0,u),s++}return r}var ctn={clone:function(t){for(var e=[],r=1-Math.pow(1-t.path.style.opacity,1/t.count),n=0;n0))return;var s=n.getModel("universalTransition").get("delay"),l=lt({setToFinal:!0},o),u,h;Bxt(t)&&(u=t,h=e),Bxt(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 C=b?S[0]:T,k=b?T:S[0];if(gj(C))d({many:[C],one:k},!0,x,w,!0);else{var E=s?mr({delay:s(x,w)},l):l;u1e(C,k,E),a(C,k,C,k,E)}}else for(var _=mr({dividePath:ctn[r],individualDelay:s&&function(I,N,F,B){return s(I+x,w)}},l),P=b?stn(S,T,_):ltn(T,S,_),L=P.fromIndividuals,R=P.toIndividuals,D=L.length,M=0;Me.length,p=u?$xt(h,u):$xt(f?e:t,[f?t:e]),g=0,m=0;mFxt))for(var a=n.getIndices(),o=0;o0&&S.group.traverse(function(C){C instanceof yn&&!C.animators.length&&C.animateFrom({style:{opacity:0}},T)})})}function Hxt(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function Wxt(t){return ft(t)?t.sort().join(","):t}function d2(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function mtn(t,e){var r=qt(),n=qt(),i=qt();return fe(t.oldSeries,function(a,o){var s=t.oldDataGroupIds[o],l=t.oldData[o],u=Hxt(a),h=Wxt(u);n.set(h,{dataGroupId:s,data:l}),ft(u)&&fe(u,function(d){i.set(d,{key:h,dataGroupId:s,data:l})})}),fe(e.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var o=a.get("dataGroupId"),s=a.getData(),l=Hxt(a),u=Wxt(l),h=n.get(u);if(h)r.set(u,{oldSeries:[{dataGroupId:h.dataGroupId,divide:d2(h.data),data:h.data}],newSeries:[{dataGroupId:o,divide:d2(s),data:s}]});else if(ft(l)){var d=[];fe(l,function(g){var m=n.get(g);m.data&&d.push({dataGroupId:m.dataGroupId,divide:d2(m.data),data:m.data})}),d.length&&r.set(u,{oldSeries:d,newSeries:[{dataGroupId:o,data:s,divide:d2(s)}]})}else{var f=i.get(l);if(f){var p=r.get(f.key);p||(p={oldSeries:[{dataGroupId:f.dataGroupId,data:f.data,divide:d2(f.data)}],newSeries:[]},r.set(f.key,p)),p.newSeries.push({dataGroupId:o,data:s,divide:d2(s)})}}}}),r}function Yxt(t,e){for(var r=0;r=0&&i.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:d2(e.oldData[s]),groupIdDim:o.dimension})}),fe(qi(t.to),function(o){var s=Yxt(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:d2(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&Gxt(i,a,n)}function ytn(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){fe(qi(n.seriesTransition),function(i){fe(qi(i.to),function(a){for(var o=n.updatedSeries,s=0;ss.vmin?n+=s.vmin-i+(e-s.vmin)/(s.vmax-s.vmin)*s.gapReal:n+=e-i,i=s.vmax,a=!1;break}n+=s.vmin-i+s.gapReal,i=s.vmax}return a&&(n+=e-i),n},transformOut:function(e,r){if(r&&r.depth===By)return e;for(var n=qxt,i=jxt,a=!0,o=0,s=0;su?o=l.vmin+(e-u)/(h-u)*(l.vmax-l.vmin):o=i+e-n,i=l.vmax,a=!1;break}n=h,i=l.vmax}return a&&(o=i+e-n),o}},t}();function xtn(t,e){return new btn(t,e)}var qxt=0,jxt=0;function wtn(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()}};fe(t.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(r+=l.val);var u=g1e(s,e);if(u){var h=u.vmin!==s.vmin,d=u.vmax!==s.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/(s.vmax-s.vmin),a[p][l.type].val=l.val}else n[l.type].span+=f,n[l.type].val+=l.val}});var o=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));fe(t.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(s.gapReal=r!==0?rn(o,0)*l.val/r:0),l.type==="tpAbs"&&(s.gapReal=l.val),s.gapReal==null&&(s.gapReal=0)})}function Atn(t,e,r,n,i,a){t!=="no"&&fe(r,function(o){var s=g1e(o,a);if(s)for(var l=e.length-1;l>=0;l--){var u=e[l],h=n(u),d=i*3/4;h>s.vmin-d&&he[0]&&r=0&&o<1-1e-5}fe(t,function(o){if(!(!o||o.start==null||o.end==null)&&!o.isExpanded){var s={breakOption:lr(o),vmin:e.parse(o.start),vmax:e.parse(o.end),gapParsed:{type:"tpAbs",val:0},gapReal:null};if(o.gap!=null){var l=!1;if($t(o.gap)){var u=Nd(o.gap);if(u.match(/%$/)){var h=parseFloat(u)/100;i(h)||(h=0),s.gapParsed.type="tpPrct",s.gapParsed.val=h,l=!0}}if(!l){var d=e.parse(o.gap);(!isFinite(d)||d<0)&&(d=0),s.gapParsed.type="tpAbs",s.gapParsed.val=d}}if(s.vmin===s.vmax&&(s.gapParsed.type="tpAbs",s.gapParsed.val=0),r&&r.noNegative&&fe(["vmin","vmax"],function(p){s[p]<0&&(s[p]=0)}),s.vmin>s.vmax){var f=s.vmax;s.vmax=s.vmin,s.vmin=f}n.push(s)}}),n.sort(function(o,s){return o.vmin-s.vmin});var a=-1/0;return fe(n,function(o,s){a>o.vmin&&(n[s]=null),a=o.vmax}),{breaks:oi(n,function(o){return!!o})}}function v1e(t,e){return y1e(e)===y1e(t)}function y1e(t){return t.start+"_\0_"+t.end}function Ttn(t,e,r){var n=[];fe(t,function(a,o){var s=e(a);s&&s.type==="vmin"&&n.push([o])}),fe(t,function(a,o){var s=e(a);if(s&&s.type==="vmax"){var l=py(n,function(u){return v1e(e(t[u[0]]).parsedBreak.breakOption,s.parsedBreak.breakOption)});l&&l.push(o)}});var i=[];return fe(n,function(a){a.length===2&&i.push(r?a:[t[a[0]],t[a[1]]])}),i}function Ctn(t,e,r,n){if(e.break){var i=e.break.parsedBreak,a=py(r,function(h){return v1e(h.breakOption,e.break.parsedBreak.breakOption)}),o={lookup:n,depth:By},s=t.transformOut(i.vmin,o),l=t.transformOut(i.vmax,o),u={vmin:s,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 Otn(t,e,r,n,i){i.original=m1e(t,e,r);var a=i.transformed=m1e(t,e,r),o=i.lookup;a.breaks=vt(a.breaks,function(s,l){var u={depth:By},h=e.transformIn(s.vmin,u),d=e.transformIn(s.vmax,u),f={type:s.gapParsed.type,val:s.gapParsed.type==="tpAbs"?e.transformIn(s.vmin+s.gapParsed.val,u)-h:s.gapParsed.val};return o.from[n+l]=h,o.to[n+l]=s.vmin,o.from[n+l+1]=d,o.to[n+l+1]=s.vmax,{vmin:h,vmax:d,gapParsed:f,gapReal:s.gapReal,breakOption:s.breakOption}})}var ktn={vmin:"start",vmax:"end"};function Etn(t,e){return e&&(t=t||{},t.break={type:ktn[e.type],start:e.parsedBreak.vmin,end:e.parsedBreak.vmax}),t}function _tn(){E8r({createBreakScaleMapper:xtn,pruneTicksByBreak:Atn,addBreaksToTicks:Stn,parseAxisBreakOption:m1e,identifyAxisBreak:v1e,serializeAxisBreakIdentifier:y1e,retrieveAxisBreakPairs:Ttn,getTicksBreakOutwardTransform:Ctn,parseAxisBreakOptionInwardTransform:Otn,makeAxisLabelFormatterParamBreak:Etn})}var Xxt=Gr();function Rtn(t,e){var r=py(t,function(n){return Ho().identifyAxisBreak(n.parsedBreak.breakOption,e.breakOption)});return r||t.push(r={zigzagRandomList:[],parsedBreak:e,shouldRemove:!1}),r}function Dtn(t){fe(t,function(e){return e.shouldRemove=!0})}function Ltn(t){for(var e=t.length-1;e>=0;e--)t[e].shouldRemove&&t.splice(e,1)}function Mtn(t,e,r,n,i){var a=r.axis;if(a.scale.isBlank()||!Ho())return;var o=Ho().retrieveAxisBreakPairs(a.scale.getTicks({breakTicks:"only_break"}),function(k){return k.break},!1);if(!o.length)return;var s=r.getModel("breakArea"),l=s.get("zigzagAmplitude"),u=s.get("zigzagMinSpan"),h=s.get("zigzagMaxSpan");u=Math.max(2,u||0),h=Math.max(u,h||0);var d=s.get("expandOnClick"),f=s.get("zigzagZ"),p=s.getModel("itemStyle"),g=p.getItemStyle(),m=g.stroke,v=g.lineWidth,y=g.lineDash,b=g.fill,x=new gr({ignoreModelZ:!0}),w=a.isHorizontal(),A=Xxt(e).visualList||(Xxt(e).visualList=[]);Dtn(A);for(var S=function(k){var E=o[k][0].break.parsedBreak,_=[];_[0]=a.toGlobalCoord(a.dataToCoord(E.vmin,!0)),_[1]=a.toGlobalCoord(a.dataToCoord(E.vmax,!0)),_[1]<_[0]&&_.reverse();var P=Rtn(A,E);P.shouldRemove=!1;var L=new gr;C(P.zigzagRandomList,L,_[0],_[1],w,E),d&&L.on("click",function(){var R={type:QY,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;q&&(U=N);var Y=[],ne=[];Y[M]=_,ne[M]=P,!G&&!q&&(Y[M]+=z?-l:l,ne[M]-=z?l:-l),Y[I]=U,ne[I]=U,B.push(Y),V.push(ne);var X=void 0;if(Qb[1]&&b.reverse(),{coordPair:b,brkId:Ho().serializeAxisBreakIdentifier(y.breakOption)}});l.sort(function(v,y){return v.coordPair[0]-y.coordPair[0]});for(var u=o[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;s=(f-m)/h.x}var v=new wr,y=new wr;wr.scale(v,n,-s),wr.scale(y,n,1-s),Eme(r[0],v),Eme(r[1],y)}function Ntn(t,e){var r={breaks:[]};return fe(e.breaks,function(n){if(n){var i=py(t.get("breaks",!0),function(s){return Ho().identifyAxisBreak(s,n)});if(i){var a=e.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===QY?!0:a===Agt?!1:a===Sgt?!i.isExpanded:i.isExpanded,r.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}}),r}function Btn(){Jzr({adjustBreakLabelPair:Ptn,buildAxisBreakLine:Itn,rectCoordBuildBreakAxis:Mtn,updateModelAxisBreak:Ntn})}function $tn(t){nUr(t),_tn(),Btn()}function Ftn(){bVr(ztn)}function ztn(t,e){fe(t,function(r){if(!r.model.get(["axisLabel","inside"])){var n=Utn(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 Utn(t){var e=t.model,r=t.scale;if(!e.get(["axisLabel","show"])||r.isBlank())return;var n,i,a=r.getExtent();r instanceof eB?i=r.count():(n=r.getTicks(),i=n.length);var o=t.getLabelModel(),s=rB(t),l,u=1;i>40&&(u=Math.ceil(i/40));for(var h=0;hKxt(t,"name",{value:e,configurable:!0}),yj=(t,e)=>{for(var r in e)Kxt(t,r,{get:e[r],enumerable:!0})},Zxt={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Ti,function(){var r=1e3,n=6e4,i=36e5,a="millisecond",o="second",s="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 I=String(R);return!I||I.length>=D?R:""+Array(D+1-I.length).join(M)+R},w={s:x,z:function(R){var D=-R.utcOffset(),M=Math.abs(D),I=Math.floor(M/60),N=M%60;return(D<=0?"+":"-")+x(I,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!I&&N&&(A=N),N||!I&&A},E=function(R,D){if(C(R))return R.clone();var M=typeof D=="object"?D:{};return M.date=R,M.args=arguments,new P(M)},_=w;_.l=k,_.i=C,_.w=function(R,D){return E(R,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var P=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(I){var N=I.date,F=I.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,I){var N=E(M);return this.startOf(I)<=N&&N<=this.endOf(I)},D.isAfter=function(M,I){return E(M){},"trace"),debug:O((...t)=>{},"debug"),info:O((...t)=>{},"info"),warn:O((...t)=>{},"warn"),error:O((...t)=>{},"error"),fatal:O((...t)=>{},"fatal")},b1e=O(function(t="fatal"){let e=Yy.fatal;typeof t=="string"?t.toLowerCase()in Yy&&(e=Yy[t]):typeof t=="number"&&(e=t),ye.trace=()=>{},ye.debug=()=>{},ye.info=()=>{},ye.warn=()=>{},ye.error=()=>{},ye.fatal=()=>{},e<=Yy.fatal&&(ye.fatal=console.error?console.error.bind(console,gp("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",gp("FATAL"))),e<=Yy.error&&(ye.error=console.error?console.error.bind(console,gp("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",gp("ERROR"))),e<=Yy.warn&&(ye.warn=console.warn?console.warn.bind(console,gp("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",gp("WARN"))),e<=Yy.info&&(ye.info=console.info?console.info.bind(console,gp("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",gp("INFO"))),e<=Yy.debug&&(ye.debug=console.debug?console.debug.bind(console,gp("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",gp("DEBUG"))),e<=Yy.trace&&(ye.trace=console.debug?console.debug.bind(console,gp("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",gp("TRACE")))},"setLogLevel"),gp=O(t=>`%c${Pl().format("ss.SSS")} : ${t} : `,"format");const bj={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 bj.hue2rgb(a,i,t+1/3)*255;case"g":return bj.hue2rgb(a,i,t)*255;case"b":return bj.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),o=(i+a)/2;if(n==="l")return o*100;if(i===a)return 0;const s=i-a,l=o>.5?s/(2-i-a):s/(i+a);if(n==="s")return l*100;switch(i){case t:return((e-r)/s+(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}`}}},f2={};for(let t=0;t<=255;t++)f2[t]=Cn.unit.dec2hex(t);const Zc={ALL:0,RGB:1,HSL:2};let Gtn=class{constructor(){this.type=Zc.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=Zc.ALL}is(e){return this.type===e}};class Htn{constructor(e,r){this.color=r,this.changed=!1,this.data=e,this.type=new Gtn}set(e,r){return this.color=r,this.changed=!1,this.data=e,this.type.type=Zc.ALL,this}_ensureHSL(){const e=this.data,{h:r,s:n,l:i}=e;r===void 0&&(e.h=Cn.channel.rgb2hsl(e,"h")),n===void 0&&(e.s=Cn.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=Cn.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r,g:n,b:i}=e;r===void 0&&(e.r=Cn.channel.hsl2rgb(e,"r")),n===void 0&&(e.g=Cn.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=Cn.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,r=e.r;return!this.type.is(Zc.HSL)&&r!==void 0?r:(this._ensureHSL(),Cn.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,r=e.g;return!this.type.is(Zc.HSL)&&r!==void 0?r:(this._ensureHSL(),Cn.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,r=e.b;return!this.type.is(Zc.HSL)&&r!==void 0?r:(this._ensureHSL(),Cn.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,r=e.h;return!this.type.is(Zc.RGB)&&r!==void 0?r:(this._ensureRGB(),Cn.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,r=e.s;return!this.type.is(Zc.RGB)&&r!==void 0?r:(this._ensureRGB(),Cn.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,r=e.l;return!this.type.is(Zc.RGB)&&r!==void 0?r:(this._ensureRGB(),Cn.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(Zc.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(Zc.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(Zc.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(Zc.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(Zc.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(Zc.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const xj=new Htn({r:0,g:0,b:0,a:0},"transparent"),J5={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(J5.re);if(!e)return;const r=e[1],n=parseInt(r,16),i=r.length,a=i%4===0,o=i>4,s=o?1:17,l=o?8:4,u=a?0:-1,h=o?255:15;return xj.set({r:(n>>l*(u+3)&h)*s,g:(n>>l*(u+2)&h)*s,b:(n>>l*(u+1)&h)*s,a:a?(n&h)*s/255:1},t)},stringify:t=>{const{r:e,g:r,b:n,a:i}=t;return i<1?`#${f2[Math.round(e)]}${f2[Math.round(r)]}${f2[Math.round(n)]}${f2[Math.round(i*255)]}`:`#${f2[Math.round(e)]}${f2[Math.round(r)]}${f2[Math.round(n)]}`}},_T={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(_T.hueRe);if(e){const[,r,n]=e;switch(n){case"grad":return Cn.channel.clamp.h(parseFloat(r)*.9);case"rad":return Cn.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return Cn.channel.clamp.h(parseFloat(r)*360)}}return Cn.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const r=t.match(_T.re);if(!r)return;const[,n,i,a,o,s]=r;return xj.set({h:_T._hue2deg(n),s:Cn.channel.clamp.s(parseFloat(i)),l:Cn.channel.clamp.l(parseFloat(a)),a:o?Cn.channel.clamp.a(s?parseFloat(o)/100:parseFloat(o)):1},t)},stringify:t=>{const{h:e,s:r,l:n,a:i}=t;return i<1?`hsla(${Cn.lang.round(e)}, ${Cn.lang.round(r)}%, ${Cn.lang.round(n)}%, ${i})`:`hsl(${Cn.lang.round(e)}, ${Cn.lang.round(r)}%, ${Cn.lang.round(n)}%)`}},a7={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=a7.colors[t];if(e)return J5.parse(e)},stringify:t=>{const e=J5.stringify(t);for(const r in a7.colors)if(a7.colors[r]===e)return r}},o7={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(o7.re);if(!r)return;const[,n,i,a,o,s,l,u,h]=r;return xj.set({r:Cn.channel.clamp.r(i?parseFloat(n)*2.55:parseFloat(n)),g:Cn.channel.clamp.g(o?parseFloat(a)*2.55:parseFloat(a)),b:Cn.channel.clamp.b(l?parseFloat(s)*2.55:parseFloat(s)),a:u?Cn.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(${Cn.lang.round(e)}, ${Cn.lang.round(r)}, ${Cn.lang.round(n)}, ${Cn.lang.round(i)})`:`rgb(${Cn.lang.round(e)}, ${Cn.lang.round(r)}, ${Cn.lang.round(n)})`}},wg={format:{keyword:a7,hex:J5,rgb:o7,rgba:o7,hsl:_T,hsla:_T},parse:t=>{if(typeof t!="string")return t;const e=J5.parse(t)||o7.parse(t)||_T.parse(t)||a7.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(Zc.HSL)||t.data.r===void 0?_T.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?o7.stringify(t):J5.stringify(t)},Jxt=(t,e)=>{const r=wg.parse(t);for(const n in e)r[n]=Cn.channel.clamp[n](e[n]);return wg.stringify(r)},Ag=(t,e,r=0,n=1)=>{if(typeof t!="number")return Jxt(t,{a:e});const i=xj.set({r:Cn.channel.clamp.r(t),g:Cn.channel.clamp.g(e),b:Cn.channel.clamp.b(r),a:Cn.channel.clamp.a(n)});return wg.stringify(i)},x1e=(t,e)=>Cn.lang.round(wg.parse(t)[e]),Wtn=t=>{const{r:e,g:r,b:n}=wg.parse(t),i=.2126*Cn.channel.toLinear(e)+.7152*Cn.channel.toLinear(r)+.0722*Cn.channel.toLinear(n);return Cn.lang.round(i)},Ytn=t=>Wtn(t)>=.5,Fu=t=>!Ytn(t),w1e=(t,e,r)=>{const n=wg.parse(t),i=n[e],a=Cn.channel.clamp[e](i+r);return i!==a&&(n[e]=a),wg.stringify(n)},ht=(t,e)=>w1e(t,"l",e),dt=(t,e)=>w1e(t,"l",-e),e2t=(t,e)=>w1e(t,"a",-e),Ae=(t,e)=>{const r=wg.parse(t),n={};for(const i in e)e[i]&&(n[i]=r[i]+e[i]);return Jxt(t,n)},qtn=(t,e,r=50)=>{const{r:n,g:i,b:a,a:o}=wg.parse(t),{r:s,g:l,b:u,a:h}=wg.parse(e),d=r/100,f=d*2-1,p=o-h,m=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,v=1-m,y=n*m+s*v,b=i*m+l*v,x=a*m+u*v,w=o*d+h*(1-d);return Ag(y,b,x,w)},it=(t,e=100)=>{const r=wg.parse(t);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,qtn(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 t2t(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:Bs(BigInt.prototype.toString),c2t=typeof Symbol>"u"?null:Bs(Symbol.prototype.toString),Qh=Bs(Object.prototype.hasOwnProperty),u7=Bs(Object.prototype.toString),Jc=Bs(RegExp.prototype.test),DT=lrn(TypeError);function Bs(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]:l7;if(n2t&&n2t(t,null),!tR(e))return t;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=r(i);a!==i&&(ern(e)||(e[n]=a),i=a)}t[i]=!0}return t}function crn(t){for(let e=0;e/g),mrn=Nl(/\${[\w\W]*/g),vrn=Nl(/^data-[\-\w.\u00B7-\uFFFF]+$/),yrn=Nl(/^aria-[\-\w]+$/),p2t=Nl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),brn=Nl(/^(?:\w+script|data):/i),xrn=Nl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),wrn=Nl(/^html$/i),Arn=Nl(/^[a-z][.\w]*(-[.\w]+)+$/i),g2t=Nl(/<[/\w!]/g),m2t=Nl(/<[/\w]/g),Srn=Nl(/<\/no(script|embed|frames)/i),Trn=Nl(/\/>/i),qd={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},v2t=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Crn=sl(Pi({},v2t)),Orn=function(){const t={};return RT(v2t,e=>{t[e]=Nl(new RegExp("])","i"))}),sl(t)}(),krn=function(){return typeof window>"u"?null:window},Ern=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(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},y2t=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},p2=function(e,r,n,i){return Qh(e,r)&&tR(e[r])?Pi(i.base?Yd(i.base):{},e[r],i.transform):n},_1e=function(e,r,n){const i=Qh(e,r)?e[r]:void 0;return i&&typeof i=="object"?Yd(i):n()};function b2t(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:krn();const e=Ht=>b2t(Ht);if(e.version="3.4.14",e.removed=[],!t||!t.document||t.document.nodeType!==qd.document||!t.Element)return e.isSupported=!1,e;let r=t.document;const n=r,i=n.currentScript;t.DocumentFragment;const a=t.HTMLTemplateElement,o=t.Node,s=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=s.prototype,p=Sg(f,"cloneNode"),g=Sg(f,"remove"),m=Sg(f,"nextSibling"),v=Sg(f,"childNodes"),y=Sg(f,"parentNode"),b=Sg(f,"shadowRoot"),x=Sg(f,"attributes"),w=o&&o.prototype?Sg(o.prototype,"nodeType"):null,A=o&&o.prototype?Sg(o.prototype,"nodeName"):null,S=o&&o.prototype?Sg(o.prototype,"ownerDocument"):null,T=function(Ve){return w?w(Ve):Ve.nodeType},C=function(Ve){return A?A(Ve):Ve.nodeName};if(typeof a=="function"){const Ht=r.createElement("template");Ht.content&&Ht.content.ownerDocument&&(r=Ht.content.ownerDocument)}let k,E="",_,P=!1,L=0;const R=function(){if(L>0)throw DT('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(Ve){R(),L++;try{return k.createHTML(Ve)}finally{L--}},M=function(Ve){R(),L++;try{return k.createScriptURL(Ve)}finally{L--}},I=function(){return P||(_=Ern(d,i),P=!0),_},N=r,F=N.implementation,B=N.createNodeIterator,V=N.createDocumentFragment,z=N.getElementsByTagName,U=n.importNode;let Q=y2t();e.isSupported=typeof r2t=="function"&&typeof y=="function"&&F&&F.createHTMLDocument!==void 0;const G=prn,q=grn,Y=mrn,ne=vrn,X=yrn,J=brn,ee=xrn,te=Arn;let pe=p2t,ie=null;const Ce=Pi({},[...u2t,...C1e,...O1e,...k1e,...h2t]);let ke=null;const Ee=Pi({},[...d2t,...E1e,...f2t,...wj]);let ue=Object.seal(eR(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}})),de=null,xe=null;const ge=Object.seal(eR(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ze=!0,we=!0,Oe=!1,Be=!0,Z=!1,le=!0,be=!1,ae=!1,K=null,se=null,me=!1,oe=!1,ve=!1,ce=!1,De=!0,Le=!1;const We="user-content-";let Ne=!0,je=!1,$e={},Ze=null;const He=Pi({},["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 et=null;const Pe=Pi({},["audio","video","img","source","image","track"]);let yt=null;const Ie=Pi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),St="http://www.w3.org/1998/Math/MathML",kt="http://www.w3.org/2000/svg",ut="http://www.w3.org/1999/xhtml";let Gt=ut,It=!1,gt=null;const Te=Pi({},[St,kt,ut],T1e),Bt=sl(["mi","mo","mn","ms","mtext"]);let Et=Pi({},Bt);const At=sl(["annotation-xml"]);let Mt=Pi({},At);const qr=Pi({},["title","style","font","a","script"]);let Me=null;const at=["application/xhtml+xml","text/html"],wt="text/html";let Tt=null,dr=null;const jr=r.createElement("form"),Ir=function(Ve){return Ve instanceof RegExp||Ve instanceof Function},Zr=function(){let Ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(dr&&dr===Ve)return;(!Ve||typeof Ve!="object")&&(Ve={}),Ve=Yd(Ve),Me=at.indexOf(Ve.PARSER_MEDIA_TYPE)===-1?wt:Ve.PARSER_MEDIA_TYPE,Tt=Me==="application/xhtml+xml"?T1e:l7,ie=p2(Ve,"ALLOWED_TAGS",Ce,{transform:Tt}),ke=p2(Ve,"ALLOWED_ATTR",Ee,{transform:Tt}),gt=p2(Ve,"ALLOWED_NAMESPACES",Te,{transform:T1e}),yt=p2(Ve,"ADD_URI_SAFE_ATTR",Ie,{transform:Tt,base:Ie}),et=p2(Ve,"ADD_DATA_URI_TAGS",Pe,{transform:Tt,base:Pe}),Ze=p2(Ve,"FORBID_CONTENTS",He,{transform:Tt}),de=p2(Ve,"FORBID_TAGS",Yd({}),{transform:Tt}),xe=p2(Ve,"FORBID_ATTR",Yd({}),{transform:Tt}),$e=Qh(Ve,"USE_PROFILES")?Ve.USE_PROFILES&&typeof Ve.USE_PROFILES=="object"?Yd(Ve.USE_PROFILES):Ve.USE_PROFILES:!1,ze=Ve.ALLOW_ARIA_ATTR!==!1,we=Ve.ALLOW_DATA_ATTR!==!1,Oe=Ve.ALLOW_UNKNOWN_PROTOCOLS||!1,Be=Ve.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Z=Ve.SAFE_FOR_TEMPLATES||!1,le=Ve.SAFE_FOR_XML!==!1,be=Ve.WHOLE_DOCUMENT||!1,oe=Ve.RETURN_DOM||!1,ve=Ve.RETURN_DOM_FRAGMENT||!1,ce=Ve.RETURN_TRUSTED_TYPE||!1,me=Ve.FORCE_BODY||!1,De=Ve.SANITIZE_DOM!==!1,Le=Ve.SANITIZE_NAMED_PROPS||!1,Ne=Ve.KEEP_CONTENT!==!1,je=Ve.IN_PLACE||!1,pe=hrn(Ve.ALLOWED_URI_REGEXP)?Ve.ALLOWED_URI_REGEXP:p2t,Gt=typeof Ve.NAMESPACE=="string"?Ve.NAMESPACE:ut,Et=_1e(Ve,"MATHML_TEXT_INTEGRATION_POINTS",()=>Pi({},Bt)),Mt=_1e(Ve,"HTML_INTEGRATION_POINTS",()=>Pi({},At));const ot=_1e(Ve,"CUSTOM_ELEMENT_HANDLING",()=>eR(null));if(ue=eR(null),Qh(ot,"tagNameCheck")&&Ir(ot.tagNameCheck)&&(ue.tagNameCheck=ot.tagNameCheck),Qh(ot,"attributeNameCheck")&&Ir(ot.attributeNameCheck)&&(ue.attributeNameCheck=ot.attributeNameCheck),Qh(ot,"allowCustomizedBuiltInElements")&&typeof ot.allowCustomizedBuiltInElements=="boolean"&&(ue.allowCustomizedBuiltInElements=ot.allowCustomizedBuiltInElements),Nl(ue),Z&&(we=!1),ve&&(oe=!0),$e&&(ie=Pi({},h2t),ke=eR(null),$e.html===!0&&(Pi(ie,u2t),Pi(ke,d2t)),$e.svg===!0&&(Pi(ie,C1e),Pi(ke,E1e),Pi(ke,wj)),$e.svgFilters===!0&&(Pi(ie,O1e),Pi(ke,E1e),Pi(ke,wj)),$e.mathMl===!0&&(Pi(ie,k1e),Pi(ke,f2t),Pi(ke,wj))),ge.tagCheck=null,ge.attributeCheck=null,Qh(Ve,"ADD_TAGS")&&(typeof Ve.ADD_TAGS=="function"?ge.tagCheck=Ve.ADD_TAGS:tR(Ve.ADD_TAGS)&&(ie===Ce&&(ie=Yd(ie)),Pi(ie,Ve.ADD_TAGS,Tt))),Qh(Ve,"ADD_ATTR")&&(typeof Ve.ADD_ATTR=="function"?ge.attributeCheck=Ve.ADD_ATTR:tR(Ve.ADD_ATTR)&&(ke===Ee&&(ke=Yd(ke)),Pi(ke,Ve.ADD_ATTR,Tt))),Qh(Ve,"ADD_FORBID_CONTENTS")&&tR(Ve.ADD_FORBID_CONTENTS)&&(Ze===He&&(Ze=Yd(Ze)),Pi(Ze,Ve.ADD_FORBID_CONTENTS,Tt)),Ne&&(ie["#text"]=!0),be&&Pi(ie,["html","head","body"]),ie.table&&(Pi(ie,["tbody"]),delete de.tbody),Ve.TRUSTED_TYPES_POLICY){if(typeof Ve.TRUSTED_TYPES_POLICY.createHTML!="function")throw DT('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Ve.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw DT('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Nt=k;k=Ve.TRUSTED_TYPES_POLICY;try{E=D("")}catch(ar){throw k=Nt,ar}}else Ve.TRUSTED_TYPES_POLICY===null?(k=void 0,E=""):(k===void 0&&(k=I()),k&&typeof E=="string"&&(E=D("")));sl&&sl(Ve),dr=Ve},Ur=Pi({},[...C1e,...O1e,...drn]),kn=Pi({},[...k1e,...frn]),$r=function(Ve,ot,Nt){return ot.namespaceURI===ut?Ve==="svg":ot.namespaceURI===St?Ve==="svg"&&(Nt==="annotation-xml"||Et[Nt]):!!Ur[Ve]},dn=function(Ve,ot,Nt){return ot.namespaceURI===ut?Ve==="math":ot.namespaceURI===kt?Ve==="math"&&Mt[Nt]:!!kn[Ve]},ii=function(Ve,ot,Nt){return ot.namespaceURI===kt&&!Mt[Nt]||ot.namespaceURI===St&&!Et[Nt]?!1:!kn[Ve]&&(qr[Ve]||!Ur[Ve])},pt=function(Ve){let ot=y(Ve);(!ot||!ot.tagName)&&(ot={namespaceURI:Gt,tagName:"template"});const Nt=l7(Ve.tagName),ar=l7(ot.tagName);return gt[Ve.namespaceURI]?Ve.namespaceURI===kt?$r(Nt,ot,ar):Ve.namespaceURI===St?dn(Nt,ot,ar):Ve.namespaceURI===ut?ii(Nt,ot,ar):!!(Me==="application/xhtml+xml"&>[Ve.namespaceURI]):!1},Ct=function(Ve){s7(e.removed,{element:Ve});try{y(Ve).removeChild(Ve)}catch{if(g(Ve),!y(Ve))throw DT("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},or=function(Ve,ot,Nt){try{Ve.removeAttributeNode(ot)}catch{try{Ve.removeAttribute(Nt)}catch{}}},Jr=function(Ve){Ot(Ve);const ot=v(Ve);if(ot){const ar=[];RT(ot,Vr=>{s7(ar,Vr)}),RT(ar,Vr=>{try{g(Vr)}catch{}})}const Nt=x(Ve);if(Nt)for(let ar=Nt.length-1;ar>=0;--ar){const Vr=Nt[ar],Rn=Vr&&Vr.name;typeof Rn=="string"&&or(Ve,Vr,Rn)}},Mn=function(Ve,ot,Nt){if(!Nt)try{Nt=ot.getAttributeNode(Ve)}catch{Nt=null}s7(e.removed,{attribute:Nt||null,from:ot});try{Nt?ot.removeAttributeNode(Nt):ot.removeAttribute(Ve)}catch{try{ot.removeAttribute(Ve)}catch{}}if(Ve==="is")if(oe||ve)try{Ct(ot)}catch{}else try{ot.setAttribute(Ve,"")}catch{}},Rt=function(Ve){const ot=x(Ve);if(ot)for(let Nt=ot.length-1;Nt>=0;--Nt){const ar=ot[Nt],Vr=ar&&ar.name;typeof Vr!="string"||ke[Tt(Vr)]||or(Ve,ar,Vr)}},Ot=function(Ve){const ot=[Ve];for(;ot.length>0;){const Nt=ot.pop();T(Nt)===qd.element&&Rt(Nt);const Vr=v(Nt);if(Vr)for(let Rn=Vr.length-1;Rn>=0;--Rn)ot.push(Vr[Rn])}},Vt=function(Ve,ot){return le?Ve==="patchsrc"?!0:Ve==="for"&&ot!=="label"&&ot!=="output":!1},mt=function(Ve){if(!le)return;const ot=[Ve];for(;ot.length>0;){const Nt=ot.pop(),ar=T(Nt);if(ar===qd.processingInstruction||ar===qd.comment&&Jc(m2t,Nt.data)){try{g(Nt)}catch{}continue}if(ar===qd.element){const Rn=Nt,Ya=Tt(C(Nt));try{Rn.hasAttribute&&Rn.hasAttribute("patchsrc")&&Rn.removeAttribute("patchsrc"),Rn.hasAttribute&&Rn.hasAttribute("for")&&Vt("for",Ya)&&Rn.removeAttribute("for")}catch{}}const Vr=v(Nt);if(Vr)for(let Rn=Vr.length-1;Rn>=0;--Rn)ot.push(Vr[Rn])}},Tr=function(Ve){let ot=null,Nt=null;if(me)Ve=""+Ve;else{const Rn=o2t(Ve,/^[\r\n\t ]+/);Nt=Rn&&Rn[0]}Me==="application/xhtml+xml"&&Gt===ut&&(Ve=''+Ve+"");const ar=k?D(Ve):Ve;if(Gt===ut)try{ot=new h().parseFromString(ar,Me)}catch{}if(!ot||!ot.documentElement){ot=F.createDocument(Gt,"template",null);try{ot.documentElement.innerHTML=It?E:ar}catch{}}const Vr=ot.body||ot.documentElement;return Ve&&Nt&&Vr.insertBefore(r.createTextNode(Nt),Vr.childNodes[0]||null),Gt===ut?z.call(ot,be?"html":"body")[0]:be?ot.documentElement:Vr},Fe=function(Ve){const ot=S?S(Ve):Ve.ownerDocument;return B.call(ot||Ve,Ve,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},ta=function(Ve){return Ve=c7(Ve,G," "),Ve=c7(Ve,q," "),Ve=c7(Ve,Y," "),Ve},Qe=function(Ve){var ot;Ve.normalize();const Nt=S?S(Ve):Ve.ownerDocument,ar=B.call(Nt||Ve,Ve,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let Vr=ar.nextNode();for(;Vr;)Vr.data=ta(Vr.data),Vr=ar.nextNode();const Rn=(ot=Ve.querySelectorAll)===null||ot===void 0?void 0:ot.call(Ve,"template");Rn&&RT(Rn,Ya=>{hi(Ya.content)&&Qe(Ya.content)})},In=function(Ve){const ot=A?A(Ve):null;return typeof ot!="string"||Tt(ot)!=="form"?!1:typeof Ve.nodeName!="string"||typeof Ve.textContent!="string"||typeof Ve.removeChild!="function"||Ve.attributes!==x(Ve)||typeof Ve.removeAttribute!="function"||typeof Ve.setAttribute!="function"||typeof Ve.namespaceURI!="string"||typeof Ve.insertBefore!="function"||typeof Ve.hasChildNodes!="function"||Ve.nodeType!==w(Ve)||Ve.childNodes!==v(Ve)},hi=function(Ve){if(!w||typeof Ve!="object"||Ve===null)return!1;try{return w(Ve)===qd.documentFragment}catch{return!1}},Bo=function(Ve){if(!w||typeof Ve!="object"||Ve===null)return!1;try{return typeof w(Ve)=="number"}catch{return!1}};function Gn(Ht,Ve,ot){Ht.length!==0&&RT(Ht,Nt=>{Nt.call(e,Ve,ot,dr)})}const fa=function(Ve,ot){return!!(le&&Ve.hasChildNodes()&&!Bo(Ve.firstElementChild)&&Jc(g2t,Ve.textContent)&&Jc(g2t,Ve.innerHTML)||le&&Ve.namespaceURI===ut&&Crn[ot]&&(Bo(Ve.firstElementChild)||typeof Ve.textContent=="string"&&Jc(Orn[ot],Ve.textContent))||Ve.nodeType===qd.processingInstruction||le&&Ve.nodeType===qd.comment&&Jc(m2t,Ve.data))},di=function(Ve,ot){if(Ve instanceof RegExp)return Jc(Ve,ot);if(Ve instanceof Function){for(var Nt=arguments.length,ar=new Array(Nt>2?Nt-2:0),Vr=2;Vr=0;--Ya){const $o=Ve===Nt?p(Vr[Ya],!0):Vr[Ya];ar.insertBefore($o,m(Ve))}}}return Ct(Ve),!0},sm=function(Ve,ot,Nt,ar){return Ve.length===0?ot:ot===Nt||ot===ar?Yd(ot):ot},Ov=function(Ve,ot){return Ve===ot||y(Ve)!==null?!1:(je&&Ot(Ve),!0)},Sk=function(Ve,ot){if(Gn(Q.beforeSanitizeElements,Ve,null),Ov(Ve,ot))return!0;if(In(Ve))return Ct(Ve),!0;const Nt=Tt(C(Ve));if(ie=sm(Q.uponSanitizeElement,ie,Ce,K),Gn(Q.uponSanitizeElement,Ve,{tagName:Nt,allowedTags:ie}),Ov(Ve,ot))return!0;if(fa(Ve,Nt))return Ct(Ve),!0;if(de[Nt]||!(ge.tagCheck instanceof Function&&ge.tagCheck(Nt))&&!ie[Nt]){const Vr=vu(Ve,Nt,ot);return Vr===!1&&Gn(Q.afterSanitizeElements,Ve,null),Vr}if(T(Ve)===qd.element&&!pt(Ve)||(Nt==="noscript"||Nt==="noembed"||Nt==="noframes")&&Jc(Srn,Ve.innerHTML))return Ct(Ve),!0;if(Z&&Ve.nodeType===qd.text){const Vr=ta(Ve.textContent);Ve.textContent!==Vr&&(s7(e.removed,{element:Ve.cloneNode()}),Ve.textContent=Vr)}return Gn(Q.afterSanitizeElements,Ve,null),!1},Tk=function(Ve,ot,Nt){if(xe[ot]||Vt(ot,Ve)||De&&(ot==="id"||ot==="name")&&(Nt in r||Nt in jr))return!1;const ar=ke[ot]||ge.attributeCheck instanceof Function&&ge.attributeCheck(ot,Ve);return we&&Jc(ne,ot)||ze&&Jc(X,ot)?!0:ar?yt[ot]||Jc(pe,c7(Nt,ee,""))||(ot==="src"||ot==="xlink:href"||ot==="href")&&Ve!=="script"&&s2t(Nt,"data:")===0&&et[Ve]||Oe&&!Jc(J,c7(Nt,ee,""))?!0:!Nt:xl(Ve)&&di(ue.tagNameCheck,Ve)&&di(ue.attributeNameCheck,ot,Ve)||ot==="is"&&ue.allowCustomizedBuiltInElements&&di(ue.tagNameCheck,Nt)},Ck=Pi({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),xl=function(Ve){return!Ck[l7(Ve)]&&Jc(te,Ve)},gd=function(Ve,ot,Nt,ar){if(k&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!Nt)switch(d.getAttributeType(Ve,ot)){case"TrustedHTML":return D(ar);case"TrustedScriptURL":return M(ar)}return ar},$c=function(Ve,ot,Nt,ar){try{Nt?Ve.setAttributeNS(Nt,ot,ar):Ve.setAttribute(ot,ar),In(Ve)?Ct(Ve):a2t(e.removed)}catch{Mn(ot,Ve)}},Zs=function(Ve){Gn(Q.beforeSanitizeAttributes,Ve,null);const ot=Ve.attributes;if(!ot||In(Ve))return;ke=sm(Q.uponSanitizeAttribute,ke,Ee,se);const Nt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ke,forceKeepAttr:void 0};let ar=ot.length;const Vr=Tt(Ve.nodeName);for(;ar--;){const Rn=ot[ar],Ya=Rn.name,$o=Rn.namespaceURI,md=Rn.value,vd=Tt(Ya),HMe=md;let xh=Ya==="value"?HMe:arn(HMe);if(Nt.attrName=vd,Nt.attrValue=xh,Nt.keepAttr=!0,Nt.forceKeepAttr=void 0,Gn(Q.uponSanitizeAttribute,Ve,Nt),xh=Nt.attrValue,Le&&(vd==="id"||vd==="name")&&s2t(xh,We)!==0&&(Mn(Ya,Ve,Rn),xh=We+xh),le&&Jc(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,xh)){Mn(Ya,Ve,Rn);continue}if(vd==="attributename"&&o2t(xh,"href")){Mn(Ya,Ve,Rn);continue}if(!Nt.forceKeepAttr){if(!Nt.keepAttr){Mn(Ya,Ve,Rn);continue}if(!Be&&Jc(Trn,xh)){Mn(Ya,Ve,Rn);continue}if(Z&&(xh=ta(xh)),!Tk(Vr,vd,xh)){Mn(Ya,Ve,Rn);continue}xh=gd(Vr,vd,$o,xh),xh!==HMe&&$c(Ve,Ya,$o,xh)}}Gn(Q.afterSanitizeAttributes,Ve,null)},Of=function(Ve){let ot=null;const Nt=Fe(Ve);for(Gn(Q.beforeSanitizeShadowDOM,Ve,null);ot=Nt.nextNode();)if(Gn(Q.uponSanitizeShadowNode,ot,null),Sk(ot,Ve),Zs(ot),hi(ot.content)&&Of(ot.content),T(ot)===qd.element){const ar=b(ot);hi(ar)&&(Yw(ar),Of(ar))}Gn(Q.afterSanitizeShadowDOM,Ve,null)},Yw=function(Ve){const ot=[{node:Ve,shadow:null}];for(;ot.length>0;){const Nt=ot.pop();if(Nt.shadow){Of(Nt.shadow);continue}const ar=Nt.node,Rn=T(ar)===qd.element,Ya=v(ar);if(Ya)for(let $o=Ya.length-1;$o>=0;--$o)ot.push({node:Ya[$o],shadow:null});if(Rn){const $o=A?A(ar):null;if(typeof $o=="string"&&Tt($o)==="template"){const md=ar.content;hi(md)&&ot.push({node:md,shadow:null})}}if(Rn){const $o=b(ar);hi($o)&&ot.push({node:null,shadow:$o},{node:$o,shadow:null})}}};return e.sanitize=function(Ht){let Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ot=null,Nt=null,ar=null,Vr=null;if(It=!Ht,It&&(Ht=""),typeof Ht!="string"&&!Bo(Ht)&&(Ht=urn(Ht),typeof Ht!="string"))throw DT("dirty is not a string, aborting");if(!e.isSupported)return Ht;ae?(ie=K,ke=se):Zr(Ve),(Q.uponSanitizeElement.length>0||Q.uponSanitizeAttribute.length>0)&&(ie=Yd(ie)),Q.uponSanitizeAttribute.length>0&&(ke=Yd(ke)),e.removed=[];const Rn=je&&typeof Ht!="string"&&Bo(Ht);if(Rn){mt(Ht);const md=C(Ht);if(typeof md=="string"){const vd=Tt(md);if(!ie[vd]||de[vd])throw Jr(Ht),DT("root node is forbidden and cannot be sanitized in-place")}if(In(Ht))throw Jr(Ht),DT("root node is clobbered and cannot be sanitized in-place");try{Yw(Ht)}catch(vd){throw Jr(Ht),vd}}else if(Bo(Ht))ot=Tr(""),Nt=ot.ownerDocument.importNode(Ht,!0),Nt.nodeType===qd.element&&Nt.nodeName==="BODY"||Nt.nodeName==="HTML"?ot=Nt:ot.appendChild(Nt),Yw(Nt);else{if(!oe&&!Z&&!be&&Ht.indexOf("<")===-1)return k&&ce?D(Ht):Ht;if(ot=Tr(Ht),!ot)return oe?null:ce?E:""}ot&&me&&Ct(ot.firstChild);const Ya=Rn?Ht:ot;try{const md=Fe(Ya);for(;ar=md.nextNode();)Sk(ar,Ya),Zs(ar),hi(ar.content)&&Of(ar.content)}catch(md){throw Rn&&(Jr(Ht),RT(e.removed,vd=>{vd.element&&Ot(vd.element)})),md}if(Rn)return RT(e.removed,md=>{md.element&&Ot(md.element)}),Z&&Qe(Ht),Ht;if(oe){if(Z&&Qe(ot),ve)for(Vr=V.call(ot.ownerDocument);ot.firstChild;)Vr.appendChild(ot.firstChild);else Vr=ot;return(ke.shadowroot||ke.shadowrootmode)&&(Vr=U.call(n,Vr,!0)),Vr}let $o=be?ot.outerHTML:ot.innerHTML;return be&&ie["!doctype"]&&ot.ownerDocument&&ot.ownerDocument.doctype&&ot.ownerDocument.doctype.name&&Jc(wrn,ot.ownerDocument.doctype.name)&&($o=" +`+$o),Z&&($o=ta($o)),k&&ce?D($o):$o},e.setConfig=function(){let Ht=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zr(Ht),ae=!0,K=ie,se=ke},e.clearConfig=function(){dr=null,ae=!1,K=null,se=null,k=_,E=""},e.isValidAttribute=function(Ht,Ve,ot){dr||Zr({});const Nt=Tt(Ht),ar=Tt(Ve);return Tk(Nt,ar,ot)},e.addHook=function(Ht,Ve){typeof Ve=="function"&&Qh(Q,Ht)&&s7(Q[Ht],Ve)},e.removeHook=function(Ht,Ve){if(Qh(Q,Ht)){if(Ve!==void 0){const ot=nrn(Q[Ht],Ve);return ot===-1?void 0:irn(Q[Ht],ot,1)[0]}return a2t(Q[Ht])}},e.removeHooks=function(Ht){Qh(Q,Ht)&&(Q[Ht]=[])},e.removeAllHooks=function(){Q=y2t()},e}var qy=b2t(),R1e=O((t,e,{depth:r=2}={})=>{const n={depth:r};if(Array.isArray(e)&&!Array.isArray(t))return e.forEach(i=>R1e(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,o])=>{if(typeof o=="object"){if(o===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(o)?[]:{}),typeof i[a]=="object"&&(i[a]=R1e(i[a],o,{depth:r-1}))}else typeof i[a]!="object"&&(Object.hasOwn(t,a)?i[a]=o:Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}))})}return t},"assignWithDepth"),$s=R1e,d0="#ffffff",f0="#f2f2f2",xn=O((t,e)=>e?Ae(t,{s:-40,l:10}):Ae(t,{s:-40,l:-10}),"mkBorder"),_rn=(UD=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,o,s,l,u,h,d,f,p,g,m,v,y,b,x,w,A,S,T,C,k,E,_,P,L,R,D,M,I,N,F,B,V,z,U,Q,G,q,Y,ne,X,J,ee,te,pe,ie;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||Ae(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Ae(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||xn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||xn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||xn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||it(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||it(this.tertiaryColor),this.lineColor=this.lineColor||it(this.background),this.arrowheadColor=this.arrowheadColor||it(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||it(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||Ae(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Ae(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Ae(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Ae(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Ae(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Ae(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||Ae(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Ae(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Ae(this.primaryColor,{h:330}),this.darkMode)for(let Ce=0;Ce{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},O(UD,"Theme"),UD),Rrn=O(t=>{const e=new _rn;return e.calculate(t),e},"getThemeVariables"),Drn=(VD=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ht(this.primaryColor,16),this.tertiaryColor=Ae(this.primaryColor,{h:-160}),this.primaryBorderColor=it(this.background),this.secondaryBorderColor=xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=xn(this.tertiaryColor,this.darkMode),this.primaryTextColor=it(this.primaryColor),this.secondaryTextColor=it(this.secondaryColor),this.tertiaryTextColor=it(this.tertiaryColor),this.lineColor=it(this.background),this.textColor=it(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ht(it("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Ag(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=Ag(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Ag(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,o,s,l,u,h,d,f,p,g,m,v,y,b,x,w,A,S,T,C,k,E,_,P,L,R,D,M,I,N,F,B,V,z,U,Q,G,q,Y,ne,X,J,ee,te,pe;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=it(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=Ae(this.primaryColor,{h:64}),this.fillType3=Ae(this.secondaryColor,{h:64}),this.fillType4=Ae(this.primaryColor,{h:-64}),this.fillType5=Ae(this.secondaryColor,{h:-64}),this.fillType6=Ae(this.primaryColor,{h:128}),this.fillType7=Ae(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||Ae(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Ae(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Ae(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Ae(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Ae(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Ae(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Ae(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Ae(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Ae(this.primaryColor,{h:330});for(let ie=0;ie{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},O(VD,"Theme"),VD),Lrn=O(t=>{const e=new Drn;return e.calculate(t),e},"getThemeVariables"),Mrn=(QD=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=Ae(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=Ae(this.primaryColor,{h:-160}),this.primaryBorderColor=xn(this.primaryColor,this.darkMode),this.secondaryBorderColor=xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=xn(this.tertiaryColor,this.darkMode),this.primaryTextColor=it(this.primaryColor),this.secondaryTextColor=it(this.secondaryColor),this.tertiaryTextColor=it(this.tertiaryColor),this.lineColor=it(this.background),this.textColor=it(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=xn(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=Ag(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,o,s,l,u,h,d,f,p,g,m,v,y,b,x,w,A,S,T,C,k,E,_,P,L,R,D,M,I,N,F,B,V,z,U,Q,G,q,Y,ne,X,J,ee,te,pe;this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||Ae(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Ae(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Ae(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Ae(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Ae(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Ae(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Ae(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Ae(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Ae(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||dt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||dt(this.tertiaryColor,40);for(let ie=0;ie{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]})}},O(QD,"Theme"),QD),jy=O(t=>{const e=new Mrn;return e.calculate(t),e},"getThemeVariables"),Irn=(GD=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=xn(this.primaryColor,this.darkMode),this.secondaryBorderColor=xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=xn(this.tertiaryColor,this.darkMode),this.primaryTextColor=it(this.primaryColor),this.secondaryTextColor=it(this.secondaryColor),this.tertiaryTextColor=it(this.primaryColor),this.lineColor=it(this.background),this.textColor=it(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,o,s,l,u,h,d,f,p,g,m,v,y,b,x,w,A,S,T,C,k,E,_,P,L,R,D,M,I,N,F,B,V,z,U,Q,G,q,Y,ne,X,J,ee,te,pe;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||Ae(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Ae(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Ae(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Ae(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Ae(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Ae(this.primaryColor,{h:210}),this.cScale9=this.cScale9||Ae(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Ae(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Ae(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||dt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||dt(this.tertiaryColor,40);for(let ie=0;ie{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},O(GD,"Theme"),GD),Prn=O(t=>{const e=new Irn;return e.calculate(t),e},"getThemeVariables"),Nrn=(HD=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=ht(this.contrast,55),this.background="#ffffff",this.tertiaryColor=Ae(this.primaryColor,{h:-160}),this.primaryBorderColor=xn(this.primaryColor,this.darkMode),this.secondaryBorderColor=xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=xn(this.tertiaryColor,this.darkMode),this.primaryTextColor=it(this.primaryColor),this.secondaryTextColor=it(this.secondaryColor),this.tertiaryTextColor=it(this.tertiaryColor),this.lineColor=it(this.background),this.textColor=it(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,o,s,l,u,h,d,f,p,g,m,v,y,b,x,w,A,S,T,C,k,E,_,P,L,R,D,M,I,N,F,B,V,z,U,Q,G,q,Y,ne,X,J,ee,te,pe;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 ie=0;ie{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},O(HD,"Theme"),HD),Brn=O(t=>{const e=new Nrn;return e.calculate(t),e},"getThemeVariables"),$rn=(WD=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=xn(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,o,s,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||Ae(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Ae(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||xn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||xn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||xn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||it(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||it(this.tertiaryColor),this.lineColor=this.lineColor||it(this.background),this.arrowheadColor=this.arrowheadColor||it(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||it(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=Ae(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||Ae(e,{h:30}),this.cScale4=this.cScale4||Ae(e,{h:60}),this.cScale5=this.cScale5||Ae(e,{h:90}),this.cScale6=this.cScale6||Ae(e,{h:120}),this.cScale7=this.cScale7||Ae(e,{h:150}),this.cScale8=this.cScale8||Ae(e,{h:210,l:150}),this.cScale9=this.cScale9||Ae(e,{h:270}),this.cScale10=this.cScale10||Ae(e,{h:300}),this.cScale11=this.cScale11||Ae(e,{h:330}),this.darkMode)for(let v=0;v{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},O(WD,"Theme"),WD),Frn=O(t=>{const e=new $rn;return e.calculate(t),e},"getThemeVariables"),zrn=(YD=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ht(this.primaryColor,16),this.tertiaryColor=Ae(this.primaryColor,{h:-160}),this.primaryBorderColor=it(this.background),this.secondaryBorderColor=xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=xn(this.tertiaryColor,this.darkMode),this.primaryTextColor=it(this.primaryColor),this.secondaryTextColor=it(this.secondaryColor),this.tertiaryTextColor=it(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ht(it("#323D47"),10),this.border1="#ccc",this.border2=Ag(255,255,255,.25),this.arrowheadColor=it(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,o,s,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||Ae(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Ae(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||xn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||xn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||xn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||it(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||it(this.tertiaryColor),this.lineColor=this.lineColor||it(this.background),this.arrowheadColor=this.arrowheadColor||it(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||it(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||Ae(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Ae(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Ae(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Ae(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Ae(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Ae(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||Ae(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Ae(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Ae(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},O(YD,"Theme"),YD),Urn=O(t=>{const e=new zrn;return e.calculate(t),e},"getThemeVariables"),Vrn=(qD=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=xn("#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,o,s,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||Ae(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Ae(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||xn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||xn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||xn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||it(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||it(this.tertiaryColor),this.lineColor=this.lineColor||it(this.background),this.arrowheadColor=this.arrowheadColor||it(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||it(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=Ae(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]})}},O(qD,"Theme"),qD),Qrn=O(t=>{const e=new Vrn;return e.calculate(t),e},"getThemeVariables"),Grn=(jD=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ht(this.primaryColor,16),this.tertiaryColor=Ae(this.primaryColor,{h:-160}),this.primaryBorderColor=it(this.background),this.secondaryBorderColor=xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=xn(this.tertiaryColor,this.darkMode),this.primaryTextColor=it(this.primaryColor),this.secondaryTextColor=it(this.secondaryColor),this.tertiaryTextColor=it(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ht(it("#323D47"),10),this.border1="#ccc",this.border2=Ag(255,255,255,.25),this.arrowheadColor=it(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,o,s,l,u,h,d,f;if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||Ae(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Ae(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||xn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||xn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||xn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||it(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||it(this.tertiaryColor),this.lineColor=this.lineColor||it(this.background),this.arrowheadColor=this.arrowheadColor||it(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||it(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||Ae(this.primaryColor,{h:30}),this.cScale4=this.cScale4||Ae(this.primaryColor,{h:60}),this.cScale5=this.cScale5||Ae(this.primaryColor,{h:90}),this.cScale6=this.cScale6||Ae(this.primaryColor,{h:120}),this.cScale7=this.cScale7||Ae(this.primaryColor,{h:150}),this.cScale8=this.cScale8||Ae(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||Ae(this.primaryColor,{h:270}),this.cScale10=this.cScale10||Ae(this.primaryColor,{h:300}),this.cScale11=this.cScale11||Ae(this.primaryColor,{h:330}),this.darkMode)for(let p=0;p{this[n]=e[n]}),this.updateColors(),r.forEach(n=>{this[n]=e[n]})}},O(jD,"Theme"),jD),Hrn=O(t=>{const e=new Grn;return e.calculate(t),e},"getThemeVariables"),Wrn=(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=xn(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,o,s,l,u,h,d,f,p,g,m;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||Ae(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Ae(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||xn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||xn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||xn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||it(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||it(this.tertiaryColor),this.lineColor=this.lineColor||it(this.background),this.arrowheadColor=this.arrowheadColor||it(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||it(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const e="#ECECFE",r="#E9E9F1",n=Ae(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]})}},O(XD,"Theme"),XD),Yrn=O(t=>{const e=new Wrn;return e.calculate(t),e},"getThemeVariables"),qrn=(KD=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=ht(this.primaryColor,16),this.tertiaryColor=Ae(this.primaryColor,{h:-160}),this.primaryBorderColor=it(this.background),this.secondaryBorderColor=xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=xn(this.tertiaryColor,this.darkMode),this.primaryTextColor=it(this.primaryColor),this.secondaryTextColor=it(this.secondaryColor),this.tertiaryTextColor=it(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=ht(it("#323D47"),10),this.border1="#ccc",this.border2=Ag(255,255,255,.25),this.arrowheadColor=it(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,o,s,l,u,h,d,f;this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||Ae(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||Ae(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||xn(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||xn(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||xn(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||xn(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||it(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||it(this.tertiaryColor),this.lineColor=this.lineColor||it(this.background),this.arrowheadColor=this.arrowheadColor||it(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||it(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]})}},O(KD,"Theme"),KD),jrn=O(t=>{const e=new qrn;return e.calculate(t),e},"getThemeVariables"),Xy={base:{getThemeVariables:Rrn},dark:{getThemeVariables:Lrn},default:{getThemeVariables:jy},forest:{getThemeVariables:Prn},neutral:{getThemeVariables:Brn},neo:{getThemeVariables:Frn},"neo-dark":{getThemeVariables:Urn},redux:{getThemeVariables:Qrn},"redux-dark":{getThemeVariables:Hrn},"redux-color":{getThemeVariables:Yrn},"redux-dark-color":{getThemeVariables:jrn}},yc={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},x2t={...yc,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES"},themeCSS:void 0,themeVariables:Xy.default.getThemeVariables(),sequence:{...yc.sequence,messageFont:O(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:O(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:O(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...yc.gantt,tickInterval:void 0,useWidth:void 0},c4:{...yc.c4,useWidth:void 0,personFont:O(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...yc.flowchart,inheritDir:!1},external_personFont:O(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:O(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:O(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:O(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:O(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:O(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:O(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:O(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:O(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:O(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:O(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:O(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:O(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:O(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:O(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:O(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:O(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:O(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:O(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:O(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:O(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...yc.pie,useWidth:984},xyChart:{...yc.xyChart,useWidth:void 0},requirement:{...yc.requirement,useWidth:void 0},packet:{...yc.packet},eventmodeling:{...yc.eventmodeling},treeView:{...yc.treeView,useWidth:void 0},radar:{...yc.radar},railroad:{...yc.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:{...yc.ishikawa},sankey:{...yc.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:{...yc.venn},cynefin:{...yc.cynefin}},w2t=O((t,e="")=>Object.keys(t).reduce((r,n)=>Array.isArray(t[n])?r:typeof t[n]=="object"&&t[n]!==null?[...r,e+n,...w2t(t[n],"")]:[...r,e+n],[]),"keyify"),Xrn=new Set(w2t(x2t,"")),Jn=x2t,Krn={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},Zrn=O((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))&&(ye.debug("sanitize deleting dictionary entry:",r,n),delete t[r])}},"sanitizeDictionaryConfig"),Aj=O(t=>{if(ye.debug("sanitizeDirective called with",t),!(typeof t!="object"||t==null)){if(Array.isArray(t)){t.forEach(e=>Aj(e));return}for(const e of Object.keys(t)){if(ye.debug("Checking key",e),e.startsWith("__")||e.includes("proto")||e.includes("constr")||!Xrn.has(e)||t[e]==null){ye.debug("sanitize deleting key: ",e),delete t[e];continue}if(typeof t[e]=="object"){const n=Krn[e];n?Zrn(t[e],n):(ye.debug("sanitizing object",e),Aj(t[e]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const n of r)e.includes(n)&&(ye.debug("sanitizing css option",e),t[e]=A2t(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]="")}ye.debug("After sanitization",t)}},"sanitizeDirective"),A2t=O(t=>{let e=0,r=0;for(const n of t){if(e!(t===!1||["false","null","0"].includes(String(t).trim().toLowerCase())),"evaluate"),Gh=$s({},rR),Sj,LT=[],h7=$s({},rR),d7=O((t,e)=>{let r=$s({},t),n={};for(const i of e)C2t(i),n=$s(n,i);if(r=$s(r,n),n.theme&&n.theme in Xy){const i=$s({},Sj),a=$s(i.themeVariables||{},n.themeVariables);r.theme&&r.theme in Xy&&(r.themeVariables=Xy[r.theme].getThemeVariables(a))}return h7=r,inn(h7),h7},"updateCurrentConfig"),Jrn=O(t=>(Gh=$s({},rR),Gh=$s(Gh,t),t.theme&&Xy[t.theme]&&(Gh.themeVariables=Xy[t.theme].getThemeVariables(t.themeVariables)),d7(Gh,LT),Gh),"setSiteConfig"),enn=O(t=>{Sj=$s({},t)},"saveConfigFromInitialize"),tnn=O(t=>(Gh=$s(Gh,t),d7(Gh,LT),Gh),"updateSiteConfig"),S2t=O(()=>$s({},Gh),"getSiteConfig"),T2t=O(t=>(d7(h7,[t]),Dr()),"setConfig"),Dr=O(()=>$s({},h7),"getConfig"),C2t=O(t=>{t&&(["secure",...Gh.secure??[]].forEach(e=>{Object.hasOwn(t,e)&&(ye.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"&&C2t(t[e])}))},"sanitize"),rnn=O(t=>{var e;Aj(t),t.fontFamily&&!((e=t.themeVariables)!=null&&e.fontFamily)&&(t.themeVariables={...t.themeVariables,fontFamily:t.fontFamily}),LT.push(t),d7(Gh,LT)},"addDirective"),Tj=O((t=Gh)=>{LT=[],d7(t,LT)},"reset"),nnn={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."},O2t={},k2t=O(t=>{O2t[t]||(ye.warn(nnn[t]),O2t[t]=!0)},"issueWarning"),inn=O(t=>{t&&(t.lazyLoadedDiagrams||t.loadExternalDiagramsAtStartup)&&k2t("LAZY_LOAD_DEPRECATED")},"checkConfig"),E2t=O(()=>{let t={};Sj&&(t=$s(t,Sj));for(const e of LT)t=$s(t,e);return t},"getUserDefinedConfig"),na=O(t=>{var e,r;return((e=t.flowchart)==null?void 0:e.htmlLabels)!=null&&k2t("FLOWCHART_HTML_LABELS_DEPRECATED"),p0(t.htmlLabels??((r=t.flowchart)==null?void 0:r.htmlLabels)??!0)},"getEffectiveHtmlLabels"),_2t=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,f7=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,ann=/\s*%%.*\n/gm,R2t=(ZD=class extends Error{constructor(e){super(e),this.name="UnknownDiagramError"}},O(ZD,"UnknownDiagramError"),ZD),MT={},D1e=O(function(t,e){t=t.replace(_2t,"").replace(f7,"").replace(ann,` +`);for(const[r,{detector:n}]of Object.entries(MT))if(n(t,e))return r;throw new R2t(`No diagram type detected matching given configuration for text: ${t}`)},"detectType"),L1e=O((...t)=>{for(const{id:e,detector:r,loader:n}of t)D2t(e,r,n)},"registerLazyLoadedDiagrams"),D2t=O((t,e,r)=>{MT[t]&&ye.warn(`Detector with key ${t} already exists. Overwriting.`),MT[t]={detector:e,loader:r},ye.debug(`Detector with key ${t} added${r?" with loader":""}`)},"addDetector"),onn=O(t=>MT[t].loader,"getDiagramLoader"),nR=//gi,snn=O(t=>t?P2t(t).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),lnn=(()=>{let t=!1;return()=>{t||(L2t(),t=!0)}})();function L2t(){const t="data-temp-href-target";qy.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute("target")&&e.setAttribute(t,e.getAttribute("target")??"")}),qy.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"))})}O(L2t,"setupDompurifyHooks");var M2t=O(t=>(lnn(),qy.sanitize(t)),"removeScript"),I2t=O((t,e)=>{if(na(e)){const r=e.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?t=M2t(t):r!=="loose"&&(t=P2t(t),t=t.replace(//g,">"),t=t.replace(/=/g,"="),t=dnn(t))}return t},"sanitizeMore"),li=O((t,e)=>t&&(e.dompurifyConfig?t=qy.sanitize(I2t(t,e),e.dompurifyConfig).toString():t=qy.sanitize(I2t(t,e),{FORBID_TAGS:["style"]}).toString(),t),"sanitizeText"),cnn=O((t,e)=>typeof t=="string"?li(t,e):t.flat().map(r=>li(r,e)),"sanitizeTextOrArray"),unn=O(t=>nR.test(t),"hasBreaks"),hnn=O(t=>t.split(nR),"splitBreaks"),dnn=O(t=>t.replace(/#br#/g,"
"),"placeholderToBreak"),P2t=O(t=>t.replace(nR,"#br#"),"breakToPlaceholder"),Cj=O(t=>{let e="";return t&&(e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,e=CSS.escape(e)),e},"getUrl"),fnn=O(function(...t){const e=t.filter(r=>!isNaN(r));return Math.max(...e)},"getMax"),pnn=O(function(...t){const e=t.filter(r=>!isNaN(r));return Math.min(...e)},"getMin"),g2=O(function(t){const e=t.split(/(,)/),r=[];for(let n=0;n0&&n+1Math.max(0,t.split(e).length-1),"countOccurrence"),gnn=O((t,e)=>{const r=M1e(t,"~"),n=M1e(e,"~");return r===1&&n===1},"shouldCombineSets"),mnn=O(t=>{const e=M1e(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"),N2t=O(()=>window.MathMLElement!==void 0,"isMathMLSupported"),I1e=/\$\$(.*?)\$\$/g,ps=O(t=>{var e;return(((e=t.match(I1e))==null?void 0:e.length)??0)>0},"hasKatex"),p7=O(async(t,e)=>{const r=document.createElement("div");r.innerHTML=await Oj(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"),vnn=O(async(t,e)=>{if(!ps(t))return t;if(!(N2t()||e.legacyMathML||e.forceLegacyMathML))return t.replace(I1e,"MathML is unsupported in this environment.");{const{default:r}=await Promise.resolve().then(()=>A5n),n=e.forceLegacyMathML||!N2t()&&e.legacyMathML?"htmlAndMathml":"mathml";return t.split(nR).map(i=>ps(i)?`
${i}
`:`
${i}
`).join("").replace(I1e,(i,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:n}).replace(/\n/g," ").replace(//g,""))}},"renderKatexUnsanitized"),Oj=O(async(t,e)=>li(await vnn(t,e),e),"renderKatexSanitized"),Xt={getRows:snn,sanitizeText:li,sanitizeTextOrArray:cnn,hasBreaks:unn,splitBreaks:hnn,lineBreakRegex:nR,removeScript:M2t,getUrl:Cj,evaluate:p0,getMax:fnn,getMin:pnn},ynn=O(function(t,e){for(let r of e)t.attr(r[0],r[1])},"d3Attrs"),bnn=O(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"),jo=O(function(t,e,r,n){const i=bnn(e,r,n);ynn(t,i)},"configureSvgSize"),iR=O(function(t,e,r,n){const i=e.node().getBBox(),a=i.width,o=i.height;ye.info(`SVG bounds: ${a}x${o}`,i);let s=0,l=0;ye.info(`Graph bounds: ${s}x${l}`,t),s=a+r*2,l=o+r*2,ye.info(`Calculated bounds: ${s}x${l}`),jo(e,l,s,n);const u=`${i.x-r} ${i.y-r} ${i.width+2*r} ${i.height+2*r}`;e.attr("viewBox",u)},"setupGraphViewbox"),kj={};function P1e(t){return[...t.cssRules].map(e=>e.cssText).join(` +`)}O(P1e,"cssStyleSheetToString");var xnn=O((t,e,r,n)=>{let i="";return t in kj&&kj[t]?i=kj[t]({...r,svgId:n}):ye.warn(`No theme found for ${t}`),`& { font-family: ${r.fontFamily}; font-size: ${r.fontSize}; fill: ${r.textColor} @@ -508,48 +508,48 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho } ${e} -`},"getStyles"),bnn=O((t,e)=>{e!==void 0&&(kj[t]=e)},"addStylesForDiagram"),xnn=ynn,N1e={};yj(N1e,{clear:()=>_a,getAccDescription:()=>lo,getAccTitle:()=>oo,getDiagramTitle:()=>$a,setAccDescription:()=>so,setAccTitle:()=>Ba,setDiagramTitle:()=>co});var B1e="",$1e="",F1e="",z1e=O(t=>li(t,Dr()),"sanitizeText"),_a=O(()=>{B1e="",F1e="",$1e=""},"clear"),Ba=O(t=>{B1e=z1e(t).replace(/^\s+/g,"")},"setAccTitle"),oo=O(()=>B1e,"getAccTitle"),so=O(t=>{F1e=z1e(t).replace(/\n\s+/g,` -`)},"setAccDescription"),lo=O(()=>F1e,"getAccDescription"),co=O(t=>{$1e=z1e(t)},"setDiagramTitle"),$a=O(()=>$1e,"getDiagramTitle"),P2t=ye,wnn=b1e,Ye=Dr,U1e=A2t,N2t=rR,V1e=O(t=>li(t,Ye()),"sanitizeText"),Q1e=iR,Ann=O(()=>N1e,"getCommonDb"),Ej={},_j=O((t,e,r)=>{var n;Ej[t]&&P2t.warn(`Diagram with id ${t} already registered. Overwriting.`),Ej[t]=e,r&&_2t(t,r),bnn(t,e.styles),(n=e.injectUtils)==null||n.call(e,P2t,wnn,Ye,V1e,Q1e,Ann(),()=>{})},"registerDiagram"),G1e=O(t=>{if(t in Ej)return Ej[t];throw new Snn(t)},"getDiagram"),Snn=(JD=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},O(JD,"DiagramNotFoundError"),JD);function Rj(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function Tnn(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function H1e(t){let e,r,n;t.length!==2?(e=Rj,r=(s,l)=>Rj(t(s),l),n=(s,l)=>t(s)-l):(e=t===Rj||t===Tnn?t:Cnn,r=t,n=t);function i(s,l,u=0,h=s.length){if(u>>1;r(s[d],l)<0?u=d+1:h=d}while(u>>1;r(s[d],l)<=0?u=d+1:h=d}while(uu&&n(s[d-1],l)>-n(s[d],l)?d-1:d}return{left:i,center:o,right:a}}function Cnn(){return 0}function Onn(t){return t===null?NaN:+t}const knn=H1e(Rj).right;H1e(Onn).center;class B2t extends Map{constructor(e,r=Rnn){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($2t(this,e))}has(e){return super.has($2t(this,e))}set(e,r){return super.set(Enn(this,e),r)}delete(e){return super.delete(_nn(this,e))}}function $2t({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function Enn({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function _nn({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function Rnn(t){return t!==null&&typeof t=="object"?t.valueOf():t}const Dnn=Math.sqrt(50),Lnn=Math.sqrt(10),Mnn=Math.sqrt(2);function Dj(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=Dnn?10:a>=Lnn?5:a>=Mnn?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/o,s=Math.round(t*u),l=Math.round(e*u),s/ue&&--l,u=-u):(u=Math.pow(10,i)*o,s=Math.round(t/u),l=Math.round(e/u),s*ue&&--l),l0))return[];if(t===e)return[t];const n=e=i))return[];const s=a-i+1,l=new Array(s);if(n)if(o<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 Nnn(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 Bnn(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 Vnn(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function Qnn(){return!this.__axis}function z2t(t,e){var r=[],n=null,i=null,a=6,o=6,s=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===Lj||t===Mj?-1:1,h=t===Mj||t===q1e?"x":"y",d=t===Lj||t===j1e?Fnn:znn;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):$nn),v=Math.max(a,0)+s,y=e.range(),b=+y[0]+l,x=+y[y.length-1]+l,w=(e.bandwidth?Vnn:Unn)(e.copy(),l),A=p.selection?p.selection():p,S=A.selectAll(".domain").data([null]),T=A.selectAll(".tick").data(g,e).order(),C=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===Lj?"0em":t===j1e?"0.71em":"0.32em")),p!==A&&(S=S.transition(p),T=T.transition(p),E=E.transition(p),_=_.transition(p),C=C.transition(p).attr("opacity",F2t).attr("transform",function(P){return isFinite(P=w(P))?d(P+l):this.getAttribute("transform")}),k.attr("opacity",F2t).attr("transform",function(P){var L=this.parentNode.__axis;return d((L&&isFinite(L=L(P))?L:w(P))+l)})),C.remove(),S.attr("d",t===Mj||t===q1e?o?"M"+u*o+","+b+"H"+l+"V"+x+"H"+u*o:"M"+l+","+b+"V"+x:o?"M"+b+","+u*o+"V"+l+"H"+x+"V"+u*o:"M"+b+","+l+"H"+x),T.attr("opacity",1).attr("transform",function(P){return d(w(P)+l)}),E.attr(h+"2",u*a),_.attr(h,u*v).text(m),A.filter(Qnn).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===q1e?"start":t===Mj?"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=o=+p,f):a},f.tickSizeInner=function(p){return arguments.length?(a=+p,f):a},f.tickSizeOuter=function(p){return arguments.length?(o=+p,f):o},f.tickPadding=function(p){return arguments.length?(s=+p,f):s},f.offset=function(p){return arguments.length?(l=+p,f):l},f}function Gnn(t){return z2t(Lj,t)}function Hnn(t){return z2t(j1e,t)}var Wnn={value:()=>{}};function U2t(){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}})}Ij.prototype=U2t.prototype={constructor:Ij,on:function(t,e){var r=this._,n=Ynn(t+"",r),i,a=-1,o=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)),Q2t.hasOwnProperty(e)?{space:Q2t[e],local:t}:t}function jnn(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===X1e&&e.documentElement.namespaceURI===X1e?e.createElement(t):e.createElementNS(r,t)}}function Xnn(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function G2t(t){var e=Pj(t);return(e.local?Xnn:jnn)(e)}function Knn(){}function K1e(t){return t==null?Knn:function(){return this.querySelector(t)}}function Znn(t){typeof t!="function"&&(t=K1e(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;)(o=n[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Sin(t){t||(t=Tin);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 Cin(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Oin(){return Array.from(this)}function kin(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?$in:typeof e=="function"?zin:Fin)(t,e,r??"")):aR(this.node(),t)}function aR(t,e){return t.style.getPropertyValue(e)||j2t(t).getComputedStyle(t,null).getPropertyValue(e)}function Vin(t){return function(){delete this[t]}}function Qin(t,e){return function(){this[t]=e}}function Gin(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function Hin(t,e){return arguments.length>1?this.each((e==null?Vin:typeof e=="function"?Gin:Qin)(t,e)):this.node()[t]}function X2t(t){return t.trim().split(/^|\s+/)}function Z1e(t){return t.classList||new K2t(t)}function K2t(t){this._node=t,this._names=X2t(t.getAttribute("class")||"")}K2t.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 Z2t(t,e){for(var r=Z1e(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function ban(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?Fj(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?Fj(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=Ean.exec(t))?new eu(e[1],e[2],e[3],1):(e=_an.exec(t))?new eu(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Ran.exec(t))?Fj(e[1],e[2],e[3],e[4]):(e=Dan.exec(t))?Fj(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Lan.exec(t))?cwt(e[1],e[2]/100,e[3]/100,1):(e=Man.exec(t))?cwt(e[1],e[2]/100,e[3]/100,e[4]):rwt.hasOwnProperty(t)?awt(rwt[t]):t==="transparent"?new eu(NaN,NaN,NaN,0):null}function awt(t){return new eu(t>>16&255,t>>8&255,t&255,1)}function Fj(t,e,r,n){return n<=0&&(t=e=r=NaN),new eu(t,e,r,n)}function owt(t){return t instanceof IT||(t=PT(t)),t?(t=t.rgb(),new eu(t.r,t.g,t.b,t.opacity)):new eu}function J1e(t,e,r,n){return arguments.length===1?owt(t):new eu(t,e,r,n??1)}function eu(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}m7(eu,J1e,Bj(IT,{brighter(t){return t=t==null?$j:Math.pow($j,t),new eu(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?v7:Math.pow(v7,t),new eu(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new eu(NT(this.r),NT(this.g),NT(this.b),zj(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:swt,formatHex:swt,formatHex8:Nan,formatRgb:lwt,toString:lwt}));function swt(){return`#${BT(this.r)}${BT(this.g)}${BT(this.b)}`}function Nan(){return`#${BT(this.r)}${BT(this.g)}${BT(this.b)}${BT((isNaN(this.opacity)?1:this.opacity)*255)}`}function lwt(){const t=zj(this.opacity);return`${t===1?"rgb(":"rgba("}${NT(this.r)}, ${NT(this.g)}, ${NT(this.b)}${t===1?")":`, ${t})`}`}function zj(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function NT(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function BT(t){return t=NT(t),(t<16?"0":"")+t.toString(16)}function cwt(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Tg(t,e,r,n)}function uwt(t){if(t instanceof Tg)return new Tg(t.h,t.s,t.l,t.opacity);if(t instanceof IT||(t=PT(t)),!t)return new Tg;if(t instanceof Tg)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),o=NaN,s=a-i,l=(a+i)/2;return s?(e===a?o=(r-n)/s+(r0&&l<1?0:o,new Tg(o,s,l,t.opacity)}function Ban(t,e,r,n){return arguments.length===1?uwt(t):new Tg(t,e,r,n??1)}function Tg(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}m7(Tg,Ban,Bj(IT,{brighter(t){return t=t==null?$j:Math.pow($j,t),new Tg(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?v7:Math.pow(v7,t),new Tg(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 eu(ebe(t>=240?t-240:t+120,i,n),ebe(t,i,n),ebe(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Tg(hwt(this.h),Uj(this.s),Uj(this.l),zj(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=zj(this.opacity);return`${t===1?"hsl(":"hsla("}${hwt(this.h)}, ${Uj(this.s)*100}%, ${Uj(this.l)*100}%${t===1?")":`, ${t})`}`}}));function hwt(t){return t=(t||0)%360,t<0?t+360:t}function Uj(t){return Math.max(0,Math.min(1,t||0))}function ebe(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 $an=Math.PI/180,Fan=180/Math.PI,Vj=18,dwt=.96422,fwt=1,pwt=.82521,gwt=4/29,sR=6/29,mwt=3*sR*sR,zan=sR*sR*sR;function vwt(t){if(t instanceof m0)return new m0(t.l,t.a,t.b,t.opacity);if(t instanceof Ky)return ywt(t);t instanceof eu||(t=owt(t));var e=ibe(t.r),r=ibe(t.g),n=ibe(t.b),i=tbe((.2225045*e+.7168786*r+.0606169*n)/fwt),a,o;return e===r&&r===n?a=o=i:(a=tbe((.4360747*e+.3850649*r+.1430804*n)/dwt),o=tbe((.0139322*e+.0971045*r+.7141733*n)/pwt)),new m0(116*i-16,500*(a-i),200*(i-o),t.opacity)}function Uan(t,e,r,n){return arguments.length===1?vwt(t):new m0(t,e,r,n??1)}function m0(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}m7(m0,Uan,Bj(IT,{brighter(t){return new m0(this.l+Vj*(t??1),this.a,this.b,this.opacity)},darker(t){return new m0(this.l-Vj*(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=dwt*rbe(e),t=fwt*rbe(t),r=pwt*rbe(r),new eu(nbe(3.1338561*e-1.6168667*t-.4906146*r),nbe(-.9787684*e+1.9161415*t+.033454*r),nbe(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function tbe(t){return t>zan?Math.pow(t,1/3):t/mwt+gwt}function rbe(t){return t>sR?t*t*t:mwt*(t-gwt)}function nbe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ibe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Van(t){if(t instanceof Ky)return new Ky(t.h,t.c,t.l,t.opacity);if(t instanceof m0||(t=vwt(t)),t.a===0&&t.b===0)return new Ky(NaN,0()=>t;function bwt(t,e){return function(r){return t+r*e}}function Qan(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 Gan(t,e){var r=e-t;return r?bwt(t,r>180||r<-180?r-360*Math.round(r/360):r):Qj(isNaN(t)?e:t)}function Han(t){return(t=+t)==1?b7:function(e,r){return r-e?Qan(e,r,t):Qj(isNaN(e)?r:e)}}function b7(t,e){var r=e-t;return r?bwt(t,r):Qj(isNaN(t)?e:t)}const Gj=function t(e){var r=Han(e);function n(i,a){var o=r((i=J1e(i)).r,(a=J1e(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=b7(i.opacity,a.opacity);return function(h){return i.r=o(h),i.g=s(h),i.b=l(h),i.opacity=u(h),i+""}}return n.gamma=t,n}(1);function Wan(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),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:Cg(n,i)})),r=sbe.lastIndex;return r180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,n)-2,x:Cg(u,h)})):h&&d.push(i(d)+"rotate("+h+n)}function s(u,h,d,f){u!==h?f.push({i:d.push(i(d)+"skewX(",null,n)-2,x:Cg(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:Cg(u,d)},{i:m-2,x:Cg(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),o(u.rotate,h.rotate,d,f),s(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;--lR}function kwt(){$T=(Yj=S7.now())+qj,lR=x7=0;try{son()}finally{lR=0,con(),$T=0}}function lon(){var t=S7.now(),e=t-Yj;e>Twt&&(qj-=e,Yj=t)}function con(){for(var t,e=Wj,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:Wj=r);A7=t,hbe(n)}function hbe(t){if(!lR){x7&&(x7=clearTimeout(x7));var e=t-$T;e>24?(t<1/0&&(x7=setTimeout(kwt,t-S7.now()-qj)),w7&&(w7=clearInterval(w7))):(w7||(Yj=S7.now(),w7=setInterval(lon,Twt)),lR=1,Cwt(kwt))}}function Ewt(t,e,r){var n=new jj;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var uon=U2t("start","end","cancel","interrupt"),hon=[],_wt=0,Rwt=1,dbe=2,Xj=3,Dwt=4,fbe=5,Kj=6;function Zj(t,e,r,n,i,a){var o=t.__transition;if(!o)t.__transition={};else if(r in o)return;don(t,r,{name:e,index:n,group:i,on:uon,tween:hon,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:_wt})}function pbe(t,e){var r=Og(t,e);if(r.state>_wt)throw new Error("too late; already scheduled");return r}function v0(t,e){var r=Og(t,e);if(r.state>Xj)throw new Error("too late; already running");return r}function Og(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function don(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=Owt(a,0,r.time);function a(u){r.state=Rwt,r.timer.restart(o,r.delay,r.time),r.delay<=u&&o(u-r.delay)}function o(u){var h,d,f,p;if(r.state!==Rwt)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===Xj)return Ewt(o);p.state===Dwt?(p.state=Kj,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+hdbe&&n.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function Qon(t,e,r){var n,i,a=Von(e)?pbe:v0;return function(){var o=a(this,t),s=o.on;s!==n&&(i=(n=s).copy()).on(e,r),o.on=i}}function Gon(t,e){var r=this._id;return arguments.length<2?Og(this.node(),r).on.on(t):this.each(Qon(r,t,e))}function Hon(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function Won(){return this.on("end.remove",Hon(this._id))}function Yon(t){var e=this._name,r=this._id;typeof t!="function"&&(t=K1e(t));for(var n=this._groups,i=n.length,a=new Array(i),o=0;o=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Pwt;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;iFT)if(!(Math.abs(d*l-u*h)>FT)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let p=n-o,g=i-s,m=l*l+u*u,v=p*p+g*g,y=Math.sqrt(m),b=Math.sqrt(f),x=a*Math.tan((mbe-Math.acos((m+f-v)/(2*y*b)))/2),w=x/b,A=x/y;Math.abs(w-1)>FT&&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,o){if(e=+e,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),l=n*Math.sin(i),u=e+s,h=r+l,d=1^o,f=o?i-a:a-i;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>FT||Math.abs(this._y1-h)>FT)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%vbe+vbe),f>ysn?this._append`A${n},${n},0,1,${d},${e-s},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=h}`:f>FT&&this._append`A${n},${n},0,${+(f>=mbe)},${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 wsn(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Jj(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 cR(t){return t=Jj(Math.abs(t)),t?t[1]:NaN}function Asn(t,e){return function(r,n){for(var i=r.length,a=[],o=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=t[o=(o+1)%t.length];return a.reverse().join(e)}}function Ssn(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var Tsn=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function eX(t){if(!(e=Tsn.exec(t)))throw new Error("invalid format: "+t);var e;return new ybe({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]})}eX.prototype=ybe.prototype;function ybe(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+""}ybe.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 Csn(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 tX;function Osn(t,e){var r=Jj(t,e);if(!r)return tX=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(tX=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+Jj(t,Math.max(0,e+a-1))[0]}function Nwt(t,e){var r=Jj(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 Bwt={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:wsn,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)=>Nwt(t*100,e),r:Nwt,s:Osn,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function $wt(t){return t}var Fwt=Array.prototype.map,zwt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ksn(t){var e=t.grouping===void 0||t.thousands===void 0?$wt:Asn(Fwt.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?$wt:Ssn(Fwt.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(d,f){d=eX(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"):Bwt[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():""),C=(v==="$"?n:/[%p]/.test(S)?o:"")+(f&&f.suffix!==void 0?f.suffix:""),k=Bwt[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 _(P){var L=T,R=C,D,M,I;if(S==="c")R=k(P)+R,P="";else{P=+P;var N=P<0||1/P<0;if(P=isNaN(P)?l:k(Math.abs(P),w),A&&(P=Csn(P)),N&&+P==0&&m!=="+"&&(N=!1),L=(N?m==="("?m:s:m==="-"||m==="("?"":m)+L,R=(S==="s"&&!isNaN(P)&&tX!==void 0?zwt[8+tX/3]:"")+R+(N&&m==="("?")":""),E){for(D=-1,M=P.length;++DI||I>57){R=(I===46?i+P.slice(D+1):P.slice(D))+R,P=P.slice(0,D);break}}}x&&!y&&(P=e(P,1/0));var F=L.length+P.length+R.length,B=F>1)+L+P+R+B.slice(F);break;default:P=B+L+P+R;break}return a(P)}return _.toString=function(){return d+""},_}function h(d,f){var p=Math.max(-8,Math.min(8,Math.floor(cR(f)/3)))*3,g=Math.pow(10,-p),m=u((d=eX(d),d.type="f",d),{suffix:zwt[8+p/3]});return function(v){return m(g*v)}}return{format:u,formatPrefix:h}}var rX,zT,Uwt;Esn({thousands:",",grouping:[3],currency:["$",""]});function Esn(t){return rX=ksn(t),zT=rX.format,Uwt=rX.formatPrefix,rX}function _sn(t){return Math.max(0,-cR(Math.abs(t)))}function Rsn(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(cR(e)/3)))*3-cR(Math.abs(t)))}function Dsn(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,cR(e)-cR(t))+1}function Lsn(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 Msn(){return this.eachAfter(Lsn)}function Isn(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function Psn(t,e){for(var r=this,n=[r],i,a,o=-1;r=n.pop();)if(t.call(e,r,++o,this),i=r.children)for(a=i.length-1;a>=0;--a)n.push(i[a]);return this}function Nsn(t,e){for(var r=this,n=[r],i=[],a,o,s,l=-1;r=n.pop();)if(i.push(r),a=r.children)for(o=0,s=a.length;o=0;)r+=n[i].value;e.value=r})}function Fsn(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function zsn(t){for(var e=this,r=Usn(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 Usn(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 Vsn(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function Qsn(){return Array.from(this)}function Gsn(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function Hsn(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*Wsn(){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;--s)i.push(a=o[s]=new nX(o[s])),a.parent=n,a.depth=n.depth+1;return r.eachBefore(Ksn)}function Ysn(){return bbe(this).eachBefore(Xsn)}function qsn(t){return t.children}function jsn(t){return Array.isArray(t)?t[1]:null}function Xsn(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ksn(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function nX(t){this.data=t,this.depth=this.height=0,this.parent=null}nX.prototype=bbe.prototype={constructor:nX,count:Msn,each:Isn,eachAfter:Nsn,eachBefore:Psn,find:Bsn,sum:$sn,sort:Fsn,path:zsn,ancestors:Vsn,descendants:Qsn,leaves:Gsn,links:Hsn,copy:Ysn,[Symbol.iterator]:Wsn};function Zsn(t){if(typeof t!="function")throw new Error;return t}function T7(){return 0}function C7(t){return function(){return t}}function Jsn(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 eln(t,e,r,n,i){for(var a=t.children,o,s=-1,l=a.length,u=t.value&&(n-e)/t.value;++sb&&(b=u),S=v*v*A,x=Math.max(b/S,S/y),x>w){v-=u;break}w=x}o.push(l={value:v,dice:p1?n:1)},r}(rln);function aln(){var t=iln,e=!1,r=1,n=1,i=[0],a=T7,o=T7,s=T7,l=T7,u=T7;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(Jsn),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 cln(t,e,r){var n=t[0],i=t[1],a=e[0],o=e[1];return i2?uln:cln,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?a:(l||(l=s(t.map(n),e,r)))(n(o(f)))}return d.invert=function(f){return o(i((u||(u=s(e,t.map(n),Cg)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,sln),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=Jan,h()},d.clamp=function(f){return arguments.length?(o=f?!0:uR,h()):o!==uR},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 Hwt(){return hln()(uR,uR)}function dln(t,e,r,n){var i=Y1e(t,e,r),a;switch(n=eX(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=Rsn(i,o))&&(n.precision=a),Uwt(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=Dsn(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=_sn(i))&&(n.precision=a-(n.type==="%")*2);break}}return zT(n)}function fln(t){var e=t.domain;return t.ticks=function(r){var n=e();return Inn(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return dln(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,o=n[i],s=n[a],l,u,h=10;for(s0;){if(u=W1e(o,s,r),u===l)return n[i]=o,n[a]=s,e(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return t},t}function hR(){var t=Hwt();return t.copy=function(){return Gwt(t,hR())},iX.apply(t,arguments),fln(t)}function pln(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],o;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 o=i(a),s=i.ceil(a);return a-o(e(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const l=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a0))return l;let u;do l.push(u=new Date(+a)),e(a,s),t(a);while(ull(o=>{if(o>=o)for(;t(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;e(o,-1),!a(o););else for(;--s>=0;)for(;e(o,1),!a(o););}),r&&(i.count=(a,o)=>(Abe.setTime(+a),Sbe.setTime(+o),t(Abe),t(Sbe),Math.floor(r(Abe,Sbe))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const dR=ll(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);dR.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?ll(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):dR),dR.range;const e1=1e3,mp=e1*60,t1=mp*60,r1=t1*24,Tbe=r1*7,Wwt=r1*30,Cbe=r1*365,m2=ll(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*e1)},(t,e)=>(e-t)/e1,t=>t.getUTCSeconds());m2.range;const O7=ll(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*e1)},(t,e)=>{t.setTime(+t+e*mp)},(t,e)=>(e-t)/mp,t=>t.getMinutes());O7.range,ll(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*mp)},(t,e)=>(e-t)/mp,t=>t.getUTCMinutes()).range;const k7=ll(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*e1-t.getMinutes()*mp)},(t,e)=>{t.setTime(+t+e*t1)},(t,e)=>(e-t)/t1,t=>t.getHours());k7.range,ll(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*t1)},(t,e)=>(e-t)/t1,t=>t.getUTCHours()).range;const VT=ll(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*mp)/r1,t=>t.getDate()-1);VT.range;const Obe=ll(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/r1,t=>t.getUTCDate()-1);Obe.range,ll(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/r1,t=>Math.floor(t/r1)).range;function QT(t){return ll(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())*mp)/Tbe)}const E7=QT(0),_7=QT(1),Ywt=QT(2),qwt=QT(3),GT=QT(4),jwt=QT(5),Xwt=QT(6);E7.range,_7.range,Ywt.range,qwt.range,GT.range,jwt.range,Xwt.range;function HT(t){return ll(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)/Tbe)}const Kwt=HT(0),aX=HT(1),gln=HT(2),mln=HT(3),fR=HT(4),vln=HT(5),yln=HT(6);Kwt.range,aX.range,gln.range,mln.range,fR.range,vln.range,yln.range;const R7=ll(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());R7.range,ll(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 n1=ll(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());n1.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ll(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)}),n1.range;const WT=ll(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());WT.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ll(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)}),WT.range;function bln(t,e,r,n,i,a){const o=[[m2,1,e1],[m2,5,5*e1],[m2,15,15*e1],[m2,30,30*e1],[a,1,mp],[a,5,5*mp],[a,15,15*mp],[a,30,30*mp],[i,1,t1],[i,3,3*t1],[i,6,6*t1],[i,12,12*t1],[n,1,r1],[n,2,2*r1],[r,1,Tbe],[e,1,Wwt],[e,3,3*Wwt],[t,1,Cbe]];function s(u,h,d){const f=hv).right(o,f);if(p===o.length)return t.every(Y1e(u/Cbe,h/Cbe,d));if(p===0)return dR.every(Math.max(Y1e(u,h,d),1));const[g,m]=o[f/o[p-1][2]53)return null;"w"in te||(te.w=1),"Z"in te?(ie=Ebe(D7(te.y,0,1)),Ce=ie.getUTCDay(),ie=Ce>4||Ce===0?aX.ceil(ie):aX(ie),ie=Obe.offset(ie,(te.V-1)*7),te.y=ie.getUTCFullYear(),te.m=ie.getUTCMonth(),te.d=ie.getUTCDate()+(te.w+6)%7):(ie=kbe(D7(te.y,0,1)),Ce=ie.getDay(),ie=Ce>4||Ce===0?_7.ceil(ie):_7(ie),ie=VT.offset(ie,(te.V-1)*7),te.y=ie.getFullYear(),te.m=ie.getMonth(),te.d=ie.getDate()+(te.w+6)%7)}else("W"in te||"U"in te)&&("w"in te||(te.w="u"in te?te.u%7:"W"in te?1:0),Ce="Z"in te?Ebe(D7(te.y,0,1)).getUTCDay():kbe(D7(te.y,0,1)).getDay(),te.m=0,te.d="W"in te?(te.w+6)%7+te.W*7-(Ce+5)%7:te.w+te.U*7-(Ce+6)%7);return"Z"in te?(te.H+=te.Z/100|0,te.M+=te.Z%100,Ebe(te)):kbe(te)}}function C(X,J,ee,te){for(var pe=0,ie=J.length,Ce=ee.length,ke,Ee;pe=Ce)return-1;if(ke=J.charCodeAt(pe++),ke===37){if(ke=J.charAt(pe++),Ee=A[ke in Zwt?J.charAt(pe++):ke],!Ee||(te=Ee(X,ee,te))<0)return-1}else if(ke!=ee.charCodeAt(te++))return-1}return te}function k(X,J,ee){var te=u.exec(J.slice(ee));return te?(X.p=h.get(te[0].toLowerCase()),ee+te[0].length):-1}function E(X,J,ee){var te=p.exec(J.slice(ee));return te?(X.w=g.get(te[0].toLowerCase()),ee+te[0].length):-1}function _(X,J,ee){var te=d.exec(J.slice(ee));return te?(X.w=f.get(te[0].toLowerCase()),ee+te[0].length):-1}function P(X,J,ee){var te=y.exec(J.slice(ee));return te?(X.m=b.get(te[0].toLowerCase()),ee+te[0].length):-1}function L(X,J,ee){var te=m.exec(J.slice(ee));return te?(X.m=v.get(te[0].toLowerCase()),ee+te[0].length):-1}function R(X,J,ee){return C(X,e,J,ee)}function D(X,J,ee){return C(X,r,J,ee)}function M(X,J,ee){return C(X,n,J,ee)}function I(X){return o[X.getDay()]}function N(X){return a[X.getDay()]}function F(X){return l[X.getMonth()]}function B(X){return s[X.getMonth()]}function V(X){return i[+(X.getHours()>=12)]}function z(X){return 1+~~(X.getMonth()/3)}function U(X){return o[X.getUTCDay()]}function Q(X){return a[X.getUTCDay()]}function G(X){return l[X.getUTCMonth()]}function q(X){return s[X.getUTCMonth()]}function Y(X){return i[+(X.getUTCHours()>=12)]}function ne(X){return 1+~~(X.getUTCMonth()/3)}return{format:function(X){var J=S(X+="",x);return J.toString=function(){return X},J},parse:function(X){var J=T(X+="",!1);return J.toString=function(){return X},J},utcFormat:function(X){var J=S(X+="",w);return J.toString=function(){return X},J},utcParse:function(X){var J=T(X+="",!0);return J.toString=function(){return X},J}}}var Zwt={"-":"",_:" ",0:"0"},Bl=/^\s*\d+/,Sln=/^%/,Tln=/[\\^$*+?|[\]().{}]/g;function Ui(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a[e.toLowerCase(),r]))}function Oln(t,e,r){var n=Bl.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function kln(t,e,r){var n=Bl.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function Eln(t,e,r){var n=Bl.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function _ln(t,e,r){var n=Bl.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function Rln(t,e,r){var n=Bl.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function Jwt(t,e,r){var n=Bl.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function eAt(t,e,r){var n=Bl.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Dln(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 Lln(t,e,r){var n=Bl.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function Mln(t,e,r){var n=Bl.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function tAt(t,e,r){var n=Bl.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Iln(t,e,r){var n=Bl.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function rAt(t,e,r){var n=Bl.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function Pln(t,e,r){var n=Bl.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Nln(t,e,r){var n=Bl.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Bln(t,e,r){var n=Bl.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function $ln(t,e,r){var n=Bl.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Fln(t,e,r){var n=Sln.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function zln(t,e,r){var n=Bl.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function Uln(t,e,r){var n=Bl.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function nAt(t,e){return Ui(t.getDate(),e,2)}function Vln(t,e){return Ui(t.getHours(),e,2)}function Qln(t,e){return Ui(t.getHours()%12||12,e,2)}function Gln(t,e){return Ui(1+VT.count(n1(t),t),e,3)}function iAt(t,e){return Ui(t.getMilliseconds(),e,3)}function Hln(t,e){return iAt(t,e)+"000"}function Wln(t,e){return Ui(t.getMonth()+1,e,2)}function Yln(t,e){return Ui(t.getMinutes(),e,2)}function qln(t,e){return Ui(t.getSeconds(),e,2)}function jln(t){var e=t.getDay();return e===0?7:e}function Xln(t,e){return Ui(E7.count(n1(t)-1,t),e,2)}function aAt(t){var e=t.getDay();return e>=4||e===0?GT(t):GT.ceil(t)}function Kln(t,e){return t=aAt(t),Ui(GT.count(n1(t),t)+(n1(t).getDay()===4),e,2)}function Zln(t){return t.getDay()}function Jln(t,e){return Ui(_7.count(n1(t)-1,t),e,2)}function ecn(t,e){return Ui(t.getFullYear()%100,e,2)}function tcn(t,e){return t=aAt(t),Ui(t.getFullYear()%100,e,2)}function rcn(t,e){return Ui(t.getFullYear()%1e4,e,4)}function ncn(t,e){var r=t.getDay();return t=r>=4||r===0?GT(t):GT.ceil(t),Ui(t.getFullYear()%1e4,e,4)}function icn(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Ui(e/60|0,"0",2)+Ui(e%60,"0",2)}function oAt(t,e){return Ui(t.getUTCDate(),e,2)}function acn(t,e){return Ui(t.getUTCHours(),e,2)}function ocn(t,e){return Ui(t.getUTCHours()%12||12,e,2)}function scn(t,e){return Ui(1+Obe.count(WT(t),t),e,3)}function sAt(t,e){return Ui(t.getUTCMilliseconds(),e,3)}function lcn(t,e){return sAt(t,e)+"000"}function ccn(t,e){return Ui(t.getUTCMonth()+1,e,2)}function ucn(t,e){return Ui(t.getUTCMinutes(),e,2)}function hcn(t,e){return Ui(t.getUTCSeconds(),e,2)}function dcn(t){var e=t.getUTCDay();return e===0?7:e}function fcn(t,e){return Ui(Kwt.count(WT(t)-1,t),e,2)}function lAt(t){var e=t.getUTCDay();return e>=4||e===0?fR(t):fR.ceil(t)}function pcn(t,e){return t=lAt(t),Ui(fR.count(WT(t),t)+(WT(t).getUTCDay()===4),e,2)}function gcn(t){return t.getUTCDay()}function mcn(t,e){return Ui(aX.count(WT(t)-1,t),e,2)}function vcn(t,e){return Ui(t.getUTCFullYear()%100,e,2)}function ycn(t,e){return t=lAt(t),Ui(t.getUTCFullYear()%100,e,2)}function bcn(t,e){return Ui(t.getUTCFullYear()%1e4,e,4)}function xcn(t,e){var r=t.getUTCDay();return t=r>=4||r===0?fR(t):fR.ceil(t),Ui(t.getUTCFullYear()%1e4,e,4)}function wcn(){return"+0000"}function cAt(){return"%"}function uAt(t){return+t}function hAt(t){return Math.floor(+t/1e3)}var pR,oX;Acn({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 Acn(t){return pR=Aln(t),oX=pR.format,pR.parse,pR.utcFormat,pR.utcParse,pR}function Scn(t){return new Date(t)}function Tcn(t){return t instanceof Date?+t:+new Date(+t)}function dAt(t,e,r,n,i,a,o,s,l,u){var h=Hwt(),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?I7:Math.acos(t)}function pAt(t){return t>=1?sX:t<=-1?-sX:Math.asin(t)}function gAt(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 xsn(e)}function Rcn(t){return t.innerRadius}function Dcn(t){return t.outerRadius}function Lcn(t){return t.startAngle}function Mcn(t){return t.endAngle}function Icn(t){return t&&t.padAngle}function Pcn(t,e,r,n,i,a,o,s){var l=r-t,u=n-e,h=o-i,d=s-a,f=d*l-h*u;if(!(f*fR*R+D*D&&(C=E,k=_),{cx:C,cy:k,x01:-h,y01:-d,x11:C*(i/A-1),y11:k*(i/A-1)}}function mR(){var t=Rcn,e=Dcn,r=gs(0),n=null,i=Lcn,a=Mcn,o=Icn,s=null,l=gAt(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-sX,m=a.apply(this,arguments)-sX,v=fAt(m-g),y=m>g;if(s||(s=h=l()),pru))s.moveTo(0,0);else if(v>lX-ru)s.moveTo(p*YT(g),p*y0(g)),s.arc(0,0,p,g,m,!y),f>ru&&(s.moveTo(f*YT(m),f*y0(m)),s.arc(0,0,f,m,g,y));else{var b=g,x=m,w=g,A=m,S=v,T=v,C=o.apply(this,arguments)/2,k=C>ru&&(n?+n.apply(this,arguments):gR(f*f+p*p)),E=_be(fAt(p-f)/2,+r.apply(this,arguments)),_=E,P=E,L,R;if(k>ru){var D=pAt(k/f*y0(C)),M=pAt(k/p*y0(C));(S-=D*2)>ru?(D*=y?1:-1,w+=D,A-=D):(S=0,w=A=(g+m)/2),(T-=M*2)>ru?(M*=y?1:-1,b+=M,x-=M):(T=0,b=x=(g+m)/2)}var I=p*YT(b),N=p*y0(b),F=f*YT(A),B=f*y0(A);if(E>ru){var V=p*YT(x),z=p*y0(x),U=f*YT(w),Q=f*y0(w),G;if(vru?P>ru?(L=cX(U,Q,I,N,p,P,y),R=cX(V,z,F,B,p,P,y),s.moveTo(L.cx+L.x01,L.cy+L.y01),Pru)||!(S>ru)?s.lineTo(F,B):_>ru?(L=cX(F,B,V,z,f,-_,y),R=cX(I,N,U,Q,f,-_,y),s.lineTo(L.cx+L.x01,L.cy+L.y01),_t?1:e>=t?0:NaN}function Fcn(t){return t}function zcn(){var t=Fcn,e=$cn,r=null,n=gs(0),i=gs(lX),a=gs(0);function o(s){var l,u=(s=mAt(s)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),v=Math.min(lX,Math.max(-lX,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(s[A],s[S])}),l=0,d=f?(v-u*x)/f:0;l0?w*d:0)+x,g[h]={data:s[h],index:l,value:w,startAngle:m,endAngle:y,padAngle:b};return g}return o.value=function(s){return arguments.length?(t=typeof s=="function"?s:gs(+s),o):t},o.sortValues=function(s){return arguments.length?(e=s,r=null,o):e},o.sort=function(s){return arguments.length?(r=s,e=null,o):r},o.startAngle=function(s){return arguments.length?(n=typeof s=="function"?s:gs(+s),o):n},o.endAngle=function(s){return arguments.length?(i=typeof s=="function"?s:gs(+s),o):i},o.padAngle=function(s){return arguments.length?(a=typeof s=="function"?s:gs(+s),o):a},o}class yAt{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 bAt(t){return new yAt(t,!0)}function xAt(t){return new yAt(t,!1)}function v2(){}function uX(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 hX(t){this._context=t}hX.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:uX(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:uX(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function B7(t){return new hX(t)}function wAt(t){this._context=t}wAt.prototype={areaStart:v2,areaEnd:v2,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:uX(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Ucn(t){return new wAt(t)}function AAt(t){this._context=t}AAt.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:uX(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Vcn(t){return new AAt(t)}function SAt(t,e){this._basis=new hX(t),this._beta=e}SAt.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,o=e[r]-i,s=-1,l;++s<=r;)l=s/r,this._basis.point(this._beta*t[s]+(1-this._beta)*(n+l*a),this._beta*e[s]+(1-this._beta)*(i+l*o));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const Qcn=function t(e){function r(n){return e===1?new hX(n):new SAt(n,e)}return r.beta=function(n){return t(+n)},r}(.85);function dX(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 Rbe(t,e){this._context=t,this._k=(1-e)/6}Rbe.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:dX(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:dX(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 TAt=function t(e){function r(n){return new Rbe(n,e)}return r.tension=function(n){return t(+n)},r}(0);function Dbe(t,e){this._context=t,this._k=(1-e)/6}Dbe.prototype={areaStart:v2,areaEnd:v2,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:dX(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 Gcn=function t(e){function r(n){return new Dbe(n,e)}return r.tension=function(n){return t(+n)},r}(0);function Lbe(t,e){this._context=t,this._k=(1-e)/6}Lbe.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:dX(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 Hcn=function t(e){function r(n){return new Lbe(n,e)}return r.tension=function(n){return t(+n)},r}(0);function Mbe(t,e,r){var n=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>ru){var s=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*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>ru){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,o=(o*u+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,a,o,t._x2,t._y2)}function CAt(t,e){this._context=t,this._alpha=e}CAt.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:Mbe(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 OAt=function t(e){function r(n){return e?new CAt(n,e):new Rbe(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function kAt(t,e){this._context=t,this._alpha=e}kAt.prototype={areaStart:v2,areaEnd:v2,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:Mbe(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 Wcn=function t(e){function r(n){return e?new kAt(n,e):new Dbe(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function EAt(t,e){this._context=t,this._alpha=e}EAt.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:Mbe(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 Ycn=function t(e){function r(n){return e?new EAt(n,e):new Lbe(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function _At(t){this._context=t}_At.prototype={areaStart:v2,areaEnd:v2,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 qcn(t){return new _At(t)}function RAt(t){return t<0?-1:1}function DAt(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),o=(r-t._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(RAt(a)+RAt(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function LAt(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Ibe(t,e,r){var n=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-n)/3;t._context.bezierCurveTo(n+s,i+s*e,a-s,o-s*r,a,o)}function fX(t){this._context=t}fX.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:Ibe(this,this._t0,LAt(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,Ibe(this,LAt(this,r=DAt(this,t,e)),r);break;default:Ibe(this,this._t0,r=DAt(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function MAt(t){this._context=new IAt(t)}(MAt.prototype=Object.create(fX.prototype)).point=function(t,e){fX.prototype.point.call(this,e,t)};function IAt(t){this._context=t}IAt.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 PAt(t){return new fX(t)}function NAt(t){return new MAt(t)}function BAt(t){this._context=t}BAt.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=$At(t),i=$At(e),a=0,o=1;o=0;--e)i[e]=(o[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 zAt(t){return new pX(t,.5)}function UAt(t){return new pX(t,0)}function VAt(t){return new pX(t,1)}function $7(t,e,r){this.k=t,this.x=e,this.y=r}$7.prototype={constructor:$7,scale:function(t){return t===1?this:new $7(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new $7(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+")"}},$7.prototype;var nu=O(t=>{var i;const{securityLevel:e}=Ye();let r=_t("body");if(e==="sandbox"){const o=((i=_t(`#i${t}`).node())==null?void 0:i.contentDocument)??document;r=_t(o.body)}return r.select(`#${t}`)},"selectSvgElement");function Pbe(t){return typeof t>"u"||t===null}O(Pbe,"isNothing");function QAt(t){return typeof t=="object"&&t!==null}O(QAt,"isObject");function GAt(t){return Array.isArray(t)?t:Pbe(t)?[]:[t]}O(GAt,"toArray");function HAt(t,e){var r,n,i,a;if(e)for(a=Object.keys(e),r=0,n=a.length;r{e!==void 0&&(kj[t]=e)},"addStylesForDiagram"),Ann=xnn,N1e={};yj(N1e,{clear:()=>_a,getAccDescription:()=>lo,getAccTitle:()=>oo,getDiagramTitle:()=>$a,setAccDescription:()=>so,setAccTitle:()=>Ba,setDiagramTitle:()=>co});var B1e="",$1e="",F1e="",z1e=O(t=>li(t,Dr()),"sanitizeText"),_a=O(()=>{B1e="",F1e="",$1e=""},"clear"),Ba=O(t=>{B1e=z1e(t).replace(/^\s+/g,"")},"setAccTitle"),oo=O(()=>B1e,"getAccTitle"),so=O(t=>{F1e=z1e(t).replace(/\n\s+/g,` +`)},"setAccDescription"),lo=O(()=>F1e,"getAccDescription"),co=O(t=>{$1e=z1e(t)},"setDiagramTitle"),$a=O(()=>$1e,"getDiagramTitle"),B2t=ye,Snn=b1e,Ye=Dr,U1e=T2t,$2t=rR,V1e=O(t=>li(t,Ye()),"sanitizeText"),Q1e=iR,Tnn=O(()=>N1e,"getCommonDb"),Ej={},_j=O((t,e,r)=>{var n;Ej[t]&&B2t.warn(`Diagram with id ${t} already registered. Overwriting.`),Ej[t]=e,r&&D2t(t,r),wnn(t,e.styles),(n=e.injectUtils)==null||n.call(e,B2t,Snn,Ye,V1e,Q1e,Tnn(),()=>{})},"registerDiagram"),G1e=O(t=>{if(t in Ej)return Ej[t];throw new Cnn(t)},"getDiagram"),Cnn=(JD=class extends Error{constructor(e){super(`Diagram ${e} not found.`)}},O(JD,"DiagramNotFoundError"),JD);function Rj(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function Onn(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function H1e(t){let e,r,n;t.length!==2?(e=Rj,r=(s,l)=>Rj(t(s),l),n=(s,l)=>t(s)-l):(e=t===Rj||t===Onn?t:knn,r=t,n=t);function i(s,l,u=0,h=s.length){if(u>>1;r(s[d],l)<0?u=d+1:h=d}while(u>>1;r(s[d],l)<=0?u=d+1:h=d}while(uu&&n(s[d-1],l)>-n(s[d],l)?d-1:d}return{left:i,center:o,right:a}}function knn(){return 0}function Enn(t){return t===null?NaN:+t}const _nn=H1e(Rj).right;H1e(Enn).center;class F2t extends Map{constructor(e,r=Lnn){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(z2t(this,e))}has(e){return super.has(z2t(this,e))}set(e,r){return super.set(Rnn(this,e),r)}delete(e){return super.delete(Dnn(this,e))}}function z2t({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function Rnn({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function Dnn({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function Lnn(t){return t!==null&&typeof t=="object"?t.valueOf():t}const Mnn=Math.sqrt(50),Inn=Math.sqrt(10),Pnn=Math.sqrt(2);function Dj(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=Mnn?10:a>=Inn?5:a>=Pnn?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/o,s=Math.round(t*u),l=Math.round(e*u),s/ue&&--l,u=-u):(u=Math.pow(10,i)*o,s=Math.round(t/u),l=Math.round(e/u),s*ue&&--l),l0))return[];if(t===e)return[t];const n=e=i))return[];const s=a-i+1,l=new Array(s);if(n)if(o<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 $nn(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 Fnn(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 Gnn(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),r=>+t(r)+e}function Hnn(){return!this.__axis}function V2t(t,e){var r=[],n=null,i=null,a=6,o=6,s=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===Lj||t===Mj?-1:1,h=t===Mj||t===q1e?"x":"y",d=t===Lj||t===j1e?Unn:Vnn;function f(p){var g=n??(e.ticks?e.ticks.apply(e,r):e.domain()),m=i??(e.tickFormat?e.tickFormat.apply(e,r):znn),v=Math.max(a,0)+s,y=e.range(),b=+y[0]+l,x=+y[y.length-1]+l,w=(e.bandwidth?Gnn:Qnn)(e.copy(),l),A=p.selection?p.selection():p,S=A.selectAll(".domain").data([null]),T=A.selectAll(".tick").data(g,e).order(),C=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===Lj?"0em":t===j1e?"0.71em":"0.32em")),p!==A&&(S=S.transition(p),T=T.transition(p),E=E.transition(p),_=_.transition(p),C=C.transition(p).attr("opacity",U2t).attr("transform",function(P){return isFinite(P=w(P))?d(P+l):this.getAttribute("transform")}),k.attr("opacity",U2t).attr("transform",function(P){var L=this.parentNode.__axis;return d((L&&isFinite(L=L(P))?L:w(P))+l)})),C.remove(),S.attr("d",t===Mj||t===q1e?o?"M"+u*o+","+b+"H"+l+"V"+x+"H"+u*o:"M"+l+","+b+"V"+x:o?"M"+b+","+u*o+"V"+l+"H"+x+"V"+u*o:"M"+b+","+l+"H"+x),T.attr("opacity",1).attr("transform",function(P){return d(w(P)+l)}),E.attr(h+"2",u*a),_.attr(h,u*v).text(m),A.filter(Hnn).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===q1e?"start":t===Mj?"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=o=+p,f):a},f.tickSizeInner=function(p){return arguments.length?(a=+p,f):a},f.tickSizeOuter=function(p){return arguments.length?(o=+p,f):o},f.tickPadding=function(p){return arguments.length?(s=+p,f):s},f.offset=function(p){return arguments.length?(l=+p,f):l},f}function Wnn(t){return V2t(Lj,t)}function Ynn(t){return V2t(j1e,t)}var qnn={value:()=>{}};function Q2t(){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}})}Ij.prototype=Q2t.prototype={constructor:Ij,on:function(t,e){var r=this._,n=jnn(t+"",r),i,a=-1,o=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)),H2t.hasOwnProperty(e)?{space:H2t[e],local:t}:t}function Knn(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===X1e&&e.documentElement.namespaceURI===X1e?e.createElement(t):e.createElementNS(r,t)}}function Znn(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function W2t(t){var e=Pj(t);return(e.local?Znn:Knn)(e)}function Jnn(){}function K1e(t){return t==null?Jnn:function(){return this.querySelector(t)}}function ein(t){typeof t!="function"&&(t=K1e(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;)(o=n[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Cin(t){t||(t=Oin);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 kin(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Ein(){return Array.from(this)}function _in(){for(var t=this._groups,e=0,r=t.length;e1?this.each((e==null?zin:typeof e=="function"?Vin:Uin)(t,e,r??"")):aR(this.node(),t)}function aR(t,e){return t.style.getPropertyValue(e)||K2t(t).getComputedStyle(t,null).getPropertyValue(e)}function Gin(t){return function(){delete this[t]}}function Hin(t,e){return function(){this[t]=e}}function Win(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function Yin(t,e){return arguments.length>1?this.each((e==null?Gin:typeof e=="function"?Win:Hin)(t,e)):this.node()[t]}function Z2t(t){return t.trim().split(/^|\s+/)}function Z1e(t){return t.classList||new J2t(t)}function J2t(t){this._node=t,this._names=Z2t(t.getAttribute("class")||"")}J2t.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 ewt(t,e){for(var r=Z1e(t),n=-1,i=e.length;++n=0&&(r=e.slice(n+1),e=e.slice(0,n)),{type:e,name:r}})}function wan(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?Fj(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?Fj(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=Ran.exec(t))?new eu(e[1],e[2],e[3],1):(e=Dan.exec(t))?new eu(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Lan.exec(t))?Fj(e[1],e[2],e[3],e[4]):(e=Man.exec(t))?Fj(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Ian.exec(t))?hwt(e[1],e[2]/100,e[3]/100,1):(e=Pan.exec(t))?hwt(e[1],e[2]/100,e[3]/100,e[4]):iwt.hasOwnProperty(t)?swt(iwt[t]):t==="transparent"?new eu(NaN,NaN,NaN,0):null}function swt(t){return new eu(t>>16&255,t>>8&255,t&255,1)}function Fj(t,e,r,n){return n<=0&&(t=e=r=NaN),new eu(t,e,r,n)}function lwt(t){return t instanceof IT||(t=PT(t)),t?(t=t.rgb(),new eu(t.r,t.g,t.b,t.opacity)):new eu}function J1e(t,e,r,n){return arguments.length===1?lwt(t):new eu(t,e,r,n??1)}function eu(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}m7(eu,J1e,Bj(IT,{brighter(t){return t=t==null?$j:Math.pow($j,t),new eu(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?v7:Math.pow(v7,t),new eu(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new eu(NT(this.r),NT(this.g),NT(this.b),zj(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:cwt,formatHex:cwt,formatHex8:$an,formatRgb:uwt,toString:uwt}));function cwt(){return`#${BT(this.r)}${BT(this.g)}${BT(this.b)}`}function $an(){return`#${BT(this.r)}${BT(this.g)}${BT(this.b)}${BT((isNaN(this.opacity)?1:this.opacity)*255)}`}function uwt(){const t=zj(this.opacity);return`${t===1?"rgb(":"rgba("}${NT(this.r)}, ${NT(this.g)}, ${NT(this.b)}${t===1?")":`, ${t})`}`}function zj(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function NT(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function BT(t){return t=NT(t),(t<16?"0":"")+t.toString(16)}function hwt(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Tg(t,e,r,n)}function dwt(t){if(t instanceof Tg)return new Tg(t.h,t.s,t.l,t.opacity);if(t instanceof IT||(t=PT(t)),!t)return new Tg;if(t instanceof Tg)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),o=NaN,s=a-i,l=(a+i)/2;return s?(e===a?o=(r-n)/s+(r0&&l<1?0:o,new Tg(o,s,l,t.opacity)}function Fan(t,e,r,n){return arguments.length===1?dwt(t):new Tg(t,e,r,n??1)}function Tg(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}m7(Tg,Fan,Bj(IT,{brighter(t){return t=t==null?$j:Math.pow($j,t),new Tg(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?v7:Math.pow(v7,t),new Tg(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 eu(ebe(t>=240?t-240:t+120,i,n),ebe(t,i,n),ebe(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Tg(fwt(this.h),Uj(this.s),Uj(this.l),zj(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=zj(this.opacity);return`${t===1?"hsl(":"hsla("}${fwt(this.h)}, ${Uj(this.s)*100}%, ${Uj(this.l)*100}%${t===1?")":`, ${t})`}`}}));function fwt(t){return t=(t||0)%360,t<0?t+360:t}function Uj(t){return Math.max(0,Math.min(1,t||0))}function ebe(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 zan=Math.PI/180,Uan=180/Math.PI,Vj=18,pwt=.96422,gwt=1,mwt=.82521,vwt=4/29,sR=6/29,ywt=3*sR*sR,Van=sR*sR*sR;function bwt(t){if(t instanceof m0)return new m0(t.l,t.a,t.b,t.opacity);if(t instanceof Ky)return xwt(t);t instanceof eu||(t=lwt(t));var e=ibe(t.r),r=ibe(t.g),n=ibe(t.b),i=tbe((.2225045*e+.7168786*r+.0606169*n)/gwt),a,o;return e===r&&r===n?a=o=i:(a=tbe((.4360747*e+.3850649*r+.1430804*n)/pwt),o=tbe((.0139322*e+.0971045*r+.7141733*n)/mwt)),new m0(116*i-16,500*(a-i),200*(i-o),t.opacity)}function Qan(t,e,r,n){return arguments.length===1?bwt(t):new m0(t,e,r,n??1)}function m0(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}m7(m0,Qan,Bj(IT,{brighter(t){return new m0(this.l+Vj*(t??1),this.a,this.b,this.opacity)},darker(t){return new m0(this.l-Vj*(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=pwt*rbe(e),t=gwt*rbe(t),r=mwt*rbe(r),new eu(nbe(3.1338561*e-1.6168667*t-.4906146*r),nbe(-.9787684*e+1.9161415*t+.033454*r),nbe(.0719453*e-.2289914*t+1.4052427*r),this.opacity)}}));function tbe(t){return t>Van?Math.pow(t,1/3):t/ywt+vwt}function rbe(t){return t>sR?t*t*t:ywt*(t-vwt)}function nbe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ibe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Gan(t){if(t instanceof Ky)return new Ky(t.h,t.c,t.l,t.opacity);if(t instanceof m0||(t=bwt(t)),t.a===0&&t.b===0)return new Ky(NaN,0()=>t;function wwt(t,e){return function(r){return t+r*e}}function Han(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 Wan(t,e){var r=e-t;return r?wwt(t,r>180||r<-180?r-360*Math.round(r/360):r):Qj(isNaN(t)?e:t)}function Yan(t){return(t=+t)==1?b7:function(e,r){return r-e?Han(e,r,t):Qj(isNaN(e)?r:e)}}function b7(t,e){var r=e-t;return r?wwt(t,r):Qj(isNaN(t)?e:t)}const Gj=function t(e){var r=Yan(e);function n(i,a){var o=r((i=J1e(i)).r,(a=J1e(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=b7(i.opacity,a.opacity);return function(h){return i.r=o(h),i.g=s(h),i.b=l(h),i.opacity=u(h),i+""}}return n.gamma=t,n}(1);function qan(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),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:Cg(n,i)})),r=sbe.lastIndex;return r180?h+=360:h-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,n)-2,x:Cg(u,h)})):h&&d.push(i(d)+"rotate("+h+n)}function s(u,h,d,f){u!==h?f.push({i:d.push(i(d)+"skewX(",null,n)-2,x:Cg(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:Cg(u,d)},{i:m-2,x:Cg(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),o(u.rotate,h.rotate,d,f),s(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;--lR}function _wt(){$T=(Yj=S7.now())+qj,lR=x7=0;try{con()}finally{lR=0,hon(),$T=0}}function uon(){var t=S7.now(),e=t-Yj;e>Owt&&(qj-=e,Yj=t)}function hon(){for(var t,e=Wj,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:Wj=r);A7=t,hbe(n)}function hbe(t){if(!lR){x7&&(x7=clearTimeout(x7));var e=t-$T;e>24?(t<1/0&&(x7=setTimeout(_wt,t-S7.now()-qj)),w7&&(w7=clearInterval(w7))):(w7||(Yj=S7.now(),w7=setInterval(uon,Owt)),lR=1,kwt(_wt))}}function Rwt(t,e,r){var n=new jj;return e=e==null?0:+e,n.restart(i=>{n.stop(),t(i+e)},e,r),n}var don=Q2t("start","end","cancel","interrupt"),fon=[],Dwt=0,Lwt=1,dbe=2,Xj=3,Mwt=4,fbe=5,Kj=6;function Zj(t,e,r,n,i,a){var o=t.__transition;if(!o)t.__transition={};else if(r in o)return;pon(t,r,{name:e,index:n,group:i,on:don,tween:fon,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Dwt})}function pbe(t,e){var r=Og(t,e);if(r.state>Dwt)throw new Error("too late; already scheduled");return r}function v0(t,e){var r=Og(t,e);if(r.state>Xj)throw new Error("too late; already running");return r}function Og(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function pon(t,e,r){var n=t.__transition,i;n[e]=r,r.timer=Ewt(a,0,r.time);function a(u){r.state=Lwt,r.timer.restart(o,r.delay,r.time),r.delay<=u&&o(u-r.delay)}function o(u){var h,d,f,p;if(r.state!==Lwt)return l();for(h in n)if(p=n[h],p.name===r.name){if(p.state===Xj)return Rwt(o);p.state===Mwt?(p.state=Kj,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete n[h]):+hdbe&&n.state=0&&(e=e.slice(0,r)),!e||e==="start"})}function Hon(t,e,r){var n,i,a=Gon(e)?pbe:v0;return function(){var o=a(this,t),s=o.on;s!==n&&(i=(n=s).copy()).on(e,r),o.on=i}}function Won(t,e){var r=this._id;return arguments.length<2?Og(this.node(),r).on.on(t):this.each(Hon(r,t,e))}function Yon(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function qon(){return this.on("end.remove",Yon(this._id))}function jon(t){var e=this._name,r=this._id;typeof t!="function"&&(t=K1e(t));for(var n=this._groups,i=n.length,a=new Array(i),o=0;o=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Bwt;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;iFT)if(!(Math.abs(d*l-u*h)>FT)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let p=n-o,g=i-s,m=l*l+u*u,v=p*p+g*g,y=Math.sqrt(m),b=Math.sqrt(f),x=a*Math.tan((mbe-Math.acos((m+f-v)/(2*y*b)))/2),w=x/b,A=x/y;Math.abs(w-1)>FT&&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,o){if(e=+e,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),l=n*Math.sin(i),u=e+s,h=r+l,d=1^o,f=o?i-a:a-i;this._x1===null?this._append`M${u},${h}`:(Math.abs(this._x1-u)>FT||Math.abs(this._y1-h)>FT)&&this._append`L${u},${h}`,n&&(f<0&&(f=f%vbe+vbe),f>xsn?this._append`A${n},${n},0,1,${d},${e-s},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=h}`:f>FT&&this._append`A${n},${n},0,${+(f>=mbe)},${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 Ssn(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Jj(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 cR(t){return t=Jj(Math.abs(t)),t?t[1]:NaN}function Tsn(t,e){return function(r,n){for(var i=r.length,a=[],o=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=t[o=(o+1)%t.length];return a.reverse().join(e)}}function Csn(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var Osn=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function eX(t){if(!(e=Osn.exec(t)))throw new Error("invalid format: "+t);var e;return new ybe({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]})}eX.prototype=ybe.prototype;function ybe(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+""}ybe.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 ksn(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 tX;function Esn(t,e){var r=Jj(t,e);if(!r)return tX=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(tX=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+Jj(t,Math.max(0,e+a-1))[0]}function $wt(t,e){var r=Jj(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 Fwt={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Ssn,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)=>$wt(t*100,e),r:$wt,s:Esn,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function zwt(t){return t}var Uwt=Array.prototype.map,Vwt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function _sn(t){var e=t.grouping===void 0||t.thousands===void 0?zwt:Tsn(Uwt.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?zwt:Csn(Uwt.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(d,f){d=eX(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"):Fwt[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():""),C=(v==="$"?n:/[%p]/.test(S)?o:"")+(f&&f.suffix!==void 0?f.suffix:""),k=Fwt[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 _(P){var L=T,R=C,D,M,I;if(S==="c")R=k(P)+R,P="";else{P=+P;var N=P<0||1/P<0;if(P=isNaN(P)?l:k(Math.abs(P),w),A&&(P=ksn(P)),N&&+P==0&&m!=="+"&&(N=!1),L=(N?m==="("?m:s:m==="-"||m==="("?"":m)+L,R=(S==="s"&&!isNaN(P)&&tX!==void 0?Vwt[8+tX/3]:"")+R+(N&&m==="("?")":""),E){for(D=-1,M=P.length;++DI||I>57){R=(I===46?i+P.slice(D+1):P.slice(D))+R,P=P.slice(0,D);break}}}x&&!y&&(P=e(P,1/0));var F=L.length+P.length+R.length,B=F>1)+L+P+R+B.slice(F);break;default:P=B+L+P+R;break}return a(P)}return _.toString=function(){return d+""},_}function h(d,f){var p=Math.max(-8,Math.min(8,Math.floor(cR(f)/3)))*3,g=Math.pow(10,-p),m=u((d=eX(d),d.type="f",d),{suffix:Vwt[8+p/3]});return function(v){return m(g*v)}}return{format:u,formatPrefix:h}}var rX,zT,Qwt;Rsn({thousands:",",grouping:[3],currency:["$",""]});function Rsn(t){return rX=_sn(t),zT=rX.format,Qwt=rX.formatPrefix,rX}function Dsn(t){return Math.max(0,-cR(Math.abs(t)))}function Lsn(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(cR(e)/3)))*3-cR(Math.abs(t)))}function Msn(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,cR(e)-cR(t))+1}function Isn(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 Psn(){return this.eachAfter(Isn)}function Nsn(t,e){let r=-1;for(const n of this)t.call(e,n,++r,this);return this}function Bsn(t,e){for(var r=this,n=[r],i,a,o=-1;r=n.pop();)if(t.call(e,r,++o,this),i=r.children)for(a=i.length-1;a>=0;--a)n.push(i[a]);return this}function $sn(t,e){for(var r=this,n=[r],i=[],a,o,s,l=-1;r=n.pop();)if(i.push(r),a=r.children)for(o=0,s=a.length;o=0;)r+=n[i].value;e.value=r})}function Usn(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function Vsn(t){for(var e=this,r=Qsn(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 Qsn(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 Gsn(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function Hsn(){return Array.from(this)}function Wsn(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function Ysn(){var t=this,e=[];return t.each(function(r){r!==t&&e.push({source:r.parent,target:r})}),e}function*qsn(){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;--s)i.push(a=o[s]=new nX(o[s])),a.parent=n,a.depth=n.depth+1;return r.eachBefore(Jsn)}function jsn(){return bbe(this).eachBefore(Zsn)}function Xsn(t){return t.children}function Ksn(t){return Array.isArray(t)?t[1]:null}function Zsn(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Jsn(t){var e=0;do t.height=e;while((t=t.parent)&&t.height<++e)}function nX(t){this.data=t,this.depth=this.height=0,this.parent=null}nX.prototype=bbe.prototype={constructor:nX,count:Psn,each:Nsn,eachAfter:$sn,eachBefore:Bsn,find:Fsn,sum:zsn,sort:Usn,path:Vsn,ancestors:Gsn,descendants:Hsn,leaves:Wsn,links:Ysn,copy:jsn,[Symbol.iterator]:qsn};function eln(t){if(typeof t!="function")throw new Error;return t}function T7(){return 0}function C7(t){return function(){return t}}function tln(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 rln(t,e,r,n,i){for(var a=t.children,o,s=-1,l=a.length,u=t.value&&(n-e)/t.value;++sb&&(b=u),S=v*v*A,x=Math.max(b/S,S/y),x>w){v-=u;break}w=x}o.push(l={value:v,dice:p1?n:1)},r}(iln);function sln(){var t=oln,e=!1,r=1,n=1,i=[0],a=T7,o=T7,s=T7,l=T7,u=T7;function h(f){return f.x0=f.y0=0,f.x1=r,f.y1=n,f.eachBefore(d),i=[0],e&&f.eachBefore(tln),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 hln(t,e,r){var n=t[0],i=t[1],a=e[0],o=e[1];return i2?dln:hln,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?a:(l||(l=s(t.map(n),e,r)))(n(o(f)))}return d.invert=function(f){return o(i((u||(u=s(e,t.map(n),Cg)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,cln),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=ton,h()},d.clamp=function(f){return arguments.length?(o=f?!0:uR,h()):o!==uR},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 Ywt(){return fln()(uR,uR)}function pln(t,e,r,n){var i=Y1e(t,e,r),a;switch(n=eX(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=Lsn(i,o))&&(n.precision=a),Qwt(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=Msn(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=Dsn(i))&&(n.precision=a-(n.type==="%")*2);break}}return zT(n)}function gln(t){var e=t.domain;return t.ticks=function(r){var n=e();return Nnn(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return pln(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,o=n[i],s=n[a],l,u,h=10;for(s0;){if(u=W1e(o,s,r),u===l)return n[i]=o,n[a]=s,e(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return t},t}function hR(){var t=Ywt();return t.copy=function(){return Wwt(t,hR())},iX.apply(t,arguments),gln(t)}function mln(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],o;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 o=i(a),s=i.ceil(a);return a-o(e(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const l=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a0))return l;let u;do l.push(u=new Date(+a)),e(a,s),t(a);while(ull(o=>{if(o>=o)for(;t(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;e(o,-1),!a(o););else for(;--s>=0;)for(;e(o,1),!a(o););}),r&&(i.count=(a,o)=>(Abe.setTime(+a),Sbe.setTime(+o),t(Abe),t(Sbe),Math.floor(r(Abe,Sbe))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const dR=ll(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);dR.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?ll(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):dR),dR.range;const e1=1e3,mp=e1*60,t1=mp*60,r1=t1*24,Tbe=r1*7,qwt=r1*30,Cbe=r1*365,m2=ll(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*e1)},(t,e)=>(e-t)/e1,t=>t.getUTCSeconds());m2.range;const O7=ll(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*e1)},(t,e)=>{t.setTime(+t+e*mp)},(t,e)=>(e-t)/mp,t=>t.getMinutes());O7.range,ll(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*mp)},(t,e)=>(e-t)/mp,t=>t.getUTCMinutes()).range;const k7=ll(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*e1-t.getMinutes()*mp)},(t,e)=>{t.setTime(+t+e*t1)},(t,e)=>(e-t)/t1,t=>t.getHours());k7.range,ll(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*t1)},(t,e)=>(e-t)/t1,t=>t.getUTCHours()).range;const VT=ll(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*mp)/r1,t=>t.getDate()-1);VT.range;const Obe=ll(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/r1,t=>t.getUTCDate()-1);Obe.range,ll(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/r1,t=>Math.floor(t/r1)).range;function QT(t){return ll(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())*mp)/Tbe)}const E7=QT(0),_7=QT(1),jwt=QT(2),Xwt=QT(3),GT=QT(4),Kwt=QT(5),Zwt=QT(6);E7.range,_7.range,jwt.range,Xwt.range,GT.range,Kwt.range,Zwt.range;function HT(t){return ll(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)/Tbe)}const Jwt=HT(0),aX=HT(1),vln=HT(2),yln=HT(3),fR=HT(4),bln=HT(5),xln=HT(6);Jwt.range,aX.range,vln.range,yln.range,fR.range,bln.range,xln.range;const R7=ll(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());R7.range,ll(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 n1=ll(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());n1.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ll(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)}),n1.range;const WT=ll(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());WT.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ll(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)}),WT.range;function wln(t,e,r,n,i,a){const o=[[m2,1,e1],[m2,5,5*e1],[m2,15,15*e1],[m2,30,30*e1],[a,1,mp],[a,5,5*mp],[a,15,15*mp],[a,30,30*mp],[i,1,t1],[i,3,3*t1],[i,6,6*t1],[i,12,12*t1],[n,1,r1],[n,2,2*r1],[r,1,Tbe],[e,1,qwt],[e,3,3*qwt],[t,1,Cbe]];function s(u,h,d){const f=hv).right(o,f);if(p===o.length)return t.every(Y1e(u/Cbe,h/Cbe,d));if(p===0)return dR.every(Math.max(Y1e(u,h,d),1));const[g,m]=o[f/o[p-1][2]53)return null;"w"in te||(te.w=1),"Z"in te?(ie=Ebe(D7(te.y,0,1)),Ce=ie.getUTCDay(),ie=Ce>4||Ce===0?aX.ceil(ie):aX(ie),ie=Obe.offset(ie,(te.V-1)*7),te.y=ie.getUTCFullYear(),te.m=ie.getUTCMonth(),te.d=ie.getUTCDate()+(te.w+6)%7):(ie=kbe(D7(te.y,0,1)),Ce=ie.getDay(),ie=Ce>4||Ce===0?_7.ceil(ie):_7(ie),ie=VT.offset(ie,(te.V-1)*7),te.y=ie.getFullYear(),te.m=ie.getMonth(),te.d=ie.getDate()+(te.w+6)%7)}else("W"in te||"U"in te)&&("w"in te||(te.w="u"in te?te.u%7:"W"in te?1:0),Ce="Z"in te?Ebe(D7(te.y,0,1)).getUTCDay():kbe(D7(te.y,0,1)).getDay(),te.m=0,te.d="W"in te?(te.w+6)%7+te.W*7-(Ce+5)%7:te.w+te.U*7-(Ce+6)%7);return"Z"in te?(te.H+=te.Z/100|0,te.M+=te.Z%100,Ebe(te)):kbe(te)}}function C(X,J,ee,te){for(var pe=0,ie=J.length,Ce=ee.length,ke,Ee;pe=Ce)return-1;if(ke=J.charCodeAt(pe++),ke===37){if(ke=J.charAt(pe++),Ee=A[ke in eAt?J.charAt(pe++):ke],!Ee||(te=Ee(X,ee,te))<0)return-1}else if(ke!=ee.charCodeAt(te++))return-1}return te}function k(X,J,ee){var te=u.exec(J.slice(ee));return te?(X.p=h.get(te[0].toLowerCase()),ee+te[0].length):-1}function E(X,J,ee){var te=p.exec(J.slice(ee));return te?(X.w=g.get(te[0].toLowerCase()),ee+te[0].length):-1}function _(X,J,ee){var te=d.exec(J.slice(ee));return te?(X.w=f.get(te[0].toLowerCase()),ee+te[0].length):-1}function P(X,J,ee){var te=y.exec(J.slice(ee));return te?(X.m=b.get(te[0].toLowerCase()),ee+te[0].length):-1}function L(X,J,ee){var te=m.exec(J.slice(ee));return te?(X.m=v.get(te[0].toLowerCase()),ee+te[0].length):-1}function R(X,J,ee){return C(X,e,J,ee)}function D(X,J,ee){return C(X,r,J,ee)}function M(X,J,ee){return C(X,n,J,ee)}function I(X){return o[X.getDay()]}function N(X){return a[X.getDay()]}function F(X){return l[X.getMonth()]}function B(X){return s[X.getMonth()]}function V(X){return i[+(X.getHours()>=12)]}function z(X){return 1+~~(X.getMonth()/3)}function U(X){return o[X.getUTCDay()]}function Q(X){return a[X.getUTCDay()]}function G(X){return l[X.getUTCMonth()]}function q(X){return s[X.getUTCMonth()]}function Y(X){return i[+(X.getUTCHours()>=12)]}function ne(X){return 1+~~(X.getUTCMonth()/3)}return{format:function(X){var J=S(X+="",x);return J.toString=function(){return X},J},parse:function(X){var J=T(X+="",!1);return J.toString=function(){return X},J},utcFormat:function(X){var J=S(X+="",w);return J.toString=function(){return X},J},utcParse:function(X){var J=T(X+="",!0);return J.toString=function(){return X},J}}}var eAt={"-":"",_:" ",0:"0"},Bl=/^\s*\d+/,Cln=/^%/,Oln=/[\\^$*+?|[\]().{}]/g;function Ui(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a[e.toLowerCase(),r]))}function Eln(t,e,r){var n=Bl.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function _ln(t,e,r){var n=Bl.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function Rln(t,e,r){var n=Bl.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function Dln(t,e,r){var n=Bl.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function Lln(t,e,r){var n=Bl.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function tAt(t,e,r){var n=Bl.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function rAt(t,e,r){var n=Bl.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Mln(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 Iln(t,e,r){var n=Bl.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function Pln(t,e,r){var n=Bl.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function nAt(t,e,r){var n=Bl.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Nln(t,e,r){var n=Bl.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function iAt(t,e,r){var n=Bl.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function Bln(t,e,r){var n=Bl.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function $ln(t,e,r){var n=Bl.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Fln(t,e,r){var n=Bl.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function zln(t,e,r){var n=Bl.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Uln(t,e,r){var n=Cln.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Vln(t,e,r){var n=Bl.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function Qln(t,e,r){var n=Bl.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function aAt(t,e){return Ui(t.getDate(),e,2)}function Gln(t,e){return Ui(t.getHours(),e,2)}function Hln(t,e){return Ui(t.getHours()%12||12,e,2)}function Wln(t,e){return Ui(1+VT.count(n1(t),t),e,3)}function oAt(t,e){return Ui(t.getMilliseconds(),e,3)}function Yln(t,e){return oAt(t,e)+"000"}function qln(t,e){return Ui(t.getMonth()+1,e,2)}function jln(t,e){return Ui(t.getMinutes(),e,2)}function Xln(t,e){return Ui(t.getSeconds(),e,2)}function Kln(t){var e=t.getDay();return e===0?7:e}function Zln(t,e){return Ui(E7.count(n1(t)-1,t),e,2)}function sAt(t){var e=t.getDay();return e>=4||e===0?GT(t):GT.ceil(t)}function Jln(t,e){return t=sAt(t),Ui(GT.count(n1(t),t)+(n1(t).getDay()===4),e,2)}function ecn(t){return t.getDay()}function tcn(t,e){return Ui(_7.count(n1(t)-1,t),e,2)}function rcn(t,e){return Ui(t.getFullYear()%100,e,2)}function ncn(t,e){return t=sAt(t),Ui(t.getFullYear()%100,e,2)}function icn(t,e){return Ui(t.getFullYear()%1e4,e,4)}function acn(t,e){var r=t.getDay();return t=r>=4||r===0?GT(t):GT.ceil(t),Ui(t.getFullYear()%1e4,e,4)}function ocn(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Ui(e/60|0,"0",2)+Ui(e%60,"0",2)}function lAt(t,e){return Ui(t.getUTCDate(),e,2)}function scn(t,e){return Ui(t.getUTCHours(),e,2)}function lcn(t,e){return Ui(t.getUTCHours()%12||12,e,2)}function ccn(t,e){return Ui(1+Obe.count(WT(t),t),e,3)}function cAt(t,e){return Ui(t.getUTCMilliseconds(),e,3)}function ucn(t,e){return cAt(t,e)+"000"}function hcn(t,e){return Ui(t.getUTCMonth()+1,e,2)}function dcn(t,e){return Ui(t.getUTCMinutes(),e,2)}function fcn(t,e){return Ui(t.getUTCSeconds(),e,2)}function pcn(t){var e=t.getUTCDay();return e===0?7:e}function gcn(t,e){return Ui(Jwt.count(WT(t)-1,t),e,2)}function uAt(t){var e=t.getUTCDay();return e>=4||e===0?fR(t):fR.ceil(t)}function mcn(t,e){return t=uAt(t),Ui(fR.count(WT(t),t)+(WT(t).getUTCDay()===4),e,2)}function vcn(t){return t.getUTCDay()}function ycn(t,e){return Ui(aX.count(WT(t)-1,t),e,2)}function bcn(t,e){return Ui(t.getUTCFullYear()%100,e,2)}function xcn(t,e){return t=uAt(t),Ui(t.getUTCFullYear()%100,e,2)}function wcn(t,e){return Ui(t.getUTCFullYear()%1e4,e,4)}function Acn(t,e){var r=t.getUTCDay();return t=r>=4||r===0?fR(t):fR.ceil(t),Ui(t.getUTCFullYear()%1e4,e,4)}function Scn(){return"+0000"}function hAt(){return"%"}function dAt(t){return+t}function fAt(t){return Math.floor(+t/1e3)}var pR,oX;Tcn({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 Tcn(t){return pR=Tln(t),oX=pR.format,pR.parse,pR.utcFormat,pR.utcParse,pR}function Ccn(t){return new Date(t)}function Ocn(t){return t instanceof Date?+t:+new Date(+t)}function pAt(t,e,r,n,i,a,o,s,l,u){var h=Ywt(),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?I7:Math.acos(t)}function mAt(t){return t>=1?sX:t<=-1?-sX:Math.asin(t)}function vAt(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 Asn(e)}function Lcn(t){return t.innerRadius}function Mcn(t){return t.outerRadius}function Icn(t){return t.startAngle}function Pcn(t){return t.endAngle}function Ncn(t){return t&&t.padAngle}function Bcn(t,e,r,n,i,a,o,s){var l=r-t,u=n-e,h=o-i,d=s-a,f=d*l-h*u;if(!(f*fR*R+D*D&&(C=E,k=_),{cx:C,cy:k,x01:-h,y01:-d,x11:C*(i/A-1),y11:k*(i/A-1)}}function mR(){var t=Lcn,e=Mcn,r=gs(0),n=null,i=Icn,a=Pcn,o=Ncn,s=null,l=vAt(u);function u(){var h,d,f=+t.apply(this,arguments),p=+e.apply(this,arguments),g=i.apply(this,arguments)-sX,m=a.apply(this,arguments)-sX,v=gAt(m-g),y=m>g;if(s||(s=h=l()),pru))s.moveTo(0,0);else if(v>lX-ru)s.moveTo(p*YT(g),p*y0(g)),s.arc(0,0,p,g,m,!y),f>ru&&(s.moveTo(f*YT(m),f*y0(m)),s.arc(0,0,f,m,g,y));else{var b=g,x=m,w=g,A=m,S=v,T=v,C=o.apply(this,arguments)/2,k=C>ru&&(n?+n.apply(this,arguments):gR(f*f+p*p)),E=_be(gAt(p-f)/2,+r.apply(this,arguments)),_=E,P=E,L,R;if(k>ru){var D=mAt(k/f*y0(C)),M=mAt(k/p*y0(C));(S-=D*2)>ru?(D*=y?1:-1,w+=D,A-=D):(S=0,w=A=(g+m)/2),(T-=M*2)>ru?(M*=y?1:-1,b+=M,x-=M):(T=0,b=x=(g+m)/2)}var I=p*YT(b),N=p*y0(b),F=f*YT(A),B=f*y0(A);if(E>ru){var V=p*YT(x),z=p*y0(x),U=f*YT(w),Q=f*y0(w),G;if(vru?P>ru?(L=cX(U,Q,I,N,p,P,y),R=cX(V,z,F,B,p,P,y),s.moveTo(L.cx+L.x01,L.cy+L.y01),Pru)||!(S>ru)?s.lineTo(F,B):_>ru?(L=cX(F,B,V,z,f,-_,y),R=cX(I,N,U,Q,f,-_,y),s.lineTo(L.cx+L.x01,L.cy+L.y01),_t?1:e>=t?0:NaN}function Ucn(t){return t}function Vcn(){var t=Ucn,e=zcn,r=null,n=gs(0),i=gs(lX),a=gs(0);function o(s){var l,u=(s=yAt(s)).length,h,d,f=0,p=new Array(u),g=new Array(u),m=+n.apply(this,arguments),v=Math.min(lX,Math.max(-lX,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(s[A],s[S])}),l=0,d=f?(v-u*x)/f:0;l0?w*d:0)+x,g[h]={data:s[h],index:l,value:w,startAngle:m,endAngle:y,padAngle:b};return g}return o.value=function(s){return arguments.length?(t=typeof s=="function"?s:gs(+s),o):t},o.sortValues=function(s){return arguments.length?(e=s,r=null,o):e},o.sort=function(s){return arguments.length?(r=s,e=null,o):r},o.startAngle=function(s){return arguments.length?(n=typeof s=="function"?s:gs(+s),o):n},o.endAngle=function(s){return arguments.length?(i=typeof s=="function"?s:gs(+s),o):i},o.padAngle=function(s){return arguments.length?(a=typeof s=="function"?s:gs(+s),o):a},o}class xAt{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 wAt(t){return new xAt(t,!0)}function AAt(t){return new xAt(t,!1)}function v2(){}function uX(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 hX(t){this._context=t}hX.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:uX(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:uX(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function B7(t){return new hX(t)}function SAt(t){this._context=t}SAt.prototype={areaStart:v2,areaEnd:v2,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:uX(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Qcn(t){return new SAt(t)}function TAt(t){this._context=t}TAt.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:uX(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Gcn(t){return new TAt(t)}function CAt(t,e){this._basis=new hX(t),this._beta=e}CAt.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,o=e[r]-i,s=-1,l;++s<=r;)l=s/r,this._basis.point(this._beta*t[s]+(1-this._beta)*(n+l*a),this._beta*e[s]+(1-this._beta)*(i+l*o));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const Hcn=function t(e){function r(n){return e===1?new hX(n):new CAt(n,e)}return r.beta=function(n){return t(+n)},r}(.85);function dX(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 Rbe(t,e){this._context=t,this._k=(1-e)/6}Rbe.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:dX(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:dX(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 OAt=function t(e){function r(n){return new Rbe(n,e)}return r.tension=function(n){return t(+n)},r}(0);function Dbe(t,e){this._context=t,this._k=(1-e)/6}Dbe.prototype={areaStart:v2,areaEnd:v2,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:dX(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 Wcn=function t(e){function r(n){return new Dbe(n,e)}return r.tension=function(n){return t(+n)},r}(0);function Lbe(t,e){this._context=t,this._k=(1-e)/6}Lbe.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:dX(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 Ycn=function t(e){function r(n){return new Lbe(n,e)}return r.tension=function(n){return t(+n)},r}(0);function Mbe(t,e,r){var n=t._x1,i=t._y1,a=t._x2,o=t._y2;if(t._l01_a>ru){var s=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*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>ru){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,o=(o*u+t._y1*t._l23_2a-r*t._l12_2a)/h}t._context.bezierCurveTo(n,i,a,o,t._x2,t._y2)}function kAt(t,e){this._context=t,this._alpha=e}kAt.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:Mbe(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 EAt=function t(e){function r(n){return e?new kAt(n,e):new Rbe(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function _At(t,e){this._context=t,this._alpha=e}_At.prototype={areaStart:v2,areaEnd:v2,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:Mbe(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 qcn=function t(e){function r(n){return e?new _At(n,e):new Dbe(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function RAt(t,e){this._context=t,this._alpha=e}RAt.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:Mbe(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 jcn=function t(e){function r(n){return e?new RAt(n,e):new Lbe(n,0)}return r.alpha=function(n){return t(+n)},r}(.5);function DAt(t){this._context=t}DAt.prototype={areaStart:v2,areaEnd:v2,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 Xcn(t){return new DAt(t)}function LAt(t){return t<0?-1:1}function MAt(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),o=(r-t._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(LAt(a)+LAt(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function IAt(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Ibe(t,e,r){var n=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-n)/3;t._context.bezierCurveTo(n+s,i+s*e,a-s,o-s*r,a,o)}function fX(t){this._context=t}fX.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:Ibe(this,this._t0,IAt(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,Ibe(this,IAt(this,r=MAt(this,t,e)),r);break;default:Ibe(this,this._t0,r=MAt(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function PAt(t){this._context=new NAt(t)}(PAt.prototype=Object.create(fX.prototype)).point=function(t,e){fX.prototype.point.call(this,e,t)};function NAt(t){this._context=t}NAt.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 BAt(t){return new fX(t)}function $At(t){return new PAt(t)}function FAt(t){this._context=t}FAt.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=zAt(t),i=zAt(e),a=0,o=1;o=0;--e)i[e]=(o[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 VAt(t){return new pX(t,.5)}function QAt(t){return new pX(t,0)}function GAt(t){return new pX(t,1)}function $7(t,e,r){this.k=t,this.x=e,this.y=r}$7.prototype={constructor:$7,scale:function(t){return t===1?this:new $7(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new $7(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+")"}},$7.prototype;var nu=O(t=>{var i;const{securityLevel:e}=Ye();let r=_t("body");if(e==="sandbox"){const o=((i=_t(`#i${t}`).node())==null?void 0:i.contentDocument)??document;r=_t(o.body)}return r.select(`#${t}`)},"selectSvgElement");function Pbe(t){return typeof t>"u"||t===null}O(Pbe,"isNothing");function HAt(t){return typeof t=="object"&&t!==null}O(HAt,"isObject");function WAt(t){return Array.isArray(t)?t:Pbe(t)?[]:[t]}O(WAt,"toArray");function YAt(t,e){var r,n,i,a;if(e)for(a=Object.keys(e),r=0,n=a.length;rs&&(a=" ... ",e=n-s+a.length),r-n>s&&(o=" ...",r=n+s-o.length),{str:a+t.slice(e,r).replace(/\t/g,"→")+o,pos:n-e+a.length}}O(gX,"getLine");function mX(t,e){return cl.repeat(" ",e-t.length)+t}O(mX,"padStart");function qAt(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,o=-1;a=r.exec(t.buffer);)i.push(a.index),n.push(a.index+a[0].length),t.position<=a.index&&o<0&&(o=n.length-2);o<0&&(o=n.length-1);var s="",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&&!(o-l<0);l++)u=gX(t.buffer,n[o-l],i[o-l],t.position-(n[o]-n[o-l]),d),s=cl.repeat(" ",e.indent)+mX((t.line-l+1).toString(),h)+" | "+u.str+` +`+t.mark.snippet),n+" "+r):n}O(Nbe,"formatError");function vR(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=Nbe(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}O(vR,"YAMLException$1"),vR.prototype=Object.create(Error.prototype),vR.prototype.constructor=vR,vR.prototype.toString=O(function(e){return this.name+": "+Nbe(this,e)},"toString");var Hh=vR;function gX(t,e,r,n,i){var a="",o="",s=Math.floor(i/2)-1;return n-e>s&&(a=" ... ",e=n-s+a.length),r-n>s&&(o=" ...",r=n+s-o.length),{str:a+t.slice(e,r).replace(/\t/g,"→")+o,pos:n-e+a.length}}O(gX,"getLine");function mX(t,e){return cl.repeat(" ",e-t.length)+t}O(mX,"padStart");function XAt(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,o=-1;a=r.exec(t.buffer);)i.push(a.index),n.push(a.index+a[0].length),t.position<=a.index&&o<0&&(o=n.length-2);o<0&&(o=n.length-1);var s="",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&&!(o-l<0);l++)u=gX(t.buffer,n[o-l],i[o-l],t.position-(n[o]-n[o-l]),d),s=cl.repeat(" ",e.indent)+mX((t.line-l+1).toString(),h)+" | "+u.str+` `+s;for(u=gX(t.buffer,n[o],i[o],t.position,d),s+=cl.repeat(" ",e.indent)+mX((t.line+1).toString(),h)+" | "+u.str+` `,s+=cl.repeat("-",e.indent+h+3+u.pos)+`^ `,l=1;l<=e.linesAfter&&!(o+l>=i.length);l++)u=gX(t.buffer,n[o+l],i[o+l],t.position-(n[o]-n[o+l]),d),s+=cl.repeat(" ",e.indent)+mX((t.line+l+1).toString(),h)+" | "+u.str+` -`;return s.replace(/\n$/,"")}O(qAt,"makeSnippet");var tun=qAt,run=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],nun=["scalar","sequence","mapping"];function jAt(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}O(jAt,"compileStyleAliases");function XAt(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(run.indexOf(r)===-1)throw new Hh('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=jAt(e.styleAliases||null),nun.indexOf(this.kind)===-1)throw new Hh('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}O(XAt,"Type$1");var iu=XAt;function Bbe(t,e){var r=[];return t[e].forEach(function(n){var i=r.length;r.forEach(function(a,o){a.tag===n.tag&&a.kind===n.kind&&a.multi===n.multi&&(i=o)}),r[i]=n}),r}O(Bbe,"compileList");function KAt(){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(O(n,"collectType"),e=0,r=arguments.length;e=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:O(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:O(function(t){return t.toString(10)},"decimal"),hexadecimal:O(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"]}}),dun=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function uSt(t){return!(t===null||!dun.test(t)||t[t.length-1]==="_")}O(uSt,"resolveYamlFloat");function hSt(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)}O(hSt,"constructYamlFloat");var fun=/^[-+]?[0-9]+e/;function dSt(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(cl.isNegativeZero(t))return"-0.0";return r=t.toString(10),fun.test(r)?r.replace("e",".e"):r}O(dSt,"representYamlFloat");function fSt(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||cl.isNegativeZero(t))}O(fSt,"isFloat");var pun=new iu("tag:yaml.org,2002:float",{kind:"scalar",resolve:uSt,construct:hSt,predicate:fSt,represent:dSt,defaultStyle:"lowercase"}),pSt=lun.extend({implicit:[cun,uun,hun,pun]}),gun=pSt,gSt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),mSt=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 vSt(t){return t===null?!1:gSt.exec(t)!==null||mSt.exec(t)!==null}O(vSt,"resolveYamlTimestamp");function ySt(t){var e,r,n,i,a,o,s,l=0,u=null,h,d,f;if(e=gSt.exec(t),e===null&&(e=mSt.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],o=+e[5],s=+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,o,s,l)),u&&f.setTime(f.getTime()-u),f}O(ySt,"constructYamlTimestamp");function bSt(t){return t.toISOString()}O(bSt,"representYamlTimestamp");var mun=new iu("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:vSt,construct:ySt,instanceOf:Date,represent:bSt});function xSt(t){return t==="<<"||t===null}O(xSt,"resolveYamlMerge");var vun=new iu("tag:yaml.org,2002:merge",{kind:"scalar",resolve:xSt}),$be=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function wSt(t){if(t===null)return!1;var e,r,n=0,i=t.length,a=$be;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}O(wSt,"resolveYamlBinary");function ASt(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,a=$be,o=0,s=[];for(e=0;e>16&255),s.push(o>>8&255),s.push(o&255)),o=o<<6|a.indexOf(n.charAt(e));return r=i%4*6,r===0?(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)):r===18?(s.push(o>>10&255),s.push(o>>2&255)):r===12&&s.push(o>>4&255),new Uint8Array(s)}O(ASt,"constructYamlBinary");function SSt(t){var e="",r=0,n,i,a=t.length,o=$be;for(n=0;n>18&63],e+=o[r>>12&63],e+=o[r>>6&63],e+=o[r&63]),r=(r<<8)+t[n];return i=a%3,i===0?(e+=o[r>>18&63],e+=o[r>>12&63],e+=o[r>>6&63],e+=o[r&63]):i===2?(e+=o[r>>10&63],e+=o[r>>4&63],e+=o[r<<2&63],e+=o[64]):i===1&&(e+=o[r>>2&63],e+=o[r<<4&63],e+=o[64],e+=o[64]),e}O(SSt,"representYamlBinary");function TSt(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}O(TSt,"isBinary");var yun=new iu("tag:yaml.org,2002:binary",{kind:"scalar",resolve:wSt,construct:ASt,predicate:TSt,represent:SSt}),bun=Object.prototype.hasOwnProperty,xun=Object.prototype.toString;function CSt(t){if(t===null)return!0;var e=[],r,n,i,a,o,s=t;for(r=0,n=s.length;r>10)+55296,(t-65536&1023)+56320)}O(zSt,"charFromCodepoint");function Vbe(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}O(Vbe,"setProperty");var USt=new Array(256),VSt=new Array(256);for(jT=0;jT<256;jT++)USt[jT]=Ube(jT)?1:0,VSt[jT]=Ube(jT);var jT;function QSt(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||DSt,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=[]}O(QSt,"State$1");function Qbe(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=tun(r),new Hh(e,r)}O(Qbe,"generateError");function Hr(t,e){throw Qbe(t,e)}O(Hr,"throwError");function F7(t,e){t.onWarning&&t.onWarning.call(null,Qbe(t,e))}O(F7,"throwWarning");var GSt={YAML:O(function(e,r,n){var i,a,o;e.version!==null&&Hr(e,"duplication of %YAML directive"),n.length!==1&&Hr(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&Hr(e,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),o=parseInt(i[2],10),a!==1&&Hr(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&F7(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:O(function(e,r,n){var i,a;n.length!==2&&Hr(e,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],PSt.test(i)||Hr(e,"ill-formed tag handle (first argument) of the TAG directive"),y2.call(e.tagMap,i)&&Hr(e,'there is a previously declared suffix for "'+i+'" tag handle'),NSt.test(a)||Hr(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{Hr(e,"tag prefix is malformed: "+a)}e.tagMap[i]=a},"handleTagDirective")};function i1(t,e,r,n){var i,a,o,s;if(e1&&(t.result+=cl.repeat(` -`,e-1))}O(wX,"writeFoldedLines");function HSt(t,e,r){var n,i,a,o,s,l,u,h,d=t.kind,f=t.result,p;if(p=t.input.charCodeAt(t.position),zu(p)||qT(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),zu(i)||r&&qT(i)))return!1;for(t.kind="scalar",t.result="",a=o=t.position,s=!1;p!==0;){if(p===58){if(i=t.input.charCodeAt(t.position+1),zu(i)||r&&qT(i))break}else if(p===35){if(n=t.input.charCodeAt(t.position-1),zu(n))break}else{if(t.position===t.lineStart&&z7(t)||r&&qT(p))break;if(kg(p))if(l=t.line,u=t.lineStart,h=t.lineIndent,ms(t,!1,-1),t.lineIndent>=e){s=!0,p=t.input.charCodeAt(t.position);continue}else{t.position=o,t.line=l,t.lineStart=u,t.lineIndent=h;break}}s&&(i1(t,a,o,!1),wX(t,t.line-l),a=o=t.position,s=!1),b2(p)||(o=t.position+1),p=t.input.charCodeAt(++t.position)}return i1(t,a,o,!1),t.result?!0:(t.kind=d,t.result=f,!1)}O(HSt,"readPlainScalar");function WSt(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(i1(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 kg(r)?(i1(t,n,i,!0),wX(t,ms(t,!1,e)),n=i=t.position):t.position===t.lineStart&&z7(t)?Hr(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);Hr(t,"unexpected end of the stream within a single quoted scalar")}O(WSt,"readSingleQuotedScalar");function YSt(t,e){var r,n,i,a,o,s;if(s=t.input.charCodeAt(t.position),s!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(s=t.input.charCodeAt(t.position))!==0;){if(s===34)return i1(t,r,t.position,!0),t.position++,!0;if(s===92){if(i1(t,r,t.position,!0),s=t.input.charCodeAt(++t.position),kg(s))ms(t,!1,e);else if(s<256&&USt[s])t.result+=VSt[s],t.position++;else if((o=$St(s))>0){for(i=o,a=0;i>0;i--)s=t.input.charCodeAt(++t.position),(o=BSt(s))>=0?a=(a<<4)+o:Hr(t,"expected hexadecimal character");t.result+=zSt(a),t.position++}else Hr(t,"unknown escape sequence");r=n=t.position}else kg(s)?(i1(t,r,n,!0),wX(t,ms(t,!1,e)),r=n=t.position):t.position===t.lineStart&&z7(t)?Hr(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}Hr(t,"unexpected end of the stream within a double quoted scalar")}O(YSt,"readDoubleQuotedScalar");function qSt(t,e){var r=!0,n,i,a,o=t.tag,s,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,s=[];else if(b===123)h=125,p=!0,s={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=s),b=t.input.charCodeAt(++t.position);b!==0;){if(ms(t,!0,e),b=t.input.charCodeAt(t.position),b===h)return t.position++,t.tag=o,t.anchor=l,t.kind=p?"mapping":"sequence",t.result=s,!0;r?b===44&&Hr(t,"expected the node content, but found ','"):Hr(t,"missed comma between flow collection entries"),v=m=y=null,d=f=!1,b===63&&(u=t.input.charCodeAt(t.position+1),zu(u)&&(d=f=!0,t.position++,ms(t,!0,e))),n=t.line,i=t.lineStart,a=t.position,KT(t,e,yX,!1,!0),v=t.tag,m=t.result,ms(t,!0,e),b=t.input.charCodeAt(t.position),(f||t.line===n)&&b===58&&(d=!0,b=t.input.charCodeAt(++t.position),ms(t,!0,e),KT(t,e,yX,!1,!0),y=t.result),p?XT(t,s,g,v,m,y,n,i,a):d?s.push(XT(t,null,g,v,m,y,n,i,a)):s.push(m),ms(t,!0,e),b=t.input.charCodeAt(t.position),b===44?(r=!0,b=t.input.charCodeAt(++t.position)):r=!1}Hr(t,"unexpected end of the stream within a flow collection")}O(qSt,"readFlowCollection");function jSt(t,e){var r,n,i=Fbe,a=!1,o=!1,s=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)Fbe===i?i=d===43?ISt:Oun:Hr(t,"repeat of a chomping mode identifier");else if((h=FSt(d))>=0)h===0?Hr(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?Hr(t,"repeat of an indentation width identifier"):(s=e+h-1,o=!0);else break;if(b2(d)){do d=t.input.charCodeAt(++t.position);while(b2(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!kg(d)&&d!==0)}for(;d!==0;){for(xX(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!o||t.lineIndents&&(s=t.lineIndent),kg(d)){l++;continue}if(t.lineIndent=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:O(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:O(function(t){return t.toString(10)},"decimal"),hexadecimal:O(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"]}}),pun=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function dSt(t){return!(t===null||!pun.test(t)||t[t.length-1]==="_")}O(dSt,"resolveYamlFloat");function fSt(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)}O(fSt,"constructYamlFloat");var gun=/^[-+]?[0-9]+e/;function pSt(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(cl.isNegativeZero(t))return"-0.0";return r=t.toString(10),gun.test(r)?r.replace("e",".e"):r}O(pSt,"representYamlFloat");function gSt(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||cl.isNegativeZero(t))}O(gSt,"isFloat");var mun=new iu("tag:yaml.org,2002:float",{kind:"scalar",resolve:dSt,construct:fSt,predicate:gSt,represent:pSt,defaultStyle:"lowercase"}),mSt=uun.extend({implicit:[hun,dun,fun,mun]}),vun=mSt,vSt=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),ySt=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 bSt(t){return t===null?!1:vSt.exec(t)!==null||ySt.exec(t)!==null}O(bSt,"resolveYamlTimestamp");function xSt(t){var e,r,n,i,a,o,s,l=0,u=null,h,d,f;if(e=vSt.exec(t),e===null&&(e=ySt.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],o=+e[5],s=+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,o,s,l)),u&&f.setTime(f.getTime()-u),f}O(xSt,"constructYamlTimestamp");function wSt(t){return t.toISOString()}O(wSt,"representYamlTimestamp");var yun=new iu("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:bSt,construct:xSt,instanceOf:Date,represent:wSt});function ASt(t){return t==="<<"||t===null}O(ASt,"resolveYamlMerge");var bun=new iu("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ASt}),$be=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function SSt(t){if(t===null)return!1;var e,r,n=0,i=t.length,a=$be;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}O(SSt,"resolveYamlBinary");function TSt(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,a=$be,o=0,s=[];for(e=0;e>16&255),s.push(o>>8&255),s.push(o&255)),o=o<<6|a.indexOf(n.charAt(e));return r=i%4*6,r===0?(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)):r===18?(s.push(o>>10&255),s.push(o>>2&255)):r===12&&s.push(o>>4&255),new Uint8Array(s)}O(TSt,"constructYamlBinary");function CSt(t){var e="",r=0,n,i,a=t.length,o=$be;for(n=0;n>18&63],e+=o[r>>12&63],e+=o[r>>6&63],e+=o[r&63]),r=(r<<8)+t[n];return i=a%3,i===0?(e+=o[r>>18&63],e+=o[r>>12&63],e+=o[r>>6&63],e+=o[r&63]):i===2?(e+=o[r>>10&63],e+=o[r>>4&63],e+=o[r<<2&63],e+=o[64]):i===1&&(e+=o[r>>2&63],e+=o[r<<4&63],e+=o[64],e+=o[64]),e}O(CSt,"representYamlBinary");function OSt(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}O(OSt,"isBinary");var xun=new iu("tag:yaml.org,2002:binary",{kind:"scalar",resolve:SSt,construct:TSt,predicate:OSt,represent:CSt}),wun=Object.prototype.hasOwnProperty,Aun=Object.prototype.toString;function kSt(t){if(t===null)return!0;var e=[],r,n,i,a,o,s=t;for(r=0,n=s.length;r>10)+55296,(t-65536&1023)+56320)}O(VSt,"charFromCodepoint");function Vbe(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}O(Vbe,"setProperty");var QSt=new Array(256),GSt=new Array(256);for(jT=0;jT<256;jT++)QSt[jT]=Ube(jT)?1:0,GSt[jT]=Ube(jT);var jT;function HSt(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||MSt,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=[]}O(HSt,"State$1");function Qbe(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=nun(r),new Hh(e,r)}O(Qbe,"generateError");function Hr(t,e){throw Qbe(t,e)}O(Hr,"throwError");function F7(t,e){t.onWarning&&t.onWarning.call(null,Qbe(t,e))}O(F7,"throwWarning");var WSt={YAML:O(function(e,r,n){var i,a,o;e.version!==null&&Hr(e,"duplication of %YAML directive"),n.length!==1&&Hr(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&Hr(e,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),o=parseInt(i[2],10),a!==1&&Hr(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&F7(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:O(function(e,r,n){var i,a;n.length!==2&&Hr(e,"TAG directive accepts exactly two arguments"),i=n[0],a=n[1],BSt.test(i)||Hr(e,"ill-formed tag handle (first argument) of the TAG directive"),y2.call(e.tagMap,i)&&Hr(e,'there is a previously declared suffix for "'+i+'" tag handle'),$St.test(a)||Hr(e,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{Hr(e,"tag prefix is malformed: "+a)}e.tagMap[i]=a},"handleTagDirective")};function i1(t,e,r,n){var i,a,o,s;if(e1&&(t.result+=cl.repeat(` +`,e-1))}O(wX,"writeFoldedLines");function YSt(t,e,r){var n,i,a,o,s,l,u,h,d=t.kind,f=t.result,p;if(p=t.input.charCodeAt(t.position),zu(p)||qT(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),zu(i)||r&&qT(i)))return!1;for(t.kind="scalar",t.result="",a=o=t.position,s=!1;p!==0;){if(p===58){if(i=t.input.charCodeAt(t.position+1),zu(i)||r&&qT(i))break}else if(p===35){if(n=t.input.charCodeAt(t.position-1),zu(n))break}else{if(t.position===t.lineStart&&z7(t)||r&&qT(p))break;if(kg(p))if(l=t.line,u=t.lineStart,h=t.lineIndent,ms(t,!1,-1),t.lineIndent>=e){s=!0,p=t.input.charCodeAt(t.position);continue}else{t.position=o,t.line=l,t.lineStart=u,t.lineIndent=h;break}}s&&(i1(t,a,o,!1),wX(t,t.line-l),a=o=t.position,s=!1),b2(p)||(o=t.position+1),p=t.input.charCodeAt(++t.position)}return i1(t,a,o,!1),t.result?!0:(t.kind=d,t.result=f,!1)}O(YSt,"readPlainScalar");function qSt(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(i1(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 kg(r)?(i1(t,n,i,!0),wX(t,ms(t,!1,e)),n=i=t.position):t.position===t.lineStart&&z7(t)?Hr(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);Hr(t,"unexpected end of the stream within a single quoted scalar")}O(qSt,"readSingleQuotedScalar");function jSt(t,e){var r,n,i,a,o,s;if(s=t.input.charCodeAt(t.position),s!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(s=t.input.charCodeAt(t.position))!==0;){if(s===34)return i1(t,r,t.position,!0),t.position++,!0;if(s===92){if(i1(t,r,t.position,!0),s=t.input.charCodeAt(++t.position),kg(s))ms(t,!1,e);else if(s<256&&QSt[s])t.result+=GSt[s],t.position++;else if((o=zSt(s))>0){for(i=o,a=0;i>0;i--)s=t.input.charCodeAt(++t.position),(o=FSt(s))>=0?a=(a<<4)+o:Hr(t,"expected hexadecimal character");t.result+=VSt(a),t.position++}else Hr(t,"unknown escape sequence");r=n=t.position}else kg(s)?(i1(t,r,n,!0),wX(t,ms(t,!1,e)),r=n=t.position):t.position===t.lineStart&&z7(t)?Hr(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}Hr(t,"unexpected end of the stream within a double quoted scalar")}O(jSt,"readDoubleQuotedScalar");function XSt(t,e){var r=!0,n,i,a,o=t.tag,s,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,s=[];else if(b===123)h=125,p=!0,s={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=s),b=t.input.charCodeAt(++t.position);b!==0;){if(ms(t,!0,e),b=t.input.charCodeAt(t.position),b===h)return t.position++,t.tag=o,t.anchor=l,t.kind=p?"mapping":"sequence",t.result=s,!0;r?b===44&&Hr(t,"expected the node content, but found ','"):Hr(t,"missed comma between flow collection entries"),v=m=y=null,d=f=!1,b===63&&(u=t.input.charCodeAt(t.position+1),zu(u)&&(d=f=!0,t.position++,ms(t,!0,e))),n=t.line,i=t.lineStart,a=t.position,KT(t,e,yX,!1,!0),v=t.tag,m=t.result,ms(t,!0,e),b=t.input.charCodeAt(t.position),(f||t.line===n)&&b===58&&(d=!0,b=t.input.charCodeAt(++t.position),ms(t,!0,e),KT(t,e,yX,!1,!0),y=t.result),p?XT(t,s,g,v,m,y,n,i,a):d?s.push(XT(t,null,g,v,m,y,n,i,a)):s.push(m),ms(t,!0,e),b=t.input.charCodeAt(t.position),b===44?(r=!0,b=t.input.charCodeAt(++t.position)):r=!1}Hr(t,"unexpected end of the stream within a flow collection")}O(XSt,"readFlowCollection");function KSt(t,e){var r,n,i=Fbe,a=!1,o=!1,s=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)Fbe===i?i=d===43?NSt:Eun:Hr(t,"repeat of a chomping mode identifier");else if((h=USt(d))>=0)h===0?Hr(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?Hr(t,"repeat of an indentation width identifier"):(s=e+h-1,o=!0);else break;if(b2(d)){do d=t.input.charCodeAt(++t.position);while(b2(d));if(d===35)do d=t.input.charCodeAt(++t.position);while(!kg(d)&&d!==0)}for(;d!==0;){for(xX(t),t.lineIndent=0,d=t.input.charCodeAt(t.position);(!o||t.lineIndents&&(s=t.lineIndent),kg(d)){l++;continue}if(t.lineIndente)&&l!==0)Hr(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(v&&(o=t.line,s=t.lineStart,l=t.position),KT(t,e,bX,!0,i)&&(v?g=t.result:m=t.result),v||(XT(t,d,f,p,g,m,o,s,l),p=g=m=null),ms(t,!0,-1),b=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&b!==0)Hr(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&&Hr(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)):Hr(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}O(KT,"composeNode");function eTt(t){var e=t.position,r,n,i,a=!1,o;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(o=t.input.charCodeAt(t.position))!==0&&(ms(t,!0,-1),o=t.input.charCodeAt(t.position),!(t.lineIndent>0||o!==37));){for(a=!0,o=t.input.charCodeAt(++t.position),r=t.position;o!==0&&!zu(o);)o=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&Hr(t,"directive name must not be less than one character in length");o!==0;){for(;b2(o);)o=t.input.charCodeAt(++t.position);if(o===35){do o=t.input.charCodeAt(++t.position);while(o!==0&&!kg(o));break}if(kg(o))break;for(r=t.position;o!==0&&!zu(o);)o=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}o!==0&&xX(t),y2.call(GSt,n)?GSt[n](t,n,i):F7(t,'unknown document directive "'+n+'"')}if(ms(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,ms(t,!0,-1)):a&&Hr(t,"directives end mark is expected"),KT(t,t.lineIndent-1,bX,!1,!0),ms(t,!0,-1),t.checkLineBreaks&&Eun.test(t.input.slice(e,t.position))&&F7(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&z7(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,ms(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var n=Wbe(t,r);if(typeof e!="function")return n;for(var i=0,a=n.length;ie)&&l!==0)Hr(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(v&&(o=t.line,s=t.lineStart,l=t.position),KT(t,e,bX,!0,i)&&(v?g=t.result:m=t.result),v||(XT(t,d,f,p,g,m,o,s,l),p=g=m=null),ms(t,!0,-1),b=t.input.charCodeAt(t.position)),(t.line===a||t.lineIndent>e)&&b!==0)Hr(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&&Hr(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)):Hr(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}O(KT,"composeNode");function rTt(t){var e=t.position,r,n,i,a=!1,o;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(o=t.input.charCodeAt(t.position))!==0&&(ms(t,!0,-1),o=t.input.charCodeAt(t.position),!(t.lineIndent>0||o!==37));){for(a=!0,o=t.input.charCodeAt(++t.position),r=t.position;o!==0&&!zu(o);)o=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&Hr(t,"directive name must not be less than one character in length");o!==0;){for(;b2(o);)o=t.input.charCodeAt(++t.position);if(o===35){do o=t.input.charCodeAt(++t.position);while(o!==0&&!kg(o));break}if(kg(o))break;for(r=t.position;o!==0&&!zu(o);)o=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}o!==0&&xX(t),y2.call(WSt,n)?WSt[n](t,n,i):F7(t,'unknown document directive "'+n+'"')}if(ms(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,ms(t,!0,-1)):a&&Hr(t,"directives end mark is expected"),KT(t,t.lineIndent-1,bX,!1,!0),ms(t,!0,-1),t.checkLineBreaks&&Run.test(t.input.slice(e,t.position))&&F7(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&z7(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,ms(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var n=Wbe(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}O(bR,"codePointAt");function Zbe(t){var e=/^\n* /;return e.test(t)}O(Zbe,"needIndentIndicator");var gTt=1,Jbe=2,mTt=3,vTt=4,xR=5;function yTt(t,e,r,n,i,a,o,s){var l,u=0,h=null,d=!1,f=!1,p=n!==-1,g=-1,m=fTt(bR(t,0))&&pTt(bR(t,t.length-1));if(e||o)for(l=0;l=65536?l+=2:l++){if(u=bR(t,l),!yR(u))return xR;m=m&&Kbe(u,h,s),h=u}else{for(l=0;l=65536?l+=2:l++){if(u=bR(t,l),u===U7)d=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!yR(u))return xR;m=m&&Kbe(u,h,s),h=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!d&&!f?m&&!o&&!i(t)?gTt:a===V7?xR:Jbe:r>9&&Zbe(t)?xR:o?a===V7?xR:Jbe:f?vTt:mTt}O(yTt,"chooseScalarStyle");function bTt(t,e,r,n,i){t.dump=function(){if(e.length===0)return t.quotingType===V7?'""':"''";if(!t.noCompatMode&&(jun.indexOf(e)!==-1||Xun.test(e)))return t.quotingType===V7?'"'+e+'"':"'"+e+"'";var a=t.indent*Math.max(1,r),o=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),s=n||t.flowLevel>-1&&r>=t.flowLevel;function l(u){return dTt(t,u)}switch(O(l,"testAmbiguity"),yTt(e,s,t.indent,o,l,t.quotingType,t.forceQuotes&&!n,i)){case gTt:return e;case Jbe:return"'"+e.replace(/'/g,"''")+"'";case mTt:return"|"+exe(e,t.indent)+txe(jbe(e,a));case vTt:return">"+exe(e,t.indent)+txe(jbe(xTt(e,o),a));case xR:return'"'+wTt(e)+'"';default:throw new Hh("impossible error: invalid scalar style")}}()}O(bTt,"writeScalar");function exe(t,e){var r=Zbe(t)?String(e):"",n=t[t.length-1]===` +`+cl.repeat(" ",t.indent*e)}O(SX,"generateNextLine");function pTt(t,e){var r,n,i;for(r=0,n=t.implicitTypes.length;r=55296&&r<=56319&&e+1=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}O(bR,"codePointAt");function Zbe(t){var e=/^\n* /;return e.test(t)}O(Zbe,"needIndentIndicator");var vTt=1,Jbe=2,yTt=3,bTt=4,xR=5;function xTt(t,e,r,n,i,a,o,s){var l,u=0,h=null,d=!1,f=!1,p=n!==-1,g=-1,m=gTt(bR(t,0))&&mTt(bR(t,t.length-1));if(e||o)for(l=0;l=65536?l+=2:l++){if(u=bR(t,l),!yR(u))return xR;m=m&&Kbe(u,h,s),h=u}else{for(l=0;l=65536?l+=2:l++){if(u=bR(t,l),u===U7)d=!0,p&&(f=f||l-g-1>n&&t[g+1]!==" ",g=l);else if(!yR(u))return xR;m=m&&Kbe(u,h,s),h=u}f=f||p&&l-g-1>n&&t[g+1]!==" "}return!d&&!f?m&&!o&&!i(t)?vTt:a===V7?xR:Jbe:r>9&&Zbe(t)?xR:o?a===V7?xR:Jbe:f?bTt:yTt}O(xTt,"chooseScalarStyle");function wTt(t,e,r,n,i){t.dump=function(){if(e.length===0)return t.quotingType===V7?'""':"''";if(!t.noCompatMode&&(Kun.indexOf(e)!==-1||Zun.test(e)))return t.quotingType===V7?'"'+e+'"':"'"+e+"'";var a=t.indent*Math.max(1,r),o=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),s=n||t.flowLevel>-1&&r>=t.flowLevel;function l(u){return pTt(t,u)}switch(O(l,"testAmbiguity"),xTt(e,s,t.indent,o,l,t.quotingType,t.forceQuotes&&!n,i)){case vTt:return e;case Jbe:return"'"+e.replace(/'/g,"''")+"'";case yTt:return"|"+exe(e,t.indent)+txe(jbe(e,a));case bTt:return">"+exe(e,t.indent)+txe(jbe(ATt(e,o),a));case xR:return'"'+STt(e)+'"';default:throw new Hh("impossible error: invalid scalar style")}}()}O(wTt,"writeScalar");function exe(t,e){var r=Zbe(t)?String(e):"",n=t[t.length-1]===` `,i=n&&(t[t.length-2]===` `||t===` `),a=i?"+":n?"":"-";return r+a+` `}O(exe,"blockHeader");function txe(t){return t[t.length-1]===` -`?t.slice(0,-1):t}O(txe,"dropEndingNewline");function xTt(t,e){for(var r=/(\n+)([^\n]*)/g,n=function(){var u=t.indexOf(` +`?t.slice(0,-1):t}O(txe,"dropEndingNewline");function ATt(t,e){for(var r=/(\n+)([^\n]*)/g,n=function(){var u=t.indexOf(` `);return u=u!==-1?u:t.length,r.lastIndex=u,rxe(t.slice(0,u),e)}(),i=t[0]===` `||t[0]===" ",a,o;o=r.exec(t);){var s=o[1],l=o[2];a=l[0]===" ",n+=s+(!i&&!a&&l!==""?` -`:"")+rxe(l,e),i=a}return n}O(xTt,"foldString");function rxe(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,n,i=0,a,o=0,s=0,l="";n=r.exec(t);)s=n.index,s-i>e&&(a=o>i?o:s,l+=` +`:"")+rxe(l,e),i=a}return n}O(ATt,"foldString");function rxe(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,n,i=0,a,o=0,s=0,l="";n=r.exec(t);)s=n.index,s-i>e&&(a=o>i?o:s,l+=` `+t.slice(i,a),i=a+1),o=s;return l+=` `,t.length-i>e&&o>i?l+=t.slice(i,o)+` -`+t.slice(o+1):l+=t.slice(i),l.slice(1)}O(rxe,"foldLine");function wTt(t){for(var e="",r=0,n,i=0;i=65536?i+=2:i++)r=bR(t,i),n=au[r],!n&&yR(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||uTt(r);return e}O(wTt,"escapeString");function ATt(t,e,r){var n="",i=t.tag,a,o,s;for(a=0,o=r.length;a"u"&&b0(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}O(ATt,"writeFlowSequence");function nxe(t,e,r,n){var i="",a=t.tag,o,s,l;for(o=0,s=r.length;o"u"&&b0(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=SX(t,e)),t.dump&&U7===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=a,t.dump=i||"[]"}O(nxe,"writeBlockSequence");function STt(t,e,r){var n="",i=t.tag,a=Object.keys(r),o,s,l,u,h;for(o=0,s=a.length;o1024&&(h+="? "),h+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),b0(t,e,u,!1,!1)&&(h+=t.dump,n+=h));t.tag=i,t.dump="{"+n+"}"}O(STt,"writeFlowMapping");function TTt(t,e,r,n){var i="",a=t.tag,o=Object.keys(r),s,l,u,h,d,f;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new Hh("sortKeys must be a boolean or a function");for(s=0,l=o.length;s1024,d&&(t.dump&&U7===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,d&&(f+=SX(t,e)),b0(t,e+1,h,!0,d)&&(t.dump&&U7===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=a,t.dump=i||"{}"}O(TTt,"writeBlockMapping");function ixe(t,e,r){var n,i,a,o,s,l;for(i=r?t.explicitTypes:t.implicitTypes,a=0,o=i.length;a tag resolver accepts not "'+l+'" style');t.dump=n}return!0}return!1}O(ixe,"detectType");function b0(t,e,r,n,i,a,o){t.tag=null,t.dump=r,ixe(t,r,!1)||ixe(t,r,!0);var s=rTt.call(t.dump),l=n,u;n&&(n=t.flowLevel<0||t.flowLevel>e);var h=s==="[object Object]"||s==="[object Array]",d,f;if(h&&(d=t.duplicates.indexOf(r),f=d!==-1),(t.tag!==null&&t.tag!=="?"||f||t.indent!==2&&e>0)&&(i=!1),f&&t.usedDuplicates[d])t.dump="*ref_"+d;else{if(h&&f&&!t.usedDuplicates[d]&&(t.usedDuplicates[d]=!0),s==="[object Object]")n&&Object.keys(t.dump).length!==0?(TTt(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(STt(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(s==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?nxe(t,e-1,t.dump,i):nxe(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(ATt(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(s==="[object String]")t.tag!=="?"&&bTt(t,t.dump,e,a,l);else{if(s==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new Hh("unacceptable kind of an object to dump "+s)}t.tag!==null&&t.tag!=="?"&&(u=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",t.dump=u+" "+t.dump)}return!0}O(b0,"writeNode");function CTt(t,e){var r=[],n=[],i,a;for(TX(t,r,n),i=0,a=n.length;i=65536?i+=2:i++)r=bR(t,i),n=au[r],!n&&yR(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||dTt(r);return e}O(STt,"escapeString");function TTt(t,e,r){var n="",i=t.tag,a,o,s;for(a=0,o=r.length;a"u"&&b0(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}O(TTt,"writeFlowSequence");function nxe(t,e,r,n){var i="",a=t.tag,o,s,l;for(o=0,s=r.length;o"u"&&b0(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=SX(t,e)),t.dump&&U7===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=a,t.dump=i||"[]"}O(nxe,"writeBlockSequence");function CTt(t,e,r){var n="",i=t.tag,a=Object.keys(r),o,s,l,u,h;for(o=0,s=a.length;o1024&&(h+="? "),h+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),b0(t,e,u,!1,!1)&&(h+=t.dump,n+=h));t.tag=i,t.dump="{"+n+"}"}O(CTt,"writeFlowMapping");function OTt(t,e,r,n){var i="",a=t.tag,o=Object.keys(r),s,l,u,h,d,f;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new Hh("sortKeys must be a boolean or a function");for(s=0,l=o.length;s1024,d&&(t.dump&&U7===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,d&&(f+=SX(t,e)),b0(t,e+1,h,!0,d)&&(t.dump&&U7===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=a,t.dump=i||"{}"}O(OTt,"writeBlockMapping");function ixe(t,e,r){var n,i,a,o,s,l;for(i=r?t.explicitTypes:t.implicitTypes,a=0,o=i.length;a tag resolver accepts not "'+l+'" style');t.dump=n}return!0}return!1}O(ixe,"detectType");function b0(t,e,r,n,i,a,o){t.tag=null,t.dump=r,ixe(t,r,!1)||ixe(t,r,!0);var s=iTt.call(t.dump),l=n,u;n&&(n=t.flowLevel<0||t.flowLevel>e);var h=s==="[object Object]"||s==="[object Array]",d,f;if(h&&(d=t.duplicates.indexOf(r),f=d!==-1),(t.tag!==null&&t.tag!=="?"||f||t.indent!==2&&e>0)&&(i=!1),f&&t.usedDuplicates[d])t.dump="*ref_"+d;else{if(h&&f&&!t.usedDuplicates[d]&&(t.usedDuplicates[d]=!0),s==="[object Object]")n&&Object.keys(t.dump).length!==0?(OTt(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(CTt(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(s==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?nxe(t,e-1,t.dump,i):nxe(t,e,t.dump,i),f&&(t.dump="&ref_"+d+t.dump)):(TTt(t,e,t.dump),f&&(t.dump="&ref_"+d+" "+t.dump));else if(s==="[object String]")t.tag!=="?"&&wTt(t,t.dump,e,a,l);else{if(s==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new Hh("unacceptable kind of an object to dump "+s)}t.tag!==null&&t.tag!=="?"&&(u=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",t.dump=u+" "+t.dump)}return!0}O(b0,"writeNode");function kTt(t,e){var r=[],n=[],i,a;for(TX(t,r,n),i=0,a=n.length;i{const{handDrawnSeed:e}=Ye();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),wR=O(t=>{const e=thn([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),thn=O(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"),axe=O(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=O(t=>{const{stylesArray:e}=wR(t),r=[],n=[],i=[],a=[];return e.forEach(o=>{const s=o[0];axe(s)?r.push(o.join(":")+" !important"):(n.push(o.join(":")+" !important"),s.includes("stroke")&&i.push(o.join(":")+" !important"),s==="fill"&&a.push(o.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}},"styles2String"),_r=O((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=Ye(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:o}=wR(t);return Object.assign({roughness:.7,fill:o.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:o.get("stroke")||i,seed:n,strokeWidth:((l=o.get("stroke-width"))==null?void 0:l.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:rhn(o.get("stroke-dasharray"))},e)},"userNodeOverrides"),rhn=O(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"),OTt={},$l={};Object.defineProperty($l,"__esModule",{value:!0}),$l.BLANK_URL=$l.relativeFirstCharacters=$l.whitespaceEscapeCharsRegex=$l.urlSchemeRegex=$l.ctrlCharactersRegex=$l.htmlCtrlEntityRegex=$l.htmlEntitiesRegex=$l.invalidProtocolRegex=void 0,$l.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,$l.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,$l.htmlCtrlEntityRegex=/&(newline|tab);/gi,$l.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,$l.urlSchemeRegex=/^.+(:|:)/gim,$l.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,$l.relativeFirstCharacters=[".","/"],$l.BLANK_URL="about:blank",Object.defineProperty(OTt,"__esModule",{value:!0});var ZT=OTt.sanitizeUrl=ohn,ou=$l;function nhn(t){return ou.relativeFirstCharacters.indexOf(t[0])>-1}function ihn(t){var e=t.replace(ou.ctrlCharactersRegex,"");return e.replace(ou.htmlEntitiesRegex,function(r,n){return String.fromCharCode(n)})}function ahn(t){return URL.canParse(t)}function kTt(t){try{return decodeURIComponent(t)}catch{return t}}function ohn(t){if(!t)return ou.BLANK_URL;var e,r=kTt(t.trim());do r=ihn(r).replace(ou.htmlCtrlEntityRegex,"").replace(ou.ctrlCharactersRegex,"").replace(ou.whitespaceEscapeCharsRegex,"").trim(),r=kTt(r),e=r.match(ou.ctrlCharactersRegex)||r.match(ou.htmlEntitiesRegex)||r.match(ou.htmlCtrlEntityRegex)||r.match(ou.whitespaceEscapeCharsRegex);while(e&&e.length>0);var n=r;if(!n)return ou.BLANK_URL;if(nhn(n))return n;var i=n.trimStart(),a=i.match(ou.urlSchemeRegex);if(!a)return n;var o=a[0].toLowerCase().trim();if(ou.invalidProtocolRegex.test(o))return ou.BLANK_URL;var s=i.replace(/\\/g,"/");if(o==="mailto:"||o.includes("://"))return s;if(o==="http:"||o==="https:"){if(!ahn(s))return ou.BLANK_URL;var l=new URL(s);return l.protocol=l.protocol.toLowerCase(),l.hostname=l.hostname.toLowerCase(),l.toString()}return s}function shn(t){return Array.isArray(t)}function oxe(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 lhn(){}function ETt(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function G7(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const _Tt="[object RegExp]",sxe="[object String]",lxe="[object Number]",cxe="[object Boolean]",uxe="[object Arguments]",RTt="[object Symbol]",DTt="[object Date]",LTt="[object Map]",MTt="[object Set]",ITt="[object Array]",PTt="[object ArrayBuffer]",NTt="[object Object]",BTt="[object DataView]",$Tt="[object Uint8Array]",FTt="[object Uint8ClampedArray]",zTt="[object Uint16Array]",UTt="[object Uint32Array]",VTt="[object Int8Array]",QTt="[object Int16Array]",GTt="[object Int32Array]",HTt="[object Float32Array]",WTt="[object Float64Array]",YTt=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||function(){return this}();function hxe(t){return typeof YTt.Buffer<"u"&&YTt.Buffer.isBuffer(t)}function chn(t){return Number.isSafeInteger(t)&&t>=0}function qTt(t){return t!=null&&typeof t!="function"&&chn(t.length)}function uhn(t){return t==="__proto__"}function kX(t){return t==null||typeof t!="object"&&typeof t!="function"}function dxe(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function hhn(t,e){return AR(t,void 0,t,new Map,e)}function AR(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(kX(t))return t;if(n.has(t))return n.get(t);if(Array.isArray(t)){const o=new Array(t.length);n.set(t,o);for(let s=0;s{if(typeof t=="object"){if(G7(t)==="[object Object]"&&typeof t.constructor!="function"){const o={};return a.set(t,o),Eg(o,t,i,a),o}switch(Object.prototype.toString.call(t)){case lxe:case sxe:case cxe:{const o=new t.constructor(t==null?void 0:t.valueOf());return Eg(o,t),o}case uxe:{const o={};return Eg(o,t),o.length=t.length,o[Symbol.iterator]=t[Symbol.iterator],o}default:return}}})}function jTt(t){return fhn(t)}function fxe(t){return t!==null&&typeof t=="object"&&G7(t)==="[object Arguments]"}function pxe(t){return typeof t=="object"&&t!==null}function phn(t){return pxe(t)&&qTt(t)}function H7(t){return dxe(t)}function ghn(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function W7(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 o=t.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(W7.Cache||Map),r}W7.Cache=Map;function mhn(t){if(kX(t))return t;const e=G7(t);if(!vhn(t))return{};if(shn(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,o=n.byteLength,s=new ArrayBuffer(o),l=new Uint8Array(i,a,o);return new Uint8Array(s).set(l),new DataView(s)}if(e==="[object Boolean]"||e==="[object Number]"||e==="[object String]"){const n=t.constructor,i=new n(t.valueOf());return e==="[object String]"?bhn(i,t):gxe(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,o)=>{i.set(o,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 gxe(i,n),i.length=n.length,i[Symbol.iterator]=n[Symbol.iterator],i}const r={};return xhn(r,t),gxe(r,t),yhn(r,t),r}function vhn(t){switch(G7(t)){case uxe:case ITt:case PTt:case BTt:case cxe:case DTt:case HTt:case WTt:case VTt:case QTt:case GTt:case LTt:case lxe:case NTt:case _Tt:case MTt:case sxe:case RTt:case $Tt:case FTt:case zTt:case UTt:return!0;default:return!1}}function gxe(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function yhn(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function xhn(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function whn(t){if(kX(t))return t;if(Array.isArray(t)||dxe(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 Ahn(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 KTt="​",Thn={curveBasis:B7,curveBasisClosed:Ucn,curveBasisOpen:Vcn,curveBumpX:bAt,curveBumpY:xAt,curveBundle:Qcn,curveCardinalClosed:Gcn,curveCardinalOpen:Hcn,curveCardinal:TAt,curveCatmullRomClosed:Wcn,curveCatmullRomOpen:Ycn,curveCatmullRom:OAt,curveLinear:P7,curveLinearClosed:qcn,curveMonotoneX:PAt,curveMonotoneY:NAt,curveNatural:FAt,curveStep:zAt,curveStepAfter:VAt,curveStepBefore:UAt},Chn=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Ohn=O(function(t,e){const r=ZTt(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const o=r.map(s=>s.args);Aj(o),n=$s(n,[...o])}else n=r.args;if(!n)return;let i=D1e(t,e);const a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),ZTt=O(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${Chn.source})(?=[}][%]{2}).* -`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),ye.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let a;const o=[];for(;(a=f7.exec(t))!==null;)if(a.index===f7.lastIndex&&f7.lastIndex++,a&&!e||e&&((r=a[1])!=null&&r.match(e))||e&&((n=a[2])!=null&&n.match(e))){const s=a[1]?a[1]:a[2],l=a[3]?a[3].trim():a[4]?JSON.parse(a[4].trim()):null;o.push({type:s,args:l})}return o.length===0?{type:t,args:null}:o.length===1?o[0]:o}catch(i){return ye.error(`ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),khn=O(function(t){return t.replace(f7,"")},"removeDirectives"),Ehn=O(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function mxe(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return Thn[r]??e}O(mxe,"interpolateToCurve");function JTt(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?ZT(r):r}O(JTt,"formatUrl");var _hn=O((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let o=0;o{r+=vxe(i,e),e=i});const n=r/2;return yxe(t,n)}O(eCt,"traverseEdge");function tCt(t){return t.length===1?t[0]:eCt(t)}O(tCt,"calcLabelPosition");var rCt=O((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),yxe=O((t,e)=>{let r,n=e;for(const i of t){if(r){const a=vxe(i,r);if(a===0)return r;if(a=1)return{x:i.x,y:i.y};if(o>0&&o<1)return{x:rCt((1-o)*r.x+o*i.x,5),y:rCt((1-o)*r.y+o*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),Rhn=O((t,e,r)=>{ye.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=yxe(e,25),a=t?10:5,o=Math.atan2(e[0].y-i.y,e[0].x-i.x),s={x:0,y:0};return s.x=Math.sin(o)*a+(e[0].x+i.x)/2,s.y=-Math.cos(o)*a+(e[0].y+i.y)/2,s},"calcCardinalityPosition");function nCt(t,e,r){const n=structuredClone(r);ye.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,a=yxe(n,i),o=10+t*.5,s=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(s+Math.PI)*o+(n[0].x+a.x)/2,l.y=-Math.cos(s+Math.PI)*o+(n[0].y+a.y)/2):e==="end_right"?(l.x=Math.sin(s-Math.PI)*o+(n[0].x+a.x)/2-5,l.y=-Math.cos(s-Math.PI)*o+(n[0].y+a.y)/2-5):e==="end_left"?(l.x=Math.sin(s)*o+(n[0].x+a.x)/2-5,l.y=-Math.cos(s)*o+(n[0].y+a.y)/2-5):(l.x=Math.sin(s)*o+(n[0].x+a.x)/2,l.y=-Math.cos(s)*o+(n[0].y+a.y)/2),l}O(nCt,"calcTerminalLabelPosition");function bxe(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}}O(bxe,"getStylesFromArray");var iCt=0,aCt=O(()=>(iCt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+iCt),"generateId");function oCt(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;ioCt(t.length),"random"),Dhn=O(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"),Lhn=O(function(t,e){const r=e.text.replace(Xt.lineBreakRegex," "),[,n]=a1(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"),Y7=W7((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),Xt.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let a="";return n.forEach((o,s)=>{const l=Uu(`${o} `,r),u=Uu(a,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=Mhn(o,e,"-",r);i.push(a,...f),a=p}else u+l>=e?(i.push(a),a=o):a=[a,o].filter(Boolean).join(" ");s+1===n.length&&i.push(a)}),i.filter(o=>o!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),Mhn=W7((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],a=[];let o="";return i.forEach((s,l)=>{const u=`${o}${s}`;if(Uu(u,n)>=e){const d=l+1,f=i.length===d,p=`${u}${r}`;a.push(f?u:p),o=""}else o=u}),{hyphenatedStrings:a,remainingWord:o}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function _X(t,e){return RX(t,e).height}O(_X,"calculateTextHeight");function Uu(t,e){return RX(t,e).width}O(Uu,"calculateTextWidth");var RX=W7((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=a1(r),o=["sans-serif",n],s=t.split(Xt.lineBreakRegex),l=[],u=_t("body");if(!u.remove)return{width:0,height:0,lineHeight:0};const h=u.append("svg");for(const f of o){let p=0;const g={width:0,height:0,lineHeight:0};for(const m of s){const v=Dhn();v.text=m||KTt;const y=Lhn(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}`),Ihn=(eL=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},O(eL,"InitIDGenerator"),eL),DX,Phn=O(function(t){return DX=DX||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),DX.innerHTML=t,unescape(DX.textContent)},"entityDecode");function xxe(t){return"str"in t}O(xxe,"isDetailedError");var Nhn=O((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"),a1=O(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 uo(t,e){return Shn({},t,e)}O(uo,"cleanAndMerge");var un={assignWithDepth:$s,wrapLabel:Y7,calculateTextHeight:_X,calculateTextWidth:Uu,calculateTextDimensions:RX,cleanAndMerge:uo,detectInit:Ohn,detectDirective:ZTt,isSubstringInArray:Ehn,interpolateToCurve:mxe,calcLabelPosition:tCt,calcCardinalityPosition:Rhn,calcTerminalLabelPosition:nCt,formatUrl:JTt,getStylesFromArray:bxe,generateId:aCt,random:sCt,runFunc:_hn,entityDecode:Phn,insertTitle:Nhn,isLabelCoordinateInPath:lCt,parseFontSize:a1,InitIDGenerator:Ihn},Bhn=O(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"),o1=O(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),SR=O((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function Fl(t){return t??null}O(Fl,"handleUndefinedAttr");function lCt(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())}O(lCt,"isLabelCoordinateInPath");var TR=O(({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 wxe(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 o(){if(i.style.display="flex",i.style.flexDirection="column",n){const s=Ye().fontSize?Ye().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[u=Jn.fontSize]=a1(s),h=u*l+"px";i.style.minWidth=h,i.style.maxWidth=h}else i.style.width="100%";a(i)}O(o,"setupImage"),setTimeout(()=>{i.complete&&o()}),i.addEventListener("error",o),i.addEventListener("load",o)})))}O(wxe,"configureLabelImages");const $hn=Object.freeze({left:0,top:0,width:16,height:16}),LX=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),cCt=Object.freeze({...$hn,...LX}),Fhn=Object.freeze({...cCt,body:"",hidden:!1}),zhn=Object.freeze({width:null,height:null}),Uhn=Object.freeze({...zhn,...LX}),Vhn=(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 s=i.pop(),l=i.pop(),u={provider:i.length>0?i[0]:n,prefix:l,name:s};return Axe(u)?u:null}const a=i[0],o=a.split("-");if(o.length>1){const s={provider:n,prefix:o.shift(),name:o.join("-")};return Axe(s)?s:null}if(r&&n===""){const s={provider:n,prefix:"",name:a};return Axe(s,r)?s:null}return null},Axe=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function Qhn(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 uCt(t,e){const r=Qhn(t,e);for(const n in Fhn)n in LX?n in t&&!(n in r)&&(r[n]=LX[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function Ghn(t,e){const r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function a(o){if(r[o])return i[o]=[];if(!(o in i)){i[o]=null;const s=n[o]&&n[o].parent,l=s&&a(s);l&&(i[o]=[s].concat(l))}return i[o]}return(e||Object.keys(r).concat(Object.keys(n))).forEach(a),i}function hCt(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function o(s){a=uCt(n[s]||i[s],a)}return o(e),r.forEach(o),uCt(t,a)}function Hhn(t,e){if(t.icons[e])return hCt(t,e,[]);const r=Ghn(t,[e])[e];return r?hCt(t,e,r):null}const Whn=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Yhn=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function dCt(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(Whn);if(n===null||!n.length)return t;const i=[];let a=n.shift(),o=Yhn.test(a);for(;;){if(o){const s=parseFloat(a);isNaN(s)?i.push(a):i.push(Math.ceil(s*e*r)/r)}else i.push(a);if(a=n.shift(),a===void 0)return i.join("");o=!o}}function qhn(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const i=t.indexOf(">",n),a=t.indexOf("",a);if(o===-1)break;r+=t.slice(i+1,a).trim(),t=t.slice(0,n).trim()+t.slice(o+1)}return{defs:r,content:t}}function jhn(t,e){return t?""+t+""+e:e}function Xhn(t,e,r){const n=qhn(t);return jhn(n.defs,e+n.content+r)}const Khn=t=>t==="unset"||t==="undefined"||t==="none";function Zhn(t,e){const r={...cCt,...t},n={...Uhn,...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=Xhn(a,'',""))});const o=n.width,s=n.height,l=i.width,u=i.height;let h,d;o===null?(d=s===null?"1em":s==="auto"?u:s,h=dCt(d,l/u)):(h=o==="auto"?l:o,d=s===null?dCt(h,u/l):s==="auto"?u:s);const f={},p=(m,v)=>{Khn(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 Jhn=/\sid="(\S+)"/g,fCt=new Map;function edn(t){t=t.replace(/[0-9]+$/,"")||"a";const e=fCt.get(t)||0;return fCt.set(t,e+1),e?`${t}${e}`:t}function tdn(t){const e=[];let r;for(;r=Jhn.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=edn(i),o=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+o+')([")]|\\.[a-z])',"g"),"$1"+a+n+"$3")}),t=t.replace(new RegExp(n,"g"),""),t}function rdn(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 pCt={body:'?',height:80,width:80},Sxe=new Map,gCt=new Map,Txe=O(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(ye.debug("Registering icon pack:",e.name),"loader"in e)gCt.set(e.name,e.loader);else if("icons"in e)Sxe.set(e.name,e.icons);else throw ye.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),mCt=O(async(t,e)=>{const r=Vhn(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=Sxe.get(n);if(!i){const o=gCt.get(n);if(!o)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await o(),prefix:n},Sxe.set(n,i)}catch(s){throw ye.error(s),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=Hhn(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),ndn=O(async t=>{try{return await mCt(t),!0}catch{return!1}},"isIconAvailable"),s1=O(async(t,e,r)=>{let n;try{n=await mCt(t,e==null?void 0:e.fallbackPrefix)}catch(o){ye.error(o),n=pCt}const i=Zhn(n,e),a=rdn(tdn(i.body),{...i.attributes,...r});return li(a,Dr())},"getIconSVG");function Cxe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var JT=Cxe();function vCt(t){JT=t}var q7={exec:()=>null};function Vi(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(Vu.caret,"$1"),r=r.replace(i,o),n},getRegex:()=>new RegExp(r,e)};return n}var idn=(()=>{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")},adn=/^(?:[ \t]*(?:\n|$))+/,odn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,sdn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,j7=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ldn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Oxe=/(?:[*+-]|\d{1,9}[.)])/,yCt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,bCt=Vi(yCt).replace(/bull/g,Oxe).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(),cdn=Vi(yCt).replace(/bull/g,Oxe).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(),kxe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,udn=/^[^\n]+/,Exe=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,hdn=Vi(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Exe).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ddn=Vi(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Oxe).getRegex(),MX="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",_xe=/|$))/,fdn=Vi("^ {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",_xe).replace("tag",MX).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),xCt=Vi(kxe).replace("hr",j7).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",MX).getRegex(),pdn=Vi(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",xCt).getRegex(),Rxe={blockquote:pdn,code:odn,def:hdn,fences:sdn,heading:ldn,hr:j7,html:fdn,lheading:bCt,list:ddn,newline:adn,paragraph:xCt,table:q7,text:udn},wCt=Vi("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",j7).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",MX).getRegex(),gdn={...Rxe,lheading:cdn,table:wCt,paragraph:Vi(kxe).replace("hr",j7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",wCt).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",MX).getRegex()},mdn={...Rxe,html:Vi(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",_xe).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:q7,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Vi(kxe).replace("hr",j7).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",bCt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},vdn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ydn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ACt=/^( {2,}|\\)\n(?!\s*$)/,bdn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",idn?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),CCt=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Tdn=Vi(CCt,"u").replace(/punct/g,IX).getRegex(),Cdn=Vi(CCt,"u").replace(/punct/g,TCt).getRegex(),OCt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Odn=Vi(OCt,"gu").replace(/notPunctSpace/g,SCt).replace(/punctSpace/g,Dxe).replace(/punct/g,IX).getRegex(),kdn=Vi(OCt,"gu").replace(/notPunctSpace/g,Adn).replace(/punctSpace/g,wdn).replace(/punct/g,TCt).getRegex(),Edn=Vi("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,SCt).replace(/punctSpace/g,Dxe).replace(/punct/g,IX).getRegex(),_dn=Vi(/\\(punct)/,"gu").replace(/punct/g,IX).getRegex(),Rdn=Vi(/^<(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(),Ddn=Vi(_xe).replace("(?:-->|$)","-->").getRegex(),Ldn=Vi("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Ddn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),PX=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Mdn=Vi(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",PX).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),kCt=Vi(/^!?\[(label)\]\[(ref)\]/).replace("label",PX).replace("ref",Exe).getRegex(),ECt=Vi(/^!?\[(ref)\](?:\[\])?/).replace("ref",Exe).getRegex(),Idn=Vi("reflink|nolink(?!\\()","g").replace("reflink",kCt).replace("nolink",ECt).getRegex(),_Ct=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Lxe={_backpedal:q7,anyPunctuation:_dn,autolink:Rdn,blockSkip:Sdn,br:ACt,code:ydn,del:q7,emStrongLDelim:Tdn,emStrongRDelimAst:Odn,emStrongRDelimUnd:Edn,escape:vdn,link:Mdn,nolink:ECt,punctuation:xdn,reflink:kCt,reflinkSearch:Idn,tag:Ldn,text:bdn,url:q7},Pdn={...Lxe,link:Vi(/^!?\[(label)\]\((.*?)\)/).replace("label",PX).getRegex(),reflink:Vi(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",PX).getRegex()},Mxe={...Lxe,emStrongRDelimAst:kdn,emStrongLDelim:Cdn,url:Vi(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",_Ct).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:Vi(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},RCt=t=>Bdn[t];function x0(t,e){if(e){if(Vu.escapeTest.test(t))return t.replace(Vu.escapeReplace,RCt)}else if(Vu.escapeTestNoEncode.test(t))return t.replace(Vu.escapeReplaceNoEncode,RCt);return t}function DCt(t){try{t=encodeURI(t).replace(Vu.percentDecode,"%")}catch{return null}return t}function LCt(t,e){var a;let r=t.replace(Vu.findPipe,(o,s,l)=>{let u=!1,h=s;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(Vu.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 MCt(t,e,r,n,i){let a=e.href,o=e.title||null,s=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:o,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,l}function Fdn(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(` + */var rhn=O(t=>{const{handDrawnSeed:e}=Ye();return{fill:t,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:t,seed:e}},"solidStateFill"),wR=O(t=>{const e=nhn([...t.cssCompiledStyles||[],...t.cssStyles||[],...t.labelStyle||[]]);return{stylesMap:e,stylesArray:[...e]}},"compileStyles"),nhn=O(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"),axe=O(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=O(t=>{const{stylesArray:e}=wR(t),r=[],n=[],i=[],a=[];return e.forEach(o=>{const s=o[0];axe(s)?r.push(o.join(":")+" !important"):(n.push(o.join(":")+" !important"),s.includes("stroke")&&i.push(o.join(":")+" !important"),s==="fill"&&a.push(o.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:n.join(";"),stylesArray:e,borderStyles:i,backgroundStyles:a}},"styles2String"),_r=O((t,e)=>{var l;const{themeVariables:r,handDrawnSeed:n}=Ye(),{nodeBorder:i,mainBkg:a}=r,{stylesMap:o}=wR(t);return Object.assign({roughness:.7,fill:o.get("fill")||a,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:o.get("stroke")||i,seed:n,strokeWidth:((l=o.get("stroke-width"))==null?void 0:l.replace("px",""))||1.3,fillLineDash:[0,0],strokeLineDash:ihn(o.get("stroke-dasharray"))},e)},"userNodeOverrides"),ihn=O(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"),ETt={},$l={};Object.defineProperty($l,"__esModule",{value:!0}),$l.BLANK_URL=$l.relativeFirstCharacters=$l.whitespaceEscapeCharsRegex=$l.urlSchemeRegex=$l.ctrlCharactersRegex=$l.htmlCtrlEntityRegex=$l.htmlEntitiesRegex=$l.invalidProtocolRegex=void 0,$l.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,$l.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,$l.htmlCtrlEntityRegex=/&(newline|tab);/gi,$l.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,$l.urlSchemeRegex=/^.+(:|:)/gim,$l.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,$l.relativeFirstCharacters=[".","/"],$l.BLANK_URL="about:blank",Object.defineProperty(ETt,"__esModule",{value:!0});var ZT=ETt.sanitizeUrl=lhn,ou=$l;function ahn(t){return ou.relativeFirstCharacters.indexOf(t[0])>-1}function ohn(t){var e=t.replace(ou.ctrlCharactersRegex,"");return e.replace(ou.htmlEntitiesRegex,function(r,n){return String.fromCharCode(n)})}function shn(t){return URL.canParse(t)}function _Tt(t){try{return decodeURIComponent(t)}catch{return t}}function lhn(t){if(!t)return ou.BLANK_URL;var e,r=_Tt(t.trim());do r=ohn(r).replace(ou.htmlCtrlEntityRegex,"").replace(ou.ctrlCharactersRegex,"").replace(ou.whitespaceEscapeCharsRegex,"").trim(),r=_Tt(r),e=r.match(ou.ctrlCharactersRegex)||r.match(ou.htmlEntitiesRegex)||r.match(ou.htmlCtrlEntityRegex)||r.match(ou.whitespaceEscapeCharsRegex);while(e&&e.length>0);var n=r;if(!n)return ou.BLANK_URL;if(ahn(n))return n;var i=n.trimStart(),a=i.match(ou.urlSchemeRegex);if(!a)return n;var o=a[0].toLowerCase().trim();if(ou.invalidProtocolRegex.test(o))return ou.BLANK_URL;var s=i.replace(/\\/g,"/");if(o==="mailto:"||o.includes("://"))return s;if(o==="http:"||o==="https:"){if(!shn(s))return ou.BLANK_URL;var l=new URL(s);return l.protocol=l.protocol.toLowerCase(),l.hostname=l.hostname.toLowerCase(),l.toString()}return s}function chn(t){return Array.isArray(t)}function oxe(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 uhn(){}function RTt(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function G7(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const DTt="[object RegExp]",sxe="[object String]",lxe="[object Number]",cxe="[object Boolean]",uxe="[object Arguments]",LTt="[object Symbol]",MTt="[object Date]",ITt="[object Map]",PTt="[object Set]",NTt="[object Array]",BTt="[object ArrayBuffer]",$Tt="[object Object]",FTt="[object DataView]",zTt="[object Uint8Array]",UTt="[object Uint8ClampedArray]",VTt="[object Uint16Array]",QTt="[object Uint32Array]",GTt="[object Int8Array]",HTt="[object Int16Array]",WTt="[object Int32Array]",YTt="[object Float32Array]",qTt="[object Float64Array]",jTt=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||function(){return this}();function hxe(t){return typeof jTt.Buffer<"u"&&jTt.Buffer.isBuffer(t)}function hhn(t){return Number.isSafeInteger(t)&&t>=0}function XTt(t){return t!=null&&typeof t!="function"&&hhn(t.length)}function dhn(t){return t==="__proto__"}function kX(t){return t==null||typeof t!="object"&&typeof t!="function"}function dxe(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function fhn(t,e){return AR(t,void 0,t,new Map,e)}function AR(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(kX(t))return t;if(n.has(t))return n.get(t);if(Array.isArray(t)){const o=new Array(t.length);n.set(t,o);for(let s=0;s{if(typeof t=="object"){if(G7(t)==="[object Object]"&&typeof t.constructor!="function"){const o={};return a.set(t,o),Eg(o,t,i,a),o}switch(Object.prototype.toString.call(t)){case lxe:case sxe:case cxe:{const o=new t.constructor(t==null?void 0:t.valueOf());return Eg(o,t),o}case uxe:{const o={};return Eg(o,t),o.length=t.length,o[Symbol.iterator]=t[Symbol.iterator],o}default:return}}})}function KTt(t){return ghn(t)}function fxe(t){return t!==null&&typeof t=="object"&&G7(t)==="[object Arguments]"}function pxe(t){return typeof t=="object"&&t!==null}function mhn(t){return pxe(t)&&XTt(t)}function H7(t){return dxe(t)}function vhn(t){const e=t==null?void 0:t.constructor;return t===(typeof e=="function"?e.prototype:Object.prototype)}function W7(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 o=t.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(W7.Cache||Map),r}W7.Cache=Map;function yhn(t){if(kX(t))return t;const e=G7(t);if(!bhn(t))return{};if(chn(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,o=n.byteLength,s=new ArrayBuffer(o),l=new Uint8Array(i,a,o);return new Uint8Array(s).set(l),new DataView(s)}if(e==="[object Boolean]"||e==="[object Number]"||e==="[object String]"){const n=t.constructor,i=new n(t.valueOf());return e==="[object String]"?whn(i,t):gxe(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,o)=>{i.set(o,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 gxe(i,n),i.length=n.length,i[Symbol.iterator]=n[Symbol.iterator],i}const r={};return Ahn(r,t),gxe(r,t),xhn(r,t),r}function bhn(t){switch(G7(t)){case uxe:case NTt:case BTt:case FTt:case cxe:case MTt:case YTt:case qTt:case GTt:case HTt:case WTt:case ITt:case lxe:case $Tt:case DTt:case PTt:case sxe:case LTt:case zTt:case UTt:case VTt:case QTt:return!0;default:return!1}}function gxe(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}function xhn(t,e){const r=Object.getOwnPropertySymbols(e);for(let n=0;n=r)&&(t[n]=e[n])}function Ahn(t,e){const r=Object.getPrototypeOf(e);r!==null&&typeof e.constructor=="function"&&Object.setPrototypeOf(t,r)}function Shn(t){if(kX(t))return t;if(Array.isArray(t)||dxe(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 Thn(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 JTt="​",Ohn={curveBasis:B7,curveBasisClosed:Qcn,curveBasisOpen:Gcn,curveBumpX:wAt,curveBumpY:AAt,curveBundle:Hcn,curveCardinalClosed:Wcn,curveCardinalOpen:Ycn,curveCardinal:OAt,curveCatmullRomClosed:qcn,curveCatmullRomOpen:jcn,curveCatmullRom:EAt,curveLinear:P7,curveLinearClosed:Xcn,curveMonotoneX:BAt,curveMonotoneY:$At,curveNatural:UAt,curveStep:VAt,curveStepAfter:GAt,curveStepBefore:QAt},khn=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,Ehn=O(function(t,e){const r=eCt(t,/(?:init\b)|(?:initialize\b)/);let n={};if(Array.isArray(r)){const o=r.map(s=>s.args);Aj(o),n=$s(n,[...o])}else n=r.args;if(!n)return;let i=D1e(t,e);const a="config";return n[a]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[a],delete n[a]),n},"detectInit"),eCt=O(function(t,e=null){var r,n;try{const i=new RegExp(`[%]{2}(?![{]${khn.source})(?=[}][%]{2}).* +`,"ig");t=t.trim().replace(i,"").replace(/'/gm,'"'),ye.debug(`Detecting diagram directive${e!==null?" type:"+e:""} based on the text:${t}`);let a;const o=[];for(;(a=f7.exec(t))!==null;)if(a.index===f7.lastIndex&&f7.lastIndex++,a&&!e||e&&((r=a[1])!=null&&r.match(e))||e&&((n=a[2])!=null&&n.match(e))){const s=a[1]?a[1]:a[2],l=a[3]?a[3].trim():a[4]?JSON.parse(a[4].trim()):null;o.push({type:s,args:l})}return o.length===0?{type:t,args:null}:o.length===1?o[0]:o}catch(i){return ye.error(`ERROR: ${i.message} - Unable to parse directive type: '${e}' based on the text: '${t}'`),{type:void 0,args:null}}},"detectDirective"),_hn=O(function(t){return t.replace(f7,"")},"removeDirectives"),Rhn=O(function(t,e){for(const[r,n]of e.entries())if(n.match(t))return r;return-1},"isSubstringInArray");function mxe(t,e){if(!t)return e;const r=`curve${t.charAt(0).toUpperCase()+t.slice(1)}`;return Ohn[r]??e}O(mxe,"interpolateToCurve");function tCt(t,e){const r=t.trim();if(r)return e.securityLevel!=="loose"?ZT(r):r}O(tCt,"formatUrl");var Dhn=O((t,...e)=>{const r=t.split("."),n=r.length-1,i=r[n];let a=window;for(let o=0;o{r+=vxe(i,e),e=i});const n=r/2;return yxe(t,n)}O(rCt,"traverseEdge");function nCt(t){return t.length===1?t[0]:rCt(t)}O(nCt,"calcLabelPosition");var iCt=O((t,e=2)=>{const r=Math.pow(10,e);return Math.round(t*r)/r},"roundNumber"),yxe=O((t,e)=>{let r,n=e;for(const i of t){if(r){const a=vxe(i,r);if(a===0)return r;if(a=1)return{x:i.x,y:i.y};if(o>0&&o<1)return{x:iCt((1-o)*r.x+o*i.x,5),y:iCt((1-o)*r.y+o*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),Lhn=O((t,e,r)=>{ye.info(`our points ${JSON.stringify(e)}`),e[0]!==r&&(e=e.reverse());const i=yxe(e,25),a=t?10:5,o=Math.atan2(e[0].y-i.y,e[0].x-i.x),s={x:0,y:0};return s.x=Math.sin(o)*a+(e[0].x+i.x)/2,s.y=-Math.cos(o)*a+(e[0].y+i.y)/2,s},"calcCardinalityPosition");function aCt(t,e,r){const n=structuredClone(r);ye.info("our points",n),e!=="start_left"&&e!=="start_right"&&n.reverse();const i=25+t,a=yxe(n,i),o=10+t*.5,s=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(s+Math.PI)*o+(n[0].x+a.x)/2,l.y=-Math.cos(s+Math.PI)*o+(n[0].y+a.y)/2):e==="end_right"?(l.x=Math.sin(s-Math.PI)*o+(n[0].x+a.x)/2-5,l.y=-Math.cos(s-Math.PI)*o+(n[0].y+a.y)/2-5):e==="end_left"?(l.x=Math.sin(s)*o+(n[0].x+a.x)/2-5,l.y=-Math.cos(s)*o+(n[0].y+a.y)/2-5):(l.x=Math.sin(s)*o+(n[0].x+a.x)/2,l.y=-Math.cos(s)*o+(n[0].y+a.y)/2),l}O(aCt,"calcTerminalLabelPosition");function bxe(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}}O(bxe,"getStylesFromArray");var oCt=0,sCt=O(()=>(oCt++,"id-"+Math.random().toString(36).substr(2,12)+"-"+oCt),"generateId");function lCt(t){let e="";const r="0123456789abcdef",n=r.length;for(let i=0;ilCt(t.length),"random"),Mhn=O(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"),Ihn=O(function(t,e){const r=e.text.replace(Xt.lineBreakRegex," "),[,n]=a1(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"),Y7=W7((t,e,r)=>{if(!t||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"
"},r),Xt.lineBreakRegex.test(t)))return t;const n=t.split(" ").filter(Boolean),i=[];let a="";return n.forEach((o,s)=>{const l=Uu(`${o} `,r),u=Uu(a,r);if(l>e){const{hyphenatedStrings:f,remainingWord:p}=Phn(o,e,"-",r);i.push(a,...f),a=p}else u+l>=e?(i.push(a),a=o):a=[a,o].filter(Boolean).join(" ");s+1===n.length&&i.push(a)}),i.filter(o=>o!=="").join(r.joinWith)},(t,e,r)=>`${t}${e}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),Phn=W7((t,e,r="-",n)=>{n=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},n);const i=[...t],a=[];let o="";return i.forEach((s,l)=>{const u=`${o}${s}`;if(Uu(u,n)>=e){const d=l+1,f=i.length===d,p=`${u}${r}`;a.push(f?u:p),o=""}else o=u}),{hyphenatedStrings:a,remainingWord:o}},(t,e,r="-",n)=>`${t}${e}${r}${n.fontSize}${n.fontWeight}${n.fontFamily}`);function _X(t,e){return RX(t,e).height}O(_X,"calculateTextHeight");function Uu(t,e){return RX(t,e).width}O(Uu,"calculateTextWidth");var RX=W7((t,e)=>{const{fontSize:r=12,fontFamily:n="Arial",fontWeight:i=400}=e;if(!t)return{width:0,height:0};const[,a]=a1(r),o=["sans-serif",n],s=t.split(Xt.lineBreakRegex),l=[],u=_t("body");if(!u.remove)return{width:0,height:0,lineHeight:0};const h=u.append("svg");for(const f of o){let p=0;const g={width:0,height:0,lineHeight:0};for(const m of s){const v=Mhn();v.text=m||JTt;const y=Ihn(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}`),Nhn=(eL=class{constructor(e=!1,r){this.count=0,this.count=r?r.length:0,this.next=e?()=>this.count++:()=>Date.now()}},O(eL,"InitIDGenerator"),eL),DX,Bhn=O(function(t){return DX=DX||document.createElement("div"),t=escape(t).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),DX.innerHTML=t,unescape(DX.textContent)},"entityDecode");function xxe(t){return"str"in t}O(xxe,"isDetailedError");var $hn=O((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"),a1=O(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 uo(t,e){return Chn({},t,e)}O(uo,"cleanAndMerge");var un={assignWithDepth:$s,wrapLabel:Y7,calculateTextHeight:_X,calculateTextWidth:Uu,calculateTextDimensions:RX,cleanAndMerge:uo,detectInit:Ehn,detectDirective:eCt,isSubstringInArray:Rhn,interpolateToCurve:mxe,calcLabelPosition:nCt,calcCardinalityPosition:Lhn,calcTerminalLabelPosition:aCt,formatUrl:tCt,getStylesFromArray:bxe,generateId:sCt,random:cCt,runFunc:Dhn,entityDecode:Bhn,insertTitle:$hn,isLabelCoordinateInPath:uCt,parseFontSize:a1,InitIDGenerator:Nhn},Fhn=O(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"),o1=O(function(t){return t.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),SR=O((t,e,{counter:r=0,prefix:n,suffix:i},a)=>a||`${n?`${n}_`:""}${t}_${e}_${r}${i?`_${i}`:""}`,"getEdgeId");function Fl(t){return t??null}O(Fl,"handleUndefinedAttr");function uCt(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())}O(uCt,"isLabelCoordinateInPath");var TR=O(({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 wxe(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 o(){if(i.style.display="flex",i.style.flexDirection="column",n){const s=Ye().fontSize?Ye().fontSize:window.getComputedStyle(document.body).fontSize,l=5,[u=Jn.fontSize]=a1(s),h=u*l+"px";i.style.minWidth=h,i.style.maxWidth=h}else i.style.width="100%";a(i)}O(o,"setupImage"),setTimeout(()=>{i.complete&&o()}),i.addEventListener("error",o),i.addEventListener("load",o)})))}O(wxe,"configureLabelImages");const zhn=Object.freeze({left:0,top:0,width:16,height:16}),LX=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),hCt=Object.freeze({...zhn,...LX}),Uhn=Object.freeze({...hCt,body:"",hidden:!1}),Vhn=Object.freeze({width:null,height:null}),Qhn=Object.freeze({...Vhn,...LX}),Ghn=(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 s=i.pop(),l=i.pop(),u={provider:i.length>0?i[0]:n,prefix:l,name:s};return Axe(u)?u:null}const a=i[0],o=a.split("-");if(o.length>1){const s={provider:n,prefix:o.shift(),name:o.join("-")};return Axe(s)?s:null}if(r&&n===""){const s={provider:n,prefix:"",name:a};return Axe(s,r)?s:null}return null},Axe=(t,e)=>t?!!((e&&t.prefix===""||t.prefix)&&t.name):!1;function Hhn(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 dCt(t,e){const r=Hhn(t,e);for(const n in Uhn)n in LX?n in t&&!(n in r)&&(r[n]=LX[n]):n in e?r[n]=e[n]:n in t&&(r[n]=t[n]);return r}function Whn(t,e){const r=t.icons,n=t.aliases||Object.create(null),i=Object.create(null);function a(o){if(r[o])return i[o]=[];if(!(o in i)){i[o]=null;const s=n[o]&&n[o].parent,l=s&&a(s);l&&(i[o]=[s].concat(l))}return i[o]}return(e||Object.keys(r).concat(Object.keys(n))).forEach(a),i}function fCt(t,e,r){const n=t.icons,i=t.aliases||Object.create(null);let a={};function o(s){a=dCt(n[s]||i[s],a)}return o(e),r.forEach(o),dCt(t,a)}function Yhn(t,e){if(t.icons[e])return fCt(t,e,[]);const r=Whn(t,[e])[e];return r?fCt(t,e,r):null}const qhn=/(-?[0-9.]*[0-9]+[0-9.]*)/g,jhn=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function pCt(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(qhn);if(n===null||!n.length)return t;const i=[];let a=n.shift(),o=jhn.test(a);for(;;){if(o){const s=parseFloat(a);isNaN(s)?i.push(a):i.push(Math.ceil(s*e*r)/r)}else i.push(a);if(a=n.shift(),a===void 0)return i.join("");o=!o}}function Xhn(t,e="defs"){let r="";const n=t.indexOf("<"+e);for(;n>=0;){const i=t.indexOf(">",n),a=t.indexOf("",a);if(o===-1)break;r+=t.slice(i+1,a).trim(),t=t.slice(0,n).trim()+t.slice(o+1)}return{defs:r,content:t}}function Khn(t,e){return t?""+t+""+e:e}function Zhn(t,e,r){const n=Xhn(t);return Khn(n.defs,e+n.content+r)}const Jhn=t=>t==="unset"||t==="undefined"||t==="none";function edn(t,e){const r={...hCt,...t},n={...Qhn,...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=Zhn(a,'',""))});const o=n.width,s=n.height,l=i.width,u=i.height;let h,d;o===null?(d=s===null?"1em":s==="auto"?u:s,h=pCt(d,l/u)):(h=o==="auto"?l:o,d=s===null?pCt(h,u/l):s==="auto"?u:s);const f={},p=(m,v)=>{Jhn(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 tdn=/\sid="(\S+)"/g,gCt=new Map;function rdn(t){t=t.replace(/[0-9]+$/,"")||"a";const e=gCt.get(t)||0;return gCt.set(t,e+1),e?`${t}${e}`:t}function ndn(t){const e=[];let r;for(;r=tdn.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=rdn(i),o=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=t.replace(new RegExp('([#;"])('+o+')([")]|\\.[a-z])',"g"),"$1"+a+n+"$3")}),t=t.replace(new RegExp(n,"g"),""),t}function idn(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 mCt={body:'?',height:80,width:80},Sxe=new Map,vCt=new Map,Txe=O(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(ye.debug("Registering icon pack:",e.name),"loader"in e)vCt.set(e.name,e.loader);else if("icons"in e)Sxe.set(e.name,e.icons);else throw ye.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),yCt=O(async(t,e)=>{const r=Ghn(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=Sxe.get(n);if(!i){const o=vCt.get(n);if(!o)throw new Error(`Icon set not found: ${r.prefix}`);try{i={...await o(),prefix:n},Sxe.set(n,i)}catch(s){throw ye.error(s),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=Yhn(i,r.name);if(!a)throw new Error(`Icon not found: ${t}`);return a},"getRegisteredIconData"),adn=O(async t=>{try{return await yCt(t),!0}catch{return!1}},"isIconAvailable"),s1=O(async(t,e,r)=>{let n;try{n=await yCt(t,e==null?void 0:e.fallbackPrefix)}catch(o){ye.error(o),n=mCt}const i=edn(n,e),a=idn(ndn(i.body),{...i.attributes,...r});return li(a,Dr())},"getIconSVG");function Cxe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var JT=Cxe();function bCt(t){JT=t}var q7={exec:()=>null};function Vi(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(Vu.caret,"$1"),r=r.replace(i,o),n},getRegex:()=>new RegExp(r,e)};return n}var odn=(()=>{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")},sdn=/^(?:[ \t]*(?:\n|$))+/,ldn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,cdn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,j7=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,udn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Oxe=/(?:[*+-]|\d{1,9}[.)])/,xCt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,wCt=Vi(xCt).replace(/bull/g,Oxe).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(),hdn=Vi(xCt).replace(/bull/g,Oxe).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(),kxe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ddn=/^[^\n]+/,Exe=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,fdn=Vi(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Exe).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),pdn=Vi(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Oxe).getRegex(),MX="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",_xe=/|$))/,gdn=Vi("^ {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",_xe).replace("tag",MX).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ACt=Vi(kxe).replace("hr",j7).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",MX).getRegex(),mdn=Vi(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ACt).getRegex(),Rxe={blockquote:mdn,code:ldn,def:fdn,fences:cdn,heading:udn,hr:j7,html:gdn,lheading:wCt,list:pdn,newline:sdn,paragraph:ACt,table:q7,text:ddn},SCt=Vi("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",j7).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",MX).getRegex(),vdn={...Rxe,lheading:hdn,table:SCt,paragraph:Vi(kxe).replace("hr",j7).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",SCt).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",MX).getRegex()},ydn={...Rxe,html:Vi(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",_xe).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:q7,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Vi(kxe).replace("hr",j7).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",wCt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},bdn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,xdn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,TCt=/^( {2,}|\\)\n(?!\s*$)/,wdn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",odn?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),kCt=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Odn=Vi(kCt,"u").replace(/punct/g,IX).getRegex(),kdn=Vi(kCt,"u").replace(/punct/g,OCt).getRegex(),ECt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Edn=Vi(ECt,"gu").replace(/notPunctSpace/g,CCt).replace(/punctSpace/g,Dxe).replace(/punct/g,IX).getRegex(),_dn=Vi(ECt,"gu").replace(/notPunctSpace/g,Tdn).replace(/punctSpace/g,Sdn).replace(/punct/g,OCt).getRegex(),Rdn=Vi("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,CCt).replace(/punctSpace/g,Dxe).replace(/punct/g,IX).getRegex(),Ddn=Vi(/\\(punct)/,"gu").replace(/punct/g,IX).getRegex(),Ldn=Vi(/^<(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(),Mdn=Vi(_xe).replace("(?:-->|$)","-->").getRegex(),Idn=Vi("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Mdn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),PX=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Pdn=Vi(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",PX).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),_Ct=Vi(/^!?\[(label)\]\[(ref)\]/).replace("label",PX).replace("ref",Exe).getRegex(),RCt=Vi(/^!?\[(ref)\](?:\[\])?/).replace("ref",Exe).getRegex(),Ndn=Vi("reflink|nolink(?!\\()","g").replace("reflink",_Ct).replace("nolink",RCt).getRegex(),DCt=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Lxe={_backpedal:q7,anyPunctuation:Ddn,autolink:Ldn,blockSkip:Cdn,br:TCt,code:xdn,del:q7,emStrongLDelim:Odn,emStrongRDelimAst:Edn,emStrongRDelimUnd:Rdn,escape:bdn,link:Pdn,nolink:RCt,punctuation:Adn,reflink:_Ct,reflinkSearch:Ndn,tag:Idn,text:wdn,url:q7},Bdn={...Lxe,link:Vi(/^!?\[(label)\]\((.*?)\)/).replace("label",PX).getRegex(),reflink:Vi(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",PX).getRegex()},Mxe={...Lxe,emStrongRDelimAst:_dn,emStrongLDelim:kdn,url:Vi(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",DCt).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:Vi(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},LCt=t=>Fdn[t];function x0(t,e){if(e){if(Vu.escapeTest.test(t))return t.replace(Vu.escapeReplace,LCt)}else if(Vu.escapeTestNoEncode.test(t))return t.replace(Vu.escapeReplaceNoEncode,LCt);return t}function MCt(t){try{t=encodeURI(t).replace(Vu.percentDecode,"%")}catch{return null}return t}function ICt(t,e){var a;let r=t.replace(Vu.findPipe,(o,s,l)=>{let u=!1,h=s;for(;--h>=0&&l[h]==="\\";)u=!u;return u?"|":" |"}),n=r.split(Vu.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 PCt(t,e,r,n,i){let a=e.href,o=e.title||null,s=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:o,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,l}function Udn(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 o=a.match(r.other.beginningSpace);if(o===null)return a;let[s]=o;return s.length>=i.length?a.slice(i.length):a}).join(` `)}var BX=class{constructor(e){Pr(this,"options");Pr(this,"rules");Pr(this,"lexer");this.options=e||JT}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:K7(n,` -`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=Fdn(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=K7(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:K7(r[0],` +`)}}}fences(e){let r=this.rules.block.fences.exec(e);if(r){let n=r[0],i=Udn(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=K7(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:K7(r[0],` `)}}blockquote(e){let r=this.rules.block.blockquote.exec(e);if(r){let n=K7(r[0],` `).split(` `),i="",a="",o=[];for(;n.length>0;){let s=!1,l=[],u;for(u=0;u=m||!p.trim())d+=` `+C.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+=T+` -`,e=e.substring(T.length+1),f=C.slice(m)}}a.loose||(s?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(s=!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:o.align[h]})));return o}}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 o=K7(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{let o=$dn(r[2],"()");if(o===-2)return;if(o>-1){let s=(r[0].indexOf("!")===0?5:4)+r[1].length+o;r[2]=r[2].substring(0,o),r[0]=r[0].substring(0,s).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(i);o&&(i=o[1],a=o[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)),MCt(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 o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return MCt(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,o,s,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(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!o)continue;if(s=[...o].length,i[3]||i[4]){l+=s;continue}else if((i[5]||i[6])&&a%3&&!((a+s)%3)){u+=s;continue}if(l-=s,l>0)continue;s=Math.min(s,s+l+u);let d=[...i[0]][0].length,f=e.slice(0,a+i.index+d+s);if(Math.min(a,s)%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 o;do o=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(o!==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}}}},_g=class YMe{constructor(e){Pr(this,"tokens");Pr(this,"options");Pr(this,"state");Pr(this,"tokenizer");Pr(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||JT,this.options.tokenizer=this.options.tokenizer||new BX,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:Vu,block:NX.normal,inline:X7.normal};this.options.pedantic?(r.block=NX.pedantic,r.inline=X7.pedantic):this.options.gfm&&(r.block=NX.gfm,this.options.breaks?r.inline=X7.breaks:r.inline=X7.gfm),this.tokenizer.rules=r}static get rules(){return{block:NX,inline:X7}}static lex(e,r){return new YMe(r).lex(e)}static lexInline(e,r){return new YMe(r).inlineTokens(e)}lex(e){e=e.replace(Vu.carriageReturn,` +`,e=e.substring(T.length+1),f=C.slice(m)}}a.loose||(s?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(s=!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:o.align[h]})));return o}}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 o=K7(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{let o=zdn(r[2],"()");if(o===-2)return;if(o>-1){let s=(r[0].indexOf("!")===0?5:4)+r[1].length+o;r[2]=r[2].substring(0,o),r[0]=r[0].substring(0,s).trim(),r[3]=""}}let i=r[2],a="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(i);o&&(i=o[1],a=o[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)),PCt(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 o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return PCt(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,o,s,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(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!o)continue;if(s=[...o].length,i[3]||i[4]){l+=s;continue}else if((i[5]||i[6])&&a%3&&!((a+s)%3)){u+=s;continue}if(l-=s,l>0)continue;s=Math.min(s,s+l+u);let d=[...i[0]][0].length,f=e.slice(0,a+i.index+d+s);if(Math.min(a,s)%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 o;do o=r[0],r[0]=((n=this.rules.inline._backpedal.exec(r[0]))==null?void 0:n[0])??"";while(o!==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}}}},_g=class YMe{constructor(e){Pr(this,"tokens");Pr(this,"options");Pr(this,"state");Pr(this,"tokenizer");Pr(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||JT,this.options.tokenizer=this.options.tokenizer||new BX,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:Vu,block:NX.normal,inline:X7.normal};this.options.pedantic?(r.block=NX.pedantic,r.inline=X7.pedantic):this.options.gfm&&(r.block=NX.gfm,this.options.breaks?r.inline=X7.breaks:r.inline=X7.gfm),this.tokenizer.rules=r}static get rules(){return{block:NX,inline:X7}}static lex(e,r){return new YMe(r).lex(e)}static lexInline(e,r){return new YMe(r).inlineTokens(e)}lex(e){e=e.replace(Vu.carriageReturn,` `),this.blockTokens(e,this.tokens);for(let r=0;r(s=u.call({lexer:this},e,r))?(e=e.substring(s.raw.length),r.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let u=r.at(-1);s.raw.length===1&&u!==void 0?u.raw+=` `:r.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.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(` `)?"":` @@ -602,28 +602,28 @@ ${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`${x0(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=DCt(e);if(a===null)return i;e=a;let o='
",o}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=DCt(e);if(a===null)return x0(n);e=a;let o=`${n}{let u=s[l].flat(1/0);n=n.concat(this.walkTokens(u,r))}):s.tokens&&(n=n.concat(this.walkTokens(s.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 o=r.renderers[a.name];o?r.renderers[a.name]=function(...s){let l=a.renderer.apply(this,s);return l===!1&&(l=o.apply(this,s)),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 o=r[a.level];o?o.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 $X(this.defaults);for(let o in n.renderer){if(!(o in a))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let s=o,l=n.renderer[s],u=a[s];a[s]=(...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 BX(this.defaults);for(let o in n.tokenizer){if(!(o in a))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let s=o,l=n.tokenizer[s],u=a[s];a[s]=(...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 Z7;for(let o in n.hooks){if(!(o in a))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let s=o,l=n.hooks[s],u=a[s];Z7.passThroughHooks.has(o)?a[s]=h=>{if(this.defaults.async&&Z7.passThroughHooksRespectAsync.has(o))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[s]=(...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,o=n.walkTokens;i.walkTokens=function(s){let l=[];return l.push(o.call(this,s)),a&&(l=l.concat(a.call(this,s))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return _g.lex(e,r??this.defaults)}parser(e,r){return Rg.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},a={...this.defaults,...i},o=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return o(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 o(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return o(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 s=a.hooks?await a.hooks.preprocess(r):r,l=await(a.hooks?await a.hooks.provideLexer():e?_g.lex:_g.lexInline)(s,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?Rg.parse:Rg.parseInline)(u,a);return a.hooks?await a.hooks.postprocess(h):h})().catch(o);try{a.hooks&&(r=a.hooks.preprocess(r));let s=(a.hooks?a.hooks.provideLexer():e?_g.lex:_g.lexInline)(r,a);a.hooks&&(s=a.hooks.processAllTokens(s)),a.walkTokens&&this.walkTokens(s,a.walkTokens);let l=(a.hooks?a.hooks.provideParser():e?Rg.parse:Rg.parseInline)(s,a);return a.hooks&&(l=a.hooks.postprocess(l)),l}catch(s){return o(s)}}}onError(e,r){return n=>{if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,e){let i="

An error occurred:

"+x0(n.message+"",!0)+"
";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},eC=new zdn;function ia(t,e){return eC.parse(t,e)}ia.options=ia.setOptions=function(t){return eC.setOptions(t),ia.defaults=eC.defaults,vCt(ia.defaults),ia},ia.getDefaults=Cxe,ia.defaults=JT,ia.use=function(...t){return eC.use(...t),ia.defaults=eC.defaults,vCt(ia.defaults),ia},ia.walkTokens=function(t,e){return eC.walkTokens(t,e)},ia.parseInline=eC.parseInline,ia.Parser=Rg,ia.parser=Rg.parse,ia.Renderer=$X,ia.TextRenderer=Ixe,ia.Lexer=_g,ia.lexer=_g.lex,ia.Tokenizer=BX,ia.Hooks=Z7,ia.parse=ia,ia.options,ia.setOptions,ia.use,ia.walkTokens,ia.parseInline,Rg.parse,_g.lex;function ICt(t){for(var e=[],r=1;r${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${x0(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=MCt(e);if(a===null)return i;e=a;let o='
",o}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=MCt(e);if(a===null)return x0(n);e=a;let o=`${n}{let u=s[l].flat(1/0);n=n.concat(this.walkTokens(u,r))}):s.tokens&&(n=n.concat(this.walkTokens(s.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 o=r.renderers[a.name];o?r.renderers[a.name]=function(...s){let l=a.renderer.apply(this,s);return l===!1&&(l=o.apply(this,s)),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 o=r[a.level];o?o.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 $X(this.defaults);for(let o in n.renderer){if(!(o in a))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let s=o,l=n.renderer[s],u=a[s];a[s]=(...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 BX(this.defaults);for(let o in n.tokenizer){if(!(o in a))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let s=o,l=n.tokenizer[s],u=a[s];a[s]=(...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 Z7;for(let o in n.hooks){if(!(o in a))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let s=o,l=n.hooks[s],u=a[s];Z7.passThroughHooks.has(o)?a[s]=h=>{if(this.defaults.async&&Z7.passThroughHooksRespectAsync.has(o))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[s]=(...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,o=n.walkTokens;i.walkTokens=function(s){let l=[];return l.push(o.call(this,s)),a&&(l=l.concat(a.call(this,s))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,r){return _g.lex(e,r??this.defaults)}parser(e,r){return Rg.parse(e,r??this.defaults)}parseMarkdown(e){return(r,n)=>{let i={...n},a={...this.defaults,...i},o=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return o(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 o(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return o(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 s=a.hooks?await a.hooks.preprocess(r):r,l=await(a.hooks?await a.hooks.provideLexer():e?_g.lex:_g.lexInline)(s,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?Rg.parse:Rg.parseInline)(u,a);return a.hooks?await a.hooks.postprocess(h):h})().catch(o);try{a.hooks&&(r=a.hooks.preprocess(r));let s=(a.hooks?a.hooks.provideLexer():e?_g.lex:_g.lexInline)(r,a);a.hooks&&(s=a.hooks.processAllTokens(s)),a.walkTokens&&this.walkTokens(s,a.walkTokens);let l=(a.hooks?a.hooks.provideParser():e?Rg.parse:Rg.parseInline)(s,a);return a.hooks&&(l=a.hooks.postprocess(l)),l}catch(s){return o(s)}}}onError(e,r){return n=>{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,e){let i="

An error occurred:

"+x0(n.message+"",!0)+"
";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},eC=new Vdn;function ia(t,e){return eC.parse(t,e)}ia.options=ia.setOptions=function(t){return eC.setOptions(t),ia.defaults=eC.defaults,bCt(ia.defaults),ia},ia.getDefaults=Cxe,ia.defaults=JT,ia.use=function(...t){return eC.use(...t),ia.defaults=eC.defaults,bCt(ia.defaults),ia},ia.walkTokens=function(t,e){return eC.walkTokens(t,e)},ia.parseInline=eC.parseInline,ia.Parser=Rg,ia.parser=Rg.parse,ia.Renderer=$X,ia.TextRenderer=Ixe,ia.Lexer=_g,ia.lexer=_g.lex,ia.Tokenizer=BX,ia.Hooks=Z7,ia.parse=ia,ia.options,ia.setOptions,ia.use,ia.walkTokens,ia.parseInline,Rg.parse,_g.lex;function NCt(t){for(var e=[],r=1;r/g,` +`)),o+=d+n[l+1]}),o}function BCt(t,{markdownAutoWrap:e}){const n=t.replace(//g,` `).replace(/\n{2,}/g,` -`);return ICt(n)}O(PCt,"preprocessMarkdown");function NCt(t){return t.split(/\\n|\n|/gi).map(e=>{var r;return((r=e.trim().match(/<[^>]+>|[^\s<>]+/g))==null?void 0:r.map(n=>({content:n,type:"normal"})))??[]})}O(NCt,"nonMarkdownToLines");function BCt(t,e={}){const r=PCt(t,e),n=ia.lexer(r),i=[[]];let a=0;function o(s,l="normal"){s.type==="text"?s.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})})}):s.type==="strong"||s.type==="em"?s.tokens.forEach(u=>{o(u,s.type)}):s.type==="html"&&i[a].push({content:s.text,type:"normal"})}return O(o,"processNode"),n.forEach(s=>{var l;s.type==="paragraph"?(l=s.tokens)==null||l.forEach(u=>{o(u)}):s.type==="html"?i[a].push({content:s.text,type:"normal"}):i[a].push({content:s.raw,type:"normal"})}),i}O(BCt,"markdownToLines");function $Ct(t){return t?`

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

`:""}O($Ct,"nonMarkdownToHTML");function FCt(t,{markdownAutoWrap:e}={}){const r=ia.lexer(t);function n(i){var a,o,s;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"?`${(o=i.tokens)==null?void 0:o.map(n).join("")}`:i.type==="paragraph"?`

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

`:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(ye.warn(`Unsupported markdown: ${i.type}`),i.raw)}return O(n,"output"),r.map(n).join("")}O(FCt,"markdownToHTML");function zCt(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}O(zCt,"splitTextToChars");function UCt(t,e){const r=zCt(e.content);return Pxe(t,[],r,e.type)}O(UCt,"splitWordToFitWidth");function Pxe(t,e,r,n){if(r.length===0)return[{content:e.join(""),type:n},{content:"",type:n}];const[i,...a]=r,o=[...e,i];return t([{content:o.join(""),type:n}])?Pxe(t,o,a,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}O(Pxe,"splitWordToFitWidthRecursion");function VCt(t,e){if(t.some(({content:r})=>r.includes(` -`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return FX(t,e)}O(VCt,"splitLineToFitWidth");function FX(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"},o=[...n];if(i!==""&&o.push({content:i,type:"normal"}),o.push(a),e(o))return FX(t,e,r,o);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){const[s,l]=UCt(e,a);r.push([s]),l.content&&t.unshift(l)}return FX(t,e,r)}O(FX,"splitLineToFitWidthRecursion");function Nxe(t,e){e&&t.attr("style",e)}O(Nxe,"applyStyle");var QCt=16384;async function GCt(t,e,r,n,i=!1,a=Dr()){const o=t.append("foreignObject");o.attr("width",`${Math.min(10*r,QCt)}px`),o.attr("height",`${Math.min(10*r,QCt)}px`);const s=o.append("xhtml:div"),l=ps(e.label)?await Oj(e.label.replace(Xt.lineBreakRegex,` -`),a):li(e.label,a),u=e.isNode?"nodeLabel":"edgeLabel",h=s.append("span");h.html(l),Nxe(h,e.labelStyle),h.attr("class",`${u} ${n}`),Nxe(s,e.labelStyle),s.style("display","table-cell"),s.style("white-space","nowrap"),s.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(s.style("max-width",r+"px"),s.style("text-align","center")),s.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&s.attr("class","labelBkg");let d=s.node().getBoundingClientRect();return d.width===r&&(s.style("display","table"),s.style("white-space","break-spaces"),s.style("width",r+"px"),d=s.node().getBoundingClientRect()),o.node()}O(GCt,"addHtmlSpan");function zX(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}O(zX,"createTspan");function HCt(t,e,r){const n=t.append("text"),i=zX(n,1,e);UX(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}O(HCt,"computeWidthOfText");function WCt(t,e,r){var o;const n=t.append("text"),i=zX(n,1,e);UX(i,[{content:r,type:"normal"}]);const a=(o=i.node())==null?void 0:o.getBoundingClientRect();return a&&n.remove(),a}O(WCt,"computeDimensionOfText");function YCt(t,e,r,n=!1,i=!1){const o=e.append("g"),s=o.insert("rect").attr("class","background").attr("style","stroke: none"),l=o.append("text").attr("y","-10.1");i&&l.attr("text-anchor","middle");let u=0;for(const h of r){const d=O(p=>HCt(o,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:VCt(h,d);for(const p of f){const g=zX(l,u,1.1,i);UX(g,p),u++}}if(n){const h=l.node().getBBox(),d=2;return s.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),o.node()}else return l.node()}O(YCt,"createFormattedText");function Bxe(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}})}O(Bxe,"decodeHTMLEntities");function UX(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(Bxe(r.content)):i.text(" "+Bxe(r.content))})}O(UX,"updateTextContentAndStyles");async function qCt(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,o)=>(r.push((async()=>{const s=`${a}:${o}`;return await ndn(s)?await s1(s,void 0,{class:"label-icon"}):``})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}O(qCt,"replaceIconSubstring");var su=O(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,markdown:o=!0,isNode:s=!0,width:l=200,addSvgBackground:u=!1}={},h)=>{if(ye.debug("XYZ createText",e,r,n,i,a,s,"addSvgBackground: ",u),a){const d=o?FCt(e,h):$Ct(e),f=await qCt(o1(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:s,label:ps(e)?p:f,labelStyle:r.replace("fill:","color:")};return await GCt(t,g,l,i,u,h)}else{const d=o1(e.replace(//g,"
")),f=o?BCt(d.replace("
","
"),h):NCt(d),p=YCt(l,t,f,e?u:!1,!s);if(s){/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:");_t(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");_t(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:");_t(p).select("text").attr("style",m)}return n?_t(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):_t(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText");function $xe(t,e,r){if(t&&t.length){const[n,i]=e,a=Math.PI/180*r,o=Math.cos(a),s=Math.sin(a);for(const l of t){const[u,h]=l;l[0]=(u-n)*o-(h-i)*s+n,l[1]=(u-n)*s+(h-i)*o+i}}}function Udn(t,e){return t[0]===e[0]&&t[1]===e[1]}function Vdn(t,e,r,n=1){const i=r,a=Math.max(e,.1),o=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,s=[0,0];if(i)for(const u of o)$xe(u,s,i);const l=function(u,h,d){const f=[];for(const b of u){const x=[...b];Udn(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}(o,a,n);if(i){for(const u of o)$xe(u,s,-i);(function(u,h,d){const f=[];u.forEach(p=>f.push(...p)),$xe(f,h,d)})(l,s,-i)}return l}function J7(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),Vdn(t,i,n,a||1)}class Fxe{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=J7(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 VX(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 Qdn extends Fxe{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=J7(e,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,o=[],s=.5*n*Math.cos(a),l=.5*n*Math.sin(a);for(const[u,h]of i)VX([u,h])&&o.push([[u[0]-s,u[1]+l],[...h]],[[u[0]+s,u[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(o,r)}}}class Gdn extends Fxe{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 Hdn=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=J7(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 o=i/4;for(const s of e){const l=VX(s),u=l/i,h=Math.ceil(u)-1,d=l-h*i,f=(s[0][0]+s[1][0])/2-i/4,p=Math.min(s[0][1],s[1][1]);for(let g=0;g{const s=VX(o),l=Math.floor(s/(n+i)),u=(s+i-l*(n+i))/2;let h=o[0],d=o[1];h[0]>d[0]&&(h=o[1],d=o[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let p=0;p{const o=VX(a),s=Math.round(o/(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:[...s]}),e=s[2],r=s[3];break;case"q":{const l=s.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:[...s]}),e=s[5],r=s[6];break;case"a":e+=s[5],r+=s[6],a.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],e,r]});break;case"H":a.push({key:"H",data:[...s]}),e=s[0];break;case"h":e+=s[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...s]}),r=s[0];break;case"v":r+=s[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...s]}),e=s[2],r=s[3];break;case"s":{const l=s.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:[...s]}),e=s[0],r=s[1];break;case"t":e+=s[0],r+=s[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 KCt(t){const e=[];let r="",n=0,i=0,a=0,o=0,s=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,o]=h;break;case"C":e.push({key:"C",data:[...h]}),n=h[4],i=h[5],s=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-s),f=i+(i-l)):(d=n,f=i),e.push({key:"C",data:[d,f,...h]}),s=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-s),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]}),s=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]}),s=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)&&(ZCt(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=o}r=u}return e}function e$(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function ZCt(t,e,r,n,i,a,o,s,l,u){const h=(d=o,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]=e$(t,e,-h),[r,n]=e$(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,I=a*a,N=M*I-M*R*R-I*L*L,F=M*R*R+I*L*L,B=(s===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=ZCt(r=m+i*Math.cos(g),n=v+a*Math.sin(g),R,D,i,a,o,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,C=4/3*a*S,k=[t,e],E=[t+T*x,e-C*b],_=[r+T*A,n-C*w],P=[r,n];if(E[0]=2*k[0]-E[0],E[1]=2*k[1]-E[1],u)return[E,_,P].concat(f);{f=[E,_,P].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=sOt(v,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const b=sOt(v,u,h,d,f,p,g,1.5,l);y.push(...b)}return o&&(s?y.push(...x2(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...x2(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 nOt(t,e){const r=KCt(XCt(Vxe(t))),n=[];let i=[0,0],a=[0,0];for(const{key:o,data:s}of r)switch(o){case"M":a=[s[0],s[1]],i=[s[0],s[1]];break;case"L":n.push(...x2(a[0],a[1],s[0],s[1],e)),a=[s[0],s[1]];break;case"C":{const[l,u,h,d,f,p]=s;n.push(...Zdn(l,u,h,d,f,p,a,e)),a=[f,p];break}case"Z":n.push(...x2(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function Gxe(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]+wn(i,e),n[0][1]+wn(i,e)]});for(let o=1;o500?.4:-.0016668*l+1.233334;let h=i.maxRandomnessOffset||0;h*h*100>s&&(h=l/10);const d=h/2,f=.2+.2*aOt(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=wn(p,i,u),g=wn(g,i,u);const m=[],v=()=>wn(d,i,u),y=()=>wn(h,i,u),b=i.preserveVertices;return o?m.push({op:"move",data:[t+(b?0:v()),e+(b?0:v())]}):m.push({op:"move",data:[t+(b?0:wn(h,i,u)),e+(b?0:wn(h,i,u))]}),o?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 WX(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+wn(e,r),t[0][1]+wn(e,r)]),n.push([t[0][0]+wn(e,r),t[0][1]+wn(e,r)]);for(let i=1;i3){const a=[],o=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let s=1;s+21&&i.push(s)):i.push(s),i.push(t[e+3])}else{const l=t[e+0],u=t[e+1],h=t[e+2],d=t[e+3],f=tC(l,u,.5),p=tC(u,h,.5),g=tC(h,d,.5),m=tC(f,p,.5),v=tC(p,g,.5),y=tC(m,v,.5);Wxe([l,f,m,y],0,r,i),Wxe([y,v,g,d],0,r,i)}var a,o;return i}function efn(t,e){return jX(t,0,t.length,e)}function jX(t,e,r,n,i){const a=i||[],o=t[e],s=t[r-1];let l=0,u=1;for(let h=e+1;hl&&(l=d,u=h)}return Math.sqrt(l)>n?(jX(t,e,u+1,n,a),jX(t,u,r,n,a)):(a.length||a.push(o),a.push(s)),a}function Yxe(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let a=0;a0?jX(n,0,n.length,r):n}const Xd="none";class XX{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 o=this._o(a);return this._d("line",[JCt(e,r,n,i,o)],o)}rectangle(e,r,n,i,a){const o=this._o(a),s=[],l=Kdn(e,r,n,i,o);if(o.fill){const u=[[e,r],[e+n,r],[e+n,r+i],[e,r+i]];o.fillStyle==="solid"?s.push(Gxe([u],o)):s.push(CR([u],o))}return o.stroke!==Xd&&s.push(l),this._d("rectangle",s,o)}ellipse(e,r,n,i,a){const o=this._o(a),s=[],l=tOt(n,i,o),u=Qxe(e,r,o,l);if(o.fill)if(o.fillStyle==="solid"){const h=Qxe(e,r,o,l).opset;h.type="fillPath",s.push(h)}else s.push(CR([u.estimatedPoints],o));return o.stroke!==Xd&&s.push(u.opset),this._d("ellipse",s,o)}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",[GX(e,!1,n)],n)}arc(e,r,n,i,a,o,s=!1,l){const u=this._o(l),h=[],d=rOt(e,r,n,i,a,o,s,!0,u);if(s&&u.fill)if(u.fillStyle==="solid"){const f=Object.assign({},u);f.disableMultiStroke=!0;const p=rOt(e,r,n,i,a,o,!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+=wn(.01*A,b),S+=wn(.01*S,b);let T=v,C=y;for(;T<0;)T+=2*Math.PI,C+=2*Math.PI;C-T>2*Math.PI&&(T=0,C=2*Math.PI);const k=(C-T)/b.curveStepCount,E=[];for(let _=T;_<=C;_+=k)E.push([x+A*Math.cos(_),w+S*Math.sin(_)]);return E.push([x+A*Math.cos(C),w+S*Math.sin(C)]),E.push([x,w]),CR([E],b)}(e,r,n,i,a,o,u));return u.stroke!==Xd&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],a=eOt(e,n);if(n.fill&&n.fill!==Xd)if(n.fillStyle==="solid"){const o=eOt(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(o.ops)})}else{const o=[],s=e;if(s.length){const l=typeof s[0][0]=="number"?[s]:s;for(const u of l)u.length<3?o.push(...u):u.length===3?o.push(...Yxe(lOt([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):o.push(...Yxe(lOt(u),10,(1+n.roughness)/2))}o.length&&i.push(CR([o],n))}return n.stroke!==Xd&&i.push(a),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],a=GX(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(Gxe([e],n)):i.push(CR([e],n))),n.stroke!==Xd&&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!==Xd,o=n.stroke!==Xd,s=!!(n.simplification&&n.simplification<1),l=function(h,d,f){const p=KCt(XCt(Vxe(h))),g=[];let m=[],v=[0,0],y=[];const b=()=>{y.length>=4&&m.push(...Yxe(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=efn(A,f);S.length&&w.push(S)}return w}(e,1,s?4-4*(n.simplification||1):(1+n.roughness)/2),u=nOt(e,n);if(a)if(n.fillStyle==="solid")if(l.length===1){const h=nOt(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(Gxe(l,n));else i.push(CR(l,n));return o&&(s?l.forEach(h=>{i.push(GX(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(o=>+o.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 o=null;switch(a.type){case"path":o={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Xd};break;case"fillPath":o={d:this.opsToPath(a),stroke:Xd,strokeWidth:0,fill:n.fill||Xd};break;case"fillSketch":o=this.fillSketch(a,n)}o&&i.push(o)}return i}fillSketch(e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||Xd,strokeWidth:n,fill:Xd}}_mergedShape(e){return e.filter((r,n)=>n===0||r.op!=="move")}}class tfn{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new XX(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.ctx,a=e.options.fixedDecimalPlaceDigits;for(const o of r)switch(o.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,o,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";const s=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,o,a,s),i.restore();break}case"fillSketch":this.fillSketch(i,o,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 o=typeof n=="number"&&n>=0?a.data.map(s=>+s.toFixed(n)):a.data;switch(a.op){case"move":e.moveTo(o[0],o[1]);break;case"bcurveTo":e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":e.lineTo(o[0],o[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 o=this.gen.line(e,r,n,i,a);return this.draw(o),o}rectangle(e,r,n,i,a){const o=this.gen.rectangle(e,r,n,i,a);return this.draw(o),o}ellipse(e,r,n,i,a){const o=this.gen.ellipse(e,r,n,i,a);return this.draw(o),o}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,o,s=!1,l){const u=this.gen.arc(e,r,n,i,a,o,s,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 KX="http://www.w3.org/2000/svg";class rfn{constructor(e,r){this.svg=e,this.gen=new XX(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(KX,"g"),o=e.options.fixedDecimalPlaceDigits;for(const s of r){let l=null;switch(s.type){case"path":l=i.createElementNS(KX,"path"),l.setAttribute("d",this.opsToPath(s,o)),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(KX,"path"),l.setAttribute("d",this.opsToPath(s,o)),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,s,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(KX,"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 o=this.gen.line(e,r,n,i,a);return this.draw(o)}rectangle(e,r,n,i,a){const o=this.gen.rectangle(e,r,n,i,a);return this.draw(o)}ellipse(e,r,n,i,a){const o=this.gen.ellipse(e,r,n,i,a);return this.draw(o)}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,o,s=!1,l){const u=this.gen.arc(e,r,n,i,a,o,s,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 tfn(t,e),svg:(t,e)=>new rfn(t,e),generator:t=>new XX(t),newSeed:()=>XX.newSeed()},gn=O(async(t,e,r)=>{var p,g;let n;const i=e.useHtmlLabels||p0((p=Ye())==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),o=a.insert("g").attr("class","label").attr("style",Fl(e.labelStyle));let s;e.label===void 0?s="":s=typeof e.label=="string"?e.label:e.label[0];const l=!!e.icon||!!e.img,u=e.labelType==="markdown",h=await su(o,li(o1(s),Ye()),{useHtmlLabels:i,width:e.width||((g=Ye().flowchart)==null?void 0:g.wrappingWidth),classes:u?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:l,markdown:u},Ye());let d=h.getBBox();const f=((e==null?void 0:e.padding)??0)/2;if(i){const m=h.children[0],v=_t(h);await wxe(m,s),d=m.getBoundingClientRect(),v.attr("width",d.width),v.attr("height",d.height)}return i?o.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):o.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&o.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:a,bbox:d,halfPadding:f,label:o}},"labelHelper"),qxe=O(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??na(Ye()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await su(i,li(o1(e),Ye()),{useHtmlLabels:n,width:r.width||((u=(l=Ye())==null?void 0:l.flowchart)==null?void 0:u.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let o=a.getBBox();const s=r.padding/2;if(na(Ye())){const h=a.children[0],d=_t(a);o=h.getBoundingClientRect(),d.attr("width",o.width),d.attr("height",o.height)}return n?i.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"):i.attr("transform","translate(0, "+-o.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:o,halfPadding:s,label:i}},"insertLabel"),Br=O((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),an=O((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function Ei(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}O(Ei,"createPathFromPoints");function w2(t,e,r,n,i,a){const o=[],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));o.push({x:m,y:v})}return o}O(w2,"generateFullSineWavePoints");function r$(t,e,r,n,i,a){const o=[],s=i*Math.PI/180,h=(a*Math.PI/180-s)/(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"),o=O((l,u)=>(l==null?void 0:l.getAttribute(u))??void 0,"getAttr");if(i){const l={fill:o(i,"fill"),"fill-opacity":o(i,"fill-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}if(a){const l={stroke:o(a,"stroke"),"stroke-width":o(a,"stroke-width")??"1","stroke-opacity":o(a,"stroke-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}const s=document.createElementNS("http://www.w3.org/2000/svg","g");return s.appendChild(r),s}O(jxe,"mergePaths");var nfn=O((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,o=t.width/2,s=t.height/2,l,u;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),l=a===0?0:s*i/a,u=s):(i<0&&(o=-o),l=o,u=i===0?0:o*a/i),{x:r+l,y:n+u}},"intersectRect"),rC=nfn,ifn=O(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const o=Ye(),s=na(o);return await su(t,a,{style:r,isTitle:n,useHtmlLabels:s,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},o)},"createLabel"),A2=ifn,S2=O((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"),afn=O(async(t,e)=>{const r=Ye(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:o}=n,s=o,{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=p0(r.flowchart.htmlLabels),g=e.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),v=await su(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=_t(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,C=e.swimlaneContentTop!==void 0?e.swimlaneContentTop:A+w/3,k=g?4:0,E=y.height+2*k;let _,P;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:s,fillWeight:3,seed:i}),B=_r(e,{roughness:.7,fill:"none",stroke:s,seed:i}),V=N.rectangle(T,A,L,w,F);_=f.insert(()=>V,":first-child");const z=N.rectangle(R,A,D,w,B);P=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"),P=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",s),P.attr("class","swimlane-body").attr("style",u).attr("x",R).attr("y",A).attr("width",D).attr("height",w).attr("fill","none").attr("stroke",s);const M=T+L/2,I=e.y;m.attr("transform",`translate(${M}, ${I}) rotate(-90) translate(${-y.width/2}, ${-y.height/2})`)}else{const L=Math.max(0,C-A),R=Math.min(E,L),D=A+R,M=Math.max(0,S-D),I=e.x-x/2;if(e.look==="handDrawn"){const B=Er.svg(f),V=_r(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),z=_r(e,{roughness:.7,fill:"none",stroke:s,seed:i}),U=B.rectangle(I,A,x,R,V);_=f.insert(()=>U,":first-child");const Q=B.rectangle(I,D,x,M,z);P=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"),P=f.insert("rect",":first-child"),_.attr("class","swimlane-title").attr("style",u).attr("x",I).attr("y",A).attr("width",x).attr("height",R).attr("fill",a).attr("stroke",s),P.attr("class","swimlane-body").attr("style",u).attr("x",I).attr("y",D).attr("width",x).attr("height",M).attr("fill","none").attr("stroke",s);const N=e.x-y.width/2,F=A+(R-y.height)/2;m.attr("transform",`translate(${N}, ${F})`)}if(ye.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 rC(e,L)},{cluster:f,labelBBox:y}},"swimlane"),cOt=O(async(t,e)=>{ye.info("Creating subgraph rect for ",e.id,e);const r=Ye(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:o}=n,{labelStyles:s,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=na(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await su(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await A2(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(na(r)){const T=g.children[0],C=_t(g);m=T.getBoundingClientRect(),C.attr("width",m.width),C.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;ye.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const T=Er.svg(d),C=_r(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),k=T.path(S2(b,x,v,y,0),C);w=d.insert(()=>(ye.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}=TR(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+A})`),s){const T=p.select("span");T&&T.attr("style",s)}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 rC(e,T)},{cluster:d,labelBBox:m}},"rect"),ofn=O((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 o=n.node().getBBox();return e.width=o.width,e.height=o.height,e.intersect=function(s){return rC(e,s)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),sfn=O(async(t,e)=>{const r=Ye(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:o,compositeTitleBackground:s,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 A2(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(na(r)){const k=p.children[0],E=_t(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(S2(w,A,y,b,10),{roughness:.7,fill:s,fillStyle:"solid",stroke:l,seed:i}):E.rectangle(w,A,y,b,{seed:i});T=u.insert(()=>_,":first-child");const P=E.rectangle(w,S,y,x,{fill:k?a:o,fillStyle:k?"hachure":"solid",stroke:l,seed:i});T=u.insert(()=>_,":first-child"),f=u.insert(()=>P)}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-(na(r)?0:3)})`);const C=T.node().getBBox();return e.height=C.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(k){return rC(e,k)},{cluster:u,labelBBox:g}},"roundedWithTitle"),lfn=O(async(t,e)=>{ye.info("Creating subgraph rect for ",e.id,e);const r=Ye(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:o}=n,{labelStyles:s,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=na(r),p=d.insert("g").attr("class","cluster-label "),g=await su(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(na(r)){const T=g.children[0],C=_t(g);m=T.getBoundingClientRect(),C.attr("width",m.width),C.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;ye.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const T=Er.svg(d),C=_r(e,{roughness:.7,fill:a,stroke:o,fillWeight:4,seed:i}),k=T.path(S2(b,x,v,y,e.rx),C);w=d.insert(()=>(ye.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}=TR(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+A})`),s){const T=p.select("span");T&&T.attr("style",s)}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 rC(e,T)},{cluster:d,labelBBox:m}},"kanbanSection"),cfn=O((t,e)=>{const r=Ye(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,o=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-look",e.look),s=o.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(o).rectangle(d,f,u,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});p=o.insert(()=>v,":first-child")}else{p=s.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 rC(e,m)},{cluster:o,labelBBox:{}}},"divider"),ufn=cOt,hfn={rect:cOt,squareRect:ufn,roundedWithTitle:sfn,noteGroup:ofn,divider:cfn,kanbanSection:lfn,swimlane:afn},uOt=new Map,ZX=O(async(t,e)=>{const r=e.shape||"rect",n=await hfn[r](t,e);return uOt.set(e.id,n),n},"insertCluster"),hOt=O(()=>{uOt=new Map},"clear");function dOt(t,e){return t.intersect(e)}O(dOt,"intersectNode");var dfn=dOt;function fOt(t,e,r,n){var i=t.x,a=t.y,o=i-n.x,s=a-n.y,l=Math.sqrt(e*e*s*s+r*r*o*o),u=Math.abs(e*r*o/l);n.x0}O(Xxe,"sameSign");var pfn=mOt;function vOt(t,e,r){let n=t.x,i=t.y,a=[],o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(h){o=Math.min(o,h.x),s=Math.min(s,h.y)}):(o=Math.min(o,e.x),s=Math.min(s,e.y));let l=n-t.width/2-o,u=i-t.height/2-s;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",Fl(s)),Br(e,d),e.intersect=function(f){return ye.info("Circle intersect",e,o,f),Sr.circle(e,o,f)},a}O(yOt,"anchor");function Kxe(t,e,r,n,i,a,o){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)*(o?-1:1),b=u-v*i*Math.cos(h)*(o?-1:1),x=Math.atan2((e-b)/a,(t-y)/i);let A=Math.atan2((n-b)/a,(r-y)/i)-x;o&&A<0&&(A+=2*Math.PI),!o&&A>0&&(A-=2*Math.PI);const S=[];for(let T=0;T<20;T++){const C=T/19,k=x+C*A,E=y+i*Math.cos(k),_=b+a*Math.sin(k);S.push({x:E,y:_})}return S}O(Kxe,"generateArcPoints");function bOt(t,e,r){const[n,i]=[e,r].sort((a,o)=>o-a);return i*(1-Math.sqrt(1-(t/n/2)**2))}O(bOt,"calculateArcSagitta");async function xOt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,o=e.look==="neo"?12:i,s=O(k=>k+o,"calcTotalHeight"),l=O(k=>{const E=k/2;return[E/(2.5+k/50),E]},"calcEllipseRadius"),{shapeSvg:u,bbox:h}=await gn(t,e,an(e)),d=s(e!=null&&e.height?e==null?void 0:e.height:h.height),[f,p]=l(d),g=bOt(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},...Kxe(-v/2,-y/2,-v/2,y/2,f,p,!1),{x:v/2,y:y/2},...Kxe(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=Ei(x),T=w.path(S,A),C=u.insert(()=>T,":first-child");return C.attr("class","basic label-container outer-path"),b&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",b),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(${f/2}, 0)`),Br(e,C),e.intersect=function(k){return Sr.polygon(e,x,k)},u}O(xOt,"bowTieRect");function l1(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+")")}O(l1,"insertPolygonShape");var JX=12;async function wOt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?28:i,o=e.look==="neo"?24:i,{shapeSvg:s,bbox:l}=await gn(t,e,an(e)),u=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a+JX),h=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?o*2:o),d=0,f=u,p=-h,g=0,m=[{x:d+JX,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+JX},{x:d+JX,y:p}];let v;const{cssStyles:y}=e;if(e.look==="handDrawn"){const b=Er.svg(s),x=_r(e,{}),w=Ei(m),A=b.path(w,x);v=s.insert(()=>A,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),y&&v.attr("style",y)}else v=l1(s,u,h,m);return n&&v.attr("style",n),Br(e,v),e.intersect=function(b){return Sr.polygon(e,m,b)},s}O(wOt,"card");function AOt(t,e){const{nodeStyles:r}=Or(e);e.label="";const n=t.insert("g").attr("class",an(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,a=Math.max(28,e.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=Er.svg(n),l=_r(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=Ei(o),h=s.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,o,f)},n}O(AOt,"choice");async function Zxe(t,e,r){const{labelStyles:n,nodeStyles:i}=Or(e);e.labelStyle=n;const{shapeSvg:a,bbox:o,halfPadding:s}=await gn(t,e,an(e)),l=16,u=(r==null?void 0:r.padding)??s,h=e.look==="neo"?o.width/2+l*2:o.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",Fl(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 Br(e,d),e.calcIntersect=function(p,g){const m=p.width/2;return Sr.circle(p,m,g)},e.intersect=function(p){return ye.info("Circle intersect",e,h,p),Sr.circle(e,h,p)},a}O(Zxe,"circle");function SOt(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},o={x:-(n/2)*e,y:-(n/2)*r},s={x:n/2*e,y:-(n/2)*r};return`M ${a.x},${a.y} L ${s.x},${s.y} - M ${i.x},${i.y} L ${o.x},${o.y}`}O(SOt,"createLine");function TOt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",an(e)).attr("id",e.domId??e.id),a=Math.max(30,(e==null?void 0:e.width)??0),{cssStyles:o}=e,s=Er.svg(i),l=_r(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=s.circle(0,0,a*2,l),h=SOt(a),d=s.path(h,l),f=i.insert(()=>u,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),o&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",o),n&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",n),Br(e,f),e.intersect=function(p){return ye.info("crossedCircle intersect",e,{radius:a,point:p}),Sr.circle(e,a,p)},i}O(TOt,"crossedCircle");function c1(t,e,r,n=100,i=0,a=180){const o=[],s=i*Math.PI/180,h=(a*Math.PI/180-s)/(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)`),o.attr("transform",`translate(${-u/2+d-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Br(e,S),e.intersect=function(T){return Sr.polygon(e,g,T)},i}O(COt,"curlyBraceLeft");function u1(t,e,r,n=100,i=0,a=180){const o=[],s=i*Math.PI/180,h=(a*Math.PI/180-s)/(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)`),o.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))})`),Br(e,S),e.intersect=function(T){return Sr.polygon(e,g,T)},i}O(OOt,"curlyBraceRight");function bc(t,e,r,n=100,i=0,a=180){const o=[],s=i*Math.PI/180,h=(a*Math.PI/180-s)/(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)`),o.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))})`),Br(e,E),e.intersect=function(_){return Sr.polygon(e,m,_)},i}O(kOt,"curlyBraces");async function EOt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,o=e.look==="neo"?12:i,s=20,l=5,{shapeSvg:u,bbox:h}=await gn(t,e,an(e)),d=Math.max(s,(h.width+a*2)*1.25,(e==null?void 0:e.width)??0),f=Math.max(l,h.height+o*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},...r$(-x,-b/2,p,50,270,90)],S=Ei(A),T=m.path(S,v),C=u.insert(()=>T,":first-child");return C.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&C.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&C.selectChildren("path").attr("style",n),C.attr("transform",`translate(${-d/2}, ${-f/2})`),Br(e,C),e.intersect=function(k){return Sr.polygon(e,A,k)},u}O(EOt,"curvedTrapezoid");var mfn=O((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"),vfn=O((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"),yfn=O((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),_Ot=8,ROt=8;async function DOt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?24:i,o=e.look==="neo"?24:i;if(e.width||e.height){const v=e.width??0;e.width=(e.width??0)-o,e.widthA,":first-child"),g=s.insert(()=>w,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const v=mfn(0,0,h,p,d,f);g=s.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",Fl(m)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),Br(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},s}O(DOt,"cylinder");async function OR(t,e,r){const{labelStyles:n,nodeStyles:i}=Or(e);e.labelStyle=n;const{shapeSvg:a,bbox:o}=await gn(t,e,an(e)),s=Math.max(o.width+r.labelPaddingX*2,(e==null?void 0:e.width)||0),l=Math.max(o.height+r.labelPaddingY*2,(e==null?void 0:e.height)||0),u=-s/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(S2(u,h,s,l,f||0),v):m.rectangle(u,h,s,l,v);d=a.insert(()=>y,":first-child"),d.attr("class","basic label-container").attr("style",Fl(g))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",Fl(f)).attr("ry",Fl(p)).attr("x",u).attr("y",h).attr("width",s).attr("height",l);return Br(e,d),e.calcIntersect=function(m,v){return Sr.rect(m,v)},e.intersect=function(m){return Sr.rect(e,m)},a}O(OR,"drawRect");async function LOt(t,e){const{cssClasses:r,labelPaddingX:n,labelPaddingY:i,padding:a,width:o,height:s}=e,l={rx:0,ry:0,labelPaddingX:n??(a??0)*2,labelPaddingY:i??a??0},u=await OR(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"))||o)??0,f=(Number(h.attr("height"))||s)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),u}O(LOt,"datastore");async function MOt(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:o,bbox:s,label:l}=await gn(t,e,an(e)),u=s.width+i,h=s.height+a,d=h*.2,f=-u/2,p=-h/2-d/2,{cssStyles:g}=e,m=Er.svg(o),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=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),l.attr("transform",`translate(${f+(e.padding??0)/2-(s.x-(s.left??0))}, ${p+d+(e.padding??0)/2-(s.y-(s.top??0))})`),Br(e,x),e.intersect=function(w){return Sr.rect(e,w)},o}O(MOt,"dividedRectangle");async function IOt(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,o=e.look==="neo"?16:a,{shapeSvg:s,bbox:l}=await gn(t,e,an(e)),u=(e!=null&&e.width?(e==null?void 0:e.width)/2:l.width/2)+(o??0),h=u-i;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const m=Er.svg(s),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=s.insert("g",":first-child"),d.attr("class",Fl(e.cssClasses)).attr("style",Fl(f)),(p=d.node())==null||p.appendChild(b),(g=d.node())==null||g.appendChild(x)}else{d=s.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 Br(e,d),e.intersect=function(m){return ye.info("DoubleCircle intersect",e,u,m),Sr.circle(e,u,m)},s}O(IOt,"doublecircle");function POt(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Or(e);e.label="",e.labelStyle=n;const a=t.insert("g").attr("class",an(e)).attr("id",e.domId??e.id),o=7,{cssStyles:s}=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,o*2,h),f=a.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${u} !important;`),s&&s.length>0&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",s),i&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",i),Br(e,f),e.intersect=function(p){return ye.info("filledCircle intersect",e,{radius:o,point:p}),Sr.circle(e,o,p)},a}O(POt,"filledCircle");var NOt=10,BOt=10;async function $Ot(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,Br(e,b),l.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${-h/2+(e.padding??0)/2+(s.y-(s.top??0))})`),e.intersect=function(x){return ye.info("Triangle intersect",e,f,x),Sr.polygon(e,f,x)},o}O($Ot,"flippedTriangle");function FOt(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=Or(e);e.label="";const o=t.insert("g").attr("class",an(e)).attr("id",e.domId??e.id),{cssStyles:s}=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(o),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=o.insert(()=>g,":first-child");s&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",s),a&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",a),Br(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)},o}O(FOt,"forkJoin");async function zOt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=15,a=10,o=e.look==="neo"?16:e.padding??0,s=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.height=((e==null?void 0: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),Br(e,x),e.intersect=function(w){return ye.info("Pill intersect",e,{radius:f,point:w}),Sr.polygon(e,v,w)},l}O(zOt,"halfRoundedRectangle");var bfn=O((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 UOt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e),i=e.look==="neo"?3.5:4;e.labelStyle=r;const a=e.padding??0,o=70,s=32,l=e.look==="neo"?o:a,u=e.look==="neo"?s: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 gn(t,e,an(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=bfn(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=l1(h,g,f,m);return n&&v.attr("style",n),e.width=g,e.height=f,Br(e,v),e.intersect=function(b){return Sr.polygon(e,m,b)},h}O(UOt,"hexagon");async function VOt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await gn(t,e,an(e)),a=Math.max(30,(e==null?void 0:e.width)??0),o=Math.max(30,(e==null?void 0:e.height)??0),{cssStyles:s}=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:o},{x:a,y:o}],d=Ei(h),f=l.path(d,u),p=i.insert(()=>f,":first-child");return p.attr("class","basic label-container outer-path"),s&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",s),n&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",n),p.attr("transform",`translate(${-a/2}, ${-o/2})`),Br(e,p),e.intersect=function(g){return ye.info("Pill intersect",e,{points:h}),Sr.polygon(e,h,g)},i}O(VOt,"hourglass");async function QOt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Or(e);e.labelStyle=i;const a=e.assetHeight??48,o=e.assetWidth??48,s=Math.max(a,o),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(s,l??0);const{shapeSvg:u,bbox:h,label:d}=await gn(t,e,"icon-shape default"),f=e.pos==="t",p=s,g=s,{nodeBorder:m}=r,{stylesMap:v}=wR(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),C=p+h.height+x,k=w.rectangle(-T/2,-C/2,T,C,{...A,fill:"transparent",stroke:"none"}),E=u.insert(()=>S,":first-child"),_=u.insert(()=>k);if(e.icon){const P=u.append("g");P.html(`${await s1(e.icon,{height:s,width:s,fallbackPrefix:""})}`);const L=P.node().getBBox(),R=L.width,D=L.height,M=L.x,I=L.y;P.attr("transform",`translate(${-R/2-M},${f?h.height/2+x/2-D/2-I:-h.height/2-x/2-D/2-I})`),P.attr("style",`color: ${v.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-C/2:C/2-h.height})`),E.attr("transform",`translate(0,${f?h.height/2+x/2:-h.height/2-x/2})`),Br(e,_),e.intersect=function(P){if(ye.info("iconSquare intersect",e,P),!e.label)return Sr.rect(e,P);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,P)},u}O(QOt,"icon");async function GOt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Or(e);e.labelStyle=i;const a=e.assetHeight??48,o=e.assetWidth??48,s=Math.max(a,o),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(s,l??0);const{shapeSvg:u,bbox:h,label:d}=await gn(t,e,"icon-shape default"),f=20,p=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:v}=r,{stylesMap:y}=wR(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 s1(e.icon,{height:s,width:s,fallbackPrefix:""})}`);const S=A.node().getBBox(),T=S.width,C=S.height,k=S.x,E=S.y,_=Math.max(T,C)*Math.SQRT2+f*2,P=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(()=>P,":first-child"),I=u.insert(()=>D);return A.attr("transform",`translate(${-T/2-k},${g?h.height/2+p/2-C/2-E:-h.height/2-p/2-C/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})`),Br(e,I),e.intersect=function(N){return ye.info("iconSquare intersect",e,N),Sr.rect(e,N)},u}O(GOt,"iconCircle");async function HOt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Or(e);e.labelStyle=i;const a=e.assetHeight??48,o=e.assetWidth??48,s=Math.max(a,o),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(s,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await gn(t,e,"icon-shape default"),p=e.pos==="t",g=s+d*2,m=s+d*2,{nodeBorder:v,mainBkg:y}=r,{stylesMap:b}=wR(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 C=b.get("fill");T.stroke=C??y;const k=S.path(S2(x,w,m,g,5),T),E=Math.max(m,h.width),_=g+h.height+A,P=S.rectangle(-E/2,-_/2,E,_,{...T,fill:"transparent",stroke:"none"}),L=u.insert(()=>k,":first-child").attr("class","icon-shape2"),R=u.insert(()=>P);if(e.icon){const D=u.append("g");D.html(`${await s1(e.icon,{height:s,width:s,fallbackPrefix:""})}`);const M=D.node().getBBox(),I=M.width,N=M.height,F=M.x,B=M.y;D.attr("transform",`translate(${-I/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})`),Br(e,R),e.intersect=function(D){if(ye.info("iconSquare intersect",e,D),!e.label)return Sr.rect(e,D);const M=e.x??0,I=e.y??0,N=e.height??0;let F=[];return p?F=[{x:M-h.width/2,y:I-N/2},{x:M+h.width/2,y:I-N/2},{x:M+h.width/2,y:I-N/2+h.height+A},{x:M+m/2,y:I-N/2+h.height+A},{x:M+m/2,y:I+N/2},{x:M-m/2,y:I+N/2},{x:M-m/2,y:I-N/2+h.height+A},{x:M-h.width/2,y:I-N/2+h.height+A}]:F=[{x:M-m/2,y:I-N/2},{x:M+m/2,y:I-N/2},{x:M+m/2,y:I-N/2+g},{x:M+h.width/2,y:I-N/2+g},{x:M+h.width/2/2,y:I+N/2},{x:M-h.width/2,y:I+N/2},{x:M-h.width/2,y:I-N/2+g},{x:M-m/2,y:I-N/2+g}],Sr.polygon(e,F,D)},u}O(HOt,"iconRounded");async function WOt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Or(e);e.labelStyle=i;const a=e.assetHeight??48,o=e.assetWidth??48,s=Math.max(a,o),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(s,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await gn(t,e,"icon-shape default"),p=e.pos==="t",g=s+d*2,m=s+d*2,{nodeBorder:v,mainBkg:y}=r,{stylesMap:b}=wR(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 C=b.get("fill");T.stroke=C??y;const k=S.path(S2(x,w,m,g,.1),T),E=Math.max(m,h.width),_=g+h.height+A,P=S.rectangle(-E/2,-_/2,E,_,{...T,fill:"transparent",stroke:"none"}),L=u.insert(()=>k,":first-child"),R=u.insert(()=>P);if(e.icon){const D=u.append("g");D.html(`${await s1(e.icon,{height:s,width:s,fallbackPrefix:""})}`);const M=D.node().getBBox(),I=M.width,N=M.height,F=M.x,B=M.y;D.attr("transform",`translate(${-I/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})`),Br(e,R),e.intersect=function(D){if(ye.info("iconSquare intersect",e,D),!e.label)return Sr.rect(e,D);const M=e.x??0,I=e.y??0,N=e.height??0;let F=[];return p?F=[{x:M-h.width/2,y:I-N/2},{x:M+h.width/2,y:I-N/2},{x:M+h.width/2,y:I-N/2+h.height+A},{x:M+m/2,y:I-N/2+h.height+A},{x:M+m/2,y:I+N/2},{x:M-m/2,y:I+N/2},{x:M-m/2,y:I-N/2+h.height+A},{x:M-h.width/2,y:I-N/2+h.height+A}]:F=[{x:M-m/2,y:I-N/2},{x:M+m/2,y:I-N/2},{x:M+m/2,y:I-N/2+g},{x:M+h.width/2,y:I-N/2+g},{x:M+h.width/2/2,y:I+N/2},{x:M-h.width/2,y:I+N/2},{x:M-h.width/2,y:I-N/2+g},{x:M-m/2,y:I-N/2+g}],Sr.polygon(e,F,D)},u}O(WOt,"iconSquare");async function YOt(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:o}=Or(e);e.labelStyle=o;const s=r==null?void 0:r.wrappingWidth;e.defaultWidth=r==null?void 0:r.wrappingWidth;const l=Math.max(e.label?s??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,s??0);const{shapeSvg:d,bbox:f,label:p}=await gn(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"}),C=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})`),C.attr("transform",`translate(0,${g?f.height/2+y/2:-f.height/2-y/2})`),Br(e,k),e.intersect=function(E){if(ye.info("iconSquare intersect",e,E),!e.label)return Sr.rect(e,E);const _=e.x??0,P=e.y??0,L=e.height??0;let R=[];return g?R=[{x:_-f.width/2,y:P-L/2},{x:_+f.width/2,y:P-L/2},{x:_+f.width/2,y:P-L/2+f.height+y},{x:_+u/2,y:P-L/2+f.height+y},{x:_+u/2,y:P+L/2},{x:_-u/2,y:P+L/2},{x:_-u/2,y:P-L/2+f.height+y},{x:_-f.width/2,y:P-L/2+f.height+y}]:R=[{x:_-u/2,y:P-L/2},{x:_+u/2,y:P-L/2},{x:_+u/2,y:P-L/2+h},{x:_+f.width/2,y:P-L/2+h},{x:_+f.width/2/2,y:P+L/2},{x:_-f.width/2,y:P+L/2},{x:_-f.width/2,y:P-L/2+h},{x:_-u/2,y:P-L/2+h}],Sr.polygon(e,R,E)},d}O(YOt,"imageSquare");async function qOt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=i,o=e.look==="neo"?i*2:i,{shapeSvg:s,bbox:l}=await gn(t,e,an(e)),u=Math.max(l.width+(o??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(s),m=_r(e,{}),v=Ei(d),y=g.path(v,m);f=s.insert(()=>y,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),p&&f.attr("style",p)}else f=l1(s,u,h,d);return n&&f.attr("style",n),e.width=u,e.height=h,Br(e,f),e.intersect=function(g){return Sr.polygon(e,d,g)},s}O(qOt,"inv_trapezoid");async function jOt(t,e){const{shapeSvg:r,bbox:n,label:i}=await gn(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))})`),Br(e,a),e.intersect=function(l){return Sr.rect(e,l)},r}O(jOt,"labelRect");async function XOt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=i,o=e.look==="neo"?i*2:i,{shapeSvg:s,bbox:l}=await gn(t,e,an(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+o,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(s),m=_r(e,{}),v=Ei(d),y=g.path(v,m);f=s.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=l1(s,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Br(e,f),e.intersect=function(g){return Sr.polygon(e,d,g)},s}O(XOt,"lean_left");async function KOt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=i,o=e.look==="neo"?i*2:i,{shapeSvg:s,bbox:l}=await gn(t,e,an(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+o,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(s),m=_r(e,{}),v=Ei(d),y=g.path(v,m);f=s.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=l1(s,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Br(e,f),e.intersect=function(g){return Sr.polygon(e,d,g)},s}O(KOt,"lean_right");function ZOt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",an(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,o=Math.max(35,(e==null?void 0:e.width)??0),s=Math.max(35,(e==null?void 0:e.height)??0),l=7,u=[{x:o,y:0},{x:0,y:s+l/2},{x:o-2*l,y:s+l/2},{x:0,y:2*s},{x:o,y:s-l/2},{x:2*l,y:s-l/2}],h=Er.svg(i),d=_r(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=Ei(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(-${o/2},${-s})`),Br(e,g),e.intersect=function(m){return ye.info("lightningBolt intersect",e,m),Sr.polygon(e,u,m)},i}O(ZOt,"lightningBolt");var xfn=O((t,e,r,n,i,a,o)=>[`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+o}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),wfn=O((t,e,r,n,i,a,o)=>[`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+o}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),Afn=O((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),JOt=10,ekt=10;async function tkt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,o=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=s.insert(()=>A,":first-child"),m.attr("class","basic label-container"),v&&m.attr("style",v)}else{const y=xfn(0,0,h,p,d,f,g);m=s.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Fl(v)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),Br(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},s}O(tkt,"linedCylinder");async function rkt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,o=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)-o*2,e.height<10&&(e.height=10)}const{shapeSvg:s,bbox:l,label:u}=await gn(t,e,an(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)+(o??0)*2,f=e.look==="neo"?d/4:d/8,p=d+f,{cssStyles:g}=e,m=Er.svg(s),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},...w2(-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=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),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))})`),Br(e,x),e.intersect=function(w){return Sr.polygon(e,y,w)},s}O(rkt,"linedWaveEdgedRect");async function nkt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,o=e.look==="neo"?12:i,s=e.look==="neo"?10:5;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-2*s,10),e.height=Math.max(((e==null?void 0:e.height)??0)-o*2-2*s,10));const{shapeSvg:l,bbox:u,label:h}=await gn(t,e,an(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+a*2+2*s,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+o*2+2*s,p=d-2*s,g=f-2*s,m=-p/2,v=-g/2,{cssStyles:y}=e,b=Er.svg(l),x=_r(e,{}),w=[{x:m-s,y:v+s},{x:m-s,y:v+g+s},{x:m+p-s,y:v+g+s},{x:m+p-s,y:v+g},{x:m+p,y:v+g},{x:m+p,y:v+g-s},{x:m+p+s,y:v+g-s},{x:m+p+s,y:v-s},{x:m+s,y:v-s},{x:m+s,y:v},{x:m,y:v},{x:m,y:v+s}],A=[{x:m,y:v+s},{x:m+p-s,y:v+s},{x:m+p-s,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=Ei(w);let T=b.path(S,x);const C=Ei(A);let k=b.path(C,x);e.look!=="handDrawn"&&(T=jxe(T),k=jxe(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)-s-(u.x-(u.left??0))}, ${-(u.height/2)+s-(u.y-(u.top??0))})`),Br(e,E),e.intersect=function(_){return Sr.polygon(e,w,_)},l}O(nkt,"multiRect");async function ikt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:o}=await gn(t,e,an(e)),s=e.padding??0,l=e.look==="neo"?16:s,u=e.look==="neo"?12:s;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=w2(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),C=_r(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const k=Ei(A),E=T.path(k,C),_=Ei(S),P=T.path(_,C),L=i.insert(()=>E,":first-child");return L.insert(()=>P),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})`),o.attr("transform",`translate(${-(a.width/2)-y-(a.x-(a.left??0))}, ${-(a.height/2)+y-p/2-(a.y-(a.top??0))})`),Br(e,L),e.intersect=function(R){return Sr.polygon(e,A,R)},i}O(ikt,"multiWaveEdgedRectangle");async function akt(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Or(e);e.labelStyle=n,e.useHtmlLabels||na(Dr())||(e.centerLabel=!0);const{shapeSvg:o,bbox:s,label:l}=await gn(t,e,an(e)),u=Math.max(s.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),h=Math.max(s.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),d=-u/2,f=-h/2,{cssStyles:p}=e,g=Er.svg(o),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=o.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(${-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),Br(e,y),e.intersect=function(b){return Sr.rect(e,b)},o}O(akt,"note");var Sfn=O((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 okt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await gn(t,e,an(e)),o=a.width+(e.padding??0),s=a.height+(e.padding??0),l=o+s,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=Sfn(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=l1(i,l,l,h),d.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&d.attr("style",n),Br(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}O(okt,"question");async function skt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?21:i??0,o=e.look==="neo"?12:i??0,{shapeSvg:s,bbox:l,label:u}=await gn(t,e,an(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"?o*2:o),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(s),b=_r(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const x=Ei(m),w=y.path(x,b),A=s.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))})`),Br(e,A),e.intersect=function(S){return Sr.polygon(e,m,S)},s}O(skt,"rect_left_inv_arrow");async function lkt(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),o=a.insert("g"),s=a.insert("g").attr("class","label").attr("style",n),l=e.description,u=e.label,h=await A2(s,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(na(Ye())){const C=h.children[0],k=_t(h);d=C.getBoundingClientRect(),k.attr("width",d.width),k.attr("height",d.height)}ye.info("Text 2",l);const f=l||[],p=h.getBBox(),g=await A2(s,Array.isArray(f)?f.join("
"):f,e.labelStyle,!0,!0),m=g.children[0],v=_t(g);d=m.getBoundingClientRect(),v.attr("width",d.width),v.attr("height",d.height);const y=(e.padding||0)/2;_t(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+y+5)+")"),_t(h).attr("transform","translate( "+(d.width(ye.debug("Rough node insert CXC",E),_),":first-child"),S=a.insert(()=>(ye.debug("Rough node insert CXC",E),E),":first-child")}else S=o.insert("rect",":first-child"),T=o.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 Br(e,S),e.intersect=function(C){return Sr.rect(e,C)},a}O(lkt,"rectWithTitle");async function ckt(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 OR(t,e,i)}O(ckt,"roundedRect");var nC=8;async function ukt(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:o,bbox:s,label:l}=await gn(t,e,an(e)),u=((e==null?void 0:e.width)??s.width)+i*2+(e.look==="neo"?nC:nC*2),h=((e==null?void 0:e.height)??s.height)+a*2,d=u-nC,f=h,p=nC-u/2,g=-h/2,{cssStyles:m}=e,v=Er.svg(o),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-nC,y:g+f},{x:p-nC,y:g},{x:p,y:g},{x:p,y:g+f}],x=v.polygon(b.map(A=>[A.x,A.y]),y),w=o.insert(()=>x,":first-child");return w.attr("class","basic label-container outer-path").attr("style",Fl(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(${nC/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),Br(e,w),e.intersect=function(A){return Sr.rect(e,A)},o}O(ukt,"shadedProcess");async function hkt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,o=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-o*2,10));const{shapeSvg:s,bbox:l,label:u}=await gn(t,e,an(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)+o*2)*1.5,f=h,p=d/1.5,g=-f/2,m=-p/2,{cssStyles:v}=e,y=Er.svg(s),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=Ei(x),A=y.path(w,b),S=s.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))})`),Br(e,S),e.intersect=function(T){return Sr.polygon(e,x,T)},s}O(hkt,"slopedRect");async function dkt(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 OR(t,e,a)}O(dkt,"squareRect");async function fkt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?20:i,o=e.look==="neo"?12:i,{shapeSvg:s,bbox:l}=await gn(t,e,an(e)),u=l.height+(e.look==="neo"?o*2:o),h=l.width+u/4+(e.look==="neo"?a*2:a),d=u/2,{cssStyles:f}=e,p=Er.svg(s),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},...r$(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},...r$(h/2-d,0,d,50,270,450)],v=Ei(m),y=p.path(v,g),b=s.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),Br(e,b),e.intersect=function(x){return Sr.polygon(e,m,x)},s}O(fkt,"stadium");async function pkt(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return OR(t,e,r)}O(pkt,"state");function gkt(t,e,{config:{themeVariables:r}}){var b,x;const{labelStyles:n,nodeStyles:i}=Or(e);e.labelStyle=n;const{cssStyles:a}=e,{lineColor:o,stateBorder:s,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:o,strokeWidth:2}),g=s??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 Br(e,y),e.intersect=function(w){return Sr.circle(e,(e.width??0)/2,w)},h}O(gkt,"stateEnd");function mkt(t,e,{config:{themeVariables:r}}){var s,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 o;if(e.look==="handDrawn"){const h=Er.svg(a).circle(0,0,e.width,ehn(n));o=a.insert(()=>h),o.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14)}else o=a.insert("circle",":first-child"),o.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=(s=t.node())==null?void 0:s.ownerSVGElement)==null?void 0:l.id)??"",h=u?`${u}-drop-shadow-small`:"drop-shadow-small";o.attr("style",`filter:url(#${h})`)}return Br(e,o),e.intersect=function(u){return Sr.circle(e,(e.width??7)/2,u)},a}O(mkt,"stateStart");var kR=8;async function vkt(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,o=e.look==="neo"?12:i,{shapeSvg:s,bbox:l}=await gn(t,e,an(e)),u=((e==null?void 0:e.width)??l.width)+2*kR+a,h=((e==null?void 0:e.height)??l.height)+o,d=u-2*kR,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(s),y=_r(e,{}),b=v.rectangle(p,g,d+16,f,y),x=v.line(p+kR,g,p+kR,g+f,y),w=v.line(p+kR+d,g,p+kR+d,g+f,y);s.insert(()=>x,":first-child"),s.insert(()=>w,":first-child");const A=s.insert(()=>b,":first-child"),{cssStyles:S}=e;A.attr("class","basic label-container").attr("style",Fl(S)),Br(e,A)}else{const v=l1(s,d,f,m);n&&v.attr("style",n),Br(e,v)}return e.intersect=function(v){return Sr.polygon(e,m,v)},s}O(vkt,"subroutine");var Jxe=.2;async function ykt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,o=e.look==="neo"?12:i;(e.width||e.height)&&(e.height=Math.max(((e==null?void 0:e.height)??0)-o*2,10),e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-Jxe*(e.height+o*2),10));const{shapeSvg:s,bbox:l}=await gn(t,e,an(e)),u=(e!=null&&e.height?e==null?void 0:e.height:l.height)+o*2,h=Jxe*u,d=Jxe*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(s),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=Ei(w),T=b.path(S,x),C=Ei(A),k=b.path(C,{...x,fillStyle:"solid"}),E=s.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),Br(e,E),e.intersect=function(_){return Sr.polygon(e,w,_)},s}O(ykt,"taggedRect");async function bkt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:o}=await gn(t,e,an(e)),s=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*s,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:-s/2-s/2*.1,y:f/2},...w2(-s/2-s/2*.1,f/2,s/2+s/2*.1,f/2,u,.8),{x:s/2+s/2*.1,y:-f/2},{x:-s/2-s/2*.1,y:-f/2}],y=-s/2+s/2*.1,b=-f/2-d*.4,x=[{x:y+s-h,y:(b+l)*1.3},{x:y+s,y:b+l-d},{x:y+s,y:(b+l)*.9},...w2(y+s,(b+l)*1.25,y+s-h,(b+l)*1.3,-l*.02,.5)],w=Ei(v),A=g.path(w,m),S=Ei(x),T=g.path(S,{...m,fillStyle:"solid"}),C=i.insert(()=>T,":first-child");return C.insert(()=>A,":first-child"),C.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(0,${-u/2})`),o.attr("transform",`translate(${-s/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-u/2-(a.y-(a.top??0))})`),Br(e,C),e.intersect=function(k){return Sr.polygon(e,v,k)},i}O(bkt,"taggedWaveEdgedRectangle");async function xkt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await gn(t,e,an(e)),o=Math.max(a.width+(e.padding??0),(e==null?void 0:e.width)||0),s=Math.max(a.height+(e.padding??0),(e==null?void 0:e.height)||0),l=-o/2,u=-s/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",o).attr("height",s),Br(e,h),e.intersect=function(d){return Sr.rect(e,d)},i}O(xkt,"text");var Tfn=O((t,e,r,n,i,a)=>`M${t},${e} +`);return NCt(n)}O(BCt,"preprocessMarkdown");function $Ct(t){return t.split(/\\n|\n|/gi).map(e=>{var r;return((r=e.trim().match(/<[^>]+>|[^\s<>]+/g))==null?void 0:r.map(n=>({content:n,type:"normal"})))??[]})}O($Ct,"nonMarkdownToLines");function FCt(t,e={}){const r=BCt(t,e),n=ia.lexer(r),i=[[]];let a=0;function o(s,l="normal"){s.type==="text"?s.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})})}):s.type==="strong"||s.type==="em"?s.tokens.forEach(u=>{o(u,s.type)}):s.type==="html"&&i[a].push({content:s.text,type:"normal"})}return O(o,"processNode"),n.forEach(s=>{var l;s.type==="paragraph"?(l=s.tokens)==null||l.forEach(u=>{o(u)}):s.type==="html"?i[a].push({content:s.text,type:"normal"}):i[a].push({content:s.raw,type:"normal"})}),i}O(FCt,"markdownToLines");function zCt(t){return t?`

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

`:""}O(zCt,"nonMarkdownToHTML");function UCt(t,{markdownAutoWrap:e}={}){const r=ia.lexer(t);function n(i){var a,o,s;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"?`${(o=i.tokens)==null?void 0:o.map(n).join("")}`:i.type==="paragraph"?`

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

`:i.type==="space"?"":i.type==="html"?`${i.text}`:i.type==="escape"?i.text:(ye.warn(`Unsupported markdown: ${i.type}`),i.raw)}return O(n,"output"),r.map(n).join("")}O(UCt,"markdownToHTML");function VCt(t){return Intl.Segmenter?[...new Intl.Segmenter().segment(t)].map(e=>e.segment):[...t]}O(VCt,"splitTextToChars");function QCt(t,e){const r=VCt(e.content);return Pxe(t,[],r,e.type)}O(QCt,"splitWordToFitWidth");function Pxe(t,e,r,n){if(r.length===0)return[{content:e.join(""),type:n},{content:"",type:n}];const[i,...a]=r,o=[...e,i];return t([{content:o.join(""),type:n}])?Pxe(t,o,a,n):(e.length===0&&i&&(e.push(i),r.shift()),[{content:e.join(""),type:n},{content:r.join(""),type:n}])}O(Pxe,"splitWordToFitWidthRecursion");function GCt(t,e){if(t.some(({content:r})=>r.includes(` +`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return FX(t,e)}O(GCt,"splitLineToFitWidth");function FX(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"},o=[...n];if(i!==""&&o.push({content:i,type:"normal"}),o.push(a),e(o))return FX(t,e,r,o);if(n.length>0)r.push(n),t.unshift(a);else if(a.content){const[s,l]=QCt(e,a);r.push([s]),l.content&&t.unshift(l)}return FX(t,e,r)}O(FX,"splitLineToFitWidthRecursion");function Nxe(t,e){e&&t.attr("style",e)}O(Nxe,"applyStyle");var HCt=16384;async function WCt(t,e,r,n,i=!1,a=Dr()){const o=t.append("foreignObject");o.attr("width",`${Math.min(10*r,HCt)}px`),o.attr("height",`${Math.min(10*r,HCt)}px`);const s=o.append("xhtml:div"),l=ps(e.label)?await Oj(e.label.replace(Xt.lineBreakRegex,` +`),a):li(e.label,a),u=e.isNode?"nodeLabel":"edgeLabel",h=s.append("span");h.html(l),Nxe(h,e.labelStyle),h.attr("class",`${u} ${n}`),Nxe(s,e.labelStyle),s.style("display","table-cell"),s.style("white-space","nowrap"),s.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(s.style("max-width",r+"px"),s.style("text-align","center")),s.attr("xmlns","http://www.w3.org/1999/xhtml"),i&&s.attr("class","labelBkg");let d=s.node().getBoundingClientRect();return d.width===r&&(s.style("display","table"),s.style("white-space","break-spaces"),s.style("width",r+"px"),d=s.node().getBoundingClientRect()),o.node()}O(WCt,"addHtmlSpan");function zX(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}O(zX,"createTspan");function YCt(t,e,r){const n=t.append("text"),i=zX(n,1,e);UX(i,r);const a=i.node().getComputedTextLength();return n.remove(),a}O(YCt,"computeWidthOfText");function qCt(t,e,r){var o;const n=t.append("text"),i=zX(n,1,e);UX(i,[{content:r,type:"normal"}]);const a=(o=i.node())==null?void 0:o.getBoundingClientRect();return a&&n.remove(),a}O(qCt,"computeDimensionOfText");function jCt(t,e,r,n=!1,i=!1){const o=e.append("g"),s=o.insert("rect").attr("class","background").attr("style","stroke: none"),l=o.append("text").attr("y","-10.1");i&&l.attr("text-anchor","middle");let u=0;for(const h of r){const d=O(p=>YCt(o,1.1,p)<=t,"checkWidth"),f=d(h)?[h]:GCt(h,d);for(const p of f){const g=zX(l,u,1.1,i);UX(g,p),u++}}if(n){const h=l.node().getBBox(),d=2;return s.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),o.node()}else return l.node()}O(jCt,"createFormattedText");function Bxe(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}})}O(Bxe,"decodeHTMLEntities");function UX(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(Bxe(r.content)):i.text(" "+Bxe(r.content))})}O(UX,"updateTextContentAndStyles");async function XCt(t,e={}){const r=[];t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(i,a,o)=>(r.push((async()=>{const s=`${a}:${o}`;return await adn(s)?await s1(s,void 0,{class:"label-icon"}):``})()),i));const n=await Promise.all(r);return t.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>n.shift()??"")}O(XCt,"replaceIconSubstring");var su=O(async(t,e="",{style:r="",isTitle:n=!1,classes:i="",useHtmlLabels:a=!0,markdown:o=!0,isNode:s=!0,width:l=200,addSvgBackground:u=!1}={},h)=>{if(ye.debug("XYZ createText",e,r,n,i,a,s,"addSvgBackground: ",u),a){const d=o?UCt(e,h):zCt(e),f=await XCt(o1(d),h),p=e.replace(/\\\\/g,"\\"),g={isNode:s,label:ps(e)?p:f,labelStyle:r.replace("fill:","color:")};return await WCt(t,g,l,i,u,h)}else{const d=o1(e.replace(//g,"
")),f=o?FCt(d.replace("
","
"),h):$Ct(d),p=jCt(l,t,f,e?u:!1,!s);if(s){/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:");_t(p).attr("style",g)}else{const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");_t(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:");_t(p).select("text").attr("style",m)}return n?_t(p).selectAll("tspan.text-outer-tspan").classed("title-row",!0):_t(p).selectAll("tspan.text-outer-tspan").classed("row",!0),p}},"createText");function $xe(t,e,r){if(t&&t.length){const[n,i]=e,a=Math.PI/180*r,o=Math.cos(a),s=Math.sin(a);for(const l of t){const[u,h]=l;l[0]=(u-n)*o-(h-i)*s+n,l[1]=(u-n)*s+(h-i)*o+i}}}function Qdn(t,e){return t[0]===e[0]&&t[1]===e[1]}function Gdn(t,e,r,n=1){const i=r,a=Math.max(e,.1),o=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,s=[0,0];if(i)for(const u of o)$xe(u,s,i);const l=function(u,h,d){const f=[];for(const b of u){const x=[...b];Qdn(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}(o,a,n);if(i){for(const u of o)$xe(u,s,-i);(function(u,h,d){const f=[];u.forEach(p=>f.push(...p)),$xe(f,h,d)})(l,s,-i)}return l}function J7(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),Gdn(t,i,n,a||1)}class Fxe{constructor(e){this.helper=e}fillPolygons(e,r){return this._fillPolygons(e,r)}_fillPolygons(e,r){const n=J7(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 VX(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 Hdn extends Fxe{fillPolygons(e,r){let n=r.hachureGap;n<0&&(n=4*r.strokeWidth),n=Math.max(n,.1);const i=J7(e,Object.assign({},r,{hachureGap:n})),a=Math.PI/180*r.hachureAngle,o=[],s=.5*n*Math.cos(a),l=.5*n*Math.sin(a);for(const[u,h]of i)VX([u,h])&&o.push([[u[0]-s,u[1]+l],[...h]],[[u[0]+s,u[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(o,r)}}}class Wdn extends Fxe{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 Ydn=class{constructor(e){this.helper=e}fillPolygons(e,r){const n=J7(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 o=i/4;for(const s of e){const l=VX(s),u=l/i,h=Math.ceil(u)-1,d=l-h*i,f=(s[0][0]+s[1][0])/2-i/4,p=Math.min(s[0][1],s[1][1]);for(let g=0;g{const s=VX(o),l=Math.floor(s/(n+i)),u=(s+i-l*(n+i))/2;let h=o[0],d=o[1];h[0]>d[0]&&(h=o[1],d=o[0]);const f=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let p=0;p{const o=VX(a),s=Math.round(o/(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:[...s]}),e=s[2],r=s[3];break;case"q":{const l=s.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:[...s]}),e=s[5],r=s[6];break;case"a":e+=s[5],r+=s[6],a.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],e,r]});break;case"H":a.push({key:"H",data:[...s]}),e=s[0];break;case"h":e+=s[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...s]}),r=s[0];break;case"v":r+=s[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...s]}),e=s[2],r=s[3];break;case"s":{const l=s.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:[...s]}),e=s[0],r=s[1];break;case"t":e+=s[0],r+=s[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 JCt(t){const e=[];let r="",n=0,i=0,a=0,o=0,s=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,o]=h;break;case"C":e.push({key:"C",data:[...h]}),n=h[4],i=h[5],s=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-s),f=i+(i-l)):(d=n,f=i),e.push({key:"C",data:[d,f,...h]}),s=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-s),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]}),s=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]}),s=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)&&(eOt(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=o}r=u}return e}function e$(t,e,r){return[t*Math.cos(r)-e*Math.sin(r),t*Math.sin(r)+e*Math.cos(r)]}function eOt(t,e,r,n,i,a,o,s,l,u){const h=(d=o,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]=e$(t,e,-h),[r,n]=e$(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,I=a*a,N=M*I-M*R*R-I*L*L,F=M*R*R+I*L*L,B=(s===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=eOt(r=m+i*Math.cos(g),n=v+a*Math.sin(g),R,D,i,a,o,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,C=4/3*a*S,k=[t,e],E=[t+T*x,e-C*b],_=[r+T*A,n-C*w],P=[r,n];if(E[0]=2*k[0]-E[0],E[1]=2*k[1]-E[1],u)return[E,_,P].concat(f);{f=[E,_,P].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=cOt(v,u,h,d,f,p,g,1,l);if(!l.disableMultiStroke){const b=cOt(v,u,h,d,f,p,g,1.5,l);y.push(...b)}return o&&(s?y.push(...x2(u,h,u+d*Math.cos(p),h+f*Math.sin(p),l),...x2(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 aOt(t,e){const r=JCt(ZCt(Vxe(t))),n=[];let i=[0,0],a=[0,0];for(const{key:o,data:s}of r)switch(o){case"M":a=[s[0],s[1]],i=[s[0],s[1]];break;case"L":n.push(...x2(a[0],a[1],s[0],s[1],e)),a=[s[0],s[1]];break;case"C":{const[l,u,h,d,f,p]=s;n.push(...efn(l,u,h,d,f,p,a,e)),a=[f,p];break}case"Z":n.push(...x2(a[0],a[1],i[0],i[1],e)),a=[i[0],i[1]]}return{type:"path",ops:n}}function Gxe(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]+wn(i,e),n[0][1]+wn(i,e)]});for(let o=1;o500?.4:-.0016668*l+1.233334;let h=i.maxRandomnessOffset||0;h*h*100>s&&(h=l/10);const d=h/2,f=.2+.2*sOt(i);let p=i.bowing*i.maxRandomnessOffset*(n-e)/200,g=i.bowing*i.maxRandomnessOffset*(t-r)/200;p=wn(p,i,u),g=wn(g,i,u);const m=[],v=()=>wn(d,i,u),y=()=>wn(h,i,u),b=i.preserveVertices;return o?m.push({op:"move",data:[t+(b?0:v()),e+(b?0:v())]}):m.push({op:"move",data:[t+(b?0:wn(h,i,u)),e+(b?0:wn(h,i,u))]}),o?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 WX(t,e,r){if(!t.length)return[];const n=[];n.push([t[0][0]+wn(e,r),t[0][1]+wn(e,r)]),n.push([t[0][0]+wn(e,r),t[0][1]+wn(e,r)]);for(let i=1;i3){const a=[],o=1-r.curveTightness;i.push({op:"move",data:[t[1][0],t[1][1]]});for(let s=1;s+21&&i.push(s)):i.push(s),i.push(t[e+3])}else{const l=t[e+0],u=t[e+1],h=t[e+2],d=t[e+3],f=tC(l,u,.5),p=tC(u,h,.5),g=tC(h,d,.5),m=tC(f,p,.5),v=tC(p,g,.5),y=tC(m,v,.5);Wxe([l,f,m,y],0,r,i),Wxe([y,v,g,d],0,r,i)}var a,o;return i}function rfn(t,e){return jX(t,0,t.length,e)}function jX(t,e,r,n,i){const a=i||[],o=t[e],s=t[r-1];let l=0,u=1;for(let h=e+1;hl&&(l=d,u=h)}return Math.sqrt(l)>n?(jX(t,e,u+1,n,a),jX(t,u,r,n,a)):(a.length||a.push(o),a.push(s)),a}function Yxe(t,e=.15,r){const n=[],i=(t.length-1)/3;for(let a=0;a0?jX(n,0,n.length,r):n}const Xd="none";class XX{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 o=this._o(a);return this._d("line",[tOt(e,r,n,i,o)],o)}rectangle(e,r,n,i,a){const o=this._o(a),s=[],l=Jdn(e,r,n,i,o);if(o.fill){const u=[[e,r],[e+n,r],[e+n,r+i],[e,r+i]];o.fillStyle==="solid"?s.push(Gxe([u],o)):s.push(CR([u],o))}return o.stroke!==Xd&&s.push(l),this._d("rectangle",s,o)}ellipse(e,r,n,i,a){const o=this._o(a),s=[],l=nOt(n,i,o),u=Qxe(e,r,o,l);if(o.fill)if(o.fillStyle==="solid"){const h=Qxe(e,r,o,l).opset;h.type="fillPath",s.push(h)}else s.push(CR([u.estimatedPoints],o));return o.stroke!==Xd&&s.push(u.opset),this._d("ellipse",s,o)}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",[GX(e,!1,n)],n)}arc(e,r,n,i,a,o,s=!1,l){const u=this._o(l),h=[],d=iOt(e,r,n,i,a,o,s,!0,u);if(s&&u.fill)if(u.fillStyle==="solid"){const f=Object.assign({},u);f.disableMultiStroke=!0;const p=iOt(e,r,n,i,a,o,!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+=wn(.01*A,b),S+=wn(.01*S,b);let T=v,C=y;for(;T<0;)T+=2*Math.PI,C+=2*Math.PI;C-T>2*Math.PI&&(T=0,C=2*Math.PI);const k=(C-T)/b.curveStepCount,E=[];for(let _=T;_<=C;_+=k)E.push([x+A*Math.cos(_),w+S*Math.sin(_)]);return E.push([x+A*Math.cos(C),w+S*Math.sin(C)]),E.push([x,w]),CR([E],b)}(e,r,n,i,a,o,u));return u.stroke!==Xd&&h.push(d),this._d("arc",h,u)}curve(e,r){const n=this._o(r),i=[],a=rOt(e,n);if(n.fill&&n.fill!==Xd)if(n.fillStyle==="solid"){const o=rOt(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));i.push({type:"fillPath",ops:this._mergedShape(o.ops)})}else{const o=[],s=e;if(s.length){const l=typeof s[0][0]=="number"?[s]:s;for(const u of l)u.length<3?o.push(...u):u.length===3?o.push(...Yxe(uOt([u[0],u[0],u[1],u[2]]),10,(1+n.roughness)/2)):o.push(...Yxe(uOt(u),10,(1+n.roughness)/2))}o.length&&i.push(CR([o],n))}return n.stroke!==Xd&&i.push(a),this._d("curve",i,n)}polygon(e,r){const n=this._o(r),i=[],a=GX(e,!0,n);return n.fill&&(n.fillStyle==="solid"?i.push(Gxe([e],n)):i.push(CR([e],n))),n.stroke!==Xd&&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!==Xd,o=n.stroke!==Xd,s=!!(n.simplification&&n.simplification<1),l=function(h,d,f){const p=JCt(ZCt(Vxe(h))),g=[];let m=[],v=[0,0],y=[];const b=()=>{y.length>=4&&m.push(...Yxe(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=rfn(A,f);S.length&&w.push(S)}return w}(e,1,s?4-4*(n.simplification||1):(1+n.roughness)/2),u=aOt(e,n);if(a)if(n.fillStyle==="solid")if(l.length===1){const h=aOt(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(Gxe(l,n));else i.push(CR(l,n));return o&&(s?l.forEach(h=>{i.push(GX(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(o=>+o.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 o=null;switch(a.type){case"path":o={d:this.opsToPath(a),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Xd};break;case"fillPath":o={d:this.opsToPath(a),stroke:Xd,strokeWidth:0,fill:n.fill||Xd};break;case"fillSketch":o=this.fillSketch(a,n)}o&&i.push(o)}return i}fillSketch(e,r){let n=r.fillWeight;return n<0&&(n=r.strokeWidth/2),{d:this.opsToPath(e),stroke:r.fill||Xd,strokeWidth:n,fill:Xd}}_mergedShape(e){return e.filter((r,n)=>n===0||r.op!=="move")}}class nfn{constructor(e,r){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new XX(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.ctx,a=e.options.fixedDecimalPlaceDigits;for(const o of r)switch(o.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,o,a),i.restore();break;case"fillPath":{i.save(),i.fillStyle=n.fill||"";const s=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(i,o,a,s),i.restore();break}case"fillSketch":this.fillSketch(i,o,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 o=typeof n=="number"&&n>=0?a.data.map(s=>+s.toFixed(n)):a.data;switch(a.op){case"move":e.moveTo(o[0],o[1]);break;case"bcurveTo":e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"lineTo":e.lineTo(o[0],o[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 o=this.gen.line(e,r,n,i,a);return this.draw(o),o}rectangle(e,r,n,i,a){const o=this.gen.rectangle(e,r,n,i,a);return this.draw(o),o}ellipse(e,r,n,i,a){const o=this.gen.ellipse(e,r,n,i,a);return this.draw(o),o}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,o,s=!1,l){const u=this.gen.arc(e,r,n,i,a,o,s,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 KX="http://www.w3.org/2000/svg";class ifn{constructor(e,r){this.svg=e,this.gen=new XX(r)}draw(e){const r=e.sets||[],n=e.options||this.getDefaultOptions(),i=this.svg.ownerDocument||window.document,a=i.createElementNS(KX,"g"),o=e.options.fixedDecimalPlaceDigits;for(const s of r){let l=null;switch(s.type){case"path":l=i.createElementNS(KX,"path"),l.setAttribute("d",this.opsToPath(s,o)),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(KX,"path"),l.setAttribute("d",this.opsToPath(s,o)),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,s,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(KX,"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 o=this.gen.line(e,r,n,i,a);return this.draw(o)}rectangle(e,r,n,i,a){const o=this.gen.rectangle(e,r,n,i,a);return this.draw(o)}ellipse(e,r,n,i,a){const o=this.gen.ellipse(e,r,n,i,a);return this.draw(o)}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,o,s=!1,l){const u=this.gen.arc(e,r,n,i,a,o,s,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 nfn(t,e),svg:(t,e)=>new ifn(t,e),generator:t=>new XX(t),newSeed:()=>XX.newSeed()},gn=O(async(t,e,r)=>{var p,g;let n;const i=e.useHtmlLabels||p0((p=Ye())==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),o=a.insert("g").attr("class","label").attr("style",Fl(e.labelStyle));let s;e.label===void 0?s="":s=typeof e.label=="string"?e.label:e.label[0];const l=!!e.icon||!!e.img,u=e.labelType==="markdown",h=await su(o,li(o1(s),Ye()),{useHtmlLabels:i,width:e.width||((g=Ye().flowchart)==null?void 0:g.wrappingWidth),classes:u?"markdown-node-label":"",style:e.labelStyle,addSvgBackground:l,markdown:u},Ye());let d=h.getBBox();const f=((e==null?void 0:e.padding)??0)/2;if(i){const m=h.children[0],v=_t(h);await wxe(m,s),d=m.getBoundingClientRect(),v.attr("width",d.width),v.attr("height",d.height)}return i?o.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"):o.attr("transform","translate(0, "+-d.height/2+")"),e.centerLabel&&o.attr("transform","translate("+-d.width/2+", "+-d.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:a,bbox:d,halfPadding:f,label:o}},"labelHelper"),qxe=O(async(t,e,r)=>{var l,u;const n=r.useHtmlLabels??na(Ye()),i=t.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await su(i,li(o1(e),Ye()),{useHtmlLabels:n,width:r.width||((u=(l=Ye())==null?void 0:l.flowchart)==null?void 0:u.wrappingWidth),style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img});let o=a.getBBox();const s=r.padding/2;if(na(Ye())){const h=a.children[0],d=_t(a);o=h.getBoundingClientRect(),d.attr("width",o.width),d.attr("height",o.height)}return n?i.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"):i.attr("transform","translate(0, "+-o.height/2+")"),r.centerLabel&&i.attr("transform","translate("+-o.width/2+", "+-o.height/2+")"),i.insert("rect",":first-child"),{shapeSvg:t,bbox:o,halfPadding:s,label:i}},"insertLabel"),Br=O((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds"),an=O((t,e)=>(t.look==="handDrawn"?"rough-node":"node")+" "+t.cssClasses+" "+(e||""),"getNodeClasses");function Ei(t){const e=t.map((r,n)=>`${n===0?"M":"L"}${r.x},${r.y}`);return e.push("Z"),e.join(" ")}O(Ei,"createPathFromPoints");function w2(t,e,r,n,i,a){const o=[],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));o.push({x:m,y:v})}return o}O(w2,"generateFullSineWavePoints");function r$(t,e,r,n,i,a){const o=[],s=i*Math.PI/180,h=(a*Math.PI/180-s)/(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"),o=O((l,u)=>(l==null?void 0:l.getAttribute(u))??void 0,"getAttr");if(i){const l={fill:o(i,"fill"),"fill-opacity":o(i,"fill-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}if(a){const l={stroke:o(a,"stroke"),"stroke-width":o(a,"stroke-width")??"1","stroke-opacity":o(a,"stroke-opacity")??"1"};Object.entries(l).forEach(([u,h])=>{h&&r.setAttribute(u,h)})}const s=document.createElementNS("http://www.w3.org/2000/svg","g");return s.appendChild(r),s}O(jxe,"mergePaths");var afn=O((t,e)=>{var r=t.x,n=t.y,i=e.x-r,a=e.y-n,o=t.width/2,s=t.height/2,l,u;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),l=a===0?0:s*i/a,u=s):(i<0&&(o=-o),l=o,u=i===0?0:o*a/i),{x:r+l,y:n+u}},"intersectRect"),rC=afn,ofn=O(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const o=Ye(),s=na(o);return await su(t,a,{style:r,isTitle:n,useHtmlLabels:s,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},o)},"createLabel"),A2=ofn,S2=O((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"),sfn=O(async(t,e)=>{const r=Ye(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:o}=n,s=o,{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=p0(r.flowchart.htmlLabels),g=e.direction==="LR",m=f.insert("g").attr("class","cluster-label swimlane-label"),v=await su(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=_t(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,C=e.swimlaneContentTop!==void 0?e.swimlaneContentTop:A+w/3,k=g?4:0,E=y.height+2*k;let _,P;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:s,fillWeight:3,seed:i}),B=_r(e,{roughness:.7,fill:"none",stroke:s,seed:i}),V=N.rectangle(T,A,L,w,F);_=f.insert(()=>V,":first-child");const z=N.rectangle(R,A,D,w,B);P=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"),P=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",s),P.attr("class","swimlane-body").attr("style",u).attr("x",R).attr("y",A).attr("width",D).attr("height",w).attr("fill","none").attr("stroke",s);const M=T+L/2,I=e.y;m.attr("transform",`translate(${M}, ${I}) rotate(-90) translate(${-y.width/2}, ${-y.height/2})`)}else{const L=Math.max(0,C-A),R=Math.min(E,L),D=A+R,M=Math.max(0,S-D),I=e.x-x/2;if(e.look==="handDrawn"){const B=Er.svg(f),V=_r(e,{roughness:.7,fill:a,stroke:s,fillWeight:3,seed:i}),z=_r(e,{roughness:.7,fill:"none",stroke:s,seed:i}),U=B.rectangle(I,A,x,R,V);_=f.insert(()=>U,":first-child");const Q=B.rectangle(I,D,x,M,z);P=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"),P=f.insert("rect",":first-child"),_.attr("class","swimlane-title").attr("style",u).attr("x",I).attr("y",A).attr("width",x).attr("height",R).attr("fill",a).attr("stroke",s),P.attr("class","swimlane-body").attr("style",u).attr("x",I).attr("y",D).attr("width",x).attr("height",M).attr("fill","none").attr("stroke",s);const N=e.x-y.width/2,F=A+(R-y.height)/2;m.attr("transform",`translate(${N}, ${F})`)}if(ye.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 rC(e,L)},{cluster:f,labelBBox:y}},"swimlane"),hOt=O(async(t,e)=>{ye.info("Creating subgraph rect for ",e.id,e);const r=Ye(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:o}=n,{labelStyles:s,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=na(r),p=d.insert("g").attr("class","cluster-label ");let g;e.labelType==="markdown"?g=await su(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width}):g=await A2(p,e.label,e.labelStyle||"",!1,!0);let m=g.getBBox();if(na(r)){const T=g.children[0],C=_t(g);m=T.getBoundingClientRect(),C.attr("width",m.width),C.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;ye.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const T=Er.svg(d),C=_r(e,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),k=T.path(S2(b,x,v,y,0),C);w=d.insert(()=>(ye.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}=TR(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+A})`),s){const T=p.select("span");T&&T.attr("style",s)}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 rC(e,T)},{cluster:d,labelBBox:m}},"rect"),lfn=O((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 o=n.node().getBBox();return e.width=o.width,e.height=o.height,e.intersect=function(s){return rC(e,s)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),cfn=O(async(t,e)=>{const r=Ye(),{themeVariables:n,handDrawnSeed:i}=r,{altBackground:a,compositeBackground:o,compositeTitleBackground:s,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 A2(d,e.label,e.labelStyle,void 0,!0);let g=p.getBBox();if(na(r)){const k=p.children[0],E=_t(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(S2(w,A,y,b,10),{roughness:.7,fill:s,fillStyle:"solid",stroke:l,seed:i}):E.rectangle(w,A,y,b,{seed:i});T=u.insert(()=>_,":first-child");const P=E.rectangle(w,S,y,x,{fill:k?a:o,fillStyle:k?"hachure":"solid",stroke:l,seed:i});T=u.insert(()=>_,":first-child"),f=u.insert(()=>P)}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-(na(r)?0:3)})`);const C=T.node().getBBox();return e.height=C.height,e.offsetX=0,e.offsetY=g.height-e.padding/2,e.labelBBox=g,e.intersect=function(k){return rC(e,k)},{cluster:u,labelBBox:g}},"roundedWithTitle"),ufn=O(async(t,e)=>{ye.info("Creating subgraph rect for ",e.id,e);const r=Ye(),{themeVariables:n,handDrawnSeed:i}=r,{clusterBkg:a,clusterBorder:o}=n,{labelStyles:s,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=na(r),p=d.insert("g").attr("class","cluster-label "),g=await su(p,e.label,{style:e.labelStyle,useHtmlLabels:f,isNode:!0,width:e.width});let m=g.getBBox();if(na(r)){const T=g.children[0],C=_t(g);m=T.getBoundingClientRect(),C.attr("width",m.width),C.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;ye.trace("Data ",e,JSON.stringify(e));let w;if(e.look==="handDrawn"){const T=Er.svg(d),C=_r(e,{roughness:.7,fill:a,stroke:o,fillWeight:4,seed:i}),k=T.path(S2(b,x,v,y,e.rx),C);w=d.insert(()=>(ye.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}=TR(r);if(p.attr("transform",`translate(${e.x-m.width/2}, ${e.y-e.height/2+A})`),s){const T=p.select("span");T&&T.attr("style",s)}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 rC(e,T)},{cluster:d,labelBBox:m}},"kanbanSection"),hfn=O((t,e)=>{const r=Ye(),{themeVariables:n,handDrawnSeed:i}=r,{nodeBorder:a}=n,o=t.insert("g").attr("class",e.cssClasses).attr("id",e.domId).attr("data-look",e.look),s=o.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(o).rectangle(d,f,u,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:a,seed:i});p=o.insert(()=>v,":first-child")}else{p=s.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 rC(e,m)},{cluster:o,labelBBox:{}}},"divider"),dfn=hOt,ffn={rect:hOt,squareRect:dfn,roundedWithTitle:cfn,noteGroup:lfn,divider:hfn,kanbanSection:ufn,swimlane:sfn},dOt=new Map,ZX=O(async(t,e)=>{const r=e.shape||"rect",n=await ffn[r](t,e);return dOt.set(e.id,n),n},"insertCluster"),fOt=O(()=>{dOt=new Map},"clear");function pOt(t,e){return t.intersect(e)}O(pOt,"intersectNode");var pfn=pOt;function gOt(t,e,r,n){var i=t.x,a=t.y,o=i-n.x,s=a-n.y,l=Math.sqrt(e*e*s*s+r*r*o*o),u=Math.abs(e*r*o/l);n.x0}O(Xxe,"sameSign");var mfn=yOt;function bOt(t,e,r){let n=t.x,i=t.y,a=[],o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(h){o=Math.min(o,h.x),s=Math.min(s,h.y)}):(o=Math.min(o,e.x),s=Math.min(s,e.y));let l=n-t.width/2-o,u=i-t.height/2-s;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",Fl(s)),Br(e,d),e.intersect=function(f){return ye.info("Circle intersect",e,o,f),Sr.circle(e,o,f)},a}O(xOt,"anchor");function Kxe(t,e,r,n,i,a,o){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)*(o?-1:1),b=u-v*i*Math.cos(h)*(o?-1:1),x=Math.atan2((e-b)/a,(t-y)/i);let A=Math.atan2((n-b)/a,(r-y)/i)-x;o&&A<0&&(A+=2*Math.PI),!o&&A>0&&(A-=2*Math.PI);const S=[];for(let T=0;T<20;T++){const C=T/19,k=x+C*A,E=y+i*Math.cos(k),_=b+a*Math.sin(k);S.push({x:E,y:_})}return S}O(Kxe,"generateArcPoints");function wOt(t,e,r){const[n,i]=[e,r].sort((a,o)=>o-a);return i*(1-Math.sqrt(1-(t/n/2)**2))}O(wOt,"calculateArcSagitta");async function AOt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,o=e.look==="neo"?12:i,s=O(k=>k+o,"calcTotalHeight"),l=O(k=>{const E=k/2;return[E/(2.5+k/50),E]},"calcEllipseRadius"),{shapeSvg:u,bbox:h}=await gn(t,e,an(e)),d=s(e!=null&&e.height?e==null?void 0:e.height:h.height),[f,p]=l(d),g=wOt(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},...Kxe(-v/2,-y/2,-v/2,y/2,f,p,!1),{x:v/2,y:y/2},...Kxe(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=Ei(x),T=w.path(S,A),C=u.insert(()=>T,":first-child");return C.attr("class","basic label-container outer-path"),b&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",b),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(${f/2}, 0)`),Br(e,C),e.intersect=function(k){return Sr.polygon(e,x,k)},u}O(AOt,"bowTieRect");function l1(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+")")}O(l1,"insertPolygonShape");var JX=12;async function SOt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?28:i,o=e.look==="neo"?24:i,{shapeSvg:s,bbox:l}=await gn(t,e,an(e)),u=((e==null?void 0:e.width)??l.width)+(e.look==="neo"?a*2:a+JX),h=((e==null?void 0:e.height)??l.height)+(e.look==="neo"?o*2:o),d=0,f=u,p=-h,g=0,m=[{x:d+JX,y:p},{x:f,y:p},{x:f,y:g},{x:d,y:g},{x:d,y:p+JX},{x:d+JX,y:p}];let v;const{cssStyles:y}=e;if(e.look==="handDrawn"){const b=Er.svg(s),x=_r(e,{}),w=Ei(m),A=b.path(w,x);v=s.insert(()=>A,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),y&&v.attr("style",y)}else v=l1(s,u,h,m);return n&&v.attr("style",n),Br(e,v),e.intersect=function(b){return Sr.polygon(e,m,b)},s}O(SOt,"card");function TOt(t,e){const{nodeStyles:r}=Or(e);e.label="";const n=t.insert("g").attr("class",an(e)).attr("id",e.domId??e.id),{cssStyles:i}=e,a=Math.max(28,e.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=Er.svg(n),l=_r(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=Ei(o),h=s.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,o,f)},n}O(TOt,"choice");async function Zxe(t,e,r){const{labelStyles:n,nodeStyles:i}=Or(e);e.labelStyle=n;const{shapeSvg:a,bbox:o,halfPadding:s}=await gn(t,e,an(e)),l=16,u=(r==null?void 0:r.padding)??s,h=e.look==="neo"?o.width/2+l*2:o.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",Fl(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 Br(e,d),e.calcIntersect=function(p,g){const m=p.width/2;return Sr.circle(p,m,g)},e.intersect=function(p){return ye.info("Circle intersect",e,h,p),Sr.circle(e,h,p)},a}O(Zxe,"circle");function COt(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},o={x:-(n/2)*e,y:-(n/2)*r},s={x:n/2*e,y:-(n/2)*r};return`M ${a.x},${a.y} L ${s.x},${s.y} + M ${i.x},${i.y} L ${o.x},${o.y}`}O(COt,"createLine");function OOt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r,e.label="";const i=t.insert("g").attr("class",an(e)).attr("id",e.domId??e.id),a=Math.max(30,(e==null?void 0:e.width)??0),{cssStyles:o}=e,s=Er.svg(i),l=_r(e,{});e.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const u=s.circle(0,0,a*2,l),h=COt(a),d=s.path(h,l),f=i.insert(()=>u,":first-child");return f.insert(()=>d),f.attr("class","outer-path"),o&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",o),n&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",n),Br(e,f),e.intersect=function(p){return ye.info("crossedCircle intersect",e,{radius:a,point:p}),Sr.circle(e,a,p)},i}O(OOt,"crossedCircle");function c1(t,e,r,n=100,i=0,a=180){const o=[],s=i*Math.PI/180,h=(a*Math.PI/180-s)/(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)`),o.attr("transform",`translate(${-u/2+d-(a.x-(a.left??0))},${-h/2+(e.padding??0)/2-(a.y-(a.top??0))})`),Br(e,S),e.intersect=function(T){return Sr.polygon(e,g,T)},i}O(kOt,"curlyBraceLeft");function u1(t,e,r,n=100,i=0,a=180){const o=[],s=i*Math.PI/180,h=(a*Math.PI/180-s)/(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)`),o.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))})`),Br(e,S),e.intersect=function(T){return Sr.polygon(e,g,T)},i}O(EOt,"curlyBraceRight");function bc(t,e,r,n=100,i=0,a=180){const o=[],s=i*Math.PI/180,h=(a*Math.PI/180-s)/(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)`),o.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))})`),Br(e,E),e.intersect=function(_){return Sr.polygon(e,m,_)},i}O(_Ot,"curlyBraces");async function ROt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,o=e.look==="neo"?12:i,s=20,l=5,{shapeSvg:u,bbox:h}=await gn(t,e,an(e)),d=Math.max(s,(h.width+a*2)*1.25,(e==null?void 0:e.width)??0),f=Math.max(l,h.height+o*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},...r$(-x,-b/2,p,50,270,90)],S=Ei(A),T=m.path(S,v),C=u.insert(()=>T,":first-child");return C.attr("class","basic label-container outer-path"),g&&e.look!=="handDrawn"&&C.selectChildren("path").attr("style",g),n&&e.look!=="handDrawn"&&C.selectChildren("path").attr("style",n),C.attr("transform",`translate(${-d/2}, ${-f/2})`),Br(e,C),e.intersect=function(k){return Sr.polygon(e,A,k)},u}O(ROt,"curvedTrapezoid");var yfn=O((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"),bfn=O((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"),xfn=O((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),DOt=8,LOt=8;async function MOt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?24:i,o=e.look==="neo"?24:i;if(e.width||e.height){const v=e.width??0;e.width=(e.width??0)-o,e.widthA,":first-child"),g=s.insert(()=>w,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const v=yfn(0,0,h,p,d,f);g=s.insert("path",":first-child").attr("d",v).attr("class","basic label-container outer-path").attr("style",Fl(m)).attr("style",n)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),Br(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},s}O(MOt,"cylinder");async function OR(t,e,r){const{labelStyles:n,nodeStyles:i}=Or(e);e.labelStyle=n;const{shapeSvg:a,bbox:o}=await gn(t,e,an(e)),s=Math.max(o.width+r.labelPaddingX*2,(e==null?void 0:e.width)||0),l=Math.max(o.height+r.labelPaddingY*2,(e==null?void 0:e.height)||0),u=-s/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(S2(u,h,s,l,f||0),v):m.rectangle(u,h,s,l,v);d=a.insert(()=>y,":first-child"),d.attr("class","basic label-container").attr("style",Fl(g))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",i).attr("rx",Fl(f)).attr("ry",Fl(p)).attr("x",u).attr("y",h).attr("width",s).attr("height",l);return Br(e,d),e.calcIntersect=function(m,v){return Sr.rect(m,v)},e.intersect=function(m){return Sr.rect(e,m)},a}O(OR,"drawRect");async function IOt(t,e){const{cssClasses:r,labelPaddingX:n,labelPaddingY:i,padding:a,width:o,height:s}=e,l={rx:0,ry:0,labelPaddingX:n??(a??0)*2,labelPaddingY:i??a??0},u=await OR(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"))||o)??0,f=(Number(h.attr("height"))||s)??0;return d>0&&f>0&&h.attr("stroke-dasharray",`${d} ${f}`),u}O(IOt,"datastore");async function POt(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:o,bbox:s,label:l}=await gn(t,e,an(e)),u=s.width+i,h=s.height+a,d=h*.2,f=-u/2,p=-h/2-d/2,{cssStyles:g}=e,m=Er.svg(o),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=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),l.attr("transform",`translate(${f+(e.padding??0)/2-(s.x-(s.left??0))}, ${p+d+(e.padding??0)/2-(s.y-(s.top??0))})`),Br(e,x),e.intersect=function(w){return Sr.rect(e,w)},o}O(POt,"dividedRectangle");async function NOt(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,o=e.look==="neo"?16:a,{shapeSvg:s,bbox:l}=await gn(t,e,an(e)),u=(e!=null&&e.width?(e==null?void 0:e.width)/2:l.width/2)+(o??0),h=u-i;let d;const{cssStyles:f}=e;if(e.look==="handDrawn"){const m=Er.svg(s),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=s.insert("g",":first-child"),d.attr("class",Fl(e.cssClasses)).attr("style",Fl(f)),(p=d.node())==null||p.appendChild(b),(g=d.node())==null||g.appendChild(x)}else{d=s.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 Br(e,d),e.intersect=function(m){return ye.info("DoubleCircle intersect",e,u,m),Sr.circle(e,u,m)},s}O(NOt,"doublecircle");function BOt(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Or(e);e.label="",e.labelStyle=n;const a=t.insert("g").attr("class",an(e)).attr("id",e.domId??e.id),o=7,{cssStyles:s}=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,o*2,h),f=a.insert(()=>d,":first-child");return f.selectAll("path").attr("style",`fill: ${u} !important;`),s&&s.length>0&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",s),i&&e.look!=="handDrawn"&&f.selectAll("path").attr("style",i),Br(e,f),e.intersect=function(p){return ye.info("filledCircle intersect",e,{radius:o,point:p}),Sr.circle(e,o,p)},a}O(BOt,"filledCircle");var $Ot=10,FOt=10;async function zOt(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.height<$Ot&&(e.height=$Ot),e.width=((e==null?void 0:e.width)??0)-a-a/2,e.widthy,":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,Br(e,b),l.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${-h/2+(e.padding??0)/2+(s.y-(s.top??0))})`),e.intersect=function(x){return ye.info("Triangle intersect",e,f,x),Sr.polygon(e,f,x)},o}O(zOt,"flippedTriangle");function UOt(t,e,{dir:r,config:{state:n,themeVariables:i}}){const{nodeStyles:a}=Or(e);e.label="";const o=t.insert("g").attr("class",an(e)).attr("id",e.domId??e.id),{cssStyles:s}=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(o),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=o.insert(()=>g,":first-child");s&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",s),a&&e.look!=="handDrawn"&&m.selectAll("path").attr("style",a),Br(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)},o}O(UOt,"forkJoin");async function VOt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=15,a=10,o=e.look==="neo"?16:e.padding??0,s=e.look==="neo"?12:e.padding??0;(e.width||e.height)&&(e.height=((e==null?void 0: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),Br(e,x),e.intersect=function(w){return ye.info("Pill intersect",e,{radius:f,point:w}),Sr.polygon(e,v,w)},l}O(VOt,"halfRoundedRectangle");var wfn=O((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 QOt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e),i=e.look==="neo"?3.5:4;e.labelStyle=r;const a=e.padding??0,o=70,s=32,l=e.look==="neo"?o:a,u=e.look==="neo"?s: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 gn(t,e,an(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=wfn(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=l1(h,g,f,m);return n&&v.attr("style",n),e.width=g,e.height=f,Br(e,v),e.intersect=function(b){return Sr.polygon(e,m,b)},h}O(QOt,"hexagon");async function GOt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.label="",e.labelStyle=r;const{shapeSvg:i}=await gn(t,e,an(e)),a=Math.max(30,(e==null?void 0:e.width)??0),o=Math.max(30,(e==null?void 0:e.height)??0),{cssStyles:s}=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:o},{x:a,y:o}],d=Ei(h),f=l.path(d,u),p=i.insert(()=>f,":first-child");return p.attr("class","basic label-container outer-path"),s&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",s),n&&e.look!=="handDrawn"&&p.selectChildren("path").attr("style",n),p.attr("transform",`translate(${-a/2}, ${-o/2})`),Br(e,p),e.intersect=function(g){return ye.info("Pill intersect",e,{points:h}),Sr.polygon(e,h,g)},i}O(GOt,"hourglass");async function HOt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Or(e);e.labelStyle=i;const a=e.assetHeight??48,o=e.assetWidth??48,s=Math.max(a,o),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(s,l??0);const{shapeSvg:u,bbox:h,label:d}=await gn(t,e,"icon-shape default"),f=e.pos==="t",p=s,g=s,{nodeBorder:m}=r,{stylesMap:v}=wR(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),C=p+h.height+x,k=w.rectangle(-T/2,-C/2,T,C,{...A,fill:"transparent",stroke:"none"}),E=u.insert(()=>S,":first-child"),_=u.insert(()=>k);if(e.icon){const P=u.append("g");P.html(`${await s1(e.icon,{height:s,width:s,fallbackPrefix:""})}`);const L=P.node().getBBox(),R=L.width,D=L.height,M=L.x,I=L.y;P.attr("transform",`translate(${-R/2-M},${f?h.height/2+x/2-D/2-I:-h.height/2-x/2-D/2-I})`),P.attr("style",`color: ${v.get("stroke")??m};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-C/2:C/2-h.height})`),E.attr("transform",`translate(0,${f?h.height/2+x/2:-h.height/2-x/2})`),Br(e,_),e.intersect=function(P){if(ye.info("iconSquare intersect",e,P),!e.label)return Sr.rect(e,P);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,P)},u}O(HOt,"icon");async function WOt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Or(e);e.labelStyle=i;const a=e.assetHeight??48,o=e.assetWidth??48,s=Math.max(a,o),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(s,l??0);const{shapeSvg:u,bbox:h,label:d}=await gn(t,e,"icon-shape default"),f=20,p=e.label?8:0,g=e.pos==="t",{nodeBorder:m,mainBkg:v}=r,{stylesMap:y}=wR(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 s1(e.icon,{height:s,width:s,fallbackPrefix:""})}`);const S=A.node().getBBox(),T=S.width,C=S.height,k=S.x,E=S.y,_=Math.max(T,C)*Math.SQRT2+f*2,P=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(()=>P,":first-child"),I=u.insert(()=>D);return A.attr("transform",`translate(${-T/2-k},${g?h.height/2+p/2-C/2-E:-h.height/2-p/2-C/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})`),Br(e,I),e.intersect=function(N){return ye.info("iconSquare intersect",e,N),Sr.rect(e,N)},u}O(WOt,"iconCircle");async function YOt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Or(e);e.labelStyle=i;const a=e.assetHeight??48,o=e.assetWidth??48,s=Math.max(a,o),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(s,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await gn(t,e,"icon-shape default"),p=e.pos==="t",g=s+d*2,m=s+d*2,{nodeBorder:v,mainBkg:y}=r,{stylesMap:b}=wR(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 C=b.get("fill");T.stroke=C??y;const k=S.path(S2(x,w,m,g,5),T),E=Math.max(m,h.width),_=g+h.height+A,P=S.rectangle(-E/2,-_/2,E,_,{...T,fill:"transparent",stroke:"none"}),L=u.insert(()=>k,":first-child").attr("class","icon-shape2"),R=u.insert(()=>P);if(e.icon){const D=u.append("g");D.html(`${await s1(e.icon,{height:s,width:s,fallbackPrefix:""})}`);const M=D.node().getBBox(),I=M.width,N=M.height,F=M.x,B=M.y;D.attr("transform",`translate(${-I/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})`),Br(e,R),e.intersect=function(D){if(ye.info("iconSquare intersect",e,D),!e.label)return Sr.rect(e,D);const M=e.x??0,I=e.y??0,N=e.height??0;let F=[];return p?F=[{x:M-h.width/2,y:I-N/2},{x:M+h.width/2,y:I-N/2},{x:M+h.width/2,y:I-N/2+h.height+A},{x:M+m/2,y:I-N/2+h.height+A},{x:M+m/2,y:I+N/2},{x:M-m/2,y:I+N/2},{x:M-m/2,y:I-N/2+h.height+A},{x:M-h.width/2,y:I-N/2+h.height+A}]:F=[{x:M-m/2,y:I-N/2},{x:M+m/2,y:I-N/2},{x:M+m/2,y:I-N/2+g},{x:M+h.width/2,y:I-N/2+g},{x:M+h.width/2/2,y:I+N/2},{x:M-h.width/2,y:I+N/2},{x:M-h.width/2,y:I-N/2+g},{x:M-m/2,y:I-N/2+g}],Sr.polygon(e,F,D)},u}O(YOt,"iconRounded");async function qOt(t,e,{config:{themeVariables:r,flowchart:n}}){const{labelStyles:i}=Or(e);e.labelStyle=i;const a=e.assetHeight??48,o=e.assetWidth??48,s=Math.max(a,o),l=n==null?void 0:n.wrappingWidth;e.width=Math.max(s,l??0);const{shapeSvg:u,bbox:h,halfPadding:d,label:f}=await gn(t,e,"icon-shape default"),p=e.pos==="t",g=s+d*2,m=s+d*2,{nodeBorder:v,mainBkg:y}=r,{stylesMap:b}=wR(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 C=b.get("fill");T.stroke=C??y;const k=S.path(S2(x,w,m,g,.1),T),E=Math.max(m,h.width),_=g+h.height+A,P=S.rectangle(-E/2,-_/2,E,_,{...T,fill:"transparent",stroke:"none"}),L=u.insert(()=>k,":first-child"),R=u.insert(()=>P);if(e.icon){const D=u.append("g");D.html(`${await s1(e.icon,{height:s,width:s,fallbackPrefix:""})}`);const M=D.node().getBBox(),I=M.width,N=M.height,F=M.x,B=M.y;D.attr("transform",`translate(${-I/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})`),Br(e,R),e.intersect=function(D){if(ye.info("iconSquare intersect",e,D),!e.label)return Sr.rect(e,D);const M=e.x??0,I=e.y??0,N=e.height??0;let F=[];return p?F=[{x:M-h.width/2,y:I-N/2},{x:M+h.width/2,y:I-N/2},{x:M+h.width/2,y:I-N/2+h.height+A},{x:M+m/2,y:I-N/2+h.height+A},{x:M+m/2,y:I+N/2},{x:M-m/2,y:I+N/2},{x:M-m/2,y:I-N/2+h.height+A},{x:M-h.width/2,y:I-N/2+h.height+A}]:F=[{x:M-m/2,y:I-N/2},{x:M+m/2,y:I-N/2},{x:M+m/2,y:I-N/2+g},{x:M+h.width/2,y:I-N/2+g},{x:M+h.width/2/2,y:I+N/2},{x:M-h.width/2,y:I+N/2},{x:M-h.width/2,y:I-N/2+g},{x:M-m/2,y:I-N/2+g}],Sr.polygon(e,F,D)},u}O(qOt,"iconSquare");async function jOt(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:o}=Or(e);e.labelStyle=o;const s=r==null?void 0:r.wrappingWidth;e.defaultWidth=r==null?void 0:r.wrappingWidth;const l=Math.max(e.label?s??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,s??0);const{shapeSvg:d,bbox:f,label:p}=await gn(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"}),C=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})`),C.attr("transform",`translate(0,${g?f.height/2+y/2:-f.height/2-y/2})`),Br(e,k),e.intersect=function(E){if(ye.info("iconSquare intersect",e,E),!e.label)return Sr.rect(e,E);const _=e.x??0,P=e.y??0,L=e.height??0;let R=[];return g?R=[{x:_-f.width/2,y:P-L/2},{x:_+f.width/2,y:P-L/2},{x:_+f.width/2,y:P-L/2+f.height+y},{x:_+u/2,y:P-L/2+f.height+y},{x:_+u/2,y:P+L/2},{x:_-u/2,y:P+L/2},{x:_-u/2,y:P-L/2+f.height+y},{x:_-f.width/2,y:P-L/2+f.height+y}]:R=[{x:_-u/2,y:P-L/2},{x:_+u/2,y:P-L/2},{x:_+u/2,y:P-L/2+h},{x:_+f.width/2,y:P-L/2+h},{x:_+f.width/2/2,y:P+L/2},{x:_-f.width/2,y:P+L/2},{x:_-f.width/2,y:P-L/2+h},{x:_-u/2,y:P-L/2+h}],Sr.polygon(e,R,E)},d}O(jOt,"imageSquare");async function XOt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=i,o=e.look==="neo"?i*2:i,{shapeSvg:s,bbox:l}=await gn(t,e,an(e)),u=Math.max(l.width+(o??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(s),m=_r(e,{}),v=Ei(d),y=g.path(v,m);f=s.insert(()=>y,":first-child").attr("transform",`translate(${-u/2}, ${h/2})`),p&&f.attr("style",p)}else f=l1(s,u,h,d);return n&&f.attr("style",n),e.width=u,e.height=h,Br(e,f),e.intersect=function(g){return Sr.polygon(e,d,g)},s}O(XOt,"inv_trapezoid");async function KOt(t,e){const{shapeSvg:r,bbox:n,label:i}=await gn(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))})`),Br(e,a),e.intersect=function(l){return Sr.rect(e,l)},r}O(KOt,"labelRect");async function ZOt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=i,o=e.look==="neo"?i*2:i,{shapeSvg:s,bbox:l}=await gn(t,e,an(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+o,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(s),m=_r(e,{}),v=Ei(d),y=g.path(v,m);f=s.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=l1(s,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Br(e,f),e.intersect=function(g){return Sr.polygon(e,d,g)},s}O(ZOt,"lean_left");async function JOt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=i,o=e.look==="neo"?i*2:i,{shapeSvg:s,bbox:l}=await gn(t,e,an(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+o,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(s),m=_r(e,{}),v=Ei(d),y=g.path(v,m);f=s.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=l1(s,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Br(e,f),e.intersect=function(g){return Sr.polygon(e,d,g)},s}O(JOt,"lean_right");function ekt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.label="",e.labelStyle=r;const i=t.insert("g").attr("class",an(e)).attr("id",e.domId??e.id),{cssStyles:a}=e,o=Math.max(35,(e==null?void 0:e.width)??0),s=Math.max(35,(e==null?void 0:e.height)??0),l=7,u=[{x:o,y:0},{x:0,y:s+l/2},{x:o-2*l,y:s+l/2},{x:0,y:2*s},{x:o,y:s-l/2},{x:2*l,y:s-l/2}],h=Er.svg(i),d=_r(e,{});e.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const f=Ei(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(-${o/2},${-s})`),Br(e,g),e.intersect=function(m){return ye.info("lightningBolt intersect",e,m),Sr.polygon(e,u,m)},i}O(ekt,"lightningBolt");var Afn=O((t,e,r,n,i,a,o)=>[`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+o}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),Sfn=O((t,e,r,n,i,a,o)=>[`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+o}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),Tfn=O((t,e,r,n,i,a)=>[`M${t-r/2},${-n/2}`,`a${i},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),tkt=10,rkt=10;async function nkt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,o=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=s.insert(()=>A,":first-child"),m.attr("class","basic label-container"),v&&m.attr("style",v)}else{const y=Afn(0,0,h,p,d,f,g);m=s.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Fl(v)).attr("style",n)}return m.attr("label-offset-y",f),m.attr("transform",`translate(${-h/2}, ${-(p/2+f)})`),Br(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},s}O(nkt,"linedCylinder");async function ikt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,o=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)-o*2,e.height<10&&(e.height=10)}const{shapeSvg:s,bbox:l,label:u}=await gn(t,e,an(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)+(o??0)*2,f=e.look==="neo"?d/4:d/8,p=d+f,{cssStyles:g}=e,m=Er.svg(s),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},...w2(-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=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),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))})`),Br(e,x),e.intersect=function(w){return Sr.polygon(e,y,w)},s}O(ikt,"linedWaveEdgedRect");async function akt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,o=e.look==="neo"?12:i,s=e.look==="neo"?10:5;(e.width||e.height)&&(e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-2*s,10),e.height=Math.max(((e==null?void 0:e.height)??0)-o*2-2*s,10));const{shapeSvg:l,bbox:u,label:h}=await gn(t,e,an(e)),d=(e!=null&&e.width?e==null?void 0:e.width:u.width)+a*2+2*s,f=(e!=null&&e.height?e==null?void 0:e.height:u.height)+o*2+2*s,p=d-2*s,g=f-2*s,m=-p/2,v=-g/2,{cssStyles:y}=e,b=Er.svg(l),x=_r(e,{}),w=[{x:m-s,y:v+s},{x:m-s,y:v+g+s},{x:m+p-s,y:v+g+s},{x:m+p-s,y:v+g},{x:m+p,y:v+g},{x:m+p,y:v+g-s},{x:m+p+s,y:v+g-s},{x:m+p+s,y:v-s},{x:m+s,y:v-s},{x:m+s,y:v},{x:m,y:v},{x:m,y:v+s}],A=[{x:m,y:v+s},{x:m+p-s,y:v+s},{x:m+p-s,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=Ei(w);let T=b.path(S,x);const C=Ei(A);let k=b.path(C,x);e.look!=="handDrawn"&&(T=jxe(T),k=jxe(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)-s-(u.x-(u.left??0))}, ${-(u.height/2)+s-(u.y-(u.top??0))})`),Br(e,E),e.intersect=function(_){return Sr.polygon(e,w,_)},l}O(akt,"multiRect");async function okt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:o}=await gn(t,e,an(e)),s=e.padding??0,l=e.look==="neo"?16:s,u=e.look==="neo"?12:s;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=w2(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),C=_r(e,{});e.look!=="handDrawn"&&(C.roughness=0,C.fillStyle="solid");const k=Ei(A),E=T.path(k,C),_=Ei(S),P=T.path(_,C),L=i.insert(()=>E,":first-child");return L.insert(()=>P),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})`),o.attr("transform",`translate(${-(a.width/2)-y-(a.x-(a.left??0))}, ${-(a.height/2)+y-p/2-(a.y-(a.top??0))})`),Br(e,L),e.intersect=function(R){return Sr.polygon(e,A,R)},i}O(okt,"multiWaveEdgedRectangle");async function skt(t,e,{config:{themeVariables:r}}){const{labelStyles:n,nodeStyles:i}=Or(e);e.labelStyle=n,e.useHtmlLabels||na(Dr())||(e.centerLabel=!0);const{shapeSvg:o,bbox:s,label:l}=await gn(t,e,an(e)),u=Math.max(s.width+(e.padding??0)*2,(e==null?void 0:e.width)??0),h=Math.max(s.height+(e.padding??0)*2,(e==null?void 0:e.height)??0),d=-u/2,f=-h/2,{cssStyles:p}=e,g=Er.svg(o),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=o.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(${-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),Br(e,y),e.intersect=function(b){return Sr.rect(e,b)},o}O(skt,"note");var Cfn=O((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 lkt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await gn(t,e,an(e)),o=a.width+(e.padding??0),s=a.height+(e.padding??0),l=o+s,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=Cfn(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=l1(i,l,l,h),d.attr("transform",`translate(${-l/2+u}, ${l/2})`);return n&&d.attr("style",n),Br(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}O(lkt,"question");async function ckt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?21:i??0,o=e.look==="neo"?12:i??0,{shapeSvg:s,bbox:l,label:u}=await gn(t,e,an(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"?o*2:o),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(s),b=_r(e,{});e.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const x=Ei(m),w=y.path(x,b),A=s.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))})`),Br(e,A),e.intersect=function(S){return Sr.polygon(e,m,S)},s}O(ckt,"rect_left_inv_arrow");async function ukt(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),o=a.insert("g"),s=a.insert("g").attr("class","label").attr("style",n),l=e.description,u=e.label,h=await A2(s,u,e.labelStyle,!0,!0);let d={width:0,height:0};if(na(Ye())){const C=h.children[0],k=_t(h);d=C.getBoundingClientRect(),k.attr("width",d.width),k.attr("height",d.height)}ye.info("Text 2",l);const f=l||[],p=h.getBBox(),g=await A2(s,Array.isArray(f)?f.join("
"):f,e.labelStyle,!0,!0),m=g.children[0],v=_t(g);d=m.getBoundingClientRect(),v.attr("width",d.width),v.attr("height",d.height);const y=(e.padding||0)/2;_t(g).attr("transform","translate( "+(d.width>p.width?0:(p.width-d.width)/2)+", "+(p.height+y+5)+")"),_t(h).attr("transform","translate( "+(d.width(ye.debug("Rough node insert CXC",E),_),":first-child"),S=a.insert(()=>(ye.debug("Rough node insert CXC",E),E),":first-child")}else S=o.insert("rect",":first-child"),T=o.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 Br(e,S),e.intersect=function(C){return Sr.rect(e,C)},a}O(ukt,"rectWithTitle");async function hkt(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 OR(t,e,i)}O(hkt,"roundedRect");var nC=8;async function dkt(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:o,bbox:s,label:l}=await gn(t,e,an(e)),u=((e==null?void 0:e.width)??s.width)+i*2+(e.look==="neo"?nC:nC*2),h=((e==null?void 0:e.height)??s.height)+a*2,d=u-nC,f=h,p=nC-u/2,g=-h/2,{cssStyles:m}=e,v=Er.svg(o),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-nC,y:g+f},{x:p-nC,y:g},{x:p,y:g},{x:p,y:g+f}],x=v.polygon(b.map(A=>[A.x,A.y]),y),w=o.insert(()=>x,":first-child");return w.attr("class","basic label-container outer-path").attr("style",Fl(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(${nC/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),Br(e,w),e.intersect=function(A){return Sr.rect(e,A)},o}O(dkt,"shadedProcess");async function fkt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,o=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-o*2,10));const{shapeSvg:s,bbox:l,label:u}=await gn(t,e,an(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)+o*2)*1.5,f=h,p=d/1.5,g=-f/2,m=-p/2,{cssStyles:v}=e,y=Er.svg(s),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=Ei(x),A=y.path(w,b),S=s.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))})`),Br(e,S),e.intersect=function(T){return Sr.polygon(e,x,T)},s}O(fkt,"slopedRect");async function pkt(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 OR(t,e,a)}O(pkt,"squareRect");async function gkt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?20:i,o=e.look==="neo"?12:i,{shapeSvg:s,bbox:l}=await gn(t,e,an(e)),u=l.height+(e.look==="neo"?o*2:o),h=l.width+u/4+(e.look==="neo"?a*2:a),d=u/2,{cssStyles:f}=e,p=Er.svg(s),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},...r$(-h/2+d,0,d,50,90,270),{x:h/2-d,y:u/2},...r$(h/2-d,0,d,50,270,450)],v=Ei(m),y=p.path(v,g),b=s.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),Br(e,b),e.intersect=function(x){return Sr.polygon(e,m,x)},s}O(gkt,"stadium");async function mkt(t,e){const r={rx:e.look==="neo"?3:5,ry:e.look==="neo"?3:5};return OR(t,e,r)}O(mkt,"state");function vkt(t,e,{config:{themeVariables:r}}){var b,x;const{labelStyles:n,nodeStyles:i}=Or(e);e.labelStyle=n;const{cssStyles:a}=e,{lineColor:o,stateBorder:s,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:o,strokeWidth:2}),g=s??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 Br(e,y),e.intersect=function(w){return Sr.circle(e,(e.width??0)/2,w)},h}O(vkt,"stateEnd");function ykt(t,e,{config:{themeVariables:r}}){var s,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 o;if(e.look==="handDrawn"){const h=Er.svg(a).circle(0,0,e.width,rhn(n));o=a.insert(()=>h),o.attr("class","state-start").attr("r",(e.width??7)/2).attr("width",e.width??14).attr("height",e.height??14)}else o=a.insert("circle",":first-child"),o.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=(s=t.node())==null?void 0:s.ownerSVGElement)==null?void 0:l.id)??"",h=u?`${u}-drop-shadow-small`:"drop-shadow-small";o.attr("style",`filter:url(#${h})`)}return Br(e,o),e.intersect=function(u){return Sr.circle(e,(e.width??7)/2,u)},a}O(ykt,"stateStart");var kR=8;async function bkt(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,o=e.look==="neo"?12:i,{shapeSvg:s,bbox:l}=await gn(t,e,an(e)),u=((e==null?void 0:e.width)??l.width)+2*kR+a,h=((e==null?void 0:e.height)??l.height)+o,d=u-2*kR,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(s),y=_r(e,{}),b=v.rectangle(p,g,d+16,f,y),x=v.line(p+kR,g,p+kR,g+f,y),w=v.line(p+kR+d,g,p+kR+d,g+f,y);s.insert(()=>x,":first-child"),s.insert(()=>w,":first-child");const A=s.insert(()=>b,":first-child"),{cssStyles:S}=e;A.attr("class","basic label-container").attr("style",Fl(S)),Br(e,A)}else{const v=l1(s,d,f,m);n&&v.attr("style",n),Br(e,v)}return e.intersect=function(v){return Sr.polygon(e,m,v)},s}O(bkt,"subroutine");var Jxe=.2;async function xkt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,o=e.look==="neo"?12:i;(e.width||e.height)&&(e.height=Math.max(((e==null?void 0:e.height)??0)-o*2,10),e.width=Math.max(((e==null?void 0:e.width)??0)-a*2-Jxe*(e.height+o*2),10));const{shapeSvg:s,bbox:l}=await gn(t,e,an(e)),u=(e!=null&&e.height?e==null?void 0:e.height:l.height)+o*2,h=Jxe*u,d=Jxe*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(s),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=Ei(w),T=b.path(S,x),C=Ei(A),k=b.path(C,{...x,fillStyle:"solid"}),E=s.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),Br(e,E),e.intersect=function(_){return Sr.polygon(e,w,_)},s}O(xkt,"taggedRect");async function wkt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,label:o}=await gn(t,e,an(e)),s=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*s,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:-s/2-s/2*.1,y:f/2},...w2(-s/2-s/2*.1,f/2,s/2+s/2*.1,f/2,u,.8),{x:s/2+s/2*.1,y:-f/2},{x:-s/2-s/2*.1,y:-f/2}],y=-s/2+s/2*.1,b=-f/2-d*.4,x=[{x:y+s-h,y:(b+l)*1.3},{x:y+s,y:b+l-d},{x:y+s,y:(b+l)*.9},...w2(y+s,(b+l)*1.25,y+s-h,(b+l)*1.3,-l*.02,.5)],w=Ei(v),A=g.path(w,m),S=Ei(x),T=g.path(S,{...m,fillStyle:"solid"}),C=i.insert(()=>T,":first-child");return C.insert(()=>A,":first-child"),C.attr("class","basic label-container outer-path"),p&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",p),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.attr("transform",`translate(0,${-u/2})`),o.attr("transform",`translate(${-s/2+(e.padding??0)-(a.x-(a.left??0))},${-l/2+(e.padding??0)-u/2-(a.y-(a.top??0))})`),Br(e,C),e.intersect=function(k){return Sr.polygon(e,v,k)},i}O(wkt,"taggedWaveEdgedRectangle");async function Akt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a}=await gn(t,e,an(e)),o=Math.max(a.width+(e.padding??0),(e==null?void 0:e.width)||0),s=Math.max(a.height+(e.padding??0),(e==null?void 0:e.height)||0),l=-o/2,u=-s/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",o).attr("height",s),Br(e,h),e.intersect=function(d){return Sr.rect(e,d)},i}O(Akt,"text");var Ofn=O((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"),Cfn=O((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"),Ofn=O((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),wkt=5,Akt=10;async function Skt(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=o.insert(()=>b,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=Tfn(0,0,f,u,d,h);g=o.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Fl(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(${-(s.width/2)-d-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),Br(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},o}O(Skt,"tiltedCylinder");async function Tkt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=(e.look==="neo",i),o=e.look==="neo"?i*2:i,{shapeSvg:s,bbox:l}=await gn(t,e,an(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+o,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(s),m=_r(e,{}),v=Ei(d),y=g.path(v,m);f=s.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=l1(s,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Br(e,f),e.intersect=function(g){return Sr.polygon(e,d,g)},s}O(Tkt,"trapezoid");async function Ckt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,o=e.look==="neo"?12:i,s=15,l=5;(e.width||e.height)&&(e.height=(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),Br(e,x),e.intersect=function(w){return Sr.polygon(e,v,w)},u}O(Ckt,"trapezoidalPentagon");var Okt=10,kkt=10;async function Ekt(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,Br(e,x),l.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${d/2-(s.height+(e.padding??0)/(u?2:1)-(s.y-(s.top??0)))})`),e.intersect=function(A){return ye.info("Triangle intersect",e,p,A),Sr.polygon(e,p,A)},o}O(Ekt,"triangle");async function _kt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,o=e.look==="neo"?12:i;let s=!0;(e.width||e.height)&&(s=!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)-o*2,e.height<10&&(e.height=10));const{shapeSvg:l,bbox:u,label:h}=await gn(t,e,an(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)+(o??0)*2,p=e.look==="neo"?f/4:f/8,g=f+(s?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},...w2(-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=Ei(A),T=x.path(S,w),C=l.insert(()=>T,":first-child");return C.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.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))})`),Br(e,C),e.intersect=function(k){return Sr.polygon(e,A,k)},l}O(_kt,"waveEdgedRectangle");async function Rkt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,o=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-o-w*(20/9)),e.width=e.width-a*2}const{shapeSvg:s,bbox:l}=await gn(t,e,an(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)+o,d=h/8,f=h+d*2,{cssStyles:p}=e,g=Er.svg(s),m=_r(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const v=[{x:-u/2,y:f/2},...w2(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...w2(u/2,-f/2,-u/2,-f/2,d,-1)],y=Ei(v),b=g.path(y,m),x=s.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),Br(e,x),e.intersect=function(w){return Sr.polygon(e,v,w)},s}O(Rkt,"waveRectangle");var Xo=10;async function Dkt(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-Xo,10),e.height=Math.max(((e==null?void 0:e.height)??0)-a*2-Xo,10));const{shapeSvg:o,bbox:s,label:l}=await gn(t,e,an(e)),u=(e!=null&&e.width?e==null?void 0:e.width:s.width)+i*2+Xo,h=(e!=null&&e.height?e==null?void 0:e.height:s.height)+a*2+Xo,d=u-Xo,f=h-Xo,p=-d/2,g=-f/2,{cssStyles:m}=e,v=Er.svg(o),y=_r(e,{}),b=[{x:p-Xo,y:g-Xo},{x:p-Xo,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-Xo}],x=`M${p-Xo},${g-Xo} L${p+d},${g-Xo} L${p+d},${g+f} L${p-Xo},${g+f} L${p-Xo},${g-Xo} + l${-r},0`,"createCylinderPathD"),kfn=O((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"),Efn=O((t,e,r,n,i,a)=>[`M${t+r/2},${-n/2}`,`a${i},${a} 0,0,0 0,${n}`].join(" "),"createInnerCylinderPathD"),Skt=5,Tkt=10;async function Ckt(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=o.insert(()=>b,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=Ofn(0,0,f,u,d,h);g=o.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Fl(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(${-(s.width/2)-d-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),Br(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},o}O(Ckt,"tiltedCylinder");async function Okt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=(e.look==="neo",i),o=e.look==="neo"?i*2:i,{shapeSvg:s,bbox:l}=await gn(t,e,an(e)),u=((e==null?void 0:e.height)??l.height)+a,h=((e==null?void 0:e.width)??l.width)+o,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(s),m=_r(e,{}),v=Ei(d),y=g.path(v,m);f=s.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${u/2})`),p&&f.attr("style",p)}else f=l1(s,h,u,d);return n&&f.attr("style",n),e.width=h,e.height=u,Br(e,f),e.intersect=function(g){return Sr.polygon(e,d,g)},s}O(Okt,"trapezoid");async function kkt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,o=e.look==="neo"?12:i,s=15,l=5;(e.width||e.height)&&(e.height=(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),Br(e,x),e.intersect=function(w){return Sr.polygon(e,v,w)},u}O(kkt,"trapezoidalPentagon");var Ekt=10,_kt=10;async function Rkt(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.width<_kt&&(e.width=_kt),e.height=(e==null?void 0:e.height)??0,e.heightb,":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,Br(e,x),l.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${d/2-(s.height+(e.padding??0)/(u?2:1)-(s.y-(s.top??0)))})`),e.intersect=function(A){return ye.info("Triangle intersect",e,p,A),Sr.polygon(e,p,A)},o}O(Rkt,"triangle");async function Dkt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,o=e.look==="neo"?12:i;let s=!0;(e.width||e.height)&&(s=!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)-o*2,e.height<10&&(e.height=10));const{shapeSvg:l,bbox:u,label:h}=await gn(t,e,an(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)+(o??0)*2,p=e.look==="neo"?f/4:f/8,g=f+(s?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},...w2(-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=Ei(A),T=x.path(S,w),C=l.insert(()=>T,":first-child");return C.attr("class","basic label-container outer-path"),m&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",m),n&&e.look!=="handDrawn"&&C.selectAll("path").attr("style",n),C.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))})`),Br(e,C),e.intersect=function(k){return Sr.polygon(e,A,k)},l}O(Dkt,"waveEdgedRectangle");async function Lkt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e.padding??0,a=e.look==="neo"?16:i,o=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-o-w*(20/9)),e.width=e.width-a*2}const{shapeSvg:s,bbox:l}=await gn(t,e,an(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)+o,d=h/8,f=h+d*2,{cssStyles:p}=e,g=Er.svg(s),m=_r(e,{});e.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const v=[{x:-u/2,y:f/2},...w2(-u/2,f/2,u/2,f/2,d,1),{x:u/2,y:-f/2},...w2(u/2,-f/2,-u/2,-f/2,d,-1)],y=Ei(v),b=g.path(y,m),x=s.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),Br(e,x),e.intersect=function(w){return Sr.polygon(e,v,w)},s}O(Lkt,"waveRectangle");var Xo=10;async function Mkt(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-Xo,10),e.height=Math.max(((e==null?void 0:e.height)??0)-a*2-Xo,10));const{shapeSvg:o,bbox:s,label:l}=await gn(t,e,an(e)),u=(e!=null&&e.width?e==null?void 0:e.width:s.width)+i*2+Xo,h=(e!=null&&e.height?e==null?void 0:e.height:s.height)+a*2+Xo,d=u-Xo,f=h-Xo,p=-d/2,g=-f/2,{cssStyles:m}=e,v=Er.svg(o),y=_r(e,{}),b=[{x:p-Xo,y:g-Xo},{x:p-Xo,y:g+f},{x:p+d,y:g+f},{x:p+d,y:g-Xo}],x=`M${p-Xo},${g-Xo} L${p+d},${g-Xo} L${p+d},${g+f} L${p-Xo},${g+f} L${p-Xo},${g-Xo} M${p-Xo},${g} L${p+d},${g} - M${p},${g-Xo} L${p},${g+f}`;e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const w=v.path(x,y),A=o.insert(()=>w,":first-child");return A.attr("transform",`translate(${Xo/2}, ${Xo/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(${-(s.width/2)+Xo/2-(s.x-(s.left??0))}, ${-(s.height/2)+Xo/2-(s.y-(s.top??0))})`),Br(e,A),e.intersect=function(S){return Sr.polygon(e,b,S)},o}O(Dkt,"windowPane");var Lkt=new Set(["redux-color","redux-dark-color"]),kfn=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function e2e(t,e){var q,Y,ne,X;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=Dr(),{rowEven:a,rowOdd:o,nodeBorder:s,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:J}=Dr(),{background:ee}=J,te={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${ee}`]};await e2e(t,te)}const u=Dr();e.useHtmlLabels=u.htmlLabels;let h=((q=u.er)==null?void 0:q.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 J={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};Uu(e.label,u)+J.labelPaddingX*20){const J=y.width+h*2-(A+S+T+C);A+=J/_,S+=J/_,T>0&&(T+=J/_),C>0&&(C+=J/_)}const L=A+S+T+C,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((J,ee)=>J+((ee==null?void 0:ee.rowHeight)??0),0));const I=Math.max(P.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=-I/2,B=-N/2;if(v.selectAll("g:not(:first-child)").each((J,ee,te)=>{const pe=_t(te[ee]),ie=pe.attr("transform");let Ce=0,ke=0;if(ie){const ue=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ie);ue&&(Ce=parseFloat(ue[1]),ke=parseFloat(ue[2]),pe.attr("class").includes("attribute-name")?Ce+=A:pe.attr("class").includes("attribute-keys")?Ce+=A+S:pe.attr("class").includes("attribute-comment")&&(Ce+=A+S+T))}pe.attr("transform",`translate(${F+h/2+Ce}, ${ke+B+y.height+d/2})`)}),v.select(".name").attr("transform","translate("+-y.width/2+", "+(B+d/2)+")"),n!=null&&Lkt.has(n)){const J=r.colorIndex??0;v.attr("data-color-id",`color-${J%l.length}`)}const V=R.rectangle(F,B,I,N,D),z=v.insert(()=>V,":first-child").attr("class","outer-path").attr("style",f.join(""));x.push(0);for(const[J,ee]of w.entries()){const pe=(J+1)%2===0&&ee.yOffset!==0,ie=R.rectangle(F,y.height+B+(ee==null?void 0:ee.yOffset),I,ee==null?void 0:ee.rowHeight,{...D,fill:pe?a:o,stroke:s});v.insert(()=>ie,"g.label").attr("style",f.join("")).attr("class",`row-rect-${pe?"even":"odd"}`)}const U=1e-4;let Q=_R(F,y.height+B,I+F,y.height+B,U),G=R.polygon(Q.map(J=>[J.x,J.y]),D);if(v.insert(()=>G).attr("class","divider"),Q=_R(A+F,y.height+B,A+F,N+B,U),G=R.polygon(Q.map(J=>[J.x,J.y]),D),v.insert(()=>G).attr("class","divider"),k){const J=A+S+F;Q=_R(J,y.height+B,J,N+B,U),G=R.polygon(Q.map(ee=>[ee.x,ee.y]),D),v.insert(()=>G).attr("class","divider")}if(E){const J=A+S+T+F;Q=_R(J,y.height+B,J,N+B,U),G=R.polygon(Q.map(ee=>[ee.x,ee.y]),D),v.insert(()=>G).attr("class","divider")}for(const J of x){const ee=y.height+B+J;Q=_R(F,ee,I+F,ee,U),G=R.polygon(Q.map(te=>[te.x,te.y]),D),v.insert(()=>G).attr("class","divider")}if(Br(e,z),g&&e.look!=="handDrawn")if(n!=null&&kfn.has(n))v.selectAll("path").attr("style",g);else{const J=g.split(";"),ee=(X=J==null?void 0:J.filter(te=>te.includes("stroke")))==null?void 0:X.map(te=>`${te}`).join("; ");v.selectAll("path").attr("style",ee??""),v.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(J){return Sr.rect(e,J)},v}O(e2e,"erBox");async function ER(t,e,r,n=0,i=0,a=[],o=""){const s=t.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",o);e!==g2(e)&&(e=g2(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=s.node().appendChild(await su(s,e,{width:Uu(e,r)+100,style:o,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(p0(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=_t(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}O(ER,"addText");function _R(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}]}O(_R,"lineToPolygon");async function Mkt(t,e,r,n,i=r.class.padding??12){const a=n?0:3,o=t.insert("g").attr("class",an(e)).attr("id",e.domId||e.id);let s=null,l=null,u=null,h=null,d=0,f=0,p=0;if(s=o.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const b=e.annotations[0];await n$(s,{text:`«${b}»`},0),d=s.node().getBBox().height}l=o.insert("g").attr("class","label-group text"),await n$(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,u=o.insert("g").attr("class","members-group text");let m=0;for(const b of e.members){const x=await n$(u,b,m,[b.parseClassifier()]);m+=x+a}p=u.node().getBBox().height,p<=0&&(p=i/2),h=o.insert("g").attr("class","methods-group text");let v=0;for(const b of e.methods){const x=await n$(h,b,v,[b.parseClassifier()]);v+=x+a}let y=o.node().getBBox();if(s!==null){const b=s.node().getBBox();s.attr("transform",`translate(${-b.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),y=o.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),y=o.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),y=o.node().getBBox(),{shapeSvg:o,bbox:y}}O(Mkt,"textHelper");async function n$(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),a=Dr();let o="useHtmlLabels"in e?e.useHtmlLabels:p0(a.htmlLabels)??!0,s="";"text"in e?s=e.text:s=e.label,!o&&s.startsWith("\\")&&(s=s.substring(1)),ps(s)&&(o=!0);const l=await su(i,V1e(o1(s)),{width:Uu(s,a)+50,classes:"markdown-node-label",useHtmlLabels:o},a);let u,h=1;if(o){const d=l.children[0],f=_t(l);h=d.innerHTML.split("
").length,d.innerHTML.includes("")&&(h+=d.innerHTML.split("").length-1);const p=d.getElementsByTagName("img");if(p){const g=s.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)}O(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")&&_t(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=s[0]+s.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),s[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}O(n$,"addText");async function Ikt(t,e){var R,D;const r=Ye(),{themeVariables:n}=r,{useGradient:i}=n,a=r.class.padding??12,o=a,s=e.useHtmlLabels??p0(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await Mkt(t,e,r,s,o),{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+=o:l.members.length>0&&l.methods.length===0&&(b+=o*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),C=u.insert(()=>T,":first-child");C.attr("class","basic label-container outer-path");const k=C.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,P=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,I,N)=>{var Q,G;const F=_t(N[I]),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 q=Math.max(P,o/2);x?z=Math.max(L,E+_+q+A+o*2+a)+o*2:z=E+_+q+A+o*4+a}l.members.length===0&&l.methods.length===0&&((Q=r.class)!=null&&Q.hideEmptyMembersBox)&&(l.annotations.length>0?z=V-o:z=V),s||(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(q,Y,ne){window.getComputedStyle(ne[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,I=m.line(k.x,M,k.x+k.width,M+.001,v);u.insert(()=>I).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+_+P+A+o*2+a,I=m.line(k.x,x?Math.max(L,M):M,k.x+k.width,(x?Math.max(L,M):M)+.001,v);u.insert(()=>I).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),C.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),!s){const M=RegExp(/color\s*:\s*([^;]*)/),I=M.exec(p);if(I){const N=I[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 Br(e,C),e.intersect=function(M){return Sr.rect(e,M)},u}O(Ikt,"classBox");async function Pkt(t,e){var k,E;const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e,a=e,o=20,s=20,l="verifyMethod"in e,u=an(e),{themeVariables:h}=Ye(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await w0(p,`<<${i.type}>>`,0,e.labelStyle):g=await w0(p,"<<Element>>",0,e.labelStyle);let m=g;const v=await w0(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=v+s,l){const _=await w0(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=_;const P=await w0(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=P;const L=await w0(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=L,await w0(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const _=await w0(p,`${a.type?`Type: ${a.type}`:""}`,m,e.labelStyle);m+=_,await w0(p,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,m,e.labelStyle)}const y=(((k=p.node())==null?void 0:k.getBBox().width)??200)+o,b=(((E=p.node())==null?void 0:E.getBBox().height)??200)+o,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),C=p.insert(()=>T,":first-child");if(C.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((_,P,L)=>{const R=_t(L[P]),D=R.attr("transform");let M=0,I=0;if(D){const V=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(D);V&&(M=parseFloat(V[1]),I=parseFloat(V[2]))}const N=I-b/2;let F=x+o/2;(P===0||P===1)&&(F=M),R.attr("transform",`translate(${F}, ${N+o})`)}),m>g+v+s){const _=w+g+v+s;let P;if(e.look==="neo"){const D=[[x,_],[x+y,_],[x+y,_+.001],[x,_+.001]];P=A.polygon(D,S)}else P=A.line(x,_,x+y,_,S);p.insert(()=>P).attr("class","divider")}return Br(e,C),e.intersect=function(_){return Sr.rect(e,_)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}O(Pkt,"requirementBox");async function w0(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),a=Ye(),o=a.htmlLabels??!0,s=await su(i,V1e(o1(e)),{width:Uu(e,a)+50,classes:"markdown-node-label",useHtmlLabels:o,style:n},a);let l;if(o){const u=s.children[0],h=_t(s);l=u.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const u=s.children[0];for(const h of u.children)n&&h.setAttribute("style",n);l=s.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}O(w0,"addText");var Efn=O(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 Nkt(t,e,{config:r}){var P,L;const{labelStyles:n,nodeStyles:i}=Or(e);e.labelStyle=n||"";const a=10,o=e.width;e.width=(e.width??200)-10;const{shapeSvg:s,bbox:l,label:u}=await gn(t,e,an(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((P=r==null?void 0:r.kanban)!=null&&P.ticketBaseUrl)&&(d=(L=r==null?void 0:r.kanban)==null?void 0:L.ticketBaseUrl.replace("#TICKET#",e.ticket),f=s.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 qxe(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await qxe(s,"ticket"in e&&e.ticket||"",p);const{label:v,bbox:y}=await qxe(s,"assigned"in e&&e.assigned||"",p);e.width=o;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 C;const{rx:k,ry:E}=e,{cssStyles:_}=e;if(e.look==="handDrawn"){const R=Er.svg(s),D=_r(e,{}),M=k||E?R.path(S2(S,T,x,A,k||0),D):R.rectangle(S,T,x,A,D);C=s.insert(()=>M,":first-child"),C.attr("class","basic label-container").attr("style",_||null)}else{C=s.insert("rect",":first-child"),C.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=s.append("line"),M=S+2,I=T+Math.floor((k??0)/2),N=T+A-Math.floor((k??0)/2);D.attr("x1",M).attr("y1",I).attr("x2",M).attr("y2",N).attr("stroke-width","4").attr("stroke",Efn(R))}}return Br(e,C),e.height=A,e.intersect=function(R){return Sr.rect(e,R)},s}O(Nkt,"kanbanItem");async function Bkt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await gn(t,e,an(e)),l=a.width+10*o,u=a.height+8*o,h=.15*l,{cssStyles:d}=e,f=a.width+20,p=a.height+20,g=Math.max(l,f),m=Math.max(u,p);s.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`);let v;const y=`M0 0 + M${p},${g-Xo} L${p},${g+f}`;e.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const w=v.path(x,y),A=o.insert(()=>w,":first-child");return A.attr("transform",`translate(${Xo/2}, ${Xo/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(${-(s.width/2)+Xo/2-(s.x-(s.left??0))}, ${-(s.height/2)+Xo/2-(s.y-(s.top??0))})`),Br(e,A),e.intersect=function(S){return Sr.polygon(e,b,S)},o}O(Mkt,"windowPane");var Ikt=new Set(["redux-color","redux-dark-color"]),_fn=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function e2e(t,e){var q,Y,ne,X;const r=e;r.alias&&(e.label=r.alias);const{theme:n,themeVariables:i}=Dr(),{rowEven:a,rowOdd:o,nodeBorder:s,borderColorArray:l}=i;if(e.look==="handDrawn"){const{themeVariables:J}=Dr(),{background:ee}=J,te={...e,id:e.id+"-background",domId:(e.domId||e.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${ee}`]};await e2e(t,te)}const u=Dr();e.useHtmlLabels=u.htmlLabels;let h=((q=u.er)==null?void 0:q.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 J={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};Uu(e.label,u)+J.labelPaddingX*20){const J=y.width+h*2-(A+S+T+C);A+=J/_,S+=J/_,T>0&&(T+=J/_),C>0&&(C+=J/_)}const L=A+S+T+C,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((J,ee)=>J+((ee==null?void 0:ee.rowHeight)??0),0));const I=Math.max(P.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=-I/2,B=-N/2;if(v.selectAll("g:not(:first-child)").each((J,ee,te)=>{const pe=_t(te[ee]),ie=pe.attr("transform");let Ce=0,ke=0;if(ie){const ue=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(ie);ue&&(Ce=parseFloat(ue[1]),ke=parseFloat(ue[2]),pe.attr("class").includes("attribute-name")?Ce+=A:pe.attr("class").includes("attribute-keys")?Ce+=A+S:pe.attr("class").includes("attribute-comment")&&(Ce+=A+S+T))}pe.attr("transform",`translate(${F+h/2+Ce}, ${ke+B+y.height+d/2})`)}),v.select(".name").attr("transform","translate("+-y.width/2+", "+(B+d/2)+")"),n!=null&&Ikt.has(n)){const J=r.colorIndex??0;v.attr("data-color-id",`color-${J%l.length}`)}const V=R.rectangle(F,B,I,N,D),z=v.insert(()=>V,":first-child").attr("class","outer-path").attr("style",f.join(""));x.push(0);for(const[J,ee]of w.entries()){const pe=(J+1)%2===0&&ee.yOffset!==0,ie=R.rectangle(F,y.height+B+(ee==null?void 0:ee.yOffset),I,ee==null?void 0:ee.rowHeight,{...D,fill:pe?a:o,stroke:s});v.insert(()=>ie,"g.label").attr("style",f.join("")).attr("class",`row-rect-${pe?"even":"odd"}`)}const U=1e-4;let Q=_R(F,y.height+B,I+F,y.height+B,U),G=R.polygon(Q.map(J=>[J.x,J.y]),D);if(v.insert(()=>G).attr("class","divider"),Q=_R(A+F,y.height+B,A+F,N+B,U),G=R.polygon(Q.map(J=>[J.x,J.y]),D),v.insert(()=>G).attr("class","divider"),k){const J=A+S+F;Q=_R(J,y.height+B,J,N+B,U),G=R.polygon(Q.map(ee=>[ee.x,ee.y]),D),v.insert(()=>G).attr("class","divider")}if(E){const J=A+S+T+F;Q=_R(J,y.height+B,J,N+B,U),G=R.polygon(Q.map(ee=>[ee.x,ee.y]),D),v.insert(()=>G).attr("class","divider")}for(const J of x){const ee=y.height+B+J;Q=_R(F,ee,I+F,ee,U),G=R.polygon(Q.map(te=>[te.x,te.y]),D),v.insert(()=>G).attr("class","divider")}if(Br(e,z),g&&e.look!=="handDrawn")if(n!=null&&_fn.has(n))v.selectAll("path").attr("style",g);else{const J=g.split(";"),ee=(X=J==null?void 0:J.filter(te=>te.includes("stroke")))==null?void 0:X.map(te=>`${te}`).join("; ");v.selectAll("path").attr("style",ee??""),v.selectAll(".row-rect-even path").attr("style",g)}return e.intersect=function(J){return Sr.rect(e,J)},v}O(e2e,"erBox");async function ER(t,e,r,n=0,i=0,a=[],o=""){const s=t.insert("g").attr("class",`label ${a.join(" ")}`).attr("transform",`translate(${n}, ${i})`).attr("style",o);e!==g2(e)&&(e=g2(e),e=e.replaceAll("<","<").replaceAll(">",">"));const l=s.node().appendChild(await su(s,e,{width:Uu(e,r)+100,style:o,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(p0(r.htmlLabels)){const h=l.children[0];h.style.textAlign="start";const d=_t(l);u=h.getBoundingClientRect(),d.attr("width",u.width),d.attr("height",u.height)}return u}O(ER,"addText");function _R(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}]}O(_R,"lineToPolygon");async function Pkt(t,e,r,n,i=r.class.padding??12){const a=n?0:3,o=t.insert("g").attr("class",an(e)).attr("id",e.domId||e.id);let s=null,l=null,u=null,h=null,d=0,f=0,p=0;if(s=o.insert("g").attr("class","annotation-group text"),e.annotations.length>0){const b=e.annotations[0];await n$(s,{text:`«${b}»`},0),d=s.node().getBBox().height}l=o.insert("g").attr("class","label-group text"),await n$(l,e,0,["font-weight: bolder"]);const g=l.node().getBBox();f=g.height,u=o.insert("g").attr("class","members-group text");let m=0;for(const b of e.members){const x=await n$(u,b,m,[b.parseClassifier()]);m+=x+a}p=u.node().getBBox().height,p<=0&&(p=i/2),h=o.insert("g").attr("class","methods-group text");let v=0;for(const b of e.methods){const x=await n$(h,b,v,[b.parseClassifier()]);v+=x+a}let y=o.node().getBBox();if(s!==null){const b=s.node().getBBox();s.attr("transform",`translate(${-b.width/2})`)}return l.attr("transform",`translate(${-g.width/2}, ${d})`),y=o.node().getBBox(),u.attr("transform",`translate(0, ${d+f+i*2})`),y=o.node().getBBox(),h.attr("transform",`translate(0, ${d+f+(p?p+i*4:i*2)})`),y=o.node().getBBox(),{shapeSvg:o,bbox:y}}O(Pkt,"textHelper");async function n$(t,e,r,n=[]){const i=t.insert("g").attr("class","label").attr("style",n.join("; ")),a=Dr();let o="useHtmlLabels"in e?e.useHtmlLabels:p0(a.htmlLabels)??!0,s="";"text"in e?s=e.text:s=e.label,!o&&s.startsWith("\\")&&(s=s.substring(1)),ps(s)&&(o=!0);const l=await su(i,V1e(o1(s)),{width:Uu(s,a)+50,classes:"markdown-node-label",useHtmlLabels:o},a);let u,h=1;if(o){const d=l.children[0],f=_t(l);h=d.innerHTML.split("
").length,d.innerHTML.includes("")&&(h+=d.innerHTML.split("").length-1);const p=d.getElementsByTagName("img");if(p){const g=s.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)}O(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")&&_t(l).selectAll("tspan").attr("font-weight",""),h=l.children.length;const d=l.children[0];(l.textContent===""||l.textContent.includes(">"))&&(d.textContent=s[0]+s.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),s[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}O(n$,"addText");async function Nkt(t,e){var R,D;const r=Ye(),{themeVariables:n}=r,{useGradient:i}=n,a=r.class.padding??12,o=a,s=e.useHtmlLabels??p0(r.htmlLabels)??!0,l=e;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:u,bbox:h}=await Pkt(t,e,r,s,o),{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+=o:l.members.length>0&&l.methods.length===0&&(b+=o*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),C=u.insert(()=>T,":first-child");C.attr("class","basic label-container outer-path");const k=C.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,P=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,I,N)=>{var Q,G;const F=_t(N[I]),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 q=Math.max(P,o/2);x?z=Math.max(L,E+_+q+A+o*2+a)+o*2:z=E+_+q+A+o*4+a}l.members.length===0&&l.methods.length===0&&((Q=r.class)!=null&&Q.hideEmptyMembersBox)&&(l.annotations.length>0?z=V-o:z=V),s||(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(q,Y,ne){window.getComputedStyle(ne[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,I=m.line(k.x,M,k.x+k.width,M+.001,v);u.insert(()=>I).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+_+P+A+o*2+a,I=m.line(k.x,x?Math.max(L,M):M,k.x+k.width,(x?Math.max(L,M):M)+.001,v);u.insert(()=>I).attr("class",`divider${e.look==="neo"&&!i?" neo-line":""}`).attr("style",p)}if(l.look!=="handDrawn"&&u.selectAll("path").attr("style",p),C.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),!s){const M=RegExp(/color\s*:\s*([^;]*)/),I=M.exec(p);if(I){const N=I[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 Br(e,C),e.intersect=function(M){return Sr.rect(e,M)},u}O(Nkt,"classBox");async function Bkt(t,e){var k,E;const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const i=e,a=e,o=20,s=20,l="verifyMethod"in e,u=an(e),{themeVariables:h}=Ye(),{borderColorArray:d,requirementEdgeLabelBackground:f}=h,p=t.insert("g").attr("class",u).attr("id",e.domId??e.id);let g;l?g=await w0(p,`<<${i.type}>>`,0,e.labelStyle):g=await w0(p,"<<Element>>",0,e.labelStyle);let m=g;const v=await w0(p,i.name,m,e.labelStyle+"; font-weight: bold;");if(m+=v+s,l){const _=await w0(p,`${i.requirementId?`ID: ${i.requirementId}`:""}`,m,e.labelStyle);m+=_;const P=await w0(p,`${i.text?`Text: ${i.text}`:""}`,m,e.labelStyle);m+=P;const L=await w0(p,`${i.risk?`Risk: ${i.risk}`:""}`,m,e.labelStyle);m+=L,await w0(p,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:""}`,m,e.labelStyle)}else{const _=await w0(p,`${a.type?`Type: ${a.type}`:""}`,m,e.labelStyle);m+=_,await w0(p,`${a.docRef?`Doc Ref: ${a.docRef}`:""}`,m,e.labelStyle)}const y=(((k=p.node())==null?void 0:k.getBBox().width)??200)+o,b=(((E=p.node())==null?void 0:E.getBBox().height)??200)+o,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),C=p.insert(()=>T,":first-child");if(C.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((_,P,L)=>{const R=_t(L[P]),D=R.attr("transform");let M=0,I=0;if(D){const V=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(D);V&&(M=parseFloat(V[1]),I=parseFloat(V[2]))}const N=I-b/2;let F=x+o/2;(P===0||P===1)&&(F=M),R.attr("transform",`translate(${F}, ${N+o})`)}),m>g+v+s){const _=w+g+v+s;let P;if(e.look==="neo"){const D=[[x,_],[x+y,_],[x+y,_+.001],[x,_+.001]];P=A.polygon(D,S)}else P=A.line(x,_,x+y,_,S);p.insert(()=>P).attr("class","divider")}return Br(e,C),e.intersect=function(_){return Sr.rect(e,_)},n&&e.look!=="handDrawn"&&(f||d!=null&&d.length)&&p.selectAll("path").attr("style",n),p}O(Bkt,"requirementBox");async function w0(t,e,r,n=""){if(e==="")return 0;const i=t.insert("g").attr("class","label").attr("style",n),a=Ye(),o=a.htmlLabels??!0,s=await su(i,V1e(o1(e)),{width:Uu(e,a)+50,classes:"markdown-node-label",useHtmlLabels:o,style:n},a);let l;if(o){const u=s.children[0],h=_t(s);l=u.getBoundingClientRect(),h.attr("width",l.width),h.attr("height",l.height)}else{const u=s.children[0];for(const h of u.children)n&&h.setAttribute("style",n);l=s.getBBox(),l.height+=6}return i.attr("transform",`translate(${-l.width/2},${-l.height/2+r})`),l.height}O(w0,"addText");var Rfn=O(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 $kt(t,e,{config:r}){var P,L;const{labelStyles:n,nodeStyles:i}=Or(e);e.labelStyle=n||"";const a=10,o=e.width;e.width=(e.width??200)-10;const{shapeSvg:s,bbox:l,label:u}=await gn(t,e,an(e)),h=e.padding||10;let d="",f;"ticket"in e&&e.ticket&&((P=r==null?void 0:r.kanban)!=null&&P.ticketBaseUrl)&&(d=(L=r==null?void 0:r.kanban)==null?void 0:L.ticketBaseUrl.replace("#TICKET#",e.ticket),f=s.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 qxe(f,"ticket"in e&&e.ticket||"",p):{label:g,bbox:m}=await qxe(s,"ticket"in e&&e.ticket||"",p);const{label:v,bbox:y}=await qxe(s,"assigned"in e&&e.assigned||"",p);e.width=o;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 C;const{rx:k,ry:E}=e,{cssStyles:_}=e;if(e.look==="handDrawn"){const R=Er.svg(s),D=_r(e,{}),M=k||E?R.path(S2(S,T,x,A,k||0),D):R.rectangle(S,T,x,A,D);C=s.insert(()=>M,":first-child"),C.attr("class","basic label-container").attr("style",_||null)}else{C=s.insert("rect",":first-child"),C.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=s.append("line"),M=S+2,I=T+Math.floor((k??0)/2),N=T+A-Math.floor((k??0)/2);D.attr("x1",M).attr("y1",I).attr("x2",M).attr("y2",N).attr("stroke-width","4").attr("stroke",Rfn(R))}}return Br(e,C),e.height=A,e.intersect=function(R){return Sr.rect(e,R)},s}O($kt,"kanbanItem");async function Fkt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await gn(t,e,an(e)),l=a.width+10*o,u=a.height+8*o,h=.15*l,{cssStyles:d}=e,f=a.width+20,p=a.height+20,g=Math.max(l,f),m=Math.max(u,p);s.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 @@ -641,7 +641,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",Fl(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})`),Br(e,v),e.calcIntersect=function(b,x){return Sr.rect(b,x)},e.intersect=function(b){return ye.info("Bang intersect",e,b),Sr.rect(e,b)},i}O(Bkt,"bang");async function $kt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await gn(t,e,an(e)),l=a.width+2*o,u=a.height+2*o,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",Fl(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})`),Br(e,v),e.calcIntersect=function(b,x){return Sr.rect(b,x)},e.intersect=function(b){return ye.info("Bang intersect",e,b),Sr.rect(e,b)},i}O(Fkt,"bang");async function zkt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await gn(t,e,an(e)),l=a.width+2*o,u=a.height+2*o,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} @@ -655,7 +655,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",Fl(g))}else m=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return s.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),m.attr("transform",`translate(${-l/2}, ${-u/2})`),Br(e,m),e.calcIntersect=function(y,b){return Sr.rect(y,b)},e.intersect=function(y){return ye.info("Cloud intersect",e,y),Sr.rect(e,y)},i}O($kt,"cloud");async function Fkt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await gn(t,e,an(e)),l=a.width+8*o,u=a.height+2*o,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",Fl(g))}else m=i.insert("path",":first-child").attr("class","basic label-container").attr("style",n).attr("d",v);return s.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),m.attr("transform",`translate(${-l/2}, ${-u/2})`),Br(e,m),e.calcIntersect=function(y,b){return Sr.rect(y,b)},e.intersect=function(y){return ye.info("Cloud intersect",e,y),Sr.rect(e,y)},i}O(zkt,"cloud");async function Ukt(t,e){const{labelStyles:r,nodeStyles:n}=Or(e);e.labelStyle=r;const{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await gn(t,e,an(e)),l=a.width+8*o,u=a.height+2*o,h=5,d=e.look==="neo"?` M${-l/2} ${u/2-h} v${-u+2*h} q0,-${h} ${h},-${h} @@ -675,39 +675,39 @@ 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),s.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>s.node()),Br(e,f),e.calcIntersect=function(p,g){return Sr.rect(p,g)},e.intersect=function(p){return Sr.rect(e,p)},i}O(Fkt,"defaultMindmapNode");async function zkt(t,e){const r={padding:e.padding??0};return Zxe(t,e,r)}O(zkt,"mindmapCircle");var _fn=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:dkt},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:ckt},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:fkt},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:vkt},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:DOt},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:LOt},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Zxe},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Bkt},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:$kt},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:okt},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:UOt},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:KOt},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:XOt},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:Tkt},{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:qOt},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:IOt},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:xkt},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:wOt},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:ukt},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:mkt},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:gkt},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:FOt},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:VOt},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:COt},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:OOt},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:kOt},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:ZOt},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:_kt},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:zOt},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Skt},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:tkt},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:EOt},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:MOt},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:Ekt},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Dkt},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:POt},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:Ckt},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:$Ot},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:hkt},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:ikt},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:nkt},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:xOt},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:TOt},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:bkt},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:ykt},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:Rkt},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:skt},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:rkt}],Rfn=O(()=>{const e=[...Object.entries({state:pkt,choice:AOt,note:akt,rectWithTitle:lkt,labelRect:jOt,iconSquare:WOt,iconCircle:GOt,icon:QOt,iconRounded:HOt,imageSquare:YOt,anchor:yOt,kanbanItem:Nkt,mindmapCircle:zkt,defaultMindmapNode:Fkt,classBox:Ikt,erBox:e2e,requirementBox:Pkt}),..._fn.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),Ukt=Rfn();function Vkt(t){return t in Ukt}O(Vkt,"isValidShape");var eK=new Map;async function i$(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?Ukt[e.shape]:void 0;if(!a)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let o;r.config.securityLevel==="sandbox"?o="_top":e.linkTarget&&(o=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",o??null),i=await a(n,e,r)}else i=await a(t,e,r),n=i;return n.attr("data-look",Fl(e.look)),e.tooltip&&i.attr("title",e.tooltip),eK.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}O(i$,"insertNode");var Dfn=O((t,e)=>{eK.set(e.id,t)},"setNodeElem"),Qkt=O(()=>{eK.clear()},"clear"),tK=O(t=>{const e=eK.get(t.id);ye.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"),A0=O((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"),zl={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},Gkt={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function a$(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=wo(t),e=wo(e);const[r,n]=[t.x,t.y],[i,a]=[e.x,e.y],o=i-r,s=a-n;return{angle:Math.atan(s/o),deltaX:o,deltaY:s}}O(a$,"calculateDeltaAndAngle");var wo=O(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),Hkt=O(t=>({x:O(function(e,r,n){let i=0;const a=wo(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(zl,t.arrowTypeEnd)){const{angle:p,deltaX:g}=a$(n[n.length-1],n[n.length-2]);i=zl[t.arrowTypeEnd]*Math.cos(p)*(g>=0?1:-1)}const o=Math.abs(wo(e).x-wo(n[n.length-1]).x),s=Math.abs(wo(e).y-wo(n[n.length-1]).y),l=Math.abs(wo(e).x-wo(n[0]).x),u=Math.abs(wo(e).y-wo(n[0]).y),h=zl[t.arrowTypeStart],d=zl[t.arrowTypeEnd],f=1;if(o0&&s0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(zl,t.arrowTypeEnd)){const{angle:p,deltaY:g}=a$(n[n.length-1],n[n.length-2]);i=zl[t.arrowTypeEnd]*Math.abs(Math.sin(p))*(g>=0?1:-1)}const o=Math.abs(wo(e).y-wo(n[n.length-1]).y),s=Math.abs(wo(e).x-wo(n[n.length-1]).x),l=Math.abs(wo(e).y-wo(n[0]).y),u=Math.abs(wo(e).x-wo(n[0]).x),h=zl[t.arrowTypeStart],d=zl[t.arrowTypeEnd],f=1;if(o0&&s0&&u{e.arrowTypeStart&&Wkt(t,"start",e.arrowTypeStart,r,n,i,a,o),e.arrowTypeEnd&&Wkt(t,"end",e.arrowTypeEnd,r,n,i,a,o)},"addEdgeMarkers"),Mfn={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}},Ifn=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],Wkt=O((t,e,r,n,i,a,o=!1,s)=>{var g;const l=Mfn[r],u=l&&Ifn.includes(l.type);if(!l){ye.warn(`Unknown arrow type: ${r}`);return}const h=l.type,p=`${i}_${a}-${h}${e==="start"?"Start":"End"}${o&&u?"-margin":""}`;if(s&&s.trim()!==""){const m=s.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",s),l.fill&&w.setAttribute("fill",s)}),(g=y.parentNode)==null||g.appendChild(b)}}t.attr(`marker-${e}`,`url(${n}#${v})`)}else t.attr(`marker-${e}`,`url(${n}#${p})`)},"addEdgeMarker"),Pfn=O(t=>{var e,r;return typeof t=="string"?t:(r=(e=Ye())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),o$=new Map,vs=new Map,Ykt=O(()=>{o$.clear(),vs.clear()},"clear"),s$=O(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),rK=O(async(t,e)=>{const r=Ye();let n=na(r);const{labelStyles:i}=Or(e);e.labelStyle=i;const a=t.insert("g").attr("class","edgeLabel"),o=a.insert("g").attr("class","label").attr("data-id",e.id),s=e.labelType==="markdown",u=await su(t,e.label,{style:s$(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:s,width:s?void 0:void 0},r);o.node().appendChild(u),ye.info("abc82",e,e.labelType);let h=u.getBBox(),d=h;if(n){const p=u.children[0],g=_t(u);h=p.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const p=_t(u).select("text").node();p&&typeof p.getBBox=="function"&&(d=p.getBBox())}o.attr("transform",A0(d,n)),o$.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 A2(g,e.startLabelLeft,s$(e.labelStyle)||"",!1,!1);f=m;let v=m.getBBox();if(n){const y=m.children[0],b=_t(m);v=y.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",A0(v,n)),vs.get(e.id)||vs.set(e.id,{}),vs.get(e.id).startLeft=p,l$(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await A2(g,e.startLabelRight,s$(e.labelStyle)||"",!1,!1);f=m;let v=m.getBBox();if(n){const y=m.children[0],b=_t(m);v=y.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",A0(v,n)),vs.get(e.id)||vs.set(e.id,{}),vs.get(e.id).startRight=p,l$(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await A2(p,e.endLabelLeft,s$(e.labelStyle)||"",!1,!1);f=m;let v=m.getBBox();if(n){const y=m.children[0],b=_t(m);v=y.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",A0(v,n)),vs.get(e.id)||vs.set(e.id,{}),vs.get(e.id).endLeft=p,l$(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await A2(p,e.endLabelRight,s$(e.labelStyle)||"",!1,!1);f=m;let v=m.getBBox();if(n){const y=m.children[0],b=_t(m);v=y.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",A0(v,n)),vs.get(e.id)||vs.set(e.id,{}),vs.get(e.id).endRight=p,l$(f,e.endLabelRight)}return u},"insertEdgeLabel");function l$(t,e){na(Ye())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}O(l$,"setTerminalWidth");var qkt=O((t,e)=>{ye.debug("Moving label abc88 ",t.id,t.label,o$.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Ye(),{subGraphTitleTotalMargin:i}=TR(n);if(t.label){const a=o$.get(t.id);let o=t.x,s=t.y;if(r){const l=un.calcLabelPosition(r);ye.debug("Moving label "+t.label+" from (",o,",",s,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(o=l.x,s=l.y)}a.attr("transform",`translate(${o}, ${s+i/2})`)}if(t.startLabelLeft){const a=vs.get(t.id).startLeft;let o=t.x,s=t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(t.startLabelRight){const a=vs.get(t.id).startRight;let o=t.x,s=t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(t.endLabelLeft){const a=vs.get(t.id).endLeft;let o=t.x,s=t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(t.endLabelRight){const a=vs.get(t.id).endRight;let o=t.x,s=t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}},"positionEdgeLabel"),Nfn=O((t,e)=>{var o;if(!(t!=null&&t.isLabelEdge)||!((o=t==null?void 0:t.id)!=null&&o.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"),Bfn=O((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),o=t.width/2,s=t.height/2;return i>=o||a>=s},"outsideNode"),$fn=O((t,e,r)=>{ye.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),s.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>s.node()),Br(e,f),e.calcIntersect=function(p,g){return Sr.rect(p,g)},e.intersect=function(p){return Sr.rect(e,p)},i}O(Ukt,"defaultMindmapNode");async function Vkt(t,e){const r={padding:e.padding??0};return Zxe(t,e,r)}O(Vkt,"mindmapCircle");var Dfn=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:pkt},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:hkt},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:gkt},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:bkt},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:MOt},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:IOt},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Zxe},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Fkt},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:zkt},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:lkt},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:QOt},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:JOt},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:ZOt},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:Okt},{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:XOt},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:NOt},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:Akt},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:SOt},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:dkt},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:ykt},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:vkt},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:UOt},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:GOt},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:kOt},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:EOt},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:_Ot},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:ekt},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:Dkt},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:VOt},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Ckt},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:nkt},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:ROt},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:POt},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:Rkt},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Mkt},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:BOt},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:kkt},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:zOt},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:fkt},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:okt},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:akt},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:AOt},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:OOt},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:wkt},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:xkt},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:Lkt},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:ckt},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:ikt}],Lfn=O(()=>{const e=[...Object.entries({state:mkt,choice:TOt,note:skt,rectWithTitle:ukt,labelRect:KOt,iconSquare:qOt,iconCircle:WOt,icon:HOt,iconRounded:YOt,imageSquare:jOt,anchor:xOt,kanbanItem:$kt,mindmapCircle:Vkt,defaultMindmapNode:Ukt,classBox:Nkt,erBox:e2e,requirementBox:Bkt}),...Dfn.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(i=>[i,r.handler]))];return Object.fromEntries(e)},"generateShapeMap"),Qkt=Lfn();function Gkt(t){return t in Qkt}O(Gkt,"isValidShape");var eK=new Map;async function i$(t,e,r){let n,i;e.shape==="rect"&&(e.rx&&e.ry?e.shape="roundedRect":e.shape="squareRect");const a=e.shape?Qkt[e.shape]:void 0;if(!a)throw new Error(`No such shape: ${e.shape}. Please check your syntax.`);if(e.link){let o;r.config.securityLevel==="sandbox"?o="_top":e.linkTarget&&(o=e.linkTarget||"_blank"),n=t.insert("svg:a").attr("xlink:href",e.link).attr("target",o??null),i=await a(n,e,r)}else i=await a(t,e,r),n=i;return n.attr("data-look",Fl(e.look)),e.tooltip&&i.attr("title",e.tooltip),eK.set(e.id,n),e.haveCallback&&n.attr("class",n.attr("class")+" clickable"),n}O(i$,"insertNode");var Mfn=O((t,e)=>{eK.set(e.id,t)},"setNodeElem"),Hkt=O(()=>{eK.clear()},"clear"),tK=O(t=>{const e=eK.get(t.id);ye.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"),A0=O((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"),zl={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},Wkt={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function a$(t,e){if(t===void 0||e===void 0)return{angle:0,deltaX:0,deltaY:0};t=wo(t),e=wo(e);const[r,n]=[t.x,t.y],[i,a]=[e.x,e.y],o=i-r,s=a-n;return{angle:Math.atan(s/o),deltaX:o,deltaY:s}}O(a$,"calculateDeltaAndAngle");var wo=O(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),Ykt=O(t=>({x:O(function(e,r,n){let i=0;const a=wo(n[0]).x=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(zl,t.arrowTypeEnd)){const{angle:p,deltaX:g}=a$(n[n.length-1],n[n.length-2]);i=zl[t.arrowTypeEnd]*Math.cos(p)*(g>=0?1:-1)}const o=Math.abs(wo(e).x-wo(n[n.length-1]).x),s=Math.abs(wo(e).y-wo(n[n.length-1]).y),l=Math.abs(wo(e).x-wo(n[0]).x),u=Math.abs(wo(e).y-wo(n[0]).y),h=zl[t.arrowTypeStart],d=zl[t.arrowTypeEnd],f=1;if(o0&&s0&&u=0?1:-1)}else if(r===n.length-1&&Object.hasOwn(zl,t.arrowTypeEnd)){const{angle:p,deltaY:g}=a$(n[n.length-1],n[n.length-2]);i=zl[t.arrowTypeEnd]*Math.abs(Math.sin(p))*(g>=0?1:-1)}const o=Math.abs(wo(e).y-wo(n[n.length-1]).y),s=Math.abs(wo(e).x-wo(n[n.length-1]).x),l=Math.abs(wo(e).y-wo(n[0]).y),u=Math.abs(wo(e).x-wo(n[0]).x),h=zl[t.arrowTypeStart],d=zl[t.arrowTypeEnd],f=1;if(o0&&s0&&u{e.arrowTypeStart&&qkt(t,"start",e.arrowTypeStart,r,n,i,a,o),e.arrowTypeEnd&&qkt(t,"end",e.arrowTypeEnd,r,n,i,a,o)},"addEdgeMarkers"),Pfn={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}},Nfn=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],qkt=O((t,e,r,n,i,a,o=!1,s)=>{var g;const l=Pfn[r],u=l&&Nfn.includes(l.type);if(!l){ye.warn(`Unknown arrow type: ${r}`);return}const h=l.type,p=`${i}_${a}-${h}${e==="start"?"Start":"End"}${o&&u?"-margin":""}`;if(s&&s.trim()!==""){const m=s.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",s),l.fill&&w.setAttribute("fill",s)}),(g=y.parentNode)==null||g.appendChild(b)}}t.attr(`marker-${e}`,`url(${n}#${v})`)}else t.attr(`marker-${e}`,`url(${n}#${p})`)},"addEdgeMarker"),Bfn=O(t=>{var e,r;return typeof t=="string"?t:(r=(e=Ye())==null?void 0:e.flowchart)==null?void 0:r.curve},"resolveEdgeCurveType"),o$=new Map,vs=new Map,jkt=O(()=>{o$.clear(),vs.clear()},"clear"),s$=O(t=>t?typeof t=="string"?t:t.reduce((e,r)=>e+";"+r,""):"","getLabelStyles"),rK=O(async(t,e)=>{const r=Ye();let n=na(r);const{labelStyles:i}=Or(e);e.labelStyle=i;const a=t.insert("g").attr("class","edgeLabel"),o=a.insert("g").attr("class","label").attr("data-id",e.id),s=e.labelType==="markdown",u=await su(t,e.label,{style:s$(e.labelStyle),useHtmlLabels:n,addSvgBackground:!0,isNode:!1,markdown:s,width:s?void 0:void 0},r);o.node().appendChild(u),ye.info("abc82",e,e.labelType);let h=u.getBBox(),d=h;if(n){const p=u.children[0],g=_t(u);h=p.getBoundingClientRect(),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const p=_t(u).select("text").node();p&&typeof p.getBBox=="function"&&(d=p.getBBox())}o.attr("transform",A0(d,n)),o$.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 A2(g,e.startLabelLeft,s$(e.labelStyle)||"",!1,!1);f=m;let v=m.getBBox();if(n){const y=m.children[0],b=_t(m);v=y.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",A0(v,n)),vs.get(e.id)||vs.set(e.id,{}),vs.get(e.id).startLeft=p,l$(f,e.startLabelLeft)}if(e.startLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await A2(g,e.startLabelRight,s$(e.labelStyle)||"",!1,!1);f=m;let v=m.getBBox();if(n){const y=m.children[0],b=_t(m);v=y.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",A0(v,n)),vs.get(e.id)||vs.set(e.id,{}),vs.get(e.id).startRight=p,l$(f,e.startLabelRight)}if(e.endLabelLeft){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await A2(p,e.endLabelLeft,s$(e.labelStyle)||"",!1,!1);f=m;let v=m.getBBox();if(n){const y=m.children[0],b=_t(m);v=y.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",A0(v,n)),vs.get(e.id)||vs.set(e.id,{}),vs.get(e.id).endLeft=p,l$(f,e.endLabelLeft)}if(e.endLabelRight){const p=t.insert("g").attr("class","edgeTerminals"),g=p.insert("g").attr("class","inner"),m=await A2(p,e.endLabelRight,s$(e.labelStyle)||"",!1,!1);f=m;let v=m.getBBox();if(n){const y=m.children[0],b=_t(m);v=y.getBoundingClientRect(),b.attr("width",v.width),b.attr("height",v.height)}g.attr("transform",A0(v,n)),vs.get(e.id)||vs.set(e.id,{}),vs.get(e.id).endRight=p,l$(f,e.endLabelRight)}return u},"insertEdgeLabel");function l$(t,e){na(Ye())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}O(l$,"setTerminalWidth");var Xkt=O((t,e)=>{ye.debug("Moving label abc88 ",t.id,t.label,o$.get(t.id),e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Ye(),{subGraphTitleTotalMargin:i}=TR(n);if(t.label){const a=o$.get(t.id);let o=t.x,s=t.y;if(r){const l=un.calcLabelPosition(r);ye.debug("Moving label "+t.label+" from (",o,",",s,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(o=l.x,s=l.y)}a.attr("transform",`translate(${o}, ${s+i/2})`)}if(t.startLabelLeft){const a=vs.get(t.id).startLeft;let o=t.x,s=t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(t.startLabelRight){const a=vs.get(t.id).startRight;let o=t.x,s=t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(t.endLabelLeft){const a=vs.get(t.id).endLeft;let o=t.x,s=t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(t.endLabelRight){const a=vs.get(t.id).endRight;let o=t.x,s=t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}},"positionEdgeLabel"),$fn=O((t,e)=>{var o;if(!(t!=null&&t.isLabelEdge)||!((o=t==null?void 0:t.id)!=null&&o.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"),Ffn=O((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),o=t.width/2,s=t.height/2;return i>=o||a>=s},"outsideNode"),zfn=O((t,e,r)=>{ye.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),o=t.width/2;let s=r.xMath.abs(n-e.x)*l){let d=r.y{ye.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(ye.info("abc88 checking point",a,e),!Bfn(e,a)&&!i){const o=$fn(e,n,a);ye.debug("abc88 inside",a,n,o),ye.debug("abc88 intersection",o,e);let s=!1;r.forEach(l=>{s=s||l.x===o.x&&l.y===o.y}),r.some(l=>l.x===o.x&&l.y===o.y)?ye.warn("abc88 no intersect",o,r):r.push(o),i=!0}else ye.warn("abc88 outside",a,n),n=a,i||r.push(a)}),ye.debug("returning points",r),r},"cutPathAtIntersect");function Xkt(t){const e=[],r=[];for(let n=1;n5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===o.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-o.y)>5)&&(e.push(a),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}O(Xkt,"extractCornerPoints");var Kkt=O(function(t,e,r){const n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),o=r/a;return{x:e.x-o*n,y:e.y-o*i}},"findAdjacentPoint"),Ffn=O(function(t){const{cornerPointPositions:e}=Xkt(t),r=[];for(let n=0;n10&&Math.abs(a.y-i.y)>=10){ye.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));const p=5;o.x===s.x?f={x:u<0?s.x-p+d:s.x+p-d,y:h<0?s.y-d:s.y+d}:f={x:u<0?s.x-d:s.x+d,y:h<0?s.y-p+d:s.y+p-d}}else ye.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"),zfn=O((t,e,r)=>{const n=t-e-r,i=2,a=2,o=i+a,s=Math.floor(n/o),l=Array(s).fill(`${i} ${a}`).join(" ");return`0 ${e} ${l} ${r}`},"generateDashArray"),t2e=O(function(t,e,r,n,i,a,o,s=!1){var N;if(!o)throw new Error(`insertEdge: missing diagramId for edge "${e.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:u}=Ye();let h=e.points,d=!1;const f=i;var p=a;const g=[];for(const F in e.cssCompiledStyles)axe(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=Pfn(e.curve);y!=="rounded"&&(v=Ffn(v));let b=P7;switch(y){case"linear":b=P7;break;case"basis":b=B7;break;case"cardinal":b=TAt;break;case"bumpX":b=bAt;break;case"bumpY":b=xAt;break;case"catmullRom":b=OAt;break;case"monotoneX":b=PAt;break;case"monotoneY":b=NAt;break;case"natural":b=FAt;break;case"step":b=zAt;break;case"stepAfter":b=VAt;break;case"stepBefore":b=UAt;break;case"rounded":b=P7;break;default:b=B7}const{x,y:w}=Hkt(e),A=N7().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,C=y==="rounded"?Zkt(Jkt(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 P=!1;if(e.look==="handDrawn"){const F=Er.svg(t);Object.assign([],v);const B=F.path(C,{roughness:.3,seed:l});S+=" transition",T=_t(B).select("path").attr("id",`${o}-${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((q,Y)=>q+Y+";",""):"",V=(F?F+";"+B+";":B)+";"+(k?k.reduce((q,Y)=>q+";"+Y,""):"");T=t.append("path").attr("d",C).attr("id",`${o}-${e.id}`).attr("class"," "+S+(e.classes?" "+e.classes:"")+(_?" "+_:"")).attr("style",V),E=(N=V.match(/stroke:([^;]+)/))==null?void 0:N[1],P=e.animate===!0||!!e.animation||F.includes("animation");const z=T.node(),U=typeof z.getTotalLength=="function"?z.getTotalLength():0,Q=Gkt[e.arrowTypeStart]||0,G=Gkt[e.arrowTypeEnd]||0;if(e.look==="neo"&&!P){const Y=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?zfn(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",Fl(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="";(Ye().flowchart.arrowMarkerAbsolute||Ye().state.arrowMarkerAbsolute)&&(L=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,L=L.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),ye.info("arrowTypeStart",e.arrowTypeStart),ye.info("arrowTypeEnd",e.arrowTypeEnd);const R=!P&&(e==null?void 0:e.look)==="neo";Lfn(T,e,L,o,n,R,E);const D=Math.floor(h.length/2),M=h[D];un.isLabelCoordinateInPath(M,T.attr("d"))||(d=!0);let I={};return d&&(I.updatedPath=h),I.originalPath=e.points,I},"insertEdge");function Zkt(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&&zl[e.arrowTypeStart]){const i=zl[e.arrowTypeStart],a=t[0],o=t[1],{angle:s}=r2e(a,o),l=i*Math.cos(s),u=i*Math.sin(s);r[0].x=a.x+l,r[0].y=a.y+u}const n=t.length;if(n>=2&&zl[e.arrowTypeEnd]){const i=zl[e.arrowTypeEnd],a=t[n-1],o=t[n-2],{angle:s}=r2e(o,a),l=i*Math.cos(s),u=i*Math.sin(s);r[n-1].x=a.x-l,r[n-1].y=a.y-u}return r}O(Jkt,"applyMarkerOffsetsToPoints");var Ufn=O((t,e,r,n)=>{e.forEach(i=>{upn[i](t,r,n)})},"insertMarkers"),Vfn=O((t,e,r)=>{ye.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"),Qfn=O((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"),Gfn=O((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"),Hfn=O((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"),Wfn=O((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"),Yfn=O((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"),qfn=O((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"),jfn=O((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"),Xfn=O((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"),Kfn=O((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"),Zfn=O((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"),Jfn=O((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"),epn=O((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"),tpn=O((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"),rpn=O((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"),npn=O((t,e,r)=>{const n=Dr(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:o}=i,s=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");s.append("circle").attr("fill",o??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),s.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",o??"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"),ipn=O((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"),apn=O((t,e,r)=>{const n=Dr(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:o}=i,s=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");s.append("circle").attr("fill",o??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),s.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",o??"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"),opn=O((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),o=t.width/2;let s=r.xMath.abs(n-e.x)*l){let d=r.y{ye.warn("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(ye.info("abc88 checking point",a,e),!Ffn(e,a)&&!i){const o=zfn(e,n,a);ye.debug("abc88 inside",a,n,o),ye.debug("abc88 intersection",o,e);let s=!1;r.forEach(l=>{s=s||l.x===o.x&&l.y===o.y}),r.some(l=>l.x===o.x&&l.y===o.y)?ye.warn("abc88 no intersect",o,r):r.push(o),i=!0}else ye.warn("abc88 outside",a,n),n=a,i||r.push(a)}),ye.debug("returning points",r),r},"cutPathAtIntersect");function Zkt(t){const e=[],r=[];for(let n=1;n5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===o.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-o.y)>5)&&(e.push(a),r.push(n))}return{cornerPoints:e,cornerPointPositions:r}}O(Zkt,"extractCornerPoints");var Jkt=O(function(t,e,r){const n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),o=r/a;return{x:e.x-o*n,y:e.y-o*i}},"findAdjacentPoint"),Ufn=O(function(t){const{cornerPointPositions:e}=Zkt(t),r=[];for(let n=0;n10&&Math.abs(a.y-i.y)>=10){ye.debug("Corner point fixing",Math.abs(a.x-i.x),Math.abs(a.y-i.y));const p=5;o.x===s.x?f={x:u<0?s.x-p+d:s.x+p-d,y:h<0?s.y-d:s.y+d}:f={x:u<0?s.x-d:s.x+d,y:h<0?s.y-p+d:s.y+p-d}}else ye.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"),Vfn=O((t,e,r)=>{const n=t-e-r,i=2,a=2,o=i+a,s=Math.floor(n/o),l=Array(s).fill(`${i} ${a}`).join(" ");return`0 ${e} ${l} ${r}`},"generateDashArray"),t2e=O(function(t,e,r,n,i,a,o,s=!1){var N;if(!o)throw new Error(`insertEdge: missing diagramId for edge "${e.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:u}=Ye();let h=e.points,d=!1;const f=i;var p=a;const g=[];for(const F in e.cssCompiledStyles)axe(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=Bfn(e.curve);y!=="rounded"&&(v=Ufn(v));let b=P7;switch(y){case"linear":b=P7;break;case"basis":b=B7;break;case"cardinal":b=OAt;break;case"bumpX":b=wAt;break;case"bumpY":b=AAt;break;case"catmullRom":b=EAt;break;case"monotoneX":b=BAt;break;case"monotoneY":b=$At;break;case"natural":b=UAt;break;case"step":b=VAt;break;case"stepAfter":b=GAt;break;case"stepBefore":b=QAt;break;case"rounded":b=P7;break;default:b=B7}const{x,y:w}=Ykt(e),A=N7().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,C=y==="rounded"?eEt(tEt(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 P=!1;if(e.look==="handDrawn"){const F=Er.svg(t);Object.assign([],v);const B=F.path(C,{roughness:.3,seed:l});S+=" transition",T=_t(B).select("path").attr("id",`${o}-${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((q,Y)=>q+Y+";",""):"",V=(F?F+";"+B+";":B)+";"+(k?k.reduce((q,Y)=>q+";"+Y,""):"");T=t.append("path").attr("d",C).attr("id",`${o}-${e.id}`).attr("class"," "+S+(e.classes?" "+e.classes:"")+(_?" "+_:"")).attr("style",V),E=(N=V.match(/stroke:([^;]+)/))==null?void 0:N[1],P=e.animate===!0||!!e.animation||F.includes("animation");const z=T.node(),U=typeof z.getTotalLength=="function"?z.getTotalLength():0,Q=Wkt[e.arrowTypeStart]||0,G=Wkt[e.arrowTypeEnd]||0;if(e.look==="neo"&&!P){const Y=`stroke-dasharray: ${e.pattern==="dotted"||e.pattern==="dashed"?Vfn(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",Fl(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="";(Ye().flowchart.arrowMarkerAbsolute||Ye().state.arrowMarkerAbsolute)&&(L=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,L=L.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),ye.info("arrowTypeStart",e.arrowTypeStart),ye.info("arrowTypeEnd",e.arrowTypeEnd);const R=!P&&(e==null?void 0:e.look)==="neo";Ifn(T,e,L,o,n,R,E);const D=Math.floor(h.length/2),M=h[D];un.isLabelCoordinateInPath(M,T.attr("d"))||(d=!0);let I={};return d&&(I.updatedPath=h),I.originalPath=e.points,I},"insertEdge");function eEt(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&&zl[e.arrowTypeStart]){const i=zl[e.arrowTypeStart],a=t[0],o=t[1],{angle:s}=r2e(a,o),l=i*Math.cos(s),u=i*Math.sin(s);r[0].x=a.x+l,r[0].y=a.y+u}const n=t.length;if(n>=2&&zl[e.arrowTypeEnd]){const i=zl[e.arrowTypeEnd],a=t[n-1],o=t[n-2],{angle:s}=r2e(o,a),l=i*Math.cos(s),u=i*Math.sin(s);r[n-1].x=a.x-l,r[n-1].y=a.y-u}return r}O(tEt,"applyMarkerOffsetsToPoints");var Qfn=O((t,e,r,n)=>{e.forEach(i=>{dpn[i](t,r,n)})},"insertMarkers"),Gfn=O((t,e,r)=>{ye.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"),Hfn=O((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"),Wfn=O((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"),Yfn=O((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"),qfn=O((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"),jfn=O((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"),Xfn=O((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"),Kfn=O((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"),Zfn=O((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"),Jfn=O((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"),epn=O((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"),tpn=O((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"),rpn=O((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"),npn=O((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"),ipn=O((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"),apn=O((t,e,r)=>{const n=Dr(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:o}=i,s=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");s.append("circle").attr("fill",o??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),s.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",o??"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"),opn=O((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"),spn=O((t,e,r)=>{const n=Dr(),{themeVariables:i}=n,{strokeWidth:a,mainBkg:o}=i,s=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");s.append("circle").attr("fill",o??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),s.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",o??"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"),lpn=O((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"),spn=O((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 + L0,20`)},"requirement_arrow"),cpn=O((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"),lpn=O((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"),cpn=O((t,e,r)=>{const n=Dr(),{themeVariables:i}=n,{strokeWidth:a}=i,o=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");o.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),o.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),o.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),o.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),upn={extension:Vfn,composition:Qfn,aggregation:Gfn,dependency:Hfn,lollipop:Wfn,point:Yfn,circle:qfn,cross:jfn,barb:Xfn,barbNeo:Kfn,only_one:Zfn,zero_or_one:Jfn,one_or_more:epn,zero_or_more:tpn,only_one_neo:rpn,zero_or_one_neo:npn,one_or_more_neo:ipn,zero_or_more_neo:apn,requirement_arrow:opn,requirement_contains:lpn,requirement_arrow_neo:spn,requirement_contains_neo:cpn},n2e=Ufn,hpn={common:Xt,getConfig:Dr,insertCluster:ZX,insertEdge:t2e,insertEdgeLabel:rK,insertMarkers:n2e,insertNode:i$,interpolateToCurve:mxe,labelHelper:gn,log:ye,positionEdgeLabel:qkt},c$={},eEt=O(t=>{for(const e of t)c$[e.name]=e},"registerLayoutLoaders"),dpn=O(()=>{eEt([{name:"dagre",loader:O(async()=>await Promise.resolve().then(()=>iPn),"loader")},{name:"swimlane",loader:O(async()=>await Promise.resolve().then(()=>mPn),"loader")},{name:"cose-bilkent",loader:O(async()=>await Promise.resolve().then(()=>rFn),"loader")}])},"registerDefaultLayoutLoaders");dpn();var RR=O(async(t,e,r)=>{if(!(t.layoutAlgorithm in c$))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=c$[t.layoutAlgorithm],i=await n.loader(),{theme:a,themeVariables:o}=t.config,{useGradient:s,gradientStart:l,gradientStop:u}=o,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"}`),s){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,hpn,{algorithm:n.algorithm},r)},"render"),u$=O((t="",{fallback:e="dagre"}={})=>{if(t in c$)return t;if(e in c$)return ye.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"),i2e="comm",tEt="rule",rEt="decl",fpn="@media",ppn="@import",gpn="@supports",mpn="@namespace",a2e="@keyframes",nEt="@layer",vpn="@scope",ypn=Math.abs,h$=String.fromCharCode;function iEt(t){return t.trim()}function o2e(t,e,r){return t.replace(e,r)}function DR(t,e){return t.charCodeAt(e)|0}function LR(t,e,r){return t.slice(e,r)}function S0(t){return t.length}function aEt(t){return t.length}function nK(t,e){return e.push(t),t}var iK=1,MR=1,oEt=0,vp=0,Fs=0,IR="";function s2e(t,e,r,n,i,a,o,s){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:iK,column:MR,length:o,return:"",siblings:s}}function bpn(){return Fs}function xpn(){return Fs=vp>0?DR(IR,--vp):0,MR--,Fs===10&&(MR=1,iK--),Fs}function Dg(){return Fs=vp2||d$(Fs)>3?"":" "}function Tpn(t,e){for(;--e&&Dg()&&!(Fs<48||Fs>102||Fs>57&&Fs<65||Fs>70&&Fs<97););return oK(t,aK()+(e<6&&T2()==32&&Dg()==32))}function c2e(t){for(;Dg();)switch(Fs){case t:return vp;case 34:case 39:t!==34&&t!==39&&c2e(Fs);break;case 40:t===41&&c2e(t);break;case 92:Dg();break}return vp}function Cpn(t,e){for(;Dg()&&t+Fs!==57;)if(t+Fs===84&&T2()===47)break;return"/*"+oK(e,vp-1)+"*"+h$(t===47?t:Dg())}function Opn(t){for(;!d$(T2());)Dg();return oK(t,vp)}function kpn(t){return Apn(sK("",null,null,null,[""],t=wpn(t),0,[0],t))}function sK(t,e,r,n,i,a,o,s,l){for(var u=0,h=0,d=o,f=0,p=0,g=0,m=1,v=1,y=1,b=0,x=0,w="",A=i,S=a,T=n,C=w;v;)switch(g=x,x=Dg()){case 40:g!=108&&DR(C,d-1)==58?(b++,C+="("):C+=l2e(x);break;case 41:b--,C+=")";break;case 34:case 39:case 91:C+=l2e(x);break;case 9:case 10:case 13:case 32:if(b>0){C+=h$(x);break}C+=Spn(g);break;case 92:C+=Tpn(aK()-1,7);continue;case 47:switch(T2()){case 42:case 47:nK(Epn(Cpn(Dg(),aK()),e,r,l),l),(d$(g||1)==5||d$(T2()||1)==5)&&S0(C)&&LR(C,-1,void 0)!==" "&&(C+=" ");break;default:C+="/"}break;case 123*m:s[u++]=S0(C)*y;case 125*m:case 59:case 0:if(b>0&&x){C+=h$(x);break}switch(x){case 0:case 125:v=0;case 59+h:y==-1&&(C=o2e(C,/\f/g,"")),p>0&&(S0(C)-d||m===0)&&nK(p>32?lEt(C+";",n,r,d-1,l):lEt(o2e(C," ","")+";",n,r,d-2,l),l);break;case 59:C+=";";default:if(nK(T=sEt(C,e,r,u,h,i,s,w,A=[],S=[],d,a),a),x===123)if(h===0)sK(C,e,T,T,A,a,d,s,S);else{switch(f){case 99:if(DR(C,3)===110)break;case 108:if(DR(C,2)===97)break;default:h=0;case 100:case 109:case 115:}h?sK(t,T,T,n&&nK(sEt(t,T,T,0,0,i,s,w,i,A=[],d,S),S),i,S,d,s,n?A:S):sK(C,T,T,T,[""],S,0,s,S)}}u=h=p=0,m=y=1,w=C="",d=o;break;case 58:d=1+S0(C),p=g;default:if(m<1){if(x==123)--m;else if(x==125&&m++==0&&xpn()==125)continue}switch(C+=h$(x),x*m){case 38:y=h>0?1:(C+="\f",-1);break;case 44:if(b>0)break;s[u++]=(S0(C)-1)*y,y=1;break;case 64:T2()===45&&(C+=l2e(Dg())),f=T2(),h=d=S0(w=C+=Opn(aK())),x++;break;case 45:g===45&&S0(C)==2&&(m=0)}}return a}function sEt(t,e,r,n,i,a,o,s,l,u,h,d){for(var f=i-1,p=i===0?a:[""],g=aEt(p),m=0,v=0,y=0;m0?p[b]+" "+x:o2e(x,/&\f/g,p[b])))&&(l[y++]=w);return s2e(t,e,r,i===0?tEt:s,l,u,h,d)}function Epn(t,e,r,n){return s2e(t,e,r,i2e,h$(bpn()),LR(t,2,-2),0,n)}function lEt(t,e,r,n,i){return s2e(t,e,r,rEt,LR(t,0,n),LR(t,n+1,-1),n,i)}function u2e(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),Lpn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>KFn);return{id:cEt,diagram:t}},"loader"),Mpn={id:cEt,detector:Dpn,loader:Lpn},Ipn=Mpn,uEt="flowchart",Ppn=O((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"),Npn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>s_e);return{id:uEt,diagram:t}},"loader"),Bpn={id:uEt,detector:Ppn,loader:Npn},$pn=Bpn,hEt="flowchart-v2",Fpn=O((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"),zpn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>s_e);return{id:hEt,diagram:t}},"loader"),Upn={id:hEt,detector:Fpn,loader:zpn},Vpn=Upn,dEt="swimlane",Qpn=O(t=>/^\s*swimlane-beta\b/.test(t),"detector"),Gpn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>d9n);return{id:dEt,diagram:t}},"loader"),Hpn={id:dEt,detector:Qpn,loader:Gpn},Wpn=Hpn,fEt="er",Ypn=O(t=>/^\s*erDiagram/.test(t),"detector"),qpn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>x9n);return{id:fEt,diagram:t}},"loader"),jpn={id:fEt,detector:Ypn,loader:qpn},Xpn=jpn,pEt="gitGraph",Kpn=O(t=>/^\s*gitGraph/.test(t),"detector"),Zpn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Sei);return{id:pEt,diagram:t}},"loader"),Jpn={id:pEt,detector:Kpn,loader:Zpn},egn=Jpn,gEt="gantt",tgn=O(t=>/^\s*gantt/.test(t),"detector"),rgn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Sti);return{id:gEt,diagram:t}},"loader"),ngn={id:gEt,detector:tgn,loader:rgn},ign=ngn,mEt="info",agn=O(t=>/^\s*info/.test(t),"detector"),ogn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Dti);return{id:mEt,diagram:t}},"loader"),sgn={id:mEt,detector:agn,loader:ogn},vEt="pie",lgn=O(t=>/^\s*pie/.test(t),"detector"),cgn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>qti);return{id:vEt,diagram:t}},"loader"),ugn={id:vEt,detector:lgn,loader:cgn},yEt="quadrantChart",hgn=O(t=>/^\s*quadrantChart/.test(t),"detector"),dgn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>rri);return{id:yEt,diagram:t}},"loader"),fgn={id:yEt,detector:hgn,loader:dgn},pgn=fgn,bEt="xychart",ggn=O(t=>/^\s*xychart(-beta)?/.test(t),"detector"),mgn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>vri);return{id:bEt,diagram:t}},"loader"),vgn={id:bEt,detector:ggn,loader:mgn},ygn=vgn,xEt="requirement",bgn=O(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),xgn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Cri);return{id:xEt,diagram:t}},"loader"),wgn={id:xEt,detector:bgn,loader:xgn},Agn=wgn,wEt="sequence",Sgn=O(t=>/^\s*sequenceDiagram/.test(t),"detector"),Tgn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>xni);return{id:wEt,diagram:t}},"loader"),Cgn={id:wEt,detector:Sgn,loader:Tgn},Ogn=Cgn,AEt="class",kgn=O((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"),Egn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Oni);return{id:AEt,diagram:t}},"loader"),_gn={id:AEt,detector:kgn,loader:Egn},Rgn=_gn,SEt="classDiagram",Dgn=O((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"),Lgn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Eni);return{id:SEt,diagram:t}},"loader"),Mgn={id:SEt,detector:Dgn,loader:Lgn},Ign=Mgn,TEt="state",Pgn=O((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"),Ngn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>vii);return{id:TEt,diagram:t}},"loader"),Bgn={id:TEt,detector:Pgn,loader:Ngn},$gn=Bgn,CEt="stateDiagram",Fgn=O((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"),zgn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>bii);return{id:CEt,diagram:t}},"loader"),Ugn={id:CEt,detector:Fgn,loader:zgn},Vgn=Ugn,OEt="journey",Qgn=O(t=>/^\s*journey/.test(t),"detector"),Ggn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Uii);return{id:OEt,diagram:t}},"loader"),Hgn={id:OEt,detector:Qgn,loader:Ggn},Wgn=Hgn,Ygn=O((t,e,r)=>{ye.debug(`rendering svg for syntax error -`);const n=nu(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),jo(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"),kEt={draw:Ygn},qgn=kEt,jgn={db:{},renderer:kEt,parser:{parse:O(()=>{},"parse")}},Xgn=jgn,EEt="flowchart-elk",Kgn=O((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"),Zgn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>s_e);return{id:EEt,diagram:t}},"loader"),Jgn={id:EEt,detector:Kgn,loader:Zgn},emn=Jgn,_Et="timeline",tmn=O(t=>/^\s*timeline/.test(t),"detector"),rmn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>mai);return{id:_Et,diagram:t}},"loader"),nmn={id:_Et,detector:tmn,loader:rmn},imn=nmn,REt="mindmap",amn=O(t=>/^\s*mindmap/.test(t),"detector"),omn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Lai);return{id:REt,diagram:t}},"loader"),smn={id:REt,detector:amn,loader:omn},lmn=smn,DEt="kanban",cmn=O(t=>/^\s*kanban/.test(t),"detector"),umn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Zai);return{id:DEt,diagram:t}},"loader"),hmn={id:DEt,detector:cmn,loader:umn},dmn=hmn,LEt="sankey",fmn=O(t=>/^\s*sankey(-beta)?/.test(t),"detector"),pmn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Boi);return{id:LEt,diagram:t}},"loader"),gmn={id:LEt,detector:fmn,loader:pmn},mmn=gmn,MEt="packet",vmn=O(t=>/^\s*packet(-beta)?/.test(t),"detector"),ymn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>qoi);return{id:MEt,diagram:t}},"loader"),bmn={id:MEt,detector:vmn,loader:ymn},IEt="radar",xmn=O(t=>/^\s*radar-beta/.test(t),"detector"),wmn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>gsi);return{id:IEt,diagram:t}},"loader"),Amn={id:IEt,detector:xmn,loader:wmn},PEt="block",Smn=O(t=>/^\s*block(-beta)?/.test(t),"detector"),Tmn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Vli);return{id:PEt,diagram:t}},"loader"),Cmn={id:PEt,detector:Smn,loader:Tmn},Omn=Cmn,NEt="treeView",kmn=O(t=>/^\s*treeView-beta/.test(t),"detector"),Emn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>dci);return{id:NEt,diagram:t}},"loader"),_mn={id:NEt,detector:kmn,loader:Emn},Rmn=_mn,BEt="architecture",Dmn=O(t=>/^\s*architecture/.test(t),"detector"),Lmn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Nci);return{id:BEt,diagram:t}},"loader"),Mmn={id:BEt,detector:Dmn,loader:Lmn},Imn=Mmn,$Et="eventmodeling",Pmn=O(t=>/^\s*eventmodeling/.test(t),"detector"),Nmn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Zci);return{id:$Et,diagram:t}},"loader"),Bmn={id:$Et,detector:Pmn,loader:Nmn},$mn=Bmn,FEt="ishikawa",Fmn=O(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),zmn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>gui);return{id:FEt,diagram:t}},"loader"),Umn={id:FEt,detector:Fmn,loader:zmn},zEt="venn",Vmn=O(t=>/^\s*venn-beta/.test(t),"detector"),Qmn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>ehi);return{id:zEt,diagram:t}},"loader"),Gmn={id:zEt,detector:Vmn,loader:Qmn},Hmn=Gmn,UEt="treemap",Wmn=O(t=>/^\s*treemap/.test(t),"detector"),Ymn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>hhi);return{id:UEt,diagram:t}},"loader"),qmn={id:UEt,detector:Wmn,loader:Ymn},VEt="wardley",jmn=O(t=>/^\s*wardley-beta/i.test(t),"detector"),Xmn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Shi);return{id:VEt,diagram:t}},"loader"),Kmn={id:VEt,detector:jmn,loader:Xmn},Zmn=Kmn,QEt="cynefin",Jmn=O(t=>/^\s*cynefin-beta(?:[\s:]|$)/.test(t),"detector"),e0n=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>zhi);return{id:QEt,diagram:t}},"loader"),t0n={id:QEt,detector:Jmn,loader:e0n},GEt="railroad",r0n=O(t=>/^\s*railroad-beta/i.test(t),"detector"),n0n=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>hdi);return{id:GEt,diagram:t}},"loader"),i0n={id:GEt,detector:r0n,loader:n0n},HEt="railroadEbnf",a0n=O(t=>/^\s*railroad-ebnf-beta/i.test(t),"detector"),o0n=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>xdi);return{id:HEt,diagram:t}},"loader"),s0n={id:HEt,detector:a0n,loader:o0n},WEt="railroadAbnf",l0n=O(t=>/^\s*railroad-abnf-beta/i.test(t),"detector"),c0n=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Rdi);return{id:WEt,diagram:t}},"loader"),u0n={id:WEt,detector:l0n,loader:c0n},YEt="railroadPeg",h0n=O(t=>/^\s*railroad-peg-beta/i.test(t),"detector"),d0n=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>zdi);return{id:YEt,diagram:t}},"loader"),f0n={id:YEt,detector:h0n,loader:d0n},qEt=!1,lK=O(()=>{qEt||(qEt=!0,_j("error",Xgn,t=>t.toLowerCase().trim()==="error"),_j("---",{db:{clear:O(()=>{},"clear")},styles:{},renderer:{draw:O(()=>{},"draw")},parser:{parse:O(()=>{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:O(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),L1e(emn,lmn,Imn),L1e(Ipn,dmn,Ign,Rgn,Xpn,ign,sgn,ugn,Agn,Ogn,Wpn,Vpn,$pn,imn,egn,Vgn,$gn,Wgn,pgn,mmn,bmn,ygn,Omn,$mn,Rmn,Amn,Umn,qmn,i0n,s0n,u0n,f0n,Hmn,Zmn,t0n))},"addDiagrams"),p0n=O(async()=>{ye.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(MT).map(async([r,{detector:n,loader:i}])=>{if(i)try{G1e(r)}catch{try{const{diagram:a,id:o}=await i();_j(o,a,n)}catch(a){throw ye.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete MT[r],a}}}))).filter(r=>r.status==="rejected");if(e.length>0){ye.error(`Failed to load ${e.length} external diagrams`);for(const r of e)ye.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),g0n="graphics-document document";function jEt(t,e){t.attr("role",g0n),e!==""&&t.attr("aria-roledescription",e)}O(jEt,"setA11yDiagramInfo");function XEt(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)}}}O(XEt,"addSVGa11yTitleDescription");var h2e=(bk=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=D1e(e,n);e=Bhn(e)+` -`;try{G1e(i)}catch{const d=inn(i);if(!d)throw new E2t(`Diagram ${i} not found.`);const{id:f,diagram:p}=await d();_j(f,p)}const{db:a,parser:o,renderer:s,init:l}=G1e(i);return o.parser&&(o.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 o.parse(e),new bk(i,e,a,o,s)}async render(e,r){await this.renderer.draw(this.text,e,r,this)}getParser(){return this.parser}getType(){return this.type}},O(bk,"Diagram"),bk),KEt=[],m0n=O(()=>{KEt.forEach(t=>{t()}),KEt=[]},"attachFunctions"),v0n=O(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function ZEt(t){const e=t.match(k2t);if(!e)return{text:t,metadata:{}};const r=e[1],n=r?e[2].split(` + L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),upn=O((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"),hpn=O((t,e,r)=>{const n=Dr(),{themeVariables:i}=n,{strokeWidth:a}=i,o=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");o.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),o.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),o.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),o.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),dpn={extension:Gfn,composition:Hfn,aggregation:Wfn,dependency:Yfn,lollipop:qfn,point:jfn,circle:Xfn,cross:Kfn,barb:Zfn,barbNeo:Jfn,only_one:epn,zero_or_one:tpn,one_or_more:rpn,zero_or_more:npn,only_one_neo:ipn,zero_or_one_neo:apn,one_or_more_neo:opn,zero_or_more_neo:spn,requirement_arrow:lpn,requirement_contains:upn,requirement_arrow_neo:cpn,requirement_contains_neo:hpn},n2e=Qfn,fpn={common:Xt,getConfig:Dr,insertCluster:ZX,insertEdge:t2e,insertEdgeLabel:rK,insertMarkers:n2e,insertNode:i$,interpolateToCurve:mxe,labelHelper:gn,log:ye,positionEdgeLabel:Xkt},c$={},rEt=O(t=>{for(const e of t)c$[e.name]=e},"registerLayoutLoaders"),ppn=O(()=>{rEt([{name:"dagre",loader:O(async()=>await Promise.resolve().then(()=>oPn),"loader")},{name:"swimlane",loader:O(async()=>await Promise.resolve().then(()=>yPn),"loader")},{name:"cose-bilkent",loader:O(async()=>await Promise.resolve().then(()=>iFn),"loader")}])},"registerDefaultLayoutLoaders");ppn();var RR=O(async(t,e,r)=>{if(!(t.layoutAlgorithm in c$))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=c$[t.layoutAlgorithm],i=await n.loader(),{theme:a,themeVariables:o}=t.config,{useGradient:s,gradientStart:l,gradientStop:u}=o,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"}`),s){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,fpn,{algorithm:n.algorithm},r)},"render"),u$=O((t="",{fallback:e="dagre"}={})=>{if(t in c$)return t;if(e in c$)return ye.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"),i2e="comm",nEt="rule",iEt="decl",gpn="@media",mpn="@import",vpn="@supports",ypn="@namespace",a2e="@keyframes",aEt="@layer",bpn="@scope",xpn=Math.abs,h$=String.fromCharCode;function oEt(t){return t.trim()}function o2e(t,e,r){return t.replace(e,r)}function DR(t,e){return t.charCodeAt(e)|0}function LR(t,e,r){return t.slice(e,r)}function S0(t){return t.length}function sEt(t){return t.length}function nK(t,e){return e.push(t),t}var iK=1,MR=1,lEt=0,vp=0,Fs=0,IR="";function s2e(t,e,r,n,i,a,o,s){return{value:t,root:e,parent:r,type:n,props:i,children:a,line:iK,column:MR,length:o,return:"",siblings:s}}function wpn(){return Fs}function Apn(){return Fs=vp>0?DR(IR,--vp):0,MR--,Fs===10&&(MR=1,iK--),Fs}function Dg(){return Fs=vp2||d$(Fs)>3?"":" "}function Opn(t,e){for(;--e&&Dg()&&!(Fs<48||Fs>102||Fs>57&&Fs<65||Fs>70&&Fs<97););return oK(t,aK()+(e<6&&T2()==32&&Dg()==32))}function c2e(t){for(;Dg();)switch(Fs){case t:return vp;case 34:case 39:t!==34&&t!==39&&c2e(Fs);break;case 40:t===41&&c2e(t);break;case 92:Dg();break}return vp}function kpn(t,e){for(;Dg()&&t+Fs!==57;)if(t+Fs===84&&T2()===47)break;return"/*"+oK(e,vp-1)+"*"+h$(t===47?t:Dg())}function Epn(t){for(;!d$(T2());)Dg();return oK(t,vp)}function _pn(t){return Tpn(sK("",null,null,null,[""],t=Spn(t),0,[0],t))}function sK(t,e,r,n,i,a,o,s,l){for(var u=0,h=0,d=o,f=0,p=0,g=0,m=1,v=1,y=1,b=0,x=0,w="",A=i,S=a,T=n,C=w;v;)switch(g=x,x=Dg()){case 40:g!=108&&DR(C,d-1)==58?(b++,C+="("):C+=l2e(x);break;case 41:b--,C+=")";break;case 34:case 39:case 91:C+=l2e(x);break;case 9:case 10:case 13:case 32:if(b>0){C+=h$(x);break}C+=Cpn(g);break;case 92:C+=Opn(aK()-1,7);continue;case 47:switch(T2()){case 42:case 47:nK(Rpn(kpn(Dg(),aK()),e,r,l),l),(d$(g||1)==5||d$(T2()||1)==5)&&S0(C)&&LR(C,-1,void 0)!==" "&&(C+=" ");break;default:C+="/"}break;case 123*m:s[u++]=S0(C)*y;case 125*m:case 59:case 0:if(b>0&&x){C+=h$(x);break}switch(x){case 0:case 125:v=0;case 59+h:y==-1&&(C=o2e(C,/\f/g,"")),p>0&&(S0(C)-d||m===0)&&nK(p>32?uEt(C+";",n,r,d-1,l):uEt(o2e(C," ","")+";",n,r,d-2,l),l);break;case 59:C+=";";default:if(nK(T=cEt(C,e,r,u,h,i,s,w,A=[],S=[],d,a),a),x===123)if(h===0)sK(C,e,T,T,A,a,d,s,S);else{switch(f){case 99:if(DR(C,3)===110)break;case 108:if(DR(C,2)===97)break;default:h=0;case 100:case 109:case 115:}h?sK(t,T,T,n&&nK(cEt(t,T,T,0,0,i,s,w,i,A=[],d,S),S),i,S,d,s,n?A:S):sK(C,T,T,T,[""],S,0,s,S)}}u=h=p=0,m=y=1,w=C="",d=o;break;case 58:d=1+S0(C),p=g;default:if(m<1){if(x==123)--m;else if(x==125&&m++==0&&Apn()==125)continue}switch(C+=h$(x),x*m){case 38:y=h>0?1:(C+="\f",-1);break;case 44:if(b>0)break;s[u++]=(S0(C)-1)*y,y=1;break;case 64:T2()===45&&(C+=l2e(Dg())),f=T2(),h=d=S0(w=C+=Epn(aK())),x++;break;case 45:g===45&&S0(C)==2&&(m=0)}}return a}function cEt(t,e,r,n,i,a,o,s,l,u,h,d){for(var f=i-1,p=i===0?a:[""],g=sEt(p),m=0,v=0,y=0;m0?p[b]+" "+x:o2e(x,/&\f/g,p[b])))&&(l[y++]=w);return s2e(t,e,r,i===0?nEt:s,l,u,h,d)}function Rpn(t,e,r,n){return s2e(t,e,r,i2e,h$(wpn()),LR(t,2,-2),0,n)}function uEt(t,e,r,n,i){return s2e(t,e,r,iEt,LR(t,0,n),LR(t,n+1,-1),n,i)}function u2e(t,e){for(var r="",n=0;n/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),Ipn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>JFn);return{id:hEt,diagram:t}},"loader"),Ppn={id:hEt,detector:Mpn,loader:Ipn},Npn=Ppn,dEt="flowchart",Bpn=O((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"),$pn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>s_e);return{id:dEt,diagram:t}},"loader"),Fpn={id:dEt,detector:Bpn,loader:$pn},zpn=Fpn,fEt="flowchart-v2",Upn=O((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"),Vpn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>s_e);return{id:fEt,diagram:t}},"loader"),Qpn={id:fEt,detector:Upn,loader:Vpn},Gpn=Qpn,pEt="swimlane",Hpn=O(t=>/^\s*swimlane-beta\b/.test(t),"detector"),Wpn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>p9n);return{id:pEt,diagram:t}},"loader"),Ypn={id:pEt,detector:Hpn,loader:Wpn},qpn=Ypn,gEt="er",jpn=O(t=>/^\s*erDiagram/.test(t),"detector"),Xpn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>A9n);return{id:gEt,diagram:t}},"loader"),Kpn={id:gEt,detector:jpn,loader:Xpn},Zpn=Kpn,mEt="gitGraph",Jpn=O(t=>/^\s*gitGraph/.test(t),"detector"),egn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Cei);return{id:mEt,diagram:t}},"loader"),tgn={id:mEt,detector:Jpn,loader:egn},rgn=tgn,vEt="gantt",ngn=O(t=>/^\s*gantt/.test(t),"detector"),ign=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Cti);return{id:vEt,diagram:t}},"loader"),agn={id:vEt,detector:ngn,loader:ign},ogn=agn,yEt="info",sgn=O(t=>/^\s*info/.test(t),"detector"),lgn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Mti);return{id:yEt,diagram:t}},"loader"),cgn={id:yEt,detector:sgn,loader:lgn},bEt="pie",ugn=O(t=>/^\s*pie/.test(t),"detector"),hgn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Xti);return{id:bEt,diagram:t}},"loader"),dgn={id:bEt,detector:ugn,loader:hgn},xEt="quadrantChart",fgn=O(t=>/^\s*quadrantChart/.test(t),"detector"),pgn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>iri);return{id:xEt,diagram:t}},"loader"),ggn={id:xEt,detector:fgn,loader:pgn},mgn=ggn,wEt="xychart",vgn=O(t=>/^\s*xychart(-beta)?/.test(t),"detector"),ygn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>bri);return{id:wEt,diagram:t}},"loader"),bgn={id:wEt,detector:vgn,loader:ygn},xgn=bgn,AEt="requirement",wgn=O(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),Agn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>kri);return{id:AEt,diagram:t}},"loader"),Sgn={id:AEt,detector:wgn,loader:Agn},Tgn=Sgn,SEt="sequence",Cgn=O(t=>/^\s*sequenceDiagram/.test(t),"detector"),Ogn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Ani);return{id:SEt,diagram:t}},"loader"),kgn={id:SEt,detector:Cgn,loader:Ogn},Egn=kgn,TEt="class",_gn=O((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"),Rgn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Eni);return{id:TEt,diagram:t}},"loader"),Dgn={id:TEt,detector:_gn,loader:Rgn},Lgn=Dgn,CEt="classDiagram",Mgn=O((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"),Ign=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Rni);return{id:CEt,diagram:t}},"loader"),Pgn={id:CEt,detector:Mgn,loader:Ign},Ngn=Pgn,OEt="state",Bgn=O((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"),$gn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>bii);return{id:OEt,diagram:t}},"loader"),Fgn={id:OEt,detector:Bgn,loader:$gn},zgn=Fgn,kEt="stateDiagram",Ugn=O((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"),Vgn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>wii);return{id:kEt,diagram:t}},"loader"),Qgn={id:kEt,detector:Ugn,loader:Vgn},Ggn=Qgn,EEt="journey",Hgn=O(t=>/^\s*journey/.test(t),"detector"),Wgn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Qii);return{id:EEt,diagram:t}},"loader"),Ygn={id:EEt,detector:Hgn,loader:Wgn},qgn=Ygn,jgn=O((t,e,r)=>{ye.debug(`rendering svg for syntax error +`);const n=nu(e),i=n.append("g");n.attr("viewBox","0 0 2412 512"),jo(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"),_Et={draw:jgn},Xgn=_Et,Kgn={db:{},renderer:_Et,parser:{parse:O(()=>{},"parse")}},Zgn=Kgn,REt="flowchart-elk",Jgn=O((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"),emn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>s_e);return{id:REt,diagram:t}},"loader"),tmn={id:REt,detector:Jgn,loader:emn},rmn=tmn,DEt="timeline",nmn=O(t=>/^\s*timeline/.test(t),"detector"),imn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>yai);return{id:DEt,diagram:t}},"loader"),amn={id:DEt,detector:nmn,loader:imn},omn=amn,LEt="mindmap",smn=O(t=>/^\s*mindmap/.test(t),"detector"),lmn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Iai);return{id:LEt,diagram:t}},"loader"),cmn={id:LEt,detector:smn,loader:lmn},umn=cmn,MEt="kanban",hmn=O(t=>/^\s*kanban/.test(t),"detector"),dmn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>eoi);return{id:MEt,diagram:t}},"loader"),fmn={id:MEt,detector:hmn,loader:dmn},pmn=fmn,IEt="sankey",gmn=O(t=>/^\s*sankey(-beta)?/.test(t),"detector"),mmn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Foi);return{id:IEt,diagram:t}},"loader"),vmn={id:IEt,detector:gmn,loader:mmn},ymn=vmn,PEt="packet",bmn=O(t=>/^\s*packet(-beta)?/.test(t),"detector"),xmn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Xoi);return{id:PEt,diagram:t}},"loader"),wmn={id:PEt,detector:bmn,loader:xmn},NEt="radar",Amn=O(t=>/^\s*radar-beta/.test(t),"detector"),Smn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>vsi);return{id:NEt,diagram:t}},"loader"),Tmn={id:NEt,detector:Amn,loader:Smn},BEt="block",Cmn=O(t=>/^\s*block(-beta)?/.test(t),"detector"),Omn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Gli);return{id:BEt,diagram:t}},"loader"),kmn={id:BEt,detector:Cmn,loader:Omn},Emn=kmn,$Et="treeView",_mn=O(t=>/^\s*treeView-beta/.test(t),"detector"),Rmn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>pci);return{id:$Et,diagram:t}},"loader"),Dmn={id:$Et,detector:_mn,loader:Rmn},Lmn=Dmn,FEt="architecture",Mmn=O(t=>/^\s*architecture/.test(t),"detector"),Imn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>$ci);return{id:FEt,diagram:t}},"loader"),Pmn={id:FEt,detector:Mmn,loader:Imn},Nmn=Pmn,zEt="eventmodeling",Bmn=O(t=>/^\s*eventmodeling/.test(t),"detector"),$mn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>eui);return{id:zEt,diagram:t}},"loader"),Fmn={id:zEt,detector:Bmn,loader:$mn},zmn=Fmn,UEt="ishikawa",Umn=O(t=>/^\s*ishikawa(-beta)?\b/i.test(t),"detector"),Vmn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>vui);return{id:UEt,diagram:t}},"loader"),Qmn={id:UEt,detector:Umn,loader:Vmn},VEt="venn",Gmn=O(t=>/^\s*venn-beta/.test(t),"detector"),Hmn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>rhi);return{id:VEt,diagram:t}},"loader"),Wmn={id:VEt,detector:Gmn,loader:Hmn},Ymn=Wmn,QEt="treemap",qmn=O(t=>/^\s*treemap/.test(t),"detector"),jmn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>fhi);return{id:QEt,diagram:t}},"loader"),Xmn={id:QEt,detector:qmn,loader:jmn},GEt="wardley",Kmn=O(t=>/^\s*wardley-beta/i.test(t),"detector"),Zmn=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Chi);return{id:GEt,diagram:t}},"loader"),Jmn={id:GEt,detector:Kmn,loader:Zmn},e0n=Jmn,HEt="cynefin",t0n=O(t=>/^\s*cynefin-beta(?:[\s:]|$)/.test(t),"detector"),r0n=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Vhi);return{id:HEt,diagram:t}},"loader"),n0n={id:HEt,detector:t0n,loader:r0n},WEt="railroad",i0n=O(t=>/^\s*railroad-beta/i.test(t),"detector"),a0n=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>fdi);return{id:WEt,diagram:t}},"loader"),o0n={id:WEt,detector:i0n,loader:a0n},YEt="railroadEbnf",s0n=O(t=>/^\s*railroad-ebnf-beta/i.test(t),"detector"),l0n=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Adi);return{id:YEt,diagram:t}},"loader"),c0n={id:YEt,detector:s0n,loader:l0n},qEt="railroadAbnf",u0n=O(t=>/^\s*railroad-abnf-beta/i.test(t),"detector"),h0n=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Ldi);return{id:qEt,diagram:t}},"loader"),d0n={id:qEt,detector:u0n,loader:h0n},jEt="railroadPeg",f0n=O(t=>/^\s*railroad-peg-beta/i.test(t),"detector"),p0n=O(async()=>{const{diagram:t}=await Promise.resolve().then(()=>Vdi);return{id:jEt,diagram:t}},"loader"),g0n={id:jEt,detector:f0n,loader:p0n},XEt=!1,lK=O(()=>{XEt||(XEt=!0,_j("error",Zgn,t=>t.toLowerCase().trim()==="error"),_j("---",{db:{clear:O(()=>{},"clear")},styles:{},renderer:{draw:O(()=>{},"draw")},parser:{parse:O(()=>{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:O(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),L1e(rmn,umn,Nmn),L1e(Npn,pmn,Ngn,Lgn,Zpn,ogn,cgn,dgn,Tgn,Egn,qpn,Gpn,zpn,omn,rgn,Ggn,zgn,qgn,mgn,ymn,wmn,xgn,Emn,zmn,Lmn,Tmn,Qmn,Xmn,o0n,c0n,d0n,g0n,Ymn,e0n,n0n))},"addDiagrams"),m0n=O(async()=>{ye.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(MT).map(async([r,{detector:n,loader:i}])=>{if(i)try{G1e(r)}catch{try{const{diagram:a,id:o}=await i();_j(o,a,n)}catch(a){throw ye.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete MT[r],a}}}))).filter(r=>r.status==="rejected");if(e.length>0){ye.error(`Failed to load ${e.length} external diagrams`);for(const r of e)ye.error(r);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),v0n="graphics-document document";function KEt(t,e){t.attr("role",v0n),e!==""&&t.attr("aria-roledescription",e)}O(KEt,"setA11yDiagramInfo");function ZEt(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)}}}O(ZEt,"addSVGa11yTitleDescription");var h2e=(bk=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=D1e(e,n);e=Fhn(e)+` +`;try{G1e(i)}catch{const d=onn(i);if(!d)throw new R2t(`Diagram ${i} not found.`);const{id:f,diagram:p}=await d();_j(f,p)}const{db:a,parser:o,renderer:s,init:l}=G1e(i);return o.parser&&(o.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 o.parse(e),new bk(i,e,a,o,s)}async render(e,r){await this.renderer.draw(this.text,e,r,this)}getParser(){return this.parser}getType(){return this.type}},O(bk,"Diagram"),bk),JEt=[],y0n=O(()=>{JEt.forEach(t=>{t()}),JEt=[]},"attachFunctions"),b0n=O(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function e_t(t){const e=t.match(_2t);if(!e)return{text:t,metadata:{}};const r=e[1],n=r?e[2].split(` `).map(o=>o.startsWith(r)?o.slice(r.length):o).join(` -`):e[2];let i=OX(n,{schema:CX})??{};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}}O(ZEt,"extractFrontMatter");var y0n=O(t=>t.replace(/\r\n?/g,` -`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),b0n=O(t=>{const{text:e,metadata:r}=ZEt(t),{displayMode:n,title:i,config:a={}}=r;return n&&(a.gantt||(a.gantt={}),a.gantt.displayMode=n),{title:i,config:a,text:e}},"processFrontmatter"),x0n=O(t=>{const e=un.detectInit(t)??{},r=un.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:n})=>n==="wrap"):(r==null?void 0:r.type)==="wrap"&&(e.wrap=!0),{text:khn(t),directive:e}},"processDirectives");function d2e(t){const e=y0n(t),r=b0n(e),n=x0n(r.text),i=uo(r.config,n.directive);return t=v0n(n.text),{code:t,title:r.title,config:i}}O(d2e,"preprocessDiagram");function JEt(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}O(JEt,"toBase64");var w0n=5e4,A0n="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",S0n="sandbox",T0n="loose",C0n="http://www.w3.org/2000/svg",O0n="http://www.w3.org/1999/xlink",k0n="http://www.w3.org/1999/xhtml",E0n="100%",_0n="100%",R0n="border:0;margin:0;",D0n="margin:0",L0n="allow-top-navigation-by-user-activation allow-popups",M0n='The "iframe" tag is not supported by your browser.',I0n=["foreignobject"],P0n=["dominant-baseline"];function f2e(t){const e=d2e(t);return Tj(),enn(e.config??{}),e}O(f2e,"processAndSetConfigs");async function e_t(t,e){lK();try{const{code:r,config:n}=f2e(t);return{diagramType:(await i_t(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}O(e_t,"parse");var t_t=O((t,e,r=[])=>{const n=x2t(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${n}`},"cssImportantStyles"),N0n=O((t,e=new Map)=>{const r=new CSSStyleSheet;if(t.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${t.fontFamily}}`,r.cssRules.length),t.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${t.altFontFamily}}`,r.cssRules.length),e instanceof Map){const s=na(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{XTt(l.styles)||s.forEach(u=>{r.insertRule(t_t(l.id,u,l.styles),r.cssRules.length)}),XTt(l.textStyles)||r.insertRule(t_t(l.id,"tspan",((l==null?void 0:l.textStyles)||[]).map(u=>u.replace("color","fill"))),r.cssRules.length)})}let n="";if(t.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const i=new CSSStyleSheet;i.replaceSync(t.themeCSS),n=P1e(i)+` +`):e[2];let i=OX(n,{schema:CX})??{};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}}O(e_t,"extractFrontMatter");var x0n=O(t=>t.replace(/\r\n?/g,` +`).replace(/<(\w+)([^>]*)>/g,(e,r,n)=>"<"+r+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),w0n=O(t=>{const{text:e,metadata:r}=e_t(t),{displayMode:n,title:i,config:a={}}=r;return n&&(a.gantt||(a.gantt={}),a.gantt.displayMode=n),{title:i,config:a,text:e}},"processFrontmatter"),A0n=O(t=>{const e=un.detectInit(t)??{},r=un.detectDirective(t,"wrap");return Array.isArray(r)?e.wrap=r.some(({type:n})=>n==="wrap"):(r==null?void 0:r.type)==="wrap"&&(e.wrap=!0),{text:_hn(t),directive:e}},"processDirectives");function d2e(t){const e=x0n(t),r=w0n(e),n=A0n(r.text),i=uo(r.config,n.directive);return t=b0n(n.text),{code:t,title:r.title,config:i}}O(d2e,"preprocessDiagram");function t_t(t){const e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}O(t_t,"toBase64");var S0n=5e4,T0n="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",C0n="sandbox",O0n="loose",k0n="http://www.w3.org/2000/svg",E0n="http://www.w3.org/1999/xlink",_0n="http://www.w3.org/1999/xhtml",R0n="100%",D0n="100%",L0n="border:0;margin:0;",M0n="margin:0",I0n="allow-top-navigation-by-user-activation allow-popups",P0n='The "iframe" tag is not supported by your browser.',N0n=["foreignobject"],B0n=["dominant-baseline"];function f2e(t){const e=d2e(t);return Tj(),rnn(e.config??{}),e}O(f2e,"processAndSetConfigs");async function r_t(t,e){lK();try{const{code:r,config:n}=f2e(t);return{diagramType:(await o_t(r)).type,config:n}}catch(r){if(e!=null&&e.suppressErrors)return!1;throw r}}O(r_t,"parse");var n_t=O((t,e,r=[])=>{const n=A2t(`{ ${r.join(" !important; ")} !important; }`);return`.${t} ${e} ${n}`},"cssImportantStyles"),$0n=O((t,e=new Map)=>{const r=new CSSStyleSheet;if(t.fontFamily!==void 0&&r.insertRule(`:root { --mermaid-font-family: ${t.fontFamily}}`,r.cssRules.length),t.altFontFamily!==void 0&&r.insertRule(`:root { --mermaid-alt-font-family: ${t.altFontFamily}}`,r.cssRules.length),e instanceof Map){const s=na(t)?["> *","span"]:["rect","polygon","ellipse","circle","path"];e.forEach(l=>{ZTt(l.styles)||s.forEach(u=>{r.insertRule(n_t(l.id,u,l.styles),r.cssRules.length)}),ZTt(l.textStyles)||r.insertRule(n_t(l.id,"tspan",((l==null?void 0:l.textStyles)||[]).map(u=>u.replace("color","fill"))),r.cssRules.length)})}let n="";if(t.themeCSS!==void 0)if(typeof r.replaceSync=="function"){const i=new CSSStyleSheet;i.replaceSync(t.themeCSS),n=P1e(i)+` `}else n+=`${t.themeCSS} -`;return n+P1e(r)},"createCssStyles"),B0n=O((t,e)=>u2e(kpn(`${t}{${e}}`),Rpn([O(function(n,i,a,o){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===a2e)return;n.props=n.props.map(s=>s===t&&Array.isArray(n.children)&&n.children.every(u=>u.type!=="decl"?!1:new Set(["font-family","font-size","fill"]).has(u.props))||(s.startsWith(`${t} `)||s.startsWith(`${t}>`))&&!s.startsWith(`${t} ||`)?s:`${t} ${s}`)}else n.type.startsWith("@")&&([...[fpn,gpn,nEt,vpn,"@container","@starting-style"],a2e].includes(n.type)||(ye.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=i2e))},"addNamespace"),_pn])),"compileCSS"),$0n=O((t,e,r,n)=>{const i=N0n(t,r),a=xnn(e,i,{...t.themeVariables,theme:t.theme,look:t.look},n);return B0n(n,a)},"createUserStyles"),F0n=O((t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=o1(n),n=n.replace(/
/g,"
"),n},"cleanUpSvgCode"),z0n=O((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":_0n,n=JEt(`${t}`);return``},"putIntoIFrame"),r_t=O((t,e,r,n,i)=>{const a=t.append("div");a.attr("id",r),n&&a.attr("style",n);const o=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns",C0n);return i&&o.attr("xmlns:xlink",i),o.append("g"),t},"appendDivSvgG");function p2e(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}O(p2e,"sandboxedIframe");var U0n=O((t,e,r,n)=>{var i,a,o;(i=t.getElementById(e))==null||i.remove(),(a=t.getElementById(r))==null||a.remove(),(o=t.getElementById(n))==null||o.remove()},"removeExistingElements"),V0n=O(async function(t,e,r){var P,L,R,D,M,I;lK();const n=f2e(e);e=n.code;const i=Dr();ye.debug(i),e.length>((i==null?void 0:i.maxTextSize)??w0n)&&(e=A0n);const a=`#${t}`,o="i"+t,s="#"+o,l="d"+t,u="#"+l,h=O(()=>{const F=_t(f?s:u).node();F&&"remove"in F&&F.remove()},"removeTempElements");let d=_t(document.body);const f=i.securityLevel===S0n,p=i.securityLevel===T0n,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const N=p2e(_t(r),o);d=_t(N.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=_t(r);r_t(d,t,l,`font-family: ${g}`,O0n)}else{if(U0n(document,t,l,o),f){const N=p2e(_t(document.body),o);d=_t(N.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=_t("body");r_t(d,t,l)}let m,v;try{m=await h2e.fromText(e,{title:n.title})}catch(N){if(i.suppressErrorRendering)throw h(),N;m=await h2e.fromText("error"),v=N}const y=d.select(u).node(),b=m.type,x=y.firstChild,w=x.firstChild,A=(L=(P=m.renderer).getClasses)==null?void 0:L.call(P,e,m),S=$0n(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():qgn.draw(e,t,"11.16.1"),N}const C=d.select(`${u} svg`),k=(D=(R=m.db).getAccTitle)==null?void 0:D.call(R),E=(I=(M=m.db).getAccDescription)==null?void 0:I.call(M);a_t(b,C,k,E),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",k0n);let _=d.select(u).node().innerHTML;if(ye.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),_=F0n(_,f,p0(i.arrowMarkerAbsolute)),f){const N=d.select(u+" svg").node();_=z0n(_,N)}else p||(_=qy.sanitize(_,{ADD_TAGS:I0n,ADD_ATTR:P0n,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(m0n(),v)throw v;return h(),{diagramType:b,svg:_,bindFunctions:m.db.bindFunctions}},"render");function n_t(t={}){var n;const e=$s({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),Zrn(e),e!=null&&e.theme&&e.theme in Xy?e.themeVariables=Xy[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=Xy.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?Krn(e):w2t();b1e(r.logLevel),lK()}O(n_t,"initialize");var i_t=O((t,e={})=>{const{code:r}=d2e(t);return h2e.fromText(r,e)},"getDiagramFromText");function a_t(t,e,r,n){jEt(e,t),XEt(e,r,n,e.attr("id"))}O(a_t,"addA11yInfo");var iC=Object.freeze({render:V0n,parse:e_t,getDiagramFromText:i_t,initialize:n_t,getConfig:Dr,setConfig:A2t,getSiteConfig:w2t,updateSiteConfig:Jrn,reset:O(()=>{Tj()},"reset"),globalReset:O(()=>{Tj(rR)},"globalReset"),defaultConfig:rR});b1e(Dr().logLevel),Tj(Dr());var Q0n=O((t,e,r)=>{ye.warn(t),xxe(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"),o_t=O(async function(t={querySelector:".mermaid"}){try{await G0n(t)}catch(e){if(xxe(e)&&ye.error(e.str),Kd.parseError&&Kd.parseError(e),!t.suppressErrors)throw ye.error("Use the suppressErrors option to suppress these errors"),e}},"run"),G0n=O(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=iC.getConfig();ye.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");ye.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(ye.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),iC.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const a=new un.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let o;const s=[];for(const l of Array.from(i)){if(ye.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const u=`mermaid-${a.next()}`;o=l.innerHTML,o=ICt(un.entityDecode(o)).trim().replace(//gi,"
");const h=un.detectInit(o);h&&ye.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await u_t(u,o,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){Q0n(d,s,Kd.parseError)}}if(s.length>0)throw s[0]},"runThrowsErrors"),s_t=O(function(t){iC.initialize(t)},"initialize"),H0n=O(async function(t,e,r){ye.warn("mermaid.init is deprecated. Please use run instead."),t&&s_t(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await o_t(n)},"init"),W0n=O(async(t,{lazyLoad:e=!0}={})=>{lK(),L1e(...t),e===!1&&await p0n()},"registerExternalDiagrams"),l_t=O(function(){if(Kd.startOnLoad){const{startOnLoad:t}=iC.getConfig();t&&Kd.run().catch(e=>ye.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",l_t,!1);var Y0n=O(function(t){Kd.parseError=t},"setParseErrorHandler"),cK=[],g2e=!1,c_t=O(async()=>{if(!g2e){for(g2e=!0;cK.length>0;){const t=cK.shift();if(t)try{await t()}catch(e){ye.error("Error executing queue",e)}}g2e=!1}},"executeQueue"),q0n=O(async(t,e)=>new Promise((r,n)=>{const i=O(()=>new Promise((a,o)=>{iC.parse(t,e).then(s=>{a(s),r(s)},s=>{var l;ye.error("Error parsing",s),(l=Kd.parseError)==null||l.call(Kd,s),o(s),n(s)})}),"performCall");cK.push(i),c_t().catch(n)}),"parse"),u_t=O((t,e,r)=>new Promise((n,i)=>{const a=O(()=>new Promise((o,s)=>{iC.render(t,e,r).then(l=>{o(l),n(l)},l=>{var u;ye.error("Error parsing",l),(u=Kd.parseError)==null||u.call(Kd,l),s(l),i(l)})}),"performCall");cK.push(a),c_t().catch(i)}),"render"),j0n=O(()=>Object.keys(MT).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),Kd={startOnLoad:!0,mermaidAPI:iC,parse:q0n,render:u_t,init:H0n,run:o_t,registerExternalDiagrams:W0n,registerLayoutLoaders:eEt,initialize:s_t,parseError:void 0,contentLoaded:l_t,setParseErrorHandler:Y0n,detectType:D1e,registerIconPacks:Txe,getRegisteredDiagramsMetadata:j0n},X0n=Kd;/*! Check if previously processed *//*! +`;return n+P1e(r)},"createCssStyles"),F0n=O((t,e)=>u2e(_pn(`${t}{${e}}`),Lpn([O(function(n,i,a,o){if(n.type==="rule"&&Array.isArray(n.props)){if(n.parent&&n.parent.type===a2e)return;n.props=n.props.map(s=>s===t&&Array.isArray(n.children)&&n.children.every(u=>u.type!=="decl"?!1:new Set(["font-family","font-size","fill"]).has(u.props))||(s.startsWith(`${t} `)||s.startsWith(`${t}>`))&&!s.startsWith(`${t} ||`)?s:`${t} ${s}`)}else n.type.startsWith("@")&&([...[gpn,vpn,aEt,bpn,"@container","@starting-style"],a2e].includes(n.type)||(ye.warn(`Removing unsupported at-rule ${n.type} from CSS`),n.type=i2e))},"addNamespace"),Dpn])),"compileCSS"),z0n=O((t,e,r,n)=>{const i=$0n(t,r),a=Ann(e,i,{...t.themeVariables,theme:t.theme,look:t.look},n);return F0n(n,a)},"createUserStyles"),U0n=O((t="",e,r)=>{let n=t;return!r&&!e&&(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=o1(n),n=n.replace(/
/g,"
"),n},"cleanUpSvgCode"),V0n=O((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":D0n,n=t_t(`${t}`);return``},"putIntoIFrame"),i_t=O((t,e,r,n,i)=>{const a=t.append("div");a.attr("id",r),n&&a.attr("style",n);const o=a.append("svg").attr("id",e).attr("width","100%").attr("xmlns",k0n);return i&&o.attr("xmlns:xlink",i),o.append("g"),t},"appendDivSvgG");function p2e(t,e){return t.append("iframe").attr("id",e).attr("style","width: 100%; height: 100%;").attr("sandbox","")}O(p2e,"sandboxedIframe");var Q0n=O((t,e,r,n)=>{var i,a,o;(i=t.getElementById(e))==null||i.remove(),(a=t.getElementById(r))==null||a.remove(),(o=t.getElementById(n))==null||o.remove()},"removeExistingElements"),G0n=O(async function(t,e,r){var P,L,R,D,M,I;lK();const n=f2e(e);e=n.code;const i=Dr();ye.debug(i),e.length>((i==null?void 0:i.maxTextSize)??S0n)&&(e=T0n);const a=`#${t}`,o="i"+t,s="#"+o,l="d"+t,u="#"+l,h=O(()=>{const F=_t(f?s:u).node();F&&"remove"in F&&F.remove()},"removeTempElements");let d=_t(document.body);const f=i.securityLevel===C0n,p=i.securityLevel===O0n,g=i.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const N=p2e(_t(r),o);d=_t(N.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=_t(r);i_t(d,t,l,`font-family: ${g}`,E0n)}else{if(Q0n(document,t,l,o),f){const N=p2e(_t(document.body),o);d=_t(N.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=_t("body");i_t(d,t,l)}let m,v;try{m=await h2e.fromText(e,{title:n.title})}catch(N){if(i.suppressErrorRendering)throw h(),N;m=await h2e.fromText("error"),v=N}const y=d.select(u).node(),b=m.type,x=y.firstChild,w=x.firstChild,A=(L=(P=m.renderer).getClasses)==null?void 0:L.call(P,e,m),S=z0n(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():Xgn.draw(e,t,"11.16.1"),N}const C=d.select(`${u} svg`),k=(D=(R=m.db).getAccTitle)==null?void 0:D.call(R),E=(I=(M=m.db).getAccDescription)==null?void 0:I.call(M);s_t(b,C,k,E),d.select(`[id="${t}"]`).selectAll("foreignobject > *").attr("xmlns",_0n);let _=d.select(u).node().innerHTML;if(ye.debug("config.arrowMarkerAbsolute",i.arrowMarkerAbsolute),_=U0n(_,f,p0(i.arrowMarkerAbsolute)),f){const N=d.select(u+" svg").node();_=V0n(_,N)}else p||(_=qy.sanitize(_,{ADD_TAGS:N0n,ADD_ATTR:B0n,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(y0n(),v)throw v;return h(),{diagramType:b,svg:_,bindFunctions:m.db.bindFunctions}},"render");function a_t(t={}){var n;const e=$s({},t);e!=null&&e.fontFamily&&!((n=e.themeVariables)!=null&&n.fontFamily)&&(e.themeVariables||(e.themeVariables={}),e.themeVariables.fontFamily=e.fontFamily),enn(e),e!=null&&e.theme&&e.theme in Xy?e.themeVariables=Xy[e.theme].getThemeVariables(e.themeVariables):e&&(e.themeVariables=Xy.default.getThemeVariables(e.themeVariables));const r=typeof e=="object"?Jrn(e):S2t();b1e(r.logLevel),lK()}O(a_t,"initialize");var o_t=O((t,e={})=>{const{code:r}=d2e(t);return h2e.fromText(r,e)},"getDiagramFromText");function s_t(t,e,r,n){KEt(e,t),ZEt(e,r,n,e.attr("id"))}O(s_t,"addA11yInfo");var iC=Object.freeze({render:G0n,parse:r_t,getDiagramFromText:o_t,initialize:a_t,getConfig:Dr,setConfig:T2t,getSiteConfig:S2t,updateSiteConfig:tnn,reset:O(()=>{Tj()},"reset"),globalReset:O(()=>{Tj(rR)},"globalReset"),defaultConfig:rR});b1e(Dr().logLevel),Tj(Dr());var H0n=O((t,e,r)=>{ye.warn(t),xxe(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"),l_t=O(async function(t={querySelector:".mermaid"}){try{await W0n(t)}catch(e){if(xxe(e)&&ye.error(e.str),Kd.parseError&&Kd.parseError(e),!t.suppressErrors)throw ye.error("Use the suppressErrors option to suppress these errors"),e}},"run"),W0n=O(async function({postRenderCallback:t,querySelector:e,nodes:r}={querySelector:".mermaid"}){const n=iC.getConfig();ye.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");ye.debug(`Found ${i.length} diagrams`),(n==null?void 0:n.startOnLoad)!==void 0&&(ye.debug("Start On Load: "+(n==null?void 0:n.startOnLoad)),iC.updateSiteConfig({startOnLoad:n==null?void 0:n.startOnLoad}));const a=new un.InitIDGenerator(n.deterministicIds,n.deterministicIDSeed);let o;const s=[];for(const l of Array.from(i)){if(ye.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const u=`mermaid-${a.next()}`;o=l.innerHTML,o=NCt(un.entityDecode(o)).trim().replace(//gi,"
");const h=un.detectInit(o);h&&ye.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:f}=await d_t(u,o,l);l.innerHTML=d,t&&await t(u),f&&f(l)}catch(d){H0n(d,s,Kd.parseError)}}if(s.length>0)throw s[0]},"runThrowsErrors"),c_t=O(function(t){iC.initialize(t)},"initialize"),Y0n=O(async function(t,e,r){ye.warn("mermaid.init is deprecated. Please use run instead."),t&&c_t(t);const n={postRenderCallback:r,querySelector:".mermaid"};typeof e=="string"?n.querySelector=e:e&&(e instanceof HTMLElement?n.nodes=[e]:n.nodes=e),await l_t(n)},"init"),q0n=O(async(t,{lazyLoad:e=!0}={})=>{lK(),L1e(...t),e===!1&&await m0n()},"registerExternalDiagrams"),u_t=O(function(){if(Kd.startOnLoad){const{startOnLoad:t}=iC.getConfig();t&&Kd.run().catch(e=>ye.error("Mermaid failed to initialize",e))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",u_t,!1);var j0n=O(function(t){Kd.parseError=t},"setParseErrorHandler"),cK=[],g2e=!1,h_t=O(async()=>{if(!g2e){for(g2e=!0;cK.length>0;){const t=cK.shift();if(t)try{await t()}catch(e){ye.error("Error executing queue",e)}}g2e=!1}},"executeQueue"),X0n=O(async(t,e)=>new Promise((r,n)=>{const i=O(()=>new Promise((a,o)=>{iC.parse(t,e).then(s=>{a(s),r(s)},s=>{var l;ye.error("Error parsing",s),(l=Kd.parseError)==null||l.call(Kd,s),o(s),n(s)})}),"performCall");cK.push(i),h_t().catch(n)}),"parse"),d_t=O((t,e,r)=>new Promise((n,i)=>{const a=O(()=>new Promise((o,s)=>{iC.render(t,e,r).then(l=>{o(l),n(l)},l=>{var u;ye.error("Error parsing",l),(u=Kd.parseError)==null||u.call(Kd,l),s(l),i(l)})}),"performCall");cK.push(a),h_t().catch(i)}),"render"),K0n=O(()=>Object.keys(MT).map(t=>({id:t})),"getRegisteredDiagramsMetadata"),Kd={startOnLoad:!0,mermaidAPI:iC,parse:X0n,render:d_t,init:Y0n,run:l_t,registerExternalDiagrams:q0n,registerLayoutLoaders:rEt,initialize:c_t,parseError:void 0,contentLoaded:u_t,setParseErrorHandler:j0n,detectType:D1e,registerIconPacks:Txe,getRegisteredDiagramsMetadata:K0n},Z0n=Kd;/*! Check if previously processed *//*! * Wait for document loaded before starting the execution - */const K0n=Object.freeze(Object.defineProperty({__proto__:null,default:X0n},Symbol.toStringTag,{value:"Module"})),h_t=1024;let Z0n=0,yp=class{constructor(e,r){this.from=e,this.to=r}};class _n{constructor(e={}){this.id=Z0n++,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=zs.match(e)),r=>{let n=e(r);return n===void 0?null:[this,n]}}}_n.closedBy=new _n({deserialize:t=>t.split(" ")}),_n.openedBy=new _n({deserialize:t=>t.split(" ")}),_n.group=new _n({deserialize:t=>t.split(" ")}),_n.isolate=new _n({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}}),_n.contextHash=new _n({perNode:!0}),_n.lookAhead=new _n({perNode:!0}),_n.mounted=new _n({perNode:!0});class PR{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[_n.mounted.id]}}const J0n=Object.create(null);class zs{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):J0n,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new zs(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(_n.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(_n.group),a=-1;a<(i?i.length:0);a++){let o=r[a<0?n.name:i[a]];if(o)return o}}}}zs.none=new zs("",Object.create(null),0,8);class NR{constructor(e){this.types=e;for(let r=0;r0;for(let l=this.cursor(o|Ki.IncludeAnonymous);;){let u=!1;if(l.from<=a&&l.to>=i&&(!s&&l.type.isAnonymous||r(l)!==!1)){if(l.firstChild())continue;u=!0}for(;u&&n&&(s||!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:b2e(zs.none,this.children,this.positions,0,this.children.length,0,this.length,(r,n,i)=>new ci(this.type,r,n,i,this.propValues),e.makeTree||((r,n,i)=>new ci(zs.none,r,n,i)))}static build(e){return nvn(e)}}ci.empty=new ci(zs.none,[],[],0);class m2e{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 m2e(this.buffer,this.index)}}class C2{constructor(e,r,n){this.buffer=e,this.length=r,this.set=n}get type(){return zs.none}toString(){let e=[];for(let r=0;r0));l=o[l+3]);return s}slice(e,r,n){let i=this.buffer,a=new Uint16Array(r-e),o=0;for(let s=e,l=0;s=e&&re;case 1:return r<=e&&n>e;case 2:return n>e;case 4:return!0}}function f$(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?s.length:-1;e!=u;e+=r){let h=s[e],d=l[e]+o.from,f;if(!(!(a&Ki.EnterBracketed&&h instanceof ci&&(f=PR.get(h))&&!f.overlay&&f.bracketed&&n>=d&&n<=d+h.length)&&!f_t(i,n,d,d+h.length))){if(h instanceof C2){if(a&Ki.ExcludeBuffers)continue;let p=h.findChild(0,h.buffer.length,r,n-d,i);if(p>-1)return new T0(new evn(o,h,e,d),null,p)}else if(a&Ki.IncludeAnonymous||!h.type.isAnonymous||y2e(h)){let p;if(!(a&Ki.IgnoreMounts)&&(p=PR.get(h))&&!p.overlay)return new lae(p.tree,d,e,o);let g=new lae(h,d,e,o);return a&Ki.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(r<0?h.children.length-1:0,r,n,i,a)}}}if(a&Ki.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+r:e=r<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,r,n=0){let i;if(!(n&Ki.IgnoreOverlays)&&(i=PR.get(this._tree))&&i.overlay){let a=e-this.from,o=n&Ki.EnterBracketed&&i.bracketed;for(let{from:s,to:l}of i.overlay)if((r>0||o?s<=a:s=a:l>a))return new lae(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 g_t(t,e,r,n){let i=t.cursor(),a=[];if(!i.firstChild())return a;if(r!=null){for(let o=!1;!o;)if(o=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 v2e(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 evn{constructor(e,r,n,i){this.parent=e,this.buffer=r,this.index=n,this.start=i}}class T0 extends p_t{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 T0(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&Ki.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 T0(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 T0(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 T0(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 o=n.buffer[this.index+1];e.push(n.slice(i,a,o)),r.push(0)}return new ci(this.type,e,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function m_t(t){if(!t.length)return null;let e=0,r=t[0];for(let a=1;ar.from||o.to=e){let s=new bp(o.tree,o.overlay[0].from+a.from,-1,a);(i||(i=[n])).push(f$(s,e,r,!1))}}return i?m_t(i):n}class hK{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&~Ki.EnterBracketed,e instanceof bp)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 bp?(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&Ki.ExcludeBuffers?!1:this.enterChild(1,e,r):this.yield(this._tree.enter(e,r,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ki.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ki.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,o=e<0?-1:n._tree.children.length;a!=o;a+=e){let s=n._tree.children[a];if(this.mode&Ki.IncludeAnonymous||s instanceof C2||!s.type.isAnonymous||y2e(s))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 o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;r=o,n=a+1;break e}i=this.stack[--a]}for(let i=n;i=0;a--){if(a<0)return v2e(this._tree,e,i);let o=n[r.buffer[this.stack[a]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function y2e(t){return t.children.some(e=>e instanceof C2||!e.type.isAnonymous||y2e(e))}function nvn(t){var e;let{buffer:r,nodeSet:n,maxBufferLength:i=h_t,reused:a=[],minRepeatType:o=n.types.length}=t,s=Array.isArray(r)?new m2e(r,r.length):r,l=n.types,u=0,h=0;function d(A,S,T,C,k,E){let{id:_,start:P,end:L,size:R}=s,D=h,M=u;if(R<0)if(s.next(),R==-1){let V=a[_];T.push(V),C.push(P-A);return}else if(R==-3){u=_;return}else if(R==-4){h=_;return}else throw new RangeError(`Unrecognized record size: ${R}`);let I=l[_],N,F,B=P-A;if(L-P<=i&&(F=v(s.pos-S,k))){let V=new Uint16Array(F.size-F.skip),z=s.pos-F.size,U=V.length;for(;s.pos>z;)U=y(F.start,V,U);N=new C2(V,L-F.start,n),B=F.start-A}else{let V=s.pos-R;s.next();let z=[],U=[],Q=_>=o?_:-1,G=0,q=L;for(;s.pos>V;)Q>=0&&s.id==Q&&s.size>=0?(s.end<=q-i&&(g(z,U,P,G,s.end,q,Q,D,M),G=z.length,q=s.end),s.next()):E>2500?f(P,V,z,U):d(P,V,z,U,Q,E+1);if(Q>=0&&G>0&&G-1&&G>0){let Y=p(I,M);N=b2e(I,z,U,0,z.length,0,L-P,Y,Y)}else N=m(I,z,U,L-P,D-L,M)}T.push(N),C.push(B)}function f(A,S,T,C){let k=[],E=0,_=-1;for(;s.pos>S;){let{id:P,start:L,end:R,size:D}=s;if(D>4)s.next();else{if(_>-1&&L<_)break;_<0&&(_=R-i),k.push(P,L,R),E++,s.next()}}if(E){let P=new Uint16Array(E*4),L=k[k.length-2];for(let R=k.length-3,D=0;R>=0;R-=3)P[D++]=k[R],P[D++]=k[R+1]-L,P[D++]=k[R+2]-L,P[D++]=D;T.push(new C2(P,k[2]-L,n)),C.push(L-A)}}function p(A,S){return(T,C,k)=>{let E=0,_=T.length-1,P,L;if(_>=0&&(P=T[_])instanceof ci){if(!_&&P.type==A&&P.length==k)return P;(L=P.prop(_n.lookAhead))&&(E=C[_]+P.length+L)}return m(A,T,C,k,E,S)}}function g(A,S,T,C,k,E,_,P,L){let R=[],D=[];for(;A.length>C;)R.push(A.pop()),D.push(S.pop()+T-k);A.push(m(n.types[_],R,D,E-k,P-E,L)),S.push(k-T)}function m(A,S,T,C,k,E,_){if(E){let P=[_n.contextHash,E];_=_?[P].concat(_):[P]}if(k>25){let P=[_n.lookAhead,k];_=_?[P].concat(_):[P]}return new ci(A,S,T,C,_)}function v(A,S){let T=s.fork(),C=0,k=0,E=0,_=T.end-i,P={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){P.size=C,P.start=k,P.skip=E,E+=4,C+=4,T.next();continue}let D=T.pos-R;if(R<0||D=o?4:0,I=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>=o&&(M+=4);T.next()}k=I,C+=R,E+=M}return(S<0||C==A)&&(P.size=C,P.start=k,P.skip=E),P.size>4?P:void 0}function y(A,S,T){let{id:C,start:k,end:E,size:_}=s;if(s.next(),_>=0&&C4){let L=s.pos-(_-4);for(;s.pos>L;)T=y(A,S,T)}S[--T]=P,S[--T]=E-A,S[--T]=k-A,S[--T]=C}else _==-3?u=C:_==-4&&(h=C);return T}let b=[],x=[];for(;s.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 ci(l[t.topID],b.reverse(),x.reverse(),w)}const v_t=new WeakMap;function dK(t,e){if(!t.isAnonymous||e instanceof C2||e.type!=t)return 1;let r=v_t.get(e);if(r==null){r=1;for(let n of e.children){if(n.type!=t||!(n instanceof ci)){r=1;break}r+=dK(t,n)}v_t.set(e,r)}return r}function b2e(t,e,r,n,i,a,o,s,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(b2e(t,g,m,w,x,A,T,null,l))}f.push(A+b-a)}}return p(e,r,n,i,0),(s||l)(d,f,o)}class x2e{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 T0?this.setBuffer(e.context.buffer,e.index,r):e instanceof bp&&this.map.set(e.tree,r)}get(e){return e instanceof T0?this.getBuffer(e.context.buffer,e.index):e instanceof bp?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 h1{constructor(e,r,n,i,a=!1,o=!1){this.from=e,this.to=r,this.tree=n,this.offset=i,this.open=(a?1:0)|(o?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 h1(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,o=e.length?e[0]:null;for(let s=0,l=0,u=0;;s++){let h=s=n)for(;o&&o.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 h1(p,g,f.tree,f.offset+u,s>0,!!h)}if(f&&i.push(f),o.to>d)break;o=anew yp(i.from,i.to)):[new yp(0,0)]:[new yp(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 ivn{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 y_t(t){return(e,r,n,i)=>new ovn(e,t,r,n,i)}class b_t{constructor(e,r,n,i,a,o){this.parser=e,this.parse=r,this.overlay=n,this.bracketed=i,this.target=a,this.from=o}}function x_t(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class avn{constructor(e,r,n,i,a,o,s,l){this.parser=e,this.predicate=r,this.mounts=n,this.index=i,this.start=a,this.bracketed=o,this.target=s,this.prev=l,this.depth=0,this.ranges=[]}}const w2e=new _n({perNode:!0});class ovn{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 ci(n.type,n.children,n.positions,n.length,n.propValues.concat([[w2e,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[_n.mounted.id]=new PR(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)s=!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})}}s=!1}else if(n&&(o=svn(n.ranges,i.from,i.to)))s=o!=2;else if(!i.type.isAnonymous&&(a=this.nest(i,this.input))&&(i.fromnew yp(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}):s=!1}}else if(r&&(l=r.predicate(i))&&(l===!0&&(l=new yp(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(s&&i.firstChild())r&&r.depth++,n&&n.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(r&&!--r.depth){let u=S_t(this.ranges,r.ranges);u.length&&(x_t(u),this.inner.splice(r.index,0,new b_t(r.parser,r.parser.startParse(this.input,T_t(r.mounts,u),u),r.ranges.map(h=>new yp(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 svn(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 w_t(t,e,r,n,i,a){if(e=e&&r.enter(n,1,Ki.IgnoreOverlays|Ki.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 ci)r=r.children[0];else break}return!1}}let cvn=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(w2e))!==null&&r!==void 0?r:n.to,this.inner=new A_t(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(w2e))!==null&&e!==void 0?e:r.to,this.inner=new A_t(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 o=(n=a.tree)===null||n===void 0?void 0:n.prop(_n.mounted);if(o&&o.parser==r)for(let s=this.fragI;s=a.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:a.from-l.offset,mount:o})}}}return i}};function S_t(t,e){let r=null,n=e;for(let i=1,a=0;i=s)break;l.to<=o||(r||(n=r=e.slice()),l.froms&&r.splice(a+1,0,new yp(s,l.to))):l.to>s?r[a--]=new yp(s,l.to):r.splice(a--,1))}}return n}function uvn(t,e,r,n){let i=0,a=0,o=!1,s=!1,l=-1e9,u=[];for(;;){let h=i==t.length?1e9:o?t[i].to:t[i].from,d=a==e.length?1e9:s?e[a].to:e[a].from;if(o!=s){let f=Math.max(l,r),p=Math.min(h,d,n);fnew yp(f.from+n,f.to+n)),d=uvn(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 h1(p,m,i.tree,-o,a.from>=p||a.openStart,a.to<=m||a.openEnd)),g)break;p=d[f].to}}else r.push(new h1(l,u,i.tree,-o,a.from>=o||a.openStart,a.to<=s||a.openEnd))}return r}let A2e=[],C_t=[];(()=>{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=C_t[n])e=n+1;else return!0;if(e==r)return!1}}function O_t(t){return t>=127462&&t<=127487}const k_t=8205;function dvn(t,e,r=!0,n=!0){return(r?E_t:fvn)(t,e,n)}function E_t(t,e,r){if(e==t.length)return e;e&&__t(t.charCodeAt(e))&&R_t(t.charCodeAt(e-1))&&e--;let n=S2e(t,e);for(e+=D_t(n);e=0&&O_t(S2e(t,o));)a++,o-=2;if(a%2==0)break;e+=2}else break}return e}function fvn(t,e,r){for(;e>1;){let n=E_t(t,e-2,r);if(n=56320&&t<57344}function R_t(t){return t>=55296&&t<56320}function D_t(t){return t<65536?1:2}class wi{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]=BR(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),pK.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]=BR(this,e,r);let n=[];return this.decompose(e,r,n,0),pK.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 p$(this),a=new p$(e);for(let o=r,s=r;;){if(i.next(o),a.next(o),o=0,i.lineBreak!=a.lineBreak||i.done!=a.done||i.value!=a.value)return!1;if(s+=i.value.length,i.done||s>=n)return!0}}iter(e=1){return new p$(this,e)}iterRange(e,r=this.length){return new M_t(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 I_t(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]?wi.empty:e.length<=32?new ys(e):pK.from(ys.split(e,[]))}}class ys extends wi{constructor(e,r=pvn(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 o=this.text[a],s=i+o.length;if((r?n:s)>=e)return new gvn(i,s,n,o);i=s+1,n++}}decompose(e,r,n,i){let a=e<=0&&r>=this.length?this:new ys(L_t(this.text,e,r),Math.min(r,this.length)-Math.max(0,e));if(i&1){let o=n.pop(),s=gK(a.text,o.text.slice(),0,a.length);if(s.length<=32)n.push(new ys(s,o.length+a.length));else{let l=s.length>>1;n.push(new ys(s.slice(0,l)),new ys(s.slice(l)))}}else n.push(a)}replace(e,r,n){if(!(n instanceof ys))return super.replace(e,r,n);[e,r]=BR(this,e,r);let i=gK(this.text,gK(n.text,L_t(this.text,0,e)),r),a=this.length+n.length-(r-e);return i.length<=32?new ys(i,a):pK.from(ys.split(i,[]),a)}sliceString(e,r=this.length,n=` + */const J0n=Object.freeze(Object.defineProperty({__proto__:null,default:Z0n},Symbol.toStringTag,{value:"Module"})),f_t=1024;let evn=0,yp=class{constructor(e,r){this.from=e,this.to=r}};class _n{constructor(e={}){this.id=evn++,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=zs.match(e)),r=>{let n=e(r);return n===void 0?null:[this,n]}}}_n.closedBy=new _n({deserialize:t=>t.split(" ")}),_n.openedBy=new _n({deserialize:t=>t.split(" ")}),_n.group=new _n({deserialize:t=>t.split(" ")}),_n.isolate=new _n({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}}),_n.contextHash=new _n({perNode:!0}),_n.lookAhead=new _n({perNode:!0}),_n.mounted=new _n({perNode:!0});class PR{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[_n.mounted.id]}}const tvn=Object.create(null);class zs{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):tvn,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new zs(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(_n.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(_n.group),a=-1;a<(i?i.length:0);a++){let o=r[a<0?n.name:i[a]];if(o)return o}}}}zs.none=new zs("",Object.create(null),0,8);class NR{constructor(e){this.types=e;for(let r=0;r0;for(let l=this.cursor(o|Ki.IncludeAnonymous);;){let u=!1;if(l.from<=a&&l.to>=i&&(!s&&l.type.isAnonymous||r(l)!==!1)){if(l.firstChild())continue;u=!0}for(;u&&n&&(s||!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:b2e(zs.none,this.children,this.positions,0,this.children.length,0,this.length,(r,n,i)=>new ci(this.type,r,n,i,this.propValues),e.makeTree||((r,n,i)=>new ci(zs.none,r,n,i)))}static build(e){return avn(e)}}ci.empty=new ci(zs.none,[],[],0);class m2e{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 m2e(this.buffer,this.index)}}class C2{constructor(e,r,n){this.buffer=e,this.length=r,this.set=n}get type(){return zs.none}toString(){let e=[];for(let r=0;r0));l=o[l+3]);return s}slice(e,r,n){let i=this.buffer,a=new Uint16Array(r-e),o=0;for(let s=e,l=0;s=e&&re;case 1:return r<=e&&n>e;case 2:return n>e;case 4:return!0}}function f$(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?s.length:-1;e!=u;e+=r){let h=s[e],d=l[e]+o.from,f;if(!(!(a&Ki.EnterBracketed&&h instanceof ci&&(f=PR.get(h))&&!f.overlay&&f.bracketed&&n>=d&&n<=d+h.length)&&!g_t(i,n,d,d+h.length))){if(h instanceof C2){if(a&Ki.ExcludeBuffers)continue;let p=h.findChild(0,h.buffer.length,r,n-d,i);if(p>-1)return new T0(new rvn(o,h,e,d),null,p)}else if(a&Ki.IncludeAnonymous||!h.type.isAnonymous||y2e(h)){let p;if(!(a&Ki.IgnoreMounts)&&(p=PR.get(h))&&!p.overlay)return new lae(p.tree,d,e,o);let g=new lae(h,d,e,o);return a&Ki.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(r<0?h.children.length-1:0,r,n,i,a)}}}if(a&Ki.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+r:e=r<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,r,n=0){let i;if(!(n&Ki.IgnoreOverlays)&&(i=PR.get(this._tree))&&i.overlay){let a=e-this.from,o=n&Ki.EnterBracketed&&i.bracketed;for(let{from:s,to:l}of i.overlay)if((r>0||o?s<=a:s=a:l>a))return new lae(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 v_t(t,e,r,n){let i=t.cursor(),a=[];if(!i.firstChild())return a;if(r!=null){for(let o=!1;!o;)if(o=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 v2e(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 rvn{constructor(e,r,n,i){this.parent=e,this.buffer=r,this.index=n,this.start=i}}class T0 extends m_t{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 T0(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&Ki.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 T0(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 T0(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 T0(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 o=n.buffer[this.index+1];e.push(n.slice(i,a,o)),r.push(0)}return new ci(this.type,e,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function y_t(t){if(!t.length)return null;let e=0,r=t[0];for(let a=1;ar.from||o.to=e){let s=new bp(o.tree,o.overlay[0].from+a.from,-1,a);(i||(i=[n])).push(f$(s,e,r,!1))}}return i?y_t(i):n}class hK{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&~Ki.EnterBracketed,e instanceof bp)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 bp?(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&Ki.ExcludeBuffers?!1:this.enterChild(1,e,r):this.yield(this._tree.enter(e,r,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ki.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ki.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,o=e<0?-1:n._tree.children.length;a!=o;a+=e){let s=n._tree.children[a];if(this.mode&Ki.IncludeAnonymous||s instanceof C2||!s.type.isAnonymous||y2e(s))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 o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;r=o,n=a+1;break e}i=this.stack[--a]}for(let i=n;i=0;a--){if(a<0)return v2e(this._tree,e,i);let o=n[r.buffer[this.stack[a]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function y2e(t){return t.children.some(e=>e instanceof C2||!e.type.isAnonymous||y2e(e))}function avn(t){var e;let{buffer:r,nodeSet:n,maxBufferLength:i=f_t,reused:a=[],minRepeatType:o=n.types.length}=t,s=Array.isArray(r)?new m2e(r,r.length):r,l=n.types,u=0,h=0;function d(A,S,T,C,k,E){let{id:_,start:P,end:L,size:R}=s,D=h,M=u;if(R<0)if(s.next(),R==-1){let V=a[_];T.push(V),C.push(P-A);return}else if(R==-3){u=_;return}else if(R==-4){h=_;return}else throw new RangeError(`Unrecognized record size: ${R}`);let I=l[_],N,F,B=P-A;if(L-P<=i&&(F=v(s.pos-S,k))){let V=new Uint16Array(F.size-F.skip),z=s.pos-F.size,U=V.length;for(;s.pos>z;)U=y(F.start,V,U);N=new C2(V,L-F.start,n),B=F.start-A}else{let V=s.pos-R;s.next();let z=[],U=[],Q=_>=o?_:-1,G=0,q=L;for(;s.pos>V;)Q>=0&&s.id==Q&&s.size>=0?(s.end<=q-i&&(g(z,U,P,G,s.end,q,Q,D,M),G=z.length,q=s.end),s.next()):E>2500?f(P,V,z,U):d(P,V,z,U,Q,E+1);if(Q>=0&&G>0&&G-1&&G>0){let Y=p(I,M);N=b2e(I,z,U,0,z.length,0,L-P,Y,Y)}else N=m(I,z,U,L-P,D-L,M)}T.push(N),C.push(B)}function f(A,S,T,C){let k=[],E=0,_=-1;for(;s.pos>S;){let{id:P,start:L,end:R,size:D}=s;if(D>4)s.next();else{if(_>-1&&L<_)break;_<0&&(_=R-i),k.push(P,L,R),E++,s.next()}}if(E){let P=new Uint16Array(E*4),L=k[k.length-2];for(let R=k.length-3,D=0;R>=0;R-=3)P[D++]=k[R],P[D++]=k[R+1]-L,P[D++]=k[R+2]-L,P[D++]=D;T.push(new C2(P,k[2]-L,n)),C.push(L-A)}}function p(A,S){return(T,C,k)=>{let E=0,_=T.length-1,P,L;if(_>=0&&(P=T[_])instanceof ci){if(!_&&P.type==A&&P.length==k)return P;(L=P.prop(_n.lookAhead))&&(E=C[_]+P.length+L)}return m(A,T,C,k,E,S)}}function g(A,S,T,C,k,E,_,P,L){let R=[],D=[];for(;A.length>C;)R.push(A.pop()),D.push(S.pop()+T-k);A.push(m(n.types[_],R,D,E-k,P-E,L)),S.push(k-T)}function m(A,S,T,C,k,E,_){if(E){let P=[_n.contextHash,E];_=_?[P].concat(_):[P]}if(k>25){let P=[_n.lookAhead,k];_=_?[P].concat(_):[P]}return new ci(A,S,T,C,_)}function v(A,S){let T=s.fork(),C=0,k=0,E=0,_=T.end-i,P={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){P.size=C,P.start=k,P.skip=E,E+=4,C+=4,T.next();continue}let D=T.pos-R;if(R<0||D=o?4:0,I=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>=o&&(M+=4);T.next()}k=I,C+=R,E+=M}return(S<0||C==A)&&(P.size=C,P.start=k,P.skip=E),P.size>4?P:void 0}function y(A,S,T){let{id:C,start:k,end:E,size:_}=s;if(s.next(),_>=0&&C4){let L=s.pos-(_-4);for(;s.pos>L;)T=y(A,S,T)}S[--T]=P,S[--T]=E-A,S[--T]=k-A,S[--T]=C}else _==-3?u=C:_==-4&&(h=C);return T}let b=[],x=[];for(;s.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 ci(l[t.topID],b.reverse(),x.reverse(),w)}const b_t=new WeakMap;function dK(t,e){if(!t.isAnonymous||e instanceof C2||e.type!=t)return 1;let r=b_t.get(e);if(r==null){r=1;for(let n of e.children){if(n.type!=t||!(n instanceof ci)){r=1;break}r+=dK(t,n)}b_t.set(e,r)}return r}function b2e(t,e,r,n,i,a,o,s,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(b2e(t,g,m,w,x,A,T,null,l))}f.push(A+b-a)}}return p(e,r,n,i,0),(s||l)(d,f,o)}class x2e{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 T0?this.setBuffer(e.context.buffer,e.index,r):e instanceof bp&&this.map.set(e.tree,r)}get(e){return e instanceof T0?this.getBuffer(e.context.buffer,e.index):e instanceof bp?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 h1{constructor(e,r,n,i,a=!1,o=!1){this.from=e,this.to=r,this.tree=n,this.offset=i,this.open=(a?1:0)|(o?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 h1(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,o=e.length?e[0]:null;for(let s=0,l=0,u=0;;s++){let h=s=n)for(;o&&o.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 h1(p,g,f.tree,f.offset+u,s>0,!!h)}if(f&&i.push(f),o.to>d)break;o=anew yp(i.from,i.to)):[new yp(0,0)]:[new yp(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 ovn{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 x_t(t){return(e,r,n,i)=>new lvn(e,t,r,n,i)}class w_t{constructor(e,r,n,i,a,o){this.parser=e,this.parse=r,this.overlay=n,this.bracketed=i,this.target=a,this.from=o}}function A_t(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class svn{constructor(e,r,n,i,a,o,s,l){this.parser=e,this.predicate=r,this.mounts=n,this.index=i,this.start=a,this.bracketed=o,this.target=s,this.prev=l,this.depth=0,this.ranges=[]}}const w2e=new _n({perNode:!0});class lvn{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 ci(n.type,n.children,n.positions,n.length,n.propValues.concat([[w2e,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[_n.mounted.id]=new PR(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)s=!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})}}s=!1}else if(n&&(o=cvn(n.ranges,i.from,i.to)))s=o!=2;else if(!i.type.isAnonymous&&(a=this.nest(i,this.input))&&(i.fromnew yp(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}):s=!1}}else if(r&&(l=r.predicate(i))&&(l===!0&&(l=new yp(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(s&&i.firstChild())r&&r.depth++,n&&n.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(r&&!--r.depth){let u=C_t(this.ranges,r.ranges);u.length&&(A_t(u),this.inner.splice(r.index,0,new w_t(r.parser,r.parser.startParse(this.input,O_t(r.mounts,u),u),r.ranges.map(h=>new yp(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 cvn(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 S_t(t,e,r,n,i,a){if(e=e&&r.enter(n,1,Ki.IgnoreOverlays|Ki.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 ci)r=r.children[0];else break}return!1}}let hvn=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(w2e))!==null&&r!==void 0?r:n.to,this.inner=new T_t(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(w2e))!==null&&e!==void 0?e:r.to,this.inner=new T_t(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 o=(n=a.tree)===null||n===void 0?void 0:n.prop(_n.mounted);if(o&&o.parser==r)for(let s=this.fragI;s=a.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:a.from-l.offset,mount:o})}}}return i}};function C_t(t,e){let r=null,n=e;for(let i=1,a=0;i=s)break;l.to<=o||(r||(n=r=e.slice()),l.froms&&r.splice(a+1,0,new yp(s,l.to))):l.to>s?r[a--]=new yp(s,l.to):r.splice(a--,1))}}return n}function dvn(t,e,r,n){let i=0,a=0,o=!1,s=!1,l=-1e9,u=[];for(;;){let h=i==t.length?1e9:o?t[i].to:t[i].from,d=a==e.length?1e9:s?e[a].to:e[a].from;if(o!=s){let f=Math.max(l,r),p=Math.min(h,d,n);fnew yp(f.from+n,f.to+n)),d=dvn(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 h1(p,m,i.tree,-o,a.from>=p||a.openStart,a.to<=m||a.openEnd)),g)break;p=d[f].to}}else r.push(new h1(l,u,i.tree,-o,a.from>=o||a.openStart,a.to<=s||a.openEnd))}return r}let A2e=[],k_t=[];(()=>{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=k_t[n])e=n+1;else return!0;if(e==r)return!1}}function E_t(t){return t>=127462&&t<=127487}const __t=8205;function pvn(t,e,r=!0,n=!0){return(r?R_t:gvn)(t,e,n)}function R_t(t,e,r){if(e==t.length)return e;e&&D_t(t.charCodeAt(e))&&L_t(t.charCodeAt(e-1))&&e--;let n=S2e(t,e);for(e+=M_t(n);e=0&&E_t(S2e(t,o));)a++,o-=2;if(a%2==0)break;e+=2}else break}return e}function gvn(t,e,r){for(;e>1;){let n=R_t(t,e-2,r);if(n=56320&&t<57344}function L_t(t){return t>=55296&&t<56320}function M_t(t){return t<65536?1:2}class wi{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]=BR(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),pK.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]=BR(this,e,r);let n=[];return this.decompose(e,r,n,0),pK.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 p$(this),a=new p$(e);for(let o=r,s=r;;){if(i.next(o),a.next(o),o=0,i.lineBreak!=a.lineBreak||i.done!=a.done||i.value!=a.value)return!1;if(s+=i.value.length,i.done||s>=n)return!0}}iter(e=1){return new p$(this,e)}iterRange(e,r=this.length){return new P_t(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 N_t(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]?wi.empty:e.length<=32?new ys(e):pK.from(ys.split(e,[]))}}class ys extends wi{constructor(e,r=mvn(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 o=this.text[a],s=i+o.length;if((r?n:s)>=e)return new vvn(i,s,n,o);i=s+1,n++}}decompose(e,r,n,i){let a=e<=0&&r>=this.length?this:new ys(I_t(this.text,e,r),Math.min(r,this.length)-Math.max(0,e));if(i&1){let o=n.pop(),s=gK(a.text,o.text.slice(),0,a.length);if(s.length<=32)n.push(new ys(s,o.length+a.length));else{let l=s.length>>1;n.push(new ys(s.slice(0,l)),new ys(s.slice(l)))}}else n.push(a)}replace(e,r,n){if(!(n instanceof ys))return super.replace(e,r,n);[e,r]=BR(this,e,r);let i=gK(this.text,gK(n.text,I_t(this.text,0,e)),r),a=this.length+n.length-(r-e);return i.length<=32?new ys(i,a):pK.from(ys.split(i,[]),a)}sliceString(e,r=this.length,n=` `){[e,r]=BR(this,e,r);let i="";for(let a=0,o=0;a<=r&&oe&&o&&(i+=n),ea&&(i+=s.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 ys(n,i)),n=[],i=-1);return i>-1&&r.push(new ys(n,i)),r}}let pK=class TP extends wi{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 o=this.children[a],s=i+o.length,l=n+o.lines-1;if((r?l:s)>=e)return o.lineInner(e,r,n,i);i=s+1,n=l+1}}decompose(e,r,n,i){for(let a=0,o=0;o<=r&&a=o){let u=i&((o<=e?1:0)|(l>=r?2:0));o>=e&&l<=r&&!u?n.push(s):s.decompose(e-o,r-o,n,u)}o=l+1}}replace(e,r,n){if([e,r]=BR(this,e,r),n.lines=a&&r<=s){let l=o.replace(e-a,r-a,n),u=this.lines-o.lines+l.lines;if(l.lines>4&&l.lines>u>>6){let h=this.children.slice();return h[i]=l,new TP(h,this.length-(r-e)+n.length)}return super.replace(a,s,l)}a=s+1}return super.replace(e,r,n)}sliceString(e,r=this.length,n=` -`){[e,r]=BR(this,e,r);let i="";for(let a=0,o=0;ae&&a&&(i+=n),eo&&(i+=s.sliceString(e-o,r-o,n)),o=l+1}return i}flatten(e){for(let r of this.children)r.flatten(e)}scanIdentical(e,r){if(!(e instanceof TP))return 0;let n=0,[i,a,o,s]=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==o||a==s)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 ys(p,r)}let i=Math.max(32,n>>5),a=i<<1,o=i>>1,s=[],l=0,u=-1,h=[];function d(p){let g;if(p.lines>a&&p instanceof TP)for(let m of p.children)d(m);else p.lines>o&&(l>o||!l)?(f(),s.push(p)):p instanceof ys&&l&&(g=h[h.length-1])instanceof ys&&p.lines+g.lines<=32?(l+=p.lines,u+=p.length+1,h[h.length-1]=new ys(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&&(s.push(h.length==1?h[0]:TP.from(h,u)),u=-1,l=h.length=0)}for(let p of e)d(p);return f(),s.length==1?s[0]:new TP(s,r)}};wi.empty=new ys([""],0);function pvn(t){let e=-1;for(let r of t)e+=r.length+1;return e}function gK(t,e,r=0,n=1e9){for(let i=0,a=0,o=!0;a=r&&(l>n&&(s=s.slice(0,n-i)),i0?1:(e instanceof ys?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],o=a>>1,s=i instanceof ys?i.text.length:i.children.length;if(o==(r>0?s: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 ys){let l=i.text[o+(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[o+(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 ys?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 M_t{constructor(e,r,n){this.value="",this.done=!1,this.cursor=new p$(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 I_t{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"&&(wi.prototype[Symbol.iterator]=function(){return this.iter()},p$.prototype[Symbol.iterator]=M_t.prototype[Symbol.iterator]=I_t.prototype[Symbol.iterator]=function(){return this});let gvn=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 BR(t,e,r){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,r))]}function Ul(t,e,r=!0,n=!0){return dvn(t,e,r,n)}function mvn(t){return t>=56320&&t<57344}function vvn(t){return t>=55296&&t<56320}function Yh(t,e){let r=t.charCodeAt(e);if(!vvn(r)||e+1==t.length)return r;let n=t.charCodeAt(e+1);return mvn(n)?(r-55296<<10)+(n-56320)+65536:r}function T2e(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function C0(t){return t<65536?1:2}const C2e=/\r\n?|\n/;var xc=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(xc||(xc={}));class O0{constructor(e){this.sections=e}get length(){let e=0;for(let r=0;re)return a+(e-i);a+=s}else{if(n!=xc.Simple&&u>=e&&(n==xc.TrackDel&&ie||n==xc.TrackBefore&&ie))return null;if(u>e||u==e&&r<0&&!s)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&&s>=e)return ir?"cover":!0;i=s}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 O0(e)}static create(e){return new O0(e)}}class bs extends O0{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 O2e(this,(r,n,i,a,o)=>e=e.replace(i,i+(n-r),o),!1),e}mapDesc(e,r=!1){return k2e(this,e,r,!0)}invert(e){let r=this.sections.slice(),n=[];for(let i=0,a=0;i=0){r[i]=s,r[i+1]=o;let l=i>>1;for(;n.length0&&O2(n,r,a.text),a.forward(h),s+=h}let u=e[o++];for(;s>1].toJSON()))}return e}static of(e,r,n){let i=[],a=[],o=0,s=null;function l(h=!1){if(!h&&!i.length)return;of||d<0||f>r)throw new RangeError(`Invalid change range ${d} to ${f} (in doc of length ${r})`);let g=p?typeof p=="string"?wi.of(p.split(n||C2e)):p:wi.empty,m=g.length;if(d==f&&m==0)return;do&&lu(i,d-o,-1),lu(i,f-d,m),O2(a,i,g),o=f}}return u(e),l(!s),s}static empty(e){return new bs(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;is&&typeof o!="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 O2(t,e,r){if(r.length==0)return;let n=e.length-2>>1;if(n>1])),!(r||o==t.sections.length||t.sections[o+1]<0);)s=t.sections[o++],l=t.sections[o++];e(i,u,a,h,d),i=u,a=h}}}function k2e(t,e,r,n=!1){let i=[],a=n?[]:null,o=new g$(t),s=new g$(e);for(let l=-1;;){if(o.done&&s.len||s.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&s.ins==-1){let u=Math.min(o.len,s.len);lu(i,u,-1),o.forward(u),s.forward(u)}else if(s.ins>=0&&(o.ins<0||l==o.i||o.off==0&&(s.len=0&&l=0){let u=0,h=o.len;for(;h;)if(s.ins==-1){let d=Math.min(h,s.len);u+=d,h-=d,s.forward(d)}else if(s.ins==0&&s.lenl||o.ins>=0&&o.len>l)&&(s||n.length>u),a.forward2(l),o.forward(l)}}}}class g${constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return r>=e.length?wi.empty:e[r]}textBit(e){let{inserted:r}=this.set,n=this.i-2>>1;return n>=r.length&&!e?wi.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 m$=class jMe{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 jMe(n,i,this.flags,this.goalColumn)}extend(e,r=e,n=0){if(e<=this.anchor&&r>=this.anchor)return xt.range(e,r,void 0,void 0,n);let i=Math.abs(e-this.anchor)>Math.abs(r-this.anchor)?e:r;return xt.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 xt.range(e.anchor,e.head)}static create(e,r,n,i){return new jMe(e,r,n,i)}};class xt{constructor(e,r){this.ranges=e,this.mainIndex=r}map(e,r=-1){return e.empty?this:xt.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 xt(e.ranges.map(r=>m$.fromJSON(r)),e.main)}static single(e,r=e){return new xt([xt.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?xt.range(l,s):xt.range(s,l))}}return new xt(e,r)}}function N_t(t,e){for(let r of t.ranges)if(r.to>e)throw new RangeError("Selection points outside of document")}let E2e=0;class vr{constructor(e,r,n,i,a){this.combine=e,this.compareInput=r,this.compare=n,this.isStatic=i,this.id=E2e++,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:_2e),!!e.static,e.enables)}of(e){return new mK([],this,0,e)}compute(e,r){if(this.isStatic)throw new Error("Can't compute a static facet");return new mK(e,this,1,r)}computeN(e,r){if(this.isStatic)throw new Error("Can't compute a static facet");return new mK(e,this,2,r)}from(e,r){return r||(r=n=>n),this.compute([e],n=>r(n.field(e)))}}function _2e(t,e){return t==e||t.length==e.length&&t.every((r,n)=>r===e[n])}class mK{constructor(e,r,n,i){this.dependencies=e,this.facet=r,this.type=n,this.value=i,this.id=E2e++}dynamicSlot(e){var r;let n=this.value,i=this.facet.compareInput,a=this.id,o=e[a]>>1,s=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[o]=n(d),1},update(d,f){if(l&&f.docChanged||u&&(f.docChanged||f.selection)||R2e(d,h)){let p=n(d);if(s?!B_t(p,d.values[o],i):!i(p,d.values[o]))return d.values[o]=p,1}return 0},reconfigure:(d,f)=>{let p,g=f.config.address[a];if(g!=null){let m=bK(f,g);if(this.dependencies.every(v=>v instanceof vr?f.facet(v)===d.facet(v):v instanceof Ko?f.field(v,!1)==d.field(v,!1):!0)||(s?B_t(p=n(d),m,i):i(p=n(d),m)))return d.values[o]=m,0}else p=n(d);return d.values[o]=p,1}}}get extension(){return this}}function B_t(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)),o=t[e.id]>>1;function s(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(vK).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],o=this.updateF(a,i);return this.compareF(a,o)?0:(n.values[r]=o,1)},reconfigure:(n,i)=>{let a=n.facet(vK),o=i.facet(vK),s;return(s=a.find(l=>l.field==this))&&s!=o.find(l=>l.field==this)?(n.values[r]=s.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,vK.of({field:this,create:e})]}get extension(){return this}}const aC={lowest:4,low:3,default:2,high:1,highest:0};function v$(t){return e=>new $_t(e,t)}const Zd={highest:v$(aC.highest),high:v$(aC.high),default:v$(aC.default),low:v$(aC.low),lowest:v$(aC.lowest)};class $_t{constructor(e,r){this.inner=e,this.prec=r}get extension(){return this}}class $R{of(e){return new D2e(this,e)}reconfigure(e){return $R.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class D2e{constructor(e,r){this.compartment=e,this.inner=r}get extension(){return this}}class yK{constructor(e,r,n,i,a,o){for(this.base=e,this.compartments=r,this.dynamicSlots=n,this.address=i,this.staticValues=a,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,r,n){let i=[],a=Object.create(null),o=new Map;for(let f of bvn(e,r,o))f instanceof Ko?i.push(f):(a[f.facet.id]||(a[f.facet.id]=[])).push(f);let s=Object.create(null),l=[],u=[];for(let f of i)s[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(s[g.id]=l.length<<1|1,_2e(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?(s[v.id]=l.length<<1|1,l.push(v.value)):(s[v.id]=u.length<<1,u.push(y=>v.dynamicSlot(y)));s[g.id]=u.length<<1,u.push(v=>yvn(v,g,p))}}let d=u.map(f=>f(s));return new yK(e,o,d,s,l,a)}}function bvn(t,e,r){let n=[[],[],[],[],[]],i=new Map;function a(o,s){let l=i.get(o);if(l!=null){if(l<=s)return;let u=n[l].indexOf(o);u>-1&&n[l].splice(u,1),o instanceof D2e&&r.delete(o.compartment)}if(i.set(o,s),Array.isArray(o))for(let u of o)a(u,s);else if(o instanceof D2e){if(r.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=e.get(o.compartment)||o.inner;r.set(o.compartment,u),a(u,s)}else if(o instanceof $_t)a(o.inner,o.prec);else if(o instanceof Ko)n[s].push(o),o.provides&&a(o.provides,s);else if(o instanceof mK)n[s].push(o),o.facet.extensions&&a(o.facet.extensions,aC.default);else{let u=o.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(u==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(u,s)}}return a(t,aC.default),n.reduce((o,s)=>o.concat(s))}function y$(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 bK(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const F_t=vr.define(),L2e=vr.define({combine:t=>t.some(e=>e),static:!0}),z_t=vr.define({combine:t=>t.length?t[0]:void 0,static:!0}),U_t=vr.define(),V_t=vr.define(),Q_t=vr.define(),G_t=vr.define({combine:t=>t.length?t[0]:!1});let k0=class{constructor(e,r){this.type=e,this.value=r}static define(){return new xvn}};class xvn{of(e){return new k0(this,e)}}class wvn{constructor(e){this.map=e}of(e){return new on(this,e)}}class on{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 on(this.type,r)}is(e){return this.type==e}static define(e={}){return new wvn(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}}on.reconfigure=on.define(),on.appendConfig=on.define();class Us{constructor(e,r,n,i,a,o){this.startState=e,this.changes=r,this.selection=n,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,n&&N_t(n,r.newLength),a.some(s=>s.type==Us.time)||(this.annotations=a.concat(Us.time.of(Date.now())))}static create(e,r,n,i,a,o){return new Us(e,r,n,i,a,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let 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(Us.userEvent);return!!(r&&(r==e||r.length>e.length&&r.slice(0,e.length)==e&&r[e.length]=="."))}}Us.time=k0.define(),Us.userEvent=k0.define(),Us.addToHistory=k0.define(),Us.remote=k0.define();function Avn(t,e){let r=[];for(let n=0,i=0;;){let a,o;if(n=t[n]))a=t[n++],o=t[n++];else if(i=0;i--){let a=n[i](t);a instanceof Us?t=a:Array.isArray(a)&&a.length==1&&a[0]instanceof Us?t=a[0]:t=W_t(e,FR(a),!1)}return t}function Tvn(t){let e=t.startState,r=e.facet(Q_t),n=t;for(let i=r.length-1;i>=0;i--){let a=r[i](t);a&&Object.keys(a).length&&(n=H_t(n,M2e(e,a,t.changes.newLength),!0))}return n==t?t:Us.create(e,t.changes,t.selection,n.effects,n.annotations,n.scrollIntoView)}const Cvn=[];function FR(t){return t==null?Cvn:Array.isArray(t)?t:[t]}var Ao=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(Ao||(Ao={}));const Ovn=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let I2e;try{I2e=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function kvn(t){if(I2e)return I2e.test(t);for(let e=0;e"€"&&(r.toUpperCase()!=r.toLowerCase()||Ovn.test(r)))return!0}return!1}function Evn(t){return e=>{if(!/\S/.test(e))return Ao.Space;if(kvn(e))return Ao.Word;for(let r=0;r-1)return Ao.Word;return Ao.Other}}class ei{constructor(e,r,n,i,a,o){this.config=e,this.doc=r,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=a,o&&(o._state=this);for(let s=0;si.set(u,l)),r=null),i.set(s.value.compartment,s.value.extension)):s.is(on.reconfigure)?(r=null,n=s.value):s.is(on.appendConfig)&&(r=null,n=FR(n).concat(s.value));let a;r?a=e.startState.values.slice():(r=yK.resolve(n,i,this),a=new ei(r,this.doc,this.selection,r.dynamicSlots.map(()=>null),(l,u)=>u.reconfigure(l,this),null).values);let o=e.startState.facet(L2e)?e.newSelection:e.newSelection.asSingle();new ei(r,e.newDoc,o,a,(s,l)=>l.update(s,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:xt.cursor(r.from+e.length)}))}changeByRange(e){let r=this.selection,n=e(r.ranges[0]),i=this.changes(n.changes),a=[n.range],o=FR(n.effects);for(let s=1;so.spec.fromJSON(s,l)))}}return ei.create({doc:e.doc,selection:xt.fromJSON(e.selection),extensions:r.extensions?i.concat([r.extensions]):i})}static create(e={}){let r=yK.resolve(e.extensions||[],new Map),n=e.doc instanceof wi?e.doc:wi.of((e.doc||"").split(r.staticFacet(ei.lineSeparator)||C2e)),i=e.selection?e.selection instanceof xt?e.selection:xt.single(e.selection.anchor,e.selection.head):xt.single(0);return N_t(i,n.length),r.staticFacet(L2e)||(i=i.asSingle()),new ei(r,n,i,r.dynamicSlots.map(()=>null),(a,o)=>o.create(a),null)}get tabSize(){return this.facet(ei.tabSize)}get lineBreak(){return this.facet(ei.lineSeparator)||` -`}get readOnly(){return this.facet(G_t)}phrase(e,...r){for(let n of this.facet(ei.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(F_t))for(let o of a(this,r,n))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){let r=this.languageDataAt("wordChars",e);return Evn(r.length?r[0]:"")}wordAt(e){let{text:r,from:n,length:i}=this.doc.lineAt(e),a=this.charCategorizer(e),o=e-n,s=e-n;for(;o>0;){let l=Ul(r,o,!1);if(a(r.slice(l,o))!=Ao.Word)break;o=l}for(;st.length?t[0]:4}),ei.lineSeparator=z_t,ei.readOnly=G_t,ei.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])}}),ei.languageData=F_t,ei.changeFilter=U_t,ei.transactionFilter=V_t,ei.transactionExtender=Q_t,$R.reconfigure=on.define();function E0(t,e,r={}){let n={};for(let i of t)for(let a of Object.keys(i)){let o=i[a],s=n[a];if(s===void 0)n[a]=o;else if(!(s===o||o===void 0))if(Object.hasOwnProperty.call(r,a))n[a]=r[a](s,o);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 k2{eq(e){return this==e}range(e,r=e){return N2e.create(e,r,this)}}k2.prototype.startSide=k2.prototype.endSide=0,k2.prototype.point=!1,k2.prototype.mapMode=xc.TrackDel;function P2e(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let N2e=class Xor{constructor(e,r,n){this.from=e,this.to=r,this.value=n}static create(e,r,n){return new Xor(e,r,n)}};function B2e(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}let _vn=class Kor{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 o=i,s=a.length;;){if(o==s)return o;let l=o+s>>1,u=a[l]-e||(n?this.value[l].endSide:this.value[l].startSide)-r;if(l==o)return u>=0?o:s;u>=0?s=l:o=l+1}}between(e,r,n,i){for(let a=this.findIndex(r,-1e9,!0),o=this.findIndex(n,1e9,!1,a);ap||f==p&&u.startSide>0&&u.endSide<=0)continue;(p-f||u.endSide-u.startSide)<0||(o<0&&(o=f),u.point&&(s=Math.max(s,p-f)),n.push(u),i.push(f-o),a.push(p-o))}return{mapped:n.length?new Kor(i,a,n,s):null,pos:o}}};class ti{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 ti(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,o=e.filter;if(r.length==0&&!o)return this;if(n&&(r=r.slice().sort(B2e)),this.isEmpty)return r.length?ti.of(r):this;let s=new q_t(this,null,-1).goto(0),l=0,u=[],h=new Qu;for(;s.value||l=0){let d=r[l++];h.addInner(d.from,d.to,d.value)||u.push(d)}else s.rangeIndex==1&&s.chunkIndexthis.chunkEnd(s.chunkIndex)||as.to||a=a&&e<=a+o.length&&o.between(a,e-a,r-a,n)===!1)return}this.nextLayer.between(e,r,n)}}iter(e=0){return b$.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,r=0){return b$.from(e).goto(r)}static compare(e,r,n,i,a=-1){let o=e.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=a),s=r.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=a),l=Y_t(o,s,n),u=new x$(o,l,a),h=new x$(s,l,a);n.iterGaps((d,f,p)=>j_t(u,d,h,f,p,i)),n.empty&&n.length==0&&j_t(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),o=r.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(a.length!=o.length)return!1;if(!a.length)return!0;let s=Y_t(a,o),l=new x$(a,s,0).goto(n),u=new x$(o,s,0).goto(n);for(;;){if(l.to!=u.to||!F2e(l.active,u.active)||l.point&&(!u.point||!P2e(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 o=new x$(e,null,a).goto(r),s=r,l=o.openStart;for(;;){let u=Math.min(o.to,n);if(o.point){let h=o.activeForPoint(o.to),d=o.pointFroms&&(i.span(s,u,o.active,l),l=o.openEnd(u));if(o.to>n)return l+(o.point&&o.to>n?1:0);s=o.to,o.next()}}static of(e,r=!1){let n=new Qu;for(let i of e instanceof N2e?[e]:r?Rvn(e):e)n.add(i.from,i.to,i.value);return n.finish()}static join(e){if(!e.length)return ti.empty;let r=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let i=e[n];i!=ti.empty;i=i.nextLayer)r=new ti(i.chunkPos,i.chunk,r,Math.max(i.maxPoint,r.maxPoint));return r}}ti.empty=new ti([],[],null,-1);function Rvn(t){if(t.length>1)for(let e=t[0],r=1;r0)return t.slice().sort(B2e);e=n}return t}ti.empty.nextLayer=ti.empty;class Qu{finishChunk(e){this.chunks.push(new _vn(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 Qu)).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(ti.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let r=ti.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,r}}function Y_t(t,e,r){let n=new Map;for(let a of t)for(let o=0;o=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 q_t(o,r,n,a));return i.length==1?i[0]:new b$(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--)$2e(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--)$2e(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(),$2e(this.heap,0)}}}function $2e(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 x${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=b$.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){xK(this.active,e),xK(this.activeTo,e),xK(this.activeRank,e),this.minActive=X_t(this.active,this.activeTo)}addActive(e){let r=0,{value:n,to:i,rank:a}=this.cursor;for(;r0;)r++;wK(this.active,r,n),wK(this.activeTo,r,i),wK(this.activeRank,r,a),e&&wK(e,r,this.cursor.from),this.minActive=X_t(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&&xK(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 j_t(t,e,r,n,i,a){t.goto(e),r.goto(n);let o=n+i,s=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,o);if(t.point||r.point?(t.point&&r.point&&P2e(t.point,r.point)&&F2e(t.activeForPoint(t.to),r.activeForPoint(r.to))||a.comparePoint(s,g,t.point,r.point),h=!1):(h&&a.boundChange(s),g>s&&!F2e(t.active,r.active)&&a.compareRange(s,g,t.active,r.active),u&&go)break;s=p,f<=0&&t.next(),f>=0&&r.next()}}function F2e(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 X_t(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=Ul(t,i)}return n===!0?-1:t.length}const U2e="ͼ",K_t=typeof Symbol>"u"?"__"+U2e:Symbol.for(U2e),V2e=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Z_t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class d1{constructor(e,r){this.rules=[];let{finish:n}=r||{};function i(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function a(o,s,l,u){let h=[],d=/^@(\w+)\b/.exec(o[0]),f=d&&d[1]=="keyframes";if(d&&s==null)return l.push(o[0]+";");for(let p in s){let g=s[p];if(/&/.test(p))a(p.split(/,\s*/).map(m=>o.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?o.map(n):o).join(", ")+" {"+h.join(" ")+"}")}for(let o in e)a(i(o),e[o],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let e=Z_t[K_t]||1;return Z_t[K_t]=e+1,U2e+e.toString(36)}static mount(e,r,n){let i=e[V2e],a=n&&n.nonce;i?a&&i.setNonce(a):i=new Dvn(e,a),i.mount(Array.isArray(r)?r:[r],e)}}let J_t=new Map;class Dvn{constructor(e,r){let n=e.ownerDocument||e,i=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let a=J_t.get(n);if(a)return e[V2e]=a;this.sheet=new i.CSSStyleSheet,J_t.set(n,this)}else this.styleTag=n.createElement("style"),r&&this.styleTag.setAttribute("nonce",r);this.modules=[],e[V2e]=this}mount(e,r){let n=this.sheet,i=0,a=0;for(let o=0;o-1&&(this.modules.splice(l,1),a--,l=-1),l==-1){if(this.modules.splice(a++,0,s),n)for(let u=0;u",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Lvn=typeof navigator<"u"&&/Mac/.test(navigator.platform),Mvn=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),wc=0;wc<10;wc++)E2[48+wc]=E2[96+wc]=String(wc);for(var wc=1;wc<=24;wc++)E2[wc+111]="F"+wc;for(var wc=65;wc<=90;wc++)E2[wc]=String.fromCharCode(wc+32),w$[wc]=String.fromCharCode(wc);for(var Q2e in E2)w$.hasOwnProperty(Q2e)||(w$[Q2e]=E2[Q2e]);function Ivn(t){var e=Lvn&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Mvn&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",r=!e&&t.key||(t.shiftKey?w$:E2)[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 xa(){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:i5t||/Mac/.test(Gu.platform),windows:/Win/.test(Gu.platform),linux:/Linux|X11/.test(Gu.platform),ie:AK,ie_version:t5t?G2e.documentMode||6:W2e?+W2e[1]:H2e?+H2e[1]:0,gecko:r5t,gecko_version:r5t?+(/Firefox\/(\d+)/.exec(Gu.userAgent)||[0,0])[1]:0,chrome:!!Y2e,chrome_version:Y2e?+Y2e[1]:0,ios:i5t,android:/Android\b/.test(Gu.userAgent),webkit:n5t,webkit_version:n5t?+(/\bAppleWebKit\/(\d+)/.exec(Gu.userAgent)||[0,0])[1]:0,safari:q2e,safari_version:q2e?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Gu.userAgent)||[0,0])[1]:0,tabSize:G2e.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function j2e(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 SK=Object.create(null);function X2e(t,e,r){if(t==e)return!0;t||(t=SK),e||(e=SK);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 Pvn(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 a5t(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 Nvn(t){let e=Object.create(null);for(let r=0;r0?3e8:-4e8:r>0?1e8:-1e8,new oC(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:o}=o5t(e,r);n=(a?r?-3e8:-1:5e8)-1,i=(o?r?2e8:1:-6e8)+1}return new oC(e,n,i,r,e.widget||null,!0)}static line(e){return new S$(e)}static set(e,r=!1){return ti.of(e,r)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ar.none=ti.empty;class A$ extends Ar{constructor(e){let{start:r,end:n}=o5t(e);super(r?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?j2e(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||SK}eq(e){return this==e||e instanceof A$&&this.tagName==e.tagName&&X2e(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)}}A$.prototype.point=!1;class S$ extends Ar{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof S$&&this.spec.class==e.spec.class&&X2e(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)}}S$.prototype.mapMode=xc.TrackBefore,S$.prototype.point=!0;class oC extends Ar{constructor(e,r,n,i,a,o){super(r,n,a,e),this.block=i,this.isReplace=o,this.mapMode=i?r<=0?xc.TrackBefore:xc.TrackAfter:xc.TrackDel}get type(){return this.startSide!=this.endSide?Ac.WidgetRange:this.startSide<=0?Ac.WidgetBefore:Ac.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof oC&&Bvn(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)}}oC.prototype.point=!0;function o5t(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 Bvn(t,e){return t==e||!!(t&&e&&t.compare(e))}function zR(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 T$ extends k2{constructor(e,r,n){super(),this.tagName=e,this.attributes=r,this.rank=n}eq(e){return e==this||e instanceof T$&&this.tagName==e.tagName&&X2e(this.attributes,e.attributes)}static create(e){return new T$(e.tagName,e.attributes||SK,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,r=!1){return ti.of(e,r)}}T$.prototype.startSide=T$.prototype.endSide=-1;function C$(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function K2e(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function O$(t,e){if(!e.anchorNode)return!1;try{return K2e(t,e.anchorNode)}catch{return!1}}function k$(t){return t.nodeType==3?R$(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function E$(t,e,r,n){return r?s5t(t,e,r,n,-1)||s5t(t,e,r,n,1):!1}function _2(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function TK(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function s5t(t,e,r,n,i){for(;;){if(t==r&&e==n)return!0;if(e==(i<0?0:f1(t))){if(t.nodeName=="DIV")return!1;let a=t.parentNode;if(!a||a.nodeType!=1)return!1;e=_2(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?f1(t):0}else return!1}}function f1(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function _$(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 $vn(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 l5t(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 Fvn(t,e,r,n,i,a,o,s){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=$vn(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}=l5t(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+o)):e.bottom>f.bottom-o&&(y=e.bottom-f.bottom+o,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 c5t(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 zvn{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?f1(r):0),n,Math.min(e.focusOffset,n?f1(n):0))}set(e,r,n,i){this.anchorNode=e,this.anchorOffset=r,this.focusNode=n,this.focusOffset=i}}let sC=null;br.safari&&br.safari_version>=26&&(sC=!1);function u5t(t){if(t.setActive)return t.setActive();if(sC)return t.focus(sC);let e=[];for(let r=t;r&&(e.push(r,r.scrollTop,r.scrollLeft),r!=r.ownerDocument);r=r.parentNode);if(t.focus(sC==null?{get preventScroll(){return sC={preventScroll:!0},!0}}:void 0),!sC){sC=!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 f5t(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=f1(r)}else if(r.parentNode&&!TK(r))n=_2(r),r=r.parentNode;else return null}}function p5t(t,e){for(let r=t,n=e;;){if(r.nodeType==3&&n=r){if(s.level==n)return o;(a<0||(i!=0?i<0?s.fromr:e[a].level>s.level))&&(a=o)}}if(a<0)throw new RangeError("Index out of range");return a}}function v5t(t,e){if(t.length!=e.length)return!1;for(let r=0;r=0;m-=3)if(_0[m+1]==-p){let v=_0[m+2],y=v&2?i:v&4?v&1?a:i:0;y&&(Da[d]=Da[_0[m]]=y),s=m;break}}else{if(_0.length==189)break;_0[s++]=d,_0[s++]=f,_0[s++]=l}else if((g=Da[d])==2||g==1){let m=g==i;l=m?0:1;for(let v=s-3;v>=0;v-=3){let y=_0[v+2];if(y&2)break;if(m)_0[v+2]|=2;else{if(y&4)break;_0[v+2]|=4}}}}}function qvn(t,e,r,n){for(let i=0,a=n;i<=r.length;i++){let o=i?r[i-1].to:t,s=il;)g==v&&(g=r[--m].from,v=m?r[m-1].to:t),Da[--g]=p;l=h}else a=u,l++}}}function ewe(t,e,r,n,i,a,o){let s=n%2?2:1;if(n%2==i%2)for(let l=e,u=0;ll&&o.push(new R0(l,m.from,p));let v=m.direction==lC!=!(p%2);twe(t,v?n+1:n,i,m.inner,m.from,m.to,o),l=m.to}g=m.to}else{if(g==r||(h?Da[g]!=s:Da[g]==s))break;g++}f?ewe(t,l,g,n+1,i,f,o):le;){let h=!0,d=!1;if(!u||l>a[u-1].to){let m=Da[l-1];m!=s&&(h=!1,d=m==16)}let f=!h&&s==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(Da[v-1]==s)break e;break}}if(f)f.push(m);else{m.toDa.length;)Da[Da.length]=256;let n=[],i=e==lC?0:1;return twe(t,i,i,r,0,t.length,n),n}function y5t(t){return[new R0(0,t,0)]}let b5t="";function Xvn(t,e,r,n,i){var a;let o=n.head-t.from,s=R0.find(e,o,(a=n.bidiLevel)!==null&&a!==void 0?a:-1,n.assoc),l=e[s],u=l.side(i,r);if(o==u){let f=s+=i?1:-1;if(f<0||f>=e.length)return null;l=e[s=f],o=l.side(!i,r),u=l.side(i,r)}let h=Ul(t.text,o,l.forward(i,r));(hl.to)&&(h=u),b5t=t.text.slice(Math.min(o,h),Math.max(o,h));let d=s==(i?e.length-1:0)?null:e[s+(i?1:-1)];return d&&h==u&&d.level+(i?0:1)t.some(e=>e)}),k5t=vr.define({combine:t=>t.some(e=>e)}),E5t=vr.define();class VR{constructor(e,r,n,i,a,o=!1){this.range=e,this.y=r,this.x=n,this.yMargin=i,this.xMargin=a,this.isSnapshot=o}map(e){return e.empty?this:new VR(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 VR(xt.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const CK=on.define({map:(t,e)=>t.map(e)}),_5t=on.define();function qh(t,e,r){let n=t.facet(S5t);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 p1=vr.define({combine:t=>t.length?t[0]:!0});let Zvn=0;const QR=vr.define({combine(t){return t.filter((e,r)=>{for(let n=0;n{let l=[];return o&&l.push(OK.of(u=>{let h=u.plugin(s);return h?o(h):Ar.none})),a&&l.push(a(s)),l})}static fromClass(e,r){return Ro.define((n,i)=>new e(n,i),r)}}class awe{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(qh(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){qh(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){qh(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const R5t=vr.define(),owe=vr.define(),OK=vr.define(),D5t=vr.define(),swe=vr.define(),D$=vr.define(),L5t=vr.define();function M5t(t,e){let r=t.state.facet(L5t);if(!r.length)return r;let n=r.map(a=>a instanceof Function?a(t):a),i=[];return ti.spans(n,e.from,e.to,{point(){},span(a,o,s,l){let u=a-e.from,h=o-e.from,d=i;for(let f=s.length-1;f>=0;f--,l--){let p=s[f].spec.bidiIsolate,g;if(p==null&&(p=Kvn(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 I5t=vr.define();function lwe(t){let e=0,r=0,n=0,i=0;for(let a of t.state.facet(I5t)){let o=a(t);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(r=Math.max(r,o.right)),o.top!=null&&(n=Math.max(n,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:e,right:r,top:n,bottom:i}}const L$=vr.define();class xp{constructor(e,r,n,i){this.fromA=e,this.toA=r,this.fromB=n,this.toB=i}join(e){return new xp(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 xp(a,o,s,l))),this.changedRanges=i}static create(e,r,n){return new kK(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 Jvn=[];class Zo{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 Jvn}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&&Pvn(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=_2(this.dom),i=this.length?e>0:r>0;return new Mg(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 _K)return e;return null}static get(e){return e.cmTile}}class EK extends Zo{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,o=0;for(let s of this.children){if(s.sync(e),o+=s.length+s.breakAfter,i=n?n.nextSibling:r.firstChild,a&&i!=s.dom&&(a.written=!0),s.dom.parentNode==r)for(;i&&i!=s.dom;)i=P5t(i);else r.insertBefore(s.dom,i);n=s.dom}for(i=n?n.nextSibling:r.firstChild,a&&i&&(a.written=!0);i;)i=P5t(i);this.length=o}}function P5t(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class _K extends EK{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=Zo.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 o=n.children[i++];if(o instanceof g1)r.push(i),n=o,i=0;else{let s=a+o.length,l=e(o,a);if(l!==void 0)return l;a=s+o.breakAfter}}}resolveBlock(e,r){let n,i=-1,a,o=-1;if(this.blockTiles((s,l)=>{let u=l+s.length;if(e>=l&&e<=u){if(s.isWidget()&&r>=-1&&r<=1){if(s.flags&32)return!0;s.flags&16&&(n=void 0)}(le||e==l&&(r>1?s.length:s.covers(-1)))&&(!a||!s.isWidget()&&a.isWidget())&&(a=s,o=e-l)}}),!n&&!a)throw new Error("No tile at position "+e);return n&&r<0||!a?{tile:n,offset:i}:{tile:a,offset:o}}}class g1 extends EK{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 g1(r||document.createElement(e.tagName),e);return r||(n.flags|=4),n}}class GR extends EK{constructor(e,r){super(e),this.attrs=r}isLine(){return!0}static start(e,r,n){let i=new GR(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,o=null,s=-1;function l(h,d){for(let f=0,p=0;f=d&&(g.isComposite()?l(g,d-p):(!o||o.isHidden&&(r>0&&!(o.flags&32)||n&&tyn(o,g)))&&(m>d||g.flags&32)?(o=g,s=d-p):(pi&&(e=i);let a=e,o=e,s=0;e==0&&r<0||e==i&&r>=0?br.chrome||br.gecko||(e?(a--,s=1):o=0)?0:l.length-1];return br.safari&&!s&&u.width==0&&(u=Array.prototype.find.call(l,h=>h.width)||u),n==null?u:_$(u,(s?s>0:r<0)==n)}static of(e,r){let n=new cC(r||document.createTextNode(e),e);return r||(n.flags|=2),n}}class uC extends Zo{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 _$(this.dom.getBoundingClientRect(),this.length?e==0:r<=0);{let a=this.dom.getClientRects(),o=null;if(!a.length)return null;let s=this.flags&16?!0:this.flags&32?!1:e>0;for(let l=s?a.length-1:0;o=a[l],!(e>0?l==0:l==a.length-1||o.top0==n)}}class ryn{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,r,n){let{tile:i,index:a,beforeBreak:o,parents:s}=this;for(;e||r>0;)if(i.isComposite())if(o){if(!e)break;n&&n.break(),e--,o=!1}else if(a==i.children.length){if(!e&&!s.length)break;n&&n.leave(i),o=!!i.breakAfter,{tile:i,index:a}=s.pop(),a++}else{let l=i.children[a],u=l.breakAfter;(r>0?l.length<=e:l.length=0;s--){let l=r.marks[s],u=i.lastChild;if(u instanceof jh&&u.mark.eq(l.mark))u.dom!=l.dom&&u.setDOM(cwe(l.dom)),i=u;else{if(this.cache.reused.get(l)){let d=Zo.get(l.dom);d&&d.setDOM(cwe(l.dom))}let h=jh.of(l.mark,l.dom);i.append(h),i=h}this.cache.reused.set(l,2)}let a=Zo.get(e.text);a&&this.cache.reused.set(a,2);let o=new cC(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,i.append(o)}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=B5t);let i=GR.start(e,r||((n=this.cache.find(GR))===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 o=e[a],s;if(r>0&&(s=i.lastChild)&&s instanceof jh&&s.mark.eq(o))i=s,r--;else{let l=jh.of(o,(n=this.cache.find(jh,u=>u.mark.eq(o)))===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||!N5t(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(br.ios&&N5t(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(uwe,0,32)||new uC(uwe.toDOM(),0,uwe,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 nyn(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.fromo.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(RK,void 0,1);return n&&(n.flags=r),n||new RK(r)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class ayn{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:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=i;let s=this.textOff=Math.min(e,i.length);return a?null:i.slice(0,s)}let r=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,r);return this.textOff=r,n}}const DK=[uC,GR,cC,jh,RK,g1,_K];for(let t=0;t[]),this.index=DK.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],o=this.index[i];for(let s=0;s{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,r){let n=r&&this.getCompositionContext(r.text);for(let i=0,a=0,o=0;;){let s=oi){let u=l-i;this.preserve(u,!o,!s),i=l,a+=u}if(!s)break;r&&s.fromA<=r.range.fromA&&s.toA>=r.range.toA?(this.forward(s.fromA,r.range.fromA,r.range.fromA{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(l-s);else{let u=l>0||s{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof jh&&i.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?i.length&&(i.length=a=0):o instanceof jh&&(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,o=ti.spans(this.decorations,e,r,{point:(s,l,u,h,d,f)=>{if(u instanceof oC){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(s).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-s);else{let p=u.widget||(u.block?HR.block:HR.inline),g=lyn(u),m=this.cache.findWidget(p,l-s,g)||uC.of(p,this.view,l-s,g);u.block?(u.startSide>0&&i.addLineStartIfNotCovered(n),i.addBlockWidget(m)):(i.ensureLine(n),i.addInlineWidget(m,h,d))}n=null}else n=cyn(n,u);l>s&&this.text.skip(l-s)},span:(s,l,u,h)=>{for(let d=s;d-1&&(this.openWidget=o>a),this.openWidget||i.addLineStartIfNotCovered(n),this.openMarks=o}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=Zo.get(i);if(i==this.view.contentDOM)break;a instanceof jh?r.push(a):a!=null&&a.isLine()?n=a:a instanceof g1||(i.nodeName=="DIV"&&!n&&i!=this.view.contentDOM?n=new GR(i,B5t):n||r.push(jh.of(new A$({tagName:i.nodeName.toLowerCase(),attributes:Nvn(i)}),i)))}return{line:n,marks:r}}}function N5t(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 lyn(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 B5t={class:"cm-line"};function cyn(t,e){let r=e.spec.attributes,n=e.spec.class;return!r&&!n||(t||(t={class:"cm-line"}),r&&j2e(r,t),n&&(t.class+=" "+n)),t}function uyn(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 jh&&e.push(n.mark)}return e}function cwe(t){let e=Zo.get(t);return e&&e.setDOM(t.cloneNode()),t}class HR extends Hu{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}}HR.inline=new HR("span"),HR.block=new HR("div");const uwe=new class extends Hu{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class $5t{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 _K(e,e.contentDOM),this.updateInner([new xp(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:!byn(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let a=i>-1?dyn(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:h,to:d}=this.hasComposition;n=new xp(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 o=this.decorations,s=this.blockWrappers;this.updateDeco();let l=gyn(o,this.decorations,e.changes);l.length&&(n=xp.extendWithRanges(n,l));let u=vyn(s,this.blockWrappers,e.changes);return u.length&&(n=xp.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 o=this.tile,s=new syn(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);r&&Zo.get(r.text)&&s.cache.reused.set(Zo.get(r.text),2),this.tile=s.run(e,r),hwe(o,s.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)&&O$(n,this.view.observer.selectionRange)&&!(i&&n.contains(i));if(!(a||r||o))return;let s=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&&hyn(u)){let f=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(f,u.node.childNodes[u.offset]||null)),u=h=new Mg(f,0),s=!0}let d=this.view.observer.selectionRange;(s||!d.focusNode||(!E$(u.node,u.offset,d.anchorNode,d.anchorOffset)||!E$(h.node,h.offset,d.focusNode,d.focusOffset))&&!this.suppressWidgetCursorChange(d,l))&&(this.view.observer.ignore(()=>{br.android&&br.chrome&&n.contains(d.focusNode)&&yyn(d.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let f=C$(this.view.root);if(f)if(l.empty){if(br.gecko){let p=fyn(u.node,u.offset);if(p&&p!=3){let g=(p==1?f5t:p5t)(u.node,u.offset);g&&(u=new Mg(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)}o&&this.view.root.activeElement==n&&(n.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(u,h)),this.impreciseAnchor=u.precise?null:new Mg(d.anchorNode,d.anchorOffset),this.impreciseHead=h.precise?null:new Mg(d.focusNode,d.focusOffset)}suppressWidgetCursorChange(e,r){return this.hasComposition&&r.empty&&E$(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=C$(e.root),{anchorNode:i,anchorOffset:a}=e.observer.selectionRange;if(!n||!r.empty||!r.assoc||!n.modify)return;let o=this.lineAt(r.head,r.assoc);if(!o)return;let s=o.posAtStart;if(r.head==s||r.head==s+o.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 o=f1(e)==0?0:r==0?-1:1;for(;;){let s=e.parentNode;if(s==n.dom)break;o==0&&s.firstChild!=s.lastChild&&(e==s.firstChild?o=-1:o=1),e=s}o<0?a=e:a=e.nextSibling}if(a==n.dom.firstChild)return i;for(;a&&!Zo.get(a);)a=a.nextSibling;if(!a)return i+n.length;for(let o=0,s=i;;o++){let l=n.children[o];if(l.dom==a)return s;s+=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,o,s=-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&&!o&&(o=u,s=e-h,l=h>e),h>e&&o)return!0}}),!n&&!o?this.domAtPos(e,r):(a&&o?n=null:l&&n&&(o=null),n&&r<0||!o?n.domIn(i,r):o.domIn(s,r))}coordsAt(e,r,n){let{tile:i,offset:a}=this.tile.resolveBlock(e,r);return i.isWidget()?i.widget instanceof dwe?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,o){if(a.isComposite())for(let s of a.children){if(s.length>=o){let l=i(s,o);if(l)return l}if(o-=s.length,o<0)break}else if(a.isText()&&oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,s=-1,l=this.view.textDirection==Ra.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 g1)v>n&&h(m,f,y);else if(f>=n&&(u>0&&r.push(-u),r.push(b+u),u=0,o)){let x=m.dom.lastChild,w=x?k$(x):[];if(w.length){let A=w[w.length-1],S=l?A.right-y.left:y.right-A.left;S>s&&(s=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"?Ra.RTL:Ra.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let s=0,l;for(let u of o.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let h=k$(u.dom);if(h.length!=1)return;s+=h[0].width,l=h[0].height}if(s)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:s/o.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 o=k$(r.firstChild)[0];n=r.getBoundingClientRect().height,i=o&&o.width?o.width/27:7,a=o&&o.height?o.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],o=a?a.from-1:this.view.state.doc.length;if(o>n){let s=(r.lineBlockAt(o).bottom-r.lineBlockAt(n).top)/this.view.scaleY;e.push(Ar.replace({widget:new dwe(s),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!a)break;n=a.to+1}return Ar.set(e)}updateDeco(){let e=1,r=this.view.state.facet(OK).map(a=>(this.dynamicDecorationMap[e++]=typeof a=="function")?a(this.view):a),n=!1,i=this.view.state.facet(swe).map((a,o)=>{let s=typeof a=="function";return s&&(n=!0),s?a(this.view):a});for(i.length&&(this.dynamicDecorationMap[e++]=n,r.push(ti.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(E5t))try{if(u(this.view,e.range,e))return!0}catch(h){qh(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=lwe(this.view),o={left:n.left-a.left,top:n.top-a.top,right:n.right+a.right,bottom:n.bottom+a.bottom},{offsetWidth:s,offsetHeight:l}=this.view.scrollDOM;if(Fvn(this.view.scrollDOM,o,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(){hwe(this.tile)}}function hwe(t,e){let r=e==null?void 0:e.get(t);if(r!=1){r==null&&t.destroy();for(let n of t.children)hwe(n,e)}}function hyn(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 F5t(t,e){let r=t.observer.selectionRange;if(!r.focusNode)return null;let n=f5t(r.focusNode,r.focusOffset),i=p5t(r.focusNode,r.focusOffset),a=n||i;if(i&&n&&i.node!=n.node){let s=Zo.get(i.node);if(!s||s.isText()&&s.text!=i.node.nodeValue)a=i;else if(t.docView.lastCompositionAfterCursor){let l=Zo.get(n.node);!l||l.isText()&&l.text!=n.node.nodeValue||(a=i)}}if(t.docView.lastCompositionAfterCursor=a!=n,!a)return null;let o=e-a.offset;return{from:o,to:o+a.node.nodeValue.length,node:a.node}}function dyn(t,e,r){let n=F5t(t,r);if(!n)return null;let{node:i,from:a,to:o}=n,s=i.nodeValue;if(/[\n\r]/.test(s)||t.state.doc.sliceString(n.from,n.to)!=s)return null;let l=e.invertedDesc;return{range:new xp(l.mapPos(a),l.mapPos(o),a,o),text:i}}function fyn(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e{ne.from&&(r=!0)}),r}class dwe extends Hu{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 xyn(t,e,r=1){let n=t.charCategorizer(e),i=t.doc.lineAt(e),a=e-i.from;if(i.length==0)return xt.cursor(e);a==0?r=1:a==i.length&&(r=-1);let o=a,s=a;r<0?o=Ul(i.text,a,!1):s=Ul(i.text,a);let l=n(i.text.slice(o,s));for(;o>0;){let u=Ul(i.text,o,!1);if(n(i.text.slice(u,o))!=l)break;o=u}for(;st.defaultLineHeight*1.5){let s=t.viewState.heightOracle.textHeight,l=Math.floor((i-r.top-(t.defaultLineHeight-s)*.5)/s);a+=l*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(r.from,r.to);return r.from+z2e(o,a,t.state.tabSize)}function fwe(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==Ac.Text&&(i.type!=a.type||(r<0?a.frome)))&&(i=a)}}return i||n}return n}function Ayn(t,e,r,n){let i=fwe(t,e.head,e.assoc||-1),a=!n||i.type!=Ac.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(a){let o=t.dom.getBoundingClientRect(),s=t.textDirectionAt(i.from),l=t.posAtCoords({x:r==(s==Ra.LTR)?o.right-1:o.left+1,y:(a.top+a.bottom)/2});if(l!=null)return xt.cursor(l,r?-1:1)}return xt.cursor(r?i.to:i.from,r?-1:1)}function z5t(t,e,r,n){let i=t.state.doc.lineAt(e.head),a=t.bidiSpans(i),o=t.textDirectionAt(i.from);for(let s=e,l=null;;){let u=Xvn(i,a,o,s,r),h=b5t;if(!u){if(i.number==(r?t.state.doc.lines:1))return s;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 s}else{if(!n)return u;l=n(h)}s=u}}function Syn(t,e,r){let n=t.state.charCategorizer(e),i=n(r);return a=>{let o=n(a);return i==Ao.Space&&(i=o),i==o}}function Tyn(t,e,r,n){let i=e.head,a=r?1:-1;if(i==(r?t.state.doc.length:0))return xt.cursor(i,e.assoc);let o=e.goalColumn,s,l=t.contentDOM.getBoundingClientRect(),u=t.coordsAtPos(i,e.assoc||((e.empty?r:e.head==e.from)?1:-1)),h=t.documentTop;if(u)o==null&&(o=u.left-l.left),s=a<0?u.top:u.bottom;else{let g=t.viewState.lineBlockAt(i);o==null&&(o=Math.min(l.right-l.left,t.defaultCharacterWidth*(i-g.from))),s=(a<0?g.top:g.bottom)+h}let d=l.left+o,f=t.viewState.heightOracle.textHeight>>1,p=n??f;for(let g=0;;g+=f){let m=s+(p+g)*a,v=gwe(t,{x:d,y:m},!1,a);if(r?m>l.bottom:ms:b{if(e>a&&ei(t)),r.from,e.head>r.from?-1:1);return n==r.from?r:xt.cursor(n,nt.viewState.docHeight)return new D0(t.state.doc.length,-1);if(u=t.elementAtHeight(l),n==null)break;if(u.type==Ac.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==Ac.Text){let d=wyn(t,i,u,o,s);return new D0(d,d==u.from?1:-1)}}if(u.type!=Ac.Text)return l<(u.top+u.bottom)/2?new D0(u.from,1):new D0(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 Cyn(t,o,s,t.textDirectionAt(u.from)).scanTile(h,u.from)}class Cyn{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(o.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=(s?this.dirAt(e[h],1):this.baseDir)==Ra.LTR;return{i:h,after:this.x>(f.left+f.right)/2==p}}scanText(e,r){let n=[];for(let a=0;a{let o=n[a]-r,s=n[a+1]-r;return R$(e.dom,o,s).getClientRects()});return i.after?new D0(n[i.i+1],-1):new D0(n[i.i],1)}scanTile(e,r){if(!e.length)return new D0(r,1);if(e.children.length==1){let s=e.children[0];if(s.isText())return this.scanText(s,r);if(s.isComposite())return this.scanTile(s,r)}let n=[r];for(let s=0,l=r;s{let l=e.children[s];return l.flags&48?null:(l.dom.nodeType==1?l.dom:R$(l.dom,0,l.length)).getClientRects()}),a=e.children[i.i],o=n[i.i];return a.isText()?this.scanText(a,o):a.isComposite()?this.scanTile(a,o):i.after?new D0(n[i.i+1],-1):new D0(o,1)}}const WR="￿";class Oyn{constructor(e,r){this.points=e,this.view=r,this.text="",this.lineSeparator=r.state.facet(ei.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=WR}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 o=Zo.get(i),s=i.nextSibling;if(s==r){o!=null&&o.breakAfter&&!s&&n!=this.view.contentDOM&&this.lineBreak();break}let l=Zo.get(s);(o&&l?o.breakAfter:(o?o.breakAfter:TK(i))||TK(s)&&(i.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>a)&&!Eyn(s,r)&&this.lineBreak(),i=s}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,o=1,s;if(this.lineSeparator?(a=r.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(s=i.exec(r))&&(a=s.index,o=s[0].length),this.append(r.slice(n,a<0?r.length:a)),a<0)break;if(this.lineBreak(),o>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=o-1);n=a+o}}readNode(e){let r=Zo.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+(kyn(e,n.node,n.offset)?r:0))}}function kyn(t,e,r){for(;;){if(!e||r-1;let{impreciseHead:a,impreciseAnchor:o}=e.docView,s=e.state.selection;if(e.state.readOnly&&r>-1)this.newSel=null;else if(r>-1&&(this.bounds=Q5t(e.docView.tile,r,n,0))){let l=a||o?[]:Dyn(e),u=new Oyn(l,e);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=Lyn(l,this.bounds.from)}else{let l=e.observer.selectionRange,u=a&&a.node==l.focusNode&&a.offset==l.focusOffset||!K2e(e.contentDOM,l.focusNode)?s.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),h=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!K2e(e.contentDOM,l.anchorNode)?s.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),d=e.viewport;if((br.ios||br.chrome)&&u!=h&&Math.min(u,h)<=s.main.from&&Math.max(u,h)>=s.main.to&&(d.from>0||d.to-1&&s.ranges.length>1)this.newSel=s.replaceRange(xt.range(h,u));else if(e.lineWrapping&&h==u&&!(s.main.empty&&s.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=xt.create([xt.cursor(u,p)])}else this.newSel=xt.single(h,u)}}}function Q5t(t,e,r,n){if(t.isComposite()){let i=-1,a=-1,o=-1,s=-1;for(let l=0,u=n,h=n;lr)return Q5t(d,e,r,u);if(f>=e&&i==-1&&(i=l,a=u),u>r&&d.dom.parentNode==t.dom){o=l,s=h;break}h=f,u=f+d.breakAfter}return{from:a,to:s<0?n+t.length:s,startDOM:(i?t.children[i-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:o=0?t.children[o].dom:null}}else return t.isText()?{from:n,to:n+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function G5t(t,e){let r,{newSel:n}=e,{state:i}=t,a=i.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:s,to:l}=e.bounds,u=a.from,h=null;(o===8||br.android&&e.text.length=s&&a.to<=l&&(e.typeOver||d!=e.text)&&d.slice(0,a.from-s)==e.text.slice(0,a.from-s)&&d.slice(a.to-s)==e.text.slice(f=e.text.length-(d.length-(a.to-s)))?r={from:a.from,to:a.to,insert:wi.of(e.text.slice(a.from-s,f).split(WR))}:(p=H5t(d,e.text,u-s,h))&&(br.chrome&&o==13&&p.toB==p.from+2&&e.text.slice(p.from,p.toB)==WR+WR&&p.toB--,r={from:s+p.from,to:s+p.toA,insert:wi.of(e.text.slice(p.from,p.toB).split(WR))})}else n&&(!t.hasFocus&&i.facet(p1)||LK(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=xt.single(n.main.anchor-1,n.main.head-1)),r={from:r.from,to:r.to,insert:wi.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=xt.single(n.main.anchor-1,n.main.head-1)),r={from:a.from,to:a.to,insert:wi.of([" "])}),r)return mwe(t,r,n,o);if(n&&!LK(n,a)){let s=!1,l="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(s=!0),l=t.inputState.lastSelectionOrigin,l=="select.pointer"&&(n=U5t(i.facet(D$).map(u=>u(t)),n))),t.dispatch({selection:n,scrollIntoView:s,userEvent:l}),!0}else return!1}function mwe(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&&UR(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||n==8&&e.insert.lengthi.head)&&UR(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&UR(t.contentDOM,"Delete",46)))return!0;let a=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,s=()=>o||(o=Ryn(t,e,r));return t.state.facet(T5t).some(l=>l(t,e.from,e.to,a,s))||t.dispatch(s()),!0}function Ryn(t,e,r){let n,i=t.state,a=i.selection.main,o=-1;if(e.from==e.to&&e.froma.to){let l=e.fromd(t)),u,l);e.from==h&&(o=h)}if(o>-1)n={changes:e,selection:xt.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&&F5t(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?xt.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 s="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,s+=".compose",t.inputState.compositionFirstChange&&(s+=".start",t.inputState.compositionFirstChange=!1)),i.update(n,{userEvent:s,scrollIntoView:!0})}function H5t(t,e,r,n){let i=Math.min(t.length,e.length),a=0;for(;a0&&s>0&&t.charCodeAt(o-1)==e.charCodeAt(s-1);)o--,s--;if(n=="end"){let l=Math.max(0,a-Math.min(o,s));r-=o+l-a}if(o=o?a-r:0;a-=l,s=a+(s-o),o=a}else if(s=s?a-r:0;a-=l,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function Dyn(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 V5t(r,n)),(i!=r||a!=n)&&e.push(new V5t(i,a))),e}function Lyn(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?xt.single(r+e,n+e):null}function LK(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class Myn{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&&jyn(e.contentDOM.ownerDocument)}handleEvent(e){!Vyn(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=Pyn(e),n=this.handlers,i=this.view.contentDOM;for(let a in r)if(a!="scroll"){let o=!r[a].handlers.length,s=n[a];s&&o!=!s.handlers.length&&(i.removeEventListener(a,this.handleEvent),s=null),s||i.addEventListener(a,this.handleEvent,{passive:o})}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&&q5t.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&&(Y5t.some(r=>r.keyCode==e.keyCode)&&!e.ctrlKey||Nyn.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)&&Iyn(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 Iyn(t){return t.visualViewport?t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85:!1}function W5t(t,e){return(r,n)=>{try{return e.call(t,n,r)}catch(i){qh(r.state,i)}}}function Pyn(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,o=i&&i.plugin.domEventObservers;if(a)for(let s in a){let l=a[s];l&&r(s).handlers.push(W5t(n.value,l))}if(o)for(let s in o){let l=o[s];l&&r(s).observers.push(W5t(n.value,l))}}for(let n in Ig)r(n).handlers.push(Ig[n]);for(let n in Wu)r(n).observers.push(Wu[n]);return e}const Y5t=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Nyn="dthko",q5t=[16,17,18,20,91,92,224,225],MK=6;function IK(t){return Math.max(0,t)*.7+8}function Byn(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class $yn{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=c5t(e.contentDOM),this.atoms=e.state.facet(D$).map(o=>o(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(ei.allowMultipleSelections)&&Fyn(e,r),this.dragging=Uyn(e,r)&&tRt(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&&Byn(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let r=0,n=0,i=0,a=0,o=this.view.win.innerWidth,s=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:a,bottom:s}=this.scrollParents.y.getBoundingClientRect());let l=lwe(this.view);e.clientX-l.left<=i+MK?r=-IK(i-e.clientX):e.clientX+l.right>=o-MK&&(r=IK(e.clientX-o)),e.clientY-l.top<=a+MK?n=-IK(a-e.clientY):e.clientY+l.bottom>=s-MK&&(n=IK(e.clientY-s)),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=U5t(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 Fyn(t,e){let r=t.state.facet(x5t);return r.length?r[0](e):br.mac?e.metaKey:e.ctrlKey}function zyn(t,e){let r=t.state.facet(w5t);return r.length?r[0](e):br.mac?!e.altKey:!e.ctrlKey}function Uyn(t,e){let{main:r}=t.state.selection;if(r.empty)return!1;let n=C$(t.root);if(!n||n.rangeCount==0)return!0;let i=n.getRangeAt(0).getClientRects();for(let a=0;a=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Vyn(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=Zo.get(r))&&n.isWidget()&&!n.isHidden&&n.widget.ignoreEvent(e))return!1;return!0}const Ig=Object.create(null),Wu=Object.create(null),j5t=br.ie&&br.ie_version<15||br.ios&&br.webkit_version<604;function Qyn(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(),X5t(t,r.value)},50)}function PK(t,e,r){for(let n of t.facet(e))r=n(r,t);return r}function X5t(t,e){e=PK(t.state,nwe,e);let{state:r}=t,n,i=1,a=r.toText(e),o=a.lines==r.selection.ranges.length;if(vwe!=null&&r.selection.ranges.every(l=>l.empty)&&vwe==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((o?a.line(i++).text:e)+r.lineBreak);return{changes:{from:h.from,insert:d},range:xt.cursor(u.from+d.length)}})}else o?n=r.changeByRange(l=>{let u=a.line(i++);return{changes:{from:l.from,to:l.to,insert:u.text},range:xt.cursor(l.from+u.length)}}):n=r.replaceSelection(a);t.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Wu.scroll=t=>{let e=t.inputState;e.lastScrollTop=t.scrollDOM.scrollTop,e.lastScrollLeft=t.scrollDOM.scrollLeft,br.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())},Wu.wheel=Wu.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()},Ig.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1),Wu.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")},Wu.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},Wu.touchend=(t,e)=>{t.inputState.touchActive=!1},Ig.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(A5t))if(r=n(t,e),r)break;if(!r&&e.button==0&&(r=Hyn(t,e)),r){let n=!t.hasFocus;t.inputState.startMouseSelection(new $yn(t,e,r,n)),n&&t.observer.ignore(()=>{u5t(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 K5t(t,e,r,n){if(n==1)return xt.cursor(e,r);if(n==2)return xyn(t.state,e,r);{let i=t.docView.lineAt(e,r),a=t.state.doc.lineAt(i?i.posAtEnd:e),o=i?i.posAtStart:a.from,s=i?i.posAtEnd:a.to;return sDate.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(J5t+1)%3:1}function Hyn(t,e){let r=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),n=tRt(e),i=t.state.selection;return{update(a){a.docChanged&&(r.pos=a.changes.mapPos(r.pos),i=i.map(a.changes))},get(a,o,s){let l=t.posAndSideAtCoords({x:a.clientX,y:a.clientY},!1),u,h=K5t(t,l.pos,l.assoc,n);if(r.pos!=l.pos&&!o){let d=K5t(t,r.pos,r.assoc,n),f=Math.min(d.from,h.from),p=Math.max(d.to,h.to);h=f1&&(u=Wyn(i,l.pos))?u:s?i.addRange(h):xt.create([h])}}}function Wyn(t,e){for(let r=0;r=e)return xt.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}Ig.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,o=a+i.length;(a>=r.to||o<=r.from)&&(r=xt.undirectionalRange(a,o))}}let{inputState:n}=t;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=r,e.dataTransfer&&(e.dataTransfer.setData("Text",PK(t.state,iwe,t.state.sliceDoc(r.from,r.to))),e.dataTransfer.effectAllowed="copyMove"),!1},Ig.dragend=t=>(t.inputState.draggedContent=null,!1);function rRt(t,e,r,n){if(r=PK(t.state,nwe,r),!r)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:a}=t.inputState,o=n&&a&&zyn(t,e)?{from:a.from,to:a.to}:null,s={from:i,insert:r},l=t.state.changes(o?[o,s]:s);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Ig.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&&rRt(t,e,n.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(s.result)||(n[o]=s.result),a()},s.readAsText(r[o])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return rRt(t,e,n,!0),!0}return!1},Ig.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let r=j5t?null:e.clipboardData;return r?(X5t(t,r.getData("text/plain")||r.getData("text/uri-list")),!0):(Qyn(t),!1)};function Yyn(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 qyn(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 o=t.doc.lineAt(a);o.number>i&&(e.push(o.text),r.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),i=o.number}n=!0}return{text:PK(t,iwe,e.join(t.lineBreak)),ranges:r,linewise:n}}let vwe=null;Ig.copy=Ig.cut=(t,e)=>{if(!O$(t.contentDOM,t.observer.selectionRange))return!1;let{text:r,ranges:n,linewise:i}=qyn(t.state);if(!r&&!i)return!1;vwe=i?r:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let a=j5t?null:e.clipboardData;return a?(a.clearData(),a.setData("text/plain",r),!0):(Yyn(t,r),!1)};const nRt=k0.define();function iRt(t,e){let r=[];for(let n of t.facet(C5t)){let i=n(t,e);i&&r.push(i)}return r.length?t.update({effects:r,annotations:nRt.of(!0)}):null}function aRt(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let r=iRt(t.state,e);r?t.dispatch(r):t.update([])}},10)}Wu.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),aRt(t)},Wu.blur=t=>{t.observer.clearSelectionRange(),aRt(t)},Wu.compositionstart=Wu.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))},Wu.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))},Wu.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},Ig.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"),o=e.getTargetRanges();if(a&&o.length){let s=o[0],l=t.posAtDOM(s.startContainer,s.startOffset),u=t.posAtDOM(s.endContainer,s.endOffset);return mwe(t,{from:l,to:u,insert:t.state.toText(a)},null),!0}}let i;if(br.chrome&&br.android&&(i=Y5t.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 o;(((o=window.visualViewport)===null||o===void 0?void 0:o.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(()=>Wu.compositionend(t,e),20),!1};const oRt=new Set;function jyn(t){oRt.has(t)||(oRt.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const sRt=["pre-wrap","normal","pre-line","break-spaces"];let YR=!1;function lRt(){YR=!1}class Xyn{constructor(e){this.lineWrapping=e,this.doc=wi.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 sRt.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!=s;if(this.lineWrapping=s,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)>NK&&(YR=!0),this.height=e)}replace(e,r,n){return Yu.of(n)}decomposeLeft(e,r){r.push(this)}decomposeRight(e,r){r.push(this)}applyChanges(e,r,n,i){let a=this,o=n.doc;for(let s=i.length-1;s>=0;s--){let{fromA:l,toA:u,fromB:h,toB:d}=i[s],f=a.lineAt(l,Fa.ByPosNoHeight,n.setDoc(r),0,0),p=f.to>=u?f:a.lineAt(u,Fa.ByPosNoHeight,n,0,0);for(d+=p.to-u,u=p.to;s>0&&f.from<=i[s-1].toA;)l=i[s-1].fromA,h=i[s-1].fromB,s--,la*2){let s=e[r-1];s.break?e.splice(--r,1,s.left,null,s.right):e.splice(--r,1,s.left,s.right),n+=1+s.break,i-=s.size}else if(a>i*2){let s=e[n];s.break?e.splice(n,1,s.left,null,s.right):e.splice(n,1,s.left,s.right),n+=2+s.break,a-=s.size}else break;else if(i=a&&o(this.lineAt(0,Fa.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 Jd extends cRt{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 Jd||i instanceof Sc&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof Sc?i=new Jd(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Yu.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 Sc extends Yu{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,o,s=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*a);o=l/a,this.length>a+1&&(s=(this.height-l)/(this.length-a-1))}else o=this.height/a;return{firstLine:n,lastLine:i,perLine:o,perChar:s}}blockAt(e,r,n,i){let{firstLine:a,lastLine:o,perLine:s,perChar:l}=this.heightMetrics(r,i);if(r.lineWrapping){let u=i+(e0){let a=n[n.length-1];a instanceof Sc?n[n.length-1]=new Sc(a.length+i):n.push(null,new Sc(i-1))}if(e>0){let a=n[0];a instanceof Sc?n[0]=new Sc(e+a.length):n.unshift(new Sc(e-1),null)}return Yu.of(n)}decomposeLeft(e,r){r.push(new Sc(e-1),null)}decomposeRight(e,r){r.push(null,new Sc(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 o=[],s=Math.max(r,i.from),l=-1;for(i.from>r&&o.push(new Sc(i.from-r-1).updateHeight(e,r));s<=a&&i.more;){let h=e.doc.lineAt(s).length;o.length&&o.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)>=NK&&(l=-2);let p=new Jd(h,d,f);p.outdated=!1,o.push(p),s+=h+1}s<=a&&o.push(null,new Sc(a-s).updateHeight(e,s));let u=Yu.of(o);return(l<0||Math.abs(u.height-this.height)>=NK||Math.abs(l-this.heightMetrics(e,r).perLine)>=NK)&&(YR=!0),BK(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 Jyn extends Yu{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 es))return u;let h=r==Fa.ByPosNoHeight?Fa.ByPosNoHeight:Fa.ByPos;return l?u.join(this.right.lineAt(s,h,n,o,s)):this.left.lineAt(s,h,n,i,a).join(u)}forEachLine(e,r,n,i,a,o){let s=i+this.left.height,l=a+this.left.length+this.break;if(this.break)e=l&&this.right.forEachLine(e,r,n,s,l,o);else{let u=this.lineAt(l,Fa.ByPos,n,i,a);e=e&&u.from<=r&&o(u),r>u.to&&this.right.forEachLine(u.to+1,r,n,s,l,o)}}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 o=a.length;for(let s of n)a.push(s);if(e>0&&uRt(a,o-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?Yu.of(this.break?[e,null,r]:[e,r]):(this.left=BK(this.left,e),this.right=BK(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:o}=this,s=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<=s+o.length&&i.more?l=o=o.updateHeight(e,s,n,i):o.updateHeight(e,s,n),l?this.balanced(a,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function uRt(t,e){let r,n;t[e]==null&&(r=t[e-1])instanceof Sc&&(n=t[e+1])instanceof Sc&&t.splice(e-1,3,new Sc(r.length+1+n.length))}const e1n=5;class ywe{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 Jd?i.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new Jd(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=e1n)&&this.addLineDeco(i,a,o)}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 Jd(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,r){let n=new Sc(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 Jd)return e;let r=new Jd(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 Jd)&&!this.isCovered?this.nodes.push(new Jd(0,-1,0)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&d.overflow!="visible"){let f=h.getBoundingClientRect();a=Math.max(a,f.left),o=Math.min(o,f.right),s=Math.max(s,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,o)-r.left,top:s-(r.top+e),bottom:Math.max(s,l)-(r.top+e)}}function i1n(t){let e=t.getBoundingClientRect(),r=t.ownerDocument.defaultView||window;return e.left0&&e.top0}function a1n(t,e){let r=t.getBoundingClientRect();return{left:0,right:r.right-r.left,top:e,bottom:r.bottom-(r.top+e)}}class bwe{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 Xyn(n),this.stateDeco=fRt(r),this.heightMap=Yu.empty().applyChanges(this.stateDeco,wi.empty,this.heightOracle.setDoc(r.doc),[new xp(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:o})=>i>=a&&i<=o)){let{from:a,to:o}=this.lineBlockAt(i);e.push(new $K(a,o))}}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?dRt:new xwe(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(I$(e,this.scaler))})}update(e,r=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=fRt(this.state);let i=e.changedRanges,a=xp.extendWithRanges(i,t1n(n,this.stateDeco,e?e.changes:bs.empty(this.state.doc.length))),o=this.heightMap.height,s=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);lRt(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),a),(this.heightMap.height!=o||YR)&&(e.flags|=2),s?(this.scrollAnchorPos=e.changes.mapPos(s.from,-1),this.scrollAnchorHeight=s.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);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(k5t)&&(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"?Ra.RTL:Ra.LTR;let o=this.heightOracle.mustRefreshForWrapping(a)||this.mustMeasureContent==="refresh",s=r.getBoundingClientRect(),l=o||this.mustMeasureContent||this.contentDOMHeight!=s.height;this.contentDOMHeight=s.height,this.mustMeasureContent=!1;let u=0,h=0;if(s.width&&s.height){let{scaleX:A,scaleY:S}=l5t(r,s);(A>.005&&Math.abs(this.scaleX-A)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=A,this.scaleY=S,u|=16,o=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=c5t(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=d5t(this.scrollParent||e.win);let m=(this.printing?a1n:n1n)(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&&!i1n(e.dom))return 0;let x=s.width;if((this.contentDOMWidth!=x||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=s.width,this.editorHeight=e.scrollDOM.clientHeight,u|=16),l){let A=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(A)&&(o=!0),o||i.lineWrapping&&Math.abs(x-this.contentDOMWidth)>i.charWidth){let{lineHeight:S,charWidth:T,textHeight:C}=e.docView.measureTextSize();o=S>0&&i.refresh(a,S,T,C,Math.max(5,x/T),A),o&&(e.docView.minWidth=0,u|=16)}v>0&&y>0?h=Math.max(v,y):v<0&&y<0&&(h=Math.min(v,y)),lRt();for(let S of this.viewports){let T=S.from==this.viewport.from?A:e.docView.measureVisibleLineHeights(S);this.heightMap=(o?Yu.empty().applyChanges(this.stateDeco,wi.empty,this.heightOracle,[new xp(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new Kyn(S.from,T))}YR&&(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(o?[]: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:o,visibleBottom:s}=this,l=new $K(i.lineAt(o-n*1e3,Fa.ByHeight,a,0,0).from,i.lineAt(s+(1-n)*1e3,Fa.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,Fa.ByPos,a,0,0),f;r.y=="center"?f=(d.top+d.bottom)/2-h/2:r.y=="start"||r.y=="nearest"&&u=s+Math.max(10,Math.min(n,250)))&&i>o-2*1e3&&a>1,o=i<<1;if(this.defaultTextDirection!=Ra.LTR&&!n)return[];let s=[],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(xt.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 bwe(h,d,y,b)}s.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=[];ti.spans(r,this.viewport.from,this.viewport.to,{span(a,o){n.push({from:a,to:o})},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)||I$(this.heightMap.lineAt(e,Fa.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)||I$(this.heightMap.lineAt(this.scaler.fromDOM(e),Fa.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 I$(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 $K{constructor(e,r){this.from=e,this.to=r}}function s1n(t,e,r){let n=[],i=t,a=0;return ti.spans(r,t,e,{span(){},point(o,s){o>i&&(n.push({from:i,to:o}),a+=o-i),i=s}},20),i=1)return e[e.length-1].to;let n=Math.floor(t*r);for(let i=0;;i++){let{from:a,to:o}=e[i],s=o-a;if(n<=s)return a+n;n-=s}}function zK(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 l1n(t,e){for(let r of t)if(e(r))return r}const dRt={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function fRt(t){let e=t.facet(OK).filter(n=>typeof n!="function"),r=t.facet(swe).filter(n=>typeof n!="function");return r.length&&e.push(ti.join(r)),e}class xwe{constructor(e,r,n){let i=0,a=0,o=0;this.viewports=n.map(({from:s,to:l})=>{let u=r.lineAt(s,Fa.ByPos,e,0,0).top,h=r.lineAt(l,Fa.ByPos,e,0,0).bottom;return i+=h-u,{from:s,to:l,top:u,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(r.height-i);for(let s of this.viewports)s.domTop=o+(s.top-a)*this.scale,o=s.domBottom=s.domTop+(s.bottom-s.top),a=s.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 I$(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=>I$(i,e)):t._content)}const UK=vr.define({combine:t=>t.join(" ")}),wwe=vr.define({combine:t=>t.indexOf(!0)>-1}),Awe=d1.newName(),pRt=d1.newName(),gRt=d1.newName(),mRt={"&light":"."+pRt,"&dark":"."+gRt};function Swe(t,e,r){return new d1(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 c1n=Swe("."+Awe,{"&":{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"}},mRt),u1n={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Twe=br.ie&&br.ie_version<=11;class h1n{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new zvn,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 f1n(e),e.state.facet(p1)&&(e.contentDOM.editContext=this.editContext.editContext)),Twe&&(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(p1)?n.root.activeElement!=this.dom:!O$(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&&E$(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,r=C$(e.root);if(!r)return!1;let n=br.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&d1n(this.view,r)||r;if(!n||this.selectionRange.eq(n))return!1;let i=O$(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&&UR(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 o=this.readMutation(a);o&&(o.typeOver&&(i=!0),r==-1?{from:r,to:n}=o:(r=Math.min(o.from,r),n=Math.max(o.to,n)))}return{from:r,to:n,typeOver:i}}readChange(){let{from:e,to:r,typeOver:n}=this.processRecords(),i=this.selectionChanged&&O$(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 _yn(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=G5t(this.view,r);return this.view.state==n&&(r.domChanged||r.newSel&&!LK(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=vRt(r,e.previousSibling||e.target.previousSibling,-1),i=vRt(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(p1)!=e.state.facet(p1)&&(e.view.contentDOM.editContext=e.state.facet(p1)?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 vRt(t,e,r){for(;e;){let n=Zo.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 yRt(t,e){let r=e.startContainer,n=e.startOffset,i=e.endContainer,a=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor,1);return E$(o.node,o.offset,i,a)&&([r,n,i,a]=[i,a,r,n]),{anchorNode:r,anchorOffset:n,focusNode:i,focusOffset:a}}function d1n(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return yRt(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?yRt(t,r):null}class f1n{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:o}=i,s=this.toEditorPos(n.updateRangeStart),l=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:s,drifted:!1});let u=l-s>n.text.length;s==this.from&&athis.to&&(l=a);let h=H5t(e.state.sliceDoc(s,l),n.text,(u?i.from:i.to)-s,u?"end":null);if(!h){let f=xt.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));LK(f,i)||e.dispatch({selection:f,userEvent:"select"});return}let d={from:h.from+s,to:h.toA+s,insert:wi.of(n.text.slice(h.from,h.toB).split(` -`))};if((br.mac||br.android)&&d.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(d={from:s,to:l,insert:wi.of([n.text.replace("."," ")])}),this.pendingContextChange=d,!e.state.readOnly){let f=this.to-this.from+(d.to-d.from+d.insert.length);mwe(e,d,xt.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 o=this.toEditorPos(n.rangeStart),s=this.toEditorPos(n.rangeEnd);o{let i=[];for(let a of n.getTextFormats()){let o=a.underlineStyle,s=a.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(s)){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=C$(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,o,s,l,u)=>{if(n)return;let h=u.length-(o-a);if(i&&o>=i.to)if(i.from==a&&i.to==o&&i.insert.eq(u)){i=this.pendingContextChange=null,r+=h,this.to+=h;return}else i=null,this.revertPending(e.state);if(a+=r,o+=r,o<=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(o),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||Uvn(e.parent)||document,this.viewState=new hRt(this,e.state||ei.create(e)),e.scrollTo&&e.scrollTo.is(CK)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(QR).map(i=>new awe(i));for(let i of this.plugins)i.update(this);this.observer=new h1n(this),this.inputState=new Myn(this),this.inputState.ensureHandlers(this.plugins),this.docView=new $5t(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 Us?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 o=this.hasFocus,s=0,l=null;e.some(f=>f.annotation(nRt))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=iRt(a,o),l||(s=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(ei.phrases)!=this.state.facet(ei.phrases))return this.setState(a);i=kK.create(this,a,e),i.flags|=s;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 VR(p.empty?p:xt.cursor(p.head,p.head>p.anchor?-1:1),"nearest","nearest",m,g)}for(let p of f.effects)p.is(CK)&&(d=p.value.clip(this.state))}this.viewState.update(i,d),this.bidiCache=VK.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),r=this.docView.update(i),this.state.facet(L$)!=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(UK)!=i.state.facet(UK)&&(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(rwe))try{f(i)}catch(p){qh(this.state,p,"update listener")}(l||h)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),h&&!G5t(this,h)&&u.force&&UR(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 hRt(this,e),this.plugins=e.facet(QR).map(n=>new awe(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new $5t(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(QR),n=e.state.facet(QR);if(r!=n){let i=[];for(let a of n){let o=r.indexOf(a);if(o<0)i.push(new awe(a));else{let s=this.plugins[o];s.mustUpdate=e,i.push(s)}}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:o}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let s=0;;s++){if(o<0)if(d5t(n||this.win))a=-1,o=this.viewState.heightMap.height;else{let p=this.viewState.scrollAnchorAt(i);a=p.from,o=p.top}this.updateState=1;let l=this.viewState.measure();if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(s>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 qh(this.state,g),bRt}}),d=kK.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),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(r&&!r.empty)for(let s of this.state.facet(rwe))s(r)}get themeClasses(){return Awe+" "+(this.state.facet(wwe)?gRt:pRt)+" "+this.state.facet(UK)}updateAttrs(){let e=xRt(this,R5t,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),r={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(p1)?"true":"false",class:"cm-content",style:`${br.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(r["aria-readonly"]="true"),xRt(this,owe,r);let n=this.observer.ignore(()=>{let i=a5t(this.contentDOM,this.contentAttrs,r),a=a5t(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(L$);let e=this.state.facet(er.cspNonce);d1.mount(this.root,this.styleModules.concat(c1n).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 pwe(this,e,z5t(this,e,r,n))}moveByGroup(e,r){return pwe(this,e,z5t(this,e,r,n=>Syn(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 xt.cursor(a.side(r,i)+e.from,a.forward(!r,i)?1:-1)}moveToLineBoundary(e,r,n=!0){return Ayn(this,e,r,n)}moveVertically(e,r,n){return pwe(this,e,Tyn(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=gwe(this,e,r);return n&&n.pos}posAndSideAtCoords(e,r=!0){return this.readMeasured(),gwe(this,e,r)}coordsAtPos(e,r=1){this.readMeasured();let n=this.state.doc.lineAt(e),i=this.bidiSpans(n),a=i[R0.find(i,e-n.from,-1,r)];return this.docView.coordsAt(e,r,a.dir==Ra.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(O5t)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>p1n)return y5t(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||v5t(a.isolates,n=M5t(this,e))))return a.order;n||(n=M5t(this,e));let i=jvn(e.text,r,n);return this.bidiCache.push(new VK(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(()=>{u5t(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,o;return CK.of(new VR(typeof e=="number"?xt.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,(o=r.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:r}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return CK.of(new VR(xt.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 Ro.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Ro.define(()=>({}),{eventObservers:e})}static theme(e,r){let n=d1.newName(),i=[UK.of(n),L$.of(Swe(`.${n}`,e))];return r&&r.dark&&i.push(wwe.of(!0)),i}static baseTheme(e){return Zd.lowest(L$.of(Swe("."+Awe,e,mRt)))}static findFromDOM(e){var r;let n=e.querySelector(".cm-content"),i=n&&Zo.get(n)||Zo.get(e);return((r=i==null?void 0:i.root)===null||r===void 0?void 0:r.view)||null}}er.styleModule=L$,er.inputHandler=T5t,er.clipboardInputFilter=nwe,er.clipboardOutputFilter=iwe,er.scrollHandler=E5t,er.focusChangeEffect=C5t,er.perLineTextDirection=O5t,er.exceptionSink=S5t,er.updateListener=rwe,er.editable=p1,er.mouseSelectionStyle=A5t,er.dragMovesSelection=w5t,er.clickAddsSelectionRange=x5t,er.decorations=OK,er.blockWrappers=D5t,er.outerDecorations=swe,er.atomicRanges=D$,er.bidiIsolatedRanges=L5t,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=I5t,er.darkTheme=wwe,er.cspNonce=vr.define({combine:t=>t.length?t[0]:""}),er.contentAttributes=owe,er.editorAttributes=R5t,er.lineWrapping=er.contentAttributes.of({class:"cm-lineWrapping"}),er.announce=on.define();const p1n=4096,bRt={};class VK{constructor(e,r,n,i,a,o){this.from=e,this.to=r,this.dir=n,this.isolates=i,this.fresh=a,this.order=o}static update(e,r){if(r.empty&&!e.some(a=>a.fresh))return e;let n=[],i=e.length?e[e.length-1].dir:Ra.LTR;for(let a=Math.max(0,e.length-10);a=0;i--){let a=n[i],o=typeof a=="function"?a(t):a;o&&j2e(o,r)}return r}const g1n=br.mac?"mac":br.windows?"win":br.linux?"linux":"key";function m1n(t,e){const r=t.split(/-(?!$)/);let n=r[r.length-1];n=="Space"&&(n=" ");let i,a,o,s;for(let l=0;ln.concat(i),[]))),r}function y1n(t,e,r){return SRt(ARt(t.state),e,t,r)}let R2=null;const b1n=4e3;function x1n(t,e=g1n){let r=Object.create(null),n=Object.create(null),i=(o,s)=>{let l=n[o];if(l==null)n[o]=s;else if(l!=s)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},a=(o,s,l,u,h)=>{var d,f;let p=r[o]||(r[o]=Object.create(null)),g=s.split(/ (?!$)/).map(y=>m1n(y,e));for(let y=1;y{let w=R2={view:x,prefix:b,scope:o};return setTimeout(()=>{R2==w&&(R2=null)},b1n),!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 o of t){let s=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let u of s){let h=r[u]||(r[u]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:d}=o;for(let f in h)h[f].run.push(p=>d(p,Cwe))}let l=o[e]||o.key;if(l)for(let u of s)a(u,l,o.run,o.preventDefault,o.stopPropagation),o.shift&&a(u,"Shift-"+l,o.shift,o.preventDefault,o.stopPropagation)}return r}let Cwe=null;function SRt(t,e,r,n){Cwe=e;let i=Ivn(e),a=Yh(i,0),o=C0(a)==i.length&&i!=" ",s="",l=!1,u=!1,h=!1;R2&&R2.view==r&&R2.scope==n&&(s=R2.prefix+" ",q5t.indexOf(e.keyCode)<0&&(u=!0,R2=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[s+QK(i,e,!o)])?l=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(br.windows&&e.ctrlKey&&e.altKey)&&!(br.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(g=E2[e.keyCode])&&g!=i?(f(p[s+QK(g,e,!0)])||e.shiftKey&&(m=w$[e.keyCode])!=i&&m!=g&&f(p[s+QK(m,e,!1)]))&&(l=!0):o&&e.shiftKey&&f(p[s+QK(i,e,!0)])&&(l=!0),!l&&f(p._any)&&(l=!0)),u&&(l=!0),l&&h&&e.stopPropagation(),Cwe=null,l}class hC{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=TRt(e);return[new hC(r,i.left-a.left,i.top-a.top,null,i.bottom-i.top)]}else return w1n(e,r,n)}}function TRt(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Ra.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function CRt(t,e,r,n){let i=t.coordsAtPos(e,r*2);if(!i)return n;let a=t.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,s=t.posAtCoords({x:a.left+1,y:o}),l=t.posAtCoords({x:a.right-1,y:o});return s==null||l==null?n:{from:Math.max(n.from,Math.min(s,l)),to:Math.min(n.to,Math.max(s,l))}}function w1n(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==Ra.LTR,o=t.contentDOM,s=o.getBoundingClientRect(),l=TRt(t),u=o.querySelector(".cm-line"),h=u&&window.getComputedStyle(u),d=s.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),f=s.right-(h?parseInt(h.paddingRight):0),p=fwe(t,n,1),g=fwe(t,i,-1),m=p.type==Ac.Text?p:null,v=g.type==Ac.Text?g:null;if(m&&(t.lineWrapping||p.widgetLineBreaks)&&(m=CRt(t,n,1,m)),v&&(t.lineWrapping||g.widgetLineBreaks)&&(v=CRt(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/2P&&R.from=M)break;B>D&&_(Math.max(F,D),A==null&&F<=P,Math.min(B,M),S==null&&B>=L,N.dir)}if(D=I.to+1,D>=M)break}return E.length==0&&_(P,A==null,L,S==null,t.textDirection),{top:C,bottom:k,horizontal:E}}function w(A,S){let T=s.top+(S?A.top:A.bottom);return{top:T,bottom:T,horizontal:[]}}}function A1n(t,e){return t.constructor==e.constructor&&t.eq(e)}class S1n{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(GK)!=e.state.facet(GK)&&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(GK);for(;r!A1n(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 GK=vr.define();function ORt(t){return[Ro.define(e=>new S1n(e,t)),GK.of(t)]}const jR=vr.define({combine(t){return E0(t,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,r)=>Math.min(e,r),drawRangeCursor:(e,r)=>e||r})}});function T1n(t={}){return[jR.of(t),C1n,O1n,k1n,k5t.of(!0)]}function kRt(t){return t.startState.facet(jR)!=t.state.facet(jR)}const C1n=ORt({above:!0,markers(t){let{state:e}=t,r=e.facet(jR),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 o=a?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",s=i.empty?i:xt.cursor(i.head,i.assoc);for(let l of hC.forRange(t,o,s))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=kRt(t);return r&&ERt(t.state,e),t.docChanged||t.selectionSet||r},mount(t,e){ERt(e.state,t)},class:"cm-cursorLayer"});function ERt(t,e){e.style.animationDuration=t.facet(jR).cursorBlinkRate+"ms"}const O1n=ORt({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 hC.forRange(t,"cm-selectionBackground",i))e.push(a);if(br.ios&&!r.empty&&t.state.facet(jR).iosSelectionHandles){for(let i of hC.forRange(t,"cm-selectionHandle cm-selectionHandle-start",xt.cursor(r.from,1)))e.push(i);for(let i of hC.forRange(t,"cm-selectionHandle cm-selectionHandle-end",xt.cursor(r.to,1)))e.push(i)}return e},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||kRt(t)},class:"cm-selectionLayer"}),k1n=Zd.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"}}}})),_Rt=on.define({map(t,e){return t==null?null:e.mapPos(t)}}),P$=Ko.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((r,n)=>n.is(_Rt)?n.value:r,t)}}),E1n=Ro.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(P$);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(P$)!=r||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(P$),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(P$)!=t&&this.view.dispatch({effects:_Rt.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 _1n(){return[P$,E1n]}function RRt(t,e,r,n,i){e.lastIndex=0;for(let a=t.iterRange(r,n),o=r,s;!a.next().done;o+=a.value.length)if(!a.lineBreak)for(;s=e.exec(a.value);)i(o+s.index,s)}function R1n(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 D1n{constructor(e){const{regexp:r,decoration:n,decorate:i,boundary:a,maxLength:o=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=(s,l,u,h)=>i(h,u,u+s[0].length,s,l);else if(typeof n=="function")this.addMatch=(s,l,u,h)=>{let d=n(s,l,u);d&&h(u,u+s[0].length,d)};else if(n)this.addMatch=(s,l,u,h)=>h(u,u+s[0].length,n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=a,this.maxLength=o}createDeco(e){let r=new Qu,n=r.add.bind(r);for(let{from:i,to:a}of R1n(e,this.maxLength))RRt(e.state.doc,this.regexp,i,a,(o,s)=>this.addMatch(s,e,o,n));return r.finish()}updateDeco(e,r){let n=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((a,o,s,l)=>{l>=e.view.viewport.from&&s<=e.view.viewport.to&&(n=Math.min(s,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 o=Math.max(a.from,n),s=Math.min(a.to,i);if(s>=o){let l=e.state.doc.lineAt(o),u=l.tol.from;o--)if(this.boundary.test(l.text[o-1-l.from])){h=o;break}for(;sf.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 Owe=/x/.unicode!=null?"gu":"g",L1n=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Owe),M1n={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 kwe=null;function I1n(){var t;if(kwe==null&&typeof document<"u"&&document.body){let e=document.body.style;kwe=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return kwe||!1}const HK=vr.define({combine(t){let e=E0(t,{render:null,specialChars:L1n,addSpecialChars:null});return(e.replaceTabs=!I1n())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Owe)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Owe)),e}});function P1n(t={}){return[HK.of(t),N1n()]}let DRt=null;function N1n(){return DRt||(DRt=Ro.fromClass(class{constructor(t){this.view=t,this.decorations=Ar.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(HK)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new D1n({regexp:t.specialChars,decoration:(e,r,n)=>{let{doc:i}=r.state,a=Yh(e[0],0);if(a==9){let o=i.lineAt(n),s=r.state.tabSize,l=Lg(o.text,s,n-o.from);return Ar.replace({widget:new z1n((s-l%s)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=Ar.replace({widget:new F1n(t,a)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(HK);t.startState.facet(HK)!=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 B1n="•";function $1n(t){return t>=32?B1n:t==10?"␤":String.fromCharCode(9216+t)}class F1n extends Hu{constructor(e,r){super(),this.options=e,this.code=r}eq(e){return e.code==this.code}toDOM(e){let r=$1n(this.code),n=e.state.phrase("Control character")+" "+(M1n[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 z1n extends Hu{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 U1n(){return Q1n}const V1n=Ar.line({class:"cm-activeLine"}),Q1n=Ro.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(V1n.range(i.from)),e=i.from)}return Ar.set(r)}},{decorations:t=>t.decorations});class G1n extends Hu{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?k$(e.firstChild):[];if(!r.length)return null;let n=window.getComputedStyle(e.parentNode),i=_$(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 H1n(t){let e=Ro.fromClass(class{constructor(r){this.view=r,this.placeholder=t?Ar.set([Ar.widget({widget:new G1n(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 Ewe=2e3;function W1n(t,e,r){let n=Math.min(e.line,r.line),i=Math.max(e.line,r.line),a=[];if(e.off>Ewe||r.off>Ewe||e.col<0||r.col<0){let o=Math.min(e.off,r.off),s=Math.max(e.off,r.off);for(let l=n;l<=i;l++){let u=t.doc.line(l);u.length<=s&&a.push(xt.range(u.from+o,u.to+s))}}else{let o=Math.min(e.col,r.col),s=Math.max(e.col,r.col);for(let l=n;l<=i;l++){let u=t.doc.line(l),h=z2e(u.text,o,t.tabSize,!0);if(h<0)a.push(xt.cursor(u.to));else{let d=z2e(u.text,s,t.tabSize);a.push(xt.range(u.from+h,u.from+d))}}}return a}function Y1n(t,e){let r=t.coordsAtPos(t.viewport.from);return r?Math.round(Math.abs((r.left-e)/t.defaultCharacterWidth)):-1}function LRt(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>Ewe?-1:i==n.length?Y1n(t,e.clientX):Lg(n.text,t.state.tabSize,r-n.from);return{line:n.number,col:a,off:i}}function q1n(t,e){let r=LRt(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),o=i.state.doc.lineAt(a);r={line:o.number,col:r.col,off:Math.min(r.off,o.length)},n=n.map(i.changes)}},get(i,a,o){let s=LRt(t,i);if(!s)return n;let l=W1n(t.state,r,s);return l.length?o?xt.create(l.concat(n.ranges)):xt.create(l):n}}:null}function j1n(t){let e=r=>r.altKey&&r.button==0;return er.mouseSelectionStyle.of((r,n)=>e(n)?q1n(r,n):null)}const X1n={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},K1n={style:"cursor: crosshair"};function Z1n(t={}){let[e,r]=X1n[t.key||"Alt"],n=Ro.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?K1n:null})]}const WK="-10000px";class MRt{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(o=>o);let a=null;this.tooltipViews=this.tooltips.map(o=>a=n(o,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 o=[],s=r?[]:null;for(let l=0;lr[u]=l),r.length=s.length),this.input=i,this.tooltips=a,this.tooltipViews=o,!0}}function J1n(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const _we=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)||J1n}}}),IRt=new WeakMap,Rwe=Ro.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(_we);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 MRt(t,Dwe,(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(_we);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=WK,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 o=a.getBoundingClientRect();r=Math.abs(o.top+1e4)>1||Math.abs(o.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=lwe(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,o)=>{let s=this.manager.tooltipViews[o];return s.getCoords?s.getCoords(a.pos):this.view.coordsAtPos(a.pos)}),size:this.manager.tooltipViews.map(({dom:a})=>a.getBoundingClientRect()),space:this.view.state.facet(_we).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:r}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let s of this.manager.tooltipViews)s.dom.style.position="absolute"}let{visible:r,space:n,scaleX:i,scaleY:a}=t,o=[];for(let s=0;s=Math.min(r.bottom,n.bottom)||d.rightMath.min(r.right,n.right)+.1)){h.style.top=WK;continue}let p=l.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,g=p?7:0,m=f.right-f.left,v=(e=IRt.get(u))!==null&&e!==void 0?e:f.bottom-f.top,y=u.offset||tbn,b=this.view.textDirection==Ra.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[s];!l.strictSide&&(w?d.top-v-g-y.yn.bottom)&&w==n.bottom-d.bottom>d.top-n.top&&(w=this.above[s]=!w);let A=(w?d.top-n.top:n.bottom-d.bottom)-g;if(Ax&&C.topS&&(S=w?C.top-v-2-g:C.bottom+g+2);if(this.position=="absolute"?(h.style.top=(S-t.parent.top)/a+"px",PRt(h,(x-t.parent.left)/i)):(h.style.top=S/a+"px",PRt(h,x/i)),p){let C=d.left+(b?y.x:-y.x)-(x+14-7);p.style.left=C/i+"px"}u.overlap!==!0&&o.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=WK}},{eventObservers:{scroll(){this.maybeMeasure()}}});function PRt(t,e){let r=parseInt(t.style.left,10);(isNaN(r)||Math.abs(e-r)>1)&&(t.style.left=e+"px")}const ebn=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"}}}),tbn={x:0,y:0},Dwe=vr.define({enables:[Rwe,ebn]}),YK=vr.define({combine:t=>t.reduce((e,r)=>e.concat(r),[])});class qK{static create(e){return new qK(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new MRt(e,YK,(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 rbn=Dwe.compute([YK],t=>{let e=t.facet(YK);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:qK.create,above:e[0].above,arrow:e.some(r=>r.arrow)}}),NRt=vr.define();class nbn{constructor(e,r,n,i,a,o){this.view=e,this.source=r,this.field=n,this.locked=i,this.setHover=a,this.hoverTime=o,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;eo.bottom||r.xo.right+e.defaultCharacterWidth)return;let s=e.bidiSpans(e.state.doc.lineAt(i)).find(u=>u.from<=i&&u.to>=i),l=s&&s.dir==Ra.RTL?-1:1;a=r.x{if(s&&!(Array.isArray(s)&&!s.length)){let l=Array.isArray(s)?s:[s];i&&this.locked.set(l,i),e.dispatch({effects:this.setHover.of(l)})}};if(a&&"then"in a){let s=this.pending={pos:r};a.then(l=>{this.pending==s&&(this.pending=null,o(l))},l=>qh(e.state,l,"hover tooltip"))}else o(a)}get tooltip(){let e=this.view.plugin(Rwe),r=e?e.manager.tooltips.findIndex(n=>n.create==qK.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&&!ibn(a.dom,e)||this.pending){let{pos:o}=i[0]||this.pending,s=(n=(r=i[0])===null||r===void 0?void 0:r.end)!==null&&n!==void 0?n:o;(o==s?this.view.posAtCoords(this.lastMove)!=o:!abn(this.view,o,s,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 jK=4;function ibn(t,e){let{left:r,right:n,top:i,bottom:a}=t.getBoundingClientRect(),o;if(o=t.querySelector(".cm-tooltip-arrow")){let s=o.getBoundingClientRect();i=Math.min(s.top,i),a=Math.max(s.bottom,a)}return e.clientX>=r-jK&&e.clientX<=n+jK&&e.clientY>=i-jK&&e.clientY<=a+jK}function abn(t,e,r,n,i,a){let o=t.scrollDOM.getBoundingClientRect(),s=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>n||o.righti||Math.min(o.bottom,s)=e&&l<=r}function obn(t,e={}){let r=on.define(),n=new WeakMap,i=Ko.define({create(){return[]},update(o,s){let l=n.get(o);if(o.length&&(e.hideOnChange&&(s.docChanged||s.selection)?o=[]:l&&l(s)?o=[]:e.hideOn&&(o=o.filter(u=>!e.hideOn(s,u)))),s.docChanged&&o.length){let u=[];for(let h of o){let d=s.changes.mapPos(h.pos,-1,xc.TrackDel);if(d!=null){let f=Object.assign(Object.create(null),h);f.pos=d,f.end!=null&&(f.end=s.changes.mapPos(f.end)),u.push(f)}}o=u}for(let u of s.effects)u.is(r)&&(o=u.value,l=void 0),(u.is(lbn)&&!u.value||u.value==i)&&(o=[]);return o.length&&l&&n.set(o,l),o},provide:o=>YK.from(o)});const a=Ro.define(o=>new nbn(o,t,i,n,r,e.hoverTime||300));return{active:i,extension:[i,a,NRt.of(a),rbn]}}function sbn(t,e,r,n={}){var i;let a=t.state.facet(NRt).map(o=>t.plugin(o)).filter(o=>!!o);if(n.tooltip&&n.tooltip.active){let o=a.find(s=>s.field==n.tooltip.active);o&&(a=[o])}for(let o of a)o.activateHover(t,e,r,(i=n.until)!==null&&i!==void 0?i:()=>!1)}function BRt(t,e){let r=t.plugin(Rwe);if(!r)return null;let n=r.manager.tooltips.indexOf(e);return n<0?null:r.manager.tooltipViews[n]}const lbn=on.define(),$Rt=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 Lwe(t,e){let r=t.plugin(FRt),n=r?r.specs.indexOf(e):-1;return n>-1?r.panels[n]:null}const FRt=Ro.fromClass(class{constructor(t){this.input=t.state.facet(N$),this.specs=this.input.filter(r=>r),this.panels=this.specs.map(r=>r(t));let e=t.state.facet($Rt);this.top=new XK(t,!0,e.topContainer),this.bottom=new XK(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($Rt);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new XK(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new XK(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let r=t.state.facet(N$);if(r!=this.input){let n=r.filter(l=>l),i=[],a=[],o=[],s=[];for(let l of n){let u=this.specs.indexOf(l),h;u<0?(h=l(t.view),s.push(h)):(h=this.panels[u],h.update&&h.update(t)),i.push(h),(h.top?a:o).push(h)}this.specs=n,this.panels=i,this.top.sync(a),this.bottom.sync(o);for(let l of s)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 XK{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=zRt(e);e=e.nextSibling}else this.dom.insertBefore(r.dom,e);for(;e;)e=zRt(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 zRt(t){let e=t.nextSibling;return t.remove(),e}const N$=vr.define({enables:FRt});function cbn(t,e){let r,n=new Promise(o=>r=o),i=o=>ubn(o,e,r);t.state.field(Mwe,!1)?t.dispatch({effects:URt.of(i)}):t.dispatch({effects:on.appendConfig.of(Mwe.init(()=>[i]))});let a=VRt.of(i);return{close:a,result:n.then(o=>((t.win.queueMicrotask||(l=>t.win.setTimeout(l,10)))(()=>{t.state.field(Mwe).indexOf(i)>-1&&t.dispatch({effects:a})}),o))}}const Mwe=Ko.define({create(){return[]},update(t,e){for(let r of e.effects)r.is(URt)?t=[r.value].concat(t):r.is(VRt)&&(t=t.filter(n=>n!=r.value));return t},provide:t=>N$.computeN([t],e=>e.field(t))}),URt=on.define(),VRt=on.define();function ubn(t,e,r){let n=e.content?e.content(t,()=>o(null)):null;if(!n){if(n=xa("form"),e.input){let s=xa("input",e.input);/^(text|password|number|email|tel|url)$/.test(s.type)&&s.classList.add("cm-textfield"),s.name||(s.name="input"),n.appendChild(xa("label",(e.label||"")+": ",s))}else n.appendChild(document.createTextNode(e.label||""));n.appendChild(document.createTextNode(" ")),n.appendChild(xa("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let i=n.nodeName=="FORM"?[n]:n.querySelectorAll("form");for(let s=0;s{u.keyCode==27?(u.preventDefault(),o(null)):u.keyCode==13&&(u.preventDefault(),o(l))}),l.addEventListener("submit",u=>{u.preventDefault(),o(l)})}let a=xa("div",n,xa("button",{onclick:()=>o(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 o(s){a.contains(a.ownerDocument.activeElement)&&t.focus(),r(s)}return{dom:a,top:e.top,mount:()=>{if(e.focus){let s;typeof e.focus=="string"?s=n.querySelector(e.focus):s=n.querySelector("input")||n.querySelector("button"),s&&"select"in s?s.select():s&&"focus"in s&&s.focus()}}}}class wp extends k2{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}wp.prototype.elementClass="",wp.prototype.toDOM=void 0,wp.prototype.mapMode=xc.TrackBefore,wp.prototype.startSide=wp.prototype.endSide=-1,wp.prototype.point=!0;const KK=vr.define(),hbn=vr.define(),dbn={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>ti.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},B$=vr.define();function Iwe(t){return[GRt(),B$.of({...dbn,...t})]}const QRt=vr.define({combine:t=>t.some(e=>e)});function GRt(t){return[fbn]}const fbn=Ro.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(B$).map(e=>new WRt(t,e)),this.fixed=!t.state.facet(QRt);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(QRt)!=!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=ti.iter(this.view.state.facet(KK),this.view.viewport.from),n=[],i=this.gutters.map(a=>new pbn(a,this.view.viewport,-this.view.documentPadding.top));for(let a of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(a.type)){let o=!0;for(let s of a.type)if(s.type==Ac.Text&&o){Pwe(r,n,s.from);for(let l of i)l.line(this.view,s,n);o=!1}else if(s.widget)for(let l of i)l.widget(this.view,s)}else if(a.type==Ac.Text){Pwe(r,n,a.from);for(let o of i)o.line(this.view,a,n)}else if(a.widget)for(let o of i)o.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(B$),r=t.state.facet(B$),n=t.docChanged||t.heightChanged||t.viewportChanged||!ti.eq(t.startState.facet(KK),t.state.facet(KK),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 o=e.indexOf(a);o<0?i.push(new WRt(this.view,a)):(this.gutters[o].update(t),i.push(this.gutters[o]))}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==Ra.LTR?{left:n,right:i}:{right:n,left:i}})});function HRt(t){return Array.isArray(t)?t:[t]}function Pwe(t,e,r){for(;t.value&&t.from<=r;)t.from==r&&e.push(t.value),t.next()}class pbn{constructor(e,r,n){this.gutter=e,this.height=n,this.i=0,this.cursor=ti.iter(e.markers,r.from)}addElement(e,r,n){let{gutter:i}=this,a=(r.top-this.height)/e.scaleY,o=r.height/e.scaleY;if(this.i==i.elements.length){let s=new YRt(e,o,a,n);i.elements.push(s),i.dom.appendChild(s.dom)}else i.elements[this.i].update(e,o,a,n);this.height=r.bottom,this.i++}line(e,r,n){let i=[];Pwe(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 o=this.gutter;i.length==0&&!o.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(hbn)){let o=a(e,r.widget,r);o&&(i||(i=[])).push(o)}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 WRt{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,o;if(a!=this.dom&&this.dom.contains(a)){for(;a.parentNode!=this.dom;)a=a.parentNode;let l=a.getBoundingClientRect();o=(l.top+l.bottom)/2}else o=i.clientY;let s=e.lineBlockAtHeight(o-e.documentTop);r.domEventHandlers[n](e,s,i)&&i.preventDefault()});this.markers=HRt(r.markers(e)),r.initialSpacer&&(this.spacer=new YRt(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=HRt(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!ti.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 YRt{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":""),gbn(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,r){let n="cm-gutterElement",i=this.dom.firstChild;for(let a=0,o=0;;){let s=o,l=aa(s,l,u)||o(s,l,u):o}return n}})}});class Nwe extends wp{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Bwe(t,e){return t.state.facet(XR).formatNumber(e,t.state)}const ybn=B$.compute([XR],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(mbn)},lineMarker(e,r,n){return n.some(i=>i.toDOM)?null:new Nwe(Bwe(e,e.state.doc.lineAt(r.from).number))},widgetMarker:(e,r,n)=>{for(let i of e.state.facet(vbn)){let a=i(e,r,n);if(a)return a}return null},lineMarkerChange:e=>e.startState.facet(XR)!=e.state.facet(XR),initialSpacer(e){return new Nwe(Bwe(e,jRt(e.state.doc.lines)))},updateSpacer(e,r){let n=Bwe(r.view,jRt(r.view.state.doc.lines));return n==e.number?e:new Nwe(n)},domEventHandlers:t.facet(XR).domEventHandlers,side:"before"}));function qRt(t={}){return[XR.of(t),GRt(),ybn]}function jRt(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(bbn.range(i)))}return ti.of(e)});function wbn(){return xbn}let Abn=0,L0=class XMe{constructor(e,r,n,i){this.name=e,this.set=r,this.base=n,this.modified=i,this.id=Abn++}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 XMe&&(r=e),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let i=new XMe(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 ZK(e);return n=>n.modified.indexOf(r)>-1?n:ZK.get(n.base||n,n.modified.concat(r).sort((i,a)=>i.id-a.id))}},Sbn=0;class ZK{constructor(e){this.name=e,this.instances=[],this.id=Sbn++}static get(e,r){if(!r.length)return e;let n=r[0].instances.find(s=>s.base==e&&Tbn(r,s.modified));if(n)return n;let i=[],a=new L0(e.name,i,e,r);for(let s of r)s.instances.push(a);let o=Cbn(r);for(let s of e.set)if(!s.modified.length)for(let l of o)i.push(ZK.get(s,l));return a}}function Tbn(t,e){return t.length==e.length&&t.every((r,n)=>r==e[n])}function Cbn(t){let e=[[]];for(let r=0;rn.length-r.length)}function m1(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=[],o=2,s=i;for(let d=0;;){if(s=="..."&&d>0&&d+3==i.length){o=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(s);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=="!"){o=0;break}if(p!="/")throw new RangeError("Invalid path: "+i);s=i.slice(d)}let l=a.length-1,u=a[l];if(!u)throw new RangeError("Invalid path: "+i);let h=new $$(n,o,l>0?a.slice(0,l):null);e[u]=h.sort(e[u])}}return XRt.add(e)}const XRt=new _n({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.tags,i.mode,i.context);r?r.next=a:n=a,r=a}return n}});let $$=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 o=i;for(let s of a)for(let l of s.set){let u=r[l.id];if(u){o=o?o+" "+u:u;break}}return o},scope:n}}function Obn(t,e){let r=null;for(let n of t){let i=n.style(e);i&&(r=r?r+" "+i:i)}return r}function ZRt(t,e,r,n=0,i=t.length){let a=new kbn(n,Array.isArray(e)?e:[e],r);a.highlightRange(t.cursor(),n,i,"",a.highlighters),a.flush(i)}class kbn{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:o,from:s,to:l}=e;if(s>=n||l<=r)return;o.isTop&&(a=this.highlighters.filter(p=>!p.scope||p.scope(o)));let u=i,h=Ebn(e)||$$.empty,d=Obn(a,h.tags);if(d&&(u&&(u+=" "),u+=d,h.mode==1&&(i+=(i?" ":"")+d)),this.startSpan(Math.max(r,s),u),h.opaque)return;let f=e.tree&&e.tree.prop(_n.mounted);if(f&&f.overlay){let p=e.node.enter(f.overlay[0].from+s,1),g=this.highlighters.filter(v=>!v.scope||v.scope(f.tree.type)),m=e.firstChild();for(let v=0,y=s;;v++){let b=v=x||!e.nextSibling())););if(!b||x>n)break;y=b.to+s,y>r&&(this.highlightRange(p.cursor(),Math.max(r,b.from+s),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 Ebn(t){let e=t.type.prop(XRt);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const hr=L0.define,JK=hr(),D2=hr(),JRt=hr(D2),e4t=hr(D2),L2=hr(),eZ=hr(L2),$we=hr(L2),M0=hr(),dC=hr(M0),I0=hr(),P0=hr(),Fwe=hr(),F$=hr(Fwe),tZ=hr(),Re={comment:JK,lineComment:hr(JK),blockComment:hr(JK),docComment:hr(JK),name:D2,variableName:hr(D2),typeName:JRt,tagName:hr(JRt),propertyName:e4t,attributeName:hr(e4t),className:hr(D2),labelName:hr(D2),namespace:hr(D2),macroName:hr(D2),literal:L2,string:eZ,docString:hr(eZ),character:hr(eZ),attributeValue:hr(eZ),number:$we,integer:hr($we),float:hr($we),bool:hr(L2),regexp:hr(L2),escape:hr(L2),color:hr(L2),url:hr(L2),keyword:I0,self:hr(I0),null:hr(I0),atom:hr(I0),unit:hr(I0),modifier:hr(I0),operatorKeyword:hr(I0),controlKeyword:hr(I0),definitionKeyword:hr(I0),moduleKeyword:hr(I0),operator:P0,derefOperator:hr(P0),arithmeticOperator:hr(P0),logicOperator:hr(P0),bitwiseOperator:hr(P0),compareOperator:hr(P0),updateOperator:hr(P0),definitionOperator:hr(P0),typeOperator:hr(P0),controlOperator:hr(P0),punctuation:Fwe,separator:hr(Fwe),bracket:F$,angleBracket:hr(F$),squareBracket:hr(F$),paren:hr(F$),brace:hr(F$),content:M0,heading:dC,heading1:hr(dC),heading2:hr(dC),heading3:hr(dC),heading4:hr(dC),heading5:hr(dC),heading6:hr(dC),contentSeparator:hr(M0),list:hr(M0),quote:hr(M0),emphasis:hr(M0),strong:hr(M0),link:hr(M0),monospace:hr(M0),strikethrough:hr(M0),inserted:hr(),deleted:hr(),changed:hr(),invalid:hr(),meta:tZ,documentMeta:hr(tZ),annotation:hr(tZ),processingInstruction:hr(tZ),definition:L0.defineModifier("definition"),constant:L0.defineModifier("constant"),function:L0.defineModifier("function"),standard:L0.defineModifier("standard"),local:L0.defineModifier("local"),special:L0.defineModifier("special")};for(let t in Re){let e=Re[t];e instanceof L0&&(e.name=t)}KRt([{tag:Re.link,class:"tok-link"},{tag:Re.heading,class:"tok-heading"},{tag:Re.emphasis,class:"tok-emphasis"},{tag:Re.strong,class:"tok-strong"},{tag:Re.keyword,class:"tok-keyword"},{tag:Re.atom,class:"tok-atom"},{tag:Re.bool,class:"tok-bool"},{tag:Re.url,class:"tok-url"},{tag:Re.labelName,class:"tok-labelName"},{tag:Re.inserted,class:"tok-inserted"},{tag:Re.deleted,class:"tok-deleted"},{tag:Re.literal,class:"tok-literal"},{tag:Re.string,class:"tok-string"},{tag:Re.number,class:"tok-number"},{tag:[Re.regexp,Re.escape,Re.special(Re.string)],class:"tok-string2"},{tag:Re.variableName,class:"tok-variableName"},{tag:Re.local(Re.variableName),class:"tok-variableName tok-local"},{tag:Re.definition(Re.variableName),class:"tok-variableName tok-definition"},{tag:Re.special(Re.variableName),class:"tok-variableName2"},{tag:Re.definition(Re.propertyName),class:"tok-propertyName tok-definition"},{tag:Re.typeName,class:"tok-typeName"},{tag:Re.namespace,class:"tok-namespace"},{tag:Re.className,class:"tok-className"},{tag:Re.macroName,class:"tok-macroName"},{tag:Re.propertyName,class:"tok-propertyName"},{tag:Re.operator,class:"tok-operator"},{tag:Re.comment,class:"tok-comment"},{tag:Re.meta,class:"tok-meta"},{tag:Re.invalid,class:"tok-invalid"},{tag:Re.punctuation,class:"tok-punctuation"}]);var zwe;const M2=new _n;function rZ(t){return vr.define({combine:t?e=>e.concat(t):void 0})}const Uwe=new _n;class ef{constructor(e,r,n=[],i=""){this.data=e,this.name=i,ei.prototype.hasOwnProperty("tree")||Object.defineProperty(ei.prototype,"tree",{get(){return wa(this)}}),this.parser=r,this.extension=[y1.of(this),ei.languageData.of((a,o,s)=>{let l=t4t(a,o,s),u=l.type.prop(M2);if(!u)return[];let h=a.facet(u),d=l.type.prop(Uwe);if(d){let f=l.resolve(o-l.from,s);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 t4t(e,r,n).type.prop(M2)==this.data}findRegions(e){let r=e.facet(y1);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,o)=>{if(a.prop(M2)==this.data){n.push({from:o,to:o+a.length});return}let s=a.prop(_n.mounted);if(s){if(s.tree.prop(M2)==this.data){if(s.overlay)for(let l of s.overlay)n.push({from:l.from+o,to:l.to+o});else n.push({from:o,to:o+a.length});return}else if(s.overlay){let l=n.length;if(i(s.tree,s.overlay[0].from+o),n.length>l)return}}for(let l=0;ln.isTop?r:void 0)]}),e.name)}configure(e,r){return new v1(this.data,this.parser.configure(e),r||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function wa(t){let e=t.field(ef.state,!1);return e?e.tree:ci.empty}class _bn{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 z$=null;class fC{constructor(e,r,n=[],i,a,o,s,l){this.parser=e,this.state=r,this.fragments=n,this.tree=i,this.treeLen=a,this.viewport=o,this.skipped=s,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,r,n){return new fC(e,r,[],ci.empty,0,n,[],null)}startParse(){return this.parser.startParse(new _bn(this.state.doc),this.fragments)}work(e,r){return r!=null&&r>=this.state.doc.length&&(r=void 0),this.tree!=ci.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(h1.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let r=z$;z$=this;try{return e()}finally{z$=r}}withoutTempSkipped(e){for(let r;r=this.tempSkipped.pop();)e=r4t(e,r.from,r.to);return e}changes(e,r){let{fragments:n,tree:i,treeLen:a,viewport:o,skipped:s}=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=h1.applyChanges(n,l),i=ci.empty,a=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){s=[];for(let u of this.skipped){let h=e.mapPos(u.from,1),d=e.mapPos(u.to,-1);he.from&&(this.fragments=r4t(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 fK{createParse(r,n,i){let a=i[0].from,o=i[i.length-1].to;return{parsedPos:a,advance(){let l=z$;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=o,new ci(zs.none,[],[],o-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 z$}}function r4t(t,e,r){return h1.applyChanges(t,[{fromA:e,toA:r,fromB:e,toB:r}])}class KR{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 KR(r)}static init(e){let r=Math.min(3e3,e.doc.length),n=fC.create(e.facet(y1).parser,e,{from:0,to:r});return n.work(20,r)||n.takeTree(),new KR(n)}}ef.state=Ko.define({create:KR.init,update(t,e){for(let r of e.effects)if(r.is(ef.setState))return r.value;return e.startState.facet(y1)!=e.state.facet(y1)?KR.init(e.state):t.apply(e)}});let n4t=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(n4t=t=>{let e=-1,r=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(r):cancelIdleCallback(e)});const Vwe=typeof navigator<"u"&&(!((zwe=navigator.scheduling)===null||zwe===void 0)&&zwe.isInputPending)?()=>navigator.scheduling.isInputPending():null,Rbn=Ro.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(ef.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(ef.state);(r.tree!=r.context.tree||!r.context.isDone(e.doc.length))&&(this.working=n4t(this.work))}work(e){this.working=null;let r=Date.now();if(this.chunkEndi+1e3,l=a.context.work(()=>Vwe&&Vwe()||Date.now()>o,i+(s?0:1e5));this.chunkBudget-=Date.now()-r,(l||this.chunkBudget<=0)&&(a.context.takeTree(),this.view.dispatch({effects:ef.setState.of(new KR(a.context))})),this.chunkBudget>0&&!(l&&!s)&&this.scheduleWork(),this.checkAsyncSchedule(a.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(r=>qh(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()}}}),y1=vr.define({combine(t){return t.length?t[0]:null},enables:t=>[ef.state,Rbn,er.contentAttributes.compute([t],e=>{let r=e.facet(t);return r&&r.name?{"data-language":r.name}:{}})]});class I2{constructor(e,r=[]){this.language=e,this.support=r,this.extension=[e,r]}}class nZ{constructor(e,r,n,i,a,o=void 0){this.name=e,this.alias=r,this.extensions=n,this.filename=i,this.loadFunc=a,this.support=o,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 nZ(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 o=r.indexOf(a);if(o>-1&&(a.length>2||!/\w/.test(r[o-1])&&!/\w/.test(r[o+a.length])))return i}return null}}const Dbn=vr.define(),ZR=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 pC(t){let e=t.facet(ZR);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function U$(t,e){let r="",n=t.tabSize,i=t.facet(ZR)[0];if(i==" "){for(;e>=n;)r+=" ",e-=n;i=" "}for(let a=0;a=e?Lbn(t,r,e):null}class iZ{constructor(e,r={}){this.state=e,this.options=r,this.unit=pC(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+=o-this.countColumn(n,n.search(/\S|$/))),a}countColumn(e,r=e.length){return Lg(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 o=a(i);if(o>-1)return o}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const b1=new _n;function Lbn(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 o=i;o&&!(o.fromn.node.to||o.from==n.node.from&&o.type==n.node.type);o=o.parent)a.push(o);for(let o=a.length-1;o>=0;o--)n={node:a[o],next:n}}return i4t(n,t,r)}function i4t(t,e,r){for(let n=t;n;n=n.next){let i=Ibn(n.node);if(i)return i(Gwe.create(e,r,n))}return 0}function Mbn(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function Ibn(t){let e=t.type.prop(b1);if(e)return e;let r=t.firstChild,n;if(r&&(n=r.type.prop(_n.closedBy))){let i=t.lastChild,a=i&&n.indexOf(i.name)>-1;return o=>a4t(o,!0,1,void 0,a&&!Mbn(o)?i.from:void 0)}return t.parent==null?Pbn:null}function Pbn(){return 0}class Gwe extends iZ{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 Gwe(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(Nbn(n,e))break;r=this.state.doc.lineAt(n.from)}return this.lineIndent(r.from)}continue(){return i4t(this.context.next,this.base,this.pos)}}function Nbn(t,e){for(let r=e;r;r=r.parent)if(t==r)return!0;return!1}function Bbn(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),o=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let s=r.to;;){let l=e.childAfter(s);if(!l||l==n)return null;if(!l.type.isSkipped){if(l.from>=o)return null;let u=/^ */.exec(a.text.slice(r.to-a.from))[0].length;return{from:r.from,to:r.to+u}}s=l.to}}function JR({closing:t,align:e=!0,units:r=1}){return n=>a4t(n,e,r,t)}function a4t(t,e,r,n,i){let a=t.textAfter,o=a.match(/^\s*/)[0].length,s=n&&a.slice(o,o+n.length)==n||i==t.pos+o,l=e?Bbn(t):null;return l?s?t.column(l.from):t.column(l.to):t.baseIndent+(s?0:t.unit*r)}const $bn=t=>t.baseIndent;function e4({except:t,units:e=1}={}){return r=>{let n=t&&t.test(r.textAfter);return r.baseIndent+(n?0:e*r.unit)}}const Fbn=200;function zbn(){return ei.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+Fbn)return t;let a=r.sliceString(i.from,n);if(!e.some(u=>u.test(a)))return t;let{state:o}=t,s=-1,l=[];for(let{head:u}of o.selection.ranges){let h=o.doc.lineAt(u);if(h.from==s)continue;s=h.from;let d=Qwe(o,h.from);if(d==null)continue;let f=/^\s*/.exec(h.text)[0],p=U$(o,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 o4t=vr.define(),x1=new _n;function V$(t){let e=t.firstChild,r=t.lastChild;return e&&e.tor)continue;if(a&&s.from=e&&u.to>r&&(a=u)}}return a}function Vbn(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function aZ(t,e,r){for(let n of t.facet(o4t)){let i=n(t,e,r);if(i)return i}return Ubn(t,e,r)}function s4t(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 oZ=on.define({map:s4t}),Q$=on.define({map:s4t});function l4t(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 gC=Ko.define({create(){return Ar.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,i)=>t=c4t(t,n,i)),t=t.map(e.changes);let r=[];for(let n of e.effects)n.is(oZ)&&!Qbn(t,n.value.from,n.value.to)?r.push(n.value):n.is(Q$)&&(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(d4t),i=r.map(a=>(n?Ar.replace({widget:new qbn(n(e.state,a))}):g4t).range(a.from,a.to));t=t.update({add:i})}return e.selection&&(t=c4t(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 sZ(t,e,r){var n;let i=null;return(n=t.field(gC,!1))===null||n===void 0||n.between(e,r,(a,o)=>{(!i||i.from>a)&&(i={from:a,to:o})}),i}function Qbn(t,e,r){let n=!1;return t.between(e,e,(i,a)=>{i==e&&a==r&&(n=!0)}),n}function u4t(t,e){return t.field(gC,!1)?e:e.concat(on.appendConfig.of(f4t()))}const Gbn=t=>{for(let e of l4t(t)){let r=aZ(t.state,e.from,e.to);if(r)return t.dispatch({effects:u4t(t.state,[oZ.of(r),h4t(t,r)])}),!0}return!1},Hbn=t=>{if(!t.state.field(gC,!1))return!1;let e=[];for(let r of l4t(t)){let n=sZ(t.state,r.from,r.to);n&&e.push(Q$.of(n),h4t(t,n,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function h4t(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 Wbn=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Gbn},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Hbn},{key:"Ctrl-Alt-[",run:t=>{let{state:e}=t,r=[];for(let n=0;n{let e=t.state.field(gC,!1);if(!e||!e.size)return!1;let r=[];return e.between(0,t.state.doc.length,(n,i)=>{r.push(Q$.of({from:n,to:i}))}),t.dispatch({effects:r}),!0}}],Ybn={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},d4t=vr.define({combine(t){return E0(t,Ybn)}});function f4t(t){return[gC,Kbn]}function p4t(t,e){let{state:r}=t,n=r.facet(d4t),i=o=>{let s=t.lineBlockAt(t.posAtDOM(o.target)),l=sZ(t.state,s.from,s.to);l&&t.dispatch({effects:Q$.of(l)}),o.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 g4t=Ar.replace({widget:new class extends Hu{toDOM(t){return p4t(t,null)}}});class qbn extends Hu{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return p4t(e,this.value)}}const jbn={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Hwe extends wp{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 Xbn(t={}){let e={...jbn,...t},r=new Hwe(e,!0),n=new Hwe(e,!1),i=Ro.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(y1)!=o.state.facet(y1)||o.startState.field(gC,!1)!=o.state.field(gC,!1)||wa(o.startState)!=wa(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let s=new Qu;for(let l of o.viewportLineBlocks){let u=sZ(o.state,l.from,l.to)?n:aZ(o.state,l.from,l.to)?r:null;u&&s.add(l.from,l.from,u)}return s.finish()}}),{domEventHandlers:a}=e;return[i,Iwe({class:"cm-foldGutter",markers(o){var s;return((s=o.plugin(i))===null||s===void 0?void 0:s.markers)||ti.empty},initialSpacer(){return new Hwe(e,!1)},domEventHandlers:{...a,click:(o,s,l)=>{if(a.click&&a.click(o,s,l))return!0;let u=sZ(o.state,s.from,s.to);if(u)return o.dispatch({effects:Q$.of(u)}),!0;let h=aZ(o.state,s.from,s.to);return h?(o.dispatch({effects:oZ.of(h)}),!0):!1}}}),f4t()]}const Kbn=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 G${constructor(e,r){this.specs=e;let n;function i(s){let l=d1.newName();return(n||(n=Object.create(null)))["."+l]=s,l}const a=typeof r.all=="string"?r.all:r.all?i(r.all):void 0,o=r.scope;this.scope=o instanceof ef?s=>s.prop(M2)==o.data:o?s=>s==o:void 0,this.style=KRt(e.map(s=>({tag:s.tag,class:s.class||i(Object.assign({},s,{tag:null}))})),{all:a}).style,this.module=n?new d1(n):null,this.themeType=r.themeType}static define(e,r){return new G$(e,r||{})}}const Wwe=vr.define(),m4t=vr.define({combine(t){return t.length?[t[0]]:null}});function lZ(t){let e=t.facet(Wwe);return e.length?e:t.facet(m4t)}function v4t(t,e){let r=[exn],n;return t instanceof G$&&(t.module&&r.push(er.styleModule.of(t.module)),n=t.themeType),e!=null&&e.fallback?r.push(m4t.of(t)):n?r.push(Wwe.computeN([er.darkTheme],i=>i.facet(er.darkTheme)==(n=="dark")?[t]:[])):r.push(Wwe.of(t)),r}function Zbn(t,e,r){let n=lZ(t),i=null;if(n){for(let a of n)if(!a.scope||r){let o=a.style(e);o&&(i=i?i+" "+o:o)}}return i}class Jbn{constructor(e){this.markCache=Object.create(null),this.tree=wa(e.state),this.decorations=this.buildDeco(e,lZ(e.state)),this.decoratedTo=e.viewport.to}update(e){let r=wa(e.state),n=lZ(e.state),i=n!=lZ(e.startState),{viewport:a}=e.view,o=e.changes.mapPos(this.decoratedTo,1);r.length=a.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(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 Qu;for(let{from:i,to:a}of e.visibleRanges)ZRt(this.tree,r,(o,s,l)=>{n.add(o,s,this.markCache[l]||(this.markCache[l]=Ar.mark({class:l})))},i,a);return n.finish()}}const exn=Zd.high(Ro.fromClass(Jbn,{decorations:t=>t.decorations})),txn=G$.define([{tag:Re.meta,color:"#404740"},{tag:Re.link,textDecoration:"underline"},{tag:Re.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Re.emphasis,fontStyle:"italic"},{tag:Re.strong,fontWeight:"bold"},{tag:Re.strikethrough,textDecoration:"line-through"},{tag:Re.keyword,color:"#708"},{tag:[Re.atom,Re.bool,Re.url,Re.contentSeparator,Re.labelName],color:"#219"},{tag:[Re.literal,Re.inserted],color:"#164"},{tag:[Re.string,Re.deleted],color:"#a11"},{tag:[Re.regexp,Re.escape,Re.special(Re.string)],color:"#e40"},{tag:Re.definition(Re.variableName),color:"#00f"},{tag:Re.local(Re.variableName),color:"#30a"},{tag:[Re.typeName,Re.namespace],color:"#085"},{tag:Re.className,color:"#167"},{tag:[Re.special(Re.variableName),Re.macroName],color:"#256"},{tag:Re.definition(Re.propertyName),color:"#00c"},{tag:Re.comment,color:"#940"},{tag:Re.invalid,color:"#f00"}]),rxn=er.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),y4t=1e4,b4t="()[]{}",x4t=vr.define({combine(t){return E0(t,{afterCursor:!0,brackets:b4t,maxScanDistance:y4t,renderMatch:axn})}}),nxn=Ar.mark({class:"cm-matchingBracket"}),ixn=Ar.mark({class:"cm-nonmatchingBracket"});function axn(t){let e=[],r=t.matched?nxn:ixn;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 w4t(t){let e=[],r=t.facet(x4t);for(let n of t.selection.ranges){if(!n.empty)continue;let i=N0(t,n.head,-1,r)||n.head>0&&N0(t,n.head-1,1,r)||r.afterCursor&&(N0(t,n.head,1,r)||n.headt.decorations}),rxn];function sxn(t={}){return[x4t.of(t),oxn]}const A4t=new _n;function Ywe(t,e,r){let n=t.prop(e<0?_n.openedBy:_n.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 qwe(t){let e=t.type.prop(A4t);return e?e(t.node):t}function N0(t,e,r,n={}){let i=n.maxScanDistance||y4t,a=n.brackets||b4t,o=wa(t),s=o.resolveInner(e,r);for(let l=s;l;l=l.parent){let u=Ywe(l.type,r,a);if(u&&l.from0?e>=h.from&&eh.from&&e<=h.to))return lxn(t,e,r,l,h,u,a)}}return cxn(t,e,r,o,s.type,i,a)}function lxn(t,e,r,n,i,a,o){let s=n.parent,l={from:i.from,to:i.to},u=0,h=s==null?void 0:s.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=o.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 S4t(t,e,r,n=0,i=0){e==null&&(e=t.search(/[^\s\u00a0]/),e==-1&&(e=t.length));let a=i;for(let o=n;o=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?o.toLowerCase():o,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 uxn(t){return{name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>!0),copyState:t.copyState||hxn,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||Kwe,mergeTokens:t.mergeTokens!==!1}}function hxn(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 C4t=new WeakMap;class jwe extends ef{constructor(e){let r=rZ(e.languageData),n=uxn(e),i,a=new class extends fK{createParse(o,s,l){return new fxn(i,o,s,l)}};super(r,a,[],e.name),this.topNode=mxn(r,this),i=this,this.streamParser=n,this.stateAfter=new _n({perNode:!0}),this.tokenTable=e.tokenTable?new D4t(n.tokenTable):gxn}static define(e){return new jwe(e)}getIndent(e){let r,{overrideIndentation:n}=e.options;n&&(r=C4t.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 o=e.children.length-1;o>=0;o--){let s=e.children[o],l=r+e.positions[o],u=s instanceof ci&&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 o=e.positions[a],s=e.children[a],l;if(or&&Xwe(t,a.tree,0-a.offset,r,s),u;if(l&&l.pos<=n&&(u=O4t(t,a.tree,r+a.offset,l.pos+a.offset,!1)))return{state:l.state,tree:u}}return{state:t.streamParser.startState(i?pC(i):4),tree:ci.empty}}let fxn=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=fC.get(),o=i[0].from,{state:s,tree:l}=dxn(e,n,o,this.to,a==null?void 0:a.state);this.state=s,this.parsedPos=this.chunkStart=o+l.length;for(let u=0;uu.from<=a.viewport.from&&u.to>=a.viewport.from)&&(this.state=this.lang.streamParser.startState(pC(a.state)),a.skipUntilInView(this.parsedPos,a.viewport.from),this.parsedPos=a.viewport.from),this.moveRangeIndex()}advance(){let e=fC.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==` +`){[e,r]=BR(this,e,r);let i="";for(let a=0,o=0;ae&&a&&(i+=n),eo&&(i+=s.sliceString(e-o,r-o,n)),o=l+1}return i}flatten(e){for(let r of this.children)r.flatten(e)}scanIdentical(e,r){if(!(e instanceof TP))return 0;let n=0,[i,a,o,s]=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==o||a==s)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 ys(p,r)}let i=Math.max(32,n>>5),a=i<<1,o=i>>1,s=[],l=0,u=-1,h=[];function d(p){let g;if(p.lines>a&&p instanceof TP)for(let m of p.children)d(m);else p.lines>o&&(l>o||!l)?(f(),s.push(p)):p instanceof ys&&l&&(g=h[h.length-1])instanceof ys&&p.lines+g.lines<=32?(l+=p.lines,u+=p.length+1,h[h.length-1]=new ys(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&&(s.push(h.length==1?h[0]:TP.from(h,u)),u=-1,l=h.length=0)}for(let p of e)d(p);return f(),s.length==1?s[0]:new TP(s,r)}};wi.empty=new ys([""],0);function mvn(t){let e=-1;for(let r of t)e+=r.length+1;return e}function gK(t,e,r=0,n=1e9){for(let i=0,a=0,o=!0;a=r&&(l>n&&(s=s.slice(0,n-i)),i0?1:(e instanceof ys?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],o=a>>1,s=i instanceof ys?i.text.length:i.children.length;if(o==(r>0?s: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 ys){let l=i.text[o+(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[o+(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 ys?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 P_t{constructor(e,r,n){this.value="",this.done=!1,this.cursor=new p$(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 N_t{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"&&(wi.prototype[Symbol.iterator]=function(){return this.iter()},p$.prototype[Symbol.iterator]=P_t.prototype[Symbol.iterator]=N_t.prototype[Symbol.iterator]=function(){return this});let vvn=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 BR(t,e,r){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,r))]}function Ul(t,e,r=!0,n=!0){return pvn(t,e,r,n)}function yvn(t){return t>=56320&&t<57344}function bvn(t){return t>=55296&&t<56320}function Yh(t,e){let r=t.charCodeAt(e);if(!bvn(r)||e+1==t.length)return r;let n=t.charCodeAt(e+1);return yvn(n)?(r-55296<<10)+(n-56320)+65536:r}function T2e(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function C0(t){return t<65536?1:2}const C2e=/\r\n?|\n/;var xc=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(xc||(xc={}));class O0{constructor(e){this.sections=e}get length(){let e=0;for(let r=0;re)return a+(e-i);a+=s}else{if(n!=xc.Simple&&u>=e&&(n==xc.TrackDel&&ie||n==xc.TrackBefore&&ie))return null;if(u>e||u==e&&r<0&&!s)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&&s>=e)return ir?"cover":!0;i=s}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 O0(e)}static create(e){return new O0(e)}}class bs extends O0{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 O2e(this,(r,n,i,a,o)=>e=e.replace(i,i+(n-r),o),!1),e}mapDesc(e,r=!1){return k2e(this,e,r,!0)}invert(e){let r=this.sections.slice(),n=[];for(let i=0,a=0;i=0){r[i]=s,r[i+1]=o;let l=i>>1;for(;n.length0&&O2(n,r,a.text),a.forward(h),s+=h}let u=e[o++];for(;s>1].toJSON()))}return e}static of(e,r,n){let i=[],a=[],o=0,s=null;function l(h=!1){if(!h&&!i.length)return;of||d<0||f>r)throw new RangeError(`Invalid change range ${d} to ${f} (in doc of length ${r})`);let g=p?typeof p=="string"?wi.of(p.split(n||C2e)):p:wi.empty,m=g.length;if(d==f&&m==0)return;do&&lu(i,d-o,-1),lu(i,f-d,m),O2(a,i,g),o=f}}return u(e),l(!s),s}static empty(e){return new bs(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;is&&typeof o!="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 O2(t,e,r){if(r.length==0)return;let n=e.length-2>>1;if(n>1])),!(r||o==t.sections.length||t.sections[o+1]<0);)s=t.sections[o++],l=t.sections[o++];e(i,u,a,h,d),i=u,a=h}}}function k2e(t,e,r,n=!1){let i=[],a=n?[]:null,o=new g$(t),s=new g$(e);for(let l=-1;;){if(o.done&&s.len||s.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&s.ins==-1){let u=Math.min(o.len,s.len);lu(i,u,-1),o.forward(u),s.forward(u)}else if(s.ins>=0&&(o.ins<0||l==o.i||o.off==0&&(s.len=0&&l=0){let u=0,h=o.len;for(;h;)if(s.ins==-1){let d=Math.min(h,s.len);u+=d,h-=d,s.forward(d)}else if(s.ins==0&&s.lenl||o.ins>=0&&o.len>l)&&(s||n.length>u),a.forward2(l),o.forward(l)}}}}class g${constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return r>=e.length?wi.empty:e[r]}textBit(e){let{inserted:r}=this.set,n=this.i-2>>1;return n>=r.length&&!e?wi.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 m$=class jMe{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 jMe(n,i,this.flags,this.goalColumn)}extend(e,r=e,n=0){if(e<=this.anchor&&r>=this.anchor)return xt.range(e,r,void 0,void 0,n);let i=Math.abs(e-this.anchor)>Math.abs(r-this.anchor)?e:r;return xt.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 xt.range(e.anchor,e.head)}static create(e,r,n,i){return new jMe(e,r,n,i)}};class xt{constructor(e,r){this.ranges=e,this.mainIndex=r}map(e,r=-1){return e.empty?this:xt.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 xt(e.ranges.map(r=>m$.fromJSON(r)),e.main)}static single(e,r=e){return new xt([xt.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?xt.range(l,s):xt.range(s,l))}}return new xt(e,r)}}function $_t(t,e){for(let r of t.ranges)if(r.to>e)throw new RangeError("Selection points outside of document")}let E2e=0;class vr{constructor(e,r,n,i,a){this.combine=e,this.compareInput=r,this.compare=n,this.isStatic=i,this.id=E2e++,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:_2e),!!e.static,e.enables)}of(e){return new mK([],this,0,e)}compute(e,r){if(this.isStatic)throw new Error("Can't compute a static facet");return new mK(e,this,1,r)}computeN(e,r){if(this.isStatic)throw new Error("Can't compute a static facet");return new mK(e,this,2,r)}from(e,r){return r||(r=n=>n),this.compute([e],n=>r(n.field(e)))}}function _2e(t,e){return t==e||t.length==e.length&&t.every((r,n)=>r===e[n])}class mK{constructor(e,r,n,i){this.dependencies=e,this.facet=r,this.type=n,this.value=i,this.id=E2e++}dynamicSlot(e){var r;let n=this.value,i=this.facet.compareInput,a=this.id,o=e[a]>>1,s=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[o]=n(d),1},update(d,f){if(l&&f.docChanged||u&&(f.docChanged||f.selection)||R2e(d,h)){let p=n(d);if(s?!F_t(p,d.values[o],i):!i(p,d.values[o]))return d.values[o]=p,1}return 0},reconfigure:(d,f)=>{let p,g=f.config.address[a];if(g!=null){let m=bK(f,g);if(this.dependencies.every(v=>v instanceof vr?f.facet(v)===d.facet(v):v instanceof Ko?f.field(v,!1)==d.field(v,!1):!0)||(s?F_t(p=n(d),m,i):i(p=n(d),m)))return d.values[o]=m,0}else p=n(d);return d.values[o]=p,1}}}get extension(){return this}}function F_t(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)),o=t[e.id]>>1;function s(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(vK).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],o=this.updateF(a,i);return this.compareF(a,o)?0:(n.values[r]=o,1)},reconfigure:(n,i)=>{let a=n.facet(vK),o=i.facet(vK),s;return(s=a.find(l=>l.field==this))&&s!=o.find(l=>l.field==this)?(n.values[r]=s.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,vK.of({field:this,create:e})]}get extension(){return this}}const aC={lowest:4,low:3,default:2,high:1,highest:0};function v$(t){return e=>new z_t(e,t)}const Zd={highest:v$(aC.highest),high:v$(aC.high),default:v$(aC.default),low:v$(aC.low),lowest:v$(aC.lowest)};class z_t{constructor(e,r){this.inner=e,this.prec=r}get extension(){return this}}class $R{of(e){return new D2e(this,e)}reconfigure(e){return $R.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class D2e{constructor(e,r){this.compartment=e,this.inner=r}get extension(){return this}}class yK{constructor(e,r,n,i,a,o){for(this.base=e,this.compartments=r,this.dynamicSlots=n,this.address=i,this.staticValues=a,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,r,n){let i=[],a=Object.create(null),o=new Map;for(let f of wvn(e,r,o))f instanceof Ko?i.push(f):(a[f.facet.id]||(a[f.facet.id]=[])).push(f);let s=Object.create(null),l=[],u=[];for(let f of i)s[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(s[g.id]=l.length<<1|1,_2e(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?(s[v.id]=l.length<<1|1,l.push(v.value)):(s[v.id]=u.length<<1,u.push(y=>v.dynamicSlot(y)));s[g.id]=u.length<<1,u.push(v=>xvn(v,g,p))}}let d=u.map(f=>f(s));return new yK(e,o,d,s,l,a)}}function wvn(t,e,r){let n=[[],[],[],[],[]],i=new Map;function a(o,s){let l=i.get(o);if(l!=null){if(l<=s)return;let u=n[l].indexOf(o);u>-1&&n[l].splice(u,1),o instanceof D2e&&r.delete(o.compartment)}if(i.set(o,s),Array.isArray(o))for(let u of o)a(u,s);else if(o instanceof D2e){if(r.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=e.get(o.compartment)||o.inner;r.set(o.compartment,u),a(u,s)}else if(o instanceof z_t)a(o.inner,o.prec);else if(o instanceof Ko)n[s].push(o),o.provides&&a(o.provides,s);else if(o instanceof mK)n[s].push(o),o.facet.extensions&&a(o.facet.extensions,aC.default);else{let u=o.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(u==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(u,s)}}return a(t,aC.default),n.reduce((o,s)=>o.concat(s))}function y$(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 bK(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const U_t=vr.define(),L2e=vr.define({combine:t=>t.some(e=>e),static:!0}),V_t=vr.define({combine:t=>t.length?t[0]:void 0,static:!0}),Q_t=vr.define(),G_t=vr.define(),H_t=vr.define(),W_t=vr.define({combine:t=>t.length?t[0]:!1});let k0=class{constructor(e,r){this.type=e,this.value=r}static define(){return new Avn}};class Avn{of(e){return new k0(this,e)}}class Svn{constructor(e){this.map=e}of(e){return new on(this,e)}}class on{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 on(this.type,r)}is(e){return this.type==e}static define(e={}){return new Svn(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}}on.reconfigure=on.define(),on.appendConfig=on.define();class Us{constructor(e,r,n,i,a,o){this.startState=e,this.changes=r,this.selection=n,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,n&&$_t(n,r.newLength),a.some(s=>s.type==Us.time)||(this.annotations=a.concat(Us.time.of(Date.now())))}static create(e,r,n,i,a,o){return new Us(e,r,n,i,a,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let 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(Us.userEvent);return!!(r&&(r==e||r.length>e.length&&r.slice(0,e.length)==e&&r[e.length]=="."))}}Us.time=k0.define(),Us.userEvent=k0.define(),Us.addToHistory=k0.define(),Us.remote=k0.define();function Tvn(t,e){let r=[];for(let n=0,i=0;;){let a,o;if(n=t[n]))a=t[n++],o=t[n++];else if(i=0;i--){let a=n[i](t);a instanceof Us?t=a:Array.isArray(a)&&a.length==1&&a[0]instanceof Us?t=a[0]:t=q_t(e,FR(a),!1)}return t}function Ovn(t){let e=t.startState,r=e.facet(H_t),n=t;for(let i=r.length-1;i>=0;i--){let a=r[i](t);a&&Object.keys(a).length&&(n=Y_t(n,M2e(e,a,t.changes.newLength),!0))}return n==t?t:Us.create(e,t.changes,t.selection,n.effects,n.annotations,n.scrollIntoView)}const kvn=[];function FR(t){return t==null?kvn:Array.isArray(t)?t:[t]}var Ao=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(Ao||(Ao={}));const Evn=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let I2e;try{I2e=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function _vn(t){if(I2e)return I2e.test(t);for(let e=0;e"€"&&(r.toUpperCase()!=r.toLowerCase()||Evn.test(r)))return!0}return!1}function Rvn(t){return e=>{if(!/\S/.test(e))return Ao.Space;if(_vn(e))return Ao.Word;for(let r=0;r-1)return Ao.Word;return Ao.Other}}class ei{constructor(e,r,n,i,a,o){this.config=e,this.doc=r,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=a,o&&(o._state=this);for(let s=0;si.set(u,l)),r=null),i.set(s.value.compartment,s.value.extension)):s.is(on.reconfigure)?(r=null,n=s.value):s.is(on.appendConfig)&&(r=null,n=FR(n).concat(s.value));let a;r?a=e.startState.values.slice():(r=yK.resolve(n,i,this),a=new ei(r,this.doc,this.selection,r.dynamicSlots.map(()=>null),(l,u)=>u.reconfigure(l,this),null).values);let o=e.startState.facet(L2e)?e.newSelection:e.newSelection.asSingle();new ei(r,e.newDoc,o,a,(s,l)=>l.update(s,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:xt.cursor(r.from+e.length)}))}changeByRange(e){let r=this.selection,n=e(r.ranges[0]),i=this.changes(n.changes),a=[n.range],o=FR(n.effects);for(let s=1;so.spec.fromJSON(s,l)))}}return ei.create({doc:e.doc,selection:xt.fromJSON(e.selection),extensions:r.extensions?i.concat([r.extensions]):i})}static create(e={}){let r=yK.resolve(e.extensions||[],new Map),n=e.doc instanceof wi?e.doc:wi.of((e.doc||"").split(r.staticFacet(ei.lineSeparator)||C2e)),i=e.selection?e.selection instanceof xt?e.selection:xt.single(e.selection.anchor,e.selection.head):xt.single(0);return $_t(i,n.length),r.staticFacet(L2e)||(i=i.asSingle()),new ei(r,n,i,r.dynamicSlots.map(()=>null),(a,o)=>o.create(a),null)}get tabSize(){return this.facet(ei.tabSize)}get lineBreak(){return this.facet(ei.lineSeparator)||` +`}get readOnly(){return this.facet(W_t)}phrase(e,...r){for(let n of this.facet(ei.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(U_t))for(let o of a(this,r,n))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){let r=this.languageDataAt("wordChars",e);return Rvn(r.length?r[0]:"")}wordAt(e){let{text:r,from:n,length:i}=this.doc.lineAt(e),a=this.charCategorizer(e),o=e-n,s=e-n;for(;o>0;){let l=Ul(r,o,!1);if(a(r.slice(l,o))!=Ao.Word)break;o=l}for(;st.length?t[0]:4}),ei.lineSeparator=V_t,ei.readOnly=W_t,ei.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])}}),ei.languageData=U_t,ei.changeFilter=Q_t,ei.transactionFilter=G_t,ei.transactionExtender=H_t,$R.reconfigure=on.define();function E0(t,e,r={}){let n={};for(let i of t)for(let a of Object.keys(i)){let o=i[a],s=n[a];if(s===void 0)n[a]=o;else if(!(s===o||o===void 0))if(Object.hasOwnProperty.call(r,a))n[a]=r[a](s,o);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 k2{eq(e){return this==e}range(e,r=e){return N2e.create(e,r,this)}}k2.prototype.startSide=k2.prototype.endSide=0,k2.prototype.point=!1,k2.prototype.mapMode=xc.TrackDel;function P2e(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let N2e=class Zor{constructor(e,r,n){this.from=e,this.to=r,this.value=n}static create(e,r,n){return new Zor(e,r,n)}};function B2e(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}let Dvn=class Jor{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 o=i,s=a.length;;){if(o==s)return o;let l=o+s>>1,u=a[l]-e||(n?this.value[l].endSide:this.value[l].startSide)-r;if(l==o)return u>=0?o:s;u>=0?s=l:o=l+1}}between(e,r,n,i){for(let a=this.findIndex(r,-1e9,!0),o=this.findIndex(n,1e9,!1,a);ap||f==p&&u.startSide>0&&u.endSide<=0)continue;(p-f||u.endSide-u.startSide)<0||(o<0&&(o=f),u.point&&(s=Math.max(s,p-f)),n.push(u),i.push(f-o),a.push(p-o))}return{mapped:n.length?new Jor(i,a,n,s):null,pos:o}}};class ti{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 ti(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,o=e.filter;if(r.length==0&&!o)return this;if(n&&(r=r.slice().sort(B2e)),this.isEmpty)return r.length?ti.of(r):this;let s=new X_t(this,null,-1).goto(0),l=0,u=[],h=new Qu;for(;s.value||l=0){let d=r[l++];h.addInner(d.from,d.to,d.value)||u.push(d)}else s.rangeIndex==1&&s.chunkIndexthis.chunkEnd(s.chunkIndex)||as.to||a=a&&e<=a+o.length&&o.between(a,e-a,r-a,n)===!1)return}this.nextLayer.between(e,r,n)}}iter(e=0){return b$.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,r=0){return b$.from(e).goto(r)}static compare(e,r,n,i,a=-1){let o=e.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=a),s=r.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=a),l=j_t(o,s,n),u=new x$(o,l,a),h=new x$(s,l,a);n.iterGaps((d,f,p)=>K_t(u,d,h,f,p,i)),n.empty&&n.length==0&&K_t(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),o=r.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(a.length!=o.length)return!1;if(!a.length)return!0;let s=j_t(a,o),l=new x$(a,s,0).goto(n),u=new x$(o,s,0).goto(n);for(;;){if(l.to!=u.to||!F2e(l.active,u.active)||l.point&&(!u.point||!P2e(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 o=new x$(e,null,a).goto(r),s=r,l=o.openStart;for(;;){let u=Math.min(o.to,n);if(o.point){let h=o.activeForPoint(o.to),d=o.pointFroms&&(i.span(s,u,o.active,l),l=o.openEnd(u));if(o.to>n)return l+(o.point&&o.to>n?1:0);s=o.to,o.next()}}static of(e,r=!1){let n=new Qu;for(let i of e instanceof N2e?[e]:r?Lvn(e):e)n.add(i.from,i.to,i.value);return n.finish()}static join(e){if(!e.length)return ti.empty;let r=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let i=e[n];i!=ti.empty;i=i.nextLayer)r=new ti(i.chunkPos,i.chunk,r,Math.max(i.maxPoint,r.maxPoint));return r}}ti.empty=new ti([],[],null,-1);function Lvn(t){if(t.length>1)for(let e=t[0],r=1;r0)return t.slice().sort(B2e);e=n}return t}ti.empty.nextLayer=ti.empty;class Qu{finishChunk(e){this.chunks.push(new Dvn(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 Qu)).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(ti.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let r=ti.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,r}}function j_t(t,e,r){let n=new Map;for(let a of t)for(let o=0;o=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 X_t(o,r,n,a));return i.length==1?i[0]:new b$(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--)$2e(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--)$2e(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(),$2e(this.heap,0)}}}function $2e(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 x${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=b$.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){xK(this.active,e),xK(this.activeTo,e),xK(this.activeRank,e),this.minActive=Z_t(this.active,this.activeTo)}addActive(e){let r=0,{value:n,to:i,rank:a}=this.cursor;for(;r0;)r++;wK(this.active,r,n),wK(this.activeTo,r,i),wK(this.activeRank,r,a),e&&wK(e,r,this.cursor.from),this.minActive=Z_t(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&&xK(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 K_t(t,e,r,n,i,a){t.goto(e),r.goto(n);let o=n+i,s=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,o);if(t.point||r.point?(t.point&&r.point&&P2e(t.point,r.point)&&F2e(t.activeForPoint(t.to),r.activeForPoint(r.to))||a.comparePoint(s,g,t.point,r.point),h=!1):(h&&a.boundChange(s),g>s&&!F2e(t.active,r.active)&&a.compareRange(s,g,t.active,r.active),u&&go)break;s=p,f<=0&&t.next(),f>=0&&r.next()}}function F2e(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 Z_t(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=Ul(t,i)}return n===!0?-1:t.length}const U2e="ͼ",J_t=typeof Symbol>"u"?"__"+U2e:Symbol.for(U2e),V2e=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),e5t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class d1{constructor(e,r){this.rules=[];let{finish:n}=r||{};function i(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function a(o,s,l,u){let h=[],d=/^@(\w+)\b/.exec(o[0]),f=d&&d[1]=="keyframes";if(d&&s==null)return l.push(o[0]+";");for(let p in s){let g=s[p];if(/&/.test(p))a(p.split(/,\s*/).map(m=>o.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?o.map(n):o).join(", ")+" {"+h.join(" ")+"}")}for(let o in e)a(i(o),e[o],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=e5t[J_t]||1;return e5t[J_t]=e+1,U2e+e.toString(36)}static mount(e,r,n){let i=e[V2e],a=n&&n.nonce;i?a&&i.setNonce(a):i=new Mvn(e,a),i.mount(Array.isArray(r)?r:[r],e)}}let t5t=new Map;class Mvn{constructor(e,r){let n=e.ownerDocument||e,i=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let a=t5t.get(n);if(a)return e[V2e]=a;this.sheet=new i.CSSStyleSheet,t5t.set(n,this)}else this.styleTag=n.createElement("style"),r&&this.styleTag.setAttribute("nonce",r);this.modules=[],e[V2e]=this}mount(e,r){let n=this.sheet,i=0,a=0;for(let o=0;o-1&&(this.modules.splice(l,1),a--,l=-1),l==-1){if(this.modules.splice(a++,0,s),n)for(let u=0;u",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Ivn=typeof navigator<"u"&&/Mac/.test(navigator.platform),Pvn=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),wc=0;wc<10;wc++)E2[48+wc]=E2[96+wc]=String(wc);for(var wc=1;wc<=24;wc++)E2[wc+111]="F"+wc;for(var wc=65;wc<=90;wc++)E2[wc]=String.fromCharCode(wc+32),w$[wc]=String.fromCharCode(wc);for(var Q2e in E2)w$.hasOwnProperty(Q2e)||(w$[Q2e]=E2[Q2e]);function Nvn(t){var e=Ivn&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Pvn&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",r=!e&&t.key||(t.shiftKey?w$:E2)[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 xa(){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:o5t||/Mac/.test(Gu.platform),windows:/Win/.test(Gu.platform),linux:/Linux|X11/.test(Gu.platform),ie:AK,ie_version:n5t?G2e.documentMode||6:W2e?+W2e[1]:H2e?+H2e[1]:0,gecko:i5t,gecko_version:i5t?+(/Firefox\/(\d+)/.exec(Gu.userAgent)||[0,0])[1]:0,chrome:!!Y2e,chrome_version:Y2e?+Y2e[1]:0,ios:o5t,android:/Android\b/.test(Gu.userAgent),webkit:a5t,webkit_version:a5t?+(/\bAppleWebKit\/(\d+)/.exec(Gu.userAgent)||[0,0])[1]:0,safari:q2e,safari_version:q2e?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Gu.userAgent)||[0,0])[1]:0,tabSize:G2e.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function j2e(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 SK=Object.create(null);function X2e(t,e,r){if(t==e)return!0;t||(t=SK),e||(e=SK);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 Bvn(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 s5t(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 $vn(t){let e=Object.create(null);for(let r=0;r0?3e8:-4e8:r>0?1e8:-1e8,new oC(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:o}=l5t(e,r);n=(a?r?-3e8:-1:5e8)-1,i=(o?r?2e8:1:-6e8)+1}return new oC(e,n,i,r,e.widget||null,!0)}static line(e){return new S$(e)}static set(e,r=!1){return ti.of(e,r)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ar.none=ti.empty;class A$ extends Ar{constructor(e){let{start:r,end:n}=l5t(e);super(r?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?j2e(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||SK}eq(e){return this==e||e instanceof A$&&this.tagName==e.tagName&&X2e(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)}}A$.prototype.point=!1;class S$ extends Ar{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof S$&&this.spec.class==e.spec.class&&X2e(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)}}S$.prototype.mapMode=xc.TrackBefore,S$.prototype.point=!0;class oC extends Ar{constructor(e,r,n,i,a,o){super(r,n,a,e),this.block=i,this.isReplace=o,this.mapMode=i?r<=0?xc.TrackBefore:xc.TrackAfter:xc.TrackDel}get type(){return this.startSide!=this.endSide?Ac.WidgetRange:this.startSide<=0?Ac.WidgetBefore:Ac.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof oC&&Fvn(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)}}oC.prototype.point=!0;function l5t(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 Fvn(t,e){return t==e||!!(t&&e&&t.compare(e))}function zR(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 T$ extends k2{constructor(e,r,n){super(),this.tagName=e,this.attributes=r,this.rank=n}eq(e){return e==this||e instanceof T$&&this.tagName==e.tagName&&X2e(this.attributes,e.attributes)}static create(e){return new T$(e.tagName,e.attributes||SK,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,r=!1){return ti.of(e,r)}}T$.prototype.startSide=T$.prototype.endSide=-1;function C$(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function K2e(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function O$(t,e){if(!e.anchorNode)return!1;try{return K2e(t,e.anchorNode)}catch{return!1}}function k$(t){return t.nodeType==3?R$(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function E$(t,e,r,n){return r?c5t(t,e,r,n,-1)||c5t(t,e,r,n,1):!1}function _2(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function TK(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function c5t(t,e,r,n,i){for(;;){if(t==r&&e==n)return!0;if(e==(i<0?0:f1(t))){if(t.nodeName=="DIV")return!1;let a=t.parentNode;if(!a||a.nodeType!=1)return!1;e=_2(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?f1(t):0}else return!1}}function f1(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function _$(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 zvn(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 u5t(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 Uvn(t,e,r,n,i,a,o,s){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=zvn(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}=u5t(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+o)):e.bottom>f.bottom-o&&(y=e.bottom-f.bottom+o,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 h5t(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 Vvn{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?f1(r):0),n,Math.min(e.focusOffset,n?f1(n):0))}set(e,r,n,i){this.anchorNode=e,this.anchorOffset=r,this.focusNode=n,this.focusOffset=i}}let sC=null;br.safari&&br.safari_version>=26&&(sC=!1);function d5t(t){if(t.setActive)return t.setActive();if(sC)return t.focus(sC);let e=[];for(let r=t;r&&(e.push(r,r.scrollTop,r.scrollLeft),r!=r.ownerDocument);r=r.parentNode);if(t.focus(sC==null?{get preventScroll(){return sC={preventScroll:!0},!0}}:void 0),!sC){sC=!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 g5t(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=f1(r)}else if(r.parentNode&&!TK(r))n=_2(r),r=r.parentNode;else return null}}function m5t(t,e){for(let r=t,n=e;;){if(r.nodeType==3&&n=r){if(s.level==n)return o;(a<0||(i!=0?i<0?s.fromr:e[a].level>s.level))&&(a=o)}}if(a<0)throw new RangeError("Index out of range");return a}}function b5t(t,e){if(t.length!=e.length)return!1;for(let r=0;r=0;m-=3)if(_0[m+1]==-p){let v=_0[m+2],y=v&2?i:v&4?v&1?a:i:0;y&&(Da[d]=Da[_0[m]]=y),s=m;break}}else{if(_0.length==189)break;_0[s++]=d,_0[s++]=f,_0[s++]=l}else if((g=Da[d])==2||g==1){let m=g==i;l=m?0:1;for(let v=s-3;v>=0;v-=3){let y=_0[v+2];if(y&2)break;if(m)_0[v+2]|=2;else{if(y&4)break;_0[v+2]|=4}}}}}function Xvn(t,e,r,n){for(let i=0,a=n;i<=r.length;i++){let o=i?r[i-1].to:t,s=il;)g==v&&(g=r[--m].from,v=m?r[m-1].to:t),Da[--g]=p;l=h}else a=u,l++}}}function ewe(t,e,r,n,i,a,o){let s=n%2?2:1;if(n%2==i%2)for(let l=e,u=0;ll&&o.push(new R0(l,m.from,p));let v=m.direction==lC!=!(p%2);twe(t,v?n+1:n,i,m.inner,m.from,m.to,o),l=m.to}g=m.to}else{if(g==r||(h?Da[g]!=s:Da[g]==s))break;g++}f?ewe(t,l,g,n+1,i,f,o):le;){let h=!0,d=!1;if(!u||l>a[u-1].to){let m=Da[l-1];m!=s&&(h=!1,d=m==16)}let f=!h&&s==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(Da[v-1]==s)break e;break}}if(f)f.push(m);else{m.toDa.length;)Da[Da.length]=256;let n=[],i=e==lC?0:1;return twe(t,i,i,r,0,t.length,n),n}function x5t(t){return[new R0(0,t,0)]}let w5t="";function Zvn(t,e,r,n,i){var a;let o=n.head-t.from,s=R0.find(e,o,(a=n.bidiLevel)!==null&&a!==void 0?a:-1,n.assoc),l=e[s],u=l.side(i,r);if(o==u){let f=s+=i?1:-1;if(f<0||f>=e.length)return null;l=e[s=f],o=l.side(!i,r),u=l.side(i,r)}let h=Ul(t.text,o,l.forward(i,r));(hl.to)&&(h=u),w5t=t.text.slice(Math.min(o,h),Math.max(o,h));let d=s==(i?e.length-1:0)?null:e[s+(i?1:-1)];return d&&h==u&&d.level+(i?0:1)t.some(e=>e)}),_5t=vr.define({combine:t=>t.some(e=>e)}),R5t=vr.define();class VR{constructor(e,r,n,i,a,o=!1){this.range=e,this.y=r,this.x=n,this.yMargin=i,this.xMargin=a,this.isSnapshot=o}map(e){return e.empty?this:new VR(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 VR(xt.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const CK=on.define({map:(t,e)=>t.map(e)}),D5t=on.define();function qh(t,e,r){let n=t.facet(C5t);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 p1=vr.define({combine:t=>t.length?t[0]:!0});let eyn=0;const QR=vr.define({combine(t){return t.filter((e,r)=>{for(let n=0;n{let l=[];return o&&l.push(OK.of(u=>{let h=u.plugin(s);return h?o(h):Ar.none})),a&&l.push(a(s)),l})}static fromClass(e,r){return Ro.define((n,i)=>new e(n,i),r)}}class awe{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(qh(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){qh(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){qh(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const L5t=vr.define(),owe=vr.define(),OK=vr.define(),M5t=vr.define(),swe=vr.define(),D$=vr.define(),I5t=vr.define();function P5t(t,e){let r=t.state.facet(I5t);if(!r.length)return r;let n=r.map(a=>a instanceof Function?a(t):a),i=[];return ti.spans(n,e.from,e.to,{point(){},span(a,o,s,l){let u=a-e.from,h=o-e.from,d=i;for(let f=s.length-1;f>=0;f--,l--){let p=s[f].spec.bidiIsolate,g;if(p==null&&(p=Jvn(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 N5t=vr.define();function lwe(t){let e=0,r=0,n=0,i=0;for(let a of t.state.facet(N5t)){let o=a(t);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(r=Math.max(r,o.right)),o.top!=null&&(n=Math.max(n,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:e,right:r,top:n,bottom:i}}const L$=vr.define();class xp{constructor(e,r,n,i){this.fromA=e,this.toA=r,this.fromB=n,this.toB=i}join(e){return new xp(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 xp(a,o,s,l))),this.changedRanges=i}static create(e,r,n){return new kK(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 tyn=[];class Zo{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 tyn}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&&Bvn(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=_2(this.dom),i=this.length?e>0:r>0;return new Mg(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 _K)return e;return null}static get(e){return e.cmTile}}class EK extends Zo{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,o=0;for(let s of this.children){if(s.sync(e),o+=s.length+s.breakAfter,i=n?n.nextSibling:r.firstChild,a&&i!=s.dom&&(a.written=!0),s.dom.parentNode==r)for(;i&&i!=s.dom;)i=B5t(i);else r.insertBefore(s.dom,i);n=s.dom}for(i=n?n.nextSibling:r.firstChild,a&&i&&(a.written=!0);i;)i=B5t(i);this.length=o}}function B5t(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class _K extends EK{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=Zo.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 o=n.children[i++];if(o instanceof g1)r.push(i),n=o,i=0;else{let s=a+o.length,l=e(o,a);if(l!==void 0)return l;a=s+o.breakAfter}}}resolveBlock(e,r){let n,i=-1,a,o=-1;if(this.blockTiles((s,l)=>{let u=l+s.length;if(e>=l&&e<=u){if(s.isWidget()&&r>=-1&&r<=1){if(s.flags&32)return!0;s.flags&16&&(n=void 0)}(le||e==l&&(r>1?s.length:s.covers(-1)))&&(!a||!s.isWidget()&&a.isWidget())&&(a=s,o=e-l)}}),!n&&!a)throw new Error("No tile at position "+e);return n&&r<0||!a?{tile:n,offset:i}:{tile:a,offset:o}}}class g1 extends EK{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 g1(r||document.createElement(e.tagName),e);return r||(n.flags|=4),n}}class GR extends EK{constructor(e,r){super(e),this.attrs=r}isLine(){return!0}static start(e,r,n){let i=new GR(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,o=null,s=-1;function l(h,d){for(let f=0,p=0;f=d&&(g.isComposite()?l(g,d-p):(!o||o.isHidden&&(r>0&&!(o.flags&32)||n&&nyn(o,g)))&&(m>d||g.flags&32)?(o=g,s=d-p):(pi&&(e=i);let a=e,o=e,s=0;e==0&&r<0||e==i&&r>=0?br.chrome||br.gecko||(e?(a--,s=1):o=0)?0:l.length-1];return br.safari&&!s&&u.width==0&&(u=Array.prototype.find.call(l,h=>h.width)||u),n==null?u:_$(u,(s?s>0:r<0)==n)}static of(e,r){let n=new cC(r||document.createTextNode(e),e);return r||(n.flags|=2),n}}class uC extends Zo{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 _$(this.dom.getBoundingClientRect(),this.length?e==0:r<=0);{let a=this.dom.getClientRects(),o=null;if(!a.length)return null;let s=this.flags&16?!0:this.flags&32?!1:e>0;for(let l=s?a.length-1:0;o=a[l],!(e>0?l==0:l==a.length-1||o.top0==n)}}class iyn{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,r,n){let{tile:i,index:a,beforeBreak:o,parents:s}=this;for(;e||r>0;)if(i.isComposite())if(o){if(!e)break;n&&n.break(),e--,o=!1}else if(a==i.children.length){if(!e&&!s.length)break;n&&n.leave(i),o=!!i.breakAfter,{tile:i,index:a}=s.pop(),a++}else{let l=i.children[a],u=l.breakAfter;(r>0?l.length<=e:l.length=0;s--){let l=r.marks[s],u=i.lastChild;if(u instanceof jh&&u.mark.eq(l.mark))u.dom!=l.dom&&u.setDOM(cwe(l.dom)),i=u;else{if(this.cache.reused.get(l)){let d=Zo.get(l.dom);d&&d.setDOM(cwe(l.dom))}let h=jh.of(l.mark,l.dom);i.append(h),i=h}this.cache.reused.set(l,2)}let a=Zo.get(e.text);a&&this.cache.reused.set(a,2);let o=new cC(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,i.append(o)}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=F5t);let i=GR.start(e,r||((n=this.cache.find(GR))===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 o=e[a],s;if(r>0&&(s=i.lastChild)&&s instanceof jh&&s.mark.eq(o))i=s,r--;else{let l=jh.of(o,(n=this.cache.find(jh,u=>u.mark.eq(o)))===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||!$5t(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(br.ios&&$5t(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(uwe,0,32)||new uC(uwe.toDOM(),0,uwe,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 ayn(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.fromo.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(RK,void 0,1);return n&&(n.flags=r),n||new RK(r)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class syn{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:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=i;let s=this.textOff=Math.min(e,i.length);return a?null:i.slice(0,s)}let r=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,r);return this.textOff=r,n}}const DK=[uC,GR,cC,jh,RK,g1,_K];for(let t=0;t[]),this.index=DK.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],o=this.index[i];for(let s=0;s{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,r){let n=r&&this.getCompositionContext(r.text);for(let i=0,a=0,o=0;;){let s=oi){let u=l-i;this.preserve(u,!o,!s),i=l,a+=u}if(!s)break;r&&s.fromA<=r.range.fromA&&s.toA>=r.range.toA?(this.forward(s.fromA,r.range.fromA,r.range.fromA{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(l-s);else{let u=l>0||s{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof jh&&i.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?i.length&&(i.length=a=0):o instanceof jh&&(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,o=ti.spans(this.decorations,e,r,{point:(s,l,u,h,d,f)=>{if(u instanceof oC){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(s).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-s);else{let p=u.widget||(u.block?HR.block:HR.inline),g=uyn(u),m=this.cache.findWidget(p,l-s,g)||uC.of(p,this.view,l-s,g);u.block?(u.startSide>0&&i.addLineStartIfNotCovered(n),i.addBlockWidget(m)):(i.ensureLine(n),i.addInlineWidget(m,h,d))}n=null}else n=hyn(n,u);l>s&&this.text.skip(l-s)},span:(s,l,u,h)=>{for(let d=s;d-1&&(this.openWidget=o>a),this.openWidget||i.addLineStartIfNotCovered(n),this.openMarks=o}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=Zo.get(i);if(i==this.view.contentDOM)break;a instanceof jh?r.push(a):a!=null&&a.isLine()?n=a:a instanceof g1||(i.nodeName=="DIV"&&!n&&i!=this.view.contentDOM?n=new GR(i,F5t):n||r.push(jh.of(new A$({tagName:i.nodeName.toLowerCase(),attributes:$vn(i)}),i)))}return{line:n,marks:r}}}function $5t(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 uyn(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 F5t={class:"cm-line"};function hyn(t,e){let r=e.spec.attributes,n=e.spec.class;return!r&&!n||(t||(t={class:"cm-line"}),r&&j2e(r,t),n&&(t.class+=" "+n)),t}function dyn(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 jh&&e.push(n.mark)}return e}function cwe(t){let e=Zo.get(t);return e&&e.setDOM(t.cloneNode()),t}class HR extends Hu{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}}HR.inline=new HR("span"),HR.block=new HR("div");const uwe=new class extends Hu{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class z5t{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 _K(e,e.contentDOM),this.updateInner([new xp(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:!wyn(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let a=i>-1?pyn(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:h,to:d}=this.hasComposition;n=new xp(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 o=this.decorations,s=this.blockWrappers;this.updateDeco();let l=vyn(o,this.decorations,e.changes);l.length&&(n=xp.extendWithRanges(n,l));let u=byn(s,this.blockWrappers,e.changes);return u.length&&(n=xp.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 o=this.tile,s=new cyn(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);r&&Zo.get(r.text)&&s.cache.reused.set(Zo.get(r.text),2),this.tile=s.run(e,r),hwe(o,s.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)&&O$(n,this.view.observer.selectionRange)&&!(i&&n.contains(i));if(!(a||r||o))return;let s=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&&fyn(u)){let f=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(f,u.node.childNodes[u.offset]||null)),u=h=new Mg(f,0),s=!0}let d=this.view.observer.selectionRange;(s||!d.focusNode||(!E$(u.node,u.offset,d.anchorNode,d.anchorOffset)||!E$(h.node,h.offset,d.focusNode,d.focusOffset))&&!this.suppressWidgetCursorChange(d,l))&&(this.view.observer.ignore(()=>{br.android&&br.chrome&&n.contains(d.focusNode)&&xyn(d.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let f=C$(this.view.root);if(f)if(l.empty){if(br.gecko){let p=gyn(u.node,u.offset);if(p&&p!=3){let g=(p==1?g5t:m5t)(u.node,u.offset);g&&(u=new Mg(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)}o&&this.view.root.activeElement==n&&(n.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(u,h)),this.impreciseAnchor=u.precise?null:new Mg(d.anchorNode,d.anchorOffset),this.impreciseHead=h.precise?null:new Mg(d.focusNode,d.focusOffset)}suppressWidgetCursorChange(e,r){return this.hasComposition&&r.empty&&E$(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=C$(e.root),{anchorNode:i,anchorOffset:a}=e.observer.selectionRange;if(!n||!r.empty||!r.assoc||!n.modify)return;let o=this.lineAt(r.head,r.assoc);if(!o)return;let s=o.posAtStart;if(r.head==s||r.head==s+o.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 o=f1(e)==0?0:r==0?-1:1;for(;;){let s=e.parentNode;if(s==n.dom)break;o==0&&s.firstChild!=s.lastChild&&(e==s.firstChild?o=-1:o=1),e=s}o<0?a=e:a=e.nextSibling}if(a==n.dom.firstChild)return i;for(;a&&!Zo.get(a);)a=a.nextSibling;if(!a)return i+n.length;for(let o=0,s=i;;o++){let l=n.children[o];if(l.dom==a)return s;s+=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,o,s=-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&&!o&&(o=u,s=e-h,l=h>e),h>e&&o)return!0}}),!n&&!o?this.domAtPos(e,r):(a&&o?n=null:l&&n&&(o=null),n&&r<0||!o?n.domIn(i,r):o.domIn(s,r))}coordsAt(e,r,n){let{tile:i,offset:a}=this.tile.resolveBlock(e,r);return i.isWidget()?i.widget instanceof dwe?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,o){if(a.isComposite())for(let s of a.children){if(s.length>=o){let l=i(s,o);if(l)return l}if(o-=s.length,o<0)break}else if(a.isText()&&oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,s=-1,l=this.view.textDirection==Ra.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 g1)v>n&&h(m,f,y);else if(f>=n&&(u>0&&r.push(-u),r.push(b+u),u=0,o)){let x=m.dom.lastChild,w=x?k$(x):[];if(w.length){let A=w[w.length-1],S=l?A.right-y.left:y.right-A.left;S>s&&(s=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"?Ra.RTL:Ra.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let s=0,l;for(let u of o.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let h=k$(u.dom);if(h.length!=1)return;s+=h[0].width,l=h[0].height}if(s)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:s/o.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 o=k$(r.firstChild)[0];n=r.getBoundingClientRect().height,i=o&&o.width?o.width/27:7,a=o&&o.height?o.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],o=a?a.from-1:this.view.state.doc.length;if(o>n){let s=(r.lineBlockAt(o).bottom-r.lineBlockAt(n).top)/this.view.scaleY;e.push(Ar.replace({widget:new dwe(s),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!a)break;n=a.to+1}return Ar.set(e)}updateDeco(){let e=1,r=this.view.state.facet(OK).map(a=>(this.dynamicDecorationMap[e++]=typeof a=="function")?a(this.view):a),n=!1,i=this.view.state.facet(swe).map((a,o)=>{let s=typeof a=="function";return s&&(n=!0),s?a(this.view):a});for(i.length&&(this.dynamicDecorationMap[e++]=n,r.push(ti.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(R5t))try{if(u(this.view,e.range,e))return!0}catch(h){qh(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=lwe(this.view),o={left:n.left-a.left,top:n.top-a.top,right:n.right+a.right,bottom:n.bottom+a.bottom},{offsetWidth:s,offsetHeight:l}=this.view.scrollDOM;if(Uvn(this.view.scrollDOM,o,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(){hwe(this.tile)}}function hwe(t,e){let r=e==null?void 0:e.get(t);if(r!=1){r==null&&t.destroy();for(let n of t.children)hwe(n,e)}}function fyn(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 U5t(t,e){let r=t.observer.selectionRange;if(!r.focusNode)return null;let n=g5t(r.focusNode,r.focusOffset),i=m5t(r.focusNode,r.focusOffset),a=n||i;if(i&&n&&i.node!=n.node){let s=Zo.get(i.node);if(!s||s.isText()&&s.text!=i.node.nodeValue)a=i;else if(t.docView.lastCompositionAfterCursor){let l=Zo.get(n.node);!l||l.isText()&&l.text!=n.node.nodeValue||(a=i)}}if(t.docView.lastCompositionAfterCursor=a!=n,!a)return null;let o=e-a.offset;return{from:o,to:o+a.node.nodeValue.length,node:a.node}}function pyn(t,e,r){let n=U5t(t,r);if(!n)return null;let{node:i,from:a,to:o}=n,s=i.nodeValue;if(/[\n\r]/.test(s)||t.state.doc.sliceString(n.from,n.to)!=s)return null;let l=e.invertedDesc;return{range:new xp(l.mapPos(a),l.mapPos(o),a,o),text:i}}function gyn(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e{ne.from&&(r=!0)}),r}class dwe extends Hu{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 Ayn(t,e,r=1){let n=t.charCategorizer(e),i=t.doc.lineAt(e),a=e-i.from;if(i.length==0)return xt.cursor(e);a==0?r=1:a==i.length&&(r=-1);let o=a,s=a;r<0?o=Ul(i.text,a,!1):s=Ul(i.text,a);let l=n(i.text.slice(o,s));for(;o>0;){let u=Ul(i.text,o,!1);if(n(i.text.slice(u,o))!=l)break;o=u}for(;st.defaultLineHeight*1.5){let s=t.viewState.heightOracle.textHeight,l=Math.floor((i-r.top-(t.defaultLineHeight-s)*.5)/s);a+=l*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(r.from,r.to);return r.from+z2e(o,a,t.state.tabSize)}function fwe(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==Ac.Text&&(i.type!=a.type||(r<0?a.frome)))&&(i=a)}}return i||n}return n}function Tyn(t,e,r,n){let i=fwe(t,e.head,e.assoc||-1),a=!n||i.type!=Ac.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(a){let o=t.dom.getBoundingClientRect(),s=t.textDirectionAt(i.from),l=t.posAtCoords({x:r==(s==Ra.LTR)?o.right-1:o.left+1,y:(a.top+a.bottom)/2});if(l!=null)return xt.cursor(l,r?-1:1)}return xt.cursor(r?i.to:i.from,r?-1:1)}function V5t(t,e,r,n){let i=t.state.doc.lineAt(e.head),a=t.bidiSpans(i),o=t.textDirectionAt(i.from);for(let s=e,l=null;;){let u=Zvn(i,a,o,s,r),h=w5t;if(!u){if(i.number==(r?t.state.doc.lines:1))return s;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 s}else{if(!n)return u;l=n(h)}s=u}}function Cyn(t,e,r){let n=t.state.charCategorizer(e),i=n(r);return a=>{let o=n(a);return i==Ao.Space&&(i=o),i==o}}function Oyn(t,e,r,n){let i=e.head,a=r?1:-1;if(i==(r?t.state.doc.length:0))return xt.cursor(i,e.assoc);let o=e.goalColumn,s,l=t.contentDOM.getBoundingClientRect(),u=t.coordsAtPos(i,e.assoc||((e.empty?r:e.head==e.from)?1:-1)),h=t.documentTop;if(u)o==null&&(o=u.left-l.left),s=a<0?u.top:u.bottom;else{let g=t.viewState.lineBlockAt(i);o==null&&(o=Math.min(l.right-l.left,t.defaultCharacterWidth*(i-g.from))),s=(a<0?g.top:g.bottom)+h}let d=l.left+o,f=t.viewState.heightOracle.textHeight>>1,p=n??f;for(let g=0;;g+=f){let m=s+(p+g)*a,v=gwe(t,{x:d,y:m},!1,a);if(r?m>l.bottom:ms:b{if(e>a&&ei(t)),r.from,e.head>r.from?-1:1);return n==r.from?r:xt.cursor(n,nt.viewState.docHeight)return new D0(t.state.doc.length,-1);if(u=t.elementAtHeight(l),n==null)break;if(u.type==Ac.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==Ac.Text){let d=Syn(t,i,u,o,s);return new D0(d,d==u.from?1:-1)}}if(u.type!=Ac.Text)return l<(u.top+u.bottom)/2?new D0(u.from,1):new D0(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 kyn(t,o,s,t.textDirectionAt(u.from)).scanTile(h,u.from)}class kyn{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(o.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=(s?this.dirAt(e[h],1):this.baseDir)==Ra.LTR;return{i:h,after:this.x>(f.left+f.right)/2==p}}scanText(e,r){let n=[];for(let a=0;a{let o=n[a]-r,s=n[a+1]-r;return R$(e.dom,o,s).getClientRects()});return i.after?new D0(n[i.i+1],-1):new D0(n[i.i],1)}scanTile(e,r){if(!e.length)return new D0(r,1);if(e.children.length==1){let s=e.children[0];if(s.isText())return this.scanText(s,r);if(s.isComposite())return this.scanTile(s,r)}let n=[r];for(let s=0,l=r;s{let l=e.children[s];return l.flags&48?null:(l.dom.nodeType==1?l.dom:R$(l.dom,0,l.length)).getClientRects()}),a=e.children[i.i],o=n[i.i];return a.isText()?this.scanText(a,o):a.isComposite()?this.scanTile(a,o):i.after?new D0(n[i.i+1],-1):new D0(o,1)}}const WR="￿";class Eyn{constructor(e,r){this.points=e,this.view=r,this.text="",this.lineSeparator=r.state.facet(ei.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=WR}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 o=Zo.get(i),s=i.nextSibling;if(s==r){o!=null&&o.breakAfter&&!s&&n!=this.view.contentDOM&&this.lineBreak();break}let l=Zo.get(s);(o&&l?o.breakAfter:(o?o.breakAfter:TK(i))||TK(s)&&(i.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>a)&&!Ryn(s,r)&&this.lineBreak(),i=s}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,o=1,s;if(this.lineSeparator?(a=r.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(s=i.exec(r))&&(a=s.index,o=s[0].length),this.append(r.slice(n,a<0?r.length:a)),a<0)break;if(this.lineBreak(),o>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=o-1);n=a+o}}readNode(e){let r=Zo.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+(_yn(e,n.node,n.offset)?r:0))}}function _yn(t,e,r){for(;;){if(!e||r-1;let{impreciseHead:a,impreciseAnchor:o}=e.docView,s=e.state.selection;if(e.state.readOnly&&r>-1)this.newSel=null;else if(r>-1&&(this.bounds=H5t(e.docView.tile,r,n,0))){let l=a||o?[]:Myn(e),u=new Eyn(l,e);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=Iyn(l,this.bounds.from)}else{let l=e.observer.selectionRange,u=a&&a.node==l.focusNode&&a.offset==l.focusOffset||!K2e(e.contentDOM,l.focusNode)?s.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),h=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!K2e(e.contentDOM,l.anchorNode)?s.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),d=e.viewport;if((br.ios||br.chrome)&&u!=h&&Math.min(u,h)<=s.main.from&&Math.max(u,h)>=s.main.to&&(d.from>0||d.to-1&&s.ranges.length>1)this.newSel=s.replaceRange(xt.range(h,u));else if(e.lineWrapping&&h==u&&!(s.main.empty&&s.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=xt.create([xt.cursor(u,p)])}else this.newSel=xt.single(h,u)}}}function H5t(t,e,r,n){if(t.isComposite()){let i=-1,a=-1,o=-1,s=-1;for(let l=0,u=n,h=n;lr)return H5t(d,e,r,u);if(f>=e&&i==-1&&(i=l,a=u),u>r&&d.dom.parentNode==t.dom){o=l,s=h;break}h=f,u=f+d.breakAfter}return{from:a,to:s<0?n+t.length:s,startDOM:(i?t.children[i-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:o=0?t.children[o].dom:null}}else return t.isText()?{from:n,to:n+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function W5t(t,e){let r,{newSel:n}=e,{state:i}=t,a=i.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:s,to:l}=e.bounds,u=a.from,h=null;(o===8||br.android&&e.text.length=s&&a.to<=l&&(e.typeOver||d!=e.text)&&d.slice(0,a.from-s)==e.text.slice(0,a.from-s)&&d.slice(a.to-s)==e.text.slice(f=e.text.length-(d.length-(a.to-s)))?r={from:a.from,to:a.to,insert:wi.of(e.text.slice(a.from-s,f).split(WR))}:(p=Y5t(d,e.text,u-s,h))&&(br.chrome&&o==13&&p.toB==p.from+2&&e.text.slice(p.from,p.toB)==WR+WR&&p.toB--,r={from:s+p.from,to:s+p.toA,insert:wi.of(e.text.slice(p.from,p.toB).split(WR))})}else n&&(!t.hasFocus&&i.facet(p1)||LK(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=xt.single(n.main.anchor-1,n.main.head-1)),r={from:r.from,to:r.to,insert:wi.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=xt.single(n.main.anchor-1,n.main.head-1)),r={from:a.from,to:a.to,insert:wi.of([" "])}),r)return mwe(t,r,n,o);if(n&&!LK(n,a)){let s=!1,l="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(s=!0),l=t.inputState.lastSelectionOrigin,l=="select.pointer"&&(n=Q5t(i.facet(D$).map(u=>u(t)),n))),t.dispatch({selection:n,scrollIntoView:s,userEvent:l}),!0}else return!1}function mwe(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&&UR(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||n==8&&e.insert.lengthi.head)&&UR(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&UR(t.contentDOM,"Delete",46)))return!0;let a=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,s=()=>o||(o=Lyn(t,e,r));return t.state.facet(O5t).some(l=>l(t,e.from,e.to,a,s))||t.dispatch(s()),!0}function Lyn(t,e,r){let n,i=t.state,a=i.selection.main,o=-1;if(e.from==e.to&&e.froma.to){let l=e.fromd(t)),u,l);e.from==h&&(o=h)}if(o>-1)n={changes:e,selection:xt.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&&U5t(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?xt.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 s="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,s+=".compose",t.inputState.compositionFirstChange&&(s+=".start",t.inputState.compositionFirstChange=!1)),i.update(n,{userEvent:s,scrollIntoView:!0})}function Y5t(t,e,r,n){let i=Math.min(t.length,e.length),a=0;for(;a0&&s>0&&t.charCodeAt(o-1)==e.charCodeAt(s-1);)o--,s--;if(n=="end"){let l=Math.max(0,a-Math.min(o,s));r-=o+l-a}if(o=o?a-r:0;a-=l,s=a+(s-o),o=a}else if(s=s?a-r:0;a-=l,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function Myn(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 G5t(r,n)),(i!=r||a!=n)&&e.push(new G5t(i,a))),e}function Iyn(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?xt.single(r+e,n+e):null}function LK(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class Pyn{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&&Kyn(e.contentDOM.ownerDocument)}handleEvent(e){!Gyn(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=Byn(e),n=this.handlers,i=this.view.contentDOM;for(let a in r)if(a!="scroll"){let o=!r[a].handlers.length,s=n[a];s&&o!=!s.handlers.length&&(i.removeEventListener(a,this.handleEvent),s=null),s||i.addEventListener(a,this.handleEvent,{passive:o})}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&&X5t.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&&(j5t.some(r=>r.keyCode==e.keyCode)&&!e.ctrlKey||$yn.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)&&Nyn(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 Nyn(t){return t.visualViewport?t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85:!1}function q5t(t,e){return(r,n)=>{try{return e.call(t,n,r)}catch(i){qh(r.state,i)}}}function Byn(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,o=i&&i.plugin.domEventObservers;if(a)for(let s in a){let l=a[s];l&&r(s).handlers.push(q5t(n.value,l))}if(o)for(let s in o){let l=o[s];l&&r(s).observers.push(q5t(n.value,l))}}for(let n in Ig)r(n).handlers.push(Ig[n]);for(let n in Wu)r(n).observers.push(Wu[n]);return e}const j5t=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],$yn="dthko",X5t=[16,17,18,20,91,92,224,225],MK=6;function IK(t){return Math.max(0,t)*.7+8}function Fyn(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class zyn{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=h5t(e.contentDOM),this.atoms=e.state.facet(D$).map(o=>o(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(ei.allowMultipleSelections)&&Uyn(e,r),this.dragging=Qyn(e,r)&&nRt(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&&Fyn(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let r=0,n=0,i=0,a=0,o=this.view.win.innerWidth,s=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:a,bottom:s}=this.scrollParents.y.getBoundingClientRect());let l=lwe(this.view);e.clientX-l.left<=i+MK?r=-IK(i-e.clientX):e.clientX+l.right>=o-MK&&(r=IK(e.clientX-o)),e.clientY-l.top<=a+MK?n=-IK(a-e.clientY):e.clientY+l.bottom>=s-MK&&(n=IK(e.clientY-s)),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=Q5t(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 Uyn(t,e){let r=t.state.facet(A5t);return r.length?r[0](e):br.mac?e.metaKey:e.ctrlKey}function Vyn(t,e){let r=t.state.facet(S5t);return r.length?r[0](e):br.mac?!e.altKey:!e.ctrlKey}function Qyn(t,e){let{main:r}=t.state.selection;if(r.empty)return!1;let n=C$(t.root);if(!n||n.rangeCount==0)return!0;let i=n.getRangeAt(0).getClientRects();for(let a=0;a=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Gyn(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=Zo.get(r))&&n.isWidget()&&!n.isHidden&&n.widget.ignoreEvent(e))return!1;return!0}const Ig=Object.create(null),Wu=Object.create(null),K5t=br.ie&&br.ie_version<15||br.ios&&br.webkit_version<604;function Hyn(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(),Z5t(t,r.value)},50)}function PK(t,e,r){for(let n of t.facet(e))r=n(r,t);return r}function Z5t(t,e){e=PK(t.state,nwe,e);let{state:r}=t,n,i=1,a=r.toText(e),o=a.lines==r.selection.ranges.length;if(vwe!=null&&r.selection.ranges.every(l=>l.empty)&&vwe==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((o?a.line(i++).text:e)+r.lineBreak);return{changes:{from:h.from,insert:d},range:xt.cursor(u.from+d.length)}})}else o?n=r.changeByRange(l=>{let u=a.line(i++);return{changes:{from:l.from,to:l.to,insert:u.text},range:xt.cursor(l.from+u.length)}}):n=r.replaceSelection(a);t.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Wu.scroll=t=>{let e=t.inputState;e.lastScrollTop=t.scrollDOM.scrollTop,e.lastScrollLeft=t.scrollDOM.scrollLeft,br.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())},Wu.wheel=Wu.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()},Ig.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1),Wu.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")},Wu.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},Wu.touchend=(t,e)=>{t.inputState.touchActive=!1},Ig.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(T5t))if(r=n(t,e),r)break;if(!r&&e.button==0&&(r=Yyn(t,e)),r){let n=!t.hasFocus;t.inputState.startMouseSelection(new zyn(t,e,r,n)),n&&t.observer.ignore(()=>{d5t(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 J5t(t,e,r,n){if(n==1)return xt.cursor(e,r);if(n==2)return Ayn(t.state,e,r);{let i=t.docView.lineAt(e,r),a=t.state.doc.lineAt(i?i.posAtEnd:e),o=i?i.posAtStart:a.from,s=i?i.posAtEnd:a.to;return sDate.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(tRt+1)%3:1}function Yyn(t,e){let r=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),n=nRt(e),i=t.state.selection;return{update(a){a.docChanged&&(r.pos=a.changes.mapPos(r.pos),i=i.map(a.changes))},get(a,o,s){let l=t.posAndSideAtCoords({x:a.clientX,y:a.clientY},!1),u,h=J5t(t,l.pos,l.assoc,n);if(r.pos!=l.pos&&!o){let d=J5t(t,r.pos,r.assoc,n),f=Math.min(d.from,h.from),p=Math.max(d.to,h.to);h=f1&&(u=qyn(i,l.pos))?u:s?i.addRange(h):xt.create([h])}}}function qyn(t,e){for(let r=0;r=e)return xt.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}Ig.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,o=a+i.length;(a>=r.to||o<=r.from)&&(r=xt.undirectionalRange(a,o))}}let{inputState:n}=t;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=r,e.dataTransfer&&(e.dataTransfer.setData("Text",PK(t.state,iwe,t.state.sliceDoc(r.from,r.to))),e.dataTransfer.effectAllowed="copyMove"),!1},Ig.dragend=t=>(t.inputState.draggedContent=null,!1);function iRt(t,e,r,n){if(r=PK(t.state,nwe,r),!r)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:a}=t.inputState,o=n&&a&&Vyn(t,e)?{from:a.from,to:a.to}:null,s={from:i,insert:r},l=t.state.changes(o?[o,s]:s);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Ig.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&&iRt(t,e,n.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(s.result)||(n[o]=s.result),a()},s.readAsText(r[o])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return iRt(t,e,n,!0),!0}return!1},Ig.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let r=K5t?null:e.clipboardData;return r?(Z5t(t,r.getData("text/plain")||r.getData("text/uri-list")),!0):(Hyn(t),!1)};function jyn(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 Xyn(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 o=t.doc.lineAt(a);o.number>i&&(e.push(o.text),r.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),i=o.number}n=!0}return{text:PK(t,iwe,e.join(t.lineBreak)),ranges:r,linewise:n}}let vwe=null;Ig.copy=Ig.cut=(t,e)=>{if(!O$(t.contentDOM,t.observer.selectionRange))return!1;let{text:r,ranges:n,linewise:i}=Xyn(t.state);if(!r&&!i)return!1;vwe=i?r:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let a=K5t?null:e.clipboardData;return a?(a.clearData(),a.setData("text/plain",r),!0):(jyn(t,r),!1)};const aRt=k0.define();function oRt(t,e){let r=[];for(let n of t.facet(k5t)){let i=n(t,e);i&&r.push(i)}return r.length?t.update({effects:r,annotations:aRt.of(!0)}):null}function sRt(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let r=oRt(t.state,e);r?t.dispatch(r):t.update([])}},10)}Wu.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),sRt(t)},Wu.blur=t=>{t.observer.clearSelectionRange(),sRt(t)},Wu.compositionstart=Wu.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))},Wu.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))},Wu.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},Ig.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"),o=e.getTargetRanges();if(a&&o.length){let s=o[0],l=t.posAtDOM(s.startContainer,s.startOffset),u=t.posAtDOM(s.endContainer,s.endOffset);return mwe(t,{from:l,to:u,insert:t.state.toText(a)},null),!0}}let i;if(br.chrome&&br.android&&(i=j5t.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 o;(((o=window.visualViewport)===null||o===void 0?void 0:o.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(()=>Wu.compositionend(t,e),20),!1};const lRt=new Set;function Kyn(t){lRt.has(t)||(lRt.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const cRt=["pre-wrap","normal","pre-line","break-spaces"];let YR=!1;function uRt(){YR=!1}class Zyn{constructor(e){this.lineWrapping=e,this.doc=wi.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 cRt.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!=s;if(this.lineWrapping=s,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)>NK&&(YR=!0),this.height=e)}replace(e,r,n){return Yu.of(n)}decomposeLeft(e,r){r.push(this)}decomposeRight(e,r){r.push(this)}applyChanges(e,r,n,i){let a=this,o=n.doc;for(let s=i.length-1;s>=0;s--){let{fromA:l,toA:u,fromB:h,toB:d}=i[s],f=a.lineAt(l,Fa.ByPosNoHeight,n.setDoc(r),0,0),p=f.to>=u?f:a.lineAt(u,Fa.ByPosNoHeight,n,0,0);for(d+=p.to-u,u=p.to;s>0&&f.from<=i[s-1].toA;)l=i[s-1].fromA,h=i[s-1].fromB,s--,la*2){let s=e[r-1];s.break?e.splice(--r,1,s.left,null,s.right):e.splice(--r,1,s.left,s.right),n+=1+s.break,i-=s.size}else if(a>i*2){let s=e[n];s.break?e.splice(n,1,s.left,null,s.right):e.splice(n,1,s.left,s.right),n+=2+s.break,a-=s.size}else break;else if(i=a&&o(this.lineAt(0,Fa.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 Jd extends hRt{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 Jd||i instanceof Sc&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof Sc?i=new Jd(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Yu.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 Sc extends Yu{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,o,s=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*a);o=l/a,this.length>a+1&&(s=(this.height-l)/(this.length-a-1))}else o=this.height/a;return{firstLine:n,lastLine:i,perLine:o,perChar:s}}blockAt(e,r,n,i){let{firstLine:a,lastLine:o,perLine:s,perChar:l}=this.heightMetrics(r,i);if(r.lineWrapping){let u=i+(e0){let a=n[n.length-1];a instanceof Sc?n[n.length-1]=new Sc(a.length+i):n.push(null,new Sc(i-1))}if(e>0){let a=n[0];a instanceof Sc?n[0]=new Sc(e+a.length):n.unshift(new Sc(e-1),null)}return Yu.of(n)}decomposeLeft(e,r){r.push(new Sc(e-1),null)}decomposeRight(e,r){r.push(null,new Sc(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 o=[],s=Math.max(r,i.from),l=-1;for(i.from>r&&o.push(new Sc(i.from-r-1).updateHeight(e,r));s<=a&&i.more;){let h=e.doc.lineAt(s).length;o.length&&o.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)>=NK&&(l=-2);let p=new Jd(h,d,f);p.outdated=!1,o.push(p),s+=h+1}s<=a&&o.push(null,new Sc(a-s).updateHeight(e,s));let u=Yu.of(o);return(l<0||Math.abs(u.height-this.height)>=NK||Math.abs(l-this.heightMetrics(e,r).perLine)>=NK)&&(YR=!0),BK(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 t1n extends Yu{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 es))return u;let h=r==Fa.ByPosNoHeight?Fa.ByPosNoHeight:Fa.ByPos;return l?u.join(this.right.lineAt(s,h,n,o,s)):this.left.lineAt(s,h,n,i,a).join(u)}forEachLine(e,r,n,i,a,o){let s=i+this.left.height,l=a+this.left.length+this.break;if(this.break)e=l&&this.right.forEachLine(e,r,n,s,l,o);else{let u=this.lineAt(l,Fa.ByPos,n,i,a);e=e&&u.from<=r&&o(u),r>u.to&&this.right.forEachLine(u.to+1,r,n,s,l,o)}}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 o=a.length;for(let s of n)a.push(s);if(e>0&&dRt(a,o-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?Yu.of(this.break?[e,null,r]:[e,r]):(this.left=BK(this.left,e),this.right=BK(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:o}=this,s=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<=s+o.length&&i.more?l=o=o.updateHeight(e,s,n,i):o.updateHeight(e,s,n),l?this.balanced(a,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function dRt(t,e){let r,n;t[e]==null&&(r=t[e-1])instanceof Sc&&(n=t[e+1])instanceof Sc&&t.splice(e-1,3,new Sc(r.length+1+n.length))}const r1n=5;class ywe{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 Jd?i.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new Jd(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=r1n)&&this.addLineDeco(i,a,o)}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 Jd(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,r){let n=new Sc(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 Jd)return e;let r=new Jd(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 Jd)&&!this.isCovered?this.nodes.push(new Jd(0,-1,0)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&d.overflow!="visible"){let f=h.getBoundingClientRect();a=Math.max(a,f.left),o=Math.min(o,f.right),s=Math.max(s,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,o)-r.left,top:s-(r.top+e),bottom:Math.max(s,l)-(r.top+e)}}function o1n(t){let e=t.getBoundingClientRect(),r=t.ownerDocument.defaultView||window;return e.left0&&e.top0}function s1n(t,e){let r=t.getBoundingClientRect();return{left:0,right:r.right-r.left,top:e,bottom:r.bottom-(r.top+e)}}class bwe{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 Zyn(n),this.stateDeco=gRt(r),this.heightMap=Yu.empty().applyChanges(this.stateDeco,wi.empty,this.heightOracle.setDoc(r.doc),[new xp(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:o})=>i>=a&&i<=o)){let{from:a,to:o}=this.lineBlockAt(i);e.push(new $K(a,o))}}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?pRt:new xwe(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(I$(e,this.scaler))})}update(e,r=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=gRt(this.state);let i=e.changedRanges,a=xp.extendWithRanges(i,n1n(n,this.stateDeco,e?e.changes:bs.empty(this.state.doc.length))),o=this.heightMap.height,s=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);uRt(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),a),(this.heightMap.height!=o||YR)&&(e.flags|=2),s?(this.scrollAnchorPos=e.changes.mapPos(s.from,-1),this.scrollAnchorHeight=s.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);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(_5t)&&(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"?Ra.RTL:Ra.LTR;let o=this.heightOracle.mustRefreshForWrapping(a)||this.mustMeasureContent==="refresh",s=r.getBoundingClientRect(),l=o||this.mustMeasureContent||this.contentDOMHeight!=s.height;this.contentDOMHeight=s.height,this.mustMeasureContent=!1;let u=0,h=0;if(s.width&&s.height){let{scaleX:A,scaleY:S}=u5t(r,s);(A>.005&&Math.abs(this.scaleX-A)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=A,this.scaleY=S,u|=16,o=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=h5t(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=p5t(this.scrollParent||e.win);let m=(this.printing?s1n:a1n)(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&&!o1n(e.dom))return 0;let x=s.width;if((this.contentDOMWidth!=x||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=s.width,this.editorHeight=e.scrollDOM.clientHeight,u|=16),l){let A=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(A)&&(o=!0),o||i.lineWrapping&&Math.abs(x-this.contentDOMWidth)>i.charWidth){let{lineHeight:S,charWidth:T,textHeight:C}=e.docView.measureTextSize();o=S>0&&i.refresh(a,S,T,C,Math.max(5,x/T),A),o&&(e.docView.minWidth=0,u|=16)}v>0&&y>0?h=Math.max(v,y):v<0&&y<0&&(h=Math.min(v,y)),uRt();for(let S of this.viewports){let T=S.from==this.viewport.from?A:e.docView.measureVisibleLineHeights(S);this.heightMap=(o?Yu.empty().applyChanges(this.stateDeco,wi.empty,this.heightOracle,[new xp(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new Jyn(S.from,T))}YR&&(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(o?[]: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:o,visibleBottom:s}=this,l=new $K(i.lineAt(o-n*1e3,Fa.ByHeight,a,0,0).from,i.lineAt(s+(1-n)*1e3,Fa.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,Fa.ByPos,a,0,0),f;r.y=="center"?f=(d.top+d.bottom)/2-h/2:r.y=="start"||r.y=="nearest"&&u=s+Math.max(10,Math.min(n,250)))&&i>o-2*1e3&&a>1,o=i<<1;if(this.defaultTextDirection!=Ra.LTR&&!n)return[];let s=[],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(xt.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 bwe(h,d,y,b)}s.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=[];ti.spans(r,this.viewport.from,this.viewport.to,{span(a,o){n.push({from:a,to:o})},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)||I$(this.heightMap.lineAt(e,Fa.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)||I$(this.heightMap.lineAt(this.scaler.fromDOM(e),Fa.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 I$(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 $K{constructor(e,r){this.from=e,this.to=r}}function c1n(t,e,r){let n=[],i=t,a=0;return ti.spans(r,t,e,{span(){},point(o,s){o>i&&(n.push({from:i,to:o}),a+=o-i),i=s}},20),i=1)return e[e.length-1].to;let n=Math.floor(t*r);for(let i=0;;i++){let{from:a,to:o}=e[i],s=o-a;if(n<=s)return a+n;n-=s}}function zK(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 u1n(t,e){for(let r of t)if(e(r))return r}const pRt={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function gRt(t){let e=t.facet(OK).filter(n=>typeof n!="function"),r=t.facet(swe).filter(n=>typeof n!="function");return r.length&&e.push(ti.join(r)),e}class xwe{constructor(e,r,n){let i=0,a=0,o=0;this.viewports=n.map(({from:s,to:l})=>{let u=r.lineAt(s,Fa.ByPos,e,0,0).top,h=r.lineAt(l,Fa.ByPos,e,0,0).bottom;return i+=h-u,{from:s,to:l,top:u,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(r.height-i);for(let s of this.viewports)s.domTop=o+(s.top-a)*this.scale,o=s.domBottom=s.domTop+(s.bottom-s.top),a=s.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 I$(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=>I$(i,e)):t._content)}const UK=vr.define({combine:t=>t.join(" ")}),wwe=vr.define({combine:t=>t.indexOf(!0)>-1}),Awe=d1.newName(),mRt=d1.newName(),vRt=d1.newName(),yRt={"&light":"."+mRt,"&dark":"."+vRt};function Swe(t,e,r){return new d1(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 h1n=Swe("."+Awe,{"&":{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"}},yRt),d1n={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Twe=br.ie&&br.ie_version<=11;class f1n{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Vvn,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 g1n(e),e.state.facet(p1)&&(e.contentDOM.editContext=this.editContext.editContext)),Twe&&(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(p1)?n.root.activeElement!=this.dom:!O$(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&&E$(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,r=C$(e.root);if(!r)return!1;let n=br.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&p1n(this.view,r)||r;if(!n||this.selectionRange.eq(n))return!1;let i=O$(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&&UR(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 o=this.readMutation(a);o&&(o.typeOver&&(i=!0),r==-1?{from:r,to:n}=o:(r=Math.min(o.from,r),n=Math.max(o.to,n)))}return{from:r,to:n,typeOver:i}}readChange(){let{from:e,to:r,typeOver:n}=this.processRecords(),i=this.selectionChanged&&O$(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 Dyn(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=W5t(this.view,r);return this.view.state==n&&(r.domChanged||r.newSel&&!LK(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=bRt(r,e.previousSibling||e.target.previousSibling,-1),i=bRt(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(p1)!=e.state.facet(p1)&&(e.view.contentDOM.editContext=e.state.facet(p1)?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 bRt(t,e,r){for(;e;){let n=Zo.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 xRt(t,e){let r=e.startContainer,n=e.startOffset,i=e.endContainer,a=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor,1);return E$(o.node,o.offset,i,a)&&([r,n,i,a]=[i,a,r,n]),{anchorNode:r,anchorOffset:n,focusNode:i,focusOffset:a}}function p1n(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return xRt(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?xRt(t,r):null}class g1n{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:o}=i,s=this.toEditorPos(n.updateRangeStart),l=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:s,drifted:!1});let u=l-s>n.text.length;s==this.from&&athis.to&&(l=a);let h=Y5t(e.state.sliceDoc(s,l),n.text,(u?i.from:i.to)-s,u?"end":null);if(!h){let f=xt.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));LK(f,i)||e.dispatch({selection:f,userEvent:"select"});return}let d={from:h.from+s,to:h.toA+s,insert:wi.of(n.text.slice(h.from,h.toB).split(` +`))};if((br.mac||br.android)&&d.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(d={from:s,to:l,insert:wi.of([n.text.replace("."," ")])}),this.pendingContextChange=d,!e.state.readOnly){let f=this.to-this.from+(d.to-d.from+d.insert.length);mwe(e,d,xt.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 o=this.toEditorPos(n.rangeStart),s=this.toEditorPos(n.rangeEnd);o{let i=[];for(let a of n.getTextFormats()){let o=a.underlineStyle,s=a.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(s)){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=C$(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,o,s,l,u)=>{if(n)return;let h=u.length-(o-a);if(i&&o>=i.to)if(i.from==a&&i.to==o&&i.insert.eq(u)){i=this.pendingContextChange=null,r+=h,this.to+=h;return}else i=null,this.revertPending(e.state);if(a+=r,o+=r,o<=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(o),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||Qvn(e.parent)||document,this.viewState=new fRt(this,e.state||ei.create(e)),e.scrollTo&&e.scrollTo.is(CK)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(QR).map(i=>new awe(i));for(let i of this.plugins)i.update(this);this.observer=new f1n(this),this.inputState=new Pyn(this),this.inputState.ensureHandlers(this.plugins),this.docView=new z5t(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 Us?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 o=this.hasFocus,s=0,l=null;e.some(f=>f.annotation(aRt))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=oRt(a,o),l||(s=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(ei.phrases)!=this.state.facet(ei.phrases))return this.setState(a);i=kK.create(this,a,e),i.flags|=s;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 VR(p.empty?p:xt.cursor(p.head,p.head>p.anchor?-1:1),"nearest","nearest",m,g)}for(let p of f.effects)p.is(CK)&&(d=p.value.clip(this.state))}this.viewState.update(i,d),this.bidiCache=VK.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),r=this.docView.update(i),this.state.facet(L$)!=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(UK)!=i.state.facet(UK)&&(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(rwe))try{f(i)}catch(p){qh(this.state,p,"update listener")}(l||h)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),h&&!W5t(this,h)&&u.force&&UR(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 fRt(this,e),this.plugins=e.facet(QR).map(n=>new awe(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new z5t(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(QR),n=e.state.facet(QR);if(r!=n){let i=[];for(let a of n){let o=r.indexOf(a);if(o<0)i.push(new awe(a));else{let s=this.plugins[o];s.mustUpdate=e,i.push(s)}}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:o}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let s=0;;s++){if(o<0)if(p5t(n||this.win))a=-1,o=this.viewState.heightMap.height;else{let p=this.viewState.scrollAnchorAt(i);a=p.from,o=p.top}this.updateState=1;let l=this.viewState.measure();if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(s>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 qh(this.state,g),wRt}}),d=kK.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),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(r&&!r.empty)for(let s of this.state.facet(rwe))s(r)}get themeClasses(){return Awe+" "+(this.state.facet(wwe)?vRt:mRt)+" "+this.state.facet(UK)}updateAttrs(){let e=ARt(this,L5t,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),r={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(p1)?"true":"false",class:"cm-content",style:`${br.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(r["aria-readonly"]="true"),ARt(this,owe,r);let n=this.observer.ignore(()=>{let i=s5t(this.contentDOM,this.contentAttrs,r),a=s5t(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(L$);let e=this.state.facet(er.cspNonce);d1.mount(this.root,this.styleModules.concat(h1n).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 pwe(this,e,V5t(this,e,r,n))}moveByGroup(e,r){return pwe(this,e,V5t(this,e,r,n=>Cyn(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 xt.cursor(a.side(r,i)+e.from,a.forward(!r,i)?1:-1)}moveToLineBoundary(e,r,n=!0){return Tyn(this,e,r,n)}moveVertically(e,r,n){return pwe(this,e,Oyn(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=gwe(this,e,r);return n&&n.pos}posAndSideAtCoords(e,r=!0){return this.readMeasured(),gwe(this,e,r)}coordsAtPos(e,r=1){this.readMeasured();let n=this.state.doc.lineAt(e),i=this.bidiSpans(n),a=i[R0.find(i,e-n.from,-1,r)];return this.docView.coordsAt(e,r,a.dir==Ra.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(E5t)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>m1n)return x5t(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||b5t(a.isolates,n=P5t(this,e))))return a.order;n||(n=P5t(this,e));let i=Kvn(e.text,r,n);return this.bidiCache.push(new VK(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(()=>{d5t(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,o;return CK.of(new VR(typeof e=="number"?xt.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,(o=r.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:r}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return CK.of(new VR(xt.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 Ro.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Ro.define(()=>({}),{eventObservers:e})}static theme(e,r){let n=d1.newName(),i=[UK.of(n),L$.of(Swe(`.${n}`,e))];return r&&r.dark&&i.push(wwe.of(!0)),i}static baseTheme(e){return Zd.lowest(L$.of(Swe("."+Awe,e,yRt)))}static findFromDOM(e){var r;let n=e.querySelector(".cm-content"),i=n&&Zo.get(n)||Zo.get(e);return((r=i==null?void 0:i.root)===null||r===void 0?void 0:r.view)||null}}er.styleModule=L$,er.inputHandler=O5t,er.clipboardInputFilter=nwe,er.clipboardOutputFilter=iwe,er.scrollHandler=R5t,er.focusChangeEffect=k5t,er.perLineTextDirection=E5t,er.exceptionSink=C5t,er.updateListener=rwe,er.editable=p1,er.mouseSelectionStyle=T5t,er.dragMovesSelection=S5t,er.clickAddsSelectionRange=A5t,er.decorations=OK,er.blockWrappers=M5t,er.outerDecorations=swe,er.atomicRanges=D$,er.bidiIsolatedRanges=I5t,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=N5t,er.darkTheme=wwe,er.cspNonce=vr.define({combine:t=>t.length?t[0]:""}),er.contentAttributes=owe,er.editorAttributes=L5t,er.lineWrapping=er.contentAttributes.of({class:"cm-lineWrapping"}),er.announce=on.define();const m1n=4096,wRt={};class VK{constructor(e,r,n,i,a,o){this.from=e,this.to=r,this.dir=n,this.isolates=i,this.fresh=a,this.order=o}static update(e,r){if(r.empty&&!e.some(a=>a.fresh))return e;let n=[],i=e.length?e[e.length-1].dir:Ra.LTR;for(let a=Math.max(0,e.length-10);a=0;i--){let a=n[i],o=typeof a=="function"?a(t):a;o&&j2e(o,r)}return r}const v1n=br.mac?"mac":br.windows?"win":br.linux?"linux":"key";function y1n(t,e){const r=t.split(/-(?!$)/);let n=r[r.length-1];n=="Space"&&(n=" ");let i,a,o,s;for(let l=0;ln.concat(i),[]))),r}function x1n(t,e,r){return CRt(TRt(t.state),e,t,r)}let R2=null;const w1n=4e3;function A1n(t,e=v1n){let r=Object.create(null),n=Object.create(null),i=(o,s)=>{let l=n[o];if(l==null)n[o]=s;else if(l!=s)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},a=(o,s,l,u,h)=>{var d,f;let p=r[o]||(r[o]=Object.create(null)),g=s.split(/ (?!$)/).map(y=>y1n(y,e));for(let y=1;y{let w=R2={view:x,prefix:b,scope:o};return setTimeout(()=>{R2==w&&(R2=null)},w1n),!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 o of t){let s=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let u of s){let h=r[u]||(r[u]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:d}=o;for(let f in h)h[f].run.push(p=>d(p,Cwe))}let l=o[e]||o.key;if(l)for(let u of s)a(u,l,o.run,o.preventDefault,o.stopPropagation),o.shift&&a(u,"Shift-"+l,o.shift,o.preventDefault,o.stopPropagation)}return r}let Cwe=null;function CRt(t,e,r,n){Cwe=e;let i=Nvn(e),a=Yh(i,0),o=C0(a)==i.length&&i!=" ",s="",l=!1,u=!1,h=!1;R2&&R2.view==r&&R2.scope==n&&(s=R2.prefix+" ",X5t.indexOf(e.keyCode)<0&&(u=!0,R2=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[s+QK(i,e,!o)])?l=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(br.windows&&e.ctrlKey&&e.altKey)&&!(br.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(g=E2[e.keyCode])&&g!=i?(f(p[s+QK(g,e,!0)])||e.shiftKey&&(m=w$[e.keyCode])!=i&&m!=g&&f(p[s+QK(m,e,!1)]))&&(l=!0):o&&e.shiftKey&&f(p[s+QK(i,e,!0)])&&(l=!0),!l&&f(p._any)&&(l=!0)),u&&(l=!0),l&&h&&e.stopPropagation(),Cwe=null,l}class hC{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=ORt(e);return[new hC(r,i.left-a.left,i.top-a.top,null,i.bottom-i.top)]}else return S1n(e,r,n)}}function ORt(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Ra.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function kRt(t,e,r,n){let i=t.coordsAtPos(e,r*2);if(!i)return n;let a=t.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,s=t.posAtCoords({x:a.left+1,y:o}),l=t.posAtCoords({x:a.right-1,y:o});return s==null||l==null?n:{from:Math.max(n.from,Math.min(s,l)),to:Math.min(n.to,Math.max(s,l))}}function S1n(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==Ra.LTR,o=t.contentDOM,s=o.getBoundingClientRect(),l=ORt(t),u=o.querySelector(".cm-line"),h=u&&window.getComputedStyle(u),d=s.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),f=s.right-(h?parseInt(h.paddingRight):0),p=fwe(t,n,1),g=fwe(t,i,-1),m=p.type==Ac.Text?p:null,v=g.type==Ac.Text?g:null;if(m&&(t.lineWrapping||p.widgetLineBreaks)&&(m=kRt(t,n,1,m)),v&&(t.lineWrapping||g.widgetLineBreaks)&&(v=kRt(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/2P&&R.from=M)break;B>D&&_(Math.max(F,D),A==null&&F<=P,Math.min(B,M),S==null&&B>=L,N.dir)}if(D=I.to+1,D>=M)break}return E.length==0&&_(P,A==null,L,S==null,t.textDirection),{top:C,bottom:k,horizontal:E}}function w(A,S){let T=s.top+(S?A.top:A.bottom);return{top:T,bottom:T,horizontal:[]}}}function T1n(t,e){return t.constructor==e.constructor&&t.eq(e)}class C1n{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(GK)!=e.state.facet(GK)&&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(GK);for(;r!T1n(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 GK=vr.define();function ERt(t){return[Ro.define(e=>new C1n(e,t)),GK.of(t)]}const jR=vr.define({combine(t){return E0(t,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,r)=>Math.min(e,r),drawRangeCursor:(e,r)=>e||r})}});function O1n(t={}){return[jR.of(t),k1n,E1n,_1n,_5t.of(!0)]}function _Rt(t){return t.startState.facet(jR)!=t.state.facet(jR)}const k1n=ERt({above:!0,markers(t){let{state:e}=t,r=e.facet(jR),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 o=a?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",s=i.empty?i:xt.cursor(i.head,i.assoc);for(let l of hC.forRange(t,o,s))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=_Rt(t);return r&&RRt(t.state,e),t.docChanged||t.selectionSet||r},mount(t,e){RRt(e.state,t)},class:"cm-cursorLayer"});function RRt(t,e){e.style.animationDuration=t.facet(jR).cursorBlinkRate+"ms"}const E1n=ERt({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 hC.forRange(t,"cm-selectionBackground",i))e.push(a);if(br.ios&&!r.empty&&t.state.facet(jR).iosSelectionHandles){for(let i of hC.forRange(t,"cm-selectionHandle cm-selectionHandle-start",xt.cursor(r.from,1)))e.push(i);for(let i of hC.forRange(t,"cm-selectionHandle cm-selectionHandle-end",xt.cursor(r.to,1)))e.push(i)}return e},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||_Rt(t)},class:"cm-selectionLayer"}),_1n=Zd.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"}}}})),DRt=on.define({map(t,e){return t==null?null:e.mapPos(t)}}),P$=Ko.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((r,n)=>n.is(DRt)?n.value:r,t)}}),R1n=Ro.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(P$);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(P$)!=r||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(P$),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(P$)!=t&&this.view.dispatch({effects:DRt.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 D1n(){return[P$,R1n]}function LRt(t,e,r,n,i){e.lastIndex=0;for(let a=t.iterRange(r,n),o=r,s;!a.next().done;o+=a.value.length)if(!a.lineBreak)for(;s=e.exec(a.value);)i(o+s.index,s)}function L1n(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 M1n{constructor(e){const{regexp:r,decoration:n,decorate:i,boundary:a,maxLength:o=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=(s,l,u,h)=>i(h,u,u+s[0].length,s,l);else if(typeof n=="function")this.addMatch=(s,l,u,h)=>{let d=n(s,l,u);d&&h(u,u+s[0].length,d)};else if(n)this.addMatch=(s,l,u,h)=>h(u,u+s[0].length,n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=a,this.maxLength=o}createDeco(e){let r=new Qu,n=r.add.bind(r);for(let{from:i,to:a}of L1n(e,this.maxLength))LRt(e.state.doc,this.regexp,i,a,(o,s)=>this.addMatch(s,e,o,n));return r.finish()}updateDeco(e,r){let n=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((a,o,s,l)=>{l>=e.view.viewport.from&&s<=e.view.viewport.to&&(n=Math.min(s,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 o=Math.max(a.from,n),s=Math.min(a.to,i);if(s>=o){let l=e.state.doc.lineAt(o),u=l.tol.from;o--)if(this.boundary.test(l.text[o-1-l.from])){h=o;break}for(;sf.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 Owe=/x/.unicode!=null?"gu":"g",I1n=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Owe),P1n={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 kwe=null;function N1n(){var t;if(kwe==null&&typeof document<"u"&&document.body){let e=document.body.style;kwe=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return kwe||!1}const HK=vr.define({combine(t){let e=E0(t,{render:null,specialChars:I1n,addSpecialChars:null});return(e.replaceTabs=!N1n())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Owe)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Owe)),e}});function B1n(t={}){return[HK.of(t),$1n()]}let MRt=null;function $1n(){return MRt||(MRt=Ro.fromClass(class{constructor(t){this.view=t,this.decorations=Ar.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(HK)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new M1n({regexp:t.specialChars,decoration:(e,r,n)=>{let{doc:i}=r.state,a=Yh(e[0],0);if(a==9){let o=i.lineAt(n),s=r.state.tabSize,l=Lg(o.text,s,n-o.from);return Ar.replace({widget:new V1n((s-l%s)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=Ar.replace({widget:new U1n(t,a)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(HK);t.startState.facet(HK)!=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 F1n="•";function z1n(t){return t>=32?F1n:t==10?"␤":String.fromCharCode(9216+t)}class U1n extends Hu{constructor(e,r){super(),this.options=e,this.code=r}eq(e){return e.code==this.code}toDOM(e){let r=z1n(this.code),n=e.state.phrase("Control character")+" "+(P1n[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 V1n extends Hu{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 Q1n(){return H1n}const G1n=Ar.line({class:"cm-activeLine"}),H1n=Ro.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(G1n.range(i.from)),e=i.from)}return Ar.set(r)}},{decorations:t=>t.decorations});class W1n extends Hu{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?k$(e.firstChild):[];if(!r.length)return null;let n=window.getComputedStyle(e.parentNode),i=_$(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 Y1n(t){let e=Ro.fromClass(class{constructor(r){this.view=r,this.placeholder=t?Ar.set([Ar.widget({widget:new W1n(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 Ewe=2e3;function q1n(t,e,r){let n=Math.min(e.line,r.line),i=Math.max(e.line,r.line),a=[];if(e.off>Ewe||r.off>Ewe||e.col<0||r.col<0){let o=Math.min(e.off,r.off),s=Math.max(e.off,r.off);for(let l=n;l<=i;l++){let u=t.doc.line(l);u.length<=s&&a.push(xt.range(u.from+o,u.to+s))}}else{let o=Math.min(e.col,r.col),s=Math.max(e.col,r.col);for(let l=n;l<=i;l++){let u=t.doc.line(l),h=z2e(u.text,o,t.tabSize,!0);if(h<0)a.push(xt.cursor(u.to));else{let d=z2e(u.text,s,t.tabSize);a.push(xt.range(u.from+h,u.from+d))}}}return a}function j1n(t,e){let r=t.coordsAtPos(t.viewport.from);return r?Math.round(Math.abs((r.left-e)/t.defaultCharacterWidth)):-1}function IRt(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>Ewe?-1:i==n.length?j1n(t,e.clientX):Lg(n.text,t.state.tabSize,r-n.from);return{line:n.number,col:a,off:i}}function X1n(t,e){let r=IRt(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),o=i.state.doc.lineAt(a);r={line:o.number,col:r.col,off:Math.min(r.off,o.length)},n=n.map(i.changes)}},get(i,a,o){let s=IRt(t,i);if(!s)return n;let l=q1n(t.state,r,s);return l.length?o?xt.create(l.concat(n.ranges)):xt.create(l):n}}:null}function K1n(t){let e=r=>r.altKey&&r.button==0;return er.mouseSelectionStyle.of((r,n)=>e(n)?X1n(r,n):null)}const Z1n={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},J1n={style:"cursor: crosshair"};function ebn(t={}){let[e,r]=Z1n[t.key||"Alt"],n=Ro.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?J1n:null})]}const WK="-10000px";class PRt{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(o=>o);let a=null;this.tooltipViews=this.tooltips.map(o=>a=n(o,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 o=[],s=r?[]:null;for(let l=0;lr[u]=l),r.length=s.length),this.input=i,this.tooltips=a,this.tooltipViews=o,!0}}function tbn(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const _we=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)||tbn}}}),NRt=new WeakMap,Rwe=Ro.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(_we);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 PRt(t,Dwe,(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(_we);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=WK,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 o=a.getBoundingClientRect();r=Math.abs(o.top+1e4)>1||Math.abs(o.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=lwe(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,o)=>{let s=this.manager.tooltipViews[o];return s.getCoords?s.getCoords(a.pos):this.view.coordsAtPos(a.pos)}),size:this.manager.tooltipViews.map(({dom:a})=>a.getBoundingClientRect()),space:this.view.state.facet(_we).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:r}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let s of this.manager.tooltipViews)s.dom.style.position="absolute"}let{visible:r,space:n,scaleX:i,scaleY:a}=t,o=[];for(let s=0;s=Math.min(r.bottom,n.bottom)||d.rightMath.min(r.right,n.right)+.1)){h.style.top=WK;continue}let p=l.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,g=p?7:0,m=f.right-f.left,v=(e=NRt.get(u))!==null&&e!==void 0?e:f.bottom-f.top,y=u.offset||nbn,b=this.view.textDirection==Ra.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[s];!l.strictSide&&(w?d.top-v-g-y.yn.bottom)&&w==n.bottom-d.bottom>d.top-n.top&&(w=this.above[s]=!w);let A=(w?d.top-n.top:n.bottom-d.bottom)-g;if(Ax&&C.topS&&(S=w?C.top-v-2-g:C.bottom+g+2);if(this.position=="absolute"?(h.style.top=(S-t.parent.top)/a+"px",BRt(h,(x-t.parent.left)/i)):(h.style.top=S/a+"px",BRt(h,x/i)),p){let C=d.left+(b?y.x:-y.x)-(x+14-7);p.style.left=C/i+"px"}u.overlap!==!0&&o.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=WK}},{eventObservers:{scroll(){this.maybeMeasure()}}});function BRt(t,e){let r=parseInt(t.style.left,10);(isNaN(r)||Math.abs(e-r)>1)&&(t.style.left=e+"px")}const rbn=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"}}}),nbn={x:0,y:0},Dwe=vr.define({enables:[Rwe,rbn]}),YK=vr.define({combine:t=>t.reduce((e,r)=>e.concat(r),[])});class qK{static create(e){return new qK(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new PRt(e,YK,(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 ibn=Dwe.compute([YK],t=>{let e=t.facet(YK);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:qK.create,above:e[0].above,arrow:e.some(r=>r.arrow)}}),$Rt=vr.define();class abn{constructor(e,r,n,i,a,o){this.view=e,this.source=r,this.field=n,this.locked=i,this.setHover=a,this.hoverTime=o,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;eo.bottom||r.xo.right+e.defaultCharacterWidth)return;let s=e.bidiSpans(e.state.doc.lineAt(i)).find(u=>u.from<=i&&u.to>=i),l=s&&s.dir==Ra.RTL?-1:1;a=r.x{if(s&&!(Array.isArray(s)&&!s.length)){let l=Array.isArray(s)?s:[s];i&&this.locked.set(l,i),e.dispatch({effects:this.setHover.of(l)})}};if(a&&"then"in a){let s=this.pending={pos:r};a.then(l=>{this.pending==s&&(this.pending=null,o(l))},l=>qh(e.state,l,"hover tooltip"))}else o(a)}get tooltip(){let e=this.view.plugin(Rwe),r=e?e.manager.tooltips.findIndex(n=>n.create==qK.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&&!obn(a.dom,e)||this.pending){let{pos:o}=i[0]||this.pending,s=(n=(r=i[0])===null||r===void 0?void 0:r.end)!==null&&n!==void 0?n:o;(o==s?this.view.posAtCoords(this.lastMove)!=o:!sbn(this.view,o,s,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 jK=4;function obn(t,e){let{left:r,right:n,top:i,bottom:a}=t.getBoundingClientRect(),o;if(o=t.querySelector(".cm-tooltip-arrow")){let s=o.getBoundingClientRect();i=Math.min(s.top,i),a=Math.max(s.bottom,a)}return e.clientX>=r-jK&&e.clientX<=n+jK&&e.clientY>=i-jK&&e.clientY<=a+jK}function sbn(t,e,r,n,i,a){let o=t.scrollDOM.getBoundingClientRect(),s=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>n||o.righti||Math.min(o.bottom,s)=e&&l<=r}function lbn(t,e={}){let r=on.define(),n=new WeakMap,i=Ko.define({create(){return[]},update(o,s){let l=n.get(o);if(o.length&&(e.hideOnChange&&(s.docChanged||s.selection)?o=[]:l&&l(s)?o=[]:e.hideOn&&(o=o.filter(u=>!e.hideOn(s,u)))),s.docChanged&&o.length){let u=[];for(let h of o){let d=s.changes.mapPos(h.pos,-1,xc.TrackDel);if(d!=null){let f=Object.assign(Object.create(null),h);f.pos=d,f.end!=null&&(f.end=s.changes.mapPos(f.end)),u.push(f)}}o=u}for(let u of s.effects)u.is(r)&&(o=u.value,l=void 0),(u.is(ubn)&&!u.value||u.value==i)&&(o=[]);return o.length&&l&&n.set(o,l),o},provide:o=>YK.from(o)});const a=Ro.define(o=>new abn(o,t,i,n,r,e.hoverTime||300));return{active:i,extension:[i,a,$Rt.of(a),ibn]}}function cbn(t,e,r,n={}){var i;let a=t.state.facet($Rt).map(o=>t.plugin(o)).filter(o=>!!o);if(n.tooltip&&n.tooltip.active){let o=a.find(s=>s.field==n.tooltip.active);o&&(a=[o])}for(let o of a)o.activateHover(t,e,r,(i=n.until)!==null&&i!==void 0?i:()=>!1)}function FRt(t,e){let r=t.plugin(Rwe);if(!r)return null;let n=r.manager.tooltips.indexOf(e);return n<0?null:r.manager.tooltipViews[n]}const ubn=on.define(),zRt=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 Lwe(t,e){let r=t.plugin(URt),n=r?r.specs.indexOf(e):-1;return n>-1?r.panels[n]:null}const URt=Ro.fromClass(class{constructor(t){this.input=t.state.facet(N$),this.specs=this.input.filter(r=>r),this.panels=this.specs.map(r=>r(t));let e=t.state.facet(zRt);this.top=new XK(t,!0,e.topContainer),this.bottom=new XK(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(zRt);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new XK(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new XK(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let r=t.state.facet(N$);if(r!=this.input){let n=r.filter(l=>l),i=[],a=[],o=[],s=[];for(let l of n){let u=this.specs.indexOf(l),h;u<0?(h=l(t.view),s.push(h)):(h=this.panels[u],h.update&&h.update(t)),i.push(h),(h.top?a:o).push(h)}this.specs=n,this.panels=i,this.top.sync(a),this.bottom.sync(o);for(let l of s)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 XK{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=VRt(e);e=e.nextSibling}else this.dom.insertBefore(r.dom,e);for(;e;)e=VRt(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 VRt(t){let e=t.nextSibling;return t.remove(),e}const N$=vr.define({enables:URt});function hbn(t,e){let r,n=new Promise(o=>r=o),i=o=>dbn(o,e,r);t.state.field(Mwe,!1)?t.dispatch({effects:QRt.of(i)}):t.dispatch({effects:on.appendConfig.of(Mwe.init(()=>[i]))});let a=GRt.of(i);return{close:a,result:n.then(o=>((t.win.queueMicrotask||(l=>t.win.setTimeout(l,10)))(()=>{t.state.field(Mwe).indexOf(i)>-1&&t.dispatch({effects:a})}),o))}}const Mwe=Ko.define({create(){return[]},update(t,e){for(let r of e.effects)r.is(QRt)?t=[r.value].concat(t):r.is(GRt)&&(t=t.filter(n=>n!=r.value));return t},provide:t=>N$.computeN([t],e=>e.field(t))}),QRt=on.define(),GRt=on.define();function dbn(t,e,r){let n=e.content?e.content(t,()=>o(null)):null;if(!n){if(n=xa("form"),e.input){let s=xa("input",e.input);/^(text|password|number|email|tel|url)$/.test(s.type)&&s.classList.add("cm-textfield"),s.name||(s.name="input"),n.appendChild(xa("label",(e.label||"")+": ",s))}else n.appendChild(document.createTextNode(e.label||""));n.appendChild(document.createTextNode(" ")),n.appendChild(xa("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let i=n.nodeName=="FORM"?[n]:n.querySelectorAll("form");for(let s=0;s{u.keyCode==27?(u.preventDefault(),o(null)):u.keyCode==13&&(u.preventDefault(),o(l))}),l.addEventListener("submit",u=>{u.preventDefault(),o(l)})}let a=xa("div",n,xa("button",{onclick:()=>o(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 o(s){a.contains(a.ownerDocument.activeElement)&&t.focus(),r(s)}return{dom:a,top:e.top,mount:()=>{if(e.focus){let s;typeof e.focus=="string"?s=n.querySelector(e.focus):s=n.querySelector("input")||n.querySelector("button"),s&&"select"in s?s.select():s&&"focus"in s&&s.focus()}}}}class wp extends k2{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}wp.prototype.elementClass="",wp.prototype.toDOM=void 0,wp.prototype.mapMode=xc.TrackBefore,wp.prototype.startSide=wp.prototype.endSide=-1,wp.prototype.point=!0;const KK=vr.define(),fbn=vr.define(),pbn={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>ti.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},B$=vr.define();function Iwe(t){return[WRt(),B$.of({...pbn,...t})]}const HRt=vr.define({combine:t=>t.some(e=>e)});function WRt(t){return[gbn]}const gbn=Ro.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(B$).map(e=>new qRt(t,e)),this.fixed=!t.state.facet(HRt);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(HRt)!=!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=ti.iter(this.view.state.facet(KK),this.view.viewport.from),n=[],i=this.gutters.map(a=>new mbn(a,this.view.viewport,-this.view.documentPadding.top));for(let a of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(a.type)){let o=!0;for(let s of a.type)if(s.type==Ac.Text&&o){Pwe(r,n,s.from);for(let l of i)l.line(this.view,s,n);o=!1}else if(s.widget)for(let l of i)l.widget(this.view,s)}else if(a.type==Ac.Text){Pwe(r,n,a.from);for(let o of i)o.line(this.view,a,n)}else if(a.widget)for(let o of i)o.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(B$),r=t.state.facet(B$),n=t.docChanged||t.heightChanged||t.viewportChanged||!ti.eq(t.startState.facet(KK),t.state.facet(KK),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 o=e.indexOf(a);o<0?i.push(new qRt(this.view,a)):(this.gutters[o].update(t),i.push(this.gutters[o]))}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==Ra.LTR?{left:n,right:i}:{right:n,left:i}})});function YRt(t){return Array.isArray(t)?t:[t]}function Pwe(t,e,r){for(;t.value&&t.from<=r;)t.from==r&&e.push(t.value),t.next()}class mbn{constructor(e,r,n){this.gutter=e,this.height=n,this.i=0,this.cursor=ti.iter(e.markers,r.from)}addElement(e,r,n){let{gutter:i}=this,a=(r.top-this.height)/e.scaleY,o=r.height/e.scaleY;if(this.i==i.elements.length){let s=new jRt(e,o,a,n);i.elements.push(s),i.dom.appendChild(s.dom)}else i.elements[this.i].update(e,o,a,n);this.height=r.bottom,this.i++}line(e,r,n){let i=[];Pwe(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 o=this.gutter;i.length==0&&!o.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(fbn)){let o=a(e,r.widget,r);o&&(i||(i=[])).push(o)}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 qRt{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,o;if(a!=this.dom&&this.dom.contains(a)){for(;a.parentNode!=this.dom;)a=a.parentNode;let l=a.getBoundingClientRect();o=(l.top+l.bottom)/2}else o=i.clientY;let s=e.lineBlockAtHeight(o-e.documentTop);r.domEventHandlers[n](e,s,i)&&i.preventDefault()});this.markers=YRt(r.markers(e)),r.initialSpacer&&(this.spacer=new jRt(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=YRt(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!ti.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 jRt{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":""),vbn(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,r){let n="cm-gutterElement",i=this.dom.firstChild;for(let a=0,o=0;;){let s=o,l=aa(s,l,u)||o(s,l,u):o}return n}})}});class Nwe extends wp{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Bwe(t,e){return t.state.facet(XR).formatNumber(e,t.state)}const xbn=B$.compute([XR],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(ybn)},lineMarker(e,r,n){return n.some(i=>i.toDOM)?null:new Nwe(Bwe(e,e.state.doc.lineAt(r.from).number))},widgetMarker:(e,r,n)=>{for(let i of e.state.facet(bbn)){let a=i(e,r,n);if(a)return a}return null},lineMarkerChange:e=>e.startState.facet(XR)!=e.state.facet(XR),initialSpacer(e){return new Nwe(Bwe(e,KRt(e.state.doc.lines)))},updateSpacer(e,r){let n=Bwe(r.view,KRt(r.view.state.doc.lines));return n==e.number?e:new Nwe(n)},domEventHandlers:t.facet(XR).domEventHandlers,side:"before"}));function XRt(t={}){return[XR.of(t),WRt(),xbn]}function KRt(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(wbn.range(i)))}return ti.of(e)});function Sbn(){return Abn}let Tbn=0,L0=class XMe{constructor(e,r,n,i){this.name=e,this.set=r,this.base=n,this.modified=i,this.id=Tbn++}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 XMe&&(r=e),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let i=new XMe(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 ZK(e);return n=>n.modified.indexOf(r)>-1?n:ZK.get(n.base||n,n.modified.concat(r).sort((i,a)=>i.id-a.id))}},Cbn=0;class ZK{constructor(e){this.name=e,this.instances=[],this.id=Cbn++}static get(e,r){if(!r.length)return e;let n=r[0].instances.find(s=>s.base==e&&Obn(r,s.modified));if(n)return n;let i=[],a=new L0(e.name,i,e,r);for(let s of r)s.instances.push(a);let o=kbn(r);for(let s of e.set)if(!s.modified.length)for(let l of o)i.push(ZK.get(s,l));return a}}function Obn(t,e){return t.length==e.length&&t.every((r,n)=>r==e[n])}function kbn(t){let e=[[]];for(let r=0;rn.length-r.length)}function m1(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=[],o=2,s=i;for(let d=0;;){if(s=="..."&&d>0&&d+3==i.length){o=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(s);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=="!"){o=0;break}if(p!="/")throw new RangeError("Invalid path: "+i);s=i.slice(d)}let l=a.length-1,u=a[l];if(!u)throw new RangeError("Invalid path: "+i);let h=new $$(n,o,l>0?a.slice(0,l):null);e[u]=h.sort(e[u])}}return ZRt.add(e)}const ZRt=new _n({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.tags,i.mode,i.context);r?r.next=a:n=a,r=a}return n}});let $$=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 o=i;for(let s of a)for(let l of s.set){let u=r[l.id];if(u){o=o?o+" "+u:u;break}}return o},scope:n}}function Ebn(t,e){let r=null;for(let n of t){let i=n.style(e);i&&(r=r?r+" "+i:i)}return r}function e4t(t,e,r,n=0,i=t.length){let a=new _bn(n,Array.isArray(e)?e:[e],r);a.highlightRange(t.cursor(),n,i,"",a.highlighters),a.flush(i)}class _bn{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:o,from:s,to:l}=e;if(s>=n||l<=r)return;o.isTop&&(a=this.highlighters.filter(p=>!p.scope||p.scope(o)));let u=i,h=Rbn(e)||$$.empty,d=Ebn(a,h.tags);if(d&&(u&&(u+=" "),u+=d,h.mode==1&&(i+=(i?" ":"")+d)),this.startSpan(Math.max(r,s),u),h.opaque)return;let f=e.tree&&e.tree.prop(_n.mounted);if(f&&f.overlay){let p=e.node.enter(f.overlay[0].from+s,1),g=this.highlighters.filter(v=>!v.scope||v.scope(f.tree.type)),m=e.firstChild();for(let v=0,y=s;;v++){let b=v=x||!e.nextSibling())););if(!b||x>n)break;y=b.to+s,y>r&&(this.highlightRange(p.cursor(),Math.max(r,b.from+s),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 Rbn(t){let e=t.type.prop(ZRt);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const hr=L0.define,JK=hr(),D2=hr(),t4t=hr(D2),r4t=hr(D2),L2=hr(),eZ=hr(L2),$we=hr(L2),M0=hr(),dC=hr(M0),I0=hr(),P0=hr(),Fwe=hr(),F$=hr(Fwe),tZ=hr(),Re={comment:JK,lineComment:hr(JK),blockComment:hr(JK),docComment:hr(JK),name:D2,variableName:hr(D2),typeName:t4t,tagName:hr(t4t),propertyName:r4t,attributeName:hr(r4t),className:hr(D2),labelName:hr(D2),namespace:hr(D2),macroName:hr(D2),literal:L2,string:eZ,docString:hr(eZ),character:hr(eZ),attributeValue:hr(eZ),number:$we,integer:hr($we),float:hr($we),bool:hr(L2),regexp:hr(L2),escape:hr(L2),color:hr(L2),url:hr(L2),keyword:I0,self:hr(I0),null:hr(I0),atom:hr(I0),unit:hr(I0),modifier:hr(I0),operatorKeyword:hr(I0),controlKeyword:hr(I0),definitionKeyword:hr(I0),moduleKeyword:hr(I0),operator:P0,derefOperator:hr(P0),arithmeticOperator:hr(P0),logicOperator:hr(P0),bitwiseOperator:hr(P0),compareOperator:hr(P0),updateOperator:hr(P0),definitionOperator:hr(P0),typeOperator:hr(P0),controlOperator:hr(P0),punctuation:Fwe,separator:hr(Fwe),bracket:F$,angleBracket:hr(F$),squareBracket:hr(F$),paren:hr(F$),brace:hr(F$),content:M0,heading:dC,heading1:hr(dC),heading2:hr(dC),heading3:hr(dC),heading4:hr(dC),heading5:hr(dC),heading6:hr(dC),contentSeparator:hr(M0),list:hr(M0),quote:hr(M0),emphasis:hr(M0),strong:hr(M0),link:hr(M0),monospace:hr(M0),strikethrough:hr(M0),inserted:hr(),deleted:hr(),changed:hr(),invalid:hr(),meta:tZ,documentMeta:hr(tZ),annotation:hr(tZ),processingInstruction:hr(tZ),definition:L0.defineModifier("definition"),constant:L0.defineModifier("constant"),function:L0.defineModifier("function"),standard:L0.defineModifier("standard"),local:L0.defineModifier("local"),special:L0.defineModifier("special")};for(let t in Re){let e=Re[t];e instanceof L0&&(e.name=t)}JRt([{tag:Re.link,class:"tok-link"},{tag:Re.heading,class:"tok-heading"},{tag:Re.emphasis,class:"tok-emphasis"},{tag:Re.strong,class:"tok-strong"},{tag:Re.keyword,class:"tok-keyword"},{tag:Re.atom,class:"tok-atom"},{tag:Re.bool,class:"tok-bool"},{tag:Re.url,class:"tok-url"},{tag:Re.labelName,class:"tok-labelName"},{tag:Re.inserted,class:"tok-inserted"},{tag:Re.deleted,class:"tok-deleted"},{tag:Re.literal,class:"tok-literal"},{tag:Re.string,class:"tok-string"},{tag:Re.number,class:"tok-number"},{tag:[Re.regexp,Re.escape,Re.special(Re.string)],class:"tok-string2"},{tag:Re.variableName,class:"tok-variableName"},{tag:Re.local(Re.variableName),class:"tok-variableName tok-local"},{tag:Re.definition(Re.variableName),class:"tok-variableName tok-definition"},{tag:Re.special(Re.variableName),class:"tok-variableName2"},{tag:Re.definition(Re.propertyName),class:"tok-propertyName tok-definition"},{tag:Re.typeName,class:"tok-typeName"},{tag:Re.namespace,class:"tok-namespace"},{tag:Re.className,class:"tok-className"},{tag:Re.macroName,class:"tok-macroName"},{tag:Re.propertyName,class:"tok-propertyName"},{tag:Re.operator,class:"tok-operator"},{tag:Re.comment,class:"tok-comment"},{tag:Re.meta,class:"tok-meta"},{tag:Re.invalid,class:"tok-invalid"},{tag:Re.punctuation,class:"tok-punctuation"}]);var zwe;const M2=new _n;function rZ(t){return vr.define({combine:t?e=>e.concat(t):void 0})}const Uwe=new _n;class ef{constructor(e,r,n=[],i=""){this.data=e,this.name=i,ei.prototype.hasOwnProperty("tree")||Object.defineProperty(ei.prototype,"tree",{get(){return wa(this)}}),this.parser=r,this.extension=[y1.of(this),ei.languageData.of((a,o,s)=>{let l=n4t(a,o,s),u=l.type.prop(M2);if(!u)return[];let h=a.facet(u),d=l.type.prop(Uwe);if(d){let f=l.resolve(o-l.from,s);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 n4t(e,r,n).type.prop(M2)==this.data}findRegions(e){let r=e.facet(y1);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,o)=>{if(a.prop(M2)==this.data){n.push({from:o,to:o+a.length});return}let s=a.prop(_n.mounted);if(s){if(s.tree.prop(M2)==this.data){if(s.overlay)for(let l of s.overlay)n.push({from:l.from+o,to:l.to+o});else n.push({from:o,to:o+a.length});return}else if(s.overlay){let l=n.length;if(i(s.tree,s.overlay[0].from+o),n.length>l)return}}for(let l=0;ln.isTop?r:void 0)]}),e.name)}configure(e,r){return new v1(this.data,this.parser.configure(e),r||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function wa(t){let e=t.field(ef.state,!1);return e?e.tree:ci.empty}class Dbn{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 z$=null;class fC{constructor(e,r,n=[],i,a,o,s,l){this.parser=e,this.state=r,this.fragments=n,this.tree=i,this.treeLen=a,this.viewport=o,this.skipped=s,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,r,n){return new fC(e,r,[],ci.empty,0,n,[],null)}startParse(){return this.parser.startParse(new Dbn(this.state.doc),this.fragments)}work(e,r){return r!=null&&r>=this.state.doc.length&&(r=void 0),this.tree!=ci.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(h1.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let r=z$;z$=this;try{return e()}finally{z$=r}}withoutTempSkipped(e){for(let r;r=this.tempSkipped.pop();)e=i4t(e,r.from,r.to);return e}changes(e,r){let{fragments:n,tree:i,treeLen:a,viewport:o,skipped:s}=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=h1.applyChanges(n,l),i=ci.empty,a=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){s=[];for(let u of this.skipped){let h=e.mapPos(u.from,1),d=e.mapPos(u.to,-1);he.from&&(this.fragments=i4t(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 fK{createParse(r,n,i){let a=i[0].from,o=i[i.length-1].to;return{parsedPos:a,advance(){let l=z$;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=o,new ci(zs.none,[],[],o-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 z$}}function i4t(t,e,r){return h1.applyChanges(t,[{fromA:e,toA:r,fromB:e,toB:r}])}class KR{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 KR(r)}static init(e){let r=Math.min(3e3,e.doc.length),n=fC.create(e.facet(y1).parser,e,{from:0,to:r});return n.work(20,r)||n.takeTree(),new KR(n)}}ef.state=Ko.define({create:KR.init,update(t,e){for(let r of e.effects)if(r.is(ef.setState))return r.value;return e.startState.facet(y1)!=e.state.facet(y1)?KR.init(e.state):t.apply(e)}});let a4t=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(a4t=t=>{let e=-1,r=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(r):cancelIdleCallback(e)});const Vwe=typeof navigator<"u"&&(!((zwe=navigator.scheduling)===null||zwe===void 0)&&zwe.isInputPending)?()=>navigator.scheduling.isInputPending():null,Lbn=Ro.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(ef.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(ef.state);(r.tree!=r.context.tree||!r.context.isDone(e.doc.length))&&(this.working=a4t(this.work))}work(e){this.working=null;let r=Date.now();if(this.chunkEndi+1e3,l=a.context.work(()=>Vwe&&Vwe()||Date.now()>o,i+(s?0:1e5));this.chunkBudget-=Date.now()-r,(l||this.chunkBudget<=0)&&(a.context.takeTree(),this.view.dispatch({effects:ef.setState.of(new KR(a.context))})),this.chunkBudget>0&&!(l&&!s)&&this.scheduleWork(),this.checkAsyncSchedule(a.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(r=>qh(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()}}}),y1=vr.define({combine(t){return t.length?t[0]:null},enables:t=>[ef.state,Lbn,er.contentAttributes.compute([t],e=>{let r=e.facet(t);return r&&r.name?{"data-language":r.name}:{}})]});class I2{constructor(e,r=[]){this.language=e,this.support=r,this.extension=[e,r]}}class nZ{constructor(e,r,n,i,a,o=void 0){this.name=e,this.alias=r,this.extensions=n,this.filename=i,this.loadFunc=a,this.support=o,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 nZ(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 o=r.indexOf(a);if(o>-1&&(a.length>2||!/\w/.test(r[o-1])&&!/\w/.test(r[o+a.length])))return i}return null}}const Mbn=vr.define(),ZR=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 pC(t){let e=t.facet(ZR);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function U$(t,e){let r="",n=t.tabSize,i=t.facet(ZR)[0];if(i==" "){for(;e>=n;)r+=" ",e-=n;i=" "}for(let a=0;a=e?Ibn(t,r,e):null}class iZ{constructor(e,r={}){this.state=e,this.options=r,this.unit=pC(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+=o-this.countColumn(n,n.search(/\S|$/))),a}countColumn(e,r=e.length){return Lg(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 o=a(i);if(o>-1)return o}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const b1=new _n;function Ibn(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 o=i;o&&!(o.fromn.node.to||o.from==n.node.from&&o.type==n.node.type);o=o.parent)a.push(o);for(let o=a.length-1;o>=0;o--)n={node:a[o],next:n}}return o4t(n,t,r)}function o4t(t,e,r){for(let n=t;n;n=n.next){let i=Nbn(n.node);if(i)return i(Gwe.create(e,r,n))}return 0}function Pbn(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function Nbn(t){let e=t.type.prop(b1);if(e)return e;let r=t.firstChild,n;if(r&&(n=r.type.prop(_n.closedBy))){let i=t.lastChild,a=i&&n.indexOf(i.name)>-1;return o=>s4t(o,!0,1,void 0,a&&!Pbn(o)?i.from:void 0)}return t.parent==null?Bbn:null}function Bbn(){return 0}class Gwe extends iZ{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 Gwe(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($bn(n,e))break;r=this.state.doc.lineAt(n.from)}return this.lineIndent(r.from)}continue(){return o4t(this.context.next,this.base,this.pos)}}function $bn(t,e){for(let r=e;r;r=r.parent)if(t==r)return!0;return!1}function Fbn(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),o=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let s=r.to;;){let l=e.childAfter(s);if(!l||l==n)return null;if(!l.type.isSkipped){if(l.from>=o)return null;let u=/^ */.exec(a.text.slice(r.to-a.from))[0].length;return{from:r.from,to:r.to+u}}s=l.to}}function JR({closing:t,align:e=!0,units:r=1}){return n=>s4t(n,e,r,t)}function s4t(t,e,r,n,i){let a=t.textAfter,o=a.match(/^\s*/)[0].length,s=n&&a.slice(o,o+n.length)==n||i==t.pos+o,l=e?Fbn(t):null;return l?s?t.column(l.from):t.column(l.to):t.baseIndent+(s?0:t.unit*r)}const zbn=t=>t.baseIndent;function e4({except:t,units:e=1}={}){return r=>{let n=t&&t.test(r.textAfter);return r.baseIndent+(n?0:e*r.unit)}}const Ubn=200;function Vbn(){return ei.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+Ubn)return t;let a=r.sliceString(i.from,n);if(!e.some(u=>u.test(a)))return t;let{state:o}=t,s=-1,l=[];for(let{head:u}of o.selection.ranges){let h=o.doc.lineAt(u);if(h.from==s)continue;s=h.from;let d=Qwe(o,h.from);if(d==null)continue;let f=/^\s*/.exec(h.text)[0],p=U$(o,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 l4t=vr.define(),x1=new _n;function V$(t){let e=t.firstChild,r=t.lastChild;return e&&e.tor)continue;if(a&&s.from=e&&u.to>r&&(a=u)}}return a}function Gbn(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function aZ(t,e,r){for(let n of t.facet(l4t)){let i=n(t,e,r);if(i)return i}return Qbn(t,e,r)}function c4t(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 oZ=on.define({map:c4t}),Q$=on.define({map:c4t});function u4t(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 gC=Ko.define({create(){return Ar.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,i)=>t=h4t(t,n,i)),t=t.map(e.changes);let r=[];for(let n of e.effects)n.is(oZ)&&!Hbn(t,n.value.from,n.value.to)?r.push(n.value):n.is(Q$)&&(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(p4t),i=r.map(a=>(n?Ar.replace({widget:new Xbn(n(e.state,a))}):v4t).range(a.from,a.to));t=t.update({add:i})}return e.selection&&(t=h4t(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 sZ(t,e,r){var n;let i=null;return(n=t.field(gC,!1))===null||n===void 0||n.between(e,r,(a,o)=>{(!i||i.from>a)&&(i={from:a,to:o})}),i}function Hbn(t,e,r){let n=!1;return t.between(e,e,(i,a)=>{i==e&&a==r&&(n=!0)}),n}function d4t(t,e){return t.field(gC,!1)?e:e.concat(on.appendConfig.of(g4t()))}const Wbn=t=>{for(let e of u4t(t)){let r=aZ(t.state,e.from,e.to);if(r)return t.dispatch({effects:d4t(t.state,[oZ.of(r),f4t(t,r)])}),!0}return!1},Ybn=t=>{if(!t.state.field(gC,!1))return!1;let e=[];for(let r of u4t(t)){let n=sZ(t.state,r.from,r.to);n&&e.push(Q$.of(n),f4t(t,n,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function f4t(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 qbn=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Wbn},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Ybn},{key:"Ctrl-Alt-[",run:t=>{let{state:e}=t,r=[];for(let n=0;n{let e=t.state.field(gC,!1);if(!e||!e.size)return!1;let r=[];return e.between(0,t.state.doc.length,(n,i)=>{r.push(Q$.of({from:n,to:i}))}),t.dispatch({effects:r}),!0}}],jbn={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},p4t=vr.define({combine(t){return E0(t,jbn)}});function g4t(t){return[gC,Jbn]}function m4t(t,e){let{state:r}=t,n=r.facet(p4t),i=o=>{let s=t.lineBlockAt(t.posAtDOM(o.target)),l=sZ(t.state,s.from,s.to);l&&t.dispatch({effects:Q$.of(l)}),o.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 v4t=Ar.replace({widget:new class extends Hu{toDOM(t){return m4t(t,null)}}});class Xbn extends Hu{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return m4t(e,this.value)}}const Kbn={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Hwe extends wp{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 Zbn(t={}){let e={...Kbn,...t},r=new Hwe(e,!0),n=new Hwe(e,!1),i=Ro.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(y1)!=o.state.facet(y1)||o.startState.field(gC,!1)!=o.state.field(gC,!1)||wa(o.startState)!=wa(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let s=new Qu;for(let l of o.viewportLineBlocks){let u=sZ(o.state,l.from,l.to)?n:aZ(o.state,l.from,l.to)?r:null;u&&s.add(l.from,l.from,u)}return s.finish()}}),{domEventHandlers:a}=e;return[i,Iwe({class:"cm-foldGutter",markers(o){var s;return((s=o.plugin(i))===null||s===void 0?void 0:s.markers)||ti.empty},initialSpacer(){return new Hwe(e,!1)},domEventHandlers:{...a,click:(o,s,l)=>{if(a.click&&a.click(o,s,l))return!0;let u=sZ(o.state,s.from,s.to);if(u)return o.dispatch({effects:Q$.of(u)}),!0;let h=aZ(o.state,s.from,s.to);return h?(o.dispatch({effects:oZ.of(h)}),!0):!1}}}),g4t()]}const Jbn=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 G${constructor(e,r){this.specs=e;let n;function i(s){let l=d1.newName();return(n||(n=Object.create(null)))["."+l]=s,l}const a=typeof r.all=="string"?r.all:r.all?i(r.all):void 0,o=r.scope;this.scope=o instanceof ef?s=>s.prop(M2)==o.data:o?s=>s==o:void 0,this.style=JRt(e.map(s=>({tag:s.tag,class:s.class||i(Object.assign({},s,{tag:null}))})),{all:a}).style,this.module=n?new d1(n):null,this.themeType=r.themeType}static define(e,r){return new G$(e,r||{})}}const Wwe=vr.define(),y4t=vr.define({combine(t){return t.length?[t[0]]:null}});function lZ(t){let e=t.facet(Wwe);return e.length?e:t.facet(y4t)}function b4t(t,e){let r=[rxn],n;return t instanceof G$&&(t.module&&r.push(er.styleModule.of(t.module)),n=t.themeType),e!=null&&e.fallback?r.push(y4t.of(t)):n?r.push(Wwe.computeN([er.darkTheme],i=>i.facet(er.darkTheme)==(n=="dark")?[t]:[])):r.push(Wwe.of(t)),r}function exn(t,e,r){let n=lZ(t),i=null;if(n){for(let a of n)if(!a.scope||r){let o=a.style(e);o&&(i=i?i+" "+o:o)}}return i}class txn{constructor(e){this.markCache=Object.create(null),this.tree=wa(e.state),this.decorations=this.buildDeco(e,lZ(e.state)),this.decoratedTo=e.viewport.to}update(e){let r=wa(e.state),n=lZ(e.state),i=n!=lZ(e.startState),{viewport:a}=e.view,o=e.changes.mapPos(this.decoratedTo,1);r.length=a.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(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 Qu;for(let{from:i,to:a}of e.visibleRanges)e4t(this.tree,r,(o,s,l)=>{n.add(o,s,this.markCache[l]||(this.markCache[l]=Ar.mark({class:l})))},i,a);return n.finish()}}const rxn=Zd.high(Ro.fromClass(txn,{decorations:t=>t.decorations})),nxn=G$.define([{tag:Re.meta,color:"#404740"},{tag:Re.link,textDecoration:"underline"},{tag:Re.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Re.emphasis,fontStyle:"italic"},{tag:Re.strong,fontWeight:"bold"},{tag:Re.strikethrough,textDecoration:"line-through"},{tag:Re.keyword,color:"#708"},{tag:[Re.atom,Re.bool,Re.url,Re.contentSeparator,Re.labelName],color:"#219"},{tag:[Re.literal,Re.inserted],color:"#164"},{tag:[Re.string,Re.deleted],color:"#a11"},{tag:[Re.regexp,Re.escape,Re.special(Re.string)],color:"#e40"},{tag:Re.definition(Re.variableName),color:"#00f"},{tag:Re.local(Re.variableName),color:"#30a"},{tag:[Re.typeName,Re.namespace],color:"#085"},{tag:Re.className,color:"#167"},{tag:[Re.special(Re.variableName),Re.macroName],color:"#256"},{tag:Re.definition(Re.propertyName),color:"#00c"},{tag:Re.comment,color:"#940"},{tag:Re.invalid,color:"#f00"}]),ixn=er.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),x4t=1e4,w4t="()[]{}",A4t=vr.define({combine(t){return E0(t,{afterCursor:!0,brackets:w4t,maxScanDistance:x4t,renderMatch:sxn})}}),axn=Ar.mark({class:"cm-matchingBracket"}),oxn=Ar.mark({class:"cm-nonmatchingBracket"});function sxn(t){let e=[],r=t.matched?axn:oxn;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 S4t(t){let e=[],r=t.facet(A4t);for(let n of t.selection.ranges){if(!n.empty)continue;let i=N0(t,n.head,-1,r)||n.head>0&&N0(t,n.head-1,1,r)||r.afterCursor&&(N0(t,n.head,1,r)||n.headt.decorations}),ixn];function cxn(t={}){return[A4t.of(t),lxn]}const T4t=new _n;function Ywe(t,e,r){let n=t.prop(e<0?_n.openedBy:_n.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 qwe(t){let e=t.type.prop(T4t);return e?e(t.node):t}function N0(t,e,r,n={}){let i=n.maxScanDistance||x4t,a=n.brackets||w4t,o=wa(t),s=o.resolveInner(e,r);for(let l=s;l;l=l.parent){let u=Ywe(l.type,r,a);if(u&&l.from0?e>=h.from&&eh.from&&e<=h.to))return uxn(t,e,r,l,h,u,a)}}return hxn(t,e,r,o,s.type,i,a)}function uxn(t,e,r,n,i,a,o){let s=n.parent,l={from:i.from,to:i.to},u=0,h=s==null?void 0:s.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=o.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 C4t(t,e,r,n=0,i=0){e==null&&(e=t.search(/[^\s\u00a0]/),e==-1&&(e=t.length));let a=i;for(let o=n;o=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?o.toLowerCase():o,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 dxn(t){return{name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>!0),copyState:t.copyState||fxn,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||Kwe,mergeTokens:t.mergeTokens!==!1}}function fxn(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 k4t=new WeakMap;class jwe extends ef{constructor(e){let r=rZ(e.languageData),n=dxn(e),i,a=new class extends fK{createParse(o,s,l){return new gxn(i,o,s,l)}};super(r,a,[],e.name),this.topNode=yxn(r,this),i=this,this.streamParser=n,this.stateAfter=new _n({perNode:!0}),this.tokenTable=e.tokenTable?new M4t(n.tokenTable):vxn}static define(e){return new jwe(e)}getIndent(e){let r,{overrideIndentation:n}=e.options;n&&(r=k4t.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 o=e.children.length-1;o>=0;o--){let s=e.children[o],l=r+e.positions[o],u=s instanceof ci&&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 o=e.positions[a],s=e.children[a],l;if(or&&Xwe(t,a.tree,0-a.offset,r,s),u;if(l&&l.pos<=n&&(u=E4t(t,a.tree,r+a.offset,l.pos+a.offset,!1)))return{state:l.state,tree:u}}return{state:t.streamParser.startState(i?pC(i):4),tree:ci.empty}}let gxn=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=fC.get(),o=i[0].from,{state:s,tree:l}=pxn(e,n,o,this.to,a==null?void 0:a.state);this.state=s,this.parsedPos=this.chunkStart=o+l.length;for(let u=0;uu.from<=a.viewport.from&&u.to>=a.viewport.from)&&(this.state=this.lang.streamParser.startState(pC(a.state)),a.skipUntilInView(this.parsedPos,a.viewport.from),this.parsedPos=a.viewport.from),this.moveRangeIndex()}advance(){let e=fC.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 o=this.ranges[i].from,s=this.lineAfter(o);r+=s,n=o+s.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 o=this.ranges[++this.rangeIndex].from;r+=o-i}return r}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){i=this.skipGapsTo(r,i,1),r+=i;let s=this.chunk.length;i=this.skipGapsTo(n,i,-1),n+=i,a+=this.chunk.length-s}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&a==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==r?this.chunk[o+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,o=new T4t(r,e?e.state.tabSize:4,e?pC(e.state):2);if(o.eol())a.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let s=k4t(a.token,o,this.state);if(s&&(i=this.emitToken(this.lang.tokenTable.resolve(s),this.parsedPos+o.start,this.parsedPos+o.pos,i)),o.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPose.start)return i}throw new Error("Stream parser failed to advance stream.")}const Kwe=Object.create(null),H$=[zs.none],pxn=new NR(H$),E4t=[],_4t=Object.create(null),R4t=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"]])R4t[t]=L4t(Kwe,e);class D4t{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),R4t)}resolve(e){return e?this.table[e]||(this.table[e]=L4t(this.extra,e)):0}}const gxn=new D4t(Kwe);function Zwe(t,e){E4t.indexOf(t)>-1||(E4t.push(t),console.warn(e))}function L4t(t,e){let r=[];for(let s of e.split(" ")){let l=[];for(let u of s.split(".")){let h=t[u]||Re[u];h?typeof h=="function"?l.length?l=l.map(h):Zwe(u,`Modifier ${u} used at start of tag`):l.length?Zwe(u,`Tag ${u} used as modifier`):l=Array.isArray(h)?h:[h]:Zwe(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(s=>s.id),a=_4t[i];if(a)return a.id;let o=_4t[i]=zs.define({id:H$.length,name:n,props:[m1({[n]:r})]});return H$.push(o),o.id}function mxn(t,e){let r=zs.define({id:H$.length,name:"Document",props:[M2.add(()=>t),b1.add(()=>n=>e.getIndent(n))],top:!0});return H$.push(r),r}Ra.RTL,Ra.LTR;let vxn=class KMe{constructor(e,r,n,i,a,o,s,l,u,h=0,d){this.p=e,this.stack=r,this.state=n,this.reducePos=i,this.pos=a,this.score=o,this.buffer=s,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 KMe(e,[],r,n,n,0,[],0,i?new M4t(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,o=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[o-4]==0&&this.buffer[o-1]>-1){if(r==n)return;if(this.buffer[o-2]>=r){this.buffer[o-2]=n;return}}}if(!a||this.pos==n)this.buffer.push(e,r,n,i);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let s=!1;for(let l=o;l>0&&this.buffer[l-2]>n;l-=4)if(this.buffer[l-1]>=0){s=!0;break}if(s)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,i>4&&(i-=4)}this.buffer[o]=e,this.buffer[o+1]=r,this.buffer[o+2]=n,this.buffer[o+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:o}=this.p;this.pos=i;let s=o.stateFlag(a,1);!s&&(i>n||r<=o.maxNode)&&(this.reducePos=i),this.pushState(a,s?n:Math.min(n,this.reducePos)),this.shiftContext(r,n),r<=o.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 KMe(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 yxn(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,o;al&1&&s==o)||i.push(r[a],o)}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 o=this.findForcedReduction();if(o==null)return!1;r=o}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,o=>{if(!(o&393216))if(o&65536){let s=(o>>19)-a;if(s>1){let l=o&65535,u=this.stack.length-s*3;if(u>=0&&e.getGoto(this.stack[u],l,!1)>=0)return s<<19|65536|l}}else{let s=n(o,a+1);if(s!=null)return s}})};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 M4t{constructor(e,r){this.tracker=e,this.context=r,this.hash=e.strict?e.hash(r):0}}class yxn{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 cZ{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 cZ(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 cZ(this.stack,this.pos,this.index)}}function W$(t,e=Uint16Array){if(typeof t!="string")return t;let r=null;for(let n=0,i=0;n=92&&o--,o>=34&&o--;let l=o-32;if(l>=46&&(l-=46,s=!0),a+=l,s)break;a*=46}r?r[i++]=a:r=new e(a)}return r}class uZ{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const I4t=new uZ;class bxn{constructor(e,r){this.input=e,this.ranges=r,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=I4t,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 o=this.ranges[++i];a+=o.from-n.to,n=o}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&&ns.to&&(this.chunk2=this.chunk2.slice(0,s.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=I4t,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 t4{constructor(e,r){this.data=e,this.id=r}token(e,r){let{parser:n}=r.p;P4t(this.data,e,r,this.id,n.data,n.tokenPrecTable)}}t4.prototype.contextual=t4.prototype.fallback=t4.prototype.extend=!1;class hZ{constructor(e,r,n){this.precTable=r,this.elseToken=n,this.data=typeof e=="string"?W$(e):e}token(e,r){let n=e.pos,i=0;for(;;){let a=e.next<0,o=e.resolveOffset(1,1);if(P4t(this.data,e,r,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(a||i++,o==null)break;e.reset(o,e.token)}i&&(e.reset(n,e.token),e.acceptToken(this.elseToken,i))}}hZ.prototype.contextual=t4.prototype.fallback=t4.prototype.extend=!1;class xs{constructor(e,r={}){this.token=e,this.contextual=!!r.contextual,this.fallback=!!r.fallback,this.extend=!!r.extend}}function P4t(t,e,r,n,i,a){let o=0,s=1<0){let g=t[p];if(l.allows(g)&&(e.token.value==-1||e.token.value==g||xxn(g,e.token.value,i,a))){e.acceptToken(g);break}}let h=e.next,d=0,f=t[o+2];if(e.next<0&&f>d&&t[u+f*3-3]==65535){o=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{o=t[g+2],e.advance();continue e}}break}}function N4t(t,e,r){for(let n=e,i;(i=t[n])!=65535;n++)if(i==r)return n-e;return-1}function xxn(t,e,r,n){let i=N4t(r,n,e);return i<0||N4t(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 wxn=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?B4t(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?B4t(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(a instanceof ci){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(a),this.start.push(o),this.index.push(0))}else this.index[r]++,this.nextStart=o+a.length}}};class Axn{constructor(e,r){this.stream=r,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new uZ)}getActions(e){let r=0,n=null,{parser:i}=e.p,{tokenizers:a}=i,o=i.stateSlot(e.state,3),s=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 uZ,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 uZ,{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 o=0;o=0&&n.p.parser.dialect.allows(s>>1)){s&1?e.extended=s>>1:e.value=s>>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 wxn(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[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;or)n.push(s);else{if(this.advanceStack(s,n,e))continue;{i||(i=[],a=[]),i.push(s);let l=this.tokens.getMainToken(s);a.push(l.value,l.end)}}break}}if(!n.length){let o=i&&Cxn(i);if(o)return tf&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw tf&&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 o=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,a,n);if(o)return tf&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((s,l)=>l.score-s.score);n.length>o;)n.pop();n.some(s=>s.reducePos>r)&&this.recovering--}else if(n.length>1){e:for(let o=0;o500&&u.buffer.length>500)if((s.score-u.score||s.buffer.length-u.buffer.length)>0)n.splice(l--,1);else{n.splice(o--,1);continue e}}}n.length>12&&(n.sort((o,s)=>s.score-o.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let o=1;o ":"";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(_n.contextHash)||0)==h))return e.useNode(d,f),tf&&console.log(o+this.stackID(e)+` (via reuse of ${a.getName(d.type.id)})`),!0;if(!(d instanceof ci)||d.children.length==0||d.positions[0]>0)break;let p=d.children[0];if(p instanceof ci&&d.positions[0]==0)d=p;else break}}let s=a.stateSlot(e.state,4);if(s>0)return e.reduce(s),tf&&console.log(o+this.stackID(e)+` (via always-reduce ${a.getName(s&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 $4t(e,r),!0}}runRecovery(e,r,n){let i=null,a=!1;for(let o=0;o ":"";if(s.deadEnd&&(a||(a=!0,s.restart(),tf&&console.log(h+this.stackID(s)+" (restarted)"),this.advanceFully(s,n))))continue;let d=s.split(),f=h;for(let p=0;p<10&&d.forceReduce()&&(tf&&console.log(f+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,n));p++)tf&&(f=this.stackID(d)+" -> ");for(let p of s.recoverByInsert(l))tf&&console.log(h+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,n);this.stream.end>s.pos?(u==s.pos&&(u++,l=0),s.recoverByDelete(l,u),tf&&console.log(h+this.stackID(s)+` (via recover-delete ${this.parser.getName(l)})`),$4t(s,n)):(!i||i.scoret;class dZ{constructor(e){this.start=e.start,this.shift=e.shift||eAe,this.reduce=e.reduce||eAe,this.reuse=e.reuse||eAe,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class w1 extends fK{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 s=0;se.topRules[s][1]),i=[];for(let s=0;s=0)a(h,l,s[u++]);else{let d=s[u+-h];for(let f=-h;f>0;f--)a(s[u++],l,d);u++}}}this.nodeSet=new NR(r.map((s,l)=>zs.define({name:l>=this.minRepeatTerm?void 0:s,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=h_t;let o=W$(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let s=0;stypeof s=="number"?new t4(o,s):s),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 Sxn(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 o=i[a++],s=o&1,l=i[a++];if(s&&n)return l;for(let u=a+(o>>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=A1(this.data,a+2);else break;i=r(A1(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=A1(this.data,n+2);else break;if(!(this.data[n+2]&1)){let i=this.data[n+1];r.some((a,o)=>o&1&&a==i)||r.push(this.data[n],i)}}return r}configure(e){let r=Object.assign(Object.create(w1.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(s=>s.from==n.external);if(!a)return n;let o=Object.assign(Object.assign({},n),{external:a.to});return r.specializers[i]=F4t(o),o})),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 o=r.indexOf(a);o>=0&&(n[o]=!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 Oxn=316,kxn=317,z4t=1,Exn=2,_xn=3,Rxn=4,Dxn=318,Lxn=320,Mxn=321,Ixn=5,Pxn=6,Nxn=0,tAe=[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],U4t=125,Bxn=59,rAe=47,$xn=42,Fxn=43,zxn=45,Uxn=60,Vxn=44,Qxn=63,Gxn=46,Hxn=91,Wxn=new dZ({start:!1,shift(t,e){return e==Ixn||e==Pxn||e==Lxn?t:e==Mxn},strict:!1}),Yxn=new xs((t,e)=>{let{next:r}=t;(r==U4t||r==-1||e.context)&&t.acceptToken(Dxn)},{contextual:!0,fallback:!0}),qxn=new xs((t,e)=>{let{next:r}=t,n;tAe.indexOf(r)>-1||r==rAe&&((n=t.peek(1))==rAe||n==$xn)||r!=U4t&&r!=Bxn&&r!=-1&&!e.context&&t.acceptToken(Oxn)},{contextual:!0}),jxn=new xs((t,e)=>{t.next==Hxn&&!e.context&&t.acceptToken(kxn)},{contextual:!0}),Xxn=new xs((t,e)=>{let{next:r}=t;if(r==Fxn||r==zxn){if(t.advance(),r==t.next){t.advance();let n=!e.context&&e.canShift(z4t);t.acceptToken(n?z4t:Exn)}}else r==Qxn&&t.peek(1)==Gxn&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(_xn))},{contextual:!0});function nAe(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const Kxn=new xs((t,e)=>{if(t.next!=Uxn||!e.dialectEnabled(Nxn)||(t.advance(),t.next==rAe))return;let r=0;for(;tAe.indexOf(t.next)>-1;)t.advance(),r++;if(nAe(t.next,!0)){for(t.advance(),r++;nAe(t.next,!1);)t.advance(),r++;for(;tAe.indexOf(t.next)>-1;)t.advance(),r++;if(t.next==Vxn)return;for(let n=0;;n++){if(n==7){if(!nAe(t.next,!0))return;break}if(t.next!="extends".charCodeAt(n))break;t.advance(),r++}}t.acceptToken(Rxn,-r)}),Zxn=m1({"get set async static":Re.modifier,"for while do if else switch try catch finally return throw break continue default case defer":Re.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":Re.operatorKeyword,"let var const using function class extends":Re.definitionKeyword,"import export from":Re.moduleKeyword,"with debugger new":Re.keyword,TemplateString:Re.special(Re.string),super:Re.atom,BooleanLiteral:Re.bool,this:Re.self,null:Re.null,Star:Re.modifier,VariableName:Re.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":Re.function(Re.variableName),VariableDefinition:Re.definition(Re.variableName),Label:Re.labelName,PropertyName:Re.propertyName,PrivatePropertyName:Re.special(Re.propertyName),"CallExpression/MemberExpression/PropertyName":Re.function(Re.propertyName),"FunctionDeclaration/VariableDefinition":Re.function(Re.definition(Re.variableName)),"ClassDeclaration/VariableDefinition":Re.definition(Re.className),"NewExpression/VariableName":Re.className,PropertyDefinition:Re.definition(Re.propertyName),PrivatePropertyDefinition:Re.definition(Re.special(Re.propertyName)),UpdateOp:Re.updateOperator,"LineComment Hashbang":Re.lineComment,BlockComment:Re.blockComment,Number:Re.number,String:Re.string,Escape:Re.escape,ArithOp:Re.arithmeticOperator,LogicOp:Re.logicOperator,BitOp:Re.bitwiseOperator,CompareOp:Re.compareOperator,RegExp:Re.regexp,Equals:Re.definitionOperator,Arrow:Re.function(Re.punctuation),": Spread":Re.punctuation,"( )":Re.paren,"[ ]":Re.squareBracket,"{ }":Re.brace,"InterpolationStart InterpolationEnd":Re.special(Re.brace),".":Re.derefOperator,", ;":Re.separator,"@":Re.meta,TypeName:Re.typeName,TypeDefinition:Re.definition(Re.typeName),"type enum interface implements namespace module declare":Re.definitionKeyword,"abstract global Privacy readonly override":Re.modifier,"is keyof unique infer asserts":Re.operatorKeyword,JSXAttributeValue:Re.attributeValue,JSXText:Re.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":Re.angleBracket,"JSXIdentifier JSXNameSpacedName":Re.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":Re.attributeName,"JSXBuiltin/JSXIdentifier":Re.standard(Re.tagName)}),Jxn={__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},e2n={__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},t2n={__proto__:null,"<":193},r2n=w1.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:Wxn,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:[Zxn],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:[qxn,jxn,Xxn,Kxn,2,3,4,5,6,7,8,9,10,11,12,13,14,Yxn,new hZ("$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 hZ("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=>Jxn[t]||-1},{term:343,get:t=>e2n[t]||-1},{term:95,get:t=>t2n[t]||-1}],tokenPrec:15201});class iAe{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=wa(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(H4t(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 V4t(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 n2n(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+$/]:n2n(e);return i=>{let a=i.matchBefore(n);return a||i.explicit?{from:a?a.from:i.pos,options:e,validFor:r}:null}}function Q4t(t,e){return r=>{for(let n=wa(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 G4t=class{constructor(e,r,n,i){this.completion=e,this.source=r,this.match=n,this.score=i}};function mC(t){return t.selection.main.from}function H4t(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 oAe=k0.define();function i2n(t,e,r,n){let{main:i}=t.selection,a=r-i.from,o=n-i.from;return{...t.changeByRange(s=>{if(s!=i&&r!=n&&t.sliceDoc(s.from+a,s.from+o)!=t.sliceDoc(r,n))return{range:s};let l=t.toText(e);return{changes:{from:s.from+a,to:n==i.from?s.to:s.from+o,insert:l},range:xt.cursor(s.from+a+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const W4t=new WeakMap;function a2n(t){if(!Array.isArray(t))return t;let e=W4t.get(t);return e||W4t.set(t,e=aAe(t)),e}const fZ=on.define(),Y$=on.define();class o2n{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=T2e(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)?o[d++]=b:o.length&&(y=!1)),w=T,b+=C0(A)}return d==l&&o[0]==0&&y?this.result(-100+(f?-200:0),o,e):p==l&&g==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):s>-1?this.ret(-700-e.length,[s,s+this.pattern.length]):p==l?this.ret(-900-e.length,[g,m]):d==l?this.result(-100+(f?-200:0)+-700+(y?0:-1100),o,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 o of r){let s=o+(this.astral?C0(Yh(n,o)):1);a&&i[a-1]==o?i[a-1]=s:(i[a++]=o,i[a++]=s)}return this.ret(e-n.length,i)}}class s2n{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:l2n,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=>Y4t(e(n),r(n)),optionClass:(e,r)=>n=>Y4t(e(n),r(n)),addToOptions:(e,r)=>e.concat(r),filterStrict:(e,r)=>e||r})}});function Y4t(t,e){return t?e?t+" "+e:t:e}function l2n(t,e,r,n,i,a){let o=t.textDirection==Ra.RTL,s=o,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(s&&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?o?"left-narrow":"right-narrow":s?"left":"right")}}const sAe=on.define();function c2n(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 o=document.createElement("span");o.className="cm-completionLabel";let s=r.displayLabel||r.label,l=0;for(let u=0;ul&&o.appendChild(document.createTextNode(s.slice(l,h)));let f=o.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(s.slice(h,d))),f.className="cm-completionMatchedText",l=d}return lr.position-n.position).map(r=>r.render)}function lAe(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 u2n{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:o}=i.open,s=e.state.facet(Vl);this.optionContent=c2n(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=lAe(a.length,o,s.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:sAe.of(h)}),l.preventDefault())}}),this.dom.addEventListener("focusout",l=>{let u=e.state.field(this.stateField,!1);u&&u.tooltip&&e.state.facet(Vl).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:Y$.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:o,disabled:s}=n.open;(!i.open||i.open.options!=a)&&(this.range=lAe(a.length,o,e.state.facet(Vl).maxRenderedOptions),this.showOptions(a,n.id)),this.updateSel(),s!=((r=i.open)===null||r===void 0?void 0:r.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!s)}}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=lAe(r.options.length,r.selected,this.view.state.facet(Vl).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 o=typeof a=="string"?document.createTextNode(a):a(i);if(!o)return;"then"in o?o.then(s=>{s&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(s,i)}).catch(s=>qh(this.view.state,s,"completion info")):(this.addInfoPane(o,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&&d2n(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 o=this.dom.ownerDocument.documentElement;a={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return i.top>Math.min(a.bottom,r.bottom)-10||i.bottom{o.target==i&&o.preventDefault()});let a=null;for(let o=n.from;on.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+"-"+o,h.setAttribute("role","option");let d=this.optionClass(s);d&&(h.className=d);for(let f of this.optionContent){let p=f(s,this.view.state,this.view,l);p&&h.appendChild(p)}}return n.from&&i.classList.add("cm-completionListIncompleteTop"),n.tonew u2n(r,t,e)}function d2n(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 q4t(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function f2n(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)}},o=e.facet(Vl);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 G4t(f,h.source,d?d(f):[],1e9-r.length));else{let f=e.sliceDoc(h.from,h.to),p,g=o.filterStrict?new s2n(f):new o2n(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 G4t(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?s.push(h):q4t(h.completion)>q4t(l)&&(s[s.length-1]=h),l=h.completion}return s}class r4{constructor(e,r,n,i,a,o){this.options=e,this.attrs=r,this.tooltip=n,this.timestamp=i,this.selected=a,this.disabled=o}setSelected(e,r){return e==this.selected||e>=this.options.length?this:new r4(this.options,j4t(r,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,r,n,i,a,o){if(i&&!o&&e.some(u=>u.isPending))return i.setDisabled();let s=f2n(e,r);if(!s.length)return i&&e.some(u=>u.isPending)?i.setDisabled():null;let l=r.facet(Vl).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:b2n,above:a.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(e){return new r4(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new r4(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class pZ{constructor(e,r,n){this.active=e,this.id=r,this.open=n}static start(){return new pZ(v2n,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:r}=e,n=r.facet(Vl),a=(n.override||r.languageDataAt("autocomplete",mC(r)).map(a2n)).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 o=this.open,s=e.effects.some(l=>l.is(cAe));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||a.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!p2n(a,this.active)||s?o=r4.build(a,r,this.id,o,n,s):o&&o.disabled&&!a.some(l=>l.isPending)&&(o=null),!o&&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(sAe)&&(o=o&&o.setSelected(l.value,this.id));return a==this.active&&o==this.open?this:new pZ(a,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?g2n:m2n}}function p2n(t,e){if(t==e)return!0;for(let r=0,n=0;;){for(;r-1&&(r["aria-activedescendant"]=t+"-"+e),r}const v2n=[];function X4t(t,e){if(t.isUserEvent("input.complete")){let n=t.annotation(oAe);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=X4t(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(fZ))i=new Ap(i.source,1,a.value);else if(a.is(Y$))i=new Ap(i.source,0);else if(a.is(cAe))for(let o of a.value)o.source==i.source&&(i=o);return i}updateFor(e,r){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(mC(e.state))}}class n4 extends Ap{constructor(e,r,n,i,a,o){super(e,3,r),this.limit=n,this.result=i,this.from=a,this.to=o}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),o=e.changes.mapPos(this.to,1),s=mC(e.state);if(s>o||!i||r&2&&(mC(e.startState)==this.from||sr.map(e))}}),Xh=Ko.define({create(){return pZ.start()},update(t,e){return t.update(e)},provide:t=>[Dwe.from(t,e=>e.tooltip),er.contentAttributes.from(t,e=>e.attrs)]});function uAe(t,e){const r=e.completion.apply||e.completion.label;let n=t.state.field(Xh).active.find(i=>i.source==e.source);return n instanceof n4?(typeof r=="string"?t.dispatch({...i2n(t.state,r,n.from,n.to),annotations:oAe.of(e.completion)}):r(t,e.completion,n.from,n.to),!0):!1}const b2n=h2n(Xh,uAe);function gZ(t,e="option"){return r=>{let n=r.state.field(Xh,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp-1?n.open.selected+i*(t?1:-1):t?0:o-1;return s<0?s=e=="page"?0:o-1:s>=o&&(s=e=="page"?o-1:0),r.dispatch({effects:sAe.of(s)}),!0}}const x2n=t=>{let e=t.state.field(Xh,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(Xh,!1)?(t.dispatch({effects:fZ.of(!0)}),!0):!1,w2n=t=>{let e=t.state.field(Xh,!1);return!e||!e.active.some(r=>r.state!=0)?!1:(t.dispatch({effects:Y$.of(null)}),!0)};class A2n{constructor(e,r){this.active=e,this.context=r,this.time=Date.now(),this.updates=[],this.done=void 0}}const S2n=50,T2n=1e3,C2n=Ro.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(Xh).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(Xh),r=t.state.facet(Vl);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Xh)==e)return;let n=t.transactions.some(a=>{let o=X4t(a,r);return o&8||(a.selection||a.docChanged)&&!(o&3)});for(let a=0;aS2n&&Date.now()-o.time>T2n){for(let s of o.context.abortListeners)try{s()}catch(l){qh(this.view.state,l)}o.context.abortListeners=null,this.running.splice(a--,1)}else o.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(a=>a.effects.some(o=>o.is(fZ)))&&(this.pendingStart=!0);let i=this.pendingStart?50:r.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(a=>a.isPending&&!this.running.some(o=>o.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(Xh);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(Vl).updateSyncTime))}startQuery(t){let{state:e}=this.view,r=mC(e),n=new iAe(e,r,t.explicit,this.view),i=new A2n(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:Y$.of(null)}),qh(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(Vl).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],r=this.view.state.facet(Vl),n=this.view.state.field(Xh);for(let i=0;is.source==a.active.source);if(o&&o.isPending)if(a.done==null){let s=new Ap(a.active.source,0);for(let l of a.updates)s=s.update(l,r);s.isPending||e.push(s)}else this.startQuery(o)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:cAe.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(Xh,!1);if(e&&e.tooltip&&this.view.state.facet(Vl).closeOnBlur){let r=e.open&&BRt(this.view,e.open.tooltip);(!r||!r.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Y$.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:fZ.of(!1)}),20),this.composing=0}}}),O2n=typeof navigator=="object"&&/Win/.test(navigator.platform),k2n=Zd.highest(er.domEventHandlers({keydown(t,e){let r=e.state.field(Xh,!1);if(!r||!r.open||r.open.disabled||r.open.selected<0||t.key.length>1||t.ctrlKey&&!(O2n&&t.altKey)||t.metaKey)return!1;let n=r.open.options[r.open.selected],i=r.active.find(o=>o.source==n.source),a=n.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(t.key)>-1&&uAe(e,n),!1}})),K4t=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 E2n{constructor(e,r,n,i){this.field=e,this.line=r,this.from=n,this.to=i}}class dAe{constructor(e,r,n){this.field=e,this.from=r,this.to=n}map(e){let r=e.mapPos(this.from,-1,xc.TrackDel),n=e.mapPos(this.to,1,xc.TrackDel);return r==null||n==null?null:new dAe(this.field,r,n)}}class fAe{constructor(e,r){this.lines=e,this.fieldPositions=r}instantiate(e,r){let n=[],i=[r],a=e.doc.lineAt(r),o=/^\s*/.exec(a.text)[0];for(let l of this.lines){if(n.length){let u=o,h=/^\t*/.exec(l)[0].length;for(let d=0;dnew dAe(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:n,ranges:s}}static parse(e){let r=[],n=[],i=[],a;for(let o of e.split(/\r\n?|\n/)){for(;a=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let s=a[1]?+a[1]:null,l=a[2]||a[3]||"",u=-1;s===0&&(s=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 E2n(u,n.length,a.index,a.index+h.length)),o=o.slice(0,a.index)+l+o.slice(a.index+a[0].length)}o=o.replace(/\\([{}])/g,(s,l,u)=>{for(let h of i)h.line==n.length&&h.from>u&&(h.from--,h.to--);return l}),n.push(o)}return new fAe(n,i)}}let _2n=Ar.widget({widget:new class extends Hu{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),R2n=Ar.mark({class:"cm-snippetField"});class i4{constructor(e,r){this.ranges=e,this.active=r,this.deco=Ar.set(e.map(n=>(n.from==n.to?_2n:R2n).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 i4(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 q$=on.define({map(t,e){return t&&t.map(e)}}),D2n=on.define(),j$=Ko.define({create(){return null},update(t,e){for(let r of e.effects){if(r.is(q$))return r.value;if(r.is(D2n)&&t)return new i4(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 pAe(t,e){return xt.create(t.filter(r=>r.field==e).map(r=>xt.range(r.from,r.to)))}function L2n(t){let e=fAe.parse(t);return(r,n,i,a)=>{let{text:o,ranges:s}=e.instantiate(r.state,i),{main:l}=r.state.selection,u={changes:{from:i,to:a==l.from?l.to:a,insert:wi.of(o)},scrollIntoView:!0,annotations:n?[oAe.of(n),Us.userEvent.of("input.complete")]:void 0};if(s.length&&(u.selection=pAe(s,0)),s.some(h=>h.field>0)){let h=new i4(s,0),d=u.effects=[q$.of(h)];r.state.field(j$,!1)===void 0&&d.push(on.appendConfig.of([j$,I2n,P2n,K4t]))}r.dispatch(r.state.update(u))}}function Z4t(t){return({state:e,dispatch:r})=>{let n=e.field(j$,!1);if(!n||t<0&&n.active==0)return!1;let i=n.active+t,a=t>0&&!n.ranges.some(o=>o.field==i+t);return r(e.update({selection:pAe(n.ranges,i),effects:q$.of(a?null:new i4(n.ranges,i)),scrollIntoView:!0})),!0}}const M2n=[{key:"Tab",run:Z4t(1),shift:Z4t(-1)},{key:"Escape",run:({state:t,dispatch:e})=>t.field(j$,!1)?(e(t.update({effects:q$.of(null)})),!0):!1}],J4t=vr.define({combine(t){return t.length?t[0]:M2n}}),I2n=Zd.highest(qR.compute([J4t],t=>t.facet(J4t)));function Do(t,e){return{...e,apply:L2n(t)}}const P2n=er.domEventHandlers({mousedown(t,e){let r=e.state.field(j$,!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:pAe(r.ranges,i.field),effects:q$.of(r.ranges.some(a=>a.field>i.field)?new i4(r.ranges,i.field):null),scrollIntoView:!0}),!0)}}),X$={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},vC=on.define({map(t,e){let r=e.mapPos(t,-1,xc.TrackAfter);return r??void 0}}),gAe=new class extends k2{};gAe.startSide=1,gAe.endSide=-1;const e3t=Ko.define({create(){return ti.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(vC)&&(t=t.update({add:[gAe.range(r.value,r.value+1)]}));return t}});function N2n(){return[$2n,e3t]}const mAe="()[]{}<>«»»«[]{}";function t3t(t){for(let e=0;e{if((B2n?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(n.length>2||n.length==2&&C0(Yh(n,0))==1||e!=i.from||r!=i.to)return!1;let a=z2n(t.state,n);return a?(t.dispatch(a),!0):!1}),F2n=[{key:"Backspace",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=r3t(t,t.selection.main.head).brackets||X$.brackets,i=null,a=t.changeByRange(o=>{if(o.empty){let s=U2n(t.doc,o.head);for(let l of n)if(l==s&&mZ(t.doc,o.head)==t3t(Yh(l,0)))return{changes:{from:o.head-l.length,to:o.head+l.length},range:xt.cursor(o.head-l.length)}}return{range:i=o}});return i||e(t.update(a,{scrollIntoView:!0,userEvent:"delete.backward"})),!i}}];function z2n(t,e){let r=r3t(t,t.selection.main.head),n=r.brackets||X$.brackets;for(let i of n){let a=t3t(Yh(i,0));if(e==i)return a==i?G2n(t,i,n.indexOf(i+i+i)>-1,r):V2n(t,i,a,r.before||X$.before);if(e==a&&n3t(t,t.selection.main.from))return Q2n(t,i,a)}return null}function n3t(t,e){let r=!1;return t.field(e3t).between(0,t.doc.length,n=>{n==e&&(r=!0)}),r}function mZ(t,e){let r=t.sliceString(e,e+2);return r.slice(0,C0(Yh(r,0)))}function U2n(t,e){let r=t.sliceString(e-2,e);return C0(Yh(r,0))==r.length?r:r.slice(1)}function V2n(t,e,r,n){let i=null,a=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:r,from:o.to}],effects:vC.of(o.to+e.length),range:xt.range(o.anchor+e.length,o.head+e.length)};let s=mZ(t.doc,o.head);return!s||/\s/.test(s)||n.indexOf(s)>-1?{changes:{insert:e+r,from:o.head},effects:vC.of(o.head+e.length),range:xt.cursor(o.head+e.length)}:{range:i=o}});return i?null:t.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function Q2n(t,e,r){let n=null,i=t.changeByRange(a=>a.empty&&mZ(t.doc,a.head)==r?{changes:{from:a.head,to:a.head+r.length,insert:r},range:xt.cursor(a.head+r.length)}:n={range:a});return n?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function G2n(t,e,r,n){let i=n.stringPrefixes||X$.stringPrefixes,a=null,o=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:e,from:s.to}],effects:vC.of(s.to+e.length),range:xt.range(s.anchor+e.length,s.head+e.length)};let l=s.head,u=mZ(t.doc,l),h;if(u==e){if(i3t(t,l))return{changes:{insert:e+e,from:l},effects:vC.of(l+e.length),range:xt.cursor(l+e.length)};if(n3t(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:xt.cursor(l+f.length)}}}else{if(r&&t.sliceDoc(l-2*e.length,l)==e+e&&(h=a3t(t,l-2*e.length,i))>-1&&i3t(t,h))return{changes:{insert:e+e+e+e,from:l},effects:vC.of(l+e.length),range:xt.cursor(l+e.length)};if(t.charCategorizer(l)(u)!=Ao.Word&&a3t(t,l,i)>-1&&!H2n(t,l,e,i))return{changes:{insert:e+e,from:l},effects:vC.of(l+e.length),range:xt.cursor(l+e.length)}}return{range:a=s}});return a?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function i3t(t,e){let r=wa(t).resolveInner(e+1);return r.parent&&r.from==e}function H2n(t,e,r,n){let i=wa(t).resolveInner(e,-1),a=n.reduce((o,s)=>Math.max(o,s.length),0);for(let o=0;o<5;o++){let s=t.sliceDoc(i.from,Math.min(i.to,i.from+r.length+a)),l=s.indexOf(r);if(!l||l>-1&&n.indexOf(s.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 a3t(t,e,r){let n=t.charCategorizer(e);if(n(t.sliceDoc(e-1,e))!=Ao.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))!=Ao.Word)return a}return-1}function W2n(t={}){return[k2n,Xh,Vl.of(t),C2n,Y2n,K4t]}const o3t=[{key:"Ctrl-Space",run:hAe},{mac:"Alt-`",run:hAe},{mac:"Alt-i",run:hAe},{key:"Escape",run:w2n},{key:"ArrowDown",run:gZ(!0)},{key:"ArrowUp",run:gZ(!1)},{key:"PageDown",run:gZ(!0,"page")},{key:"PageUp",run:gZ(!1,"page")},{key:"Enter",run:x2n}],Y2n=Zd.highest(qR.computeN([Vl],t=>t.facet(Vl).defaultKeymap?[o3t]:[])),s3t=[Do("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Do("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Do("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Do("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Do("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Do(`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 o=this.ranges[i].from,s=this.lineAfter(o);r+=s,n=o+s.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 o=this.ranges[++this.rangeIndex].from;r+=o-i}return r}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){i=this.skipGapsTo(r,i,1),r+=i;let s=this.chunk.length;i=this.skipGapsTo(n,i,-1),n+=i,a+=this.chunk.length-s}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&a==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==r?this.chunk[o+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,o=new O4t(r,e?e.state.tabSize:4,e?pC(e.state):2);if(o.eol())a.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let s=_4t(a.token,o,this.state);if(s&&(i=this.emitToken(this.lang.tokenTable.resolve(s),this.parsedPos+o.start,this.parsedPos+o.pos,i)),o.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPose.start)return i}throw new Error("Stream parser failed to advance stream.")}const Kwe=Object.create(null),H$=[zs.none],mxn=new NR(H$),R4t=[],D4t=Object.create(null),L4t=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"]])L4t[t]=I4t(Kwe,e);class M4t{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),L4t)}resolve(e){return e?this.table[e]||(this.table[e]=I4t(this.extra,e)):0}}const vxn=new M4t(Kwe);function Zwe(t,e){R4t.indexOf(t)>-1||(R4t.push(t),console.warn(e))}function I4t(t,e){let r=[];for(let s of e.split(" ")){let l=[];for(let u of s.split(".")){let h=t[u]||Re[u];h?typeof h=="function"?l.length?l=l.map(h):Zwe(u,`Modifier ${u} used at start of tag`):l.length?Zwe(u,`Tag ${u} used as modifier`):l=Array.isArray(h)?h:[h]:Zwe(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(s=>s.id),a=D4t[i];if(a)return a.id;let o=D4t[i]=zs.define({id:H$.length,name:n,props:[m1({[n]:r})]});return H$.push(o),o.id}function yxn(t,e){let r=zs.define({id:H$.length,name:"Document",props:[M2.add(()=>t),b1.add(()=>n=>e.getIndent(n))],top:!0});return H$.push(r),r}Ra.RTL,Ra.LTR;let bxn=class KMe{constructor(e,r,n,i,a,o,s,l,u,h=0,d){this.p=e,this.stack=r,this.state=n,this.reducePos=i,this.pos=a,this.score=o,this.buffer=s,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 KMe(e,[],r,n,n,0,[],0,i?new P4t(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,o=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[o-4]==0&&this.buffer[o-1]>-1){if(r==n)return;if(this.buffer[o-2]>=r){this.buffer[o-2]=n;return}}}if(!a||this.pos==n)this.buffer.push(e,r,n,i);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let s=!1;for(let l=o;l>0&&this.buffer[l-2]>n;l-=4)if(this.buffer[l-1]>=0){s=!0;break}if(s)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,i>4&&(i-=4)}this.buffer[o]=e,this.buffer[o+1]=r,this.buffer[o+2]=n,this.buffer[o+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:o}=this.p;this.pos=i;let s=o.stateFlag(a,1);!s&&(i>n||r<=o.maxNode)&&(this.reducePos=i),this.pushState(a,s?n:Math.min(n,this.reducePos)),this.shiftContext(r,n),r<=o.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 KMe(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 xxn(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,o;al&1&&s==o)||i.push(r[a],o)}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 o=this.findForcedReduction();if(o==null)return!1;r=o}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,o=>{if(!(o&393216))if(o&65536){let s=(o>>19)-a;if(s>1){let l=o&65535,u=this.stack.length-s*3;if(u>=0&&e.getGoto(this.stack[u],l,!1)>=0)return s<<19|65536|l}}else{let s=n(o,a+1);if(s!=null)return s}})};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 P4t{constructor(e,r){this.tracker=e,this.context=r,this.hash=e.strict?e.hash(r):0}}class xxn{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 cZ{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 cZ(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 cZ(this.stack,this.pos,this.index)}}function W$(t,e=Uint16Array){if(typeof t!="string")return t;let r=null;for(let n=0,i=0;n=92&&o--,o>=34&&o--;let l=o-32;if(l>=46&&(l-=46,s=!0),a+=l,s)break;a*=46}r?r[i++]=a:r=new e(a)}return r}class uZ{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const N4t=new uZ;class wxn{constructor(e,r){this.input=e,this.ranges=r,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=N4t,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 o=this.ranges[++i];a+=o.from-n.to,n=o}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&&ns.to&&(this.chunk2=this.chunk2.slice(0,s.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=N4t,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 t4{constructor(e,r){this.data=e,this.id=r}token(e,r){let{parser:n}=r.p;B4t(this.data,e,r,this.id,n.data,n.tokenPrecTable)}}t4.prototype.contextual=t4.prototype.fallback=t4.prototype.extend=!1;class hZ{constructor(e,r,n){this.precTable=r,this.elseToken=n,this.data=typeof e=="string"?W$(e):e}token(e,r){let n=e.pos,i=0;for(;;){let a=e.next<0,o=e.resolveOffset(1,1);if(B4t(this.data,e,r,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(a||i++,o==null)break;e.reset(o,e.token)}i&&(e.reset(n,e.token),e.acceptToken(this.elseToken,i))}}hZ.prototype.contextual=t4.prototype.fallback=t4.prototype.extend=!1;class xs{constructor(e,r={}){this.token=e,this.contextual=!!r.contextual,this.fallback=!!r.fallback,this.extend=!!r.extend}}function B4t(t,e,r,n,i,a){let o=0,s=1<0){let g=t[p];if(l.allows(g)&&(e.token.value==-1||e.token.value==g||Axn(g,e.token.value,i,a))){e.acceptToken(g);break}}let h=e.next,d=0,f=t[o+2];if(e.next<0&&f>d&&t[u+f*3-3]==65535){o=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{o=t[g+2],e.advance();continue e}}break}}function $4t(t,e,r){for(let n=e,i;(i=t[n])!=65535;n++)if(i==r)return n-e;return-1}function Axn(t,e,r,n){let i=$4t(r,n,e);return i<0||$4t(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 Sxn=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?F4t(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?F4t(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(a instanceof ci){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(a),this.start.push(o),this.index.push(0))}else this.index[r]++,this.nextStart=o+a.length}}};class Txn{constructor(e,r){this.stream=r,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new uZ)}getActions(e){let r=0,n=null,{parser:i}=e.p,{tokenizers:a}=i,o=i.stateSlot(e.state,3),s=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 uZ,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 uZ,{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 o=0;o=0&&n.p.parser.dialect.allows(s>>1)){s&1?e.extended=s>>1:e.value=s>>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 Sxn(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[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;or)n.push(s);else{if(this.advanceStack(s,n,e))continue;{i||(i=[],a=[]),i.push(s);let l=this.tokens.getMainToken(s);a.push(l.value,l.end)}}break}}if(!n.length){let o=i&&kxn(i);if(o)return tf&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw tf&&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 o=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,a,n);if(o)return tf&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((s,l)=>l.score-s.score);n.length>o;)n.pop();n.some(s=>s.reducePos>r)&&this.recovering--}else if(n.length>1){e:for(let o=0;o500&&u.buffer.length>500)if((s.score-u.score||s.buffer.length-u.buffer.length)>0)n.splice(l--,1);else{n.splice(o--,1);continue e}}}n.length>12&&(n.sort((o,s)=>s.score-o.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let o=1;o ":"";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(_n.contextHash)||0)==h))return e.useNode(d,f),tf&&console.log(o+this.stackID(e)+` (via reuse of ${a.getName(d.type.id)})`),!0;if(!(d instanceof ci)||d.children.length==0||d.positions[0]>0)break;let p=d.children[0];if(p instanceof ci&&d.positions[0]==0)d=p;else break}}let s=a.stateSlot(e.state,4);if(s>0)return e.reduce(s),tf&&console.log(o+this.stackID(e)+` (via always-reduce ${a.getName(s&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 z4t(e,r),!0}}runRecovery(e,r,n){let i=null,a=!1;for(let o=0;o ":"";if(s.deadEnd&&(a||(a=!0,s.restart(),tf&&console.log(h+this.stackID(s)+" (restarted)"),this.advanceFully(s,n))))continue;let d=s.split(),f=h;for(let p=0;p<10&&d.forceReduce()&&(tf&&console.log(f+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,n));p++)tf&&(f=this.stackID(d)+" -> ");for(let p of s.recoverByInsert(l))tf&&console.log(h+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,n);this.stream.end>s.pos?(u==s.pos&&(u++,l=0),s.recoverByDelete(l,u),tf&&console.log(h+this.stackID(s)+` (via recover-delete ${this.parser.getName(l)})`),z4t(s,n)):(!i||i.scoret;class dZ{constructor(e){this.start=e.start,this.shift=e.shift||eAe,this.reduce=e.reduce||eAe,this.reuse=e.reuse||eAe,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class w1 extends fK{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 s=0;se.topRules[s][1]),i=[];for(let s=0;s=0)a(h,l,s[u++]);else{let d=s[u+-h];for(let f=-h;f>0;f--)a(s[u++],l,d);u++}}}this.nodeSet=new NR(r.map((s,l)=>zs.define({name:l>=this.minRepeatTerm?void 0:s,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=f_t;let o=W$(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let s=0;stypeof s=="number"?new t4(o,s):s),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 Cxn(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 o=i[a++],s=o&1,l=i[a++];if(s&&n)return l;for(let u=a+(o>>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=A1(this.data,a+2);else break;i=r(A1(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=A1(this.data,n+2);else break;if(!(this.data[n+2]&1)){let i=this.data[n+1];r.some((a,o)=>o&1&&a==i)||r.push(this.data[n],i)}}return r}configure(e){let r=Object.assign(Object.create(w1.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(s=>s.from==n.external);if(!a)return n;let o=Object.assign(Object.assign({},n),{external:a.to});return r.specializers[i]=U4t(o),o})),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 o=r.indexOf(a);o>=0&&(n[o]=!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 Exn=316,_xn=317,V4t=1,Rxn=2,Dxn=3,Lxn=4,Mxn=318,Ixn=320,Pxn=321,Nxn=5,Bxn=6,$xn=0,tAe=[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],Q4t=125,Fxn=59,rAe=47,zxn=42,Uxn=43,Vxn=45,Qxn=60,Gxn=44,Hxn=63,Wxn=46,Yxn=91,qxn=new dZ({start:!1,shift(t,e){return e==Nxn||e==Bxn||e==Ixn?t:e==Pxn},strict:!1}),jxn=new xs((t,e)=>{let{next:r}=t;(r==Q4t||r==-1||e.context)&&t.acceptToken(Mxn)},{contextual:!0,fallback:!0}),Xxn=new xs((t,e)=>{let{next:r}=t,n;tAe.indexOf(r)>-1||r==rAe&&((n=t.peek(1))==rAe||n==zxn)||r!=Q4t&&r!=Fxn&&r!=-1&&!e.context&&t.acceptToken(Exn)},{contextual:!0}),Kxn=new xs((t,e)=>{t.next==Yxn&&!e.context&&t.acceptToken(_xn)},{contextual:!0}),Zxn=new xs((t,e)=>{let{next:r}=t;if(r==Uxn||r==Vxn){if(t.advance(),r==t.next){t.advance();let n=!e.context&&e.canShift(V4t);t.acceptToken(n?V4t:Rxn)}}else r==Hxn&&t.peek(1)==Wxn&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(Dxn))},{contextual:!0});function nAe(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const Jxn=new xs((t,e)=>{if(t.next!=Qxn||!e.dialectEnabled($xn)||(t.advance(),t.next==rAe))return;let r=0;for(;tAe.indexOf(t.next)>-1;)t.advance(),r++;if(nAe(t.next,!0)){for(t.advance(),r++;nAe(t.next,!1);)t.advance(),r++;for(;tAe.indexOf(t.next)>-1;)t.advance(),r++;if(t.next==Gxn)return;for(let n=0;;n++){if(n==7){if(!nAe(t.next,!0))return;break}if(t.next!="extends".charCodeAt(n))break;t.advance(),r++}}t.acceptToken(Lxn,-r)}),e2n=m1({"get set async static":Re.modifier,"for while do if else switch try catch finally return throw break continue default case defer":Re.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":Re.operatorKeyword,"let var const using function class extends":Re.definitionKeyword,"import export from":Re.moduleKeyword,"with debugger new":Re.keyword,TemplateString:Re.special(Re.string),super:Re.atom,BooleanLiteral:Re.bool,this:Re.self,null:Re.null,Star:Re.modifier,VariableName:Re.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":Re.function(Re.variableName),VariableDefinition:Re.definition(Re.variableName),Label:Re.labelName,PropertyName:Re.propertyName,PrivatePropertyName:Re.special(Re.propertyName),"CallExpression/MemberExpression/PropertyName":Re.function(Re.propertyName),"FunctionDeclaration/VariableDefinition":Re.function(Re.definition(Re.variableName)),"ClassDeclaration/VariableDefinition":Re.definition(Re.className),"NewExpression/VariableName":Re.className,PropertyDefinition:Re.definition(Re.propertyName),PrivatePropertyDefinition:Re.definition(Re.special(Re.propertyName)),UpdateOp:Re.updateOperator,"LineComment Hashbang":Re.lineComment,BlockComment:Re.blockComment,Number:Re.number,String:Re.string,Escape:Re.escape,ArithOp:Re.arithmeticOperator,LogicOp:Re.logicOperator,BitOp:Re.bitwiseOperator,CompareOp:Re.compareOperator,RegExp:Re.regexp,Equals:Re.definitionOperator,Arrow:Re.function(Re.punctuation),": Spread":Re.punctuation,"( )":Re.paren,"[ ]":Re.squareBracket,"{ }":Re.brace,"InterpolationStart InterpolationEnd":Re.special(Re.brace),".":Re.derefOperator,", ;":Re.separator,"@":Re.meta,TypeName:Re.typeName,TypeDefinition:Re.definition(Re.typeName),"type enum interface implements namespace module declare":Re.definitionKeyword,"abstract global Privacy readonly override":Re.modifier,"is keyof unique infer asserts":Re.operatorKeyword,JSXAttributeValue:Re.attributeValue,JSXText:Re.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":Re.angleBracket,"JSXIdentifier JSXNameSpacedName":Re.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":Re.attributeName,"JSXBuiltin/JSXIdentifier":Re.standard(Re.tagName)}),t2n={__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},r2n={__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},n2n={__proto__:null,"<":193},i2n=w1.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:qxn,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:[e2n],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:[Xxn,Kxn,Zxn,Jxn,2,3,4,5,6,7,8,9,10,11,12,13,14,jxn,new hZ("$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 hZ("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=>t2n[t]||-1},{term:343,get:t=>r2n[t]||-1},{term:95,get:t=>n2n[t]||-1}],tokenPrec:15201});class iAe{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=wa(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(Y4t(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 G4t(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 a2n(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+$/]:a2n(e);return i=>{let a=i.matchBefore(n);return a||i.explicit?{from:a?a.from:i.pos,options:e,validFor:r}:null}}function H4t(t,e){return r=>{for(let n=wa(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 W4t=class{constructor(e,r,n,i){this.completion=e,this.source=r,this.match=n,this.score=i}};function mC(t){return t.selection.main.from}function Y4t(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 oAe=k0.define();function o2n(t,e,r,n){let{main:i}=t.selection,a=r-i.from,o=n-i.from;return{...t.changeByRange(s=>{if(s!=i&&r!=n&&t.sliceDoc(s.from+a,s.from+o)!=t.sliceDoc(r,n))return{range:s};let l=t.toText(e);return{changes:{from:s.from+a,to:n==i.from?s.to:s.from+o,insert:l},range:xt.cursor(s.from+a+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const q4t=new WeakMap;function s2n(t){if(!Array.isArray(t))return t;let e=q4t.get(t);return e||q4t.set(t,e=aAe(t)),e}const fZ=on.define(),Y$=on.define();class l2n{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=T2e(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)?o[d++]=b:o.length&&(y=!1)),w=T,b+=C0(A)}return d==l&&o[0]==0&&y?this.result(-100+(f?-200:0),o,e):p==l&&g==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):s>-1?this.ret(-700-e.length,[s,s+this.pattern.length]):p==l?this.ret(-900-e.length,[g,m]):d==l?this.result(-100+(f?-200:0)+-700+(y?0:-1100),o,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 o of r){let s=o+(this.astral?C0(Yh(n,o)):1);a&&i[a-1]==o?i[a-1]=s:(i[a++]=o,i[a++]=s)}return this.ret(e-n.length,i)}}class c2n{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:u2n,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=>j4t(e(n),r(n)),optionClass:(e,r)=>n=>j4t(e(n),r(n)),addToOptions:(e,r)=>e.concat(r),filterStrict:(e,r)=>e||r})}});function j4t(t,e){return t?e?t+" "+e:t:e}function u2n(t,e,r,n,i,a){let o=t.textDirection==Ra.RTL,s=o,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(s&&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?o?"left-narrow":"right-narrow":s?"left":"right")}}const sAe=on.define();function h2n(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 o=document.createElement("span");o.className="cm-completionLabel";let s=r.displayLabel||r.label,l=0;for(let u=0;ul&&o.appendChild(document.createTextNode(s.slice(l,h)));let f=o.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(s.slice(h,d))),f.className="cm-completionMatchedText",l=d}return lr.position-n.position).map(r=>r.render)}function lAe(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 d2n{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:o}=i.open,s=e.state.facet(Vl);this.optionContent=h2n(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=lAe(a.length,o,s.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:sAe.of(h)}),l.preventDefault())}}),this.dom.addEventListener("focusout",l=>{let u=e.state.field(this.stateField,!1);u&&u.tooltip&&e.state.facet(Vl).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:Y$.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:o,disabled:s}=n.open;(!i.open||i.open.options!=a)&&(this.range=lAe(a.length,o,e.state.facet(Vl).maxRenderedOptions),this.showOptions(a,n.id)),this.updateSel(),s!=((r=i.open)===null||r===void 0?void 0:r.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!s)}}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=lAe(r.options.length,r.selected,this.view.state.facet(Vl).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 o=typeof a=="string"?document.createTextNode(a):a(i);if(!o)return;"then"in o?o.then(s=>{s&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(s,i)}).catch(s=>qh(this.view.state,s,"completion info")):(this.addInfoPane(o,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&&p2n(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 o=this.dom.ownerDocument.documentElement;a={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return i.top>Math.min(a.bottom,r.bottom)-10||i.bottom{o.target==i&&o.preventDefault()});let a=null;for(let o=n.from;on.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+"-"+o,h.setAttribute("role","option");let d=this.optionClass(s);d&&(h.className=d);for(let f of this.optionContent){let p=f(s,this.view.state,this.view,l);p&&h.appendChild(p)}}return n.from&&i.classList.add("cm-completionListIncompleteTop"),n.tonew d2n(r,t,e)}function p2n(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 X4t(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function g2n(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)}},o=e.facet(Vl);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 W4t(f,h.source,d?d(f):[],1e9-r.length));else{let f=e.sliceDoc(h.from,h.to),p,g=o.filterStrict?new c2n(f):new l2n(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 W4t(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?s.push(h):X4t(h.completion)>X4t(l)&&(s[s.length-1]=h),l=h.completion}return s}class r4{constructor(e,r,n,i,a,o){this.options=e,this.attrs=r,this.tooltip=n,this.timestamp=i,this.selected=a,this.disabled=o}setSelected(e,r){return e==this.selected||e>=this.options.length?this:new r4(this.options,K4t(r,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,r,n,i,a,o){if(i&&!o&&e.some(u=>u.isPending))return i.setDisabled();let s=g2n(e,r);if(!s.length)return i&&e.some(u=>u.isPending)?i.setDisabled():null;let l=r.facet(Vl).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:w2n,above:a.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(e){return new r4(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new r4(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class pZ{constructor(e,r,n){this.active=e,this.id=r,this.open=n}static start(){return new pZ(b2n,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:r}=e,n=r.facet(Vl),a=(n.override||r.languageDataAt("autocomplete",mC(r)).map(s2n)).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 o=this.open,s=e.effects.some(l=>l.is(cAe));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||a.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!m2n(a,this.active)||s?o=r4.build(a,r,this.id,o,n,s):o&&o.disabled&&!a.some(l=>l.isPending)&&(o=null),!o&&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(sAe)&&(o=o&&o.setSelected(l.value,this.id));return a==this.active&&o==this.open?this:new pZ(a,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?v2n:y2n}}function m2n(t,e){if(t==e)return!0;for(let r=0,n=0;;){for(;r-1&&(r["aria-activedescendant"]=t+"-"+e),r}const b2n=[];function Z4t(t,e){if(t.isUserEvent("input.complete")){let n=t.annotation(oAe);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=Z4t(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(fZ))i=new Ap(i.source,1,a.value);else if(a.is(Y$))i=new Ap(i.source,0);else if(a.is(cAe))for(let o of a.value)o.source==i.source&&(i=o);return i}updateFor(e,r){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(mC(e.state))}}class n4 extends Ap{constructor(e,r,n,i,a,o){super(e,3,r),this.limit=n,this.result=i,this.from=a,this.to=o}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),o=e.changes.mapPos(this.to,1),s=mC(e.state);if(s>o||!i||r&2&&(mC(e.startState)==this.from||sr.map(e))}}),Xh=Ko.define({create(){return pZ.start()},update(t,e){return t.update(e)},provide:t=>[Dwe.from(t,e=>e.tooltip),er.contentAttributes.from(t,e=>e.attrs)]});function uAe(t,e){const r=e.completion.apply||e.completion.label;let n=t.state.field(Xh).active.find(i=>i.source==e.source);return n instanceof n4?(typeof r=="string"?t.dispatch({...o2n(t.state,r,n.from,n.to),annotations:oAe.of(e.completion)}):r(t,e.completion,n.from,n.to),!0):!1}const w2n=f2n(Xh,uAe);function gZ(t,e="option"){return r=>{let n=r.state.field(Xh,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp-1?n.open.selected+i*(t?1:-1):t?0:o-1;return s<0?s=e=="page"?0:o-1:s>=o&&(s=e=="page"?o-1:0),r.dispatch({effects:sAe.of(s)}),!0}}const A2n=t=>{let e=t.state.field(Xh,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(Xh,!1)?(t.dispatch({effects:fZ.of(!0)}),!0):!1,S2n=t=>{let e=t.state.field(Xh,!1);return!e||!e.active.some(r=>r.state!=0)?!1:(t.dispatch({effects:Y$.of(null)}),!0)};class T2n{constructor(e,r){this.active=e,this.context=r,this.time=Date.now(),this.updates=[],this.done=void 0}}const C2n=50,O2n=1e3,k2n=Ro.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(Xh).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(Xh),r=t.state.facet(Vl);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Xh)==e)return;let n=t.transactions.some(a=>{let o=Z4t(a,r);return o&8||(a.selection||a.docChanged)&&!(o&3)});for(let a=0;aC2n&&Date.now()-o.time>O2n){for(let s of o.context.abortListeners)try{s()}catch(l){qh(this.view.state,l)}o.context.abortListeners=null,this.running.splice(a--,1)}else o.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(a=>a.effects.some(o=>o.is(fZ)))&&(this.pendingStart=!0);let i=this.pendingStart?50:r.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(a=>a.isPending&&!this.running.some(o=>o.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(Xh);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(Vl).updateSyncTime))}startQuery(t){let{state:e}=this.view,r=mC(e),n=new iAe(e,r,t.explicit,this.view),i=new T2n(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:Y$.of(null)}),qh(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(Vl).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],r=this.view.state.facet(Vl),n=this.view.state.field(Xh);for(let i=0;is.source==a.active.source);if(o&&o.isPending)if(a.done==null){let s=new Ap(a.active.source,0);for(let l of a.updates)s=s.update(l,r);s.isPending||e.push(s)}else this.startQuery(o)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:cAe.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(Xh,!1);if(e&&e.tooltip&&this.view.state.facet(Vl).closeOnBlur){let r=e.open&&FRt(this.view,e.open.tooltip);(!r||!r.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Y$.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:fZ.of(!1)}),20),this.composing=0}}}),E2n=typeof navigator=="object"&&/Win/.test(navigator.platform),_2n=Zd.highest(er.domEventHandlers({keydown(t,e){let r=e.state.field(Xh,!1);if(!r||!r.open||r.open.disabled||r.open.selected<0||t.key.length>1||t.ctrlKey&&!(E2n&&t.altKey)||t.metaKey)return!1;let n=r.open.options[r.open.selected],i=r.active.find(o=>o.source==n.source),a=n.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(t.key)>-1&&uAe(e,n),!1}})),J4t=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 R2n{constructor(e,r,n,i){this.field=e,this.line=r,this.from=n,this.to=i}}class dAe{constructor(e,r,n){this.field=e,this.from=r,this.to=n}map(e){let r=e.mapPos(this.from,-1,xc.TrackDel),n=e.mapPos(this.to,1,xc.TrackDel);return r==null||n==null?null:new dAe(this.field,r,n)}}class fAe{constructor(e,r){this.lines=e,this.fieldPositions=r}instantiate(e,r){let n=[],i=[r],a=e.doc.lineAt(r),o=/^\s*/.exec(a.text)[0];for(let l of this.lines){if(n.length){let u=o,h=/^\t*/.exec(l)[0].length;for(let d=0;dnew dAe(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:n,ranges:s}}static parse(e){let r=[],n=[],i=[],a;for(let o of e.split(/\r\n?|\n/)){for(;a=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let s=a[1]?+a[1]:null,l=a[2]||a[3]||"",u=-1;s===0&&(s=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 R2n(u,n.length,a.index,a.index+h.length)),o=o.slice(0,a.index)+l+o.slice(a.index+a[0].length)}o=o.replace(/\\([{}])/g,(s,l,u)=>{for(let h of i)h.line==n.length&&h.from>u&&(h.from--,h.to--);return l}),n.push(o)}return new fAe(n,i)}}let D2n=Ar.widget({widget:new class extends Hu{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),L2n=Ar.mark({class:"cm-snippetField"});class i4{constructor(e,r){this.ranges=e,this.active=r,this.deco=Ar.set(e.map(n=>(n.from==n.to?D2n:L2n).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 i4(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 q$=on.define({map(t,e){return t&&t.map(e)}}),M2n=on.define(),j$=Ko.define({create(){return null},update(t,e){for(let r of e.effects){if(r.is(q$))return r.value;if(r.is(M2n)&&t)return new i4(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 pAe(t,e){return xt.create(t.filter(r=>r.field==e).map(r=>xt.range(r.from,r.to)))}function I2n(t){let e=fAe.parse(t);return(r,n,i,a)=>{let{text:o,ranges:s}=e.instantiate(r.state,i),{main:l}=r.state.selection,u={changes:{from:i,to:a==l.from?l.to:a,insert:wi.of(o)},scrollIntoView:!0,annotations:n?[oAe.of(n),Us.userEvent.of("input.complete")]:void 0};if(s.length&&(u.selection=pAe(s,0)),s.some(h=>h.field>0)){let h=new i4(s,0),d=u.effects=[q$.of(h)];r.state.field(j$,!1)===void 0&&d.push(on.appendConfig.of([j$,N2n,B2n,J4t]))}r.dispatch(r.state.update(u))}}function e3t(t){return({state:e,dispatch:r})=>{let n=e.field(j$,!1);if(!n||t<0&&n.active==0)return!1;let i=n.active+t,a=t>0&&!n.ranges.some(o=>o.field==i+t);return r(e.update({selection:pAe(n.ranges,i),effects:q$.of(a?null:new i4(n.ranges,i)),scrollIntoView:!0})),!0}}const P2n=[{key:"Tab",run:e3t(1),shift:e3t(-1)},{key:"Escape",run:({state:t,dispatch:e})=>t.field(j$,!1)?(e(t.update({effects:q$.of(null)})),!0):!1}],t3t=vr.define({combine(t){return t.length?t[0]:P2n}}),N2n=Zd.highest(qR.compute([t3t],t=>t.facet(t3t)));function Do(t,e){return{...e,apply:I2n(t)}}const B2n=er.domEventHandlers({mousedown(t,e){let r=e.state.field(j$,!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:pAe(r.ranges,i.field),effects:q$.of(r.ranges.some(a=>a.field>i.field)?new i4(r.ranges,i.field):null),scrollIntoView:!0}),!0)}}),X$={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},vC=on.define({map(t,e){let r=e.mapPos(t,-1,xc.TrackAfter);return r??void 0}}),gAe=new class extends k2{};gAe.startSide=1,gAe.endSide=-1;const r3t=Ko.define({create(){return ti.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(vC)&&(t=t.update({add:[gAe.range(r.value,r.value+1)]}));return t}});function $2n(){return[z2n,r3t]}const mAe="()[]{}<>«»»«[]{}";function n3t(t){for(let e=0;e{if((F2n?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(n.length>2||n.length==2&&C0(Yh(n,0))==1||e!=i.from||r!=i.to)return!1;let a=V2n(t.state,n);return a?(t.dispatch(a),!0):!1}),U2n=[{key:"Backspace",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=i3t(t,t.selection.main.head).brackets||X$.brackets,i=null,a=t.changeByRange(o=>{if(o.empty){let s=Q2n(t.doc,o.head);for(let l of n)if(l==s&&mZ(t.doc,o.head)==n3t(Yh(l,0)))return{changes:{from:o.head-l.length,to:o.head+l.length},range:xt.cursor(o.head-l.length)}}return{range:i=o}});return i||e(t.update(a,{scrollIntoView:!0,userEvent:"delete.backward"})),!i}}];function V2n(t,e){let r=i3t(t,t.selection.main.head),n=r.brackets||X$.brackets;for(let i of n){let a=n3t(Yh(i,0));if(e==i)return a==i?W2n(t,i,n.indexOf(i+i+i)>-1,r):G2n(t,i,a,r.before||X$.before);if(e==a&&a3t(t,t.selection.main.from))return H2n(t,i,a)}return null}function a3t(t,e){let r=!1;return t.field(r3t).between(0,t.doc.length,n=>{n==e&&(r=!0)}),r}function mZ(t,e){let r=t.sliceString(e,e+2);return r.slice(0,C0(Yh(r,0)))}function Q2n(t,e){let r=t.sliceString(e-2,e);return C0(Yh(r,0))==r.length?r:r.slice(1)}function G2n(t,e,r,n){let i=null,a=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:r,from:o.to}],effects:vC.of(o.to+e.length),range:xt.range(o.anchor+e.length,o.head+e.length)};let s=mZ(t.doc,o.head);return!s||/\s/.test(s)||n.indexOf(s)>-1?{changes:{insert:e+r,from:o.head},effects:vC.of(o.head+e.length),range:xt.cursor(o.head+e.length)}:{range:i=o}});return i?null:t.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function H2n(t,e,r){let n=null,i=t.changeByRange(a=>a.empty&&mZ(t.doc,a.head)==r?{changes:{from:a.head,to:a.head+r.length,insert:r},range:xt.cursor(a.head+r.length)}:n={range:a});return n?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function W2n(t,e,r,n){let i=n.stringPrefixes||X$.stringPrefixes,a=null,o=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:e,from:s.to}],effects:vC.of(s.to+e.length),range:xt.range(s.anchor+e.length,s.head+e.length)};let l=s.head,u=mZ(t.doc,l),h;if(u==e){if(o3t(t,l))return{changes:{insert:e+e,from:l},effects:vC.of(l+e.length),range:xt.cursor(l+e.length)};if(a3t(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:xt.cursor(l+f.length)}}}else{if(r&&t.sliceDoc(l-2*e.length,l)==e+e&&(h=s3t(t,l-2*e.length,i))>-1&&o3t(t,h))return{changes:{insert:e+e+e+e,from:l},effects:vC.of(l+e.length),range:xt.cursor(l+e.length)};if(t.charCategorizer(l)(u)!=Ao.Word&&s3t(t,l,i)>-1&&!Y2n(t,l,e,i))return{changes:{insert:e+e,from:l},effects:vC.of(l+e.length),range:xt.cursor(l+e.length)}}return{range:a=s}});return a?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function o3t(t,e){let r=wa(t).resolveInner(e+1);return r.parent&&r.from==e}function Y2n(t,e,r,n){let i=wa(t).resolveInner(e,-1),a=n.reduce((o,s)=>Math.max(o,s.length),0);for(let o=0;o<5;o++){let s=t.sliceDoc(i.from,Math.min(i.to,i.from+r.length+a)),l=s.indexOf(r);if(!l||l>-1&&n.indexOf(s.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 s3t(t,e,r){let n=t.charCategorizer(e);if(n(t.sliceDoc(e-1,e))!=Ao.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))!=Ao.Word)return a}return-1}function q2n(t={}){return[_2n,Xh,Vl.of(t),k2n,j2n,J4t]}const l3t=[{key:"Ctrl-Space",run:hAe},{mac:"Alt-`",run:hAe},{mac:"Alt-i",run:hAe},{key:"Escape",run:S2n},{key:"ArrowDown",run:gZ(!0)},{key:"ArrowUp",run:gZ(!1)},{key:"PageDown",run:gZ(!0,"page")},{key:"PageUp",run:gZ(!1,"page")},{key:"Enter",run:A2n}],j2n=Zd.highest(qR.computeN([Vl],t=>t.facet(Vl).defaultKeymap?[l3t]:[])),c3t=[Do("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Do("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Do("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Do("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Do("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Do(`try { \${} } catch (\${error}) { \${} @@ -719,17 +719,17 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="

An error constructor(\${params}) { \${} } -}`,{label:"class",detail:"definition",type:"keyword"}),Do('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Do('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],q2n=s3t.concat([Do("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Do("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Do("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),l3t=new x2e,c3t=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function K$(t){return(e,r)=>{let n=e.node.getChild("VariableDefinition");return n&&r(n,t),!0}}const j2n=["FunctionDeclaration"],X2n={FunctionDeclaration:K$("function"),ClassDeclaration:K$("class"),ClassExpression:()=>!0,EnumDeclaration:K$("constant"),TypeAliasDeclaration:K$("type"),NamespaceDeclaration:K$("namespace"),VariableDefinition(t,e){t.matchContext(j2n)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function u3t(t,e){let r=l3t.get(e);if(r)return r;let n=[],i=!0;function a(o,s){let l=t.sliceString(o.from,o.to);n.push({label:l,type:s})}return e.cursor(Ki.IncludeAnonymous).iterate(o=>{if(i)i=!1;else if(o.name){let s=X2n[o.name];if(s&&s(o,a)||c3t.has(o.name))return!1}else if(o.to-o.from>8192){for(let s of u3t(t,o.node))n.push(s);return!1}}),l3t.set(e,n),n}const h3t=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,d3t=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function K2n(t){let e=wa(t.state).resolveInner(t.pos,-1);if(d3t.indexOf(e.name)>-1)return null;let r=e.name=="VariableName"||e.to-e.from<20&&h3t.test(t.state.sliceDoc(e.from,e.to));if(!r&&!t.explicit)return null;let n=[];for(let i=e;i;i=i.parent)c3t.has(i.name)&&(n=n.concat(u3t(t.state.doc,i)));return{options:n,from:r?e.from:t.pos,validFor:h3t}}const B0=v1.define({name:"javascript",parser:r2n.configure({props:[b1.add({IfStatement:e4({except:/^\s*({|else\b)/}),TryStatement:e4({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:$bn,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:JR({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":e4({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}}),x1.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":V$,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:"$"}}),f3t={test:t=>/^JSX/.test(t.name),facet:rZ({commentTokens:{block:{open:"{/*",close:"*/}"}}})},p3t=B0.configure({dialect:"ts"},"typescript"),g3t=B0.configure({dialect:"jsx",props:[Uwe.add(t=>t.isTop?[f3t]:void 0)]}),m3t=B0.configure({dialect:"jsx ts",props:[Uwe.add(t=>t.isTop?[f3t]:void 0)]},"typescript");let v3t=t=>({label:t,type:"keyword"});const y3t="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(v3t),Z2n=y3t.concat(["declare","implements","private","protected","public"].map(v3t));function vAe(t={}){let e=t.jsx?t.typescript?m3t:g3t:t.typescript?p3t:B0,r=t.typescript?q2n.concat(Z2n):s3t.concat(y3t);return new I2(e,[B0.data.of({autocomplete:Q4t(d3t,aAe(r))}),B0.data.of({autocomplete:K2n}),t.jsx?twn:[]])}function J2n(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 b3t(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 ewn=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),twn=er.inputHandler.of((t,e,r,n,i)=>{if((ewn?t.composing:t.compositionStarted)||t.state.readOnly||e!=r||n!=">"&&n!="/"||!B0.isActiveAt(t.state,e,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(l=>{var u;let{head:h}=l,d=wa(o).resolveInner(h-1,-1),f;if(d.name=="JSXStartTag"&&(d=d.parent),!(o.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=b3t(o.doc,g.firstChild,h))||((u=g.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let m=`${f}>`;return{range:xt.cursor(h+m.length,-1),changes:{from:h,insert:m}}}}else if(n==">"){let p=J2n(d);if(p&&p.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(h,h+2))&&(f=b3t(o.doc,p,h)))return{range:l,changes:{from:h,insert:``}}}}return{range:l}});return s.changes.empty?!1:(t.dispatch([a,o.update(s,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),rwn=m1({String:Re.string,Number:Re.number,"True False":Re.bool,PropertyName:Re.propertyName,Null:Re.null,", :":Re.separator,"[ ]":Re.squareBracket,"{ }":Re.brace}),nwn=w1.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:[rwn],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}),iwn=v1.define({name:"json",parser:nwn.configure({props:[b1.add({Object:e4({except:/^\s*\}/}),Array:e4({except:/^\s*\]/})}),x1.add({"Object Array":V$})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function awn(){return new I2(iwn)}class vZ{static create(e,r,n,i,a){let o=i+(i<<8)+e+(r<<4)|0;return new vZ(e,r,n,o,a,[],[])}constructor(e,r,n,i,a,o,s){this.type=e,this.value=r,this.from=n,this.hash=i,this.end=a,this.children=o,this.positions=s,this.hashProp=[[_n.contextHash,i]]}addChild(e,r){e.prop(_n.contextHash)!=this.hash&&(e=new ci(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 ci(e.types[this.type],this.children,this.positions,r-this.from).balance({makeTree:(i,a,o)=>new ci(zs.none,i,a,o,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 own{constructor(e,r){this.start=e,this.content=r,this.marks=[],this.parsers=[]}}class swn{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 Z$(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?xAe:bAe)(r,e,!1);return n>0&&(t.type!=nr.BulletList||yAe(r,e,!1)<0)&&r.text.charCodeAt(r.pos+n-1)==t.value}const w3t={[nr.Blockquote](t,e,r){return r.next!=62?!1:(r.markers.push(Li(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]:x3t,[nr.BulletList]:x3t,[nr.Document](){return!0}};function Sp(t){return t==32||t==9||t==10||t==13}function Z$(t,e=0){for(;er&&Sp(t.charCodeAt(e-1));)e--;return e}function S3t(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(L3t.SetextHeading)>-1||n<3?-1:1}function C3t(t,e){for(let r=t.stack.length-1;r>=0;r--)if(t.stack[r].type==e)return!0;return!1}function bAe(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||C3t(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 O3t(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e6?-1:r}function k3t(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e/,_3t=/\?>/,AAe=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/,D3t=/\?>/,AAe=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(n);if(a)return t.append(Li(nr.Comment,r,r+1+a[0].length));let o=/^\?[^]*?\?>/.exec(n);if(o)return t.append(Li(nr.ProcessingInstruction,r,r+1+o[0].length));let s=/^(?:![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 s?t.append(Li(nr.HTMLTag,r,r+1+s[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),o=tF.test(i),s=tF.test(a),l=/\s|^$/.test(i),u=/\s|^$/.test(a),h=!u&&(!s||l||o),d=!l&&(!o||u||s),f=h&&(e==42||!d||o),p=d&&(e==42||!h||s);return t.append(new rf(e==95?B3t:$3t,r,n,(f?1:0)|(p?2:0)))},HardBreak(t,e,r){if(e==92&&t.char(r+1)==10)return t.append(Li(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(Li(nr.HardBreak,r,n+1))}return-1},Link(t,e,r){return e==91?t.append(new rf(yC,r,r+1,1)):-1},Image(t,e,r){return e==33&&t.char(r+1)==91?t.append(new rf(wZ,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 rf&&(i.type==yC||i.type==wZ)){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),o=t.parts[n]=fwn(t,a,i.type==yC?nr.Link:nr.Image,i.from,r+1);if(i.type==yC)for(let s=0;se?Li(nr.URL,e+r,a+r):a==t.length?null:!1}}function U3t(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,o=!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 rf(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 rf&&(r.type==yC||r.type==wZ))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 rf&&m.side&1&&m.type==i.type&&!(a&&(i.side&1||m.side&2)&&(m.to-m.from+o)%3==0&&((m.to-m.from)%3||o%3))){s=m;break}}if(!s)continue;let u=i.type.resolve,h=[],d=s.from,f=i.to;if(a){let m=Math.min(2,s.to-s.from,o);d=s.to-m,f=i.from+m,u=m==1?"Emphasis":"StrongEmphasis"}s.type.mark&&h.push(this.elt(s.type.mark,d,s.to));for(let m=l+1;m=0;r--){let n=this.parts[r];if(n instanceof rf&&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 rf?r:null}skipSpace(e){return Z$(this.text,e-this.offset)+this.offset}elt(e,r,n,i){return typeof e=="string"?Li(this.parser.getNodeType(e),r,n,i):new N3t(e,r)}}OAe.linkStart=yC,OAe.imageStart=wZ;function kAe(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(_n.contextHash)==e}takeNodes(e){let r=this.cursor,n=this.fragment.offset,i=this.fragmentEnd-(this.fragment.openEnd?1:0),a=e.absoluteLineStart,o=a,s=e.block.children.length,l=o,u=s;for(;;){if(r.to-n>i){if(r.type.isAnonymous&&r.firstChild())continue;break}let h=Q3t(r.from-n,e.ranges);if(r.to-n<=e.ranges[e.rangeI].to)e.addNode(r.tree,h);else{let d=new ci(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")&&(pwn.indexOf(r.type.id)<0?(o=r.to-n,s=e.block.children.length):(o=l,s=u),l=r.to-n,u=e.block.children.length),!r.nextSibling())break}for(;e.block.children.length>s;)e.block.children.pop(),e.block.positions.pop();return o-a}}function Q3t(t,e){let r=t;for(let n=1;nyZ[t]),Object.keys(yZ).map(t=>L3t[t]),Object.keys(yZ),uwn,w3t,Object.keys(CAe).map(t=>CAe[t]),Object.keys(CAe),[]);function ywn(t,e,r){let n=[];for(let i=t.firstChild,a=e;;i=i.nextSibling){let o=i?i.from:r;if(o>a&&n.push({from:a,to:o}),!i)break;a=i.to}return n}function bwn(t){let{codeParser:e,htmlParser:r}=t;return{wrap:y_t((i,a)=>{let o=i.type.id;if(e&&(o==nr.CodeBlock||o==nr.FencedCode)){let s="";if(o==nr.FencedCode){let u=i.node.getChild(nr.CodeInfo);u&&(s=a.read(u.from,u.to))}let l=e(s);if(l)return{parser:l,overlay:u=>u.type.id==nr.CodeText,bracketed:o==nr.FencedCode}}else if(r&&(o==nr.HTMLBlock||o==nr.HTMLTag||o==nr.CommentBlock))return{parser:r,overlay:ywn(i.node,i.from,i.to)};return null})}}const xwn={resolve:"Strikethrough",mark:"StrikethroughMark"},wwn={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":Re.strikethrough}},{name:"StrikethroughMark",style:Re.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),o=/\s|^$/.test(i),s=tF.test(n),l=tF.test(i);return t.addDelimiter(xwn,r,r+2,!o&&(!l||a||s),!a&&(!s||o||l))},after:"Emphasis"}]};function rF(t,e,r=0,n,i=0){let a=0,o=!0,s=-1,l=-1,u=!1,h=()=>{n.push(t.elt("TableCell",i+s,i+l,t.parser.parseInline(e.slice(s,l),i+s)))};for(let d=r;d-1)&&a++,o=!1,n&&(s>-1&&h(),n.push(t.elt("TableDelimiter",d+i,d+i+1))),s=l=-1):(u||f!=32&&f!=9)&&(s<0&&(s=d),l=d+1),u=!u&&f==92}return s>-1&&(a++,n&&h()),a}function G3t(t,e){for(let r=e;r\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class W3t{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)&&H3t.test(i=r.text.slice(r.pos))){let a=[];rF(e,n.content,0,a,n.start)==rF(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=[];rF(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 Awn={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":Re.heading}},"TableRow",{name:"TableCell",style:Re.content},{name:"TableDelimiter",style:Re.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return G3t(e.content,0)?new W3t:null},endLeaf(t,e,r){if(r.parsers.some(i=>i instanceof W3t)||!G3t(e.text,e.basePos))return!1;let n=t.peekLine();return H3t.test(n)&&rF(t,e.text,e.basePos)==rF(t,n,e.basePos)},before:"SetextHeading"}]};class Swn{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 Twn={defineNodes:[{name:"Task",block:!0,style:Re.list},{name:"TaskMarker",style:Re.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\][ \t]/.test(e.content)&&t.parentType().name=="ListItem"?new Swn:null},after:"SetextHeading"}]},Y3t=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,q3t=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,Cwn=/[\w-]+\.[\w-]+($|[/:])/,j3t=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,X3t=/\/[a-zA-Z\d@.]+/gy;function K3t(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==")"&&K3t(t,e,n,")")>K3t(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 Z3t(t,e){j3t.lastIndex=e;let r=j3t.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 kwn=[Awn,Twn,wwn,{parseInline:[{name:"Autolink",parse(t,e,r){let n=r-t.offset;if(n&&/\w/.test(t.text[n-1]))return-1;Y3t.lastIndex=n;let i=Y3t.exec(t.text),a=-1;if(!i)return-1;if(i[1]||i[2]){if(a=Own(t.text,n+i[0].length),a>-1&&t.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(n,a));a=n+o[0].length}}else i[3]?a=Z3t(t.text,n):(a=Z3t(t.text,n+i[0].length),a>-1&&i[0]=="xmpp:"&&(X3t.lastIndex=a,i=X3t.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 J3t(t,e,r){return(n,i,a)=>{if(i!=t||n.char(a+1)==t)return-1;let o=[n.elt(r,a,a+1)];for(let s=a+1;s=65&&t<=90||t==95||t>=97&&t<=122||t>=161}let uDt=null,hDt=null,dDt=0;function DAe(t,e){let r=t.pos+e;if(dDt==r&&hDt==t)return uDt;let n=t.peek(e),i="";for(;eAn(n);)i+=String.fromCharCode(n),n=t.peek(++e);return hDt=t,dDt=r,uDt=i?i.toLowerCase():n==tAn||n==rAn?void 0:null}const fDt=60,AZ=62,LAe=47,tAn=63,rAn=33,nAn=45;function pDt(t,e){this.name=t,this.parent=e}const iAn=[EAe,iDt,tDt,rDt,nDt],aAn=new dZ({start:null,shift(t,e,r,n){return iAn.indexOf(e)>-1?new pDt(DAe(n,1)||"",t):t},reduce(t,e){return e==oDt&&t?t.parent:t},reuse(t,e,r,n){let i=e.type.id;return i==EAe||i==qwn?new pDt(DAe(n,1)||"",t):t},strict:!1}),oAn=new xs((t,e)=>{if(t.next!=fDt){t.next<0&&e.context&&t.acceptToken(_Ae);return}t.advance();let r=t.next==LAe;r&&t.advance();let n=DAe(t,0);if(n===void 0)return;if(!n)return t.acceptToken(r?Vwn:Uwn);let i=e.context?e.context.name:null;if(r){if(n==i)return t.acceptToken($wn);if(i&&Jwn[i])return t.acceptToken(_Ae,-2);if(e.dialectEnabled(Xwn))return t.acceptToken(Fwn);for(let a=e.context;a;a=a.parent)if(a.name==n)return;t.acceptToken(zwn)}else{if(n=="script")return t.acceptToken(tDt);if(n=="style")return t.acceptToken(rDt);if(n=="textarea")return t.acceptToken(nDt);if(Zwn.hasOwnProperty(n))return t.acceptToken(iDt);i&&cDt[i]&&cDt[i][n]?t.acceptToken(_Ae,-1):t.acceptToken(EAe)}},{contextual:!0}),sAn=new xs(t=>{for(let e=0,r=0;;r++){if(t.next<0){r&&t.acceptToken(aDt);break}if(t.next==nAn)e++;else if(t.next==AZ&&e>=2){r>=3&&t.acceptToken(aDt,-2);break}else e=0;t.advance()}});function lAn(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const cAn=new xs((t,e)=>{if(t.next==LAe&&t.peek(1)==AZ){let r=e.dialectEnabled(Kwn)||lAn(e.context);t.acceptToken(r?Bwn:eDt,2)}else t.next==AZ&&t.acceptToken(eDt,1)});function MAe(t,e,r){let n=2+t.length;return new xs(i=>{for(let a=0,o=0,s=0;;s++){if(i.next<0){s&&i.acceptToken(e);break}if(a==0&&i.next==fDt||a==1&&i.next==LAe||a>=2&&ao?i.acceptToken(e,-o):i.acceptToken(r,-(o-2));break}else if((i.next==10||i.next==13)&&s){i.acceptToken(e,1);break}else a=o=0;i.advance()}})}const uAn=MAe("script",Dwn,Lwn),hAn=MAe("style",Mwn,Iwn),dAn=MAe("textarea",Pwn,Nwn),fAn=m1({"Text RawText IncompleteTag IncompleteCloseTag":Re.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":Re.angleBracket,TagName:Re.tagName,"MismatchedCloseTag/TagName":[Re.tagName,Re.invalid],AttributeName:Re.attributeName,"AttributeValue UnquotedAttributeValue":Re.attributeValue,Is:Re.definitionOperator,"EntityReference CharacterReference":Re.character,Comment:Re.blockComment,ProcessingInst:Re.processingInstruction,DoctypeDecl:Re.documentMeta}),pAn=w1.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:aAn,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:[fAn],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=s.type.id;if(u==Hwn)return IAe(s,l,r);if(u==Wwn)return IAe(s,l,n);if(u==Ywn)return IAe(s,l,i);if(u==oDt&&a.length){let h=s.node,d=h.firstChild,f=d&&mDt(d,l),p;if(f){for(let g of a)if(g.tag==f&&(!g.attrs||g.attrs(p||(p=gDt(d,l))))){let m=h.lastChild,v=m.type.id==jwn?m.from:h.to;if(v>d.to)return{parser:g.parser,overlay:[{from:d.to,to:v}]}}}}if(o&&u==sDt){let h=s.node,d;if(d=h.firstChild){let f=o[l.read(d.from,d.to)];if(f)for(let p of f){if(p.tagName&&p.tagName!=mDt(h.parent,l))continue;let g=h.lastChild;if(g.type.id==RAe){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==lDt)return{parser:p.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const gAn=145,yDt=1,mAn=146,vAn=147,bDt=2,yAn=148,bAn=3,xAn=4,xDt=[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],wAn=58,AAn=40,wDt=95,SAn=91,SZ=45,TAn=46,CAn=35,OAn=37,kAn=38,EAn=92,_An=10,RAn=42;function nF(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function PAe(t){return t>=48&&t<=57}function ADt(t){return PAe(t)||t>=97&&t<=102||t>=65&&t<=70}const SDt=(t,e,r)=>(n,i)=>{for(let a=!1,o=0,s=0;;s++){let{next:l}=n;if(nF(l)||l==SZ||l==wDt||a&&PAe(l))!a&&(l!=SZ||s>0)&&(a=!0),o===s&&l==SZ&&o++,n.advance();else if(l==EAn&&n.peek(1)!=_An){if(n.advance(),ADt(n.next)){do n.advance();while(ADt(n.next));n.next==32&&n.advance()}else n.next>-1&&n.advance();a=!0}else{a&&n.acceptToken(o==2&&i.canShift(bDt)?e:l==AAn?r:t);break}}},DAn=new xs(SDt(mAn,bDt,vAn),{contextual:!0}),LAn=new xs(SDt(yAn,bAn,xAn),{contextual:!0}),MAn=new xs(t=>{if(xDt.includes(t.peek(-1))){let{next:e}=t;(nF(e)||e==wDt||e==CAn||e==TAn||e==RAn||e==SAn||e==wAn&&nF(t.peek(1))||e==SZ||e==kAn)&&t.acceptToken(gAn)}}),IAn=new xs(t=>{if(!xDt.includes(t.peek(-1))){let{next:e}=t;if(e==OAn&&(t.advance(),t.acceptToken(yDt)),nF(e)){do t.advance();while(nF(t.next)||PAe(t.next));t.acceptToken(yDt)}}}),PAn=m1({"AtKeyword import charset namespace keyframes media supports font-feature-values":Re.definitionKeyword,"from to selector scope MatchFlag":Re.keyword,NamespaceName:Re.namespace,KeyframeName:Re.labelName,KeyframeRangeName:Re.operatorKeyword,TagName:Re.tagName,ClassName:Re.className,PseudoClassName:Re.constant(Re.className),IdName:Re.labelName,"FeatureName PropertyName":Re.propertyName,AttributeName:Re.attributeName,NumberLiteral:Re.number,KeywordQuery:Re.keyword,UnaryQueryOp:Re.operatorKeyword,"CallTag ValueName FontName":Re.atom,VariableName:Re.variableName,Callee:Re.operatorKeyword,Unit:Re.unit,"UniversalSelector NestingSelector":Re.definitionOperator,"MatchOp CompareOp":Re.compareOperator,"ChildOp SiblingOp, LogicOp":Re.logicOperator,BinOp:Re.arithmeticOperator,Important:Re.modifier,Comment:Re.blockComment,ColorLiteral:Re.color,"ParenthesizedContent StringLiteral":Re.string,":":Re.punctuation,"PseudoOp #":Re.derefOperator,"; , |":Re.separator,"( )":Re.paren,"[ ]":Re.squareBracket,"{ }":Re.brace}),NAn={__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},BAn={__proto__:null,or:104,and:104,not:112,only:112,layer:206},$An={__proto__:null,selector:118,style:124,layer:202},FAn={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},zAn={__proto__:null,to:243},UAn=w1.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:[MAn,IAn,DAn,LAn,1,2,3,4,new hZ("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=>NAn[t]||-1},{term:148,get:t=>BAn[t]||-1},{term:4,get:t=>$An[t]||-1},{term:28,get:t=>FAn[t]||-1},{term:146,get:t=>zAn[t]||-1}],tokenPrec:2405});let NAe=null;function BAe(){if(!NAe&&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)));NAe=e.sort().map(n=>({type:"property",label:n,apply:n+": "}))}return NAe||[]}const TDt=["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})),CDt=["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}))),VAn=["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})),QAn=["@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})),S1=/^(\w[\w-]*|-\w[\w-]*|)$/,GAn=/^-(-[\w-]*)?$/;function HAn(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 ODt=new x2e,WAn=["Declaration"];function YAn(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function kDt(t,e,r){if(e.to-e.from>4096){let n=ODt.get(e);if(n)return n;let i=[],a=new Set,o=e.cursor(Ki.IncludeAnonymous);if(o.firstChild())do for(let s of kDt(t,o.node,r))a.has(s.label)||(a.add(s.label),i.push(s));while(o.nextSibling());return ODt.set(e,i),i}else{let n=[],i=new Set;return e.cursor().iterate(a=>{var o;if(r(a)&&a.matchContext(WAn)&&((o=a.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let s=t.sliceString(a.from,a.to);i.has(s)||(i.add(s),n.push({label:s,type:"variable"}))}}),n}}const qAn=(t=>e=>{let{state:r,pos:n}=e,i=wa(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:BAe(),validFor:S1};if(i.name=="ValueName")return{from:i.from,options:CDt,validFor:S1};if(i.name=="PseudoClassName")return{from:i.from,options:TDt,validFor:S1};if(t(i)||(e.explicit||a)&&HAn(i,r.doc))return{from:t(i)||a?i.from:n,options:kDt(r.doc,YAn(i),t),validFor:GAn};if(i.name=="TagName"){for(let{parent:l}=i;l;l=l.parent)if(l.name=="Block")return{from:i.from,options:BAe(),validFor:S1};return{from:i.from,options:VAn,validFor:S1}}if(i.name=="AtKeyword")return{from:i.from,options:QAn,validFor:S1};if(!e.explicit)return null;let o=i.resolve(n),s=o.childBefore(n);return s&&s.name==":"&&o.name=="PseudoClassSelector"?{from:n,options:TDt,validFor:S1}:s&&s.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:n,options:CDt,validFor:S1}:o.name=="Block"||o.name=="Styles"?{from:n,options:BAe(),validFor:S1}:null})(t=>t.name=="VariableName"),TZ=v1.define({name:"css",parser:UAn.configure({props:[b1.add({Declaration:e4()}),x1.add({"Block KeyframeList":V$})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function jAn(){return new I2(TZ,TZ.data.of({autocomplete:qAn}))}const iF=["_blank","_self","_top","_parent"],$Ae=["ascii","utf-8","utf-16","latin1","latin1"],FAe=["get","post","put","delete"],zAe=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],nf=["true","false"],zr={},XAn={a:{attrs:{href:null,ping:null,type:null,media:null,target:iF,hreflang:null}},abbr:zr,address:zr,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:zr,aside:zr,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:zr,base:{attrs:{href:null,target:iF}},bdi:zr,bdo:zr,blockquote:{attrs:{cite:null}},body:zr,br:zr,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:zAe,formmethod:FAe,formnovalidate:["novalidate"],formtarget:iF,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:zr,center:zr,cite:zr,code:zr,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:zr,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:zr,div:zr,dl:zr,dt:zr,em:zr,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:zr,figure:zr,footer:zr,form:{attrs:{action:null,name:null,"accept-charset":$Ae,autocomplete:["on","off"],enctype:zAe,method:FAe,novalidate:["novalidate"],target:iF}},h1:zr,h2:zr,h3:zr,h4:zr,h5:zr,h6:zr,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:zr,hgroup:zr,hr:zr,html:{attrs:{manifest:null}},i:zr,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:zAe,formmethod:FAe,formnovalidate:["novalidate"],formtarget:iF,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:zr,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:zr,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:zr,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:$Ae,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:zr,noscript:zr,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:zr,param:{attrs:{name:null,value:null}},pre:zr,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:zr,rt:zr,ruby:zr,samp:zr,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:$Ae}},section:zr,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:zr,source:{attrs:{src:null,type:null,media:null}},span:zr,strong:zr,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:zr,summary:zr,sup:zr,table:zr,tbody:zr,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:zr,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:zr,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:zr,time:{attrs:{datetime:null}},title:zr,tr:zr,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:zr,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:zr},EDt={accesskey:null,class:null,contenteditable:nf,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:nf,autocorrect:nf,autocapitalize:nf,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":nf,"aria-autocomplete":["inline","list","both","none"],"aria-busy":nf,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":nf,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":nf,"aria-hidden":nf,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":nf,"aria-multiselectable":nf,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":nf,"aria-relevant":null,"aria-required":nf,"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},_Dt="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 _Dt)EDt[t]=null;class aF{constructor(e,r){this.tags={...XAn,...e},this.globalAttrs={...EDt,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}aF.default=new aF;function o4(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 s4(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function RDt(t,e,r){let n=r.tags[o4(t,s4(e))];return(n==null?void 0:n.children)||r.allTags}function UAe(t,e){let r=[];for(let n=s4(e);n&&!n.type.isTop;n=s4(n.parent)){let i=o4(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 DDt=/^[:\-\.\w\u00b7-\uffff]*$/;function LDt(t,e,r,n,i){let a=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",o=s4(r,r.name=="StartTag"||r.name=="TagName");return{from:n,to:i,options:RDt(t.doc,o,e).map(s=>({label:s,type:"type"})).concat(UAe(t.doc,r).map((s,l)=>({label:"/"+s,apply:"/"+s+a,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function MDt(t,e,r,n){let i=/\s*>/.test(t.sliceDoc(n,n+5))?"":">";return{from:r,to:n,options:UAe(t.doc,e).map((a,o)=>({label:a,apply:a+i,type:"type",boost:99-o})),validFor:DDt}}function KAn(t,e,r,n){let i=[],a=0;for(let o of RDt(t.doc,r,e))i.push({label:"<"+o,type:"type"});for(let o of UAe(t.doc,r))i.push({label:"",type:"type",boost:99-a++});return{from:n,to:n,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function ZAn(t,e,r,n,i){let a=s4(r),o=a?e.tags[o4(t.doc,a)]:null,s=o&&o.attrs?Object.keys(o.attrs):[],l=o&&o.globalAttrs===!1?s:s.length?s.concat(e.globalAttrNames):e.globalAttrNames;return{from:n,to:i,options:l.map(u=>({label:u,type:"property"})),validFor:DDt}}function JAn(t,e,r,n,i){var a;let o=(a=r.parent)===null||a===void 0?void 0:a.getChild("AttributeName"),s=[],l;if(o){let u=t.sliceDoc(o.from,o.to),h=e.globalAttrs[u];if(!h){let d=s4(r),f=d?e.tags[o4(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)s.push({label:g,apply:f+g+p,type:"constant"})}}return{from:n,to:i,options:s,validFor:l}}function IDt(t,e){let{state:r,pos:n}=e,i=wa(r).resolveInner(n,-1),a=i.resolve(n);for(let o=n,s;a==i&&(s=i.childBefore(o));){let l=s.lastChild;if(!l||!l.type.isError||l.fromIDt(n,i)}const rSn=B0.parser.configure({top:"SingleExpression"}),PDt=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:p3t.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:g3t.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:m3t.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:rSn},{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:TZ.parser}],NDt=[{name:"style",parser:TZ.parser.configure({top:"Styles"})}].concat(_Dt.map(t=>({name:t,parser:B0.parser}))),BDt=v1.define({name:"html",parser:pAn.configure({props:[b1.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:"-_"}}),CZ=BDt.configure({wrap:vDt(PDt,NDt)});function nSn(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=vDt((t.nestedLanguages||[]).concat(PDt),(t.nestedAttributes||[]).concat(NDt)));let n=r?BDt.configure({wrap:r,dialect:e}):e?CZ.configure({dialect:e}):CZ;return new I2(n,[CZ.data.of({autocomplete:tSn(t)}),t.autoCloseTags!==!1?iSn:[],vAe().support,jAn().support])}const $Dt=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),iSn=er.inputHandler.of((t,e,r,n,i)=>{if(t.composing||t.state.readOnly||e!=r||n!=">"&&n!="/"||!CZ.isActiveAt(t.state,e,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(l=>{var u,h,d;let f=o.doc.sliceString(l.from-1,l.to)==n,{head:p}=l,g=wa(o).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=o4(o.doc,v.parent,p))&&!$Dt.has(m)){let y=p+(o.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=o4(o.doc,v,p))&&!$Dt.has(m)){let y=p+(o.doc.sliceString(p,p+1)===">"?1:0),b=`${m}>`;return{range:xt.cursor(p+b.length,-1),changes:{from:p,to:y,insert:b}}}}return{range:l}});return s.changes.empty?!1:(t.dispatch([a,o.update(s,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),FDt=rZ({commentTokens:{block:{open:""}}}),zDt=new _n,UDt=vwn.configure({props:[x1.add(t=>!t.is("Block")||t.is("Document")||VAe(t)!=null||aSn(t)?void 0:(e,r)=>({from:r.doc.lineAt(e.from).to,to:e.to})),zDt.add(VAe),b1.add({Document:()=>null}),M2.add({Document:FDt})]});function VAe(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function aSn(t){return t.name=="OrderedList"||t.name=="BulletList"}function oSn(t,e){let r=t;for(;;){let n=r.nextSibling,i;if(!n||(i=VAe(n.type))!=null&&i<=e)break;r=n}return r.to}const sSn=o4t.of((t,e,r)=>{for(let n=wa(t).resolveInner(r,-1);n&&!(n.fromr)return{from:r,to:a}}return null});function QAe(t){return new ef(FDt,t,[],"markdown")}const lSn=QAe(UDt),OZ=QAe(UDt.configure([kwn,_wn,Ewn,Rwn,{props:[x1.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]));function cSn(t,e){return r=>{if(r&&t){let n=null;if(r=/\S*/.exec(r)[0],typeof t=="function"?n=t(r):n=nZ.matchLanguageName(t,r,!0),n instanceof nZ)return n.support?n.support.language.parser:fC.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}let GAe=class{constructor(e,r,n,i,a,o,s){this.node=e,this.from=r,this.to=n,this.spaceBefore=i,this.spaceAfter=a,this.type=o,this.item=s}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(+QDt(this.item,e)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}};function VDt(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],o,s=e.lineAt(a.from),l=a.from-s.from;if(a.name=="Blockquote"&&(o=/^ *>( ?)/.exec(s.text.slice(l))))n.push(new GAe(a,l,l+o[0].length,"",o[1],">",null));else if(a.name=="ListItem"&&a.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(s.text.slice(l)))){let u=o[3],h=o[0].length;u.length>=4&&(u=u.slice(0,u.length-4),h-=4),n.push(new GAe(a.parent,l,l+h,o[1],u,o[2],a))}else if(a.name=="ListItem"&&a.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(s.text.slice(l)))){let u=o[4],h=o[0].length;u.length>4&&(u=u.slice(0,u.length-4),h-=4);let d=o[2];o[3]&&(d+=o[3].replace(/[xX]/," ")),n.push(new GAe(a.parent,l,l+h,o[1],u,d,a))}}return n}function QDt(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function HAe(t,e,r,n=0){for(let i=-1,a=t;;){if(a.name=="ListItem"){let s=QDt(a,e),l=+s[2];if(i>=0){if(l!=i+1)return;r.push({from:a.from+s[1].length,to:a.from+s[0].length,insert:String(i+2+n)})}i=l}let o=a.nextSibling;if(!o)break;a=o}}function WAe(t,e){let r=/^[ \t]*/.exec(t)[0].length;if(!r||e.facet(ZR)!=" ")return t;let n=Lg(t,4,r),i="";for(let a=n;a>0;)a>=4?(i+=" ",a-=4):(i+=" ",a--);return i+t.slice(r)}const uSn=((t={})=>({state:e,dispatch:r})=>{let n=wa(e),{doc:i}=e,a=null,o=e.changeByRange(s=>{if(!s.empty||!OZ.isActiveAt(e,s.from,-1)&&!OZ.isActiveAt(e,s.from,1))return a={range:s};let l=s.from,u=i.lineAt(l),h=VDt(n.resolveInner(l,-1),i);for(;h.length&&h[h.length-1].from>l-u.from;)h.pop();if(!h.length)return a={range:s};let d=h[h.length-1];if(d.to-d.spaceAfter.length>l-u.from)return a={range:s};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"&&HAe(d.item,i,S,-2),x&&x.node.name=="OrderedList"&&HAe(x.item,i,S),{range:xt.cursor(w+A.length),changes:S}}else{let x=HDt(h,e,u);return{range:xt.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:s.map(x),changes:x}}}let p=[];d.node.name=="OrderedList"&&HAe(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=WAe(m,e),hSn(d.node,e.doc)&&(m=HDt(h,e,u)+e.lineBreak+m),p.push({from:v,to:l,insert:e.lineBreak+m}),{range:xt.cursor(v+m.length+1),changes:p}});return a?!1:(r(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)})();function GDt(t){return t.name=="QuoteMark"||t.name=="ListMark"}function hSn(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),o=/^[\s>]*$/.test(i.text);return i.number+(o?0:1){let r=wa(t),n=null,i=t.changeByRange(a=>{let o=a.from,{doc:s}=t;if(a.empty&&OZ.isActiveAt(t,a.from)){let l=s.lineAt(o),u=VDt(dSn(r,o),s);if(u.length){let h=u[u.length-1],d=h.to-h.spaceAfter.length+(h.spaceAfter?1:0);if(o-l.from>d&&!/\S/.test(l.text.slice(d,o-l.from)))return{range:xt.cursor(l.from+d),changes:{from:l.from+d,to:o}};if(o-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),!OZ.isActiveAt(e.state,n.from,1)))return!1;let a=wa(e.state),o=!1;return a.iterate({from:n.from,to:n.to,enter:s=>{(s.from>n.from||vSn.test(s.name))&&(o=!0)},leave:s=>{s.to=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const yTn=new xs((t,e)=>{let r;if(t.next<0)t.acceptToken(ASn);else if(e.context.flags&EZ)KAe(t.next)&&t.acceptToken(wSn,1);else if(((r=t.peek(-1))<0||KAe(r))&&e.canShift(jDt)){let n=0;for(;t.next==qAe||t.next==kZ;)t.advance(),n++;(t.next==bC||t.next==oF||t.next==jAe)&&t.acceptToken(jDt,-n)}else KAe(t.next)&&t.acceptToken(xSn,1)},{contextual:!0}),bTn=new xs((t,e)=>{let r=e.context;if(r.flags)return;let n=t.peek(-1);if(n==bC||n==oF){let i=0,a=0;for(;;){if(t.next==qAe)i++;else if(t.next==kZ)i+=8-i%8;else break;t.advance(),a++}i!=r.indent&&t.next!=bC&&t.next!=oF&&t.next!=jAe&&(i[t,e|nLt])),ATn=new dZ({start:xTn,reduce(t,e,r,n){return t.flags&EZ&&vTn.has(e)||(e==FSn||e==ZDt)&&t.flags&nLt?t.parent:t},shift(t,e,r,n){return e==YDt?new _Z(t,wTn(n.read(n.pos,r.pos)),0):e==qDt?t.parent:e==CSn||e==_Sn||e==LSn||e==XDt?new _Z(t,0,EZ):iLt.has(e)?new _Z(t,0,iLt.get(e)|t.flags&EZ):t},hash(t){return t.hash}}),STn=new xs(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==qAe||r==kZ)){r!=uTn&&r!=hTn&&r!=bC&&r!=oF&&r!=jAe&&t.acceptToken(bSn);return}}}),TTn=new xs((t,e)=>{let{flags:r}=e.context,n=r&T1?tLt:eLt,i=(r&C1)>0,a=!(r&O1),o=(r&k1)>0,s=t.pos;for(;!(t.next<0);)if(o&&t.next==XAe)if(t.peek(1)==XAe)t.advance(2);else{if(t.pos==s){t.acceptToken(XDt,1);return}break}else if(a&&t.next==rLt){if(t.pos==s){t.advance();let l=t.next;l>=0&&(t.advance(),CTn(t,l)),t.acceptToken(TSn);return}break}else if(t.next==rLt&&!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==s){t.acceptToken(KDt,i?3:1);return}break}else if(t.next==bC){if(i)t.advance();else if(t.pos==s){t.acceptToken(KDt);return}break}else t.advance();t.pos>s&&t.acceptToken(SSn)});function CTn(t,e){if(e==dTn)for(let r=0;r<2&&t.next>=48&&t.next<=55;r++)t.advance();else if(e==fTn)for(let r=0;r<2&&ZAe(t.next);r++)t.advance();else if(e==gTn)for(let r=0;r<4&&ZAe(t.next);r++)t.advance();else if(e==mTn)for(let r=0;r<8&&ZAe(t.next);r++)t.advance();else if(e==pTn&&t.next==XAe){for(t.advance();t.next>=0&&t.next!=JDt&&t.next!=eLt&&t.next!=tLt&&t.next!=bC;)t.advance();t.next==JDt&&t.advance()}}const OTn=m1({'async "*" "**" FormatConversion FormatSpec':Re.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":Re.controlKeyword,"in not and or is del":Re.operatorKeyword,"from def class global nonlocal lambda":Re.definitionKeyword,import:Re.moduleKeyword,"with as print":Re.keyword,Boolean:Re.bool,None:Re.null,VariableName:Re.variableName,"CallExpression/VariableName":Re.function(Re.variableName),"FunctionDefinition/VariableName":Re.function(Re.definition(Re.variableName)),"ClassDefinition/VariableName":Re.definition(Re.className),PropertyName:Re.propertyName,"CallExpression/MemberExpression/PropertyName":Re.function(Re.propertyName),Comment:Re.lineComment,Number:Re.number,String:Re.string,FormatString:Re.special(Re.string),Escape:Re.escape,UpdateOp:Re.updateOperator,"ArithOp!":Re.arithmeticOperator,BitOp:Re.bitwiseOperator,CompareOp:Re.compareOperator,AssignOp:Re.definitionOperator,Ellipsis:Re.punctuation,At:Re.meta,"( )":Re.paren,"[ ]":Re.squareBracket,"{ }":Re.brace,".":Re.derefOperator,", ;":Re.separator}),kTn={__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},ETn=w1.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:[STn,bTn,yTn,TTn,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>kTn[t]||-1}],tokenPrec:7668}),aLt=new x2e,oLt=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function RZ(t){return(e,r,n)=>{if(n)return!1;let i=e.node.getChild("VariableName");return i&&r(i,t),!0}}const _Tn={FunctionDefinition:RZ("function"),ClassDefinition:RZ("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 o=i.getChild("import");o;o=o.nextSibling)o.name=="VariableName"&&((n=o.nextSibling)===null||n===void 0?void 0:n.name)!="as"&&e(o,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:RZ("variable"),AsPattern:RZ("variable"),__proto__:null};function sLt(t,e){let r=aLt.get(e);if(r)return r;let n=[],i=!0;function a(o,s){let l=t.sliceString(o.from,o.to);n.push({label:l,type:s})}return e.cursor(Ki.IncludeAnonymous).iterate(o=>{if(o.name){let s=_Tn[o.name];if(s&&s(o,a,i)||!i&&oLt.has(o.name))return!1;i=!1}else if(o.to-o.from>8192){for(let s of sLt(t,o.node))n.push(s);return!1}}),aLt.set(e,n),n}const lLt=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,cLt=["String","FormatString","Comment","PropertyName"];function RTn(t){let e=wa(t.state).resolveInner(t.pos,-1);if(cLt.indexOf(e.name)>-1)return null;let r=e.name=="VariableName"||e.to-e.from<20&&lLt.test(t.state.sliceDoc(e.from,e.to));if(!r&&!t.explicit)return null;let n=[];for(let i=e;i;i=i.parent)oLt.has(i.name)&&(n=n.concat(sLt(t.state.doc,i)));return{options:n,from:r?e.from:t.pos,validFor:lLt}}const DTn=["__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"}))),LTn=[Do("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),Do("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),Do("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),Do("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),Do(`if \${}: +`);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=vZ.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 ci(this.parser.nodeSet.types[e],a4,a4,(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(kAe(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?P3t(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=kAe(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"?Li(this.parser.getNodeType(e),r,n,i):new $3t(e,r)}get buffer(){return new B3t(this.parser.nodeSet)}}function P3t(t,e,r,n,i){let a=t[e].to,o=[],s=[],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=P3t(t,e,h,n,i),u(h.to+n,!1)):f=h.toTree(),o.push(f),s.push(d-l)}return u(r.to+n,!1),new ci(r.type,o,s,r.to+n-l,r.tree?r.tree.propValues:void 0)}class bZ extends fK{constructor(e,r,n,i,a,o,s,l,u){super(),this.nodeSet=e,this.blockParsers=r,this.leafBlockParsers=n,this.blockNames=i,this.endLeafBlock=a,this.skipContextMarkup=o,this.inlineParsers=s,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 pwn(this,e,r,n);for(let a of this.wrappers)i=a(i,e,r,n);return i}configure(e){let r=TAe(e);if(!r)return this;let{nodeSet:n,skipContextMarkup:i}=this,a=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),s=this.blockNames.slice(),l=this.inlineParsers.slice(),u=this.inlineNames.slice(),h=this.endLeafBlock.slice(),d=this.wrappers;if(J$(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(zs.define({id:x,name:m,props:w&&[[_n.group,w]]})),b&&(p||(p={}),Array.isArray(b)||b instanceof L0?p[m]=b:Object.assign(p,b))}n=new NR(f),p&&(n=n.extend(m1(p)))}if(J$(r.props)&&(n=n.extend(...r.props)),J$(r.remove))for(let f of r.remove){let p=this.blockNames.indexOf(f),g=this.inlineNames.indexOf(f);p>-1&&(a[p]=o[p]=void 0),g>-1&&(l[g]=void 0)}if(J$(r.parseBlock))for(let f of r.parseBlock){let p=s.indexOf(f.name);if(p>-1)a[p]=f.parse,o[p]=f.leaf;else{let g=f.before?xZ(s,f.before):f.after?xZ(s,f.after)+1:s.length-1;a.splice(g,0,f.parse),o.splice(g,0,f.leaf),s.splice(g,0,f.name)}f.endLeaf&&h.push(f.endLeaf)}if(J$(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?xZ(u,f.before):f.after?xZ(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 bZ(n,a,o,s,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 OAe(this,e,r);e:for(let i=r;i=0){i=s;continue e}}i++}return n.resolveMarkers(0)}}function J$(t){return t!=null&&t.length>0}function TAe(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let e=TAe(t[0]);if(t.length==1)return e;let r=TAe(t.slice(1));if(!r||!e)return e||r;let n=(o,s)=>(o||a4).concat(s||a4),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?(o,s,l,u)=>i(a(o,s,l,u),s,l,u):i:a}}function xZ(t,e){let r=t.indexOf(e);if(r<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return r}let N3t=[zs.none];for(let t=1,e;e=nr[t];t++)N3t[t]=zs.define({id:t,name:e,props:t>=nr.Escape?[]:[[_n.group,t in S3t?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const a4=[];let B3t=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 ci.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:r})}},eF=class{constructor(e,r,n,i=a4){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 B3t(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class $3t{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 a4}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 Li(t,e,r,n){return new eF(t,e,r,n)}const F3t={resolve:"Emphasis",mark:"EmphasisMark"},z3t={resolve:"Emphasis",mark:"EmphasisMark"},yC={},wZ={};class rf{constructor(e,r,n,i){this.type=e,this.from=r,this.to=n,this.side=i}}const U3t="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let tF=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{tF=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const CAe={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(Li(nr.Autolink,r,r+1+i[0].length,[Li(nr.LinkMark,r,r+1),Li(nr.URL,r+1,r+i[0].length),Li(nr.LinkMark,r+i[0].length,r+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(n);if(a)return t.append(Li(nr.Comment,r,r+1+a[0].length));let o=/^\?[^]*?\?>/.exec(n);if(o)return t.append(Li(nr.ProcessingInstruction,r,r+1+o[0].length));let s=/^(?:![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 s?t.append(Li(nr.HTMLTag,r,r+1+s[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),o=tF.test(i),s=tF.test(a),l=/\s|^$/.test(i),u=/\s|^$/.test(a),h=!u&&(!s||l||o),d=!l&&(!o||u||s),f=h&&(e==42||!d||o),p=d&&(e==42||!h||s);return t.append(new rf(e==95?F3t:z3t,r,n,(f?1:0)|(p?2:0)))},HardBreak(t,e,r){if(e==92&&t.char(r+1)==10)return t.append(Li(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(Li(nr.HardBreak,r,n+1))}return-1},Link(t,e,r){return e==91?t.append(new rf(yC,r,r+1,1)):-1},Image(t,e,r){return e==33&&t.char(r+1)==91?t.append(new rf(wZ,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 rf&&(i.type==yC||i.type==wZ)){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),o=t.parts[n]=gwn(t,a,i.type==yC?nr.Link:nr.Image,i.from,r+1);if(i.type==yC)for(let s=0;se?Li(nr.URL,e+r,a+r):a==t.length?null:!1}}function Q3t(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,o=!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 rf(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 rf&&(r.type==yC||r.type==wZ))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 rf&&m.side&1&&m.type==i.type&&!(a&&(i.side&1||m.side&2)&&(m.to-m.from+o)%3==0&&((m.to-m.from)%3||o%3))){s=m;break}}if(!s)continue;let u=i.type.resolve,h=[],d=s.from,f=i.to;if(a){let m=Math.min(2,s.to-s.from,o);d=s.to-m,f=i.from+m,u=m==1?"Emphasis":"StrongEmphasis"}s.type.mark&&h.push(this.elt(s.type.mark,d,s.to));for(let m=l+1;m=0;r--){let n=this.parts[r];if(n instanceof rf&&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 rf?r:null}skipSpace(e){return Z$(this.text,e-this.offset)+this.offset}elt(e,r,n,i){return typeof e=="string"?Li(this.parser.getNodeType(e),r,n,i):new $3t(e,r)}}OAe.linkStart=yC,OAe.imageStart=wZ;function kAe(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(_n.contextHash)==e}takeNodes(e){let r=this.cursor,n=this.fragment.offset,i=this.fragmentEnd-(this.fragment.openEnd?1:0),a=e.absoluteLineStart,o=a,s=e.block.children.length,l=o,u=s;for(;;){if(r.to-n>i){if(r.type.isAnonymous&&r.firstChild())continue;break}let h=H3t(r.from-n,e.ranges);if(r.to-n<=e.ranges[e.rangeI].to)e.addNode(r.tree,h);else{let d=new ci(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")&&(mwn.indexOf(r.type.id)<0?(o=r.to-n,s=e.block.children.length):(o=l,s=u),l=r.to-n,u=e.block.children.length),!r.nextSibling())break}for(;e.block.children.length>s;)e.block.children.pop(),e.block.positions.pop();return o-a}}function H3t(t,e){let r=t;for(let n=1;nyZ[t]),Object.keys(yZ).map(t=>I3t[t]),Object.keys(yZ),dwn,S3t,Object.keys(CAe).map(t=>CAe[t]),Object.keys(CAe),[]);function xwn(t,e,r){let n=[];for(let i=t.firstChild,a=e;;i=i.nextSibling){let o=i?i.from:r;if(o>a&&n.push({from:a,to:o}),!i)break;a=i.to}return n}function wwn(t){let{codeParser:e,htmlParser:r}=t;return{wrap:x_t((i,a)=>{let o=i.type.id;if(e&&(o==nr.CodeBlock||o==nr.FencedCode)){let s="";if(o==nr.FencedCode){let u=i.node.getChild(nr.CodeInfo);u&&(s=a.read(u.from,u.to))}let l=e(s);if(l)return{parser:l,overlay:u=>u.type.id==nr.CodeText,bracketed:o==nr.FencedCode}}else if(r&&(o==nr.HTMLBlock||o==nr.HTMLTag||o==nr.CommentBlock))return{parser:r,overlay:xwn(i.node,i.from,i.to)};return null})}}const Awn={resolve:"Strikethrough",mark:"StrikethroughMark"},Swn={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":Re.strikethrough}},{name:"StrikethroughMark",style:Re.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),o=/\s|^$/.test(i),s=tF.test(n),l=tF.test(i);return t.addDelimiter(Awn,r,r+2,!o&&(!l||a||s),!a&&(!s||o||l))},after:"Emphasis"}]};function rF(t,e,r=0,n,i=0){let a=0,o=!0,s=-1,l=-1,u=!1,h=()=>{n.push(t.elt("TableCell",i+s,i+l,t.parser.parseInline(e.slice(s,l),i+s)))};for(let d=r;d-1)&&a++,o=!1,n&&(s>-1&&h(),n.push(t.elt("TableDelimiter",d+i,d+i+1))),s=l=-1):(u||f!=32&&f!=9)&&(s<0&&(s=d),l=d+1),u=!u&&f==92}return s>-1&&(a++,n&&h()),a}function W3t(t,e){for(let r=e;r\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class q3t{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)&&Y3t.test(i=r.text.slice(r.pos))){let a=[];rF(e,n.content,0,a,n.start)==rF(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=[];rF(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 Twn={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":Re.heading}},"TableRow",{name:"TableCell",style:Re.content},{name:"TableDelimiter",style:Re.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return W3t(e.content,0)?new q3t:null},endLeaf(t,e,r){if(r.parsers.some(i=>i instanceof q3t)||!W3t(e.text,e.basePos))return!1;let n=t.peekLine();return Y3t.test(n)&&rF(t,e.text,e.basePos)==rF(t,n,e.basePos)},before:"SetextHeading"}]};class Cwn{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 Own={defineNodes:[{name:"Task",block:!0,style:Re.list},{name:"TaskMarker",style:Re.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\][ \t]/.test(e.content)&&t.parentType().name=="ListItem"?new Cwn:null},after:"SetextHeading"}]},j3t=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,X3t=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,kwn=/[\w-]+\.[\w-]+($|[/:])/,K3t=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,Z3t=/\/[a-zA-Z\d@.]+/gy;function J3t(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==")"&&J3t(t,e,n,")")>J3t(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 eDt(t,e){K3t.lastIndex=e;let r=K3t.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 _wn=[Twn,Own,Swn,{parseInline:[{name:"Autolink",parse(t,e,r){let n=r-t.offset;if(n&&/\w/.test(t.text[n-1]))return-1;j3t.lastIndex=n;let i=j3t.exec(t.text),a=-1;if(!i)return-1;if(i[1]||i[2]){if(a=Ewn(t.text,n+i[0].length),a>-1&&t.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(n,a));a=n+o[0].length}}else i[3]?a=eDt(t.text,n):(a=eDt(t.text,n+i[0].length),a>-1&&i[0]=="xmpp:"&&(Z3t.lastIndex=a,i=Z3t.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 tDt(t,e,r){return(n,i,a)=>{if(i!=t||n.char(a+1)==t)return-1;let o=[n.elt(r,a,a+1)];for(let s=a+1;s=65&&t<=90||t==95||t>=97&&t<=122||t>=161}let dDt=null,fDt=null,pDt=0;function DAe(t,e){let r=t.pos+e;if(pDt==r&&fDt==t)return dDt;let n=t.peek(e),i="";for(;rAn(n);)i+=String.fromCharCode(n),n=t.peek(++e);return fDt=t,pDt=r,dDt=i?i.toLowerCase():n==nAn||n==iAn?void 0:null}const gDt=60,AZ=62,LAe=47,nAn=63,iAn=33,aAn=45;function mDt(t,e){this.name=t,this.parent=e}const oAn=[EAe,oDt,nDt,iDt,aDt],sAn=new dZ({start:null,shift(t,e,r,n){return oAn.indexOf(e)>-1?new mDt(DAe(n,1)||"",t):t},reduce(t,e){return e==lDt&&t?t.parent:t},reuse(t,e,r,n){let i=e.type.id;return i==EAe||i==Xwn?new mDt(DAe(n,1)||"",t):t},strict:!1}),lAn=new xs((t,e)=>{if(t.next!=gDt){t.next<0&&e.context&&t.acceptToken(_Ae);return}t.advance();let r=t.next==LAe;r&&t.advance();let n=DAe(t,0);if(n===void 0)return;if(!n)return t.acceptToken(r?Gwn:Qwn);let i=e.context?e.context.name:null;if(r){if(n==i)return t.acceptToken(zwn);if(i&&tAn[i])return t.acceptToken(_Ae,-2);if(e.dialectEnabled(Zwn))return t.acceptToken(Uwn);for(let a=e.context;a;a=a.parent)if(a.name==n)return;t.acceptToken(Vwn)}else{if(n=="script")return t.acceptToken(nDt);if(n=="style")return t.acceptToken(iDt);if(n=="textarea")return t.acceptToken(aDt);if(eAn.hasOwnProperty(n))return t.acceptToken(oDt);i&&hDt[i]&&hDt[i][n]?t.acceptToken(_Ae,-1):t.acceptToken(EAe)}},{contextual:!0}),cAn=new xs(t=>{for(let e=0,r=0;;r++){if(t.next<0){r&&t.acceptToken(sDt);break}if(t.next==aAn)e++;else if(t.next==AZ&&e>=2){r>=3&&t.acceptToken(sDt,-2);break}else e=0;t.advance()}});function uAn(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const hAn=new xs((t,e)=>{if(t.next==LAe&&t.peek(1)==AZ){let r=e.dialectEnabled(Jwn)||uAn(e.context);t.acceptToken(r?Fwn:rDt,2)}else t.next==AZ&&t.acceptToken(rDt,1)});function MAe(t,e,r){let n=2+t.length;return new xs(i=>{for(let a=0,o=0,s=0;;s++){if(i.next<0){s&&i.acceptToken(e);break}if(a==0&&i.next==gDt||a==1&&i.next==LAe||a>=2&&ao?i.acceptToken(e,-o):i.acceptToken(r,-(o-2));break}else if((i.next==10||i.next==13)&&s){i.acceptToken(e,1);break}else a=o=0;i.advance()}})}const dAn=MAe("script",Mwn,Iwn),fAn=MAe("style",Pwn,Nwn),pAn=MAe("textarea",Bwn,$wn),gAn=m1({"Text RawText IncompleteTag IncompleteCloseTag":Re.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":Re.angleBracket,TagName:Re.tagName,"MismatchedCloseTag/TagName":[Re.tagName,Re.invalid],AttributeName:Re.attributeName,"AttributeValue UnquotedAttributeValue":Re.attributeValue,Is:Re.definitionOperator,"EntityReference CharacterReference":Re.character,Comment:Re.blockComment,ProcessingInst:Re.processingInstruction,DoctypeDecl:Re.documentMeta}),mAn=w1.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:sAn,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:[gAn],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=s.type.id;if(u==Ywn)return IAe(s,l,r);if(u==qwn)return IAe(s,l,n);if(u==jwn)return IAe(s,l,i);if(u==lDt&&a.length){let h=s.node,d=h.firstChild,f=d&&yDt(d,l),p;if(f){for(let g of a)if(g.tag==f&&(!g.attrs||g.attrs(p||(p=vDt(d,l))))){let m=h.lastChild,v=m.type.id==Kwn?m.from:h.to;if(v>d.to)return{parser:g.parser,overlay:[{from:d.to,to:v}]}}}}if(o&&u==cDt){let h=s.node,d;if(d=h.firstChild){let f=o[l.read(d.from,d.to)];if(f)for(let p of f){if(p.tagName&&p.tagName!=yDt(h.parent,l))continue;let g=h.lastChild;if(g.type.id==RAe){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==uDt)return{parser:p.parser,overlay:[{from:g.from,to:g.to}]}}}}return null})}const vAn=145,xDt=1,yAn=146,bAn=147,wDt=2,xAn=148,wAn=3,AAn=4,ADt=[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],SAn=58,TAn=40,SDt=95,CAn=91,SZ=45,OAn=46,kAn=35,EAn=37,_An=38,RAn=92,DAn=10,LAn=42;function nF(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function PAe(t){return t>=48&&t<=57}function TDt(t){return PAe(t)||t>=97&&t<=102||t>=65&&t<=70}const CDt=(t,e,r)=>(n,i)=>{for(let a=!1,o=0,s=0;;s++){let{next:l}=n;if(nF(l)||l==SZ||l==SDt||a&&PAe(l))!a&&(l!=SZ||s>0)&&(a=!0),o===s&&l==SZ&&o++,n.advance();else if(l==RAn&&n.peek(1)!=DAn){if(n.advance(),TDt(n.next)){do n.advance();while(TDt(n.next));n.next==32&&n.advance()}else n.next>-1&&n.advance();a=!0}else{a&&n.acceptToken(o==2&&i.canShift(wDt)?e:l==TAn?r:t);break}}},MAn=new xs(CDt(yAn,wDt,bAn),{contextual:!0}),IAn=new xs(CDt(xAn,wAn,AAn),{contextual:!0}),PAn=new xs(t=>{if(ADt.includes(t.peek(-1))){let{next:e}=t;(nF(e)||e==SDt||e==kAn||e==OAn||e==LAn||e==CAn||e==SAn&&nF(t.peek(1))||e==SZ||e==_An)&&t.acceptToken(vAn)}}),NAn=new xs(t=>{if(!ADt.includes(t.peek(-1))){let{next:e}=t;if(e==EAn&&(t.advance(),t.acceptToken(xDt)),nF(e)){do t.advance();while(nF(t.next)||PAe(t.next));t.acceptToken(xDt)}}}),BAn=m1({"AtKeyword import charset namespace keyframes media supports font-feature-values":Re.definitionKeyword,"from to selector scope MatchFlag":Re.keyword,NamespaceName:Re.namespace,KeyframeName:Re.labelName,KeyframeRangeName:Re.operatorKeyword,TagName:Re.tagName,ClassName:Re.className,PseudoClassName:Re.constant(Re.className),IdName:Re.labelName,"FeatureName PropertyName":Re.propertyName,AttributeName:Re.attributeName,NumberLiteral:Re.number,KeywordQuery:Re.keyword,UnaryQueryOp:Re.operatorKeyword,"CallTag ValueName FontName":Re.atom,VariableName:Re.variableName,Callee:Re.operatorKeyword,Unit:Re.unit,"UniversalSelector NestingSelector":Re.definitionOperator,"MatchOp CompareOp":Re.compareOperator,"ChildOp SiblingOp, LogicOp":Re.logicOperator,BinOp:Re.arithmeticOperator,Important:Re.modifier,Comment:Re.blockComment,ColorLiteral:Re.color,"ParenthesizedContent StringLiteral":Re.string,":":Re.punctuation,"PseudoOp #":Re.derefOperator,"; , |":Re.separator,"( )":Re.paren,"[ ]":Re.squareBracket,"{ }":Re.brace}),$An={__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},FAn={__proto__:null,or:104,and:104,not:112,only:112,layer:206},zAn={__proto__:null,selector:118,style:124,layer:202},UAn={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},VAn={__proto__:null,to:243},QAn=w1.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:[PAn,NAn,MAn,IAn,1,2,3,4,new hZ("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=>$An[t]||-1},{term:148,get:t=>FAn[t]||-1},{term:4,get:t=>zAn[t]||-1},{term:28,get:t=>UAn[t]||-1},{term:146,get:t=>VAn[t]||-1}],tokenPrec:2405});let NAe=null;function BAe(){if(!NAe&&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)));NAe=e.sort().map(n=>({type:"property",label:n,apply:n+": "}))}return NAe||[]}const ODt=["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})),kDt=["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}))),GAn=["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})),HAn=["@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})),S1=/^(\w[\w-]*|-\w[\w-]*|)$/,WAn=/^-(-[\w-]*)?$/;function YAn(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 EDt=new x2e,qAn=["Declaration"];function jAn(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function _Dt(t,e,r){if(e.to-e.from>4096){let n=EDt.get(e);if(n)return n;let i=[],a=new Set,o=e.cursor(Ki.IncludeAnonymous);if(o.firstChild())do for(let s of _Dt(t,o.node,r))a.has(s.label)||(a.add(s.label),i.push(s));while(o.nextSibling());return EDt.set(e,i),i}else{let n=[],i=new Set;return e.cursor().iterate(a=>{var o;if(r(a)&&a.matchContext(qAn)&&((o=a.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let s=t.sliceString(a.from,a.to);i.has(s)||(i.add(s),n.push({label:s,type:"variable"}))}}),n}}const XAn=(t=>e=>{let{state:r,pos:n}=e,i=wa(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:BAe(),validFor:S1};if(i.name=="ValueName")return{from:i.from,options:kDt,validFor:S1};if(i.name=="PseudoClassName")return{from:i.from,options:ODt,validFor:S1};if(t(i)||(e.explicit||a)&&YAn(i,r.doc))return{from:t(i)||a?i.from:n,options:_Dt(r.doc,jAn(i),t),validFor:WAn};if(i.name=="TagName"){for(let{parent:l}=i;l;l=l.parent)if(l.name=="Block")return{from:i.from,options:BAe(),validFor:S1};return{from:i.from,options:GAn,validFor:S1}}if(i.name=="AtKeyword")return{from:i.from,options:HAn,validFor:S1};if(!e.explicit)return null;let o=i.resolve(n),s=o.childBefore(n);return s&&s.name==":"&&o.name=="PseudoClassSelector"?{from:n,options:ODt,validFor:S1}:s&&s.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:n,options:kDt,validFor:S1}:o.name=="Block"||o.name=="Styles"?{from:n,options:BAe(),validFor:S1}:null})(t=>t.name=="VariableName"),TZ=v1.define({name:"css",parser:QAn.configure({props:[b1.add({Declaration:e4()}),x1.add({"Block KeyframeList":V$})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function KAn(){return new I2(TZ,TZ.data.of({autocomplete:XAn}))}const iF=["_blank","_self","_top","_parent"],$Ae=["ascii","utf-8","utf-16","latin1","latin1"],FAe=["get","post","put","delete"],zAe=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],nf=["true","false"],zr={},ZAn={a:{attrs:{href:null,ping:null,type:null,media:null,target:iF,hreflang:null}},abbr:zr,address:zr,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:zr,aside:zr,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:zr,base:{attrs:{href:null,target:iF}},bdi:zr,bdo:zr,blockquote:{attrs:{cite:null}},body:zr,br:zr,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:zAe,formmethod:FAe,formnovalidate:["novalidate"],formtarget:iF,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:zr,center:zr,cite:zr,code:zr,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:zr,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:zr,div:zr,dl:zr,dt:zr,em:zr,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:zr,figure:zr,footer:zr,form:{attrs:{action:null,name:null,"accept-charset":$Ae,autocomplete:["on","off"],enctype:zAe,method:FAe,novalidate:["novalidate"],target:iF}},h1:zr,h2:zr,h3:zr,h4:zr,h5:zr,h6:zr,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:zr,hgroup:zr,hr:zr,html:{attrs:{manifest:null}},i:zr,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:zAe,formmethod:FAe,formnovalidate:["novalidate"],formtarget:iF,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:zr,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:zr,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:zr,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:$Ae,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:zr,noscript:zr,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:zr,param:{attrs:{name:null,value:null}},pre:zr,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:zr,rt:zr,ruby:zr,samp:zr,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:$Ae}},section:zr,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:zr,source:{attrs:{src:null,type:null,media:null}},span:zr,strong:zr,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:zr,summary:zr,sup:zr,table:zr,tbody:zr,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:zr,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:zr,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:zr,time:{attrs:{datetime:null}},title:zr,tr:zr,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:zr,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:zr},RDt={accesskey:null,class:null,contenteditable:nf,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:nf,autocorrect:nf,autocapitalize:nf,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":nf,"aria-autocomplete":["inline","list","both","none"],"aria-busy":nf,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":nf,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":nf,"aria-hidden":nf,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":nf,"aria-multiselectable":nf,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":nf,"aria-relevant":null,"aria-required":nf,"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},DDt="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 DDt)RDt[t]=null;class aF{constructor(e,r){this.tags={...ZAn,...e},this.globalAttrs={...RDt,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}aF.default=new aF;function o4(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 s4(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function LDt(t,e,r){let n=r.tags[o4(t,s4(e))];return(n==null?void 0:n.children)||r.allTags}function UAe(t,e){let r=[];for(let n=s4(e);n&&!n.type.isTop;n=s4(n.parent)){let i=o4(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 MDt=/^[:\-\.\w\u00b7-\uffff]*$/;function IDt(t,e,r,n,i){let a=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",o=s4(r,r.name=="StartTag"||r.name=="TagName");return{from:n,to:i,options:LDt(t.doc,o,e).map(s=>({label:s,type:"type"})).concat(UAe(t.doc,r).map((s,l)=>({label:"/"+s,apply:"/"+s+a,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function PDt(t,e,r,n){let i=/\s*>/.test(t.sliceDoc(n,n+5))?"":">";return{from:r,to:n,options:UAe(t.doc,e).map((a,o)=>({label:a,apply:a+i,type:"type",boost:99-o})),validFor:MDt}}function JAn(t,e,r,n){let i=[],a=0;for(let o of LDt(t.doc,r,e))i.push({label:"<"+o,type:"type"});for(let o of UAe(t.doc,r))i.push({label:"",type:"type",boost:99-a++});return{from:n,to:n,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function eSn(t,e,r,n,i){let a=s4(r),o=a?e.tags[o4(t.doc,a)]:null,s=o&&o.attrs?Object.keys(o.attrs):[],l=o&&o.globalAttrs===!1?s:s.length?s.concat(e.globalAttrNames):e.globalAttrNames;return{from:n,to:i,options:l.map(u=>({label:u,type:"property"})),validFor:MDt}}function tSn(t,e,r,n,i){var a;let o=(a=r.parent)===null||a===void 0?void 0:a.getChild("AttributeName"),s=[],l;if(o){let u=t.sliceDoc(o.from,o.to),h=e.globalAttrs[u];if(!h){let d=s4(r),f=d?e.tags[o4(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)s.push({label:g,apply:f+g+p,type:"constant"})}}return{from:n,to:i,options:s,validFor:l}}function NDt(t,e){let{state:r,pos:n}=e,i=wa(r).resolveInner(n,-1),a=i.resolve(n);for(let o=n,s;a==i&&(s=i.childBefore(o));){let l=s.lastChild;if(!l||!l.type.isError||l.fromNDt(n,i)}const iSn=B0.parser.configure({top:"SingleExpression"}),BDt=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:m3t.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:v3t.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:y3t.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:iSn},{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:TZ.parser}],$Dt=[{name:"style",parser:TZ.parser.configure({top:"Styles"})}].concat(DDt.map(t=>({name:t,parser:B0.parser}))),FDt=v1.define({name:"html",parser:mAn.configure({props:[b1.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:"-_"}}),CZ=FDt.configure({wrap:bDt(BDt,$Dt)});function aSn(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=bDt((t.nestedLanguages||[]).concat(BDt),(t.nestedAttributes||[]).concat($Dt)));let n=r?FDt.configure({wrap:r,dialect:e}):e?CZ.configure({dialect:e}):CZ;return new I2(n,[CZ.data.of({autocomplete:nSn(t)}),t.autoCloseTags!==!1?oSn:[],vAe().support,KAn().support])}const zDt=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),oSn=er.inputHandler.of((t,e,r,n,i)=>{if(t.composing||t.state.readOnly||e!=r||n!=">"&&n!="/"||!CZ.isActiveAt(t.state,e,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(l=>{var u,h,d;let f=o.doc.sliceString(l.from-1,l.to)==n,{head:p}=l,g=wa(o).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=o4(o.doc,v.parent,p))&&!zDt.has(m)){let y=p+(o.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=o4(o.doc,v,p))&&!zDt.has(m)){let y=p+(o.doc.sliceString(p,p+1)===">"?1:0),b=`${m}>`;return{range:xt.cursor(p+b.length,-1),changes:{from:p,to:y,insert:b}}}}return{range:l}});return s.changes.empty?!1:(t.dispatch([a,o.update(s,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),UDt=rZ({commentTokens:{block:{open:""}}}),VDt=new _n,QDt=bwn.configure({props:[x1.add(t=>!t.is("Block")||t.is("Document")||VAe(t)!=null||sSn(t)?void 0:(e,r)=>({from:r.doc.lineAt(e.from).to,to:e.to})),VDt.add(VAe),b1.add({Document:()=>null}),M2.add({Document:UDt})]});function VAe(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function sSn(t){return t.name=="OrderedList"||t.name=="BulletList"}function lSn(t,e){let r=t;for(;;){let n=r.nextSibling,i;if(!n||(i=VAe(n.type))!=null&&i<=e)break;r=n}return r.to}const cSn=l4t.of((t,e,r)=>{for(let n=wa(t).resolveInner(r,-1);n&&!(n.fromr)return{from:r,to:a}}return null});function QAe(t){return new ef(UDt,t,[],"markdown")}const uSn=QAe(QDt),OZ=QAe(QDt.configure([_wn,Dwn,Rwn,Lwn,{props:[x1.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]));function hSn(t,e){return r=>{if(r&&t){let n=null;if(r=/\S*/.exec(r)[0],typeof t=="function"?n=t(r):n=nZ.matchLanguageName(t,r,!0),n instanceof nZ)return n.support?n.support.language.parser:fC.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}let GAe=class{constructor(e,r,n,i,a,o,s){this.node=e,this.from=r,this.to=n,this.spaceBefore=i,this.spaceAfter=a,this.type=o,this.item=s}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(+HDt(this.item,e)[2]+r):"";return this.spaceBefore+n+this.type+this.spaceAfter}};function GDt(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],o,s=e.lineAt(a.from),l=a.from-s.from;if(a.name=="Blockquote"&&(o=/^ *>( ?)/.exec(s.text.slice(l))))n.push(new GAe(a,l,l+o[0].length,"",o[1],">",null));else if(a.name=="ListItem"&&a.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(s.text.slice(l)))){let u=o[3],h=o[0].length;u.length>=4&&(u=u.slice(0,u.length-4),h-=4),n.push(new GAe(a.parent,l,l+h,o[1],u,o[2],a))}else if(a.name=="ListItem"&&a.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(s.text.slice(l)))){let u=o[4],h=o[0].length;u.length>4&&(u=u.slice(0,u.length-4),h-=4);let d=o[2];o[3]&&(d+=o[3].replace(/[xX]/," ")),n.push(new GAe(a.parent,l,l+h,o[1],u,d,a))}}return n}function HDt(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function HAe(t,e,r,n=0){for(let i=-1,a=t;;){if(a.name=="ListItem"){let s=HDt(a,e),l=+s[2];if(i>=0){if(l!=i+1)return;r.push({from:a.from+s[1].length,to:a.from+s[0].length,insert:String(i+2+n)})}i=l}let o=a.nextSibling;if(!o)break;a=o}}function WAe(t,e){let r=/^[ \t]*/.exec(t)[0].length;if(!r||e.facet(ZR)!=" ")return t;let n=Lg(t,4,r),i="";for(let a=n;a>0;)a>=4?(i+=" ",a-=4):(i+=" ",a--);return i+t.slice(r)}const dSn=((t={})=>({state:e,dispatch:r})=>{let n=wa(e),{doc:i}=e,a=null,o=e.changeByRange(s=>{if(!s.empty||!OZ.isActiveAt(e,s.from,-1)&&!OZ.isActiveAt(e,s.from,1))return a={range:s};let l=s.from,u=i.lineAt(l),h=GDt(n.resolveInner(l,-1),i);for(;h.length&&h[h.length-1].from>l-u.from;)h.pop();if(!h.length)return a={range:s};let d=h[h.length-1];if(d.to-d.spaceAfter.length>l-u.from)return a={range:s};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"&&HAe(d.item,i,S,-2),x&&x.node.name=="OrderedList"&&HAe(x.item,i,S),{range:xt.cursor(w+A.length),changes:S}}else{let x=YDt(h,e,u);return{range:xt.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:s.map(x),changes:x}}}let p=[];d.node.name=="OrderedList"&&HAe(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=WAe(m,e),fSn(d.node,e.doc)&&(m=YDt(h,e,u)+e.lineBreak+m),p.push({from:v,to:l,insert:e.lineBreak+m}),{range:xt.cursor(v+m.length+1),changes:p}});return a?!1:(r(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)})();function WDt(t){return t.name=="QuoteMark"||t.name=="ListMark"}function fSn(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),o=/^[\s>]*$/.test(i.text);return i.number+(o?0:1){let r=wa(t),n=null,i=t.changeByRange(a=>{let o=a.from,{doc:s}=t;if(a.empty&&OZ.isActiveAt(t,a.from)){let l=s.lineAt(o),u=GDt(pSn(r,o),s);if(u.length){let h=u[u.length-1],d=h.to-h.spaceAfter.length+(h.spaceAfter?1:0);if(o-l.from>d&&!/\S/.test(l.text.slice(d,o-l.from)))return{range:xt.cursor(l.from+d),changes:{from:l.from+d,to:o}};if(o-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),!OZ.isActiveAt(e.state,n.from,1)))return!1;let a=wa(e.state),o=!1;return a.iterate({from:n.from,to:n.to,enter:s=>{(s.from>n.from||bSn.test(s.name))&&(o=!0)},leave:s=>{s.to=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const xTn=new xs((t,e)=>{let r;if(t.next<0)t.acceptToken(TSn);else if(e.context.flags&EZ)KAe(t.next)&&t.acceptToken(SSn,1);else if(((r=t.peek(-1))<0||KAe(r))&&e.canShift(KDt)){let n=0;for(;t.next==qAe||t.next==kZ;)t.advance(),n++;(t.next==bC||t.next==oF||t.next==jAe)&&t.acceptToken(KDt,-n)}else KAe(t.next)&&t.acceptToken(ASn,1)},{contextual:!0}),wTn=new xs((t,e)=>{let r=e.context;if(r.flags)return;let n=t.peek(-1);if(n==bC||n==oF){let i=0,a=0;for(;;){if(t.next==qAe)i++;else if(t.next==kZ)i+=8-i%8;else break;t.advance(),a++}i!=r.indent&&t.next!=bC&&t.next!=oF&&t.next!=jAe&&(i[t,e|aLt])),TTn=new dZ({start:ATn,reduce(t,e,r,n){return t.flags&EZ&&bTn.has(e)||(e==USn||e==eLt)&&t.flags&aLt?t.parent:t},shift(t,e,r,n){return e==jDt?new _Z(t,STn(n.read(n.pos,r.pos)),0):e==XDt?t.parent:e==kSn||e==DSn||e==ISn||e==ZDt?new _Z(t,0,EZ):oLt.has(e)?new _Z(t,0,oLt.get(e)|t.flags&EZ):t},hash(t){return t.hash}}),CTn=new xs(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==qAe||r==kZ)){r!=dTn&&r!=fTn&&r!=bC&&r!=oF&&r!=jAe&&t.acceptToken(wSn);return}}}),OTn=new xs((t,e)=>{let{flags:r}=e.context,n=r&T1?nLt:rLt,i=(r&C1)>0,a=!(r&O1),o=(r&k1)>0,s=t.pos;for(;!(t.next<0);)if(o&&t.next==XAe)if(t.peek(1)==XAe)t.advance(2);else{if(t.pos==s){t.acceptToken(ZDt,1);return}break}else if(a&&t.next==iLt){if(t.pos==s){t.advance();let l=t.next;l>=0&&(t.advance(),kTn(t,l)),t.acceptToken(OSn);return}break}else if(t.next==iLt&&!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==s){t.acceptToken(JDt,i?3:1);return}break}else if(t.next==bC){if(i)t.advance();else if(t.pos==s){t.acceptToken(JDt);return}break}else t.advance();t.pos>s&&t.acceptToken(CSn)});function kTn(t,e){if(e==pTn)for(let r=0;r<2&&t.next>=48&&t.next<=55;r++)t.advance();else if(e==gTn)for(let r=0;r<2&&ZAe(t.next);r++)t.advance();else if(e==vTn)for(let r=0;r<4&&ZAe(t.next);r++)t.advance();else if(e==yTn)for(let r=0;r<8&&ZAe(t.next);r++)t.advance();else if(e==mTn&&t.next==XAe){for(t.advance();t.next>=0&&t.next!=tLt&&t.next!=rLt&&t.next!=nLt&&t.next!=bC;)t.advance();t.next==tLt&&t.advance()}}const ETn=m1({'async "*" "**" FormatConversion FormatSpec':Re.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":Re.controlKeyword,"in not and or is del":Re.operatorKeyword,"from def class global nonlocal lambda":Re.definitionKeyword,import:Re.moduleKeyword,"with as print":Re.keyword,Boolean:Re.bool,None:Re.null,VariableName:Re.variableName,"CallExpression/VariableName":Re.function(Re.variableName),"FunctionDefinition/VariableName":Re.function(Re.definition(Re.variableName)),"ClassDefinition/VariableName":Re.definition(Re.className),PropertyName:Re.propertyName,"CallExpression/MemberExpression/PropertyName":Re.function(Re.propertyName),Comment:Re.lineComment,Number:Re.number,String:Re.string,FormatString:Re.special(Re.string),Escape:Re.escape,UpdateOp:Re.updateOperator,"ArithOp!":Re.arithmeticOperator,BitOp:Re.bitwiseOperator,CompareOp:Re.compareOperator,AssignOp:Re.definitionOperator,Ellipsis:Re.punctuation,At:Re.meta,"( )":Re.paren,"[ ]":Re.squareBracket,"{ }":Re.brace,".":Re.derefOperator,", ;":Re.separator}),_Tn={__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},RTn=w1.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:[CTn,wTn,xTn,OTn,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>_Tn[t]||-1}],tokenPrec:7668}),sLt=new x2e,lLt=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function RZ(t){return(e,r,n)=>{if(n)return!1;let i=e.node.getChild("VariableName");return i&&r(i,t),!0}}const DTn={FunctionDefinition:RZ("function"),ClassDefinition:RZ("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 o=i.getChild("import");o;o=o.nextSibling)o.name=="VariableName"&&((n=o.nextSibling)===null||n===void 0?void 0:n.name)!="as"&&e(o,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:RZ("variable"),AsPattern:RZ("variable"),__proto__:null};function cLt(t,e){let r=sLt.get(e);if(r)return r;let n=[],i=!0;function a(o,s){let l=t.sliceString(o.from,o.to);n.push({label:l,type:s})}return e.cursor(Ki.IncludeAnonymous).iterate(o=>{if(o.name){let s=DTn[o.name];if(s&&s(o,a,i)||!i&&lLt.has(o.name))return!1;i=!1}else if(o.to-o.from>8192){for(let s of cLt(t,o.node))n.push(s);return!1}}),sLt.set(e,n),n}const uLt=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,hLt=["String","FormatString","Comment","PropertyName"];function LTn(t){let e=wa(t.state).resolveInner(t.pos,-1);if(hLt.indexOf(e.name)>-1)return null;let r=e.name=="VariableName"||e.to-e.from<20&&uLt.test(t.state.sliceDoc(e.from,e.to));if(!r&&!t.explicit)return null;let n=[];for(let i=e;i;i=i.parent)lLt.has(i.name)&&(n=n.concat(cLt(t.state.doc,i)));return{options:n,from:r?e.from:t.pos,validFor:uLt}}const MTn=["__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"}))),ITn=[Do("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),Do("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),Do("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),Do("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),Do(`if \${}: -`,{label:"if",detail:"block",type:"keyword"}),Do("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),Do("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),Do("import ${module}",{label:"import",detail:"statement",type:"keyword"}),Do("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],MTn=Q4t(cLt,aAe(DTn.concat(LTn)));function JAe(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 eSe(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 tSe=v1.define({name:"python",parser:ETn.configure({props:[b1.add({Body:t=>{var e;let r=/^\s*(#|$)/.test(t.textAfter)&&JAe(t)||t.node;return(e=eSe(t,r))!==null&&e!==void 0?e:t.continue()},MatchBody:t=>{var e;let r=JAe(t);return(e=eSe(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":JR({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":JR({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":JR({closing:"]"}),MemberExpression:t=>t.baseIndent+t.unit,"String FormatString":()=>null,Script:t=>{var e;let r=JAe(t);return(e=r&&eSe(t,r))!==null&&e!==void 0?e:t.continue()}}),x1.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":V$,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 ITn(){return new I2(tSe,[tSe.data.of({autocomplete:RTn}),tSe.data.of({autocomplete:MTn})])}const l4=63,uLt=64,PTn=1,NTn=2,hLt=3,BTn=4,dLt=5,$Tn=6,FTn=7,fLt=65,zTn=66,UTn=8,VTn=9,QTn=10,GTn=11,HTn=12,pLt=13,WTn=19,YTn=20,qTn=29,jTn=33,XTn=34,KTn=47,ZTn=0,rSe=1,nSe=2,sF=3,iSe=4;class xC{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}}xC.top=new xC(null,-1,ZTn);function lF(t,e){for(let r=0,n=e-t.pos-1;;n--,r++){let i=t.peek(n);if(E1(i)||i==-1)return r}}function aSe(t){return t==32||t==9}function E1(t){return t==10||t==13}function gLt(t){return aSe(t)||E1(t)}function wC(t){return t<0||gLt(t)}const JTn=new dZ({start:xC.top,reduce(t,e){return t.type==sF&&(e==YTn||e==XTn)?t.parent:t},shift(t,e,r,n){if(e==hLt)return new xC(t,lF(n,n.pos),rSe);if(e==fLt||e==dLt)return new xC(t,lF(n,n.pos),nSe);if(e==l4)return t.parent;if(e==WTn||e==jTn)return new xC(t,0,sF);if(e==pLt&&t.type==iSe)return t.parent;if(e==KTn){let i=/[1-9]/.exec(n.read(n.pos,r.pos));if(i)return new xC(t,t.depth+ +i[0],iSe)}return t},hash(t){return t.hash}});function c4(t,e,r=0){return t.peek(r)==e&&t.peek(r+1)==e&&t.peek(r+2)==e&&wC(t.peek(r+3))}const eCn=new xs((t,e)=>{if(t.next==-1&&e.canShift(uLt))return t.acceptToken(uLt);let r=t.peek(-1);if((E1(r)||r<0)&&e.context.type!=sF){if(c4(t,45))if(e.canShift(l4))t.acceptToken(l4);else return t.acceptToken(PTn,3);if(c4(t,46))if(e.canShift(l4))t.acceptToken(l4);else return t.acceptToken(NTn,3);let n=0;for(;t.next==32;)n++,t.advance();(n{if(e.context.type==sF){t.next==63&&(t.advance(),wC(t.next)&&t.acceptToken(FTn));return}if(t.next==45)t.advance(),wC(t.next)&&t.acceptToken(e.context.type==rSe&&e.context.depth==lF(t,t.pos-1)?BTn:hLt);else if(t.next==63)t.advance(),wC(t.next)&&t.acceptToken(e.context.type==nSe&&e.context.depth==lF(t,t.pos-1)?$Tn:dLt);else{let r=t.pos;for(;;)if(aSe(t.next)){if(t.pos==r)return;t.advance()}else if(t.next==33)yLt(t);else if(t.next==38)oSe(t);else if(t.next==42){oSe(t);break}else if(t.next==39||t.next==34){if(sSe(t,!0))break;return}else if(t.next==91||t.next==123){if(!nCn(t))return;break}else{bLt(t,!0,!1,0);break}for(;aSe(t.next);)t.advance();if(t.next==58){if(t.pos==r&&e.canShift(qTn))return;let n=t.peek(1);wC(n)&&t.acceptTokenTo(e.context.type==nSe&&e.context.depth==lF(t,r)?zTn:fLt,r)}}},{contextual:!0});function rCn(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 mLt(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function vLt(t,e){return t.next==37?(t.advance(),mLt(t.next)&&t.advance(),mLt(t.next)&&t.advance(),!0):rCn(t.next)||e&&t.next==44?(t.advance(),!0):!1}function yLt(t){if(t.advance(),t.next==60){for(t.advance();;)if(!vLt(t,!0)){t.next==62&&t.advance();break}}else for(;vLt(t,!1););}function oSe(t){for(t.advance();!wC(t.next)&&DZ(t.next)!="f";)t.advance()}function sSe(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(E1(a)){if(e)return!1;n=!0}else if(e&&t.pos>=i+1024)return!1}return!n}function nCn(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(!sSe(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||E1(t.next))return!1;t.advance()}}const iCn="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function DZ(t){return t<33?"u":t>125?"s":iCn[t-33]}function lSe(t,e){let r=DZ(t);return r!="u"&&!(e&&r=="f")}function bLt(t,e,r,n){if(DZ(t.next)=="s"||(t.next==63||t.next==58||t.next==45)&&lSe(t.peek(1),r))t.advance();else return!1;let i=t.pos;for(;;){let a=t.next,o=0,s=n+1;for(;gLt(a);){if(E1(a)){if(e)return!1;s=0}else s++;a=t.peek(++o)}if(!(a>=0&&(a==58?lSe(t.peek(o+1),r):a==35?t.peek(o-1)!=32:lSe(a,r)))||!r&&s<=n||s==0&&!r&&(c4(t,45,o)||c4(t,46,o)))break;if(e&&DZ(a)=="f")return!1;for(let u=o;u>=0;u--)t.advance();if(e&&t.pos>i+1024)return!1}return!0}const aCn=new xs((t,e)=>{if(t.next==33)yLt(t),t.acceptToken(HTn);else if(t.next==38||t.next==42){let r=t.next==38?QTn:GTn;oSe(t),t.acceptToken(r)}else t.next==39||t.next==34?(sSe(t,!1),t.acceptToken(VTn)):bLt(t,!1,e.context.type==sF,e.context.depth)&&t.acceptToken(UTn)}),oCn=new xs((t,e)=>{let r=e.context.type==iSe?e.context.depth:-1,n=t.pos;e:for(;;){let i=0,a=t.next;for(;a==32;)a=t.peek(++i);if(!i&&(c4(t,45,i)||c4(t,46,i))||!E1(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:JTn,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[sCn],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:[eCn,tCn,aCn,oCn,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),cCn=v1.define({name:"yaml",parser:lCn.configure({props:[b1.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:JR({closing:"}"}),FlowSequence:JR({closing:"]"})}),x1.add({"FlowMapping FlowSequence":V$,"Item Pair BlockLiteral":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function uCn(){return new I2(cCn)}function hCn(t){xLt(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]=[],o=t[i],s=0;s2&&o.token&&typeof o.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 o=0;o{let{state:e}=t,r=e.doc.lineAt(e.selection.main.from),n=hSe(t.state,r.from);return n.line?kCn(t):n.block?_Cn(t):!1};function uSe(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 kCn=uSe(LCn,0),ECn=uSe(CLt,0),_Cn=uSe((t,e)=>CLt(t,e,DCn(e)),0);function hSe(t,e){let r=t.languageDataAt("commentTokens",e,1);return r.length?r[0]:{}}const cF=50;function RCn(t,{open:e,close:r},n,i){let a=t.sliceDoc(n-cF,n),o=t.sliceDoc(i,i+cF),s=/\s*$/.exec(a)[0].length,l=/^\s*/.exec(o)[0].length,u=a.length-s;if(a.slice(u-e.length,u)==e&&o.slice(l,l+r.length)==r)return{open:{pos:n-s,margin:s&&1},close:{pos:i+l,margin:l&&1}};let h,d;i-n<=2*cF?h=d=t.sliceDoc(n,i):(h=t.sliceDoc(n,n+cF),d=t.sliceDoc(i-cF,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 DCn(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 CLt(t,e,r=e.selection.ranges){let n=r.map(a=>hSe(e,a.from).block);if(!n.every(a=>a))return null;let i=r.map((a,o)=>RCn(e,n[o],a.from,a.to));if(t!=2&&!i.every(a=>a))return{changes:e.changes(r.map((a,o)=>i[o]?[]:[{from:a.from,insert:n[o].open+" "},{from:a.to,insert:" "+n[o].close}]))};if(t!=1&&i.some(a=>a)){let a=[];for(let o=0,s;oi&&(a==o||o>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:s,token:l,indent:u,empty:h,single:d}of n)(d||!h)&&a.push({from:s.from+u,insert:l+" "});let o=e.changes(a);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&n.some(a=>a.comment>=0)){let a=[];for(let{line:o,comment:s,token:l}of n)if(s>=0){let u=o.from+s,h=u+l.length;o.text[h-o.from]==" "&&h++,a.push({from:u,to:h})}return{changes:a}}return null}const dSe=k0.define(),MCn=k0.define(),ICn=vr.define(),OLt=vr.define({combine(t){return E0(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)})}}),kLt=Ko.define({create(){return $0.empty},update(t,e){let r=e.state.facet(OLt),n=e.annotation(dSe);if(n){let l=Kh.fromTransaction(e,n.selection),u=n.side,h=u==0?t.undone:t.done;return l?h=MZ(h,h.length,r.minDepth,l):h=RLt(h,e.startState.selection),new $0(u==0?n.rest:h,u==0?h:n.rest)}let i=e.annotation(MCn);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(Us.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let a=Kh.fromTransaction(e),o=e.annotation(Us.time),s=e.annotation(Us.userEvent);return a?t=t.addChanges(a,o,s,r,e):e.selection&&(t=t.addSelection(e.startState.selection,o,s,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 $0(t.done.map(Kh.fromJSON),t.undone.map(Kh.fromJSON))}});function PCn(t={}){return[kLt,OLt.of(t),er.domEventHandlers({beforeinput(e,r){let n=e.inputType=="historyUndo"?ELt:e.inputType=="historyRedo"?fSe:null;return n?(e.preventDefault(),n(r)):!1}})]}function LZ(t,e){return function({state:r,dispatch:n}){if(!e&&r.readOnly)return!1;let i=r.field(kLt,!1);if(!i)return!1;let a=i.pop(t,r,e);return a?(n(a),!0):!1}}const ELt=LZ(0,!1),fSe=LZ(1,!1),NCn=LZ(0,!0),BCn=LZ(1,!0);class Kh{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 Kh(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 Kh(e.changes&&bs.fromJSON(e.changes),[],e.mapped&&O0.fromJSON(e.mapped),e.startSelection&&xt.fromJSON(e.startSelection),e.selectionsAfter.map(xt.fromJSON))}static fromTransaction(e,r){let n=Tp;for(let i of e.startState.facet(ICn)){let a=i(e);a.length&&(n=n.concat(a))}return!n.length&&e.changes.empty?null:new Kh(e.changes.invert(e.startState.doc),n,void 0,r||e.startState.selection,Tp)}static selection(e){return new Kh(void 0,Tp,void 0,void 0,e)}}function MZ(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 $Cn(t,e){let r=[],n=!1;return t.iterChangedRanges((i,a)=>r.push(i,a)),e.iterChangedRanges((i,a,o,s)=>{for(let l=0;l=u&&o<=h&&(n=!0)}}),n}function FCn(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((r,n)=>r.empty!=e.ranges[n].empty).length===0}function _Lt(t,e){return t.length?e.length?t.concat(e):t:e}const Tp=[],zCn=200;function RLt(t,e){if(t.length){let r=t[t.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-zCn));return n.length&&n[n.length-1].eq(e)?t:(n.push(e),MZ(t,t.length-1,1e9,r.setSelAfter(n)))}else return[Kh.selection([e])]}function UCn(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 pSe(t,e){if(!t.length)return t;let r=t.length,n=Tp;for(;r;){let i=VCn(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?[Kh.selection(n)]:Tp}function VCn(t,e,r){let n=_Lt(t.selectionsAfter.length?t.selectionsAfter.map(s=>s.map(e)):Tp,r);if(!t.changes)return Kh.selection(n);let i=t.changes.map(e),a=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(a):a;return new Kh(i,on.mapEffects(t.effects,e),o,t.startSelection.map(a),n)}const QCn=/^(input\.type|delete)($|\.)/;class $0{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 $0(this.done,this.undone):this}addChanges(e,r,n,i,a){let o=this.done,s=o[o.length-1];return s&&s.changes&&!s.changes.empty&&e.changes&&(!n||QCn.test(n))&&(!s.selectionsAfter.length&&r-this.prevTime0&&r-this.prevTimer.empty?t.moveByChar(r,e):IZ(r,e))}function cu(t){return t.textDirectionAt(t.state.selection.main.head)==Ra.LTR}const LLt=t=>DLt(t,!cu(t)),MLt=t=>DLt(t,cu(t));function ILt(t,e){return Bg(t,r=>r.empty?t.moveByGroup(r,e):IZ(r,e))}const HCn=t=>ILt(t,!cu(t)),WCn=t=>ILt(t,cu(t));function YCn(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 PZ(t,e,r){let n=wa(t).resolveInner(e.head),i=r?_n.closedBy:_n.openedBy;for(let l=e.head;;){let u=r?n.childAfter(l):n.childBefore(l);if(!u)break;YCn(t,u,i)?n=u:l=r?u.to:u.from}let a=n.type.prop(i),o,s;return a&&(o=r?N0(t,n.from,1):N0(t,n.to,-1))&&o.matched?s=r?o.end.to:o.end.from:s=r?n.to:n.from,xt.cursor(s,r?-1:1)}const qCn=t=>Bg(t,e=>PZ(t.state,e,!cu(t))),jCn=t=>Bg(t,e=>PZ(t.state,e,cu(t)));function PLt(t,e){return Bg(t,r=>{if(!r.empty)return IZ(r,e);let n=t.moveVertically(r,e);return n.head!=r.head?n:t.moveToLineBoundary(r,e)})}const NLt=t=>PLt(t,!1),BLt=t=>PLt(t,!0);function $Lt(t){let e=t.scrollDOM.clientHeighto.empty?t.moveVertically(o,e,r.height):IZ(o,e));if(i.eq(n.selection))return!1;let a;if(r.selfScroll){let o=t.coordsAtPos(n.selection.main.head),s=t.scrollDOM.getBoundingClientRect(),l=s.top+r.marginTop,u=s.bottom-r.marginBottom;o&&o.top>l&&o.bottomFLt(t,!1),gSe=t=>FLt(t,!0);function N2(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=xt.cursor(n.from+a))}return i}const XCn=t=>Bg(t,e=>N2(t,e,!0)),KCn=t=>Bg(t,e=>N2(t,e,!1)),ZCn=t=>Bg(t,e=>N2(t,e,!cu(t))),JCn=t=>Bg(t,e=>N2(t,e,cu(t))),eOn=t=>Bg(t,e=>xt.cursor(t.lineBlockAt(e.head).from,1)),tOn=t=>Bg(t,e=>xt.cursor(t.lineBlockAt(e.head).to,-1));function rOn(t,e,r){let n=!1,i=u4(t.selection,a=>{let o=N0(t,a.head,-1)||N0(t,a.head,1)||a.head>0&&N0(t,a.head-1,1)||a.headrOn(t,e);function Cp(t,e,r){let n=u4(t.state.selection,i=>{i.undirectional&&i.head>=i.anchor!=e&&(i=xt.range(i.head,i.anchor));let a=r(i);return xt.range(i.anchor,a.head,a.goalColumn,a.bidiLevel||void 0,a.assoc)});return n.eq(t.state.selection)?!1:(t.dispatch(Ng(t.state,n)),!0)}function ULt(t,e){return Cp(t,e,r=>t.moveByChar(r,e))}const VLt=t=>ULt(t,!cu(t)),QLt=t=>ULt(t,cu(t));function GLt(t,e){return Cp(t,e,r=>t.moveByGroup(r,e))}const iOn=t=>GLt(t,!cu(t)),aOn=t=>GLt(t,cu(t)),oOn=t=>{let e=!cu(t);return Cp(t,e,r=>PZ(t.state,r,e))},sOn=t=>{let e=cu(t);return Cp(t,e,r=>PZ(t.state,r,e))};function HLt(t,e){return Cp(t,e,r=>t.moveVertically(r,e))}const WLt=t=>HLt(t,!1),YLt=t=>HLt(t,!0);function qLt(t,e){return Cp(t,e,r=>t.moveVertically(r,e,$Lt(t).height))}const jLt=t=>qLt(t,!1),XLt=t=>qLt(t,!0),lOn=t=>Cp(t,!0,e=>N2(t,e,!0)),cOn=t=>Cp(t,!1,e=>N2(t,e,!1)),uOn=t=>{let e=!cu(t);return Cp(t,e,r=>N2(t,r,e))},hOn=t=>{let e=cu(t);return Cp(t,e,r=>N2(t,r,e))},dOn=t=>Cp(t,!1,e=>xt.cursor(t.lineBlockAt(e.head).from)),fOn=t=>Cp(t,!0,e=>xt.cursor(t.lineBlockAt(e.head).to)),KLt=({state:t,dispatch:e})=>(e(Ng(t,{anchor:0})),!0),ZLt=({state:t,dispatch:e})=>(e(Ng(t,{anchor:t.doc.length})),!0),JLt=({state:t,dispatch:e})=>(e(Ng(t,{anchor:t.selection.main.anchor,head:0})),!0),eMt=({state:t,dispatch:e})=>(e(Ng(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),pOn=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),gOn=({state:t,dispatch:e})=>{let r=BZ(t).map(({from:n,to:i})=>xt.range(n,Math.min(i+1,t.doc.length)));return e(t.update({selection:xt.create(r),userEvent:"select"})),!0},mOn=({state:t,dispatch:e})=>{let r=u4(t.selection,n=>{let i=wa(t),a=i.resolveStack(n.from,1);if(n.empty){let o=i.resolveStack(n.from,-1);o.node.from>=a.node.from&&o.node.to<=a.node.to&&(a=o)}for(let o=a;o;o=o.next){let{node:s}=o;if((s.from=n.to||s.to>n.to&&s.from<=n.from)&&o.next)return xt.range(s.to,s.from)}return n});return r.eq(t.selection)?!1:(e(Ng(t,r)),!0)};function tMt(t,e){let{state:r}=t,n=r.selection,i=r.selection.ranges.slice();for(let a of r.selection.ranges){let o=r.doc.lineAt(a.head);if(e?o.to0)for(let s=a;;){let l=t.moveVertically(s,e);if(l.heado.to){i.some(u=>u.head==l.head)||i.push(l);break}else{if(l.head==s.head)break;s=l}}}return i.length==n.ranges.length?!1:(t.dispatch(Ng(r,xt.create(i,i.length-1))),!0)}const vOn=t=>tMt(t,!1),yOn=t=>tMt(t,!0),bOn=({state:t,dispatch:e})=>{let r=t.selection,n=null;return r.ranges.length>1?n=xt.create([r.main]):r.main.empty||(n=xt.create([xt.cursor(r.main.head)])),n?(e(Ng(t,n)),!0):!1};function uF(t,e){if(t.state.readOnly)return!1;let r="delete.selection",{state:n}=t,i=n.changeByRange(a=>{let{from:o,to:s}=a;if(o==s){let l=e(a);lo&&(r="delete.forward",l=NZ(t,l,!0)),o=Math.min(o,l),s=Math.max(s,l)}else o=NZ(t,o,!1),s=NZ(t,s,!0);return o==s?{range:a}:{changes:{from:o,to:s},range:xt.cursor(o,oi(t)))n.between(e,e,(i,a)=>{ie&&(e=r?a:i)});return e}const rMt=(t,e,r)=>uF(t,n=>{let i=n.from,{state:a}=t,o=a.doc.lineAt(i),s,l;if(r&&!e&&i>o.from&&irMt(t,!1,!0),nMt=t=>rMt(t,!0,!1),iMt=(t,e)=>uF(t,r=>{let n=r.head,{state:i}=t,a=i.doc.lineAt(n),o=i.charCategorizer(n);for(let s=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=Ul(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=o(u);if(s!=null&&h!=s)break;(u!=" "||n!=r.head)&&(s=h),n=l}return n}),aMt=t=>iMt(t,!1),xOn=t=>iMt(t,!0),wOn=t=>uF(t,e=>{let r=t.lineBlockAt(e.head).to;return e.headuF(t,e=>{let r=t.moveToLineBoundary(e,!1).head;return e.head>r?r:Math.max(0,e.head-1)}),SOn=t=>uF(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:wi.of(["",""])},range:xt.cursor(n.from)}));return e(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0},COn=({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),o=i==a.from?i-1:Ul(a.text,i-a.from,!1)+a.from,s=i==a.to?i+1:Ul(a.text,i-a.from,!0)+a.from;return{changes:{from:o,to:s,insert:t.doc.slice(i,s).append(t.doc.slice(o,i))},range:xt.cursor(s)}});return r.changes.empty?!1:(e(t.update(r,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function BZ(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 o=e[e.length-1];o.to=a.to,o.ranges.push(n)}else e.push({from:i.from,to:a.to,ranges:[n]});r=a.number+1}return e}function oMt(t,e,r){if(t.readOnly)return!1;let n=[],i=[];for(let a of BZ(t)){if(r?a.to==t.doc.length:a.from==0)continue;let o=t.doc.lineAt(r?a.to+1:a.from-1),s=o.length+1;if(r){n.push({from:a.to,to:o.to},{from:a.from,insert:o.text+t.lineBreak});for(let l of a.ranges)i.push(xt.range(Math.min(t.doc.length,l.anchor+s),Math.min(t.doc.length,l.head+s)))}else{n.push({from:o.from,to:a.from},{from:a.to,insert:t.lineBreak+o.text});for(let l of a.ranges)i.push(xt.range(l.anchor-s,l.head-s))}}return n.length?(e(t.update({changes:n,scrollIntoView:!0,selection:xt.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const OOn=({state:t,dispatch:e})=>oMt(t,e,!1),kOn=({state:t,dispatch:e})=>oMt(t,e,!0);function sMt(t,e,r){if(t.readOnly)return!1;let n=[];for(let a of BZ(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 EOn=({state:t,dispatch:e})=>sMt(t,e,!1),_On=({state:t,dispatch:e})=>sMt(t,e,!0),ROn=t=>{if(t.state.readOnly)return!1;let{state:e}=t,r=e.changes(BZ(e).map(({from:i,to:a})=>(i>0?i--:a{let a;if(t.lineWrapping){let o=t.lineBlockAt(i.head),s=t.coordsAtPos(i.head,i.assoc||1);s&&(a=o.bottom+t.documentTop-s.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 DOn(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let r=wa(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(_n.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 lMt=cMt(!1),LOn=cMt(!0);function cMt(t){return({state:e,dispatch:r})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{let{from:a,to:o}=i,s=e.doc.lineAt(a),l=!t&&a==o&&DOn(e,a);t&&(a=o=(o<=s.to?s:e.doc.lineAt(o)).to);let u=new iZ(e,{simulateBreak:a,simulateDoubleBreak:!!l}),h=Qwe(u,a);for(h==null&&(h=Lg(/^\s*/.exec(e.doc.lineAt(a).text)[0],e.tabSize));os.from&&a{let i=[];for(let o=n.from;o<=n.to;){let s=t.doc.lineAt(o);s.number>r&&(n.empty||n.to>s.from)&&(e(s,i,n),r=s.number),o=s.to+1}let a=t.changes(i);return{changes:i,range:xt.range(a.mapPos(n.anchor,1),a.mapPos(n.head,1))}})}const MOn=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=Object.create(null),n=new iZ(t,{overrideIndentation:a=>{let o=r[a];return o??-1}}),i=vSe(t,(a,o,s)=>{let l=Qwe(n,a.from);if(l==null)return;/\S/.test(a.text)||(l=0);let u=/^\s*/.exec(a.text)[0],h=U$(t,l);(u!=h||s.fromt.readOnly?!1:(e(t.update(vSe(t,(r,n)=>{n.push({from:r.from,insert:t.facet(ZR)})}),{userEvent:"input.indent"})),!0),hMt=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(vSe(t,(r,n)=>{let i=/^\s*/.exec(r.text)[0];if(!i)return;let a=Lg(i,t.tabSize),o=0,s=U$(t,Math.max(0,a-pC(t)));for(;o(t.setTabFocusMode(),!0),POn=[{key:"Ctrl-b",run:LLt,shift:VLt,preventDefault:!0},{key:"Ctrl-f",run:MLt,shift:QLt},{key:"Ctrl-p",run:NLt,shift:WLt},{key:"Ctrl-n",run:BLt,shift:YLt},{key:"Ctrl-a",run:eOn,shift:dOn},{key:"Ctrl-e",run:tOn,shift:fOn},{key:"Ctrl-d",run:nMt},{key:"Ctrl-h",run:mSe},{key:"Ctrl-k",run:wOn},{key:"Ctrl-Alt-h",run:aMt},{key:"Ctrl-o",run:TOn},{key:"Ctrl-t",run:COn},{key:"Ctrl-v",run:gSe}],NOn=[{key:"ArrowLeft",run:LLt,shift:VLt,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:HCn,shift:iOn,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:ZCn,shift:uOn,preventDefault:!0},{key:"ArrowRight",run:MLt,shift:QLt,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:WCn,shift:aOn,preventDefault:!0},{mac:"Cmd-ArrowRight",run:JCn,shift:hOn,preventDefault:!0},{key:"ArrowUp",run:NLt,shift:WLt,preventDefault:!0},{mac:"Cmd-ArrowUp",run:KLt,shift:JLt},{mac:"Ctrl-ArrowUp",run:zLt,shift:jLt},{key:"ArrowDown",run:BLt,shift:YLt,preventDefault:!0},{mac:"Cmd-ArrowDown",run:ZLt,shift:eMt},{mac:"Ctrl-ArrowDown",run:gSe,shift:XLt},{key:"PageUp",run:zLt,shift:jLt},{key:"PageDown",run:gSe,shift:XLt},{key:"Home",run:KCn,shift:cOn,preventDefault:!0},{key:"Mod-Home",run:KLt,shift:JLt},{key:"End",run:XCn,shift:lOn,preventDefault:!0},{key:"Mod-End",run:ZLt,shift:eMt},{key:"Enter",run:lMt,shift:lMt},{key:"Mod-a",run:pOn},{key:"Backspace",run:mSe,shift:mSe,preventDefault:!0},{key:"Delete",run:nMt,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:aMt,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:xOn,preventDefault:!0},{mac:"Mod-Backspace",run:AOn,preventDefault:!0},{mac:"Mod-Delete",run:SOn,preventDefault:!0}].concat(POn.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),BOn=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:qCn,shift:oOn},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:jCn,shift:sOn},{key:"Alt-ArrowUp",run:OOn},{key:"Shift-Alt-ArrowUp",run:EOn},{key:"Alt-ArrowDown",run:kOn},{key:"Shift-Alt-ArrowDown",run:_On},{key:"Mod-Alt-ArrowUp",run:vOn},{key:"Mod-Alt-ArrowDown",run:yOn},{key:"Escape",run:bOn},{key:"Mod-Enter",run:LOn},{key:"Alt-l",mac:"Ctrl-l",run:gOn},{key:"Mod-i",run:mOn,preventDefault:!0},{key:"Mod-[",run:hMt},{key:"Mod-]",run:uMt},{key:"Mod-Alt-\\",run:MOn},{key:"Shift-Mod-k",run:ROn},{key:"Shift-Mod-\\",run:nOn},{key:"Mod-/",run:OCn},{key:"Alt-A",run:ECn},{key:"Ctrl-m",mac:"Shift-Alt-m",run:IOn}].concat(NOn),$On={key:"Tab",run:uMt,shift:hMt},dMt=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class h4{constructor(e,r,n=0,i=e.length,a,o){this.test=o,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?s=>a(dMt(s)):dMt,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 Yh(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=T2e(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=C0(e);let i=this.normalize(r);if(i.length)for(let a=0,o=n,s=!0;;a++){let l=i.charCodeAt(a),u=this.match(l,o,s,this.bufferPos+this.bufferStart,a==i.length-1);if(u)return this.value=u,this;if(a==i.length-1)break;s&&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=$Z(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 s=new d4(r,e.sliceString(r,n));return bSe.set(e,s),s}if(i.from==r&&i.to==n)return i;let{text:a,from:o}=i;return o>r&&(a=e.sliceString(r,o)+a,o=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=$Z(this.text,i+(n==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=d4.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(pMt.prototype[Symbol.iterator]=gMt.prototype[Symbol.iterator]=function(){return this});function FOn(t){try{return new RegExp(t,ySe),!0}catch{return!1}}function $Z(t,e){if(e>=t.length)return e;let r=t.lineAt(e),n;for(;e=56320&&n<57344;)e++;return e}const zOn=t=>{let{state:e}=t,r=String(e.doc.lineAt(t.state.selection.main.head).number),{close:n,result:i}=cbn(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 o=a&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(a.elements.line.value);if(!o){t.dispatch({effects:n});return}let s=e.doc.lineAt(e.selection.main.head),[,l,u,h,d]=o,f=h?+h.slice(1):0,p=u?+u:s.number;if(u&&d){let v=p/100;l&&(v=v*(l=="-"?-1:1)+s.number/e.doc.lines),p=Math.round(e.doc.lines*v)}else u&&l&&(p=p*(l=="-"?-1:1)+s.number);let g=e.doc.line(Math.max(1,Math.min(e.doc.lines,p))),m=xt.cursor(g.from+Math.max(0,Math.min(f,g.length)));t.dispatch({effects:[n,er.scrollIntoView(m.from,{y:"center"})],selection:m})}),!0},UOn={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},VOn=vr.define({combine(t){return E0(t,UOn,{highlightWordAroundCursor:(e,r)=>e||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function QOn(t){return[qOn,YOn]}const GOn=Ar.mark({class:"cm-selectionMatch"}),HOn=Ar.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function mMt(t,e,r,n){return(r==0||t(e.sliceDoc(r-1,r))!=Ao.Word)&&(n==e.doc.length||t(e.sliceDoc(n,n+1))!=Ao.Word)}function WOn(t,e,r,n){return t(e.sliceDoc(r,r+1))==Ao.Word&&t(e.sliceDoc(n-1,n))==Ao.Word}const YOn=Ro.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(VOn),{state:r}=t,n=r.selection;if(n.ranges.length>1)return Ar.none;let i=n.main,a,o=null;if(i.empty){if(!e.highlightWordAroundCursor)return Ar.none;let l=r.wordAt(i.head);if(!l)return Ar.none;o=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),o=r.charCategorizer(i.head),!(mMt(o,r,i.from,i.to)&&WOn(o,r,i.from,i.to)))return Ar.none}else if(a=r.sliceDoc(i.from,i.to),!a)return Ar.none}let s=[];for(let l of t.visibleRanges){let u=new h4(r.doc,a,l.from,l.to);for(;!u.next().done;){let{from:h,to:d}=u.value;if((!o||mMt(o,r,h,d))&&(i.empty&&h<=i.from&&d>=i.to?s.push(HOn.range(h,d)):(h>=i.to||d<=i.from)&&s.push(GOn.range(h,d)),s.length>e.maxMatches))return Ar.none}}return Ar.set(s)}},{decorations:t=>t.decorations}),qOn=er.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),jOn=({state:t,dispatch:e})=>{let{selection:r}=t,n=xt.create(r.ranges.map(i=>t.wordAt(i.head)||xt.cursor(i.head)),r.mainIndex);return n.eq(r)?!1:(e(t.update({selection:n})),!0)};function XOn(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 o=!1,s=new h4(t.doc,e,n[n.length-1].to);;)if(s.next(),s.done){if(o)return null;s=new h4(t.doc,e,0,Math.max(0,n[n.length-1].from-1)),o=!0}else{if(o&&n.some(l=>l.from==s.value.from))continue;if(a){let l=t.wordAt(s.value.from);if(!l||l.from!=s.value.from||l.to!=s.value.to)continue}return s.value}}const KOn=({state:t,dispatch:e})=>{let{ranges:r}=t.selection;if(r.some(a=>a.from===a.to))return jOn({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=XOn(t,n);return i?(e(t.update({selection:t.selection.addRange(xt.range(i.from,i.to),!1),effects:er.scrollIntoView(i.to)})),!0):!1},f4=vr.define({combine(t){return E0(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new hkn(e),scrollToMatch:e=>er.scrollIntoView(e)})}});class vMt{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||FOn(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 nkn(this):new ekn(this)}getCursor(e,r=0,n){let i=e.doc?e:ei.create({doc:e});return n==null&&(n=i.doc.length),this.regexp?g4(this,i,r,n):p4(this,i,r,n)}}class yMt{constructor(e){this.spec=e}}function ZOn(t,e,r){return(n,i,a,o)=>{if(r&&!r(n,i,a,o))return!1;let s=n>=o&&i<=o+a.length?a.slice(n-o,i-o):e.doc.sliceString(n,i);return t(s,e,n,i)}}function p4(t,e,r,n){let i;return t.wholeWord&&(i=JOn(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(i=ZOn(t.test,e,i)),new h4(e.doc,t.unquoted,r,n,t.caseSensitive?void 0:a=>a.toLowerCase(),i)}function JOn(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=p4(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 tkn(t,e,r){return(n,i,a)=>(!r||r(n,i,a))&&t(a[0],e,n,i)}function g4(t,e,r,n){let i;return t.wholeWord&&(i=rkn(e.charCategorizer(e.selection.main.head))),t.test&&(i=tkn(t.test,e,i)),new pMt(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:i},r,n)}function FZ(t,e){return t.slice(Ul(t,e,!1),e)}function zZ(t,e){return t.slice(e,Ul(t,e))}function rkn(t){return(e,r,n)=>!n[0].length||(t(FZ(n.input,n.index))!=Ao.Word||t(zZ(n.input,n.index))!=Ao.Word)&&(t(zZ(n.input,n.index+n[0].length))!=Ao.Word||t(FZ(n.input,n.index+n[0].length))!=Ao.Word)}class nkn extends yMt{nextMatch(e,r,n){let i=g4(this.spec,e,n,e.doc.length).next();return i.done&&(i=g4(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),o=g4(this.spec,e,a,n),s=null;for(;!o.next().done;)s=o.value;if(s&&(a==r||s.from>a+10))return s;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=g4(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 hF=on.define(),xSe=on.define(),B2=Ko.define({create(t){return new wSe(SSe(t).create(),null)},update(t,e){for(let r of e.effects)r.is(hF)?t=new wSe(r.value.create(),t.panel):r.is(xSe)&&(t=new wSe(t.query,r.value?ASe:null));return t},provide:t=>N$.from(t,e=>e.panel)});class wSe{constructor(e,r){this.query=e,this.panel=r}}const ikn=Ar.mark({class:"cm-searchMatch"}),akn=Ar.mark({class:"cm-searchMatch cm-searchMatch-selected"}),okn=Ro.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(B2))}update(t){let e=t.state.field(B2);(e!=t.startState.field(B2)||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 Qu;for(let i=0,a=r.visibleRanges,o=a.length;ia[i+1].from-2*250;)l=a[++i].to;t.highlight(r.state,s,l,(u,h)=>{let d=r.state.selection.ranges.some(f=>f.from==u&&f.to==h);n.add(u,h,d?akn:ikn)})}return n.finish()}},{decorations:t=>t.decorations});function dF(t){return e=>{let r=e.state.field(B2,!1);return r&&r.query.spec.valid?t(e,r):AMt(e)}}const UZ=dF((t,{query:e})=>{let{to:r}=t.state.selection.main,n=e.nextMatch(t.state,r,r);if(!n)return!1;let i=xt.single(n.from,n.to),a=t.state.facet(f4);return t.dispatch({selection:i,effects:[TSe(t,n),a.scrollToMatch(i.main,t)],userEvent:"select.search"}),wMt(t),!0}),VZ=dF((t,{query:e})=>{let{state:r}=t,{from:n}=r.selection.main,i=e.prevMatch(r,n,n);if(!i)return!1;let a=xt.single(i.from,i.to),o=t.state.facet(f4);return t.dispatch({selection:a,effects:[TSe(t,i),o.scrollToMatch(a.main,t)],userEvent:"select.search"}),wMt(t),!0}),skn=dF((t,{query:e})=>{let r=e.matchAll(t.state,1e3);return!r||!r.length?!1:(t.dispatch({selection:xt.create(r.map(n=>xt.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),lkn=({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=[],o=0;for(let s=new h4(t.doc,t.sliceDoc(n,i));!s.next().done;){if(a.length>1e3)return!1;s.value.from==n&&(o=a.length),a.push(xt.range(s.value.from,s.value.to))}return e(t.update({selection:xt.create(a,o),userEvent:"select.search.matches"})),!0},bMt=dF((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 o=a,s=[],l,u,h=[];o.precise?o.from==n&&o.to==i&&(u=r.toText(e.getReplacement(o)),s.push({from:o.from,to:o.to,insert:u}),o=e.nextMatch(r,o.from,o.to),h.push(er.announce.of(r.phrase("replaced match on line $",r.doc.lineAt(n).number)+"."))):o=e.nextMatch(r,o.from,o.to);let d=t.state.changes(s);return o&&(l=xt.single(o.from,o.to).map(d),h.push(TSe(t,o)),h.push(r.facet(f4).scrollToMatch(l.main,t))),t.dispatch({changes:d,selection:l,effects:h,userEvent:"input.replace"}),!0}),ckn=dF((t,{query:e})=>{if(t.state.readOnly)return!1;let r=[];for(let i of e.matchAll(t.state,1e9)){let{from:a,to:o,precise:s}=i;s&&r.push({from:a,to:o,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 ASe(t){return t.state.facet(f4).createPanel(t)}function SSe(t,e){var r,n,i,a,o;let s=t.selection.main,l=s.empty||s.to>s.from+100?"":t.sliceDoc(s.from,s.to);if(e&&!l)return e;let u=t.facet(f4);return new vMt({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:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:u.wholeWord})}function xMt(t){let e=Lwe(t,ASe);return e&&e.dom.querySelector("[main-field]")}function wMt(t){let e=xMt(t);e&&e==t.root.activeElement&&e.select()}const AMt=t=>{let e=t.state.field(B2,!1);if(e&&e.panel){let r=xMt(t);if(r&&r!=t.root.activeElement){let n=SSe(t.state,e.query.spec);n.valid&&t.dispatch({effects:hF.of(n)}),r.focus(),r.select()}}else t.dispatch({effects:[xSe.of(!0),e?hF.of(SSe(t.state,e.query.spec)):on.appendConfig.of(fkn)]});return!0},SMt=t=>{let e=t.state.field(B2,!1);if(!e||!e.panel)return!1;let r=Lwe(t,ASe);return r&&r.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:xSe.of(!1)}),!0},ukn=[{key:"Mod-f",run:AMt,scope:"editor search-panel"},{key:"F3",run:UZ,shift:VZ,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:UZ,shift:VZ,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:SMt,scope:"editor search-panel"},{key:"Mod-Shift-l",run:lkn},{key:"Mod-Alt-g",run:zOn},{key:"Mod-d",run:KOn,preventDefault:!0}];class hkn{constructor(e){this.view=e;let r=this.query=e.state.field(B2).query.spec;this.commit=this.commit.bind(this),this.searchField=xa("input",{value:r.search,placeholder:af(e,"Find"),"aria-label":af(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=xa("input",{value:r.replace,placeholder:af(e,"Replace"),"aria-label":af(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=xa("input",{type:"checkbox",name:"case",form:"",checked:r.caseSensitive,onchange:this.commit}),this.reField=xa("input",{type:"checkbox",name:"re",form:"",checked:r.regexp,onchange:this.commit}),this.wordField=xa("input",{type:"checkbox",name:"word",form:"",checked:r.wholeWord,onchange:this.commit});function n(i,a,o){return xa("button",{class:"cm-button",name:i,onclick:a,type:"button"},o)}this.dom=xa("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,n("next",()=>UZ(e),[af(e,"next")]),n("prev",()=>VZ(e),[af(e,"previous")]),n("select",()=>skn(e),[af(e,"all")]),xa("label",null,[this.caseField,af(e,"match case")]),xa("label",null,[this.reField,af(e,"regexp")]),xa("label",null,[this.wordField,af(e,"by word")]),...e.state.readOnly?[]:[xa("br"),this.replaceField,n("replace",()=>bMt(e),[af(e,"replace")]),n("replaceAll",()=>ckn(e),[af(e,"replace all")])],xa("button",{name:"close",onclick:()=>SMt(e),"aria-label":af(e,"close"),type:"button"},["×"])])}commit(){let e=new vMt({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:hF.of(e)}))}keydown(e){y1n(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?VZ:UZ)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),bMt(this.view))}update(e){for(let r of e.transactions)for(let n of r.effects)n.is(hF)&&!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(f4).top}}function af(t,e){return t.state.phrase(e)}const QZ=30,GZ=/[\s\.,:;?!]/;function TSe(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-QZ),o=Math.min(i,r+QZ),s=t.state.sliceDoc(a,o);if(a!=n.from){for(let l=0;ls.length-QZ;l--)if(!GZ.test(s[l-1])&&GZ.test(s[l])){s=s.slice(0,l);break}}return er.announce.of(`${t.state.phrase("current match")}. ${s} ${t.state.phrase("on line")} ${n.number}.`)}const dkn=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"}}),fkn=[B2,Zd.low(okn),dkn];class TMt{constructor(e,r,n){this.from=e,this.to=r,this.diagnostic=n}}class AC{constructor(e,r,n){this.diagnostics=e,this.panel=r,this.selected=n}static init(e,r,n){let i=n.facet(fF).markerFilter;i&&(e=i(e,n));let a=e.slice().sort((p,g)=>p.from-g.from||p.to-g.to),o=new Qu,s=[],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&&!s.length)break;let m,v;if(s.length)m=l,v=s.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,s.push(g),p++}for(;px.from||x.to==m))s.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(s.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=Ckn(s);if(y)o.add(m,m,Ar.widget({widget:new wkn(b),diagnostics:s.slice()}));else{let x=s.reduce((w,A)=>A.markClass?w+" "+A.markClass:w,"");o.add(m,v,Ar.mark({class:"cm-lintRange cm-lintRange-"+b+x,diagnostics:s.slice(),inclusiveEnd:s.some(w=>w.to>v)}))}if(l=v,l==d)break;for(let x=0;x{if(!(e&&o.diagnostics.indexOf(e)<0))if(!n)n=new TMt(i,a,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new TMt(n.from,a,n.diagnostic)}}),n}function pkn(t,e){let r=e.pos,n=e.end||r,i=t.state.facet(fF).hideOn(t,r,n);if(i!=null)return i;let a=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(o=>o.is(CMt))||t.changes.touchesRange(a.from,Math.max(a.to,n)))}function gkn(t,e){return t.field(of,!1)?e:e.concat(on.appendConfig.of(Okn))}const CMt=on.define(),CSe=on.define(),OMt=on.define(),of=Ko.define({create(){return new AC(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=$2(r,t.selected.diagnostic,a)||$2(r,null,a)}!r.size&&i&&e.state.facet(fF).autoPanel&&(i=null),t=new AC(r,i,n)}for(let r of e.effects)if(r.is(CMt)){let n=e.state.facet(fF).autoPanel?r.value.length?pF.open:null:t.panel;t=AC.init(r.value,n,e.state)}else r.is(CSe)?t=new AC(t.diagnostics,r.value?pF.open:null,t.selected):r.is(OMt)&&(t=new AC(t.diagnostics,t.panel,r.value));return t},provide:t=>[N$.from(t,e=>e.panel),er.decorations.from(t,e=>e.diagnostics)]}),mkn=Ar.mark({class:"cm-lintRange cm-lintRange-active"});function vkn(t,e,r){let{diagnostics:n}=t.state.field(of),i,a=-1,o=-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)&&(eRMt(t,r,!1)))}const bkn=t=>{let e=t.state.field(of,!1);(!e||!e.panel)&&t.dispatch({effects:gkn(t.state,[CSe.of(!0)])});let r=Lwe(t,pF.open);return r&&r.dom.querySelector(".cm-panel-lint ul").focus(),!0},kMt=t=>{let e=t.state.field(of,!1);return!e||!e.panel?!1:(t.dispatch({effects:CSe.of(!1)}),!0)},xkn=[{key:"Mod-Shift-m",run:bkn,preventDefault:!0},{key:"F8",run:t=>{let e=t.state.field(of,!1);if(!e)return!1;let r=t.state.selection.main,n=$2(e.diagnostics,null,r.to+1);return!n&&(n=$2(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}),sbn(t,n.from,1,{tooltip:LMt,until:i=>i.docChanged||i.newSelection.main.headn.to}),!0)}}],fF=vr.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...E0(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:EMt,tooltipFilter:EMt,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 EMt(t,e){return t?e?(r,n)=>e(t(r,n),n):t:e}function _Mt(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 RMt(t,e,r){var n;let i=r?_Mt(e.actions):[];return xa("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},xa("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(n=e.actions)===null||n===void 0?void 0:n.map((a,o)=>{let s=!1,l=p=>{if(p.preventDefault(),s)return;s=!0;let g=$2(t.state.field(of).diagnostics,e);g&&a.apply(t,g.from,g.to)},{name:u}=a,h=i[o]?u.indexOf(i[o]):-1,d=h<0?u:[u.slice(0,h),xa("u",u.slice(h,h+1)),u.slice(h+1)],f=a.markClass?" "+a.markClass:"";return xa("button",{type:"button",class:"cm-diagnosticAction"+f,onclick:l,onmousedown:l,"aria-label":` Action: ${u}${h<0?"":` (access key "${i[o]})"`}.`},d)}),e.source&&xa("div",{class:"cm-diagnosticSource"},e.source))}class wkn extends Hu{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return xa("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class DMt{constructor(e,r){this.diagnostic=r,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=RMt(e,r,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class pF{constructor(e){this.view=e,this.items=[];let r=i=>{if(!(i.ctrlKey||i.altKey||i.metaKey)){if(i.keyCode==27)kMt(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],o=_Mt(a.actions);for(let s=0;s{for(let a=0;akMt(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(of).selected;if(!e)return-1;for(let r=0;r{for(let h of u.diagnostics){if(o.has(h))continue;o.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:s,panel:l})=>{let u=l.height/this.list.offsetHeight;s.topl.bottom&&(this.list.scrollTop+=(s.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(of),n=$2(r.diagnostics,this.items[e].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:OMt.of(n)})}static open(e){return new pF(e)}}function Akn(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function HZ(t){return Akn(``,'width="6" height="3"')}const Skn=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:HZ("#f11")},".cm-lintRange-warning":{backgroundImage:HZ("orange")},".cm-lintRange-info":{backgroundImage:HZ("#999")},".cm-lintRange-hint":{backgroundImage:HZ("#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 Tkn(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function Ckn(t){let e="hint",r=1;for(let n of t){let i=Tkn(n.severity);i>r&&(r=i,e=n.severity)}return e}const LMt=obn(vkn,{hideOn:pkn}),Okn=[of,er.decorations.compute([of],t=>{let{selected:e,panel:r}=t.field(of);return!e||!r||e.from==e.to?Ar.none:Ar.set([mkn.range(e.from,e.to)])}),LMt,Skn];var OSe=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(F2n)),e.defaultKeymap!==!1&&(a=a.concat(BOn)),e.searchKeymap!==!1&&(a=a.concat(ukn)),e.historyKeymap!==!1&&(a=a.concat(GCn)),e.foldKeymap!==!1&&(a=a.concat(Wbn)),e.completionKeymap!==!1&&(a=a.concat(o3t)),e.lintKeymap!==!1&&(a=a.concat(xkn));var o=[];return e.lineNumbers!==!1&&o.push(qRt()),e.highlightActiveLineGutter!==!1&&o.push(wbn()),e.highlightSpecialChars!==!1&&o.push(P1n()),e.history!==!1&&o.push(PCn()),e.foldGutter!==!1&&o.push(Xbn()),e.drawSelection!==!1&&o.push(T1n()),e.dropCursor!==!1&&o.push(_1n()),e.allowMultipleSelections!==!1&&o.push(ei.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&o.push(zbn()),e.syntaxHighlighting!==!1&&o.push(v4t(txn,{fallback:!0})),e.bracketMatching!==!1&&o.push(sxn()),e.closeBrackets!==!1&&o.push(N2n()),e.autocompletion!==!1&&o.push(W2n()),e.rectangularSelection!==!1&&o.push(j1n()),i!==!1&&o.push(Z1n()),e.highlightActiveLine!==!1&&o.push(U1n()),e.highlightSelectionMatches!==!1&&o.push(QOn()),e.tabSize&&typeof e.tabSize=="number"&&o.push(ZR.of(" ".repeat(e.tabSize))),o.concat([qR.of(a.flat())]).filter(Boolean)};const kkn="#e5c07b",MMt="#e06c75",Ekn="#56b6c2",_kn="#ffffff",WZ="#abb2bf",kSe="#7d8799",Rkn="#61afef",Dkn="#98c379",IMt="#d19a66",Lkn="#c678dd",Mkn="#21252b",PMt="#2c313a",NMt="#282c34",ESe="#353a42",Ikn="#3E4451",BMt="#528bff",Pkn=er.theme({"&":{color:WZ,backgroundColor:NMt},".cm-content":{caretColor:BMt},".cm-cursor, .cm-dropCursor":{borderLeftColor:BMt},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Ikn},".cm-panels":{backgroundColor:Mkn,color:WZ},".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:NMt,color:kSe,border:"none"},".cm-activeLineGutter":{backgroundColor:PMt},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:ESe},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:ESe,borderBottomColor:ESe},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:PMt,color:WZ}}},{dark:!0}),Nkn=G$.define([{tag:Re.keyword,color:Lkn},{tag:[Re.name,Re.deleted,Re.character,Re.propertyName,Re.macroName],color:MMt},{tag:[Re.function(Re.variableName),Re.labelName],color:Rkn},{tag:[Re.color,Re.constant(Re.name),Re.standard(Re.name)],color:IMt},{tag:[Re.definition(Re.name),Re.separator],color:WZ},{tag:[Re.typeName,Re.className,Re.number,Re.changed,Re.annotation,Re.modifier,Re.self,Re.namespace],color:kkn},{tag:[Re.operator,Re.operatorKeyword,Re.url,Re.escape,Re.regexp,Re.link,Re.special(Re.string)],color:Ekn},{tag:[Re.meta,Re.comment],color:kSe},{tag:Re.strong,fontWeight:"bold"},{tag:Re.emphasis,fontStyle:"italic"},{tag:Re.strikethrough,textDecoration:"line-through"},{tag:Re.link,color:kSe,textDecoration:"underline"},{tag:Re.heading,fontWeight:"bold",color:MMt},{tag:[Re.atom,Re.bool,Re.special(Re.variableName)],color:IMt},{tag:[Re.processingInstruction,Re.string,Re.inserted],color:Dkn},{tag:Re.invalid,color:_kn}]),$Mt=[Pkn,v4t(Nkn)];var Bkn=er.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),$kn=function(e){e===void 0&&(e={});var r=e,n=r.indentWithTab,i=n===void 0?!0:n,a=r.editable,o=a===void 0?!0:a,s=r.readOnly,l=s===void 0?!1:s,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(qR.of([$On])),g&&(typeof g=="boolean"?m.unshift(OSe()):m.unshift(OSe(g))),f&&m.unshift(H1n(f)),h){case"light":m.push(Bkn);break;case"dark":m.push($Mt);break;case"none":break;default:m.push(h);break}return o===!1&&m.push(er.editable.of(!1)),l&&m.push(ei.readOnly.of(!0)),[...m]},Fkn=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 zkn{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 FMt{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 _Se=null,Ukn=()=>typeof window>"u"?new FMt:(_Se||(_Se=new FMt),_Se),Vkn=er.theme({"& .cm-scroller":{height:"100% !important"}}),zMt=null,RSe=null;function Qkn(t,e,r,n,i,a){if(!t&&!e&&!r&&!n&&!i&&!a)return null;var o=JSON.stringify({height:t,minHeight:e,maxHeight:r,width:n,minWidth:i,maxWidth:a});return o===zMt||(zMt=o,RSe=er.theme({"&":{height:t,minHeight:e,maxHeight:r,width:n,minWidth:i,maxWidth:a}})),RSe}var UMt=k0.define(),Gkn=200,Hkn=[];function Wkn(t){var e=t.value,r=t.selection,n=t.onChange,i=t.onStatistics,a=t.onCreateEditor,o=t.onUpdate,s=t.extensions,l=s===void 0?Hkn:s,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,C=t.placeholder,k=C===void 0?"":C,E=t.editable,_=E===void 0?!0:E,P=t.readOnly,L=P===void 0?!1:P,R=t.indentWithTab,D=R===void 0?!0:R,M=t.basicSetup,I=M===void 0?!0:M,N=t.root,F=t.initialState,B=j.useState(),V=B[0],z=B[1],U=j.useState(),Q=U[0],G=U[1],q=j.useState(),Y=q[0],ne=q[1],X=j.useState(()=>({current:null}))[0],J=j.useState(()=>({current:null}))[0],ee=Qkn(p,m,y,x,A,T),te=er.updateListener.of(Ce=>{if(Ce.docChanged&&typeof n=="function"&&!Ce.transactions.some(ue=>ue.annotation(UMt))){X.current?X.current.reset():(X.current=new zkn(()=>{if(J.current){var ue=J.current;J.current=null,ue()}X.current=null},Gkn),Ukn().add(X.current));var ke=Ce.state.doc,Ee=ke.toString();n(Ee,Ce)}i&&i(Fkn(Ce))}),pe=$kn({theme:d,editable:_,readOnly:L,placeholder:k,indentWithTab:D,basicSetup:I}),ie=[te,...ee?[ee]:[],Vkn,...pe];return o&&typeof o=="function"&&ie.push(er.updateListener.of(o)),ie=ie.concat(l),j.useLayoutEffect(()=>{if(V&&!Y){var Ce={doc:e,selection:r,extensions:ie},ke=F?ei.fromJSON(F.json,Ce,F.fields):ei.create(Ce);if(ne(ke),!Q){var Ee=new er({state:ke,parent:V,root:N});G(Ee),a&&a(Ee,ke)}}return()=>{Q&&(ne(void 0),G(void 0))}},[V,Y]),j.useEffect(()=>{t.container&&z(t.container)},[t.container]),j.useEffect(()=>()=>{Q&&(Q.destroy(),G(void 0)),X.current&&(X.current.cancel(),X.current=null)},[Q]),j.useEffect(()=>{u&&Q&&Q.focus()},[u,Q]),j.useEffect(()=>{Q&&Q.dispatch({effects:on.reconfigure.of(ie)})},[d,l,p,m,y,x,A,T,k,_,L,D,I,n,o]),j.useEffect(()=>{if(e!==void 0){var Ce=Q?Q.state.doc.toString():"";if(Q&&e!==Ce){var ke=X.current&&!X.current.isDone,Ee=()=>{Q&&e!==Q.state.doc.toString()&&Q.dispatch({changes:{from:0,to:Q.state.doc.toString().length,insert:e||""},annotations:[UMt.of(!0)]})};ke?J.current=Ee:Ee()}}},[e,Q]),{state:Y,setState:ne,view:Q,setView:G,container:V,setContainer:z}}var Ykn=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],DSe=j.forwardRef((t,e)=>{var r=t.className,n=t.value,i=n===void 0?"":n,a=t.selection,o=t.extensions,s=o===void 0?[]:o,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,C=t.editable,k=t.readOnly,E=t.root,_=t.initialState,P=CCn(t,Ykn),L=j.useRef(null),R=Wkn({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:C,readOnly:k,selection:a,onChange:l,onStatistics:u,onCreateEditor:h,onUpdate:d,extensions:s,initialState:_}),D=R.state,M=R.view,I=R.container,N=R.setContainer;j.useImperativeHandle(e,()=>({editor:L.current,state:D,view:M}),[L,I,D,M]);var F=j.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 H.jsx("div",cSe({ref:F,className:""+B+(r?" "+r:"")},P))});DSe.displayName="CodeMirror";function YZ(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")?[jwe.define(TCn)]:n==="py"||n==="pyi"?[ITn()]:["ts","tsx","mts","cts"].includes(n??"")?[vAe({typescript:!0,jsx:n==="tsx"})]:["js","jsx","mjs","cjs"].includes(n??"")?[vAe({jsx:n==="jsx"})]:n==="json"||n==="jsonc"?[awn()]:n==="yaml"||n==="yml"?[uCn()]:["md","markdown"].includes(n??"")?[pSn()]:[]}function qkn({value:t,path:e,onChange:r,readOnly:n=!1,theme:i="light",lineNumberStart:a=1,height:o="100%",minHeight:s,maxHeight:l,extensions:u}){const h=j.useMemo(()=>[...YZ(e),...a===1?[]:[qRt({formatNumber:d=>String(d+a-1)})],...u??[]],[a,e,u]);return H.jsx(DSe,{value:t,height:o,minHeight:s,maxHeight:l,theme:i,extensions:h,editable:!n,onChange:r,basicSetup:{lineNumbers:a===1,foldGutter:!0,highlightActiveLine:!0,highlightActiveLineGutter:!0,autocompletion:!1}})}const jkn=Object.freeze(Object.defineProperty({__proto__:null,default:qkn,languageFor:YZ},Symbol.toStringTag,{value:"Module"}));class Vs{constructor(e,r,n,i){this.fromA=e,this.toA=r,this.fromB=n,this.toB=i}offset(e,r=e){return new Vs(this.fromA+e,this.toA+e,this.fromB+r,this.toB+r)}}function SC(t,e,r,n,i,a){if(t==n)return[];let o=PSe(t,e,r,n,i,a),s=NSe(t,e+o,r,n,i+o,a);e+=o,r-=s,i+=o,a-=s;let l=r-e,u=a-i;if(!l||!u)return[new Vs(e,r,i,a)];if(l>u){let d=t.slice(e,r).indexOf(n.slice(i,a));if(d>-1)return[new Vs(e,e+d,i,i),new Vs(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 Vs(e,e,i,i+d),new Vs(r,r,i+d+l,a)]}if(l==1||u==1)return[new Vs(e,r,i,a)];let h=GMt(t,e,r,n,i,a);if(h){let[d,f,p]=h;return SC(t,e,d,n,i,f).concat(SC(t,d+p,r,n,f+p,a))}return Xkn(t,e,r,n,i,a)}let gF=1e9,mF=0,LSe=!1;function Xkn(t,e,r,n,i,a){let o=r-e,s=a-i;if(gF<1e9&&Math.min(o,s)>gF*16||mF>0&&Date.now()>mF)return Math.min(o,s)>gF*64?[new Vs(e,r,i,a)]:HMt(t,e,r,n,i,a);let l=Math.ceil((o+s)/2);MSe.reset(l),ISe.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=(o-s)%2!=0?ISe:null,f=d?null:MSe;for(let p=0;pgF||mF>0&&!(p&63)&&Date.now()>mF)return HMt(t,e,r,n,i,a);let g=MSe.advance(p,o,s,l,d,!1,u)||ISe.advance(p,o,s,l,f,!0,h);if(g)return Kkn(t,e,r,e+g[0],n,i,a,i+g[1])}return[new Vs(e,r,i,a)]}class VMt{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 MSe=new VMt,ISe=new VMt;function Kkn(t,e,r,n,i,a,o,s){let l=!1;return!m4(t,n)&&++n==r&&(l=!0),!m4(i,s)&&++s==o&&(l=!0),l?[new Vs(e,r,a,o)]:SC(t,e,n,i,a,s).concat(SC(t,n,r,i,s,o))}function QMt(t,e){let r=1,n=Math.min(t,e);for(;rr||h>a||t.slice(s,u)!=n.slice(l,h)){if(o==1)return s-e-(m4(t,s)?0:1);o=o>>1}else{if(u==r||h==a)return u-e;s=u,l=h}}}function NSe(t,e,r,n,i,a){if(e==r||i==a||t.charCodeAt(r-1)!=n.charCodeAt(a-1))return 0;let o=QMt(r-e,a-i);for(let s=r,l=a;;){let u=s-o,h=l-o;if(u>1}else{if(u==e||h==i)return r-u;s=u,l=h}}}function BSe(t,e,r,n,i,a,o,s){let l=n.slice(i,a),u=null;for(;;){if(u||o=r)break;let f=t.slice(h,d),p=-1;for(;(p=l.indexOf(f,p+1))!=-1;){let g=PSe(t,d,r,n,i+p+f.length,a),m=NSe(t,e,h,n,i,i+p),v=f.length+g+m;(!u||u[2]>1}}function GMt(t,e,r,n,i,a){let o=r-e,s=a-i;if(oi.fromA-e&&n.toB>i.fromB-e&&(t[r-1]=new Vs(n.fromA,i.toA,n.fromB,i.toB),t.splice(r--,1))}}function Zkn(t,e,r){for(;;){WMt(r,1);let n=!1;for(let i=0;i3||s>3){let l=i==t.length-1?e.length:t[i+1].fromA,u=a.fromA-n,h=l-a.toA,d=ZMt(e,a.fromA,u),f=KMt(e,a.toA,h),p=a.fromA-d,g=f-a.toA;if((!o||!s)&&p&&g){let m=Math.max(o,s),[v,y,b]=o?[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 Vs(d,d+o,a.fromB-p,a.toB-p),d=a.fromA,f=KMt(e,a.toA,l-a.toA)):m>g&&e.slice(a.toA,f)==v.slice(y,y+g)&&(a=t[i]=new Vs(f-o,f,a.fromB+g,a.toB+g),f=a.toA,d=ZMt(e,a.fromA,a.fromA-n)),p=a.fromA-d,g=f-a.toA}if(p||g)a=t[i]=new Vs(a.fromA-p,a.toA+g,a.fromB-p,a.toB+g);else if(o){if(!s){let m=eIt(e,a.fromA,a.toA),v,y=m<0?-1:JMt(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=eIt(r,a.fromB,a.toB),v,y=m<0?-1:JMt(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 WMt(t,3),t}let TC;try{TC=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function YMt(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function qMt(t,e){if(e==t.length)return 0;let r=t.charCodeAt(e);return r<192?YMt(r)?1:0:TC?!tIt(r)||e==t.length-1?TC.test(String.fromCharCode(r))?1:0:TC.test(t.slice(e,e+2))?2:0:0}function jMt(t,e){if(!e)return 0;let r=t.charCodeAt(e-1);return r<192?YMt(r)?1:0:TC?!rIt(r)||e==1?TC.test(String.fromCharCode(r))?1:0:TC.test(t.slice(e-2,e))?2:0:0}const XMt=8;function KMt(t,e,r){if(e==t.length||!jMt(t,e))return e;for(let n=e,i=e+r,a=0;ai)return n;n+=o}return e}function ZMt(t,e,r){if(!e||!qMt(t,e))return e;for(let n=e,i=e-r,a=0;at>=55296&&t<=56319,rIt=t=>t>=56320&&t<=57343;function m4(t,e){return!e||e==t.length||!tIt(t.charCodeAt(e-1))||!rIt(t.charCodeAt(e))}function eEn(t,e,r){var n;let i=r==null?void 0:r.override;return i?i(t,e):(gF=((n=r==null?void 0:r.scanLimit)!==null&&n!==void 0?n:1e9)>>1,mF=r!=null&&r.timeout?Date.now()+r.timeout:0,LSe=!1,Zkn(t,e,SC(t,0,t.length,e,0,e.length)))}function nIt(){return!LSe}function iIt(t,e,r){return Jkn(eEn(t,e,r),t,e)}const Zh=vr.define({combine:t=>t[0]}),$Se=on.define(),aIt=vr.define(),qu=Ko.define({create(t){return null},update(t,e){for(let r of e.effects)r.is($Se)&&(t=r.value);for(let r of e.state.facet(aIt))t=r(t,e);return t}});class _1{constructor(e,r,n,i,a,o=!0){this.changes=e,this.fromA=r,this.toA=n,this.fromB=i,this.toB=a,this.precise=o}offset(e,r){return e||r?new _1(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=iIt(e.toString(),r.toString(),n);return lIt(i,e,r,0,0,nIt())}static updateA(e,r,n,i,a){return hIt(uIt(e,i,!0,n.length),e,r,n,a)}static updateB(e,r,n,i,a){return hIt(uIt(e,i,!1,r.length),e,r,n,a)}}function oIt(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]=sIt(g.toA+n,g.toB+i,e,r),s++}o.push(new _1(p,u,Math.max(u,d),h,Math.max(h,f),a))}return o}const qZ=1e3;function cIt(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 o=i+a>>1,s=t[o],[l,u]=r?[s.fromA,s.toA]:[s.fromB,s.toB];if(l>e)a=o;else if(u<=e)i=o+1;else return n?[s.fromA,s.fromB]:[s.toA,s.toB]}}function uIt(t,e,r,n){let i=[];return e.iterChangedRanges((a,o,s,l)=>{let u=0,h=r?e.length:n,d=0,f=r?n:e.length;a>qZ&&([u,d]=cIt(t,a-qZ,r,!0)),o=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 hIt(t,e,r,n,i){if(!t.length)return e;let a=[];for(let o=0,s=0,l=0,u=0;;o++){let h=o==t.length?null:t[o],d=h?h.fromA+s:r.length,f=h?h.fromB+l:n.length;for(;ud||v.toB+l>f))break;a.push(v.offset(s,l)),u++}if(!h)break;let p=h.toA+s+h.diffA,g=h.toB+l+h.diffB,m=iIt(r.sliceString(d,p),n.sliceString(f,g),i);for(let v of lIt(m,r,n,d,f,nIt()))a.push(v);for(s+=h.diffA,l+=h.diffB;up&&v.fromB+l>g)break;u++}}return a}const dIt={scanLimit:500},jZ=Ro.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=mIt(t))}update(t){(t.docChanged||t.viewportChanged||tEn(t.startState,t.state)||rEn(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=mIt(t.view))}},{decorations:t=>t.deco}),XZ=Zd.low(Iwe({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(jZ))===null||e===void 0?void 0:e.gutter)||ti.empty}}));function tEn(t,e){return t.field(qu,!1)!=e.field(qu,!1)}function rEn(t,e){return t.facet(Zh)!=e.facet(Zh)}const fIt=Ar.line({class:"cm-changedLine"}),pIt=Ar.mark({class:"cm-changedText"}),nEn=Ar.mark({tagName:"ins",class:"cm-insertedLine"}),iEn=Ar.mark({tagName:"del",class:"cm-deletedLine"}),gIt=new class extends wp{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function aEn(t,e,r,n,i,a){let o=r?t.fromA:t.fromB,s=r?t.toA:t.toB,l=0;if(o!=s){i.add(o,o,fIt),i.add(o,s,r?iEn:nEn),a&&a.add(o,o,gIt);for(let u=e.iterRange(o,s-1),h=o;!u.next().done;){if(u.lineBreak){h++,i.add(h,h,fIt),a&&a.add(h,h,gIt);continue}let d=h+u.value.length;if(n)for(;l=h)break;(o?d.toA:d.toB)>u&&(!a||!a(t.state,d,s,l))&&aEn(d,t.state.doc,o,n,s,l)}return{deco:s.finish(),gutter:l&&l.finish()}}class KZ extends Hu{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 ZZ=on.define({map:(t,e)=>t.map(e)}),vF=Ko.define({create:()=>Ar.none,update:(t,e)=>{for(let r of e.effects)if(r.is(ZZ))return r.value;return t.map(e.changes)},provide:t=>er.decorations.from(t)}),JZ=.01;function vIt(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 oEn(t,e,r){let n=new Qu,i=new Qu,a=t.state.field(vF).iter(),o=e.state.field(vF).iter(),s=0,l=0,u=0,h=0,d=t.viewport,f=e.viewport;for(let v=0;;v++){let y=vJZ&&(h+=S,i.add(l,l,Ar.widget({widget:new KZ(S),block:!0,side:-1})))}if(b>s+1e3&&sd.from&&lf.from){let w=Math.min(d.from-s,f.from-l);s+=w,l+=w,v--}else if(y)s=y.toA,l=y.toB;else break;for(;a.value&&a.fromJZ&&i.add(e.state.doc.length,e.state.doc.length,Ar.widget({widget:new KZ(p),block:!0,side:1}));let g=n.finish(),m=i.finish();vIt(g,t.state.field(vF))||t.dispatch({effects:ZZ.of(g)}),vIt(m,e.state.field(vF))||e.dispatch({effects:ZZ.of(m)})}const FSe=on.define({map:(t,e)=>e.mapPos(t)});class sEn extends Hu{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:FSe.of(i)});let{side:a,sibling:o}=e.state.facet(Zh);o&&o().dispatch({effects:FSe.of(lEn(i,e.state.field(qu),a=="a"))})}),r}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function lEn(t,e,r){let n=0,i=0;for(let a=0;;a++){let o=a=t)return i+(t-n);[n,i]=r?[o.toA,o.toB]:[o.toB,o.toA]}}const cEn=Ko.define({create(t){return Ar.none},update(t,e){t=t.map(e.changes);for(let r of e.effects)r.is(FSe)&&(t=t.update({filter:n=>n!=r.value}));if(t.size&&e.state.field(qu)!=e.startState.field(qu,!1)){let r=e.state.facet(Zh).side=="a",n=[];for(let i of e.state.field(qu))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 zSe({margin:t=3,minSize:e=4}){return cEn.init(r=>uEn(r,t,e))}function uEn(t,e,r){let n=new Qu,i=t.facet(Zh).side=="a",a=t.field(qu),o=1;for(let s=0;;s++){let l=s=r&&n.add(t.doc.line(u).from,t.doc.line(h).to,Ar.replace({widget:new sEn(d),block:!0})),!l)break;o=t.doc.lineAt(Math.min(t.doc.length,i?l.toA:l.toB)).number}return n.finish()}const hEn=er.styleModule.of(new d1({".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"}})),yIt=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"}}),bIt=new $R,eJ=new $R;class dEn{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||dIt;let r=[Zd.low(jZ),yIt,hEn,vF,er.updateListener.of(d=>{this.measuring<0&&(d.heightChanged||d.viewportChanged)&&!d.transactions.some(f=>f.effects.some(p=>p.is(ZZ)))&&this.measure()})],n=[Zh.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&n.push(XZ);let i=ei.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],er.editorAttributes.of({class:"cm-merge-a"}),eJ.of(n),r]}),a=[Zh.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&a.push(XZ);let o=ei.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],er.editorAttributes.of({class:"cm-merge-b"}),eJ.of(a),r]});this.chunks=_1.build(i.doc,o.doc,this.diffConf);let s=[qu.init(()=>this.chunks),bIt.of(e.collapseUnchanged?zSe(e.collapseUnchanged):[])];i=i.update({effects:on.appendConfig.of(s)}).state,o=o.update({effects:on.appendConfig.of(s)}).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:o,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((o,s)=>o.compose(s.changes),bs.empty(e[0].startState.doc.length));this.chunks=r==this.a?_1.updateA(this.chunks,n.newDoc,this.b.state.doc,i,this.diffConf):_1.updateB(this.chunks,this.a.state.doc,n.newDoc,i,this.diffConf),r.update([...e,n.state.update({effects:$Se.of(this.chunks)})]);let a=r==this.a?this.b:this.a;a.update([a.state.update({effects:$Se.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 o=this.a.dom.parentNode,s=this.b.dom.parentNode;o.remove(),s.remove(),this.editorDOM.insertBefore(a?o:s,this.editorDOM.firstChild),this.editorDOM.appendChild(a?s:o),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let a=!!this.revertDOM,o=this.revertToA,s=this.renderRevert;"revertControls"in e&&(a=!!e.revertControls,o=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(s=e.renderRevertControl),this.setupRevertControls(a,o,s)}let r="highlightChanges"in e,n="gutter"in e,i="collapseUnchanged"in e;if(r||n||i){let a=[],o=[];if(r||n){let s=this.a.state.facet(Zh),l=n?e.gutter!==!1:s.markGutter,u=r?e.highlightChanges!==!1:s.highlightChanges;a.push(eJ.reconfigure([Zh.of({side:"a",sibling:()=>this.b,highlightChanges:u,markGutter:l}),l?XZ:[]])),o.push(eJ.reconfigure([Zh.of({side:"b",sibling:()=>this.a,highlightChanges:u,markGutter:l}),l?XZ:[]]))}if(i){let s=bIt.reconfigure(e.collapseUnchanged?zSe(e.collapseUnchanged):[]);a.push(s),o.push(s)}this.a.dispatch({effects:a}),this.b.dispatch({effects:o})}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(){oEn(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||o.fromB>i.to)break;if(o.fromA-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function xIt(t){let e=t.nextSibling;return t.remove(),e}const fEn=new class extends wp{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},pEn=Zd.low(Iwe({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(jZ))===null||e===void 0?void 0:e.gutter)||ti.empty},widgetMarker:(t,e)=>e instanceof AIt?fEn:null}));function gEn(t){var e;let r=typeof t.original=="string"?wi.of(t.original.split(/\r?\n/)):t.original,n=t.diffConfig||dIt;return[Zd.low(jZ),bEn,yIt,er.editorAttributes.of({class:"cm-merge-b"}),aIt.of((i,a)=>{let o=a.effects.find(s=>s.is(USe));return o&&(i=_1.updateA(i,o.value.doc,a.startState.doc,o.value.changes,n)),a.docChanged&&(i=_1.updateB(i,a.state.field(v4),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:SEn,side:"b"}),v4.init(()=>r),t.gutter!==!1?pEn:[],t.collapseUnchanged?zSe(t.collapseUnchanged):[],qu.init(i=>_1.build(r,i.doc,n))]}const USe=on.define(),v4=Ko.define({create:()=>wi.empty,update(t,e){for(let r of e.effects)r.is(USe)&&(t=r.value.doc);return t}}),wIt=new WeakMap;class AIt extends Hu{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 mEn(t,e,r){let n=wIt.get(e.changes);if(n)return n;let i=o=>{let{highlightChanges:s,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(),vEn(o,o.posAtDOM(d))},S=T=>{T.preventDefault(),yEn(o,o.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 C=w.appendChild(document.createElement("button"));C.name="reject",C.textContent=t.phrase("Reject"),C.onmousedown=S}}if(r||e.fromA>=e.toA)return d;let f=o.state.field(v4).sliceString(e.fromA,e.endA),p=l&&t.facet(y1),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;Tr?null:r+t.unit}const tSe=v1.define({name:"python",parser:RTn.configure({props:[b1.add({Body:t=>{var e;let r=/^\s*(#|$)/.test(t.textAfter)&&JAe(t)||t.node;return(e=eSe(t,r))!==null&&e!==void 0?e:t.continue()},MatchBody:t=>{var e;let r=JAe(t);return(e=eSe(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":JR({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":JR({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":JR({closing:"]"}),MemberExpression:t=>t.baseIndent+t.unit,"String FormatString":()=>null,Script:t=>{var e;let r=JAe(t);return(e=r&&eSe(t,r))!==null&&e!==void 0?e:t.continue()}}),x1.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":V$,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 NTn(){return new I2(tSe,[tSe.data.of({autocomplete:LTn}),tSe.data.of({autocomplete:PTn})])}const l4=63,dLt=64,BTn=1,$Tn=2,fLt=3,FTn=4,pLt=5,zTn=6,UTn=7,gLt=65,VTn=66,QTn=8,GTn=9,HTn=10,WTn=11,YTn=12,mLt=13,qTn=19,jTn=20,XTn=29,KTn=33,ZTn=34,JTn=47,eCn=0,rSe=1,nSe=2,sF=3,iSe=4;class xC{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}}xC.top=new xC(null,-1,eCn);function lF(t,e){for(let r=0,n=e-t.pos-1;;n--,r++){let i=t.peek(n);if(E1(i)||i==-1)return r}}function aSe(t){return t==32||t==9}function E1(t){return t==10||t==13}function vLt(t){return aSe(t)||E1(t)}function wC(t){return t<0||vLt(t)}const tCn=new dZ({start:xC.top,reduce(t,e){return t.type==sF&&(e==jTn||e==ZTn)?t.parent:t},shift(t,e,r,n){if(e==fLt)return new xC(t,lF(n,n.pos),rSe);if(e==gLt||e==pLt)return new xC(t,lF(n,n.pos),nSe);if(e==l4)return t.parent;if(e==qTn||e==KTn)return new xC(t,0,sF);if(e==mLt&&t.type==iSe)return t.parent;if(e==JTn){let i=/[1-9]/.exec(n.read(n.pos,r.pos));if(i)return new xC(t,t.depth+ +i[0],iSe)}return t},hash(t){return t.hash}});function c4(t,e,r=0){return t.peek(r)==e&&t.peek(r+1)==e&&t.peek(r+2)==e&&wC(t.peek(r+3))}const rCn=new xs((t,e)=>{if(t.next==-1&&e.canShift(dLt))return t.acceptToken(dLt);let r=t.peek(-1);if((E1(r)||r<0)&&e.context.type!=sF){if(c4(t,45))if(e.canShift(l4))t.acceptToken(l4);else return t.acceptToken(BTn,3);if(c4(t,46))if(e.canShift(l4))t.acceptToken(l4);else return t.acceptToken($Tn,3);let n=0;for(;t.next==32;)n++,t.advance();(n{if(e.context.type==sF){t.next==63&&(t.advance(),wC(t.next)&&t.acceptToken(UTn));return}if(t.next==45)t.advance(),wC(t.next)&&t.acceptToken(e.context.type==rSe&&e.context.depth==lF(t,t.pos-1)?FTn:fLt);else if(t.next==63)t.advance(),wC(t.next)&&t.acceptToken(e.context.type==nSe&&e.context.depth==lF(t,t.pos-1)?zTn:pLt);else{let r=t.pos;for(;;)if(aSe(t.next)){if(t.pos==r)return;t.advance()}else if(t.next==33)xLt(t);else if(t.next==38)oSe(t);else if(t.next==42){oSe(t);break}else if(t.next==39||t.next==34){if(sSe(t,!0))break;return}else if(t.next==91||t.next==123){if(!aCn(t))return;break}else{wLt(t,!0,!1,0);break}for(;aSe(t.next);)t.advance();if(t.next==58){if(t.pos==r&&e.canShift(XTn))return;let n=t.peek(1);wC(n)&&t.acceptTokenTo(e.context.type==nSe&&e.context.depth==lF(t,r)?VTn:gLt,r)}}},{contextual:!0});function iCn(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 yLt(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function bLt(t,e){return t.next==37?(t.advance(),yLt(t.next)&&t.advance(),yLt(t.next)&&t.advance(),!0):iCn(t.next)||e&&t.next==44?(t.advance(),!0):!1}function xLt(t){if(t.advance(),t.next==60){for(t.advance();;)if(!bLt(t,!0)){t.next==62&&t.advance();break}}else for(;bLt(t,!1););}function oSe(t){for(t.advance();!wC(t.next)&&DZ(t.next)!="f";)t.advance()}function sSe(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(E1(a)){if(e)return!1;n=!0}else if(e&&t.pos>=i+1024)return!1}return!n}function aCn(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(!sSe(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||E1(t.next))return!1;t.advance()}}const oCn="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function DZ(t){return t<33?"u":t>125?"s":oCn[t-33]}function lSe(t,e){let r=DZ(t);return r!="u"&&!(e&&r=="f")}function wLt(t,e,r,n){if(DZ(t.next)=="s"||(t.next==63||t.next==58||t.next==45)&&lSe(t.peek(1),r))t.advance();else return!1;let i=t.pos;for(;;){let a=t.next,o=0,s=n+1;for(;vLt(a);){if(E1(a)){if(e)return!1;s=0}else s++;a=t.peek(++o)}if(!(a>=0&&(a==58?lSe(t.peek(o+1),r):a==35?t.peek(o-1)!=32:lSe(a,r)))||!r&&s<=n||s==0&&!r&&(c4(t,45,o)||c4(t,46,o)))break;if(e&&DZ(a)=="f")return!1;for(let u=o;u>=0;u--)t.advance();if(e&&t.pos>i+1024)return!1}return!0}const sCn=new xs((t,e)=>{if(t.next==33)xLt(t),t.acceptToken(YTn);else if(t.next==38||t.next==42){let r=t.next==38?HTn:WTn;oSe(t),t.acceptToken(r)}else t.next==39||t.next==34?(sSe(t,!1),t.acceptToken(GTn)):wLt(t,!1,e.context.type==sF,e.context.depth)&&t.acceptToken(QTn)}),lCn=new xs((t,e)=>{let r=e.context.type==iSe?e.context.depth:-1,n=t.pos;e:for(;;){let i=0,a=t.next;for(;a==32;)a=t.peek(++i);if(!i&&(c4(t,45,i)||c4(t,46,i))||!E1(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:tCn,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[cCn],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:[rCn,nCn,sCn,lCn,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),hCn=v1.define({name:"yaml",parser:uCn.configure({props:[b1.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:JR({closing:"}"}),FlowSequence:JR({closing:"]"})}),x1.add({"FlowMapping FlowSequence":V$,"Item Pair BlockLiteral":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function dCn(){return new I2(hCn)}function fCn(t){ALt(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]=[],o=t[i],s=0;s2&&o.token&&typeof o.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 o=0;o{let{state:e}=t,r=e.doc.lineAt(e.selection.main.from),n=hSe(t.state,r.from);return n.line?_Cn(t):n.block?DCn(t):!1};function uSe(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 _Cn=uSe(ICn,0),RCn=uSe(kLt,0),DCn=uSe((t,e)=>kLt(t,e,MCn(e)),0);function hSe(t,e){let r=t.languageDataAt("commentTokens",e,1);return r.length?r[0]:{}}const cF=50;function LCn(t,{open:e,close:r},n,i){let a=t.sliceDoc(n-cF,n),o=t.sliceDoc(i,i+cF),s=/\s*$/.exec(a)[0].length,l=/^\s*/.exec(o)[0].length,u=a.length-s;if(a.slice(u-e.length,u)==e&&o.slice(l,l+r.length)==r)return{open:{pos:n-s,margin:s&&1},close:{pos:i+l,margin:l&&1}};let h,d;i-n<=2*cF?h=d=t.sliceDoc(n,i):(h=t.sliceDoc(n,n+cF),d=t.sliceDoc(i-cF,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 MCn(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 kLt(t,e,r=e.selection.ranges){let n=r.map(a=>hSe(e,a.from).block);if(!n.every(a=>a))return null;let i=r.map((a,o)=>LCn(e,n[o],a.from,a.to));if(t!=2&&!i.every(a=>a))return{changes:e.changes(r.map((a,o)=>i[o]?[]:[{from:a.from,insert:n[o].open+" "},{from:a.to,insert:" "+n[o].close}]))};if(t!=1&&i.some(a=>a)){let a=[];for(let o=0,s;oi&&(a==o||o>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:s,token:l,indent:u,empty:h,single:d}of n)(d||!h)&&a.push({from:s.from+u,insert:l+" "});let o=e.changes(a);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&n.some(a=>a.comment>=0)){let a=[];for(let{line:o,comment:s,token:l}of n)if(s>=0){let u=o.from+s,h=u+l.length;o.text[h-o.from]==" "&&h++,a.push({from:u,to:h})}return{changes:a}}return null}const dSe=k0.define(),PCn=k0.define(),NCn=vr.define(),ELt=vr.define({combine(t){return E0(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)})}}),_Lt=Ko.define({create(){return $0.empty},update(t,e){let r=e.state.facet(ELt),n=e.annotation(dSe);if(n){let l=Kh.fromTransaction(e,n.selection),u=n.side,h=u==0?t.undone:t.done;return l?h=MZ(h,h.length,r.minDepth,l):h=LLt(h,e.startState.selection),new $0(u==0?n.rest:h,u==0?h:n.rest)}let i=e.annotation(PCn);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(Us.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let a=Kh.fromTransaction(e),o=e.annotation(Us.time),s=e.annotation(Us.userEvent);return a?t=t.addChanges(a,o,s,r,e):e.selection&&(t=t.addSelection(e.startState.selection,o,s,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 $0(t.done.map(Kh.fromJSON),t.undone.map(Kh.fromJSON))}});function BCn(t={}){return[_Lt,ELt.of(t),er.domEventHandlers({beforeinput(e,r){let n=e.inputType=="historyUndo"?RLt:e.inputType=="historyRedo"?fSe:null;return n?(e.preventDefault(),n(r)):!1}})]}function LZ(t,e){return function({state:r,dispatch:n}){if(!e&&r.readOnly)return!1;let i=r.field(_Lt,!1);if(!i)return!1;let a=i.pop(t,r,e);return a?(n(a),!0):!1}}const RLt=LZ(0,!1),fSe=LZ(1,!1),$Cn=LZ(0,!0),FCn=LZ(1,!0);class Kh{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 Kh(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 Kh(e.changes&&bs.fromJSON(e.changes),[],e.mapped&&O0.fromJSON(e.mapped),e.startSelection&&xt.fromJSON(e.startSelection),e.selectionsAfter.map(xt.fromJSON))}static fromTransaction(e,r){let n=Tp;for(let i of e.startState.facet(NCn)){let a=i(e);a.length&&(n=n.concat(a))}return!n.length&&e.changes.empty?null:new Kh(e.changes.invert(e.startState.doc),n,void 0,r||e.startState.selection,Tp)}static selection(e){return new Kh(void 0,Tp,void 0,void 0,e)}}function MZ(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 zCn(t,e){let r=[],n=!1;return t.iterChangedRanges((i,a)=>r.push(i,a)),e.iterChangedRanges((i,a,o,s)=>{for(let l=0;l=u&&o<=h&&(n=!0)}}),n}function UCn(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((r,n)=>r.empty!=e.ranges[n].empty).length===0}function DLt(t,e){return t.length?e.length?t.concat(e):t:e}const Tp=[],VCn=200;function LLt(t,e){if(t.length){let r=t[t.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-VCn));return n.length&&n[n.length-1].eq(e)?t:(n.push(e),MZ(t,t.length-1,1e9,r.setSelAfter(n)))}else return[Kh.selection([e])]}function QCn(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 pSe(t,e){if(!t.length)return t;let r=t.length,n=Tp;for(;r;){let i=GCn(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?[Kh.selection(n)]:Tp}function GCn(t,e,r){let n=DLt(t.selectionsAfter.length?t.selectionsAfter.map(s=>s.map(e)):Tp,r);if(!t.changes)return Kh.selection(n);let i=t.changes.map(e),a=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(a):a;return new Kh(i,on.mapEffects(t.effects,e),o,t.startSelection.map(a),n)}const HCn=/^(input\.type|delete)($|\.)/;class $0{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 $0(this.done,this.undone):this}addChanges(e,r,n,i,a){let o=this.done,s=o[o.length-1];return s&&s.changes&&!s.changes.empty&&e.changes&&(!n||HCn.test(n))&&(!s.selectionsAfter.length&&r-this.prevTime0&&r-this.prevTimer.empty?t.moveByChar(r,e):IZ(r,e))}function cu(t){return t.textDirectionAt(t.state.selection.main.head)==Ra.LTR}const ILt=t=>MLt(t,!cu(t)),PLt=t=>MLt(t,cu(t));function NLt(t,e){return Bg(t,r=>r.empty?t.moveByGroup(r,e):IZ(r,e))}const YCn=t=>NLt(t,!cu(t)),qCn=t=>NLt(t,cu(t));function jCn(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 PZ(t,e,r){let n=wa(t).resolveInner(e.head),i=r?_n.closedBy:_n.openedBy;for(let l=e.head;;){let u=r?n.childAfter(l):n.childBefore(l);if(!u)break;jCn(t,u,i)?n=u:l=r?u.to:u.from}let a=n.type.prop(i),o,s;return a&&(o=r?N0(t,n.from,1):N0(t,n.to,-1))&&o.matched?s=r?o.end.to:o.end.from:s=r?n.to:n.from,xt.cursor(s,r?-1:1)}const XCn=t=>Bg(t,e=>PZ(t.state,e,!cu(t))),KCn=t=>Bg(t,e=>PZ(t.state,e,cu(t)));function BLt(t,e){return Bg(t,r=>{if(!r.empty)return IZ(r,e);let n=t.moveVertically(r,e);return n.head!=r.head?n:t.moveToLineBoundary(r,e)})}const $Lt=t=>BLt(t,!1),FLt=t=>BLt(t,!0);function zLt(t){let e=t.scrollDOM.clientHeighto.empty?t.moveVertically(o,e,r.height):IZ(o,e));if(i.eq(n.selection))return!1;let a;if(r.selfScroll){let o=t.coordsAtPos(n.selection.main.head),s=t.scrollDOM.getBoundingClientRect(),l=s.top+r.marginTop,u=s.bottom-r.marginBottom;o&&o.top>l&&o.bottomULt(t,!1),gSe=t=>ULt(t,!0);function N2(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=xt.cursor(n.from+a))}return i}const ZCn=t=>Bg(t,e=>N2(t,e,!0)),JCn=t=>Bg(t,e=>N2(t,e,!1)),eOn=t=>Bg(t,e=>N2(t,e,!cu(t))),tOn=t=>Bg(t,e=>N2(t,e,cu(t))),rOn=t=>Bg(t,e=>xt.cursor(t.lineBlockAt(e.head).from,1)),nOn=t=>Bg(t,e=>xt.cursor(t.lineBlockAt(e.head).to,-1));function iOn(t,e,r){let n=!1,i=u4(t.selection,a=>{let o=N0(t,a.head,-1)||N0(t,a.head,1)||a.head>0&&N0(t,a.head-1,1)||a.headiOn(t,e);function Cp(t,e,r){let n=u4(t.state.selection,i=>{i.undirectional&&i.head>=i.anchor!=e&&(i=xt.range(i.head,i.anchor));let a=r(i);return xt.range(i.anchor,a.head,a.goalColumn,a.bidiLevel||void 0,a.assoc)});return n.eq(t.state.selection)?!1:(t.dispatch(Ng(t.state,n)),!0)}function QLt(t,e){return Cp(t,e,r=>t.moveByChar(r,e))}const GLt=t=>QLt(t,!cu(t)),HLt=t=>QLt(t,cu(t));function WLt(t,e){return Cp(t,e,r=>t.moveByGroup(r,e))}const oOn=t=>WLt(t,!cu(t)),sOn=t=>WLt(t,cu(t)),lOn=t=>{let e=!cu(t);return Cp(t,e,r=>PZ(t.state,r,e))},cOn=t=>{let e=cu(t);return Cp(t,e,r=>PZ(t.state,r,e))};function YLt(t,e){return Cp(t,e,r=>t.moveVertically(r,e))}const qLt=t=>YLt(t,!1),jLt=t=>YLt(t,!0);function XLt(t,e){return Cp(t,e,r=>t.moveVertically(r,e,zLt(t).height))}const KLt=t=>XLt(t,!1),ZLt=t=>XLt(t,!0),uOn=t=>Cp(t,!0,e=>N2(t,e,!0)),hOn=t=>Cp(t,!1,e=>N2(t,e,!1)),dOn=t=>{let e=!cu(t);return Cp(t,e,r=>N2(t,r,e))},fOn=t=>{let e=cu(t);return Cp(t,e,r=>N2(t,r,e))},pOn=t=>Cp(t,!1,e=>xt.cursor(t.lineBlockAt(e.head).from)),gOn=t=>Cp(t,!0,e=>xt.cursor(t.lineBlockAt(e.head).to)),JLt=({state:t,dispatch:e})=>(e(Ng(t,{anchor:0})),!0),eMt=({state:t,dispatch:e})=>(e(Ng(t,{anchor:t.doc.length})),!0),tMt=({state:t,dispatch:e})=>(e(Ng(t,{anchor:t.selection.main.anchor,head:0})),!0),rMt=({state:t,dispatch:e})=>(e(Ng(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),mOn=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),vOn=({state:t,dispatch:e})=>{let r=BZ(t).map(({from:n,to:i})=>xt.range(n,Math.min(i+1,t.doc.length)));return e(t.update({selection:xt.create(r),userEvent:"select"})),!0},yOn=({state:t,dispatch:e})=>{let r=u4(t.selection,n=>{let i=wa(t),a=i.resolveStack(n.from,1);if(n.empty){let o=i.resolveStack(n.from,-1);o.node.from>=a.node.from&&o.node.to<=a.node.to&&(a=o)}for(let o=a;o;o=o.next){let{node:s}=o;if((s.from=n.to||s.to>n.to&&s.from<=n.from)&&o.next)return xt.range(s.to,s.from)}return n});return r.eq(t.selection)?!1:(e(Ng(t,r)),!0)};function nMt(t,e){let{state:r}=t,n=r.selection,i=r.selection.ranges.slice();for(let a of r.selection.ranges){let o=r.doc.lineAt(a.head);if(e?o.to0)for(let s=a;;){let l=t.moveVertically(s,e);if(l.heado.to){i.some(u=>u.head==l.head)||i.push(l);break}else{if(l.head==s.head)break;s=l}}}return i.length==n.ranges.length?!1:(t.dispatch(Ng(r,xt.create(i,i.length-1))),!0)}const bOn=t=>nMt(t,!1),xOn=t=>nMt(t,!0),wOn=({state:t,dispatch:e})=>{let r=t.selection,n=null;return r.ranges.length>1?n=xt.create([r.main]):r.main.empty||(n=xt.create([xt.cursor(r.main.head)])),n?(e(Ng(t,n)),!0):!1};function uF(t,e){if(t.state.readOnly)return!1;let r="delete.selection",{state:n}=t,i=n.changeByRange(a=>{let{from:o,to:s}=a;if(o==s){let l=e(a);lo&&(r="delete.forward",l=NZ(t,l,!0)),o=Math.min(o,l),s=Math.max(s,l)}else o=NZ(t,o,!1),s=NZ(t,s,!0);return o==s?{range:a}:{changes:{from:o,to:s},range:xt.cursor(o,oi(t)))n.between(e,e,(i,a)=>{ie&&(e=r?a:i)});return e}const iMt=(t,e,r)=>uF(t,n=>{let i=n.from,{state:a}=t,o=a.doc.lineAt(i),s,l;if(r&&!e&&i>o.from&&iiMt(t,!1,!0),aMt=t=>iMt(t,!0,!1),oMt=(t,e)=>uF(t,r=>{let n=r.head,{state:i}=t,a=i.doc.lineAt(n),o=i.charCategorizer(n);for(let s=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=Ul(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=o(u);if(s!=null&&h!=s)break;(u!=" "||n!=r.head)&&(s=h),n=l}return n}),sMt=t=>oMt(t,!1),AOn=t=>oMt(t,!0),SOn=t=>uF(t,e=>{let r=t.lineBlockAt(e.head).to;return e.headuF(t,e=>{let r=t.moveToLineBoundary(e,!1).head;return e.head>r?r:Math.max(0,e.head-1)}),COn=t=>uF(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:wi.of(["",""])},range:xt.cursor(n.from)}));return e(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0},kOn=({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),o=i==a.from?i-1:Ul(a.text,i-a.from,!1)+a.from,s=i==a.to?i+1:Ul(a.text,i-a.from,!0)+a.from;return{changes:{from:o,to:s,insert:t.doc.slice(i,s).append(t.doc.slice(o,i))},range:xt.cursor(s)}});return r.changes.empty?!1:(e(t.update(r,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function BZ(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 o=e[e.length-1];o.to=a.to,o.ranges.push(n)}else e.push({from:i.from,to:a.to,ranges:[n]});r=a.number+1}return e}function lMt(t,e,r){if(t.readOnly)return!1;let n=[],i=[];for(let a of BZ(t)){if(r?a.to==t.doc.length:a.from==0)continue;let o=t.doc.lineAt(r?a.to+1:a.from-1),s=o.length+1;if(r){n.push({from:a.to,to:o.to},{from:a.from,insert:o.text+t.lineBreak});for(let l of a.ranges)i.push(xt.range(Math.min(t.doc.length,l.anchor+s),Math.min(t.doc.length,l.head+s)))}else{n.push({from:o.from,to:a.from},{from:a.to,insert:t.lineBreak+o.text});for(let l of a.ranges)i.push(xt.range(l.anchor-s,l.head-s))}}return n.length?(e(t.update({changes:n,scrollIntoView:!0,selection:xt.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const EOn=({state:t,dispatch:e})=>lMt(t,e,!1),_On=({state:t,dispatch:e})=>lMt(t,e,!0);function cMt(t,e,r){if(t.readOnly)return!1;let n=[];for(let a of BZ(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 ROn=({state:t,dispatch:e})=>cMt(t,e,!1),DOn=({state:t,dispatch:e})=>cMt(t,e,!0),LOn=t=>{if(t.state.readOnly)return!1;let{state:e}=t,r=e.changes(BZ(e).map(({from:i,to:a})=>(i>0?i--:a{let a;if(t.lineWrapping){let o=t.lineBlockAt(i.head),s=t.coordsAtPos(i.head,i.assoc||1);s&&(a=o.bottom+t.documentTop-s.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 MOn(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let r=wa(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(_n.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 uMt=hMt(!1),IOn=hMt(!0);function hMt(t){return({state:e,dispatch:r})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{let{from:a,to:o}=i,s=e.doc.lineAt(a),l=!t&&a==o&&MOn(e,a);t&&(a=o=(o<=s.to?s:e.doc.lineAt(o)).to);let u=new iZ(e,{simulateBreak:a,simulateDoubleBreak:!!l}),h=Qwe(u,a);for(h==null&&(h=Lg(/^\s*/.exec(e.doc.lineAt(a).text)[0],e.tabSize));os.from&&a{let i=[];for(let o=n.from;o<=n.to;){let s=t.doc.lineAt(o);s.number>r&&(n.empty||n.to>s.from)&&(e(s,i,n),r=s.number),o=s.to+1}let a=t.changes(i);return{changes:i,range:xt.range(a.mapPos(n.anchor,1),a.mapPos(n.head,1))}})}const POn=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=Object.create(null),n=new iZ(t,{overrideIndentation:a=>{let o=r[a];return o??-1}}),i=vSe(t,(a,o,s)=>{let l=Qwe(n,a.from);if(l==null)return;/\S/.test(a.text)||(l=0);let u=/^\s*/.exec(a.text)[0],h=U$(t,l);(u!=h||s.fromt.readOnly?!1:(e(t.update(vSe(t,(r,n)=>{n.push({from:r.from,insert:t.facet(ZR)})}),{userEvent:"input.indent"})),!0),fMt=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(vSe(t,(r,n)=>{let i=/^\s*/.exec(r.text)[0];if(!i)return;let a=Lg(i,t.tabSize),o=0,s=U$(t,Math.max(0,a-pC(t)));for(;o(t.setTabFocusMode(),!0),BOn=[{key:"Ctrl-b",run:ILt,shift:GLt,preventDefault:!0},{key:"Ctrl-f",run:PLt,shift:HLt},{key:"Ctrl-p",run:$Lt,shift:qLt},{key:"Ctrl-n",run:FLt,shift:jLt},{key:"Ctrl-a",run:rOn,shift:pOn},{key:"Ctrl-e",run:nOn,shift:gOn},{key:"Ctrl-d",run:aMt},{key:"Ctrl-h",run:mSe},{key:"Ctrl-k",run:SOn},{key:"Ctrl-Alt-h",run:sMt},{key:"Ctrl-o",run:OOn},{key:"Ctrl-t",run:kOn},{key:"Ctrl-v",run:gSe}],$On=[{key:"ArrowLeft",run:ILt,shift:GLt,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:YCn,shift:oOn,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:eOn,shift:dOn,preventDefault:!0},{key:"ArrowRight",run:PLt,shift:HLt,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:qCn,shift:sOn,preventDefault:!0},{mac:"Cmd-ArrowRight",run:tOn,shift:fOn,preventDefault:!0},{key:"ArrowUp",run:$Lt,shift:qLt,preventDefault:!0},{mac:"Cmd-ArrowUp",run:JLt,shift:tMt},{mac:"Ctrl-ArrowUp",run:VLt,shift:KLt},{key:"ArrowDown",run:FLt,shift:jLt,preventDefault:!0},{mac:"Cmd-ArrowDown",run:eMt,shift:rMt},{mac:"Ctrl-ArrowDown",run:gSe,shift:ZLt},{key:"PageUp",run:VLt,shift:KLt},{key:"PageDown",run:gSe,shift:ZLt},{key:"Home",run:JCn,shift:hOn,preventDefault:!0},{key:"Mod-Home",run:JLt,shift:tMt},{key:"End",run:ZCn,shift:uOn,preventDefault:!0},{key:"Mod-End",run:eMt,shift:rMt},{key:"Enter",run:uMt,shift:uMt},{key:"Mod-a",run:mOn},{key:"Backspace",run:mSe,shift:mSe,preventDefault:!0},{key:"Delete",run:aMt,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:sMt,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:AOn,preventDefault:!0},{mac:"Mod-Backspace",run:TOn,preventDefault:!0},{mac:"Mod-Delete",run:COn,preventDefault:!0}].concat(BOn.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),FOn=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:XCn,shift:lOn},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:KCn,shift:cOn},{key:"Alt-ArrowUp",run:EOn},{key:"Shift-Alt-ArrowUp",run:ROn},{key:"Alt-ArrowDown",run:_On},{key:"Shift-Alt-ArrowDown",run:DOn},{key:"Mod-Alt-ArrowUp",run:bOn},{key:"Mod-Alt-ArrowDown",run:xOn},{key:"Escape",run:wOn},{key:"Mod-Enter",run:IOn},{key:"Alt-l",mac:"Ctrl-l",run:vOn},{key:"Mod-i",run:yOn,preventDefault:!0},{key:"Mod-[",run:fMt},{key:"Mod-]",run:dMt},{key:"Mod-Alt-\\",run:POn},{key:"Shift-Mod-k",run:LOn},{key:"Shift-Mod-\\",run:aOn},{key:"Mod-/",run:ECn},{key:"Alt-A",run:RCn},{key:"Ctrl-m",mac:"Shift-Alt-m",run:NOn}].concat($On),zOn={key:"Tab",run:dMt,shift:fMt},pMt=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class h4{constructor(e,r,n=0,i=e.length,a,o){this.test=o,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?s=>a(pMt(s)):pMt,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 Yh(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=T2e(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=C0(e);let i=this.normalize(r);if(i.length)for(let a=0,o=n,s=!0;;a++){let l=i.charCodeAt(a),u=this.match(l,o,s,this.bufferPos+this.bufferStart,a==i.length-1);if(u)return this.value=u,this;if(a==i.length-1)break;s&&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=$Z(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 s=new d4(r,e.sliceString(r,n));return bSe.set(e,s),s}if(i.from==r&&i.to==n)return i;let{text:a,from:o}=i;return o>r&&(a=e.sliceString(r,o)+a,o=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=$Z(this.text,i+(n==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=d4.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(mMt.prototype[Symbol.iterator]=vMt.prototype[Symbol.iterator]=function(){return this});function UOn(t){try{return new RegExp(t,ySe),!0}catch{return!1}}function $Z(t,e){if(e>=t.length)return e;let r=t.lineAt(e),n;for(;e=56320&&n<57344;)e++;return e}const VOn=t=>{let{state:e}=t,r=String(e.doc.lineAt(t.state.selection.main.head).number),{close:n,result:i}=hbn(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 o=a&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(a.elements.line.value);if(!o){t.dispatch({effects:n});return}let s=e.doc.lineAt(e.selection.main.head),[,l,u,h,d]=o,f=h?+h.slice(1):0,p=u?+u:s.number;if(u&&d){let v=p/100;l&&(v=v*(l=="-"?-1:1)+s.number/e.doc.lines),p=Math.round(e.doc.lines*v)}else u&&l&&(p=p*(l=="-"?-1:1)+s.number);let g=e.doc.line(Math.max(1,Math.min(e.doc.lines,p))),m=xt.cursor(g.from+Math.max(0,Math.min(f,g.length)));t.dispatch({effects:[n,er.scrollIntoView(m.from,{y:"center"})],selection:m})}),!0},QOn={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},GOn=vr.define({combine(t){return E0(t,QOn,{highlightWordAroundCursor:(e,r)=>e||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function HOn(t){return[XOn,jOn]}const WOn=Ar.mark({class:"cm-selectionMatch"}),YOn=Ar.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function yMt(t,e,r,n){return(r==0||t(e.sliceDoc(r-1,r))!=Ao.Word)&&(n==e.doc.length||t(e.sliceDoc(n,n+1))!=Ao.Word)}function qOn(t,e,r,n){return t(e.sliceDoc(r,r+1))==Ao.Word&&t(e.sliceDoc(n-1,n))==Ao.Word}const jOn=Ro.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(GOn),{state:r}=t,n=r.selection;if(n.ranges.length>1)return Ar.none;let i=n.main,a,o=null;if(i.empty){if(!e.highlightWordAroundCursor)return Ar.none;let l=r.wordAt(i.head);if(!l)return Ar.none;o=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),o=r.charCategorizer(i.head),!(yMt(o,r,i.from,i.to)&&qOn(o,r,i.from,i.to)))return Ar.none}else if(a=r.sliceDoc(i.from,i.to),!a)return Ar.none}let s=[];for(let l of t.visibleRanges){let u=new h4(r.doc,a,l.from,l.to);for(;!u.next().done;){let{from:h,to:d}=u.value;if((!o||yMt(o,r,h,d))&&(i.empty&&h<=i.from&&d>=i.to?s.push(YOn.range(h,d)):(h>=i.to||d<=i.from)&&s.push(WOn.range(h,d)),s.length>e.maxMatches))return Ar.none}}return Ar.set(s)}},{decorations:t=>t.decorations}),XOn=er.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),KOn=({state:t,dispatch:e})=>{let{selection:r}=t,n=xt.create(r.ranges.map(i=>t.wordAt(i.head)||xt.cursor(i.head)),r.mainIndex);return n.eq(r)?!1:(e(t.update({selection:n})),!0)};function ZOn(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 o=!1,s=new h4(t.doc,e,n[n.length-1].to);;)if(s.next(),s.done){if(o)return null;s=new h4(t.doc,e,0,Math.max(0,n[n.length-1].from-1)),o=!0}else{if(o&&n.some(l=>l.from==s.value.from))continue;if(a){let l=t.wordAt(s.value.from);if(!l||l.from!=s.value.from||l.to!=s.value.to)continue}return s.value}}const JOn=({state:t,dispatch:e})=>{let{ranges:r}=t.selection;if(r.some(a=>a.from===a.to))return KOn({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=ZOn(t,n);return i?(e(t.update({selection:t.selection.addRange(xt.range(i.from,i.to),!1),effects:er.scrollIntoView(i.to)})),!0):!1},f4=vr.define({combine(t){return E0(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new fkn(e),scrollToMatch:e=>er.scrollIntoView(e)})}});class bMt{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||UOn(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 akn(this):new rkn(this)}getCursor(e,r=0,n){let i=e.doc?e:ei.create({doc:e});return n==null&&(n=i.doc.length),this.regexp?g4(this,i,r,n):p4(this,i,r,n)}}class xMt{constructor(e){this.spec=e}}function ekn(t,e,r){return(n,i,a,o)=>{if(r&&!r(n,i,a,o))return!1;let s=n>=o&&i<=o+a.length?a.slice(n-o,i-o):e.doc.sliceString(n,i);return t(s,e,n,i)}}function p4(t,e,r,n){let i;return t.wholeWord&&(i=tkn(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(i=ekn(t.test,e,i)),new h4(e.doc,t.unquoted,r,n,t.caseSensitive?void 0:a=>a.toLowerCase(),i)}function tkn(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=p4(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 nkn(t,e,r){return(n,i,a)=>(!r||r(n,i,a))&&t(a[0],e,n,i)}function g4(t,e,r,n){let i;return t.wholeWord&&(i=ikn(e.charCategorizer(e.selection.main.head))),t.test&&(i=nkn(t.test,e,i)),new mMt(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:i},r,n)}function FZ(t,e){return t.slice(Ul(t,e,!1),e)}function zZ(t,e){return t.slice(e,Ul(t,e))}function ikn(t){return(e,r,n)=>!n[0].length||(t(FZ(n.input,n.index))!=Ao.Word||t(zZ(n.input,n.index))!=Ao.Word)&&(t(zZ(n.input,n.index+n[0].length))!=Ao.Word||t(FZ(n.input,n.index+n[0].length))!=Ao.Word)}class akn extends xMt{nextMatch(e,r,n){let i=g4(this.spec,e,n,e.doc.length).next();return i.done&&(i=g4(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),o=g4(this.spec,e,a,n),s=null;for(;!o.next().done;)s=o.value;if(s&&(a==r||s.from>a+10))return s;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=g4(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 hF=on.define(),xSe=on.define(),B2=Ko.define({create(t){return new wSe(SSe(t).create(),null)},update(t,e){for(let r of e.effects)r.is(hF)?t=new wSe(r.value.create(),t.panel):r.is(xSe)&&(t=new wSe(t.query,r.value?ASe:null));return t},provide:t=>N$.from(t,e=>e.panel)});class wSe{constructor(e,r){this.query=e,this.panel=r}}const okn=Ar.mark({class:"cm-searchMatch"}),skn=Ar.mark({class:"cm-searchMatch cm-searchMatch-selected"}),lkn=Ro.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(B2))}update(t){let e=t.state.field(B2);(e!=t.startState.field(B2)||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 Qu;for(let i=0,a=r.visibleRanges,o=a.length;ia[i+1].from-2*250;)l=a[++i].to;t.highlight(r.state,s,l,(u,h)=>{let d=r.state.selection.ranges.some(f=>f.from==u&&f.to==h);n.add(u,h,d?skn:okn)})}return n.finish()}},{decorations:t=>t.decorations});function dF(t){return e=>{let r=e.state.field(B2,!1);return r&&r.query.spec.valid?t(e,r):TMt(e)}}const UZ=dF((t,{query:e})=>{let{to:r}=t.state.selection.main,n=e.nextMatch(t.state,r,r);if(!n)return!1;let i=xt.single(n.from,n.to),a=t.state.facet(f4);return t.dispatch({selection:i,effects:[TSe(t,n),a.scrollToMatch(i.main,t)],userEvent:"select.search"}),SMt(t),!0}),VZ=dF((t,{query:e})=>{let{state:r}=t,{from:n}=r.selection.main,i=e.prevMatch(r,n,n);if(!i)return!1;let a=xt.single(i.from,i.to),o=t.state.facet(f4);return t.dispatch({selection:a,effects:[TSe(t,i),o.scrollToMatch(a.main,t)],userEvent:"select.search"}),SMt(t),!0}),ckn=dF((t,{query:e})=>{let r=e.matchAll(t.state,1e3);return!r||!r.length?!1:(t.dispatch({selection:xt.create(r.map(n=>xt.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),ukn=({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=[],o=0;for(let s=new h4(t.doc,t.sliceDoc(n,i));!s.next().done;){if(a.length>1e3)return!1;s.value.from==n&&(o=a.length),a.push(xt.range(s.value.from,s.value.to))}return e(t.update({selection:xt.create(a,o),userEvent:"select.search.matches"})),!0},wMt=dF((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 o=a,s=[],l,u,h=[];o.precise?o.from==n&&o.to==i&&(u=r.toText(e.getReplacement(o)),s.push({from:o.from,to:o.to,insert:u}),o=e.nextMatch(r,o.from,o.to),h.push(er.announce.of(r.phrase("replaced match on line $",r.doc.lineAt(n).number)+"."))):o=e.nextMatch(r,o.from,o.to);let d=t.state.changes(s);return o&&(l=xt.single(o.from,o.to).map(d),h.push(TSe(t,o)),h.push(r.facet(f4).scrollToMatch(l.main,t))),t.dispatch({changes:d,selection:l,effects:h,userEvent:"input.replace"}),!0}),hkn=dF((t,{query:e})=>{if(t.state.readOnly)return!1;let r=[];for(let i of e.matchAll(t.state,1e9)){let{from:a,to:o,precise:s}=i;s&&r.push({from:a,to:o,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 ASe(t){return t.state.facet(f4).createPanel(t)}function SSe(t,e){var r,n,i,a,o;let s=t.selection.main,l=s.empty||s.to>s.from+100?"":t.sliceDoc(s.from,s.to);if(e&&!l)return e;let u=t.facet(f4);return new bMt({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:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:u.wholeWord})}function AMt(t){let e=Lwe(t,ASe);return e&&e.dom.querySelector("[main-field]")}function SMt(t){let e=AMt(t);e&&e==t.root.activeElement&&e.select()}const TMt=t=>{let e=t.state.field(B2,!1);if(e&&e.panel){let r=AMt(t);if(r&&r!=t.root.activeElement){let n=SSe(t.state,e.query.spec);n.valid&&t.dispatch({effects:hF.of(n)}),r.focus(),r.select()}}else t.dispatch({effects:[xSe.of(!0),e?hF.of(SSe(t.state,e.query.spec)):on.appendConfig.of(gkn)]});return!0},CMt=t=>{let e=t.state.field(B2,!1);if(!e||!e.panel)return!1;let r=Lwe(t,ASe);return r&&r.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:xSe.of(!1)}),!0},dkn=[{key:"Mod-f",run:TMt,scope:"editor search-panel"},{key:"F3",run:UZ,shift:VZ,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:UZ,shift:VZ,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:CMt,scope:"editor search-panel"},{key:"Mod-Shift-l",run:ukn},{key:"Mod-Alt-g",run:VOn},{key:"Mod-d",run:JOn,preventDefault:!0}];class fkn{constructor(e){this.view=e;let r=this.query=e.state.field(B2).query.spec;this.commit=this.commit.bind(this),this.searchField=xa("input",{value:r.search,placeholder:af(e,"Find"),"aria-label":af(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=xa("input",{value:r.replace,placeholder:af(e,"Replace"),"aria-label":af(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=xa("input",{type:"checkbox",name:"case",form:"",checked:r.caseSensitive,onchange:this.commit}),this.reField=xa("input",{type:"checkbox",name:"re",form:"",checked:r.regexp,onchange:this.commit}),this.wordField=xa("input",{type:"checkbox",name:"word",form:"",checked:r.wholeWord,onchange:this.commit});function n(i,a,o){return xa("button",{class:"cm-button",name:i,onclick:a,type:"button"},o)}this.dom=xa("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,n("next",()=>UZ(e),[af(e,"next")]),n("prev",()=>VZ(e),[af(e,"previous")]),n("select",()=>ckn(e),[af(e,"all")]),xa("label",null,[this.caseField,af(e,"match case")]),xa("label",null,[this.reField,af(e,"regexp")]),xa("label",null,[this.wordField,af(e,"by word")]),...e.state.readOnly?[]:[xa("br"),this.replaceField,n("replace",()=>wMt(e),[af(e,"replace")]),n("replaceAll",()=>hkn(e),[af(e,"replace all")])],xa("button",{name:"close",onclick:()=>CMt(e),"aria-label":af(e,"close"),type:"button"},["×"])])}commit(){let e=new bMt({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:hF.of(e)}))}keydown(e){x1n(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?VZ:UZ)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),wMt(this.view))}update(e){for(let r of e.transactions)for(let n of r.effects)n.is(hF)&&!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(f4).top}}function af(t,e){return t.state.phrase(e)}const QZ=30,GZ=/[\s\.,:;?!]/;function TSe(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-QZ),o=Math.min(i,r+QZ),s=t.state.sliceDoc(a,o);if(a!=n.from){for(let l=0;ls.length-QZ;l--)if(!GZ.test(s[l-1])&&GZ.test(s[l])){s=s.slice(0,l);break}}return er.announce.of(`${t.state.phrase("current match")}. ${s} ${t.state.phrase("on line")} ${n.number}.`)}const pkn=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"}}),gkn=[B2,Zd.low(lkn),pkn];class OMt{constructor(e,r,n){this.from=e,this.to=r,this.diagnostic=n}}class AC{constructor(e,r,n){this.diagnostics=e,this.panel=r,this.selected=n}static init(e,r,n){let i=n.facet(fF).markerFilter;i&&(e=i(e,n));let a=e.slice().sort((p,g)=>p.from-g.from||p.to-g.to),o=new Qu,s=[],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&&!s.length)break;let m,v;if(s.length)m=l,v=s.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,s.push(g),p++}for(;px.from||x.to==m))s.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(s.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=kkn(s);if(y)o.add(m,m,Ar.widget({widget:new Skn(b),diagnostics:s.slice()}));else{let x=s.reduce((w,A)=>A.markClass?w+" "+A.markClass:w,"");o.add(m,v,Ar.mark({class:"cm-lintRange cm-lintRange-"+b+x,diagnostics:s.slice(),inclusiveEnd:s.some(w=>w.to>v)}))}if(l=v,l==d)break;for(let x=0;x{if(!(e&&o.diagnostics.indexOf(e)<0))if(!n)n=new OMt(i,a,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new OMt(n.from,a,n.diagnostic)}}),n}function mkn(t,e){let r=e.pos,n=e.end||r,i=t.state.facet(fF).hideOn(t,r,n);if(i!=null)return i;let a=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(o=>o.is(kMt))||t.changes.touchesRange(a.from,Math.max(a.to,n)))}function vkn(t,e){return t.field(of,!1)?e:e.concat(on.appendConfig.of(Ekn))}const kMt=on.define(),CSe=on.define(),EMt=on.define(),of=Ko.define({create(){return new AC(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=$2(r,t.selected.diagnostic,a)||$2(r,null,a)}!r.size&&i&&e.state.facet(fF).autoPanel&&(i=null),t=new AC(r,i,n)}for(let r of e.effects)if(r.is(kMt)){let n=e.state.facet(fF).autoPanel?r.value.length?pF.open:null:t.panel;t=AC.init(r.value,n,e.state)}else r.is(CSe)?t=new AC(t.diagnostics,r.value?pF.open:null,t.selected):r.is(EMt)&&(t=new AC(t.diagnostics,t.panel,r.value));return t},provide:t=>[N$.from(t,e=>e.panel),er.decorations.from(t,e=>e.diagnostics)]}),ykn=Ar.mark({class:"cm-lintRange cm-lintRange-active"});function bkn(t,e,r){let{diagnostics:n}=t.state.field(of),i,a=-1,o=-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)&&(eLMt(t,r,!1)))}const wkn=t=>{let e=t.state.field(of,!1);(!e||!e.panel)&&t.dispatch({effects:vkn(t.state,[CSe.of(!0)])});let r=Lwe(t,pF.open);return r&&r.dom.querySelector(".cm-panel-lint ul").focus(),!0},_Mt=t=>{let e=t.state.field(of,!1);return!e||!e.panel?!1:(t.dispatch({effects:CSe.of(!1)}),!0)},Akn=[{key:"Mod-Shift-m",run:wkn,preventDefault:!0},{key:"F8",run:t=>{let e=t.state.field(of,!1);if(!e)return!1;let r=t.state.selection.main,n=$2(e.diagnostics,null,r.to+1);return!n&&(n=$2(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}),cbn(t,n.from,1,{tooltip:IMt,until:i=>i.docChanged||i.newSelection.main.headn.to}),!0)}}],fF=vr.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...E0(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:RMt,tooltipFilter:RMt,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 RMt(t,e){return t?e?(r,n)=>e(t(r,n),n):t:e}function DMt(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 LMt(t,e,r){var n;let i=r?DMt(e.actions):[];return xa("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},xa("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(n=e.actions)===null||n===void 0?void 0:n.map((a,o)=>{let s=!1,l=p=>{if(p.preventDefault(),s)return;s=!0;let g=$2(t.state.field(of).diagnostics,e);g&&a.apply(t,g.from,g.to)},{name:u}=a,h=i[o]?u.indexOf(i[o]):-1,d=h<0?u:[u.slice(0,h),xa("u",u.slice(h,h+1)),u.slice(h+1)],f=a.markClass?" "+a.markClass:"";return xa("button",{type:"button",class:"cm-diagnosticAction"+f,onclick:l,onmousedown:l,"aria-label":` Action: ${u}${h<0?"":` (access key "${i[o]})"`}.`},d)}),e.source&&xa("div",{class:"cm-diagnosticSource"},e.source))}class Skn extends Hu{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return xa("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class MMt{constructor(e,r){this.diagnostic=r,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=LMt(e,r,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class pF{constructor(e){this.view=e,this.items=[];let r=i=>{if(!(i.ctrlKey||i.altKey||i.metaKey)){if(i.keyCode==27)_Mt(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],o=DMt(a.actions);for(let s=0;s{for(let a=0;a_Mt(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(of).selected;if(!e)return-1;for(let r=0;r{for(let h of u.diagnostics){if(o.has(h))continue;o.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:s,panel:l})=>{let u=l.height/this.list.offsetHeight;s.topl.bottom&&(this.list.scrollTop+=(s.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(of),n=$2(r.diagnostics,this.items[e].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:EMt.of(n)})}static open(e){return new pF(e)}}function Tkn(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function HZ(t){return Tkn(``,'width="6" height="3"')}const Ckn=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:HZ("#f11")},".cm-lintRange-warning":{backgroundImage:HZ("orange")},".cm-lintRange-info":{backgroundImage:HZ("#999")},".cm-lintRange-hint":{backgroundImage:HZ("#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 Okn(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function kkn(t){let e="hint",r=1;for(let n of t){let i=Okn(n.severity);i>r&&(r=i,e=n.severity)}return e}const IMt=lbn(bkn,{hideOn:mkn}),Ekn=[of,er.decorations.compute([of],t=>{let{selected:e,panel:r}=t.field(of);return!e||!r||e.from==e.to?Ar.none:Ar.set([ykn.range(e.from,e.to)])}),IMt,Ckn];var OSe=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(U2n)),e.defaultKeymap!==!1&&(a=a.concat(FOn)),e.searchKeymap!==!1&&(a=a.concat(dkn)),e.historyKeymap!==!1&&(a=a.concat(WCn)),e.foldKeymap!==!1&&(a=a.concat(qbn)),e.completionKeymap!==!1&&(a=a.concat(l3t)),e.lintKeymap!==!1&&(a=a.concat(Akn));var o=[];return e.lineNumbers!==!1&&o.push(XRt()),e.highlightActiveLineGutter!==!1&&o.push(Sbn()),e.highlightSpecialChars!==!1&&o.push(B1n()),e.history!==!1&&o.push(BCn()),e.foldGutter!==!1&&o.push(Zbn()),e.drawSelection!==!1&&o.push(O1n()),e.dropCursor!==!1&&o.push(D1n()),e.allowMultipleSelections!==!1&&o.push(ei.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&o.push(Vbn()),e.syntaxHighlighting!==!1&&o.push(b4t(nxn,{fallback:!0})),e.bracketMatching!==!1&&o.push(cxn()),e.closeBrackets!==!1&&o.push($2n()),e.autocompletion!==!1&&o.push(q2n()),e.rectangularSelection!==!1&&o.push(K1n()),i!==!1&&o.push(ebn()),e.highlightActiveLine!==!1&&o.push(Q1n()),e.highlightSelectionMatches!==!1&&o.push(HOn()),e.tabSize&&typeof e.tabSize=="number"&&o.push(ZR.of(" ".repeat(e.tabSize))),o.concat([qR.of(a.flat())]).filter(Boolean)};const _kn="#e5c07b",PMt="#e06c75",Rkn="#56b6c2",Dkn="#ffffff",WZ="#abb2bf",kSe="#7d8799",Lkn="#61afef",Mkn="#98c379",NMt="#d19a66",Ikn="#c678dd",Pkn="#21252b",BMt="#2c313a",$Mt="#282c34",ESe="#353a42",Nkn="#3E4451",FMt="#528bff",Bkn=er.theme({"&":{color:WZ,backgroundColor:$Mt},".cm-content":{caretColor:FMt},".cm-cursor, .cm-dropCursor":{borderLeftColor:FMt},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Nkn},".cm-panels":{backgroundColor:Pkn,color:WZ},".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:$Mt,color:kSe,border:"none"},".cm-activeLineGutter":{backgroundColor:BMt},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:ESe},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:ESe,borderBottomColor:ESe},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:BMt,color:WZ}}},{dark:!0}),$kn=G$.define([{tag:Re.keyword,color:Ikn},{tag:[Re.name,Re.deleted,Re.character,Re.propertyName,Re.macroName],color:PMt},{tag:[Re.function(Re.variableName),Re.labelName],color:Lkn},{tag:[Re.color,Re.constant(Re.name),Re.standard(Re.name)],color:NMt},{tag:[Re.definition(Re.name),Re.separator],color:WZ},{tag:[Re.typeName,Re.className,Re.number,Re.changed,Re.annotation,Re.modifier,Re.self,Re.namespace],color:_kn},{tag:[Re.operator,Re.operatorKeyword,Re.url,Re.escape,Re.regexp,Re.link,Re.special(Re.string)],color:Rkn},{tag:[Re.meta,Re.comment],color:kSe},{tag:Re.strong,fontWeight:"bold"},{tag:Re.emphasis,fontStyle:"italic"},{tag:Re.strikethrough,textDecoration:"line-through"},{tag:Re.link,color:kSe,textDecoration:"underline"},{tag:Re.heading,fontWeight:"bold",color:PMt},{tag:[Re.atom,Re.bool,Re.special(Re.variableName)],color:NMt},{tag:[Re.processingInstruction,Re.string,Re.inserted],color:Mkn},{tag:Re.invalid,color:Dkn}]),zMt=[Bkn,b4t($kn)];var Fkn=er.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),zkn=function(e){e===void 0&&(e={});var r=e,n=r.indentWithTab,i=n===void 0?!0:n,a=r.editable,o=a===void 0?!0:a,s=r.readOnly,l=s===void 0?!1:s,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(qR.of([zOn])),g&&(typeof g=="boolean"?m.unshift(OSe()):m.unshift(OSe(g))),f&&m.unshift(Y1n(f)),h){case"light":m.push(Fkn);break;case"dark":m.push(zMt);break;case"none":break;default:m.push(h);break}return o===!1&&m.push(er.editable.of(!1)),l&&m.push(ei.readOnly.of(!0)),[...m]},Ukn=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 Vkn{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 UMt{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 _Se=null,Qkn=()=>typeof window>"u"?new UMt:(_Se||(_Se=new UMt),_Se),Gkn=er.theme({"& .cm-scroller":{height:"100% !important"}}),VMt=null,RSe=null;function Hkn(t,e,r,n,i,a){if(!t&&!e&&!r&&!n&&!i&&!a)return null;var o=JSON.stringify({height:t,minHeight:e,maxHeight:r,width:n,minWidth:i,maxWidth:a});return o===VMt||(VMt=o,RSe=er.theme({"&":{height:t,minHeight:e,maxHeight:r,width:n,minWidth:i,maxWidth:a}})),RSe}var QMt=k0.define(),Wkn=200,Ykn=[];function qkn(t){var e=t.value,r=t.selection,n=t.onChange,i=t.onStatistics,a=t.onCreateEditor,o=t.onUpdate,s=t.extensions,l=s===void 0?Ykn:s,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,C=t.placeholder,k=C===void 0?"":C,E=t.editable,_=E===void 0?!0:E,P=t.readOnly,L=P===void 0?!1:P,R=t.indentWithTab,D=R===void 0?!0:R,M=t.basicSetup,I=M===void 0?!0:M,N=t.root,F=t.initialState,B=j.useState(),V=B[0],z=B[1],U=j.useState(),Q=U[0],G=U[1],q=j.useState(),Y=q[0],ne=q[1],X=j.useState(()=>({current:null}))[0],J=j.useState(()=>({current:null}))[0],ee=Hkn(p,m,y,x,A,T),te=er.updateListener.of(Ce=>{if(Ce.docChanged&&typeof n=="function"&&!Ce.transactions.some(ue=>ue.annotation(QMt))){X.current?X.current.reset():(X.current=new Vkn(()=>{if(J.current){var ue=J.current;J.current=null,ue()}X.current=null},Wkn),Qkn().add(X.current));var ke=Ce.state.doc,Ee=ke.toString();n(Ee,Ce)}i&&i(Ukn(Ce))}),pe=zkn({theme:d,editable:_,readOnly:L,placeholder:k,indentWithTab:D,basicSetup:I}),ie=[te,...ee?[ee]:[],Gkn,...pe];return o&&typeof o=="function"&&ie.push(er.updateListener.of(o)),ie=ie.concat(l),j.useLayoutEffect(()=>{if(V&&!Y){var Ce={doc:e,selection:r,extensions:ie},ke=F?ei.fromJSON(F.json,Ce,F.fields):ei.create(Ce);if(ne(ke),!Q){var Ee=new er({state:ke,parent:V,root:N});G(Ee),a&&a(Ee,ke)}}return()=>{Q&&(ne(void 0),G(void 0))}},[V,Y]),j.useEffect(()=>{t.container&&z(t.container)},[t.container]),j.useEffect(()=>()=>{Q&&(Q.destroy(),G(void 0)),X.current&&(X.current.cancel(),X.current=null)},[Q]),j.useEffect(()=>{u&&Q&&Q.focus()},[u,Q]),j.useEffect(()=>{Q&&Q.dispatch({effects:on.reconfigure.of(ie)})},[d,l,p,m,y,x,A,T,k,_,L,D,I,n,o]),j.useEffect(()=>{if(e!==void 0){var Ce=Q?Q.state.doc.toString():"";if(Q&&e!==Ce){var ke=X.current&&!X.current.isDone,Ee=()=>{Q&&e!==Q.state.doc.toString()&&Q.dispatch({changes:{from:0,to:Q.state.doc.toString().length,insert:e||""},annotations:[QMt.of(!0)]})};ke?J.current=Ee:Ee()}}},[e,Q]),{state:Y,setState:ne,view:Q,setView:G,container:V,setContainer:z}}var jkn=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],DSe=j.forwardRef((t,e)=>{var r=t.className,n=t.value,i=n===void 0?"":n,a=t.selection,o=t.extensions,s=o===void 0?[]:o,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,C=t.editable,k=t.readOnly,E=t.root,_=t.initialState,P=kCn(t,jkn),L=j.useRef(null),R=qkn({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:C,readOnly:k,selection:a,onChange:l,onStatistics:u,onCreateEditor:h,onUpdate:d,extensions:s,initialState:_}),D=R.state,M=R.view,I=R.container,N=R.setContainer;j.useImperativeHandle(e,()=>({editor:L.current,state:D,view:M}),[L,I,D,M]);var F=j.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 H.jsx("div",cSe({ref:F,className:""+B+(r?" "+r:"")},P))});DSe.displayName="CodeMirror";function YZ(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")?[jwe.define(OCn)]:n==="py"||n==="pyi"?[NTn()]:["ts","tsx","mts","cts"].includes(n??"")?[vAe({typescript:!0,jsx:n==="tsx"})]:["js","jsx","mjs","cjs"].includes(n??"")?[vAe({jsx:n==="jsx"})]:n==="json"||n==="jsonc"?[swn()]:n==="yaml"||n==="yml"?[dCn()]:["md","markdown"].includes(n??"")?[mSn()]:[]}function Xkn({value:t,path:e,onChange:r,readOnly:n=!1,theme:i="light",lineNumberStart:a=1,height:o="100%",minHeight:s,maxHeight:l,extensions:u}){const h=j.useMemo(()=>[...YZ(e),...a===1?[]:[XRt({formatNumber:d=>String(d+a-1)})],...u??[]],[a,e,u]);return H.jsx(DSe,{value:t,height:o,minHeight:s,maxHeight:l,theme:i,extensions:h,editable:!n,onChange:r,basicSetup:{lineNumbers:a===1,foldGutter:!0,highlightActiveLine:!0,highlightActiveLineGutter:!0,autocompletion:!1}})}const Kkn=Object.freeze(Object.defineProperty({__proto__:null,default:Xkn,languageFor:YZ},Symbol.toStringTag,{value:"Module"}));class Vs{constructor(e,r,n,i){this.fromA=e,this.toA=r,this.fromB=n,this.toB=i}offset(e,r=e){return new Vs(this.fromA+e,this.toA+e,this.fromB+r,this.toB+r)}}function SC(t,e,r,n,i,a){if(t==n)return[];let o=PSe(t,e,r,n,i,a),s=NSe(t,e+o,r,n,i+o,a);e+=o,r-=s,i+=o,a-=s;let l=r-e,u=a-i;if(!l||!u)return[new Vs(e,r,i,a)];if(l>u){let d=t.slice(e,r).indexOf(n.slice(i,a));if(d>-1)return[new Vs(e,e+d,i,i),new Vs(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 Vs(e,e,i,i+d),new Vs(r,r,i+d+l,a)]}if(l==1||u==1)return[new Vs(e,r,i,a)];let h=WMt(t,e,r,n,i,a);if(h){let[d,f,p]=h;return SC(t,e,d,n,i,f).concat(SC(t,d+p,r,n,f+p,a))}return Zkn(t,e,r,n,i,a)}let gF=1e9,mF=0,LSe=!1;function Zkn(t,e,r,n,i,a){let o=r-e,s=a-i;if(gF<1e9&&Math.min(o,s)>gF*16||mF>0&&Date.now()>mF)return Math.min(o,s)>gF*64?[new Vs(e,r,i,a)]:YMt(t,e,r,n,i,a);let l=Math.ceil((o+s)/2);MSe.reset(l),ISe.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=(o-s)%2!=0?ISe:null,f=d?null:MSe;for(let p=0;pgF||mF>0&&!(p&63)&&Date.now()>mF)return YMt(t,e,r,n,i,a);let g=MSe.advance(p,o,s,l,d,!1,u)||ISe.advance(p,o,s,l,f,!0,h);if(g)return Jkn(t,e,r,e+g[0],n,i,a,i+g[1])}return[new Vs(e,r,i,a)]}class GMt{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 MSe=new GMt,ISe=new GMt;function Jkn(t,e,r,n,i,a,o,s){let l=!1;return!m4(t,n)&&++n==r&&(l=!0),!m4(i,s)&&++s==o&&(l=!0),l?[new Vs(e,r,a,o)]:SC(t,e,n,i,a,s).concat(SC(t,n,r,i,s,o))}function HMt(t,e){let r=1,n=Math.min(t,e);for(;rr||h>a||t.slice(s,u)!=n.slice(l,h)){if(o==1)return s-e-(m4(t,s)?0:1);o=o>>1}else{if(u==r||h==a)return u-e;s=u,l=h}}}function NSe(t,e,r,n,i,a){if(e==r||i==a||t.charCodeAt(r-1)!=n.charCodeAt(a-1))return 0;let o=HMt(r-e,a-i);for(let s=r,l=a;;){let u=s-o,h=l-o;if(u>1}else{if(u==e||h==i)return r-u;s=u,l=h}}}function BSe(t,e,r,n,i,a,o,s){let l=n.slice(i,a),u=null;for(;;){if(u||o=r)break;let f=t.slice(h,d),p=-1;for(;(p=l.indexOf(f,p+1))!=-1;){let g=PSe(t,d,r,n,i+p+f.length,a),m=NSe(t,e,h,n,i,i+p),v=f.length+g+m;(!u||u[2]>1}}function WMt(t,e,r,n,i,a){let o=r-e,s=a-i;if(oi.fromA-e&&n.toB>i.fromB-e&&(t[r-1]=new Vs(n.fromA,i.toA,n.fromB,i.toB),t.splice(r--,1))}}function eEn(t,e,r){for(;;){qMt(r,1);let n=!1;for(let i=0;i3||s>3){let l=i==t.length-1?e.length:t[i+1].fromA,u=a.fromA-n,h=l-a.toA,d=eIt(e,a.fromA,u),f=JMt(e,a.toA,h),p=a.fromA-d,g=f-a.toA;if((!o||!s)&&p&&g){let m=Math.max(o,s),[v,y,b]=o?[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 Vs(d,d+o,a.fromB-p,a.toB-p),d=a.fromA,f=JMt(e,a.toA,l-a.toA)):m>g&&e.slice(a.toA,f)==v.slice(y,y+g)&&(a=t[i]=new Vs(f-o,f,a.fromB+g,a.toB+g),f=a.toA,d=eIt(e,a.fromA,a.fromA-n)),p=a.fromA-d,g=f-a.toA}if(p||g)a=t[i]=new Vs(a.fromA-p,a.toA+g,a.fromB-p,a.toB+g);else if(o){if(!s){let m=rIt(e,a.fromA,a.toA),v,y=m<0?-1:tIt(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=rIt(r,a.fromB,a.toB),v,y=m<0?-1:tIt(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 qMt(t,3),t}let TC;try{TC=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function jMt(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function XMt(t,e){if(e==t.length)return 0;let r=t.charCodeAt(e);return r<192?jMt(r)?1:0:TC?!nIt(r)||e==t.length-1?TC.test(String.fromCharCode(r))?1:0:TC.test(t.slice(e,e+2))?2:0:0}function KMt(t,e){if(!e)return 0;let r=t.charCodeAt(e-1);return r<192?jMt(r)?1:0:TC?!iIt(r)||e==1?TC.test(String.fromCharCode(r))?1:0:TC.test(t.slice(e-2,e))?2:0:0}const ZMt=8;function JMt(t,e,r){if(e==t.length||!KMt(t,e))return e;for(let n=e,i=e+r,a=0;ai)return n;n+=o}return e}function eIt(t,e,r){if(!e||!XMt(t,e))return e;for(let n=e,i=e-r,a=0;at>=55296&&t<=56319,iIt=t=>t>=56320&&t<=57343;function m4(t,e){return!e||e==t.length||!nIt(t.charCodeAt(e-1))||!iIt(t.charCodeAt(e))}function rEn(t,e,r){var n;let i=r==null?void 0:r.override;return i?i(t,e):(gF=((n=r==null?void 0:r.scanLimit)!==null&&n!==void 0?n:1e9)>>1,mF=r!=null&&r.timeout?Date.now()+r.timeout:0,LSe=!1,eEn(t,e,SC(t,0,t.length,e,0,e.length)))}function aIt(){return!LSe}function oIt(t,e,r){return tEn(rEn(t,e,r),t,e)}const Zh=vr.define({combine:t=>t[0]}),$Se=on.define(),sIt=vr.define(),qu=Ko.define({create(t){return null},update(t,e){for(let r of e.effects)r.is($Se)&&(t=r.value);for(let r of e.state.facet(sIt))t=r(t,e);return t}});class _1{constructor(e,r,n,i,a,o=!0){this.changes=e,this.fromA=r,this.toA=n,this.fromB=i,this.toB=a,this.precise=o}offset(e,r){return e||r?new _1(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=oIt(e.toString(),r.toString(),n);return uIt(i,e,r,0,0,aIt())}static updateA(e,r,n,i,a){return fIt(dIt(e,i,!0,n.length),e,r,n,a)}static updateB(e,r,n,i,a){return fIt(dIt(e,i,!1,r.length),e,r,n,a)}}function lIt(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]=cIt(g.toA+n,g.toB+i,e,r),s++}o.push(new _1(p,u,Math.max(u,d),h,Math.max(h,f),a))}return o}const qZ=1e3;function hIt(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 o=i+a>>1,s=t[o],[l,u]=r?[s.fromA,s.toA]:[s.fromB,s.toB];if(l>e)a=o;else if(u<=e)i=o+1;else return n?[s.fromA,s.fromB]:[s.toA,s.toB]}}function dIt(t,e,r,n){let i=[];return e.iterChangedRanges((a,o,s,l)=>{let u=0,h=r?e.length:n,d=0,f=r?n:e.length;a>qZ&&([u,d]=hIt(t,a-qZ,r,!0)),o=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 fIt(t,e,r,n,i){if(!t.length)return e;let a=[];for(let o=0,s=0,l=0,u=0;;o++){let h=o==t.length?null:t[o],d=h?h.fromA+s:r.length,f=h?h.fromB+l:n.length;for(;ud||v.toB+l>f))break;a.push(v.offset(s,l)),u++}if(!h)break;let p=h.toA+s+h.diffA,g=h.toB+l+h.diffB,m=oIt(r.sliceString(d,p),n.sliceString(f,g),i);for(let v of uIt(m,r,n,d,f,aIt()))a.push(v);for(s+=h.diffA,l+=h.diffB;up&&v.fromB+l>g)break;u++}}return a}const pIt={scanLimit:500},jZ=Ro.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=yIt(t))}update(t){(t.docChanged||t.viewportChanged||nEn(t.startState,t.state)||iEn(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=yIt(t.view))}},{decorations:t=>t.deco}),XZ=Zd.low(Iwe({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(jZ))===null||e===void 0?void 0:e.gutter)||ti.empty}}));function nEn(t,e){return t.field(qu,!1)!=e.field(qu,!1)}function iEn(t,e){return t.facet(Zh)!=e.facet(Zh)}const gIt=Ar.line({class:"cm-changedLine"}),mIt=Ar.mark({class:"cm-changedText"}),aEn=Ar.mark({tagName:"ins",class:"cm-insertedLine"}),oEn=Ar.mark({tagName:"del",class:"cm-deletedLine"}),vIt=new class extends wp{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function sEn(t,e,r,n,i,a){let o=r?t.fromA:t.fromB,s=r?t.toA:t.toB,l=0;if(o!=s){i.add(o,o,gIt),i.add(o,s,r?oEn:aEn),a&&a.add(o,o,vIt);for(let u=e.iterRange(o,s-1),h=o;!u.next().done;){if(u.lineBreak){h++,i.add(h,h,gIt),a&&a.add(h,h,vIt);continue}let d=h+u.value.length;if(n)for(;l=h)break;(o?d.toA:d.toB)>u&&(!a||!a(t.state,d,s,l))&&sEn(d,t.state.doc,o,n,s,l)}return{deco:s.finish(),gutter:l&&l.finish()}}class KZ extends Hu{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 ZZ=on.define({map:(t,e)=>t.map(e)}),vF=Ko.define({create:()=>Ar.none,update:(t,e)=>{for(let r of e.effects)if(r.is(ZZ))return r.value;return t.map(e.changes)},provide:t=>er.decorations.from(t)}),JZ=.01;function bIt(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 lEn(t,e,r){let n=new Qu,i=new Qu,a=t.state.field(vF).iter(),o=e.state.field(vF).iter(),s=0,l=0,u=0,h=0,d=t.viewport,f=e.viewport;for(let v=0;;v++){let y=vJZ&&(h+=S,i.add(l,l,Ar.widget({widget:new KZ(S),block:!0,side:-1})))}if(b>s+1e3&&sd.from&&lf.from){let w=Math.min(d.from-s,f.from-l);s+=w,l+=w,v--}else if(y)s=y.toA,l=y.toB;else break;for(;a.value&&a.fromJZ&&i.add(e.state.doc.length,e.state.doc.length,Ar.widget({widget:new KZ(p),block:!0,side:1}));let g=n.finish(),m=i.finish();bIt(g,t.state.field(vF))||t.dispatch({effects:ZZ.of(g)}),bIt(m,e.state.field(vF))||e.dispatch({effects:ZZ.of(m)})}const FSe=on.define({map:(t,e)=>e.mapPos(t)});class cEn extends Hu{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:FSe.of(i)});let{side:a,sibling:o}=e.state.facet(Zh);o&&o().dispatch({effects:FSe.of(uEn(i,e.state.field(qu),a=="a"))})}),r}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function uEn(t,e,r){let n=0,i=0;for(let a=0;;a++){let o=a=t)return i+(t-n);[n,i]=r?[o.toA,o.toB]:[o.toB,o.toA]}}const hEn=Ko.define({create(t){return Ar.none},update(t,e){t=t.map(e.changes);for(let r of e.effects)r.is(FSe)&&(t=t.update({filter:n=>n!=r.value}));if(t.size&&e.state.field(qu)!=e.startState.field(qu,!1)){let r=e.state.facet(Zh).side=="a",n=[];for(let i of e.state.field(qu))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 zSe({margin:t=3,minSize:e=4}){return hEn.init(r=>dEn(r,t,e))}function dEn(t,e,r){let n=new Qu,i=t.facet(Zh).side=="a",a=t.field(qu),o=1;for(let s=0;;s++){let l=s=r&&n.add(t.doc.line(u).from,t.doc.line(h).to,Ar.replace({widget:new cEn(d),block:!0})),!l)break;o=t.doc.lineAt(Math.min(t.doc.length,i?l.toA:l.toB)).number}return n.finish()}const fEn=er.styleModule.of(new d1({".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"}})),xIt=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"}}),wIt=new $R,eJ=new $R;class pEn{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||pIt;let r=[Zd.low(jZ),xIt,fEn,vF,er.updateListener.of(d=>{this.measuring<0&&(d.heightChanged||d.viewportChanged)&&!d.transactions.some(f=>f.effects.some(p=>p.is(ZZ)))&&this.measure()})],n=[Zh.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&n.push(XZ);let i=ei.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],er.editorAttributes.of({class:"cm-merge-a"}),eJ.of(n),r]}),a=[Zh.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&a.push(XZ);let o=ei.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],er.editorAttributes.of({class:"cm-merge-b"}),eJ.of(a),r]});this.chunks=_1.build(i.doc,o.doc,this.diffConf);let s=[qu.init(()=>this.chunks),wIt.of(e.collapseUnchanged?zSe(e.collapseUnchanged):[])];i=i.update({effects:on.appendConfig.of(s)}).state,o=o.update({effects:on.appendConfig.of(s)}).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:o,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((o,s)=>o.compose(s.changes),bs.empty(e[0].startState.doc.length));this.chunks=r==this.a?_1.updateA(this.chunks,n.newDoc,this.b.state.doc,i,this.diffConf):_1.updateB(this.chunks,this.a.state.doc,n.newDoc,i,this.diffConf),r.update([...e,n.state.update({effects:$Se.of(this.chunks)})]);let a=r==this.a?this.b:this.a;a.update([a.state.update({effects:$Se.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 o=this.a.dom.parentNode,s=this.b.dom.parentNode;o.remove(),s.remove(),this.editorDOM.insertBefore(a?o:s,this.editorDOM.firstChild),this.editorDOM.appendChild(a?s:o),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let a=!!this.revertDOM,o=this.revertToA,s=this.renderRevert;"revertControls"in e&&(a=!!e.revertControls,o=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(s=e.renderRevertControl),this.setupRevertControls(a,o,s)}let r="highlightChanges"in e,n="gutter"in e,i="collapseUnchanged"in e;if(r||n||i){let a=[],o=[];if(r||n){let s=this.a.state.facet(Zh),l=n?e.gutter!==!1:s.markGutter,u=r?e.highlightChanges!==!1:s.highlightChanges;a.push(eJ.reconfigure([Zh.of({side:"a",sibling:()=>this.b,highlightChanges:u,markGutter:l}),l?XZ:[]])),o.push(eJ.reconfigure([Zh.of({side:"b",sibling:()=>this.a,highlightChanges:u,markGutter:l}),l?XZ:[]]))}if(i){let s=wIt.reconfigure(e.collapseUnchanged?zSe(e.collapseUnchanged):[]);a.push(s),o.push(s)}this.a.dispatch({effects:a}),this.b.dispatch({effects:o})}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(){lEn(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||o.fromB>i.to)break;if(o.fromA-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function AIt(t){let e=t.nextSibling;return t.remove(),e}const gEn=new class extends wp{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},mEn=Zd.low(Iwe({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(jZ))===null||e===void 0?void 0:e.gutter)||ti.empty},widgetMarker:(t,e)=>e instanceof TIt?gEn:null}));function vEn(t){var e;let r=typeof t.original=="string"?wi.of(t.original.split(/\r?\n/)):t.original,n=t.diffConfig||pIt;return[Zd.low(jZ),wEn,xIt,er.editorAttributes.of({class:"cm-merge-b"}),sIt.of((i,a)=>{let o=a.effects.find(s=>s.is(USe));return o&&(i=_1.updateA(i,o.value.doc,a.startState.doc,o.value.changes,n)),a.docChanged&&(i=_1.updateB(i,a.state.field(v4),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:CEn,side:"b"}),v4.init(()=>r),t.gutter!==!1?mEn:[],t.collapseUnchanged?zSe(t.collapseUnchanged):[],qu.init(i=>_1.build(r,i.doc,n))]}const USe=on.define(),v4=Ko.define({create:()=>wi.empty,update(t,e){for(let r of e.effects)r.is(USe)&&(t=r.value.doc);return t}}),SIt=new WeakMap;class TIt extends Hu{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 yEn(t,e,r){let n=SIt.get(e.changes);if(n)return n;let i=o=>{let{highlightChanges:s,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(),bEn(o,o.posAtDOM(d))},S=T=>{T.preventDefault(),xEn(o,o.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 C=w.appendChild(document.createElement("button"));C.name="reject",C.textContent=t.phrase("Reject"),C.onmousedown=S}}if(r||e.fromA>=e.toA)return d;let f=o.state.field(v4).sliceString(e.fromA,e.endA),p=l&&t.facet(y1),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 P=document.createTextNode(f.slice(T,C));if(k){let L=g.appendChild(document.createElement("span"));L.className=k,L.appendChild(P)}else g.appendChild(P);T=C}E&&(y=!y)}}if(p&&e.toA-e.fromA<=u){let w=p.parser.parse(f),A=0;ZRt(w,{style:S=>Zbn(t,S)},(S,T,C)=>{S>A&&x(A,S,""),x(S,T,C),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 AIt(i)});return wIt.set(e.changes,a),a}function vEn(t,e){let{state:r}=t,n=e??r.selection.main.head,i=t.state.field(qu).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)),o=t.state.field(v4);i.fromB!=i.toB&&i.toA<=o.length&&(a+=t.state.lineBreak);let s=bs.of({from:i.fromA,to:Math.min(o.length,i.toA),insert:a},o.length);return t.dispatch({effects:USe.of({doc:s.apply(o),changes:s}),userEvent:"accept"}),!0}function yEn(t,e){let{state:r}=t,n=e??r.selection.main.head,i=r.field(qu).find(s=>s.fromB<=n&&s.endB>=n);if(!i)return!1;let o=r.field(v4).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));return i.fromA!=i.toA&&i.toB<=r.doc.length&&(o+=r.lineBreak),t.dispatch({changes:{from:i.fromB,to:Math.min(r.doc.length,i.toB),insert:o},userEvent:"revert"}),!0}function SIt(t){let e=new Qu;for(let r of t.field(qu)){let n=t.facet(Zh).overrideChunk&&CIt(t,r);e.add(r.fromB,r.fromB,mEn(t,r,!!n))}return e.finish()}const bEn=Ko.define({create:t=>SIt(t),update(t,e){return e.state.field(qu,!1)!=e.startState.field(qu,!1)?SIt(e.state):t},provide:t=>er.decorations.from(t)}),TIt=new WeakMap;function CIt(t,e){let r=TIt.get(e);if(r!==void 0)return r;r=null;let n=t.field(v4),i=t.doc,a=n.lineAt(e.endA).number-n.lineAt(e.fromA).number+1,o=i.lineAt(e.endB).number-i.lineAt(e.fromB).number+1;e:if(a==o&&a<10){let s=[],l=0,u=e.fromA,h=e.fromB;for(let d of e.changes){if(d.fromA=e.endB)break;o=t.doc.lineAt(o.to+1)}return!0}const OIt="(max-width: 760px)";function TEn(){const[t,e]=j.useState(()=>typeof window<"u"&&window.matchMedia(OIt).matches);return j.useEffect(()=>{const r=window.matchMedia(OIt),n=()=>e(r.matches);return n(),r.addEventListener("change",n),()=>r.removeEventListener("change",n)},[]),t}function kIt(t,e){return[OSe({lineNumbers:!0,foldGutter:!0,highlightActiveLine:!1,highlightActiveLineGutter:!1,autocompletion:!1}),...YZ(t),ei.readOnly.of(!0),...e==="dark"?[$Mt]:[]]}function CEn({before:t,after:e,path:r,theme:n}){const i=j.useRef(null);return j.useEffect(()=>{if(!i.current)return;const a=new dEn({a:{doc:t,extensions:kIt(r,n)},b:{doc:e,extensions:kIt(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]),H.jsx("div",{ref:i,className:"code-browser-merge"})}function OEn(t){return TEn()?H.jsx(DSe,{value:t.after,height:"100%",theme:t.theme,editable:!1,extensions:[...YZ(t.path),...gEn({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}}):H.jsx(CEn,{...t})}const kEn=Object.freeze(Object.defineProperty({__proto__:null,default:OEn},Symbol.toStringTag,{value:"Module"}));class Zt extends Error{constructor(e,r){var n="KaTeX parse error: "+e,i,a,o=r&&r.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=s.slice(i,a).replace(/[^]/g,"$&̲"),u;i>15?u="…"+s.slice(i-15,i):u=s.slice(0,i);var h;a+15t.replace(EEn,"-$1").toLowerCase(),REn={"&":"&",">":">","<":"<",'"':""","'":"'"},DEn=/[&><"']/g,uu=t=>String(t).replace(DEn,e=>REn[e]),tJ=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?tJ(t.body[0]):t:t.type==="font"?tJ(t.body):t,LEn=new Set(["mathord","textord","atom"]),R1=t=>LEn.has(tJ(t).type),MEn=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"},rJ={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 IEn(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 PEn(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return IEn(e)}function NEn(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:PEn(n)}class VSe{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(rJ)){var n=rJ[r];n&&NEn(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=MEn(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class F2{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 F0[BEn[this.id]]}sub(){return F0[$En[this.id]]}fracNum(){return F0[FEn[this.id]]}fracDen(){return F0[zEn[this.id]]}cramp(){return F0[UEn[this.id]]}text(){return F0[VEn[this.id]]}isTight(){return this.size>=2}}var QSe=0,nJ=1,y4=2,D1=3,yF=4,Op=5,b4=6,ju=7,F0=[new F2(QSe,0,!1),new F2(nJ,0,!0),new F2(y4,1,!1),new F2(D1,1,!0),new F2(yF,2,!1),new F2(Op,2,!0),new F2(b4,3,!1),new F2(ju,3,!0)],BEn=[yF,Op,yF,Op,b4,ju,b4,ju],$En=[Op,Op,Op,Op,ju,ju,ju,ju],FEn=[y4,D1,yF,Op,b4,ju,b4,ju],zEn=[D1,D1,Op,Op,ju,ju,ju,ju],UEn=[nJ,nJ,D1,D1,Op,Op,ju,ju],VEn=[QSe,nJ,y4,D1,y4,D1,y4,D1],Nn={DISPLAY:F0[QSe],TEXT:F0[y4],SCRIPT:F0[yF],SCRIPTSCRIPT:F0[b4]},GSe=[{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 QEn(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var iJ=[];GSe.forEach(t=>t.blocks.forEach(e=>iJ.push(...e)));function EIt(t){for(var e=0;e=iJ[e]&&t<=iJ[e+1])return!0;return!1}var ul=t=>t+" "+t,x4=80,GEn=function(e,r){return"M95,"+(622+e+r)+` +`,T);if(_>-1&&_T){let P=document.createTextNode(f.slice(T,C));if(k){let L=g.appendChild(document.createElement("span"));L.className=k,L.appendChild(P)}else g.appendChild(P);T=C}E&&(y=!y)}}if(p&&e.toA-e.fromA<=u){let w=p.parser.parse(f),A=0;e4t(w,{style:S=>exn(t,S)},(S,T,C)=>{S>A&&x(A,S,""),x(S,T,C),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 TIt(i)});return SIt.set(e.changes,a),a}function bEn(t,e){let{state:r}=t,n=e??r.selection.main.head,i=t.state.field(qu).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)),o=t.state.field(v4);i.fromB!=i.toB&&i.toA<=o.length&&(a+=t.state.lineBreak);let s=bs.of({from:i.fromA,to:Math.min(o.length,i.toA),insert:a},o.length);return t.dispatch({effects:USe.of({doc:s.apply(o),changes:s}),userEvent:"accept"}),!0}function xEn(t,e){let{state:r}=t,n=e??r.selection.main.head,i=r.field(qu).find(s=>s.fromB<=n&&s.endB>=n);if(!i)return!1;let o=r.field(v4).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));return i.fromA!=i.toA&&i.toB<=r.doc.length&&(o+=r.lineBreak),t.dispatch({changes:{from:i.fromB,to:Math.min(r.doc.length,i.toB),insert:o},userEvent:"revert"}),!0}function CIt(t){let e=new Qu;for(let r of t.field(qu)){let n=t.facet(Zh).overrideChunk&&kIt(t,r);e.add(r.fromB,r.fromB,yEn(t,r,!!n))}return e.finish()}const wEn=Ko.define({create:t=>CIt(t),update(t,e){return e.state.field(qu,!1)!=e.startState.field(qu,!1)?CIt(e.state):t},provide:t=>er.decorations.from(t)}),OIt=new WeakMap;function kIt(t,e){let r=OIt.get(e);if(r!==void 0)return r;r=null;let n=t.field(v4),i=t.doc,a=n.lineAt(e.endA).number-n.lineAt(e.fromA).number+1,o=i.lineAt(e.endB).number-i.lineAt(e.fromB).number+1;e:if(a==o&&a<10){let s=[],l=0,u=e.fromA,h=e.fromB;for(let d of e.changes){if(d.fromA=e.endB)break;o=t.doc.lineAt(o.to+1)}return!0}const EIt="(max-width: 760px)";function OEn(){const[t,e]=j.useState(()=>typeof window<"u"&&window.matchMedia(EIt).matches);return j.useEffect(()=>{const r=window.matchMedia(EIt),n=()=>e(r.matches);return n(),r.addEventListener("change",n),()=>r.removeEventListener("change",n)},[]),t}function _It(t,e){return[OSe({lineNumbers:!0,foldGutter:!0,highlightActiveLine:!1,highlightActiveLineGutter:!1,autocompletion:!1}),...YZ(t),ei.readOnly.of(!0),...e==="dark"?[zMt]:[]]}function kEn({before:t,after:e,path:r,theme:n}){const i=j.useRef(null);return j.useEffect(()=>{if(!i.current)return;const a=new pEn({a:{doc:t,extensions:_It(r,n)},b:{doc:e,extensions:_It(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]),H.jsx("div",{ref:i,className:"code-browser-merge"})}function EEn(t){return OEn()?H.jsx(DSe,{value:t.after,height:"100%",theme:t.theme,editable:!1,extensions:[...YZ(t.path),...vEn({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}}):H.jsx(kEn,{...t})}const _En=Object.freeze(Object.defineProperty({__proto__:null,default:EEn},Symbol.toStringTag,{value:"Module"}));class Zt extends Error{constructor(e,r){var n="KaTeX parse error: "+e,i,a,o=r&&r.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var l=s.slice(i,a).replace(/[^]/g,"$&̲"),u;i>15?u="…"+s.slice(i-15,i):u=s.slice(0,i);var h;a+15t.replace(REn,"-$1").toLowerCase(),LEn={"&":"&",">":">","<":"<",'"':""","'":"'"},MEn=/[&><"']/g,uu=t=>String(t).replace(MEn,e=>LEn[e]),tJ=t=>t.type==="ordgroup"||t.type==="color"?t.body.length===1?tJ(t.body[0]):t:t.type==="font"?tJ(t.body):t,IEn=new Set(["mathord","textord","atom"]),R1=t=>IEn.has(tJ(t).type),PEn=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"},rJ={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 NEn(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 BEn(t){if(t.default!==void 0)return t.default;var e=Array.isArray(t.type)?t.type[0]:t.type;return NEn(e)}function $En(t,e,r,n){var i=r[e];t[e]=i!==void 0?n.processor?n.processor(i):i:BEn(n)}class VSe{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(rJ)){var n=rJ[r];n&&$En(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=PEn(e.url);if(r==null)return!1;e.protocol=r}var n=typeof this.trust=="function"?this.trust(e):this.trust;return!!n}}class F2{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 F0[FEn[this.id]]}sub(){return F0[zEn[this.id]]}fracNum(){return F0[UEn[this.id]]}fracDen(){return F0[VEn[this.id]]}cramp(){return F0[QEn[this.id]]}text(){return F0[GEn[this.id]]}isTight(){return this.size>=2}}var QSe=0,nJ=1,y4=2,D1=3,yF=4,Op=5,b4=6,ju=7,F0=[new F2(QSe,0,!1),new F2(nJ,0,!0),new F2(y4,1,!1),new F2(D1,1,!0),new F2(yF,2,!1),new F2(Op,2,!0),new F2(b4,3,!1),new F2(ju,3,!0)],FEn=[yF,Op,yF,Op,b4,ju,b4,ju],zEn=[Op,Op,Op,Op,ju,ju,ju,ju],UEn=[y4,D1,yF,Op,b4,ju,b4,ju],VEn=[D1,D1,Op,Op,ju,ju,ju,ju],QEn=[nJ,nJ,D1,D1,Op,Op,ju,ju],GEn=[QSe,nJ,y4,D1,y4,D1,y4,D1],Nn={DISPLAY:F0[QSe],TEXT:F0[y4],SCRIPT:F0[yF],SCRIPTSCRIPT:F0[b4]},GSe=[{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 HEn(t){for(var e=0;e=i[0]&&t<=i[1])return r.name}return null}var iJ=[];GSe.forEach(t=>t.blocks.forEach(e=>iJ.push(...e)));function RIt(t){for(var e=0;e=iJ[e]&&t<=iJ[e+1])return!0;return!1}var ul=t=>t+" "+t,x4=80,WEn=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 @@ -740,7 +740,7 @@ c5.3,-9.3,12,-14,20,-14 H400000v`+(40+e)+`H845.2724 s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z -M`+(834+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},HEn=function(e,r){return"M263,"+(601+e+r)+`c0.7,0,18,39.7,52,119 +M`+(834+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},YEn=function(e,r){return"M263,"+(601+e+r)+`c0.7,0,18,39.7,52,119 c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 c340,-704.7,510.7,-1060.3,512,-1067 l`+e/2.084+" -"+e+` @@ -750,7 +750,7 @@ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5, c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z -M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},WEn=function(e,r){return"M983 "+(10+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},qEn=function(e,r){return"M983 "+(10+e+r)+` l`+e/3.13+" -"+e+` c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+` H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 @@ -759,7 +759,7 @@ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 c53.7,-170.3,84.5,-266.8,92.5,-289.5z -M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},YEn=function(e,r){return"M424,"+(2398+e+r)+` +M`+(1001+e)+" "+r+"h400000v"+(40+e)+"h-400000z"},jEn=function(e,r){return"M424,"+(2398+e+r)+` c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 @@ -769,18 +769,18 @@ v`+(40+e)+`H1014.6 s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+r+` -h400000v`+(40+e)+"h-400000z"},qEn=function(e,r){return"M473,"+(2713+e+r)+` +h400000v`+(40+e)+"h-400000z"},XEn=function(e,r){return"M473,"+(2713+e+r)+` c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+` c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7 s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, -606zM`+(1001+e)+" "+r+"h400000v"+(40+e)+"H1017.7z"},jEn=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},XEn=function(e,r,n){var i=n-54-r-e;return"M702 "+(e+r)+"H400000"+(40+e)+` +606zM`+(1001+e)+" "+r+"h400000v"+(40+e)+"H1017.7z"},KEn=function(e){var r=e/2;return"M400000 "+e+" H0 L"+r+" 0 l65 45 L145 "+(e-80)+" H400000z"},ZEn=function(e,r,n){var i=n-54-r-e;return"M702 "+(e+r)+"H400000"+(40+e)+` H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 -219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},KEn=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=GEn(r,x4);break;case"sqrtSize1":i=HEn(r,x4);break;case"sqrtSize2":i=WEn(r,x4);break;case"sqrtSize3":i=YEn(r,x4);break;case"sqrtSize4":i=qEn(r,x4);break;case"sqrtTall":i=XEn(r,x4,n)}return i},ZEn=function(e,r){switch(e){case"⎜":return ul("M291 0 H417 V"+r+" H291z");case"∣":return ul("M145 0 H188 V"+r+" H145z");case"∥":return ul("M145 0 H188 V"+r+" H145z")+ul("M367 0 H410 V"+r+" H367z");case"⎟":return ul("M457 0 H583 V"+r+" H457z");case"⎢":return ul("M319 0 H403 V"+r+" H319z");case"⎥":return ul("M263 0 H347 V"+r+" H263z");case"⎪":return ul("M384 0 H504 V"+r+" H384z");case"⏐":return ul("M312 0 H355 V"+r+" H312z");case"‖":return ul("M257 0 H300 V"+r+" H257z")+ul("M478 0 H521 V"+r+" H478z");default:return""}},_It={doubleleftarrow:`M262 157 +219 661 l218 661zM702 `+r+"H400000v"+(40+e)+"H742z"},JEn=function(e,r,n){r=1e3*r;var i="";switch(e){case"sqrtMain":i=WEn(r,x4);break;case"sqrtSize1":i=YEn(r,x4);break;case"sqrtSize2":i=qEn(r,x4);break;case"sqrtSize3":i=jEn(r,x4);break;case"sqrtSize4":i=XEn(r,x4);break;case"sqrtTall":i=ZEn(r,x4,n)}return i},e_n=function(e,r){switch(e){case"⎜":return ul("M291 0 H417 V"+r+" H291z");case"∣":return ul("M145 0 H188 V"+r+" H145z");case"∥":return ul("M145 0 H188 V"+r+" H145z")+ul("M367 0 H410 V"+r+" H367z");case"⎟":return ul("M457 0 H583 V"+r+" H457z");case"⎢":return ul("M319 0 H403 V"+r+" H319z");case"⎥":return ul("M263 0 H347 V"+r+" H263z");case"⎪":return ul("M384 0 H504 V"+r+" H384z");case"⏐":return ul("M312 0 H355 V"+r+" H312z");case"‖":return ul("M257 0 H300 V"+r+" H257z")+ul("M478 0 H521 V"+r+" H478z");default:return""}},DIt={doubleleftarrow:`M262 157 l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 @@ -951,7 +951,7 @@ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z` c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},JEn=function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 v84 h347 v-84 +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},t_n=function(e,r){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 v84 h347 v-84 H403z M403 1759 V0 H319 V1759 v`+r+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v1759 H0 v84 H347z M347 1759 V0 H263 V1759 v`+r+" v1759 h84z";case"vert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15 @@ -979,48 +979,48 @@ 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 e_n(t){return"toText"in t}class w4{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(e_n(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var HSe={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},t_n={ex:!0,em:!0,mu:!0},RIt=function(e){return typeof e!="string"&&(e=e.unit),e in HSe||e in t_n||e==="ex"},Lo=function(e,r){var n;if(e.unit in HSe)n=HSe[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"},z2=function(e){return e.filter(r=>r).join(" ")},WSe=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=_En(n)+":"+i+";")}return r},DIt=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)}},LIt=function(e){var r=document.createElement(e);r.className=z2(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]/,MIt=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+uu(z2(this.classes))+'"');var n=WSe(this.style);n&&(r+=' style="'+uu(n)+'"');for(var i of Object.keys(this.attributes)){if(r_n.test(i))throw new Zt("Invalid attribute name '"+i+"'");r+=" "+i+'="'+uu(this.attributes[i])+'"'}r+=">";for(var a=0;a",r};class A4{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,DIt.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return LIt.call(this,"span")}toMarkup(){return MIt.call(this,"span")}}let aJ=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,DIt.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 LIt.call(this,"a")}toMarkup(){return MIt.call(this,"a")}};class n_n{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=''+uu(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=ir(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=z2(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+=WSe(this.style),n&&(e=!0,r+=' style="'+uu(n)+'"');var i=uu(this.text);return e?(r+=">",r+=i,r+="",r):i}}class L1{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 YSe{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 s_n=t=>t instanceof A4||t instanceof aJ||t instanceof w4,z0={"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]}},oJ={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]},IIt={Å:"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 PIt(t,e){z0[t]=e}function qSe(t,e,r){if(!z0[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=z0[e][n];if(!i&&t[0]in IIt&&(n=IIt[t[0]].charCodeAt(0),i=z0[e][n]),!i&&r==="text"&&EIt(n)&&(i=z0[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var jSe={};function l_n(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!jSe[e]){var r=jSe[e]={cssEmPerMu:oJ.quad[e]/18};for(var n in oJ)oJ.hasOwnProperty(n)&&(r[n]=oJ[n][e])}return jSe[e]}var So={math:{},text:{}};function re(t,e,r,n,i,a){So[t][i]={font:e,group:r,replace:n},a&&n&&(So[t][n]=So[t][i])}var he="math",zt="text",Se="main",qe="ams",To="accent-token",kr="bin",Xu="close",S4="inner",sn="mathord",Qs="op-token",lf="open",bF="punct",Xe="rel",M1="spacing",Je="textord";re(he,Se,Xe,"≡","\\equiv",!0),re(he,Se,Xe,"≺","\\prec",!0),re(he,Se,Xe,"≻","\\succ",!0),re(he,Se,Xe,"∼","\\sim",!0),re(he,Se,Xe,"⊥","\\perp"),re(he,Se,Xe,"⪯","\\preceq",!0),re(he,Se,Xe,"⪰","\\succeq",!0),re(he,Se,Xe,"≃","\\simeq",!0),re(he,Se,Xe,"∣","\\mid",!0),re(he,Se,Xe,"≪","\\ll",!0),re(he,Se,Xe,"≫","\\gg",!0),re(he,Se,Xe,"≍","\\asymp",!0),re(he,Se,Xe,"∥","\\parallel"),re(he,Se,Xe,"⋈","\\bowtie",!0),re(he,Se,Xe,"⌣","\\smile",!0),re(he,Se,Xe,"⊑","\\sqsubseteq",!0),re(he,Se,Xe,"⊒","\\sqsupseteq",!0),re(he,Se,Xe,"≐","\\doteq",!0),re(he,Se,Xe,"⌢","\\frown",!0),re(he,Se,Xe,"∋","\\ni",!0),re(he,Se,Xe,"∝","\\propto",!0),re(he,Se,Xe,"⊢","\\vdash",!0),re(he,Se,Xe,"⊣","\\dashv",!0),re(he,Se,Xe,"∋","\\owns"),re(he,Se,bF,".","\\ldotp"),re(he,Se,bF,"⋅","\\cdotp"),re(he,Se,bF,"⋅","·"),re(zt,Se,Je,"⋅","·"),re(he,Se,Je,"#","\\#"),re(zt,Se,Je,"#","\\#"),re(he,Se,Je,"&","\\&"),re(zt,Se,Je,"&","\\&"),re(he,Se,Je,"ℵ","\\aleph",!0),re(he,Se,Je,"∀","\\forall",!0),re(he,Se,Je,"ℏ","\\hbar",!0),re(he,Se,Je,"∃","\\exists",!0),re(he,Se,Je,"∇","\\nabla",!0),re(he,Se,Je,"♭","\\flat",!0),re(he,Se,Je,"ℓ","\\ell",!0),re(he,Se,Je,"♮","\\natural",!0),re(he,Se,Je,"♣","\\clubsuit",!0),re(he,Se,Je,"℘","\\wp",!0),re(he,Se,Je,"♯","\\sharp",!0),re(he,Se,Je,"♢","\\diamondsuit",!0),re(he,Se,Je,"ℜ","\\Re",!0),re(he,Se,Je,"♡","\\heartsuit",!0),re(he,Se,Je,"ℑ","\\Im",!0),re(he,Se,Je,"♠","\\spadesuit",!0),re(he,Se,Je,"§","\\S",!0),re(zt,Se,Je,"§","\\S"),re(he,Se,Je,"¶","\\P",!0),re(zt,Se,Je,"¶","\\P"),re(he,Se,Je,"†","\\dag"),re(zt,Se,Je,"†","\\dag"),re(zt,Se,Je,"†","\\textdagger"),re(he,Se,Je,"‡","\\ddag"),re(zt,Se,Je,"‡","\\ddag"),re(zt,Se,Je,"‡","\\textdaggerdbl"),re(he,Se,Xu,"⎱","\\rmoustache",!0),re(he,Se,lf,"⎰","\\lmoustache",!0),re(he,Se,Xu,"⟯","\\rgroup",!0),re(he,Se,lf,"⟮","\\lgroup",!0),re(he,Se,kr,"∓","\\mp",!0),re(he,Se,kr,"⊖","\\ominus",!0),re(he,Se,kr,"⊎","\\uplus",!0),re(he,Se,kr,"⊓","\\sqcap",!0),re(he,Se,kr,"∗","\\ast"),re(he,Se,kr,"⊔","\\sqcup",!0),re(he,Se,kr,"◯","\\bigcirc",!0),re(he,Se,kr,"∙","\\bullet",!0),re(he,Se,kr,"‡","\\ddagger"),re(he,Se,kr,"≀","\\wr",!0),re(he,Se,kr,"⨿","\\amalg"),re(he,Se,kr,"&","\\And"),re(he,Se,Xe,"⟵","\\longleftarrow",!0),re(he,Se,Xe,"⇐","\\Leftarrow",!0),re(he,Se,Xe,"⟸","\\Longleftarrow",!0),re(he,Se,Xe,"⟶","\\longrightarrow",!0),re(he,Se,Xe,"⇒","\\Rightarrow",!0),re(he,Se,Xe,"⟹","\\Longrightarrow",!0),re(he,Se,Xe,"↔","\\leftrightarrow",!0),re(he,Se,Xe,"⟷","\\longleftrightarrow",!0),re(he,Se,Xe,"⇔","\\Leftrightarrow",!0),re(he,Se,Xe,"⟺","\\Longleftrightarrow",!0),re(he,Se,Xe,"↦","\\mapsto",!0),re(he,Se,Xe,"⟼","\\longmapsto",!0),re(he,Se,Xe,"↗","\\nearrow",!0),re(he,Se,Xe,"↩","\\hookleftarrow",!0),re(he,Se,Xe,"↪","\\hookrightarrow",!0),re(he,Se,Xe,"↘","\\searrow",!0),re(he,Se,Xe,"↼","\\leftharpoonup",!0),re(he,Se,Xe,"⇀","\\rightharpoonup",!0),re(he,Se,Xe,"↙","\\swarrow",!0),re(he,Se,Xe,"↽","\\leftharpoondown",!0),re(he,Se,Xe,"⇁","\\rightharpoondown",!0),re(he,Se,Xe,"↖","\\nwarrow",!0),re(he,Se,Xe,"⇌","\\rightleftharpoons",!0),re(he,qe,Xe,"≮","\\nless",!0),re(he,qe,Xe,"","\\@nleqslant"),re(he,qe,Xe,"","\\@nleqq"),re(he,qe,Xe,"⪇","\\lneq",!0),re(he,qe,Xe,"≨","\\lneqq",!0),re(he,qe,Xe,"","\\@lvertneqq"),re(he,qe,Xe,"⋦","\\lnsim",!0),re(he,qe,Xe,"⪉","\\lnapprox",!0),re(he,qe,Xe,"⊀","\\nprec",!0),re(he,qe,Xe,"⋠","\\npreceq",!0),re(he,qe,Xe,"⋨","\\precnsim",!0),re(he,qe,Xe,"⪹","\\precnapprox",!0),re(he,qe,Xe,"≁","\\nsim",!0),re(he,qe,Xe,"","\\@nshortmid"),re(he,qe,Xe,"∤","\\nmid",!0),re(he,qe,Xe,"⊬","\\nvdash",!0),re(he,qe,Xe,"⊭","\\nvDash",!0),re(he,qe,Xe,"⋪","\\ntriangleleft"),re(he,qe,Xe,"⋬","\\ntrianglelefteq",!0),re(he,qe,Xe,"⊊","\\subsetneq",!0),re(he,qe,Xe,"","\\@varsubsetneq"),re(he,qe,Xe,"⫋","\\subsetneqq",!0),re(he,qe,Xe,"","\\@varsubsetneqq"),re(he,qe,Xe,"≯","\\ngtr",!0),re(he,qe,Xe,"","\\@ngeqslant"),re(he,qe,Xe,"","\\@ngeqq"),re(he,qe,Xe,"⪈","\\gneq",!0),re(he,qe,Xe,"≩","\\gneqq",!0),re(he,qe,Xe,"","\\@gvertneqq"),re(he,qe,Xe,"⋧","\\gnsim",!0),re(he,qe,Xe,"⪊","\\gnapprox",!0),re(he,qe,Xe,"⊁","\\nsucc",!0),re(he,qe,Xe,"⋡","\\nsucceq",!0),re(he,qe,Xe,"⋩","\\succnsim",!0),re(he,qe,Xe,"⪺","\\succnapprox",!0),re(he,qe,Xe,"≆","\\ncong",!0),re(he,qe,Xe,"","\\@nshortparallel"),re(he,qe,Xe,"∦","\\nparallel",!0),re(he,qe,Xe,"⊯","\\nVDash",!0),re(he,qe,Xe,"⋫","\\ntriangleright"),re(he,qe,Xe,"⋭","\\ntrianglerighteq",!0),re(he,qe,Xe,"","\\@nsupseteqq"),re(he,qe,Xe,"⊋","\\supsetneq",!0),re(he,qe,Xe,"","\\@varsupsetneq"),re(he,qe,Xe,"⫌","\\supsetneqq",!0),re(he,qe,Xe,"","\\@varsupsetneqq"),re(he,qe,Xe,"⊮","\\nVdash",!0),re(he,qe,Xe,"⪵","\\precneqq",!0),re(he,qe,Xe,"⪶","\\succneqq",!0),re(he,qe,Xe,"","\\@nsubseteqq"),re(he,qe,kr,"⊴","\\unlhd"),re(he,qe,kr,"⊵","\\unrhd"),re(he,qe,Xe,"↚","\\nleftarrow",!0),re(he,qe,Xe,"↛","\\nrightarrow",!0),re(he,qe,Xe,"⇍","\\nLeftarrow",!0),re(he,qe,Xe,"⇏","\\nRightarrow",!0),re(he,qe,Xe,"↮","\\nleftrightarrow",!0),re(he,qe,Xe,"⇎","\\nLeftrightarrow",!0),re(he,qe,Xe,"△","\\vartriangle"),re(he,qe,Je,"ℏ","\\hslash"),re(he,qe,Je,"▽","\\triangledown"),re(he,qe,Je,"◊","\\lozenge"),re(he,qe,Je,"Ⓢ","\\circledS"),re(he,qe,Je,"®","\\circledR"),re(zt,qe,Je,"®","\\circledR"),re(he,qe,Je,"∡","\\measuredangle",!0),re(he,qe,Je,"∄","\\nexists"),re(he,qe,Je,"℧","\\mho"),re(he,qe,Je,"Ⅎ","\\Finv",!0),re(he,qe,Je,"⅁","\\Game",!0),re(he,qe,Je,"‵","\\backprime"),re(he,qe,Je,"▲","\\blacktriangle"),re(he,qe,Je,"▼","\\blacktriangledown"),re(he,qe,Je,"■","\\blacksquare"),re(he,qe,Je,"⧫","\\blacklozenge"),re(he,qe,Je,"★","\\bigstar"),re(he,qe,Je,"∢","\\sphericalangle",!0),re(he,qe,Je,"∁","\\complement",!0),re(he,qe,Je,"ð","\\eth",!0),re(zt,Se,Je,"ð","ð"),re(he,qe,Je,"╱","\\diagup"),re(he,qe,Je,"╲","\\diagdown"),re(he,qe,Je,"□","\\square"),re(he,qe,Je,"□","\\Box"),re(he,qe,Je,"◊","\\Diamond"),re(he,qe,Je,"¥","\\yen",!0),re(zt,qe,Je,"¥","\\yen",!0),re(he,qe,Je,"✓","\\checkmark",!0),re(zt,qe,Je,"✓","\\checkmark"),re(he,qe,Je,"ℶ","\\beth",!0),re(he,qe,Je,"ℸ","\\daleth",!0),re(he,qe,Je,"ℷ","\\gimel",!0),re(he,qe,Je,"ϝ","\\digamma",!0),re(he,qe,Je,"ϰ","\\varkappa"),re(he,qe,lf,"┌","\\@ulcorner",!0),re(he,qe,Xu,"┐","\\@urcorner",!0),re(he,qe,lf,"└","\\@llcorner",!0),re(he,qe,Xu,"┘","\\@lrcorner",!0),re(he,qe,Xe,"≦","\\leqq",!0),re(he,qe,Xe,"⩽","\\leqslant",!0),re(he,qe,Xe,"⪕","\\eqslantless",!0),re(he,qe,Xe,"≲","\\lesssim",!0),re(he,qe,Xe,"⪅","\\lessapprox",!0),re(he,qe,Xe,"≊","\\approxeq",!0),re(he,qe,kr,"⋖","\\lessdot"),re(he,qe,Xe,"⋘","\\lll",!0),re(he,qe,Xe,"≶","\\lessgtr",!0),re(he,qe,Xe,"⋚","\\lesseqgtr",!0),re(he,qe,Xe,"⪋","\\lesseqqgtr",!0),re(he,qe,Xe,"≑","\\doteqdot"),re(he,qe,Xe,"≓","\\risingdotseq",!0),re(he,qe,Xe,"≒","\\fallingdotseq",!0),re(he,qe,Xe,"∽","\\backsim",!0),re(he,qe,Xe,"⋍","\\backsimeq",!0),re(he,qe,Xe,"⫅","\\subseteqq",!0),re(he,qe,Xe,"⋐","\\Subset",!0),re(he,qe,Xe,"⊏","\\sqsubset",!0),re(he,qe,Xe,"≼","\\preccurlyeq",!0),re(he,qe,Xe,"⋞","\\curlyeqprec",!0),re(he,qe,Xe,"≾","\\precsim",!0),re(he,qe,Xe,"⪷","\\precapprox",!0),re(he,qe,Xe,"⊲","\\vartriangleleft"),re(he,qe,Xe,"⊴","\\trianglelefteq"),re(he,qe,Xe,"⊨","\\vDash",!0),re(he,qe,Xe,"⊪","\\Vvdash",!0),re(he,qe,Xe,"⌣","\\smallsmile"),re(he,qe,Xe,"⌢","\\smallfrown"),re(he,qe,Xe,"≏","\\bumpeq",!0),re(he,qe,Xe,"≎","\\Bumpeq",!0),re(he,qe,Xe,"≧","\\geqq",!0),re(he,qe,Xe,"⩾","\\geqslant",!0),re(he,qe,Xe,"⪖","\\eqslantgtr",!0),re(he,qe,Xe,"≳","\\gtrsim",!0),re(he,qe,Xe,"⪆","\\gtrapprox",!0),re(he,qe,kr,"⋗","\\gtrdot"),re(he,qe,Xe,"⋙","\\ggg",!0),re(he,qe,Xe,"≷","\\gtrless",!0),re(he,qe,Xe,"⋛","\\gtreqless",!0),re(he,qe,Xe,"⪌","\\gtreqqless",!0),re(he,qe,Xe,"≖","\\eqcirc",!0),re(he,qe,Xe,"≗","\\circeq",!0),re(he,qe,Xe,"≜","\\triangleq",!0),re(he,qe,Xe,"∼","\\thicksim"),re(he,qe,Xe,"≈","\\thickapprox"),re(he,qe,Xe,"⫆","\\supseteqq",!0),re(he,qe,Xe,"⋑","\\Supset",!0),re(he,qe,Xe,"⊐","\\sqsupset",!0),re(he,qe,Xe,"≽","\\succcurlyeq",!0),re(he,qe,Xe,"⋟","\\curlyeqsucc",!0),re(he,qe,Xe,"≿","\\succsim",!0),re(he,qe,Xe,"⪸","\\succapprox",!0),re(he,qe,Xe,"⊳","\\vartriangleright"),re(he,qe,Xe,"⊵","\\trianglerighteq"),re(he,qe,Xe,"⊩","\\Vdash",!0),re(he,qe,Xe,"∣","\\shortmid"),re(he,qe,Xe,"∥","\\shortparallel"),re(he,qe,Xe,"≬","\\between",!0),re(he,qe,Xe,"⋔","\\pitchfork",!0),re(he,qe,Xe,"∝","\\varpropto"),re(he,qe,Xe,"◀","\\blacktriangleleft"),re(he,qe,Xe,"∴","\\therefore",!0),re(he,qe,Xe,"∍","\\backepsilon"),re(he,qe,Xe,"▶","\\blacktriangleright"),re(he,qe,Xe,"∵","\\because",!0),re(he,qe,Xe,"⋘","\\llless"),re(he,qe,Xe,"⋙","\\gggtr"),re(he,qe,kr,"⊲","\\lhd"),re(he,qe,kr,"⊳","\\rhd"),re(he,qe,Xe,"≂","\\eqsim",!0),re(he,Se,Xe,"⋈","\\Join"),re(he,qe,Xe,"≑","\\Doteq",!0),re(he,qe,kr,"∔","\\dotplus",!0),re(he,qe,kr,"∖","\\smallsetminus"),re(he,qe,kr,"⋒","\\Cap",!0),re(he,qe,kr,"⋓","\\Cup",!0),re(he,qe,kr,"⩞","\\doublebarwedge",!0),re(he,qe,kr,"⊟","\\boxminus",!0),re(he,qe,kr,"⊞","\\boxplus",!0),re(he,qe,kr,"⋇","\\divideontimes",!0),re(he,qe,kr,"⋉","\\ltimes",!0),re(he,qe,kr,"⋊","\\rtimes",!0),re(he,qe,kr,"⋋","\\leftthreetimes",!0),re(he,qe,kr,"⋌","\\rightthreetimes",!0),re(he,qe,kr,"⋏","\\curlywedge",!0),re(he,qe,kr,"⋎","\\curlyvee",!0),re(he,qe,kr,"⊝","\\circleddash",!0),re(he,qe,kr,"⊛","\\circledast",!0),re(he,qe,kr,"⋅","\\centerdot"),re(he,qe,kr,"⊺","\\intercal",!0),re(he,qe,kr,"⋒","\\doublecap"),re(he,qe,kr,"⋓","\\doublecup"),re(he,qe,kr,"⊠","\\boxtimes",!0),re(he,qe,Xe,"⇢","\\dashrightarrow",!0),re(he,qe,Xe,"⇠","\\dashleftarrow",!0),re(he,qe,Xe,"⇇","\\leftleftarrows",!0),re(he,qe,Xe,"⇆","\\leftrightarrows",!0),re(he,qe,Xe,"⇚","\\Lleftarrow",!0),re(he,qe,Xe,"↞","\\twoheadleftarrow",!0),re(he,qe,Xe,"↢","\\leftarrowtail",!0),re(he,qe,Xe,"↫","\\looparrowleft",!0),re(he,qe,Xe,"⇋","\\leftrightharpoons",!0),re(he,qe,Xe,"↶","\\curvearrowleft",!0),re(he,qe,Xe,"↺","\\circlearrowleft",!0),re(he,qe,Xe,"↰","\\Lsh",!0),re(he,qe,Xe,"⇈","\\upuparrows",!0),re(he,qe,Xe,"↿","\\upharpoonleft",!0),re(he,qe,Xe,"⇃","\\downharpoonleft",!0),re(he,Se,Xe,"⊶","\\origof",!0),re(he,Se,Xe,"⊷","\\imageof",!0),re(he,qe,Xe,"⊸","\\multimap",!0),re(he,qe,Xe,"↭","\\leftrightsquigarrow",!0),re(he,qe,Xe,"⇉","\\rightrightarrows",!0),re(he,qe,Xe,"⇄","\\rightleftarrows",!0),re(he,qe,Xe,"↠","\\twoheadrightarrow",!0),re(he,qe,Xe,"↣","\\rightarrowtail",!0),re(he,qe,Xe,"↬","\\looparrowright",!0),re(he,qe,Xe,"↷","\\curvearrowright",!0),re(he,qe,Xe,"↻","\\circlearrowright",!0),re(he,qe,Xe,"↱","\\Rsh",!0),re(he,qe,Xe,"⇊","\\downdownarrows",!0),re(he,qe,Xe,"↾","\\upharpoonright",!0),re(he,qe,Xe,"⇂","\\downharpoonright",!0),re(he,qe,Xe,"⇝","\\rightsquigarrow",!0),re(he,qe,Xe,"⇝","\\leadsto"),re(he,qe,Xe,"⇛","\\Rrightarrow",!0),re(he,qe,Xe,"↾","\\restriction"),re(he,Se,Je,"‘","`"),re(he,Se,Je,"$","\\$"),re(zt,Se,Je,"$","\\$"),re(zt,Se,Je,"$","\\textdollar"),re(he,Se,Je,"%","\\%"),re(zt,Se,Je,"%","\\%"),re(he,Se,Je,"_","\\_"),re(zt,Se,Je,"_","\\_"),re(zt,Se,Je,"_","\\textunderscore"),re(he,Se,Je,"∠","\\angle",!0),re(he,Se,Je,"∞","\\infty",!0),re(he,Se,Je,"′","\\prime"),re(he,Se,Je,"△","\\triangle"),re(he,Se,Je,"Γ","\\Gamma",!0),re(he,Se,Je,"Δ","\\Delta",!0),re(he,Se,Je,"Θ","\\Theta",!0),re(he,Se,Je,"Λ","\\Lambda",!0),re(he,Se,Je,"Ξ","\\Xi",!0),re(he,Se,Je,"Π","\\Pi",!0),re(he,Se,Je,"Σ","\\Sigma",!0),re(he,Se,Je,"Υ","\\Upsilon",!0),re(he,Se,Je,"Φ","\\Phi",!0),re(he,Se,Je,"Ψ","\\Psi",!0),re(he,Se,Je,"Ω","\\Omega",!0),re(he,Se,Je,"A","Α"),re(he,Se,Je,"B","Β"),re(he,Se,Je,"E","Ε"),re(he,Se,Je,"Z","Ζ"),re(he,Se,Je,"H","Η"),re(he,Se,Je,"I","Ι"),re(he,Se,Je,"K","Κ"),re(he,Se,Je,"M","Μ"),re(he,Se,Je,"N","Ν"),re(he,Se,Je,"O","Ο"),re(he,Se,Je,"P","Ρ"),re(he,Se,Je,"T","Τ"),re(he,Se,Je,"X","Χ"),re(he,Se,Je,"¬","\\neg",!0),re(he,Se,Je,"¬","\\lnot"),re(he,Se,Je,"⊤","\\top"),re(he,Se,Je,"⊥","\\bot"),re(he,Se,Je,"∅","\\emptyset"),re(he,qe,Je,"∅","\\varnothing"),re(he,Se,sn,"α","\\alpha",!0),re(he,Se,sn,"β","\\beta",!0),re(he,Se,sn,"γ","\\gamma",!0),re(he,Se,sn,"δ","\\delta",!0),re(he,Se,sn,"ϵ","\\epsilon",!0),re(he,Se,sn,"ζ","\\zeta",!0),re(he,Se,sn,"η","\\eta",!0),re(he,Se,sn,"θ","\\theta",!0),re(he,Se,sn,"ι","\\iota",!0),re(he,Se,sn,"κ","\\kappa",!0),re(he,Se,sn,"λ","\\lambda",!0),re(he,Se,sn,"μ","\\mu",!0),re(he,Se,sn,"ν","\\nu",!0),re(he,Se,sn,"ξ","\\xi",!0),re(he,Se,sn,"ο","\\omicron",!0),re(he,Se,sn,"π","\\pi",!0),re(he,Se,sn,"ρ","\\rho",!0),re(he,Se,sn,"σ","\\sigma",!0),re(he,Se,sn,"τ","\\tau",!0),re(he,Se,sn,"υ","\\upsilon",!0),re(he,Se,sn,"ϕ","\\phi",!0),re(he,Se,sn,"χ","\\chi",!0),re(he,Se,sn,"ψ","\\psi",!0),re(he,Se,sn,"ω","\\omega",!0),re(he,Se,sn,"ε","\\varepsilon",!0),re(he,Se,sn,"ϑ","\\vartheta",!0),re(he,Se,sn,"ϖ","\\varpi",!0),re(he,Se,sn,"ϱ","\\varrho",!0),re(he,Se,sn,"ς","\\varsigma",!0),re(he,Se,sn,"φ","\\varphi",!0),re(he,Se,kr,"∗","*",!0),re(he,Se,kr,"+","+"),re(he,Se,kr,"−","-",!0),re(he,Se,kr,"⋅","\\cdot",!0),re(he,Se,kr,"∘","\\circ",!0),re(he,Se,kr,"÷","\\div",!0),re(he,Se,kr,"±","\\pm",!0),re(he,Se,kr,"×","\\times",!0),re(he,Se,kr,"∩","\\cap",!0),re(he,Se,kr,"∪","\\cup",!0),re(he,Se,kr,"∖","\\setminus",!0),re(he,Se,kr,"∧","\\land"),re(he,Se,kr,"∨","\\lor"),re(he,Se,kr,"∧","\\wedge",!0),re(he,Se,kr,"∨","\\vee",!0),re(he,Se,Je,"√","\\surd"),re(he,Se,lf,"⟨","\\langle",!0),re(he,Se,lf,"∣","\\lvert"),re(he,Se,lf,"∥","\\lVert"),re(he,Se,Xu,"?","?"),re(he,Se,Xu,"!","!"),re(he,Se,Xu,"⟩","\\rangle",!0),re(he,Se,Xu,"∣","\\rvert"),re(he,Se,Xu,"∥","\\rVert"),re(he,Se,Xe,"=","="),re(he,Se,Xe,":",":"),re(he,Se,Xe,"≈","\\approx",!0),re(he,Se,Xe,"≅","\\cong",!0),re(he,Se,Xe,"≥","\\ge"),re(he,Se,Xe,"≥","\\geq",!0),re(he,Se,Xe,"←","\\gets"),re(he,Se,Xe,">","\\gt",!0),re(he,Se,Xe,"∈","\\in",!0),re(he,Se,Xe,"","\\@not"),re(he,Se,Xe,"⊂","\\subset",!0),re(he,Se,Xe,"⊃","\\supset",!0),re(he,Se,Xe,"⊆","\\subseteq",!0),re(he,Se,Xe,"⊇","\\supseteq",!0),re(he,qe,Xe,"⊈","\\nsubseteq",!0),re(he,qe,Xe,"⊉","\\nsupseteq",!0),re(he,Se,Xe,"⊨","\\models"),re(he,Se,Xe,"←","\\leftarrow",!0),re(he,Se,Xe,"≤","\\le"),re(he,Se,Xe,"≤","\\leq",!0),re(he,Se,Xe,"<","\\lt",!0),re(he,Se,Xe,"→","\\rightarrow",!0),re(he,Se,Xe,"→","\\to"),re(he,qe,Xe,"≱","\\ngeq",!0),re(he,qe,Xe,"≰","\\nleq",!0),re(he,Se,M1," ","\\ "),re(he,Se,M1," ","\\space"),re(he,Se,M1," ","\\nobreakspace"),re(zt,Se,M1," ","\\ "),re(zt,Se,M1," "," "),re(zt,Se,M1," ","\\space"),re(zt,Se,M1," ","\\nobreakspace"),re(he,Se,M1,"","\\nobreak"),re(he,Se,M1,"","\\allowbreak"),re(he,Se,bF,",",","),re(he,Se,bF,";",";"),re(he,qe,kr,"⊼","\\barwedge",!0),re(he,qe,kr,"⊻","\\veebar",!0),re(he,Se,kr,"⊙","\\odot",!0),re(he,Se,kr,"⊕","\\oplus",!0),re(he,Se,kr,"⊗","\\otimes",!0),re(he,Se,Je,"∂","\\partial",!0),re(he,Se,kr,"⊘","\\oslash",!0),re(he,qe,kr,"⊚","\\circledcirc",!0),re(he,qe,kr,"⊡","\\boxdot",!0),re(he,Se,kr,"△","\\bigtriangleup"),re(he,Se,kr,"▽","\\bigtriangledown"),re(he,Se,kr,"†","\\dagger"),re(he,Se,kr,"⋄","\\diamond"),re(he,Se,kr,"⋆","\\star"),re(he,Se,kr,"◃","\\triangleleft"),re(he,Se,kr,"▹","\\triangleright"),re(he,Se,lf,"{","\\{"),re(zt,Se,Je,"{","\\{"),re(zt,Se,Je,"{","\\textbraceleft"),re(he,Se,Xu,"}","\\}"),re(zt,Se,Je,"}","\\}"),re(zt,Se,Je,"}","\\textbraceright"),re(he,Se,lf,"{","\\lbrace"),re(he,Se,Xu,"}","\\rbrace"),re(he,Se,lf,"[","\\lbrack",!0),re(zt,Se,Je,"[","\\lbrack",!0),re(he,Se,Xu,"]","\\rbrack",!0),re(zt,Se,Je,"]","\\rbrack",!0),re(he,Se,lf,"(","\\lparen",!0),re(he,Se,Xu,")","\\rparen",!0),re(zt,Se,Je,"<","\\textless",!0),re(zt,Se,Je,">","\\textgreater",!0),re(he,Se,lf,"⌊","\\lfloor",!0),re(he,Se,Xu,"⌋","\\rfloor",!0),re(he,Se,lf,"⌈","\\lceil",!0),re(he,Se,Xu,"⌉","\\rceil",!0),re(he,Se,Je,"\\","\\backslash"),re(he,Se,Je,"∣","|"),re(he,Se,Je,"∣","\\vert"),re(zt,Se,Je,"|","\\textbar",!0),re(he,Se,Je,"∥","\\|"),re(he,Se,Je,"∥","\\Vert"),re(zt,Se,Je,"∥","\\textbardbl"),re(zt,Se,Je,"~","\\textasciitilde"),re(zt,Se,Je,"\\","\\textbackslash"),re(zt,Se,Je,"^","\\textasciicircum"),re(he,Se,Xe,"↑","\\uparrow",!0),re(he,Se,Xe,"⇑","\\Uparrow",!0),re(he,Se,Xe,"↓","\\downarrow",!0),re(he,Se,Xe,"⇓","\\Downarrow",!0),re(he,Se,Xe,"↕","\\updownarrow",!0),re(he,Se,Xe,"⇕","\\Updownarrow",!0),re(he,Se,Qs,"∐","\\coprod"),re(he,Se,Qs,"⋁","\\bigvee"),re(he,Se,Qs,"⋀","\\bigwedge"),re(he,Se,Qs,"⨄","\\biguplus"),re(he,Se,Qs,"⋂","\\bigcap"),re(he,Se,Qs,"⋃","\\bigcup"),re(he,Se,Qs,"∫","\\int"),re(he,Se,Qs,"∫","\\intop"),re(he,Se,Qs,"∬","\\iint"),re(he,Se,Qs,"∭","\\iiint"),re(he,Se,Qs,"∏","\\prod"),re(he,Se,Qs,"∑","\\sum"),re(he,Se,Qs,"⨂","\\bigotimes"),re(he,Se,Qs,"⨁","\\bigoplus"),re(he,Se,Qs,"⨀","\\bigodot"),re(he,Se,Qs,"∮","\\oint"),re(he,Se,Qs,"∯","\\oiint"),re(he,Se,Qs,"∰","\\oiiint"),re(he,Se,Qs,"⨆","\\bigsqcup"),re(he,Se,Qs,"∫","\\smallint"),re(zt,Se,S4,"…","\\textellipsis"),re(he,Se,S4,"…","\\mathellipsis"),re(zt,Se,S4,"…","\\ldots",!0),re(he,Se,S4,"…","\\ldots",!0),re(he,Se,S4,"⋯","\\@cdots",!0),re(he,Se,S4,"⋱","\\ddots",!0),re(he,Se,Je,"⋮","\\varvdots"),re(zt,Se,Je,"⋮","\\varvdots"),re(he,Se,To,"ˊ","\\acute"),re(he,Se,To,"ˋ","\\grave"),re(he,Se,To,"¨","\\ddot"),re(he,Se,To,"~","\\tilde"),re(he,Se,To,"ˉ","\\bar"),re(he,Se,To,"˘","\\breve"),re(he,Se,To,"ˇ","\\check"),re(he,Se,To,"^","\\hat"),re(he,Se,To,"⃗","\\vec"),re(he,Se,To,"˙","\\dot"),re(he,Se,To,"˚","\\mathring"),re(he,Se,sn,"","\\@imath"),re(he,Se,sn,"","\\@jmath"),re(he,Se,Je,"ı","ı"),re(he,Se,Je,"ȷ","ȷ"),re(zt,Se,Je,"ı","\\i",!0),re(zt,Se,Je,"ȷ","\\j",!0),re(zt,Se,Je,"ß","\\ss",!0),re(zt,Se,Je,"æ","\\ae",!0),re(zt,Se,Je,"œ","\\oe",!0),re(zt,Se,Je,"ø","\\o",!0),re(zt,Se,Je,"Æ","\\AE",!0),re(zt,Se,Je,"Œ","\\OE",!0),re(zt,Se,Je,"Ø","\\O",!0),re(zt,Se,To,"ˊ","\\'"),re(zt,Se,To,"ˋ","\\`"),re(zt,Se,To,"ˆ","\\^"),re(zt,Se,To,"˜","\\~"),re(zt,Se,To,"ˉ","\\="),re(zt,Se,To,"˘","\\u"),re(zt,Se,To,"˙","\\."),re(zt,Se,To,"¸","\\c"),re(zt,Se,To,"˚","\\r"),re(zt,Se,To,"ˇ","\\v"),re(zt,Se,To,"¨",'\\"'),re(zt,Se,To,"˝","\\H"),re(zt,Se,To,"◯","\\textcircled");var NIt={"--":!0,"---":!0,"``":!0,"''":!0};re(zt,Se,Je,"–","--",!0),re(zt,Se,Je,"–","\\textendash"),re(zt,Se,Je,"—","---",!0),re(zt,Se,Je,"—","\\textemdash"),re(zt,Se,Je,"‘","`",!0),re(zt,Se,Je,"‘","\\textquoteleft"),re(zt,Se,Je,"’","'",!0),re(zt,Se,Je,"’","\\textquoteright"),re(zt,Se,Je,"“","``",!0),re(zt,Se,Je,"“","\\textquotedblleft"),re(zt,Se,Je,"”","''",!0),re(zt,Se,Je,"”","\\textquotedblright"),re(he,Se,Je,"°","\\degree",!0),re(zt,Se,Je,"°","\\degree"),re(zt,Se,Je,"°","\\textdegree",!0),re(he,Se,Je,"£","\\pounds"),re(he,Se,Je,"£","\\mathsterling",!0),re(zt,Se,Je,"£","\\pounds"),re(zt,Se,Je,"£","\\textsterling",!0),re(he,qe,Je,"✠","\\maltese"),re(zt,qe,Je,"✠","\\maltese");for(var BIt='0123456789/@."',XSe=0;XSe{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 YIt[i]}else if(120782<=n&&n<=120831){var a=Math.floor((n-120782)/10);return u_n[a]}else{if(n===120485||n===120486)return YIt[0];if(120486{if(z2(t.classes)!==z2(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},qIt=t=>{for(var e=0;er&&(r=o.height),o.depth>n&&(n=o.depth),o.maxFontSize>i&&(i=o.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},Yt=function(e,r,n,i){var a=new A4(e,r,n,i);return oTe(a),a},Q2=(t,e,r,n)=>new A4(t,e,r,n),T4=function(e,r,n){var i=Yt([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=ir(i.height),i.maxFontSize=1,i},p_n=function(e,r,n,i){var a=new aJ(e,r,n,i);return oTe(a),a},I1=function(e){var r=new w4(e);return oTe(r),r},C4=function(e,r){return e instanceof w4?Yt([],[e],r):e},g_n=function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,a=i,o=1;o{var r=Yt(["mspace"],[],e),n=Lo(t,e);return r.style.marginRight=ir(n),r},dJ=(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},sTe={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"}},XIt={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},KIt=function(e,r){var[n,i,a]=XIt[e],o=new U2(n),s=new L1([o],{width:ir(i),height:ir(a),style:"width:"+ir(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=Q2(["overlay"],[s],r);return l.height=a,l.style.height=ir(a),l.style.width=ir(i),l},Mo={number:3,unit:"mu"},kC={number:4,unit:"mu"},P1={number:5,unit:"mu"},m_n={mord:{mop:Mo,mbin:kC,mrel:P1,minner:Mo},mop:{mord:Mo,mop:Mo,mrel:P1,minner:Mo},mbin:{mord:kC,mop:kC,mopen:kC,minner:kC},mrel:{mord:P1,mop:P1,mopen:P1,minner:P1},mopen:{},mclose:{mop:Mo,mbin:kC,mrel:P1,minner:Mo},mpunct:{mord:Mo,mop:Mo,mrel:P1,mopen:Mo,mclose:Mo,mpunct:Mo,minner:Mo},minner:{mord:Mo,mop:Mo,mbin:kC,mrel:P1,mopen:Mo,mpunct:Mo,minner:Mo}},v_n={mord:{mop:Mo},mop:{mord:Mo,mop:Mo},mbin:{},mrel:{},mopen:{},mclose:{mop:Mo},mpunct:{},minner:{mop:Mo}},ZIt={},fJ={},pJ={};function xr(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:o}=t,s={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"&&b_n.has(y)?m.classes[0]="mord":y==="mbin"&&y_n.has(v)&&(g.classes[0]="mord")},{node:d},f,p),lTe(a,(g,m)=>{var v,y,b=uTe(m),x=uTe(g),w=b&&x?g.hasClass("mtight")?(v=v_n[b])==null?void 0:v[x]:(y=m_n[b])==null?void 0:y[x]:null;if(w)return jIt(w,u)},{node:d},f,p),a},lTe=function(e,r,n,i,a){i&&e.push(i);for(var o=0;of=>{e.splice(d+1,0,f),o++})(o)}i&&e.pop()},JIt=function(e){return e instanceof w4||e instanceof aJ||e instanceof A4&&e.hasClass("enclosing")?e:null},cTe=function(e,r){var n=JIt(e);if(n){var i=n.children;if(i.length){if(r==="right")return cTe(i[i.length-1],"right");if(r==="left")return cTe(i[0],"left")}}return e},uTe=function(e,r){if(!e)return null;r&&(e=cTe(e,r));var n=e.classes[0];return w_n[n]||null},xF=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Yt(r.concat(n))},Ji=function(e,r,n){if(!e)return Yt();if(fJ[e.type]){var i=fJ[e.type](e,r);if(n&&r.size!==n.size){i=Yt(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 mJ(t,e){var r=Yt(["base"],t,e),n=Yt(["strut"]);return n.style.height=ir(r.height+r.depth),r.depth&&(n.style.verticalAlign=ir(-r.depth)),r.children.unshift(n),r}function hTe(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=hl(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],o=[],s=0;s0&&(a.push(mJ(o,e)),o=[]),a.push(n[s]));o.length>0&&a.push(mJ(o,e));var u;r?(u=mJ(hl(r,e,!0),e),u.classes=["tag"],a.push(u)):i&&a.push(i);var h=Yt(["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 ePt(t){return new w4(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=z2(this.classes));for(var n=0;n0&&(e+=' class ="'+uu(z2(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Hs{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return uu(this.toText())}toText(){return this.text}}class tPt{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 A_n=new Set(["\\imath","\\jmath"]),S_n=new Set(["mrow","mtable"]),kp=function(e,r,n){return So[r][e]&&So[r][e].replace&&e.charCodeAt(0)!==55349&&!(NIt.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=So[r][e].replace),new Hs(e)},dTe=function(e){return e.length===1?e[0]:new tr("mrow",e)},T_n={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"},fTe=(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=T_n[r];if(i)return typeof i=="function"?i(t):i;var a=t.text;if(A_n.has(a))return null;if(So[n][a]){var o=So[n][a].replace;o&&(a=o)}var s=sTe[r].fontName;return qSe(a,s,n)?sTe[r].variant:null};function pTe(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Hs&&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 Hs&&r.text===","}else return!1}var cf=function(e,r,n){if(e.length===1){var i=La(e[0],r);return n&&i instanceof tr&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],o,s=0;s=1&&(o.type==="mn"||pTe(o))){var u=l.children[0];u instanceof tr&&u.type==="mn"&&(u.children=[...o.children,...u.children],a.pop())}else if(o.type==="mi"&&o.children.length===1){var h=o.children[0];if(h instanceof Hs&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof Hs&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),o=l}return a},G2=function(e,r,n){return dTe(cf(e,r,n))},La=function(e,r){if(!e)return new tr("mrow");if(pJ[e.type])return pJ[e.type](e,r);throw new Zt("Got group of unknown type: '"+e.type+"'")};function rPt(t,e,r,n,i){var a=cf(t,r),o;a.length===1&&a[0]instanceof tr&&S_n.has(a[0].type)?o=a[0]:o=new tr("mrow",a);var s=new tr("annotation",[new Hs(e)]);s.setAttribute("encoding","application/x-tex");var l=new tr("semantics",[o,s]),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 Yt([h],[u])}var C_n=[[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]],nPt=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],iPt=function(e,r){return r.size<2?e:C_n[e-1][r.size-1]};class N1{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||N1.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=nPt[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 N1(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:iPt(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:nPt[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=iPt(N1.BASESIZE,e);return this.size===r&&this.textSize===N1.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!==N1.BASESIZE?["sizing","reset-size"+this.size,"size"+N1.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=l_n(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}N1.BASESIZE=6;var aPt=function(e){return new N1({style:e.displayMode?Nn.DISPLAY:Nn.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},oPt=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=Yt(n,[e])}return e},O_n=function(e,r,n){var i=aPt(n),a;if(n.output==="mathml")return rPt(e,r,i,n.displayMode,!0);if(n.output==="html"){var o=hTe(e,i);a=Yt(["katex"],[o])}else{var s=rPt(e,r,i,n.displayMode,!1),l=hTe(e,i);a=Yt(["katex"],[s,l])}return oPt(a,n)},k_n=function(e,r,n){var i=aPt(n),a=hTe(e,i),o=Yt(["katex"],[a]);return oPt(o,n)},E_n={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":"="},vJ=function(e){var r=new tr("mo",[new Hs(E_n[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},__n={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]},R_n=new Set(["widehat","widecheck","widetilde","utilde"]),yJ=function(e,r){function n(){var s=4e5,l=e.label.slice(1);if(R_n.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,s=2364,f=.42,d=l+"4"):(h=312,s=2340,f=.34,d="tilde4");else{var p=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(s=[0,1062,2364,2364,2364][p],h=[0,239,300,360,420][p],f=[0,.24,.3,.3,.36,.42][p],d=l+p):(s=[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 U2(d),m=new L1([g],{width:"100%",height:ir(f),viewBox:"0 0 "+s+" "+h,preserveAspectRatio:"none"});return{span:Q2([],[m],r),minWidth:0,height:f}}else{var v=[],y=__n[l];if(!y)throw new Error('No SVG data for "'+l+'".');var[b,x,w]=y,A=w/1e3,S=b.length,T,C;if(S===1){if(y.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');T=["hide-tail"],C=[y[3]]}else if(S===2)T=["halfarrow-left","halfarrow-right"],C=["xMinYMin","xMaxYMin"];else if(S===3)T=["brace-left","brace-center","brace-right"],C=["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},D_n=function(e,r,n,i,a){var o,s=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(o=Yt(["stretchy",r],[],a),r==="fbox"){var l=a.color&&a.getColor();l&&(o.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new YSe({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new YSe({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new L1(u,{width:"100%",height:ir(s)});o=Q2([],[h],a)}return o.height=s,o.style.height=ir(s),o},L_n={bin:1,close:1,inner:1,open:1,punct:1,rel:1},M_n={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function I_n(t){return t in L_n}function jn(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 bJ(t){var e=xJ(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 xJ(t){return t&&(t.type==="atom"||M_n.hasOwnProperty(t.type))?t:null}var sPt=t=>{if(t instanceof sf)return t;if(s_n(t)&&t.children.length===1)return sPt(t.children[0])},gTe=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=jn(t.base,"accent"),r=n.base,t.base=r,i=o_n(Ji(t,e)),t.base=n):(n=jn(t,"accent"),r=n.base);var a=Ji(r,e.havingCrampedStyle()),o=n.isShifty&&R1(r),s=0;if(o){var l,u;s=(l=(u=sPt(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=yJ(n,e),f=Zi({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:s>0?{width:"calc(100% - "+ir(2*s)+")",marginLeft:ir(2*s)}:void 0}]});else{var p,g;n.label==="\\vec"?(p=KIt("vec",e),g=XIt.vec[1]):(p=hJ({mode:n.mode,text:n.label},e,"textord"),p=a_n(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=Yt(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=a.height);var v=s;m||(v-=g/2),f.style.left=ir(v),n.label==="\\textcircled"&&(f.style.top=".2em"),f=Zi({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:f}]})}var y=Yt(["mord","accent"],[f],e);return i?(i.children[0]=y,i.height=Math.max(y.height,i.height),i.classes[0]="mord",i):y},lPt=(t,e)=>{var r=t.isStretchy?vJ(t.label):new tr("mo",[kp(t.label,t.mode)]),n=new tr("mover",[La(t.base,e),r]);return n.setAttribute("accent","true"),n},P_n=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=gJ(e[0]),n=!P_n.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:gTe,mathmlBuilder:lPt}),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:gTe,mathmlBuilder:lPt}),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=Ji(t.base,e),n=yJ(t,e),i=t.label==="\\utilde"?.12:0,a=Zi({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return Yt(["mord","accentunder"],[a],e)},mathmlBuilder:(t,e)=>{var r=vJ(t.label),n=new tr("munder",[La(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var wJ=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=C4(Ji(t.body,n,e),e),a=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var o;t.below&&(n=e.havingStyle(r.sub()),o=C4(Ji(t.below,n,e),e),o.classes.push(a+"-arrow-pad"));var s=yJ(t,e),l=-e.fontMetrics().axisHeight+.5*s.height,u=-e.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(u-=i.depth);var h;if(o){var d=-e.fontMetrics().axisHeight+o.height+.5*s.height+.111;h=Zi({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:s,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:o,shift:d}]})}else h=Zi({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:s,shift:l,wrapperClasses:["svg-align"]}]});return Yt(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=vJ(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=wJ(La(t.body,e));if(t.below){var a=wJ(La(t.below,e));n=new tr("munderover",[r,a,i])}else n=new tr("mover",[r,i])}else if(t.below){var o=wJ(La(t.below,e));n=new tr("munder",[r,o])}else n=wJ(),n=new tr("mover",[r,n]);return n}});function cPt(t,e){var r=hl(t.body,e,!0);return Yt([t.mclass],r,e)}function uPt(t,e){var r,n=cf(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:Gs(i),isCharacterBox:R1(i)}},htmlBuilder:cPt,mathmlBuilder:uPt});var AJ=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:AJ(e[0]),body:Gs(e[1]),isCharacterBox:R1(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],o;n!=="\\stackrel"?o=AJ(i):o="mrel";var s={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Gs(i)},l={type:"supsub",mode:a.mode,base:s,sup:n==="\\underset"?null:a,sub:n==="\\underset"?a:null};return{type:"mclass",mode:r.mode,mclass:o,body:[l],isCharacterBox:R1(l)}},htmlBuilder:cPt,mathmlBuilder:uPt}),xr({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:AJ(e[0]),body:Gs(e[0])}},htmlBuilder(t,e){var r=hl(t.body,e,!0),n=Yt([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=cf(t.body,e),n=new tr("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var N_n={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},hPt=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),dPt=t=>t.type==="textord"&&t.text==="@",B_n=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function $_n(t,e,r){var n=N_n[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"},o=r.callFunction("\\Big",[a],[]),s=r.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,o,s]};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 F_n(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 @',o[l]);var g=$_n(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),s=hPt()}a%2===0?n.push(s):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=C4(Ji(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",[La(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=C4(Ji(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new tr("mrow",[La(t.fragment,e)])}}),xr({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=jn(e[0],"ordgroup"),i=n.body,a="",o=0;o=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 fPt=(t,e)=>{var r=hl(t.body,e.withColor(t.color),!1);return I1(r)},pPt=(t,e)=>{var r=cf(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=jn(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:Gs(i)}},htmlBuilder:fPt,mathmlBuilder:pPt}),xr({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=jn(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:fPt,mathmlBuilder:pPt}),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&&jn(i,"size").value}},htmlBuilder(t,e){var r=Yt(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=ir(Lo(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(Lo(t.size,e)))),r}});var mTe={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},gPt=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Zt("Expected a control sequence",t);return e},z_n=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},mPt=(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(mTe[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=mTe[n.text]),jn(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,o,s=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){o=e.gullet.future(),s[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++,s.push([])}else{if(n.text==="EOF")throw new Zt("Expected a macro definition");s[a].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return o&&l.unshift(o),(r==="\\edef"||r==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:a,delimiters:s},r===mTe[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=gPt(e.gullet.popToken());e.gullet.consumeSpaces();var i=z_n(e);return mPt(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=gPt(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return mPt(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var wF=function(e,r,n){var i=So.math[e]&&So.math[e].replace,a=qSe(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},vTe=function(e,r,n,i){var a=n.havingBaseStyle(r),o=Yt(i.concat(a.sizingClasses(n)),[e],n),s=a.sizeMultiplier/n.sizeMultiplier;return o.height*=s,o.depth*=s,o.maxFontSize=a.sizeMultiplier,o},vPt=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},U_n=function(e,r,n,i,a,o){var s=Zu(e,"Main-Regular",a,i),l=vTe(s,r,i,o);return vPt(l,i,r),l},V_n=function(e,r,n,i){return Zu(e,"Size"+r+"-Regular",n,i)},yPt=function(e,r,n,i,a,o){var s=V_n(e,r,a,i),l=vTe(Yt(["delimsizing","size"+r],[s],i),Nn.TEXT,i,o);return n&&vPt(l,i,Nn.TEXT),l},yTe=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Yt(["delimsizinginner",i],[Yt([],[Zu(e,r,n)])]);return{type:"elem",elem:a}},bTe=function(e,r,n){var i=z0["Size4-Regular"][e.charCodeAt(0)]?z0["Size4-Regular"][e.charCodeAt(0)][4]:z0["Size1-Regular"][e.charCodeAt(0)][4],a=new U2("inner",ZEn(e,Math.round(1e3*r))),o=new L1([a],{width:ir(i),height:ir(r),style:"width:"+ir(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),s=Q2([],[o],n);return s.height=r,s.style.height=ir(r),s.style.width=ir(i),{type:"elem",elem:s}},xTe=.008,SJ={type:"kern",size:-1*xTe},Q_n=new Set(["|","\\lvert","\\rvert","\\vert"]),G_n=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),bPt=function(e,r,n,i,a,o){var s,l,u,h,d="",f=0;s=u=h=e,l=null;var p="Size1-Regular";e==="\\uparrow"?u=h="⏐":e==="\\Uparrow"?u=h="‖":e==="\\downarrow"?s=u="⏐":e==="\\Downarrow"?s=u="‖":e==="\\updownarrow"?(s="\\uparrow",u="⏐",h="\\downarrow"):e==="\\Updownarrow"?(s="\\Uparrow",u="‖",h="\\Downarrow"):Q_n.has(e)?(u="∣",d="vert",f=333):G_n.has(e)?(u="∥",d="doublevert",f=556):e==="["||e==="\\lbrack"?(s="⎡",u="⎢",h="⎣",p="Size4-Regular",d="lbrack",f=667):e==="]"||e==="\\rbrack"?(s="⎤",u="⎥",h="⎦",p="Size4-Regular",d="rbrack",f=667):e==="\\lfloor"||e==="⌊"?(u=s="⎢",h="⎣",p="Size4-Regular",d="lfloor",f=667):e==="\\lceil"||e==="⌈"?(s="⎡",u=h="⎢",p="Size4-Regular",d="lceil",f=667):e==="\\rfloor"||e==="⌋"?(u=s="⎥",h="⎦",p="Size4-Regular",d="rfloor",f=667):e==="\\rceil"||e==="⌉"?(s="⎤",u=h="⎥",p="Size4-Regular",d="rceil",f=667):e==="("||e==="\\lparen"?(s="⎛",u="⎜",h="⎝",p="Size4-Regular",d="lparen",f=875):e===")"||e==="\\rparen"?(s="⎞",u="⎟",h="⎠",p="Size4-Regular",d="rparen",f=875):e==="\\{"||e==="\\lbrace"?(s="⎧",l="⎨",h="⎩",u="⎪",p="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(s="⎫",l="⎬",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(s="⎧",h="⎩",u="⎪",p="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(s="⎫",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(s="⎧",h="⎭",u="⎪",p="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(s="⎫",h="⎩",u="⎪",p="Size4-Regular");var g=wF(s,p,a),m=g.height+g.depth,v=wF(u,p,a),y=v.height+v.depth,b=wF(h,p,a),x=b.height+b.depth,w=0,A=1;if(l!==null){var S=wF(l,p,a);w=S.height+S.depth,A=2}var T=m+x+w,C=Math.max(0,Math.ceil((r-T)/(A*y))),k=T+C*A*y,E=i.fontMetrics().axisHeight;n&&(E*=i.sizeMultiplier);var _=k/2-E,P=[];if(d.length>0){var L=k-m-x,R=Math.round(k*1e3),D=JEn(d,Math.round(L*1e3)),M=new U2(d,D),I=ir(f/1e3),N=ir(R/1e3),F=new L1([M],{width:I,height:N,viewBox:"0 0 "+f+" "+R}),B=Q2([],[F],i);B.height=R/1e3,B.style.width=I,B.style.height=N,P.push({type:"elem",elem:B})}else{if(P.push(yTe(h,p,a)),P.push(SJ),l===null){var V=k-m-x+2*xTe;P.push(bTe(u,V,i))}else{var z=(k-m-x-w)/2+2*xTe;P.push(bTe(u,z,i)),P.push(SJ),P.push(yTe(l,p,a)),P.push(SJ),P.push(bTe(u,z,i))}P.push(SJ),P.push(yTe(s,p,a))}var U=i.havingBaseStyle(Nn.TEXT),Q=Zi({positionType:"bottom",positionData:_,children:P});return vTe(Yt(["delimsizing","mult"],[Q],U),Nn.TEXT,i,o)},wTe=80,ATe=.08,STe=function(e,r,n,i,a){var o=KEn(e,i,n),s=new U2(e,o),l=new L1([s],{width:"400em",height:ir(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Q2(["hide-tail"],[l],a)},H_n=function(e,r){var n=r.havingBaseSizing(),i=TPt("\\surd",e*n.sizeMultiplier,SPt,n),a=n.sizeMultiplier,o=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),s,l,u,h,d;return i.type==="small"?(h=1e3+1e3*o+wTe,e<1?a=1:e<1.4&&(a=.7),l=(1+o+ATe)/a,u=(1+o)/a,s=STe("sqrtMain",l,h,o,r),s.style.minWidth="0.853em",d=.833/a):i.type==="large"?(h=(1e3+wTe)*AF[i.size],u=(AF[i.size]+o)/a,l=(AF[i.size]+o+ATe)/a,s=STe("sqrtSize"+i.size,l,h,o,r),s.style.minWidth="1.02em",d=1/a):(l=e+o+ATe,u=e+o,h=Math.floor(1e3*e+o)+wTe,s=STe("sqrtTall",l,h,o,r),s.style.minWidth="0.742em",d=1.056),s.height=u,s.style.height=ir(l),{span:s,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+o)*a}},xPt=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),W_n=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),wPt=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),AF=[0,1.2,1.8,2.4,3],APt=function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),xPt.has(e)||wPt.has(e))return yPt(e,r,!1,n,i,a);if(W_n.has(e))return bPt(e,AF[r],!1,n,i,a);throw new Zt("Illegal delimiter: '"+e+"'")},Y_n=[{type:"small",style:Nn.SCRIPTSCRIPT},{type:"small",style:Nn.SCRIPT},{type:"small",style:Nn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],q_n=[{type:"small",style:Nn.SCRIPTSCRIPT},{type:"small",style:Nn.SCRIPT},{type:"small",style:Nn.TEXT},{type:"stack"}],SPt=[{type:"small",style:Nn.SCRIPTSCRIPT},{type:"small",style:Nn.SCRIPT},{type:"small",style:Nn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],j_n=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.")},TPt=function(e,r,n,i){for(var a=Math.min(2,3-i.style.size),o=a;or)return s}return n[n.length-1]},TTe=function(e,r,n,i,a,o){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var s;wPt.has(e)?s=Y_n:xPt.has(e)?s=SPt:s=q_n;var l=TPt(e,r,s,i);return l.type==="small"?U_n(e,l.style,n,i,a,o):l.type==="large"?yPt(e,l.size,n,i,a,o):bPt(e,r,n,i,a,o)},CTe=function(e,r,n,i,a,o){var s=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,h=Math.max(r-s,n+s),d=Math.max(h/500*l,2*h-u);return TTe(e,d,!0,i,a,o)},CPt={"\\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}},X_n=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 OPt(t){return"isMiddle"in t}function TJ(t,e){var r=xJ(t);if(r&&X_n.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=TJ(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:CPt[t.funcName].size,mclass:CPt[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?Yt([t.mclass]):APt(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(kp(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(AF[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function kPt(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:TJ(e[0],t).text,color:r}}}),xr({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=TJ(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=jn(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},htmlBuilder:(t,e)=>{kPt(t);for(var r=hl(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,o=0;o{kPt(t);var r=cf(t.body,e);if(t.left!=="."){var n=new tr("mo",[kp(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new tr("mo",[kp(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return dTe(r)}}),xr({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=TJ(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=xF(e,[]):(r=APt(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?kp("|","text"):kp(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 CJ=(t,e)=>{var r=C4(Ji(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,o,s=R1(t.body);if(n==="sout")a=Yt(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,o=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=Lo({number:.6,unit:"pt"},e),u=Lo({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=jEn(f),g=new L1([new U2("phase",p)],{width:"400em",height:ir(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=Q2(["hide-tail"],[g],e),a.style.height=ir(d),o=r.depth+l+u}else{/cancel/.test(n)?s||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=s?.2:0,v=m),a=D_n(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)),o=r.depth+v,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var b;if(t.backgroundColor)b=Zi({positionType:"individualShift",children:[{type:"elem",elem:a,shift:o},{type:"elem",elem:r,shift:0}]});else{var x=/cancel|phase/.test(n)?["svg-align"]:[];b=Zi({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:o,wrapperClasses:x}]})}return/cancel/.test(n)&&(b.height=r.height,b.depth=r.depth),/cancel/.test(n)&&!s?Yt(["mord","cancel-lap"],[b],e):Yt(["mord"],[b],e)},OJ=(t,e)=>{var r,n=new tr(t.label.includes("colorbox")?"mpadded":"menclose",[La(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=jn(e[0],"color-token").color,o=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:CJ,mathmlBuilder:OJ}),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=jn(e[0],"color-token").color,o=jn(e[1],"color-token").color,s=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:o,borderColor:a,body:s}},htmlBuilder:CJ,mathmlBuilder:OJ}),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:CJ,mathmlBuilder:OJ}),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:CJ,mathmlBuilder:OJ}),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 EPt={};function U0(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:o}=t,s={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.")},K_n=new Set(["gather","gather*"]);function OTe(t){if(!t.includes("ed"))return!t.includes("*")}function H2(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:a,arraystretch:o,colSeparationType:s,autoTag:l,singleRow:u,emptySingleRow:h,maxNumCols:d,leqno:f}=e;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!o){var p=t.gullet.expandMacroAsText("\\arraystretch");if(p==null)o=1;else if(o=parseFloat(p),!o||o<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 uf("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):b.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(x(),y.push(RPt(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||s)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[ae]})}for(w(o[0]),n=0;n0&&(_+=b,T<_&&(T=_),_=0)),e.addJot&&nbe))for(n=0;n=s)){var X=void 0;if(i>0||e.hskipBeforeAndAfter){var J,ee;X=(J=(ee=U)==null?void 0:ee.pregap)!=null?J:f,X!==0&&(D=Yt(["arraycolsep"],[]),D.style.width=ir(X),R.push(D))}var te=[];for(n=0;n0){for(var ge=T4("hline",r,h),ze=T4("hdashline",r,h),we=[{type:"elem",elem:xe,shift:0}];u.length>0;){var Oe=u.pop(),Be=Oe.pos-P;Oe.isDashed?we.push({type:"elem",elem:ze,shift:Be}):we.push({type:"elem",elem:ge,shift:Be})}xe=Zi({positionType:"individualShift",children:we})}if(I.length===0)return Yt(["mord"],[xe],r);var Z=Zi({positionType:"individualShift",children:I}),le=Yt(["tag"],[Z],r);return I1([xe,le])},Z_n={c:"center ",l:"left ",r:"right "},Q0=function(e,r){for(var n=[],i=new tr("mtd",[],["mtr-glue"]),a=new tr("mtd",[],["mml-eqn-num"]),o=0;o0){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 o.colSeparationType=p?"align":"alignat",o};U0({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=xJ(e[0]),n=r?[e[0]]:jn(e[0],"ordgroup").body,i=n.map(function(o){var s=bJ(o),l=s.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,o)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return H2(t.parser,a,kTe(t.envName))},htmlBuilder:V0,mathmlBuilder:Q0}),U0({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=H2(t.parser,n,kTe(t.envName)),o=Math.max(0,...a.body.map(s=>s.length));return a.cols=new Array(o).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:V0,mathmlBuilder:Q0}),U0({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=H2(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:V0,mathmlBuilder:Q0}),U0({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=xJ(e[0]),n=r?[e[0]]:jn(e[0],"ordgroup").body,i=n.map(function(s){var l=bJ(s),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Zt("Unknown column alignment: "+u,s)});if(i.length>1)throw new Zt("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},o=H2(t.parser,a,"script");if(o.body.length>0&&o.body[0].length>1)throw new Zt("{subarray} can contain only one column");return o},htmlBuilder:V0,mathmlBuilder:Q0}),U0({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=H2(t.parser,e,kTe(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:V0,mathmlBuilder:Q0}),U0({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:DPt,htmlBuilder:V0,mathmlBuilder:Q0}),U0({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){K_n.has(t.envName)&&kJ(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:OTe(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return H2(t.parser,e,"display")},htmlBuilder:V0,mathmlBuilder:Q0}),U0({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:DPt,htmlBuilder:V0,mathmlBuilder:Q0}),U0({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){kJ(t);var e={autoTag:OTe(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return H2(t.parser,e,"display")},htmlBuilder:V0,mathmlBuilder:Q0}),U0({type:"array",names:["CD"],props:{numArgs:0},handler(t){return kJ(t),F_n(t.parser)},htmlBuilder:V0,mathmlBuilder:Q0}),_e("\\nonumber","\\gdef\\@eqnsw{0}"),_e("\\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 LPt=EPt;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="",o=0;o{var r=t.font,n=e.withFont(r);return Ji(t.body,n)},IPt=(t,e)=>{var r=t.font,n=e.withFont(r);return La(t.body,n)},PPt={"\\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=gJ(e[0]),a=n;return a in PPt&&(a=PPt[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:MPt,mathmlBuilder:IPt}),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:AJ(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:R1(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,o=r.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:o}}},htmlBuilder:MPt,mathmlBuilder:IPt});var J_n=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var o=Ji(t.numer,a,e);if(t.continued){var s=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;o.height=o.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-o.depth-(b+.5*d){var r=new tr("mfrac",[La(t.numer,e),La(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=Lo(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 Hs(t.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(r),t.rightDelim!=null){var o=new tr("mo",[new Hs(t.rightDelim.replace("\\",""))]);o.setAttribute("fence","true"),i.push(o)}return dTe(i)}return r},NPt=(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],o,s=null,l=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,s="(",l=")";break;case"\\\\bracefrac":o=!1,s="\\{",l="\\}";break;case"\\\\brackfrac":o=!1,s="[",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"),NPt({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:u,hasBarLine:o,leftDelim:s,rightDelim:l,barSize:null},h)},htmlBuilder:J_n,mathmlBuilder:e5n}),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 BPt=["display","text","script","scriptscript"],$Pt=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=gJ(e[0]),o=a.type==="atom"&&a.family==="open"?$Pt(a.text):null,s=gJ(e[1]),l=s.type==="atom"&&s.family==="close"?$Pt(s.text):null,u=jn(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=jn(p.body[0],"textord");f=BPt[Number(g.text)]}}else p=jn(p,"textord"),f=BPt[Number(p.text)];return NPt({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:o,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:jn(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=jn(e[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var o=e[2],s=a.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:o,continued:!1,hasBarLine:s,barSize:a,leftDelim:null,rightDelim:null}}});var FPt=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?Ji(t.sup,e.havingStyle(r.sup()),e):Ji(t.sub,e.havingStyle(r.sub()),e),i=jn(t.base,"horizBrace")):i=jn(t,"horizBrace");var a=Ji(i.base,e.havingBaseStyle(Nn.DISPLAY)),o=yJ(i,e),s;if(i.isOver?s=Zi({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:o,wrapperClasses:["svg-align"]}]}):s=Zi({positionType:"bottom",positionData:a.depth+.1+o.height,children:[{type:"elem",elem:o,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),n){var l=Yt(["minner",i.isOver?"mover":"munder"],[s],e);i.isOver?s=Zi({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):s=Zi({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Yt(["minner",i.isOver?"mover":"munder"],[s],e)},t5n=(t,e)=>{var r=vJ(t.label);return new tr(t.isOver?"mover":"munder",[La(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:FPt,mathmlBuilder:t5n}),xr({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=jn(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:Gs(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=hl(t.body,e,!1);return p_n(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=G2(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=jn(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=jn(e[0],"raw").string,o=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var s,l={};switch(n){case"\\htmlClass":l.class=a,s={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,s={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,s={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var u=a.split(","),h=0;h{var r=hl(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=Yt(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)=>G2(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:Gs(e[0]),mathml:Gs(e[1])}},htmlBuilder:(t,e)=>{var r=hl(t.html,e,!1);return I1(r)},mathmlBuilder:(t,e)=>G2(t.mathml,e)});var ETe=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(!RIt(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"},o={number:0,unit:"em"},s="";if(r[0])for(var l=jn(r[0],"raw").string,u=l.split(","),h=0;h{var r=Lo(t.height,e),n=0;t.totalheight.number>0&&(n=Lo(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=Lo(t.width,e));var a={height:ir(r+n)};i>0&&(a.width=ir(i)),n>0&&(a.verticalAlign=ir(-n));var o=new n_n(t.src,t.alt,a);return o.height=r,o.depth=n,o},mathmlBuilder:(t,e)=>{var r=new tr("mglyph",[]);r.setAttribute("alt",t.alt);var n=Lo(t.height,e),i=0;if(t.totalheight.number>0&&(i=Lo(t.totalheight,e)-n,r.setAttribute("valign",ir(-i))),r.setAttribute("height",ir(n+i)),t.width.number>0){var a=Lo(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=jn(e[0],"size");if(r.settings.strict){var a=n[1]==="m",o=i.value.unit==="mu";a?(o||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")):o&&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 jIt(t.dimension,e)},mathmlBuilder(t,e){var r=Lo(t.dimension,e);return new tPt(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=Yt([],[Ji(t.body,e)]),r=Yt(["inner"],[r],e)):r=Yt(["inner"],[Ji(t.body,e)]);var n=Yt(["fix"],[]),i=Yt([t.alignment],[r,n],e),a=Yt(["strut"]);return a.style.height=ir(i.height+i.depth),i.depth&&(a.style.verticalAlign=ir(-i.depth)),i.children.unshift(a),i=Yt(["thinbox"],[i],e),Yt(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new tr("mpadded",[La(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==="\\("?"\\)":"$",o=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",resetFont:!0,body:o}}}),xr({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new Zt("Mismatched "+t.funcName)}});var zPt=(t,e)=>{switch(e.style.size){case Nn.DISPLAY.size:return t.display;case Nn.TEXT.size:return t.text;case Nn.SCRIPT.size:return t.script;case Nn.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:Gs(e[0]),text:Gs(e[1]),script:Gs(e[2]),scriptscript:Gs(e[3])}},htmlBuilder:(t,e)=>{var r=zPt(t,e),n=hl(r,e,!1);return I1(n)},mathmlBuilder:(t,e)=>{var r=zPt(t,e);return G2(r,e)}});var UPt=(t,e,r,n,i,a,o)=>{t=Yt([],[t]);var s=r&&R1(r),l,u;if(e){var h=Ji(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=Ji(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+o;f=Zi({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-o;f=Zi({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+o;f=Zi({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&&!s){var y=Yt(["mspace"],[],n);y.style.marginRight=ir(a),v.unshift(y)}return Yt(["mop","op-limits"],v,n)},VPt=new Set(["\\smallint"]),O4=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=jn(t.base,"op"),i=!0):a=jn(t,"op");var o=e.style,s=!1;o.size===Nn.DISPLAY.size&&a.symbol&&!VPt.has(a.name)&&(s=!0);var l,u;if(a.symbol){var h=s?"Size2-Regular":"Size1-Regular",d="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(d=a.name.slice(1),a.name=d==="oiint"?"\\iint":"\\iiint"),l=Zu(a.name,h,"math",e,["mop","op-symbol",s?"large-op":"small-op"]),u=l.italic,d.length>0){var f=KIt(d+"Size"+(s?"2":"1"),e);l=Zi({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:s?.08:0}]}),a.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(a.body){var p=hl(a.body,e,!0);p.length===1&&p[0]instanceof sf?(l=p[0],l.classes[0]="mop"):l=Yt(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new tr("mo",[kp(t.name,t.mode)]),VPt.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new tr("mo",cf(t.body,e));else{r=new tr("mi",[new Hs(t.name.slice(1))]);var n=new tr("mo",[kp("⁡","text")]);t.parentIsSupSub?r=new tr("mrow",[r,n]):r=ePt([r,n])}return r},r5n={"∏":"\\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=r5n[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:O4,mathmlBuilder:SF}),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:Gs(n)}},htmlBuilder:O4,mathmlBuilder:SF});var n5n={"∫":"\\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:O4,mathmlBuilder:SF}),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:O4,mathmlBuilder:SF}),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=n5n[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:O4,mathmlBuilder:SF});var QPt=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=jn(t.base,"operatorname"),i=!0):a=jn(t,"operatorname");var o;if(a.body.length>0){for(var s=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=hl(s,e.withFont("mathrm"),!0),u=0;u{for(var r=cf(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new Hs(s)]}var l=new tr("mi",r);l.setAttribute("mathvariant","normal");var u=new tr("mo",[kp("⁡","text")]);return t.parentIsSupSub?new tr("mrow",[l,u]):ePt([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:Gs(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:QPt,mathmlBuilder:i5n}),_e("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),EC({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?I1(hl(t.body,e,!1)):Yt(["mord"],hl(t.body,e,!0),e)},mathmlBuilder(t,e){return G2(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=Ji(t.body,e.havingCrampedStyle()),n=T4("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Zi({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return Yt(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new tr("mo",[new Hs("‾")]);r.setAttribute("stretchy","true");var n=new tr("mover",[La(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:Gs(n)}},htmlBuilder:(t,e)=>{var r=hl(t.body,e.withPhantom(),!1);return I1(r)},mathmlBuilder:(t,e)=>{var r=cf(t.body,e);return new tr("mphantom",r)}}),_e("\\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=Yt(["inner"],[Ji(t.body,e.withPhantom())]),n=Yt(["fix"],[]);return Yt(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=cf(Gs(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=jn(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=Ji(t.body,e),n=Lo(t.dy,e);return Zi({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new tr("mpadded",[La(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=jn(e[0],"size"),o=jn(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&jn(i,"size").value,width:a.value,height:o.value}},htmlBuilder(t,e){var r=Yt(["mord","rule"],[],e),n=Lo(t.width,e),i=Lo(t.height,e),a=t.shift?Lo(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=Lo(t.width,e),n=Lo(t.height,e),i=t.shift?Lo(t.shift,e):0,a=e.color&&e.getColor()||"black",o=new tr("mspace");o.setAttribute("mathbackground",a),o.setAttribute("width",ir(r)),o.setAttribute("height",ir(n));var s=new tr("mpadded",[o]);return i>=0?s.setAttribute("height",ir(i)):(s.setAttribute("height",ir(i)),s.setAttribute("depth",ir(-i))),s.setAttribute("voffset",ir(i)),s}});function GPt(t,e,r){for(var n=hl(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,a=0;a{var r=e.havingSize(t.size);return GPt(t.body,r,e)};xr({type:"sizing",names:HPt,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:HPt.indexOf(n)+1,body:a}},htmlBuilder:a5n,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=cf(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,o=r[0]&&jn(r[0],"ordgroup");if(o)for(var s,l=0;l{var r=Yt([],[Ji(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 Yt(["mord","smash"],[r],e);if(r.children)for(var n=0;n{var r=new tr("mpadded",[La(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=Ji(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=C4(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.idr.height+r.depth+o&&(o=(o+d-r.height-r.depth)/2);var f=l.height-r.height-o-u;r.style.paddingLeft=ir(h);var p=Zi({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(Nn.SCRIPTSCRIPT),m=Ji(t.index,g,e),v=.6*(p.height-p.depth),y=Zi({positionType:"shift",positionData:-v,children:[{type:"elem",elem:m}]}),b=Yt(["root"],[y]);return Yt(["mord","sqrt"],[b,p],e)}else return Yt(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new tr("mroot",[La(r,e),La(n,e)]):new tr("msqrt",[La(r,e)])}});var _Te={display:Nn.DISPLAY,text:Nn.TEXT,script:Nn.SCRIPT,scriptscript:Nn.SCRIPTSCRIPT};function o5n(t){return t in _Te}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),o=n.slice(1,n.length-5);if(!o5n(o))throw new Error("Unknown style: "+o);return{type:"styling",mode:i.mode,style:o,body:a}},htmlBuilder(t,e){var r=_Te[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),GPt(t.body,n,e)},mathmlBuilder(t,e){var r=_Te[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=cf(t.body,n),a=new tr("mstyle",i),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},s=o[t.style];return a.setAttribute("scriptlevel",s[0]),a.setAttribute("displaystyle",s[1]),a}});var s5n=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===Nn.DISPLAY.size||n.alwaysHandleSupSub);return i?O4:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===Nn.DISPLAY.size||n.limits);return a?QPt:null}else{if(n.type==="accent")return R1(n.base)?gTe:null;if(n.type==="horizBrace"){var o=!e.sub;return o===n.isOver?FPt:null}else return null}else return null};EC({type:"supsub",htmlBuilder(t,e){var r=s5n(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,o=Ji(n,e),s,l,u=e.fontMetrics(),h=0,d=0,f=n&&R1(n);if(i){var p=e.havingStyle(e.style.sup());s=Ji(i,p,e),f||(h=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());l=Ji(a,g,e),f||(d=o.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===Nn.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(o instanceof sf||x){var w;b=ir(-((w=o.italic)!=null?w:0))}}var A;if(s&&l){h=Math.max(h,m,s.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var S=u.defaultRuleThickness,T=4*S;if(h-s.depth-(l.height-d)0&&(h+=C,d-=C)}var k=[{type:"elem",elem:l,shift:d,marginRight:y,marginLeft:b},{type:"elem",elem:s,shift:-h,marginRight:y}];A=Zi({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=Zi({positionType:"shift",positionData:d,children:E})}else if(s)h=Math.max(h,m,s.depth+.25*u.xHeight),A=Zi({positionType:"shift",positionData:-h,children:[{type:"elem",elem:s,marginRight:y}]});else throw new Error("supsub must have either sup or sub.");var _=uTe(o,"right")||"mord";return Yt([_],[o,Yt(["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=[La(t.base,e)];t.sub&&a.push(La(t.sub,e)),t.sup&&a.push(La(t.sup,e));var o;if(r)o=n?"mover":"munder";else if(t.sub)if(t.sup){var u=t.base;u&&u.type==="op"&&u.limits&&e.style===Nn.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===Nn.DISPLAY||u.limits)?o="munderover":o="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===Nn.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Nn.DISPLAY)?o="munder":o="msub"}else{var s=t.base;s&&s.type==="op"&&s.limits&&(e.style===Nn.DISPLAY||s.alwaysHandleSupSub)||s&&s.type==="operatorname"&&s.alwaysHandleSupSub&&(s.limits||e.style===Nn.DISPLAY)?o="mover":o="msup"}return new tr(o,a)}}),EC({type:"atom",htmlBuilder(t,e){return aTe(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new tr("mo",[kp(t.text,t.mode)]);if(t.family==="bin"){var n=fTe(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 WPt={mi:"italic",mn:"normal",mtext:"normal"};EC({type:"mathord",htmlBuilder(t,e){return hJ(t,e,"mathord")},mathmlBuilder(t,e){var r=new tr("mi",[kp(t.text,t.mode,e)]),n=fTe(t,e)||"italic";return n!==WPt[r.type]&&r.setAttribute("mathvariant",n),r}}),EC({type:"textord",htmlBuilder(t,e){return hJ(t,e,"textord")},mathmlBuilder(t,e){var r=kp(t.text,t.mode,e),n=fTe(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!==WPt[i.type]&&i.setAttribute("mathvariant",n),i}});var RTe={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},DTe={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};EC({type:"spacing",htmlBuilder(t,e){if(DTe.hasOwnProperty(t.text)){var r=DTe[t.text].className||"";if(t.mode==="text"){var n=hJ(t,e,"textord");return n.classes.push(r),n}else return Yt(["mspace",r],[aTe(t.text,t.mode,e)],e)}else{if(RTe.hasOwnProperty(t.text))return Yt(["mspace",RTe[t.text]],[],e);throw new Zt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(DTe.hasOwnProperty(t.text))r=new tr("mtext",[new Hs(" ")]);else{if(RTe.hasOwnProperty(t.text))return new tr("mspace");throw new Zt('Unknown type of space "'+t.text+'"')}return r}});var YPt=()=>{var t=new tr("mtd",[]);return t.setAttribute("width","50%"),t};EC({type:"tag",mathmlBuilder(t,e){var r=new tr("mtable",[new tr("mtr",[YPt(),new tr("mtd",[G2(t.body,e)]),YPt(),new tr("mtd",[G2(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var qPt={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},jPt={"\\textbf":"textbf","\\textmd":"textmd"},l5n={"\\textit":"textit","\\textup":"textup"},XPt=(t,e)=>{var r=t.font;if(r){if(qPt[r])return e.withTextFontFamily(qPt[r]);if(jPt[r])return e.withTextFontWeight(jPt[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(l5n[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:Gs(i),font:n}},htmlBuilder(t,e){var r=XPt(t,e),n=hl(t.body,r,!0);return Yt(["mord","text"],n,r)},mathmlBuilder(t,e){var r=XPt(t,e);return G2(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=Ji(t.body,e),n=T4("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Zi({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]});return Yt(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new tr("mo",[new Hs("‾")]);r.setAttribute("stretchy","true");var n=new tr("munder",[La(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=Ji(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return Zi({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new tr("mpadded",[La(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=KPt(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"␣":" "),W2=ZIt,ZPt=`[ \r - ]`,c5n="\\\\[a-zA-Z@]+",u5n="\\\\[^\uD800-\uDFFF]",h5n="("+c5n+")"+ZPt+"*",d5n=`\\\\( +-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 r_n(t){return"toText"in t}class w4{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(r_n(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var HSe={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},n_n={ex:!0,em:!0,mu:!0},LIt=function(e){return typeof e!="string"&&(e=e.unit),e in HSe||e in n_n||e==="ex"},Lo=function(e,r){var n;if(e.unit in HSe)n=HSe[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"},z2=function(e){return e.filter(r=>r).join(" ")},WSe=function(e){var r="";for(var n of Object.keys(e)){var i=e[n];i!==void 0&&(r+=DEn(n)+":"+i+";")}return r},MIt=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)}},IIt=function(e){var r=document.createElement(e);r.className=z2(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]/,PIt=function(e){var r="<"+e;this.classes.length&&(r+=' class="'+uu(z2(this.classes))+'"');var n=WSe(this.style);n&&(r+=' style="'+uu(n)+'"');for(var i of Object.keys(this.attributes)){if(i_n.test(i))throw new Zt("Invalid attribute name '"+i+"'");r+=" "+i+'="'+uu(this.attributes[i])+'"'}r+=">";for(var a=0;a",r};class A4{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,MIt.call(this,e,n,i),this.children=r||[]}setAttribute(e,r){this.attributes[e]=r}hasClass(e){return this.classes.includes(e)}toNode(){return IIt.call(this,"span")}toMarkup(){return PIt.call(this,"span")}}let aJ=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,MIt.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 IIt.call(this,"a")}toMarkup(){return PIt.call(this,"a")}};class a_n{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=''+uu(this.alt)+'0&&(r=document.createElement("span"),r.style.marginRight=ir(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=z2(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+=WSe(this.style),n&&(e=!0,r+=' style="'+uu(n)+'"');var i=uu(this.text);return e?(r+=">",r+=i,r+="",r):i}}class L1{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 YSe{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 c_n=t=>t instanceof A4||t instanceof aJ||t instanceof w4,z0={"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]}},oJ={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]},NIt={Å:"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 BIt(t,e){z0[t]=e}function qSe(t,e,r){if(!z0[e])throw new Error("Font metrics not found for font: "+e+".");var n=t.charCodeAt(0),i=z0[e][n];if(!i&&t[0]in NIt&&(n=NIt[t[0]].charCodeAt(0),i=z0[e][n]),!i&&r==="text"&&RIt(n)&&(i=z0[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var jSe={};function u_n(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!jSe[e]){var r=jSe[e]={cssEmPerMu:oJ.quad[e]/18};for(var n in oJ)oJ.hasOwnProperty(n)&&(r[n]=oJ[n][e])}return jSe[e]}var So={math:{},text:{}};function re(t,e,r,n,i,a){So[t][i]={font:e,group:r,replace:n},a&&n&&(So[t][n]=So[t][i])}var he="math",zt="text",Se="main",qe="ams",To="accent-token",kr="bin",Xu="close",S4="inner",sn="mathord",Qs="op-token",lf="open",bF="punct",Xe="rel",M1="spacing",Je="textord";re(he,Se,Xe,"≡","\\equiv",!0),re(he,Se,Xe,"≺","\\prec",!0),re(he,Se,Xe,"≻","\\succ",!0),re(he,Se,Xe,"∼","\\sim",!0),re(he,Se,Xe,"⊥","\\perp"),re(he,Se,Xe,"⪯","\\preceq",!0),re(he,Se,Xe,"⪰","\\succeq",!0),re(he,Se,Xe,"≃","\\simeq",!0),re(he,Se,Xe,"∣","\\mid",!0),re(he,Se,Xe,"≪","\\ll",!0),re(he,Se,Xe,"≫","\\gg",!0),re(he,Se,Xe,"≍","\\asymp",!0),re(he,Se,Xe,"∥","\\parallel"),re(he,Se,Xe,"⋈","\\bowtie",!0),re(he,Se,Xe,"⌣","\\smile",!0),re(he,Se,Xe,"⊑","\\sqsubseteq",!0),re(he,Se,Xe,"⊒","\\sqsupseteq",!0),re(he,Se,Xe,"≐","\\doteq",!0),re(he,Se,Xe,"⌢","\\frown",!0),re(he,Se,Xe,"∋","\\ni",!0),re(he,Se,Xe,"∝","\\propto",!0),re(he,Se,Xe,"⊢","\\vdash",!0),re(he,Se,Xe,"⊣","\\dashv",!0),re(he,Se,Xe,"∋","\\owns"),re(he,Se,bF,".","\\ldotp"),re(he,Se,bF,"⋅","\\cdotp"),re(he,Se,bF,"⋅","·"),re(zt,Se,Je,"⋅","·"),re(he,Se,Je,"#","\\#"),re(zt,Se,Je,"#","\\#"),re(he,Se,Je,"&","\\&"),re(zt,Se,Je,"&","\\&"),re(he,Se,Je,"ℵ","\\aleph",!0),re(he,Se,Je,"∀","\\forall",!0),re(he,Se,Je,"ℏ","\\hbar",!0),re(he,Se,Je,"∃","\\exists",!0),re(he,Se,Je,"∇","\\nabla",!0),re(he,Se,Je,"♭","\\flat",!0),re(he,Se,Je,"ℓ","\\ell",!0),re(he,Se,Je,"♮","\\natural",!0),re(he,Se,Je,"♣","\\clubsuit",!0),re(he,Se,Je,"℘","\\wp",!0),re(he,Se,Je,"♯","\\sharp",!0),re(he,Se,Je,"♢","\\diamondsuit",!0),re(he,Se,Je,"ℜ","\\Re",!0),re(he,Se,Je,"♡","\\heartsuit",!0),re(he,Se,Je,"ℑ","\\Im",!0),re(he,Se,Je,"♠","\\spadesuit",!0),re(he,Se,Je,"§","\\S",!0),re(zt,Se,Je,"§","\\S"),re(he,Se,Je,"¶","\\P",!0),re(zt,Se,Je,"¶","\\P"),re(he,Se,Je,"†","\\dag"),re(zt,Se,Je,"†","\\dag"),re(zt,Se,Je,"†","\\textdagger"),re(he,Se,Je,"‡","\\ddag"),re(zt,Se,Je,"‡","\\ddag"),re(zt,Se,Je,"‡","\\textdaggerdbl"),re(he,Se,Xu,"⎱","\\rmoustache",!0),re(he,Se,lf,"⎰","\\lmoustache",!0),re(he,Se,Xu,"⟯","\\rgroup",!0),re(he,Se,lf,"⟮","\\lgroup",!0),re(he,Se,kr,"∓","\\mp",!0),re(he,Se,kr,"⊖","\\ominus",!0),re(he,Se,kr,"⊎","\\uplus",!0),re(he,Se,kr,"⊓","\\sqcap",!0),re(he,Se,kr,"∗","\\ast"),re(he,Se,kr,"⊔","\\sqcup",!0),re(he,Se,kr,"◯","\\bigcirc",!0),re(he,Se,kr,"∙","\\bullet",!0),re(he,Se,kr,"‡","\\ddagger"),re(he,Se,kr,"≀","\\wr",!0),re(he,Se,kr,"⨿","\\amalg"),re(he,Se,kr,"&","\\And"),re(he,Se,Xe,"⟵","\\longleftarrow",!0),re(he,Se,Xe,"⇐","\\Leftarrow",!0),re(he,Se,Xe,"⟸","\\Longleftarrow",!0),re(he,Se,Xe,"⟶","\\longrightarrow",!0),re(he,Se,Xe,"⇒","\\Rightarrow",!0),re(he,Se,Xe,"⟹","\\Longrightarrow",!0),re(he,Se,Xe,"↔","\\leftrightarrow",!0),re(he,Se,Xe,"⟷","\\longleftrightarrow",!0),re(he,Se,Xe,"⇔","\\Leftrightarrow",!0),re(he,Se,Xe,"⟺","\\Longleftrightarrow",!0),re(he,Se,Xe,"↦","\\mapsto",!0),re(he,Se,Xe,"⟼","\\longmapsto",!0),re(he,Se,Xe,"↗","\\nearrow",!0),re(he,Se,Xe,"↩","\\hookleftarrow",!0),re(he,Se,Xe,"↪","\\hookrightarrow",!0),re(he,Se,Xe,"↘","\\searrow",!0),re(he,Se,Xe,"↼","\\leftharpoonup",!0),re(he,Se,Xe,"⇀","\\rightharpoonup",!0),re(he,Se,Xe,"↙","\\swarrow",!0),re(he,Se,Xe,"↽","\\leftharpoondown",!0),re(he,Se,Xe,"⇁","\\rightharpoondown",!0),re(he,Se,Xe,"↖","\\nwarrow",!0),re(he,Se,Xe,"⇌","\\rightleftharpoons",!0),re(he,qe,Xe,"≮","\\nless",!0),re(he,qe,Xe,"","\\@nleqslant"),re(he,qe,Xe,"","\\@nleqq"),re(he,qe,Xe,"⪇","\\lneq",!0),re(he,qe,Xe,"≨","\\lneqq",!0),re(he,qe,Xe,"","\\@lvertneqq"),re(he,qe,Xe,"⋦","\\lnsim",!0),re(he,qe,Xe,"⪉","\\lnapprox",!0),re(he,qe,Xe,"⊀","\\nprec",!0),re(he,qe,Xe,"⋠","\\npreceq",!0),re(he,qe,Xe,"⋨","\\precnsim",!0),re(he,qe,Xe,"⪹","\\precnapprox",!0),re(he,qe,Xe,"≁","\\nsim",!0),re(he,qe,Xe,"","\\@nshortmid"),re(he,qe,Xe,"∤","\\nmid",!0),re(he,qe,Xe,"⊬","\\nvdash",!0),re(he,qe,Xe,"⊭","\\nvDash",!0),re(he,qe,Xe,"⋪","\\ntriangleleft"),re(he,qe,Xe,"⋬","\\ntrianglelefteq",!0),re(he,qe,Xe,"⊊","\\subsetneq",!0),re(he,qe,Xe,"","\\@varsubsetneq"),re(he,qe,Xe,"⫋","\\subsetneqq",!0),re(he,qe,Xe,"","\\@varsubsetneqq"),re(he,qe,Xe,"≯","\\ngtr",!0),re(he,qe,Xe,"","\\@ngeqslant"),re(he,qe,Xe,"","\\@ngeqq"),re(he,qe,Xe,"⪈","\\gneq",!0),re(he,qe,Xe,"≩","\\gneqq",!0),re(he,qe,Xe,"","\\@gvertneqq"),re(he,qe,Xe,"⋧","\\gnsim",!0),re(he,qe,Xe,"⪊","\\gnapprox",!0),re(he,qe,Xe,"⊁","\\nsucc",!0),re(he,qe,Xe,"⋡","\\nsucceq",!0),re(he,qe,Xe,"⋩","\\succnsim",!0),re(he,qe,Xe,"⪺","\\succnapprox",!0),re(he,qe,Xe,"≆","\\ncong",!0),re(he,qe,Xe,"","\\@nshortparallel"),re(he,qe,Xe,"∦","\\nparallel",!0),re(he,qe,Xe,"⊯","\\nVDash",!0),re(he,qe,Xe,"⋫","\\ntriangleright"),re(he,qe,Xe,"⋭","\\ntrianglerighteq",!0),re(he,qe,Xe,"","\\@nsupseteqq"),re(he,qe,Xe,"⊋","\\supsetneq",!0),re(he,qe,Xe,"","\\@varsupsetneq"),re(he,qe,Xe,"⫌","\\supsetneqq",!0),re(he,qe,Xe,"","\\@varsupsetneqq"),re(he,qe,Xe,"⊮","\\nVdash",!0),re(he,qe,Xe,"⪵","\\precneqq",!0),re(he,qe,Xe,"⪶","\\succneqq",!0),re(he,qe,Xe,"","\\@nsubseteqq"),re(he,qe,kr,"⊴","\\unlhd"),re(he,qe,kr,"⊵","\\unrhd"),re(he,qe,Xe,"↚","\\nleftarrow",!0),re(he,qe,Xe,"↛","\\nrightarrow",!0),re(he,qe,Xe,"⇍","\\nLeftarrow",!0),re(he,qe,Xe,"⇏","\\nRightarrow",!0),re(he,qe,Xe,"↮","\\nleftrightarrow",!0),re(he,qe,Xe,"⇎","\\nLeftrightarrow",!0),re(he,qe,Xe,"△","\\vartriangle"),re(he,qe,Je,"ℏ","\\hslash"),re(he,qe,Je,"▽","\\triangledown"),re(he,qe,Je,"◊","\\lozenge"),re(he,qe,Je,"Ⓢ","\\circledS"),re(he,qe,Je,"®","\\circledR"),re(zt,qe,Je,"®","\\circledR"),re(he,qe,Je,"∡","\\measuredangle",!0),re(he,qe,Je,"∄","\\nexists"),re(he,qe,Je,"℧","\\mho"),re(he,qe,Je,"Ⅎ","\\Finv",!0),re(he,qe,Je,"⅁","\\Game",!0),re(he,qe,Je,"‵","\\backprime"),re(he,qe,Je,"▲","\\blacktriangle"),re(he,qe,Je,"▼","\\blacktriangledown"),re(he,qe,Je,"■","\\blacksquare"),re(he,qe,Je,"⧫","\\blacklozenge"),re(he,qe,Je,"★","\\bigstar"),re(he,qe,Je,"∢","\\sphericalangle",!0),re(he,qe,Je,"∁","\\complement",!0),re(he,qe,Je,"ð","\\eth",!0),re(zt,Se,Je,"ð","ð"),re(he,qe,Je,"╱","\\diagup"),re(he,qe,Je,"╲","\\diagdown"),re(he,qe,Je,"□","\\square"),re(he,qe,Je,"□","\\Box"),re(he,qe,Je,"◊","\\Diamond"),re(he,qe,Je,"¥","\\yen",!0),re(zt,qe,Je,"¥","\\yen",!0),re(he,qe,Je,"✓","\\checkmark",!0),re(zt,qe,Je,"✓","\\checkmark"),re(he,qe,Je,"ℶ","\\beth",!0),re(he,qe,Je,"ℸ","\\daleth",!0),re(he,qe,Je,"ℷ","\\gimel",!0),re(he,qe,Je,"ϝ","\\digamma",!0),re(he,qe,Je,"ϰ","\\varkappa"),re(he,qe,lf,"┌","\\@ulcorner",!0),re(he,qe,Xu,"┐","\\@urcorner",!0),re(he,qe,lf,"└","\\@llcorner",!0),re(he,qe,Xu,"┘","\\@lrcorner",!0),re(he,qe,Xe,"≦","\\leqq",!0),re(he,qe,Xe,"⩽","\\leqslant",!0),re(he,qe,Xe,"⪕","\\eqslantless",!0),re(he,qe,Xe,"≲","\\lesssim",!0),re(he,qe,Xe,"⪅","\\lessapprox",!0),re(he,qe,Xe,"≊","\\approxeq",!0),re(he,qe,kr,"⋖","\\lessdot"),re(he,qe,Xe,"⋘","\\lll",!0),re(he,qe,Xe,"≶","\\lessgtr",!0),re(he,qe,Xe,"⋚","\\lesseqgtr",!0),re(he,qe,Xe,"⪋","\\lesseqqgtr",!0),re(he,qe,Xe,"≑","\\doteqdot"),re(he,qe,Xe,"≓","\\risingdotseq",!0),re(he,qe,Xe,"≒","\\fallingdotseq",!0),re(he,qe,Xe,"∽","\\backsim",!0),re(he,qe,Xe,"⋍","\\backsimeq",!0),re(he,qe,Xe,"⫅","\\subseteqq",!0),re(he,qe,Xe,"⋐","\\Subset",!0),re(he,qe,Xe,"⊏","\\sqsubset",!0),re(he,qe,Xe,"≼","\\preccurlyeq",!0),re(he,qe,Xe,"⋞","\\curlyeqprec",!0),re(he,qe,Xe,"≾","\\precsim",!0),re(he,qe,Xe,"⪷","\\precapprox",!0),re(he,qe,Xe,"⊲","\\vartriangleleft"),re(he,qe,Xe,"⊴","\\trianglelefteq"),re(he,qe,Xe,"⊨","\\vDash",!0),re(he,qe,Xe,"⊪","\\Vvdash",!0),re(he,qe,Xe,"⌣","\\smallsmile"),re(he,qe,Xe,"⌢","\\smallfrown"),re(he,qe,Xe,"≏","\\bumpeq",!0),re(he,qe,Xe,"≎","\\Bumpeq",!0),re(he,qe,Xe,"≧","\\geqq",!0),re(he,qe,Xe,"⩾","\\geqslant",!0),re(he,qe,Xe,"⪖","\\eqslantgtr",!0),re(he,qe,Xe,"≳","\\gtrsim",!0),re(he,qe,Xe,"⪆","\\gtrapprox",!0),re(he,qe,kr,"⋗","\\gtrdot"),re(he,qe,Xe,"⋙","\\ggg",!0),re(he,qe,Xe,"≷","\\gtrless",!0),re(he,qe,Xe,"⋛","\\gtreqless",!0),re(he,qe,Xe,"⪌","\\gtreqqless",!0),re(he,qe,Xe,"≖","\\eqcirc",!0),re(he,qe,Xe,"≗","\\circeq",!0),re(he,qe,Xe,"≜","\\triangleq",!0),re(he,qe,Xe,"∼","\\thicksim"),re(he,qe,Xe,"≈","\\thickapprox"),re(he,qe,Xe,"⫆","\\supseteqq",!0),re(he,qe,Xe,"⋑","\\Supset",!0),re(he,qe,Xe,"⊐","\\sqsupset",!0),re(he,qe,Xe,"≽","\\succcurlyeq",!0),re(he,qe,Xe,"⋟","\\curlyeqsucc",!0),re(he,qe,Xe,"≿","\\succsim",!0),re(he,qe,Xe,"⪸","\\succapprox",!0),re(he,qe,Xe,"⊳","\\vartriangleright"),re(he,qe,Xe,"⊵","\\trianglerighteq"),re(he,qe,Xe,"⊩","\\Vdash",!0),re(he,qe,Xe,"∣","\\shortmid"),re(he,qe,Xe,"∥","\\shortparallel"),re(he,qe,Xe,"≬","\\between",!0),re(he,qe,Xe,"⋔","\\pitchfork",!0),re(he,qe,Xe,"∝","\\varpropto"),re(he,qe,Xe,"◀","\\blacktriangleleft"),re(he,qe,Xe,"∴","\\therefore",!0),re(he,qe,Xe,"∍","\\backepsilon"),re(he,qe,Xe,"▶","\\blacktriangleright"),re(he,qe,Xe,"∵","\\because",!0),re(he,qe,Xe,"⋘","\\llless"),re(he,qe,Xe,"⋙","\\gggtr"),re(he,qe,kr,"⊲","\\lhd"),re(he,qe,kr,"⊳","\\rhd"),re(he,qe,Xe,"≂","\\eqsim",!0),re(he,Se,Xe,"⋈","\\Join"),re(he,qe,Xe,"≑","\\Doteq",!0),re(he,qe,kr,"∔","\\dotplus",!0),re(he,qe,kr,"∖","\\smallsetminus"),re(he,qe,kr,"⋒","\\Cap",!0),re(he,qe,kr,"⋓","\\Cup",!0),re(he,qe,kr,"⩞","\\doublebarwedge",!0),re(he,qe,kr,"⊟","\\boxminus",!0),re(he,qe,kr,"⊞","\\boxplus",!0),re(he,qe,kr,"⋇","\\divideontimes",!0),re(he,qe,kr,"⋉","\\ltimes",!0),re(he,qe,kr,"⋊","\\rtimes",!0),re(he,qe,kr,"⋋","\\leftthreetimes",!0),re(he,qe,kr,"⋌","\\rightthreetimes",!0),re(he,qe,kr,"⋏","\\curlywedge",!0),re(he,qe,kr,"⋎","\\curlyvee",!0),re(he,qe,kr,"⊝","\\circleddash",!0),re(he,qe,kr,"⊛","\\circledast",!0),re(he,qe,kr,"⋅","\\centerdot"),re(he,qe,kr,"⊺","\\intercal",!0),re(he,qe,kr,"⋒","\\doublecap"),re(he,qe,kr,"⋓","\\doublecup"),re(he,qe,kr,"⊠","\\boxtimes",!0),re(he,qe,Xe,"⇢","\\dashrightarrow",!0),re(he,qe,Xe,"⇠","\\dashleftarrow",!0),re(he,qe,Xe,"⇇","\\leftleftarrows",!0),re(he,qe,Xe,"⇆","\\leftrightarrows",!0),re(he,qe,Xe,"⇚","\\Lleftarrow",!0),re(he,qe,Xe,"↞","\\twoheadleftarrow",!0),re(he,qe,Xe,"↢","\\leftarrowtail",!0),re(he,qe,Xe,"↫","\\looparrowleft",!0),re(he,qe,Xe,"⇋","\\leftrightharpoons",!0),re(he,qe,Xe,"↶","\\curvearrowleft",!0),re(he,qe,Xe,"↺","\\circlearrowleft",!0),re(he,qe,Xe,"↰","\\Lsh",!0),re(he,qe,Xe,"⇈","\\upuparrows",!0),re(he,qe,Xe,"↿","\\upharpoonleft",!0),re(he,qe,Xe,"⇃","\\downharpoonleft",!0),re(he,Se,Xe,"⊶","\\origof",!0),re(he,Se,Xe,"⊷","\\imageof",!0),re(he,qe,Xe,"⊸","\\multimap",!0),re(he,qe,Xe,"↭","\\leftrightsquigarrow",!0),re(he,qe,Xe,"⇉","\\rightrightarrows",!0),re(he,qe,Xe,"⇄","\\rightleftarrows",!0),re(he,qe,Xe,"↠","\\twoheadrightarrow",!0),re(he,qe,Xe,"↣","\\rightarrowtail",!0),re(he,qe,Xe,"↬","\\looparrowright",!0),re(he,qe,Xe,"↷","\\curvearrowright",!0),re(he,qe,Xe,"↻","\\circlearrowright",!0),re(he,qe,Xe,"↱","\\Rsh",!0),re(he,qe,Xe,"⇊","\\downdownarrows",!0),re(he,qe,Xe,"↾","\\upharpoonright",!0),re(he,qe,Xe,"⇂","\\downharpoonright",!0),re(he,qe,Xe,"⇝","\\rightsquigarrow",!0),re(he,qe,Xe,"⇝","\\leadsto"),re(he,qe,Xe,"⇛","\\Rrightarrow",!0),re(he,qe,Xe,"↾","\\restriction"),re(he,Se,Je,"‘","`"),re(he,Se,Je,"$","\\$"),re(zt,Se,Je,"$","\\$"),re(zt,Se,Je,"$","\\textdollar"),re(he,Se,Je,"%","\\%"),re(zt,Se,Je,"%","\\%"),re(he,Se,Je,"_","\\_"),re(zt,Se,Je,"_","\\_"),re(zt,Se,Je,"_","\\textunderscore"),re(he,Se,Je,"∠","\\angle",!0),re(he,Se,Je,"∞","\\infty",!0),re(he,Se,Je,"′","\\prime"),re(he,Se,Je,"△","\\triangle"),re(he,Se,Je,"Γ","\\Gamma",!0),re(he,Se,Je,"Δ","\\Delta",!0),re(he,Se,Je,"Θ","\\Theta",!0),re(he,Se,Je,"Λ","\\Lambda",!0),re(he,Se,Je,"Ξ","\\Xi",!0),re(he,Se,Je,"Π","\\Pi",!0),re(he,Se,Je,"Σ","\\Sigma",!0),re(he,Se,Je,"Υ","\\Upsilon",!0),re(he,Se,Je,"Φ","\\Phi",!0),re(he,Se,Je,"Ψ","\\Psi",!0),re(he,Se,Je,"Ω","\\Omega",!0),re(he,Se,Je,"A","Α"),re(he,Se,Je,"B","Β"),re(he,Se,Je,"E","Ε"),re(he,Se,Je,"Z","Ζ"),re(he,Se,Je,"H","Η"),re(he,Se,Je,"I","Ι"),re(he,Se,Je,"K","Κ"),re(he,Se,Je,"M","Μ"),re(he,Se,Je,"N","Ν"),re(he,Se,Je,"O","Ο"),re(he,Se,Je,"P","Ρ"),re(he,Se,Je,"T","Τ"),re(he,Se,Je,"X","Χ"),re(he,Se,Je,"¬","\\neg",!0),re(he,Se,Je,"¬","\\lnot"),re(he,Se,Je,"⊤","\\top"),re(he,Se,Je,"⊥","\\bot"),re(he,Se,Je,"∅","\\emptyset"),re(he,qe,Je,"∅","\\varnothing"),re(he,Se,sn,"α","\\alpha",!0),re(he,Se,sn,"β","\\beta",!0),re(he,Se,sn,"γ","\\gamma",!0),re(he,Se,sn,"δ","\\delta",!0),re(he,Se,sn,"ϵ","\\epsilon",!0),re(he,Se,sn,"ζ","\\zeta",!0),re(he,Se,sn,"η","\\eta",!0),re(he,Se,sn,"θ","\\theta",!0),re(he,Se,sn,"ι","\\iota",!0),re(he,Se,sn,"κ","\\kappa",!0),re(he,Se,sn,"λ","\\lambda",!0),re(he,Se,sn,"μ","\\mu",!0),re(he,Se,sn,"ν","\\nu",!0),re(he,Se,sn,"ξ","\\xi",!0),re(he,Se,sn,"ο","\\omicron",!0),re(he,Se,sn,"π","\\pi",!0),re(he,Se,sn,"ρ","\\rho",!0),re(he,Se,sn,"σ","\\sigma",!0),re(he,Se,sn,"τ","\\tau",!0),re(he,Se,sn,"υ","\\upsilon",!0),re(he,Se,sn,"ϕ","\\phi",!0),re(he,Se,sn,"χ","\\chi",!0),re(he,Se,sn,"ψ","\\psi",!0),re(he,Se,sn,"ω","\\omega",!0),re(he,Se,sn,"ε","\\varepsilon",!0),re(he,Se,sn,"ϑ","\\vartheta",!0),re(he,Se,sn,"ϖ","\\varpi",!0),re(he,Se,sn,"ϱ","\\varrho",!0),re(he,Se,sn,"ς","\\varsigma",!0),re(he,Se,sn,"φ","\\varphi",!0),re(he,Se,kr,"∗","*",!0),re(he,Se,kr,"+","+"),re(he,Se,kr,"−","-",!0),re(he,Se,kr,"⋅","\\cdot",!0),re(he,Se,kr,"∘","\\circ",!0),re(he,Se,kr,"÷","\\div",!0),re(he,Se,kr,"±","\\pm",!0),re(he,Se,kr,"×","\\times",!0),re(he,Se,kr,"∩","\\cap",!0),re(he,Se,kr,"∪","\\cup",!0),re(he,Se,kr,"∖","\\setminus",!0),re(he,Se,kr,"∧","\\land"),re(he,Se,kr,"∨","\\lor"),re(he,Se,kr,"∧","\\wedge",!0),re(he,Se,kr,"∨","\\vee",!0),re(he,Se,Je,"√","\\surd"),re(he,Se,lf,"⟨","\\langle",!0),re(he,Se,lf,"∣","\\lvert"),re(he,Se,lf,"∥","\\lVert"),re(he,Se,Xu,"?","?"),re(he,Se,Xu,"!","!"),re(he,Se,Xu,"⟩","\\rangle",!0),re(he,Se,Xu,"∣","\\rvert"),re(he,Se,Xu,"∥","\\rVert"),re(he,Se,Xe,"=","="),re(he,Se,Xe,":",":"),re(he,Se,Xe,"≈","\\approx",!0),re(he,Se,Xe,"≅","\\cong",!0),re(he,Se,Xe,"≥","\\ge"),re(he,Se,Xe,"≥","\\geq",!0),re(he,Se,Xe,"←","\\gets"),re(he,Se,Xe,">","\\gt",!0),re(he,Se,Xe,"∈","\\in",!0),re(he,Se,Xe,"","\\@not"),re(he,Se,Xe,"⊂","\\subset",!0),re(he,Se,Xe,"⊃","\\supset",!0),re(he,Se,Xe,"⊆","\\subseteq",!0),re(he,Se,Xe,"⊇","\\supseteq",!0),re(he,qe,Xe,"⊈","\\nsubseteq",!0),re(he,qe,Xe,"⊉","\\nsupseteq",!0),re(he,Se,Xe,"⊨","\\models"),re(he,Se,Xe,"←","\\leftarrow",!0),re(he,Se,Xe,"≤","\\le"),re(he,Se,Xe,"≤","\\leq",!0),re(he,Se,Xe,"<","\\lt",!0),re(he,Se,Xe,"→","\\rightarrow",!0),re(he,Se,Xe,"→","\\to"),re(he,qe,Xe,"≱","\\ngeq",!0),re(he,qe,Xe,"≰","\\nleq",!0),re(he,Se,M1," ","\\ "),re(he,Se,M1," ","\\space"),re(he,Se,M1," ","\\nobreakspace"),re(zt,Se,M1," ","\\ "),re(zt,Se,M1," "," "),re(zt,Se,M1," ","\\space"),re(zt,Se,M1," ","\\nobreakspace"),re(he,Se,M1,"","\\nobreak"),re(he,Se,M1,"","\\allowbreak"),re(he,Se,bF,",",","),re(he,Se,bF,";",";"),re(he,qe,kr,"⊼","\\barwedge",!0),re(he,qe,kr,"⊻","\\veebar",!0),re(he,Se,kr,"⊙","\\odot",!0),re(he,Se,kr,"⊕","\\oplus",!0),re(he,Se,kr,"⊗","\\otimes",!0),re(he,Se,Je,"∂","\\partial",!0),re(he,Se,kr,"⊘","\\oslash",!0),re(he,qe,kr,"⊚","\\circledcirc",!0),re(he,qe,kr,"⊡","\\boxdot",!0),re(he,Se,kr,"△","\\bigtriangleup"),re(he,Se,kr,"▽","\\bigtriangledown"),re(he,Se,kr,"†","\\dagger"),re(he,Se,kr,"⋄","\\diamond"),re(he,Se,kr,"⋆","\\star"),re(he,Se,kr,"◃","\\triangleleft"),re(he,Se,kr,"▹","\\triangleright"),re(he,Se,lf,"{","\\{"),re(zt,Se,Je,"{","\\{"),re(zt,Se,Je,"{","\\textbraceleft"),re(he,Se,Xu,"}","\\}"),re(zt,Se,Je,"}","\\}"),re(zt,Se,Je,"}","\\textbraceright"),re(he,Se,lf,"{","\\lbrace"),re(he,Se,Xu,"}","\\rbrace"),re(he,Se,lf,"[","\\lbrack",!0),re(zt,Se,Je,"[","\\lbrack",!0),re(he,Se,Xu,"]","\\rbrack",!0),re(zt,Se,Je,"]","\\rbrack",!0),re(he,Se,lf,"(","\\lparen",!0),re(he,Se,Xu,")","\\rparen",!0),re(zt,Se,Je,"<","\\textless",!0),re(zt,Se,Je,">","\\textgreater",!0),re(he,Se,lf,"⌊","\\lfloor",!0),re(he,Se,Xu,"⌋","\\rfloor",!0),re(he,Se,lf,"⌈","\\lceil",!0),re(he,Se,Xu,"⌉","\\rceil",!0),re(he,Se,Je,"\\","\\backslash"),re(he,Se,Je,"∣","|"),re(he,Se,Je,"∣","\\vert"),re(zt,Se,Je,"|","\\textbar",!0),re(he,Se,Je,"∥","\\|"),re(he,Se,Je,"∥","\\Vert"),re(zt,Se,Je,"∥","\\textbardbl"),re(zt,Se,Je,"~","\\textasciitilde"),re(zt,Se,Je,"\\","\\textbackslash"),re(zt,Se,Je,"^","\\textasciicircum"),re(he,Se,Xe,"↑","\\uparrow",!0),re(he,Se,Xe,"⇑","\\Uparrow",!0),re(he,Se,Xe,"↓","\\downarrow",!0),re(he,Se,Xe,"⇓","\\Downarrow",!0),re(he,Se,Xe,"↕","\\updownarrow",!0),re(he,Se,Xe,"⇕","\\Updownarrow",!0),re(he,Se,Qs,"∐","\\coprod"),re(he,Se,Qs,"⋁","\\bigvee"),re(he,Se,Qs,"⋀","\\bigwedge"),re(he,Se,Qs,"⨄","\\biguplus"),re(he,Se,Qs,"⋂","\\bigcap"),re(he,Se,Qs,"⋃","\\bigcup"),re(he,Se,Qs,"∫","\\int"),re(he,Se,Qs,"∫","\\intop"),re(he,Se,Qs,"∬","\\iint"),re(he,Se,Qs,"∭","\\iiint"),re(he,Se,Qs,"∏","\\prod"),re(he,Se,Qs,"∑","\\sum"),re(he,Se,Qs,"⨂","\\bigotimes"),re(he,Se,Qs,"⨁","\\bigoplus"),re(he,Se,Qs,"⨀","\\bigodot"),re(he,Se,Qs,"∮","\\oint"),re(he,Se,Qs,"∯","\\oiint"),re(he,Se,Qs,"∰","\\oiiint"),re(he,Se,Qs,"⨆","\\bigsqcup"),re(he,Se,Qs,"∫","\\smallint"),re(zt,Se,S4,"…","\\textellipsis"),re(he,Se,S4,"…","\\mathellipsis"),re(zt,Se,S4,"…","\\ldots",!0),re(he,Se,S4,"…","\\ldots",!0),re(he,Se,S4,"⋯","\\@cdots",!0),re(he,Se,S4,"⋱","\\ddots",!0),re(he,Se,Je,"⋮","\\varvdots"),re(zt,Se,Je,"⋮","\\varvdots"),re(he,Se,To,"ˊ","\\acute"),re(he,Se,To,"ˋ","\\grave"),re(he,Se,To,"¨","\\ddot"),re(he,Se,To,"~","\\tilde"),re(he,Se,To,"ˉ","\\bar"),re(he,Se,To,"˘","\\breve"),re(he,Se,To,"ˇ","\\check"),re(he,Se,To,"^","\\hat"),re(he,Se,To,"⃗","\\vec"),re(he,Se,To,"˙","\\dot"),re(he,Se,To,"˚","\\mathring"),re(he,Se,sn,"","\\@imath"),re(he,Se,sn,"","\\@jmath"),re(he,Se,Je,"ı","ı"),re(he,Se,Je,"ȷ","ȷ"),re(zt,Se,Je,"ı","\\i",!0),re(zt,Se,Je,"ȷ","\\j",!0),re(zt,Se,Je,"ß","\\ss",!0),re(zt,Se,Je,"æ","\\ae",!0),re(zt,Se,Je,"œ","\\oe",!0),re(zt,Se,Je,"ø","\\o",!0),re(zt,Se,Je,"Æ","\\AE",!0),re(zt,Se,Je,"Œ","\\OE",!0),re(zt,Se,Je,"Ø","\\O",!0),re(zt,Se,To,"ˊ","\\'"),re(zt,Se,To,"ˋ","\\`"),re(zt,Se,To,"ˆ","\\^"),re(zt,Se,To,"˜","\\~"),re(zt,Se,To,"ˉ","\\="),re(zt,Se,To,"˘","\\u"),re(zt,Se,To,"˙","\\."),re(zt,Se,To,"¸","\\c"),re(zt,Se,To,"˚","\\r"),re(zt,Se,To,"ˇ","\\v"),re(zt,Se,To,"¨",'\\"'),re(zt,Se,To,"˝","\\H"),re(zt,Se,To,"◯","\\textcircled");var $It={"--":!0,"---":!0,"``":!0,"''":!0};re(zt,Se,Je,"–","--",!0),re(zt,Se,Je,"–","\\textendash"),re(zt,Se,Je,"—","---",!0),re(zt,Se,Je,"—","\\textemdash"),re(zt,Se,Je,"‘","`",!0),re(zt,Se,Je,"‘","\\textquoteleft"),re(zt,Se,Je,"’","'",!0),re(zt,Se,Je,"’","\\textquoteright"),re(zt,Se,Je,"“","``",!0),re(zt,Se,Je,"“","\\textquotedblleft"),re(zt,Se,Je,"”","''",!0),re(zt,Se,Je,"”","\\textquotedblright"),re(he,Se,Je,"°","\\degree",!0),re(zt,Se,Je,"°","\\degree"),re(zt,Se,Je,"°","\\textdegree",!0),re(he,Se,Je,"£","\\pounds"),re(he,Se,Je,"£","\\mathsterling",!0),re(zt,Se,Je,"£","\\pounds"),re(zt,Se,Je,"£","\\textsterling",!0),re(he,qe,Je,"✠","\\maltese"),re(zt,qe,Je,"✠","\\maltese");for(var FIt='0123456789/@."',XSe=0;XSe{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 jIt[i]}else if(120782<=n&&n<=120831){var a=Math.floor((n-120782)/10);return d_n[a]}else{if(n===120485||n===120486)return jIt[0];if(120486{if(z2(t.classes)!==z2(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},XIt=t=>{for(var e=0;er&&(r=o.height),o.depth>n&&(n=o.depth),o.maxFontSize>i&&(i=o.maxFontSize)}e.height=r,e.depth=n,e.maxFontSize=i},Yt=function(e,r,n,i){var a=new A4(e,r,n,i);return oTe(a),a},Q2=(t,e,r,n)=>new A4(t,e,r,n),T4=function(e,r,n){var i=Yt([e],[],r);return i.height=Math.max(n||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),i.style.borderBottomWidth=ir(i.height),i.maxFontSize=1,i},m_n=function(e,r,n,i){var a=new aJ(e,r,n,i);return oTe(a),a},I1=function(e){var r=new w4(e);return oTe(r),r},C4=function(e,r){return e instanceof w4?Yt([],[e],r):e},v_n=function(e){if(e.positionType==="individualShift"){for(var r=e.children,n=[r[0]],i=-r[0].shift-r[0].elem.depth,a=i,o=1;o{var r=Yt(["mspace"],[],e),n=Lo(t,e);return r.style.marginRight=ir(n),r},dJ=(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},sTe={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"}},ZIt={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},JIt=function(e,r){var[n,i,a]=ZIt[e],o=new U2(n),s=new L1([o],{width:ir(i),height:ir(a),style:"width:"+ir(i),viewBox:"0 0 "+1e3*i+" "+1e3*a,preserveAspectRatio:"xMinYMin"}),l=Q2(["overlay"],[s],r);return l.height=a,l.style.height=ir(a),l.style.width=ir(i),l},Mo={number:3,unit:"mu"},kC={number:4,unit:"mu"},P1={number:5,unit:"mu"},y_n={mord:{mop:Mo,mbin:kC,mrel:P1,minner:Mo},mop:{mord:Mo,mop:Mo,mrel:P1,minner:Mo},mbin:{mord:kC,mop:kC,mopen:kC,minner:kC},mrel:{mord:P1,mop:P1,mopen:P1,minner:P1},mopen:{},mclose:{mop:Mo,mbin:kC,mrel:P1,minner:Mo},mpunct:{mord:Mo,mop:Mo,mrel:P1,mopen:Mo,mclose:Mo,mpunct:Mo,minner:Mo},minner:{mord:Mo,mop:Mo,mbin:kC,mrel:P1,mopen:Mo,mpunct:Mo,minner:Mo}},b_n={mord:{mop:Mo},mop:{mord:Mo,mop:Mo},mbin:{},mrel:{},mopen:{},mclose:{mop:Mo},mpunct:{},minner:{mop:Mo}},ePt={},fJ={},pJ={};function xr(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:o}=t,s={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"&&w_n.has(y)?m.classes[0]="mord":y==="mbin"&&x_n.has(v)&&(g.classes[0]="mord")},{node:d},f,p),lTe(a,(g,m)=>{var v,y,b=uTe(m),x=uTe(g),w=b&&x?g.hasClass("mtight")?(v=b_n[b])==null?void 0:v[x]:(y=y_n[b])==null?void 0:y[x]:null;if(w)return KIt(w,u)},{node:d},f,p),a},lTe=function(e,r,n,i,a){i&&e.push(i);for(var o=0;of=>{e.splice(d+1,0,f),o++})(o)}i&&e.pop()},tPt=function(e){return e instanceof w4||e instanceof aJ||e instanceof A4&&e.hasClass("enclosing")?e:null},cTe=function(e,r){var n=tPt(e);if(n){var i=n.children;if(i.length){if(r==="right")return cTe(i[i.length-1],"right");if(r==="left")return cTe(i[0],"left")}}return e},uTe=function(e,r){if(!e)return null;r&&(e=cTe(e,r));var n=e.classes[0];return S_n[n]||null},xF=function(e,r){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Yt(r.concat(n))},Ji=function(e,r,n){if(!e)return Yt();if(fJ[e.type]){var i=fJ[e.type](e,r);if(n&&r.size!==n.size){i=Yt(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 mJ(t,e){var r=Yt(["base"],t,e),n=Yt(["strut"]);return n.style.height=ir(r.height+r.depth),r.depth&&(n.style.verticalAlign=ir(-r.depth)),r.children.unshift(n),r}function hTe(t,e){var r=null;t.length===1&&t[0].type==="tag"&&(r=t[0].tag,t=t[0].body);var n=hl(t,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var a=[],o=[],s=0;s0&&(a.push(mJ(o,e)),o=[]),a.push(n[s]));o.length>0&&a.push(mJ(o,e));var u;r?(u=mJ(hl(r,e,!0),e),u.classes=["tag"],a.push(u)):i&&a.push(i);var h=Yt(["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 rPt(t){return new w4(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=z2(this.classes));for(var n=0;n0&&(e+=' class ="'+uu(z2(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Hs{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return uu(this.toText())}toText(){return this.text}}class nPt{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 T_n=new Set(["\\imath","\\jmath"]),C_n=new Set(["mrow","mtable"]),kp=function(e,r,n){return So[r][e]&&So[r][e].replace&&e.charCodeAt(0)!==55349&&!($It.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=So[r][e].replace),new Hs(e)},dTe=function(e){return e.length===1?e[0]:new tr("mrow",e)},O_n={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"},fTe=(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=O_n[r];if(i)return typeof i=="function"?i(t):i;var a=t.text;if(T_n.has(a))return null;if(So[n][a]){var o=So[n][a].replace;o&&(a=o)}var s=sTe[r].fontName;return qSe(a,s,n)?sTe[r].variant:null};function pTe(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof Hs&&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 Hs&&r.text===","}else return!1}var cf=function(e,r,n){if(e.length===1){var i=La(e[0],r);return n&&i instanceof tr&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var a=[],o,s=0;s=1&&(o.type==="mn"||pTe(o))){var u=l.children[0];u instanceof tr&&u.type==="mn"&&(u.children=[...o.children,...u.children],a.pop())}else if(o.type==="mi"&&o.children.length===1){var h=o.children[0];if(h instanceof Hs&&h.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof Hs&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),a.pop())}}}a.push(l),o=l}return a},G2=function(e,r,n){return dTe(cf(e,r,n))},La=function(e,r){if(!e)return new tr("mrow");if(pJ[e.type])return pJ[e.type](e,r);throw new Zt("Got group of unknown type: '"+e.type+"'")};function iPt(t,e,r,n,i){var a=cf(t,r),o;a.length===1&&a[0]instanceof tr&&C_n.has(a[0].type)?o=a[0]:o=new tr("mrow",a);var s=new tr("annotation",[new Hs(e)]);s.setAttribute("encoding","application/x-tex");var l=new tr("semantics",[o,s]),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 Yt([h],[u])}var k_n=[[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]],aPt=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],oPt=function(e,r){return r.size<2?e:k_n[e-1][r.size-1]};class N1{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||N1.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=aPt[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 N1(r)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:oPt(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:aPt[e-1]})}havingBaseStyle(e){e=e||this.style.text();var r=oPt(N1.BASESIZE,e);return this.size===r&&this.textSize===N1.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!==N1.BASESIZE?["sizing","reset-size"+this.size,"size"+N1.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=u_n(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}N1.BASESIZE=6;var sPt=function(e){return new N1({style:e.displayMode?Nn.DISPLAY:Nn.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},lPt=function(e,r){if(r.displayMode){var n=["katex-display"];r.leqno&&n.push("leqno"),r.fleqn&&n.push("fleqn"),e=Yt(n,[e])}return e},E_n=function(e,r,n){var i=sPt(n),a;if(n.output==="mathml")return iPt(e,r,i,n.displayMode,!0);if(n.output==="html"){var o=hTe(e,i);a=Yt(["katex"],[o])}else{var s=iPt(e,r,i,n.displayMode,!1),l=hTe(e,i);a=Yt(["katex"],[s,l])}return lPt(a,n)},__n=function(e,r,n){var i=sPt(n),a=hTe(e,i),o=Yt(["katex"],[a]);return lPt(o,n)},R_n={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":"="},vJ=function(e){var r=new tr("mo",[new Hs(R_n[e.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},D_n={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]},L_n=new Set(["widehat","widecheck","widetilde","utilde"]),yJ=function(e,r){function n(){var s=4e5,l=e.label.slice(1);if(L_n.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,s=2364,f=.42,d=l+"4"):(h=312,s=2340,f=.34,d="tilde4");else{var p=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(s=[0,1062,2364,2364,2364][p],h=[0,239,300,360,420][p],f=[0,.24,.3,.3,.36,.42][p],d=l+p):(s=[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 U2(d),m=new L1([g],{width:"100%",height:ir(f),viewBox:"0 0 "+s+" "+h,preserveAspectRatio:"none"});return{span:Q2([],[m],r),minWidth:0,height:f}}else{var v=[],y=D_n[l];if(!y)throw new Error('No SVG data for "'+l+'".');var[b,x,w]=y,A=w/1e3,S=b.length,T,C;if(S===1){if(y.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+l+'".');T=["hide-tail"],C=[y[3]]}else if(S===2)T=["halfarrow-left","halfarrow-right"],C=["xMinYMin","xMaxYMin"];else if(S===3)T=["brace-left","brace-center","brace-right"],C=["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},M_n=function(e,r,n,i,a){var o,s=e.height+e.depth+n+i;if(/fbox|color|angl/.test(r)){if(o=Yt(["stretchy",r],[],a),r==="fbox"){var l=a.color&&a.getColor();l&&(o.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(r)&&u.push(new YSe({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&u.push(new YSe({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new L1(u,{width:"100%",height:ir(s)});o=Q2([],[h],a)}return o.height=s,o.style.height=ir(s),o},I_n={bin:1,close:1,inner:1,open:1,punct:1,rel:1},P_n={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function N_n(t){return t in I_n}function jn(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 bJ(t){var e=xJ(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 xJ(t){return t&&(t.type==="atom"||P_n.hasOwnProperty(t.type))?t:null}var cPt=t=>{if(t instanceof sf)return t;if(c_n(t)&&t.children.length===1)return cPt(t.children[0])},gTe=(t,e)=>{var r,n,i;t&&t.type==="supsub"?(n=jn(t.base,"accent"),r=n.base,t.base=r,i=l_n(Ji(t,e)),t.base=n):(n=jn(t,"accent"),r=n.base);var a=Ji(r,e.havingCrampedStyle()),o=n.isShifty&&R1(r),s=0;if(o){var l,u;s=(l=(u=cPt(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=yJ(n,e),f=Zi({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:s>0?{width:"calc(100% - "+ir(2*s)+")",marginLeft:ir(2*s)}:void 0}]});else{var p,g;n.label==="\\vec"?(p=JIt("vec",e),g=ZIt.vec[1]):(p=hJ({mode:n.mode,text:n.label},e,"textord"),p=s_n(p),p.italic=0,g=p.width,h&&(d+=p.depth)),f=Yt(["accent-body"],[p]);var m=n.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=a.height);var v=s;m||(v-=g/2),f.style.left=ir(v),n.label==="\\textcircled"&&(f.style.top=".2em"),f=Zi({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:-d},{type:"elem",elem:f}]})}var y=Yt(["mord","accent"],[f],e);return i?(i.children[0]=y,i.height=Math.max(y.height,i.height),i.classes[0]="mord",i):y},uPt=(t,e)=>{var r=t.isStretchy?vJ(t.label):new tr("mo",[kp(t.label,t.mode)]),n=new tr("mover",[La(t.base,e),r]);return n.setAttribute("accent","true"),n},B_n=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=gJ(e[0]),n=!B_n.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:gTe,mathmlBuilder:uPt}),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:gTe,mathmlBuilder:uPt}),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=Ji(t.base,e),n=yJ(t,e),i=t.label==="\\utilde"?.12:0,a=Zi({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:r}]});return Yt(["mord","accentunder"],[a],e)},mathmlBuilder:(t,e)=>{var r=vJ(t.label),n=new tr("munder",[La(t.base,e),r]);return n.setAttribute("accentunder","true"),n}});var wJ=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=C4(Ji(t.body,n,e),e),a=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(a+"-arrow-pad");var o;t.below&&(n=e.havingStyle(r.sub()),o=C4(Ji(t.below,n,e),e),o.classes.push(a+"-arrow-pad"));var s=yJ(t,e),l=-e.fontMetrics().axisHeight+.5*s.height,u=-e.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(u-=i.depth);var h;if(o){var d=-e.fontMetrics().axisHeight+o.height+.5*s.height+.111;h=Zi({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:s,shift:l,wrapperClasses:["svg-align"]},{type:"elem",elem:o,shift:d}]})}else h=Zi({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:s,shift:l,wrapperClasses:["svg-align"]}]});return Yt(["mrel","x-arrow"],[h],e)},mathmlBuilder(t,e){var r=vJ(t.label);r.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(t.body){var i=wJ(La(t.body,e));if(t.below){var a=wJ(La(t.below,e));n=new tr("munderover",[r,a,i])}else n=new tr("mover",[r,i])}else if(t.below){var o=wJ(La(t.below,e));n=new tr("munder",[r,o])}else n=wJ(),n=new tr("mover",[r,n]);return n}});function hPt(t,e){var r=hl(t.body,e,!0);return Yt([t.mclass],r,e)}function dPt(t,e){var r,n=cf(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:Gs(i),isCharacterBox:R1(i)}},htmlBuilder:hPt,mathmlBuilder:dPt});var AJ=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:AJ(e[0]),body:Gs(e[1]),isCharacterBox:R1(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],o;n!=="\\stackrel"?o=AJ(i):o="mrel";var s={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Gs(i)},l={type:"supsub",mode:a.mode,base:s,sup:n==="\\underset"?null:a,sub:n==="\\underset"?a:null};return{type:"mclass",mode:r.mode,mclass:o,body:[l],isCharacterBox:R1(l)}},htmlBuilder:hPt,mathmlBuilder:dPt}),xr({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:r}=t;return{type:"pmb",mode:r.mode,mclass:AJ(e[0]),body:Gs(e[0])}},htmlBuilder(t,e){var r=hl(t.body,e,!0),n=Yt([t.mclass],r,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(t,e){var r=cf(t.body,e),n=new tr("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var $_n={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},fPt=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),pPt=t=>t.type==="textord"&&t.text==="@",F_n=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function z_n(t,e,r){var n=$_n[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"},o=r.callFunction("\\Big",[a],[]),s=r.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,o,s]};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 U_n(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 @',o[l]);var g=z_n(u,h,t),m={type:"styling",body:[g],mode:"math",style:"display",resetFont:!0};n.push(m),s=fPt()}a%2===0?n.push(s):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=C4(Ji(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",[La(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=C4(Ji(t.fragment,e),e);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(t,e){return new tr("mrow",[La(t.fragment,e)])}}),xr({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:r}=t,n=jn(e[0],"ordgroup"),i=n.body,a="",o=0;o=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 gPt=(t,e)=>{var r=hl(t.body,e.withColor(t.color),!1);return I1(r)},mPt=(t,e)=>{var r=cf(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=jn(e[0],"color-token").color,i=e[1];return{type:"color",mode:r.mode,color:n,body:Gs(i)}},htmlBuilder:gPt,mathmlBuilder:mPt}),xr({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:r,breakOnTokenText:n}=t,i=jn(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:gPt,mathmlBuilder:mPt}),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&&jn(i,"size").value}},htmlBuilder(t,e){var r=Yt(["mspace"],[],e);return t.newLine&&(r.classes.push("newline"),t.size&&(r.style.marginTop=ir(Lo(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(Lo(t.size,e)))),r}});var mTe={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},vPt=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new Zt("Expected a control sequence",t);return e},V_n=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},yPt=(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(mTe[n.text])return(r==="\\global"||r==="\\\\globallong")&&(n.text=mTe[n.text]),jn(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,o,s=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){o=e.gullet.future(),s[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++,s.push([])}else{if(n.text==="EOF")throw new Zt("Expected a macro definition");s[a].push(n.text)}var{tokens:l}=e.gullet.consumeArg();return o&&l.unshift(o),(r==="\\edef"||r==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:a,delimiters:s},r===mTe[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=vPt(e.gullet.popToken());e.gullet.consumeSpaces();var i=V_n(e);return yPt(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=vPt(e.gullet.popToken()),i=e.gullet.popToken(),a=e.gullet.popToken();return yPt(e,n,a,r==="\\\\globalfuture"),e.gullet.pushToken(a),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var wF=function(e,r,n){var i=So.math[e]&&So.math[e].replace,a=qSe(i||e,r,n);if(!a)throw new Error("Unsupported symbol "+e+" and font size "+r+".");return a},vTe=function(e,r,n,i){var a=n.havingBaseStyle(r),o=Yt(i.concat(a.sizingClasses(n)),[e],n),s=a.sizeMultiplier/n.sizeMultiplier;return o.height*=s,o.depth*=s,o.maxFontSize=a.sizeMultiplier,o},bPt=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},Q_n=function(e,r,n,i,a,o){var s=Zu(e,"Main-Regular",a,i),l=vTe(s,r,i,o);return bPt(l,i,r),l},G_n=function(e,r,n,i){return Zu(e,"Size"+r+"-Regular",n,i)},xPt=function(e,r,n,i,a,o){var s=G_n(e,r,a,i),l=vTe(Yt(["delimsizing","size"+r],[s],i),Nn.TEXT,i,o);return n&&bPt(l,i,Nn.TEXT),l},yTe=function(e,r,n){var i;r==="Size1-Regular"?i="delim-size1":i="delim-size4";var a=Yt(["delimsizinginner",i],[Yt([],[Zu(e,r,n)])]);return{type:"elem",elem:a}},bTe=function(e,r,n){var i=z0["Size4-Regular"][e.charCodeAt(0)]?z0["Size4-Regular"][e.charCodeAt(0)][4]:z0["Size1-Regular"][e.charCodeAt(0)][4],a=new U2("inner",e_n(e,Math.round(1e3*r))),o=new L1([a],{width:ir(i),height:ir(r),style:"width:"+ir(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),s=Q2([],[o],n);return s.height=r,s.style.height=ir(r),s.style.width=ir(i),{type:"elem",elem:s}},xTe=.008,SJ={type:"kern",size:-1*xTe},H_n=new Set(["|","\\lvert","\\rvert","\\vert"]),W_n=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),wPt=function(e,r,n,i,a,o){var s,l,u,h,d="",f=0;s=u=h=e,l=null;var p="Size1-Regular";e==="\\uparrow"?u=h="⏐":e==="\\Uparrow"?u=h="‖":e==="\\downarrow"?s=u="⏐":e==="\\Downarrow"?s=u="‖":e==="\\updownarrow"?(s="\\uparrow",u="⏐",h="\\downarrow"):e==="\\Updownarrow"?(s="\\Uparrow",u="‖",h="\\Downarrow"):H_n.has(e)?(u="∣",d="vert",f=333):W_n.has(e)?(u="∥",d="doublevert",f=556):e==="["||e==="\\lbrack"?(s="⎡",u="⎢",h="⎣",p="Size4-Regular",d="lbrack",f=667):e==="]"||e==="\\rbrack"?(s="⎤",u="⎥",h="⎦",p="Size4-Regular",d="rbrack",f=667):e==="\\lfloor"||e==="⌊"?(u=s="⎢",h="⎣",p="Size4-Regular",d="lfloor",f=667):e==="\\lceil"||e==="⌈"?(s="⎡",u=h="⎢",p="Size4-Regular",d="lceil",f=667):e==="\\rfloor"||e==="⌋"?(u=s="⎥",h="⎦",p="Size4-Regular",d="rfloor",f=667):e==="\\rceil"||e==="⌉"?(s="⎤",u=h="⎥",p="Size4-Regular",d="rceil",f=667):e==="("||e==="\\lparen"?(s="⎛",u="⎜",h="⎝",p="Size4-Regular",d="lparen",f=875):e===")"||e==="\\rparen"?(s="⎞",u="⎟",h="⎠",p="Size4-Regular",d="rparen",f=875):e==="\\{"||e==="\\lbrace"?(s="⎧",l="⎨",h="⎩",u="⎪",p="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(s="⎫",l="⎬",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(s="⎧",h="⎩",u="⎪",p="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(s="⎫",h="⎭",u="⎪",p="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(s="⎧",h="⎭",u="⎪",p="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(s="⎫",h="⎩",u="⎪",p="Size4-Regular");var g=wF(s,p,a),m=g.height+g.depth,v=wF(u,p,a),y=v.height+v.depth,b=wF(h,p,a),x=b.height+b.depth,w=0,A=1;if(l!==null){var S=wF(l,p,a);w=S.height+S.depth,A=2}var T=m+x+w,C=Math.max(0,Math.ceil((r-T)/(A*y))),k=T+C*A*y,E=i.fontMetrics().axisHeight;n&&(E*=i.sizeMultiplier);var _=k/2-E,P=[];if(d.length>0){var L=k-m-x,R=Math.round(k*1e3),D=t_n(d,Math.round(L*1e3)),M=new U2(d,D),I=ir(f/1e3),N=ir(R/1e3),F=new L1([M],{width:I,height:N,viewBox:"0 0 "+f+" "+R}),B=Q2([],[F],i);B.height=R/1e3,B.style.width=I,B.style.height=N,P.push({type:"elem",elem:B})}else{if(P.push(yTe(h,p,a)),P.push(SJ),l===null){var V=k-m-x+2*xTe;P.push(bTe(u,V,i))}else{var z=(k-m-x-w)/2+2*xTe;P.push(bTe(u,z,i)),P.push(SJ),P.push(yTe(l,p,a)),P.push(SJ),P.push(bTe(u,z,i))}P.push(SJ),P.push(yTe(s,p,a))}var U=i.havingBaseStyle(Nn.TEXT),Q=Zi({positionType:"bottom",positionData:_,children:P});return vTe(Yt(["delimsizing","mult"],[Q],U),Nn.TEXT,i,o)},wTe=80,ATe=.08,STe=function(e,r,n,i,a){var o=JEn(e,i,n),s=new U2(e,o),l=new L1([s],{width:"400em",height:ir(r),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Q2(["hide-tail"],[l],a)},Y_n=function(e,r){var n=r.havingBaseSizing(),i=OPt("\\surd",e*n.sizeMultiplier,CPt,n),a=n.sizeMultiplier,o=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),s,l,u,h,d;return i.type==="small"?(h=1e3+1e3*o+wTe,e<1?a=1:e<1.4&&(a=.7),l=(1+o+ATe)/a,u=(1+o)/a,s=STe("sqrtMain",l,h,o,r),s.style.minWidth="0.853em",d=.833/a):i.type==="large"?(h=(1e3+wTe)*AF[i.size],u=(AF[i.size]+o)/a,l=(AF[i.size]+o+ATe)/a,s=STe("sqrtSize"+i.size,l,h,o,r),s.style.minWidth="1.02em",d=1/a):(l=e+o+ATe,u=e+o,h=Math.floor(1e3*e+o)+wTe,s=STe("sqrtTall",l,h,o,r),s.style.minWidth="0.742em",d=1.056),s.height=u,s.style.height=ir(l),{span:s,advanceWidth:d,ruleWidth:(r.fontMetrics().sqrtRuleThickness+o)*a}},APt=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),q_n=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),SPt=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),AF=[0,1.2,1.8,2.4,3],TPt=function(e,r,n,i,a){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),APt.has(e)||SPt.has(e))return xPt(e,r,!1,n,i,a);if(q_n.has(e))return wPt(e,AF[r],!1,n,i,a);throw new Zt("Illegal delimiter: '"+e+"'")},j_n=[{type:"small",style:Nn.SCRIPTSCRIPT},{type:"small",style:Nn.SCRIPT},{type:"small",style:Nn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],X_n=[{type:"small",style:Nn.SCRIPTSCRIPT},{type:"small",style:Nn.SCRIPT},{type:"small",style:Nn.TEXT},{type:"stack"}],CPt=[{type:"small",style:Nn.SCRIPTSCRIPT},{type:"small",style:Nn.SCRIPT},{type:"small",style:Nn.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],K_n=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.")},OPt=function(e,r,n,i){for(var a=Math.min(2,3-i.style.size),o=a;or)return s}return n[n.length-1]},TTe=function(e,r,n,i,a,o){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var s;SPt.has(e)?s=j_n:APt.has(e)?s=CPt:s=X_n;var l=OPt(e,r,s,i);return l.type==="small"?Q_n(e,l.style,n,i,a,o):l.type==="large"?xPt(e,l.size,n,i,a,o):wPt(e,r,n,i,a,o)},CTe=function(e,r,n,i,a,o){var s=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,u=5/i.fontMetrics().ptPerEm,h=Math.max(r-s,n+s),d=Math.max(h/500*l,2*h-u);return TTe(e,d,!0,i,a,o)},kPt={"\\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}},Z_n=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 EPt(t){return"isMiddle"in t}function TJ(t,e){var r=xJ(t);if(r&&Z_n.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=TJ(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:kPt[t.funcName].size,mclass:kPt[t.funcName].mclass,delim:r.text}},htmlBuilder:(t,e)=>t.delim==="."?Yt([t.mclass]):TPt(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(kp(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(AF[t.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}});function _Pt(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:TJ(e[0],t).text,color:r}}}),xr({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=TJ(e[0],t),n=t.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var a=jn(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:r.text,right:a.delim,rightColor:a.color}},htmlBuilder:(t,e)=>{_Pt(t);for(var r=hl(t.body,e,!0,["mopen","mclose"]),n=0,i=0,a=!1,o=0;o{_Pt(t);var r=cf(t.body,e);if(t.left!=="."){var n=new tr("mo",[kp(t.left,t.mode)]);n.setAttribute("fence","true"),r.unshift(n)}if(t.right!=="."){var i=new tr("mo",[kp(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),r.push(i)}return dTe(r)}}),xr({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var r=TJ(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=xF(e,[]):(r=TPt(t.delim,1,e,t.mode,[]),r.isMiddle={delim:t.delim,options:e}),r},mathmlBuilder:(t,e)=>{var r=t.delim==="\\vert"||t.delim==="|"?kp("|","text"):kp(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 CJ=(t,e)=>{var r=C4(Ji(t.body,e),e),n=t.label.slice(1),i=e.sizeMultiplier,a,o,s=R1(t.body);if(n==="sout")a=Yt(["stretchy","sout"]),a.height=e.fontMetrics().defaultRuleThickness/i,o=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var l=Lo({number:.6,unit:"pt"},e),u=Lo({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=KEn(f),g=new L1([new U2("phase",p)],{width:"400em",height:ir(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});a=Q2(["hide-tail"],[g],e),a.style.height=ir(d),o=r.depth+l+u}else{/cancel/.test(n)?s||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=s?.2:0,v=m),a=M_n(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)),o=r.depth+v,t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor,t.borderColor&&(a.style.borderColor=t.borderColor))}var b;if(t.backgroundColor)b=Zi({positionType:"individualShift",children:[{type:"elem",elem:a,shift:o},{type:"elem",elem:r,shift:0}]});else{var x=/cancel|phase/.test(n)?["svg-align"]:[];b=Zi({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:a,shift:o,wrapperClasses:x}]})}return/cancel/.test(n)&&(b.height=r.height,b.depth=r.depth),/cancel/.test(n)&&!s?Yt(["mord","cancel-lap"],[b],e):Yt(["mord"],[b],e)},OJ=(t,e)=>{var r,n=new tr(t.label.includes("colorbox")?"mpadded":"menclose",[La(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=jn(e[0],"color-token").color,o=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:CJ,mathmlBuilder:OJ}),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=jn(e[0],"color-token").color,o=jn(e[1],"color-token").color,s=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:o,borderColor:a,body:s}},htmlBuilder:CJ,mathmlBuilder:OJ}),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:CJ,mathmlBuilder:OJ}),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:CJ,mathmlBuilder:OJ}),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 RPt={};function U0(t){for(var{type:e,names:r,props:n,handler:i,htmlBuilder:a,mathmlBuilder:o}=t,s={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.")},J_n=new Set(["gather","gather*"]);function OTe(t){if(!t.includes("ed"))return!t.includes("*")}function H2(t,e,r){var{hskipBeforeAndAfter:n,addJot:i,cols:a,arraystretch:o,colSeparationType:s,autoTag:l,singleRow:u,emptySingleRow:h,maxNumCols:d,leqno:f}=e;if(t.gullet.beginGroup(),u||t.gullet.macros.set("\\cr","\\\\\\relax"),!o){var p=t.gullet.expandMacroAsText("\\arraystretch");if(p==null)o=1;else if(o=parseFloat(p),!o||o<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 uf("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):b.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(x(),y.push(LPt(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||s)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[ae]})}for(w(o[0]),n=0;n0&&(_+=b,T<_&&(T=_),_=0)),e.addJot&&nbe))for(n=0;n=s)){var X=void 0;if(i>0||e.hskipBeforeAndAfter){var J,ee;X=(J=(ee=U)==null?void 0:ee.pregap)!=null?J:f,X!==0&&(D=Yt(["arraycolsep"],[]),D.style.width=ir(X),R.push(D))}var te=[];for(n=0;n0){for(var ge=T4("hline",r,h),ze=T4("hdashline",r,h),we=[{type:"elem",elem:xe,shift:0}];u.length>0;){var Oe=u.pop(),Be=Oe.pos-P;Oe.isDashed?we.push({type:"elem",elem:ze,shift:Be}):we.push({type:"elem",elem:ge,shift:Be})}xe=Zi({positionType:"individualShift",children:we})}if(I.length===0)return Yt(["mord"],[xe],r);var Z=Zi({positionType:"individualShift",children:I}),le=Yt(["tag"],[Z],r);return I1([xe,le])},e5n={c:"center ",l:"left ",r:"right "},Q0=function(e,r){for(var n=[],i=new tr("mtd",[],["mtr-glue"]),a=new tr("mtd",[],["mml-eqn-num"]),o=0;o0){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 o.colSeparationType=p?"align":"alignat",o};U0({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var r=xJ(e[0]),n=r?[e[0]]:jn(e[0],"ordgroup").body,i=n.map(function(o){var s=bJ(o),l=s.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,o)}),a={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return H2(t.parser,a,kTe(t.envName))},htmlBuilder:V0,mathmlBuilder:Q0}),U0({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=H2(t.parser,n,kTe(t.envName)),o=Math.max(0,...a.body.map(s=>s.length));return a.cols=new Array(o).fill({type:"align",align:r}),e?{type:"leftright",mode:t.mode,body:[a],left:e[0],right:e[1],rightColor:void 0}:a},htmlBuilder:V0,mathmlBuilder:Q0}),U0({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},r=H2(t.parser,e,"script");return r.colSeparationType="small",r},htmlBuilder:V0,mathmlBuilder:Q0}),U0({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var r=xJ(e[0]),n=r?[e[0]]:jn(e[0],"ordgroup").body,i=n.map(function(s){var l=bJ(s),u=l.text;if("lc".includes(u))return{type:"align",align:u};throw new Zt("Unknown column alignment: "+u,s)});if(i.length>1)throw new Zt("{subarray} can contain only one column");var a={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5},o=H2(t.parser,a,"script");if(o.body.length>0&&o.body[0].length>1)throw new Zt("{subarray} can contain only one column");return o},htmlBuilder:V0,mathmlBuilder:Q0}),U0({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=H2(t.parser,e,kTe(t.envName));return{type:"leftright",mode:t.mode,body:[r],left:t.envName.includes("r")?".":"\\{",right:t.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:V0,mathmlBuilder:Q0}),U0({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:MPt,htmlBuilder:V0,mathmlBuilder:Q0}),U0({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){J_n.has(t.envName)&&kJ(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:OTe(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return H2(t.parser,e,"display")},htmlBuilder:V0,mathmlBuilder:Q0}),U0({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:MPt,htmlBuilder:V0,mathmlBuilder:Q0}),U0({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){kJ(t);var e={autoTag:OTe(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return H2(t.parser,e,"display")},htmlBuilder:V0,mathmlBuilder:Q0}),U0({type:"array",names:["CD"],props:{numArgs:0},handler(t){return kJ(t),U_n(t.parser)},htmlBuilder:V0,mathmlBuilder:Q0}),_e("\\nonumber","\\gdef\\@eqnsw{0}"),_e("\\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 IPt=RPt;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="",o=0;o{var r=t.font,n=e.withFont(r);return Ji(t.body,n)},NPt=(t,e)=>{var r=t.font,n=e.withFont(r);return La(t.body,n)},BPt={"\\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=gJ(e[0]),a=n;return a in BPt&&(a=BPt[a]),{type:"font",mode:r.mode,font:a.slice(1),body:i}},htmlBuilder:PPt,mathmlBuilder:NPt}),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:AJ(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:R1(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,o=r.parseExpression(!0,i);return{type:"font",mode:a,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:o}}},htmlBuilder:PPt,mathmlBuilder:NPt});var t5n=(t,e)=>{var r=e.style,n=r.fracNum(),i=r.fracDen(),a;a=e.havingStyle(n);var o=Ji(t.numer,a,e);if(t.continued){var s=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;o.height=o.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-o.depth-(b+.5*d){var r=new tr("mfrac",[La(t.numer,e),La(t.denom,e)]);if(!t.hasBarLine)r.setAttribute("linethickness","0px");else if(t.barSize){var n=Lo(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 Hs(t.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),i.push(a)}if(i.push(r),t.rightDelim!=null){var o=new tr("mo",[new Hs(t.rightDelim.replace("\\",""))]);o.setAttribute("fence","true"),i.push(o)}return dTe(i)}return r},$Pt=(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],o,s=null,l=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,s="(",l=")";break;case"\\\\bracefrac":o=!1,s="\\{",l="\\}";break;case"\\\\brackfrac":o=!1,s="[",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"),$Pt({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:u,hasBarLine:o,leftDelim:s,rightDelim:l,barSize:null},h)},htmlBuilder:t5n,mathmlBuilder:r5n}),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 FPt=["display","text","script","scriptscript"],zPt=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=gJ(e[0]),o=a.type==="atom"&&a.family==="open"?zPt(a.text):null,s=gJ(e[1]),l=s.type==="atom"&&s.family==="close"?zPt(s.text):null,u=jn(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=jn(p.body[0],"textord");f=FPt[Number(g.text)]}}else p=jn(p,"textord"),f=FPt[Number(p.text)];return $Pt({type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:h,barSize:d,leftDelim:o,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:jn(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=jn(e[1],"infix").size;if(!a)throw new Error("\\\\abovefrac expected size, but got "+String(a));var o=e[2],s=a.number>0;return{type:"genfrac",mode:r.mode,numer:i,denom:o,continued:!1,hasBarLine:s,barSize:a,leftDelim:null,rightDelim:null}}});var UPt=(t,e)=>{var r=e.style,n,i;t.type==="supsub"?(n=t.sup?Ji(t.sup,e.havingStyle(r.sup()),e):Ji(t.sub,e.havingStyle(r.sub()),e),i=jn(t.base,"horizBrace")):i=jn(t,"horizBrace");var a=Ji(i.base,e.havingBaseStyle(Nn.DISPLAY)),o=yJ(i,e),s;if(i.isOver?s=Zi({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:o,wrapperClasses:["svg-align"]}]}):s=Zi({positionType:"bottom",positionData:a.depth+.1+o.height,children:[{type:"elem",elem:o,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),n){var l=Yt(["minner",i.isOver?"mover":"munder"],[s],e);i.isOver?s=Zi({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):s=Zi({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return Yt(["minner",i.isOver?"mover":"munder"],[s],e)},n5n=(t,e)=>{var r=vJ(t.label);return new tr(t.isOver?"mover":"munder",[La(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:UPt,mathmlBuilder:n5n}),xr({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:r}=t,n=e[1],i=jn(e[0],"url").url;return r.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:r.mode,href:i,body:Gs(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var r=hl(t.body,e,!1);return m_n(t.href,[],r,e)},mathmlBuilder:(t,e)=>{var r=G2(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=jn(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=jn(e[0],"raw").string,o=e[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var s,l={};switch(n){case"\\htmlClass":l.class=a,s={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,s={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,s={command:"\\htmlStyle",style:a};break;case"\\htmlData":{for(var u=a.split(","),h=0;h{var r=hl(t.body,e,!1),n=["enclosing"];t.attributes.class&&n.push(...t.attributes.class.trim().split(/\s+/));var i=Yt(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)=>G2(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:Gs(e[0]),mathml:Gs(e[1])}},htmlBuilder:(t,e)=>{var r=hl(t.html,e,!1);return I1(r)},mathmlBuilder:(t,e)=>G2(t.mathml,e)});var ETe=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(!LIt(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"},o={number:0,unit:"em"},s="";if(r[0])for(var l=jn(r[0],"raw").string,u=l.split(","),h=0;h{var r=Lo(t.height,e),n=0;t.totalheight.number>0&&(n=Lo(t.totalheight,e)-r);var i=0;t.width.number>0&&(i=Lo(t.width,e));var a={height:ir(r+n)};i>0&&(a.width=ir(i)),n>0&&(a.verticalAlign=ir(-n));var o=new a_n(t.src,t.alt,a);return o.height=r,o.depth=n,o},mathmlBuilder:(t,e)=>{var r=new tr("mglyph",[]);r.setAttribute("alt",t.alt);var n=Lo(t.height,e),i=0;if(t.totalheight.number>0&&(i=Lo(t.totalheight,e)-n,r.setAttribute("valign",ir(-i))),r.setAttribute("height",ir(n+i)),t.width.number>0){var a=Lo(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=jn(e[0],"size");if(r.settings.strict){var a=n[1]==="m",o=i.value.unit==="mu";a?(o||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")):o&&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 KIt(t.dimension,e)},mathmlBuilder(t,e){var r=Lo(t.dimension,e);return new nPt(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=Yt([],[Ji(t.body,e)]),r=Yt(["inner"],[r],e)):r=Yt(["inner"],[Ji(t.body,e)]);var n=Yt(["fix"],[]),i=Yt([t.alignment],[r,n],e),a=Yt(["strut"]);return a.style.height=ir(i.height+i.depth),i.depth&&(a.style.verticalAlign=ir(-i.depth)),i.children.unshift(a),i=Yt(["thinbox"],[i],e),Yt(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var r=new tr("mpadded",[La(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==="\\("?"\\)":"$",o=n.parseExpression(!1,a);return n.expect(a),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",resetFont:!0,body:o}}}),xr({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new Zt("Mismatched "+t.funcName)}});var VPt=(t,e)=>{switch(e.style.size){case Nn.DISPLAY.size:return t.display;case Nn.TEXT.size:return t.text;case Nn.SCRIPT.size:return t.script;case Nn.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:Gs(e[0]),text:Gs(e[1]),script:Gs(e[2]),scriptscript:Gs(e[3])}},htmlBuilder:(t,e)=>{var r=VPt(t,e),n=hl(r,e,!1);return I1(n)},mathmlBuilder:(t,e)=>{var r=VPt(t,e);return G2(r,e)}});var QPt=(t,e,r,n,i,a,o)=>{t=Yt([],[t]);var s=r&&R1(r),l,u;if(e){var h=Ji(e,n.havingStyle(i.sup()),n);u={elem:h,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-h.depth)}}if(r){var d=Ji(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+o;f=Zi({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-o;f=Zi({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+o;f=Zi({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&&!s){var y=Yt(["mspace"],[],n);y.style.marginRight=ir(a),v.unshift(y)}return Yt(["mop","op-limits"],v,n)},GPt=new Set(["\\smallint"]),O4=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=jn(t.base,"op"),i=!0):a=jn(t,"op");var o=e.style,s=!1;o.size===Nn.DISPLAY.size&&a.symbol&&!GPt.has(a.name)&&(s=!0);var l,u;if(a.symbol){var h=s?"Size2-Regular":"Size1-Regular",d="";if((a.name==="\\oiint"||a.name==="\\oiiint")&&(d=a.name.slice(1),a.name=d==="oiint"?"\\iint":"\\iiint"),l=Zu(a.name,h,"math",e,["mop","op-symbol",s?"large-op":"small-op"]),u=l.italic,d.length>0){var f=JIt(d+"Size"+(s?"2":"1"),e);l=Zi({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:s?.08:0}]}),a.name="\\"+d,l.classes.unshift("mop"),l.italic=u}}else if(a.body){var p=hl(a.body,e,!0);p.length===1&&p[0]instanceof sf?(l=p[0],l.classes[0]="mop"):l=Yt(["mop"],p,e)}else{for(var g=[],m=1;m{var r;if(t.symbol)r=new tr("mo",[kp(t.name,t.mode)]),GPt.has(t.name)&&r.setAttribute("largeop","false");else if(t.body)r=new tr("mo",cf(t.body,e));else{r=new tr("mi",[new Hs(t.name.slice(1))]);var n=new tr("mo",[kp("⁡","text")]);t.parentIsSupSub?r=new tr("mrow",[r,n]):r=rPt([r,n])}return r},i5n={"∏":"\\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=i5n[i]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:O4,mathmlBuilder:SF}),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:Gs(n)}},htmlBuilder:O4,mathmlBuilder:SF});var a5n={"∫":"\\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:O4,mathmlBuilder:SF}),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:O4,mathmlBuilder:SF}),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=a5n[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:O4,mathmlBuilder:SF});var HPt=(t,e)=>{var r,n,i=!1,a;t.type==="supsub"?(r=t.sup,n=t.sub,a=jn(t.base,"operatorname"),i=!0):a=jn(t,"operatorname");var o;if(a.body.length>0){for(var s=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=hl(s,e.withFont("mathrm"),!0),u=0;u{for(var r=cf(t.body,e.withFont("mathrm")),n=!0,i=0;ih.toText()).join("");r=[new Hs(s)]}var l=new tr("mi",r);l.setAttribute("mathvariant","normal");var u=new tr("mo",[kp("⁡","text")]);return t.parentIsSupSub?new tr("mrow",[l,u]):rPt([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:Gs(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:HPt,mathmlBuilder:o5n}),_e("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),EC({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?I1(hl(t.body,e,!1)):Yt(["mord"],hl(t.body,e,!0),e)},mathmlBuilder(t,e){return G2(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=Ji(t.body,e.havingCrampedStyle()),n=T4("overline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Zi({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]});return Yt(["mord","overline"],[a],e)},mathmlBuilder(t,e){var r=new tr("mo",[new Hs("‾")]);r.setAttribute("stretchy","true");var n=new tr("mover",[La(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:Gs(n)}},htmlBuilder:(t,e)=>{var r=hl(t.body,e.withPhantom(),!1);return I1(r)},mathmlBuilder:(t,e)=>{var r=cf(t.body,e);return new tr("mphantom",r)}}),_e("\\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=Yt(["inner"],[Ji(t.body,e.withPhantom())]),n=Yt(["fix"],[]);return Yt(["mord","rlap"],[r,n],e)},mathmlBuilder:(t,e)=>{var r=cf(Gs(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=jn(e[0],"size").value,i=e[1];return{type:"raisebox",mode:r.mode,dy:n,body:i}},htmlBuilder(t,e){var r=Ji(t.body,e),n=Lo(t.dy,e);return Zi({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new tr("mpadded",[La(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=jn(e[0],"size"),o=jn(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&jn(i,"size").value,width:a.value,height:o.value}},htmlBuilder(t,e){var r=Yt(["mord","rule"],[],e),n=Lo(t.width,e),i=Lo(t.height,e),a=t.shift?Lo(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=Lo(t.width,e),n=Lo(t.height,e),i=t.shift?Lo(t.shift,e):0,a=e.color&&e.getColor()||"black",o=new tr("mspace");o.setAttribute("mathbackground",a),o.setAttribute("width",ir(r)),o.setAttribute("height",ir(n));var s=new tr("mpadded",[o]);return i>=0?s.setAttribute("height",ir(i)):(s.setAttribute("height",ir(i)),s.setAttribute("depth",ir(-i))),s.setAttribute("voffset",ir(i)),s}});function WPt(t,e,r){for(var n=hl(t,e,!1),i=e.sizeMultiplier/r.sizeMultiplier,a=0;a{var r=e.havingSize(t.size);return WPt(t.body,r,e)};xr({type:"sizing",names:YPt,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:YPt.indexOf(n)+1,body:a}},htmlBuilder:s5n,mathmlBuilder:(t,e)=>{var r=e.havingSize(t.size),n=cf(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,o=r[0]&&jn(r[0],"ordgroup");if(o)for(var s,l=0;l{var r=Yt([],[Ji(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 Yt(["mord","smash"],[r],e);if(r.children)for(var n=0;n{var r=new tr("mpadded",[La(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=Ji(t.body,e.havingCrampedStyle());r.height===0&&(r.height=e.fontMetrics().xHeight),r=C4(r,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,a=i;e.style.idr.height+r.depth+o&&(o=(o+d-r.height-r.depth)/2);var f=l.height-r.height-o-u;r.style.paddingLeft=ir(h);var p=Zi({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(Nn.SCRIPTSCRIPT),m=Ji(t.index,g,e),v=.6*(p.height-p.depth),y=Zi({positionType:"shift",positionData:-v,children:[{type:"elem",elem:m}]}),b=Yt(["root"],[y]);return Yt(["mord","sqrt"],[b,p],e)}else return Yt(["mord","sqrt"],[p],e)},mathmlBuilder(t,e){var{body:r,index:n}=t;return n?new tr("mroot",[La(r,e),La(n,e)]):new tr("msqrt",[La(r,e)])}});var _Te={display:Nn.DISPLAY,text:Nn.TEXT,script:Nn.SCRIPT,scriptscript:Nn.SCRIPTSCRIPT};function l5n(t){return t in _Te}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),o=n.slice(1,n.length-5);if(!l5n(o))throw new Error("Unknown style: "+o);return{type:"styling",mode:i.mode,style:o,body:a}},htmlBuilder(t,e){var r=_Te[t.style],n=e.havingStyle(r);return t.resetFont&&(n=n.withFont("")),WPt(t.body,n,e)},mathmlBuilder(t,e){var r=_Te[t.style],n=e.havingStyle(r);t.resetFont&&(n=n.withFont(""));var i=cf(t.body,n),a=new tr("mstyle",i),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},s=o[t.style];return a.setAttribute("scriptlevel",s[0]),a.setAttribute("displaystyle",s[1]),a}});var c5n=function(e,r){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(r.style.size===Nn.DISPLAY.size||n.alwaysHandleSupSub);return i?O4:null}else if(n.type==="operatorname"){var a=n.alwaysHandleSupSub&&(r.style.size===Nn.DISPLAY.size||n.limits);return a?HPt:null}else{if(n.type==="accent")return R1(n.base)?gTe:null;if(n.type==="horizBrace"){var o=!e.sub;return o===n.isOver?UPt:null}else return null}else return null};EC({type:"supsub",htmlBuilder(t,e){var r=c5n(t,e);if(r)return r(t,e);var{base:n,sup:i,sub:a}=t,o=Ji(n,e),s,l,u=e.fontMetrics(),h=0,d=0,f=n&&R1(n);if(i){var p=e.havingStyle(e.style.sup());s=Ji(i,p,e),f||(h=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(a){var g=e.havingStyle(e.style.sub());l=Ji(a,g,e),f||(d=o.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var m;e.style===Nn.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(o instanceof sf||x){var w;b=ir(-((w=o.italic)!=null?w:0))}}var A;if(s&&l){h=Math.max(h,m,s.depth+.25*u.xHeight),d=Math.max(d,u.sub2);var S=u.defaultRuleThickness,T=4*S;if(h-s.depth-(l.height-d)0&&(h+=C,d-=C)}var k=[{type:"elem",elem:l,shift:d,marginRight:y,marginLeft:b},{type:"elem",elem:s,shift:-h,marginRight:y}];A=Zi({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=Zi({positionType:"shift",positionData:d,children:E})}else if(s)h=Math.max(h,m,s.depth+.25*u.xHeight),A=Zi({positionType:"shift",positionData:-h,children:[{type:"elem",elem:s,marginRight:y}]});else throw new Error("supsub must have either sup or sub.");var _=uTe(o,"right")||"mord";return Yt([_],[o,Yt(["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=[La(t.base,e)];t.sub&&a.push(La(t.sub,e)),t.sup&&a.push(La(t.sup,e));var o;if(r)o=n?"mover":"munder";else if(t.sub)if(t.sup){var u=t.base;u&&u.type==="op"&&u.limits&&e.style===Nn.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===Nn.DISPLAY||u.limits)?o="munderover":o="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===Nn.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Nn.DISPLAY)?o="munder":o="msub"}else{var s=t.base;s&&s.type==="op"&&s.limits&&(e.style===Nn.DISPLAY||s.alwaysHandleSupSub)||s&&s.type==="operatorname"&&s.alwaysHandleSupSub&&(s.limits||e.style===Nn.DISPLAY)?o="mover":o="msup"}return new tr(o,a)}}),EC({type:"atom",htmlBuilder(t,e){return aTe(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var r=new tr("mo",[kp(t.text,t.mode)]);if(t.family==="bin"){var n=fTe(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 qPt={mi:"italic",mn:"normal",mtext:"normal"};EC({type:"mathord",htmlBuilder(t,e){return hJ(t,e,"mathord")},mathmlBuilder(t,e){var r=new tr("mi",[kp(t.text,t.mode,e)]),n=fTe(t,e)||"italic";return n!==qPt[r.type]&&r.setAttribute("mathvariant",n),r}}),EC({type:"textord",htmlBuilder(t,e){return hJ(t,e,"textord")},mathmlBuilder(t,e){var r=kp(t.text,t.mode,e),n=fTe(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!==qPt[i.type]&&i.setAttribute("mathvariant",n),i}});var RTe={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},DTe={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};EC({type:"spacing",htmlBuilder(t,e){if(DTe.hasOwnProperty(t.text)){var r=DTe[t.text].className||"";if(t.mode==="text"){var n=hJ(t,e,"textord");return n.classes.push(r),n}else return Yt(["mspace",r],[aTe(t.text,t.mode,e)],e)}else{if(RTe.hasOwnProperty(t.text))return Yt(["mspace",RTe[t.text]],[],e);throw new Zt('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var r;if(DTe.hasOwnProperty(t.text))r=new tr("mtext",[new Hs(" ")]);else{if(RTe.hasOwnProperty(t.text))return new tr("mspace");throw new Zt('Unknown type of space "'+t.text+'"')}return r}});var jPt=()=>{var t=new tr("mtd",[]);return t.setAttribute("width","50%"),t};EC({type:"tag",mathmlBuilder(t,e){var r=new tr("mtable",[new tr("mtr",[jPt(),new tr("mtd",[G2(t.body,e)]),jPt(),new tr("mtd",[G2(t.tag,e)])])]);return r.setAttribute("width","100%"),r}});var XPt={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},KPt={"\\textbf":"textbf","\\textmd":"textmd"},u5n={"\\textit":"textit","\\textup":"textup"},ZPt=(t,e)=>{var r=t.font;if(r){if(XPt[r])return e.withTextFontFamily(XPt[r]);if(KPt[r])return e.withTextFontWeight(KPt[r]);if(r==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(u5n[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:Gs(i),font:n}},htmlBuilder(t,e){var r=ZPt(t,e),n=hl(t.body,r,!0);return Yt(["mord","text"],n,r)},mathmlBuilder(t,e){var r=ZPt(t,e);return G2(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=Ji(t.body,e),n=T4("underline-line",e),i=e.fontMetrics().defaultRuleThickness,a=Zi({positionType:"top",positionData:r.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r}]});return Yt(["mord","underline"],[a],e)},mathmlBuilder(t,e){var r=new tr("mo",[new Hs("‾")]);r.setAttribute("stretchy","true");var n=new tr("munder",[La(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=Ji(t.body,e),n=e.fontMetrics().axisHeight,i=.5*(r.height-n-(r.depth+n));return Zi({positionType:"shift",positionData:i,children:[{type:"elem",elem:r}]})},mathmlBuilder(t,e){var r=new tr("mpadded",[La(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=JPt(t),n=[],i=e.havingStyle(e.style.text()),a=0;at.body.replace(/ /g,t.star?"␣":" "),W2=ePt,e6t=`[ \r + ]`,h5n="\\\\[a-zA-Z@]+",d5n="\\\\[^\uD800-\uDFFF]",f5n="("+h5n+")"+e6t+"*",p5n=`\\\\( |[ \r ]+ -?)[ \r ]*`,LTe="[̀-ͯ]",f5n=new RegExp(LTe+"+$"),p5n="("+ZPt+"+)|"+(d5n+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(LTe+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(LTe+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+h5n)+("|"+u5n+")");let JPt=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(p5n,"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 uf("EOF",new Jh(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new Zt("Unexpected character: '"+e[r]+"'",new uf(e[r],new Jh(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 uf(i,new Jh(this,r,this.tokenRegex.lastIndex))}};class g5n{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 m5n=_Pt;_e("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}}),_e("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}}),_e("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}}),_e("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}}),_e("\\@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}}),_e("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),_e("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var e6t={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};_e("\\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=e6t[e.text],n==null||n>=r)throw new Zt("Invalid base-"+r+" digit "+e.text);for(var i;(i=e6t[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,o=t.isDefined(a);if(o&&!e)throw new Zt("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!o&&!r)throw new Zt("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var s=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);s=parseInt(l),i=t.consumeArg().tokens}return o&&n||t.macros.set(a,{tokens:i,numArgs:s}),""};_e("\\newcommand",t=>MTe(t,!1,!0,!1)),_e("\\renewcommand",t=>MTe(t,!0,!1,!1)),_e("\\providecommand",t=>MTe(t,!0,!0,!0)),_e("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""}),_e("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""}),_e("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),W2[r],So.math[r],So.text[r]),""}),_e("\\bgroup","{"),_e("\\egroup","}"),_e("~","\\nobreakspace"),_e("\\lq","`"),_e("\\rq","'"),_e("\\aa","\\r a"),_e("\\AA","\\r A"),_e("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),_e("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),_e("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),_e("ℬ","\\mathscr{B}"),_e("ℰ","\\mathscr{E}"),_e("ℱ","\\mathscr{F}"),_e("ℋ","\\mathscr{H}"),_e("ℐ","\\mathscr{I}"),_e("ℒ","\\mathscr{L}"),_e("ℳ","\\mathscr{M}"),_e("ℛ","\\mathscr{R}"),_e("ℭ","\\mathfrak{C}"),_e("ℌ","\\mathfrak{H}"),_e("ℨ","\\mathfrak{Z}"),_e("\\Bbbk","\\Bbb{k}"),_e("\\llap","\\mathllap{\\textrm{#1}}"),_e("\\rlap","\\mathrlap{\\textrm{#1}}"),_e("\\clap","\\mathclap{\\textrm{#1}}"),_e("\\mathstrut","\\vphantom{(}"),_e("\\underbar","\\underline{\\text{#1}}"),_e("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}'),_e("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),_e("\\ne","\\neq"),_e("≠","\\neq"),_e("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),_e("∉","\\notin"),_e("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),_e("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),_e("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),_e("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),_e("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),_e("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),_e("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),_e("⟂","\\perp"),_e("‼","\\mathclose{!\\mkern-0.8mu!}"),_e("∌","\\notni"),_e("⌜","\\ulcorner"),_e("⌝","\\urcorner"),_e("⌞","\\llcorner"),_e("⌟","\\lrcorner"),_e("©","\\copyright"),_e("®","\\textregistered"),_e("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),_e("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),_e("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),_e("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),_e("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),_e("⋮","\\vdots"),_e("\\varGamma","\\mathit{\\Gamma}"),_e("\\varDelta","\\mathit{\\Delta}"),_e("\\varTheta","\\mathit{\\Theta}"),_e("\\varLambda","\\mathit{\\Lambda}"),_e("\\varXi","\\mathit{\\Xi}"),_e("\\varPi","\\mathit{\\Pi}"),_e("\\varSigma","\\mathit{\\Sigma}"),_e("\\varUpsilon","\\mathit{\\Upsilon}"),_e("\\varPhi","\\mathit{\\Phi}"),_e("\\varPsi","\\mathit{\\Psi}"),_e("\\varOmega","\\mathit{\\Omega}"),_e("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),_e("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),_e("\\boxed","\\fbox{$\\displaystyle{#1}$}"),_e("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),_e("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),_e("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),_e("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),_e("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var t6t={",":"\\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"},v5n=new Set(["bin","rel"]);_e("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in t6t?e=t6t[r]:(r.slice(0,4)==="\\not"||r in So.math&&v5n.has(So.math[r].group))&&(e="\\dotsb"),e});var ITe={")":!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};_e("\\dotso",function(t){var e=t.future().text;return e in ITe?"\\ldots\\,":"\\ldots"}),_e("\\dotsc",function(t){var e=t.future().text;return e in ITe&&e!==","?"\\ldots\\,":"\\ldots"}),_e("\\cdots",function(t){var e=t.future().text;return e in ITe?"\\@cdots\\,":"\\@cdots"}),_e("\\dotsb","\\cdots"),_e("\\dotsm","\\cdots"),_e("\\dotsi","\\!\\cdots"),_e("\\dotsx","\\ldots\\,"),_e("\\DOTSI","\\relax"),_e("\\DOTSB","\\relax"),_e("\\DOTSX","\\relax"),_e("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),_e("\\,","\\tmspace+{3mu}{.1667em}"),_e("\\thinspace","\\,"),_e("\\>","\\mskip{4mu}"),_e("\\:","\\tmspace+{4mu}{.2222em}"),_e("\\medspace","\\:"),_e("\\;","\\tmspace+{5mu}{.2777em}"),_e("\\thickspace","\\;"),_e("\\!","\\tmspace-{3mu}{.1667em}"),_e("\\negthinspace","\\!"),_e("\\negmedspace","\\tmspace-{4mu}{.2222em}"),_e("\\negthickspace","\\tmspace-{5mu}{.277em}"),_e("\\enspace","\\kern.5em "),_e("\\enskip","\\hskip.5em\\relax"),_e("\\quad","\\hskip1em\\relax"),_e("\\qquad","\\hskip2em\\relax"),_e("\\tag","\\@ifstar\\tag@literal\\tag@paren"),_e("\\tag@paren","\\tag@literal{({#1})}"),_e("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new Zt("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),_e("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),_e("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),_e("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),_e("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),_e("\\newline","\\\\\\relax"),_e("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var r6t=ir(z0["Main-Regular"][84][1]-.7*z0["Main-Regular"][65][1]);_e("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+r6t+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),_e("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+r6t+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),_e("\\hspace","\\@ifstar\\@hspacer\\@hspace"),_e("\\@hspace","\\hskip #1\\relax"),_e("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),_e("\\ordinarycolon",":"),_e("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),_e("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),_e("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),_e("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),_e("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),_e("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),_e("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),_e("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),_e("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),_e("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),_e("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),_e("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),_e("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),_e("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),_e("∷","\\dblcolon"),_e("∹","\\eqcolon"),_e("≔","\\coloneqq"),_e("≕","\\eqqcolon"),_e("⩴","\\Coloneqq"),_e("\\ratio","\\vcentcolon"),_e("\\coloncolon","\\dblcolon"),_e("\\colonequals","\\coloneqq"),_e("\\coloncolonequals","\\Coloneqq"),_e("\\equalscolon","\\eqqcolon"),_e("\\equalscoloncolon","\\Eqqcolon"),_e("\\colonminus","\\coloneq"),_e("\\coloncolonminus","\\Coloneq"),_e("\\minuscolon","\\eqcolon"),_e("\\minuscoloncolon","\\Eqcolon"),_e("\\coloncolonapprox","\\Colonapprox"),_e("\\coloncolonsim","\\Colonsim"),_e("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),_e("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),_e("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),_e("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),_e("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),_e("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),_e("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),_e("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),_e("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),_e("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),_e("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),_e("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),_e("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),_e("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),_e("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),_e("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),_e("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),_e("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),_e("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),_e("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),_e("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),_e("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),_e("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),_e("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),_e("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),_e("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),_e("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),_e("\\imath","\\html@mathml{\\@imath}{ı}"),_e("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),_e("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),_e("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),_e("⟦","\\llbracket"),_e("⟧","\\rrbracket"),_e("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),_e("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),_e("⦃","\\lBrace"),_e("⦄","\\rBrace"),_e("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),_e("⦵","\\minuso"),_e("\\darr","\\downarrow"),_e("\\dArr","\\Downarrow"),_e("\\Darr","\\Downarrow"),_e("\\lang","\\langle"),_e("\\rang","\\rangle"),_e("\\uarr","\\uparrow"),_e("\\uArr","\\Uparrow"),_e("\\Uarr","\\Uparrow"),_e("\\N","\\mathbb{N}"),_e("\\R","\\mathbb{R}"),_e("\\Z","\\mathbb{Z}"),_e("\\alef","\\aleph"),_e("\\alefsym","\\aleph"),_e("\\Alpha","\\mathrm{A}"),_e("\\Beta","\\mathrm{B}"),_e("\\bull","\\bullet"),_e("\\Chi","\\mathrm{X}"),_e("\\clubs","\\clubsuit"),_e("\\cnums","\\mathbb{C}"),_e("\\Complex","\\mathbb{C}"),_e("\\Dagger","\\ddagger"),_e("\\diamonds","\\diamondsuit"),_e("\\empty","\\emptyset"),_e("\\Epsilon","\\mathrm{E}"),_e("\\Eta","\\mathrm{H}"),_e("\\exist","\\exists"),_e("\\harr","\\leftrightarrow"),_e("\\hArr","\\Leftrightarrow"),_e("\\Harr","\\Leftrightarrow"),_e("\\hearts","\\heartsuit"),_e("\\image","\\Im"),_e("\\infin","\\infty"),_e("\\Iota","\\mathrm{I}"),_e("\\isin","\\in"),_e("\\Kappa","\\mathrm{K}"),_e("\\larr","\\leftarrow"),_e("\\lArr","\\Leftarrow"),_e("\\Larr","\\Leftarrow"),_e("\\lrarr","\\leftrightarrow"),_e("\\lrArr","\\Leftrightarrow"),_e("\\Lrarr","\\Leftrightarrow"),_e("\\Mu","\\mathrm{M}"),_e("\\natnums","\\mathbb{N}"),_e("\\Nu","\\mathrm{N}"),_e("\\Omicron","\\mathrm{O}"),_e("\\plusmn","\\pm"),_e("\\rarr","\\rightarrow"),_e("\\rArr","\\Rightarrow"),_e("\\Rarr","\\Rightarrow"),_e("\\real","\\Re"),_e("\\reals","\\mathbb{R}"),_e("\\Reals","\\mathbb{R}"),_e("\\Rho","\\mathrm{P}"),_e("\\sdot","\\cdot"),_e("\\sect","\\S"),_e("\\spades","\\spadesuit"),_e("\\sub","\\subset"),_e("\\sube","\\subseteq"),_e("\\supe","\\supseteq"),_e("\\Tau","\\mathrm{T}"),_e("\\thetasym","\\vartheta"),_e("\\weierp","\\wp"),_e("\\Zeta","\\mathrm{Z}"),_e("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),_e("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),_e("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),_e("\\bra","\\mathinner{\\langle{#1}|}"),_e("\\ket","\\mathinner{|{#1}\\rangle}"),_e("\\braket","\\mathinner{\\langle{#1}\\rangle}"),_e("\\Bra","\\left\\langle#1\\right|"),_e("\\Ket","\\left|#1\\right\\rangle");var n6t=t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,o=e.macros.get("|"),s=e.macros.get("\\|");e.macros.beginGroup();var l=d=>f=>{t&&(f.macros.set("|",o),i.length&&f.macros.set("\\|",s));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}};_e("\\bra@ket",n6t(!1)),_e("\\bra@set",n6t(!0)),_e("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),_e("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),_e("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),_e("\\angln","{\\angl n}"),_e("\\blue","\\textcolor{##6495ed}{#1}"),_e("\\orange","\\textcolor{##ffa500}{#1}"),_e("\\pink","\\textcolor{##ff00af}{#1}"),_e("\\red","\\textcolor{##df0030}{#1}"),_e("\\green","\\textcolor{##28ae7b}{#1}"),_e("\\gray","\\textcolor{gray}{#1}"),_e("\\purple","\\textcolor{##9d38bd}{#1}"),_e("\\blueA","\\textcolor{##ccfaff}{#1}"),_e("\\blueB","\\textcolor{##80f6ff}{#1}"),_e("\\blueC","\\textcolor{##63d9ea}{#1}"),_e("\\blueD","\\textcolor{##11accd}{#1}"),_e("\\blueE","\\textcolor{##0c7f99}{#1}"),_e("\\tealA","\\textcolor{##94fff5}{#1}"),_e("\\tealB","\\textcolor{##26edd5}{#1}"),_e("\\tealC","\\textcolor{##01d1c1}{#1}"),_e("\\tealD","\\textcolor{##01a995}{#1}"),_e("\\tealE","\\textcolor{##208170}{#1}"),_e("\\greenA","\\textcolor{##b6ffb0}{#1}"),_e("\\greenB","\\textcolor{##8af281}{#1}"),_e("\\greenC","\\textcolor{##74cf70}{#1}"),_e("\\greenD","\\textcolor{##1fab54}{#1}"),_e("\\greenE","\\textcolor{##0d923f}{#1}"),_e("\\goldA","\\textcolor{##ffd0a9}{#1}"),_e("\\goldB","\\textcolor{##ffbb71}{#1}"),_e("\\goldC","\\textcolor{##ff9c39}{#1}"),_e("\\goldD","\\textcolor{##e07d10}{#1}"),_e("\\goldE","\\textcolor{##a75a05}{#1}"),_e("\\redA","\\textcolor{##fca9a9}{#1}"),_e("\\redB","\\textcolor{##ff8482}{#1}"),_e("\\redC","\\textcolor{##f9685d}{#1}"),_e("\\redD","\\textcolor{##e84d39}{#1}"),_e("\\redE","\\textcolor{##bc2612}{#1}"),_e("\\maroonA","\\textcolor{##ffbde0}{#1}"),_e("\\maroonB","\\textcolor{##ff92c6}{#1}"),_e("\\maroonC","\\textcolor{##ed5fa6}{#1}"),_e("\\maroonD","\\textcolor{##ca337c}{#1}"),_e("\\maroonE","\\textcolor{##9e034e}{#1}"),_e("\\purpleA","\\textcolor{##ddd7ff}{#1}"),_e("\\purpleB","\\textcolor{##c6b9fc}{#1}"),_e("\\purpleC","\\textcolor{##aa87ff}{#1}"),_e("\\purpleD","\\textcolor{##7854ab}{#1}"),_e("\\purpleE","\\textcolor{##543b78}{#1}"),_e("\\mintA","\\textcolor{##f5f9e8}{#1}"),_e("\\mintB","\\textcolor{##edf2df}{#1}"),_e("\\mintC","\\textcolor{##e0e5cc}{#1}"),_e("\\grayA","\\textcolor{##f6f7f7}{#1}"),_e("\\grayB","\\textcolor{##f0f1f2}{#1}"),_e("\\grayC","\\textcolor{##e3e5e6}{#1}"),_e("\\grayD","\\textcolor{##d6d8da}{#1}"),_e("\\grayE","\\textcolor{##babec2}{#1}"),_e("\\grayF","\\textcolor{##888d93}{#1}"),_e("\\grayG","\\textcolor{##626569}{#1}"),_e("\\grayH","\\textcolor{##3b3e40}{#1}"),_e("\\grayI","\\textcolor{##21242c}{#1}"),_e("\\kaBlue","\\textcolor{##314453}{#1}"),_e("\\kaGreen","\\textcolor{##71B307}{#1}");var i6t={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class y5n{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 g5n(m5n,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new JPt(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 uf("EOF",n.loc)),this.pushTokens(i),new uf("",Jh.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,o=0,s=0;do{if(a=this.popToken(),r.push(a),a.text==="{")++o;else if(a.text==="}"){if(--o,o===-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[s]:"}")+"'",a);if(e&&n)if((o===0||o===1&&e[s]==="{")&&a.text===e[s]){if(++s,s===e.length){r.splice(-s,s);break}}else s=0}while(o!==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,o=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var s=a.length-1;s>=0;--s){var l=a[s];if(l.text==="#"){if(s===0)throw new Zt("Incomplete placeholder at end of macro body",l);if(l=a[--s],l.text==="#")a.splice(s+1,1);else if(/^[1-9]$/.test(l.text))a.splice(s,2,...o[+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 uf(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 o=i.replace(/##/g,"");o.includes("#"+(a+1));)++a;for(var s=new JPt(i,this.settings),l=[],u=s.lex();u.text!=="EOF";)l.push(u),u=s.lex();l.reverse();var h={tokens:l,numArgs:a};return h}return i}isDefined(e){return this.macros.has(e)||W2.hasOwnProperty(e)||So.math.hasOwnProperty(e)||So.text.hasOwnProperty(e)||i6t.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:W2.hasOwnProperty(e)&&!W2[e].primitive}}var a6t=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,EJ=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),PTe={"́":{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"}},o6t={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let s6t=class Zor{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 y5n(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 uf("}")),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(Zor.endOfExpression.has(i.text)||r&&i.text===r||e&&W2[i.text]&&W2[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&&(EIt(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)),o={type:"textord",mode:"text",loc:Jh.range(e),text:r};else return null;if(this.consume(),a)for(var h=0;h0){if(++e>=sRn)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function E4(t){return function(){return t}}var DJ=function(){try{var t=MC(Object,"defineProperty");return t({},"",{}),t}catch{}}(),hRn=DJ?function(t,e){return DJ(t,"toString",{configurable:!0,enumerable:!1,value:E4(e),writable:!0})}:DC,C6t=uRn(hRn);function O6t(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}var mRn=9007199254740991,vRn=/^(?:0|[1-9]\d*)$/;function LJ(t,e){var r=typeof t;return e=e??mRn,!!e&&(r=="number"||r!="symbol"&&vRn.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=xRn}function Y2(t){return t!=null&&zTe(t.length)&&!CF(t)}function kF(t,e,r){if(!hf(r))return!1;var n=typeof e;return(n=="number"?Y2(r)&&LJ(e,r.length):n=="string"&&e in r)?_4(r[e],t):!1}function wRn(t){return PJ(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,o&&kF(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}function R4n(t,e){var r=this.__data__,n=FJ(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function B1(t){var e=-1,r=t==null?0:t.length;for(this.clear();++es))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&PDn?new MF:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&kF(e[0],e[1],i)&&(n=1);++r-1?i[a?e[o]:o]:void 0}}var TLn=Math.max;function CLn(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:U5n(r);return i<0&&(i=TLn(n+i,0)),k6t(t,q2(e),i)}var oCe=SLn(CLn);function ONt(t,e){var r=-1,n=Y2(t)?Array(t.length):[];return HJ(t,function(i,a,o){n[++r]=e(i,a,o)}),n}function Ys(t,e){var r=Ws(t)?k4:ONt;return r(t,q2(e))}function OLn(t,e){return t==null?t:tCe(t,aCe(e),IC)}function kLn(t,e){return t&&rCe(t,aCe(e))}function ELn(t,e){return t>e}var _Ln=Object.prototype,RLn=_Ln.hasOwnProperty;function DLn(t,e){return t!=null&&RLn.call(t,e)}function kNt(t,e){return t!=null&&wNt(t,e,DLn)}function LLn(t,e){return k4(e,function(r){return t[r]})}function z1(t){return t==null?[]:LLn(t,df(t))}var MLn="[object Map]",ILn="[object Set]",PLn=Object.prototype,NLn=PLn.hasOwnProperty;function ENt(t){if(t==null)return!0;if(Y2(t)&&(Ws(t)||typeof t=="string"||typeof t.splice=="function"||D4(t)||$J(t)||R4(t)))return!t.length;var e=_p(t);if(e==MLn||e==ILn)return!t.size;if(NJ(t))return!F6t(t).length;for(var r in t)if(NLn.call(t,r))return!1;return!0}function ws(t){return t===void 0}function _Nt(t,e){return te||a&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&t=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}function VLn(t,e,r){e.length?e=k4(e,function(a){return Ws(a)?function(o){return VJ(o,a.length===1?a[0]:a)}:a}):e=[DC];var n=-1;e=k4(e,BJ(q2));var i=ONt(t,function(a,o,s){var l=k4(e,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return FLn(i,function(a,o){return ULn(a,o,r)})}function QLn(t,e){return $Ln(t,e,function(r,n){return ANt(t,n)})}var qJ=H4n(function(t,e){return t==null?{}:QLn(t,e)}),GLn=Math.ceil,HLn=Math.max;function WLn(t,e,r,n){for(var i=-1,a=HLn(GLn((e-t)/(r||1)),0),o=Array(a);a--;)o[++i]=t,t+=r;return o}function YLn(t){return function(e,r,n){return n&&typeof n!="number"&&kF(e,r,n)&&(r=n=void 0),e=RJ(e),r===void 0?(r=e,e=0):r=RJ(r),n=n===void 0?e1&&kF(t,e[0],e[1])?e=[]:r>2&&kF(e[0],e[1],e[2])&&(e=[e[0]]),VLn(t,HTe(e),[])}),jLn=1/0,XLn=I4&&1/ZTe(new I4([,-0]))[1]==jLn?function(t){return new I4(t)}:oRn,KLn=200;function ZLn(t,e,r){var n=-1,i=gRn,a=t.length,o=!0,s=[],l=s;if(a>=KLn){var u=XLn(t);if(u)return ZTe(u);o=!1,i=fNt,l=new MF}else l=s;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]=BC,this._children[e]={},this._children[BC][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],Dt(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),Dt(df(this._in[e]),r),delete this._in[e],delete this._preds[e],Dt(df(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(ws(r))r=BC;else{r+="";for(var n=r;!ws(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!==BC)return r}}children(e){if(ws(e)&&(e=BC),this._isCompound){var r=this._children[e];if(r)return df(r)}else{if(e===BC)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return df(r)}successors(e){var r=this._sucs[e];if(r)return df(r)}neighbors(e){var r=this.predecessors(e);if(r)return JLn(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;Dt(this._nodes,function(o,s){e(s)&&r.setNode(s,o)}),Dt(this._edgeObjs,function(o){r.hasNode(o.v)&&r.hasNode(o.w)&&r.setEdge(o,n.edge(o))});var i={};function a(o){var s=n.parent(o);return s===void 0||r.hasNode(s)?(i[o]=s,s):s in i?i[s]:a(s)}return this._isCompound&&Dt(r.nodes(),function(o){r.setParent(o,a(o))}),r}setDefaultEdgeLabel(e){return CF(e)||(e=E4(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return z1(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return PF(e,function(a,o){return i.length>1?n.setEdge(a,o,r):n.setEdge(a,o),o}),this}setEdge(){var e,r,n,i,a=!1,o=arguments[0];typeof o=="object"&&o!==null&&"v"in o?(e=o.v,r=o.w,n=o.name,arguments.length===2&&(i=arguments[1],a=!0)):(e=o,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,r=""+r,ws(n)||(n=""+n);var s=BF(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,s))return a&&(this._edgeLabels[s]=i),this;if(!ws(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[s]=a?i:this._defaultEdgeLabelFn(e,r,n);var l=iMn(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[s]=l,DNt(this._preds[r],e),DNt(this._sucs[e],r),this._in[r][s]=l,this._out[e][s]=l,this._edgeCount++,this}edge(e,r,n){var i=arguments.length===1?hCe(this._isDirected,arguments[0]):BF(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?hCe(this._isDirected,arguments[0]):BF(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?hCe(this._isDirected,arguments[0]):BF(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],LNt(this._preds[r],e),LNt(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=z1(n);return r?F1(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=z1(n);return r?F1(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))}}hu.prototype._nodeCount=0,hu.prototype._edgeCount=0;function DNt(t,e){t[e]?t[e]++:t[e]=1}function LNt(t,e){--t[e]||delete t[e]}function BF(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var o=i;i=a,a=o}return i+RNt+a+RNt+(ws(n)?nMn:n)}function iMn(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return n&&(s.name=n),s}function hCe(t,e){return BF(t,e.v,e.w,e.name)}function U1(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:aMn(t),edges:oMn(t)};return ws(t.graph())||(e.value=ODn(t.graph())),e}function aMn(t){return Ys(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return ws(r)||(i.value=r),ws(n)||(i.parent=n),i})}function oMn(t){return Ys(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return ws(e.name)||(n.name=e.name),ws(r)||(n.value=r),n})}var Ln=new Map,j2=new Map,MNt=new Map,INt=O(()=>{j2.clear(),MNt.clear(),Ln.clear()},"clear"),$C=O((t,e)=>{const r=j2.get(e)||[];return ye.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),sMn=O((t,e)=>{const r=j2.get(e)||[];return ye.info("Descendants of ",e," is ",r),ye.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||$C(t.v,e)||$C(t.w,e)||r.includes(t.w):(ye.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),dCe=O((t,e,r,n)=>{ye.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),ye.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(a=>{if(e.children(a).length>0)dCe(a,e,r,n);else{const o=e.node(a);ye.info("cp ",a," to ",n," with parent ",t),r.setNode(a,o),n!==e.parent(a)&&(ye.warn("Setting parent",a,e.parent(a)),r.setParent(a,e.parent(a))),t!==n&&a!==t?(ye.debug("Setting parent",a,t),r.setParent(a,t)):(ye.info("In copy ",t,"root",n,"data",e.node(t),n),ye.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==n,"node!==clusterId",a!==t));const s=e.edges(a);ye.debug("Copying Edges",s),s.forEach(l=>{ye.info("Edge",l);const u=e.edge(l.v,l.w,l.name);ye.info("Edge data",u,n);try{if(sMn(l,n)){const h=j2.get(n)||[],d=h.includes(l.v)||$C(l.v,n)||l.v===n,f=h.includes(l.w)||$C(l.w,n)||l.w===n;if(d&&f)ye.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),ye.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]));else{const p=d?n:l.v,g=f?n:l.w;ye.info("Rebinding cross-boundary edge as ",p,g,u,l.name),e.setEdge(p,g,u,l.name)}}else ye.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(h){ye.error(h)}})}ye.debug("Removing node",a),e.removeNode(a)})},"copy"),PNt=O((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)MNt.set(i,t),n=[...n,...PNt(i,e)];return n},"extractDescendants"),lMn=O((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})),o=i.map(l=>({v:l.v,w:l.w}));return a.filter(l=>o.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),N4=O((t,e,r)=>{const n=e.children(t);if(ye.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const a of n){const o=N4(a,e,r),s=lMn(e,r,o);if(o)if(s.length>0)i=o;else return o}return i},"findNonClusterChild"),NNt=O(t=>!Ln.has(t)||!Ln.get(t).externalConnections?t:Ln.has(t)?Ln.get(t).id:t,"getAnchorId"),cMn=O((t,e)=>{var r;if(!t||e>10){ye.debug("Opting out, no graph ");return}else ye.debug("Opting in, graph ");t.nodes().forEach(function(n){t.children(n).length>0&&(ye.warn("Cluster identified",n," Replacement id in edges: ",N4(n,t,n)),j2.set(n,PNt(n,t)),Ln.set(n,{id:N4(n,t,n),clusterData:t.node(n)}))}),t.nodes().forEach(function(n){const i=t.children(n),a=t.edges();i.length>0?(ye.debug("Cluster identified",n,j2),a.forEach(o=>{const s=$C(o.v,n),l=$C(o.w,n);s^l&&(ye.warn("Edge: ",o," leaves cluster ",n),ye.warn("Descendants of XXX ",n,": ",j2.get(n)),Ln.get(n).externalConnections=!0)})):ye.debug("Not a cluster ",n,j2)});for(let n of Ln.keys()){const i=Ln.get(n).id,a=t.parent(i);a!==n&&Ln.has(a)&&!Ln.get(a).externalConnections&&(Ln.get(n).id=a);const o=t.edges().some(s=>s.v===n);if(i&&((r=Ln.get(n))!=null&&r.externalConnections)&&o&&FNt(t,i,n)){const s=hMn(t,n,t.parent(i));s&&(Ln.get(n).id=s)}}t.edges().forEach(function(n){const i=t.edge(n);ye.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),ye.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(t.edge(n)));let a=n.v,o=n.w;if(ye.warn("Fix XXX",Ln,"ids:",n.v,n.w,"Translating: ",Ln.get(n.v)," --- ",Ln.get(n.w)),Ln.get(n.v)||Ln.get(n.w)){if(ye.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),a=NNt(n.v),o=NNt(n.w),t.removeEdge(n.v,n.w,n.name),a!==n.v){const s=t.parent(a);Ln.get(s).externalConnections=!0,i.fromCluster=n.v}if(o!==n.w){const s=t.parent(o);Ln.get(s).externalConnections=!0,i.toCluster=n.w}ye.warn("Fix Replacing with XXX",a,o,n.name),t.setEdge(a,o,i,n.name)}}),ye.warn("Adjusted Graph",U1(t)),BNt(t,0),ye.trace(Ln)},"adjustClustersAndEdges"),BNt=O((t,e)=>{var i,a,o,s;if(ye.warn("extractor - ",e,U1(t),t.children("D")),e>10){ye.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){ye.debug("Done, no node has children",t.nodes());return}ye.debug("Nodes = ",r,e);for(const l of r)if(ye.debug("Extracting node",l,Ln,Ln.has(l)&&!Ln.get(l).externalConnections,!t.parent(l),t.node(l),t.children("D")," Depth ",e),!Ln.has(l))ye.debug("Not a cluster",l,e);else if((a=(i=Ln.get(l))==null?void 0:i.clusterData)!=null&&a.explicitDir&&t.children(l)&&t.children(l).length>0){ye.warn("Cluster with explicit dir, creating subgraph for children",l,e);const u=Ln.get(l).clusterData.dir,h=new hu({multigraph:!0,compound:!0}).setGraph({rankdir:u,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});dCe(l,t,h,l);const d=t.node(l)||{};t.setNode(l,{...d,clusterNode:!0,id:l,clusterData:Ln.get(l).clusterData,label:Ln.get(l).label,graph:h}),ye.warn("Subgraph for cluster with explicit dir created:",l,U1(h))}else if(!Ln.get(l).externalConnections&&t.children(l)&&t.children(l).length>0){ye.warn("Cluster without external connections, without a parent and with children",l,e);let h=t.graph().rankdir==="TB"?"LR":"TB";(s=(o=Ln.get(l))==null?void 0:o.clusterData)!=null&&s.dir&&(h=Ln.get(l).clusterData.dir,ye.warn("Fixing dir",Ln.get(l).clusterData.dir,h));const d=new hu({multigraph:!0,compound:!0}).setGraph({rankdir:h,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});dCe(l,t,d,l);const f=t.node(l)||{};t.setNode(l,{...f,clusterNode:!0,id:l,clusterData:Ln.get(l).clusterData,label:Ln.get(l).label,graph:d}),ye.debug("Old graph after copy",U1(t))}else ye.warn("Cluster ** ",l," **not meeting the criteria !externalConnections:",!Ln.get(l).externalConnections," no parent: ",!t.parent(l)," children ",t.children(l)&&t.children(l).length>0,t.children("D"),e),ye.debug(Ln);r=t.nodes(),ye.warn("New list of nodes",r);for(const l of r){const u=t.node(l);ye.warn(" Now next level",l,u),u!=null&&u.clusterNode&&BNt(u.graph,e+1)}},"extractor"),$Nt=O((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),a=$Nt(t,i);r=[...r,...a]}),r},"sorter"),uMn=O(t=>$Nt(t,t.children()),"sortNodesByHierarchy"),FNt=O((t,e,r)=>{let n=t.parent(e);for(;n&&n!==r;){const i=Ln.get(n);if(i&&!i.externalConnections)return!0;n=t.parent(n)}return!1},"isNodeInExtractableCluster"),hMn=O((t,e,r)=>{const n=t.children(e)??[];for(const i of n){if(i===r||$C(i,r))continue;const a=N4(i,t,e);if(a&&!FNt(t,a,e))return a}return null},"findSafeAnchorNode");class dMn{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return zNt(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&zNt(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,fMn)),n=n._prev;return"["+e.join(", ")+"]"}}function zNt(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function fMn(t,e){if(t!=="_next"&&t!=="_prev")return e}var pMn=E4(1);function gMn(t,e){if(t.nodeCount()<=1)return[];var r=vMn(t,e||pMn),n=mMn(r.graph,r.buckets,r.zeroIdx);return M4(Ys(n,function(i){return t.outEdges(i.v,i.w)}))}function mMn(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],o;t.nodeCount();){for(;o=a.dequeue();)fCe(t,e,r,o);for(;o=i.dequeue();)fCe(t,e,r,o);if(t.nodeCount()){for(var s=e.length-2;s>0;--s)if(o=e[s].dequeue(),o){n=n.concat(fCe(t,e,r,o,!0));break}}}return n}function fCe(t,e,r,n,i){var a=i?[]:void 0;return Dt(t.inEdges(n.v),function(o){var s=t.edge(o),l=t.node(o.v);i&&a.push({v:o.v,w:o.w}),l.out-=s,pCe(e,r,l)}),Dt(t.outEdges(n.v),function(o){var s=t.edge(o),l=o.w,u=t.node(l);u.in-=s,pCe(e,r,u)}),t.removeNode(n.v),a}function vMn(t,e){var r=new hu,n=0,i=0;Dt(t.nodes(),function(s){r.setNode(s,{v:s,in:0,out:0})}),Dt(t.edges(),function(s){var l=r.edge(s.v,s.w)||0,u=e(s),h=l+u;r.setEdge(s.v,s.w,h),i=Math.max(i,r.node(s.v).out+=u),n=Math.max(n,r.node(s.w).in+=u)});var a=P4(i+n+3).map(function(){return new dMn}),o=n+1;return Dt(r.nodes(),function(s){pCe(a,o,r.node(s))}),{graph:r,buckets:a,zeroIdx:o}}function pCe(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 yMn(t){var e=t.graph().acyclicer==="greedy"?gMn(t,r(t)):bMn(t);Dt(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,uCe("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function bMn(t){var e=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,Dt(t.outEdges(a),function(o){Object.prototype.hasOwnProperty.call(r,o.w)?e.push(o):i(o.w)}),delete r[a])}return Dt(t.nodes(),i),e}function xMn(t){Dt(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 B4(t,e,r,n){var i;do i=uCe(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function wMn(t){var e=new hu().setGraph(t.graph());return Dt(t.nodes(),function(r){e.setNode(r,t.node(r))}),Dt(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 UNt(t){var e=new hu({multigraph:t.isMultigraph()}).setGraph(t.graph());return Dt(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),Dt(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function VNt(t,e){var r=t.x,n=t.y,i=e.x-r,a=e.y-n,o=t.width/2,s=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)*o>Math.abs(i)*s?(a<0&&(s=-s),l=s*i/a,u=s):(i<0&&(o=-o),l=o,u=o*a/i),{x:r+l,y:n+u}}function jJ(t){var e=Ys(P4(GNt(t)+1),function(){return[]});return Dt(t.nodes(),function(r){var n=t.node(r),i=n.rank;ws(i)||(e[i][n.order]=r)}),e}function AMn(t){var e=IF(Ys(t.nodes(),function(r){return t.node(r).rank}));Dt(t.nodes(),function(r){var n=t.node(r);kNt(n,"rank")&&(n.rank-=e)})}function SMn(t){var e=IF(Ys(t.nodes(),function(a){return t.node(a).rank})),r=[];Dt(t.nodes(),function(a){var o=t.node(a).rank-e;r[o]||(r[o]=[]),r[o].push(a)});var n=0,i=t.graph().nodeRankFactor;Dt(r,function(a,o){ws(a)&&o%i!==0?--n:n&&Dt(a,function(s){t.node(s).rank+=n})})}function QNt(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),B4(t,"border",i,e)}function GNt(t){return NC(Ys(t.nodes(),function(e){var r=t.node(e).rank;if(!ws(r))return r}))}function TMn(t,e){var r={lhs:[],rhs:[]};return Dt(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function CMn(t,e){return e()}function OMn(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&&Dt(n,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;ao.lim&&(s=o,l=!0);var u=F1(e.edges(),function(h){return l===r8t(t,t.node(h.v),s)&&l!==r8t(t,t.node(h.w),s)});return cCe(u,function(h){return $F(e,h)})}function t8t(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),bCe(t),yCe(t,e),UMn(t,e)}function UMn(t,e){var r=oCe(t.nodes(),function(i){return!e.node(i).parent}),n=FMn(t,r);n=n.slice(1),Dt(n,function(i){var a=t.node(i).parent,o=e.edge(i,a),s=!1;o||(o=e.edge(a,i),s=!0),e.node(i).rank=e.node(a).rank+(s?o.minlen:-o.minlen)})}function VMn(t,e,r){return t.hasEdge(e,r)}function r8t(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function QMn(t){switch(t.graph().ranker){case"network-simplex":n8t(t);break;case"tight-tree":HMn(t);break;case"longest-path":GMn(t);break;default:n8t(t)}}var GMn=vCe;function HMn(t){vCe(t),qNt(t)}function n8t(t){FC(t)}function WMn(t){var e=B4(t,"root",{},"_root"),r=YMn(t),n=NC(z1(r))-1,i=2*n+1;t.graph().nestingRoot=e,Dt(t.edges(),function(o){t.edge(o).minlen*=i});var a=qMn(t)+1;Dt(t.children(),function(o){i8t(t,e,i,a,n,r,o)}),t.graph().nodeRankFactor=i}function i8t(t,e,r,n,i,a,o){var s=t.children(o);if(!s.length){o!==e&&t.setEdge(e,o,{weight:0,minlen:r});return}var l=QNt(t,"_bt"),u=QNt(t,"_bb"),h=t.node(o);t.setParent(l,o),h.borderTop=l,t.setParent(u,o),h.borderBottom=u,Dt(s,function(d){i8t(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[o]+1;t.setEdge(l,p,{weight:m,minlen:v,nestingEdge:!0}),t.setEdge(g,u,{weight:m,minlen:v,nestingEdge:!0})}),t.parent(o)||t.setEdge(e,l,{weight:0,minlen:i+a[o]})}function YMn(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&&Dt(a,function(o){r(o,i+1)}),e[n]=i}return Dt(t.children(),function(n){r(n,1)}),e}function qMn(t){return PF(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function jMn(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,Dt(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function XMn(t,e,r){var n={},i;Dt(r,function(a){for(var o=t.parent(a),s,l;o;){if(s=t.parent(o),s?(l=n[s],n[s]=o):(l=i,i=o),l&&l!==o){e.setEdge(l,o);return}o=s}})}function KMn(t,e,r){var n=ZMn(t),i=new hu({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return t.node(a)});return Dt(t.nodes(),function(a){var o=t.node(a),s=t.parent(a);(o.rank===e||o.minRank<=e&&e<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||n),Dt(t[r](a),function(l){var u=l.v===a?l.w:l.v,h=i.edge(u,a),d=ws(h)?0:h.weight;i.setEdge(u,a,{weight:t.edge(l).weight+d})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&i.setNode(a,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))}),i}function ZMn(t){for(var e;t.hasNode(e=uCe("_root")););return e}function JMn(t,e){for(var r=0,n=1;n0;)h%2&&(d+=s[h+1]),h=h-1>>1,s[h]+=u.weight;l+=u.weight*d})),l}function tIn(t){var e={},r=F1(t.nodes(),function(s){return!t.children(s).length}),n=NC(Ys(r,function(s){return t.node(s).rank})),i=Ys(P4(n+1),function(){return[]});function a(s){if(!kNt(e,s)){e[s]=!0;var l=t.node(s);i[l.rank].push(s),Dt(t.successors(s),a)}}var o=NF(r,function(s){return t.node(s).rank});return Dt(o,a),i}function rIn(t,e){return Ys(e,function(r){var n=t.inEdges(r);if(n.length){var i=PF(n,function(a,o){var s=t.edge(o),l=t.node(o.v);return{sum:a.sum+s.weight*l.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function nIn(t,e){var r={};Dt(t,function(i,a){var o=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};ws(i.barycenter)||(o.barycenter=i.barycenter,o.weight=i.weight)}),Dt(e.edges(),function(i){var a=r[i.v],o=r[i.w];!ws(a)&&!ws(o)&&(o.indegree++,a.out.push(r[i.w]))});var n=F1(r,function(i){return!i.indegree});return iIn(n)}function iIn(t){var e=[];function r(a){return function(o){o.merged||(ws(o.barycenter)||ws(a.barycenter)||o.barycenter>=a.barycenter)&&aIn(a,o)}}function n(a){return function(o){o.in.push(a),--o.indegree===0&&t.push(o)}}for(;t.length;){var i=t.pop();e.push(i),Dt(i.in.reverse(),r(i)),Dt(i.out,n(i))}return Ys(F1(e,function(a){return!a.merged}),function(a){return qJ(a,["vs","i","barycenter","weight"])})}function aIn(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 oIn(t,e){var r=TMn(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=NF(r.rhs,function(h){return-h.i}),a=[],o=0,s=0,l=0;n.sort(sIn(!!e)),l=a8t(a,i,l),Dt(n,function(h){l+=h.vs.length,a.push(h.vs),o+=h.barycenter*h.weight,s+=h.weight,l=a8t(a,i,l)});var u={vs:M4(a)};return s&&(u.barycenter=o/s,u.weight=s),u}function a8t(t,e,r){for(var n;e.length&&(n=WJ(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function sIn(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function o8t(t,e,r,n){var i=t.children(e),a=t.node(e),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,l={};o&&(i=F1(i,function(g){return g!==o&&g!==s}));var u=rIn(t,i);Dt(u,function(g){if(t.children(g.v).length){var m=o8t(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&cIn(g,m)}});var h=nIn(u,r);lIn(h,l);var d=oIn(h,n);if(o&&(d.vs=M4([o,d.vs,s]),t.predecessors(o).length)){var f=t.node(t.predecessors(o)[0]),p=t.node(t.predecessors(s)[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 lIn(t,e){Dt(t,function(r){r.vs=M4(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function cIn(t,e){ws(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 uIn(t){var e=GNt(t),r=s8t(t,P4(1,e+1),"inEdges"),n=s8t(t,P4(e-1,-1,-1),"outEdges"),i=tIn(t);l8t(t,i);for(var a=Number.POSITIVE_INFINITY,o,s=0,l=0;l<4;++s,++l){hIn(s%2?r:n,s%4>=2),i=jJ(t);var u=JMn(t,i);uo||s>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 pIn(t){var e={},r=0;function n(i){var a=r;Dt(t.children(i),n),e[i]={low:a,lim:r++}}return Dt(t.children(),n),e}function gIn(t,e){var r={};function n(i,a){var o=0,s=0,l=i.length,u=WJ(a);return Dt(a,function(h,d){var f=vIn(t,h),p=f?t.node(f).order:l;(f||h===u)&&(Dt(a.slice(s,d+1),function(g){Dt(t.predecessors(g),function(m){var v=t.node(m),y=v.order;(yu)&&c8t(r,f,h)})})}function i(a,o){var s=-1,l,u=0;return Dt(o,function(h,d){if(t.node(h).dummy==="border"){var f=t.predecessors(h);f.length&&(l=t.node(f[0]).order,n(o,u,d,s,l),u=d,s=l)}n(o,u,o.length,l,a.length)}),o}return PF(e,i),r}function vIn(t,e){if(t.node(e).dummy)return oCe(t.predecessors(e),function(r){return t.node(r).dummy})}function c8t(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 yIn(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function bIn(t,e,r,n){var i={},a={},o={};return Dt(e,function(s){Dt(s,function(l,u){i[l]=l,a[l]=l,o[l]=u})}),Dt(e,function(s){var l=-1;Dt(s,function(u){var h=n(u);if(h.length){h=NF(h,function(m){return o[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",()=>zIn(t));r(" runLayout",()=>RIn(n,r)),r(" updateInputGraph",()=>DIn(t,n))})}function RIn(t,e){e(" makeSpaceForEdgeLabels",()=>UIn(t)),e(" removeSelfEdges",()=>XIn(t)),e(" acyclic",()=>yMn(t)),e(" nestingGraph.run",()=>WMn(t)),e(" rank",()=>QMn(UNt(t))),e(" injectEdgeLabelProxies",()=>VIn(t)),e(" removeEmptyRanks",()=>SMn(t)),e(" nestingGraph.cleanup",()=>jMn(t)),e(" normalizeRanks",()=>AMn(t)),e(" assignRankMinMax",()=>QIn(t)),e(" removeEdgeLabelProxies",()=>GIn(t)),e(" normalize.run",()=>DMn(t)),e(" parentDummyChains",()=>dIn(t)),e(" addBorderSegments",()=>OMn(t)),e(" order",()=>uIn(t)),e(" insertSelfEdges",()=>KIn(t)),e(" adjustCoordinateSystem",()=>kMn(t)),e(" position",()=>EIn(t)),e(" positionSelfEdges",()=>ZIn(t)),e(" removeBorderNodes",()=>jIn(t)),e(" normalize.undo",()=>MMn(t)),e(" fixupEdgeLabelCoords",()=>YIn(t)),e(" undoCoordinateSystem",()=>EMn(t)),e(" translateGraph",()=>HIn(t)),e(" assignNodeIntersects",()=>WIn(t)),e(" reversePoints",()=>qIn(t)),e(" acyclic.undo",()=>xMn(t))}function DIn(t,e){Dt(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))}),Dt(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 LIn=["nodesep","edgesep","ranksep","marginx","marginy"],MIn={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},IIn=["acyclicer","ranker","rankdir","align"],PIn=["width","height"],NIn={width:0,height:0},BIn=["minlen","weight","width","height","labeloffset"],$In={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},FIn=["labelpos"];function zIn(t){var e=new hu({multigraph:!0,compound:!0}),r=wCe(t.graph());return e.setGraph(lCe({},MIn,xCe(r,LIn),qJ(r,IIn))),Dt(t.nodes(),function(n){var i=wCe(t.node(n));e.setNode(n,bLn(xCe(i,PIn),NIn)),e.setParent(n,t.parent(n))}),Dt(t.edges(),function(n){var i=wCe(t.edge(n));e.setEdge(n,lCe({},$In,xCe(i,BIn),qJ(i,FIn)))}),e}function UIn(t){var e=t.graph();e.ranksep/=2,Dt(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 VIn(t){Dt(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};B4(t,"edge-proxy",a,"_ep")}})}function QIn(t){var e=0;Dt(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=NC(e,n.maxRank))}),t.graph().maxRank=e}function GIn(t){Dt(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function HIn(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=t.graph(),o=a.marginx||0,s=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)}Dt(t.nodes(),function(u){l(t.node(u))}),Dt(t.edges(),function(u){var h=t.edge(u);Object.prototype.hasOwnProperty.call(h,"x")&&l(h)}),e-=o,n-=s,Dt(t.nodes(),function(u){var h=t.node(u);h.x-=e,h.y-=n}),Dt(t.edges(),function(u){var h=t.edge(u);Dt(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+o,a.height=i-n+s}function WIn(t){Dt(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),i=t.node(e.w),a,o;r.points?(a=r.points[0],o=r.points[r.points.length-1]):(r.points=[],a=i,o=n),r.points.unshift(VNt(n,a)),r.points.push(VNt(i,o))})}function YIn(t){Dt(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 qIn(t){Dt(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function jIn(t){Dt(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(WJ(r.borderLeft)),o=t.node(WJ(r.borderRight));r.width=Math.abs(o.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}}),Dt(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function XIn(t){Dt(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 KIn(t){var e=jJ(t);Dt(e,function(r){var n=0;Dt(r,function(i,a){var o=t.node(i);o.order=a+n,Dt(o.selfEdges,function(s){B4(t,"selfedge",{width:s.label.width,height:s.label.height,rank:o.rank,order:a+ ++n,e:s.e,label:s.label},"_se")}),delete o.selfEdges})})}function ZIn(t){Dt(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,o=r.x-i,s=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],r.label.x=r.x,r.label.y=r.y}})}function xCe(t,e){return YJ(qJ(t,e),Number)}function wCe(t){var e={};return Dt(t,function(r,n){e[n.toLowerCase()]=r}),e}var h8t=O((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),d8t=O((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),JIn=O(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram","shouldMergeSelfLoopSegments"),ePn=O((t,e,r,n,i)=>{const a=[],o=new Set;if(r.forEach(({start:h,end:d})=>{h!==n&&o.add(h),d!==n&&o.add(d)}),o.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 d8t(i);const s=a.reduce((h,d)=>({x:h.x+d.x/a.length,y:h.y+d.y/a.length}),{x:0,y:0}),l=s.x-e.x,u=s.y-e.y;return Math.abs(l)>Math.abs(u)?l>0?"right":"left":Math.abs(u)>0?u>0?"bottom":"top":d8t(i)},"getSelfLoopSide"),tPn=O((t,e="top",r=0,n=0)=>{const i=t.x,a=t.y-r,o=t.width/2,s=t.height/2,l=Math.max(36,Math.min(100,t.width*.8)),u=h8t(Math.max(n,t.width*.35),36,l),h=h8t(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{const d=a+s;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+o;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-o;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-s;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"),rPn=O((t,e,r="top",n=0,i={})=>{const o=t.x,s=t.y-n,l=i.width??0,u=i.height??0;switch(r){case"bottom":return{x:o,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:s};case"left":return{x:Math.min(...e.map(h=>h.x))-l/2-4,y:s};case"top":default:return{x:o,y:Math.min(...e.map(h=>h.y))-u/2-4}}},"getSelfLoopLabelPosition"),f8t=O((t,e=0,{mergeSelfLoops:r=!0}={})=>{var o;const n=new Map,i=[],a=(o=t.graph())==null?void 0:o.rankdir;return t.edges().forEach(s=>{const l=t.edge(s);if(r&&l.selfLoop){const u=l.selfLoop.id;n.has(u)||n.set(u,[]),n.get(u).push({edge:l,start:s.v,end:s.w})}else i.push({edge:l,start:s.v,end:s.w})}),n.forEach(s=>{if(s.length!==3){s.forEach(b=>i.push(b));return}s.sort((b,x)=>b.edge.selfLoop.order-x.edge.selfLoop.order);const[l,u,h]=s,d=l.edge.originalEdge??u.edge.originalEdge??h.edge.originalEdge??u.edge,f=t.node(d.start);if(!f){s.forEach(b=>i.push(b));return}const p={width:u.edge.width,height:u.edge.height},g=ePn(t,f,s,d.start,a),m=tPn(f,g,e,p.width??0),v=rPn(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"),p8t=O(async(t,e,r,n,i,a)=>{ye.warn("Graph in recursive render:XAX",U1(e),i);const o=e.graph().rankdir;ye.trace("Dir in recursive render - dir:",o);const s=t.insert("g").attr("class","root");e.nodes()?ye.info("Recursive render XXX",e.nodes()):ye.info("No nodes found for",e),e.edges().length>0&&ye.info("Recursive edges",e.edge(e.edges()[0]));const l=s.insert("g").attr("class","clusters"),u=s.insert("g").attr("class","edgePaths"),h=s.insert("g").attr("class","edgeLabels"),d=s.insert("g").attr("class","nodes"),f=JIn(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));ye.trace(`Setting data for parent cluster XXX +?)[ \r ]*`,LTe="[̀-ͯ]",g5n=new RegExp(LTe+"+$"),m5n="("+e6t+"+)|"+(p5n+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(LTe+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(LTe+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+f5n)+("|"+d5n+")");let t6t=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(m5n,"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 uf("EOF",new Jh(this,r,r));var n=this.tokenRegex.exec(e);if(n===null||n.index!==r)throw new Zt("Unexpected character: '"+e[r]+"'",new uf(e[r],new Jh(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 uf(i,new Jh(this,r,this.tokenRegex.lastIndex))}};class v5n{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 y5n=DPt;_e("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}}),_e("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}}),_e("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}}),_e("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}}),_e("\\@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}}),_e("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),_e("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var r6t={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};_e("\\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=r6t[e.text],n==null||n>=r)throw new Zt("Invalid base-"+r+" digit "+e.text);for(var i;(i=r6t[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,o=t.isDefined(a);if(o&&!e)throw new Zt("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!o&&!r)throw new Zt("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var s=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);s=parseInt(l),i=t.consumeArg().tokens}return o&&n||t.macros.set(a,{tokens:i,numArgs:s}),""};_e("\\newcommand",t=>MTe(t,!1,!0,!1)),_e("\\renewcommand",t=>MTe(t,!0,!1,!1)),_e("\\providecommand",t=>MTe(t,!0,!0,!0)),_e("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(r=>r.text).join("")),""}),_e("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(r=>r.text).join("")),""}),_e("\\show",t=>{var e=t.popToken(),r=e.text;return console.log(e,t.macros.get(r),W2[r],So.math[r],So.text[r]),""}),_e("\\bgroup","{"),_e("\\egroup","}"),_e("~","\\nobreakspace"),_e("\\lq","`"),_e("\\rq","'"),_e("\\aa","\\r a"),_e("\\AA","\\r A"),_e("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),_e("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),_e("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),_e("ℬ","\\mathscr{B}"),_e("ℰ","\\mathscr{E}"),_e("ℱ","\\mathscr{F}"),_e("ℋ","\\mathscr{H}"),_e("ℐ","\\mathscr{I}"),_e("ℒ","\\mathscr{L}"),_e("ℳ","\\mathscr{M}"),_e("ℛ","\\mathscr{R}"),_e("ℭ","\\mathfrak{C}"),_e("ℌ","\\mathfrak{H}"),_e("ℨ","\\mathfrak{Z}"),_e("\\Bbbk","\\Bbb{k}"),_e("\\llap","\\mathllap{\\textrm{#1}}"),_e("\\rlap","\\mathrlap{\\textrm{#1}}"),_e("\\clap","\\mathclap{\\textrm{#1}}"),_e("\\mathstrut","\\vphantom{(}"),_e("\\underbar","\\underline{\\text{#1}}"),_e("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}'),_e("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),_e("\\ne","\\neq"),_e("≠","\\neq"),_e("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),_e("∉","\\notin"),_e("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),_e("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),_e("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),_e("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),_e("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),_e("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),_e("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),_e("⟂","\\perp"),_e("‼","\\mathclose{!\\mkern-0.8mu!}"),_e("∌","\\notni"),_e("⌜","\\ulcorner"),_e("⌝","\\urcorner"),_e("⌞","\\llcorner"),_e("⌟","\\lrcorner"),_e("©","\\copyright"),_e("®","\\textregistered"),_e("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),_e("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),_e("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),_e("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),_e("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),_e("⋮","\\vdots"),_e("\\varGamma","\\mathit{\\Gamma}"),_e("\\varDelta","\\mathit{\\Delta}"),_e("\\varTheta","\\mathit{\\Theta}"),_e("\\varLambda","\\mathit{\\Lambda}"),_e("\\varXi","\\mathit{\\Xi}"),_e("\\varPi","\\mathit{\\Pi}"),_e("\\varSigma","\\mathit{\\Sigma}"),_e("\\varUpsilon","\\mathit{\\Upsilon}"),_e("\\varPhi","\\mathit{\\Phi}"),_e("\\varPsi","\\mathit{\\Psi}"),_e("\\varOmega","\\mathit{\\Omega}"),_e("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),_e("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),_e("\\boxed","\\fbox{$\\displaystyle{#1}$}"),_e("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),_e("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),_e("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),_e("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),_e("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var n6t={",":"\\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"},b5n=new Set(["bin","rel"]);_e("\\dots",function(t){var e="\\dotso",r=t.expandAfterFuture().text;return r in n6t?e=n6t[r]:(r.slice(0,4)==="\\not"||r in So.math&&b5n.has(So.math[r].group))&&(e="\\dotsb"),e});var ITe={")":!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};_e("\\dotso",function(t){var e=t.future().text;return e in ITe?"\\ldots\\,":"\\ldots"}),_e("\\dotsc",function(t){var e=t.future().text;return e in ITe&&e!==","?"\\ldots\\,":"\\ldots"}),_e("\\cdots",function(t){var e=t.future().text;return e in ITe?"\\@cdots\\,":"\\@cdots"}),_e("\\dotsb","\\cdots"),_e("\\dotsm","\\cdots"),_e("\\dotsi","\\!\\cdots"),_e("\\dotsx","\\ldots\\,"),_e("\\DOTSI","\\relax"),_e("\\DOTSB","\\relax"),_e("\\DOTSX","\\relax"),_e("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),_e("\\,","\\tmspace+{3mu}{.1667em}"),_e("\\thinspace","\\,"),_e("\\>","\\mskip{4mu}"),_e("\\:","\\tmspace+{4mu}{.2222em}"),_e("\\medspace","\\:"),_e("\\;","\\tmspace+{5mu}{.2777em}"),_e("\\thickspace","\\;"),_e("\\!","\\tmspace-{3mu}{.1667em}"),_e("\\negthinspace","\\!"),_e("\\negmedspace","\\tmspace-{4mu}{.2222em}"),_e("\\negthickspace","\\tmspace-{5mu}{.277em}"),_e("\\enspace","\\kern.5em "),_e("\\enskip","\\hskip.5em\\relax"),_e("\\quad","\\hskip1em\\relax"),_e("\\qquad","\\hskip2em\\relax"),_e("\\tag","\\@ifstar\\tag@literal\\tag@paren"),_e("\\tag@paren","\\tag@literal{({#1})}"),_e("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new Zt("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),_e("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),_e("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),_e("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),_e("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),_e("\\newline","\\\\\\relax"),_e("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var i6t=ir(z0["Main-Regular"][84][1]-.7*z0["Main-Regular"][65][1]);_e("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+i6t+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),_e("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+i6t+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),_e("\\hspace","\\@ifstar\\@hspacer\\@hspace"),_e("\\@hspace","\\hskip #1\\relax"),_e("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),_e("\\ordinarycolon",":"),_e("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),_e("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),_e("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),_e("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),_e("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),_e("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),_e("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),_e("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),_e("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),_e("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),_e("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),_e("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),_e("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),_e("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),_e("∷","\\dblcolon"),_e("∹","\\eqcolon"),_e("≔","\\coloneqq"),_e("≕","\\eqqcolon"),_e("⩴","\\Coloneqq"),_e("\\ratio","\\vcentcolon"),_e("\\coloncolon","\\dblcolon"),_e("\\colonequals","\\coloneqq"),_e("\\coloncolonequals","\\Coloneqq"),_e("\\equalscolon","\\eqqcolon"),_e("\\equalscoloncolon","\\Eqqcolon"),_e("\\colonminus","\\coloneq"),_e("\\coloncolonminus","\\Coloneq"),_e("\\minuscolon","\\eqcolon"),_e("\\minuscoloncolon","\\Eqcolon"),_e("\\coloncolonapprox","\\Colonapprox"),_e("\\coloncolonsim","\\Colonsim"),_e("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),_e("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),_e("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),_e("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),_e("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),_e("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),_e("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),_e("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),_e("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),_e("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),_e("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),_e("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),_e("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),_e("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),_e("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),_e("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),_e("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),_e("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),_e("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),_e("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),_e("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),_e("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),_e("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),_e("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),_e("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),_e("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),_e("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),_e("\\imath","\\html@mathml{\\@imath}{ı}"),_e("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),_e("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),_e("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),_e("⟦","\\llbracket"),_e("⟧","\\rrbracket"),_e("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),_e("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),_e("⦃","\\lBrace"),_e("⦄","\\rBrace"),_e("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),_e("⦵","\\minuso"),_e("\\darr","\\downarrow"),_e("\\dArr","\\Downarrow"),_e("\\Darr","\\Downarrow"),_e("\\lang","\\langle"),_e("\\rang","\\rangle"),_e("\\uarr","\\uparrow"),_e("\\uArr","\\Uparrow"),_e("\\Uarr","\\Uparrow"),_e("\\N","\\mathbb{N}"),_e("\\R","\\mathbb{R}"),_e("\\Z","\\mathbb{Z}"),_e("\\alef","\\aleph"),_e("\\alefsym","\\aleph"),_e("\\Alpha","\\mathrm{A}"),_e("\\Beta","\\mathrm{B}"),_e("\\bull","\\bullet"),_e("\\Chi","\\mathrm{X}"),_e("\\clubs","\\clubsuit"),_e("\\cnums","\\mathbb{C}"),_e("\\Complex","\\mathbb{C}"),_e("\\Dagger","\\ddagger"),_e("\\diamonds","\\diamondsuit"),_e("\\empty","\\emptyset"),_e("\\Epsilon","\\mathrm{E}"),_e("\\Eta","\\mathrm{H}"),_e("\\exist","\\exists"),_e("\\harr","\\leftrightarrow"),_e("\\hArr","\\Leftrightarrow"),_e("\\Harr","\\Leftrightarrow"),_e("\\hearts","\\heartsuit"),_e("\\image","\\Im"),_e("\\infin","\\infty"),_e("\\Iota","\\mathrm{I}"),_e("\\isin","\\in"),_e("\\Kappa","\\mathrm{K}"),_e("\\larr","\\leftarrow"),_e("\\lArr","\\Leftarrow"),_e("\\Larr","\\Leftarrow"),_e("\\lrarr","\\leftrightarrow"),_e("\\lrArr","\\Leftrightarrow"),_e("\\Lrarr","\\Leftrightarrow"),_e("\\Mu","\\mathrm{M}"),_e("\\natnums","\\mathbb{N}"),_e("\\Nu","\\mathrm{N}"),_e("\\Omicron","\\mathrm{O}"),_e("\\plusmn","\\pm"),_e("\\rarr","\\rightarrow"),_e("\\rArr","\\Rightarrow"),_e("\\Rarr","\\Rightarrow"),_e("\\real","\\Re"),_e("\\reals","\\mathbb{R}"),_e("\\Reals","\\mathbb{R}"),_e("\\Rho","\\mathrm{P}"),_e("\\sdot","\\cdot"),_e("\\sect","\\S"),_e("\\spades","\\spadesuit"),_e("\\sub","\\subset"),_e("\\sube","\\subseteq"),_e("\\supe","\\supseteq"),_e("\\Tau","\\mathrm{T}"),_e("\\thetasym","\\vartheta"),_e("\\weierp","\\wp"),_e("\\Zeta","\\mathrm{Z}"),_e("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),_e("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),_e("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),_e("\\bra","\\mathinner{\\langle{#1}|}"),_e("\\ket","\\mathinner{|{#1}\\rangle}"),_e("\\braket","\\mathinner{\\langle{#1}\\rangle}"),_e("\\Bra","\\left\\langle#1\\right|"),_e("\\Ket","\\left|#1\\right\\rangle");var a6t=t=>e=>{var r=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.consumeArg().tokens,o=e.macros.get("|"),s=e.macros.get("\\|");e.macros.beginGroup();var l=d=>f=>{t&&(f.macros.set("|",o),i.length&&f.macros.set("\\|",s));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}};_e("\\bra@ket",a6t(!1)),_e("\\bra@set",a6t(!0)),_e("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),_e("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),_e("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),_e("\\angln","{\\angl n}"),_e("\\blue","\\textcolor{##6495ed}{#1}"),_e("\\orange","\\textcolor{##ffa500}{#1}"),_e("\\pink","\\textcolor{##ff00af}{#1}"),_e("\\red","\\textcolor{##df0030}{#1}"),_e("\\green","\\textcolor{##28ae7b}{#1}"),_e("\\gray","\\textcolor{gray}{#1}"),_e("\\purple","\\textcolor{##9d38bd}{#1}"),_e("\\blueA","\\textcolor{##ccfaff}{#1}"),_e("\\blueB","\\textcolor{##80f6ff}{#1}"),_e("\\blueC","\\textcolor{##63d9ea}{#1}"),_e("\\blueD","\\textcolor{##11accd}{#1}"),_e("\\blueE","\\textcolor{##0c7f99}{#1}"),_e("\\tealA","\\textcolor{##94fff5}{#1}"),_e("\\tealB","\\textcolor{##26edd5}{#1}"),_e("\\tealC","\\textcolor{##01d1c1}{#1}"),_e("\\tealD","\\textcolor{##01a995}{#1}"),_e("\\tealE","\\textcolor{##208170}{#1}"),_e("\\greenA","\\textcolor{##b6ffb0}{#1}"),_e("\\greenB","\\textcolor{##8af281}{#1}"),_e("\\greenC","\\textcolor{##74cf70}{#1}"),_e("\\greenD","\\textcolor{##1fab54}{#1}"),_e("\\greenE","\\textcolor{##0d923f}{#1}"),_e("\\goldA","\\textcolor{##ffd0a9}{#1}"),_e("\\goldB","\\textcolor{##ffbb71}{#1}"),_e("\\goldC","\\textcolor{##ff9c39}{#1}"),_e("\\goldD","\\textcolor{##e07d10}{#1}"),_e("\\goldE","\\textcolor{##a75a05}{#1}"),_e("\\redA","\\textcolor{##fca9a9}{#1}"),_e("\\redB","\\textcolor{##ff8482}{#1}"),_e("\\redC","\\textcolor{##f9685d}{#1}"),_e("\\redD","\\textcolor{##e84d39}{#1}"),_e("\\redE","\\textcolor{##bc2612}{#1}"),_e("\\maroonA","\\textcolor{##ffbde0}{#1}"),_e("\\maroonB","\\textcolor{##ff92c6}{#1}"),_e("\\maroonC","\\textcolor{##ed5fa6}{#1}"),_e("\\maroonD","\\textcolor{##ca337c}{#1}"),_e("\\maroonE","\\textcolor{##9e034e}{#1}"),_e("\\purpleA","\\textcolor{##ddd7ff}{#1}"),_e("\\purpleB","\\textcolor{##c6b9fc}{#1}"),_e("\\purpleC","\\textcolor{##aa87ff}{#1}"),_e("\\purpleD","\\textcolor{##7854ab}{#1}"),_e("\\purpleE","\\textcolor{##543b78}{#1}"),_e("\\mintA","\\textcolor{##f5f9e8}{#1}"),_e("\\mintB","\\textcolor{##edf2df}{#1}"),_e("\\mintC","\\textcolor{##e0e5cc}{#1}"),_e("\\grayA","\\textcolor{##f6f7f7}{#1}"),_e("\\grayB","\\textcolor{##f0f1f2}{#1}"),_e("\\grayC","\\textcolor{##e3e5e6}{#1}"),_e("\\grayD","\\textcolor{##d6d8da}{#1}"),_e("\\grayE","\\textcolor{##babec2}{#1}"),_e("\\grayF","\\textcolor{##888d93}{#1}"),_e("\\grayG","\\textcolor{##626569}{#1}"),_e("\\grayH","\\textcolor{##3b3e40}{#1}"),_e("\\grayI","\\textcolor{##21242c}{#1}"),_e("\\kaBlue","\\textcolor{##314453}{#1}"),_e("\\kaGreen","\\textcolor{##71B307}{#1}");var o6t={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class x5n{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 v5n(y5n,r.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new t6t(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 uf("EOF",n.loc)),this.pushTokens(i),new uf("",Jh.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,o=0,s=0;do{if(a=this.popToken(),r.push(a),a.text==="{")++o;else if(a.text==="}"){if(--o,o===-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[s]:"}")+"'",a);if(e&&n)if((o===0||o===1&&e[s]==="{")&&a.text===e[s]){if(++s,s===e.length){r.splice(-s,s);break}}else s=0}while(o!==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,o=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var s=a.length-1;s>=0;--s){var l=a[s];if(l.text==="#"){if(s===0)throw new Zt("Incomplete placeholder at end of macro body",l);if(l=a[--s],l.text==="#")a.splice(s+1,1);else if(/^[1-9]$/.test(l.text))a.splice(s,2,...o[+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 uf(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 o=i.replace(/##/g,"");o.includes("#"+(a+1));)++a;for(var s=new t6t(i,this.settings),l=[],u=s.lex();u.text!=="EOF";)l.push(u),u=s.lex();l.reverse();var h={tokens:l,numArgs:a};return h}return i}isDefined(e){return this.macros.has(e)||W2.hasOwnProperty(e)||So.math.hasOwnProperty(e)||So.text.hasOwnProperty(e)||o6t.hasOwnProperty(e)}isExpandable(e){var r=this.macros.get(e);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:W2.hasOwnProperty(e)&&!W2[e].primitive}}var s6t=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,EJ=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),PTe={"́":{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"}},l6t={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let c6t=class esr{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 x5n(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 uf("}")),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(esr.endOfExpression.has(i.text)||r&&i.text===r||e&&W2[i.text]&&W2[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&&(RIt(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)),o={type:"textord",mode:"text",loc:Jh.range(e),text:r};else return null;if(this.consume(),a)for(var h=0;h0){if(++e>=cRn)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function E4(t){return function(){return t}}var DJ=function(){try{var t=MC(Object,"defineProperty");return t({},"",{}),t}catch{}}(),fRn=DJ?function(t,e){return DJ(t,"toString",{configurable:!0,enumerable:!1,value:E4(e),writable:!0})}:DC,k6t=dRn(fRn);function E6t(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}var yRn=9007199254740991,bRn=/^(?:0|[1-9]\d*)$/;function LJ(t,e){var r=typeof t;return e=e??yRn,!!e&&(r=="number"||r!="symbol"&&bRn.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=ARn}function Y2(t){return t!=null&&zTe(t.length)&&!CF(t)}function kF(t,e,r){if(!hf(r))return!1;var n=typeof e;return(n=="number"?Y2(r)&&LJ(e,r.length):n=="string"&&e in r)?_4(r[e],t):!1}function SRn(t){return PJ(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,o&&kF(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}function L4n(t,e){var r=this.__data__,n=FJ(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function B1(t){var e=-1,r=t==null?0:t.length;for(this.clear();++es))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&BDn?new MF:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&kF(e[0],e[1],i)&&(n=1);++r-1?i[a?e[o]:o]:void 0}}var OLn=Math.max;function kLn(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Q5n(r);return i<0&&(i=OLn(n+i,0)),_6t(t,q2(e),i)}var oCe=CLn(kLn);function ENt(t,e){var r=-1,n=Y2(t)?Array(t.length):[];return HJ(t,function(i,a,o){n[++r]=e(i,a,o)}),n}function Ys(t,e){var r=Ws(t)?k4:ENt;return r(t,q2(e))}function ELn(t,e){return t==null?t:tCe(t,aCe(e),IC)}function _Ln(t,e){return t&&rCe(t,aCe(e))}function RLn(t,e){return t>e}var DLn=Object.prototype,LLn=DLn.hasOwnProperty;function MLn(t,e){return t!=null&&LLn.call(t,e)}function _Nt(t,e){return t!=null&&SNt(t,e,MLn)}function ILn(t,e){return k4(e,function(r){return t[r]})}function z1(t){return t==null?[]:ILn(t,df(t))}var PLn="[object Map]",NLn="[object Set]",BLn=Object.prototype,$Ln=BLn.hasOwnProperty;function RNt(t){if(t==null)return!0;if(Y2(t)&&(Ws(t)||typeof t=="string"||typeof t.splice=="function"||D4(t)||$J(t)||R4(t)))return!t.length;var e=_p(t);if(e==PLn||e==NLn)return!t.size;if(NJ(t))return!U6t(t).length;for(var r in t)if($Ln.call(t,r))return!1;return!0}function ws(t){return t===void 0}function DNt(t,e){return te||a&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&t=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}function GLn(t,e,r){e.length?e=k4(e,function(a){return Ws(a)?function(o){return VJ(o,a.length===1?a[0]:a)}:a}):e=[DC];var n=-1;e=k4(e,BJ(q2));var i=ENt(t,function(a,o,s){var l=k4(e,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return ULn(i,function(a,o){return QLn(a,o,r)})}function HLn(t,e){return zLn(t,e,function(r,n){return TNt(t,n)})}var qJ=Y4n(function(t,e){return t==null?{}:HLn(t,e)}),WLn=Math.ceil,YLn=Math.max;function qLn(t,e,r,n){for(var i=-1,a=YLn(WLn((e-t)/(r||1)),0),o=Array(a);a--;)o[++i]=t,t+=r;return o}function jLn(t){return function(e,r,n){return n&&typeof n!="number"&&kF(e,r,n)&&(r=n=void 0),e=RJ(e),r===void 0?(r=e,e=0):r=RJ(r),n=n===void 0?e1&&kF(t,e[0],e[1])?e=[]:r>2&&kF(e[0],e[1],e[2])&&(e=[e[0]]),GLn(t,HTe(e),[])}),KLn=1/0,ZLn=I4&&1/ZTe(new I4([,-0]))[1]==KLn?function(t){return new I4(t)}:lRn,JLn=200;function eMn(t,e,r){var n=-1,i=vRn,a=t.length,o=!0,s=[],l=s;if(a>=JLn){var u=ZLn(t);if(u)return ZTe(u);o=!1,i=gNt,l=new MF}else l=s;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]=BC,this._children[e]={},this._children[BC][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],Dt(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),Dt(df(this._in[e]),r),delete this._in[e],delete this._preds[e],Dt(df(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(ws(r))r=BC;else{r+="";for(var n=r;!ws(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!==BC)return r}}children(e){if(ws(e)&&(e=BC),this._isCompound){var r=this._children[e];if(r)return df(r)}else{if(e===BC)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return df(r)}successors(e){var r=this._sucs[e];if(r)return df(r)}neighbors(e){var r=this.predecessors(e);if(r)return tMn(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;Dt(this._nodes,function(o,s){e(s)&&r.setNode(s,o)}),Dt(this._edgeObjs,function(o){r.hasNode(o.v)&&r.hasNode(o.w)&&r.setEdge(o,n.edge(o))});var i={};function a(o){var s=n.parent(o);return s===void 0||r.hasNode(s)?(i[o]=s,s):s in i?i[s]:a(s)}return this._isCompound&&Dt(r.nodes(),function(o){r.setParent(o,a(o))}),r}setDefaultEdgeLabel(e){return CF(e)||(e=E4(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return z1(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return PF(e,function(a,o){return i.length>1?n.setEdge(a,o,r):n.setEdge(a,o),o}),this}setEdge(){var e,r,n,i,a=!1,o=arguments[0];typeof o=="object"&&o!==null&&"v"in o?(e=o.v,r=o.w,n=o.name,arguments.length===2&&(i=arguments[1],a=!0)):(e=o,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,r=""+r,ws(n)||(n=""+n);var s=BF(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,s))return a&&(this._edgeLabels[s]=i),this;if(!ws(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[s]=a?i:this._defaultEdgeLabelFn(e,r,n);var l=oMn(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[s]=l,MNt(this._preds[r],e),MNt(this._sucs[e],r),this._in[r][s]=l,this._out[e][s]=l,this._edgeCount++,this}edge(e,r,n){var i=arguments.length===1?hCe(this._isDirected,arguments[0]):BF(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?hCe(this._isDirected,arguments[0]):BF(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?hCe(this._isDirected,arguments[0]):BF(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],INt(this._preds[r],e),INt(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=z1(n);return r?F1(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=z1(n);return r?F1(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))}}hu.prototype._nodeCount=0,hu.prototype._edgeCount=0;function MNt(t,e){t[e]?t[e]++:t[e]=1}function INt(t,e){--t[e]||delete t[e]}function BF(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var o=i;i=a,a=o}return i+LNt+a+LNt+(ws(n)?aMn:n)}function oMn(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return n&&(s.name=n),s}function hCe(t,e){return BF(t,e.v,e.w,e.name)}function U1(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:sMn(t),edges:lMn(t)};return ws(t.graph())||(e.value=EDn(t.graph())),e}function sMn(t){return Ys(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return ws(r)||(i.value=r),ws(n)||(i.parent=n),i})}function lMn(t){return Ys(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return ws(e.name)||(n.name=e.name),ws(r)||(n.value=r),n})}var Ln=new Map,j2=new Map,PNt=new Map,NNt=O(()=>{j2.clear(),PNt.clear(),Ln.clear()},"clear"),$C=O((t,e)=>{const r=j2.get(e)||[];return ye.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),cMn=O((t,e)=>{const r=j2.get(e)||[];return ye.info("Descendants of ",e," is ",r),ye.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||$C(t.v,e)||$C(t.w,e)||r.includes(t.w):(ye.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),dCe=O((t,e,r,n)=>{ye.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),ye.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(a=>{if(e.children(a).length>0)dCe(a,e,r,n);else{const o=e.node(a);ye.info("cp ",a," to ",n," with parent ",t),r.setNode(a,o),n!==e.parent(a)&&(ye.warn("Setting parent",a,e.parent(a)),r.setParent(a,e.parent(a))),t!==n&&a!==t?(ye.debug("Setting parent",a,t),r.setParent(a,t)):(ye.info("In copy ",t,"root",n,"data",e.node(t),n),ye.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==n,"node!==clusterId",a!==t));const s=e.edges(a);ye.debug("Copying Edges",s),s.forEach(l=>{ye.info("Edge",l);const u=e.edge(l.v,l.w,l.name);ye.info("Edge data",u,n);try{if(cMn(l,n)){const h=j2.get(n)||[],d=h.includes(l.v)||$C(l.v,n)||l.v===n,f=h.includes(l.w)||$C(l.w,n)||l.w===n;if(d&&f)ye.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),ye.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]));else{const p=d?n:l.v,g=f?n:l.w;ye.info("Rebinding cross-boundary edge as ",p,g,u,l.name),e.setEdge(p,g,u,l.name)}}else ye.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(h){ye.error(h)}})}ye.debug("Removing node",a),e.removeNode(a)})},"copy"),BNt=O((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)PNt.set(i,t),n=[...n,...BNt(i,e)];return n},"extractDescendants"),uMn=O((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})),o=i.map(l=>({v:l.v,w:l.w}));return a.filter(l=>o.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),N4=O((t,e,r)=>{const n=e.children(t);if(ye.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const a of n){const o=N4(a,e,r),s=uMn(e,r,o);if(o)if(s.length>0)i=o;else return o}return i},"findNonClusterChild"),$Nt=O(t=>!Ln.has(t)||!Ln.get(t).externalConnections?t:Ln.has(t)?Ln.get(t).id:t,"getAnchorId"),hMn=O((t,e)=>{var r;if(!t||e>10){ye.debug("Opting out, no graph ");return}else ye.debug("Opting in, graph ");t.nodes().forEach(function(n){t.children(n).length>0&&(ye.warn("Cluster identified",n," Replacement id in edges: ",N4(n,t,n)),j2.set(n,BNt(n,t)),Ln.set(n,{id:N4(n,t,n),clusterData:t.node(n)}))}),t.nodes().forEach(function(n){const i=t.children(n),a=t.edges();i.length>0?(ye.debug("Cluster identified",n,j2),a.forEach(o=>{const s=$C(o.v,n),l=$C(o.w,n);s^l&&(ye.warn("Edge: ",o," leaves cluster ",n),ye.warn("Descendants of XXX ",n,": ",j2.get(n)),Ln.get(n).externalConnections=!0)})):ye.debug("Not a cluster ",n,j2)});for(let n of Ln.keys()){const i=Ln.get(n).id,a=t.parent(i);a!==n&&Ln.has(a)&&!Ln.get(a).externalConnections&&(Ln.get(n).id=a);const o=t.edges().some(s=>s.v===n);if(i&&((r=Ln.get(n))!=null&&r.externalConnections)&&o&&UNt(t,i,n)){const s=fMn(t,n,t.parent(i));s&&(Ln.get(n).id=s)}}t.edges().forEach(function(n){const i=t.edge(n);ye.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),ye.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(t.edge(n)));let a=n.v,o=n.w;if(ye.warn("Fix XXX",Ln,"ids:",n.v,n.w,"Translating: ",Ln.get(n.v)," --- ",Ln.get(n.w)),Ln.get(n.v)||Ln.get(n.w)){if(ye.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),a=$Nt(n.v),o=$Nt(n.w),t.removeEdge(n.v,n.w,n.name),a!==n.v){const s=t.parent(a);Ln.get(s).externalConnections=!0,i.fromCluster=n.v}if(o!==n.w){const s=t.parent(o);Ln.get(s).externalConnections=!0,i.toCluster=n.w}ye.warn("Fix Replacing with XXX",a,o,n.name),t.setEdge(a,o,i,n.name)}}),ye.warn("Adjusted Graph",U1(t)),FNt(t,0),ye.trace(Ln)},"adjustClustersAndEdges"),FNt=O((t,e)=>{var i,a,o,s;if(ye.warn("extractor - ",e,U1(t),t.children("D")),e>10){ye.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){ye.debug("Done, no node has children",t.nodes());return}ye.debug("Nodes = ",r,e);for(const l of r)if(ye.debug("Extracting node",l,Ln,Ln.has(l)&&!Ln.get(l).externalConnections,!t.parent(l),t.node(l),t.children("D")," Depth ",e),!Ln.has(l))ye.debug("Not a cluster",l,e);else if((a=(i=Ln.get(l))==null?void 0:i.clusterData)!=null&&a.explicitDir&&t.children(l)&&t.children(l).length>0){ye.warn("Cluster with explicit dir, creating subgraph for children",l,e);const u=Ln.get(l).clusterData.dir,h=new hu({multigraph:!0,compound:!0}).setGraph({rankdir:u,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});dCe(l,t,h,l);const d=t.node(l)||{};t.setNode(l,{...d,clusterNode:!0,id:l,clusterData:Ln.get(l).clusterData,label:Ln.get(l).label,graph:h}),ye.warn("Subgraph for cluster with explicit dir created:",l,U1(h))}else if(!Ln.get(l).externalConnections&&t.children(l)&&t.children(l).length>0){ye.warn("Cluster without external connections, without a parent and with children",l,e);let h=t.graph().rankdir==="TB"?"LR":"TB";(s=(o=Ln.get(l))==null?void 0:o.clusterData)!=null&&s.dir&&(h=Ln.get(l).clusterData.dir,ye.warn("Fixing dir",Ln.get(l).clusterData.dir,h));const d=new hu({multigraph:!0,compound:!0}).setGraph({rankdir:h,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});dCe(l,t,d,l);const f=t.node(l)||{};t.setNode(l,{...f,clusterNode:!0,id:l,clusterData:Ln.get(l).clusterData,label:Ln.get(l).label,graph:d}),ye.debug("Old graph after copy",U1(t))}else ye.warn("Cluster ** ",l," **not meeting the criteria !externalConnections:",!Ln.get(l).externalConnections," no parent: ",!t.parent(l)," children ",t.children(l)&&t.children(l).length>0,t.children("D"),e),ye.debug(Ln);r=t.nodes(),ye.warn("New list of nodes",r);for(const l of r){const u=t.node(l);ye.warn(" Now next level",l,u),u!=null&&u.clusterNode&&FNt(u.graph,e+1)}},"extractor"),zNt=O((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),a=zNt(t,i);r=[...r,...a]}),r},"sorter"),dMn=O(t=>zNt(t,t.children()),"sortNodesByHierarchy"),UNt=O((t,e,r)=>{let n=t.parent(e);for(;n&&n!==r;){const i=Ln.get(n);if(i&&!i.externalConnections)return!0;n=t.parent(n)}return!1},"isNodeInExtractableCluster"),fMn=O((t,e,r)=>{const n=t.children(e)??[];for(const i of n){if(i===r||$C(i,r))continue;const a=N4(i,t,e);if(a&&!UNt(t,a,e))return a}return null},"findSafeAnchorNode");class pMn{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return VNt(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&VNt(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,gMn)),n=n._prev;return"["+e.join(", ")+"]"}}function VNt(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function gMn(t,e){if(t!=="_next"&&t!=="_prev")return e}var mMn=E4(1);function vMn(t,e){if(t.nodeCount()<=1)return[];var r=bMn(t,e||mMn),n=yMn(r.graph,r.buckets,r.zeroIdx);return M4(Ys(n,function(i){return t.outEdges(i.v,i.w)}))}function yMn(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],o;t.nodeCount();){for(;o=a.dequeue();)fCe(t,e,r,o);for(;o=i.dequeue();)fCe(t,e,r,o);if(t.nodeCount()){for(var s=e.length-2;s>0;--s)if(o=e[s].dequeue(),o){n=n.concat(fCe(t,e,r,o,!0));break}}}return n}function fCe(t,e,r,n,i){var a=i?[]:void 0;return Dt(t.inEdges(n.v),function(o){var s=t.edge(o),l=t.node(o.v);i&&a.push({v:o.v,w:o.w}),l.out-=s,pCe(e,r,l)}),Dt(t.outEdges(n.v),function(o){var s=t.edge(o),l=o.w,u=t.node(l);u.in-=s,pCe(e,r,u)}),t.removeNode(n.v),a}function bMn(t,e){var r=new hu,n=0,i=0;Dt(t.nodes(),function(s){r.setNode(s,{v:s,in:0,out:0})}),Dt(t.edges(),function(s){var l=r.edge(s.v,s.w)||0,u=e(s),h=l+u;r.setEdge(s.v,s.w,h),i=Math.max(i,r.node(s.v).out+=u),n=Math.max(n,r.node(s.w).in+=u)});var a=P4(i+n+3).map(function(){return new pMn}),o=n+1;return Dt(r.nodes(),function(s){pCe(a,o,r.node(s))}),{graph:r,buckets:a,zeroIdx:o}}function pCe(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 xMn(t){var e=t.graph().acyclicer==="greedy"?vMn(t,r(t)):wMn(t);Dt(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,uCe("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function wMn(t){var e=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,Dt(t.outEdges(a),function(o){Object.prototype.hasOwnProperty.call(r,o.w)?e.push(o):i(o.w)}),delete r[a])}return Dt(t.nodes(),i),e}function AMn(t){Dt(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 B4(t,e,r,n){var i;do i=uCe(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function SMn(t){var e=new hu().setGraph(t.graph());return Dt(t.nodes(),function(r){e.setNode(r,t.node(r))}),Dt(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 QNt(t){var e=new hu({multigraph:t.isMultigraph()}).setGraph(t.graph());return Dt(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),Dt(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function GNt(t,e){var r=t.x,n=t.y,i=e.x-r,a=e.y-n,o=t.width/2,s=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)*o>Math.abs(i)*s?(a<0&&(s=-s),l=s*i/a,u=s):(i<0&&(o=-o),l=o,u=o*a/i),{x:r+l,y:n+u}}function jJ(t){var e=Ys(P4(WNt(t)+1),function(){return[]});return Dt(t.nodes(),function(r){var n=t.node(r),i=n.rank;ws(i)||(e[i][n.order]=r)}),e}function TMn(t){var e=IF(Ys(t.nodes(),function(r){return t.node(r).rank}));Dt(t.nodes(),function(r){var n=t.node(r);_Nt(n,"rank")&&(n.rank-=e)})}function CMn(t){var e=IF(Ys(t.nodes(),function(a){return t.node(a).rank})),r=[];Dt(t.nodes(),function(a){var o=t.node(a).rank-e;r[o]||(r[o]=[]),r[o].push(a)});var n=0,i=t.graph().nodeRankFactor;Dt(r,function(a,o){ws(a)&&o%i!==0?--n:n&&Dt(a,function(s){t.node(s).rank+=n})})}function HNt(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),B4(t,"border",i,e)}function WNt(t){return NC(Ys(t.nodes(),function(e){var r=t.node(e).rank;if(!ws(r))return r}))}function OMn(t,e){var r={lhs:[],rhs:[]};return Dt(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function kMn(t,e){return e()}function EMn(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&&Dt(n,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;ao.lim&&(s=o,l=!0);var u=F1(e.edges(),function(h){return l===i8t(t,t.node(h.v),s)&&l!==i8t(t,t.node(h.w),s)});return cCe(u,function(h){return $F(e,h)})}function n8t(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),bCe(t),yCe(t,e),QMn(t,e)}function QMn(t,e){var r=oCe(t.nodes(),function(i){return!e.node(i).parent}),n=UMn(t,r);n=n.slice(1),Dt(n,function(i){var a=t.node(i).parent,o=e.edge(i,a),s=!1;o||(o=e.edge(a,i),s=!0),e.node(i).rank=e.node(a).rank+(s?o.minlen:-o.minlen)})}function GMn(t,e,r){return t.hasEdge(e,r)}function i8t(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function HMn(t){switch(t.graph().ranker){case"network-simplex":a8t(t);break;case"tight-tree":YMn(t);break;case"longest-path":WMn(t);break;default:a8t(t)}}var WMn=vCe;function YMn(t){vCe(t),XNt(t)}function a8t(t){FC(t)}function qMn(t){var e=B4(t,"root",{},"_root"),r=jMn(t),n=NC(z1(r))-1,i=2*n+1;t.graph().nestingRoot=e,Dt(t.edges(),function(o){t.edge(o).minlen*=i});var a=XMn(t)+1;Dt(t.children(),function(o){o8t(t,e,i,a,n,r,o)}),t.graph().nodeRankFactor=i}function o8t(t,e,r,n,i,a,o){var s=t.children(o);if(!s.length){o!==e&&t.setEdge(e,o,{weight:0,minlen:r});return}var l=HNt(t,"_bt"),u=HNt(t,"_bb"),h=t.node(o);t.setParent(l,o),h.borderTop=l,t.setParent(u,o),h.borderBottom=u,Dt(s,function(d){o8t(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[o]+1;t.setEdge(l,p,{weight:m,minlen:v,nestingEdge:!0}),t.setEdge(g,u,{weight:m,minlen:v,nestingEdge:!0})}),t.parent(o)||t.setEdge(e,l,{weight:0,minlen:i+a[o]})}function jMn(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&&Dt(a,function(o){r(o,i+1)}),e[n]=i}return Dt(t.children(),function(n){r(n,1)}),e}function XMn(t){return PF(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function KMn(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,Dt(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function ZMn(t,e,r){var n={},i;Dt(r,function(a){for(var o=t.parent(a),s,l;o;){if(s=t.parent(o),s?(l=n[s],n[s]=o):(l=i,i=o),l&&l!==o){e.setEdge(l,o);return}o=s}})}function JMn(t,e,r){var n=eIn(t),i=new hu({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return t.node(a)});return Dt(t.nodes(),function(a){var o=t.node(a),s=t.parent(a);(o.rank===e||o.minRank<=e&&e<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||n),Dt(t[r](a),function(l){var u=l.v===a?l.w:l.v,h=i.edge(u,a),d=ws(h)?0:h.weight;i.setEdge(u,a,{weight:t.edge(l).weight+d})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&i.setNode(a,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))}),i}function eIn(t){for(var e;t.hasNode(e=uCe("_root")););return e}function tIn(t,e){for(var r=0,n=1;n0;)h%2&&(d+=s[h+1]),h=h-1>>1,s[h]+=u.weight;l+=u.weight*d})),l}function nIn(t){var e={},r=F1(t.nodes(),function(s){return!t.children(s).length}),n=NC(Ys(r,function(s){return t.node(s).rank})),i=Ys(P4(n+1),function(){return[]});function a(s){if(!_Nt(e,s)){e[s]=!0;var l=t.node(s);i[l.rank].push(s),Dt(t.successors(s),a)}}var o=NF(r,function(s){return t.node(s).rank});return Dt(o,a),i}function iIn(t,e){return Ys(e,function(r){var n=t.inEdges(r);if(n.length){var i=PF(n,function(a,o){var s=t.edge(o),l=t.node(o.v);return{sum:a.sum+s.weight*l.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function aIn(t,e){var r={};Dt(t,function(i,a){var o=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};ws(i.barycenter)||(o.barycenter=i.barycenter,o.weight=i.weight)}),Dt(e.edges(),function(i){var a=r[i.v],o=r[i.w];!ws(a)&&!ws(o)&&(o.indegree++,a.out.push(r[i.w]))});var n=F1(r,function(i){return!i.indegree});return oIn(n)}function oIn(t){var e=[];function r(a){return function(o){o.merged||(ws(o.barycenter)||ws(a.barycenter)||o.barycenter>=a.barycenter)&&sIn(a,o)}}function n(a){return function(o){o.in.push(a),--o.indegree===0&&t.push(o)}}for(;t.length;){var i=t.pop();e.push(i),Dt(i.in.reverse(),r(i)),Dt(i.out,n(i))}return Ys(F1(e,function(a){return!a.merged}),function(a){return qJ(a,["vs","i","barycenter","weight"])})}function sIn(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 lIn(t,e){var r=OMn(t,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),n=r.lhs,i=NF(r.rhs,function(h){return-h.i}),a=[],o=0,s=0,l=0;n.sort(cIn(!!e)),l=s8t(a,i,l),Dt(n,function(h){l+=h.vs.length,a.push(h.vs),o+=h.barycenter*h.weight,s+=h.weight,l=s8t(a,i,l)});var u={vs:M4(a)};return s&&(u.barycenter=o/s,u.weight=s),u}function s8t(t,e,r){for(var n;e.length&&(n=WJ(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function cIn(t){return function(e,r){return e.barycenterr.barycenter?1:t?r.i-e.i:e.i-r.i}}function l8t(t,e,r,n){var i=t.children(e),a=t.node(e),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,l={};o&&(i=F1(i,function(g){return g!==o&&g!==s}));var u=iIn(t,i);Dt(u,function(g){if(t.children(g.v).length){var m=l8t(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&hIn(g,m)}});var h=aIn(u,r);uIn(h,l);var d=lIn(h,n);if(o&&(d.vs=M4([o,d.vs,s]),t.predecessors(o).length)){var f=t.node(t.predecessors(o)[0]),p=t.node(t.predecessors(s)[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 uIn(t,e){Dt(t,function(r){r.vs=M4(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function hIn(t,e){ws(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 dIn(t){var e=WNt(t),r=c8t(t,P4(1,e+1),"inEdges"),n=c8t(t,P4(e-1,-1,-1),"outEdges"),i=nIn(t);u8t(t,i);for(var a=Number.POSITIVE_INFINITY,o,s=0,l=0;l<4;++s,++l){fIn(s%2?r:n,s%4>=2),i=jJ(t);var u=tIn(t,i);uo||s>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 mIn(t){var e={},r=0;function n(i){var a=r;Dt(t.children(i),n),e[i]={low:a,lim:r++}}return Dt(t.children(),n),e}function vIn(t,e){var r={};function n(i,a){var o=0,s=0,l=i.length,u=WJ(a);return Dt(a,function(h,d){var f=bIn(t,h),p=f?t.node(f).order:l;(f||h===u)&&(Dt(a.slice(s,d+1),function(g){Dt(t.predecessors(g),function(m){var v=t.node(m),y=v.order;(yu)&&h8t(r,f,h)})})}function i(a,o){var s=-1,l,u=0;return Dt(o,function(h,d){if(t.node(h).dummy==="border"){var f=t.predecessors(h);f.length&&(l=t.node(f[0]).order,n(o,u,d,s,l),u=d,s=l)}n(o,u,o.length,l,a.length)}),o}return PF(e,i),r}function bIn(t,e){if(t.node(e).dummy)return oCe(t.predecessors(e),function(r){return t.node(r).dummy})}function h8t(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 xIn(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function wIn(t,e,r,n){var i={},a={},o={};return Dt(e,function(s){Dt(s,function(l,u){i[l]=l,a[l]=l,o[l]=u})}),Dt(e,function(s){var l=-1;Dt(s,function(u){var h=n(u);if(h.length){h=NF(h,function(m){return o[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",()=>VIn(t));r(" runLayout",()=>LIn(n,r)),r(" updateInputGraph",()=>MIn(t,n))})}function LIn(t,e){e(" makeSpaceForEdgeLabels",()=>QIn(t)),e(" removeSelfEdges",()=>ZIn(t)),e(" acyclic",()=>xMn(t)),e(" nestingGraph.run",()=>qMn(t)),e(" rank",()=>HMn(QNt(t))),e(" injectEdgeLabelProxies",()=>GIn(t)),e(" removeEmptyRanks",()=>CMn(t)),e(" nestingGraph.cleanup",()=>KMn(t)),e(" normalizeRanks",()=>TMn(t)),e(" assignRankMinMax",()=>HIn(t)),e(" removeEdgeLabelProxies",()=>WIn(t)),e(" normalize.run",()=>MMn(t)),e(" parentDummyChains",()=>pIn(t)),e(" addBorderSegments",()=>EMn(t)),e(" order",()=>dIn(t)),e(" insertSelfEdges",()=>JIn(t)),e(" adjustCoordinateSystem",()=>_Mn(t)),e(" position",()=>RIn(t)),e(" positionSelfEdges",()=>ePn(t)),e(" removeBorderNodes",()=>KIn(t)),e(" normalize.undo",()=>PMn(t)),e(" fixupEdgeLabelCoords",()=>jIn(t)),e(" undoCoordinateSystem",()=>RMn(t)),e(" translateGraph",()=>YIn(t)),e(" assignNodeIntersects",()=>qIn(t)),e(" reversePoints",()=>XIn(t)),e(" acyclic.undo",()=>AMn(t))}function MIn(t,e){Dt(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))}),Dt(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 IIn=["nodesep","edgesep","ranksep","marginx","marginy"],PIn={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},NIn=["acyclicer","ranker","rankdir","align"],BIn=["width","height"],$In={width:0,height:0},FIn=["minlen","weight","width","height","labeloffset"],zIn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},UIn=["labelpos"];function VIn(t){var e=new hu({multigraph:!0,compound:!0}),r=wCe(t.graph());return e.setGraph(lCe({},PIn,xCe(r,IIn),qJ(r,NIn))),Dt(t.nodes(),function(n){var i=wCe(t.node(n));e.setNode(n,wLn(xCe(i,BIn),$In)),e.setParent(n,t.parent(n))}),Dt(t.edges(),function(n){var i=wCe(t.edge(n));e.setEdge(n,lCe({},zIn,xCe(i,FIn),qJ(i,UIn)))}),e}function QIn(t){var e=t.graph();e.ranksep/=2,Dt(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 GIn(t){Dt(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};B4(t,"edge-proxy",a,"_ep")}})}function HIn(t){var e=0;Dt(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=NC(e,n.maxRank))}),t.graph().maxRank=e}function WIn(t){Dt(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function YIn(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=t.graph(),o=a.marginx||0,s=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)}Dt(t.nodes(),function(u){l(t.node(u))}),Dt(t.edges(),function(u){var h=t.edge(u);Object.prototype.hasOwnProperty.call(h,"x")&&l(h)}),e-=o,n-=s,Dt(t.nodes(),function(u){var h=t.node(u);h.x-=e,h.y-=n}),Dt(t.edges(),function(u){var h=t.edge(u);Dt(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+o,a.height=i-n+s}function qIn(t){Dt(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),i=t.node(e.w),a,o;r.points?(a=r.points[0],o=r.points[r.points.length-1]):(r.points=[],a=i,o=n),r.points.unshift(GNt(n,a)),r.points.push(GNt(i,o))})}function jIn(t){Dt(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 XIn(t){Dt(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function KIn(t){Dt(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(WJ(r.borderLeft)),o=t.node(WJ(r.borderRight));r.width=Math.abs(o.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}}),Dt(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function ZIn(t){Dt(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 JIn(t){var e=jJ(t);Dt(e,function(r){var n=0;Dt(r,function(i,a){var o=t.node(i);o.order=a+n,Dt(o.selfEdges,function(s){B4(t,"selfedge",{width:s.label.width,height:s.label.height,rank:o.rank,order:a+ ++n,e:s.e,label:s.label},"_se")}),delete o.selfEdges})})}function ePn(t){Dt(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,o=r.x-i,s=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],r.label.x=r.x,r.label.y=r.y}})}function xCe(t,e){return YJ(qJ(t,e),Number)}function wCe(t){var e={};return Dt(t,function(r,n){e[n.toLowerCase()]=r}),e}var f8t=O((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),p8t=O((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),tPn=O(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram","shouldMergeSelfLoopSegments"),rPn=O((t,e,r,n,i)=>{const a=[],o=new Set;if(r.forEach(({start:h,end:d})=>{h!==n&&o.add(h),d!==n&&o.add(d)}),o.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 p8t(i);const s=a.reduce((h,d)=>({x:h.x+d.x/a.length,y:h.y+d.y/a.length}),{x:0,y:0}),l=s.x-e.x,u=s.y-e.y;return Math.abs(l)>Math.abs(u)?l>0?"right":"left":Math.abs(u)>0?u>0?"bottom":"top":p8t(i)},"getSelfLoopSide"),nPn=O((t,e="top",r=0,n=0)=>{const i=t.x,a=t.y-r,o=t.width/2,s=t.height/2,l=Math.max(36,Math.min(100,t.width*.8)),u=f8t(Math.max(n,t.width*.35),36,l),h=f8t(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{const d=a+s;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+o;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-o;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-s;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"),iPn=O((t,e,r="top",n=0,i={})=>{const o=t.x,s=t.y-n,l=i.width??0,u=i.height??0;switch(r){case"bottom":return{x:o,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:s};case"left":return{x:Math.min(...e.map(h=>h.x))-l/2-4,y:s};case"top":default:return{x:o,y:Math.min(...e.map(h=>h.y))-u/2-4}}},"getSelfLoopLabelPosition"),g8t=O((t,e=0,{mergeSelfLoops:r=!0}={})=>{var o;const n=new Map,i=[],a=(o=t.graph())==null?void 0:o.rankdir;return t.edges().forEach(s=>{const l=t.edge(s);if(r&&l.selfLoop){const u=l.selfLoop.id;n.has(u)||n.set(u,[]),n.get(u).push({edge:l,start:s.v,end:s.w})}else i.push({edge:l,start:s.v,end:s.w})}),n.forEach(s=>{if(s.length!==3){s.forEach(b=>i.push(b));return}s.sort((b,x)=>b.edge.selfLoop.order-x.edge.selfLoop.order);const[l,u,h]=s,d=l.edge.originalEdge??u.edge.originalEdge??h.edge.originalEdge??u.edge,f=t.node(d.start);if(!f){s.forEach(b=>i.push(b));return}const p={width:u.edge.width,height:u.edge.height},g=rPn(t,f,s,d.start,a),m=nPn(f,g,e,p.width??0),v=iPn(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"),m8t=O(async(t,e,r,n,i,a)=>{ye.warn("Graph in recursive render:XAX",U1(e),i);const o=e.graph().rankdir;ye.trace("Dir in recursive render - dir:",o);const s=t.insert("g").attr("class","root");e.nodes()?ye.info("Recursive render XXX",e.nodes()):ye.info("No nodes found for",e),e.edges().length>0&&ye.info("Recursive edges",e.edge(e.edges()[0]));const l=s.insert("g").attr("class","clusters"),u=s.insert("g").attr("class","edgePaths"),h=s.insert("g").attr("class","edgeLabels"),d=s.insert("g").attr("class","nodes"),f=tPn(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));ye.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)||(ye.trace("Setting parent",b,i.id),e.setParent(b,i.id,w))}if(ye.info("(Insert) Node XXX"+b+": "+JSON.stringify(e.node(b))),x!=null&&x.clusterNode){ye.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 p8t(d,x.graph,r,n,e.node(b),a),T=S.elem;Br(x,T),x.diff=S.diff||0,ye.info("New compound node after recursive render XAX",b,"width",x.width,"height",x.height),Dfn(T,x)}else e.children(b).length>0?(ye.trace("Cluster - the non recursive path XBX",b,x.id,x,x.width,"Graph:",e),ye.trace(N4(x.id,e)),Ln.set(x.id,{id:N4(x.id,e),node:x})):(ye.trace("Node - the non recursive path XAX",b,d,e.node(b),o),await i$(d,e.node(b),{config:a,dir:o}))})),await O(async()=>{const b=e.edges().map(async function(x){const w=e.edge(x.v,x.w,x.name);if(ye.info("Edge "+x.v+" -> "+x.w+": "+JSON.stringify(x)),ye.info("Edge "+x.v+" -> "+x.w+": ",x," ",JSON.stringify(e.edge(x))),ye.info("Fix",Ln,"ids:",x.v,x.w,"Translating: ",Ln.get(x.v),Ln.get(x.w)),f&&w.selfLoop){if(w.selfLoop.order!==1)return;const A=w.id;w.id=w.selfLoop.id,await rK(h,w),w.id=A;return}await rK(h,w)});await Promise.all(b)},"processEdges")(),ye.info("Graph before layout:",JSON.stringify(U1(e))),ye.info("############################################# XXX"),ye.info("### Layout ### XXX"),ye.info("############################################# XXX"),u8t(e),ye.info("Graph after layout:",JSON.stringify(U1(e)));let g=0,{subGraphTitleTotalMargin:m}=TR(a);await Promise.all(uMn(e).map(async function(b){var w;const x=e.node(b);if(ye.info("Position XBX => "+b+": ("+x.x,","+x.y,") width: ",x.width," height: ",x.height),x!=null&&x.clusterNode)x.y+=m,ye.info("A tainted cluster node XBX1",b,x.id,x.width,x.height,x.x,x.y,e.parent(b)),Ln.get(x.id).node=x,tK(x);else if(e.children(b).length>0){ye.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;ye.debug("OffsetY",T,"labelHeight",S,"halfPadding",A),await ZX(l,x),Ln.get(x.id).node=x}else{const A=e.node(x.parentId);x.y+=m/2,ye.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),tK(x)}}));const v=m/2;return f8t(e,v,{mergeSelfLoops:f}).forEach(function({edge:b,start:x,end:w}){ye.info("Edge "+x+" -> "+w+": "+JSON.stringify(b),b),b.points.forEach(C=>C.y+=v);const A=e.node(x),S=e.node(w),T=t2e(u,b,Ln,r,A,S,n);qkt(b,T)}),e.nodes().forEach(function(b){const x=e.node(b);ye.info(b,x.type,x.diff),x.isGroup&&(g=x.diff)}),ye.warn("Returning from recursive render XAX",s,g),{elem:s,diff:g}},"recursiveRender"),nPn=O(async(t,e)=>{var a,o,s,l,u,h;const r=new hu({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:((a=t.config)==null?void 0:a.nodeSpacing)||((s=(o=t.config)==null?void 0:o.flowchart)==null?void 0:s.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");n2e(n,t.markers,t.type,t.diagramId),Qkt(),Ykt(),hOt(),INt(),t.nodes.forEach(d=>{r.setNode(d.id,{...d}),d.parentId&&r.setParent(d.id,d.parentId)}),ye.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)}),ye.warn("Graph at first:",JSON.stringify(U1(r))),cMn(r),ye.warn("Graph after XAX:",JSON.stringify(U1(r)));const i=Ye();await p8t(n,r,t.type,t.diagramId,void 0,i)},"render");const iPn=Object.freeze(Object.defineProperty({__proto__:null,getEdgesToRender:f8t,render:nPn},Symbol.toStringTag,{value:"Module"}));async function g8t(t,e){const r=new hu({multigraph:!0,compound:!0}),n=[...e.edges],i=Ye(),a=t.insert("g").attr("class","root"),o=a.insert("g").attr("class","clusters"),s=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 i$(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(()=>Vdi);f(t,e)}return{graph:r,groups:{clusters:o,edgePaths:s,edgeLabels:l,nodes:u,rootGroups:a},nodeElements:h}}O(g8t,"createGraphWithElements");var m8t=5,XJ=1e-5,KJ=1e-6;function ZJ(t){const e=[];for(let r=0;r=1-KJ||f<=KJ||f>=1-KJ?null:{point:{x:t.x+d*i,y:t.y+d*a},tA:d,tB:f}}O(v8t,"segmentIntersection");function ACe(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}O(ACe,"isHorizontalSeg");function y8t(t){const e=[];for(let r=0;r=Math.abs(r)?e>=0?1:0:r>=0?1:0}O(b8t,"getArcSweepFlag");var aPn=.001;function x8t(t,e){if(t.length<2)return t.map(a=>({...a}));const r=t.map(a=>({...a})),n=e.arrowTypeStart&&zl[e.arrowTypeStart];if(n){const a=t[0],o=t[1],s=Math.atan2(o.y-a.y,o.x-a.x);r[0].x=a.x+n*Math.cos(s),r[0].y=a.y+n*Math.sin(s)}const i=e.arrowTypeEnd&&zl[e.arrowTypeEnd];if(i){const a=t.length,o=t[a-2],s=t[a-1],l=Math.atan2(s.y-o.y,s.x-o.x);r[a-1].x=s.x-i*Math.cos(l),r[a-1].y=s.y-i*Math.sin(l)}return r}O(x8t,"applyMarkerOffsets");function w8t(t,e,r,n,i){const a=t.point.x,o=t.point.y,s={x:a-e*t.r,y:o-r*t.r},l={x:a+e*t.r,y:o+r*t.r},u=[`L${$4(s)}`];return i==="arc"?u.push(`A${Fg(t.r)},${Fg(t.r)} 0 0 ${n} ${$4(l)}`):u.push(`M${$4(l)}`),u}O(w8t,"emitJump");function SCe(t,e,r,n){const i=e.x-t.x,a=e.y-t.y,o=r.x-e.x,s=r.y-e.y,l=Math.hypot(i,a),u=Math.hypot(o,s);if(l0){const x=SCe(i[u-1],i[u],i[u+1]??i[u],m8t);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}}O(C8t,"decodeDataPoints");function O8t(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=[],o=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;o.set(u.id,d);const p=C8t(d.getAttribute("data-points"))??u.points;a.push({...u,points:p})}const s=y8t(a);if(s.length===0)return;const l=new Map;for(const u of s){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&&!T8t(f))continue;const p=o.get(u.id);if(!p)continue;if(f===void 0){const x=p.getAttribute("d")??"";if(!S8t(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=A8t(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)}}}O(O8t,"applyLineJumpsToSvg");async function k8t(t,e){var i,a;for(const o of t.nodes)o.isGroup?await ZX(e.clusters,o):tK(o);const r=new Map;for(const o of t.nodes)o!=null&&o.id&&r.set(o.id,o);for(const o of t.edges){const s=o.start?r.get(o.start)??{}:{},l=o.end?r.get(o.end)??{}:{},u=t2e(e.edgePaths,{...o},{},t.type,s,l,t.diagramId);o.label&&await rK(e.rootGroups,o),o.label&&E8t(o,u)}const n=(a=(i=t.config)==null?void 0:i.swimlane)==null?void 0:a.lineHops;if(n!==!1){const o=n==="gap"?"gap":"arc",s=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}));O8t(e.edgePaths,s,{enabled:!0,jumpRadius:6,jumpStyle:o})}}O(k8t,"adjustLayout");function E8t(t,e){const r=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),n=Dr(),{subGraphTitleTotalMargin:i}=TR({flowchart:n.flowchart??{}});if(t.label){const a=o$.get(t.id);let o=t.x,s=t.y;if(r){const l=un.calcLabelPosition(r);ye.debug("Moving label "+t.label+" from (",o,",",s,") to (",l.x,",",l.y,") abc88"),e&&(o=l.x,s=l.y)}a.attr("transform",`translate(${o}, ${s+i/2})`)}if(t!=null&&t.startLabelLeft){const a=vs.get(t.id).startLeft;let o=t==null?void 0:t.x,s=t==null?void 0:t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(t.startLabelRight){const a=vs.get(t.id).startRight;let o=t.x,s=t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(t.endLabelLeft){const a=vs.get(t.id).endLeft;let o=t.x,s=t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(t.endLabelRight){const a=vs.get(t.id).endRight;let o=t.x,s=t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}}O(E8t,"positionEdgeLabel");var TCe="__swimlane_default__",oPn=21,_8t=20;function CCe(t){return Math.max(t.padding??_8t,_8t)}O(CCe,"topLaneHorizontalPadding");function R8t(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 o=r-i/2,s=Math.min(a,r+i/2),l=Math.min(oPn,Math.max(0,s-o)),u=o+l;if(u<=o){delete t.groupTitleRect;return}t.groupTitleRect={left:e-n/2,right:e+n/2,top:o,bottom:u}}O(R8t,"assignTopLaneTitleRect");function D8t(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===TCe);i?i.isGroup&&(i.shape="swimlane",e&&(i.direction=e)):(i={id:TCe,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},r.push(i));for(const a of n)a.parentId=TCe}O(D8t,"prepareLayoutForSwimlanes");function L8t(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}}O(L8t,"toGraphView");function M8t(t,e,r,n){const{layout:i}=t,a=t.nodeById,o=(n==null?void 0:n.layerGap)??100,s=(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*s,y=r.y[g]??l*o;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*CCe(f),w=b,A=Math.max(0,m-g)+x,S=Math.max(0,y-v)+w,T=(g+m)/2,C=(v+y)/2;f.x=T,f.y=C,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,P=E.x??0;return _-P}),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*CCe(k),P=(E.minX+E.maxX)/2;A.push(k.id),S.push(P),T.push(_)}const C=A.length;if(C>0){const k=new Map;if(C===1)k.set(A[0],T[0]);else{const E=[];for(let D=0;D0&&i>0?{cx:e,cy:r,rect:z4(e,r,n,i)}:void 0}O(OCe,"measuredNodeRect");function kCe(t){if(t.isGroup)return;const e=OCe(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}O(kCe,"nodeBoundsInfoFor");function Rp(t,e,r=Ql){return Math.abs(t.x-e.x)r}O(es,"isHorizontalSegment");function ts(t,e,r=Ql){return Ai(t,e,r)&&Math.abs(t.y-e.y)>r}O(ts,"isVerticalSegment");function Ju(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)))}O(Ju,"overlapLength");function W0(t,e,r=Ql){return t.horizontal&&e.horizontal&&_i(t.a,e.a,r)?Ju(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&Ai(t.a,e.a,r)?Ju(t.a.y,t.b.y,e.a.y,e.b.y):0}O(W0,"sameAxisSegmentOverlapLength");function F4(t,e=Ql){const r=[];for(let n=0;n0?r[r.length-1]:void 0;(!i||!Rp(i,n,e))&&r.push({x:n.x,y:n.y})}return r}O(Ni,"dedupeConsecutivePoints");function ECe(t,e=Ql){if(!t||t.length!==4)return;const[r,n,i,a]=t;return es(r,n,e)&&ts(n,i,e)&&es(i,a,e)?{kind:"HVH",p0:r,p1:n,p2:i,p3:a}:ts(r,n,e)&&es(n,i,e)&&ts(i,a,e)?{kind:"VHV",p0:r,p1:n,p2:i,p3:a}:void 0}O(ECe,"classifyThreeSegmentRoute");function JJ(t,e,r,n=0){const i=Math.min(t.x,e.x),a=Math.max(t.x,e.x),o=Math.min(t.y,e.y),s=Math.max(t.y,e.y);return a>r.left-n&&ir.top-n&&oe.left+r&&t.xe.top+r&&t.y=e.right&&t.top<=e.top&&t.bottom>=e.bottom}O(P8t,"rectContainsRect");function eee(t,e){return t.lefte.left&&t.tope.top}O(eee,"rectsOverlap");function RCe(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}O(RCe,"inflateRect");function z4(t,e,r,n){return{left:t-r/2,right:t+r/2,top:e-n/2,bottom:e+n/2}}O(z4,"rectFromCenterSize");function ed(t){var e;return(e=OCe(t))==null?void 0:e.rect}O(ed,"rectOfNodeBounds");function zC(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}}}O(zC,"portForRectSide");function DCe(t,e,r,n,i,a=Ql){const o=e==="left"||e==="right",s=n==="left"||n==="right";if(o&&s){if(e==="right"&&n==="left"&&t.xr.x){if(_i(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(_i(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(!o&&!s){if(e===n){if(Ai(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(Ai(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(o&&!s){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}O(DCe,"buildOrthogonalPortPath");function LCe(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]}O(LCe,"buildSameSideTrackPath");function tee(t){const e=new Map,r=[];for(const n of t){if(n.isEdgeLabel)continue;const i=kCe(n);i&&(e.set(i.id,i),r.push({id:i.id,rect:i.rect}))}return{nodeInfoById:e,realNodeRects:r}}O(tee,"collectRealNodeBounds");function X2(t){const e=[],r=[];for(const n of t){const i=kCe(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}}O(X2,"collectNodeRectEntries");function N8t(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,o=n.width??0,s=n.height??0;r.push({nodeId:n.id,...z4(i,a,o,s)})}return r}O(N8t,"collectLayoutNodeRects");function MCe(t,e,r=Ql){const n=t.start,i=t.end;if(!n||!i)return;const a=e.get(n),o=e.get(i);if(!(!a||!o))return{srcId:n,dstId:i,srcInfo:a,dstInfo:o,collinearX:Math.abs(a.cx-o.cx)g||fy)return!1;const b=Math.abs(m-h.a.x)i:a&&s&&_i(t,r,i)?Ju(t.x,e.x,r.x,n.x)>i:!1}O(B8t,"sameAxisSegmentsOverlap");function ree(t,e,r,n,{epsilon:i=Ql,skipDegenerateOther:a=!1}={}){for(const o of r){if(o===n||o.isLayoutOnly)continue;const s=o.points;if(!(!s||s.length<2))for(let l=0;lf+i&&gm+i&&dn+Ql&&t=2?e[e.length-2]:void 0,l=(o?Ai(o,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||!Rp(i,n))&&r.push(n)}return r}O(nee,"orthogonalizePolyline");function Y0(t){if(t.length<3)return t;let e=[...t];for(let r=0;r<32;r++){const n=F8t(e);if(e=n.points,!n.changed)break}return e}O(Y0,"simplifyPolyline");var mn=.001,lPn=.5,z8t=4;function NCe(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 o=U8t(t[i],t[a],e);return r?[o,...t.slice(i)]:[...t.slice(0,i+1),o]}O(BCe,"clipEndpoint");function V8t(t,e){for(const r of t){const n=NCe(r,e,2);if(!n)continue;let i=[...n.points];n.srcRect&&(i=BCe(i,n.srcRect,!0)),n.dstRect&&(i=BCe(i,n.dstRect,!1)),i=Y0(nee(i)),i=VCe(i,n.srcRect,n.dstRect),n.edge.points=Y0(nee(i))}}O(V8t,"clipEdgeEndpointsToNodeBoundaries");function $Ce(t,e,r,n=!1){if(_i(t,e,mn)){if(e.yr.bottom+mn)return e;if(n){if(t.xr.right+mn)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(Ai(t,e,mn)){if(e.xr.right+mn)return e;if(n){if(t.yr.bottom+mn)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}O($Ce,"snapEndpointToBoundary");function iee(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}}O(Q8t,"intersectRanges");function zCe(t,e){return e==="left"||e==="right"?aee(t.top,t.bottom):aee(t.left,t.right)}O(zCe,"clearanceRangeForSide");function oee(t,e,r){const n=t.y>=r.top-mn&&t.y<=r.bottom+mn,i=t.x>=r.left-mn&&t.x<=r.right+mn;if(_i(t,e,mn)&&n){if(Math.abs(t.x-r.left)0?Q8t(a):void 0}O(G8t,"straightClearanceRange");function UCe(t,e,r,n,i){const a=G8t(t,e,r,n,i);if(!a)return;const o=i?t.y:t.x,s=Math.min(a.hi,Math.max(a.lo,o));if(!(Math.abs(s-o)({...s}));for(let s=e;s>=0&&s=r.left-mn&&Math.max(t.x,e.x)<=r.right+mn,i=Math.min(t.y,e.y)>=r.top-mn&&Math.max(t.y,e.y)<=r.bottom+mn;if(Math.abs(t.y-r.top)n.bottom+mn;case"left":return _i(e,r,mn)&&r.xn.right+mn}}O(HCe,"leavesOutward");function WCe(t,e,r){if(t.length<3)return t;if(r){const a=GCe(t[0],t[1],e);return a&&HCe(a,t[1],t[2],e)?t.slice(1):t}const n=t.length-1,i=GCe(t[n-1],t[n],e);return i&&HCe(i,t[n-1],t[n-2],e)?t.slice(0,n):t}O(WCe,"collapseOwnBorderStub");function Y8t(t,e,r){let n=t;if(e){const a=iee(n,0,1);if(a){const o=$Ce(a,n[0],e);o!==n[0]&&(n=[o,...n.slice(1)])}n=WCe(n,e,!0)}if(r){const a=n.length-1,o=iee(n,a,-1);if(o){const s=$Ce(o,n[a],r,!0);s!==n[a]&&(n=[...n.slice(0,a),s])}n=WCe(n,r,!1)}const i=VCe(n,e,r);return i!==n||n.length===2?i:(e&&(n=QCe(n,e,!0)),r&&(n=QCe(n,r,!1)),n)}O(Y8t,"snapAndCollapseEndpoints");function YCe(t,e){for(const r of t){const n=NCe(r,e,2);if(!n)continue;const i=Ni(n.points,mn),a=Y8t(i,n.srcRect,n.dstRect);if(a.length<3){n.edge.points=a;continue}const o=[a[0],{...a[0]},...a.slice(1,-1),a[a.length-1],{...a[a.length-1]}];n.edge.points=o}}O(YCe,"prepareEdgeEndpointsForRenderer");function qCe(t){return new Map(t.map(e=>[e.id,e]))}O(qCe,"buildNodeMap");function q8t(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}O(q8t,"resolveTopLevelGroupId");function jCe(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}O(jCe,"groupDepth");function XCe(t){let e=1/0,r=-1/0,n=1/0,i=-1/0;for(const a of t){const o=a.x,s=a.y;if(typeof o!="number"||typeof s!="number")continue;const l=a.width??0,u=a.height??0;e=Math.min(e,o-l/2),r=Math.max(r,o+l/2),n=Math.min(n,s-u/2),i=Math.max(i,s+u/2)}return e===1/0||n===1/0?null:{minX:e,maxX:r,minY:n,maxY:i}}O(XCe,"boundsForChildren");function j8t(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}O(j8t,"applyGroupBounds");function X8t(t){const e=qCe(t),r=t.filter(n=>n.isGroup&&n.parentId).sort((n,i)=>jCe(i,e)-jCe(n,e));for(const n of r){const i=t.filter(o=>o.parentId===n.id),a=XCe(i);a&&j8t(n,a)}}O(X8t,"recomputeNestedGroupBounds");function see(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(l=>!l.isGroup);let a=1/0,o=-1/0;for(const l of i){const u=l[e];typeof u=="number"&&(a=Math.min(a,u),o=Math.max(o,u))}if(!Number.isFinite(a)||!Number.isFinite(o))return!1;const s=O(l=>a+o-l,"mirror");for(const l of r){const u=l[e];typeof u=="number"&&(l[e]=s(u));const h=l.groupTitleRect;h&&(l.groupTitleRect=e==="x"?{...h,left:s(h.right),right:s(h.left)}:{...h,top:s(h.bottom),bottom:s(h.top)})}for(const l of n)for(const u of l.points??[])u[e]=s(u[e]);return!0}O(see,"mirrorAxis");function K8t(t){return(t.nodes??[]).some(r=>!r.isGroup)?see(t,"y"):!0}O(K8t,"applyBtDirectionTransform");function Z8t(t,e="LR"){const r=t.nodes??[],n=t.edges??[],i=r.filter(L=>!L.isGroup);let a=1/0,o=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)-o)*f+s,I=R-a;L.x=M,L.y=I}for(const L of n)if(L.points)for(const R of L.points){const D=R.x,I=(R.y-o)*f+s,N=D-a;R.x=I,R.y=N}X8t(r);const p=r.filter(L=>L.isGroup&&!L.parentId);if(p.length===0)return e==="RL"&&see(t,"x"),!0;const g=qCe(r),m=new Map;for(const L of r){if(L.isGroup)continue;const R=q8t(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=XCe(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=s+S,E=(b+x)/2-S/2-s,_=E+T/2,P=Math.max(v,s);y.sort((L,R)=>L.centerY-R.centerY);for(let L=0;Lf.cy?y.bottom:y.top,P=f.cx+b;if(P<=y.left+zg||P>=y.right-zg)continue;x={x:P,y:_},w={x:P,y:s.y},A={x:s.x,y:s.y}}else{const _=p.cx>f.cx?y.right:y.left,P=f.cy+b;if(P<=y.top+zg||P>=y.bottom-zg)continue;x={x:_,y:P},w={x:s.x,y:P},A={x:s.x,y:s.y}}const S=Rp(x,w,zg),T=Rp(w,A,zg);if(S&&T||!S&&As(x,w,n,[h],1)||!T&&As(w,A,n,[d],1))continue;const C=!S&&ree(x,w,t,i,{epsilon:zg,skipDegenerateOther:!0}),k=!T&&ree(w,A,t,i,{epsilon:zg,skipDegenerateOther:!0});if(!(C||k)){S?v=[w,A]:T?v=[x,w]:v=[x,w,A];break}}v&&(i.points=v)}}O(J8t,"portSwapToLShape");function eBt(t,e){const{realNodeRects:a,labelNodeRects:o}=X2(e.values());for(const s of t){if(s.isLayoutOnly)continue;const l=s.points;if(!l||l.length<4)continue;const u=Ni(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=es(f,d,.001),A=ts(f,d,.001),S=es(p,f,.001),T=ts(p,f,.001);if(!(w&&T||A&&S))continue;const C=s.end,k=s.start,E=C?e.get(C):void 0;if(!E)continue;const _=E.x??0,P=E.y??0,L=ed(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:P},D={x:z?L.right:L.left,y:P}}if(As(R,D,a,C?[C]:[],-2)||As(R,D,o,[],-2))continue;if(k){const z=e.get(k),U=z?ed(z):void 0;if(U&&_Ce(R,U,2))continue}const M=O((z,U)=>`${z.x.toFixed(3)},${z.y.toFixed(3)}|${U.x.toFixed(3)},${U.y.toFixed(3)}`,"ownSegmentKey"),I=new Set;for(let z=0;z{for(const Q of t){if(Q===s||Q.isLayoutOnly)continue;const G=Q.points;if(!(!G||G.length<2))for(let q=0;q=0){const z=u[h-3],U=[k,C].filter(Q=>!!Q);if(As(z,R,a,U,-2)||N(z,R))continue}const B=[...u.slice(0,h-2),R,D];s.points=B;const V=s.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,q,Y=-1;for(let ne=0;ne=U+2||pe&&ee>=Q+2)&&ee>Y&&(Y=ee,G=(X.x+J.x)/2,q=(X.y+J.y)/2)}G!==void 0&&q!==void 0&&(z.x=G,z.y=q)}}}}}O(eBt,"collapseShortTerminalStub");var Lr=.001,Gl=8,Xn=F4,KCe=O((t,e)=>Ai(t,e,Lr)||_i(t,e,Lr),"orthogonallyAligned");function tBt(t,e){const i=O((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=O((p,g)=>{const m=Ni(p.points??[]);if(m.length<2)return;const v=g?p.start:p.end,y=v?e.get(v):void 0,b=y?ed(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(KCe(w,A)&&(S=w),Ai(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(_i(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"),o=O((p,g)=>Math.max(0,Math.min(p.max,g.max)-Math.max(p.min,g.min)),"projectedOverlapLength"),s=O((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)&&Ai(p.boundary,g.boundary,1):(Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1)&&_i(p.boundary,g.boundary,1),"sameTerminalFace"),l=O((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:o(p,g)>=Gl&&Math.abs(p.coord-g.coord)<.5,"exactTerminalLaneConflict"),u=O((p,g)=>{if(p.nodeId!==g.nodeId||p.orientation!==g.orientation||p.orientation!=="H"||p.atStart===g.atStart)return!1;const m=o(p,g);if(m2*v?!1:s(p,g)&&Math.abs(p.coord-g.coord)<16},"nearTerminalLaneConflict"),h=O((p,g)=>{const m=Ni(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(!O(()=>Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1?_i(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?Ai(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&&Rp(m[1],p.railEnd,Lr),T=m.slice(S?2:1),C=T[0];return C&&!KCe(C,y)?void 0:[v,y,...T]}const x=m.length>1&&Rp(m[m.length-2],p.railEnd,Lr),w=m.slice(0,x?-2:-1),A=w[w.length-1];if(!(A&&!KCe(A,y)))return[...w,y,v]},"shiftedCandidate"),d=O(p=>{const g=p.edge,m=Ni(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,[C,k]=m;return _i(C,k,Lr)&&Math.abs(A-T)<1&&Math.abs(w-S)>1||Ai(C,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 C=d(S),k=d(T);return C!==k?Number(C)-Number(k):+!T.atStart-+!S.atStart});for(const S of A){for(const T of f){const C=h(S,T);if(!C)continue;const k=a({...S.edge,points:C},S.atStart);if(!(!k||g.some(E=>E.edge!==S.edge&&(l(k,E)||w&&u(k,E))))){S.edge.points=C,m=!0;break}}if(m)break}}if(!m)return}}O(tBt,"separateSharedRenderedTerminalLanes");function rBt(t,e){const{realNodeRects:n,labelNodeRects:i}=X2(e.values()),a=O((s,l)=>{const u=s.start,h=s.end,d=Xn(l);if(d.length!==l.length-1)return!1;const f=[u,h].filter(p=>!!p);for(const p of d)if(As(p.a,p.b,n,f,-2)||As(p.a,p.b,i,[],-2))return!1;for(const p of t){if(p===s||p.isLayoutOnly)continue;const g=p.points;if(!(!g||g.length<2)){for(const m of d)for(const v of Xn(Ni(g)))if(W0(m,v,.5)>=Gl||V1(m.a,m.b,v.a,v.b,Lr))return!1}}return!0},"candidateIsSafe"),o=O((s,l)=>{if(l+4>=s.length)return;const u=s[l],h=s[l+1],d=s[l+2],f=s[l+3],p=s[l+4],g=es(u,h)&&ts(h,d)&&es(d,f)&&ts(f,p)&&Ai(u,f,Lr)&&Ai(u,p,Lr)&&Ai(h,d,Lr)&&(h.x-u.x)*(f.x-d.x)<0,m=ts(u,h)&&es(h,d)&&ts(d,f)&&es(f,p)&&_i(u,f,Lr)&&_i(u,p,Lr)&&_i(h,d,Lr)&&(h.y-u.y)*(f.y-d.y)<0;if(g||m)return Ni([...s.slice(0,l+1),p,...s.slice(l+5)]);if(l+5>=s.length)return;const v=s[l+5],y=ts(u,h)&&es(h,d)&&ts(d,f)&&es(f,p)&&ts(p,v)&&Ai(u,p,Lr)&&Ai(u,v,Lr)&&Ai(d,f,Lr)&&(d.x-h.x)*(p.x-f.x)<0,b=es(u,h)&&ts(h,d)&&es(d,f)&&ts(f,p)&&es(p,v)&&_i(u,p,Lr)&&_i(u,v,Lr)&&_i(d,f,Lr)&&(d.y-h.y)*(p.y-f.y)<0;if(!(!y&&!b))return Ni([...s.slice(0,l+1),v,...s.slice(l+6)])},"withoutDogleg");for(let s=0;s<8;s++){let l=!1;for(const u of t){if(u.isLayoutOnly)continue;const h=Ni(u.points??[]);for(let d=0;d<=h.length-5;d++){const f=o(h,d);if(!(!f||!a(u,f))){u.points=f,l=!0;break}}if(l)break}if(!l)return}}O(rBt,"collapseRedundantRectangularDoglegs");function ZCe(t,e){const{realNodeRects:a,labelNodeRects:o}=X2(e.values()),s=t.filter(g=>!g.isLayoutOnly),l=O((g,m,v)=>Ni(g===m?v??[]:g.points??[]),"pointsFor"),u=O((g,m)=>{let v=0;for(let y=0;y{const m=Xn(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=O((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?Ju(m.a.x,m.b.x,b.left,b.right)>=Gl&&m.a.y>=b.top-2&&m.a.y<=b.bottom+2:Ju(m.a.y,m.b.y,b.top,b.bottom)>=Gl&&m.a.x>=b.left-2&&m.a.x<=b.right+2})},"blockingRectsFor"),f=O((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=Y0(Ni(y));return Xn(b).length===b.length-1?b:void 0},"candidateByMovingRail"),p=O((g,m,v)=>{const y=[g.start,g.end].filter(x=>!!x),b=Xn(m);if(b.length!==m.length-1)return!1;for(const x of b)if(As(x.a,x.b,a,y,-2)||As(x.a,x.b,o,[],-2))return!1;for(const x of s)if(x!==g){for(const w of b)for(const A of Xn(l(x)))if(W0(w,A,.5)>=Gl)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 s){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}}O(ZCe,"liftObstacleHuggingSameSideRails");function JCe(t,e){const n=O(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=O(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:Ju(l.a.x,l.b.x,u.left,u.right)>=Gl},"horizontalSegmentIntersectsTitle"),o=[...e.values()].map(i).filter(l=>!!l);if(o.length===0)return;let s=0;for(const l of t){if(l.isLayoutOnly)continue;const u=Ni(l.points??[]);for(const h of Xn(u))for(const d of o)a(h,d.rect)&&(s=Math.max(s,d.rect.bottom-h.a.y+4))}if(!(s<=Lr))for(const l of o){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-s/2,l.node.height=h+s,l.node.groupTitleRect={...l.rect,top:l.rect.top-s,bottom:l.rect.bottom-s})}}O(JCe,"liftTopLaneTitleBandsAboveRails");function eOe(t,e){const n=O(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=O(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:Ju(u.a.y,u.b.y,h.top,h.bottom)>=Gl},"verticalSegmentIntersectsTitle"),o=O((u,h)=>{if(!u.horizontal)return!1;const d=u.a.y;return d<=h.top+Lr||d>=h.bottom-Lr?!1:Ju(u.a.x,u.b.x,h.left,h.right)>=Gl},"horizontalSegmentIntersectsTitle"),s=[...e.values()].map(i).filter(u=>!!u);if(s.length===0)return;let l=0;for(const u of t){if(u.isLayoutOnly)continue;const h=Ni(u.points??[]);for(const d of Xn(h))for(const f of s)if(a(d,f.rect))l=Math.max(l,f.rect.right-d.a.x+4);else if(o(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 s){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})}}O(eOe,"shiftLeftLaneTitleBandsLeftOfRails");function nBt(t,e){const{realNodeRects:n}=X2(e.values()),i=t.filter(g=>!g.isLayoutOnly),a=O((g,m=new Map)=>Ni(m.get(g)??g.points??[]),"replacementPointsFor"),o=O((g=new Map)=>{let m=0;for(let v=0;vi.reduce((m,v)=>m+ff(a(v,g)),0),"totalBends"),l=O(g=>{const m=a(g);if(m.length<4)return;const v=m[m.length-2],y=m[m.length-1];if(!(!es(v,y,Lr)&&!ts(v,y,Lr)))return{tailStart:v,terminal:y}},"terminalTailFor"),u=O((g,m)=>{const v=a(g);if(v.length<3)return;const y=v[0],b=v[1];let x;if(es(y,b,Lr))x={x:b.x,y:m.tailStart.y};else if(ts(y,b,Lr))x={x:m.tailStart.x,y:b.y};else return;const w=Y0(Ni([y,b,x,m.tailStart,m.terminal]));return Xn(w).length===w.length-1?w:void 0},"candidateWithDestinationTail"),h=O((g,m)=>{const v=[g.start,g.end].filter(y=>!!y);for(const y of Xn(m))if(As(y.a,y.b,n,v,-2))return!0;return!1},"pathHasNodeHit"),d=O((g,m,v)=>{for(const y of i)if(y!==g){for(const b of Xn(m))for(const x of Xn(a(y,v)))if(W0(b,x,.5)>=Gl)return!0}return!1},"pathHasSharedTrack"),f=O((g,m,v)=>!h(g,m)&&!d(g,m,v),"candidateIsSafe"),p=O(()=>{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=o();if(m===0)return;const v=s();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}}O(nBt,"swapDestinationTerminalTailsToReduceCrossings");function iBt(t,e){const{realNodeRects:a,labelNodeRects:o}=X2(e.values()),s=t.filter(w=>!w.isLayoutOnly),l=O((w,A=new Map)=>Ni(A.get(w)??w.points??[]),"replacementPointsFor"),u=O((w=new Map)=>{let A=0;for(let S=0;Ss.reduce((A,S)=>A+ff(l(S,w)),0),"totalBends"),d=O(w=>{const A=w.start,S=w.end,T=A?e.get(A):void 0,C=S?e.get(S):void 0,k=T?ed(T):void 0,E=C?ed(C):void 0;return k&&E?{src:k,dst:E}:void 0},"endpointRectsFor"),f=O((w,A,S)=>{if(S.index<=0||S.index+1>=A.length-1)return;const T=d(w);if(T){if(S.vertical){const C=S.a.x,k=Math.min(T.src.left,T.dst.left),E=Math.max(T.src.right,T.dst.right),_=CE+Lr?"right":void 0;return _?{edge:w,points:A,segmentIndex:S.index,axis:"vertical",side:_,coord:C,min:Math.min(S.a.y,S.b.y),max:Math.max(S.a.y,S.b.y)}:void 0}if(S.horizontal){const C=S.a.y,k=Math.min(T.src.top,T.dst.top),E=Math.max(T.src.bottom,T.dst.bottom),_=CE+Lr?"bottom":void 0;return _?{edge:w,points:A,segmentIndex:S.index,axis:"horizontal",side:_,coord:C,min:Math.min(S.a.x,S.b.x),max:Math.max(S.a.x,S.b.x)}:void 0}}},"externalRailForSegment"),p=O(()=>{const w=[];for(const A of s){const S=l(A);for(const T of Xn(S)){const C=f(A,S,T);C&&w.push(C)}}return w},"collectExternalRails"),g=O((w,A)=>w.edge!==A.edge&&w.axis===A.axis&&w.side===A.side&&Ju(w.min,w.max,A.min,A.max)>=Gl,"railsInteract"),m=O(w=>{const A=[],S=new Set;for(const T of w){if(S.has(T))continue;const C=[T],k=[];for(S.add(T);C.length>0;){const E=C.pop();k.push(E);for(const _ of w)!S.has(_)&&g(E,_)&&(S.add(_),C.push(_))}k.length>1&&A.push(k)}return A},"connectedComponents"),v=O(w=>{const A=[];for(const S of w)A.some(T=>Math.abs(T-S.coord){const A=w.map(C=>C.coord),S=v(w),T=[];if(w.length<=6){const C=new Array(S.length).fill(!1),k=[],E=O(()=>{if(k.length===w.length){k.some((_,P)=>Math.abs(_-A[P])>=Lr)&&T.push([...k]);return}for(const[_,P]of S.entries())C[_]||(C[_]=!0,k.push(P),E(),k.pop(),C[_]=!1)},"visit");return E(),T}for(let C=0;C{const S=new Map;for(const[C,k]of w.entries()){const E=A[C],_=S.get(k.edge)??k.points.map(P=>({x:P.x,y:P.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[C,k]of S){const E=Y0(Ni(k));if(Xn(E).length!==E.length-1)return;T.set(C,E)}return T},"replacementsForAssignment"),x=O(w=>{for(const[A,S]of w){const T=[A.start,A.end].filter(C=>!!C);for(const C of Xn(S))if(As(C.a,C.b,a,T,-2)||As(C.a,C.b,o,[],-2))return!1}for(let A=0;A=Gl)return!1}}return!0},"candidateIsSafe");for(let w=0;w<4;w++){const A=u();if(A===0)return;let S,T=A,C=h(),k=Number.POSITIVE_INFINITY;for(const E of m(p()))for(const _ of y(E)){const P=b(E,_);if(!P||!x(P))continue;const L=u(P);if(L>=A)continue;const R=h(P),D=E.reduce((M,I,N)=>M+Math.abs(_[N]-I.coord),0);L>T||L===T&&(R>C||R===C&&D>=k)||(S=P,T=L,C=R,k=D)}if(!S)return;for(const[E,_]of S)E.points=_}}O(iBt,"reassignCrossingExternalRailChannels");function aBt(t,e){const{realNodeRects:n,labelNodeRects:i}=X2(e.values()),a=t.filter(p=>!p.isLayoutOnly),o=O((p,g,m)=>Ni(p===g?m??[]:p.points??[]),"pointsFor"),s=O(p=>Xn(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=O((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)&&Ju(p.a.x,p.b.x,g.left,g.right)>=Gl}if(p.vertical){const m=p.a.x;return(Math.abs(m-g.left)<1||Math.abs(m-g.right)<1)&&Ju(p.a.y,p.b.y,g.top,g.bottom)>=Gl}return!1},"segmentRunsAlongRectBorder"),h=O(p=>{const g=[p.start,p.end].filter(v=>!!v),m=[];for(const v of g){const y=e.get(v),b=y?ed(y):void 0;b&&m.push(b)}return m},"endpointRectsFor"),d=O((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=es(m,v,Lr)&&ts(v,y,Lr)&&es(y,b,Lr),w=ts(m,v,Lr)&&es(v,y,Lr)&&ts(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=Ai(m,b,Lr)||_i(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)]),C=new Set;return T.map(k=>Y0(Ni(k))).filter(k=>{if(Xn(k).length!==k.length-1||!k.some(_=>Rp(_,b,Lr)))return!1;const E=k.map(_=>`${_.x.toFixed(3)},${_.y.toFixed(3)}`).join("|");return C.has(E)?!1:(C.add(E),!0)})},"shortcutCandidatesAt"),f=O((p,g,m)=>{const v=[p.start,p.end].filter(b=>!!b),y=h(p);for(const b of Xn(g))if(As(b.a,b.b,n,v,-2)||As(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 Xn(g))for(const w of Xn(o(b)))if(W0(x,w,.5)>=Gl)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=o(w),S=ff(A,Lr),T=s(A);for(let C=0;C<=A.length-4;C++)for(const k of d(A,C)){const E=ff(k,Lr),_=s(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}}O(aBt,"shortcutRedundantOrthogonalJogs");function oBt(t,e){const o=[];for(const ue of e.values()){if(ue.isGroup||ue.isEdgeLabel)continue;const de=ue.x??0,xe=ue.y??0,ge=ed(ue);ge&&o.push({id:String(ue.id??""),cx:de,cy:xe,rect:ge})}if(o.length===0)return;const s=new Map(o.map(ue=>[ue.id,ue])),l=o.map(ue=>({id:ue.id,rect:ue.rect})),u=["top","bottom","left","right"],h={top:Math.min(...o.map(ue=>ue.rect.top))-20,bottom:Math.max(...o.map(ue=>ue.rect.bottom))+20,left:Math.min(...o.map(ue=>ue.rect.left))-20,right:Math.max(...o.map(ue=>ue.rect.right))+20},d=t.filter(ue=>!ue.isLayoutOnly),f=new Map(d.map((ue,de)=>[ue,de])),p=O(ue=>{const de=ue==="left"||ue==="top"?-1:1,xe=[];for(let ge=0;ge<=2;ge++)xe.push(h[ue]+de*20*ge);return xe},"outwardTracksForSide"),g=O((ue,de=new Map)=>Ni(de.get(ue)??ue.points??[]),"replacementPointsFor"),m=O((ue,de)=>{let xe=0;for(const ge of ue)for(const ze of de)V1(ge.a,ge.b,ze.a,ze.b,Lr)&&xe++;return xe},"crossingCountBetweenSegments"),v=O((ue,de)=>m(Xn(ue),Xn(de)),"crossingCountBetweenPaths"),y=O((ue=new Map)=>{let de=0;const xe=[],ge=new Set,ze=[],we=O(Oe=>{ge.has(Oe)||(ge.add(Oe),ze.push(Oe))},"addEdge");for(let Oe=0;Oe0&&(de+=ae,xe.push({first:Be,second:be,count:ae}),we(Be),we(be))}}return ze.sort((Oe,Be)=>(f.get(Oe)??0)-(f.get(Be)??0)),{count:de,pairs:xe,edgeSet:ge,edges:ze}},"crossingSnapshot"),b=O((ue,de)=>{const xe=new Set(de.keys());if(xe.size===0)return ue.count;let ge=0;for(const we of ue.pairs)(xe.has(we.first)||xe.has(we.second))&&(ge+=we.count);let ze=0;for(let we=0;we{const de=new Map;for(const ze of ue.pairs){const we=de.get(ze.first)??new Set;we.add(ze.second),de.set(ze.first,we);const Oe=de.get(ze.second)??new Set;Oe.add(ze.first),de.set(ze.second,Oe)}const xe=[],ge=new Set;for(const ze of ue.edges){if(ge.has(ze))continue;const we=[ze],Oe=[];for(ge.add(ze);we.length>0;){const Be=we.pop();Oe.push(Be);for(const Z of de.get(Be)??[])ge.has(Z)||(ge.add(Z),we.push(Z))}Oe.sort((Be,Z)=>(f.get(Be)??0)-(f.get(Z)??0)),Oe.length>1&&xe.push(Oe)}return xe},"crossingComponents"),w=O(ue=>[ue.start,ue.end].filter(de=>!!de),"endpointIdsFor"),A=O(ue=>{const de=[];for(const xe of x(ue)){const ge=new Set(xe),ze=new Set(xe.flatMap(Oe=>w(Oe))),we=[...xe];for(const Oe of d)ge.has(Oe)||w(Oe).some(Be=>ze.has(Be))&&we.push(Oe);we.sort((Oe,Be)=>(f.get(Oe)??0)-(f.get(Be)??0)),de.push(we)}return de},"pairSearchGroups"),S=O((ue,de,xe)=>b(ue,new Map([[de,xe]])),"crossingCountWithSingleReplacement"),T=O(ue=>{const de=new Map;for(const xe of ue.pairs)de.set(xe.first,(de.get(xe.first)??0)+xe.count),de.set(xe.second,(de.get(xe.second)??0)+xe.count);return de},"currentCrossingsByEdge"),C=O(ue=>ue.slice(1).reduce((de,xe,ge)=>{const ze=ue[ge];return de+Math.abs(xe.x-ze.x)+Math.abs(xe.y-ze.y)},0),"pathLength"),k=O((ue=new Map)=>d.reduce((de,xe)=>de+ff(g(xe,ue)),0),"totalBends"),E=O((ue=new Map)=>d.reduce((de,xe)=>de+C(g(xe,ue)),0),"totalLength"),_=O((ue,de,xe=new Map)=>{const ge=Xn(de);for(const ze of d)if(ze!==ue){for(const we of ge)for(const Oe of Xn(g(ze,xe)))if(W0(we,Oe,.5)>=Gl)return!0}return!1},"pathHasSegmentConflict"),P=O((ue,de)=>{const xe=[ue.start,ue.end].filter(ge=>!!ge);for(const ge of Xn(de))if(As(ge.a,ge.b,l,xe,-2))return!0;return!1},"pathHitsNode"),L=O((ue,de)=>{const xe=Y0(Ni(de));Xn(xe).length===xe.length-1&&ue.push(xe)},"pushOrthogonalCandidate"),R=O(ue=>ue==="left"||ue==="right","sideIsHorizontal"),D=O((ue,de,xe)=>{switch(de){case"left":return Math.min(ue.x,xe.x)-20;case"right":return Math.max(ue.x,xe.x)+20;case"top":return Math.min(ue.y,xe.y)-20;case"bottom":return Math.max(ue.y,xe.y)+20}},"localTrackForSameSide"),M=O((ue,de,xe,ge)=>{const ze=xe==="left"||xe==="top"?-1:1,we=[D(de,xe,ge),h[xe]];for(const Oe of we)for(let Be=0;Be<=2;Be++)L(ue,LCe(de,xe,ge,Oe+ze*20*Be))},"addSameSideCandidates"),I=O((ue,de,xe,ge,ze)=>{for(const we of p(xe))for(const Oe of p(ze))L(ue,[de,{x:we,y:de.y},{x:we,y:Oe},{x:ge.x,y:Oe},ge])},"addHorizontalToVerticalCandidates"),N=O((ue,de,xe,ge,ze)=>{for(const we of p(xe))for(const Oe of p(ze))L(ue,[de,{x:de.x,y:we},{x:Oe,y:we},{x:Oe,y:ge.y},ge])},"addVerticalToHorizontalCandidates"),F=O((ue,de,xe,ge,ze)=>{const we=[...p("top"),...p("bottom")];for(const Oe of p(xe))for(const Be of p(ze))for(const Z of we)L(ue,[de,{x:Oe,y:de.y},{x:Oe,y:Z},{x:Be,y:Z},{x:Be,y:ge.y},ge])},"addHorizontalPairCandidates"),B=O((ue,de,xe,ge,ze)=>{const we=[...p("left"),...p("right")];for(const Oe of p(xe))for(const Be of p(ze))for(const Z of we)L(ue,[de,{x:de.x,y:Oe},{x:Z,y:Oe},{x:Z,y:Be},{x:ge.x,y:Be},ge])},"addVerticalPairCandidates"),V=O(ue=>{const de=new Set;return ue.map(xe=>Ni(xe)).filter(xe=>{const ge=xe.map(ze=>`${ze.x.toFixed(3)},${ze.y.toFixed(3)}`).join("|");return de.has(ge)||xe.length<2?!1:(de.add(ge),!0)})},"dedupeCandidatePaths"),z=O((ue,de,xe,ge)=>{const ze=[],we=DCe(ue,de,xe,ge,20,Lr);we&&L(ze,we),de===ge&&M(ze,ue,de,xe);const Oe=R(de),Be=R(ge);return Oe&&!Be?I(ze,ue,de,xe,ge):!Oe&&Be?N(ze,ue,de,xe,ge):Oe?F(ze,ue,de,xe,ge):B(ze,ue,de,xe,ge),V(ze)},"buildCandidatesForSides"),U=O((ue,de,xe,ge)=>{const ze=[...p("left"),...p("right")],we=[...p("top"),...p("bottom")];for(const Oe of u){const Be=zC(ge,Oe),Z=Oe==="top"||Oe==="bottom"?p(Oe):we;for(const le of ze){L(ue,[de,xe,{x:le,y:xe.y},{x:le,y:Be.y},Be]);for(const be of Z)L(ue,[de,xe,{x:le,y:xe.y},{x:le,y:be},{x:Be.x,y:be},Be])}}},"addVerticalDepartureOuterTrackCandidates"),Q=O((ue,de,xe,ge)=>{const ze=[...p("left"),...p("right")],we=[...p("top"),...p("bottom")];for(const Oe of u){const Be=zC(ge,Oe),Z=Oe==="left"||Oe==="right"?p(Oe):ze;for(const le of we){L(ue,[de,xe,{x:xe.x,y:le},{x:Be.x,y:le},Be]);for(const be of Z)L(ue,[de,xe,{x:xe.x,y:le},{x:be,y:le},{x:be,y:Be.y},Be])}}},"addHorizontalDepartureOuterTrackCandidates"),G=O(ue=>{const de=ue.start,xe=ue.end,ge=xe?s.get(xe):void 0;if(!de||!ge)return[];const ze=Ni(ue.points??[]);if(ze.length<4)return[];const we=ze[0],Oe=ze[1],Be=[];return ts(we,Oe,Lr)?U(Be,we,Oe,ge):es(we,Oe,Lr)&&Q(Be,we,Oe,ge),Be},"terminalPreservingOuterTrackCandidates"),q=O(ue=>{const de=ue.start,xe=ue.end,ge=de?s.get(de):void 0,ze=xe?s.get(xe):void 0;if(!ge||!ze)return[];const we=[];for(const Oe of u){const Be=zC(ge,Oe);for(const Z of u)we.push(...z(Be,Oe,zC(ze,Z),Z))}return we.push(...G(ue)),we},"candidatePathsFor"),Y=O(()=>new Map(d.map(ue=>[ue,Xn(g(ue))])),"currentSegmentsByEdge"),ne=O((ue,de,xe)=>{const ge=new Set;for(const ze of d){if(ze===ue)continue;const we=xe.get(ze)??Xn(g(ze));de.some(Oe=>we.some(Be=>W0(Oe,Be,.5)>=Gl))&&ge.add(ze)}return ge},"sharedTrackConflictsFor"),X=O((ue,de,xe,ge)=>{const ze=new Set;return q(ue).map(Oe=>Y0(Ni(Oe))).filter(Oe=>{if(P(ue,Oe))return!1;const Be=Oe.map(Z=>`${Z.x.toFixed(3)},${Z.y.toFixed(3)}`).join("|");return ze.has(Be)||Oe.length<2?!1:(ze.add(Be),!0)}).map(Oe=>{const Be=Xn(Oe);let Z=0;for(const le of d)le!==ue&&(Z+=m(Be,xe.get(le)??Xn(g(le))));return{candidate:Oe,candidateSegments:Be,crossings:de.count-(ge.get(ue)??0)+Z,bends:ff(Oe,Lr),totalBends:ff(Oe),length:C(Oe)}}).filter(({crossings:Oe})=>Oe<=de.count).sort((Oe,Be)=>Oe.crossings-Be.crossings||Oe.bends-Be.bends||Oe.length-Be.length).slice(0,48).map(Oe=>({path:Oe.candidate,segments:Oe.candidateSegments,sharedTrackConflicts:ne(ue,Oe.candidateSegments,xe),totalBends:Oe.totalBends,length:Oe.length}))},"pairCandidatesFor"),J=O((ue,de,xe,ge,ze,we)=>{let Oe=0;for(const Z of ue.pairs)(Z.first===de||Z.second===de||Z.first===ge||Z.second===ge)&&(Oe+=Z.count);let Be=m(xe.segments,ze.segments);for(const Z of d){if(Z===de||Z===ge)continue;const le=we.get(Z)??Xn(g(Z));Be+=m(xe.segments,le)+m(ze.segments,le)}return ue.count-Oe+Be},"pairCrossingCount"),ee=O((ue,de)=>{for(const xe of ue.sharedTrackConflicts)if(xe!==de)return!1;return!0},"conflictsOnlyWith"),te=O((ue,de)=>ue.segments.some(xe=>de.segments.some(ge=>W0(xe,ge,.5)>=Gl)),"candidatesShareTrack"),pe=O((ue,de,xe,ge)=>ee(de,xe.edge)&&ee(ge,ue.edge)&&!te(de,ge),"pairCandidatesAreCompatible"),ie=O((ue,de,xe,ge,ze)=>{const we=J(ue.current,de.edge,xe,ge.edge,ze,ue.baseSegments);if(!(we>=ue.current.count))return{replacements:new Map([[de.edge,xe.path],[ge.edge,ze.path]]),crossings:we,bends:ue.currentBends-(ue.baseBendsByEdge.get(de.edge)??0)-(ue.baseBendsByEdge.get(ge.edge)??0)+xe.totalBends+ze.totalBends,length:ue.currentLength-(ue.baseLengthByEdge.get(de.edge)??0)-(ue.baseLengthByEdge.get(ge.edge)??0)+xe.length+ze.length}},"scorePairReplacement"),Ce=O((ue,de)=>ue.crossings{let ze=ge;for(const we of de.candidates)for(const Oe of xe.candidates){if(!pe(de,we,xe,Oe))continue;const Be=ie(ue,de,we,xe,Oe);Be&&Ce(Be,ze)&&(ze=Be)}return ze},"bestScoreForOptionPair"),Ee=O(ue=>{const de=k(),xe=E(),ge=Y(),ze=T(ue),we=new Map(d.map(ae=>[ae,ff(g(ae))])),Oe=new Map(d.map(ae=>[ae,C(g(ae))])),Be=new Map,Z=A(ue);for(const ae of Z)for(const K of ae){if(Be.has(K))continue;const se=X(K,ue,ge,ze);se.length>0&&Be.set(K,{edge:K,candidates:se})}let le={replacements:new Map,crossings:ue.count,bends:de,length:xe};const be={current:ue,currentBends:de,currentLength:xe,baseBendsByEdge:we,baseLengthByEdge:Oe,baseSegments:ge};for(const ae of Z){const K=new Set(ae.filter(me=>ue.edgeSet.has(me))),se=ae.map(me=>Be.get(me)).filter(me=>!!me);for(let me=0;me0?le.replacements:void 0},"bestPairedReplacement");for(let ue=0;ue<4;ue++){const de=y(),xe=de.count;if(xe===0)return;let ge,ze,we=xe,Oe=Number.POSITIVE_INFINITY;for(const Z of de.edges){const le=ff(g(Z),Lr);for(const be of q(Z)){const ae=P(Z,be),K=!ae&&_(Z,be),se=S(de,Z,be),me=ff(be,Lr);ae||K||!(sewe||se===we&&me>=Oe||(ge=Z,ze=be,we=se,Oe=me)}}if(ge&&ze){ge.points=ze;continue}const Be=Ee(de);if(!Be)return;for(const[Z,le]of Be)Z.points=le}}O(oBt,"resolveRenderedOrthogonalCrossings");var K2=.001,hPn=8;function sBt(t,e){const{nodeInfoById:r,realNodeRects:n}=tee(e),i=["top","bottom","left","right"],a=20,o={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},s=O((m,v,y,b)=>{const x=[],w=DCe(m,v,y,b,a,K2);return w&&x.push(w),v===b&&x.push(LCe(m,v,y,o[v])),x},"buildOrthogonalPathCandidates"),l=O((m,v)=>{for(let y=0;y{let b=0;const x=F4(m,K2),w=v.start,A=v.end;for(const S of t){if(S===v||S.isLayoutOnly)continue;const T=S.start,C=S.end;if(!y&&w&&A&&(T===w||T===A||C===w||C===A))continue;const k=S.points;if(!(!k||k.length<2))for(const E of x)for(const _ of F4(k,K2)){if(ICe(E.a,E.b,_.a,_.b,K2,K2)){b++;continue}W0(E,_,K2)>=hPn&&b++}}return b},"pathConflictCount"),h=4,d=O((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=O((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=ff(v,K2);if(y0){const N=u(M,m,!0);if(N>E||N===E&&I>=_)continue;E=N,_=I,k=M;continue}u(M,m)>C||I<_&&(_=I,k=M)}}}if(k){m.points=k;const P=f.get(b);P&&f.set(b,P.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)}}}O(sBt,"simplifyDetouredEdges");var td=.001,lBt=10,cee=7;function tOe(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 o=a.x-i.x,s=a.y-i.y;if(!(Math.abs(o)+Math.abs(s)a&&eee(t,cBt(a)))}O(rOe,"labelOverlapsOwnMarker");function uee(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=RCe(m,a);for(const{nodeId:y,rect:b}of n)if(y!==g&&eee(v,b))return!0;return!1},"labelOverlapsForeignNode"),u=O((g,m)=>{const v=RCe(m,a);for(const y of r)if(y.edgeId!==g&&JJ(y.p1,y.p2,v))return!0;return!1},"labelOverlapsForeignEdge"),h=O((g,m,v)=>l(g,v)||u(m,v),"labelOverlapsAnything"),d=[],f=O(g=>{for(const{id:m,rect:v}of i)if(P8t(v,g))return m},"findContainingLane"),p=O((g,m)=>d.some(v=>v.labelId!==g&&eee(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=td&&G>=td||w.push({idx:V,length:Q+G,orientation:Q>=td?"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",C=O(V=>[...V].sort((z,U)=>{const Q=z.orientation===T,G=U.orientation===T;if(Q!==G)return Q?-1:1;const q=z.length>=(z.orientation==="horizontal"?b:x)+2,Y=U.length>=(U.orientation==="horizontal"?b:x)+2;return q!==Y?q?-1:1:U.length-z.length}),"rankSegments"),k=w[0],E=w[w.length-1],_=[.5,.25,.75,.05,.95,.15,.85,.1,.9],P=O((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=O((V,z,U)=>Math.min(U,Math.max(z,V)),"clamp"),R=O((V,z)=>V.midX>=z.left-td&&V.midX<=z.right+td&&V.midY>=z.top-td&&V.midY<=z.bottom+td,"pointInsideRectInclusive"),D=O(V=>{const z=z4(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+o,q=Q.rect.right-b/2-o,Y=Q.rect.top+x/2+o,ne=Q.rect.bottom-x/2-o;if(G>q||Y>ne)return;const X={midX:L(V.midX,G,q),midY:L(V.midY,Y,ne)},J=z4(X.midX,X.midY,b,x);return R(V,J)?{laneId:Q.id,anchor:X,rect:J}:void 0},"placementForAnchor"),M=O((V,z,U)=>V.orientation==="horizontal"?Math.abs(z.midX-U.x):Math.abs(z.midY-U.y),"distanceAlongSegment"),I=O((V,z)=>{const Q=(V.orientation==="horizontal"?b/2:x/2)+s;if(V===k){const G=y[V.idx];if(M(V,z,G)+td{const z=C(V);for(const U of z)for(const Q of _){const G=P(U,Q);if(!I(U,G))continue;const q=D(G);if(q&&!rOe(q.rect,y)&&!p(m,q.rect)&&!h(m,g.id,q.rect))return{laneId:q.laneId,anchor:q.anchor}}},"tryPool"),F=O((V,z,U=!1)=>{const Q=C(V);for(const G of Q){const q={midX:G.midX,midY:G.midY};if(z&&!I(G,q))continue;const Y=D(q);if(Y&&!rOe(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})}}}O(uee,"anchorLabelsToPolyline");var nOe=1e-6,dPn=8,uBt=dPn/2,fPn=3;function iOe(t,e){return t{const h=iOe(s,l);let d=0;const f=O(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(o.labelNodeId);for(const p of t){if(p===o||p.isLayoutOnly)continue;const g=p.start,m=p.end;!g||!m||iOe(g,m)===h&&f(p.labelNodeId)}return d>0?d+fPn:0},"labelClearanceFor");for(const o of t){if(o.isLayoutOnly)continue;const s=o.points;if(!ECe(s,nOe))continue;const l=MCe(o,r,nOe);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(As(m,v,n,[u,h],1))continue;const b=a(o,u,h,p?"x":"y"),x=b>uBt?b:uBt,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(!As(S,T,n,[u,h],1)&&!ree(S,T,t,o,{epsilon:nOe})){o.points=[S,T];break}}}}O(hBt,"straightenCollinearSiblingDetours");function aOe(t,e){const{realNodeRects:l,labelNodeRects:u}=X2(e.values()),h=O((A,S)=>F4(S,.001).map(T=>({...T,edge:A,interior:T.index>=1&&T.index<=S.length-3})),"segmentsFor"),d=O(()=>{const A=[];for(const S of t){if(S.isLayoutOnly)continue;const T=S.points;!T||T.length<2||A.push(...h(S,Ni(T)))}return A},"allSegments"),f=O((A,S)=>A.horizontal&&S.horizontal?Ju(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?Ju(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=O((A,S)=>{const T=A.start,C=A.end,k=h(A,S);if(k.length!==S.length-1)return!1;const E=[T,C].filter(P=>!!P),_=A.labelNodeId?[A.labelNodeId]:[];for(const P of k)if(As(P.a,P.b,l,E,-2)||As(P.a,P.b,u,_,-2))return!1;for(const P of t){if(P===A||P.isLayoutOnly)continue;const L=P.points;if(!(!L||L.length<2)){for(const R of k)for(const D of h(P,Ni(L)))if(f(R,D)||V1(R.a,R.b,D.a,D.b,.001))return!1}}return!0},"candidateIsSafe"),g=O((A,S)=>{const T=Ni(A.edge.points??[]);if(T.length<4||A.index>=T.length-1)return;const C=T.map(k=>({...k}));if(A.horizontal)C[A.index].y+=S,C[A.index+1].y+=S;else if(A.vertical)C[A.index].x+=S,C[A.index+1].x+=S;else return;return h(A.edge,C).length===C.length-1?C:void 0},"shiftedCandidate"),m=O((A,S)=>({x:A.x??(S.left+S.right)/2,y:A.y??(S.top+S.bottom)/2}),"nodeCenter"),v=O(A=>{const S=A.edge,T=Ni(S.points??[]);if(T.length!==4||A.index!==1)return;const C=S.start?e.get(S.start):void 0,k=S.end?e.get(S.end):void 0,E=C?ed(C):void 0,_=k?ed(k):void 0,P=T.slice(A.index+2);if(!(!C||!k||!E||!_||P.length===0))return{sourceCenter:m(C,E),targetCenter:m(k,_),sourceRect:E,tail:P}},"sourceDetourContextFor"),y=O((A,S,T,C,k,E)=>{const _=C.y>=T.y,P=_?k.bottom:k.top,L=P+(_?20:-20);if(_&&A.b.y<=L+.001||!_&&A.b.y>=L-.001)return;const R=A.a.x+S;return Ni([{x:T.x,y:P},{x:T.x,y:L},{x:R,y:L},{x:R,y:A.b.y},...E],.001)},"verticalSourceDetour"),b=O((A,S,T,C,k,E)=>{const _=C.x>=T.x,P=_?k.right:k.left,L=P+(_?20:-20);if(_&&A.b.x<=L+.001||!_&&A.b.x>=L-.001)return;const R=A.a.y+S;return Ni([{x:P,y:T.y},{x:L,y:T.y},{x:L,y:R},{x:A.b.x,y:R},...E],.001)},"horizontalSourceDetour"),x=O((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 C=0;CL.interior);for(const L of P){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}}O(aOe,"nudgeSharedInteriorSubpaths");function dBt(t,e,r,n){const i=e.x-t.x,a=e.y-t.y,o=n.x-r.x,s=n.y-r.y,l=i*s-a*o;if(Math.abs(l)<1e-10)return!1;const u=r.x-t.x,h=r.y-t.y,d=(u*s-h*o)/l,f=(u*a-h*i)/l,p=.01;return d>p&&d<1-p&&f>p&&f<1-p}O(dBt,"segmentsIntersect");function fBt(t){const e=t.nodes??[],r=t.edges??[],n=[];if(!r.length||!e.length)return n;const i=N8t(e),a=[];for(const s of r){if(s.isLayoutOnly)continue;const l=s.points;if(!l||l.length<2)continue;const u=s.start,h=s.end,d=s.labelNodeId,f=s.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 s=n.filter(u=>u.type==="edge-node-overlap").length,l=n.filter(u=>u.type==="edge-edge-crossing").length;ye.warn(`[SWIMLANE_VALIDATE] ${n.length} issue(s) detected: ${s} edge-node overlap(s), ${l} edge crossing(s)`);for(const u of n)ye.warn(`[SWIMLANE_VALIDATE] ${u.type}: ${u.detail}`)}return n}O(fBt,"validateSwimlanesLayout");function pBt(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(s=>!s.isGroup);if((e==="LR"||e==="RL")&&i.length>0&&!Z8t(t,e)||e==="BT"&&i.length>0&&!K8t(t))return;for(const s of n){if(s.isLayoutOnly)continue;const l=s.points;!l||l.length<2||(s.points=Y0(nee(l)))}sBt(n,r),hBt(n,r),J8t(n,r);const a=new Map;for(const s of r)a.set(String(s.id),s);uee(n,a),V8t(n,a),eBt(n,a),aOe(n,a),tBt(n,a),rBt(n,a),ZCe(n,a),nBt(n,a);const o=O(()=>{oBt(n,a),iBt(n,a),aBt(n,a),uee(n,a),YCe(n,a),ZCe(n,a),uee(n,a),YCe(n,a)},"finalizeRenderedEdges");o(),aOe(n,a),o(),JCe(n,a),eOe(n,a),JCe(n,a),eOe(n,a)}O(pBt,"postProcessSwimlaneLayout");function Z2(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 o=`${a.id}:${a.src}->${a.dst}`;r.has(o)||(r.add(o),n.push(a))}return{nodes:[...e.keys()],edges:n,layout:t.layout,nodeById:e}}O(Z2,"normalizeGraph");function oOe(t,e){return t.edges.filter(r=>r.dst===e)}O(oOe,"incoming");function gBt(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}O(gBt,"buildSuccessorMap");function sOe(t){const e=gBt(t);for(const r of e.values())r.sort((n,i)=>n.localeCompare(i));return e}O(sOe,"buildSortedSuccessorMap");function lOe(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}O(lOe,"buildInDegreeMap");function cOe(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,r)=>e.localeCompare(r))}O(cOe,"sortedZeroInDegreeNodes");function hee(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}}O(hee,"buildPredecessorSuccessorMaps");function uOe(t,e,r,n){var o,s;let i=0;for(const l of t.nodes)n!=null&&n.skipGroups&&((o=t.nodeById.get(l))!=null&&o.isGroup)||(i=Math.max(i,r[l]??0));const a=Array.from({length:i+1},()=>[]);for(const l of e)n!=null&&n.skipGroups&&((s=t.nodeById.get(l))!=null&&s.isGroup)||a[Math.max(0,r[l]??0)].push(l);return a}O(uOe,"buildLayersFromRanks");function zF(t){const e=lOe(t),r=cOe(e),n=[],i=sOe(t);for(;r.length;){const a=r.shift();n.push(a);for(const o of i.get(a)??[])if(e.set(o,(e.get(o)??0)-1),(e.get(o)??0)===0){let s=0;for(;s{if(i-n<=1)return 0;const a=n+i>>1;let o=r(n,a)+r(a,i),s=n,l=a,u=n;for(;s=i||sd.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=O(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"),o=[...e.nodes].sort((h,d)=>h.localeCompare(d));for(const h of o)n[h]===0&&a(h);const s=new Set(i.map(h=>`${h.id}:${h.src}->${h.dst}`)),l=e.edges.map(h=>s.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}}O(mBt,"removeCycles_DFS");function vBt(t){const e=new Map,r=O(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 s=r(a)??a;return e.set(n,s),s},"resolve");for(const n of t.nodes)r(n);return e}O(vBt,"buildTopLaneMap");function Q1(t){const e=vBt(t);return r=>e.get(r)??null}O(Q1,"createTopLaneResolver");function dee(t){const e=[];for(const r of t.layout.nodes??[])r.isGroup&&!r.parentId&&e.push(r.id);return[...new Set(e)].reverse()}O(dee,"buildTopLaneOrder");function dOe(t,e){const r=dee(t);if(!e||e.length===0)return r;const n=new Set(r),i=new Set,a=[];for(const o of e)!n.has(o)||i.has(o)||(i.add(o),a.push(o));for(const o of r)i.has(o)||a.push(o);return a}O(dOe,"resolveTopLaneOrder");var pPn={EPSILON:1e-6},fee={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},yBt={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function bBt(t,e){const r=Z2(t),n=(e==null?void 0:e.laneOf)??(()=>null),i=e==null?void 0:e.rankHint,{preds:a}=hee(r);for(const A of a.values())A.sort((S,T)=>S.localeCompare(T));const o=zF(r)??[...r.nodes].sort((A,S)=>A.localeCompare(S)),s=new Map;for(const[A,S]of o.entries())s.set(S,A);const l=new Map,u=new Map;for(const A of r.nodes)u.set(A,[]);for(const A of o){const S=(a.get(A)??[]).filter(T=>l.has(T));if(S.length>0){const T=xBt(A,S,{laneOf:n,rankHint:i,topoIndex:s});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=s.get(A)??0,C=s.get(S)??0;return T===C?A.localeCompare(S):T-C}),f=wBt(r),p=new Map;for(const[A,S]of f.entries())p.set(A,[...S].sort((T,C)=>T.localeCompare(C)));const g=ABt(p),m=SBt(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=O(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 o)w(A);return{parent:l,children:u,roots:d,componentOf:g,blocks:m,nodeBlocks:v,adjacency:p,preorder:y,postorder:b,topologicalOrder:o}}O(bBt,"buildDrivingTree");function xBt(t,e,r){const n=r.laneOf(t);return[...e].sort((a,o)=>{var m,v;const s=r.laneOf(a),l=r.laneOf(o),u=s!=null&&s===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[o];if(d!=null&&f!=null&&d!==f)return f-d;const p=r.topoIndex.get(a)??0,g=r.topoIndex.get(o)??0;return p!==g?p-g:a.localeCompare(o)})[0]}O(xBt,"chooseParent");function wBt(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}O(wBt,"buildAdjacency");function ABt(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 o of t.get(a)??[])e.has(o)||i.push(o)}}r++}return e}O(ABt,"assignComponents");function SBt(t){const e=new Map,r=new Map,n=[],i=[];let a=0;const o=O((s,l)=>{e.set(s,++a),r.set(s,a);for(const u of t.get(s)??[])u!==l&&(e.has(u)?(e.get(u)??0)<(e.get(s)??0)&&(n.push([s,u]),r.set(s,Math.min(r.get(s)??a,e.get(u)??a))):(n.push([s,u]),o(u,s),r.set(s,Math.min(r.get(s)??a,r.get(u)??a)),(r.get(u)??0)>=(e.get(s)??0)&&i.push(TBt(s,u,n,i.length))))},"visit");for(const s of t.keys())e.has(s)||o(s,null);return i}O(SBt,"computeBlocks");function TBt(t,e,r,n){const i=[],a=new Set;for(;r.length>0;){const o=r.pop();if(i.push(o),a.add(o[0]),a.add(o[1]),o[0]===t&&o[1]===e||o[0]===e&&o[1]===t)break}return{id:n,edges:i,nodes:[...a]}}O(TBt,"popBlock");function CBt(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,o=new Array(a).fill(-1),s=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&&(o[w]=-1,s[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&&(o[S]=x,s[S]=s[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&&(o[x]=-1,s[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;s[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),C=i.get(w);if(T==null||C==null)continue;const k=f(T,C);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=O(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 C=y(T),k=e[b];if(k!=null){let E=g.get(b);E||(E=new Map,g.set(b,E));let _=C.get(k)??0;const P=e[T];P!=null&&P>k&&(_+=1),E.set(T,_)}m(A,C)}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}O(CBt,"computeSubtreeCrossCounts");function OBt(t,e,r){const n=new Map,i=O(a=>{let o=r[a]??0;const s=[...e.get(a)??[]];s.sort(fOe(r));for(const l of s){i(l);const u=n.get(l);u!=null&&(o=Math.min(o,u))}n.set(a,o)},"annotate");for(const a of t)i(a);return n}O(OBt,"annotateMinimumLayers");function fOe(t){return(e,r)=>{const n=t[e]??0,i=t[r]??0;return n===i?e.localeCompare(r):n-i}}O(fOe,"compareByRankThenId");function kBt(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},()=>[]),o=new Set,s=O(l=>{if(o.has(l))return;o.add(l);const u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l);for(const h of n(l))s(h)},"emit");for(const l of t)s(l);for(const l of e)if(!o.has(l)){const u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l),o.add(l)}return a}O(kBt,"emitNodesInTreeOrder");function EBt(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}O(EBt,"deduplicateLayers");function _Bt(t,e,r,n){return i=>{const a=t.get(i)??[];if(a.length===0)return[];const o=e[i]??0,s=[],l=[],u=r.get(i);for(const h of a){const d=n.get(h)??o;d>o?s.push({child:h,min:d}):l.push(h)}return s.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)??o,m=n.get(d)??o;return g!==m?g-m:h.localeCompare(d)}),[...s.map(h=>h.child),...l]}}O(_Bt,"createChildOrderer");function pee(t,e,r){const n=bBt(t,{rankHint:e,laneOf:r}),{children:i,roots:a}=n;for(const d of t.nodes)i.has(d)||i.set(d,[]);const o=CBt(t,e,n),s=[...a].sort(fOe(e)),l=OBt(s,i,e),u=_Bt(i,e,o,l);let h=kBt(s,t.nodes,e,u);return h=EBt(h),h}O(pee,"buildMultitreeLayerOrder");function RBt(t,e,r){const n=new Set(t),i=new Set(e),a=U4(e),o=[];for(const s of r)n.has(s.src)&&i.has(s.dst)&&o.push(a.get(s.dst));return hOe(o)}O(RBt,"countCrossingsBetweenAdjacent");function pOe(t,e,r){const n=[];for(const a of e){const o=r[a.src],s=r[a.dst];if(o==null||s==null||o===s)continue;let l=a.src,u=a.dst,h=o,d=s;o>s&&(l=a.dst,u=a.src,h=s,d=o);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=pee(t,r,i),v=pOe(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 o=t.edges.filter(m=>m.src===i);if(o.length===0)continue;let s=!1,l=0;for(const m of o){const v=r(m.dst);v==null||v===a?s=!0:l++}if(l===0||s)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)}}O(LBt,"adjustCrossLaneSources");function MBt(t,e){const r=Z2(t),n=zF(r)??[...r.nodes].sort(),i=(e==null?void 0:e.compactSingleInput)??!1,a=Q1(r);let o=Object.create(null);for(const l of n){const u=oOe(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)o[l]=0;else if(i&&h.length===1){const d=h[0].src,f=a(d),p=a(l);f!==p?o[l]=o[d]??0:o[l]=(o[d]??0)+1}else{let d=-1/0;for(const f of h)d=Math.max(d,(o[f.src]??0)+1);o[l]=d===-1/0?0:d}}return((e==null?void 0:e.optimizeRanksByCrossings)??!1)&&(o=DBt(r,o)),e!=null&&e.ignoreCrossLaneEdges&&LBt(r,o),{layers:pee(r,o,a),rankOf:o,dummy:new Set}}O(MBt,"assignLayers_LongestPath");function IBt(t,e){const r=Z2(t),i={...MBt(r,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},a=Q1(r),{preds:o,succs:s}=hee(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=zF(r)??[...r.nodes],u=[...l].reverse(),h=O((g,m)=>{let v=0;for(const x of o.get(g)??[])v=Math.max(v,(i[x]??0)+1);let y=Number.POSITIVE_INFINITY;const b=s.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=fee.GRAVITY_ITERATIONS,f=O(g=>{let m=!1;for(const v of g){const y=o.get(v)??[],b=s.get(v)??[];if(y.length===0&&b.length===0)continue;const x=y.length>0?y.reduce((T,C)=>T+(i[C]??0)+1,0)/y.length:i[v]??0,w=b.length>0?b.reduce((T,C)=>T+(i[C]??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:uOe(r,l,i),rankOf:i,dummy:new Set}}O(IBt,"assignLayers_Gravity");function PBt(t){const e=lOe(t),r=sOe(t);let n=cOe(e);const i=[];for(;n.length>0;){const a=[];for(const o of n){i.push(o);for(const s of r.get(o)??[])e.set(s,(e.get(s)??0)-1),(e.get(s)??0)===0&&a.push(s)}n=a.sort((o,s)=>o.localeCompare(s))}return i.length===t.nodes.length?i:null}O(PBt,"topoSortByGenerationIfAcyclic");function NBt(t,e){const r=Z2(t),n=(e==null?void 0:e.direction)==="LR"?PBt(r)??[...r.nodes].sort():zF(r)??[...r.nodes].sort(),i=Q1(r),a=O(h=>i(h)??h,"laneOf"),o=Object.create(null),s=new Map,l=O((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=oOe(r,h);let p=0;if(f.length>0)for(const y of f){const b=y.src,x=o[b]??0;p=Math.max(p,x+l(b,h))}const g=a(h),m=s.get(g)??0,v=Math.max(p,m);o[h]=v,s.set(g,v+1)}return{layers:uOe(r,n,o,{skipGroups:!0}),rankOf:o,dummy:new Set}}O(NBt,"assignLayers_LaneAwareCompact");function BBt(t,e){const r=Z2(e),{rankOf:n}=t,i=t.layers.map(p=>[...p]),a=new Set(t.dummy?[...t.dummy]:[]);let o=0;const s=new Map(r.nodeById),l=O(p=>{const g=`placeholder-${o++}`,m={id:g,isGroup:!1,isDummy:!0,width:0,height:0};for(s.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:s};return{layering:{layers:i,rankOf:n,dummy:a},graphWithDummies:f}}O(BBt,"makeProperLayering");function gOe(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])}O(gOe,"median");function mOe(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((r,n)=>r+n,0)/t.length}O(mOe,"barycenter");function $Bt(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}O($Bt,"neighborPositionsFor");function FBt(t,e,r){const n=r.get(t)??0,i=r.get(e)??0;return n!==i?n-i:t.localeCompare(e)}O(FBt,"currentOrderTieBreak");function vOe(t,e,r){const n=new Set(t),i=new Set(e),a=U4(t),o=U4(e),s=[];for(const u of r)n.has(u.src)&&i.has(u.dst)&&s.push({u:a.get(u.src),v:o.get(u.dst)});s.sort((u,h)=>u.u===h.u?u.v-h.v:u.u-h.u);const l=s.map(u=>u.v);return hOe(l)}O(vOe,"countCrossingsBetweenAdjacent");function gee(t,e,r){return[...t].sort((n,i)=>{const a=gOe(e.get(n)??[]),o=gOe(e.get(i)??[]);return a===o?FBt(n,i,r):isFinite(a)?isFinite(o)?a-o:-1:1})}O(gee,"sortByHeuristic");function yOe(t,e,r,n,i,a){const o=U4(t),s=U4(e),l=$Bt(e,o,r,n);if(!i||!a||a.length===0)return gee(e,l,s);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=gee(p,l,s);h.push(...g)}const d=u.get(null);if(d&&d.length>0){const f=gee(d,l,s);for(const p of f){const g=mOe(l.get(p)??[]);let m=h.length;if(isFinite(g))for(const[v,y]of h.entries()){const b=mOe(l.get(y)??[]);if(go.has(m.src)&&s.has(m.dst)),h=l?r.filter(m=>s.has(m.src)&&l.has(m.dst)):void 0,d=O(m=>{let v=vOe(t,m,u);return h&&n&&(v+=vOe(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[...s]),i=e.edges,a=Q1(e),o=dOe(e,r==null?void 0:r.laneOrder);for(let s=0;s<3;s++){for(let l=1;l=0;l--)n[l]=yOe(n[l+1],n[l],i,"up",a,o),n[l]=bOe(n[l+1],n[l],i,n[l-1],a)}return{layers:n}}O(zBt,"orderLayers");function UBt(t,e,r){const n=(r==null?void 0:r.layerGap)??yBt.DEFAULT_LAYER_GAP,i=(r==null?void 0:r.nodeGap)??yBt.DEFAULT_NODE_GAP,a=(r==null?void 0:r.laneGap)??i*2,o=(r==null?void 0:r.direction)??"TB",s=o==="LR"||o==="RL",l=t.layers,u=Object.create(null),h=Object.create(null),d=O(E=>e.nodeById.get(E),"getNode"),f=O(E=>{var _;return((_=d(E))==null?void 0:_.width)??0},"getWidth"),p=O(E=>{var _;return((_=d(E))==null?void 0:_.height)??0},"getHeight"),g=Q1(e),m=dOe(e,r==null?void 0:r.laneOrder),v=l.map(E=>E.reduce((_,P)=>Math.max(_,p(P)),0)),y=[];if(s)for(let E=0;E+1Math.max(N,f(F)),0),P=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=(_+P)/2,I=Math.max(0,M-D-n);y.push(I)}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),P=[];for(const L of E){const R=g(L);R===null?P.push(L):(_[R]||(_[R]=[])).push(L)}for(const[L,R]of Object.entries(_)){const D=R.reduce((M,I)=>M+f(I),0)+i*Math.max(0,R.length-1);S[L]=Math.max(S[L]??0,D)}if(x&&P.length){const L=P.reduce((R,D)=>R+f(D),0)+i*Math.max(0,P.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 P=-(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=I-F/2;for(const[V,z]of M.entries()){const U=N[V];u[z]=B+U/2,h[z]=C+P/2,B+=U+i}}}const R=y[E]??0;C+=P+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,P=_.start,L=_.end;if(P==null||L==null)continue;const R=Math.round(((u[P]??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===P||M===L)continue;const I=e.nodeById.get(M);I!=null&&I.isDummy&&(u[M]=R)}}return{x:u,y:h}}O(UBt,"assignCoordinates");var VBt=8;function QBt(t){let e=2166136261;for(let r=0;r>>0}O(QBt,"hashString");function GBt(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}}O(GBt,"mulberry32");function HBt(t,e){const r=[...t],n=GBt(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}O(HBt,"deterministicShuffle");function WBt(t,e){let r=0;for(const[n,i]of t.entries())r+=Math.abs(n-(e.get(i)??n));return r}O(WBt,"sourceDistance");function xOe(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:o}of e){const s=r.get(i),l=r.get(a);s==null||l==null||(n+=o*Math.abs(s-l))}return n}O(xOe,"laneArrangementCost");function YBt(t){const e=dee(t);if(e.length<2)return[];const r=new Map(e.map((a,o)=>[a,o])),n=Q1(t),i=new Map;for(const a of t.layout.edges??[]){if(a.isLayoutOnly)continue;const o=typeof a.start=="string"?a.start:void 0,s=typeof a.end=="string"?a.end:void 0;if(!o||!s||!t.nodeById.has(o)||!t.nodeById.has(s))continue;const l=n(o),u=n(s);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()]}O(YBt,"buildWeightedLaneEdges");function wOe(t,e,r){const n=[...t];let i=xOe(n,e),a=!0,o=0;const s=Math.max(1,n.length);for(;a&&oi.a===a.a?i.b.localeCompare(a.b):i.a.localeCompare(a.a)).map(({a:i,b:a,weight:o})=>`${i}:${a}:${o}`).join("|");return QBt(`${t.join("|")}#${n}#${r}`)}O(jBt,"seedForRestart");function XBt(t,e={}){const r=dee(t);if(r.length<2)return r;const n=YBt(t);if(n.length===0)return r;const i=new Map(r.map((s,l)=>[s,l]));let a=wOe(r,n,i);const o=Math.max(0,e.restarts??VBt);for(let s=0;sri&&l*3>=s?o>0?"bottom":"top":s>ri?a>0?"right":"left":r}O(SOe,"chooseOrthogonalSide");function TOe(t,e){return Math.abs(t.to-e.from)Z.isGroup&&!Z.parentId);for(const Z of u){const le={id:Z.id},be=O(ae=>{o.set(ae.id,le),r.filter(K=>K.parentId===ae.id).forEach(be)},"assignLane");be(Z)}const h=r.filter(Z=>!Z.isGroup&&!Z.isEdgeLabel).map(Z=>{const le=Z.width??10,be=Z.height??10,ae=Z.x??0,K=Z.y??0,se=gPn;return{nodeId:Z.id,minX:ae-le/2-se,maxX:ae+le/2+se,minY:K-be/2-se,maxY:K+be/2+se,visualXHalfExtent:l?be/2+se:le/2+se}}),d=O((Z,le,be,ae)=>{let K=s.find(se=>se.orientation===Z&&Math.abs(se.coord-le)<1);return K||(K={id:`pipe-${Z}-${le.toFixed(0)}`,orientation:Z,coord:le,spanMin:be,spanMax:ae,tracks:[]},s.push(K)),K.spanMin=Math.min(K.spanMin,be),K.spanMax=Math.max(K.spanMax,ae),K},"getOrAddPipe"),f=O((Z,le)=>{const be=Z.width??10,ae=Z.height??10,K=Z.x??0,se=Z.y??0;switch(le){case"top":return{x:K,y:se-ae/2};case"bottom":return{x:K,y:se+ae/2};case"left":return{x:K-be/2,y:se};case"right":return{x:K+be/2,y:se}}},"portForSide"),p=O((Z,le,be)=>f(Z,SOe(Z,le,be?"bottom":"top")),"getOrthogonalPort"),g=[],m=[],v=new Set,y=1e3,b=O((Z,le,be)=>{if(g.length===0)return 0;const ae=Math.abs(le.y-be.y)ve||ce.from-ri<=me&&ce.to+ri>=me&&(se+=y)}else if(K){const me=le.x,oe=Math.min(le.y,be.y)-ri,ve=Math.max(le.y,be.y)+ri;if(ve<=oe)return 0;for(const ce of g)ce.edgeIndex===Z||ce.orientation!=="horizontal"||ce.pipe.coordve||ce.from-ri<=me&&ce.to+ri>=me&&(se+=y)}return se},"crossingPenalty"),x=i.map((Z,le)=>{if(!Z.start||!Z.end)return{idx:le,crossLane:0,dx:0,dy:0};const be=a.get(Z.start),ae=a.get(Z.end),K=o.get(Z.start),se=o.get(Z.end),me=K&&se&&K.id!==se.id?1:0,oe=be&&ae?Math.abs((ae.x??0)-(be.x??0)):0,ve=be&&ae?Math.abs((ae.y??0)-(be.y??0)):0;return{idx:le,crossLane:me,dx:oe,dy:ve}}).sort((Z,le)=>{if(Z.crossLane!==le.crossLane)return le.crossLane-Z.crossLane;const be=Z.dx+Z.dy,ae=le.dx+le.dy;return Math.abs(be-ae)>1?be-ae:Z.idx-le.idx}).map(Z=>Z.idx),w=O((Z,le,be,ae)=>{const K=Math.min(Z.x,le.x),se=Math.max(Z.x,le.x),me=Math.min(Z.y,le.y),oe=Math.max(Z.y,le.y);return!!h.find(ce=>be&&ce.nodeId===be||ae&&ce.nodeId===ae?!1:Math.abs(Z.x-le.x)>ri?ce.minYZ.y&&ce.maxX>K&&ce.minXZ.x&&ce.maxY>me&&ce.minYSOe(Z,le,"bottom"),"determineSide"),C=new Map;for(const[Z,le]of i.entries()){if(!le.start||!le.end||le.start===le.end||le.points&&le.points.length>0)continue;const be=a.get(le.start),ae=a.get(le.end);if(!be||!ae)continue;const K=(ae.x??0)-(be.x??0),se=(ae.y??0)-(be.y??0);C.set(Z,{edgeIdx:Z,srcId:le.start,dstId:le.end,srcSide:T(be,{x:ae.x??0,y:ae.y??0}),dstSide:T(ae,{x:be.x??0,y:be.y??0}),absDx:Math.abs(K),absDy:Math.abs(se),dxSign:Math.sign(K),dySign:Math.sign(se)})}const k=O(Z=>Z.srcSide==="top"||Z.srcSide==="bottom"?Z.absDx===0?1/0:Z.absDy/Z.absDx:Z.absDy===0?1/0:Z.absDx/Z.absDy,"preferenceStrength"),E=O(Z=>Z.srcSide==="top"||Z.srcSide==="bottom"?Z.dxSign>=0?"right":"left":Z.dySign>=0?"bottom":"top","secondarySide"),_=new Map;for(const Z of C.values()){const le=`${Z.srcId}:${Z.srcSide}`;_.has(le)||_.set(le,[]),_.get(le).push(Z)}const P=new Map,L=O((Z,le)=>`${Z}:${le}`,"loadKey");for(const Z of C.values())P.set(L(Z.srcId,Z.srcSide),(P.get(L(Z.srcId,Z.srcSide))??0)+1),P.set(L(Z.dstId,Z.dstSide),(P.get(L(Z.dstId,Z.dstSide))??0)+1);for(const Z of _.values())if(!(Z.length<2)){Z.sort((le,be)=>{const ae=k(le),K=k(be);return Math.abs(ae-K)>1e-9?K-ae:le.edgeIdx-be.edgeIdx});for(let le=1;le=K||(P.set(L(be.srcId,be.srcSide),K-1),P.set(L(be.srcId,ae),se+1),be.srcSide=ae)}}const R=O(Z=>{const le=Z==null?void 0:Z.shape;return le==="question"||le==="diamond"},"isDiamondNode"),D=new Map;for(const Z of C.values())D.has(Z.dstId)||D.set(Z.dstId,new Set),D.get(Z.dstId).add(Z.dstSide);for(const Z of C.values()){if(!R(a.get(Z.srcId)))continue;const le=D.get(Z.srcId);if(!(le!=null&&le.has(Z.srcSide)))continue;const be=E(Z);if(le.has(be)||(P.get(L(Z.srcId,be))??0)>0)continue;const ae=P.get(L(Z.srcId,Z.srcSide))??0;P.set(L(Z.srcId,Z.srcSide),Math.max(0,ae-1)),P.set(L(Z.srcId,be),1),Z.srcSide=be}for(const Z of C.values()){const{edgeIdx:le,srcId:be,dstId:ae,srcSide:K,dstSide:se}=Z,me=a.get(be),oe=a.get(ae),ve=`${be}:${K}:src`,ce=K==="top"||K==="bottom"?oe.x??0:oe.y??0;A.has(ve)||A.set(ve,[]),A.get(ve).push({edgeIdx:le,oppositeCoord:ce});const De=`${ae}:${se}:dst`,Le=se==="top"||se==="bottom"?me.x??0:me.y??0;A.has(De)||A.set(De,[]),A.get(De).push({edgeIdx:le,oppositeCoord:Le})}const M=new Map,I=8;for(const[Z,le]of A){if(le.length<2)continue;le.sort((Ze,He)=>Ze.oppositeCoord-He.oppositeCoord);const be=Z.split(":"),ae=be.slice(0,-2).join(":"),K=be[be.length-2],se=be[be.length-1],me=a.get(ae);if(!me)continue;const ve=K==="left"||K==="right"?me.height??10:me.width??10,ce=me.shape,Le=ce==="question"||ce==="diamond"?ve*.3:ve,Ne=Math.min(20,Math.max(I,Le/(le.length+1))),$e=-(Ne*(le.length-1))/2;for(const[Ze,He]of le.entries()){const et=$e+Ze*Ne,Pe=`${He.edgeIdx}:${se}`;M.set(Pe,et)}}const N=O(Z=>{var le;return!!((le=i[Z])!=null&&le.labelNodeId)},"edgeHasLabelNode"),F=O((Z,le)=>Z?(A.get(`${Z}:${le}:src`)??[]).some(({edgeIdx:be})=>N(be))||(A.get(`${Z}:${le}:dst`)??[]).some(({edgeIdx:be})=>N(be)):!1,"faceHasLabelNode"),B=O((Z,le,be)=>le==="top"||le==="bottom"?{x:Z.x+be,y:Z.y}:{x:Z.x,y:Z.y+be},"applyPortOffset"),V=O((Z,le,be)=>{const ae=C.get(Z),K={x:be.x??0,y:be.y??0},se={x:le.x??0,y:le.y??0},me=(ae==null?void 0:ae.srcSide)??T(le,K),oe=(ae==null?void 0:ae.dstSide)??T(be,se);let ve=ae?f(le,ae.srcSide):p(le,K,!0),ce=ae?f(be,ae.dstSide):p(be,se,!1);const De=M.get(`${Z}:src`),Le=M.get(`${Z}:dst`);return De!==void 0&&(ve=B(ve,me,De)),Le!==void 0&&(ce=B(ce,oe,Le)),{pSrcPort:ve,pDstPort:ce,srcSide:me,dstSide:oe}},"portsForEdge");for(const Z of x){const le=i[Z];if(m[Z]=[],!le.start||!le.end||le.points&&le.points.length>0||le.start===le.end)continue;const be=a.get(le.start),ae=a.get(le.end);if(!be||!ae)continue;const{pSrcPort:K,pDstPort:se,srcSide:me,dstSide:oe}=V(Z,be,ae),ve={...K},ce={...se},De=me==="top"||me==="bottom",Le=oe==="top"||oe==="bottom";if(De){const pt=K.y>(be.y??0);ve.y=pt?K.y+Dp:K.y-Dp}else{const pt=K.x>(be.x??0);ve.x=pt?K.x+Dp:K.x-Dp}if(Le){const pt=se.y>(ae.y??0);ce.y=pt?se.y+Dp:se.y-Dp}else{const pt=se.x>(ae.x??0);ce.x=pt?se.x+Dp:se.x-Dp}const We=O((pt,Ct)=>{for(const or of h)if(!Ct.includes(or.nodeId)&&pt.x>or.minX&&pt.xor.minY&&pt.y{if(Mn){const Vt=pt.y>(Ct.y??0);return{x:(or.x??0)>=pt.x?Jr.maxX+UC:Jr.minX-UC,y:Vt?Jr.maxY+V4:Jr.minY-V4,leavesPositiveSide:Vt}}const Rt=pt.x>(Ct.x??0),Ot=(or.y??0)>=pt.y;return{x:Rt?Jr.maxX+UC:Jr.minX-UC,y:Ot?Jr.maxY+V4:Jr.minY-V4,leavesPositiveSide:Rt}},"obstacleDetour");let je=[];const $e=[le.start,le.end],Ze=We(ve,$e);if(Ze.inside&&Ze.obstacle){const pt=Ze.obstacle;if(De){const Ct=Ne(K,be,ae,pt,!0);ve.x=Ct.x,ve.y=Ct.y;const or=Ct.leavesPositiveSide?Math.min(pt.minY-2,K.y+Dp):Math.max(pt.maxY+2,K.y-Dp);je=[{x:K.x,y:or},{x:Ct.x,y:or},{x:Ct.x,y:Ct.y}]}else{const Ct=Ne(K,be,ae,pt,!1),or=Ct.leavesPositiveSide?Math.min(pt.minX-2,K.x+Dp):Math.max(pt.maxX+2,K.x-Dp);ve.x=Ct.x,ve.y=Ct.y,je=[{x:or,y:K.y},{x:or,y:Ct.y},{x:Ct.x,y:Ct.y}]}}let He=[];const et=We(ce,$e);if(et.inside&&et.obstacle){const pt=et.obstacle;if(Le){const Ct=Ne(se,ae,be,pt,!0);ce.x=Ct.x,ce.y=Ct.y,He=[{x:Ct.x,y:Ct.y},{x:se.x,y:Ct.y}]}else{const Ct=Ne(se,ae,be,pt,!1);ce.x=Ct.x,ce.y=Ct.y,He=[{x:Ct.x,y:Ct.y},{x:Ct.x,y:se.y}]}}if(je.length===0&&He.length===0){const pt=UC,Ct=Math.abs(ve.x-ce.x)1||Rt>1,Vt=S.get(le.start??"")??0,mt=S.get(le.end??"")??0,Tr=Mn>1&&F(le.start,me)||Rt>1&&F(le.end,oe),Fe=Mn<=1||Vt<=2,ta=Rt<=1||mt<=2;if((Ct||or)&&!Jr&&(!Ot||Ot&&!Tr&&Fe&&ta)&&!w(K,se,le.start,le.end)){le.points=[{...K},{...ve},{...ce},{...se}],v.add(Z);const hi=or?"horizontal":"vertical",Bo=or?K.y:K.x,Gn=or?Math.min(K.x,se.x):Math.min(K.y,se.y),fa=or?Math.max(K.x,se.x):Math.max(K.y,se.y),di={id:`fast-path-${hi}-${Bo.toFixed(0)}-${Z}`,orientation:hi,coord:Bo,spanMin:Gn,spanMax:fa,tracks:[]};g.push({edgeIndex:Z,segmentIndex:0,orientation:hi,pipe:di,trackIndex:0,from:Gn,to:fa});continue}}const Pe=d("vertical",ve.x,ve.y,ve.y);ve.x=Pe.coord;const yt=d("vertical",ce.x,ce.y,ce.y);ce.x=yt.coord;let Ie=Math.min(ve.x,ce.x)-50,St=Math.max(ve.x,ce.x)+50,kt=Math.min(ve.y,ce.y)-50,ut=Math.max(ve.y,ce.y)+50;for(const pt of h){const Ct=Math.min(ve.x,ce.x),or=Math.max(ve.x,ce.x),Jr=Math.min(ve.y,ce.y),Mn=Math.max(ve.y,ce.y);pt.minXCt&&pt.minYJr&&(Ie=Math.min(Ie,pt.minX-mee),St=Math.max(St,pt.maxX+mee),kt=Math.min(kt,pt.minY-mee),ut=Math.max(ut,pt.maxY+mee))}for(const pt of h){if(pt.maxXSt||pt.maxYut)continue;const Ct=UC;d("horizontal",pt.minY-Ct,Ie,St),d("horizontal",pt.maxY+Ct,Ie,St);const or=V4;d("vertical",pt.minX-or,kt,ut),d("vertical",pt.maxX+or,kt,ut)}d("horizontal",ve.y,Ie,St),d("horizontal",ce.y,Ie,St);const Gt=s.filter(pt=>pt.orientation==="horizontal"&&pt.coord>=kt&&pt.coord<=ut),It=s.filter(pt=>pt.orientation==="vertical"&&pt.coord>=Ie&&pt.coord<=St),gt=O((pt,Ct)=>`${pt.toFixed(1)},${Ct.toFixed(1)}`,"getKey"),Te=gt(ve.x,ve.y),Bt=gt(ce.x,ce.y),Et=new Map,At=new Map,Mt=new Map,qr=new Set,Me=[];Et.set(Te,0),Mt.set(Te,"n"),Me.push({key:Te,f:Math.hypot(ce.x-ve.x,ce.y-ve.y),pt:ve}),qr.add(Te);let at=[];const wt=O((pt,Ct)=>w(pt,Ct,le.start,le.end),"checkSegmentBlocked"),Tt={x:ce.x,y:ve.y},dr=wt(ve,Tt),jr=wt(Tt,ce),Ir=dr||jr,Zr={x:ve.x,y:ce.y},Ur=wt(ve,Zr),kn=wt(Zr,ce);if(Ir?Ur||kn||(Math.abs(ve.x-ce.x)0;){Me.sort((mt,Tr)=>mt.f-Tr.f);const pt=Me.shift();if(qr.delete(pt.key),pt.key===Bt){let mt=Bt,Tr=ce;for(at=[Tr];At.has(mt);){const Fe=At.get(mt);at.unshift(Fe),Tr=Fe,mt=gt(Fe.x,Fe.y)}break}const Ct=pt.pt.x,or=pt.pt.y,Jr=It.sort((mt,Tr)=>mt.coord-Tr.coord),Mn=Jr.findIndex(mt=>Math.abs(mt.coord-Ct)<1),Rt=Gt.sort((mt,Tr)=>mt.coord-Tr.coord),Ot=Rt.findIndex(mt=>Math.abs(mt.coord-or)<1),Vt=[];Mn>0&&Vt.push({x:Jr[Mn-1].coord,y:or}),Mn>=0&&Mn0&&Vt.push({x:Ct,y:Rt[Ot-1].coord}),Ot>=0&&OtZs.nodeId===le.start||Zs.nodeId===le.end?!1:Tr!==Fe?Zs.minYor&&Zs.maxX>Tr&&Zs.minXCt&&Zs.maxY>ta&&Zs.minY10&&Ov<-5||vu<-10&&Ov>5)&&(fa=Math.abs(Ov)*100),(di>10&&sm<-5||di<-10&&sm>5)&&(fa+=Math.abs(sm)*50);let Sk=0;const Tk=Mt.get(pt.key)??"n",Ck=Math.abs(sm)>ri?"h":"v";Tk!=="n"&&Tk!==Ck&&(Sk=50);const xl=Bo+Gn+fa+Sk,gd=(Et.get(pt.key)??1/0)+xl,$c=Math.abs(ce.x-mt.x)+Math.abs(ce.y-mt.y);if(gd<(Et.get(hi)??1/0))if(At.set(hi,pt.pt),Et.set(hi,gd),Mt.set(hi,Ck),!qr.has(hi))Me.push({key:hi,f:gd+$c,pt:mt}),qr.add(hi);else{const Zs=Me.findIndex(Of=>Of.key===hi);Zs!==-1&&(Me[Zs].f=gd+$c)}}}if(at.length===0&&(at=[ve,{x:ve.x,y:ce.y},ce]),at.length>4){const pt=at[0],Ct=at[at.length-1];let or=Math.min(pt.x,Ct.x),Jr=Math.max(pt.x,Ct.x),Mn=Math.min(pt.y,Ct.y),Rt=Math.max(pt.y,Ct.y);for(const ta of at)or=Math.min(or,ta.x),Jr=Math.max(Jr,ta.x),Mn=Math.min(Mn,ta.y),Rt=Math.max(Rt,ta.y);const Ot=Jr>Math.max(pt.x,Ct.x),Vt=orGn.minXQe&&Gn.minYIn);if(Bo.length>0){let Gn=Math.max(pt.x,Ct.x);for(const fa of Bo){const di=(fa.minX+fa.maxX)/2;if(fa.visualXHalfExtent===void 0||isNaN(fa.visualXHalfExtent))continue;const vu=di+fa.visualXHalfExtent+ta;Gn=Math.max(Gn,vu)}isNaN(Gn)||(Jr=Gn)}}if(Vt){const Qe=h.filter(In=>In.minXMath.min(pt.y,Ct.y));if(Qe.length>0){let In=Math.min(pt.x,Ct.x);for(const hi of Qe){const Gn=(hi.minX+hi.maxX)/2-hi.visualXHalfExtent-ta;In=Math.min(In,Gn)}or=In}}}const mt=O(ta=>{const Qe=Ct.y>pt.y,In=h.filter(Gn=>{const fa=Math.min(pt.x,Ct.x)Gn.minX,di=Math.min(pt.y,Ct.y)Gn.minY;return fa&&di});let hi=In;if(l&&In.length>0){const Gn=In.filter(fa=>fa.minXta);Gn.length>0&&(hi=Gn)}if(hi.length===0)return Ct.y;const Bo=UC;if(Qe){const fa=Math.max(...hi.map(di=>di.maxY))+Bo;if(fadi.minY))-Bo;if(fa>Ct.y+ri)return fa}return Ct.y},"findBestReturnY"),Tr=O(ta=>{const Qe=mt(ta),In={x:ta,y:pt.y},hi={x:ta,y:Qe},Bo={x:Ct.x,y:Qe},Gn=wt(pt,In),fa=wt(In,hi),di=wt(hi,Bo),vu=Qe!==Ct.y?wt(Bo,Ct):!1;return!Gn&&!fa&&!di&&!vu?Math.abs(Qe-Ct.y)=3){const pt=dn[dn.length-1],Ct=dn[dn.length-2],or=dn[dn.length-3],Jr=Math.abs(or.y-Ct.y)Math.abs(pt.x-or.x)&&dn.splice(-2,1)}else if(Mn){const Rt=Math.sign(Ct.y-or.y),Ot=Math.sign(pt.y-or.y);Rt!==0&&Rt===Ot&&Math.abs(Ct.y-or.y)>Math.abs(pt.y-or.y)&&dn.splice(-2,1)}}const ii=[dn[0]];for(let pt=1;ptCt.x,Rt=Jr.x>or.x;if(Mn!==Rt){ii.push(or);continue}continue}if(Math.abs(Ct.x-or.x)Ct.y,Rt=Jr.y>or.y;if(Mn!==Rt){ii.push(or);continue}continue}ii.push(or)}ii.push(dn[dn.length-1]);for(let pt=0;ptZ.from{const K=!ae.segments.some(me=>(me.edgeIndex!==le.edgeIndex||me.segmentIndex!==le.segmentIndex)&&z(me,Z)),se=!be.segments.some(me=>(me.edgeIndex!==Z.edgeIndex||me.segmentIndex!==Z.segmentIndex)&&z(me,le));return K&&se?(Z.trackIndex=ae.index,le.trackIndex=be.index,be.segments=[...be.segments.filter(me=>me.edgeIndex!==Z.edgeIndex||me.segmentIndex!==Z.segmentIndex),{edgeIndex:le.edgeIndex,segmentIndex:le.segmentIndex,from:le.from,to:le.to}],ae.segments=[...ae.segments.filter(me=>me.edgeIndex!==le.edgeIndex||me.segmentIndex!==le.segmentIndex),{edgeIndex:Z.edgeIndex,segmentIndex:Z.segmentIndex,from:Z.from,to:Z.to}],!0):!1},"trySwapSegmentsAcrossTracks"),Q=O(Z=>{const le=Z.tracks.length;return Z.tracks[le]={index:le,coord:Z.coord,segments:[]},le},"createNewTrack"),G=O((Z,le)=>{const be=Z.pipe.tracks[Z.trackIndex];be.segments=be.segments.filter(K=>K.edgeIndex!==Z.edgeIndex||K.segmentIndex!==Z.segmentIndex),Z.trackIndex=le,Z.pipe.tracks[le].segments.push({edgeIndex:Z.edgeIndex,segmentIndex:Z.segmentIndex,from:Z.from,to:Z.to})},"moveSegmentToTrack"),q=O((Z,le)=>{const be=m[Z.edgeIndex];for(const ae of be){const K=g[ae];K.pipe===Z.pipe&&G(K,le)}},"moveSegmentChainToTrack"),Y=O(Z=>{const le=m[Z.edgeIndex],be=le.indexOf(g.indexOf(Z)),ae=[];return be>0&&ae.push(g[le[be-1]]),be{if(Z.orientation===le.orientation)return!1;const be=Z.orientation==="horizontal"?Z:le,ae=Z.orientation==="horizontal"?le:Z;return ae.pipe.coord>be.from&&ae.pipe.coordae.from&&be.pipe.coord{for(const be of Z.tracks)if(!be.segments.some(K=>(K.edgeIndex!==le.edgeIndex||K.segmentIndex!==le.segmentIndex)&&z(K,le)))return be.index;return-1},"findAvailableTrack"),J=O((Z,le)=>{if(Z.trackIndex===le.trackIndex)return z(Z,le);const be=Y(Z),ae=Y(le);return be.some(K=>ae.some(se=>ne(K,se)))},"segmentsConflict"),ee=O((Z,le,be)=>{if(U(Z,le,Z.pipe.tracks[Z.trackIndex],le.pipe.tracks[le.trackIndex]))return;const ae=X(Z.pipe,le);be(le,ae!==-1?ae:Q(Z.pipe))},"resolveTrackConflict"),te=O(Z=>{let le=0;for(let be=0;be{if(pe.has(Z))return pe.get(Z);const le=m[Z];if(le.length===0){const oe={dest:0,deviation:0,base:0,delta:0};return pe.set(Z,oe),oe}const ae=g[le[0]].pipe.coord;let K=ae;for(let oe=1;oeMath.abs(De-ae)?ce:De;break}}const se=Math.abs(K-ae),me={dest:K,deviation:se,base:ae,delta:K-ae};return pe.set(Z,me),me},"getDestInfo"),Ce=O(()=>{let Z=0;const le=new Map;for(const[ae,K]of i.entries())m[ae].length!==0&&K.start&&(le.has(K.start)||le.set(K.start,[]),le.get(K.start).push(ae));const be=O(ae=>{const K=i[ae];if(!K.start||!K.end)return 0;const se=a.get(K.start),me=a.get(K.end);if(!se||!me)return 0;const oe=(me.x??0)-(se.x??0),ve=(me.y??0)-(se.y??0);return Math.abs(oe)+Math.abs(ve)},"getEdgeDistance");for(const ae of le.values()){ae.sort((se,me)=>{const oe=ie(se),ve=ie(me);if(Math.abs(oe.deviation-ve.deviation)>1)return oe.deviation-ve.deviation;if(Math.abs(oe.dest-ve.dest)>1)return oe.dest-ve.dest;const ce=be(se),De=be(me);if(Math.abs(ce-De)>1)return De-ce;const Le=m[se].length,We=m[me].length;if(Le!==We)return Le-We;if(Le===1){const Ne=m[se][0],je=m[me][0];if(g[Ne]&&g[je]){const $e=g[Ne],Ze=g[je],He=Math.abs($e.to-$e.from),et=Math.abs(Ze.to-Ze.from);if(Math.abs(He-et)>1)return He-et}}return 0});const K=ae.map(se=>g[m[se][0]]);Z+=te(K)}return Z},"fixSourceHandleCrossings"),ke=O(()=>{let Z=0;const le=new Map;for(const[be,ae]of i.entries())m[be].length!==0&&ae.end&&(le.has(ae.end)||le.set(ae.end,[]),le.get(ae.end).push(be));for(const be of le.values()){be.sort((K,se)=>{const me=O(ce=>{const De=m[ce];if(De.length<2)return 0;const Le=g[De[De.length-2]];return Math.abs(Le.to-Le.from)},"getDist"),oe=me(K),ve=me(se);return Math.abs(oe-ve)>.1?oe-ve:K-se});const ae=be.map(K=>g[m[K][m[K].length-1]]);Z+=te(ae)}return Z},"fixTargetHandleCrossings"),Ee=O(()=>{let Z=0;for(const le of s){const be=[];for(const ae of le.tracks)for(const K of ae.segments){const se=m[K.edgeIndex].find(me=>g[me].segmentIndex===K.segmentIndex);se!==void 0&&be.push(g[se])}be.sort((ae,K)=>ae.edgeIndex-K.edgeIndex||ae.segmentIndex-K.segmentIndex);for(let ae=0;ae{ae.segments.forEach(K=>{le.push({edgeIndex:K.edgeIndex,segmentIndex:K.segmentIndex,trackIndex:ae.index,from:K.from,to:K.to})})}),le.sort((ae,K)=>ae.from-K.from);const be=[];if(le.length>0){let ae=[le[0]],K=le[0].to;for(let se=1;seK.add(Ne.trackIndex));const se=new Map;ae.forEach(Ne=>{const je=ie(Ne.edgeIndex);se.set(Ne.trackIndex,(se.get(Ne.trackIndex)??0)+je.delta)});const me=[...K].filter(Ne=>(se.get(Ne)??0)<-1),oe=[...K].filter(Ne=>(se.get(Ne)??0)>1),ve=[...K].filter(Ne=>Math.abs(se.get(Ne)??0)<=1);me.sort((Ne,je)=>(se.get(je)??0)-(se.get(Ne)??0)),oe.sort((Ne,je)=>(se.get(Ne)??0)-(se.get(je)??0));const ce=O((Ne,je)=>{ae.filter($e=>$e.trackIndex===Ne).forEach($e=>{const Ze=v.has($e.edgeIndex)?Z.coord:je;xe.set(`${$e.edgeIndex}-${$e.segmentIndex}`,Ze)})},"assignCoord");let De=0;for(const Ne of me)De++,ce(Ne,Z.coord-De*AOe);if(ve.length===0&&K.size>0){const Ne=[...K].sort((Ze,He)=>Math.abs(se.get(Ze)??0)-Math.abs(se.get(He)??0))[0],je=me.indexOf(Ne);je!==-1&&me.splice(je,1);const $e=oe.indexOf(Ne);$e!==-1&&oe.splice($e,1),ve.push(Ne)}let Le=0;for(const Ne of ve){if(Le===0)ce(Ne,Z.coord);else{const je=Le%2===1?1:-1,$e=Math.ceil(Le/2);ce(Ne,Z.coord+je*$e*AOe*.5)}Le++}let We=0;for(const Ne of oe)We++,ce(Ne,Z.coord+We*AOe)}}for(const[Z,le]of i.entries()){const be=m[Z]??[];if(be.length===0)continue;const ae=[],K=a.get(le.start),se=a.get(le.end),{pSrcPort:me,pDstPort:oe}=V(Z,K,se),ve=be.map(Le=>{const We=g[Le],Ne=xe.get(`${We.edgeIndex}-${We.segmentIndex}`)??We.pipe.coord;return{orient:We.orientation,coord:Ne,from:We.from,to:We.to}});ae.push(me);for(let Le=0;Leri&&ae.push(VC(We,je)),He&&Ze.orient===We.orient)if(Math.abs(We.coord-Ze.coord)>ri){const et=We.orient==="vertical"?(je+Ze.from)/2:TOe(We,Ze);ae.push(VC(We,et),VC(Ze,et))}else(Le===0||Le===ve.length-2)&&ae.push(VC(We,TOe(We,Ze)));else if(He)ae.push(VC(We,Ze.coord));else{const et=Math.abs(We.from-je)ri||Math.abs(ce.y-oe.y)>ri)&&ae.push(oe);const De=[];ae.length>0&&De.push(ae[0]);for(let Le=1;Leri||Math.abs(We.y-Ne.y)>ri)&&De.push(We)}le.points=De}for(const Z of i){const le=Z.__originalEdge;le&&Z.points&&(le.points=Z.points)}t.edges=(t.edges??[]).filter(Z=>!Z.isLayoutOnly);const ge=O((Z,le)=>{const be=le.x??0,ae=le.y??0,K=le.width??0,se=le.height??0;if(K<=0||se<=0)return Z;const me=be-K/2,oe=be+K/2,ve=ae-se/2,ce=ae+se/2;if(Z.xoe||Z.yce)return Z;const De=Z.x-me,Le=oe-Z.x,We=Z.y-ve,Ne=ce-Z.y,je=Math.min(De,Le,We,Ne);return je===De?{x:me,y:Z.y}:je===Le?{x:oe,y:Z.y}:je===We?{x:Z.x,y:ve}:{x:Z.x,y:ce}},"nodeBoundaryClamp");for(const Z of t.edges){const le=Z.points;if(!le||le.length<2)continue;const be=Z.start,ae=Z.end,K=be?a.get(be):void 0,se=ae?a.get(ae):void 0;K&&(le[0]=ge(le[0],K)),se&&(le[le.length-1]=ge(le[le.length-1],se))}return t}O(ZBt,"routeEdgesOrthogonal");function JBt(t){return t.direction??"TB"}O(JBt,"getSwimlaneDirection");function e7t(t){var h,d,f,p,g;const e=L8t(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,o=((g=t.config.swimlane)==null?void 0:g.automaticLaneOrdering)??!1,s=JBt(t),{ordered:l,coordinates:u}=KBt(e,{nodeGap:r,layerGap:n,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:o,direction:s});M8t(e,l,u,{nodeGap:r,layerGap:n});for(const m of t.edges??[])delete m.points;ZBt(t,s);for(const m of t.edges??[])(!m.curve||m.curve==="basis")&&(m.curve="rounded");return pBt(t,s),fBt(t),s}O(e7t,"runSwimlaneLayoutCore");async function t7t(t,e){const r=e.select("g");n2e(r,t.markers,t.type,t.diagramId),Qkt(),Ykt(),hOt(),INt(),D8t(t);const n=I8t(t);t.nodes=n.nodes,t.edges=n.edges;const{groups:i}=await g8t(r,t);e7t(t),await k8t(t,i)}O(t7t,"render");const mPn=Object.freeze(Object.defineProperty({__proto__:null,render:t7t},Symbol.toStringTag,{value:"Module"}));function COe(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,o=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{o||r.return==null||r.return()}finally{if(s)throw a}}}}function r7t(t,e,r){return(e=n7t(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xPn(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function wPn(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,s=[],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)&&(s.push(n.value),s.length!==e);l=!0);}catch(h){u=!0,i=h}finally{try{if(!l&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}function APn(){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 SPn(){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 qs(t,e){return vPn(t)||wPn(t,e)||OOe(t,e)||APn()}function vee(t){return yPn(t)||xPn(t)||OOe(t)||SPn()}function TPn(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 n7t(t){var e=TPn(t,"string");return typeof e=="symbol"?e:e+""}function dl(t){"@babel/helpers - typeof";return dl=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},dl(t)}function OOe(t,e){if(t){if(typeof t=="string")return COe(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)?COe(t,e):void 0}}var fl=typeof window>"u"?null:window,i7t=fl?fl.navigator:null;fl&&fl.document;var CPn=dl(""),a7t=dl({}),OPn=dl(function(){}),kPn=typeof HTMLElement>"u"?"undefined":dl(HTMLElement),UF=function(e){return e&&e.instanceString&&Io(e.instanceString)?e.instanceString():null},Yr=function(e){return e!=null&&dl(e)==CPn},Io=function(e){return e!=null&&dl(e)===OPn},Ma=function(e){return!pf(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Bi=function(e){return e!=null&&dl(e)===a7t&&!Ma(e)&&e.constructor===Object},EPn=function(e){return e!=null&&dl(e)===a7t},sr=function(e){return e!=null&&dl(e)===dl(1)&&!isNaN(e)},o7t=function(e){return sr(e)&&Math.floor(e)===e},yee=function(e){if(kPn!=="undefined")return e!=null&&e instanceof HTMLElement},pf=function(e){return VF(e)||s7t(e)},VF=function(e){return UF(e)==="collection"&&e._private.single},s7t=function(e){return UF(e)==="collection"&&!e._private.single},kOe=function(e){return UF(e)==="core"},l7t=function(e){return UF(e)==="stylesheet"},_Pn=function(e){return UF(e)==="event"},tw=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},RPn=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},DPn=function(e){return Bi(e)&&sr(e.x1)&&sr(e.x2)&&sr(e.y1)&&sr(e.y2)},LPn=function(e){return EPn(e)&&Io(e.then)},MPn=function(){return i7t&&i7t.userAgent.match(/msie|trident|edge/i)},Q4=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var a=[],o=0;or?1:0},zPn=function(e,r){return-1*h7t(e,r)},ln=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("^"+NPn+"$").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,o=d[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(i===0)s=l=u=Math.round(a*255);else{var f=a<.5?a*(1+i):a+i-a*i,p=2*a-f;s=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=[s,l,u,o]}return r},QPn=function(e){var r,n=new RegExp("^"+IPn+"$").exec(e);if(n){r=[];for(var i=[],a=1;a<=3;a++){var o=n[a];if(o[o.length-1]==="%"&&(i[a]=!0),o=parseFloat(o),i[a]&&(o=o/100*255),o<0||o>255)return;r.push(Math.floor(o))}var s=i[1]||i[2]||i[3],l=i[1]&&i[2]&&i[3];if(s&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},GPn=function(e){return HPn[e.toLowerCase()]},d7t=function(e){return(Ma(e)?e:null)||GPn(e)||UPn(e)||QPn(e)||VPn(e)},HPn={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]},f7t=function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a=l||R<0||b&&D>=f}function C(){var L=e();if(T(L))return k(L);g=setTimeout(C,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 P(){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(C,l),w(m)}return g===void 0&&(g=setTimeout(C,l)),p}return P.cancel=E,P.flush=_,P}return QOe=o,QOe}var t6n=e6n(),WF=QF(t6n),GOe=fl?fl.performance:null,R7t=GOe&&GOe.now?function(){return GOe.now()}:function(){return Date.now()},r6n=function(){if(fl){if(fl.requestAnimationFrame)return function(t){fl.requestAnimationFrame(t)};if(fl.mozRequestAnimationFrame)return function(t){fl.mozRequestAnimationFrame(t)};if(fl.webkitRequestAnimationFrame)return function(t){fl.webkitRequestAnimationFrame(t)};if(fl.msRequestAnimationFrame)return function(t){fl.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(R7t())},1e3/60)}}(),Aee=function(e){return r6n(e)},G1=R7t,QC=9261,D7t=65599,G4=5381,L7t=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:QC,n=r,i;i=e.next(),!i.done;)n=n*D7t+i.value|0;return n},YF=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:QC;return r*D7t+e|0},qF=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:G4;return(r<<5)+r+e|0},n6n=function(e,r){return e*2097152+r},nw=function(e){return e[0]*2097152+e[1]},See=function(e,r){return[YF(e[0],r[0]),qF(e[1],r[1])]},M7t=function(e,r){var n={value:0,done:!1},i=0,a=e.length,o={next:function(){return i=0;i--)e[i]===r&&e.splice(i,1)},YOe=function(e){e.splice(0,e.length)},f6n=function(e,r){for(var n=0;n"u"?"undefined":dl(Set))!==g6n?Set:m6n,Cee=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!kOe(e)){Co("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"){Co("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 H4,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 o=r.renderedPosition,s=e.pan(),l=e.zoom();a.position={x:(o.x-s.x)/l,y:(o.y-s.y)/l}}var u=[];Ma(r.classes)?u=r.classes:Yr(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--)C.push(k);return C}).apply(this).reverse(),T=[],w=0,A=S.length;w_;0<=_?++C:--C)P.push(o(y,x));return P},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,C;for(x==null&&(x=n),A=y.length,C=b,S=y[b],w=2*b+1;w0;){var S=b.pop(),T=v(S),C=S.id();if(f[C]=T,T!==1/0)for(var k=S.neighborhood().intersect(g),E=0;E0)for(N.unshift(I);d[B];){var V=d[B];N.unshift(V.edge),N.unshift(V.node),F=V.node,B=F.id()}return s.spawn(N)}}}},S6n={kruskal:function(e){e=e||function(x){return 1};for(var r=this.byGroup(),n=r.nodes,i=r.edges,a=n.length,o=new Array(a),s=n,l=function(w){for(var A=0;A0;){if(A(),T++,w===h){for(var C=[],k=a,E=h,_=y[E];C.unshift(k),_!=null&&C.unshift(_),k=v[E],k!=null;)E=k.id(),_=y[E];return{found:!0,distance:d[w],path:this.spawn(C),steps:T}}p[w]=!0;for(var P=x._private.edges,L=0;L_&&(g[E]=_,b[E]=k,x[E]=A),!a){var P=k*h+C;!a&&g[P]>_&&(g[P]=_,b[P]=C,x[P]=A)}}}for(var L=0;L1&&arguments[1]!==void 0?arguments[1]:o,xe=x(ue),ge=[],ze=xe;;){if(ze==null)return r.spawn();var we=b(ze),Oe=we.edge,Be=we.pred;if(ge.unshift(ze[0]),ze.same(de)&&ge.length>0)break;Oe!=null&&ge.unshift(Oe),ze=Be}return l.spawn(ge)},S=0;S=0;h--){var d=u[h],f=d[1],p=d[2];(r[f]===s&&r[p]===l||r[f]===l&&r[p]===s)&&u.splice(h,1)}for(var g=0;gi;){var a=Math.floor(Math.random()*r.length);r=D6n(a,e,r),n--}return r},L6n={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,o=i.length,s=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),l=Math.floor(a/R6n);if(a<2){Co("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,o=r;o1&&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,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;i?e=e.slice(r,n):(n0&&e.splice(0,r));for(var s=0,l=e.length-1;l>=0;l--){var u=e[l];o?isFinite(u)||(e[l]=-1/0,s++):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+s]:(e[d-1+s]+e[d+s])/2},H7t=function(e,r){return r===0?e:H7t(r,e%r)},$6n=function(e){for(var r=e[0],n=0;n0&&(r=H7t(r,e[n]));else return 0;return r},F6n=function(e){return Math.PI*e/180},Eee=function(e,r){return Math.atan2(r,e)-Math.PI/2},KOe=Math.log2||function(t){return Math.log(t)/Math.log(2)},ZOe=function(e){return e>0?1:e<0?-1:0},HC=function(e,r){return Math.sqrt(WC(e,r))},WC=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},z6n=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}}},V6n=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},Q6n=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},G6n=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},W7t=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},_ee=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},Ree=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,i,a,o;if(r.length===1)n=i=a=o=r[0];else if(r.length===2)n=a=r[0],o=i=r[1];else if(r.length===4){var s=qs(r,4);n=s[0],i=s[1],a=s[2],o=s[3]}return e.x1-=o,e.x2+=i,e.y1-=n,e.y2+=a,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Y7t=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},JOe=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},aw=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},q7t=function(e,r){return aw(e,r.x,r.y)},j7t=function(e,r){return aw(e,r.x1,r.y1)&&aw(e,r.x2,r.y2)},H6n=(XOe=Math.hypot)!==null&&XOe!==void 0?XOe:function(t,e){return Math.sqrt(t*t+e*e)};function W6n(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(C,k){return{x:C.x+k.x,y:C.y+k.y}},n=function(C,k){return{x:C.x-k.x,y:C.y-k.y}},i=function(C,k){return{x:C.x*k,y:C.y*k}},a=function(C,k){return C.x*k.y-C.y*k.x},o=function(C){var k=H6n(C.x,C.y);return k===0?{x:0,y:0}:{x:C.x/k,y:C.y/k}},s=function(C){for(var k=0,E=0;E7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?sw(a,o):l,h=a/2,d=o/2;u=Math.min(u,h,d);var f=u!==h,p=u!==d,g;if(f){var m=n-h+u-s,v=i-d-s,y=n+h-u+s,b=v;if(g=ow(e,r,n,i,m,v,y,b,!1),g.length>0)return g}if(p){var x=n+h+s,w=i-d+u-s,A=x,S=i+d-u+s;if(g=ow(e,r,n,i,x,w,A,S,!1),g.length>0)return g}if(f){var T=n-h+u-s,C=i+d+s,k=n+h-u+s,E=C;if(g=ow(e,r,n,i,T,C,k,E,!1),g.length>0)return g}if(p){var _=n-h-s,P=i-d+u-s,L=_,R=i+d-u+s;if(g=ow(e,r,n,i,_,P,L,R,!1),g.length>0)return g}var D;{var M=n-h+u,I=i-d+u;if(D=ZF(e,r,n,i,M,I,u+s),D.length>0&&D[0]<=M&&D[1]<=I)return[D[0],D[1]]}{var N=n+h-u,F=i-d+u;if(D=ZF(e,r,n,i,N,F,u+s),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=ZF(e,r,n,i,B,V,u+s),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=ZF(e,r,n,i,z,U,u+s),D.length>0&&D[0]<=z&&D[1]>=U)return[D[0],D[1]]}return[]},q6n=function(e,r,n,i,a,o,s){var l=s,u=Math.min(n,a),h=Math.max(n,a),d=Math.min(i,o),f=Math.max(i,o);return u-l<=e&&e<=h+l&&d-l<=r&&r<=f+l},j6n=function(e,r,n,i,a,o,s,l,u){var h={x1:Math.min(n,s,a)-u,x2:Math.max(n,s,a)+u,y1:Math.min(i,l,o)-u,y2:Math.max(i,l,o)+u};return!(eh.x2||rh.y2)},X6n=function(e,r,n,i){n-=i;var a=r*r-4*e*n;if(a<0)return[];var o=Math.sqrt(a),s=2*e,l=(-r+o)/s,u=(-r-o)/s;return[l,u]},K6n=function(e,r,n,i,a){var o=1e-5;e===0&&(e=o),r/=e,n/=e,i/=e;var s,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,s=l*l*l+u*u,a[1]=0,p=r/3,s>0){d=u+Math.sqrt(s),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),f=u-Math.sqrt(s),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,s===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)},Z6n=function(e,r,n,i,a,o,s,l){var u=1*n*n-4*n*a+2*n*s+4*a*a-4*a*s+s*s+i*i-4*i*o+2*i*l+4*o*o-4*o*l+l*l,h=1*9*n*a-3*n*n-3*n*s-6*a*a+3*a*s+9*i*o-3*i*i-3*i*l-6*o*o+3*o*l,d=1*3*n*n-6*n*a+n*s-n*e+2*a*a+2*a*e-s*e+3*i*i-6*i*o+i*l-i*r+2*o*o+2*o*r-l*r,f=1*n*a-n*n+n*e-a*e+i*o-i*i+i*r-o*r,p=[];K6n(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-o)*(r-o):h-f},nd=function(e,r,n){for(var i,a,o,s,l,u=0,h=0;h=e&&e>=o||i<=e&&e<=o)l=(e-i)/(o-i)*(s-a)+a,l>r&&u++;else continue;return u%2!==0},W1=function(e,r,n,i,a,o,s,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=Lee(h,-u);m=Dee(v)}else m=h;return nd(e,r,m)},eNn=function(e,r,n,i,a,o,s,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]},eke=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},ow=function(e,r,n,i,a,o,s,l,u){var h=e-a,d=n-e,f=s-a,p=r-o,g=i-r,m=l-o,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?eke(e,n,s)===s?[s,l]:eke(e,n,a)===a?[a,o]:eke(a,s,n)===n?[n,i]:[]:[]},rNn=function(e,r,n,i,a){var o=[],s=i/2,l=a/2,u=r,h=n;o.push({x:u+s*e[0],y:h+l*e[1]});for(var d=1;d0){var m=Lee(d,-l);p=Dee(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,C.nodes.indexOf(L)<0?C.push(L):C.updateItem(L),S[L]=0,A[L]=[]),T[L]==T[_]+M&&(S[L]=S[L]+S[_],A[L].push(_))}else for(var I=0;I0;){for(var V=w.pop(),z=0;z0&&s.push(n[l]);s.length!==0&&a.push(i.collection(s))}return a},vNn=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:xNn,s=i,l,u,h=0;h=2?e9(e,r,n,0,a$t,wNn):e9(e,r,n,0,i$t)},squaredEuclidean:function(e,r,n){return e9(e,r,n,0,a$t)},manhattan:function(e,r,n){return e9(e,r,n,0,i$t)},max:function(e,r,n){return e9(e,r,n,-1/0,ANn)}};X4["squared-euclidean"]=X4.squaredEuclidean,X4.squaredeuclidean=X4.squaredEuclidean;function Iee(t,e,r,n,i,a){var o;return Io(t)?o=t:o=X4[t]||X4.euclidean,e===0&&Io(t)?o(i,a):o(e,r,n,i,a)}var SNn=Tc({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),oke=function(e){return SNn(e)},Pee=function(e,r,n,i,a){var o=a!=="kMedoids",s=o?function(d){return n[d]}:function(d){return i[d](n)},l=function(f){return i[f](r)},u=n,h=r;return Iee(e,i.length,s,l,u,h)},ske=function(e,r,n){for(var i=n.length,a=new Array(i),o=new Array(i),s=new Array(r),l=null,u=0;un)return!1}return!0},ONn=function(e,r,n){for(var i=0;is&&(s=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[o],m=r[i[o]],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},f$t=function(e,r,n){for(var i=[],a=0;as&&(o=u,s=r[a*e+u])}o>0&&i.push(o)}for(var h=0;hu&&(l=h,u=d)}n[a]=o[l]}return i=f$t(e,r,n),i},p$t=function(e){for(var r=this.cy(),n=this.nodes(),i=$Nn(e),a={},o=0;o=_?(P=_,_=R,L=D):R>P&&(P=R);for(var M=0;M0?1:0;T[k%i.minIterations*s+z]=U,V+=U}if(V>0&&(k>=i.minIterations-1||k==i.maxIterations-1)){for(var Q=0,G=0;G1||S>1)&&(s=!0),d[x]=[],b.outgoers().forEach(function(C){C.isEdge()&&d[x].push(C.id())})}else f[x]=[void 0,b.target().id()]}):o.forEach(function(b){var x=b.id();if(b.isNode()){var w=b.degree(!0);w%2&&(l?u?s=!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(s)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=o[0].id());var g=function(x){for(var w=x,A=[x],S,T,C;d[w].length;)S=d[w].shift(),T=f[S][0],C=f[S][1],w!=C?(d[C]=d[C].filter(function(k){return k!=S}),w=C):!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(o.getElementById(v.shift())),m.unshift(o.getElementById(v.shift()))):v=g(v.shift()).concat(v);m.unshift(o.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}},Nee=function(){var e=this,r={},n=0,i=0,a=[],o=[],s={},l=function(f,p){for(var g=o.length-1,m=[],v=e.spawn();o[g].x!=f||o[g].y!=p;)m.push(o.pop().edge),g--;m.push(o.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(),s[x]||(s[x]=!0,o.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}},WNn={hopcroftTarjanBiconnected:Nee,htbc:Nee,htb:Nee,hopcroftTarjanBiconnectedComponents:Nee},Bee=function(){var e=this,r={},n=0,i=[],a=[],o=e.spawn(e),s=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||s(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),o=o.difference(g)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||s(u)}}),{cut:o,components:i}},YNn={tarjanStronglyConnected:Bee,tsc:Bee,tscc:Bee,tarjanStronglyConnectedComponents:Bee},g$t={};[jF,A6n,S6n,C6n,k6n,_6n,L6n,oNn,q4,j4,ake,bNn,LNn,NNn,QNn,HNn,WNn,YNn].forEach(function(t){ln(g$t,t)});/*! +Parent cluster`,i.height),e.setNode(i.id,w),e.parent(b)||(ye.trace("Setting parent",b,i.id),e.setParent(b,i.id,w))}if(ye.info("(Insert) Node XXX"+b+": "+JSON.stringify(e.node(b))),x!=null&&x.clusterNode){ye.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 m8t(d,x.graph,r,n,e.node(b),a),T=S.elem;Br(x,T),x.diff=S.diff||0,ye.info("New compound node after recursive render XAX",b,"width",x.width,"height",x.height),Mfn(T,x)}else e.children(b).length>0?(ye.trace("Cluster - the non recursive path XBX",b,x.id,x,x.width,"Graph:",e),ye.trace(N4(x.id,e)),Ln.set(x.id,{id:N4(x.id,e),node:x})):(ye.trace("Node - the non recursive path XAX",b,d,e.node(b),o),await i$(d,e.node(b),{config:a,dir:o}))})),await O(async()=>{const b=e.edges().map(async function(x){const w=e.edge(x.v,x.w,x.name);if(ye.info("Edge "+x.v+" -> "+x.w+": "+JSON.stringify(x)),ye.info("Edge "+x.v+" -> "+x.w+": ",x," ",JSON.stringify(e.edge(x))),ye.info("Fix",Ln,"ids:",x.v,x.w,"Translating: ",Ln.get(x.v),Ln.get(x.w)),f&&w.selfLoop){if(w.selfLoop.order!==1)return;const A=w.id;w.id=w.selfLoop.id,await rK(h,w),w.id=A;return}await rK(h,w)});await Promise.all(b)},"processEdges")(),ye.info("Graph before layout:",JSON.stringify(U1(e))),ye.info("############################################# XXX"),ye.info("### Layout ### XXX"),ye.info("############################################# XXX"),d8t(e),ye.info("Graph after layout:",JSON.stringify(U1(e)));let g=0,{subGraphTitleTotalMargin:m}=TR(a);await Promise.all(dMn(e).map(async function(b){var w;const x=e.node(b);if(ye.info("Position XBX => "+b+": ("+x.x,","+x.y,") width: ",x.width," height: ",x.height),x!=null&&x.clusterNode)x.y+=m,ye.info("A tainted cluster node XBX1",b,x.id,x.width,x.height,x.x,x.y,e.parent(b)),Ln.get(x.id).node=x,tK(x);else if(e.children(b).length>0){ye.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;ye.debug("OffsetY",T,"labelHeight",S,"halfPadding",A),await ZX(l,x),Ln.get(x.id).node=x}else{const A=e.node(x.parentId);x.y+=m/2,ye.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),tK(x)}}));const v=m/2;return g8t(e,v,{mergeSelfLoops:f}).forEach(function({edge:b,start:x,end:w}){ye.info("Edge "+x+" -> "+w+": "+JSON.stringify(b),b),b.points.forEach(C=>C.y+=v);const A=e.node(x),S=e.node(w),T=t2e(u,b,Ln,r,A,S,n);Xkt(b,T)}),e.nodes().forEach(function(b){const x=e.node(b);ye.info(b,x.type,x.diff),x.isGroup&&(g=x.diff)}),ye.warn("Returning from recursive render XAX",s,g),{elem:s,diff:g}},"recursiveRender"),aPn=O(async(t,e)=>{var a,o,s,l,u,h;const r=new hu({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:((a=t.config)==null?void 0:a.nodeSpacing)||((s=(o=t.config)==null?void 0:o.flowchart)==null?void 0:s.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");n2e(n,t.markers,t.type,t.diagramId),Hkt(),jkt(),fOt(),NNt(),t.nodes.forEach(d=>{r.setNode(d.id,{...d}),d.parentId&&r.setParent(d.id,d.parentId)}),ye.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)}),ye.warn("Graph at first:",JSON.stringify(U1(r))),hMn(r),ye.warn("Graph after XAX:",JSON.stringify(U1(r)));const i=Ye();await m8t(n,r,t.type,t.diagramId,void 0,i)},"render");const oPn=Object.freeze(Object.defineProperty({__proto__:null,getEdgesToRender:g8t,render:aPn},Symbol.toStringTag,{value:"Module"}));async function v8t(t,e){const r=new hu({multigraph:!0,compound:!0}),n=[...e.edges],i=Ye(),a=t.insert("g").attr("class","root"),o=a.insert("g").attr("class","clusters"),s=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 i$(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(()=>Gdi);f(t,e)}return{graph:r,groups:{clusters:o,edgePaths:s,edgeLabels:l,nodes:u,rootGroups:a},nodeElements:h}}O(v8t,"createGraphWithElements");var y8t=5,XJ=1e-5,KJ=1e-6;function ZJ(t){const e=[];for(let r=0;r=1-KJ||f<=KJ||f>=1-KJ?null:{point:{x:t.x+d*i,y:t.y+d*a},tA:d,tB:f}}O(b8t,"segmentIntersection");function ACe(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}O(ACe,"isHorizontalSeg");function x8t(t){const e=[];for(let r=0;r=Math.abs(r)?e>=0?1:0:r>=0?1:0}O(w8t,"getArcSweepFlag");var sPn=.001;function A8t(t,e){if(t.length<2)return t.map(a=>({...a}));const r=t.map(a=>({...a})),n=e.arrowTypeStart&&zl[e.arrowTypeStart];if(n){const a=t[0],o=t[1],s=Math.atan2(o.y-a.y,o.x-a.x);r[0].x=a.x+n*Math.cos(s),r[0].y=a.y+n*Math.sin(s)}const i=e.arrowTypeEnd&&zl[e.arrowTypeEnd];if(i){const a=t.length,o=t[a-2],s=t[a-1],l=Math.atan2(s.y-o.y,s.x-o.x);r[a-1].x=s.x-i*Math.cos(l),r[a-1].y=s.y-i*Math.sin(l)}return r}O(A8t,"applyMarkerOffsets");function S8t(t,e,r,n,i){const a=t.point.x,o=t.point.y,s={x:a-e*t.r,y:o-r*t.r},l={x:a+e*t.r,y:o+r*t.r},u=[`L${$4(s)}`];return i==="arc"?u.push(`A${Fg(t.r)},${Fg(t.r)} 0 0 ${n} ${$4(l)}`):u.push(`M${$4(l)}`),u}O(S8t,"emitJump");function SCe(t,e,r,n){const i=e.x-t.x,a=e.y-t.y,o=r.x-e.x,s=r.y-e.y,l=Math.hypot(i,a),u=Math.hypot(o,s);if(l0){const x=SCe(i[u-1],i[u],i[u+1]??i[u],y8t);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}}O(k8t,"decodeDataPoints");function E8t(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=[],o=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;o.set(u.id,d);const p=k8t(d.getAttribute("data-points"))??u.points;a.push({...u,points:p})}const s=x8t(a);if(s.length===0)return;const l=new Map;for(const u of s){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&&!O8t(f))continue;const p=o.get(u.id);if(!p)continue;if(f===void 0){const x=p.getAttribute("d")??"";if(!C8t(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=T8t(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)}}}O(E8t,"applyLineJumpsToSvg");async function _8t(t,e){var i,a;for(const o of t.nodes)o.isGroup?await ZX(e.clusters,o):tK(o);const r=new Map;for(const o of t.nodes)o!=null&&o.id&&r.set(o.id,o);for(const o of t.edges){const s=o.start?r.get(o.start)??{}:{},l=o.end?r.get(o.end)??{}:{},u=t2e(e.edgePaths,{...o},{},t.type,s,l,t.diagramId);o.label&&await rK(e.rootGroups,o),o.label&&R8t(o,u)}const n=(a=(i=t.config)==null?void 0:i.swimlane)==null?void 0:a.lineHops;if(n!==!1){const o=n==="gap"?"gap":"arc",s=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}));E8t(e.edgePaths,s,{enabled:!0,jumpRadius:6,jumpStyle:o})}}O(_8t,"adjustLayout");function R8t(t,e){const r=(e==null?void 0:e.updatedPath)??(e==null?void 0:e.originalPath),n=Dr(),{subGraphTitleTotalMargin:i}=TR({flowchart:n.flowchart??{}});if(t.label){const a=o$.get(t.id);let o=t.x,s=t.y;if(r){const l=un.calcLabelPosition(r);ye.debug("Moving label "+t.label+" from (",o,",",s,") to (",l.x,",",l.y,") abc88"),e&&(o=l.x,s=l.y)}a.attr("transform",`translate(${o}, ${s+i/2})`)}if(t!=null&&t.startLabelLeft){const a=vs.get(t.id).startLeft;let o=t==null?void 0:t.x,s=t==null?void 0:t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(t.startLabelRight){const a=vs.get(t.id).startRight;let o=t.x,s=t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(t.endLabelLeft){const a=vs.get(t.id).endLeft;let o=t.x,s=t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(t.endLabelRight){const a=vs.get(t.id).endRight;let o=t.x,s=t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}}O(R8t,"positionEdgeLabel");var TCe="__swimlane_default__",lPn=21,D8t=20;function CCe(t){return Math.max(t.padding??D8t,D8t)}O(CCe,"topLaneHorizontalPadding");function L8t(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 o=r-i/2,s=Math.min(a,r+i/2),l=Math.min(lPn,Math.max(0,s-o)),u=o+l;if(u<=o){delete t.groupTitleRect;return}t.groupTitleRect={left:e-n/2,right:e+n/2,top:o,bottom:u}}O(L8t,"assignTopLaneTitleRect");function M8t(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===TCe);i?i.isGroup&&(i.shape="swimlane",e&&(i.direction=e)):(i={id:TCe,label:"",isGroup:!0,shape:"swimlane",padding:20,...e?{direction:e}:{}},r.push(i));for(const a of n)a.parentId=TCe}O(M8t,"prepareLayoutForSwimlanes");function I8t(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}}O(I8t,"toGraphView");function P8t(t,e,r,n){const{layout:i}=t,a=t.nodeById,o=(n==null?void 0:n.layerGap)??100,s=(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*s,y=r.y[g]??l*o;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*CCe(f),w=b,A=Math.max(0,m-g)+x,S=Math.max(0,y-v)+w,T=(g+m)/2,C=(v+y)/2;f.x=T,f.y=C,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,P=E.x??0;return _-P}),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*CCe(k),P=(E.minX+E.maxX)/2;A.push(k.id),S.push(P),T.push(_)}const C=A.length;if(C>0){const k=new Map;if(C===1)k.set(A[0],T[0]);else{const E=[];for(let D=0;D0&&i>0?{cx:e,cy:r,rect:z4(e,r,n,i)}:void 0}O(OCe,"measuredNodeRect");function kCe(t){if(t.isGroup)return;const e=OCe(t);return e?{id:String(t.id??""),cx:e.cx,cy:e.cy,rect:e.rect}:void 0}O(kCe,"nodeBoundsInfoFor");function Rp(t,e,r=Ql){return Math.abs(t.x-e.x)r}O(es,"isHorizontalSegment");function ts(t,e,r=Ql){return Ai(t,e,r)&&Math.abs(t.y-e.y)>r}O(ts,"isVerticalSegment");function Ju(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)))}O(Ju,"overlapLength");function W0(t,e,r=Ql){return t.horizontal&&e.horizontal&&_i(t.a,e.a,r)?Ju(t.a.x,t.b.x,e.a.x,e.b.x):t.vertical&&e.vertical&&Ai(t.a,e.a,r)?Ju(t.a.y,t.b.y,e.a.y,e.b.y):0}O(W0,"sameAxisSegmentOverlapLength");function F4(t,e=Ql){const r=[];for(let n=0;n0?r[r.length-1]:void 0;(!i||!Rp(i,n,e))&&r.push({x:n.x,y:n.y})}return r}O(Ni,"dedupeConsecutivePoints");function ECe(t,e=Ql){if(!t||t.length!==4)return;const[r,n,i,a]=t;return es(r,n,e)&&ts(n,i,e)&&es(i,a,e)?{kind:"HVH",p0:r,p1:n,p2:i,p3:a}:ts(r,n,e)&&es(n,i,e)&&ts(i,a,e)?{kind:"VHV",p0:r,p1:n,p2:i,p3:a}:void 0}O(ECe,"classifyThreeSegmentRoute");function JJ(t,e,r,n=0){const i=Math.min(t.x,e.x),a=Math.max(t.x,e.x),o=Math.min(t.y,e.y),s=Math.max(t.y,e.y);return a>r.left-n&&ir.top-n&&oe.left+r&&t.xe.top+r&&t.y=e.right&&t.top<=e.top&&t.bottom>=e.bottom}O(B8t,"rectContainsRect");function eee(t,e){return t.lefte.left&&t.tope.top}O(eee,"rectsOverlap");function RCe(t,e){return{left:t.left-e,right:t.right+e,top:t.top-e,bottom:t.bottom+e}}O(RCe,"inflateRect");function z4(t,e,r,n){return{left:t-r/2,right:t+r/2,top:e-n/2,bottom:e+n/2}}O(z4,"rectFromCenterSize");function ed(t){var e;return(e=OCe(t))==null?void 0:e.rect}O(ed,"rectOfNodeBounds");function zC(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}}}O(zC,"portForRectSide");function DCe(t,e,r,n,i,a=Ql){const o=e==="left"||e==="right",s=n==="left"||n==="right";if(o&&s){if(e==="right"&&n==="left"&&t.xr.x){if(_i(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(_i(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(!o&&!s){if(e===n){if(Ai(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(Ai(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(o&&!s){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}O(DCe,"buildOrthogonalPortPath");function LCe(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]}O(LCe,"buildSameSideTrackPath");function tee(t){const e=new Map,r=[];for(const n of t){if(n.isEdgeLabel)continue;const i=kCe(n);i&&(e.set(i.id,i),r.push({id:i.id,rect:i.rect}))}return{nodeInfoById:e,realNodeRects:r}}O(tee,"collectRealNodeBounds");function X2(t){const e=[],r=[];for(const n of t){const i=kCe(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}}O(X2,"collectNodeRectEntries");function $8t(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,o=n.width??0,s=n.height??0;r.push({nodeId:n.id,...z4(i,a,o,s)})}return r}O($8t,"collectLayoutNodeRects");function MCe(t,e,r=Ql){const n=t.start,i=t.end;if(!n||!i)return;const a=e.get(n),o=e.get(i);if(!(!a||!o))return{srcId:n,dstId:i,srcInfo:a,dstInfo:o,collinearX:Math.abs(a.cx-o.cx)g||fy)return!1;const b=Math.abs(m-h.a.x)i:a&&s&&_i(t,r,i)?Ju(t.x,e.x,r.x,n.x)>i:!1}O(F8t,"sameAxisSegmentsOverlap");function ree(t,e,r,n,{epsilon:i=Ql,skipDegenerateOther:a=!1}={}){for(const o of r){if(o===n||o.isLayoutOnly)continue;const s=o.points;if(!(!s||s.length<2))for(let l=0;lf+i&&gm+i&&dn+Ql&&t=2?e[e.length-2]:void 0,l=(o?Ai(o,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||!Rp(i,n))&&r.push(n)}return r}O(nee,"orthogonalizePolyline");function Y0(t){if(t.length<3)return t;let e=[...t];for(let r=0;r<32;r++){const n=U8t(e);if(e=n.points,!n.changed)break}return e}O(Y0,"simplifyPolyline");var mn=.001,uPn=.5,V8t=4;function NCe(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 o=Q8t(t[i],t[a],e);return r?[o,...t.slice(i)]:[...t.slice(0,i+1),o]}O(BCe,"clipEndpoint");function G8t(t,e){for(const r of t){const n=NCe(r,e,2);if(!n)continue;let i=[...n.points];n.srcRect&&(i=BCe(i,n.srcRect,!0)),n.dstRect&&(i=BCe(i,n.dstRect,!1)),i=Y0(nee(i)),i=VCe(i,n.srcRect,n.dstRect),n.edge.points=Y0(nee(i))}}O(G8t,"clipEdgeEndpointsToNodeBoundaries");function $Ce(t,e,r,n=!1){if(_i(t,e,mn)){if(e.yr.bottom+mn)return e;if(n){if(t.xr.right+mn)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(Ai(t,e,mn)){if(e.xr.right+mn)return e;if(n){if(t.yr.bottom+mn)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}O($Ce,"snapEndpointToBoundary");function iee(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}}O(H8t,"intersectRanges");function zCe(t,e){return e==="left"||e==="right"?aee(t.top,t.bottom):aee(t.left,t.right)}O(zCe,"clearanceRangeForSide");function oee(t,e,r){const n=t.y>=r.top-mn&&t.y<=r.bottom+mn,i=t.x>=r.left-mn&&t.x<=r.right+mn;if(_i(t,e,mn)&&n){if(Math.abs(t.x-r.left)0?H8t(a):void 0}O(W8t,"straightClearanceRange");function UCe(t,e,r,n,i){const a=W8t(t,e,r,n,i);if(!a)return;const o=i?t.y:t.x,s=Math.min(a.hi,Math.max(a.lo,o));if(!(Math.abs(s-o)({...s}));for(let s=e;s>=0&&s=r.left-mn&&Math.max(t.x,e.x)<=r.right+mn,i=Math.min(t.y,e.y)>=r.top-mn&&Math.max(t.y,e.y)<=r.bottom+mn;if(Math.abs(t.y-r.top)n.bottom+mn;case"left":return _i(e,r,mn)&&r.xn.right+mn}}O(HCe,"leavesOutward");function WCe(t,e,r){if(t.length<3)return t;if(r){const a=GCe(t[0],t[1],e);return a&&HCe(a,t[1],t[2],e)?t.slice(1):t}const n=t.length-1,i=GCe(t[n-1],t[n],e);return i&&HCe(i,t[n-1],t[n-2],e)?t.slice(0,n):t}O(WCe,"collapseOwnBorderStub");function j8t(t,e,r){let n=t;if(e){const a=iee(n,0,1);if(a){const o=$Ce(a,n[0],e);o!==n[0]&&(n=[o,...n.slice(1)])}n=WCe(n,e,!0)}if(r){const a=n.length-1,o=iee(n,a,-1);if(o){const s=$Ce(o,n[a],r,!0);s!==n[a]&&(n=[...n.slice(0,a),s])}n=WCe(n,r,!1)}const i=VCe(n,e,r);return i!==n||n.length===2?i:(e&&(n=QCe(n,e,!0)),r&&(n=QCe(n,r,!1)),n)}O(j8t,"snapAndCollapseEndpoints");function YCe(t,e){for(const r of t){const n=NCe(r,e,2);if(!n)continue;const i=Ni(n.points,mn),a=j8t(i,n.srcRect,n.dstRect);if(a.length<3){n.edge.points=a;continue}const o=[a[0],{...a[0]},...a.slice(1,-1),a[a.length-1],{...a[a.length-1]}];n.edge.points=o}}O(YCe,"prepareEdgeEndpointsForRenderer");function qCe(t){return new Map(t.map(e=>[e.id,e]))}O(qCe,"buildNodeMap");function X8t(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}O(X8t,"resolveTopLevelGroupId");function jCe(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}O(jCe,"groupDepth");function XCe(t){let e=1/0,r=-1/0,n=1/0,i=-1/0;for(const a of t){const o=a.x,s=a.y;if(typeof o!="number"||typeof s!="number")continue;const l=a.width??0,u=a.height??0;e=Math.min(e,o-l/2),r=Math.max(r,o+l/2),n=Math.min(n,s-u/2),i=Math.max(i,s+u/2)}return e===1/0||n===1/0?null:{minX:e,maxX:r,minY:n,maxY:i}}O(XCe,"boundsForChildren");function K8t(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}O(K8t,"applyGroupBounds");function Z8t(t){const e=qCe(t),r=t.filter(n=>n.isGroup&&n.parentId).sort((n,i)=>jCe(i,e)-jCe(n,e));for(const n of r){const i=t.filter(o=>o.parentId===n.id),a=XCe(i);a&&K8t(n,a)}}O(Z8t,"recomputeNestedGroupBounds");function see(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(l=>!l.isGroup);let a=1/0,o=-1/0;for(const l of i){const u=l[e];typeof u=="number"&&(a=Math.min(a,u),o=Math.max(o,u))}if(!Number.isFinite(a)||!Number.isFinite(o))return!1;const s=O(l=>a+o-l,"mirror");for(const l of r){const u=l[e];typeof u=="number"&&(l[e]=s(u));const h=l.groupTitleRect;h&&(l.groupTitleRect=e==="x"?{...h,left:s(h.right),right:s(h.left)}:{...h,top:s(h.bottom),bottom:s(h.top)})}for(const l of n)for(const u of l.points??[])u[e]=s(u[e]);return!0}O(see,"mirrorAxis");function J8t(t){return(t.nodes??[]).some(r=>!r.isGroup)?see(t,"y"):!0}O(J8t,"applyBtDirectionTransform");function eBt(t,e="LR"){const r=t.nodes??[],n=t.edges??[],i=r.filter(L=>!L.isGroup);let a=1/0,o=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)-o)*f+s,I=R-a;L.x=M,L.y=I}for(const L of n)if(L.points)for(const R of L.points){const D=R.x,I=(R.y-o)*f+s,N=D-a;R.x=I,R.y=N}Z8t(r);const p=r.filter(L=>L.isGroup&&!L.parentId);if(p.length===0)return e==="RL"&&see(t,"x"),!0;const g=qCe(r),m=new Map;for(const L of r){if(L.isGroup)continue;const R=X8t(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=XCe(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=s+S,E=(b+x)/2-S/2-s,_=E+T/2,P=Math.max(v,s);y.sort((L,R)=>L.centerY-R.centerY);for(let L=0;Lf.cy?y.bottom:y.top,P=f.cx+b;if(P<=y.left+zg||P>=y.right-zg)continue;x={x:P,y:_},w={x:P,y:s.y},A={x:s.x,y:s.y}}else{const _=p.cx>f.cx?y.right:y.left,P=f.cy+b;if(P<=y.top+zg||P>=y.bottom-zg)continue;x={x:_,y:P},w={x:s.x,y:P},A={x:s.x,y:s.y}}const S=Rp(x,w,zg),T=Rp(w,A,zg);if(S&&T||!S&&As(x,w,n,[h],1)||!T&&As(w,A,n,[d],1))continue;const C=!S&&ree(x,w,t,i,{epsilon:zg,skipDegenerateOther:!0}),k=!T&&ree(w,A,t,i,{epsilon:zg,skipDegenerateOther:!0});if(!(C||k)){S?v=[w,A]:T?v=[x,w]:v=[x,w,A];break}}v&&(i.points=v)}}O(tBt,"portSwapToLShape");function rBt(t,e){const{realNodeRects:a,labelNodeRects:o}=X2(e.values());for(const s of t){if(s.isLayoutOnly)continue;const l=s.points;if(!l||l.length<4)continue;const u=Ni(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=es(f,d,.001),A=ts(f,d,.001),S=es(p,f,.001),T=ts(p,f,.001);if(!(w&&T||A&&S))continue;const C=s.end,k=s.start,E=C?e.get(C):void 0;if(!E)continue;const _=E.x??0,P=E.y??0,L=ed(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:P},D={x:z?L.right:L.left,y:P}}if(As(R,D,a,C?[C]:[],-2)||As(R,D,o,[],-2))continue;if(k){const z=e.get(k),U=z?ed(z):void 0;if(U&&_Ce(R,U,2))continue}const M=O((z,U)=>`${z.x.toFixed(3)},${z.y.toFixed(3)}|${U.x.toFixed(3)},${U.y.toFixed(3)}`,"ownSegmentKey"),I=new Set;for(let z=0;z{for(const Q of t){if(Q===s||Q.isLayoutOnly)continue;const G=Q.points;if(!(!G||G.length<2))for(let q=0;q=0){const z=u[h-3],U=[k,C].filter(Q=>!!Q);if(As(z,R,a,U,-2)||N(z,R))continue}const B=[...u.slice(0,h-2),R,D];s.points=B;const V=s.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,q,Y=-1;for(let ne=0;ne=U+2||pe&&ee>=Q+2)&&ee>Y&&(Y=ee,G=(X.x+J.x)/2,q=(X.y+J.y)/2)}G!==void 0&&q!==void 0&&(z.x=G,z.y=q)}}}}}O(rBt,"collapseShortTerminalStub");var Lr=.001,Gl=8,Xn=F4,KCe=O((t,e)=>Ai(t,e,Lr)||_i(t,e,Lr),"orthogonallyAligned");function nBt(t,e){const i=O((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=O((p,g)=>{const m=Ni(p.points??[]);if(m.length<2)return;const v=g?p.start:p.end,y=v?e.get(v):void 0,b=y?ed(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(KCe(w,A)&&(S=w),Ai(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(_i(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"),o=O((p,g)=>Math.max(0,Math.min(p.max,g.max)-Math.max(p.min,g.min)),"projectedOverlapLength"),s=O((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)&&Ai(p.boundary,g.boundary,1):(Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1)&&_i(p.boundary,g.boundary,1),"sameTerminalFace"),l=O((p,g)=>p.nodeId!==g.nodeId||p.orientation!==g.orientation?!1:o(p,g)>=Gl&&Math.abs(p.coord-g.coord)<.5,"exactTerminalLaneConflict"),u=O((p,g)=>{if(p.nodeId!==g.nodeId||p.orientation!==g.orientation||p.orientation!=="H"||p.atStart===g.atStart)return!1;const m=o(p,g);if(m2*v?!1:s(p,g)&&Math.abs(p.coord-g.coord)<16},"nearTerminalLaneConflict"),h=O((p,g)=>{const m=Ni(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(!O(()=>Math.abs(p.boundary.y-p.rect.top)<1||Math.abs(p.boundary.y-p.rect.bottom)<1?_i(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?Ai(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&&Rp(m[1],p.railEnd,Lr),T=m.slice(S?2:1),C=T[0];return C&&!KCe(C,y)?void 0:[v,y,...T]}const x=m.length>1&&Rp(m[m.length-2],p.railEnd,Lr),w=m.slice(0,x?-2:-1),A=w[w.length-1];if(!(A&&!KCe(A,y)))return[...w,y,v]},"shiftedCandidate"),d=O(p=>{const g=p.edge,m=Ni(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,[C,k]=m;return _i(C,k,Lr)&&Math.abs(A-T)<1&&Math.abs(w-S)>1||Ai(C,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 C=d(S),k=d(T);return C!==k?Number(C)-Number(k):+!T.atStart-+!S.atStart});for(const S of A){for(const T of f){const C=h(S,T);if(!C)continue;const k=a({...S.edge,points:C},S.atStart);if(!(!k||g.some(E=>E.edge!==S.edge&&(l(k,E)||w&&u(k,E))))){S.edge.points=C,m=!0;break}}if(m)break}}if(!m)return}}O(nBt,"separateSharedRenderedTerminalLanes");function iBt(t,e){const{realNodeRects:n,labelNodeRects:i}=X2(e.values()),a=O((s,l)=>{const u=s.start,h=s.end,d=Xn(l);if(d.length!==l.length-1)return!1;const f=[u,h].filter(p=>!!p);for(const p of d)if(As(p.a,p.b,n,f,-2)||As(p.a,p.b,i,[],-2))return!1;for(const p of t){if(p===s||p.isLayoutOnly)continue;const g=p.points;if(!(!g||g.length<2)){for(const m of d)for(const v of Xn(Ni(g)))if(W0(m,v,.5)>=Gl||V1(m.a,m.b,v.a,v.b,Lr))return!1}}return!0},"candidateIsSafe"),o=O((s,l)=>{if(l+4>=s.length)return;const u=s[l],h=s[l+1],d=s[l+2],f=s[l+3],p=s[l+4],g=es(u,h)&&ts(h,d)&&es(d,f)&&ts(f,p)&&Ai(u,f,Lr)&&Ai(u,p,Lr)&&Ai(h,d,Lr)&&(h.x-u.x)*(f.x-d.x)<0,m=ts(u,h)&&es(h,d)&&ts(d,f)&&es(f,p)&&_i(u,f,Lr)&&_i(u,p,Lr)&&_i(h,d,Lr)&&(h.y-u.y)*(f.y-d.y)<0;if(g||m)return Ni([...s.slice(0,l+1),p,...s.slice(l+5)]);if(l+5>=s.length)return;const v=s[l+5],y=ts(u,h)&&es(h,d)&&ts(d,f)&&es(f,p)&&ts(p,v)&&Ai(u,p,Lr)&&Ai(u,v,Lr)&&Ai(d,f,Lr)&&(d.x-h.x)*(p.x-f.x)<0,b=es(u,h)&&ts(h,d)&&es(d,f)&&ts(f,p)&&es(p,v)&&_i(u,p,Lr)&&_i(u,v,Lr)&&_i(d,f,Lr)&&(d.y-h.y)*(p.y-f.y)<0;if(!(!y&&!b))return Ni([...s.slice(0,l+1),v,...s.slice(l+6)])},"withoutDogleg");for(let s=0;s<8;s++){let l=!1;for(const u of t){if(u.isLayoutOnly)continue;const h=Ni(u.points??[]);for(let d=0;d<=h.length-5;d++){const f=o(h,d);if(!(!f||!a(u,f))){u.points=f,l=!0;break}}if(l)break}if(!l)return}}O(iBt,"collapseRedundantRectangularDoglegs");function ZCe(t,e){const{realNodeRects:a,labelNodeRects:o}=X2(e.values()),s=t.filter(g=>!g.isLayoutOnly),l=O((g,m,v)=>Ni(g===m?v??[]:g.points??[]),"pointsFor"),u=O((g,m)=>{let v=0;for(let y=0;y{const m=Xn(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=O((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?Ju(m.a.x,m.b.x,b.left,b.right)>=Gl&&m.a.y>=b.top-2&&m.a.y<=b.bottom+2:Ju(m.a.y,m.b.y,b.top,b.bottom)>=Gl&&m.a.x>=b.left-2&&m.a.x<=b.right+2})},"blockingRectsFor"),f=O((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=Y0(Ni(y));return Xn(b).length===b.length-1?b:void 0},"candidateByMovingRail"),p=O((g,m,v)=>{const y=[g.start,g.end].filter(x=>!!x),b=Xn(m);if(b.length!==m.length-1)return!1;for(const x of b)if(As(x.a,x.b,a,y,-2)||As(x.a,x.b,o,[],-2))return!1;for(const x of s)if(x!==g){for(const w of b)for(const A of Xn(l(x)))if(W0(w,A,.5)>=Gl)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 s){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}}O(ZCe,"liftObstacleHuggingSameSideRails");function JCe(t,e){const n=O(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=O(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:Ju(l.a.x,l.b.x,u.left,u.right)>=Gl},"horizontalSegmentIntersectsTitle"),o=[...e.values()].map(i).filter(l=>!!l);if(o.length===0)return;let s=0;for(const l of t){if(l.isLayoutOnly)continue;const u=Ni(l.points??[]);for(const h of Xn(u))for(const d of o)a(h,d.rect)&&(s=Math.max(s,d.rect.bottom-h.a.y+4))}if(!(s<=Lr))for(const l of o){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-s/2,l.node.height=h+s,l.node.groupTitleRect={...l.rect,top:l.rect.top-s,bottom:l.rect.bottom-s})}}O(JCe,"liftTopLaneTitleBandsAboveRails");function eOe(t,e){const n=O(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=O(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:Ju(u.a.y,u.b.y,h.top,h.bottom)>=Gl},"verticalSegmentIntersectsTitle"),o=O((u,h)=>{if(!u.horizontal)return!1;const d=u.a.y;return d<=h.top+Lr||d>=h.bottom-Lr?!1:Ju(u.a.x,u.b.x,h.left,h.right)>=Gl},"horizontalSegmentIntersectsTitle"),s=[...e.values()].map(i).filter(u=>!!u);if(s.length===0)return;let l=0;for(const u of t){if(u.isLayoutOnly)continue;const h=Ni(u.points??[]);for(const d of Xn(h))for(const f of s)if(a(d,f.rect))l=Math.max(l,f.rect.right-d.a.x+4);else if(o(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 s){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})}}O(eOe,"shiftLeftLaneTitleBandsLeftOfRails");function aBt(t,e){const{realNodeRects:n}=X2(e.values()),i=t.filter(g=>!g.isLayoutOnly),a=O((g,m=new Map)=>Ni(m.get(g)??g.points??[]),"replacementPointsFor"),o=O((g=new Map)=>{let m=0;for(let v=0;vi.reduce((m,v)=>m+ff(a(v,g)),0),"totalBends"),l=O(g=>{const m=a(g);if(m.length<4)return;const v=m[m.length-2],y=m[m.length-1];if(!(!es(v,y,Lr)&&!ts(v,y,Lr)))return{tailStart:v,terminal:y}},"terminalTailFor"),u=O((g,m)=>{const v=a(g);if(v.length<3)return;const y=v[0],b=v[1];let x;if(es(y,b,Lr))x={x:b.x,y:m.tailStart.y};else if(ts(y,b,Lr))x={x:m.tailStart.x,y:b.y};else return;const w=Y0(Ni([y,b,x,m.tailStart,m.terminal]));return Xn(w).length===w.length-1?w:void 0},"candidateWithDestinationTail"),h=O((g,m)=>{const v=[g.start,g.end].filter(y=>!!y);for(const y of Xn(m))if(As(y.a,y.b,n,v,-2))return!0;return!1},"pathHasNodeHit"),d=O((g,m,v)=>{for(const y of i)if(y!==g){for(const b of Xn(m))for(const x of Xn(a(y,v)))if(W0(b,x,.5)>=Gl)return!0}return!1},"pathHasSharedTrack"),f=O((g,m,v)=>!h(g,m)&&!d(g,m,v),"candidateIsSafe"),p=O(()=>{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=o();if(m===0)return;const v=s();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}}O(aBt,"swapDestinationTerminalTailsToReduceCrossings");function oBt(t,e){const{realNodeRects:a,labelNodeRects:o}=X2(e.values()),s=t.filter(w=>!w.isLayoutOnly),l=O((w,A=new Map)=>Ni(A.get(w)??w.points??[]),"replacementPointsFor"),u=O((w=new Map)=>{let A=0;for(let S=0;Ss.reduce((A,S)=>A+ff(l(S,w)),0),"totalBends"),d=O(w=>{const A=w.start,S=w.end,T=A?e.get(A):void 0,C=S?e.get(S):void 0,k=T?ed(T):void 0,E=C?ed(C):void 0;return k&&E?{src:k,dst:E}:void 0},"endpointRectsFor"),f=O((w,A,S)=>{if(S.index<=0||S.index+1>=A.length-1)return;const T=d(w);if(T){if(S.vertical){const C=S.a.x,k=Math.min(T.src.left,T.dst.left),E=Math.max(T.src.right,T.dst.right),_=CE+Lr?"right":void 0;return _?{edge:w,points:A,segmentIndex:S.index,axis:"vertical",side:_,coord:C,min:Math.min(S.a.y,S.b.y),max:Math.max(S.a.y,S.b.y)}:void 0}if(S.horizontal){const C=S.a.y,k=Math.min(T.src.top,T.dst.top),E=Math.max(T.src.bottom,T.dst.bottom),_=CE+Lr?"bottom":void 0;return _?{edge:w,points:A,segmentIndex:S.index,axis:"horizontal",side:_,coord:C,min:Math.min(S.a.x,S.b.x),max:Math.max(S.a.x,S.b.x)}:void 0}}},"externalRailForSegment"),p=O(()=>{const w=[];for(const A of s){const S=l(A);for(const T of Xn(S)){const C=f(A,S,T);C&&w.push(C)}}return w},"collectExternalRails"),g=O((w,A)=>w.edge!==A.edge&&w.axis===A.axis&&w.side===A.side&&Ju(w.min,w.max,A.min,A.max)>=Gl,"railsInteract"),m=O(w=>{const A=[],S=new Set;for(const T of w){if(S.has(T))continue;const C=[T],k=[];for(S.add(T);C.length>0;){const E=C.pop();k.push(E);for(const _ of w)!S.has(_)&&g(E,_)&&(S.add(_),C.push(_))}k.length>1&&A.push(k)}return A},"connectedComponents"),v=O(w=>{const A=[];for(const S of w)A.some(T=>Math.abs(T-S.coord){const A=w.map(C=>C.coord),S=v(w),T=[];if(w.length<=6){const C=new Array(S.length).fill(!1),k=[],E=O(()=>{if(k.length===w.length){k.some((_,P)=>Math.abs(_-A[P])>=Lr)&&T.push([...k]);return}for(const[_,P]of S.entries())C[_]||(C[_]=!0,k.push(P),E(),k.pop(),C[_]=!1)},"visit");return E(),T}for(let C=0;C{const S=new Map;for(const[C,k]of w.entries()){const E=A[C],_=S.get(k.edge)??k.points.map(P=>({x:P.x,y:P.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[C,k]of S){const E=Y0(Ni(k));if(Xn(E).length!==E.length-1)return;T.set(C,E)}return T},"replacementsForAssignment"),x=O(w=>{for(const[A,S]of w){const T=[A.start,A.end].filter(C=>!!C);for(const C of Xn(S))if(As(C.a,C.b,a,T,-2)||As(C.a,C.b,o,[],-2))return!1}for(let A=0;A=Gl)return!1}}return!0},"candidateIsSafe");for(let w=0;w<4;w++){const A=u();if(A===0)return;let S,T=A,C=h(),k=Number.POSITIVE_INFINITY;for(const E of m(p()))for(const _ of y(E)){const P=b(E,_);if(!P||!x(P))continue;const L=u(P);if(L>=A)continue;const R=h(P),D=E.reduce((M,I,N)=>M+Math.abs(_[N]-I.coord),0);L>T||L===T&&(R>C||R===C&&D>=k)||(S=P,T=L,C=R,k=D)}if(!S)return;for(const[E,_]of S)E.points=_}}O(oBt,"reassignCrossingExternalRailChannels");function sBt(t,e){const{realNodeRects:n,labelNodeRects:i}=X2(e.values()),a=t.filter(p=>!p.isLayoutOnly),o=O((p,g,m)=>Ni(p===g?m??[]:p.points??[]),"pointsFor"),s=O(p=>Xn(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=O((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)&&Ju(p.a.x,p.b.x,g.left,g.right)>=Gl}if(p.vertical){const m=p.a.x;return(Math.abs(m-g.left)<1||Math.abs(m-g.right)<1)&&Ju(p.a.y,p.b.y,g.top,g.bottom)>=Gl}return!1},"segmentRunsAlongRectBorder"),h=O(p=>{const g=[p.start,p.end].filter(v=>!!v),m=[];for(const v of g){const y=e.get(v),b=y?ed(y):void 0;b&&m.push(b)}return m},"endpointRectsFor"),d=O((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=es(m,v,Lr)&&ts(v,y,Lr)&&es(y,b,Lr),w=ts(m,v,Lr)&&es(v,y,Lr)&&ts(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=Ai(m,b,Lr)||_i(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)]),C=new Set;return T.map(k=>Y0(Ni(k))).filter(k=>{if(Xn(k).length!==k.length-1||!k.some(_=>Rp(_,b,Lr)))return!1;const E=k.map(_=>`${_.x.toFixed(3)},${_.y.toFixed(3)}`).join("|");return C.has(E)?!1:(C.add(E),!0)})},"shortcutCandidatesAt"),f=O((p,g,m)=>{const v=[p.start,p.end].filter(b=>!!b),y=h(p);for(const b of Xn(g))if(As(b.a,b.b,n,v,-2)||As(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 Xn(g))for(const w of Xn(o(b)))if(W0(x,w,.5)>=Gl)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=o(w),S=ff(A,Lr),T=s(A);for(let C=0;C<=A.length-4;C++)for(const k of d(A,C)){const E=ff(k,Lr),_=s(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}}O(sBt,"shortcutRedundantOrthogonalJogs");function lBt(t,e){const o=[];for(const ue of e.values()){if(ue.isGroup||ue.isEdgeLabel)continue;const de=ue.x??0,xe=ue.y??0,ge=ed(ue);ge&&o.push({id:String(ue.id??""),cx:de,cy:xe,rect:ge})}if(o.length===0)return;const s=new Map(o.map(ue=>[ue.id,ue])),l=o.map(ue=>({id:ue.id,rect:ue.rect})),u=["top","bottom","left","right"],h={top:Math.min(...o.map(ue=>ue.rect.top))-20,bottom:Math.max(...o.map(ue=>ue.rect.bottom))+20,left:Math.min(...o.map(ue=>ue.rect.left))-20,right:Math.max(...o.map(ue=>ue.rect.right))+20},d=t.filter(ue=>!ue.isLayoutOnly),f=new Map(d.map((ue,de)=>[ue,de])),p=O(ue=>{const de=ue==="left"||ue==="top"?-1:1,xe=[];for(let ge=0;ge<=2;ge++)xe.push(h[ue]+de*20*ge);return xe},"outwardTracksForSide"),g=O((ue,de=new Map)=>Ni(de.get(ue)??ue.points??[]),"replacementPointsFor"),m=O((ue,de)=>{let xe=0;for(const ge of ue)for(const ze of de)V1(ge.a,ge.b,ze.a,ze.b,Lr)&&xe++;return xe},"crossingCountBetweenSegments"),v=O((ue,de)=>m(Xn(ue),Xn(de)),"crossingCountBetweenPaths"),y=O((ue=new Map)=>{let de=0;const xe=[],ge=new Set,ze=[],we=O(Oe=>{ge.has(Oe)||(ge.add(Oe),ze.push(Oe))},"addEdge");for(let Oe=0;Oe0&&(de+=ae,xe.push({first:Be,second:be,count:ae}),we(Be),we(be))}}return ze.sort((Oe,Be)=>(f.get(Oe)??0)-(f.get(Be)??0)),{count:de,pairs:xe,edgeSet:ge,edges:ze}},"crossingSnapshot"),b=O((ue,de)=>{const xe=new Set(de.keys());if(xe.size===0)return ue.count;let ge=0;for(const we of ue.pairs)(xe.has(we.first)||xe.has(we.second))&&(ge+=we.count);let ze=0;for(let we=0;we{const de=new Map;for(const ze of ue.pairs){const we=de.get(ze.first)??new Set;we.add(ze.second),de.set(ze.first,we);const Oe=de.get(ze.second)??new Set;Oe.add(ze.first),de.set(ze.second,Oe)}const xe=[],ge=new Set;for(const ze of ue.edges){if(ge.has(ze))continue;const we=[ze],Oe=[];for(ge.add(ze);we.length>0;){const Be=we.pop();Oe.push(Be);for(const Z of de.get(Be)??[])ge.has(Z)||(ge.add(Z),we.push(Z))}Oe.sort((Be,Z)=>(f.get(Be)??0)-(f.get(Z)??0)),Oe.length>1&&xe.push(Oe)}return xe},"crossingComponents"),w=O(ue=>[ue.start,ue.end].filter(de=>!!de),"endpointIdsFor"),A=O(ue=>{const de=[];for(const xe of x(ue)){const ge=new Set(xe),ze=new Set(xe.flatMap(Oe=>w(Oe))),we=[...xe];for(const Oe of d)ge.has(Oe)||w(Oe).some(Be=>ze.has(Be))&&we.push(Oe);we.sort((Oe,Be)=>(f.get(Oe)??0)-(f.get(Be)??0)),de.push(we)}return de},"pairSearchGroups"),S=O((ue,de,xe)=>b(ue,new Map([[de,xe]])),"crossingCountWithSingleReplacement"),T=O(ue=>{const de=new Map;for(const xe of ue.pairs)de.set(xe.first,(de.get(xe.first)??0)+xe.count),de.set(xe.second,(de.get(xe.second)??0)+xe.count);return de},"currentCrossingsByEdge"),C=O(ue=>ue.slice(1).reduce((de,xe,ge)=>{const ze=ue[ge];return de+Math.abs(xe.x-ze.x)+Math.abs(xe.y-ze.y)},0),"pathLength"),k=O((ue=new Map)=>d.reduce((de,xe)=>de+ff(g(xe,ue)),0),"totalBends"),E=O((ue=new Map)=>d.reduce((de,xe)=>de+C(g(xe,ue)),0),"totalLength"),_=O((ue,de,xe=new Map)=>{const ge=Xn(de);for(const ze of d)if(ze!==ue){for(const we of ge)for(const Oe of Xn(g(ze,xe)))if(W0(we,Oe,.5)>=Gl)return!0}return!1},"pathHasSegmentConflict"),P=O((ue,de)=>{const xe=[ue.start,ue.end].filter(ge=>!!ge);for(const ge of Xn(de))if(As(ge.a,ge.b,l,xe,-2))return!0;return!1},"pathHitsNode"),L=O((ue,de)=>{const xe=Y0(Ni(de));Xn(xe).length===xe.length-1&&ue.push(xe)},"pushOrthogonalCandidate"),R=O(ue=>ue==="left"||ue==="right","sideIsHorizontal"),D=O((ue,de,xe)=>{switch(de){case"left":return Math.min(ue.x,xe.x)-20;case"right":return Math.max(ue.x,xe.x)+20;case"top":return Math.min(ue.y,xe.y)-20;case"bottom":return Math.max(ue.y,xe.y)+20}},"localTrackForSameSide"),M=O((ue,de,xe,ge)=>{const ze=xe==="left"||xe==="top"?-1:1,we=[D(de,xe,ge),h[xe]];for(const Oe of we)for(let Be=0;Be<=2;Be++)L(ue,LCe(de,xe,ge,Oe+ze*20*Be))},"addSameSideCandidates"),I=O((ue,de,xe,ge,ze)=>{for(const we of p(xe))for(const Oe of p(ze))L(ue,[de,{x:we,y:de.y},{x:we,y:Oe},{x:ge.x,y:Oe},ge])},"addHorizontalToVerticalCandidates"),N=O((ue,de,xe,ge,ze)=>{for(const we of p(xe))for(const Oe of p(ze))L(ue,[de,{x:de.x,y:we},{x:Oe,y:we},{x:Oe,y:ge.y},ge])},"addVerticalToHorizontalCandidates"),F=O((ue,de,xe,ge,ze)=>{const we=[...p("top"),...p("bottom")];for(const Oe of p(xe))for(const Be of p(ze))for(const Z of we)L(ue,[de,{x:Oe,y:de.y},{x:Oe,y:Z},{x:Be,y:Z},{x:Be,y:ge.y},ge])},"addHorizontalPairCandidates"),B=O((ue,de,xe,ge,ze)=>{const we=[...p("left"),...p("right")];for(const Oe of p(xe))for(const Be of p(ze))for(const Z of we)L(ue,[de,{x:de.x,y:Oe},{x:Z,y:Oe},{x:Z,y:Be},{x:ge.x,y:Be},ge])},"addVerticalPairCandidates"),V=O(ue=>{const de=new Set;return ue.map(xe=>Ni(xe)).filter(xe=>{const ge=xe.map(ze=>`${ze.x.toFixed(3)},${ze.y.toFixed(3)}`).join("|");return de.has(ge)||xe.length<2?!1:(de.add(ge),!0)})},"dedupeCandidatePaths"),z=O((ue,de,xe,ge)=>{const ze=[],we=DCe(ue,de,xe,ge,20,Lr);we&&L(ze,we),de===ge&&M(ze,ue,de,xe);const Oe=R(de),Be=R(ge);return Oe&&!Be?I(ze,ue,de,xe,ge):!Oe&&Be?N(ze,ue,de,xe,ge):Oe?F(ze,ue,de,xe,ge):B(ze,ue,de,xe,ge),V(ze)},"buildCandidatesForSides"),U=O((ue,de,xe,ge)=>{const ze=[...p("left"),...p("right")],we=[...p("top"),...p("bottom")];for(const Oe of u){const Be=zC(ge,Oe),Z=Oe==="top"||Oe==="bottom"?p(Oe):we;for(const le of ze){L(ue,[de,xe,{x:le,y:xe.y},{x:le,y:Be.y},Be]);for(const be of Z)L(ue,[de,xe,{x:le,y:xe.y},{x:le,y:be},{x:Be.x,y:be},Be])}}},"addVerticalDepartureOuterTrackCandidates"),Q=O((ue,de,xe,ge)=>{const ze=[...p("left"),...p("right")],we=[...p("top"),...p("bottom")];for(const Oe of u){const Be=zC(ge,Oe),Z=Oe==="left"||Oe==="right"?p(Oe):ze;for(const le of we){L(ue,[de,xe,{x:xe.x,y:le},{x:Be.x,y:le},Be]);for(const be of Z)L(ue,[de,xe,{x:xe.x,y:le},{x:be,y:le},{x:be,y:Be.y},Be])}}},"addHorizontalDepartureOuterTrackCandidates"),G=O(ue=>{const de=ue.start,xe=ue.end,ge=xe?s.get(xe):void 0;if(!de||!ge)return[];const ze=Ni(ue.points??[]);if(ze.length<4)return[];const we=ze[0],Oe=ze[1],Be=[];return ts(we,Oe,Lr)?U(Be,we,Oe,ge):es(we,Oe,Lr)&&Q(Be,we,Oe,ge),Be},"terminalPreservingOuterTrackCandidates"),q=O(ue=>{const de=ue.start,xe=ue.end,ge=de?s.get(de):void 0,ze=xe?s.get(xe):void 0;if(!ge||!ze)return[];const we=[];for(const Oe of u){const Be=zC(ge,Oe);for(const Z of u)we.push(...z(Be,Oe,zC(ze,Z),Z))}return we.push(...G(ue)),we},"candidatePathsFor"),Y=O(()=>new Map(d.map(ue=>[ue,Xn(g(ue))])),"currentSegmentsByEdge"),ne=O((ue,de,xe)=>{const ge=new Set;for(const ze of d){if(ze===ue)continue;const we=xe.get(ze)??Xn(g(ze));de.some(Oe=>we.some(Be=>W0(Oe,Be,.5)>=Gl))&&ge.add(ze)}return ge},"sharedTrackConflictsFor"),X=O((ue,de,xe,ge)=>{const ze=new Set;return q(ue).map(Oe=>Y0(Ni(Oe))).filter(Oe=>{if(P(ue,Oe))return!1;const Be=Oe.map(Z=>`${Z.x.toFixed(3)},${Z.y.toFixed(3)}`).join("|");return ze.has(Be)||Oe.length<2?!1:(ze.add(Be),!0)}).map(Oe=>{const Be=Xn(Oe);let Z=0;for(const le of d)le!==ue&&(Z+=m(Be,xe.get(le)??Xn(g(le))));return{candidate:Oe,candidateSegments:Be,crossings:de.count-(ge.get(ue)??0)+Z,bends:ff(Oe,Lr),totalBends:ff(Oe),length:C(Oe)}}).filter(({crossings:Oe})=>Oe<=de.count).sort((Oe,Be)=>Oe.crossings-Be.crossings||Oe.bends-Be.bends||Oe.length-Be.length).slice(0,48).map(Oe=>({path:Oe.candidate,segments:Oe.candidateSegments,sharedTrackConflicts:ne(ue,Oe.candidateSegments,xe),totalBends:Oe.totalBends,length:Oe.length}))},"pairCandidatesFor"),J=O((ue,de,xe,ge,ze,we)=>{let Oe=0;for(const Z of ue.pairs)(Z.first===de||Z.second===de||Z.first===ge||Z.second===ge)&&(Oe+=Z.count);let Be=m(xe.segments,ze.segments);for(const Z of d){if(Z===de||Z===ge)continue;const le=we.get(Z)??Xn(g(Z));Be+=m(xe.segments,le)+m(ze.segments,le)}return ue.count-Oe+Be},"pairCrossingCount"),ee=O((ue,de)=>{for(const xe of ue.sharedTrackConflicts)if(xe!==de)return!1;return!0},"conflictsOnlyWith"),te=O((ue,de)=>ue.segments.some(xe=>de.segments.some(ge=>W0(xe,ge,.5)>=Gl)),"candidatesShareTrack"),pe=O((ue,de,xe,ge)=>ee(de,xe.edge)&&ee(ge,ue.edge)&&!te(de,ge),"pairCandidatesAreCompatible"),ie=O((ue,de,xe,ge,ze)=>{const we=J(ue.current,de.edge,xe,ge.edge,ze,ue.baseSegments);if(!(we>=ue.current.count))return{replacements:new Map([[de.edge,xe.path],[ge.edge,ze.path]]),crossings:we,bends:ue.currentBends-(ue.baseBendsByEdge.get(de.edge)??0)-(ue.baseBendsByEdge.get(ge.edge)??0)+xe.totalBends+ze.totalBends,length:ue.currentLength-(ue.baseLengthByEdge.get(de.edge)??0)-(ue.baseLengthByEdge.get(ge.edge)??0)+xe.length+ze.length}},"scorePairReplacement"),Ce=O((ue,de)=>ue.crossings{let ze=ge;for(const we of de.candidates)for(const Oe of xe.candidates){if(!pe(de,we,xe,Oe))continue;const Be=ie(ue,de,we,xe,Oe);Be&&Ce(Be,ze)&&(ze=Be)}return ze},"bestScoreForOptionPair"),Ee=O(ue=>{const de=k(),xe=E(),ge=Y(),ze=T(ue),we=new Map(d.map(ae=>[ae,ff(g(ae))])),Oe=new Map(d.map(ae=>[ae,C(g(ae))])),Be=new Map,Z=A(ue);for(const ae of Z)for(const K of ae){if(Be.has(K))continue;const se=X(K,ue,ge,ze);se.length>0&&Be.set(K,{edge:K,candidates:se})}let le={replacements:new Map,crossings:ue.count,bends:de,length:xe};const be={current:ue,currentBends:de,currentLength:xe,baseBendsByEdge:we,baseLengthByEdge:Oe,baseSegments:ge};for(const ae of Z){const K=new Set(ae.filter(me=>ue.edgeSet.has(me))),se=ae.map(me=>Be.get(me)).filter(me=>!!me);for(let me=0;me0?le.replacements:void 0},"bestPairedReplacement");for(let ue=0;ue<4;ue++){const de=y(),xe=de.count;if(xe===0)return;let ge,ze,we=xe,Oe=Number.POSITIVE_INFINITY;for(const Z of de.edges){const le=ff(g(Z),Lr);for(const be of q(Z)){const ae=P(Z,be),K=!ae&&_(Z,be),se=S(de,Z,be),me=ff(be,Lr);ae||K||!(sewe||se===we&&me>=Oe||(ge=Z,ze=be,we=se,Oe=me)}}if(ge&&ze){ge.points=ze;continue}const Be=Ee(de);if(!Be)return;for(const[Z,le]of Be)Z.points=le}}O(lBt,"resolveRenderedOrthogonalCrossings");var K2=.001,fPn=8;function cBt(t,e){const{nodeInfoById:r,realNodeRects:n}=tee(e),i=["top","bottom","left","right"],a=20,o={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},s=O((m,v,y,b)=>{const x=[],w=DCe(m,v,y,b,a,K2);return w&&x.push(w),v===b&&x.push(LCe(m,v,y,o[v])),x},"buildOrthogonalPathCandidates"),l=O((m,v)=>{for(let y=0;y{let b=0;const x=F4(m,K2),w=v.start,A=v.end;for(const S of t){if(S===v||S.isLayoutOnly)continue;const T=S.start,C=S.end;if(!y&&w&&A&&(T===w||T===A||C===w||C===A))continue;const k=S.points;if(!(!k||k.length<2))for(const E of x)for(const _ of F4(k,K2)){if(ICe(E.a,E.b,_.a,_.b,K2,K2)){b++;continue}W0(E,_,K2)>=fPn&&b++}}return b},"pathConflictCount"),h=4,d=O((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=O((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=ff(v,K2);if(y0){const N=u(M,m,!0);if(N>E||N===E&&I>=_)continue;E=N,_=I,k=M;continue}u(M,m)>C||I<_&&(_=I,k=M)}}}if(k){m.points=k;const P=f.get(b);P&&f.set(b,P.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)}}}O(cBt,"simplifyDetouredEdges");var td=.001,uBt=10,cee=7;function tOe(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 o=a.x-i.x,s=a.y-i.y;if(!(Math.abs(o)+Math.abs(s)a&&eee(t,hBt(a)))}O(rOe,"labelOverlapsOwnMarker");function uee(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=RCe(m,a);for(const{nodeId:y,rect:b}of n)if(y!==g&&eee(v,b))return!0;return!1},"labelOverlapsForeignNode"),u=O((g,m)=>{const v=RCe(m,a);for(const y of r)if(y.edgeId!==g&&JJ(y.p1,y.p2,v))return!0;return!1},"labelOverlapsForeignEdge"),h=O((g,m,v)=>l(g,v)||u(m,v),"labelOverlapsAnything"),d=[],f=O(g=>{for(const{id:m,rect:v}of i)if(B8t(v,g))return m},"findContainingLane"),p=O((g,m)=>d.some(v=>v.labelId!==g&&eee(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=td&&G>=td||w.push({idx:V,length:Q+G,orientation:Q>=td?"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",C=O(V=>[...V].sort((z,U)=>{const Q=z.orientation===T,G=U.orientation===T;if(Q!==G)return Q?-1:1;const q=z.length>=(z.orientation==="horizontal"?b:x)+2,Y=U.length>=(U.orientation==="horizontal"?b:x)+2;return q!==Y?q?-1:1:U.length-z.length}),"rankSegments"),k=w[0],E=w[w.length-1],_=[.5,.25,.75,.05,.95,.15,.85,.1,.9],P=O((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=O((V,z,U)=>Math.min(U,Math.max(z,V)),"clamp"),R=O((V,z)=>V.midX>=z.left-td&&V.midX<=z.right+td&&V.midY>=z.top-td&&V.midY<=z.bottom+td,"pointInsideRectInclusive"),D=O(V=>{const z=z4(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+o,q=Q.rect.right-b/2-o,Y=Q.rect.top+x/2+o,ne=Q.rect.bottom-x/2-o;if(G>q||Y>ne)return;const X={midX:L(V.midX,G,q),midY:L(V.midY,Y,ne)},J=z4(X.midX,X.midY,b,x);return R(V,J)?{laneId:Q.id,anchor:X,rect:J}:void 0},"placementForAnchor"),M=O((V,z,U)=>V.orientation==="horizontal"?Math.abs(z.midX-U.x):Math.abs(z.midY-U.y),"distanceAlongSegment"),I=O((V,z)=>{const Q=(V.orientation==="horizontal"?b/2:x/2)+s;if(V===k){const G=y[V.idx];if(M(V,z,G)+td{const z=C(V);for(const U of z)for(const Q of _){const G=P(U,Q);if(!I(U,G))continue;const q=D(G);if(q&&!rOe(q.rect,y)&&!p(m,q.rect)&&!h(m,g.id,q.rect))return{laneId:q.laneId,anchor:q.anchor}}},"tryPool"),F=O((V,z,U=!1)=>{const Q=C(V);for(const G of Q){const q={midX:G.midX,midY:G.midY};if(z&&!I(G,q))continue;const Y=D(q);if(Y&&!rOe(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})}}}O(uee,"anchorLabelsToPolyline");var nOe=1e-6,pPn=8,dBt=pPn/2,gPn=3;function iOe(t,e){return t{const h=iOe(s,l);let d=0;const f=O(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(o.labelNodeId);for(const p of t){if(p===o||p.isLayoutOnly)continue;const g=p.start,m=p.end;!g||!m||iOe(g,m)===h&&f(p.labelNodeId)}return d>0?d+gPn:0},"labelClearanceFor");for(const o of t){if(o.isLayoutOnly)continue;const s=o.points;if(!ECe(s,nOe))continue;const l=MCe(o,r,nOe);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(As(m,v,n,[u,h],1))continue;const b=a(o,u,h,p?"x":"y"),x=b>dBt?b:dBt,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(!As(S,T,n,[u,h],1)&&!ree(S,T,t,o,{epsilon:nOe})){o.points=[S,T];break}}}}O(fBt,"straightenCollinearSiblingDetours");function aOe(t,e){const{realNodeRects:l,labelNodeRects:u}=X2(e.values()),h=O((A,S)=>F4(S,.001).map(T=>({...T,edge:A,interior:T.index>=1&&T.index<=S.length-3})),"segmentsFor"),d=O(()=>{const A=[];for(const S of t){if(S.isLayoutOnly)continue;const T=S.points;!T||T.length<2||A.push(...h(S,Ni(T)))}return A},"allSegments"),f=O((A,S)=>A.horizontal&&S.horizontal?Ju(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?Ju(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=O((A,S)=>{const T=A.start,C=A.end,k=h(A,S);if(k.length!==S.length-1)return!1;const E=[T,C].filter(P=>!!P),_=A.labelNodeId?[A.labelNodeId]:[];for(const P of k)if(As(P.a,P.b,l,E,-2)||As(P.a,P.b,u,_,-2))return!1;for(const P of t){if(P===A||P.isLayoutOnly)continue;const L=P.points;if(!(!L||L.length<2)){for(const R of k)for(const D of h(P,Ni(L)))if(f(R,D)||V1(R.a,R.b,D.a,D.b,.001))return!1}}return!0},"candidateIsSafe"),g=O((A,S)=>{const T=Ni(A.edge.points??[]);if(T.length<4||A.index>=T.length-1)return;const C=T.map(k=>({...k}));if(A.horizontal)C[A.index].y+=S,C[A.index+1].y+=S;else if(A.vertical)C[A.index].x+=S,C[A.index+1].x+=S;else return;return h(A.edge,C).length===C.length-1?C:void 0},"shiftedCandidate"),m=O((A,S)=>({x:A.x??(S.left+S.right)/2,y:A.y??(S.top+S.bottom)/2}),"nodeCenter"),v=O(A=>{const S=A.edge,T=Ni(S.points??[]);if(T.length!==4||A.index!==1)return;const C=S.start?e.get(S.start):void 0,k=S.end?e.get(S.end):void 0,E=C?ed(C):void 0,_=k?ed(k):void 0,P=T.slice(A.index+2);if(!(!C||!k||!E||!_||P.length===0))return{sourceCenter:m(C,E),targetCenter:m(k,_),sourceRect:E,tail:P}},"sourceDetourContextFor"),y=O((A,S,T,C,k,E)=>{const _=C.y>=T.y,P=_?k.bottom:k.top,L=P+(_?20:-20);if(_&&A.b.y<=L+.001||!_&&A.b.y>=L-.001)return;const R=A.a.x+S;return Ni([{x:T.x,y:P},{x:T.x,y:L},{x:R,y:L},{x:R,y:A.b.y},...E],.001)},"verticalSourceDetour"),b=O((A,S,T,C,k,E)=>{const _=C.x>=T.x,P=_?k.right:k.left,L=P+(_?20:-20);if(_&&A.b.x<=L+.001||!_&&A.b.x>=L-.001)return;const R=A.a.y+S;return Ni([{x:P,y:T.y},{x:L,y:T.y},{x:L,y:R},{x:A.b.x,y:R},...E],.001)},"horizontalSourceDetour"),x=O((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 C=0;CL.interior);for(const L of P){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}}O(aOe,"nudgeSharedInteriorSubpaths");function pBt(t,e,r,n){const i=e.x-t.x,a=e.y-t.y,o=n.x-r.x,s=n.y-r.y,l=i*s-a*o;if(Math.abs(l)<1e-10)return!1;const u=r.x-t.x,h=r.y-t.y,d=(u*s-h*o)/l,f=(u*a-h*i)/l,p=.01;return d>p&&d<1-p&&f>p&&f<1-p}O(pBt,"segmentsIntersect");function gBt(t){const e=t.nodes??[],r=t.edges??[],n=[];if(!r.length||!e.length)return n;const i=$8t(e),a=[];for(const s of r){if(s.isLayoutOnly)continue;const l=s.points;if(!l||l.length<2)continue;const u=s.start,h=s.end,d=s.labelNodeId,f=s.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 s=n.filter(u=>u.type==="edge-node-overlap").length,l=n.filter(u=>u.type==="edge-edge-crossing").length;ye.warn(`[SWIMLANE_VALIDATE] ${n.length} issue(s) detected: ${s} edge-node overlap(s), ${l} edge crossing(s)`);for(const u of n)ye.warn(`[SWIMLANE_VALIDATE] ${u.type}: ${u.detail}`)}return n}O(gBt,"validateSwimlanesLayout");function mBt(t,e){const r=t.nodes??[],n=t.edges??[],i=r.filter(s=>!s.isGroup);if((e==="LR"||e==="RL")&&i.length>0&&!eBt(t,e)||e==="BT"&&i.length>0&&!J8t(t))return;for(const s of n){if(s.isLayoutOnly)continue;const l=s.points;!l||l.length<2||(s.points=Y0(nee(l)))}cBt(n,r),fBt(n,r),tBt(n,r);const a=new Map;for(const s of r)a.set(String(s.id),s);uee(n,a),G8t(n,a),rBt(n,a),aOe(n,a),nBt(n,a),iBt(n,a),ZCe(n,a),aBt(n,a);const o=O(()=>{lBt(n,a),oBt(n,a),sBt(n,a),uee(n,a),YCe(n,a),ZCe(n,a),uee(n,a),YCe(n,a)},"finalizeRenderedEdges");o(),aOe(n,a),o(),JCe(n,a),eOe(n,a),JCe(n,a),eOe(n,a)}O(mBt,"postProcessSwimlaneLayout");function Z2(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 o=`${a.id}:${a.src}->${a.dst}`;r.has(o)||(r.add(o),n.push(a))}return{nodes:[...e.keys()],edges:n,layout:t.layout,nodeById:e}}O(Z2,"normalizeGraph");function oOe(t,e){return t.edges.filter(r=>r.dst===e)}O(oOe,"incoming");function vBt(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}O(vBt,"buildSuccessorMap");function sOe(t){const e=vBt(t);for(const r of e.values())r.sort((n,i)=>n.localeCompare(i));return e}O(sOe,"buildSortedSuccessorMap");function lOe(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}O(lOe,"buildInDegreeMap");function cOe(t){return[...t.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,r)=>e.localeCompare(r))}O(cOe,"sortedZeroInDegreeNodes");function hee(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}}O(hee,"buildPredecessorSuccessorMaps");function uOe(t,e,r,n){var o,s;let i=0;for(const l of t.nodes)n!=null&&n.skipGroups&&((o=t.nodeById.get(l))!=null&&o.isGroup)||(i=Math.max(i,r[l]??0));const a=Array.from({length:i+1},()=>[]);for(const l of e)n!=null&&n.skipGroups&&((s=t.nodeById.get(l))!=null&&s.isGroup)||a[Math.max(0,r[l]??0)].push(l);return a}O(uOe,"buildLayersFromRanks");function zF(t){const e=lOe(t),r=cOe(e),n=[],i=sOe(t);for(;r.length;){const a=r.shift();n.push(a);for(const o of i.get(a)??[])if(e.set(o,(e.get(o)??0)-1),(e.get(o)??0)===0){let s=0;for(;s{if(i-n<=1)return 0;const a=n+i>>1;let o=r(n,a)+r(a,i),s=n,l=a,u=n;for(;s=i||sd.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=O(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"),o=[...e.nodes].sort((h,d)=>h.localeCompare(d));for(const h of o)n[h]===0&&a(h);const s=new Set(i.map(h=>`${h.id}:${h.src}->${h.dst}`)),l=e.edges.map(h=>s.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}}O(yBt,"removeCycles_DFS");function bBt(t){const e=new Map,r=O(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 s=r(a)??a;return e.set(n,s),s},"resolve");for(const n of t.nodes)r(n);return e}O(bBt,"buildTopLaneMap");function Q1(t){const e=bBt(t);return r=>e.get(r)??null}O(Q1,"createTopLaneResolver");function dee(t){const e=[];for(const r of t.layout.nodes??[])r.isGroup&&!r.parentId&&e.push(r.id);return[...new Set(e)].reverse()}O(dee,"buildTopLaneOrder");function dOe(t,e){const r=dee(t);if(!e||e.length===0)return r;const n=new Set(r),i=new Set,a=[];for(const o of e)!n.has(o)||i.has(o)||(i.add(o),a.push(o));for(const o of r)i.has(o)||a.push(o);return a}O(dOe,"resolveTopLaneOrder");var mPn={EPSILON:1e-6},fee={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},xBt={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function wBt(t,e){const r=Z2(t),n=(e==null?void 0:e.laneOf)??(()=>null),i=e==null?void 0:e.rankHint,{preds:a}=hee(r);for(const A of a.values())A.sort((S,T)=>S.localeCompare(T));const o=zF(r)??[...r.nodes].sort((A,S)=>A.localeCompare(S)),s=new Map;for(const[A,S]of o.entries())s.set(S,A);const l=new Map,u=new Map;for(const A of r.nodes)u.set(A,[]);for(const A of o){const S=(a.get(A)??[]).filter(T=>l.has(T));if(S.length>0){const T=ABt(A,S,{laneOf:n,rankHint:i,topoIndex:s});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=s.get(A)??0,C=s.get(S)??0;return T===C?A.localeCompare(S):T-C}),f=SBt(r),p=new Map;for(const[A,S]of f.entries())p.set(A,[...S].sort((T,C)=>T.localeCompare(C)));const g=TBt(p),m=CBt(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=O(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 o)w(A);return{parent:l,children:u,roots:d,componentOf:g,blocks:m,nodeBlocks:v,adjacency:p,preorder:y,postorder:b,topologicalOrder:o}}O(wBt,"buildDrivingTree");function ABt(t,e,r){const n=r.laneOf(t);return[...e].sort((a,o)=>{var m,v;const s=r.laneOf(a),l=r.laneOf(o),u=s!=null&&s===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[o];if(d!=null&&f!=null&&d!==f)return f-d;const p=r.topoIndex.get(a)??0,g=r.topoIndex.get(o)??0;return p!==g?p-g:a.localeCompare(o)})[0]}O(ABt,"chooseParent");function SBt(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}O(SBt,"buildAdjacency");function TBt(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 o of t.get(a)??[])e.has(o)||i.push(o)}}r++}return e}O(TBt,"assignComponents");function CBt(t){const e=new Map,r=new Map,n=[],i=[];let a=0;const o=O((s,l)=>{e.set(s,++a),r.set(s,a);for(const u of t.get(s)??[])u!==l&&(e.has(u)?(e.get(u)??0)<(e.get(s)??0)&&(n.push([s,u]),r.set(s,Math.min(r.get(s)??a,e.get(u)??a))):(n.push([s,u]),o(u,s),r.set(s,Math.min(r.get(s)??a,r.get(u)??a)),(r.get(u)??0)>=(e.get(s)??0)&&i.push(OBt(s,u,n,i.length))))},"visit");for(const s of t.keys())e.has(s)||o(s,null);return i}O(CBt,"computeBlocks");function OBt(t,e,r,n){const i=[],a=new Set;for(;r.length>0;){const o=r.pop();if(i.push(o),a.add(o[0]),a.add(o[1]),o[0]===t&&o[1]===e||o[0]===e&&o[1]===t)break}return{id:n,edges:i,nodes:[...a]}}O(OBt,"popBlock");function kBt(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,o=new Array(a).fill(-1),s=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&&(o[w]=-1,s[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&&(o[S]=x,s[S]=s[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&&(o[x]=-1,s[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;s[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),C=i.get(w);if(T==null||C==null)continue;const k=f(T,C);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=O(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 C=y(T),k=e[b];if(k!=null){let E=g.get(b);E||(E=new Map,g.set(b,E));let _=C.get(k)??0;const P=e[T];P!=null&&P>k&&(_+=1),E.set(T,_)}m(A,C)}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}O(kBt,"computeSubtreeCrossCounts");function EBt(t,e,r){const n=new Map,i=O(a=>{let o=r[a]??0;const s=[...e.get(a)??[]];s.sort(fOe(r));for(const l of s){i(l);const u=n.get(l);u!=null&&(o=Math.min(o,u))}n.set(a,o)},"annotate");for(const a of t)i(a);return n}O(EBt,"annotateMinimumLayers");function fOe(t){return(e,r)=>{const n=t[e]??0,i=t[r]??0;return n===i?e.localeCompare(r):n-i}}O(fOe,"compareByRankThenId");function _Bt(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},()=>[]),o=new Set,s=O(l=>{if(o.has(l))return;o.add(l);const u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l);for(const h of n(l))s(h)},"emit");for(const l of t)s(l);for(const l of e)if(!o.has(l)){const u=r[l]??0;a[u]||(a[u]=[]),a[u].push(l),o.add(l)}return a}O(_Bt,"emitNodesInTreeOrder");function RBt(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}O(RBt,"deduplicateLayers");function DBt(t,e,r,n){return i=>{const a=t.get(i)??[];if(a.length===0)return[];const o=e[i]??0,s=[],l=[],u=r.get(i);for(const h of a){const d=n.get(h)??o;d>o?s.push({child:h,min:d}):l.push(h)}return s.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)??o,m=n.get(d)??o;return g!==m?g-m:h.localeCompare(d)}),[...s.map(h=>h.child),...l]}}O(DBt,"createChildOrderer");function pee(t,e,r){const n=wBt(t,{rankHint:e,laneOf:r}),{children:i,roots:a}=n;for(const d of t.nodes)i.has(d)||i.set(d,[]);const o=kBt(t,e,n),s=[...a].sort(fOe(e)),l=EBt(s,i,e),u=DBt(i,e,o,l);let h=_Bt(s,t.nodes,e,u);return h=RBt(h),h}O(pee,"buildMultitreeLayerOrder");function LBt(t,e,r){const n=new Set(t),i=new Set(e),a=U4(e),o=[];for(const s of r)n.has(s.src)&&i.has(s.dst)&&o.push(a.get(s.dst));return hOe(o)}O(LBt,"countCrossingsBetweenAdjacent");function pOe(t,e,r){const n=[];for(const a of e){const o=r[a.src],s=r[a.dst];if(o==null||s==null||o===s)continue;let l=a.src,u=a.dst,h=o,d=s;o>s&&(l=a.dst,u=a.src,h=s,d=o);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=pee(t,r,i),v=pOe(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 o=t.edges.filter(m=>m.src===i);if(o.length===0)continue;let s=!1,l=0;for(const m of o){const v=r(m.dst);v==null||v===a?s=!0:l++}if(l===0||s)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)}}O(IBt,"adjustCrossLaneSources");function PBt(t,e){const r=Z2(t),n=zF(r)??[...r.nodes].sort(),i=(e==null?void 0:e.compactSingleInput)??!1,a=Q1(r);let o=Object.create(null);for(const l of n){const u=oOe(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)o[l]=0;else if(i&&h.length===1){const d=h[0].src,f=a(d),p=a(l);f!==p?o[l]=o[d]??0:o[l]=(o[d]??0)+1}else{let d=-1/0;for(const f of h)d=Math.max(d,(o[f.src]??0)+1);o[l]=d===-1/0?0:d}}return((e==null?void 0:e.optimizeRanksByCrossings)??!1)&&(o=MBt(r,o)),e!=null&&e.ignoreCrossLaneEdges&&IBt(r,o),{layers:pee(r,o,a),rankOf:o,dummy:new Set}}O(PBt,"assignLayers_LongestPath");function NBt(t,e){const r=Z2(t),i={...PBt(r,{compactSingleInput:e==null?void 0:e.compactSingleInput,ignoreCrossLaneEdges:e==null?void 0:e.ignoreCrossLaneEdges,optimizeRanksByCrossings:e==null?void 0:e.optimizeRanksByCrossings}).rankOf},a=Q1(r),{preds:o,succs:s}=hee(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=zF(r)??[...r.nodes],u=[...l].reverse(),h=O((g,m)=>{let v=0;for(const x of o.get(g)??[])v=Math.max(v,(i[x]??0)+1);let y=Number.POSITIVE_INFINITY;const b=s.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=fee.GRAVITY_ITERATIONS,f=O(g=>{let m=!1;for(const v of g){const y=o.get(v)??[],b=s.get(v)??[];if(y.length===0&&b.length===0)continue;const x=y.length>0?y.reduce((T,C)=>T+(i[C]??0)+1,0)/y.length:i[v]??0,w=b.length>0?b.reduce((T,C)=>T+(i[C]??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:uOe(r,l,i),rankOf:i,dummy:new Set}}O(NBt,"assignLayers_Gravity");function BBt(t){const e=lOe(t),r=sOe(t);let n=cOe(e);const i=[];for(;n.length>0;){const a=[];for(const o of n){i.push(o);for(const s of r.get(o)??[])e.set(s,(e.get(s)??0)-1),(e.get(s)??0)===0&&a.push(s)}n=a.sort((o,s)=>o.localeCompare(s))}return i.length===t.nodes.length?i:null}O(BBt,"topoSortByGenerationIfAcyclic");function $Bt(t,e){const r=Z2(t),n=(e==null?void 0:e.direction)==="LR"?BBt(r)??[...r.nodes].sort():zF(r)??[...r.nodes].sort(),i=Q1(r),a=O(h=>i(h)??h,"laneOf"),o=Object.create(null),s=new Map,l=O((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=oOe(r,h);let p=0;if(f.length>0)for(const y of f){const b=y.src,x=o[b]??0;p=Math.max(p,x+l(b,h))}const g=a(h),m=s.get(g)??0,v=Math.max(p,m);o[h]=v,s.set(g,v+1)}return{layers:uOe(r,n,o,{skipGroups:!0}),rankOf:o,dummy:new Set}}O($Bt,"assignLayers_LaneAwareCompact");function FBt(t,e){const r=Z2(e),{rankOf:n}=t,i=t.layers.map(p=>[...p]),a=new Set(t.dummy?[...t.dummy]:[]);let o=0;const s=new Map(r.nodeById),l=O(p=>{const g=`placeholder-${o++}`,m={id:g,isGroup:!1,isDummy:!0,width:0,height:0};for(s.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:s};return{layering:{layers:i,rankOf:n,dummy:a},graphWithDummies:f}}O(FBt,"makeProperLayering");function gOe(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])}O(gOe,"median");function mOe(t){return t.length===0?Number.POSITIVE_INFINITY:t.reduce((r,n)=>r+n,0)/t.length}O(mOe,"barycenter");function zBt(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}O(zBt,"neighborPositionsFor");function UBt(t,e,r){const n=r.get(t)??0,i=r.get(e)??0;return n!==i?n-i:t.localeCompare(e)}O(UBt,"currentOrderTieBreak");function vOe(t,e,r){const n=new Set(t),i=new Set(e),a=U4(t),o=U4(e),s=[];for(const u of r)n.has(u.src)&&i.has(u.dst)&&s.push({u:a.get(u.src),v:o.get(u.dst)});s.sort((u,h)=>u.u===h.u?u.v-h.v:u.u-h.u);const l=s.map(u=>u.v);return hOe(l)}O(vOe,"countCrossingsBetweenAdjacent");function gee(t,e,r){return[...t].sort((n,i)=>{const a=gOe(e.get(n)??[]),o=gOe(e.get(i)??[]);return a===o?UBt(n,i,r):isFinite(a)?isFinite(o)?a-o:-1:1})}O(gee,"sortByHeuristic");function yOe(t,e,r,n,i,a){const o=U4(t),s=U4(e),l=zBt(e,o,r,n);if(!i||!a||a.length===0)return gee(e,l,s);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=gee(p,l,s);h.push(...g)}const d=u.get(null);if(d&&d.length>0){const f=gee(d,l,s);for(const p of f){const g=mOe(l.get(p)??[]);let m=h.length;if(isFinite(g))for(const[v,y]of h.entries()){const b=mOe(l.get(y)??[]);if(go.has(m.src)&&s.has(m.dst)),h=l?r.filter(m=>s.has(m.src)&&l.has(m.dst)):void 0,d=O(m=>{let v=vOe(t,m,u);return h&&n&&(v+=vOe(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[...s]),i=e.edges,a=Q1(e),o=dOe(e,r==null?void 0:r.laneOrder);for(let s=0;s<3;s++){for(let l=1;l=0;l--)n[l]=yOe(n[l+1],n[l],i,"up",a,o),n[l]=bOe(n[l+1],n[l],i,n[l-1],a)}return{layers:n}}O(VBt,"orderLayers");function QBt(t,e,r){const n=(r==null?void 0:r.layerGap)??xBt.DEFAULT_LAYER_GAP,i=(r==null?void 0:r.nodeGap)??xBt.DEFAULT_NODE_GAP,a=(r==null?void 0:r.laneGap)??i*2,o=(r==null?void 0:r.direction)??"TB",s=o==="LR"||o==="RL",l=t.layers,u=Object.create(null),h=Object.create(null),d=O(E=>e.nodeById.get(E),"getNode"),f=O(E=>{var _;return((_=d(E))==null?void 0:_.width)??0},"getWidth"),p=O(E=>{var _;return((_=d(E))==null?void 0:_.height)??0},"getHeight"),g=Q1(e),m=dOe(e,r==null?void 0:r.laneOrder),v=l.map(E=>E.reduce((_,P)=>Math.max(_,p(P)),0)),y=[];if(s)for(let E=0;E+1Math.max(N,f(F)),0),P=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=(_+P)/2,I=Math.max(0,M-D-n);y.push(I)}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),P=[];for(const L of E){const R=g(L);R===null?P.push(L):(_[R]||(_[R]=[])).push(L)}for(const[L,R]of Object.entries(_)){const D=R.reduce((M,I)=>M+f(I),0)+i*Math.max(0,R.length-1);S[L]=Math.max(S[L]??0,D)}if(x&&P.length){const L=P.reduce((R,D)=>R+f(D),0)+i*Math.max(0,P.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 P=-(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=I-F/2;for(const[V,z]of M.entries()){const U=N[V];u[z]=B+U/2,h[z]=C+P/2,B+=U+i}}}const R=y[E]??0;C+=P+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,P=_.start,L=_.end;if(P==null||L==null)continue;const R=Math.round(((u[P]??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===P||M===L)continue;const I=e.nodeById.get(M);I!=null&&I.isDummy&&(u[M]=R)}}return{x:u,y:h}}O(QBt,"assignCoordinates");var GBt=8;function HBt(t){let e=2166136261;for(let r=0;r>>0}O(HBt,"hashString");function WBt(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}}O(WBt,"mulberry32");function YBt(t,e){const r=[...t],n=WBt(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}O(YBt,"deterministicShuffle");function qBt(t,e){let r=0;for(const[n,i]of t.entries())r+=Math.abs(n-(e.get(i)??n));return r}O(qBt,"sourceDistance");function xOe(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:o}of e){const s=r.get(i),l=r.get(a);s==null||l==null||(n+=o*Math.abs(s-l))}return n}O(xOe,"laneArrangementCost");function jBt(t){const e=dee(t);if(e.length<2)return[];const r=new Map(e.map((a,o)=>[a,o])),n=Q1(t),i=new Map;for(const a of t.layout.edges??[]){if(a.isLayoutOnly)continue;const o=typeof a.start=="string"?a.start:void 0,s=typeof a.end=="string"?a.end:void 0;if(!o||!s||!t.nodeById.has(o)||!t.nodeById.has(s))continue;const l=n(o),u=n(s);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()]}O(jBt,"buildWeightedLaneEdges");function wOe(t,e,r){const n=[...t];let i=xOe(n,e),a=!0,o=0;const s=Math.max(1,n.length);for(;a&&oi.a===a.a?i.b.localeCompare(a.b):i.a.localeCompare(a.a)).map(({a:i,b:a,weight:o})=>`${i}:${a}:${o}`).join("|");return HBt(`${t.join("|")}#${n}#${r}`)}O(KBt,"seedForRestart");function ZBt(t,e={}){const r=dee(t);if(r.length<2)return r;const n=jBt(t);if(n.length===0)return r;const i=new Map(r.map((s,l)=>[s,l]));let a=wOe(r,n,i);const o=Math.max(0,e.restarts??GBt);for(let s=0;sri&&l*3>=s?o>0?"bottom":"top":s>ri?a>0?"right":"left":r}O(SOe,"chooseOrthogonalSide");function TOe(t,e){return Math.abs(t.to-e.from)Z.isGroup&&!Z.parentId);for(const Z of u){const le={id:Z.id},be=O(ae=>{o.set(ae.id,le),r.filter(K=>K.parentId===ae.id).forEach(be)},"assignLane");be(Z)}const h=r.filter(Z=>!Z.isGroup&&!Z.isEdgeLabel).map(Z=>{const le=Z.width??10,be=Z.height??10,ae=Z.x??0,K=Z.y??0,se=vPn;return{nodeId:Z.id,minX:ae-le/2-se,maxX:ae+le/2+se,minY:K-be/2-se,maxY:K+be/2+se,visualXHalfExtent:l?be/2+se:le/2+se}}),d=O((Z,le,be,ae)=>{let K=s.find(se=>se.orientation===Z&&Math.abs(se.coord-le)<1);return K||(K={id:`pipe-${Z}-${le.toFixed(0)}`,orientation:Z,coord:le,spanMin:be,spanMax:ae,tracks:[]},s.push(K)),K.spanMin=Math.min(K.spanMin,be),K.spanMax=Math.max(K.spanMax,ae),K},"getOrAddPipe"),f=O((Z,le)=>{const be=Z.width??10,ae=Z.height??10,K=Z.x??0,se=Z.y??0;switch(le){case"top":return{x:K,y:se-ae/2};case"bottom":return{x:K,y:se+ae/2};case"left":return{x:K-be/2,y:se};case"right":return{x:K+be/2,y:se}}},"portForSide"),p=O((Z,le,be)=>f(Z,SOe(Z,le,be?"bottom":"top")),"getOrthogonalPort"),g=[],m=[],v=new Set,y=1e3,b=O((Z,le,be)=>{if(g.length===0)return 0;const ae=Math.abs(le.y-be.y)ve||ce.from-ri<=me&&ce.to+ri>=me&&(se+=y)}else if(K){const me=le.x,oe=Math.min(le.y,be.y)-ri,ve=Math.max(le.y,be.y)+ri;if(ve<=oe)return 0;for(const ce of g)ce.edgeIndex===Z||ce.orientation!=="horizontal"||ce.pipe.coordve||ce.from-ri<=me&&ce.to+ri>=me&&(se+=y)}return se},"crossingPenalty"),x=i.map((Z,le)=>{if(!Z.start||!Z.end)return{idx:le,crossLane:0,dx:0,dy:0};const be=a.get(Z.start),ae=a.get(Z.end),K=o.get(Z.start),se=o.get(Z.end),me=K&&se&&K.id!==se.id?1:0,oe=be&&ae?Math.abs((ae.x??0)-(be.x??0)):0,ve=be&&ae?Math.abs((ae.y??0)-(be.y??0)):0;return{idx:le,crossLane:me,dx:oe,dy:ve}}).sort((Z,le)=>{if(Z.crossLane!==le.crossLane)return le.crossLane-Z.crossLane;const be=Z.dx+Z.dy,ae=le.dx+le.dy;return Math.abs(be-ae)>1?be-ae:Z.idx-le.idx}).map(Z=>Z.idx),w=O((Z,le,be,ae)=>{const K=Math.min(Z.x,le.x),se=Math.max(Z.x,le.x),me=Math.min(Z.y,le.y),oe=Math.max(Z.y,le.y);return!!h.find(ce=>be&&ce.nodeId===be||ae&&ce.nodeId===ae?!1:Math.abs(Z.x-le.x)>ri?ce.minYZ.y&&ce.maxX>K&&ce.minXZ.x&&ce.maxY>me&&ce.minYSOe(Z,le,"bottom"),"determineSide"),C=new Map;for(const[Z,le]of i.entries()){if(!le.start||!le.end||le.start===le.end||le.points&&le.points.length>0)continue;const be=a.get(le.start),ae=a.get(le.end);if(!be||!ae)continue;const K=(ae.x??0)-(be.x??0),se=(ae.y??0)-(be.y??0);C.set(Z,{edgeIdx:Z,srcId:le.start,dstId:le.end,srcSide:T(be,{x:ae.x??0,y:ae.y??0}),dstSide:T(ae,{x:be.x??0,y:be.y??0}),absDx:Math.abs(K),absDy:Math.abs(se),dxSign:Math.sign(K),dySign:Math.sign(se)})}const k=O(Z=>Z.srcSide==="top"||Z.srcSide==="bottom"?Z.absDx===0?1/0:Z.absDy/Z.absDx:Z.absDy===0?1/0:Z.absDx/Z.absDy,"preferenceStrength"),E=O(Z=>Z.srcSide==="top"||Z.srcSide==="bottom"?Z.dxSign>=0?"right":"left":Z.dySign>=0?"bottom":"top","secondarySide"),_=new Map;for(const Z of C.values()){const le=`${Z.srcId}:${Z.srcSide}`;_.has(le)||_.set(le,[]),_.get(le).push(Z)}const P=new Map,L=O((Z,le)=>`${Z}:${le}`,"loadKey");for(const Z of C.values())P.set(L(Z.srcId,Z.srcSide),(P.get(L(Z.srcId,Z.srcSide))??0)+1),P.set(L(Z.dstId,Z.dstSide),(P.get(L(Z.dstId,Z.dstSide))??0)+1);for(const Z of _.values())if(!(Z.length<2)){Z.sort((le,be)=>{const ae=k(le),K=k(be);return Math.abs(ae-K)>1e-9?K-ae:le.edgeIdx-be.edgeIdx});for(let le=1;le=K||(P.set(L(be.srcId,be.srcSide),K-1),P.set(L(be.srcId,ae),se+1),be.srcSide=ae)}}const R=O(Z=>{const le=Z==null?void 0:Z.shape;return le==="question"||le==="diamond"},"isDiamondNode"),D=new Map;for(const Z of C.values())D.has(Z.dstId)||D.set(Z.dstId,new Set),D.get(Z.dstId).add(Z.dstSide);for(const Z of C.values()){if(!R(a.get(Z.srcId)))continue;const le=D.get(Z.srcId);if(!(le!=null&&le.has(Z.srcSide)))continue;const be=E(Z);if(le.has(be)||(P.get(L(Z.srcId,be))??0)>0)continue;const ae=P.get(L(Z.srcId,Z.srcSide))??0;P.set(L(Z.srcId,Z.srcSide),Math.max(0,ae-1)),P.set(L(Z.srcId,be),1),Z.srcSide=be}for(const Z of C.values()){const{edgeIdx:le,srcId:be,dstId:ae,srcSide:K,dstSide:se}=Z,me=a.get(be),oe=a.get(ae),ve=`${be}:${K}:src`,ce=K==="top"||K==="bottom"?oe.x??0:oe.y??0;A.has(ve)||A.set(ve,[]),A.get(ve).push({edgeIdx:le,oppositeCoord:ce});const De=`${ae}:${se}:dst`,Le=se==="top"||se==="bottom"?me.x??0:me.y??0;A.has(De)||A.set(De,[]),A.get(De).push({edgeIdx:le,oppositeCoord:Le})}const M=new Map,I=8;for(const[Z,le]of A){if(le.length<2)continue;le.sort((Ze,He)=>Ze.oppositeCoord-He.oppositeCoord);const be=Z.split(":"),ae=be.slice(0,-2).join(":"),K=be[be.length-2],se=be[be.length-1],me=a.get(ae);if(!me)continue;const ve=K==="left"||K==="right"?me.height??10:me.width??10,ce=me.shape,Le=ce==="question"||ce==="diamond"?ve*.3:ve,Ne=Math.min(20,Math.max(I,Le/(le.length+1))),$e=-(Ne*(le.length-1))/2;for(const[Ze,He]of le.entries()){const et=$e+Ze*Ne,Pe=`${He.edgeIdx}:${se}`;M.set(Pe,et)}}const N=O(Z=>{var le;return!!((le=i[Z])!=null&&le.labelNodeId)},"edgeHasLabelNode"),F=O((Z,le)=>Z?(A.get(`${Z}:${le}:src`)??[]).some(({edgeIdx:be})=>N(be))||(A.get(`${Z}:${le}:dst`)??[]).some(({edgeIdx:be})=>N(be)):!1,"faceHasLabelNode"),B=O((Z,le,be)=>le==="top"||le==="bottom"?{x:Z.x+be,y:Z.y}:{x:Z.x,y:Z.y+be},"applyPortOffset"),V=O((Z,le,be)=>{const ae=C.get(Z),K={x:be.x??0,y:be.y??0},se={x:le.x??0,y:le.y??0},me=(ae==null?void 0:ae.srcSide)??T(le,K),oe=(ae==null?void 0:ae.dstSide)??T(be,se);let ve=ae?f(le,ae.srcSide):p(le,K,!0),ce=ae?f(be,ae.dstSide):p(be,se,!1);const De=M.get(`${Z}:src`),Le=M.get(`${Z}:dst`);return De!==void 0&&(ve=B(ve,me,De)),Le!==void 0&&(ce=B(ce,oe,Le)),{pSrcPort:ve,pDstPort:ce,srcSide:me,dstSide:oe}},"portsForEdge");for(const Z of x){const le=i[Z];if(m[Z]=[],!le.start||!le.end||le.points&&le.points.length>0||le.start===le.end)continue;const be=a.get(le.start),ae=a.get(le.end);if(!be||!ae)continue;const{pSrcPort:K,pDstPort:se,srcSide:me,dstSide:oe}=V(Z,be,ae),ve={...K},ce={...se},De=me==="top"||me==="bottom",Le=oe==="top"||oe==="bottom";if(De){const pt=K.y>(be.y??0);ve.y=pt?K.y+Dp:K.y-Dp}else{const pt=K.x>(be.x??0);ve.x=pt?K.x+Dp:K.x-Dp}if(Le){const pt=se.y>(ae.y??0);ce.y=pt?se.y+Dp:se.y-Dp}else{const pt=se.x>(ae.x??0);ce.x=pt?se.x+Dp:se.x-Dp}const We=O((pt,Ct)=>{for(const or of h)if(!Ct.includes(or.nodeId)&&pt.x>or.minX&&pt.xor.minY&&pt.y{if(Mn){const Vt=pt.y>(Ct.y??0);return{x:(or.x??0)>=pt.x?Jr.maxX+UC:Jr.minX-UC,y:Vt?Jr.maxY+V4:Jr.minY-V4,leavesPositiveSide:Vt}}const Rt=pt.x>(Ct.x??0),Ot=(or.y??0)>=pt.y;return{x:Rt?Jr.maxX+UC:Jr.minX-UC,y:Ot?Jr.maxY+V4:Jr.minY-V4,leavesPositiveSide:Rt}},"obstacleDetour");let je=[];const $e=[le.start,le.end],Ze=We(ve,$e);if(Ze.inside&&Ze.obstacle){const pt=Ze.obstacle;if(De){const Ct=Ne(K,be,ae,pt,!0);ve.x=Ct.x,ve.y=Ct.y;const or=Ct.leavesPositiveSide?Math.min(pt.minY-2,K.y+Dp):Math.max(pt.maxY+2,K.y-Dp);je=[{x:K.x,y:or},{x:Ct.x,y:or},{x:Ct.x,y:Ct.y}]}else{const Ct=Ne(K,be,ae,pt,!1),or=Ct.leavesPositiveSide?Math.min(pt.minX-2,K.x+Dp):Math.max(pt.maxX+2,K.x-Dp);ve.x=Ct.x,ve.y=Ct.y,je=[{x:or,y:K.y},{x:or,y:Ct.y},{x:Ct.x,y:Ct.y}]}}let He=[];const et=We(ce,$e);if(et.inside&&et.obstacle){const pt=et.obstacle;if(Le){const Ct=Ne(se,ae,be,pt,!0);ce.x=Ct.x,ce.y=Ct.y,He=[{x:Ct.x,y:Ct.y},{x:se.x,y:Ct.y}]}else{const Ct=Ne(se,ae,be,pt,!1);ce.x=Ct.x,ce.y=Ct.y,He=[{x:Ct.x,y:Ct.y},{x:Ct.x,y:se.y}]}}if(je.length===0&&He.length===0){const pt=UC,Ct=Math.abs(ve.x-ce.x)1||Rt>1,Vt=S.get(le.start??"")??0,mt=S.get(le.end??"")??0,Tr=Mn>1&&F(le.start,me)||Rt>1&&F(le.end,oe),Fe=Mn<=1||Vt<=2,ta=Rt<=1||mt<=2;if((Ct||or)&&!Jr&&(!Ot||Ot&&!Tr&&Fe&&ta)&&!w(K,se,le.start,le.end)){le.points=[{...K},{...ve},{...ce},{...se}],v.add(Z);const hi=or?"horizontal":"vertical",Bo=or?K.y:K.x,Gn=or?Math.min(K.x,se.x):Math.min(K.y,se.y),fa=or?Math.max(K.x,se.x):Math.max(K.y,se.y),di={id:`fast-path-${hi}-${Bo.toFixed(0)}-${Z}`,orientation:hi,coord:Bo,spanMin:Gn,spanMax:fa,tracks:[]};g.push({edgeIndex:Z,segmentIndex:0,orientation:hi,pipe:di,trackIndex:0,from:Gn,to:fa});continue}}const Pe=d("vertical",ve.x,ve.y,ve.y);ve.x=Pe.coord;const yt=d("vertical",ce.x,ce.y,ce.y);ce.x=yt.coord;let Ie=Math.min(ve.x,ce.x)-50,St=Math.max(ve.x,ce.x)+50,kt=Math.min(ve.y,ce.y)-50,ut=Math.max(ve.y,ce.y)+50;for(const pt of h){const Ct=Math.min(ve.x,ce.x),or=Math.max(ve.x,ce.x),Jr=Math.min(ve.y,ce.y),Mn=Math.max(ve.y,ce.y);pt.minXCt&&pt.minYJr&&(Ie=Math.min(Ie,pt.minX-mee),St=Math.max(St,pt.maxX+mee),kt=Math.min(kt,pt.minY-mee),ut=Math.max(ut,pt.maxY+mee))}for(const pt of h){if(pt.maxXSt||pt.maxYut)continue;const Ct=UC;d("horizontal",pt.minY-Ct,Ie,St),d("horizontal",pt.maxY+Ct,Ie,St);const or=V4;d("vertical",pt.minX-or,kt,ut),d("vertical",pt.maxX+or,kt,ut)}d("horizontal",ve.y,Ie,St),d("horizontal",ce.y,Ie,St);const Gt=s.filter(pt=>pt.orientation==="horizontal"&&pt.coord>=kt&&pt.coord<=ut),It=s.filter(pt=>pt.orientation==="vertical"&&pt.coord>=Ie&&pt.coord<=St),gt=O((pt,Ct)=>`${pt.toFixed(1)},${Ct.toFixed(1)}`,"getKey"),Te=gt(ve.x,ve.y),Bt=gt(ce.x,ce.y),Et=new Map,At=new Map,Mt=new Map,qr=new Set,Me=[];Et.set(Te,0),Mt.set(Te,"n"),Me.push({key:Te,f:Math.hypot(ce.x-ve.x,ce.y-ve.y),pt:ve}),qr.add(Te);let at=[];const wt=O((pt,Ct)=>w(pt,Ct,le.start,le.end),"checkSegmentBlocked"),Tt={x:ce.x,y:ve.y},dr=wt(ve,Tt),jr=wt(Tt,ce),Ir=dr||jr,Zr={x:ve.x,y:ce.y},Ur=wt(ve,Zr),kn=wt(Zr,ce);if(Ir?Ur||kn||(Math.abs(ve.x-ce.x)0;){Me.sort((mt,Tr)=>mt.f-Tr.f);const pt=Me.shift();if(qr.delete(pt.key),pt.key===Bt){let mt=Bt,Tr=ce;for(at=[Tr];At.has(mt);){const Fe=At.get(mt);at.unshift(Fe),Tr=Fe,mt=gt(Fe.x,Fe.y)}break}const Ct=pt.pt.x,or=pt.pt.y,Jr=It.sort((mt,Tr)=>mt.coord-Tr.coord),Mn=Jr.findIndex(mt=>Math.abs(mt.coord-Ct)<1),Rt=Gt.sort((mt,Tr)=>mt.coord-Tr.coord),Ot=Rt.findIndex(mt=>Math.abs(mt.coord-or)<1),Vt=[];Mn>0&&Vt.push({x:Jr[Mn-1].coord,y:or}),Mn>=0&&Mn0&&Vt.push({x:Ct,y:Rt[Ot-1].coord}),Ot>=0&&OtZs.nodeId===le.start||Zs.nodeId===le.end?!1:Tr!==Fe?Zs.minYor&&Zs.maxX>Tr&&Zs.minXCt&&Zs.maxY>ta&&Zs.minY10&&Ov<-5||vu<-10&&Ov>5)&&(fa=Math.abs(Ov)*100),(di>10&&sm<-5||di<-10&&sm>5)&&(fa+=Math.abs(sm)*50);let Sk=0;const Tk=Mt.get(pt.key)??"n",Ck=Math.abs(sm)>ri?"h":"v";Tk!=="n"&&Tk!==Ck&&(Sk=50);const xl=Bo+Gn+fa+Sk,gd=(Et.get(pt.key)??1/0)+xl,$c=Math.abs(ce.x-mt.x)+Math.abs(ce.y-mt.y);if(gd<(Et.get(hi)??1/0))if(At.set(hi,pt.pt),Et.set(hi,gd),Mt.set(hi,Ck),!qr.has(hi))Me.push({key:hi,f:gd+$c,pt:mt}),qr.add(hi);else{const Zs=Me.findIndex(Of=>Of.key===hi);Zs!==-1&&(Me[Zs].f=gd+$c)}}}if(at.length===0&&(at=[ve,{x:ve.x,y:ce.y},ce]),at.length>4){const pt=at[0],Ct=at[at.length-1];let or=Math.min(pt.x,Ct.x),Jr=Math.max(pt.x,Ct.x),Mn=Math.min(pt.y,Ct.y),Rt=Math.max(pt.y,Ct.y);for(const ta of at)or=Math.min(or,ta.x),Jr=Math.max(Jr,ta.x),Mn=Math.min(Mn,ta.y),Rt=Math.max(Rt,ta.y);const Ot=Jr>Math.max(pt.x,Ct.x),Vt=orGn.minXQe&&Gn.minYIn);if(Bo.length>0){let Gn=Math.max(pt.x,Ct.x);for(const fa of Bo){const di=(fa.minX+fa.maxX)/2;if(fa.visualXHalfExtent===void 0||isNaN(fa.visualXHalfExtent))continue;const vu=di+fa.visualXHalfExtent+ta;Gn=Math.max(Gn,vu)}isNaN(Gn)||(Jr=Gn)}}if(Vt){const Qe=h.filter(In=>In.minXMath.min(pt.y,Ct.y));if(Qe.length>0){let In=Math.min(pt.x,Ct.x);for(const hi of Qe){const Gn=(hi.minX+hi.maxX)/2-hi.visualXHalfExtent-ta;In=Math.min(In,Gn)}or=In}}}const mt=O(ta=>{const Qe=Ct.y>pt.y,In=h.filter(Gn=>{const fa=Math.min(pt.x,Ct.x)Gn.minX,di=Math.min(pt.y,Ct.y)Gn.minY;return fa&&di});let hi=In;if(l&&In.length>0){const Gn=In.filter(fa=>fa.minXta);Gn.length>0&&(hi=Gn)}if(hi.length===0)return Ct.y;const Bo=UC;if(Qe){const fa=Math.max(...hi.map(di=>di.maxY))+Bo;if(fadi.minY))-Bo;if(fa>Ct.y+ri)return fa}return Ct.y},"findBestReturnY"),Tr=O(ta=>{const Qe=mt(ta),In={x:ta,y:pt.y},hi={x:ta,y:Qe},Bo={x:Ct.x,y:Qe},Gn=wt(pt,In),fa=wt(In,hi),di=wt(hi,Bo),vu=Qe!==Ct.y?wt(Bo,Ct):!1;return!Gn&&!fa&&!di&&!vu?Math.abs(Qe-Ct.y)=3){const pt=dn[dn.length-1],Ct=dn[dn.length-2],or=dn[dn.length-3],Jr=Math.abs(or.y-Ct.y)Math.abs(pt.x-or.x)&&dn.splice(-2,1)}else if(Mn){const Rt=Math.sign(Ct.y-or.y),Ot=Math.sign(pt.y-or.y);Rt!==0&&Rt===Ot&&Math.abs(Ct.y-or.y)>Math.abs(pt.y-or.y)&&dn.splice(-2,1)}}const ii=[dn[0]];for(let pt=1;ptCt.x,Rt=Jr.x>or.x;if(Mn!==Rt){ii.push(or);continue}continue}if(Math.abs(Ct.x-or.x)Ct.y,Rt=Jr.y>or.y;if(Mn!==Rt){ii.push(or);continue}continue}ii.push(or)}ii.push(dn[dn.length-1]);for(let pt=0;ptZ.from{const K=!ae.segments.some(me=>(me.edgeIndex!==le.edgeIndex||me.segmentIndex!==le.segmentIndex)&&z(me,Z)),se=!be.segments.some(me=>(me.edgeIndex!==Z.edgeIndex||me.segmentIndex!==Z.segmentIndex)&&z(me,le));return K&&se?(Z.trackIndex=ae.index,le.trackIndex=be.index,be.segments=[...be.segments.filter(me=>me.edgeIndex!==Z.edgeIndex||me.segmentIndex!==Z.segmentIndex),{edgeIndex:le.edgeIndex,segmentIndex:le.segmentIndex,from:le.from,to:le.to}],ae.segments=[...ae.segments.filter(me=>me.edgeIndex!==le.edgeIndex||me.segmentIndex!==le.segmentIndex),{edgeIndex:Z.edgeIndex,segmentIndex:Z.segmentIndex,from:Z.from,to:Z.to}],!0):!1},"trySwapSegmentsAcrossTracks"),Q=O(Z=>{const le=Z.tracks.length;return Z.tracks[le]={index:le,coord:Z.coord,segments:[]},le},"createNewTrack"),G=O((Z,le)=>{const be=Z.pipe.tracks[Z.trackIndex];be.segments=be.segments.filter(K=>K.edgeIndex!==Z.edgeIndex||K.segmentIndex!==Z.segmentIndex),Z.trackIndex=le,Z.pipe.tracks[le].segments.push({edgeIndex:Z.edgeIndex,segmentIndex:Z.segmentIndex,from:Z.from,to:Z.to})},"moveSegmentToTrack"),q=O((Z,le)=>{const be=m[Z.edgeIndex];for(const ae of be){const K=g[ae];K.pipe===Z.pipe&&G(K,le)}},"moveSegmentChainToTrack"),Y=O(Z=>{const le=m[Z.edgeIndex],be=le.indexOf(g.indexOf(Z)),ae=[];return be>0&&ae.push(g[le[be-1]]),be{if(Z.orientation===le.orientation)return!1;const be=Z.orientation==="horizontal"?Z:le,ae=Z.orientation==="horizontal"?le:Z;return ae.pipe.coord>be.from&&ae.pipe.coordae.from&&be.pipe.coord{for(const be of Z.tracks)if(!be.segments.some(K=>(K.edgeIndex!==le.edgeIndex||K.segmentIndex!==le.segmentIndex)&&z(K,le)))return be.index;return-1},"findAvailableTrack"),J=O((Z,le)=>{if(Z.trackIndex===le.trackIndex)return z(Z,le);const be=Y(Z),ae=Y(le);return be.some(K=>ae.some(se=>ne(K,se)))},"segmentsConflict"),ee=O((Z,le,be)=>{if(U(Z,le,Z.pipe.tracks[Z.trackIndex],le.pipe.tracks[le.trackIndex]))return;const ae=X(Z.pipe,le);be(le,ae!==-1?ae:Q(Z.pipe))},"resolveTrackConflict"),te=O(Z=>{let le=0;for(let be=0;be{if(pe.has(Z))return pe.get(Z);const le=m[Z];if(le.length===0){const oe={dest:0,deviation:0,base:0,delta:0};return pe.set(Z,oe),oe}const ae=g[le[0]].pipe.coord;let K=ae;for(let oe=1;oeMath.abs(De-ae)?ce:De;break}}const se=Math.abs(K-ae),me={dest:K,deviation:se,base:ae,delta:K-ae};return pe.set(Z,me),me},"getDestInfo"),Ce=O(()=>{let Z=0;const le=new Map;for(const[ae,K]of i.entries())m[ae].length!==0&&K.start&&(le.has(K.start)||le.set(K.start,[]),le.get(K.start).push(ae));const be=O(ae=>{const K=i[ae];if(!K.start||!K.end)return 0;const se=a.get(K.start),me=a.get(K.end);if(!se||!me)return 0;const oe=(me.x??0)-(se.x??0),ve=(me.y??0)-(se.y??0);return Math.abs(oe)+Math.abs(ve)},"getEdgeDistance");for(const ae of le.values()){ae.sort((se,me)=>{const oe=ie(se),ve=ie(me);if(Math.abs(oe.deviation-ve.deviation)>1)return oe.deviation-ve.deviation;if(Math.abs(oe.dest-ve.dest)>1)return oe.dest-ve.dest;const ce=be(se),De=be(me);if(Math.abs(ce-De)>1)return De-ce;const Le=m[se].length,We=m[me].length;if(Le!==We)return Le-We;if(Le===1){const Ne=m[se][0],je=m[me][0];if(g[Ne]&&g[je]){const $e=g[Ne],Ze=g[je],He=Math.abs($e.to-$e.from),et=Math.abs(Ze.to-Ze.from);if(Math.abs(He-et)>1)return He-et}}return 0});const K=ae.map(se=>g[m[se][0]]);Z+=te(K)}return Z},"fixSourceHandleCrossings"),ke=O(()=>{let Z=0;const le=new Map;for(const[be,ae]of i.entries())m[be].length!==0&&ae.end&&(le.has(ae.end)||le.set(ae.end,[]),le.get(ae.end).push(be));for(const be of le.values()){be.sort((K,se)=>{const me=O(ce=>{const De=m[ce];if(De.length<2)return 0;const Le=g[De[De.length-2]];return Math.abs(Le.to-Le.from)},"getDist"),oe=me(K),ve=me(se);return Math.abs(oe-ve)>.1?oe-ve:K-se});const ae=be.map(K=>g[m[K][m[K].length-1]]);Z+=te(ae)}return Z},"fixTargetHandleCrossings"),Ee=O(()=>{let Z=0;for(const le of s){const be=[];for(const ae of le.tracks)for(const K of ae.segments){const se=m[K.edgeIndex].find(me=>g[me].segmentIndex===K.segmentIndex);se!==void 0&&be.push(g[se])}be.sort((ae,K)=>ae.edgeIndex-K.edgeIndex||ae.segmentIndex-K.segmentIndex);for(let ae=0;ae{ae.segments.forEach(K=>{le.push({edgeIndex:K.edgeIndex,segmentIndex:K.segmentIndex,trackIndex:ae.index,from:K.from,to:K.to})})}),le.sort((ae,K)=>ae.from-K.from);const be=[];if(le.length>0){let ae=[le[0]],K=le[0].to;for(let se=1;seK.add(Ne.trackIndex));const se=new Map;ae.forEach(Ne=>{const je=ie(Ne.edgeIndex);se.set(Ne.trackIndex,(se.get(Ne.trackIndex)??0)+je.delta)});const me=[...K].filter(Ne=>(se.get(Ne)??0)<-1),oe=[...K].filter(Ne=>(se.get(Ne)??0)>1),ve=[...K].filter(Ne=>Math.abs(se.get(Ne)??0)<=1);me.sort((Ne,je)=>(se.get(je)??0)-(se.get(Ne)??0)),oe.sort((Ne,je)=>(se.get(Ne)??0)-(se.get(je)??0));const ce=O((Ne,je)=>{ae.filter($e=>$e.trackIndex===Ne).forEach($e=>{const Ze=v.has($e.edgeIndex)?Z.coord:je;xe.set(`${$e.edgeIndex}-${$e.segmentIndex}`,Ze)})},"assignCoord");let De=0;for(const Ne of me)De++,ce(Ne,Z.coord-De*AOe);if(ve.length===0&&K.size>0){const Ne=[...K].sort((Ze,He)=>Math.abs(se.get(Ze)??0)-Math.abs(se.get(He)??0))[0],je=me.indexOf(Ne);je!==-1&&me.splice(je,1);const $e=oe.indexOf(Ne);$e!==-1&&oe.splice($e,1),ve.push(Ne)}let Le=0;for(const Ne of ve){if(Le===0)ce(Ne,Z.coord);else{const je=Le%2===1?1:-1,$e=Math.ceil(Le/2);ce(Ne,Z.coord+je*$e*AOe*.5)}Le++}let We=0;for(const Ne of oe)We++,ce(Ne,Z.coord+We*AOe)}}for(const[Z,le]of i.entries()){const be=m[Z]??[];if(be.length===0)continue;const ae=[],K=a.get(le.start),se=a.get(le.end),{pSrcPort:me,pDstPort:oe}=V(Z,K,se),ve=be.map(Le=>{const We=g[Le],Ne=xe.get(`${We.edgeIndex}-${We.segmentIndex}`)??We.pipe.coord;return{orient:We.orientation,coord:Ne,from:We.from,to:We.to}});ae.push(me);for(let Le=0;Leri&&ae.push(VC(We,je)),He&&Ze.orient===We.orient)if(Math.abs(We.coord-Ze.coord)>ri){const et=We.orient==="vertical"?(je+Ze.from)/2:TOe(We,Ze);ae.push(VC(We,et),VC(Ze,et))}else(Le===0||Le===ve.length-2)&&ae.push(VC(We,TOe(We,Ze)));else if(He)ae.push(VC(We,Ze.coord));else{const et=Math.abs(We.from-je)ri||Math.abs(ce.y-oe.y)>ri)&&ae.push(oe);const De=[];ae.length>0&&De.push(ae[0]);for(let Le=1;Leri||Math.abs(We.y-Ne.y)>ri)&&De.push(We)}le.points=De}for(const Z of i){const le=Z.__originalEdge;le&&Z.points&&(le.points=Z.points)}t.edges=(t.edges??[]).filter(Z=>!Z.isLayoutOnly);const ge=O((Z,le)=>{const be=le.x??0,ae=le.y??0,K=le.width??0,se=le.height??0;if(K<=0||se<=0)return Z;const me=be-K/2,oe=be+K/2,ve=ae-se/2,ce=ae+se/2;if(Z.xoe||Z.yce)return Z;const De=Z.x-me,Le=oe-Z.x,We=Z.y-ve,Ne=ce-Z.y,je=Math.min(De,Le,We,Ne);return je===De?{x:me,y:Z.y}:je===Le?{x:oe,y:Z.y}:je===We?{x:Z.x,y:ve}:{x:Z.x,y:ce}},"nodeBoundaryClamp");for(const Z of t.edges){const le=Z.points;if(!le||le.length<2)continue;const be=Z.start,ae=Z.end,K=be?a.get(be):void 0,se=ae?a.get(ae):void 0;K&&(le[0]=ge(le[0],K)),se&&(le[le.length-1]=ge(le[le.length-1],se))}return t}O(e7t,"routeEdgesOrthogonal");function t7t(t){return t.direction??"TB"}O(t7t,"getSwimlaneDirection");function r7t(t){var h,d,f,p,g;const e=I8t(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,o=((g=t.config.swimlane)==null?void 0:g.automaticLaneOrdering)??!1,s=t7t(t),{ordered:l,coordinates:u}=JBt(e,{nodeGap:r,layerGap:n,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:o,direction:s});P8t(e,l,u,{nodeGap:r,layerGap:n});for(const m of t.edges??[])delete m.points;e7t(t,s);for(const m of t.edges??[])(!m.curve||m.curve==="basis")&&(m.curve="rounded");return mBt(t,s),gBt(t),s}O(r7t,"runSwimlaneLayoutCore");async function n7t(t,e){const r=e.select("g");n2e(r,t.markers,t.type,t.diagramId),Hkt(),jkt(),fOt(),NNt(),M8t(t);const n=N8t(t);t.nodes=n.nodes,t.edges=n.edges;const{groups:i}=await v8t(r,t);r7t(t),await _8t(t,i)}O(n7t,"render");const yPn=Object.freeze(Object.defineProperty({__proto__:null,render:n7t},Symbol.toStringTag,{value:"Module"}));function COe(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,o=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{o||r.return==null||r.return()}finally{if(s)throw a}}}}function i7t(t,e,r){return(e=a7t(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function APn(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function SPn(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,s=[],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)&&(s.push(n.value),s.length!==e);l=!0);}catch(h){u=!0,i=h}finally{try{if(!l&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}function TPn(){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 CPn(){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 qs(t,e){return bPn(t)||SPn(t,e)||OOe(t,e)||TPn()}function vee(t){return xPn(t)||APn(t)||OOe(t)||CPn()}function OPn(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 a7t(t){var e=OPn(t,"string");return typeof e=="symbol"?e:e+""}function dl(t){"@babel/helpers - typeof";return dl=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},dl(t)}function OOe(t,e){if(t){if(typeof t=="string")return COe(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)?COe(t,e):void 0}}var fl=typeof window>"u"?null:window,o7t=fl?fl.navigator:null;fl&&fl.document;var kPn=dl(""),s7t=dl({}),EPn=dl(function(){}),_Pn=typeof HTMLElement>"u"?"undefined":dl(HTMLElement),UF=function(e){return e&&e.instanceString&&Io(e.instanceString)?e.instanceString():null},Yr=function(e){return e!=null&&dl(e)==kPn},Io=function(e){return e!=null&&dl(e)===EPn},Ma=function(e){return!pf(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Bi=function(e){return e!=null&&dl(e)===s7t&&!Ma(e)&&e.constructor===Object},RPn=function(e){return e!=null&&dl(e)===s7t},sr=function(e){return e!=null&&dl(e)===dl(1)&&!isNaN(e)},l7t=function(e){return sr(e)&&Math.floor(e)===e},yee=function(e){if(_Pn!=="undefined")return e!=null&&e instanceof HTMLElement},pf=function(e){return VF(e)||c7t(e)},VF=function(e){return UF(e)==="collection"&&e._private.single},c7t=function(e){return UF(e)==="collection"&&!e._private.single},kOe=function(e){return UF(e)==="core"},u7t=function(e){return UF(e)==="stylesheet"},DPn=function(e){return UF(e)==="event"},tw=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},LPn=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},MPn=function(e){return Bi(e)&&sr(e.x1)&&sr(e.x2)&&sr(e.y1)&&sr(e.y2)},IPn=function(e){return RPn(e)&&Io(e.then)},PPn=function(){return o7t&&o7t.userAgent.match(/msie|trident|edge/i)},Q4=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var a=[],o=0;or?1:0},VPn=function(e,r){return-1*f7t(e,r)},ln=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("^"+$Pn+"$").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,o=d[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(i===0)s=l=u=Math.round(a*255);else{var f=a<.5?a*(1+i):a+i-a*i,p=2*a-f;s=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=[s,l,u,o]}return r},HPn=function(e){var r,n=new RegExp("^"+NPn+"$").exec(e);if(n){r=[];for(var i=[],a=1;a<=3;a++){var o=n[a];if(o[o.length-1]==="%"&&(i[a]=!0),o=parseFloat(o),i[a]&&(o=o/100*255),o<0||o>255)return;r.push(Math.floor(o))}var s=i[1]||i[2]||i[3],l=i[1]&&i[2]&&i[3];if(s&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},WPn=function(e){return YPn[e.toLowerCase()]},p7t=function(e){return(Ma(e)?e:null)||WPn(e)||QPn(e)||HPn(e)||GPn(e)},YPn={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]},g7t=function(e){for(var r=e.map,n=e.keys,i=n.length,a=0;a=l||R<0||b&&D>=f}function C(){var L=e();if(T(L))return k(L);g=setTimeout(C,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 P(){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(C,l),w(m)}return g===void 0&&(g=setTimeout(C,l)),p}return P.cancel=E,P.flush=_,P}return QOe=o,QOe}var n6n=r6n(),WF=QF(n6n),GOe=fl?fl.performance:null,L7t=GOe&&GOe.now?function(){return GOe.now()}:function(){return Date.now()},i6n=function(){if(fl){if(fl.requestAnimationFrame)return function(t){fl.requestAnimationFrame(t)};if(fl.mozRequestAnimationFrame)return function(t){fl.mozRequestAnimationFrame(t)};if(fl.webkitRequestAnimationFrame)return function(t){fl.webkitRequestAnimationFrame(t)};if(fl.msRequestAnimationFrame)return function(t){fl.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(L7t())},1e3/60)}}(),Aee=function(e){return i6n(e)},G1=L7t,QC=9261,M7t=65599,G4=5381,I7t=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:QC,n=r,i;i=e.next(),!i.done;)n=n*M7t+i.value|0;return n},YF=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:QC;return r*M7t+e|0},qF=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:G4;return(r<<5)+r+e|0},a6n=function(e,r){return e*2097152+r},nw=function(e){return e[0]*2097152+e[1]},See=function(e,r){return[YF(e[0],r[0]),qF(e[1],r[1])]},P7t=function(e,r){var n={value:0,done:!1},i=0,a=e.length,o={next:function(){return i=0;i--)e[i]===r&&e.splice(i,1)},YOe=function(e){e.splice(0,e.length)},g6n=function(e,r){for(var n=0;n"u"?"undefined":dl(Set))!==v6n?Set:y6n,Cee=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!kOe(e)){Co("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"){Co("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 H4,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 o=r.renderedPosition,s=e.pan(),l=e.zoom();a.position={x:(o.x-s.x)/l,y:(o.y-s.y)/l}}var u=[];Ma(r.classes)?u=r.classes:Yr(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--)C.push(k);return C}).apply(this).reverse(),T=[],w=0,A=S.length;w_;0<=_?++C:--C)P.push(o(y,x));return P},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,C;for(x==null&&(x=n),A=y.length,C=b,S=y[b],w=2*b+1;w0;){var S=b.pop(),T=v(S),C=S.id();if(f[C]=T,T!==1/0)for(var k=S.neighborhood().intersect(g),E=0;E0)for(N.unshift(I);d[B];){var V=d[B];N.unshift(V.edge),N.unshift(V.node),F=V.node,B=F.id()}return s.spawn(N)}}}},C6n={kruskal:function(e){e=e||function(x){return 1};for(var r=this.byGroup(),n=r.nodes,i=r.edges,a=n.length,o=new Array(a),s=n,l=function(w){for(var A=0;A0;){if(A(),T++,w===h){for(var C=[],k=a,E=h,_=y[E];C.unshift(k),_!=null&&C.unshift(_),k=v[E],k!=null;)E=k.id(),_=y[E];return{found:!0,distance:d[w],path:this.spawn(C),steps:T}}p[w]=!0;for(var P=x._private.edges,L=0;L_&&(g[E]=_,b[E]=k,x[E]=A),!a){var P=k*h+C;!a&&g[P]>_&&(g[P]=_,b[P]=C,x[P]=A)}}}for(var L=0;L1&&arguments[1]!==void 0?arguments[1]:o,xe=x(ue),ge=[],ze=xe;;){if(ze==null)return r.spawn();var we=b(ze),Oe=we.edge,Be=we.pred;if(ge.unshift(ze[0]),ze.same(de)&&ge.length>0)break;Oe!=null&&ge.unshift(Oe),ze=Be}return l.spawn(ge)},S=0;S=0;h--){var d=u[h],f=d[1],p=d[2];(r[f]===s&&r[p]===l||r[f]===l&&r[p]===s)&&u.splice(h,1)}for(var g=0;gi;){var a=Math.floor(Math.random()*r.length);r=M6n(a,e,r),n--}return r},I6n={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,o=i.length,s=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),l=Math.floor(a/L6n);if(a<2){Co("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,o=r;o1&&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,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;i?e=e.slice(r,n):(n0&&e.splice(0,r));for(var s=0,l=e.length-1;l>=0;l--){var u=e[l];o?isFinite(u)||(e[l]=-1/0,s++):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+s]:(e[d-1+s]+e[d+s])/2},Y7t=function(e,r){return r===0?e:Y7t(r,e%r)},z6n=function(e){for(var r=e[0],n=0;n0&&(r=Y7t(r,e[n]));else return 0;return r},U6n=function(e){return Math.PI*e/180},Eee=function(e,r){return Math.atan2(r,e)-Math.PI/2},KOe=Math.log2||function(t){return Math.log(t)/Math.log(2)},ZOe=function(e){return e>0?1:e<0?-1:0},HC=function(e,r){return Math.sqrt(WC(e,r))},WC=function(e,r){var n=r.x-e.x,i=r.y-e.y;return n*n+i*i},V6n=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}}},G6n=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},H6n=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},W6n=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},q7t=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},_ee=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},Ree=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,i,a,o;if(r.length===1)n=i=a=o=r[0];else if(r.length===2)n=a=r[0],o=i=r[1];else if(r.length===4){var s=qs(r,4);n=s[0],i=s[1],a=s[2],o=s[3]}return e.x1-=o,e.x2+=i,e.y1-=n,e.y2+=a,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},j7t=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},JOe=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},aw=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},X7t=function(e,r){return aw(e,r.x,r.y)},K7t=function(e,r){return aw(e,r.x1,r.y1)&&aw(e,r.x2,r.y2)},Y6n=(XOe=Math.hypot)!==null&&XOe!==void 0?XOe:function(t,e){return Math.sqrt(t*t+e*e)};function q6n(t,e){if(t.length<3)throw new Error("Need at least 3 vertices");var r=function(C,k){return{x:C.x+k.x,y:C.y+k.y}},n=function(C,k){return{x:C.x-k.x,y:C.y-k.y}},i=function(C,k){return{x:C.x*k,y:C.y*k}},a=function(C,k){return C.x*k.y-C.y*k.x},o=function(C){var k=Y6n(C.x,C.y);return k===0?{x:0,y:0}:{x:C.x/k,y:C.y/k}},s=function(C){for(var k=0,E=0;E7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?sw(a,o):l,h=a/2,d=o/2;u=Math.min(u,h,d);var f=u!==h,p=u!==d,g;if(f){var m=n-h+u-s,v=i-d-s,y=n+h-u+s,b=v;if(g=ow(e,r,n,i,m,v,y,b,!1),g.length>0)return g}if(p){var x=n+h+s,w=i-d+u-s,A=x,S=i+d-u+s;if(g=ow(e,r,n,i,x,w,A,S,!1),g.length>0)return g}if(f){var T=n-h+u-s,C=i+d+s,k=n+h-u+s,E=C;if(g=ow(e,r,n,i,T,C,k,E,!1),g.length>0)return g}if(p){var _=n-h-s,P=i-d+u-s,L=_,R=i+d-u+s;if(g=ow(e,r,n,i,_,P,L,R,!1),g.length>0)return g}var D;{var M=n-h+u,I=i-d+u;if(D=ZF(e,r,n,i,M,I,u+s),D.length>0&&D[0]<=M&&D[1]<=I)return[D[0],D[1]]}{var N=n+h-u,F=i-d+u;if(D=ZF(e,r,n,i,N,F,u+s),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=ZF(e,r,n,i,B,V,u+s),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=ZF(e,r,n,i,z,U,u+s),D.length>0&&D[0]<=z&&D[1]>=U)return[D[0],D[1]]}return[]},X6n=function(e,r,n,i,a,o,s){var l=s,u=Math.min(n,a),h=Math.max(n,a),d=Math.min(i,o),f=Math.max(i,o);return u-l<=e&&e<=h+l&&d-l<=r&&r<=f+l},K6n=function(e,r,n,i,a,o,s,l,u){var h={x1:Math.min(n,s,a)-u,x2:Math.max(n,s,a)+u,y1:Math.min(i,l,o)-u,y2:Math.max(i,l,o)+u};return!(eh.x2||rh.y2)},Z6n=function(e,r,n,i){n-=i;var a=r*r-4*e*n;if(a<0)return[];var o=Math.sqrt(a),s=2*e,l=(-r+o)/s,u=(-r-o)/s;return[l,u]},J6n=function(e,r,n,i,a){var o=1e-5;e===0&&(e=o),r/=e,n/=e,i/=e;var s,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,s=l*l*l+u*u,a[1]=0,p=r/3,s>0){d=u+Math.sqrt(s),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),f=u-Math.sqrt(s),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,s===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)},eNn=function(e,r,n,i,a,o,s,l){var u=1*n*n-4*n*a+2*n*s+4*a*a-4*a*s+s*s+i*i-4*i*o+2*i*l+4*o*o-4*o*l+l*l,h=1*9*n*a-3*n*n-3*n*s-6*a*a+3*a*s+9*i*o-3*i*i-3*i*l-6*o*o+3*o*l,d=1*3*n*n-6*n*a+n*s-n*e+2*a*a+2*a*e-s*e+3*i*i-6*i*o+i*l-i*r+2*o*o+2*o*r-l*r,f=1*n*a-n*n+n*e-a*e+i*o-i*i+i*r-o*r,p=[];J6n(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-o)*(r-o):h-f},nd=function(e,r,n){for(var i,a,o,s,l,u=0,h=0;h=e&&e>=o||i<=e&&e<=o)l=(e-i)/(o-i)*(s-a)+a,l>r&&u++;else continue;return u%2!==0},W1=function(e,r,n,i,a,o,s,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=Lee(h,-u);m=Dee(v)}else m=h;return nd(e,r,m)},rNn=function(e,r,n,i,a,o,s,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]},eke=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},ow=function(e,r,n,i,a,o,s,l,u){var h=e-a,d=n-e,f=s-a,p=r-o,g=i-r,m=l-o,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?eke(e,n,s)===s?[s,l]:eke(e,n,a)===a?[a,o]:eke(a,s,n)===n?[n,i]:[]:[]},iNn=function(e,r,n,i,a){var o=[],s=i/2,l=a/2,u=r,h=n;o.push({x:u+s*e[0],y:h+l*e[1]});for(var d=1;d0){var m=Lee(d,-l);p=Dee(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,C.nodes.indexOf(L)<0?C.push(L):C.updateItem(L),S[L]=0,A[L]=[]),T[L]==T[_]+M&&(S[L]=S[L]+S[_],A[L].push(_))}else for(var I=0;I0;){for(var V=w.pop(),z=0;z0&&s.push(n[l]);s.length!==0&&a.push(i.collection(s))}return a},bNn=function(e,r){for(var n=0;n5&&arguments[5]!==void 0?arguments[5]:ANn,s=i,l,u,h=0;h=2?e9(e,r,n,0,s$t,SNn):e9(e,r,n,0,o$t)},squaredEuclidean:function(e,r,n){return e9(e,r,n,0,s$t)},manhattan:function(e,r,n){return e9(e,r,n,0,o$t)},max:function(e,r,n){return e9(e,r,n,-1/0,TNn)}};X4["squared-euclidean"]=X4.squaredEuclidean,X4.squaredeuclidean=X4.squaredEuclidean;function Iee(t,e,r,n,i,a){var o;return Io(t)?o=t:o=X4[t]||X4.euclidean,e===0&&Io(t)?o(i,a):o(e,r,n,i,a)}var CNn=Tc({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),oke=function(e){return CNn(e)},Pee=function(e,r,n,i,a){var o=a!=="kMedoids",s=o?function(d){return n[d]}:function(d){return i[d](n)},l=function(f){return i[f](r)},u=n,h=r;return Iee(e,i.length,s,l,u,h)},ske=function(e,r,n){for(var i=n.length,a=new Array(i),o=new Array(i),s=new Array(r),l=null,u=0;un)return!1}return!0},ENn=function(e,r,n){for(var i=0;is&&(s=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[o],m=r[i[o]],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},g$t=function(e,r,n){for(var i=[],a=0;as&&(o=u,s=r[a*e+u])}o>0&&i.push(o)}for(var h=0;hu&&(l=h,u=d)}n[a]=o[l]}return i=g$t(e,r,n),i},m$t=function(e){for(var r=this.cy(),n=this.nodes(),i=zNn(e),a={},o=0;o=_?(P=_,_=R,L=D):R>P&&(P=R);for(var M=0;M0?1:0;T[k%i.minIterations*s+z]=U,V+=U}if(V>0&&(k>=i.minIterations-1||k==i.maxIterations-1)){for(var Q=0,G=0;G1||S>1)&&(s=!0),d[x]=[],b.outgoers().forEach(function(C){C.isEdge()&&d[x].push(C.id())})}else f[x]=[void 0,b.target().id()]}):o.forEach(function(b){var x=b.id();if(b.isNode()){var w=b.degree(!0);w%2&&(l?u?s=!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(s)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=o[0].id());var g=function(x){for(var w=x,A=[x],S,T,C;d[w].length;)S=d[w].shift(),T=f[S][0],C=f[S][1],w!=C?(d[C]=d[C].filter(function(k){return k!=S}),w=C):!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(o.getElementById(v.shift())),m.unshift(o.getElementById(v.shift()))):v=g(v.shift()).concat(v);m.unshift(o.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}},Nee=function(){var e=this,r={},n=0,i=0,a=[],o=[],s={},l=function(f,p){for(var g=o.length-1,m=[],v=e.spawn();o[g].x!=f||o[g].y!=p;)m.push(o.pop().edge),g--;m.push(o.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(),s[x]||(s[x]=!0,o.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}},qNn={hopcroftTarjanBiconnected:Nee,htbc:Nee,htb:Nee,hopcroftTarjanBiconnectedComponents:Nee},Bee=function(){var e=this,r={},n=0,i=[],a=[],o=e.spawn(e),s=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||s(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),o=o.difference(g)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||s(u)}}),{cut:o,components:i}},jNn={tarjanStronglyConnected:Bee,tsc:Bee,tscc:Bee,tarjanStronglyConnectedComponents:Bee},v$t={};[jF,T6n,C6n,k6n,_6n,D6n,I6n,lNn,q4,j4,ake,wNn,INn,$Nn,HNn,YNn,qNn,jNn].forEach(function(t){ln(v$t,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 m$t=0,v$t=1,y$t=2,Ug=function(e){if(!(this instanceof Ug))return new Ug(e);this.id="Thenable/1.0.7",this.state=m$t,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))};Ug.prototype={fulfill:function(e){return b$t(this,v$t,"fulfillValue",e)},reject:function(e){return b$t(this,y$t,"rejectReason",e)},then:function(e,r){var n=this,i=new Ug;return n.onFulfilled.push(A$t(e,i,"fulfill")),n.onRejected.push(A$t(r,i,"reject")),x$t(n),i.proxy}};var b$t=function(e,r,n,i){return e.state===m$t&&(e.state=r,e[n]=i,x$t(e)),e},x$t=function(e){e.state===v$t?w$t(e,"onFulfilled",e.fulfillValue):e.state===y$t&&w$t(e,"onRejected",e.rejectReason)},w$t=function(e,r,n){if(e[r].length!==0){var i=e[r];e[r]=[];var a=function(){for(var s=0;s0}},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 o=0;o-1}return Mke=e,Mke}var Ike,Y$t;function d8n(){if(Y$t)return Ike;Y$t=1;var t=zee();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 Ike=e,Ike}var Pke,q$t;function f8n(){if(q$t)return Pke;q$t=1;var t=l8n(),e=c8n(),r=u8n(),n=h8n(),i=d8n();function a(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s-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){Ma(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=r===void 0,a=[],o=0,s=n.length;o0&&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}};Vee.className=Vee.classNames=Vee.classes;var $i={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:pl,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};$i.variable="(?:[\\w-.]|(?:\\\\"+$i.metaChar+"))+",$i.className="(?:[\\w-]|(?:\\\\"+$i.metaChar+"))+",$i.value=$i.string+"|"+$i.number,$i.id=$i.variable,function(){var t,e,r;for(t=$i.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&($i.comparatorOp+="|\\!"+e)}();var Aa=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},uEe=[{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 zPn(t.selector,e.selector)}),G8n=function(){for(var t={},e,r=0;r0&&h.edgeCount>0)return aa("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return aa("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&aa("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},X8n=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},r=function(h){return Yr(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),C=a(h.right,d);return S+(S.length>0?" ":"")+T+C}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)},"")},o="",s=0;s1&&s=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),h=!0),(a||s||h)&&(l=!a&&!o?"":""+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()),s&&n(i,a,h)}return t}function kFt(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i1&&arguments[1]!==void 0?arguments[1]:!0;return fEe(this,t,e,kFt)};function EFt(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}e3.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return fEe(this,t,e,EFt)};function iBn(t,e,r){EFt(t,e,r),kFt(t,e,r)}e3.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return fEe(this,t,e,iBn)},e3.ancestors=e3.parents;var t9,_Ft;t9=_Ft={data:oa.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:oa.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:oa.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:oa.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:oa.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:oa.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},t9.attr=t9.data,t9.removeAttr=t9.removeData;var aBn=_Ft,Qee={};function pEe(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,o=0;oe}),minIndegree:t3("indegree",function(t,e){return te}),minOutdegree:t3("outdegree",function(t,e){return te})}),ln(Qee,{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=s?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(!o)return;return this}},Vg.modelPosition=Vg.point=Vg.position,Vg.modelPositions=Vg.points=Vg.positions,Vg.renderedPoint=Vg.renderedPosition,Vg.relativePoint=Vg.relativePosition;var oBn=RFt,r3=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},n3=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},sBn=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"}},i3,dw;i3=dw={},dw.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),i=r.pan(),a=e.x1*n+i.x,o=e.x2*n+i.x,s=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:a,x2:o,y1:s,y2:l,w:o-a,h:l-s}},dw.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)},dw.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(o){if(!o.isParent())return;var s=o._private,l=o.children(),u=o.pstyle("compound-sizing-wrt-labels").value==="include",h={width:{val:o.pstyle("min-width").pfValue,left:o.pstyle("min-width-bias-left"),right:o.pstyle("min-width-bias-right")},height:{val:o.pstyle("min-height").pfValue,top:o.pstyle("min-height-bias-top"),bottom:o.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),f=s.position;(d.w===0||d.h===0)&&(d={w:o.pstyle("width").pfValue,h:o.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 P=0,L=0,R=E+_;return k>0&&R>0&&(P=E/R*k,L=_/R*k),{biasDiff:P,biasComplementDiff:L}}function g(k,E,_,P){if(_.units==="%")switch(P){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,C=S.biasComplementDiff;s.autoPadding=g(d.w,d.h,o.pstyle("padding"),o.pstyle("padding-relative-to").value),s.autoWidth=Math.max(d.w,h.width.val),f.x=(-w+d.x1+d.x2+A)/2,s.autoHeight=Math.max(d.h,h.height.val),f.y=(-T+d.y1+d.y2+C)/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)},fw=function(e,r){return r==null?e:Qg(e,r.x1,r.y1,r.x2,r.y2)},r9=function(e,r,n){return eh(e,r,n)},Gee=function(e,r,n){if(!r.cy().headless()){var i=r._private,a=i.rstyle,o=a.arrowWidth/2,s=r.pstyle(n+"-arrow-shape").value,l,u;if(s!=="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-o,d.y1=u-o,d.x2=l+o,d.y2=u+o,d.w=d.x2-d.x1,d.h=d.y2-d.y1,_ee(d,1),Qg(e,d.x1,d.y1,d.x2,d.y2)}}},gEe=function(e,r,n){if(!r.cy().headless()){var i;n?i=n+"-":i="";var a=r._private,o=a.rstyle,s=r.pstyle(i+"label").strValue;if(s){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),h=r9(o,"labelWidth",n),d=r9(o,"labelHeight",n),f=r9(o,"labelX",n),p=r9(o,"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,C=h,k=C/2,E=T/2,_,P,L,R;if(v)_=f-k,P=f+k,L=p-E,R=p+E;else{switch(r3(l.value)){case"left":_=f-C,P=f;break;case"center":_=f-k,P=f+k;break;case"right":_=f,P=f+C;break}switch(n3(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,I=m-Math.max(b,w)-A-S,N=m+Math.max(b,w)+A+S;_+=D,P+=M,L+=I,R+=N;var F=n||"main",B=a.labelBounds,V=B[F]=B[F]||{};V.x1=_,V.y1=L,V.x2=P,V.y2=R,V.w=P-_,V.h=R-L,V.leftPad=D,V.rightPad=M,V.topPad=I,V.botPad=N;var z=v&&y.strValue==="autorotate",U=y.pfValue!=null&&y.pfValue!==0;if(z||U){var Q=z?r9(a.rstyle,"labelAngle",n):y.pfValue,G=Math.cos(Q),q=Math.sin(Q),Y=(_+P)/2,ne=(L+R)/2;if(!v){switch(r3(l.value)){case"left":Y=P;break;case"right":Y=_;break}switch(n3(u.value)){case"top":ne=R;break;case"bottom":ne=L;break}}var X=function(Ee,ue){return Ee=Ee-Y,ue=ue-ne,{x:Ee*G-ue*q+Y,y:Ee*q+ue*G+ne}},J=X(_,L),ee=X(_,R),te=X(P,L),pe=X(P,R);_=Math.min(J.x,ee.x,te.x,pe.x),P=Math.max(J.x,ee.x,te.x,pe.x),L=Math.min(J.y,ee.y,te.y,pe.y),R=Math.max(J.y,ee.y,te.y,pe.y)}var ie=F+"Rot",Ce=B[ie]=B[ie]||{};Ce.x1=_,Ce.y1=L,Ce.x2=P,Ce.y2=R,Ce.w=P-_,Ce.h=R-L,Qg(e,_,L,P,R),Qg(a.labelBounds.all,_,L,P,R)}return e}},MFt=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,o=i+a;IFt(e,r,n,o,"outside",o/2)}},IFt=function(e,r,n,i,a,o){if(!(n===0||i<=0||a==="inside")){var s=r.cy(),l=s.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);fw(e,m)}else o!=null&&o>0&&Ree(e,[o,o,o,o])}}},lBn=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;IFt(e,r,n,i,a)}},cBn=function(e,r){var n=e._private.cy,i=n.styleEnabled(),a=n.headless(),o=th(),s=e._private,l=e.isNode(),u=e.isEdge(),h,d,f,p,g,m,v=s.rstyle,y=l&&i?e.pstyle("bounds-expansion").pfValue:[0],b=function(ke){return ke.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 C=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 P=e.outerWidth(),L=P/2,R=e.outerHeight(),D=R/2;h=g-L,d=g+L,f=m-D,p=m+D,Qg(o,h,f,d,p),i&&MFt(o,e),i&&r.includeOutlines&&!a&&MFt(o,e),i&&lBn(o,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,Qg(o,h,f,d,p),M==="haystack"){var I=v.haystackPts;if(I&&I.length===2){if(h=I[0].x,f=I[0].y,d=I[1].x,p=I[1].y,h>d){var N=h;h=d,d=N}if(f>p){var F=f;f=p,p=F}Qg(o,h-E,f-E,d+E,p+E)}}else if(M==="bezier"||M==="unbundled-bezier"||rw(M,"segments")||rw(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 ne=f;f=p,p=ne}h-=E,d+=E,f-=E,p+=E,Qg(o,h,f,d,p)}if(i&&r.includeEdges&&u&&(Gee(o,e,"mid-source"),Gee(o,e,"mid-target"),Gee(o,e,"source"),Gee(o,e,"target")),i){var X=e.pstyle("ghost").value==="yes";if(X){var J=e.pstyle("ghost-offset-x").pfValue,ee=e.pstyle("ghost-offset-y").pfValue;Qg(o,o.x1+J,o.y1+ee,o.x2+J,o.y2+ee)}}var te=s.bodyBounds=s.bodyBounds||{};Y7t(te,o),Ree(te,y),_ee(te,1),i&&(h=o.x1,d=o.x2,f=o.y1,p=o.y2,Qg(o,h-C,f-C,d+C,p+C));var pe=s.overlayBounds=s.overlayBounds||{};Y7t(pe,o),Ree(pe,y),_ee(pe,1);var ie=s.labelBounds=s.labelBounds||{};ie.all!=null?Q6n(ie.all):ie.all=th(),i&&r.includeLabels&&(r.includeMainLabels&&gEe(o,e,null),u&&(r.includeSourceLabels&&gEe(o,e,"source"),r.includeTargetLabels&&gEe(o,e,"target")))}return o.x1=Mp(o.x1),o.y1=Mp(o.y1),o.x2=Mp(o.x2),o.y2=Mp(o.y2),o.w=Mp(o.x2-o.x1),o.h=Mp(o.y2-o.y1),o.w>0&&o.h>0&&x&&(Ree(o,y),_ee(o,1)),o},PFt=function(e){var r=0,n=function(o){return(o?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 o=0;o-1}return Mke=e,Mke}var Ike,j$t;function p8n(){if(j$t)return Ike;j$t=1;var t=zee();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 Ike=e,Ike}var Pke,X$t;function g8n(){if(X$t)return Pke;X$t=1;var t=u8n(),e=h8n(),r=d8n(),n=f8n(),i=p8n();function a(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s-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){Ma(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=r===void 0,a=[],o=0,s=n.length;o0&&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}};Vee.className=Vee.classNames=Vee.classes;var $i={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:pl,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};$i.variable="(?:[\\w-.]|(?:\\\\"+$i.metaChar+"))+",$i.className="(?:[\\w-]|(?:\\\\"+$i.metaChar+"))+",$i.value=$i.string+"|"+$i.number,$i.id=$i.variable,function(){var t,e,r;for(t=$i.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&($i.comparatorOp+="|\\!"+e)}();var Aa=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},uEe=[{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 VPn(t.selector,e.selector)}),W8n=function(){for(var t={},e,r=0;r0&&h.edgeCount>0)return aa("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return aa("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&aa("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},Z8n=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(h){return h??""},r=function(h){return Yr(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),C=a(h.right,d);return S+(S.length>0?" ":"")+T+C}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)},"")},o="",s=0;s1&&s=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),h=!0),(a||s||h)&&(l=!a&&!o?"":""+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()),s&&n(i,a,h)}return t}function _Ft(t,e,r){if(r.isParent())for(var n=r._private.children,i=0;i1&&arguments[1]!==void 0?arguments[1]:!0;return fEe(this,t,e,_Ft)};function RFt(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}e3.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return fEe(this,t,e,RFt)};function oBn(t,e,r){RFt(t,e,r),_Ft(t,e,r)}e3.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return fEe(this,t,e,oBn)},e3.ancestors=e3.parents;var t9,DFt;t9=DFt={data:oa.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:oa.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:oa.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:oa.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:oa.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:oa.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},t9.attr=t9.data,t9.removeAttr=t9.removeData;var sBn=DFt,Qee={};function pEe(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,o=0;oe}),minIndegree:t3("indegree",function(t,e){return te}),minOutdegree:t3("outdegree",function(t,e){return te})}),ln(Qee,{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=s?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(!o)return;return this}},Vg.modelPosition=Vg.point=Vg.position,Vg.modelPositions=Vg.points=Vg.positions,Vg.renderedPoint=Vg.renderedPosition,Vg.relativePoint=Vg.relativePosition;var lBn=LFt,r3=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},n3=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}},cBn=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"}},i3,dw;i3=dw={},dw.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),i=r.pan(),a=e.x1*n+i.x,o=e.x2*n+i.x,s=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:a,x2:o,y1:s,y2:l,w:o-a,h:l-s}},dw.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)},dw.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(o){if(!o.isParent())return;var s=o._private,l=o.children(),u=o.pstyle("compound-sizing-wrt-labels").value==="include",h={width:{val:o.pstyle("min-width").pfValue,left:o.pstyle("min-width-bias-left"),right:o.pstyle("min-width-bias-right")},height:{val:o.pstyle("min-height").pfValue,top:o.pstyle("min-height-bias-top"),bottom:o.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),f=s.position;(d.w===0||d.h===0)&&(d={w:o.pstyle("width").pfValue,h:o.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 P=0,L=0,R=E+_;return k>0&&R>0&&(P=E/R*k,L=_/R*k),{biasDiff:P,biasComplementDiff:L}}function g(k,E,_,P){if(_.units==="%")switch(P){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,C=S.biasComplementDiff;s.autoPadding=g(d.w,d.h,o.pstyle("padding"),o.pstyle("padding-relative-to").value),s.autoWidth=Math.max(d.w,h.width.val),f.x=(-w+d.x1+d.x2+A)/2,s.autoHeight=Math.max(d.h,h.height.val),f.y=(-T+d.y1+d.y2+C)/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)},fw=function(e,r){return r==null?e:Qg(e,r.x1,r.y1,r.x2,r.y2)},r9=function(e,r,n){return eh(e,r,n)},Gee=function(e,r,n){if(!r.cy().headless()){var i=r._private,a=i.rstyle,o=a.arrowWidth/2,s=r.pstyle(n+"-arrow-shape").value,l,u;if(s!=="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-o,d.y1=u-o,d.x2=l+o,d.y2=u+o,d.w=d.x2-d.x1,d.h=d.y2-d.y1,_ee(d,1),Qg(e,d.x1,d.y1,d.x2,d.y2)}}},gEe=function(e,r,n){if(!r.cy().headless()){var i;n?i=n+"-":i="";var a=r._private,o=a.rstyle,s=r.pstyle(i+"label").strValue;if(s){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),h=r9(o,"labelWidth",n),d=r9(o,"labelHeight",n),f=r9(o,"labelX",n),p=r9(o,"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,C=h,k=C/2,E=T/2,_,P,L,R;if(v)_=f-k,P=f+k,L=p-E,R=p+E;else{switch(r3(l.value)){case"left":_=f-C,P=f;break;case"center":_=f-k,P=f+k;break;case"right":_=f,P=f+C;break}switch(n3(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,I=m-Math.max(b,w)-A-S,N=m+Math.max(b,w)+A+S;_+=D,P+=M,L+=I,R+=N;var F=n||"main",B=a.labelBounds,V=B[F]=B[F]||{};V.x1=_,V.y1=L,V.x2=P,V.y2=R,V.w=P-_,V.h=R-L,V.leftPad=D,V.rightPad=M,V.topPad=I,V.botPad=N;var z=v&&y.strValue==="autorotate",U=y.pfValue!=null&&y.pfValue!==0;if(z||U){var Q=z?r9(a.rstyle,"labelAngle",n):y.pfValue,G=Math.cos(Q),q=Math.sin(Q),Y=(_+P)/2,ne=(L+R)/2;if(!v){switch(r3(l.value)){case"left":Y=P;break;case"right":Y=_;break}switch(n3(u.value)){case"top":ne=R;break;case"bottom":ne=L;break}}var X=function(Ee,ue){return Ee=Ee-Y,ue=ue-ne,{x:Ee*G-ue*q+Y,y:Ee*q+ue*G+ne}},J=X(_,L),ee=X(_,R),te=X(P,L),pe=X(P,R);_=Math.min(J.x,ee.x,te.x,pe.x),P=Math.max(J.x,ee.x,te.x,pe.x),L=Math.min(J.y,ee.y,te.y,pe.y),R=Math.max(J.y,ee.y,te.y,pe.y)}var ie=F+"Rot",Ce=B[ie]=B[ie]||{};Ce.x1=_,Ce.y1=L,Ce.x2=P,Ce.y2=R,Ce.w=P-_,Ce.h=R-L,Qg(e,_,L,P,R),Qg(a.labelBounds.all,_,L,P,R)}return e}},PFt=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,o=i+a;NFt(e,r,n,o,"outside",o/2)}},NFt=function(e,r,n,i,a,o){if(!(n===0||i<=0||a==="inside")){var s=r.cy(),l=s.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);fw(e,m)}else o!=null&&o>0&&Ree(e,[o,o,o,o])}}},uBn=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;NFt(e,r,n,i,a)}},hBn=function(e,r){var n=e._private.cy,i=n.styleEnabled(),a=n.headless(),o=th(),s=e._private,l=e.isNode(),u=e.isEdge(),h,d,f,p,g,m,v=s.rstyle,y=l&&i?e.pstyle("bounds-expansion").pfValue:[0],b=function(ke){return ke.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 C=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 P=e.outerWidth(),L=P/2,R=e.outerHeight(),D=R/2;h=g-L,d=g+L,f=m-D,p=m+D,Qg(o,h,f,d,p),i&&PFt(o,e),i&&r.includeOutlines&&!a&&PFt(o,e),i&&uBn(o,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,Qg(o,h,f,d,p),M==="haystack"){var I=v.haystackPts;if(I&&I.length===2){if(h=I[0].x,f=I[0].y,d=I[1].x,p=I[1].y,h>d){var N=h;h=d,d=N}if(f>p){var F=f;f=p,p=F}Qg(o,h-E,f-E,d+E,p+E)}}else if(M==="bezier"||M==="unbundled-bezier"||rw(M,"segments")||rw(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 ne=f;f=p,p=ne}h-=E,d+=E,f-=E,p+=E,Qg(o,h,f,d,p)}if(i&&r.includeEdges&&u&&(Gee(o,e,"mid-source"),Gee(o,e,"mid-target"),Gee(o,e,"source"),Gee(o,e,"target")),i){var X=e.pstyle("ghost").value==="yes";if(X){var J=e.pstyle("ghost-offset-x").pfValue,ee=e.pstyle("ghost-offset-y").pfValue;Qg(o,o.x1+J,o.y1+ee,o.x2+J,o.y2+ee)}}var te=s.bodyBounds=s.bodyBounds||{};j7t(te,o),Ree(te,y),_ee(te,1),i&&(h=o.x1,d=o.x2,f=o.y1,p=o.y2,Qg(o,h-C,f-C,d+C,p+C));var pe=s.overlayBounds=s.overlayBounds||{};j7t(pe,o),Ree(pe,y),_ee(pe,1);var ie=s.labelBounds=s.labelBounds||{};ie.all!=null?H6n(ie.all):ie.all=th(),i&&r.includeLabels&&(r.includeMainLabels&&gEe(o,e,null),u&&(r.includeSourceLabels&&gEe(o,e,"source"),r.includeTargetLabels&&gEe(o,e,"target")))}return o.x1=Mp(o.x1),o.y1=Mp(o.y1),o.x2=Mp(o.x2),o.y2=Mp(o.y2),o.w=Mp(o.x2-o.x1),o.h=Mp(o.y2-o.y1),o.w>0&&o.h>0&&x&&(Ree(o,y),_ee(o,1)),o},BFt=function(e){var r=0,n=function(o){return(o?1:0)<0&&arguments[0]!==void 0?arguments[0]:TBn,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;s--)o(s);return this},pw.removeAllListeners=function(){return this.removeListener("*")},pw.emit=pw.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,Ma(e)||(e=[e]),CBn(this,function(a,o){r!=null&&(n=[{event:o.event,type:o.type,namespace:o.namespace,callback:r}],i=n.length);for(var s=function(){var h=n[l];if(h.type===o.type&&(!h.namespace||h.namespace===o.namespace||h.namespace===SBn)&&a.eventMatches(a.context,h,o)){var d=[o];e!=null&&f6n(d,e),a.beforeEmit(a.context,h,o),h.conf&&h.conf.one&&(a.listeners=a.listeners.filter(function(g){return g!==h}));var f=a.callbackContext(a.context,h,o),p=h.callback.apply(f,d);a.afterEmit(a.context,h,o),p===!1&&(o.stopPropagation(),o.preventDefault())}},l=0;l1&&!o){var s=this.length-1,l=this[s],u=l._private.data.id;this[s]=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 o=a.index;return this.unmergeAt(o),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&Yr(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=s)}return{value:n,ele:i}},min:function(e,r){for(var n=1/0,i,a=this,o=0;o=0&&a"u"?"undefined":dl(Symbol))!=e&&dl(Symbol.iterator)!=e;r&&(qee[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,o=this.length;return r7t({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(Bi(e)){var o=e;a.applyBypass(this,o,i),this.emitAndNotify("style")}else if(Yr(e))if(r===void 0){var s=this[0];return s?a.getStylePropertyValue(s,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 o=0;o0&&e.push(h[0]),e.push(s[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)}}),du.neighbourhood=du.neighborhood,du.closedNeighbourhood=du.closedNeighborhood,du.openNeighbourhood=du.openNeighborhood,ln(du,{source:Lp(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:Lp(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:r9t({attr:"source"}),targets:r9t({attr:"target"})});function r9t(t){return function(r){for(var n=[],i=0;i0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),du.componentsOf=du.components;var Oc=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){Co("A collection must have a reference to the core");return}var a=new H1,o=!1;if(!r)r=[];else if(r.length>0&&Bi(r[0])&&!VF(r[0])){o=!0;for(var s=[],l=new H4,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=[],o=[],s,l=0,u=r.length;l0){for(var F=s.length===r.length?r:new Oc(n,s),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 o(R){for(var D=R._private.edges,M=0;M0&&(t?_.emitAndNotify("remove"):e&&_.emit("remove"));for(var P=0;P0?P=R:_=R;while(Math.abs(L)>o&&++D=a?b(E,D):M===0?D:w(E,_,_+u)}var S=!1;function T(){S=!0,(t!==e||r!==n)&&x()}var C=function(_){return S||T(),t===e&&r===n?_:_===0?0:_===1?1:v(A(_),e,n)};C.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var k="generateBezier("+[t,e,r,n]+")";return C.toString=function(){return k},C}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var NBn=function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,i,a){var o={x:n.x+a.dx*i,v:n.v+a.dv*i,tension:n.tension,friction:n.friction};return{dx:o.v,dv:t(o)}}function r(n,i){var a={dx:n.v,dv:t(n)},o=e(n,i*.5,a),s=e(n,i*.5,o),l=e(n,i,s),u=1/6*(a.dx+2*(o.dx+s.dx)+l.dx),h=1/6*(a.dv+2*(o.dv+s.dv)+l.dv);return n.x=n.x+u*i,n.v=n.v+h*i,n}return function n(i,a,o){var s={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,o=o||null,s.tension=i,s.friction=a,f=o!==null,f?(u=n(i,a),p=u/o*d):p=d;g=r(g||s,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}}(),Va=function(e,r,n,i){var a=PBn(e,r,n,i);return function(o,s,l){return o+(s-o)*a(l)}},Zee={linear:function(e,r,n){return e+(r-e)*n},ease:Va(.25,.1,.25,1),"ease-in":Va(.42,0,1,1),"ease-out":Va(0,0,.58,1),"ease-in-out":Va(.42,0,.58,1),"ease-in-sine":Va(.47,0,.745,.715),"ease-out-sine":Va(.39,.575,.565,1),"ease-in-out-sine":Va(.445,.05,.55,.95),"ease-in-quad":Va(.55,.085,.68,.53),"ease-out-quad":Va(.25,.46,.45,.94),"ease-in-out-quad":Va(.455,.03,.515,.955),"ease-in-cubic":Va(.55,.055,.675,.19),"ease-out-cubic":Va(.215,.61,.355,1),"ease-in-out-cubic":Va(.645,.045,.355,1),"ease-in-quart":Va(.895,.03,.685,.22),"ease-out-quart":Va(.165,.84,.44,1),"ease-in-out-quart":Va(.77,0,.175,1),"ease-in-quint":Va(.755,.05,.855,.06),"ease-out-quint":Va(.23,1,.32,1),"ease-in-out-quint":Va(.86,0,.07,1),"ease-in-expo":Va(.95,.05,.795,.035),"ease-out-expo":Va(.19,1,.22,1),"ease-in-out-expo":Va(1,0,0,1),"ease-in-circ":Va(.6,.04,.98,.335),"ease-out-circ":Va(.075,.82,.165,1),"ease-in-out-circ":Va(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return Zee.linear;var i=NBn(e,r,n);return function(a,o,s){return a+(o-a)*i(s)}},"cubic-bezier":Va};function a9t(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 o9t(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function s3(t,e,r,n,i){var a=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var o=o9t(t,i),s=o9t(e,i);if(sr(o)&&sr(s))return a9t(a,o,s,r,n);if(Ma(o)&&Ma(s)){for(var l=[],u=0;u0?(p==="spring"&&g.push(o.duration),o.easingImpl=Zee[p].apply(null,g)):o.easingImpl=Zee[p]}var m=o.easingImpl,v;if(o.duration===0?v=1:v=(r-l)/o.duration,o.applying&&(v=o.progress),v<0?v=0:v>1&&(v=1),o.delay==null){var y=o.startPosition,b=o.position;if(b&&i&&!t.locked()){var x={};s9(y.x,b.x)&&(x.x=s3(y.x,b.x,v,m)),s9(y.y,b.y)&&(x.y=s3(y.y,b.y,v,m)),t.position(x)}var w=o.startPan,A=o.pan,S=a.pan,T=A!=null&&n;T&&(s9(w.x,A.x)&&(S.x=s3(w.x,A.x,v,m)),s9(w.y,A.y)&&(S.y=s3(w.y,A.y,v,m)),t.emit("pan"));var C=o.startZoom,k=o.zoom,E=k!=null&&n;E&&(s9(C,k)&&(a.zoom=KF(a.minZoom,s3(C,k,v,m),a.maxZoom)),t.emit("zoom")),(T||E)&&t.emit("viewport");var _=o.style;if(_&&_.length>0&&i){for(var P=0;P<_.length;P++){var L=_[P],R=L.name,D=L,M=o.startStyle[R],I=h.properties[M.name],N=s3(M,D,v,m,I);h.overrideBypass(t,R,N)}t.emit("style")}}return o.progress=v,v}function s9(t,e){return t==null||e==null?!1:sr(t)&&sr(e)?!0:!!(t&&e)}function $Bn(t,e,r,n){var i=e._private;i.started=!0,i.startTime=r-i.progress*i.duration}function s9t(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 C=S[T];C()}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||$Bn(h,x,t),BBn(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,o=0;o0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var FBn={animate:oa.animate(),animation:oa.animation(),animated:oa.animated(),clearQueue:oa.clearQueue(),delay:oa.delay(),delayAnimation:oa.delayAnimation(),stop:oa.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&&Aee(function(a){s9t(a,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(a,o){s9t(o,e)},n.beforeRenderPriorities.animations):r()}},zBn={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&&VF(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}},Jee=function(e){return Yr(e)?new cw(e):e},l9t={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Wee(zBn,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,Jee(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,Jee(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,Jee(r),n),this},once:function(e,r,n){return this.emitter().one(e,Jee(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}};oa.eventAliasesOn(l9t);var yEe={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)}};yEe.jpeg=yEe.jpg;var ete={layout:function(e){var r=this;if(e==null){Co("Layout options must be specified to make a layout");return}if(e.name==null){Co("A `name` must be specified to make a layout");return}var n=e.name,i=r.extension("layout",n);if(i==null){Co("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;Yr(e.eles)?a=r.$(e.eles):a=e.eles!=null?e.eles:r.$();var o=new i(ln({},e,{cy:r,eles:a}));return o}};ete.createLayout=ete.makeLayout=ete.layout;var UBn={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)}};bEe.invalidateDimensions=bEe.resize;var tte={collection:function(e,r){return Yr(e)?this.$(e):pf(e)?e.collection():Ma(e)?(r||(r={}),new Oc(this,e,r.unique,r.removed)):new Oc(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}};tte.elements=tte.filter=tte.$;var Wl={},l9="t",QBn="f";Wl.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),s.color){var S=n.valueMin[0],T=n.valueMax[0],C=n.valueMin[1],k=n.valueMax[1],E=n.valueMin[2],_=n.valueMax[2],P=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(C+(k-C)*w),Math.round(E+(_-E)*w),Math.round(P+(L-P)*w)];a={bypass:n.bypass,name:n.name,value:R,strValue:"rgb("+R[0]+", "+R[1]+", "+R[2]+")"}}else if(s.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 o.data:{for(var M=n.field.split("."),I=d.data,N=0;N0&&a>0){for(var s={},l=!1,u=0;u0?t.delayAnimation(o).play().promise().then(x):x()}).then(function(){return t.animation({style:s,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)},Wl.checkTrigger=function(t,e,r,n,i,a){var o=this.properties[e],s=i(o);t.removed()||s!=null&&s(r,n,t)&&a(o)},Wl.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)})},Wl.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})},Wl.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()})})},Wl.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()})})},Wl.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 c9={};c9.applyBypass=function(t,e,r,n){var i=this,a=[],o=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var s=0;si.length?n=n.substr(i.length):n=""}function l(){a.length>o.length?a=a.substr(o.length):a=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){aa("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 cw(d);if(f.invalid){aa("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),s();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){aa("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),g=!0;break}o=y[0];var b=y[1],x=y[2],w=e.properties[b];if(!w){aa("Skipping property: Invalid property name in: "+o),l();continue}var A=r.parse(b,x);if(!A){aa("Skipping property: Invalid property definition in: "+o),l();continue}m.push({name:b,val:x}),l()}if(g){s();break}r.selector(d);for(var S=0;S=7&&e[0]==="d"&&(h=new RegExp(s.data.regex).exec(e))){if(r)return!1;var f=s.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(s.mapData.regex).exec(e))){if(r||u.multiple)return!1;var p=s.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 aa("`"+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+/):Ma(e)?x=e:x=[e],u.evenMultiple&&x.length%2!==0)return null;for(var w=[],A=[],S=[],T="",C=!1,k=0;k0?" ":"")+E.strValue}return u.validate&&!u.validate(w,A)?null:u.singleEnum&&C?w.length===1&&Yr(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 X=0;Xu.max||u.strictMax&&e===u.max))return null;var M={name:t,value:e,strValue:""+e+(P||""),units:P,bypass:r};return u.unitless||P!=="px"&&P!=="em"?M.pfValue=e:M.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&(M.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&(M.pfValue=P==="rad"?e:F6n(e)),P==="%"&&(M.pfValue=e/100),M}else if(u.propList){var I=[],N=""+e;if(N!=="none"){for(var F=N.split(/\s*,\s*|\s+/),B=0;B0&&s>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((o-2*r)/n.w,(s-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,o,s=!1;if(r.zoomingEnabled||(s=!0),sr(e)?o=e:Bi(e)&&(o=e.level,e.position!=null?a=kee(e.position,i,n):e.renderedPosition!=null&&(a=e.renderedPosition),a!=null&&!r.panningEnabled&&(s=!0)),o=o>r.maxZoom?r.maxZoom:o,o=or.maxZoom||!r.zoomingEnabled?o=!0:(r.zoom=l,a.push("zoom"))}if(i&&(!o||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;sr(u.x)&&(r.pan.x=u.x,s=!1),sr(u.y)&&(r.pan.y=u.y,s=!1),s||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(Yr(e)){var n=e;e=this.mutableElements().filter(n)}else pf(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),a=this.width(),o=this.height();r=r===void 0?this._private.zoom:r;var s={x:(a-r*(i.x1+i.x2))/2,y:(o-r*(i.y1+i.y2))/2};return s}}},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(s){return parseFloat(i.getPropertyValue(s))};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}};jC.centre=jC.center,jC.autolockNodes=jC.autolock,jC.autoungrabifyNodes=jC.autoungrabify;var u9={data:oa.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:oa.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:oa.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:oa.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};u9.attr=u9.data,u9.removeAttr=u9.removeData;var h9=function(e){var r=this;e=ln({},e);var n=e.container;n&&!yee(n)&&yee(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 o=fl!==void 0&&n!==void 0&&!e.headless,s=e;s.layout=ln({name:o?"grid":"null"},s.layout),s.renderer=ln({name:o?"canvas":"null"},s.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:s,elements:new Oc(this),listeners:[],aniEles:new Oc(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,s.zoomingEnabled),userZoomingEnabled:l(!0,s.userZoomingEnabled),panningEnabled:l(!0,s.panningEnabled),userPanningEnabled:l(!0,s.userPanningEnabled),boxSelectionEnabled:l(!0,s.boxSelectionEnabled),autolock:l(!1,s.autolock,s.autolockNodes),autoungrabify:l(!1,s.autoungrabify,s.autoungrabifyNodes),autounselectify:l(!1,s.autounselectify),styleEnabled:s.styleEnabled===void 0?o:s.styleEnabled,zoom:sr(s.zoom)?s.zoom:1,pan:{x:Bi(s.pan)&&sr(s.pan.x)?s.pan.x:0,y:Bi(s.pan)&&sr(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,s.multiClickDebounceTime)};this.createEmitter(),this.selectionType(s.selectionType),this.zoomRange({min:s.minZoom,max:s.maxZoom});var h=function(g,m){var v=g.some(LPn);if(v)return Z4.all(g).then(m);m(g)};u.styleEnabled&&r.setStyle([]);var d=ln({},s,s.renderer);r.initRenderer(d);var f=function(g,m,v){r.notifications(!1);var y=r.mutableElements();y.length>0&&y.remove(),g!=null&&(Bi(g)||Ma(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=ln({},r._private.options.layout);b.eles=r.elements(),r.layout(b).run()};h([s.style,s.elements],function(p){var g=p[0],m=p[1];u.styleEnabled&&r.style().append(g),f(m,function(){r.startAnimationLoop(),u.ready=!0,Io(s.ready)&&r.on("ready",s.ready);for(var v=0;v0,s=!!t.boundingBox,l=th(s?t.boundingBox:structuredClone(e.extent())),u;if(pf(t.roots))u=t.roots;else if(Ma(t.roots)){for(var h=[],d=0;d0;){var R=L(),D=k(R,_);if(D)R.outgoers().filter(function(de){return de.isNode()&&r.has(de)}).forEach(P);else if(D===null){aa("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 I=0;I0&&y[0].length<=3?Oe/2:0),Z=2*Math.PI/y[ze].length*we;return ze===0&&y[0].length===1&&(Be=1),{x:te.x+Be*Math.cos(Z),y:te.y+Be*Math.sin(Z)}}else{var le=y[ze].length,be=Math.max(le===1?0:s?(l.w-t.padding*2-pe.w)/((t.grid?Ce:le)-1):(l.w-t.padding*2-pe.w)/((t.grid?Ce:le)+1),M),ae={x:te.x+(we+1-(le+1)/2)*be,y:te.y+(ze+1-(G+1)/2)*ie};return ae}},Ee={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Ee).indexOf(t.direction)===-1&&Co("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Ee).join(", ")));var ue=function(xe){return s6n(ke(xe),l,Ee[t.direction])};return r.nodes().layoutPositions(this,t,ue),this};var qBn={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 h9t(t){this.options=ln({},qBn,t)}h9t.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 o=th(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s={x:o.x1+o.w/2,y:o.y1+o.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 C=e.startAngle+T*u*(i?1:-1),k=h*Math.cos(C),E=h*Math.sin(C),_={x:s.x+k,y:s.y+E};return _};return n.nodes().layoutPositions(this,e,w),this};var jBn={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 d9t(t){this.options=ln({},jBn,t)}d9t.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"),o=th(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),s={x:o.x1+o.w/2,y:o.y1+o.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,C=Math.min(o.w,o.h)/2-S,k=C/(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),I=Math.sqrt(S*S/(D*D+M*M));E=Math.max(I,E)}P.r=E,E+=S}if(e.equidistant){for(var N=0,F=0,B=0;B=t.numIter||(r7n(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&a(),Aee(h)}};h()}else{for(;u;)u=o(l),l++;v9t(n,t),s()}return this},ate.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},ate.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var KBn=function(e,r,n){for(var i=n.eles.edges(),a=n.eles.nodes(),o=th(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),s={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},l=n.eles.components(),u={},h=0;h0){s.graphSet.push(C);for(var h=0;hi.count?0:i.graph},f9t=function(e,r,n,i){var a=i.graphSet[n];if(-10)var d=i.nodeOverlap*h,f=Math.sqrt(s*s+l*l),p=d*s/f,g=d*l/f;else var m=ote(e,s,l),v=ote(r,-1*s,-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)}},a7n=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 o=e.maxY-r.minY;else var o=r.maxY-e.minY;return a>=0&&o>=0?Math.sqrt(a*a+o*o):0},ote=function(e,r,n){var i=e.positionX,a=e.positionY,o=e.height||1,s=e.width||1,l=n/r,u=o/s,h={};return r===0&&0n?(h.x=i,h.y=a+o/2,h):0r&&-1*u<=l&&l<=u?(h.x=i-s/2,h.y=a-s*n/2/r,h):0=u)?(h.x=i+o*r/2/n,h.y=a+o/2,h):(0>n&&(l<=-1*u||l>=u)&&(h.x=i-o*r/2/n,h.y=a-o/2),h)},o7n=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}}}}},l7n=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 o=n[i++],s=e.idToIndex[o],l=e.layoutNodes[s],u=l.children;if(0n)var a={x:n*e/i,y:n*r/i};else var a={x:e,y:r};return a},m9t=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)}}},h7n={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 y9t(t){this.options=ln({},h7n,t)}y9t.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=th(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 o=i.size(),s=Math.sqrt(o*a.h/a.w),l=Math.round(s),u=Math.round(a.w/a.h*s),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(o/l);else if(f==null&&p!=null)u=p,l=Math.ceil(o/u);else if(u*l>o){var g=h(),m=d();(g-1)*m>=o?h(g-1):(m-1)*g>=o&&d(m-1)}else for(;u*l=o?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++)},I={},N=0;N(D=J6n(t,e,M[I],M[I+1],M[I+2],M[I+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,I=0;I+5(D=Z6n(t,e,M[I],M[I+1],M[I+2],M[I+3],M[I+4],M[I+5])))return v(T,D),!0}for(var N=N||C.source,F=F||C.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}],I=0;I0&&(y(N),y(F))}function x(T,C,k){return eh(T,C,k)}function w(T,C){var k=T._private,E=f,_;C?_=C+"-":_="",T.boundingBox();var P=k.labelBounds[C||"main"],L=T.pstyle(_+"label").value,R=T.pstyle("text-events").strValue==="yes";if(!(!R||!L)){var D=x(k.rscratch,"labelX",C),M=x(k.rscratch,"labelY",C),I=x(k.rscratch,"labelAngle",C),N=T.pstyle(_+"text-margin-x").pfValue,F=T.pstyle(_+"text-margin-y").pfValue,B=P.x1-E-N,V=P.x2+E-N,z=P.y1-E-F,U=P.y2+E-F;if(I){var Q=Math.cos(I),G=Math.sin(I),q=function(pe,ie){return pe=pe-D,ie=ie-M,{x:pe*Q-ie*G+D,y:pe*G+ie*Q+M}},Y=q(B,z),ne=q(B,U),X=q(V,z),J=q(V,U),ee=[Y.x+N,Y.y+F,X.x+N,X.y+F,J.x+N,J.y+F,ne.x+N,ne.y+F];if(nd(t,e,ee))return v(T),!0}else if(aw(P,t,e))return v(T),!0}}for(var A=o.length-1;A>=0;A--){var S=o[A];S.isNode()?y(S)||w(S):b(S)||w(S)||w(S,"source")||w(S,"target")}return s},XC.getAllInBox=function(t,e,r,n){var i=this.getCachedZSortedEles().interactive,a=this.cy.zoom(),o=2/a,s=[],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=th({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(pe,ie,Ce){return eh(pe,ie,Ce)}function v(pe,ie){var Ce=pe._private,ke=o,Ee="";pe.boundingBox();var ue=Ce.labelBounds.main;if(!ue)return null;var de=m(Ce.rscratch,"labelX",ie),xe=m(Ce.rscratch,"labelY",ie),ge=m(Ce.rscratch,"labelAngle",ie),ze=pe.pstyle(Ee+"text-margin-x").pfValue,we=pe.pstyle(Ee+"text-margin-y").pfValue,Oe=ue.x1-ke-ze,Be=ue.x2+ke-ze,Z=ue.y1-ke-we,le=ue.y2+ke-we;if(ge){var be=Math.cos(ge),ae=Math.sin(ge),K=function(me,oe){return me=me-de,oe=oe-xe,{x:me*be-oe*ae+de,y:me*ae+oe*be+xe}};return[K(Oe,Z),K(Be,Z),K(Be,le),K(Oe,le)]}else return[{x:Oe,y:Z},{x:Be,y:Z},{x:Be,y:le},{x:Oe,y:le}]}function y(pe,ie,Ce,ke){function Ee(ue,de,xe){return(xe.y-ue.y)*(de.x-ue.x)>(de.y-ue.y)*(xe.x-ue.x)}return Ee(pe,Ce,ke)!==Ee(ie,Ce,ke)&&Ee(pe,ie,Ce)!==Ee(pe,ie,ke)}for(var b=0;b0?-(Math.PI-e.ang):Math.PI+e.ang},v7n=function(e,r,n,i,a){if(e!==E9t?_9t(r,e,K0):m7n(Ip,K0),_9t(r,n,Ip),T9t=K0.nx*Ip.ny-K0.ny*Ip.nx,C9t=K0.nx*Ip.nx-K0.ny*-Ip.ny,Y1=Math.asin(Math.max(-1,Math.min(1,T9t))),Math.abs(Y1)<1e-6){CEe=r.x,OEe=r.y,JC=c3=0;return}KC=1,lte=!1,C9t<0?Y1<0?Y1=Math.PI+Y1:(Y1=Math.PI-Y1,KC=-1,lte=!0):Y1>0&&(KC=-1,lte=!0),r.radius!==void 0?c3=r.radius:c3=i,ZC=Y1/2,cte=Math.min(K0.len/2,Ip.len/2),a?(Z0=Math.abs(Math.cos(ZC)*c3/Math.sin(ZC)),Z0>cte?(Z0=cte,JC=Math.abs(Z0*Math.sin(ZC)/Math.cos(ZC))):JC=c3):(Z0=Math.min(cte,c3),JC=Math.abs(Z0*Math.sin(ZC)/Math.cos(ZC))),kEe=r.x+Ip.nx*Z0,EEe=r.y+Ip.ny*Z0,CEe=kEe-Ip.ny*JC*KC,OEe=EEe+Ip.nx*JC*KC,O9t=r.x+K0.nx*Z0,k9t=r.y+K0.ny*Z0,E9t=r};function R9t(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 _Ee(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}:(v7n(t,e,r,n,i),{cx:CEe,cy:OEe,radius:JC,startX:O9t,startY:k9t,stopX:kEe,stopY:EEe,startAngle:K0.ang+Math.PI/2*KC,endAngle:Ip.ang-Math.PI/2*KC,counterClockwise:lte})}var d9=.01,y7n=Math.sqrt(2*d9),pu={};pu.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,a,o=t.pstyle("source-endpoint"),s=t.pstyle("target-endpoint"),l=o.units!=null&&s.units!=null,u=function(A,S,T,C){var k=C-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],o),f=qs(d,2),p=f[0],g=f[1],m=this.manualEndptToPx(t.target()[0],s),v=qs(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 aa("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}},pu.findHaystackPoints=function(t){for(var e=0;e0?Math.max(oe-ve,0):Math.min(oe+ve,0)},L=P(E,C),R=P(_,k),D=!1;b===u?y=Math.abs(L)>Math.abs(R)?i:n:b===l||b===s?(y=n,D=!0):(b===a||b===o)&&(y=i,D=!0);var M=y===n,I=M?R:L,N=M?_:E,F=ZOe(N),B=!1;!(D&&(w||S))&&(b===s&&N<0||b===l&&N>0||b===a&&N>0||b===o&&N<0)&&(F*=-1,I=F*Math.abs(I),B=!0);var V;if(w){var z=A<0?1+A:A;V=z*I}else{var U=A<0?I:0;V=U+A*F}var Q=function(oe){return Math.abs(oe)=Math.abs(I)},G=Q(V),q=Q(Math.abs(I)-Math.abs(V)),Y=G||q;if(Y&&!B)if(M){var ne=Math.abs(N)<=f/2,X=Math.abs(E)<=p/2;if(ne){var J=(h.x1+h.x2)/2,ee=h.y1,te=h.y2;r.segpts=[J,ee,J,te]}else if(X){var pe=(h.y1+h.y2)/2,ie=h.x1,Ce=h.x2;r.segpts=[ie,pe,Ce,pe]}else r.segpts=[h.x1,h.y2]}else{var ke=Math.abs(N)<=d/2,Ee=Math.abs(_)<=g/2;if(ke){var ue=(h.y1+h.y2)/2,de=h.x1,xe=h.x2;r.segpts=[de,ue,xe,ue]}else if(Ee){var ge=(h.x1+h.x2)/2,ze=h.y1,we=h.y2;r.segpts=[ge,ze,ge,we]}else r.segpts=[h.x2,h.y1]}else if(M){var Oe=h.y1+V+(v?f/2*F:0),Be=h.x1,Z=h.x2;r.segpts=[Be,Oe,Z,Oe]}else{var le=h.x1+V+(v?d/2*F:0),be=h.y1,ae=h.y2;r.segpts=[le,be,le,ae]}if(r.isRound){var K=t.pstyle("taxi-radius").value,se=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(K),r.isArcRadius=new Array(r.segpts.length/2).fill(se)}},pu.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,i=e.tgtPos,a=e.srcW,o=e.srcH,s=e.tgtW,l=e.tgtH,u=e.srcShape,h=e.tgtShape,d=e.srcCornerRadius,f=e.tgtCornerRadius,p=e.srcRs,g=e.tgtRs,m=!sr(r.startX)||!sr(r.startY),v=!sr(r.arrowStartX)||!sr(r.arrowStartY),y=!sr(r.endX)||!sr(r.endY),b=!sr(r.arrowEndX)||!sr(r.arrowEndY),x=3,w=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,A=x*w,S=HC({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),T=SN.poolIndex()){var F=I;I=N,N=F}var B=L.srcPos=I.position(),V=L.tgtPos=N.position(),z=L.srcW=I.outerWidth(),U=L.srcH=I.outerHeight(),Q=L.tgtW=N.outerWidth(),G=L.tgtH=N.outerHeight(),q=L.srcShape=r.nodeShapes[e.getNodeShape(I)],Y=L.tgtShape=r.nodeShapes[e.getNodeShape(N)],ne=L.srcCornerRadius=I.pstyle("corner-radius").value==="auto"?"auto":I.pstyle("corner-radius").pfValue,X=L.tgtCornerRadius=N.pstyle("corner-radius").value==="auto"?"auto":N.pstyle("corner-radius").pfValue,J=L.tgtRs=N._private.rscratch,ee=L.srcRs=I._private.rscratch;L.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var te=0;te=y7n||(Z=Math.sqrt(Math.max(Be*Be,d9)+Math.max(Oe*Oe,d9)));var le=L.vector={x:Be,y:Oe},be=L.vectorNorm={x:le.x/Z,y:le.y/Z},ae={x:-be.y,y:be.x};L.nodesOverlap=!sr(Z)||Y.checkPoint(ue[0],ue[1],0,Q,G,V.x,V.y,X,J)||q.checkPoint(xe[0],xe[1],0,z,U,B.x,B.y,ne,ee),L.vectorNormInverse=ae,R={nodesOverlap:L.nodesOverlap,dirCounts:L.dirCounts,calculatedIntersection:!0,hasBezier:L.hasBezier,hasUnbundled:L.hasUnbundled,eles:L.eles,srcPos:V,srcRs:J,tgtPos:B,tgtRs:ee,srcW:Q,srcH:G,tgtW:z,tgtH:U,srcIntn:ge,tgtIntn:de,srcShape:Y,tgtShape:q,posPts:{x1:we.x2,y1:we.y2,x2:we.x1,y2:we.y1},intersectionPts:{x1:ze.x2,y1:ze.y2,x2:ze.x1,y2:ze.y1},vector:{x:-le.x,y:-le.y},vectorNorm:{x:-be.x,y:-be.y},vectorNormInverse:{x:-ae.x,y:-ae.y}}}var K=Ee?R:L;ie.nodesOverlap=K.nodesOverlap,ie.srcIntn=K.srcIntn,ie.tgtIntn=K.tgtIntn,ie.isRound=Ce.startsWith("round"),i&&(I.isParent()||I.isChild()||N.isParent()||N.isChild())&&(I.parents().anySame(N)||N.parents().anySame(I)||I.same(N)&&I.isParent())?e.findCompoundLoopPoints(pe,K,te,ke):I===N?e.findLoopPoints(pe,K,te,ke):Ce.endsWith("segments")?e.findSegmentsPoints(pe,K):Ce.endsWith("taxi")?e.findTaxiPoints(pe,K):Ce==="straight"||!ke&&L.eles.length%2===1&&te===Math.floor(L.eles.length/2)?e.findStraightEdgePoints(pe):e.findBezierPoints(pe,K,te,ke,Ee),e.findEndpoints(pe),e.tryToCorrectInvalidPoints(pe,K),e.checkForInvalidEdgeWarning(pe),e.storeAllpts(pe),e.storeEdgeProjections(pe),e.calculateArrowAngles(pe),e.recalculateEdgeLabelProjections(pe),e.calculateLabelAngles(pe)}},T=0;T0){var ue=u,de=WC(ue,W4(o)),xe=WC(ue,W4(Ee)),ge=de;if(xe2){var ze=WC(ue,{x:Ee[2],y:Ee[3]});ze0){var ce=h,De=WC(ce,W4(o)),Le=WC(ce,W4(ve)),We=De;if(Le2){var Ne=WC(ce,{x:ve[2],y:ve[3]});Ne=g||T){v={cp:w,segment:S};break}}if(v)break}var C=v.cp,k=v.segment,E=(g-y)/k.length,_=k.t1-k.t0,P=p?k.t0+_*E:k.t1-_*E;P=KF(0,P,1),e=Y4(C.p0,C.p1,C.p2,P),f=x7n(C.p0,C.p1,C.p2,P);break}case"straight":case"segments":case"haystack":{for(var L=0,R,D,M,I,N=n.allpts.length,F=0;F+3=g));F+=2);var B=g-D,V=B/R;V=KF(0,V,1),e=U6n(M,I,V),f=M9t(M,I);break}}o("labelX",d,e.x),o("labelY",d,e.y),o("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}},J0.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},J0.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=GC(n,t._private.labelDimsKey);if(eh(r.rscratch,"prefixedLabelDimsKey",e)!==i){j0(r.rscratch,"prefixedLabelDimsKey",e,i);var a=this.calculateLabelDimensions(t,n),o=t.pstyle("line-height").pfValue,s=t.pstyle("font-size").pfValue,l=t.pstyle("text-wrap").strValue,u=eh(r.rscratch,"labelWrapCachedLines",e)||[],h=l!=="wrap"?1:Math.max(u.length,1),d=s*o,f=a.width,p=a.height+(h-1)*(o-1)*s;j0(r.rstyle,"labelWidth",e,f),j0(r.rscratch,"labelWidth",e,f),j0(r.rstyle,"labelHeight",e,p),j0(r.rscratch,"labelHeight",e,p),j0(r.rscratch,"labelLineHeight",e,d),j0(r.rscratch,"labelActualDescent",e,a.labelActualDescent)}},J0.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,a=t.pstyle("text-transform").value,o=function(U,Q){return Q?(j0(r.rscratch,U,e,Q),Q):eh(r.rscratch,U,e)};if(!i)return"";a=="none"||(a=="uppercase"?i=i.toUpperCase():a=="lowercase"&&(i=i.toLowerCase()));var s=t.pstyle("text-wrap").value;if(s==="wrap"){var l=o("labelKey");if(l!=null&&o("labelWrapKey")===l)return o("labelWrapCachedText");for(var u="​",h=i.split(` + */var GFt=function(e,r){this.recycle(e,r)};function o9(){return!1}function Hee(){return!0}GFt.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?Hee: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=Hee;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Hee;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Hee,this.stopPropagation()},isDefaultPrevented:o9,isPropagationStopped:o9,isImmediatePropagationStopped:o9};var HFt=/^([^.]+)(\.(?:[^.]+))?$/,CBn=".*",WFt={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},YFt=Object.keys(WFt),OBn={};function Wee(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:OBn,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;s--)o(s);return this},pw.removeAllListeners=function(){return this.removeListener("*")},pw.emit=pw.trigger=function(t,e,r){var n=this.listeners,i=n.length;return this.emitting++,Ma(e)||(e=[e]),kBn(this,function(a,o){r!=null&&(n=[{event:o.event,type:o.type,namespace:o.namespace,callback:r}],i=n.length);for(var s=function(){var h=n[l];if(h.type===o.type&&(!h.namespace||h.namespace===o.namespace||h.namespace===CBn)&&a.eventMatches(a.context,h,o)){var d=[o];e!=null&&g6n(d,e),a.beforeEmit(a.context,h,o),h.conf&&h.conf.one&&(a.listeners=a.listeners.filter(function(g){return g!==h}));var f=a.callbackContext(a.context,h,o),p=h.callback.apply(f,d);a.afterEmit(a.context,h,o),p===!1&&(o.stopPropagation(),o.preventDefault())}},l=0;l1&&!o){var s=this.length-1,l=this[s],u=l._private.data.id;this[s]=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 o=a.index;return this.unmergeAt(o),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&Yr(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=s)}return{value:n,ele:i}},min:function(e,r){for(var n=1/0,i,a=this,o=0;o=0&&a"u"?"undefined":dl(Symbol))!=e&&dl(Symbol.iterator)!=e;r&&(qee[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},a=0,o=this.length;return i7t({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(Bi(e)){var o=e;a.applyBypass(this,o,i),this.emitAndNotify("style")}else if(Yr(e))if(r===void 0){var s=this[0];return s?a.getStylePropertyValue(s,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 o=0;o0&&e.push(h[0]),e.push(s[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)}}),du.neighbourhood=du.neighborhood,du.closedNeighbourhood=du.closedNeighborhood,du.openNeighbourhood=du.openNeighborhood,ln(du,{source:Lp(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:Lp(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:i9t({attr:"source"}),targets:i9t({attr:"target"})});function i9t(t){return function(r){for(var n=[],i=0;i0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),du.componentsOf=du.components;var Oc=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){Co("A collection must have a reference to the core");return}var a=new H1,o=!1;if(!r)r=[];else if(r.length>0&&Bi(r[0])&&!VF(r[0])){o=!0;for(var s=[],l=new H4,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=[],o=[],s,l=0,u=r.length;l0){for(var F=s.length===r.length?r:new Oc(n,s),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 o(R){for(var D=R._private.edges,M=0;M0&&(t?_.emitAndNotify("remove"):e&&_.emit("remove"));for(var P=0;P0?P=R:_=R;while(Math.abs(L)>o&&++D=a?b(E,D):M===0?D:w(E,_,_+u)}var S=!1;function T(){S=!0,(t!==e||r!==n)&&x()}var C=function(_){return S||T(),t===e&&r===n?_:_===0?0:_===1?1:v(A(_),e,n)};C.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var k="generateBezier("+[t,e,r,n]+")";return C.toString=function(){return k},C}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var $Bn=function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,i,a){var o={x:n.x+a.dx*i,v:n.v+a.dv*i,tension:n.tension,friction:n.friction};return{dx:o.v,dv:t(o)}}function r(n,i){var a={dx:n.v,dv:t(n)},o=e(n,i*.5,a),s=e(n,i*.5,o),l=e(n,i,s),u=1/6*(a.dx+2*(o.dx+s.dx)+l.dx),h=1/6*(a.dv+2*(o.dv+s.dv)+l.dv);return n.x=n.x+u*i,n.v=n.v+h*i,n}return function n(i,a,o){var s={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,o=o||null,s.tension=i,s.friction=a,f=o!==null,f?(u=n(i,a),p=u/o*d):p=d;g=r(g||s,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}}(),Va=function(e,r,n,i){var a=BBn(e,r,n,i);return function(o,s,l){return o+(s-o)*a(l)}},Zee={linear:function(e,r,n){return e+(r-e)*n},ease:Va(.25,.1,.25,1),"ease-in":Va(.42,0,1,1),"ease-out":Va(0,0,.58,1),"ease-in-out":Va(.42,0,.58,1),"ease-in-sine":Va(.47,0,.745,.715),"ease-out-sine":Va(.39,.575,.565,1),"ease-in-out-sine":Va(.445,.05,.55,.95),"ease-in-quad":Va(.55,.085,.68,.53),"ease-out-quad":Va(.25,.46,.45,.94),"ease-in-out-quad":Va(.455,.03,.515,.955),"ease-in-cubic":Va(.55,.055,.675,.19),"ease-out-cubic":Va(.215,.61,.355,1),"ease-in-out-cubic":Va(.645,.045,.355,1),"ease-in-quart":Va(.895,.03,.685,.22),"ease-out-quart":Va(.165,.84,.44,1),"ease-in-out-quart":Va(.77,0,.175,1),"ease-in-quint":Va(.755,.05,.855,.06),"ease-out-quint":Va(.23,1,.32,1),"ease-in-out-quint":Va(.86,0,.07,1),"ease-in-expo":Va(.95,.05,.795,.035),"ease-out-expo":Va(.19,1,.22,1),"ease-in-out-expo":Va(1,0,0,1),"ease-in-circ":Va(.6,.04,.98,.335),"ease-out-circ":Va(.075,.82,.165,1),"ease-in-out-circ":Va(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return Zee.linear;var i=$Bn(e,r,n);return function(a,o,s){return a+(o-a)*i(s)}},"cubic-bezier":Va};function s9t(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 l9t(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function s3(t,e,r,n,i){var a=i!=null?i.type:null;r<0?r=0:r>1&&(r=1);var o=l9t(t,i),s=l9t(e,i);if(sr(o)&&sr(s))return s9t(a,o,s,r,n);if(Ma(o)&&Ma(s)){for(var l=[],u=0;u0?(p==="spring"&&g.push(o.duration),o.easingImpl=Zee[p].apply(null,g)):o.easingImpl=Zee[p]}var m=o.easingImpl,v;if(o.duration===0?v=1:v=(r-l)/o.duration,o.applying&&(v=o.progress),v<0?v=0:v>1&&(v=1),o.delay==null){var y=o.startPosition,b=o.position;if(b&&i&&!t.locked()){var x={};s9(y.x,b.x)&&(x.x=s3(y.x,b.x,v,m)),s9(y.y,b.y)&&(x.y=s3(y.y,b.y,v,m)),t.position(x)}var w=o.startPan,A=o.pan,S=a.pan,T=A!=null&&n;T&&(s9(w.x,A.x)&&(S.x=s3(w.x,A.x,v,m)),s9(w.y,A.y)&&(S.y=s3(w.y,A.y,v,m)),t.emit("pan"));var C=o.startZoom,k=o.zoom,E=k!=null&&n;E&&(s9(C,k)&&(a.zoom=KF(a.minZoom,s3(C,k,v,m),a.maxZoom)),t.emit("zoom")),(T||E)&&t.emit("viewport");var _=o.style;if(_&&_.length>0&&i){for(var P=0;P<_.length;P++){var L=_[P],R=L.name,D=L,M=o.startStyle[R],I=h.properties[M.name],N=s3(M,D,v,m,I);h.overrideBypass(t,R,N)}t.emit("style")}}return o.progress=v,v}function s9(t,e){return t==null||e==null?!1:sr(t)&&sr(e)?!0:!!(t&&e)}function zBn(t,e,r,n){var i=e._private;i.started=!0,i.startTime=r-i.progress*i.duration}function c9t(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 C=S[T];C()}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||zBn(h,x,t),FBn(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,o=0;o0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var UBn={animate:oa.animate(),animation:oa.animation(),animated:oa.animated(),clearQueue:oa.clearQueue(),delay:oa.delay(),delayAnimation:oa.delayAnimation(),stop:oa.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&&Aee(function(a){c9t(a,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(a,o){c9t(o,e)},n.beforeRenderPriorities.animations):r()}},VBn={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&&VF(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}},Jee=function(e){return Yr(e)?new cw(e):e},u9t={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Wee(VBn,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,Jee(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,Jee(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,Jee(r),n),this},once:function(e,r,n){return this.emitter().one(e,Jee(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}};oa.eventAliasesOn(u9t);var yEe={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)}};yEe.jpeg=yEe.jpg;var ete={layout:function(e){var r=this;if(e==null){Co("Layout options must be specified to make a layout");return}if(e.name==null){Co("A `name` must be specified to make a layout");return}var n=e.name,i=r.extension("layout",n);if(i==null){Co("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;Yr(e.eles)?a=r.$(e.eles):a=e.eles!=null?e.eles:r.$();var o=new i(ln({},e,{cy:r,eles:a}));return o}};ete.createLayout=ete.makeLayout=ete.layout;var QBn={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)}};bEe.invalidateDimensions=bEe.resize;var tte={collection:function(e,r){return Yr(e)?this.$(e):pf(e)?e.collection():Ma(e)?(r||(r={}),new Oc(this,e,r.unique,r.removed)):new Oc(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}};tte.elements=tte.filter=tte.$;var Wl={},l9="t",HBn="f";Wl.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),s.color){var S=n.valueMin[0],T=n.valueMax[0],C=n.valueMin[1],k=n.valueMax[1],E=n.valueMin[2],_=n.valueMax[2],P=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(C+(k-C)*w),Math.round(E+(_-E)*w),Math.round(P+(L-P)*w)];a={bypass:n.bypass,name:n.name,value:R,strValue:"rgb("+R[0]+", "+R[1]+", "+R[2]+")"}}else if(s.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 o.data:{for(var M=n.field.split("."),I=d.data,N=0;N0&&a>0){for(var s={},l=!1,u=0;u0?t.delayAnimation(o).play().promise().then(x):x()}).then(function(){return t.animation({style:s,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)},Wl.checkTrigger=function(t,e,r,n,i,a){var o=this.properties[e],s=i(o);t.removed()||s!=null&&s(r,n,t)&&a(o)},Wl.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)})},Wl.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(i){return i.triggersBounds},function(i){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache()})},Wl.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()})})},Wl.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()})})},Wl.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 c9={};c9.applyBypass=function(t,e,r,n){var i=this,a=[],o=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var s=0;si.length?n=n.substr(i.length):n=""}function l(){a.length>o.length?a=a.substr(o.length):a=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var h=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){aa("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 cw(d);if(f.invalid){aa("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),s();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){aa("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+p),g=!0;break}o=y[0];var b=y[1],x=y[2],w=e.properties[b];if(!w){aa("Skipping property: Invalid property name in: "+o),l();continue}var A=r.parse(b,x);if(!A){aa("Skipping property: Invalid property definition in: "+o),l();continue}m.push({name:b,val:x}),l()}if(g){s();break}r.selector(d);for(var S=0;S=7&&e[0]==="d"&&(h=new RegExp(s.data.regex).exec(e))){if(r)return!1;var f=s.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(s.mapData.regex).exec(e))){if(r||u.multiple)return!1;var p=s.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 aa("`"+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+/):Ma(e)?x=e:x=[e],u.evenMultiple&&x.length%2!==0)return null;for(var w=[],A=[],S=[],T="",C=!1,k=0;k0?" ":"")+E.strValue}return u.validate&&!u.validate(w,A)?null:u.singleEnum&&C?w.length===1&&Yr(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 X=0;Xu.max||u.strictMax&&e===u.max))return null;var M={name:t,value:e,strValue:""+e+(P||""),units:P,bypass:r};return u.unitless||P!=="px"&&P!=="em"?M.pfValue=e:M.pfValue=P==="px"||!P?e:this.getEmSizeInPixels()*e,(P==="ms"||P==="s")&&(M.pfValue=P==="ms"?e:1e3*e),(P==="deg"||P==="rad")&&(M.pfValue=P==="rad"?e:U6n(e)),P==="%"&&(M.pfValue=e/100),M}else if(u.propList){var I=[],N=""+e;if(N!=="none"){for(var F=N.split(/\s*,\s*|\s+/),B=0;B0&&s>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((o-2*r)/n.w,(s-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,o,s=!1;if(r.zoomingEnabled||(s=!0),sr(e)?o=e:Bi(e)&&(o=e.level,e.position!=null?a=kee(e.position,i,n):e.renderedPosition!=null&&(a=e.renderedPosition),a!=null&&!r.panningEnabled&&(s=!0)),o=o>r.maxZoom?r.maxZoom:o,o=or.maxZoom||!r.zoomingEnabled?o=!0:(r.zoom=l,a.push("zoom"))}if(i&&(!o||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;sr(u.x)&&(r.pan.x=u.x,s=!1),sr(u.y)&&(r.pan.y=u.y,s=!1),s||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(Yr(e)){var n=e;e=this.mutableElements().filter(n)}else pf(e)||(e=this.mutableElements());if(e.length!==0){var i=e.boundingBox(),a=this.width(),o=this.height();r=r===void 0?this._private.zoom:r;var s={x:(a-r*(i.x1+i.x2))/2,y:(o-r*(i.y1+i.y2))/2};return s}}},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(s){return parseFloat(i.getPropertyValue(s))};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}};jC.centre=jC.center,jC.autolockNodes=jC.autolock,jC.autoungrabifyNodes=jC.autoungrabify;var u9={data:oa.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:oa.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:oa.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:oa.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};u9.attr=u9.data,u9.removeAttr=u9.removeData;var h9=function(e){var r=this;e=ln({},e);var n=e.container;n&&!yee(n)&&yee(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 o=fl!==void 0&&n!==void 0&&!e.headless,s=e;s.layout=ln({name:o?"grid":"null"},s.layout),s.renderer=ln({name:o?"canvas":"null"},s.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:s,elements:new Oc(this),listeners:[],aniEles:new Oc(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,s.zoomingEnabled),userZoomingEnabled:l(!0,s.userZoomingEnabled),panningEnabled:l(!0,s.panningEnabled),userPanningEnabled:l(!0,s.userPanningEnabled),boxSelectionEnabled:l(!0,s.boxSelectionEnabled),autolock:l(!1,s.autolock,s.autolockNodes),autoungrabify:l(!1,s.autoungrabify,s.autoungrabifyNodes),autounselectify:l(!1,s.autounselectify),styleEnabled:s.styleEnabled===void 0?o:s.styleEnabled,zoom:sr(s.zoom)?s.zoom:1,pan:{x:Bi(s.pan)&&sr(s.pan.x)?s.pan.x:0,y:Bi(s.pan)&&sr(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,s.multiClickDebounceTime)};this.createEmitter(),this.selectionType(s.selectionType),this.zoomRange({min:s.minZoom,max:s.maxZoom});var h=function(g,m){var v=g.some(IPn);if(v)return Z4.all(g).then(m);m(g)};u.styleEnabled&&r.setStyle([]);var d=ln({},s,s.renderer);r.initRenderer(d);var f=function(g,m,v){r.notifications(!1);var y=r.mutableElements();y.length>0&&y.remove(),g!=null&&(Bi(g)||Ma(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=ln({},r._private.options.layout);b.eles=r.elements(),r.layout(b).run()};h([s.style,s.elements],function(p){var g=p[0],m=p[1];u.styleEnabled&&r.style().append(g),f(m,function(){r.startAnimationLoop(),u.ready=!0,Io(s.ready)&&r.on("ready",s.ready);for(var v=0;v0,s=!!t.boundingBox,l=th(s?t.boundingBox:structuredClone(e.extent())),u;if(pf(t.roots))u=t.roots;else if(Ma(t.roots)){for(var h=[],d=0;d0;){var R=L(),D=k(R,_);if(D)R.outgoers().filter(function(de){return de.isNode()&&r.has(de)}).forEach(P);else if(D===null){aa("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 I=0;I0&&y[0].length<=3?Oe/2:0),Z=2*Math.PI/y[ze].length*we;return ze===0&&y[0].length===1&&(Be=1),{x:te.x+Be*Math.cos(Z),y:te.y+Be*Math.sin(Z)}}else{var le=y[ze].length,be=Math.max(le===1?0:s?(l.w-t.padding*2-pe.w)/((t.grid?Ce:le)-1):(l.w-t.padding*2-pe.w)/((t.grid?Ce:le)+1),M),ae={x:te.x+(we+1-(le+1)/2)*be,y:te.y+(ze+1-(G+1)/2)*ie};return ae}},Ee={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(Ee).indexOf(t.direction)===-1&&Co("Invalid direction '".concat(t.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Ee).join(", ")));var ue=function(xe){return c6n(ke(xe),l,Ee[t.direction])};return r.nodes().layoutPositions(this,t,ue),this};var XBn={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 f9t(t){this.options=ln({},XBn,t)}f9t.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 o=th(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s={x:o.x1+o.w/2,y:o.y1+o.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 C=e.startAngle+T*u*(i?1:-1),k=h*Math.cos(C),E=h*Math.sin(C),_={x:s.x+k,y:s.y+E};return _};return n.nodes().layoutPositions(this,e,w),this};var KBn={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 p9t(t){this.options=ln({},KBn,t)}p9t.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"),o=th(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),s={x:o.x1+o.w/2,y:o.y1+o.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,C=Math.min(o.w,o.h)/2-S,k=C/(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),I=Math.sqrt(S*S/(D*D+M*M));E=Math.max(I,E)}P.r=E,E+=S}if(e.equidistant){for(var N=0,F=0,B=0;B=t.numIter||(i7n(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature=t.animationThreshold&&a(),Aee(h)}};h()}else{for(;u;)u=o(l),l++;b9t(n,t),s()}return this},ate.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},ate.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var JBn=function(e,r,n){for(var i=n.eles.edges(),a=n.eles.nodes(),o=th(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),s={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},l=n.eles.components(),u={},h=0;h0){s.graphSet.push(C);for(var h=0;hi.count?0:i.graph},g9t=function(e,r,n,i){var a=i.graphSet[n];if(-10)var d=i.nodeOverlap*h,f=Math.sqrt(s*s+l*l),p=d*s/f,g=d*l/f;else var m=ote(e,s,l),v=ote(r,-1*s,-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)}},s7n=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 o=e.maxY-r.minY;else var o=r.maxY-e.minY;return a>=0&&o>=0?Math.sqrt(a*a+o*o):0},ote=function(e,r,n){var i=e.positionX,a=e.positionY,o=e.height||1,s=e.width||1,l=n/r,u=o/s,h={};return r===0&&0n?(h.x=i,h.y=a+o/2,h):0r&&-1*u<=l&&l<=u?(h.x=i-s/2,h.y=a-s*n/2/r,h):0=u)?(h.x=i+o*r/2/n,h.y=a+o/2,h):(0>n&&(l<=-1*u||l>=u)&&(h.x=i-o*r/2/n,h.y=a-o/2),h)},l7n=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}}}}},u7n=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 o=n[i++],s=e.idToIndex[o],l=e.layoutNodes[s],u=l.children;if(0n)var a={x:n*e/i,y:n*r/i};else var a={x:e,y:r};return a},y9t=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)}}},f7n={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 x9t(t){this.options=ln({},f7n,t)}x9t.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=th(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 o=i.size(),s=Math.sqrt(o*a.h/a.w),l=Math.round(s),u=Math.round(a.w/a.h*s),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(o/l);else if(f==null&&p!=null)u=p,l=Math.ceil(o/u);else if(u*l>o){var g=h(),m=d();(g-1)*m>=o?h(g-1):(m-1)*g>=o&&d(m-1)}else for(;u*l=o?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++)},I={},N=0;N(D=tNn(t,e,M[I],M[I+1],M[I+2],M[I+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,I=0;I+5(D=eNn(t,e,M[I],M[I+1],M[I+2],M[I+3],M[I+4],M[I+5])))return v(T,D),!0}for(var N=N||C.source,F=F||C.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}],I=0;I0&&(y(N),y(F))}function x(T,C,k){return eh(T,C,k)}function w(T,C){var k=T._private,E=f,_;C?_=C+"-":_="",T.boundingBox();var P=k.labelBounds[C||"main"],L=T.pstyle(_+"label").value,R=T.pstyle("text-events").strValue==="yes";if(!(!R||!L)){var D=x(k.rscratch,"labelX",C),M=x(k.rscratch,"labelY",C),I=x(k.rscratch,"labelAngle",C),N=T.pstyle(_+"text-margin-x").pfValue,F=T.pstyle(_+"text-margin-y").pfValue,B=P.x1-E-N,V=P.x2+E-N,z=P.y1-E-F,U=P.y2+E-F;if(I){var Q=Math.cos(I),G=Math.sin(I),q=function(pe,ie){return pe=pe-D,ie=ie-M,{x:pe*Q-ie*G+D,y:pe*G+ie*Q+M}},Y=q(B,z),ne=q(B,U),X=q(V,z),J=q(V,U),ee=[Y.x+N,Y.y+F,X.x+N,X.y+F,J.x+N,J.y+F,ne.x+N,ne.y+F];if(nd(t,e,ee))return v(T),!0}else if(aw(P,t,e))return v(T),!0}}for(var A=o.length-1;A>=0;A--){var S=o[A];S.isNode()?y(S)||w(S):b(S)||w(S)||w(S,"source")||w(S,"target")}return s},XC.getAllInBox=function(t,e,r,n){var i=this.getCachedZSortedEles().interactive,a=this.cy.zoom(),o=2/a,s=[],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=th({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(pe,ie,Ce){return eh(pe,ie,Ce)}function v(pe,ie){var Ce=pe._private,ke=o,Ee="";pe.boundingBox();var ue=Ce.labelBounds.main;if(!ue)return null;var de=m(Ce.rscratch,"labelX",ie),xe=m(Ce.rscratch,"labelY",ie),ge=m(Ce.rscratch,"labelAngle",ie),ze=pe.pstyle(Ee+"text-margin-x").pfValue,we=pe.pstyle(Ee+"text-margin-y").pfValue,Oe=ue.x1-ke-ze,Be=ue.x2+ke-ze,Z=ue.y1-ke-we,le=ue.y2+ke-we;if(ge){var be=Math.cos(ge),ae=Math.sin(ge),K=function(me,oe){return me=me-de,oe=oe-xe,{x:me*be-oe*ae+de,y:me*ae+oe*be+xe}};return[K(Oe,Z),K(Be,Z),K(Be,le),K(Oe,le)]}else return[{x:Oe,y:Z},{x:Be,y:Z},{x:Be,y:le},{x:Oe,y:le}]}function y(pe,ie,Ce,ke){function Ee(ue,de,xe){return(xe.y-ue.y)*(de.x-ue.x)>(de.y-ue.y)*(xe.x-ue.x)}return Ee(pe,Ce,ke)!==Ee(ie,Ce,ke)&&Ee(pe,ie,Ce)!==Ee(pe,ie,ke)}for(var b=0;b0?-(Math.PI-e.ang):Math.PI+e.ang},b7n=function(e,r,n,i,a){if(e!==R9t?D9t(r,e,K0):y7n(Ip,K0),D9t(r,n,Ip),O9t=K0.nx*Ip.ny-K0.ny*Ip.nx,k9t=K0.nx*Ip.nx-K0.ny*-Ip.ny,Y1=Math.asin(Math.max(-1,Math.min(1,O9t))),Math.abs(Y1)<1e-6){CEe=r.x,OEe=r.y,JC=c3=0;return}KC=1,lte=!1,k9t<0?Y1<0?Y1=Math.PI+Y1:(Y1=Math.PI-Y1,KC=-1,lte=!0):Y1>0&&(KC=-1,lte=!0),r.radius!==void 0?c3=r.radius:c3=i,ZC=Y1/2,cte=Math.min(K0.len/2,Ip.len/2),a?(Z0=Math.abs(Math.cos(ZC)*c3/Math.sin(ZC)),Z0>cte?(Z0=cte,JC=Math.abs(Z0*Math.sin(ZC)/Math.cos(ZC))):JC=c3):(Z0=Math.min(cte,c3),JC=Math.abs(Z0*Math.sin(ZC)/Math.cos(ZC))),kEe=r.x+Ip.nx*Z0,EEe=r.y+Ip.ny*Z0,CEe=kEe-Ip.ny*JC*KC,OEe=EEe+Ip.nx*JC*KC,E9t=r.x+K0.nx*Z0,_9t=r.y+K0.ny*Z0,R9t=r};function L9t(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 _Ee(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}:(b7n(t,e,r,n,i),{cx:CEe,cy:OEe,radius:JC,startX:E9t,startY:_9t,stopX:kEe,stopY:EEe,startAngle:K0.ang+Math.PI/2*KC,endAngle:Ip.ang-Math.PI/2*KC,counterClockwise:lte})}var d9=.01,x7n=Math.sqrt(2*d9),pu={};pu.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,a,o=t.pstyle("source-endpoint"),s=t.pstyle("target-endpoint"),l=o.units!=null&&s.units!=null,u=function(A,S,T,C){var k=C-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],o),f=qs(d,2),p=f[0],g=f[1],m=this.manualEndptToPx(t.target()[0],s),v=qs(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 aa("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}},pu.findHaystackPoints=function(t){for(var e=0;e0?Math.max(oe-ve,0):Math.min(oe+ve,0)},L=P(E,C),R=P(_,k),D=!1;b===u?y=Math.abs(L)>Math.abs(R)?i:n:b===l||b===s?(y=n,D=!0):(b===a||b===o)&&(y=i,D=!0);var M=y===n,I=M?R:L,N=M?_:E,F=ZOe(N),B=!1;!(D&&(w||S))&&(b===s&&N<0||b===l&&N>0||b===a&&N>0||b===o&&N<0)&&(F*=-1,I=F*Math.abs(I),B=!0);var V;if(w){var z=A<0?1+A:A;V=z*I}else{var U=A<0?I:0;V=U+A*F}var Q=function(oe){return Math.abs(oe)=Math.abs(I)},G=Q(V),q=Q(Math.abs(I)-Math.abs(V)),Y=G||q;if(Y&&!B)if(M){var ne=Math.abs(N)<=f/2,X=Math.abs(E)<=p/2;if(ne){var J=(h.x1+h.x2)/2,ee=h.y1,te=h.y2;r.segpts=[J,ee,J,te]}else if(X){var pe=(h.y1+h.y2)/2,ie=h.x1,Ce=h.x2;r.segpts=[ie,pe,Ce,pe]}else r.segpts=[h.x1,h.y2]}else{var ke=Math.abs(N)<=d/2,Ee=Math.abs(_)<=g/2;if(ke){var ue=(h.y1+h.y2)/2,de=h.x1,xe=h.x2;r.segpts=[de,ue,xe,ue]}else if(Ee){var ge=(h.x1+h.x2)/2,ze=h.y1,we=h.y2;r.segpts=[ge,ze,ge,we]}else r.segpts=[h.x2,h.y1]}else if(M){var Oe=h.y1+V+(v?f/2*F:0),Be=h.x1,Z=h.x2;r.segpts=[Be,Oe,Z,Oe]}else{var le=h.x1+V+(v?d/2*F:0),be=h.y1,ae=h.y2;r.segpts=[le,be,le,ae]}if(r.isRound){var K=t.pstyle("taxi-radius").value,se=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(K),r.isArcRadius=new Array(r.segpts.length/2).fill(se)}},pu.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,i=e.tgtPos,a=e.srcW,o=e.srcH,s=e.tgtW,l=e.tgtH,u=e.srcShape,h=e.tgtShape,d=e.srcCornerRadius,f=e.tgtCornerRadius,p=e.srcRs,g=e.tgtRs,m=!sr(r.startX)||!sr(r.startY),v=!sr(r.arrowStartX)||!sr(r.arrowStartY),y=!sr(r.endX)||!sr(r.endY),b=!sr(r.arrowEndX)||!sr(r.arrowEndY),x=3,w=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,A=x*w,S=HC({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),T=SN.poolIndex()){var F=I;I=N,N=F}var B=L.srcPos=I.position(),V=L.tgtPos=N.position(),z=L.srcW=I.outerWidth(),U=L.srcH=I.outerHeight(),Q=L.tgtW=N.outerWidth(),G=L.tgtH=N.outerHeight(),q=L.srcShape=r.nodeShapes[e.getNodeShape(I)],Y=L.tgtShape=r.nodeShapes[e.getNodeShape(N)],ne=L.srcCornerRadius=I.pstyle("corner-radius").value==="auto"?"auto":I.pstyle("corner-radius").pfValue,X=L.tgtCornerRadius=N.pstyle("corner-radius").value==="auto"?"auto":N.pstyle("corner-radius").pfValue,J=L.tgtRs=N._private.rscratch,ee=L.srcRs=I._private.rscratch;L.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var te=0;te=x7n||(Z=Math.sqrt(Math.max(Be*Be,d9)+Math.max(Oe*Oe,d9)));var le=L.vector={x:Be,y:Oe},be=L.vectorNorm={x:le.x/Z,y:le.y/Z},ae={x:-be.y,y:be.x};L.nodesOverlap=!sr(Z)||Y.checkPoint(ue[0],ue[1],0,Q,G,V.x,V.y,X,J)||q.checkPoint(xe[0],xe[1],0,z,U,B.x,B.y,ne,ee),L.vectorNormInverse=ae,R={nodesOverlap:L.nodesOverlap,dirCounts:L.dirCounts,calculatedIntersection:!0,hasBezier:L.hasBezier,hasUnbundled:L.hasUnbundled,eles:L.eles,srcPos:V,srcRs:J,tgtPos:B,tgtRs:ee,srcW:Q,srcH:G,tgtW:z,tgtH:U,srcIntn:ge,tgtIntn:de,srcShape:Y,tgtShape:q,posPts:{x1:we.x2,y1:we.y2,x2:we.x1,y2:we.y1},intersectionPts:{x1:ze.x2,y1:ze.y2,x2:ze.x1,y2:ze.y1},vector:{x:-le.x,y:-le.y},vectorNorm:{x:-be.x,y:-be.y},vectorNormInverse:{x:-ae.x,y:-ae.y}}}var K=Ee?R:L;ie.nodesOverlap=K.nodesOverlap,ie.srcIntn=K.srcIntn,ie.tgtIntn=K.tgtIntn,ie.isRound=Ce.startsWith("round"),i&&(I.isParent()||I.isChild()||N.isParent()||N.isChild())&&(I.parents().anySame(N)||N.parents().anySame(I)||I.same(N)&&I.isParent())?e.findCompoundLoopPoints(pe,K,te,ke):I===N?e.findLoopPoints(pe,K,te,ke):Ce.endsWith("segments")?e.findSegmentsPoints(pe,K):Ce.endsWith("taxi")?e.findTaxiPoints(pe,K):Ce==="straight"||!ke&&L.eles.length%2===1&&te===Math.floor(L.eles.length/2)?e.findStraightEdgePoints(pe):e.findBezierPoints(pe,K,te,ke,Ee),e.findEndpoints(pe),e.tryToCorrectInvalidPoints(pe,K),e.checkForInvalidEdgeWarning(pe),e.storeAllpts(pe),e.storeEdgeProjections(pe),e.calculateArrowAngles(pe),e.recalculateEdgeLabelProjections(pe),e.calculateLabelAngles(pe)}},T=0;T0){var ue=u,de=WC(ue,W4(o)),xe=WC(ue,W4(Ee)),ge=de;if(xe2){var ze=WC(ue,{x:Ee[2],y:Ee[3]});ze0){var ce=h,De=WC(ce,W4(o)),Le=WC(ce,W4(ve)),We=De;if(Le2){var Ne=WC(ce,{x:ve[2],y:ve[3]});Ne=g||T){v={cp:w,segment:S};break}}if(v)break}var C=v.cp,k=v.segment,E=(g-y)/k.length,_=k.t1-k.t0,P=p?k.t0+_*E:k.t1-_*E;P=KF(0,P,1),e=Y4(C.p0,C.p1,C.p2,P),f=A7n(C.p0,C.p1,C.p2,P);break}case"straight":case"segments":case"haystack":{for(var L=0,R,D,M,I,N=n.allpts.length,F=0;F+3=g));F+=2);var B=g-D,V=B/R;V=KF(0,V,1),e=Q6n(M,I,V),f=P9t(M,I);break}}o("labelX",d,e.x),o("labelY",d,e.y),o("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(t)}},J0.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},J0.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),i=GC(n,t._private.labelDimsKey);if(eh(r.rscratch,"prefixedLabelDimsKey",e)!==i){j0(r.rscratch,"prefixedLabelDimsKey",e,i);var a=this.calculateLabelDimensions(t,n),o=t.pstyle("line-height").pfValue,s=t.pstyle("font-size").pfValue,l=t.pstyle("text-wrap").strValue,u=eh(r.rscratch,"labelWrapCachedLines",e)||[],h=l!=="wrap"?1:Math.max(u.length,1),d=s*o,f=a.width,p=a.height+(h-1)*(o-1)*s;j0(r.rstyle,"labelWidth",e,f),j0(r.rscratch,"labelWidth",e,f),j0(r.rstyle,"labelHeight",e,p),j0(r.rscratch,"labelHeight",e,p),j0(r.rscratch,"labelLineHeight",e,d),j0(r.rscratch,"labelActualDescent",e,a.labelActualDescent)}},J0.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",i=t.pstyle(n+"label").strValue,a=t.pstyle("text-transform").value,o=function(U,Q){return Q?(j0(r.rscratch,U,e,Q),Q):eh(r.rscratch,U,e)};if(!i)return"";a=="none"||(a=="uppercase"?i=i.toUpperCase():a=="lowercase"&&(i=i.toLowerCase()));var s=t.pstyle("text-wrap").value;if(s==="wrap"){var l=o("labelKey");if(l!=null&&o("labelWrapKey")===l)return o("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,C=rd(A),k;try{for(C.s();!(k=C.n()).done;){var E=k.value,_=E[0],P=y.substring(T,E.index);T=E.index+_.length;var L=S.length===0?P:S+P+_,R=this.calculateLabelDimensions(t,L),D=R.width;D<=d?S+=P+_:(S&&g.push(S),S=P+_)}}catch(z){C.e(z)}finally{C.f()}S.match(/^[\s\u200b]+$/)||g.push(S)}else g.push(y)}o("labelWrapCachedLines",g),i=o("labelWrapCachedText",g.join(` -`)),o("labelWrapKey",l)}else if(s==="ellipsis"){var M=t.pstyle("text-max-width").pfValue,I="",N="…",F=!1;if(this.calculateLabelDimensions(t,i).widthM)break;I+=i[B],B===i.length-1&&(F=!0)}return F||(I+=N),I}return i},J0.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;return e==="auto"?t.isNode()?sBn(r):"center":e},J0.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),i=n.document,a=0,o=t.pstyle("font-style").strValue,s=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(o," ").concat(u," ").concat(s,"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(o),s)for(var l=0;l=t.desktopTapThreshold2}var Gt=a(K);Pe&&(t.hoverData.tapholdCancelled=!0);var It=function(){var Tt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Tt.length===0?(Tt.push(He[0]),Tt.push(He[1])):(Tt[0]+=He[0],Tt[1]+=He[1])};me=!0,i(je,["mousemove","vmousemove","tapdrag"],K,{x:De[0],y:De[1]});var gt=function(Tt){return{originalEvent:K,type:Tt,position:{x:De[0],y:De[1]}}},Te=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||oe.emit(gt("boxstart")),Ne[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(Pe){var Bt=gt("cxtdrag");Ze?Ze.emit(Bt):oe.emit(Bt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||je!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(gt("cxtdragout")),t.hoverData.cxtOver=je,je&&je.emit(gt("cxtdragover")))}}else if(t.hoverData.dragging){if(me=!0,oe.panningEnabled()&&oe.userPanningEnabled()){var Et;if(t.hoverData.justStartedPan){var At=t.hoverData.mdownPos;Et={x:(De[0]-At[0])*ve,y:(De[1]-At[1])*ve},t.hoverData.justStartedPan=!1}else Et={x:He[0]*ve,y:He[1]*ve};oe.panBy(Et),oe.emit(gt("dragpan")),t.hoverData.dragged=!0}De=t.projectIntoViewport(K.clientX,K.clientY)}else if(Ne[4]==1&&(Ze==null||Ze.pannable())){if(Pe){if(!t.hoverData.dragging&&oe.boxSelectionEnabled()&&(Gt||!oe.panningEnabled()||!oe.userPanningEnabled()))Te();else if(!t.hoverData.selecting&&oe.panningEnabled()&&oe.userPanningEnabled()){var Mt=o(Ze,t.hoverData.downs);Mt&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Ne[4]=0,t.data.bgActivePosistion=W4(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())&&je!=$e&&($e&&i($e,["mouseout","tapdragout"],K,{x:De[0],y:De[1]}),je&&i(je,["mouseover","tapdragover"],K,{x:De[0],y:De[1]}),t.hoverData.last=je),Ze)if(Pe){if(oe.boxSelectionEnabled()&&Gt)Ze&&Ze.grabbed()&&(m(et),Ze.emit(gt("freeon")),et.emit(gt("free")),t.dragData.didDrag&&(Ze.emit(gt("dragfreeon")),et.emit(gt("dragfree")))),Te();else if(Ze&&Ze.grabbed()&&t.nodeIsDraggable(Ze)){var qr=!t.dragData.didDrag;qr&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(et,{inDragLayer:!0});var Me={x:0,y:0};if(sr(He[0])&&sr(He[1])&&(Me.x+=He[0],Me.y+=He[1],qr)){var at=t.hoverData.dragDelta;at&&sr(at[0])&&sr(at[1])&&(Me.x+=at[0],Me.y+=at[1])}t.hoverData.draggingEles=!0,et.silentShift(Me).emit(gt("position")).emit(gt("drag")),t.redrawHint("drag",!0),t.redraw()}}else It();me=!0}if(Ne[2]=De[0],Ne[3]=De[1],me)return K.stopPropagation&&K.stopPropagation(),K.preventDefault&&K.preventDefault(),!1}},!1);var E,_,P;t.registerBinding(e,"mouseup",function(K){if(!(t.hoverData.which===1&&K.which!==1&&t.hoverData.capture)){var se=t.hoverData.capture;if(se){t.hoverData.capture=!1;var me=t.cy,oe=t.projectIntoViewport(K.clientX,K.clientY),ve=t.selection,ce=t.findNearestElement(oe[0],oe[1],!0,!1),De=t.dragData.possibleDragElements,Le=t.hoverData.down,We=a(K);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Le&&Le.unactivate();var Ne=function(yt){return{originalEvent:K,type:yt,position:{x:oe[0],y:oe[1]}}};if(t.hoverData.which===3){var je=Ne("cxttapend");if(Le?Le.emit(je):me.emit(je),!t.hoverData.cxtDragged){var $e=Ne("cxttap");Le?Le.emit($e):me.emit($e)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(ce,["mouseup","tapend","vmouseup"],K,{x:oe[0],y:oe[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Le,["click","tap","vclick"],K,{x:oe[0],y:oe[1]}),_=!1,K.timeStamp-P<=me.multiClickDebounceTime()?(E&&clearTimeout(E),_=!0,P=null,i(Le,["dblclick","dbltap","vdblclick"],K,{x:oe[0],y:oe[1]})):(E=setTimeout(function(){_||i(Le,["oneclick","onetap","voneclick"],K,{x:oe[0],y:oe[1]})},me.multiClickDebounceTime()),P=K.timeStamp)),Le==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(K)&&(me.$(r).unselect(["tapunselect"]),De.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=De=me.collection()),ce==Le&&!t.dragData.didDrag&&!t.hoverData.selecting&&ce!=null&&ce._private.selectable&&(t.hoverData.dragging||(me.selectionType()==="additive"||We?ce.selected()?ce.unselect(["tapunselect"]):ce.select(["tapselect"]):We||(me.$(r).unmerge(ce).unselect(["tapunselect"]),ce.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Ze=me.collection(t.getAllInBox(ve[0],ve[1],ve[2],ve[3]));t.redrawHint("select",!0),Ze.length>0&&t.redrawHint("eles",!0),me.emit(Ne("boxend"));var He=function(yt){return yt.selectable()&&!yt.selected()};me.selectionType()==="additive"||We||me.$(r).unmerge(Ze).unselect(),Ze.emit(Ne("box")).stdFilter(He).select().emit(Ne("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!ve[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var et=Le&&Le.grabbed();m(De),et&&(Le.emit(Ne("freeon")),De.emit(Ne("free")),t.dragData.didDrag&&(Le.emit(Ne("dragfreeon")),De.emit(Ne("dragfree"))))}}ve[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,I=function(K){for(var se=Math.abs(K[0]),me=1;me=R){D=!1;var oe=L;if(oe[0]>=5){var ve;I(oe)?ve=oe[0]:ve=$6n(oe),ve>1&&(D=!0,M=ve)}}else L.push(Math.abs(me)),se=!0;else D&&(M=Math.min(Math.abs(me),M));if(!t.scrollingPage){var ce=t.cy,De=ce.zoom(),Le=ce.pan(),We=t.projectIntoViewport(K.clientX,K.clientY),Ne=[We[0]*De+Le.x,We[1]*De+Le.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||T()){K.preventDefault();return}if(ce.panningEnabled()&&ce.userPanningEnabled()&&ce.zoomingEnabled()&&ce.userZoomingEnabled()){K.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 je;se&&Math.abs(me)>5&&(me=ZOe(me)*5),je=me/-250,D&&(je/=M,je*=3),je=je*t.wheelSensitivity;var $e=K.deltaMode===1;$e&&(je*=33);var Ze=ce.zoom()*Math.pow(10,je);K.type==="gesturechange"&&(Ze=t.gestureStartZoom*K.scale),ce.zoom({level:Ze,renderedPosition:{x:Ne[0],y:Ne[1]}}),ce.emit({type:K.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:K,position:{x:We[0],y:We[1]}})}}}};t.registerBinding(t.container,"wheel",N,!0),t.registerBinding(e,"scroll",function(K){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(K){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||K.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(ae){t.hasTouchStarted||N(ae)},!0),t.registerBinding(t.container,"mouseout",function(K){var se=t.projectIntoViewport(K.clientX,K.clientY);t.cy.emit({originalEvent:K,type:"mouseout",position:{x:se[0],y:se[1]}})},!1),t.registerBinding(t.container,"mouseover",function(K){var se=t.projectIntoViewport(K.clientX,K.clientY);t.cy.emit({originalEvent:K,type:"mouseover",position:{x:se[0],y:se[1]}})},!1);var F,B,V,z,U,Q,G,q,Y,ne,X,J,ee,te=function(K,se,me,oe){return Math.sqrt((me-K)*(me-K)+(oe-se)*(oe-se))},pe=function(K,se,me,oe){return(me-K)*(me-K)+(oe-se)*(oe-se)},ie;t.registerBinding(t.container,"touchstart",ie=function(K){if(t.hasTouchStarted=!0,!!C(K)){y(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var se=t.cy,me=t.touchData.now,oe=t.touchData.earlier;if(K.touches[0]){var ve=t.projectIntoViewport(K.touches[0].clientX,K.touches[0].clientY);me[0]=ve[0],me[1]=ve[1]}if(K.touches[1]){var ve=t.projectIntoViewport(K.touches[1].clientX,K.touches[1].clientY);me[2]=ve[0],me[3]=ve[1]}if(K.touches[2]){var ve=t.projectIntoViewport(K.touches[2].clientX,K.touches[2].clientY);me[4]=ve[0],me[5]=ve[1]}var ce=function(Gt){return{originalEvent:K,type:Gt,position:{x:me[0],y:me[1]}}};if(K.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var De=t.findContainerClientCoords();Y=De[0],ne=De[1],X=De[2],J=De[3],F=K.touches[0].clientX-Y,B=K.touches[0].clientY-ne,V=K.touches[1].clientX-Y,z=K.touches[1].clientY-ne,ee=0<=F&&F<=X&&0<=V&&V<=X&&0<=B&&B<=J&&0<=z&&z<=J;var Le=se.pan(),We=se.zoom();U=te(F,B,V,z),Q=pe(F,B,V,z),G=[(F+V)/2,(B+z)/2],q=[(G[0]-Le.x)/We,(G[1]-Le.y)/We];var Ne=200,je=Ne*Ne;if(Q=1){for(var Ie=t.touchData.startPosition=[null,null,null,null,null,null],St=0;St=t.touchTapThreshold2}if(se&&t.touchData.cxt){K.preventDefault();var St=K.touches[0].clientX-Y,kt=K.touches[0].clientY-ne,ut=K.touches[1].clientX-Y,Gt=K.touches[1].clientY-ne,It=pe(St,kt,ut,Gt),gt=It/Q,Te=150,Bt=Te*Te,Et=1.5,At=Et*Et;if(gt>=At||It>=Bt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Mt=We("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(Mt),t.touchData.start=null):oe.emit(Mt)}}if(se&&t.touchData.cxt){var Mt=We("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Mt):oe.emit(Mt),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var qr=t.findNearestElement(ve[0],ve[1],!0,!0);(!t.touchData.cxtOver||qr!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(We("cxtdragout")),t.touchData.cxtOver=qr,qr&&qr.emit(We("cxtdragover")))}else if(se&&K.touches[2]&&oe.boxSelectionEnabled())K.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||oe.emit(We("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,me[4]=1,!me||me.length===0||me[0]===void 0?(me[0]=(ve[0]+ve[2]+ve[4])/3,me[1]=(ve[1]+ve[3]+ve[5])/3,me[2]=(ve[0]+ve[2]+ve[4])/3+1,me[3]=(ve[1]+ve[3]+ve[5])/3+1):(me[2]=(ve[0]+ve[2]+ve[4])/3,me[3]=(ve[1]+ve[3]+ve[5])/3),t.redrawHint("select",!0),t.redraw();else if(se&&K.touches[1]&&!t.touchData.didSelect&&oe.zoomingEnabled()&&oe.panningEnabled()&&oe.userZoomingEnabled()&&oe.userPanningEnabled()){K.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Me=t.dragData.touchDragEles;if(Me){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 ke;t.registerBinding(e,"touchcancel",ke=function(K){var se=t.touchData.start;t.touchData.capture=!1,se&&se.unactivate()});var Ee,ue,de,xe;if(t.registerBinding(e,"touchend",Ee=function(K){var se=t.touchData.start,me=t.touchData.capture;if(me)K.touches.length===0&&(t.touchData.capture=!1),K.preventDefault();else return;var oe=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var ve=t.cy,ce=ve.zoom(),De=t.touchData.now,Le=t.touchData.earlier;if(K.touches[0]){var We=t.projectIntoViewport(K.touches[0].clientX,K.touches[0].clientY);De[0]=We[0],De[1]=We[1]}if(K.touches[1]){var We=t.projectIntoViewport(K.touches[1].clientX,K.touches[1].clientY);De[2]=We[0],De[3]=We[1]}if(K.touches[2]){var We=t.projectIntoViewport(K.touches[2].clientX,K.touches[2].clientY);De[4]=We[0],De[5]=We[1]}var Ne=function(Bt){return{originalEvent:K,type:Bt,position:{x:De[0],y:De[1]}}};se&&se.unactivate();var je;if(t.touchData.cxt){if(je=Ne("cxttapend"),se?se.emit(je):ve.emit(je),!t.touchData.cxtDragged){var $e=Ne("cxttap");se?se.emit($e):ve.emit($e)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!K.touches[2]&&ve.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Ze=ve.collection(t.getAllInBox(oe[0],oe[1],oe[2],oe[3]));oe[0]=void 0,oe[1]=void 0,oe[2]=void 0,oe[3]=void 0,oe[4]=0,t.redrawHint("select",!0),ve.emit(Ne("boxend"));var He=function(Bt){return Bt.selectable()&&!Bt.selected()};Ze.emit(Ne("box")).stdFilter(He).select().emit(Ne("boxselect")),Ze.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(se!=null&&se.unactivate(),K.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!K.touches[1]){if(!K.touches[0]){if(!K.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var et=t.dragData.touchDragEles;if(se!=null){var Pe=se._private.grabbed;m(et),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Pe&&(se.emit(Ne("freeon")),et.emit(Ne("free")),t.dragData.didDrag&&(se.emit(Ne("dragfreeon")),et.emit(Ne("dragfree")))),i(se,["touchend","tapend","vmouseup","tapdragout"],K,{x:De[0],y:De[1]}),se.unactivate(),t.touchData.start=null}else{var yt=t.findNearestElement(De[0],De[1],!0,!0);i(yt,["touchend","tapend","vmouseup","tapdragout"],K,{x:De[0],y:De[1]})}var Ie=t.touchData.startPosition[0]-De[0],St=Ie*Ie,kt=t.touchData.startPosition[1]-De[1],ut=kt*kt,Gt=St+ut,It=Gt*ce*ce;t.touchData.singleTouchMoved||(se||ve.$(":selected").unselect(["tapunselect"]),i(se,["tap","vclick"],K,{x:De[0],y:De[1]}),ue=!1,K.timeStamp-xe<=ve.multiClickDebounceTime()?(de&&clearTimeout(de),ue=!0,xe=null,i(se,["dbltap","vdblclick"],K,{x:De[0],y:De[1]})):(de=setTimeout(function(){ue||i(se,["onetap","voneclick"],K,{x:De[0],y:De[1]})},ve.multiClickDebounceTime()),xe=K.timeStamp)),se!=null&&!t.dragData.didDrag&&se._private.selectable&&It"u"){var ge=[],ze=function(K){return{clientX:K.clientX,clientY:K.clientY,force:1,identifier:K.pointerId,pageX:K.pageX,pageY:K.pageY,radiusX:K.width/2,radiusY:K.height/2,screenX:K.screenX,screenY:K.screenY,target:K.target}},we=function(K){return{event:K,touch:ze(K)}},Oe=function(K){ge.push(we(K))},Be=function(K){for(var se=0;se0)return z[0]}return null},g=Object.keys(f),m=0;m0?p:X7t(a,o,e,r,n,i,s,l)},checkPoint:function(e,r,n,i,a,o,s,l){l=l==="auto"?sw(i,a):l;var u=2*l;if(W1(e,r,this.points,o,s,i,a-u,[0,-1],n)||W1(e,r,this.points,o,s,i-u,a,[0,-1],n))return!0;var h=i/2+2*n,d=a/2+2*n,f=[o-h,s-d,o-h,s,o+h,s,o+h,s-d];return!!(nd(e,r,f)||YC(e,r,u,u,o+i/2-l,s+a/2-l,n)||YC(e,r,u,u,o-i/2+l,s+a/2-l,n))}}},q1.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",rh(3,0)),this.generateRoundPolygon("round-triangle",rh(3,0)),this.generatePolygon("rectangle",rh(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",rh(5,0)),this.generateRoundPolygon("round-pentagon",rh(5,0)),this.generatePolygon("hexagon",rh(6,0)),this.generateRoundPolygon("round-hexagon",rh(6,0)),this.generatePolygon("heptagon",rh(7,0)),this.generateRoundPolygon("round-heptagon",rh(7,0)),this.generatePolygon("octagon",rh(8,0)),this.generateRoundPolygon("round-octagon",rh(8,0));var n=new Array(20);{var i=tke(5,0),a=tke(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s=e.deqFastCost*w)break}else if(u){if(b>=e.deqCost*p||b>=e.deqAvgCost*f)break}else if(x>=e.deqNoDrawCost*DEe)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())},s=e.priority||WOe;i.beforeRender(o,s(n))}}}},T7n=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tee;J2(this,t),this.idsByKey=new H1,this.keyForId=new H1,this.cachesByLvl=new H1,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return ew(t,[{key:"getIdsFor",value:function(r){r==null&&Co("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new H4,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 H1,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}}])}(),Q9t=25,dte=50,fte=-4,LEe=3,G9t=7.99,C7n=8,O7n=1024,k7n=1024,E7n=1024,_7n=.2,R7n=.8,D7n=10,L7n=.15,M7n=.1,I7n=.9,P7n=.9,N7n=100,B7n=1,d3={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},$7n=Tc({getKey:null,doesEleInvalidateKey:Tee,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:N7t,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),g9=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=$7n(r);ln(n,i),n.lookup=new T7n(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},gl=g9.prototype;gl.reasons=d3,gl.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},gl.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n},gl.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new XF(function(r,n){return n.reqs-r.reqs});return e},gl.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},gl.getElement=function(t,e,r,n,i){var a=this,o=this.renderer,s=o.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(KOe(s*r))),n=G9t||n>LEe)return null;var u=Math.pow(2,n),h=e.h*u,d=e.w*u,f=o.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<=Q9t?g=Q9t:h<=dte?g=dte:g=Math.ceil(h/dte)*dte,h>E7n||d>k7n)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,_,d3.downscale);E()}else return a.queueElement(t,S.level-1),S;else{var P;if(!x&&!w&&!A)for(var L=n-1;L>=fte;L--){var R=l.get(t,L);if(R){P=R;break}}if(b(P))return a.queueElement(t,n),P;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+C7n),v.eleCaches.push(p),l.set(t,n,p),a.checkTextureFullness(v),p},gl.invalidateElements=function(t){for(var e=0;e=_7n*t.width&&this.retireTexture(t)},gl.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>R7n&&t.fullnessChecks>=D7n?iw(r,t):t.fullnessChecks++},gl.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;iw(n,t),t.retired=!0;for(var a=t.eleCaches,o=0;o=e)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,YOe(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),iw(i,o),n.push(o),o}},gl.queueElement=function(t,e){var r=this,n=r.getElementQueue(),i=r.getElementKeyToQueue(),a=this.getKey(t),o=i[a];if(o)o.level=Math.max(o.level,e),o.eles.merge(t),o.reqs++,n.updateItem(o);else{var s={eles:t.spawn().merge(t),level:e,reqs:1,key:a};n.push(s),i[a]=s}},gl.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],a=e.lookup,o=0;o0;o++){var s=r.pop(),l=s.key,u=s.eles[0],h=a.hasCache(u,s.level);if(n[l]=null,h)continue;i.push(s);var d=e.getBoundingBox(u);e.getElement(u,d,t,s.level,d3.dequeue)}return i},gl.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=HOe,r.updateItem(a),r.pop(),n[i]=null):a.eles.unmerge(t))},gl.onDequeue=function(t){this.onDequeues.push(t)},gl.offDequeue=function(t){iw(this.onDequeues,t)},gl.setupDequeueing=V9t.setupDequeueing({deqRedrawThreshold:N7n,deqCost:L7n,deqAvgCost:M7n,deqNoDrawCost:I7n,deqFastCost:P7n,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n=z7n||r>pte)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;m9<=M&&M<=pte&&!E(M);M+=D);};_(1),_(-1);for(var P=h.length-1;P>=0;P--){var L=h[P];L.invalid&&iw(h,L)}};if(!f)g();else return h;var m=function(){if(!d){d=th();for(var E=0;EW9t||L>W9t)return null;var R=P*L;if(R>q7n)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&&!s)return null;for(var y=null,b=t.length/F7n,x=!s,w=0;w=b||!j7t(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)},kc.getEleLevelForLayerLevel=function(t,e){return t},kc.drawEleInLayer=function(t,e,r,n){var i=this,a=this.renderer,o=t.context,s=e.boundingBox();s.w===0||s.h===0||!e.visible()||(r=i.getEleLevelForLayerLevel(r,n),a.setImgSmoothing(o,!1),a.drawCachedElement(o,e,null,null,r,j7n),a.setImgSmoothing(o,!0))},kc.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||o.invalid)return!1;i+=o.eles.length}return i===e.length},kc.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e},kc.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=G1(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,a){e.invalidateLayer(n)}))},kc.invalidateLayer=function(t){if(this.lastInvalidationTime=G1(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];iw(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,o=this,s=e._private.rscratch;if(!(a&&!e.visible())&&!(s.badLine||s.allpts==null||isNaN(s.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"?(o.eleStrokeStyle(t,e,D),o.drawEdgeTrianglePath(e,t,s.allpts)):(t.lineWidth=p,t.lineCap=g,o.eleStrokeStyle(t,e,D),o.drawEdgePath(e,t,s.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)o.colorStrokeStyle(t,v[0],v[1],v[2],D);else{t.lineCap="butt";return}d==="straight-triangle"?o.drawEdgeTrianglePath(e,t,s.allpts):(o.drawEdgePath(e,t,s.allpts,f),t.lineCap="butt")},A=function(){i&&o.drawEdgeOverlay(t,e)},S=function(){i&&o.drawEdgeUnderlay(t,e)},T=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;o.drawArrowheads(t,e,D)},C=function(){o.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,P=e.pstyle("ghost-opacity").value,L=y*P;t.translate(E,_),x(L),T(L),t.translate(-E,-_)}else w();S(),x(),T(),A(),C(),r&&t.translate(l.x1,l.y1)}};var Z9t=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,o=a.usePaths(),s=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,h=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,s.edgeType==="self"&&!o?r.lineCap="butt":r.lineCap="round",a.colorStrokeStyle(r,h[0],h[1],h[2],i),a.drawEdgePath(n,r,s.allpts,"solid")}}}};j1.drawEdgeOverlay=Z9t("overlay"),j1.drawEdgeUnderlay=Z9t("underlay"),j1.drawEdgePath=function(t,e,r,n){var i=t._private.rscratch,a=e,o,s=!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?(o=e=i.pathCache,s=!0):(o=e=new Path2D,i.pathCacheKey=d,i.pathCache=o)}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(!s&&!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,o=this;if(n==null){if(a&&!o.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var s=e.pstyle("label");if(!s||!s.value)return;var l=o.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?(o.drawText(t,e,null,g,a),e.isEdge()&&(o.drawText(t,e,"source",g,a),o.drawText(t,e,"target",g,a))):o.drawText(t,e,i,g,a),r&&t.translate(m.x1,m.y1)},eO.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,o=e.pstyle("font-weight").strValue,s=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*s,u=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+o+" "+i+" "+a,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],s),this.colorStrokeStyle(t,h[0],h[1],h[2],l)};function o$n(t,e,r,n,i){var a=Math.min(n,i),o=a/2,s=e+n/2,l=r+i/2;t.beginPath(),t.arc(s,l,o,0,Math.PI*2),t.closePath()}function J9t(t,e,r,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,o=Math.min(a,n/2,i/2);t.beginPath(),t.moveTo(e+o,r),t.lineTo(e+n-o,r),t.quadraticCurveTo(e+n,r,e+n,r+o),t.lineTo(e+n,r+i-o),t.quadraticCurveTo(e+n,r+i,e+n-o,r+i),t.lineTo(e+o,r+i),t.quadraticCurveTo(e,r+i,e,r+i-o),t.lineTo(e,r+o),t.quadraticCurveTo(e,r,e+o,r),t.closePath()}eO.getTextAngle=function(t,e){var r,n=t._private,i=n.rscratch,a=e?e+"-":"",o=t.pstyle(a+"text-rotation");if(o.strValue==="autorotate"){var s=eh(i,"labelAngle",e);r=t.isEdge()?s:0}else o.strValue==="none"?r=0:r=o.pfValue;return r},eO.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,o=a.rscratch,s=i?e.effectiveOpacity():1;if(!(i&&(s===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=eh(o,"labelX",r),u=eh(o,"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=eh(o,"labelWidth",r),m=eh(o,"labelHeight",r),v=eh(o,"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=r3(w),C=n3(A);switch(C){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,P=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 I=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-P;switch(T){case"left":G-=g;break;case"center":G-=g/2;break}var q=u-m-P,Y=g+2*P,ne=m+2*P;if(U&&(t.fillStyle="rgba(".concat(B[0],",").concat(B[1],",").concat(B[2],",").concat(k*s,")")),Q&&(t.strokeStyle="rgba(".concat(V[0],",").concat(V[1],",").concat(V[2],",").concat(E*s,")"),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(),J9t(t,G,q,Y,ne,M)):D?(t.beginPath(),o$n(t,G,q,Y,ne)):(t.beginPath(),t.rect(G,q,Y,ne)),U&&t.fill(),Q&&t.stroke(),Q&&z==="double"){var X=_/2;t.beginPath(),R?J9t(t,G+X,q+X,Y-2*X,ne-2*X,M):t.rect(G+X,q+X,Y-2*X,ne-2*X),t.stroke()}t.fillStyle=I,t.strokeStyle=N,t.lineWidth=F,t.setLineDash&&t.setLineDash([])}var J=2*e.pstyle("text-outline-width").pfValue;if(J>0&&(t.lineWidth=J),u-=v,e.pstyle("text-wrap").value==="wrap"){var ee=eh(o,"labelWrapCachedLines",r),te=eh(o,"labelLineHeight",r),pe=g/2,ie=this.getLabelJustification(e);switch(ie==="auto"||(T==="left"?ie==="left"?l+=-g:ie==="center"&&(l+=-pe):T==="center"?ie==="left"?l+=-pe:ie==="right"&&(l+=pe):T==="right"&&(ie==="center"?l+=pe:ie==="right"&&(l+=g))),C){case"top":u-=(ee.length-1)*te;break;case"center":case"bottom":u-=(ee.length-1)*te;break}for(var Ce=0;Ce0&&t.strokeText(ee[Ce],l,u),t.fillText(ee[Ce],l,u),u+=te}else J>0&&t.strokeText(f,l,u),t.fillText(f,l,u);S!==0&&(t.rotate(-S),t.translate(-h,-d))}}};var mw={};mw.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,o=this,s,l,u=e._private,h=u.rscratch,d=e.position();if(!(!sr(d.x)||!sr(d.y))&&!(a&&!e.visible())){var f=a?e.effectiveOpacity():1,p=o.usePaths(),g,m=!1,v=e.padding();s=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;o.eleFillStyle(t,e,se)},X=function(){var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V;o.colorStrokeStyle(t,R[0],R[1],R[2],se)},J=function(){var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G;o.colorStrokeStyle(t,U[0],U[1],U[2],se)},ee=function(se,me,oe,ve){var ce=o.nodePathCache=o.nodePathCache||[],De=I7t(oe==="polygon"?oe+","+ve.join(","):oe,""+me,""+se,""+Y),Le=ce[De],We,Ne=!1;return Le!=null?(We=Le,Ne=!0,h.pathCache=We):(We=new Path2D,ce[De]=h.pathCache=We),{path:We,cacheHit:Ne}},te=e.pstyle("shape").strValue,pe=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var ie=ee(s,l,te,pe);g=ie.path,m=ie.cacheHit}var Ce=function(){if(!m){var se=d;p&&(se={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(g||t,se.x,se.y,s,l,Y,h)}p?t.fill(g):t.fill()},ke=function(){for(var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,oe=u.backgrounding,ve=0,ce=0;ce0&&arguments[0]!==void 0?arguments[0]:!1,me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;o.hasPie(e)&&(o.drawPie(t,e,me),se&&(p||o.nodeShapes[o.getNodeShape(e)].draw(t,d.x,d.y,s,l,Y,h)))},ue=function(){var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;o.hasStripe(e)&&(t.save(),p?t.clip(h.pathCache):(o.nodeShapes[o.getNodeShape(e)].draw(t,d.x,d.y,s,l,Y,h),t.clip()),o.drawStripe(t,e,me),t.restore(),se&&(p||o.nodeShapes[o.getNodeShape(e)].draw(t,d.x,d.y,s,l,Y,h)))},de=function(){var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,me=(_>0?_:-_)*se,oe=_>0?0:255;_!==0&&(o.colorFillStyle(t,oe,oe,oe,me),p?t.fill(g):t.fill())},xe=function(){if(P>0){if(t.lineWidth=P,t.lineCap=I,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 se=new Path2D;se.rect(-s/2-P,-l/2-P,s+2*P,l+2*P),se.addPath(g),t.clip(se,"evenodd")}p?t.stroke(g):t.stroke(),t.restore()}else p?t.stroke(g):t.stroke();if(D==="double"){t.lineWidth=P/3;var me=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=me}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 se=d;p&&(se={x:0,y:0});var me=o.getNodeShape(e),oe=P;N==="inside"&&(oe=0),N==="outside"&&(oe*=2);var ve=(s+oe+(z+q))/s,ce=(l+oe+(z+q))/l,De=s*ve,Le=l*ce,We=o.nodeShapes[me].points,Ne;if(p){var je=ee(De,Le,me,We);Ne=je.path}if(me==="ellipse")o.drawEllipsePath(Ne||t,se.x,se.y,De,Le);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(me)){var $e=0,Ze=0,He=0;me==="round-diamond"?$e=(oe+q+z)*1.4:me==="round-heptagon"?($e=(oe+q+z)*1.075,He=-(oe/2+q+z)/35):me==="round-hexagon"?$e=(oe+q+z)*1.12:me==="round-pentagon"?($e=(oe+q+z)*1.13,He=-(oe/2+q+z)/15):me==="round-tag"?($e=(oe+q+z)*1.12,Ze=(oe/2+z+q)*.07):me==="round-triangle"&&($e=(oe+q+z)*(Math.PI/2),He=-(oe+q/2+z)/Math.PI),$e!==0&&(ve=(s+$e)/s,De=s*ve,["round-hexagon","round-tag"].includes(me)||(ce=(l+$e)/l,Le=l*ce)),Y=Y==="auto"?Z7t(De,Le):Y;for(var et=De/2,Pe=Le/2,yt=Y+(oe+z+q)/2,Ie=new Array(We.length/2),St=new Array(We.length/2),kt=0;kt0){if(i=i||n.position(),a==null||o==null){var p=n.padding();a=n.width()+2*p,o=n.height()+2*p}s.colorFillStyle(r,h[0],h[1],h[2],u),s.nodeShapes[d].draw(r,i.x,i.y,a+l*2,o+l*2,f),r.fill()}}}};mw.drawNodeOverlay=ezt("overlay"),mw.drawNodeUnderlay=ezt("underlay"),mw.hasPie=function(t){return t=t[0],t._private.hasPie},mw.hasStripe=function(t){return t=t[0],t._private.hasStripe},mw.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),o=e.pstyle("pie-hole"),s=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),o.units==="%"?p=f*o.pfValue:o.pfValue!==void 0&&(p=o.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+=s;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)}},mw.drawStripe=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=n.x,o=n.y,s=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=s,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,o=0),o-=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,o+g*u,p,g*x),t.closePath(),this.colorFillStyle(t,y[0],y[1],y[2],b),t.fill(),u+=x)}t.restore()};var nh={},s$n=100;nh.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},nh.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=o!==void 0?o:x,A=r.pan(),S={x:A.x,y:A.y},T={zoom:x,pan:{x:A.x,y:A.y}},C=e.prevViewport,k=C===void 0||T.zoom!==C.zoom||T.pan.x!==C.pan.x||T.pan.y!==C.pan.y;!k&&!(m&&!g)&&(e.motionBlurPxRatio=1),s&&(S=s),w*=l,S.x*=l,S.y*=l;var E=e.getCachedZSortedEles();function _(X,J,ee,te,pe){var ie=X.globalCompositeOperation;X.globalCompositeOperation="destination-out",e.colorFillStyle(X,255,255,255,e.motionBlurTransparency),X.fillRect(J,ee,te,pe),X.globalCompositeOperation=ie}function P(X,J){var ee,te,pe,ie;!e.clearingMotionBlur&&(X===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||X===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(ee={x:A.x*p,y:A.y*p},te=x*p,pe=e.canvasWidth*p,ie=e.canvasHeight*p):(ee=S,te=w,pe=e.canvasWidth,ie=e.canvasHeight),X.setTransform(1,0,0,1,0,0),J==="motionBlur"?_(X,0,0,pe,ie):!n&&(J===void 0||J)&&X.clearRect(0,0,pe,ie),i||(X.translate(ee.x,ee.y),X.scale(te,te)),s&&X.translate(s.x,s.y),o&&X.scale(o,o)}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,I=b.core("outside-texture-bg-opacity").value;e.colorFillStyle(R,M[0],M[1],M[2],I),R.fillRect(0,0,T.width,T.height);var x=r.zoom();P(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;P(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]);P(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,P),f&&p!==1){var Q=u.contexts[e.NODE],G=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],q=u.contexts[e.DRAG],Y=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],ne=function(J,ee,te){J.setTransform(1,0,0,1,0,0),te||!y?J.clearRect(0,0,e.canvasWidth,e.canvasHeight):_(J,0,0,e.canvasWidth,e.canvasHeight);var pe=p;J.drawImage(ee,0,0,e.canvasWidth*pe,e.canvasHeight*pe,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||V[e.NODE])&&(ne(Q,G,V[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||V[e.DRAG])&&(ne(q,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()},s$n)),n||r.emit("render")};var v9;nh.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,i=r.data,a=n.style(),o=t.drawOnlyNodeLayer,s=t.drawAllLayers,l=i.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!o&&l[r.SELECT_BOX]&&!s){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",!v9){var y=h.measureText(v);v9=y.actualBoundingBoxAscent}h.fillText(v,0,v9);var b=60;h.strokeRect(0,v9+10,250,20),h.fillRect(0,v9+10,250*Math.min(m/b,1),20)}s||(l[r.SELECT_BOX]=!1)}};function tzt(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 l$n(t,e,r){var n=tzt(t,t.VERTEX_SHADER,e),i=tzt(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 c$n(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 PEe(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 u$n(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function h$n(t,e,r,n,i){var a=n*r+e.x,o=i*r+e.y;return o=Math.round(t.canvasHeight-o),[a,o]}function d$n(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 f$n(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 p$n(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function g$n(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 rzt(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 nzt(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function m$n(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 v$n(t,e,r,n){var i=rzt(t,e),a=qs(i,2),o=a[0],s=a[1],l=nzt(t,s,n),u=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),s===t.FLOAT?t.vertexAttribPointer(r,o,s,!1,0,0):s===t.INT&&t.vertexAttribIPointer(r,o,s,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function tv(t,e,r,n){var i=rzt(t,r),a=qs(i,3),o=a[0],s=a[1],l=a[2],u=nzt(t,s,e*o),h=o*l,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),s===t.FLOAT?t.vertexAttribPointer(n,o,s,!1,h,0):s===t.INT&&t.vertexAttribIPointer(n,o,s,h,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var f=new Array(e),p=0;po&&(s=o/n,l=n*s,u=i*s),{scale:s,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 o=this.texSize,s=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,C=S,k=l*T;A.save(),A.translate(C,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==o&&(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=o-a.freePointer.x,S=d-A,T=l;{var C=a.freePointer.x,k=a.freePointer.row*l,E=A;w.context.drawImage(x,0,0,E,T,C,k,E,T),g[0]={x:C,y:k,w:E,h:f}}{var _=A,P=(a.freePointer.row+1)*l,L=S;w&&w.context.drawImage(x,_,0,L,T,0,P,L,T),g[1]={x:0,y:P,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<=o)m();else{if(this.freePointer.row>=s-1)return!1;this.freePointer.x===o?(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),o=a.texW;return this.freePointer.x+o>n?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},a=i.forceRedraw,o=a===void 0?!1:a,s=i.filterEle,l=s===void 0?function(){return!0}:s,u=i.filterType,h=u===void 0?function(){return!0}:u,d=!1,f=!1,p=rd(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var v=rd(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),C=Array.isArray(T)?T:[T];if(o)C.forEach(function(P){return S.markKeyForGC(P)}),f=!0;else{var k=w.getID?w.getID(m):m.id(),E=n._key(A,k),_=n.typeAndIdToKey.get(E);_!==void 0&&!f$n(C,_)&&(d=!0,n.typeAndIdToKey.delete(E),_.forEach(function(P){return S.markKeyForGC(P)}))}}};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=rd(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 o=this.renderTypes.get(n),s=this.collections.get(o.collection),l=!1,u=s.draw(a,i,function(f){o.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,i.w,i.h),f.clip(),o.drawElement(f,r,i,!0,!0),f.restore()):o.drawElement(f,r,i,!0,!0),l=!0});if(l){var h=o.getID?o.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),o=a.getKey(r),s=Array.isArray(o)?o:[o];return s.map(function(l){var u=a.getBoundingBox(r,l),h=i.getOrCreateAtlas(r,n,u,l),d=h.getOffsets(l),f=qs(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=rd(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=qs(i.value,2),o=a[0],s=a[1],l=s.getCounts(),u=l.keyCount,h=l.atlasCount;r.push({type:o,keyCount:u,atlasCount:h})}}catch(d){n.e(d)}finally{n.f()}return r}}])}(),O$n=function(){function t(e){J2(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return ew(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}}])}(),k$n=` +`)),o("labelWrapKey",l)}else if(s==="ellipsis"){var M=t.pstyle("text-max-width").pfValue,I="",N="…",F=!1;if(this.calculateLabelDimensions(t,i).widthM)break;I+=i[B],B===i.length-1&&(F=!0)}return F||(I+=N),I}return i},J0.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;return e==="auto"?t.isNode()?cBn(r):"center":e},J0.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),i=n.document,a=0,o=t.pstyle("font-style").strValue,s=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(o," ").concat(u," ").concat(s,"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(o),s)for(var l=0;l=t.desktopTapThreshold2}var Gt=a(K);Pe&&(t.hoverData.tapholdCancelled=!0);var It=function(){var Tt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Tt.length===0?(Tt.push(He[0]),Tt.push(He[1])):(Tt[0]+=He[0],Tt[1]+=He[1])};me=!0,i(je,["mousemove","vmousemove","tapdrag"],K,{x:De[0],y:De[1]});var gt=function(Tt){return{originalEvent:K,type:Tt,position:{x:De[0],y:De[1]}}},Te=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||oe.emit(gt("boxstart")),Ne[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(Pe){var Bt=gt("cxtdrag");Ze?Ze.emit(Bt):oe.emit(Bt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||je!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit(gt("cxtdragout")),t.hoverData.cxtOver=je,je&&je.emit(gt("cxtdragover")))}}else if(t.hoverData.dragging){if(me=!0,oe.panningEnabled()&&oe.userPanningEnabled()){var Et;if(t.hoverData.justStartedPan){var At=t.hoverData.mdownPos;Et={x:(De[0]-At[0])*ve,y:(De[1]-At[1])*ve},t.hoverData.justStartedPan=!1}else Et={x:He[0]*ve,y:He[1]*ve};oe.panBy(Et),oe.emit(gt("dragpan")),t.hoverData.dragged=!0}De=t.projectIntoViewport(K.clientX,K.clientY)}else if(Ne[4]==1&&(Ze==null||Ze.pannable())){if(Pe){if(!t.hoverData.dragging&&oe.boxSelectionEnabled()&&(Gt||!oe.panningEnabled()||!oe.userPanningEnabled()))Te();else if(!t.hoverData.selecting&&oe.panningEnabled()&&oe.userPanningEnabled()){var Mt=o(Ze,t.hoverData.downs);Mt&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Ne[4]=0,t.data.bgActivePosistion=W4(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())&&je!=$e&&($e&&i($e,["mouseout","tapdragout"],K,{x:De[0],y:De[1]}),je&&i(je,["mouseover","tapdragover"],K,{x:De[0],y:De[1]}),t.hoverData.last=je),Ze)if(Pe){if(oe.boxSelectionEnabled()&&Gt)Ze&&Ze.grabbed()&&(m(et),Ze.emit(gt("freeon")),et.emit(gt("free")),t.dragData.didDrag&&(Ze.emit(gt("dragfreeon")),et.emit(gt("dragfree")))),Te();else if(Ze&&Ze.grabbed()&&t.nodeIsDraggable(Ze)){var qr=!t.dragData.didDrag;qr&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||p(et,{inDragLayer:!0});var Me={x:0,y:0};if(sr(He[0])&&sr(He[1])&&(Me.x+=He[0],Me.y+=He[1],qr)){var at=t.hoverData.dragDelta;at&&sr(at[0])&&sr(at[1])&&(Me.x+=at[0],Me.y+=at[1])}t.hoverData.draggingEles=!0,et.silentShift(Me).emit(gt("position")).emit(gt("drag")),t.redrawHint("drag",!0),t.redraw()}}else It();me=!0}if(Ne[2]=De[0],Ne[3]=De[1],me)return K.stopPropagation&&K.stopPropagation(),K.preventDefault&&K.preventDefault(),!1}},!1);var E,_,P;t.registerBinding(e,"mouseup",function(K){if(!(t.hoverData.which===1&&K.which!==1&&t.hoverData.capture)){var se=t.hoverData.capture;if(se){t.hoverData.capture=!1;var me=t.cy,oe=t.projectIntoViewport(K.clientX,K.clientY),ve=t.selection,ce=t.findNearestElement(oe[0],oe[1],!0,!1),De=t.dragData.possibleDragElements,Le=t.hoverData.down,We=a(K);t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Le&&Le.unactivate();var Ne=function(yt){return{originalEvent:K,type:yt,position:{x:oe[0],y:oe[1]}}};if(t.hoverData.which===3){var je=Ne("cxttapend");if(Le?Le.emit(je):me.emit(je),!t.hoverData.cxtDragged){var $e=Ne("cxttap");Le?Le.emit($e):me.emit($e)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(i(ce,["mouseup","tapend","vmouseup"],K,{x:oe[0],y:oe[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(i(Le,["click","tap","vclick"],K,{x:oe[0],y:oe[1]}),_=!1,K.timeStamp-P<=me.multiClickDebounceTime()?(E&&clearTimeout(E),_=!0,P=null,i(Le,["dblclick","dbltap","vdblclick"],K,{x:oe[0],y:oe[1]})):(E=setTimeout(function(){_||i(Le,["oneclick","onetap","voneclick"],K,{x:oe[0],y:oe[1]})},me.multiClickDebounceTime()),P=K.timeStamp)),Le==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(K)&&(me.$(r).unselect(["tapunselect"]),De.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=De=me.collection()),ce==Le&&!t.dragData.didDrag&&!t.hoverData.selecting&&ce!=null&&ce._private.selectable&&(t.hoverData.dragging||(me.selectionType()==="additive"||We?ce.selected()?ce.unselect(["tapunselect"]):ce.select(["tapselect"]):We||(me.$(r).unmerge(ce).unselect(["tapunselect"]),ce.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Ze=me.collection(t.getAllInBox(ve[0],ve[1],ve[2],ve[3]));t.redrawHint("select",!0),Ze.length>0&&t.redrawHint("eles",!0),me.emit(Ne("boxend"));var He=function(yt){return yt.selectable()&&!yt.selected()};me.selectionType()==="additive"||We||me.$(r).unmerge(Ze).unselect(),Ze.emit(Ne("box")).stdFilter(He).select().emit(Ne("boxselect")),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!ve[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var et=Le&&Le.grabbed();m(De),et&&(Le.emit(Ne("freeon")),De.emit(Ne("free")),t.dragData.didDrag&&(Le.emit(Ne("dragfreeon")),De.emit(Ne("dragfree"))))}}ve[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,I=function(K){for(var se=Math.abs(K[0]),me=1;me=R){D=!1;var oe=L;if(oe[0]>=5){var ve;I(oe)?ve=oe[0]:ve=z6n(oe),ve>1&&(D=!0,M=ve)}}else L.push(Math.abs(me)),se=!0;else D&&(M=Math.min(Math.abs(me),M));if(!t.scrollingPage){var ce=t.cy,De=ce.zoom(),Le=ce.pan(),We=t.projectIntoViewport(K.clientX,K.clientY),Ne=[We[0]*De+Le.x,We[1]*De+Le.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||T()){K.preventDefault();return}if(ce.panningEnabled()&&ce.userPanningEnabled()&&ce.zoomingEnabled()&&ce.userZoomingEnabled()){K.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 je;se&&Math.abs(me)>5&&(me=ZOe(me)*5),je=me/-250,D&&(je/=M,je*=3),je=je*t.wheelSensitivity;var $e=K.deltaMode===1;$e&&(je*=33);var Ze=ce.zoom()*Math.pow(10,je);K.type==="gesturechange"&&(Ze=t.gestureStartZoom*K.scale),ce.zoom({level:Ze,renderedPosition:{x:Ne[0],y:Ne[1]}}),ce.emit({type:K.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:K,position:{x:We[0],y:We[1]}})}}}};t.registerBinding(t.container,"wheel",N,!0),t.registerBinding(e,"scroll",function(K){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(K){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||K.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(ae){t.hasTouchStarted||N(ae)},!0),t.registerBinding(t.container,"mouseout",function(K){var se=t.projectIntoViewport(K.clientX,K.clientY);t.cy.emit({originalEvent:K,type:"mouseout",position:{x:se[0],y:se[1]}})},!1),t.registerBinding(t.container,"mouseover",function(K){var se=t.projectIntoViewport(K.clientX,K.clientY);t.cy.emit({originalEvent:K,type:"mouseover",position:{x:se[0],y:se[1]}})},!1);var F,B,V,z,U,Q,G,q,Y,ne,X,J,ee,te=function(K,se,me,oe){return Math.sqrt((me-K)*(me-K)+(oe-se)*(oe-se))},pe=function(K,se,me,oe){return(me-K)*(me-K)+(oe-se)*(oe-se)},ie;t.registerBinding(t.container,"touchstart",ie=function(K){if(t.hasTouchStarted=!0,!!C(K)){y(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var se=t.cy,me=t.touchData.now,oe=t.touchData.earlier;if(K.touches[0]){var ve=t.projectIntoViewport(K.touches[0].clientX,K.touches[0].clientY);me[0]=ve[0],me[1]=ve[1]}if(K.touches[1]){var ve=t.projectIntoViewport(K.touches[1].clientX,K.touches[1].clientY);me[2]=ve[0],me[3]=ve[1]}if(K.touches[2]){var ve=t.projectIntoViewport(K.touches[2].clientX,K.touches[2].clientY);me[4]=ve[0],me[5]=ve[1]}var ce=function(Gt){return{originalEvent:K,type:Gt,position:{x:me[0],y:me[1]}}};if(K.touches[1]){t.touchData.singleTouchMoved=!0,m(t.dragData.touchDragEles);var De=t.findContainerClientCoords();Y=De[0],ne=De[1],X=De[2],J=De[3],F=K.touches[0].clientX-Y,B=K.touches[0].clientY-ne,V=K.touches[1].clientX-Y,z=K.touches[1].clientY-ne,ee=0<=F&&F<=X&&0<=V&&V<=X&&0<=B&&B<=J&&0<=z&&z<=J;var Le=se.pan(),We=se.zoom();U=te(F,B,V,z),Q=pe(F,B,V,z),G=[(F+V)/2,(B+z)/2],q=[(G[0]-Le.x)/We,(G[1]-Le.y)/We];var Ne=200,je=Ne*Ne;if(Q=1){for(var Ie=t.touchData.startPosition=[null,null,null,null,null,null],St=0;St=t.touchTapThreshold2}if(se&&t.touchData.cxt){K.preventDefault();var St=K.touches[0].clientX-Y,kt=K.touches[0].clientY-ne,ut=K.touches[1].clientX-Y,Gt=K.touches[1].clientY-ne,It=pe(St,kt,ut,Gt),gt=It/Q,Te=150,Bt=Te*Te,Et=1.5,At=Et*Et;if(gt>=At||It>=Bt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Mt=We("cxttapend");t.touchData.start?(t.touchData.start.unactivate().emit(Mt),t.touchData.start=null):oe.emit(Mt)}}if(se&&t.touchData.cxt){var Mt=We("cxtdrag");t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Mt):oe.emit(Mt),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var qr=t.findNearestElement(ve[0],ve[1],!0,!0);(!t.touchData.cxtOver||qr!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit(We("cxtdragout")),t.touchData.cxtOver=qr,qr&&qr.emit(We("cxtdragover")))}else if(se&&K.touches[2]&&oe.boxSelectionEnabled())K.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||oe.emit(We("boxstart")),t.touchData.selecting=!0,t.touchData.didSelect=!0,me[4]=1,!me||me.length===0||me[0]===void 0?(me[0]=(ve[0]+ve[2]+ve[4])/3,me[1]=(ve[1]+ve[3]+ve[5])/3,me[2]=(ve[0]+ve[2]+ve[4])/3+1,me[3]=(ve[1]+ve[3]+ve[5])/3+1):(me[2]=(ve[0]+ve[2]+ve[4])/3,me[3]=(ve[1]+ve[3]+ve[5])/3),t.redrawHint("select",!0),t.redraw();else if(se&&K.touches[1]&&!t.touchData.didSelect&&oe.zoomingEnabled()&&oe.panningEnabled()&&oe.userZoomingEnabled()&&oe.userPanningEnabled()){K.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Me=t.dragData.touchDragEles;if(Me){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 ke;t.registerBinding(e,"touchcancel",ke=function(K){var se=t.touchData.start;t.touchData.capture=!1,se&&se.unactivate()});var Ee,ue,de,xe;if(t.registerBinding(e,"touchend",Ee=function(K){var se=t.touchData.start,me=t.touchData.capture;if(me)K.touches.length===0&&(t.touchData.capture=!1),K.preventDefault();else return;var oe=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var ve=t.cy,ce=ve.zoom(),De=t.touchData.now,Le=t.touchData.earlier;if(K.touches[0]){var We=t.projectIntoViewport(K.touches[0].clientX,K.touches[0].clientY);De[0]=We[0],De[1]=We[1]}if(K.touches[1]){var We=t.projectIntoViewport(K.touches[1].clientX,K.touches[1].clientY);De[2]=We[0],De[3]=We[1]}if(K.touches[2]){var We=t.projectIntoViewport(K.touches[2].clientX,K.touches[2].clientY);De[4]=We[0],De[5]=We[1]}var Ne=function(Bt){return{originalEvent:K,type:Bt,position:{x:De[0],y:De[1]}}};se&&se.unactivate();var je;if(t.touchData.cxt){if(je=Ne("cxttapend"),se?se.emit(je):ve.emit(je),!t.touchData.cxtDragged){var $e=Ne("cxttap");se?se.emit($e):ve.emit($e)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!K.touches[2]&&ve.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Ze=ve.collection(t.getAllInBox(oe[0],oe[1],oe[2],oe[3]));oe[0]=void 0,oe[1]=void 0,oe[2]=void 0,oe[3]=void 0,oe[4]=0,t.redrawHint("select",!0),ve.emit(Ne("boxend"));var He=function(Bt){return Bt.selectable()&&!Bt.selected()};Ze.emit(Ne("box")).stdFilter(He).select().emit(Ne("boxselect")),Ze.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(se!=null&&se.unactivate(),K.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!K.touches[1]){if(!K.touches[0]){if(!K.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var et=t.dragData.touchDragEles;if(se!=null){var Pe=se._private.grabbed;m(et),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Pe&&(se.emit(Ne("freeon")),et.emit(Ne("free")),t.dragData.didDrag&&(se.emit(Ne("dragfreeon")),et.emit(Ne("dragfree")))),i(se,["touchend","tapend","vmouseup","tapdragout"],K,{x:De[0],y:De[1]}),se.unactivate(),t.touchData.start=null}else{var yt=t.findNearestElement(De[0],De[1],!0,!0);i(yt,["touchend","tapend","vmouseup","tapdragout"],K,{x:De[0],y:De[1]})}var Ie=t.touchData.startPosition[0]-De[0],St=Ie*Ie,kt=t.touchData.startPosition[1]-De[1],ut=kt*kt,Gt=St+ut,It=Gt*ce*ce;t.touchData.singleTouchMoved||(se||ve.$(":selected").unselect(["tapunselect"]),i(se,["tap","vclick"],K,{x:De[0],y:De[1]}),ue=!1,K.timeStamp-xe<=ve.multiClickDebounceTime()?(de&&clearTimeout(de),ue=!0,xe=null,i(se,["dbltap","vdblclick"],K,{x:De[0],y:De[1]})):(de=setTimeout(function(){ue||i(se,["onetap","voneclick"],K,{x:De[0],y:De[1]})},ve.multiClickDebounceTime()),xe=K.timeStamp)),se!=null&&!t.dragData.didDrag&&se._private.selectable&&It"u"){var ge=[],ze=function(K){return{clientX:K.clientX,clientY:K.clientY,force:1,identifier:K.pointerId,pageX:K.pageX,pageY:K.pageY,radiusX:K.width/2,radiusY:K.height/2,screenX:K.screenX,screenY:K.screenY,target:K.target}},we=function(K){return{event:K,touch:ze(K)}},Oe=function(K){ge.push(we(K))},Be=function(K){for(var se=0;se0)return z[0]}return null},g=Object.keys(f),m=0;m0?p:Z7t(a,o,e,r,n,i,s,l)},checkPoint:function(e,r,n,i,a,o,s,l){l=l==="auto"?sw(i,a):l;var u=2*l;if(W1(e,r,this.points,o,s,i,a-u,[0,-1],n)||W1(e,r,this.points,o,s,i-u,a,[0,-1],n))return!0;var h=i/2+2*n,d=a/2+2*n,f=[o-h,s-d,o-h,s,o+h,s,o+h,s-d];return!!(nd(e,r,f)||YC(e,r,u,u,o+i/2-l,s+a/2-l,n)||YC(e,r,u,u,o-i/2+l,s+a/2-l,n))}}},q1.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",rh(3,0)),this.generateRoundPolygon("round-triangle",rh(3,0)),this.generatePolygon("rectangle",rh(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",rh(5,0)),this.generateRoundPolygon("round-pentagon",rh(5,0)),this.generatePolygon("hexagon",rh(6,0)),this.generateRoundPolygon("round-hexagon",rh(6,0)),this.generatePolygon("heptagon",rh(7,0)),this.generateRoundPolygon("round-heptagon",rh(7,0)),this.generatePolygon("octagon",rh(8,0)),this.generateRoundPolygon("round-octagon",rh(8,0));var n=new Array(20);{var i=tke(5,0),a=tke(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s=e.deqFastCost*w)break}else if(u){if(b>=e.deqCost*p||b>=e.deqAvgCost*f)break}else if(x>=e.deqNoDrawCost*DEe)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())},s=e.priority||WOe;i.beforeRender(o,s(n))}}}},O7n=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tee;J2(this,t),this.idsByKey=new H1,this.keyForId=new H1,this.cachesByLvl=new H1,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return ew(t,[{key:"getIdsFor",value:function(r){r==null&&Co("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(r);return i||(i=new H4,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 H1,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}}])}(),H9t=25,dte=50,fte=-4,LEe=3,W9t=7.99,k7n=8,E7n=1024,_7n=1024,R7n=1024,D7n=.2,L7n=.8,M7n=10,I7n=.15,P7n=.1,N7n=.9,B7n=.9,$7n=100,F7n=1,d3={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},z7n=Tc({getKey:null,doesEleInvalidateKey:Tee,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:$7t,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),g9=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var i=z7n(r);ln(n,i),n.lookup=new O7n(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},gl=g9.prototype;gl.reasons=d3,gl.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},gl.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n},gl.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new XF(function(r,n){return n.reqs-r.reqs});return e},gl.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},gl.getElement=function(t,e,r,n,i){var a=this,o=this.renderer,s=o.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(KOe(s*r))),n=W9t||n>LEe)return null;var u=Math.pow(2,n),h=e.h*u,d=e.w*u,f=o.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<=H9t?g=H9t:h<=dte?g=dte:g=Math.ceil(h/dte)*dte,h>R7n||d>_7n)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,_,d3.downscale);E()}else return a.queueElement(t,S.level-1),S;else{var P;if(!x&&!w&&!A)for(var L=n-1;L>=fte;L--){var R=l.get(t,L);if(R){P=R;break}}if(b(P))return a.queueElement(t,n),P;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+k7n),v.eleCaches.push(p),l.set(t,n,p),a.checkTextureFullness(v),p},gl.invalidateElements=function(t){for(var e=0;e=D7n*t.width&&this.retireTexture(t)},gl.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>L7n&&t.fullnessChecks>=M7n?iw(r,t):t.fullnessChecks++},gl.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),i=this.lookup;iw(n,t),t.retired=!0;for(var a=t.eleCaches,o=0;o=e)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,YOe(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),iw(i,o),n.push(o),o}},gl.queueElement=function(t,e){var r=this,n=r.getElementQueue(),i=r.getElementKeyToQueue(),a=this.getKey(t),o=i[a];if(o)o.level=Math.max(o.level,e),o.eles.merge(t),o.reqs++,n.updateItem(o);else{var s={eles:t.spawn().merge(t),level:e,reqs:1,key:a};n.push(s),i[a]=s}},gl.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],a=e.lookup,o=0;o0;o++){var s=r.pop(),l=s.key,u=s.eles[0],h=a.hasCache(u,s.level);if(n[l]=null,h)continue;i.push(s);var d=e.getBoundingBox(u);e.getElement(u,d,t,s.level,d3.dequeue)}return i},gl.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=HOe,r.updateItem(a),r.pop(),n[i]=null):a.eles.unmerge(t))},gl.onDequeue=function(t){this.onDequeues.push(t)},gl.offDequeue=function(t){iw(this.onDequeues,t)},gl.setupDequeueing=G9t.setupDequeueing({deqRedrawThreshold:$7n,deqCost:I7n,deqAvgCost:P7n,deqNoDrawCost:N7n,deqFastCost:B7n,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n=V7n||r>pte)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;m9<=M&&M<=pte&&!E(M);M+=D);};_(1),_(-1);for(var P=h.length-1;P>=0;P--){var L=h[P];L.invalid&&iw(h,L)}};if(!f)g();else return h;var m=function(){if(!d){d=th();for(var E=0;Eq9t||L>q9t)return null;var R=P*L;if(R>X7n)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&&!s)return null;for(var y=null,b=t.length/U7n,x=!s,w=0;w=b||!K7t(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)},kc.getEleLevelForLayerLevel=function(t,e){return t},kc.drawEleInLayer=function(t,e,r,n){var i=this,a=this.renderer,o=t.context,s=e.boundingBox();s.w===0||s.h===0||!e.visible()||(r=i.getEleLevelForLayerLevel(r,n),a.setImgSmoothing(o,!1),a.drawCachedElement(o,e,null,null,r,K7n),a.setImgSmoothing(o,!0))},kc.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||o.invalid)return!1;i+=o.eles.length}return i===e.length},kc.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n0){e=!0;break}}return e},kc.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=G1(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,i,a){e.invalidateLayer(n)}))},kc.invalidateLayer=function(t){if(this.lastInvalidationTime=G1(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];iw(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,o=this,s=e._private.rscratch;if(!(a&&!e.visible())&&!(s.badLine||s.allpts==null||isNaN(s.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"?(o.eleStrokeStyle(t,e,D),o.drawEdgeTrianglePath(e,t,s.allpts)):(t.lineWidth=p,t.lineCap=g,o.eleStrokeStyle(t,e,D),o.drawEdgePath(e,t,s.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)o.colorStrokeStyle(t,v[0],v[1],v[2],D);else{t.lineCap="butt";return}d==="straight-triangle"?o.drawEdgeTrianglePath(e,t,s.allpts):(o.drawEdgePath(e,t,s.allpts,f),t.lineCap="butt")},A=function(){i&&o.drawEdgeOverlay(t,e)},S=function(){i&&o.drawEdgeUnderlay(t,e)},T=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;o.drawArrowheads(t,e,D)},C=function(){o.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,P=e.pstyle("ghost-opacity").value,L=y*P;t.translate(E,_),x(L),T(L),t.translate(-E,-_)}else w();S(),x(),T(),A(),C(),r&&t.translate(l.x1,l.y1)}};var ezt=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,o=a.usePaths(),s=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,h=n.pstyle("".concat(e,"-color")).value;r.lineWidth=u,s.edgeType==="self"&&!o?r.lineCap="butt":r.lineCap="round",a.colorStrokeStyle(r,h[0],h[1],h[2],i),a.drawEdgePath(n,r,s.allpts,"solid")}}}};j1.drawEdgeOverlay=ezt("overlay"),j1.drawEdgeUnderlay=ezt("underlay"),j1.drawEdgePath=function(t,e,r,n){var i=t._private.rscratch,a=e,o,s=!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?(o=e=i.pathCache,s=!0):(o=e=new Path2D,i.pathCacheKey=d,i.pathCache=o)}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(!s&&!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,o=this;if(n==null){if(a&&!o.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var s=e.pstyle("label");if(!s||!s.value)return;var l=o.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?(o.drawText(t,e,null,g,a),e.isEdge()&&(o.drawText(t,e,"source",g,a),o.drawText(t,e,"target",g,a))):o.drawText(t,e,i,g,a),r&&t.translate(m.x1,m.y1)},eO.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,o=e.pstyle("font-weight").strValue,s=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*s,u=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=n+" "+o+" "+i+" "+a,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],s),this.colorStrokeStyle(t,h[0],h[1],h[2],l)};function l$n(t,e,r,n,i){var a=Math.min(n,i),o=a/2,s=e+n/2,l=r+i/2;t.beginPath(),t.arc(s,l,o,0,Math.PI*2),t.closePath()}function tzt(t,e,r,n,i){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,o=Math.min(a,n/2,i/2);t.beginPath(),t.moveTo(e+o,r),t.lineTo(e+n-o,r),t.quadraticCurveTo(e+n,r,e+n,r+o),t.lineTo(e+n,r+i-o),t.quadraticCurveTo(e+n,r+i,e+n-o,r+i),t.lineTo(e+o,r+i),t.quadraticCurveTo(e,r+i,e,r+i-o),t.lineTo(e,r+o),t.quadraticCurveTo(e,r,e+o,r),t.closePath()}eO.getTextAngle=function(t,e){var r,n=t._private,i=n.rscratch,a=e?e+"-":"",o=t.pstyle(a+"text-rotation");if(o.strValue==="autorotate"){var s=eh(i,"labelAngle",e);r=t.isEdge()?s:0}else o.strValue==="none"?r=0:r=o.pfValue;return r},eO.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,o=a.rscratch,s=i?e.effectiveOpacity():1;if(!(i&&(s===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=eh(o,"labelX",r),u=eh(o,"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=eh(o,"labelWidth",r),m=eh(o,"labelHeight",r),v=eh(o,"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=r3(w),C=n3(A);switch(C){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,P=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 I=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-P;switch(T){case"left":G-=g;break;case"center":G-=g/2;break}var q=u-m-P,Y=g+2*P,ne=m+2*P;if(U&&(t.fillStyle="rgba(".concat(B[0],",").concat(B[1],",").concat(B[2],",").concat(k*s,")")),Q&&(t.strokeStyle="rgba(".concat(V[0],",").concat(V[1],",").concat(V[2],",").concat(E*s,")"),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(),tzt(t,G,q,Y,ne,M)):D?(t.beginPath(),l$n(t,G,q,Y,ne)):(t.beginPath(),t.rect(G,q,Y,ne)),U&&t.fill(),Q&&t.stroke(),Q&&z==="double"){var X=_/2;t.beginPath(),R?tzt(t,G+X,q+X,Y-2*X,ne-2*X,M):t.rect(G+X,q+X,Y-2*X,ne-2*X),t.stroke()}t.fillStyle=I,t.strokeStyle=N,t.lineWidth=F,t.setLineDash&&t.setLineDash([])}var J=2*e.pstyle("text-outline-width").pfValue;if(J>0&&(t.lineWidth=J),u-=v,e.pstyle("text-wrap").value==="wrap"){var ee=eh(o,"labelWrapCachedLines",r),te=eh(o,"labelLineHeight",r),pe=g/2,ie=this.getLabelJustification(e);switch(ie==="auto"||(T==="left"?ie==="left"?l+=-g:ie==="center"&&(l+=-pe):T==="center"?ie==="left"?l+=-pe:ie==="right"&&(l+=pe):T==="right"&&(ie==="center"?l+=pe:ie==="right"&&(l+=g))),C){case"top":u-=(ee.length-1)*te;break;case"center":case"bottom":u-=(ee.length-1)*te;break}for(var Ce=0;Ce0&&t.strokeText(ee[Ce],l,u),t.fillText(ee[Ce],l,u),u+=te}else J>0&&t.strokeText(f,l,u),t.fillText(f,l,u);S!==0&&(t.rotate(-S),t.translate(-h,-d))}}};var mw={};mw.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,o=this,s,l,u=e._private,h=u.rscratch,d=e.position();if(!(!sr(d.x)||!sr(d.y))&&!(a&&!e.visible())){var f=a?e.effectiveOpacity():1,p=o.usePaths(),g,m=!1,v=e.padding();s=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;o.eleFillStyle(t,e,se)},X=function(){var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V;o.colorStrokeStyle(t,R[0],R[1],R[2],se)},J=function(){var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G;o.colorStrokeStyle(t,U[0],U[1],U[2],se)},ee=function(se,me,oe,ve){var ce=o.nodePathCache=o.nodePathCache||[],De=N7t(oe==="polygon"?oe+","+ve.join(","):oe,""+me,""+se,""+Y),Le=ce[De],We,Ne=!1;return Le!=null?(We=Le,Ne=!0,h.pathCache=We):(We=new Path2D,ce[De]=h.pathCache=We),{path:We,cacheHit:Ne}},te=e.pstyle("shape").strValue,pe=e.pstyle("shape-polygon-points").pfValue;if(p){t.translate(d.x,d.y);var ie=ee(s,l,te,pe);g=ie.path,m=ie.cacheHit}var Ce=function(){if(!m){var se=d;p&&(se={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(g||t,se.x,se.y,s,l,Y,h)}p?t.fill(g):t.fill()},ke=function(){for(var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,oe=u.backgrounding,ve=0,ce=0;ce0&&arguments[0]!==void 0?arguments[0]:!1,me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;o.hasPie(e)&&(o.drawPie(t,e,me),se&&(p||o.nodeShapes[o.getNodeShape(e)].draw(t,d.x,d.y,s,l,Y,h)))},ue=function(){var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;o.hasStripe(e)&&(t.save(),p?t.clip(h.pathCache):(o.nodeShapes[o.getNodeShape(e)].draw(t,d.x,d.y,s,l,Y,h),t.clip()),o.drawStripe(t,e,me),t.restore(),se&&(p||o.nodeShapes[o.getNodeShape(e)].draw(t,d.x,d.y,s,l,Y,h)))},de=function(){var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f,me=(_>0?_:-_)*se,oe=_>0?0:255;_!==0&&(o.colorFillStyle(t,oe,oe,oe,me),p?t.fill(g):t.fill())},xe=function(){if(P>0){if(t.lineWidth=P,t.lineCap=I,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 se=new Path2D;se.rect(-s/2-P,-l/2-P,s+2*P,l+2*P),se.addPath(g),t.clip(se,"evenodd")}p?t.stroke(g):t.stroke(),t.restore()}else p?t.stroke(g):t.stroke();if(D==="double"){t.lineWidth=P/3;var me=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",p?t.stroke(g):t.stroke(),t.globalCompositeOperation=me}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 se=d;p&&(se={x:0,y:0});var me=o.getNodeShape(e),oe=P;N==="inside"&&(oe=0),N==="outside"&&(oe*=2);var ve=(s+oe+(z+q))/s,ce=(l+oe+(z+q))/l,De=s*ve,Le=l*ce,We=o.nodeShapes[me].points,Ne;if(p){var je=ee(De,Le,me,We);Ne=je.path}if(me==="ellipse")o.drawEllipsePath(Ne||t,se.x,se.y,De,Le);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(me)){var $e=0,Ze=0,He=0;me==="round-diamond"?$e=(oe+q+z)*1.4:me==="round-heptagon"?($e=(oe+q+z)*1.075,He=-(oe/2+q+z)/35):me==="round-hexagon"?$e=(oe+q+z)*1.12:me==="round-pentagon"?($e=(oe+q+z)*1.13,He=-(oe/2+q+z)/15):me==="round-tag"?($e=(oe+q+z)*1.12,Ze=(oe/2+z+q)*.07):me==="round-triangle"&&($e=(oe+q+z)*(Math.PI/2),He=-(oe+q/2+z)/Math.PI),$e!==0&&(ve=(s+$e)/s,De=s*ve,["round-hexagon","round-tag"].includes(me)||(ce=(l+$e)/l,Le=l*ce)),Y=Y==="auto"?e$t(De,Le):Y;for(var et=De/2,Pe=Le/2,yt=Y+(oe+z+q)/2,Ie=new Array(We.length/2),St=new Array(We.length/2),kt=0;kt0){if(i=i||n.position(),a==null||o==null){var p=n.padding();a=n.width()+2*p,o=n.height()+2*p}s.colorFillStyle(r,h[0],h[1],h[2],u),s.nodeShapes[d].draw(r,i.x,i.y,a+l*2,o+l*2,f),r.fill()}}}};mw.drawNodeOverlay=rzt("overlay"),mw.drawNodeUnderlay=rzt("underlay"),mw.hasPie=function(t){return t=t[0],t._private.hasPie},mw.hasStripe=function(t){return t=t[0],t._private.hasStripe},mw.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=e.pstyle("pie-size"),o=e.pstyle("pie-hole"),s=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),o.units==="%"?p=f*o.pfValue:o.pfValue!==void 0&&(p=o.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+=s;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)}},mw.drawStripe=function(t,e,r,n){e=e[0],n=n||e.position();var i=e.cy().style(),a=n.x,o=n.y,s=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=s,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,o=0),o-=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,o+g*u,p,g*x),t.closePath(),this.colorFillStyle(t,y[0],y[1],y[2],b),t.fill(),u+=x)}t.restore()};var nh={},c$n=100;nh.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},nh.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=o!==void 0?o:x,A=r.pan(),S={x:A.x,y:A.y},T={zoom:x,pan:{x:A.x,y:A.y}},C=e.prevViewport,k=C===void 0||T.zoom!==C.zoom||T.pan.x!==C.pan.x||T.pan.y!==C.pan.y;!k&&!(m&&!g)&&(e.motionBlurPxRatio=1),s&&(S=s),w*=l,S.x*=l,S.y*=l;var E=e.getCachedZSortedEles();function _(X,J,ee,te,pe){var ie=X.globalCompositeOperation;X.globalCompositeOperation="destination-out",e.colorFillStyle(X,255,255,255,e.motionBlurTransparency),X.fillRect(J,ee,te,pe),X.globalCompositeOperation=ie}function P(X,J){var ee,te,pe,ie;!e.clearingMotionBlur&&(X===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||X===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(ee={x:A.x*p,y:A.y*p},te=x*p,pe=e.canvasWidth*p,ie=e.canvasHeight*p):(ee=S,te=w,pe=e.canvasWidth,ie=e.canvasHeight),X.setTransform(1,0,0,1,0,0),J==="motionBlur"?_(X,0,0,pe,ie):!n&&(J===void 0||J)&&X.clearRect(0,0,pe,ie),i||(X.translate(ee.x,ee.y),X.scale(te,te)),s&&X.translate(s.x,s.y),o&&X.scale(o,o)}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,I=b.core("outside-texture-bg-opacity").value;e.colorFillStyle(R,M[0],M[1],M[2],I),R.fillRect(0,0,T.width,T.height);var x=r.zoom();P(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;P(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]);P(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,P),f&&p!==1){var Q=u.contexts[e.NODE],G=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],q=u.contexts[e.DRAG],Y=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],ne=function(J,ee,te){J.setTransform(1,0,0,1,0,0),te||!y?J.clearRect(0,0,e.canvasWidth,e.canvasHeight):_(J,0,0,e.canvasWidth,e.canvasHeight);var pe=p;J.drawImage(ee,0,0,e.canvasWidth*pe,e.canvasHeight*pe,0,0,e.canvasWidth,e.canvasHeight)};(h[e.NODE]||V[e.NODE])&&(ne(Q,G,V[e.NODE]),h[e.NODE]=!1),(h[e.DRAG]||V[e.DRAG])&&(ne(q,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()},c$n)),n||r.emit("render")};var v9;nh.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,i=r.data,a=n.style(),o=t.drawOnlyNodeLayer,s=t.drawAllLayers,l=i.canvasNeedsRedraw,u=t.forcedContext;if(r.showFps||!o&&l[r.SELECT_BOX]&&!s){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",!v9){var y=h.measureText(v);v9=y.actualBoundingBoxAscent}h.fillText(v,0,v9);var b=60;h.strokeRect(0,v9+10,250,20),h.fillRect(0,v9+10,250*Math.min(m/b,1),20)}s||(l[r.SELECT_BOX]=!1)}};function nzt(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 u$n(t,e,r){var n=nzt(t,t.VERTEX_SHADER,e),i=nzt(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 h$n(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 PEe(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 d$n(t){var e=t.pixelRatio,r=t.cy.zoom();return r*e}function f$n(t,e,r,n,i){var a=n*r+e.x,o=i*r+e.y;return o=Math.round(t.canvasHeight-o),[a,o]}function p$n(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 g$n(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 m$n(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function v$n(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 izt(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 azt(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function y$n(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 b$n(t,e,r,n){var i=izt(t,e),a=qs(i,2),o=a[0],s=a[1],l=azt(t,s,n),u=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,u),t.bufferData(t.ARRAY_BUFFER,l,t.STATIC_DRAW),s===t.FLOAT?t.vertexAttribPointer(r,o,s,!1,0,0):s===t.INT&&t.vertexAttribIPointer(r,o,s,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),u}function tv(t,e,r,n){var i=izt(t,r),a=qs(i,3),o=a[0],s=a[1],l=a[2],u=azt(t,s,e*o),h=o*l,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*h,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),s===t.FLOAT?t.vertexAttribPointer(n,o,s,!1,h,0):s===t.INT&&t.vertexAttribIPointer(n,o,s,h,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var f=new Array(e),p=0;po&&(s=o/n,l=n*s,u=i*s),{scale:s,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 o=this.texSize,s=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,C=S,k=l*T;A.save(),A.translate(C,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==o&&(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=o-a.freePointer.x,S=d-A,T=l;{var C=a.freePointer.x,k=a.freePointer.row*l,E=A;w.context.drawImage(x,0,0,E,T,C,k,E,T),g[0]={x:C,y:k,w:E,h:f}}{var _=A,P=(a.freePointer.row+1)*l,L=S;w&&w.context.drawImage(x,_,0,L,T,0,P,L,T),g[1]={x:0,y:P,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<=o)m();else{if(this.freePointer.row>=s-1)return!1;this.freePointer.x===o?(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),o=a.texW;return this.freePointer.x+o>n?this.freePointer.row1&&arguments[1]!==void 0?arguments[1]:{},a=i.forceRedraw,o=a===void 0?!1:a,s=i.filterEle,l=s===void 0?function(){return!0}:s,u=i.filterType,h=u===void 0?function(){return!0}:u,d=!1,f=!1,p=rd(r),g;try{for(p.s();!(g=p.n()).done;){var m=g.value;if(l(m)){var v=rd(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),C=Array.isArray(T)?T:[T];if(o)C.forEach(function(P){return S.markKeyForGC(P)}),f=!0;else{var k=w.getID?w.getID(m):m.id(),E=n._key(A,k),_=n.typeAndIdToKey.get(E);_!==void 0&&!g$n(C,_)&&(d=!0,n.typeAndIdToKey.delete(E),_.forEach(function(P){return S.markKeyForGC(P)}))}}};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=rd(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 o=this.renderTypes.get(n),s=this.collections.get(o.collection),l=!1,u=s.draw(a,i,function(f){o.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,i.w,i.h),f.clip(),o.drawElement(f,r,i,!0,!0),f.restore()):o.drawElement(f,r,i,!0,!0),l=!0});if(l){var h=o.getID?o.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),o=a.getKey(r),s=Array.isArray(o)?o:[o];return s.map(function(l){var u=a.getBoundingBox(r,l),h=i.getOrCreateAtlas(r,n,u,l),d=h.getOffsets(l),f=qs(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=rd(this.collections),i;try{for(n.s();!(i=n.n()).done;){var a=qs(i.value,2),o=a[0],s=a[1],l=s.getCounts(),u=l.keyCount,h=l.atlasCount;r.push({type:o,keyCount:u,atlasCount:h})}}catch(d){n.e(d)}finally{n.f()}return r}}])}(),E$n=function(){function t(e){J2(this,t),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return ew(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}}])}(),_$n=` float circleSD(vec2 p, float r) { return distance(vec2(0), p) - r; // signed distance } -`,E$n=` +`,R$n=` float rectangleSD(vec2 p, vec2 b) { vec2 d = abs(p)-b; return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0); } -`,_$n=` +`,D$n=` float roundRectangleSD(vec2 p, vec2 b, vec4 cr) { cr.xy = (p.x > 0.0) ? cr.xy : cr.zw; cr.x = (p.y > 0.0) ? cr.x : cr.y; vec2 q = abs(p) - b + cr.x; return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x; } -`,R$n=` +`,L$n=` float ellipseSD(vec2 p, vec2 ab) { p = abs( p ); // symmetry @@ -1040,7 +1040,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) // return signed distance return (dot(p/ab,p/ab)>1.0) ? d : -d; } -`,y9={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},mte={IGNORE:1,USE_BB:2},$Ee=0,szt=1,lzt=2,FEe=3,p3=4,vte=5,b9=6,x9=7,D$n=function(){function t(e,r,n){J2(this,t),this.r=e,this.gl=r,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=c$n,this.atlasManager=new C$n(e,n),this.batchManager=new O$n(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(y9.SCREEN),this.pickingProgram=this._createShaderProgram(y9.PICKING),this.vao=this._createVAO()}return ew(t,[{key:"addAtlasCollection",value:function(r,n){this.atlasManager.addAtlasCollection(r,n)}},{key:"addTextureAtlasRenderType",value:function(r,n){this.atlasManager.addRenderType(r,n)}},{key:"addSimpleShapeRenderType",value:function(r,n){this.simpleShapeOptions.set(r,n)}},{key:"invalidate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.type,a=this.atlasManager;return i?a.invalidate(r,{filterType:function(s){return s===i},forceRedraw:!0}):a.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(r){var n=this.gl,i=`#version 300 es +`,y9={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},mte={IGNORE:1,USE_BB:2},$Ee=0,czt=1,uzt=2,FEe=3,p3=4,vte=5,b9=6,x9=7,M$n=function(){function t(e,r,n){J2(this,t),this.r=e,this.gl=r,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=h$n,this.atlasManager=new k$n(e,n),this.batchManager=new E$n(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(y9.SCREEN),this.pickingProgram=this._createShaderProgram(y9.PICKING),this.vao=this._createVAO()}return ew(t,[{key:"addAtlasCollection",value:function(r,n){this.atlasManager.addAtlasCollection(r,n)}},{key:"addTextureAtlasRenderType",value:function(r,n){this.atlasManager.addRenderType(r,n)}},{key:"addSimpleShapeRenderType",value:function(r,n){this.simpleShapeOptions.set(r,n)}},{key:"invalidate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.type,a=this.atlasManager;return i?a.invalidate(r,{filterType:function(s){return s===i},forceRedraw:!0}):a.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(r){var n=this.gl,i=`#version 300 es precision highp float; uniform mat3 uPanZoomMatrix; @@ -1121,7 +1121,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(szt,`) { + else if(aVertType == `).concat(czt,`) { vec2 source = aPointAPointB.xy; vec2 target = aPointAPointB.zw; @@ -1136,7 +1136,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(lzt,`) { + else if(aVertType == `).concat(uzt,`) { vec2 pointA = aPointAPointB.xy; vec2 pointB = aPointAPointB.zw; vec2 pointC = aPointCPointD.xy; @@ -1230,10 +1230,10 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) out vec4 outColor; - `).concat(k$n,` - `).concat(E$n,` `).concat(_$n,` `).concat(R$n,` + `).concat(D$n,` + `).concat(L$n,` vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha return vec4( @@ -1318,16 +1318,16 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT) `).concat(r.picking?`if(outColor.a == 0.0) discard; else outColor = vIndex;`:"",` } - `),s=l$n(n,i,o);s.aPosition=n.getAttribLocation(s,"aPosition"),s.aIndex=n.getAttribLocation(s,"aIndex"),s.aVertType=n.getAttribLocation(s,"aVertType"),s.aTransform=n.getAttribLocation(s,"aTransform"),s.aAtlasId=n.getAttribLocation(s,"aAtlasId"),s.aTex=n.getAttribLocation(s,"aTex"),s.aPointAPointB=n.getAttribLocation(s,"aPointAPointB"),s.aPointCPointD=n.getAttribLocation(s,"aPointCPointD"),s.aLineWidth=n.getAttribLocation(s,"aLineWidth"),s.aColor=n.getAttribLocation(s,"aColor"),s.aCornerRadius=n.getAttribLocation(s,"aCornerRadius"),s.aBorderColor=n.getAttribLocation(s,"aBorderColor"),s.uPanZoomMatrix=n.getUniformLocation(s,"uPanZoomMatrix"),s.uAtlasSize=n.getUniformLocation(s,"uAtlasSize"),s.uBGColor=n.getUniformLocation(s,"uBGColor"),s.uZoom=n.getUniformLocation(s,"uZoom"),s.uTextures=[];for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:y9.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,o=this.batchManager,s=a.getRenderTypeOpts(i);if(this._isVisible(r,s)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&s.getTexPickingMode){var l=s.getTexPickingMode(r);if(l===mte.IGNORE)return;if(l==mte.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=a.getAtlasInfo(r,i),h=rd(u),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,p=f.atlas,g=f.tex1,m=f.tex2;o.canAddToCurrentBatch(p)||this.endBatch();for(var v=o.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 o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=0;if(i.shapeProps&&i.shapeProps.padding&&(s=r.pstyle(i.shapeProps.padding).pfValue),a){var l=a.bb,u=a.tex1,h=a.tex2,d=u.w/(u.w+h.w);o||(d=1-d);var f=this._getAdjustedBB(l,s,o,d);this._applyTransformMatrix(n,f,i,r)}else{var p=i.getBoundingBox(r),g=this._getAdjustedBB(p,s,!0,1);this._applyTransformMatrix(n,g,i,r)}}},{key:"_applyTransformMatrix",value:function(r,n,i,a){var o,s;azt(r);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var u=i.getRotationPoint(a),h=u.x,d=u.y;gte(r,r,[h,d]),ozt(r,r,l);var f=i.getRotationOffset(a);o=f.x+(n.xOffset||0),s=f.y+(n.yOffset||0)}else o=n.x1,s=n.y1;gte(r,r,[o,s]),BEe(r,r,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(r,n,i,a){var o=r.x1,s=r.y1,l=r.w,u=r.h,h=r.yOffset;n&&(o-=n,s-=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,o+=d,l=f),{x1:o,y1:s,w:l,h:u,xOffset:d,yOffset:h}}},{key:"drawPickingRectangle",value:function(r,n,i){var a=this.atlasManager.getRenderTypeOpts(i),o=this.instanceCount;this.vertTypeBuffer.getView(o)[0]=p3;var s=this.indexBuffer.getView(o);f3(n,s);var l=this.colorBuffer.getView(o);tO([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(o);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 o=a.shapeProps,s=this._getVertTypeForShape(r,o.shape);if(s===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]=s,s===vte||s===b9){var u=a.getBoundingBox(r),h=this._getCornerRadius(r,o.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=h,d[1]=h,d[2]=h,d[3]=h,s===b9&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);f3(n,f);var p=this.renderTarget.picking?1:i==="node-body"?r.effectiveOpacity():1,g=this.renderTarget.picking?1:r.pstyle(o.opacity).value*p,m=r.pstyle(o.color).value,v=this.colorBuffer.getView(l);tO(m,g,v);var y=this.lineWidthBuffer.getView(l);if(y[0]=0,y[1]=0,o.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);tO(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 C=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(r,C,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 p3;case"ellipse":return x9;case"roundrectangle":case"round-rectangle":return vte;case"bottom-round-rectangle":return b9;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var a=i.w,o=i.h;if(r.pstyle(n).value==="auto")return sw(a,o);var s=r.pstyle(n).pfValue,l=a/2,u=o/2;return Math.min(s,u,l)}},{key:"drawEdgeArrow",value:function(r,n,i){if(r.visible()){var a=r._private.rscratch,o,s,l;if(i==="source"?(o=a.arrowStartX,s=a.arrowStartY,l=a.srcArrowAngle):(o=a.arrowEndX,s=a.arrowEndY,l=a.tgtArrowAngle),!(isNaN(o)||o==null||isNaN(s)||s==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);azt(b),gte(b,b,[o,s]),BEe(b,b,[v,v]),ozt(b,b,l),this.vertTypeBuffer.getView(y)[0]=FEe;var x=this.indexBuffer.getView(y);f3(n,x);var w=this.colorBuffer.getView(y);tO(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,o=r.pstyle("line-opacity").value,s=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=a*o;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=szt;var d=this.indexBuffer.getView(h);f3(n,d);var f=this.colorBuffer.getView(h);tO(l,u,f);var p=this.lineWidthBuffer.getView(h);p[0]=s;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 o=a/n;this._setCurvePoint(r,o,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 o=Array(r.length-2),s=0;s0}},s=function(d){var f=d.pstyle("text-events").strValue==="yes";return f?mte.USE_BB:mte.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:d$n,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:o("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:o("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:s,getKey:zEe(e.getLabelKey,null),getBoundingBox:UEe(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:s,getKey:zEe(e.getSourceLabelKey,"source"),getBoundingBox:UEe(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:s,getKey:zEe(e.getTargetLabelKey,"target"),getBoundingBox:UEe(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:a("target-label")});var u=WF(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()}),M$n(r)};function L$n(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return d7t(r)}function uzt(t,e){var r=t._private.rscratch;return eh(r,"labelWrapCachedLines",e)||[]}var zEe=function(e,r){return function(n){var i=e(n),a=uzt(n,r);return a.length>1?a.map(function(o,s){return"".concat(i,"_").concat(s)}):i}},UEe=function(e,r){return function(n,i){var a=e(n);if(typeof i=="string"){var o=i.indexOf("_");if(o>0){var s=Number(i.substring(o+1)),l=uzt(n,r),u=a.h/l.length,h=u*s,d=a.y1+h;return{x1:a.x1,w:a.w,y1:d,h:u,yOffset:h}}}return a}};function M$n(t){{var e=t.render;t.render=function(a){a=a||{};var o=t.cy;t.webgl&&(o.zoom()>G9t?(I$n(t),e.call(t,a)):(P$n(t),dzt(t,a,y9.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,o,s,l){return U$n(t,a,o)};{var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var i=t.notify;t.notify=function(a,o){i.call(t,a,o),a==="viewport"||a==="bounds"?t.pickingFrameBuffer.needsDraw=!0:a==="background"&&t.drawing.invalidate(o,{type:"node-body"})}}}function I$n(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function P$n(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 N$n(t){var e=t.canvasWidth,r=t.canvasHeight,n=PEe(t),i=n.pan,a=n.zoom,o=NEe();gte(o,o,[i.x,i.y]),BEe(o,o,[a,a]);var s=NEe();w$n(s,e,r);var l=NEe();return x$n(l,s,o),l}function hzt(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=PEe(t),a=i.pan,o=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(a.x,a.y),e.scale(o,o)}function B$n(t,e){t.drawSelectionRectangle(e,function(r){return hzt(t,r)})}function $$n(t){var e=t.data.contexts[t.NODE];e.save(),hzt(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 F$n(t){var e=function(i,a,o){for(var s=i.atlasManager.getAtlasCollection(a),l=t.data.contexts[t.NODE],u=s.atlases,h=0;h=0&&w.add(T)}return w}function U$n(t,e,r){var n=z$n(t,e,r),i=t.getCachedZSortedEles(),a,o,s=rd(n),l;try{for(s.s();!(l=s.n()).done;){var u=l.value,h=i[u];if(!a&&h.isNode()&&(a=h),!o&&h.isEdge()&&(o=h),a&&o)break}}catch(d){s.e(d)}finally{s.f()}return[a,o].filter(Boolean)}function VEe(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 dzt(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]&&B$n(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var o=t.data.contexts[t.WEBGL];r.screen?(o.clearColor(0,0,0,0),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA)):o.disable(o.BLEND),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.viewport(0,0,o.canvas.width,o.canvas.height);var s=N$n(t),l=t.getCachedZSortedEles();if(a=l.length,i.startFrame(s,r),r.screen){for(var u=0;u0&&o>0){p.clearRect(0,0,a,o),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,o),p.fill())}return f};function V$n(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a"u"?"undefined":dl(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},[j9t,ev,j1,IEe,eO,mw,nh,czt,vw,w9,yzt].forEach(function(t){ln(ni,t)});var H$n=[{name:"null",impl:w9t},{name:"base",impl:U9t},{name:"canvas",impl:Q$n}],W$n=[{type:"layout",extensions:g7n},{type:"renderer",extensions:H$n}],xzt={},wzt={};function Azt(t,e,r){var n=r,i=function(C){aa("Can not register `"+e+"` for `"+t+"` since `"+C+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(h9.prototype[e])return i(e);h9.prototype[e]=r}else if(t==="collection"){if(Oc.prototype[e])return i(e);Oc.prototype[e]=r}else if(t==="layout"){for(var a=function(C){this.options=C,r.call(this,C),Bi(this._private)||(this._private={}),this._private.cy=C.cy,this._private.listeners=[],this.createEmitter()},o=a.prototype=Object.create(r.prototype),s=[],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==o.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(o,s){o==null&&s==null?(this.x=0,this.y=0):(this.x=o,this.y=s)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(o){this.x=o},a.prototype.setY=function(o){this.y=o},a.prototype.getDifference=function(o){return new DimensionD(this.x-o.x,this.y-o.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(o){return this.x+=o.width,this.y+=o.height,this},r.exports=a},function(r,n,i){var a=i(2),o=i(10),s=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=o.MIN_VALUE,this.margin=s.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&&C>-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(C,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=o.MAX_VALUE,y=o.MAX_VALUE,b,x,w,A=this.getNodes(),S=A.length,T=0;Tb&&(v=b),y>x&&(y=x)}return v==o.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=o.MAX_VALUE,b=-o.MAX_VALUE,x=o.MAX_VALUE,w=-o.MAX_VALUE,A,S,T,C,k,E=this.nodes,_=E.length,P=0;P<_;P++){var L=E[P];v&&L.child!=null&&L.updateBounds(),A=L.getLeft(),S=L.getRight(),T=L.getTop(),C=L.getBottom(),y>A&&(y=A),bT&&(x=T),wA&&(y=A),bT&&(x=T),w=this.nodes.length){var _=0;b.forEach(function(P){P.owner==v&&_++}),_==this.nodes.length&&(this.isConnected=!0)}},r.exports=g},function(r,n,i){var a,o=i(1);function s(l){a=i(5),this.layout=l,this.graphs=[],this.edges=[]}s.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},s.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}},s.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()-s.getX(),s.getRight()-l.getRight()):l.getX()<=s.getX()&&l.getRight()>=s.getRight()&&(u[0]+=Math.min(s.getX()-l.getX(),l.getRight()-s.getRight())),s.getY()<=l.getY()&&s.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-s.getY(),s.getBottom()-l.getBottom()):l.getY()<=s.getY()&&l.getBottom()>=s.getBottom()&&(u[1]+=Math.min(s.getY()-l.getY(),l.getBottom()-s.getBottom()));var f=Math.abs((l.getCenterY()-s.getCenterY())/(l.getCenterX()-s.getCenterX()));l.getCenterY()===s.getCenterY()&&l.getCenterX()===s.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]=C,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)),-I===N?f>h?(u[2]=k,u[3]=E,D=!0):(u[2]=C,u[3]=T,D=!0):I===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(I,N,2)):(F=this.getCardinalDirection(-M,N,3),B=this.getCardinalDirection(-I,N,1)):d>p?(F=this.getCardinalDirection(-M,N,1),B=this.getCardinalDirection(-I,N,3)):(F=this.getCardinalDirection(M,N,2),B=this.getCardinalDirection(I,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+P*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+-P*N,u[2]=U,u[3]=Q;break}}return!1},o.getCardinalDirection=function(s,l,u){return s>l?u:1+u%4},o.getIntersection=function(s,l,u,h){if(h==null)return this.getIntersection2(s,l,u);var d=s.x,f=s.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,C=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,C=m-y,E=y*v-m*b,_=A*C-S*T,_===0?null:(x=(T*E-C*k)/_,w=(S*k-A*E)/_,new a(x,w))},o.angleOfVector=function(s,l,u,h){var d=void 0;return s!==u?(d=Math.atan((h-l)/(u-s)),u0?1:o<0?-1:0},a.floor=function(o){return o<0?Math.ceil(o):Math.floor(o)},a.ceil=function(o){return o<0?Math.floor(o):Math.ceil(o)},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(s);return s==null||l!="object"&&l!="function"},r.exports=o},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 C=A[0];A.splice(0,1),w.add(C);for(var k=C.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&&C.push(R),b.set(R,M)}})}y=y.concat(C),(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 o(s,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}o.prototype.getWorldOrgX=function(){return this.lworldOrgX},o.prototype.setWorldOrgX=function(s){this.lworldOrgX=s},o.prototype.getWorldOrgY=function(){return this.lworldOrgY},o.prototype.setWorldOrgY=function(s){this.lworldOrgY=s},o.prototype.getWorldExtX=function(){return this.lworldExtX},o.prototype.setWorldExtX=function(s){this.lworldExtX=s},o.prototype.getWorldExtY=function(){return this.lworldExtY},o.prototype.setWorldExtY=function(s){this.lworldExtY=s},o.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},o.prototype.setDeviceOrgX=function(s){this.ldeviceOrgX=s},o.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},o.prototype.setDeviceOrgY=function(s){this.ldeviceOrgY=s},o.prototype.getDeviceExtX=function(){return this.ldeviceExtX},o.prototype.setDeviceExtX=function(s){this.ldeviceExtX=s},o.prototype.getDeviceExtY=function(){return this.ldeviceExtY},o.prototype.setDeviceExtY=function(s){this.ldeviceExtY=s},o.prototype.transformX=function(s){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(s-this.lworldOrgX)*this.ldeviceExtX/u),l},o.prototype.transformY=function(s){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(s-this.lworldOrgY)*this.ldeviceExtY/u),l},o.prototype.inverseTransformX=function(s){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(s-this.ldeviceOrgX)*this.lworldExtX/u),l},o.prototype.inverseTransformY=function(s){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(s-this.ldeviceOrgY)*this.lworldExtY/u),l},o.prototype.inverseTransformPoint=function(s){var l=new a(this.inverseTransformX(s.x),this.inverseTransformY(s.y));return l},r.exports=o},function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);gs.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*s.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-s.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>s.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(s.COOLING_ADAPTATION_FACTOR,1-(p-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*(1-s.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=s.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%s.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;o(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===s&&h.callback===l&&this.listeners.splice(u,1)}},o.emit=function(s,l){for(var u=0;uh.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*s.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*s.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 C=new Set(this.getAllNodes()),k=this.nodesWithGravity.filter(function(E){return C.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()),C=this.nodesWithGravity.filter(function(_){return T.has(_)});this.graphManager.setAllNodesToApplyGravitation(C),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(),C={},k=0;k1){var R;for(R=0;RE&&(E=Math.floor(L.y)),P=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,C,k){var E=Math.max(this.maxDiagonalInTree(T),d.DEFAULT_RADIAL_SEPARATION);A.branchRadialLayout(C,null,0,359,0,E);var _=x.calculateBounds(T),P=new w;P.setDeviceOrgX(_.getMinX()),P.setDeviceOrgY(_.getMinY()),P.setWorldOrgX(k.x),P.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--}C!=null?z=(N.indexOf(U[0])+1)%V:z=0;for(var q=Math.abs(E-k)/F,Y=z;B!=F;Y=++Y%V){var ne=N[Y].getOtherEnd(T);if(ne!=C){var X=(k+B*q)%360,J=(X+q)%360;A.branchRadialLayout(ne,T,X,J,_+P,P),B++}}},A.maxDiagonalInTree=function(T){for(var C=y.MIN_VALUE,k=0;kC&&(C=_)}return C},A.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},A.prototype.groupZeroDegreeMembers=function(){var T=this,C={};this.memberGroups={},this.idToDummyNode={};for(var k=[],E=this.graphManager.getAllNodes(),_=0;_"u"&&(C[R]=[]),C[R]=C[R].concat(P)}Object.keys(C).forEach(function(D){if(C[D].length>1){var M="DummyCompound_"+D;T.memberGroups[M]=C[D];var I=C[D][0].getParent(),N=new u(T.graphManager);N.id=M,N.paddingLeft=I.paddingLeft||0,N.paddingRight=I.paddingRight||0,N.paddingBottom=I.paddingBottom||0,N.paddingTop=I.paddingTop||0,T.idToDummyNode[M]=N;var F=T.getGraphManager().add(T.newGraph(),N),B=I.getChild();B.add(N);for(var V=0;V=0;T--){var C=this.compoundOrder[T],k=C.id,E=C.paddingLeft,_=C.paddingTop;this.adjustLocations(this.tiledMemberPack[k],C.rect.x,C.rect.y,E,_)}},A.prototype.repopulateZeroDegreeMembers=function(){var T=this,C=this.tiledZeroDegreePack;Object.keys(C).forEach(function(k){var E=T.idToDummyNode[k],_=E.paddingLeft,P=E.paddingTop;T.adjustLocations(C[k],E.rect.x,E.rect.y,_,P)})},A.prototype.getToBeTiled=function(T){var C=T.id;if(this.toBeTiled[C]!=null)return this.toBeTiled[C];var k=T.getChild();if(k==null)return this.toBeTiled[C]=!1,!1;for(var E=k.getNodes(),_=0;_0)return this.toBeTiled[C]=!1,!1;if(P.getChild()==null){this.toBeTiled[P.id]=!1;continue}if(!this.getToBeTiled(P))return this.toBeTiled[C]=!1,!1}return this.toBeTiled[C]=!0,!0},A.prototype.getNodeDegree=function(T){T.id;for(var C=T.getEdges(),k=0,E=0;ED&&(D=I.rect.height)}k+=D+T.verticalPadding}},A.prototype.tileCompoundMembers=function(T,C){var k=this;this.tiledMemberPack=[],Object.keys(T).forEach(function(E){var _=C[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,C){var k=d.TILING_PADDING_VERTICAL,E=d.TILING_PADDING_HORIZONTAL,_={rows:[],rowWidth:[],rowHeight:[],width:0,height:C,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(C)},A.prototype.getShortestRowIndex=function(T){for(var C=-1,k=Number.MAX_VALUE,E=0;Ek&&(C=E,k=T.rowWidth[E]);return C},A.prototype.canAddHorizontal=function(T,C,k){var E=this.getShortestRowIndex(T);if(E<0)return!0;var _=T.rowWidth[E];if(_+T.horizontalPadding+C<=T.width)return!0;var P=0;T.rowHeight[E]0&&(P=k+T.verticalPadding-T.rowHeight[E]);var L;T.width-_>=C+T.horizontalPadding?L=(T.height+P)/(_+C+T.horizontalPadding):L=(T.height+P)/T.width,P=k+T.verticalPadding;var R;return T.widthP&&C!=k){E.splice(-1,1),T.rows[k].push(_),T.rowWidth[C]=T.rowWidth[C]-P,T.rowWidth[k]=T.rowWidth[k]+P,T.width=T.rowWidth[instance.getLongestRowIndex(T)];for(var L=Number.MIN_VALUE,R=0;RL&&(L=E[R].height);C>0&&(L+=T.verticalPadding);var D=T.rowHeight[C]+T.rowHeight[k];T.rowHeight[C]=L,T.rowHeight[k]<_.height+T.verticalPadding&&(T.rowHeight[k]=_.height+T.verticalPadding);var M=T.rowHeight[C]+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=[],C=!0,k;C;){var E=this.graphManager.getAllNodes(),_=[];C=!1;for(var P=0;P0)for(var B=_;B<=P;B++)F[0]+=this.grid[B][L-1].length+this.grid[B][L].length-1;if(P0)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,C,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}])})})(Tzt);var Z$n=Tzt.exports;const J$n=wh(Z$n);rv.use(J$n);function kzt(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}})})}O(kzt,"addNodes");function Ezt(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})})}O(Ezt,"addEdges");function _zt(t){return new Promise(e=>{const r=_t("body").append("div").attr("id","cy").attr("style","display:none"),n=rv({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),kzt(t.nodes,n),Ezt(t.edges,n),n.nodes().forEach(function(a){a.layoutDimensions=()=>{const o=a.data();return{w:o.width,h:o.height}}});const i={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(i).run(),n.ready(a=>{ye.info("Cytoscape ready",a),e(n)})})}O(_zt,"createCytoscapeInstance");function Rzt(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})}O(Rzt,"extractPositionedNodes");function Dzt(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})}O(Dzt,"extractPositionedEdges");async function Lzt(t,e){ye.debug("Starting cose-bilkent layout algorithm");try{Mzt(t);const r=await _zt(t),n=Rzt(r),i=Dzt(r);return ye.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(r){throw ye.error("Error in cose-bilkent layout algorithm:",r),r}}O(Lzt,"executeCoseBilkentLayout");function Mzt(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}O(Mzt,"validateLayoutData");var eFn=O(async(t,e,{insertCluster:r,insertEdge:n,insertEdgeLabel:i,insertMarkers:a,insertNode:o,log:s,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");s.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 o(v,x,{config:t.config,dir:t.direction||"TB"}),S=A.node().getBBox();w.width=S.width,w.height=S.height,w.domId=A,s.debug(`Node ${x.id} dimensions: ${S.width}x${S.height}`)}})),s.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 Lzt(y,t.config);s.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,s.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}])}),s.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){s.debug("APA01 positionedEdge",S);const T={...x},C=n(g,T,d,t.type,w,A,t.diagramId);l(T,C)}else{const T={...x,points:[{x:w.x||0,y:w.y||0},{x:A.x||0,y:A.y||0}]},C=n(g,T,d,t.type,w,A,t.diagramId);l(T,C)}}})),s.debug("Cose-bilkent rendering completed")},"render"),tFn=eFn;const rFn=Object.freeze(Object.defineProperty({__proto__:null,render:tFn},Symbol.toStringTag,{value:"Module"}));var bte=O((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"),Izt=O((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"};bte(t,r).lower()},"drawBackgroundRect"),nFn=O((t,e)=>{const r=e.text.replace(nR," "),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"),qEe=O((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=ZT(n);i.attr("xlink:href",a)},"drawImage"),jEe=O((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=ZT(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),gf=O(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),XEe=O(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),KEe=O(()=>{let t=_t(".mermaidTooltip");return t.empty()&&(t=_t("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"),xte=function(){var t=O(function(we,Oe,Be,Z){for(Be=Be||{},Z=we.length;Z--;Be[we[Z]]=Oe);return Be},"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],o=[1,63],s=[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],C=[1,40],k=[1,41],E=[1,42],_=[1,43],P=[1,44],L=[1,45],R=[1,46],D=[1,47],M=[1,48],I=[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],q=[1,59],Y=[1,60],ne=[14,42],X=[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],J=[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],te=[1,83],pe=[1,84],ie=[1,85],Ce=[12,14,42],ke=[12,14,33,42],Ee=[12,14,33,42,76,77,79,80],ue=[12,33],de=[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],xe={trace:O(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:O(function(Oe,Be,Z,le,be,ae,K){var se=ae.length-1;switch(be){case 3:le.setDirection("TB");break;case 4:le.setDirection("BT");break;case 5:le.setDirection("RL");break;case 6:le.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:le.setC4Type(ae[se-3]);break;case 19:le.setTitle(ae[se].substring(6)),this.$=ae[se].substring(6);break;case 20:le.setAccDescription(ae[se].substring(15)),this.$=ae[se].substring(15);break;case 21:this.$=ae[se].trim(),le.setTitle(this.$);break;case 22:case 23:this.$=ae[se].trim(),le.setAccDescription(this.$);break;case 28:ae[se].splice(2,0,"ENTERPRISE"),le.addPersonOrSystemBoundary(...ae[se]),this.$=ae[se];break;case 29:ae[se].splice(2,0,"SYSTEM"),le.addPersonOrSystemBoundary(...ae[se]),this.$=ae[se];break;case 30:le.addPersonOrSystemBoundary(...ae[se]),this.$=ae[se];break;case 31:ae[se].splice(2,0,"CONTAINER"),le.addContainerBoundary(...ae[se]),this.$=ae[se];break;case 32:le.addDeploymentNode("node",...ae[se]),this.$=ae[se];break;case 33:le.addDeploymentNode("nodeL",...ae[se]),this.$=ae[se];break;case 34:le.addDeploymentNode("nodeR",...ae[se]),this.$=ae[se];break;case 35:le.popBoundaryParseStack();break;case 39:le.addPersonOrSystem("person",...ae[se]),this.$=ae[se];break;case 40:le.addPersonOrSystem("external_person",...ae[se]),this.$=ae[se];break;case 41:le.addPersonOrSystem("system",...ae[se]),this.$=ae[se];break;case 42:le.addPersonOrSystem("system_db",...ae[se]),this.$=ae[se];break;case 43:le.addPersonOrSystem("system_queue",...ae[se]),this.$=ae[se];break;case 44:le.addPersonOrSystem("external_system",...ae[se]),this.$=ae[se];break;case 45:le.addPersonOrSystem("external_system_db",...ae[se]),this.$=ae[se];break;case 46:le.addPersonOrSystem("external_system_queue",...ae[se]),this.$=ae[se];break;case 47:le.addContainer("container",...ae[se]),this.$=ae[se];break;case 48:le.addContainer("container_db",...ae[se]),this.$=ae[se];break;case 49:le.addContainer("container_queue",...ae[se]),this.$=ae[se];break;case 50:le.addContainer("external_container",...ae[se]),this.$=ae[se];break;case 51:le.addContainer("external_container_db",...ae[se]),this.$=ae[se];break;case 52:le.addContainer("external_container_queue",...ae[se]),this.$=ae[se];break;case 53:le.addComponent("component",...ae[se]),this.$=ae[se];break;case 54:le.addComponent("component_db",...ae[se]),this.$=ae[se];break;case 55:le.addComponent("component_queue",...ae[se]),this.$=ae[se];break;case 56:le.addComponent("external_component",...ae[se]),this.$=ae[se];break;case 57:le.addComponent("external_component_db",...ae[se]),this.$=ae[se];break;case 58:le.addComponent("external_component_queue",...ae[se]),this.$=ae[se];break;case 60:le.addRel("rel",...ae[se]),this.$=ae[se];break;case 61:le.addRel("birel",...ae[se]),this.$=ae[se];break;case 62:le.addRel("rel_u",...ae[se]),this.$=ae[se];break;case 63:le.addRel("rel_d",...ae[se]),this.$=ae[se];break;case 64:le.addRel("rel_l",...ae[se]),this.$=ae[se];break;case 65:le.addRel("rel_r",...ae[se]),this.$=ae[se];break;case 66:le.addRel("rel_b",...ae[se]),this.$=ae[se];break;case 67:ae[se].splice(0,1),le.addRel("rel",...ae[se]),this.$=ae[se];break;case 68:le.updateElStyle("update_el_style",...ae[se]),this.$=ae[se];break;case 69:le.updateRelStyle("update_rel_style",...ae[se]),this.$=ae[se];break;case 70:le.updateLayoutConfig("update_layout_config",...ae[se]),this.$=ae[se];break;case 71:this.$=[ae[se]];break;case 72:ae[se].unshift(ae[se-1]),this.$=ae[se];break;case 73:case 75:this.$=ae[se].trim();break;case 74:let me={};me[ae[se-1].trim()]=ae[se].trim(),this.$=me;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:o,36:s,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:C,56:k,57:E,58:_,59:P,60:L,61:R,62:D,63:M,64:I,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:q,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:o,36:s,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:C,56:k,57:E,58:_,59:P,60:L,61:R,62:D,63:M,64:I,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:q,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:o,36:s,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:C,56:k,57:E,58:_,59:P,60:L,61:R,62:D,63:M,64:I,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:q,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:o,36:s,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:C,56:k,57:E,58:_,59:P,60:L,61:R,62:D,63:M,64:I,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:q,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:o,36:s,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:C,56:k,57:E,58:_,59:P,60:L,61:R,62:D,63:M,64:I,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:q,74:Y},{14:[1,74]},t(ne,[2,13],{43:23,29:49,30:61,32:62,20:75,34:o,36:s,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:C,56:k,57:E,58:_,59:P,60:L,61:R,62:D,63:M,64:I,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:q,74:Y}),t(ne,[2,14]),t(X,[2,16],{12:[1,76]}),t(ne,[2,36],{12:[1,77]}),t(J,[2,19]),t(J,[2,20]),{25:[1,78]},{27:[1,79]},t(J,[2,23]),{35:80,75:81,76:ee,77:te,79:pe,80:ie},{35:86,75:81,76:ee,77:te,79:pe,80:ie},{35:87,75:81,76:ee,77:te,79:pe,80:ie},{35:88,75:81,76:ee,77:te,79:pe,80:ie},{35:89,75:81,76:ee,77:te,79:pe,80:ie},{35:90,75:81,76:ee,77:te,79:pe,80:ie},{35:91,75:81,76:ee,77:te,79:pe,80:ie},{35:92,75:81,76:ee,77:te,79:pe,80:ie},{35:93,75:81,76:ee,77:te,79:pe,80:ie},{35:94,75:81,76:ee,77:te,79:pe,80:ie},{35:95,75:81,76:ee,77:te,79:pe,80:ie},{35:96,75:81,76:ee,77:te,79:pe,80:ie},{35:97,75:81,76:ee,77:te,79:pe,80:ie},{35:98,75:81,76:ee,77:te,79:pe,80:ie},{35:99,75:81,76:ee,77:te,79:pe,80:ie},{35:100,75:81,76:ee,77:te,79:pe,80:ie},{35:101,75:81,76:ee,77:te,79:pe,80:ie},{35:102,75:81,76:ee,77:te,79:pe,80:ie},{35:103,75:81,76:ee,77:te,79:pe,80:ie},{35:104,75:81,76:ee,77:te,79:pe,80:ie},t(Ce,[2,59]),{35:105,75:81,76:ee,77:te,79:pe,80:ie},{35:106,75:81,76:ee,77:te,79:pe,80:ie},{35:107,75:81,76:ee,77:te,79:pe,80:ie},{35:108,75:81,76:ee,77:te,79:pe,80:ie},{35:109,75:81,76:ee,77:te,79:pe,80:ie},{35:110,75:81,76:ee,77:te,79:pe,80:ie},{35:111,75:81,76:ee,77:te,79:pe,80:ie},{35:112,75:81,76:ee,77:te,79:pe,80:ie},{35:113,75:81,76:ee,77:te,79:pe,80:ie},{35:114,75:81,76:ee,77:te,79:pe,80:ie},{35:115,75:81,76:ee,77:te,79:pe,80:ie},{20:116,29:49,30:61,32:62,34:o,36:s,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:C,56:k,57:E,58:_,59:P,60:L,61:R,62:D,63:M,64:I,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:q,74:Y},{12:[1,118],33:[1,117]},{35:119,75:81,76:ee,77:te,79:pe,80:ie},{35:120,75:81,76:ee,77:te,79:pe,80:ie},{35:121,75:81,76:ee,77:te,79:pe,80:ie},{35:122,75:81,76:ee,77:te,79:pe,80:ie},{35:123,75:81,76:ee,77:te,79:pe,80:ie},{35:124,75:81,76:ee,77:te,79:pe,80:ie},{35:125,75:81,76:ee,77:te,79:pe,80:ie},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(ne,[2,15]),t(X,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(ne,[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:o,36:s,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:C,56:k,57:E,58:_,59:P,60:L,61:R,62:D,63:M,64:I,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:q,74:Y}),t(J,[2,21]),t(J,[2,22]),t(Ce,[2,39]),t(ke,[2,71],{75:81,35:132,76:ee,77:te,79:pe,80:ie}),t(Ee,[2,73]),{78:[1,133]},t(Ee,[2,75]),t(Ee,[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(ue,[2,28]),t(ue,[2,29]),t(ue,[2,30]),t(ue,[2,31]),t(ue,[2,32]),t(ue,[2,33]),t(ue,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(X,[2,18]),t(ne,[2,38]),t(ke,[2,72]),t(Ee,[2,74]),t(Ce,[2,24]),t(Ce,[2,35]),t(de,[2,25]),t(de,[2,26],{12:[1,138]}),t(de,[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:O(function(Oe,Be){if(Be.recoverable)this.trace(Oe);else{var Z=new Error(Oe);throw Z.hash=Be,Z}},"parseError"),parse:O(function(Oe){var Be=this,Z=[0],le=[],be=[null],ae=[],K=this.table,se="",me=0,oe=0,ve=2,ce=1,De=ae.slice.call(arguments,1),Le=Object.create(this.lexer),We={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(We.yy[Ne]=this.yy[Ne]);Le.setInput(Oe,We.yy),We.yy.lexer=Le,We.yy.parser=this,typeof Le.yylloc>"u"&&(Le.yylloc={});var je=Le.yylloc;ae.push(je);var $e=Le.options&&Le.options.ranges;typeof We.yy.parseError=="function"?this.parseError=We.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ze(Te){Z.length=Z.length-2*Te,be.length=be.length-Te,ae.length=ae.length-Te}O(Ze,"popStack");function He(){var Te;return Te=le.pop()||Le.lex()||ce,typeof Te!="number"&&(Te instanceof Array&&(le=Te,Te=le.pop()),Te=Be.symbols_[Te]||Te),Te}O(He,"lex");for(var et,Pe,yt,Ie,St={},kt,ut,Gt,It;;){if(Pe=Z[Z.length-1],this.defaultActions[Pe]?yt=this.defaultActions[Pe]:((et===null||typeof et>"u")&&(et=He()),yt=K[Pe]&&K[Pe][et]),typeof yt>"u"||!yt.length||!yt[0]){var gt="";It=[];for(kt in K[Pe])this.terminals_[kt]&&kt>ve&&It.push("'"+this.terminals_[kt]+"'");Le.showPosition?gt="Parse error on line "+(me+1)+`: + `),s=u$n(n,i,o);s.aPosition=n.getAttribLocation(s,"aPosition"),s.aIndex=n.getAttribLocation(s,"aIndex"),s.aVertType=n.getAttribLocation(s,"aVertType"),s.aTransform=n.getAttribLocation(s,"aTransform"),s.aAtlasId=n.getAttribLocation(s,"aAtlasId"),s.aTex=n.getAttribLocation(s,"aTex"),s.aPointAPointB=n.getAttribLocation(s,"aPointAPointB"),s.aPointCPointD=n.getAttribLocation(s,"aPointCPointD"),s.aLineWidth=n.getAttribLocation(s,"aLineWidth"),s.aColor=n.getAttribLocation(s,"aColor"),s.aCornerRadius=n.getAttribLocation(s,"aCornerRadius"),s.aBorderColor=n.getAttribLocation(s,"aBorderColor"),s.uPanZoomMatrix=n.getUniformLocation(s,"uPanZoomMatrix"),s.uAtlasSize=n.getUniformLocation(s,"uAtlasSize"),s.uBGColor=n.getUniformLocation(s,"uBGColor"),s.uZoom=n.getUniformLocation(s,"uZoom"),s.uTextures=[];for(var l=0;l1&&arguments[1]!==void 0?arguments[1]:y9.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,o=this.batchManager,s=a.getRenderTypeOpts(i);if(this._isVisible(r,s)&&!(r.isEdge()&&!this._isValidEdge(r))){if(this.renderTarget.picking&&s.getTexPickingMode){var l=s.getTexPickingMode(r);if(l===mte.IGNORE)return;if(l==mte.USE_BB){this.drawPickingRectangle(r,n,i);return}}var u=a.getAtlasInfo(r,i),h=rd(u),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,p=f.atlas,g=f.tex1,m=f.tex2;o.canAddToCurrentBatch(p)||this.endBatch();for(var v=o.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 o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=0;if(i.shapeProps&&i.shapeProps.padding&&(s=r.pstyle(i.shapeProps.padding).pfValue),a){var l=a.bb,u=a.tex1,h=a.tex2,d=u.w/(u.w+h.w);o||(d=1-d);var f=this._getAdjustedBB(l,s,o,d);this._applyTransformMatrix(n,f,i,r)}else{var p=i.getBoundingBox(r),g=this._getAdjustedBB(p,s,!0,1);this._applyTransformMatrix(n,g,i,r)}}},{key:"_applyTransformMatrix",value:function(r,n,i,a){var o,s;szt(r);var l=i.getRotation?i.getRotation(a):0;if(l!==0){var u=i.getRotationPoint(a),h=u.x,d=u.y;gte(r,r,[h,d]),lzt(r,r,l);var f=i.getRotationOffset(a);o=f.x+(n.xOffset||0),s=f.y+(n.yOffset||0)}else o=n.x1,s=n.y1;gte(r,r,[o,s]),BEe(r,r,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(r,n,i,a){var o=r.x1,s=r.y1,l=r.w,u=r.h,h=r.yOffset;n&&(o-=n,s-=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,o+=d,l=f),{x1:o,y1:s,w:l,h:u,xOffset:d,yOffset:h}}},{key:"drawPickingRectangle",value:function(r,n,i){var a=this.atlasManager.getRenderTypeOpts(i),o=this.instanceCount;this.vertTypeBuffer.getView(o)[0]=p3;var s=this.indexBuffer.getView(o);f3(n,s);var l=this.colorBuffer.getView(o);tO([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(o);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 o=a.shapeProps,s=this._getVertTypeForShape(r,o.shape);if(s===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]=s,s===vte||s===b9){var u=a.getBoundingBox(r),h=this._getCornerRadius(r,o.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=h,d[1]=h,d[2]=h,d[3]=h,s===b9&&(d[0]=0,d[2]=0)}var f=this.indexBuffer.getView(l);f3(n,f);var p=this.renderTarget.picking?1:i==="node-body"?r.effectiveOpacity():1,g=this.renderTarget.picking?1:r.pstyle(o.opacity).value*p,m=r.pstyle(o.color).value,v=this.colorBuffer.getView(l);tO(m,g,v);var y=this.lineWidthBuffer.getView(l);if(y[0]=0,y[1]=0,o.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);tO(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 C=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(r,C,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 p3;case"ellipse":return x9;case"roundrectangle":case"round-rectangle":return vte;case"bottom-round-rectangle":return b9;default:return}}},{key:"_getCornerRadius",value:function(r,n,i){var a=i.w,o=i.h;if(r.pstyle(n).value==="auto")return sw(a,o);var s=r.pstyle(n).pfValue,l=a/2,u=o/2;return Math.min(s,u,l)}},{key:"drawEdgeArrow",value:function(r,n,i){if(r.visible()){var a=r._private.rscratch,o,s,l;if(i==="source"?(o=a.arrowStartX,s=a.arrowStartY,l=a.srcArrowAngle):(o=a.arrowEndX,s=a.arrowEndY,l=a.tgtArrowAngle),!(isNaN(o)||o==null||isNaN(s)||s==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);szt(b),gte(b,b,[o,s]),BEe(b,b,[v,v]),lzt(b,b,l),this.vertTypeBuffer.getView(y)[0]=FEe;var x=this.indexBuffer.getView(y);f3(n,x);var w=this.colorBuffer.getView(y);tO(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,o=r.pstyle("line-opacity").value,s=r.pstyle("width").pfValue,l=r.pstyle("line-color").value,u=a*o;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),i.length==4){var h=this.instanceCount;this.vertTypeBuffer.getView(h)[0]=czt;var d=this.indexBuffer.getView(h);f3(n,d);var f=this.colorBuffer.getView(h);tO(l,u,f);var p=this.lineWidthBuffer.getView(h);p[0]=s;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 o=a/n;this._setCurvePoint(r,o,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 o=Array(r.length-2),s=0;s0}},s=function(d){var f=d.pstyle("text-events").strValue==="yes";return f?mte.USE_BB:mte.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:p$n,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),r.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:o("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:o("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:s,getKey:zEe(e.getLabelKey,null),getBoundingBox:UEe(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:s,getKey:zEe(e.getSourceLabelKey,"source"),getBoundingBox:UEe(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:s,getKey:zEe(e.getTargetLabelKey,"target"),getBoundingBox:UEe(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:a("target-label")});var u=WF(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()}),P$n(r)};function I$n(t){var e=t.cy.container(),r=e&&e.style&&e.style.backgroundColor||"white";return p7t(r)}function dzt(t,e){var r=t._private.rscratch;return eh(r,"labelWrapCachedLines",e)||[]}var zEe=function(e,r){return function(n){var i=e(n),a=dzt(n,r);return a.length>1?a.map(function(o,s){return"".concat(i,"_").concat(s)}):i}},UEe=function(e,r){return function(n,i){var a=e(n);if(typeof i=="string"){var o=i.indexOf("_");if(o>0){var s=Number(i.substring(o+1)),l=dzt(n,r),u=a.h/l.length,h=u*s,d=a.y1+h;return{x1:a.x1,w:a.w,y1:d,h:u,yOffset:h}}}return a}};function P$n(t){{var e=t.render;t.render=function(a){a=a||{};var o=t.cy;t.webgl&&(o.zoom()>W9t?(N$n(t),e.call(t,a)):(B$n(t),pzt(t,a,y9.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,o,s,l){return Q$n(t,a,o)};{var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var i=t.notify;t.notify=function(a,o){i.call(t,a,o),a==="viewport"||a==="bounds"?t.pickingFrameBuffer.needsDraw=!0:a==="background"&&t.drawing.invalidate(o,{type:"node-body"})}}}function N$n(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function B$n(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 $$n(t){var e=t.canvasWidth,r=t.canvasHeight,n=PEe(t),i=n.pan,a=n.zoom,o=NEe();gte(o,o,[i.x,i.y]),BEe(o,o,[a,a]);var s=NEe();S$n(s,e,r);var l=NEe();return A$n(l,s,o),l}function fzt(t,e){var r=t.canvasWidth,n=t.canvasHeight,i=PEe(t),a=i.pan,o=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(a.x,a.y),e.scale(o,o)}function F$n(t,e){t.drawSelectionRectangle(e,function(r){return fzt(t,r)})}function z$n(t){var e=t.data.contexts[t.NODE];e.save(),fzt(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 U$n(t){var e=function(i,a,o){for(var s=i.atlasManager.getAtlasCollection(a),l=t.data.contexts[t.NODE],u=s.atlases,h=0;h=0&&w.add(T)}return w}function Q$n(t,e,r){var n=V$n(t,e,r),i=t.getCachedZSortedEles(),a,o,s=rd(n),l;try{for(s.s();!(l=s.n()).done;){var u=l.value,h=i[u];if(!a&&h.isNode()&&(a=h),!o&&h.isEdge()&&(o=h),a&&o)break}}catch(d){s.e(d)}finally{s.f()}return[a,o].filter(Boolean)}function VEe(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 pzt(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]&&F$n(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var o=t.data.contexts[t.WEBGL];r.screen?(o.clearColor(0,0,0,0),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA)):o.disable(o.BLEND),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.viewport(0,0,o.canvas.width,o.canvas.height);var s=$$n(t),l=t.getCachedZSortedEles();if(a=l.length,i.startFrame(s,r),r.screen){for(var u=0;u0&&o>0){p.clearRect(0,0,a,o),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,o),p.fill())}return f};function G$n(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a"u"?"undefined":dl(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},[K9t,ev,j1,IEe,eO,mw,nh,hzt,vw,w9,xzt].forEach(function(t){ln(ni,t)});var Y$n=[{name:"null",impl:S9t},{name:"base",impl:Q9t},{name:"canvas",impl:H$n}],q$n=[{type:"layout",extensions:v7n},{type:"renderer",extensions:Y$n}],Azt={},Szt={};function Tzt(t,e,r){var n=r,i=function(C){aa("Can not register `"+e+"` for `"+t+"` since `"+C+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(h9.prototype[e])return i(e);h9.prototype[e]=r}else if(t==="collection"){if(Oc.prototype[e])return i(e);Oc.prototype[e]=r}else if(t==="layout"){for(var a=function(C){this.options=C,r.call(this,C),Bi(this._private)||(this._private={}),this._private.cy=C.cy,this._private.listeners=[],this.createEmitter()},o=a.prototype=Object.create(r.prototype),s=[],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==o.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(o,s){o==null&&s==null?(this.x=0,this.y=0):(this.x=o,this.y=s)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(o){this.x=o},a.prototype.setY=function(o){this.y=o},a.prototype.getDifference=function(o){return new DimensionD(this.x-o.x,this.y-o.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(o){return this.x+=o.width,this.y+=o.height,this},r.exports=a},function(r,n,i){var a=i(2),o=i(10),s=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=o.MIN_VALUE,this.margin=s.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&&C>-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(C,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=o.MAX_VALUE,y=o.MAX_VALUE,b,x,w,A=this.getNodes(),S=A.length,T=0;Tb&&(v=b),y>x&&(y=x)}return v==o.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=o.MAX_VALUE,b=-o.MAX_VALUE,x=o.MAX_VALUE,w=-o.MAX_VALUE,A,S,T,C,k,E=this.nodes,_=E.length,P=0;P<_;P++){var L=E[P];v&&L.child!=null&&L.updateBounds(),A=L.getLeft(),S=L.getRight(),T=L.getTop(),C=L.getBottom(),y>A&&(y=A),bT&&(x=T),wA&&(y=A),bT&&(x=T),w=this.nodes.length){var _=0;b.forEach(function(P){P.owner==v&&_++}),_==this.nodes.length&&(this.isConnected=!0)}},r.exports=g},function(r,n,i){var a,o=i(1);function s(l){a=i(5),this.layout=l,this.graphs=[],this.edges=[]}s.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},s.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}},s.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()-s.getX(),s.getRight()-l.getRight()):l.getX()<=s.getX()&&l.getRight()>=s.getRight()&&(u[0]+=Math.min(s.getX()-l.getX(),l.getRight()-s.getRight())),s.getY()<=l.getY()&&s.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-s.getY(),s.getBottom()-l.getBottom()):l.getY()<=s.getY()&&l.getBottom()>=s.getBottom()&&(u[1]+=Math.min(s.getY()-l.getY(),l.getBottom()-s.getBottom()));var f=Math.abs((l.getCenterY()-s.getCenterY())/(l.getCenterX()-s.getCenterX()));l.getCenterY()===s.getCenterY()&&l.getCenterX()===s.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]=C,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)),-I===N?f>h?(u[2]=k,u[3]=E,D=!0):(u[2]=C,u[3]=T,D=!0):I===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(I,N,2)):(F=this.getCardinalDirection(-M,N,3),B=this.getCardinalDirection(-I,N,1)):d>p?(F=this.getCardinalDirection(-M,N,1),B=this.getCardinalDirection(-I,N,3)):(F=this.getCardinalDirection(M,N,2),B=this.getCardinalDirection(I,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+P*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+-P*N,u[2]=U,u[3]=Q;break}}return!1},o.getCardinalDirection=function(s,l,u){return s>l?u:1+u%4},o.getIntersection=function(s,l,u,h){if(h==null)return this.getIntersection2(s,l,u);var d=s.x,f=s.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,C=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,C=m-y,E=y*v-m*b,_=A*C-S*T,_===0?null:(x=(T*E-C*k)/_,w=(S*k-A*E)/_,new a(x,w))},o.angleOfVector=function(s,l,u,h){var d=void 0;return s!==u?(d=Math.atan((h-l)/(u-s)),u0?1:o<0?-1:0},a.floor=function(o){return o<0?Math.ceil(o):Math.floor(o)},a.ceil=function(o){return o<0?Math.floor(o):Math.ceil(o)},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(s);return s==null||l!="object"&&l!="function"},r.exports=o},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 C=A[0];A.splice(0,1),w.add(C);for(var k=C.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&&C.push(R),b.set(R,M)}})}y=y.concat(C),(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 o(s,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}o.prototype.getWorldOrgX=function(){return this.lworldOrgX},o.prototype.setWorldOrgX=function(s){this.lworldOrgX=s},o.prototype.getWorldOrgY=function(){return this.lworldOrgY},o.prototype.setWorldOrgY=function(s){this.lworldOrgY=s},o.prototype.getWorldExtX=function(){return this.lworldExtX},o.prototype.setWorldExtX=function(s){this.lworldExtX=s},o.prototype.getWorldExtY=function(){return this.lworldExtY},o.prototype.setWorldExtY=function(s){this.lworldExtY=s},o.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},o.prototype.setDeviceOrgX=function(s){this.ldeviceOrgX=s},o.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},o.prototype.setDeviceOrgY=function(s){this.ldeviceOrgY=s},o.prototype.getDeviceExtX=function(){return this.ldeviceExtX},o.prototype.setDeviceExtX=function(s){this.ldeviceExtX=s},o.prototype.getDeviceExtY=function(){return this.ldeviceExtY},o.prototype.setDeviceExtY=function(s){this.ldeviceExtY=s},o.prototype.transformX=function(s){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(s-this.lworldOrgX)*this.ldeviceExtX/u),l},o.prototype.transformY=function(s){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(s-this.lworldOrgY)*this.ldeviceExtY/u),l},o.prototype.inverseTransformX=function(s){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(s-this.ldeviceOrgX)*this.lworldExtX/u),l},o.prototype.inverseTransformY=function(s){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(s-this.ldeviceOrgY)*this.lworldExtY/u),l},o.prototype.inverseTransformPoint=function(s){var l=new a(this.inverseTransformX(s.x),this.inverseTransformY(s.y));return l},r.exports=o},function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);gs.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*s.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-s.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>s.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(s.COOLING_ADAPTATION_FACTOR,1-(p-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*(1-s.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=s.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%s.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;o(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===s&&h.callback===l&&this.listeners.splice(u,1)}},o.emit=function(s,l){for(var u=0;uh.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*s.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*s.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 C=new Set(this.getAllNodes()),k=this.nodesWithGravity.filter(function(E){return C.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()),C=this.nodesWithGravity.filter(function(_){return T.has(_)});this.graphManager.setAllNodesToApplyGravitation(C),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(),C={},k=0;k1){var R;for(R=0;RE&&(E=Math.floor(L.y)),P=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,C,k){var E=Math.max(this.maxDiagonalInTree(T),d.DEFAULT_RADIAL_SEPARATION);A.branchRadialLayout(C,null,0,359,0,E);var _=x.calculateBounds(T),P=new w;P.setDeviceOrgX(_.getMinX()),P.setDeviceOrgY(_.getMinY()),P.setWorldOrgX(k.x),P.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--}C!=null?z=(N.indexOf(U[0])+1)%V:z=0;for(var q=Math.abs(E-k)/F,Y=z;B!=F;Y=++Y%V){var ne=N[Y].getOtherEnd(T);if(ne!=C){var X=(k+B*q)%360,J=(X+q)%360;A.branchRadialLayout(ne,T,X,J,_+P,P),B++}}},A.maxDiagonalInTree=function(T){for(var C=y.MIN_VALUE,k=0;kC&&(C=_)}return C},A.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},A.prototype.groupZeroDegreeMembers=function(){var T=this,C={};this.memberGroups={},this.idToDummyNode={};for(var k=[],E=this.graphManager.getAllNodes(),_=0;_"u"&&(C[R]=[]),C[R]=C[R].concat(P)}Object.keys(C).forEach(function(D){if(C[D].length>1){var M="DummyCompound_"+D;T.memberGroups[M]=C[D];var I=C[D][0].getParent(),N=new u(T.graphManager);N.id=M,N.paddingLeft=I.paddingLeft||0,N.paddingRight=I.paddingRight||0,N.paddingBottom=I.paddingBottom||0,N.paddingTop=I.paddingTop||0,T.idToDummyNode[M]=N;var F=T.getGraphManager().add(T.newGraph(),N),B=I.getChild();B.add(N);for(var V=0;V=0;T--){var C=this.compoundOrder[T],k=C.id,E=C.paddingLeft,_=C.paddingTop;this.adjustLocations(this.tiledMemberPack[k],C.rect.x,C.rect.y,E,_)}},A.prototype.repopulateZeroDegreeMembers=function(){var T=this,C=this.tiledZeroDegreePack;Object.keys(C).forEach(function(k){var E=T.idToDummyNode[k],_=E.paddingLeft,P=E.paddingTop;T.adjustLocations(C[k],E.rect.x,E.rect.y,_,P)})},A.prototype.getToBeTiled=function(T){var C=T.id;if(this.toBeTiled[C]!=null)return this.toBeTiled[C];var k=T.getChild();if(k==null)return this.toBeTiled[C]=!1,!1;for(var E=k.getNodes(),_=0;_0)return this.toBeTiled[C]=!1,!1;if(P.getChild()==null){this.toBeTiled[P.id]=!1;continue}if(!this.getToBeTiled(P))return this.toBeTiled[C]=!1,!1}return this.toBeTiled[C]=!0,!0},A.prototype.getNodeDegree=function(T){T.id;for(var C=T.getEdges(),k=0,E=0;ED&&(D=I.rect.height)}k+=D+T.verticalPadding}},A.prototype.tileCompoundMembers=function(T,C){var k=this;this.tiledMemberPack=[],Object.keys(T).forEach(function(E){var _=C[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,C){var k=d.TILING_PADDING_VERTICAL,E=d.TILING_PADDING_HORIZONTAL,_={rows:[],rowWidth:[],rowHeight:[],width:0,height:C,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(C)},A.prototype.getShortestRowIndex=function(T){for(var C=-1,k=Number.MAX_VALUE,E=0;Ek&&(C=E,k=T.rowWidth[E]);return C},A.prototype.canAddHorizontal=function(T,C,k){var E=this.getShortestRowIndex(T);if(E<0)return!0;var _=T.rowWidth[E];if(_+T.horizontalPadding+C<=T.width)return!0;var P=0;T.rowHeight[E]0&&(P=k+T.verticalPadding-T.rowHeight[E]);var L;T.width-_>=C+T.horizontalPadding?L=(T.height+P)/(_+C+T.horizontalPadding):L=(T.height+P)/T.width,P=k+T.verticalPadding;var R;return T.widthP&&C!=k){E.splice(-1,1),T.rows[k].push(_),T.rowWidth[C]=T.rowWidth[C]-P,T.rowWidth[k]=T.rowWidth[k]+P,T.width=T.rowWidth[instance.getLongestRowIndex(T)];for(var L=Number.MIN_VALUE,R=0;RL&&(L=E[R].height);C>0&&(L+=T.verticalPadding);var D=T.rowHeight[C]+T.rowHeight[k];T.rowHeight[C]=L,T.rowHeight[k]<_.height+T.verticalPadding&&(T.rowHeight[k]=_.height+T.verticalPadding);var M=T.rowHeight[C]+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=[],C=!0,k;C;){var E=this.graphManager.getAllNodes(),_=[];C=!1;for(var P=0;P0)for(var B=_;B<=P;B++)F[0]+=this.grid[B][L-1].length+this.grid[B][L].length-1;if(P0)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,C,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}])})})(Ozt);var eFn=Ozt.exports;const tFn=wh(eFn);rv.use(tFn);function _zt(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}})})}O(_zt,"addNodes");function Rzt(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})})}O(Rzt,"addEdges");function Dzt(t){return new Promise(e=>{const r=_t("body").append("div").attr("id","cy").attr("style","display:none"),n=rv({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});r.remove(),_zt(t.nodes,n),Rzt(t.edges,n),n.nodes().forEach(function(a){a.layoutDimensions=()=>{const o=a.data();return{w:o.width,h:o.height}}});const i={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(i).run(),n.ready(a=>{ye.info("Cytoscape ready",a),e(n)})})}O(Dzt,"createCytoscapeInstance");function Lzt(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})}O(Lzt,"extractPositionedNodes");function Mzt(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})}O(Mzt,"extractPositionedEdges");async function Izt(t,e){ye.debug("Starting cose-bilkent layout algorithm");try{Pzt(t);const r=await Dzt(t),n=Lzt(r),i=Mzt(r);return ye.debug(`Layout completed: ${n.length} nodes, ${i.length} edges`),{nodes:n,edges:i}}catch(r){throw ye.error("Error in cose-bilkent layout algorithm:",r),r}}O(Izt,"executeCoseBilkentLayout");function Pzt(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}O(Pzt,"validateLayoutData");var rFn=O(async(t,e,{insertCluster:r,insertEdge:n,insertEdgeLabel:i,insertMarkers:a,insertNode:o,log:s,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");s.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 o(v,x,{config:t.config,dir:t.direction||"TB"}),S=A.node().getBBox();w.width=S.width,w.height=S.height,w.domId=A,s.debug(`Node ${x.id} dimensions: ${S.width}x${S.height}`)}})),s.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 Izt(y,t.config);s.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,s.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}])}),s.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){s.debug("APA01 positionedEdge",S);const T={...x},C=n(g,T,d,t.type,w,A,t.diagramId);l(T,C)}else{const T={...x,points:[{x:w.x||0,y:w.y||0},{x:A.x||0,y:A.y||0}]},C=n(g,T,d,t.type,w,A,t.diagramId);l(T,C)}}})),s.debug("Cose-bilkent rendering completed")},"render"),nFn=rFn;const iFn=Object.freeze(Object.defineProperty({__proto__:null,render:nFn},Symbol.toStringTag,{value:"Module"}));var bte=O((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"),Nzt=O((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"};bte(t,r).lower()},"drawBackgroundRect"),aFn=O((t,e)=>{const r=e.text.replace(nR," "),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"),qEe=O((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=ZT(n);i.attr("xlink:href",a)},"drawImage"),jEe=O((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=ZT(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),gf=O(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),XEe=O(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),KEe=O(()=>{let t=_t(".mermaidTooltip");return t.empty()&&(t=_t("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"),xte=function(){var t=O(function(we,Oe,Be,Z){for(Be=Be||{},Z=we.length;Z--;Be[we[Z]]=Oe);return Be},"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],o=[1,63],s=[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],C=[1,40],k=[1,41],E=[1,42],_=[1,43],P=[1,44],L=[1,45],R=[1,46],D=[1,47],M=[1,48],I=[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],q=[1,59],Y=[1,60],ne=[14,42],X=[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],J=[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],te=[1,83],pe=[1,84],ie=[1,85],Ce=[12,14,42],ke=[12,14,33,42],Ee=[12,14,33,42,76,77,79,80],ue=[12,33],de=[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],xe={trace:O(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:O(function(Oe,Be,Z,le,be,ae,K){var se=ae.length-1;switch(be){case 3:le.setDirection("TB");break;case 4:le.setDirection("BT");break;case 5:le.setDirection("RL");break;case 6:le.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:le.setC4Type(ae[se-3]);break;case 19:le.setTitle(ae[se].substring(6)),this.$=ae[se].substring(6);break;case 20:le.setAccDescription(ae[se].substring(15)),this.$=ae[se].substring(15);break;case 21:this.$=ae[se].trim(),le.setTitle(this.$);break;case 22:case 23:this.$=ae[se].trim(),le.setAccDescription(this.$);break;case 28:ae[se].splice(2,0,"ENTERPRISE"),le.addPersonOrSystemBoundary(...ae[se]),this.$=ae[se];break;case 29:ae[se].splice(2,0,"SYSTEM"),le.addPersonOrSystemBoundary(...ae[se]),this.$=ae[se];break;case 30:le.addPersonOrSystemBoundary(...ae[se]),this.$=ae[se];break;case 31:ae[se].splice(2,0,"CONTAINER"),le.addContainerBoundary(...ae[se]),this.$=ae[se];break;case 32:le.addDeploymentNode("node",...ae[se]),this.$=ae[se];break;case 33:le.addDeploymentNode("nodeL",...ae[se]),this.$=ae[se];break;case 34:le.addDeploymentNode("nodeR",...ae[se]),this.$=ae[se];break;case 35:le.popBoundaryParseStack();break;case 39:le.addPersonOrSystem("person",...ae[se]),this.$=ae[se];break;case 40:le.addPersonOrSystem("external_person",...ae[se]),this.$=ae[se];break;case 41:le.addPersonOrSystem("system",...ae[se]),this.$=ae[se];break;case 42:le.addPersonOrSystem("system_db",...ae[se]),this.$=ae[se];break;case 43:le.addPersonOrSystem("system_queue",...ae[se]),this.$=ae[se];break;case 44:le.addPersonOrSystem("external_system",...ae[se]),this.$=ae[se];break;case 45:le.addPersonOrSystem("external_system_db",...ae[se]),this.$=ae[se];break;case 46:le.addPersonOrSystem("external_system_queue",...ae[se]),this.$=ae[se];break;case 47:le.addContainer("container",...ae[se]),this.$=ae[se];break;case 48:le.addContainer("container_db",...ae[se]),this.$=ae[se];break;case 49:le.addContainer("container_queue",...ae[se]),this.$=ae[se];break;case 50:le.addContainer("external_container",...ae[se]),this.$=ae[se];break;case 51:le.addContainer("external_container_db",...ae[se]),this.$=ae[se];break;case 52:le.addContainer("external_container_queue",...ae[se]),this.$=ae[se];break;case 53:le.addComponent("component",...ae[se]),this.$=ae[se];break;case 54:le.addComponent("component_db",...ae[se]),this.$=ae[se];break;case 55:le.addComponent("component_queue",...ae[se]),this.$=ae[se];break;case 56:le.addComponent("external_component",...ae[se]),this.$=ae[se];break;case 57:le.addComponent("external_component_db",...ae[se]),this.$=ae[se];break;case 58:le.addComponent("external_component_queue",...ae[se]),this.$=ae[se];break;case 60:le.addRel("rel",...ae[se]),this.$=ae[se];break;case 61:le.addRel("birel",...ae[se]),this.$=ae[se];break;case 62:le.addRel("rel_u",...ae[se]),this.$=ae[se];break;case 63:le.addRel("rel_d",...ae[se]),this.$=ae[se];break;case 64:le.addRel("rel_l",...ae[se]),this.$=ae[se];break;case 65:le.addRel("rel_r",...ae[se]),this.$=ae[se];break;case 66:le.addRel("rel_b",...ae[se]),this.$=ae[se];break;case 67:ae[se].splice(0,1),le.addRel("rel",...ae[se]),this.$=ae[se];break;case 68:le.updateElStyle("update_el_style",...ae[se]),this.$=ae[se];break;case 69:le.updateRelStyle("update_rel_style",...ae[se]),this.$=ae[se];break;case 70:le.updateLayoutConfig("update_layout_config",...ae[se]),this.$=ae[se];break;case 71:this.$=[ae[se]];break;case 72:ae[se].unshift(ae[se-1]),this.$=ae[se];break;case 73:case 75:this.$=ae[se].trim();break;case 74:let me={};me[ae[se-1].trim()]=ae[se].trim(),this.$=me;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:o,36:s,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:C,56:k,57:E,58:_,59:P,60:L,61:R,62:D,63:M,64:I,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:q,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:o,36:s,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:C,56:k,57:E,58:_,59:P,60:L,61:R,62:D,63:M,64:I,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:q,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:o,36:s,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:C,56:k,57:E,58:_,59:P,60:L,61:R,62:D,63:M,64:I,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:q,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:o,36:s,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:C,56:k,57:E,58:_,59:P,60:L,61:R,62:D,63:M,64:I,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:q,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:o,36:s,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:C,56:k,57:E,58:_,59:P,60:L,61:R,62:D,63:M,64:I,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:q,74:Y},{14:[1,74]},t(ne,[2,13],{43:23,29:49,30:61,32:62,20:75,34:o,36:s,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:C,56:k,57:E,58:_,59:P,60:L,61:R,62:D,63:M,64:I,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:q,74:Y}),t(ne,[2,14]),t(X,[2,16],{12:[1,76]}),t(ne,[2,36],{12:[1,77]}),t(J,[2,19]),t(J,[2,20]),{25:[1,78]},{27:[1,79]},t(J,[2,23]),{35:80,75:81,76:ee,77:te,79:pe,80:ie},{35:86,75:81,76:ee,77:te,79:pe,80:ie},{35:87,75:81,76:ee,77:te,79:pe,80:ie},{35:88,75:81,76:ee,77:te,79:pe,80:ie},{35:89,75:81,76:ee,77:te,79:pe,80:ie},{35:90,75:81,76:ee,77:te,79:pe,80:ie},{35:91,75:81,76:ee,77:te,79:pe,80:ie},{35:92,75:81,76:ee,77:te,79:pe,80:ie},{35:93,75:81,76:ee,77:te,79:pe,80:ie},{35:94,75:81,76:ee,77:te,79:pe,80:ie},{35:95,75:81,76:ee,77:te,79:pe,80:ie},{35:96,75:81,76:ee,77:te,79:pe,80:ie},{35:97,75:81,76:ee,77:te,79:pe,80:ie},{35:98,75:81,76:ee,77:te,79:pe,80:ie},{35:99,75:81,76:ee,77:te,79:pe,80:ie},{35:100,75:81,76:ee,77:te,79:pe,80:ie},{35:101,75:81,76:ee,77:te,79:pe,80:ie},{35:102,75:81,76:ee,77:te,79:pe,80:ie},{35:103,75:81,76:ee,77:te,79:pe,80:ie},{35:104,75:81,76:ee,77:te,79:pe,80:ie},t(Ce,[2,59]),{35:105,75:81,76:ee,77:te,79:pe,80:ie},{35:106,75:81,76:ee,77:te,79:pe,80:ie},{35:107,75:81,76:ee,77:te,79:pe,80:ie},{35:108,75:81,76:ee,77:te,79:pe,80:ie},{35:109,75:81,76:ee,77:te,79:pe,80:ie},{35:110,75:81,76:ee,77:te,79:pe,80:ie},{35:111,75:81,76:ee,77:te,79:pe,80:ie},{35:112,75:81,76:ee,77:te,79:pe,80:ie},{35:113,75:81,76:ee,77:te,79:pe,80:ie},{35:114,75:81,76:ee,77:te,79:pe,80:ie},{35:115,75:81,76:ee,77:te,79:pe,80:ie},{20:116,29:49,30:61,32:62,34:o,36:s,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:C,56:k,57:E,58:_,59:P,60:L,61:R,62:D,63:M,64:I,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:q,74:Y},{12:[1,118],33:[1,117]},{35:119,75:81,76:ee,77:te,79:pe,80:ie},{35:120,75:81,76:ee,77:te,79:pe,80:ie},{35:121,75:81,76:ee,77:te,79:pe,80:ie},{35:122,75:81,76:ee,77:te,79:pe,80:ie},{35:123,75:81,76:ee,77:te,79:pe,80:ie},{35:124,75:81,76:ee,77:te,79:pe,80:ie},{35:125,75:81,76:ee,77:te,79:pe,80:ie},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(ne,[2,15]),t(X,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(ne,[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:o,36:s,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:C,56:k,57:E,58:_,59:P,60:L,61:R,62:D,63:M,64:I,65:N,66:F,67:B,68:V,69:z,70:U,71:Q,72:G,73:q,74:Y}),t(J,[2,21]),t(J,[2,22]),t(Ce,[2,39]),t(ke,[2,71],{75:81,35:132,76:ee,77:te,79:pe,80:ie}),t(Ee,[2,73]),{78:[1,133]},t(Ee,[2,75]),t(Ee,[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(ue,[2,28]),t(ue,[2,29]),t(ue,[2,30]),t(ue,[2,31]),t(ue,[2,32]),t(ue,[2,33]),t(ue,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(X,[2,18]),t(ne,[2,38]),t(ke,[2,72]),t(Ee,[2,74]),t(Ce,[2,24]),t(Ce,[2,35]),t(de,[2,25]),t(de,[2,26],{12:[1,138]}),t(de,[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:O(function(Oe,Be){if(Be.recoverable)this.trace(Oe);else{var Z=new Error(Oe);throw Z.hash=Be,Z}},"parseError"),parse:O(function(Oe){var Be=this,Z=[0],le=[],be=[null],ae=[],K=this.table,se="",me=0,oe=0,ve=2,ce=1,De=ae.slice.call(arguments,1),Le=Object.create(this.lexer),We={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(We.yy[Ne]=this.yy[Ne]);Le.setInput(Oe,We.yy),We.yy.lexer=Le,We.yy.parser=this,typeof Le.yylloc>"u"&&(Le.yylloc={});var je=Le.yylloc;ae.push(je);var $e=Le.options&&Le.options.ranges;typeof We.yy.parseError=="function"?this.parseError=We.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ze(Te){Z.length=Z.length-2*Te,be.length=be.length-Te,ae.length=ae.length-Te}O(Ze,"popStack");function He(){var Te;return Te=le.pop()||Le.lex()||ce,typeof Te!="number"&&(Te instanceof Array&&(le=Te,Te=le.pop()),Te=Be.symbols_[Te]||Te),Te}O(He,"lex");for(var et,Pe,yt,Ie,St={},kt,ut,Gt,It;;){if(Pe=Z[Z.length-1],this.defaultActions[Pe]?yt=this.defaultActions[Pe]:((et===null||typeof et>"u")&&(et=He()),yt=K[Pe]&&K[Pe][et]),typeof yt>"u"||!yt.length||!yt[0]){var gt="";It=[];for(kt in K[Pe])this.terminals_[kt]&&kt>ve&&It.push("'"+this.terminals_[kt]+"'");Le.showPosition?gt="Parse error on line "+(me+1)+`: `+Le.showPosition()+` Expecting `+It.join(", ")+", got '"+(this.terminals_[et]||et)+"'":gt="Parse error on line "+(me+1)+": Unexpected "+(et==ce?"end of input":"'"+(this.terminals_[et]||et)+"'"),this.parseError(gt,{text:Le.match,token:this.terminals_[et]||et,line:Le.yylineno,loc:je,expected:It})}if(yt[0]instanceof Array&&yt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Pe+", token: "+et);switch(yt[0]){case 1:Z.push(et),be.push(Le.yytext),ae.push(Le.yylloc),Z.push(yt[1]),et=null,oe=Le.yyleng,se=Le.yytext,me=Le.yylineno,je=Le.yylloc;break;case 2:if(ut=this.productions_[yt[1]][1],St.$=be[be.length-ut],St._$={first_line:ae[ae.length-(ut||1)].first_line,last_line:ae[ae.length-1].last_line,first_column:ae[ae.length-(ut||1)].first_column,last_column:ae[ae.length-1].last_column},$e&&(St._$.range=[ae[ae.length-(ut||1)].range[0],ae[ae.length-1].range[1]]),Ie=this.performAction.apply(St,[se,oe,me,We.yy,yt[1],be,ae].concat(De)),typeof Ie<"u")return Ie;ut&&(Z=Z.slice(0,-1*ut*2),be=be.slice(0,-1*ut),ae=ae.slice(0,-1*ut)),Z.push(this.productions_[yt[1]][0]),be.push(St.$),ae.push(St._$),Gt=K[Z[Z.length-2]][Z[Z.length-1]],Z.push(Gt);break;case 3:return!0}}return!0},"parse")},ge=function(){var we={EOF:1,parseError:O(function(Be,Z){if(this.yy.parser)this.yy.parser.parseError(Be,Z);else throw new Error(Be)},"parseError"),setInput:O(function(Oe,Be){return this.yy=Be||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:O(function(){var Oe=this._input[0];this.yytext+=Oe,this.yyleng++,this.offset++,this.match+=Oe,this.matched+=Oe;var Be=Oe.match(/(?:\r\n?|\n).*/g);return Be?(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:O(function(Oe){var Be=Oe.length,Z=Oe.split(/(?:\r\n?|\n)/g);this._input=Oe+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Be),this.offset-=Be;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),Z.length-1&&(this.yylineno-=Z.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:Z?(Z.length===le.length?this.yylloc.first_column:0)+le[le.length-Z.length].length-Z[0].length:this.yylloc.first_column-Be},this.options.ranges&&(this.yylloc.range=[be[0],be[0]+this.yyleng-Be]),this.yyleng=this.yytext.length,this},"unput"),more:O(function(){return this._more=!0,this},"more"),reject:O(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:O(function(Oe){this.unput(this.match.slice(Oe))},"less"),pastInput:O(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:O(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:O(function(){var Oe=this.pastInput(),Be=new Array(Oe.length+1).join("-");return Oe+this.upcomingInput()+` `+Be+"^"},"showPosition"),test_match:O(function(Oe,Be){var Z,le,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))),le=Oe[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+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],Z=this.performAction.call(this,this.yy,this,Be,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Z)return Z;if(this._backtrack){for(var ae in be)this[ae]=be[ae];return!1}return!1},"test_match"),next:O(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Oe,Be,Z,le;this._more||(this.yytext="",this.match="");for(var be=this._currentRules(),ae=0;aeBe[0].length)){if(Be=Z,le=ae,this.options.backtrack_lexer){if(Oe=this.test_match(Z,be[ae]),Oe!==!1)return Oe;if(this._backtrack){Be=!1;continue}else return!1}else if(!this.options.flex)break}return Be?(Oe=this.test_match(Be,be[le]),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:O(function(){var Be=this.next();return Be||this.lex()},"lex"),begin:O(function(Be){this.conditionStack.push(Be)},"begin"),popState:O(function(){var Be=this.conditionStack.length-1;return Be>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(Be){return Be=this.conditionStack.length-1-Math.abs(Be||0),Be>=0?this.conditionStack[Be]:"INITIAL"},"topState"),pushState:O(function(Be){this.begin(Be)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:O(function(Be,Z,le,be){switch(le){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 we}();xe.lexer=ge;function ze(){this.yy={}}return O(ze,"Parser"),ze.prototype=xe,xe.Parser=ze,new ze}();xte.parser=xte;var iFn=xte,Gg=[],yw=[""],ih="global",Hg="",nv=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],A9=[],ZEe="",JEe=!1,wte=4,Ate=2,Pzt,aFn=O(function(){return Pzt},"getC4Type"),oFn=O(function(t){Pzt=li(t,Ye())},"setC4Type"),sFn=O(function(t,e,r,n,i,a,o,s,l){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let u={};const h=A9.find(d=>d.from===e&&d.to===r);if(h?u=h:A9.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 o=="object"){let[d,f]=Object.entries(o)[0];u[d]=f}else u.sprite=o;if(typeof s=="object"){let[d,f]=Object.entries(s)[0];u[d]=f}else u.tags=s;if(typeof l=="object"){let[d,f]=Object.entries(l)[0];u[d]=f}else u.link=l;u.wrap=bw()},"addRel"),lFn=O(function(t,e,r,n,i,a,o){if(e===null||r===null)return;let s={};const l=Gg.find(u=>u.alias===e);if(l&&e===l.alias?s=l:(s.alias=e,Gg.push(s)),r==null?s.label={text:""}:s.label={text:r},n==null)s.descr={text:""};else if(typeof n=="object"){let[u,h]=Object.entries(n)[0];s[u]={text:h}}else s.descr={text:n};if(typeof i=="object"){let[u,h]=Object.entries(i)[0];s[u]=h}else s.sprite=i;if(typeof a=="object"){let[u,h]=Object.entries(a)[0];s[u]=h}else s.tags=a;if(typeof o=="object"){let[u,h]=Object.entries(o)[0];s[u]=h}else s.link=o;s.typeC4Shape={text:t},s.parentBoundary=ih,s.wrap=bw()},"addPersonOrSystem"),cFn=O(function(t,e,r,n,i,a,o,s){if(e===null||r===null)return;let l={};const u=Gg.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Gg.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 o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.tags=o;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.link=s;l.wrap=bw(),l.typeC4Shape={text:t},l.parentBoundary=ih},"addContainer"),uFn=O(function(t,e,r,n,i,a,o,s){if(e===null||r===null)return;let l={};const u=Gg.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Gg.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 o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.tags=o;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.link=s;l.wrap=bw(),l.typeC4Shape={text:t},l.parentBoundary=ih},"addComponent"),hFn=O(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const o=nv.find(s=>s.alias===t);if(o&&t===o.alias?a=o:(a.alias=t,nv.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"system"};else if(typeof r=="object"){let[s,l]=Object.entries(r)[0];a[s]={text:l}}else a.type={text:r};if(typeof n=="object"){let[s,l]=Object.entries(n)[0];a[s]=l}else a.tags=n;if(typeof i=="object"){let[s,l]=Object.entries(i)[0];a[s]=l}else a.link=i;a.parentBoundary=ih,a.wrap=bw(),Hg=ih,ih=t,yw.push(Hg)},"addPersonOrSystemBoundary"),dFn=O(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const o=nv.find(s=>s.alias===t);if(o&&t===o.alias?a=o:(a.alias=t,nv.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"container"};else if(typeof r=="object"){let[s,l]=Object.entries(r)[0];a[s]={text:l}}else a.type={text:r};if(typeof n=="object"){let[s,l]=Object.entries(n)[0];a[s]=l}else a.tags=n;if(typeof i=="object"){let[s,l]=Object.entries(i)[0];a[s]=l}else a.link=i;a.parentBoundary=ih,a.wrap=bw(),Hg=ih,ih=t,yw.push(Hg)},"addContainerBoundary"),fFn=O(function(t,e,r,n,i,a,o,s){if(e===null||r===null)return;let l={};const u=nv.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,nv.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 o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.tags=o;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.link=s;l.nodeType=t,l.parentBoundary=ih,l.wrap=bw(),Hg=ih,ih=e,yw.push(Hg)},"addDeploymentNode"),pFn=O(function(){ih=Hg,yw.pop(),Hg=yw.pop(),yw.push(Hg)},"popBoundaryParseStack"),gFn=O(function(t,e,r,n,i,a,o,s,l,u,h){let d=Gg.find(f=>f.alias===e);if(!(d===void 0&&(d=nv.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(o!=null)if(typeof o=="object"){let[f,p]=Object.entries(o)[0];d[f]=p}else d.shape=o;if(s!=null)if(typeof s=="object"){let[f,p]=Object.entries(s)[0];d[f]=p}else d.sprite=s;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"),mFn=O(function(t,e,r,n,i,a,o){const s=A9.find(l=>l.from===e&&l.to===r);if(s!==void 0){if(n!=null)if(typeof n=="object"){let[l,u]=Object.entries(n)[0];s[l]=u}else s.textColor=n;if(i!=null)if(typeof i=="object"){let[l,u]=Object.entries(i)[0];s[l]=u}else s.lineColor=i;if(a!=null)if(typeof a=="object"){let[l,u]=Object.entries(a)[0];s[l]=parseInt(u)}else s.offsetX=parseInt(a);if(o!=null)if(typeof o=="object"){let[l,u]=Object.entries(o)[0];s[l]=parseInt(u)}else s.offsetY=parseInt(o)}},"updateRelStyle"),vFn=O(function(t,e,r){let n=wte,i=Ate;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&&(wte=n),i>=1&&(Ate=i)},"updateLayoutConfig"),yFn=O(function(){return wte},"getC4ShapeInRow"),bFn=O(function(){return Ate},"getC4BoundaryInRow"),xFn=O(function(){return ih},"getCurrentBoundaryParse"),wFn=O(function(){return Hg},"getParentBoundaryParse"),Nzt=O(function(t){return t==null?Gg:Gg.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),AFn=O(function(t){return Gg.find(e=>e.alias===t)},"getC4Shape"),SFn=O(function(t){return Object.keys(Nzt(t))},"getC4ShapeKeys"),Bzt=O(function(t){return t==null?nv:nv.filter(e=>e.parentBoundary===t)},"getBoundaries"),TFn=Bzt,CFn=O(function(){return A9},"getRels"),OFn=O(function(){return ZEe},"getTitle"),kFn=O(function(t){JEe=t},"setWrap"),bw=O(function(){return JEe},"autoWrap"),EFn=O(function(){Gg=[],nv=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Hg="",ih="global",yw=[""],A9=[],yw=[""],ZEe="",JEe=!1,wte=4,Ate=2},"clear"),_Fn={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},RFn={FILLED:0,OPEN:1},DFn={LEFTOF:0,RIGHTOF:1,OVER:2},LFn=O(function(t){ZEe=li(t,Ye())},"setTitle"),e_e={addPersonOrSystem:lFn,addPersonOrSystemBoundary:hFn,addContainer:cFn,addContainerBoundary:dFn,addComponent:uFn,addDeploymentNode:fFn,popBoundaryParseStack:pFn,addRel:sFn,updateElStyle:gFn,updateRelStyle:mFn,updateLayoutConfig:vFn,autoWrap:bw,setWrap:kFn,getC4ShapeArray:Nzt,getC4Shape:AFn,getC4ShapeKeys:SFn,getBoundaries:Bzt,getBoundarys:TFn,getCurrentBoundaryParse:xFn,getParentBoundaryParse:wFn,getRels:CFn,getTitle:OFn,getC4Type:aFn,getC4ShapeInRow:yFn,getC4BoundaryInRow:bFn,setAccTitle:Ba,getAccTitle:oo,getAccDescription:lo,setAccDescription:so,getConfig:O(()=>Ye().c4,"getConfig"),clear:EFn,LINETYPE:_Fn,ARROWTYPE:RFn,PLACEMENT:DFn,setTitle:LFn,setC4Type:oFn},t_e=O(function(t,e){return bte(t,e)},"drawRect"),$zt=O(function(t,e,r,n,i,a){const o=t.append("image");o.attr("width",e),o.attr("height",r),o.attr("x",n),o.attr("y",i);let s=a.startsWith("data:image/png;base64")?a:ZT(a);o.attr("xlink:href",s)},"drawImage"),MFn=O((t,e,r,n)=>{const i=t.append("g");let a=0;for(let o of e){let s=o.textColor?o.textColor:"#444444",l=o.lineColor?o.lineColor:"#444444",u=o.offsetX?parseInt(o.offsetX):0,h=o.offsetY?parseInt(o.offsetY):0,d="";if(a===0){let p=i.append("line");p.attr("x1",o.startPoint.x),p.attr("y1",o.startPoint.y),p.attr("x2",o.endPoint.x),p.attr("y2",o.endPoint.y),p.attr("stroke-width","1"),p.attr("stroke",l),p.style("fill","none"),o.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(o.type==="birel"||o.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",o.startPoint.x).replaceAll("starty",o.startPoint.y).replaceAll("controlx",o.startPoint.x+(o.endPoint.x-o.startPoint.x)/2-(o.endPoint.x-o.startPoint.x)/4).replaceAll("controly",o.startPoint.y+(o.endPoint.y-o.startPoint.y)/2).replaceAll("stopx",o.endPoint.x).replaceAll("stopy",o.endPoint.y)),o.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(o.type==="birel"||o.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)")}let f=r.messageFont();X1(r)(o.label.text,i,Math.min(o.startPoint.x,o.endPoint.x)+Math.abs(o.endPoint.x-o.startPoint.x)/2+u,Math.min(o.startPoint.y,o.endPoint.y)+Math.abs(o.endPoint.y-o.startPoint.y)/2+h,o.label.width,o.label.height,{fill:s},f),o.techn&&o.techn.text!==""&&(f=r.messageFont(),X1(r)("["+o.techn.text+"]",i,Math.min(o.startPoint.x,o.endPoint.x)+Math.abs(o.endPoint.x-o.startPoint.x)/2+u,Math.min(o.startPoint.y,o.endPoint.y)+Math.abs(o.endPoint.y-o.startPoint.y)/2+r.messageFontSize+5+h,Math.max(o.label.width,o.techn.width),o.techn.height,{fill:s,"font-style":"italic"},f))}},"drawRels"),IFn=O(function(t,e,r){const n=t.append("g");let i=e.bgColor?e.bgColor:"none",a=e.borderColor?e.borderColor:"#444444",o=e.fontColor?e.fontColor:"black",s={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(s={"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:s};t_e(n,l);let u=r.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=o,X1(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=o,X1(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=o,X1(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},u))},"drawBoundary"),PFn=O(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",o="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":o="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":o="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 s=t.append("g");s.attr("class","person-man");const l=gf();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},t_e(s,l);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":s.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)),s.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":s.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)),s.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=QFn(r,e.typeC4Shape.text);switch(s.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":$zt(s,48,48,e.x+e.width/2-24,e.y+e.image.Y,o);break}let h=r[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=a,X1(r)(e.label.text,s,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)!==""?X1(r)(e.techn.text,s,e.x,e.y+e.techn.Y,e.width,e.height,{fill:a,"font-style":"italic"},h):e.type&&e.type.text!==""&&X1(r)(e.type.text,s,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,X1(r)(e.descr.text,s,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},h)),e.height},"drawC4Shape"),NFn=O(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"),BFn=O(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"),$Fn=O(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"),FFn=O(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"),zFn=O(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"),UFn=O(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"),VFn=O(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"),QFn=O((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"getC4ShapeFont"),X1=function(){function t(i,a,o,s,l,u,h){const d=a.append("text").attr("x",o+l/2).attr("y",s+u/2+5).style("text-anchor","middle").text(i);n(d,h)}O(t,"byText");function e(i,a,o,s,l,u,h,d){const{fontSize:f,fontFamily:p,fontWeight:g}=d,m=i.split(Xt.lineBreakRegex);for(let v=0;v=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>Fzt)&&(r=this.nextData.startx+e.margin+Fr.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},n_e(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},O(tL,"Bounds"),tL),n_e=O(function(t){$s(Fr,t),t.fontFamily&&(Fr.personFontFamily=Fr.systemFontFamily=Fr.messageFontFamily=t.fontFamily),t.fontSize&&(Fr.personFontSize=Fr.systemFontSize=Fr.messageFontSize=t.fontSize),t.fontWeight&&(Fr.personFontWeight=Fr.systemFontWeight=Fr.messageFontWeight=t.fontWeight)},"setConf"),S9=O((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),Cte=O(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),GFn=O(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function Pp(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=Y7(e[t].text,i,n),e[t].textLines=e[t].text.split(Xt.lineBreakRegex).length,e[t].width=i,e[t].height=_X(e[t].text,n);else{let a=e[t].text.split(Xt.lineBreakRegex);e[t].textLines=a.length;let o=0;e[t].height=0,e[t].width=0;for(const s of a)e[t].width=Math.max(Uu(s,n),e[t].width),o=_X(s,n),e[t].height=e[t].height+o}}O(Pp,"calcC4ShapeTextWH");var Uzt=O(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=Fr.c4ShapeMargin-35;let n=e.wrap&&Fr.wrap,i=Cte(Fr);i.fontSize=i.fontSize+2,i.fontWeight="bold";let a=Uu(e.label.text,i);Pp("label",e,n,i,a),iv.drawBoundary(t,e,Fr)},"drawBoundary"),Vzt=O(function(t,e,r,n){let i=0;for(const a of n){i=0;const o=r[a];let s=S9(Fr,o.typeC4Shape.text);switch(s.fontSize=s.fontSize-2,o.typeC4Shape.width=Uu("«"+o.typeC4Shape.text+"»",s),o.typeC4Shape.height=s.fontSize+2,o.typeC4Shape.Y=Fr.c4ShapePadding,i=o.typeC4Shape.Y+o.typeC4Shape.height-4,o.image={width:0,height:0,Y:0},o.typeC4Shape.text){case"person":case"external_person":o.image.width=48,o.image.height=48,o.image.Y=i,i=o.image.Y+o.image.height;break}o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=i,i=o.image.Y+o.image.height);let l=o.wrap&&Fr.wrap,u=Fr.width-Fr.c4ShapePadding*2,h=S9(Fr,o.typeC4Shape.text);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",Pp("label",o,l,h,u),o.label.Y=i+8,i=o.label.Y+o.label.height,o.type&&o.type.text!==""){o.type.text="["+o.type.text+"]";let p=S9(Fr,o.typeC4Shape.text);Pp("type",o,l,p,u),o.type.Y=i+5,i=o.type.Y+o.type.height}else if(o.techn&&o.techn.text!==""){o.techn.text="["+o.techn.text+"]";let p=S9(Fr,o.techn.text);Pp("techn",o,l,p,u),o.techn.Y=i+5,i=o.techn.Y+o.techn.height}let d=i,f=o.label.width;if(o.descr&&o.descr.text!==""){let p=S9(Fr,o.typeC4Shape.text);Pp("descr",o,l,p,u),o.descr.Y=i+20,i=o.descr.Y+o.descr.height,f=Math.max(o.label.width,o.descr.width),d=i-o.descr.textLines*5}f=f+Fr.c4ShapePadding,o.width=Math.max(o.width||Fr.width,f,Fr.width),o.height=Math.max(o.height||Fr.height,d,Fr.height),o.margin=o.margin||Fr.c4ShapeMargin,t.insert(o),iv.drawC4Shape(e,o,Fr)}t.bumpLastMargin(Fr.c4ShapeMargin)},"drawC4ShapeArray"),Np=(rL=class{constructor(e,r){this.x=e,this.y=r}},O(rL,"Point"),rL),Qzt=O(function(t,e){let r=t.x,n=t.y,i=e.x,a=e.y,o=r+t.width/2,s=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 Np(r,s):r==i&&na&&(f=new Np(o,n)),r>i&&n=h?f=new Np(r,s+h*t.width/2):f=new Np(o-l/u*t.height/2,n+t.height):r=h?f=new Np(r+t.width,s+h*t.width/2):f=new Np(o+l/u*t.height/2,n+t.height):ra?d>=h?f=new Np(r+t.width,s-h*t.width/2):f=new Np(o+t.height/2*l/u,n):r>i&&n>a&&(d>=h?f=new Np(r,s-t.width/2*h):f=new Np(o-t.height/2*l/u,n)),f},"getIntersectPoint"),HFn=O(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=Qzt(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=Qzt(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),WFn=O(function(t,e,r,n,i){let a=0;for(let o of e){a=a+1;let s=o.wrap&&Fr.wrap,l=GFn(Fr);n.db.getC4Type()==="C4Dynamic"&&(o.label.text=a+": "+o.label.text);let h=Uu(o.label.text,l);Pp("label",o,s,l,h),o.techn&&o.techn.text!==""&&(h=Uu(o.techn.text,l),Pp("techn",o,s,l,h)),o.descr&&o.descr.text!==""&&(h=Uu(o.descr.text,l),Pp("descr",o,s,l,h));let d=r(o.from),f=r(o.to),p=HFn(d,f);o.startPoint=p.startPoint,o.endPoint=p.endPoint}iv.drawRels(t,e,Fr,i)},"drawRels");function i_e(t,e,r,n,i){let a=new zzt(i);a.data.widthLimit=r.data.widthLimit/Math.min(r_e,n.length);for(let[o,s]of n.entries()){let l=0;s.image={width:0,height:0,Y:0},s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=l,l=s.image.Y+s.image.height);let u=s.wrap&&Fr.wrap,h=Cte(Fr);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",Pp("label",s,u,h,a.data.widthLimit),s.label.Y=l+8,l=s.label.Y+s.label.height,s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";let g=Cte(Fr);Pp("type",s,u,g,a.data.widthLimit),s.type.Y=l+5,l=s.type.Y+s.type.height}if(s.descr&&s.descr.text!==""){let g=Cte(Fr);g.fontSize=g.fontSize-2,Pp("descr",s,u,g,a.data.widthLimit),s.descr.Y=l+20,l=s.descr.Y+s.descr.height}if(o==0||o%r_e===0){let g=r.data.startx+Fr.diagramMarginX,m=r.data.stopy+Fr.diagramMarginY+l;a.setData(g,g,m,m)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+Fr.diagramMarginX:a.data.startx,m=a.data.starty;a.setData(g,g,m,m)}a.name=s.alias;let d=i.db.getC4ShapeArray(s.alias),f=i.db.getC4ShapeKeys(s.alias);f.length>0&&Vzt(a,t,d,f),e=s.alias;let p=i.db.getBoundaries(e);p.length>0&&i_e(t,e,a,p,i),s.alias!=="global"&&Uzt(t,s,a),r.data.stopy=Math.max(a.data.stopy+Fr.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+Fr.c4ShapeMargin,r.data.stopx),Ste=Math.max(Ste,r.data.stopx),Tte=Math.max(Tte,r.data.stopy)}}O(i_e,"drawInsideBoundary");var YFn=O(function(t,e,r,n){Fr=Ye().c4;const i=Ye().securityLevel;let a;i==="sandbox"&&(a=_t("#i"+e));const o=_t(i==="sandbox"?a.nodes()[0].contentDocument.body:"body");let s=n.db;n.db.setWrap(Fr.wrap),Fzt=s.getC4ShapeInRow(),r_e=s.getC4BoundaryInRow(),ye.debug(`C:${JSON.stringify(Fr,null,2)}`);const l=i==="sandbox"?o.select(`[id="${e}"]`):_t(`[id="${e}"]`);iv.insertComputerIcon(l,e),iv.insertDatabaseIcon(l,e),iv.insertClockIcon(l,e);let u=new zzt(n);u.setData(Fr.diagramMarginX,Fr.diagramMarginX,Fr.diagramMarginY,Fr.diagramMarginY),u.data.widthLimit=screen.availWidth,Ste=Fr.diagramMarginX,Tte=Fr.diagramMarginY;const h=n.db.getTitle();let d=n.db.getBoundaries("");i_e(l,"",u,d,n),iv.insertArrowHead(l,e),iv.insertArrowEnd(l,e),iv.insertArrowCrossHead(l,e),iv.insertArrowFilledHead(l,e),WFn(l,n.db.getRels(),n.db.getC4Shape,n,e),u.data.stopx=Ste,u.data.stopy=Tte;const f=u.data;let g=f.stopy-f.starty+2*Fr.diagramMarginY;const v=f.stopx-f.startx+2*Fr.diagramMarginX;h&&l.append("text").text(h).attr("x",(f.stopx-f.startx)/2-4*Fr.diagramMarginX).attr("y",f.starty+Fr.diagramMarginY),jo(l,g,v,Fr.useMaxWidth);const y=h?60:0;l.attr("viewBox",f.startx-Fr.diagramMarginX+" -"+(Fr.diagramMarginY+y)+" "+v+" "+(g+y)),ye.debug("models:",f)},"draw"),Gzt={drawPersonOrSystemArray:Vzt,drawBoundary:Uzt,setConf:n_e,draw:YFn},qFn=O(t=>`.person { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:O(function(){var Be=this.next();return Be||this.lex()},"lex"),begin:O(function(Be){this.conditionStack.push(Be)},"begin"),popState:O(function(){var Be=this.conditionStack.length-1;return Be>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(Be){return Be=this.conditionStack.length-1-Math.abs(Be||0),Be>=0?this.conditionStack[Be]:"INITIAL"},"topState"),pushState:O(function(Be){this.begin(Be)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:O(function(Be,Z,le,be){switch(le){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 we}();xe.lexer=ge;function ze(){this.yy={}}return O(ze,"Parser"),ze.prototype=xe,xe.Parser=ze,new ze}();xte.parser=xte;var oFn=xte,Gg=[],yw=[""],ih="global",Hg="",nv=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],A9=[],ZEe="",JEe=!1,wte=4,Ate=2,Bzt,sFn=O(function(){return Bzt},"getC4Type"),lFn=O(function(t){Bzt=li(t,Ye())},"setC4Type"),cFn=O(function(t,e,r,n,i,a,o,s,l){if(t==null||e===void 0||e===null||r===void 0||r===null||n===void 0||n===null)return;let u={};const h=A9.find(d=>d.from===e&&d.to===r);if(h?u=h:A9.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 o=="object"){let[d,f]=Object.entries(o)[0];u[d]=f}else u.sprite=o;if(typeof s=="object"){let[d,f]=Object.entries(s)[0];u[d]=f}else u.tags=s;if(typeof l=="object"){let[d,f]=Object.entries(l)[0];u[d]=f}else u.link=l;u.wrap=bw()},"addRel"),uFn=O(function(t,e,r,n,i,a,o){if(e===null||r===null)return;let s={};const l=Gg.find(u=>u.alias===e);if(l&&e===l.alias?s=l:(s.alias=e,Gg.push(s)),r==null?s.label={text:""}:s.label={text:r},n==null)s.descr={text:""};else if(typeof n=="object"){let[u,h]=Object.entries(n)[0];s[u]={text:h}}else s.descr={text:n};if(typeof i=="object"){let[u,h]=Object.entries(i)[0];s[u]=h}else s.sprite=i;if(typeof a=="object"){let[u,h]=Object.entries(a)[0];s[u]=h}else s.tags=a;if(typeof o=="object"){let[u,h]=Object.entries(o)[0];s[u]=h}else s.link=o;s.typeC4Shape={text:t},s.parentBoundary=ih,s.wrap=bw()},"addPersonOrSystem"),hFn=O(function(t,e,r,n,i,a,o,s){if(e===null||r===null)return;let l={};const u=Gg.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Gg.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 o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.tags=o;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.link=s;l.wrap=bw(),l.typeC4Shape={text:t},l.parentBoundary=ih},"addContainer"),dFn=O(function(t,e,r,n,i,a,o,s){if(e===null||r===null)return;let l={};const u=Gg.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,Gg.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 o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.tags=o;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.link=s;l.wrap=bw(),l.typeC4Shape={text:t},l.parentBoundary=ih},"addComponent"),fFn=O(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const o=nv.find(s=>s.alias===t);if(o&&t===o.alias?a=o:(a.alias=t,nv.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"system"};else if(typeof r=="object"){let[s,l]=Object.entries(r)[0];a[s]={text:l}}else a.type={text:r};if(typeof n=="object"){let[s,l]=Object.entries(n)[0];a[s]=l}else a.tags=n;if(typeof i=="object"){let[s,l]=Object.entries(i)[0];a[s]=l}else a.link=i;a.parentBoundary=ih,a.wrap=bw(),Hg=ih,ih=t,yw.push(Hg)},"addPersonOrSystemBoundary"),pFn=O(function(t,e,r,n,i){if(t===null||e===null)return;let a={};const o=nv.find(s=>s.alias===t);if(o&&t===o.alias?a=o:(a.alias=t,nv.push(a)),e==null?a.label={text:""}:a.label={text:e},r==null)a.type={text:"container"};else if(typeof r=="object"){let[s,l]=Object.entries(r)[0];a[s]={text:l}}else a.type={text:r};if(typeof n=="object"){let[s,l]=Object.entries(n)[0];a[s]=l}else a.tags=n;if(typeof i=="object"){let[s,l]=Object.entries(i)[0];a[s]=l}else a.link=i;a.parentBoundary=ih,a.wrap=bw(),Hg=ih,ih=t,yw.push(Hg)},"addContainerBoundary"),gFn=O(function(t,e,r,n,i,a,o,s){if(e===null||r===null)return;let l={};const u=nv.find(h=>h.alias===e);if(u&&e===u.alias?l=u:(l.alias=e,nv.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 o=="object"){let[h,d]=Object.entries(o)[0];l[h]=d}else l.tags=o;if(typeof s=="object"){let[h,d]=Object.entries(s)[0];l[h]=d}else l.link=s;l.nodeType=t,l.parentBoundary=ih,l.wrap=bw(),Hg=ih,ih=e,yw.push(Hg)},"addDeploymentNode"),mFn=O(function(){ih=Hg,yw.pop(),Hg=yw.pop(),yw.push(Hg)},"popBoundaryParseStack"),vFn=O(function(t,e,r,n,i,a,o,s,l,u,h){let d=Gg.find(f=>f.alias===e);if(!(d===void 0&&(d=nv.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(o!=null)if(typeof o=="object"){let[f,p]=Object.entries(o)[0];d[f]=p}else d.shape=o;if(s!=null)if(typeof s=="object"){let[f,p]=Object.entries(s)[0];d[f]=p}else d.sprite=s;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"),yFn=O(function(t,e,r,n,i,a,o){const s=A9.find(l=>l.from===e&&l.to===r);if(s!==void 0){if(n!=null)if(typeof n=="object"){let[l,u]=Object.entries(n)[0];s[l]=u}else s.textColor=n;if(i!=null)if(typeof i=="object"){let[l,u]=Object.entries(i)[0];s[l]=u}else s.lineColor=i;if(a!=null)if(typeof a=="object"){let[l,u]=Object.entries(a)[0];s[l]=parseInt(u)}else s.offsetX=parseInt(a);if(o!=null)if(typeof o=="object"){let[l,u]=Object.entries(o)[0];s[l]=parseInt(u)}else s.offsetY=parseInt(o)}},"updateRelStyle"),bFn=O(function(t,e,r){let n=wte,i=Ate;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&&(wte=n),i>=1&&(Ate=i)},"updateLayoutConfig"),xFn=O(function(){return wte},"getC4ShapeInRow"),wFn=O(function(){return Ate},"getC4BoundaryInRow"),AFn=O(function(){return ih},"getCurrentBoundaryParse"),SFn=O(function(){return Hg},"getParentBoundaryParse"),$zt=O(function(t){return t==null?Gg:Gg.filter(e=>e.parentBoundary===t)},"getC4ShapeArray"),TFn=O(function(t){return Gg.find(e=>e.alias===t)},"getC4Shape"),CFn=O(function(t){return Object.keys($zt(t))},"getC4ShapeKeys"),Fzt=O(function(t){return t==null?nv:nv.filter(e=>e.parentBoundary===t)},"getBoundaries"),OFn=Fzt,kFn=O(function(){return A9},"getRels"),EFn=O(function(){return ZEe},"getTitle"),_Fn=O(function(t){JEe=t},"setWrap"),bw=O(function(){return JEe},"autoWrap"),RFn=O(function(){Gg=[],nv=[{alias:"global",label:{text:"global"},type:{text:"global"},tags:null,link:null,parentBoundary:""}],Hg="",ih="global",yw=[""],A9=[],yw=[""],ZEe="",JEe=!1,wte=4,Ate=2},"clear"),DFn={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},LFn={FILLED:0,OPEN:1},MFn={LEFTOF:0,RIGHTOF:1,OVER:2},IFn=O(function(t){ZEe=li(t,Ye())},"setTitle"),e_e={addPersonOrSystem:uFn,addPersonOrSystemBoundary:fFn,addContainer:hFn,addContainerBoundary:pFn,addComponent:dFn,addDeploymentNode:gFn,popBoundaryParseStack:mFn,addRel:cFn,updateElStyle:vFn,updateRelStyle:yFn,updateLayoutConfig:bFn,autoWrap:bw,setWrap:_Fn,getC4ShapeArray:$zt,getC4Shape:TFn,getC4ShapeKeys:CFn,getBoundaries:Fzt,getBoundarys:OFn,getCurrentBoundaryParse:AFn,getParentBoundaryParse:SFn,getRels:kFn,getTitle:EFn,getC4Type:sFn,getC4ShapeInRow:xFn,getC4BoundaryInRow:wFn,setAccTitle:Ba,getAccTitle:oo,getAccDescription:lo,setAccDescription:so,getConfig:O(()=>Ye().c4,"getConfig"),clear:RFn,LINETYPE:DFn,ARROWTYPE:LFn,PLACEMENT:MFn,setTitle:IFn,setC4Type:lFn},t_e=O(function(t,e){return bte(t,e)},"drawRect"),zzt=O(function(t,e,r,n,i,a){const o=t.append("image");o.attr("width",e),o.attr("height",r),o.attr("x",n),o.attr("y",i);let s=a.startsWith("data:image/png;base64")?a:ZT(a);o.attr("xlink:href",s)},"drawImage"),PFn=O((t,e,r,n)=>{const i=t.append("g");let a=0;for(let o of e){let s=o.textColor?o.textColor:"#444444",l=o.lineColor?o.lineColor:"#444444",u=o.offsetX?parseInt(o.offsetX):0,h=o.offsetY?parseInt(o.offsetY):0,d="";if(a===0){let p=i.append("line");p.attr("x1",o.startPoint.x),p.attr("y1",o.startPoint.y),p.attr("x2",o.endPoint.x),p.attr("y2",o.endPoint.y),p.attr("stroke-width","1"),p.attr("stroke",l),p.style("fill","none"),o.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(o.type==="birel"||o.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",o.startPoint.x).replaceAll("starty",o.startPoint.y).replaceAll("controlx",o.startPoint.x+(o.endPoint.x-o.startPoint.x)/2-(o.endPoint.x-o.startPoint.x)/4).replaceAll("controly",o.startPoint.y+(o.endPoint.y-o.startPoint.y)/2).replaceAll("stopx",o.endPoint.x).replaceAll("stopy",o.endPoint.y)),o.type!=="rel_b"&&p.attr("marker-end","url("+d+"#"+n+"-arrowhead)"),(o.type==="birel"||o.type==="rel_b")&&p.attr("marker-start","url("+d+"#"+n+"-arrowend)")}let f=r.messageFont();X1(r)(o.label.text,i,Math.min(o.startPoint.x,o.endPoint.x)+Math.abs(o.endPoint.x-o.startPoint.x)/2+u,Math.min(o.startPoint.y,o.endPoint.y)+Math.abs(o.endPoint.y-o.startPoint.y)/2+h,o.label.width,o.label.height,{fill:s},f),o.techn&&o.techn.text!==""&&(f=r.messageFont(),X1(r)("["+o.techn.text+"]",i,Math.min(o.startPoint.x,o.endPoint.x)+Math.abs(o.endPoint.x-o.startPoint.x)/2+u,Math.min(o.startPoint.y,o.endPoint.y)+Math.abs(o.endPoint.y-o.startPoint.y)/2+r.messageFontSize+5+h,Math.max(o.label.width,o.techn.width),o.techn.height,{fill:s,"font-style":"italic"},f))}},"drawRels"),NFn=O(function(t,e,r){const n=t.append("g");let i=e.bgColor?e.bgColor:"none",a=e.borderColor?e.borderColor:"#444444",o=e.fontColor?e.fontColor:"black",s={"stroke-width":1,"stroke-dasharray":"7.0,7.0"};e.nodeType&&(s={"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:s};t_e(n,l);let u=r.boundaryFont();u.fontWeight="bold",u.fontSize=u.fontSize+2,u.fontColor=o,X1(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=o,X1(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=o,X1(r)(e.descr.text,n,e.x,e.y+e.descr.Y,e.width,e.height,{fill:"#444444"},u))},"drawBoundary"),BFn=O(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",o="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":o="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":o="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 s=t.append("g");s.attr("class","person-man");const l=gf();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},t_e(s,l);break;case"system_db":case"external_system_db":case"container_db":case"external_container_db":case"component_db":case"external_component_db":s.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)),s.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":s.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)),s.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=HFn(r,e.typeC4Shape.text);switch(s.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":zzt(s,48,48,e.x+e.width/2-24,e.y+e.image.Y,o);break}let h=r[e.typeC4Shape.text+"Font"]();return h.fontWeight="bold",h.fontSize=h.fontSize+2,h.fontColor=a,X1(r)(e.label.text,s,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)!==""?X1(r)(e.techn.text,s,e.x,e.y+e.techn.Y,e.width,e.height,{fill:a,"font-style":"italic"},h):e.type&&e.type.text!==""&&X1(r)(e.type.text,s,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,X1(r)(e.descr.text,s,e.x,e.y+e.descr.Y,e.width,e.height,{fill:a},h)),e.height},"drawC4Shape"),$Fn=O(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"),FFn=O(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"),zFn=O(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"),UFn=O(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"),VFn=O(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"),QFn=O(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"),GFn=O(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"),HFn=O((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"getC4ShapeFont"),X1=function(){function t(i,a,o,s,l,u,h){const d=a.append("text").attr("x",o+l/2).attr("y",s+u/2+5).style("text-anchor","middle").text(i);n(d,h)}O(t,"byText");function e(i,a,o,s,l,u,h,d){const{fontSize:f,fontFamily:p,fontWeight:g}=d,m=i.split(Xt.lineBreakRegex);for(let v=0;v=this.data.widthLimit||n>=this.data.widthLimit||this.nextData.cnt>Uzt)&&(r=this.nextData.startx+e.margin+Fr.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},n_e(e.db.getConfig())}bumpLastMargin(e){this.data.stopx+=e,this.data.stopy+=e}},O(tL,"Bounds"),tL),n_e=O(function(t){$s(Fr,t),t.fontFamily&&(Fr.personFontFamily=Fr.systemFontFamily=Fr.messageFontFamily=t.fontFamily),t.fontSize&&(Fr.personFontSize=Fr.systemFontSize=Fr.messageFontSize=t.fontSize),t.fontWeight&&(Fr.personFontWeight=Fr.systemFontWeight=Fr.messageFontWeight=t.fontWeight)},"setConf"),S9=O((t,e)=>({fontFamily:t[e+"FontFamily"],fontSize:t[e+"FontSize"],fontWeight:t[e+"FontWeight"]}),"c4ShapeFont"),Cte=O(t=>({fontFamily:t.boundaryFontFamily,fontSize:t.boundaryFontSize,fontWeight:t.boundaryFontWeight}),"boundaryFont"),WFn=O(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont");function Pp(t,e,r,n,i){if(!e[t].width)if(r)e[t].text=Y7(e[t].text,i,n),e[t].textLines=e[t].text.split(Xt.lineBreakRegex).length,e[t].width=i,e[t].height=_X(e[t].text,n);else{let a=e[t].text.split(Xt.lineBreakRegex);e[t].textLines=a.length;let o=0;e[t].height=0,e[t].width=0;for(const s of a)e[t].width=Math.max(Uu(s,n),e[t].width),o=_X(s,n),e[t].height=e[t].height+o}}O(Pp,"calcC4ShapeTextWH");var Qzt=O(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=Fr.c4ShapeMargin-35;let n=e.wrap&&Fr.wrap,i=Cte(Fr);i.fontSize=i.fontSize+2,i.fontWeight="bold";let a=Uu(e.label.text,i);Pp("label",e,n,i,a),iv.drawBoundary(t,e,Fr)},"drawBoundary"),Gzt=O(function(t,e,r,n){let i=0;for(const a of n){i=0;const o=r[a];let s=S9(Fr,o.typeC4Shape.text);switch(s.fontSize=s.fontSize-2,o.typeC4Shape.width=Uu("«"+o.typeC4Shape.text+"»",s),o.typeC4Shape.height=s.fontSize+2,o.typeC4Shape.Y=Fr.c4ShapePadding,i=o.typeC4Shape.Y+o.typeC4Shape.height-4,o.image={width:0,height:0,Y:0},o.typeC4Shape.text){case"person":case"external_person":o.image.width=48,o.image.height=48,o.image.Y=i,i=o.image.Y+o.image.height;break}o.sprite&&(o.image.width=48,o.image.height=48,o.image.Y=i,i=o.image.Y+o.image.height);let l=o.wrap&&Fr.wrap,u=Fr.width-Fr.c4ShapePadding*2,h=S9(Fr,o.typeC4Shape.text);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",Pp("label",o,l,h,u),o.label.Y=i+8,i=o.label.Y+o.label.height,o.type&&o.type.text!==""){o.type.text="["+o.type.text+"]";let p=S9(Fr,o.typeC4Shape.text);Pp("type",o,l,p,u),o.type.Y=i+5,i=o.type.Y+o.type.height}else if(o.techn&&o.techn.text!==""){o.techn.text="["+o.techn.text+"]";let p=S9(Fr,o.techn.text);Pp("techn",o,l,p,u),o.techn.Y=i+5,i=o.techn.Y+o.techn.height}let d=i,f=o.label.width;if(o.descr&&o.descr.text!==""){let p=S9(Fr,o.typeC4Shape.text);Pp("descr",o,l,p,u),o.descr.Y=i+20,i=o.descr.Y+o.descr.height,f=Math.max(o.label.width,o.descr.width),d=i-o.descr.textLines*5}f=f+Fr.c4ShapePadding,o.width=Math.max(o.width||Fr.width,f,Fr.width),o.height=Math.max(o.height||Fr.height,d,Fr.height),o.margin=o.margin||Fr.c4ShapeMargin,t.insert(o),iv.drawC4Shape(e,o,Fr)}t.bumpLastMargin(Fr.c4ShapeMargin)},"drawC4ShapeArray"),Np=(rL=class{constructor(e,r){this.x=e,this.y=r}},O(rL,"Point"),rL),Hzt=O(function(t,e){let r=t.x,n=t.y,i=e.x,a=e.y,o=r+t.width/2,s=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 Np(r,s):r==i&&na&&(f=new Np(o,n)),r>i&&n=h?f=new Np(r,s+h*t.width/2):f=new Np(o-l/u*t.height/2,n+t.height):r=h?f=new Np(r+t.width,s+h*t.width/2):f=new Np(o+l/u*t.height/2,n+t.height):ra?d>=h?f=new Np(r+t.width,s-h*t.width/2):f=new Np(o+t.height/2*l/u,n):r>i&&n>a&&(d>=h?f=new Np(r,s-t.width/2*h):f=new Np(o-t.height/2*l/u,n)),f},"getIntersectPoint"),YFn=O(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=Hzt(t,r);r.x=t.x+t.width/2,r.y=t.y+t.height/2;let i=Hzt(e,r);return{startPoint:n,endPoint:i}},"getIntersectPoints"),qFn=O(function(t,e,r,n,i){let a=0;for(let o of e){a=a+1;let s=o.wrap&&Fr.wrap,l=WFn(Fr);n.db.getC4Type()==="C4Dynamic"&&(o.label.text=a+": "+o.label.text);let h=Uu(o.label.text,l);Pp("label",o,s,l,h),o.techn&&o.techn.text!==""&&(h=Uu(o.techn.text,l),Pp("techn",o,s,l,h)),o.descr&&o.descr.text!==""&&(h=Uu(o.descr.text,l),Pp("descr",o,s,l,h));let d=r(o.from),f=r(o.to),p=YFn(d,f);o.startPoint=p.startPoint,o.endPoint=p.endPoint}iv.drawRels(t,e,Fr,i)},"drawRels");function i_e(t,e,r,n,i){let a=new Vzt(i);a.data.widthLimit=r.data.widthLimit/Math.min(r_e,n.length);for(let[o,s]of n.entries()){let l=0;s.image={width:0,height:0,Y:0},s.sprite&&(s.image.width=48,s.image.height=48,s.image.Y=l,l=s.image.Y+s.image.height);let u=s.wrap&&Fr.wrap,h=Cte(Fr);if(h.fontSize=h.fontSize+2,h.fontWeight="bold",Pp("label",s,u,h,a.data.widthLimit),s.label.Y=l+8,l=s.label.Y+s.label.height,s.type&&s.type.text!==""){s.type.text="["+s.type.text+"]";let g=Cte(Fr);Pp("type",s,u,g,a.data.widthLimit),s.type.Y=l+5,l=s.type.Y+s.type.height}if(s.descr&&s.descr.text!==""){let g=Cte(Fr);g.fontSize=g.fontSize-2,Pp("descr",s,u,g,a.data.widthLimit),s.descr.Y=l+20,l=s.descr.Y+s.descr.height}if(o==0||o%r_e===0){let g=r.data.startx+Fr.diagramMarginX,m=r.data.stopy+Fr.diagramMarginY+l;a.setData(g,g,m,m)}else{let g=a.data.stopx!==a.data.startx?a.data.stopx+Fr.diagramMarginX:a.data.startx,m=a.data.starty;a.setData(g,g,m,m)}a.name=s.alias;let d=i.db.getC4ShapeArray(s.alias),f=i.db.getC4ShapeKeys(s.alias);f.length>0&&Gzt(a,t,d,f),e=s.alias;let p=i.db.getBoundaries(e);p.length>0&&i_e(t,e,a,p,i),s.alias!=="global"&&Qzt(t,s,a),r.data.stopy=Math.max(a.data.stopy+Fr.c4ShapeMargin,r.data.stopy),r.data.stopx=Math.max(a.data.stopx+Fr.c4ShapeMargin,r.data.stopx),Ste=Math.max(Ste,r.data.stopx),Tte=Math.max(Tte,r.data.stopy)}}O(i_e,"drawInsideBoundary");var jFn=O(function(t,e,r,n){Fr=Ye().c4;const i=Ye().securityLevel;let a;i==="sandbox"&&(a=_t("#i"+e));const o=_t(i==="sandbox"?a.nodes()[0].contentDocument.body:"body");let s=n.db;n.db.setWrap(Fr.wrap),Uzt=s.getC4ShapeInRow(),r_e=s.getC4BoundaryInRow(),ye.debug(`C:${JSON.stringify(Fr,null,2)}`);const l=i==="sandbox"?o.select(`[id="${e}"]`):_t(`[id="${e}"]`);iv.insertComputerIcon(l,e),iv.insertDatabaseIcon(l,e),iv.insertClockIcon(l,e);let u=new Vzt(n);u.setData(Fr.diagramMarginX,Fr.diagramMarginX,Fr.diagramMarginY,Fr.diagramMarginY),u.data.widthLimit=screen.availWidth,Ste=Fr.diagramMarginX,Tte=Fr.diagramMarginY;const h=n.db.getTitle();let d=n.db.getBoundaries("");i_e(l,"",u,d,n),iv.insertArrowHead(l,e),iv.insertArrowEnd(l,e),iv.insertArrowCrossHead(l,e),iv.insertArrowFilledHead(l,e),qFn(l,n.db.getRels(),n.db.getC4Shape,n,e),u.data.stopx=Ste,u.data.stopy=Tte;const f=u.data;let g=f.stopy-f.starty+2*Fr.diagramMarginY;const v=f.stopx-f.startx+2*Fr.diagramMarginX;h&&l.append("text").text(h).attr("x",(f.stopx-f.startx)/2-4*Fr.diagramMarginX).attr("y",f.starty+Fr.diagramMarginY),jo(l,g,v,Fr.useMaxWidth);const y=h?60:0;l.attr("viewBox",f.startx-Fr.diagramMarginX+" -"+(Fr.diagramMarginY+y)+" "+v+" "+(g+y)),ye.debug("models:",f)},"draw"),Wzt={drawPersonOrSystemArray:Gzt,drawBoundary:Qzt,setConf:n_e,draw:jFn},XFn=O(t=>`.person { stroke: ${t.personBorder}; fill: ${t.personBkg}; } -`,"getStyles"),jFn=qFn,XFn={parser:iFn,db:e_e,renderer:Gzt,styles:jFn,init:O(({c4:t,wrap:e})=>{Gzt.setConf(t),e_e.setWrap(e)},"init")};const KFn=Object.freeze(Object.defineProperty({__proto__:null,diagram:XFn},Symbol.toStringTag,{value:"Module"}));var T9=O(()=>` +`,"getStyles"),KFn=XFn,ZFn={parser:oFn,db:e_e,renderer:Wzt,styles:KFn,init:O(({c4:t,wrap:e})=>{Wzt.setConf(t),e_e.setWrap(e)},"init")};const JFn=Object.freeze(Object.defineProperty({__proto__:null,diagram:ZFn},Symbol.toStringTag,{value:"Module"}));var T9=O(()=>` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; @@ -1341,21 +1341,21 @@ Expecting `+It.join(", ")+", got '"+(this.terminals_[et]||et)+"'":gt="Parse erro stroke: revert; stroke-width: revert; } -`,"getIconStyles"),m3=O((t,e)=>{let r;return e==="sandbox"&&(r=_t("#i"+t)),_t(e==="sandbox"?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)},"getDiagramElement"),nO=O((t,e,r,n)=>{t.attr("class",r);const{width:i,height:a,x:o,y:s}=ZFn(t,e);jo(t,a,i,n);const l=JFn(o,s,i,a,e);t.attr("viewBox",l),ye.debug(`viewBox configured: ${l} with padding: ${e}`)},"setupViewPortForSVG"),ZFn=O((t,e)=>{var n;const r=((n=t.node())==null?void 0:n.getBBox())||{width:0,height:0,x:0,y:0};return{width:r.width+e*2,height:r.height+e*2,x:r.x,y:r.y}},"calculateDimensionsWithPadding"),JFn=O((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`,"createViewBox"),e9n="flowchart-",t9n=(nL=class{constructor(){this.vertexCounter=0,this.config=Ye(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Ba,this.setAccDescription=so,this.setDiagramTitle=co,this.getAccTitle=oo,this.getAccDescription=lo,this.getDiagramTitle=$a,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(e){return Xt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const r of this.vertices.values())if(r.id===e)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,r,n,i,a,o,s={},l){var p,g;if(!e||e.trim().length===0)return;let u;if(l!==void 0){let m;l.includes(` +`,"getIconStyles"),m3=O((t,e)=>{let r;return e==="sandbox"&&(r=_t("#i"+t)),_t(e==="sandbox"?r.nodes()[0].contentDocument.body:"body").select(`[id="${t}"]`)},"getDiagramElement"),nO=O((t,e,r,n)=>{t.attr("class",r);const{width:i,height:a,x:o,y:s}=e9n(t,e);jo(t,a,i,n);const l=t9n(o,s,i,a,e);t.attr("viewBox",l),ye.debug(`viewBox configured: ${l} with padding: ${e}`)},"setupViewPortForSVG"),e9n=O((t,e)=>{var n;const r=((n=t.node())==null?void 0:n.getBBox())||{width:0,height:0,x:0,y:0};return{width:r.width+e*2,height:r.height+e*2,x:r.x,y:r.y}},"calculateDimensionsWithPadding"),t9n=O((t,e,r,n,i)=>`${t-i} ${e-i} ${r} ${n}`,"createViewBox"),r9n="flowchart-",n9n=(nL=class{constructor(){this.vertexCounter=0,this.config=Ye(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Ba,this.setAccDescription=so,this.setDiagramTitle=co,this.getAccTitle=oo,this.getAccDescription=lo,this.getDiagramTitle=$a,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(e){return Xt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const r of this.vertices.values())if(r.id===e)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,r,n,i,a,o,s={},l){var p,g;if(!e||e.trim().length===0)return;let u;if(l!==void 0){let m;l.includes(` `)?m=l+` `:m=`{ `+l+` -}`,u=OX(m,{schema:CX})}const h=this.edges.find(m=>m.id===e);if(h){const m=u;(m==null?void 0:m.animate)!==void 0&&(h.animate=m.animate),(m==null?void 0:m.animation)!==void 0&&(h.animation=m.animation),(m==null?void 0:m.curve)!==void 0&&(h.interpolate=m.curve);return}let d,f=this.vertices.get(e);if(f===void 0&&(r===void 0&&n===void 0&&i!==void 0&&i!==null&&ye.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),f={id:e,labelType:"text",domId:e9n+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,r!==void 0?(this.config=Ye(),d=this.sanitizeText(r.text.trim()),f.labelType=r.type,d.startsWith('"')&&d.endsWith('"')&&(d=d.substring(1,d.length-1)),f.text=d):f.text===void 0&&(f.text=e),n!==void 0&&(f.type=n),i!=null&&i.forEach(m=>{f.styles.push(m)}),a!=null&&a.forEach(m=>{f.classes.push(m)}),o!==void 0&&(f.dir=o),f.props===void 0?f.props=s:s!==void 0&&Object.assign(f.props,s),u!==void 0){if(u.shape){if(u.shape!==u.shape.toLowerCase()||u.shape.includes("_"))throw new Error(`No such shape: ${u.shape}. Shape names should be lowercase.`);if(!Vkt(u.shape))throw new Error(`No such shape: ${u.shape}.`);f.type=u==null?void 0:u.shape}u!=null&&u.label&&(f.text=u==null?void 0:u.label,f.labelType=this.sanitizeNodeLabelType(u==null?void 0:u.labelType)),u!=null&&u.icon&&(f.icon=u==null?void 0:u.icon,!((p=u.label)!=null&&p.trim())&&f.text===e&&(f.text="")),u!=null&&u.form&&(f.form=u==null?void 0:u.form),u!=null&&u.pos&&(f.pos=u==null?void 0:u.pos),u!=null&&u.img&&(f.img=u==null?void 0:u.img,!((g=u.label)!=null&&g.trim())&&f.text===e&&(f.text="")),u!=null&&u.constraint&&(f.constraint=u.constraint),u.w&&(f.assetWidth=Number(u.w)),u.h&&(f.assetHeight=Number(u.h))}}addSingleLink(e,r,n,i){const s={start:e,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};ye.info("abc78 Got edge...",s);const l=n.text;if(l!==void 0&&(s.text=this.sanitizeText(l.text.trim()),s.text.startsWith('"')&&s.text.endsWith('"')&&(s.text=s.text.substring(1,s.text.length-1)),s.labelType=this.sanitizeNodeLabelType(l.type)),n!==void 0&&(s.type=n.type,s.stroke=n.stroke,s.length=n.length>10?10:n.length),i&&!this.edges.some(u=>u.id===i))s.id=i,s.isUserDefinedId=!0;else{const u=this.edges.filter(h=>h.start===s.start&&h.end===s.end);u.length===0?s.id=SR(s.start,s.end,{counter:0,prefix:"L"}):s.id=SR(s.start,s.end,{counter:u.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))ye.info("Pushing edge..."),this.edges.push(s);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. +}`,u=OX(m,{schema:CX})}const h=this.edges.find(m=>m.id===e);if(h){const m=u;(m==null?void 0:m.animate)!==void 0&&(h.animate=m.animate),(m==null?void 0:m.animation)!==void 0&&(h.animation=m.animation),(m==null?void 0:m.curve)!==void 0&&(h.interpolate=m.curve);return}let d,f=this.vertices.get(e);if(f===void 0&&(r===void 0&&n===void 0&&i!==void 0&&i!==null&&ye.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),f={id:e,labelType:"text",domId:r9n+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,f)),this.vertexCounter++,r!==void 0?(this.config=Ye(),d=this.sanitizeText(r.text.trim()),f.labelType=r.type,d.startsWith('"')&&d.endsWith('"')&&(d=d.substring(1,d.length-1)),f.text=d):f.text===void 0&&(f.text=e),n!==void 0&&(f.type=n),i!=null&&i.forEach(m=>{f.styles.push(m)}),a!=null&&a.forEach(m=>{f.classes.push(m)}),o!==void 0&&(f.dir=o),f.props===void 0?f.props=s:s!==void 0&&Object.assign(f.props,s),u!==void 0){if(u.shape){if(u.shape!==u.shape.toLowerCase()||u.shape.includes("_"))throw new Error(`No such shape: ${u.shape}. Shape names should be lowercase.`);if(!Gkt(u.shape))throw new Error(`No such shape: ${u.shape}.`);f.type=u==null?void 0:u.shape}u!=null&&u.label&&(f.text=u==null?void 0:u.label,f.labelType=this.sanitizeNodeLabelType(u==null?void 0:u.labelType)),u!=null&&u.icon&&(f.icon=u==null?void 0:u.icon,!((p=u.label)!=null&&p.trim())&&f.text===e&&(f.text="")),u!=null&&u.form&&(f.form=u==null?void 0:u.form),u!=null&&u.pos&&(f.pos=u==null?void 0:u.pos),u!=null&&u.img&&(f.img=u==null?void 0:u.img,!((g=u.label)!=null&&g.trim())&&f.text===e&&(f.text="")),u!=null&&u.constraint&&(f.constraint=u.constraint),u.w&&(f.assetWidth=Number(u.w)),u.h&&(f.assetHeight=Number(u.h))}}addSingleLink(e,r,n,i){const s={start:e,end:r,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};ye.info("abc78 Got edge...",s);const l=n.text;if(l!==void 0&&(s.text=this.sanitizeText(l.text.trim()),s.text.startsWith('"')&&s.text.endsWith('"')&&(s.text=s.text.substring(1,s.text.length-1)),s.labelType=this.sanitizeNodeLabelType(l.type)),n!==void 0&&(s.type=n.type,s.stroke=n.stroke,s.length=n.length>10?10:n.length),i&&!this.edges.some(u=>u.id===i))s.id=i,s.isUserDefinedId=!0;else{const u=this.edges.filter(h=>h.start===s.start&&h.end===s.end);u.length===0?s.id=SR(s.start,s.end,{counter:0,prefix:"L"}):s.id=SR(s.start,s.end,{counter:u.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))ye.info("Pushing edge..."),this.edges.push(s);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. 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;ye.info("addLink",e,r,i);for(const a of e)for(const o of r){const s=a===e[e.length-1],l=o===r[0];s&&l?this.addSingleLink(a,o,n,i):this.addSingleLink(a,o,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,o,s,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&&!((s=(o=this.edges[n])==null?void 0:o.style)!=null&&s.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(o=>{if(/color/.exec(o)){const s=o.replace("fill","bgFill");a.textStyles.push(s)}a.styles.push(o)})})}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(s=>s.id===n);a&&a.classes.push(r);const o=this.subGraphLookup.get(n);o&&o.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(Ye().securityLevel!=="loose"||r===void 0)return;let i=[];if(typeof n=="string"){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let o=0;o{const o=this.lookUpDomId(e),s=document.querySelector(`[id="${o}"]`);s!==null&&s.addEventListener("click",()=>{un.runFunc(r,...i)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{const a=this.vertices.get(i);a!==void 0&&(a.link=un.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=KEe();_t(e).select("svg").selectAll("g.node").on("mouseover",a=>{var u;const o=_t(a.currentTarget),s=o.attr("title");if(s===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(o.attr("title")).style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(qy.sanitize(s)),o.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),_t(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=Ye(),_a()}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 s=O(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=s.nodeList,u=s.dir,h=u!==void 0,d=Ye().flowchart??{},f=u??(d.inheritDir?this.getDirection()??Ye().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 s=this.indexNodes2(e,o);if(s.result)return{result:!0,count:a+s.count};a=a+s.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",o=n.length-1;n.startsWith("=")&&(a="thick"),n.startsWith("~")&&(a="invisible");const s=this.countChar(".",n);return s&&(a="dotted",o=s),{type:i,stroke:a,length:o}}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,o){var h;const s=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:s,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:o,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=Ye(),r=[],n=[],i=this.getSubGraphs(),a=new Map,o=new Map;for(let u=i.length-1;u>=0;u--){const h=i[u];h.nodes.length>0&&o.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,o,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:SR(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 N2t.flowchart}},O(nL,"FlowDB"),nL),r9n=O(function(t,e){return e.db.getClasses()},"getClasses"),n9n=O(async function(t,e,r,n,i){var f;ye.info("REF0:"),ye.info("Drawing state diagram (v2)",e);const{securityLevel:a,flowchart:o,layout:s}=Ye();n.db.setDiagramId(e),ye.debug("Before getData: ");const l=n.db.getData();ye.debug("Data: ",l);const u=m3(e,a),h=n.db.getDirection();l.type=n.type,l.layoutAlgorithm=u$(s),l.layoutAlgorithm==="dagre"&&s==="elk"&&ye.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=(o==null?void 0:o.nodeSpacing)||50,l.rankSpacing=(o==null?void 0:o.rankSpacing)||50,l.markers=["point","circle","cross"],l.diagramId=e,ye.debug("REF1:",l),await RR(l,u,i);const d=((f=l.config.flowchart)==null?void 0:f.diagramPadding)??8;un.insertTitle(u,"flowchartTitleText",(o==null?void 0:o.titleTopMargin)||0,n.db.getDiagramTitle()),nO(u,d,"flowchart",(o==null?void 0:o.useMaxWidth)||!1)},"draw"),i9n={getClasses:r9n,draw:n9n},a_e=function(){var t=O(function(Mn,Rt,Ot,Vt){for(Ot=Ot||{},Vt=Mn.length;Vt--;Ot[Mn[Vt]]=Rt);return Ot},"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],o=[1,13],s=[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],C=[1,48],k=[1,44],E=[1,51],_=[1,46],P=[1,52],L=[1,53],R=[1,34],D=[1,35],M=[1,36],I=[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],q=[1,92],Y=[1,97],ne=[1,96],X=[1,93],J=[1,89],ee=[1,95],te=[1,91],pe=[1,98],ie=[1,94],Ce=[1,99],ke=[1,90],Ee=[8,9,10,11,40,75,77,78],ue=[8,9,10,11,40,46,75,77,78],de=[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],xe=[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],ze=[1,122],we=[1,123],Oe=[1,125],Be=[1,124],Z=[44,60,62,74,89,102,105,106,109,111,114,115,116],le=[1,134],be=[1,148],ae=[1,149],K=[1,150],se=[1,151],me=[1,136],oe=[1,138],ve=[1,142],ce=[1,143],De=[1,144],Le=[1,145],We=[1,146],Ne=[1,147],je=[1,152],$e=[1,153],Ze=[1,132],He=[1,133],et=[1,140],Pe=[1,135],yt=[1,139],Ie=[1,137],St=[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],kt=[1,155],ut=[1,157],Gt=[8,9,11],It=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],gt=[1,177],Te=[1,173],Bt=[1,174],Et=[1,178],At=[1,175],Mt=[1,176],qr=[77,116,119],Me=[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],wt=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],Tt=[1,248],dr=[1,246],jr=[1,250],Ir=[1,244],Zr=[1,245],Ur=[1,247],kn=[1,249],$r=[1,251],dn=[1,269],ii=[8,9,11,106],pt=[8,9,10,11,60,84,105,106,109,110,111,112],Ct={trace:O(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:O(function(Rt,Ot,Vt,mt,Tr,Fe,ta){var Qe=Fe.length-1;switch(Tr){case 2:this.$=[];break;case 3:(!Array.isArray(Fe[Qe])||Fe[Qe].length>0)&&Fe[Qe-1].push(Fe[Qe]),this.$=Fe[Qe-1];break;case 4:case 183:this.$=Fe[Qe];break;case 11:mt.setDirection("TB"),this.$="TB";break;case 12:mt.setDirection(Fe[Qe-1]),this.$=Fe[Qe-1];break;case 27:this.$=Fe[Qe-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=mt.addSubGraph(Fe[Qe-6],Fe[Qe-1],Fe[Qe-4]);break;case 34:this.$=mt.addSubGraph(Fe[Qe-3],Fe[Qe-1],Fe[Qe-3]);break;case 35:this.$=mt.addSubGraph(void 0,Fe[Qe-1],void 0);break;case 37:this.$=Fe[Qe].trim(),mt.setAccTitle(this.$);break;case 38:case 39:this.$=Fe[Qe].trim(),mt.setAccDescription(this.$);break;case 43:this.$=Fe[Qe-1]+Fe[Qe];break;case 44:this.$=Fe[Qe];break;case 45:mt.addVertex(Fe[Qe-1][Fe[Qe-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Fe[Qe]),mt.addLink(Fe[Qe-3].stmt,Fe[Qe-1],Fe[Qe-2]),this.$={stmt:Fe[Qe-1],nodes:Fe[Qe-1].concat(Fe[Qe-3].nodes)};break;case 46:mt.addLink(Fe[Qe-2].stmt,Fe[Qe],Fe[Qe-1]),this.$={stmt:Fe[Qe],nodes:Fe[Qe].concat(Fe[Qe-2].nodes)};break;case 47:mt.addLink(Fe[Qe-3].stmt,Fe[Qe-1],Fe[Qe-2]),this.$={stmt:Fe[Qe-1],nodes:Fe[Qe-1].concat(Fe[Qe-3].nodes)};break;case 48:this.$={stmt:Fe[Qe-1],nodes:Fe[Qe-1]};break;case 49:mt.addVertex(Fe[Qe-1][Fe[Qe-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Fe[Qe]),this.$={stmt:Fe[Qe-1],nodes:Fe[Qe-1],shapeData:Fe[Qe]};break;case 50:this.$={stmt:Fe[Qe],nodes:Fe[Qe]};break;case 51:this.$=[Fe[Qe]];break;case 52:mt.addVertex(Fe[Qe-5][Fe[Qe-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Fe[Qe-4]),this.$=Fe[Qe-5].concat(Fe[Qe]);break;case 53:this.$=Fe[Qe-4].concat(Fe[Qe]);break;case 54:this.$=Fe[Qe];break;case 55:this.$=Fe[Qe-2],mt.setClass(Fe[Qe-2],Fe[Qe]);break;case 56:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"square");break;case 57:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"doublecircle");break;case 58:this.$=Fe[Qe-5],mt.addVertex(Fe[Qe-5],Fe[Qe-2],"circle");break;case 59:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"ellipse");break;case 60:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"stadium");break;case 61:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"subroutine");break;case 62:this.$=Fe[Qe-7],mt.addVertex(Fe[Qe-7],Fe[Qe-1],"rect",void 0,void 0,void 0,Object.fromEntries([[Fe[Qe-5],Fe[Qe-3]]]));break;case 63:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"cylinder");break;case 64:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"round");break;case 65:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"diamond");break;case 66:this.$=Fe[Qe-5],mt.addVertex(Fe[Qe-5],Fe[Qe-2],"hexagon");break;case 67:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"odd");break;case 68:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"trapezoid");break;case 69:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"inv_trapezoid");break;case 70:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"lean_right");break;case 71:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"lean_left");break;case 72:this.$=Fe[Qe],mt.addVertex(Fe[Qe]);break;case 73:Fe[Qe-1].text=Fe[Qe],this.$=Fe[Qe-1];break;case 74:case 75:Fe[Qe-2].text=Fe[Qe-1],this.$=Fe[Qe-2];break;case 76:this.$=Fe[Qe];break;case 77:var In=mt.destructLink(Fe[Qe],Fe[Qe-2]);this.$={type:In.type,stroke:In.stroke,length:In.length,text:Fe[Qe-1]};break;case 78:var In=mt.destructLink(Fe[Qe],Fe[Qe-2]);this.$={type:In.type,stroke:In.stroke,length:In.length,text:Fe[Qe-1],id:Fe[Qe-3]};break;case 79:this.$={text:Fe[Qe],type:"text"};break;case 80:this.$={text:Fe[Qe-1].text+""+Fe[Qe],type:Fe[Qe-1].type};break;case 81:this.$={text:Fe[Qe],type:"string"};break;case 82:this.$={text:Fe[Qe],type:"markdown"};break;case 83:var In=mt.destructLink(Fe[Qe]);this.$={type:In.type,stroke:In.stroke,length:In.length};break;case 84:var In=mt.destructLink(Fe[Qe]);this.$={type:In.type,stroke:In.stroke,length:In.length,id:Fe[Qe-1]};break;case 85:this.$=Fe[Qe-1];break;case 86:this.$={text:Fe[Qe],type:"text"};break;case 87:this.$={text:Fe[Qe-1].text+""+Fe[Qe],type:Fe[Qe-1].type};break;case 88:this.$={text:Fe[Qe],type:"string"};break;case 89:case 104:this.$={text:Fe[Qe],type:"markdown"};break;case 101:this.$={text:Fe[Qe],type:"text"};break;case 102:this.$={text:Fe[Qe-1].text+""+Fe[Qe],type:Fe[Qe-1].type};break;case 103:this.$={text:Fe[Qe],type:"text"};break;case 105:this.$=Fe[Qe-4],mt.addClass(Fe[Qe-2],Fe[Qe]);break;case 106:this.$=Fe[Qe-4],mt.setClass(Fe[Qe-2],Fe[Qe]);break;case 107:case 115:this.$=Fe[Qe-1],mt.setClickEvent(Fe[Qe-1],Fe[Qe]);break;case 108:case 116:this.$=Fe[Qe-3],mt.setClickEvent(Fe[Qe-3],Fe[Qe-2]),mt.setTooltip(Fe[Qe-3],Fe[Qe]);break;case 109:this.$=Fe[Qe-2],mt.setClickEvent(Fe[Qe-2],Fe[Qe-1],Fe[Qe]);break;case 110:this.$=Fe[Qe-4],mt.setClickEvent(Fe[Qe-4],Fe[Qe-3],Fe[Qe-2]),mt.setTooltip(Fe[Qe-4],Fe[Qe]);break;case 111:this.$=Fe[Qe-2],mt.setLink(Fe[Qe-2],Fe[Qe]);break;case 112:this.$=Fe[Qe-4],mt.setLink(Fe[Qe-4],Fe[Qe-2]),mt.setTooltip(Fe[Qe-4],Fe[Qe]);break;case 113:this.$=Fe[Qe-4],mt.setLink(Fe[Qe-4],Fe[Qe-2],Fe[Qe]);break;case 114:this.$=Fe[Qe-6],mt.setLink(Fe[Qe-6],Fe[Qe-4],Fe[Qe]),mt.setTooltip(Fe[Qe-6],Fe[Qe-2]);break;case 117:this.$=Fe[Qe-1],mt.setLink(Fe[Qe-1],Fe[Qe]);break;case 118:this.$=Fe[Qe-3],mt.setLink(Fe[Qe-3],Fe[Qe-2]),mt.setTooltip(Fe[Qe-3],Fe[Qe]);break;case 119:this.$=Fe[Qe-3],mt.setLink(Fe[Qe-3],Fe[Qe-2],Fe[Qe]);break;case 120:this.$=Fe[Qe-5],mt.setLink(Fe[Qe-5],Fe[Qe-4],Fe[Qe]),mt.setTooltip(Fe[Qe-5],Fe[Qe-2]);break;case 121:this.$=Fe[Qe-4],mt.addVertex(Fe[Qe-2],void 0,void 0,Fe[Qe]);break;case 122:this.$=Fe[Qe-4],mt.updateLink([Fe[Qe-2]],Fe[Qe]);break;case 123:this.$=Fe[Qe-4],mt.updateLink(Fe[Qe-2],Fe[Qe]);break;case 124:this.$=Fe[Qe-8],mt.updateLinkInterpolate([Fe[Qe-6]],Fe[Qe-2]),mt.updateLink([Fe[Qe-6]],Fe[Qe]);break;case 125:this.$=Fe[Qe-8],mt.updateLinkInterpolate(Fe[Qe-6],Fe[Qe-2]),mt.updateLink(Fe[Qe-6],Fe[Qe]);break;case 126:this.$=Fe[Qe-6],mt.updateLinkInterpolate([Fe[Qe-4]],Fe[Qe]);break;case 127:this.$=Fe[Qe-6],mt.updateLinkInterpolate(Fe[Qe-4],Fe[Qe]);break;case 128:case 130:this.$=[Fe[Qe]];break;case 129:case 131:Fe[Qe-2].push(Fe[Qe]),this.$=Fe[Qe-2];break;case 133:this.$=Fe[Qe-1]+Fe[Qe];break;case 181:this.$=Fe[Qe];break;case 182:this.$=Fe[Qe-1]+""+Fe[Qe];break;case 184:this.$=Fe[Qe-1]+""+Fe[Qe];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:o,9:s,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:C,109:k,111:E,113:42,114:_,115:P,116:L,121:R,122:D,123:M,124:I,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:q,44:Y,60:ne,80:[1,87],89:X,95:[1,84],97:[1,85],101:86,105:J,106:ee,109:te,111:pe,114:ie,115:Ce,116:ke,120:88},t(B,[2,185]),t(B,[2,186]),t(B,[2,187]),t(B,[2,188]),t(B,[2,189]),t(Ee,[2,51]),t(Ee,[2,54],{46:[1,100]}),t(ue,[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:C,109:k,111:E,114:_,115:P,116:L}),t(de,[2,181]),t(de,[2,142]),t(de,[2,143]),t(de,[2,144]),t(de,[2,145]),t(de,[2,146]),t(de,[2,147]),t(de,[2,148]),t(de,[2,149]),t(de,[2,150]),t(de,[2,151]),t(de,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,114]},t(xe,[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:C,109:k,111:E,113:42,114:_,115:P,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:ze,81:we,116:Oe,119:Be},{75:[1,126],77:[1,127]},t(Z,[2,83]),t(B,[2,28]),t(B,[2,29]),t(B,[2,30]),t(B,[2,31]),t(B,[2,32]),{10:le,12:be,14:ae,27:K,28:128,32:se,44:me,60:oe,75:ve,80:[1,130],81:[1,131],83:141,84:ce,85:De,86:Le,87:We,88:Ne,89:je,90:$e,91:129,105:Ze,109:He,111:et,114:Pe,115:yt,116:Ie},t(St,a,{5:154}),t(B,[2,37]),t(B,[2,38]),t(Q,[2,48],{44:kt}),t(Q,[2,49],{18:156,10:F,40:ut}),t(Ee,[2,44]),{44:g,47:158,60:m,89:A,102:S,105:T,106:C,109:k,111:E,113:42,114:_,115:P,116:L},{102:[1,159],103:160,105:[1,161]},{44:g,47:162,60:m,89:A,102:S,105:T,106:C,109:k,111:E,113:42,114:_,115:P,116:L},{44:g,47:163,60:m,89:A,102:S,105:T,106:C,109:k,111:E,113:42,114:_,115:P,116:L},t(Gt,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(Gt,[2,115],{120:168,10:[1,167],14:q,44:Y,60:ne,89:X,105:J,106:ee,109:te,111:pe,114:ie,115:Ce,116:ke}),t(Gt,[2,117],{10:[1,169]}),t(It,[2,183]),t(It,[2,170]),t(It,[2,171]),t(It,[2,172]),t(It,[2,173]),t(It,[2,174]),t(It,[2,175]),t(It,[2,176]),t(It,[2,177]),t(It,[2,178]),t(It,[2,179]),t(It,[2,180]),{44:g,47:170,60:m,89:A,102:S,105:T,106:C,109:k,111:E,113:42,114:_,115:P,116:L},{30:171,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{30:179,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{30:181,50:[1,180],67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{30:182,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{30:183,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{30:184,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{109:[1,185]},{30:186,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{30:187,65:[1,188],67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{30:189,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{30:190,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{30:191,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},t(de,[2,182]),t(i,[2,20]),t(xe,[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:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{77:[1,197],79:198,116:Oe,119:Be},t(qr,[2,79]),t(qr,[2,81]),t(qr,[2,82]),t(qr,[2,168]),t(qr,[2,169]),{76:199,79:121,80:ze,81:we,116:Oe,119:Be},t(Z,[2,84]),{8:V,9:z,10:le,11:U,12:be,14:ae,21:201,27:K,29:[1,200],32:se,44:me,60:oe,75:ve,83:141,84:ce,85:De,86:Le,87:We,88:Ne,89:je,90:$e,91:202,105:Ze,109:He,111:et,114:Pe,115:yt,116:Ie},t(Me,[2,101]),t(Me,[2,103]),t(Me,[2,104]),t(Me,[2,157]),t(Me,[2,158]),t(Me,[2,159]),t(Me,[2,160]),t(Me,[2,161]),t(Me,[2,162]),t(Me,[2,163]),t(Me,[2,164]),t(Me,[2,165]),t(Me,[2,166]),t(Me,[2,167]),t(Me,[2,90]),t(Me,[2,91]),t(Me,[2,92]),t(Me,[2,93]),t(Me,[2,94]),t(Me,[2,95]),t(Me,[2,96]),t(Me,[2,97]),t(Me,[2,98]),t(Me,[2,99]),t(Me,[2,100]),{6:11,7:12,8:o,9:s,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:C,109:k,111:E,113:42,114:_,115:P,116:L,121:R,122:D,123:M,124:I,125:N},{10:F,18:204},{44:[1,205]},t(Ee,[2,43]),{10:[1,206],44:g,60:m,89:A,102:S,105:T,106:C,109:k,111:E,113:113,114:_,115:P,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:C,109:k,111:E,113:113,114:_,115:P,116:L},{10:[1,211],44:g,60:m,89:A,102:S,105:T,106:C,109:k,111:E,113:113,114:_,115:P,116:L},{80:[1,212]},t(Gt,[2,109],{10:[1,213]}),t(Gt,[2,111],{10:[1,214]}),{80:[1,215]},t(It,[2,184]),{80:[1,216],98:[1,217]},t(Ee,[2,55],{113:113,44:g,60:m,89:A,102:S,105:T,106:C,109:k,111:E,114:_,115:P,116:L}),{31:[1,218],67:gt,82:219,116:Et,117:At,118:Mt},t(wt,[2,86]),t(wt,[2,88]),t(wt,[2,89]),t(wt,[2,153]),t(wt,[2,154]),t(wt,[2,155]),t(wt,[2,156]),{49:[1,220],67:gt,82:219,116:Et,117:At,118:Mt},{30:221,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{51:[1,222],67:gt,82:219,116:Et,117:At,118:Mt},{53:[1,223],67:gt,82:219,116:Et,117:At,118:Mt},{55:[1,224],67:gt,82:219,116:Et,117:At,118:Mt},{57:[1,225],67:gt,82:219,116:Et,117:At,118:Mt},{60:[1,226]},{64:[1,227],67:gt,82:219,116:Et,117:At,118:Mt},{66:[1,228],67:gt,82:219,116:Et,117:At,118:Mt},{30:229,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{31:[1,230],67:gt,82:219,116:Et,117:At,118:Mt},{67:gt,69:[1,231],71:[1,232],82:219,116:Et,117:At,118:Mt},{67:gt,69:[1,234],71:[1,233],82:219,116:Et,117:At,118:Mt},t(Q,[2,45],{18:156,10:F,40:ut}),t(Q,[2,47],{44:kt}),t(ge,[2,75]),t(ge,[2,74]),{62:[1,235],67:gt,82:219,116:Et,117:At,118:Mt},t(ge,[2,77]),t(qr,[2,80]),{77:[1,236],79:198,116:Oe,119:Be},{30:237,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},t(St,a,{5:238}),t(Me,[2,102]),t(B,[2,35]),{43:239,44:g,45:40,47:41,60:m,89:A,102:S,105:T,106:C,109:k,111:E,113:42,114:_,115:P,116:L},{10:F,18:240},{10:Tt,60:dr,84:jr,92:241,105:Ir,107:242,108:243,109:Zr,110:Ur,111:kn,112:$r},{10:Tt,60:dr,84:jr,92:252,104:[1,253],105:Ir,107:242,108:243,109:Zr,110:Ur,111:kn,112:$r},{10:Tt,60:dr,84:jr,92:254,104:[1,255],105:Ir,107:242,108:243,109:Zr,110:Ur,111:kn,112:$r},{105:[1,256]},{10:Tt,60:dr,84:jr,92:257,105:Ir,107:242,108:243,109:Zr,110:Ur,111:kn,112:$r},{44:g,47:258,60:m,89:A,102:S,105:T,106:C,109:k,111:E,113:42,114:_,115:P,116:L},t(Gt,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(Gt,[2,116]),t(Gt,[2,118],{10:[1,262]}),t(Gt,[2,119]),t(ue,[2,56]),t(wt,[2,87]),t(ue,[2,57]),{51:[1,263],67:gt,82:219,116:Et,117:At,118:Mt},t(ue,[2,64]),t(ue,[2,59]),t(ue,[2,60]),t(ue,[2,61]),{109:[1,264]},t(ue,[2,63]),t(ue,[2,65]),{66:[1,265],67:gt,82:219,116:Et,117:At,118:Mt},t(ue,[2,67]),t(ue,[2,68]),t(ue,[2,70]),t(ue,[2,69]),t(ue,[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:Et,117:At,118:Mt},{6:11,7:12,8:o,9:s,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:C,109:k,111:E,113:42,114:_,115:P,116:L,121:R,122:D,123:M,124:I,125:N},t(Ee,[2,53]),{43:268,44:g,45:40,47:41,60:m,89:A,102:S,105:T,106:C,109:k,111:E,113:42,114:_,115:P,116:L},t(Gt,[2,121],{106:dn}),t(ii,[2,130],{108:270,10:Tt,60:dr,84:jr,105:Ir,109:Zr,110:Ur,111:kn,112:$r}),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(Gt,[2,122],{106:dn}),{10:[1,271]},t(Gt,[2,123],{106:dn}),{10:[1,272]},t(at,[2,129]),t(Gt,[2,105],{106:dn}),t(Gt,[2,106],{113:113,44:g,60:m,89:A,102:S,105:T,106:C,109:k,111:E,114:_,115:P,116:L}),t(Gt,[2,110]),t(Gt,[2,112],{10:[1,273]}),t(Gt,[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(Ee,[2,52]),{10:Tt,60:dr,84:jr,105:Ir,107:279,108:243,109:Zr,110:Ur,111:kn,112:$r},t(pt,[2,133]),{14:q,44:Y,60:ne,89:X,101:280,105:J,106:ee,109:te,111:pe,114:ie,115:Ce,116:ke,120:88},{14:q,44:Y,60:ne,89:X,101:281,105:J,106:ee,109:te,111:pe,114:ie,115:Ce,116:ke,120:88},{98:[1,282]},t(Gt,[2,120]),t(ue,[2,58]),{30:283,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},t(ue,[2,66]),t(St,a,{5:284}),t(ii,[2,131],{108:270,10:Tt,60:dr,84:jr,105:Ir,109:Zr,110:Ur,111:kn,112:$r}),t(Gt,[2,126],{120:168,10:[1,285],14:q,44:Y,60:ne,89:X,105:J,106:ee,109:te,111:pe,114:ie,115:Ce,116:ke}),t(Gt,[2,127],{120:168,10:[1,286],14:q,44:Y,60:ne,89:X,105:J,106:ee,109:te,111:pe,114:ie,115:Ce,116:ke}),t(Gt,[2,114]),{31:[1,287],67:gt,82:219,116:Et,117:At,118:Mt},{6:11,7:12,8:o,9:s,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:C,109:k,111:E,113:42,114:_,115:P,116:L,121:R,122:D,123:M,124:I,125:N},{10:Tt,60:dr,84:jr,92:289,105:Ir,107:242,108:243,109:Zr,110:Ur,111:kn,112:$r},{10:Tt,60:dr,84:jr,92:290,105:Ir,107:242,108:243,109:Zr,110:Ur,111:kn,112:$r},t(ue,[2,62]),t(B,[2,33]),t(Gt,[2,124],{106:dn}),t(Gt,[2,125],{106:dn})],defaultActions:{},parseError:O(function(Rt,Ot){if(Ot.recoverable)this.trace(Rt);else{var Vt=new Error(Rt);throw Vt.hash=Ot,Vt}},"parseError"),parse:O(function(Rt){var Ot=this,Vt=[0],mt=[],Tr=[null],Fe=[],ta=this.table,Qe="",In=0,hi=0,Bo=2,Gn=1,fa=Fe.slice.call(arguments,1),di=Object.create(this.lexer),vu={yy:{}};for(var sm in this.yy)Object.prototype.hasOwnProperty.call(this.yy,sm)&&(vu.yy[sm]=this.yy[sm]);di.setInput(Rt,vu.yy),vu.yy.lexer=di,vu.yy.parser=this,typeof di.yylloc>"u"&&(di.yylloc={});var Ov=di.yylloc;Fe.push(Ov);var Sk=di.options&&di.options.ranges;typeof vu.yy.parseError=="function"?this.parseError=vu.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Tk(ar){Vt.length=Vt.length-2*ar,Tr.length=Tr.length-ar,Fe.length=Fe.length-ar}O(Tk,"popStack");function Ck(){var ar;return ar=mt.pop()||di.lex()||Gn,typeof ar!="number"&&(ar instanceof Array&&(mt=ar,ar=mt.pop()),ar=Ot.symbols_[ar]||ar),ar}O(Ck,"lex");for(var xl,gd,$c,Zs,Of={},Yw,Ht,Ve,ot;;){if(gd=Vt[Vt.length-1],this.defaultActions[gd]?$c=this.defaultActions[gd]:((xl===null||typeof xl>"u")&&(xl=Ck()),$c=ta[gd]&&ta[gd][xl]),typeof $c>"u"||!$c.length||!$c[0]){var Nt="";ot=[];for(Yw in ta[gd])this.terminals_[Yw]&&Yw>Bo&&ot.push("'"+this.terminals_[Yw]+"'");di.showPosition?Nt="Parse error on line "+(In+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;ye.info("addLink",e,r,i);for(const a of e)for(const o of r){const s=a===e[e.length-1],l=o===r[0];s&&l?this.addSingleLink(a,o,n,i):this.addSingleLink(a,o,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,o,s,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&&!((s=(o=this.edges[n])==null?void 0:o.style)!=null&&s.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(o=>{if(/color/.exec(o)){const s=o.replace("fill","bgFill");a.textStyles.push(s)}a.styles.push(o)})})}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(s=>s.id===n);a&&a.classes.push(r);const o=this.subGraphLookup.get(n);o&&o.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(Ye().securityLevel!=="loose"||r===void 0)return;let i=[];if(typeof n=="string"){i=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let o=0;o{const o=this.lookUpDomId(e),s=document.querySelector(`[id="${o}"]`);s!==null&&s.addEventListener("click",()=>{un.runFunc(r,...i)},!1)}))}setLink(e,r,n){e.split(",").forEach(i=>{const a=this.vertices.get(i);a!==void 0&&(a.link=un.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=KEe();_t(e).select("svg").selectAll("g.node").on("mouseover",a=>{var u;const o=_t(a.currentTarget),s=o.attr("title");if(s===null)return;const l=(u=a.currentTarget)==null?void 0:u.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(o.attr("title")).style("left",window.scrollX+l.left+(l.right-l.left)/2+"px").style("top",window.scrollY+l.bottom+"px"),r.html(qy.sanitize(s)),o.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),_t(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=Ye(),_a()}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 s=O(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=s.nodeList,u=s.dir,h=u!==void 0,d=Ye().flowchart??{},f=u??(d.inheritDir?this.getDirection()??Ye().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 s=this.indexNodes2(e,o);if(s.result)return{result:!0,count:a+s.count};a=a+s.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",o=n.length-1;n.startsWith("=")&&(a="thick"),n.startsWith("~")&&(a="invisible");const s=this.countChar(".",n);return s&&(a="dotted",o=s),{type:i,stroke:a,length:o}}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,o){var h;const s=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:s,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:o,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=Ye(),r=[],n=[],i=this.getSubGraphs(),a=new Map,o=new Map;for(let u=i.length-1;u>=0;u--){const h=i[u];h.nodes.length>0&&o.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,o,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:SR(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 $2t.flowchart}},O(nL,"FlowDB"),nL),i9n=O(function(t,e){return e.db.getClasses()},"getClasses"),a9n=O(async function(t,e,r,n,i){var f;ye.info("REF0:"),ye.info("Drawing state diagram (v2)",e);const{securityLevel:a,flowchart:o,layout:s}=Ye();n.db.setDiagramId(e),ye.debug("Before getData: ");const l=n.db.getData();ye.debug("Data: ",l);const u=m3(e,a),h=n.db.getDirection();l.type=n.type,l.layoutAlgorithm=u$(s),l.layoutAlgorithm==="dagre"&&s==="elk"&&ye.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=(o==null?void 0:o.nodeSpacing)||50,l.rankSpacing=(o==null?void 0:o.rankSpacing)||50,l.markers=["point","circle","cross"],l.diagramId=e,ye.debug("REF1:",l),await RR(l,u,i);const d=((f=l.config.flowchart)==null?void 0:f.diagramPadding)??8;un.insertTitle(u,"flowchartTitleText",(o==null?void 0:o.titleTopMargin)||0,n.db.getDiagramTitle()),nO(u,d,"flowchart",(o==null?void 0:o.useMaxWidth)||!1)},"draw"),o9n={getClasses:i9n,draw:a9n},a_e=function(){var t=O(function(Mn,Rt,Ot,Vt){for(Ot=Ot||{},Vt=Mn.length;Vt--;Ot[Mn[Vt]]=Rt);return Ot},"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],o=[1,13],s=[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],C=[1,48],k=[1,44],E=[1,51],_=[1,46],P=[1,52],L=[1,53],R=[1,34],D=[1,35],M=[1,36],I=[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],q=[1,92],Y=[1,97],ne=[1,96],X=[1,93],J=[1,89],ee=[1,95],te=[1,91],pe=[1,98],ie=[1,94],Ce=[1,99],ke=[1,90],Ee=[8,9,10,11,40,75,77,78],ue=[8,9,10,11,40,46,75,77,78],de=[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],xe=[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],ze=[1,122],we=[1,123],Oe=[1,125],Be=[1,124],Z=[44,60,62,74,89,102,105,106,109,111,114,115,116],le=[1,134],be=[1,148],ae=[1,149],K=[1,150],se=[1,151],me=[1,136],oe=[1,138],ve=[1,142],ce=[1,143],De=[1,144],Le=[1,145],We=[1,146],Ne=[1,147],je=[1,152],$e=[1,153],Ze=[1,132],He=[1,133],et=[1,140],Pe=[1,135],yt=[1,139],Ie=[1,137],St=[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],kt=[1,155],ut=[1,157],Gt=[8,9,11],It=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],gt=[1,177],Te=[1,173],Bt=[1,174],Et=[1,178],At=[1,175],Mt=[1,176],qr=[77,116,119],Me=[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],wt=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],Tt=[1,248],dr=[1,246],jr=[1,250],Ir=[1,244],Zr=[1,245],Ur=[1,247],kn=[1,249],$r=[1,251],dn=[1,269],ii=[8,9,11,106],pt=[8,9,10,11,60,84,105,106,109,110,111,112],Ct={trace:O(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:O(function(Rt,Ot,Vt,mt,Tr,Fe,ta){var Qe=Fe.length-1;switch(Tr){case 2:this.$=[];break;case 3:(!Array.isArray(Fe[Qe])||Fe[Qe].length>0)&&Fe[Qe-1].push(Fe[Qe]),this.$=Fe[Qe-1];break;case 4:case 183:this.$=Fe[Qe];break;case 11:mt.setDirection("TB"),this.$="TB";break;case 12:mt.setDirection(Fe[Qe-1]),this.$=Fe[Qe-1];break;case 27:this.$=Fe[Qe-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=mt.addSubGraph(Fe[Qe-6],Fe[Qe-1],Fe[Qe-4]);break;case 34:this.$=mt.addSubGraph(Fe[Qe-3],Fe[Qe-1],Fe[Qe-3]);break;case 35:this.$=mt.addSubGraph(void 0,Fe[Qe-1],void 0);break;case 37:this.$=Fe[Qe].trim(),mt.setAccTitle(this.$);break;case 38:case 39:this.$=Fe[Qe].trim(),mt.setAccDescription(this.$);break;case 43:this.$=Fe[Qe-1]+Fe[Qe];break;case 44:this.$=Fe[Qe];break;case 45:mt.addVertex(Fe[Qe-1][Fe[Qe-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Fe[Qe]),mt.addLink(Fe[Qe-3].stmt,Fe[Qe-1],Fe[Qe-2]),this.$={stmt:Fe[Qe-1],nodes:Fe[Qe-1].concat(Fe[Qe-3].nodes)};break;case 46:mt.addLink(Fe[Qe-2].stmt,Fe[Qe],Fe[Qe-1]),this.$={stmt:Fe[Qe],nodes:Fe[Qe].concat(Fe[Qe-2].nodes)};break;case 47:mt.addLink(Fe[Qe-3].stmt,Fe[Qe-1],Fe[Qe-2]),this.$={stmt:Fe[Qe-1],nodes:Fe[Qe-1].concat(Fe[Qe-3].nodes)};break;case 48:this.$={stmt:Fe[Qe-1],nodes:Fe[Qe-1]};break;case 49:mt.addVertex(Fe[Qe-1][Fe[Qe-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Fe[Qe]),this.$={stmt:Fe[Qe-1],nodes:Fe[Qe-1],shapeData:Fe[Qe]};break;case 50:this.$={stmt:Fe[Qe],nodes:Fe[Qe]};break;case 51:this.$=[Fe[Qe]];break;case 52:mt.addVertex(Fe[Qe-5][Fe[Qe-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,Fe[Qe-4]),this.$=Fe[Qe-5].concat(Fe[Qe]);break;case 53:this.$=Fe[Qe-4].concat(Fe[Qe]);break;case 54:this.$=Fe[Qe];break;case 55:this.$=Fe[Qe-2],mt.setClass(Fe[Qe-2],Fe[Qe]);break;case 56:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"square");break;case 57:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"doublecircle");break;case 58:this.$=Fe[Qe-5],mt.addVertex(Fe[Qe-5],Fe[Qe-2],"circle");break;case 59:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"ellipse");break;case 60:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"stadium");break;case 61:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"subroutine");break;case 62:this.$=Fe[Qe-7],mt.addVertex(Fe[Qe-7],Fe[Qe-1],"rect",void 0,void 0,void 0,Object.fromEntries([[Fe[Qe-5],Fe[Qe-3]]]));break;case 63:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"cylinder");break;case 64:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"round");break;case 65:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"diamond");break;case 66:this.$=Fe[Qe-5],mt.addVertex(Fe[Qe-5],Fe[Qe-2],"hexagon");break;case 67:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"odd");break;case 68:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"trapezoid");break;case 69:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"inv_trapezoid");break;case 70:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"lean_right");break;case 71:this.$=Fe[Qe-3],mt.addVertex(Fe[Qe-3],Fe[Qe-1],"lean_left");break;case 72:this.$=Fe[Qe],mt.addVertex(Fe[Qe]);break;case 73:Fe[Qe-1].text=Fe[Qe],this.$=Fe[Qe-1];break;case 74:case 75:Fe[Qe-2].text=Fe[Qe-1],this.$=Fe[Qe-2];break;case 76:this.$=Fe[Qe];break;case 77:var In=mt.destructLink(Fe[Qe],Fe[Qe-2]);this.$={type:In.type,stroke:In.stroke,length:In.length,text:Fe[Qe-1]};break;case 78:var In=mt.destructLink(Fe[Qe],Fe[Qe-2]);this.$={type:In.type,stroke:In.stroke,length:In.length,text:Fe[Qe-1],id:Fe[Qe-3]};break;case 79:this.$={text:Fe[Qe],type:"text"};break;case 80:this.$={text:Fe[Qe-1].text+""+Fe[Qe],type:Fe[Qe-1].type};break;case 81:this.$={text:Fe[Qe],type:"string"};break;case 82:this.$={text:Fe[Qe],type:"markdown"};break;case 83:var In=mt.destructLink(Fe[Qe]);this.$={type:In.type,stroke:In.stroke,length:In.length};break;case 84:var In=mt.destructLink(Fe[Qe]);this.$={type:In.type,stroke:In.stroke,length:In.length,id:Fe[Qe-1]};break;case 85:this.$=Fe[Qe-1];break;case 86:this.$={text:Fe[Qe],type:"text"};break;case 87:this.$={text:Fe[Qe-1].text+""+Fe[Qe],type:Fe[Qe-1].type};break;case 88:this.$={text:Fe[Qe],type:"string"};break;case 89:case 104:this.$={text:Fe[Qe],type:"markdown"};break;case 101:this.$={text:Fe[Qe],type:"text"};break;case 102:this.$={text:Fe[Qe-1].text+""+Fe[Qe],type:Fe[Qe-1].type};break;case 103:this.$={text:Fe[Qe],type:"text"};break;case 105:this.$=Fe[Qe-4],mt.addClass(Fe[Qe-2],Fe[Qe]);break;case 106:this.$=Fe[Qe-4],mt.setClass(Fe[Qe-2],Fe[Qe]);break;case 107:case 115:this.$=Fe[Qe-1],mt.setClickEvent(Fe[Qe-1],Fe[Qe]);break;case 108:case 116:this.$=Fe[Qe-3],mt.setClickEvent(Fe[Qe-3],Fe[Qe-2]),mt.setTooltip(Fe[Qe-3],Fe[Qe]);break;case 109:this.$=Fe[Qe-2],mt.setClickEvent(Fe[Qe-2],Fe[Qe-1],Fe[Qe]);break;case 110:this.$=Fe[Qe-4],mt.setClickEvent(Fe[Qe-4],Fe[Qe-3],Fe[Qe-2]),mt.setTooltip(Fe[Qe-4],Fe[Qe]);break;case 111:this.$=Fe[Qe-2],mt.setLink(Fe[Qe-2],Fe[Qe]);break;case 112:this.$=Fe[Qe-4],mt.setLink(Fe[Qe-4],Fe[Qe-2]),mt.setTooltip(Fe[Qe-4],Fe[Qe]);break;case 113:this.$=Fe[Qe-4],mt.setLink(Fe[Qe-4],Fe[Qe-2],Fe[Qe]);break;case 114:this.$=Fe[Qe-6],mt.setLink(Fe[Qe-6],Fe[Qe-4],Fe[Qe]),mt.setTooltip(Fe[Qe-6],Fe[Qe-2]);break;case 117:this.$=Fe[Qe-1],mt.setLink(Fe[Qe-1],Fe[Qe]);break;case 118:this.$=Fe[Qe-3],mt.setLink(Fe[Qe-3],Fe[Qe-2]),mt.setTooltip(Fe[Qe-3],Fe[Qe]);break;case 119:this.$=Fe[Qe-3],mt.setLink(Fe[Qe-3],Fe[Qe-2],Fe[Qe]);break;case 120:this.$=Fe[Qe-5],mt.setLink(Fe[Qe-5],Fe[Qe-4],Fe[Qe]),mt.setTooltip(Fe[Qe-5],Fe[Qe-2]);break;case 121:this.$=Fe[Qe-4],mt.addVertex(Fe[Qe-2],void 0,void 0,Fe[Qe]);break;case 122:this.$=Fe[Qe-4],mt.updateLink([Fe[Qe-2]],Fe[Qe]);break;case 123:this.$=Fe[Qe-4],mt.updateLink(Fe[Qe-2],Fe[Qe]);break;case 124:this.$=Fe[Qe-8],mt.updateLinkInterpolate([Fe[Qe-6]],Fe[Qe-2]),mt.updateLink([Fe[Qe-6]],Fe[Qe]);break;case 125:this.$=Fe[Qe-8],mt.updateLinkInterpolate(Fe[Qe-6],Fe[Qe-2]),mt.updateLink(Fe[Qe-6],Fe[Qe]);break;case 126:this.$=Fe[Qe-6],mt.updateLinkInterpolate([Fe[Qe-4]],Fe[Qe]);break;case 127:this.$=Fe[Qe-6],mt.updateLinkInterpolate(Fe[Qe-4],Fe[Qe]);break;case 128:case 130:this.$=[Fe[Qe]];break;case 129:case 131:Fe[Qe-2].push(Fe[Qe]),this.$=Fe[Qe-2];break;case 133:this.$=Fe[Qe-1]+Fe[Qe];break;case 181:this.$=Fe[Qe];break;case 182:this.$=Fe[Qe-1]+""+Fe[Qe];break;case 184:this.$=Fe[Qe-1]+""+Fe[Qe];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:o,9:s,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:C,109:k,111:E,113:42,114:_,115:P,116:L,121:R,122:D,123:M,124:I,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:q,44:Y,60:ne,80:[1,87],89:X,95:[1,84],97:[1,85],101:86,105:J,106:ee,109:te,111:pe,114:ie,115:Ce,116:ke,120:88},t(B,[2,185]),t(B,[2,186]),t(B,[2,187]),t(B,[2,188]),t(B,[2,189]),t(Ee,[2,51]),t(Ee,[2,54],{46:[1,100]}),t(ue,[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:C,109:k,111:E,114:_,115:P,116:L}),t(de,[2,181]),t(de,[2,142]),t(de,[2,143]),t(de,[2,144]),t(de,[2,145]),t(de,[2,146]),t(de,[2,147]),t(de,[2,148]),t(de,[2,149]),t(de,[2,150]),t(de,[2,151]),t(de,[2,152]),t(i,[2,12]),t(i,[2,18]),t(i,[2,19]),{9:[1,114]},t(xe,[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:C,109:k,111:E,113:42,114:_,115:P,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:ze,81:we,116:Oe,119:Be},{75:[1,126],77:[1,127]},t(Z,[2,83]),t(B,[2,28]),t(B,[2,29]),t(B,[2,30]),t(B,[2,31]),t(B,[2,32]),{10:le,12:be,14:ae,27:K,28:128,32:se,44:me,60:oe,75:ve,80:[1,130],81:[1,131],83:141,84:ce,85:De,86:Le,87:We,88:Ne,89:je,90:$e,91:129,105:Ze,109:He,111:et,114:Pe,115:yt,116:Ie},t(St,a,{5:154}),t(B,[2,37]),t(B,[2,38]),t(Q,[2,48],{44:kt}),t(Q,[2,49],{18:156,10:F,40:ut}),t(Ee,[2,44]),{44:g,47:158,60:m,89:A,102:S,105:T,106:C,109:k,111:E,113:42,114:_,115:P,116:L},{102:[1,159],103:160,105:[1,161]},{44:g,47:162,60:m,89:A,102:S,105:T,106:C,109:k,111:E,113:42,114:_,115:P,116:L},{44:g,47:163,60:m,89:A,102:S,105:T,106:C,109:k,111:E,113:42,114:_,115:P,116:L},t(Gt,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(Gt,[2,115],{120:168,10:[1,167],14:q,44:Y,60:ne,89:X,105:J,106:ee,109:te,111:pe,114:ie,115:Ce,116:ke}),t(Gt,[2,117],{10:[1,169]}),t(It,[2,183]),t(It,[2,170]),t(It,[2,171]),t(It,[2,172]),t(It,[2,173]),t(It,[2,174]),t(It,[2,175]),t(It,[2,176]),t(It,[2,177]),t(It,[2,178]),t(It,[2,179]),t(It,[2,180]),{44:g,47:170,60:m,89:A,102:S,105:T,106:C,109:k,111:E,113:42,114:_,115:P,116:L},{30:171,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{30:179,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{30:181,50:[1,180],67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{30:182,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{30:183,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{30:184,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{109:[1,185]},{30:186,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{30:187,65:[1,188],67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{30:189,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{30:190,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{30:191,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},t(de,[2,182]),t(i,[2,20]),t(xe,[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:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{77:[1,197],79:198,116:Oe,119:Be},t(qr,[2,79]),t(qr,[2,81]),t(qr,[2,82]),t(qr,[2,168]),t(qr,[2,169]),{76:199,79:121,80:ze,81:we,116:Oe,119:Be},t(Z,[2,84]),{8:V,9:z,10:le,11:U,12:be,14:ae,21:201,27:K,29:[1,200],32:se,44:me,60:oe,75:ve,83:141,84:ce,85:De,86:Le,87:We,88:Ne,89:je,90:$e,91:202,105:Ze,109:He,111:et,114:Pe,115:yt,116:Ie},t(Me,[2,101]),t(Me,[2,103]),t(Me,[2,104]),t(Me,[2,157]),t(Me,[2,158]),t(Me,[2,159]),t(Me,[2,160]),t(Me,[2,161]),t(Me,[2,162]),t(Me,[2,163]),t(Me,[2,164]),t(Me,[2,165]),t(Me,[2,166]),t(Me,[2,167]),t(Me,[2,90]),t(Me,[2,91]),t(Me,[2,92]),t(Me,[2,93]),t(Me,[2,94]),t(Me,[2,95]),t(Me,[2,96]),t(Me,[2,97]),t(Me,[2,98]),t(Me,[2,99]),t(Me,[2,100]),{6:11,7:12,8:o,9:s,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:C,109:k,111:E,113:42,114:_,115:P,116:L,121:R,122:D,123:M,124:I,125:N},{10:F,18:204},{44:[1,205]},t(Ee,[2,43]),{10:[1,206],44:g,60:m,89:A,102:S,105:T,106:C,109:k,111:E,113:113,114:_,115:P,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:C,109:k,111:E,113:113,114:_,115:P,116:L},{10:[1,211],44:g,60:m,89:A,102:S,105:T,106:C,109:k,111:E,113:113,114:_,115:P,116:L},{80:[1,212]},t(Gt,[2,109],{10:[1,213]}),t(Gt,[2,111],{10:[1,214]}),{80:[1,215]},t(It,[2,184]),{80:[1,216],98:[1,217]},t(Ee,[2,55],{113:113,44:g,60:m,89:A,102:S,105:T,106:C,109:k,111:E,114:_,115:P,116:L}),{31:[1,218],67:gt,82:219,116:Et,117:At,118:Mt},t(wt,[2,86]),t(wt,[2,88]),t(wt,[2,89]),t(wt,[2,153]),t(wt,[2,154]),t(wt,[2,155]),t(wt,[2,156]),{49:[1,220],67:gt,82:219,116:Et,117:At,118:Mt},{30:221,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{51:[1,222],67:gt,82:219,116:Et,117:At,118:Mt},{53:[1,223],67:gt,82:219,116:Et,117:At,118:Mt},{55:[1,224],67:gt,82:219,116:Et,117:At,118:Mt},{57:[1,225],67:gt,82:219,116:Et,117:At,118:Mt},{60:[1,226]},{64:[1,227],67:gt,82:219,116:Et,117:At,118:Mt},{66:[1,228],67:gt,82:219,116:Et,117:At,118:Mt},{30:229,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},{31:[1,230],67:gt,82:219,116:Et,117:At,118:Mt},{67:gt,69:[1,231],71:[1,232],82:219,116:Et,117:At,118:Mt},{67:gt,69:[1,234],71:[1,233],82:219,116:Et,117:At,118:Mt},t(Q,[2,45],{18:156,10:F,40:ut}),t(Q,[2,47],{44:kt}),t(ge,[2,75]),t(ge,[2,74]),{62:[1,235],67:gt,82:219,116:Et,117:At,118:Mt},t(ge,[2,77]),t(qr,[2,80]),{77:[1,236],79:198,116:Oe,119:Be},{30:237,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},t(St,a,{5:238}),t(Me,[2,102]),t(B,[2,35]),{43:239,44:g,45:40,47:41,60:m,89:A,102:S,105:T,106:C,109:k,111:E,113:42,114:_,115:P,116:L},{10:F,18:240},{10:Tt,60:dr,84:jr,92:241,105:Ir,107:242,108:243,109:Zr,110:Ur,111:kn,112:$r},{10:Tt,60:dr,84:jr,92:252,104:[1,253],105:Ir,107:242,108:243,109:Zr,110:Ur,111:kn,112:$r},{10:Tt,60:dr,84:jr,92:254,104:[1,255],105:Ir,107:242,108:243,109:Zr,110:Ur,111:kn,112:$r},{105:[1,256]},{10:Tt,60:dr,84:jr,92:257,105:Ir,107:242,108:243,109:Zr,110:Ur,111:kn,112:$r},{44:g,47:258,60:m,89:A,102:S,105:T,106:C,109:k,111:E,113:42,114:_,115:P,116:L},t(Gt,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(Gt,[2,116]),t(Gt,[2,118],{10:[1,262]}),t(Gt,[2,119]),t(ue,[2,56]),t(wt,[2,87]),t(ue,[2,57]),{51:[1,263],67:gt,82:219,116:Et,117:At,118:Mt},t(ue,[2,64]),t(ue,[2,59]),t(ue,[2,60]),t(ue,[2,61]),{109:[1,264]},t(ue,[2,63]),t(ue,[2,65]),{66:[1,265],67:gt,82:219,116:Et,117:At,118:Mt},t(ue,[2,67]),t(ue,[2,68]),t(ue,[2,70]),t(ue,[2,69]),t(ue,[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:Et,117:At,118:Mt},{6:11,7:12,8:o,9:s,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:C,109:k,111:E,113:42,114:_,115:P,116:L,121:R,122:D,123:M,124:I,125:N},t(Ee,[2,53]),{43:268,44:g,45:40,47:41,60:m,89:A,102:S,105:T,106:C,109:k,111:E,113:42,114:_,115:P,116:L},t(Gt,[2,121],{106:dn}),t(ii,[2,130],{108:270,10:Tt,60:dr,84:jr,105:Ir,109:Zr,110:Ur,111:kn,112:$r}),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(Gt,[2,122],{106:dn}),{10:[1,271]},t(Gt,[2,123],{106:dn}),{10:[1,272]},t(at,[2,129]),t(Gt,[2,105],{106:dn}),t(Gt,[2,106],{113:113,44:g,60:m,89:A,102:S,105:T,106:C,109:k,111:E,114:_,115:P,116:L}),t(Gt,[2,110]),t(Gt,[2,112],{10:[1,273]}),t(Gt,[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(Ee,[2,52]),{10:Tt,60:dr,84:jr,105:Ir,107:279,108:243,109:Zr,110:Ur,111:kn,112:$r},t(pt,[2,133]),{14:q,44:Y,60:ne,89:X,101:280,105:J,106:ee,109:te,111:pe,114:ie,115:Ce,116:ke,120:88},{14:q,44:Y,60:ne,89:X,101:281,105:J,106:ee,109:te,111:pe,114:ie,115:Ce,116:ke,120:88},{98:[1,282]},t(Gt,[2,120]),t(ue,[2,58]),{30:283,67:gt,80:Te,81:Bt,82:172,116:Et,117:At,118:Mt},t(ue,[2,66]),t(St,a,{5:284}),t(ii,[2,131],{108:270,10:Tt,60:dr,84:jr,105:Ir,109:Zr,110:Ur,111:kn,112:$r}),t(Gt,[2,126],{120:168,10:[1,285],14:q,44:Y,60:ne,89:X,105:J,106:ee,109:te,111:pe,114:ie,115:Ce,116:ke}),t(Gt,[2,127],{120:168,10:[1,286],14:q,44:Y,60:ne,89:X,105:J,106:ee,109:te,111:pe,114:ie,115:Ce,116:ke}),t(Gt,[2,114]),{31:[1,287],67:gt,82:219,116:Et,117:At,118:Mt},{6:11,7:12,8:o,9:s,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:C,109:k,111:E,113:42,114:_,115:P,116:L,121:R,122:D,123:M,124:I,125:N},{10:Tt,60:dr,84:jr,92:289,105:Ir,107:242,108:243,109:Zr,110:Ur,111:kn,112:$r},{10:Tt,60:dr,84:jr,92:290,105:Ir,107:242,108:243,109:Zr,110:Ur,111:kn,112:$r},t(ue,[2,62]),t(B,[2,33]),t(Gt,[2,124],{106:dn}),t(Gt,[2,125],{106:dn})],defaultActions:{},parseError:O(function(Rt,Ot){if(Ot.recoverable)this.trace(Rt);else{var Vt=new Error(Rt);throw Vt.hash=Ot,Vt}},"parseError"),parse:O(function(Rt){var Ot=this,Vt=[0],mt=[],Tr=[null],Fe=[],ta=this.table,Qe="",In=0,hi=0,Bo=2,Gn=1,fa=Fe.slice.call(arguments,1),di=Object.create(this.lexer),vu={yy:{}};for(var sm in this.yy)Object.prototype.hasOwnProperty.call(this.yy,sm)&&(vu.yy[sm]=this.yy[sm]);di.setInput(Rt,vu.yy),vu.yy.lexer=di,vu.yy.parser=this,typeof di.yylloc>"u"&&(di.yylloc={});var Ov=di.yylloc;Fe.push(Ov);var Sk=di.options&&di.options.ranges;typeof vu.yy.parseError=="function"?this.parseError=vu.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Tk(ar){Vt.length=Vt.length-2*ar,Tr.length=Tr.length-ar,Fe.length=Fe.length-ar}O(Tk,"popStack");function Ck(){var ar;return ar=mt.pop()||di.lex()||Gn,typeof ar!="number"&&(ar instanceof Array&&(mt=ar,ar=mt.pop()),ar=Ot.symbols_[ar]||ar),ar}O(Ck,"lex");for(var xl,gd,$c,Zs,Of={},Yw,Ht,Ve,ot;;){if(gd=Vt[Vt.length-1],this.defaultActions[gd]?$c=this.defaultActions[gd]:((xl===null||typeof xl>"u")&&(xl=Ck()),$c=ta[gd]&&ta[gd][xl]),typeof $c>"u"||!$c.length||!$c[0]){var Nt="";ot=[];for(Yw in ta[gd])this.terminals_[Yw]&&Yw>Bo&&ot.push("'"+this.terminals_[Yw]+"'");di.showPosition?Nt="Parse error on line "+(In+1)+`: `+di.showPosition()+` Expecting `+ot.join(", ")+", got '"+(this.terminals_[xl]||xl)+"'":Nt="Parse error on line "+(In+1)+": Unexpected "+(xl==Gn?"end of input":"'"+(this.terminals_[xl]||xl)+"'"),this.parseError(Nt,{text:di.match,token:this.terminals_[xl]||xl,line:di.yylineno,loc:Ov,expected:ot})}if($c[0]instanceof Array&&$c.length>1)throw new Error("Parse Error: multiple actions possible at state: "+gd+", token: "+xl);switch($c[0]){case 1:Vt.push(xl),Tr.push(di.yytext),Fe.push(di.yylloc),Vt.push($c[1]),xl=null,hi=di.yyleng,Qe=di.yytext,In=di.yylineno,Ov=di.yylloc;break;case 2:if(Ht=this.productions_[$c[1]][1],Of.$=Tr[Tr.length-Ht],Of._$={first_line:Fe[Fe.length-(Ht||1)].first_line,last_line:Fe[Fe.length-1].last_line,first_column:Fe[Fe.length-(Ht||1)].first_column,last_column:Fe[Fe.length-1].last_column},Sk&&(Of._$.range=[Fe[Fe.length-(Ht||1)].range[0],Fe[Fe.length-1].range[1]]),Zs=this.performAction.apply(Of,[Qe,hi,In,vu.yy,$c[1],Tr,Fe].concat(fa)),typeof Zs<"u")return Zs;Ht&&(Vt=Vt.slice(0,-1*Ht*2),Tr=Tr.slice(0,-1*Ht),Fe=Fe.slice(0,-1*Ht)),Vt.push(this.productions_[$c[1]][0]),Tr.push(Of.$),Fe.push(Of._$),Ve=ta[Vt[Vt.length-2]][Vt[Vt.length-1]],Vt.push(Ve);break;case 3:return!0}}return!0},"parse")},or=function(){var Mn={EOF:1,parseError:O(function(Ot,Vt){if(this.yy.parser)this.yy.parser.parseError(Ot,Vt);else throw new Error(Ot)},"parseError"),setInput:O(function(Rt,Ot){return this.yy=Ot||this.yy||{},this._input=Rt,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:O(function(){var Rt=this._input[0];this.yytext+=Rt,this.yyleng++,this.offset++,this.match+=Rt,this.matched+=Rt;var Ot=Rt.match(/(?:\r\n?|\n).*/g);return Ot?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),Rt},"input"),unput:O(function(Rt){var Ot=Rt.length,Vt=Rt.split(/(?:\r\n?|\n)/g);this._input=Rt+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ot),this.offset-=Ot;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-Ot},this.options.ranges&&(this.yylloc.range=[Tr[0],Tr[0]+this.yyleng-Ot]),this.yyleng=this.yytext.length,this},"unput"),more:O(function(){return this._more=!0,this},"more"),reject:O(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:O(function(Rt){this.unput(this.match.slice(Rt))},"less"),pastInput:O(function(){var Rt=this.matched.substr(0,this.matched.length-this.match.length);return(Rt.length>20?"...":"")+Rt.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:O(function(){var Rt=this.match;return Rt.length<20&&(Rt+=this._input.substr(0,20-Rt.length)),(Rt.substr(0,20)+(Rt.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:O(function(){var Rt=this.pastInput(),Ot=new Array(Rt.length+1).join("-");return Rt+this.upcomingInput()+` `+Ot+"^"},"showPosition"),test_match:O(function(Rt,Ot){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=Rt[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+Rt[0].length},this.yytext+=Rt[0],this.match+=Rt[0],this.matches=Rt,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(Rt[0].length),this.matched+=Rt[0],Vt=this.performAction.call(this,this.yy,this,Ot,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Vt)return Vt;if(this._backtrack){for(var Fe in Tr)this[Fe]=Tr[Fe];return!1}return!1},"test_match"),next:O(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var Rt,Ot,Vt,mt;this._more||(this.yytext="",this.match="");for(var Tr=this._currentRules(),Fe=0;FeOt[0].length)){if(Ot=Vt,mt=Fe,this.options.backtrack_lexer){if(Rt=this.test_match(Vt,Tr[Fe]),Rt!==!1)return Rt;if(this._backtrack){Ot=!1;continue}else return!1}else if(!this.options.flex)break}return Ot?(Rt=this.test_match(Ot,Tr[mt]),Rt!==!1?Rt:!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:O(function(){var Ot=this.next();return Ot||this.lex()},"lex"),begin:O(function(Ot){this.conditionStack.push(Ot)},"begin"),popState:O(function(){var Ot=this.conditionStack.length-1;return Ot>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(Ot){return Ot=this.conditionStack.length-1-Math.abs(Ot||0),Ot>=0?this.conditionStack[Ot]:"INITIAL"},"topState"),pushState:O(function(Ot){this.begin(Ot)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:O(function(Ot,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 Fe=/\n\s*/g;return Vt.yytext=Vt.yytext.replace(Fe,"
"),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 Ot.lex.firstGraph()&&this.begin("dir"),12;case 36:return Ot.lex.firstGraph()&&this.begin("dir"),12;case 37:return Ot.lex.firstGraph()&&this.begin("dir"),12;case 38:return Ot.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 Mn}();Ct.lexer=or;function Jr(){this.yy={}}return O(Jr,"Parser"),Jr.prototype=Ct,Ct.Parser=Jr,new Jr}();a_e.parser=a_e;var Hzt=a_e,Wzt=Object.assign({},Hzt);Wzt.parse=t=>{const e=t.replace(/}\s*\n/g,`} -`);return Hzt.parse(e)};var a9n=Wzt,o9n=O((t,e)=>{const r=x1e,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Ag(n,i,a,e)},"fade"),s9n=O(t=>`.label { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:O(function(){var Ot=this.next();return Ot||this.lex()},"lex"),begin:O(function(Ot){this.conditionStack.push(Ot)},"begin"),popState:O(function(){var Ot=this.conditionStack.length-1;return Ot>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(Ot){return Ot=this.conditionStack.length-1-Math.abs(Ot||0),Ot>=0?this.conditionStack[Ot]:"INITIAL"},"topState"),pushState:O(function(Ot){this.begin(Ot)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:O(function(Ot,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 Fe=/\n\s*/g;return Vt.yytext=Vt.yytext.replace(Fe,"
"),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 Ot.lex.firstGraph()&&this.begin("dir"),12;case 36:return Ot.lex.firstGraph()&&this.begin("dir"),12;case 37:return Ot.lex.firstGraph()&&this.begin("dir"),12;case 38:return Ot.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 Mn}();Ct.lexer=or;function Jr(){this.yy={}}return O(Jr,"Parser"),Jr.prototype=Ct,Ct.Parser=Jr,new Jr}();a_e.parser=a_e;var Yzt=a_e,qzt=Object.assign({},Yzt);qzt.parse=t=>{const e=t.replace(/}\s*\n/g,`} +`);return Yzt.parse(e)};var s9n=qzt,l9n=O((t,e)=>{const r=x1e,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Ag(n,i,a,e)},"fade"),c9n=O(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } @@ -1436,7 +1436,7 @@ Expecting `+ot.join(", ")+", got '"+(this.terminals_[xl]||xl)+"'":Nt="Parse erro /* For html labels only */ .labelBkg { - background-color: ${o9n(t.edgeLabelBackground,.5)}; + background-color: ${l9n(t.edgeLabelBackground,.5)}; // background-color: } @@ -1496,19 +1496,19 @@ Expecting `+ot.join(", ")+", got '"+(this.terminals_[xl]||xl)+"'":Nt="Parse erro text-align: center; } ${T9()} -`,"getStyles"),Yzt=s9n,o_e=O(({defaultLayout:t,styles:e=Yzt}={})=>({parser:a9n,get db(){return new t9n},renderer:i9n,styles:e,init:O(r=>{r.flowchart||(r.flowchart={});const n=O2t().layout??t??r.layout;n&&U1e({layout:n}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,U1e({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),l9n=o_e();const s_e=Object.freeze(Object.defineProperty({__proto__:null,createFlowDiagram:o_e,diagram:l9n},Symbol.toStringTag,{value:"Module"}));var c9n=O(t=>`${Yzt(t)} +`,"getStyles"),jzt=c9n,o_e=O(({defaultLayout:t,styles:e=jzt}={})=>({parser:s9n,get db(){return new n9n},renderer:o9n,styles:e,init:O(r=>{r.flowchart||(r.flowchart={});const n=E2t().layout??t??r.layout;n&&U1e({layout:n}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,U1e({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}})},"init")}),"createFlowDiagram"),u9n=o_e();const s_e=Object.freeze(Object.defineProperty({__proto__:null,createFlowDiagram:o_e,diagram:u9n},Symbol.toStringTag,{value:"Module"}));var h9n=O(t=>`${jzt(t)} .swimlane.cluster rect { stroke: ${t.clusterBorder} !important; } [data-look="neo"].cluster rect { filter: none; } -`,"getStyles"),u9n=c9n,h9n=o_e({defaultLayout:"swimlane",styles:u9n});const d9n=Object.freeze(Object.defineProperty({__proto__:null,diagram:h9n},Symbol.toStringTag,{value:"Module"}));var l_e=function(){var t=O(function(Ce,ke,Ee,ue){for(Ee=Ee||{},ue=Ce.length;ue--;Ee[Ce[ue]]=ke);return Ee},"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],o=[1,23],s=[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],C=[1,45],k=[1,46],E=[1,55],_=[40,48,50,51,52,71,72],P=[1,66],L=[1,64],R=[1,61],D=[1,65],M=[1,67],I=[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],q=[1,92],Y=[1,91],ne=[19,58],X=[1,102],J=[1,101],ee=[19,58,61,63],te={trace:O(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:O(function(ke,Ee,ue,de,xe,ge,ze){var we=ge.length-1;switch(xe){case 1:break;case 2:this.$=[];break;case 3:ge[we-1].push(ge[we]),this.$=ge[we-1];break;case 4:case 5:this.$=ge[we];break;case 6:case 7:this.$=[];break;case 8:de.addEntity(ge[we-4]),de.addEntity(ge[we-2]),de.addRelationship(ge[we-4],ge[we],ge[we-2],ge[we-3]);break;case 9:de.addEntity(ge[we-8]),de.addEntity(ge[we-4]),de.addRelationship(ge[we-8],ge[we],ge[we-4],ge[we-5]),de.setClass([ge[we-8]],ge[we-6]),de.setClass([ge[we-4]],ge[we-2]);break;case 10:de.addEntity(ge[we-6]),de.addEntity(ge[we-2]),de.addRelationship(ge[we-6],ge[we],ge[we-2],ge[we-3]),de.setClass([ge[we-6]],ge[we-4]);break;case 11:de.addEntity(ge[we-6]),de.addEntity(ge[we-4]),de.addRelationship(ge[we-6],ge[we],ge[we-4],ge[we-5]),de.setClass([ge[we-4]],ge[we-2]);break;case 12:de.addEntity(ge[we-3]),de.addAttributes(ge[we-3],ge[we-1]);break;case 13:de.addEntity(ge[we-5]),de.addAttributes(ge[we-5],ge[we-1]),de.setClass([ge[we-5]],ge[we-3]);break;case 14:de.addEntity(ge[we-2]);break;case 15:de.addEntity(ge[we-4]),de.setClass([ge[we-4]],ge[we-2]);break;case 16:de.addEntity(ge[we]);break;case 17:de.addEntity(ge[we-2]),de.setClass([ge[we-2]],ge[we]);break;case 18:de.addEntity(ge[we-6],ge[we-4]),de.addAttributes(ge[we-6],ge[we-1]);break;case 19:de.addEntity(ge[we-8],ge[we-6]),de.addAttributes(ge[we-8],ge[we-1]),de.setClass([ge[we-8]],ge[we-3]);break;case 20:de.addEntity(ge[we-5],ge[we-3]);break;case 21:de.addEntity(ge[we-7],ge[we-5]),de.setClass([ge[we-7]],ge[we-2]);break;case 22:de.addEntity(ge[we-3],ge[we-1]);break;case 23:de.addEntity(ge[we-5],ge[we-3]),de.setClass([ge[we-5]],ge[we]);break;case 24:case 25:this.$=ge[we].trim(),de.setAccTitle(this.$);break;case 26:case 27:this.$=ge[we].trim(),de.setAccDescription(this.$);break;case 32:de.setDirection("TB");break;case 33:de.setDirection("BT");break;case 34:de.setDirection("RL");break;case 35:de.setDirection("LR");break;case 36:this.$=ge[we-3],de.addClass(ge[we-2],ge[we-1]);break;case 37:case 38:case 59:case 68:this.$=[ge[we]];break;case 39:case 40:this.$=ge[we-2].concat([ge[we]]);break;case 41:this.$=ge[we-2],de.setClass(ge[we-1],ge[we]);break;case 42:this.$=ge[we-3],de.addCssStyles(ge[we-2],ge[we-1]);break;case 43:this.$=[ge[we]];break;case 44:ge[we-2].push(ge[we]),this.$=ge[we-2];break;case 46:this.$=ge[we-1]+ge[we];break;case 54:case 80:case 81:this.$=ge[we].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=ge[we];break;case 60:ge[we].push(ge[we-1]),this.$=ge[we];break;case 61:this.$={type:ge[we-1],name:ge[we]};break;case 62:this.$={type:ge[we-2],name:ge[we-1],keys:ge[we]};break;case 63:this.$={type:ge[we-2],name:ge[we-1],comment:ge[we]};break;case 64:this.$={type:ge[we-3],name:ge[we-2],keys:ge[we-1],comment:ge[we]};break;case 65:case 67:case 70:this.$=ge[we];break;case 66:this.$=ge[we-1]+ge[we];break;case 69:ge[we-2].push(ge[we]),this.$=ge[we-2];break;case 71:this.$=ge[we].replace(/"/g,"");break;case 72:this.$={cardA:ge[we],relType:ge[we-1],cardB:ge[we-2]};break;case 73:this.$=de.Cardinality.ZERO_OR_ONE;break;case 74:this.$=de.Cardinality.ZERO_OR_MORE;break;case 75:this.$=de.Cardinality.ONE_OR_MORE;break;case 76:this.$=de.Cardinality.ONLY_ONE;break;case 77:this.$=de.Cardinality.MD_PARENT;break;case 78:this.$=de.Identification.NON_IDENTIFYING;break;case 79:this.$=de.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:o,34:s,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:o,34:s,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:C,41:k},{16:47,40:C,41:k},{16:48,40:C,41:k},t(e,[2,4]),{11:49,40:d,48:g,50:m,51:v,52:y},{16:50,40:C,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:P,38:60,41:L,42:R,45:62,46:63,48:D,49:M},t(I,[2,37]),t(I,[2,38]),{16:68,40:C,41:k,42:R},{13:P,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:P,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:q,73:Y},{16:94,40:C,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(ne,[2,61],{56:98,57:99,60:100,62:X,63:J}),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:P,41:L,45:105,46:63,48:D,49:M},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(I,[2,39]),t(I,[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(ne,[2,62],{57:110,61:[1,111],63:J}),t(ne,[2,63]),t(ee,[2,68]),t(ne,[2,71]),t(ee,[2,70]),{18:112,19:[1,113],53:53,54:54,58:E},{16:114,40:C,41:k},t(U,[2,44],{46:88,13:P,41:L,48:D,49:M}),{14:115,40:G,50:q,73:Y},{16:116,40:C,41:k},{14:117,40:G,50:q,73:Y},t(e,[2,13]),t(ne,[2,64]),{60:118,62:X},{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:q,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:O(function(ke,Ee){if(Ee.recoverable)this.trace(ke);else{var ue=new Error(ke);throw ue.hash=Ee,ue}},"parseError"),parse:O(function(ke){var Ee=this,ue=[0],de=[],xe=[null],ge=[],ze=this.table,we="",Oe=0,Be=0,Z=2,le=1,be=ge.slice.call(arguments,1),ae=Object.create(this.lexer),K={yy:{}};for(var se in this.yy)Object.prototype.hasOwnProperty.call(this.yy,se)&&(K.yy[se]=this.yy[se]);ae.setInput(ke,K.yy),K.yy.lexer=ae,K.yy.parser=this,typeof ae.yylloc>"u"&&(ae.yylloc={});var me=ae.yylloc;ge.push(me);var oe=ae.options&&ae.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ve(yt){ue.length=ue.length-2*yt,xe.length=xe.length-yt,ge.length=ge.length-yt}O(ve,"popStack");function ce(){var yt;return yt=de.pop()||ae.lex()||le,typeof yt!="number"&&(yt instanceof Array&&(de=yt,yt=de.pop()),yt=Ee.symbols_[yt]||yt),yt}O(ce,"lex");for(var De,Le,We,Ne,je={},$e,Ze,He,et;;){if(Le=ue[ue.length-1],this.defaultActions[Le]?We=this.defaultActions[Le]:((De===null||typeof De>"u")&&(De=ce()),We=ze[Le]&&ze[Le][De]),typeof We>"u"||!We.length||!We[0]){var Pe="";et=[];for($e in ze[Le])this.terminals_[$e]&&$e>Z&&et.push("'"+this.terminals_[$e]+"'");ae.showPosition?Pe="Parse error on line "+(Oe+1)+`: +`,"getStyles"),d9n=h9n,f9n=o_e({defaultLayout:"swimlane",styles:d9n});const p9n=Object.freeze(Object.defineProperty({__proto__:null,diagram:f9n},Symbol.toStringTag,{value:"Module"}));var l_e=function(){var t=O(function(Ce,ke,Ee,ue){for(Ee=Ee||{},ue=Ce.length;ue--;Ee[Ce[ue]]=ke);return Ee},"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],o=[1,23],s=[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],C=[1,45],k=[1,46],E=[1,55],_=[40,48,50,51,52,71,72],P=[1,66],L=[1,64],R=[1,61],D=[1,65],M=[1,67],I=[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],q=[1,92],Y=[1,91],ne=[19,58],X=[1,102],J=[1,101],ee=[19,58,61,63],te={trace:O(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:O(function(ke,Ee,ue,de,xe,ge,ze){var we=ge.length-1;switch(xe){case 1:break;case 2:this.$=[];break;case 3:ge[we-1].push(ge[we]),this.$=ge[we-1];break;case 4:case 5:this.$=ge[we];break;case 6:case 7:this.$=[];break;case 8:de.addEntity(ge[we-4]),de.addEntity(ge[we-2]),de.addRelationship(ge[we-4],ge[we],ge[we-2],ge[we-3]);break;case 9:de.addEntity(ge[we-8]),de.addEntity(ge[we-4]),de.addRelationship(ge[we-8],ge[we],ge[we-4],ge[we-5]),de.setClass([ge[we-8]],ge[we-6]),de.setClass([ge[we-4]],ge[we-2]);break;case 10:de.addEntity(ge[we-6]),de.addEntity(ge[we-2]),de.addRelationship(ge[we-6],ge[we],ge[we-2],ge[we-3]),de.setClass([ge[we-6]],ge[we-4]);break;case 11:de.addEntity(ge[we-6]),de.addEntity(ge[we-4]),de.addRelationship(ge[we-6],ge[we],ge[we-4],ge[we-5]),de.setClass([ge[we-4]],ge[we-2]);break;case 12:de.addEntity(ge[we-3]),de.addAttributes(ge[we-3],ge[we-1]);break;case 13:de.addEntity(ge[we-5]),de.addAttributes(ge[we-5],ge[we-1]),de.setClass([ge[we-5]],ge[we-3]);break;case 14:de.addEntity(ge[we-2]);break;case 15:de.addEntity(ge[we-4]),de.setClass([ge[we-4]],ge[we-2]);break;case 16:de.addEntity(ge[we]);break;case 17:de.addEntity(ge[we-2]),de.setClass([ge[we-2]],ge[we]);break;case 18:de.addEntity(ge[we-6],ge[we-4]),de.addAttributes(ge[we-6],ge[we-1]);break;case 19:de.addEntity(ge[we-8],ge[we-6]),de.addAttributes(ge[we-8],ge[we-1]),de.setClass([ge[we-8]],ge[we-3]);break;case 20:de.addEntity(ge[we-5],ge[we-3]);break;case 21:de.addEntity(ge[we-7],ge[we-5]),de.setClass([ge[we-7]],ge[we-2]);break;case 22:de.addEntity(ge[we-3],ge[we-1]);break;case 23:de.addEntity(ge[we-5],ge[we-3]),de.setClass([ge[we-5]],ge[we]);break;case 24:case 25:this.$=ge[we].trim(),de.setAccTitle(this.$);break;case 26:case 27:this.$=ge[we].trim(),de.setAccDescription(this.$);break;case 32:de.setDirection("TB");break;case 33:de.setDirection("BT");break;case 34:de.setDirection("RL");break;case 35:de.setDirection("LR");break;case 36:this.$=ge[we-3],de.addClass(ge[we-2],ge[we-1]);break;case 37:case 38:case 59:case 68:this.$=[ge[we]];break;case 39:case 40:this.$=ge[we-2].concat([ge[we]]);break;case 41:this.$=ge[we-2],de.setClass(ge[we-1],ge[we]);break;case 42:this.$=ge[we-3],de.addCssStyles(ge[we-2],ge[we-1]);break;case 43:this.$=[ge[we]];break;case 44:ge[we-2].push(ge[we]),this.$=ge[we-2];break;case 46:this.$=ge[we-1]+ge[we];break;case 54:case 80:case 81:this.$=ge[we].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=ge[we];break;case 60:ge[we].push(ge[we-1]),this.$=ge[we];break;case 61:this.$={type:ge[we-1],name:ge[we]};break;case 62:this.$={type:ge[we-2],name:ge[we-1],keys:ge[we]};break;case 63:this.$={type:ge[we-2],name:ge[we-1],comment:ge[we]};break;case 64:this.$={type:ge[we-3],name:ge[we-2],keys:ge[we-1],comment:ge[we]};break;case 65:case 67:case 70:this.$=ge[we];break;case 66:this.$=ge[we-1]+ge[we];break;case 69:ge[we-2].push(ge[we]),this.$=ge[we-2];break;case 71:this.$=ge[we].replace(/"/g,"");break;case 72:this.$={cardA:ge[we],relType:ge[we-1],cardB:ge[we-2]};break;case 73:this.$=de.Cardinality.ZERO_OR_ONE;break;case 74:this.$=de.Cardinality.ZERO_OR_MORE;break;case 75:this.$=de.Cardinality.ONE_OR_MORE;break;case 76:this.$=de.Cardinality.ONLY_ONE;break;case 77:this.$=de.Cardinality.MD_PARENT;break;case 78:this.$=de.Identification.NON_IDENTIFYING;break;case 79:this.$=de.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:o,34:s,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:o,34:s,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:C,41:k},{16:47,40:C,41:k},{16:48,40:C,41:k},t(e,[2,4]),{11:49,40:d,48:g,50:m,51:v,52:y},{16:50,40:C,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:P,38:60,41:L,42:R,45:62,46:63,48:D,49:M},t(I,[2,37]),t(I,[2,38]),{16:68,40:C,41:k,42:R},{13:P,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:P,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:q,73:Y},{16:94,40:C,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(ne,[2,61],{56:98,57:99,60:100,62:X,63:J}),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:P,41:L,45:105,46:63,48:D,49:M},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(I,[2,39]),t(I,[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(ne,[2,62],{57:110,61:[1,111],63:J}),t(ne,[2,63]),t(ee,[2,68]),t(ne,[2,71]),t(ee,[2,70]),{18:112,19:[1,113],53:53,54:54,58:E},{16:114,40:C,41:k},t(U,[2,44],{46:88,13:P,41:L,48:D,49:M}),{14:115,40:G,50:q,73:Y},{16:116,40:C,41:k},{14:117,40:G,50:q,73:Y},t(e,[2,13]),t(ne,[2,64]),{60:118,62:X},{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:q,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:O(function(ke,Ee){if(Ee.recoverable)this.trace(ke);else{var ue=new Error(ke);throw ue.hash=Ee,ue}},"parseError"),parse:O(function(ke){var Ee=this,ue=[0],de=[],xe=[null],ge=[],ze=this.table,we="",Oe=0,Be=0,Z=2,le=1,be=ge.slice.call(arguments,1),ae=Object.create(this.lexer),K={yy:{}};for(var se in this.yy)Object.prototype.hasOwnProperty.call(this.yy,se)&&(K.yy[se]=this.yy[se]);ae.setInput(ke,K.yy),K.yy.lexer=ae,K.yy.parser=this,typeof ae.yylloc>"u"&&(ae.yylloc={});var me=ae.yylloc;ge.push(me);var oe=ae.options&&ae.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ve(yt){ue.length=ue.length-2*yt,xe.length=xe.length-yt,ge.length=ge.length-yt}O(ve,"popStack");function ce(){var yt;return yt=de.pop()||ae.lex()||le,typeof yt!="number"&&(yt instanceof Array&&(de=yt,yt=de.pop()),yt=Ee.symbols_[yt]||yt),yt}O(ce,"lex");for(var De,Le,We,Ne,je={},$e,Ze,He,et;;){if(Le=ue[ue.length-1],this.defaultActions[Le]?We=this.defaultActions[Le]:((De===null||typeof De>"u")&&(De=ce()),We=ze[Le]&&ze[Le][De]),typeof We>"u"||!We.length||!We[0]){var Pe="";et=[];for($e in ze[Le])this.terminals_[$e]&&$e>Z&&et.push("'"+this.terminals_[$e]+"'");ae.showPosition?Pe="Parse error on line "+(Oe+1)+`: `+ae.showPosition()+` Expecting `+et.join(", ")+", got '"+(this.terminals_[De]||De)+"'":Pe="Parse error on line "+(Oe+1)+": Unexpected "+(De==le?"end of input":"'"+(this.terminals_[De]||De)+"'"),this.parseError(Pe,{text:ae.match,token:this.terminals_[De]||De,line:ae.yylineno,loc:me,expected:et})}if(We[0]instanceof Array&&We.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Le+", token: "+De);switch(We[0]){case 1:ue.push(De),xe.push(ae.yytext),ge.push(ae.yylloc),ue.push(We[1]),De=null,Be=ae.yyleng,we=ae.yytext,Oe=ae.yylineno,me=ae.yylloc;break;case 2:if(Ze=this.productions_[We[1]][1],je.$=xe[xe.length-Ze],je._$={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},oe&&(je._$.range=[ge[ge.length-(Ze||1)].range[0],ge[ge.length-1].range[1]]),Ne=this.performAction.apply(je,[we,Be,Oe,K.yy,We[1],xe,ge].concat(be)),typeof Ne<"u")return Ne;Ze&&(ue=ue.slice(0,-1*Ze*2),xe=xe.slice(0,-1*Ze),ge=ge.slice(0,-1*Ze)),ue.push(this.productions_[We[1]][0]),xe.push(je.$),ge.push(je._$),He=ze[ue[ue.length-2]][ue[ue.length-1]],ue.push(He);break;case 3:return!0}}return!0},"parse")},pe=function(){var Ce={EOF:1,parseError:O(function(Ee,ue){if(this.yy.parser)this.yy.parser.parseError(Ee,ue);else throw new Error(Ee)},"parseError"),setInput:O(function(ke,Ee){return this.yy=Ee||this.yy||{},this._input=ke,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:O(function(){var ke=this._input[0];this.yytext+=ke,this.yyleng++,this.offset++,this.match+=ke,this.matched+=ke;var Ee=ke.match(/(?:\r\n?|\n).*/g);return Ee?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ke},"input"),unput:O(function(ke){var Ee=ke.length,ue=ke.split(/(?:\r\n?|\n)/g);this._input=ke+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Ee),this.offset-=Ee;var de=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),ue.length-1&&(this.yylineno-=ue.length-1);var xe=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:ue?(ue.length===de.length?this.yylloc.first_column:0)+de[de.length-ue.length].length-ue[0].length:this.yylloc.first_column-Ee},this.options.ranges&&(this.yylloc.range=[xe[0],xe[0]+this.yyleng-Ee]),this.yyleng=this.yytext.length,this},"unput"),more:O(function(){return this._more=!0,this},"more"),reject:O(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:O(function(ke){this.unput(this.match.slice(ke))},"less"),pastInput:O(function(){var ke=this.matched.substr(0,this.matched.length-this.match.length);return(ke.length>20?"...":"")+ke.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:O(function(){var ke=this.match;return ke.length<20&&(ke+=this._input.substr(0,20-ke.length)),(ke.substr(0,20)+(ke.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:O(function(){var ke=this.pastInput(),Ee=new Array(ke.length+1).join("-");return ke+this.upcomingInput()+` `+Ee+"^"},"showPosition"),test_match:O(function(ke,Ee){var ue,de,xe;if(this.options.backtrack_lexer&&(xe={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&&(xe.yylloc.range=this.yylloc.range.slice(0))),de=ke[0].match(/(?:\r\n?|\n).*/g),de&&(this.yylineno+=de.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:de?de[de.length-1].length-de[de.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+ke[0].length},this.yytext+=ke[0],this.match+=ke[0],this.matches=ke,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(ke[0].length),this.matched+=ke[0],ue=this.performAction.call(this,this.yy,this,Ee,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ue)return ue;if(this._backtrack){for(var ge in xe)this[ge]=xe[ge];return!1}return!1},"test_match"),next:O(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var ke,Ee,ue,de;this._more||(this.yytext="",this.match="");for(var xe=this._currentRules(),ge=0;geEe[0].length)){if(Ee=ue,de=ge,this.options.backtrack_lexer){if(ke=this.test_match(ue,xe[ge]),ke!==!1)return ke;if(this._backtrack){Ee=!1;continue}else return!1}else if(!this.options.flex)break}return Ee?(ke=this.test_match(Ee,xe[de]),ke!==!1?ke:!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:O(function(){var Ee=this.next();return Ee||this.lex()},"lex"),begin:O(function(Ee){this.conditionStack.push(Ee)},"begin"),popState:O(function(){var Ee=this.conditionStack.length-1;return Ee>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(Ee){return Ee=this.conditionStack.length-1-Math.abs(Ee||0),Ee>=0?this.conditionStack[Ee]:"INITIAL"},"topState"),pushState:O(function(Ee){this.begin(Ee)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(function(Ee,ue,de,xe){switch(de){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 ue.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 ue.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}();te.lexer=pe;function ie(){this.yy={}}return O(ie,"Parser"),ie.prototype=te,te.Parser=ie,new ie}();l_e.parser=l_e;var f9n=l_e,p9n=(iL=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=Ba,this.getAccTitle=oo,this.setAccDescription=so,this.getAccDescription=lo,this.setDiagramTitle=co,this.getDiagramTitle=$a,this.getConfig=O(()=>Ye().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,ye.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:Ye().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),ye.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]),ye.debug("Added attribute ",r[i].name)}addRelationship(e,r,n,i){const a=this.entities.get(e),o=this.entities.get(n);if(!a||!o)return;const s={entityA:a.id,roleA:r,entityB:o.id,relSpec:i};this.relationships.push(s),ye.debug("Added new relationship :",s)}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 o=a.replace("fill","bgFill");i.textStyles.push(o)}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=[],_a()}getData(){const e=[],r=[],n=Ye();let i=0;for(const o of this.entities.keys()){const s=this.entities.get(o);s&&(s.cssCompiledStyles=this.getCompiledStyles(s.cssClasses.split(" ")),s.colorIndex=i++,e.push(s))}let a=0;for(const o of this.relationships){const s={id:SR(o.entityA,o.entityB,{prefix:"id",counter:a++}),type:"normal",curve:"basis",start:o.entityA,end:o.entityB,label:o.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:o.relSpec.cardB.toLowerCase(),arrowTypeEnd:o.relSpec.cardA.toLowerCase(),pattern:o.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:n.look,labelType:"markdown"};r.push(s)}return{nodes:e,edges:r,other:{},config:n,direction:"TB"}}},O(iL,"ErDB"),iL),qzt={};yj(qzt,{draw:()=>g9n});var g9n=O(async function(t,e,r,n){ye.info("REF0:"),ye.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:a,layout:o}=Ye(),s=n.db.getData(),l=m3(e,i);s.type=n.type,s.layoutAlgorithm=u$(o),s.config.flowchart.nodeSpacing=(a==null?void 0:a.nodeSpacing)||140,s.config.flowchart.rankSpacing=(a==null?void 0:a.rankSpacing)||80,s.direction=n.db.getDirection();const{config:u}=s,{look:h}=u;h==="neo"?s.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:s.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],s.diagramId=e,await RR(s,l),s.layoutAlgorithm==="elk"&&l.select(".edges").lower();const d=l.selectAll('[id*="-background"]');Array.from(d).length>0&&d.each(function(){const p=_t(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;un.insertTitle(l,"erDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),nO(l,f,"erDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),jzt=O((t,e)=>{const r=x1e,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Ag(n,i,a,e)},"fade"),Ote=new Set(["redux-color","redux-dark-color"]),m9n=O(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!Ote.has(e))return"";const a=(n==null?void 0:n.length)>0;let o="";for(let s=0;s0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(Ee){return Ee=this.conditionStack.length-1-Math.abs(Ee||0),Ee>=0?this.conditionStack[Ee]:"INITIAL"},"topState"),pushState:O(function(Ee){this.begin(Ee)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(function(Ee,ue,de,xe){switch(de){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 ue.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 ue.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}();te.lexer=pe;function ie(){this.yy={}}return O(ie,"Parser"),ie.prototype=te,te.Parser=ie,new ie}();l_e.parser=l_e;var g9n=l_e,m9n=(iL=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=Ba,this.getAccTitle=oo,this.setAccDescription=so,this.getAccDescription=lo,this.setDiagramTitle=co,this.getDiagramTitle=$a,this.getConfig=O(()=>Ye().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,ye.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:Ye().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),ye.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]),ye.debug("Added attribute ",r[i].name)}addRelationship(e,r,n,i){const a=this.entities.get(e),o=this.entities.get(n);if(!a||!o)return;const s={entityA:a.id,roleA:r,entityB:o.id,relSpec:i};this.relationships.push(s),ye.debug("Added new relationship :",s)}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 o=a.replace("fill","bgFill");i.textStyles.push(o)}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=[],_a()}getData(){const e=[],r=[],n=Ye();let i=0;for(const o of this.entities.keys()){const s=this.entities.get(o);s&&(s.cssCompiledStyles=this.getCompiledStyles(s.cssClasses.split(" ")),s.colorIndex=i++,e.push(s))}let a=0;for(const o of this.relationships){const s={id:SR(o.entityA,o.entityB,{prefix:"id",counter:a++}),type:"normal",curve:"basis",start:o.entityA,end:o.entityB,label:o.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:o.relSpec.cardB.toLowerCase(),arrowTypeEnd:o.relSpec.cardA.toLowerCase(),pattern:o.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:n.look,labelType:"markdown"};r.push(s)}return{nodes:e,edges:r,other:{},config:n,direction:"TB"}}},O(iL,"ErDB"),iL),Xzt={};yj(Xzt,{draw:()=>v9n});var v9n=O(async function(t,e,r,n){ye.info("REF0:"),ye.info("Drawing er diagram (unified)",e);const{securityLevel:i,er:a,layout:o}=Ye(),s=n.db.getData(),l=m3(e,i);s.type=n.type,s.layoutAlgorithm=u$(o),s.config.flowchart.nodeSpacing=(a==null?void 0:a.nodeSpacing)||140,s.config.flowchart.rankSpacing=(a==null?void 0:a.rankSpacing)||80,s.direction=n.db.getDirection();const{config:u}=s,{look:h}=u;h==="neo"?s.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:s.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],s.diagramId=e,await RR(s,l),s.layoutAlgorithm==="elk"&&l.select(".edges").lower();const d=l.selectAll('[id*="-background"]');Array.from(d).length>0&&d.each(function(){const p=_t(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;un.insertTitle(l,"erDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),nO(l,f,"erDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Kzt=O((t,e)=>{const r=x1e,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Ag(n,i,a,e)},"fade"),Ote=new Set(["redux-color","redux-dark-color"]),y9n=O(t=>{const{theme:e,look:r,bkgColorArray:n,borderColorArray:i}=t;if(!Ote.has(e))return"";const a=(n==null?void 0:n.length)>0;let o="";for(let s=0;s{const{look:e,theme:r,erEdgeLabelBackground:n,strokeWidth:i}=t;return` - ${m9n(t)} + `;return o},"genColor"),b9n=O(t=>{const{look:e,theme:r,erEdgeLabelBackground:n,strokeWidth:i}=t;return` + ${y9n(t)} .entityBox { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; @@ -1536,7 +1536,7 @@ Expecting `+et.join(", ")+", got '"+(this.terminals_[De]||De)+"'":Pe="Parse erro } .labelBkg { - background-color: ${Ote.has(r)&&n?n:jzt(t.tertiaryColor,.5)}; + background-color: ${Ote.has(r)&&n?n:Kzt(t.tertiaryColor,.5)}; } .edgeLabel { @@ -1585,17 +1585,17 @@ Expecting `+et.join(", ")+", got '"+(this.terminals_[De]||De)+"'":Pe="Parse erro stroke-width: 1; } [data-look=neo].labelBkg { - background-color: ${jzt(t.tertiaryColor,.5)}; + background-color: ${Kzt(t.tertiaryColor,.5)}; } -`},"getStyles"),y9n=v9n,b9n={parser:f9n,get db(){return new p9n},renderer:qzt,styles:y9n};const x9n=Object.freeze(Object.defineProperty({__proto__:null,diagram:b9n},Symbol.toStringTag,{value:"Module"}));var c_e=(aL=class{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}},O(aL,"ImperativeState"),aL);function ah(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))}O(ah,"populateCommonDb");var w9n=Object.create,C9=Object.defineProperty,A9n=Object.getOwnPropertyDescriptor,u_e=Object.getOwnPropertyNames,S9n=Object.getPrototypeOf,T9n=Object.prototype.hasOwnProperty,$=(t,e)=>C9(t,"name",{value:e,configurable:!0}),C9n=(t,e)=>function(){return t&&(e=(0,t[u_e(t)[0]])(t=0)),e},Fn=(t,e)=>function(){return e||(0,t[u_e(t)[0]])((e={exports:{}}).exports,e),e.exports},xw=(t,e)=>{for(var r in e)C9(t,r,{get:e[r],enumerable:!0})},h_e=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of u_e(e))!T9n.call(t,i)&&i!==r&&C9(t,i,{get:()=>e[i],enumerable:!(n=A9n(e,i))||n.enumerable});return t},kte=(t,e,r)=>(h_e(t,e,"default"),r),d_e=(t,e,r)=>(r=t!=null?w9n(S9n(t)):{},h_e(C9(r,"default",{value:t,enumerable:!0}),t)),f_e=t=>h_e(C9({},"__esModule",{value:!0}),t),Ete={};xw(Ete,{AnnotatedTextEdit:()=>K1,ChangeAnnotation:()=>aO,ChangeAnnotationIdentifier:()=>Ec,CodeAction:()=>q_e,CodeActionContext:()=>Y_e,CodeActionKind:()=>W_e,CodeActionTriggerKind:()=>M9,CodeDescription:()=>S_e,CodeLens:()=>j_e,Color:()=>Rte,ColorInformation:()=>v_e,ColorPresentation:()=>y_e,Command:()=>iO,CompletionItem:()=>I_e,CompletionItemKind:()=>E_e,CompletionItemLabelDetails:()=>M_e,CompletionItemTag:()=>R_e,CompletionList:()=>P_e,CreateFile:()=>v3,DeleteFile:()=>b3,Diagnostic:()=>E9,DiagnosticRelatedInformation:()=>Dte,DiagnosticSeverity:()=>w_e,DiagnosticTag:()=>A_e,DocumentHighlight:()=>z_e,DocumentHighlightKind:()=>F_e,DocumentLink:()=>K_e,DocumentSymbol:()=>H_e,DocumentUri:()=>p_e,EOL:()=>Kzt,FoldingRange:()=>x_e,FoldingRangeKind:()=>b_e,FormattingOptions:()=>X_e,Hover:()=>N_e,InlayHint:()=>o5e,InlayHintKind:()=>Ite,InlayHintLabelPart:()=>Pte,InlineCompletionContext:()=>d5e,InlineCompletionItem:()=>l5e,InlineCompletionList:()=>c5e,InlineCompletionTriggerKind:()=>u5e,InlineValueContext:()=>a5e,InlineValueEvaluatableExpression:()=>i5e,InlineValueText:()=>r5e,InlineValueVariableLookup:()=>n5e,InsertReplaceEdit:()=>D_e,InsertTextFormat:()=>__e,InsertTextMode:()=>L_e,Location:()=>k9,LocationLink:()=>m_e,MarkedString:()=>L9,MarkupContent:()=>x3,MarkupKind:()=>Mte,OptionalVersionedTextDocumentIdentifier:()=>D9,ParameterInformation:()=>B_e,Position:()=>ea,Range:()=>Ri,RenameFile:()=>y3,SelectedCompletionInfo:()=>h5e,SelectionRange:()=>Z_e,SemanticTokenModifiers:()=>e5e,SemanticTokenTypes:()=>J_e,SemanticTokens:()=>t5e,SignatureInformation:()=>$_e,StringValue:()=>s5e,SymbolInformation:()=>Q_e,SymbolKind:()=>U_e,SymbolTag:()=>V_e,TextDocument:()=>p5e,TextDocumentEdit:()=>_9,TextDocumentIdentifier:()=>C_e,TextDocumentItem:()=>k_e,TextEdit:()=>av,URI:()=>_te,VersionedTextDocumentIdentifier:()=>O_e,WorkspaceChange:()=>Xzt,WorkspaceEdit:()=>Lte,WorkspaceFolder:()=>f5e,WorkspaceSymbol:()=>G_e,integer:()=>g_e,uinteger:()=>O9});var p_e,_te,g_e,O9,ea,Ri,k9,m_e,Rte,v_e,y_e,b_e,x_e,Dte,w_e,A_e,S_e,E9,iO,av,aO,Ec,K1,_9,v3,y3,b3,Lte,R9,T_e,Xzt,C_e,O_e,D9,k_e,Mte,x3,E_e,__e,R_e,D_e,L_e,M_e,I_e,P_e,L9,N_e,B_e,$_e,F_e,z_e,U_e,V_e,Q_e,G_e,H_e,W_e,M9,Y_e,q_e,j_e,X_e,K_e,Z_e,J_e,e5e,t5e,r5e,n5e,i5e,a5e,Ite,Pte,o5e,s5e,l5e,c5e,u5e,h5e,d5e,f5e,Kzt,p5e,Zzt,ct,I9=C9n({"../../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(o){return typeof o=="string"}$(a,"is"),i.is=a})(p_e||(p_e={})),function(i){function a(o){return typeof o=="string"}$(a,"is"),i.is=a}(_te||(_te={})),function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function a(o){return typeof o=="number"&&i.MIN_VALUE<=o&&o<=i.MAX_VALUE}$(a,"is"),i.is=a}(g_e||(g_e={})),function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function a(o){return typeof o=="number"&&i.MIN_VALUE<=o&&o<=i.MAX_VALUE}$(a,"is"),i.is=a}(O9||(O9={})),function(i){function a(s,l){return s===Number.MAX_VALUE&&(s=O9.MAX_VALUE),l===Number.MAX_VALUE&&(l=O9.MAX_VALUE),{line:s,character:l}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.objectLiteral(l)&&ct.uinteger(l.line)&&ct.uinteger(l.character)}$(o,"is"),i.is=o}(ea||(ea={})),function(i){function a(s,l,u,h){if(ct.uinteger(s)&&ct.uinteger(l)&&ct.uinteger(u)&&ct.uinteger(h))return{start:ea.create(s,l),end:ea.create(u,h)};if(ea.is(s)&&ea.is(l))return{start:s,end:l};throw new Error(`Range#create called with invalid arguments[${s}, ${l}, ${u}, ${h}]`)}$(a,"create"),i.create=a;function o(s){let l=s;return ct.objectLiteral(l)&&ea.is(l.start)&&ea.is(l.end)}$(o,"is"),i.is=o}(Ri||(Ri={})),function(i){function a(s,l){return{uri:s,range:l}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.objectLiteral(l)&&Ri.is(l.range)&&(ct.string(l.uri)||ct.undefined(l.uri))}$(o,"is"),i.is=o}(k9||(k9={})),function(i){function a(s,l,u,h){return{targetUri:s,targetRange:l,targetSelectionRange:u,originSelectionRange:h}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.objectLiteral(l)&&Ri.is(l.targetRange)&&ct.string(l.targetUri)&&Ri.is(l.targetSelectionRange)&&(Ri.is(l.originSelectionRange)||ct.undefined(l.originSelectionRange))}$(o,"is"),i.is=o}(m_e||(m_e={})),function(i){function a(s,l,u,h){return{red:s,green:l,blue:u,alpha:h}}$(a,"create"),i.create=a;function o(s){const l=s;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)}$(o,"is"),i.is=o}(Rte||(Rte={})),function(i){function a(s,l){return{range:s,color:l}}$(a,"create"),i.create=a;function o(s){const l=s;return ct.objectLiteral(l)&&Ri.is(l.range)&&Rte.is(l.color)}$(o,"is"),i.is=o}(v_e||(v_e={})),function(i){function a(s,l,u){return{label:s,textEdit:l,additionalTextEdits:u}}$(a,"create"),i.create=a;function o(s){const l=s;return ct.objectLiteral(l)&&ct.string(l.label)&&(ct.undefined(l.textEdit)||av.is(l))&&(ct.undefined(l.additionalTextEdits)||ct.typedArray(l.additionalTextEdits,av.is))}$(o,"is"),i.is=o}(y_e||(y_e={})),function(i){i.Comment="comment",i.Imports="imports",i.Region="region"}(b_e||(b_e={})),function(i){function a(s,l,u,h,d,f){const p={startLine:s,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 o(s){const l=s;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))}$(o,"is"),i.is=o}(x_e||(x_e={})),function(i){function a(s,l){return{location:s,message:l}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&k9.is(l.location)&&ct.string(l.message)}$(o,"is"),i.is=o}(Dte||(Dte={})),function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4}(w_e||(w_e={})),function(i){i.Unnecessary=1,i.Deprecated=2}(A_e||(A_e={})),function(i){function a(o){const s=o;return ct.objectLiteral(s)&&ct.string(s.href)}$(a,"is"),i.is=a}(S_e||(S_e={})),function(i){function a(s,l,u,h,d,f){let p={range:s,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 o(s){var l;let u=s;return ct.defined(u)&&Ri.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,Dte.is))}$(o,"is"),i.is=o}(E9||(E9={})),function(i){function a(s,l,...u){let h={title:s,command:l};return ct.defined(u)&&u.length>0&&(h.arguments=u),h}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&ct.string(l.title)&&ct.string(l.command)}$(o,"is"),i.is=o}(iO||(iO={})),function(i){function a(u,h){return{range:u,newText:h}}$(a,"replace"),i.replace=a;function o(u,h){return{range:{start:u,end:u},newText:h}}$(o,"insert"),i.insert=o;function s(u){return{range:u,newText:""}}$(s,"del"),i.del=s;function l(u){const h=u;return ct.objectLiteral(h)&&ct.string(h.newText)&&Ri.is(h.range)}$(l,"is"),i.is=l}(av||(av={})),function(i){function a(s,l,u){const h={label:s};return l!==void 0&&(h.needsConfirmation=l),u!==void 0&&(h.description=u),h}$(a,"create"),i.create=a;function o(s){const l=s;return ct.objectLiteral(l)&&ct.string(l.label)&&(ct.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(ct.string(l.description)||l.description===void 0)}$(o,"is"),i.is=o}(aO||(aO={})),function(i){function a(o){const s=o;return ct.string(s)}$(a,"is"),i.is=a}(Ec||(Ec={})),function(i){function a(u,h,d){return{range:u,newText:h,annotationId:d}}$(a,"replace"),i.replace=a;function o(u,h,d){return{range:{start:u,end:u},newText:h,annotationId:d}}$(o,"insert"),i.insert=o;function s(u,h){return{range:u,newText:"",annotationId:h}}$(s,"del"),i.del=s;function l(u){const h=u;return av.is(h)&&(aO.is(h.annotationId)||Ec.is(h.annotationId))}$(l,"is"),i.is=l}(K1||(K1={})),function(i){function a(s,l){return{textDocument:s,edits:l}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&D9.is(l.textDocument)&&Array.isArray(l.edits)}$(o,"is"),i.is=o}(_9||(_9={})),function(i){function a(s,l,u){let h={kind:"create",uri:s};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 o(s){let l=s;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||Ec.is(l.annotationId))}$(o,"is"),i.is=o}(v3||(v3={})),function(i){function a(s,l,u,h){let d={kind:"rename",oldUri:s,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 o(s){let l=s;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||Ec.is(l.annotationId))}$(o,"is"),i.is=o}(y3||(y3={})),function(i){function a(s,l,u){let h={kind:"delete",uri:s};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 o(s){let l=s;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||Ec.is(l.annotationId))}$(o,"is"),i.is=o}(b3||(b3={})),function(i){function a(o){let s=o;return s&&(s.changes!==void 0||s.documentChanges!==void 0)&&(s.documentChanges===void 0||s.documentChanges.every(l=>ct.string(l.kind)?v3.is(l)||y3.is(l)||b3.is(l):_9.is(l)))}$(a,"is"),i.is=a}(Lte||(Lte={})),R9=(t=class{constructor(a,o){this.edits=a,this.changeAnnotations=o}insert(a,o,s){let l,u;if(s===void 0?l=av.insert(a,o):Ec.is(s)?(u=s,l=K1.insert(a,o,s)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(s),l=K1.insert(a,o,u)),this.edits.push(l),u!==void 0)return u}replace(a,o,s){let l,u;if(s===void 0?l=av.replace(a,o):Ec.is(s)?(u=s,l=K1.replace(a,o,s)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(s),l=K1.replace(a,o,u)),this.edits.push(l),u!==void 0)return u}delete(a,o){let s,l;if(o===void 0?s=av.del(a):Ec.is(o)?(l=o,s=K1.del(a,o)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(o),s=K1.del(a,l)),this.edits.push(s),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),T_e=(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,o){let s;if(Ec.is(a)?s=a:(s=this.nextId(),o=a),this._annotations[s]!==void 0)throw new Error(`Id ${s} is already in use.`);if(o===void 0)throw new Error(`No annotation provided for id ${s}`);return this._annotations[s]=o,this._size++,s}nextId(){return this._counter++,this._counter.toString()}},$(e,"ChangeAnnotations"),e),Xzt=(r=class{constructor(a){this._textEditChanges=Object.create(null),a!==void 0?(this._workspaceEdit=a,a.documentChanges?(this._changeAnnotations=new T_e(a.changeAnnotations),a.changeAnnotations=this._changeAnnotations.all(),a.documentChanges.forEach(o=>{if(_9.is(o)){const s=new R9(o.edits,this._changeAnnotations);this._textEditChanges[o.textDocument.uri]=s}})):a.changes&&Object.keys(a.changes).forEach(o=>{const s=new R9(a.changes[o]);this._textEditChanges[o]=s})):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(D9.is(a)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const o={uri:a.uri,version:a.version};let s=this._textEditChanges[o.uri];if(!s){const l=[],u={textDocument:o,edits:l};this._workspaceEdit.documentChanges.push(u),s=new R9(l,this._changeAnnotations),this._textEditChanges[o.uri]=s}return s}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let o=this._textEditChanges[a];if(!o){let s=[];this._workspaceEdit.changes[a]=s,o=new R9(s),this._textEditChanges[a]=o}return o}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new T_e,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,o,s){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;aO.is(o)||Ec.is(o)?l=o:s=o;let u,h;if(l===void 0?u=v3.create(a,s):(h=Ec.is(l)?l:this._changeAnnotations.manage(l),u=v3.create(a,s,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}renameFile(a,o,s,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let u;aO.is(s)||Ec.is(s)?u=s:l=s;let h,d;if(u===void 0?h=y3.create(a,o,l):(d=Ec.is(u)?u:this._changeAnnotations.manage(u),h=y3.create(a,o,l,d)),this._workspaceEdit.documentChanges.push(h),d!==void 0)return d}deleteFile(a,o,s){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;aO.is(o)||Ec.is(o)?l=o:s=o;let u,h;if(l===void 0?u=b3.create(a,s):(h=Ec.is(l)?l:this._changeAnnotations.manage(l),u=b3.create(a,s,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}},$(r,"WorkspaceChange"),r),function(i){function a(s){return{uri:s}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&ct.string(l.uri)}$(o,"is"),i.is=o}(C_e||(C_e={})),function(i){function a(s,l){return{uri:s,version:l}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&ct.string(l.uri)&&ct.integer(l.version)}$(o,"is"),i.is=o}(O_e||(O_e={})),function(i){function a(s,l){return{uri:s,version:l}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&ct.string(l.uri)&&(l.version===null||ct.integer(l.version))}$(o,"is"),i.is=o}(D9||(D9={})),function(i){function a(s,l,u,h){return{uri:s,languageId:l,version:u,text:h}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&ct.string(l.uri)&&ct.string(l.languageId)&&ct.integer(l.version)&&ct.string(l.text)}$(o,"is"),i.is=o}(k_e||(k_e={})),function(i){i.PlainText="plaintext",i.Markdown="markdown";function a(o){const s=o;return s===i.PlainText||s===i.Markdown}$(a,"is"),i.is=a}(Mte||(Mte={})),function(i){function a(o){const s=o;return ct.objectLiteral(o)&&Mte.is(s.kind)&&ct.string(s.value)}$(a,"is"),i.is=a}(x3||(x3={})),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}(E_e||(E_e={})),function(i){i.PlainText=1,i.Snippet=2}(__e||(__e={})),function(i){i.Deprecated=1}(R_e||(R_e={})),function(i){function a(s,l,u){return{newText:s,insert:l,replace:u}}$(a,"create"),i.create=a;function o(s){const l=s;return l&&ct.string(l.newText)&&Ri.is(l.insert)&&Ri.is(l.replace)}$(o,"is"),i.is=o}(D_e||(D_e={})),function(i){i.asIs=1,i.adjustIndentation=2}(L_e||(L_e={})),function(i){function a(o){const s=o;return s&&(ct.string(s.detail)||s.detail===void 0)&&(ct.string(s.description)||s.description===void 0)}$(a,"is"),i.is=a}(M_e||(M_e={})),function(i){function a(o){return{label:o}}$(a,"create"),i.create=a}(I_e||(I_e={})),function(i){function a(o,s){return{items:o||[],isIncomplete:!!s}}$(a,"create"),i.create=a}(P_e||(P_e={})),function(i){function a(s){return s.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}$(a,"fromPlainText"),i.fromPlainText=a;function o(s){const l=s;return ct.string(l)||ct.objectLiteral(l)&&ct.string(l.language)&&ct.string(l.value)}$(o,"is"),i.is=o}(L9||(L9={})),function(i){function a(o){let s=o;return!!s&&ct.objectLiteral(s)&&(x3.is(s.contents)||L9.is(s.contents)||ct.typedArray(s.contents,L9.is))&&(o.range===void 0||Ri.is(o.range))}$(a,"is"),i.is=a}(N_e||(N_e={})),function(i){function a(o,s){return s?{label:o,documentation:s}:{label:o}}$(a,"create"),i.create=a}(B_e||(B_e={})),function(i){function a(o,s,...l){let u={label:o};return ct.defined(s)&&(u.documentation=s),ct.defined(l)?u.parameters=l:u.parameters=[],u}$(a,"create"),i.create=a}($_e||($_e={})),function(i){i.Text=1,i.Read=2,i.Write=3}(F_e||(F_e={})),function(i){function a(o,s){let l={range:o};return ct.number(s)&&(l.kind=s),l}$(a,"create"),i.create=a}(z_e||(z_e={})),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}(U_e||(U_e={})),function(i){i.Deprecated=1}(V_e||(V_e={})),function(i){function a(o,s,l,u,h){let d={name:o,kind:s,location:{uri:u,range:l}};return h&&(d.containerName=h),d}$(a,"create"),i.create=a}(Q_e||(Q_e={})),function(i){function a(o,s,l,u){return u!==void 0?{name:o,kind:s,location:{uri:l,range:u}}:{name:o,kind:s,location:{uri:l}}}$(a,"create"),i.create=a}(G_e||(G_e={})),function(i){function a(s,l,u,h,d,f){let p={name:s,detail:l,kind:u,range:h,selectionRange:d};return f!==void 0&&(p.children=f),p}$(a,"create"),i.create=a;function o(s){let l=s;return l&&ct.string(l.name)&&ct.number(l.kind)&&Ri.is(l.range)&&Ri.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))}$(o,"is"),i.is=o}(H_e||(H_e={})),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"}(W_e||(W_e={})),function(i){i.Invoked=1,i.Automatic=2}(M9||(M9={})),function(i){function a(s,l,u){let h={diagnostics:s};return l!=null&&(h.only=l),u!=null&&(h.triggerKind=u),h}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&ct.typedArray(l.diagnostics,E9.is)&&(l.only===void 0||ct.typedArray(l.only,ct.string))&&(l.triggerKind===void 0||l.triggerKind===M9.Invoked||l.triggerKind===M9.Automatic)}$(o,"is"),i.is=o}(Y_e||(Y_e={})),function(i){function a(s,l,u){let h={title:s},d=!0;return typeof l=="string"?(d=!1,h.kind=l):iO.is(l)?h.command=l:h.edit=l,d&&u!==void 0&&(h.kind=u),h}$(a,"create"),i.create=a;function o(s){let l=s;return l&&ct.string(l.title)&&(l.diagnostics===void 0||ct.typedArray(l.diagnostics,E9.is))&&(l.kind===void 0||ct.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||iO.is(l.command))&&(l.isPreferred===void 0||ct.boolean(l.isPreferred))&&(l.edit===void 0||Lte.is(l.edit))}$(o,"is"),i.is=o}(q_e||(q_e={})),function(i){function a(s,l){let u={range:s};return ct.defined(l)&&(u.data=l),u}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&Ri.is(l.range)&&(ct.undefined(l.command)||iO.is(l.command))}$(o,"is"),i.is=o}(j_e||(j_e={})),function(i){function a(s,l){return{tabSize:s,insertSpaces:l}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&ct.uinteger(l.tabSize)&&ct.boolean(l.insertSpaces)}$(o,"is"),i.is=o}(X_e||(X_e={})),function(i){function a(s,l,u){return{range:s,target:l,data:u}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&Ri.is(l.range)&&(ct.undefined(l.target)||ct.string(l.target))}$(o,"is"),i.is=o}(K_e||(K_e={})),function(i){function a(s,l){return{range:s,parent:l}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.objectLiteral(l)&&Ri.is(l.range)&&(l.parent===void 0||i.is(l.parent))}$(o,"is"),i.is=o}(Z_e||(Z_e={})),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"}(J_e||(J_e={})),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"}(e5e||(e5e={})),function(i){function a(o){const s=o;return ct.objectLiteral(s)&&(s.resultId===void 0||typeof s.resultId=="string")&&Array.isArray(s.data)&&(s.data.length===0||typeof s.data[0]=="number")}$(a,"is"),i.is=a}(t5e||(t5e={})),function(i){function a(s,l){return{range:s,text:l}}$(a,"create"),i.create=a;function o(s){const l=s;return l!=null&&Ri.is(l.range)&&ct.string(l.text)}$(o,"is"),i.is=o}(r5e||(r5e={})),function(i){function a(s,l,u){return{range:s,variableName:l,caseSensitiveLookup:u}}$(a,"create"),i.create=a;function o(s){const l=s;return l!=null&&Ri.is(l.range)&&ct.boolean(l.caseSensitiveLookup)&&(ct.string(l.variableName)||l.variableName===void 0)}$(o,"is"),i.is=o}(n5e||(n5e={})),function(i){function a(s,l){return{range:s,expression:l}}$(a,"create"),i.create=a;function o(s){const l=s;return l!=null&&Ri.is(l.range)&&(ct.string(l.expression)||l.expression===void 0)}$(o,"is"),i.is=o}(i5e||(i5e={})),function(i){function a(s,l){return{frameId:s,stoppedLocation:l}}$(a,"create"),i.create=a;function o(s){const l=s;return ct.defined(l)&&Ri.is(s.stoppedLocation)}$(o,"is"),i.is=o}(a5e||(a5e={})),function(i){i.Type=1,i.Parameter=2;function a(o){return o===1||o===2}$(a,"is"),i.is=a}(Ite||(Ite={})),function(i){function a(s){return{value:s}}$(a,"create"),i.create=a;function o(s){const l=s;return ct.objectLiteral(l)&&(l.tooltip===void 0||ct.string(l.tooltip)||x3.is(l.tooltip))&&(l.location===void 0||k9.is(l.location))&&(l.command===void 0||iO.is(l.command))}$(o,"is"),i.is=o}(Pte||(Pte={})),function(i){function a(s,l,u){const h={position:s,label:l};return u!==void 0&&(h.kind=u),h}$(a,"create"),i.create=a;function o(s){const l=s;return ct.objectLiteral(l)&&ea.is(l.position)&&(ct.string(l.label)||ct.typedArray(l.label,Pte.is))&&(l.kind===void 0||Ite.is(l.kind))&&l.textEdits===void 0||ct.typedArray(l.textEdits,av.is)&&(l.tooltip===void 0||ct.string(l.tooltip)||x3.is(l.tooltip))&&(l.paddingLeft===void 0||ct.boolean(l.paddingLeft))&&(l.paddingRight===void 0||ct.boolean(l.paddingRight))}$(o,"is"),i.is=o}(o5e||(o5e={})),function(i){function a(o){return{kind:"snippet",value:o}}$(a,"createSnippet"),i.createSnippet=a}(s5e||(s5e={})),function(i){function a(o,s,l,u){return{insertText:o,filterText:s,range:l,command:u}}$(a,"create"),i.create=a}(l5e||(l5e={})),function(i){function a(o){return{items:o}}$(a,"create"),i.create=a}(c5e||(c5e={})),function(i){i.Invoked=0,i.Automatic=1}(u5e||(u5e={})),function(i){function a(o,s){return{range:o,text:s}}$(a,"create"),i.create=a}(h5e||(h5e={})),function(i){function a(o,s){return{triggerKind:o,selectedCompletionInfo:s}}$(a,"create"),i.create=a}(d5e||(d5e={})),function(i){function a(o){const s=o;return ct.objectLiteral(s)&&_te.is(s.uri)&&ct.string(s.name)}$(a,"is"),i.is=a}(f5e||(f5e={})),Kzt=[` +`},"getStyles"),x9n=b9n,w9n={parser:g9n,get db(){return new m9n},renderer:Xzt,styles:x9n};const A9n=Object.freeze(Object.defineProperty({__proto__:null,diagram:w9n},Symbol.toStringTag,{value:"Module"}));var c_e=(aL=class{constructor(e){this.init=e,this.records=this.init()}reset(){this.records=this.init()}},O(aL,"ImperativeState"),aL);function ah(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))}O(ah,"populateCommonDb");var S9n=Object.create,C9=Object.defineProperty,T9n=Object.getOwnPropertyDescriptor,u_e=Object.getOwnPropertyNames,C9n=Object.getPrototypeOf,O9n=Object.prototype.hasOwnProperty,$=(t,e)=>C9(t,"name",{value:e,configurable:!0}),k9n=(t,e)=>function(){return t&&(e=(0,t[u_e(t)[0]])(t=0)),e},Fn=(t,e)=>function(){return e||(0,t[u_e(t)[0]])((e={exports:{}}).exports,e),e.exports},xw=(t,e)=>{for(var r in e)C9(t,r,{get:e[r],enumerable:!0})},h_e=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of u_e(e))!O9n.call(t,i)&&i!==r&&C9(t,i,{get:()=>e[i],enumerable:!(n=T9n(e,i))||n.enumerable});return t},kte=(t,e,r)=>(h_e(t,e,"default"),r),d_e=(t,e,r)=>(r=t!=null?S9n(C9n(t)):{},h_e(C9(r,"default",{value:t,enumerable:!0}),t)),f_e=t=>h_e(C9({},"__esModule",{value:!0}),t),Ete={};xw(Ete,{AnnotatedTextEdit:()=>K1,ChangeAnnotation:()=>aO,ChangeAnnotationIdentifier:()=>Ec,CodeAction:()=>q_e,CodeActionContext:()=>Y_e,CodeActionKind:()=>W_e,CodeActionTriggerKind:()=>M9,CodeDescription:()=>S_e,CodeLens:()=>j_e,Color:()=>Rte,ColorInformation:()=>v_e,ColorPresentation:()=>y_e,Command:()=>iO,CompletionItem:()=>I_e,CompletionItemKind:()=>E_e,CompletionItemLabelDetails:()=>M_e,CompletionItemTag:()=>R_e,CompletionList:()=>P_e,CreateFile:()=>v3,DeleteFile:()=>b3,Diagnostic:()=>E9,DiagnosticRelatedInformation:()=>Dte,DiagnosticSeverity:()=>w_e,DiagnosticTag:()=>A_e,DocumentHighlight:()=>z_e,DocumentHighlightKind:()=>F_e,DocumentLink:()=>K_e,DocumentSymbol:()=>H_e,DocumentUri:()=>p_e,EOL:()=>Jzt,FoldingRange:()=>x_e,FoldingRangeKind:()=>b_e,FormattingOptions:()=>X_e,Hover:()=>N_e,InlayHint:()=>o5e,InlayHintKind:()=>Ite,InlayHintLabelPart:()=>Pte,InlineCompletionContext:()=>d5e,InlineCompletionItem:()=>l5e,InlineCompletionList:()=>c5e,InlineCompletionTriggerKind:()=>u5e,InlineValueContext:()=>a5e,InlineValueEvaluatableExpression:()=>i5e,InlineValueText:()=>r5e,InlineValueVariableLookup:()=>n5e,InsertReplaceEdit:()=>D_e,InsertTextFormat:()=>__e,InsertTextMode:()=>L_e,Location:()=>k9,LocationLink:()=>m_e,MarkedString:()=>L9,MarkupContent:()=>x3,MarkupKind:()=>Mte,OptionalVersionedTextDocumentIdentifier:()=>D9,ParameterInformation:()=>B_e,Position:()=>ea,Range:()=>Ri,RenameFile:()=>y3,SelectedCompletionInfo:()=>h5e,SelectionRange:()=>Z_e,SemanticTokenModifiers:()=>e5e,SemanticTokenTypes:()=>J_e,SemanticTokens:()=>t5e,SignatureInformation:()=>$_e,StringValue:()=>s5e,SymbolInformation:()=>Q_e,SymbolKind:()=>U_e,SymbolTag:()=>V_e,TextDocument:()=>p5e,TextDocumentEdit:()=>_9,TextDocumentIdentifier:()=>C_e,TextDocumentItem:()=>k_e,TextEdit:()=>av,URI:()=>_te,VersionedTextDocumentIdentifier:()=>O_e,WorkspaceChange:()=>Zzt,WorkspaceEdit:()=>Lte,WorkspaceFolder:()=>f5e,WorkspaceSymbol:()=>G_e,integer:()=>g_e,uinteger:()=>O9});var p_e,_te,g_e,O9,ea,Ri,k9,m_e,Rte,v_e,y_e,b_e,x_e,Dte,w_e,A_e,S_e,E9,iO,av,aO,Ec,K1,_9,v3,y3,b3,Lte,R9,T_e,Zzt,C_e,O_e,D9,k_e,Mte,x3,E_e,__e,R_e,D_e,L_e,M_e,I_e,P_e,L9,N_e,B_e,$_e,F_e,z_e,U_e,V_e,Q_e,G_e,H_e,W_e,M9,Y_e,q_e,j_e,X_e,K_e,Z_e,J_e,e5e,t5e,r5e,n5e,i5e,a5e,Ite,Pte,o5e,s5e,l5e,c5e,u5e,h5e,d5e,f5e,Jzt,p5e,eUt,ct,I9=k9n({"../../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(o){return typeof o=="string"}$(a,"is"),i.is=a})(p_e||(p_e={})),function(i){function a(o){return typeof o=="string"}$(a,"is"),i.is=a}(_te||(_te={})),function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function a(o){return typeof o=="number"&&i.MIN_VALUE<=o&&o<=i.MAX_VALUE}$(a,"is"),i.is=a}(g_e||(g_e={})),function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function a(o){return typeof o=="number"&&i.MIN_VALUE<=o&&o<=i.MAX_VALUE}$(a,"is"),i.is=a}(O9||(O9={})),function(i){function a(s,l){return s===Number.MAX_VALUE&&(s=O9.MAX_VALUE),l===Number.MAX_VALUE&&(l=O9.MAX_VALUE),{line:s,character:l}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.objectLiteral(l)&&ct.uinteger(l.line)&&ct.uinteger(l.character)}$(o,"is"),i.is=o}(ea||(ea={})),function(i){function a(s,l,u,h){if(ct.uinteger(s)&&ct.uinteger(l)&&ct.uinteger(u)&&ct.uinteger(h))return{start:ea.create(s,l),end:ea.create(u,h)};if(ea.is(s)&&ea.is(l))return{start:s,end:l};throw new Error(`Range#create called with invalid arguments[${s}, ${l}, ${u}, ${h}]`)}$(a,"create"),i.create=a;function o(s){let l=s;return ct.objectLiteral(l)&&ea.is(l.start)&&ea.is(l.end)}$(o,"is"),i.is=o}(Ri||(Ri={})),function(i){function a(s,l){return{uri:s,range:l}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.objectLiteral(l)&&Ri.is(l.range)&&(ct.string(l.uri)||ct.undefined(l.uri))}$(o,"is"),i.is=o}(k9||(k9={})),function(i){function a(s,l,u,h){return{targetUri:s,targetRange:l,targetSelectionRange:u,originSelectionRange:h}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.objectLiteral(l)&&Ri.is(l.targetRange)&&ct.string(l.targetUri)&&Ri.is(l.targetSelectionRange)&&(Ri.is(l.originSelectionRange)||ct.undefined(l.originSelectionRange))}$(o,"is"),i.is=o}(m_e||(m_e={})),function(i){function a(s,l,u,h){return{red:s,green:l,blue:u,alpha:h}}$(a,"create"),i.create=a;function o(s){const l=s;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)}$(o,"is"),i.is=o}(Rte||(Rte={})),function(i){function a(s,l){return{range:s,color:l}}$(a,"create"),i.create=a;function o(s){const l=s;return ct.objectLiteral(l)&&Ri.is(l.range)&&Rte.is(l.color)}$(o,"is"),i.is=o}(v_e||(v_e={})),function(i){function a(s,l,u){return{label:s,textEdit:l,additionalTextEdits:u}}$(a,"create"),i.create=a;function o(s){const l=s;return ct.objectLiteral(l)&&ct.string(l.label)&&(ct.undefined(l.textEdit)||av.is(l))&&(ct.undefined(l.additionalTextEdits)||ct.typedArray(l.additionalTextEdits,av.is))}$(o,"is"),i.is=o}(y_e||(y_e={})),function(i){i.Comment="comment",i.Imports="imports",i.Region="region"}(b_e||(b_e={})),function(i){function a(s,l,u,h,d,f){const p={startLine:s,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 o(s){const l=s;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))}$(o,"is"),i.is=o}(x_e||(x_e={})),function(i){function a(s,l){return{location:s,message:l}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&k9.is(l.location)&&ct.string(l.message)}$(o,"is"),i.is=o}(Dte||(Dte={})),function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4}(w_e||(w_e={})),function(i){i.Unnecessary=1,i.Deprecated=2}(A_e||(A_e={})),function(i){function a(o){const s=o;return ct.objectLiteral(s)&&ct.string(s.href)}$(a,"is"),i.is=a}(S_e||(S_e={})),function(i){function a(s,l,u,h,d,f){let p={range:s,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 o(s){var l;let u=s;return ct.defined(u)&&Ri.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,Dte.is))}$(o,"is"),i.is=o}(E9||(E9={})),function(i){function a(s,l,...u){let h={title:s,command:l};return ct.defined(u)&&u.length>0&&(h.arguments=u),h}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&ct.string(l.title)&&ct.string(l.command)}$(o,"is"),i.is=o}(iO||(iO={})),function(i){function a(u,h){return{range:u,newText:h}}$(a,"replace"),i.replace=a;function o(u,h){return{range:{start:u,end:u},newText:h}}$(o,"insert"),i.insert=o;function s(u){return{range:u,newText:""}}$(s,"del"),i.del=s;function l(u){const h=u;return ct.objectLiteral(h)&&ct.string(h.newText)&&Ri.is(h.range)}$(l,"is"),i.is=l}(av||(av={})),function(i){function a(s,l,u){const h={label:s};return l!==void 0&&(h.needsConfirmation=l),u!==void 0&&(h.description=u),h}$(a,"create"),i.create=a;function o(s){const l=s;return ct.objectLiteral(l)&&ct.string(l.label)&&(ct.boolean(l.needsConfirmation)||l.needsConfirmation===void 0)&&(ct.string(l.description)||l.description===void 0)}$(o,"is"),i.is=o}(aO||(aO={})),function(i){function a(o){const s=o;return ct.string(s)}$(a,"is"),i.is=a}(Ec||(Ec={})),function(i){function a(u,h,d){return{range:u,newText:h,annotationId:d}}$(a,"replace"),i.replace=a;function o(u,h,d){return{range:{start:u,end:u},newText:h,annotationId:d}}$(o,"insert"),i.insert=o;function s(u,h){return{range:u,newText:"",annotationId:h}}$(s,"del"),i.del=s;function l(u){const h=u;return av.is(h)&&(aO.is(h.annotationId)||Ec.is(h.annotationId))}$(l,"is"),i.is=l}(K1||(K1={})),function(i){function a(s,l){return{textDocument:s,edits:l}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&D9.is(l.textDocument)&&Array.isArray(l.edits)}$(o,"is"),i.is=o}(_9||(_9={})),function(i){function a(s,l,u){let h={kind:"create",uri:s};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 o(s){let l=s;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||Ec.is(l.annotationId))}$(o,"is"),i.is=o}(v3||(v3={})),function(i){function a(s,l,u,h){let d={kind:"rename",oldUri:s,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 o(s){let l=s;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||Ec.is(l.annotationId))}$(o,"is"),i.is=o}(y3||(y3={})),function(i){function a(s,l,u){let h={kind:"delete",uri:s};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 o(s){let l=s;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||Ec.is(l.annotationId))}$(o,"is"),i.is=o}(b3||(b3={})),function(i){function a(o){let s=o;return s&&(s.changes!==void 0||s.documentChanges!==void 0)&&(s.documentChanges===void 0||s.documentChanges.every(l=>ct.string(l.kind)?v3.is(l)||y3.is(l)||b3.is(l):_9.is(l)))}$(a,"is"),i.is=a}(Lte||(Lte={})),R9=(t=class{constructor(a,o){this.edits=a,this.changeAnnotations=o}insert(a,o,s){let l,u;if(s===void 0?l=av.insert(a,o):Ec.is(s)?(u=s,l=K1.insert(a,o,s)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(s),l=K1.insert(a,o,u)),this.edits.push(l),u!==void 0)return u}replace(a,o,s){let l,u;if(s===void 0?l=av.replace(a,o):Ec.is(s)?(u=s,l=K1.replace(a,o,s)):(this.assertChangeAnnotations(this.changeAnnotations),u=this.changeAnnotations.manage(s),l=K1.replace(a,o,u)),this.edits.push(l),u!==void 0)return u}delete(a,o){let s,l;if(o===void 0?s=av.del(a):Ec.is(o)?(l=o,s=K1.del(a,o)):(this.assertChangeAnnotations(this.changeAnnotations),l=this.changeAnnotations.manage(o),s=K1.del(a,l)),this.edits.push(s),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),T_e=(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,o){let s;if(Ec.is(a)?s=a:(s=this.nextId(),o=a),this._annotations[s]!==void 0)throw new Error(`Id ${s} is already in use.`);if(o===void 0)throw new Error(`No annotation provided for id ${s}`);return this._annotations[s]=o,this._size++,s}nextId(){return this._counter++,this._counter.toString()}},$(e,"ChangeAnnotations"),e),Zzt=(r=class{constructor(a){this._textEditChanges=Object.create(null),a!==void 0?(this._workspaceEdit=a,a.documentChanges?(this._changeAnnotations=new T_e(a.changeAnnotations),a.changeAnnotations=this._changeAnnotations.all(),a.documentChanges.forEach(o=>{if(_9.is(o)){const s=new R9(o.edits,this._changeAnnotations);this._textEditChanges[o.textDocument.uri]=s}})):a.changes&&Object.keys(a.changes).forEach(o=>{const s=new R9(a.changes[o]);this._textEditChanges[o]=s})):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(D9.is(a)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const o={uri:a.uri,version:a.version};let s=this._textEditChanges[o.uri];if(!s){const l=[],u={textDocument:o,edits:l};this._workspaceEdit.documentChanges.push(u),s=new R9(l,this._changeAnnotations),this._textEditChanges[o.uri]=s}return s}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let o=this._textEditChanges[a];if(!o){let s=[];this._workspaceEdit.changes[a]=s,o=new R9(s),this._textEditChanges[a]=o}return o}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new T_e,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,o,s){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;aO.is(o)||Ec.is(o)?l=o:s=o;let u,h;if(l===void 0?u=v3.create(a,s):(h=Ec.is(l)?l:this._changeAnnotations.manage(l),u=v3.create(a,s,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}renameFile(a,o,s,l){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let u;aO.is(s)||Ec.is(s)?u=s:l=s;let h,d;if(u===void 0?h=y3.create(a,o,l):(d=Ec.is(u)?u:this._changeAnnotations.manage(u),h=y3.create(a,o,l,d)),this._workspaceEdit.documentChanges.push(h),d!==void 0)return d}deleteFile(a,o,s){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let l;aO.is(o)||Ec.is(o)?l=o:s=o;let u,h;if(l===void 0?u=b3.create(a,s):(h=Ec.is(l)?l:this._changeAnnotations.manage(l),u=b3.create(a,s,h)),this._workspaceEdit.documentChanges.push(u),h!==void 0)return h}},$(r,"WorkspaceChange"),r),function(i){function a(s){return{uri:s}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&ct.string(l.uri)}$(o,"is"),i.is=o}(C_e||(C_e={})),function(i){function a(s,l){return{uri:s,version:l}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&ct.string(l.uri)&&ct.integer(l.version)}$(o,"is"),i.is=o}(O_e||(O_e={})),function(i){function a(s,l){return{uri:s,version:l}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&ct.string(l.uri)&&(l.version===null||ct.integer(l.version))}$(o,"is"),i.is=o}(D9||(D9={})),function(i){function a(s,l,u,h){return{uri:s,languageId:l,version:u,text:h}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&ct.string(l.uri)&&ct.string(l.languageId)&&ct.integer(l.version)&&ct.string(l.text)}$(o,"is"),i.is=o}(k_e||(k_e={})),function(i){i.PlainText="plaintext",i.Markdown="markdown";function a(o){const s=o;return s===i.PlainText||s===i.Markdown}$(a,"is"),i.is=a}(Mte||(Mte={})),function(i){function a(o){const s=o;return ct.objectLiteral(o)&&Mte.is(s.kind)&&ct.string(s.value)}$(a,"is"),i.is=a}(x3||(x3={})),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}(E_e||(E_e={})),function(i){i.PlainText=1,i.Snippet=2}(__e||(__e={})),function(i){i.Deprecated=1}(R_e||(R_e={})),function(i){function a(s,l,u){return{newText:s,insert:l,replace:u}}$(a,"create"),i.create=a;function o(s){const l=s;return l&&ct.string(l.newText)&&Ri.is(l.insert)&&Ri.is(l.replace)}$(o,"is"),i.is=o}(D_e||(D_e={})),function(i){i.asIs=1,i.adjustIndentation=2}(L_e||(L_e={})),function(i){function a(o){const s=o;return s&&(ct.string(s.detail)||s.detail===void 0)&&(ct.string(s.description)||s.description===void 0)}$(a,"is"),i.is=a}(M_e||(M_e={})),function(i){function a(o){return{label:o}}$(a,"create"),i.create=a}(I_e||(I_e={})),function(i){function a(o,s){return{items:o||[],isIncomplete:!!s}}$(a,"create"),i.create=a}(P_e||(P_e={})),function(i){function a(s){return s.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}$(a,"fromPlainText"),i.fromPlainText=a;function o(s){const l=s;return ct.string(l)||ct.objectLiteral(l)&&ct.string(l.language)&&ct.string(l.value)}$(o,"is"),i.is=o}(L9||(L9={})),function(i){function a(o){let s=o;return!!s&&ct.objectLiteral(s)&&(x3.is(s.contents)||L9.is(s.contents)||ct.typedArray(s.contents,L9.is))&&(o.range===void 0||Ri.is(o.range))}$(a,"is"),i.is=a}(N_e||(N_e={})),function(i){function a(o,s){return s?{label:o,documentation:s}:{label:o}}$(a,"create"),i.create=a}(B_e||(B_e={})),function(i){function a(o,s,...l){let u={label:o};return ct.defined(s)&&(u.documentation=s),ct.defined(l)?u.parameters=l:u.parameters=[],u}$(a,"create"),i.create=a}($_e||($_e={})),function(i){i.Text=1,i.Read=2,i.Write=3}(F_e||(F_e={})),function(i){function a(o,s){let l={range:o};return ct.number(s)&&(l.kind=s),l}$(a,"create"),i.create=a}(z_e||(z_e={})),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}(U_e||(U_e={})),function(i){i.Deprecated=1}(V_e||(V_e={})),function(i){function a(o,s,l,u,h){let d={name:o,kind:s,location:{uri:u,range:l}};return h&&(d.containerName=h),d}$(a,"create"),i.create=a}(Q_e||(Q_e={})),function(i){function a(o,s,l,u){return u!==void 0?{name:o,kind:s,location:{uri:l,range:u}}:{name:o,kind:s,location:{uri:l}}}$(a,"create"),i.create=a}(G_e||(G_e={})),function(i){function a(s,l,u,h,d,f){let p={name:s,detail:l,kind:u,range:h,selectionRange:d};return f!==void 0&&(p.children=f),p}$(a,"create"),i.create=a;function o(s){let l=s;return l&&ct.string(l.name)&&ct.number(l.kind)&&Ri.is(l.range)&&Ri.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))}$(o,"is"),i.is=o}(H_e||(H_e={})),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"}(W_e||(W_e={})),function(i){i.Invoked=1,i.Automatic=2}(M9||(M9={})),function(i){function a(s,l,u){let h={diagnostics:s};return l!=null&&(h.only=l),u!=null&&(h.triggerKind=u),h}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&ct.typedArray(l.diagnostics,E9.is)&&(l.only===void 0||ct.typedArray(l.only,ct.string))&&(l.triggerKind===void 0||l.triggerKind===M9.Invoked||l.triggerKind===M9.Automatic)}$(o,"is"),i.is=o}(Y_e||(Y_e={})),function(i){function a(s,l,u){let h={title:s},d=!0;return typeof l=="string"?(d=!1,h.kind=l):iO.is(l)?h.command=l:h.edit=l,d&&u!==void 0&&(h.kind=u),h}$(a,"create"),i.create=a;function o(s){let l=s;return l&&ct.string(l.title)&&(l.diagnostics===void 0||ct.typedArray(l.diagnostics,E9.is))&&(l.kind===void 0||ct.string(l.kind))&&(l.edit!==void 0||l.command!==void 0)&&(l.command===void 0||iO.is(l.command))&&(l.isPreferred===void 0||ct.boolean(l.isPreferred))&&(l.edit===void 0||Lte.is(l.edit))}$(o,"is"),i.is=o}(q_e||(q_e={})),function(i){function a(s,l){let u={range:s};return ct.defined(l)&&(u.data=l),u}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&Ri.is(l.range)&&(ct.undefined(l.command)||iO.is(l.command))}$(o,"is"),i.is=o}(j_e||(j_e={})),function(i){function a(s,l){return{tabSize:s,insertSpaces:l}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&ct.uinteger(l.tabSize)&&ct.boolean(l.insertSpaces)}$(o,"is"),i.is=o}(X_e||(X_e={})),function(i){function a(s,l,u){return{range:s,target:l,data:u}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.defined(l)&&Ri.is(l.range)&&(ct.undefined(l.target)||ct.string(l.target))}$(o,"is"),i.is=o}(K_e||(K_e={})),function(i){function a(s,l){return{range:s,parent:l}}$(a,"create"),i.create=a;function o(s){let l=s;return ct.objectLiteral(l)&&Ri.is(l.range)&&(l.parent===void 0||i.is(l.parent))}$(o,"is"),i.is=o}(Z_e||(Z_e={})),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"}(J_e||(J_e={})),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"}(e5e||(e5e={})),function(i){function a(o){const s=o;return ct.objectLiteral(s)&&(s.resultId===void 0||typeof s.resultId=="string")&&Array.isArray(s.data)&&(s.data.length===0||typeof s.data[0]=="number")}$(a,"is"),i.is=a}(t5e||(t5e={})),function(i){function a(s,l){return{range:s,text:l}}$(a,"create"),i.create=a;function o(s){const l=s;return l!=null&&Ri.is(l.range)&&ct.string(l.text)}$(o,"is"),i.is=o}(r5e||(r5e={})),function(i){function a(s,l,u){return{range:s,variableName:l,caseSensitiveLookup:u}}$(a,"create"),i.create=a;function o(s){const l=s;return l!=null&&Ri.is(l.range)&&ct.boolean(l.caseSensitiveLookup)&&(ct.string(l.variableName)||l.variableName===void 0)}$(o,"is"),i.is=o}(n5e||(n5e={})),function(i){function a(s,l){return{range:s,expression:l}}$(a,"create"),i.create=a;function o(s){const l=s;return l!=null&&Ri.is(l.range)&&(ct.string(l.expression)||l.expression===void 0)}$(o,"is"),i.is=o}(i5e||(i5e={})),function(i){function a(s,l){return{frameId:s,stoppedLocation:l}}$(a,"create"),i.create=a;function o(s){const l=s;return ct.defined(l)&&Ri.is(s.stoppedLocation)}$(o,"is"),i.is=o}(a5e||(a5e={})),function(i){i.Type=1,i.Parameter=2;function a(o){return o===1||o===2}$(a,"is"),i.is=a}(Ite||(Ite={})),function(i){function a(s){return{value:s}}$(a,"create"),i.create=a;function o(s){const l=s;return ct.objectLiteral(l)&&(l.tooltip===void 0||ct.string(l.tooltip)||x3.is(l.tooltip))&&(l.location===void 0||k9.is(l.location))&&(l.command===void 0||iO.is(l.command))}$(o,"is"),i.is=o}(Pte||(Pte={})),function(i){function a(s,l,u){const h={position:s,label:l};return u!==void 0&&(h.kind=u),h}$(a,"create"),i.create=a;function o(s){const l=s;return ct.objectLiteral(l)&&ea.is(l.position)&&(ct.string(l.label)||ct.typedArray(l.label,Pte.is))&&(l.kind===void 0||Ite.is(l.kind))&&l.textEdits===void 0||ct.typedArray(l.textEdits,av.is)&&(l.tooltip===void 0||ct.string(l.tooltip)||x3.is(l.tooltip))&&(l.paddingLeft===void 0||ct.boolean(l.paddingLeft))&&(l.paddingRight===void 0||ct.boolean(l.paddingRight))}$(o,"is"),i.is=o}(o5e||(o5e={})),function(i){function a(o){return{kind:"snippet",value:o}}$(a,"createSnippet"),i.createSnippet=a}(s5e||(s5e={})),function(i){function a(o,s,l,u){return{insertText:o,filterText:s,range:l,command:u}}$(a,"create"),i.create=a}(l5e||(l5e={})),function(i){function a(o){return{items:o}}$(a,"create"),i.create=a}(c5e||(c5e={})),function(i){i.Invoked=0,i.Automatic=1}(u5e||(u5e={})),function(i){function a(o,s){return{range:o,text:s}}$(a,"create"),i.create=a}(h5e||(h5e={})),function(i){function a(o,s){return{triggerKind:o,selectedCompletionInfo:s}}$(a,"create"),i.create=a}(d5e||(d5e={})),function(i){function a(o){const s=o;return ct.objectLiteral(s)&&_te.is(s.uri)&&ct.string(s.name)}$(a,"is"),i.is=a}(f5e||(f5e={})),Jzt=[` `,`\r -`,"\r"],function(i){function a(u,h,d,f){return new Zzt(u,h,d,f)}$(a,"create"),i.create=a;function o(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))}$(o,"is"),i.is=o;function s(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}$(s,"applyEdits"),i.applyEdits=s;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(;g{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}$(s,"applyEdits"),i.applyEdits=s;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(o.length),this._lineOffsets=a}return this._lineOffsets}positionAt(a){a=Math.max(Math.min(a,this._content.length),0);let o=this.getLineOffsets(),s=0,l=o.length;if(l===0)return ea.create(0,a);for(;sa?l=h:s=h+1}let u=s-1;return ea.create(u,a-o[u])}offsetAt(a){let o=this.getLineOffsets();if(a.line>=o.length)return this._content.length;if(a.line<0)return 0;let s=o[a.line],l=a.line+1"u"}$(s,"undefined"),i.undefined=s;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={}))}}),oO=Fn({"../../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}}),P9=Fn({"../../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 o(l){return Array.isArray(l)}$(o,"array"),t.array=o;function s(l){return o(l)&&l.every(u=>r(u))}$(s,"stringArray"),t.stringArray=s}}),w3=Fn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(t){var a,o;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e=oO(),r;(function(s){const l={dispose(){}};s.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=o._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)}},$(o,"Emitter"),o);t.Emitter=i,i._noop=function(){}}}),Nte=Fn({"../../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=oO(),r=P9(),n=w3(),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()}}}),o=(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),s=(u=class{get token(){return this._token||(this._token=new o),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof o&&this._token.dispose():this._token=i.None}},$(u,"CancellationTokenSource"),u);t.CancellationTokenSource=s}}),Jzt=Fn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var L,R,D,M,I,N,F,B,V,z,U,Q,G,q,Y,ne,X,J,ee,te,pe,ie,Ce,ke,Ee;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=P9(),r;(function(ue){ue.ParseError=-32700,ue.InvalidRequest=-32600,ue.MethodNotFound=-32601,ue.InvalidParams=-32602,ue.InternalError=-32603,ue.jsonrpcReservedErrorRangeStart=-32099,ue.serverErrorStart=-32099,ue.MessageWriteError=-32099,ue.MessageReadError=-32098,ue.PendingResponseRejected=-32097,ue.ConnectionInactive=-32096,ue.ServerNotInitialized=-32002,ue.UnknownErrorCode=-32001,ue.jsonrpcReservedErrorRangeEnd=-32e3,ue.serverErrorEnd=-32e3})(r||(t.ErrorCodes=r={}));var n=(L=class extends Error{constructor(de,xe,ge){super(xe),this.code=e.number(de)?de:r.UnknownErrorCode,this.data=ge,Object.setPrototypeOf(this,L.prototype)}toJson(){const de={code:this.code,message:this.message};return this.data!==void 0&&(de.data=this.data),de}},$(L,"ResponseError"),L);t.ResponseError=n;var i=(R=class{constructor(de){this.kind=de}static is(de){return de===R.auto||de===R.byName||de===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(de,xe){this.method=de,this.numberOfParams=xe}get parameterStructures(){return i.auto}},$(D,"AbstractMessageSignature"),D);t.AbstractMessageSignature=a;var o=(M=class extends a{constructor(de){super(de,0)}},$(M,"RequestType0"),M);t.RequestType0=o;var s=(I=class extends a{constructor(de,xe=i.auto){super(de,1),this._parameterStructures=xe}get parameterStructures(){return this._parameterStructures}},$(I,"RequestType"),I);t.RequestType=s;var l=(N=class extends a{constructor(de,xe=i.auto){super(de,1),this._parameterStructures=xe}get parameterStructures(){return this._parameterStructures}},$(N,"RequestType1"),N);t.RequestType1=l;var u=(F=class extends a{constructor(de){super(de,2)}},$(F,"RequestType2"),F);t.RequestType2=u;var h=(B=class extends a{constructor(de){super(de,3)}},$(B,"RequestType3"),B);t.RequestType3=h;var d=(V=class extends a{constructor(de){super(de,4)}},$(V,"RequestType4"),V);t.RequestType4=d;var f=(z=class extends a{constructor(de){super(de,5)}},$(z,"RequestType5"),z);t.RequestType5=f;var p=(U=class extends a{constructor(de){super(de,6)}},$(U,"RequestType6"),U);t.RequestType6=p;var g=(Q=class extends a{constructor(de){super(de,7)}},$(Q,"RequestType7"),Q);t.RequestType7=g;var m=(G=class extends a{constructor(de){super(de,8)}},$(G,"RequestType8"),G);t.RequestType8=m;var v=(q=class extends a{constructor(de){super(de,9)}},$(q,"RequestType9"),q);t.RequestType9=v;var y=(Y=class extends a{constructor(de,xe=i.auto){super(de,1),this._parameterStructures=xe}get parameterStructures(){return this._parameterStructures}},$(Y,"NotificationType"),Y);t.NotificationType=y;var b=(ne=class extends a{constructor(de){super(de,0)}},$(ne,"NotificationType0"),ne);t.NotificationType0=b;var x=(X=class extends a{constructor(de,xe=i.auto){super(de,1),this._parameterStructures=xe}get parameterStructures(){return this._parameterStructures}},$(X,"NotificationType1"),X);t.NotificationType1=x;var w=(J=class extends a{constructor(de){super(de,2)}},$(J,"NotificationType2"),J);t.NotificationType2=w;var A=(ee=class extends a{constructor(de){super(de,3)}},$(ee,"NotificationType3"),ee);t.NotificationType3=A;var S=(te=class extends a{constructor(de){super(de,4)}},$(te,"NotificationType4"),te);t.NotificationType4=S;var T=(pe=class extends a{constructor(de){super(de,5)}},$(pe,"NotificationType5"),pe);t.NotificationType5=T;var C=(ie=class extends a{constructor(de){super(de,6)}},$(ie,"NotificationType6"),ie);t.NotificationType6=C;var k=(Ce=class extends a{constructor(de){super(de,7)}},$(Ce,"NotificationType7"),Ce);t.NotificationType7=k;var E=(ke=class extends a{constructor(de){super(de,8)}},$(ke,"NotificationType8"),ke);t.NotificationType8=E;var _=(Ee=class extends a{constructor(de){super(de,9)}},$(Ee,"NotificationType9"),Ee);t.NotificationType9=_;var P;(function(ue){function de(ze){const we=ze;return we&&e.string(we.method)&&(e.string(we.id)||e.number(we.id))}$(de,"isRequest"),ue.isRequest=de;function xe(ze){const we=ze;return we&&e.string(we.method)&&ze.id===void 0}$(xe,"isNotification"),ue.isNotification=xe;function ge(ze){const we=ze;return we&&(we.result!==void 0||!!we.error)&&(e.string(we.id)||e.number(we.id)||we.id===null)}$(ge,"isResponse"),ue.isResponse=ge})(P||(t.Message=P={}))}}),eUt=Fn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(t){var a,o;var e;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0;var r;(function(s){s.None=0,s.First=1,s.AsOld=s.First,s.Last=2,s.AsNew=s.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=(o=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))}},$(o,"LRUCache"),o);t.LRUCache=i}}),O9n=Fn({"../../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={}))}}),k9n=Fn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(t){var s,l,u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=void 0;var e=Nte(),r;(function(d){d.Continue=0,d.Cancelled=1})(r||(r={}));var n=(s=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()}},$(s,"SharedArraySenderStrategy"),s);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),o=(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=o}}),tUt=Fn({"../../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=oO(),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((o,s)=>{this._waiting.push({thunk:a,resolve:o,reject:s}),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 o=a.thunk();o instanceof Promise?o.then(s=>{this._active--,a.resolve(s),this.runNext()},s=>{this._active--,a.reject(s),this.runNext()}):(this._active--,a.resolve(o),this.runNext())}catch(o){this._active--,a.reject(o),this.runNext()}}},$(n,"Semaphore"),n);t.Semaphore=r}}),E9n=Fn({"../../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=oO(),r=P9(),n=w3(),i=tUt(),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 o=(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=o;var s;(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})(s||(s={}));var l=(h=class extends o{constructor(f,p){super(),this.readable=f,this.options=s.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}}),_9n=Fn({"../../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=oO(),r=P9(),n=tUt(),i=w3(),a="Content-Length: ",o=`\r -`,s;(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})(s||(t.MessageWriter=s={}));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(),o),y.push(o),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}}),R9n=Fn({"../../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 +`&&l++}s&&o.length>0&&a.push(o.length),this._lineOffsets=a}return this._lineOffsets}positionAt(a){a=Math.max(Math.min(a,this._content.length),0);let o=this.getLineOffsets(),s=0,l=o.length;if(l===0)return ea.create(0,a);for(;sa?l=h:s=h+1}let u=s-1;return ea.create(u,a-o[u])}offsetAt(a){let o=this.getLineOffsets();if(a.line>=o.length)return this._content.length;if(a.line<0)return 0;let s=o[a.line],l=a.line+1"u"}$(s,"undefined"),i.undefined=s;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={}))}}),oO=Fn({"../../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}}),P9=Fn({"../../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 o(l){return Array.isArray(l)}$(o,"array"),t.array=o;function s(l){return o(l)&&l.every(u=>r(u))}$(s,"stringArray"),t.stringArray=s}}),w3=Fn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/events.js"(t){var a,o;Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;var e=oO(),r;(function(s){const l={dispose(){}};s.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=o._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)}},$(o,"Emitter"),o);t.Emitter=i,i._noop=function(){}}}),Nte=Fn({"../../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=oO(),r=P9(),n=w3(),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()}}}),o=(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),s=(u=class{get token(){return this._token||(this._token=new o),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof o&&this._token.dispose():this._token=i.None}},$(u,"CancellationTokenSource"),u);t.CancellationTokenSource=s}}),tUt=Fn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/messages.js"(t){var L,R,D,M,I,N,F,B,V,z,U,Q,G,q,Y,ne,X,J,ee,te,pe,ie,Ce,ke,Ee;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=P9(),r;(function(ue){ue.ParseError=-32700,ue.InvalidRequest=-32600,ue.MethodNotFound=-32601,ue.InvalidParams=-32602,ue.InternalError=-32603,ue.jsonrpcReservedErrorRangeStart=-32099,ue.serverErrorStart=-32099,ue.MessageWriteError=-32099,ue.MessageReadError=-32098,ue.PendingResponseRejected=-32097,ue.ConnectionInactive=-32096,ue.ServerNotInitialized=-32002,ue.UnknownErrorCode=-32001,ue.jsonrpcReservedErrorRangeEnd=-32e3,ue.serverErrorEnd=-32e3})(r||(t.ErrorCodes=r={}));var n=(L=class extends Error{constructor(de,xe,ge){super(xe),this.code=e.number(de)?de:r.UnknownErrorCode,this.data=ge,Object.setPrototypeOf(this,L.prototype)}toJson(){const de={code:this.code,message:this.message};return this.data!==void 0&&(de.data=this.data),de}},$(L,"ResponseError"),L);t.ResponseError=n;var i=(R=class{constructor(de){this.kind=de}static is(de){return de===R.auto||de===R.byName||de===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(de,xe){this.method=de,this.numberOfParams=xe}get parameterStructures(){return i.auto}},$(D,"AbstractMessageSignature"),D);t.AbstractMessageSignature=a;var o=(M=class extends a{constructor(de){super(de,0)}},$(M,"RequestType0"),M);t.RequestType0=o;var s=(I=class extends a{constructor(de,xe=i.auto){super(de,1),this._parameterStructures=xe}get parameterStructures(){return this._parameterStructures}},$(I,"RequestType"),I);t.RequestType=s;var l=(N=class extends a{constructor(de,xe=i.auto){super(de,1),this._parameterStructures=xe}get parameterStructures(){return this._parameterStructures}},$(N,"RequestType1"),N);t.RequestType1=l;var u=(F=class extends a{constructor(de){super(de,2)}},$(F,"RequestType2"),F);t.RequestType2=u;var h=(B=class extends a{constructor(de){super(de,3)}},$(B,"RequestType3"),B);t.RequestType3=h;var d=(V=class extends a{constructor(de){super(de,4)}},$(V,"RequestType4"),V);t.RequestType4=d;var f=(z=class extends a{constructor(de){super(de,5)}},$(z,"RequestType5"),z);t.RequestType5=f;var p=(U=class extends a{constructor(de){super(de,6)}},$(U,"RequestType6"),U);t.RequestType6=p;var g=(Q=class extends a{constructor(de){super(de,7)}},$(Q,"RequestType7"),Q);t.RequestType7=g;var m=(G=class extends a{constructor(de){super(de,8)}},$(G,"RequestType8"),G);t.RequestType8=m;var v=(q=class extends a{constructor(de){super(de,9)}},$(q,"RequestType9"),q);t.RequestType9=v;var y=(Y=class extends a{constructor(de,xe=i.auto){super(de,1),this._parameterStructures=xe}get parameterStructures(){return this._parameterStructures}},$(Y,"NotificationType"),Y);t.NotificationType=y;var b=(ne=class extends a{constructor(de){super(de,0)}},$(ne,"NotificationType0"),ne);t.NotificationType0=b;var x=(X=class extends a{constructor(de,xe=i.auto){super(de,1),this._parameterStructures=xe}get parameterStructures(){return this._parameterStructures}},$(X,"NotificationType1"),X);t.NotificationType1=x;var w=(J=class extends a{constructor(de){super(de,2)}},$(J,"NotificationType2"),J);t.NotificationType2=w;var A=(ee=class extends a{constructor(de){super(de,3)}},$(ee,"NotificationType3"),ee);t.NotificationType3=A;var S=(te=class extends a{constructor(de){super(de,4)}},$(te,"NotificationType4"),te);t.NotificationType4=S;var T=(pe=class extends a{constructor(de){super(de,5)}},$(pe,"NotificationType5"),pe);t.NotificationType5=T;var C=(ie=class extends a{constructor(de){super(de,6)}},$(ie,"NotificationType6"),ie);t.NotificationType6=C;var k=(Ce=class extends a{constructor(de){super(de,7)}},$(Ce,"NotificationType7"),Ce);t.NotificationType7=k;var E=(ke=class extends a{constructor(de){super(de,8)}},$(ke,"NotificationType8"),ke);t.NotificationType8=E;var _=(Ee=class extends a{constructor(de){super(de,9)}},$(Ee,"NotificationType9"),Ee);t.NotificationType9=_;var P;(function(ue){function de(ze){const we=ze;return we&&e.string(we.method)&&(e.string(we.id)||e.number(we.id))}$(de,"isRequest"),ue.isRequest=de;function xe(ze){const we=ze;return we&&e.string(we.method)&&ze.id===void 0}$(xe,"isNotification"),ue.isNotification=xe;function ge(ze){const we=ze;return we&&(we.result!==void 0||!!we.error)&&(e.string(we.id)||e.number(we.id)||we.id===null)}$(ge,"isResponse"),ue.isResponse=ge})(P||(t.Message=P={}))}}),rUt=Fn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(t){var a,o;var e;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0;var r;(function(s){s.None=0,s.First=1,s.AsOld=s.First,s.Last=2,s.AsNew=s.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=(o=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))}},$(o,"LRUCache"),o);t.LRUCache=i}}),E9n=Fn({"../../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={}))}}),_9n=Fn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(t){var s,l,u,h;Object.defineProperty(t,"__esModule",{value:!0}),t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=void 0;var e=Nte(),r;(function(d){d.Continue=0,d.Cancelled=1})(r||(r={}));var n=(s=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()}},$(s,"SharedArraySenderStrategy"),s);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),o=(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=o}}),nUt=Fn({"../../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=oO(),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((o,s)=>{this._waiting.push({thunk:a,resolve:o,reject:s}),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 o=a.thunk();o instanceof Promise?o.then(s=>{this._active--,a.resolve(s),this.runNext()},s=>{this._active--,a.reject(s),this.runNext()}):(this._active--,a.resolve(o),this.runNext())}catch(o){this._active--,a.reject(o),this.runNext()}}},$(n,"Semaphore"),n);t.Semaphore=r}}),R9n=Fn({"../../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=oO(),r=P9(),n=w3(),i=nUt(),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 o=(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=o;var s;(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})(s||(s={}));var l=(h=class extends o{constructor(f,p){super(),this.readable=f,this.options=s.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}}),D9n=Fn({"../../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=oO(),r=P9(),n=nUt(),i=w3(),a="Content-Length: ",o=`\r +`,s;(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})(s||(t.MessageWriter=s={}));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(),o),y.push(o),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}}),L9n=Fn({"../../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(s="utf-8"){this._encoding=s,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(s){const l=typeof s=="string"?this.fromString(s,this._encoding):s;this._chunks.push(l),this._totalLength+=l.byteLength}tryReadHeaders(s=!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===s){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(d)}if(this._chunks[0].byteLength>s){const d=this._chunks[0],f=this.asNative(d,s);return this._chunks[0]=d.slice(s),this._totalLength-=s,f}const l=this.allocNative(s);let u=0,h=0;for(;s>0;){const d=this._chunks[h];if(d.byteLength>s){const f=d.slice(0,s);l.set(f,u),u+=s,this._chunks[h]=d.slice(s),this._totalLength-=s,s-=s}else l.set(d,u),u+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,s-=d.byteLength}return l}},$(a,"AbstractMessageBuffer"),a);t.AbstractMessageBuffer=i}}),D9n=Fn({"../../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=oO(),r=P9(),n=Jzt(),i=eUt(),a=w3(),o=Nte(),s;(function(D){D.type=new n.NotificationType("$/cancelRequest")})(s||(s={}));var l;(function(D){function M(I){return typeof I=="string"||typeof I=="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(I){return r.func(I)}$(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 I(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"}}$(I,"toString"),D.toString=I}(f||(t.Trace=f={}));var g;(function(D){D.Text="text",D.JSON="json"})(g||(t.TraceFormat=g={})),function(D){function M(I){return r.string(I)?(I=I.toLowerCase(),I==="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,I){super(I),this.code=M,Object.setPrototypeOf(this,R.prototype)}},$(R,"ConnectionError"),R);t.ConnectionError=b;var x;(function(D){function M(I){const N=I;return N&&r.func(N.cancelUndispatched)}$(M,"is"),D.is=M})(x||(t.ConnectionStrategy=x={}));var w;(function(D){function M(I){const N=I;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(I){const N=I;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(I){return new o.CancellationTokenSource}});function M(I){return w.is(I)||A.is(I)}$(M,"is"),D.is=M})(S||(t.CancellationReceiverStrategy=S={}));var T;(function(D){D.Message=Object.freeze({sendCancellation(I,N){return I.sendNotification(s.type,{id:N})},cleanup(I){}});function M(I){const N=I;return N&&r.func(N.sendCancellation)&&r.func(N.cleanup)}$(M,"is"),D.is=M})(T||(t.CancellationSenderStrategy=T={}));var C;(function(D){D.Message=Object.freeze({receiver:S.Message,sender:T.Message});function M(I){const N=I;return N&&S.is(N.receiver)&&T.is(N.sender)}$(M,"is"),D.is=M})(C||(t.CancellationStrategy=C={}));var k;(function(D){function M(I){const N=I;return N&&r.func(N.handleMessage)}$(M,"is"),D.is=M})(k||(t.MessageStrategy=k={}));var E;(function(D){function M(I){const N=I;return N&&(C.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 P(D,M,I,N){const F=I!==void 0?I:t.NullLogger;let B=0,V=0,z=0;const U="2.0";let Q;const G=new Map;let q;const Y=new Map,ne=new Map;let X,J=new i.LinkedMap,ee=new Map,te=new Set,pe=new Map,ie=f.Off,Ce=g.Text,ke,Ee=_.New;const ue=new a.Emitter,de=new a.Emitter,xe=new a.Emitter,ge=new a.Emitter,ze=new a.Emitter,we=N&&N.cancellationStrategy?N.cancellationStrategy:C.Message;function Oe(Me){if(Me===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Me.toString()}$(Oe,"createRequestQueueKey");function Be(Me){return Me===null?"res-unknown-"+(++z).toString():"res-"+Me.toString()}$(Be,"createResponseQueueKey");function Z(){return"not-"+(++V).toString()}$(Z,"createNotificationQueueKey");function le(Me,at){n.Message.isRequest(at)?Me.set(Oe(at.id),at):n.Message.isResponse(at)?Me.set(Be(at.id),at):Me.set(Z(),at)}$(le,"addMessageToQueue");function be(Me){}$(be,"cancelUndispatched");function ae(){return Ee===_.Listening}$(ae,"isListening");function K(){return Ee===_.Closed}$(K,"isClosed");function se(){return Ee===_.Disposed}$(se,"isDisposed");function me(){(Ee===_.New||Ee===_.Listening)&&(Ee=_.Closed,de.fire(void 0))}$(me,"closeHandler");function oe(Me){ue.fire([Me,void 0,void 0])}$(oe,"readErrorHandler");function ve(Me){ue.fire(Me)}$(ve,"writeErrorHandler"),D.onClose(me),D.onError(oe),M.onClose(me),M.onError(ve);function ce(){X||J.size===0||(X=(0,e.default)().timer.setImmediate(()=>{X=void 0,Le()}))}$(ce,"triggerMessageQueue");function De(Me){n.Message.isRequest(Me)?Ne(Me):n.Message.isNotification(Me)?$e(Me):n.Message.isResponse(Me)?je(Me):Ze(Me)}$(De,"handleMessage");function Le(){if(J.size===0)return;const Me=J.shift();try{const at=N==null?void 0:N.messageStrategy;k.is(at)?at.handleMessage(Me,De):De(Me)}finally{ce()}}$(Le,"processMessageQueue");const We=$(Me=>{try{if(n.Message.isNotification(Me)&&Me.method===s.type.method){const at=Me.params.id,wt=Oe(at),Tt=J.get(wt);if(n.Message.isRequest(Tt)){const jr=N==null?void 0:N.connectionStrategy,Ir=jr&&jr.cancelUndispatched?jr.cancelUndispatched(Tt,be):void 0;if(Ir&&(Ir.error!==void 0||Ir.result!==void 0)){J.delete(wt),pe.delete(at),Ir.id=Tt.id,yt(Ir,Me.method,Date.now()),M.write(Ir).catch(()=>F.error("Sending response for canceled message failed."));return}}const dr=pe.get(at);if(dr!==void 0){dr.cancel(),St(Me);return}else te.add(at)}le(J,Me)}finally{ce()}},"callback");function Ne(Me){if(se())return;function at(Ur,kn,$r){const dn={jsonrpc:U,id:Me.id};Ur instanceof n.ResponseError?dn.error=Ur.toJson():dn.result=Ur===void 0?null:Ur,yt(dn,kn,$r),M.write(dn).catch(()=>F.error("Sending response failed."))}$(at,"reply");function wt(Ur,kn,$r){const dn={jsonrpc:U,id:Me.id,error:Ur.toJson()};yt(dn,kn,$r),M.write(dn).catch(()=>F.error("Sending response failed."))}$(wt,"replyError");function Tt(Ur,kn,$r){Ur===void 0&&(Ur=null);const dn={jsonrpc:U,id:Me.id,result:Ur};yt(dn,kn,$r),M.write(dn).catch(()=>F.error("Sending response failed."))}$(Tt,"replySuccess"),Ie(Me);const dr=G.get(Me.method);let jr,Ir;dr&&(jr=dr.type,Ir=dr.handler);const Zr=Date.now();if(Ir||Q){const Ur=Me.id??String(Date.now()),kn=w.is(we.receiver)?we.receiver.createCancellationTokenSource(Ur):we.receiver.createCancellationTokenSource(Me);Me.id!==null&&te.has(Me.id)&&kn.cancel(),Me.id!==null&&pe.set(Ur,kn);try{let $r;if(Ir)if(Me.params===void 0){if(jr!==void 0&&jr.numberOfParams!==0){wt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Me.method} defines ${jr.numberOfParams} params but received none.`),Me.method,Zr);return}$r=Ir(kn.token)}else if(Array.isArray(Me.params)){if(jr!==void 0&&jr.parameterStructures===n.ParameterStructures.byName){wt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Me.method} defines parameters by name but received parameters by position`),Me.method,Zr);return}$r=Ir(...Me.params,kn.token)}else{if(jr!==void 0&&jr.parameterStructures===n.ParameterStructures.byPosition){wt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Me.method} defines parameters by position but received parameters by name`),Me.method,Zr);return}$r=Ir(Me.params,kn.token)}else Q&&($r=Q(Me.method,Me.params,kn.token));const dn=$r;$r?dn.then?dn.then(ii=>{pe.delete(Ur),at(ii,Me.method,Zr)},ii=>{pe.delete(Ur),ii instanceof n.ResponseError?wt(ii,Me.method,Zr):ii&&r.string(ii.message)?wt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Me.method} failed with message: ${ii.message}`),Me.method,Zr):wt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Me.method} failed unexpectedly without providing any details.`),Me.method,Zr)}):(pe.delete(Ur),at($r,Me.method,Zr)):(pe.delete(Ur),Tt($r,Me.method,Zr))}catch($r){pe.delete(Ur),$r instanceof n.ResponseError?at($r,Me.method,Zr):$r&&r.string($r.message)?wt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Me.method} failed with message: ${$r.message}`),Me.method,Zr):wt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Me.method} failed unexpectedly without providing any details.`),Me.method,Zr)}}else wt(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${Me.method}`),Me.method,Zr)}$(Ne,"handleRequest");function je(Me){if(!se())if(Me.id===null)Me.error?F.error(`Received response message without id: Error is: +${v}`);const b=v.substr(0,y),x=v.substr(y+1).trim();p.set(s?b.toLowerCase():b,x)}return p}tryReadBody(s){if(!(this._totalLengththis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===s){const d=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(d)}if(this._chunks[0].byteLength>s){const d=this._chunks[0],f=this.asNative(d,s);return this._chunks[0]=d.slice(s),this._totalLength-=s,f}const l=this.allocNative(s);let u=0,h=0;for(;s>0;){const d=this._chunks[h];if(d.byteLength>s){const f=d.slice(0,s);l.set(f,u),u+=s,this._chunks[h]=d.slice(s),this._totalLength-=s,s-=s}else l.set(d,u),u+=d.byteLength,this._chunks.shift(),this._totalLength-=d.byteLength,s-=d.byteLength}return l}},$(a,"AbstractMessageBuffer"),a);t.AbstractMessageBuffer=i}}),M9n=Fn({"../../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=oO(),r=P9(),n=tUt(),i=rUt(),a=w3(),o=Nte(),s;(function(D){D.type=new n.NotificationType("$/cancelRequest")})(s||(s={}));var l;(function(D){function M(I){return typeof I=="string"||typeof I=="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(I){return r.func(I)}$(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 I(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"}}$(I,"toString"),D.toString=I}(f||(t.Trace=f={}));var g;(function(D){D.Text="text",D.JSON="json"})(g||(t.TraceFormat=g={})),function(D){function M(I){return r.string(I)?(I=I.toLowerCase(),I==="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,I){super(I),this.code=M,Object.setPrototypeOf(this,R.prototype)}},$(R,"ConnectionError"),R);t.ConnectionError=b;var x;(function(D){function M(I){const N=I;return N&&r.func(N.cancelUndispatched)}$(M,"is"),D.is=M})(x||(t.ConnectionStrategy=x={}));var w;(function(D){function M(I){const N=I;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(I){const N=I;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(I){return new o.CancellationTokenSource}});function M(I){return w.is(I)||A.is(I)}$(M,"is"),D.is=M})(S||(t.CancellationReceiverStrategy=S={}));var T;(function(D){D.Message=Object.freeze({sendCancellation(I,N){return I.sendNotification(s.type,{id:N})},cleanup(I){}});function M(I){const N=I;return N&&r.func(N.sendCancellation)&&r.func(N.cleanup)}$(M,"is"),D.is=M})(T||(t.CancellationSenderStrategy=T={}));var C;(function(D){D.Message=Object.freeze({receiver:S.Message,sender:T.Message});function M(I){const N=I;return N&&S.is(N.receiver)&&T.is(N.sender)}$(M,"is"),D.is=M})(C||(t.CancellationStrategy=C={}));var k;(function(D){function M(I){const N=I;return N&&r.func(N.handleMessage)}$(M,"is"),D.is=M})(k||(t.MessageStrategy=k={}));var E;(function(D){function M(I){const N=I;return N&&(C.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 P(D,M,I,N){const F=I!==void 0?I:t.NullLogger;let B=0,V=0,z=0;const U="2.0";let Q;const G=new Map;let q;const Y=new Map,ne=new Map;let X,J=new i.LinkedMap,ee=new Map,te=new Set,pe=new Map,ie=f.Off,Ce=g.Text,ke,Ee=_.New;const ue=new a.Emitter,de=new a.Emitter,xe=new a.Emitter,ge=new a.Emitter,ze=new a.Emitter,we=N&&N.cancellationStrategy?N.cancellationStrategy:C.Message;function Oe(Me){if(Me===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Me.toString()}$(Oe,"createRequestQueueKey");function Be(Me){return Me===null?"res-unknown-"+(++z).toString():"res-"+Me.toString()}$(Be,"createResponseQueueKey");function Z(){return"not-"+(++V).toString()}$(Z,"createNotificationQueueKey");function le(Me,at){n.Message.isRequest(at)?Me.set(Oe(at.id),at):n.Message.isResponse(at)?Me.set(Be(at.id),at):Me.set(Z(),at)}$(le,"addMessageToQueue");function be(Me){}$(be,"cancelUndispatched");function ae(){return Ee===_.Listening}$(ae,"isListening");function K(){return Ee===_.Closed}$(K,"isClosed");function se(){return Ee===_.Disposed}$(se,"isDisposed");function me(){(Ee===_.New||Ee===_.Listening)&&(Ee=_.Closed,de.fire(void 0))}$(me,"closeHandler");function oe(Me){ue.fire([Me,void 0,void 0])}$(oe,"readErrorHandler");function ve(Me){ue.fire(Me)}$(ve,"writeErrorHandler"),D.onClose(me),D.onError(oe),M.onClose(me),M.onError(ve);function ce(){X||J.size===0||(X=(0,e.default)().timer.setImmediate(()=>{X=void 0,Le()}))}$(ce,"triggerMessageQueue");function De(Me){n.Message.isRequest(Me)?Ne(Me):n.Message.isNotification(Me)?$e(Me):n.Message.isResponse(Me)?je(Me):Ze(Me)}$(De,"handleMessage");function Le(){if(J.size===0)return;const Me=J.shift();try{const at=N==null?void 0:N.messageStrategy;k.is(at)?at.handleMessage(Me,De):De(Me)}finally{ce()}}$(Le,"processMessageQueue");const We=$(Me=>{try{if(n.Message.isNotification(Me)&&Me.method===s.type.method){const at=Me.params.id,wt=Oe(at),Tt=J.get(wt);if(n.Message.isRequest(Tt)){const jr=N==null?void 0:N.connectionStrategy,Ir=jr&&jr.cancelUndispatched?jr.cancelUndispatched(Tt,be):void 0;if(Ir&&(Ir.error!==void 0||Ir.result!==void 0)){J.delete(wt),pe.delete(at),Ir.id=Tt.id,yt(Ir,Me.method,Date.now()),M.write(Ir).catch(()=>F.error("Sending response for canceled message failed."));return}}const dr=pe.get(at);if(dr!==void 0){dr.cancel(),St(Me);return}else te.add(at)}le(J,Me)}finally{ce()}},"callback");function Ne(Me){if(se())return;function at(Ur,kn,$r){const dn={jsonrpc:U,id:Me.id};Ur instanceof n.ResponseError?dn.error=Ur.toJson():dn.result=Ur===void 0?null:Ur,yt(dn,kn,$r),M.write(dn).catch(()=>F.error("Sending response failed."))}$(at,"reply");function wt(Ur,kn,$r){const dn={jsonrpc:U,id:Me.id,error:Ur.toJson()};yt(dn,kn,$r),M.write(dn).catch(()=>F.error("Sending response failed."))}$(wt,"replyError");function Tt(Ur,kn,$r){Ur===void 0&&(Ur=null);const dn={jsonrpc:U,id:Me.id,result:Ur};yt(dn,kn,$r),M.write(dn).catch(()=>F.error("Sending response failed."))}$(Tt,"replySuccess"),Ie(Me);const dr=G.get(Me.method);let jr,Ir;dr&&(jr=dr.type,Ir=dr.handler);const Zr=Date.now();if(Ir||Q){const Ur=Me.id??String(Date.now()),kn=w.is(we.receiver)?we.receiver.createCancellationTokenSource(Ur):we.receiver.createCancellationTokenSource(Me);Me.id!==null&&te.has(Me.id)&&kn.cancel(),Me.id!==null&&pe.set(Ur,kn);try{let $r;if(Ir)if(Me.params===void 0){if(jr!==void 0&&jr.numberOfParams!==0){wt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Me.method} defines ${jr.numberOfParams} params but received none.`),Me.method,Zr);return}$r=Ir(kn.token)}else if(Array.isArray(Me.params)){if(jr!==void 0&&jr.parameterStructures===n.ParameterStructures.byName){wt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Me.method} defines parameters by name but received parameters by position`),Me.method,Zr);return}$r=Ir(...Me.params,kn.token)}else{if(jr!==void 0&&jr.parameterStructures===n.ParameterStructures.byPosition){wt(new n.ResponseError(n.ErrorCodes.InvalidParams,`Request ${Me.method} defines parameters by position but received parameters by name`),Me.method,Zr);return}$r=Ir(Me.params,kn.token)}else Q&&($r=Q(Me.method,Me.params,kn.token));const dn=$r;$r?dn.then?dn.then(ii=>{pe.delete(Ur),at(ii,Me.method,Zr)},ii=>{pe.delete(Ur),ii instanceof n.ResponseError?wt(ii,Me.method,Zr):ii&&r.string(ii.message)?wt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Me.method} failed with message: ${ii.message}`),Me.method,Zr):wt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Me.method} failed unexpectedly without providing any details.`),Me.method,Zr)}):(pe.delete(Ur),at($r,Me.method,Zr)):(pe.delete(Ur),Tt($r,Me.method,Zr))}catch($r){pe.delete(Ur),$r instanceof n.ResponseError?at($r,Me.method,Zr):$r&&r.string($r.message)?wt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Me.method} failed with message: ${$r.message}`),Me.method,Zr):wt(new n.ResponseError(n.ErrorCodes.InternalError,`Request ${Me.method} failed unexpectedly without providing any details.`),Me.method,Zr)}}else wt(new n.ResponseError(n.ErrorCodes.MethodNotFound,`Unhandled method ${Me.method}`),Me.method,Zr)}$(Ne,"handleRequest");function je(Me){if(!se())if(Me.id===null)Me.error?F.error(`Received response message without id: Error is: ${JSON.stringify(Me.error,void 0,4)}`):F.error("Received response message without id. No further error information provided.");else{const at=Me.id,wt=ee.get(at);if(kt(Me,wt),wt!==void 0){ee.delete(at);try{if(Me.error){const Tt=Me.error;wt.reject(new n.ResponseError(Tt.code,Tt.message,Tt.data))}else if(Me.result!==void 0)wt.resolve(Me.result);else throw new Error("Should never happen.")}catch(Tt){Tt.message?F.error(`Response handler '${wt.method}' failed with message: ${Tt.message}`):F.error(`Response handler '${wt.method}' failed unexpectedly.`)}}}}$(je,"handleResponse");function $e(Me){if(se())return;let at,wt;if(Me.method===s.type.method){const Tt=Me.params.id;te.delete(Tt),St(Me);return}else{const Tt=Y.get(Me.method);Tt&&(wt=Tt.handler,at=Tt.type)}if(wt||q)try{if(St(Me),wt)if(Me.params===void 0)at!==void 0&&at.numberOfParams!==0&&at.parameterStructures!==n.ParameterStructures.byName&&F.error(`Notification ${Me.method} defines ${at.numberOfParams} params but received none.`),wt();else if(Array.isArray(Me.params)){const Tt=Me.params;Me.method===u.type.method&&Tt.length===2&&l.is(Tt[0])?wt({token:Tt[0],value:Tt[1]}):(at!==void 0&&(at.parameterStructures===n.ParameterStructures.byName&&F.error(`Notification ${Me.method} defines parameters by name but received parameters by position`),at.numberOfParams!==Me.params.length&&F.error(`Notification ${Me.method} defines ${at.numberOfParams} params but received ${Tt.length} arguments`)),wt(...Tt))}else at!==void 0&&at.parameterStructures===n.ParameterStructures.byPosition&&F.error(`Notification ${Me.method} defines parameters by position but received parameters by name`),wt(Me.params);else q&&q(Me.method,Me.params)}catch(Tt){Tt.message?F.error(`Notification handler '${Me.method}' failed with message: ${Tt.message}`):F.error(`Notification handler '${Me.method}' failed unexpectedly.`)}else xe.fire(Me)}$($e,"handleNotification");function Ze(Me){if(!Me){F.error("Received empty message.");return}F.error(`Received message which is neither a response nor a notification message: ${JSON.stringify(Me,null,4)}`);const at=Me;if(r.string(at.id)||r.number(at.id)){const wt=at.id,Tt=ee.get(wt);Tt&&Tt.reject(new Error("The received response has neither a result nor an error property."))}}$(Ze,"handleInvalidMessage");function He(Me){if(Me!=null)switch(ie){case f.Verbose:return JSON.stringify(Me,null,4);case f.Compact:return JSON.stringify(Me);default:return}}$(He,"stringifyTrace");function et(Me){if(!(ie===f.Off||!ke))if(Ce===g.Text){let at;(ie===f.Verbose||ie===f.Compact)&&Me.params&&(at=`Params: ${He(Me.params)} @@ -1621,19 +1621,19 @@ ${JSON.stringify(Me,null,4)}`);const at=Me;if(r.string(at.id)||r.number(at.id)){ `:Me.error===void 0&&(wt=`No result returned. -`)),at){const Tt=Me.error?` Request failed: ${Me.error.message} (${Me.error.code}).`:"";ke.log(`Received response '${at.method} - (${Me.id})' in ${Date.now()-at.timerStart}ms.${Tt}`,wt)}else ke.log(`Received response ${Me.id} without active response promise.`,wt)}else ut("receive-response",Me)}$(kt,"traceReceivedResponse");function ut(Me,at){if(!ke||ie===f.Off)return;const wt={isLSPMessage:!0,type:Me,message:at,timestamp:Date.now()};ke.log(wt)}$(ut,"logLSPMessage");function Gt(){if(K())throw new b(y.Closed,"Connection is closed.");if(se())throw new b(y.Disposed,"Connection is disposed.")}$(Gt,"throwIfClosedOrDisposed");function It(){if(ae())throw new b(y.AlreadyListening,"Connection is already listening")}$(It,"throwIfListening");function gt(){if(!ae())throw new Error("Call listen() first.")}$(gt,"throwIfNotListening");function Te(Me){return Me===void 0?null:Me}$(Te,"undefinedToNull");function Bt(Me){if(Me!==null)return Me}$(Bt,"nullToUndefined");function Et(Me){return Me!=null&&!Array.isArray(Me)&&typeof Me=="object"}$(Et,"isNamedParam");function At(Me,at){switch(Me){case n.ParameterStructures.auto:return Et(at)?Bt(at):[Te(at)];case n.ParameterStructures.byName:if(!Et(at))throw new Error("Received parameters by name but param is not an object literal.");return Bt(at);case n.ParameterStructures.byPosition:return[Te(at)];default:throw new Error(`Unknown parameter structure ${Me.toString()}`)}}$(At,"computeSingleParam");function Mt(Me,at){let wt;const Tt=Me.numberOfParams;switch(Tt){case 0:wt=void 0;break;case 1:wt=At(Me.parameterStructures,at[0]);break;default:wt=[];for(let dr=0;dr{Gt();let wt,Tt;if(r.string(Me)){wt=Me;const jr=at[0];let Ir=0,Zr=n.ParameterStructures.auto;n.ParameterStructures.is(jr)&&(Ir=1,Zr=jr);let Ur=at.length;const kn=Ur-Ir;switch(kn){case 0:Tt=void 0;break;case 1:Tt=At(Zr,at[Ir]);break;default:if(Zr===n.ParameterStructures.byName)throw new Error(`Received ${kn} parameters for 'by Name' notification parameter structure.`);Tt=at.slice(Ir,Ur).map($r=>Te($r));break}}else{const jr=at;wt=Me.method,Tt=Mt(Me,jr)}const dr={jsonrpc:U,method:wt,params:Tt};return Pe(dr),M.write(dr).catch(jr=>{throw F.error("Sending notification failed."),jr})},"sendNotification"),onNotification:$((Me,at)=>{Gt();let wt;return r.func(Me)?q=Me:at&&(r.string(Me)?(wt=Me,Y.set(Me,{type:void 0,handler:at})):(wt=Me.method,Y.set(Me.method,{type:Me,handler:at}))),{dispose:$(()=>{wt!==void 0?Y.delete(wt):q=void 0},"dispose")}},"onNotification"),onProgress:$((Me,at,wt)=>{if(ne.has(at))throw new Error(`Progress handler for token ${at} already registered`);return ne.set(at,wt),{dispose:$(()=>{ne.delete(at)},"dispose")}},"onProgress"),sendProgress:$((Me,at,wt)=>qr.sendNotification(u.type,{token:at,value:wt}),"sendProgress"),onUnhandledProgress:ge.event,sendRequest:$((Me,...at)=>{Gt(),gt();let wt,Tt,dr;if(r.string(Me)){wt=Me;const Ur=at[0],kn=at[at.length-1];let $r=0,dn=n.ParameterStructures.auto;n.ParameterStructures.is(Ur)&&($r=1,dn=Ur);let ii=at.length;o.CancellationToken.is(kn)&&(ii=ii-1,dr=kn);const pt=ii-$r;switch(pt){case 0:Tt=void 0;break;case 1:Tt=At(dn,at[$r]);break;default:if(dn===n.ParameterStructures.byName)throw new Error(`Received ${pt} parameters for 'by Name' request parameter structure.`);Tt=at.slice($r,ii).map(Ct=>Te(Ct));break}}else{const Ur=at;wt=Me.method,Tt=Mt(Me,Ur);const kn=Me.numberOfParams;dr=o.CancellationToken.is(Ur[kn])?Ur[kn]:void 0}const jr=B++;let Ir;dr&&(Ir=dr.onCancellationRequested(()=>{const Ur=we.sender.sendCancellation(qr,jr);return Ur===void 0?(F.log(`Received no promise from cancellation strategy when cancelling id ${jr}`),Promise.resolve()):Ur.catch(()=>{F.log(`Sending cancellation messages for id ${jr} failed`)})}));const Zr={jsonrpc:U,id:jr,method:wt,params:Tt};return et(Zr),typeof we.sender.enableCancellation=="function"&&we.sender.enableCancellation(Zr),new Promise(async(Ur,kn)=>{const $r=$(pt=>{Ur(pt),we.sender.cleanup(jr),Ir==null||Ir.dispose()},"resolveWithCleanup"),dn=$(pt=>{kn(pt),we.sender.cleanup(jr),Ir==null||Ir.dispose()},"rejectWithCleanup"),ii={method:wt,timerStart:Date.now(),resolve:$r,reject:dn};try{await M.write(Zr),ee.set(jr,ii)}catch(pt){throw F.error("Sending request failed."),ii.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,pt.message?pt.message:"Unknown reason")),pt}})},"sendRequest"),onRequest:$((Me,at)=>{Gt();let wt=null;return d.is(Me)?(wt=void 0,Q=Me):r.string(Me)?(wt=null,at!==void 0&&(wt=Me,G.set(Me,{handler:at,type:void 0}))):at!==void 0&&(wt=Me.method,G.set(Me.method,{type:Me,handler:at})),{dispose:$(()=>{wt!==null&&(wt!==void 0?G.delete(wt):Q=void 0)},"dispose")}},"onRequest"),hasPendingResponse:$(()=>ee.size>0,"hasPendingResponse"),trace:$(async(Me,at,wt)=>{let Tt=!1,dr=g.Text;wt!==void 0&&(r.boolean(wt)?Tt=wt:(Tt=wt.sendNotification||!1,dr=wt.traceFormat||g.Text)),ie=Me,Ce=dr,ie===f.Off?ke=void 0:ke=at,Tt&&!K()&&!se()&&await qr.sendNotification(m.type,{value:f.toString(Me)})},"trace"),onError:ue.event,onClose:de.event,onUnhandledNotification:xe.event,onDispose:ze.event,end:$(()=>{M.end()},"end"),dispose:$(()=>{if(se())return;Ee=_.Disposed,ze.fire(void 0);const Me=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const at of ee.values())at.reject(Me);ee=new Map,pe=new Map,te=new Set,J=new i.LinkedMap,r.func(M.dispose)&&M.dispose(),r.func(D.dispose)&&D.dispose()},"dispose"),listen:$(()=>{Gt(),It(),Ee=_.Listening,D.listen(We)},"listen"),inspect:$(()=>{(0,e.default)().console.log("inspect")},"inspect")};return qr.onNotification(v.type,Me=>{if(ie===f.Off||!ke)return;const at=ie===f.Verbose||ie===f.Compact;ke.log(Me.message,at?Me.verbose:void 0)}),qr.onNotification(u.type,Me=>{const at=ne.get(Me.token);at?at(Me.value):ge.fire(Me)}),qr}$(P,"createMessageConnection"),t.createMessageConnection=P}}),g5e=Fn({"../../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=Jzt();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=eUt();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=O9n();Object.defineProperty(t,"Disposable",{enumerable:!0,get:$(function(){return n.Disposable},"get")});var i=w3();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=Nte();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 o=k9n();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:$(function(){return o.SharedArraySenderStrategy},"get")}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:$(function(){return o.SharedArrayReceiverStrategy},"get")});var s=E9n();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:$(function(){return s.MessageReader},"get")}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:$(function(){return s.AbstractMessageReader},"get")}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:$(function(){return s.ReadableStreamMessageReader},"get")});var l=_9n();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=R9n();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:$(function(){return u.AbstractMessageBuffer},"get")});var h=D9n();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=oO();t.RAL=d.default}}),L9n=Fn({"../../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=g5e(),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,o=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 s(){return o}$(s,"RIL"),function(d){function f(){e.RAL.install(o)}$(f,"install"),d.install=f}(s||(s={})),t.default=s}}),A3=Fn({"../../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=L9n();n.default.install();var i=g5e();r(g5e(),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 o=(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=o;function s(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)}$(s,"createMessageConnection"),t.createMessageConnection=s}}),rUt=Fn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=A3()}}),Po=Fn({"../../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=A3(),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 o=(d=class extends e.NotificationType0{constructor(g){super(g)}},$(d,"ProtocolNotificationType0"),d);t.ProtocolNotificationType0=o;var s=(f=class extends e.NotificationType{constructor(g){super(g,e.ParameterStructures.byName)}},$(f,"ProtocolNotificationType"),f);t.ProtocolNotificationType=s}}),m5e=Fn({"../../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 o(h){return Array.isArray(h)}$(o,"array"),t.array=o;function s(h){return o(h)&&h.every(d=>r(d))}$(s,"stringArray"),t.stringArray=s;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}}),M9n=Fn({"../../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=Po(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ImplementationRequest=r={}))}}),I9n=Fn({"../../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=Po(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.TypeDefinitionRequest=r={}))}}),P9n=Fn({"../../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=Po(),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={}))}}),N9n=Fn({"../../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=Po(),r;(function(n){n.method="workspace/configuration",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ConfigurationRequest=r={}))}}),B9n=Fn({"../../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=Po(),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={}))}}),$9n=Fn({"../../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=Po(),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={}))}}),F9n=Fn({"../../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=Po(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.DeclarationRequest=r={}))}}),z9n=Fn({"../../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=Po(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.SelectionRangeRequest=r={}))}}),U9n=Fn({"../../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=A3(),r=Po(),n;(function(o){o.type=new e.ProgressType;function s(l){return l===o.type}$(s,"is"),o.is=s})(n||(t.WorkDoneProgress=n={}));var i;(function(o){o.method="window/workDoneProgress/create",o.messageDirection=r.MessageDirection.serverToClient,o.type=new r.ProtocolRequestType(o.method)})(i||(t.WorkDoneProgressCreateRequest=i={}));var a;(function(o){o.method="window/workDoneProgress/cancel",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolNotificationType(o.method)})(a||(t.WorkDoneProgressCancelNotification=a={}))}}),V9n=Fn({"../../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=Po(),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={}))}}),Q9n=Fn({"../../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=Po(),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 o;(function(l){l.method="textDocument/semanticTokens/range",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(o||(t.SemanticTokensRangeRequest=o={}));var s;(function(l){l.method="workspace/semanticTokens/refresh",l.messageDirection=e.MessageDirection.serverToClient,l.type=new e.ProtocolRequestType0(l.method)})(s||(t.SemanticTokensRefreshRequest=s={}))}}),G9n=Fn({"../../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=Po(),r;(function(n){n.method="window/showDocument",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ShowDocumentRequest=r={}))}}),H9n=Fn({"../../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=Po(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.LinkedEditingRangeRequest=r={}))}}),W9n=Fn({"../../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=Po(),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 o;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(o||(t.DidRenameFilesNotification=o={}));var s;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(s||(t.DidDeleteFilesNotification=s={}));var l;(function(u){u.method="workspace/willDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(l||(t.WillDeleteFilesRequest=l={}))}}),Y9n=Fn({"../../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=Po(),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={}))}}),q9n=Fn({"../../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=Po(),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={}))}}),j9n=Fn({"../../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=Po(),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={}))}}),X9n=Fn({"../../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=Po(),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={}))}}),K9n=Fn({"../../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=A3(),r=m5e(),n=Po(),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 o;(function(u){u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(o||(t.DocumentDiagnosticRequest=o={}));var s;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(s||(t.WorkspaceDiagnosticRequest=s={}));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={}))}}),Z9n=Fn({"../../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=(I9(),f_e(Ete)),r=m5e(),n=Po(),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 o;(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}$(Bt,"hasId"),Te.hasId=Bt})(N||(t.StaticRegistrationOptions=N={}));var F;(function(Te){function Bt(Et){const At=Et;return At&&(At.documentSelector===null||P.is(At.documentSelector))}$(Bt,"is"),Te.is=Bt})(F||(t.TextDocumentRegistrationOptions=F={}));var B;(function(Te){function Bt(At){const Mt=At;return n.objectLiteral(Mt)&&(Mt.workDoneProgress===void 0||n.boolean(Mt.workDoneProgress))}$(Bt,"is"),Te.is=Bt;function Et(At){const Mt=At;return Mt&&n.boolean(Mt.workDoneProgress)}$(Et,"hasWorkDoneProgress"),Te.hasWorkDoneProgress=Et})(B||(t.WorkDoneProgressOptions=B={}));var V;(function(Te){Te.method="initialize",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(V||(t.InitializeRequest=V={}));var z;(function(Te){Te.unknownProtocolVersion=1})(z||(t.InitializeErrorCodes=z={}));var U;(function(Te){Te.method="initialized",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType(Te.method)})(U||(t.InitializedNotification=U={}));var Q;(function(Te){Te.method="shutdown",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType0(Te.method)})(Q||(t.ShutdownRequest=Q={}));var G;(function(Te){Te.method="exit",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType0(Te.method)})(G||(t.ExitNotification=G={}));var q;(function(Te){Te.method="workspace/didChangeConfiguration",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType(Te.method)})(q||(t.DidChangeConfigurationNotification=q={}));var Y;(function(Te){Te.Error=1,Te.Warning=2,Te.Info=3,Te.Log=4,Te.Debug=5})(Y||(t.MessageType=Y={}));var ne;(function(Te){Te.method="window/showMessage",Te.messageDirection=e.MessageDirection.serverToClient,Te.type=new e.ProtocolNotificationType(Te.method)})(ne||(t.ShowMessageNotification=ne={}));var X;(function(Te){Te.method="window/showMessageRequest",Te.messageDirection=e.MessageDirection.serverToClient,Te.type=new e.ProtocolRequestType(Te.method)})(X||(t.ShowMessageRequest=X={}));var J;(function(Te){Te.method="window/logMessage",Te.messageDirection=e.MessageDirection.serverToClient,Te.type=new e.ProtocolNotificationType(Te.method)})(J||(t.LogMessageNotification=J={}));var ee;(function(Te){Te.method="telemetry/event",Te.messageDirection=e.MessageDirection.serverToClient,Te.type=new e.ProtocolNotificationType(Te.method)})(ee||(t.TelemetryEventNotification=ee={}));var te;(function(Te){Te.None=0,Te.Full=1,Te.Incremental=2})(te||(t.TextDocumentSyncKind=te={}));var pe;(function(Te){Te.method="textDocument/didOpen",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType(Te.method)})(pe||(t.DidOpenTextDocumentNotification=pe={}));var ie;(function(Te){function Bt(At){let Mt=At;return Mt!=null&&typeof Mt.text=="string"&&Mt.range!==void 0&&(Mt.rangeLength===void 0||typeof Mt.rangeLength=="number")}$(Bt,"isIncremental"),Te.isIncremental=Bt;function Et(At){let Mt=At;return Mt!=null&&typeof Mt.text=="string"&&Mt.range===void 0&&Mt.rangeLength===void 0}$(Et,"isFull"),Te.isFull=Et})(ie||(t.TextDocumentContentChangeEvent=ie={}));var Ce;(function(Te){Te.method="textDocument/didChange",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType(Te.method)})(Ce||(t.DidChangeTextDocumentNotification=Ce={}));var ke;(function(Te){Te.method="textDocument/didClose",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType(Te.method)})(ke||(t.DidCloseTextDocumentNotification=ke={}));var Ee;(function(Te){Te.method="textDocument/didSave",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType(Te.method)})(Ee||(t.DidSaveTextDocumentNotification=Ee={}));var ue;(function(Te){Te.Manual=1,Te.AfterDelay=2,Te.FocusOut=3})(ue||(t.TextDocumentSaveReason=ue={}));var de;(function(Te){Te.method="textDocument/willSave",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType(Te.method)})(de||(t.WillSaveTextDocumentNotification=de={}));var xe;(function(Te){Te.method="textDocument/willSaveWaitUntil",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(xe||(t.WillSaveTextDocumentWaitUntilRequest=xe={}));var ge;(function(Te){Te.method="workspace/didChangeWatchedFiles",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType(Te.method)})(ge||(t.DidChangeWatchedFilesNotification=ge={}));var ze;(function(Te){Te.Created=1,Te.Changed=2,Te.Deleted=3})(ze||(t.FileChangeType=ze={}));var we;(function(Te){function Bt(Et){const At=Et;return n.objectLiteral(At)&&(r.URI.is(At.baseUri)||r.WorkspaceFolder.is(At.baseUri))&&n.string(At.pattern)}$(Bt,"is"),Te.is=Bt})(we||(t.RelativePattern=we={}));var Oe;(function(Te){Te.Create=1,Te.Change=2,Te.Delete=4})(Oe||(t.WatchKind=Oe={}));var Be;(function(Te){Te.method="textDocument/publishDiagnostics",Te.messageDirection=e.MessageDirection.serverToClient,Te.type=new e.ProtocolNotificationType(Te.method)})(Be||(t.PublishDiagnosticsNotification=Be={}));var Z;(function(Te){Te.Invoked=1,Te.TriggerCharacter=2,Te.TriggerForIncompleteCompletions=3})(Z||(t.CompletionTriggerKind=Z={}));var le;(function(Te){Te.method="textDocument/completion",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(le||(t.CompletionRequest=le={}));var be;(function(Te){Te.method="completionItem/resolve",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(be||(t.CompletionResolveRequest=be={}));var ae;(function(Te){Te.method="textDocument/hover",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(ae||(t.HoverRequest=ae={}));var K;(function(Te){Te.Invoked=1,Te.TriggerCharacter=2,Te.ContentChange=3})(K||(t.SignatureHelpTriggerKind=K={}));var se;(function(Te){Te.method="textDocument/signatureHelp",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(se||(t.SignatureHelpRequest=se={}));var me;(function(Te){Te.method="textDocument/definition",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(me||(t.DefinitionRequest=me={}));var oe;(function(Te){Te.method="textDocument/references",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(oe||(t.ReferencesRequest=oe={}));var ve;(function(Te){Te.method="textDocument/documentHighlight",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(ve||(t.DocumentHighlightRequest=ve={}));var ce;(function(Te){Te.method="textDocument/documentSymbol",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(ce||(t.DocumentSymbolRequest=ce={}));var De;(function(Te){Te.method="textDocument/codeAction",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(De||(t.CodeActionRequest=De={}));var Le;(function(Te){Te.method="codeAction/resolve",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(Le||(t.CodeActionResolveRequest=Le={}));var We;(function(Te){Te.method="workspace/symbol",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(We||(t.WorkspaceSymbolRequest=We={}));var Ne;(function(Te){Te.method="workspaceSymbol/resolve",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(Ne||(t.WorkspaceSymbolResolveRequest=Ne={}));var je;(function(Te){Te.method="textDocument/codeLens",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(je||(t.CodeLensRequest=je={}));var $e;(function(Te){Te.method="codeLens/resolve",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})($e||(t.CodeLensResolveRequest=$e={}));var Ze;(function(Te){Te.method="workspace/codeLens/refresh",Te.messageDirection=e.MessageDirection.serverToClient,Te.type=new e.ProtocolRequestType0(Te.method)})(Ze||(t.CodeLensRefreshRequest=Ze={}));var He;(function(Te){Te.method="textDocument/documentLink",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(He||(t.DocumentLinkRequest=He={}));var et;(function(Te){Te.method="documentLink/resolve",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(et||(t.DocumentLinkResolveRequest=et={}));var Pe;(function(Te){Te.method="textDocument/formatting",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(Pe||(t.DocumentFormattingRequest=Pe={}));var yt;(function(Te){Te.method="textDocument/rangeFormatting",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(yt||(t.DocumentRangeFormattingRequest=yt={}));var Ie;(function(Te){Te.method="textDocument/rangesFormatting",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(Ie||(t.DocumentRangesFormattingRequest=Ie={}));var St;(function(Te){Te.method="textDocument/onTypeFormatting",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(St||(t.DocumentOnTypeFormattingRequest=St={}));var kt;(function(Te){Te.Identifier=1})(kt||(t.PrepareSupportDefaultBehavior=kt={}));var ut;(function(Te){Te.method="textDocument/rename",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(ut||(t.RenameRequest=ut={}));var Gt;(function(Te){Te.method="textDocument/prepareRename",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(Gt||(t.PrepareRenameRequest=Gt={}));var It;(function(Te){Te.method="workspace/executeCommand",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(It||(t.ExecuteCommandRequest=It={}));var gt;(function(Te){Te.method="workspace/applyEdit",Te.messageDirection=e.MessageDirection.serverToClient,Te.type=new e.ProtocolRequestType("workspace/applyEdit")})(gt||(t.ApplyWorkspaceEditRequest=gt={}))}}),tzn=Fn({"../../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=A3();function r(n,i,a,o){return e.ConnectionStrategy.is(o)&&(o={connectionStrategy:o}),(0,e.createMessageConnection)(n,i,a,o)}$(r,"createProtocolConnection"),t.createProtocolConnection=r}}),rzn=Fn({"../../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,o,s,l){l===void 0&&(l=s);var u=Object.getOwnPropertyDescriptor(o,s);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:$(function(){return o[s]},"get")}),Object.defineProperty(a,l,u)}:function(a,o,s,l){l===void 0&&(l=s),a[l]=o[s]}),r=t&&t.__exportStar||function(a,o){for(var s in a)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&e(o,a,s)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,r(A3(),t),r((I9(),f_e(Ete)),t),r(Po(),t),r(ezn(),t);var n=tzn();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={}))}}),nzn=Fn({"../../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,o,s,l){l===void 0&&(l=s);var u=Object.getOwnPropertyDescriptor(o,s);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:$(function(){return o[s]},"get")}),Object.defineProperty(a,l,u)}:function(a,o,s,l){l===void 0&&(l=s),a[l]=o[s]}),r=t&&t.__exportStar||function(a,o){for(var s in a)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&e(o,a,s)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var n=rUt();r(rUt(),t),r(rzn(),t);function i(a,o,s,l){return(0,n.createMessageConnection)(a,o,s,l)}$(i,"createProtocolConnection"),t.createProtocolConnection=i}}),nUt={};xw(nUt,{AbstractAstReflection:()=>b5e,AbstractCstNode:()=>n3e,AbstractLangiumParser:()=>a3e,AbstractParserErrorMessageProvider:()=>uZt,AbstractThreadedAsyncParser:()=>kKn,AstUtils:()=>x5e,BiMap:()=>$ne,Cancellation:()=>Ha,CompositeCstNodeImpl:()=>One,ContextCache:()=>zne,CstNodeBuilder:()=>oZt,CstUtils:()=>v5e,DEFAULT_TOKENIZE_OPTIONS:()=>O3e,DONE_RESULT:()=>sh,DatatypeSymbol:()=>kne,DefaultAstNodeDescriptionProvider:()=>UZt,DefaultAstNodeLocator:()=>QZt,DefaultAsyncParser:()=>cJt,DefaultCommentProvider:()=>lJt,DefaultConfigurationProvider:()=>GZt,DefaultDocumentBuilder:()=>HZt,DefaultDocumentValidator:()=>zZt,DefaultHydrator:()=>hJt,DefaultIndexManager:()=>WZt,DefaultJsonSerializer:()=>NZt,DefaultLangiumDocumentFactory:()=>kZt,DefaultLangiumDocuments:()=>EZt,DefaultLangiumProfiler:()=>LKn,DefaultLexer:()=>k3e,DefaultLexerErrorMessageProvider:()=>qZt,DefaultLinker:()=>_Zt,DefaultNameProvider:()=>RZt,DefaultReferenceDescriptionProvider:()=>VZt,DefaultReferences:()=>DZt,DefaultScopeComputation:()=>LZt,DefaultScopeProvider:()=>PZt,DefaultServiceRegistry:()=>BZt,DefaultTokenBuilder:()=>Lne,DefaultValueConverter:()=>d3e,DefaultWorkspaceLock:()=>uJt,DefaultWorkspaceManager:()=>YZt,Deferred:()=>fb,Disposable:()=>KO,DisposableCache:()=>Fne,DocumentCache:()=>IZt,DocumentState:()=>ui,DocumentValidator:()=>Vp,EMPTY_SCOPE:()=>SKn,EMPTY_STREAM:()=>S3,EmptyFileSystem:()=>Lc,EmptyFileSystemProvider:()=>gJt,ErrorWithLocation:()=>lre,GrammarAST:()=>oUt,GrammarUtils:()=>K5e,IndentationAwareLexer:()=>_Kn,IndentationAwareTokenBuilder:()=>pJt,JSDocDocumentationProvider:()=>sJt,LangiumCompletionParser:()=>hZt,LangiumParser:()=>cZt,LangiumParserErrorMessageProvider:()=>o3e,LeafCstNodeImpl:()=>Cne,LexingMode:()=>ZO,MapScope:()=>AKn,Module:()=>B3e,MultiMap:()=>pb,MultiMapScope:()=>MZt,OperationCancelled:()=>vv,ParserWorker:()=>EKn,ProfilingTask:()=>vJt,Reduction:()=>B9,RefResolving:()=>jO,RegExpUtils:()=>J5e,RootCstNodeImpl:()=>i3e,SimpleCache:()=>x3e,StreamImpl:()=>sv,StreamScope:()=>b3e,TextDocument:()=>Nne,TreeStreamImpl:()=>T3,URI:()=>Af,UriTrie:()=>v3e,UriUtils:()=>ph,VALIDATE_EACH_NODE:()=>FZt,ValidationCategory:()=>Une,ValidationRegistry:()=>$Zt,ValueConverter:()=>mv,WorkspaceCache:()=>w3e,assertCondition:()=>Z5e,assertUnreachable:()=>kw,createCompletionParser:()=>c3e,createDefaultCoreModule:()=>Xl,createDefaultSharedCoreModule:()=>Kl,createGrammarConfig:()=>yRe,createLangiumParser:()=>u3e,createParser:()=>_ne,delayNextTick:()=>Mne,diagnosticData:()=>XO,eagerLoad:()=>$3e,getDiagnosticRange:()=>T3e,indentationBuilderDefaultOptions:()=>U3e,inject:()=>Mi,interruptAndCheck:()=>jl,isAstNode:()=>Xs,isAstNodeDescription:()=>y5e,isAstNodeWithComment:()=>A3e,isCompositeCstNode:()=>Z1,isIMultiModeLexerDefinition:()=>Hne,isJSDoc:()=>_3e,isLeafCstNode:()=>lO,isLinkingError:()=>sO,isMultiReference:()=>ov,isNamed:()=>y3e,isOperationCancelled:()=>qO,isReference:()=>oh,isRootCstNode:()=>Bte,isTokenTypeArray:()=>Gne,isTokenTypeDictionary:()=>Wne,loadGrammarFromJson:()=>Zl,parseJSDoc:()=>E3e,prepareLangiumParser:()=>h3e,setInterruptionPeriod:()=>f3e,startCancelableOperation:()=>Pne,stream:()=>da,toDiagnosticData:()=>C3e,toDiagnosticSeverity:()=>Fz});var v5e={};xw(v5e,{DefaultNameRegexp:()=>H5e,RangeComparison:()=>cv,compareRange:()=>Q5e,findCommentNode:()=>W5e,findDeclarationNodeAtOffset:()=>CUt,findLeafNodeAtOffset:()=>sre,findLeafNodeBeforeOffset:()=>Y5e,flattenCst:()=>TUt,getDatatypeNode:()=>SUt,getInteriorNodes:()=>EUt,getNextNode:()=>OUt,getPreviousNode:()=>j5e,getStartlineNode:()=>kUt,inRange:()=>G5e,isChildNode:()=>V5e,isCommentNode:()=>ore,streamCst:()=>N3,toDocumentSegment:()=>B3,tokenToRange:()=>q9});function Xs(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}$(Xs,"isAstNode");function oh(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}$(oh,"isReference");function ov(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}$(ov,"isMultiReference");function y5e(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}$(y5e,"isAstNodeDescription");function sO(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}$(sO,"isLinkingError");var b5e=(oL=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 Xs(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],o=a?a.superTypes.some(s=>this.isSubtype(s,r)):!1;return n[r]=o,o}}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}}},$(oL,"AbstractAstReflection"),oL);function Z1(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}$(Z1,"isCompositeCstNode");function lO(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}$(lO,"isLeafCstNode");function Bte(t){return Z1(t)&&typeof t.fullText=="string"}$(Bte,"isRootCstNode");var sv=(pd=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 pd(()=>({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 sh})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=iUt(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 pd(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?sh:{done:!1,value:e(i)}})}filter(e){return new pd(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return sh})}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 pd(()=>({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(N9(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return sh})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new pd(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const o=n.iterator.next();if(o.done)n.iterator=void 0;else return o}const{done:i,value:a}=r.nextFn(n.this);if(!i)if(N9(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return sh})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new pd(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?sh:this.nextFn(r.state)))}distinct(e){return new pd(()=>({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 sh})}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)})}},$(pd,"StreamImpl"),pd);function iUt(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}$(iUt,"toString");function N9(t){return!!t&&typeof t[Symbol.iterator]=="function"}$(N9,"isIterable");var S3=new sv(()=>{},()=>sh),sh=Object.freeze({done:!0,value:void 0});function da(...t){if(t.length===1){const e=t[0];if(e instanceof sv)return e;if(N9(e))return new sv(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new sv(()=>({index:0}),r=>r.index1?new sv(()=>({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 o=i.iterators[i.iterators.length-1].next();if(o.done)i.iterators.pop();else return i.iterators.push(r(o.value)[Symbol.iterator]()),o}return sh})}iterator(){const e={state:this.startFn(),next:$(()=>this.nextFn(e.state),"next"),prune:$(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},$(sL,"TreeStreamImpl"),sL),B9;(function(t){function e(a){return a.reduce((o,s)=>o+s,0)}$(e,"sum"),t.sum=e;function r(a){return a.reduce((o,s)=>o*s,0)}$(r,"product"),t.product=r;function n(a){return a.reduce((o,s)=>Math.min(o,s))}$(n,"min"),t.min=n;function i(a){return a.reduce((o,s)=>Math.max(o,s))}$(i,"max"),t.max=i})(B9||(B9={}));var x5e={};xw(x5e,{assignMandatoryProperties:()=>w5e,copyAstNode:()=>zte,findRootNode:()=>O3,getContainerOfType:()=>cO,getDocument:()=>Wg,getReferenceNodes:()=>$te,hasContainerOfType:()=>aUt,linkContentToContainer:()=>C3,streamAllContents:()=>J1,streamAst:()=>Yg,streamContents:()=>$9,streamReferences:()=>k3});function C3(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{Xs(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&C3(i,e))}):Xs(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&C3(n,e)))}$(C3,"linkContentToContainer");function cO(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}$(cO,"getContainerOfType");function aUt(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}$(aUt,"hasContainerOfType");function Wg(t){const r=O3(t).$document;if(!r)throw new Error("AST node has no document.");return r}$(Wg,"getDocument");function O3(t){for(;t.$container;)t=t.$container;return t}$(O3,"findRootNode");function $te(t){return oh(t)?t.ref?[t.ref]:[]:ov(t)?t.items.map(e=>e.ref):[]}$($te,"getReferenceNodes");function $9(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new sv(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndex$9(r,e))}$(J1,"streamAllContents");function Yg(t,e){if(t){if(e!=null&&e.range&&!Fte(t,e.range))return new T3(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new T3(t,r=>$9(r,e),{includeRoot:!0})}$(Yg,"streamAst");function Fte(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?G5e(r,e):!1}$(Fte,"isAstNodeInRange");function k3(t){return new sv(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexid,AbstractParserRule:()=>F9,AbstractRule:()=>E3,AbstractType:()=>mf,Action:()=>ww,Alternatives:()=>z9,ArrayLiteral:()=>Qte,ArrayType:()=>Gte,Assignment:()=>Sw,BooleanLiteral:()=>Hte,CharacterRange:()=>Tw,Condition:()=>Cw,Conjunction:()=>U9,CrossReference:()=>Ow,Disjunction:()=>V9,EndOfFile:()=>Wte,Grammar:()=>tb,GrammarImport:()=>Yte,Group:()=>dO,InferredType:()=>qte,InfixRule:()=>lv,InfixRuleOperatorList:()=>G9,InfixRuleOperators:()=>jte,Interface:()=>R3,Keyword:()=>D3,LangiumGrammarAstReflection:()=>U5e,LangiumGrammarTerminals:()=>izn,NamedArgument:()=>L3,NegatedToken:()=>pO,Negation:()=>Xte,NumberLiteral:()=>Kte,Parameter:()=>M3,ParameterReference:()=>Zte,ParserRule:()=>qg,ReferenceType:()=>H9,RegexToken:()=>gO,ReturnType:()=>Jte,RuleCall:()=>mO,SimpleType:()=>I3,StringLiteral:()=>tre,TerminalAlternatives:()=>vO,TerminalElement:()=>ad,TerminalGroup:()=>yO,TerminalRule:()=>ib,TerminalRuleCall:()=>bO,Type:()=>W9,TypeAttribute:()=>xO,TypeDefinition:()=>wO,UnionType:()=>ire,UnorderedGroup:()=>Y9,UntilToken:()=>AO,ValueLiteral:()=>SO,Wildcard:()=>P3,isAbstractElement:()=>Ute,isAbstractParserRule:()=>uO,isAbstractRule:()=>sUt,isAbstractType:()=>lUt,isAction:()=>Aw,isAlternatives:()=>Vte,isArrayLiteral:()=>cUt,isArrayType:()=>S5e,isAssignment:()=>eb,isBooleanLiteral:()=>T5e,isCharacterRange:()=>C5e,isCondition:()=>uUt,isConjunction:()=>O5e,isCrossReference:()=>hO,isDisjunction:()=>k5e,isEndOfFile:()=>E5e,isGrammar:()=>hUt,isGrammarImport:()=>dUt,isGroup:()=>fO,isInferredType:()=>Q9,isInfixRule:()=>_3,isInfixRuleOperatorList:()=>fUt,isInfixRuleOperators:()=>pUt,isInterface:()=>_5e,isKeyword:()=>rb,isNamedArgument:()=>gUt,isNegatedToken:()=>R5e,isNegation:()=>D5e,isNumberLiteral:()=>mUt,isParameter:()=>vUt,isParameterReference:()=>L5e,isParserRule:()=>lh,isReferenceType:()=>M5e,isRegexToken:()=>I5e,isReturnType:()=>P5e,isRuleCall:()=>nb,isSimpleType:()=>ere,isStringLiteral:()=>yUt,isTerminalAlternatives:()=>N5e,isTerminalElement:()=>bUt,isTerminalGroup:()=>B5e,isTerminalRule:()=>Bp,isTerminalRuleCall:()=>rre,isType:()=>nre,isTypeAttribute:()=>xUt,isTypeDefinition:()=>wUt,isUnionType:()=>$5e,isUnorderedGroup:()=>are,isUntilToken:()=>F5e,isValueLiteral:()=>AUt,isWildcard:()=>z5e,reflection:()=>cn});var izn={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]*/},id={$type:"AbstractElement",cardinality:"cardinality"};function Ute(t){return cn.isInstance(t,id.$type)}$(Ute,"isAbstractElement");var F9={$type:"AbstractParserRule"};function uO(t){return cn.isInstance(t,F9.$type)}$(uO,"isAbstractParserRule");var E3={$type:"AbstractRule"};function sUt(t){return cn.isInstance(t,E3.$type)}$(sUt,"isAbstractRule");var mf={$type:"AbstractType"};function lUt(t){return cn.isInstance(t,mf.$type)}$(lUt,"isAbstractType");var ww={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Aw(t){return cn.isInstance(t,ww.$type)}$(Aw,"isAction");var z9={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Vte(t){return cn.isInstance(t,z9.$type)}$(Vte,"isAlternatives");var Qte={$type:"ArrayLiteral",elements:"elements"};function cUt(t){return cn.isInstance(t,Qte.$type)}$(cUt,"isArrayLiteral");var Gte={$type:"ArrayType",elementType:"elementType"};function S5e(t){return cn.isInstance(t,Gte.$type)}$(S5e,"isArrayType");var Sw={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function eb(t){return cn.isInstance(t,Sw.$type)}$(eb,"isAssignment");var Hte={$type:"BooleanLiteral",true:"true"};function T5e(t){return cn.isInstance(t,Hte.$type)}$(T5e,"isBooleanLiteral");var Tw={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function C5e(t){return cn.isInstance(t,Tw.$type)}$(C5e,"isCharacterRange");var Cw={$type:"Condition"};function uUt(t){return cn.isInstance(t,Cw.$type)}$(uUt,"isCondition");var U9={$type:"Conjunction",left:"left",right:"right"};function O5e(t){return cn.isInstance(t,U9.$type)}$(O5e,"isConjunction");var Ow={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function hO(t){return cn.isInstance(t,Ow.$type)}$(hO,"isCrossReference");var V9={$type:"Disjunction",left:"left",right:"right"};function k5e(t){return cn.isInstance(t,V9.$type)}$(k5e,"isDisjunction");var Wte={$type:"EndOfFile",cardinality:"cardinality"};function E5e(t){return cn.isInstance(t,Wte.$type)}$(E5e,"isEndOfFile");var tb={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function hUt(t){return cn.isInstance(t,tb.$type)}$(hUt,"isGrammar");var Yte={$type:"GrammarImport",path:"path"};function dUt(t){return cn.isInstance(t,Yte.$type)}$(dUt,"isGrammarImport");var dO={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function fO(t){return cn.isInstance(t,dO.$type)}$(fO,"isGroup");var qte={$type:"InferredType",name:"name"};function Q9(t){return cn.isInstance(t,qte.$type)}$(Q9,"isInferredType");var lv={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function _3(t){return cn.isInstance(t,lv.$type)}$(_3,"isInfixRule");var G9={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function fUt(t){return cn.isInstance(t,G9.$type)}$(fUt,"isInfixRuleOperatorList");var jte={$type:"InfixRuleOperators",precedences:"precedences"};function pUt(t){return cn.isInstance(t,jte.$type)}$(pUt,"isInfixRuleOperators");var R3={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function _5e(t){return cn.isInstance(t,R3.$type)}$(_5e,"isInterface");var D3={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function rb(t){return cn.isInstance(t,D3.$type)}$(rb,"isKeyword");var L3={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function gUt(t){return cn.isInstance(t,L3.$type)}$(gUt,"isNamedArgument");var pO={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function R5e(t){return cn.isInstance(t,pO.$type)}$(R5e,"isNegatedToken");var Xte={$type:"Negation",value:"value"};function D5e(t){return cn.isInstance(t,Xte.$type)}$(D5e,"isNegation");var Kte={$type:"NumberLiteral",value:"value"};function mUt(t){return cn.isInstance(t,Kte.$type)}$(mUt,"isNumberLiteral");var M3={$type:"Parameter",name:"name"};function vUt(t){return cn.isInstance(t,M3.$type)}$(vUt,"isParameter");var Zte={$type:"ParameterReference",parameter:"parameter"};function L5e(t){return cn.isInstance(t,Zte.$type)}$(L5e,"isParameterReference");var qg={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function lh(t){return cn.isInstance(t,qg.$type)}$(lh,"isParserRule");var H9={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function M5e(t){return cn.isInstance(t,H9.$type)}$(M5e,"isReferenceType");var gO={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function I5e(t){return cn.isInstance(t,gO.$type)}$(I5e,"isRegexToken");var Jte={$type:"ReturnType",name:"name"};function P5e(t){return cn.isInstance(t,Jte.$type)}$(P5e,"isReturnType");var mO={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function nb(t){return cn.isInstance(t,mO.$type)}$(nb,"isRuleCall");var I3={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function ere(t){return cn.isInstance(t,I3.$type)}$(ere,"isSimpleType");var tre={$type:"StringLiteral",value:"value"};function yUt(t){return cn.isInstance(t,tre.$type)}$(yUt,"isStringLiteral");var vO={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function N5e(t){return cn.isInstance(t,vO.$type)}$(N5e,"isTerminalAlternatives");var ad={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function bUt(t){return cn.isInstance(t,ad.$type)}$(bUt,"isTerminalElement");var yO={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function B5e(t){return cn.isInstance(t,yO.$type)}$(B5e,"isTerminalGroup");var ib={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function Bp(t){return cn.isInstance(t,ib.$type)}$(Bp,"isTerminalRule");var bO={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function rre(t){return cn.isInstance(t,bO.$type)}$(rre,"isTerminalRuleCall");var W9={$type:"Type",name:"name",type:"type"};function nre(t){return cn.isInstance(t,W9.$type)}$(nre,"isType");var xO={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function xUt(t){return cn.isInstance(t,xO.$type)}$(xUt,"isTypeAttribute");var wO={$type:"TypeDefinition"};function wUt(t){return cn.isInstance(t,wO.$type)}$(wUt,"isTypeDefinition");var ire={$type:"UnionType",types:"types"};function $5e(t){return cn.isInstance(t,ire.$type)}$($5e,"isUnionType");var Y9={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function are(t){return cn.isInstance(t,Y9.$type)}$(are,"isUnorderedGroup");var AO={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function F5e(t){return cn.isInstance(t,AO.$type)}$(F5e,"isUntilToken");var SO={$type:"ValueLiteral"};function AUt(t){return cn.isInstance(t,SO.$type)}$(AUt,"isValueLiteral");var P3={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function z5e(t){return cn.isInstance(t,P3.$type)}$(z5e,"isWildcard");var U5e=(lL=class extends b5e{constructor(){super(...arguments),this.types={AbstractElement:{name:id.$type,properties:{cardinality:{name:id.cardinality}},superTypes:[]},AbstractParserRule:{name:F9.$type,properties:{},superTypes:[E3.$type,mf.$type]},AbstractRule:{name:E3.$type,properties:{},superTypes:[]},AbstractType:{name:mf.$type,properties:{},superTypes:[]},Action:{name:ww.$type,properties:{cardinality:{name:ww.cardinality},feature:{name:ww.feature},inferredType:{name:ww.inferredType},operator:{name:ww.operator},type:{name:ww.type,referenceType:mf.$type}},superTypes:[id.$type]},Alternatives:{name:z9.$type,properties:{cardinality:{name:z9.cardinality},elements:{name:z9.elements,defaultValue:[]}},superTypes:[id.$type]},ArrayLiteral:{name:Qte.$type,properties:{elements:{name:Qte.elements,defaultValue:[]}},superTypes:[SO.$type]},ArrayType:{name:Gte.$type,properties:{elementType:{name:Gte.elementType}},superTypes:[wO.$type]},Assignment:{name:Sw.$type,properties:{cardinality:{name:Sw.cardinality},feature:{name:Sw.feature},operator:{name:Sw.operator},predicate:{name:Sw.predicate},terminal:{name:Sw.terminal}},superTypes:[id.$type]},BooleanLiteral:{name:Hte.$type,properties:{true:{name:Hte.true,defaultValue:!1}},superTypes:[Cw.$type,SO.$type]},CharacterRange:{name:Tw.$type,properties:{cardinality:{name:Tw.cardinality},left:{name:Tw.left},lookahead:{name:Tw.lookahead},parenthesized:{name:Tw.parenthesized,defaultValue:!1},right:{name:Tw.right}},superTypes:[ad.$type]},Condition:{name:Cw.$type,properties:{},superTypes:[]},Conjunction:{name:U9.$type,properties:{left:{name:U9.left},right:{name:U9.right}},superTypes:[Cw.$type]},CrossReference:{name:Ow.$type,properties:{cardinality:{name:Ow.cardinality},deprecatedSyntax:{name:Ow.deprecatedSyntax,defaultValue:!1},isMulti:{name:Ow.isMulti,defaultValue:!1},terminal:{name:Ow.terminal},type:{name:Ow.type,referenceType:mf.$type}},superTypes:[id.$type]},Disjunction:{name:V9.$type,properties:{left:{name:V9.left},right:{name:V9.right}},superTypes:[Cw.$type]},EndOfFile:{name:Wte.$type,properties:{cardinality:{name:Wte.cardinality}},superTypes:[id.$type]},Grammar:{name:tb.$type,properties:{imports:{name:tb.imports,defaultValue:[]},interfaces:{name:tb.interfaces,defaultValue:[]},isDeclared:{name:tb.isDeclared,defaultValue:!1},name:{name:tb.name},rules:{name:tb.rules,defaultValue:[]},types:{name:tb.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:Yte.$type,properties:{path:{name:Yte.path}},superTypes:[]},Group:{name:dO.$type,properties:{cardinality:{name:dO.cardinality},elements:{name:dO.elements,defaultValue:[]},guardCondition:{name:dO.guardCondition},predicate:{name:dO.predicate}},superTypes:[id.$type]},InferredType:{name:qte.$type,properties:{name:{name:qte.name}},superTypes:[mf.$type]},InfixRule:{name:lv.$type,properties:{call:{name:lv.call},dataType:{name:lv.dataType},inferredType:{name:lv.inferredType},name:{name:lv.name},operators:{name:lv.operators},parameters:{name:lv.parameters,defaultValue:[]},returnType:{name:lv.returnType,referenceType:mf.$type}},superTypes:[F9.$type]},InfixRuleOperatorList:{name:G9.$type,properties:{associativity:{name:G9.associativity},operators:{name:G9.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:jte.$type,properties:{precedences:{name:jte.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:R3.$type,properties:{attributes:{name:R3.attributes,defaultValue:[]},name:{name:R3.name},superTypes:{name:R3.superTypes,defaultValue:[],referenceType:mf.$type}},superTypes:[mf.$type]},Keyword:{name:D3.$type,properties:{cardinality:{name:D3.cardinality},predicate:{name:D3.predicate},value:{name:D3.value}},superTypes:[id.$type]},NamedArgument:{name:L3.$type,properties:{calledByName:{name:L3.calledByName,defaultValue:!1},parameter:{name:L3.parameter,referenceType:M3.$type},value:{name:L3.value}},superTypes:[]},NegatedToken:{name:pO.$type,properties:{cardinality:{name:pO.cardinality},lookahead:{name:pO.lookahead},parenthesized:{name:pO.parenthesized,defaultValue:!1},terminal:{name:pO.terminal}},superTypes:[ad.$type]},Negation:{name:Xte.$type,properties:{value:{name:Xte.value}},superTypes:[Cw.$type]},NumberLiteral:{name:Kte.$type,properties:{value:{name:Kte.value}},superTypes:[SO.$type]},Parameter:{name:M3.$type,properties:{name:{name:M3.name}},superTypes:[]},ParameterReference:{name:Zte.$type,properties:{parameter:{name:Zte.parameter,referenceType:M3.$type}},superTypes:[Cw.$type]},ParserRule:{name:qg.$type,properties:{dataType:{name:qg.dataType},definition:{name:qg.definition},entry:{name:qg.entry,defaultValue:!1},fragment:{name:qg.fragment,defaultValue:!1},inferredType:{name:qg.inferredType},name:{name:qg.name},parameters:{name:qg.parameters,defaultValue:[]},returnType:{name:qg.returnType,referenceType:mf.$type}},superTypes:[F9.$type]},ReferenceType:{name:H9.$type,properties:{isMulti:{name:H9.isMulti,defaultValue:!1},referenceType:{name:H9.referenceType}},superTypes:[wO.$type]},RegexToken:{name:gO.$type,properties:{cardinality:{name:gO.cardinality},lookahead:{name:gO.lookahead},parenthesized:{name:gO.parenthesized,defaultValue:!1},regex:{name:gO.regex}},superTypes:[ad.$type]},ReturnType:{name:Jte.$type,properties:{name:{name:Jte.name}},superTypes:[]},RuleCall:{name:mO.$type,properties:{arguments:{name:mO.arguments,defaultValue:[]},cardinality:{name:mO.cardinality},predicate:{name:mO.predicate},rule:{name:mO.rule,referenceType:E3.$type}},superTypes:[id.$type]},SimpleType:{name:I3.$type,properties:{primitiveType:{name:I3.primitiveType},stringType:{name:I3.stringType},typeRef:{name:I3.typeRef,referenceType:mf.$type}},superTypes:[wO.$type]},StringLiteral:{name:tre.$type,properties:{value:{name:tre.value}},superTypes:[SO.$type]},TerminalAlternatives:{name:vO.$type,properties:{cardinality:{name:vO.cardinality},elements:{name:vO.elements,defaultValue:[]},lookahead:{name:vO.lookahead},parenthesized:{name:vO.parenthesized,defaultValue:!1}},superTypes:[ad.$type]},TerminalElement:{name:ad.$type,properties:{cardinality:{name:ad.cardinality},lookahead:{name:ad.lookahead},parenthesized:{name:ad.parenthesized,defaultValue:!1}},superTypes:[id.$type]},TerminalGroup:{name:yO.$type,properties:{cardinality:{name:yO.cardinality},elements:{name:yO.elements,defaultValue:[]},lookahead:{name:yO.lookahead},parenthesized:{name:yO.parenthesized,defaultValue:!1}},superTypes:[ad.$type]},TerminalRule:{name:ib.$type,properties:{definition:{name:ib.definition},fragment:{name:ib.fragment,defaultValue:!1},hidden:{name:ib.hidden,defaultValue:!1},name:{name:ib.name},type:{name:ib.type}},superTypes:[E3.$type]},TerminalRuleCall:{name:bO.$type,properties:{cardinality:{name:bO.cardinality},lookahead:{name:bO.lookahead},parenthesized:{name:bO.parenthesized,defaultValue:!1},rule:{name:bO.rule,referenceType:ib.$type}},superTypes:[ad.$type]},Type:{name:W9.$type,properties:{name:{name:W9.name},type:{name:W9.type}},superTypes:[mf.$type]},TypeAttribute:{name:xO.$type,properties:{defaultValue:{name:xO.defaultValue},isOptional:{name:xO.isOptional,defaultValue:!1},name:{name:xO.name},type:{name:xO.type}},superTypes:[]},TypeDefinition:{name:wO.$type,properties:{},superTypes:[]},UnionType:{name:ire.$type,properties:{types:{name:ire.types,defaultValue:[]}},superTypes:[wO.$type]},UnorderedGroup:{name:Y9.$type,properties:{cardinality:{name:Y9.cardinality},elements:{name:Y9.elements,defaultValue:[]}},superTypes:[id.$type]},UntilToken:{name:AO.$type,properties:{cardinality:{name:AO.cardinality},lookahead:{name:AO.lookahead},parenthesized:{name:AO.parenthesized,defaultValue:!1},terminal:{name:AO.terminal}},superTypes:[ad.$type]},ValueLiteral:{name:SO.$type,properties:{},superTypes:[]},Wildcard:{name:P3.$type,properties:{cardinality:{name:P3.cardinality},lookahead:{name:P3.lookahead},parenthesized:{name:P3.parenthesized,defaultValue:!1}},superTypes:[ad.$type]}}}},$(lL,"LangiumGrammarAstReflection"),lL),cn=new U5e;function SUt(t){let e=t,r=!1;for(;e;){const n=cO(e.grammarSource,lh);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}$(SUt,"getDatatypeNode");function N3(t){return new T3(t,e=>Z1(e)?e.content:[],{includeRoot:!0})}$(N3,"streamCst");function TUt(t){return N3(t).filter(lO)}$(TUt,"flattenCst");function V5e(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}$(V5e,"isChildNode");function q9(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}$(q9,"tokenToRange");function B3(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}$(B3,"toDocumentSegment");var cv;(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"})(cv||(cv={}));function Q5e(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return cv.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.linecv.After}$(G5e,"inRange");var H5e=/^[\w\p{L}]$/u;function CUt(t,e,r=H5e){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return sre(t,e)}}$(CUt,"findDeclarationNodeAtOffset");function W5e(t,e){if(t){const r=j5e(t,!0);if(r&&ore(r,e))return r;if(Bte(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(ore(a,e))return a}}}}$(W5e,"findCommentNode");function ore(t,e){return lO(t)&&e.includes(t.tokenType.name)}$(ore,"isCommentNode");function sre(t,e){if(lO(t))return t;if(Z1(t)){const r=q5e(t,e,!1);if(r)return sre(r,e)}}$(sre,"findLeafNodeAtOffset");function Y5e(t,e){if(lO(t))return t;if(Z1(t)){const r=q5e(t,e,!0);if(r)return Y5e(r,e)}}$(Y5e,"findLeafNodeBeforeOffset");function q5e(t,e,r){let n=0,i=t.content.length-1,a;for(;n<=i;){const o=Math.floor((n+i)/2),s=t.content[o];if(s.offset<=e&&s.end>e)return s;s.end<=e?(a=r?s:void 0,n=o+1):i=o-1}return a}$(q5e,"binarySearch");function j5e(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}}$(j5e,"getPreviousNode");function OUt(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;nhRe,findNameAssignment:()=>bre,findNodeForKeyword:()=>uRe,findNodeForProperty:()=>mre,findNodesForKeyword:()=>$Ut,findNodesForKeywordInternal:()=>yre,findNodesForProperty:()=>cRe,getActionAtElement:()=>fRe,getActionType:()=>gRe,getAllReachableRules:()=>gre,getAllRulesUsedForCrossReferences:()=>BUt,getCrossReferenceTerminal:()=>sRe,getEntryRule:()=>iRe,getExplicitRuleType:()=>X9,getHiddenRules:()=>aRe,getRuleType:()=>mRe,getRuleTypeName:()=>QUt,getTypeName:()=>OO,isArrayCardinality:()=>zUt,isArrayOperator:()=>UUt,isCommentTerminal:()=>lRe,isDataType:()=>VUt,isDataTypeRule:()=>j9,isOptionalCardinality:()=>FUt,terminalRegex:()=>K9});var lre=(cL=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},$(cL,"ErrorWithLocation"),cL);function kw(t,e="Error: Got unexpected value."){throw new Error(e)}$(kw,"assertUnreachable");function Z5e(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}$(Z5e,"assertCondition");var J5e={};xw(J5e,{NEWLINE_REGEXP:()=>MUt,escapeRegExp:()=>F3,getTerminalParts:()=>PUt,isMultilineComment:()=>tRe,isWhitespace:()=>pre,partialMatches:()=>rRe,partialRegExp:()=>nRe,whitespaceCharacters:()=>NUt});function An(t){return t.charCodeAt(0)}$(An,"cc");function cre(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}$(cre,"insertToSet");function $3(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}$($3,"addFlag");function TO(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}$(TO,"ASSERT_EXISTS");function RUt(){throw Error("Internal Error - Should never get here!")}$(RUt,"ASSERT_NEVER_REACH_HERE");function eRe(t){return t.type==="Character"}$(eRe,"isCharacter");var ure=[];for(let t=An("0");t<=An("9");t++)ure.push(t);var hre=[An("_")].concat(ure);for(let t=An("a");t<=An("z");t++)hre.push(t);for(let t=An("A");t<=An("Z");t++)hre.push(t);var DUt=[An(" "),An("\f"),An(` -`),An("\r"),An(" "),An("\v"),An(" "),An(" "),An(" "),An(" "),An(" "),An(" "),An(" "),An(" "),An(" "),An(" "),An(" "),An(" "),An(" "),An(" "),An("\u2028"),An("\u2029"),An(" "),An(" "),An(" "),An("\uFEFF")],azn=/[0-9a-fA-F]/,dre=/[0-9]/,ozn=/[1-9]/,LUt=(uL=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":$3(n,"global");break;case"i":$3(n,"ignoreCase");break;case"m":$3(n,"multiLine");break;case"u":$3(n,"unicode");break;case"y":$3(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 RUt()}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:[An(` -`),An("\r"),An("\u2028"),An("\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=ure;break;case"D":e=ure,r=!0;break;case"s":e=DUt;break;case"S":e=DUt,r=!0;break;case"w":e=hre;break;case"W":e=hre,r=!0;break}if(TO(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=An("\f");break;case"n":e=An(` +`)),at){const Tt=Me.error?` Request failed: ${Me.error.message} (${Me.error.code}).`:"";ke.log(`Received response '${at.method} - (${Me.id})' in ${Date.now()-at.timerStart}ms.${Tt}`,wt)}else ke.log(`Received response ${Me.id} without active response promise.`,wt)}else ut("receive-response",Me)}$(kt,"traceReceivedResponse");function ut(Me,at){if(!ke||ie===f.Off)return;const wt={isLSPMessage:!0,type:Me,message:at,timestamp:Date.now()};ke.log(wt)}$(ut,"logLSPMessage");function Gt(){if(K())throw new b(y.Closed,"Connection is closed.");if(se())throw new b(y.Disposed,"Connection is disposed.")}$(Gt,"throwIfClosedOrDisposed");function It(){if(ae())throw new b(y.AlreadyListening,"Connection is already listening")}$(It,"throwIfListening");function gt(){if(!ae())throw new Error("Call listen() first.")}$(gt,"throwIfNotListening");function Te(Me){return Me===void 0?null:Me}$(Te,"undefinedToNull");function Bt(Me){if(Me!==null)return Me}$(Bt,"nullToUndefined");function Et(Me){return Me!=null&&!Array.isArray(Me)&&typeof Me=="object"}$(Et,"isNamedParam");function At(Me,at){switch(Me){case n.ParameterStructures.auto:return Et(at)?Bt(at):[Te(at)];case n.ParameterStructures.byName:if(!Et(at))throw new Error("Received parameters by name but param is not an object literal.");return Bt(at);case n.ParameterStructures.byPosition:return[Te(at)];default:throw new Error(`Unknown parameter structure ${Me.toString()}`)}}$(At,"computeSingleParam");function Mt(Me,at){let wt;const Tt=Me.numberOfParams;switch(Tt){case 0:wt=void 0;break;case 1:wt=At(Me.parameterStructures,at[0]);break;default:wt=[];for(let dr=0;dr{Gt();let wt,Tt;if(r.string(Me)){wt=Me;const jr=at[0];let Ir=0,Zr=n.ParameterStructures.auto;n.ParameterStructures.is(jr)&&(Ir=1,Zr=jr);let Ur=at.length;const kn=Ur-Ir;switch(kn){case 0:Tt=void 0;break;case 1:Tt=At(Zr,at[Ir]);break;default:if(Zr===n.ParameterStructures.byName)throw new Error(`Received ${kn} parameters for 'by Name' notification parameter structure.`);Tt=at.slice(Ir,Ur).map($r=>Te($r));break}}else{const jr=at;wt=Me.method,Tt=Mt(Me,jr)}const dr={jsonrpc:U,method:wt,params:Tt};return Pe(dr),M.write(dr).catch(jr=>{throw F.error("Sending notification failed."),jr})},"sendNotification"),onNotification:$((Me,at)=>{Gt();let wt;return r.func(Me)?q=Me:at&&(r.string(Me)?(wt=Me,Y.set(Me,{type:void 0,handler:at})):(wt=Me.method,Y.set(Me.method,{type:Me,handler:at}))),{dispose:$(()=>{wt!==void 0?Y.delete(wt):q=void 0},"dispose")}},"onNotification"),onProgress:$((Me,at,wt)=>{if(ne.has(at))throw new Error(`Progress handler for token ${at} already registered`);return ne.set(at,wt),{dispose:$(()=>{ne.delete(at)},"dispose")}},"onProgress"),sendProgress:$((Me,at,wt)=>qr.sendNotification(u.type,{token:at,value:wt}),"sendProgress"),onUnhandledProgress:ge.event,sendRequest:$((Me,...at)=>{Gt(),gt();let wt,Tt,dr;if(r.string(Me)){wt=Me;const Ur=at[0],kn=at[at.length-1];let $r=0,dn=n.ParameterStructures.auto;n.ParameterStructures.is(Ur)&&($r=1,dn=Ur);let ii=at.length;o.CancellationToken.is(kn)&&(ii=ii-1,dr=kn);const pt=ii-$r;switch(pt){case 0:Tt=void 0;break;case 1:Tt=At(dn,at[$r]);break;default:if(dn===n.ParameterStructures.byName)throw new Error(`Received ${pt} parameters for 'by Name' request parameter structure.`);Tt=at.slice($r,ii).map(Ct=>Te(Ct));break}}else{const Ur=at;wt=Me.method,Tt=Mt(Me,Ur);const kn=Me.numberOfParams;dr=o.CancellationToken.is(Ur[kn])?Ur[kn]:void 0}const jr=B++;let Ir;dr&&(Ir=dr.onCancellationRequested(()=>{const Ur=we.sender.sendCancellation(qr,jr);return Ur===void 0?(F.log(`Received no promise from cancellation strategy when cancelling id ${jr}`),Promise.resolve()):Ur.catch(()=>{F.log(`Sending cancellation messages for id ${jr} failed`)})}));const Zr={jsonrpc:U,id:jr,method:wt,params:Tt};return et(Zr),typeof we.sender.enableCancellation=="function"&&we.sender.enableCancellation(Zr),new Promise(async(Ur,kn)=>{const $r=$(pt=>{Ur(pt),we.sender.cleanup(jr),Ir==null||Ir.dispose()},"resolveWithCleanup"),dn=$(pt=>{kn(pt),we.sender.cleanup(jr),Ir==null||Ir.dispose()},"rejectWithCleanup"),ii={method:wt,timerStart:Date.now(),resolve:$r,reject:dn};try{await M.write(Zr),ee.set(jr,ii)}catch(pt){throw F.error("Sending request failed."),ii.reject(new n.ResponseError(n.ErrorCodes.MessageWriteError,pt.message?pt.message:"Unknown reason")),pt}})},"sendRequest"),onRequest:$((Me,at)=>{Gt();let wt=null;return d.is(Me)?(wt=void 0,Q=Me):r.string(Me)?(wt=null,at!==void 0&&(wt=Me,G.set(Me,{handler:at,type:void 0}))):at!==void 0&&(wt=Me.method,G.set(Me.method,{type:Me,handler:at})),{dispose:$(()=>{wt!==null&&(wt!==void 0?G.delete(wt):Q=void 0)},"dispose")}},"onRequest"),hasPendingResponse:$(()=>ee.size>0,"hasPendingResponse"),trace:$(async(Me,at,wt)=>{let Tt=!1,dr=g.Text;wt!==void 0&&(r.boolean(wt)?Tt=wt:(Tt=wt.sendNotification||!1,dr=wt.traceFormat||g.Text)),ie=Me,Ce=dr,ie===f.Off?ke=void 0:ke=at,Tt&&!K()&&!se()&&await qr.sendNotification(m.type,{value:f.toString(Me)})},"trace"),onError:ue.event,onClose:de.event,onUnhandledNotification:xe.event,onDispose:ze.event,end:$(()=>{M.end()},"end"),dispose:$(()=>{if(se())return;Ee=_.Disposed,ze.fire(void 0);const Me=new n.ResponseError(n.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const at of ee.values())at.reject(Me);ee=new Map,pe=new Map,te=new Set,J=new i.LinkedMap,r.func(M.dispose)&&M.dispose(),r.func(D.dispose)&&D.dispose()},"dispose"),listen:$(()=>{Gt(),It(),Ee=_.Listening,D.listen(We)},"listen"),inspect:$(()=>{(0,e.default)().console.log("inspect")},"inspect")};return qr.onNotification(v.type,Me=>{if(ie===f.Off||!ke)return;const at=ie===f.Verbose||ie===f.Compact;ke.log(Me.message,at?Me.verbose:void 0)}),qr.onNotification(u.type,Me=>{const at=ne.get(Me.token);at?at(Me.value):ge.fire(Me)}),qr}$(P,"createMessageConnection"),t.createMessageConnection=P}}),g5e=Fn({"../../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=tUt();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=rUt();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=E9n();Object.defineProperty(t,"Disposable",{enumerable:!0,get:$(function(){return n.Disposable},"get")});var i=w3();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=Nte();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 o=_9n();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:$(function(){return o.SharedArraySenderStrategy},"get")}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:$(function(){return o.SharedArrayReceiverStrategy},"get")});var s=R9n();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:$(function(){return s.MessageReader},"get")}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:$(function(){return s.AbstractMessageReader},"get")}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:$(function(){return s.ReadableStreamMessageReader},"get")});var l=D9n();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=L9n();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:$(function(){return u.AbstractMessageBuffer},"get")});var h=M9n();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=oO();t.RAL=d.default}}),I9n=Fn({"../../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=g5e(),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,o=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 s(){return o}$(s,"RIL"),function(d){function f(){e.RAL.install(o)}$(f,"install"),d.install=f}(s||(s={})),t.default=s}}),A3=Fn({"../../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=I9n();n.default.install();var i=g5e();r(g5e(),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 o=(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=o;function s(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)}$(s,"createMessageConnection"),t.createMessageConnection=s}}),iUt=Fn({"../../node_modules/.pnpm/vscode-jsonrpc@8.2.0/node_modules/vscode-jsonrpc/browser.js"(t,e){e.exports=A3()}}),Po=Fn({"../../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=A3(),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 o=(d=class extends e.NotificationType0{constructor(g){super(g)}},$(d,"ProtocolNotificationType0"),d);t.ProtocolNotificationType0=o;var s=(f=class extends e.NotificationType{constructor(g){super(g,e.ParameterStructures.byName)}},$(f,"ProtocolNotificationType"),f);t.ProtocolNotificationType=s}}),m5e=Fn({"../../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 o(h){return Array.isArray(h)}$(o,"array"),t.array=o;function s(h){return o(h)&&h.every(d=>r(d))}$(s,"stringArray"),t.stringArray=s;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}}),P9n=Fn({"../../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=Po(),r;(function(n){n.method="textDocument/implementation",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ImplementationRequest=r={}))}}),N9n=Fn({"../../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=Po(),r;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.TypeDefinitionRequest=r={}))}}),B9n=Fn({"../../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=Po(),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={}))}}),$9n=Fn({"../../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=Po(),r;(function(n){n.method="workspace/configuration",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ConfigurationRequest=r={}))}}),F9n=Fn({"../../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=Po(),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={}))}}),z9n=Fn({"../../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=Po(),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={}))}}),U9n=Fn({"../../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=Po(),r;(function(n){n.method="textDocument/declaration",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.DeclarationRequest=r={}))}}),V9n=Fn({"../../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=Po(),r;(function(n){n.method="textDocument/selectionRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.SelectionRangeRequest=r={}))}}),Q9n=Fn({"../../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=A3(),r=Po(),n;(function(o){o.type=new e.ProgressType;function s(l){return l===o.type}$(s,"is"),o.is=s})(n||(t.WorkDoneProgress=n={}));var i;(function(o){o.method="window/workDoneProgress/create",o.messageDirection=r.MessageDirection.serverToClient,o.type=new r.ProtocolRequestType(o.method)})(i||(t.WorkDoneProgressCreateRequest=i={}));var a;(function(o){o.method="window/workDoneProgress/cancel",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolNotificationType(o.method)})(a||(t.WorkDoneProgressCancelNotification=a={}))}}),G9n=Fn({"../../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=Po(),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={}))}}),H9n=Fn({"../../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=Po(),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 o;(function(l){l.method="textDocument/semanticTokens/range",l.messageDirection=e.MessageDirection.clientToServer,l.type=new e.ProtocolRequestType(l.method),l.registrationMethod=n.method})(o||(t.SemanticTokensRangeRequest=o={}));var s;(function(l){l.method="workspace/semanticTokens/refresh",l.messageDirection=e.MessageDirection.serverToClient,l.type=new e.ProtocolRequestType0(l.method)})(s||(t.SemanticTokensRefreshRequest=s={}))}}),W9n=Fn({"../../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=Po(),r;(function(n){n.method="window/showDocument",n.messageDirection=e.MessageDirection.serverToClient,n.type=new e.ProtocolRequestType(n.method)})(r||(t.ShowDocumentRequest=r={}))}}),Y9n=Fn({"../../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=Po(),r;(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=e.MessageDirection.clientToServer,n.type=new e.ProtocolRequestType(n.method)})(r||(t.LinkedEditingRangeRequest=r={}))}}),q9n=Fn({"../../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=Po(),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 o;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(o||(t.DidRenameFilesNotification=o={}));var s;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolNotificationType(u.method)})(s||(t.DidDeleteFilesNotification=s={}));var l;(function(u){u.method="workspace/willDeleteFiles",u.messageDirection=e.MessageDirection.clientToServer,u.type=new e.ProtocolRequestType(u.method)})(l||(t.WillDeleteFilesRequest=l={}))}}),j9n=Fn({"../../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=Po(),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={}))}}),X9n=Fn({"../../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=Po(),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={}))}}),K9n=Fn({"../../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=Po(),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={}))}}),Z9n=Fn({"../../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=Po(),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={}))}}),J9n=Fn({"../../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=A3(),r=m5e(),n=Po(),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 o;(function(u){u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(o||(t.DocumentDiagnosticRequest=o={}));var s;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new e.ProgressType})(s||(t.WorkspaceDiagnosticRequest=s={}));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={}))}}),ezn=Fn({"../../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=(I9(),f_e(Ete)),r=m5e(),n=Po(),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 o;(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}$(Bt,"hasId"),Te.hasId=Bt})(N||(t.StaticRegistrationOptions=N={}));var F;(function(Te){function Bt(Et){const At=Et;return At&&(At.documentSelector===null||P.is(At.documentSelector))}$(Bt,"is"),Te.is=Bt})(F||(t.TextDocumentRegistrationOptions=F={}));var B;(function(Te){function Bt(At){const Mt=At;return n.objectLiteral(Mt)&&(Mt.workDoneProgress===void 0||n.boolean(Mt.workDoneProgress))}$(Bt,"is"),Te.is=Bt;function Et(At){const Mt=At;return Mt&&n.boolean(Mt.workDoneProgress)}$(Et,"hasWorkDoneProgress"),Te.hasWorkDoneProgress=Et})(B||(t.WorkDoneProgressOptions=B={}));var V;(function(Te){Te.method="initialize",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(V||(t.InitializeRequest=V={}));var z;(function(Te){Te.unknownProtocolVersion=1})(z||(t.InitializeErrorCodes=z={}));var U;(function(Te){Te.method="initialized",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType(Te.method)})(U||(t.InitializedNotification=U={}));var Q;(function(Te){Te.method="shutdown",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType0(Te.method)})(Q||(t.ShutdownRequest=Q={}));var G;(function(Te){Te.method="exit",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType0(Te.method)})(G||(t.ExitNotification=G={}));var q;(function(Te){Te.method="workspace/didChangeConfiguration",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType(Te.method)})(q||(t.DidChangeConfigurationNotification=q={}));var Y;(function(Te){Te.Error=1,Te.Warning=2,Te.Info=3,Te.Log=4,Te.Debug=5})(Y||(t.MessageType=Y={}));var ne;(function(Te){Te.method="window/showMessage",Te.messageDirection=e.MessageDirection.serverToClient,Te.type=new e.ProtocolNotificationType(Te.method)})(ne||(t.ShowMessageNotification=ne={}));var X;(function(Te){Te.method="window/showMessageRequest",Te.messageDirection=e.MessageDirection.serverToClient,Te.type=new e.ProtocolRequestType(Te.method)})(X||(t.ShowMessageRequest=X={}));var J;(function(Te){Te.method="window/logMessage",Te.messageDirection=e.MessageDirection.serverToClient,Te.type=new e.ProtocolNotificationType(Te.method)})(J||(t.LogMessageNotification=J={}));var ee;(function(Te){Te.method="telemetry/event",Te.messageDirection=e.MessageDirection.serverToClient,Te.type=new e.ProtocolNotificationType(Te.method)})(ee||(t.TelemetryEventNotification=ee={}));var te;(function(Te){Te.None=0,Te.Full=1,Te.Incremental=2})(te||(t.TextDocumentSyncKind=te={}));var pe;(function(Te){Te.method="textDocument/didOpen",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType(Te.method)})(pe||(t.DidOpenTextDocumentNotification=pe={}));var ie;(function(Te){function Bt(At){let Mt=At;return Mt!=null&&typeof Mt.text=="string"&&Mt.range!==void 0&&(Mt.rangeLength===void 0||typeof Mt.rangeLength=="number")}$(Bt,"isIncremental"),Te.isIncremental=Bt;function Et(At){let Mt=At;return Mt!=null&&typeof Mt.text=="string"&&Mt.range===void 0&&Mt.rangeLength===void 0}$(Et,"isFull"),Te.isFull=Et})(ie||(t.TextDocumentContentChangeEvent=ie={}));var Ce;(function(Te){Te.method="textDocument/didChange",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType(Te.method)})(Ce||(t.DidChangeTextDocumentNotification=Ce={}));var ke;(function(Te){Te.method="textDocument/didClose",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType(Te.method)})(ke||(t.DidCloseTextDocumentNotification=ke={}));var Ee;(function(Te){Te.method="textDocument/didSave",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType(Te.method)})(Ee||(t.DidSaveTextDocumentNotification=Ee={}));var ue;(function(Te){Te.Manual=1,Te.AfterDelay=2,Te.FocusOut=3})(ue||(t.TextDocumentSaveReason=ue={}));var de;(function(Te){Te.method="textDocument/willSave",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType(Te.method)})(de||(t.WillSaveTextDocumentNotification=de={}));var xe;(function(Te){Te.method="textDocument/willSaveWaitUntil",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(xe||(t.WillSaveTextDocumentWaitUntilRequest=xe={}));var ge;(function(Te){Te.method="workspace/didChangeWatchedFiles",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolNotificationType(Te.method)})(ge||(t.DidChangeWatchedFilesNotification=ge={}));var ze;(function(Te){Te.Created=1,Te.Changed=2,Te.Deleted=3})(ze||(t.FileChangeType=ze={}));var we;(function(Te){function Bt(Et){const At=Et;return n.objectLiteral(At)&&(r.URI.is(At.baseUri)||r.WorkspaceFolder.is(At.baseUri))&&n.string(At.pattern)}$(Bt,"is"),Te.is=Bt})(we||(t.RelativePattern=we={}));var Oe;(function(Te){Te.Create=1,Te.Change=2,Te.Delete=4})(Oe||(t.WatchKind=Oe={}));var Be;(function(Te){Te.method="textDocument/publishDiagnostics",Te.messageDirection=e.MessageDirection.serverToClient,Te.type=new e.ProtocolNotificationType(Te.method)})(Be||(t.PublishDiagnosticsNotification=Be={}));var Z;(function(Te){Te.Invoked=1,Te.TriggerCharacter=2,Te.TriggerForIncompleteCompletions=3})(Z||(t.CompletionTriggerKind=Z={}));var le;(function(Te){Te.method="textDocument/completion",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(le||(t.CompletionRequest=le={}));var be;(function(Te){Te.method="completionItem/resolve",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(be||(t.CompletionResolveRequest=be={}));var ae;(function(Te){Te.method="textDocument/hover",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(ae||(t.HoverRequest=ae={}));var K;(function(Te){Te.Invoked=1,Te.TriggerCharacter=2,Te.ContentChange=3})(K||(t.SignatureHelpTriggerKind=K={}));var se;(function(Te){Te.method="textDocument/signatureHelp",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(se||(t.SignatureHelpRequest=se={}));var me;(function(Te){Te.method="textDocument/definition",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(me||(t.DefinitionRequest=me={}));var oe;(function(Te){Te.method="textDocument/references",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(oe||(t.ReferencesRequest=oe={}));var ve;(function(Te){Te.method="textDocument/documentHighlight",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(ve||(t.DocumentHighlightRequest=ve={}));var ce;(function(Te){Te.method="textDocument/documentSymbol",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(ce||(t.DocumentSymbolRequest=ce={}));var De;(function(Te){Te.method="textDocument/codeAction",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(De||(t.CodeActionRequest=De={}));var Le;(function(Te){Te.method="codeAction/resolve",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(Le||(t.CodeActionResolveRequest=Le={}));var We;(function(Te){Te.method="workspace/symbol",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(We||(t.WorkspaceSymbolRequest=We={}));var Ne;(function(Te){Te.method="workspaceSymbol/resolve",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(Ne||(t.WorkspaceSymbolResolveRequest=Ne={}));var je;(function(Te){Te.method="textDocument/codeLens",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(je||(t.CodeLensRequest=je={}));var $e;(function(Te){Te.method="codeLens/resolve",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})($e||(t.CodeLensResolveRequest=$e={}));var Ze;(function(Te){Te.method="workspace/codeLens/refresh",Te.messageDirection=e.MessageDirection.serverToClient,Te.type=new e.ProtocolRequestType0(Te.method)})(Ze||(t.CodeLensRefreshRequest=Ze={}));var He;(function(Te){Te.method="textDocument/documentLink",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(He||(t.DocumentLinkRequest=He={}));var et;(function(Te){Te.method="documentLink/resolve",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(et||(t.DocumentLinkResolveRequest=et={}));var Pe;(function(Te){Te.method="textDocument/formatting",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(Pe||(t.DocumentFormattingRequest=Pe={}));var yt;(function(Te){Te.method="textDocument/rangeFormatting",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(yt||(t.DocumentRangeFormattingRequest=yt={}));var Ie;(function(Te){Te.method="textDocument/rangesFormatting",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(Ie||(t.DocumentRangesFormattingRequest=Ie={}));var St;(function(Te){Te.method="textDocument/onTypeFormatting",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(St||(t.DocumentOnTypeFormattingRequest=St={}));var kt;(function(Te){Te.Identifier=1})(kt||(t.PrepareSupportDefaultBehavior=kt={}));var ut;(function(Te){Te.method="textDocument/rename",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(ut||(t.RenameRequest=ut={}));var Gt;(function(Te){Te.method="textDocument/prepareRename",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(Gt||(t.PrepareRenameRequest=Gt={}));var It;(function(Te){Te.method="workspace/executeCommand",Te.messageDirection=e.MessageDirection.clientToServer,Te.type=new e.ProtocolRequestType(Te.method)})(It||(t.ExecuteCommandRequest=It={}));var gt;(function(Te){Te.method="workspace/applyEdit",Te.messageDirection=e.MessageDirection.serverToClient,Te.type=new e.ProtocolRequestType("workspace/applyEdit")})(gt||(t.ApplyWorkspaceEditRequest=gt={}))}}),nzn=Fn({"../../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=A3();function r(n,i,a,o){return e.ConnectionStrategy.is(o)&&(o={connectionStrategy:o}),(0,e.createMessageConnection)(n,i,a,o)}$(r,"createProtocolConnection"),t.createProtocolConnection=r}}),izn=Fn({"../../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,o,s,l){l===void 0&&(l=s);var u=Object.getOwnPropertyDescriptor(o,s);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:$(function(){return o[s]},"get")}),Object.defineProperty(a,l,u)}:function(a,o,s,l){l===void 0&&(l=s),a[l]=o[s]}),r=t&&t.__exportStar||function(a,o){for(var s in a)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&e(o,a,s)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,r(A3(),t),r((I9(),f_e(Ete)),t),r(Po(),t),r(rzn(),t);var n=nzn();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={}))}}),azn=Fn({"../../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,o,s,l){l===void 0&&(l=s);var u=Object.getOwnPropertyDescriptor(o,s);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:$(function(){return o[s]},"get")}),Object.defineProperty(a,l,u)}:function(a,o,s,l){l===void 0&&(l=s),a[l]=o[s]}),r=t&&t.__exportStar||function(a,o){for(var s in a)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&e(o,a,s)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;var n=iUt();r(iUt(),t),r(izn(),t);function i(a,o,s,l){return(0,n.createMessageConnection)(a,o,s,l)}$(i,"createProtocolConnection"),t.createProtocolConnection=i}}),aUt={};xw(aUt,{AbstractAstReflection:()=>b5e,AbstractCstNode:()=>n3e,AbstractLangiumParser:()=>a3e,AbstractParserErrorMessageProvider:()=>dZt,AbstractThreadedAsyncParser:()=>_Kn,AstUtils:()=>x5e,BiMap:()=>$ne,Cancellation:()=>Ha,CompositeCstNodeImpl:()=>One,ContextCache:()=>zne,CstNodeBuilder:()=>lZt,CstUtils:()=>v5e,DEFAULT_TOKENIZE_OPTIONS:()=>O3e,DONE_RESULT:()=>sh,DatatypeSymbol:()=>kne,DefaultAstNodeDescriptionProvider:()=>QZt,DefaultAstNodeLocator:()=>HZt,DefaultAsyncParser:()=>hJt,DefaultCommentProvider:()=>uJt,DefaultConfigurationProvider:()=>WZt,DefaultDocumentBuilder:()=>YZt,DefaultDocumentValidator:()=>VZt,DefaultHydrator:()=>fJt,DefaultIndexManager:()=>qZt,DefaultJsonSerializer:()=>$Zt,DefaultLangiumDocumentFactory:()=>_Zt,DefaultLangiumDocuments:()=>RZt,DefaultLangiumProfiler:()=>IKn,DefaultLexer:()=>k3e,DefaultLexerErrorMessageProvider:()=>XZt,DefaultLinker:()=>DZt,DefaultNameProvider:()=>LZt,DefaultReferenceDescriptionProvider:()=>GZt,DefaultReferences:()=>MZt,DefaultScopeComputation:()=>IZt,DefaultScopeProvider:()=>BZt,DefaultServiceRegistry:()=>FZt,DefaultTokenBuilder:()=>Lne,DefaultValueConverter:()=>d3e,DefaultWorkspaceLock:()=>dJt,DefaultWorkspaceManager:()=>jZt,Deferred:()=>fb,Disposable:()=>KO,DisposableCache:()=>Fne,DocumentCache:()=>NZt,DocumentState:()=>ui,DocumentValidator:()=>Vp,EMPTY_SCOPE:()=>CKn,EMPTY_STREAM:()=>S3,EmptyFileSystem:()=>Lc,EmptyFileSystemProvider:()=>vJt,ErrorWithLocation:()=>lre,GrammarAST:()=>lUt,GrammarUtils:()=>K5e,IndentationAwareLexer:()=>DKn,IndentationAwareTokenBuilder:()=>mJt,JSDocDocumentationProvider:()=>cJt,LangiumCompletionParser:()=>fZt,LangiumParser:()=>hZt,LangiumParserErrorMessageProvider:()=>o3e,LeafCstNodeImpl:()=>Cne,LexingMode:()=>ZO,MapScope:()=>TKn,Module:()=>B3e,MultiMap:()=>pb,MultiMapScope:()=>PZt,OperationCancelled:()=>vv,ParserWorker:()=>RKn,ProfilingTask:()=>bJt,Reduction:()=>B9,RefResolving:()=>jO,RegExpUtils:()=>J5e,RootCstNodeImpl:()=>i3e,SimpleCache:()=>x3e,StreamImpl:()=>sv,StreamScope:()=>b3e,TextDocument:()=>Nne,TreeStreamImpl:()=>T3,URI:()=>Af,UriTrie:()=>v3e,UriUtils:()=>ph,VALIDATE_EACH_NODE:()=>UZt,ValidationCategory:()=>Une,ValidationRegistry:()=>zZt,ValueConverter:()=>mv,WorkspaceCache:()=>w3e,assertCondition:()=>Z5e,assertUnreachable:()=>kw,createCompletionParser:()=>c3e,createDefaultCoreModule:()=>Xl,createDefaultSharedCoreModule:()=>Kl,createGrammarConfig:()=>yRe,createLangiumParser:()=>u3e,createParser:()=>_ne,delayNextTick:()=>Mne,diagnosticData:()=>XO,eagerLoad:()=>$3e,getDiagnosticRange:()=>T3e,indentationBuilderDefaultOptions:()=>U3e,inject:()=>Mi,interruptAndCheck:()=>jl,isAstNode:()=>Xs,isAstNodeDescription:()=>y5e,isAstNodeWithComment:()=>A3e,isCompositeCstNode:()=>Z1,isIMultiModeLexerDefinition:()=>Hne,isJSDoc:()=>_3e,isLeafCstNode:()=>lO,isLinkingError:()=>sO,isMultiReference:()=>ov,isNamed:()=>y3e,isOperationCancelled:()=>qO,isReference:()=>oh,isRootCstNode:()=>Bte,isTokenTypeArray:()=>Gne,isTokenTypeDictionary:()=>Wne,loadGrammarFromJson:()=>Zl,parseJSDoc:()=>E3e,prepareLangiumParser:()=>h3e,setInterruptionPeriod:()=>f3e,startCancelableOperation:()=>Pne,stream:()=>da,toDiagnosticData:()=>C3e,toDiagnosticSeverity:()=>Fz});var v5e={};xw(v5e,{DefaultNameRegexp:()=>H5e,RangeComparison:()=>cv,compareRange:()=>Q5e,findCommentNode:()=>W5e,findDeclarationNodeAtOffset:()=>kUt,findLeafNodeAtOffset:()=>sre,findLeafNodeBeforeOffset:()=>Y5e,flattenCst:()=>OUt,getDatatypeNode:()=>CUt,getInteriorNodes:()=>RUt,getNextNode:()=>EUt,getPreviousNode:()=>j5e,getStartlineNode:()=>_Ut,inRange:()=>G5e,isChildNode:()=>V5e,isCommentNode:()=>ore,streamCst:()=>N3,toDocumentSegment:()=>B3,tokenToRange:()=>q9});function Xs(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}$(Xs,"isAstNode");function oh(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}$(oh,"isReference");function ov(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}$(ov,"isMultiReference");function y5e(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}$(y5e,"isAstNodeDescription");function sO(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}$(sO,"isLinkingError");var b5e=(oL=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 Xs(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],o=a?a.superTypes.some(s=>this.isSubtype(s,r)):!1;return n[r]=o,o}}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}}},$(oL,"AbstractAstReflection"),oL);function Z1(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}$(Z1,"isCompositeCstNode");function lO(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}$(lO,"isLeafCstNode");function Bte(t){return Z1(t)&&typeof t.fullText=="string"}$(Bte,"isRootCstNode");var sv=(pd=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 pd(()=>({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 sh})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=oUt(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 pd(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?sh:{done:!1,value:e(i)}})}filter(e){return new pd(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return sh})}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 pd(()=>({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(N9(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return sh})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new pd(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const o=n.iterator.next();if(o.done)n.iterator=void 0;else return o}const{done:i,value:a}=r.nextFn(n.this);if(!i)if(N9(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return sh})}head(){const r=this.iterator().next();if(!r.done)return r.value}tail(e=1){return new pd(()=>{const r=this.startFn();for(let n=0;n({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?sh:this.nextFn(r.state)))}distinct(e){return new pd(()=>({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 sh})}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)})}},$(pd,"StreamImpl"),pd);function oUt(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}$(oUt,"toString");function N9(t){return!!t&&typeof t[Symbol.iterator]=="function"}$(N9,"isIterable");var S3=new sv(()=>{},()=>sh),sh=Object.freeze({done:!0,value:void 0});function da(...t){if(t.length===1){const e=t[0];if(e instanceof sv)return e;if(N9(e))return new sv(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new sv(()=>({index:0}),r=>r.index1?new sv(()=>({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 o=i.iterators[i.iterators.length-1].next();if(o.done)i.iterators.pop();else return i.iterators.push(r(o.value)[Symbol.iterator]()),o}return sh})}iterator(){const e={state:this.startFn(),next:$(()=>this.nextFn(e.state),"next"),prune:$(()=>{e.state.pruned=!0},"prune"),[Symbol.iterator]:()=>e};return e}},$(sL,"TreeStreamImpl"),sL),B9;(function(t){function e(a){return a.reduce((o,s)=>o+s,0)}$(e,"sum"),t.sum=e;function r(a){return a.reduce((o,s)=>o*s,0)}$(r,"product"),t.product=r;function n(a){return a.reduce((o,s)=>Math.min(o,s))}$(n,"min"),t.min=n;function i(a){return a.reduce((o,s)=>Math.max(o,s))}$(i,"max"),t.max=i})(B9||(B9={}));var x5e={};xw(x5e,{assignMandatoryProperties:()=>w5e,copyAstNode:()=>zte,findRootNode:()=>O3,getContainerOfType:()=>cO,getDocument:()=>Wg,getReferenceNodes:()=>$te,hasContainerOfType:()=>sUt,linkContentToContainer:()=>C3,streamAllContents:()=>J1,streamAst:()=>Yg,streamContents:()=>$9,streamReferences:()=>k3});function C3(t,e={}){for(const[r,n]of Object.entries(t))r.startsWith("$")||(Array.isArray(n)?n.forEach((i,a)=>{Xs(i)&&(i.$container=t,i.$containerProperty=r,i.$containerIndex=a,e.deep&&C3(i,e))}):Xs(n)&&(n.$container=t,n.$containerProperty=r,e.deep&&C3(n,e)))}$(C3,"linkContentToContainer");function cO(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}$(cO,"getContainerOfType");function sUt(t,e){let r=t;for(;r;){if(e(r))return!0;r=r.$container}return!1}$(sUt,"hasContainerOfType");function Wg(t){const r=O3(t).$document;if(!r)throw new Error("AST node has no document.");return r}$(Wg,"getDocument");function O3(t){for(;t.$container;)t=t.$container;return t}$(O3,"findRootNode");function $te(t){return oh(t)?t.ref?[t.ref]:[]:ov(t)?t.items.map(e=>e.ref):[]}$($te,"getReferenceNodes");function $9(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new sv(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndex$9(r,e))}$(J1,"streamAllContents");function Yg(t,e){if(t){if(e!=null&&e.range&&!Fte(t,e.range))return new T3(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new T3(t,r=>$9(r,e),{includeRoot:!0})}$(Yg,"streamAst");function Fte(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)==null?void 0:n.range;return r?G5e(r,e):!1}$(Fte,"isAstNodeInRange");function k3(t){return new sv(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndexid,AbstractParserRule:()=>F9,AbstractRule:()=>E3,AbstractType:()=>mf,Action:()=>ww,Alternatives:()=>z9,ArrayLiteral:()=>Qte,ArrayType:()=>Gte,Assignment:()=>Sw,BooleanLiteral:()=>Hte,CharacterRange:()=>Tw,Condition:()=>Cw,Conjunction:()=>U9,CrossReference:()=>Ow,Disjunction:()=>V9,EndOfFile:()=>Wte,Grammar:()=>tb,GrammarImport:()=>Yte,Group:()=>dO,InferredType:()=>qte,InfixRule:()=>lv,InfixRuleOperatorList:()=>G9,InfixRuleOperators:()=>jte,Interface:()=>R3,Keyword:()=>D3,LangiumGrammarAstReflection:()=>U5e,LangiumGrammarTerminals:()=>ozn,NamedArgument:()=>L3,NegatedToken:()=>pO,Negation:()=>Xte,NumberLiteral:()=>Kte,Parameter:()=>M3,ParameterReference:()=>Zte,ParserRule:()=>qg,ReferenceType:()=>H9,RegexToken:()=>gO,ReturnType:()=>Jte,RuleCall:()=>mO,SimpleType:()=>I3,StringLiteral:()=>tre,TerminalAlternatives:()=>vO,TerminalElement:()=>ad,TerminalGroup:()=>yO,TerminalRule:()=>ib,TerminalRuleCall:()=>bO,Type:()=>W9,TypeAttribute:()=>xO,TypeDefinition:()=>wO,UnionType:()=>ire,UnorderedGroup:()=>Y9,UntilToken:()=>AO,ValueLiteral:()=>SO,Wildcard:()=>P3,isAbstractElement:()=>Ute,isAbstractParserRule:()=>uO,isAbstractRule:()=>cUt,isAbstractType:()=>uUt,isAction:()=>Aw,isAlternatives:()=>Vte,isArrayLiteral:()=>hUt,isArrayType:()=>S5e,isAssignment:()=>eb,isBooleanLiteral:()=>T5e,isCharacterRange:()=>C5e,isCondition:()=>dUt,isConjunction:()=>O5e,isCrossReference:()=>hO,isDisjunction:()=>k5e,isEndOfFile:()=>E5e,isGrammar:()=>fUt,isGrammarImport:()=>pUt,isGroup:()=>fO,isInferredType:()=>Q9,isInfixRule:()=>_3,isInfixRuleOperatorList:()=>gUt,isInfixRuleOperators:()=>mUt,isInterface:()=>_5e,isKeyword:()=>rb,isNamedArgument:()=>vUt,isNegatedToken:()=>R5e,isNegation:()=>D5e,isNumberLiteral:()=>yUt,isParameter:()=>bUt,isParameterReference:()=>L5e,isParserRule:()=>lh,isReferenceType:()=>M5e,isRegexToken:()=>I5e,isReturnType:()=>P5e,isRuleCall:()=>nb,isSimpleType:()=>ere,isStringLiteral:()=>xUt,isTerminalAlternatives:()=>N5e,isTerminalElement:()=>wUt,isTerminalGroup:()=>B5e,isTerminalRule:()=>Bp,isTerminalRuleCall:()=>rre,isType:()=>nre,isTypeAttribute:()=>AUt,isTypeDefinition:()=>SUt,isUnionType:()=>$5e,isUnorderedGroup:()=>are,isUntilToken:()=>F5e,isValueLiteral:()=>TUt,isWildcard:()=>z5e,reflection:()=>cn});var ozn={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]*/},id={$type:"AbstractElement",cardinality:"cardinality"};function Ute(t){return cn.isInstance(t,id.$type)}$(Ute,"isAbstractElement");var F9={$type:"AbstractParserRule"};function uO(t){return cn.isInstance(t,F9.$type)}$(uO,"isAbstractParserRule");var E3={$type:"AbstractRule"};function cUt(t){return cn.isInstance(t,E3.$type)}$(cUt,"isAbstractRule");var mf={$type:"AbstractType"};function uUt(t){return cn.isInstance(t,mf.$type)}$(uUt,"isAbstractType");var ww={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Aw(t){return cn.isInstance(t,ww.$type)}$(Aw,"isAction");var z9={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Vte(t){return cn.isInstance(t,z9.$type)}$(Vte,"isAlternatives");var Qte={$type:"ArrayLiteral",elements:"elements"};function hUt(t){return cn.isInstance(t,Qte.$type)}$(hUt,"isArrayLiteral");var Gte={$type:"ArrayType",elementType:"elementType"};function S5e(t){return cn.isInstance(t,Gte.$type)}$(S5e,"isArrayType");var Sw={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function eb(t){return cn.isInstance(t,Sw.$type)}$(eb,"isAssignment");var Hte={$type:"BooleanLiteral",true:"true"};function T5e(t){return cn.isInstance(t,Hte.$type)}$(T5e,"isBooleanLiteral");var Tw={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function C5e(t){return cn.isInstance(t,Tw.$type)}$(C5e,"isCharacterRange");var Cw={$type:"Condition"};function dUt(t){return cn.isInstance(t,Cw.$type)}$(dUt,"isCondition");var U9={$type:"Conjunction",left:"left",right:"right"};function O5e(t){return cn.isInstance(t,U9.$type)}$(O5e,"isConjunction");var Ow={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function hO(t){return cn.isInstance(t,Ow.$type)}$(hO,"isCrossReference");var V9={$type:"Disjunction",left:"left",right:"right"};function k5e(t){return cn.isInstance(t,V9.$type)}$(k5e,"isDisjunction");var Wte={$type:"EndOfFile",cardinality:"cardinality"};function E5e(t){return cn.isInstance(t,Wte.$type)}$(E5e,"isEndOfFile");var tb={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};function fUt(t){return cn.isInstance(t,tb.$type)}$(fUt,"isGrammar");var Yte={$type:"GrammarImport",path:"path"};function pUt(t){return cn.isInstance(t,Yte.$type)}$(pUt,"isGrammarImport");var dO={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function fO(t){return cn.isInstance(t,dO.$type)}$(fO,"isGroup");var qte={$type:"InferredType",name:"name"};function Q9(t){return cn.isInstance(t,qte.$type)}$(Q9,"isInferredType");var lv={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function _3(t){return cn.isInstance(t,lv.$type)}$(_3,"isInfixRule");var G9={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};function gUt(t){return cn.isInstance(t,G9.$type)}$(gUt,"isInfixRuleOperatorList");var jte={$type:"InfixRuleOperators",precedences:"precedences"};function mUt(t){return cn.isInstance(t,jte.$type)}$(mUt,"isInfixRuleOperators");var R3={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function _5e(t){return cn.isInstance(t,R3.$type)}$(_5e,"isInterface");var D3={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function rb(t){return cn.isInstance(t,D3.$type)}$(rb,"isKeyword");var L3={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};function vUt(t){return cn.isInstance(t,L3.$type)}$(vUt,"isNamedArgument");var pO={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function R5e(t){return cn.isInstance(t,pO.$type)}$(R5e,"isNegatedToken");var Xte={$type:"Negation",value:"value"};function D5e(t){return cn.isInstance(t,Xte.$type)}$(D5e,"isNegation");var Kte={$type:"NumberLiteral",value:"value"};function yUt(t){return cn.isInstance(t,Kte.$type)}$(yUt,"isNumberLiteral");var M3={$type:"Parameter",name:"name"};function bUt(t){return cn.isInstance(t,M3.$type)}$(bUt,"isParameter");var Zte={$type:"ParameterReference",parameter:"parameter"};function L5e(t){return cn.isInstance(t,Zte.$type)}$(L5e,"isParameterReference");var qg={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function lh(t){return cn.isInstance(t,qg.$type)}$(lh,"isParserRule");var H9={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function M5e(t){return cn.isInstance(t,H9.$type)}$(M5e,"isReferenceType");var gO={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function I5e(t){return cn.isInstance(t,gO.$type)}$(I5e,"isRegexToken");var Jte={$type:"ReturnType",name:"name"};function P5e(t){return cn.isInstance(t,Jte.$type)}$(P5e,"isReturnType");var mO={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function nb(t){return cn.isInstance(t,mO.$type)}$(nb,"isRuleCall");var I3={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function ere(t){return cn.isInstance(t,I3.$type)}$(ere,"isSimpleType");var tre={$type:"StringLiteral",value:"value"};function xUt(t){return cn.isInstance(t,tre.$type)}$(xUt,"isStringLiteral");var vO={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function N5e(t){return cn.isInstance(t,vO.$type)}$(N5e,"isTerminalAlternatives");var ad={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function wUt(t){return cn.isInstance(t,ad.$type)}$(wUt,"isTerminalElement");var yO={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function B5e(t){return cn.isInstance(t,yO.$type)}$(B5e,"isTerminalGroup");var ib={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function Bp(t){return cn.isInstance(t,ib.$type)}$(Bp,"isTerminalRule");var bO={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function rre(t){return cn.isInstance(t,bO.$type)}$(rre,"isTerminalRuleCall");var W9={$type:"Type",name:"name",type:"type"};function nre(t){return cn.isInstance(t,W9.$type)}$(nre,"isType");var xO={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};function AUt(t){return cn.isInstance(t,xO.$type)}$(AUt,"isTypeAttribute");var wO={$type:"TypeDefinition"};function SUt(t){return cn.isInstance(t,wO.$type)}$(SUt,"isTypeDefinition");var ire={$type:"UnionType",types:"types"};function $5e(t){return cn.isInstance(t,ire.$type)}$($5e,"isUnionType");var Y9={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function are(t){return cn.isInstance(t,Y9.$type)}$(are,"isUnorderedGroup");var AO={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function F5e(t){return cn.isInstance(t,AO.$type)}$(F5e,"isUntilToken");var SO={$type:"ValueLiteral"};function TUt(t){return cn.isInstance(t,SO.$type)}$(TUt,"isValueLiteral");var P3={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function z5e(t){return cn.isInstance(t,P3.$type)}$(z5e,"isWildcard");var U5e=(lL=class extends b5e{constructor(){super(...arguments),this.types={AbstractElement:{name:id.$type,properties:{cardinality:{name:id.cardinality}},superTypes:[]},AbstractParserRule:{name:F9.$type,properties:{},superTypes:[E3.$type,mf.$type]},AbstractRule:{name:E3.$type,properties:{},superTypes:[]},AbstractType:{name:mf.$type,properties:{},superTypes:[]},Action:{name:ww.$type,properties:{cardinality:{name:ww.cardinality},feature:{name:ww.feature},inferredType:{name:ww.inferredType},operator:{name:ww.operator},type:{name:ww.type,referenceType:mf.$type}},superTypes:[id.$type]},Alternatives:{name:z9.$type,properties:{cardinality:{name:z9.cardinality},elements:{name:z9.elements,defaultValue:[]}},superTypes:[id.$type]},ArrayLiteral:{name:Qte.$type,properties:{elements:{name:Qte.elements,defaultValue:[]}},superTypes:[SO.$type]},ArrayType:{name:Gte.$type,properties:{elementType:{name:Gte.elementType}},superTypes:[wO.$type]},Assignment:{name:Sw.$type,properties:{cardinality:{name:Sw.cardinality},feature:{name:Sw.feature},operator:{name:Sw.operator},predicate:{name:Sw.predicate},terminal:{name:Sw.terminal}},superTypes:[id.$type]},BooleanLiteral:{name:Hte.$type,properties:{true:{name:Hte.true,defaultValue:!1}},superTypes:[Cw.$type,SO.$type]},CharacterRange:{name:Tw.$type,properties:{cardinality:{name:Tw.cardinality},left:{name:Tw.left},lookahead:{name:Tw.lookahead},parenthesized:{name:Tw.parenthesized,defaultValue:!1},right:{name:Tw.right}},superTypes:[ad.$type]},Condition:{name:Cw.$type,properties:{},superTypes:[]},Conjunction:{name:U9.$type,properties:{left:{name:U9.left},right:{name:U9.right}},superTypes:[Cw.$type]},CrossReference:{name:Ow.$type,properties:{cardinality:{name:Ow.cardinality},deprecatedSyntax:{name:Ow.deprecatedSyntax,defaultValue:!1},isMulti:{name:Ow.isMulti,defaultValue:!1},terminal:{name:Ow.terminal},type:{name:Ow.type,referenceType:mf.$type}},superTypes:[id.$type]},Disjunction:{name:V9.$type,properties:{left:{name:V9.left},right:{name:V9.right}},superTypes:[Cw.$type]},EndOfFile:{name:Wte.$type,properties:{cardinality:{name:Wte.cardinality}},superTypes:[id.$type]},Grammar:{name:tb.$type,properties:{imports:{name:tb.imports,defaultValue:[]},interfaces:{name:tb.interfaces,defaultValue:[]},isDeclared:{name:tb.isDeclared,defaultValue:!1},name:{name:tb.name},rules:{name:tb.rules,defaultValue:[]},types:{name:tb.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:Yte.$type,properties:{path:{name:Yte.path}},superTypes:[]},Group:{name:dO.$type,properties:{cardinality:{name:dO.cardinality},elements:{name:dO.elements,defaultValue:[]},guardCondition:{name:dO.guardCondition},predicate:{name:dO.predicate}},superTypes:[id.$type]},InferredType:{name:qte.$type,properties:{name:{name:qte.name}},superTypes:[mf.$type]},InfixRule:{name:lv.$type,properties:{call:{name:lv.call},dataType:{name:lv.dataType},inferredType:{name:lv.inferredType},name:{name:lv.name},operators:{name:lv.operators},parameters:{name:lv.parameters,defaultValue:[]},returnType:{name:lv.returnType,referenceType:mf.$type}},superTypes:[F9.$type]},InfixRuleOperatorList:{name:G9.$type,properties:{associativity:{name:G9.associativity},operators:{name:G9.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:jte.$type,properties:{precedences:{name:jte.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:R3.$type,properties:{attributes:{name:R3.attributes,defaultValue:[]},name:{name:R3.name},superTypes:{name:R3.superTypes,defaultValue:[],referenceType:mf.$type}},superTypes:[mf.$type]},Keyword:{name:D3.$type,properties:{cardinality:{name:D3.cardinality},predicate:{name:D3.predicate},value:{name:D3.value}},superTypes:[id.$type]},NamedArgument:{name:L3.$type,properties:{calledByName:{name:L3.calledByName,defaultValue:!1},parameter:{name:L3.parameter,referenceType:M3.$type},value:{name:L3.value}},superTypes:[]},NegatedToken:{name:pO.$type,properties:{cardinality:{name:pO.cardinality},lookahead:{name:pO.lookahead},parenthesized:{name:pO.parenthesized,defaultValue:!1},terminal:{name:pO.terminal}},superTypes:[ad.$type]},Negation:{name:Xte.$type,properties:{value:{name:Xte.value}},superTypes:[Cw.$type]},NumberLiteral:{name:Kte.$type,properties:{value:{name:Kte.value}},superTypes:[SO.$type]},Parameter:{name:M3.$type,properties:{name:{name:M3.name}},superTypes:[]},ParameterReference:{name:Zte.$type,properties:{parameter:{name:Zte.parameter,referenceType:M3.$type}},superTypes:[Cw.$type]},ParserRule:{name:qg.$type,properties:{dataType:{name:qg.dataType},definition:{name:qg.definition},entry:{name:qg.entry,defaultValue:!1},fragment:{name:qg.fragment,defaultValue:!1},inferredType:{name:qg.inferredType},name:{name:qg.name},parameters:{name:qg.parameters,defaultValue:[]},returnType:{name:qg.returnType,referenceType:mf.$type}},superTypes:[F9.$type]},ReferenceType:{name:H9.$type,properties:{isMulti:{name:H9.isMulti,defaultValue:!1},referenceType:{name:H9.referenceType}},superTypes:[wO.$type]},RegexToken:{name:gO.$type,properties:{cardinality:{name:gO.cardinality},lookahead:{name:gO.lookahead},parenthesized:{name:gO.parenthesized,defaultValue:!1},regex:{name:gO.regex}},superTypes:[ad.$type]},ReturnType:{name:Jte.$type,properties:{name:{name:Jte.name}},superTypes:[]},RuleCall:{name:mO.$type,properties:{arguments:{name:mO.arguments,defaultValue:[]},cardinality:{name:mO.cardinality},predicate:{name:mO.predicate},rule:{name:mO.rule,referenceType:E3.$type}},superTypes:[id.$type]},SimpleType:{name:I3.$type,properties:{primitiveType:{name:I3.primitiveType},stringType:{name:I3.stringType},typeRef:{name:I3.typeRef,referenceType:mf.$type}},superTypes:[wO.$type]},StringLiteral:{name:tre.$type,properties:{value:{name:tre.value}},superTypes:[SO.$type]},TerminalAlternatives:{name:vO.$type,properties:{cardinality:{name:vO.cardinality},elements:{name:vO.elements,defaultValue:[]},lookahead:{name:vO.lookahead},parenthesized:{name:vO.parenthesized,defaultValue:!1}},superTypes:[ad.$type]},TerminalElement:{name:ad.$type,properties:{cardinality:{name:ad.cardinality},lookahead:{name:ad.lookahead},parenthesized:{name:ad.parenthesized,defaultValue:!1}},superTypes:[id.$type]},TerminalGroup:{name:yO.$type,properties:{cardinality:{name:yO.cardinality},elements:{name:yO.elements,defaultValue:[]},lookahead:{name:yO.lookahead},parenthesized:{name:yO.parenthesized,defaultValue:!1}},superTypes:[ad.$type]},TerminalRule:{name:ib.$type,properties:{definition:{name:ib.definition},fragment:{name:ib.fragment,defaultValue:!1},hidden:{name:ib.hidden,defaultValue:!1},name:{name:ib.name},type:{name:ib.type}},superTypes:[E3.$type]},TerminalRuleCall:{name:bO.$type,properties:{cardinality:{name:bO.cardinality},lookahead:{name:bO.lookahead},parenthesized:{name:bO.parenthesized,defaultValue:!1},rule:{name:bO.rule,referenceType:ib.$type}},superTypes:[ad.$type]},Type:{name:W9.$type,properties:{name:{name:W9.name},type:{name:W9.type}},superTypes:[mf.$type]},TypeAttribute:{name:xO.$type,properties:{defaultValue:{name:xO.defaultValue},isOptional:{name:xO.isOptional,defaultValue:!1},name:{name:xO.name},type:{name:xO.type}},superTypes:[]},TypeDefinition:{name:wO.$type,properties:{},superTypes:[]},UnionType:{name:ire.$type,properties:{types:{name:ire.types,defaultValue:[]}},superTypes:[wO.$type]},UnorderedGroup:{name:Y9.$type,properties:{cardinality:{name:Y9.cardinality},elements:{name:Y9.elements,defaultValue:[]}},superTypes:[id.$type]},UntilToken:{name:AO.$type,properties:{cardinality:{name:AO.cardinality},lookahead:{name:AO.lookahead},parenthesized:{name:AO.parenthesized,defaultValue:!1},terminal:{name:AO.terminal}},superTypes:[ad.$type]},ValueLiteral:{name:SO.$type,properties:{},superTypes:[]},Wildcard:{name:P3.$type,properties:{cardinality:{name:P3.cardinality},lookahead:{name:P3.lookahead},parenthesized:{name:P3.parenthesized,defaultValue:!1}},superTypes:[ad.$type]}}}},$(lL,"LangiumGrammarAstReflection"),lL),cn=new U5e;function CUt(t){let e=t,r=!1;for(;e;){const n=cO(e.grammarSource,lh);if(n&&n.dataType)e=e.container,r=!0;else return r?e:void 0}}$(CUt,"getDatatypeNode");function N3(t){return new T3(t,e=>Z1(e)?e.content:[],{includeRoot:!0})}$(N3,"streamCst");function OUt(t){return N3(t).filter(lO)}$(OUt,"flattenCst");function V5e(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}$(V5e,"isChildNode");function q9(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}$(q9,"tokenToRange");function B3(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}$(B3,"toDocumentSegment");var cv;(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"})(cv||(cv={}));function Q5e(t,e){if(t.end.linee.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return cv.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.linecv.After}$(G5e,"inRange");var H5e=/^[\w\p{L}]$/u;function kUt(t,e,r=H5e){if(t){if(e>0){const n=e-t.offset,i=t.text.charAt(n);r.test(i)||e--}return sre(t,e)}}$(kUt,"findDeclarationNodeAtOffset");function W5e(t,e){if(t){const r=j5e(t,!0);if(r&&ore(r,e))return r;if(Bte(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(ore(a,e))return a}}}}$(W5e,"findCommentNode");function ore(t,e){return lO(t)&&e.includes(t.tokenType.name)}$(ore,"isCommentNode");function sre(t,e){if(lO(t))return t;if(Z1(t)){const r=q5e(t,e,!1);if(r)return sre(r,e)}}$(sre,"findLeafNodeAtOffset");function Y5e(t,e){if(lO(t))return t;if(Z1(t)){const r=q5e(t,e,!0);if(r)return Y5e(r,e)}}$(Y5e,"findLeafNodeBeforeOffset");function q5e(t,e,r){let n=0,i=t.content.length-1,a;for(;n<=i;){const o=Math.floor((n+i)/2),s=t.content[o];if(s.offset<=e&&s.end>e)return s;s.end<=e?(a=r?s:void 0,n=o+1):i=o-1}return a}$(q5e,"binarySearch");function j5e(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}}$(j5e,"getPreviousNode");function EUt(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);const i=r.content.length-1;for(;nhRe,findNameAssignment:()=>bre,findNodeForKeyword:()=>uRe,findNodeForProperty:()=>mre,findNodesForKeyword:()=>zUt,findNodesForKeywordInternal:()=>yre,findNodesForProperty:()=>cRe,getActionAtElement:()=>fRe,getActionType:()=>gRe,getAllReachableRules:()=>gre,getAllRulesUsedForCrossReferences:()=>FUt,getCrossReferenceTerminal:()=>sRe,getEntryRule:()=>iRe,getExplicitRuleType:()=>X9,getHiddenRules:()=>aRe,getRuleType:()=>mRe,getRuleTypeName:()=>HUt,getTypeName:()=>OO,isArrayCardinality:()=>VUt,isArrayOperator:()=>QUt,isCommentTerminal:()=>lRe,isDataType:()=>GUt,isDataTypeRule:()=>j9,isOptionalCardinality:()=>UUt,terminalRegex:()=>K9});var lre=(cL=class extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}},$(cL,"ErrorWithLocation"),cL);function kw(t,e="Error: Got unexpected value."){throw new Error(e)}$(kw,"assertUnreachable");function Z5e(t,e="Error: Condition is violated."){if(!t)throw new Error(e)}$(Z5e,"assertCondition");var J5e={};xw(J5e,{NEWLINE_REGEXP:()=>PUt,escapeRegExp:()=>F3,getTerminalParts:()=>BUt,isMultilineComment:()=>tRe,isWhitespace:()=>pre,partialMatches:()=>rRe,partialRegExp:()=>nRe,whitespaceCharacters:()=>$Ut});function An(t){return t.charCodeAt(0)}$(An,"cc");function cre(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}$(cre,"insertToSet");function $3(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}$($3,"addFlag");function TO(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}$(TO,"ASSERT_EXISTS");function LUt(){throw Error("Internal Error - Should never get here!")}$(LUt,"ASSERT_NEVER_REACH_HERE");function eRe(t){return t.type==="Character"}$(eRe,"isCharacter");var ure=[];for(let t=An("0");t<=An("9");t++)ure.push(t);var hre=[An("_")].concat(ure);for(let t=An("a");t<=An("z");t++)hre.push(t);for(let t=An("A");t<=An("Z");t++)hre.push(t);var MUt=[An(" "),An("\f"),An(` +`),An("\r"),An(" "),An("\v"),An(" "),An(" "),An(" "),An(" "),An(" "),An(" "),An(" "),An(" "),An(" "),An(" "),An(" "),An(" "),An(" "),An(" "),An("\u2028"),An("\u2029"),An(" "),An(" "),An(" "),An("\uFEFF")],szn=/[0-9a-fA-F]/,dre=/[0-9]/,lzn=/[1-9]/,IUt=(uL=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":$3(n,"global");break;case"i":$3(n,"ignoreCase");break;case"m":$3(n,"multiLine");break;case"u":$3(n,"unicode");break;case"y":$3(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 LUt()}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:[An(` +`),An("\r"),An("\u2028"),An("\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=ure;break;case"D":e=ure,r=!0;break;case"s":e=MUt;break;case"S":e=MUt,r=!0;break;case"w":e=hre;break;case"W":e=hre,r=!0;break}if(TO(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=An("\f");break;case"n":e=An(` `);break;case"r":e=An("\r");break;case"t":e=An(" ");break;case"v":e=An("\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:An("\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:An(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:An(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,eRe(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,eRe(i)){if(i.value=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}},$(uL,"RegExpParser"),uL),fre=(hL=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){}},$(hL,"BaseRegExpVisitor"),hL),MUt=/\r?\n/gm,IUt=new LUt,szn=(dL=class extends fre{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}}},$(uL,"RegExpParser"),uL),fre=(hL=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){}},$(hL,"BaseRegExpVisitor"),hL),PUt=/\r?\n/gm,NUt=new IUt,czn=(dL=class extends fre{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=F3(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)}},$(dL,"TerminalRegExpVisitor"),dL),CO=new szn;function PUt(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=IUt.pattern(t),r=[];for(const n of e.value.value)CO.reset(t),CO.visit(n),r.push({start:CO.startRegexp,end:CO.endRegex});return r}catch{return[]}}$(PUt,"getTerminalParts");function tRe(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),CO.reset(t),CO.visit(IUt.pattern(t)),CO.multiline}catch{return!1}}$(tRe,"isMultilineComment");var NUt=`\f -\r \v              \u2028\u2029   \uFEFF`.split("");function pre(t){const e=typeof t=="string"?new RegExp(t):t;return NUt.some(r=>e.test(r))}$(pre,"isWhitespace");function F3(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$(F3,"escapeRegExp");function rRe(t,e){const r=nRe(t),n=e.match(r);return!!n&&n[0].length>0}$(rRe,"partialMatches");function nRe(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let a="",o;function s(u){a+=r.substr(n,u),n+=u}$(s,"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"[":o=/\[(?:\\.|.)*?\]/g,o.lastIndex=n,o=o.exec(r)||[],l(o[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":s(1);break;case"{":o=/\{\d+,?\d*\}/g,o.lastIndex=n,o=o.exec(r),o?s(o[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"!":o=n,n+=3,i(),a+=r.substr(o,n-o);break;case"<":switch(r[n+3]){case"=":case"!":o=n,n+=4,i(),a+=r.substr(o,n-o);break;default:s(r.indexOf(">",n)-n+1),a+=i()+"|$)";break}break}else s(1),a+=i()+"|$)";break;case")":return++n,a;default:l(1);break}return a}return $(i,"process"),new RegExp(i(),t.flags)}$(nRe,"partialRegExp");function iRe(t){return t.rules.find(e=>lh(e)&&e.entry)}$(iRe,"getEntryRule");function aRe(t){return t.rules.filter(e=>Bp(e)&&e.hidden)}$(aRe,"getHiddenRules");function gre(t,e){const r=new Set,n=iRe(t);if(!n)return new Set(t.rules);const i=[n].concat(aRe(t));for(const o of i)oRe(o,r,e);const a=new Set;for(const o of t.rules)(r.has(o.name)||Bp(o)&&o.hidden)&&a.add(o);return a}$(gre,"getAllReachableRules");function oRe(t,e,r){e.add(t.name),J1(t).forEach(n=>{if(nb(n)||r&&rre(n)){const i=n.rule.ref;i&&!e.has(i.name)&&oRe(i,e,r)}})}$(oRe,"ruleDfs");function BUt(t){const e=new Set;return J1(t).forEach(r=>{hO(r)&&(lh(r.type.ref)&&e.add(r.type.ref),Q9(r.type.ref)&&lh(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}$(BUt,"getAllRulesUsedForCrossReferences");function sRe(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=bre(t.type.ref);return e==null?void 0:e.terminal}}$(sRe,"getCrossReferenceTerminal");function lRe(t){return t.hidden&&!pre(K9(t))}$(lRe,"isCommentTerminal");function cRe(t,e){return!t||!e?[]:vre(t,e,t.astNode,!0)}$(cRe,"findNodesForProperty");function mre(t,e,r){if(!t||!e)return;const n=vre(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]}$(mre,"findNodeForProperty");function vre(t,e,r,n){if(!n){const i=cO(t.grammarSource,eb);if(i&&i.feature===e)return[t]}return Z1(t)&&t.astNode===r?t.content.flatMap(i=>vre(i,e,r,!1)):[]}$(vre,"findNodesForPropertyInternal");function $Ut(t,e){return t?yre(t,e,t==null?void 0:t.astNode):[]}$($Ut,"findNodesForKeyword");function uRe(t,e,r){if(!t)return;const n=yre(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]}$(uRe,"findNodeForKeyword");function yre(t,e,r){if(t.astNode!==r)return[];if(rb(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=N3(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const o=i.value;o.astNode===r?rb(o.grammarSource)&&o.grammarSource.value===e&&a.push(o):n.prune()}while(!i.done);return a}$(yre,"findNodesForKeywordInternal");function hRe(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=cO(t.grammarSource,eb);if(n)return n;t=t.container}}$(hRe,"findAssignment");function bre(t){let e=t;return Q9(e)&&(Aw(e.$container)?e=e.$container.$container:uO(e.$container)?e=e.$container:kw(e.$container)),dRe(t,e,new Map)}$(bre,"findNameAssignment");function dRe(t,e,r){var i;function n(a,o){let s;return cO(a,eb)||(s=dRe(o,o,r)),r.set(t,s),s}if($(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const a of J1(e)){if(eb(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(nb(a)&&lh(a.rule.ref))return n(a,a.rule.ref);if(ere(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}$(dRe,"findNameAssignmentInternal");function fRe(t){const e=t.$container;if(fO(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const a=r[i];if(Aw(a))return a;{const o=J1(r[i]).find(Aw);if(o)return o}}}if(Ute(e))return fRe(e)}$(fRe,"getActionAtElement");function FUt(t,e){return t==="?"||t==="*"||fO(e)&&!!e.guardCondition}$(FUt,"isOptionalCardinality");function zUt(t){return t==="*"||t==="+"}$(zUt,"isArrayCardinality");function UUt(t){return t==="+="}$(UUt,"isArrayOperator");function j9(t){return pRe(t,new Set)}$(j9,"isDataTypeRule");function pRe(t,e){if(e.has(t))return!0;e.add(t);for(const r of J1(t))if(nb(r)){if(!r.rule.ref||lh(r.rule.ref)&&!pRe(r.rule.ref,e)||_3(r.rule.ref))return!1}else{if(eb(r))return!1;if(Aw(r))return!1}return!!t.definition}$(pRe,"isDataTypeRuleInternal");function VUt(t){return xre(t.type,new Set)}$(VUt,"isDataType");function xre(t,e){if(e.has(t))return!0;if(e.add(t),S5e(t))return!1;if(M5e(t))return!1;if($5e(t))return t.types.every(r=>xre(r,e));if(ere(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 nre(r)?xre(r.type,e):!1}else return!1}else return!1}$(xre,"isDataTypeInternal");function X9(t){if(!Bp(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}}}$(X9,"getExplicitRuleType");function OO(t){if(uO(t))return lh(t)&&j9(t)?t.name:X9(t)??t.name;if(_5e(t)||nre(t)||P5e(t))return t.name;if(Aw(t)){const e=gRe(t);if(e)return e}else if(Q9(t))return t.name;throw new Error("Cannot get name of Unknown Type")}$(OO,"getTypeName");function gRe(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return OO(t.type.ref)}$(gRe,"getActionType");function QUt(t){var e;return Bp(t)?((e=t.type)==null?void 0:e.name)??"string":lh(t)&&j9(t)?t.name:X9(t)??t.name}$(QUt,"getRuleTypeName");function mRe(t){var e;return Bp(t)?((e=t.type)==null?void 0:e.name)??"string":X9(t)??t.name}$(mRe,"getRuleType");function K9(t){const e={s:!1,i:!1,u:!1},r=kO(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}$(K9,"terminalRegex");var vRe=/[\s\S]/.source;function kO(t,e){var r;if(N5e(t))return GUt(t);if(B5e(t))return HUt(t);if(C5e(t))return qUt(t);if(rre(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return uv(kO(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(R5e(t))return YUt(t);if(F5e(t))return WUt(t);if(I5e(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")),uv(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(z5e(t))return uv(vRe,{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}`)}}}$(kO,"abstractElementToRegex");function GUt(t){return uv(t.elements.map(e=>kO(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}$(GUt,"terminalAlternativesToRegex");function HUt(t){return uv(t.elements.map(e=>kO(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}$(HUt,"terminalGroupToRegex");function WUt(t){return uv(`${vRe}*?${kO(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}$(WUt,"untilTokenToRegex");function YUt(t){return uv(`(?!${kO(t.terminal)})${vRe}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}$(YUt,"negateTokenToRegex");function qUt(t){return t.right?uv(`[${wre(t.left)}-${wre(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):uv(wre(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}$(qUt,"characterRangeToRegex");function wre(t){return F3(t.value)}$(wre,"keywordToRegex");function uv(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}$(uv,"withCardinality");function yRe(t){const e=[],r=t.Grammar;for(const n of r.rules)Bp(n)&&lRe(n)&&tRe(K9(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:H5e}}$(yRe,"createGrammarConfig");var lzn=typeof global=="object"&&global&&global.Object===Object&&global,jUt=lzn,czn=typeof self=="object"&&self&&self.Object===Object&&self,uzn=jUt||czn||Function("return this")(),hv=uzn,hzn=hv.Symbol,$p=hzn,XUt=Object.prototype,dzn=XUt.hasOwnProperty,fzn=XUt.toString,Z9=$p?$p.toStringTag:void 0;function KUt(t){var e=dzn.call(t,Z9),r=t[Z9];try{t[Z9]=void 0;var n=!0}catch{}var i=fzn.call(t);return n&&(e?t[Z9]=r:delete t[Z9]),i}$(KUt,"getRawTag");var pzn=KUt,gzn=Object.prototype,mzn=gzn.toString;function ZUt(t){return mzn.call(t)}$(ZUt,"objectToString");var vzn=ZUt,yzn="[object Null]",bzn="[object Undefined]",JUt=$p?$p.toStringTag:void 0;function eVt(t){return t==null?t===void 0?bzn:yzn:JUt&&JUt in Object(t)?pzn(t):vzn(t)}$(eVt,"baseGetTag");var Ew=eVt;function tVt(t){return t!=null&&typeof t=="object"}$(tVt,"isObjectLike");var jg=tVt,xzn="[object Symbol]";function rVt(t){return typeof t=="symbol"||jg(t)&&Ew(t)==xzn}$(rVt,"isSymbol");var Are=rVt;function nVt(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=rUn)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}$(OVt,"shortOut");var aUn=OVt;function kVt(t){return function(){return t}}$(kVt,"constant");var oUn=kVt,sUn=function(){try{var t=_O(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Sre=sUn,lUn=Sre?function(t,e){return Sre(t,"toString",{configurable:!0,enumerable:!1,value:oUn(e),writable:!0})}:tz,cUn=lUn,uUn=aUn(cUn),hUn=uUn;function EVt(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}$(PVt,"arrayIncludes");var NVt=PVt,pUn=9007199254740991,gUn=/^(?:0|[1-9]\d*)$/;function BVt(t,e){var r=typeof t;return e=e??pUn,!!e&&(r=="number"||r!="symbol"&&gUn.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=bUn}$(HVt,"isLength");var CRe=HVt;function WVt(t){return t!=null&&CRe(t.length)&&!ab(t)}$(WVt,"isArrayLike");var dv=WVt;function YVt(t,e,r){if(!Fp(r))return!1;var n=typeof e;return(n=="number"?dv(r)&&Tre(e,r.length):n=="string"&&e in r)?rz(r[e],t):!1}$(YVt,"isIterateeCall");var Ore=YVt;function qVt(t){return TRe(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,o&&Ore(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}$(_Qt,"listCacheHas");var BVn=_Qt;function RQt(t,e){var r=this.__data__,n=_re(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}$(RQt,"listCacheSet");var $Vn=RQt;function DO(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(s)?e>1?DRe(s,e-1,r,n,i):RRe(i,s):n||(i[i.length]=s)}return i}$(DRe,"baseFlatten");var LRe=DRe;function YQt(t){var e=t==null?0:t.length;return e?LRe(t,1):[]}$(YQt,"flatten");var Xg=YQt,nQn=hQt(Object.getPrototypeOf,Object),qQt=nQn;function jQt(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);++ns))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&YGn?new FRe:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&Ore(e[0],e[1],i)&&(n=1);++r=zHn&&(a=zRe,o=!1,e=new FRe(e));e:for(;++i-1?i[a?e[o]:o]:void 0}}$(qHt,"createFind");var WHn=qHt,YHn=Math.max;function jHt(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:ez(r);return i<0&&(i=YHn(n+i,0)),DVt(t,fv(e),i)}$(jHt,"findIndex");var qHn=jHt,jHn=WHn(qHn),V3=jHn;function XHt(t){return t&&t.length?t[0]:void 0}$(XHt,"head");var Zg=XHt;function KHt(t,e){var r=-1,n=dv(t)?Array(t.length):[];return PO(t,function(i,a,o){n[++r]=e(i,a,o)}),n}$(KHt,"baseMap");var XHn=KHt;function ZHt(t,e){var r=Fi(t)?J9:XHn;return r(t,fv(e))}$(ZHt,"map");var Wr=ZHt;function JHt(t,e){return LRe(Wr(t,e),1)}$(JHt,"flatMap");var Up=JHt,KHn=Object.prototype,ZHn=KHn.hasOwnProperty,JHn=BHn(function(t,e,r){ZHn.call(t,r)?t[r].push(e):SRe(t,r,[e])}),eWn=JHn,tWn=Object.prototype,rWn=tWn.hasOwnProperty;function eWt(t,e){return t!=null&&rWn.call(t,e)}$(eWt,"baseHas");var nWn=eWt;function tWt(t,e){return t!=null&&yHt(t,e,nWn)}$(tWt,"has");var hn=tWt,iWn="[object String]";function rWt(t){return typeof t=="string"||!Fi(t)&&jg(t)&&Ew(t)==iWn}$(rWt,"isString");var od=rWt;function nWt(t,e){return J9(e,function(r){return t[r]})}$(nWt,"baseValues");var aWn=nWt;function iWt(t){return t==null?[]:aWn(t,vf(t))}$(iWt,"values");var ml=iWt,oWn=Math.max;function aWt(t,e,r,n){t=dv(t)?t:ml(t),r=r&&!n?ez(r):0;var i=t.length;return r<0&&(r=oWn(i+r,0)),od(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&ARe(t,e,r)>-1}$(aWt,"includes");var ch=aWt,sWn=Math.max;function oWt(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:ez(r);return i<0&&(i=sWn(n+i,0)),ARe(t,e,i)}$(oWt,"indexOf");var sWt=oWt,lWn="[object Map]",cWn="[object Set]",uWn=Object.prototype,hWn=uWn.hasOwnProperty;function lWt(t){if(t==null)return!0;if(dv(t)&&(Fi(t)||typeof t=="string"||typeof t.splice=="function"||az(t)||kRe(t)||kre(t)))return!t.length;var e=U3(t);if(e==lWn||e==cWn)return!t.size;if(iz(t))return!fQt(t).length;for(var r in t)if(hWn.call(t,r))return!1;return!0}$(lWt,"isEmpty");var Ga=lWt,dWn="[object RegExp]";function cWt(t){return jg(t)&&Ew(t)==dWn}$(cWt,"baseIsRegExp");var fWn=cWt,uWt=_w&&_w.isRegExp,pWn=uWt?oz(uWt):fWn,ob=pWn;function hWt(t){return t===void 0}$(hWt,"isUndefined");var sb=hWt,gWn="Expected a function";function dWt(t){if(typeof t!="function")throw new TypeError(gWn);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)}}$(dWt,"negate");var mWn=dWt;function fWt(t,e,r,n){if(!Fp(t))return t;e=Ire(e,t);for(var i=-1,a=e.length,o=a-1,s=t;s!=null&&++i=TWn){var u=e?null:SWn(t);if(u)return URe(u);o=!1,i=zRe,l=new FRe}else l=e?[]:s;e:for(;++n{r.accept(e)})}},$(fL,"AbstractProduction"),fL),uh=(pL=class extends pv{constructor(e){super([]),this.idx=1,yf(this,Jg(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},$(pL,"NonTerminal"),pL),Q3=(gL=class extends pv{constructor(e){super(e.definition),this.orgText="",yf(this,Jg(e,r=>r!==void 0))}},$(gL,"Rule"),gL),sd=(mL=class extends pv{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,yf(this,Jg(e,r=>r!==void 0))}},$(mL,"Alternative"),mL),Dc=(vL=class extends pv{constructor(e){super(e.definition),this.idx=1,yf(this,Jg(e,r=>r!==void 0))}},$(vL,"Option"),vL),xf=(yL=class extends pv{constructor(e){super(e.definition),this.idx=1,yf(this,Jg(e,r=>r!==void 0))}},$(yL,"RepetitionMandatory"),yL),wf=(bL=class extends pv{constructor(e){super(e.definition),this.idx=1,yf(this,Jg(e,r=>r!==void 0))}},$(bL,"RepetitionMandatoryWithSeparator"),bL),ns=(xL=class extends pv{constructor(e){super(e.definition),this.idx=1,yf(this,Jg(e,r=>r!==void 0))}},$(xL,"Repetition"),xL),ld=(wL=class extends pv{constructor(e){super(e.definition),this.idx=1,yf(this,Jg(e,r=>r!==void 0))}},$(wL,"RepetitionWithSeparator"),wL),cd=(AL=class extends pv{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,yf(this,Jg(e,r=>r!==void 0))}},$(AL,"Alternation"),AL),go=(SL=class{constructor(e){this.idx=1,yf(this,Jg(e,r=>r!==void 0))}accept(e){e.visit(this)}},$(SL,"Terminal"),SL);function OWt(t){return Wr(t,mz)}$(OWt,"serializeGrammar");function mz(t){function e(r){return Wr(r,mz)}if($(e,"convertDefinition"),t instanceof uh){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return od(t.label)&&(r.label=t.label),r}else{if(t instanceof sd)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Dc)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof xf)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof wf)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:mz(new go({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ld)return{type:"RepetitionWithSeparator",idx:t.idx,separator:mz(new go({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ns)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof cd)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof go){const r={type:"Terminal",name:t.terminalType.name,label:TWt(t.terminalType),idx:t.idx};od(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=ob(n)?n.source:n),r}else{if(t instanceof Q3)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}$(mz,"serializeProduction");var G3=(TL=class{visit(e){const r=e;switch(r.constructor){case uh:return this.visitNonTerminal(r);case sd:return this.visitAlternative(r);case Dc:return this.visitOption(r);case xf:return this.visitRepetitionMandatory(r);case wf:return this.visitRepetitionMandatoryWithSeparator(r);case ld:return this.visitRepetitionWithSeparator(r);case ns:return this.visitRepetition(r);case cd:return this.visitAlternation(r);case go:return this.visitTerminal(r);case Q3: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){}},$(TL,"GAstVisitor"),TL);function kWt(t){return t instanceof sd||t instanceof Dc||t instanceof ns||t instanceof xf||t instanceof wf||t instanceof ld||t instanceof go||t instanceof Q3}$(kWt,"isSequenceProd");function vz(t,e=[]){return t instanceof Dc||t instanceof ns||t instanceof ld?!0:t instanceof cd?wWt(t.definition,n=>vz(n,e)):t instanceof uh&&ch(e,t)?!1:t instanceof pv?(t instanceof uh&&e.push(t),Kg(t.definition,n=>vz(n,e))):!1}$(vz,"isOptionalProd");function EWt(t){return t instanceof cd}$(EWt,"isBranchingProd");function em(t){if(t instanceof uh)return"SUBRULE";if(t instanceof Dc)return"OPTION";if(t instanceof cd)return"OR";if(t instanceof xf)return"AT_LEAST_ONE";if(t instanceof wf)return"AT_LEAST_ONE_SEP";if(t instanceof ld)return"MANY_SEP";if(t instanceof ns)return"MANY";if(t instanceof go)return"CONSUME";throw Error("non exhaustive match")}$(em,"getProductionDslName");var zre=(CL=class{walk(e,r=[]){Sn(e.definition,(n,i)=>{const a=Rc(e.definition,i+1);if(n instanceof uh)this.walkProdRef(n,a,r);else if(n instanceof go)this.walkTerminal(n,a,r);else if(n instanceof sd)this.walkFlat(n,a,r);else if(n instanceof Dc)this.walkOption(n,a,r);else if(n instanceof xf)this.walkAtLeastOne(n,a,r);else if(n instanceof wf)this.walkAtLeastOneSep(n,a,r);else if(n instanceof ld)this.walkManySep(n,a,r);else if(n instanceof ns)this.walkMany(n,a,r);else if(n instanceof cd)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 Dc({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=jRe(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new Dc({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=jRe(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);Sn(e.definition,a=>{const o=new sd({definition:[a]});this.walk(o,i)})}},$(CL,"RestWalker"),CL);function jRe(t,e,r){return[new Dc({definition:[new go({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}$(jRe,"restForRepetitionWithSeparator");function H3(t){if(t instanceof uh)return H3(t.referencedRule);if(t instanceof go)return DWt(t);if(kWt(t))return _Wt(t);if(EWt(t))return RWt(t);throw Error("non exhaustive match")}$(H3,"first");function _Wt(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,o=!0;for(;i&&o;)a=r[n],o=vz(a),e=e.concat(H3(a)),n=n+1,i=r.length>n;return HRe(e)}$(_Wt,"firstForSequence");function RWt(t){const e=Wr(t.definition,r=>H3(r));return HRe(Xg(e))}$(RWt,"firstForBranching");function DWt(t){return[t.terminalType]}$(DWt,"firstForTerminal");var LWt="_~IN~_",OWn=(OL=class extends zre{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=IWt(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),o=new sd({definition:a}),s=H3(o);this.follows[i]=s}},$(OL,"ResyncFollowsWalker"),OL);function MWt(t){const e={};return Sn(t,r=>{const n=new OWn(r).startWalking();yf(e,n)}),e}$(MWt,"computeAllProdsFollows");function IWt(t,e){return t.name+e+LWt}$(IWt,"buildBetweenProdsFollowPrefix");var Ure={},kWn=new LUt;function yz(t){const e=t.toString();if(Ure.hasOwnProperty(e))return Ure[e];{const r=kWn.pattern(e);return Ure[e]=r,r}}$(yz,"getRegExpAst");function PWt(){Ure={}}$(PWt,"clearRegExpParserCache");var NWt="Complement Sets are not supported for first char optimization",Vre=`Unable to use "first char" lexer optimizations: -`;function BWt(t,e=!1){try{const r=yz(t);return Qre(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===NWt)e&&WRe(`${Vre} Unable to optimize: < ${t.toString()} > +`.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)}},$(dL,"TerminalRegExpVisitor"),dL),CO=new czn;function BUt(t){try{typeof t!="string"&&(t=t.source),t=`/${t}/`;const e=NUt.pattern(t),r=[];for(const n of e.value.value)CO.reset(t),CO.visit(n),r.push({start:CO.startRegexp,end:CO.endRegex});return r}catch{return[]}}$(BUt,"getTerminalParts");function tRe(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),CO.reset(t),CO.visit(NUt.pattern(t)),CO.multiline}catch{return!1}}$(tRe,"isMultilineComment");var $Ut=`\f +\r \v              \u2028\u2029   \uFEFF`.split("");function pre(t){const e=typeof t=="string"?new RegExp(t):t;return $Ut.some(r=>e.test(r))}$(pre,"isWhitespace");function F3(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$(F3,"escapeRegExp");function rRe(t,e){const r=nRe(t),n=e.match(r);return!!n&&n[0].length>0}$(rRe,"partialMatches");function nRe(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let a="",o;function s(u){a+=r.substr(n,u),n+=u}$(s,"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"[":o=/\[(?:\\.|.)*?\]/g,o.lastIndex=n,o=o.exec(r)||[],l(o[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":s(1);break;case"{":o=/\{\d+,?\d*\}/g,o.lastIndex=n,o=o.exec(r),o?s(o[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"!":o=n,n+=3,i(),a+=r.substr(o,n-o);break;case"<":switch(r[n+3]){case"=":case"!":o=n,n+=4,i(),a+=r.substr(o,n-o);break;default:s(r.indexOf(">",n)-n+1),a+=i()+"|$)";break}break}else s(1),a+=i()+"|$)";break;case")":return++n,a;default:l(1);break}return a}return $(i,"process"),new RegExp(i(),t.flags)}$(nRe,"partialRegExp");function iRe(t){return t.rules.find(e=>lh(e)&&e.entry)}$(iRe,"getEntryRule");function aRe(t){return t.rules.filter(e=>Bp(e)&&e.hidden)}$(aRe,"getHiddenRules");function gre(t,e){const r=new Set,n=iRe(t);if(!n)return new Set(t.rules);const i=[n].concat(aRe(t));for(const o of i)oRe(o,r,e);const a=new Set;for(const o of t.rules)(r.has(o.name)||Bp(o)&&o.hidden)&&a.add(o);return a}$(gre,"getAllReachableRules");function oRe(t,e,r){e.add(t.name),J1(t).forEach(n=>{if(nb(n)||r&&rre(n)){const i=n.rule.ref;i&&!e.has(i.name)&&oRe(i,e,r)}})}$(oRe,"ruleDfs");function FUt(t){const e=new Set;return J1(t).forEach(r=>{hO(r)&&(lh(r.type.ref)&&e.add(r.type.ref),Q9(r.type.ref)&&lh(r.type.ref.$container)&&e.add(r.type.ref.$container))}),e}$(FUt,"getAllRulesUsedForCrossReferences");function sRe(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=bre(t.type.ref);return e==null?void 0:e.terminal}}$(sRe,"getCrossReferenceTerminal");function lRe(t){return t.hidden&&!pre(K9(t))}$(lRe,"isCommentTerminal");function cRe(t,e){return!t||!e?[]:vre(t,e,t.astNode,!0)}$(cRe,"findNodesForProperty");function mre(t,e,r){if(!t||!e)return;const n=vre(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]}$(mre,"findNodeForProperty");function vre(t,e,r,n){if(!n){const i=cO(t.grammarSource,eb);if(i&&i.feature===e)return[t]}return Z1(t)&&t.astNode===r?t.content.flatMap(i=>vre(i,e,r,!1)):[]}$(vre,"findNodesForPropertyInternal");function zUt(t,e){return t?yre(t,e,t==null?void 0:t.astNode):[]}$(zUt,"findNodesForKeyword");function uRe(t,e,r){if(!t)return;const n=yre(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]}$(uRe,"findNodeForKeyword");function yre(t,e,r){if(t.astNode!==r)return[];if(rb(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=N3(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const o=i.value;o.astNode===r?rb(o.grammarSource)&&o.grammarSource.value===e&&a.push(o):n.prune()}while(!i.done);return a}$(yre,"findNodesForKeywordInternal");function hRe(t){var r;const e=t.astNode;for(;e===((r=t.container)==null?void 0:r.astNode);){const n=cO(t.grammarSource,eb);if(n)return n;t=t.container}}$(hRe,"findAssignment");function bre(t){let e=t;return Q9(e)&&(Aw(e.$container)?e=e.$container.$container:uO(e.$container)?e=e.$container:kw(e.$container)),dRe(t,e,new Map)}$(bre,"findNameAssignment");function dRe(t,e,r){var i;function n(a,o){let s;return cO(a,eb)||(s=dRe(o,o,r)),r.set(t,s),s}if($(n,"go"),r.has(t))return r.get(t);r.set(t,void 0);for(const a of J1(e)){if(eb(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(nb(a)&&lh(a.rule.ref))return n(a,a.rule.ref);if(ere(a)&&((i=a.typeRef)!=null&&i.ref))return n(a,a.typeRef.ref)}}$(dRe,"findNameAssignmentInternal");function fRe(t){const e=t.$container;if(fO(e)){const r=e.elements,n=r.indexOf(t);for(let i=n-1;i>=0;i--){const a=r[i];if(Aw(a))return a;{const o=J1(r[i]).find(Aw);if(o)return o}}}if(Ute(e))return fRe(e)}$(fRe,"getActionAtElement");function UUt(t,e){return t==="?"||t==="*"||fO(e)&&!!e.guardCondition}$(UUt,"isOptionalCardinality");function VUt(t){return t==="*"||t==="+"}$(VUt,"isArrayCardinality");function QUt(t){return t==="+="}$(QUt,"isArrayOperator");function j9(t){return pRe(t,new Set)}$(j9,"isDataTypeRule");function pRe(t,e){if(e.has(t))return!0;e.add(t);for(const r of J1(t))if(nb(r)){if(!r.rule.ref||lh(r.rule.ref)&&!pRe(r.rule.ref,e)||_3(r.rule.ref))return!1}else{if(eb(r))return!1;if(Aw(r))return!1}return!!t.definition}$(pRe,"isDataTypeRuleInternal");function GUt(t){return xre(t.type,new Set)}$(GUt,"isDataType");function xre(t,e){if(e.has(t))return!0;if(e.add(t),S5e(t))return!1;if(M5e(t))return!1;if($5e(t))return t.types.every(r=>xre(r,e));if(ere(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 nre(r)?xre(r.type,e):!1}else return!1}else return!1}$(xre,"isDataTypeInternal");function X9(t){if(!Bp(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}}}$(X9,"getExplicitRuleType");function OO(t){if(uO(t))return lh(t)&&j9(t)?t.name:X9(t)??t.name;if(_5e(t)||nre(t)||P5e(t))return t.name;if(Aw(t)){const e=gRe(t);if(e)return e}else if(Q9(t))return t.name;throw new Error("Cannot get name of Unknown Type")}$(OO,"getTypeName");function gRe(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return OO(t.type.ref)}$(gRe,"getActionType");function HUt(t){var e;return Bp(t)?((e=t.type)==null?void 0:e.name)??"string":lh(t)&&j9(t)?t.name:X9(t)??t.name}$(HUt,"getRuleTypeName");function mRe(t){var e;return Bp(t)?((e=t.type)==null?void 0:e.name)??"string":X9(t)??t.name}$(mRe,"getRuleType");function K9(t){const e={s:!1,i:!1,u:!1},r=kO(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}$(K9,"terminalRegex");var vRe=/[\s\S]/.source;function kO(t,e){var r;if(N5e(t))return WUt(t);if(B5e(t))return YUt(t);if(C5e(t))return XUt(t);if(rre(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return uv(kO(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(R5e(t))return jUt(t);if(F5e(t))return qUt(t);if(I5e(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")),uv(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(z5e(t))return uv(vRe,{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}`)}}}$(kO,"abstractElementToRegex");function WUt(t){return uv(t.elements.map(e=>kO(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}$(WUt,"terminalAlternativesToRegex");function YUt(t){return uv(t.elements.map(e=>kO(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}$(YUt,"terminalGroupToRegex");function qUt(t){return uv(`${vRe}*?${kO(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}$(qUt,"untilTokenToRegex");function jUt(t){return uv(`(?!${kO(t.terminal)})${vRe}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}$(jUt,"negateTokenToRegex");function XUt(t){return t.right?uv(`[${wre(t.left)}-${wre(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):uv(wre(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}$(XUt,"characterRangeToRegex");function wre(t){return F3(t.value)}$(wre,"keywordToRegex");function uv(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}$(uv,"withCardinality");function yRe(t){const e=[],r=t.Grammar;for(const n of r.rules)Bp(n)&&lRe(n)&&tRe(K9(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:H5e}}$(yRe,"createGrammarConfig");var uzn=typeof global=="object"&&global&&global.Object===Object&&global,KUt=uzn,hzn=typeof self=="object"&&self&&self.Object===Object&&self,dzn=KUt||hzn||Function("return this")(),hv=dzn,fzn=hv.Symbol,$p=fzn,ZUt=Object.prototype,pzn=ZUt.hasOwnProperty,gzn=ZUt.toString,Z9=$p?$p.toStringTag:void 0;function JUt(t){var e=pzn.call(t,Z9),r=t[Z9];try{t[Z9]=void 0;var n=!0}catch{}var i=gzn.call(t);return n&&(e?t[Z9]=r:delete t[Z9]),i}$(JUt,"getRawTag");var mzn=JUt,vzn=Object.prototype,yzn=vzn.toString;function eVt(t){return yzn.call(t)}$(eVt,"objectToString");var bzn=eVt,xzn="[object Null]",wzn="[object Undefined]",tVt=$p?$p.toStringTag:void 0;function rVt(t){return t==null?t===void 0?wzn:xzn:tVt&&tVt in Object(t)?mzn(t):bzn(t)}$(rVt,"baseGetTag");var Ew=rVt;function nVt(t){return t!=null&&typeof t=="object"}$(nVt,"isObjectLike");var jg=nVt,Azn="[object Symbol]";function iVt(t){return typeof t=="symbol"||jg(t)&&Ew(t)==Azn}$(iVt,"isSymbol");var Are=iVt;function aVt(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r0){if(++e>=iUn)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}$(EVt,"shortOut");var sUn=EVt;function _Vt(t){return function(){return t}}$(_Vt,"constant");var lUn=_Vt,cUn=function(){try{var t=_O(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Sre=cUn,uUn=Sre?function(t,e){return Sre(t,"toString",{configurable:!0,enumerable:!1,value:lUn(e),writable:!0})}:tz,hUn=uUn,dUn=sUn(hUn),fUn=dUn;function RVt(t,e){for(var r=-1,n=t==null?0:t.length;++r-1}$(BVt,"arrayIncludes");var $Vt=BVt,mUn=9007199254740991,vUn=/^(?:0|[1-9]\d*)$/;function FVt(t,e){var r=typeof t;return e=e??mUn,!!e&&(r=="number"||r!="symbol"&&vUn.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=wUn}$(YVt,"isLength");var CRe=YVt;function qVt(t){return t!=null&&CRe(t.length)&&!ab(t)}$(qVt,"isArrayLike");var dv=qVt;function jVt(t,e,r){if(!Fp(r))return!1;var n=typeof e;return(n=="number"?dv(r)&&Tre(e,r.length):n=="string"&&e in r)?rz(r[e],t):!1}$(jVt,"isIterateeCall");var Ore=jVt;function XVt(t){return TRe(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,o&&Ore(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n-1}$(DQt,"listCacheHas");var FVn=DQt;function LQt(t,e){var r=this.__data__,n=_re(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}$(LQt,"listCacheSet");var zVn=LQt;function DO(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e0&&r(s)?e>1?DRe(s,e-1,r,n,i):RRe(i,s):n||(i[i.length]=s)}return i}$(DRe,"baseFlatten");var LRe=DRe;function jQt(t){var e=t==null?0:t.length;return e?LRe(t,1):[]}$(jQt,"flatten");var Xg=jQt,aQn=fQt(Object.getPrototypeOf,Object),XQt=aQn;function KQt(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);++ns))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&jGn?new FRe:void 0;for(a.set(t,e),a.set(e,t);++d2?e[2]:void 0;for(i&&Ore(e[0],e[1],i)&&(n=1);++r=VHn&&(a=zRe,o=!1,e=new FRe(e));e:for(;++i-1?i[a?e[o]:o]:void 0}}$(XHt,"createFind");var qHn=XHt,jHn=Math.max;function KHt(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:ez(r);return i<0&&(i=jHn(n+i,0)),MVt(t,fv(e),i)}$(KHt,"findIndex");var XHn=KHt,KHn=qHn(XHn),V3=KHn;function ZHt(t){return t&&t.length?t[0]:void 0}$(ZHt,"head");var Zg=ZHt;function JHt(t,e){var r=-1,n=dv(t)?Array(t.length):[];return PO(t,function(i,a,o){n[++r]=e(i,a,o)}),n}$(JHt,"baseMap");var ZHn=JHt;function eWt(t,e){var r=Fi(t)?J9:ZHn;return r(t,fv(e))}$(eWt,"map");var Wr=eWt;function tWt(t,e){return LRe(Wr(t,e),1)}$(tWt,"flatMap");var Up=tWt,JHn=Object.prototype,eWn=JHn.hasOwnProperty,tWn=FHn(function(t,e,r){eWn.call(t,r)?t[r].push(e):SRe(t,r,[e])}),rWn=tWn,nWn=Object.prototype,iWn=nWn.hasOwnProperty;function rWt(t,e){return t!=null&&iWn.call(t,e)}$(rWt,"baseHas");var aWn=rWt;function nWt(t,e){return t!=null&&xHt(t,e,aWn)}$(nWt,"has");var hn=nWt,oWn="[object String]";function iWt(t){return typeof t=="string"||!Fi(t)&&jg(t)&&Ew(t)==oWn}$(iWt,"isString");var od=iWt;function aWt(t,e){return J9(e,function(r){return t[r]})}$(aWt,"baseValues");var sWn=aWt;function oWt(t){return t==null?[]:sWn(t,vf(t))}$(oWt,"values");var ml=oWt,lWn=Math.max;function sWt(t,e,r,n){t=dv(t)?t:ml(t),r=r&&!n?ez(r):0;var i=t.length;return r<0&&(r=lWn(i+r,0)),od(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&ARe(t,e,r)>-1}$(sWt,"includes");var ch=sWt,cWn=Math.max;function lWt(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:ez(r);return i<0&&(i=cWn(n+i,0)),ARe(t,e,i)}$(lWt,"indexOf");var cWt=lWt,uWn="[object Map]",hWn="[object Set]",dWn=Object.prototype,fWn=dWn.hasOwnProperty;function uWt(t){if(t==null)return!0;if(dv(t)&&(Fi(t)||typeof t=="string"||typeof t.splice=="function"||az(t)||kRe(t)||kre(t)))return!t.length;var e=U3(t);if(e==uWn||e==hWn)return!t.size;if(iz(t))return!gQt(t).length;for(var r in t)if(fWn.call(t,r))return!1;return!0}$(uWt,"isEmpty");var Ga=uWt,pWn="[object RegExp]";function hWt(t){return jg(t)&&Ew(t)==pWn}$(hWt,"baseIsRegExp");var gWn=hWt,dWt=_w&&_w.isRegExp,mWn=dWt?oz(dWt):gWn,ob=mWn;function fWt(t){return t===void 0}$(fWt,"isUndefined");var sb=fWt,vWn="Expected a function";function pWt(t){if(typeof t!="function")throw new TypeError(vWn);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)}}$(pWt,"negate");var yWn=pWt;function gWt(t,e,r,n){if(!Fp(t))return t;e=Ire(e,t);for(var i=-1,a=e.length,o=a-1,s=t;s!=null&&++i=OWn){var u=e?null:CWn(t);if(u)return URe(u);o=!1,i=zRe,l=new FRe}else l=e?[]:s;e:for(;++n{r.accept(e)})}},$(fL,"AbstractProduction"),fL),uh=(pL=class extends pv{constructor(e){super([]),this.idx=1,yf(this,Jg(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},$(pL,"NonTerminal"),pL),Q3=(gL=class extends pv{constructor(e){super(e.definition),this.orgText="",yf(this,Jg(e,r=>r!==void 0))}},$(gL,"Rule"),gL),sd=(mL=class extends pv{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,yf(this,Jg(e,r=>r!==void 0))}},$(mL,"Alternative"),mL),Dc=(vL=class extends pv{constructor(e){super(e.definition),this.idx=1,yf(this,Jg(e,r=>r!==void 0))}},$(vL,"Option"),vL),xf=(yL=class extends pv{constructor(e){super(e.definition),this.idx=1,yf(this,Jg(e,r=>r!==void 0))}},$(yL,"RepetitionMandatory"),yL),wf=(bL=class extends pv{constructor(e){super(e.definition),this.idx=1,yf(this,Jg(e,r=>r!==void 0))}},$(bL,"RepetitionMandatoryWithSeparator"),bL),ns=(xL=class extends pv{constructor(e){super(e.definition),this.idx=1,yf(this,Jg(e,r=>r!==void 0))}},$(xL,"Repetition"),xL),ld=(wL=class extends pv{constructor(e){super(e.definition),this.idx=1,yf(this,Jg(e,r=>r!==void 0))}},$(wL,"RepetitionWithSeparator"),wL),cd=(AL=class extends pv{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,yf(this,Jg(e,r=>r!==void 0))}},$(AL,"Alternation"),AL),go=(SL=class{constructor(e){this.idx=1,yf(this,Jg(e,r=>r!==void 0))}accept(e){e.visit(this)}},$(SL,"Terminal"),SL);function EWt(t){return Wr(t,mz)}$(EWt,"serializeGrammar");function mz(t){function e(r){return Wr(r,mz)}if($(e,"convertDefinition"),t instanceof uh){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return od(t.label)&&(r.label=t.label),r}else{if(t instanceof sd)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Dc)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof xf)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof wf)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:mz(new go({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ld)return{type:"RepetitionWithSeparator",idx:t.idx,separator:mz(new go({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ns)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof cd)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof go){const r={type:"Terminal",name:t.terminalType.name,label:OWt(t.terminalType),idx:t.idx};od(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=ob(n)?n.source:n),r}else{if(t instanceof Q3)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}$(mz,"serializeProduction");var G3=(TL=class{visit(e){const r=e;switch(r.constructor){case uh:return this.visitNonTerminal(r);case sd:return this.visitAlternative(r);case Dc:return this.visitOption(r);case xf:return this.visitRepetitionMandatory(r);case wf:return this.visitRepetitionMandatoryWithSeparator(r);case ld:return this.visitRepetitionWithSeparator(r);case ns:return this.visitRepetition(r);case cd:return this.visitAlternation(r);case go:return this.visitTerminal(r);case Q3: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){}},$(TL,"GAstVisitor"),TL);function _Wt(t){return t instanceof sd||t instanceof Dc||t instanceof ns||t instanceof xf||t instanceof wf||t instanceof ld||t instanceof go||t instanceof Q3}$(_Wt,"isSequenceProd");function vz(t,e=[]){return t instanceof Dc||t instanceof ns||t instanceof ld?!0:t instanceof cd?SWt(t.definition,n=>vz(n,e)):t instanceof uh&&ch(e,t)?!1:t instanceof pv?(t instanceof uh&&e.push(t),Kg(t.definition,n=>vz(n,e))):!1}$(vz,"isOptionalProd");function RWt(t){return t instanceof cd}$(RWt,"isBranchingProd");function em(t){if(t instanceof uh)return"SUBRULE";if(t instanceof Dc)return"OPTION";if(t instanceof cd)return"OR";if(t instanceof xf)return"AT_LEAST_ONE";if(t instanceof wf)return"AT_LEAST_ONE_SEP";if(t instanceof ld)return"MANY_SEP";if(t instanceof ns)return"MANY";if(t instanceof go)return"CONSUME";throw Error("non exhaustive match")}$(em,"getProductionDslName");var zre=(CL=class{walk(e,r=[]){Sn(e.definition,(n,i)=>{const a=Rc(e.definition,i+1);if(n instanceof uh)this.walkProdRef(n,a,r);else if(n instanceof go)this.walkTerminal(n,a,r);else if(n instanceof sd)this.walkFlat(n,a,r);else if(n instanceof Dc)this.walkOption(n,a,r);else if(n instanceof xf)this.walkAtLeastOne(n,a,r);else if(n instanceof wf)this.walkAtLeastOneSep(n,a,r);else if(n instanceof ld)this.walkManySep(n,a,r);else if(n instanceof ns)this.walkMany(n,a,r);else if(n instanceof cd)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 Dc({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=jRe(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new Dc({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=jRe(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);Sn(e.definition,a=>{const o=new sd({definition:[a]});this.walk(o,i)})}},$(CL,"RestWalker"),CL);function jRe(t,e,r){return[new Dc({definition:[new go({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}$(jRe,"restForRepetitionWithSeparator");function H3(t){if(t instanceof uh)return H3(t.referencedRule);if(t instanceof go)return MWt(t);if(_Wt(t))return DWt(t);if(RWt(t))return LWt(t);throw Error("non exhaustive match")}$(H3,"first");function DWt(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,o=!0;for(;i&&o;)a=r[n],o=vz(a),e=e.concat(H3(a)),n=n+1,i=r.length>n;return HRe(e)}$(DWt,"firstForSequence");function LWt(t){const e=Wr(t.definition,r=>H3(r));return HRe(Xg(e))}$(LWt,"firstForBranching");function MWt(t){return[t.terminalType]}$(MWt,"firstForTerminal");var IWt="_~IN~_",EWn=(OL=class extends zre{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=NWt(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),o=new sd({definition:a}),s=H3(o);this.follows[i]=s}},$(OL,"ResyncFollowsWalker"),OL);function PWt(t){const e={};return Sn(t,r=>{const n=new EWn(r).startWalking();yf(e,n)}),e}$(PWt,"computeAllProdsFollows");function NWt(t,e){return t.name+e+IWt}$(NWt,"buildBetweenProdsFollowPrefix");var Ure={},_Wn=new IUt;function yz(t){const e=t.toString();if(Ure.hasOwnProperty(e))return Ure[e];{const r=_Wn.pattern(e);return Ure[e]=r,r}}$(yz,"getRegExpAst");function BWt(){Ure={}}$(BWt,"clearRegExpParserCache");var $Wt="Complement Sets are not supported for first char optimization",Vre=`Unable to use "first char" lexer optimizations: +`;function FWt(t,e=!1){try{const r=yz(t);return Qre(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===$Wt)e&&WRe(`${Vre} 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=` @@ -1641,48 +1641,48 @@ ${JSON.stringify(Me,null,4)}`);const at=Me;if(r.string(at.id)||r.number(at.id)){ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Fre(`${Vre} Failed parsing: < ${t.toString()} > Using the @chevrotain/regexp-to-ast library - Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}$(BWt,"getOptimizedStartCodesIndices");function Qre(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof l=="number")bz(l,e,r);else{const u=l;if(r===!0)for(let h=u.from;h<=u.to;h++)bz(h,e,r);else{for(let h=u.from;h<=u.to&&h=wz){const h=u.from>=wz?u.from:wz,d=u.to,f=lb(h),p=lb(d);for(let g=f;g<=p;g++)e[g]=g}}}});break;case"Group":Qre(o.value,e,r);break;default:throw Error("Non Exhaustive Match")}const s=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&Gre(o)===!1||o.type!=="Group"&&s===!1)break}break;default:throw Error("non exhaustive match!")}return ml(e)}$(Qre,"firstCharOptimizedIndices");function bz(t,e,r){const n=lb(t);e[n]=n,r===!0&&$Wt(t,e)}$(bz,"addOptimizedIdxToResult");function $Wt(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=lb(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=lb(i.charCodeAt(0));e[a]=a}}}$($Wt,"handleIgnoreCase");function XRe(t,e){return V3(t.value,r=>{if(typeof r=="number")return ch(e,r);{const n=r;return V3(e,i=>n.from<=i&&i<=n.to)!==void 0}})}$(XRe,"findCode");function Gre(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Fi(t.value)?Kg(t.value,Gre):Gre(t.value):!1}$(Gre,"isWholeOptional");var EWn=(kL=class extends fre{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){ch(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?XRe(e,this.targetCharCodes)===void 0&&(this.found=!0):XRe(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},$(kL,"CharCodeFinder"),kL);function Hre(t,e){if(e instanceof RegExp){const r=yz(e),n=new EWn(t);return n.visit(r),n.found}else return V3(e,r=>ch(t,r.charCodeAt(0)))!==void 0}$(Hre,"canMatchCharCode");var BO="PATTERN",xz="defaultMode",Wre="modes";function FWt(t,e){e=GRe(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` -`],tracer:$((b,x)=>x(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{oYt()});let n;r("Reject Lexer.NA",()=>{n=$re(t,b=>b[BO]===hh.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=Wr(n,b=>{const x=b[BO];if(ob(x)){const w=x.source;return w.length===1&&w!=="^"&&w!=="$"&&w!=="."&&!x.ignoreCase?w:w.length===2&&w[0]==="\\"&&!ch(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],w[1])?w[1]:KRe(x)}else{if(ab(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 KRe(A)}}else throw Error("non exhaustive match")}})});let o,s,l,u,h;r("misc mapping",()=>{o=Wr(n,b=>b.tokenTypeIdx),s=Wr(n,b=>{const x=b.GROUP;if(x!==hh.SKIPPED){if(od(x))return x;if(sb(x))return!1;throw Error("non exhaustive match")}}),l=Wr(n,b=>{const x=b.LONGER_ALT;if(x)return Fi(x)?Wr(x,A=>sWt(n,A)):[sWt(n,x)]}),u=Wr(n,b=>b.PUSH_MODE),h=Wr(n,b=>hn(b,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const b=e4e(e.lineTerminatorCharacters);d=Wr(n,x=>!1),e.positionTracking!=="onlyOffset"&&(d=Wr(n,x=>hn(x,"LINE_BREAKS")?!!x.LINE_BREAKS:JRe(x,b)===!1&&Hre(b,x.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=Wr(n,ZRe),p=Wr(a,iYt),g=bf(n,(b,x)=>{const w=x.GROUP;return od(w)&&w!==hh.SKIPPED&&(b[w]=[]),b},{}),m=Wr(a,(b,x)=>({pattern:a[x],longerAlt:l[x],canLineTerminator:d[x],isCustom:f[x],short:p[x],group:s[x],push:u[x],pop:h[x],tokenTypeIdx:o[x],tokenType:n[x]}))});let v=!0,y=[];return e.safeMode||r("First Char Optimization",()=>{y=bf(n,(b,x,w)=>{if(typeof x.PATTERN=="string"){const A=x.PATTERN.charCodeAt(0),S=lb(A);Yre(b,S,m[w])}else if(Fi(x.START_CHARS_HINT)){let A;Sn(x.START_CHARS_HINT,S=>{const T=typeof S=="string"?S.charCodeAt(0):S,C=lb(T);A!==C&&(A=C,Yre(b,C,m[w]))})}else if(ob(x.PATTERN))if(x.PATTERN.unicode)v=!1,e.ensureOptimizations&&Fre(`${Vre} Unable to analyze < ${x.PATTERN.toString()} > pattern. + Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}$(FWt,"getOptimizedStartCodesIndices");function Qre(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i{if(typeof l=="number")bz(l,e,r);else{const u=l;if(r===!0)for(let h=u.from;h<=u.to;h++)bz(h,e,r);else{for(let h=u.from;h<=u.to&&h=wz){const h=u.from>=wz?u.from:wz,d=u.to,f=lb(h),p=lb(d);for(let g=f;g<=p;g++)e[g]=g}}}});break;case"Group":Qre(o.value,e,r);break;default:throw Error("Non Exhaustive Match")}const s=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&Gre(o)===!1||o.type!=="Group"&&s===!1)break}break;default:throw Error("non exhaustive match!")}return ml(e)}$(Qre,"firstCharOptimizedIndices");function bz(t,e,r){const n=lb(t);e[n]=n,r===!0&&zWt(t,e)}$(bz,"addOptimizedIdxToResult");function zWt(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=lb(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=lb(i.charCodeAt(0));e[a]=a}}}$(zWt,"handleIgnoreCase");function XRe(t,e){return V3(t.value,r=>{if(typeof r=="number")return ch(e,r);{const n=r;return V3(e,i=>n.from<=i&&i<=n.to)!==void 0}})}$(XRe,"findCode");function Gre(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Fi(t.value)?Kg(t.value,Gre):Gre(t.value):!1}$(Gre,"isWholeOptional");var RWn=(kL=class extends fre{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){ch(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?XRe(e,this.targetCharCodes)===void 0&&(this.found=!0):XRe(e,this.targetCharCodes)!==void 0&&(this.found=!0)}},$(kL,"CharCodeFinder"),kL);function Hre(t,e){if(e instanceof RegExp){const r=yz(e),n=new RWn(t);return n.visit(r),n.found}else return V3(e,r=>ch(t,r.charCodeAt(0)))!==void 0}$(Hre,"canMatchCharCode");var BO="PATTERN",xz="defaultMode",Wre="modes";function UWt(t,e){e=GRe(e,{debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",` +`],tracer:$((b,x)=>x(),"tracer")});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{lYt()});let n;r("Reject Lexer.NA",()=>{n=$re(t,b=>b[BO]===hh.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=Wr(n,b=>{const x=b[BO];if(ob(x)){const w=x.source;return w.length===1&&w!=="^"&&w!=="$"&&w!=="."&&!x.ignoreCase?w:w.length===2&&w[0]==="\\"&&!ch(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],w[1])?w[1]:KRe(x)}else{if(ab(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 KRe(A)}}else throw Error("non exhaustive match")}})});let o,s,l,u,h;r("misc mapping",()=>{o=Wr(n,b=>b.tokenTypeIdx),s=Wr(n,b=>{const x=b.GROUP;if(x!==hh.SKIPPED){if(od(x))return x;if(sb(x))return!1;throw Error("non exhaustive match")}}),l=Wr(n,b=>{const x=b.LONGER_ALT;if(x)return Fi(x)?Wr(x,A=>cWt(n,A)):[cWt(n,x)]}),u=Wr(n,b=>b.PUSH_MODE),h=Wr(n,b=>hn(b,"POP_MODE"))});let d;r("Line Terminator Handling",()=>{const b=e4e(e.lineTerminatorCharacters);d=Wr(n,x=>!1),e.positionTracking!=="onlyOffset"&&(d=Wr(n,x=>hn(x,"LINE_BREAKS")?!!x.LINE_BREAKS:JRe(x,b)===!1&&Hre(b,x.PATTERN)))});let f,p,g,m;r("Misc Mapping #2",()=>{f=Wr(n,ZRe),p=Wr(a,oYt),g=bf(n,(b,x)=>{const w=x.GROUP;return od(w)&&w!==hh.SKIPPED&&(b[w]=[]),b},{}),m=Wr(a,(b,x)=>({pattern:a[x],longerAlt:l[x],canLineTerminator:d[x],isCustom:f[x],short:p[x],group:s[x],push:u[x],pop:h[x],tokenTypeIdx:o[x],tokenType:n[x]}))});let v=!0,y=[];return e.safeMode||r("First Char Optimization",()=>{y=bf(n,(b,x,w)=>{if(typeof x.PATTERN=="string"){const A=x.PATTERN.charCodeAt(0),S=lb(A);Yre(b,S,m[w])}else if(Fi(x.START_CHARS_HINT)){let A;Sn(x.START_CHARS_HINT,S=>{const T=typeof S=="string"?S.charCodeAt(0):S,C=lb(T);A!==C&&(A=C,Yre(b,C,m[w]))})}else if(ob(x.PATTERN))if(x.PATTERN.unicode)v=!1,e.ensureOptimizations&&Fre(`${Vre} 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=BWt(x.PATTERN,e.ensureOptimizations);Ga(A)&&(v=!1),Sn(A,S=>{Yre(b,S,m[w])})}else e.ensureOptimizations&&Fre(`${Vre} 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=FWt(x.PATTERN,e.ensureOptimizations);Ga(A)&&(v=!1),Sn(A,S=>{Yre(b,S,m[w])})}else e.ensureOptimizations&&Fre(`${Vre} 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}}$(FWt,"analyzeTokenTypes");function zWt(t,e){let r=[];const n=VWt(t);r=r.concat(n.errors);const i=QWt(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(UWt(a)),r=r.concat(jWt(a)),r=r.concat(XWt(a,e)),r=r.concat(KWt(a)),r}$(zWt,"validatePatterns");function UWt(t){let e=[];const r=zp(t,n=>ob(n[BO]));return e=e.concat(GWt(r)),e=e.concat(WWt(r)),e=e.concat(YWt(r)),e=e.concat(qWt(r)),e=e.concat(HWt(r)),e}$(UWt,"validateRegExpPattern");function VWt(t){const e=zp(t,i=>!hn(i,BO)),r=Wr(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:is.MISSING_PATTERN,tokenTypes:[i]})),n=Bre(t,e);return{errors:r,valid:n}}$(VWt,"findMissingPatterns");function QWt(t){const e=zp(t,i=>{const a=i[BO];return!ob(a)&&!ab(a)&&!hn(a,"exec")&&!od(a)}),r=Wr(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:is.INVALID_PATTERN,tokenTypes:[i]})),n=Bre(t,e);return{errors:r,valid:n}}$(QWt,"findInvalidPatterns");var _Wn=/[^\\][$]/;function GWt(t){const i=class i extends fre{constructor(){super(...arguments),this.found=!1}visitEndAnchor(o){this.found=!0}};$(i,"EndAnchorFinder");let e=i;const r=zp(t,a=>{const o=a.PATTERN;try{const s=yz(o),l=new e;return l.visit(s),l.found}catch{return _Wn.test(o.source)}});return Wr(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}}$(UWt,"analyzeTokenTypes");function VWt(t,e){let r=[];const n=GWt(t);r=r.concat(n.errors);const i=HWt(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(QWt(a)),r=r.concat(KWt(a)),r=r.concat(ZWt(a,e)),r=r.concat(JWt(a)),r}$(VWt,"validatePatterns");function QWt(t){let e=[];const r=zp(t,n=>ob(n[BO]));return e=e.concat(WWt(r)),e=e.concat(qWt(r)),e=e.concat(jWt(r)),e=e.concat(XWt(r)),e=e.concat(YWt(r)),e}$(QWt,"validateRegExpPattern");function GWt(t){const e=zp(t,i=>!hn(i,BO)),r=Wr(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:is.MISSING_PATTERN,tokenTypes:[i]})),n=Bre(t,e);return{errors:r,valid:n}}$(GWt,"findMissingPatterns");function HWt(t){const e=zp(t,i=>{const a=i[BO];return!ob(a)&&!ab(a)&&!hn(a,"exec")&&!od(a)}),r=Wr(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:is.INVALID_PATTERN,tokenTypes:[i]})),n=Bre(t,e);return{errors:r,valid:n}}$(HWt,"findInvalidPatterns");var DWn=/[^\\][$]/;function WWt(t){const i=class i extends fre{constructor(){super(...arguments),this.found=!1}visitEndAnchor(o){this.found=!0}};$(i,"EndAnchorFinder");let e=i;const r=zp(t,a=>{const o=a.PATTERN;try{const s=yz(o),l=new e;return l.visit(s),l.found}catch{return DWn.test(o.source)}});return Wr(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:is.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}$(GWt,"findEndOfInputAnchor");function HWt(t){const e=zp(t,n=>n.PATTERN.test(""));return Wr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:is.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}$(HWt,"findEmptyMatchRegExps");var RWn=/[^\\[][\^]|^\^/;function WWt(t){const i=class i extends fre{constructor(){super(...arguments),this.found=!1}visitStartAnchor(o){this.found=!0}};$(i,"StartAnchorFinder");let e=i;const r=zp(t,a=>{const o=a.PATTERN;try{const s=yz(o),l=new e;return l.visit(s),l.found}catch{return RWn.test(o.source)}});return Wr(r,a=>({message:`Unexpected RegExp Anchor Error: + See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:is.EOI_ANCHOR_FOUND,tokenTypes:[a]}))}$(WWt,"findEndOfInputAnchor");function YWt(t){const e=zp(t,n=>n.PATTERN.test(""));return Wr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:is.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}$(YWt,"findEmptyMatchRegExps");var LWn=/[^\\[][\^]|^\^/;function qWt(t){const i=class i extends fre{constructor(){super(...arguments),this.found=!1}visitStartAnchor(o){this.found=!0}};$(i,"StartAnchorFinder");let e=i;const r=zp(t,a=>{const o=a.PATTERN;try{const s=yz(o),l=new e;return l.visit(s),l.found}catch{return LWn.test(o.source)}});return Wr(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:is.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}$(WWt,"findStartOfInputAnchor");function YWt(t){const e=zp(t,n=>{const i=n[BO];return i instanceof RegExp&&(i.multiline||i.global)});return Wr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:is.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}$(YWt,"findUnsupportedFlags");function qWt(t){const e=[];let r=Wr(t,a=>bf(t,(o,s)=>(a.PATTERN.source===s.PATTERN.source&&!ch(e,s)&&s.PATTERN!==hh.NA&&(e.push(s),o.push(s)),o),[]));r=fz(r);const n=zp(r,a=>a.length>1);return Wr(n,a=>{const o=Wr(a,l=>l.name);return{message:`The same RegExp pattern ->${Zg(a).PATTERN}<-has been used in all of the following Token Types: ${o.join(", ")} <-`,type:is.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}$(qWt,"findDuplicatePatterns");function jWt(t){const e=zp(t,n=>{if(!hn(n,"GROUP"))return!1;const i=n.GROUP;return i!==hh.SKIPPED&&i!==hh.NA&&!od(i)});return Wr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:is.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}$(jWt,"findInvalidGroupType");function XWt(t,e){const r=zp(t,i=>i.PUSH_MODE!==void 0&&!ch(e,i.PUSH_MODE));return Wr(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:is.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}$(XWt,"findModesThatDoNotExist");function KWt(t){const e=[],r=bf(t,(n,i,a)=>{const o=i.PATTERN;return o===hh.NA||(od(o)?n.push({str:o,idx:a,tokenType:i}):ob(o)&&JWt(o)&&n.push({str:o.source,idx:a,tokenType:i})),n},[]);return Sn(t,(n,i)=>{Sn(r,({str:a,idx:o,tokenType:s})=>{if(i${s.name}<- can never be matched. + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:is.SOI_ANCHOR_FOUND,tokenTypes:[a]}))}$(qWt,"findStartOfInputAnchor");function jWt(t){const e=zp(t,n=>{const i=n[BO];return i instanceof RegExp&&(i.multiline||i.global)});return Wr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:is.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}$(jWt,"findUnsupportedFlags");function XWt(t){const e=[];let r=Wr(t,a=>bf(t,(o,s)=>(a.PATTERN.source===s.PATTERN.source&&!ch(e,s)&&s.PATTERN!==hh.NA&&(e.push(s),o.push(s)),o),[]));r=fz(r);const n=zp(r,a=>a.length>1);return Wr(n,a=>{const o=Wr(a,l=>l.name);return{message:`The same RegExp pattern ->${Zg(a).PATTERN}<-has been used in all of the following Token Types: ${o.join(", ")} <-`,type:is.DUPLICATE_PATTERNS_FOUND,tokenTypes:a}})}$(XWt,"findDuplicatePatterns");function KWt(t){const e=zp(t,n=>{if(!hn(n,"GROUP"))return!1;const i=n.GROUP;return i!==hh.SKIPPED&&i!==hh.NA&&!od(i)});return Wr(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:is.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}$(KWt,"findInvalidGroupType");function ZWt(t,e){const r=zp(t,i=>i.PUSH_MODE!==void 0&&!ch(e,i.PUSH_MODE));return Wr(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:is.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}$(ZWt,"findModesThatDoNotExist");function JWt(t){const e=[],r=bf(t,(n,i,a)=>{const o=i.PATTERN;return o===hh.NA||(od(o)?n.push({str:o,idx:a,tokenType:i}):ob(o)&&tYt(o)&&n.push({str:o.source,idx:a,tokenType:i})),n},[]);return Sn(t,(n,i)=>{Sn(r,({str:a,idx:o,tokenType:s})=>{if(i${s.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:is.UNREACHABLE_PATTERN,tokenTypes:[n,s]})}})}),e}$(KWt,"findUnreachablePatterns");function ZWt(t,e){if(ob(e)){if(eYt(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(ab(e))return e(t,0,[],{});if(hn(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}$(ZWt,"tryToMatchStrToPattern");function JWt(t){return V3([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}$(JWt,"noMetaChar");function eYt(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition +See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:is.UNREACHABLE_PATTERN,tokenTypes:[n,s]})}})}),e}$(JWt,"findUnreachablePatterns");function eYt(t,e){if(ob(e)){if(rYt(e))return!1;const r=e.exec(t);return r!==null&&r.index===0}else{if(ab(e))return e(t,0,[],{});if(hn(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}$(eYt,"tryToMatchStrToPattern");function tYt(t){return V3([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}$(tYt,"noMetaChar");function rYt(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\? property in its definition `,type:is.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),hn(t,Wre)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Wre+`> property in its definition `,type:is.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),hn(t,Wre)&&hn(t,xz)&&!hn(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${xz}: <${t.defaultMode}>which does not exist `,type:is.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),hn(t,Wre)&&Sn(t.modes,(i,a)=>{Sn(i,(o,s)=>{if(sb(o))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${a}> at index: <${s}> `,type:is.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(hn(o,"LONGER_ALT")){const l=Fi(o.LONGER_ALT)?o.LONGER_ALT:[o.LONGER_ALT];Sn(l,u=>{!sb(u)&&!ch(i,u)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${o.name}> outside of mode <${a}> -`,type:is.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}$(tYt,"performRuntimeChecks");function rYt(t,e,r){const n=[];let i=!1;const a=fz(Xg(ml(t.modes))),o=$re(a,l=>l[BO]===hh.NA),s=e4e(r);return e&&Sn(o,l=>{const u=JRe(l,s);if(u!==!1){const d={message:aYt(l,u),type:u.issue,tokenType:l};n.push(d)}else hn(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):Hre(s,l.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found. +`,type:is.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}$(nYt,"performRuntimeChecks");function iYt(t,e,r){const n=[];let i=!1;const a=fz(Xg(ml(t.modes))),o=$re(a,l=>l[BO]===hh.NA),s=e4e(r);return e&&Sn(o,l=>{const u=JRe(l,s);if(u!==!1){const d={message:sYt(l,u),type:u.issue,tokenType:l};n.push(d)}else hn(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):Hre(s,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 - for details.`,type:is.NO_LINE_BREAKS_FLAGS}),n}$(rYt,"performWarningRuntimeChecks");function nYt(t){const e={},r=vf(t);return Sn(r,n=>{const i=t[n];if(Fi(i))e[n]=[];else throw Error("non exhaustive match")}),e}$(nYt,"cloneEmptyGroups");function ZRe(t){const e=t.PATTERN;if(ob(e))return!1;if(ab(e))return!0;if(hn(e,"exec"))return!0;if(od(e))return!1;throw Error("non exhaustive match")}$(ZRe,"isCustomPattern");function iYt(t){return od(t)&&t.length===1?t.charCodeAt(0):!1}$(iYt,"isShortPattern");var DWn={test:$(function(t){const e=t.length;for(let r=this.lastIndex;r{const i=t[n];if(Fi(i))e[n]=[];else throw Error("non exhaustive match")}),e}$(aYt,"cloneEmptyGroups");function ZRe(t){const e=t.PATTERN;if(ob(e))return!1;if(ab(e))return!0;if(hn(e,"exec"))return!0;if(od(e))return!1;throw Error("non exhaustive match")}$(ZRe,"isCustomPattern");function oYt(t){return od(t)&&t.length===1?t.charCodeAt(0):!1}$(oYt,"isShortPattern");var MWn={test:$(function(t){const e=t.length;for(let r=this.lastIndex;r Token Type Root cause: ${e.errMsg}. For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===is.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the option. The problem is in the <${t.name}> Token Type - For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}$(aYt,"buildLineBreakIssueMessage");function e4e(t){return Wr(t,r=>od(r)?r.charCodeAt(0):r)}$(e4e,"getCharCodes");function Yre(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}$(Yre,"addToMapOfArrays");var wz=256,qre=[];function lb(t){return t255?255+~~(t/255):t}}$(oYt,"initCharCodeToOptimizedIndexMap");function W3(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}$(W3,"tokenStructuredMatcher");function Az(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}$(Az,"tokenStructuredMatcherNoCategories");var sYt=1,lYt={};function Y3(t){const e=cYt(t);uYt(e),dYt(e),hYt(e),Sn(e,r=>{r.isParent=r.categoryMatches.length>0})}$(Y3,"augmentTokenTypes");function cYt(t){let e=_c(t),r=t,n=!0;for(;n;){r=fz(Xg(Wr(r,a=>a.CATEGORIES)));const i=Bre(r,e);e=e.concat(i),Ga(i)?n=!1:r=i}return e}$(cYt,"expandCategories");function uYt(t){Sn(t,e=>{r4e(e)||(lYt[sYt]=e,e.tokenTypeIdx=sYt++),n4e(e)&&!Fi(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),n4e(e)||(e.CATEGORIES=[]),fYt(e)||(e.categoryMatches=[]),pYt(e)||(e.categoryMatchesMap={})})}$(uYt,"assignTokenDefaultProps");function hYt(t){Sn(t,e=>{e.categoryMatches=[],Sn(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(lYt[n].tokenTypeIdx)})})}$(hYt,"assignCategoriesTokensProp");function dYt(t){Sn(t,e=>{t4e([],e)})}$(dYt,"assignCategoriesMapProp");function t4e(t,e){Sn(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),Sn(e.CATEGORIES,r=>{const n=t.concat(e);ch(n,r)||t4e(n,r)})}$(t4e,"singleAssignCategoriesToksMap");function r4e(t){return hn(t,"tokenTypeIdx")}$(r4e,"hasShortKeyProperty");function n4e(t){return hn(t,"CATEGORIES")}$(n4e,"hasCategoriesProperty");function fYt(t){return hn(t,"categoryMatches")}$(fYt,"hasExtendingTokensTypesProperty");function pYt(t){return hn(t,"categoryMatchesMap")}$(pYt,"hasExtendingTokensTypesMapProperty");function gYt(t){return hn(t,"tokenTypeIdx")}$(gYt,"isTokenType");var i4e={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,a){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}},is;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(is||(is={}));var Sz={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` + For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}$(sYt,"buildLineBreakIssueMessage");function e4e(t){return Wr(t,r=>od(r)?r.charCodeAt(0):r)}$(e4e,"getCharCodes");function Yre(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}$(Yre,"addToMapOfArrays");var wz=256,qre=[];function lb(t){return t255?255+~~(t/255):t}}$(lYt,"initCharCodeToOptimizedIndexMap");function W3(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}$(W3,"tokenStructuredMatcher");function Az(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}$(Az,"tokenStructuredMatcherNoCategories");var cYt=1,uYt={};function Y3(t){const e=hYt(t);dYt(e),pYt(e),fYt(e),Sn(e,r=>{r.isParent=r.categoryMatches.length>0})}$(Y3,"augmentTokenTypes");function hYt(t){let e=_c(t),r=t,n=!0;for(;n;){r=fz(Xg(Wr(r,a=>a.CATEGORIES)));const i=Bre(r,e);e=e.concat(i),Ga(i)?n=!1:r=i}return e}$(hYt,"expandCategories");function dYt(t){Sn(t,e=>{r4e(e)||(uYt[cYt]=e,e.tokenTypeIdx=cYt++),n4e(e)&&!Fi(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),n4e(e)||(e.CATEGORIES=[]),gYt(e)||(e.categoryMatches=[]),mYt(e)||(e.categoryMatchesMap={})})}$(dYt,"assignTokenDefaultProps");function fYt(t){Sn(t,e=>{e.categoryMatches=[],Sn(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(uYt[n].tokenTypeIdx)})})}$(fYt,"assignCategoriesTokensProp");function pYt(t){Sn(t,e=>{t4e([],e)})}$(pYt,"assignCategoriesMapProp");function t4e(t,e){Sn(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),Sn(e.CATEGORIES,r=>{const n=t.concat(e);ch(n,r)||t4e(n,r)})}$(t4e,"singleAssignCategoriesToksMap");function r4e(t){return hn(t,"tokenTypeIdx")}$(r4e,"hasShortKeyProperty");function n4e(t){return hn(t,"CATEGORIES")}$(n4e,"hasCategoriesProperty");function gYt(t){return hn(t,"categoryMatches")}$(gYt,"hasExtendingTokensTypesProperty");function mYt(t){return hn(t,"categoryMatchesMap")}$(mYt,"hasExtendingTokensTypesMapProperty");function vYt(t){return hn(t,"tokenTypeIdx")}$(vYt,"isTokenType");var i4e={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i,a){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}},is;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(is||(is={}));var Sz={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[` `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:i4e,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Sz);var hh=(EL=class{constructor(e,r=Sz){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const o=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${i}>`);const{time:s,value:l}=YRe(a),u=s>10?console.warn:console.log;return this.traceInitIndent time: ${s}ms`),this.traceInitIndent--,l}else return a()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object. -a boolean 2nd argument is no longer supported`);this.config=yf({},Sz,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===Sz.lineTerminatorsPattern)this.config.lineTerminatorsPattern=DWn;else if(this.config.lineTerminatorCharacters===Sz.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),Fi(e)?i={modes:{defaultMode:_c(e)},defaultMode:xz}:(a=!1,i=_c(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(tYt(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(rYt(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},Sn(i.modes,(s,l)=>{i.modes[l]=$re(s,u=>sb(u))});const o=vf(i.modes);if(Sn(i.modes,(s,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(zWt(s,o))}),Ga(this.lexerDefinitionErrors)){Y3(s);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=FWt(s,{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=yf({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Ga(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=Wr(this.lexerDefinitionErrors,u=>u.message).join(`----------------------- +a boolean 2nd argument is no longer supported`);this.config=yf({},Sz,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===Sz.lineTerminatorsPattern)this.config.lineTerminatorsPattern=MWn;else if(this.config.lineTerminatorCharacters===Sz.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),Fi(e)?i={modes:{defaultMode:_c(e)},defaultMode:xz}:(a=!1,i=_c(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(nYt(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(iYt(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},Sn(i.modes,(s,l)=>{i.modes[l]=$re(s,u=>sb(u))});const o=vf(i.modes);if(Sn(i.modes,(s,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(VWt(s,o))}),Ga(this.lexerDefinitionErrors)){Y3(s);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=UWt(s,{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=yf({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Ga(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=Wr(this.lexerDefinitionErrors,u=>u.message).join(`----------------------- `);throw new Error(`Errors detected in definition of Lexer: `+l)}Sn(this.lexerDefinitionWarning,s=>{WRe(s.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(a&&(this.handleModes=ql),this.trackStartLines===!1&&(this.computeNewColumn=tz),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=ql),/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 s=bf(this.canModeBeOptimized,(l,u,h)=>(u===!1&&l.push(h),l),[]);if(r.ensureOptimizations&&!Ga(s))throw Error(`Lexer Modes: < ${s.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",()=>{PWt()}),this.TRACE_INIT("toFastProperties",()=>{qRe(this)})})}tokenize(e,r=this.defaultMode){if(!Ga(this.lexerDefinitionErrors)){const i=Wr(this.lexerDefinitionErrors,a=>a.message).join(`----------------------- + Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{BWt()}),this.TRACE_INIT("toFastProperties",()=>{qRe(this)})})}tokenize(e,r=this.defaultMode){if(!Ga(this.lexerDefinitionErrors)){const i=Wr(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,o,s,l,u,h,d,f,p,g,m,v,y;const b=e,x=b.length;let w=0,A=0;const S=this.hasCustom?0:Math.floor(e.length/10),T=new Array(S),C=[];let k=this.trackStartLines?1:void 0,E=this.trackStartLines?1:void 0;const _=nYt(this.emptyGroups),P=this.trackStartLines,L=this.config.lineTerminatorsPattern;let R=0,D=[],M=[];const I=[],N=[];Object.freeze(N);let F=!1;const B=$(Q=>{if(I.length===1&&Q.tokenType.PUSH_MODE===void 0){const G=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Q);C.push({offset:Q.startOffset,line:Q.startLine,column:Q.startColumn,length:Q.image.length,message:G})}else{I.pop();const G=NO(I);D=this.patternIdxToConfig[G],M=this.charCodeToPatternIdxToConfig[G],R=D.length;const q=this.canModeBeOptimized[G]&&this.config.safeMode===!1;M&&q?F=!0:F=!1}},"pop_mode");function V(Q){I.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=o,d=o.length,u=h,z=J;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)),P===!0&&z.canLineTerminator===!0){let Y=0,ne,X;L.lastIndex=0;do l=l!==null?l:e.substring(w,w+d),ne=L.test(l),ne===!0&&(X=L.lastIndex-1,Y++);while(ne===!0);Y!==0?(k=k+Y,E=d-X,this.updateTokenEndLineColumnLocation(g,f,X,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,ne=k,X=E;let J=U===!1;for(;J===!1&&w ${$O(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: ",s=` +`+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,a,o,s,l,u,h,d,f,p,g,m,v,y;const b=e,x=b.length;let w=0,A=0;const S=this.hasCustom?0:Math.floor(e.length/10),T=new Array(S),C=[];let k=this.trackStartLines?1:void 0,E=this.trackStartLines?1:void 0;const _=aYt(this.emptyGroups),P=this.trackStartLines,L=this.config.lineTerminatorsPattern;let R=0,D=[],M=[];const I=[],N=[];Object.freeze(N);let F=!1;const B=$(Q=>{if(I.length===1&&Q.tokenType.PUSH_MODE===void 0){const G=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Q);C.push({offset:Q.startOffset,line:Q.startLine,column:Q.startColumn,length:Q.image.length,message:G})}else{I.pop();const G=NO(I);D=this.patternIdxToConfig[G],M=this.charCodeToPatternIdxToConfig[G],R=D.length;const q=this.canModeBeOptimized[G]&&this.config.safeMode===!1;M&&q?F=!0:F=!1}},"pop_mode");function V(Q){I.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=o,d=o.length,u=h,z=J;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)),P===!0&&z.canLineTerminator===!0){let Y=0,ne,X;L.lastIndex=0;do l=l!==null?l:e.substring(w,w+d),ne=L.test(l),ne===!0&&(X=L.lastIndex-1,Y++);while(ne===!0);Y!==0?(k=k+Y,E=d-X,this.updateTokenEndLineColumnLocation(g,f,X,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,ne=k,X=E;let J=U===!1;for(;J===!1&&w ${$O(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: ",s=` but found: '`+Zg(e).image+"'";if(n)return a+n+s;{const l=bf(t,(f,p)=>f.concat(p),[]),u=Wr(l,f=>`[${Wr(f,p=>$O(p)).join(", ")}]`),d=`one of these possible Token sequences: ${Wr(u,(f,p)=>` ${p+1}. ${f}`).join(` `)}`;return a+d+s}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){const i="Expecting: ",o=` but found: '`+Zg(e).image+"'";if(r)return i+r+o;{const l=`expecting at least one iteration which starts with one of these possible Token sequences:: - <${Wr(t,u=>`[${Wr(u,h=>$O(h)).join(",")}]`).join(" ,")}>`;return i+l+o}}};Object.freeze(j3);var MWn={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- + <${Wr(t,u=>`[${Wr(u,h=>$O(h)).join(",")}]`).join(" ,")}>`;return i+l+o}}};Object.freeze(j3);var PWn={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- inside top level rule: ->`+t.name+"<-"}},FO={buildDuplicateFoundError(t,e){function r(h){return h instanceof go?h.terminalType.name:h instanceof uh?h.nonTerminalName:""}$(r,"getExtraProductionArgument");const n=t.name,i=Zg(e),a=i.idx,o=em(i),s=r(i),l=a>0;let u=`->${o}${l?a:""}<- ${s?`with argument: ->${s}<-`:""} 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 @@ -1709,44 +1709,44 @@ rule: <${e}> can be invoked from itself (directly or indirectly) 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 Q3?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function CYt(t,e){const r=new IWn(t,e);return r.resolveRefs(),r.errors}$(CYt,"resolveGrammar");var IWn=(_L=class extends G3{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){Sn(ml(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:dh.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},$(_L,"GastRefResolverVisitor"),_L),PWn=(RL=class extends zre{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=_c(this.path.ruleStack).reverse(),this.occurrenceStack=_c(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(){Ga(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},$(RL,"AbstractNextPossibleTokensWalker"),RL),NWn=(DL=class extends PWn{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 sd({definition:i});this.possibleTokTypes=H3(a),this.found=!0}}},$(DL,"NextAfterTokenWalker"),DL),jre=(LL=class extends zre{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}},$(LL,"AbstractNextTerminalAfterProductionWalker"),LL),BWn=(ML=class extends jre{walkMany(e,r,n){if(e.idx===this.occurrence){const i=Zg(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof go&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},$(ML,"NextTerminalAfterManyWalker"),ML),OYt=(IL=class extends jre{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=Zg(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof go&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},$(IL,"NextTerminalAfterManySepWalker"),IL),$Wn=(PL=class extends jre{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=Zg(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof go&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},$(PL,"NextTerminalAfterAtLeastOneWalker"),PL),kYt=(NL=class extends jre{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=Zg(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof go&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}},$(NL,"NextTerminalAfterAtLeastOneSepWalker"),NL);function Xre(t,e,r=[]){r=_c(r);let n=[],i=0;function a(s){return s.concat(Rc(t,i+1))}$(a,"remainingPathWith");function o(s){const l=Xre(a(s),e,r);return n.concat(l)}for($(o,"getAlternativesForProd");r.length{Ga(l.definition)===!1&&(n=o(l.definition))}),n;if(s instanceof go)r.push(s.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:Rc(t,i)}),n}$(Xre,"possiblePathsFrom");function s4e(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],o="EXIT_ALTERNATIVE";let s=!1;const l=e.length,u=l-n-1,h=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Ga(d);){const f=d.pop();if(f===o){s&&NO(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,v=f.occurrenceStack;if(Ga(p))continue;const y=p[0];if(y===i){const b={idx:g,def:Rc(p),ruleStack:gz(m),occurrenceStack:gz(v)};d.push(b)}else if(y instanceof go)if(g=0;b--){const x=y.definition[b],w={idx:g,def:x.definition.concat(Rc(p)),ruleStack:m,occurrenceStack:v};d.push(w),d.push(o)}else if(y instanceof sd)d.push({idx:g,def:y.definition.concat(Rc(p)),ruleStack:m,occurrenceStack:v});else if(y instanceof Q3)d.push(EYt(y,g,m,v));else throw Error("non exhaustive match")}return h}$(s4e,"nextPossibleTokensAfter");function EYt(t,e,r,n){const i=_c(r);i.push(t.name);const a=_c(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}$(EYt,"expandTopLevelRule");var No;(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"})(No||(No={}));function Kre(t){if(t instanceof Dc||t==="Option")return No.OPTION;if(t instanceof ns||t==="Repetition")return No.REPETITION;if(t instanceof xf||t==="RepetitionMandatory")return No.REPETITION_MANDATORY;if(t instanceof wf||t==="RepetitionMandatoryWithSeparator")return No.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof ld||t==="RepetitionWithSeparator")return No.REPETITION_WITH_SEPARATOR;if(t instanceof cd||t==="Alternation")return No.ALTERNATION;throw Error("non exhaustive match")}$(Kre,"getProdType");function l4e(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=Kre(n);return a===No.ALTERNATION?Cz(e,r,i):Oz(e,r,a,i)}$(l4e,"getLookaheadPaths");function _Yt(t,e,r,n,i,a){const o=Cz(t,e,r),s=h4e(o)?Az:W3;return a(o,n,s,i)}$(_Yt,"buildLookaheadFuncForOr");function RYt(t,e,r,n,i,a){const o=Oz(t,e,i,r),s=h4e(o)?Az:W3;return a(o[0],s,n)}$(RYt,"buildLookaheadFuncForOptionalProd");function DYt(t,e,r,n){const i=t.length,a=Kg(t,o=>Kg(o,s=>s.length===1));if(e)return function(o){const s=Wr(o,l=>l.GATE);for(let l=0;lXg(l)),s=bf(o,(l,u,h)=>(Sn(u,d=>{hn(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),Sn(d.categoryMatches,f=>{hn(l,f)||(l[f]=h)})}),l),{});return function(){const l=this.LA(1);return s[l.tokenTypeIdx]}}else return function(){for(let o=0;oa.length===1),i=t.length;if(n&&!r){const a=Xg(t);if(a.length===1&&Ga(a[0].categoryMatches)){const s=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===s}}else{const o=bf(a,(s,l,u)=>(s[l.tokenTypeIdx]=!0,Sn(l.categoryMatches,h=>{s[h]=!0}),s),[]);return function(){const s=this.LA(1);return o[s.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;aXre([o],1)),n=c4e(r.length),i=Wr(r,o=>{const s={};return Sn(o,l=>{const u=Zre(l.partialPath);Sn(u,h=>{s[h]=!0})}),s});let a=r;for(let o=1;o<=e;o++){const s=a;a=c4e(s.length);for(let l=0;l{const y=Zre(v.partialPath);Sn(y,b=>{i[l][b]=!0})})}}}}return n}$(u4e,"lookAheadSequenceFromAlternatives");function Cz(t,e,r,n){const i=new MYt(t,No.ALTERNATION,n);return e.accept(i),u4e(i.result,r)}$(Cz,"getLookaheadPathsForOr");function Oz(t,e,r,n){const i=new MYt(t,r);e.accept(i);const a=i.result,s=new FWn(e,t,r).startWalking(),l=new sd({definition:a}),u=new sd({definition:s});return u4e([l,u],n)}$(Oz,"getLookaheadPathsForOptionalProd");function Jre(t,e){e:for(let r=0;r{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}$(PYt,"isStrictPrefixOfPath");function h4e(t){return Kg(t,e=>Kg(e,r=>Kg(r,n=>Ga(n.categoryMatches))))}$(h4e,"areTokenCategoriesNotUsed");function NYt(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return Wr(e,r=>Object.assign({type:dh.CUSTOM_LOOKAHEAD_VALIDATION},r))}$(NYt,"validateLookahead");function BYt(t,e,r,n){const i=Up(t,l=>$Yt(l,r)),a=qYt(t,e,r),o=Up(t,l=>GYt(l,r)),s=Up(t,l=>zYt(l,t,n,r));return i.concat(a,o,s)}$(BYt,"validateGrammar");function $Yt(t,e){const r=new zWn;t.accept(r);const n=r.allProductions,i=eWn(n,FYt),a=Jg(i,s=>s.length>1);return Wr(ml(a),s=>{const l=Zg(s),u=e.buildDuplicateFoundError(t,s),h=em(l),d={message:u,type:dh.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=d4e(l);return f&&(d.parameter=f),d})}$($Yt,"validateDuplicateProductions");function FYt(t){return`${em(t)}_#_${t.idx}_#_${d4e(t)}`}$(FYt,"identifyProductionForDuplicates");function d4e(t){return t instanceof go?t.terminalType.name:t instanceof uh?t.nonTerminalName:""}$(d4e,"getExtraProductionArgument");var zWn=(FL=class extends G3{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)}},$(FL,"OccurrenceValidationCollector"),FL);function zYt(t,e,r,n){const i=[];if(bf(e,(o,s)=>s.name===t.name?o+1:o,0)>1){const o=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:o,type:dh.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}$(zYt,"validateRuleDoesNotAlreadyExist");function UYt(t,e,r){const n=[];let i;return ch(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:dh.INVALID_RULE_OVERRIDE,ruleName:t})),n}$(UYt,"validateRuleIsOverridden");function f4e(t,e,r,n=[]){const i=[],a=kz(e.definition);if(Ga(a))return[];{const o=t.name;ch(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:dh.LEFT_RECURSION,ruleName:o});const l=Bre(a,n.concat([t])),u=Up(l,h=>{const d=_c(n);return d.push(h),f4e(t,h,r,d)});return i.concat(u)}}$(f4e,"validateNoLeftRecursion");function kz(t){let e=[];if(Ga(t))return e;const r=Zg(t);if(r instanceof uh)e.push(r.referencedRule);else if(r instanceof sd||r instanceof Dc||r instanceof xf||r instanceof wf||r instanceof ld||r instanceof ns)e=e.concat(kz(r.definition));else if(r instanceof cd)e=Xg(Wr(r.definition,a=>kz(a.definition)));else if(!(r instanceof go))throw Error("non exhaustive match");const n=vz(r),i=t.length>1;if(n&&i){const a=Rc(t);return e.concat(kz(a))}else return e}$(kz,"getFirstNoneTerminal");var p4e=(zL=class extends G3{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},$(zL,"OrCollector"),zL);function VYt(t,e){const r=new p4e;t.accept(r);const n=r.alternations;return Up(n,a=>{const o=gz(a.definition);return Up(o,(s,l)=>{const u=s4e([s],[],W3,1);return Ga(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:dh.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]})})}$(VYt,"validateEmptyOrAlternative");function QYt(t,e,r){const n=new p4e;t.accept(n);let i=n.alternations;return i=$re(i,o=>o.ignoreAmbiguities===!0),Up(i,o=>{const s=o.idx,l=o.maxLookahead||e,u=Cz(s,t,l,o),h=WYt(u,o,t,r),d=YYt(u,o,t,r);return h.concat(d)})}$(QYt,"validateAmbiguousAlternationAlternatives");var UWn=(UL=class extends G3{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)}},$(UL,"RepetitionCollector"),UL);function GYt(t,e){const r=new p4e;t.accept(r);const n=r.alternations;return Up(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:dh.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}$(GYt,"validateTooManyAlts");function HYt(t,e,r){const n=[];return Sn(t,i=>{const a=new UWn;i.accept(a);const o=a.allProductions;Sn(o,s=>{const l=Kre(s),u=s.maxLookahead||e,h=s.idx,f=Oz(h,i,l,u)[0];if(Ga(Xg(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:s});n.push({message:p,type:dh.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}$(HYt,"validateSomeNonEmptyLookaheadPath");function WYt(t,e,r,n){const i=[],a=bf(t,(s,l,u)=>(e.definition[u].ignoreAmbiguities===!0||Sn(l,h=>{const d=[u];Sn(t,(f,p)=>{u!==p&&Jre(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!Jre(i,h)&&(i.push(h),s.push({alts:d,path:h}))}),s),[]);return Wr(a,s=>{const l=Wr(s.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:s.path}),type:dh.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:s.alts}})}$(WYt,"checkAlternativesAmbiguities");function YYt(t,e,r,n){const i=bf(t,(o,s,l)=>{const u=Wr(s,h=>({idx:l,path:h}));return o.concat(u)},[]);return fz(Up(i,o=>{if(e.definition[o.idx].ignoreAmbiguities===!0)return[];const l=o.idx,u=o.path,h=zp(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:dh.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}$(YYt,"checkPrefixAlternativesAmbiguities");function qYt(t,e,r){const n=[],i=Wr(e,a=>a.name);return Sn(t,a=>{const o=a.name;if(ch(i,o)){const s=r.buildNamespaceConflictError(a);n.push({message:s,type:dh.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:o})}}),n}$(qYt,"checkTerminalAndNoneTerminalsNameSpace");function jYt(t){const e=GRe(t,{errMsgProvider:MWn}),r={};return Sn(t.rules,n=>{r[n.name]=n}),CYt(r,e.errMsgProvider)}$(jYt,"resolveGrammar");function XYt(t){return t=GRe(t,{errMsgProvider:FO}),BYt(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}$(XYt,"validateGrammar");var KYt="MismatchedTokenException",ZYt="NoViableAltException",JYt="EarlyExitException",eqt="NotAllInputParsedException",tqt=[KYt,ZYt,JYt,eqt];Object.freeze(tqt);function Ez(t){return ch(tqt,t.name)}$(Ez,"isRecognitionException");var ene=(VL=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)}},$(VL,"RecognitionException"),VL),rqt=(QL=class extends ene{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=KYt}},$(QL,"MismatchedTokenException"),QL),VWn=(GL=class extends ene{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=ZYt}},$(GL,"NoViableAltException"),GL),QWn=(HL=class extends ene{constructor(e,r){super(e,r),this.name=eqt}},$(HL,"NotAllInputParsedException"),HL),GWn=(WL=class extends ene{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=JYt}},$(WL,"EarlyExitException"),WL),g4e={},nqt="InRuleRecoveryException",HWn=(YL=class extends Error{constructor(e){super(e),this.name=nqt}},$(YL,"InRuleRecoveryException"),YL),WWn=(qL=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=hn(e,"recoveryEnabled")?e.recoveryEnabled:cb.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=iqt)}getTokenToInsert(e){const r=Tz(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(),o=this.exportLexerState(),s=[];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 rqt(p,u,this.LA(0));g.resyncedTokens=gz(s),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,s));this.importLexerState(o)}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 HWn("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Ga(r))return!1;const n=this.LA(1);return V3(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 ch(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=V3(e,a=>o4e(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return g4e;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 Wr(e,(n,i)=>i===0?g4e:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=Wr(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Xg(e)}getFollowSetFromFollowKey(e){if(e===g4e)return[Rw];const r=e.ruleName+e.idxInCallingRule+LWt+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,Rw)||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 gz(r)}attemptInRepetitionRecovery(e,r,n,i,a,o,s){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=_c(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return Wr(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},$(qL,"Recoverable"),qL);function iqt(t,e,r,n,i,a,o){const s=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[s];if(l===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];l=new a(p,i).startWalking(),this.firstAfterRepMap[s]=l}let u=l.token,h=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=Rw,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,o)&&this.tryInRepetitionRecovery(t,e,r,u)}$(iqt,"attemptInRepetitionRecovery");var YWn=4,Dw=8,aqt=1<f4e(r,r,FO))}validateEmptyOrAlternatives(e){return Up(e,r=>VYt(r,FO))}validateAmbiguousAlternationAlternatives(e,r){return Up(e,n=>QYt(n,r,FO))}validateSomeNonEmptyLookaheadPath(e,r){return HYt(e,r,FO)}buildLookaheadForAlternation(e){return _Yt(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,DYt)}buildLookaheadForOptional(e){return RYt(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Kre(e.prodType),LYt)}},$(jL,"LLkLookaheadStrategy"),jL),qWn=(XL=class{initLooksAhead(e){this.dynamicTokensEnabled=hn(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:cb.dynamicTokensEnabled,this.maxLookahead=hn(e,"maxLookahead")?e.maxLookahead:cb.maxLookahead,this.lookaheadStrategy=hn(e,"lookaheadStrategy")?e.lookaheadStrategy:new b4e({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){Sn(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:o,repetitionMandatoryWithSeparator:s,repetitionWithSeparator:l}=sqt(r);Sn(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${em(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=rne(this.fullRuleNameToShort[r.name],aqt,u.idx);this.setLaFuncCache(f,d)})}),Sn(i,u=>{this.computeLookaheadFunc(r,u.idx,m4e,"Repetition",u.maxLookahead,em(u))}),Sn(a,u=>{this.computeLookaheadFunc(r,u.idx,oqt,"Option",u.maxLookahead,em(u))}),Sn(o,u=>{this.computeLookaheadFunc(r,u.idx,v4e,"RepetitionMandatory",u.maxLookahead,em(u))}),Sn(s,u=>{this.computeLookaheadFunc(r,u.idx,tne,"RepetitionMandatoryWithSeparator",u.maxLookahead,em(u))}),Sn(l,u=>{this.computeLookaheadFunc(r,u.idx,y4e,"RepetitionWithSeparator",u.maxLookahead,em(u))})})})}computeLookaheadFunc(e,r,n,i,a,o){this.TRACE_INIT(`${o}${r===0?"":r}`,()=>{const s=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=rne(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,s)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return rne(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},$(XL,"LooksAhead"),XL),jWn=(KL=class extends G3{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)}},$(KL,"DslMethodsCollectorVisitor"),KL),nne=new jWn;function sqt(t){nne.reset(),t.accept(nne);const e=nne.dslMethods;return nne.reset(),e}$(sqt,"collectMethods");function x4e(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffseto.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 Q3?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function kYt(t,e){const r=new NWn(t,e);return r.resolveRefs(),r.errors}$(kYt,"resolveGrammar");var NWn=(_L=class extends G3{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){Sn(ml(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:dh.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},$(_L,"GastRefResolverVisitor"),_L),BWn=(RL=class extends zre{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=_c(this.path.ruleStack).reverse(),this.occurrenceStack=_c(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(){Ga(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},$(RL,"AbstractNextPossibleTokensWalker"),RL),$Wn=(DL=class extends BWn{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 sd({definition:i});this.possibleTokTypes=H3(a),this.found=!0}}},$(DL,"NextAfterTokenWalker"),DL),jre=(LL=class extends zre{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}},$(LL,"AbstractNextTerminalAfterProductionWalker"),LL),FWn=(ML=class extends jre{walkMany(e,r,n){if(e.idx===this.occurrence){const i=Zg(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof go&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},$(ML,"NextTerminalAfterManyWalker"),ML),EYt=(IL=class extends jre{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=Zg(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof go&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},$(IL,"NextTerminalAfterManySepWalker"),IL),zWn=(PL=class extends jre{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=Zg(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof go&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},$(PL,"NextTerminalAfterAtLeastOneWalker"),PL),_Yt=(NL=class extends jre{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=Zg(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof go&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}},$(NL,"NextTerminalAfterAtLeastOneSepWalker"),NL);function Xre(t,e,r=[]){r=_c(r);let n=[],i=0;function a(s){return s.concat(Rc(t,i+1))}$(a,"remainingPathWith");function o(s){const l=Xre(a(s),e,r);return n.concat(l)}for($(o,"getAlternativesForProd");r.length{Ga(l.definition)===!1&&(n=o(l.definition))}),n;if(s instanceof go)r.push(s.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:Rc(t,i)}),n}$(Xre,"possiblePathsFrom");function s4e(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],o="EXIT_ALTERNATIVE";let s=!1;const l=e.length,u=l-n-1,h=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Ga(d);){const f=d.pop();if(f===o){s&&NO(d).idx<=u&&d.pop();continue}const p=f.def,g=f.idx,m=f.ruleStack,v=f.occurrenceStack;if(Ga(p))continue;const y=p[0];if(y===i){const b={idx:g,def:Rc(p),ruleStack:gz(m),occurrenceStack:gz(v)};d.push(b)}else if(y instanceof go)if(g=0;b--){const x=y.definition[b],w={idx:g,def:x.definition.concat(Rc(p)),ruleStack:m,occurrenceStack:v};d.push(w),d.push(o)}else if(y instanceof sd)d.push({idx:g,def:y.definition.concat(Rc(p)),ruleStack:m,occurrenceStack:v});else if(y instanceof Q3)d.push(RYt(y,g,m,v));else throw Error("non exhaustive match")}return h}$(s4e,"nextPossibleTokensAfter");function RYt(t,e,r,n){const i=_c(r);i.push(t.name);const a=_c(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}$(RYt,"expandTopLevelRule");var No;(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"})(No||(No={}));function Kre(t){if(t instanceof Dc||t==="Option")return No.OPTION;if(t instanceof ns||t==="Repetition")return No.REPETITION;if(t instanceof xf||t==="RepetitionMandatory")return No.REPETITION_MANDATORY;if(t instanceof wf||t==="RepetitionMandatoryWithSeparator")return No.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof ld||t==="RepetitionWithSeparator")return No.REPETITION_WITH_SEPARATOR;if(t instanceof cd||t==="Alternation")return No.ALTERNATION;throw Error("non exhaustive match")}$(Kre,"getProdType");function l4e(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=Kre(n);return a===No.ALTERNATION?Cz(e,r,i):Oz(e,r,a,i)}$(l4e,"getLookaheadPaths");function DYt(t,e,r,n,i,a){const o=Cz(t,e,r),s=h4e(o)?Az:W3;return a(o,n,s,i)}$(DYt,"buildLookaheadFuncForOr");function LYt(t,e,r,n,i,a){const o=Oz(t,e,i,r),s=h4e(o)?Az:W3;return a(o[0],s,n)}$(LYt,"buildLookaheadFuncForOptionalProd");function MYt(t,e,r,n){const i=t.length,a=Kg(t,o=>Kg(o,s=>s.length===1));if(e)return function(o){const s=Wr(o,l=>l.GATE);for(let l=0;lXg(l)),s=bf(o,(l,u,h)=>(Sn(u,d=>{hn(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=h),Sn(d.categoryMatches,f=>{hn(l,f)||(l[f]=h)})}),l),{});return function(){const l=this.LA(1);return s[l.tokenTypeIdx]}}else return function(){for(let o=0;oa.length===1),i=t.length;if(n&&!r){const a=Xg(t);if(a.length===1&&Ga(a[0].categoryMatches)){const s=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===s}}else{const o=bf(a,(s,l,u)=>(s[l.tokenTypeIdx]=!0,Sn(l.categoryMatches,h=>{s[h]=!0}),s),[]);return function(){const s=this.LA(1);return o[s.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;aXre([o],1)),n=c4e(r.length),i=Wr(r,o=>{const s={};return Sn(o,l=>{const u=Zre(l.partialPath);Sn(u,h=>{s[h]=!0})}),s});let a=r;for(let o=1;o<=e;o++){const s=a;a=c4e(s.length);for(let l=0;l{const y=Zre(v.partialPath);Sn(y,b=>{i[l][b]=!0})})}}}}return n}$(u4e,"lookAheadSequenceFromAlternatives");function Cz(t,e,r,n){const i=new PYt(t,No.ALTERNATION,n);return e.accept(i),u4e(i.result,r)}$(Cz,"getLookaheadPathsForOr");function Oz(t,e,r,n){const i=new PYt(t,r);e.accept(i);const a=i.result,s=new UWn(e,t,r).startWalking(),l=new sd({definition:a}),u=new sd({definition:s});return u4e([l,u],n)}$(Oz,"getLookaheadPathsForOptionalProd");function Jre(t,e){e:for(let r=0;r{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}$(BYt,"isStrictPrefixOfPath");function h4e(t){return Kg(t,e=>Kg(e,r=>Kg(r,n=>Ga(n.categoryMatches))))}$(h4e,"areTokenCategoriesNotUsed");function $Yt(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return Wr(e,r=>Object.assign({type:dh.CUSTOM_LOOKAHEAD_VALIDATION},r))}$($Yt,"validateLookahead");function FYt(t,e,r,n){const i=Up(t,l=>zYt(l,r)),a=XYt(t,e,r),o=Up(t,l=>WYt(l,r)),s=Up(t,l=>VYt(l,t,n,r));return i.concat(a,o,s)}$(FYt,"validateGrammar");function zYt(t,e){const r=new VWn;t.accept(r);const n=r.allProductions,i=rWn(n,UYt),a=Jg(i,s=>s.length>1);return Wr(ml(a),s=>{const l=Zg(s),u=e.buildDuplicateFoundError(t,s),h=em(l),d={message:u,type:dh.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:l.idx},f=d4e(l);return f&&(d.parameter=f),d})}$(zYt,"validateDuplicateProductions");function UYt(t){return`${em(t)}_#_${t.idx}_#_${d4e(t)}`}$(UYt,"identifyProductionForDuplicates");function d4e(t){return t instanceof go?t.terminalType.name:t instanceof uh?t.nonTerminalName:""}$(d4e,"getExtraProductionArgument");var VWn=(FL=class extends G3{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)}},$(FL,"OccurrenceValidationCollector"),FL);function VYt(t,e,r,n){const i=[];if(bf(e,(o,s)=>s.name===t.name?o+1:o,0)>1){const o=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:o,type:dh.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}$(VYt,"validateRuleDoesNotAlreadyExist");function QYt(t,e,r){const n=[];let i;return ch(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:dh.INVALID_RULE_OVERRIDE,ruleName:t})),n}$(QYt,"validateRuleIsOverridden");function f4e(t,e,r,n=[]){const i=[],a=kz(e.definition);if(Ga(a))return[];{const o=t.name;ch(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:dh.LEFT_RECURSION,ruleName:o});const l=Bre(a,n.concat([t])),u=Up(l,h=>{const d=_c(n);return d.push(h),f4e(t,h,r,d)});return i.concat(u)}}$(f4e,"validateNoLeftRecursion");function kz(t){let e=[];if(Ga(t))return e;const r=Zg(t);if(r instanceof uh)e.push(r.referencedRule);else if(r instanceof sd||r instanceof Dc||r instanceof xf||r instanceof wf||r instanceof ld||r instanceof ns)e=e.concat(kz(r.definition));else if(r instanceof cd)e=Xg(Wr(r.definition,a=>kz(a.definition)));else if(!(r instanceof go))throw Error("non exhaustive match");const n=vz(r),i=t.length>1;if(n&&i){const a=Rc(t);return e.concat(kz(a))}else return e}$(kz,"getFirstNoneTerminal");var p4e=(zL=class extends G3{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}},$(zL,"OrCollector"),zL);function GYt(t,e){const r=new p4e;t.accept(r);const n=r.alternations;return Up(n,a=>{const o=gz(a.definition);return Up(o,(s,l)=>{const u=s4e([s],[],W3,1);return Ga(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:a,emptyChoiceIdx:l}),type:dh.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:a.idx,alternative:l+1}]:[]})})}$(GYt,"validateEmptyOrAlternative");function HYt(t,e,r){const n=new p4e;t.accept(n);let i=n.alternations;return i=$re(i,o=>o.ignoreAmbiguities===!0),Up(i,o=>{const s=o.idx,l=o.maxLookahead||e,u=Cz(s,t,l,o),h=qYt(u,o,t,r),d=jYt(u,o,t,r);return h.concat(d)})}$(HYt,"validateAmbiguousAlternationAlternatives");var QWn=(UL=class extends G3{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)}},$(UL,"RepetitionCollector"),UL);function WYt(t,e){const r=new p4e;t.accept(r);const n=r.alternations;return Up(n,a=>a.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:a}),type:dh.TOO_MANY_ALTS,ruleName:t.name,occurrence:a.idx}]:[])}$(WYt,"validateTooManyAlts");function YYt(t,e,r){const n=[];return Sn(t,i=>{const a=new QWn;i.accept(a);const o=a.allProductions;Sn(o,s=>{const l=Kre(s),u=s.maxLookahead||e,h=s.idx,f=Oz(h,i,l,u)[0];if(Ga(Xg(f))){const p=r.buildEmptyRepetitionError({topLevelRule:i,repetition:s});n.push({message:p,type:dh.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}$(YYt,"validateSomeNonEmptyLookaheadPath");function qYt(t,e,r,n){const i=[],a=bf(t,(s,l,u)=>(e.definition[u].ignoreAmbiguities===!0||Sn(l,h=>{const d=[u];Sn(t,(f,p)=>{u!==p&&Jre(f,h)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!Jre(i,h)&&(i.push(h),s.push({alts:d,path:h}))}),s),[]);return Wr(a,s=>{const l=Wr(s.alts,h=>h+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:l,prefixPath:s.path}),type:dh.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:s.alts}})}$(qYt,"checkAlternativesAmbiguities");function jYt(t,e,r,n){const i=bf(t,(o,s,l)=>{const u=Wr(s,h=>({idx:l,path:h}));return o.concat(u)},[]);return fz(Up(i,o=>{if(e.definition[o.idx].ignoreAmbiguities===!0)return[];const l=o.idx,u=o.path,h=zp(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:dh.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:g,alternatives:p}})}))}$(jYt,"checkPrefixAlternativesAmbiguities");function XYt(t,e,r){const n=[],i=Wr(e,a=>a.name);return Sn(t,a=>{const o=a.name;if(ch(i,o)){const s=r.buildNamespaceConflictError(a);n.push({message:s,type:dh.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:o})}}),n}$(XYt,"checkTerminalAndNoneTerminalsNameSpace");function KYt(t){const e=GRe(t,{errMsgProvider:PWn}),r={};return Sn(t.rules,n=>{r[n.name]=n}),kYt(r,e.errMsgProvider)}$(KYt,"resolveGrammar");function ZYt(t){return t=GRe(t,{errMsgProvider:FO}),FYt(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}$(ZYt,"validateGrammar");var JYt="MismatchedTokenException",eqt="NoViableAltException",tqt="EarlyExitException",rqt="NotAllInputParsedException",nqt=[JYt,eqt,tqt,rqt];Object.freeze(nqt);function Ez(t){return ch(nqt,t.name)}$(Ez,"isRecognitionException");var ene=(VL=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)}},$(VL,"RecognitionException"),VL),iqt=(QL=class extends ene{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=JYt}},$(QL,"MismatchedTokenException"),QL),GWn=(GL=class extends ene{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=eqt}},$(GL,"NoViableAltException"),GL),HWn=(HL=class extends ene{constructor(e,r){super(e,r),this.name=rqt}},$(HL,"NotAllInputParsedException"),HL),WWn=(WL=class extends ene{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=tqt}},$(WL,"EarlyExitException"),WL),g4e={},aqt="InRuleRecoveryException",YWn=(YL=class extends Error{constructor(e){super(e),this.name=aqt}},$(YL,"InRuleRecoveryException"),YL),qWn=(qL=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=hn(e,"recoveryEnabled")?e.recoveryEnabled:cb.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=oqt)}getTokenToInsert(e){const r=Tz(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(),o=this.exportLexerState(),s=[];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 iqt(p,u,this.LA(0));g.resyncedTokens=gz(s),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,s));this.importLexerState(o)}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 YWn("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Ga(r))return!1;const n=this.LA(1);return V3(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 ch(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=V3(e,a=>o4e(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return g4e;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 Wr(e,(n,i)=>i===0?g4e:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=Wr(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Xg(e)}getFollowSetFromFollowKey(e){if(e===g4e)return[Rw];const r=e.ruleName+e.idxInCallingRule+IWt+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,Rw)||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 gz(r)}attemptInRepetitionRecovery(e,r,n,i,a,o,s){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=_c(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return Wr(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}},$(qL,"Recoverable"),qL);function oqt(t,e,r,n,i,a,o){const s=this.getKeyForAutomaticLookahead(n,i);let l=this.firstAfterRepMap[s];if(l===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];l=new a(p,i).startWalking(),this.firstAfterRepMap[s]=l}let u=l.token,h=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=Rw,h=1),!(u===void 0||h===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,h,o)&&this.tryInRepetitionRecovery(t,e,r,u)}$(oqt,"attemptInRepetitionRecovery");var jWn=4,Dw=8,sqt=1<f4e(r,r,FO))}validateEmptyOrAlternatives(e){return Up(e,r=>GYt(r,FO))}validateAmbiguousAlternationAlternatives(e,r){return Up(e,n=>HYt(n,r,FO))}validateSomeNonEmptyLookaheadPath(e,r){return YYt(e,r,FO)}buildLookaheadForAlternation(e){return DYt(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,MYt)}buildLookaheadForOptional(e){return LYt(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Kre(e.prodType),IYt)}},$(jL,"LLkLookaheadStrategy"),jL),XWn=(XL=class{initLooksAhead(e){this.dynamicTokensEnabled=hn(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:cb.dynamicTokensEnabled,this.maxLookahead=hn(e,"maxLookahead")?e.maxLookahead:cb.maxLookahead,this.lookaheadStrategy=hn(e,"lookaheadStrategy")?e.lookaheadStrategy:new b4e({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){Sn(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:o,repetitionMandatoryWithSeparator:s,repetitionWithSeparator:l}=cqt(r);Sn(n,u=>{const h=u.idx===0?"":u.idx;this.TRACE_INIT(`${em(u)}${h}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:r,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=rne(this.fullRuleNameToShort[r.name],sqt,u.idx);this.setLaFuncCache(f,d)})}),Sn(i,u=>{this.computeLookaheadFunc(r,u.idx,m4e,"Repetition",u.maxLookahead,em(u))}),Sn(a,u=>{this.computeLookaheadFunc(r,u.idx,lqt,"Option",u.maxLookahead,em(u))}),Sn(o,u=>{this.computeLookaheadFunc(r,u.idx,v4e,"RepetitionMandatory",u.maxLookahead,em(u))}),Sn(s,u=>{this.computeLookaheadFunc(r,u.idx,tne,"RepetitionMandatoryWithSeparator",u.maxLookahead,em(u))}),Sn(l,u=>{this.computeLookaheadFunc(r,u.idx,y4e,"RepetitionWithSeparator",u.maxLookahead,em(u))})})})}computeLookaheadFunc(e,r,n,i,a,o){this.TRACE_INIT(`${o}${r===0?"":r}`,()=>{const s=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=rne(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(l,s)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return rne(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},$(XL,"LooksAhead"),XL),KWn=(KL=class extends G3{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)}},$(KL,"DslMethodsCollectorVisitor"),KL),nne=new KWn;function cqt(t){nne.reset(),t.accept(nne);const e=nne.dslMethods;return nne.reset(),e}$(cqt,"collectMethods");function x4e(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffseto.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}$(hqt,"createBaseSemanticVisitorConstructor");function dqt(t,e,r){const n=$(function(){},"derivedConstructor");A4e(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return Sn(e,a=>{i[a]=uqt}),n.prototype=i,n.prototype.constructor=n,n}$(dqt,"createBaseVisitorConstructorWithDefaults");var S4e;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(S4e||(S4e={}));function fqt(t,e){return pqt(t,e)}$(fqt,"validateVisitor");function pqt(t,e){const r=zp(e,i=>ab(t[i])===!1),n=Wr(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:S4e.MISSING_METHOD,methodName:i}));return fz(n)}$(pqt,"validateMissingCstMethods");var KWn=(ZL=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=hn(e,"nodeLocationTracking")?e.nodeLocationTracking:cb.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ql,this.cstFinallyStateUpdate=ql,this.cstPostTerminal=ql,this.cstPostNonTerminal=ql,this.cstPostRule=ql;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=w4e,this.setNodeLocationFromNode=w4e,this.cstPostRule=ql,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ql,this.setNodeLocationFromNode=ql,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=x4e,this.setNodeLocationFromNode=x4e,this.cstPostRule=ql,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ql,this.setNodeLocationFromNode=ql,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ql,this.setNodeLocationFromNode=ql,this.cstPostRule=ql,this.setInitialNodeLocation=ql;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];lqt(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];cqt(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(sb(this.baseCstVisitorConstructor)){const e=hqt(this.className,vf(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(sb(this.baseCstVisitorWithDefaultsConstructor)){const e=dqt(this.className,vf(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]}},$(ZL,"TreeBuilder"),ZL),ZWn=(JL=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)):ane}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?ane: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()}},$(JL,"LexerAdapter"),JL),JWn=(eM=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=one){if(ch(this.definedRulesNames,e)){const o={message:FO.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:dh.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(o)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=one){const i=UYt(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(Ez(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return OWt(ml(this.gastProductionsCache))}},$(eM,"RecognizerApi"),eM),eYn=(tM=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Az,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},hn(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}$(fqt,"createBaseSemanticVisitorConstructor");function pqt(t,e,r){const n=$(function(){},"derivedConstructor");A4e(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return Sn(e,a=>{i[a]=dqt}),n.prototype=i,n.prototype.constructor=n,n}$(pqt,"createBaseVisitorConstructorWithDefaults");var S4e;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(S4e||(S4e={}));function gqt(t,e){return mqt(t,e)}$(gqt,"validateVisitor");function mqt(t,e){const r=zp(e,i=>ab(t[i])===!1),n=Wr(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:S4e.MISSING_METHOD,methodName:i}));return fz(n)}$(mqt,"validateMissingCstMethods");var JWn=(ZL=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=hn(e,"nodeLocationTracking")?e.nodeLocationTracking:cb.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=ql,this.cstFinallyStateUpdate=ql,this.cstPostTerminal=ql,this.cstPostNonTerminal=ql,this.cstPostRule=ql;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=w4e,this.setNodeLocationFromNode=w4e,this.cstPostRule=ql,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=ql,this.setNodeLocationFromNode=ql,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=x4e,this.setNodeLocationFromNode=x4e,this.cstPostRule=ql,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=ql,this.setNodeLocationFromNode=ql,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=ql,this.setNodeLocationFromNode=ql,this.cstPostRule=ql,this.setInitialNodeLocation=ql;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];uqt(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];hqt(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(sb(this.baseCstVisitorConstructor)){const e=fqt(this.className,vf(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(sb(this.baseCstVisitorWithDefaultsConstructor)){const e=pqt(this.className,vf(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]}},$(ZL,"TreeBuilder"),ZL),eYn=(JL=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)):ane}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?ane: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()}},$(JL,"LexerAdapter"),JL),tYn=(eM=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=one){if(ch(this.definedRulesNames,e)){const o={message:FO.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:dh.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(o)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=one){const i=QYt(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(Ez(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return EWt(ml(this.gastProductionsCache))}},$(eM,"RecognizerApi"),eM),rYn=(tM=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Az,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},hn(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(Fi(e)){if(Ga(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(Fi(e))this.tokensMap=bf(e,(a,o)=>(a[o.name]=o,a),{});else if(hn(e,"modes")&&Kg(Xg(ml(e.modes)),gYt)){const a=Xg(ml(e.modes)),o=HRe(a);this.tokensMap=bf(o,(s,l)=>(s[l.name]=l,s),{})}else if(Fp(e))this.tokensMap=_c(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Rw;const n=hn(e,"modes")?Xg(ml(e.modes)):ml(e),i=Kg(n,a=>Ga(a.categoryMatches));this.tokenMatcher=i?Az:W3,Y3(ml(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=hn(n,"resyncEnabled")?n.resyncEnabled:one.resyncEnabled,a=hn(n,"recoveryValueFunc")?n.recoveryValueFunc:one.recoveryValueFunc,o=this.ruleShortNameIdx<o.call(this)&&s.call(this),"lookAheadFunc")}}else a=e;if(i.call(this)===!0)return a.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(v4e,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 o=r.GATE;if(o!==void 0){const s=i;i=$(()=>o.call(this)&&s.call(this),"lookAheadFunc")}}else a=r;if(i.call(this)===!0){let o=this.doSingleRepetition(a);for(;i.call(this)===!0&&o===!0;)o=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,No.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,v4e,e,$Wn)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(tne,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 s=$(()=>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,s,i,kYt],s,tne,e,kYt)}else throw this.raiseEarlyExitException(e,No.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(m4e,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 s=r.GATE;if(s!==void 0){const l=i;i=$(()=>s.call(this)&&l.call(this),"lookaheadFunction")}}else a=r;let o=!0;for(;i.call(this)===!0&&o===!0;)o=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,m4e,e,BWn,o)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(y4e,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 s=$(()=>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,s,i,OYt],s,y4e,e,OYt)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,tne,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(aqt,r),i=Fi(e)?e:e.DEF,o=this.getLaFuncFromCache(n).call(this,i);if(o!==void 0)return i[o].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 QWn(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 Ez(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 rqt(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===nqt?n:a}}else throw n}saveRecogState(){const e=this.errors,r=_c(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),Rw)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},$(tM,"RecognizerEngine"),tM),tYn=(rM=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=hn(e,"errorMessageProvider")?e.errorMessageProvider:cb.errorMessageProvider}SAVE_ERROR(e){if(Ez(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:_c(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return _c(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],s=Oz(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:s,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new GWn(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=Cz(e,i,this.maxLookahead),o=[];for(let u=1;u<=this.maxLookahead;u++)o.push(this.LA(u));const s=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:o,previous:s,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new VWn(l,this.LA(1),s))}},$(rM,"ErrorHandler"),rM),rYn=(nM=class{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(sb(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return s4e([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=Zg(e.ruleStack),i=this.getGAstProductions()[r];return new NWn(i,e).startWalking()}},$(nM,"ContentAssist"),nM),ine={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(ine);var gqt=!0,mqt=Math.pow(2,Dw)-1,vqt=q3({name:"RECORDING_PHASE_TOKEN",pattern:hh.NA});Y3([vqt]);var yqt=Tz(vqt,`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(yqt);var nYn={name:`This CSTNode indicates the Parser is in Recording Phase - See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},iYn=(iM=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 ane}topLevelRuleRecord(e,r){try{const n=new Q3({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+` + For Further details.`)}if(Fi(e))this.tokensMap=bf(e,(a,o)=>(a[o.name]=o,a),{});else if(hn(e,"modes")&&Kg(Xg(ml(e.modes)),vYt)){const a=Xg(ml(e.modes)),o=HRe(a);this.tokensMap=bf(o,(s,l)=>(s[l.name]=l,s),{})}else if(Fp(e))this.tokensMap=_c(e);else throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Rw;const n=hn(e,"modes")?Xg(ml(e.modes)):ml(e),i=Kg(n,a=>Ga(a.categoryMatches));this.tokenMatcher=i?Az:W3,Y3(ml(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=hn(n,"resyncEnabled")?n.resyncEnabled:one.resyncEnabled,a=hn(n,"recoveryValueFunc")?n.recoveryValueFunc:one.recoveryValueFunc,o=this.ruleShortNameIdx<o.call(this)&&s.call(this),"lookAheadFunc")}}else a=e;if(i.call(this)===!0)return a.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(v4e,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 o=r.GATE;if(o!==void 0){const s=i;i=$(()=>o.call(this)&&s.call(this),"lookAheadFunc")}}else a=r;if(i.call(this)===!0){let o=this.doSingleRepetition(a);for(;i.call(this)===!0&&o===!0;)o=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,No.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,v4e,e,zWn)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(tne,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 s=$(()=>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,s,i,_Yt],s,tne,e,_Yt)}else throw this.raiseEarlyExitException(e,No.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(m4e,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 s=r.GATE;if(s!==void 0){const l=i;i=$(()=>s.call(this)&&l.call(this),"lookaheadFunction")}}else a=r;let o=!0;for(;i.call(this)===!0&&o===!0;)o=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,m4e,e,FWn,o)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(y4e,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 s=$(()=>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,s,i,EYt],s,y4e,e,EYt)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,tne,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(sqt,r),i=Fi(e)?e:e.DEF,o=this.getLaFuncFromCache(n).call(this,i);if(o!==void 0)return i[o].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 HWn(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 Ez(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 iqt(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===aqt?n:a}}else throw n}saveRecogState(){const e=this.errors,r=_c(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),Rw)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}},$(tM,"RecognizerEngine"),tM),nYn=(rM=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=hn(e,"errorMessageProvider")?e.errorMessageProvider:cb.errorMessageProvider}SAVE_ERROR(e){if(Ez(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:_c(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return _c(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],s=Oz(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:s,actual:l,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new WWn(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=Cz(e,i,this.maxLookahead),o=[];for(let u=1;u<=this.maxLookahead;u++)o.push(this.LA(u));const s=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:o,previous:s,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new GWn(l,this.LA(1),s))}},$(rM,"ErrorHandler"),rM),iYn=(nM=class{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(sb(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return s4e([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=Zg(e.ruleStack),i=this.getGAstProductions()[r];return new $Wn(i,e).startWalking()}},$(nM,"ContentAssist"),nM),ine={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(ine);var vqt=!0,yqt=Math.pow(2,Dw)-1,bqt=q3({name:"RECORDING_PHASE_TOKEN",pattern:hh.NA});Y3([bqt]);var xqt=Tz(bqt,`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(xqt);var aYn={name:`This CSTNode indicates the Parser is in Recording Phase + See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},oYn=(iM=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 ane}topLevelRuleRecord(e,r){try{const n=new Q3({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+` This error was thrown during the "grammar recording phase" For more info see: - https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return X3.call(this,Dc,e,r)}atLeastOneInternalRecord(e,r){X3.call(this,xf,r,e)}atLeastOneSepFirstInternalRecord(e,r){X3.call(this,wf,r,e,gqt)}manyInternalRecord(e,r){X3.call(this,ns,r,e)}manySepFirstInternalRecord(e,r){X3.call(this,ld,r,e,gqt)}orInternalRecord(e,r){return bqt.call(this,e,r)}subruleInternalRecord(e,r,n){if(_z(r),!e||hn(e,"ruleName")===!1){const s=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> - inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}const i=NO(this.recordingProdStack),a=e.ruleName,o=new uh({idx:r,nonTerminalName:a,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(o),this.outputCst?nYn:ine}consumeInternalRecord(e,r,n){if(_z(r),!r4e(e)){const o=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> - inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=NO(this.recordingProdStack),a=new go({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(a),yqt}},$(iM,"GastRecorder"),iM);function X3(t,e,r,n=!1){_z(r);const i=NO(this.recordingProdStack),a=ab(e)?e:e.DEF,o=new t({definition:[],idx:r});return n&&(o.separator=e.SEP),hn(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(o),a.call(this),i.definition.push(o),this.recordingProdStack.pop(),ine}$(X3,"recordProd");function bqt(t,e){_z(e);const r=NO(this.recordingProdStack),n=Fi(t)===!1,i=n===!1?t:t.DEF,a=new cd({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});hn(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const o=wWt(i,s=>ab(s.GATE));return a.hasPredicates=o,r.definition.push(a),Sn(i,s=>{const l=new sd({definition:[]});a.definition.push(l),hn(s,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=s.IGNORE_AMBIGUITIES:hn(s,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),s.ALT.call(this),this.recordingProdStack.pop()}),ine}$(bqt,"recordOrProd");function T4e(t){return t===0?"":`${t}`}$(T4e,"getIdxSuffix");function _z(t){if(t<0||t>mqt){const e=new Error(`Invalid DSL Method idx value: <${t}> - Idx value must be a none negative value smaller than ${mqt+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}$(_z,"assertMethodIdxIsValid");var aYn=(aM=class{initPerformanceTracer(e){if(hn(e,"traceInitPerf")){const r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=cb.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);const{time:i,value:a}=YRe(r),o=i>10?console.warn:console.log;return this.traceInitIndent time: ${i}ms`),this.traceInitIndent--,a}else return r()}},$(aM,"PerformanceTracer"),aM);function xqt(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;const a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(t.prototype,i,a):t.prototype[i]=r.prototype[i]})})}$(xqt,"applyMixins");var ane=Tz(Rw,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ane);var cb=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:j3,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),one=Object.freeze({recoveryValueFunc:$(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),dh;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(dh||(dh={}));function C4e(t=void 0){return function(){return t}}$(C4e,"EMPTY_ALT");var O4e=(xk=class{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",()=>{qRe(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),Sn(this.definedRulesNames,i=>{const o=this[i].originalGrammarAction;let s;this.TRACE_INIT(`${i} Rule`,()=>{s=this.topLevelRuleRecord(i,o)}),this.gastProductionsCache[i]=s})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=jYt({rules:ml(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Ga(n)&&this.skipValidations===!1){const i=XYt({rules:ml(this.gastProductionsCache),tokenTypes:ml(this.tokensMap),errMsgProvider:FO,grammarName:r}),a=NYt({lookaheadStrategy:this.lookaheadStrategy,rules:ml(this.gastProductionsCache),tokenTypes:ml(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),Ga(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=MWt(ml(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,a;(a=(i=this.lookaheadStrategy).initialize)===null||a===void 0||a.call(i,{rules:ml(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(ml(this.gastProductionsCache))})),!xk.DEFER_DEFINITION_ERRORS_HANDLING&&!Ga(this.definitionErrors))throw e=Wr(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected: + https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return X3.call(this,Dc,e,r)}atLeastOneInternalRecord(e,r){X3.call(this,xf,r,e)}atLeastOneSepFirstInternalRecord(e,r){X3.call(this,wf,r,e,vqt)}manyInternalRecord(e,r){X3.call(this,ns,r,e)}manySepFirstInternalRecord(e,r){X3.call(this,ld,r,e,vqt)}orInternalRecord(e,r){return wqt.call(this,e,r)}subruleInternalRecord(e,r,n){if(_z(r),!e||hn(e,"ruleName")===!1){const s=new Error(` argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}const i=NO(this.recordingProdStack),a=e.ruleName,o=new uh({idx:r,nonTerminalName:a,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(o),this.outputCst?aYn:ine}consumeInternalRecord(e,r,n){if(_z(r),!r4e(e)){const o=new Error(` argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}> + inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=NO(this.recordingProdStack),a=new go({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(a),xqt}},$(iM,"GastRecorder"),iM);function X3(t,e,r,n=!1){_z(r);const i=NO(this.recordingProdStack),a=ab(e)?e:e.DEF,o=new t({definition:[],idx:r});return n&&(o.separator=e.SEP),hn(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(o),a.call(this),i.definition.push(o),this.recordingProdStack.pop(),ine}$(X3,"recordProd");function wqt(t,e){_z(e);const r=NO(this.recordingProdStack),n=Fi(t)===!1,i=n===!1?t:t.DEF,a=new cd({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});hn(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const o=SWt(i,s=>ab(s.GATE));return a.hasPredicates=o,r.definition.push(a),Sn(i,s=>{const l=new sd({definition:[]});a.definition.push(l),hn(s,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=s.IGNORE_AMBIGUITIES:hn(s,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),s.ALT.call(this),this.recordingProdStack.pop()}),ine}$(wqt,"recordOrProd");function T4e(t){return t===0?"":`${t}`}$(T4e,"getIdxSuffix");function _z(t){if(t<0||t>yqt){const e=new Error(`Invalid DSL Method idx value: <${t}> + Idx value must be a none negative value smaller than ${yqt+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}$(_z,"assertMethodIdxIsValid");var sYn=(aM=class{initPerformanceTracer(e){if(hn(e,"traceInitPerf")){const r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=cb.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent <${e}>`);const{time:i,value:a}=YRe(r),o=i>10?console.warn:console.log;return this.traceInitIndent time: ${i}ms`),this.traceInitIndent--,a}else return r()}},$(aM,"PerformanceTracer"),aM);function Aqt(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;const a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(t.prototype,i,a):t.prototype[i]=r.prototype[i]})})}$(Aqt,"applyMixins");var ane=Tz(Rw,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ane);var cb=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:j3,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),one=Object.freeze({recoveryValueFunc:$(()=>{},"recoveryValueFunc"),resyncEnabled:!0}),dh;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(dh||(dh={}));function C4e(t=void 0){return function(){return t}}$(C4e,"EMPTY_ALT");var O4e=(xk=class{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",()=>{qRe(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),Sn(this.definedRulesNames,i=>{const o=this[i].originalGrammarAction;let s;this.TRACE_INIT(`${i} Rule`,()=>{s=this.topLevelRuleRecord(i,o)}),this.gastProductionsCache[i]=s})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=KYt({rules:ml(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Ga(n)&&this.skipValidations===!1){const i=ZYt({rules:ml(this.gastProductionsCache),tokenTypes:ml(this.tokensMap),errMsgProvider:FO,grammarName:r}),a=$Yt({lookaheadStrategy:this.lookaheadStrategy,rules:ml(this.gastProductionsCache),tokenTypes:ml(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),Ga(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=PWt(ml(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,a;(a=(i=this.lookaheadStrategy).initialize)===null||a===void 0||a.call(i,{rules:ml(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(ml(this.gastProductionsCache))})),!xk.DEFER_DEFINITION_ERRORS_HANDLING&&!Ga(this.definitionErrors))throw e=Wr(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected: ${e.join(` ------------------------------- `)}`)})}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),hn(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=hn(r,"skipValidations")?r.skipValidations:cb.skipValidations}},$(xk,"Parser"),xk);O4e.DEFER_DEFINITION_ERRORS_HANDLING=!1,xqt(O4e,[WWn,qWn,KWn,ZWn,eYn,JWn,tYn,rYn,iYn,aYn]);var oYn=(oM=class extends O4e{constructor(e,r=cb){const n=_c(r);n.outputCst=!1,super(e,n)}},$(oM,"EmbeddedActionsParser"),oM);function wqt(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r-1}$(_qt,"listCacheHas");var dYn=_qt;function Rqt(t,e){var r=this.__data__,n=sne(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}$(Rqt,"listCacheSet");var fYn=Rqt;function zO(t){var e=-1,r=t==null?0:t.length;for(this.clear();++es))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&bqn?new djt:void 0;for(a.set(t,e),a.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=ejn}$(Ujt,"isLength");var D4e=Ujt,tjn="[object Arguments]",rjn="[object Array]",njn="[object Boolean]",ijn="[object Date]",ajn="[object Error]",ojn="[object Function]",sjn="[object Map]",ljn="[object Number]",cjn="[object Object]",ujn="[object RegExp]",hjn="[object Set]",djn="[object String]",fjn="[object WeakMap]",pjn="[object ArrayBuffer]",gjn="[object DataView]",mjn="[object Float32Array]",vjn="[object Float64Array]",yjn="[object Int8Array]",bjn="[object Int16Array]",xjn="[object Int32Array]",wjn="[object Uint8Array]",Ajn="[object Uint8ClampedArray]",Sjn="[object Uint16Array]",Tjn="[object Uint32Array]",mo={};mo[mjn]=mo[vjn]=mo[yjn]=mo[bjn]=mo[xjn]=mo[wjn]=mo[Ajn]=mo[Sjn]=mo[Tjn]=!0,mo[tjn]=mo[rjn]=mo[pjn]=mo[njn]=mo[gjn]=mo[ijn]=mo[ajn]=mo[ojn]=mo[sjn]=mo[ljn]=mo[cjn]=mo[ujn]=mo[hjn]=mo[djn]=mo[fjn]=!1;function Vjt(t){return J3(t)&&D4e(t.length)&&!!mo[K3(t)]}$(Vjt,"baseIsTypedArray");var Cjn=Vjt;function Qjt(t){return function(e){return t(e)}}$(Qjt,"baseUnary");var Ojn=Qjt,Gjt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Iz=Gjt&&typeof module=="object"&&module&&!module.nodeType&&module,kjn=Iz&&Iz.exports===Gjt,L4e=kjn&&Pqt.process,Ejn=function(){try{var t=Iz&&Iz.require&&Iz.require("util").types;return t||L4e&&L4e.binding&&L4e.binding("util")}catch{}}(),Hjt=Ejn,Wjt=Hjt&&Hjt.isTypedArray,_jn=Wjt?Ojn(Wjt):Cjn,M4e=_jn,Rjn=Object.prototype,Djn=Rjn.hasOwnProperty;function Yjt(t,e){var r=fh(t),n=!r&&dne(t),i=!r&&!n&&fne(t),a=!r&&!n&&!i&&M4e(t),o=r||n||i||a,s=o?Qqn(t.length,String):[],l=s.length;for(var u in t)(e||Djn.call(t,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||zjt(u,l)))&&s.push(u);return s}$(Yjt,"arrayLikeKeys");var Ljn=Yjt,Mjn=Object.prototype;function qjt(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Mjn;return t===r}$(qjt,"isPrototype");var jjt=qjt;function Xjt(t,e){return function(r){return t(e(r))}}$(Xjt,"overArg");var Ijn=Xjt,Pjn=Ijn(Object.keys,Object),Njn=Pjn,Bjn=Object.prototype,$jn=Bjn.hasOwnProperty;function Kjt(t){if(!jjt(t))return Njn(t);var e=[];for(var r in Object(t))$jn.call(t,r)&&r!="constructor"&&e.push(r);return e}$(Kjt,"baseKeys");var Zjt=Kjt;function Jjt(t){return t!=null&&D4e(t.length)&&!Qqt(t)}$(Jjt,"isArrayLike");var pne=Jjt;function eXt(t){return pne(t)?Ljn(t):Zjt(t)}$(eXt,"keys");var I4e=eXt;function tXt(t){return Bqn(t,I4e,Vqn)}$(tXt,"getAllKeys");var rXt=tXt,Fjn=1,zjn=Object.prototype,Ujn=zjn.hasOwnProperty;function nXt(t,e,r,n,i,a){var o=r&Fjn,s=rXt(t),l=s.length,u=rXt(e),h=u.length;if(l!=h&&!o)return!1;for(var d=l;d--;){var f=s[d];if(!(o?f in e:Ujn.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=o;++dW4e(t,e,o));return YO(t,e,n,r,...i)}$(aKt,"alternation");function oKt(t,e,r){const n=vl(t,e,r,{type:Lw});db(t,n);const i=YO(t,e,n,r,Mw(t,e,r));return sKt(t,e,r,i)}$(oKt,"option");function Mw(t,e,r){const n=$Xn(hb(r.definition,i=>W4e(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:cKt(t,n)}$(Mw,"block");function Y4e(t,e,r,n,i){const a=n.left,o=n.right,s=vl(t,e,r,{type:QXn});db(t,s);const l=vl(t,e,r,{type:KXt});return a.loopback=s,l.loopback=s,t.decisionMap[WO(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=s,Ss(o,s),i===void 0?(Ss(s,a),Ss(s,l)):(Ss(s,l),Ss(s,i.left),Ss(i.right,a)),{left:a,right:l}}$(Y4e,"plus");function q4e(t,e,r,n,i){const a=n.left,o=n.right,s=vl(t,e,r,{type:VXn});db(t,s);const l=vl(t,e,r,{type:KXt}),u=vl(t,e,r,{type:UXn});return s.loopback=u,l.loopback=u,Ss(s,a),Ss(s,l),Ss(o,u),i!==void 0?(Ss(u,l),Ss(u,i.left),Ss(i.right,a)):Ss(u,s),t.decisionMap[WO(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=s,{left:s,right:l}}$(q4e,"star");function sKt(t,e,r,n){const i=n.left,a=n.right;return Ss(i,a),t.decisionMap[WO(e,"Option",r.idx)]=i,n}$(sKt,"optional");function db(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}$(db,"defineDecisionState");function YO(t,e,r,n,...i){const a=vl(t,e,n,{type:zXn,start:r});r.end=a;for(const s of i)s!==void 0?(Ss(r,s.left),Ss(s.right,a)):Ss(r,a);const o={left:r,right:a};return t.decisionMap[WO(e,lKt(n),n.idx)]=r,o}$(YO,"makeAlts");function lKt(t){if(t instanceof cd)return"Alternation";if(t instanceof Dc)return"Option";if(t instanceof ns)return"Repetition";if(t instanceof ld)return"RepetitionWithSeparator";if(t instanceof xf)return"RepetitionMandatory";if(t instanceof wf)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}$(lKt,"getProdType");function cKt(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}},$(hM,"ATNConfigSet"),hM);function X4e(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}$(X4e,"getATNConfigKey");function fKt(t,e,r){for(var n=-1,i=t.length;++n0&&r(s)?e>1?K4e(s,e-1,r,n,i):Tjt(i,s):n||(i[i.length]=s)}return i}$(K4e,"baseFlatten");var yKt=K4e;function bKt(t,e){return yKt(hb(t,e),1)}$(bKt,"flatMap");var qXn=bKt;function xKt(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a-1}$(TKt,"arrayIncludes");var JXn=TKt;function CKt(t,e,r){for(var n=-1,i=t==null?0:t.length;++n=aKn){var u=e?null:iKn(t);if(u)return _4e(u);o=!1,i=gjt,l=new djt}else l=e?[]:s;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}}$($Kt,"createDFACache");var FKt=(dM=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=JXt(e.rules),this.dfas=UKt(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:a}=e,o=this.dfas,s=this.logging,l=WO(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=hb(l4e({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>hb(f,p=>p[0]));if(J4e(d,!1)&&!a){const f=BKt(d,(p,g,m)=>(Z4e(g,v=>{v&&(p[v.tokenTypeIdx]=m,Z4e(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 FKt,g=f===void 0?0:f.length;for(let v=0;vhb(f,p=>p[0]));if(J4e(d)&&d[0][0]&&!a){const f=d[0],p=lKn(f);if(p.length===1&&gKn(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=BKt(p,(m,v)=>(v!==void 0&&(m[v.tokenTypeIdx]=!0,Z4e(v.categoryMatches,y=>{m[y]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=Tne.call(this,o,h,zKt,s);return typeof f=="object"?!1:f===0}}},$(fM,"LLStarLookaheadStrategy"),fM);function J4e(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 o=[a.tokenTypeIdx].concat(a.categoryMatches);for(const s of o)if(r.has(s)){if(!i.has(s))return!1}else r.add(s),i.add(s)}}return!0}$(J4e,"isLL1Sequence");function UKt(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;n$O(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${WKt(t.production)}${r}> inside <${t.topLevelRule.name}> Rule, + For further details.`);this.skipValidations=hn(r,"skipValidations")?r.skipValidations:cb.skipValidations}},$(xk,"Parser"),xk);O4e.DEFER_DEFINITION_ERRORS_HANDLING=!1,Aqt(O4e,[qWn,XWn,JWn,eYn,rYn,tYn,nYn,iYn,oYn,sYn]);var lYn=(oM=class extends O4e{constructor(e,r=cb){const n=_c(r);n.outputCst=!1,super(e,n)}},$(oM,"EmbeddedActionsParser"),oM);function Sqt(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r-1}$(Dqt,"listCacheHas");var pYn=Dqt;function Lqt(t,e){var r=this.__data__,n=sne(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}$(Lqt,"listCacheSet");var gYn=Lqt;function zO(t){var e=-1,r=t==null?0:t.length;for(this.clear();++es))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&wqn?new pjt:void 0;for(a.set(t,e),a.set(e,t);++d-1&&t%1==0&&t-1&&t%1==0&&t<=rjn}$(Qjt,"isLength");var D4e=Qjt,njn="[object Arguments]",ijn="[object Array]",ajn="[object Boolean]",ojn="[object Date]",sjn="[object Error]",ljn="[object Function]",cjn="[object Map]",ujn="[object Number]",hjn="[object Object]",djn="[object RegExp]",fjn="[object Set]",pjn="[object String]",gjn="[object WeakMap]",mjn="[object ArrayBuffer]",vjn="[object DataView]",yjn="[object Float32Array]",bjn="[object Float64Array]",xjn="[object Int8Array]",wjn="[object Int16Array]",Ajn="[object Int32Array]",Sjn="[object Uint8Array]",Tjn="[object Uint8ClampedArray]",Cjn="[object Uint16Array]",Ojn="[object Uint32Array]",mo={};mo[yjn]=mo[bjn]=mo[xjn]=mo[wjn]=mo[Ajn]=mo[Sjn]=mo[Tjn]=mo[Cjn]=mo[Ojn]=!0,mo[njn]=mo[ijn]=mo[mjn]=mo[ajn]=mo[vjn]=mo[ojn]=mo[sjn]=mo[ljn]=mo[cjn]=mo[ujn]=mo[hjn]=mo[djn]=mo[fjn]=mo[pjn]=mo[gjn]=!1;function Gjt(t){return J3(t)&&D4e(t.length)&&!!mo[K3(t)]}$(Gjt,"baseIsTypedArray");var kjn=Gjt;function Hjt(t){return function(e){return t(e)}}$(Hjt,"baseUnary");var Ejn=Hjt,Wjt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Iz=Wjt&&typeof module=="object"&&module&&!module.nodeType&&module,_jn=Iz&&Iz.exports===Wjt,L4e=_jn&&Bqt.process,Rjn=function(){try{var t=Iz&&Iz.require&&Iz.require("util").types;return t||L4e&&L4e.binding&&L4e.binding("util")}catch{}}(),Yjt=Rjn,qjt=Yjt&&Yjt.isTypedArray,Djn=qjt?Ejn(qjt):kjn,M4e=Djn,Ljn=Object.prototype,Mjn=Ljn.hasOwnProperty;function jjt(t,e){var r=fh(t),n=!r&&dne(t),i=!r&&!n&&fne(t),a=!r&&!n&&!i&&M4e(t),o=r||n||i||a,s=o?Hqn(t.length,String):[],l=s.length;for(var u in t)(e||Mjn.call(t,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Vjt(u,l)))&&s.push(u);return s}$(jjt,"arrayLikeKeys");var Ijn=jjt,Pjn=Object.prototype;function Xjt(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Pjn;return t===r}$(Xjt,"isPrototype");var Kjt=Xjt;function Zjt(t,e){return function(r){return t(e(r))}}$(Zjt,"overArg");var Njn=Zjt,Bjn=Njn(Object.keys,Object),$jn=Bjn,Fjn=Object.prototype,zjn=Fjn.hasOwnProperty;function Jjt(t){if(!Kjt(t))return $jn(t);var e=[];for(var r in Object(t))zjn.call(t,r)&&r!="constructor"&&e.push(r);return e}$(Jjt,"baseKeys");var eXt=Jjt;function tXt(t){return t!=null&&D4e(t.length)&&!Hqt(t)}$(tXt,"isArrayLike");var pne=tXt;function rXt(t){return pne(t)?Ijn(t):eXt(t)}$(rXt,"keys");var I4e=rXt;function nXt(t){return Fqn(t,I4e,Gqn)}$(nXt,"getAllKeys");var iXt=nXt,Ujn=1,Vjn=Object.prototype,Qjn=Vjn.hasOwnProperty;function aXt(t,e,r,n,i,a){var o=r&Ujn,s=iXt(t),l=s.length,u=iXt(e),h=u.length;if(l!=h&&!o)return!1;for(var d=l;d--;){var f=s[d];if(!(o?f in e:Qjn.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=o;++dW4e(t,e,o));return YO(t,e,n,r,...i)}$(sKt,"alternation");function lKt(t,e,r){const n=vl(t,e,r,{type:Lw});db(t,n);const i=YO(t,e,n,r,Mw(t,e,r));return cKt(t,e,r,i)}$(lKt,"option");function Mw(t,e,r){const n=zXn(hb(r.definition,i=>W4e(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:hKt(t,n)}$(Mw,"block");function Y4e(t,e,r,n,i){const a=n.left,o=n.right,s=vl(t,e,r,{type:HXn});db(t,s);const l=vl(t,e,r,{type:JXt});return a.loopback=s,l.loopback=s,t.decisionMap[WO(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=s,Ss(o,s),i===void 0?(Ss(s,a),Ss(s,l)):(Ss(s,l),Ss(s,i.left),Ss(i.right,a)),{left:a,right:l}}$(Y4e,"plus");function q4e(t,e,r,n,i){const a=n.left,o=n.right,s=vl(t,e,r,{type:GXn});db(t,s);const l=vl(t,e,r,{type:JXt}),u=vl(t,e,r,{type:QXn});return s.loopback=u,l.loopback=u,Ss(s,a),Ss(s,l),Ss(o,u),i!==void 0?(Ss(u,l),Ss(u,i.left),Ss(i.right,a)):Ss(u,s),t.decisionMap[WO(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=s,{left:s,right:l}}$(q4e,"star");function cKt(t,e,r,n){const i=n.left,a=n.right;return Ss(i,a),t.decisionMap[WO(e,"Option",r.idx)]=i,n}$(cKt,"optional");function db(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}$(db,"defineDecisionState");function YO(t,e,r,n,...i){const a=vl(t,e,n,{type:VXn,start:r});r.end=a;for(const s of i)s!==void 0?(Ss(r,s.left),Ss(s.right,a)):Ss(r,a);const o={left:r,right:a};return t.decisionMap[WO(e,uKt(n),n.idx)]=r,o}$(YO,"makeAlts");function uKt(t){if(t instanceof cd)return"Alternation";if(t instanceof Dc)return"Option";if(t instanceof ns)return"Repetition";if(t instanceof ld)return"RepetitionWithSeparator";if(t instanceof xf)return"RepetitionMandatory";if(t instanceof wf)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}$(uKt,"getProdType");function hKt(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}},$(hM,"ATNConfigSet"),hM);function X4e(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}$(X4e,"getATNConfigKey");function gKt(t,e,r){for(var n=-1,i=t.length;++n0&&r(s)?e>1?K4e(s,e-1,r,n,i):Ojt(i,s):n||(i[i.length]=s)}return i}$(K4e,"baseFlatten");var xKt=K4e;function wKt(t,e){return xKt(hb(t,e),1)}$(wKt,"flatMap");var XXn=wKt;function AKt(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a-1}$(OKt,"arrayIncludes");var tKn=OKt;function kKt(t,e,r){for(var n=-1,i=t==null?0:t.length;++n=sKn){var u=e?null:oKn(t);if(u)return _4e(u);o=!1,i=vjt,l=new pjt}else l=e?[]:s;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}}$(zKt,"createDFACache");var UKt=(dM=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=tKt(e.rules),this.dfas=QKt(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:a}=e,o=this.dfas,s=this.logging,l=WO(n,"Alternation",r),h=this.atn.decisionMap[l].decision,d=hb(l4e({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>hb(f,p=>p[0]));if(J4e(d,!1)&&!a){const f=FKt(d,(p,g,m)=>(Z4e(g,v=>{v&&(p[v.tokenTypeIdx]=m,Z4e(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 UKt,g=f===void 0?0:f.length;for(let v=0;vhb(f,p=>p[0]));if(J4e(d)&&d[0][0]&&!a){const f=d[0],p=uKn(f);if(p.length===1&&vKn(p[0].categoryMatches)){const m=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===m}}else{const g=FKt(p,(m,v)=>(v!==void 0&&(m[v.tokenTypeIdx]=!0,Z4e(v.categoryMatches,y=>{m[y]=!0})),m),{});return function(){const m=this.LA(1);return g[m.tokenTypeIdx]===!0}}}return function(){const f=Tne.call(this,o,h,VKt,s);return typeof f=="object"?!1:f===0}}},$(fM,"LLStarLookaheadStrategy"),fM);function J4e(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 o=[a.tokenTypeIdx].concat(a.categoryMatches);for(const s of o)if(r.has(s)){if(!i.has(s))return!1}else r.add(s),i.add(s)}}return!0}$(J4e,"isLL1Sequence");function QKt(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;n$O(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${qKt(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}$(HKt,"buildAmbiguityError");function WKt(t){if(t instanceof uh)return"SUBRULE";if(t instanceof Dc)return"OPTION";if(t instanceof cd)return"OR";if(t instanceof xf)return"AT_LEAST_ONE";if(t instanceof wf)return"AT_LEAST_ONE_SEP";if(t instanceof ld)return"MANY_SEP";if(t instanceof ns)return"MANY";if(t instanceof go)return"CONSUME";throw Error("non exhaustive match")}$(WKt,"getProductionDslName");function YKt(t,e,r){const n=qXn(e.configs.elements,a=>a.state.transitions),i=sKn(n.filter(a=>a instanceof G4e).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}$(YKt,"buildAdaptivePredictError");function qKt(t,e){return t.edges[e.tokenTypeIdx]}$(qKt,"getExistingTargetState");function jKt(t,e,r){const n=new j4e,i=[];for(const o of t.elements){if(r.is(o.alt)===!1)continue;if(o.state.type===Pz){i.push(o);continue}const s=o.state.transitions.length;for(let l=0;l0&&!eZt(a))for(const o of i)a.add(o);return a}$(jKt,"computeReachSet");function XKt(t,e){if(t instanceof G4e&&o4e(e,t.tokenType))return t.target}$(XKt,"getReachableTarget");function KKt(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}$(KKt,"getUniqueAlt");function e3e(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}$(e3e,"newDFAState");function t3e(t,e,r,n){return n=r3e(t,n),e.edges[r.tokenTypeIdx]=n,n}$(t3e,"addDFAEdge");function r3e(t,e){if(e===Sne)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}$(r3e,"addDFAState");function ZKt(t){const e=new j4e,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],o={state:i.pop(),alt:t.alt,stack:i};Nz(o,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}$(iZt,"hasConflictingAltSet");function aZt(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}$(aZt,"hasStateAssociatedWithOneAlt"),I9();var oZt=(pM=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new i3e(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new One;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new Cne(e.startOffset,e.image.length,q9(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 o=new Cne(a.startOffset,a.image.length,q9(a),a.tokenType,!0);o.root=this.rootNode,r.push(o)}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)}},$(pM,"CstNodeBuilder"),pM),n3e=(gM=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)}},$(gM,"AbstractCstNode"),gM),Cne=(mM=class extends n3e{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}},$(mM,"LeafCstNodeImpl"),mM),One=(vM=class extends n3e{constructor(){super(...arguments),this.content=new bKn(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]}},$(vM,"CompositeCstNodeImpl"),vM),bKn=(wk=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,wk.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}},$(wk,"CstNodeContainer"),wk),i3e=(yM=class extends One{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},$(yM,"RootCstNodeImpl"),yM),kne=Symbol("Datatype");function Ene(t){return t.$type===kne}$(Ene,"isDataTypeNode");var sZt="​",lZt=$(t=>t.endsWith(sZt)?t:t+sZt,"withRuleSuffix"),a3e=(bM=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 wKn(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new dZt(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()}},$(bM,"AbstractLangiumParser"),bM),cZt=(xM=class extends a3e{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new oZt,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;_3(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(lZt(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),lh(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 o={$type:e};this.stack.push(o),e===kne?o.value="":r!==void 0&&(o.$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 o=this.nodeBuilder.buildLeafNode(i,n),{assignment:s,crossRef:l}=this.getAssignment(n),u=this.current;if(s){const h=rb(n)?i.image:this.converter.convert(i.image,o);this.assign(s.operator,s.feature,h,o,l)}else if(Ene(u)){let h=i.image;rb(n)||(h=this.converter.convert(h,o).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 o;!this.isRecording()&&!n&&(o=this.nodeBuilder.buildCompositeNode(i));let s;try{s=this.wrapper.wrapSubrule(e,r,a)}finally{this.isRecording()||(s===void 0&&!n&&(s=this.construct()),s!==void 0&&o&&o.length>0&&this.performSubruleAssignment(s,i,o))}}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 o=this.current;if(Ene(o))o.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,o);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)):Ene(e)?this.converter.convert(e.value,e.$cstNode):(w5e(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,o=-1;for(let m=0;mo?(o=y.precedence,a=m):y.precedence===o&&(y.rightAssoc||(a=m))}const s=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:s},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=cO(e,eb);this.assignmentMap.set(e,{assignment:r,crossRef:r&&hO(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,a){const o=this.current;let s;switch(a==="single"&&typeof n=="string"?s=this.linker.buildReference(o,r,i,n):a==="multi"&&typeof n=="string"?s=this.linker.buildMultiReference(o,r,i,n):s=n,e){case"=":{o[r]=s;break}case"?=":{o[r]=!0;break}case"+=":Array.isArray(o[r])||(o[r]=[]),o[r].push(s)}}assignWithoutOverride(e,r){for(const[i,a]of Object.entries(r)){const o=e[i];o===void 0?e[i]=a:Array.isArray(o)&&Array.isArray(a)&&(a.push(...o),e[i]=a)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},$(xM,"LangiumParser"),xM),uZt=(wM=class{buildMismatchTokenMessage(e){return j3.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return j3.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return j3.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return j3.buildEarlyExitMessage(e)}},$(wM,"AbstractParserErrorMessageProvider"),wM),o3e=(AM=class extends uZt{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}\`.`}},$(AM,"LangiumParserErrorMessageProvider"),AM),hZt=(SM=class extends a3e{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(lZt(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}},$(SM,"LangiumCompletionParser"),SM),xKn={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new o3e},dZt=(TM=class extends oYn{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...xKn,lookaheadStrategy:n?new b4e({maxLookahead:r.maxLookahead}):new yKn({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,{})}},$(TM,"ChevrotainWrapper"),TM),wKn=(CM=class extends dZt{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))}}},$(CM,"ProfilerWrapper"),CM);function _ne(t,e,r){return fZt({parser:e,tokens:r,ruleNames:new Map},t),e}$(_ne,"createParser");function fZt(t,e){const r=gre(e,!1),n=da(e.rules).filter(lh).filter(a=>r.has(a));for(const a of n){const o={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(a,Iw(o,a.definition))}const i=da(e.rules).filter(_3).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,pZt(t,a))}$(fZt,"buildRules");function pZt(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(Bp(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},o={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(a,o);const l={$container:o,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},u={...a,$container:o};o.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=Rne(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")})}}$(pZt,"buildInfixRule");function Iw(t,e,r=!1){let n;if(rb(e))n=wZt(t,e);else if(Aw(e))n=gZt(t,e);else if(eb(e))n=Iw(t,e.terminal);else if(hO(e))n=s3e(t,e);else if(nb(e))n=mZt(t,e);else if(Vte(e))n=yZt(t,e);else if(are(e))n=bZt(t,e);else if(fO(e))n=xZt(t,e);else if(E5e(e)){const i=t.consume++;n=$(()=>t.parser.consume(i,Rw,e),"method")}else throw new lre(e.$cstNode,`Unexpected element type: ${e.$type}`);return l3e(t,r?void 0:Bz(e),n,e.cardinality)}$(Iw,"buildElement");function gZt(t,e){const r=OO(e);return()=>t.parser.action(r,e)}$(gZt,"buildAction");function mZt(t,e){const r=e.rule.ref;if(uO(r)){const n=t.subrule++,i=lh(r)&&r.fragment,a=e.arguments.length>0?vZt(r,e.arguments):()=>({});let o;return s=>{o??(o=Rne(t,r)),t.parser.subrule(n,o,i,e,a(s))}}else if(Bp(r)){const n=t.consume++,i=Dne(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)kw();else throw new lre(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}$(mZt,"buildRuleCall");function vZt(t,e){if(e.some(n=>n.calledByName)){const n=e.map(i=>{var a,o;return{parameterName:(o=(a=i.parameter)==null?void 0:a.ref)==null?void 0:o.name,predicate:tm(i.value)}});return i=>{const a={};for(const{parameterName:o,predicate:s}of n)o&&(a[o]=s(i));return a}}else{const n=e.map(i=>tm(i.value));return i=>{const a={};for(let o=0;oe(n)||r(n)}else if(O5e(t)){const e=tm(t.left),r=tm(t.right);return n=>e(n)&&r(n)}else if(D5e(t)){const e=tm(t.value);return r=>!e(r)}else if(L5e(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(T5e(t)){const e=!!t.true;return()=>e}kw()}$(tm,"buildPredicate");function yZt(t,e){if(e.elements.length===1)return Iw(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:Iw(t,i,!0)},o=Bz(i);o&&(a.GATE=tm(o)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const o={ALT:$(()=>a.ALT(i),"ALT")},s=a.GATE;return s&&(o.GATE=()=>s(i)),o}))}}$(yZt,"buildAlternatives");function bZt(t,e){if(e.elements.length===1)return Iw(t,e.elements[0]);const r=[];for(const s of e.elements){const l={ALT:Iw(t,s,!0)},u=Bz(s);u&&(l.GATE=tm(u)),r.push(l)}const n=t.or++,i=$((s,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${s}_${u}`},"idFunc"),a=$(s=>t.parser.alternatives(n,r.map((l,u)=>{const h={ALT:$(()=>!0,"ALT")},d=t.parser;h.ALT=()=>{if(l.ALT(s),!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(s):h.GATE=()=>{const p=d.unorderedGroups.get(i(n,d));return!(p!=null&&p[u])},h})),"alternatives"),o=l3e(t,Bz(e),a,"*");return s=>{o(s),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}$(bZt,"buildUnorderedGroup");function xZt(t,e){const r=e.elements.map(n=>Iw(t,n));return n=>r.forEach(i=>i(n))}$(xZt,"buildGroup");function Bz(t){if(fO(t))return t.guardCondition}$(Bz,"getGuardCondition");function s3e(t,e,r=e.terminal){if(r)if(nb(r)&&lh(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return o=>{a??(a=Rne(t,n)),t.parser.subrule(i,a,!1,e,o)}}else if(nb(r)&&Bp(r.rule.ref)){const n=t.consume++,i=Dne(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(rb(r)){const n=t.consume++,i=Dne(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=bre(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+OO(e.type.ref));return s3e(t,e,i)}}$(s3e,"buildCrossReference");function wZt(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)}$(wZt,"buildKeyword");function l3e(t,e,r,n){const i=e&&tm(e);if(!n)if(i){const a=t.or++;return o=>t.parser.alternatives(a,[{ALT:$(()=>r(o),"ALT"),GATE:$(()=>i(o),"GATE")},{ALT:C4e(),GATE:$(()=>!i(o),"GATE")}])}else return r;if(n==="*"){const a=t.many++;return o=>t.parser.many(a,{DEF:$(()=>r(o),"DEF"),GATE:i?()=>i(o):void 0})}else if(n==="+"){const a=t.many++;if(i){const o=t.or++;return s=>t.parser.alternatives(o,[{ALT:$(()=>t.parser.atLeastOne(a,{DEF:$(()=>r(s),"DEF")}),"ALT"),GATE:$(()=>i(s),"GATE")},{ALT:C4e(),GATE:$(()=>!i(s),"GATE")}])}else return o=>t.parser.atLeastOne(a,{DEF:$(()=>r(o),"DEF")})}else if(n==="?"){const a=t.optional++;return o=>t.parser.optional(a,{DEF:$(()=>r(o),"DEF"),GATE:i?()=>i(o):void 0})}else kw()}$(l3e,"wrap");function Rne(t,e){const r=AZt(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}$(Rne,"getRule");function AZt(t,e){if(uO(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!lh(n);)(fO(n)||Vte(n)||are(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}$(AZt,"getRuleName");function Dne(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}$(Dne,"getToken");function c3e(t){const e=t.Grammar,r=t.parser.Lexer,n=new hZt(t);return _ne(e,n,r.definition),n.finalize(),n}$(c3e,"createCompletionParser");function u3e(t){const e=h3e(t);return e.finalize(),e}$(u3e,"createLangiumParser");function h3e(t){const e=t.Grammar,r=t.parser.Lexer,n=new cZt(t);return _ne(e,n,r.definition)}$(h3e,"prepareLangiumParser");var Lne=(OM=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=da(gre(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(Bp).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=K9(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=pre(r)?hh.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(uO).flatMap(i=>J1(i).filter(rb)).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(F3(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&&rRe("^"+a.source+"$",e.value)&&n.push(i),n},[])}},$(OM,"DefaultTokenBuilder"),OM),d3e=(kM=class{convert(e,r){let n=r.grammarSource;if(hO(n)&&(n=sRe(n)),nb(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 mv.convertInt(r);case"STRING":return mv.convertString(r);case"ID":return mv.convertID(r)}switch((i=mRe(e))==null?void 0:i.toLowerCase()){case"number":return mv.convertNumber(r);case"boolean":return mv.convertBoolean(r);case"bigint":return mv.convertBigint(r);case"date":return mv.convertDate(r);default:return r}}},$(kM,"DefaultValueConverter"),kM),mv;(function(t){function e(u){let h="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}$(Mne,"delayNextTick");var Ine=0,SZt=10;function Pne(){return Ine=performance.now(),new Ha.CancellationTokenSource}$(Pne,"startCancelableOperation");function f3e(t){SZt=t}$(f3e,"setInterruptionPeriod");var vv=Symbol("OperationCancelled");function qO(t){return t===vv}$(qO,"isOperationCancelled");async function jl(t){if(t===Ha.CancellationToken.None)return;const e=performance.now();if(e-Ine>=SZt&&(Ine=e,await Mne(),Ine=performance.now()),t.isCancellationRequested)throw vv}$(jl,"interruptAndCheck");var fb=(EM=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},$(EM,"Deferred"),EM),TZt=(Hw=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(Hw.isIncremental(n)){const i=m3e(n.range),a=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(o,this._content.length);const s=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const h=p3e(n.text,!1,a);if(l-s===h.length)for(let f=0,p=h.length;fe?i=o:n=o+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&&g3e(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}},$(Hw,"FullTextDocument"),Hw),Nne;(function(t){function e(i,a,o,s){return new TZt(i,a,o,s)}$(e,"create"),t.create=e;function r(i,a,o){if(i instanceof TZt)return i.update(a,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}$(r,"update"),t.update=r;function n(i,a){const o=i.getText(),s=Bne(a.map(CZt),(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 s){const d=i.offsetAt(h.range.start);if(dl&&u.push(o.substring(l,d)),h.newText.length&&u.push(h.newText),l=i.offsetAt(h.range.end)}return u.push(o.substr(l)),u.join("")}$(n,"applyEdits"),t.applyEdits=n})(Nne||(Nne={}));function Bne(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);Bne(n,e),Bne(i,e);let a=0,o=0,s=0;for(;ar.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}$(m3e,"getWellformedRange");function CZt(t){const e=m3e(t.range);return e!==t.range?{newText:t.newText,range:e}:t}$(CZt,"getWellformedEdit");var OZt;(()=>{var t={975:L=>{function R(I){if(typeof I!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(I))}$(R,"e");function D(I,N){for(var F,B="",V=0,z=-1,U=0,Q=0;Q<=I.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+="/"+I.slice(z+1,Q):B=I.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 I,N="",F=!1,B=arguments.length-1;B>=-1&&!F;B--){var V;B>=0?V=arguments[B]:(I===void 0&&(I=process.cwd()),V=I),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(I){if(R(I),I.length===0)return".";var N=I.charCodeAt(0)===47,F=I.charCodeAt(I.length-1)===47;return(I=D(I,!N)).length!==0||N||(I="."),I.length>0&&F&&(I+="/"),N?"/"+I:I},"normalize"),isAbsolute:$(function(I){return R(I),I.length>0&&I.charCodeAt(0)===47},"isAbsolute"),join:$(function(){if(arguments.length===0)return".";for(var I,N=0;N0&&(I===void 0?I=F:I+="/"+F)}return I===void 0?".":M.normalize(I)},"join"),relative:$(function(I,N){if(R(I),R(N),I===N||(I=M.resolve(I))===(N=M.resolve(N)))return"";for(var F=1;FQ){if(N.charCodeAt(z+q)===47)return N.slice(z+q+1);if(q===0)return N.slice(z+q)}else V>Q&&(I.charCodeAt(F+q)===47?G=q:q===0&&(G=0));break}var Y=I.charCodeAt(F+q);if(Y!==N.charCodeAt(z+q))break;Y===47&&(G=q)}var ne="";for(q=F+G+1;q<=B;++q)q!==B&&I.charCodeAt(q)!==47||(ne.length===0?ne+="..":ne+="/..");return ne.length>0?ne+N.slice(z+G):(z+=G,N.charCodeAt(z)===47&&++z,N.slice(z))},"relative"),_makeLong:$(function(I){return I},"_makeLong"),dirname:$(function(I){if(R(I),I.length===0)return".";for(var N=I.charCodeAt(0),F=N===47,B=-1,V=!0,z=I.length-1;z>=1;--z)if((N=I.charCodeAt(z))===47){if(!V){B=z;break}}else V=!1;return B===-1?F?"/":".":F&&B===1?"//":I.slice(0,B)},"dirname"),basename:$(function(I,N){if(N!==void 0&&typeof N!="string")throw new TypeError('"ext" argument must be a string');R(I);var F,B=0,V=-1,z=!0;if(N!==void 0&&N.length>0&&N.length<=I.length){if(N.length===I.length&&N===I)return"";var U=N.length-1,Q=-1;for(F=I.length-1;F>=0;--F){var G=I.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=I.length),I.slice(B,V)}for(F=I.length-1;F>=0;--F)if(I.charCodeAt(F)===47){if(!z){B=F+1;break}}else V===-1&&(z=!1,V=F+1);return V===-1?"":I.slice(B,V)},"basename"),extname:$(function(I){R(I);for(var N=-1,F=0,B=-1,V=!0,z=0,U=I.length-1;U>=0;--U){var Q=I.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?"":I.slice(N,B)},"extname"),format:$(function(I){if(I===null||typeof I!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof I);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,I)},"format"),parse:$(function(I){R(I);var N={root:"",dir:"",base:"",ext:"",name:""};if(I.length===0)return N;var F,B=I.charCodeAt(0),V=B===47;V?(N.root="/",F=1):F=0;for(var z=-1,U=0,Q=-1,G=!0,q=I.length-1,Y=0;q>=F;--q)if((B=I.charCodeAt(q))!==47)Q===-1&&(G=!1,Q=q+1),B===46?z===-1?z=q:Y!==1&&(Y=1):z!==-1&&(Y=-1);else if(!G){U=q+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?I.slice(1,Q):I.slice(U,Q)):(U===0&&V?(N.name=I.slice(1,z),N.base=I.slice(1,Q)):(N.name=I.slice(U,z),N.base=I.slice(U,Q)),N.ext=I.slice(z,Q)),U>0?N.dir=I.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+.-]*$/,o=/^\//,s=/^\/\//;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(!o.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(s.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,I,N,F=!1){Pr(this,"scheme");Pr(this,"authority");Pr(this,"path");Pr(this,"query");Pr(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=I||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:I,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),I===void 0?I=this.path:I===null&&(I=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&&I===this.path&&N===this.query&&F===this.fragment?this:new g(D,M,I,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,P=class P extends f{constructor(){super(...arguments);Pr(this,"_formatted",null);Pr(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}};$(P,"d");let g=P;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,I=-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)I!==-1&&(M+=encodeURIComponent(L.substring(I,N)),I=-1),M!==void 0&&(M+=L.charAt(N));else{M===void 0&&(M=L.substr(0,N));const B=m[F];B!==void 0?(I!==-1&&(M+=encodeURIComponent(L.substring(I,N)),I=-1),M+=B):I===-1&&(I=N)}}return I!==-1&&(M+=encodeURIComponent(L.substring(I))),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:I,authority:N,path:F,query:B,fragment:V}=L;if(I&&(M+=I,M+=":"),(N||I==="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 C=T.posix||T,k="/";var E;(function(L){L.joinPath=function(R,...D){return R.with({path:C.join(R.path,...D)})},L.resolvePath=function(R,...D){let M=R.path,I=!1;M[0]!==k&&(M=k+M,I=!0);let N=C.resolve(M,...D);return I&&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=C.dirname(R.path);return D.length===1&&D.charCodeAt(0)===46&&(D=""),R.with({path:D})},L.basename=function(R){return C.basename(R.path)},L.extname=function(R){return C.extname(R.path)}})(E||(E={})),OZt=n})();var{URI:Af,Utils:$z}=OZt,ph;(function(t){t.basename=$z.basename,t.dirname=$z.dirname,t.extname=$z.extname,t.joinPath=$z.joinPath,t.resolvePath=$z.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function r(o,s){return(o==null?void 0:o.toString())===(s==null?void 0:s.toString())}$(r,"equals"),t.equals=r;function n(o,s){const l=typeof o=="string"?Af.parse(o).path:o.path,u=typeof s=="string"?Af.parse(s).path:s.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:ph.joinPath(Af.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(ph.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 o=i.children.get(a);if(!o)if(r)o={name:a,children:new Map,parent:i},i.children.set(a,o);else return;i=o}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}},$(_M,"UriTrie"),_M),ui;(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"})(ui||(ui={}));var kZt=(RM=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=Ha.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??Af.parse(e.uri),Ha.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return Ha.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:ui.Parsed,references:[],textDocument:n};else{const o=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:ui.Parsed,references:[],get textDocument(){return o()}}}return e.value.$document=a,a}async update(e,r){var o,s;const n=(o=e.parseResult.value.$cstNode)==null?void 0:o.root.fullText,i=(s=this.textDocuments)==null?void 0:s.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=ui.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=Nne.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},$(RM,"DefaultLangiumDocumentFactory"),RM),EZt=(DM=class{constructor(e){this.documentTrie=new v3e,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return da(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,ui.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=ui.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=ui.Changed;return this.documentTrie.delete(r),n}},$(DM,"DefaultLangiumDocuments"),DM),jO=Symbol("RefResolving"),_Zt=(LM=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=Ha.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 Yg(e.parseResult.value))await jl(r),k3(a).forEach(o=>{const s=`${a.$type}:${o.property}`;i.startSubTask(s);try{this.doLink(o,e)}finally{i.stopSubTask(s)}})}finally{i.stop()}}else for(const i of Yg(e.parseResult.value))await jl(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=jO;try{const i=this.getCandidate(e);if(sO(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=jO;try{const i=this.getCandidates(e),a=[];if(sO(i))n._linkingError=i;else for(const o of i){const s=this.loadAstNode(o);s&&a.push({ref:s,$nodeDescription:o})}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,o={$refNode:n,$refText:i,_ref:void 0,get ref(){if(Xs(this._ref))return this._ref;if(y5e(this._nodeDescription)){const s=a.loadAstNode(this._nodeDescription);this._ref=s??a.createLinkingError({reference:o,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=jO;const s=O3(e).$document,l=a.getLinkedNode({reference:o,container:e,property:r});if(l.error&&s&&s.state0))return this._linkingError=a.createLinkingError({reference:o,container:e,property:r})}};return o}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(sO(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=O3(e.container).$document;n&&n.statehO(r)&&r.isMulti)}findDeclarations(e){if(e){const r=hRe(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(oh(i)||ov(i))return $te(i);if(Array.isArray(i)){for(const a of i)if((oh(a)||ov(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return $te(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||V5e(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(ov(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=>ph.equals(a.sourceUri,r.documentUri))),n.push(...i),da(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const o=Wg(i),s=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:o.uri,sourcePath:s,targetUri:o.uri,targetPath:s,segment:B3(a),local:!0})}}return n}},$(IM,"DefaultReferences"),IM),pb=(PM=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return B9.sum(da(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?da(r):S3}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 da(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return da(this.map.keys())}values(){return da(this.map.values()).flat()}entriesGroupedByKey(){return da(this.map.entries())}},$(PM,"MultiMap"),PM),$ne=(NM=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}},$(NM,"BiMap"),NM),LZt=(BM=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=Ha.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=$9,i=Ha.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const o of n(e))await jl(i),this.addExportedSymbol(o,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=Ha.CancellationToken.None){const n=e.parseResult.value,i=new pb;for(const a of J1(n))await jl(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))}}},$(BM,"DefaultScopeComputation"),BM),b3e=($M=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}},$($M,"StreamScope"),$M),AKn=(FM=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?da(i).concat(this.outerScope.getElements(e)):da(i)}getAllElements(){let e=da(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},$(FM,"MapScope"),FM),MZt=(zM=class{constructor(e,r,n){this.elements=new pb,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?da(n).concat(this.outerScope.getElements(e)):da(n)}getAllElements(){let e=da(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},$(zM,"MultiMapScope"),zM),SKn={getElement(){},getElements(){return S3},getAllElements(){return S3}},Fne=(UM=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")}},$(UM,"DisposableCache"),UM),x3e=(VM=class extends Fne{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()}},$(VM,"SimpleCache"),VM),zne=(QM=class extends Fne{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}},$(QM,"ContextCache"),QM),IZt=(GM=class extends zne{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 o of a)this.clear(o)}))}},$(GM,"DocumentCache"),GM),w3e=(HM=class extends x3e{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()}))}},$(HM,"WorkspaceCache"),HM),PZt=(WM=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 w3e(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=Wg(e.container).localSymbols;if(i){let o=e.container;do i.has(o)&&r.push(i.getStream(o).filter(s=>this.reflection.isSubtype(s.type,n))),o=o.$container;while(o)}let a=this.getGlobalScope(n,e);for(let o=r.length-1;o>=0;o--)a=this.createScope(r[o],a);return a}createScope(e,r,n){return new b3e(da(e),r,n)}createScopeForNodes(e,r,n){const i=da(e).map(a=>{const o=this.nameProvider.getName(a);if(o)return this.descriptions.createDescription(a,o)}).nonNullable();return new b3e(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new MZt(this.indexManager.allElements(e)))}},$(WM,"DefaultScopeProvider"),WM);function A3e(t){return typeof t.$comment=="string"}$(A3e,"isAstNodeWithComment");function S3e(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}$(S3e,"isIntermediateReference");var NZt=(YM=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=$((s,l)=>this.replacer(s,l,n),"defaultReplacer"),o=i?(s,l)=>i(s,l,a):a;try{return this.currentDocument=Wg(e),JSON.stringify(e,o,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:o,uriConverter:s}){var l,u,h;if(!this.ignoreProperties.has(e))if(oh(r)){const d=r.ref,f=n?r.$refText:void 0;if(d){const p=Wg(d);let g="";this.currentDocument&&this.currentDocument!==p&&(s?g=s(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(ov(r)){const d=n?r.$refText:void 0,f=[];for(const p of r.items){const g=p.ref,m=Wg(p.ref);let v="";this.currentDocument&&this.currentDocument!==m&&(s?v=s(m.uri,g):v=m.uri.toString());const y=this.astNodeLocator.getAstNodePath(g);f.push(`${v}#${y}`)}return{$refs:f,$refText:d}}else if(Xs(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),o){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 o=cRe(e.$cstNode,a).map(r);o.length!==0&&(i[a]=o)}),e}}linkNode(e,r,n,i,a,o){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(qO(a))throw a;console.error(`${r}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const o=a instanceof Error?a.message:String(a);n("error",`${r}: ${o}`,{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=da(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,o,s)=>{await this.handleException(()=>e.call(n,i,a,o,s),r,a,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},$(jM,"ValidationRegistry"),jM),FZt=Object.freeze({validateNode:!0,validateChildren:!0}),zZt=(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=Ha.CancellationToken.None){const i=e.parseResult,a=[];if(await jl(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(o=>{var s;return((s=o.data)==null?void 0:s.code)===Vp.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(o=>{var s;return((s=o.data)==null?void 0:s.code)===Vp.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(o=>{var s;return((s=o.data)==null?void 0:s.code)===Vp.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(o){if(qO(o))throw o;console.error("An error occurred during validation:",o)}return await jl(n),a}processLexingErrors(e,r,n){var a;const i=[...e.lexerErrors,...((a=e.lexerReport)==null?void 0:a.diagnostics)??[]];for(const o of i){const s=o.severity??"error",l={severity:Fz(s),range:{start:{line:o.line-1,character:o.column-1},end:{line:o.line-1,character:o.column+o.length-1}},message:o.message,data:C3e(s),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 o=i.previousToken;if(isNaN(o.startOffset)){const s={line:0,character:0};a={start:s,end:s}}else{const s={line:o.endLine-1,character:o.endColumn};a={start:s,end:s}}}}else a=q9(i.token);if(a){const o={severity:Fz("error"),range:a,message:i.message,data:XO(Vp.ParsingError),source:this.getSource()};r.push(o)}}}processLinkingErrors(e,r,n){var i;for(const a of e.references){const o=a.error;if(o){const s={node:o.info.container,range:(i=a.$refNode)==null?void 0:i.range,property:o.info.property,index:o.info.index,data:{code:Vp.LinkingError,containerType:o.info.container.$type,property:o.info.property,refText:o.info.reference.$refText}};r.push(this.toDiagnostic("error",o.message,s))}}}async validateAst(e,r,n=Ha.CancellationToken.None){const i=[],a=$((o,s,l)=>{i.push(this.toDiagnostic(o,s,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=Ha.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const o of a)await jl(i),await o(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=Ha.CancellationToken.None){var a;if((a=this.profiler)!=null&&a.isActive("validating")){const o=this.profiler.createTask("validating",this.languageId);o.start();try{const s=Yg(e).iterator();for(const l of s){o.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{o.stopSubTask(l.$type)}u.validateChildren||s.prune()}}finally{o.stop()}}else{const o=Yg(e).iterator();for(const s of o){await jl(i);const l=this.validateSingleNodeOptions(s,r);if(l.validateNode){const u=this.validationRegistry.getChecks(s.$type,r.categories);for(const h of u)await h(s,n,i)}l.validateChildren||o.prune()}}}validateSingleNodeOptions(e,r){return FZt}async validateAstAfter(e,r,n,i=Ha.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const o of a)await jl(i),await o(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:T3e(n),severity:Fz(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 T3e(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=mre(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=uRe(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}}}$(T3e,"getDiagnosticRange");function Fz(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)}}$(Fz,"toDiagnosticSeverity");function C3e(t){switch(t){case"error":return XO(Vp.LexingError);case"warning":return XO(Vp.LexingWarning);case"info":return XO(Vp.LexingInfo);case"hint":return XO(Vp.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}$(C3e,"toDiagnosticData");var Vp;(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"})(Vp||(Vp={}));var UZt=(KM=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??Wg(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 o;const s=$(()=>o??(o=B3(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return s()},selectionSegment:B3(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}},$(KM,"DefaultAstNodeDescriptionProvider"),KM),VZt=(ZM=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=Ha.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of Yg(i))await jl(r),k3(a).forEach(o=>{o.reference.error||n.push(...this.createInfoDescriptions(o))});return n}createInfoDescriptions(e){const r=e.reference;if(r.error||!r.$refNode)return[];let n=[];oh(r)&&r.$nodeDescription?n=[r.$nodeDescription]:ov(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=Wg(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),o=[],s=B3(r.$refNode);for(const l of n)o.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:s,local:ph.equals(l.documentUri,i)});return o}},$(ZM,"DefaultReferenceDescriptionProvider"),ZM),QZt=(JM=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 o=a.indexOf(this.indexSeparator);if(o>0){const s=a.substring(0,o),l=parseInt(a.substring(o+1)),u=i[s];return u==null?void 0:u[l]}return i[a]},e)}},$(JM,"DefaultAstNodeLocator"),JM),Vne={};kte(Vne,d_e(w3()));var GZt=(eI=class{constructor(e){this._ready=new fb,this.onConfigurationSectionUpdateEmitter=new Vne.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}},$(eI,"DefaultConfigurationProvider"),eI),Qne=d_e(nzn()),KO;(function(t){function e(r){return{dispose:$(async()=>await r(),"dispose")}}$(e,"create"),t.create=e})(KO||(KO={}));var HZt=(tI=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new pb,this.documentPhaseListeners=new pb,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=ui.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=Ha.CancellationToken.None){var i;for(const a of e){const o=a.uri.toString();if(a.state===ui.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(a,ui.IndexedReferences);else if(typeof r.validation=="object"){const s=this.findMissingValidationCategories(a,r);s.length>0&&(this.buildState.set(o,{completed:!1,options:{validation:{categories:s}},result:(i=this.buildState.get(o))==null?void 0:i.result}),a.state=ui.IndexedReferences)}}else this.buildState.delete(o)}this.currentState=ui.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=Ha.CancellationToken.None){this.currentState=ui.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=ui.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,ui.Changed)}const o=da(a).concat(i).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!o.has(l.uri.toString())&&this.shouldRelink(l,o)).forEach(l=>this.resetToState(l,ui.ComputedScopes)),await this.emitUpdate(a,i),await jl(n);const s=this.sortDocuments(this.langiumDocuments.all.filter(l=>{var u;return l.state=1}findMissingValidationCategories(e,r){var s,l;const n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=(s=n==null?void 0:n.result)!=null&&s.validationChecks?new Set((l=n==null?void 0:n.result)==null?void 0:l.validationChecks):n!=null&&n.completed?i:new Set,o=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return da(o).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),KO.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case ui.Changed:case ui.Parsed:this.indexManager.removeContent(e.uri);case ui.IndexedContent:e.localSymbols=void 0;case ui.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case ui.Linked:this.indexManager.removeReferences(e.uri);case ui.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case ui.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=ui.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,ui.Parsed,n,o=>this.langiumDocumentFactory.update(o,n)),await this.runCancelable(e,ui.IndexedContent,n,o=>this.indexManager.updateContent(o,n)),await this.runCancelable(e,ui.ComputedScopes,n,async o=>{const s=this.serviceRegistry.getServices(o.uri).references.ScopeComputation;o.localSymbols=await s.collectLocalSymbols(o,n)});const i=e.filter(o=>this.shouldLink(o));await this.runCancelable(i,ui.Linked,n,o=>this.serviceRegistry.getServices(o.uri).references.Linker.link(o,n)),await this.runCancelable(i,ui.IndexedReferences,n,o=>this.indexManager.updateReferences(o,n));const a=e.filter(o=>this.shouldValidate(o)?!0:(this.markAsCompleted(o),!1));await this.runCancelable(a,ui.Validated,n,async o=>{await this.validate(o,n),this.markAsCompleted(o)})}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 o of e)o.stateo.state===r);await this.notifyBuildPhase(a,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),KO.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),KO.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=Ha.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(vv);if(this.currentState>=e&&e>i.state)return Promise.reject(new Qne.ResponseError(Qne.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${ui[i.state]}, requiring ${ui[e]}, but workspace state is already ${ui[this.currentState]}. Returning undefined.`))}else return Promise.reject(new Qne.ResponseError(Qne.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,o)=>{const s=this.onDocumentPhase(e,u=>{ph.equals(u.uri,r)&&(s.dispose(),l.dispose(),a(u.uri))}),l=n.onCancellationRequested(()=>{s.dispose(),l.dispose(),o(vv)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(vv):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),o.dispose(),n()}),o=r.onCancellationRequested(()=>{a.dispose(),o.dispose(),i(vv)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const o of a)try{await jl(n),await o(e,n)}catch(s){if(!qO(s))throw s}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const a=this.buildPhaseListeners.get(r).slice();for(const o of a)await jl(n),await o(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 o=await n.validateDocument(e,a,r);e.diagnostics?e.diagnostics.push(...o):e.diagnostics=o;const s=this.buildState.get(e.uri.toString());s&&(s.result??(s.result={}),s.result.validationChecks?s.result.validationChecks=da(s.result.validationChecks).concat(a.categories).distinct().toArray():s.result.validationChecks=[...a.categories])}getBuildOptions(e){var r;return((r=this.buildState.get(e.uri.toString()))==null?void 0:r.options)??{}}},$(tI,"DefaultDocumentBuilder"),tI),WZt=(rI=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new zne,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=Wg(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(o=>{ph.equals(o.targetUri,n)&&o.targetPath===r&&i.push(o)})}),da(i)}allElements(e,r){let n=da(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=Ha.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=Ha.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}},$(rI,"DefaultIndexManager"),rI),YZt=(nI=class{constructor(e){this.initialBuildOptions={},this._ready=new fb,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=Ha.CancellationToken.None){const n=await this.performStartup(e);await jl(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=$(o=>{r.push(o),this.langiumDocuments.hasDocument(o.uri)||this.langiumDocuments.addDocument(o)},"collector");await this.loadAdditionalDocuments(e,n);const i=[];await Promise.all(e.map(o=>this.getRootFolder(o)).map(async o=>this.traverseFolder(o,i)));const a=da(i).distinct(o=>o.toString()).filter(o=>!this.langiumDocuments.hasDocument(o));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 Af.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=ph.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},$(nI,"DefaultWorkspaceManager"),nI),qZt=(iI=class{buildUnexpectedCharactersMessage(e,r,n,i,a){return i4e.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return i4e.buildUnableToPopLexerModeMessage(e)}},$(iI,"DefaultLexerErrorMessageProvider"),iI),O3e={mode:"full"},k3e=(aI=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=Wne(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new hh(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=O3e){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(Wne(e))return e;const r=Hne(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},$(aI,"DefaultLexer"),aI);function Gne(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}$(Gne,"isTokenTypeArray");function Hne(t){return t&&"modes"in t&&"defaultMode"in t}$(Hne,"isIMultiModeLexerDefinition");function Wne(t){return!Gne(t)&&!Hne(t)}$(Wne,"isTokenTypeDictionary"),I9();function E3e(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=ea.create(0,0));const a=R3e(t),o=qne(n),s=XZt({lines:a,position:i,options:o});return JZt({index:0,tokens:s,position:i})}$(E3e,"parseJSDoc");function _3e(t,e){const r=qne(e),n=R3e(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],o=r.start,s=r.end;return!!(o!=null&&o.exec(i))&&!!(s!=null&&s.exec(a))}$(_3e,"isJSDoc");function R3e(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(MUt)}$(R3e,"getLines");var jZt=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,TKn=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function XZt(t){var i,a,o;const e=[];let r=t.position.line,n=t.position.character;for(let s=0;s=h.length){if(e.length>0){const p=ea.create(r,n);e.push({type:"break",content:"",range:Ri.create(p,p)})}}else{jZt.lastIndex=d;const p=jZt.exec(h);if(p){const g=p[0],m=p[1],v=ea.create(r,n+d),y=ea.create(r,n+d+g.length);e.push({type:"tag",content:m,range:Ri.create(v,y)}),d+=g.length,d=Yne(h,d)}if(d0&&e[e.length-1].type==="break"?e.slice(0,-1):e}$(XZt,"tokenize");function KZt(t,e,r,n){const i=[];if(t.length===0){const a=ea.create(r,n),o=ea.create(r,n+e.length);i.push({type:"text",content:e,range:Ri.create(a,o)})}else{let a=0;for(const s of t){const l=s.index,u=e.substring(a,l);u.length>0&&i.push({type:"text",content:e.substring(a,l),range:Ri.create(ea.create(r,a+n),ea.create(r,l+n))});let h=u.length+1;const d=s[1];if(i.push({type:"inline-tag",content:d,range:Ri.create(ea.create(r,a+h+n),ea.create(r,a+h+d.length+n))}),h+=d.length,s.length===4){h+=s[2].length;const f=s[3];i.push({type:"text",content:f,range:Ri.create(ea.create(r,a+h+n),ea.create(r,a+h+f.length+n))})}else i.push({type:"text",content:"",range:Ri.create(ea.create(r,a+h+n),ea.create(r,a+h+n))});a=l+s[0].length}const o=e.substring(a);o.length>0&&i.push({type:"text",content:o,range:Ri.create(ea.create(r,a+n),ea.create(r,a+n+o.length))})}return i}$(KZt,"buildInlineTokens");var CKn=/\S/,OKn=/\s*$/;function Yne(t,e){const r=t.substring(e).match(CKn);return r?e+r.index:t.length}$(Yne,"skipWhitespace");function ZZt(t){const e=t.match(OKn);if(e&&typeof e.index=="number")return e.index}$(ZZt,"lastCharacter");function JZt(t){var a,o;const e=ea.create(t.position.line,t.position.character);if(t.tokens.length===0)return new nJt([],Ri.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+=N3e(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+=N3e(r)+i}return r.trim()}},$(oI,"JSDocCommentImpl"),oI),I3e=(sI=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=iJt(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}},$(sI,"JSDocTagImpl"),sI);function iJt(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const s=Yne(e,i);a=e.substring(s),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))??aJt(e,a)}}$(iJt,"renderInlineTag");function aJt(t,e){try{return Af.parse(t,!0),`[${e}](${t})`}catch{return t}}$(aJt,"renderLinkDefault");var P3e=(lI=class{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;rn.range.start.line&&(e+=` +For Further details.`,n}$(YKt,"buildAmbiguityError");function qKt(t){if(t instanceof uh)return"SUBRULE";if(t instanceof Dc)return"OPTION";if(t instanceof cd)return"OR";if(t instanceof xf)return"AT_LEAST_ONE";if(t instanceof wf)return"AT_LEAST_ONE_SEP";if(t instanceof ld)return"MANY_SEP";if(t instanceof ns)return"MANY";if(t instanceof go)return"CONSUME";throw Error("non exhaustive match")}$(qKt,"getProductionDslName");function jKt(t,e,r){const n=XXn(e.configs.elements,a=>a.state.transitions),i=cKn(n.filter(a=>a instanceof G4e).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}$(jKt,"buildAdaptivePredictError");function XKt(t,e){return t.edges[e.tokenTypeIdx]}$(XKt,"getExistingTargetState");function KKt(t,e,r){const n=new j4e,i=[];for(const o of t.elements){if(r.is(o.alt)===!1)continue;if(o.state.type===Pz){i.push(o);continue}const s=o.state.transitions.length;for(let l=0;l0&&!rZt(a))for(const o of i)a.add(o);return a}$(KKt,"computeReachSet");function ZKt(t,e){if(t instanceof G4e&&o4e(e,t.tokenType))return t.target}$(ZKt,"getReachableTarget");function JKt(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}$(JKt,"getUniqueAlt");function e3e(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}$(e3e,"newDFAState");function t3e(t,e,r,n){return n=r3e(t,n),e.edges[r.tokenTypeIdx]=n,n}$(t3e,"addDFAEdge");function r3e(t,e){if(e===Sne)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}$(r3e,"addDFAState");function eZt(t){const e=new j4e,r=t.transitions.length;for(let n=0;n0){const i=[...t.stack],o={state:i.pop(),alt:t.alt,stack:i};Nz(o,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}$(oZt,"hasConflictingAltSet");function sZt(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}$(sZt,"hasStateAssociatedWithOneAlt"),I9();var lZt=(pM=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new i3e(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new One;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new Cne(e.startOffset,e.image.length,q9(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 o=new Cne(a.startOffset,a.image.length,q9(a),a.tokenType,!0);o.root=this.rootNode,r.push(o)}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)}},$(pM,"CstNodeBuilder"),pM),n3e=(gM=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)}},$(gM,"AbstractCstNode"),gM),Cne=(mM=class extends n3e{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}},$(mM,"LeafCstNodeImpl"),mM),One=(vM=class extends n3e{constructor(){super(...arguments),this.content=new wKn(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]}},$(vM,"CompositeCstNodeImpl"),vM),wKn=(wk=class extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,wk.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}},$(wk,"CstNodeContainer"),wk),i3e=(yM=class extends One{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}},$(yM,"RootCstNodeImpl"),yM),kne=Symbol("Datatype");function Ene(t){return t.$type===kne}$(Ene,"isDataTypeNode");var cZt="​",uZt=$(t=>t.endsWith(cZt)?t:t+cZt,"withRuleSuffix"),a3e=(bM=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 SKn(r,{...e.parser.ParserConfig,skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new pZt(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()}},$(bM,"AbstractLangiumParser"),bM),hZt=(xM=class extends a3e{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new lZt,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;_3(e)&&(i=e.name,this.registerPrecedenceMap(e));const a=this.wrapper.DEFINE_RULE(uZt(e.name),this.startImplementation(n,i,r).bind(this));return this.allRules.set(e.name,a),lh(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 o={$type:e};this.stack.push(o),e===kne?o.value="":r!==void 0&&(o.$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 o=this.nodeBuilder.buildLeafNode(i,n),{assignment:s,crossRef:l}=this.getAssignment(n),u=this.current;if(s){const h=rb(n)?i.image:this.converter.convert(i.image,o);this.assign(s.operator,s.feature,h,o,l)}else if(Ene(u)){let h=i.image;rb(n)||(h=this.converter.convert(h,o).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 o;!this.isRecording()&&!n&&(o=this.nodeBuilder.buildCompositeNode(i));let s;try{s=this.wrapper.wrapSubrule(e,r,a)}finally{this.isRecording()||(s===void 0&&!n&&(s=this.construct()),s!==void 0&&o&&o.length>0&&this.performSubruleAssignment(s,i,o))}}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 o=this.current;if(Ene(o))o.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,o);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)):Ene(e)?this.converter.convert(e.value,e.$cstNode):(w5e(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,o=-1;for(let m=0;mo?(o=y.precedence,a=m):y.precedence===o&&(y.rightAssoc||(a=m))}const s=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:s},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=cO(e,eb);this.assignmentMap.set(e,{assignment:r,crossRef:r&&hO(r.terminal)?r.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,r,n,i,a){const o=this.current;let s;switch(a==="single"&&typeof n=="string"?s=this.linker.buildReference(o,r,i,n):a==="multi"&&typeof n=="string"?s=this.linker.buildMultiReference(o,r,i,n):s=n,e){case"=":{o[r]=s;break}case"?=":{o[r]=!0;break}case"+=":Array.isArray(o[r])||(o[r]=[]),o[r].push(s)}}assignWithoutOverride(e,r){for(const[i,a]of Object.entries(r)){const o=e[i];o===void 0?e[i]=a:Array.isArray(o)&&Array.isArray(a)&&(a.push(...o),e[i]=a)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}},$(xM,"LangiumParser"),xM),dZt=(wM=class{buildMismatchTokenMessage(e){return j3.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return j3.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return j3.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return j3.buildEarlyExitMessage(e)}},$(wM,"AbstractParserErrorMessageProvider"),wM),o3e=(AM=class extends dZt{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}\`.`}},$(AM,"LangiumParserErrorMessageProvider"),AM),fZt=(SM=class extends a3e{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(uZt(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}},$(SM,"LangiumCompletionParser"),SM),AKn={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new o3e},pZt=(TM=class extends lYn{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,{...AKn,lookaheadStrategy:n?new b4e({maxLookahead:r.maxLookahead}):new xKn({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,{})}},$(TM,"ChevrotainWrapper"),TM),SKn=(CM=class extends pZt{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))}}},$(CM,"ProfilerWrapper"),CM);function _ne(t,e,r){return gZt({parser:e,tokens:r,ruleNames:new Map},t),e}$(_ne,"createParser");function gZt(t,e){const r=gre(e,!1),n=da(e.rules).filter(lh).filter(a=>r.has(a));for(const a of n){const o={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(a,Iw(o,a.definition))}const i=da(e.rules).filter(_3).filter(a=>r.has(a));for(const a of i)t.parser.rule(a,mZt(t,a))}$(gZt,"buildRules");function mZt(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(Bp(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},o={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(a,o);const l={$container:o,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:n}},u={...a,$container:o};o.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=Rne(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")})}}$(mZt,"buildInfixRule");function Iw(t,e,r=!1){let n;if(rb(e))n=SZt(t,e);else if(Aw(e))n=vZt(t,e);else if(eb(e))n=Iw(t,e.terminal);else if(hO(e))n=s3e(t,e);else if(nb(e))n=yZt(t,e);else if(Vte(e))n=xZt(t,e);else if(are(e))n=wZt(t,e);else if(fO(e))n=AZt(t,e);else if(E5e(e)){const i=t.consume++;n=$(()=>t.parser.consume(i,Rw,e),"method")}else throw new lre(e.$cstNode,`Unexpected element type: ${e.$type}`);return l3e(t,r?void 0:Bz(e),n,e.cardinality)}$(Iw,"buildElement");function vZt(t,e){const r=OO(e);return()=>t.parser.action(r,e)}$(vZt,"buildAction");function yZt(t,e){const r=e.rule.ref;if(uO(r)){const n=t.subrule++,i=lh(r)&&r.fragment,a=e.arguments.length>0?bZt(r,e.arguments):()=>({});let o;return s=>{o??(o=Rne(t,r)),t.parser.subrule(n,o,i,e,a(s))}}else if(Bp(r)){const n=t.consume++,i=Dne(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)kw();else throw new lre(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}$(yZt,"buildRuleCall");function bZt(t,e){if(e.some(n=>n.calledByName)){const n=e.map(i=>{var a,o;return{parameterName:(o=(a=i.parameter)==null?void 0:a.ref)==null?void 0:o.name,predicate:tm(i.value)}});return i=>{const a={};for(const{parameterName:o,predicate:s}of n)o&&(a[o]=s(i));return a}}else{const n=e.map(i=>tm(i.value));return i=>{const a={};for(let o=0;oe(n)||r(n)}else if(O5e(t)){const e=tm(t.left),r=tm(t.right);return n=>e(n)&&r(n)}else if(D5e(t)){const e=tm(t.value);return r=>!e(r)}else if(L5e(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(T5e(t)){const e=!!t.true;return()=>e}kw()}$(tm,"buildPredicate");function xZt(t,e){if(e.elements.length===1)return Iw(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:Iw(t,i,!0)},o=Bz(i);o&&(a.GATE=tm(o)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const o={ALT:$(()=>a.ALT(i),"ALT")},s=a.GATE;return s&&(o.GATE=()=>s(i)),o}))}}$(xZt,"buildAlternatives");function wZt(t,e){if(e.elements.length===1)return Iw(t,e.elements[0]);const r=[];for(const s of e.elements){const l={ALT:Iw(t,s,!0)},u=Bz(s);u&&(l.GATE=tm(u)),r.push(l)}const n=t.or++,i=$((s,l)=>{const u=l.getRuleStack().join("-");return`uGroup_${s}_${u}`},"idFunc"),a=$(s=>t.parser.alternatives(n,r.map((l,u)=>{const h={ALT:$(()=>!0,"ALT")},d=t.parser;h.ALT=()=>{if(l.ALT(s),!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(s):h.GATE=()=>{const p=d.unorderedGroups.get(i(n,d));return!(p!=null&&p[u])},h})),"alternatives"),o=l3e(t,Bz(e),a,"*");return s=>{o(s),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}$(wZt,"buildUnorderedGroup");function AZt(t,e){const r=e.elements.map(n=>Iw(t,n));return n=>r.forEach(i=>i(n))}$(AZt,"buildGroup");function Bz(t){if(fO(t))return t.guardCondition}$(Bz,"getGuardCondition");function s3e(t,e,r=e.terminal){if(r)if(nb(r)&&lh(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;let a;return o=>{a??(a=Rne(t,n)),t.parser.subrule(i,a,!1,e,o)}}else if(nb(r)&&Bp(r.rule.ref)){const n=t.consume++,i=Dne(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(rb(r)){const n=t.consume++,i=Dne(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=bre(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+OO(e.type.ref));return s3e(t,e,i)}}$(s3e,"buildCrossReference");function SZt(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)}$(SZt,"buildKeyword");function l3e(t,e,r,n){const i=e&&tm(e);if(!n)if(i){const a=t.or++;return o=>t.parser.alternatives(a,[{ALT:$(()=>r(o),"ALT"),GATE:$(()=>i(o),"GATE")},{ALT:C4e(),GATE:$(()=>!i(o),"GATE")}])}else return r;if(n==="*"){const a=t.many++;return o=>t.parser.many(a,{DEF:$(()=>r(o),"DEF"),GATE:i?()=>i(o):void 0})}else if(n==="+"){const a=t.many++;if(i){const o=t.or++;return s=>t.parser.alternatives(o,[{ALT:$(()=>t.parser.atLeastOne(a,{DEF:$(()=>r(s),"DEF")}),"ALT"),GATE:$(()=>i(s),"GATE")},{ALT:C4e(),GATE:$(()=>!i(s),"GATE")}])}else return o=>t.parser.atLeastOne(a,{DEF:$(()=>r(o),"DEF")})}else if(n==="?"){const a=t.optional++;return o=>t.parser.optional(a,{DEF:$(()=>r(o),"DEF"),GATE:i?()=>i(o):void 0})}else kw()}$(l3e,"wrap");function Rne(t,e){const r=TZt(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}$(Rne,"getRule");function TZt(t,e){if(uO(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!lh(n);)(fO(n)||Vte(n)||are(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}$(TZt,"getRuleName");function Dne(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}$(Dne,"getToken");function c3e(t){const e=t.Grammar,r=t.parser.Lexer,n=new fZt(t);return _ne(e,n,r.definition),n.finalize(),n}$(c3e,"createCompletionParser");function u3e(t){const e=h3e(t);return e.finalize(),e}$(u3e,"createLangiumParser");function h3e(t){const e=t.Grammar,r=t.parser.Lexer,n=new hZt(t);return _ne(e,n,r.definition)}$(h3e,"prepareLangiumParser");var Lne=(OM=class{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=da(gre(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(Bp).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=K9(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=pre(r)?hh.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(uO).flatMap(i=>J1(i).filter(rb)).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(F3(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&&rRe("^"+a.source+"$",e.value)&&n.push(i),n},[])}},$(OM,"DefaultTokenBuilder"),OM),d3e=(kM=class{convert(e,r){let n=r.grammarSource;if(hO(n)&&(n=sRe(n)),nb(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 mv.convertInt(r);case"STRING":return mv.convertString(r);case"ID":return mv.convertID(r)}switch((i=mRe(e))==null?void 0:i.toLowerCase()){case"number":return mv.convertNumber(r);case"boolean":return mv.convertBoolean(r);case"bigint":return mv.convertBigint(r);case"date":return mv.convertDate(r);default:return r}}},$(kM,"DefaultValueConverter"),kM),mv;(function(t){function e(u){let h="";for(let d=1;d{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}$(Mne,"delayNextTick");var Ine=0,CZt=10;function Pne(){return Ine=performance.now(),new Ha.CancellationTokenSource}$(Pne,"startCancelableOperation");function f3e(t){CZt=t}$(f3e,"setInterruptionPeriod");var vv=Symbol("OperationCancelled");function qO(t){return t===vv}$(qO,"isOperationCancelled");async function jl(t){if(t===Ha.CancellationToken.None)return;const e=performance.now();if(e-Ine>=CZt&&(Ine=e,await Mne(),Ine=performance.now()),t.isCancellationRequested)throw vv}$(jl,"interruptAndCheck");var fb=(EM=class{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}},$(EM,"Deferred"),EM),OZt=(Hw=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(Hw.isIncremental(n)){const i=m3e(n.range),a=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(o,this._content.length);const s=Math.max(i.start.line,0),l=Math.max(i.end.line,0);let u=this._lineOffsets;const h=p3e(n.text,!1,a);if(l-s===h.length)for(let f=0,p=h.length;fe?i=o:n=o+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&&g3e(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}},$(Hw,"FullTextDocument"),Hw),Nne;(function(t){function e(i,a,o,s){return new OZt(i,a,o,s)}$(e,"create"),t.create=e;function r(i,a,o){if(i instanceof OZt)return i.update(a,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}$(r,"update"),t.update=r;function n(i,a){const o=i.getText(),s=Bne(a.map(kZt),(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 s){const d=i.offsetAt(h.range.start);if(dl&&u.push(o.substring(l,d)),h.newText.length&&u.push(h.newText),l=i.offsetAt(h.range.end)}return u.push(o.substr(l)),u.join("")}$(n,"applyEdits"),t.applyEdits=n})(Nne||(Nne={}));function Bne(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);Bne(n,e),Bne(i,e);let a=0,o=0,s=0;for(;ar.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}$(m3e,"getWellformedRange");function kZt(t){const e=m3e(t.range);return e!==t.range?{newText:t.newText,range:e}:t}$(kZt,"getWellformedEdit");var EZt;(()=>{var t={975:L=>{function R(I){if(typeof I!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(I))}$(R,"e");function D(I,N){for(var F,B="",V=0,z=-1,U=0,Q=0;Q<=I.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+="/"+I.slice(z+1,Q):B=I.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 I,N="",F=!1,B=arguments.length-1;B>=-1&&!F;B--){var V;B>=0?V=arguments[B]:(I===void 0&&(I=process.cwd()),V=I),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(I){if(R(I),I.length===0)return".";var N=I.charCodeAt(0)===47,F=I.charCodeAt(I.length-1)===47;return(I=D(I,!N)).length!==0||N||(I="."),I.length>0&&F&&(I+="/"),N?"/"+I:I},"normalize"),isAbsolute:$(function(I){return R(I),I.length>0&&I.charCodeAt(0)===47},"isAbsolute"),join:$(function(){if(arguments.length===0)return".";for(var I,N=0;N0&&(I===void 0?I=F:I+="/"+F)}return I===void 0?".":M.normalize(I)},"join"),relative:$(function(I,N){if(R(I),R(N),I===N||(I=M.resolve(I))===(N=M.resolve(N)))return"";for(var F=1;FQ){if(N.charCodeAt(z+q)===47)return N.slice(z+q+1);if(q===0)return N.slice(z+q)}else V>Q&&(I.charCodeAt(F+q)===47?G=q:q===0&&(G=0));break}var Y=I.charCodeAt(F+q);if(Y!==N.charCodeAt(z+q))break;Y===47&&(G=q)}var ne="";for(q=F+G+1;q<=B;++q)q!==B&&I.charCodeAt(q)!==47||(ne.length===0?ne+="..":ne+="/..");return ne.length>0?ne+N.slice(z+G):(z+=G,N.charCodeAt(z)===47&&++z,N.slice(z))},"relative"),_makeLong:$(function(I){return I},"_makeLong"),dirname:$(function(I){if(R(I),I.length===0)return".";for(var N=I.charCodeAt(0),F=N===47,B=-1,V=!0,z=I.length-1;z>=1;--z)if((N=I.charCodeAt(z))===47){if(!V){B=z;break}}else V=!1;return B===-1?F?"/":".":F&&B===1?"//":I.slice(0,B)},"dirname"),basename:$(function(I,N){if(N!==void 0&&typeof N!="string")throw new TypeError('"ext" argument must be a string');R(I);var F,B=0,V=-1,z=!0;if(N!==void 0&&N.length>0&&N.length<=I.length){if(N.length===I.length&&N===I)return"";var U=N.length-1,Q=-1;for(F=I.length-1;F>=0;--F){var G=I.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=I.length),I.slice(B,V)}for(F=I.length-1;F>=0;--F)if(I.charCodeAt(F)===47){if(!z){B=F+1;break}}else V===-1&&(z=!1,V=F+1);return V===-1?"":I.slice(B,V)},"basename"),extname:$(function(I){R(I);for(var N=-1,F=0,B=-1,V=!0,z=0,U=I.length-1;U>=0;--U){var Q=I.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?"":I.slice(N,B)},"extname"),format:$(function(I){if(I===null||typeof I!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof I);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,I)},"format"),parse:$(function(I){R(I);var N={root:"",dir:"",base:"",ext:"",name:""};if(I.length===0)return N;var F,B=I.charCodeAt(0),V=B===47;V?(N.root="/",F=1):F=0;for(var z=-1,U=0,Q=-1,G=!0,q=I.length-1,Y=0;q>=F;--q)if((B=I.charCodeAt(q))!==47)Q===-1&&(G=!1,Q=q+1),B===46?z===-1?z=q:Y!==1&&(Y=1):z!==-1&&(Y=-1);else if(!G){U=q+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?I.slice(1,Q):I.slice(U,Q)):(U===0&&V?(N.name=I.slice(1,z),N.base=I.slice(1,Q)):(N.name=I.slice(U,z),N.base=I.slice(U,Q)),N.ext=I.slice(z,Q)),U>0?N.dir=I.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+.-]*$/,o=/^\//,s=/^\/\//;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(!o.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(s.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,I,N,F=!1){Pr(this,"scheme");Pr(this,"authority");Pr(this,"path");Pr(this,"query");Pr(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=I||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:I,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),I===void 0?I=this.path:I===null&&(I=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&&I===this.path&&N===this.query&&F===this.fragment?this:new g(D,M,I,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,P=class P extends f{constructor(){super(...arguments);Pr(this,"_formatted",null);Pr(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}};$(P,"d");let g=P;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,I=-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)I!==-1&&(M+=encodeURIComponent(L.substring(I,N)),I=-1),M!==void 0&&(M+=L.charAt(N));else{M===void 0&&(M=L.substr(0,N));const B=m[F];B!==void 0?(I!==-1&&(M+=encodeURIComponent(L.substring(I,N)),I=-1),M+=B):I===-1&&(I=N)}}return I!==-1&&(M+=encodeURIComponent(L.substring(I))),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:I,authority:N,path:F,query:B,fragment:V}=L;if(I&&(M+=I,M+=":"),(N||I==="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 C=T.posix||T,k="/";var E;(function(L){L.joinPath=function(R,...D){return R.with({path:C.join(R.path,...D)})},L.resolvePath=function(R,...D){let M=R.path,I=!1;M[0]!==k&&(M=k+M,I=!0);let N=C.resolve(M,...D);return I&&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=C.dirname(R.path);return D.length===1&&D.charCodeAt(0)===46&&(D=""),R.with({path:D})},L.basename=function(R){return C.basename(R.path)},L.extname=function(R){return C.extname(R.path)}})(E||(E={})),EZt=n})();var{URI:Af,Utils:$z}=EZt,ph;(function(t){t.basename=$z.basename,t.dirname=$z.dirname,t.extname=$z.extname,t.joinPath=$z.joinPath,t.resolvePath=$z.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function r(o,s){return(o==null?void 0:o.toString())===(s==null?void 0:s.toString())}$(r,"equals"),t.equals=r;function n(o,s){const l=typeof o=="string"?Af.parse(o).path:o.path,u=typeof s=="string"?Af.parse(s).path:s.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:ph.joinPath(Af.parse(r),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const r=this.getNode(ph.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 o=i.children.get(a);if(!o)if(r)o={name:a,children:new Map,parent:i},i.children.set(a,o);else return;i=o}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}},$(_M,"UriTrie"),_M),ui;(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"})(ui||(ui={}));var _Zt=(RM=class{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=Ha.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??Af.parse(e.uri),Ha.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return Ha.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:ui.Parsed,references:[],textDocument:n};else{const o=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:ui.Parsed,references:[],get textDocument(){return o()}}}return e.value.$document=a,a}async update(e,r){var o,s;const n=(o=e.parseResult.value.$cstNode)==null?void 0:o.root.fullText,i=(s=this.textDocuments)==null?void 0:s.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=ui.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=Nne.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}},$(RM,"DefaultLangiumDocumentFactory"),RM),RZt=(DM=class{constructor(e){this.documentTrie=new v3e,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return da(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,ui.Changed),n}deleteDocument(e){const r=e.toString(),n=this.documentTrie.find(r);return n&&(n.state=ui.Changed,this.documentTrie.delete(r)),n}deleteDocuments(e){const r=e.toString(),n=this.documentTrie.findAll(r);for(const i of n)i.state=ui.Changed;return this.documentTrie.delete(r),n}},$(DM,"DefaultLangiumDocuments"),DM),jO=Symbol("RefResolving"),DZt=(LM=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=Ha.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 Yg(e.parseResult.value))await jl(r),k3(a).forEach(o=>{const s=`${a.$type}:${o.property}`;i.startSubTask(s);try{this.doLink(o,e)}finally{i.stopSubTask(s)}})}finally{i.stop()}}else for(const i of Yg(e.parseResult.value))await jl(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=jO;try{const i=this.getCandidate(e);if(sO(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=jO;try{const i=this.getCandidates(e),a=[];if(sO(i))n._linkingError=i;else for(const o of i){const s=this.loadAstNode(o);s&&a.push({ref:s,$nodeDescription:o})}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,o={$refNode:n,$refText:i,_ref:void 0,get ref(){if(Xs(this._ref))return this._ref;if(y5e(this._nodeDescription)){const s=a.loadAstNode(this._nodeDescription);this._ref=s??a.createLinkingError({reference:o,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=jO;const s=O3(e).$document,l=a.getLinkedNode({reference:o,container:e,property:r});if(l.error&&s&&s.state0))return this._linkingError=a.createLinkingError({reference:o,container:e,property:r})}};return o}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(sO(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=O3(e.container).$document;n&&n.statehO(r)&&r.isMulti)}findDeclarations(e){if(e){const r=hRe(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(oh(i)||ov(i))return $te(i);if(Array.isArray(i)){for(const a of i)if((oh(a)||ov(a))&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return $te(a)}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||V5e(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(ov(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=>ph.equals(a.sourceUri,r.documentUri))),n.push(...i),da(n)}getSelfReferences(e){const r=this.getSelfNodes(e),n=[];for(const i of r){const a=this.nameProvider.getNameNode(i);if(a){const o=Wg(i),s=this.nodeLocator.getAstNodePath(i);n.push({sourceUri:o.uri,sourcePath:s,targetUri:o.uri,targetPath:s,segment:B3(a),local:!0})}}return n}},$(IM,"DefaultReferences"),IM),pb=(PM=class{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return B9.sum(da(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?da(r):S3}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 da(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return da(this.map.keys())}values(){return da(this.map.values()).flat()}entriesGroupedByKey(){return da(this.map.entries())}},$(PM,"MultiMap"),PM),$ne=(NM=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}},$(NM,"BiMap"),NM),IZt=(BM=class{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,r=Ha.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,r)}async collectExportedSymbolsForNode(e,r,n=$9,i=Ha.CancellationToken.None){const a=[];this.addExportedSymbol(e,a,r);for(const o of n(e))await jl(i),this.addExportedSymbol(o,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=Ha.CancellationToken.None){const n=e.parseResult.value,i=new pb;for(const a of J1(n))await jl(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))}}},$(BM,"DefaultScopeComputation"),BM),b3e=($M=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}},$($M,"StreamScope"),$M),TKn=(FM=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?da(i).concat(this.outerScope.getElements(e)):da(i)}getAllElements(){let e=da(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},$(FM,"MapScope"),FM),PZt=(zM=class{constructor(e,r,n){this.elements=new pb,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?da(n).concat(this.outerScope.getElements(e)):da(n)}getAllElements(){let e=da(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}},$(zM,"MultiMapScope"),zM),CKn={getElement(){},getElements(){return S3},getAllElements(){return S3}},Fne=(UM=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")}},$(UM,"DisposableCache"),UM),x3e=(VM=class extends Fne{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()}},$(VM,"SimpleCache"),VM),zne=(QM=class extends Fne{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}},$(QM,"ContextCache"),QM),NZt=(GM=class extends zne{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 o of a)this.clear(o)}))}},$(GM,"DocumentCache"),GM),w3e=(HM=class extends x3e{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()}))}},$(HM,"WorkspaceCache"),HM),BZt=(WM=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 w3e(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=Wg(e.container).localSymbols;if(i){let o=e.container;do i.has(o)&&r.push(i.getStream(o).filter(s=>this.reflection.isSubtype(s.type,n))),o=o.$container;while(o)}let a=this.getGlobalScope(n,e);for(let o=r.length-1;o>=0;o--)a=this.createScope(r[o],a);return a}createScope(e,r,n){return new b3e(da(e),r,n)}createScopeForNodes(e,r,n){const i=da(e).map(a=>{const o=this.nameProvider.getName(a);if(o)return this.descriptions.createDescription(a,o)}).nonNullable();return new b3e(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new PZt(this.indexManager.allElements(e)))}},$(WM,"DefaultScopeProvider"),WM);function A3e(t){return typeof t.$comment=="string"}$(A3e,"isAstNodeWithComment");function S3e(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}$(S3e,"isIntermediateReference");var $Zt=(YM=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=$((s,l)=>this.replacer(s,l,n),"defaultReplacer"),o=i?(s,l)=>i(s,l,a):a;try{return this.currentDocument=Wg(e),JSON.stringify(e,o,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:o,uriConverter:s}){var l,u,h;if(!this.ignoreProperties.has(e))if(oh(r)){const d=r.ref,f=n?r.$refText:void 0;if(d){const p=Wg(d);let g="";this.currentDocument&&this.currentDocument!==p&&(s?g=s(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(ov(r)){const d=n?r.$refText:void 0,f=[];for(const p of r.items){const g=p.ref,m=Wg(p.ref);let v="";this.currentDocument&&this.currentDocument!==m&&(s?v=s(m.uri,g):v=m.uri.toString());const y=this.astNodeLocator.getAstNodePath(g);f.push(`${v}#${y}`)}return{$refs:f,$refText:d}}else if(Xs(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),o){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 o=cRe(e.$cstNode,a).map(r);o.length!==0&&(i[a]=o)}),e}}linkNode(e,r,n,i,a,o){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(qO(a))throw a;console.error(`${r}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const o=a instanceof Error?a.message:String(a);n("error",`${r}: ${o}`,{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=da(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,o,s)=>{await this.handleException(()=>e.call(n,i,a,o,s),r,a,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}},$(jM,"ValidationRegistry"),jM),UZt=Object.freeze({validateNode:!0,validateChildren:!0}),VZt=(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=Ha.CancellationToken.None){const i=e.parseResult,a=[];if(await jl(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(o=>{var s;return((s=o.data)==null?void 0:s.code)===Vp.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(o=>{var s;return((s=o.data)==null?void 0:s.code)===Vp.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(o=>{var s;return((s=o.data)==null?void 0:s.code)===Vp.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(o){if(qO(o))throw o;console.error("An error occurred during validation:",o)}return await jl(n),a}processLexingErrors(e,r,n){var a;const i=[...e.lexerErrors,...((a=e.lexerReport)==null?void 0:a.diagnostics)??[]];for(const o of i){const s=o.severity??"error",l={severity:Fz(s),range:{start:{line:o.line-1,character:o.column-1},end:{line:o.line-1,character:o.column+o.length-1}},message:o.message,data:C3e(s),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 o=i.previousToken;if(isNaN(o.startOffset)){const s={line:0,character:0};a={start:s,end:s}}else{const s={line:o.endLine-1,character:o.endColumn};a={start:s,end:s}}}}else a=q9(i.token);if(a){const o={severity:Fz("error"),range:a,message:i.message,data:XO(Vp.ParsingError),source:this.getSource()};r.push(o)}}}processLinkingErrors(e,r,n){var i;for(const a of e.references){const o=a.error;if(o){const s={node:o.info.container,range:(i=a.$refNode)==null?void 0:i.range,property:o.info.property,index:o.info.index,data:{code:Vp.LinkingError,containerType:o.info.container.$type,property:o.info.property,refText:o.info.reference.$refText}};r.push(this.toDiagnostic("error",o.message,s))}}}async validateAst(e,r,n=Ha.CancellationToken.None){const i=[],a=$((o,s,l)=>{i.push(this.toDiagnostic(o,s,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=Ha.CancellationToken.None){const a=this.validationRegistry.checksBefore;for(const o of a)await jl(i),await o(e,n,r.categories??[],i)}async validateAstNodes(e,r,n,i=Ha.CancellationToken.None){var a;if((a=this.profiler)!=null&&a.isActive("validating")){const o=this.profiler.createTask("validating",this.languageId);o.start();try{const s=Yg(e).iterator();for(const l of s){o.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{o.stopSubTask(l.$type)}u.validateChildren||s.prune()}}finally{o.stop()}}else{const o=Yg(e).iterator();for(const s of o){await jl(i);const l=this.validateSingleNodeOptions(s,r);if(l.validateNode){const u=this.validationRegistry.getChecks(s.$type,r.categories);for(const h of u)await h(s,n,i)}l.validateChildren||o.prune()}}}validateSingleNodeOptions(e,r){return UZt}async validateAstAfter(e,r,n,i=Ha.CancellationToken.None){const a=this.validationRegistry.checksAfter;for(const o of a)await jl(i),await o(e,n,r.categories??[],i)}toDiagnostic(e,r,n){return{message:r,range:T3e(n),severity:Fz(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 T3e(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=mre(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=uRe(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}}}$(T3e,"getDiagnosticRange");function Fz(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)}}$(Fz,"toDiagnosticSeverity");function C3e(t){switch(t){case"error":return XO(Vp.LexingError);case"warning":return XO(Vp.LexingWarning);case"info":return XO(Vp.LexingInfo);case"hint":return XO(Vp.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}$(C3e,"toDiagnosticData");var Vp;(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"})(Vp||(Vp={}));var QZt=(KM=class{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??Wg(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 o;const s=$(()=>o??(o=B3(this.nameProvider.getNameNode(e)??e.$cstNode)),"nameSegmentGetter");return{node:e,name:r,get nameSegment(){return s()},selectionSegment:B3(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}},$(KM,"DefaultAstNodeDescriptionProvider"),KM),GZt=(ZM=class{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=Ha.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of Yg(i))await jl(r),k3(a).forEach(o=>{o.reference.error||n.push(...this.createInfoDescriptions(o))});return n}createInfoDescriptions(e){const r=e.reference;if(r.error||!r.$refNode)return[];let n=[];oh(r)&&r.$nodeDescription?n=[r.$nodeDescription]:ov(r)&&(n=r.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));const i=Wg(e.container).uri,a=this.nodeLocator.getAstNodePath(e.container),o=[],s=B3(r.$refNode);for(const l of n)o.push({sourceUri:i,sourcePath:a,targetUri:l.documentUri,targetPath:l.path,segment:s,local:ph.equals(l.documentUri,i)});return o}},$(ZM,"DefaultReferenceDescriptionProvider"),ZM),HZt=(JM=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 o=a.indexOf(this.indexSeparator);if(o>0){const s=a.substring(0,o),l=parseInt(a.substring(o+1)),u=i[s];return u==null?void 0:u[l]}return i[a]},e)}},$(JM,"DefaultAstNodeLocator"),JM),Vne={};kte(Vne,d_e(w3()));var WZt=(eI=class{constructor(e){this._ready=new fb,this.onConfigurationSectionUpdateEmitter=new Vne.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}},$(eI,"DefaultConfigurationProvider"),eI),Qne=d_e(azn()),KO;(function(t){function e(r){return{dispose:$(async()=>await r(),"dispose")}}$(e,"create"),t.create=e})(KO||(KO={}));var YZt=(tI=class{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new pb,this.documentPhaseListeners=new pb,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=ui.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=Ha.CancellationToken.None){var i;for(const a of e){const o=a.uri.toString();if(a.state===ui.Validated){if(typeof r.validation=="boolean"&&r.validation)this.resetToState(a,ui.IndexedReferences);else if(typeof r.validation=="object"){const s=this.findMissingValidationCategories(a,r);s.length>0&&(this.buildState.set(o,{completed:!1,options:{validation:{categories:s}},result:(i=this.buildState.get(o))==null?void 0:i.result}),a.state=ui.IndexedReferences)}}else this.buildState.delete(o)}this.currentState=ui.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=Ha.CancellationToken.None){this.currentState=ui.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=ui.Changed,this.langiumDocuments.addDocument(u)),this.resetToState(u,ui.Changed)}const o=da(a).concat(i).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!o.has(l.uri.toString())&&this.shouldRelink(l,o)).forEach(l=>this.resetToState(l,ui.ComputedScopes)),await this.emitUpdate(a,i),await jl(n);const s=this.sortDocuments(this.langiumDocuments.all.filter(l=>{var u;return l.state=1}findMissingValidationCategories(e,r){var s,l;const n=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),a=(s=n==null?void 0:n.result)!=null&&s.validationChecks?new Set((l=n==null?void 0:n.result)==null?void 0:l.validationChecks):n!=null&&n.completed?i:new Set,o=r===void 0||r.validation===!0?i:typeof r.validation=="object"?r.validation.categories??i:[];return da(o).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),KO.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}resetToState(e,r){switch(r){case ui.Changed:case ui.Parsed:this.indexManager.removeContent(e.uri);case ui.IndexedContent:e.localSymbols=void 0;case ui.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case ui.Linked:this.indexManager.removeReferences(e.uri);case ui.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case ui.Validated:}e.state>r&&(e.state=r)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=ui.Changed}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,ui.Parsed,n,o=>this.langiumDocumentFactory.update(o,n)),await this.runCancelable(e,ui.IndexedContent,n,o=>this.indexManager.updateContent(o,n)),await this.runCancelable(e,ui.ComputedScopes,n,async o=>{const s=this.serviceRegistry.getServices(o.uri).references.ScopeComputation;o.localSymbols=await s.collectLocalSymbols(o,n)});const i=e.filter(o=>this.shouldLink(o));await this.runCancelable(i,ui.Linked,n,o=>this.serviceRegistry.getServices(o.uri).references.Linker.link(o,n)),await this.runCancelable(i,ui.IndexedReferences,n,o=>this.indexManager.updateReferences(o,n));const a=e.filter(o=>this.shouldValidate(o)?!0:(this.markAsCompleted(o),!1));await this.runCancelable(a,ui.Validated,n,async o=>{await this.validate(o,n),this.markAsCompleted(o)})}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 o of e)o.stateo.state===r);await this.notifyBuildPhase(a,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),KO.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),KO.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;return r&&"path"in r?i=r:n=r,n??(n=Ha.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(vv);if(this.currentState>=e&&e>i.state)return Promise.reject(new Qne.ResponseError(Qne.LSPErrorCodes.RequestFailed,`Document state of ${r.toString()} is ${ui[i.state]}, requiring ${ui[e]}, but workspace state is already ${ui[this.currentState]}. Returning undefined.`))}else return Promise.reject(new Qne.ResponseError(Qne.LSPErrorCodes.ServerCancelled,`No document found for URI: ${r.toString()}`));return new Promise((a,o)=>{const s=this.onDocumentPhase(e,u=>{ph.equals(u.uri,r)&&(s.dispose(),l.dispose(),a(u.uri))}),l=n.onCancellationRequested(()=>{s.dispose(),l.dispose(),o(vv)})})}awaitBuilderState(e,r){return this.currentState>=e?Promise.resolve():r.isCancellationRequested?Promise.reject(vv):new Promise((n,i)=>{const a=this.onBuildPhase(e,()=>{a.dispose(),o.dispose(),n()}),o=r.onCancellationRequested(()=>{a.dispose(),o.dispose(),i(vv)})})}async notifyDocumentPhase(e,r,n){const a=this.documentPhaseListeners.get(r).slice();for(const o of a)try{await jl(n),await o(e,n)}catch(s){if(!qO(s))throw s}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const a=this.buildPhaseListeners.get(r).slice();for(const o of a)await jl(n),await o(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 o=await n.validateDocument(e,a,r);e.diagnostics?e.diagnostics.push(...o):e.diagnostics=o;const s=this.buildState.get(e.uri.toString());s&&(s.result??(s.result={}),s.result.validationChecks?s.result.validationChecks=da(s.result.validationChecks).concat(a.categories).distinct().toArray():s.result.validationChecks=[...a.categories])}getBuildOptions(e){var r;return((r=this.buildState.get(e.uri.toString()))==null?void 0:r.options)??{}}},$(tI,"DefaultDocumentBuilder"),tI),qZt=(rI=class{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new zne,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=Wg(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(o=>{ph.equals(o.targetUri,n)&&o.targetPath===r&&i.push(o)})}),da(i)}allElements(e,r){let n=da(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=Ha.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=Ha.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}},$(rI,"DefaultIndexManager"),rI),jZt=(nI=class{constructor(e){this.initialBuildOptions={},this._ready=new fb,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=Ha.CancellationToken.None){const n=await this.performStartup(e);await jl(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=[],n=$(o=>{r.push(o),this.langiumDocuments.hasDocument(o.uri)||this.langiumDocuments.addDocument(o)},"collector");await this.loadAdditionalDocuments(e,n);const i=[];await Promise.all(e.map(o=>this.getRootFolder(o)).map(async o=>this.traverseFolder(o,i)));const a=da(i).distinct(o=>o.toString()).filter(o=>!this.langiumDocuments.hasDocument(o));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 Af.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=ph.basename(e.uri);return r.startsWith(".")?!1:e.isDirectory?r!=="node_modules"&&r!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}},$(nI,"DefaultWorkspaceManager"),nI),XZt=(iI=class{buildUnexpectedCharactersMessage(e,r,n,i,a){return i4e.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return i4e.buildUnableToPopLexerModeMessage(e)}},$(iI,"DefaultLexerErrorMessageProvider"),iI),O3e={mode:"full"},k3e=(aI=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=Wne(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new hh(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=O3e){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(Wne(e))return e;const r=Hne(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}},$(aI,"DefaultLexer"),aI);function Gne(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}$(Gne,"isTokenTypeArray");function Hne(t){return t&&"modes"in t&&"defaultMode"in t}$(Hne,"isIMultiModeLexerDefinition");function Wne(t){return!Gne(t)&&!Hne(t)}$(Wne,"isTokenTypeDictionary"),I9();function E3e(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=ea.create(0,0));const a=R3e(t),o=qne(n),s=ZZt({lines:a,position:i,options:o});return tJt({index:0,tokens:s,position:i})}$(E3e,"parseJSDoc");function _3e(t,e){const r=qne(e),n=R3e(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],o=r.start,s=r.end;return!!(o!=null&&o.exec(i))&&!!(s!=null&&s.exec(a))}$(_3e,"isJSDoc");function R3e(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(PUt)}$(R3e,"getLines");var KZt=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,OKn=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function ZZt(t){var i,a,o;const e=[];let r=t.position.line,n=t.position.character;for(let s=0;s=h.length){if(e.length>0){const p=ea.create(r,n);e.push({type:"break",content:"",range:Ri.create(p,p)})}}else{KZt.lastIndex=d;const p=KZt.exec(h);if(p){const g=p[0],m=p[1],v=ea.create(r,n+d),y=ea.create(r,n+d+g.length);e.push({type:"tag",content:m,range:Ri.create(v,y)}),d+=g.length,d=Yne(h,d)}if(d0&&e[e.length-1].type==="break"?e.slice(0,-1):e}$(ZZt,"tokenize");function JZt(t,e,r,n){const i=[];if(t.length===0){const a=ea.create(r,n),o=ea.create(r,n+e.length);i.push({type:"text",content:e,range:Ri.create(a,o)})}else{let a=0;for(const s of t){const l=s.index,u=e.substring(a,l);u.length>0&&i.push({type:"text",content:e.substring(a,l),range:Ri.create(ea.create(r,a+n),ea.create(r,l+n))});let h=u.length+1;const d=s[1];if(i.push({type:"inline-tag",content:d,range:Ri.create(ea.create(r,a+h+n),ea.create(r,a+h+d.length+n))}),h+=d.length,s.length===4){h+=s[2].length;const f=s[3];i.push({type:"text",content:f,range:Ri.create(ea.create(r,a+h+n),ea.create(r,a+h+f.length+n))})}else i.push({type:"text",content:"",range:Ri.create(ea.create(r,a+h+n),ea.create(r,a+h+n))});a=l+s[0].length}const o=e.substring(a);o.length>0&&i.push({type:"text",content:o,range:Ri.create(ea.create(r,a+n),ea.create(r,a+n+o.length))})}return i}$(JZt,"buildInlineTokens");var kKn=/\S/,EKn=/\s*$/;function Yne(t,e){const r=t.substring(e).match(kKn);return r?e+r.index:t.length}$(Yne,"skipWhitespace");function eJt(t){const e=t.match(EKn);if(e&&typeof e.index=="number")return e.index}$(eJt,"lastCharacter");function tJt(t){var a,o;const e=ea.create(t.position.line,t.position.character);if(t.tokens.length===0)return new aJt([],Ri.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+=N3e(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+=N3e(r)+i}return r.trim()}},$(oI,"JSDocCommentImpl"),oI),I3e=(sI=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=oJt(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}},$(sI,"JSDocTagImpl"),sI);function oJt(t,e,r){var n;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let a=e;if(i>0){const s=Yne(e,i);a=e.substring(s),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))??sJt(e,a)}}$(oJt,"renderInlineTag");function sJt(t,e){try{return Af.parse(t,!0),`[${e}](${t})`}catch{return t}}$(sJt,"renderLinkDefault");var P3e=(lI=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+=` -`)}return r}},$(lI,"JSDocTextImpl"),lI),oJt=(cI=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},$(cI,"JSDocLineImpl"),cI);function N3e(t){return t.endsWith(` +`)}return r}},$(lI,"JSDocTextImpl"),lI),lJt=(cI=class{constructor(e,r){this.text=e,this.range=r}toString(){return this.text}toMarkdown(){return this.text}},$(cI,"JSDocLineImpl"),cI);function N3e(t){return t.endsWith(` `)?` `:` -`}$(N3e,"fillNewlines");var sJt=(uI=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&_3e(r))return E3e(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,o=i.nameSegment.range.start.character+1,s=i.documentUri.with({fragment:`L${a},${o}`});return`[${n}](${s.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const i=Wg(e).localSymbols;if(!i)return;let a=e;do{const s=i.getStream(a).find(l=>l.name===r);if(s)return s;a=a.$container}while(a)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}},$(uI,"JSDocDocumentationProvider"),uI),lJt=(hI=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return A3e(e)?e.$comment:(r=W5e(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},$(hI,"DefaultCommentProvider"),hI),cJt=(dI=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},$(dI,"DefaultAsyncParser"),dI),kKn=(fI=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 fb;let a;const o=r.onCancellationRequested(()=>{a=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(s=>{const l=this.hydrator.hydrate(s);i.resolve(l)}).catch(s=>{i.reject(s)}).finally(()=>{o.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 fb;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(vv)}),this.queue.push(r),r.promise}},$(fI,"AbstractThreadedAsyncParser"),fI),EKn=(pI=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new Vne.Emitter,this.deferred=new fb,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(a=>{const o=a;this.deferred.resolve(o),this.unlock()}),n(a=>{this.deferred.reject(a),this.unlock()})}terminate(){this.deferred.reject(vv),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 fb,this.sendMessage(e),this.deferred.promise}},$(pI,"ParserWorker"),pI),uJt=(gI=class{constructor(){this.previousTokenSource=new Ha.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=Pne();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=Ha.CancellationToken.None){const i=new fb,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){qO(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},$(gI,"DefaultWorkspaceLock"),gI),hJt=(mI=class{constructor(e){this.grammarElementIdMap=new $ne,this.tokenTypeIdMap=new $ne,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 Yg(e))r.set(i,{});if(e.$cstNode)for(const i of N3(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 o=[];n[i]=o;for(const s of a)Xs(s)?o.push(this.dehydrateAstNode(s,r)):oh(s)?o.push(this.dehydrateReference(s,r)):o.push(s)}else Xs(a)?n[i]=this.dehydrateAstNode(a,r):oh(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 Bte(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Z1(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):lO(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 Yg(e))r.set(a,{});let i;if(e.$cstNode)for(const a of N3(e.$cstNode)){let o;"fullText"in a?(o=new i3e(a.fullText),i=o):"content"in a?o=new One:"tokenType"in a&&(o=this.hydrateCstLeafNode(a)),o&&(n.set(a,o),o.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 o=[];n[i]=o;for(const s of a)Xs(s)?o.push(this.setParent(this.hydrateAstNode(s,r),n)):oh(s)?o.push(this.hydrateReference(s,n,i,r)):o.push(s)}else Xs(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):oh(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),Z1(i))for(const a of e.content){const o=this.hydrateCstNode(a,r,n++);i.content.push(o)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,a=e.startLine,o=e.startColumn,s=e.endLine,l=e.endColumn,u=e.hidden;return new Cne(n,i,{start:{line:a,character:o},end:{line:s,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 Yg(this.grammar))Ute(r)&&this.grammarElementIdMap.set(r,e++)}},$(mI,"DefaultHydrator"),mI);function Xl(t){return{documentation:{CommentProvider:$(e=>new lJt(e),"CommentProvider"),DocumentationProvider:$(e=>new sJt(e),"DocumentationProvider")},parser:{AsyncParser:$(e=>new cJt(e),"AsyncParser"),GrammarConfig:$(e=>yRe(e),"GrammarConfig"),LangiumParser:$(e=>u3e(e),"LangiumParser"),CompletionParser:$(e=>c3e(e),"CompletionParser"),ValueConverter:$(()=>new d3e,"ValueConverter"),TokenBuilder:$(()=>new Lne,"TokenBuilder"),Lexer:$(e=>new k3e(e),"Lexer"),ParserErrorMessageProvider:$(()=>new o3e,"ParserErrorMessageProvider"),LexerErrorMessageProvider:$(()=>new qZt,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:$(()=>new QZt,"AstNodeLocator"),AstNodeDescriptionProvider:$(e=>new UZt(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:$(e=>new VZt(e),"ReferenceDescriptionProvider")},references:{Linker:$(e=>new _Zt(e),"Linker"),NameProvider:$(()=>new RZt,"NameProvider"),ScopeProvider:$(e=>new PZt(e),"ScopeProvider"),ScopeComputation:$(e=>new LZt(e),"ScopeComputation"),References:$(e=>new DZt(e),"References")},serializer:{Hydrator:$(e=>new hJt(e),"Hydrator"),JsonSerializer:$(e=>new NZt(e),"JsonSerializer")},validation:{DocumentValidator:$(e=>new zZt(e),"DocumentValidator"),ValidationRegistry:$(e=>new $Zt(e),"ValidationRegistry")},shared:$(()=>t.shared,"shared")}}$(Xl,"createDefaultCoreModule");function Kl(t){return{ServiceRegistry:$(e=>new BZt(e),"ServiceRegistry"),workspace:{LangiumDocuments:$(e=>new EZt(e),"LangiumDocuments"),LangiumDocumentFactory:$(e=>new kZt(e),"LangiumDocumentFactory"),DocumentBuilder:$(e=>new HZt(e),"DocumentBuilder"),IndexManager:$(e=>new WZt(e),"IndexManager"),WorkspaceManager:$(e=>new YZt(e),"WorkspaceManager"),FileSystemProvider:$(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:$(()=>new uJt,"WorkspaceLock"),ConfigurationProvider:$(e=>new GZt(e),"ConfigurationProvider")},profilers:{}}}$(Kl,"createDefaultSharedCoreModule");var B3e;(function(t){t.merge=(e,r)=>tD(tD({},e),r)})(B3e||(B3e={}));function Mi(t,e,r,n,i,a,o,s,l){const u=[t,e,r,n,i,a,o,s,l].reduce(tD,{});return F3e(u)}$(Mi,"inject");var dJt=Symbol("isProxy");function $3e(t){if(t&&t[dJt])for(const e of Object.values(t))$3e(e);return t}$($3e,"eagerLoad");function F3e(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===dJt?!0:z3e(n,i,t,e||r),"get"),getOwnPropertyDescriptor:$((n,i)=>(z3e(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:$((n,i)=>i in t,"has"),ownKeys:$(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}$(F3e,"_inject");var fJt=Symbol();function z3e(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]===fJt)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]=fJt;try{t[e]=typeof i=="function"?i(n):F3e(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}$(z3e,"_resolve");function tD(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]=tD(i,n):t[r]=tD({},n)}else t[r]=n}return t}$(tD,"_merge");var U3e={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},ZO;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(ZO||(ZO={}));var pJt=(vI=class extends Lne{constructor(e=U3e){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...U3e,...e},this.indentTokenType=q3({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=q3({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!Gne(n))throw new Error("Invalid tokens built by default builder");const{indentTokenName:i,dedentTokenName:a,whitespaceTokenName:o,ignoreIndentationDelimiters:s}=this.options;let l,u,h;const d=[];for(const f of n){for(const[p,g]of s)f.name===p?f.PUSH_MODE=ZO.IGNORE_INDENTATION:f.name===g&&(f.POP_MODE=!0);f.name===a?l=f:f.name===i?u=f:f.name===o?h=f:d.push(f)}if(!l||!u||!h)throw new Error("Some indentation/whitespace tokens not found!");return s.length>0?{modes:{[ZO.REGULAR]:[l,u,...d,h],[ZO.IGNORE_INDENTATION]:[...d,h]},defaultMode:ZO.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 Tz(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:o,match:s}=this.matchWhitespace(e,r,n,i);return a<=o?null:(this.indentationStack.push(a),s)}dedentMatcher(e,r,n,i){var d,f;if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:o,match:s}=this.matchWhitespace(e,r,n,i);if(a>=o)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=s==null?void 0:s[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}},$(vI,"IndentationAwareTokenBuilder"),vI),_Kn=(yI=class extends k3e{constructor(e){if(super(e),e.parser.TokenBuilder instanceof pJt)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=O3e){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:o}=this.indentationTokenBuilder,s=a.tokenTypeIdx,l=o.tokenTypeIdx,u=[],h=n.tokens.length-1;for(let d=0;d=0&&u.push(n.tokens[h]),n.tokens=u,n}},$(yI,"IndentationAwareLexer"),yI),V3e={};xw(V3e,{AstUtils:()=>x5e,BiMap:()=>$ne,Cancellation:()=>Ha,ContextCache:()=>zne,CstUtils:()=>v5e,DONE_RESULT:()=>sh,Deferred:()=>fb,Disposable:()=>KO,DisposableCache:()=>Fne,DocumentCache:()=>IZt,EMPTY_STREAM:()=>S3,ErrorWithLocation:()=>lre,GrammarUtils:()=>K5e,MultiMap:()=>pb,OperationCancelled:()=>vv,Reduction:()=>B9,RegExpUtils:()=>J5e,SimpleCache:()=>x3e,StreamImpl:()=>sv,TreeStreamImpl:()=>T3,URI:()=>Af,UriTrie:()=>v3e,UriUtils:()=>ph,WorkspaceCache:()=>w3e,assertCondition:()=>Z5e,assertUnreachable:()=>kw,delayNextTick:()=>Mne,interruptAndCheck:()=>jl,isOperationCancelled:()=>qO,loadGrammarFromJson:()=>Zl,setInterruptionPeriod:()=>f3e,startCancelableOperation:()=>Pne,stream:()=>da}),kte(V3e,Vne);var gJt=(bI=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[]}},$(bI,"EmptyFileSystemProvider"),bI),Lc={fileSystemProvider:$(()=>new gJt,"fileSystemProvider")},RKn={Grammar:$(()=>{},"Grammar"),LanguageMetaData:$(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},DKn={AstReflection:$(()=>new U5e,"AstReflection")};function mJt(){const t=Mi(Kl(Lc),DKn),e=Mi(Xl({shared:t}),RKn);return t.ServiceRegistry.register(e),e}$(mJt,"createMinimalGrammarServices");function Zl(t){const e=mJt(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,Af.parse(`memory:/${r.name??"grammar"}.langium`)),r}$(Zl,"loadGrammarFromJson"),kte(nUt,V3e);var LKn=(xI=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new pb}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 vJt(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 o of r.entries.keys()){const s=r.entries.get(o),l=s.reduce((u,h)=>u+h);n.push({name:`${r.identifier}.${o}`,count:s.length,duration:l})}const i=r.duration-n.map(o=>o.duration).reduce((o,s)=>o+s,0);n.push({name:r.identifier,count:1,duration:i}),n.sort((o,s)=>s.duration-o.duration);function a(o){return Math.round(100*o)/100}return $(a,"Round"),console.table(n.map(o=>({Element:o.name,Count:o.count,"Self %":a(100*o.duration/r.duration),"Time (ms)":a(o.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])}},$(xI,"DefaultLangiumProfiler"),xI),vJt=(wI=class{constructor(e,r){this.stack=[],this.entries=new pb,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)}},$(wI,"ProfilingTask"),wI),Q3e;(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]+)\]/}})(Q3e||(Q3e={}));var G3e;(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]*/}})(G3e||(G3e={}));var H3e;(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]*/}})(H3e||(H3e={}));var W3e;(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])?/}})(W3e||(W3e={}));var Y3e;(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]*/}})(Y3e||(Y3e={}));var q3e;(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]*/}})(q3e||(q3e={}));var j3e;(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]*/}})(j3e||(j3e={}));var X3e;(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]*/}})(X3e||(X3e={}));var K3e;(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]*/}})(K3e||(K3e={}));var Z3e;(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]*?\*\)/}})(Z3e||(Z3e={}));var J3e;(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]*?\*\//}})(J3e||(J3e={}));var eDe;(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]*/}})(eDe||(eDe={}));var tDe;(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:/"[^"]*"|'[^']*'/}})(tDe||(tDe={}));var rDe;(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])*/}})(rDe||(rDe={}));var nDe;(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]*/}})(nDe||(nDe={})),{...Q3e.Terminals,...G3e.Terminals,...H3e.Terminals,...W3e.Terminals,...Y3e.Terminals,...q3e.Terminals,...j3e.Terminals,...X3e.Terminals,...K3e.Terminals,...Z3e.Terminals,...J3e.Terminals,...eDe.Terminals,...rDe.Terminals,...tDe.Terminals,...nDe.Terminals};var yJt={$type:"AbnfAlternation",alternatives:"alternatives"},bJt={$type:"AbnfConcatenation",elements:"elements"},iDe={$type:"AbnfElement",primary:"primary",repeat:"repeat"},xJt={$type:"AbnfGroup",element:"element"},wJt={$type:"AbnfNumVal",value:"value"},AJt={$type:"AbnfOptionalGroup",element:"element"},rD={$type:"AbnfPrimary"},aDe={$type:"AbnfRule",definition:"definition",name:"name"},SJt={$type:"AbnfRuleName",name:"name"},TJt={$type:"AbnfStringLiteral",value:"value"},Xne={$type:"Accelerator",name:"name",x:"x",y:"y"},oDe={$type:"Alignment",direction:"direction",members:"members"},Kne={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},zz={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},sDe={$type:"Annotations",x:"x",y:"y"},yv={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function MKn(t){return Ts.isInstance(t,yv.$type)}$(MKn,"isArchitecture");var Zne={$type:"Axis",label:"label",name:"name"},Jne={$type:"Branch",name:"name",order:"order"};function IKn(t){return Ts.isInstance(t,Jne.$type)}$(IKn,"isBranch");var CJt={$type:"Checkout",branch:"branch"},eie={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},lDe={$type:"ClassDefStatement",className:"className",styleText:"styleText"},nD={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function PKn(t){return Ts.isInstance(t,nD.$type)}$(PKn,"isCommit");var tie={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},JO={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},rie={$type:"Curve",entries:"entries",label:"label",name:"name"},ek={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function NKn(t){return Ts.isInstance(t,ek.$type)}$(NKn,"isCynefin");var nie={$type:"Deaccelerator",name:"name",x:"x",y:"y"},OJt={$type:"Decorator",strategy:"strategy"},iD={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},iie={$type:"DomainBlock",domain:"domain",items:"items"};function BKn(t){return Ts.isInstance(t,iie.$type)}$(BKn,"isDomainBlock");var cDe={$type:"DomainItem",label:"label"};function $Kn(t){return Ts.isInstance(t,cDe.$type)}$($Kn,"isDomainItem");var kJt={$type:"EbnfChoice",alternatives:"alternatives"},EJt={$type:"EbnfExceptionPostfix",except:"except"},_Jt={$type:"EbnfGroup",element:"element"},RJt={$type:"EbnfNonTerminal",name:"name"},DJt={$type:"EbnfOneOrMorePostfix",operator:"operator"},LJt={$type:"EbnfOptional",element:"element"},MJt={$type:"EbnfOptionalPostfix",operator:"operator"},Uz={$type:"EbnfPostfix"},tk={$type:"EbnfPrimary"},IJt={$type:"EbnfRepetition",element:"element"},uDe={$type:"EbnfRule",definition:"definition",name:"name"},PJt={$type:"EbnfSequence",elements:"elements"},NJt={$type:"EbnfSpecial",text:"text"},hDe={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},BJt={$type:"EbnfTerminal",value:"value"},$Jt={$type:"EbnfZeroOrMorePostfix",operator:"operator"},bv={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},aD={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},rk={$type:"EmFrame"},Vz={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},FJt={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},dDe={$type:"EmModelEntity",name:"name"};function FKn(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}$(FKn,"isEmModelEntityType");var aie={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},gb={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function zJt(t){return Ts.isInstance(t,gb.$type)}$(zJt,"isEmResetFrame");var Pw={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},fDe={$type:"Entry",axis:"axis",value:"value"},mb={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},UJt={$type:"Evolution",stages:"stages"},oie={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},pDe={$type:"Evolve",component:"component",target:"target"},nk={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function zKn(t){return Ts.isInstance(t,nk.$type)}$(zKn,"isGitGraph");var Qz={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},Gz={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function UKn(t){return Ts.isInstance(t,Gz.$type)}$(UKn,"isInfo");var Hz={$type:"Item",classSelector:"classSelector",name:"name"},gDe={$type:"Junction",id:"id",in:"in"},Wz={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},sie={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},ik={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},oD={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function VKn(t){return Ts.isInstance(t,oD.$type)}$(VKn,"isMerge");var lie={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},mDe={$type:"Option",name:"name",value:"value"},sD={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function QKn(t){return Ts.isInstance(t,sD.$type)}$(QKn,"isPacket");var lD={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function GKn(t){return Ts.isInstance(t,lD.$type)}$(GKn,"isPacketBlock");var VJt={$type:"PegAny",dot:"dot"},QJt={$type:"PegGroup",element:"element"},GJt={$type:"PegIdentifier",name:"name"},HJt={$type:"PegLiteral",value:"value"},WJt={$type:"PegOrderedChoice",alternatives:"alternatives"},vDe={$type:"PegPrefix",operator:"operator",suffix:"suffix"},Yz={$type:"PegPrimary"},yDe={$type:"PegRule",definition:"definition",name:"name"},YJt={$type:"PegSequence",elements:"elements"},bDe={$type:"PegSuffix",operator:"operator",primary:"primary"},ak={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function HKn(t){return Ts.isInstance(t,ak.$type)}$(HKn,"isPie");var cie={$type:"PieSection",label:"label",value:"value"};function WKn(t){return Ts.isInstance(t,cie.$type)}$(WKn,"isPieSection");var xDe={$type:"Pipeline",components:"components",parent:"parent"},uie={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},ok={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},cD={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function YKn(t){return Ts.isInstance(t,cD.$type)}$(YKn,"isRailroad");var uD={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function qKn(t){return Ts.isInstance(t,uD.$type)}$(qKn,"isRailroadAbnf");var qJt={$type:"RailroadChoiceExpr",alternatives:"alternatives"},hD={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function jKn(t){return Ts.isInstance(t,hD.$type)}$(jKn,"isRailroadEbnf");var vb={$type:"RailroadExpression"},jJt={$type:"RailroadNonTerminalExpr",name:"name"},XJt={$type:"RailroadOneOrMoreExpr",element:"element"},KJt={$type:"RailroadOptionalExpr",element:"element"},dD={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function XKn(t){return Ts.isInstance(t,dD.$type)}$(XKn,"isRailroadPeg");var wDe={$type:"RailroadRule",definition:"definition",name:"name"},ZJt={$type:"RailroadSequenceExpr",elements:"elements"},JJt={$type:"RailroadSpecialExpr",text:"text"},eer={$type:"RailroadTerminalExpr",value:"value"},ter={$type:"RailroadZeroOrMoreExpr",element:"element"},ADe={$type:"Section",classSelector:"classSelector",name:"name"},fD={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},SDe={$type:"Size",height:"height",width:"width"},pD={$type:"Statement"},qz={$type:"Transition",from:"from",label:"label",to:"to"};function KKn(t){return Ts.isInstance(t,qz.$type)}$(KKn,"isTransition");var gD={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function ZKn(t){return Ts.isInstance(t,gD.$type)}$(ZKn,"isTreemap");var TDe={$type:"TreemapRow",indent:"indent",item:"item"},mD={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},jz={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},Mc={$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 JKn(t){return Ts.isInstance(t,Mc.$type)}$(JKn,"isWardley");var rer=(AI=class extends b5e{constructor(){super(...arguments),this.types={AbnfAlternation:{name:yJt.$type,properties:{alternatives:{name:yJt.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:bJt.$type,properties:{elements:{name:bJt.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:iDe.$type,properties:{primary:{name:iDe.primary},repeat:{name:iDe.repeat}},superTypes:[]},AbnfGroup:{name:xJt.$type,properties:{element:{name:xJt.element}},superTypes:[rD.$type]},AbnfNumVal:{name:wJt.$type,properties:{value:{name:wJt.value}},superTypes:[rD.$type]},AbnfOptionalGroup:{name:AJt.$type,properties:{element:{name:AJt.element}},superTypes:[rD.$type]},AbnfPrimary:{name:rD.$type,properties:{},superTypes:[]},AbnfRule:{name:aDe.$type,properties:{definition:{name:aDe.definition},name:{name:aDe.name}},superTypes:[]},AbnfRuleName:{name:SJt.$type,properties:{name:{name:SJt.name}},superTypes:[rD.$type]},AbnfStringLiteral:{name:TJt.$type,properties:{value:{name:TJt.value}},superTypes:[rD.$type]},Accelerator:{name:Xne.$type,properties:{name:{name:Xne.name},x:{name:Xne.x},y:{name:Xne.y}},superTypes:[]},Alignment:{name:oDe.$type,properties:{direction:{name:oDe.direction},members:{name:oDe.members,defaultValue:[]}},superTypes:[]},Anchor:{name:Kne.$type,properties:{evolution:{name:Kne.evolution},name:{name:Kne.name},visibility:{name:Kne.visibility}},superTypes:[]},Annotation:{name:zz.$type,properties:{number:{name:zz.number},text:{name:zz.text},x:{name:zz.x},y:{name:zz.y}},superTypes:[]},Annotations:{name:sDe.$type,properties:{x:{name:sDe.x},y:{name:sDe.y}},superTypes:[]},Architecture:{name:yv.$type,properties:{accDescr:{name:yv.accDescr},accTitle:{name:yv.accTitle},alignments:{name:yv.alignments,defaultValue:[]},edges:{name:yv.edges,defaultValue:[]},groups:{name:yv.groups,defaultValue:[]},junctions:{name:yv.junctions,defaultValue:[]},services:{name:yv.services,defaultValue:[]},title:{name:yv.title}},superTypes:[]},Axis:{name:Zne.$type,properties:{label:{name:Zne.label},name:{name:Zne.name}},superTypes:[]},Branch:{name:Jne.$type,properties:{name:{name:Jne.name},order:{name:Jne.order}},superTypes:[pD.$type]},Checkout:{name:CJt.$type,properties:{branch:{name:CJt.branch}},superTypes:[pD.$type]},CherryPicking:{name:eie.$type,properties:{id:{name:eie.id},parent:{name:eie.parent},tags:{name:eie.tags,defaultValue:[]}},superTypes:[pD.$type]},ClassDefStatement:{name:lDe.$type,properties:{className:{name:lDe.className},styleText:{name:lDe.styleText}},superTypes:[]},Commit:{name:nD.$type,properties:{id:{name:nD.id},message:{name:nD.message},tags:{name:nD.tags,defaultValue:[]},type:{name:nD.type}},superTypes:[pD.$type]},Common:{name:tie.$type,properties:{accDescr:{name:tie.accDescr},accTitle:{name:tie.accTitle},title:{name:tie.title}},superTypes:[]},Component:{name:JO.$type,properties:{decorator:{name:JO.decorator},evolution:{name:JO.evolution},inertia:{name:JO.inertia,defaultValue:!1},label:{name:JO.label},name:{name:JO.name},visibility:{name:JO.visibility}},superTypes:[]},Curve:{name:rie.$type,properties:{entries:{name:rie.entries,defaultValue:[]},label:{name:rie.label},name:{name:rie.name}},superTypes:[]},Cynefin:{name:ek.$type,properties:{accDescr:{name:ek.accDescr},accTitle:{name:ek.accTitle},domains:{name:ek.domains,defaultValue:[]},title:{name:ek.title},transitions:{name:ek.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:nie.$type,properties:{name:{name:nie.name},x:{name:nie.x},y:{name:nie.y}},superTypes:[]},Decorator:{name:OJt.$type,properties:{strategy:{name:OJt.strategy}},superTypes:[]},Direction:{name:iD.$type,properties:{accDescr:{name:iD.accDescr},accTitle:{name:iD.accTitle},dir:{name:iD.dir},statements:{name:iD.statements,defaultValue:[]},title:{name:iD.title}},superTypes:[nk.$type]},DomainBlock:{name:iie.$type,properties:{domain:{name:iie.domain},items:{name:iie.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:cDe.$type,properties:{label:{name:cDe.label}},superTypes:[]},EbnfChoice:{name:kJt.$type,properties:{alternatives:{name:kJt.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:EJt.$type,properties:{except:{name:EJt.except}},superTypes:[Uz.$type]},EbnfGroup:{name:_Jt.$type,properties:{element:{name:_Jt.element}},superTypes:[tk.$type]},EbnfNonTerminal:{name:RJt.$type,properties:{name:{name:RJt.name}},superTypes:[tk.$type]},EbnfOneOrMorePostfix:{name:DJt.$type,properties:{operator:{name:DJt.operator}},superTypes:[Uz.$type]},EbnfOptional:{name:LJt.$type,properties:{element:{name:LJt.element}},superTypes:[tk.$type]},EbnfOptionalPostfix:{name:MJt.$type,properties:{operator:{name:MJt.operator}},superTypes:[Uz.$type]},EbnfPostfix:{name:Uz.$type,properties:{},superTypes:[]},EbnfPrimary:{name:tk.$type,properties:{},superTypes:[]},EbnfRepetition:{name:IJt.$type,properties:{element:{name:IJt.element}},superTypes:[tk.$type]},EbnfRule:{name:uDe.$type,properties:{definition:{name:uDe.definition},name:{name:uDe.name}},superTypes:[]},EbnfSequence:{name:PJt.$type,properties:{elements:{name:PJt.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:NJt.$type,properties:{text:{name:NJt.text}},superTypes:[tk.$type]},EbnfTerm:{name:hDe.$type,properties:{base:{name:hDe.base},postfixes:{name:hDe.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:BJt.$type,properties:{value:{name:BJt.value}},superTypes:[tk.$type]},EbnfZeroOrMorePostfix:{name:$Jt.$type,properties:{operator:{name:$Jt.operator}},superTypes:[Uz.$type]},Edge:{name:bv.$type,properties:{lhsDir:{name:bv.lhsDir},lhsGroup:{name:bv.lhsGroup,defaultValue:!1},lhsId:{name:bv.lhsId},lhsInto:{name:bv.lhsInto,defaultValue:!1},rhsDir:{name:bv.rhsDir},rhsGroup:{name:bv.rhsGroup,defaultValue:!1},rhsId:{name:bv.rhsId},rhsInto:{name:bv.rhsInto,defaultValue:!1},title:{name:bv.title}},superTypes:[]},EmDataEntity:{name:aD.$type,properties:{dataBlockValue:{name:aD.dataBlockValue},dataType:{name:aD.dataType},name:{name:aD.name}},superTypes:[]},EmFrame:{name:rk.$type,properties:{},superTypes:[]},EmGwt:{name:Vz.$type,properties:{givenStatements:{name:Vz.givenStatements,defaultValue:[]},sourceFrame:{name:Vz.sourceFrame,referenceType:rk.$type},thenStatements:{name:Vz.thenStatements,defaultValue:[]},whenStatements:{name:Vz.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:FJt.$type,properties:{entityIdentifier:{name:FJt.entityIdentifier,referenceType:dDe.$type}},superTypes:[]},EmModelEntity:{name:dDe.$type,properties:{name:{name:dDe.name}},superTypes:[]},EmNoteEntity:{name:aie.$type,properties:{dataBlockValue:{name:aie.dataBlockValue},dataType:{name:aie.dataType},sourceFrame:{name:aie.sourceFrame,referenceType:rk.$type}},superTypes:[]},EmResetFrame:{name:gb.$type,properties:{dataInlineValue:{name:gb.dataInlineValue},dataReference:{name:gb.dataReference,referenceType:aD.$type},dataType:{name:gb.dataType},entityIdentifier:{name:gb.entityIdentifier},modelEntityType:{name:gb.modelEntityType},name:{name:gb.name},sourceFrames:{name:gb.sourceFrames,defaultValue:[],referenceType:rk.$type}},superTypes:[rk.$type]},EmTimeFrame:{name:Pw.$type,properties:{dataInlineValue:{name:Pw.dataInlineValue},dataReference:{name:Pw.dataReference,referenceType:aD.$type},dataType:{name:Pw.dataType},entityIdentifier:{name:Pw.entityIdentifier},modelEntityType:{name:Pw.modelEntityType},name:{name:Pw.name},sourceFrames:{name:Pw.sourceFrames,defaultValue:[],referenceType:rk.$type}},superTypes:[rk.$type]},Entry:{name:fDe.$type,properties:{axis:{name:fDe.axis,referenceType:Zne.$type},value:{name:fDe.value}},superTypes:[]},EventModel:{name:mb.$type,properties:{accDescr:{name:mb.accDescr},accTitle:{name:mb.accTitle},dataEntities:{name:mb.dataEntities,defaultValue:[]},frames:{name:mb.frames,defaultValue:[]},gwtEntities:{name:mb.gwtEntities,defaultValue:[]},modelEntities:{name:mb.modelEntities,defaultValue:[]},noteEntities:{name:mb.noteEntities,defaultValue:[]},title:{name:mb.title}},superTypes:[]},Evolution:{name:UJt.$type,properties:{stages:{name:UJt.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:oie.$type,properties:{boundary:{name:oie.boundary},name:{name:oie.name},secondName:{name:oie.secondName}},superTypes:[]},Evolve:{name:pDe.$type,properties:{component:{name:pDe.component},target:{name:pDe.target}},superTypes:[]},GitGraph:{name:nk.$type,properties:{accDescr:{name:nk.accDescr},accTitle:{name:nk.accTitle},statements:{name:nk.statements,defaultValue:[]},title:{name:nk.title}},superTypes:[]},Group:{name:Qz.$type,properties:{icon:{name:Qz.icon},id:{name:Qz.id},in:{name:Qz.in},title:{name:Qz.title}},superTypes:[]},Info:{name:Gz.$type,properties:{accDescr:{name:Gz.accDescr},accTitle:{name:Gz.accTitle},title:{name:Gz.title}},superTypes:[]},Item:{name:Hz.$type,properties:{classSelector:{name:Hz.classSelector},name:{name:Hz.name}},superTypes:[]},Junction:{name:gDe.$type,properties:{id:{name:gDe.id},in:{name:gDe.in}},superTypes:[]},Label:{name:Wz.$type,properties:{negX:{name:Wz.negX,defaultValue:!1},negY:{name:Wz.negY,defaultValue:!1},offsetX:{name:Wz.offsetX},offsetY:{name:Wz.offsetY}},superTypes:[]},Leaf:{name:sie.$type,properties:{classSelector:{name:sie.classSelector},name:{name:sie.name},value:{name:sie.value}},superTypes:[Hz.$type]},Link:{name:ik.$type,properties:{arrow:{name:ik.arrow},from:{name:ik.from},fromPort:{name:ik.fromPort},linkLabel:{name:ik.linkLabel},to:{name:ik.to},toPort:{name:ik.toPort}},superTypes:[]},Merge:{name:oD.$type,properties:{branch:{name:oD.branch},id:{name:oD.id},tags:{name:oD.tags,defaultValue:[]},type:{name:oD.type}},superTypes:[pD.$type]},Note:{name:lie.$type,properties:{evolution:{name:lie.evolution},text:{name:lie.text},visibility:{name:lie.visibility}},superTypes:[]},Option:{name:mDe.$type,properties:{name:{name:mDe.name},value:{name:mDe.value,defaultValue:!1}},superTypes:[]},Packet:{name:sD.$type,properties:{accDescr:{name:sD.accDescr},accTitle:{name:sD.accTitle},blocks:{name:sD.blocks,defaultValue:[]},title:{name:sD.title}},superTypes:[]},PacketBlock:{name:lD.$type,properties:{bits:{name:lD.bits},end:{name:lD.end},label:{name:lD.label},start:{name:lD.start}},superTypes:[]},PegAny:{name:VJt.$type,properties:{dot:{name:VJt.dot}},superTypes:[Yz.$type]},PegGroup:{name:QJt.$type,properties:{element:{name:QJt.element}},superTypes:[Yz.$type]},PegIdentifier:{name:GJt.$type,properties:{name:{name:GJt.name}},superTypes:[Yz.$type]},PegLiteral:{name:HJt.$type,properties:{value:{name:HJt.value}},superTypes:[Yz.$type]},PegOrderedChoice:{name:WJt.$type,properties:{alternatives:{name:WJt.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:vDe.$type,properties:{operator:{name:vDe.operator},suffix:{name:vDe.suffix}},superTypes:[]},PegPrimary:{name:Yz.$type,properties:{},superTypes:[]},PegRule:{name:yDe.$type,properties:{definition:{name:yDe.definition},name:{name:yDe.name}},superTypes:[]},PegSequence:{name:YJt.$type,properties:{elements:{name:YJt.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:bDe.$type,properties:{operator:{name:bDe.operator},primary:{name:bDe.primary}},superTypes:[]},Pie:{name:ak.$type,properties:{accDescr:{name:ak.accDescr},accTitle:{name:ak.accTitle},sections:{name:ak.sections,defaultValue:[]},showData:{name:ak.showData,defaultValue:!1},title:{name:ak.title}},superTypes:[]},PieSection:{name:cie.$type,properties:{label:{name:cie.label},value:{name:cie.value}},superTypes:[]},Pipeline:{name:xDe.$type,properties:{components:{name:xDe.components,defaultValue:[]},parent:{name:xDe.parent}},superTypes:[]},PipelineComponent:{name:uie.$type,properties:{evolution:{name:uie.evolution},label:{name:uie.label},name:{name:uie.name}},superTypes:[]},Radar:{name:ok.$type,properties:{accDescr:{name:ok.accDescr},accTitle:{name:ok.accTitle},axes:{name:ok.axes,defaultValue:[]},curves:{name:ok.curves,defaultValue:[]},options:{name:ok.options,defaultValue:[]},title:{name:ok.title}},superTypes:[]},Railroad:{name:cD.$type,properties:{accDescr:{name:cD.accDescr},accTitle:{name:cD.accTitle},rules:{name:cD.rules,defaultValue:[]},title:{name:cD.title}},superTypes:[]},RailroadAbnf:{name:uD.$type,properties:{accDescr:{name:uD.accDescr},accTitle:{name:uD.accTitle},rules:{name:uD.rules,defaultValue:[]},title:{name:uD.title}},superTypes:[]},RailroadChoiceExpr:{name:qJt.$type,properties:{alternatives:{name:qJt.alternatives,defaultValue:[]}},superTypes:[vb.$type]},RailroadEbnf:{name:hD.$type,properties:{accDescr:{name:hD.accDescr},accTitle:{name:hD.accTitle},rules:{name:hD.rules,defaultValue:[]},title:{name:hD.title}},superTypes:[]},RailroadExpression:{name:vb.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:jJt.$type,properties:{name:{name:jJt.name}},superTypes:[vb.$type]},RailroadOneOrMoreExpr:{name:XJt.$type,properties:{element:{name:XJt.element}},superTypes:[vb.$type]},RailroadOptionalExpr:{name:KJt.$type,properties:{element:{name:KJt.element}},superTypes:[vb.$type]},RailroadPeg:{name:dD.$type,properties:{accDescr:{name:dD.accDescr},accTitle:{name:dD.accTitle},rules:{name:dD.rules,defaultValue:[]},title:{name:dD.title}},superTypes:[]},RailroadRule:{name:wDe.$type,properties:{definition:{name:wDe.definition},name:{name:wDe.name}},superTypes:[]},RailroadSequenceExpr:{name:ZJt.$type,properties:{elements:{name:ZJt.elements,defaultValue:[]}},superTypes:[vb.$type]},RailroadSpecialExpr:{name:JJt.$type,properties:{text:{name:JJt.text}},superTypes:[vb.$type]},RailroadTerminalExpr:{name:eer.$type,properties:{value:{name:eer.value}},superTypes:[vb.$type]},RailroadZeroOrMoreExpr:{name:ter.$type,properties:{element:{name:ter.element}},superTypes:[vb.$type]},Section:{name:ADe.$type,properties:{classSelector:{name:ADe.classSelector},name:{name:ADe.name}},superTypes:[Hz.$type]},Service:{name:fD.$type,properties:{icon:{name:fD.icon},iconText:{name:fD.iconText},id:{name:fD.id},in:{name:fD.in},title:{name:fD.title}},superTypes:[]},Size:{name:SDe.$type,properties:{height:{name:SDe.height},width:{name:SDe.width}},superTypes:[]},Statement:{name:pD.$type,properties:{},superTypes:[]},Transition:{name:qz.$type,properties:{from:{name:qz.from},label:{name:qz.label},to:{name:qz.to}},superTypes:[]},TreeNode:{name:mD.$type,properties:{classAnnotation:{name:mD.classAnnotation},descAnnotation:{name:mD.descAnnotation},iconAnnotation:{name:mD.iconAnnotation},indent:{name:mD.indent},name:{name:mD.name}},superTypes:[]},TreeView:{name:jz.$type,properties:{accDescr:{name:jz.accDescr},accTitle:{name:jz.accTitle},nodes:{name:jz.nodes,defaultValue:[]},title:{name:jz.title}},superTypes:[]},Treemap:{name:gD.$type,properties:{accDescr:{name:gD.accDescr},accTitle:{name:gD.accTitle},title:{name:gD.title},TreemapRows:{name:gD.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:TDe.$type,properties:{indent:{name:TDe.indent},item:{name:TDe.item}},superTypes:[]},Wardley:{name:Mc.$type,properties:{accDescr:{name:Mc.accDescr},accelerators:{name:Mc.accelerators,defaultValue:[]},accTitle:{name:Mc.accTitle},anchors:{name:Mc.anchors,defaultValue:[]},annotation:{name:Mc.annotation,defaultValue:[]},annotations:{name:Mc.annotations,defaultValue:[]},components:{name:Mc.components,defaultValue:[]},deaccelerators:{name:Mc.deaccelerators,defaultValue:[]},evolution:{name:Mc.evolution},evolves:{name:Mc.evolves,defaultValue:[]},links:{name:Mc.links,defaultValue:[]},notes:{name:Mc.notes,defaultValue:[]},pipelines:{name:Mc.pipelines,defaultValue:[]},size:{name:Mc.size},title:{name:Mc.title}},superTypes:[]}}}},$(AI,"MermaidAstReflection"),AI),Ts=new rer,ner,eZn=$(()=>ner??(ner=Zl(`{"$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"),ier,tZn=$(()=>ier??(ier=Zl(`{"$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"),aer,rZn=$(()=>aer??(aer=Zl('{"$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"),oer,nZn=$(()=>oer??(oer=Zl(`{"$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"),ser,iZn=$(()=>ser??(ser=Zl(`{"$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"),ler,aZn=$(()=>ler??(ler=Zl(`{"$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"),cer,oZn=$(()=>cer??(cer=Zl(`{"$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"),uer,sZn=$(()=>uer??(uer=Zl(`{"$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"),her,lZn=$(()=>her??(her=Zl('{"$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"),der,cZn=$(()=>der??(der=Zl(`{"$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"),fer,uZn=$(()=>fer??(fer=Zl(`{"$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"),per,hZn=$(()=>per??(per=Zl(`{"$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"),ger,dZn=$(()=>ger??(ger=Zl(`{"$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"),mer,fZn=$(()=>mer??(mer=Zl(`{"$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"),ver,pZn=$(()=>ver??(ver=Zl(`{"$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"),gZn={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},mZn={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},vZn={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},yZn={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},bZn={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},xZn={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},wZn={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},AZn={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},SZn={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},TZn={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},CZn={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},OZn={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},kZn={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},EZn={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},_Zn={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},gh={AstReflection:$(()=>new rer,"AstReflection")},RZn={Grammar:$(()=>eZn(),"Grammar"),LanguageMetaData:$(()=>gZn,"LanguageMetaData"),parser:{}},DZn={Grammar:$(()=>tZn(),"Grammar"),LanguageMetaData:$(()=>mZn,"LanguageMetaData"),parser:{}},LZn={Grammar:$(()=>rZn(),"Grammar"),LanguageMetaData:$(()=>vZn,"LanguageMetaData"),parser:{}},MZn={Grammar:$(()=>nZn(),"Grammar"),LanguageMetaData:$(()=>yZn,"LanguageMetaData"),parser:{}},IZn={Grammar:$(()=>iZn(),"Grammar"),LanguageMetaData:$(()=>bZn,"LanguageMetaData"),parser:{}},PZn={Grammar:$(()=>aZn(),"Grammar"),LanguageMetaData:$(()=>xZn,"LanguageMetaData"),parser:{}},NZn={Grammar:$(()=>oZn(),"Grammar"),LanguageMetaData:$(()=>wZn,"LanguageMetaData"),parser:{}},BZn={Grammar:$(()=>sZn(),"Grammar"),LanguageMetaData:$(()=>AZn,"LanguageMetaData"),parser:{}},$Zn={Grammar:$(()=>lZn(),"Grammar"),LanguageMetaData:$(()=>SZn,"LanguageMetaData"),parser:{}},FZn={Grammar:$(()=>cZn(),"Grammar"),LanguageMetaData:$(()=>TZn,"LanguageMetaData"),parser:{}},zZn={Grammar:$(()=>uZn(),"Grammar"),LanguageMetaData:$(()=>CZn,"LanguageMetaData"),parser:{}},UZn={Grammar:$(()=>hZn(),"Grammar"),LanguageMetaData:$(()=>OZn,"LanguageMetaData"),parser:{}},VZn={Grammar:$(()=>dZn(),"Grammar"),LanguageMetaData:$(()=>kZn,"LanguageMetaData"),parser:{}},QZn={Grammar:$(()=>fZn(),"Grammar"),LanguageMetaData:$(()=>EZn,"LanguageMetaData"),parser:{}},GZn={Grammar:$(()=>pZn(),"Grammar"),LanguageMetaData:$(()=>_Zn,"LanguageMetaData"),parser:{}},HZn=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,WZn=/accTitle[\t ]*:([^\n\r]*)/,YZn=/title([\t ][^\n\r]*|)/,qZn={ACC_DESCR:HZn,ACC_TITLE:WZn,TITLE:YZn},xv=(SI=class extends d3e{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=qZn[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,` +`}$(N3e,"fillNewlines");var cJt=(uI=class{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&_3e(r))return E3e(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,o=i.nameSegment.range.start.character+1,s=i.documentUri.with({fragment:`L${a},${o}`});return`[${n}](${s.toString()})`}else return}documentationTagRenderer(e,r){}findNameInLocalSymbols(e,r){const i=Wg(e).localSymbols;if(!i)return;let a=e;do{const s=i.getStream(a).find(l=>l.name===r);if(s)return s;a=a.$container}while(a)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(i=>i.name===r)}},$(uI,"JSDocDocumentationProvider"),uI),uJt=(hI=class{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return A3e(e)?e.$comment:(r=W5e(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:r.text}},$(hI,"DefaultCommentProvider"),hI),hJt=(dI=class{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}},$(dI,"DefaultAsyncParser"),dI),_Kn=(fI=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 fb;let a;const o=r.onCancellationRequested(()=>{a=setTimeout(()=>{this.terminateWorker(n)},this.terminationDelay)});return n.parse(e).then(s=>{const l=this.hydrator.hydrate(s);i.resolve(l)}).catch(s=>{i.reject(s)}).finally(()=>{o.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 fb;return e.onCancellationRequested(()=>{const n=this.queue.indexOf(r);n>=0&&this.queue.splice(n,1),r.reject(vv)}),this.queue.push(r),r.promise}},$(fI,"AbstractThreadedAsyncParser"),fI),RKn=(pI=class{get ready(){return this._ready}get onReady(){return this.onReadyEmitter.event}constructor(e,r,n,i){this.onReadyEmitter=new Vne.Emitter,this.deferred=new fb,this._ready=!0,this._parsing=!1,this.sendMessage=e,this._terminate=i,r(a=>{const o=a;this.deferred.resolve(o),this.unlock()}),n(a=>{this.deferred.reject(a),this.unlock()})}terminate(){this.deferred.reject(vv),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 fb,this.sendMessage(e),this.deferred.promise}},$(pI,"ParserWorker"),pI),dJt=(gI=class{constructor(){this.previousTokenSource=new Ha.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=Pne();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=Ha.CancellationToken.None){const i=new fb,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){qO(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}},$(gI,"DefaultWorkspaceLock"),gI),fJt=(mI=class{constructor(e){this.grammarElementIdMap=new $ne,this.tokenTypeIdMap=new $ne,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 Yg(e))r.set(i,{});if(e.$cstNode)for(const i of N3(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 o=[];n[i]=o;for(const s of a)Xs(s)?o.push(this.dehydrateAstNode(s,r)):oh(s)?o.push(this.dehydrateReference(s,r)):o.push(s)}else Xs(a)?n[i]=this.dehydrateAstNode(a,r):oh(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 Bte(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Z1(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):lO(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 Yg(e))r.set(a,{});let i;if(e.$cstNode)for(const a of N3(e.$cstNode)){let o;"fullText"in a?(o=new i3e(a.fullText),i=o):"content"in a?o=new One:"tokenType"in a&&(o=this.hydrateCstLeafNode(a)),o&&(n.set(a,o),o.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 o=[];n[i]=o;for(const s of a)Xs(s)?o.push(this.setParent(this.hydrateAstNode(s,r),n)):oh(s)?o.push(this.hydrateReference(s,n,i,r)):o.push(s)}else Xs(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):oh(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),Z1(i))for(const a of e.content){const o=this.hydrateCstNode(a,r,n++);i.content.push(o)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,a=e.startLine,o=e.startColumn,s=e.endLine,l=e.endColumn,u=e.hidden;return new Cne(n,i,{start:{line:a,character:o},end:{line:s,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 Yg(this.grammar))Ute(r)&&this.grammarElementIdMap.set(r,e++)}},$(mI,"DefaultHydrator"),mI);function Xl(t){return{documentation:{CommentProvider:$(e=>new uJt(e),"CommentProvider"),DocumentationProvider:$(e=>new cJt(e),"DocumentationProvider")},parser:{AsyncParser:$(e=>new hJt(e),"AsyncParser"),GrammarConfig:$(e=>yRe(e),"GrammarConfig"),LangiumParser:$(e=>u3e(e),"LangiumParser"),CompletionParser:$(e=>c3e(e),"CompletionParser"),ValueConverter:$(()=>new d3e,"ValueConverter"),TokenBuilder:$(()=>new Lne,"TokenBuilder"),Lexer:$(e=>new k3e(e),"Lexer"),ParserErrorMessageProvider:$(()=>new o3e,"ParserErrorMessageProvider"),LexerErrorMessageProvider:$(()=>new XZt,"LexerErrorMessageProvider")},workspace:{AstNodeLocator:$(()=>new HZt,"AstNodeLocator"),AstNodeDescriptionProvider:$(e=>new QZt(e),"AstNodeDescriptionProvider"),ReferenceDescriptionProvider:$(e=>new GZt(e),"ReferenceDescriptionProvider")},references:{Linker:$(e=>new DZt(e),"Linker"),NameProvider:$(()=>new LZt,"NameProvider"),ScopeProvider:$(e=>new BZt(e),"ScopeProvider"),ScopeComputation:$(e=>new IZt(e),"ScopeComputation"),References:$(e=>new MZt(e),"References")},serializer:{Hydrator:$(e=>new fJt(e),"Hydrator"),JsonSerializer:$(e=>new $Zt(e),"JsonSerializer")},validation:{DocumentValidator:$(e=>new VZt(e),"DocumentValidator"),ValidationRegistry:$(e=>new zZt(e),"ValidationRegistry")},shared:$(()=>t.shared,"shared")}}$(Xl,"createDefaultCoreModule");function Kl(t){return{ServiceRegistry:$(e=>new FZt(e),"ServiceRegistry"),workspace:{LangiumDocuments:$(e=>new RZt(e),"LangiumDocuments"),LangiumDocumentFactory:$(e=>new _Zt(e),"LangiumDocumentFactory"),DocumentBuilder:$(e=>new YZt(e),"DocumentBuilder"),IndexManager:$(e=>new qZt(e),"IndexManager"),WorkspaceManager:$(e=>new jZt(e),"WorkspaceManager"),FileSystemProvider:$(e=>t.fileSystemProvider(e),"FileSystemProvider"),WorkspaceLock:$(()=>new dJt,"WorkspaceLock"),ConfigurationProvider:$(e=>new WZt(e),"ConfigurationProvider")},profilers:{}}}$(Kl,"createDefaultSharedCoreModule");var B3e;(function(t){t.merge=(e,r)=>tD(tD({},e),r)})(B3e||(B3e={}));function Mi(t,e,r,n,i,a,o,s,l){const u=[t,e,r,n,i,a,o,s,l].reduce(tD,{});return F3e(u)}$(Mi,"inject");var pJt=Symbol("isProxy");function $3e(t){if(t&&t[pJt])for(const e of Object.values(t))$3e(e);return t}$($3e,"eagerLoad");function F3e(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===pJt?!0:z3e(n,i,t,e||r),"get"),getOwnPropertyDescriptor:$((n,i)=>(z3e(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),"getOwnPropertyDescriptor"),has:$((n,i)=>i in t,"has"),ownKeys:$(()=>[...Object.getOwnPropertyNames(t)],"ownKeys")});return r}$(F3e,"_inject");var gJt=Symbol();function z3e(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]===gJt)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]=gJt;try{t[e]=typeof i=="function"?i(n):F3e(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}$(z3e,"_resolve");function tD(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]=tD(i,n):t[r]=tD({},n)}else t[r]=n}return t}$(tD,"_merge");var U3e={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},ZO;(function(t){t.REGULAR="indentation-sensitive",t.IGNORE_INDENTATION="ignore-indentation"})(ZO||(ZO={}));var mJt=(vI=class extends Lne{constructor(e=U3e){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...U3e,...e},this.indentTokenType=q3({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=q3({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(e,r){const n=super.buildTokens(e,r);if(!Gne(n))throw new Error("Invalid tokens built by default builder");const{indentTokenName:i,dedentTokenName:a,whitespaceTokenName:o,ignoreIndentationDelimiters:s}=this.options;let l,u,h;const d=[];for(const f of n){for(const[p,g]of s)f.name===p?f.PUSH_MODE=ZO.IGNORE_INDENTATION:f.name===g&&(f.POP_MODE=!0);f.name===a?l=f:f.name===i?u=f:f.name===o?h=f:d.push(f)}if(!l||!u||!h)throw new Error("Some indentation/whitespace tokens not found!");return s.length>0?{modes:{[ZO.REGULAR]:[l,u,...d,h],[ZO.IGNORE_INDENTATION]:[...d,h]},defaultMode:ZO.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 Tz(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:o,match:s}=this.matchWhitespace(e,r,n,i);return a<=o?null:(this.indentationStack.push(a),s)}dedentMatcher(e,r,n,i){var d,f;if(!this.isStartOfLine(e,r))return null;const{currIndentLevel:a,prevIndentLevel:o,match:s}=this.matchWhitespace(e,r,n,i);if(a>=o)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=s==null?void 0:s[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}},$(vI,"IndentationAwareTokenBuilder"),vI),DKn=(yI=class extends k3e{constructor(e){if(super(e),e.parser.TokenBuilder instanceof mJt)this.indentationTokenBuilder=e.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(e,r=O3e){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:o}=this.indentationTokenBuilder,s=a.tokenTypeIdx,l=o.tokenTypeIdx,u=[],h=n.tokens.length-1;for(let d=0;d=0&&u.push(n.tokens[h]),n.tokens=u,n}},$(yI,"IndentationAwareLexer"),yI),V3e={};xw(V3e,{AstUtils:()=>x5e,BiMap:()=>$ne,Cancellation:()=>Ha,ContextCache:()=>zne,CstUtils:()=>v5e,DONE_RESULT:()=>sh,Deferred:()=>fb,Disposable:()=>KO,DisposableCache:()=>Fne,DocumentCache:()=>NZt,EMPTY_STREAM:()=>S3,ErrorWithLocation:()=>lre,GrammarUtils:()=>K5e,MultiMap:()=>pb,OperationCancelled:()=>vv,Reduction:()=>B9,RegExpUtils:()=>J5e,SimpleCache:()=>x3e,StreamImpl:()=>sv,TreeStreamImpl:()=>T3,URI:()=>Af,UriTrie:()=>v3e,UriUtils:()=>ph,WorkspaceCache:()=>w3e,assertCondition:()=>Z5e,assertUnreachable:()=>kw,delayNextTick:()=>Mne,interruptAndCheck:()=>jl,isOperationCancelled:()=>qO,loadGrammarFromJson:()=>Zl,setInterruptionPeriod:()=>f3e,startCancelableOperation:()=>Pne,stream:()=>da}),kte(V3e,Vne);var vJt=(bI=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[]}},$(bI,"EmptyFileSystemProvider"),bI),Lc={fileSystemProvider:$(()=>new vJt,"fileSystemProvider")},LKn={Grammar:$(()=>{},"Grammar"),LanguageMetaData:$(()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"}),"LanguageMetaData")},MKn={AstReflection:$(()=>new U5e,"AstReflection")};function yJt(){const t=Mi(Kl(Lc),MKn),e=Mi(Xl({shared:t}),LKn);return t.ServiceRegistry.register(e),e}$(yJt,"createMinimalGrammarServices");function Zl(t){const e=yJt(),r=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(r,Af.parse(`memory:/${r.name??"grammar"}.langium`)),r}$(Zl,"loadGrammarFromJson"),kte(aUt,V3e);var IKn=(xI=class{constructor(e){this.activeCategories=new Set,this.allCategories=new Set(["validating","parsing","linking"]),this.activeCategories=e??new Set(this.allCategories),this.records=new pb}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 bJt(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 o of r.entries.keys()){const s=r.entries.get(o),l=s.reduce((u,h)=>u+h);n.push({name:`${r.identifier}.${o}`,count:s.length,duration:l})}const i=r.duration-n.map(o=>o.duration).reduce((o,s)=>o+s,0);n.push({name:r.identifier,count:1,duration:i}),n.sort((o,s)=>s.duration-o.duration);function a(o){return Math.round(100*o)/100}return $(a,"Round"),console.table(n.map(o=>({Element:o.name,Count:o.count,"Self %":a(100*o.duration/r.duration),"Time (ms)":a(o.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])}},$(xI,"DefaultLangiumProfiler"),xI),bJt=(wI=class{constructor(e,r){this.stack=[],this.entries=new pb,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)}},$(wI,"ProfilingTask"),wI),Q3e;(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]+)\]/}})(Q3e||(Q3e={}));var G3e;(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]*/}})(G3e||(G3e={}));var H3e;(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]*/}})(H3e||(H3e={}));var W3e;(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])?/}})(W3e||(W3e={}));var Y3e;(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]*/}})(Y3e||(Y3e={}));var q3e;(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]*/}})(q3e||(q3e={}));var j3e;(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]*/}})(j3e||(j3e={}));var X3e;(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]*/}})(X3e||(X3e={}));var K3e;(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]*/}})(K3e||(K3e={}));var Z3e;(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]*?\*\)/}})(Z3e||(Z3e={}));var J3e;(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]*?\*\//}})(J3e||(J3e={}));var eDe;(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]*/}})(eDe||(eDe={}));var tDe;(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:/"[^"]*"|'[^']*'/}})(tDe||(tDe={}));var rDe;(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])*/}})(rDe||(rDe={}));var nDe;(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]*/}})(nDe||(nDe={})),{...Q3e.Terminals,...G3e.Terminals,...H3e.Terminals,...W3e.Terminals,...Y3e.Terminals,...q3e.Terminals,...j3e.Terminals,...X3e.Terminals,...K3e.Terminals,...Z3e.Terminals,...J3e.Terminals,...eDe.Terminals,...rDe.Terminals,...tDe.Terminals,...nDe.Terminals};var xJt={$type:"AbnfAlternation",alternatives:"alternatives"},wJt={$type:"AbnfConcatenation",elements:"elements"},iDe={$type:"AbnfElement",primary:"primary",repeat:"repeat"},AJt={$type:"AbnfGroup",element:"element"},SJt={$type:"AbnfNumVal",value:"value"},TJt={$type:"AbnfOptionalGroup",element:"element"},rD={$type:"AbnfPrimary"},aDe={$type:"AbnfRule",definition:"definition",name:"name"},CJt={$type:"AbnfRuleName",name:"name"},OJt={$type:"AbnfStringLiteral",value:"value"},Xne={$type:"Accelerator",name:"name",x:"x",y:"y"},oDe={$type:"Alignment",direction:"direction",members:"members"},Kne={$type:"Anchor",evolution:"evolution",name:"name",visibility:"visibility"},zz={$type:"Annotation",number:"number",text:"text",x:"x",y:"y"},sDe={$type:"Annotations",x:"x",y:"y"},yv={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",alignments:"alignments",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function PKn(t){return Ts.isInstance(t,yv.$type)}$(PKn,"isArchitecture");var Zne={$type:"Axis",label:"label",name:"name"},Jne={$type:"Branch",name:"name",order:"order"};function NKn(t){return Ts.isInstance(t,Jne.$type)}$(NKn,"isBranch");var kJt={$type:"Checkout",branch:"branch"},eie={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},lDe={$type:"ClassDefStatement",className:"className",styleText:"styleText"},nD={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function BKn(t){return Ts.isInstance(t,nD.$type)}$(BKn,"isCommit");var tie={$type:"Common",accDescr:"accDescr",accTitle:"accTitle",title:"title"},JO={$type:"Component",decorator:"decorator",evolution:"evolution",inertia:"inertia",label:"label",name:"name",visibility:"visibility"},rie={$type:"Curve",entries:"entries",label:"label",name:"name"},ek={$type:"Cynefin",accDescr:"accDescr",accTitle:"accTitle",domains:"domains",title:"title",transitions:"transitions"};function $Kn(t){return Ts.isInstance(t,ek.$type)}$($Kn,"isCynefin");var nie={$type:"Deaccelerator",name:"name",x:"x",y:"y"},EJt={$type:"Decorator",strategy:"strategy"},iD={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},iie={$type:"DomainBlock",domain:"domain",items:"items"};function FKn(t){return Ts.isInstance(t,iie.$type)}$(FKn,"isDomainBlock");var cDe={$type:"DomainItem",label:"label"};function zKn(t){return Ts.isInstance(t,cDe.$type)}$(zKn,"isDomainItem");var _Jt={$type:"EbnfChoice",alternatives:"alternatives"},RJt={$type:"EbnfExceptionPostfix",except:"except"},DJt={$type:"EbnfGroup",element:"element"},LJt={$type:"EbnfNonTerminal",name:"name"},MJt={$type:"EbnfOneOrMorePostfix",operator:"operator"},IJt={$type:"EbnfOptional",element:"element"},PJt={$type:"EbnfOptionalPostfix",operator:"operator"},Uz={$type:"EbnfPostfix"},tk={$type:"EbnfPrimary"},NJt={$type:"EbnfRepetition",element:"element"},uDe={$type:"EbnfRule",definition:"definition",name:"name"},BJt={$type:"EbnfSequence",elements:"elements"},$Jt={$type:"EbnfSpecial",text:"text"},hDe={$type:"EbnfTerm",base:"base",postfixes:"postfixes"},FJt={$type:"EbnfTerminal",value:"value"},zJt={$type:"EbnfZeroOrMorePostfix",operator:"operator"},bv={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},aD={$type:"EmDataEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",name:"name"},rk={$type:"EmFrame"},Vz={$type:"EmGwt",givenStatements:"givenStatements",sourceFrame:"sourceFrame",thenStatements:"thenStatements",whenStatements:"whenStatements"},UJt={$type:"EmGwtStatement",entityIdentifier:"entityIdentifier"},dDe={$type:"EmModelEntity",name:"name"};function UKn(t){return t==="rmo"||t==="readmodel"||t==="ui"||t==="cmd"||t==="command"||t==="evt"||t==="event"||t==="pcr"||t==="processor"}$(UKn,"isEmModelEntityType");var aie={$type:"EmNoteEntity",dataBlockValue:"dataBlockValue",dataType:"dataType",sourceFrame:"sourceFrame"},gb={$type:"EmResetFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"};function VJt(t){return Ts.isInstance(t,gb.$type)}$(VJt,"isEmResetFrame");var Pw={$type:"EmTimeFrame",dataInlineValue:"dataInlineValue",dataReference:"dataReference",dataType:"dataType",entityIdentifier:"entityIdentifier",modelEntityType:"modelEntityType",name:"name",sourceFrames:"sourceFrames"},fDe={$type:"Entry",axis:"axis",value:"value"},mb={$type:"EventModel",accDescr:"accDescr",accTitle:"accTitle",dataEntities:"dataEntities",frames:"frames",gwtEntities:"gwtEntities",modelEntities:"modelEntities",noteEntities:"noteEntities",title:"title"},QJt={$type:"Evolution",stages:"stages"},oie={$type:"EvolutionStage",boundary:"boundary",name:"name",secondName:"secondName"},pDe={$type:"Evolve",component:"component",target:"target"},nk={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function VKn(t){return Ts.isInstance(t,nk.$type)}$(VKn,"isGitGraph");var Qz={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},Gz={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function QKn(t){return Ts.isInstance(t,Gz.$type)}$(QKn,"isInfo");var Hz={$type:"Item",classSelector:"classSelector",name:"name"},gDe={$type:"Junction",id:"id",in:"in"},Wz={$type:"Label",negX:"negX",negY:"negY",offsetX:"offsetX",offsetY:"offsetY"},sie={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},ik={$type:"Link",arrow:"arrow",from:"from",fromPort:"fromPort",linkLabel:"linkLabel",to:"to",toPort:"toPort"},oD={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function GKn(t){return Ts.isInstance(t,oD.$type)}$(GKn,"isMerge");var lie={$type:"Note",evolution:"evolution",text:"text",visibility:"visibility"},mDe={$type:"Option",name:"name",value:"value"},sD={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function HKn(t){return Ts.isInstance(t,sD.$type)}$(HKn,"isPacket");var lD={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function WKn(t){return Ts.isInstance(t,lD.$type)}$(WKn,"isPacketBlock");var GJt={$type:"PegAny",dot:"dot"},HJt={$type:"PegGroup",element:"element"},WJt={$type:"PegIdentifier",name:"name"},YJt={$type:"PegLiteral",value:"value"},qJt={$type:"PegOrderedChoice",alternatives:"alternatives"},vDe={$type:"PegPrefix",operator:"operator",suffix:"suffix"},Yz={$type:"PegPrimary"},yDe={$type:"PegRule",definition:"definition",name:"name"},jJt={$type:"PegSequence",elements:"elements"},bDe={$type:"PegSuffix",operator:"operator",primary:"primary"},ak={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function YKn(t){return Ts.isInstance(t,ak.$type)}$(YKn,"isPie");var cie={$type:"PieSection",label:"label",value:"value"};function qKn(t){return Ts.isInstance(t,cie.$type)}$(qKn,"isPieSection");var xDe={$type:"Pipeline",components:"components",parent:"parent"},uie={$type:"PipelineComponent",evolution:"evolution",label:"label",name:"name"},ok={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},cD={$type:"Railroad",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function jKn(t){return Ts.isInstance(t,cD.$type)}$(jKn,"isRailroad");var uD={$type:"RailroadAbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function XKn(t){return Ts.isInstance(t,uD.$type)}$(XKn,"isRailroadAbnf");var XJt={$type:"RailroadChoiceExpr",alternatives:"alternatives"},hD={$type:"RailroadEbnf",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function KKn(t){return Ts.isInstance(t,hD.$type)}$(KKn,"isRailroadEbnf");var vb={$type:"RailroadExpression"},KJt={$type:"RailroadNonTerminalExpr",name:"name"},ZJt={$type:"RailroadOneOrMoreExpr",element:"element"},JJt={$type:"RailroadOptionalExpr",element:"element"},dD={$type:"RailroadPeg",accDescr:"accDescr",accTitle:"accTitle",rules:"rules",title:"title"};function ZKn(t){return Ts.isInstance(t,dD.$type)}$(ZKn,"isRailroadPeg");var wDe={$type:"RailroadRule",definition:"definition",name:"name"},eer={$type:"RailroadSequenceExpr",elements:"elements"},ter={$type:"RailroadSpecialExpr",text:"text"},rer={$type:"RailroadTerminalExpr",value:"value"},ner={$type:"RailroadZeroOrMoreExpr",element:"element"},ADe={$type:"Section",classSelector:"classSelector",name:"name"},fD={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},SDe={$type:"Size",height:"height",width:"width"},pD={$type:"Statement"},qz={$type:"Transition",from:"from",label:"label",to:"to"};function JKn(t){return Ts.isInstance(t,qz.$type)}$(JKn,"isTransition");var gD={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function eZn(t){return Ts.isInstance(t,gD.$type)}$(eZn,"isTreemap");var TDe={$type:"TreemapRow",indent:"indent",item:"item"},mD={$type:"TreeNode",classAnnotation:"classAnnotation",descAnnotation:"descAnnotation",iconAnnotation:"iconAnnotation",indent:"indent",name:"name"},jz={$type:"TreeView",accDescr:"accDescr",accTitle:"accTitle",nodes:"nodes",title:"title"},Mc={$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 tZn(t){return Ts.isInstance(t,Mc.$type)}$(tZn,"isWardley");var ier=(AI=class extends b5e{constructor(){super(...arguments),this.types={AbnfAlternation:{name:xJt.$type,properties:{alternatives:{name:xJt.alternatives,defaultValue:[]}},superTypes:[]},AbnfConcatenation:{name:wJt.$type,properties:{elements:{name:wJt.elements,defaultValue:[]}},superTypes:[]},AbnfElement:{name:iDe.$type,properties:{primary:{name:iDe.primary},repeat:{name:iDe.repeat}},superTypes:[]},AbnfGroup:{name:AJt.$type,properties:{element:{name:AJt.element}},superTypes:[rD.$type]},AbnfNumVal:{name:SJt.$type,properties:{value:{name:SJt.value}},superTypes:[rD.$type]},AbnfOptionalGroup:{name:TJt.$type,properties:{element:{name:TJt.element}},superTypes:[rD.$type]},AbnfPrimary:{name:rD.$type,properties:{},superTypes:[]},AbnfRule:{name:aDe.$type,properties:{definition:{name:aDe.definition},name:{name:aDe.name}},superTypes:[]},AbnfRuleName:{name:CJt.$type,properties:{name:{name:CJt.name}},superTypes:[rD.$type]},AbnfStringLiteral:{name:OJt.$type,properties:{value:{name:OJt.value}},superTypes:[rD.$type]},Accelerator:{name:Xne.$type,properties:{name:{name:Xne.name},x:{name:Xne.x},y:{name:Xne.y}},superTypes:[]},Alignment:{name:oDe.$type,properties:{direction:{name:oDe.direction},members:{name:oDe.members,defaultValue:[]}},superTypes:[]},Anchor:{name:Kne.$type,properties:{evolution:{name:Kne.evolution},name:{name:Kne.name},visibility:{name:Kne.visibility}},superTypes:[]},Annotation:{name:zz.$type,properties:{number:{name:zz.number},text:{name:zz.text},x:{name:zz.x},y:{name:zz.y}},superTypes:[]},Annotations:{name:sDe.$type,properties:{x:{name:sDe.x},y:{name:sDe.y}},superTypes:[]},Architecture:{name:yv.$type,properties:{accDescr:{name:yv.accDescr},accTitle:{name:yv.accTitle},alignments:{name:yv.alignments,defaultValue:[]},edges:{name:yv.edges,defaultValue:[]},groups:{name:yv.groups,defaultValue:[]},junctions:{name:yv.junctions,defaultValue:[]},services:{name:yv.services,defaultValue:[]},title:{name:yv.title}},superTypes:[]},Axis:{name:Zne.$type,properties:{label:{name:Zne.label},name:{name:Zne.name}},superTypes:[]},Branch:{name:Jne.$type,properties:{name:{name:Jne.name},order:{name:Jne.order}},superTypes:[pD.$type]},Checkout:{name:kJt.$type,properties:{branch:{name:kJt.branch}},superTypes:[pD.$type]},CherryPicking:{name:eie.$type,properties:{id:{name:eie.id},parent:{name:eie.parent},tags:{name:eie.tags,defaultValue:[]}},superTypes:[pD.$type]},ClassDefStatement:{name:lDe.$type,properties:{className:{name:lDe.className},styleText:{name:lDe.styleText}},superTypes:[]},Commit:{name:nD.$type,properties:{id:{name:nD.id},message:{name:nD.message},tags:{name:nD.tags,defaultValue:[]},type:{name:nD.type}},superTypes:[pD.$type]},Common:{name:tie.$type,properties:{accDescr:{name:tie.accDescr},accTitle:{name:tie.accTitle},title:{name:tie.title}},superTypes:[]},Component:{name:JO.$type,properties:{decorator:{name:JO.decorator},evolution:{name:JO.evolution},inertia:{name:JO.inertia,defaultValue:!1},label:{name:JO.label},name:{name:JO.name},visibility:{name:JO.visibility}},superTypes:[]},Curve:{name:rie.$type,properties:{entries:{name:rie.entries,defaultValue:[]},label:{name:rie.label},name:{name:rie.name}},superTypes:[]},Cynefin:{name:ek.$type,properties:{accDescr:{name:ek.accDescr},accTitle:{name:ek.accTitle},domains:{name:ek.domains,defaultValue:[]},title:{name:ek.title},transitions:{name:ek.transitions,defaultValue:[]}},superTypes:[]},Deaccelerator:{name:nie.$type,properties:{name:{name:nie.name},x:{name:nie.x},y:{name:nie.y}},superTypes:[]},Decorator:{name:EJt.$type,properties:{strategy:{name:EJt.strategy}},superTypes:[]},Direction:{name:iD.$type,properties:{accDescr:{name:iD.accDescr},accTitle:{name:iD.accTitle},dir:{name:iD.dir},statements:{name:iD.statements,defaultValue:[]},title:{name:iD.title}},superTypes:[nk.$type]},DomainBlock:{name:iie.$type,properties:{domain:{name:iie.domain},items:{name:iie.items,defaultValue:[]}},superTypes:[]},DomainItem:{name:cDe.$type,properties:{label:{name:cDe.label}},superTypes:[]},EbnfChoice:{name:_Jt.$type,properties:{alternatives:{name:_Jt.alternatives,defaultValue:[]}},superTypes:[]},EbnfExceptionPostfix:{name:RJt.$type,properties:{except:{name:RJt.except}},superTypes:[Uz.$type]},EbnfGroup:{name:DJt.$type,properties:{element:{name:DJt.element}},superTypes:[tk.$type]},EbnfNonTerminal:{name:LJt.$type,properties:{name:{name:LJt.name}},superTypes:[tk.$type]},EbnfOneOrMorePostfix:{name:MJt.$type,properties:{operator:{name:MJt.operator}},superTypes:[Uz.$type]},EbnfOptional:{name:IJt.$type,properties:{element:{name:IJt.element}},superTypes:[tk.$type]},EbnfOptionalPostfix:{name:PJt.$type,properties:{operator:{name:PJt.operator}},superTypes:[Uz.$type]},EbnfPostfix:{name:Uz.$type,properties:{},superTypes:[]},EbnfPrimary:{name:tk.$type,properties:{},superTypes:[]},EbnfRepetition:{name:NJt.$type,properties:{element:{name:NJt.element}},superTypes:[tk.$type]},EbnfRule:{name:uDe.$type,properties:{definition:{name:uDe.definition},name:{name:uDe.name}},superTypes:[]},EbnfSequence:{name:BJt.$type,properties:{elements:{name:BJt.elements,defaultValue:[]}},superTypes:[]},EbnfSpecial:{name:$Jt.$type,properties:{text:{name:$Jt.text}},superTypes:[tk.$type]},EbnfTerm:{name:hDe.$type,properties:{base:{name:hDe.base},postfixes:{name:hDe.postfixes,defaultValue:[]}},superTypes:[]},EbnfTerminal:{name:FJt.$type,properties:{value:{name:FJt.value}},superTypes:[tk.$type]},EbnfZeroOrMorePostfix:{name:zJt.$type,properties:{operator:{name:zJt.operator}},superTypes:[Uz.$type]},Edge:{name:bv.$type,properties:{lhsDir:{name:bv.lhsDir},lhsGroup:{name:bv.lhsGroup,defaultValue:!1},lhsId:{name:bv.lhsId},lhsInto:{name:bv.lhsInto,defaultValue:!1},rhsDir:{name:bv.rhsDir},rhsGroup:{name:bv.rhsGroup,defaultValue:!1},rhsId:{name:bv.rhsId},rhsInto:{name:bv.rhsInto,defaultValue:!1},title:{name:bv.title}},superTypes:[]},EmDataEntity:{name:aD.$type,properties:{dataBlockValue:{name:aD.dataBlockValue},dataType:{name:aD.dataType},name:{name:aD.name}},superTypes:[]},EmFrame:{name:rk.$type,properties:{},superTypes:[]},EmGwt:{name:Vz.$type,properties:{givenStatements:{name:Vz.givenStatements,defaultValue:[]},sourceFrame:{name:Vz.sourceFrame,referenceType:rk.$type},thenStatements:{name:Vz.thenStatements,defaultValue:[]},whenStatements:{name:Vz.whenStatements,defaultValue:[]}},superTypes:[]},EmGwtStatement:{name:UJt.$type,properties:{entityIdentifier:{name:UJt.entityIdentifier,referenceType:dDe.$type}},superTypes:[]},EmModelEntity:{name:dDe.$type,properties:{name:{name:dDe.name}},superTypes:[]},EmNoteEntity:{name:aie.$type,properties:{dataBlockValue:{name:aie.dataBlockValue},dataType:{name:aie.dataType},sourceFrame:{name:aie.sourceFrame,referenceType:rk.$type}},superTypes:[]},EmResetFrame:{name:gb.$type,properties:{dataInlineValue:{name:gb.dataInlineValue},dataReference:{name:gb.dataReference,referenceType:aD.$type},dataType:{name:gb.dataType},entityIdentifier:{name:gb.entityIdentifier},modelEntityType:{name:gb.modelEntityType},name:{name:gb.name},sourceFrames:{name:gb.sourceFrames,defaultValue:[],referenceType:rk.$type}},superTypes:[rk.$type]},EmTimeFrame:{name:Pw.$type,properties:{dataInlineValue:{name:Pw.dataInlineValue},dataReference:{name:Pw.dataReference,referenceType:aD.$type},dataType:{name:Pw.dataType},entityIdentifier:{name:Pw.entityIdentifier},modelEntityType:{name:Pw.modelEntityType},name:{name:Pw.name},sourceFrames:{name:Pw.sourceFrames,defaultValue:[],referenceType:rk.$type}},superTypes:[rk.$type]},Entry:{name:fDe.$type,properties:{axis:{name:fDe.axis,referenceType:Zne.$type},value:{name:fDe.value}},superTypes:[]},EventModel:{name:mb.$type,properties:{accDescr:{name:mb.accDescr},accTitle:{name:mb.accTitle},dataEntities:{name:mb.dataEntities,defaultValue:[]},frames:{name:mb.frames,defaultValue:[]},gwtEntities:{name:mb.gwtEntities,defaultValue:[]},modelEntities:{name:mb.modelEntities,defaultValue:[]},noteEntities:{name:mb.noteEntities,defaultValue:[]},title:{name:mb.title}},superTypes:[]},Evolution:{name:QJt.$type,properties:{stages:{name:QJt.stages,defaultValue:[]}},superTypes:[]},EvolutionStage:{name:oie.$type,properties:{boundary:{name:oie.boundary},name:{name:oie.name},secondName:{name:oie.secondName}},superTypes:[]},Evolve:{name:pDe.$type,properties:{component:{name:pDe.component},target:{name:pDe.target}},superTypes:[]},GitGraph:{name:nk.$type,properties:{accDescr:{name:nk.accDescr},accTitle:{name:nk.accTitle},statements:{name:nk.statements,defaultValue:[]},title:{name:nk.title}},superTypes:[]},Group:{name:Qz.$type,properties:{icon:{name:Qz.icon},id:{name:Qz.id},in:{name:Qz.in},title:{name:Qz.title}},superTypes:[]},Info:{name:Gz.$type,properties:{accDescr:{name:Gz.accDescr},accTitle:{name:Gz.accTitle},title:{name:Gz.title}},superTypes:[]},Item:{name:Hz.$type,properties:{classSelector:{name:Hz.classSelector},name:{name:Hz.name}},superTypes:[]},Junction:{name:gDe.$type,properties:{id:{name:gDe.id},in:{name:gDe.in}},superTypes:[]},Label:{name:Wz.$type,properties:{negX:{name:Wz.negX,defaultValue:!1},negY:{name:Wz.negY,defaultValue:!1},offsetX:{name:Wz.offsetX},offsetY:{name:Wz.offsetY}},superTypes:[]},Leaf:{name:sie.$type,properties:{classSelector:{name:sie.classSelector},name:{name:sie.name},value:{name:sie.value}},superTypes:[Hz.$type]},Link:{name:ik.$type,properties:{arrow:{name:ik.arrow},from:{name:ik.from},fromPort:{name:ik.fromPort},linkLabel:{name:ik.linkLabel},to:{name:ik.to},toPort:{name:ik.toPort}},superTypes:[]},Merge:{name:oD.$type,properties:{branch:{name:oD.branch},id:{name:oD.id},tags:{name:oD.tags,defaultValue:[]},type:{name:oD.type}},superTypes:[pD.$type]},Note:{name:lie.$type,properties:{evolution:{name:lie.evolution},text:{name:lie.text},visibility:{name:lie.visibility}},superTypes:[]},Option:{name:mDe.$type,properties:{name:{name:mDe.name},value:{name:mDe.value,defaultValue:!1}},superTypes:[]},Packet:{name:sD.$type,properties:{accDescr:{name:sD.accDescr},accTitle:{name:sD.accTitle},blocks:{name:sD.blocks,defaultValue:[]},title:{name:sD.title}},superTypes:[]},PacketBlock:{name:lD.$type,properties:{bits:{name:lD.bits},end:{name:lD.end},label:{name:lD.label},start:{name:lD.start}},superTypes:[]},PegAny:{name:GJt.$type,properties:{dot:{name:GJt.dot}},superTypes:[Yz.$type]},PegGroup:{name:HJt.$type,properties:{element:{name:HJt.element}},superTypes:[Yz.$type]},PegIdentifier:{name:WJt.$type,properties:{name:{name:WJt.name}},superTypes:[Yz.$type]},PegLiteral:{name:YJt.$type,properties:{value:{name:YJt.value}},superTypes:[Yz.$type]},PegOrderedChoice:{name:qJt.$type,properties:{alternatives:{name:qJt.alternatives,defaultValue:[]}},superTypes:[]},PegPrefix:{name:vDe.$type,properties:{operator:{name:vDe.operator},suffix:{name:vDe.suffix}},superTypes:[]},PegPrimary:{name:Yz.$type,properties:{},superTypes:[]},PegRule:{name:yDe.$type,properties:{definition:{name:yDe.definition},name:{name:yDe.name}},superTypes:[]},PegSequence:{name:jJt.$type,properties:{elements:{name:jJt.elements,defaultValue:[]}},superTypes:[]},PegSuffix:{name:bDe.$type,properties:{operator:{name:bDe.operator},primary:{name:bDe.primary}},superTypes:[]},Pie:{name:ak.$type,properties:{accDescr:{name:ak.accDescr},accTitle:{name:ak.accTitle},sections:{name:ak.sections,defaultValue:[]},showData:{name:ak.showData,defaultValue:!1},title:{name:ak.title}},superTypes:[]},PieSection:{name:cie.$type,properties:{label:{name:cie.label},value:{name:cie.value}},superTypes:[]},Pipeline:{name:xDe.$type,properties:{components:{name:xDe.components,defaultValue:[]},parent:{name:xDe.parent}},superTypes:[]},PipelineComponent:{name:uie.$type,properties:{evolution:{name:uie.evolution},label:{name:uie.label},name:{name:uie.name}},superTypes:[]},Radar:{name:ok.$type,properties:{accDescr:{name:ok.accDescr},accTitle:{name:ok.accTitle},axes:{name:ok.axes,defaultValue:[]},curves:{name:ok.curves,defaultValue:[]},options:{name:ok.options,defaultValue:[]},title:{name:ok.title}},superTypes:[]},Railroad:{name:cD.$type,properties:{accDescr:{name:cD.accDescr},accTitle:{name:cD.accTitle},rules:{name:cD.rules,defaultValue:[]},title:{name:cD.title}},superTypes:[]},RailroadAbnf:{name:uD.$type,properties:{accDescr:{name:uD.accDescr},accTitle:{name:uD.accTitle},rules:{name:uD.rules,defaultValue:[]},title:{name:uD.title}},superTypes:[]},RailroadChoiceExpr:{name:XJt.$type,properties:{alternatives:{name:XJt.alternatives,defaultValue:[]}},superTypes:[vb.$type]},RailroadEbnf:{name:hD.$type,properties:{accDescr:{name:hD.accDescr},accTitle:{name:hD.accTitle},rules:{name:hD.rules,defaultValue:[]},title:{name:hD.title}},superTypes:[]},RailroadExpression:{name:vb.$type,properties:{},superTypes:[]},RailroadNonTerminalExpr:{name:KJt.$type,properties:{name:{name:KJt.name}},superTypes:[vb.$type]},RailroadOneOrMoreExpr:{name:ZJt.$type,properties:{element:{name:ZJt.element}},superTypes:[vb.$type]},RailroadOptionalExpr:{name:JJt.$type,properties:{element:{name:JJt.element}},superTypes:[vb.$type]},RailroadPeg:{name:dD.$type,properties:{accDescr:{name:dD.accDescr},accTitle:{name:dD.accTitle},rules:{name:dD.rules,defaultValue:[]},title:{name:dD.title}},superTypes:[]},RailroadRule:{name:wDe.$type,properties:{definition:{name:wDe.definition},name:{name:wDe.name}},superTypes:[]},RailroadSequenceExpr:{name:eer.$type,properties:{elements:{name:eer.elements,defaultValue:[]}},superTypes:[vb.$type]},RailroadSpecialExpr:{name:ter.$type,properties:{text:{name:ter.text}},superTypes:[vb.$type]},RailroadTerminalExpr:{name:rer.$type,properties:{value:{name:rer.value}},superTypes:[vb.$type]},RailroadZeroOrMoreExpr:{name:ner.$type,properties:{element:{name:ner.element}},superTypes:[vb.$type]},Section:{name:ADe.$type,properties:{classSelector:{name:ADe.classSelector},name:{name:ADe.name}},superTypes:[Hz.$type]},Service:{name:fD.$type,properties:{icon:{name:fD.icon},iconText:{name:fD.iconText},id:{name:fD.id},in:{name:fD.in},title:{name:fD.title}},superTypes:[]},Size:{name:SDe.$type,properties:{height:{name:SDe.height},width:{name:SDe.width}},superTypes:[]},Statement:{name:pD.$type,properties:{},superTypes:[]},Transition:{name:qz.$type,properties:{from:{name:qz.from},label:{name:qz.label},to:{name:qz.to}},superTypes:[]},TreeNode:{name:mD.$type,properties:{classAnnotation:{name:mD.classAnnotation},descAnnotation:{name:mD.descAnnotation},iconAnnotation:{name:mD.iconAnnotation},indent:{name:mD.indent},name:{name:mD.name}},superTypes:[]},TreeView:{name:jz.$type,properties:{accDescr:{name:jz.accDescr},accTitle:{name:jz.accTitle},nodes:{name:jz.nodes,defaultValue:[]},title:{name:jz.title}},superTypes:[]},Treemap:{name:gD.$type,properties:{accDescr:{name:gD.accDescr},accTitle:{name:gD.accTitle},title:{name:gD.title},TreemapRows:{name:gD.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:TDe.$type,properties:{indent:{name:TDe.indent},item:{name:TDe.item}},superTypes:[]},Wardley:{name:Mc.$type,properties:{accDescr:{name:Mc.accDescr},accelerators:{name:Mc.accelerators,defaultValue:[]},accTitle:{name:Mc.accTitle},anchors:{name:Mc.anchors,defaultValue:[]},annotation:{name:Mc.annotation,defaultValue:[]},annotations:{name:Mc.annotations,defaultValue:[]},components:{name:Mc.components,defaultValue:[]},deaccelerators:{name:Mc.deaccelerators,defaultValue:[]},evolution:{name:Mc.evolution},evolves:{name:Mc.evolves,defaultValue:[]},links:{name:Mc.links,defaultValue:[]},notes:{name:Mc.notes,defaultValue:[]},pipelines:{name:Mc.pipelines,defaultValue:[]},size:{name:Mc.size},title:{name:Mc.title}},superTypes:[]}}}},$(AI,"MermaidAstReflection"),AI),Ts=new ier,aer,rZn=$(()=>aer??(aer=Zl(`{"$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"),oer,nZn=$(()=>oer??(oer=Zl(`{"$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"),ser,iZn=$(()=>ser??(ser=Zl('{"$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"),ler,aZn=$(()=>ler??(ler=Zl(`{"$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"),cer,oZn=$(()=>cer??(cer=Zl(`{"$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"),uer,sZn=$(()=>uer??(uer=Zl(`{"$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"),her,lZn=$(()=>her??(her=Zl(`{"$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"),der,cZn=$(()=>der??(der=Zl(`{"$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"),fer,uZn=$(()=>fer??(fer=Zl('{"$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"),per,hZn=$(()=>per??(per=Zl(`{"$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"),ger,dZn=$(()=>ger??(ger=Zl(`{"$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"),mer,fZn=$(()=>mer??(mer=Zl(`{"$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"),ver,pZn=$(()=>ver??(ver=Zl(`{"$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"),yer,gZn=$(()=>yer??(yer=Zl(`{"$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"),ber,mZn=$(()=>ber??(ber=Zl(`{"$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"),vZn={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},yZn={languageId:"cynefin",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},bZn={languageId:"eventmodeling",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},xZn={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},wZn={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},AZn={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},SZn={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},TZn={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},CZn={languageId:"railroadAbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},OZn={languageId:"railroadEbnf",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},kZn={languageId:"railroad",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},EZn={languageId:"railroadPeg",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},_Zn={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},RZn={languageId:"treeView",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},DZn={languageId:"wardley",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},gh={AstReflection:$(()=>new ier,"AstReflection")},LZn={Grammar:$(()=>rZn(),"Grammar"),LanguageMetaData:$(()=>vZn,"LanguageMetaData"),parser:{}},MZn={Grammar:$(()=>nZn(),"Grammar"),LanguageMetaData:$(()=>yZn,"LanguageMetaData"),parser:{}},IZn={Grammar:$(()=>iZn(),"Grammar"),LanguageMetaData:$(()=>bZn,"LanguageMetaData"),parser:{}},PZn={Grammar:$(()=>aZn(),"Grammar"),LanguageMetaData:$(()=>xZn,"LanguageMetaData"),parser:{}},NZn={Grammar:$(()=>oZn(),"Grammar"),LanguageMetaData:$(()=>wZn,"LanguageMetaData"),parser:{}},BZn={Grammar:$(()=>sZn(),"Grammar"),LanguageMetaData:$(()=>AZn,"LanguageMetaData"),parser:{}},$Zn={Grammar:$(()=>lZn(),"Grammar"),LanguageMetaData:$(()=>SZn,"LanguageMetaData"),parser:{}},FZn={Grammar:$(()=>cZn(),"Grammar"),LanguageMetaData:$(()=>TZn,"LanguageMetaData"),parser:{}},zZn={Grammar:$(()=>uZn(),"Grammar"),LanguageMetaData:$(()=>CZn,"LanguageMetaData"),parser:{}},UZn={Grammar:$(()=>hZn(),"Grammar"),LanguageMetaData:$(()=>OZn,"LanguageMetaData"),parser:{}},VZn={Grammar:$(()=>dZn(),"Grammar"),LanguageMetaData:$(()=>kZn,"LanguageMetaData"),parser:{}},QZn={Grammar:$(()=>fZn(),"Grammar"),LanguageMetaData:$(()=>EZn,"LanguageMetaData"),parser:{}},GZn={Grammar:$(()=>pZn(),"Grammar"),LanguageMetaData:$(()=>_Zn,"LanguageMetaData"),parser:{}},HZn={Grammar:$(()=>gZn(),"Grammar"),LanguageMetaData:$(()=>RZn,"LanguageMetaData"),parser:{}},WZn={Grammar:$(()=>mZn(),"Grammar"),LanguageMetaData:$(()=>DZn,"LanguageMetaData"),parser:{}},YZn=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,qZn=/accTitle[\t ]*:([^\n\r]*)/,jZn=/title([\t ][^\n\r]*|)/,XZn={ACC_DESCR:YZn,ACC_TITLE:qZn,TITLE:jZn},xv=(SI=class extends d3e{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=XZn[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,` `)}}},$(SI,"AbstractMermaidValueConverter"),SI),vD=(TI=class extends xv{runCustomConverter(e,r,n){}},$(TI,"CommonValueConverter"),TI),mh=(CI=class extends Lne{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}},$(CI,"AbstractMermaidTokenBuilder"),CI);OI=class extends mh{},$(OI,"CommonTokenBuilder");/*! Bundled license information: lodash-es/lodash.js: @@ -1759,12 +1759,12 @@ ${r}`),this.inline?`{${i}}`:i}},$(sI,"JSDocTagImpl"),sI);function iJt(t,e,r){var * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors *) - */var jZn=(kI=class extends mh{constructor(){super(["radar-beta"])}},$(kI,"RadarTokenBuilder"),kI),yer={parser:{TokenBuilder:$(()=>new jZn,"TokenBuilder"),ValueConverter:$(()=>new vD,"ValueConverter")}};function ber(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),BZn,yer);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}$(ber,"createRadarServices");var XZn=(EI=class extends mh{constructor(){super(["railroad-beta"])}},$(EI,"RailroadTokenBuilder"),EI),xer=$(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew XZn,"TokenBuilder"),ValueConverter:$(()=>new KZn,"ValueConverter")}};function CDe(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),zZn,wer);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}$(CDe,"createRailroadServices");var ZZn=(RI=class extends mh{constructor(){super(["railroad-ebnf-beta"])}},$(RI,"RailroadEbnfTokenBuilder"),RI),Aer=$(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew ZZn,"TokenBuilder"),ValueConverter:$(()=>new JZn,"ValueConverter")}};function ODe(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),FZn,Ser);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}$(ODe,"createRailroadEbnfServices");var eJn=(LI=class extends mh{constructor(){super(["railroad-abnf-beta"])}},$(LI,"RailroadAbnfTokenBuilder"),LI),tJn=(MI=class extends xv{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)}},$(MI,"RailroadAbnfValueConverter"),MI),Ter={parser:{TokenBuilder:$(()=>new eJn,"TokenBuilder"),ValueConverter:$(()=>new tJn,"ValueConverter")}};function kDe(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),$Zn,Ter);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}$(kDe,"createRailroadAbnfServices");var rJn=(II=class extends mh{constructor(){super(["railroad-peg-beta"])}},$(II,"RailroadPegTokenBuilder"),II),Cer=$(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew rJn,"TokenBuilder"),ValueConverter:$(()=>new nJn,"ValueConverter")}};function EDe(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),UZn,Oer);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}$(EDe,"createRailroadPegServices");var iJn=(NI=class extends mh{constructor(){super(["treemap"])}},$(NI,"TreemapTokenBuilder"),NI),aJn=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,oJn=(BI=class extends xv{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=aJn.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},$(BI,"TreemapValueConverter"),BI);function ker(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}$(ker,"registerValidationChecks");var sJn=($I=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"}))}},$($I,"TreemapValidator"),$I),Eer={parser:{TokenBuilder:$(()=>new iJn,"TokenBuilder"),ValueConverter:$(()=>new oJn,"ValueConverter")},validation:{TreemapValidator:$(()=>new sJn,"TreemapValidator")}};function _er(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),VZn,Eer);return e.ServiceRegistry.register(r),ker(r),{shared:e,Treemap:r}}$(_er,"createTreemapServices");var lJn=(FI=class extends xv{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},$(FI,"WardleyValueConverter"),FI),Rer={parser:{ValueConverter:$(()=>new lJn,"ValueConverter")}};function Der(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),GZn,Rer);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}$(Der,"createWardleyServices");var cJn=(zI=class extends mh{constructor(){super(["cynefin-beta"])}},$(zI,"CynefinTokenBuilder"),zI),Ler={parser:{TokenBuilder:$(()=>new cJn,"TokenBuilder"),ValueConverter:$(()=>new vD,"ValueConverter")}};function Mer(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),DZn,Ler);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}$(Mer,"createCynefinServices");var uJn=(UI=class extends mh{constructor(){super(["gitGraph"])}},$(UI,"GitGraphTokenBuilder"),UI),Ier={parser:{TokenBuilder:$(()=>new uJn,"TokenBuilder"),ValueConverter:$(()=>new vD,"ValueConverter")}};function Per(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),MZn,Ier);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}$(Per,"createGitGraphServices");var hJn=(VI=class extends mh{constructor(){super(["info","showInfo"])}},$(VI,"InfoTokenBuilder"),VI),Ner={parser:{TokenBuilder:$(()=>new hJn,"TokenBuilder"),ValueConverter:$(()=>new vD,"ValueConverter")}};function Ber(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),IZn,Ner);return e.ServiceRegistry.register(r),{shared:e,Info:r}}$(Ber,"createInfoServices");var dJn=(QI=class extends mh{constructor(){super(["packet"])}},$(QI,"PacketTokenBuilder"),QI),$er={parser:{TokenBuilder:$(()=>new dJn,"TokenBuilder"),ValueConverter:$(()=>new vD,"ValueConverter")}};function Fer(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),PZn,$er);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}$(Fer,"createPacketServices");var fJn=(GI=class extends mh{constructor(){super(["pie","showData"])}},$(GI,"PieTokenBuilder"),GI),pJn=(HI=class extends xv{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},$(HI,"PieValueConverter"),HI),zer={parser:{TokenBuilder:$(()=>new fJn,"TokenBuilder"),ValueConverter:$(()=>new pJn,"ValueConverter")}};function Uer(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),NZn,zer);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}$(Uer,"createPieServices");var gJn=(WI=class extends xv{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()}},$(WI,"TreeViewValueConverter"),WI),mJn=(YI=class extends mh{constructor(){super(["treeView-beta"])}},$(YI,"TreeViewTokenBuilder"),YI),Ver={parser:{TokenBuilder:$(()=>new mJn,"TokenBuilder"),ValueConverter:$(()=>new gJn,"ValueConverter")}};function Qer(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),QZn,Ver);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}$(Qer,"createTreeViewServices");var vJn=(qI=class extends mh{constructor(){super(["architecture"])}},$(qI,"ArchitectureTokenBuilder"),qI),yJn=(jI=class extends xv{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()}}},$(jI,"ArchitectureValueConverter"),jI),Ger={parser:{TokenBuilder:$(()=>new vJn,"TokenBuilder"),ValueConverter:$(()=>new yJn,"ValueConverter")}};function Her(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),RZn,Ger);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}$(Her,"createArchitectureServices");var bJn=(XI=class extends mh{constructor(){super(["eventmodeling"])}},$(XI,"EventModelingTokenBuilder"),XI),Wer=new Set(["cmd","command"]),Yer=new Set(["evt","event"]),_De=new Set(["rmo","readmodel"]),qer=new Set(["pcr","processor"]),jer=new Set(["ui"]);function Xer(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)}}$(Xer,"registerValidationChecks");var xJn=(KI=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(Wer.has(e.modelEntityType)?this.validateSources(e,new Set([...jer,...qer]),"command","ui or processor",r):Yer.has(e.modelEntityType)?this.validateSources(e,Wer,"event","command",r):_De.has(e.modelEntityType)?this.validateSources(e,Yer,"read model","event",r):qer.has(e.modelEntityType)?this.validateSources(e,_De,"processor","read model",r):jer.has(e.modelEntityType)&&this.validateSources(e,_De,"ui","read model",r))}validateSources(e,r,n,i,a){for(const o of e.sourceFrames){const s=o.ref;s!==void 0&&!r.has(s.modelEntityType)&&a("error",`A ${n} can only receive input from a ${i}, not from '${s.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},$(KI,"EventModelingValidator"),KI),Ker={parser:{TokenBuilder:$(()=>new bJn,"TokenBuilder"),ValueConverter:$(()=>new vD,"ValueConverter")},validation:{EventModelingValidator:$(()=>new xJn,"EventModelingValidator")}};function Zer(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),LZn,Ker);return e.ServiceRegistry.register(r),Xer(r),{shared:e,EventModel:r}}$(Zer,"createEventModelingServices");var Ic={},wJn={info:$(async()=>{const{createInfoServices:t}=await Promise.resolve().then(()=>Qdi),e=t().Info.parser.LangiumParser;Ic.info=e},"info"),packet:$(async()=>{const{createPacketServices:t}=await Promise.resolve().then(()=>Gdi),e=t().Packet.parser.LangiumParser;Ic.packet=e},"packet"),pie:$(async()=>{const{createPieServices:t}=await Promise.resolve().then(()=>Hdi),e=t().Pie.parser.LangiumParser;Ic.pie=e},"pie"),treeView:$(async()=>{const{createTreeViewServices:t}=await Promise.resolve().then(()=>Wdi),e=t().TreeView.parser.LangiumParser;Ic.treeView=e},"treeView"),architecture:$(async()=>{const{createArchitectureServices:t}=await Promise.resolve().then(()=>Ydi),e=t().Architecture.parser.LangiumParser;Ic.architecture=e},"architecture"),gitGraph:$(async()=>{const{createGitGraphServices:t}=await Promise.resolve().then(()=>qdi),e=t().GitGraph.parser.LangiumParser;Ic.gitGraph=e},"gitGraph"),eventmodeling:$(async()=>{const{createEventModelingServices:t}=await Promise.resolve().then(()=>jdi),e=t().EventModel.parser.LangiumParser;Ic.eventmodeling=e},"eventmodeling"),radar:$(async()=>{const{createRadarServices:t}=await Promise.resolve().then(()=>Xdi),e=t().Radar.parser.LangiumParser;Ic.radar=e},"radar"),railroad:$(async()=>{const{createRailroadServices:t}=await Promise.resolve().then(()=>Kdi),e=t().Railroad.parser.LangiumParser;Ic.railroad=e},"railroad"),railroadEbnf:$(async()=>{const{createRailroadEbnfServices:t}=await Promise.resolve().then(()=>Zdi),e=t().RailroadEbnf.parser.LangiumParser;Ic.railroadEbnf=e},"railroadEbnf"),railroadAbnf:$(async()=>{const{createRailroadAbnfServices:t}=await Promise.resolve().then(()=>Jdi),e=t().RailroadAbnf.parser.LangiumParser;Ic.railroadAbnf=e},"railroadAbnf"),railroadPeg:$(async()=>{const{createRailroadPegServices:t}=await Promise.resolve().then(()=>efi),e=t().RailroadPeg.parser.LangiumParser;Ic.railroadPeg=e},"railroadPeg"),treemap:$(async()=>{const{createTreemapServices:t}=await Promise.resolve().then(()=>tfi),e=t().Treemap.parser.LangiumParser;Ic.treemap=e},"treemap"),wardley:$(async()=>{const{createWardleyServices:t}=await Promise.resolve().then(()=>rfi),e=t().Wardley.parser.LangiumParser;Ic.wardley=e},"wardley"),cynefin:$(async()=>{const{createCynefinServices:t}=await Promise.resolve().then(()=>nfi),e=t().Cynefin.parser.LangiumParser;Ic.cynefin=e},"cynefin")};async function Qp(t,e){const r=wJn[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);Ic[t]||await r();const i=Ic[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new Xz(i);return i.value}$(Qp,"parse");var Xz=(ZI=class extends Error{constructor(e){const r=e.lexerErrors.map(i=>{const a=i.line!==void 0&&!isNaN(i.line)?i.line:"?",o=i.column!==void 0&&!isNaN(i.column)?i.column:"?";return`Lexer error on line ${a}, column ${o}: ${i.message}`}).join(` + */var KZn=(kI=class extends mh{constructor(){super(["radar-beta"])}},$(kI,"RadarTokenBuilder"),kI),xer={parser:{TokenBuilder:$(()=>new KZn,"TokenBuilder"),ValueConverter:$(()=>new vD,"ValueConverter")}};function wer(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),FZn,xer);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}$(wer,"createRadarServices");var ZZn=(EI=class extends mh{constructor(){super(["railroad-beta"])}},$(EI,"RailroadTokenBuilder"),EI),Aer=$(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew ZZn,"TokenBuilder"),ValueConverter:$(()=>new JZn,"ValueConverter")}};function CDe(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),VZn,Ser);return e.ServiceRegistry.register(r),{shared:e,Railroad:r}}$(CDe,"createRailroadServices");var eJn=(RI=class extends mh{constructor(){super(["railroad-ebnf-beta"])}},$(RI,"RailroadEbnfTokenBuilder"),RI),Ter=$(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew eJn,"TokenBuilder"),ValueConverter:$(()=>new tJn,"ValueConverter")}};function ODe(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),UZn,Cer);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}$(ODe,"createRailroadEbnfServices");var rJn=(LI=class extends mh{constructor(){super(["railroad-abnf-beta"])}},$(LI,"RailroadAbnfTokenBuilder"),LI),nJn=(MI=class extends xv{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)}},$(MI,"RailroadAbnfValueConverter"),MI),Oer={parser:{TokenBuilder:$(()=>new rJn,"TokenBuilder"),ValueConverter:$(()=>new nJn,"ValueConverter")}};function kDe(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),zZn,Oer);return e.ServiceRegistry.register(r),{shared:e,RailroadAbnf:r}}$(kDe,"createRailroadAbnfServices");var iJn=(II=class extends mh{constructor(){super(["railroad-peg-beta"])}},$(II,"RailroadPegTokenBuilder"),II),ker=$(t=>{const e=t.slice(1,-1);let r="";for(let n=0;nnew iJn,"TokenBuilder"),ValueConverter:$(()=>new aJn,"ValueConverter")}};function EDe(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),QZn,Eer);return e.ServiceRegistry.register(r),{shared:e,RailroadPeg:r}}$(EDe,"createRailroadPegServices");var oJn=(NI=class extends mh{constructor(){super(["treemap"])}},$(NI,"TreemapTokenBuilder"),NI),sJn=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,lJn=(BI=class extends xv{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=sJn.exec(r);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},$(BI,"TreemapValueConverter"),BI);function _er(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}$(_er,"registerValidationChecks");var cJn=($I=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"}))}},$($I,"TreemapValidator"),$I),Rer={parser:{TokenBuilder:$(()=>new oJn,"TokenBuilder"),ValueConverter:$(()=>new lJn,"ValueConverter")},validation:{TreemapValidator:$(()=>new cJn,"TreemapValidator")}};function Der(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),GZn,Rer);return e.ServiceRegistry.register(r),_er(r),{shared:e,Treemap:r}}$(Der,"createTreemapServices");var uJn=(FI=class extends xv{runCustomConverter(e,r,n){switch(e.name.toUpperCase()){case"LINK_LABEL":return r.substring(1).trim();default:return}}},$(FI,"WardleyValueConverter"),FI),Ler={parser:{ValueConverter:$(()=>new uJn,"ValueConverter")}};function Mer(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),WZn,Ler);return e.ServiceRegistry.register(r),{shared:e,Wardley:r}}$(Mer,"createWardleyServices");var hJn=(zI=class extends mh{constructor(){super(["cynefin-beta"])}},$(zI,"CynefinTokenBuilder"),zI),Ier={parser:{TokenBuilder:$(()=>new hJn,"TokenBuilder"),ValueConverter:$(()=>new vD,"ValueConverter")}};function Per(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),MZn,Ier);return e.ServiceRegistry.register(r),{shared:e,Cynefin:r}}$(Per,"createCynefinServices");var dJn=(UI=class extends mh{constructor(){super(["gitGraph"])}},$(UI,"GitGraphTokenBuilder"),UI),Ner={parser:{TokenBuilder:$(()=>new dJn,"TokenBuilder"),ValueConverter:$(()=>new vD,"ValueConverter")}};function Ber(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),PZn,Ner);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}$(Ber,"createGitGraphServices");var fJn=(VI=class extends mh{constructor(){super(["info","showInfo"])}},$(VI,"InfoTokenBuilder"),VI),$er={parser:{TokenBuilder:$(()=>new fJn,"TokenBuilder"),ValueConverter:$(()=>new vD,"ValueConverter")}};function Fer(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),NZn,$er);return e.ServiceRegistry.register(r),{shared:e,Info:r}}$(Fer,"createInfoServices");var pJn=(QI=class extends mh{constructor(){super(["packet"])}},$(QI,"PacketTokenBuilder"),QI),zer={parser:{TokenBuilder:$(()=>new pJn,"TokenBuilder"),ValueConverter:$(()=>new vD,"ValueConverter")}};function Uer(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),BZn,zer);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}$(Uer,"createPacketServices");var gJn=(GI=class extends mh{constructor(){super(["pie","showData"])}},$(GI,"PieTokenBuilder"),GI),mJn=(HI=class extends xv{runCustomConverter(e,r,n){if(e.name==="PIE_SECTION_LABEL")return r.replace(/"/g,"").trim()}},$(HI,"PieValueConverter"),HI),Ver={parser:{TokenBuilder:$(()=>new gJn,"TokenBuilder"),ValueConverter:$(()=>new mJn,"ValueConverter")}};function Qer(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),$Zn,Ver);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}$(Qer,"createPieServices");var vJn=(WI=class extends xv{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()}},$(WI,"TreeViewValueConverter"),WI),yJn=(YI=class extends mh{constructor(){super(["treeView-beta"])}},$(YI,"TreeViewTokenBuilder"),YI),Ger={parser:{TokenBuilder:$(()=>new yJn,"TokenBuilder"),ValueConverter:$(()=>new vJn,"ValueConverter")}};function Her(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),HZn,Ger);return e.ServiceRegistry.register(r),{shared:e,TreeView:r}}$(Her,"createTreeViewServices");var bJn=(qI=class extends mh{constructor(){super(["architecture"])}},$(qI,"ArchitectureTokenBuilder"),qI),xJn=(jI=class extends xv{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()}}},$(jI,"ArchitectureValueConverter"),jI),Wer={parser:{TokenBuilder:$(()=>new bJn,"TokenBuilder"),ValueConverter:$(()=>new xJn,"ValueConverter")}};function Yer(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),LZn,Wer);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}$(Yer,"createArchitectureServices");var wJn=(XI=class extends mh{constructor(){super(["eventmodeling"])}},$(XI,"EventModelingTokenBuilder"),XI),qer=new Set(["cmd","command"]),jer=new Set(["evt","event"]),_De=new Set(["rmo","readmodel"]),Xer=new Set(["pcr","processor"]),Ker=new Set(["ui"]);function Zer(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)}}$(Zer,"registerValidationChecks");var AJn=(KI=class{checkSourceFrameTypes(e,r){e.sourceFrames.length!==0&&(qer.has(e.modelEntityType)?this.validateSources(e,new Set([...Ker,...Xer]),"command","ui or processor",r):jer.has(e.modelEntityType)?this.validateSources(e,qer,"event","command",r):_De.has(e.modelEntityType)?this.validateSources(e,jer,"read model","event",r):Xer.has(e.modelEntityType)?this.validateSources(e,_De,"processor","read model",r):Ker.has(e.modelEntityType)&&this.validateSources(e,_De,"ui","read model",r))}validateSources(e,r,n,i,a){for(const o of e.sourceFrames){const s=o.ref;s!==void 0&&!r.has(s.modelEntityType)&&a("error",`A ${n} can only receive input from a ${i}, not from '${s.modelEntityType}'.`,{node:e,property:"sourceFrames"})}}},$(KI,"EventModelingValidator"),KI),Jer={parser:{TokenBuilder:$(()=>new wJn,"TokenBuilder"),ValueConverter:$(()=>new vD,"ValueConverter")},validation:{EventModelingValidator:$(()=>new AJn,"EventModelingValidator")}};function etr(t=Lc){const e=Mi(Kl(t),gh),r=Mi(Xl({shared:e}),IZn,Jer);return e.ServiceRegistry.register(r),Zer(r),{shared:e,EventModel:r}}$(etr,"createEventModelingServices");var Ic={},SJn={info:$(async()=>{const{createInfoServices:t}=await Promise.resolve().then(()=>Hdi),e=t().Info.parser.LangiumParser;Ic.info=e},"info"),packet:$(async()=>{const{createPacketServices:t}=await Promise.resolve().then(()=>Wdi),e=t().Packet.parser.LangiumParser;Ic.packet=e},"packet"),pie:$(async()=>{const{createPieServices:t}=await Promise.resolve().then(()=>Ydi),e=t().Pie.parser.LangiumParser;Ic.pie=e},"pie"),treeView:$(async()=>{const{createTreeViewServices:t}=await Promise.resolve().then(()=>qdi),e=t().TreeView.parser.LangiumParser;Ic.treeView=e},"treeView"),architecture:$(async()=>{const{createArchitectureServices:t}=await Promise.resolve().then(()=>jdi),e=t().Architecture.parser.LangiumParser;Ic.architecture=e},"architecture"),gitGraph:$(async()=>{const{createGitGraphServices:t}=await Promise.resolve().then(()=>Xdi),e=t().GitGraph.parser.LangiumParser;Ic.gitGraph=e},"gitGraph"),eventmodeling:$(async()=>{const{createEventModelingServices:t}=await Promise.resolve().then(()=>Kdi),e=t().EventModel.parser.LangiumParser;Ic.eventmodeling=e},"eventmodeling"),radar:$(async()=>{const{createRadarServices:t}=await Promise.resolve().then(()=>Zdi),e=t().Radar.parser.LangiumParser;Ic.radar=e},"radar"),railroad:$(async()=>{const{createRailroadServices:t}=await Promise.resolve().then(()=>Jdi),e=t().Railroad.parser.LangiumParser;Ic.railroad=e},"railroad"),railroadEbnf:$(async()=>{const{createRailroadEbnfServices:t}=await Promise.resolve().then(()=>efi),e=t().RailroadEbnf.parser.LangiumParser;Ic.railroadEbnf=e},"railroadEbnf"),railroadAbnf:$(async()=>{const{createRailroadAbnfServices:t}=await Promise.resolve().then(()=>tfi),e=t().RailroadAbnf.parser.LangiumParser;Ic.railroadAbnf=e},"railroadAbnf"),railroadPeg:$(async()=>{const{createRailroadPegServices:t}=await Promise.resolve().then(()=>rfi),e=t().RailroadPeg.parser.LangiumParser;Ic.railroadPeg=e},"railroadPeg"),treemap:$(async()=>{const{createTreemapServices:t}=await Promise.resolve().then(()=>nfi),e=t().Treemap.parser.LangiumParser;Ic.treemap=e},"treemap"),wardley:$(async()=>{const{createWardleyServices:t}=await Promise.resolve().then(()=>ifi),e=t().Wardley.parser.LangiumParser;Ic.wardley=e},"wardley"),cynefin:$(async()=>{const{createCynefinServices:t}=await Promise.resolve().then(()=>afi),e=t().Cynefin.parser.LangiumParser;Ic.cynefin=e},"cynefin")};async function Qp(t,e){const r=SJn[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);Ic[t]||await r();const i=Ic[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new Xz(i);return i.value}$(Qp,"parse");var Xz=(ZI=class extends Error{constructor(e){const r=e.lexerErrors.map(i=>{const a=i.line!==void 0&&!isNaN(i.line)?i.line:"?",o=i.column!==void 0&&!isNaN(i.column)?i.column:"?";return`Lexer error on line ${a}, column ${o}: ${i.message}`}).join(` `),n=e.parserErrors.map(i=>{const a=i.token.startLine!==void 0&&!isNaN(i.token.startLine)?i.token.startLine:"?",o=i.token.startColumn!==void 0&&!isNaN(i.token.startColumn)?i.token.startColumn:"?";return`Parse error on line ${a}, column ${o}: ${i.message}`}).join(` -`);super(`Parsing failed: ${r} ${n}`),this.result=e}},$(ZI,"MermaidParseError"),ZI),Sa={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},AJn=Jn.gitGraph,sk=O(()=>uo({...AJn,...Dr().gitGraph}),"getConfig"),cr=new c_e(()=>{const t=sk(),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 hie(){return sCt({length:7})}O(hie,"getID");function Jer(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},[])}O(Jer,"uniqBy");var SJn=O(function(t){cr.records.direction=t},"setDirection"),TJn=O(function(t){ye.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{cr.records.options=JSON.parse(t)}catch(e){ye.error("error while parsing gitGraph options",e.message)}},"setOptions"),CJn=O(function(){return cr.records.options},"getOptions"),OJn=O(function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;ye.info("commit",e,r,n,i),ye.debug("Entering commit:",e,r,n,i);const a=sk();r=Xt.sanitizeText(r,a),e=Xt.sanitizeText(e,a),i=i==null?void 0:i.map(s=>Xt.sanitizeText(s,a));const o={id:r||cr.records.seq+"-"+hie(),message:e,seq:cr.records.seq++,type:n??Sa.NORMAL,tags:i??[],parents:cr.records.head==null?[]:[cr.records.head.id],branch:cr.records.currBranch};cr.records.head=o,ye.info("main branch",a.mainBranchName),cr.records.commits.has(o.id)&&ye.warn(`Commit ID ${o.id} already exists`),cr.records.commits.set(o.id,o),cr.records.branches.set(cr.records.currBranch,o.id),ye.debug("in pushCommit "+o.id)},"commit"),kJn=O(function(t){let e=t.name;const r=t.order;if(e=Xt.sanitizeText(e,sk()),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}),etr(e),ye.debug("in createBranch")},"branch"),EJn=O(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,a=sk();e=Xt.sanitizeText(e,a),r&&(r=Xt.sanitizeText(r,a));const o=cr.records.branches.get(cr.records.currBranch),s=cr.records.branches.get(e),l=o?cr.records.commits.get(o):void 0,u=s?cr.records.commits.get(s):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=s||"",d={id:r||`${cr.records.seq}-${hie()}`,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:Sa.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),ye.debug(cr.records.branches),ye.debug("in mergeBranch")},"merge"),_Jn=O(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;ye.debug("Entering cherryPick:",e,r,n);const a=sk();if(e=Xt.sanitizeText(e,a),r=Xt.sanitizeText(r,a),n=n==null?void 0:n.map(l=>Xt.sanitizeText(l,a)),i=Xt.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 o=cr.records.commits.get(e);if(o===void 0||!o)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(o.parents)&&o.parents.includes(i)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const s=o.branch;if(o.type===Sa.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(s===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+"-"+hie(),message:`cherry-picked ${o==null?void 0:o.message} into ${cr.records.currBranch}`,seq:cr.records.seq++,parents:cr.records.head==null?[]:[cr.records.head.id,o.id],branch:cr.records.currBranch,type:Sa.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${o.id}${o.type===Sa.MERGE?`|parent:${i}`:""}`]};cr.records.head=h,cr.records.commits.set(h.id,h),cr.records.branches.set(cr.records.currBranch,h.id),ye.debug(cr.records.branches),ye.debug("in cherryPick")}},"cherryPick"),etr=O(function(t){if(t=Xt.sanitizeText(t,sk()),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 RDe(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}O(RDe,"upsert");function DDe(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(ye.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const i=cr.records.commits.get(e.parents[0]);RDe(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]);RDe(t,e,i)}}t=Jer(t,i=>i.id),DDe(t)}O(DDe,"prettyPrintCommitHistory");var RJn=O(function(){ye.debug(cr.records.commits);const t=ttr()[0];DDe([t])},"prettyPrint"),DJn=O(function(){cr.reset(),_a()},"clear"),LJn=O(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"),MJn=O(function(){return cr.records.branches},"getBranches"),IJn=O(function(){return cr.records.commits},"getCommits"),ttr=O(function(){const t=[...cr.records.commits.values()];return t.forEach(function(e){ye.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),PJn=O(function(){return cr.records.currBranch},"getCurrentBranch"),NJn=O(function(){return cr.records.direction},"getDirection"),BJn=O(function(){return cr.records.head},"getHead"),rtr={commitType:Sa,getConfig:sk,setDirection:SJn,setOptions:TJn,getOptions:CJn,commit:OJn,branch:kJn,merge:EJn,cherryPick:_Jn,checkout:etr,prettyPrint:RJn,clear:DJn,getBranchesAsObjArray:LJn,getBranches:MJn,getCommits:IJn,getCommitsArray:ttr,getCurrentBranch:PJn,getDirection:NJn,getHead:BJn,setAccTitle:Ba,getAccTitle:oo,getAccDescription:lo,setAccDescription:so,setDiagramTitle:co,getDiagramTitle:$a},$Jn=O((t,e)=>{ah(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)FJn(r,e)},"populate"),FJn=O((t,e)=>{const n={Commit:O(i=>e.commit(zJn(i)),"Commit"),Branch:O(i=>e.branch(UJn(i)),"Branch"),Merge:O(i=>e.merge(VJn(i)),"Merge"),Checkout:O(i=>e.checkout(QJn(i)),"Checkout"),CherryPicking:O(i=>e.cherryPick(GJn(i)),"CherryPicking")}[t.$type];n?n(t):ye.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),zJn=O(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?Sa[t.type]:Sa.NORMAL,tags:t.tags??void 0}),"parseCommit"),UJn=O(t=>({name:t.name,order:t.order??0}),"parseBranch"),VJn=O(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?Sa[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),QJn=O(t=>t.branch,"parseCheckout"),GJn=O(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"),HJn={parse:O(async t=>{const e=await Qp("gitGraph",t);ye.debug(e),$Jn(e,rtr)},"parse")},Nw=10,Bw=40,wv=4,yb=2,lk=8,die=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),LDe=12,MDe=new Set(["redux-color","redux-dark-color"]),WJn=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),ck=O((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),ud=new Map,hd=new Map,fie=30,Kz=new Map,pie=[],bb=0,mi="LR",YJn=O(()=>{ud.clear(),hd.clear(),Kz.clear(),bb=0,pie=[],mi="LR"},"clear"),ntr=O(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"),itr=O(t=>{let e,r,n;return mi==="BT"?(r=O((i,a)=>i<=a,"comparisonFunc"),n=1/0):(r=O((i,a)=>i>=a,"comparisonFunc"),n=0),t.forEach(i=>{var o,s;const a=mi==="TB"||mi=="BT"?(o=hd.get(i))==null?void 0:o.y:(s=hd.get(i))==null?void 0:s.x;a!==void 0&&r(a,n)&&(e=i,n=a)}),e},"findClosestParent"),qJn=O(t=>{let e="",r=1/0;return t.forEach(n=>{const i=hd.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),jJn=O((t,e,r)=>{let n=r,i=r;const a=[];t.forEach(o=>{const s=e.get(o);if(!s)throw new Error(`Commit not found for key ${o}`);s.parents.length?(n=KJn(s),i=Math.max(n,i)):a.push(s),ZJn(s,n)}),n=i,a.forEach(o=>{JJn(o,n,r)}),t.forEach(o=>{const s=e.get(o);if(s!=null&&s.parents.length){const l=qJn(s.parents);n=hd.get(l).y-Bw,n<=i&&(i=n);const u=ud.get(s.branch).pos,h=n-Nw;hd.set(s.id,{x:u,y:h})}})},"setParallelBTPos"),XJn=O(t=>{var n;const e=itr(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=hd.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"),KJn=O(t=>XJn(t)+Bw,"calculateCommitPosition"),ZJn=O((t,e)=>{const r=ud.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+Nw;return hd.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),JJn=O((t,e,r)=>{const n=ud.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,a=n.pos;hd.set(t.id,{x:a,y:i})},"setRootPosition"),eei=O((t,e,r,n,i,a)=>{const{theme:o}=Ye(),s=die.has(o??""),l=MDe.has(o??""),u=WJn.has(o??"");if(a===Sa.HIGHLIGHT)t.append("rect").attr("x",r.x-10+(s?3:0)).attr("y",r.y-10+(s?3:0)).attr("width",s?14:20).attr("height",s?14:20).attr("class",`commit ${e.id} commit-highlight${ck(i,lk,l)} ${n}-outer`),t.append("rect").attr("x",r.x-6+(s?2:0)).attr("y",r.y-6+(s?2:0)).attr("width",s?8:12).attr("height",s?8:12).attr("class",`commit ${e.id} commit${ck(i,lk,l)} ${n}-inner`);else if(a===Sa.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",s?7:10).attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",s?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",s?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",s?7:10),h.attr("class",`commit ${e.id} commit${ck(i,lk,l)}`),a===Sa.MERGE){const d=t.append("circle");d.attr("cx",r.x),d.attr("cy",r.y),d.attr("r",s?5:6),d.attr("class",`commit ${n} ${e.id} commit${ck(i,lk,l)}`)}if(a===Sa.REVERSE){const d=t.append("path"),f=s?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${ck(i,lk,l)}`)}}},"drawCommitBullet"),tei=O((t,e,r,n,i)=>{var a;if(e.type!==Sa.CHERRY_PICK&&(e.customId&&e.type===Sa.MERGE||e.type!==Sa.MERGE)&&i.showCommitLabel){const o=t.append("g"),s=o.insert("rect").attr("class","commit-label-bkg"),l=o.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&&(s.attr("x",r.posWithOffset-u.width/2-yb).attr("y",r.y+13.5).attr("width",u.width+2*yb).attr("height",u.height+2*yb),mi==="TB"||mi==="BT"?(s.attr("x",r.x-(u.width+4*wv+5)).attr("y",r.y-12),l.attr("x",r.x-(u.width+4*wv)).attr("y",r.y+u.height-12)):l.attr("x",r.posWithOffset-u.width/2),i.rotateCommitLabel))if(mi==="TB"||mi==="BT")l.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),s.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;o.attr("transform","translate("+h+", "+d+") rotate(-45, "+n+", "+r.y+")")}}},"drawCommitLabel"),rei=O((t,e,r,n)=>{var i;if(e.tags.length>0){let a=0,o=0,s=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");o=Math.max(o,p.width),s=Math.max(s,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=s/2,g=r.y-19.2-f;if(d.attr("class","tag-label-bkg").attr("points",` +`);super(`Parsing failed: ${r} ${n}`),this.result=e}},$(ZI,"MermaidParseError"),ZI),Sa={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},TJn=Jn.gitGraph,sk=O(()=>uo({...TJn,...Dr().gitGraph}),"getConfig"),cr=new c_e(()=>{const t=sk(),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 hie(){return cCt({length:7})}O(hie,"getID");function ttr(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},[])}O(ttr,"uniqBy");var CJn=O(function(t){cr.records.direction=t},"setDirection"),OJn=O(function(t){ye.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{cr.records.options=JSON.parse(t)}catch(e){ye.error("error while parsing gitGraph options",e.message)}},"setOptions"),kJn=O(function(){return cr.records.options},"getOptions"),EJn=O(function(t){let e=t.msg,r=t.id;const n=t.type;let i=t.tags;ye.info("commit",e,r,n,i),ye.debug("Entering commit:",e,r,n,i);const a=sk();r=Xt.sanitizeText(r,a),e=Xt.sanitizeText(e,a),i=i==null?void 0:i.map(s=>Xt.sanitizeText(s,a));const o={id:r||cr.records.seq+"-"+hie(),message:e,seq:cr.records.seq++,type:n??Sa.NORMAL,tags:i??[],parents:cr.records.head==null?[]:[cr.records.head.id],branch:cr.records.currBranch};cr.records.head=o,ye.info("main branch",a.mainBranchName),cr.records.commits.has(o.id)&&ye.warn(`Commit ID ${o.id} already exists`),cr.records.commits.set(o.id,o),cr.records.branches.set(cr.records.currBranch,o.id),ye.debug("in pushCommit "+o.id)},"commit"),_Jn=O(function(t){let e=t.name;const r=t.order;if(e=Xt.sanitizeText(e,sk()),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}),rtr(e),ye.debug("in createBranch")},"branch"),RJn=O(t=>{let e=t.branch,r=t.id;const n=t.type,i=t.tags,a=sk();e=Xt.sanitizeText(e,a),r&&(r=Xt.sanitizeText(r,a));const o=cr.records.branches.get(cr.records.currBranch),s=cr.records.branches.get(e),l=o?cr.records.commits.get(o):void 0,u=s?cr.records.commits.get(s):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=s||"",d={id:r||`${cr.records.seq}-${hie()}`,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:Sa.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),ye.debug(cr.records.branches),ye.debug("in mergeBranch")},"merge"),DJn=O(function(t){let e=t.id,r=t.targetId,n=t.tags,i=t.parent;ye.debug("Entering cherryPick:",e,r,n);const a=sk();if(e=Xt.sanitizeText(e,a),r=Xt.sanitizeText(r,a),n=n==null?void 0:n.map(l=>Xt.sanitizeText(l,a)),i=Xt.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 o=cr.records.commits.get(e);if(o===void 0||!o)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(i&&!(Array.isArray(o.parents)&&o.parents.includes(i)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const s=o.branch;if(o.type===Sa.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(s===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+"-"+hie(),message:`cherry-picked ${o==null?void 0:o.message} into ${cr.records.currBranch}`,seq:cr.records.seq++,parents:cr.records.head==null?[]:[cr.records.head.id,o.id],branch:cr.records.currBranch,type:Sa.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${o.id}${o.type===Sa.MERGE?`|parent:${i}`:""}`]};cr.records.head=h,cr.records.commits.set(h.id,h),cr.records.branches.set(cr.records.currBranch,h.id),ye.debug(cr.records.branches),ye.debug("in cherryPick")}},"cherryPick"),rtr=O(function(t){if(t=Xt.sanitizeText(t,sk()),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 RDe(t,e,r){const n=t.indexOf(e);n===-1?t.push(r):t.splice(n,1,r)}O(RDe,"upsert");function DDe(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(ye.debug(n.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const i=cr.records.commits.get(e.parents[0]);RDe(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]);RDe(t,e,i)}}t=ttr(t,i=>i.id),DDe(t)}O(DDe,"prettyPrintCommitHistory");var LJn=O(function(){ye.debug(cr.records.commits);const t=ntr()[0];DDe([t])},"prettyPrint"),MJn=O(function(){cr.reset(),_a()},"clear"),IJn=O(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"),PJn=O(function(){return cr.records.branches},"getBranches"),NJn=O(function(){return cr.records.commits},"getCommits"),ntr=O(function(){const t=[...cr.records.commits.values()];return t.forEach(function(e){ye.debug(e.id)}),t.sort((e,r)=>e.seq-r.seq),t},"getCommitsArray"),BJn=O(function(){return cr.records.currBranch},"getCurrentBranch"),$Jn=O(function(){return cr.records.direction},"getDirection"),FJn=O(function(){return cr.records.head},"getHead"),itr={commitType:Sa,getConfig:sk,setDirection:CJn,setOptions:OJn,getOptions:kJn,commit:EJn,branch:_Jn,merge:RJn,cherryPick:DJn,checkout:rtr,prettyPrint:LJn,clear:MJn,getBranchesAsObjArray:IJn,getBranches:PJn,getCommits:NJn,getCommitsArray:ntr,getCurrentBranch:BJn,getDirection:$Jn,getHead:FJn,setAccTitle:Ba,getAccTitle:oo,getAccDescription:lo,setAccDescription:so,setDiagramTitle:co,getDiagramTitle:$a},zJn=O((t,e)=>{ah(t,e),t.dir&&e.setDirection(t.dir);for(const r of t.statements)UJn(r,e)},"populate"),UJn=O((t,e)=>{const n={Commit:O(i=>e.commit(VJn(i)),"Commit"),Branch:O(i=>e.branch(QJn(i)),"Branch"),Merge:O(i=>e.merge(GJn(i)),"Merge"),Checkout:O(i=>e.checkout(HJn(i)),"Checkout"),CherryPicking:O(i=>e.cherryPick(WJn(i)),"CherryPicking")}[t.$type];n?n(t):ye.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),VJn=O(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?Sa[t.type]:Sa.NORMAL,tags:t.tags??void 0}),"parseCommit"),QJn=O(t=>({name:t.name,order:t.order??0}),"parseBranch"),GJn=O(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?Sa[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),HJn=O(t=>t.branch,"parseCheckout"),WJn=O(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"),YJn={parse:O(async t=>{const e=await Qp("gitGraph",t);ye.debug(e),zJn(e,itr)},"parse")},Nw=10,Bw=40,wv=4,yb=2,lk=8,die=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),LDe=12,MDe=new Set(["redux-color","redux-dark-color"]),qJn=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),ck=O((t,e,r=!1)=>r&&t>0?(t-1)%(e-1)+1:t%e,"calcColorIndex"),ud=new Map,hd=new Map,fie=30,Kz=new Map,pie=[],bb=0,mi="LR",jJn=O(()=>{ud.clear(),hd.clear(),Kz.clear(),bb=0,pie=[],mi="LR"},"clear"),atr=O(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"),otr=O(t=>{let e,r,n;return mi==="BT"?(r=O((i,a)=>i<=a,"comparisonFunc"),n=1/0):(r=O((i,a)=>i>=a,"comparisonFunc"),n=0),t.forEach(i=>{var o,s;const a=mi==="TB"||mi=="BT"?(o=hd.get(i))==null?void 0:o.y:(s=hd.get(i))==null?void 0:s.x;a!==void 0&&r(a,n)&&(e=i,n=a)}),e},"findClosestParent"),XJn=O(t=>{let e="",r=1/0;return t.forEach(n=>{const i=hd.get(n).y;i<=r&&(e=n,r=i)}),e||void 0},"findClosestParentBT"),KJn=O((t,e,r)=>{let n=r,i=r;const a=[];t.forEach(o=>{const s=e.get(o);if(!s)throw new Error(`Commit not found for key ${o}`);s.parents.length?(n=JJn(s),i=Math.max(n,i)):a.push(s),eei(s,n)}),n=i,a.forEach(o=>{tei(o,n,r)}),t.forEach(o=>{const s=e.get(o);if(s!=null&&s.parents.length){const l=XJn(s.parents);n=hd.get(l).y-Bw,n<=i&&(i=n);const u=ud.get(s.branch).pos,h=n-Nw;hd.set(s.id,{x:u,y:h})}})},"setParallelBTPos"),ZJn=O(t=>{var n;const e=otr(t.parents.filter(i=>i!==null));if(!e)throw new Error(`Closest parent not found for commit ${t.id}`);const r=(n=hd.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"),JJn=O(t=>ZJn(t)+Bw,"calculateCommitPosition"),eei=O((t,e)=>{const r=ud.get(t.branch);if(!r)throw new Error(`Branch not found for commit ${t.id}`);const n=r.pos,i=e+Nw;return hd.set(t.id,{x:n,y:i}),{x:n,y:i}},"setCommitPosition"),tei=O((t,e,r)=>{const n=ud.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const i=e+r,a=n.pos;hd.set(t.id,{x:a,y:i})},"setRootPosition"),rei=O((t,e,r,n,i,a)=>{const{theme:o}=Ye(),s=die.has(o??""),l=MDe.has(o??""),u=qJn.has(o??"");if(a===Sa.HIGHLIGHT)t.append("rect").attr("x",r.x-10+(s?3:0)).attr("y",r.y-10+(s?3:0)).attr("width",s?14:20).attr("height",s?14:20).attr("class",`commit ${e.id} commit-highlight${ck(i,lk,l)} ${n}-outer`),t.append("rect").attr("x",r.x-6+(s?2:0)).attr("y",r.y-6+(s?2:0)).attr("width",s?8:12).attr("height",s?8:12).attr("class",`commit ${e.id} commit${ck(i,lk,l)} ${n}-inner`);else if(a===Sa.CHERRY_PICK)t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",s?7:10).attr("class",`commit ${e.id} ${n}`),t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",s?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",s?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",s?7:10),h.attr("class",`commit ${e.id} commit${ck(i,lk,l)}`),a===Sa.MERGE){const d=t.append("circle");d.attr("cx",r.x),d.attr("cy",r.y),d.attr("r",s?5:6),d.attr("class",`commit ${n} ${e.id} commit${ck(i,lk,l)}`)}if(a===Sa.REVERSE){const d=t.append("path"),f=s?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${ck(i,lk,l)}`)}}},"drawCommitBullet"),nei=O((t,e,r,n,i)=>{var a;if(e.type!==Sa.CHERRY_PICK&&(e.customId&&e.type===Sa.MERGE||e.type!==Sa.MERGE)&&i.showCommitLabel){const o=t.append("g"),s=o.insert("rect").attr("class","commit-label-bkg"),l=o.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&&(s.attr("x",r.posWithOffset-u.width/2-yb).attr("y",r.y+13.5).attr("width",u.width+2*yb).attr("height",u.height+2*yb),mi==="TB"||mi==="BT"?(s.attr("x",r.x-(u.width+4*wv+5)).attr("y",r.y-12),l.attr("x",r.x-(u.width+4*wv)).attr("y",r.y+u.height-12)):l.attr("x",r.posWithOffset-u.width/2),i.rotateCommitLabel))if(mi==="TB"||mi==="BT")l.attr("transform","rotate(-45, "+r.x+", "+r.y+")"),s.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;o.attr("transform","translate("+h+", "+d+") rotate(-45, "+n+", "+r.y+")")}}},"drawCommitLabel"),iei=O((t,e,r,n)=>{var i;if(e.tags.length>0){let a=0,o=0,s=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");o=Math.max(o,p.width),s=Math.max(s,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=s/2,g=r.y-19.2-f;if(d.attr("class","tag-label-bkg").attr("points",` ${n-o/2-wv/2},${g+yb} ${n-o/2-wv/2},${g-yb} ${r.posWithOffset-o/2-wv},${g-p-yb} @@ -1776,22 +1776,22 @@ ${r}`),this.inline?`{${i}}`:i}},$(sI,"JSDocTagImpl"),sI);function iJt(t,e,r){var ${r.x+Nw},${m-p-2} ${r.x+Nw+o+4},${m-p-2} ${r.x+Nw+o+4},${m+p+2} - ${r.x+Nw},${m+p+2}`).attr("transform","translate(12,12) rotate(45, "+r.x+","+n+")"),h.attr("cx",r.x+wv/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"),nei=O(t=>{switch(t.customType??t.type){case Sa.NORMAL:return"commit-normal";case Sa.REVERSE:return"commit-reverse";case Sa.HIGHLIGHT:return"commit-highlight";case Sa.MERGE:return"commit-merge";case Sa.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),iei=O((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const a=itr(t.parents);if(a){const o=n.get(a)??i;return e==="TB"?o.y+Bw:e==="BT"?(n.get(t.id)??i).y-Bw:o.x+Bw}}else return e==="TB"?fie:e==="BT"?(n.get(t.id)??i).y-Bw:0;return 0},"calculatePosition"),aei=O((t,e,r)=>{var l,u;const n=mi==="BT"&&r?e:e+Nw,i=(l=ud.get(t.branch))==null?void 0:l.pos,a=mi==="TB"||mi==="BT"?(u=ud.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 o=die.has(Ye().theme??""),s=mi==="TB"||mi==="BT"?n:i+(o?LDe/2+1:-2);return{x:a,y:s,posWithOffset:n}},"getCommitPosition"),atr=O((t,e,r,n)=>{const i=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let o=mi==="TB"||mi==="BT"?fie:0;const s=[...e.keys()],l=n.parallelCommits??!1,u=O((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=s.sort(u);mi==="BT"&&(l&&jJn(h,e,o),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&&(o=iei(f,mi,o,hd));const p=aei(f,o,l);if(r){const m=nei(f),v=f.customType??f.type,y=((g=ud.get(f.branch))==null?void 0:g.index)??0;eei(i,f,p,m,y,v),tei(a,f,p,o,n),rei(a,f,p,o)}mi==="TB"||mi==="BT"?hd.set(f.id,{x:p.x,y:p.posWithOffset}):hd.set(f.id,{x:p.posWithOffset,y:p.y}),o=mi==="BT"&&l?o+Bw:o+Bw+Nw,o>bb&&(bb=o)})},"drawCommits"),oei=O((t,e,r,n,i)=>{const o=(mi==="TB"||mi==="BT"?r.xu.branch===o,"isOnBranchToGetCurve"),l=O(u=>u.seq>t.seq&&u.seql(u)&&s(u))},"shouldRerouteArrow"),Zz=O((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(pie.every(o=>Math.abs(o-n)>=10))return pie.push(n),n;const a=Math.abs(t-e);return Zz(t,e-a/5,r+1)},"findLane"),sei=O((t,e,r,n)=>{var m,v,y,b,x;const{theme:i}=Ye(),a=MDe.has(i??""),o=hd.get(e.id),s=hd.get(r.id);if(o===void 0||s===void 0)throw new Error(`Commit positions not found for commits ${e.id} and ${r.id}`);const l=oei(e,r,o,s,n);let u="",h="",d=0,f=0,p=(m=ud.get(r.branch))==null?void 0:m.index;r.type===Sa.MERGE&&e.id!==r.parents[0]&&(p=(v=ud.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=o.ys.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Sa.MERGE&&e.id!==r.parents[0]?g=`M ${o.x} ${o.y} L ${o.x} ${s.y-d} ${h} ${o.x-f} ${s.y} L ${s.x} ${s.y}`:g=`M ${o.x} ${o.y} L ${s.x+d} ${o.y} ${u} ${s.x} ${o.y+f} L ${s.x} ${s.y}`),o.x===s.x&&(g=`M ${o.x} ${o.y} L ${s.x} ${s.y}`)):mi==="BT"?(o.xs.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Sa.MERGE&&e.id!==r.parents[0]?g=`M ${o.x} ${o.y} L ${o.x} ${s.y+d} ${u} ${o.x-f} ${s.y} L ${s.x} ${s.y}`:g=`M ${o.x} ${o.y} L ${s.x+d} ${o.y} ${h} ${s.x} ${o.y-f} L ${s.x} ${s.y}`),o.x===s.x&&(g=`M ${o.x} ${o.y} L ${s.x} ${s.y}`)):(o.ys.y&&(r.type===Sa.MERGE&&e.id!==r.parents[0]?g=`M ${o.x} ${o.y} L ${s.x-d} ${o.y} ${u} ${s.x} ${o.y-f} L ${s.x} ${s.y}`:g=`M ${o.x} ${o.y} L ${o.x} ${s.y+d} ${h} ${o.x+f} ${s.y} L ${s.x} ${s.y}`),o.y===s.y&&(g=`M ${o.x} ${o.y} L ${s.x} ${s.y}`));if(g===void 0)throw new Error("Line definition not found");t.append("path").attr("d",g).attr("class","arrow arrow"+ck(p,lk,a))},"drawArrow"),lei=O((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=>{sei(r,e.get(a),i,e)})})},"drawArrows"),cei=O((t,e,r,n)=>{const{look:i,theme:a,themeVariables:o}=Ye(),{dropShadow:s,THEME_COLOR_LIMIT:l}=o,u=die.has(a??""),h=MDe.has(a??""),d=t.append("g");e.forEach((f,p)=>{var _;const g=ck(p,u?l:lk,h),m=(_=ud.get(f.name))==null?void 0:_.pos;if(m===void 0)throw new Error(`Position not found for branch ${f.name}`);const v=mi==="TB"||mi==="BT"?m:u?m+LDe/2+1:m-2,y=d.append("line");y.attr("x1",0),y.attr("y1",v),y.attr("x2",bb),y.attr("y2",v),y.attr("class","branch branch"+g),mi==="TB"?(y.attr("y1",fie),y.attr("x1",m),y.attr("y2",bb),y.attr("x2",m)):mi==="BT"&&(y.attr("y1",bb),y.attr("x1",m),y.attr("y2",fie),y.attr("x2",m)),pie.push(v);const b=f.name,x=ntr(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(),C=u?0:4,k=u?16:0,E=u?LDe:0;i==="neo"&&w.attr("data-look","neo"),w.attr("class","branchLabelBkg label"+g).attr("style",i==="neo"?`filter:${u?`url(#${n}-drop-shadow)`:s}`:"").attr("rx",C).attr("ry",C).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)+")"),mi==="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)+")"))):mi==="BT"?(w.attr("x",m-T.width/2-10).attr("y",bb),S.attr("transform","translate("+(m-T.width/2-5)+", "+bb+")"),u&&(w.attr("transform",`translate(${-k/2-3}, ${E+10})`),S.attr("transform","translate("+(m-T.width/2-5)+", "+(bb+E*2+4)+")"))):w.attr("transform","translate(-19, "+(v-12-E/2)+")")})},"drawBranches"),uei=O(function(t,e,r,n,i){return ud.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(mi==="TB"||mi==="BT"?n.width/2:0),e},"setBranchPosition"),hei=O(function(t,e,r,n){YJn(),ye.debug("in gitgraph renderer",t+` -`,"id:",e,r);const i=n.db;if(!i.getConfig){ye.error("getConfig method is not available on db");return}const a=i.getConfig(),o=a.rotateCommitLabel??!1;Kz=i.getCommits();const s=i.getBranchesAsObjArray();mi=i.getDirection();const l=_t(`[id="${e}"]`),{look:u,theme:h,themeVariables:d}=Ye(),{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"&&die.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;s.forEach((y,b)=>{var C;const x=ntr(y.name),w=l.append("g"),A=w.insert("g").attr("class","branchLabel"),S=A.insert("g").attr("class","label branch-label");(C=S.node())==null||C.appendChild(x);const T=x.getBBox();v=uei(y.name,v,b,T,o),S.remove(),A.remove(),w.remove()}),atr(l,Kz,!1,a),a.showBranches&&cei(l,s,a,e),lei(l,Kz),atr(l,Kz,!0,a),un.insertTitle(l,"gitTitleText",a.titleTopMargin??0,i.getDiagramTitle()),Q1e(void 0,l,a.diagramPadding,a.useMaxWidth)},"draw"),dei={draw:hei},otr=8,str=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),fei=new Set(["redux-color","redux-dark-color"]),pei=new Set(["neo","neo-dark"]),gei=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),mei=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),vei=O(t=>{const{svgId:e}=t;let r="";if(t.useGradient&&e)for(let n=0;n{switch(t.customType??t.type){case Sa.NORMAL:return"commit-normal";case Sa.REVERSE:return"commit-reverse";case Sa.HIGHLIGHT:return"commit-highlight";case Sa.MERGE:return"commit-merge";case Sa.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),oei=O((t,e,r,n)=>{const i={x:0,y:0};if(t.parents.length>0){const a=otr(t.parents);if(a){const o=n.get(a)??i;return e==="TB"?o.y+Bw:e==="BT"?(n.get(t.id)??i).y-Bw:o.x+Bw}}else return e==="TB"?fie:e==="BT"?(n.get(t.id)??i).y-Bw:0;return 0},"calculatePosition"),sei=O((t,e,r)=>{var l,u;const n=mi==="BT"&&r?e:e+Nw,i=(l=ud.get(t.branch))==null?void 0:l.pos,a=mi==="TB"||mi==="BT"?(u=ud.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 o=die.has(Ye().theme??""),s=mi==="TB"||mi==="BT"?n:i+(o?LDe/2+1:-2);return{x:a,y:s,posWithOffset:n}},"getCommitPosition"),str=O((t,e,r,n)=>{const i=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let o=mi==="TB"||mi==="BT"?fie:0;const s=[...e.keys()],l=n.parallelCommits??!1,u=O((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=s.sort(u);mi==="BT"&&(l&&KJn(h,e,o),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&&(o=oei(f,mi,o,hd));const p=sei(f,o,l);if(r){const m=aei(f),v=f.customType??f.type,y=((g=ud.get(f.branch))==null?void 0:g.index)??0;rei(i,f,p,m,y,v),nei(a,f,p,o,n),iei(a,f,p,o)}mi==="TB"||mi==="BT"?hd.set(f.id,{x:p.x,y:p.posWithOffset}):hd.set(f.id,{x:p.posWithOffset,y:p.y}),o=mi==="BT"&&l?o+Bw:o+Bw+Nw,o>bb&&(bb=o)})},"drawCommits"),lei=O((t,e,r,n,i)=>{const o=(mi==="TB"||mi==="BT"?r.xu.branch===o,"isOnBranchToGetCurve"),l=O(u=>u.seq>t.seq&&u.seql(u)&&s(u))},"shouldRerouteArrow"),Zz=O((t,e,r=0)=>{const n=t+Math.abs(t-e)/2;if(r>5)return n;if(pie.every(o=>Math.abs(o-n)>=10))return pie.push(n),n;const a=Math.abs(t-e);return Zz(t,e-a/5,r+1)},"findLane"),cei=O((t,e,r,n)=>{var m,v,y,b,x;const{theme:i}=Ye(),a=MDe.has(i??""),o=hd.get(e.id),s=hd.get(r.id);if(o===void 0||s===void 0)throw new Error(`Commit positions not found for commits ${e.id} and ${r.id}`);const l=lei(e,r,o,s,n);let u="",h="",d=0,f=0,p=(m=ud.get(r.branch))==null?void 0:m.index;r.type===Sa.MERGE&&e.id!==r.parents[0]&&(p=(v=ud.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=o.ys.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Sa.MERGE&&e.id!==r.parents[0]?g=`M ${o.x} ${o.y} L ${o.x} ${s.y-d} ${h} ${o.x-f} ${s.y} L ${s.x} ${s.y}`:g=`M ${o.x} ${o.y} L ${s.x+d} ${o.y} ${u} ${s.x} ${o.y+f} L ${s.x} ${s.y}`),o.x===s.x&&(g=`M ${o.x} ${o.y} L ${s.x} ${s.y}`)):mi==="BT"?(o.xs.x&&(u="A 20 20, 0, 0, 0,",h="A 20 20, 0, 0, 1,",d=20,f=20,r.type===Sa.MERGE&&e.id!==r.parents[0]?g=`M ${o.x} ${o.y} L ${o.x} ${s.y+d} ${u} ${o.x-f} ${s.y} L ${s.x} ${s.y}`:g=`M ${o.x} ${o.y} L ${s.x+d} ${o.y} ${h} ${s.x} ${o.y-f} L ${s.x} ${s.y}`),o.x===s.x&&(g=`M ${o.x} ${o.y} L ${s.x} ${s.y}`)):(o.ys.y&&(r.type===Sa.MERGE&&e.id!==r.parents[0]?g=`M ${o.x} ${o.y} L ${s.x-d} ${o.y} ${u} ${s.x} ${o.y-f} L ${s.x} ${s.y}`:g=`M ${o.x} ${o.y} L ${o.x} ${s.y+d} ${h} ${o.x+f} ${s.y} L ${s.x} ${s.y}`),o.y===s.y&&(g=`M ${o.x} ${o.y} L ${s.x} ${s.y}`));if(g===void 0)throw new Error("Line definition not found");t.append("path").attr("d",g).attr("class","arrow arrow"+ck(p,lk,a))},"drawArrow"),uei=O((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=>{cei(r,e.get(a),i,e)})})},"drawArrows"),hei=O((t,e,r,n)=>{const{look:i,theme:a,themeVariables:o}=Ye(),{dropShadow:s,THEME_COLOR_LIMIT:l}=o,u=die.has(a??""),h=MDe.has(a??""),d=t.append("g");e.forEach((f,p)=>{var _;const g=ck(p,u?l:lk,h),m=(_=ud.get(f.name))==null?void 0:_.pos;if(m===void 0)throw new Error(`Position not found for branch ${f.name}`);const v=mi==="TB"||mi==="BT"?m:u?m+LDe/2+1:m-2,y=d.append("line");y.attr("x1",0),y.attr("y1",v),y.attr("x2",bb),y.attr("y2",v),y.attr("class","branch branch"+g),mi==="TB"?(y.attr("y1",fie),y.attr("x1",m),y.attr("y2",bb),y.attr("x2",m)):mi==="BT"&&(y.attr("y1",bb),y.attr("x1",m),y.attr("y2",fie),y.attr("x2",m)),pie.push(v);const b=f.name,x=atr(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(),C=u?0:4,k=u?16:0,E=u?LDe:0;i==="neo"&&w.attr("data-look","neo"),w.attr("class","branchLabelBkg label"+g).attr("style",i==="neo"?`filter:${u?`url(#${n}-drop-shadow)`:s}`:"").attr("rx",C).attr("ry",C).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)+")"),mi==="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)+")"))):mi==="BT"?(w.attr("x",m-T.width/2-10).attr("y",bb),S.attr("transform","translate("+(m-T.width/2-5)+", "+bb+")"),u&&(w.attr("transform",`translate(${-k/2-3}, ${E+10})`),S.attr("transform","translate("+(m-T.width/2-5)+", "+(bb+E*2+4)+")"))):w.attr("transform","translate(-19, "+(v-12-E/2)+")")})},"drawBranches"),dei=O(function(t,e,r,n,i){return ud.set(t,{pos:e,index:r}),e+=50+(i?40:0)+(mi==="TB"||mi==="BT"?n.width/2:0),e},"setBranchPosition"),fei=O(function(t,e,r,n){jJn(),ye.debug("in gitgraph renderer",t+` +`,"id:",e,r);const i=n.db;if(!i.getConfig){ye.error("getConfig method is not available on db");return}const a=i.getConfig(),o=a.rotateCommitLabel??!1;Kz=i.getCommits();const s=i.getBranchesAsObjArray();mi=i.getDirection();const l=_t(`[id="${e}"]`),{look:u,theme:h,themeVariables:d}=Ye(),{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"&&die.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;s.forEach((y,b)=>{var C;const x=atr(y.name),w=l.append("g"),A=w.insert("g").attr("class","branchLabel"),S=A.insert("g").attr("class","label branch-label");(C=S.node())==null||C.appendChild(x);const T=x.getBBox();v=dei(y.name,v,b,T,o),S.remove(),A.remove(),w.remove()}),str(l,Kz,!1,a),a.showBranches&&hei(l,s,a,e),uei(l,Kz),str(l,Kz,!0,a),un.insertTitle(l,"gitTitleText",a.titleTopMargin??0,i.getDiagramTitle()),Q1e(void 0,l,a.diagramPadding,a.useMaxWidth)},"draw"),pei={draw:fei},ltr=8,ctr=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),gei=new Set(["redux-color","redux-dark-color"]),mei=new Set(["neo","neo-dark"]),vei=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),yei=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),bei=O(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=str.has(r);if(pei.has(r)){let o="";for(let s=0;s{const e=Dr(),{theme:r,themeVariables:n}=e,{borderColorArray:i}=n,a=ctr.has(r);if(mei.has(r)){let o="";for(let s=0;s`${Array.from({length:t.THEME_COLOR_LIMIT},(e,r)=>r).map(e=>{const r=e%otr;return` + `;return o}},"genColor"),wei=O(t=>`${Array.from({length:t.THEME_COLOR_LIMIT},(e,r)=>r).map(e=>{const r=e%ltr;return` .branch-label${e} { fill: ${t["gitBranchLabel"+r]}; } .commit${e} { stroke: ${t["git"+r]}; fill: ${t["git"+r]}; } .commit-highlight${e} { stroke: ${t["gitInv"+r]}; fill: ${t["gitInv"+r]}; } .label${e} { fill: ${t["git"+r]}; } .arrow${e} { stroke: ${t["git"+r]}; } `}).join(` -`)}`,"normalTheme"),xei=O(t=>{const e=Dr(),{theme:r}=e,n=mei.has(r);return` +`)}`,"normalTheme"),Aei=O(t=>{const e=Dr(),{theme:r}=e,n=yei.has(r);return` .commit-id, .commit-msg, .branch-label { @@ -1829,7 +1829,7 @@ ${r}`),this.inline?`{${i}}`:i}},$(sI,"JSDocTagImpl"),sI);function iJt(t,e,r){var font-family: var(--mermaid-font-family); } - ${n?yei(t):bei(t)} + ${n?xei(t):wei(t)} .branch { stroke-width: ${t.strokeWidth}; @@ -1860,7 +1860,7 @@ ${r}`),this.inline?`{${i}}`:i}},$(sI,"JSDocTagImpl"),sI);function iJt(t,e,r){var .arrow { /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */ - stroke-width: ${str.has(r)?t.strokeWidth:8}; + stroke-width: ${ctr.has(r)?t.strokeWidth:8}; stroke-linecap: round; fill: none } @@ -1869,12 +1869,12 @@ ${r}`),this.inline?`{${i}}`:i}},$(sI,"JSDocTagImpl"),sI);function iJt(t,e,r){var font-size: 18px; fill: ${t.textColor}; } -`},"getStyles"),wei=xei,Aei={parser:HJn,db:rtr,renderer:dei,styles:wei};const Sei=Object.freeze(Object.defineProperty({__proto__:null,diagram:Aei},Symbol.toStringTag,{value:"Module"}));var ltr={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Ti,function(){var r="day";return function(n,i,a){var o=function(u){return u.add(4-u.isoWeekday(),r)},s=i.prototype;s.isoWeekYear=function(){return o(this).year()},s.isoWeek=function(u){if(!this.$utils().u(u))return this.add(7*(u-this.isoWeek()),r);var h,d,f,p,g=o(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},s.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var l=s.startOf;s.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)}}})})(ltr);var Tei=ltr.exports;const Cei=wh(Tei);var ctr={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Ti,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/,o=/\d\d?/,s=/\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:[s,function(v){this.afternoon=p(v,!1)}],a:[s,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:[o,h("seconds")],ss:[o,h("seconds")],m:[o,h("minutes")],mm:[o,h("minutes")],H:[o,h("hours")],h:[o,h("hours")],HH:[o,h("hours")],hh:[o,h("hours")],D:[o,h("day")],DD:[a,h("day")],Do:[s,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:[o,h("week")],ww:[a,h("week")],M:[o,h("month")],MM:[a,h("month")],MMM:[s,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:[s,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,_,P){var L=P&&P.toUpperCase();return _||b[P]||r[P]||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)*I);var V=m(N)(I),z=V.year,U=V.month,Q=V.day,G=V.hours,q=V.minutes,Y=V.seconds,ne=V.milliseconds,X=V.zone,J=V.week,ee=new Date,te=Q||(z||U?1:ee.getDate()),pe=z||ee.getFullYear(),ie=0;z&&!U||(ie=U>0?U-1:ee.getMonth());var Ce,ke=G||0,Ee=q||0,ue=Y||0,de=ne||0;return X?new Date(Date.UTC(pe,ie,te,ke,Ee,ue,de+60*X.offset*1e3)):F?new Date(Date.UTC(pe,ie,te,ke,Ee,ue,de)):(Ce=new Date(pe,ie,te,ke,Ee,ue,de),J&&(Ce=B(Ce).week(J).toDate()),Ce)}catch{return new Date("")}}(S,k,T,b),this.init(),L&&L!==!0&&(this.$L=this.locale(L).$L),P&&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){C[1]=k[D-1];var M=b.apply(this,C);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)}}})})(ctr);var Oei=ctr.exports;const kei=wh(Oei);var utr={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Ti,function(){return function(r,n){var i=n.prototype,a=i.format;i.format=function(o){var s=this,l=this.$locale();if(!this.isValid())return a.bind(this)(o);var u=this.$utils(),h=(o||"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((s.$M+1)/3);case"Do":return l.ordinal(s.$D);case"gggg":return s.weekYear();case"GGGG":return s.isoWeekYear();case"wo":return l.ordinal(s.week(),"W");case"w":case"ww":return u.s(s.week(),d==="w"?1:2,"0");case"W":case"WW":return u.s(s.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return u.s(String(s.$H===0?24:s.$H),d==="k"?1:2,"0");case"X":return Math.floor(s.$d.getTime()/1e3);case"x":return s.$d.getTime();case"z":return"["+s.offsetName()+"]";case"zzz":return"["+s.offsetName("long")+"]";default:return d}});return a.bind(this)(h)}}})})(utr);var Eei=utr.exports;const _ei=wh(Eei);var htr={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Ti,function(){var r,n,i=1e3,a=6e4,o=36e5,s=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:s,hours:o,minutes:a,seconds:i,milliseconds:1,weeks:6048e5},p=function(S){return S instanceof w},g=function(S,T,C){return new w(S,C,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(C,k,E){var _=this;if(this.$d={},this.$l=E,C===void 0&&(this.$ms=0,this.parseFromMilliseconds()),k)return g(C*f[m(k)],this);if(typeof C=="number")return this.$ms=C,this.parseFromMilliseconds(),this;if(typeof C=="object")return Object.keys(C).forEach(function(R){_.$d[m(R)]=C[R]}),this.calMilliseconds(),this;if(typeof C=="string"){var P=C.match(h);if(P){var L=P.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 C=this;this.$ms=Object.keys(this.$d).reduce(function(k,E){return k+(C.$d[E]||0)*f[E]},0)},T.parseFromMilliseconds=function(){var C=this.$ms;this.$d.years=y(C/l),C%=l,this.$d.months=y(C/u),C%=u,this.$d.days=y(C/s),C%=s,this.$d.hours=y(C/o),C%=o,this.$d.minutes=y(C/a),C%=a,this.$d.seconds=y(C/i),C%=i,this.$d.milliseconds=C},T.toISOString=function(){var C=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"),P=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=C.negative||k.negative||_.negative||P.negative||L.negative||D.negative,I=P.format||L.format||D.format?"T":"",N=(M?"-":"")+"P"+C.format+k.format+_.format+I+P.format+L.format+D.format;return N==="P"||N==="-P"?"P0D":N},T.toJSON=function(){return this.toISOString()},T.format=function(C){var k=C||"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(_,P){return P||String(E[_])})},T.as=function(C){return this.$ms/f[m(C)]},T.get=function(C){var k=this.$ms,E=m(C);return E==="milliseconds"?k%=1e3:k=E==="weeks"?y(k/f[E]):this.$d[E],k||0},T.add=function(C,k,E){var _;return _=k?C*f[m(k)]:p(C)?C.$ms:g(C,this).$ms,g(this.$ms+_*(E?-1:1),this)},T.subtract=function(C,k){return this.add(C,k,!0)},T.locale=function(C){var k=this.clone();return k.$l=C,k},T.clone=function(){return g(this.$ms,this)},T.humanize=function(C){return r().add(this.$ms,"ms").locale(this.$l).fromNow(!C)},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,C){return S.add(T.years()*C,"y").add(T.months()*C,"M").add(T.days()*C,"d").add(T.hours()*C,"h").add(T.minutes()*C,"m").add(T.seconds()*C,"s").add(T.milliseconds()*C,"ms")};return function(S,T,C){r=C,n=C().$utils(),C.duration=function(_,P){var L=C.locale();return g(_,{$l:L},P)},C.isDuration=p;var k=T.prototype.add,E=T.prototype.subtract;T.prototype.add=function(_,P){return p(_)?A(this,_,1):k.bind(this)(_,P)},T.prototype.subtract=function(_,P){return p(_)?A(this,_,-1):E.bind(this)(_,P)}}})})(htr);var Rei=htr.exports;const Dei=wh(Rei);var IDe=function(){var t=O(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],o=[1,30],s=[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],C=[1,25],k=[1,35],E={trace:O(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:O(function(R,D,M,I,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:I.setWeekday("monday");break;case 9:I.setWeekday("tuesday");break;case 10:I.setWeekday("wednesday");break;case 11:I.setWeekday("thursday");break;case 12:I.setWeekday("friday");break;case 13:I.setWeekday("saturday");break;case 14:I.setWeekday("sunday");break;case 15:I.setWeekend("friday");break;case 16:I.setWeekend("saturday");break;case 17:I.setDateFormat(F[V].substr(11)),this.$=F[V].substr(11);break;case 18:I.enableInclusiveEndDates(),this.$=F[V].substr(18);break;case 19:I.TopAxis(),this.$=F[V].substr(8);break;case 20:I.setAxisFormat(F[V].substr(11)),this.$=F[V].substr(11);break;case 21:I.setTickInterval(F[V].substr(13)),this.$=F[V].substr(13);break;case 22:I.setExcludes(F[V].substr(9)),this.$=F[V].substr(9);break;case 23:I.setIncludes(F[V].substr(9)),this.$=F[V].substr(9);break;case 24:I.setTodayMarker(F[V].substr(12)),this.$=F[V].substr(12);break;case 27:I.setDiagramTitle(F[V].substr(6)),this.$=F[V].substr(6);break;case 28:this.$=F[V].trim(),I.setAccTitle(this.$);break;case 29:case 30:this.$=F[V].trim(),I.setAccDescription(this.$);break;case 31:I.addSection(F[V].substr(8)),this.$=F[V].substr(8);break;case 33:I.addTask(F[V-1],F[V]),this.$="task";break;case 34:this.$=F[V-1],I.setClickEvent(F[V-1],F[V],null);break;case 35:this.$=F[V-2],I.setClickEvent(F[V-2],F[V-1],F[V]);break;case 36:this.$=F[V-2],I.setClickEvent(F[V-2],F[V-1],null),I.setLink(F[V-2],F[V]);break;case 37:this.$=F[V-3],I.setClickEvent(F[V-3],F[V-2],F[V-1]),I.setLink(F[V-3],F[V]);break;case 38:this.$=F[V-2],I.setClickEvent(F[V-2],F[V],null),I.setLink(F[V-2],F[V-1]);break;case 39:this.$=F[V-3],I.setClickEvent(F[V-3],F[V-1],F[V]),I.setLink(F[V-3],F[V-2]);break;case 40:this.$=F[V-1],I.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:o,17:s,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:C,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:o,17:s,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:C,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:O(function(R,D){if(D.recoverable)this.trace(R);else{var M=new Error(R);throw M.hash=D,M}},"parseError"),parse:O(function(R){var D=this,M=[0],I=[],N=[null],F=[],B=this.table,V="",z=0,U=0,Q=2,G=1,q=F.slice.call(arguments,1),Y=Object.create(this.lexer),ne={yy:{}};for(var X in this.yy)Object.prototype.hasOwnProperty.call(this.yy,X)&&(ne.yy[X]=this.yy[X]);Y.setInput(R,ne.yy),ne.yy.lexer=Y,ne.yy.parser=this,typeof Y.yylloc>"u"&&(Y.yylloc={});var J=Y.yylloc;F.push(J);var ee=Y.options&&Y.options.ranges;typeof ne.yy.parseError=="function"?this.parseError=ne.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function te(Oe){M.length=M.length-2*Oe,N.length=N.length-Oe,F.length=F.length-Oe}O(te,"popStack");function pe(){var Oe;return Oe=I.pop()||Y.lex()||G,typeof Oe!="number"&&(Oe instanceof Array&&(I=Oe,Oe=I.pop()),Oe=D.symbols_[Oe]||Oe),Oe}O(pe,"lex");for(var ie,Ce,ke,Ee,ue={},de,xe,ge,ze;;){if(Ce=M[M.length-1],this.defaultActions[Ce]?ke=this.defaultActions[Ce]:((ie===null||typeof ie>"u")&&(ie=pe()),ke=B[Ce]&&B[Ce][ie]),typeof ke>"u"||!ke.length||!ke[0]){var we="";ze=[];for(de in B[Ce])this.terminals_[de]&&de>Q&&ze.push("'"+this.terminals_[de]+"'");Y.showPosition?we="Parse error on line "+(z+1)+`: +`},"getStyles"),Sei=Aei,Tei={parser:YJn,db:itr,renderer:pei,styles:Sei};const Cei=Object.freeze(Object.defineProperty({__proto__:null,diagram:Tei},Symbol.toStringTag,{value:"Module"}));var utr={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Ti,function(){var r="day";return function(n,i,a){var o=function(u){return u.add(4-u.isoWeekday(),r)},s=i.prototype;s.isoWeekYear=function(){return o(this).year()},s.isoWeek=function(u){if(!this.$utils().u(u))return this.add(7*(u-this.isoWeek()),r);var h,d,f,p,g=o(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},s.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var l=s.startOf;s.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)}}})})(utr);var Oei=utr.exports;const kei=wh(Oei);var htr={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Ti,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/,o=/\d\d?/,s=/\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:[s,function(v){this.afternoon=p(v,!1)}],a:[s,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:[o,h("seconds")],ss:[o,h("seconds")],m:[o,h("minutes")],mm:[o,h("minutes")],H:[o,h("hours")],h:[o,h("hours")],HH:[o,h("hours")],hh:[o,h("hours")],D:[o,h("day")],DD:[a,h("day")],Do:[s,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:[o,h("week")],ww:[a,h("week")],M:[o,h("month")],MM:[a,h("month")],MMM:[s,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:[s,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,_,P){var L=P&&P.toUpperCase();return _||b[P]||r[P]||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)*I);var V=m(N)(I),z=V.year,U=V.month,Q=V.day,G=V.hours,q=V.minutes,Y=V.seconds,ne=V.milliseconds,X=V.zone,J=V.week,ee=new Date,te=Q||(z||U?1:ee.getDate()),pe=z||ee.getFullYear(),ie=0;z&&!U||(ie=U>0?U-1:ee.getMonth());var Ce,ke=G||0,Ee=q||0,ue=Y||0,de=ne||0;return X?new Date(Date.UTC(pe,ie,te,ke,Ee,ue,de+60*X.offset*1e3)):F?new Date(Date.UTC(pe,ie,te,ke,Ee,ue,de)):(Ce=new Date(pe,ie,te,ke,Ee,ue,de),J&&(Ce=B(Ce).week(J).toDate()),Ce)}catch{return new Date("")}}(S,k,T,b),this.init(),L&&L!==!0&&(this.$L=this.locale(L).$L),P&&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){C[1]=k[D-1];var M=b.apply(this,C);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)}}})})(htr);var Eei=htr.exports;const _ei=wh(Eei);var dtr={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Ti,function(){return function(r,n){var i=n.prototype,a=i.format;i.format=function(o){var s=this,l=this.$locale();if(!this.isValid())return a.bind(this)(o);var u=this.$utils(),h=(o||"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((s.$M+1)/3);case"Do":return l.ordinal(s.$D);case"gggg":return s.weekYear();case"GGGG":return s.isoWeekYear();case"wo":return l.ordinal(s.week(),"W");case"w":case"ww":return u.s(s.week(),d==="w"?1:2,"0");case"W":case"WW":return u.s(s.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return u.s(String(s.$H===0?24:s.$H),d==="k"?1:2,"0");case"X":return Math.floor(s.$d.getTime()/1e3);case"x":return s.$d.getTime();case"z":return"["+s.offsetName()+"]";case"zzz":return"["+s.offsetName("long")+"]";default:return d}});return a.bind(this)(h)}}})})(dtr);var Rei=dtr.exports;const Dei=wh(Rei);var ftr={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Ti,function(){var r,n,i=1e3,a=6e4,o=36e5,s=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:s,hours:o,minutes:a,seconds:i,milliseconds:1,weeks:6048e5},p=function(S){return S instanceof w},g=function(S,T,C){return new w(S,C,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(C,k,E){var _=this;if(this.$d={},this.$l=E,C===void 0&&(this.$ms=0,this.parseFromMilliseconds()),k)return g(C*f[m(k)],this);if(typeof C=="number")return this.$ms=C,this.parseFromMilliseconds(),this;if(typeof C=="object")return Object.keys(C).forEach(function(R){_.$d[m(R)]=C[R]}),this.calMilliseconds(),this;if(typeof C=="string"){var P=C.match(h);if(P){var L=P.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 C=this;this.$ms=Object.keys(this.$d).reduce(function(k,E){return k+(C.$d[E]||0)*f[E]},0)},T.parseFromMilliseconds=function(){var C=this.$ms;this.$d.years=y(C/l),C%=l,this.$d.months=y(C/u),C%=u,this.$d.days=y(C/s),C%=s,this.$d.hours=y(C/o),C%=o,this.$d.minutes=y(C/a),C%=a,this.$d.seconds=y(C/i),C%=i,this.$d.milliseconds=C},T.toISOString=function(){var C=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"),P=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=C.negative||k.negative||_.negative||P.negative||L.negative||D.negative,I=P.format||L.format||D.format?"T":"",N=(M?"-":"")+"P"+C.format+k.format+_.format+I+P.format+L.format+D.format;return N==="P"||N==="-P"?"P0D":N},T.toJSON=function(){return this.toISOString()},T.format=function(C){var k=C||"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(_,P){return P||String(E[_])})},T.as=function(C){return this.$ms/f[m(C)]},T.get=function(C){var k=this.$ms,E=m(C);return E==="milliseconds"?k%=1e3:k=E==="weeks"?y(k/f[E]):this.$d[E],k||0},T.add=function(C,k,E){var _;return _=k?C*f[m(k)]:p(C)?C.$ms:g(C,this).$ms,g(this.$ms+_*(E?-1:1),this)},T.subtract=function(C,k){return this.add(C,k,!0)},T.locale=function(C){var k=this.clone();return k.$l=C,k},T.clone=function(){return g(this.$ms,this)},T.humanize=function(C){return r().add(this.$ms,"ms").locale(this.$l).fromNow(!C)},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,C){return S.add(T.years()*C,"y").add(T.months()*C,"M").add(T.days()*C,"d").add(T.hours()*C,"h").add(T.minutes()*C,"m").add(T.seconds()*C,"s").add(T.milliseconds()*C,"ms")};return function(S,T,C){r=C,n=C().$utils(),C.duration=function(_,P){var L=C.locale();return g(_,{$l:L},P)},C.isDuration=p;var k=T.prototype.add,E=T.prototype.subtract;T.prototype.add=function(_,P){return p(_)?A(this,_,1):k.bind(this)(_,P)},T.prototype.subtract=function(_,P){return p(_)?A(this,_,-1):E.bind(this)(_,P)}}})})(ftr);var Lei=ftr.exports;const Mei=wh(Lei);var IDe=function(){var t=O(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],o=[1,30],s=[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],C=[1,25],k=[1,35],E={trace:O(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:O(function(R,D,M,I,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:I.setWeekday("monday");break;case 9:I.setWeekday("tuesday");break;case 10:I.setWeekday("wednesday");break;case 11:I.setWeekday("thursday");break;case 12:I.setWeekday("friday");break;case 13:I.setWeekday("saturday");break;case 14:I.setWeekday("sunday");break;case 15:I.setWeekend("friday");break;case 16:I.setWeekend("saturday");break;case 17:I.setDateFormat(F[V].substr(11)),this.$=F[V].substr(11);break;case 18:I.enableInclusiveEndDates(),this.$=F[V].substr(18);break;case 19:I.TopAxis(),this.$=F[V].substr(8);break;case 20:I.setAxisFormat(F[V].substr(11)),this.$=F[V].substr(11);break;case 21:I.setTickInterval(F[V].substr(13)),this.$=F[V].substr(13);break;case 22:I.setExcludes(F[V].substr(9)),this.$=F[V].substr(9);break;case 23:I.setIncludes(F[V].substr(9)),this.$=F[V].substr(9);break;case 24:I.setTodayMarker(F[V].substr(12)),this.$=F[V].substr(12);break;case 27:I.setDiagramTitle(F[V].substr(6)),this.$=F[V].substr(6);break;case 28:this.$=F[V].trim(),I.setAccTitle(this.$);break;case 29:case 30:this.$=F[V].trim(),I.setAccDescription(this.$);break;case 31:I.addSection(F[V].substr(8)),this.$=F[V].substr(8);break;case 33:I.addTask(F[V-1],F[V]),this.$="task";break;case 34:this.$=F[V-1],I.setClickEvent(F[V-1],F[V],null);break;case 35:this.$=F[V-2],I.setClickEvent(F[V-2],F[V-1],F[V]);break;case 36:this.$=F[V-2],I.setClickEvent(F[V-2],F[V-1],null),I.setLink(F[V-2],F[V]);break;case 37:this.$=F[V-3],I.setClickEvent(F[V-3],F[V-2],F[V-1]),I.setLink(F[V-3],F[V]);break;case 38:this.$=F[V-2],I.setClickEvent(F[V-2],F[V],null),I.setLink(F[V-2],F[V-1]);break;case 39:this.$=F[V-3],I.setClickEvent(F[V-3],F[V-1],F[V]),I.setLink(F[V-3],F[V-2]);break;case 40:this.$=F[V-1],I.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:o,17:s,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:C,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:o,17:s,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:C,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:O(function(R,D){if(D.recoverable)this.trace(R);else{var M=new Error(R);throw M.hash=D,M}},"parseError"),parse:O(function(R){var D=this,M=[0],I=[],N=[null],F=[],B=this.table,V="",z=0,U=0,Q=2,G=1,q=F.slice.call(arguments,1),Y=Object.create(this.lexer),ne={yy:{}};for(var X in this.yy)Object.prototype.hasOwnProperty.call(this.yy,X)&&(ne.yy[X]=this.yy[X]);Y.setInput(R,ne.yy),ne.yy.lexer=Y,ne.yy.parser=this,typeof Y.yylloc>"u"&&(Y.yylloc={});var J=Y.yylloc;F.push(J);var ee=Y.options&&Y.options.ranges;typeof ne.yy.parseError=="function"?this.parseError=ne.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function te(Oe){M.length=M.length-2*Oe,N.length=N.length-Oe,F.length=F.length-Oe}O(te,"popStack");function pe(){var Oe;return Oe=I.pop()||Y.lex()||G,typeof Oe!="number"&&(Oe instanceof Array&&(I=Oe,Oe=I.pop()),Oe=D.symbols_[Oe]||Oe),Oe}O(pe,"lex");for(var ie,Ce,ke,Ee,ue={},de,xe,ge,ze;;){if(Ce=M[M.length-1],this.defaultActions[Ce]?ke=this.defaultActions[Ce]:((ie===null||typeof ie>"u")&&(ie=pe()),ke=B[Ce]&&B[Ce][ie]),typeof ke>"u"||!ke.length||!ke[0]){var we="";ze=[];for(de in B[Ce])this.terminals_[de]&&de>Q&&ze.push("'"+this.terminals_[de]+"'");Y.showPosition?we="Parse error on line "+(z+1)+`: `+Y.showPosition()+` Expecting `+ze.join(", ")+", got '"+(this.terminals_[ie]||ie)+"'":we="Parse error on line "+(z+1)+": Unexpected "+(ie==G?"end of input":"'"+(this.terminals_[ie]||ie)+"'"),this.parseError(we,{text:Y.match,token:this.terminals_[ie]||ie,line:Y.yylineno,loc:J,expected:ze})}if(ke[0]instanceof Array&&ke.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Ce+", token: "+ie);switch(ke[0]){case 1:M.push(ie),N.push(Y.yytext),F.push(Y.yylloc),M.push(ke[1]),ie=null,U=Y.yyleng,V=Y.yytext,z=Y.yylineno,J=Y.yylloc;break;case 2:if(xe=this.productions_[ke[1]][1],ue.$=N[N.length-xe],ue._$={first_line:F[F.length-(xe||1)].first_line,last_line:F[F.length-1].last_line,first_column:F[F.length-(xe||1)].first_column,last_column:F[F.length-1].last_column},ee&&(ue._$.range=[F[F.length-(xe||1)].range[0],F[F.length-1].range[1]]),Ee=this.performAction.apply(ue,[V,U,z,ne.yy,ke[1],N,F].concat(q)),typeof Ee<"u")return Ee;xe&&(M=M.slice(0,-1*xe*2),N=N.slice(0,-1*xe),F=F.slice(0,-1*xe)),M.push(this.productions_[ke[1]][0]),N.push(ue.$),F.push(ue._$),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:O(function(D,M){if(this.yy.parser)this.yy.parser.parseError(D,M);else throw new Error(D)},"parseError"),setInput:O(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:O(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:O(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 I=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===I.length?this.yylloc.first_column:0)+I[I.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:O(function(){return this._more=!0,this},"more"),reject:O(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:O(function(R){this.unput(this.match.slice(R))},"less"),pastInput:O(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:O(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:O(function(){var R=this.pastInput(),D=new Array(R.length+1).join("-");return R+this.upcomingInput()+` `+D+"^"},"showPosition"),test_match:O(function(R,D){var M,I,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))),I=R[0].match(/(?:\r\n?|\n).*/g),I&&(this.yylineno+=I.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:I?I[I.length-1].length-I[I.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:O(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var R,D,M,I;this._more||(this.yytext="",this.match="");for(var N=this._currentRules(),F=0;FD[0].length)){if(D=M,I=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[I]),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:O(function(){var D=this.next();return D||this.lex()},"lex"),begin:O(function(D){this.conditionStack.push(D)},"begin"),popState:O(function(){var D=this.conditionStack.length-1;return D>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(D){return D=this.conditionStack.length-1-Math.abs(D||0),D>=0?this.conditionStack[D]:"INITIAL"},"topState"),pushState:O(function(D){this.begin(D)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(function(D,M,I,N){switch(I){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 P(){this.yy={}}return O(P,"Parser"),P.prototype=E,E.Parser=P,new P}();IDe.parser=IDe;var Lei=IDe;Pl.extend(Cei),Pl.extend(kei),Pl.extend(_ei);var dtr={friday:5,saturday:6},Av="",PDe="",NDe=void 0,BDe="",yD=[],bD=[],$De=new Map,FDe=[],gie=[],xD="",zDe="",ftr=["active","done","crit","milestone","vert"],UDe=[],wD="",Jz=!1,VDe=!1,QDe="sunday",mie="saturday",GDe=0,Mei=O(function(){FDe=[],gie=[],xD="",UDe=[],vie=0,WDe=void 0,yie=void 0,yl=[],Av="",PDe="",zDe="",NDe=void 0,BDe="",yD=[],bD=[],Jz=!1,VDe=!1,GDe=0,$De=new Map,wD="",_a(),QDe="sunday",mie="saturday"},"clear"),Iei=O(function(t){wD=t},"setDiagramId"),Pei=O(function(t){PDe=t},"setAxisFormat"),Nei=O(function(){return PDe},"getAxisFormat"),Bei=O(function(t){NDe=t},"setTickInterval"),$ei=O(function(){return NDe},"getTickInterval"),Fei=O(function(t){BDe=t},"setTodayMarker"),zei=O(function(){return BDe},"getTodayMarker"),Uei=O(function(t){Av=t},"setDateFormat"),Vei=O(function(){Jz=!0},"enableInclusiveEndDates"),Qei=O(function(){return Jz},"endDatesAreInclusive"),Gei=O(function(){VDe=!0},"enableTopAxis"),Hei=O(function(){return VDe},"topAxisEnabled"),Wei=O(function(t){zDe=t},"setDisplayMode"),Yei=O(function(){return zDe},"getDisplayMode"),qei=O(function(){return Av},"getDateFormat"),ptr=O((t,e)=>{const r=e.toLowerCase().split(/[\s,]+/).filter(n=>n!=="");return[...new Set([...t,...r])]},"mergeTokens"),jei=O(function(t){yD=ptr(yD,t)},"setIncludes"),Xei=O(function(){return yD},"getIncludes"),Kei=O(function(t){bD=ptr(bD,t)},"setExcludes"),Zei=O(function(){return bD},"getExcludes"),Jei=O(function(){return $De},"getLinks"),eti=O(function(t){xD=t,FDe.push(t)},"addSection"),tti=O(function(){return FDe},"getSections"),rti=O(function(){let t=xtr();const e=10;let r=0;for(;!t&&rs))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,o]},"fixTaskDates"),HDe=O(function(t,e,r){if(r=r.trim(),O(s=>{const l=s.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 s=null;for(const u of a.groups.ids.split(" ")){let h=uk(u);h!==void 0&&(!s||h.endTime>s.endTime)&&(s=h)}if(s)return s.endTime;const l=new Date;return l.setHours(0,0,0,0),l}let o=Pl(r,e.trim(),!0);if(o.isValid())return o.toDate();{ye.debug("Invalid date:"+r),ye.debug("With date format:"+e.trim());const s=new Date(r);if(s===void 0||isNaN(s.getTime())||s.getFullYear()<-1e4||s.getFullYear()>1e4)throw new Error("Invalid date:"+r);return s}},"getStartDate"),vtr=O(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),ytr=O(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=uk(f);p!==void 0&&(!h||p.startTime{window.open(r,"_self")}),$De.set(n,r))}),wtr(t,"clickable")},"setLink"),wtr=O(function(t,e){t.split(",").forEach(function(r){let n=uk(r);n!==void 0&&n.classes.push(e)})},"setClass"),dti=O(function(t,e,r){if(Ye().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{un.runFunc(e,...n)})},"setClickFun"),Atr=O(function(t,e){UDe.push(function(){const r=wD?`${wD}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=wD?`${wD}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),fti=O(function(t,e,r){t.split(",").forEach(function(n){dti(n,e,r)}),wtr(t,"clickable")},"setClickEvent"),pti=O(function(t){UDe.forEach(function(e){e(t)})},"bindFunctions"),gti={getConfig:O(()=>Ye().gantt,"getConfig"),clear:Mei,setDateFormat:Uei,getDateFormat:qei,enableInclusiveEndDates:Vei,endDatesAreInclusive:Qei,enableTopAxis:Gei,topAxisEnabled:Hei,setAxisFormat:Pei,getAxisFormat:Nei,setTickInterval:Bei,getTickInterval:$ei,setTodayMarker:Fei,getTodayMarker:zei,setAccTitle:Ba,getAccTitle:oo,setDiagramTitle:co,getDiagramTitle:$a,setDiagramId:Iei,setDisplayMode:Wei,getDisplayMode:Yei,setAccDescription:so,getAccDescription:lo,addSection:eti,getSections:tti,getTasks:rti,addTask:cti,findTaskById:uk,addTaskOrg:uti,setIncludes:jei,getIncludes:Xei,setExcludes:Kei,getExcludes:Zei,setClickEvent:fti,setLink:hti,getLinks:Jei,bindFunctions:pti,parseDuration:vtr,isInvalidDate:gtr,setWeekday:nti,getWeekday:iti,setWeekend:ati};function YDe(t,e,r){let n=!0;for(;n;)n=!1,r.forEach(function(i){const a="^\\s*"+i+"\\s*$",o=new RegExp(a);t[0].match(o)&&(e[i]=!0,t.shift(1),n=!0)})}O(YDe,"getTaskTags"),Pl.extend(Dei);var mti=O(function(){ye.debug("Something is calling, setConf, remove the call")},"setConf"),Str={monday:_7,tuesday:Ywt,wednesday:qwt,thursday:GT,friday:jwt,saturday:Xwt,sunday:E7},vti=O((t,e)=>{let r=[...t].map(()=>-1/0),n=[...t].sort((a,o)=>a.startTime-o.startTime||a.order-o.order),i=0;for(const a of n)for(let o=0;o=r[o]){r[o]=a.endTime,a.order=o+e,o>i&&(i=o);break}return i},"getMaxIntersections"),xb,qDe=1e4,yti=O(function(t,e,r,n){const i=Ye().gantt;n.db.setDiagramId(e);const a=Ye().securityLevel;let o;a==="sandbox"&&(o=_t("#i"+e));const s=_t(a==="sandbox"?o.nodes()[0].contentDocument.body:"body"),l=a==="sandbox"?o.nodes()[0].contentDocument:document,u=l.getElementById(e);xb=u.parentElement.offsetWidth,xb===void 0&&(xb=1200),i.useWidth!==void 0&&(xb=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 P of d)E[P.section]===void 0?E[P.section]=[P]:E[P.section].push(P);let _=0;for(const P of Object.keys(E)){const L=vti(E[P],_)+1;_+=L,g+=L*(i.barHeight+i.barGap),p[P]=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 "+xb+" "+g);const m=s.select(`[id="${e}"]`),v=Ccn().domain([Nnn(h,function(E){return E.startTime}),Pnn(h,function(E){return E.endTime})]).rangeRound([0,xb-i.leftPadding-i.rightPadding]);function y(E,_){const P=E.startTime,L=_.startTime;let R=0;return P>L?R=1:PU.vert===Q.vert?0:U.vert?1:-1);const I=E.filter(U=>!U.vert),F=[...new Set(I.map(U=>U.order))].map(U=>I.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*_+P-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*_+P}).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?I.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*_+P+.5*R).toString()+"px"}).attr("class",function(U){const Q="task";let G="";U.classes.length>0&&(G=U.classes.join(" "));let q=0;for(const[ne,X]of f.entries())U.type===X&&(q=ne%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+=q,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 q=this.getBBox().width;return q>G-Q?G+q+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+I.length*(i.barHeight+i.barGap)+60:(Q=U.order,Q*_+i.barHeight/2+(i.fontSize/2-2)+P)}).attr("text-height",R).attr("class",function(U){const Q=v(U.startTime);let G=v(U.endTime);U.milestone&&(G=Q+R);const q=this.getBBox().width;let Y="";U.classes.length>0&&(Y=U.classes.join(" "));let ne=0;for(const[J,ee]of f.entries())U.type===ee&&(ne=J%i.numberSectionStyles);let X="";return U.active&&(U.crit?X="activeCritText"+ne:X="activeText"+ne),U.done?U.crit?X=X+" doneCritText"+ne:X=X+" doneText"+ne:U.crit&&(X=X+" critText"+ne),U.milestone&&(X+=" milestoneText"),U.vert&&(X+=" vertText"),q>G-Q?G+q+1.5*i.leftPadding>M?Y+" taskTextOutsideLeft taskTextOutside"+ne+" "+X:Y+" taskTextOutsideRight taskTextOutside"+ne+" "+X+" width-"+q:Y+" taskText taskText"+ne+" "+X+" width-"+q}),Ye().securityLevel==="sandbox"){let U;U=_t("#i"+e);const Q=U.nodes()[0].contentDocument;B.filter(function(G){return V.has(G.id)}).each(function(G){var q=Q.querySelector("#"+CSS.escape(e+"-"+G.id)),Y=Q.querySelector("#"+CSS.escape(e+"-"+G.id+"-text"));const ne=q.parentNode;var X=Q.createElement("a");X.setAttribute("xlink:href",V.get(G.id)),X.setAttribute("target","_top"),ne.appendChild(X),X.appendChild(q),X.appendChild(Y)})}}O(x,"drawRects");function w(E,_,P,L,R,D,M,I){if(M.length===0&&I.length===0)return;let N,F;for(const{startTime:G,endTime:q}of D)(N===void 0||GF)&&(F=q);if(!N||!F)return;if(Pl(F).diff(Pl(N),"year")>5){ye.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=Pl(N);for(;U.valueOf()<=F;)n.db.isInvalidDate(U,B,M,I)?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"))+P).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,q){return(v(G.start)+P+.5*(v(G.end)-v(G.start))).toString()+"px "+(q*E+.5*R).toString()+"px"}).attr("class","exclude-range")}O(w,"drawExcludeDays");function A(E,_,P,L){if(P<=0||E>_)return 1/0;const R=_-E,D=Pl.duration({[L??"day"]:P}).asMilliseconds();return D<=0?1/0:Math.ceil(R/D)}O(A,"getEstimatedTickCount");function S(E,_,P,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 I=Hnn(v).tickSize(-L+_+i.gridLineStartPadding).tickFormat(oX(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)ye.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],q=A(Q,G,B,V);if(q>qDe)ye.warn(`The tick interval "${B}${V}" would generate ${q} ticks, which exceeds the maximum allowed (${qDe}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(V){case"millisecond":I.ticks(dR.every(B));break;case"second":I.ticks(m2.every(B));break;case"minute":I.ticks(O7.every(B));break;case"hour":I.ticks(k7.every(B));break;case"day":I.ticks(VT.every(B));break;case"week":I.ticks(Str[z].every(B));break;case"month":I.ticks(R7.every(B));break}}}if(m.append("g").attr("class","grid").attr("transform","translate("+E+", "+(L-50)+")").call(I).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=Gnn(v).tickSize(-L+_+i.gridLineStartPadding).tickFormat(oX(M));if(F!==null){const V=parseInt(F[1],10);if(isNaN(V)||V<=0)ye.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],q=Q[1];if(A(G,q,V,z)<=qDe)switch(z){case"millisecond":B.ticks(dR.every(V));break;case"second":B.ticks(m2.every(V));break;case"minute":B.ticks(O7.every(V));break;case"hour":B.ticks(k7.every(V));break;case"day":B.ticks(VT.every(V));break;case"week":B.ticks(Str[U].every(V));break;case"month":B.ticks(R7.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)}}O(S,"makeGrid");function T(E,_){let P=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(Xt.lineBreakRegex),M=-(D.length-1)/2,I=l.createElementNS("http://www.w3.org/2000/svg","text");I.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,I.appendChild(B)}return I}).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:O(function(){var D=this.next();return D||this.lex()},"lex"),begin:O(function(D){this.conditionStack.push(D)},"begin"),popState:O(function(){var D=this.conditionStack.length-1;return D>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(D){return D=this.conditionStack.length-1-Math.abs(D||0),D>=0?this.conditionStack[D]:"INITIAL"},"topState"),pushState:O(function(D){this.begin(D)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(function(D,M,I,N){switch(I){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 P(){this.yy={}}return O(P,"Parser"),P.prototype=E,E.Parser=P,new P}();IDe.parser=IDe;var Iei=IDe;Pl.extend(kei),Pl.extend(_ei),Pl.extend(Dei);var ptr={friday:5,saturday:6},Av="",PDe="",NDe=void 0,BDe="",yD=[],bD=[],$De=new Map,FDe=[],gie=[],xD="",zDe="",gtr=["active","done","crit","milestone","vert"],UDe=[],wD="",Jz=!1,VDe=!1,QDe="sunday",mie="saturday",GDe=0,Pei=O(function(){FDe=[],gie=[],xD="",UDe=[],vie=0,WDe=void 0,yie=void 0,yl=[],Av="",PDe="",zDe="",NDe=void 0,BDe="",yD=[],bD=[],Jz=!1,VDe=!1,GDe=0,$De=new Map,wD="",_a(),QDe="sunday",mie="saturday"},"clear"),Nei=O(function(t){wD=t},"setDiagramId"),Bei=O(function(t){PDe=t},"setAxisFormat"),$ei=O(function(){return PDe},"getAxisFormat"),Fei=O(function(t){NDe=t},"setTickInterval"),zei=O(function(){return NDe},"getTickInterval"),Uei=O(function(t){BDe=t},"setTodayMarker"),Vei=O(function(){return BDe},"getTodayMarker"),Qei=O(function(t){Av=t},"setDateFormat"),Gei=O(function(){Jz=!0},"enableInclusiveEndDates"),Hei=O(function(){return Jz},"endDatesAreInclusive"),Wei=O(function(){VDe=!0},"enableTopAxis"),Yei=O(function(){return VDe},"topAxisEnabled"),qei=O(function(t){zDe=t},"setDisplayMode"),jei=O(function(){return zDe},"getDisplayMode"),Xei=O(function(){return Av},"getDateFormat"),mtr=O((t,e)=>{const r=e.toLowerCase().split(/[\s,]+/).filter(n=>n!=="");return[...new Set([...t,...r])]},"mergeTokens"),Kei=O(function(t){yD=mtr(yD,t)},"setIncludes"),Zei=O(function(){return yD},"getIncludes"),Jei=O(function(t){bD=mtr(bD,t)},"setExcludes"),eti=O(function(){return bD},"getExcludes"),tti=O(function(){return $De},"getLinks"),rti=O(function(t){xD=t,FDe.push(t)},"addSection"),nti=O(function(){return FDe},"getSections"),iti=O(function(){let t=Atr();const e=10;let r=0;for(;!t&&rs))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,o]},"fixTaskDates"),HDe=O(function(t,e,r){if(r=r.trim(),O(s=>{const l=s.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 s=null;for(const u of a.groups.ids.split(" ")){let h=uk(u);h!==void 0&&(!s||h.endTime>s.endTime)&&(s=h)}if(s)return s.endTime;const l=new Date;return l.setHours(0,0,0,0),l}let o=Pl(r,e.trim(),!0);if(o.isValid())return o.toDate();{ye.debug("Invalid date:"+r),ye.debug("With date format:"+e.trim());const s=new Date(r);if(s===void 0||isNaN(s.getTime())||s.getFullYear()<-1e4||s.getFullYear()>1e4)throw new Error("Invalid date:"+r);return s}},"getStartDate"),btr=O(function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());return e!==null?[Number.parseFloat(e[1]),e[2]]:[NaN,"ms"]},"parseDuration"),xtr=O(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=uk(f);p!==void 0&&(!h||p.startTime{window.open(r,"_self")}),$De.set(n,r))}),Str(t,"clickable")},"setLink"),Str=O(function(t,e){t.split(",").forEach(function(r){let n=uk(r);n!==void 0&&n.classes.push(e)})},"setClass"),pti=O(function(t,e,r){if(Ye().securityLevel!=="loose"||e===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let a=0;a{un.runFunc(e,...n)})},"setClickFun"),Ttr=O(function(t,e){UDe.push(function(){const r=wD?`${wD}-${t}`:t,n=document.querySelector(`[id="${r}"]`);n!==null&&n.addEventListener("click",function(){e()})},function(){const r=wD?`${wD}-${t}`:t,n=document.querySelector(`[id="${r}-text"]`);n!==null&&n.addEventListener("click",function(){e()})})},"pushFun"),gti=O(function(t,e,r){t.split(",").forEach(function(n){pti(n,e,r)}),Str(t,"clickable")},"setClickEvent"),mti=O(function(t){UDe.forEach(function(e){e(t)})},"bindFunctions"),vti={getConfig:O(()=>Ye().gantt,"getConfig"),clear:Pei,setDateFormat:Qei,getDateFormat:Xei,enableInclusiveEndDates:Gei,endDatesAreInclusive:Hei,enableTopAxis:Wei,topAxisEnabled:Yei,setAxisFormat:Bei,getAxisFormat:$ei,setTickInterval:Fei,getTickInterval:zei,setTodayMarker:Uei,getTodayMarker:Vei,setAccTitle:Ba,getAccTitle:oo,setDiagramTitle:co,getDiagramTitle:$a,setDiagramId:Nei,setDisplayMode:qei,getDisplayMode:jei,setAccDescription:so,getAccDescription:lo,addSection:rti,getSections:nti,getTasks:iti,addTask:hti,findTaskById:uk,addTaskOrg:dti,setIncludes:Kei,getIncludes:Zei,setExcludes:Jei,getExcludes:eti,setClickEvent:gti,setLink:fti,getLinks:tti,bindFunctions:mti,parseDuration:btr,isInvalidDate:vtr,setWeekday:ati,getWeekday:oti,setWeekend:sti};function YDe(t,e,r){let n=!0;for(;n;)n=!1,r.forEach(function(i){const a="^\\s*"+i+"\\s*$",o=new RegExp(a);t[0].match(o)&&(e[i]=!0,t.shift(1),n=!0)})}O(YDe,"getTaskTags"),Pl.extend(Mei);var yti=O(function(){ye.debug("Something is calling, setConf, remove the call")},"setConf"),Ctr={monday:_7,tuesday:jwt,wednesday:Xwt,thursday:GT,friday:Kwt,saturday:Zwt,sunday:E7},bti=O((t,e)=>{let r=[...t].map(()=>-1/0),n=[...t].sort((a,o)=>a.startTime-o.startTime||a.order-o.order),i=0;for(const a of n)for(let o=0;o=r[o]){r[o]=a.endTime,a.order=o+e,o>i&&(i=o);break}return i},"getMaxIntersections"),xb,qDe=1e4,xti=O(function(t,e,r,n){const i=Ye().gantt;n.db.setDiagramId(e);const a=Ye().securityLevel;let o;a==="sandbox"&&(o=_t("#i"+e));const s=_t(a==="sandbox"?o.nodes()[0].contentDocument.body:"body"),l=a==="sandbox"?o.nodes()[0].contentDocument:document,u=l.getElementById(e);xb=u.parentElement.offsetWidth,xb===void 0&&(xb=1200),i.useWidth!==void 0&&(xb=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 P of d)E[P.section]===void 0?E[P.section]=[P]:E[P.section].push(P);let _=0;for(const P of Object.keys(E)){const L=bti(E[P],_)+1;_+=L,g+=L*(i.barHeight+i.barGap),p[P]=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 "+xb+" "+g);const m=s.select(`[id="${e}"]`),v=kcn().domain([$nn(h,function(E){return E.startTime}),Bnn(h,function(E){return E.endTime})]).rangeRound([0,xb-i.leftPadding-i.rightPadding]);function y(E,_){const P=E.startTime,L=_.startTime;let R=0;return P>L?R=1:PU.vert===Q.vert?0:U.vert?1:-1);const I=E.filter(U=>!U.vert),F=[...new Set(I.map(U=>U.order))].map(U=>I.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*_+P-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*_+P}).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?I.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*_+P+.5*R).toString()+"px"}).attr("class",function(U){const Q="task";let G="";U.classes.length>0&&(G=U.classes.join(" "));let q=0;for(const[ne,X]of f.entries())U.type===X&&(q=ne%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+=q,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 q=this.getBBox().width;return q>G-Q?G+q+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+I.length*(i.barHeight+i.barGap)+60:(Q=U.order,Q*_+i.barHeight/2+(i.fontSize/2-2)+P)}).attr("text-height",R).attr("class",function(U){const Q=v(U.startTime);let G=v(U.endTime);U.milestone&&(G=Q+R);const q=this.getBBox().width;let Y="";U.classes.length>0&&(Y=U.classes.join(" "));let ne=0;for(const[J,ee]of f.entries())U.type===ee&&(ne=J%i.numberSectionStyles);let X="";return U.active&&(U.crit?X="activeCritText"+ne:X="activeText"+ne),U.done?U.crit?X=X+" doneCritText"+ne:X=X+" doneText"+ne:U.crit&&(X=X+" critText"+ne),U.milestone&&(X+=" milestoneText"),U.vert&&(X+=" vertText"),q>G-Q?G+q+1.5*i.leftPadding>M?Y+" taskTextOutsideLeft taskTextOutside"+ne+" "+X:Y+" taskTextOutsideRight taskTextOutside"+ne+" "+X+" width-"+q:Y+" taskText taskText"+ne+" "+X+" width-"+q}),Ye().securityLevel==="sandbox"){let U;U=_t("#i"+e);const Q=U.nodes()[0].contentDocument;B.filter(function(G){return V.has(G.id)}).each(function(G){var q=Q.querySelector("#"+CSS.escape(e+"-"+G.id)),Y=Q.querySelector("#"+CSS.escape(e+"-"+G.id+"-text"));const ne=q.parentNode;var X=Q.createElement("a");X.setAttribute("xlink:href",V.get(G.id)),X.setAttribute("target","_top"),ne.appendChild(X),X.appendChild(q),X.appendChild(Y)})}}O(x,"drawRects");function w(E,_,P,L,R,D,M,I){if(M.length===0&&I.length===0)return;let N,F;for(const{startTime:G,endTime:q}of D)(N===void 0||GF)&&(F=q);if(!N||!F)return;if(Pl(F).diff(Pl(N),"year")>5){ye.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=Pl(N);for(;U.valueOf()<=F;)n.db.isInvalidDate(U,B,M,I)?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"))+P).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,q){return(v(G.start)+P+.5*(v(G.end)-v(G.start))).toString()+"px "+(q*E+.5*R).toString()+"px"}).attr("class","exclude-range")}O(w,"drawExcludeDays");function A(E,_,P,L){if(P<=0||E>_)return 1/0;const R=_-E,D=Pl.duration({[L??"day"]:P}).asMilliseconds();return D<=0?1/0:Math.ceil(R/D)}O(A,"getEstimatedTickCount");function S(E,_,P,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 I=Ynn(v).tickSize(-L+_+i.gridLineStartPadding).tickFormat(oX(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)ye.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],q=A(Q,G,B,V);if(q>qDe)ye.warn(`The tick interval "${B}${V}" would generate ${q} ticks, which exceeds the maximum allowed (${qDe}). This may indicate an invalid date or time range. Skipping custom tick interval.`);else switch(V){case"millisecond":I.ticks(dR.every(B));break;case"second":I.ticks(m2.every(B));break;case"minute":I.ticks(O7.every(B));break;case"hour":I.ticks(k7.every(B));break;case"day":I.ticks(VT.every(B));break;case"week":I.ticks(Ctr[z].every(B));break;case"month":I.ticks(R7.every(B));break}}}if(m.append("g").attr("class","grid").attr("transform","translate("+E+", "+(L-50)+")").call(I).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=Wnn(v).tickSize(-L+_+i.gridLineStartPadding).tickFormat(oX(M));if(F!==null){const V=parseInt(F[1],10);if(isNaN(V)||V<=0)ye.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],q=Q[1];if(A(G,q,V,z)<=qDe)switch(z){case"millisecond":B.ticks(dR.every(V));break;case"second":B.ticks(m2.every(V));break;case"minute":B.ticks(O7.every(V));break;case"hour":B.ticks(k7.every(V));break;case"day":B.ticks(VT.every(V));break;case"week":B.ticks(Ctr[U].every(V));break;case"month":B.ticks(R7.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)}}O(S,"makeGrid");function T(E,_){let P=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(Xt.lineBreakRegex),M=-(D.length-1)/2,I=l.createElementNS("http://www.w3.org/2000/svg","text");I.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,I.appendChild(B)}return I}).attr("x",10).attr("y",function(R,D){if(D>0)for(let M=0;M` .mermaid-main-font { font-family: ${t.fontFamily}; } @@ -2160,8 +2160,8 @@ Expecting `+ze.join(", ")+", got '"+(this.terminals_[ie]||ie)+"'":we="Parse erro fill: ${t.titleColor||t.textColor}; font-family: ${t.fontFamily}; } -`,"getStyles"),wti=xti,Ati={parser:Lei,db:gti,renderer:bti,styles:wti};const Sti=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ati},Symbol.toStringTag,{value:"Module"}));var Tti={parse:O(async t=>{const e=await Qp("info",t);ye.debug(e)},"parse")},Cti={version:"11.16.1"},Oti=O(()=>Cti.version,"getVersion"),kti={getVersion:Oti},Eti=O((t,e,r)=>{ye.debug(`rendering info diagram -`+t);const n=nu(e);jo(n,100,400,!0),n.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${r}`)},"draw"),_ti={draw:Eti},Rti={parser:Tti,db:kti,renderer:_ti};const Dti=Object.freeze(Object.defineProperty({__proto__:null,diagram:Rti},Symbol.toStringTag,{value:"Module"}));var Lti=Jn.pie,jDe={sections:new Map,showData:!1},bie=jDe.sections,XDe=jDe.showData,Mti=structuredClone(Lti),Iti=O(()=>structuredClone(Mti),"getConfig"),Pti=O(()=>{bie=new Map,XDe=jDe.showData,_a()},"clear"),Nti=O(({label:t,value:e})=>{if(e<0)throw new Error(`"${t}" has invalid value: ${e}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);bie.has(t)||(bie.set(t,e),ye.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),Bti=O(()=>bie,"getSections"),$ti=O(t=>{XDe=t},"setShowData"),Fti=O(()=>XDe,"getShowData"),Ttr={getConfig:Iti,clear:Pti,setDiagramTitle:co,getDiagramTitle:$a,setAccTitle:Ba,getAccTitle:oo,setAccDescription:so,getAccDescription:lo,addSection:Nti,getSections:Bti,setShowData:$ti,getShowData:Fti},zti=O((t,e)=>{ah(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),Uti={parse:O(async t=>{const e=await Qp("pie",t);ye.debug(e),zti(e,Ttr)},"parse")},Vti=O(t=>` +`,"getStyles"),Sti=Ati,Tti={parser:Iei,db:vti,renderer:wti,styles:Sti};const Cti=Object.freeze(Object.defineProperty({__proto__:null,diagram:Tti},Symbol.toStringTag,{value:"Module"}));var Oti={parse:O(async t=>{const e=await Qp("info",t);ye.debug(e)},"parse")},kti={version:"11.16.1"},Eti=O(()=>kti.version,"getVersion"),_ti={getVersion:Eti},Rti=O((t,e,r)=>{ye.debug(`rendering info diagram +`+t);const n=nu(e);jo(n,100,400,!0),n.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${r}`)},"draw"),Dti={draw:Rti},Lti={parser:Oti,db:_ti,renderer:Dti};const Mti=Object.freeze(Object.defineProperty({__proto__:null,diagram:Lti},Symbol.toStringTag,{value:"Module"}));var Iti=Jn.pie,jDe={sections:new Map,showData:!1},bie=jDe.sections,XDe=jDe.showData,Pti=structuredClone(Iti),Nti=O(()=>structuredClone(Pti),"getConfig"),Bti=O(()=>{bie=new Map,XDe=jDe.showData,_a()},"clear"),$ti=O(({label:t,value:e})=>{if(e<0)throw new Error(`"${t}" has invalid value: ${e}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);bie.has(t)||(bie.set(t,e),ye.debug(`added new section: ${t}, with value: ${e}`))},"addSection"),Fti=O(()=>bie,"getSections"),zti=O(t=>{XDe=t},"setShowData"),Uti=O(()=>XDe,"getShowData"),Otr={getConfig:Nti,clear:Bti,setDiagramTitle:co,getDiagramTitle:$a,setAccTitle:Ba,getAccTitle:oo,setAccDescription:so,getAccDescription:lo,addSection:$ti,getSections:Fti,setShowData:zti,getShowData:Uti},Vti=O((t,e)=>{ah(t,e),e.setShowData(t.showData),t.sections.map(e.addSection)},"populateDb"),Qti={parse:O(async t=>{const e=await Qp("pie",t);ye.debug(e),Vti(e,Otr)},"parse")},Gti=O(t=>` .pieCircle{ stroke: ${t.pieStrokeColor}; stroke-width : ${t.pieStrokeWidth}; @@ -2198,25 +2198,25 @@ Expecting `+ze.join(", ")+", got '"+(this.terminals_[ie]||ie)+"'":we="Parse erro font-family: ${t.fontFamily}; font-size: ${t.pieLegendTextSize}; } -`,"getStyles"),Qti=Vti,Gti=O(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 zcn().value(i=>i.value).sort(null)(r)},"createPieArcs"),Hti=O((t,e,r,n)=>{var Y;ye.debug(`rendering pie chart -`+t);const i=n.db,a=Ye(),o=uo(i.getConfig(),a.pie),s=40,l=18,u=4,h=450,d=h,f=nu(e),p=f.append("g");p.attr("transform","translate("+d/2+","+h/2+")");const{themeVariables:g}=a;let[m]=a1(g.pieOuterStrokeWidth);m??(m=2);const v=o.legendPosition,y=o.textPosition,b=o.donutHole>0&&o.donutHole<=.9?o.donutHole:0,x=Math.min(d,h)/2-s,w=mR().innerRadius(b*x).outerRadius(x),A=mR().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(),C=Gti(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(ne=>{E+=ne});const _=C.filter(ne=>(ne.data.value/E*100).toFixed(0)!=="0"),P=UT(k).domain([...T.keys()]);S.selectAll("mySlices").data(_).enter().append("path").attr("d",w).attr("fill",ne=>P(ne.data.label)).attr("class",ne=>{let X="pieCircle";return o.highlightSlice==="hover"?X+=" highlightedOnHover":o.highlightSlice===ne.data.label&&(X+=" highlighted"),X}),S.selectAll("mySlices").data(_).enter().append("text").text(ne=>(ne.data.value/E*100).toFixed(0)+"%").attr("transform",ne=>"translate("+A.centroid(ne)+")").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(([ne,X])=>({label:ne,value:X})),D=p.selectAll(".legend").data(R).enter().append("g").attr("class","legend");D.append("rect").attr("width",l).attr("height",l).style("fill",ne=>P(ne.label)).style("stroke",ne=>P(ne.label)),D.append("text").attr("x",l+u).attr("y",l-u).text(ne=>i.getShowData()?`${ne.label} [${ne.value}]`:ne.label);const M=Math.max(...D.selectAll("text").nodes().map(ne=>(ne==null?void 0:ne.getBoundingClientRect().width)??0));let I=h,N=d+s;const F=l+u,B=R.length*F;switch(v){case"center":D.attr("transform",(ne,X)=>{const J=F*R.length/2,ee=-M/2-(l+u),te=X*F-J;return"translate("+ee+","+te+")"});break;case"top":I+=B,D.attr("transform",(ne,X)=>{const J=x,ee=-M/2-(l+u),te=X*F-J;return`translate(${ee}, ${te})`}),S.attr("transform",()=>`translate(0, ${B+F})`);break;case"bottom":I+=B,D.attr("transform",(ne,X)=>{const J=-x-F,ee=-M/2-(l+u),te=X*F-J;return"translate("+ee+","+te+")"});break;case"left":N+=l+u+M,D.attr("transform",(ne,X)=>{const J=F*R.length/2,ee=-x-(l+u),te=X*F-J;return"translate("+ee+","+te+")"}),S.attr("transform",()=>`translate(${M+l+u}, 0)`);break;case"right":default:N+=l+u+M,D.attr("transform",(ne,X)=>{const J=F*R.length/2,ee=12*l,te=X*F-J;return"translate("+ee+","+te+")"});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),q=Math.max(N,U)-Q;f.attr("viewBox",`${Q} 0 ${q} ${I}`),jo(f,I,q,o.useMaxWidth)},"draw"),Wti={draw:Hti},Yti={parser:Uti,db:Ttr,renderer:Wti,styles:Qti};const qti=Object.freeze(Object.defineProperty({__proto__:null,diagram:Yti},Symbol.toStringTag,{value:"Module"}));var KDe=function(){var t=O(function(oe,ve,ce,De){for(ce=ce||{},De=oe.length;De--;ce[oe[De]]=ve);return ce},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[1,7],o=[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],s=[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],C=[1,24],k=[1,25],E=[1,26],_=[1,27],P=[1,28],L=[1,29],R=[1,32],D=[1,33],M=[1,34],I=[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],q=[1,68],Y=[1,69],ne=[1,70],X=[1,71],J=[1,72],ee=[1,73],te=[1,74],pe=[1,75],ie=[1,76],Ce=[1,77],ke=[4,5,6,7,8,9,10,11,12,13,14,15,18],Ee=[1,91],ue=[1,92],de=[1,93],xe=[1,100],ge=[1,94],ze=[1,97],we=[1,95],Oe=[1,96],Be=[1,98],Z=[1,99],le=[1,103],be=[10,55,56,57],ae=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],K={trace:O(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:O(function(ve,ce,De,Le,We,Ne,je){var $e=Ne.length-1;switch(We){case 23:this.$=Ne[$e];break;case 24:this.$=Ne[$e-1]+""+Ne[$e];break;case 26:this.$=Ne[$e-1]+Ne[$e];break;case 27:this.$=[Ne[$e].trim()];break;case 28:Ne[$e-2].push(Ne[$e].trim()),this.$=Ne[$e-2];break;case 29:this.$=Ne[$e-4],Le.addClass(Ne[$e-2],Ne[$e]);break;case 37:this.$=[];break;case 42:this.$=Ne[$e].trim(),Le.setDiagramTitle(this.$);break;case 43:this.$=Ne[$e].trim(),Le.setAccTitle(this.$);break;case 44:case 45:this.$=Ne[$e].trim(),Le.setAccDescription(this.$);break;case 46:Le.addSection(Ne[$e].substr(8)),this.$=Ne[$e].substr(8);break;case 47:Le.addPoint(Ne[$e-3],"",Ne[$e-1],Ne[$e],[]);break;case 48:Le.addPoint(Ne[$e-4],Ne[$e-3],Ne[$e-1],Ne[$e],[]);break;case 49:Le.addPoint(Ne[$e-4],"",Ne[$e-2],Ne[$e-1],Ne[$e]);break;case 50:Le.addPoint(Ne[$e-5],Ne[$e-4],Ne[$e-2],Ne[$e-1],Ne[$e]);break;case 51:Le.setXAxisLeftText(Ne[$e-2]),Le.setXAxisRightText(Ne[$e]);break;case 52:Ne[$e-1].text+=" ⟶ ",Le.setXAxisLeftText(Ne[$e-1]);break;case 53:Le.setXAxisLeftText(Ne[$e]);break;case 54:Le.setYAxisBottomText(Ne[$e-2]),Le.setYAxisTopText(Ne[$e]);break;case 55:Ne[$e-1].text+=" ⟶ ",Le.setYAxisBottomText(Ne[$e-1]);break;case 56:Le.setYAxisBottomText(Ne[$e]);break;case 57:Le.setQuadrant1Text(Ne[$e]);break;case 58:Le.setQuadrant2Text(Ne[$e]);break;case 59:Le.setQuadrant3Text(Ne[$e]);break;case 60:Le.setQuadrant4Text(Ne[$e]);break;case 64:this.$={text:Ne[$e],type:"text"};break;case 65:this.$={text:Ne[$e-1].text+""+Ne[$e],type:Ne[$e-1].type};break;case 66:this.$={text:Ne[$e],type:"text"};break;case 67:this.$={text:Ne[$e],type:"markdown"};break;case 68:this.$=Ne[$e];break;case 69:this.$=Ne[$e-1]+""+Ne[$e];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(o,[2,33],{29:10}),t(s,[2,61]),t(s,[2,62]),t(s,[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:C,50:k,51:E,52:_,53:P,54:L,60:R,61:D,63:M,64:I,65:N,66:F,67:B}),t(o,[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:C,50:k,51:E,52:_,53:P,54:L,60:R,61:D,63:M,64:I,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:I,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:I,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:I,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:I,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:I,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:I,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:I,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(o,[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:q,7:Y,8:ne,9:X,10:J,11:ee,12:te,13:pe,14:ie,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:I,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:I,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:I,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:I,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:I,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:I,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:q,7:Y,8:ne,9:X,10:J,11:ee,12:te,13:pe,14:ie,15:Ce,18:[1,82]},t(ke,[2,23]),t(ke,[2,1]),t(ke,[2,2]),t(ke,[2,3]),t(ke,[2,4]),t(ke,[2,5]),t(ke,[2,6]),t(ke,[2,7]),t(ke,[2,8]),t(ke,[2,9]),t(ke,[2,10]),t(ke,[2,11]),t(ke,[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:I,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:I,65:N,66:F,67:B}),{46:[1,86]},{45:[1,87]},{4:Ee,5:ue,6:de,8:xe,11:ge,13:ze,16:90,17:we,18:Oe,19:Be,20:Z,22:89,23:88},t(ke,[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:I,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:I,65:N,66:F,67:B}),t(l,[2,47],{22:89,16:90,23:101,4:Ee,5:ue,6:de,8:xe,11:ge,13:ze,17:we,18:Oe,19:Be,20:Z}),{46:[1,102]},t(l,[2,29],{10:le}),t(be,[2,27],{16:104,4:Ee,5:ue,6:de,8:xe,11:ge,13:ze,17:we,18:Oe,19:Be,20:Z}),t(ae,[2,25]),t(ae,[2,13]),t(ae,[2,14]),t(ae,[2,15]),t(ae,[2,16]),t(ae,[2,17]),t(ae,[2,18]),t(ae,[2,19]),t(ae,[2,20]),t(ae,[2,21]),t(ae,[2,22]),t(l,[2,49],{10:le}),t(l,[2,48],{22:89,16:90,23:105,4:Ee,5:ue,6:de,8:xe,11:ge,13:ze,17:we,18:Oe,19:Be,20:Z}),{4:Ee,5:ue,6:de,8:xe,11:ge,13:ze,16:90,17:we,18:Oe,19:Be,20:Z,22:106},t(ae,[2,26]),t(l,[2,50],{10:le}),t(be,[2,28],{16:104,4:Ee,5:ue,6:de,8:xe,11:ge,13:ze,17:we,18:Oe,19:Be,20:Z})],defaultActions:{8:[2,30],9:[2,31]},parseError:O(function(ve,ce){if(ce.recoverable)this.trace(ve);else{var De=new Error(ve);throw De.hash=ce,De}},"parseError"),parse:O(function(ve){var ce=this,De=[0],Le=[],We=[null],Ne=[],je=this.table,$e="",Ze=0,He=0,et=2,Pe=1,yt=Ne.slice.call(arguments,1),Ie=Object.create(this.lexer),St={yy:{}};for(var kt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,kt)&&(St.yy[kt]=this.yy[kt]);Ie.setInput(ve,St.yy),St.yy.lexer=Ie,St.yy.parser=this,typeof Ie.yylloc>"u"&&(Ie.yylloc={});var ut=Ie.yylloc;Ne.push(ut);var Gt=Ie.options&&Ie.options.ranges;typeof St.yy.parseError=="function"?this.parseError=St.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function It(dr){De.length=De.length-2*dr,We.length=We.length-dr,Ne.length=Ne.length-dr}O(It,"popStack");function gt(){var dr;return dr=Le.pop()||Ie.lex()||Pe,typeof dr!="number"&&(dr instanceof Array&&(Le=dr,dr=Le.pop()),dr=ce.symbols_[dr]||dr),dr}O(gt,"lex");for(var Te,Bt,Et,At,Mt={},qr,Me,at,wt;;){if(Bt=De[De.length-1],this.defaultActions[Bt]?Et=this.defaultActions[Bt]:((Te===null||typeof Te>"u")&&(Te=gt()),Et=je[Bt]&&je[Bt][Te]),typeof Et>"u"||!Et.length||!Et[0]){var Tt="";wt=[];for(qr in je[Bt])this.terminals_[qr]&&qr>et&&wt.push("'"+this.terminals_[qr]+"'");Ie.showPosition?Tt="Parse error on line "+(Ze+1)+`: +`,"getStyles"),Hti=Gti,Wti=O(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 Vcn().value(i=>i.value).sort(null)(r)},"createPieArcs"),Yti=O((t,e,r,n)=>{var Y;ye.debug(`rendering pie chart +`+t);const i=n.db,a=Ye(),o=uo(i.getConfig(),a.pie),s=40,l=18,u=4,h=450,d=h,f=nu(e),p=f.append("g");p.attr("transform","translate("+d/2+","+h/2+")");const{themeVariables:g}=a;let[m]=a1(g.pieOuterStrokeWidth);m??(m=2);const v=o.legendPosition,y=o.textPosition,b=o.donutHole>0&&o.donutHole<=.9?o.donutHole:0,x=Math.min(d,h)/2-s,w=mR().innerRadius(b*x).outerRadius(x),A=mR().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(),C=Wti(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(ne=>{E+=ne});const _=C.filter(ne=>(ne.data.value/E*100).toFixed(0)!=="0"),P=UT(k).domain([...T.keys()]);S.selectAll("mySlices").data(_).enter().append("path").attr("d",w).attr("fill",ne=>P(ne.data.label)).attr("class",ne=>{let X="pieCircle";return o.highlightSlice==="hover"?X+=" highlightedOnHover":o.highlightSlice===ne.data.label&&(X+=" highlighted"),X}),S.selectAll("mySlices").data(_).enter().append("text").text(ne=>(ne.data.value/E*100).toFixed(0)+"%").attr("transform",ne=>"translate("+A.centroid(ne)+")").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(([ne,X])=>({label:ne,value:X})),D=p.selectAll(".legend").data(R).enter().append("g").attr("class","legend");D.append("rect").attr("width",l).attr("height",l).style("fill",ne=>P(ne.label)).style("stroke",ne=>P(ne.label)),D.append("text").attr("x",l+u).attr("y",l-u).text(ne=>i.getShowData()?`${ne.label} [${ne.value}]`:ne.label);const M=Math.max(...D.selectAll("text").nodes().map(ne=>(ne==null?void 0:ne.getBoundingClientRect().width)??0));let I=h,N=d+s;const F=l+u,B=R.length*F;switch(v){case"center":D.attr("transform",(ne,X)=>{const J=F*R.length/2,ee=-M/2-(l+u),te=X*F-J;return"translate("+ee+","+te+")"});break;case"top":I+=B,D.attr("transform",(ne,X)=>{const J=x,ee=-M/2-(l+u),te=X*F-J;return`translate(${ee}, ${te})`}),S.attr("transform",()=>`translate(0, ${B+F})`);break;case"bottom":I+=B,D.attr("transform",(ne,X)=>{const J=-x-F,ee=-M/2-(l+u),te=X*F-J;return"translate("+ee+","+te+")"});break;case"left":N+=l+u+M,D.attr("transform",(ne,X)=>{const J=F*R.length/2,ee=-x-(l+u),te=X*F-J;return"translate("+ee+","+te+")"}),S.attr("transform",()=>`translate(${M+l+u}, 0)`);break;case"right":default:N+=l+u+M,D.attr("transform",(ne,X)=>{const J=F*R.length/2,ee=12*l,te=X*F-J;return"translate("+ee+","+te+")"});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),q=Math.max(N,U)-Q;f.attr("viewBox",`${Q} 0 ${q} ${I}`),jo(f,I,q,o.useMaxWidth)},"draw"),qti={draw:Yti},jti={parser:Qti,db:Otr,renderer:qti,styles:Hti};const Xti=Object.freeze(Object.defineProperty({__proto__:null,diagram:jti},Symbol.toStringTag,{value:"Module"}));var KDe=function(){var t=O(function(oe,ve,ce,De){for(ce=ce||{},De=oe.length;De--;ce[oe[De]]=ve);return ce},"o"),e=[1,3],r=[1,4],n=[1,5],i=[1,6],a=[1,7],o=[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],s=[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],C=[1,24],k=[1,25],E=[1,26],_=[1,27],P=[1,28],L=[1,29],R=[1,32],D=[1,33],M=[1,34],I=[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],q=[1,68],Y=[1,69],ne=[1,70],X=[1,71],J=[1,72],ee=[1,73],te=[1,74],pe=[1,75],ie=[1,76],Ce=[1,77],ke=[4,5,6,7,8,9,10,11,12,13,14,15,18],Ee=[1,91],ue=[1,92],de=[1,93],xe=[1,100],ge=[1,94],ze=[1,97],we=[1,95],Oe=[1,96],Be=[1,98],Z=[1,99],le=[1,103],be=[10,55,56,57],ae=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],K={trace:O(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:O(function(ve,ce,De,Le,We,Ne,je){var $e=Ne.length-1;switch(We){case 23:this.$=Ne[$e];break;case 24:this.$=Ne[$e-1]+""+Ne[$e];break;case 26:this.$=Ne[$e-1]+Ne[$e];break;case 27:this.$=[Ne[$e].trim()];break;case 28:Ne[$e-2].push(Ne[$e].trim()),this.$=Ne[$e-2];break;case 29:this.$=Ne[$e-4],Le.addClass(Ne[$e-2],Ne[$e]);break;case 37:this.$=[];break;case 42:this.$=Ne[$e].trim(),Le.setDiagramTitle(this.$);break;case 43:this.$=Ne[$e].trim(),Le.setAccTitle(this.$);break;case 44:case 45:this.$=Ne[$e].trim(),Le.setAccDescription(this.$);break;case 46:Le.addSection(Ne[$e].substr(8)),this.$=Ne[$e].substr(8);break;case 47:Le.addPoint(Ne[$e-3],"",Ne[$e-1],Ne[$e],[]);break;case 48:Le.addPoint(Ne[$e-4],Ne[$e-3],Ne[$e-1],Ne[$e],[]);break;case 49:Le.addPoint(Ne[$e-4],"",Ne[$e-2],Ne[$e-1],Ne[$e]);break;case 50:Le.addPoint(Ne[$e-5],Ne[$e-4],Ne[$e-2],Ne[$e-1],Ne[$e]);break;case 51:Le.setXAxisLeftText(Ne[$e-2]),Le.setXAxisRightText(Ne[$e]);break;case 52:Ne[$e-1].text+=" ⟶ ",Le.setXAxisLeftText(Ne[$e-1]);break;case 53:Le.setXAxisLeftText(Ne[$e]);break;case 54:Le.setYAxisBottomText(Ne[$e-2]),Le.setYAxisTopText(Ne[$e]);break;case 55:Ne[$e-1].text+=" ⟶ ",Le.setYAxisBottomText(Ne[$e-1]);break;case 56:Le.setYAxisBottomText(Ne[$e]);break;case 57:Le.setQuadrant1Text(Ne[$e]);break;case 58:Le.setQuadrant2Text(Ne[$e]);break;case 59:Le.setQuadrant3Text(Ne[$e]);break;case 60:Le.setQuadrant4Text(Ne[$e]);break;case 64:this.$={text:Ne[$e],type:"text"};break;case 65:this.$={text:Ne[$e-1].text+""+Ne[$e],type:Ne[$e-1].type};break;case 66:this.$={text:Ne[$e],type:"text"};break;case 67:this.$={text:Ne[$e],type:"markdown"};break;case 68:this.$=Ne[$e];break;case 69:this.$=Ne[$e-1]+""+Ne[$e];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(o,[2,33],{29:10}),t(s,[2,61]),t(s,[2,62]),t(s,[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:C,50:k,51:E,52:_,53:P,54:L,60:R,61:D,63:M,64:I,65:N,66:F,67:B}),t(o,[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:C,50:k,51:E,52:_,53:P,54:L,60:R,61:D,63:M,64:I,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:I,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:I,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:I,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:I,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:I,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:I,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:I,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(o,[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:q,7:Y,8:ne,9:X,10:J,11:ee,12:te,13:pe,14:ie,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:I,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:I,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:I,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:I,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:I,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:I,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:q,7:Y,8:ne,9:X,10:J,11:ee,12:te,13:pe,14:ie,15:Ce,18:[1,82]},t(ke,[2,23]),t(ke,[2,1]),t(ke,[2,2]),t(ke,[2,3]),t(ke,[2,4]),t(ke,[2,5]),t(ke,[2,6]),t(ke,[2,7]),t(ke,[2,8]),t(ke,[2,9]),t(ke,[2,10]),t(ke,[2,11]),t(ke,[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:I,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:I,65:N,66:F,67:B}),{46:[1,86]},{45:[1,87]},{4:Ee,5:ue,6:de,8:xe,11:ge,13:ze,16:90,17:we,18:Oe,19:Be,20:Z,22:89,23:88},t(ke,[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:I,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:I,65:N,66:F,67:B}),t(l,[2,47],{22:89,16:90,23:101,4:Ee,5:ue,6:de,8:xe,11:ge,13:ze,17:we,18:Oe,19:Be,20:Z}),{46:[1,102]},t(l,[2,29],{10:le}),t(be,[2,27],{16:104,4:Ee,5:ue,6:de,8:xe,11:ge,13:ze,17:we,18:Oe,19:Be,20:Z}),t(ae,[2,25]),t(ae,[2,13]),t(ae,[2,14]),t(ae,[2,15]),t(ae,[2,16]),t(ae,[2,17]),t(ae,[2,18]),t(ae,[2,19]),t(ae,[2,20]),t(ae,[2,21]),t(ae,[2,22]),t(l,[2,49],{10:le}),t(l,[2,48],{22:89,16:90,23:105,4:Ee,5:ue,6:de,8:xe,11:ge,13:ze,17:we,18:Oe,19:Be,20:Z}),{4:Ee,5:ue,6:de,8:xe,11:ge,13:ze,16:90,17:we,18:Oe,19:Be,20:Z,22:106},t(ae,[2,26]),t(l,[2,50],{10:le}),t(be,[2,28],{16:104,4:Ee,5:ue,6:de,8:xe,11:ge,13:ze,17:we,18:Oe,19:Be,20:Z})],defaultActions:{8:[2,30],9:[2,31]},parseError:O(function(ve,ce){if(ce.recoverable)this.trace(ve);else{var De=new Error(ve);throw De.hash=ce,De}},"parseError"),parse:O(function(ve){var ce=this,De=[0],Le=[],We=[null],Ne=[],je=this.table,$e="",Ze=0,He=0,et=2,Pe=1,yt=Ne.slice.call(arguments,1),Ie=Object.create(this.lexer),St={yy:{}};for(var kt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,kt)&&(St.yy[kt]=this.yy[kt]);Ie.setInput(ve,St.yy),St.yy.lexer=Ie,St.yy.parser=this,typeof Ie.yylloc>"u"&&(Ie.yylloc={});var ut=Ie.yylloc;Ne.push(ut);var Gt=Ie.options&&Ie.options.ranges;typeof St.yy.parseError=="function"?this.parseError=St.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function It(dr){De.length=De.length-2*dr,We.length=We.length-dr,Ne.length=Ne.length-dr}O(It,"popStack");function gt(){var dr;return dr=Le.pop()||Ie.lex()||Pe,typeof dr!="number"&&(dr instanceof Array&&(Le=dr,dr=Le.pop()),dr=ce.symbols_[dr]||dr),dr}O(gt,"lex");for(var Te,Bt,Et,At,Mt={},qr,Me,at,wt;;){if(Bt=De[De.length-1],this.defaultActions[Bt]?Et=this.defaultActions[Bt]:((Te===null||typeof Te>"u")&&(Te=gt()),Et=je[Bt]&&je[Bt][Te]),typeof Et>"u"||!Et.length||!Et[0]){var Tt="";wt=[];for(qr in je[Bt])this.terminals_[qr]&&qr>et&&wt.push("'"+this.terminals_[qr]+"'");Ie.showPosition?Tt="Parse error on line "+(Ze+1)+`: `+Ie.showPosition()+` Expecting `+wt.join(", ")+", got '"+(this.terminals_[Te]||Te)+"'":Tt="Parse error on line "+(Ze+1)+": Unexpected "+(Te==Pe?"end of input":"'"+(this.terminals_[Te]||Te)+"'"),this.parseError(Tt,{text:Ie.match,token:this.terminals_[Te]||Te,line:Ie.yylineno,loc:ut,expected:wt})}if(Et[0]instanceof Array&&Et.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Bt+", token: "+Te);switch(Et[0]){case 1:De.push(Te),We.push(Ie.yytext),Ne.push(Ie.yylloc),De.push(Et[1]),Te=null,He=Ie.yyleng,$e=Ie.yytext,Ze=Ie.yylineno,ut=Ie.yylloc;break;case 2:if(Me=this.productions_[Et[1]][1],Mt.$=We[We.length-Me],Mt._$={first_line:Ne[Ne.length-(Me||1)].first_line,last_line:Ne[Ne.length-1].last_line,first_column:Ne[Ne.length-(Me||1)].first_column,last_column:Ne[Ne.length-1].last_column},Gt&&(Mt._$.range=[Ne[Ne.length-(Me||1)].range[0],Ne[Ne.length-1].range[1]]),At=this.performAction.apply(Mt,[$e,He,Ze,St.yy,Et[1],We,Ne].concat(yt)),typeof At<"u")return At;Me&&(De=De.slice(0,-1*Me*2),We=We.slice(0,-1*Me),Ne=Ne.slice(0,-1*Me)),De.push(this.productions_[Et[1]][0]),We.push(Mt.$),Ne.push(Mt._$),at=je[De[De.length-2]][De[De.length-1]],De.push(at);break;case 3:return!0}}return!0},"parse")},se=function(){var oe={EOF:1,parseError:O(function(ce,De){if(this.yy.parser)this.yy.parser.parseError(ce,De);else throw new Error(ce)},"parseError"),setInput:O(function(ve,ce){return this.yy=ce||this.yy||{},this._input=ve,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:O(function(){var ve=this._input[0];this.yytext+=ve,this.yyleng++,this.offset++,this.match+=ve,this.matched+=ve;var ce=ve.match(/(?:\r\n?|\n).*/g);return ce?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),ve},"input"),unput:O(function(ve){var ce=ve.length,De=ve.split(/(?:\r\n?|\n)/g);this._input=ve+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ce),this.offset-=ce;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),De.length-1&&(this.yylineno-=De.length-1);var We=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:De?(De.length===Le.length?this.yylloc.first_column:0)+Le[Le.length-De.length].length-De[0].length:this.yylloc.first_column-ce},this.options.ranges&&(this.yylloc.range=[We[0],We[0]+this.yyleng-ce]),this.yyleng=this.yytext.length,this},"unput"),more:O(function(){return this._more=!0,this},"more"),reject:O(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:O(function(ve){this.unput(this.match.slice(ve))},"less"),pastInput:O(function(){var ve=this.matched.substr(0,this.matched.length-this.match.length);return(ve.length>20?"...":"")+ve.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:O(function(){var ve=this.match;return ve.length<20&&(ve+=this._input.substr(0,20-ve.length)),(ve.substr(0,20)+(ve.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:O(function(){var ve=this.pastInput(),ce=new Array(ve.length+1).join("-");return ve+this.upcomingInput()+` `+ce+"^"},"showPosition"),test_match:O(function(ve,ce){var De,Le,We;if(this.options.backtrack_lexer&&(We={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&&(We.yylloc.range=this.yylloc.range.slice(0))),Le=ve[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+ve[0].length},this.yytext+=ve[0],this.match+=ve[0],this.matches=ve,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(ve[0].length),this.matched+=ve[0],De=this.performAction.call(this,this.yy,this,ce,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),De)return De;if(this._backtrack){for(var Ne in We)this[Ne]=We[Ne];return!1}return!1},"test_match"),next:O(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var ve,ce,De,Le;this._more||(this.yytext="",this.match="");for(var We=this._currentRules(),Ne=0;Nece[0].length)){if(ce=De,Le=Ne,this.options.backtrack_lexer){if(ve=this.test_match(De,We[Ne]),ve!==!1)return ve;if(this._backtrack){ce=!1;continue}else return!1}else if(!this.options.flex)break}return ce?(ve=this.test_match(ce,We[Le]),ve!==!1?ve:!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:O(function(){var ce=this.next();return ce||this.lex()},"lex"),begin:O(function(ce){this.conditionStack.push(ce)},"begin"),popState:O(function(){var ce=this.conditionStack.length-1;return ce>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(ce){return ce=this.conditionStack.length-1-Math.abs(ce||0),ce>=0?this.conditionStack[ce]:"INITIAL"},"topState"),pushState:O(function(ce){this.begin(ce)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(function(ce,De,Le,We){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 oe}();K.lexer=se;function me(){this.yy={}}return O(me,"Parser"),me.prototype=K,K.Parser=me,new me}();KDe.parser=KDe;var jti=KDe,vh=jy(),Xti=(JI=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,o,s,l,u,h,d,f,p,g,m,v,y,b;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((e=Jn.quadrantChart)==null?void 0:e.chartWidth)||500,chartWidth:((r=Jn.quadrantChart)==null?void 0:r.chartHeight)||500,titlePadding:((n=Jn.quadrantChart)==null?void 0:n.titlePadding)||10,titleFontSize:((i=Jn.quadrantChart)==null?void 0:i.titleFontSize)||20,quadrantPadding:((a=Jn.quadrantChart)==null?void 0:a.quadrantPadding)||5,xAxisLabelPadding:((o=Jn.quadrantChart)==null?void 0:o.xAxisLabelPadding)||5,yAxisLabelPadding:((s=Jn.quadrantChart)==null?void 0:s.yAxisLabelPadding)||5,xAxisLabelFontSize:((l=Jn.quadrantChart)==null?void 0:l.xAxisLabelFontSize)||16,yAxisLabelFontSize:((u=Jn.quadrantChart)==null?void 0:u.yAxisLabelFontSize)||16,quadrantLabelFontSize:((h=Jn.quadrantChart)==null?void 0:h.quadrantLabelFontSize)||16,quadrantTextTopPadding:((d=Jn.quadrantChart)==null?void 0:d.quadrantTextTopPadding)||5,pointTextPadding:((f=Jn.quadrantChart)==null?void 0:f.pointTextPadding)||5,pointLabelFontSize:((p=Jn.quadrantChart)==null?void 0:p.pointLabelFontSize)||12,pointRadius:((g=Jn.quadrantChart)==null?void 0:g.pointRadius)||5,xAxisPosition:((m=Jn.quadrantChart)==null?void 0:m.xAxisPosition)||"top",yAxisPosition:((v=Jn.quadrantChart)==null?void 0:v.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((y=Jn.quadrantChart)==null?void 0:y.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((b=Jn.quadrantChart)==null?void 0:b.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:vh.quadrant1Fill,quadrant2Fill:vh.quadrant2Fill,quadrant3Fill:vh.quadrant3Fill,quadrant4Fill:vh.quadrant4Fill,quadrant1TextFill:vh.quadrant1TextFill,quadrant2TextFill:vh.quadrant2TextFill,quadrant3TextFill:vh.quadrant3TextFill,quadrant4TextFill:vh.quadrant4TextFill,quadrantPointFill:vh.quadrantPointFill,quadrantPointTextFill:vh.quadrantPointTextFill,quadrantXAxisTextFill:vh.quadrantXAxisTextFill,quadrantYAxisTextFill:vh.quadrantYAxisTextFill,quadrantTitleFill:vh.quadrantTitleFill,quadrantInternalBorderStrokeFill:vh.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:vh.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,ye.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){ye.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){ye.trace("setThemeConfig called with: ",e),this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,r,n,i){const a=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,o={top:e==="top"&&r?a:0,bottom:e==="bottom"&&r?a:0},s=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,l={left:this.config.yAxisPosition==="left"&&n?s:0,right:this.config.yAxisPosition==="right"&&n?s:0},u=this.config.titleFontSize+this.config.titlePadding*2,h={top:i?u:0},d=this.config.quadrantPadding+l.left,f=this.config.quadrantPadding+o.top+h.top,p=this.config.chartWidth-this.config.quadrantPadding*2-l.left-l.right,g=this.config.chartHeight-this.config.quadrantPadding*2-o.top-o.bottom-h.top,m=p/2,v=g/2;return{xAxisSpace:o,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:o}=i,{quadrantHalfHeight:s,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+o.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+o.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?s/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+s-(g?s/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:o}=r,s=[{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:o,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:o,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:o+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:o+n,width:a,height:n,fill:this.themeConfig.quadrant4Fill}];for(const l of s)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 s}getQuadrantPoints(e){const{quadrantSpace:r}=e,{quadrantHeight:n,quadrantLeft:i,quadrantTop:a,quadrantWidth:o}=r,s=hR().domain([0,1]).range([i,o+i]),l=hR().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:s(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:s(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:o,quadrantHalfWidth:s,quadrantTop:l,quadrantWidth:u}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:o-r,y1:l,x2:o+u+r,y2:l},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:o+u,y1:l+r,x2:o+u,y2:l+a-r},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:o-r,y1:l+a,x2:o+u+r,y2:l+a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:o,y1:l+r,x2:o,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:o+s,y1:l+r,x2:o+s,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:o+r,y1:l+i,x2:o+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)}}},O(JI,"QuadrantBuilder"),JI),xie=(eP=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},O(eP,"InvalidStyleError"),eP);function ZDe(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}O(ZDe,"validateHexCode");function Ctr(t){return!/^\d+$/.test(t)}O(Ctr,"validateNumber");function Otr(t){return!/^\d+px$/.test(t)}O(Otr,"validateSizeInPixels");function Sv(t){return li(t.trim(),Ye())}O(Sv,"textSanitizer");var Pc=new Xti;function ktr(t){Pc.setData({quadrant1Text:Sv(t.text)})}O(ktr,"setQuadrant1Text");function Etr(t){Pc.setData({quadrant2Text:Sv(t.text)})}O(Etr,"setQuadrant2Text");function _tr(t){Pc.setData({quadrant3Text:Sv(t.text)})}O(_tr,"setQuadrant3Text");function Rtr(t){Pc.setData({quadrant4Text:Sv(t.text)})}O(Rtr,"setQuadrant4Text");function Dtr(t){Pc.setData({xAxisLeftText:Sv(t.text)})}O(Dtr,"setXAxisLeftText");function Ltr(t){Pc.setData({xAxisRightText:Sv(t.text)})}O(Ltr,"setXAxisRightText");function Mtr(t){Pc.setData({yAxisTopText:Sv(t.text)})}O(Mtr,"setYAxisTopText");function Itr(t){Pc.setData({yAxisBottomText:Sv(t.text)})}O(Itr,"setYAxisBottomText");function wie(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(Ctr(i))throw new xie(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(ZDe(i))throw new xie(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(ZDe(i))throw new xie(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(Otr(i))throw new xie(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}O(wie,"parseStyles");function Ptr(t,e,r,n,i){const a=wie(i);Pc.addPoints([{x:r,y:n,text:Sv(t.text),className:e,...a}])}O(Ptr,"addPoint");function Ntr(t,e){Pc.addClass(t,wie(e))}O(Ntr,"addClass");function Btr(t){Pc.setConfig({chartWidth:t})}O(Btr,"setWidth");function $tr(t){Pc.setConfig({chartHeight:t})}O($tr,"setHeight");function Ftr(){const t=Ye(),{themeVariables:e,quadrantChart:r}=t;return r&&Pc.setConfig(r),Pc.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}),Pc.setData({titleText:$a()}),Pc.build()}O(Ftr,"getQuadrantData");var Kti=O(function(){Pc.clear(),_a()},"clear"),Zti={setWidth:Btr,setHeight:$tr,setQuadrant1Text:ktr,setQuadrant2Text:Etr,setQuadrant3Text:_tr,setQuadrant4Text:Rtr,setXAxisLeftText:Dtr,setXAxisRightText:Ltr,setYAxisTopText:Mtr,setYAxisBottomText:Itr,parseStyles:wie,addPoint:Ptr,addClass:Ntr,getQuadrantData:Ftr,clear:Kti,setAccTitle:Ba,getAccTitle:oo,setDiagramTitle:co,getDiagramTitle:$a,getAccDescription:lo,setAccDescription:so},Jti=O((t,e,r,n)=>{var C,k,E;function i(_){return _==="top"?"hanging":"middle"}O(i,"getDominantBaseLine");function a(_){return _==="left"?"start":"middle"}O(a,"getTextAnchor");function o(_){return`translate(${_.x}, ${_.y}) rotate(${_.rotation||0})`}O(o,"getTransformation");const s=Ye();ye.debug(`Rendering quadrant chart -`+t);const l=s.securityLevel;let u;l==="sandbox"&&(u=_t("#i"+e));const d=_t(l==="sandbox"?u.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),f=d.append("g").attr("class","main"),p=((C=s.quadrantChart)==null?void 0:C.chartWidth)??500,g=((k=s.quadrantChart)==null?void 0:k.chartHeight)??500;jo(d,g,p,((E=s.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",o(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",_=>o(_.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",_=>o(_));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",_=>o(_.text))},"draw"),eri={draw:Jti},tri={parser:jti,db:Zti,renderer:eri,styles:O(()=>"","styles")};const rri=Object.freeze(Object.defineProperty({__proto__:null,diagram:tri},Symbol.toStringTag,{value:"Module"}));var JDe=function(){var t=O(function(M,I,N,F){for(N=N||{},F=M.length;F--;N[M[F]]=I);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],o=[1,7],s=[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],C=[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],P=[26,28],L={trace:O(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:O(function(I,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:o}),{1:[3]},t(e,r,{4:2,7:4,3:8,5:n,36:i,37:a,38:o}),t(e,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:i,37:a,38:o}),{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(s,[2,36]),t(s,[2,37]),t(s,[2,38]),{1:[2,1]},t(e,r,{4:2,7:4,3:21,5:n,36:i,37:a,38:o}),{1:[2,3]},t(s,[2,5]),t(e,[2,7],{4:22,36:i,37:a,38:o}),{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(C,[2,18]),{1:[2,2]},t(C,[2,8]),t(C,[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(C,[2,10]),t(C,[2,24],{32:41,31:56,24:w,29:A}),t(C,[2,26]),t(C,[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(C,[2,11]),t(C,[2,32],{35:60,29:S}),t(C,[2,34]),{33:[1,61]},t(C,[2,12]),{17:62,24:T},{25:63,27:64,29:_},t(C,[2,14]),{17:66,24:T},t(C,[2,16]),t(C,[2,17]),t(E,[2,43]),t(C,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(C,[2,33]),{29:[1,70]},t(C,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(P,[2,23],{30:[1,73]}),t(C,[2,15]),t(C,[2,28]),t(C,[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(C,[2,35]),t(C,[2,19]),{25:75,27:64,29:_},t(P,[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:O(function(I,N){if(N.recoverable)this.trace(I);else{var F=new Error(I);throw F.hash=N,F}},"parseError"),parse:O(function(I){var N=this,F=[0],B=[],V=[null],z=[],U=this.table,Q="",G=0,q=0,Y=2,ne=1,X=z.slice.call(arguments,1),J=Object.create(this.lexer),ee={yy:{}};for(var te in this.yy)Object.prototype.hasOwnProperty.call(this.yy,te)&&(ee.yy[te]=this.yy[te]);J.setInput(I,ee.yy),ee.yy.lexer=J,ee.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var pe=J.yylloc;z.push(pe);var ie=J.options&&J.options.ranges;typeof ee.yy.parseError=="function"?this.parseError=ee.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ce(le){F.length=F.length-2*le,V.length=V.length-le,z.length=z.length-le}O(Ce,"popStack");function ke(){var le;return le=B.pop()||J.lex()||ne,typeof le!="number"&&(le instanceof Array&&(B=le,le=B.pop()),le=N.symbols_[le]||le),le}O(ke,"lex");for(var Ee,ue,de,xe,ge={},ze,we,Oe,Be;;){if(ue=F[F.length-1],this.defaultActions[ue]?de=this.defaultActions[ue]:((Ee===null||typeof Ee>"u")&&(Ee=ke()),de=U[ue]&&U[ue][Ee]),typeof de>"u"||!de.length||!de[0]){var Z="";Be=[];for(ze in U[ue])this.terminals_[ze]&&ze>Y&&Be.push("'"+this.terminals_[ze]+"'");J.showPosition?Z="Parse error on line "+(G+1)+`: +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:O(function(){var ce=this.next();return ce||this.lex()},"lex"),begin:O(function(ce){this.conditionStack.push(ce)},"begin"),popState:O(function(){var ce=this.conditionStack.length-1;return ce>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(ce){return ce=this.conditionStack.length-1-Math.abs(ce||0),ce>=0?this.conditionStack[ce]:"INITIAL"},"topState"),pushState:O(function(ce){this.begin(ce)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(function(ce,De,Le,We){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 oe}();K.lexer=se;function me(){this.yy={}}return O(me,"Parser"),me.prototype=K,K.Parser=me,new me}();KDe.parser=KDe;var Kti=KDe,vh=jy(),Zti=(JI=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,o,s,l,u,h,d,f,p,g,m,v,y,b;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((e=Jn.quadrantChart)==null?void 0:e.chartWidth)||500,chartWidth:((r=Jn.quadrantChart)==null?void 0:r.chartHeight)||500,titlePadding:((n=Jn.quadrantChart)==null?void 0:n.titlePadding)||10,titleFontSize:((i=Jn.quadrantChart)==null?void 0:i.titleFontSize)||20,quadrantPadding:((a=Jn.quadrantChart)==null?void 0:a.quadrantPadding)||5,xAxisLabelPadding:((o=Jn.quadrantChart)==null?void 0:o.xAxisLabelPadding)||5,yAxisLabelPadding:((s=Jn.quadrantChart)==null?void 0:s.yAxisLabelPadding)||5,xAxisLabelFontSize:((l=Jn.quadrantChart)==null?void 0:l.xAxisLabelFontSize)||16,yAxisLabelFontSize:((u=Jn.quadrantChart)==null?void 0:u.yAxisLabelFontSize)||16,quadrantLabelFontSize:((h=Jn.quadrantChart)==null?void 0:h.quadrantLabelFontSize)||16,quadrantTextTopPadding:((d=Jn.quadrantChart)==null?void 0:d.quadrantTextTopPadding)||5,pointTextPadding:((f=Jn.quadrantChart)==null?void 0:f.pointTextPadding)||5,pointLabelFontSize:((p=Jn.quadrantChart)==null?void 0:p.pointLabelFontSize)||12,pointRadius:((g=Jn.quadrantChart)==null?void 0:g.pointRadius)||5,xAxisPosition:((m=Jn.quadrantChart)==null?void 0:m.xAxisPosition)||"top",yAxisPosition:((v=Jn.quadrantChart)==null?void 0:v.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((y=Jn.quadrantChart)==null?void 0:y.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((b=Jn.quadrantChart)==null?void 0:b.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:vh.quadrant1Fill,quadrant2Fill:vh.quadrant2Fill,quadrant3Fill:vh.quadrant3Fill,quadrant4Fill:vh.quadrant4Fill,quadrant1TextFill:vh.quadrant1TextFill,quadrant2TextFill:vh.quadrant2TextFill,quadrant3TextFill:vh.quadrant3TextFill,quadrant4TextFill:vh.quadrant4TextFill,quadrantPointFill:vh.quadrantPointFill,quadrantPointTextFill:vh.quadrantPointTextFill,quadrantXAxisTextFill:vh.quadrantXAxisTextFill,quadrantYAxisTextFill:vh.quadrantYAxisTextFill,quadrantTitleFill:vh.quadrantTitleFill,quadrantInternalBorderStrokeFill:vh.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:vh.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,ye.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){ye.trace("setConfig called with: ",e),this.config={...this.config,...e}}setThemeConfig(e){ye.trace("setThemeConfig called with: ",e),this.themeConfig={...this.themeConfig,...e}}calculateSpace(e,r,n,i){const a=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,o={top:e==="top"&&r?a:0,bottom:e==="bottom"&&r?a:0},s=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,l={left:this.config.yAxisPosition==="left"&&n?s:0,right:this.config.yAxisPosition==="right"&&n?s:0},u=this.config.titleFontSize+this.config.titlePadding*2,h={top:i?u:0},d=this.config.quadrantPadding+l.left,f=this.config.quadrantPadding+o.top+h.top,p=this.config.chartWidth-this.config.quadrantPadding*2-l.left-l.right,g=this.config.chartHeight-this.config.quadrantPadding*2-o.top-o.bottom-h.top,m=p/2,v=g/2;return{xAxisSpace:o,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:o}=i,{quadrantHalfHeight:s,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+o.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+o.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?s/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+s-(g?s/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:o}=r,s=[{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:o,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:o,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:o+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:o+n,width:a,height:n,fill:this.themeConfig.quadrant4Fill}];for(const l of s)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 s}getQuadrantPoints(e){const{quadrantSpace:r}=e,{quadrantHeight:n,quadrantLeft:i,quadrantTop:a,quadrantWidth:o}=r,s=hR().domain([0,1]).range([i,o+i]),l=hR().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:s(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:s(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:o,quadrantHalfWidth:s,quadrantTop:l,quadrantWidth:u}=n;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:o-r,y1:l,x2:o+u+r,y2:l},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:o+u,y1:l+r,x2:o+u,y2:l+a-r},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:o-r,y1:l+a,x2:o+u+r,y2:l+a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:o,y1:l+r,x2:o,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:o+s,y1:l+r,x2:o+s,y2:l+a-r},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:o+r,y1:l+i,x2:o+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)}}},O(JI,"QuadrantBuilder"),JI),xie=(eP=class extends Error{constructor(e,r,n){super(`value for ${e} ${r} is invalid, please use a valid ${n}`),this.name="InvalidStyleError"}},O(eP,"InvalidStyleError"),eP);function ZDe(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}O(ZDe,"validateHexCode");function ktr(t){return!/^\d+$/.test(t)}O(ktr,"validateNumber");function Etr(t){return!/^\d+px$/.test(t)}O(Etr,"validateSizeInPixels");function Sv(t){return li(t.trim(),Ye())}O(Sv,"textSanitizer");var Pc=new Zti;function _tr(t){Pc.setData({quadrant1Text:Sv(t.text)})}O(_tr,"setQuadrant1Text");function Rtr(t){Pc.setData({quadrant2Text:Sv(t.text)})}O(Rtr,"setQuadrant2Text");function Dtr(t){Pc.setData({quadrant3Text:Sv(t.text)})}O(Dtr,"setQuadrant3Text");function Ltr(t){Pc.setData({quadrant4Text:Sv(t.text)})}O(Ltr,"setQuadrant4Text");function Mtr(t){Pc.setData({xAxisLeftText:Sv(t.text)})}O(Mtr,"setXAxisLeftText");function Itr(t){Pc.setData({xAxisRightText:Sv(t.text)})}O(Itr,"setXAxisRightText");function Ptr(t){Pc.setData({yAxisTopText:Sv(t.text)})}O(Ptr,"setYAxisTopText");function Ntr(t){Pc.setData({yAxisBottomText:Sv(t.text)})}O(Ntr,"setYAxisBottomText");function wie(t){const e={};for(const r of t){const[n,i]=r.trim().split(/\s*:\s*/);if(n==="radius"){if(ktr(i))throw new xie(n,i,"number");e.radius=parseInt(i)}else if(n==="color"){if(ZDe(i))throw new xie(n,i,"hex code");e.color=i}else if(n==="stroke-color"){if(ZDe(i))throw new xie(n,i,"hex code");e.strokeColor=i}else if(n==="stroke-width"){if(Etr(i))throw new xie(n,i,"number of pixels (eg. 10px)");e.strokeWidth=i}else throw new Error(`style named ${n} is not supported.`)}return e}O(wie,"parseStyles");function Btr(t,e,r,n,i){const a=wie(i);Pc.addPoints([{x:r,y:n,text:Sv(t.text),className:e,...a}])}O(Btr,"addPoint");function $tr(t,e){Pc.addClass(t,wie(e))}O($tr,"addClass");function Ftr(t){Pc.setConfig({chartWidth:t})}O(Ftr,"setWidth");function ztr(t){Pc.setConfig({chartHeight:t})}O(ztr,"setHeight");function Utr(){const t=Ye(),{themeVariables:e,quadrantChart:r}=t;return r&&Pc.setConfig(r),Pc.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}),Pc.setData({titleText:$a()}),Pc.build()}O(Utr,"getQuadrantData");var Jti=O(function(){Pc.clear(),_a()},"clear"),eri={setWidth:Ftr,setHeight:ztr,setQuadrant1Text:_tr,setQuadrant2Text:Rtr,setQuadrant3Text:Dtr,setQuadrant4Text:Ltr,setXAxisLeftText:Mtr,setXAxisRightText:Itr,setYAxisTopText:Ptr,setYAxisBottomText:Ntr,parseStyles:wie,addPoint:Btr,addClass:$tr,getQuadrantData:Utr,clear:Jti,setAccTitle:Ba,getAccTitle:oo,setDiagramTitle:co,getDiagramTitle:$a,getAccDescription:lo,setAccDescription:so},tri=O((t,e,r,n)=>{var C,k,E;function i(_){return _==="top"?"hanging":"middle"}O(i,"getDominantBaseLine");function a(_){return _==="left"?"start":"middle"}O(a,"getTextAnchor");function o(_){return`translate(${_.x}, ${_.y}) rotate(${_.rotation||0})`}O(o,"getTransformation");const s=Ye();ye.debug(`Rendering quadrant chart +`+t);const l=s.securityLevel;let u;l==="sandbox"&&(u=_t("#i"+e));const d=_t(l==="sandbox"?u.nodes()[0].contentDocument.body:"body").select(`[id="${e}"]`),f=d.append("g").attr("class","main"),p=((C=s.quadrantChart)==null?void 0:C.chartWidth)??500,g=((k=s.quadrantChart)==null?void 0:k.chartHeight)??500;jo(d,g,p,((E=s.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",o(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",_=>o(_.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",_=>o(_));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",_=>o(_.text))},"draw"),rri={draw:tri},nri={parser:Kti,db:eri,renderer:rri,styles:O(()=>"","styles")};const iri=Object.freeze(Object.defineProperty({__proto__:null,diagram:nri},Symbol.toStringTag,{value:"Module"}));var JDe=function(){var t=O(function(M,I,N,F){for(N=N||{},F=M.length;F--;N[M[F]]=I);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],o=[1,7],s=[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],C=[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],P=[26,28],L={trace:O(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:O(function(I,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:o}),{1:[3]},t(e,r,{4:2,7:4,3:8,5:n,36:i,37:a,38:o}),t(e,r,{4:2,7:4,6:9,3:10,5:n,8:[1,11],36:i,37:a,38:o}),{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(s,[2,36]),t(s,[2,37]),t(s,[2,38]),{1:[2,1]},t(e,r,{4:2,7:4,3:21,5:n,36:i,37:a,38:o}),{1:[2,3]},t(s,[2,5]),t(e,[2,7],{4:22,36:i,37:a,38:o}),{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(C,[2,18]),{1:[2,2]},t(C,[2,8]),t(C,[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(C,[2,10]),t(C,[2,24],{32:41,31:56,24:w,29:A}),t(C,[2,26]),t(C,[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(C,[2,11]),t(C,[2,32],{35:60,29:S}),t(C,[2,34]),{33:[1,61]},t(C,[2,12]),{17:62,24:T},{25:63,27:64,29:_},t(C,[2,14]),{17:66,24:T},t(C,[2,16]),t(C,[2,17]),t(E,[2,43]),t(C,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(C,[2,33]),{29:[1,70]},t(C,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(P,[2,23],{30:[1,73]}),t(C,[2,15]),t(C,[2,28]),t(C,[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(C,[2,35]),t(C,[2,19]),{25:75,27:64,29:_},t(P,[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:O(function(I,N){if(N.recoverable)this.trace(I);else{var F=new Error(I);throw F.hash=N,F}},"parseError"),parse:O(function(I){var N=this,F=[0],B=[],V=[null],z=[],U=this.table,Q="",G=0,q=0,Y=2,ne=1,X=z.slice.call(arguments,1),J=Object.create(this.lexer),ee={yy:{}};for(var te in this.yy)Object.prototype.hasOwnProperty.call(this.yy,te)&&(ee.yy[te]=this.yy[te]);J.setInput(I,ee.yy),ee.yy.lexer=J,ee.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var pe=J.yylloc;z.push(pe);var ie=J.options&&J.options.ranges;typeof ee.yy.parseError=="function"?this.parseError=ee.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ce(le){F.length=F.length-2*le,V.length=V.length-le,z.length=z.length-le}O(Ce,"popStack");function ke(){var le;return le=B.pop()||J.lex()||ne,typeof le!="number"&&(le instanceof Array&&(B=le,le=B.pop()),le=N.symbols_[le]||le),le}O(ke,"lex");for(var Ee,ue,de,xe,ge={},ze,we,Oe,Be;;){if(ue=F[F.length-1],this.defaultActions[ue]?de=this.defaultActions[ue]:((Ee===null||typeof Ee>"u")&&(Ee=ke()),de=U[ue]&&U[ue][Ee]),typeof de>"u"||!de.length||!de[0]){var Z="";Be=[];for(ze in U[ue])this.terminals_[ze]&&ze>Y&&Be.push("'"+this.terminals_[ze]+"'");J.showPosition?Z="Parse error on line "+(G+1)+`: `+J.showPosition()+` Expecting `+Be.join(", ")+", got '"+(this.terminals_[Ee]||Ee)+"'":Z="Parse error on line "+(G+1)+": Unexpected "+(Ee==ne?"end of input":"'"+(this.terminals_[Ee]||Ee)+"'"),this.parseError(Z,{text:J.match,token:this.terminals_[Ee]||Ee,line:J.yylineno,loc:pe,expected:Be})}if(de[0]instanceof Array&&de.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ue+", token: "+Ee);switch(de[0]){case 1:F.push(Ee),V.push(J.yytext),z.push(J.yylloc),F.push(de[1]),Ee=null,q=J.yyleng,Q=J.yytext,G=J.yylineno,pe=J.yylloc;break;case 2:if(we=this.productions_[de[1]][1],ge.$=V[V.length-we],ge._$={first_line:z[z.length-(we||1)].first_line,last_line:z[z.length-1].last_line,first_column:z[z.length-(we||1)].first_column,last_column:z[z.length-1].last_column},ie&&(ge._$.range=[z[z.length-(we||1)].range[0],z[z.length-1].range[1]]),xe=this.performAction.apply(ge,[Q,q,G,ee.yy,de[1],V,z].concat(X)),typeof xe<"u")return xe;we&&(F=F.slice(0,-1*we*2),V=V.slice(0,-1*we),z=z.slice(0,-1*we)),F.push(this.productions_[de[1]][0]),V.push(ge.$),z.push(ge._$),Oe=U[F[F.length-2]][F[F.length-1]],F.push(Oe);break;case 3:return!0}}return!0},"parse")},R=function(){var M={EOF:1,parseError:O(function(N,F){if(this.yy.parser)this.yy.parser.parseError(N,F);else throw new Error(N)},"parseError"),setInput:O(function(I,N){return this.yy=N||this.yy||{},this._input=I,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:O(function(){var I=this._input[0];this.yytext+=I,this.yyleng++,this.offset++,this.match+=I,this.matched+=I;var N=I.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),I},"input"),unput:O(function(I){var N=I.length,F=I.split(/(?:\r\n?|\n)/g);this._input=I+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:O(function(){return this._more=!0,this},"more"),reject:O(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:O(function(I){this.unput(this.match.slice(I))},"less"),pastInput:O(function(){var I=this.matched.substr(0,this.matched.length-this.match.length);return(I.length>20?"...":"")+I.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:O(function(){var I=this.match;return I.length<20&&(I+=this._input.substr(0,20-I.length)),(I.substr(0,20)+(I.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:O(function(){var I=this.pastInput(),N=new Array(I.length+1).join("-");return I+this.upcomingInput()+` `+N+"^"},"showPosition"),test_match:O(function(I,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=I[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+I[0].length},this.yytext+=I[0],this.match+=I[0],this.matches=I,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(I[0].length),this.matched+=I[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:O(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var I,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(I=this.test_match(F,V[z]),I!==!1)return I;if(this._backtrack){N=!1;continue}else return!1}else if(!this.options.flex)break}return N?(I=this.test_match(N,V[B]),I!==!1?I:!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:O(function(){var N=this.next();return N||this.lex()},"lex"),begin:O(function(N){this.conditionStack.push(N)},"begin"),popState:O(function(){var N=this.conditionStack.length-1;return N>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(N){return N=this.conditionStack.length-1-Math.abs(N||0),N>=0?this.conditionStack[N]:"INITIAL"},"topState"),pushState:O(function(N){this.begin(N)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(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 O(D,"Parser"),D.prototype=L,L.Parser=D,new D}();JDe.parser=JDe;var nri=JDe;function eLe(t){return t.type==="bar"}O(eLe,"isBarPlot");function Aie(t){return t.type==="band"}O(Aie,"isBandAxisData");function SD(t){return t.type==="linear"}O(SD,"isLinearAxisData");var ztr=(tP=class{constructor(e){this.parentGroup=e}getMaxDimension(e,r){if(!this.parentGroup)return{width:e.reduce((a,o)=>Math.max(o.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 o=WCt(i,1,a),s=o?o.width:a.length*r,l=o?o.height:r;n.width=Math.max(n.width,s),n.height=Math.max(n.height,l)}return i.remove(),n}},O(tP,"TextDimensionCalculatorWithFont"),tP),Utr=.7,Vtr=.2,Qtr=(rP=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(){Utr*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(Utr*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=Vtr*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=Vtr*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():[]}},O(rP,"BaseAxis"),rP),iri=(nP=class extends Qtr{constructor(e,r,n,i,a){super(e,i,a,r),this.categories=n,this.scale=xbe().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=xbe().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),ye.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},O(nP,"BandAxis"),nP),ari=(iP=class extends Qtr{constructor(e,r,n,i,a){super(e,i,a,r),this.domain=n,this.scale=hR().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=hR().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},O(iP,"LinearAxis"),iP);function tLe(t,e,r,n){const i=new ztr(n);return Aie(t)?new iri(e,r,t.categories,t.title,i):new ari(e,r,[t.min,t.max],t.title,i)}O(tLe,"getAxis");var ori=(aP=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}},O(aP,"ChartTitle"),aP);function Gtr(t,e,r,n){const i=new ztr(n);return new ori(i,t,e,r)}O(Gtr,"getChartTitleComponent");var sri=(oP=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=N7().y(i=>i[0]).x(i=>i[1])(e):r=N7().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 o=[];for(const[s,[l,u]]of e.entries()){const h=this.plotData.pointLabels[s];h&&(this.orientation==="horizontal"?o.push({x:u+10,y:l,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):o.push({x:l,y:u-10,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}o.length>0&&n.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:o})}return n}},O(oP,"LinePlot"),oP),lri=(sP=class{constructor(e,r,n,i,a,o){this.barData=e,this.boundingRect=r,this.xAxis=n,this.yAxis=i,this.orientation=a,this.plotIndex=o}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}))}]}},O(sP,"BarPlot"),sP),cri=(lP=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 sri(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new lri(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},O(lP,"BasePlot"),lP);function Htr(t,e,r){return new cri(t,e,r)}O(Htr,"getPlotComponent");var uri=(cP=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:Gtr(e,r,n,i),plot:Htr(e,r,n),xAxis:tLe(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:tLe(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),o=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),s=this.componentStore.plot.calculateSpace({width:a,height:o});e-=s.width,r-=s.height,s=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),i=s.height,r-=s.height,this.componentStore.xAxis.setAxisPosition("bottom"),s=this.componentStore.xAxis.calculateSpace({width:e,height:r}),r-=s.height,this.componentStore.yAxis.setAxisPosition("left"),s=this.componentStore.yAxis.calculateSpace({width:e,height:r}),n=s.width,e-=s.width,e>0&&(a+=e,e=0),r>0&&(o+=r,r=0),this.componentStore.plot.calculateSpace({width:a,height:o}),this.componentStore.plot.setBoundingBoxXY({x:n,y:i}),this.componentStore.xAxis.setRange([n,n+a]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:i+o}),this.componentStore.yAxis.setRange([i,i+o]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(l=>eLe(l))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=0,o=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),s=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),l=this.componentStore.plot.calculateSpace({width:o,height:s});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&&(o+=e,e=0),r>0&&(s+=r,r=0),this.componentStore.plot.calculateSpace({width:o,height:s}),this.componentStore.plot.setBoundingBoxXY({x:i,y:a}),this.componentStore.yAxis.setRange([i,i+o]),this.componentStore.yAxis.setBoundingBoxXY({x:i,y:n}),this.componentStore.xAxis.setRange([a,a+s]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(u=>eLe(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}},O(cP,"Orchestrator"),cP),hri=(uP=class{static build(e,r,n,i){return new uri(e,r,n,i).getDrawableElement()}},O(uP,"XYChartBuilder"),uP),eU=0,Wtr,tU=aLe(),rU=iLe(),zi=oLe(),rLe=rU.plotColorPalette.split(",").map(t=>t.trim()),Sie=!1,nLe=!1;function iLe(){const t=jy(),e=Dr();return uo(t.xyChart,e.themeVariables.xyChart)}O(iLe,"getChartDefaultThemeConfig");function aLe(){const t=Dr();return uo(Jn.xyChart,t.xyChart)}O(aLe,"getChartDefaultConfig");function oLe(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}O(oLe,"getChartDefaultData");function nU(t){const e=Dr();return li(t.trim(),e)}O(nU,"textSanitizer");function Ytr(t){Wtr=t}O(Ytr,"setTmpSVGG");function qtr(t){t==="horizontal"?tU.chartOrientation="horizontal":tU.chartOrientation="vertical"}O(qtr,"setOrientation");function jtr(t){zi.xAxis.title=nU(t.text)}O(jtr,"setXAxisTitle");function sLe(t,e){zi.xAxis={type:"linear",title:zi.xAxis.title,min:t,max:e},Sie=!0}O(sLe,"setXAxisRangeData");function Xtr(t){zi.xAxis={type:"band",title:zi.xAxis.title,categories:t.map(e=>nU(e.text))},Sie=!0}O(Xtr,"setXAxisBand");function Ktr(t){zi.yAxis.title=nU(t.text)}O(Ktr,"setYAxisTitle");function Ztr(t,e){zi.yAxis={type:"linear",title:zi.yAxis.title,min:t,max:e},nLe=!0}O(Ztr,"setYAxisRangeData");function Jtr(t){const e=Math.min(...t),r=Math.max(...t),n=SD(zi.yAxis)?zi.yAxis.min:1/0,i=SD(zi.yAxis)?zi.yAxis.max:-1/0;zi.yAxis={type:"linear",title:zi.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}O(Jtr,"setYAxisRangeFromPlotData");function lLe(t){let e=[];if(t.length===0)return e;if(!Sie){const r=SD(zi.xAxis)?zi.xAxis.min:1/0,n=SD(zi.xAxis)?zi.xAxis.max:-1/0;sLe(Math.min(r,1),Math.max(n,t.length))}if(Aie(zi.xAxis)&&t.length>zi.xAxis.categories.length&&(t=t.slice(0,zi.xAxis.categories.length)),nLe||Jtr(t),Aie(zi.xAxis)&&(e=zi.xAxis.categories.map((r,n)=>[r,t[n]])),SD(zi.xAxis)){const r=zi.xAxis.min,n=zi.xAxis.max;if(t.length===1)e=[[`${r}`,t[0]]];else{const i=(n-r)/(t.length-1);e=t.map((a,o)=>[`${r+o*i}`,a])}}return e}O(lLe,"transformDataWithoutCategory");function cLe(t){return rLe[t===0?0:t%rLe.length]}O(cLe,"getPlotColorFromPalette");function err(t,e){const r=e.map(o=>o.value),n=e.map(o=>o.label?nU(o.label):""),i=lLe(r),a=n.some(o=>o!=="");zi.plots.push({type:"line",strokeFill:cLe(eU),strokeWidth:2,data:i,...a?{pointLabels:n}:{}}),eU++}O(err,"setLineData");function trr(t,e){const r=e.map(i=>i.value),n=lLe(r);zi.plots.push({type:"bar",fill:cLe(eU),data:n}),eU++}O(trr,"setBarData");function rrr(){if(zi.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return zi.title=$a(),hri.build(tU,zi,rU,Wtr)}O(rrr,"getDrawableElem");function nrr(){return rU}O(nrr,"getChartThemeConfig");function irr(){return tU}O(irr,"getChartConfig");function arr(){return zi}O(arr,"getXYChartData");var dri=O(function(){_a(),eU=0,tU=aLe(),zi=oLe(),rU=iLe(),rLe=rU.plotColorPalette.split(",").map(t=>t.trim()),Sie=!1,nLe=!1},"clear"),fri={getDrawableElem:rrr,clear:dri,setAccTitle:Ba,getAccTitle:oo,setDiagramTitle:co,getDiagramTitle:$a,getAccDescription:lo,setAccDescription:so,setOrientation:qtr,setXAxisTitle:jtr,setXAxisRangeData:sLe,setXAxisBand:Xtr,setYAxisTitle:Ktr,setYAxisRangeData:Ztr,setLineData:err,setBarData:trr,setTmpSVGG:Ytr,getChartThemeConfig:nrr,getChartConfig:irr,getXYChartData:arr},pri=O((t,e,r,n)=>{const i=n.db,a=i.getChartThemeConfig(),o=i.getChartConfig(),s=i.getXYChartData().plots[0].data.map(y=>y[1]);function l(y){return y==="top"?"text-before-edge":"middle"}O(l,"getDominantBaseLine");function u(y){return y==="left"?"start":y==="right"?"end":"middle"}O(u,"getTextAnchor");function h(y){return`translate(${y.x}, ${y.y}) rotate(${y.rotation||0})`}O(h,"getTextTransformation"),ye.debug(`Rendering xychart chart -`+t);const d=nu(e),f=d.append("g").attr("class","main"),p=f.append("rect").attr("width",o.width).attr("height",o.height).attr("class","background");jo(d,o.height,o.width,!0),d.attr("viewBox",`0 0 ${o.width} ${o.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}O(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),o.showDataLabel){const x=o.showDataLabelOutsideBar;if(o.chartOrientation==="horizontal"){let w=function(_,P){const{data:L,label:R}=_;return P*R.length*A<=L.width-S};O(w,"fitsHorizontally");const A=.7,S=10,T=y.data.map((_,P)=>({data:_,label:s[P].toString()})).filter(_=>_.data.width>0&&_.data.height>0),C=T.map(_=>{const{data:P}=_;let L=P.height*.7;for(;!w(_,L)&&L>0;)L-=1;return L}),k=Math.floor(Math.min(...C)),E=O(_=>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,_,P){const{data:L,label:R}=E,M=_*R.length*.7,I=L.x+L.width/2,N=I-M/2,F=I+M/2,B=N>=L.x&&F<=L.x+L.width,V=L.y+P+_<=L.y+L.height;return B&&V};O(w,"fitsInBar");const A=10,S=y.data.map((E,_)=>({data:E,label:s[_].toString()})).filter(E=>E.data.width>0&&E.data.height>0),T=S.map(E=>{const{data:_,label:P}=E;let L=_.width/(P.length*.7);for(;!w(E,L,A)&&L>0;)L-=1;return L}),C=Math.floor(Math.min(...T)),k=O(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",`${C}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"),gri={draw:pri},mri={parser:nri,db:fri,renderer:gri};const vri=Object.freeze(Object.defineProperty({__proto__:null,diagram:mri},Symbol.toStringTag,{value:"Module"}));var uLe=function(){var t=O(function(ae,K,se,me){for(se=se||{},me=ae.length;me--;se[ae[me]]=K);return se},"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],o=[1,22],s=[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],C=[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],P=[27,29],L=[1,70],R=[1,71],D=[1,72],M=[1,73],I=[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],q=[1,88],Y=[1,89],ne=[1,90],X=[1,91],J=[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],te=[63,64],pe=[1,101],ie=[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],ke=[1,110],Ee=[1,106],ue=[1,107],de=[1,108],xe=[1,109],ge=[1,111],ze=[1,116],we=[1,117],Oe=[1,114],Be=[1,115],Z={trace:O(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:O(function(K,se,me,oe,ve,ce,De){var Le=ce.length-1;switch(ve){case 4:this.$=ce[Le].trim(),oe.setAccTitle(this.$);break;case 5:case 6:this.$=ce[Le].trim(),oe.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:oe.setDirection("TB");break;case 18:oe.setDirection("BT");break;case 19:oe.setDirection("RL");break;case 20:oe.setDirection("LR");break;case 21:oe.addRequirement(ce[Le-3],ce[Le-4]);break;case 22:oe.addRequirement(ce[Le-5],ce[Le-6]),oe.setClass([ce[Le-5]],ce[Le-3]);break;case 23:oe.setNewReqId(ce[Le-2]);break;case 24:oe.setNewReqText(ce[Le-2]);break;case 25:oe.setNewReqRisk(ce[Le-2]);break;case 26:oe.setNewReqVerifyMethod(ce[Le-2]);break;case 29:this.$=oe.RequirementType.REQUIREMENT;break;case 30:this.$=oe.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=oe.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=oe.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=oe.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=oe.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=oe.RiskLevel.LOW_RISK;break;case 36:this.$=oe.RiskLevel.MED_RISK;break;case 37:this.$=oe.RiskLevel.HIGH_RISK;break;case 38:this.$=oe.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=oe.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=oe.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=oe.VerifyType.VERIFY_TEST;break;case 42:oe.addElement(ce[Le-3]);break;case 43:oe.addElement(ce[Le-5]),oe.setClass([ce[Le-5]],ce[Le-3]);break;case 44:oe.setNewElementType(ce[Le-2]);break;case 45:oe.setNewElementDocRef(ce[Le-2]);break;case 48:oe.addRelationship(ce[Le-2],ce[Le],ce[Le-4]);break;case 49:oe.addRelationship(ce[Le-2],ce[Le-4],ce[Le]);break;case 50:this.$=oe.Relationships.CONTAINS;break;case 51:this.$=oe.Relationships.COPIES;break;case 52:this.$=oe.Relationships.DERIVES;break;case 53:this.$=oe.Relationships.SATISFIES;break;case 54:this.$=oe.Relationships.VERIFIES;break;case 55:this.$=oe.Relationships.REFINES;break;case 56:this.$=oe.Relationships.TRACES;break;case 57:this.$=ce[Le-2],oe.defineClass(ce[Le-1],ce[Le]);break;case 58:oe.setClass(ce[Le-1],ce[Le]);break;case 59:oe.setClass([ce[Le-2]],ce[Le]);break;case 60:case 62:this.$=[ce[Le]];break;case 61:case 63:this.$=ce[Le-2].concat([ce[Le]]);break;case 64:this.$=ce[Le-2],oe.setCssStyle(ce[Le-1],ce[Le]);break;case 65:this.$=[ce[Le]];break;case 66:ce[Le-2].push(ce[Le]),this.$=ce[Le-2];break;case 68:this.$=ce[Le-1]+ce[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:o,7:13,8:s,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:o,7:42,8:s,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:o,7:43,8:s,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:o,7:44,8:s,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:o,7:45,8:s,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:o,7:46,8:s,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:o,7:47,8:s,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:o,7:48,8:s,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:o,7:49,8:s,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:o,7:50,8:s,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(C,[2,17]),t(C,[2,18]),t(C,[2,19]),t(C,[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(P,[2,79]),t(P,[2,80]),{27:[1,67],29:[1,68]},t(P,[2,85]),t(P,[2,86]),{62:69,65:L,66:R,67:D,68:M,69:I,70:N,71:F},{62:77,65:L,66:R,67:D,68:M,69:I,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:q,85:Y,86:ne,87:X,88:J},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:q,85:Y,86:ne,87:X,88:J},{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(te,[2,50]),t(te,[2,51]),t(te,[2,52]),t(te,[2,53]),t(te,[2,54]),t(te,[2,55]),t(te,[2,56]),{64:[1,100]},t(C,[2,59],{76:V}),t(C,[2,64],{76:pe}),{33:103,75:[1,102],89:S,90:T},t(ie,[2,65],{79:104,75:B,80:z,81:U,82:Q,83:G,84:q,85:Y,86:ne,87:X,88:J}),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(C,[2,57],{76:pe}),t(C,[2,58],{76:V}),{5:ke,28:105,31:Ee,34:ue,36:de,38:xe,40:ge},{27:[1,112],76:V},{5:ze,40:we,56:113,57:Oe,59:Be},{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:q,85:Y,86:ne,87:X,88:J},t(ee,[2,61]),t(ee,[2,63]),t(Ce,[2,68]),t(C,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:ke,28:126,31:Ee,34:ue,36:de,38:xe,40:ge},t(C,[2,28]),{5:[1,127]},t(C,[2,42]),{32:[1,128]},{32:[1,129]},{5:ze,40:we,56:130,57:Oe,59:Be},t(C,[2,47]),{5:[1,131]},t(C,[2,48]),t(C,[2,49]),t(ie,[2,66],{79:104,75:B,80:z,81:U,82:Q,83:G,84:q,85:Y,86:ne,87:X,88:J}),{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(C,[2,27]),{5:ke,28:145,31:Ee,34:ue,36:de,38:xe,40:ge},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(C,[2,46]),{5:ze,40:we,56:152,57:Oe,59:Be},{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(C,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(C,[2,43]),{5:ke,28:159,31:Ee,34:ue,36:de,38:xe,40:ge},{5:ke,28:160,31:Ee,34:ue,36:de,38:xe,40:ge},{5:ke,28:161,31:Ee,34:ue,36:de,38:xe,40:ge},{5:ke,28:162,31:Ee,34:ue,36:de,38:xe,40:ge},{5:ze,40:we,56:163,57:Oe,59:Be},{5:ze,40:we,56:164,57:Oe,59:Be},t(C,[2,23]),t(C,[2,24]),t(C,[2,25]),t(C,[2,26]),t(C,[2,44]),t(C,[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:O(function(K,se){if(se.recoverable)this.trace(K);else{var me=new Error(K);throw me.hash=se,me}},"parseError"),parse:O(function(K){var se=this,me=[0],oe=[],ve=[null],ce=[],De=this.table,Le="",We=0,Ne=0,je=2,$e=1,Ze=ce.slice.call(arguments,1),He=Object.create(this.lexer),et={yy:{}};for(var Pe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Pe)&&(et.yy[Pe]=this.yy[Pe]);He.setInput(K,et.yy),et.yy.lexer=He,et.yy.parser=this,typeof He.yylloc>"u"&&(He.yylloc={});var yt=He.yylloc;ce.push(yt);var Ie=He.options&&He.options.ranges;typeof et.yy.parseError=="function"?this.parseError=et.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function St(Me){me.length=me.length-2*Me,ve.length=ve.length-Me,ce.length=ce.length-Me}O(St,"popStack");function kt(){var Me;return Me=oe.pop()||He.lex()||$e,typeof Me!="number"&&(Me instanceof Array&&(oe=Me,Me=oe.pop()),Me=se.symbols_[Me]||Me),Me}O(kt,"lex");for(var ut,Gt,It,gt,Te={},Bt,Et,At,Mt;;){if(Gt=me[me.length-1],this.defaultActions[Gt]?It=this.defaultActions[Gt]:((ut===null||typeof ut>"u")&&(ut=kt()),It=De[Gt]&&De[Gt][ut]),typeof It>"u"||!It.length||!It[0]){var qr="";Mt=[];for(Bt in De[Gt])this.terminals_[Bt]&&Bt>je&&Mt.push("'"+this.terminals_[Bt]+"'");He.showPosition?qr="Parse error on line "+(We+1)+`: +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:O(function(){var N=this.next();return N||this.lex()},"lex"),begin:O(function(N){this.conditionStack.push(N)},"begin"),popState:O(function(){var N=this.conditionStack.length-1;return N>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(N){return N=this.conditionStack.length-1-Math.abs(N||0),N>=0?this.conditionStack[N]:"INITIAL"},"topState"),pushState:O(function(N){this.begin(N)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(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 O(D,"Parser"),D.prototype=L,L.Parser=D,new D}();JDe.parser=JDe;var ari=JDe;function eLe(t){return t.type==="bar"}O(eLe,"isBarPlot");function Aie(t){return t.type==="band"}O(Aie,"isBandAxisData");function SD(t){return t.type==="linear"}O(SD,"isLinearAxisData");var Vtr=(tP=class{constructor(e){this.parentGroup=e}getMaxDimension(e,r){if(!this.parentGroup)return{width:e.reduce((a,o)=>Math.max(o.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 o=qCt(i,1,a),s=o?o.width:a.length*r,l=o?o.height:r;n.width=Math.max(n.width,s),n.height=Math.max(n.height,l)}return i.remove(),n}},O(tP,"TextDimensionCalculatorWithFont"),tP),Qtr=.7,Gtr=.2,Htr=(rP=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(){Qtr*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(Qtr*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=Gtr*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=Gtr*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():[]}},O(rP,"BaseAxis"),rP),ori=(nP=class extends Htr{constructor(e,r,n,i,a){super(e,i,a,r),this.categories=n,this.scale=xbe().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=xbe().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),ye.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},O(nP,"BandAxis"),nP),sri=(iP=class extends Htr{constructor(e,r,n,i,a){super(e,i,a,r),this.domain=n,this.scale=hR().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const e=[...this.domain];this.axisPosition==="left"&&e.reverse(),this.scale=hR().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}},O(iP,"LinearAxis"),iP);function tLe(t,e,r,n){const i=new Vtr(n);return Aie(t)?new ori(e,r,t.categories,t.title,i):new sri(e,r,[t.min,t.max],t.title,i)}O(tLe,"getAxis");var lri=(aP=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}},O(aP,"ChartTitle"),aP);function Wtr(t,e,r,n){const i=new Vtr(n);return new lri(i,t,e,r)}O(Wtr,"getChartTitleComponent");var cri=(oP=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=N7().y(i=>i[0]).x(i=>i[1])(e):r=N7().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 o=[];for(const[s,[l,u]]of e.entries()){const h=this.plotData.pointLabels[s];h&&(this.orientation==="horizontal"?o.push({x:u+10,y:l,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):o.push({x:l,y:u-10,text:h,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}o.length>0&&n.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:o})}return n}},O(oP,"LinePlot"),oP),uri=(sP=class{constructor(e,r,n,i,a,o){this.barData=e,this.boundingRect=r,this.xAxis=n,this.yAxis=i,this.orientation=a,this.plotIndex=o}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}))}]}},O(sP,"BarPlot"),sP),hri=(lP=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 cri(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break;case"bar":{const i=new uri(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,r);e.push(...i.getDrawableElement())}break}return e}},O(lP,"BasePlot"),lP);function Ytr(t,e,r){return new hri(t,e,r)}O(Ytr,"getPlotComponent");var dri=(cP=class{constructor(e,r,n,i){this.chartConfig=e,this.chartData=r,this.componentStore={title:Wtr(e,r,n,i),plot:Ytr(e,r,n),xAxis:tLe(r.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},i),yAxis:tLe(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),o=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),s=this.componentStore.plot.calculateSpace({width:a,height:o});e-=s.width,r-=s.height,s=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:r}),i=s.height,r-=s.height,this.componentStore.xAxis.setAxisPosition("bottom"),s=this.componentStore.xAxis.calculateSpace({width:e,height:r}),r-=s.height,this.componentStore.yAxis.setAxisPosition("left"),s=this.componentStore.yAxis.calculateSpace({width:e,height:r}),n=s.width,e-=s.width,e>0&&(a+=e,e=0),r>0&&(o+=r,r=0),this.componentStore.plot.calculateSpace({width:a,height:o}),this.componentStore.plot.setBoundingBoxXY({x:n,y:i}),this.componentStore.xAxis.setRange([n,n+a]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:i+o}),this.componentStore.yAxis.setRange([i,i+o]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(l=>eLe(l))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,r=this.chartConfig.height,n=0,i=0,a=0,o=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),s=Math.floor(r*this.chartConfig.plotReservedSpacePercent/100),l=this.componentStore.plot.calculateSpace({width:o,height:s});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&&(o+=e,e=0),r>0&&(s+=r,r=0),this.componentStore.plot.calculateSpace({width:o,height:s}),this.componentStore.plot.setBoundingBoxXY({x:i,y:a}),this.componentStore.yAxis.setRange([i,i+o]),this.componentStore.yAxis.setBoundingBoxXY({x:i,y:n}),this.componentStore.xAxis.setRange([a,a+s]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(u=>eLe(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}},O(cP,"Orchestrator"),cP),fri=(uP=class{static build(e,r,n,i){return new dri(e,r,n,i).getDrawableElement()}},O(uP,"XYChartBuilder"),uP),eU=0,qtr,tU=aLe(),rU=iLe(),zi=oLe(),rLe=rU.plotColorPalette.split(",").map(t=>t.trim()),Sie=!1,nLe=!1;function iLe(){const t=jy(),e=Dr();return uo(t.xyChart,e.themeVariables.xyChart)}O(iLe,"getChartDefaultThemeConfig");function aLe(){const t=Dr();return uo(Jn.xyChart,t.xyChart)}O(aLe,"getChartDefaultConfig");function oLe(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}O(oLe,"getChartDefaultData");function nU(t){const e=Dr();return li(t.trim(),e)}O(nU,"textSanitizer");function jtr(t){qtr=t}O(jtr,"setTmpSVGG");function Xtr(t){t==="horizontal"?tU.chartOrientation="horizontal":tU.chartOrientation="vertical"}O(Xtr,"setOrientation");function Ktr(t){zi.xAxis.title=nU(t.text)}O(Ktr,"setXAxisTitle");function sLe(t,e){zi.xAxis={type:"linear",title:zi.xAxis.title,min:t,max:e},Sie=!0}O(sLe,"setXAxisRangeData");function Ztr(t){zi.xAxis={type:"band",title:zi.xAxis.title,categories:t.map(e=>nU(e.text))},Sie=!0}O(Ztr,"setXAxisBand");function Jtr(t){zi.yAxis.title=nU(t.text)}O(Jtr,"setYAxisTitle");function err(t,e){zi.yAxis={type:"linear",title:zi.yAxis.title,min:t,max:e},nLe=!0}O(err,"setYAxisRangeData");function trr(t){const e=Math.min(...t),r=Math.max(...t),n=SD(zi.yAxis)?zi.yAxis.min:1/0,i=SD(zi.yAxis)?zi.yAxis.max:-1/0;zi.yAxis={type:"linear",title:zi.yAxis.title,min:Math.min(n,e),max:Math.max(i,r)}}O(trr,"setYAxisRangeFromPlotData");function lLe(t){let e=[];if(t.length===0)return e;if(!Sie){const r=SD(zi.xAxis)?zi.xAxis.min:1/0,n=SD(zi.xAxis)?zi.xAxis.max:-1/0;sLe(Math.min(r,1),Math.max(n,t.length))}if(Aie(zi.xAxis)&&t.length>zi.xAxis.categories.length&&(t=t.slice(0,zi.xAxis.categories.length)),nLe||trr(t),Aie(zi.xAxis)&&(e=zi.xAxis.categories.map((r,n)=>[r,t[n]])),SD(zi.xAxis)){const r=zi.xAxis.min,n=zi.xAxis.max;if(t.length===1)e=[[`${r}`,t[0]]];else{const i=(n-r)/(t.length-1);e=t.map((a,o)=>[`${r+o*i}`,a])}}return e}O(lLe,"transformDataWithoutCategory");function cLe(t){return rLe[t===0?0:t%rLe.length]}O(cLe,"getPlotColorFromPalette");function rrr(t,e){const r=e.map(o=>o.value),n=e.map(o=>o.label?nU(o.label):""),i=lLe(r),a=n.some(o=>o!=="");zi.plots.push({type:"line",strokeFill:cLe(eU),strokeWidth:2,data:i,...a?{pointLabels:n}:{}}),eU++}O(rrr,"setLineData");function nrr(t,e){const r=e.map(i=>i.value),n=lLe(r);zi.plots.push({type:"bar",fill:cLe(eU),data:n}),eU++}O(nrr,"setBarData");function irr(){if(zi.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return zi.title=$a(),fri.build(tU,zi,rU,qtr)}O(irr,"getDrawableElem");function arr(){return rU}O(arr,"getChartThemeConfig");function orr(){return tU}O(orr,"getChartConfig");function srr(){return zi}O(srr,"getXYChartData");var pri=O(function(){_a(),eU=0,tU=aLe(),zi=oLe(),rU=iLe(),rLe=rU.plotColorPalette.split(",").map(t=>t.trim()),Sie=!1,nLe=!1},"clear"),gri={getDrawableElem:irr,clear:pri,setAccTitle:Ba,getAccTitle:oo,setDiagramTitle:co,getDiagramTitle:$a,getAccDescription:lo,setAccDescription:so,setOrientation:Xtr,setXAxisTitle:Ktr,setXAxisRangeData:sLe,setXAxisBand:Ztr,setYAxisTitle:Jtr,setYAxisRangeData:err,setLineData:rrr,setBarData:nrr,setTmpSVGG:jtr,getChartThemeConfig:arr,getChartConfig:orr,getXYChartData:srr},mri=O((t,e,r,n)=>{const i=n.db,a=i.getChartThemeConfig(),o=i.getChartConfig(),s=i.getXYChartData().plots[0].data.map(y=>y[1]);function l(y){return y==="top"?"text-before-edge":"middle"}O(l,"getDominantBaseLine");function u(y){return y==="left"?"start":y==="right"?"end":"middle"}O(u,"getTextAnchor");function h(y){return`translate(${y.x}, ${y.y}) rotate(${y.rotation||0})`}O(h,"getTextTransformation"),ye.debug(`Rendering xychart chart +`+t);const d=nu(e),f=d.append("g").attr("class","main"),p=f.append("rect").attr("width",o.width).attr("height",o.height).attr("class","background");jo(d,o.height,o.width,!0),d.attr("viewBox",`0 0 ${o.width} ${o.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}O(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),o.showDataLabel){const x=o.showDataLabelOutsideBar;if(o.chartOrientation==="horizontal"){let w=function(_,P){const{data:L,label:R}=_;return P*R.length*A<=L.width-S};O(w,"fitsHorizontally");const A=.7,S=10,T=y.data.map((_,P)=>({data:_,label:s[P].toString()})).filter(_=>_.data.width>0&&_.data.height>0),C=T.map(_=>{const{data:P}=_;let L=P.height*.7;for(;!w(_,L)&&L>0;)L-=1;return L}),k=Math.floor(Math.min(...C)),E=O(_=>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,_,P){const{data:L,label:R}=E,M=_*R.length*.7,I=L.x+L.width/2,N=I-M/2,F=I+M/2,B=N>=L.x&&F<=L.x+L.width,V=L.y+P+_<=L.y+L.height;return B&&V};O(w,"fitsInBar");const A=10,S=y.data.map((E,_)=>({data:E,label:s[_].toString()})).filter(E=>E.data.width>0&&E.data.height>0),T=S.map(E=>{const{data:_,label:P}=E;let L=_.width/(P.length*.7);for(;!w(E,L,A)&&L>0;)L-=1;return L}),C=Math.floor(Math.min(...T)),k=O(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",`${C}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"),vri={draw:mri},yri={parser:ari,db:gri,renderer:vri};const bri=Object.freeze(Object.defineProperty({__proto__:null,diagram:yri},Symbol.toStringTag,{value:"Module"}));var uLe=function(){var t=O(function(ae,K,se,me){for(se=se||{},me=ae.length;me--;se[ae[me]]=K);return se},"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],o=[1,22],s=[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],C=[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],P=[27,29],L=[1,70],R=[1,71],D=[1,72],M=[1,73],I=[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],q=[1,88],Y=[1,89],ne=[1,90],X=[1,91],J=[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],te=[63,64],pe=[1,101],ie=[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],ke=[1,110],Ee=[1,106],ue=[1,107],de=[1,108],xe=[1,109],ge=[1,111],ze=[1,116],we=[1,117],Oe=[1,114],Be=[1,115],Z={trace:O(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:O(function(K,se,me,oe,ve,ce,De){var Le=ce.length-1;switch(ve){case 4:this.$=ce[Le].trim(),oe.setAccTitle(this.$);break;case 5:case 6:this.$=ce[Le].trim(),oe.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:oe.setDirection("TB");break;case 18:oe.setDirection("BT");break;case 19:oe.setDirection("RL");break;case 20:oe.setDirection("LR");break;case 21:oe.addRequirement(ce[Le-3],ce[Le-4]);break;case 22:oe.addRequirement(ce[Le-5],ce[Le-6]),oe.setClass([ce[Le-5]],ce[Le-3]);break;case 23:oe.setNewReqId(ce[Le-2]);break;case 24:oe.setNewReqText(ce[Le-2]);break;case 25:oe.setNewReqRisk(ce[Le-2]);break;case 26:oe.setNewReqVerifyMethod(ce[Le-2]);break;case 29:this.$=oe.RequirementType.REQUIREMENT;break;case 30:this.$=oe.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=oe.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=oe.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=oe.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=oe.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=oe.RiskLevel.LOW_RISK;break;case 36:this.$=oe.RiskLevel.MED_RISK;break;case 37:this.$=oe.RiskLevel.HIGH_RISK;break;case 38:this.$=oe.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=oe.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=oe.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=oe.VerifyType.VERIFY_TEST;break;case 42:oe.addElement(ce[Le-3]);break;case 43:oe.addElement(ce[Le-5]),oe.setClass([ce[Le-5]],ce[Le-3]);break;case 44:oe.setNewElementType(ce[Le-2]);break;case 45:oe.setNewElementDocRef(ce[Le-2]);break;case 48:oe.addRelationship(ce[Le-2],ce[Le],ce[Le-4]);break;case 49:oe.addRelationship(ce[Le-2],ce[Le-4],ce[Le]);break;case 50:this.$=oe.Relationships.CONTAINS;break;case 51:this.$=oe.Relationships.COPIES;break;case 52:this.$=oe.Relationships.DERIVES;break;case 53:this.$=oe.Relationships.SATISFIES;break;case 54:this.$=oe.Relationships.VERIFIES;break;case 55:this.$=oe.Relationships.REFINES;break;case 56:this.$=oe.Relationships.TRACES;break;case 57:this.$=ce[Le-2],oe.defineClass(ce[Le-1],ce[Le]);break;case 58:oe.setClass(ce[Le-1],ce[Le]);break;case 59:oe.setClass([ce[Le-2]],ce[Le]);break;case 60:case 62:this.$=[ce[Le]];break;case 61:case 63:this.$=ce[Le-2].concat([ce[Le]]);break;case 64:this.$=ce[Le-2],oe.setCssStyle(ce[Le-1],ce[Le]);break;case 65:this.$=[ce[Le]];break;case 66:ce[Le-2].push(ce[Le]),this.$=ce[Le-2];break;case 68:this.$=ce[Le-1]+ce[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:o,7:13,8:s,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:o,7:42,8:s,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:o,7:43,8:s,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:o,7:44,8:s,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:o,7:45,8:s,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:o,7:46,8:s,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:o,7:47,8:s,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:o,7:48,8:s,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:o,7:49,8:s,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:o,7:50,8:s,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(C,[2,17]),t(C,[2,18]),t(C,[2,19]),t(C,[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(P,[2,79]),t(P,[2,80]),{27:[1,67],29:[1,68]},t(P,[2,85]),t(P,[2,86]),{62:69,65:L,66:R,67:D,68:M,69:I,70:N,71:F},{62:77,65:L,66:R,67:D,68:M,69:I,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:q,85:Y,86:ne,87:X,88:J},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:q,85:Y,86:ne,87:X,88:J},{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(te,[2,50]),t(te,[2,51]),t(te,[2,52]),t(te,[2,53]),t(te,[2,54]),t(te,[2,55]),t(te,[2,56]),{64:[1,100]},t(C,[2,59],{76:V}),t(C,[2,64],{76:pe}),{33:103,75:[1,102],89:S,90:T},t(ie,[2,65],{79:104,75:B,80:z,81:U,82:Q,83:G,84:q,85:Y,86:ne,87:X,88:J}),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(C,[2,57],{76:pe}),t(C,[2,58],{76:V}),{5:ke,28:105,31:Ee,34:ue,36:de,38:xe,40:ge},{27:[1,112],76:V},{5:ze,40:we,56:113,57:Oe,59:Be},{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:q,85:Y,86:ne,87:X,88:J},t(ee,[2,61]),t(ee,[2,63]),t(Ce,[2,68]),t(C,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:ke,28:126,31:Ee,34:ue,36:de,38:xe,40:ge},t(C,[2,28]),{5:[1,127]},t(C,[2,42]),{32:[1,128]},{32:[1,129]},{5:ze,40:we,56:130,57:Oe,59:Be},t(C,[2,47]),{5:[1,131]},t(C,[2,48]),t(C,[2,49]),t(ie,[2,66],{79:104,75:B,80:z,81:U,82:Q,83:G,84:q,85:Y,86:ne,87:X,88:J}),{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(C,[2,27]),{5:ke,28:145,31:Ee,34:ue,36:de,38:xe,40:ge},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(C,[2,46]),{5:ze,40:we,56:152,57:Oe,59:Be},{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(C,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(C,[2,43]),{5:ke,28:159,31:Ee,34:ue,36:de,38:xe,40:ge},{5:ke,28:160,31:Ee,34:ue,36:de,38:xe,40:ge},{5:ke,28:161,31:Ee,34:ue,36:de,38:xe,40:ge},{5:ke,28:162,31:Ee,34:ue,36:de,38:xe,40:ge},{5:ze,40:we,56:163,57:Oe,59:Be},{5:ze,40:we,56:164,57:Oe,59:Be},t(C,[2,23]),t(C,[2,24]),t(C,[2,25]),t(C,[2,26]),t(C,[2,44]),t(C,[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:O(function(K,se){if(se.recoverable)this.trace(K);else{var me=new Error(K);throw me.hash=se,me}},"parseError"),parse:O(function(K){var se=this,me=[0],oe=[],ve=[null],ce=[],De=this.table,Le="",We=0,Ne=0,je=2,$e=1,Ze=ce.slice.call(arguments,1),He=Object.create(this.lexer),et={yy:{}};for(var Pe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Pe)&&(et.yy[Pe]=this.yy[Pe]);He.setInput(K,et.yy),et.yy.lexer=He,et.yy.parser=this,typeof He.yylloc>"u"&&(He.yylloc={});var yt=He.yylloc;ce.push(yt);var Ie=He.options&&He.options.ranges;typeof et.yy.parseError=="function"?this.parseError=et.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function St(Me){me.length=me.length-2*Me,ve.length=ve.length-Me,ce.length=ce.length-Me}O(St,"popStack");function kt(){var Me;return Me=oe.pop()||He.lex()||$e,typeof Me!="number"&&(Me instanceof Array&&(oe=Me,Me=oe.pop()),Me=se.symbols_[Me]||Me),Me}O(kt,"lex");for(var ut,Gt,It,gt,Te={},Bt,Et,At,Mt;;){if(Gt=me[me.length-1],this.defaultActions[Gt]?It=this.defaultActions[Gt]:((ut===null||typeof ut>"u")&&(ut=kt()),It=De[Gt]&&De[Gt][ut]),typeof It>"u"||!It.length||!It[0]){var qr="";Mt=[];for(Bt in De[Gt])this.terminals_[Bt]&&Bt>je&&Mt.push("'"+this.terminals_[Bt]+"'");He.showPosition?qr="Parse error on line "+(We+1)+`: `+He.showPosition()+` Expecting `+Mt.join(", ")+", got '"+(this.terminals_[ut]||ut)+"'":qr="Parse error on line "+(We+1)+": Unexpected "+(ut==$e?"end of input":"'"+(this.terminals_[ut]||ut)+"'"),this.parseError(qr,{text:He.match,token:this.terminals_[ut]||ut,line:He.yylineno,loc:yt,expected:Mt})}if(It[0]instanceof Array&&It.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Gt+", token: "+ut);switch(It[0]){case 1:me.push(ut),ve.push(He.yytext),ce.push(He.yylloc),me.push(It[1]),ut=null,Ne=He.yyleng,Le=He.yytext,We=He.yylineno,yt=He.yylloc;break;case 2:if(Et=this.productions_[It[1]][1],Te.$=ve[ve.length-Et],Te._$={first_line:ce[ce.length-(Et||1)].first_line,last_line:ce[ce.length-1].last_line,first_column:ce[ce.length-(Et||1)].first_column,last_column:ce[ce.length-1].last_column},Ie&&(Te._$.range=[ce[ce.length-(Et||1)].range[0],ce[ce.length-1].range[1]]),gt=this.performAction.apply(Te,[Le,Ne,We,et.yy,It[1],ve,ce].concat(Ze)),typeof gt<"u")return gt;Et&&(me=me.slice(0,-1*Et*2),ve=ve.slice(0,-1*Et),ce=ce.slice(0,-1*Et)),me.push(this.productions_[It[1]][0]),ve.push(Te.$),ce.push(Te._$),At=De[me[me.length-2]][me[me.length-1]],me.push(At);break;case 3:return!0}}return!0},"parse")},le=function(){var ae={EOF:1,parseError:O(function(se,me){if(this.yy.parser)this.yy.parser.parseError(se,me);else throw new Error(se)},"parseError"),setInput:O(function(K,se){return this.yy=se||this.yy||{},this._input=K,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:O(function(){var K=this._input[0];this.yytext+=K,this.yyleng++,this.offset++,this.match+=K,this.matched+=K;var se=K.match(/(?:\r\n?|\n).*/g);return se?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),K},"input"),unput:O(function(K){var se=K.length,me=K.split(/(?:\r\n?|\n)/g);this._input=K+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-se),this.offset-=se;var oe=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),me.length-1&&(this.yylineno-=me.length-1);var ve=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:me?(me.length===oe.length?this.yylloc.first_column:0)+oe[oe.length-me.length].length-me[0].length:this.yylloc.first_column-se},this.options.ranges&&(this.yylloc.range=[ve[0],ve[0]+this.yyleng-se]),this.yyleng=this.yytext.length,this},"unput"),more:O(function(){return this._more=!0,this},"more"),reject:O(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:O(function(K){this.unput(this.match.slice(K))},"less"),pastInput:O(function(){var K=this.matched.substr(0,this.matched.length-this.match.length);return(K.length>20?"...":"")+K.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:O(function(){var K=this.match;return K.length<20&&(K+=this._input.substr(0,20-K.length)),(K.substr(0,20)+(K.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:O(function(){var K=this.pastInput(),se=new Array(K.length+1).join("-");return K+this.upcomingInput()+` `+se+"^"},"showPosition"),test_match:O(function(K,se){var me,oe,ve;if(this.options.backtrack_lexer&&(ve={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&&(ve.yylloc.range=this.yylloc.range.slice(0))),oe=K[0].match(/(?:\r\n?|\n).*/g),oe&&(this.yylineno+=oe.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:oe?oe[oe.length-1].length-oe[oe.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+K[0].length},this.yytext+=K[0],this.match+=K[0],this.matches=K,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(K[0].length),this.matched+=K[0],me=this.performAction.call(this,this.yy,this,se,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),me)return me;if(this._backtrack){for(var ce in ve)this[ce]=ve[ce];return!1}return!1},"test_match"),next:O(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var K,se,me,oe;this._more||(this.yytext="",this.match="");for(var ve=this._currentRules(),ce=0;cese[0].length)){if(se=me,oe=ce,this.options.backtrack_lexer){if(K=this.test_match(me,ve[ce]),K!==!1)return K;if(this._backtrack){se=!1;continue}else return!1}else if(!this.options.flex)break}return se?(K=this.test_match(se,ve[oe]),K!==!1?K:!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:O(function(){var se=this.next();return se||this.lex()},"lex"),begin:O(function(se){this.conditionStack.push(se)},"begin"),popState:O(function(){var se=this.conditionStack.length-1;return se>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(se){return se=this.conditionStack.length-1-Math.abs(se||0),se>=0?this.conditionStack[se]:"INITIAL"},"topState"),pushState:O(function(se){this.begin(se)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(function(se,me,oe,ve){switch(oe){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;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:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return me.yytext=me.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?: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,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,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,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return ae}();Z.lexer=le;function be(){this.yy={}}return O(be,"Parser"),be.prototype=Z,Z.Parser=be,new be}();uLe.parser=uLe;var yri=uLe,bri=(hP=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=Ba,this.getAccTitle=oo,this.setAccDescription=so,this.getAccDescription=lo,this.setDiagramTitle=co,this.getDiagramTitle=$a,this.getConfig=O(()=>Ye().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(e,r){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:r,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=e)}setNewReqText(e){this.latestRequirement!==void 0&&(this.latestRequirement.text=e)}setNewReqRisk(e){this.latestRequirement!==void 0&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),ye.info("Added new element: ",e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){this.latestElement!==void 0&&(this.latestElement.type=e)}setNewElementDocRef(e){this.latestElement!==void 0&&(this.latestElement.docRef=e)}addRelationship(e,r,n){this.relations.push({type:e,src:r,dst:n})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,_a()}setCssStyle(e,r){for(const n of e){const i=this.requirements.get(n)??this.elements.get(n);if(!r||!i)return;for(const a of r)a.includes(",")?i.cssStyles.push(...a.split(",")):i.cssStyles.push(a)}}setClass(e,r){var n;for(const i of e){const a=this.requirements.get(i)??this.elements.get(i);if(a)for(const o of r){a.classes.push(o);const s=(n=this.classes.get(o))==null?void 0:n.styles;s&&a.cssStyles.push(...s)}}}defineClass(e,r){for(const n of e){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 o=a.replace("fill","bgFill");i.textStyles.push(o)}i.styles.push(a)}),this.requirements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(o=>o.split(",")))}),this.elements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(o=>o.split(",")))})}}getClasses(){return this.classes}getData(){var i,a,o,s;const e=Ye(),r=[],n=[];for(const l of this.requirements.values()){const u=l;u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.shape="requirementBox",u.look=e.look,u.colorIndex=r.length,r.push(u)}for(const l of this.elements.values()){const u=l;u.shape="requirementBox",u.look=e.look,u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.colorIndex=r.length,r.push(u)}for(const l of this.relations){let u=0;const h=l.type===this.Relationships.CONTAINS,d={id:`${l.src}-${l.dst}-${u}`,start:((i=this.requirements.get(l.src))==null?void 0:i.name)??((a=this.elements.get(l.src))==null?void 0:a.name),end:((o=this.requirements.get(l.dst))==null?void 0:o.name)??((s=this.elements.get(l.dst))==null?void 0:s.name),label:`<<${l.type}>>`,classes:"relationshipLine",style:["fill:none",h?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:h?"normal":"dashed",arrowTypeStart:h?"requirement_contains":"",arrowTypeEnd:h?"":"requirement_arrow",look:e.look,labelType:"markdown"};n.push(d),u++}return{nodes:r,edges:n,other:{},config:e,direction:this.getDirection()}}},O(hP,"RequirementDB"),hP),xri=O(t=>{const e=Dr(),{themeVariables:r,look:n}=e,{bkgColorArray:i,borderColorArray:a}=r;if(!(a!=null&&a.length))return"";let o="";for(let s=0;s0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(se){return se=this.conditionStack.length-1-Math.abs(se||0),se>=0?this.conditionStack[se]:"INITIAL"},"topState"),pushState:O(function(se){this.begin(se)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(function(se,me,oe,ve){switch(oe){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;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:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:break;case 14:break;case 15:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 56:break;case 57:this.begin("string");break;case 58:this.popState();break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 64:this.begin("string");break;case 65:this.popState();break;case 66:return"qString";case 67:return me.yytext=me.yytext.trim(),89;case 68:return 75;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?: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,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,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,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}};return ae}();Z.lexer=le;function be(){this.yy={}}return O(be,"Parser"),be.prototype=Z,Z.Parser=be,new be}();uLe.parser=uLe;var xri=uLe,wri=(hP=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=Ba,this.getAccTitle=oo,this.setAccDescription=so,this.getAccDescription=lo,this.setDiagramTitle=co,this.getDiagramTitle=$a,this.getConfig=O(()=>Ye().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}getDirection(){return this.direction}setDirection(e){this.direction=e}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(e,r){return this.requirements.has(e)||this.requirements.set(e,{name:e,type:r,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(e)}getRequirements(){return this.requirements}setNewReqId(e){this.latestRequirement!==void 0&&(this.latestRequirement.requirementId=e)}setNewReqText(e){this.latestRequirement!==void 0&&(this.latestRequirement.text=e)}setNewReqRisk(e){this.latestRequirement!==void 0&&(this.latestRequirement.risk=e)}setNewReqVerifyMethod(e){this.latestRequirement!==void 0&&(this.latestRequirement.verifyMethod=e)}addElement(e){return this.elements.has(e)||(this.elements.set(e,{name:e,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),ye.info("Added new element: ",e)),this.resetLatestElement(),this.elements.get(e)}getElements(){return this.elements}setNewElementType(e){this.latestElement!==void 0&&(this.latestElement.type=e)}setNewElementDocRef(e){this.latestElement!==void 0&&(this.latestElement.docRef=e)}addRelationship(e,r,n){this.relations.push({type:e,src:r,dst:n})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,_a()}setCssStyle(e,r){for(const n of e){const i=this.requirements.get(n)??this.elements.get(n);if(!r||!i)return;for(const a of r)a.includes(",")?i.cssStyles.push(...a.split(",")):i.cssStyles.push(a)}}setClass(e,r){var n;for(const i of e){const a=this.requirements.get(i)??this.elements.get(i);if(a)for(const o of r){a.classes.push(o);const s=(n=this.classes.get(o))==null?void 0:n.styles;s&&a.cssStyles.push(...s)}}}defineClass(e,r){for(const n of e){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 o=a.replace("fill","bgFill");i.textStyles.push(o)}i.styles.push(a)}),this.requirements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(o=>o.split(",")))}),this.elements.forEach(a=>{a.classes.includes(n)&&a.cssStyles.push(...r.flatMap(o=>o.split(",")))})}}getClasses(){return this.classes}getData(){var i,a,o,s;const e=Ye(),r=[],n=[];for(const l of this.requirements.values()){const u=l;u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.shape="requirementBox",u.look=e.look,u.colorIndex=r.length,r.push(u)}for(const l of this.elements.values()){const u=l;u.shape="requirementBox",u.look=e.look,u.id=l.name,u.cssStyles=l.cssStyles,u.cssClasses=l.classes.join(" "),u.colorIndex=r.length,r.push(u)}for(const l of this.relations){let u=0;const h=l.type===this.Relationships.CONTAINS,d={id:`${l.src}-${l.dst}-${u}`,start:((i=this.requirements.get(l.src))==null?void 0:i.name)??((a=this.elements.get(l.src))==null?void 0:a.name),end:((o=this.requirements.get(l.dst))==null?void 0:o.name)??((s=this.elements.get(l.dst))==null?void 0:s.name),label:`<<${l.type}>>`,classes:"relationshipLine",style:["fill:none",h?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:h?"normal":"dashed",arrowTypeStart:h?"requirement_contains":"",arrowTypeEnd:h?"":"requirement_arrow",look:e.look,labelType:"markdown"};n.push(d),u++}return{nodes:r,edges:n,other:{},config:e,direction:this.getDirection()}}},O(hP,"RequirementDB"),hP),Ari=O(t=>{const e=Dr(),{themeVariables:r,look:n}=e,{bkgColorArray:i,borderColorArray:a}=r;if(!(a!=null&&a.length))return"";let o="";for(let s=0;s{const e=Dr(),{look:r,themeVariables:n}=e,{requirementEdgeLabelBackground:i}=n;return` - ${xri(t)} + `;return o},"genColor"),Sri=O(t=>{const e=Dr(),{look:r,themeVariables:n}=e,{requirementEdgeLabelBackground:i}=n;return` + ${Ari(t)} marker { fill: ${t.relationColor}; stroke: ${t.relationColor}; @@ -2294,16 +2294,16 @@ Expecting `+Mt.join(", ")+", got '"+(this.terminals_[ut]||ut)+"'":qr="Parse erro background-color: ${i??t.edgeLabelBackground}; } -`},"getStyles"),Ari=wri,orr={};yj(orr,{draw:()=>Sri});var Sri=O(async function(t,e,r,n){ye.info("REF0:"),ye.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:a,layout:o,look:s}=Ye(),l=n.db.getData(),u=m3(e,i);l.type=n.type,l.layoutAlgorithm=u$(o),l.nodeSpacing=(a==null?void 0:a.nodeSpacing)??50,l.rankSpacing=(a==null?void 0:a.rankSpacing)??50,l.markers=s==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],l.diagramId=e,await RR(l,u);const h=8;un.insertTitle(u,"requirementDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),nO(u,h,"requirementDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Tri={parser:yri,get db(){return new bri},renderer:orr,styles:Ari};const Cri=Object.freeze(Object.defineProperty({__proto__:null,diagram:Tri},Symbol.toStringTag,{value:"Module"}));var hLe=function(){var t=O(function(Ne,je,$e,Ze){for($e=$e||{},Ze=Ne.length;Ze--;$e[Ne[Ze]]=je);return $e},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],o=[1,11],s=[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],C=[1,36],k=[1,37],E=[1,38],_=[1,39],P=[1,40],L=[1,42],R=[1,43],D=[1,44],M=[1,45],I=[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],q=[1,85],Y=[1,86],ne=[1,87],X=[1,88],J=[1,89],ee=[1,90],te=[1,91],pe=[1,92],ie=[1,93],Ce=[1,94],ke=[1,95],Ee=[1,96],ue=[1,97],de=[1,98],xe=[1,99],ge=[1,100],ze=[1,101],we=[1,102],Oe=[1,103],Be=[1,104],Z=[1,105],le=[2,78],be=[4,5,17,51,53,54],ae=[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],K=[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],se=[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],me=[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],oe=[5,52],ve=[70,71,72,73],ce=[1,151],De={trace:O(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:O(function(je,$e,Ze,He,et,Pe,yt){var Ie=Pe.length-1;switch(et){case 3:return He.apply(Pe[Ie]),Pe[Ie];case 4:case 10:this.$=[];break;case 5:case 11:Pe[Ie-1].push(Pe[Ie]),this.$=Pe[Ie-1];break;case 6:case 7:case 12:case 13:this.$=Pe[Ie];break;case 8:case 9:case 14:this.$=[];break;case 16:Pe[Ie].type="createParticipant",this.$=Pe[Ie];break;case 17:Pe[Ie-1].unshift({type:"boxStart",boxData:He.parseBoxData(Pe[Ie-2])}),Pe[Ie-1].push({type:"boxEnd",boxText:Pe[Ie-2]}),this.$=Pe[Ie-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(Pe[Ie-2]),sequenceIndexStep:Number(Pe[Ie-1]),sequenceVisible:!0,signalType:He.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(Pe[Ie-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:He.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:He.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:He.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:He.LINETYPE.ACTIVE_START,actor:Pe[Ie-1].actor};break;case 24:this.$={type:"activeEnd",signalType:He.LINETYPE.ACTIVE_END,actor:Pe[Ie-1].actor};break;case 30:He.setDiagramTitle(Pe[Ie].substring(6)),this.$=Pe[Ie].substring(6);break;case 31:He.setDiagramTitle(Pe[Ie].substring(7)),this.$=Pe[Ie].substring(7);break;case 32:this.$=Pe[Ie].trim(),He.setAccTitle(this.$);break;case 33:case 34:this.$=Pe[Ie].trim(),He.setAccDescription(this.$);break;case 35:Pe[Ie-1].unshift({type:"loopStart",loopText:He.parseMessage(Pe[Ie-2]),signalType:He.LINETYPE.LOOP_START}),Pe[Ie-1].push({type:"loopEnd",loopText:Pe[Ie-2],signalType:He.LINETYPE.LOOP_END}),this.$=Pe[Ie-1];break;case 36:Pe[Ie-1].unshift({type:"rectStart",color:He.parseMessage(Pe[Ie-2]),signalType:He.LINETYPE.RECT_START}),Pe[Ie-1].push({type:"rectEnd",color:He.parseMessage(Pe[Ie-2]),signalType:He.LINETYPE.RECT_END}),this.$=Pe[Ie-1];break;case 37:Pe[Ie-1].unshift({type:"optStart",optText:He.parseMessage(Pe[Ie-2]),signalType:He.LINETYPE.OPT_START}),Pe[Ie-1].push({type:"optEnd",optText:He.parseMessage(Pe[Ie-2]),signalType:He.LINETYPE.OPT_END}),this.$=Pe[Ie-1];break;case 38:Pe[Ie-1].unshift({type:"altStart",altText:He.parseMessage(Pe[Ie-2]),signalType:He.LINETYPE.ALT_START}),Pe[Ie-1].push({type:"altEnd",signalType:He.LINETYPE.ALT_END}),this.$=Pe[Ie-1];break;case 39:Pe[Ie-1].unshift({type:"parStart",parText:He.parseMessage(Pe[Ie-2]),signalType:He.LINETYPE.PAR_START}),Pe[Ie-1].push({type:"parEnd",signalType:He.LINETYPE.PAR_END}),this.$=Pe[Ie-1];break;case 40:Pe[Ie-1].unshift({type:"parStart",parText:He.parseMessage(Pe[Ie-2]),signalType:He.LINETYPE.PAR_OVER_START}),Pe[Ie-1].push({type:"parEnd",signalType:He.LINETYPE.PAR_END}),this.$=Pe[Ie-1];break;case 41:Pe[Ie-1].unshift({type:"criticalStart",criticalText:He.parseMessage(Pe[Ie-2]),signalType:He.LINETYPE.CRITICAL_START}),Pe[Ie-1].push({type:"criticalEnd",signalType:He.LINETYPE.CRITICAL_END}),this.$=Pe[Ie-1];break;case 42:Pe[Ie-1].unshift({type:"breakStart",breakText:He.parseMessage(Pe[Ie-2]),signalType:He.LINETYPE.BREAK_START}),Pe[Ie-1].push({type:"breakEnd",optText:He.parseMessage(Pe[Ie-2]),signalType:He.LINETYPE.BREAK_END}),this.$=Pe[Ie-1];break;case 44:this.$=Pe[Ie-3].concat([{type:"option",optionText:He.parseMessage(Pe[Ie-1]),signalType:He.LINETYPE.CRITICAL_OPTION},Pe[Ie]]);break;case 46:this.$=Pe[Ie-3].concat([{type:"and",parText:He.parseMessage(Pe[Ie-1]),signalType:He.LINETYPE.PAR_AND},Pe[Ie]]);break;case 48:this.$=Pe[Ie-3].concat([{type:"else",altText:He.parseMessage(Pe[Ie-1]),signalType:He.LINETYPE.ALT_ELSE},Pe[Ie]]);break;case 49:Pe[Ie-3].draw="participant",Pe[Ie-3].type="addParticipant",Pe[Ie-3].description=He.parseMessage(Pe[Ie-1]),this.$=Pe[Ie-3];break;case 50:Pe[Ie-1].draw="participant",Pe[Ie-1].type="addParticipant",this.$=Pe[Ie-1];break;case 51:Pe[Ie-3].draw="actor",Pe[Ie-3].type="addParticipant",Pe[Ie-3].description=He.parseMessage(Pe[Ie-1]),this.$=Pe[Ie-3];break;case 52:case 57:Pe[Ie-1].draw="actor",Pe[Ie-1].type="addParticipant",this.$=Pe[Ie-1];break;case 53:Pe[Ie-1].type="destroyParticipant",this.$=Pe[Ie-1];break;case 54:Pe[Ie-3].draw="participant",Pe[Ie-3].type="addParticipant",Pe[Ie-3].description=He.parseMessage(Pe[Ie-1]),this.$=Pe[Ie-3];break;case 55:Pe[Ie-1].draw="participant",Pe[Ie-1].type="addParticipant",this.$=Pe[Ie-1];break;case 56:Pe[Ie-3].draw="actor",Pe[Ie-3].type="addParticipant",Pe[Ie-3].description=He.parseMessage(Pe[Ie-1]),this.$=Pe[Ie-3];break;case 58:this.$=[Pe[Ie-1],{type:"addNote",placement:Pe[Ie-2],actor:Pe[Ie-1].actor,text:Pe[Ie]}];break;case 59:Pe[Ie-2]=[].concat(Pe[Ie-1],Pe[Ie-1]).slice(0,2),Pe[Ie-2][0]=Pe[Ie-2][0].actor,Pe[Ie-2][1]=Pe[Ie-2][1].actor,this.$=[Pe[Ie-1],{type:"addNote",placement:He.PLACEMENT.OVER,actor:Pe[Ie-2].slice(0,2),text:Pe[Ie]}];break;case 60:this.$=[Pe[Ie-1],{type:"addLinks",actor:Pe[Ie-1].actor,text:Pe[Ie]}];break;case 61:this.$=[Pe[Ie-1],{type:"addALink",actor:Pe[Ie-1].actor,text:Pe[Ie]}];break;case 62:this.$=[Pe[Ie-1],{type:"addProperties",actor:Pe[Ie-1].actor,text:Pe[Ie]}];break;case 63:this.$=[Pe[Ie-1],{type:"addDetails",actor:Pe[Ie-1].actor,text:Pe[Ie]}];break;case 66:this.$=[Pe[Ie-2],Pe[Ie]];break;case 67:this.$=Pe[Ie];break;case 68:this.$=He.PLACEMENT.LEFTOF;break;case 69:this.$=He.PLACEMENT.RIGHTOF;break;case 70:this.$=[Pe[Ie-4],Pe[Ie-1],{type:"addMessage",from:Pe[Ie-4].actor,to:Pe[Ie-1].actor,signalType:Pe[Ie-3],msg:Pe[Ie],activate:!0},{type:"activeStart",signalType:He.LINETYPE.ACTIVE_START,actor:Pe[Ie-1].actor}];break;case 71:this.$=[Pe[Ie-4],Pe[Ie-1],{type:"addMessage",from:Pe[Ie-4].actor,to:Pe[Ie-1].actor,signalType:Pe[Ie-3],msg:Pe[Ie]},{type:"activeEnd",signalType:He.LINETYPE.ACTIVE_END,actor:Pe[Ie-4].actor}];break;case 72:this.$=[Pe[Ie-4],Pe[Ie-1],{type:"addMessage",from:Pe[Ie-4].actor,to:Pe[Ie-1].actor,signalType:Pe[Ie-3],msg:Pe[Ie],activate:!0,centralConnection:He.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:He.LINETYPE.CENTRAL_CONNECTION,actor:Pe[Ie-1].actor}];break;case 73:this.$=[Pe[Ie-4],Pe[Ie-1],{type:"addMessage",from:Pe[Ie-4].actor,to:Pe[Ie-1].actor,signalType:Pe[Ie-2],msg:Pe[Ie],activate:!1,centralConnection:He.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:He.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Pe[Ie-4].actor}];break;case 74:this.$=[Pe[Ie-5],Pe[Ie-1],{type:"addMessage",from:Pe[Ie-5].actor,to:Pe[Ie-1].actor,signalType:Pe[Ie-3],msg:Pe[Ie],activate:!0,centralConnection:He.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:He.LINETYPE.CENTRAL_CONNECTION,actor:Pe[Ie-1].actor},{type:"centralConnectionReverse",signalType:He.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Pe[Ie-5].actor}];break;case 75:this.$=[Pe[Ie-3],Pe[Ie-1],{type:"addMessage",from:Pe[Ie-3].actor,to:Pe[Ie-1].actor,signalType:Pe[Ie-2],msg:Pe[Ie]}];break;case 76:this.$={type:"addParticipant",actor:Pe[Ie-1],config:Pe[Ie]};break;case 77:this.$=Pe[Ie-1].trim();break;case 78:this.$={type:"addParticipant",actor:Pe[Ie]};break;case 79:this.$=He.LINETYPE.SOLID_OPEN;break;case 80:this.$=He.LINETYPE.DOTTED_OPEN;break;case 81:this.$=He.LINETYPE.SOLID;break;case 82:this.$=He.LINETYPE.SOLID_TOP;break;case 83:this.$=He.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=He.LINETYPE.STICK_TOP;break;case 85:this.$=He.LINETYPE.STICK_BOTTOM;break;case 86:this.$=He.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=He.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=He.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=He.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=He.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=He.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=He.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=He.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=He.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=He.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=He.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=He.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=He.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=He.LINETYPE.DOTTED;break;case 100:this.$=He.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=He.LINETYPE.SOLID_CROSS;break;case 102:this.$=He.LINETYPE.DOTTED_CROSS;break;case 103:this.$=He.LINETYPE.SOLID_POINT;break;case 104:this.$=He.LINETYPE.DOTTED_POINT;break;case 105:this.$=He.parseMessage(Pe[Ie].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:o,8:8,9:10,10:s,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:C,47:k,51:E,53:_,54:P,56:L,61:R,62:D,63:M,64:I,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:C,47:k,51:E,53:_,54:P,56:L,61:R,62:D,63:M,64:I,73:N},t(F,[2,7]),t(F,[2,8]),t(F,[2,9]),t(F,[2,15]),{13:49,51:E,53:_,54:P},{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:q,84:Y,85:ne,86:X,87:J,88:ee,89:te,90:pe,91:ie,92:Ce,93:ke,94:Ee,95:ue,96:de,97:xe,98:ge,99:ze,100:we,101:Oe,102:Be,103:Z},{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],le),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(ae,i,{7:120}),t(ae,i,{7:121}),t(ae,i,{7:122}),t(K,i,{41:123,7:124}),t(se,i,{43:125,7:126}),t(se,i,{7:126,43:127}),t(me,i,{46:128,7:129}),t(ae,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(oe,le,{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:q,84:Y,85:ne,86:X,87:J,88:ee,89:te,90:pe,91:ie,92:Ce,93:ke,94:Ee,95:ue,96:de,97:xe,98:ge,99:ze,100:we,101:Oe,102:Be,103:Z},t(ve,[2,79]),t(ve,[2,80]),t(ve,[2,81]),t(ve,[2,82]),t(ve,[2,83]),t(ve,[2,84]),t(ve,[2,85]),t(ve,[2,86]),t(ve,[2,87]),t(ve,[2,88]),t(ve,[2,89]),t(ve,[2,90]),t(ve,[2,91]),t(ve,[2,92]),t(ve,[2,93]),t(ve,[2,94]),t(ve,[2,95]),t(ve,[2,96]),t(ve,[2,97]),t(ve,[2,98]),t(ve,[2,99]),t(ve,[2,100]),t(ve,[2,101]),t(ve,[2,102]),t(ve,[2,103]),t(ve,[2,104]),{23:147,73:N},{23:149,60:148,73:N},{73:[2,68]},{73:[2,69]},{58:150,104:ce},{58:152,104:ce},{58:153,104:ce},{58:154,104:ce},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:E,53:_,54:P},{5:[1,160]},t(F,[2,20]),t(F,[2,21]),t(F,[2,23]),t(F,[2,24]),{4:a,5:o,8:8,9:10,10:s,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:C,47:k,51:E,53:_,54:P,56:L,61:R,62:D,63:M,64:I,73:N},{4:a,5:o,8:8,9:10,10:s,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:C,47:k,51:E,53:_,54:P,56:L,61:R,62:D,63:M,64:I,73:N},{4:a,5:o,8:8,9:10,10:s,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:C,47:k,51:E,53:_,54:P,56:L,61:R,62:D,63:M,64:I,73:N},{17:[1,164]},{4:a,5:o,8:8,9:10,10:s,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:C,47:k,50:[1,165],51:E,53:_,54:P,56:L,61:R,62:D,63:M,64:I,73:N},{17:[1,166]},{4:a,5:o,8:8,9:10,10:s,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:C,47:k,49:[1,167],51:E,53:_,54:P,56:L,61:R,62:D,63:M,64:I,73:N},{17:[1,168]},{17:[1,169]},{4:a,5:o,8:8,9:10,10:s,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:C,47:k,48:[1,170],51:E,53:_,54:P,56:L,61:R,62:D,63:M,64:I,73:N},{4:a,5:o,8:8,9:10,10:s,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:C,47:k,51:E,53:_,54:P,56:L,61:R,62:D,63:M,64:I,73:N},{16:[1,172]},t(F,[2,50]),{16:[1,173]},t(F,[2,55]),t(oe,[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:ce},{23:181,72:[1,182],73:N},{58:183,104:ce},{58:184,104:ce},{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:P},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:ce},{58:196,104:ce},{58:197,104:ce},{5:[2,75]},{58:198,104:ce},{23:199,73:N},{5:[2,58]},{5:[2,59]},{23:200,73:N},t(be,[2,12]),t(K,i,{7:124,41:201}),t(se,i,{7:126,43:202}),t(me,i,{7:129,46:203}),t(F,[2,49]),t(F,[2,54]),t(oe,[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:ce},{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:O(function(je,$e){if($e.recoverable)this.trace(je);else{var Ze=new Error(je);throw Ze.hash=$e,Ze}},"parseError"),parse:O(function(je){var $e=this,Ze=[0],He=[],et=[null],Pe=[],yt=this.table,Ie="",St=0,kt=0,ut=2,Gt=1,It=Pe.slice.call(arguments,1),gt=Object.create(this.lexer),Te={yy:{}};for(var Bt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Bt)&&(Te.yy[Bt]=this.yy[Bt]);gt.setInput(je,Te.yy),Te.yy.lexer=gt,Te.yy.parser=this,typeof gt.yylloc>"u"&&(gt.yylloc={});var Et=gt.yylloc;Pe.push(Et);var At=gt.options&>.options.ranges;typeof Te.yy.parseError=="function"?this.parseError=Te.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Mt($r){Ze.length=Ze.length-2*$r,et.length=et.length-$r,Pe.length=Pe.length-$r}O(Mt,"popStack");function qr(){var $r;return $r=He.pop()||gt.lex()||Gt,typeof $r!="number"&&($r instanceof Array&&(He=$r,$r=He.pop()),$r=$e.symbols_[$r]||$r),$r}O(qr,"lex");for(var Me,at,wt,Tt,dr={},jr,Ir,Zr,Ur;;){if(at=Ze[Ze.length-1],this.defaultActions[at]?wt=this.defaultActions[at]:((Me===null||typeof Me>"u")&&(Me=qr()),wt=yt[at]&&yt[at][Me]),typeof wt>"u"||!wt.length||!wt[0]){var kn="";Ur=[];for(jr in yt[at])this.terminals_[jr]&&jr>ut&&Ur.push("'"+this.terminals_[jr]+"'");gt.showPosition?kn="Parse error on line "+(St+1)+`: +`},"getStyles"),Tri=Sri,lrr={};yj(lrr,{draw:()=>Cri});var Cri=O(async function(t,e,r,n){ye.info("REF0:"),ye.info("Drawing requirement diagram (unified)",e);const{securityLevel:i,state:a,layout:o,look:s}=Ye(),l=n.db.getData(),u=m3(e,i);l.type=n.type,l.layoutAlgorithm=u$(o),l.nodeSpacing=(a==null?void 0:a.nodeSpacing)??50,l.rankSpacing=(a==null?void 0:a.rankSpacing)??50,l.markers=s==="neo"?["requirement_contains_neo","requirement_arrow_neo"]:["requirement_contains","requirement_arrow"],l.diagramId=e,await RR(l,u);const h=8;un.insertTitle(u,"requirementDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),nO(u,h,"requirementDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Ori={parser:xri,get db(){return new wri},renderer:lrr,styles:Tri};const kri=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ori},Symbol.toStringTag,{value:"Module"}));var hLe=function(){var t=O(function(Ne,je,$e,Ze){for($e=$e||{},Ze=Ne.length;Ze--;$e[Ne[Ze]]=je);return $e},"o"),e=[1,2],r=[1,3],n=[1,4],i=[2,4],a=[1,9],o=[1,11],s=[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],C=[1,36],k=[1,37],E=[1,38],_=[1,39],P=[1,40],L=[1,42],R=[1,43],D=[1,44],M=[1,45],I=[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],q=[1,85],Y=[1,86],ne=[1,87],X=[1,88],J=[1,89],ee=[1,90],te=[1,91],pe=[1,92],ie=[1,93],Ce=[1,94],ke=[1,95],Ee=[1,96],ue=[1,97],de=[1,98],xe=[1,99],ge=[1,100],ze=[1,101],we=[1,102],Oe=[1,103],Be=[1,104],Z=[1,105],le=[2,78],be=[4,5,17,51,53,54],ae=[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],K=[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],se=[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],me=[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],oe=[5,52],ve=[70,71,72,73],ce=[1,151],De={trace:O(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:O(function(je,$e,Ze,He,et,Pe,yt){var Ie=Pe.length-1;switch(et){case 3:return He.apply(Pe[Ie]),Pe[Ie];case 4:case 10:this.$=[];break;case 5:case 11:Pe[Ie-1].push(Pe[Ie]),this.$=Pe[Ie-1];break;case 6:case 7:case 12:case 13:this.$=Pe[Ie];break;case 8:case 9:case 14:this.$=[];break;case 16:Pe[Ie].type="createParticipant",this.$=Pe[Ie];break;case 17:Pe[Ie-1].unshift({type:"boxStart",boxData:He.parseBoxData(Pe[Ie-2])}),Pe[Ie-1].push({type:"boxEnd",boxText:Pe[Ie-2]}),this.$=Pe[Ie-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(Pe[Ie-2]),sequenceIndexStep:Number(Pe[Ie-1]),sequenceVisible:!0,signalType:He.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(Pe[Ie-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:He.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:He.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:He.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:He.LINETYPE.ACTIVE_START,actor:Pe[Ie-1].actor};break;case 24:this.$={type:"activeEnd",signalType:He.LINETYPE.ACTIVE_END,actor:Pe[Ie-1].actor};break;case 30:He.setDiagramTitle(Pe[Ie].substring(6)),this.$=Pe[Ie].substring(6);break;case 31:He.setDiagramTitle(Pe[Ie].substring(7)),this.$=Pe[Ie].substring(7);break;case 32:this.$=Pe[Ie].trim(),He.setAccTitle(this.$);break;case 33:case 34:this.$=Pe[Ie].trim(),He.setAccDescription(this.$);break;case 35:Pe[Ie-1].unshift({type:"loopStart",loopText:He.parseMessage(Pe[Ie-2]),signalType:He.LINETYPE.LOOP_START}),Pe[Ie-1].push({type:"loopEnd",loopText:Pe[Ie-2],signalType:He.LINETYPE.LOOP_END}),this.$=Pe[Ie-1];break;case 36:Pe[Ie-1].unshift({type:"rectStart",color:He.parseMessage(Pe[Ie-2]),signalType:He.LINETYPE.RECT_START}),Pe[Ie-1].push({type:"rectEnd",color:He.parseMessage(Pe[Ie-2]),signalType:He.LINETYPE.RECT_END}),this.$=Pe[Ie-1];break;case 37:Pe[Ie-1].unshift({type:"optStart",optText:He.parseMessage(Pe[Ie-2]),signalType:He.LINETYPE.OPT_START}),Pe[Ie-1].push({type:"optEnd",optText:He.parseMessage(Pe[Ie-2]),signalType:He.LINETYPE.OPT_END}),this.$=Pe[Ie-1];break;case 38:Pe[Ie-1].unshift({type:"altStart",altText:He.parseMessage(Pe[Ie-2]),signalType:He.LINETYPE.ALT_START}),Pe[Ie-1].push({type:"altEnd",signalType:He.LINETYPE.ALT_END}),this.$=Pe[Ie-1];break;case 39:Pe[Ie-1].unshift({type:"parStart",parText:He.parseMessage(Pe[Ie-2]),signalType:He.LINETYPE.PAR_START}),Pe[Ie-1].push({type:"parEnd",signalType:He.LINETYPE.PAR_END}),this.$=Pe[Ie-1];break;case 40:Pe[Ie-1].unshift({type:"parStart",parText:He.parseMessage(Pe[Ie-2]),signalType:He.LINETYPE.PAR_OVER_START}),Pe[Ie-1].push({type:"parEnd",signalType:He.LINETYPE.PAR_END}),this.$=Pe[Ie-1];break;case 41:Pe[Ie-1].unshift({type:"criticalStart",criticalText:He.parseMessage(Pe[Ie-2]),signalType:He.LINETYPE.CRITICAL_START}),Pe[Ie-1].push({type:"criticalEnd",signalType:He.LINETYPE.CRITICAL_END}),this.$=Pe[Ie-1];break;case 42:Pe[Ie-1].unshift({type:"breakStart",breakText:He.parseMessage(Pe[Ie-2]),signalType:He.LINETYPE.BREAK_START}),Pe[Ie-1].push({type:"breakEnd",optText:He.parseMessage(Pe[Ie-2]),signalType:He.LINETYPE.BREAK_END}),this.$=Pe[Ie-1];break;case 44:this.$=Pe[Ie-3].concat([{type:"option",optionText:He.parseMessage(Pe[Ie-1]),signalType:He.LINETYPE.CRITICAL_OPTION},Pe[Ie]]);break;case 46:this.$=Pe[Ie-3].concat([{type:"and",parText:He.parseMessage(Pe[Ie-1]),signalType:He.LINETYPE.PAR_AND},Pe[Ie]]);break;case 48:this.$=Pe[Ie-3].concat([{type:"else",altText:He.parseMessage(Pe[Ie-1]),signalType:He.LINETYPE.ALT_ELSE},Pe[Ie]]);break;case 49:Pe[Ie-3].draw="participant",Pe[Ie-3].type="addParticipant",Pe[Ie-3].description=He.parseMessage(Pe[Ie-1]),this.$=Pe[Ie-3];break;case 50:Pe[Ie-1].draw="participant",Pe[Ie-1].type="addParticipant",this.$=Pe[Ie-1];break;case 51:Pe[Ie-3].draw="actor",Pe[Ie-3].type="addParticipant",Pe[Ie-3].description=He.parseMessage(Pe[Ie-1]),this.$=Pe[Ie-3];break;case 52:case 57:Pe[Ie-1].draw="actor",Pe[Ie-1].type="addParticipant",this.$=Pe[Ie-1];break;case 53:Pe[Ie-1].type="destroyParticipant",this.$=Pe[Ie-1];break;case 54:Pe[Ie-3].draw="participant",Pe[Ie-3].type="addParticipant",Pe[Ie-3].description=He.parseMessage(Pe[Ie-1]),this.$=Pe[Ie-3];break;case 55:Pe[Ie-1].draw="participant",Pe[Ie-1].type="addParticipant",this.$=Pe[Ie-1];break;case 56:Pe[Ie-3].draw="actor",Pe[Ie-3].type="addParticipant",Pe[Ie-3].description=He.parseMessage(Pe[Ie-1]),this.$=Pe[Ie-3];break;case 58:this.$=[Pe[Ie-1],{type:"addNote",placement:Pe[Ie-2],actor:Pe[Ie-1].actor,text:Pe[Ie]}];break;case 59:Pe[Ie-2]=[].concat(Pe[Ie-1],Pe[Ie-1]).slice(0,2),Pe[Ie-2][0]=Pe[Ie-2][0].actor,Pe[Ie-2][1]=Pe[Ie-2][1].actor,this.$=[Pe[Ie-1],{type:"addNote",placement:He.PLACEMENT.OVER,actor:Pe[Ie-2].slice(0,2),text:Pe[Ie]}];break;case 60:this.$=[Pe[Ie-1],{type:"addLinks",actor:Pe[Ie-1].actor,text:Pe[Ie]}];break;case 61:this.$=[Pe[Ie-1],{type:"addALink",actor:Pe[Ie-1].actor,text:Pe[Ie]}];break;case 62:this.$=[Pe[Ie-1],{type:"addProperties",actor:Pe[Ie-1].actor,text:Pe[Ie]}];break;case 63:this.$=[Pe[Ie-1],{type:"addDetails",actor:Pe[Ie-1].actor,text:Pe[Ie]}];break;case 66:this.$=[Pe[Ie-2],Pe[Ie]];break;case 67:this.$=Pe[Ie];break;case 68:this.$=He.PLACEMENT.LEFTOF;break;case 69:this.$=He.PLACEMENT.RIGHTOF;break;case 70:this.$=[Pe[Ie-4],Pe[Ie-1],{type:"addMessage",from:Pe[Ie-4].actor,to:Pe[Ie-1].actor,signalType:Pe[Ie-3],msg:Pe[Ie],activate:!0},{type:"activeStart",signalType:He.LINETYPE.ACTIVE_START,actor:Pe[Ie-1].actor}];break;case 71:this.$=[Pe[Ie-4],Pe[Ie-1],{type:"addMessage",from:Pe[Ie-4].actor,to:Pe[Ie-1].actor,signalType:Pe[Ie-3],msg:Pe[Ie]},{type:"activeEnd",signalType:He.LINETYPE.ACTIVE_END,actor:Pe[Ie-4].actor}];break;case 72:this.$=[Pe[Ie-4],Pe[Ie-1],{type:"addMessage",from:Pe[Ie-4].actor,to:Pe[Ie-1].actor,signalType:Pe[Ie-3],msg:Pe[Ie],activate:!0,centralConnection:He.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:He.LINETYPE.CENTRAL_CONNECTION,actor:Pe[Ie-1].actor}];break;case 73:this.$=[Pe[Ie-4],Pe[Ie-1],{type:"addMessage",from:Pe[Ie-4].actor,to:Pe[Ie-1].actor,signalType:Pe[Ie-2],msg:Pe[Ie],activate:!1,centralConnection:He.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:He.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Pe[Ie-4].actor}];break;case 74:this.$=[Pe[Ie-5],Pe[Ie-1],{type:"addMessage",from:Pe[Ie-5].actor,to:Pe[Ie-1].actor,signalType:Pe[Ie-3],msg:Pe[Ie],activate:!0,centralConnection:He.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:He.LINETYPE.CENTRAL_CONNECTION,actor:Pe[Ie-1].actor},{type:"centralConnectionReverse",signalType:He.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:Pe[Ie-5].actor}];break;case 75:this.$=[Pe[Ie-3],Pe[Ie-1],{type:"addMessage",from:Pe[Ie-3].actor,to:Pe[Ie-1].actor,signalType:Pe[Ie-2],msg:Pe[Ie]}];break;case 76:this.$={type:"addParticipant",actor:Pe[Ie-1],config:Pe[Ie]};break;case 77:this.$=Pe[Ie-1].trim();break;case 78:this.$={type:"addParticipant",actor:Pe[Ie]};break;case 79:this.$=He.LINETYPE.SOLID_OPEN;break;case 80:this.$=He.LINETYPE.DOTTED_OPEN;break;case 81:this.$=He.LINETYPE.SOLID;break;case 82:this.$=He.LINETYPE.SOLID_TOP;break;case 83:this.$=He.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=He.LINETYPE.STICK_TOP;break;case 85:this.$=He.LINETYPE.STICK_BOTTOM;break;case 86:this.$=He.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=He.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=He.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=He.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=He.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=He.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=He.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=He.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=He.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=He.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=He.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=He.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=He.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=He.LINETYPE.DOTTED;break;case 100:this.$=He.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=He.LINETYPE.SOLID_CROSS;break;case 102:this.$=He.LINETYPE.DOTTED_CROSS;break;case 103:this.$=He.LINETYPE.SOLID_POINT;break;case 104:this.$=He.LINETYPE.DOTTED_POINT;break;case 105:this.$=He.parseMessage(Pe[Ie].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:o,8:8,9:10,10:s,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:C,47:k,51:E,53:_,54:P,56:L,61:R,62:D,63:M,64:I,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:C,47:k,51:E,53:_,54:P,56:L,61:R,62:D,63:M,64:I,73:N},t(F,[2,7]),t(F,[2,8]),t(F,[2,9]),t(F,[2,15]),{13:49,51:E,53:_,54:P},{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:q,84:Y,85:ne,86:X,87:J,88:ee,89:te,90:pe,91:ie,92:Ce,93:ke,94:Ee,95:ue,96:de,97:xe,98:ge,99:ze,100:we,101:Oe,102:Be,103:Z},{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],le),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(ae,i,{7:120}),t(ae,i,{7:121}),t(ae,i,{7:122}),t(K,i,{41:123,7:124}),t(se,i,{43:125,7:126}),t(se,i,{7:126,43:127}),t(me,i,{46:128,7:129}),t(ae,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(oe,le,{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:q,84:Y,85:ne,86:X,87:J,88:ee,89:te,90:pe,91:ie,92:Ce,93:ke,94:Ee,95:ue,96:de,97:xe,98:ge,99:ze,100:we,101:Oe,102:Be,103:Z},t(ve,[2,79]),t(ve,[2,80]),t(ve,[2,81]),t(ve,[2,82]),t(ve,[2,83]),t(ve,[2,84]),t(ve,[2,85]),t(ve,[2,86]),t(ve,[2,87]),t(ve,[2,88]),t(ve,[2,89]),t(ve,[2,90]),t(ve,[2,91]),t(ve,[2,92]),t(ve,[2,93]),t(ve,[2,94]),t(ve,[2,95]),t(ve,[2,96]),t(ve,[2,97]),t(ve,[2,98]),t(ve,[2,99]),t(ve,[2,100]),t(ve,[2,101]),t(ve,[2,102]),t(ve,[2,103]),t(ve,[2,104]),{23:147,73:N},{23:149,60:148,73:N},{73:[2,68]},{73:[2,69]},{58:150,104:ce},{58:152,104:ce},{58:153,104:ce},{58:154,104:ce},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:E,53:_,54:P},{5:[1,160]},t(F,[2,20]),t(F,[2,21]),t(F,[2,23]),t(F,[2,24]),{4:a,5:o,8:8,9:10,10:s,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:C,47:k,51:E,53:_,54:P,56:L,61:R,62:D,63:M,64:I,73:N},{4:a,5:o,8:8,9:10,10:s,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:C,47:k,51:E,53:_,54:P,56:L,61:R,62:D,63:M,64:I,73:N},{4:a,5:o,8:8,9:10,10:s,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:C,47:k,51:E,53:_,54:P,56:L,61:R,62:D,63:M,64:I,73:N},{17:[1,164]},{4:a,5:o,8:8,9:10,10:s,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:C,47:k,50:[1,165],51:E,53:_,54:P,56:L,61:R,62:D,63:M,64:I,73:N},{17:[1,166]},{4:a,5:o,8:8,9:10,10:s,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:C,47:k,49:[1,167],51:E,53:_,54:P,56:L,61:R,62:D,63:M,64:I,73:N},{17:[1,168]},{17:[1,169]},{4:a,5:o,8:8,9:10,10:s,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:C,47:k,48:[1,170],51:E,53:_,54:P,56:L,61:R,62:D,63:M,64:I,73:N},{4:a,5:o,8:8,9:10,10:s,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:C,47:k,51:E,53:_,54:P,56:L,61:R,62:D,63:M,64:I,73:N},{16:[1,172]},t(F,[2,50]),{16:[1,173]},t(F,[2,55]),t(oe,[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:ce},{23:181,72:[1,182],73:N},{58:183,104:ce},{58:184,104:ce},{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:P},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:ce},{58:196,104:ce},{58:197,104:ce},{5:[2,75]},{58:198,104:ce},{23:199,73:N},{5:[2,58]},{5:[2,59]},{23:200,73:N},t(be,[2,12]),t(K,i,{7:124,41:201}),t(se,i,{7:126,43:202}),t(me,i,{7:129,46:203}),t(F,[2,49]),t(F,[2,54]),t(oe,[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:ce},{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:O(function(je,$e){if($e.recoverable)this.trace(je);else{var Ze=new Error(je);throw Ze.hash=$e,Ze}},"parseError"),parse:O(function(je){var $e=this,Ze=[0],He=[],et=[null],Pe=[],yt=this.table,Ie="",St=0,kt=0,ut=2,Gt=1,It=Pe.slice.call(arguments,1),gt=Object.create(this.lexer),Te={yy:{}};for(var Bt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Bt)&&(Te.yy[Bt]=this.yy[Bt]);gt.setInput(je,Te.yy),Te.yy.lexer=gt,Te.yy.parser=this,typeof gt.yylloc>"u"&&(gt.yylloc={});var Et=gt.yylloc;Pe.push(Et);var At=gt.options&>.options.ranges;typeof Te.yy.parseError=="function"?this.parseError=Te.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Mt($r){Ze.length=Ze.length-2*$r,et.length=et.length-$r,Pe.length=Pe.length-$r}O(Mt,"popStack");function qr(){var $r;return $r=He.pop()||gt.lex()||Gt,typeof $r!="number"&&($r instanceof Array&&(He=$r,$r=He.pop()),$r=$e.symbols_[$r]||$r),$r}O(qr,"lex");for(var Me,at,wt,Tt,dr={},jr,Ir,Zr,Ur;;){if(at=Ze[Ze.length-1],this.defaultActions[at]?wt=this.defaultActions[at]:((Me===null||typeof Me>"u")&&(Me=qr()),wt=yt[at]&&yt[at][Me]),typeof wt>"u"||!wt.length||!wt[0]){var kn="";Ur=[];for(jr in yt[at])this.terminals_[jr]&&jr>ut&&Ur.push("'"+this.terminals_[jr]+"'");gt.showPosition?kn="Parse error on line "+(St+1)+`: `+gt.showPosition()+` Expecting `+Ur.join(", ")+", got '"+(this.terminals_[Me]||Me)+"'":kn="Parse error on line "+(St+1)+": Unexpected "+(Me==Gt?"end of input":"'"+(this.terminals_[Me]||Me)+"'"),this.parseError(kn,{text:gt.match,token:this.terminals_[Me]||Me,line:gt.yylineno,loc:Et,expected:Ur})}if(wt[0]instanceof Array&&wt.length>1)throw new Error("Parse Error: multiple actions possible at state: "+at+", token: "+Me);switch(wt[0]){case 1:Ze.push(Me),et.push(gt.yytext),Pe.push(gt.yylloc),Ze.push(wt[1]),Me=null,kt=gt.yyleng,Ie=gt.yytext,St=gt.yylineno,Et=gt.yylloc;break;case 2:if(Ir=this.productions_[wt[1]][1],dr.$=et[et.length-Ir],dr._$={first_line:Pe[Pe.length-(Ir||1)].first_line,last_line:Pe[Pe.length-1].last_line,first_column:Pe[Pe.length-(Ir||1)].first_column,last_column:Pe[Pe.length-1].last_column},At&&(dr._$.range=[Pe[Pe.length-(Ir||1)].range[0],Pe[Pe.length-1].range[1]]),Tt=this.performAction.apply(dr,[Ie,kt,St,Te.yy,wt[1],et,Pe].concat(It)),typeof Tt<"u")return Tt;Ir&&(Ze=Ze.slice(0,-1*Ir*2),et=et.slice(0,-1*Ir),Pe=Pe.slice(0,-1*Ir)),Ze.push(this.productions_[wt[1]][0]),et.push(dr.$),Pe.push(dr._$),Zr=yt[Ze[Ze.length-2]][Ze[Ze.length-1]],Ze.push(Zr);break;case 3:return!0}}return!0},"parse")},Le=function(){var Ne={EOF:1,parseError:O(function($e,Ze){if(this.yy.parser)this.yy.parser.parseError($e,Ze);else throw new Error($e)},"parseError"),setInput:O(function(je,$e){return this.yy=$e||this.yy||{},this._input=je,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:O(function(){var je=this._input[0];this.yytext+=je,this.yyleng++,this.offset++,this.match+=je,this.matched+=je;var $e=je.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),je},"input"),unput:O(function(je){var $e=je.length,Ze=je.split(/(?:\r\n?|\n)/g);this._input=je+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-$e),this.offset-=$e;var He=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 et=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===He.length?this.yylloc.first_column:0)+He[He.length-Ze.length].length-Ze[0].length:this.yylloc.first_column-$e},this.options.ranges&&(this.yylloc.range=[et[0],et[0]+this.yyleng-$e]),this.yyleng=this.yytext.length,this},"unput"),more:O(function(){return this._more=!0,this},"more"),reject:O(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:O(function(je){this.unput(this.match.slice(je))},"less"),pastInput:O(function(){var je=this.matched.substr(0,this.matched.length-this.match.length);return(je.length>20?"...":"")+je.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:O(function(){var je=this.match;return je.length<20&&(je+=this._input.substr(0,20-je.length)),(je.substr(0,20)+(je.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:O(function(){var je=this.pastInput(),$e=new Array(je.length+1).join("-");return je+this.upcomingInput()+` `+$e+"^"},"showPosition"),test_match:O(function(je,$e){var Ze,He,et;if(this.options.backtrack_lexer&&(et={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&&(et.yylloc.range=this.yylloc.range.slice(0))),He=je[0].match(/(?:\r\n?|\n).*/g),He&&(this.yylineno+=He.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:He?He[He.length-1].length-He[He.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+je[0].length},this.yytext+=je[0],this.match+=je[0],this.matches=je,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(je[0].length),this.matched+=je[0],Ze=this.performAction.call(this,this.yy,this,$e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),Ze)return Ze;if(this._backtrack){for(var Pe in et)this[Pe]=et[Pe];return!1}return!1},"test_match"),next:O(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var je,$e,Ze,He;this._more||(this.yytext="",this.match="");for(var et=this._currentRules(),Pe=0;Pe$e[0].length)){if($e=Ze,He=Pe,this.options.backtrack_lexer){if(je=this.test_match(Ze,et[Pe]),je!==!1)return je;if(this._backtrack){$e=!1;continue}else return!1}else if(!this.options.flex)break}return $e?(je=this.test_match($e,et[He]),je!==!1?je:!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:O(function(){var $e=this.next();return $e||this.lex()},"lex"),begin:O(function($e){this.conditionStack.push($e)},"begin"),popState:O(function(){var $e=this.conditionStack.length-1;return $e>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function($e){return $e=this.conditionStack.length-1-Math.abs($e||0),$e>=0?this.conditionStack[$e]:"INITIAL"},"topState"),pushState:O(function($e){this.begin($e)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(function($e,Ze,He,et){switch(He){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:return Ze.yytext=Ze.yytext.trim(),73;case 12:return Ze.yytext=Ze.yytext.trim(),this.begin("ALIAS"),73;case 13:return Ze.yytext=Ze.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return Ze.yytext=Ze.yytext.trim(),this.popState(),10;case 16:return this.begin("LINE"),15;case 17:return this.begin("ID"),51;case 18:return this.begin("ID"),53;case 19:return 14;case 20:return this.begin("ID"),54;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin("LINE"),37;case 24:return this.begin("LINE"),38;case 25:return this.begin("LINE"),39;case 26:return this.begin("LINE"),40;case 27:return this.begin("LINE"),50;case 28:return this.begin("LINE"),42;case 29:return this.begin("LINE"),44;case 30:return this.begin("LINE"),49;case 31:return this.begin("LINE"),45;case 32:return this.begin("LINE"),48;case 33:return this.begin("LINE"),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;case 45:return this.begin("ID"),24;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;case 49:return this.popState(),"acc_title_value";case 50:return this.begin("acc_descr"),34;case 51:return this.popState(),"acc_descr_value";case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return Ze.yytext=Ze.yytext.trim(),73;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/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,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}};return Ne}();De.lexer=Le;function We(){this.yy={}}return O(We,"Parser"),We.prototype=De,De.Parser=We,new We}();hLe.parser=hLe;var Ori=hLe,kri={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,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},Eri={FILLED:0,OPEN:1},_ri={LEFTOF:0,RIGHTOF:1,OVER:2},Tie={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},Rri=(dP=class{constructor(){this.state=new c_e(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=Ba,this.setAccDescription=so,this.setDiagramTitle=co,this.getAccTitle=oo,this.getAccDescription=lo,this.getDiagramTitle=$a,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(Ye().wrap),this.LINETYPE=kri,this.ARROWTYPE=Eri,this.PLACEMENT=_ri}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,r,n,i,a){let o=this.state.records.currentBox,s;if(a!==void 0){let u;a.includes(` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:O(function(){var $e=this.next();return $e||this.lex()},"lex"),begin:O(function($e){this.conditionStack.push($e)},"begin"),popState:O(function(){var $e=this.conditionStack.length-1;return $e>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function($e){return $e=this.conditionStack.length-1-Math.abs($e||0),$e>=0?this.conditionStack[$e]:"INITIAL"},"topState"),pushState:O(function($e){this.begin($e)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(function($e,Ze,He,et){switch(He){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:return Ze.yytext=Ze.yytext.trim(),73;case 12:return Ze.yytext=Ze.yytext.trim(),this.begin("ALIAS"),73;case 13:return Ze.yytext=Ze.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return Ze.yytext=Ze.yytext.trim(),this.popState(),10;case 16:return this.begin("LINE"),15;case 17:return this.begin("ID"),51;case 18:return this.begin("ID"),53;case 19:return 14;case 20:return this.begin("ID"),54;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin("LINE"),37;case 24:return this.begin("LINE"),38;case 25:return this.begin("LINE"),39;case 26:return this.begin("LINE"),40;case 27:return this.begin("LINE"),50;case 28:return this.begin("LINE"),42;case 29:return this.begin("LINE"),44;case 30:return this.begin("LINE"),49;case 31:return this.begin("LINE"),45;case 32:return this.begin("LINE"),48;case 33:return this.begin("LINE"),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;case 45:return this.begin("ID"),24;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;case 49:return this.popState(),"acc_title_value";case 50:return this.begin("acc_descr"),34;case 51:return this.popState(),"acc_descr_value";case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return Ze.yytext=Ze.yytext.trim(),73;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/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,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}};return Ne}();De.lexer=Le;function We(){this.yy={}}return O(We,"Parser"),We.prototype=De,De.Parser=We,new We}();hLe.parser=hLe;var Eri=hLe,_ri={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,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},Rri={FILLED:0,OPEN:1},Dri={LEFTOF:0,RIGHTOF:1,OVER:2},Tie={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},Lri=(dP=class{constructor(){this.state=new c_e(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=Ba,this.setAccDescription=so,this.setDiagramTitle=co,this.getAccTitle=oo,this.getAccDescription=lo,this.getDiagramTitle=$a,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(Ye().wrap),this.LINETYPE=_ri,this.ARROWTYPE=Rri,this.PLACEMENT=Dri}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,r,n,i,a){let o=this.state.records.currentBox,s;if(a!==void 0){let u;a.includes(` `)?u=a+` `:u=`{ `+a+` -}`,s=OX(u,{schema:CX})}i=(s==null?void 0:s.type)??i,s!=null&&s.alias&&(!n||n.text===r)&&(n={text:s.alias,wrap:n==null?void 0:n.wrap,type:i});const l=this.state.records.actors.get(e);if(l){if(this.state.records.currentBox&&l.box&&this.state.records.currentBox!==l.box)throw new Error(`A same participant should only be defined in one Box: ${l.name} can't be in '${l.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(o=l.box?l.box:this.state.records.currentBox,l.box=o,l&&r===l.name&&n==null)return}if((n==null?void 0:n.text)==null&&(n={text:r,type:i}),(i==null||n.text==null)&&(n={text:r,type:i}),this.state.records.actors.set(e,{box:o,name:r,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:i??"participant"}),this.state.records.prevActor){const u=this.state.records.actors.get(this.state.records.prevActor);u&&(u.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let r,n=0;if(!e)return 0;for(r=0;r>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},l}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:r,message:(n==null?void 0:n.text)??"",wrap:(n==null?void 0:n.wrap)??this.autoWrap(),type:i,activate:a,centralConnection:o??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();const r=/^:?wrap:/.exec(e)!==null?!0:/^:?nowrap:/.exec(e)!==null?!1:void 0;return{cleanedText:(r===void 0?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:r}}autoWrap(){var e;return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:((e=Ye().sequence)==null?void 0:e.wrap)??!1}clear(){this.state.reset(),_a()}parseMessage(e){const r=e.trim(),{wrap:n,cleanedText:i}=this.extractWrap(r),a={text:i,wrap:n};return ye.debug(`parseMessage: ${JSON.stringify(a)}`),a}parseBoxData(e){const r=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);let n=r!=null&&r[1]?r[1].trim():"transparent",i=r!=null&&r[2]?r[2].trim():void 0;if(window!=null&&window.CSS)window.CSS.supports("color",n)||(n="transparent",i=e.trim());else{const s=new Option().style;s.color=n,s.color!==n&&(n="transparent",i=e.trim())}const{wrap:a,cleanedText:o}=this.extractWrap(i);return{text:o?li(o,Ye()):void 0,color:n,wrap:a}}addNote(e,r,n){const i={actor:e,placement:r,message:n.text,wrap:n.wrap??this.autoWrap()},a=[].concat(e,e);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:a[0],to:a[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:r})}addLinks(e,r){const n=this.getActor(e);try{let i=li(r.text,Ye());i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const a=JSON.parse(i);this.insertLinks(n,a)}catch(i){ye.error("error while parsing actor link text",i)}}addALink(e,r){const n=this.getActor(e);try{const i={};let a=li(r.text,Ye());const o=a.indexOf("@");a=a.replace(/=/g,"="),a=a.replace(/&/g,"&");const s=a.slice(0,o-1).trim(),l=a.slice(o+1).trim();i[s]=l,this.insertLinks(n,i)}catch(i){ye.error("error while parsing actor link text",i)}}insertLinks(e,r){if(e.links==null)e.links=r;else for(const n in r)e.links[n]=r[n]}addProperties(e,r){const n=this.getActor(e);try{const i=li(r.text,Ye()),a=JSON.parse(i);this.insertProperties(n,a)}catch(i){ye.error("error while parsing actor properties text",i)}}insertProperties(e,r){if(e.properties==null)e.properties=r;else for(const n in r)e.properties[n]=r[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,r){const n=this.getActor(e),i=document.getElementById(r.text);try{const a=i.innerHTML,o=JSON.parse(a);o.properties&&this.insertProperties(n,o.properties),o.links&&this.insertLinks(n,o.links)}catch(a){ye.error("error while parsing actor details text",a)}}getActorProperty(e,r){if((e==null?void 0:e.properties)!==void 0)return e.properties[r]}apply(e){if(Array.isArray(e))e.forEach(r=>{this.apply(r)});else switch(e.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case"addParticipant":this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case"createParticipant":if(this.state.records.actors.has(e.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnection":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnectionReverse":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"activeEnd":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"addNote":this.addNote(e.actor,e.placement,e.text);break;case"addLinks":this.addLinks(e.actor,e.text);break;case"addALink":this.addALink(e.actor,e.text);break;case"addProperties":this.addProperties(e.actor,e.text);break;case"addDetails":this.addDetails(e.actor,e.text);break;case"addMessage":if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case"boxStart":this.addBox(e.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"rectStart":this.addSignal(void 0,void 0,e.color,e.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"setAccTitle":Ba(e.text);break;case"parStart":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case"option":this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break}}getConfig(){return Ye().sequence}},O(dP,"SequenceDB"),dP),Dri=O(t=>{const e=t.dropShadow??"none",{look:r}=Ye();return`.actor { +}`,s=OX(u,{schema:CX})}i=(s==null?void 0:s.type)??i,s!=null&&s.alias&&(!n||n.text===r)&&(n={text:s.alias,wrap:n==null?void 0:n.wrap,type:i});const l=this.state.records.actors.get(e);if(l){if(this.state.records.currentBox&&l.box&&this.state.records.currentBox!==l.box)throw new Error(`A same participant should only be defined in one Box: ${l.name} can't be in '${l.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(o=l.box?l.box:this.state.records.currentBox,l.box=o,l&&r===l.name&&n==null)return}if((n==null?void 0:n.text)==null&&(n={text:r,type:i}),(i==null||n.text==null)&&(n={text:r,type:i}),this.state.records.actors.set(e,{box:o,name:r,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:i??"participant"}),this.state.records.prevActor){const u=this.state.records.actors.get(this.state.records.prevActor);u&&(u.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let r,n=0;if(!e)return 0;for(r=0;r>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},l}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:r,message:(n==null?void 0:n.text)??"",wrap:(n==null?void 0:n.wrap)??this.autoWrap(),type:i,activate:a,centralConnection:o??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();const r=/^:?wrap:/.exec(e)!==null?!0:/^:?nowrap:/.exec(e)!==null?!1:void 0;return{cleanedText:(r===void 0?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:r}}autoWrap(){var e;return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:((e=Ye().sequence)==null?void 0:e.wrap)??!1}clear(){this.state.reset(),_a()}parseMessage(e){const r=e.trim(),{wrap:n,cleanedText:i}=this.extractWrap(r),a={text:i,wrap:n};return ye.debug(`parseMessage: ${JSON.stringify(a)}`),a}parseBoxData(e){const r=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);let n=r!=null&&r[1]?r[1].trim():"transparent",i=r!=null&&r[2]?r[2].trim():void 0;if(window!=null&&window.CSS)window.CSS.supports("color",n)||(n="transparent",i=e.trim());else{const s=new Option().style;s.color=n,s.color!==n&&(n="transparent",i=e.trim())}const{wrap:a,cleanedText:o}=this.extractWrap(i);return{text:o?li(o,Ye()):void 0,color:n,wrap:a}}addNote(e,r,n){const i={actor:e,placement:r,message:n.text,wrap:n.wrap??this.autoWrap()},a=[].concat(e,e);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:a[0],to:a[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:r})}addLinks(e,r){const n=this.getActor(e);try{let i=li(r.text,Ye());i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const a=JSON.parse(i);this.insertLinks(n,a)}catch(i){ye.error("error while parsing actor link text",i)}}addALink(e,r){const n=this.getActor(e);try{const i={};let a=li(r.text,Ye());const o=a.indexOf("@");a=a.replace(/=/g,"="),a=a.replace(/&/g,"&");const s=a.slice(0,o-1).trim(),l=a.slice(o+1).trim();i[s]=l,this.insertLinks(n,i)}catch(i){ye.error("error while parsing actor link text",i)}}insertLinks(e,r){if(e.links==null)e.links=r;else for(const n in r)e.links[n]=r[n]}addProperties(e,r){const n=this.getActor(e);try{const i=li(r.text,Ye()),a=JSON.parse(i);this.insertProperties(n,a)}catch(i){ye.error("error while parsing actor properties text",i)}}insertProperties(e,r){if(e.properties==null)e.properties=r;else for(const n in r)e.properties[n]=r[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,r){const n=this.getActor(e),i=document.getElementById(r.text);try{const a=i.innerHTML,o=JSON.parse(a);o.properties&&this.insertProperties(n,o.properties),o.links&&this.insertLinks(n,o.links)}catch(a){ye.error("error while parsing actor details text",a)}}getActorProperty(e,r){if((e==null?void 0:e.properties)!==void 0)return e.properties[r]}apply(e){if(Array.isArray(e))e.forEach(r=>{this.apply(r)});else switch(e.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case"addParticipant":this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case"createParticipant":if(this.state.records.actors.has(e.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnection":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"centralConnectionReverse":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"activeEnd":this.addSignal(e.actor,void 0,void 0,e.signalType);break;case"addNote":this.addNote(e.actor,e.placement,e.text);break;case"addLinks":this.addLinks(e.actor,e.text);break;case"addALink":this.addALink(e.actor,e.text);break;case"addProperties":this.addProperties(e.actor,e.text);break;case"addDetails":this.addDetails(e.actor,e.text);break;case"addMessage":if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case"boxStart":this.addBox(e.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"rectStart":this.addSignal(void 0,void 0,e.color,e.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":this.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"else":this.addSignal(void 0,void 0,e.altText,e.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"setAccTitle":Ba(e.text);break;case"parStart":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"and":this.addSignal(void 0,void 0,e.parText,e.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case"option":this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break;case"breakStart":this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,e.signalType);break}}getConfig(){return Ye().sequence}},O(dP,"SequenceDB"),dP),Mri=O(t=>{const e=t.dropShadow??"none",{look:r}=Ye();return`.actor { stroke: ${t.actorBorder}; fill: ${t.actorBkg}; stroke-width: ${t.strokeWidth??1}; @@ -2442,25 +2442,25 @@ Expecting `+Ur.join(", ")+", got '"+(this.terminals_[Me]||Me)+"'":kn="Parse erro filter: ${e}; stroke: ${t.nodeBorder}; } -`},"getStyles"),Lri=Dri,hk=18*2,$w="actor-top",Fw="actor-bottom",Cie="actor-box",dk="actor-man",wb=new Set(["redux-color","redux-dark-color"]),iU=O(function(t,e){const r=bte(t,e);return Dr().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),Mri=O(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,o=e.actorCnt,s=e.rectData;var l="none";i&&(l="block !important");const u=t.append("g");u.attr("id","actor"+o+"_popup"),u.attr("class","actorPopupMenu"),u.attr("display",l);var h="";s.class!==void 0&&(h=" "+s.class);let d=s.width>r?s.width:r;const f=u.append("rect");if(f.attr("class","actorPopupMenuPanel"+h),f.attr("x",s.x),f.attr("y",s.height),f.attr("fill",s.fill),f.attr("stroke",s.stroke),f.attr("width",d),f.attr("height",s.height),f.attr("rx",s.rx),f.attr("ry",s.ry),a!=null){var p=20;for(let v in a){var g=u.append("a"),m=ZT(a[v]);g.attr("xlink:href",m),g.attr("target","_blank"),rni(n)(v,g,s.x+10,s.height+p,d,20,{class:"actor"},n),p+=30}}return f.attr("height",p),{height:s.height+p,width:d}},"drawPopup"),Oie=O(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),kie=O(async function(t,e,r=null){let n=t.append("foreignObject");const i=await Oj(e.text,Dr()),o=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(o.height)).attr("width",Math.round(o.width)),e.class==="noteText"){const s=t.node().firstChild;s.setAttribute("height",o.height+2*e.textMargin);const l=s.getBBox();n.attr("x",Math.round(l.x+l.width/2-o.width/2)).attr("y",Math.round(l.y+l.height/2-o.height/2))}else if(r){let{startx:s,stopx:l,starty:u}=r;if(s>l){const h=s;s=l,l=h}n.attr("x",Math.round(s+Math.abs(s-l)/2-o.width/2)),e.class==="loopText"?n.attr("y",Math.round(u)):n.attr("y",Math.round(u-o.height))}return[n]},"drawKatex"),TD=O(function(t,e){let r=0,n=0;const i=e.text.split(Xt.lineBreakRegex),[a,o]=a1(e.fontSize);let s=[],l=0,u=O(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":u=O(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":u=O(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":u=O(()=>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),o!==void 0&&f.style("font-size",o),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||KTt;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),s.push(f)}return s},"drawText"),srr=O(function(t,e){function r(i,a,o,s,l){return i+","+a+" "+(i+o)+","+a+" "+(i+o)+","+(a+s-l)+" "+(i+o-l*1.2)+","+(a+s)+" "+i+","+(a+s)}O(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,TD(t,e),n},"drawLabel"),Si=-1,lrr=O((t,e,r,n)=>{t.select&&r.forEach(i=>{const a=e.get(i),o=t.select("#actor"+a.actorCnt);!n.mirrorActors&&a.stopy?o.attr("y2",a.stopy+a.height/2):n.mirrorActors&&o.attr("y2",a.stopy)})},"fixLifeLineHeights"),Iri=O(function(t,e,r,n,i){var w,A;const a=n?e.stopy:e.starty,o=e.x+e.width/2,s=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Si++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",Oie(`actor${Si}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Si).attr("x1",o).attr("y1",s).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),g=p.append("g"),e.actorCnt=Si,e.links!=null&&g.attr("id","root-"+Si),l==="neo"&&g.attr("data-look","neo"));const m=gf();var v="actor";(w=e.properties)!=null&&w.class?v=e.properties.class:m.fill="#eaeaea",n?v+=` ${Fw}`:v+=` ${$w}`,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=iU(g,m),b=i.get(e.name)??0;if(wb.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)==="@"?jEe(g,m.x+m.width-20,m.y+10,S.substr(1)):qEe(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)),Ab(r,ps(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${Cie}`},r);let x=e.height;if(y.node){const S=y.node().getBBox();e.height=S.height,x=S.height}return x},"drawActorTypeParticipant"),Pri=O(function(t,e,r,n,i){var T,C;const a=n?e.stopy:e.starty,o=e.x+e.width/2,s=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Si++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",Oie(`actor${Si}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Si).attr("x1",o).attr("y1",s).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),g=p.append("g"),e.actorCnt=Si,e.links!=null&&g.attr("id","root-"+Si),l==="neo"&&g.attr("data-look","neo"));const m=gf();var v="actor";(T=e.properties)!=null&&T.class?v=e.properties.class:m.fill="#eaeaea",n?v+=` ${Fw}`:v+=` ${$w}`,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=iU(g,m),w=iU(g,b);e.rectData=m,l==="neo"&&g.attr("filter","url(#drop-shadow)");const A=i.get(e.name)??0;if(wb.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])),(C=e.properties)!=null&&C.icon){const k=e.properties.icon.trim();k.charAt(0)==="@"?jEe(g,m.x+m.width-20,m.y+10,k.substr(1)):qEe(g,m.x+m.width-20,m.y+10,k)}Ab(r,ps(e.description))(e.description,g,m.x-y,m.y+y,m.width,m.height,{class:`actor ${Cie}`},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"),Nri=O(function(t,e,r,n,i){var k,E;const a=n?e.stopy:e.starty,o=e.x+e.width/2,s=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();let g=p;n||(Si++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",Oie(`actor${Si}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Si).attr("x1",o).attr("y1",s).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),g=p.append("g"),e.actorCnt=Si,e.links!=null&&g.attr("id","root-"+Si),l==="neo"&&g.attr("data-look","neo"));const m=gf();let v="actor";(k=e.properties)!=null&&k.class?v=e.properties.class:m.fill="#eaeaea",n?v+=` ${Fw}`:v+=` ${$w}`,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"),Iri=Mri,hk=18*2,$w="actor-top",Fw="actor-bottom",Cie="actor-box",dk="actor-man",wb=new Set(["redux-color","redux-dark-color"]),iU=O(function(t,e){const r=bte(t,e);return Dr().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),Pri=O(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,o=e.actorCnt,s=e.rectData;var l="none";i&&(l="block !important");const u=t.append("g");u.attr("id","actor"+o+"_popup"),u.attr("class","actorPopupMenu"),u.attr("display",l);var h="";s.class!==void 0&&(h=" "+s.class);let d=s.width>r?s.width:r;const f=u.append("rect");if(f.attr("class","actorPopupMenuPanel"+h),f.attr("x",s.x),f.attr("y",s.height),f.attr("fill",s.fill),f.attr("stroke",s.stroke),f.attr("width",d),f.attr("height",s.height),f.attr("rx",s.rx),f.attr("ry",s.ry),a!=null){var p=20;for(let v in a){var g=u.append("a"),m=ZT(a[v]);g.attr("xlink:href",m),g.attr("target","_blank"),ini(n)(v,g,s.x+10,s.height+p,d,20,{class:"actor"},n),p+=30}}return f.attr("height",p),{height:s.height+p,width:d}},"drawPopup"),Oie=O(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),kie=O(async function(t,e,r=null){let n=t.append("foreignObject");const i=await Oj(e.text,Dr()),o=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(o.height)).attr("width",Math.round(o.width)),e.class==="noteText"){const s=t.node().firstChild;s.setAttribute("height",o.height+2*e.textMargin);const l=s.getBBox();n.attr("x",Math.round(l.x+l.width/2-o.width/2)).attr("y",Math.round(l.y+l.height/2-o.height/2))}else if(r){let{startx:s,stopx:l,starty:u}=r;if(s>l){const h=s;s=l,l=h}n.attr("x",Math.round(s+Math.abs(s-l)/2-o.width/2)),e.class==="loopText"?n.attr("y",Math.round(u)):n.attr("y",Math.round(u-o.height))}return[n]},"drawKatex"),TD=O(function(t,e){let r=0,n=0;const i=e.text.split(Xt.lineBreakRegex),[a,o]=a1(e.fontSize);let s=[],l=0,u=O(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":u=O(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":u=O(()=>Math.round(e.y+(r+n+e.textMargin)/2),"yfunc");break;case"bottom":case"end":u=O(()=>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),o!==void 0&&f.style("font-size",o),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||JTt;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),s.push(f)}return s},"drawText"),crr=O(function(t,e){function r(i,a,o,s,l){return i+","+a+" "+(i+o)+","+a+" "+(i+o)+","+(a+s-l)+" "+(i+o-l*1.2)+","+(a+s)+" "+i+","+(a+s)}O(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,TD(t,e),n},"drawLabel"),Si=-1,urr=O((t,e,r,n)=>{t.select&&r.forEach(i=>{const a=e.get(i),o=t.select("#actor"+a.actorCnt);!n.mirrorActors&&a.stopy?o.attr("y2",a.stopy+a.height/2):n.mirrorActors&&o.attr("y2",a.stopy)})},"fixLifeLineHeights"),Nri=O(function(t,e,r,n,i){var w,A;const a=n?e.stopy:e.starty,o=e.x+e.width/2,s=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Si++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",Oie(`actor${Si}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Si).attr("x1",o).attr("y1",s).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),g=p.append("g"),e.actorCnt=Si,e.links!=null&&g.attr("id","root-"+Si),l==="neo"&&g.attr("data-look","neo"));const m=gf();var v="actor";(w=e.properties)!=null&&w.class?v=e.properties.class:m.fill="#eaeaea",n?v+=` ${Fw}`:v+=` ${$w}`,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=iU(g,m),b=i.get(e.name)??0;if(wb.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)==="@"?jEe(g,m.x+m.width-20,m.y+10,S.substr(1)):qEe(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)),Ab(r,ps(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${Cie}`},r);let x=e.height;if(y.node){const S=y.node().getBBox();e.height=S.height,x=S.height}return x},"drawActorTypeParticipant"),Bri=O(function(t,e,r,n,i){var T,C;const a=n?e.stopy:e.starty,o=e.x+e.width/2,s=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();var g=p;n||(Si++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",Oie(`actor${Si}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Si).attr("x1",o).attr("y1",s).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),g=p.append("g"),e.actorCnt=Si,e.links!=null&&g.attr("id","root-"+Si),l==="neo"&&g.attr("data-look","neo"));const m=gf();var v="actor";(T=e.properties)!=null&&T.class?v=e.properties.class:m.fill="#eaeaea",n?v+=` ${Fw}`:v+=` ${$w}`,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=iU(g,m),w=iU(g,b);e.rectData=m,l==="neo"&&g.attr("filter","url(#drop-shadow)");const A=i.get(e.name)??0;if(wb.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])),(C=e.properties)!=null&&C.icon){const k=e.properties.icon.trim();k.charAt(0)==="@"?jEe(g,m.x+m.width-20,m.y+10,k.substr(1)):qEe(g,m.x+m.width-20,m.y+10,k)}Ab(r,ps(e.description))(e.description,g,m.x-y,m.y+y,m.width,m.height,{class:`actor ${Cie}`},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"),$ri=O(function(t,e,r,n,i){var k,E;const a=n?e.stopy:e.starty,o=e.x+e.width/2,s=a+e.height,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f}=h,p=t.append("g").lower();let g=p;n||(Si++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",Oie(`actor${Si}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Si).attr("x1",o).attr("y1",s).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),g=p.append("g"),e.actorCnt=Si,e.links!=null&&g.attr("id","root-"+Si),l==="neo"&&g.attr("data-look","neo"));const m=gf();let v="actor";(k=e.properties)!=null&&k.class?v=e.properties.class:m.fill="#eaeaea",n?v+=` ${Fw}`:v+=` ${$w}`,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 S=i.get(e.name)??0;if(wb.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(),P=m.x+m.width-20,L=m.y+10;_.charAt(0)==="@"?jEe(g,P,L,_.substr(1)):qEe(g,P,L,_)}Ab(r,ps(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${Cie}`},r);let T=e.height;const C=x.select("path:last-child");if(C.node()){const _=C.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"),Bri=O(function(t,e,r,n,i,a){var k;const o=n?e.stopy:e.starty,s=e.x+e.width/2,l=o+75,{look:u,theme:h,themeVariables:d}=r,{bkgColorArray:f,borderColorArray:p,actorBorder:g,actorBkg:m}=d,v=t.append("g").lower();n||(Si++,v.append("line").attr("id","actor"+Si).attr("x1",s).attr("y1",l).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=Si);const y=t.append("g");let b=dk;n?b+=` ${Fw}`:b+=` ${$w}`,y.attr("class",b),y.attr("name",e.name);const x=gf();x.x=e.x,x.y=o,x.fill="#eaeaea",x.width=e.width,x.height=e.height,x.class="actor";const w=e.x+e.width/2,A=o+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;wb.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 C=y.node().getBBox();return e.height=C.height+2*(((k=r==null?void 0:r.sequence)==null?void 0:k.labelBoxHeight)??0),Ab(r,ps(e.description))(e.description,y,x.x,x.y+S+(n?5:12),x.width,x.height,{class:`actor ${dk}`},r),n||(y.attr("data-et","participant"),y.attr("data-type","control"),y.attr("data-id",e.name)),e.height},"drawActorTypeControl"),$ri=O(function(t,e,r,n,i){var S;const a=n?e.stopy:e.starty,o=e.x+e.width/2,s=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+=` ${Fw}`:m+=` ${$w}`,g.attr("class",m),g.attr("name",e.name);const v=gf();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;wb.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||(Si++,p.append("line").attr("id","actor"+Si).attr("x1",o).attr("y1",s).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=Si),Ab(r,ps(e.description))(e.description,g,v.x,v.y+(n?15:30),v.width,v.height,{class:`actor ${dk}`},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"),Fri=O(function(t,e,r,n,i){var E;const a=n?e.stopy:e.starty,o=e.x+e.width/2,s=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||(Si++,Object.keys(e.links||{}).length&&!r.forceMenus&&m.attr("onclick",Oie(`actor${Si}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+Si).attr("x1",o).attr("y1",s).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),m=g.append("g"),e.actorCnt=Si,e.links!=null&&m.attr("id","root-"+Si),h==="neo"&&m.attr("data-look","neo"));const v=gf();let y="actor";(E=e.properties)!=null&&E.class?y=e.properties.class:v.fill="#eaeaea",n?y+=` ${Fw}`:y+=` ${$w}`,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=` + 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(wb.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(),P=m.x+m.width-20,L=m.y+10;_.charAt(0)==="@"?jEe(g,P,L,_.substr(1)):qEe(g,P,L,_)}Ab(r,ps(e.description))(e.description,g,m.x,m.y,m.width,m.height,{class:`actor ${Cie}`},r);let T=e.height;const C=x.select("path:last-child");if(C.node()){const _=C.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"),Fri=O(function(t,e,r,n,i,a){var k;const o=n?e.stopy:e.starty,s=e.x+e.width/2,l=o+75,{look:u,theme:h,themeVariables:d}=r,{bkgColorArray:f,borderColorArray:p,actorBorder:g,actorBkg:m}=d,v=t.append("g").lower();n||(Si++,v.append("line").attr("id","actor"+Si).attr("x1",s).attr("y1",l).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=Si);const y=t.append("g");let b=dk;n?b+=` ${Fw}`:b+=` ${$w}`,y.attr("class",b),y.attr("name",e.name);const x=gf();x.x=e.x,x.y=o,x.fill="#eaeaea",x.width=e.width,x.height=e.height,x.class="actor";const w=e.x+e.width/2,A=o+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;wb.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 C=y.node().getBBox();return e.height=C.height+2*(((k=r==null?void 0:r.sequence)==null?void 0:k.labelBoxHeight)??0),Ab(r,ps(e.description))(e.description,y,x.x,x.y+S+(n?5:12),x.width,x.height,{class:`actor ${dk}`},r),n||(y.attr("data-et","participant"),y.attr("data-type","control"),y.attr("data-id",e.name)),e.height},"drawActorTypeControl"),zri=O(function(t,e,r,n,i){var S;const a=n?e.stopy:e.starty,o=e.x+e.width/2,s=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+=` ${Fw}`:m+=` ${$w}`,g.attr("class",m),g.attr("name",e.name);const v=gf();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;wb.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||(Si++,p.append("line").attr("id","actor"+Si).attr("x1",o).attr("y1",s).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=Si),Ab(r,ps(e.description))(e.description,g,v.x,v.y+(n?15:30),v.width,v.height,{class:`actor ${dk}`},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"),Uri=O(function(t,e,r,n,i){var E;const a=n?e.stopy:e.starty,o=e.x+e.width/2,s=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||(Si++,Object.keys(e.links||{}).length&&!r.forceMenus&&m.attr("onclick",Oie(`actor${Si}_popup`)).attr("cursor","pointer"),m.append("line").attr("id","actor"+Si).attr("x1",o).attr("y1",s).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),m=g.append("g"),e.actorCnt=Si,e.links!=null&&m.attr("id","root-"+Si),h==="neo"&&m.attr("data-look","neo"));const v=gf();let y="actor";(E=e.properties)!=null&&E.class?y=e.properties.class:v.fill="#eaeaea",n?y+=` ${Fw}`:y+=` ${$w}`,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} -`;S.append("path").attr("d",T),h==="neo"&&S.attr("filter","url(#drop-shadow)");const C=i.get(e.name)??0;wb.has(l)?(S.style("stroke",f[C%f.length]),S.style("fill",d[C%f.length])):S.style("stroke",p),S.attr("transform",`translate(${b}, ${A})`),e.rectData=v,Ab(r,ps(e.description))(e.description,m,v.x,v.y+35,v.width,v.height,{class:`actor ${Cie}`},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"),zri=O(function(t,e,r,n,i){const a=n?e.stopy:e.starty,o=e.x+e.width/2,s=a+80,l=22,u=t.append("g").lower(),{look:h,theme:d,themeVariables:f}=r,{bkgColorArray:p,borderColorArray:g,actorBorder:m}=f;n||(Si++,u.append("line").attr("id","actor"+Si).attr("x1",o).attr("y1",s).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=Si);const v=t.append("g");let y=dk;n?y+=` ${Fw}`:y+=` ${$w}`,v.attr("class",y),v.attr("name",e.name);const b=gf();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"+Si).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"+Si).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;wb.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),Ab(r,ps(e.description))(e.description,v,b.x,b.y+15,b.width,b.height,{class:`actor ${dk}`},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"),Uri=O(function(t,e,r,n,i){const a=n?e.stopy:e.starty,o=e.x+e.width/2,s=a+80,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=h,g=t.append("g").lower();n||(Si++,g.append("line").attr("id","actor"+Si).attr("x1",o).attr("y1",s).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=Si);const m=t.append("g");let v=dk;n?v+=` ${Fw}`:v+=` ${$w}`,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"+Si).attr("x1",o).attr("y1",b+25*y).attr("x2",o).attr("y2",b+45*y),m.append("line").attr("id","actor-man-arms"+Si).attr("x1",o-hk/2*y).attr("y1",b+33*y).attr("x2",o+hk/2*y).attr("y2",b+33*y),m.append("line").attr("x1",o-hk/2*y).attr("y1",b+60*y).attr("x2",o).attr("y2",b+45*y),m.append("line").attr("x1",o).attr("y1",b+45*y).attr("x2",o+(hk/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=gf();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 wb.has(u)?(m.style("stroke",f[S%f.length]),m.style("fill",d[S%f.length])):m.style("stroke",p),Ab(r,ps(e.description))(e.description,m,A.x,b+35*y-(l==="neo"?10:0),A.width,A.height,{class:`actor ${dk}`},r),e.height},"drawActorTypeActor"),Vri=O(async function(t,e,r,n,i,a,o){const s=o??new Map([...a.db.getActors().values()].map((l,u)=>[l.name,u]));switch(e.type){case"actor":return await Uri(t,e,r,n,s);case"participant":return await Iri(t,e,r,n,s);case"boundary":return await zri(t,e,r,n,s);case"control":return await Bri(t,e,r,n,i,s);case"entity":return await $ri(t,e,r,n,s);case"database":return await Fri(t,e,r,n,s);case"collections":return await Pri(t,e,r,n,s);case"queue":return await Nri(t,e,r,n,s)}},"drawActor"),Qri=O(function(t,e,r){const i=t.append("g");crr(i,e),e.name&&Ab(r)(e.name,i,e.x,e.y+r.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),i.lower()},"drawBox"),Gri=O(function(t){return t.append("g")},"anchorElement"),Hri=O(function(t,e,r,n,i,a,o){const{theme:s,themeVariables:l}=n,{bkgColorArray:u,borderColorArray:h,mainBkg:d}=l,f=gf(),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=iU(p,f),y=(o??new Map([...a.db.getActors().values()].map((b,x)=>[b.name,x]))).get(g)??0;wb.has(s)&&(m.style("stroke",h[y%h.length]),m.style("fill",u[y%h.length]??d))},"drawActivation"),Wri=O(async function(t,e,r,n,i){const{boxMargin:a,boxTextMargin:o,labelBoxHeight:s,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=O(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=XEe();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=s+(n.look==="neo"?15:0)||20,g.textMargin=o,g.class="labelText",srr(f,g),g=urr(),g.text=e.title,g.x=e.startx+l/2+(e.stopx-e.startx)/2,g.y=e.starty+a+o,g.anchor="middle",g.valign="middle",g.textMargin=o,g.class="loopText",g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=!0;let m=ps(g.text)?await kie(f,g,e):TD(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+o,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,ps(g.text)?(e.starty=e.sections[v].y,await kie(f,g,e)):TD(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+o)}}return e.height=Math.round(e.stopy-e.starty),f},"drawLoop"),crr=O(function(t,e){Izt(t,e)},"drawBackgroundRect"),Yri=O(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"),qri=O(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"),jri=O(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"),Xri=O(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"),Kri=O(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"),Zri=O(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"),Jri=O(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"),eni=O(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"),urr=O(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"),tni=O(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Ab=function(){function t(a,o,s,l,u,h,d){const f=o.append("text").attr("x",s+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(a);i(f,d)}O(t,"byText");function e(a,o,s,l,u,h,d,f){const{actorFontSize:p,actorFontFamily:g,actorFontWeight:m}=f,[v,y]=a1(p),b=a.split(Xt.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:O(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:O(function(t){this.boxes.push(t)},"addBox"),addActor:O(function(t){this.actors.push(t)},"addActor"),addLoop:O(function(t){this.loops.push(t)},"addLoop"),addMessage:O(function(t){this.messages.push(t)},"addMessage"),addNote:O(function(t){this.notes.push(t)},"addNote"),lastActor:O(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:O(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:O(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:O(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:O(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,prr(Ye())},"init"),updateVal:O(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:O(function(t,e,r,n){const i=this;let a=0;function o(s){return O(function(u){a++;const h=i.sequenceItems.length-a+1;i.updateVal(u,"starty",e-h*rt.boxMargin,Math.min),i.updateVal(u,"stopy",n+h*rt.boxMargin,Math.max),i.updateVal(Ft.data,"startx",t-h*rt.boxMargin,Math.min),i.updateVal(Ft.data,"stopx",r+h*rt.boxMargin,Math.max),s!=="activation"&&(i.updateVal(u,"startx",t-h*rt.boxMargin,Math.min),i.updateVal(u,"stopx",r+h*rt.boxMargin,Math.max),i.updateVal(Ft.data,"starty",e-h*rt.boxMargin,Math.min),i.updateVal(Ft.data,"stopy",n+h*rt.boxMargin,Math.max))},"updateItemBounds")}O(o,"updateFn"),this.sequenceItems.forEach(o()),this.activations.forEach(o("activation"))},"updateBounds"),insert:O(function(t,e,r,n){const i=Xt.getMin(t,r),a=Xt.getMax(t,r),o=Xt.getMin(e,n),s=Xt.getMax(e,n);this.updateVal(Ft.data,"startx",i,Math.min),this.updateVal(Ft.data,"starty",o,Math.min),this.updateVal(Ft.data,"stopx",a,Math.max),this.updateVal(Ft.data,"stopy",s,Math.max),this.updateBounds(i,o,a,s)},"insert"),newActivation:O(function(t,e,r){const n=r.get(t.from),i=Eie(t.from).length||0,a=n.x+n.width/2+(i-1)*rt.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+rt.activationWidth,stopy:void 0,actor:t.from,anchored:Wa.anchorElement(e)})},"newActivation"),endActivation:O(function(t){const e=this.activations.map(function(r){return r.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:O(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:O(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:O(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:O(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:O(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:Ft.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:O(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:O(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:O(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=Xt.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:O(function(){return this.verticalPos},"getVerticalPos"),getBounds:O(function(){return{bounds:this.data,models:this.models}},"getBounds")},sni=O(async function(t,e,r){Ft.bumpVerticalPos(rt.boxMargin),e.height=rt.boxMargin,e.starty=Ft.getVerticalPos();const n=gf();n.x=e.startx,n.y=e.starty,n.width=e.width||rt.width,n.class="note";const i=t.append("g");i.attr("data-et","note"),i.attr("data-id","i"+r);const a=Wa.drawRect(i,n),o=XEe();o.x=e.startx,o.y=e.starty,o.width=n.width,o.dy="1em",o.text=e.message,o.class="noteText",o.fontFamily=rt.noteFontFamily,o.fontSize=rt.noteFontSize,o.fontWeight=rt.noteFontWeight,o.anchor=rt.noteAlign,o.textMargin=rt.noteMargin,o.valign="center";const s=ps(o.text)?await kie(i,o):TD(i,o),l=Math.round(s.map(u=>(u._groups||u)[0][0].getBBox().height).reduce((u,h)=>u+h));a.attr("height",l+2*rt.noteMargin),e.height+=l+2*rt.noteMargin,Ft.bumpVerticalPos(l+2*rt.noteMargin),e.stopy=e.starty+l+2*rt.noteMargin,e.stopx=e.startx+n.width,Ft.insert(e.startx,e.starty,e.stopx,e.stopy),Ft.models.addNote(e)},"drawNote"),hrr=O(function(t,e,r,n,i,a,o){const s=n.db.getActors(),l=s.get(e.from),u=s.get(e.to),h=r.sequenceVisible;let d=l.x+l.width/2,f=u.x+u.width/2;const p=d<=f,g=brr(e,n),m=t.append("g"),v=16.5,y=O((S,T)=>{const C=S?v:-v;return T?-C:C},"getCircleOffset"),b=O(S=>{m.append("circle").attr("cx",S).attr("cy",o).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"),fk=O(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),CD=O(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),dLe=O(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function drr(t,e){Ft.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,a=Xt.splitBreaks(i).length,o=ps(i),s=o?await p7(i,Ye()):un.calculateTextDimensions(i,fk(rt));if(!o){const d=s.height/a;e.height+=d,Ft.bumpVerticalPos(d)}let l,u=s.height-10;const h=s.width;if(r===n){l=Ft.getVerticalPos()+u,rt.rightAngles||(u+=rt.boxMargin,l=Ft.getVerticalPos()+u),u+=30;const d=Xt.getMax(h/2,rt.width/2);Ft.insert(r-d,Ft.getVerticalPos()-10+u,n+d,Ft.getVerticalPos()+30+u)}else u+=rt.boxMargin,l=Ft.getVerticalPos()+u,Ft.insert(r,l-10,n,l);return Ft.bumpVerticalPos(u),e.height+=u,e.stopy=e.starty+e.height,Ft.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}O(drr,"boundMessage");var lni=O(async function(t,e,r,n,i,a){const{startx:o,stopx:s,starty:l,message:u,type:h,sequenceIndex:d,sequenceVisible:f}=e,p=un.calculateTextDimensions(u,fk(rt)),g=XEe();g.x=Math.min(o,s),g.y=l+10,g.width=Math.abs(s-o),g.class="messageText",g.dy="1em",g.text=u,g.fontFamily=rt.messageFontFamily,g.fontSize=rt.messageFontSize,g.fontWeight=rt.messageFontWeight,g.anchor=rt.messageAlign,g.valign="center",g.textMargin=rt.wrapPadding,g.tspan=!1,ps(g.text)?await kie(t,g,{startx:o,stopx:s,starty:r}):TD(t,g);const m=p.width;let v;if(o===s){const b=f||rt.showSequenceNumbers,x=brr(i,n),w=gni(i,n),A=o+(b&&(x||w)?10:0);rt.rightAngles?v=t.append("path").attr("d",`M ${A},${r} H ${o+Xt.getMax(rt.width/2,m/2)} V ${r+25} H ${o}`):v=t.append("path").attr("d","M "+A+","+r+" C "+(A+60)+","+(r-10)+" "+(o+60)+","+(r+30)+" "+o+","+(r+20)),pLe(i,n)&&hrr(t,i,e,n,o,s,r)}else v=t.append("line"),v.attr("x1",o),v.attr("y1",r),v.attr("x2",s),v.attr("y2",r),pLe(i,n)&&hrr(t,i,e,n,o,s,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(rt.arrowMarkerAbsolute&&(y=Cj(!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||rt.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=pLe(i,n);let S=o,T=s;b?(oo?T=s-2*w:(T=s-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",o+w);let C=0;const k=o===s,E=o<=s;k?C=e.fromBounds+1:x?C=E?e.toBounds-1:e.fromBounds+1:C=E?e.fromBounds+1:e.toBounds-1;let _="12px";const P=d.toString().length;P>5?_="7px":P>3&&(_="9px"),t.append("line").attr("x1",C).attr("y1",r).attr("x2",C).attr("y2",r).attr("stroke-width",0).attr("marker-start","url("+y+"#"+a+"-sequencenumber)"),t.append("text").attr("x",C).attr("y",r+4).attr("font-family","sans-serif").attr("font-size",_).attr("text-anchor","middle").attr("class","sequenceNumber").text(d)}},"drawMessage"),cni=O(function(t,e,r,n,i,a,o){let s=0,l=0,u,h=0;for(const d of n){const f=e.get(d),p=f.box;u&&u!=p&&(o||Ft.models.addBox(u),l+=rt.boxMargin+u.margin),p&&p!=u&&(o||(p.x=s+l,p.y=i),l+=p.margin),f.width=Xt.getMax(f.width||rt.width,rt.width),f.height=Xt.getMax(f.height||rt.height,rt.height),f.margin=f.margin||rt.actorMargin,h=Xt.getMax(h,f.height),r.get(f.name)&&(l+=f.width/2),f.x=s+l,f.starty=Ft.getVerticalPos(),Ft.insert(f.x,i,f.x+f.width,f.height),s+=f.width+l,f.box&&(f.box.width=s+p.margin-f.box.x),l=f.margin,u=f.box,Ft.models.addActor(f)}u&&!o&&Ft.models.addBox(u),Ft.bumpVerticalPos(h)},"addActorRenderingData"),fLe=O(async function(t,e,r,n,i,a,o){if(n){let s=0;Ft.bumpVerticalPos(rt.boxMargin*2);for(const l of r){const u=e.get(l);u.stopy||(u.stopy=Ft.getVerticalPos());const h=await Wa.drawActor(t,u,rt,!0,i,a,o);s=Xt.getMax(s,h)}Ft.bumpVerticalPos(s+rt.boxMargin)}else for(const s of r){const l=e.get(s);await Wa.drawActor(t,l,rt,!1,i,a,o)}},"drawActors"),frr=O(function(t,e,r,n){let i=0,a=0;for(const o of r){const s=e.get(o),l=hni(s),u=Wa.drawPopup(t,s,l,rt,rt.forceMenus,n);u.height>i&&(i=u.height),u.width+s.x>a&&(a=u.width+s.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),prr=O(function(t){$s(rt,t),t.fontFamily&&(rt.actorFontFamily=rt.noteFontFamily=rt.messageFontFamily=t.fontFamily),t.fontSize&&(rt.actorFontSize=rt.noteFontSize=rt.messageFontSize=t.fontSize),t.fontWeight&&(rt.actorFontWeight=rt.noteFontWeight=rt.messageFontWeight=t.fontWeight)},"setConf"),Eie=O(function(t){return Ft.activations.filter(function(e){return e.actor===t})},"actorActivations"),grr=O(function(t,e){const r=e.get(t),n=Eie(t),i=n.reduce(function(o,s){return Xt.getMin(o,s.startx)},r.x+r.width/2-1),a=n.reduce(function(o,s){return Xt.getMax(o,s.stopx)},r.x+r.width/2+1);return[i,a]},"activationBounds");function rm(t,e,r,n,i){Ft.bumpVerticalPos(r);let a=n;if(e.id&&e.message&&t[e.id]){const o=t[e.id].width,s=fk(rt);e.message=un.wrapLabel(`[${e.message}]`,o-2*rt.wrapPadding,s),e.width=o,e.wrap=!0;const l=un.calculateTextDimensions(e.message,s),u=Xt.getMax(l.height,rt.labelBoxHeight);a=n+u,ye.debug(`${u} - ${e.message}`)}i(e),Ft.bumpVerticalPos(a)}O(rm,"adjustLoopHeightForWrap");function mrr(t,e,r,n,i,a,o){function s(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]}));cni(d,f,p,v,0,y,!1);const T=await vni(y,f,A,n);Wa.insertArrowHead(d,e),Wa.insertArrowCrossHead(d,e),Wa.insertArrowFilledHead(d,e),Wa.insertSequenceNumber(d,e),Wa.insertSolidTopArrowHead(d,e),Wa.insertSolidBottomArrowHead(d,e),Wa.insertStickTopArrowHead(d,e),Wa.insertStickBottomArrowHead(d,e),o==="neo"&&Wa.insertDropShadow(d,rt);function C(z,U){const Q=Ft.endActivation(z);Q.starty+18>U&&(Q.starty=U-6,U+=12),Wa.drawActivation(d,Q,U,rt,Eie(z.from).length,n,S),Ft.insert(Q.startx,U-10,Q.stopx,U)}O(C,"activeEnd");let k=1,E=1;const _=[],P=[];let L=0;for(const z of y){let U,Q,G;switch(z.type){case n.db.LINETYPE.NOTE:Ft.resetVerticalPos(),Q=z.noteModel,await sni(d,Q,z.id);break;case n.db.LINETYPE.ACTIVE_START:Ft.newActivation(z,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION:Ft.newActivation(z,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:Ft.newActivation(z,d,f);break;case n.db.LINETYPE.ACTIVE_END:C(z,Ft.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:rm(T,z,rt.boxMargin,rt.boxMargin+rt.boxTextMargin,q=>Ft.newLoop(q));break;case n.db.LINETYPE.LOOP_END:U=Ft.endLoop(),await Wa.drawLoop(d,U,"loop",rt,z),Ft.bumpVerticalPos(U.stopy-Ft.getVerticalPos()),Ft.models.addLoop(U);break;case n.db.LINETYPE.RECT_START:rm(T,z,rt.boxMargin,rt.boxMargin,q=>{let Y=q.message;Y||(Y=(s==null?void 0:s.rectBkgColor)||(s==null?void 0:s.actorBkg)||"rgba(128, 128, 128, 0.5)"),Ft.newLoop(void 0,Y)});break;case n.db.LINETYPE.RECT_END:U=Ft.endLoop(),P.push(U),Ft.models.addLoop(U),Ft.bumpVerticalPos(U.stopy-Ft.getVerticalPos());break;case n.db.LINETYPE.OPT_START:rm(T,z,rt.boxMargin,rt.boxMargin+rt.boxTextMargin,q=>Ft.newLoop(q));break;case n.db.LINETYPE.OPT_END:U=Ft.endLoop(),await Wa.drawLoop(d,U,"opt",rt,z),Ft.bumpVerticalPos(U.stopy-Ft.getVerticalPos()),Ft.models.addLoop(U);break;case n.db.LINETYPE.ALT_START:rm(T,z,rt.boxMargin,rt.boxMargin+rt.boxTextMargin,q=>Ft.newLoop(q));break;case n.db.LINETYPE.ALT_ELSE:rm(T,z,rt.boxMargin+rt.boxTextMargin,rt.boxMargin,q=>Ft.addSectionToLoop(q));break;case n.db.LINETYPE.ALT_END:U=Ft.endLoop(),await Wa.drawLoop(d,U,"alt",rt,z),Ft.bumpVerticalPos(U.stopy-Ft.getVerticalPos()),Ft.models.addLoop(U);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:rm(T,z,rt.boxMargin,rt.boxMargin+rt.boxTextMargin,q=>Ft.newLoop(q)),Ft.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:rm(T,z,rt.boxMargin+rt.boxTextMargin,rt.boxMargin,q=>Ft.addSectionToLoop(q));break;case n.db.LINETYPE.PAR_END:U=Ft.endLoop(),await Wa.drawLoop(d,U,"par",rt,z),Ft.bumpVerticalPos(U.stopy-Ft.getVerticalPos()),Ft.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:rm(T,z,rt.boxMargin,rt.boxMargin+rt.boxTextMargin,q=>Ft.newLoop(q));break;case n.db.LINETYPE.CRITICAL_OPTION:rm(T,z,rt.boxMargin+rt.boxTextMargin,rt.boxMargin,q=>Ft.addSectionToLoop(q));break;case n.db.LINETYPE.CRITICAL_END:U=Ft.endLoop(),await Wa.drawLoop(d,U,"critical",rt,z),Ft.bumpVerticalPos(U.stopy-Ft.getVerticalPos()),Ft.models.addLoop(U);break;case n.db.LINETYPE.BREAK_START:rm(T,z,rt.boxMargin,rt.boxMargin+rt.boxTextMargin,q=>Ft.newLoop(q));break;case n.db.LINETYPE.BREAK_END:U=Ft.endLoop(),await Wa.drawLoop(d,U,"break",rt,z),Ft.bumpVerticalPos(U.stopy-Ft.getVerticalPos()),Ft.models.addLoop(U);break;default:try{G=z.msgModel,G.starty=Ft.getVerticalPos(),G.sequenceIndex=k,G.sequenceVisible=n.db.showSequenceNumbers(),G.id=z.id,G.from=z.from,G.to=z.to;const q=await drr(d,G);mrr(z,G,q,L,f,p,g),_.push({messageModel:G,lineStartY:q,msg:z}),Ft.models.addMessage(G)}catch(q){ye.error("error while drawing message",q)}}[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++}ye.debug("createdActors",p),ye.debug("destroyedActors",g),await fLe(d,f,v,!1,e,n,S);for(const z of _)await lni(d,z.messageModel,z.lineStartY,n,z.msg,e);rt.mirrorActors&&await fLe(d,f,v,!0,e,n,S),P.forEach(z=>Wa.drawBackgroundRect(d,z)),lrr(d,f,v,rt);for(const z of Ft.models.boxes){z.height=Ft.getVerticalPos()-z.y,Ft.insert(z.x,z.y,z.x+z.width,z.height);const U=rt.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)",Wa.drawBox(d,z,rt)}x&&Ft.bumpVerticalPos(rt.boxMargin);const R=frr(d,f,v,h),{bounds:D}=Ft.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 o=fk(rt);let s=a.actorKeys.reduce((d,f)=>d+=t.get(f).width+(t.get(f).margin||0),0);const l=rt.boxMargin*8;s+=l,s-=2*rt.boxTextMargin,a.wrap&&(a.name=un.wrapLabel(a.name,s-2*rt.wrapPadding,o));const u=un.calculateTextDimensions(a.name,o);i=Xt.getMax(u.height,i);const h=Xt.getMax(s,u.width+2*rt.wrapPadding);if(a.margin=rt.boxTextMargin,sa.textMaxHeight=i),Xt.getMax(n,rt.height)}O(yrr,"calculateActorMargins");var dni=O(async function(t,e,r){const n=e.get(t.from),i=e.get(t.to),a=n.x,o=i.x,s=t.wrap&&t.message;let l=ps(t.message)?await p7(t.message,Ye()):un.calculateTextDimensions(s?un.wrapLabel(t.message,rt.width,CD(rt)):t.message,CD(rt));const u={width:s?rt.width:Xt.getMax(rt.width,l.width+2*rt.noteMargin),height:0,startx:n.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===r.db.PLACEMENT.RIGHTOF?(u.width=s?Xt.getMax(rt.width,l.width):Xt.getMax(n.width/2+i.width/2,l.width+2*rt.noteMargin),u.startx=a+(n.width+rt.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(u.width=s?Xt.getMax(rt.width,l.width+2*rt.noteMargin):Xt.getMax(n.width/2+i.width/2,l.width+2*rt.noteMargin),u.startx=a-u.width+(n.width-rt.actorMargin)/2):t.to===t.from?(l=un.calculateTextDimensions(s?un.wrapLabel(t.message,Xt.getMax(rt.width,n.width),CD(rt)):t.message,CD(rt)),u.width=s?Xt.getMax(rt.width,n.width):Xt.getMax(n.width,rt.width,l.width+2*rt.noteMargin),u.startx=a+(n.width-u.width)/2):(u.width=Math.abs(a+n.width/2-(o+i.width/2))+rt.actorMargin,u.startx=a2,f=O(v=>l?-v:v,"adjustValue");t.from===t.to?h=u:(t.activate&&!d&&(h+=f(rt.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,o,s],g=Math.abs(u-h);t.wrap&&t.message&&(t.message=un.wrapLabel(t.message,Xt.getMax(g+2*rt.wrapPadding,rt.width),fk(rt)));const m=un.calculateTextDimensions(t.message,fk(rt));return{width:Xt.getMax(t.wrap?0:m.width+2*rt.wrapPadding,g+2*rt.wrapPadding,rt.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"),vni=O(async function(t,e,r,n){const i={},a=[];let o,s,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&&(o=a.pop(),i[o.id]=o,i[u.id]=o,a.push(o));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:o=a.pop(),i[o.id]=o;break;case n.db.LINETYPE.ACTIVE_START:{const d=e.get(u.from?u.from:u.to.actor),f=Eie(u.from?u.from:u.to.actor).length,p=d.x+d.width/2+(f-1)*rt.activationWidth/2,g={startx:p,stopx:p+rt.activationWidth,actor:u.from,enabled:!0};Ft.activations.push(g)}break;case n.db.LINETYPE.ACTIVE_END:{const d=Ft.activations.map(f=>f.actor).lastIndexOf(u.from);Ft.activations.splice(d,1).splice(0,1)}break}u.placement!==void 0?(s=await dni(u,e,n),u.noteModel=s,a.forEach(d=>{o=d,o.from=Xt.getMin(o.from,s.startx),o.to=Xt.getMax(o.to,s.startx+s.width),o.width=Xt.getMax(o.width,Math.abs(o.from-o.to))-rt.labelBoxWidth})):(l=mni(u,e,n),u.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach(d=>{if(o=d,l.startx===l.stopx){const f=e.get(u.from),p=e.get(u.to);o.from=Xt.getMin(f.x-l.width/2,f.x-f.width/2,o.from),o.to=Xt.getMax(p.x+l.width/2,p.x+f.width/2,o.to),o.width=Xt.getMax(o.width,Math.abs(o.to-o.from))-rt.labelBoxWidth}else o.from=Xt.getMin(l.startx,o.from),o.to=Xt.getMax(l.stopx,o.to),o.width=Xt.getMax(o.width,l.width)-rt.labelBoxWidth}))}return Ft.activations=[],ye.debug("Loop type widths:",i),i},"calculateLoopBounds"),yni={bounds:Ft,drawActors:fLe,drawActorsPopup:frr,setConf:prr,draw:uni},bni={parser:Ori,get db(){return new Rri},renderer:yni,styles:Lri,init:O(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,U1e({sequence:{wrap:t.wrap}}))},"init")};const xni=Object.freeze(Object.defineProperty({__proto__:null,diagram:bni},Symbol.toStringTag,{value:"Module"}));var gLe=function(){var t=O(function(le,be,ae,K){for(ae=ae||{},K=le.length;K--;ae[le[K]]=be);return ae},"o"),e=[1,18],r=[1,19],n=[1,20],i=[1,41],a=[1,26],o=[1,42],s=[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],C=[1,43],k=[1,47],E=[1,9],_=[1,8,9],P=[1,58],L=[1,59],R=[1,60],D=[1,61],M=[1,62],I=[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],q=[1,103],Y=[1,121],ne=[1,117],X=[1,113],J=[1,119],ee=[1,114],te=[1,115],pe=[1,116],ie=[1,118],Ce=[1,120],ke=[22,50,60,61,82,86,87,88,89,90],Ee=[1,128],ue=[12,39],de=[1,8,9,39,41,44,46],xe=[1,8,9,22],ge=[1,153],ze=[1,8,9,61],we=[1,8,9,22,50,60,61,82,86,87,88,89,90],Oe={trace:O(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:O(function(be,ae,K,se,me,oe,ve){var ce=oe.length-1;switch(me){case 8:this.$=oe[ce-1];break;case 9:case 10:case 13:case 15:this.$=oe[ce];break;case 11:case 14:this.$=oe[ce-2]+"."+oe[ce];break;case 12:case 16:this.$=oe[ce-1]+oe[ce];break;case 17:case 18:this.$=oe[ce-1]+"~"+oe[ce]+"~";break;case 19:se.addRelation(oe[ce]);break;case 20:oe[ce-1].title=se.cleanupLabel(oe[ce]),se.addRelation(oe[ce-1]);break;case 31:this.$=oe[ce].trim(),se.setAccTitle(this.$);break;case 32:case 33:this.$=oe[ce].trim(),se.setAccDescription(this.$);break;case 34:se.addClassesToNamespace(oe[ce-3],oe[ce-1][0],oe[ce-1][1]),se.popNamespace();break;case 35:se.addClassesToNamespace(oe[ce-4],oe[ce-1][0],oe[ce-1][1]),se.popNamespace();break;case 36:this.$=se.addNamespace(oe[ce]);break;case 37:this.$=se.addNamespace(oe[ce-1],oe[ce]);break;case 38:this.$=[[oe[ce]],[]];break;case 39:this.$=[[oe[ce-1]],[]];break;case 40:oe[ce][0].unshift(oe[ce-2]),this.$=oe[ce];break;case 41:this.$=[[],[oe[ce]]];break;case 42:this.$=[[],[oe[ce-1]]];break;case 43:oe[ce][1].unshift(oe[ce-2]),this.$=oe[ce];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=oe[ce];break;case 48:se.setCssClass(oe[ce-2],oe[ce]);break;case 49:se.addMembers(oe[ce-3],oe[ce-1]);break;case 51:se.setCssClass(oe[ce-5],oe[ce-3]),se.addMembers(oe[ce-5],oe[ce-1]);break;case 52:se.addAnnotation(oe[ce-3],oe[ce-1]);break;case 53:se.addAnnotation(oe[ce-6],oe[ce-4]),se.addMembers(oe[ce-6],oe[ce-1]);break;case 54:se.addAnnotation(oe[ce-5],oe[ce-3]);break;case 55:this.$=oe[ce],se.addClass(oe[ce]);break;case 56:this.$=oe[ce-1],se.addClass(oe[ce-1]),se.setClassLabel(oe[ce-1],oe[ce]);break;case 60:se.addAnnotation(oe[ce],oe[ce-2]);break;case 61:case 74:this.$=[oe[ce]];break;case 62:oe[ce].push(oe[ce-1]),this.$=oe[ce];break;case 63:break;case 64:se.addMember(oe[ce-1],se.cleanupLabel(oe[ce]));break;case 65:break;case 66:break;case 67:this.$={id1:oe[ce-2],id2:oe[ce],relation:oe[ce-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:oe[ce-3],id2:oe[ce],relation:oe[ce-1],relationTitle1:oe[ce-2],relationTitle2:"none"};break;case 69:this.$={id1:oe[ce-3],id2:oe[ce],relation:oe[ce-2],relationTitle1:"none",relationTitle2:oe[ce-1]};break;case 70:this.$={id1:oe[ce-4],id2:oe[ce],relation:oe[ce-2],relationTitle1:oe[ce-3],relationTitle2:oe[ce-1]};break;case 71:this.$=se.addNote(oe[ce],oe[ce-1]);break;case 72:this.$=se.addNote(oe[ce]);break;case 73:this.$=oe[ce-2],se.defineClass(oe[ce-1],oe[ce]);break;case 75:this.$=oe[ce-2].concat([oe[ce]]);break;case 76:se.setDirection("TB");break;case 77:se.setDirection("BT");break;case 78:se.setDirection("RL");break;case 79:se.setDirection("LR");break;case 80:this.$={type1:oe[ce-2],type2:oe[ce],lineType:oe[ce-1]};break;case 81:this.$={type1:"none",type2:oe[ce],lineType:oe[ce-1]};break;case 82:this.$={type1:oe[ce-1],type2:"none",lineType:oe[ce]};break;case 83:this.$={type1:"none",type2:"none",lineType:oe[ce]};break;case 84:this.$=se.relationType.AGGREGATION;break;case 85:this.$=se.relationType.EXTENSION;break;case 86:this.$=se.relationType.COMPOSITION;break;case 87:this.$=se.relationType.DEPENDENCY;break;case 88:this.$=se.relationType.LOLLIPOP;break;case 89:this.$=se.lineType.LINE;break;case 90:this.$=se.lineType.DOTTED_LINE;break;case 91:case 97:this.$=oe[ce-2],se.setClickEvent(oe[ce-1],oe[ce]);break;case 92:case 98:this.$=oe[ce-3],se.setClickEvent(oe[ce-2],oe[ce-1]),se.setTooltip(oe[ce-2],oe[ce]);break;case 93:this.$=oe[ce-2],se.setLink(oe[ce-1],oe[ce]);break;case 94:this.$=oe[ce-3],se.setLink(oe[ce-2],oe[ce-1],oe[ce]);break;case 95:this.$=oe[ce-3],se.setLink(oe[ce-2],oe[ce-1]),se.setTooltip(oe[ce-2],oe[ce]);break;case 96:this.$=oe[ce-4],se.setLink(oe[ce-3],oe[ce-2],oe[ce]),se.setTooltip(oe[ce-3],oe[ce-1]);break;case 99:this.$=oe[ce-3],se.setClickEvent(oe[ce-2],oe[ce-1],oe[ce]);break;case 100:this.$=oe[ce-4],se.setClickEvent(oe[ce-3],oe[ce-2],oe[ce-1]),se.setTooltip(oe[ce-3],oe[ce]);break;case 101:this.$=oe[ce-3],se.setLink(oe[ce-2],oe[ce]);break;case 102:this.$=oe[ce-4],se.setLink(oe[ce-3],oe[ce-1],oe[ce]);break;case 103:this.$=oe[ce-4],se.setLink(oe[ce-3],oe[ce-1]),se.setTooltip(oe[ce-3],oe[ce]);break;case 104:this.$=oe[ce-5],se.setLink(oe[ce-4],oe[ce-2],oe[ce]),se.setTooltip(oe[ce-4],oe[ce-1]);break;case 105:this.$=oe[ce-2],se.setCssStyle(oe[ce-1],oe[ce]);break;case 106:se.setCssClass(oe[ce-1],oe[ce]);break;case 107:this.$=[oe[ce]];break;case 108:oe[ce-2].push(oe[ce]),this.$=oe[ce-2];break;case 110:this.$=oe[ce-1]+oe[ce];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:o,51:s,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:C,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:P,69:L,70:R,71:D,72:M,73:I,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:C},{16:39,17:40,19:70,60:f,86:S,100:T,102:C,103:k},{16:39,17:40,19:71,60:f,86:S,100:T,102:C,103:k},{16:39,17:40,19:72,60:f,86:S,100:T,102:C,103:k},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:f,86:S,100:T,102:C,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:C,103:k}),t(V,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:f,86:S,100:T,102:C,103:k},{16:39,17:40,19:87,60:f,86:S,100:T,102:C,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:o,51:s,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:C,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:o,51:s,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:C,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:C,103:k},{53:92,66:56,67:57,68:P,69:L,70:R,71:D,72:M,73:I,74:N},t(_,[2,64]),{67:93,73:I,74:N},t(U,[2,83],{66:94,68:P,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:o,54:u,56:h},{16:100,60:f,86:S,100:T,102:C},{41:[1,102],45:101,51:q},{16:104,60:f,86:S,100:T,102:C},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:Y,50:ne,59:110,60:X,82:J,84:111,85:112,86:ee,87:te,88:pe,89:ie,90:Ce},{60:[1,122]},{13:B,55:123},t(F,[2,72]),t(F,[2,138]),{22:Y,50:ne,59:124,60:X,61:[1,125],82:J,84:111,85:112,86:ee,87:te,88:pe,89:ie,90:Ce},t(ke,[2,74]),{16:39,17:40,19:126,60:f,86:S,100:T,102:C,103:k},t(V,[2,16]),t(V,[2,17]),t(V,[2,18]),{11:127,12:Ee,39:[2,36]},t(ue,[2,9],{16:85,17:86,15:130,18:[1,129],60:f,86:S,100:T,102:C,103:k}),t(ue,[2,10]),t(de,[2,55],{11:131,12:Ee}),t(E,[2,7]),{9:[1,132]},t(xe,[2,67]),{16:39,17:40,19:133,60:f,86:S,100:T,102:C,103:k},{13:[1,135],16:39,17:40,19:134,60:f,86:S,100:T,102:C,103:k},t(U,[2,82],{66:136,68:P,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:o,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:q},{47:[1,145]},{16:39,17:40,19:146,60:f,86:S,100:T,102:C,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(ze,[2,107],{85:154,22:Y,50:ne,60:X,82:J,86:ee,87:te,88:pe,89:ie,90:Ce}),t(we,[2,109]),t(we,[2,111]),t(we,[2,112]),t(we,[2,113]),t(we,[2,114]),t(we,[2,115]),t(we,[2,116]),t(we,[2,117]),t(we,[2,118]),t(we,[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:C,103:k},t(ue,[2,12]),t(de,[2,56]),{1:[2,4]},t(xe,[2,69]),t(xe,[2,68]),{16:39,17:40,19:158,60:f,86:S,100:T,102:C,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:o,54:u,56:h},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:i,43:23,48:o,54:u,56:h},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:i,43:23,48:o,54:u,56:h},{45:163,51:q},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:ne,60:X,82:J,84:169,85:112,86:ee,87:te,88:pe,89:ie,90:Ce},t(we,[2,110]),t(ke,[2,75]),{14:[1,170]},t(ue,[2,11]),t(xe,[2,70]),t(F,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:q},t(_,[2,96]),t(_,[2,100]),t(_,[2,102]),t(_,[2,103],{77:[1,174]}),t(ze,[2,108],{85:154,22:Y,50:ne,60:X,82:J,86:ee,87:te,88:pe,89:ie,90:Ce}),t(de,[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:O(function(be,ae){if(ae.recoverable)this.trace(be);else{var K=new Error(be);throw K.hash=ae,K}},"parseError"),parse:O(function(be){var ae=this,K=[0],se=[],me=[null],oe=[],ve=this.table,ce="",De=0,Le=0,We=2,Ne=1,je=oe.slice.call(arguments,1),$e=Object.create(this.lexer),Ze={yy:{}};for(var He in this.yy)Object.prototype.hasOwnProperty.call(this.yy,He)&&(Ze.yy[He]=this.yy[He]);$e.setInput(be,Ze.yy),Ze.yy.lexer=$e,Ze.yy.parser=this,typeof $e.yylloc>"u"&&($e.yylloc={});var et=$e.yylloc;oe.push(et);var Pe=$e.options&&$e.options.ranges;typeof Ze.yy.parseError=="function"?this.parseError=Ze.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function yt(Mt){K.length=K.length-2*Mt,me.length=me.length-Mt,oe.length=oe.length-Mt}O(yt,"popStack");function Ie(){var Mt;return Mt=se.pop()||$e.lex()||Ne,typeof Mt!="number"&&(Mt instanceof Array&&(se=Mt,Mt=se.pop()),Mt=ae.symbols_[Mt]||Mt),Mt}O(Ie,"lex");for(var St,kt,ut,Gt,It={},gt,Te,Bt,Et;;){if(kt=K[K.length-1],this.defaultActions[kt]?ut=this.defaultActions[kt]:((St===null||typeof St>"u")&&(St=Ie()),ut=ve[kt]&&ve[kt][St]),typeof ut>"u"||!ut.length||!ut[0]){var At="";Et=[];for(gt in ve[kt])this.terminals_[gt]&>>We&&Et.push("'"+this.terminals_[gt]+"'");$e.showPosition?At="Parse error on line "+(De+1)+`: +`;S.append("path").attr("d",T),h==="neo"&&S.attr("filter","url(#drop-shadow)");const C=i.get(e.name)??0;wb.has(l)?(S.style("stroke",f[C%f.length]),S.style("fill",d[C%f.length])):S.style("stroke",p),S.attr("transform",`translate(${b}, ${A})`),e.rectData=v,Ab(r,ps(e.description))(e.description,m,v.x,v.y+35,v.width,v.height,{class:`actor ${Cie}`},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"),Vri=O(function(t,e,r,n,i){const a=n?e.stopy:e.starty,o=e.x+e.width/2,s=a+80,l=22,u=t.append("g").lower(),{look:h,theme:d,themeVariables:f}=r,{bkgColorArray:p,borderColorArray:g,actorBorder:m}=f;n||(Si++,u.append("line").attr("id","actor"+Si).attr("x1",o).attr("y1",s).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=Si);const v=t.append("g");let y=dk;n?y+=` ${Fw}`:y+=` ${$w}`,v.attr("class",y),v.attr("name",e.name);const b=gf();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"+Si).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"+Si).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;wb.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),Ab(r,ps(e.description))(e.description,v,b.x,b.y+15,b.width,b.height,{class:`actor ${dk}`},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"),Qri=O(function(t,e,r,n,i){const a=n?e.stopy:e.starty,o=e.x+e.width/2,s=a+80,{look:l,theme:u,themeVariables:h}=r,{bkgColorArray:d,borderColorArray:f,actorBorder:p}=h,g=t.append("g").lower();n||(Si++,g.append("line").attr("id","actor"+Si).attr("x1",o).attr("y1",s).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=Si);const m=t.append("g");let v=dk;n?v+=` ${Fw}`:v+=` ${$w}`,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"+Si).attr("x1",o).attr("y1",b+25*y).attr("x2",o).attr("y2",b+45*y),m.append("line").attr("id","actor-man-arms"+Si).attr("x1",o-hk/2*y).attr("y1",b+33*y).attr("x2",o+hk/2*y).attr("y2",b+33*y),m.append("line").attr("x1",o-hk/2*y).attr("y1",b+60*y).attr("x2",o).attr("y2",b+45*y),m.append("line").attr("x1",o).attr("y1",b+45*y).attr("x2",o+(hk/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=gf();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 wb.has(u)?(m.style("stroke",f[S%f.length]),m.style("fill",d[S%f.length])):m.style("stroke",p),Ab(r,ps(e.description))(e.description,m,A.x,b+35*y-(l==="neo"?10:0),A.width,A.height,{class:`actor ${dk}`},r),e.height},"drawActorTypeActor"),Gri=O(async function(t,e,r,n,i,a,o){const s=o??new Map([...a.db.getActors().values()].map((l,u)=>[l.name,u]));switch(e.type){case"actor":return await Qri(t,e,r,n,s);case"participant":return await Nri(t,e,r,n,s);case"boundary":return await Vri(t,e,r,n,s);case"control":return await Fri(t,e,r,n,i,s);case"entity":return await zri(t,e,r,n,s);case"database":return await Uri(t,e,r,n,s);case"collections":return await Bri(t,e,r,n,s);case"queue":return await $ri(t,e,r,n,s)}},"drawActor"),Hri=O(function(t,e,r){const i=t.append("g");hrr(i,e),e.name&&Ab(r)(e.name,i,e.x,e.y+r.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},r),i.lower()},"drawBox"),Wri=O(function(t){return t.append("g")},"anchorElement"),Yri=O(function(t,e,r,n,i,a,o){const{theme:s,themeVariables:l}=n,{bkgColorArray:u,borderColorArray:h,mainBkg:d}=l,f=gf(),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=iU(p,f),y=(o??new Map([...a.db.getActors().values()].map((b,x)=>[b.name,x]))).get(g)??0;wb.has(s)&&(m.style("stroke",h[y%h.length]),m.style("fill",u[y%h.length]??d))},"drawActivation"),qri=O(async function(t,e,r,n,i){const{boxMargin:a,boxTextMargin:o,labelBoxHeight:s,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=O(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=XEe();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=s+(n.look==="neo"?15:0)||20,g.textMargin=o,g.class="labelText",crr(f,g),g=drr(),g.text=e.title,g.x=e.startx+l/2+(e.stopx-e.startx)/2,g.y=e.starty+a+o,g.anchor="middle",g.valign="middle",g.textMargin=o,g.class="loopText",g.fontFamily=u,g.fontSize=h,g.fontWeight=d,g.wrap=!0;let m=ps(g.text)?await kie(f,g,e):TD(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+o,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,ps(g.text)?(e.starty=e.sections[v].y,await kie(f,g,e)):TD(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+o)}}return e.height=Math.round(e.stopy-e.starty),f},"drawLoop"),hrr=O(function(t,e){Nzt(t,e)},"drawBackgroundRect"),jri=O(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"),Xri=O(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"),Kri=O(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"),Zri=O(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"),Jri=O(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"),eni=O(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"),tni=O(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"),rni=O(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"),drr=O(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"),nni=O(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Ab=function(){function t(a,o,s,l,u,h,d){const f=o.append("text").attr("x",s+u/2).attr("y",l+h/2+5).style("text-anchor","middle").text(a);i(f,d)}O(t,"byText");function e(a,o,s,l,u,h,d,f){const{actorFontSize:p,actorFontFamily:g,actorFontWeight:m}=f,[v,y]=a1(p),b=a.split(Xt.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:O(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:O(function(t){this.boxes.push(t)},"addBox"),addActor:O(function(t){this.actors.push(t)},"addActor"),addLoop:O(function(t){this.loops.push(t)},"addLoop"),addMessage:O(function(t){this.messages.push(t)},"addMessage"),addNote:O(function(t){this.notes.push(t)},"addNote"),lastActor:O(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:O(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:O(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:O(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:O(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,mrr(Ye())},"init"),updateVal:O(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:O(function(t,e,r,n){const i=this;let a=0;function o(s){return O(function(u){a++;const h=i.sequenceItems.length-a+1;i.updateVal(u,"starty",e-h*rt.boxMargin,Math.min),i.updateVal(u,"stopy",n+h*rt.boxMargin,Math.max),i.updateVal(Ft.data,"startx",t-h*rt.boxMargin,Math.min),i.updateVal(Ft.data,"stopx",r+h*rt.boxMargin,Math.max),s!=="activation"&&(i.updateVal(u,"startx",t-h*rt.boxMargin,Math.min),i.updateVal(u,"stopx",r+h*rt.boxMargin,Math.max),i.updateVal(Ft.data,"starty",e-h*rt.boxMargin,Math.min),i.updateVal(Ft.data,"stopy",n+h*rt.boxMargin,Math.max))},"updateItemBounds")}O(o,"updateFn"),this.sequenceItems.forEach(o()),this.activations.forEach(o("activation"))},"updateBounds"),insert:O(function(t,e,r,n){const i=Xt.getMin(t,r),a=Xt.getMax(t,r),o=Xt.getMin(e,n),s=Xt.getMax(e,n);this.updateVal(Ft.data,"startx",i,Math.min),this.updateVal(Ft.data,"starty",o,Math.min),this.updateVal(Ft.data,"stopx",a,Math.max),this.updateVal(Ft.data,"stopy",s,Math.max),this.updateBounds(i,o,a,s)},"insert"),newActivation:O(function(t,e,r){const n=r.get(t.from),i=Eie(t.from).length||0,a=n.x+n.width/2+(i-1)*rt.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+rt.activationWidth,stopy:void 0,actor:t.from,anchored:Wa.anchorElement(e)})},"newActivation"),endActivation:O(function(t){const e=this.activations.map(function(r){return r.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:O(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:O(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:O(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:O(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:O(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:Ft.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:O(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:O(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:O(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=Xt.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:O(function(){return this.verticalPos},"getVerticalPos"),getBounds:O(function(){return{bounds:this.data,models:this.models}},"getBounds")},cni=O(async function(t,e,r){Ft.bumpVerticalPos(rt.boxMargin),e.height=rt.boxMargin,e.starty=Ft.getVerticalPos();const n=gf();n.x=e.startx,n.y=e.starty,n.width=e.width||rt.width,n.class="note";const i=t.append("g");i.attr("data-et","note"),i.attr("data-id","i"+r);const a=Wa.drawRect(i,n),o=XEe();o.x=e.startx,o.y=e.starty,o.width=n.width,o.dy="1em",o.text=e.message,o.class="noteText",o.fontFamily=rt.noteFontFamily,o.fontSize=rt.noteFontSize,o.fontWeight=rt.noteFontWeight,o.anchor=rt.noteAlign,o.textMargin=rt.noteMargin,o.valign="center";const s=ps(o.text)?await kie(i,o):TD(i,o),l=Math.round(s.map(u=>(u._groups||u)[0][0].getBBox().height).reduce((u,h)=>u+h));a.attr("height",l+2*rt.noteMargin),e.height+=l+2*rt.noteMargin,Ft.bumpVerticalPos(l+2*rt.noteMargin),e.stopy=e.starty+l+2*rt.noteMargin,e.stopx=e.startx+n.width,Ft.insert(e.startx,e.starty,e.stopx,e.stopy),Ft.models.addNote(e)},"drawNote"),frr=O(function(t,e,r,n,i,a,o){const s=n.db.getActors(),l=s.get(e.from),u=s.get(e.to),h=r.sequenceVisible;let d=l.x+l.width/2,f=u.x+u.width/2;const p=d<=f,g=wrr(e,n),m=t.append("g"),v=16.5,y=O((S,T)=>{const C=S?v:-v;return T?-C:C},"getCircleOffset"),b=O(S=>{m.append("circle").attr("cx",S).attr("cy",o).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"),fk=O(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),CD=O(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),dLe=O(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function prr(t,e){Ft.bumpVerticalPos(10);const{startx:r,stopx:n,message:i}=e,a=Xt.splitBreaks(i).length,o=ps(i),s=o?await p7(i,Ye()):un.calculateTextDimensions(i,fk(rt));if(!o){const d=s.height/a;e.height+=d,Ft.bumpVerticalPos(d)}let l,u=s.height-10;const h=s.width;if(r===n){l=Ft.getVerticalPos()+u,rt.rightAngles||(u+=rt.boxMargin,l=Ft.getVerticalPos()+u),u+=30;const d=Xt.getMax(h/2,rt.width/2);Ft.insert(r-d,Ft.getVerticalPos()-10+u,n+d,Ft.getVerticalPos()+30+u)}else u+=rt.boxMargin,l=Ft.getVerticalPos()+u,Ft.insert(r,l-10,n,l);return Ft.bumpVerticalPos(u),e.height+=u,e.stopy=e.starty+e.height,Ft.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),l}O(prr,"boundMessage");var uni=O(async function(t,e,r,n,i,a){const{startx:o,stopx:s,starty:l,message:u,type:h,sequenceIndex:d,sequenceVisible:f}=e,p=un.calculateTextDimensions(u,fk(rt)),g=XEe();g.x=Math.min(o,s),g.y=l+10,g.width=Math.abs(s-o),g.class="messageText",g.dy="1em",g.text=u,g.fontFamily=rt.messageFontFamily,g.fontSize=rt.messageFontSize,g.fontWeight=rt.messageFontWeight,g.anchor=rt.messageAlign,g.valign="center",g.textMargin=rt.wrapPadding,g.tspan=!1,ps(g.text)?await kie(t,g,{startx:o,stopx:s,starty:r}):TD(t,g);const m=p.width;let v;if(o===s){const b=f||rt.showSequenceNumbers,x=wrr(i,n),w=vni(i,n),A=o+(b&&(x||w)?10:0);rt.rightAngles?v=t.append("path").attr("d",`M ${A},${r} H ${o+Xt.getMax(rt.width/2,m/2)} V ${r+25} H ${o}`):v=t.append("path").attr("d","M "+A+","+r+" C "+(A+60)+","+(r-10)+" "+(o+60)+","+(r+30)+" "+o+","+(r+20)),pLe(i,n)&&frr(t,i,e,n,o,s,r)}else v=t.append("line"),v.attr("x1",o),v.attr("y1",r),v.attr("x2",s),v.attr("y2",r),pLe(i,n)&&frr(t,i,e,n,o,s,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(rt.arrowMarkerAbsolute&&(y=Cj(!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||rt.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=pLe(i,n);let S=o,T=s;b?(oo?T=s-2*w:(T=s-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",o+w);let C=0;const k=o===s,E=o<=s;k?C=e.fromBounds+1:x?C=E?e.toBounds-1:e.fromBounds+1:C=E?e.fromBounds+1:e.toBounds-1;let _="12px";const P=d.toString().length;P>5?_="7px":P>3&&(_="9px"),t.append("line").attr("x1",C).attr("y1",r).attr("x2",C).attr("y2",r).attr("stroke-width",0).attr("marker-start","url("+y+"#"+a+"-sequencenumber)"),t.append("text").attr("x",C).attr("y",r+4).attr("font-family","sans-serif").attr("font-size",_).attr("text-anchor","middle").attr("class","sequenceNumber").text(d)}},"drawMessage"),hni=O(function(t,e,r,n,i,a,o){let s=0,l=0,u,h=0;for(const d of n){const f=e.get(d),p=f.box;u&&u!=p&&(o||Ft.models.addBox(u),l+=rt.boxMargin+u.margin),p&&p!=u&&(o||(p.x=s+l,p.y=i),l+=p.margin),f.width=Xt.getMax(f.width||rt.width,rt.width),f.height=Xt.getMax(f.height||rt.height,rt.height),f.margin=f.margin||rt.actorMargin,h=Xt.getMax(h,f.height),r.get(f.name)&&(l+=f.width/2),f.x=s+l,f.starty=Ft.getVerticalPos(),Ft.insert(f.x,i,f.x+f.width,f.height),s+=f.width+l,f.box&&(f.box.width=s+p.margin-f.box.x),l=f.margin,u=f.box,Ft.models.addActor(f)}u&&!o&&Ft.models.addBox(u),Ft.bumpVerticalPos(h)},"addActorRenderingData"),fLe=O(async function(t,e,r,n,i,a,o){if(n){let s=0;Ft.bumpVerticalPos(rt.boxMargin*2);for(const l of r){const u=e.get(l);u.stopy||(u.stopy=Ft.getVerticalPos());const h=await Wa.drawActor(t,u,rt,!0,i,a,o);s=Xt.getMax(s,h)}Ft.bumpVerticalPos(s+rt.boxMargin)}else for(const s of r){const l=e.get(s);await Wa.drawActor(t,l,rt,!1,i,a,o)}},"drawActors"),grr=O(function(t,e,r,n){let i=0,a=0;for(const o of r){const s=e.get(o),l=fni(s),u=Wa.drawPopup(t,s,l,rt,rt.forceMenus,n);u.height>i&&(i=u.height),u.width+s.x>a&&(a=u.width+s.x)}return{maxHeight:i,maxWidth:a}},"drawActorsPopup"),mrr=O(function(t){$s(rt,t),t.fontFamily&&(rt.actorFontFamily=rt.noteFontFamily=rt.messageFontFamily=t.fontFamily),t.fontSize&&(rt.actorFontSize=rt.noteFontSize=rt.messageFontSize=t.fontSize),t.fontWeight&&(rt.actorFontWeight=rt.noteFontWeight=rt.messageFontWeight=t.fontWeight)},"setConf"),Eie=O(function(t){return Ft.activations.filter(function(e){return e.actor===t})},"actorActivations"),vrr=O(function(t,e){const r=e.get(t),n=Eie(t),i=n.reduce(function(o,s){return Xt.getMin(o,s.startx)},r.x+r.width/2-1),a=n.reduce(function(o,s){return Xt.getMax(o,s.stopx)},r.x+r.width/2+1);return[i,a]},"activationBounds");function rm(t,e,r,n,i){Ft.bumpVerticalPos(r);let a=n;if(e.id&&e.message&&t[e.id]){const o=t[e.id].width,s=fk(rt);e.message=un.wrapLabel(`[${e.message}]`,o-2*rt.wrapPadding,s),e.width=o,e.wrap=!0;const l=un.calculateTextDimensions(e.message,s),u=Xt.getMax(l.height,rt.labelBoxHeight);a=n+u,ye.debug(`${u} - ${e.message}`)}i(e),Ft.bumpVerticalPos(a)}O(rm,"adjustLoopHeightForWrap");function yrr(t,e,r,n,i,a,o){function s(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]}));hni(d,f,p,v,0,y,!1);const T=await bni(y,f,A,n);Wa.insertArrowHead(d,e),Wa.insertArrowCrossHead(d,e),Wa.insertArrowFilledHead(d,e),Wa.insertSequenceNumber(d,e),Wa.insertSolidTopArrowHead(d,e),Wa.insertSolidBottomArrowHead(d,e),Wa.insertStickTopArrowHead(d,e),Wa.insertStickBottomArrowHead(d,e),o==="neo"&&Wa.insertDropShadow(d,rt);function C(z,U){const Q=Ft.endActivation(z);Q.starty+18>U&&(Q.starty=U-6,U+=12),Wa.drawActivation(d,Q,U,rt,Eie(z.from).length,n,S),Ft.insert(Q.startx,U-10,Q.stopx,U)}O(C,"activeEnd");let k=1,E=1;const _=[],P=[];let L=0;for(const z of y){let U,Q,G;switch(z.type){case n.db.LINETYPE.NOTE:Ft.resetVerticalPos(),Q=z.noteModel,await cni(d,Q,z.id);break;case n.db.LINETYPE.ACTIVE_START:Ft.newActivation(z,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION:Ft.newActivation(z,d,f);break;case n.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:Ft.newActivation(z,d,f);break;case n.db.LINETYPE.ACTIVE_END:C(z,Ft.getVerticalPos());break;case n.db.LINETYPE.LOOP_START:rm(T,z,rt.boxMargin,rt.boxMargin+rt.boxTextMargin,q=>Ft.newLoop(q));break;case n.db.LINETYPE.LOOP_END:U=Ft.endLoop(),await Wa.drawLoop(d,U,"loop",rt,z),Ft.bumpVerticalPos(U.stopy-Ft.getVerticalPos()),Ft.models.addLoop(U);break;case n.db.LINETYPE.RECT_START:rm(T,z,rt.boxMargin,rt.boxMargin,q=>{let Y=q.message;Y||(Y=(s==null?void 0:s.rectBkgColor)||(s==null?void 0:s.actorBkg)||"rgba(128, 128, 128, 0.5)"),Ft.newLoop(void 0,Y)});break;case n.db.LINETYPE.RECT_END:U=Ft.endLoop(),P.push(U),Ft.models.addLoop(U),Ft.bumpVerticalPos(U.stopy-Ft.getVerticalPos());break;case n.db.LINETYPE.OPT_START:rm(T,z,rt.boxMargin,rt.boxMargin+rt.boxTextMargin,q=>Ft.newLoop(q));break;case n.db.LINETYPE.OPT_END:U=Ft.endLoop(),await Wa.drawLoop(d,U,"opt",rt,z),Ft.bumpVerticalPos(U.stopy-Ft.getVerticalPos()),Ft.models.addLoop(U);break;case n.db.LINETYPE.ALT_START:rm(T,z,rt.boxMargin,rt.boxMargin+rt.boxTextMargin,q=>Ft.newLoop(q));break;case n.db.LINETYPE.ALT_ELSE:rm(T,z,rt.boxMargin+rt.boxTextMargin,rt.boxMargin,q=>Ft.addSectionToLoop(q));break;case n.db.LINETYPE.ALT_END:U=Ft.endLoop(),await Wa.drawLoop(d,U,"alt",rt,z),Ft.bumpVerticalPos(U.stopy-Ft.getVerticalPos()),Ft.models.addLoop(U);break;case n.db.LINETYPE.PAR_START:case n.db.LINETYPE.PAR_OVER_START:rm(T,z,rt.boxMargin,rt.boxMargin+rt.boxTextMargin,q=>Ft.newLoop(q)),Ft.saveVerticalPos();break;case n.db.LINETYPE.PAR_AND:rm(T,z,rt.boxMargin+rt.boxTextMargin,rt.boxMargin,q=>Ft.addSectionToLoop(q));break;case n.db.LINETYPE.PAR_END:U=Ft.endLoop(),await Wa.drawLoop(d,U,"par",rt,z),Ft.bumpVerticalPos(U.stopy-Ft.getVerticalPos()),Ft.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:rm(T,z,rt.boxMargin,rt.boxMargin+rt.boxTextMargin,q=>Ft.newLoop(q));break;case n.db.LINETYPE.CRITICAL_OPTION:rm(T,z,rt.boxMargin+rt.boxTextMargin,rt.boxMargin,q=>Ft.addSectionToLoop(q));break;case n.db.LINETYPE.CRITICAL_END:U=Ft.endLoop(),await Wa.drawLoop(d,U,"critical",rt,z),Ft.bumpVerticalPos(U.stopy-Ft.getVerticalPos()),Ft.models.addLoop(U);break;case n.db.LINETYPE.BREAK_START:rm(T,z,rt.boxMargin,rt.boxMargin+rt.boxTextMargin,q=>Ft.newLoop(q));break;case n.db.LINETYPE.BREAK_END:U=Ft.endLoop(),await Wa.drawLoop(d,U,"break",rt,z),Ft.bumpVerticalPos(U.stopy-Ft.getVerticalPos()),Ft.models.addLoop(U);break;default:try{G=z.msgModel,G.starty=Ft.getVerticalPos(),G.sequenceIndex=k,G.sequenceVisible=n.db.showSequenceNumbers(),G.id=z.id,G.from=z.from,G.to=z.to;const q=await prr(d,G);yrr(z,G,q,L,f,p,g),_.push({messageModel:G,lineStartY:q,msg:z}),Ft.models.addMessage(G)}catch(q){ye.error("error while drawing message",q)}}[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++}ye.debug("createdActors",p),ye.debug("destroyedActors",g),await fLe(d,f,v,!1,e,n,S);for(const z of _)await uni(d,z.messageModel,z.lineStartY,n,z.msg,e);rt.mirrorActors&&await fLe(d,f,v,!0,e,n,S),P.forEach(z=>Wa.drawBackgroundRect(d,z)),urr(d,f,v,rt);for(const z of Ft.models.boxes){z.height=Ft.getVerticalPos()-z.y,Ft.insert(z.x,z.y,z.x+z.width,z.height);const U=rt.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)",Wa.drawBox(d,z,rt)}x&&Ft.bumpVerticalPos(rt.boxMargin);const R=grr(d,f,v,h),{bounds:D}=Ft.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 o=fk(rt);let s=a.actorKeys.reduce((d,f)=>d+=t.get(f).width+(t.get(f).margin||0),0);const l=rt.boxMargin*8;s+=l,s-=2*rt.boxTextMargin,a.wrap&&(a.name=un.wrapLabel(a.name,s-2*rt.wrapPadding,o));const u=un.calculateTextDimensions(a.name,o);i=Xt.getMax(u.height,i);const h=Xt.getMax(s,u.width+2*rt.wrapPadding);if(a.margin=rt.boxTextMargin,sa.textMaxHeight=i),Xt.getMax(n,rt.height)}O(xrr,"calculateActorMargins");var pni=O(async function(t,e,r){const n=e.get(t.from),i=e.get(t.to),a=n.x,o=i.x,s=t.wrap&&t.message;let l=ps(t.message)?await p7(t.message,Ye()):un.calculateTextDimensions(s?un.wrapLabel(t.message,rt.width,CD(rt)):t.message,CD(rt));const u={width:s?rt.width:Xt.getMax(rt.width,l.width+2*rt.noteMargin),height:0,startx:n.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===r.db.PLACEMENT.RIGHTOF?(u.width=s?Xt.getMax(rt.width,l.width):Xt.getMax(n.width/2+i.width/2,l.width+2*rt.noteMargin),u.startx=a+(n.width+rt.actorMargin)/2):t.placement===r.db.PLACEMENT.LEFTOF?(u.width=s?Xt.getMax(rt.width,l.width+2*rt.noteMargin):Xt.getMax(n.width/2+i.width/2,l.width+2*rt.noteMargin),u.startx=a-u.width+(n.width-rt.actorMargin)/2):t.to===t.from?(l=un.calculateTextDimensions(s?un.wrapLabel(t.message,Xt.getMax(rt.width,n.width),CD(rt)):t.message,CD(rt)),u.width=s?Xt.getMax(rt.width,n.width):Xt.getMax(n.width,rt.width,l.width+2*rt.noteMargin),u.startx=a+(n.width-u.width)/2):(u.width=Math.abs(a+n.width/2-(o+i.width/2))+rt.actorMargin,u.startx=a2,f=O(v=>l?-v:v,"adjustValue");t.from===t.to?h=u:(t.activate&&!d&&(h+=f(rt.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,o,s],g=Math.abs(u-h);t.wrap&&t.message&&(t.message=un.wrapLabel(t.message,Xt.getMax(g+2*rt.wrapPadding,rt.width),fk(rt)));const m=un.calculateTextDimensions(t.message,fk(rt));return{width:Xt.getMax(t.wrap?0:m.width+2*rt.wrapPadding,g+2*rt.wrapPadding,rt.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"),bni=O(async function(t,e,r,n){const i={},a=[];let o,s,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&&(o=a.pop(),i[o.id]=o,i[u.id]=o,a.push(o));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:o=a.pop(),i[o.id]=o;break;case n.db.LINETYPE.ACTIVE_START:{const d=e.get(u.from?u.from:u.to.actor),f=Eie(u.from?u.from:u.to.actor).length,p=d.x+d.width/2+(f-1)*rt.activationWidth/2,g={startx:p,stopx:p+rt.activationWidth,actor:u.from,enabled:!0};Ft.activations.push(g)}break;case n.db.LINETYPE.ACTIVE_END:{const d=Ft.activations.map(f=>f.actor).lastIndexOf(u.from);Ft.activations.splice(d,1).splice(0,1)}break}u.placement!==void 0?(s=await pni(u,e,n),u.noteModel=s,a.forEach(d=>{o=d,o.from=Xt.getMin(o.from,s.startx),o.to=Xt.getMax(o.to,s.startx+s.width),o.width=Xt.getMax(o.width,Math.abs(o.from-o.to))-rt.labelBoxWidth})):(l=yni(u,e,n),u.msgModel=l,l.startx&&l.stopx&&a.length>0&&a.forEach(d=>{if(o=d,l.startx===l.stopx){const f=e.get(u.from),p=e.get(u.to);o.from=Xt.getMin(f.x-l.width/2,f.x-f.width/2,o.from),o.to=Xt.getMax(p.x+l.width/2,p.x+f.width/2,o.to),o.width=Xt.getMax(o.width,Math.abs(o.to-o.from))-rt.labelBoxWidth}else o.from=Xt.getMin(l.startx,o.from),o.to=Xt.getMax(l.stopx,o.to),o.width=Xt.getMax(o.width,l.width)-rt.labelBoxWidth}))}return Ft.activations=[],ye.debug("Loop type widths:",i),i},"calculateLoopBounds"),xni={bounds:Ft,drawActors:fLe,drawActorsPopup:grr,setConf:mrr,draw:dni},wni={parser:Eri,get db(){return new Lri},renderer:xni,styles:Iri,init:O(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,U1e({sequence:{wrap:t.wrap}}))},"init")};const Ani=Object.freeze(Object.defineProperty({__proto__:null,diagram:wni},Symbol.toStringTag,{value:"Module"}));var gLe=function(){var t=O(function(le,be,ae,K){for(ae=ae||{},K=le.length;K--;ae[le[K]]=be);return ae},"o"),e=[1,18],r=[1,19],n=[1,20],i=[1,41],a=[1,26],o=[1,42],s=[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],C=[1,43],k=[1,47],E=[1,9],_=[1,8,9],P=[1,58],L=[1,59],R=[1,60],D=[1,61],M=[1,62],I=[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],q=[1,103],Y=[1,121],ne=[1,117],X=[1,113],J=[1,119],ee=[1,114],te=[1,115],pe=[1,116],ie=[1,118],Ce=[1,120],ke=[22,50,60,61,82,86,87,88,89,90],Ee=[1,128],ue=[12,39],de=[1,8,9,39,41,44,46],xe=[1,8,9,22],ge=[1,153],ze=[1,8,9,61],we=[1,8,9,22,50,60,61,82,86,87,88,89,90],Oe={trace:O(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:O(function(be,ae,K,se,me,oe,ve){var ce=oe.length-1;switch(me){case 8:this.$=oe[ce-1];break;case 9:case 10:case 13:case 15:this.$=oe[ce];break;case 11:case 14:this.$=oe[ce-2]+"."+oe[ce];break;case 12:case 16:this.$=oe[ce-1]+oe[ce];break;case 17:case 18:this.$=oe[ce-1]+"~"+oe[ce]+"~";break;case 19:se.addRelation(oe[ce]);break;case 20:oe[ce-1].title=se.cleanupLabel(oe[ce]),se.addRelation(oe[ce-1]);break;case 31:this.$=oe[ce].trim(),se.setAccTitle(this.$);break;case 32:case 33:this.$=oe[ce].trim(),se.setAccDescription(this.$);break;case 34:se.addClassesToNamespace(oe[ce-3],oe[ce-1][0],oe[ce-1][1]),se.popNamespace();break;case 35:se.addClassesToNamespace(oe[ce-4],oe[ce-1][0],oe[ce-1][1]),se.popNamespace();break;case 36:this.$=se.addNamespace(oe[ce]);break;case 37:this.$=se.addNamespace(oe[ce-1],oe[ce]);break;case 38:this.$=[[oe[ce]],[]];break;case 39:this.$=[[oe[ce-1]],[]];break;case 40:oe[ce][0].unshift(oe[ce-2]),this.$=oe[ce];break;case 41:this.$=[[],[oe[ce]]];break;case 42:this.$=[[],[oe[ce-1]]];break;case 43:oe[ce][1].unshift(oe[ce-2]),this.$=oe[ce];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=oe[ce];break;case 48:se.setCssClass(oe[ce-2],oe[ce]);break;case 49:se.addMembers(oe[ce-3],oe[ce-1]);break;case 51:se.setCssClass(oe[ce-5],oe[ce-3]),se.addMembers(oe[ce-5],oe[ce-1]);break;case 52:se.addAnnotation(oe[ce-3],oe[ce-1]);break;case 53:se.addAnnotation(oe[ce-6],oe[ce-4]),se.addMembers(oe[ce-6],oe[ce-1]);break;case 54:se.addAnnotation(oe[ce-5],oe[ce-3]);break;case 55:this.$=oe[ce],se.addClass(oe[ce]);break;case 56:this.$=oe[ce-1],se.addClass(oe[ce-1]),se.setClassLabel(oe[ce-1],oe[ce]);break;case 60:se.addAnnotation(oe[ce],oe[ce-2]);break;case 61:case 74:this.$=[oe[ce]];break;case 62:oe[ce].push(oe[ce-1]),this.$=oe[ce];break;case 63:break;case 64:se.addMember(oe[ce-1],se.cleanupLabel(oe[ce]));break;case 65:break;case 66:break;case 67:this.$={id1:oe[ce-2],id2:oe[ce],relation:oe[ce-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:oe[ce-3],id2:oe[ce],relation:oe[ce-1],relationTitle1:oe[ce-2],relationTitle2:"none"};break;case 69:this.$={id1:oe[ce-3],id2:oe[ce],relation:oe[ce-2],relationTitle1:"none",relationTitle2:oe[ce-1]};break;case 70:this.$={id1:oe[ce-4],id2:oe[ce],relation:oe[ce-2],relationTitle1:oe[ce-3],relationTitle2:oe[ce-1]};break;case 71:this.$=se.addNote(oe[ce],oe[ce-1]);break;case 72:this.$=se.addNote(oe[ce]);break;case 73:this.$=oe[ce-2],se.defineClass(oe[ce-1],oe[ce]);break;case 75:this.$=oe[ce-2].concat([oe[ce]]);break;case 76:se.setDirection("TB");break;case 77:se.setDirection("BT");break;case 78:se.setDirection("RL");break;case 79:se.setDirection("LR");break;case 80:this.$={type1:oe[ce-2],type2:oe[ce],lineType:oe[ce-1]};break;case 81:this.$={type1:"none",type2:oe[ce],lineType:oe[ce-1]};break;case 82:this.$={type1:oe[ce-1],type2:"none",lineType:oe[ce]};break;case 83:this.$={type1:"none",type2:"none",lineType:oe[ce]};break;case 84:this.$=se.relationType.AGGREGATION;break;case 85:this.$=se.relationType.EXTENSION;break;case 86:this.$=se.relationType.COMPOSITION;break;case 87:this.$=se.relationType.DEPENDENCY;break;case 88:this.$=se.relationType.LOLLIPOP;break;case 89:this.$=se.lineType.LINE;break;case 90:this.$=se.lineType.DOTTED_LINE;break;case 91:case 97:this.$=oe[ce-2],se.setClickEvent(oe[ce-1],oe[ce]);break;case 92:case 98:this.$=oe[ce-3],se.setClickEvent(oe[ce-2],oe[ce-1]),se.setTooltip(oe[ce-2],oe[ce]);break;case 93:this.$=oe[ce-2],se.setLink(oe[ce-1],oe[ce]);break;case 94:this.$=oe[ce-3],se.setLink(oe[ce-2],oe[ce-1],oe[ce]);break;case 95:this.$=oe[ce-3],se.setLink(oe[ce-2],oe[ce-1]),se.setTooltip(oe[ce-2],oe[ce]);break;case 96:this.$=oe[ce-4],se.setLink(oe[ce-3],oe[ce-2],oe[ce]),se.setTooltip(oe[ce-3],oe[ce-1]);break;case 99:this.$=oe[ce-3],se.setClickEvent(oe[ce-2],oe[ce-1],oe[ce]);break;case 100:this.$=oe[ce-4],se.setClickEvent(oe[ce-3],oe[ce-2],oe[ce-1]),se.setTooltip(oe[ce-3],oe[ce]);break;case 101:this.$=oe[ce-3],se.setLink(oe[ce-2],oe[ce]);break;case 102:this.$=oe[ce-4],se.setLink(oe[ce-3],oe[ce-1],oe[ce]);break;case 103:this.$=oe[ce-4],se.setLink(oe[ce-3],oe[ce-1]),se.setTooltip(oe[ce-3],oe[ce]);break;case 104:this.$=oe[ce-5],se.setLink(oe[ce-4],oe[ce-2],oe[ce]),se.setTooltip(oe[ce-4],oe[ce-1]);break;case 105:this.$=oe[ce-2],se.setCssStyle(oe[ce-1],oe[ce]);break;case 106:se.setCssClass(oe[ce-1],oe[ce]);break;case 107:this.$=[oe[ce]];break;case 108:oe[ce-2].push(oe[ce]),this.$=oe[ce-2];break;case 110:this.$=oe[ce-1]+oe[ce];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:o,51:s,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:C,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:P,69:L,70:R,71:D,72:M,73:I,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:C},{16:39,17:40,19:70,60:f,86:S,100:T,102:C,103:k},{16:39,17:40,19:71,60:f,86:S,100:T,102:C,103:k},{16:39,17:40,19:72,60:f,86:S,100:T,102:C,103:k},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:f,86:S,100:T,102:C,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:C,103:k}),t(V,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:f,86:S,100:T,102:C,103:k},{16:39,17:40,19:87,60:f,86:S,100:T,102:C,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:o,51:s,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:C,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:o,51:s,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:C,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:C,103:k},{53:92,66:56,67:57,68:P,69:L,70:R,71:D,72:M,73:I,74:N},t(_,[2,64]),{67:93,73:I,74:N},t(U,[2,83],{66:94,68:P,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:o,54:u,56:h},{16:100,60:f,86:S,100:T,102:C},{41:[1,102],45:101,51:q},{16:104,60:f,86:S,100:T,102:C},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:Y,50:ne,59:110,60:X,82:J,84:111,85:112,86:ee,87:te,88:pe,89:ie,90:Ce},{60:[1,122]},{13:B,55:123},t(F,[2,72]),t(F,[2,138]),{22:Y,50:ne,59:124,60:X,61:[1,125],82:J,84:111,85:112,86:ee,87:te,88:pe,89:ie,90:Ce},t(ke,[2,74]),{16:39,17:40,19:126,60:f,86:S,100:T,102:C,103:k},t(V,[2,16]),t(V,[2,17]),t(V,[2,18]),{11:127,12:Ee,39:[2,36]},t(ue,[2,9],{16:85,17:86,15:130,18:[1,129],60:f,86:S,100:T,102:C,103:k}),t(ue,[2,10]),t(de,[2,55],{11:131,12:Ee}),t(E,[2,7]),{9:[1,132]},t(xe,[2,67]),{16:39,17:40,19:133,60:f,86:S,100:T,102:C,103:k},{13:[1,135],16:39,17:40,19:134,60:f,86:S,100:T,102:C,103:k},t(U,[2,82],{66:136,68:P,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:o,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:q},{47:[1,145]},{16:39,17:40,19:146,60:f,86:S,100:T,102:C,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(ze,[2,107],{85:154,22:Y,50:ne,60:X,82:J,86:ee,87:te,88:pe,89:ie,90:Ce}),t(we,[2,109]),t(we,[2,111]),t(we,[2,112]),t(we,[2,113]),t(we,[2,114]),t(we,[2,115]),t(we,[2,116]),t(we,[2,117]),t(we,[2,118]),t(we,[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:C,103:k},t(ue,[2,12]),t(de,[2,56]),{1:[2,4]},t(xe,[2,69]),t(xe,[2,68]),{16:39,17:40,19:158,60:f,86:S,100:T,102:C,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:o,54:u,56:h},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:i,43:23,48:o,54:u,56:h},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:i,43:23,48:o,54:u,56:h},{45:163,51:q},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:ne,60:X,82:J,84:169,85:112,86:ee,87:te,88:pe,89:ie,90:Ce},t(we,[2,110]),t(ke,[2,75]),{14:[1,170]},t(ue,[2,11]),t(xe,[2,70]),t(F,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:q},t(_,[2,96]),t(_,[2,100]),t(_,[2,102]),t(_,[2,103],{77:[1,174]}),t(ze,[2,108],{85:154,22:Y,50:ne,60:X,82:J,86:ee,87:te,88:pe,89:ie,90:Ce}),t(de,[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:O(function(be,ae){if(ae.recoverable)this.trace(be);else{var K=new Error(be);throw K.hash=ae,K}},"parseError"),parse:O(function(be){var ae=this,K=[0],se=[],me=[null],oe=[],ve=this.table,ce="",De=0,Le=0,We=2,Ne=1,je=oe.slice.call(arguments,1),$e=Object.create(this.lexer),Ze={yy:{}};for(var He in this.yy)Object.prototype.hasOwnProperty.call(this.yy,He)&&(Ze.yy[He]=this.yy[He]);$e.setInput(be,Ze.yy),Ze.yy.lexer=$e,Ze.yy.parser=this,typeof $e.yylloc>"u"&&($e.yylloc={});var et=$e.yylloc;oe.push(et);var Pe=$e.options&&$e.options.ranges;typeof Ze.yy.parseError=="function"?this.parseError=Ze.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function yt(Mt){K.length=K.length-2*Mt,me.length=me.length-Mt,oe.length=oe.length-Mt}O(yt,"popStack");function Ie(){var Mt;return Mt=se.pop()||$e.lex()||Ne,typeof Mt!="number"&&(Mt instanceof Array&&(se=Mt,Mt=se.pop()),Mt=ae.symbols_[Mt]||Mt),Mt}O(Ie,"lex");for(var St,kt,ut,Gt,It={},gt,Te,Bt,Et;;){if(kt=K[K.length-1],this.defaultActions[kt]?ut=this.defaultActions[kt]:((St===null||typeof St>"u")&&(St=Ie()),ut=ve[kt]&&ve[kt][St]),typeof ut>"u"||!ut.length||!ut[0]){var At="";Et=[];for(gt in ve[kt])this.terminals_[gt]&>>We&&Et.push("'"+this.terminals_[gt]+"'");$e.showPosition?At="Parse error on line "+(De+1)+`: `+$e.showPosition()+` Expecting `+Et.join(", ")+", got '"+(this.terminals_[St]||St)+"'":At="Parse error on line "+(De+1)+": Unexpected "+(St==Ne?"end of input":"'"+(this.terminals_[St]||St)+"'"),this.parseError(At,{text:$e.match,token:this.terminals_[St]||St,line:$e.yylineno,loc:et,expected:Et})}if(ut[0]instanceof Array&&ut.length>1)throw new Error("Parse Error: multiple actions possible at state: "+kt+", token: "+St);switch(ut[0]){case 1:K.push(St),me.push($e.yytext),oe.push($e.yylloc),K.push(ut[1]),St=null,Le=$e.yyleng,ce=$e.yytext,De=$e.yylineno,et=$e.yylloc;break;case 2:if(Te=this.productions_[ut[1]][1],It.$=me[me.length-Te],It._$={first_line:oe[oe.length-(Te||1)].first_line,last_line:oe[oe.length-1].last_line,first_column:oe[oe.length-(Te||1)].first_column,last_column:oe[oe.length-1].last_column},Pe&&(It._$.range=[oe[oe.length-(Te||1)].range[0],oe[oe.length-1].range[1]]),Gt=this.performAction.apply(It,[ce,Le,De,Ze.yy,ut[1],me,oe].concat(je)),typeof Gt<"u")return Gt;Te&&(K=K.slice(0,-1*Te*2),me=me.slice(0,-1*Te),oe=oe.slice(0,-1*Te)),K.push(this.productions_[ut[1]][0]),me.push(It.$),oe.push(It._$),Bt=ve[K[K.length-2]][K[K.length-1]],K.push(Bt);break;case 3:return!0}}return!0},"parse")},Be=function(){var le={EOF:1,parseError:O(function(ae,K){if(this.yy.parser)this.yy.parser.parseError(ae,K);else throw new Error(ae)},"parseError"),setInput:O(function(be,ae){return this.yy=ae||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:O(function(){var be=this._input[0];this.yytext+=be,this.yyleng++,this.offset++,this.match+=be,this.matched+=be;var ae=be.match(/(?:\r\n?|\n).*/g);return ae?(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:O(function(be){var ae=be.length,K=be.split(/(?:\r\n?|\n)/g);this._input=be+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-ae),this.offset-=ae;var se=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 me=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===se.length?this.yylloc.first_column:0)+se[se.length-K.length].length-K[0].length:this.yylloc.first_column-ae},this.options.ranges&&(this.yylloc.range=[me[0],me[0]+this.yyleng-ae]),this.yyleng=this.yytext.length,this},"unput"),more:O(function(){return this._more=!0,this},"more"),reject:O(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:O(function(be){this.unput(this.match.slice(be))},"less"),pastInput:O(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:O(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:O(function(){var be=this.pastInput(),ae=new Array(be.length+1).join("-");return be+this.upcomingInput()+` `+ae+"^"},"showPosition"),test_match:O(function(be,ae){var K,se,me;if(this.options.backtrack_lexer&&(me={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&&(me.yylloc.range=this.yylloc.range.slice(0))),se=be[0].match(/(?:\r\n?|\n).*/g),se&&(this.yylineno+=se.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:se?se[se.length-1].length-se[se.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+be[0].length},this.yytext+=be[0],this.match+=be[0],this.matches=be,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(be[0].length),this.matched+=be[0],K=this.performAction.call(this,this.yy,this,ae,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),K)return K;if(this._backtrack){for(var oe in me)this[oe]=me[oe];return!1}return!1},"test_match"),next:O(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var be,ae,K,se;this._more||(this.yytext="",this.match="");for(var me=this._currentRules(),oe=0;oeae[0].length)){if(ae=K,se=oe,this.options.backtrack_lexer){if(be=this.test_match(K,me[oe]),be!==!1)return be;if(this._backtrack){ae=!1;continue}else return!1}else if(!this.options.flex)break}return ae?(be=this.test_match(ae,me[se]),be!==!1?be:!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:O(function(){var ae=this.next();return ae||this.lex()},"lex"),begin:O(function(ae){this.conditionStack.push(ae)},"begin"),popState:O(function(){var ae=this.conditionStack.length-1;return ae>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(ae){return ae=this.conditionStack.length-1-Math.abs(ae||0),ae>=0?this.conditionStack[ae]:"INITIAL"},"topState"),pushState:O(function(ae){this.begin(ae)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:O(function(ae,K,se,me){switch(se){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;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 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-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])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}};return le}();Oe.lexer=Be;function Z(){this.yy={}}return O(Z,"Parser"),Z.prototype=Oe,Oe.Parser=Z,new Z}();gLe.parser=gLe;var xrr=gLe,wrr=["#","+","~","-",""],Arr=(fP=class{constructor(e,r){this.memberType=r,this.visibility="",this.classifier="",this.text="";const n=li(e,Ye());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+g2(this.id);this.memberType==="method"&&(e+=`(${g2(this.parameters.trim())})`,this.returnType&&(e+=" : "+g2(this.returnType))),e=e.trim();const r=this.parseClassifier();return{displayText:e,cssStyle:r}}parseMember(e){let r="";if(this.memberType==="method"){const a=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(a){const o=a[1]?a[1].trim():"";if(wrr.includes(o)&&(this.visibility=o),this.id=a[2],this.parameters=a[3]?a[3].trim():"",r=a[4]?a[4].trim():"",this.returnType=a[5]?a[5].trim():"",r===""){const s=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(s)&&(r=s,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const i=e.length,a=e.substring(0,1),o=e.substring(i-1);wrr.includes(a)&&(this.visibility=a),/[$*]/.exec(o)&&(r=o),this.id=e.substring(this.visibility===""?0:1,r===""?i:i-1)}this.classifier=r,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const n=`${this.visibility?"\\"+this.visibility:""}${g2(this.id)}${this.memberType==="method"?`(${g2(this.parameters)})${this.returnType?" : "+g2(this.returnType):""}`:""}`;this.text=n.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},O(fP,"ClassMember"),fP),_ie="classId-",Srr=0,pk=O(t=>Xt.sanitizeText(t,Ye()),"sanitizeText"),Trr=(Ww=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=O(e=>{const r=KEe();_t(e).select("svg").selectAll("g").filter(function(){return _t(this).attr("title")!==null}).on("mouseover",a=>{const o=_t(a.currentTarget),s=o.attr("title");if(!s)return;const l=a.currentTarget.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.html(qy.sanitize(s)).style("left",`${window.scrollX+l.left+l.width/2}px`).style("top",`${window.scrollY+l.bottom+4}px`),o.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),_t(a.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=Ba,this.getAccTitle=oo,this.setAccDescription=so,this.getAccDescription=lo,this.setDiagramTitle=co,this.getDiagramTitle=$a,this.getConfig=O(()=>Ye().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}splitClassNameAndType(e){const r=Xt.sanitizeText(e,Ye());let n="",i=r;if(r.indexOf("~")>0){const a=r.split("~");i=pk(a[0]),n=pk(a[1])}return{className:i,type:n}}setClassLabel(e,r){const n=Xt.sanitizeText(e,Ye());r&&(r=pk(r));const{className:i}=this.splitClassNameAndType(n);this.classes.get(i).label=r,this.classes.get(i).text=`${r}${this.classes.get(i).type?`<${this.classes.get(i).type}>`:""}`}addClass(e){const r=Xt.sanitizeText(e,Ye()),{className:n,type:i}=this.splitClassNameAndType(r);if(this.classes.has(n))return;const a=Xt.sanitizeText(n,Ye());this.classes.set(a,{id:a,type:i,label:a,text:`${a}${i?`<${i}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:_ie+a+"-"+Srr}),Srr++}addInterface(e,r){const n={id:`interface${this.interfaces.length}`,label:e,classId:r};this.interfaces.push(n)}setDiagramId(e){this.diagramId=e}lookUpDomId(e){const r=Xt.sanitizeText(e,Ye());if(this.classes.has(r)){const n=this.classes.get(r).domId;return this.diagramId?`${this.diagramId}-${n}`:n}throw new Error("Class not found: "+r)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",_a()}getClass(e){return this.classes.get(e)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(e){const r=typeof e=="number"?`note${e}`:e;return this.notes.get(r)}getNotes(){return this.notes}addRelation(e){ye.debug("Adding relation: "+JSON.stringify(e));const r=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];e.relation.type1===this.relationType.LOLLIPOP&&!r.includes(e.relation.type2)?(this.addClass(e.id2),this.addInterface(e.id1,e.id2),e.id1=`interface${this.interfaces.length-1}`):e.relation.type2===this.relationType.LOLLIPOP&&!r.includes(e.relation.type1)?(this.addClass(e.id1),this.addInterface(e.id2,e.id1),e.id2=`interface${this.interfaces.length-1}`):(this.addClass(e.id1),this.addClass(e.id2)),e.id1=this.splitClassNameAndType(e.id1).className,e.id2=this.splitClassNameAndType(e.id2).className,e.relationTitle1=Xt.sanitizeText(e.relationTitle1.trim(),Ye()),e.relationTitle2=Xt.sanitizeText(e.relationTitle2.trim(),Ye()),this.relations.push(e)}addAnnotation(e,r){const n=this.splitClassNameAndType(e).className;this.classes.get(n).annotations.push(r)}addMember(e,r){this.addClass(e);const n=this.splitClassNameAndType(e).className,i=this.classes.get(n);if(typeof r=="string"){const a=r.trim();a.startsWith("<<")&&a.endsWith(">>")?i.annotations.push(pk(a.substring(2,a.length-2))):a.indexOf(")")>0?i.methods.push(new Arr(a,"method")):a&&i.members.push(new Arr(a,"attribute"))}}addMembers(e,r){Array.isArray(r)&&(r.reverse(),r.forEach(n=>this.addMember(e,n)))}addNote(e,r){const n=this.notes.size,i={id:`note${n}`,class:r,text:e,index:n};return this.notes.set(i.id,i),i.id}cleanupLabel(e){return e.startsWith(":")&&(e=e.substring(1)),pk(e.trim())}setCssClass(e,r){e.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=_ie+i),i=this.splitClassNameAndType(i).className;const a=this.classes.get(i);a&&(a.cssClasses+=" "+r)})}defineClass(e,r){for(const n of e){let i=this.styleClasses.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,i)),r&&r.forEach(a=>{if(/color/.exec(a)){const o=a.replace("fill","bgFill");i.textStyles.push(o)}i.styles.push(a)}),this.classes.forEach(a=>{a.cssClasses.includes(n)&&a.styles.push(...r.flatMap(o=>o.split(",")))})}}setTooltip(e,r){e.split(",").forEach(n=>{if(r!==void 0){const i=this.splitClassNameAndType(n).className,a=this.classes.get(i);a&&(a.tooltip=pk(r))}})}getTooltip(e,r){return r&&this.namespaces.has(r)?this.namespaces.get(r).classes.get(e).tooltip:this.classes.get(e).tooltip}setLink(e,r,n){const i=Ye();e.split(",").forEach(a=>{let o=a;/\d/.exec(a[0])&&(o=_ie+o),o=this.splitClassNameAndType(o).className;const s=this.classes.get(o);s&&(s.link=un.formatUrl(r,i),i.securityLevel==="sandbox"?s.linkTarget="_top":typeof n=="string"?s.linkTarget=pk(n):s.linkTarget="_blank")}),this.setCssClass(e,"clickable")}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFunc(i,r,n);const a=this.splitClassNameAndType(i).className,o=this.classes.get(a);o&&(o.haveCallback=!0)}),this.setCssClass(e,"clickable")}setClickFunc(e,r,n){const i=Xt.sanitizeText(e,Ye());if(Ye().securityLevel!=="loose"||r===void 0)return;const o=this.splitClassNameAndType(i).className;if(this.classes.has(o)){let s=[];if(typeof n=="string"){s=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l{const l=this.lookUpDomId(o),u=document.querySelector(`[id="${l}"]`);u!==null&&u.addEventListener("click",()=>{un.runFunc(r,...s)},!1)})}}bindFunctions(e){this.functions.forEach(r=>{r(e)})}escapeHtml(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(e){this.direction=e}static resolveQualifiedId(e,r){const n=r.at(-1);return n?`${n}.${e}`:e}static getAncestorIds(e){const r=e.split("."),n=new Array(r.length);n[0]=r[0];for(let i=1;i0?a[o-1]:void 0,u=o===a.length-1,h=u&&r?r:i[o];this.namespaces.has(s)?u&&(this.namespaces.get(s).explicit=!0):this.namespaces.set(s,this.createNamespaceNode(s,h,l,u)),l&&this.linkParentChild(l,s)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(e){return this.namespaces.get(e)}getNamespaces(){return this.namespaces}addClassesToNamespace(e,r,n){if(this.namespaces.has(e)){for(const i of r){const{className:a}=this.splitClassNameAndType(i),o=this.getClass(a);o.parent=e,this.namespaces.get(e).classes.set(a,o)}for(const i of n){const a=this.getNote(i);a.parent=e,this.namespaces.get(e).notes.set(i,a)}}}setCssStyle(e,r){const n=this.classes.get(e);if(!(!r||!n))for(const i of r)i.includes(",")?n.styles.push(...i.split(",")):n.styles.push(i)}getArrowMarker(e){let r;switch(e){case 0:r="aggregation";break;case 1:r="extension";break;case 2:r="composition";break;case 3:r="dependency";break;case 4:r="lollipop";break;default:r="none"}return r}resolveExplicitAncestor(e){let r=e;for(;r;){const n=this.namespaces.get(r);if(!n)return;if(n.explicit)return r;r=n.parent}}getData(){var o,s;const e=[],r=[],n=Ye(),i=((o=n.class)==null?void 0:o.hierarchicalNamespaces)??!0;for(const l of this.namespaces.values()){if(!i&&!l.explicit)continue;const u={id:l.id,label:i?l.label:l.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:[],look:n.look,parentId:i?l.parent:void 0};e.push(u)}for(const l of this.classes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={...l,type:void 0,isGroup:!1,parentId:u,look:n.look};e.push(h)}for(const l of this.notes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={id:l.id,label:l.text,isGroup:!1,shape:"note",padding:n.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:u,labelType:"markdown"};e.push(h);const d=(s=this.classes.get(l.class))==null?void 0:s.id;if(d){const f={id:`edgeNote${l.index}`,start:l.id,end:d,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};r.push(f)}}for(const l of this.interfaces){const u={id:l.id,label:l.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};e.push(u)}let a=0;for(const l of this.relations){a++;const u={id:SR(l.id1,l.id2,{prefix:"id",counter:a}),start:l.id1,end:l.id2,type:"normal",label:l.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(l.relation.type1),arrowTypeEnd:this.getArrowMarker(l.relation.type2),startLabelRight:l.relationTitle1==="none"?"":l.relationTitle1,endLabelLeft:l.relationTitle2==="none"?"":l.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:l.style||"",pattern:l.relation.lineType==1?"dashed":"solid",look:n.look,labelType:"markdown"};r.push(u)}return{nodes:e,edges:r,other:{},config:n,direction:this.getDirection()}}},O(Ww,"ClassDB"),Ww),wni=O(t=>`g.classGroup text { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:O(function(){var ae=this.next();return ae||this.lex()},"lex"),begin:O(function(ae){this.conditionStack.push(ae)},"begin"),popState:O(function(){var ae=this.conditionStack.length-1;return ae>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(ae){return ae=this.conditionStack.length-1-Math.abs(ae||0),ae>=0?this.conditionStack[ae]:"INITIAL"},"topState"),pushState:O(function(ae){this.begin(ae)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:O(function(ae,K,se,me){switch(se){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin("acc_title"),33;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),35;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 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return"EDGE_STATE";case 18:this.begin("callback_name");break;case 19:this.popState();break;case 20:this.popState(),this.begin("callback_args");break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return"STR";case 26:this.begin("string");break;case 27:return 82;case 28:return 57;case 29:return this.begin("namespace"),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin("namespace-body"),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return"EOF_IN_STRUCT";case 36:return 8;case 37:break;case 38:return"EDGE_STATE";case 39:return this.begin("class"),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin("class-body"),39;case 44:return this.popState(),41;case 45:return"EOF_IN_STRUCT";case 46:return"EDGE_STATE";case 47:return"OPEN_IN_STRUCT";case 48:break;case 49:return"MEMBER";case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return"GENERICTYPE";case 61:this.begin("generic");break;case 62:this.popState();break;case 63:return"BQUOTE_STR";case 64:this.begin("bqstring");break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return"PLUS";case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return"EQUALS";case 89:return"EQUALS";case 90:return 60;case 91:return 12;case 92:return 14;case 93:return"PUNCTUATION";case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},"anonymous"),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-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])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}};return le}();Oe.lexer=Be;function Z(){this.yy={}}return O(Z,"Parser"),Z.prototype=Oe,Oe.Parser=Z,new Z}();gLe.parser=gLe;var Arr=gLe,Srr=["#","+","~","-",""],Trr=(fP=class{constructor(e,r){this.memberType=r,this.visibility="",this.classifier="",this.text="";const n=li(e,Ye());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+g2(this.id);this.memberType==="method"&&(e+=`(${g2(this.parameters.trim())})`,this.returnType&&(e+=" : "+g2(this.returnType))),e=e.trim();const r=this.parseClassifier();return{displayText:e,cssStyle:r}}parseMember(e){let r="";if(this.memberType==="method"){const a=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(a){const o=a[1]?a[1].trim():"";if(Srr.includes(o)&&(this.visibility=o),this.id=a[2],this.parameters=a[3]?a[3].trim():"",r=a[4]?a[4].trim():"",this.returnType=a[5]?a[5].trim():"",r===""){const s=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(s)&&(r=s,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{const i=e.length,a=e.substring(0,1),o=e.substring(i-1);Srr.includes(a)&&(this.visibility=a),/[$*]/.exec(o)&&(r=o),this.id=e.substring(this.visibility===""?0:1,r===""?i:i-1)}this.classifier=r,this.id=this.id.startsWith(" ")?" "+this.id.trim():this.id.trim();const n=`${this.visibility?"\\"+this.visibility:""}${g2(this.id)}${this.memberType==="method"?`(${g2(this.parameters)})${this.returnType?" : "+g2(this.returnType):""}`:""}`;this.text=n.replaceAll("<","<").replaceAll(">",">"),this.text.startsWith("\\<")&&(this.text=this.text.replace("\\<","~"))}parseClassifier(){switch(this.classifier){case"*":return"font-style:italic;";case"$":return"text-decoration:underline;";default:return""}}},O(fP,"ClassMember"),fP),_ie="classId-",Crr=0,pk=O(t=>Xt.sanitizeText(t,Ye()),"sanitizeText"),Orr=(Ww=class{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=O(e=>{const r=KEe();_t(e).select("svg").selectAll("g").filter(function(){return _t(this).attr("title")!==null}).on("mouseover",a=>{const o=_t(a.currentTarget),s=o.attr("title");if(!s)return;const l=a.currentTarget.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.html(qy.sanitize(s)).style("left",`${window.scrollX+l.left+l.width/2}px`).style("top",`${window.scrollY+l.bottom+4}px`),o.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),_t(a.currentTarget).classed("hover",!1)})},"setupToolTips"),this.direction="TB",this.setAccTitle=Ba,this.getAccTitle=oo,this.setAccDescription=so,this.getAccDescription=lo,this.setDiagramTitle=co,this.getDiagramTitle=$a,this.getConfig=O(()=>Ye().class,"getConfig"),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}splitClassNameAndType(e){const r=Xt.sanitizeText(e,Ye());let n="",i=r;if(r.indexOf("~")>0){const a=r.split("~");i=pk(a[0]),n=pk(a[1])}return{className:i,type:n}}setClassLabel(e,r){const n=Xt.sanitizeText(e,Ye());r&&(r=pk(r));const{className:i}=this.splitClassNameAndType(n);this.classes.get(i).label=r,this.classes.get(i).text=`${r}${this.classes.get(i).type?`<${this.classes.get(i).type}>`:""}`}addClass(e){const r=Xt.sanitizeText(e,Ye()),{className:n,type:i}=this.splitClassNameAndType(r);if(this.classes.has(n))return;const a=Xt.sanitizeText(n,Ye());this.classes.set(a,{id:a,type:i,label:a,text:`${a}${i?`<${i}>`:""}`,shape:"classBox",cssClasses:"default",methods:[],members:[],annotations:[],styles:[],domId:_ie+a+"-"+Crr}),Crr++}addInterface(e,r){const n={id:`interface${this.interfaces.length}`,label:e,classId:r};this.interfaces.push(n)}setDiagramId(e){this.diagramId=e}lookUpDomId(e){const r=Xt.sanitizeText(e,Ye());if(this.classes.has(r)){const n=this.classes.get(r).domId;return this.diagramId?`${this.diagramId}-${n}`:n}throw new Error("Class not found: "+r)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId="",this.direction="TB",_a()}getClass(e){return this.classes.get(e)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(e){const r=typeof e=="number"?`note${e}`:e;return this.notes.get(r)}getNotes(){return this.notes}addRelation(e){ye.debug("Adding relation: "+JSON.stringify(e));const r=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];e.relation.type1===this.relationType.LOLLIPOP&&!r.includes(e.relation.type2)?(this.addClass(e.id2),this.addInterface(e.id1,e.id2),e.id1=`interface${this.interfaces.length-1}`):e.relation.type2===this.relationType.LOLLIPOP&&!r.includes(e.relation.type1)?(this.addClass(e.id1),this.addInterface(e.id2,e.id1),e.id2=`interface${this.interfaces.length-1}`):(this.addClass(e.id1),this.addClass(e.id2)),e.id1=this.splitClassNameAndType(e.id1).className,e.id2=this.splitClassNameAndType(e.id2).className,e.relationTitle1=Xt.sanitizeText(e.relationTitle1.trim(),Ye()),e.relationTitle2=Xt.sanitizeText(e.relationTitle2.trim(),Ye()),this.relations.push(e)}addAnnotation(e,r){const n=this.splitClassNameAndType(e).className;this.classes.get(n).annotations.push(r)}addMember(e,r){this.addClass(e);const n=this.splitClassNameAndType(e).className,i=this.classes.get(n);if(typeof r=="string"){const a=r.trim();a.startsWith("<<")&&a.endsWith(">>")?i.annotations.push(pk(a.substring(2,a.length-2))):a.indexOf(")")>0?i.methods.push(new Trr(a,"method")):a&&i.members.push(new Trr(a,"attribute"))}}addMembers(e,r){Array.isArray(r)&&(r.reverse(),r.forEach(n=>this.addMember(e,n)))}addNote(e,r){const n=this.notes.size,i={id:`note${n}`,class:r,text:e,index:n};return this.notes.set(i.id,i),i.id}cleanupLabel(e){return e.startsWith(":")&&(e=e.substring(1)),pk(e.trim())}setCssClass(e,r){e.split(",").forEach(n=>{let i=n;/\d/.exec(n[0])&&(i=_ie+i),i=this.splitClassNameAndType(i).className;const a=this.classes.get(i);a&&(a.cssClasses+=" "+r)})}defineClass(e,r){for(const n of e){let i=this.styleClasses.get(n);i===void 0&&(i={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,i)),r&&r.forEach(a=>{if(/color/.exec(a)){const o=a.replace("fill","bgFill");i.textStyles.push(o)}i.styles.push(a)}),this.classes.forEach(a=>{a.cssClasses.includes(n)&&a.styles.push(...r.flatMap(o=>o.split(",")))})}}setTooltip(e,r){e.split(",").forEach(n=>{if(r!==void 0){const i=this.splitClassNameAndType(n).className,a=this.classes.get(i);a&&(a.tooltip=pk(r))}})}getTooltip(e,r){return r&&this.namespaces.has(r)?this.namespaces.get(r).classes.get(e).tooltip:this.classes.get(e).tooltip}setLink(e,r,n){const i=Ye();e.split(",").forEach(a=>{let o=a;/\d/.exec(a[0])&&(o=_ie+o),o=this.splitClassNameAndType(o).className;const s=this.classes.get(o);s&&(s.link=un.formatUrl(r,i),i.securityLevel==="sandbox"?s.linkTarget="_top":typeof n=="string"?s.linkTarget=pk(n):s.linkTarget="_blank")}),this.setCssClass(e,"clickable")}setClickEvent(e,r,n){e.split(",").forEach(i=>{this.setClickFunc(i,r,n);const a=this.splitClassNameAndType(i).className,o=this.classes.get(a);o&&(o.haveCallback=!0)}),this.setCssClass(e,"clickable")}setClickFunc(e,r,n){const i=Xt.sanitizeText(e,Ye());if(Ye().securityLevel!=="loose"||r===void 0)return;const o=this.splitClassNameAndType(i).className;if(this.classes.has(o)){let s=[];if(typeof n=="string"){s=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l{const l=this.lookUpDomId(o),u=document.querySelector(`[id="${l}"]`);u!==null&&u.addEventListener("click",()=>{un.runFunc(r,...s)},!1)})}}bindFunctions(e){this.functions.forEach(r=>{r(e)})}escapeHtml(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}getDirection(){return this.direction}setDirection(e){this.direction=e}static resolveQualifiedId(e,r){const n=r.at(-1);return n?`${n}.${e}`:e}static getAncestorIds(e){const r=e.split("."),n=new Array(r.length);n[0]=r[0];for(let i=1;i0?a[o-1]:void 0,u=o===a.length-1,h=u&&r?r:i[o];this.namespaces.has(s)?u&&(this.namespaces.get(s).explicit=!0):this.namespaces.set(s,this.createNamespaceNode(s,h,l,u)),l&&this.linkParentChild(l,s)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(e){return this.namespaces.get(e)}getNamespaces(){return this.namespaces}addClassesToNamespace(e,r,n){if(this.namespaces.has(e)){for(const i of r){const{className:a}=this.splitClassNameAndType(i),o=this.getClass(a);o.parent=e,this.namespaces.get(e).classes.set(a,o)}for(const i of n){const a=this.getNote(i);a.parent=e,this.namespaces.get(e).notes.set(i,a)}}}setCssStyle(e,r){const n=this.classes.get(e);if(!(!r||!n))for(const i of r)i.includes(",")?n.styles.push(...i.split(",")):n.styles.push(i)}getArrowMarker(e){let r;switch(e){case 0:r="aggregation";break;case 1:r="extension";break;case 2:r="composition";break;case 3:r="dependency";break;case 4:r="lollipop";break;default:r="none"}return r}resolveExplicitAncestor(e){let r=e;for(;r;){const n=this.namespaces.get(r);if(!n)return;if(n.explicit)return r;r=n.parent}}getData(){var o,s;const e=[],r=[],n=Ye(),i=((o=n.class)==null?void 0:o.hierarchicalNamespaces)??!0;for(const l of this.namespaces.values()){if(!i&&!l.explicit)continue;const u={id:l.id,label:i?l.label:l.id,isGroup:!0,padding:n.class.padding??16,shape:"rect",cssStyles:[],look:n.look,parentId:i?l.parent:void 0};e.push(u)}for(const l of this.classes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={...l,type:void 0,isGroup:!1,parentId:u,look:n.look};e.push(h)}for(const l of this.notes.values()){const u=i?l.parent:this.resolveExplicitAncestor(l.parent),h={id:l.id,label:l.text,isGroup:!1,shape:"note",padding:n.class.padding??6,cssStyles:["text-align: left","white-space: nowrap",`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:u,labelType:"markdown"};e.push(h);const d=(s=this.classes.get(l.class))==null?void 0:s.id;if(d){const f={id:`edgeNote${l.index}`,start:l.id,end:d,type:"normal",thickness:"normal",classes:"relation",arrowTypeStart:"none",arrowTypeEnd:"none",arrowheadStyle:"",labelStyle:[""],style:["fill: none"],pattern:"dotted",look:n.look};r.push(f)}}for(const l of this.interfaces){const u={id:l.id,label:l.label,isGroup:!1,shape:"rect",cssStyles:["opacity: 0;"],look:n.look};e.push(u)}let a=0;for(const l of this.relations){a++;const u={id:SR(l.id1,l.id2,{prefix:"id",counter:a}),start:l.id1,end:l.id2,type:"normal",label:l.title,labelpos:"c",thickness:"normal",classes:"relation",arrowTypeStart:this.getArrowMarker(l.relation.type1),arrowTypeEnd:this.getArrowMarker(l.relation.type2),startLabelRight:l.relationTitle1==="none"?"":l.relationTitle1,endLabelLeft:l.relationTitle2==="none"?"":l.relationTitle2,arrowheadStyle:"",labelStyle:["display: inline-block"],style:l.style||"",pattern:l.relation.lineType==1?"dashed":"solid",look:n.look,labelType:"markdown"};r.push(u)}return{nodes:e,edges:r,other:{},config:n,direction:this.getDirection()}}},O(Ww,"ClassDB"),Ww),Sni=O(t=>`g.classGroup text { fill: ${t.nodeBorder||t.classText}; stroke: none; font-family: ${t.fontFamily}; @@ -2660,12 +2660,12 @@ g.classGroup line { text-align: center; } ${T9()} -`,"getStyles"),Crr=wni,Ani=O((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"),Sni=O(function(t,e){return e.db.getClasses()},"getClasses"),Tni=O(async function(t,e,r,n){ye.info("REF0:"),ye.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:a,layout:o}=Ye();n.db.setDiagramId(e);const s=n.db.getData(),l=m3(e,i);s.type=n.type,s.layoutAlgorithm=u$(o),s.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,s.rankSpacing=(a==null?void 0:a.rankSpacing)||50,s.markers=["aggregation","extension","composition","dependency","lollipop"],s.diagramId=e,await RR(s,l);const u=8;un.insertTitle(l,"classDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),nO(l,u,"classDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Orr={getClasses:Sni,draw:Tni,getDir:Ani},Cni={parser:xrr,get db(){return new Trr},renderer:Orr,styles:Crr,init:O(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Oni=Object.freeze(Object.defineProperty({__proto__:null,diagram:Cni},Symbol.toStringTag,{value:"Module"}));var kni={parser:xrr,get db(){return new Trr},renderer:Orr,styles:Crr,init:O(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Eni=Object.freeze(Object.defineProperty({__proto__:null,diagram:kni},Symbol.toStringTag,{value:"Module"}));var mLe=function(){var t=O(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],o=[1,11],s=[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],C=[1,35],k=[1,36],E=[1,37],_=[1,38],P=[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:O(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:O(function(B,V,z,U,Q,G,q){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 te=U.trimColon(G[Y]);this.$={stmt:"relation",state1:G[Y-3],state2:G[Y-1],description:te};break;case 19:this.$={stmt:"state",id:G[Y-3],type:"default",description:"",doc:G[Y-1]};break;case 20:var ne=G[Y],X=G[Y-2].trim();if(G[Y].match(":")){var J=G[Y].split(":");ne=J[0],X=[X,J[1]]}this.$={stmt:"state",id:ne,type:"default",description:X};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:o,8:8,9:10,10:12,11:13,12:14,13:15,16:s,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:C,52:k,53:E,54:_,57:P},t(L,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:s,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:C,52:k,53:E,54:_,57:P},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:P},{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:P},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:o,8:8,9:10,10:12,11:13,12:14,13:15,16:s,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:C,52:k,53:E,54:_,57:P},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:o,8:8,9:10,10:12,11:13,12:14,13:15,16:s,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:C,52:k,53:E,54:_,57:P},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:O(function(B,V){if(V.recoverable)this.trace(B);else{var z=new Error(B);throw z.hash=V,z}},"parseError"),parse:O(function(B){var V=this,z=[0],U=[],Q=[null],G=[],q=this.table,Y="",ne=0,X=0,J=2,ee=1,te=G.slice.call(arguments,1),pe=Object.create(this.lexer),ie={yy:{}};for(var Ce in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ce)&&(ie.yy[Ce]=this.yy[Ce]);pe.setInput(B,ie.yy),ie.yy.lexer=pe,ie.yy.parser=this,typeof pe.yylloc>"u"&&(pe.yylloc={});var ke=pe.yylloc;G.push(ke);var Ee=pe.options&&pe.options.ranges;typeof ie.yy.parseError=="function"?this.parseError=ie.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(K){z.length=z.length-2*K,Q.length=Q.length-K,G.length=G.length-K}O(ue,"popStack");function de(){var K;return K=U.pop()||pe.lex()||ee,typeof K!="number"&&(K instanceof Array&&(U=K,K=U.pop()),K=V.symbols_[K]||K),K}O(de,"lex");for(var xe,ge,ze,we,Oe={},Be,Z,le,be;;){if(ge=z[z.length-1],this.defaultActions[ge]?ze=this.defaultActions[ge]:((xe===null||typeof xe>"u")&&(xe=de()),ze=q[ge]&&q[ge][xe]),typeof ze>"u"||!ze.length||!ze[0]){var ae="";be=[];for(Be in q[ge])this.terminals_[Be]&&Be>J&&be.push("'"+this.terminals_[Be]+"'");pe.showPosition?ae="Parse error on line "+(ne+1)+`: +`,"getStyles"),krr=Sni,Tni=O((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"),Cni=O(function(t,e){return e.db.getClasses()},"getClasses"),Oni=O(async function(t,e,r,n){ye.info("REF0:"),ye.info("Drawing class diagram (v3)",e);const{securityLevel:i,state:a,layout:o}=Ye();n.db.setDiagramId(e);const s=n.db.getData(),l=m3(e,i);s.type=n.type,s.layoutAlgorithm=u$(o),s.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,s.rankSpacing=(a==null?void 0:a.rankSpacing)||50,s.markers=["aggregation","extension","composition","dependency","lollipop"],s.diagramId=e,await RR(s,l);const u=8;un.insertTitle(l,"classDiagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),nO(l,u,"classDiagram",(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Err={getClasses:Cni,draw:Oni,getDir:Tni},kni={parser:Arr,get db(){return new Orr},renderer:Err,styles:krr,init:O(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Eni=Object.freeze(Object.defineProperty({__proto__:null,diagram:kni},Symbol.toStringTag,{value:"Module"}));var _ni={parser:Arr,get db(){return new Orr},renderer:Err,styles:krr,init:O(t=>{t.class||(t.class={}),t.class.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const Rni=Object.freeze(Object.defineProperty({__proto__:null,diagram:_ni},Symbol.toStringTag,{value:"Module"}));var mLe=function(){var t=O(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],o=[1,11],s=[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],C=[1,35],k=[1,36],E=[1,37],_=[1,38],P=[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:O(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:O(function(B,V,z,U,Q,G,q){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 te=U.trimColon(G[Y]);this.$={stmt:"relation",state1:G[Y-3],state2:G[Y-1],description:te};break;case 19:this.$={stmt:"state",id:G[Y-3],type:"default",description:"",doc:G[Y-1]};break;case 20:var ne=G[Y],X=G[Y-2].trim();if(G[Y].match(":")){var J=G[Y].split(":");ne=J[0],X=[X,J[1]]}this.$={stmt:"state",id:ne,type:"default",description:X};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:o,8:8,9:10,10:12,11:13,12:14,13:15,16:s,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:C,52:k,53:E,54:_,57:P},t(L,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:s,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:C,52:k,53:E,54:_,57:P},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:P},{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:P},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:o,8:8,9:10,10:12,11:13,12:14,13:15,16:s,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:C,52:k,53:E,54:_,57:P},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:o,8:8,9:10,10:12,11:13,12:14,13:15,16:s,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:C,52:k,53:E,54:_,57:P},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:O(function(B,V){if(V.recoverable)this.trace(B);else{var z=new Error(B);throw z.hash=V,z}},"parseError"),parse:O(function(B){var V=this,z=[0],U=[],Q=[null],G=[],q=this.table,Y="",ne=0,X=0,J=2,ee=1,te=G.slice.call(arguments,1),pe=Object.create(this.lexer),ie={yy:{}};for(var Ce in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ce)&&(ie.yy[Ce]=this.yy[Ce]);pe.setInput(B,ie.yy),ie.yy.lexer=pe,ie.yy.parser=this,typeof pe.yylloc>"u"&&(pe.yylloc={});var ke=pe.yylloc;G.push(ke);var Ee=pe.options&&pe.options.ranges;typeof ie.yy.parseError=="function"?this.parseError=ie.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(K){z.length=z.length-2*K,Q.length=Q.length-K,G.length=G.length-K}O(ue,"popStack");function de(){var K;return K=U.pop()||pe.lex()||ee,typeof K!="number"&&(K instanceof Array&&(U=K,K=U.pop()),K=V.symbols_[K]||K),K}O(de,"lex");for(var xe,ge,ze,we,Oe={},Be,Z,le,be;;){if(ge=z[z.length-1],this.defaultActions[ge]?ze=this.defaultActions[ge]:((xe===null||typeof xe>"u")&&(xe=de()),ze=q[ge]&&q[ge][xe]),typeof ze>"u"||!ze.length||!ze[0]){var ae="";be=[];for(Be in q[ge])this.terminals_[Be]&&Be>J&&be.push("'"+this.terminals_[Be]+"'");pe.showPosition?ae="Parse error on line "+(ne+1)+`: `+pe.showPosition()+` Expecting `+be.join(", ")+", got '"+(this.terminals_[xe]||xe)+"'":ae="Parse error on line "+(ne+1)+": Unexpected "+(xe==ee?"end of input":"'"+(this.terminals_[xe]||xe)+"'"),this.parseError(ae,{text:pe.match,token:this.terminals_[xe]||xe,line:pe.yylineno,loc:ke,expected:be})}if(ze[0]instanceof Array&&ze.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ge+", token: "+xe);switch(ze[0]){case 1:z.push(xe),Q.push(pe.yytext),G.push(pe.yylloc),z.push(ze[1]),xe=null,X=pe.yyleng,Y=pe.yytext,ne=pe.yylineno,ke=pe.yylloc;break;case 2:if(Z=this.productions_[ze[1]][1],Oe.$=Q[Q.length-Z],Oe._$={first_line:G[G.length-(Z||1)].first_line,last_line:G[G.length-1].last_line,first_column:G[G.length-(Z||1)].first_column,last_column:G[G.length-1].last_column},Ee&&(Oe._$.range=[G[G.length-(Z||1)].range[0],G[G.length-1].range[1]]),we=this.performAction.apply(Oe,[Y,X,ne,ie.yy,ze[1],Q,G].concat(te)),typeof we<"u")return we;Z&&(z=z.slice(0,-1*Z*2),Q=Q.slice(0,-1*Z),G=G.slice(0,-1*Z)),z.push(this.productions_[ze[1]][0]),Q.push(Oe.$),G.push(Oe._$),le=q[z[z.length-2]][z[z.length-1]],z.push(le);break;case 3:return!0}}return!0},"parse")},I=function(){var F={EOF:1,parseError:O(function(V,z){if(this.yy.parser)this.yy.parser.parseError(V,z);else throw new Error(V)},"parseError"),setInput:O(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:O(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:O(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:O(function(){return this._more=!0,this},"more"),reject:O(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:O(function(B){this.unput(this.match.slice(B))},"less"),pastInput:O(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:O(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:O(function(){var B=this.pastInput(),V=new Array(B.length+1).join("-");return B+this.upcomingInput()+` `+V+"^"},"showPosition"),test_match:O(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:O(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:O(function(){var V=this.next();return V||this.lex()},"lex"),begin:O(function(V){this.conditionStack.push(V)},"begin"),popState:O(function(){var V=this.conditionStack.length-1;return V>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(V){return V=this.conditionStack.length-1-Math.abs(V||0),V>=0?this.conditionStack[V]:"INITIAL"},"topState"),pushState:O(function(V){this.begin(V)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(function(V,z,U,Q){function G(){const q=z.yytext.indexOf("%%");if(q===0)return!1;if(q>0){const Y=z.yytext.slice(0,q),ne=z.yytext.slice(q);ne&&V.lexer.unput(ne),z.yytext=Y}return!0}switch(O(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=I;function N(){this.yy={}}return O(N,"Parser"),N.prototype=M,M.Parser=N,new N}();mLe.parser=mLe;var krr=mLe,_ni="TB",Err="TB",_rr="dir",OD="state",kD="root",vLe="relation",Rni="classDef",Dni="style",Lni="applyClass",aU="default",Rrr="divider",Drr="fill:none",Lrr="fill: #333",Mrr="c",Irr="markdown",Prr="normal",yLe="rect",bLe="rectWithTitle",Mni="stateStart",Ini="stateEnd",Nrr="divider",Brr="roundedWithTitle",Pni="note",Nni="noteGroup",oU="statediagram",Bni="state",$ni=`${oU}-${Bni}`,$rr="transition",Fni="note",zni="note-edge",Uni=`${$rr} ${zni}`,Vni=`${oU}-${Fni}`,Qni="cluster",Gni=`${oU}-${Qni}`,Hni="cluster-alt",Wni=`${oU}-${Hni}`,Frr="parent",zrr="note",Yni="state",xLe="----",qni=`${xLe}${zrr}`,Urr=`${xLe}${Frr}`,Vrr=O((t,e=Err)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),jni=O(function(t,e){return e.db.getClasses()},"getClasses"),Xni=O(async function(t,e,r,n){ye.info("REF0:"),ye.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:o}=Ye();n.db.extract(n.db.getRootDocV2());const s=n.db.getData(),l=m3(e,i);s.type=n.type,s.layoutAlgorithm=o,s.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,s.rankSpacing=(a==null?void 0:a.rankSpacing)||50,Ye().look==="neo"?s.markers=["barbNeo"]:s.markers=["barb"],s.diagramId=e,await RR(s,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=s.nodes.find(S=>S.id===g);if(!g){ye.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 C;const T=(C=S.textContent)==null?void 0:C.trim();(S.id===(m==null?void 0:m.domId)||T===g)&&(y=S)}),!y){ye.warn("⚠️ Could not find node matching text:",g);return}const b=y.parentNode;if(!b){ye.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),ye.info("🔗 Wrapped node in
tag for:",g,f.url)})}catch(d){ye.error("❌ Error injecting clickable links:",d)}un.insertTitle(l,"statediagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),nO(l,h,oU,(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Kni={getClasses:jni,draw:Xni,getDir:Vrr},Rie=new Map,zw=0;function Die(t="",e=0,r="",n=xLe){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${Yni}-${t}${i}-${e}`}O(Die,"stateDomId");var Zni=O((t,e,r,n,i,a,o,s)=>{ye.trace("items",e),e.forEach(l=>{switch(l.stmt){case OD:lU(t,l,r,n,i,a,o,s);break;case aU:lU(t,l,r,n,i,a,o,s);break;case vLe:{lU(t,l.state1,r,n,i,a,o,s),lU(t,l.state2,r,n,i,a,o,s);const u=o==="neo",h={id:"edge"+zw,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:Drr,labelStyle:"",label:Xt.sanitizeText(l.description??"",Ye()),arrowheadStyle:Lrr,labelpos:Mrr,labelType:Irr,thickness:Prr,classes:$rr,look:o};i.push(h),zw++}break}})},"setupDoc"),Qrr=O((t,e=Err)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function sU(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)}O(sU,"insertOrUpdateNode");function Grr(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}O(Grr,"getClassesFromDbInfo");function Hrr(t){return(t==null?void 0:t.styles)??[]}O(Hrr,"getStylesFromDbInfo");var lU=O((t,e,r,n,i,a,o,s)=>{var p,g,m;const l=e.id,u=r.get(l),h=Grr(u),d=Hrr(u),f=Ye();if(ye.info("dataFetcher parsedItem",e,u,d),l!=="root"){let v=yLe;e.start===!0?v=Mni:e.start===!1&&(v=Ini),e.type!==aU&&(v=e.type),Rie.get(l)||Rie.set(l,{id:l,shape:v,description:Xt.sanitizeText(l,f),cssClasses:`${h} ${$ni}`,cssStyles:d});const y=Rie.get(l);e.description&&(Array.isArray(y.description)?(y.shape=bLe,y.description.push(e.description)):(p=y.description)!=null&&p.length&&y.description.length>0?(y.shape=bLe,y.description===l?y.description=[e.description]:y.description=[y.description,e.description]):(y.shape=yLe,y.description=e.description),y.description=Xt.sanitizeTextOrArray(y.description,f)),((g=y.description)==null?void 0:g.length)===1&&y.shape===bLe&&(y.type==="group"?y.shape=Brr:y.shape=yLe),!y.type&&e.doc&&(ye.info("Setting cluster for XCX",l,Qrr(e)),y.type="group",y.isGroup=!0,y.dir=Qrr(e),y.explicitDir=e.doc.some(x=>x.stmt==="dir"),y.shape=e.type===Rrr?Nrr:Brr,y.cssClasses=`${y.cssClasses} ${Gni} ${a?Wni:""}`);const b={labelStyle:"",shape:y.shape,label:y.description,cssClasses:y.cssClasses,cssCompiledStyles:[],cssStyles:y.cssStyles,id:l,dir:y.dir,domId:Die(l,zw),type:y.type,isGroup:y.type==="group",padding:8,rx:10,ry:10,look:o,labelType:"markdown"};if(b.shape===Nrr&&(b.label=""),t&&t.id!=="root"&&(ye.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:Pni,label:e.note.text,labelType:"markdown",cssClasses:Vni,cssStyles:[],cssCompiledStyles:[],id:l+qni+"-"+zw,domId:Die(l,zw,zrr),type:y.type,isGroup:y.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:o,position:e.note.position},w=l+Urr,A={labelStyle:"",shape:Nni,label:e.note.text,cssClasses:y.cssClasses,cssStyles:[],id:l+Urr,domId:Die(l,zw,Frr),type:"group",isGroup:!0,padding:16,look:o,position:e.note.position};zw++,A.id=w,x.parentId=w,sU(n,A,s),sU(n,x,s),sU(n,b,s);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:Drr,labelStyle:"",classes:Uni,arrowheadStyle:Lrr,labelpos:Mrr,labelType:Irr,thickness:Prr,look:o})}else sU(n,b,s)}e.doc&&(ye.trace("Adding nodes children "),Zni(e,e.doc,r,n,i,!a,o,s))},"dataFetcher"),Jni=O(()=>{Rie.clear(),zw=0},"reset"),yh={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Wrr=O(()=>new Map,"newClassesList"),Yrr=O(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),Lie=O(t=>JSON.parse(JSON.stringify(t)),"clone"),gk=(Ak=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Wrr(),this.documents={root:Yrr()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=oo,this.setAccTitle=Ba,this.getAccDescription=lo,this.setAccDescription=so,this.setDiagramTitle=co,this.getDiagramTitle=$a,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 OD:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case vLe:this.addRelation(i.state1,i.state2,i.description);break;case Rni:this.addStyleClass(i.id.trim(),i.classes);break;case Dni:this.handleStyleDef(i);break;case Lni:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const r=this.getStates(),n=Ye();Jni(),lU(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 o=i.trim();this.addState(o),a=this.getState(o)}a&&(a.styles=n.map(o=>{var s;return(s=o.replace(/;/g,""))==null?void 0:s.trim()}))}}setRootDoc(e){ye.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===vLe){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===OD&&(r.id===yh.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==kD&&r.stmt!==OD||!r.doc)return;const i=[];let a=[];for(const o of r.doc)if(o.type===Rrr){const s=Lie(o);s.doc=Lie(a),i.push(s),a=[]}else a.push(o);if(i.length>0&&a.length>0){const o={stmt:OD,id:aCt(),type:"divider",doc:Lie(a)};i.push(Lie(o)),r.doc=i}r.doc.forEach(o=>this.docTranslator(r,o,!0))}getRootDocV2(){return this.docTranslator({id:kD,stmt:kD},{id:kD,stmt:kD,doc:this.rootDoc},!0),{id:kD,doc:this.rootDoc}}addState(e,r=aU,n=void 0,i=void 0,a=void 0,o=void 0,s=void 0,l=void 0){const u=e==null?void 0:e.trim();if(!this.currentDocument.states.has(u))ye.info("Adding state ",u,i),this.currentDocument.states.set(u,{stmt:OD,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&&(ye.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=Xt.sanitizeText(h.note.text,Ye())}o&&(ye.info("Setting state classes",u,o),(Array.isArray(o)?o:[o]).forEach(d=>this.setCssClass(u,d.trim()))),s&&(ye.info("Setting state styles",u,s),(Array.isArray(s)?s:[s]).forEach(d=>this.setStyle(u,d.trim()))),l&&(ye.info("Setting state styles",u,s),(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:Yrr()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Wrr(),e||(this.links=new Map,_a())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){ye.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,r,n){this.links.set(e,{url:r,tooltip:n}),ye.warn("Adding link",e,r,n)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===yh.START_NODE?(this.startEndCount++,`${yh.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=aU){return e===yh.START_NODE?yh.START_TYPE:r}endIdIfNeeded(e=""){return e===yh.END_NODE?(this.startEndCount++,`${yh.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=aU){return e===yh.END_NODE?yh.END_TYPE:r}addRelationObjs(e,r,n=""){const i=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type),o=this.startIdIfNeeded(r.id.trim()),s=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(o,s,r.doc,r.description,r.note,r.classes,r.styles,r.textStyles),this.currentDocument.relations.push({id1:i,id2:o,relationTitle:Xt.sanitizeText(n,Ye())})}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),o=this.endIdIfNeeded(r.trim()),s=this.endTypeIfNeeded(r);this.addState(i,a),this.addState(o,s),this.currentDocument.relations.push({id1:i,id2:o,relationTitle:n?Xt.sanitizeText(n,Ye()):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(Xt.sanitizeText(i,Ye()))}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(yh.STYLECLASS_SEP).forEach(i=>{const a=i.replace(/([^;]*);/,"$1").trim();if(RegExp(yh.COLOR_KEYWORD).exec(i)){const s=a.replace(yh.FILL_KEYWORD,yh.BG_FILL).replace(yh.COLOR_KEYWORD,yh.FILL_KEYWORD);n.textStyles.push(s)}n.styles.push(a)})}getClasses(){return this.classes}setupToolTips(e){const r=KEe();_t(e).select("svg").selectAll("g.node, g.rough-node").on("mouseover",a=>{var u;const o=_t(a.currentTarget),s=o.attr("title");if(s===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(qy.sanitize(s)),o.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),_t(a.currentTarget).classed("hover",!1)})}setCssClass(e,r){e.split(",").forEach(n=>{var a;let i=this.getState(n);if(!i){const o=n.trim();this.addState(o),i=this.getState(o)}(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===_rr)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??_ni}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:_rr,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=Ye();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Vrr(this.getRootDocV2())}}getConfig(){return Ye().state}},O(Ak,"StateDB"),Ak.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},Ak),eii=O(t=>` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:O(function(){var V=this.next();return V||this.lex()},"lex"),begin:O(function(V){this.conditionStack.push(V)},"begin"),popState:O(function(){var V=this.conditionStack.length-1;return V>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(V){return V=this.conditionStack.length-1-Math.abs(V||0),V>=0?this.conditionStack[V]:"INITIAL"},"topState"),pushState:O(function(V){this.begin(V)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(function(V,z,U,Q){function G(){const q=z.yytext.indexOf("%%");if(q===0)return!1;if(q>0){const Y=z.yytext.slice(0,q),ne=z.yytext.slice(q);ne&&V.lexer.unput(ne),z.yytext=Y}return!0}switch(O(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=I;function N(){this.yy={}}return O(N,"Parser"),N.prototype=M,M.Parser=N,new N}();mLe.parser=mLe;var _rr=mLe,Dni="TB",Rrr="TB",Drr="dir",OD="state",kD="root",vLe="relation",Lni="classDef",Mni="style",Ini="applyClass",aU="default",Lrr="divider",Mrr="fill:none",Irr="fill: #333",Prr="c",Nrr="markdown",Brr="normal",yLe="rect",bLe="rectWithTitle",Pni="stateStart",Nni="stateEnd",$rr="divider",Frr="roundedWithTitle",Bni="note",$ni="noteGroup",oU="statediagram",Fni="state",zni=`${oU}-${Fni}`,zrr="transition",Uni="note",Vni="note-edge",Qni=`${zrr} ${Vni}`,Gni=`${oU}-${Uni}`,Hni="cluster",Wni=`${oU}-${Hni}`,Yni="cluster-alt",qni=`${oU}-${Yni}`,Urr="parent",Vrr="note",jni="state",xLe="----",Xni=`${xLe}${Vrr}`,Qrr=`${xLe}${Urr}`,Grr=O((t,e=Rrr)=>{if(!t.doc)return e;let r=e;for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir"),Kni=O(function(t,e){return e.db.getClasses()},"getClasses"),Zni=O(async function(t,e,r,n){ye.info("REF0:"),ye.info("Drawing state diagram (v2)",e);const{securityLevel:i,state:a,layout:o}=Ye();n.db.extract(n.db.getRootDocV2());const s=n.db.getData(),l=m3(e,i);s.type=n.type,s.layoutAlgorithm=o,s.nodeSpacing=(a==null?void 0:a.nodeSpacing)||50,s.rankSpacing=(a==null?void 0:a.rankSpacing)||50,Ye().look==="neo"?s.markers=["barbNeo"]:s.markers=["barb"],s.diagramId=e,await RR(s,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=s.nodes.find(S=>S.id===g);if(!g){ye.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 C;const T=(C=S.textContent)==null?void 0:C.trim();(S.id===(m==null?void 0:m.domId)||T===g)&&(y=S)}),!y){ye.warn("⚠️ Could not find node matching text:",g);return}const b=y.parentNode;if(!b){ye.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),ye.info("🔗 Wrapped node in tag for:",g,f.url)})}catch(d){ye.error("❌ Error injecting clickable links:",d)}un.insertTitle(l,"statediagramTitleText",(a==null?void 0:a.titleTopMargin)??25,n.db.getDiagramTitle()),nO(l,h,oU,(a==null?void 0:a.useMaxWidth)??!0)},"draw"),Jni={getClasses:Kni,draw:Zni,getDir:Grr},Rie=new Map,zw=0;function Die(t="",e=0,r="",n=xLe){const i=r!==null&&r.length>0?`${n}${r}`:"";return`${jni}-${t}${i}-${e}`}O(Die,"stateDomId");var eii=O((t,e,r,n,i,a,o,s)=>{ye.trace("items",e),e.forEach(l=>{switch(l.stmt){case OD:lU(t,l,r,n,i,a,o,s);break;case aU:lU(t,l,r,n,i,a,o,s);break;case vLe:{lU(t,l.state1,r,n,i,a,o,s),lU(t,l.state2,r,n,i,a,o,s);const u=o==="neo",h={id:"edge"+zw,start:l.state1.id,end:l.state2.id,arrowhead:"normal",arrowTypeEnd:u?"arrow_barb_neo":"arrow_barb",style:Mrr,labelStyle:"",label:Xt.sanitizeText(l.description??"",Ye()),arrowheadStyle:Irr,labelpos:Prr,labelType:Nrr,thickness:Brr,classes:zrr,look:o};i.push(h),zw++}break}})},"setupDoc"),Hrr=O((t,e=Rrr)=>{let r=e;if(t.doc)for(const n of t.doc)n.stmt==="dir"&&(r=n.value);return r},"getDir");function sU(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)}O(sU,"insertOrUpdateNode");function Wrr(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}O(Wrr,"getClassesFromDbInfo");function Yrr(t){return(t==null?void 0:t.styles)??[]}O(Yrr,"getStylesFromDbInfo");var lU=O((t,e,r,n,i,a,o,s)=>{var p,g,m;const l=e.id,u=r.get(l),h=Wrr(u),d=Yrr(u),f=Ye();if(ye.info("dataFetcher parsedItem",e,u,d),l!=="root"){let v=yLe;e.start===!0?v=Pni:e.start===!1&&(v=Nni),e.type!==aU&&(v=e.type),Rie.get(l)||Rie.set(l,{id:l,shape:v,description:Xt.sanitizeText(l,f),cssClasses:`${h} ${zni}`,cssStyles:d});const y=Rie.get(l);e.description&&(Array.isArray(y.description)?(y.shape=bLe,y.description.push(e.description)):(p=y.description)!=null&&p.length&&y.description.length>0?(y.shape=bLe,y.description===l?y.description=[e.description]:y.description=[y.description,e.description]):(y.shape=yLe,y.description=e.description),y.description=Xt.sanitizeTextOrArray(y.description,f)),((g=y.description)==null?void 0:g.length)===1&&y.shape===bLe&&(y.type==="group"?y.shape=Frr:y.shape=yLe),!y.type&&e.doc&&(ye.info("Setting cluster for XCX",l,Hrr(e)),y.type="group",y.isGroup=!0,y.dir=Hrr(e),y.explicitDir=e.doc.some(x=>x.stmt==="dir"),y.shape=e.type===Lrr?$rr:Frr,y.cssClasses=`${y.cssClasses} ${Wni} ${a?qni:""}`);const b={labelStyle:"",shape:y.shape,label:y.description,cssClasses:y.cssClasses,cssCompiledStyles:[],cssStyles:y.cssStyles,id:l,dir:y.dir,domId:Die(l,zw),type:y.type,isGroup:y.type==="group",padding:8,rx:10,ry:10,look:o,labelType:"markdown"};if(b.shape===$rr&&(b.label=""),t&&t.id!=="root"&&(ye.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:Bni,label:e.note.text,labelType:"markdown",cssClasses:Gni,cssStyles:[],cssCompiledStyles:[],id:l+Xni+"-"+zw,domId:Die(l,zw,Vrr),type:y.type,isGroup:y.type==="group",padding:(m=f.flowchart)==null?void 0:m.padding,look:o,position:e.note.position},w=l+Qrr,A={labelStyle:"",shape:$ni,label:e.note.text,cssClasses:y.cssClasses,cssStyles:[],id:l+Qrr,domId:Die(l,zw,Urr),type:"group",isGroup:!0,padding:16,look:o,position:e.note.position};zw++,A.id=w,x.parentId=w,sU(n,A,s),sU(n,x,s),sU(n,b,s);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:Mrr,labelStyle:"",classes:Qni,arrowheadStyle:Irr,labelpos:Prr,labelType:Nrr,thickness:Brr,look:o})}else sU(n,b,s)}e.doc&&(ye.trace("Adding nodes children "),eii(e,e.doc,r,n,i,!a,o,s))},"dataFetcher"),tii=O(()=>{Rie.clear(),zw=0},"reset"),yh={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},qrr=O(()=>new Map,"newClassesList"),jrr=O(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),Lie=O(t=>JSON.parse(JSON.stringify(t)),"clone"),gk=(Ak=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=qrr(),this.documents={root:jrr()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=oo,this.setAccTitle=Ba,this.getAccDescription=lo,this.setAccDescription=so,this.setDiagramTitle=co,this.getDiagramTitle=$a,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 OD:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case vLe:this.addRelation(i.state1,i.state2,i.description);break;case Lni:this.addStyleClass(i.id.trim(),i.classes);break;case Mni:this.handleStyleDef(i);break;case Ini:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}const r=this.getStates(),n=Ye();tii(),lU(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 o=i.trim();this.addState(o),a=this.getState(o)}a&&(a.styles=n.map(o=>{var s;return(s=o.replace(/;/g,""))==null?void 0:s.trim()}))}}setRootDoc(e){ye.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===vLe){this.docTranslator(e,r.state1,!0),this.docTranslator(e,r.state2,!1);return}if(r.stmt===OD&&(r.id===yh.START_NODE?(r.id=e.id+(n?"_start":"_end"),r.start=n):r.id=r.id.trim()),r.stmt!==kD&&r.stmt!==OD||!r.doc)return;const i=[];let a=[];for(const o of r.doc)if(o.type===Lrr){const s=Lie(o);s.doc=Lie(a),i.push(s),a=[]}else a.push(o);if(i.length>0&&a.length>0){const o={stmt:OD,id:sCt(),type:"divider",doc:Lie(a)};i.push(Lie(o)),r.doc=i}r.doc.forEach(o=>this.docTranslator(r,o,!0))}getRootDocV2(){return this.docTranslator({id:kD,stmt:kD},{id:kD,stmt:kD,doc:this.rootDoc},!0),{id:kD,doc:this.rootDoc}}addState(e,r=aU,n=void 0,i=void 0,a=void 0,o=void 0,s=void 0,l=void 0){const u=e==null?void 0:e.trim();if(!this.currentDocument.states.has(u))ye.info("Adding state ",u,i),this.currentDocument.states.set(u,{stmt:OD,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&&(ye.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=Xt.sanitizeText(h.note.text,Ye())}o&&(ye.info("Setting state classes",u,o),(Array.isArray(o)?o:[o]).forEach(d=>this.setCssClass(u,d.trim()))),s&&(ye.info("Setting state styles",u,s),(Array.isArray(s)?s:[s]).forEach(d=>this.setStyle(u,d.trim()))),l&&(ye.info("Setting state styles",u,s),(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:jrr()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=qrr(),e||(this.links=new Map,_a())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){ye.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,r,n){this.links.set(e,{url:r,tooltip:n}),ye.warn("Adding link",e,r,n)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===yh.START_NODE?(this.startEndCount++,`${yh.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",r=aU){return e===yh.START_NODE?yh.START_TYPE:r}endIdIfNeeded(e=""){return e===yh.END_NODE?(this.startEndCount++,`${yh.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",r=aU){return e===yh.END_NODE?yh.END_TYPE:r}addRelationObjs(e,r,n=""){const i=this.startIdIfNeeded(e.id.trim()),a=this.startTypeIfNeeded(e.id.trim(),e.type),o=this.startIdIfNeeded(r.id.trim()),s=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(o,s,r.doc,r.description,r.note,r.classes,r.styles,r.textStyles),this.currentDocument.relations.push({id1:i,id2:o,relationTitle:Xt.sanitizeText(n,Ye())})}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),o=this.endIdIfNeeded(r.trim()),s=this.endTypeIfNeeded(r);this.addState(i,a),this.addState(o,s),this.currentDocument.relations.push({id1:i,id2:o,relationTitle:n?Xt.sanitizeText(n,Ye()):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(Xt.sanitizeText(i,Ye()))}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(yh.STYLECLASS_SEP).forEach(i=>{const a=i.replace(/([^;]*);/,"$1").trim();if(RegExp(yh.COLOR_KEYWORD).exec(i)){const s=a.replace(yh.FILL_KEYWORD,yh.BG_FILL).replace(yh.COLOR_KEYWORD,yh.FILL_KEYWORD);n.textStyles.push(s)}n.styles.push(a)})}getClasses(){return this.classes}setupToolTips(e){const r=KEe();_t(e).select("svg").selectAll("g.node, g.rough-node").on("mouseover",a=>{var u;const o=_t(a.currentTarget),s=o.attr("title");if(s===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(qy.sanitize(s)),o.classed("hover",!0)}).on("mouseout",a=>{r.transition().duration(500).style("opacity",0),_t(a.currentTarget).classed("hover",!1)})}setCssClass(e,r){e.split(",").forEach(n=>{var a;let i=this.getState(n);if(!i){const o=n.trim();this.addState(o),i=this.getState(o)}(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===Drr)}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??Dni}setDirection(e){const r=this.getDirectionStatement();r?r.value=e:this.rootDoc.unshift({stmt:Drr,value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){const e=Ye();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Grr(this.getRootDocV2())}}getConfig(){return Ye().state}},O(Ak,"StateDB"),Ak.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},Ak),rii=O(t=>` defs [id$="-barbEnd"] { fill: ${t.transitionColor}; stroke: ${t.transitionColor}; @@ -2890,12 +2890,12 @@ g.stateGroup line { ry: ${t.radius}px; filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"} } -`,"getStyles"),qrr=eii,tii=O(t=>t.append("circle").attr("class","start-state").attr("r",Ye().state.sizeUnit).attr("cx",Ye().state.padding+Ye().state.sizeUnit).attr("cy",Ye().state.padding+Ye().state.sizeUnit),"drawStartState"),rii=O(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",Ye().state.textHeight).attr("class","divider").attr("x2",Ye().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),nii=O((t,e)=>{const r=t.append("text").attr("x",2*Ye().state.padding).attr("y",Ye().state.textHeight+2*Ye().state.padding).attr("font-size",Ye().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",Ye().state.padding).attr("y",Ye().state.padding).attr("width",n.width+2*Ye().state.padding).attr("height",n.height+2*Ye().state.padding).attr("rx",Ye().state.radius),r},"drawSimpleState"),iii=O((t,e)=>{const r=O(function(f,p,g){const m=f.append("tspan").attr("x",2*Ye().state.padding).text(p);g||m.attr("dy",Ye().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*Ye().state.padding).attr("y",Ye().state.textHeight+1.3*Ye().state.padding).attr("font-size",Ye().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),a=i.height,o=t.append("text").attr("x",Ye().state.padding).attr("y",a+Ye().state.padding*.4+Ye().state.dividerMargin+Ye().state.textHeight).attr("class","state-description");let s=!0,l=!0;e.descriptions.forEach(function(f){s||(r(o,f,l),l=!1),s=!1});const u=t.append("line").attr("x1",Ye().state.padding).attr("y1",Ye().state.padding+a+Ye().state.dividerMargin/2).attr("y2",Ye().state.padding+a+Ye().state.dividerMargin/2).attr("class","descr-divider"),h=o.node().getBBox(),d=Math.max(h.width,i.width);return u.attr("x2",d+3*Ye().state.padding),t.insert("rect",":first-child").attr("x",Ye().state.padding).attr("y",Ye().state.padding).attr("width",d+2*Ye().state.padding).attr("height",h.height+a+2*Ye().state.padding).attr("rx",Ye().state.radius),t},"drawDescrState"),aii=O((t,e,r)=>{const n=Ye().state.padding,i=2*Ye().state.padding,a=t.node().getBBox(),o=a.width,s=a.x,l=t.append("text").attr("x",0).attr("y",Ye().state.titleShift).attr("font-size",Ye().state.fontSize).attr("class","state-title").text(e.id),h=l.node().getBBox().width+i;let d=Math.max(h,o);d===o&&(d=d+i);let f;const p=t.node().getBBox();e.doc,f=s-n,h>o&&(f=(o-d)/2+n),Math.abs(s-p.x)o&&(f=s-(h-o)/2);const g=1-Ye().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+Ye().state.textHeight+Ye().state.titleShift+1).attr("rx","0"),l.attr("x",f+n),h<=o&&l.attr("x",s+(d-i)/2-h/2+n),t.insert("rect",":first-child").attr("x",f).attr("y",Ye().state.titleShift-Ye().state.textHeight-Ye().state.padding).attr("width",d).attr("height",Ye().state.textHeight*3).attr("rx",Ye().state.radius),t.insert("rect",":first-child").attr("x",f).attr("y",Ye().state.titleShift-Ye().state.textHeight-Ye().state.padding).attr("width",d).attr("height",p.height+3+2*Ye().state.textHeight).attr("rx",Ye().state.radius),t},"addTitleAndBox"),oii=O(t=>(t.append("circle").attr("class","end-state-outer").attr("r",Ye().state.sizeUnit+Ye().state.miniPadding).attr("cx",Ye().state.padding+Ye().state.sizeUnit+Ye().state.miniPadding).attr("cy",Ye().state.padding+Ye().state.sizeUnit+Ye().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",Ye().state.sizeUnit).attr("cx",Ye().state.padding+Ye().state.sizeUnit+2).attr("cy",Ye().state.padding+Ye().state.sizeUnit+2)),"drawEndState"),sii=O((t,e)=>{let r=Ye().state.forkWidth,n=Ye().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",Ye().state.padding).attr("y",Ye().state.padding)},"drawForkJoinState"),lii=O((t,e,r,n)=>{let i=0;const a=n.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let o=t.replace(/\r\n/g,"
");o=o.replace(/\n/g,"
");const s=o.split(Xt.lineBreakRegex);let l=1.25*Ye().state.noteMargin;for(const u of s){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+Ye().state.noteMargin),d.attr("y",r+i+1.25*Ye().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},"_drawLongText"),cii=O((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",Ye().state.padding),n=e.append("g"),{textWidth:i,textHeight:a}=lii(t,0,0,n);return r.attr("height",a+2*Ye().state.noteMargin),r.attr("width",i+Ye().state.noteMargin*2),r},"drawNote"),jrr=O(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"&&tii(i),e.type==="end"&&oii(i),(e.type==="fork"||e.type==="join")&&sii(i,e),e.type==="note"&&cii(e.note.text,i),e.type==="divider"&&rii(i),e.type==="default"&&e.descriptions.length===0&&nii(i,e),e.type==="default"&&e.descriptions.length>0&&iii(i,e);const a=i.node().getBBox();return n.width=a.width+2*Ye().state.padding,n.height=a.height+2*Ye().state.padding,n},"drawState"),Xrr=0,uii=O(function(t,e,r){const n=O(function(l){switch(l){case gk.relationType.AGGREGATION:return"aggregation";case gk.relationType.EXTENSION:return"extension";case gk.relationType.COMPOSITION:return"composition";case gk.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,a=N7().x(function(l){return l.x}).y(function(l){return l.y}).curve(B7),o=t.append("path").attr("d",a(i)).attr("id","edge"+Xrr).attr("class","transition");let s="";if(Ye().state.arrowMarkerAbsolute&&(s=Cj(!0)),o.attr("marker-end","url("+s+"#"+n(gk.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const l=t.append("g").attr("class","stateLabel"),{x:u,y:h}=un.calcLabelPosition(e.points),d=Xt.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),ye.info(w.x,u,h+f),f===0&&(f=x.node().getBBox().height,ye.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-Ye().state.padding/2).attr("y",h-v/2-Ye().state.padding/2-3.5).attr("width",g+Ye().state.padding).attr("height",v+Ye().state.padding),ye.info(y)}Xrr++},"drawEdge"),Sf,wLe={},hii=O(function(){},"setConf"),dii=O(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"),fii=O(function(t,e,r,n){Sf=Ye().state;const i=Ye().securityLevel;let a;i==="sandbox"&&(a=_t("#i"+e));const o=_t(i==="sandbox"?a.nodes()[0].contentDocument.body:"body"),s=i==="sandbox"?a.nodes()[0].contentDocument:document;ye.debug("Rendering diagram "+t);const l=o.select(`[id='${e}']`);dii(l);const u=n.db.getRootDoc(),h=l.append("g").attr("id",e+"-root");Krr(u,h,void 0,!1,o,s,n);const d=Sf.padding,f=l.node().getBBox(),p=f.width+d*2,g=f.height+d*2,m=p*1.75;jo(l,g,m,Sf.useMaxWidth),l.attr("viewBox",`${f.x-Sf.padding} ${f.y-Sf.padding} `+p+" "+g)},"draw"),pii=O(t=>t?t.length*Sf.fontSizeFactor:1,"getLabelWidth"),Krr=O((t,e,r,n,i,a,o)=>{const s=new hu({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)})):ye.debug("No Node "+y+": "+JSON.stringify(s.node(y)))});let m=g.getBBox();s.edges().forEach(function(y){y!==void 0&&s.edge(y)!==void 0&&(ye.debug("Edge "+y.v+" -> "+y.w+": "+JSON.stringify(s.edge(y))),uii(e,s.edge(y),s.edge(y).relation))}),m=g.getBBox();const v={id:r||"root",label:r||"root",width:0,height:0};return v.width=m.width+2*Sf.padding,v.height=m.height+2*Sf.padding,ye.debug("Doc rendered",v,s),v},"renderDoc"),gii={setConf:hii,draw:fii},mii={parser:krr,get db(){return new gk(1)},renderer:gii,styles:qrr,init:O(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const vii=Object.freeze(Object.defineProperty({__proto__:null,diagram:mii},Symbol.toStringTag,{value:"Module"}));var yii={parser:krr,get db(){return new gk(2)},renderer:Kni,styles:qrr,init:O(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const bii=Object.freeze(Object.defineProperty({__proto__:null,diagram:yii},Symbol.toStringTag,{value:"Module"}));var ALe=function(){var t=O(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],o=[1,13],s=[1,14],l={trace:O(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:O(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:o,18:s},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:n,14:i,16:a,17:o,18:s},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:O(function(f,p){if(p.recoverable)this.trace(f);else{var g=new Error(f);throw g.hash=p,g}},"parseError"),parse:O(function(f){var p=this,g=[0],m=[],v=[null],y=[],b=this.table,x="",w=0,A=0,S=2,T=1,C=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 P=k.yylloc;y.push(P);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(q){g.length=g.length-2*q,v.length=v.length-q,y.length=y.length-q}O(R,"popStack");function D(){var q;return q=m.pop()||k.lex()||T,typeof q!="number"&&(q instanceof Array&&(m=q,q=m.pop()),q=p.symbols_[q]||q),q}O(D,"lex");for(var M,I,N,F,B={},V,z,U,Q;;){if(I=g[g.length-1],this.defaultActions[I]?N=this.defaultActions[I]:((M===null||typeof M>"u")&&(M=D()),N=b[I]&&b[I][M]),typeof N>"u"||!N.length||!N[0]){var G="";Q=[];for(V in b[I])this.terminals_[V]&&V>S&&Q.push("'"+this.terminals_[V]+"'");k.showPosition?G="Parse error on line "+(w+1)+`: +`,"getStyles"),Xrr=rii,nii=O(t=>t.append("circle").attr("class","start-state").attr("r",Ye().state.sizeUnit).attr("cx",Ye().state.padding+Ye().state.sizeUnit).attr("cy",Ye().state.padding+Ye().state.sizeUnit),"drawStartState"),iii=O(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",Ye().state.textHeight).attr("class","divider").attr("x2",Ye().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),aii=O((t,e)=>{const r=t.append("text").attr("x",2*Ye().state.padding).attr("y",Ye().state.textHeight+2*Ye().state.padding).attr("font-size",Ye().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",Ye().state.padding).attr("y",Ye().state.padding).attr("width",n.width+2*Ye().state.padding).attr("height",n.height+2*Ye().state.padding).attr("rx",Ye().state.radius),r},"drawSimpleState"),oii=O((t,e)=>{const r=O(function(f,p,g){const m=f.append("tspan").attr("x",2*Ye().state.padding).text(p);g||m.attr("dy",Ye().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*Ye().state.padding).attr("y",Ye().state.textHeight+1.3*Ye().state.padding).attr("font-size",Ye().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),a=i.height,o=t.append("text").attr("x",Ye().state.padding).attr("y",a+Ye().state.padding*.4+Ye().state.dividerMargin+Ye().state.textHeight).attr("class","state-description");let s=!0,l=!0;e.descriptions.forEach(function(f){s||(r(o,f,l),l=!1),s=!1});const u=t.append("line").attr("x1",Ye().state.padding).attr("y1",Ye().state.padding+a+Ye().state.dividerMargin/2).attr("y2",Ye().state.padding+a+Ye().state.dividerMargin/2).attr("class","descr-divider"),h=o.node().getBBox(),d=Math.max(h.width,i.width);return u.attr("x2",d+3*Ye().state.padding),t.insert("rect",":first-child").attr("x",Ye().state.padding).attr("y",Ye().state.padding).attr("width",d+2*Ye().state.padding).attr("height",h.height+a+2*Ye().state.padding).attr("rx",Ye().state.radius),t},"drawDescrState"),sii=O((t,e,r)=>{const n=Ye().state.padding,i=2*Ye().state.padding,a=t.node().getBBox(),o=a.width,s=a.x,l=t.append("text").attr("x",0).attr("y",Ye().state.titleShift).attr("font-size",Ye().state.fontSize).attr("class","state-title").text(e.id),h=l.node().getBBox().width+i;let d=Math.max(h,o);d===o&&(d=d+i);let f;const p=t.node().getBBox();e.doc,f=s-n,h>o&&(f=(o-d)/2+n),Math.abs(s-p.x)o&&(f=s-(h-o)/2);const g=1-Ye().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+Ye().state.textHeight+Ye().state.titleShift+1).attr("rx","0"),l.attr("x",f+n),h<=o&&l.attr("x",s+(d-i)/2-h/2+n),t.insert("rect",":first-child").attr("x",f).attr("y",Ye().state.titleShift-Ye().state.textHeight-Ye().state.padding).attr("width",d).attr("height",Ye().state.textHeight*3).attr("rx",Ye().state.radius),t.insert("rect",":first-child").attr("x",f).attr("y",Ye().state.titleShift-Ye().state.textHeight-Ye().state.padding).attr("width",d).attr("height",p.height+3+2*Ye().state.textHeight).attr("rx",Ye().state.radius),t},"addTitleAndBox"),lii=O(t=>(t.append("circle").attr("class","end-state-outer").attr("r",Ye().state.sizeUnit+Ye().state.miniPadding).attr("cx",Ye().state.padding+Ye().state.sizeUnit+Ye().state.miniPadding).attr("cy",Ye().state.padding+Ye().state.sizeUnit+Ye().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",Ye().state.sizeUnit).attr("cx",Ye().state.padding+Ye().state.sizeUnit+2).attr("cy",Ye().state.padding+Ye().state.sizeUnit+2)),"drawEndState"),cii=O((t,e)=>{let r=Ye().state.forkWidth,n=Ye().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",Ye().state.padding).attr("y",Ye().state.padding)},"drawForkJoinState"),uii=O((t,e,r,n)=>{let i=0;const a=n.append("text");a.style("text-anchor","start"),a.attr("class","noteText");let o=t.replace(/\r\n/g,"
");o=o.replace(/\n/g,"
");const s=o.split(Xt.lineBreakRegex);let l=1.25*Ye().state.noteMargin;for(const u of s){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+Ye().state.noteMargin),d.attr("y",r+i+1.25*Ye().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},"_drawLongText"),hii=O((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",Ye().state.padding),n=e.append("g"),{textWidth:i,textHeight:a}=uii(t,0,0,n);return r.attr("height",a+2*Ye().state.noteMargin),r.attr("width",i+Ye().state.noteMargin*2),r},"drawNote"),Krr=O(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"&&nii(i),e.type==="end"&&lii(i),(e.type==="fork"||e.type==="join")&&cii(i,e),e.type==="note"&&hii(e.note.text,i),e.type==="divider"&&iii(i),e.type==="default"&&e.descriptions.length===0&&aii(i,e),e.type==="default"&&e.descriptions.length>0&&oii(i,e);const a=i.node().getBBox();return n.width=a.width+2*Ye().state.padding,n.height=a.height+2*Ye().state.padding,n},"drawState"),Zrr=0,dii=O(function(t,e,r){const n=O(function(l){switch(l){case gk.relationType.AGGREGATION:return"aggregation";case gk.relationType.EXTENSION:return"extension";case gk.relationType.COMPOSITION:return"composition";case gk.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(l=>!Number.isNaN(l.y));const i=e.points,a=N7().x(function(l){return l.x}).y(function(l){return l.y}).curve(B7),o=t.append("path").attr("d",a(i)).attr("id","edge"+Zrr).attr("class","transition");let s="";if(Ye().state.arrowMarkerAbsolute&&(s=Cj(!0)),o.attr("marker-end","url("+s+"#"+n(gk.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const l=t.append("g").attr("class","stateLabel"),{x:u,y:h}=un.calcLabelPosition(e.points),d=Xt.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),ye.info(w.x,u,h+f),f===0&&(f=x.node().getBBox().height,ye.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-Ye().state.padding/2).attr("y",h-v/2-Ye().state.padding/2-3.5).attr("width",g+Ye().state.padding).attr("height",v+Ye().state.padding),ye.info(y)}Zrr++},"drawEdge"),Sf,wLe={},fii=O(function(){},"setConf"),pii=O(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"),gii=O(function(t,e,r,n){Sf=Ye().state;const i=Ye().securityLevel;let a;i==="sandbox"&&(a=_t("#i"+e));const o=_t(i==="sandbox"?a.nodes()[0].contentDocument.body:"body"),s=i==="sandbox"?a.nodes()[0].contentDocument:document;ye.debug("Rendering diagram "+t);const l=o.select(`[id='${e}']`);pii(l);const u=n.db.getRootDoc(),h=l.append("g").attr("id",e+"-root");Jrr(u,h,void 0,!1,o,s,n);const d=Sf.padding,f=l.node().getBBox(),p=f.width+d*2,g=f.height+d*2,m=p*1.75;jo(l,g,m,Sf.useMaxWidth),l.attr("viewBox",`${f.x-Sf.padding} ${f.y-Sf.padding} `+p+" "+g)},"draw"),mii=O(t=>t?t.length*Sf.fontSizeFactor:1,"getLabelWidth"),Jrr=O((t,e,r,n,i,a,o)=>{const s=new hu({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)})):ye.debug("No Node "+y+": "+JSON.stringify(s.node(y)))});let m=g.getBBox();s.edges().forEach(function(y){y!==void 0&&s.edge(y)!==void 0&&(ye.debug("Edge "+y.v+" -> "+y.w+": "+JSON.stringify(s.edge(y))),dii(e,s.edge(y),s.edge(y).relation))}),m=g.getBBox();const v={id:r||"root",label:r||"root",width:0,height:0};return v.width=m.width+2*Sf.padding,v.height=m.height+2*Sf.padding,ye.debug("Doc rendered",v,s),v},"renderDoc"),vii={setConf:fii,draw:gii},yii={parser:_rr,get db(){return new gk(1)},renderer:vii,styles:Xrr,init:O(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const bii=Object.freeze(Object.defineProperty({__proto__:null,diagram:yii},Symbol.toStringTag,{value:"Module"}));var xii={parser:_rr,get db(){return new gk(2)},renderer:Jni,styles:Xrr,init:O(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};const wii=Object.freeze(Object.defineProperty({__proto__:null,diagram:xii},Symbol.toStringTag,{value:"Module"}));var ALe=function(){var t=O(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],o=[1,13],s=[1,14],l={trace:O(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:O(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:o,18:s},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:r,12:n,14:i,16:a,17:o,18:s},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:O(function(f,p){if(p.recoverable)this.trace(f);else{var g=new Error(f);throw g.hash=p,g}},"parseError"),parse:O(function(f){var p=this,g=[0],m=[],v=[null],y=[],b=this.table,x="",w=0,A=0,S=2,T=1,C=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 P=k.yylloc;y.push(P);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(q){g.length=g.length-2*q,v.length=v.length-q,y.length=y.length-q}O(R,"popStack");function D(){var q;return q=m.pop()||k.lex()||T,typeof q!="number"&&(q instanceof Array&&(m=q,q=m.pop()),q=p.symbols_[q]||q),q}O(D,"lex");for(var M,I,N,F,B={},V,z,U,Q;;){if(I=g[g.length-1],this.defaultActions[I]?N=this.defaultActions[I]:((M===null||typeof M>"u")&&(M=D()),N=b[I]&&b[I][M]),typeof N>"u"||!N.length||!N[0]){var G="";Q=[];for(V in b[I])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==T?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(G,{text:k.match,token:this.terminals_[M]||M,line:k.yylineno,loc:P,expected:Q})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+I+", 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,P=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(C)),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:O(function(p,g){if(this.yy.parser)this.yy.parser.parseError(p,g);else throw new Error(p)},"parseError"),setInput:O(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:O(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:O(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:O(function(){return this._more=!0,this},"more"),reject:O(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:O(function(f){this.unput(this.match.slice(f))},"less"),pastInput:O(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:O(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:O(function(){var f=this.pastInput(),p=new Array(f.length+1).join("-");return f+this.upcomingInput()+` `+p+"^"},"showPosition"),test_match:O(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:O(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:O(function(){var p=this.next();return p||this.lex()},"lex"),begin:O(function(p){this.conditionStack.push(p)},"begin"),popState:O(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:O(function(p){this.begin(p)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(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 O(h,"Parser"),h.prototype=l,l.Parser=h,new h}();ALe.parser=ALe;var xii=ALe,ED="",SLe=[],cU=[],uU=[],wii=O(function(){SLe.length=0,cU.length=0,ED="",uU.length=0,_a()},"clear"),Aii=O(function(t){ED=t,SLe.push(t)},"addSection"),Sii=O(function(){return SLe},"getSections"),Tii=O(function(){let t=Zrr();const e=100;let r=0;for(;!t&&r{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),Oii=O(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(s=>s.trim()),o={section:ED,type:ED,people:a,task:t,score:n};uU.push(o)},"addTask"),kii=O(function(t){const e={section:ED,type:ED,description:t,task:t,classes:[]};cU.push(e)},"addTaskOrg"),Zrr=O(function(){const t=O(function(r){return uU[r].processed},"compileTask");let e=!0;for(const[r,n]of uU.entries())t(r),e=e&&n.processed;return e},"compileTasks"),Eii=O(function(){return Cii()},"getActors"),Jrr={getConfig:O(()=>Ye().journey,"getConfig"),clear:wii,setDiagramTitle:co,getDiagramTitle:$a,setAccTitle:Ba,getAccTitle:oo,setAccDescription:so,getAccDescription:lo,addSection:Aii,getSections:Sii,getTasks:Tii,addTask:Oii,addTaskOrg:kii,getActors:Eii},_ii=O(t=>`.label { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:O(function(){var p=this.next();return p||this.lex()},"lex"),begin:O(function(p){this.conditionStack.push(p)},"begin"),popState:O(function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},"topState"),pushState:O(function(p){this.begin(p)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(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 O(h,"Parser"),h.prototype=l,l.Parser=h,new h}();ALe.parser=ALe;var Aii=ALe,ED="",SLe=[],cU=[],uU=[],Sii=O(function(){SLe.length=0,cU.length=0,ED="",uU.length=0,_a()},"clear"),Tii=O(function(t){ED=t,SLe.push(t)},"addSection"),Cii=O(function(){return SLe},"getSections"),Oii=O(function(){let t=enr();const e=100;let r=0;for(;!t&&r{r.people&&t.push(...r.people)}),[...new Set(t)].sort()},"updateActors"),Eii=O(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(s=>s.trim()),o={section:ED,type:ED,people:a,task:t,score:n};uU.push(o)},"addTask"),_ii=O(function(t){const e={section:ED,type:ED,description:t,task:t,classes:[]};cU.push(e)},"addTaskOrg"),enr=O(function(){const t=O(function(r){return uU[r].processed},"compileTask");let e=!0;for(const[r,n]of uU.entries())t(r),e=e&&n.processed;return e},"compileTasks"),Rii=O(function(){return kii()},"getActors"),tnr={getConfig:O(()=>Ye().journey,"getConfig"),clear:Sii,setDiagramTitle:co,getDiagramTitle:$a,setAccTitle:Ba,getAccTitle:oo,setAccDescription:so,getAccDescription:lo,addSection:Tii,getSections:Cii,getTasks:Oii,addTask:Eii,addTaskOrg:_ii,getActors:Rii},Dii=O(t=>`.label { font-family: ${t.fontFamily}; color: ${t.textColor}; } @@ -3028,12 +3028,12 @@ Expecting `+Q.join(", ")+", got '"+(this.terminals_[M]||M)+"'":G="Parse error on ${t.actor5?`fill: ${t.actor5}`:""}; } ${T9()} -`,"getStyles"),Rii=_ii,TLe=O(function(t,e){return bte(t,e)},"drawRect"),Dii=O(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=mR().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)+")")}O(a,"smile");function o(l){const u=mR().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)+")")}O(o,"sad");function s(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 O(s,"ambivalent"),e.score>3?a(i):e.score<3?o(i):s(i),n},"drawFace"),enr=O(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"),tnr=O(function(t,e){return nFn(t,e)},"drawText"),Lii=O(function(t,e){function r(i,a,o,s,l){return i+","+a+" "+(i+o)+","+a+" "+(i+o)+","+(a+s-l)+" "+(i+o-l*1.2)+","+(a+s)+" "+i+","+(a+s)}O(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,tnr(t,e)},"drawLabel"),Mii=O(function(t,e,r){const n=t.append("g"),i=gf();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,TLe(n,i),rnr(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),CLe=-1,Iii=O(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");CLe++;const o=300+5*30;a.append("line").attr("id",n+"-task"+CLe).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",o).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Dii(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const s=gf();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=r.width,s.height=r.height,s.class="task task-type-"+e.num,s.rx=3,s.ry=3,TLe(a,s);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};enr(a,d),l+=10}),rnr(r)(e.task,a,s.x,s.y,s.width,s.height,{class:"task"},r,e.colour)},"drawTask"),Pii=O(function(t,e){Izt(t,e)},"drawBackgroundRect"),rnr=function(){function t(i,a,o,s,l,u,h,d){const f=a.append("text").attr("x",o+l/2).attr("y",s+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}O(t,"byText");function e(i,a,o,s,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let v=0;v{const a=Sb[i].color,o={cx:20,cy:n,r:7,fill:a,stroke:"#000",pos:Sb[i].position};hU.drawCircle(t,o);let s=t.append("text").attr("visibility","hidden").text(i);const l=s.node().getBoundingClientRect().width;s.remove();let u=[];if(l<=r)u=[i];else{const h=i.split(" ");let d="";s=t.append("text").attr("visibility","hidden"),h.forEach(f=>{const p=d?`${d} ${f}`:f;if(s.text(p),s.node().getBoundingClientRect().width>r){if(d&&u.push(d),d=f,s.text(f),s.node().getBoundingClientRect().width>r){let m="";for(const v of f)m+=v,s.text(m+"-"),s.node().getBoundingClientRect().width>r&&(u.push(m.slice(0,-1)+"-"),m=v);d=m}}else d=p}),d&&u.push(d),s.remove()}u.forEach((h,d)=>{const f={x:40,y:n+7+d*20,fill:"#666",text:h,textMargin:e.boxTextMargin??5},g=hU.drawText(t,f).node().getBoundingClientRect().width;g>Mie&&g>e.leftMargin-g&&(Mie=g)}),n+=Math.max(20,u.length*20)})}O(nnr,"drawActorLegend");var nm=Ye().journey,Uw=0,$ii=O(function(t,e,r,n){const i=Ye(),a=i.journey.titleColor,o=i.journey.titleFontSize,s=i.journey.titleFontFamily,l=i.securityLevel;let u;l==="sandbox"&&(u=_t("#i"+e));const h=_t(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");Gp.init();const d=h.select("#"+e);hU.initGraphics(d,e);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const w in Sb)delete Sb[w];let m=0;g.forEach(w=>{Sb[w]={color:nm.actorColours[m%nm.actorColours.length],position:m},m++}),nnr(d),Uw=nm.leftMargin+Mie,Gp.insert(0,0,Uw,Object.keys(Sb).length*50),Fii(d,f,0,e);const v=Gp.getBounds();p&&d.append("text").text(p).attr("x",Uw).attr("font-size",o).attr("font-weight","bold").attr("y",25).attr("fill",a).attr("font-family",s);const y=v.stopy-v.starty+2*nm.diagramMarginY,b=Uw+v.stopx+2*nm.diagramMarginX;jo(d,y,b,nm.useMaxWidth),d.append("line").attr("x1",Uw).attr("y1",nm.height*4).attr("x2",b-Uw-4).attr("y2",nm.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"),Gp={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:O(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:O(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:O(function(t,e,r,n){const i=Ye().journey,a=this;let o=0;function s(l){return O(function(h){o++;const d=a.sequenceItems.length-o+1;a.updateVal(h,"starty",e-d*i.boxMargin,Math.min),a.updateVal(h,"stopy",n+d*i.boxMargin,Math.max),a.updateVal(Gp.data,"startx",t-d*i.boxMargin,Math.min),a.updateVal(Gp.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(Gp.data,"starty",e-d*i.boxMargin,Math.min),a.updateVal(Gp.data,"stopy",n+d*i.boxMargin,Math.max))},"updateItemBounds")}O(s,"updateFn"),this.sequenceItems.forEach(s())},"updateBounds"),insert:O(function(t,e,r,n){const i=Math.min(t,r),a=Math.max(t,r),o=Math.min(e,n),s=Math.max(e,n);this.updateVal(Gp.data,"startx",i,Math.min),this.updateVal(Gp.data,"starty",o,Math.min),this.updateVal(Gp.data,"stopx",a,Math.max),this.updateVal(Gp.data,"stopy",s,Math.max),this.updateBounds(i,o,a,s)},"insert"),bumpVerticalPos:O(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:O(function(){return this.verticalPos},"getVerticalPos"),getBounds:O(function(){return this.data},"getBounds")},OLe=nm.sectionFills,inr=nm.sectionColours,Fii=O(function(t,e,r,n){const i=Ye().journey;let a="";const o=i.height*2+i.diagramMarginY,s=r+o;let l=0,u="#CCC",h="black",d=0;for(const[f,p]of e.entries()){if(a!==p.section){u=OLe[l%OLe.length],d=l%OLe.length,h=inr[l%inr.length];let m=0;const v=p.section;for(let b=f;b(Sb[v]&&(m[v]=Sb[v]),m),{});p.x=f*i.taskMargin+f*i.width+Uw,p.y=s,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=h,p.fill=u,p.num=d,p.actors=g,hU.drawTask(t,p,i,n),Gp.insert(p.x,p.y,p.x+p.width+i.taskMargin,300+5*30)}},"drawTasks"),anr={setConf:Bii,draw:$ii},zii={parser:xii,db:Jrr,renderer:anr,styles:Rii,init:O(t=>{anr.setConf(t.journey),Jrr.clear()},"init")};const Uii=Object.freeze(Object.defineProperty({__proto__:null,diagram:zii},Symbol.toStringTag,{value:"Module"}));var kLe=function(){var t=O(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],o=[1,16],s=[1,19],l=[1,20],u={trace:O(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:O(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:o,21:17,22:18,23:s,24:l},t(e,[2,10],{1:[2,1]}),t(e,[2,6]),{12:21,14:r,15:n,17:i,19:a,20:o,21:17,22:18,23:s,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:O(function(p,g){if(g.recoverable)this.trace(p);else{var m=new Error(p);throw m.hash=g,m}},"parseError"),parse:O(function(p){var g=this,m=[0],v=[],y=[null],b=[],x=this.table,w="",A=0,S=0,T=2,C=1,k=b.slice.call(arguments,1),E=Object.create(this.lexer),_={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(_.yy[P]=this.yy[P]);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}O(D,"popStack");function M(){var Y;return Y=v.pop()||E.lex()||C,typeof Y!="number"&&(Y instanceof Array&&(v=Y,Y=v.pop()),Y=g.symbols_[Y]||Y),Y}O(M,"lex");for(var I,N,F,B,V={},z,U,Q,G;;){if(N=m[m.length-1],this.defaultActions[N]?F=this.defaultActions[N]:((I===null||typeof I>"u")&&(I=M()),F=x[N]&&x[N][I]),typeof F>"u"||!F.length||!F[0]){var q="";G=[];for(z in x[N])this.terminals_[z]&&z>T&&G.push("'"+this.terminals_[z]+"'");E.showPosition?q="Parse error on line "+(A+1)+`: +`,"getStyles"),Lii=Dii,TLe=O(function(t,e){return bte(t,e)},"drawRect"),Mii=O(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=mR().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)+")")}O(a,"smile");function o(l){const u=mR().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)+")")}O(o,"sad");function s(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 O(s,"ambivalent"),e.score>3?a(i):e.score<3?o(i):s(i),n},"drawFace"),rnr=O(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"),nnr=O(function(t,e){return aFn(t,e)},"drawText"),Iii=O(function(t,e){function r(i,a,o,s,l){return i+","+a+" "+(i+o)+","+a+" "+(i+o)+","+(a+s-l)+" "+(i+o-l*1.2)+","+(a+s)+" "+i+","+(a+s)}O(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,nnr(t,e)},"drawLabel"),Pii=O(function(t,e,r){const n=t.append("g"),i=gf();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,TLe(n,i),inr(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),CLe=-1,Nii=O(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");CLe++;const o=300+5*30;a.append("line").attr("id",n+"-task"+CLe).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",o).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Mii(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const s=gf();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=r.width,s.height=r.height,s.class="task task-type-"+e.num,s.rx=3,s.ry=3,TLe(a,s);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};rnr(a,d),l+=10}),inr(r)(e.task,a,s.x,s.y,s.width,s.height,{class:"task"},r,e.colour)},"drawTask"),Bii=O(function(t,e){Nzt(t,e)},"drawBackgroundRect"),inr=function(){function t(i,a,o,s,l,u,h,d){const f=a.append("text").attr("x",o+l/2).attr("y",s+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}O(t,"byText");function e(i,a,o,s,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let v=0;v{const a=Sb[i].color,o={cx:20,cy:n,r:7,fill:a,stroke:"#000",pos:Sb[i].position};hU.drawCircle(t,o);let s=t.append("text").attr("visibility","hidden").text(i);const l=s.node().getBoundingClientRect().width;s.remove();let u=[];if(l<=r)u=[i];else{const h=i.split(" ");let d="";s=t.append("text").attr("visibility","hidden"),h.forEach(f=>{const p=d?`${d} ${f}`:f;if(s.text(p),s.node().getBoundingClientRect().width>r){if(d&&u.push(d),d=f,s.text(f),s.node().getBoundingClientRect().width>r){let m="";for(const v of f)m+=v,s.text(m+"-"),s.node().getBoundingClientRect().width>r&&(u.push(m.slice(0,-1)+"-"),m=v);d=m}}else d=p}),d&&u.push(d),s.remove()}u.forEach((h,d)=>{const f={x:40,y:n+7+d*20,fill:"#666",text:h,textMargin:e.boxTextMargin??5},g=hU.drawText(t,f).node().getBoundingClientRect().width;g>Mie&&g>e.leftMargin-g&&(Mie=g)}),n+=Math.max(20,u.length*20)})}O(anr,"drawActorLegend");var nm=Ye().journey,Uw=0,zii=O(function(t,e,r,n){const i=Ye(),a=i.journey.titleColor,o=i.journey.titleFontSize,s=i.journey.titleFontFamily,l=i.securityLevel;let u;l==="sandbox"&&(u=_t("#i"+e));const h=_t(l==="sandbox"?u.nodes()[0].contentDocument.body:"body");Gp.init();const d=h.select("#"+e);hU.initGraphics(d,e);const f=n.db.getTasks(),p=n.db.getDiagramTitle(),g=n.db.getActors();for(const w in Sb)delete Sb[w];let m=0;g.forEach(w=>{Sb[w]={color:nm.actorColours[m%nm.actorColours.length],position:m},m++}),anr(d),Uw=nm.leftMargin+Mie,Gp.insert(0,0,Uw,Object.keys(Sb).length*50),Uii(d,f,0,e);const v=Gp.getBounds();p&&d.append("text").text(p).attr("x",Uw).attr("font-size",o).attr("font-weight","bold").attr("y",25).attr("fill",a).attr("font-family",s);const y=v.stopy-v.starty+2*nm.diagramMarginY,b=Uw+v.stopx+2*nm.diagramMarginX;jo(d,y,b,nm.useMaxWidth),d.append("line").attr("x1",Uw).attr("y1",nm.height*4).attr("x2",b-Uw-4).attr("y2",nm.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"),Gp={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:O(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:O(function(t,e,r,n){t[e]===void 0?t[e]=r:t[e]=n(r,t[e])},"updateVal"),updateBounds:O(function(t,e,r,n){const i=Ye().journey,a=this;let o=0;function s(l){return O(function(h){o++;const d=a.sequenceItems.length-o+1;a.updateVal(h,"starty",e-d*i.boxMargin,Math.min),a.updateVal(h,"stopy",n+d*i.boxMargin,Math.max),a.updateVal(Gp.data,"startx",t-d*i.boxMargin,Math.min),a.updateVal(Gp.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(Gp.data,"starty",e-d*i.boxMargin,Math.min),a.updateVal(Gp.data,"stopy",n+d*i.boxMargin,Math.max))},"updateItemBounds")}O(s,"updateFn"),this.sequenceItems.forEach(s())},"updateBounds"),insert:O(function(t,e,r,n){const i=Math.min(t,r),a=Math.max(t,r),o=Math.min(e,n),s=Math.max(e,n);this.updateVal(Gp.data,"startx",i,Math.min),this.updateVal(Gp.data,"starty",o,Math.min),this.updateVal(Gp.data,"stopx",a,Math.max),this.updateVal(Gp.data,"stopy",s,Math.max),this.updateBounds(i,o,a,s)},"insert"),bumpVerticalPos:O(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:O(function(){return this.verticalPos},"getVerticalPos"),getBounds:O(function(){return this.data},"getBounds")},OLe=nm.sectionFills,onr=nm.sectionColours,Uii=O(function(t,e,r,n){const i=Ye().journey;let a="";const o=i.height*2+i.diagramMarginY,s=r+o;let l=0,u="#CCC",h="black",d=0;for(const[f,p]of e.entries()){if(a!==p.section){u=OLe[l%OLe.length],d=l%OLe.length,h=onr[l%onr.length];let m=0;const v=p.section;for(let b=f;b(Sb[v]&&(m[v]=Sb[v]),m),{});p.x=f*i.taskMargin+f*i.width+Uw,p.y=s,p.width=i.diagramMarginX,p.height=i.diagramMarginY,p.colour=h,p.fill=u,p.num=d,p.actors=g,hU.drawTask(t,p,i,n),Gp.insert(p.x,p.y,p.x+p.width+i.taskMargin,300+5*30)}},"drawTasks"),snr={setConf:Fii,draw:zii},Vii={parser:Aii,db:tnr,renderer:snr,styles:Lii,init:O(t=>{snr.setConf(t.journey),tnr.clear()},"init")};const Qii=Object.freeze(Object.defineProperty({__proto__:null,diagram:Vii},Symbol.toStringTag,{value:"Module"}));var kLe=function(){var t=O(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],o=[1,16],s=[1,19],l=[1,20],u={trace:O(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:O(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:o,21:17,22:18,23:s,24:l},t(e,[2,10],{1:[2,1]}),t(e,[2,6]),{12:21,14:r,15:n,17:i,19:a,20:o,21:17,22:18,23:s,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:O(function(p,g){if(g.recoverable)this.trace(p);else{var m=new Error(p);throw m.hash=g,m}},"parseError"),parse:O(function(p){var g=this,m=[0],v=[],y=[null],b=[],x=this.table,w="",A=0,S=0,T=2,C=1,k=b.slice.call(arguments,1),E=Object.create(this.lexer),_={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(_.yy[P]=this.yy[P]);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}O(D,"popStack");function M(){var Y;return Y=v.pop()||E.lex()||C,typeof Y!="number"&&(Y instanceof Array&&(v=Y,Y=v.pop()),Y=g.symbols_[Y]||Y),Y}O(M,"lex");for(var I,N,F,B,V={},z,U,Q,G;;){if(N=m[m.length-1],this.defaultActions[N]?F=this.defaultActions[N]:((I===null||typeof I>"u")&&(I=M()),F=x[N]&&x[N][I]),typeof F>"u"||!F.length||!F[0]){var q="";G=[];for(z in x[N])this.terminals_[z]&&z>T&&G.push("'"+this.terminals_[z]+"'");E.showPosition?q="Parse error on line "+(A+1)+`: `+E.showPosition()+` Expecting `+G.join(", ")+", got '"+(this.terminals_[I]||I)+"'":q="Parse error on line "+(A+1)+": Unexpected "+(I==C?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(q,{text:E.match,token:this.terminals_[I]||I,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: "+I);switch(F[0]){case 1:m.push(I),y.push(E.yytext),b.push(E.yylloc),m.push(F[1]),I=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:O(function(g,m){if(this.yy.parser)this.yy.parser.parseError(g,m);else throw new Error(g)},"parseError"),setInput:O(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:O(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:O(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:O(function(){return this._more=!0,this},"more"),reject:O(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:O(function(p){this.unput(this.match.slice(p))},"less"),pastInput:O(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:O(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:O(function(){var p=this.pastInput(),g=new Array(p.length+1).join("-");return p+this.upcomingInput()+` `+g+"^"},"showPosition"),test_match:O(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:O(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:O(function(){var g=this.next();return g||this.lex()},"lex"),begin:O(function(g){this.conditionStack.push(g)},"begin"),popState:O(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:O(function(g){this.begin(g)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(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 O(d,"Parser"),d.prototype=u,u.Parser=d,new d}();kLe.parser=kLe;var Vii=kLe,onr={};yj(onr,{addEvent:()=>mnr,addSection:()=>dnr,addTask:()=>gnr,addTaskOrg:()=>vnr,clear:()=>cnr,default:()=>Qii,getCommonDb:()=>lnr,getDirection:()=>hnr,getSections:()=>fnr,getTasks:()=>pnr,setDirection:()=>unr});var _D="",snr=0,ELe="LR",_Le=[],Iie=[],RD=[],lnr=O(()=>N1e,"getCommonDb"),cnr=O(function(){_Le.length=0,Iie.length=0,_D="",RD.length=0,ELe="LR",_a()},"clear"),unr=O(function(t){ELe=t},"setDirection"),hnr=O(function(){return ELe},"getDirection"),dnr=O(function(t){_D=t,_Le.push(t)},"addSection"),fnr=O(function(){return _Le},"getSections"),pnr=O(function(){let t=ynr();const e=100;let r=0;for(;!t&&rr.id===snr-1).events.push(t)},"addEvent"),vnr=O(function(t){const e={section:_D,type:_D,description:t,task:t,classes:[]};Iie.push(e)},"addTaskOrg"),ynr=O(function(){const t=O(function(r){return RD[r].processed},"compileTask");let e=!0;for(const[r,n]of RD.entries())t(r),e=e&&n.processed;return e},"compileTasks"),Qii={clear:cnr,getCommonDb:lnr,getDirection:hnr,setDirection:unr,addSection:dnr,getSections:fnr,getTasks:pnr,addTask:gnr,addTaskOrg:vnr,addEvent:mnr},bnr=0,Pie=O(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"),Gii=O(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=mR().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)+")")}O(a,"smile");function o(l){const u=mR().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)+")")}O(o,"sad");function s(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 O(s,"ambivalent"),e.score>3?a(i):e.score<3?o(i):s(i),n},"drawFace"),Hii=O(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"),xnr=O(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"),Wii=O(function(t,e){function r(i,a,o,s,l){return i+","+a+" "+(i+o)+","+a+" "+(i+o)+","+(a+s-l)+" "+(i+o-l*1.2)+","+(a+s)+" "+i+","+(a+s)}O(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,xnr(t,e)},"drawLabel"),Yii=O(function(t,e,r){const n=t.append("g"),i=DLe();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,Pie(n,i),wnr(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),RLe=-1,qii=O(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");RLe++;const o=300+5*30;a.append("line").attr("id",n+"-task"+RLe).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",o).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Gii(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const s=DLe();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=r.width,s.height=r.height,s.class="task task-type-"+e.num,s.rx=3,s.ry=3,Pie(a,s),wnr(r)(e.task,a,s.x,s.y,s.width,s.height,{class:"task"},r,e.colour)},"drawTask"),jii=O(function(t,e){Pie(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),Xii=O(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),DLe=O(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),wnr=function(){function t(i,a,o,s,l,u,h,d){const f=a.append("text").attr("x",o+l/2).attr("y",s+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}O(t,"byText");function e(i,a,o,s,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let v=0;v)/).reverse(),i,a=[],o=1.1,s=r.attr("y"),l=parseFloat(r.attr("dy")),u=r.text(null).append("tspan").attr("x",0).attr("y",s).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",s).attr("dy",o+"em").text(i))})}O(LLe,"wrap");var Zii=O(function(t,e,r,n,i,a=!1){var y,b,x;const{theme:o,look:s}=n,l=o==null?void 0:o.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(LLe,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})`),eai(f,e,h,i,n),s==="neo"&&(d.attr("data-look","neo"),l)){const w=o.includes("dark"),A=((x=t.node())==null?void 0:x.ownerSVGElement)??t.node(),S=_t(A),T=S.attr("id")??"",C=T?`${T}-drop-shadow`:"drop-shadow";if(S.select(`#${C}`).empty()){const k=S.select("defs");(k.empty()?S.append("defs"):k).append("filter").attr("id",C).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"),Jii=O(function(t,e,r){var s;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(LLe,e.width).node().getBBox(),o=(s=r.fontSize)!=null&&s.replace?r.fontSize.replace("px",""):r.fontSize;return n.remove(),a.height+o*1.1*.5+e.padding},"getVirtualNodeHeight"),eai=O(function(t,e,r,n,i){const{theme:a}=i,o=a!=null&&a.includes("redux")?0:5,s=5,l=o>0?`M0 ${e.height-s} v${-e.height+2*s} q0,-${o},${o},-${o} h${e.width-2*s} q${o},0,${o},${o} v${e.height-s} H0 Z`:`M0 ${e.height-s} v${-(e.height-s)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",n+"-node-"+bnr++).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"),dd={drawRect:Pie,drawCircle:Hii,drawSection:Yii,drawText:xnr,drawLabel:Wii,drawTask:qii,drawBackgroundRect:jii,getTextObj:Xii,getNoteRect:DLe,initGraphics:Kii,drawNode:Zii,getVirtualNodeHeight:Jii},tai=O(function(t,e,r,n){var D,M,I;const i=Ye(),{look:a,theme:o,themeVariables:s}=i,{useGradient:l,gradientStart:u,gradientStop:h}=s,d=((D=i.timeline)==null?void 0:D.leftMargin)??50;ye.debug("timeline",n.db);const f=i.securityLevel;let p;f==="sandbox"&&(p=_t("#i"+e));const m=_t(f==="sandbox"?p.nodes()[0].contentDocument.body:"body").select("#"+e);m.append("g");const v=n.db.getTasks(),y=n.db.getCommonDb().getDiagramTitle();ye.debug("task",v),dd.initGraphics(m,e);const b=n.db.getSections();ye.debug("sections",b);let x=0,w=0,A=0,S=0,T=50+d,C=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=dd.getVirtualNodeHeight(m,F,i);ye.debug("sectionHeight before draw",B),x=Math.max(x,B+20)});let _=0,P=0;ye.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=dd.getVirtualNodeHeight(m,B,i);ye.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+=dd.getVirtualNodeHeight(m,Q,i)}F.events.length>0&&(z+=(F.events.length-1)*10),P=Math.max(P,z)}ye.debug("maxSectionHeight before draw",x),ye.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};ye.debug("sectionNode",B);const V=m.append("g"),z=dd.drawNode(V,B,k,i,e);ye.debug("sectionNode output",z),V.attr("transform",`translate(${T}, ${S})`),C+=x+50,F.length>0&&Anr(m,F,k,T,C,w,i,_,P,x,!1,e),T+=200*Math.max(F.length,1),C=S,k++}):(E=!1,Anr(m,v,k,T,C,w,i,_,P,x,!0,e));const L=m.node().getBBox();if(ye.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&&o!=="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)}iR(void 0,m,((M=i.timeline)==null?void 0:M.padding)??50,((I=i.timeline)==null?void 0:I.useMaxWidth)??!1)},"draw"),Anr=O(function(t,e,r,n,i,a,o,s,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};ye.debug("taskNode",g);const m=t.append("g").attr("class","taskWrapper"),y=dd.drawNode(m,g,r,o,d).height;if(ye.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+rai(t,p.events,r,n,i,o,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=o.timeline)!=null&&f.disableMulticolor)&&r++}i=i-10},"drawTasks"),rai=O(function(t,e,r,n,i,a,o){let s=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};ye.debug("eventNode",h);const d=t.append("g").attr("class","eventWrapper"),p=dd.drawNode(d,h,r,a,o,!0).height;s=s+p,d.attr("transform",`translate(${n}, ${i})`),i=i+10+p}return i=l,s},"drawEvents"),nai={setConf:O(()=>{},"setConf"),draw:tai},Nie=200,Tb=5,iai=Nie+Tb*2,MLe=Nie+100,aai=MLe+Tb*2,Snr=10,oai=0,Tnr=20,Cnr=20,Onr=30,knr=50,sai=O(function(t,e,r,n){var D,M,I,N,F;const i=Ye(),a=((D=i.timeline)==null?void 0:D.leftMargin)??50;ye.debug("timeline",n.db);const o=nu(e);o.append("g");const s=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();ye.debug("task",s),dd.initGraphics(o);const u=n.db.getSections();ye.debug("sections",u);let h=0,d=0;const f=50+a;let p=50;const g=p,m=f,v=iai+Cnr,y=aai+knr,b=m+v;let x=0;const w=u&&u.length>0,A=w?b:f+v,S=Math.max(50,v+y-Tb*2);u.forEach(function(B){const V={number:x,descr:B,section:x,width:S,padding:Tb,maxHeight:h},z=dd.getVirtualNodeHeight(o,V,i);ye.debug("sectionHeight before draw",z),h=Math.max(h,z)});let T=0;ye.debug("tasks.length",s.length);for(const[B,V]of s.entries()){const z={number:B,descr:V,section:V.section,width:Nie,padding:Tb,maxHeight:d},U=dd.getVirtualNodeHeight(o,z,i);ye.debug("taskHeight before draw",U),d=Math.max(d,U);let Q=0;for(const G of V.events){const q={descr:G,section:V.section,number:V.section,width:MLe,padding:Tb,maxHeight:50};Q+=dd.getVirtualNodeHeight(o,q,i)}V.events.length>0&&(Q+=(V.events.length-1)*Snr),T=Math.max(T,Q)+oai}ye.debug("maxSectionHeight before draw",h),ye.debug("maxTaskHeight before draw",d);const k=Math.max(d,T)+Onr;w?u.forEach(B=>{const V=s.filter(X=>X.section===B),z={number:x,descr:B,section:x,width:S,padding:Tb,maxHeight:h};ye.debug("sectionNode",z);const U=o.append("g"),Q=dd.drawNode(U,z,x,i);ye.debug("sectionNode output",Q);const G=A-v;U.attr("transform",`translate(${G}, ${p})`);const q=p+Q.height+Tnr;V.length>0&&Enr(o,V,x,A,q,d,i,k,!1);const Y=V.length,ne=Q.height+Tnr+k*Math.max(Y,1)-(Y>0?Onr*2:0);p+=ne,x++}):Enr(o,s,x,A,p,d,i,k,!0);let E=(M=o.node())==null?void 0:M.getBBox();if(!E)throw new Error("bbox not found");if(ye.debug("bounds",E),l){if(o.append("text").text(l).attr("x",E.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),E=(I=o.node())==null?void 0:I.getBBox(),!E)throw new Error("bbox not found");ye.debug("bounds after title",E)}const[_]=a1(i.fontSize),P=(_??16)*2,L=(_??16)*.5+20,R=o.append("g").attr("class","lineWrapper");R.append("line").attr("x1",A).attr("y1",g-P).attr("x2",A).attr("y2",E.y+E.height+L).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),R.lower(),iR(void 0,o,((N=i.timeline)==null?void 0:N.padding)??50,((F=i.timeline)==null?void 0:F.useMaxWidth)??!1)},"draw"),Enr=O(function(t,e,r,n,i,a,o,s,l){var u;for(const h of e){const d={descr:h.task,section:r,number:r,width:Nie,padding:Tb,maxHeight:a};ye.debug("taskNode",d);const f=t.append("g").attr("class","taskWrapper"),p=dd.drawNode(f,d,r,o),g=p.height;ye.debug("taskHeight after draw",g);const m=n-Cnr-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+knr;lai(t,h.events,r,n,y,v,o)}i=i+s,l&&!((u=o.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),lai=O(function(t,e,r,n,i,a,o){let s=a;for(const l of e){const u={descr:l,section:r,number:r,width:MLe,padding:Tb,maxHeight:0};ye.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=dd.drawNode(h,u,r,o).height;h.attr("transform",`translate(${i}, ${s})`);const p=t.append("g").attr("class","lineWrapper"),g=s+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"),s=s+f+Snr}return s-a},"drawEvents"),cai={setConf:O(()=>{},"setConf"),draw:sai},uai=O(t=>{var s;const{theme:e}=Dr(),r=e==null?void 0:e.includes("dark"),n=e==null?void 0:e.includes("color"),i=((s=t.svgId)==null?void 0:s.replace(/^#/,""))??"",a=i?`url(#${i}-drop-shadow)`:t.dropShadow??"none";let o="";for(let l=0;l0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:O(function(g){this.begin(g)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(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 O(d,"Parser"),d.prototype=u,u.Parser=d,new d}();kLe.parser=kLe;var Gii=kLe,lnr={};yj(lnr,{addEvent:()=>ynr,addSection:()=>pnr,addTask:()=>vnr,addTaskOrg:()=>bnr,clear:()=>hnr,default:()=>Hii,getCommonDb:()=>unr,getDirection:()=>fnr,getSections:()=>gnr,getTasks:()=>mnr,setDirection:()=>dnr});var _D="",cnr=0,ELe="LR",_Le=[],Iie=[],RD=[],unr=O(()=>N1e,"getCommonDb"),hnr=O(function(){_Le.length=0,Iie.length=0,_D="",RD.length=0,ELe="LR",_a()},"clear"),dnr=O(function(t){ELe=t},"setDirection"),fnr=O(function(){return ELe},"getDirection"),pnr=O(function(t){_D=t,_Le.push(t)},"addSection"),gnr=O(function(){return _Le},"getSections"),mnr=O(function(){let t=xnr();const e=100;let r=0;for(;!t&&rr.id===cnr-1).events.push(t)},"addEvent"),bnr=O(function(t){const e={section:_D,type:_D,description:t,task:t,classes:[]};Iie.push(e)},"addTaskOrg"),xnr=O(function(){const t=O(function(r){return RD[r].processed},"compileTask");let e=!0;for(const[r,n]of RD.entries())t(r),e=e&&n.processed;return e},"compileTasks"),Hii={clear:hnr,getCommonDb:unr,getDirection:fnr,setDirection:dnr,addSection:pnr,getSections:gnr,getTasks:mnr,addTask:vnr,addTaskOrg:bnr,addEvent:ynr},wnr=0,Pie=O(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"),Wii=O(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=mR().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)+")")}O(a,"smile");function o(l){const u=mR().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)+")")}O(o,"sad");function s(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 O(s,"ambivalent"),e.score>3?a(i):e.score<3?o(i):s(i),n},"drawFace"),Yii=O(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"),Anr=O(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"),qii=O(function(t,e){function r(i,a,o,s,l){return i+","+a+" "+(i+o)+","+a+" "+(i+o)+","+(a+s-l)+" "+(i+o-l*1.2)+","+(a+s)+" "+i+","+(a+s)}O(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,Anr(t,e)},"drawLabel"),jii=O(function(t,e,r){const n=t.append("g"),i=DLe();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,Pie(n,i),Snr(r)(e.text,n,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},r,e.colour)},"drawSection"),RLe=-1,Xii=O(function(t,e,r,n){const i=e.x+r.width/2,a=t.append("g");RLe++;const o=300+5*30;a.append("line").attr("id",n+"-task"+RLe).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",o).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Wii(a,{cx:i,cy:300+(5-e.score)*30,score:e.score});const s=DLe();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=r.width,s.height=r.height,s.class="task task-type-"+e.num,s.rx=3,s.ry=3,Pie(a,s),Snr(r)(e.task,a,s.x,s.y,s.width,s.height,{class:"task"},r,e.colour)},"drawTask"),Kii=O(function(t,e){Pie(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),Zii=O(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),DLe=O(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Snr=function(){function t(i,a,o,s,l,u,h,d){const f=a.append("text").attr("x",o+l/2).attr("y",s+u/2+5).style("font-color",d).style("text-anchor","middle").text(i);n(f,h)}O(t,"byText");function e(i,a,o,s,l,u,h,d,f){const{taskFontSize:p,taskFontFamily:g}=d,m=i.split(//gi);for(let v=0;v)/).reverse(),i,a=[],o=1.1,s=r.attr("y"),l=parseFloat(r.attr("dy")),u=r.text(null).append("tspan").attr("x",0).attr("y",s).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",s).attr("dy",o+"em").text(i))})}O(LLe,"wrap");var eai=O(function(t,e,r,n,i,a=!1){var y,b,x;const{theme:o,look:s}=n,l=o==null?void 0:o.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(LLe,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})`),rai(f,e,h,i,n),s==="neo"&&(d.attr("data-look","neo"),l)){const w=o.includes("dark"),A=((x=t.node())==null?void 0:x.ownerSVGElement)??t.node(),S=_t(A),T=S.attr("id")??"",C=T?`${T}-drop-shadow`:"drop-shadow";if(S.select(`#${C}`).empty()){const k=S.select("defs");(k.empty()?S.append("defs"):k).append("filter").attr("id",C).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"),tai=O(function(t,e,r){var s;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(LLe,e.width).node().getBBox(),o=(s=r.fontSize)!=null&&s.replace?r.fontSize.replace("px",""):r.fontSize;return n.remove(),a.height+o*1.1*.5+e.padding},"getVirtualNodeHeight"),rai=O(function(t,e,r,n,i){const{theme:a}=i,o=a!=null&&a.includes("redux")?0:5,s=5,l=o>0?`M0 ${e.height-s} v${-e.height+2*s} q0,-${o},${o},-${o} h${e.width-2*s} q${o},0,${o},${o} v${e.height-s} H0 Z`:`M0 ${e.height-s} v${-(e.height-s)} h${e.width} v${e.height} H0 Z`;t.append("path").attr("id",n+"-node-"+wnr++).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"),dd={drawRect:Pie,drawCircle:Yii,drawSection:jii,drawText:Anr,drawLabel:qii,drawTask:Xii,drawBackgroundRect:Kii,getTextObj:Zii,getNoteRect:DLe,initGraphics:Jii,drawNode:eai,getVirtualNodeHeight:tai},nai=O(function(t,e,r,n){var D,M,I;const i=Ye(),{look:a,theme:o,themeVariables:s}=i,{useGradient:l,gradientStart:u,gradientStop:h}=s,d=((D=i.timeline)==null?void 0:D.leftMargin)??50;ye.debug("timeline",n.db);const f=i.securityLevel;let p;f==="sandbox"&&(p=_t("#i"+e));const m=_t(f==="sandbox"?p.nodes()[0].contentDocument.body:"body").select("#"+e);m.append("g");const v=n.db.getTasks(),y=n.db.getCommonDb().getDiagramTitle();ye.debug("task",v),dd.initGraphics(m,e);const b=n.db.getSections();ye.debug("sections",b);let x=0,w=0,A=0,S=0,T=50+d,C=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=dd.getVirtualNodeHeight(m,F,i);ye.debug("sectionHeight before draw",B),x=Math.max(x,B+20)});let _=0,P=0;ye.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=dd.getVirtualNodeHeight(m,B,i);ye.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+=dd.getVirtualNodeHeight(m,Q,i)}F.events.length>0&&(z+=(F.events.length-1)*10),P=Math.max(P,z)}ye.debug("maxSectionHeight before draw",x),ye.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};ye.debug("sectionNode",B);const V=m.append("g"),z=dd.drawNode(V,B,k,i,e);ye.debug("sectionNode output",z),V.attr("transform",`translate(${T}, ${S})`),C+=x+50,F.length>0&&Tnr(m,F,k,T,C,w,i,_,P,x,!1,e),T+=200*Math.max(F.length,1),C=S,k++}):(E=!1,Tnr(m,v,k,T,C,w,i,_,P,x,!0,e));const L=m.node().getBBox();if(ye.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&&o!=="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)}iR(void 0,m,((M=i.timeline)==null?void 0:M.padding)??50,((I=i.timeline)==null?void 0:I.useMaxWidth)??!1)},"draw"),Tnr=O(function(t,e,r,n,i,a,o,s,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};ye.debug("taskNode",g);const m=t.append("g").attr("class","taskWrapper"),y=dd.drawNode(m,g,r,o,d).height;if(ye.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+iai(t,p.events,r,n,i,o,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=o.timeline)!=null&&f.disableMulticolor)&&r++}i=i-10},"drawTasks"),iai=O(function(t,e,r,n,i,a,o){let s=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};ye.debug("eventNode",h);const d=t.append("g").attr("class","eventWrapper"),p=dd.drawNode(d,h,r,a,o,!0).height;s=s+p,d.attr("transform",`translate(${n}, ${i})`),i=i+10+p}return i=l,s},"drawEvents"),aai={setConf:O(()=>{},"setConf"),draw:nai},Nie=200,Tb=5,oai=Nie+Tb*2,MLe=Nie+100,sai=MLe+Tb*2,Cnr=10,lai=0,Onr=20,knr=20,Enr=30,_nr=50,cai=O(function(t,e,r,n){var D,M,I,N,F;const i=Ye(),a=((D=i.timeline)==null?void 0:D.leftMargin)??50;ye.debug("timeline",n.db);const o=nu(e);o.append("g");const s=n.db.getTasks(),l=n.db.getCommonDb().getDiagramTitle();ye.debug("task",s),dd.initGraphics(o);const u=n.db.getSections();ye.debug("sections",u);let h=0,d=0;const f=50+a;let p=50;const g=p,m=f,v=oai+knr,y=sai+_nr,b=m+v;let x=0;const w=u&&u.length>0,A=w?b:f+v,S=Math.max(50,v+y-Tb*2);u.forEach(function(B){const V={number:x,descr:B,section:x,width:S,padding:Tb,maxHeight:h},z=dd.getVirtualNodeHeight(o,V,i);ye.debug("sectionHeight before draw",z),h=Math.max(h,z)});let T=0;ye.debug("tasks.length",s.length);for(const[B,V]of s.entries()){const z={number:B,descr:V,section:V.section,width:Nie,padding:Tb,maxHeight:d},U=dd.getVirtualNodeHeight(o,z,i);ye.debug("taskHeight before draw",U),d=Math.max(d,U);let Q=0;for(const G of V.events){const q={descr:G,section:V.section,number:V.section,width:MLe,padding:Tb,maxHeight:50};Q+=dd.getVirtualNodeHeight(o,q,i)}V.events.length>0&&(Q+=(V.events.length-1)*Cnr),T=Math.max(T,Q)+lai}ye.debug("maxSectionHeight before draw",h),ye.debug("maxTaskHeight before draw",d);const k=Math.max(d,T)+Enr;w?u.forEach(B=>{const V=s.filter(X=>X.section===B),z={number:x,descr:B,section:x,width:S,padding:Tb,maxHeight:h};ye.debug("sectionNode",z);const U=o.append("g"),Q=dd.drawNode(U,z,x,i);ye.debug("sectionNode output",Q);const G=A-v;U.attr("transform",`translate(${G}, ${p})`);const q=p+Q.height+Onr;V.length>0&&Rnr(o,V,x,A,q,d,i,k,!1);const Y=V.length,ne=Q.height+Onr+k*Math.max(Y,1)-(Y>0?Enr*2:0);p+=ne,x++}):Rnr(o,s,x,A,p,d,i,k,!0);let E=(M=o.node())==null?void 0:M.getBBox();if(!E)throw new Error("bbox not found");if(ye.debug("bounds",E),l){if(o.append("text").text(l).attr("x",E.width/2-a).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),E=(I=o.node())==null?void 0:I.getBBox(),!E)throw new Error("bbox not found");ye.debug("bounds after title",E)}const[_]=a1(i.fontSize),P=(_??16)*2,L=(_??16)*.5+20,R=o.append("g").attr("class","lineWrapper");R.append("line").attr("x1",A).attr("y1",g-P).attr("x2",A).attr("y2",E.y+E.height+L).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),R.lower(),iR(void 0,o,((N=i.timeline)==null?void 0:N.padding)??50,((F=i.timeline)==null?void 0:F.useMaxWidth)??!1)},"draw"),Rnr=O(function(t,e,r,n,i,a,o,s,l){var u;for(const h of e){const d={descr:h.task,section:r,number:r,width:Nie,padding:Tb,maxHeight:a};ye.debug("taskNode",d);const f=t.append("g").attr("class","taskWrapper"),p=dd.drawNode(f,d,r,o),g=p.height;ye.debug("taskHeight after draw",g);const m=n-knr-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+_nr;uai(t,h.events,r,n,y,v,o)}i=i+s,l&&!((u=o.timeline)!=null&&u.disableMulticolor)&&r++}},"drawTasks"),uai=O(function(t,e,r,n,i,a,o){let s=a;for(const l of e){const u={descr:l,section:r,number:r,width:MLe,padding:Tb,maxHeight:0};ye.debug("eventNode",u);const h=t.append("g").attr("class","eventWrapper"),f=dd.drawNode(h,u,r,o).height;h.attr("transform",`translate(${i}, ${s})`);const p=t.append("g").attr("class","lineWrapper"),g=s+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"),s=s+f+Cnr}return s-a},"drawEvents"),hai={setConf:O(()=>{},"setConf"),draw:cai},dai=O(t=>{var s;const{theme:e}=Dr(),r=e==null?void 0:e.includes("dark"),n=e==null?void 0:e.includes("color"),i=((s=t.svgId)==null?void 0:s.replace(/^#/,""))??"",a=i?`url(#${i}-drop-shadow)`:t.dropShadow??"none";let o="";for(let l=0;l{let e="";for(let r=0;r{let e="";for(let r=0;r{var o;const{theme:e}=Dr(),r=e==null?void 0:e.includes("redux"),n=e==="neutral",i=((o=t.svgId)==null?void 0:o.replace(/^#/,""))??"";let a="";if(t.useGradient&&i&&t.THEME_COLOR_LIMIT&&!n)for(let s=0;s{var o;const{theme:e}=Dr(),r=e==null?void 0:e.includes("redux"),n=e==="neutral",i=((o=t.svgId)==null?void 0:o.replace(/^#/,""))??"";let a="";if(t.useGradient&&i&&t.THEME_COLOR_LIMIT&&!n)for(let s=0;s{},"setConf"),draw:O((t,e,r,n)=>{var a,o;return(((o=(a=n==null?void 0:n.db)==null?void 0:a.getDirection)==null?void 0:o.call(a))??"LR")==="TD"?cai.draw(t,e,r,n):nai.draw(t,e,r,n)},"draw")},gai={db:onr,renderer:pai,parser:Vii,styles:fai};const mai=Object.freeze(Object.defineProperty({__proto__:null,diagram:gai},Symbol.toStringTag,{value:"Module"})),Nc=[];for(let t=0;t<256;++t)Nc.push((t+256).toString(16).slice(1));function vai(t,e=0){return(Nc[t[e+0]]+Nc[t[e+1]]+Nc[t[e+2]]+Nc[t[e+3]]+"-"+Nc[t[e+4]]+Nc[t[e+5]]+"-"+Nc[t[e+6]]+Nc[t[e+7]]+"-"+Nc[t[e+8]]+Nc[t[e+9]]+"-"+Nc[t[e+10]]+Nc[t[e+11]]+Nc[t[e+12]]+Nc[t[e+13]]+Nc[t[e+14]]+Nc[t[e+15]]).toLowerCase()}const yai=new Uint8Array(16);function bai(){return crypto.getRandomValues(yai)}function xai(t,e,r){return crypto.randomUUID?crypto.randomUUID():wai(t)}function wai(t,e,r){var i;t=t||{};const n=t.random??((i=t.rng)==null?void 0:i.call(t))??bai();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,vai(n)}var ILe=function(){var t=O(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],o=[1,20],s=[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:O(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:O(function(A,S,T,C,k,E,_){var P=E.length-1;switch(k){case 6:case 7:return C;case 8:C.getLogger().trace("Stop NL ");break;case 9:C.getLogger().trace("Stop EOF ");break;case 11:C.getLogger().trace("Stop NL2 ");break;case 12:C.getLogger().trace("Stop EOF2 ");break;case 15:C.getLogger().info("Node: ",E[P].id),C.addNode(E[P-1].length,E[P].id,E[P].descr,E[P].type);break;case 16:C.getLogger().trace("Icon: ",E[P]),C.decorateNode({icon:E[P]});break;case 17:case 21:C.decorateNode({class:E[P]});break;case 18:C.getLogger().trace("SPACELIST");break;case 19:C.getLogger().trace("Node: ",E[P].id),C.addNode(0,E[P].id,E[P].descr,E[P].type);break;case 20:C.decorateNode({icon:E[P]});break;case 25:C.getLogger().trace("node found ..",E[P-2]),this.$={id:E[P-1],descr:E[P-1],type:C.getType(E[P-2],E[P])};break;case 26:this.$={id:E[P],descr:E[P],type:C.nodeType.DEFAULT};break;case 27:C.getLogger().trace("node found ..",E[P-3]),this.$={id:E[P-3],descr:E[P-1],type:C.getType(E[P-2],E[P])};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:o,22:s},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:o,22:s},{6:r,9:22,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:o,22:s},{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:o,22:s}),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:o,22:s},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:O(function(A,S){if(S.recoverable)this.trace(A);else{var T=new Error(A);throw T.hash=S,T}},"parseError"),parse:O(function(A){var S=this,T=[0],C=[],k=[null],E=[],_=this.table,P="",L=0,R=0,D=2,M=1,I=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}O(U,"popStack");function Q(){var Ce;return Ce=C.pop()||N.lex()||M,typeof Ce!="number"&&(Ce instanceof Array&&(C=Ce,Ce=C.pop()),Ce=S.symbols_[Ce]||Ce),Ce}O(Q,"lex");for(var G,q,Y,ne,X={},J,ee,te,pe;;){if(q=T[T.length-1],this.defaultActions[q]?Y=this.defaultActions[q]:((G===null||typeof G>"u")&&(G=Q()),Y=_[q]&&_[q][G]),typeof Y>"u"||!Y.length||!Y[0]){var ie="";pe=[];for(J in _[q])this.terminals_[J]&&J>D&&pe.push("'"+this.terminals_[J]+"'");N.showPosition?ie="Parse error on line "+(L+1)+`: +`},"getStyles"),gai=pai,mai={setConf:O(()=>{},"setConf"),draw:O((t,e,r,n)=>{var a,o;return(((o=(a=n==null?void 0:n.db)==null?void 0:a.getDirection)==null?void 0:o.call(a))??"LR")==="TD"?hai.draw(t,e,r,n):aai.draw(t,e,r,n)},"draw")},vai={db:lnr,renderer:mai,parser:Gii,styles:gai};const yai=Object.freeze(Object.defineProperty({__proto__:null,diagram:vai},Symbol.toStringTag,{value:"Module"})),Nc=[];for(let t=0;t<256;++t)Nc.push((t+256).toString(16).slice(1));function bai(t,e=0){return(Nc[t[e+0]]+Nc[t[e+1]]+Nc[t[e+2]]+Nc[t[e+3]]+"-"+Nc[t[e+4]]+Nc[t[e+5]]+"-"+Nc[t[e+6]]+Nc[t[e+7]]+"-"+Nc[t[e+8]]+Nc[t[e+9]]+"-"+Nc[t[e+10]]+Nc[t[e+11]]+Nc[t[e+12]]+Nc[t[e+13]]+Nc[t[e+14]]+Nc[t[e+15]]).toLowerCase()}const xai=new Uint8Array(16);function wai(){return crypto.getRandomValues(xai)}function Aai(t,e,r){return crypto.randomUUID?crypto.randomUUID():Sai(t)}function Sai(t,e,r){var i;t=t||{};const n=t.random??((i=t.rng)==null?void 0:i.call(t))??wai();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,bai(n)}var ILe=function(){var t=O(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],o=[1,20],s=[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:O(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:O(function(A,S,T,C,k,E,_){var P=E.length-1;switch(k){case 6:case 7:return C;case 8:C.getLogger().trace("Stop NL ");break;case 9:C.getLogger().trace("Stop EOF ");break;case 11:C.getLogger().trace("Stop NL2 ");break;case 12:C.getLogger().trace("Stop EOF2 ");break;case 15:C.getLogger().info("Node: ",E[P].id),C.addNode(E[P-1].length,E[P].id,E[P].descr,E[P].type);break;case 16:C.getLogger().trace("Icon: ",E[P]),C.decorateNode({icon:E[P]});break;case 17:case 21:C.decorateNode({class:E[P]});break;case 18:C.getLogger().trace("SPACELIST");break;case 19:C.getLogger().trace("Node: ",E[P].id),C.addNode(0,E[P].id,E[P].descr,E[P].type);break;case 20:C.decorateNode({icon:E[P]});break;case 25:C.getLogger().trace("node found ..",E[P-2]),this.$={id:E[P-1],descr:E[P-1],type:C.getType(E[P-2],E[P])};break;case 26:this.$={id:E[P],descr:E[P],type:C.nodeType.DEFAULT};break;case 27:C.getLogger().trace("node found ..",E[P-3]),this.$={id:E[P-3],descr:E[P-1],type:C.getType(E[P-2],E[P])};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:o,22:s},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:o,22:s},{6:r,9:22,12:11,13:n,14:14,15:i,16:a,17:17,18:18,19:o,22:s},{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:o,22:s}),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:o,22:s},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:O(function(A,S){if(S.recoverable)this.trace(A);else{var T=new Error(A);throw T.hash=S,T}},"parseError"),parse:O(function(A){var S=this,T=[0],C=[],k=[null],E=[],_=this.table,P="",L=0,R=0,D=2,M=1,I=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}O(U,"popStack");function Q(){var Ce;return Ce=C.pop()||N.lex()||M,typeof Ce!="number"&&(Ce instanceof Array&&(C=Ce,Ce=C.pop()),Ce=S.symbols_[Ce]||Ce),Ce}O(Q,"lex");for(var G,q,Y,ne,X={},J,ee,te,pe;;){if(q=T[T.length-1],this.defaultActions[q]?Y=this.defaultActions[q]:((G===null||typeof G>"u")&&(G=Q()),Y=_[q]&&_[q][G]),typeof Y>"u"||!Y.length||!Y[0]){var ie="";pe=[];for(J in _[q])this.terminals_[J]&&J>D&&pe.push("'"+this.terminals_[J]+"'");N.showPosition?ie="Parse error on line "+(L+1)+`: `+N.showPosition()+` Expecting `+pe.join(", ")+", got '"+(this.terminals_[G]||G)+"'":ie="Parse error on line "+(L+1)+": Unexpected "+(G==M?"end of input":"'"+(this.terminals_[G]||G)+"'"),this.parseError(ie,{text:N.match,token:this.terminals_[G]||G,line:N.yylineno,loc:V,expected:pe})}if(Y[0]instanceof Array&&Y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", 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,P=N.yytext,L=N.yylineno,V=N.yylloc;break;case 2:if(ee=this.productions_[Y[1]][1],X.$=k[k.length-ee],X._$={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&&(X._$.range=[E[E.length-(ee||1)].range[0],E[E.length-1].range[1]]),ne=this.performAction.apply(X,[P,R,L,F.yy,Y[1],k,E].concat(I)),typeof ne<"u")return ne;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(X.$),E.push(X._$),te=_[T[T.length-2]][T[T.length-1]],T.push(te);break;case 3:return!0}}return!0},"parse")},b=function(){var w={EOF:1,parseError:O(function(S,T){if(this.yy.parser)this.yy.parser.parseError(S,T);else throw new Error(S)},"parseError"),setInput:O(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:O(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:O(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 C=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===C.length?this.yylloc.first_column:0)+C[C.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:O(function(){return this._more=!0,this},"more"),reject:O(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:O(function(A){this.unput(this.match.slice(A))},"less"),pastInput:O(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:O(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:O(function(){var A=this.pastInput(),S=new Array(A.length+1).join("-");return A+this.upcomingInput()+` `+S+"^"},"showPosition"),test_match:O(function(A,S){var T,C,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))),C=A[0].match(/(?:\r\n?|\n).*/g),C&&(this.yylineno+=C.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:C?C[C.length-1].length-C[C.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:O(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var A,S,T,C;this._more||(this.yytext="",this.match="");for(var k=this._currentRules(),E=0;ES[0].length)){if(S=T,C=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[C]),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:O(function(){var S=this.next();return S||this.lex()},"lex"),begin:O(function(S){this.conditionStack.push(S)},"begin"),popState:O(function(){var S=this.conditionStack.length-1;return S>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(S){return S=this.conditionStack.length-1-Math.abs(S||0),S>=0?this.conditionStack[S]:"INITIAL"},"topState"),pushState:O(function(S){this.begin(S)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(function(S,T,C,k){switch(C){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 O(x,"Parser"),x.prototype=y,y.Parser=x,new x}();ILe.parser=ILe;var Aai=ILe,Sai=12,Cb={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Tai=(pP=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=Cb,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;ye.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 o=Ye();let s=((h=o.mindmap)==null?void 0:h.padding)??Jn.mindmap.padding;switch(i){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:s*=2;break}const l={id:this.count++,nodeId:li(r,o),level:e,descr:li(n,o),type:i,children:[],width:((d=o.mindmap)==null?void 0:d.maxNodeWidth)??Jn.mindmap.maxNodeWidth,padding:s,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(ye.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=Ye(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=li(e.icon,r)),e.class&&(n.class=li(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%(Sai-1):r;this.assignSections(i,a)}}flattenNodes(e,r){const n=Ye(),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(" "),o=O(l=>{var d;const h=(((d=n.theme)==null?void 0:d.toLowerCase())??"").includes("redux");switch(l){case Cb.CIRCLE:return"mindmapCircle";case Cb.RECT:return"rect";case Cb.ROUNDED_RECT:return"rounded";case Cb.CLOUD:return"cloud";case Cb.BANG:return"bang";case Cb.HEXAGON:return"hexagon";case Cb.DEFAULT:return h?"rounded":"defaultMindmapNode";case Cb.NO_BORDER:default:return"rect"}},"getShapeFromType"),s={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:o(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(s),e.children)for(const l of e.children)this.flattenNodes(l,r)}generateEdges(e,r){if(!e.children)return;const n=Ye();for(const i of e.children){let a="edge";i.section!==void 0&&(a+=` section-edge-${i.section}`);const o=e.level+1;a+=` edge-depth-${o}`;const s={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(s),this.generateEdges(i,r)}}getData(){const e=this.getMindmap(),r=Ye(),i=O2t().layout!==void 0,a=r;if(i||(a.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:a};ye.debug("getData: mindmapRoot",e,r),this.assignSections(e);const o=[],s=[];this.flattenNodes(e,o),this.generateEdges(e,s),ye.debug(`getData: processed ${o.length} nodes and ${s.length} edges`);const l=new Map;for(const u of o)l.set(u.id,{shape:u.shape,width:u.width,height:u.height,padding:u.padding});return{nodes:o,edges:s,config:a,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(l),type:"mindmap",diagramId:"mindmap-"+xai()}}getLogger(){return ye}},O(pP,"MindmapDB"),pP),Cai=O(async(t,e,r,n)=>{var f,p;ye.debug(`Rendering mindmap diagram -`+t);const i=n.db,a=i.getData(),o=m3(e,a.config.securityLevel);if(a.type=n.type,a.layoutAlgorithm=u$(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 RR(a,o);const{themeVariables:l}=Dr(),{useGradient:u,gradientStart:h,gradientStop:d}=l;if(u&&h&&d){const g=o.attr("id"),m=o.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)}nO(o,((f=a.config.mindmap)==null?void 0:f.padding)??Jn.mindmap.padding,"mindmapDiagram",((p=a.config.mindmap)==null?void 0:p.useMaxWidth)??Jn.mindmap.useMaxWidth)},"draw"),Oai={draw:Cai},kai=O(t=>{const{theme:e,look:r}=t;let n="";for(let i=0;i0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(S){return S=this.conditionStack.length-1-Math.abs(S||0),S>=0?this.conditionStack[S]:"INITIAL"},"topState"),pushState:O(function(S){this.begin(S)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(function(S,T,C,k){switch(C){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 O(x,"Parser"),x.prototype=y,y.Parser=x,new x}();ILe.parser=ILe;var Tai=ILe,Cai=12,Cb={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Oai=(pP=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=Cb,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;ye.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 o=Ye();let s=((h=o.mindmap)==null?void 0:h.padding)??Jn.mindmap.padding;switch(i){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:s*=2;break}const l={id:this.count++,nodeId:li(r,o),level:e,descr:li(n,o),type:i,children:[],width:((d=o.mindmap)==null?void 0:d.maxNodeWidth)??Jn.mindmap.maxNodeWidth,padding:s,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(ye.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=Ye(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=li(e.icon,r)),e.class&&(n.class=li(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%(Cai-1):r;this.assignSections(i,a)}}flattenNodes(e,r){const n=Ye(),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(" "),o=O(l=>{var d;const h=(((d=n.theme)==null?void 0:d.toLowerCase())??"").includes("redux");switch(l){case Cb.CIRCLE:return"mindmapCircle";case Cb.RECT:return"rect";case Cb.ROUNDED_RECT:return"rounded";case Cb.CLOUD:return"cloud";case Cb.BANG:return"bang";case Cb.HEXAGON:return"hexagon";case Cb.DEFAULT:return h?"rounded":"defaultMindmapNode";case Cb.NO_BORDER:default:return"rect"}},"getShapeFromType"),s={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:o(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(s),e.children)for(const l of e.children)this.flattenNodes(l,r)}generateEdges(e,r){if(!e.children)return;const n=Ye();for(const i of e.children){let a="edge";i.section!==void 0&&(a+=` section-edge-${i.section}`);const o=e.level+1;a+=` edge-depth-${o}`;const s={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(s),this.generateEdges(i,r)}}getData(){const e=this.getMindmap(),r=Ye(),i=E2t().layout!==void 0,a=r;if(i||(a.layout="cose-bilkent"),!e)return{nodes:[],edges:[],config:a};ye.debug("getData: mindmapRoot",e,r),this.assignSections(e);const o=[],s=[];this.flattenNodes(e,o),this.generateEdges(e,s),ye.debug(`getData: processed ${o.length} nodes and ${s.length} edges`);const l=new Map;for(const u of o)l.set(u.id,{shape:u.shape,width:u.width,height:u.height,padding:u.padding});return{nodes:o,edges:s,config:a,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(l),type:"mindmap",diagramId:"mindmap-"+Aai()}}getLogger(){return ye}},O(pP,"MindmapDB"),pP),kai=O(async(t,e,r,n)=>{var f,p;ye.debug(`Rendering mindmap diagram +`+t);const i=n.db,a=i.getData(),o=m3(e,a.config.securityLevel);if(a.type=n.type,a.layoutAlgorithm=u$(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 RR(a,o);const{themeVariables:l}=Dr(),{useGradient:u,gradientStart:h,gradientStop:d}=l;if(u&&h&&d){const g=o.attr("id"),m=o.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)}nO(o,((f=a.config.mindmap)==null?void 0:f.padding)??Jn.mindmap.padding,"mindmapDiagram",((p=a.config.mindmap)==null?void 0:p.useMaxWidth)??Jn.mindmap.useMaxWidth)},"draw"),Eai={draw:kai},_ai=O(t=>{const{theme:e,look:r}=t;let n="";for(let i=0;i{let n="";for(let i=0;i{let n="";for(let i=0;i{const{theme:e}=t,r=t.svgId,n=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none";return` + }`;return n},"genGradient"),Dai=O(t=>{const{theme:e}=t,r=t.svgId,n=t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${r}-drop-shadow)`):"none";return` .edge { stroke-width: 3; } - ${kai(t)} + ${_ai(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${t.git0}; } @@ -3241,18 +3241,18 @@ Expecting `+pe.join(", ")+", got '"+(this.terminals_[G]||G)+"'":ie="Parse error [data-look="neo"].mindmap-node.section-root .text-inner-tspan { fill: ${e!=null&&e.includes("redux")?t.nodeBorder:t["cScaleLabel"+(e==="neutral"?1:0)]}; } - ${t.useGradient&&r&&t.mainBkg?Eai(t.THEME_COLOR_LIMIT,r,t.mainBkg):""} -`},"getStyles"),Rai=_ai,Dai={get db(){return new Tai},renderer:Oai,parser:Aai,styles:Rai};const Lai=Object.freeze(Object.defineProperty({__proto__:null,diagram:Dai},Symbol.toStringTag,{value:"Module"}));var PLe=function(){var t=O(function(T,C,k,E){for(k=k||{},E=T.length;E--;k[T[E]]=C);return k},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],o=[1,20],s=[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:O(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:O(function(C,k,E,_,P,L,R){var D=L.length-1;switch(P){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:o,23:s},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:o,23:s},{6:r,9:22,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:o,23:s},{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:o,23:s}),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:o,23:s},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:O(function(C,k){if(k.recoverable)this.trace(C);else{var E=new Error(C);throw E.hash=k,E}},"parseError"),parse:O(function(C){var k=this,E=[0],_=[],P=[null],L=[],R=this.table,D="",M=0,I=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(C,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 q(ue){E.length=E.length-2*ue,P.length=P.length-ue,L.length=L.length-ue}O(q,"popStack");function Y(){var ue;return ue=_.pop()||V.lex()||F,typeof ue!="number"&&(ue instanceof Array&&(_=ue,ue=_.pop()),ue=k.symbols_[ue]||ue),ue}O(Y,"lex");for(var ne,X,J,ee,te={},pe,ie,Ce,ke;;){if(X=E[E.length-1],this.defaultActions[X]?J=this.defaultActions[X]:((ne===null||typeof ne>"u")&&(ne=Y()),J=R[X]&&R[X][ne]),typeof J>"u"||!J.length||!J[0]){var Ee="";ke=[];for(pe in R[X])this.terminals_[pe]&&pe>N&&ke.push("'"+this.terminals_[pe]+"'");V.showPosition?Ee="Parse error on line "+(M+1)+`: + ${t.useGradient&&r&&t.mainBkg?Rai(t.THEME_COLOR_LIMIT,r,t.mainBkg):""} +`},"getStyles"),Lai=Dai,Mai={get db(){return new Oai},renderer:Eai,parser:Tai,styles:Lai};const Iai=Object.freeze(Object.defineProperty({__proto__:null,diagram:Mai},Symbol.toStringTag,{value:"Module"}));var PLe=function(){var t=O(function(T,C,k,E){for(k=k||{},E=T.length;E--;k[T[E]]=C);return k},"o"),e=[1,4],r=[1,13],n=[1,12],i=[1,15],a=[1,16],o=[1,20],s=[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:O(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:O(function(C,k,E,_,P,L,R){var D=L.length-1;switch(P){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:o,23:s},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:o,23:s},{6:r,9:22,12:11,13:n,14:14,16:i,17:a,18:17,19:18,20:o,23:s},{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:o,23:s}),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:o,23:s},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:O(function(C,k){if(k.recoverable)this.trace(C);else{var E=new Error(C);throw E.hash=k,E}},"parseError"),parse:O(function(C){var k=this,E=[0],_=[],P=[null],L=[],R=this.table,D="",M=0,I=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(C,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 q(ue){E.length=E.length-2*ue,P.length=P.length-ue,L.length=L.length-ue}O(q,"popStack");function Y(){var ue;return ue=_.pop()||V.lex()||F,typeof ue!="number"&&(ue instanceof Array&&(_=ue,ue=_.pop()),ue=k.symbols_[ue]||ue),ue}O(Y,"lex");for(var ne,X,J,ee,te={},pe,ie,Ce,ke;;){if(X=E[E.length-1],this.defaultActions[X]?J=this.defaultActions[X]:((ne===null||typeof ne>"u")&&(ne=Y()),J=R[X]&&R[X][ne]),typeof J>"u"||!J.length||!J[0]){var Ee="";ke=[];for(pe in R[X])this.terminals_[pe]&&pe>N&&ke.push("'"+this.terminals_[pe]+"'");V.showPosition?Ee="Parse error on line "+(M+1)+`: `+V.showPosition()+` Expecting `+ke.join(", ")+", got '"+(this.terminals_[ne]||ne)+"'":Ee="Parse error on line "+(M+1)+": Unexpected "+(ne==F?"end of input":"'"+(this.terminals_[ne]||ne)+"'"),this.parseError(Ee,{text:V.match,token:this.terminals_[ne]||ne,line:V.yylineno,loc:Q,expected:ke})}if(J[0]instanceof Array&&J.length>1)throw new Error("Parse Error: multiple actions possible at state: "+X+", token: "+ne);switch(J[0]){case 1:E.push(ne),P.push(V.yytext),L.push(V.yylloc),E.push(J[1]),ne=null,I=V.yyleng,D=V.yytext,M=V.yylineno,Q=V.yylloc;break;case 2:if(ie=this.productions_[J[1]][1],te.$=P[P.length-ie],te._$={first_line:L[L.length-(ie||1)].first_line,last_line:L[L.length-1].last_line,first_column:L[L.length-(ie||1)].first_column,last_column:L[L.length-1].last_column},G&&(te._$.range=[L[L.length-(ie||1)].range[0],L[L.length-1].range[1]]),ee=this.performAction.apply(te,[D,I,M,z.yy,J[1],P,L].concat(B)),typeof ee<"u")return ee;ie&&(E=E.slice(0,-1*ie*2),P=P.slice(0,-1*ie),L=L.slice(0,-1*ie)),E.push(this.productions_[J[1]][0]),P.push(te.$),L.push(te._$),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:O(function(k,E){if(this.yy.parser)this.yy.parser.parseError(k,E);else throw new Error(k)},"parseError"),setInput:O(function(C,k){return this.yy=k||this.yy||{},this._input=C,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:O(function(){var C=this._input[0];this.yytext+=C,this.yyleng++,this.offset++,this.match+=C,this.matched+=C;var k=C.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),C},"input"),unput:O(function(C){var k=C.length,E=C.split(/(?:\r\n?|\n)/g);this._input=C+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 P=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=[P[0],P[0]+this.yyleng-k]),this.yyleng=this.yytext.length,this},"unput"),more:O(function(){return this._more=!0,this},"more"),reject:O(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:O(function(C){this.unput(this.match.slice(C))},"less"),pastInput:O(function(){var C=this.matched.substr(0,this.matched.length-this.match.length);return(C.length>20?"...":"")+C.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:O(function(){var C=this.match;return C.length<20&&(C+=this._input.substr(0,20-C.length)),(C.substr(0,20)+(C.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:O(function(){var C=this.pastInput(),k=new Array(C.length+1).join("-");return C+this.upcomingInput()+` `+k+"^"},"showPosition"),test_match:O(function(C,k){var E,_,P;if(this.options.backtrack_lexer&&(P={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&&(P.yylloc.range=this.yylloc.range.slice(0))),_=C[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+C[0].length},this.yytext+=C[0],this.match+=C[0],this.matches=C,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(C[0].length),this.matched+=C[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 P)this[L]=P[L];return!1}return!1},"test_match"),next:O(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var C,k,E,_;this._more||(this.yytext="",this.match="");for(var P=this._currentRules(),L=0;Lk[0].length)){if(k=E,_=L,this.options.backtrack_lexer){if(C=this.test_match(E,P[L]),C!==!1)return C;if(this._backtrack){k=!1;continue}else return!1}else if(!this.options.flex)break}return k?(C=this.test_match(k,P[_]),C!==!1?C:!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:O(function(){var k=this.next();return k||this.lex()},"lex"),begin:O(function(k){this.conditionStack.push(k)},"begin"),popState:O(function(){var k=this.conditionStack.length-1;return k>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(k){return k=this.conditionStack.length-1-Math.abs(k||0),k>=0?this.conditionStack[k]:"INITIAL"},"topState"),pushState:O(function(k){this.begin(k)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(function(k,E,_,P){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 O(S,"Parser"),S.prototype=w,w.Parser=S,new S}();PLe.parser=PLe;var Mai=PLe,Hp=[],NLe=[],BLe=0,$Le={},Iai=O(()=>{Hp=[],NLe=[],BLe=0,$Le={}},"clear"),Pai=O(t=>{if(Hp.length===0)return null;const e=Hp[0].level;let r=null;for(let n=Hp.length-1;n>=0;n--)if(Hp[n].level===e&&!r&&(r=Hp[n]),Hp[n].levels.parentId===i.id);for(const s of o){const l={id:s.id,parentId:i.id,label:li(s.label??"",n),labelType:"markdown",isGroup:!1,ticket:s==null?void 0:s.ticket,priority:s==null?void 0:s.priority,assigned:s==null?void 0:s.assigned,icon:s==null?void 0:s.icon,shape:"kanbanItem",level:s.level,rx:5,ry:5,cssStyles:["text-align: left"]};e.push(l)}}return{nodes:e,edges:t,other:{},config:Ye()}},"getData"),Bai=O((t,e,r,n,i)=>{var u,h;const a=Ye();let o=((u=a.mindmap)==null?void 0:u.padding)??Jn.mindmap.padding;switch(n){case bl.ROUNDED_RECT:case bl.RECT:case bl.HEXAGON:o*=2}const s={id:li(e,a)||"kbn"+BLe++,level:t,label:li(r,a),width:((h=a.mindmap)==null?void 0:h.maxNodeWidth)??Jn.mindmap.maxNodeWidth,padding:o,isGroup:!1};if(i!==void 0){let d;i.includes(` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:O(function(){var k=this.next();return k||this.lex()},"lex"),begin:O(function(k){this.conditionStack.push(k)},"begin"),popState:O(function(){var k=this.conditionStack.length-1;return k>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(k){return k=this.conditionStack.length-1-Math.abs(k||0),k>=0?this.conditionStack[k]:"INITIAL"},"topState"),pushState:O(function(k){this.begin(k)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(function(k,E,_,P){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 O(S,"Parser"),S.prototype=w,w.Parser=S,new S}();PLe.parser=PLe;var Pai=PLe,Hp=[],NLe=[],BLe=0,$Le={},Nai=O(()=>{Hp=[],NLe=[],BLe=0,$Le={}},"clear"),Bai=O(t=>{if(Hp.length===0)return null;const e=Hp[0].level;let r=null;for(let n=Hp.length-1;n>=0;n--)if(Hp[n].level===e&&!r&&(r=Hp[n]),Hp[n].levels.parentId===i.id);for(const s of o){const l={id:s.id,parentId:i.id,label:li(s.label??"",n),labelType:"markdown",isGroup:!1,ticket:s==null?void 0:s.ticket,priority:s==null?void 0:s.priority,assigned:s==null?void 0:s.assigned,icon:s==null?void 0:s.icon,shape:"kanbanItem",level:s.level,rx:5,ry:5,cssStyles:["text-align: left"]};e.push(l)}}return{nodes:e,edges:t,other:{},config:Ye()}},"getData"),Fai=O((t,e,r,n,i)=>{var u,h;const a=Ye();let o=((u=a.mindmap)==null?void 0:u.padding)??Jn.mindmap.padding;switch(n){case bl.ROUNDED_RECT:case bl.RECT:case bl.HEXAGON:o*=2}const s={id:li(e,a)||"kbn"+BLe++,level:t,label:li(r,a),width:((h=a.mindmap)==null?void 0:h.maxNodeWidth)??Jn.mindmap.maxNodeWidth,padding:o,isGroup:!1};if(i!==void 0){let d;i.includes(` `)?d=i+` `:d=`{ `+i+` -}`;const f=OX(d,{schema:CX});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"&&(s.shape=f==null?void 0:f.shape),f!=null&&f.label&&(s.label=f==null?void 0:f.label),f!=null&&f.icon&&(s.icon=f==null?void 0:f.icon.toString()),f!=null&&f.assigned&&(s.assigned=f==null?void 0:f.assigned.toString()),f!=null&&f.ticket&&(s.ticket=f==null?void 0:f.ticket.toString()),f!=null&&f.priority&&(s.priority=f==null?void 0:f.priority)}const l=Pai(t);l?s.parentId=l.id||"kbn"+BLe++:NLe.push(s),Hp.push(s)},"addNode"),bl={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},$ai=O((t,e)=>{switch(ye.debug("In get type",t,e),t){case"[":return bl.RECT;case"(":return e===")"?bl.ROUNDED_RECT:bl.CLOUD;case"((":return bl.CIRCLE;case")":return bl.CLOUD;case"))":return bl.BANG;case"{{":return bl.HEXAGON;default:return bl.DEFAULT}},"getType"),Fai=O((t,e)=>{$Le[t]=e},"setElementForId"),zai=O(t=>{if(!t)return;const e=Ye(),r=Hp[Hp.length-1];t.icon&&(r.icon=li(t.icon,e)),t.class&&(r.cssClasses=li(t.class,e))},"decorateNode"),Uai=O(t=>{switch(t){case bl.DEFAULT:return"no-border";case bl.RECT:return"rect";case bl.ROUNDED_RECT:return"rounded-rect";case bl.CIRCLE:return"circle";case bl.CLOUD:return"cloud";case bl.BANG:return"bang";case bl.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Vai=O(()=>ye,"getLogger"),Qai=O(t=>$Le[t],"getElementById"),Gai={clear:Iai,addNode:Bai,getSections:_nr,getData:Nai,nodeType:bl,getType:$ai,setElementForId:Fai,decorateNode:zai,type2Str:Uai,getLogger:Vai,getElementById:Qai},Hai=Gai,Wai=O(async(t,e,r,n)=>{var v,y,b,x,w;ye.debug(`Rendering kanban diagram -`+t);const a=n.db.getData(),o=Ye();o.htmlLabels=!1;const s=nu(e);for(const A of a.nodes)A.domId=`${e}-${A.id}`;const l=s.append("g");l.attr("class","sections");const u=s.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 S=((v=o==null?void 0:o.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 ZX(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=o==null?void 0:o.kanban)==null?void 0:b.sectionWidth)||200,C=-T*3/2+g;let k=C;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 i$(u,L,{config:o})).node().getBBox();L.y=k+D.height/2,await tK(L),k=L.y+D.height/2+f/2}const _=S.cluster.select("rect"),P=Math.max(k-C+3*f,50)+(g-25);_.attr("height",P)}iR(void 0,s,((x=o.mindmap)==null?void 0:x.padding)??Jn.kanban.padding,((w=o.mindmap)==null?void 0:w.useMaxWidth)??Jn.kanban.useMaxWidth)},"draw"),Yai={draw:Wai},qai=O(t=>{let e="";for(let n=0;nt.darkMode?dt(n,i):ht(n,i),"adjuster");for(let n=0;n{switch(ye.debug("In get type",t,e),t){case"[":return bl.RECT;case"(":return e===")"?bl.ROUNDED_RECT:bl.CLOUD;case"((":return bl.CIRCLE;case")":return bl.CLOUD;case"))":return bl.BANG;case"{{":return bl.HEXAGON;default:return bl.DEFAULT}},"getType"),Uai=O((t,e)=>{$Le[t]=e},"setElementForId"),Vai=O(t=>{if(!t)return;const e=Ye(),r=Hp[Hp.length-1];t.icon&&(r.icon=li(t.icon,e)),t.class&&(r.cssClasses=li(t.class,e))},"decorateNode"),Qai=O(t=>{switch(t){case bl.DEFAULT:return"no-border";case bl.RECT:return"rect";case bl.ROUNDED_RECT:return"rounded-rect";case bl.CIRCLE:return"circle";case bl.CLOUD:return"cloud";case bl.BANG:return"bang";case bl.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Gai=O(()=>ye,"getLogger"),Hai=O(t=>$Le[t],"getElementById"),Wai={clear:Nai,addNode:Fai,getSections:Dnr,getData:$ai,nodeType:bl,getType:zai,setElementForId:Uai,decorateNode:Vai,type2Str:Qai,getLogger:Gai,getElementById:Hai},Yai=Wai,qai=O(async(t,e,r,n)=>{var v,y,b,x,w;ye.debug(`Rendering kanban diagram +`+t);const a=n.db.getData(),o=Ye();o.htmlLabels=!1;const s=nu(e);for(const A of a.nodes)A.domId=`${e}-${A.id}`;const l=s.append("g");l.attr("class","sections");const u=s.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 S=((v=o==null?void 0:o.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 ZX(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=o==null?void 0:o.kanban)==null?void 0:b.sectionWidth)||200,C=-T*3/2+g;let k=C;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 i$(u,L,{config:o})).node().getBBox();L.y=k+D.height/2,await tK(L),k=L.y+D.height/2+f/2}const _=S.cluster.select("rect"),P=Math.max(k-C+3*f,50)+(g-25);_.attr("height",P)}iR(void 0,s,((x=o.mindmap)==null?void 0:x.padding)??Jn.kanban.padding,((w=o.mindmap)==null?void 0:w.useMaxWidth)??Jn.kanban.useMaxWidth)},"draw"),jai={draw:qai},Xai=O(t=>{let e="";for(let n=0;nt.darkMode?dt(n,i):ht(n,i),"adjuster");for(let n=0;n` + `}return e},"genSections"),Kai=O(t=>` .edge { stroke-width: 3; } - ${qai(t)} + ${Xai(t)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${t.git0}; } @@ -3330,14 +3330,14 @@ Expecting `+ke.join(", ")+", got '"+(this.terminals_[ne]||ne)+"'":Ee="Parse erro text-align: center; } ${T9()} -`,"getStyles"),Xai=jai,Kai={db:Hai,renderer:Yai,parser:Mai,styles:Xai};const Zai=Object.freeze(Object.defineProperty({__proto__:null,diagram:Kai},Symbol.toStringTag,{value:"Module"}));function Rnr(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 Dnr(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 FLe(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 Jai(t){return t.target.depth}function eoi(t){return t.depth}function toi(t,e){return e-1-t.height}function Lnr(t,e){return t.sourceLinks.length?t.depth:e-1}function roi(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?Dnr(t.sourceLinks,Jai)-1:0}function Bie(t){return function(){return t}}function Mnr(t,e){return $ie(t.source,e.source)||t.index-e.index}function Inr(t,e){return $ie(t.target,e.target)||t.index-e.index}function $ie(t,e){return t.y0-e.y0}function zLe(t){return t.value}function noi(t){return t.index}function ioi(t){return t.nodes}function aoi(t){return t.links}function Pnr(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function Nnr({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 ooi(){let t=0,e=0,r=1,n=1,i=24,a=8,o,s=noi,l=Lnr,u,h,d=ioi,f=aoi,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),Nnr(D),D}g.update=function(D){return Nnr(D),D},g.nodeId=function(D){return arguments.length?(s=typeof D=="function"?D:Bie(D),g):s},g.nodeAlign=function(D){return arguments.length?(l=typeof D=="function"?D:Bie(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=o=+D,g):a},g.nodes=function(D){return arguments.length?(d=typeof D=="function"?D:Bie(D),g):d},g.links=function(D){return arguments.length?(f=typeof D=="function"?D:Bie(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 I=new Map(D.map((N,F)=>[s(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=Pnr(I,B)),typeof V!="object"&&(V=F.target=Pnr(I,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(FLe(M.sourceLinks,zLe),FLe(M.targetLinks,zLe)):M.fixedValue}function y({nodes:D}){const M=D.length;let I=new Set(D),N=new Set,F=0;for(;I.size;){for(const B of I){B.depth=F;for(const{target:V}of B.sourceLinks)N.add(V)}if(++F>M)throw new Error("circular link");I=N,N=new Set}}function b({nodes:D}){const M=D.length;let I=new Set(D),N=new Set,F=0;for(;I.size;){for(const B of I){B.height=F;for(const{source:V}of B.targetLinks)N.add(V)}if(++F>M)throw new Error("circular link");I=N,N=new Set}}function x({nodes:D}){const M=Rnr(D,F=>F.depth)+1,I=(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*I,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=Dnr(D,I=>(n-e-(I.length-1)*o)/FLe(I,zLe));for(const I of D){let N=e;for(const F of I){F.y0=N,F.y1=N+F.value*M,N=F.y1+o;for(const B of F.sourceLinks)B.width=B.value*M}N=(n-N+o)/(I.length+1);for(let F=0;FI.length)-1)),w(M);for(let I=0;I0))continue;let Q=(z/U-V.y0)*M;V.y0+=Q,V.y1+=Q,_(V)}u===void 0&&B.sort($ie),C(B,I)}}function T(D,M,I){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:q}of V.sourceLinks){let Y=q*(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($ie),C(B,I)}}function C(D,M){const I=D.length>>1,N=D[I];E(D,N.y0-o,I-1,M),k(D,N.y1+o,I+1,M),E(D,n,D.length-1,M),k(D,e,0,M)}function k(D,M,I,N){for(;I1e-6&&(F.y0+=B,F.y1+=B),M=F.y1+o}}function E(D,M,I,N){for(;I>=0;--I){const F=D[I],B=(F.y1-M)*N;B>1e-6&&(F.y0-=B,F.y1-=B),M=F.y0-o}}function _({sourceLinks:D,targetLinks:M}){if(h===void 0){for(const{source:{sourceLinks:I}}of M)I.sort(Inr);for(const{target:{targetLinks:I}}of D)I.sort(Mnr)}}function P(D){if(h===void 0)for(const{sourceLinks:M,targetLinks:I}of D)M.sort(Inr),I.sort(Mnr)}function L(D,M){let I=D.y0-(D.sourceLinks.length-1)*o/2;for(const{target:N,width:F}of D.sourceLinks){if(N===M)break;I+=F+o}for(const{source:N,width:F}of M.targetLinks){if(N===D)break;I-=F}return I}function R(D,M){let I=M.y0-(M.targetLinks.length-1)*o/2;for(const{source:N,width:F}of M.targetLinks){if(N===D)break;I+=F+o}for(const{target:N,width:F}of D.sourceLinks){if(N===M)break;I-=F}return I}return g}var ULe=Math.PI,VLe=2*ULe,mk=1e-6,soi=VLe-mk;function QLe(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Bnr(){return new QLe}QLe.prototype=Bnr.prototype={constructor:QLe,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,o=this._y1,s=r-t,l=n-e,u=a-t,h=o-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>mk)if(!(Math.abs(h*s-l*u)>mk)||!i)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var f=r-a,p=n-o,g=s*s+l*l,m=f*f+p*p,v=Math.sqrt(g),y=Math.sqrt(d),b=i*Math.tan((ULe-Math.acos((g+d-m)/(2*v*y)))/2),x=b/y,w=b/v;Math.abs(x-1)>mk&&(this._+="L"+(t+x*u)+","+(e+x*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>u*p)+","+(this._x1=t+w*s)+","+(this._y1=e+w*l)}},arc:function(t,e,r,n,i,a){t=+t,e=+e,r=+r,a=!!a;var o=r*Math.cos(n),s=r*Math.sin(n),l=t+o,u=e+s,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)>mk||Math.abs(this._y1-u)>mk)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%VLe+VLe),d>soi?this._+="A"+r+","+r+",0,1,"+h+","+(t-o)+","+(e-s)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>mk&&(this._+="A"+r+","+r+",0,"+ +(d>=ULe)+","+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 $nr(t){return function(){return t}}function loi(t){return t[0]}function coi(t){return t[1]}var uoi=Array.prototype.slice;function hoi(t){return t.source}function doi(t){return t.target}function foi(t){var e=hoi,r=doi,n=loi,i=coi,a=null;function o(){var s,l=uoi.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(a||(a=s=Bnr()),t(a,+n.apply(this,(l[0]=u,l)),+i.apply(this,l),+n.apply(this,(l[0]=h,l)),+i.apply(this,l)),s)return a=null,s+""||null}return o.source=function(s){return arguments.length?(e=s,o):e},o.target=function(s){return arguments.length?(r=s,o):r},o.x=function(s){return arguments.length?(n=typeof s=="function"?s:$nr(+s),o):n},o.y=function(s){return arguments.length?(i=typeof s=="function"?s:$nr(+s),o):i},o.context=function(s){return arguments.length?(a=s??null,o):a},o}function poi(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function goi(){return foi(poi)}function moi(t){return[t.source.x1,t.y0]}function voi(t){return[t.target.x0,t.y1]}function yoi(){return goi().source(moi).target(voi)}var GLe=function(){var t=O(function(s,l,u,h){for(u=u||{},h=s.length;h--;u[s[h]]=l);return u},"o"),e=[1,9],r=[1,10],n=[1,5,10,12],i={trace:O(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:O(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:O(function(l,u){if(u.recoverable)this.trace(l);else{var h=new Error(l);throw h.hash=u,h}},"parseError"),parse:O(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 C=A.yylloc;p.push(C);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}O(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}O(_,"lex");for(var P,L,R,D,M={},I,N,F,B;;){if(L=h[h.length-1],this.defaultActions[L]?R=this.defaultActions[L]:((P===null||typeof P>"u")&&(P=_()),R=g[L]&&g[L][P]),typeof R>"u"||!R.length||!R[0]){var V="";B=[];for(I in g[L])this.terminals_[I]&&I>b&&B.push("'"+this.terminals_[I]+"'");A.showPosition?V="Parse error on line "+(v+1)+`: +`,"getStyles"),Zai=Kai,Jai={db:Yai,renderer:jai,parser:Pai,styles:Zai};const eoi=Object.freeze(Object.defineProperty({__proto__:null,diagram:Jai},Symbol.toStringTag,{value:"Module"}));function Lnr(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 Mnr(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 FLe(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 toi(t){return t.target.depth}function roi(t){return t.depth}function noi(t,e){return e-1-t.height}function Inr(t,e){return t.sourceLinks.length?t.depth:e-1}function ioi(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?Mnr(t.sourceLinks,toi)-1:0}function Bie(t){return function(){return t}}function Pnr(t,e){return $ie(t.source,e.source)||t.index-e.index}function Nnr(t,e){return $ie(t.target,e.target)||t.index-e.index}function $ie(t,e){return t.y0-e.y0}function zLe(t){return t.value}function aoi(t){return t.index}function ooi(t){return t.nodes}function soi(t){return t.links}function Bnr(t,e){const r=t.get(e);if(!r)throw new Error("missing: "+e);return r}function $nr({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 loi(){let t=0,e=0,r=1,n=1,i=24,a=8,o,s=aoi,l=Inr,u,h,d=ooi,f=soi,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),$nr(D),D}g.update=function(D){return $nr(D),D},g.nodeId=function(D){return arguments.length?(s=typeof D=="function"?D:Bie(D),g):s},g.nodeAlign=function(D){return arguments.length?(l=typeof D=="function"?D:Bie(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=o=+D,g):a},g.nodes=function(D){return arguments.length?(d=typeof D=="function"?D:Bie(D),g):d},g.links=function(D){return arguments.length?(f=typeof D=="function"?D:Bie(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 I=new Map(D.map((N,F)=>[s(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=Bnr(I,B)),typeof V!="object"&&(V=F.target=Bnr(I,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(FLe(M.sourceLinks,zLe),FLe(M.targetLinks,zLe)):M.fixedValue}function y({nodes:D}){const M=D.length;let I=new Set(D),N=new Set,F=0;for(;I.size;){for(const B of I){B.depth=F;for(const{target:V}of B.sourceLinks)N.add(V)}if(++F>M)throw new Error("circular link");I=N,N=new Set}}function b({nodes:D}){const M=D.length;let I=new Set(D),N=new Set,F=0;for(;I.size;){for(const B of I){B.height=F;for(const{source:V}of B.targetLinks)N.add(V)}if(++F>M)throw new Error("circular link");I=N,N=new Set}}function x({nodes:D}){const M=Lnr(D,F=>F.depth)+1,I=(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*I,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=Mnr(D,I=>(n-e-(I.length-1)*o)/FLe(I,zLe));for(const I of D){let N=e;for(const F of I){F.y0=N,F.y1=N+F.value*M,N=F.y1+o;for(const B of F.sourceLinks)B.width=B.value*M}N=(n-N+o)/(I.length+1);for(let F=0;FI.length)-1)),w(M);for(let I=0;I0))continue;let Q=(z/U-V.y0)*M;V.y0+=Q,V.y1+=Q,_(V)}u===void 0&&B.sort($ie),C(B,I)}}function T(D,M,I){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:q}of V.sourceLinks){let Y=q*(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($ie),C(B,I)}}function C(D,M){const I=D.length>>1,N=D[I];E(D,N.y0-o,I-1,M),k(D,N.y1+o,I+1,M),E(D,n,D.length-1,M),k(D,e,0,M)}function k(D,M,I,N){for(;I1e-6&&(F.y0+=B,F.y1+=B),M=F.y1+o}}function E(D,M,I,N){for(;I>=0;--I){const F=D[I],B=(F.y1-M)*N;B>1e-6&&(F.y0-=B,F.y1-=B),M=F.y0-o}}function _({sourceLinks:D,targetLinks:M}){if(h===void 0){for(const{source:{sourceLinks:I}}of M)I.sort(Nnr);for(const{target:{targetLinks:I}}of D)I.sort(Pnr)}}function P(D){if(h===void 0)for(const{sourceLinks:M,targetLinks:I}of D)M.sort(Nnr),I.sort(Pnr)}function L(D,M){let I=D.y0-(D.sourceLinks.length-1)*o/2;for(const{target:N,width:F}of D.sourceLinks){if(N===M)break;I+=F+o}for(const{source:N,width:F}of M.targetLinks){if(N===D)break;I-=F}return I}function R(D,M){let I=M.y0-(M.targetLinks.length-1)*o/2;for(const{source:N,width:F}of M.targetLinks){if(N===D)break;I+=F+o}for(const{target:N,width:F}of D.sourceLinks){if(N===M)break;I-=F}return I}return g}var ULe=Math.PI,VLe=2*ULe,mk=1e-6,coi=VLe-mk;function QLe(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Fnr(){return new QLe}QLe.prototype=Fnr.prototype={constructor:QLe,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,o=this._y1,s=r-t,l=n-e,u=a-t,h=o-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>mk)if(!(Math.abs(h*s-l*u)>mk)||!i)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var f=r-a,p=n-o,g=s*s+l*l,m=f*f+p*p,v=Math.sqrt(g),y=Math.sqrt(d),b=i*Math.tan((ULe-Math.acos((g+d-m)/(2*v*y)))/2),x=b/y,w=b/v;Math.abs(x-1)>mk&&(this._+="L"+(t+x*u)+","+(e+x*h)),this._+="A"+i+","+i+",0,0,"+ +(h*f>u*p)+","+(this._x1=t+w*s)+","+(this._y1=e+w*l)}},arc:function(t,e,r,n,i,a){t=+t,e=+e,r=+r,a=!!a;var o=r*Math.cos(n),s=r*Math.sin(n),l=t+o,u=e+s,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)>mk||Math.abs(this._y1-u)>mk)&&(this._+="L"+l+","+u),r&&(d<0&&(d=d%VLe+VLe),d>coi?this._+="A"+r+","+r+",0,1,"+h+","+(t-o)+","+(e-s)+"A"+r+","+r+",0,1,"+h+","+(this._x1=l)+","+(this._y1=u):d>mk&&(this._+="A"+r+","+r+",0,"+ +(d>=ULe)+","+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 znr(t){return function(){return t}}function uoi(t){return t[0]}function hoi(t){return t[1]}var doi=Array.prototype.slice;function foi(t){return t.source}function poi(t){return t.target}function goi(t){var e=foi,r=poi,n=uoi,i=hoi,a=null;function o(){var s,l=doi.call(arguments),u=e.apply(this,l),h=r.apply(this,l);if(a||(a=s=Fnr()),t(a,+n.apply(this,(l[0]=u,l)),+i.apply(this,l),+n.apply(this,(l[0]=h,l)),+i.apply(this,l)),s)return a=null,s+""||null}return o.source=function(s){return arguments.length?(e=s,o):e},o.target=function(s){return arguments.length?(r=s,o):r},o.x=function(s){return arguments.length?(n=typeof s=="function"?s:znr(+s),o):n},o.y=function(s){return arguments.length?(i=typeof s=="function"?s:znr(+s),o):i},o.context=function(s){return arguments.length?(a=s??null,o):a},o}function moi(t,e,r,n,i){t.moveTo(e,r),t.bezierCurveTo(e=(e+n)/2,r,e,i,n,i)}function voi(){return goi(moi)}function yoi(t){return[t.source.x1,t.y0]}function boi(t){return[t.target.x0,t.y1]}function xoi(){return voi().source(yoi).target(boi)}var GLe=function(){var t=O(function(s,l,u,h){for(u=u||{},h=s.length;h--;u[s[h]]=l);return u},"o"),e=[1,9],r=[1,10],n=[1,5,10,12],i={trace:O(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:O(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:O(function(l,u){if(u.recoverable)this.trace(l);else{var h=new Error(l);throw h.hash=u,h}},"parseError"),parse:O(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 C=A.yylloc;p.push(C);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}O(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}O(_,"lex");for(var P,L,R,D,M={},I,N,F,B;;){if(L=h[h.length-1],this.defaultActions[L]?R=this.defaultActions[L]:((P===null||typeof P>"u")&&(P=_()),R=g[L]&&g[L][P]),typeof R>"u"||!R.length||!R[0]){var V="";B=[];for(I in g[L])this.terminals_[I]&&I>b&&B.push("'"+this.terminals_[I]+"'");A.showPosition?V="Parse error on line "+(v+1)+`: `+A.showPosition()+` Expecting `+B.join(", ")+", got '"+(this.terminals_[P]||P)+"'":V="Parse error on line "+(v+1)+": Unexpected "+(P==x?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(V,{text:A.match,token:this.terminals_[P]||P,line:A.yylineno,loc:C,expected:B})}if(R[0]instanceof Array&&R.length>1)throw new Error("Parse Error: multiple actions possible at state: "+L+", token: "+P);switch(R[0]){case 1:h.push(P),f.push(A.yytext),p.push(A.yylloc),h.push(R[1]),P=null,y=A.yyleng,m=A.yytext,v=A.yylineno,C=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 s={EOF:1,parseError:O(function(u,h){if(this.yy.parser)this.yy.parser.parseError(u,h);else throw new Error(u)},"parseError"),setInput:O(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:O(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:O(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:O(function(){return this._more=!0,this},"more"),reject:O(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:O(function(l){this.unput(this.match.slice(l))},"less"),pastInput:O(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:O(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:O(function(){var l=this.pastInput(),u=new Array(l.length+1).join("-");return l+this.upcomingInput()+` `+u+"^"},"showPosition"),test_match:O(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:O(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:O(function(){var u=this.next();return u||this.lex()},"lex"),begin:O(function(u){this.conditionStack.push(u)},"begin"),popState:O(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:O(function(u){this.begin(u)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(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 s}();i.lexer=a;function o(){this.yy={}}return O(o,"Parser"),o.prototype=i,i.Parser=o,new o}();GLe.parser=GLe;var Fie=GLe,zie=[],Uie=[],Vie=new Map,boi=O(()=>{zie=[],Uie=[],Vie=new Map,_a()},"clear"),xoi=(gP=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},O(gP,"SankeyLink"),gP),woi=O((t,e,r)=>{zie.push(new xoi(t,e,r))},"addLink"),Aoi=(mP=class{constructor(e){this.ID=e}},O(mP,"SankeyNode"),mP),Soi=O(t=>{t=Xt.sanitizeText(t,Ye());let e=Vie.get(t);return e===void 0&&(e=new Aoi(t),Vie.set(t,e),Uie.push(e)),e},"findOrCreateNode"),Toi=O(()=>Uie,"getNodes"),Coi=O(()=>zie,"getLinks"),Ooi=O(()=>({nodes:Uie.map(t=>({id:t.ID})),links:zie.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),koi={nodesMap:Vie,getConfig:O(()=>Ye().sankey,"getConfig"),getNodes:Toi,getLinks:Coi,getGraph:Ooi,addLink:woi,findOrCreateNode:Soi,getAccTitle:oo,setAccTitle:Ba,getAccDescription:lo,setAccDescription:so,getDiagramTitle:$a,setDiagramTitle:co,clear:boi},Fnr=(kb=class{static next(e){return new kb(e+ ++kb.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},O(kb,"Uid"),kb.count=0,kb),Eoi={left:eoi,right:toi,center:roi,justify:Lnr},_oi=O(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"),Roi=O(function(t,e,r,n){const{securityLevel:i,sankey:a}=Ye(),o=N2t.sankey;let s;i==="sandbox"&&(s=_t("#i"+e));const l=_t(i==="sandbox"?s.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):_t(`[id="${e}"]`),h=(a==null?void 0:a.width)??o.width,d=(a==null?void 0:a.height)??o.width,f=(a==null?void 0:a.useMaxWidth)??o.useMaxWidth,p=(a==null?void 0:a.nodeAlignment)??o.nodeAlignment,g=(a==null?void 0:a.prefix)??o.prefix,m=(a==null?void 0:a.suffix)??o.suffix,v=(a==null?void 0:a.showValues)??o.showValues,y=(a==null?void 0:a.nodeWidth)??o.nodeWidth??10,b=(a==null?void 0:a.nodePadding)??o.nodePadding??12,x=(a==null?void 0:a.labelStyle)??o.labelStyle??"legacy",w=(a==null?void 0:a.nodeColors)??{},A=n.db.getGraph(),S=Eoi[p];ooi().nodeId(N=>N.id).nodeWidth(y).nodePadding(b+(v?15:0)).nodeAlign(S).extent([[0,0],[h,d]])(A);const C=_oi(A.nodes),k=UT(kcn),E=O(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=Fnr.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 _=O(({id:N,value:F})=>v?`${N} -${g}${Math.round(F*100)/100}${m}`:N,"getText"),P=O(N=>x==="outlined"?(N.layer??0)L.selectAll(N?`.${N}`:"text").data(A.nodes).join("text").attr("class",N??null).attr("x",F=>P(F).x).attr("y",F=>(F.y1+F.y0)/2).attr("dy",`${v?"0":"0.35"}em`).attr("text-anchor",F=>P(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=Fnr.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 I;switch(M){case"gradient":I=O(N=>N.uid,"coloring");break;case"source":I=O(N=>E(N.source.id),"coloring");break;case"target":I=O(N=>E(N.target.id),"coloring");break;default:I=M}D.append("path").attr("d",yoi()).attr("stroke",I).attr("stroke-width",N=>Math.max(1,N.width)),iR(void 0,u,0,f)},"draw"),Doi={draw:Roi},Loi=O(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` -`).trim(),"prepareTextForParsing"),Moi=O(t=>`.label { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:O(function(){var u=this.next();return u||this.lex()},"lex"),begin:O(function(u){this.conditionStack.push(u)},"begin"),popState:O(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:O(function(u){this.begin(u)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(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 s}();i.lexer=a;function o(){this.yy={}}return O(o,"Parser"),o.prototype=i,i.Parser=o,new o}();GLe.parser=GLe;var Fie=GLe,zie=[],Uie=[],Vie=new Map,woi=O(()=>{zie=[],Uie=[],Vie=new Map,_a()},"clear"),Aoi=(gP=class{constructor(e,r,n=0){this.source=e,this.target=r,this.value=n}},O(gP,"SankeyLink"),gP),Soi=O((t,e,r)=>{zie.push(new Aoi(t,e,r))},"addLink"),Toi=(mP=class{constructor(e){this.ID=e}},O(mP,"SankeyNode"),mP),Coi=O(t=>{t=Xt.sanitizeText(t,Ye());let e=Vie.get(t);return e===void 0&&(e=new Toi(t),Vie.set(t,e),Uie.push(e)),e},"findOrCreateNode"),Ooi=O(()=>Uie,"getNodes"),koi=O(()=>zie,"getLinks"),Eoi=O(()=>({nodes:Uie.map(t=>({id:t.ID})),links:zie.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),_oi={nodesMap:Vie,getConfig:O(()=>Ye().sankey,"getConfig"),getNodes:Ooi,getLinks:koi,getGraph:Eoi,addLink:Soi,findOrCreateNode:Coi,getAccTitle:oo,setAccTitle:Ba,getAccDescription:lo,setAccDescription:so,getDiagramTitle:$a,setDiagramTitle:co,clear:woi},Unr=(kb=class{static next(e){return new kb(e+ ++kb.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},O(kb,"Uid"),kb.count=0,kb),Roi={left:roi,right:noi,center:ioi,justify:Inr},Doi=O(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"),Loi=O(function(t,e,r,n){const{securityLevel:i,sankey:a}=Ye(),o=$2t.sankey;let s;i==="sandbox"&&(s=_t("#i"+e));const l=_t(i==="sandbox"?s.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):_t(`[id="${e}"]`),h=(a==null?void 0:a.width)??o.width,d=(a==null?void 0:a.height)??o.width,f=(a==null?void 0:a.useMaxWidth)??o.useMaxWidth,p=(a==null?void 0:a.nodeAlignment)??o.nodeAlignment,g=(a==null?void 0:a.prefix)??o.prefix,m=(a==null?void 0:a.suffix)??o.suffix,v=(a==null?void 0:a.showValues)??o.showValues,y=(a==null?void 0:a.nodeWidth)??o.nodeWidth??10,b=(a==null?void 0:a.nodePadding)??o.nodePadding??12,x=(a==null?void 0:a.labelStyle)??o.labelStyle??"legacy",w=(a==null?void 0:a.nodeColors)??{},A=n.db.getGraph(),S=Roi[p];loi().nodeId(N=>N.id).nodeWidth(y).nodePadding(b+(v?15:0)).nodeAlign(S).extent([[0,0],[h,d]])(A);const C=Doi(A.nodes),k=UT(_cn),E=O(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=Unr.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 _=O(({id:N,value:F})=>v?`${N} +${g}${Math.round(F*100)/100}${m}`:N,"getText"),P=O(N=>x==="outlined"?(N.layer??0)L.selectAll(N?`.${N}`:"text").data(A.nodes).join("text").attr("class",N??null).attr("x",F=>P(F).x).attr("y",F=>(F.y1+F.y0)/2).attr("dy",`${v?"0":"0.35"}em`).attr("text-anchor",F=>P(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=Unr.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 I;switch(M){case"gradient":I=O(N=>N.uid,"coloring");break;case"source":I=O(N=>E(N.source.id),"coloring");break;case"target":I=O(N=>E(N.target.id),"coloring");break;default:I=M}D.append("path").attr("d",xoi()).attr("stroke",I).attr("stroke-width",N=>Math.max(1,N.width)),iR(void 0,u,0,f)},"draw"),Moi={draw:Loi},Ioi=O(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,` +`).trim(),"prepareTextForParsing"),Poi=O(t=>`.label { font-family: ${t.fontFamily}; } @@ -3369,7 +3369,7 @@ ${g}${Math.round(F*100)/100}${m}`:N,"getText"),P=O(N=>x==="outlined"?(N.layer??0 stroke-opacity: 0.5; mix-blend-mode: multiply; } -`,"getStyles"),Ioi=Moi,Poi=Fie.parse.bind(Fie);Fie.parse=t=>Poi(Loi(t));var Noi={styles:Ioi,parser:Fie,db:koi,renderer:Doi};const Boi=Object.freeze(Object.defineProperty({__proto__:null,diagram:Noi},Symbol.toStringTag,{value:"Module"}));var $oi=Jn.packet,znr=(vP=class{constructor(){this.packet=[],this.setAccTitle=Ba,this.getAccTitle=oo,this.setDiagramTitle=co,this.getDiagramTitle=$a,this.getAccDescription=lo,this.setAccDescription=so}getConfig(){const e=uo({...$oi,...Dr().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){_a(),this.packet=[]}},O(vP,"PacketDB"),vP),Foi=1e4,zoi=O((t,e)=>{ah(t,e);let r=-1,n=[],i=1;const{bitsPerRow:a}=e.getConfig();for(let{start:o,end:s,bits:l,label:u}of t.blocks){if(o!==void 0&&s!==void 0&&s{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const n=e*r-1,i=e*r;return[{start:t.start,end:n,label:t.label,bits:n-t.start},{start:i,end:t.end,label:t.label,bits:t.end-i}]},"getNextFittingBlock"),Unr={parser:{yy:void 0},parse:O(async t=>{var n;const e=await Qp("packet",t),r=(n=Unr.parser)==null?void 0:n.yy;if(!(r instanceof znr))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");ye.debug(e),zoi(e,r)},"parse")},Voi=O((t,e,r,n)=>{const i=n.db,a=i.getConfig(),{rowHeight:o,paddingY:s,bitWidth:l,bitsPerRow:u}=a,h=i.getPacket(),d=i.getDiagramTitle(),f=o+s,p=f*(h.length+1)-(d?0:o),g=l*u+2,m=nu(e);m.attr("viewBox",`0 0 ${g} ${p}`),jo(m,p,g,a.useMaxWidth);for(const[v,y]of h.entries())Qoi(m,y,v,a);m.append("text").text(d).attr("x",g/2).attr("y",p-f/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),Qoi=O((t,e,r,{rowHeight:n,paddingX:i,paddingY:a,bitWidth:o,bitsPerRow:s,showBits:l})=>{const u=t.append("g"),h=r*(n+a)+a;for(const d of e){const f=d.start%s*o+1,p=(d.end-d.start+1)*o-i;if(u.append("rect").attr("x",f).attr("y",h).attr("width",p).attr("height",n).attr("class","packetBlock"),u.append("text").attr("x",f+p/2).attr("y",h+n/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(d.label),!l)continue;const g=d.end===d.start,m=h-2;u.append("text").attr("x",f+(g?p/2:0)).attr("y",m).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",g?"middle":"start").text(d.start),g||u.append("text").attr("x",f+p).attr("y",m).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(d.end)}},"drawWord"),Goi={draw:Voi},Hoi={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},Woi=O(({packet:t}={})=>{const e=uo(Hoi,t);return` +`,"getStyles"),Noi=Poi,Boi=Fie.parse.bind(Fie);Fie.parse=t=>Boi(Ioi(t));var $oi={styles:Noi,parser:Fie,db:_oi,renderer:Moi};const Foi=Object.freeze(Object.defineProperty({__proto__:null,diagram:$oi},Symbol.toStringTag,{value:"Module"}));var zoi=Jn.packet,Vnr=(vP=class{constructor(){this.packet=[],this.setAccTitle=Ba,this.getAccTitle=oo,this.setDiagramTitle=co,this.getDiagramTitle=$a,this.getAccDescription=lo,this.setAccDescription=so}getConfig(){const e=uo({...zoi,...Dr().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){_a(),this.packet=[]}},O(vP,"PacketDB"),vP),Uoi=1e4,Voi=O((t,e)=>{ah(t,e);let r=-1,n=[],i=1;const{bitsPerRow:a}=e.getConfig();for(let{start:o,end:s,bits:l,label:u}of t.blocks){if(o!==void 0&&s!==void 0&&s{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const n=e*r-1,i=e*r;return[{start:t.start,end:n,label:t.label,bits:n-t.start},{start:i,end:t.end,label:t.label,bits:t.end-i}]},"getNextFittingBlock"),Qnr={parser:{yy:void 0},parse:O(async t=>{var n;const e=await Qp("packet",t),r=(n=Qnr.parser)==null?void 0:n.yy;if(!(r instanceof Vnr))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");ye.debug(e),Voi(e,r)},"parse")},Goi=O((t,e,r,n)=>{const i=n.db,a=i.getConfig(),{rowHeight:o,paddingY:s,bitWidth:l,bitsPerRow:u}=a,h=i.getPacket(),d=i.getDiagramTitle(),f=o+s,p=f*(h.length+1)-(d?0:o),g=l*u+2,m=nu(e);m.attr("viewBox",`0 0 ${g} ${p}`),jo(m,p,g,a.useMaxWidth);for(const[v,y]of h.entries())Hoi(m,y,v,a);m.append("text").text(d).attr("x",g/2).attr("y",p-f/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),Hoi=O((t,e,r,{rowHeight:n,paddingX:i,paddingY:a,bitWidth:o,bitsPerRow:s,showBits:l})=>{const u=t.append("g"),h=r*(n+a)+a;for(const d of e){const f=d.start%s*o+1,p=(d.end-d.start+1)*o-i;if(u.append("rect").attr("x",f).attr("y",h).attr("width",p).attr("height",n).attr("class","packetBlock"),u.append("text").attr("x",f+p/2).attr("y",h+n/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(d.label),!l)continue;const g=d.end===d.start,m=h-2;u.append("text").attr("x",f+(g?p/2:0)).attr("y",m).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",g?"middle":"start").text(d.start),g||u.append("text").attr("x",f+p).attr("y",m).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(d.end)}},"drawWord"),Woi={draw:Goi},Yoi={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},qoi=O(({packet:t}={})=>{const e=uo(Yoi,t);return` .packetByte { font-size: ${e.byteFontSize}; } @@ -3392,7 +3392,7 @@ ${g}${Math.round(F*100)/100}${m}`:N,"getText"),P=O(N=>x==="outlined"?(N.layer??0 stroke-width: ${e.blockStrokeWidth}; fill: ${e.blockFillColor}; } - `},"styles"),Yoi={parser:Unr,get db(){return new znr},renderer:Goi,styles:Woi};const qoi=Object.freeze(Object.defineProperty({__proto__:null,diagram:Yoi},Symbol.toStringTag,{value:"Module"}));var DD={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},Qie=32,Vnr={axes:[],curves:[],options:DD},Tv=structuredClone(Vnr),joi=Jn.radar,Xoi=O(()=>uo({...joi,...Dr().radar}),"getConfig"),Qnr=O(()=>Tv.axes,"getAxes"),Koi=O(()=>Tv.curves,"getCurves"),Zoi=O(()=>Tv.options,"getOptions"),Joi=O(t=>{Tv.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),esi=O(t=>{Tv.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:tsi(e.entries)}))},"setCurves"),tsi=O(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=Qnr();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"),rsi=O(t=>{var r,n,i,a,o;const e=t.reduce((s,l)=>(s[l.name]=l,s),{});Tv.options={showLegend:((r=e.showLegend)==null?void 0:r.value)??DD.showLegend,ticks:((n=e.ticks)==null?void 0:n.value)??DD.ticks,max:((i=e.max)==null?void 0:i.value)??DD.max,min:((a=e.min)==null?void 0:a.value)??DD.min,graticule:((o=e.graticule)==null?void 0:o.value)??DD.graticule},Tv.options.ticks>Qie&&(ye.warn(`Radar diagram ticks (${Tv.options.ticks}) exceeds maximum allowed (${Qie}). Using ${Qie} instead.`),Tv.options.ticks=Qie)},"setOptions"),nsi=O(()=>{_a(),Tv=structuredClone(Vnr)},"clear"),dU={getAxes:Qnr,getCurves:Koi,getOptions:Zoi,setAxes:Joi,setCurves:esi,setOptions:rsi,getConfig:Xoi,clear:nsi,setAccTitle:Ba,getAccTitle:oo,setDiagramTitle:co,getDiagramTitle:$a,getAccDescription:lo,setAccDescription:so},isi=O(t=>{ah(t,dU);const{axes:e,curves:r,options:n}=t;dU.setAxes(e),dU.setCurves(r),dU.setOptions(n)},"populate"),asi={parse:O(async t=>{const e=await Qp("radar",t);ye.debug(e),isi(e)},"parse")},osi=O((t,e,r,n)=>{const i=n.db,a=i.getAxes(),o=i.getCurves(),s=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),h=nu(e),d=ssi(h,l),f=s.max??Math.max(...o.map(m=>Math.max(...m.entries))),p=s.min,g=Math.min(l.width,l.height)/2;lsi(d,a,g,s.ticks,s.graticule),csi(d,a,g,l),Gnr(d,a,o,p,f,s.graticule,l),Ynr(d,o,s.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),ssi=O((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 jo(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"),lsi=O((t,e,r,n,i)=>{if(i==="circle")for(let a=0;a{const d=2*h*Math.PI/a-Math.PI/2,f=s*Math.cos(d),p=s*Math.sin(d);return`${f},${p}`}).join(" ");t.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),csi=O((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(o).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 Gnr(t,e,r,n,i,a,o){const s=e.length,l=Math.min(o.width,o.height)/2;r.forEach((u,h)=>{if(u.entries.length!==s)return;const d=u.entries.map((f,p)=>{const g=2*Math.PI*p/s-Math.PI/2,m=Hnr(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",Wnr(d,o.curveTension)).attr("class",`radarCurve-${h}`):a==="polygon"&&t.append("polygon").attr("points",d.map(f=>`${f.x},${f.y}`).join(" ")).attr("class",`radarCurve-${h}`)})}O(Gnr,"drawCurves");function Hnr(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}O(Hnr,"relativeRadius");function Wnr(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*o})`);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(s.label)})}O(Ynr,"drawLegend");var usi={draw:osi},hsi=O((t,e)=>{let r="";for(let n=0;nuo({...Koi,...Dr().radar}),"getConfig"),Hnr=O(()=>Tv.axes,"getAxes"),Joi=O(()=>Tv.curves,"getCurves"),esi=O(()=>Tv.options,"getOptions"),tsi=O(t=>{Tv.axes=t.map(e=>({name:e.name,label:e.label??e.name}))},"setAxes"),rsi=O(t=>{Tv.curves=t.map(e=>({name:e.name,label:e.label??e.name,entries:nsi(e.entries)}))},"setCurves"),nsi=O(t=>{if(t[0].axis==null)return t.map(r=>r.value);const e=Hnr();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"),isi=O(t=>{var r,n,i,a,o;const e=t.reduce((s,l)=>(s[l.name]=l,s),{});Tv.options={showLegend:((r=e.showLegend)==null?void 0:r.value)??DD.showLegend,ticks:((n=e.ticks)==null?void 0:n.value)??DD.ticks,max:((i=e.max)==null?void 0:i.value)??DD.max,min:((a=e.min)==null?void 0:a.value)??DD.min,graticule:((o=e.graticule)==null?void 0:o.value)??DD.graticule},Tv.options.ticks>Qie&&(ye.warn(`Radar diagram ticks (${Tv.options.ticks}) exceeds maximum allowed (${Qie}). Using ${Qie} instead.`),Tv.options.ticks=Qie)},"setOptions"),asi=O(()=>{_a(),Tv=structuredClone(Gnr)},"clear"),dU={getAxes:Hnr,getCurves:Joi,getOptions:esi,setAxes:tsi,setCurves:rsi,setOptions:isi,getConfig:Zoi,clear:asi,setAccTitle:Ba,getAccTitle:oo,setDiagramTitle:co,getDiagramTitle:$a,getAccDescription:lo,setAccDescription:so},osi=O(t=>{ah(t,dU);const{axes:e,curves:r,options:n}=t;dU.setAxes(e),dU.setCurves(r),dU.setOptions(n)},"populate"),ssi={parse:O(async t=>{const e=await Qp("radar",t);ye.debug(e),osi(e)},"parse")},lsi=O((t,e,r,n)=>{const i=n.db,a=i.getAxes(),o=i.getCurves(),s=i.getOptions(),l=i.getConfig(),u=i.getDiagramTitle(),h=nu(e),d=csi(h,l),f=s.max??Math.max(...o.map(m=>Math.max(...m.entries))),p=s.min,g=Math.min(l.width,l.height)/2;usi(d,a,g,s.ticks,s.graticule),hsi(d,a,g,l),Wnr(d,a,o,p,f,s.graticule,l),jnr(d,o,s.showLegend,l),d.append("text").attr("class","radarTitle").text(u).attr("x",0).attr("y",-l.height/2-l.marginTop)},"draw"),csi=O((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 jo(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"),usi=O((t,e,r,n,i)=>{if(i==="circle")for(let a=0;a{const d=2*h*Math.PI/a-Math.PI/2,f=s*Math.cos(d),p=s*Math.sin(d);return`${f},${p}`}).join(" ");t.append("polygon").attr("points",l).attr("class","radarGraticule")}}},"drawGraticule"),hsi=O((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(o).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 Wnr(t,e,r,n,i,a,o){const s=e.length,l=Math.min(o.width,o.height)/2;r.forEach((u,h)=>{if(u.entries.length!==s)return;const d=u.entries.map((f,p)=>{const g=2*Math.PI*p/s-Math.PI/2,m=Ynr(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",qnr(d,o.curveTension)).attr("class",`radarCurve-${h}`):a==="polygon"&&t.append("polygon").attr("points",d.map(f=>`${f.x},${f.y}`).join(" ")).attr("class",`radarCurve-${h}`)})}O(Wnr,"drawCurves");function Ynr(t,e,r,n){const i=Math.min(Math.max(t,e),r);return n*(i-e)/(r-e)}O(Ynr,"relativeRadius");function qnr(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*o})`);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(s.label)})}O(jnr,"drawLegend");var dsi={draw:lsi},fsi=O((t,e)=>{let r="";for(let n=0;nx==="outlined"?(N.layer??0 fill-opacity: ${e.curveOpacity}; stroke: ${i}; } - `}return r},"genIndexStyles"),dsi=O(t=>{const e=jy(),r=Dr(),n=uo(e,r.themeVariables),i=uo(n.radar,t);return{themeVariables:n,radarOptions:i}},"buildRadarStyleOptions"),fsi=O(({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=dsi(t);return` + `}return r},"genIndexStyles"),psi=O(t=>{const e=jy(),r=Dr(),n=uo(e,r.themeVariables),i=uo(n.radar,t);return{themeVariables:n,radarOptions:i}},"buildRadarStyleOptions"),gsi=O(({radar:t}={})=>{const{themeVariables:e,radarOptions:r}=psi(t);return` .radarTitle { font-size: ${e.fontSize}; color: ${e.titleColor}; @@ -3431,13 +3431,13 @@ ${g}${Math.round(F*100)/100}${m}`:N,"getText"),P=O(N=>x==="outlined"?(N.layer??0 font-size: ${r.legendFontSize}px; dominant-baseline: hanging; } - ${hsi(e,r)} - `},"styles"),psi={parser:asi,db:dU,renderer:usi,styles:fsi};const gsi=Object.freeze(Object.defineProperty({__proto__:null,diagram:psi},Symbol.toStringTag,{value:"Module"}));var HLe=function(){var t=O(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],o=[1,16],s=[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:O(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:O(function(w,A,S,T,C,k,E){var _=k.length-1;switch(C){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 P=parseInt(k[_]),L=T.generateId();this.$={id:L,type:"space",label:"",width:P,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),I=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:I,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:o,43:s,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:o,43:s,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:o,43:s,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:o,43:s,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:O(function(w,A){if(A.recoverable)this.trace(w);else{var S=new Error(w);throw S.hash=A,S}},"parseError"),parse:O(function(w){var A=this,S=[0],T=[],C=[null],k=[],E=this.table,_="",P=0,L=0,R=2,D=1,M=k.slice.call(arguments,1),I=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]);I.setInput(w,N.yy),N.yy.lexer=I,N.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var B=I.yylloc;k.push(B);var V=I.options&&I.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function z(ie){S.length=S.length-2*ie,C.length=C.length-ie,k.length=k.length-ie}O(z,"popStack");function U(){var ie;return ie=T.pop()||I.lex()||D,typeof ie!="number"&&(ie instanceof Array&&(T=ie,ie=T.pop()),ie=A.symbols_[ie]||ie),ie}O(U,"lex");for(var Q,G,q,Y,ne={},X,J,ee,te;;){if(G=S[S.length-1],this.defaultActions[G]?q=this.defaultActions[G]:((Q===null||typeof Q>"u")&&(Q=U()),q=E[G]&&E[G][Q]),typeof q>"u"||!q.length||!q[0]){var pe="";te=[];for(X in E[G])this.terminals_[X]&&X>R&&te.push("'"+this.terminals_[X]+"'");I.showPosition?pe="Parse error on line "+(P+1)+`: + ${fsi(e,r)} + `},"styles"),msi={parser:ssi,db:dU,renderer:dsi,styles:gsi};const vsi=Object.freeze(Object.defineProperty({__proto__:null,diagram:msi},Symbol.toStringTag,{value:"Module"}));var HLe=function(){var t=O(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],o=[1,16],s=[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:O(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:O(function(w,A,S,T,C,k,E){var _=k.length-1;switch(C){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 P=parseInt(k[_]),L=T.generateId();this.$={id:L,type:"space",label:"",width:P,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),I=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:I,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:o,43:s,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:o,43:s,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:o,43:s,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:o,43:s,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:O(function(w,A){if(A.recoverable)this.trace(w);else{var S=new Error(w);throw S.hash=A,S}},"parseError"),parse:O(function(w){var A=this,S=[0],T=[],C=[null],k=[],E=this.table,_="",P=0,L=0,R=2,D=1,M=k.slice.call(arguments,1),I=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]);I.setInput(w,N.yy),N.yy.lexer=I,N.yy.parser=this,typeof I.yylloc>"u"&&(I.yylloc={});var B=I.yylloc;k.push(B);var V=I.options&&I.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function z(ie){S.length=S.length-2*ie,C.length=C.length-ie,k.length=k.length-ie}O(z,"popStack");function U(){var ie;return ie=T.pop()||I.lex()||D,typeof ie!="number"&&(ie instanceof Array&&(T=ie,ie=T.pop()),ie=A.symbols_[ie]||ie),ie}O(U,"lex");for(var Q,G,q,Y,ne={},X,J,ee,te;;){if(G=S[S.length-1],this.defaultActions[G]?q=this.defaultActions[G]:((Q===null||typeof Q>"u")&&(Q=U()),q=E[G]&&E[G][Q]),typeof q>"u"||!q.length||!q[0]){var pe="";te=[];for(X in E[G])this.terminals_[X]&&X>R&&te.push("'"+this.terminals_[X]+"'");I.showPosition?pe="Parse error on line "+(P+1)+`: `+I.showPosition()+` Expecting `+te.join(", ")+", got '"+(this.terminals_[Q]||Q)+"'":pe="Parse error on line "+(P+1)+": Unexpected "+(Q==D?"end of input":"'"+(this.terminals_[Q]||Q)+"'"),this.parseError(pe,{text:I.match,token:this.terminals_[Q]||Q,line:I.yylineno,loc:B,expected:te})}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+Q);switch(q[0]){case 1:S.push(Q),C.push(I.yytext),k.push(I.yylloc),S.push(q[1]),Q=null,L=I.yyleng,_=I.yytext,P=I.yylineno,B=I.yylloc;break;case 2:if(J=this.productions_[q[1]][1],ne.$=C[C.length-J],ne._$={first_line:k[k.length-(J||1)].first_line,last_line:k[k.length-1].last_line,first_column:k[k.length-(J||1)].first_column,last_column:k[k.length-1].last_column},V&&(ne._$.range=[k[k.length-(J||1)].range[0],k[k.length-1].range[1]]),Y=this.performAction.apply(ne,[_,L,P,N.yy,q[1],C,k].concat(M)),typeof Y<"u")return Y;J&&(S=S.slice(0,-1*J*2),C=C.slice(0,-1*J),k=k.slice(0,-1*J)),S.push(this.productions_[q[1]][0]),C.push(ne.$),k.push(ne._$),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:O(function(A,S){if(this.yy.parser)this.yy.parser.parseError(A,S);else throw new Error(A)},"parseError"),setInput:O(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:O(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:O(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 C=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=[C[0],C[0]+this.yyleng-A]),this.yyleng=this.yytext.length,this},"unput"),more:O(function(){return this._more=!0,this},"more"),reject:O(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:O(function(w){this.unput(this.match.slice(w))},"less"),pastInput:O(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:O(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:O(function(){var w=this.pastInput(),A=new Array(w.length+1).join("-");return w+this.upcomingInput()+` `+A+"^"},"showPosition"),test_match:O(function(w,A){var S,T,C;if(this.options.backtrack_lexer&&(C={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&&(C.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 C)this[k]=C[k];return!1}return!1},"test_match"),next:O(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 C=this._currentRules(),k=0;kA[0].length)){if(A=S,T=k,this.options.backtrack_lexer){if(w=this.test_match(S,C[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,C[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:O(function(){var A=this.next();return A||this.lex()},"lex"),begin:O(function(A){this.conditionStack.push(A)},"begin"),popState:O(function(){var A=this.conditionStack.length-1;return A>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(A){return A=this.conditionStack.length-1-Math.abs(A||0),A>=0?this.conditionStack[A]:"INITIAL"},"topState"),pushState:O(function(A){this.begin(A)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:O(function(A,S,T,C){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 O(b,"Parser"),b.prototype=v,v.Parser=b,new b}();HLe.parser=HLe;var msi=HLe,im=new Map,WLe=[],YLe=new Map,qnr="color",jnr="fill",vsi="bgFill",Xnr=",",Gie=new Map,qLe="",ysi=O(t=>Xt.sanitizeText(t,Ye()),"sanitizeText"),bsi=O(function(t,e=""){let r=Gie.get(t);r||(r={id:t,styles:[],textStyles:[]},Gie.set(t,r)),e!=null&&e.split(Xnr).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(qnr).exec(n)){const o=i.replace(jnr,vsi).replace(qnr,jnr);r.textStyles.push(o)}r.styles.push(i)})},"addStyleClass"),xsi=O(function(t,e=""){const r=im.get(t);e!=null&&(r.styles=e.split(Xnr))},"addStyle2Node"),wsi=O(function(t,e){t.split(",").forEach(function(r){let n=im.get(r);if(n===void 0){const i=r.trim();n={id:i,type:"na",children:[]},im.set(i,n)}n.classes||(n.classes=[]),n.classes.push(e)})},"setCssClass"),Knr=O((t,e)=>{const r=t.flat(),n=[],i=r.find(o=>(o==null?void 0:o.type)==="column-setting"),a=(i==null?void 0:i.columns)??-1;for(const o of r){if(typeof a=="number"&&a>0&&o.type!=="column-setting"&&typeof o.widthInColumns=="number"&&o.widthInColumns>a&&ye.warn(`Block ${o.id} width ${o.widthInColumns} exceeds configured column width ${a}`),o.label&&(o.label=ysi(o.label)),o.type==="classDef"){bsi(o.id,o.css);continue}if(o.type==="applyClass"){wsi(o.id,(o==null?void 0:o.styleClass)??"");continue}if(o.type==="applyStyles"){o!=null&&o.stylesStr&&xsi(o.id,o==null?void 0:o.stylesStr);continue}if(o.type==="column-setting")e.columns=o.columns??-1;else if(o.type==="edge"){const s=(YLe.get(o.id)??0)+1;YLe.set(o.id,s),o.id=s+"-"+o.id,WLe.push(o)}else{o.label||(o.type==="composite"?o.label="":o.label=o.id);const s=im.get(o.id);if(s===void 0?im.set(o.id,o):(o.type!=="na"&&(s.type=o.type),o.label!==o.id&&(s.label=o.label)),o.children&&Knr(o.children,o),o.type==="space"){const l=o.width??1;for(let u=0;u{ye.debug("Clear called"),_a(),fU={id:"root",type:"composite",children:[],columns:-1},im=new Map([["root",fU]]),jLe=[],Gie=new Map,WLe=[],YLe=new Map,qLe=""},"clear");function Znr(t){switch(ye.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return ye.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"}}O(Znr,"typeStr2Type");function Jnr(t){switch(ye.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}O(Jnr,"edgeTypeStr2Type");function eir(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}O(eir,"edgeStrToEdgeData");function tir(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}O(tir,"edgeStrToEdgeStartData");function rir(t){return t.includes("==")?"thick":"normal"}O(rir,"edgeStrToThickness");function nir(t){return t.includes(".-")?"dotted":"solid"}O(nir,"edgeStrToPattern");var iir=0,Ssi=O(()=>(iir++,"id-"+Math.random().toString(36).substr(2,12)+"-"+iir),"generateId"),Tsi=O(t=>{fU.children=t,Knr(t,fU),jLe=fU.children},"setHierarchy"),Csi=O(t=>{const e=im.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),Osi=O(()=>[...im.values()],"getBlocksFlat"),ksi=O(()=>jLe||[],"getBlocks"),Esi=O(()=>WLe,"getEdges"),_si=O(t=>im.get(t),"getBlock"),Rsi=O(t=>{im.set(t.id,t)},"setBlock"),Dsi=O(t=>{qLe=t},"setDiagramId"),Lsi=O(()=>qLe,"getDiagramId"),Msi=O(()=>ye,"getLogger"),Isi=O(function(){return Gie},"getClasses"),Psi={getConfig:O(()=>Dr().block,"getConfig"),typeStr2Type:Znr,edgeTypeStr2Type:Jnr,edgeStrToEdgeData:eir,edgeStrToEdgeStartData:tir,edgeStrToThickness:rir,edgeStrToPattern:nir,getLogger:Msi,getBlocksFlat:Osi,getBlocks:ksi,getEdges:Esi,setHierarchy:Tsi,getBlock:_si,setBlock:Rsi,getColumns:Csi,getClasses:Isi,clear:Asi,generateId:Ssi,setDiagramId:Dsi,getDiagramId:Lsi},Nsi=Psi,XLe=O((t,e)=>{const r=x1e,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Ag(n,i,a,e)},"fade"),Bsi=O(t=>`.label { +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:O(function(){var A=this.next();return A||this.lex()},"lex"),begin:O(function(A){this.conditionStack.push(A)},"begin"),popState:O(function(){var A=this.conditionStack.length-1;return A>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(A){return A=this.conditionStack.length-1-Math.abs(A||0),A>=0?this.conditionStack[A]:"INITIAL"},"topState"),pushState:O(function(A){this.begin(A)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:O(function(A,S,T,C){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 O(b,"Parser"),b.prototype=v,v.Parser=b,new b}();HLe.parser=HLe;var ysi=HLe,im=new Map,WLe=[],YLe=new Map,Xnr="color",Knr="fill",bsi="bgFill",Znr=",",Gie=new Map,qLe="",xsi=O(t=>Xt.sanitizeText(t,Ye()),"sanitizeText"),wsi=O(function(t,e=""){let r=Gie.get(t);r||(r={id:t,styles:[],textStyles:[]},Gie.set(t,r)),e!=null&&e.split(Znr).forEach(n=>{const i=n.replace(/([^;]*);/,"$1").trim();if(RegExp(Xnr).exec(n)){const o=i.replace(Knr,bsi).replace(Xnr,Knr);r.textStyles.push(o)}r.styles.push(i)})},"addStyleClass"),Asi=O(function(t,e=""){const r=im.get(t);e!=null&&(r.styles=e.split(Znr))},"addStyle2Node"),Ssi=O(function(t,e){t.split(",").forEach(function(r){let n=im.get(r);if(n===void 0){const i=r.trim();n={id:i,type:"na",children:[]},im.set(i,n)}n.classes||(n.classes=[]),n.classes.push(e)})},"setCssClass"),Jnr=O((t,e)=>{const r=t.flat(),n=[],i=r.find(o=>(o==null?void 0:o.type)==="column-setting"),a=(i==null?void 0:i.columns)??-1;for(const o of r){if(typeof a=="number"&&a>0&&o.type!=="column-setting"&&typeof o.widthInColumns=="number"&&o.widthInColumns>a&&ye.warn(`Block ${o.id} width ${o.widthInColumns} exceeds configured column width ${a}`),o.label&&(o.label=xsi(o.label)),o.type==="classDef"){wsi(o.id,o.css);continue}if(o.type==="applyClass"){Ssi(o.id,(o==null?void 0:o.styleClass)??"");continue}if(o.type==="applyStyles"){o!=null&&o.stylesStr&&Asi(o.id,o==null?void 0:o.stylesStr);continue}if(o.type==="column-setting")e.columns=o.columns??-1;else if(o.type==="edge"){const s=(YLe.get(o.id)??0)+1;YLe.set(o.id,s),o.id=s+"-"+o.id,WLe.push(o)}else{o.label||(o.type==="composite"?o.label="":o.label=o.id);const s=im.get(o.id);if(s===void 0?im.set(o.id,o):(o.type!=="na"&&(s.type=o.type),o.label!==o.id&&(s.label=o.label)),o.children&&Jnr(o.children,o),o.type==="space"){const l=o.width??1;for(let u=0;u{ye.debug("Clear called"),_a(),fU={id:"root",type:"composite",children:[],columns:-1},im=new Map([["root",fU]]),jLe=[],Gie=new Map,WLe=[],YLe=new Map,qLe=""},"clear");function eir(t){switch(ye.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return ye.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"}}O(eir,"typeStr2Type");function tir(t){switch(ye.debug("typeStr2Type",t),t){case"==":return"thick";default:return"normal"}}O(tir,"edgeTypeStr2Type");function rir(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}O(rir,"edgeStrToEdgeData");function nir(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}O(nir,"edgeStrToEdgeStartData");function iir(t){return t.includes("==")?"thick":"normal"}O(iir,"edgeStrToThickness");function air(t){return t.includes(".-")?"dotted":"solid"}O(air,"edgeStrToPattern");var oir=0,Csi=O(()=>(oir++,"id-"+Math.random().toString(36).substr(2,12)+"-"+oir),"generateId"),Osi=O(t=>{fU.children=t,Jnr(t,fU),jLe=fU.children},"setHierarchy"),ksi=O(t=>{const e=im.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),Esi=O(()=>[...im.values()],"getBlocksFlat"),_si=O(()=>jLe||[],"getBlocks"),Rsi=O(()=>WLe,"getEdges"),Dsi=O(t=>im.get(t),"getBlock"),Lsi=O(t=>{im.set(t.id,t)},"setBlock"),Msi=O(t=>{qLe=t},"setDiagramId"),Isi=O(()=>qLe,"getDiagramId"),Psi=O(()=>ye,"getLogger"),Nsi=O(function(){return Gie},"getClasses"),Bsi={getConfig:O(()=>Dr().block,"getConfig"),typeStr2Type:eir,edgeTypeStr2Type:tir,edgeStrToEdgeData:rir,edgeStrToEdgeStartData:nir,edgeStrToThickness:iir,edgeStrToPattern:air,getLogger:Psi,getBlocksFlat:Esi,getBlocks:_si,getEdges:Rsi,setHierarchy:Osi,getBlock:Dsi,setBlock:Lsi,getColumns:ksi,getClasses:Nsi,clear:Tsi,generateId:Csi,setDiagramId:Msi,getDiagramId:Isi},$si=Bsi,XLe=O((t,e)=>{const r=x1e,n=r(t,"r"),i=r(t,"g"),a=r(t,"b");return Ag(n,i,a,e)},"fade"),Fsi=O(t=>`.label { font-family: ${t.fontFamily}; color: ${t.nodeTextColor||t.textColor}; } @@ -3560,13 +3560,13 @@ Expecting `+te.join(", ")+", got '"+(this.terminals_[Q]||Q)+"'":pe="Parse error fill: ${t.textColor}; } ${T9()} -`,"getStyles"),$si=Bsi,Fsi=O((t,e,r,n)=>{e.forEach(i=>{jsi[i](t,r,n)})},"insertMarkers"),zsi=O((t,e,r)=>{ye.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"),Usi=O((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"),Vsi=O((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"),Qsi=O((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"),Gsi=O((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"),Hsi=O((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"),Wsi=O((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"),Ysi=O((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"),qsi=O((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"),jsi={extension:zsi,composition:Usi,aggregation:Vsi,dependency:Qsi,lollipop:Gsi,point:Hsi,circle:Wsi,cross:Ysi,barb:qsi},Xsi=Fsi;function KLe(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}}O(KLe,"calculateBlockPosition");var Ksi=O(t=>{let e=0,r=0;for(const n of t.children){const{width:i,height:a,x:o,y:s}=n.size??{width:0,height:0,x:0,y:0};if(ye.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",a,"x:",o,"y:",s,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 Hie(t,e,r=0,n=0,i=8){var s,l,u,h,d,f,p,g,m,v,y;ye.debug("setBlockSizes abc95 (start)",t.id,(s=t==null?void 0:t.size)==null?void 0:s.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,o=0;if(((u=t.children)==null?void 0:u.length)>0){for(const k of t.children)Hie(k,e,0,0,i);const b=Ksi(t);a=b.width,o=b.height,ye.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",a,o);for(const k of t.children)k.size&&(ye.debug(`abc95 Setting size of children of ${t.id} id=${k.id} ${a} ${o} ${JSON.stringify(k.size)}`),k.size.width=a*(k.widthInColumns??1)+i*((k.widthInColumns??1)-1),k.size.height=o,k.size.x=0,k.size.y=0,ye.debug(`abc95 updating size of ${t.id} children child:${k.id} maxWidth:${a} maxHeight:${o}`));for(const k of t.children)Hie(k,e,a,o,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;ye.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:C,x:0,y:0}}ye.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)}O(Hie,"setBlockSizes");function ZLe(t,e,r=8){var i,a,o,s,l,u,h,d,f,p,g,m,v,y,b,x,w;ye.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: ${(o=t==null?void 0:t.size)==null?void 0:o.width}`);const n=t.columns??-1;if(ye.debug("layoutBlocks columns abc95",t.id,"=>",n,t),t.children&&t.children.length>0){const A=((l=(s=t==null?void 0:t.children[0])==null?void 0:s.size)==null?void 0:l.width)??0,S=t.children.length*A+(t.children.length-1)*r;ye.debug("widthOfChildren 88",S,"posX");const T=new Map;{let P=0;for(const L of t.children){if(!L.size)continue;const{py:R}=KLe(n,P),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-P%n)),P+=M}}const C=new Map;{let P=0;const L=[...T.keys()].sort((R,D)=>R-D);for(const R of L)C.set(R,P),P+=(T.get(R)??0)+r}let k=0;ye.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 P of t.children){const L=t;if(!P.size)continue;const{width:R,height:D}=P.size,{px:M,py:I}=KLe(n,k);if(I!=_&&(_=I,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,ye.debug("New row in layout for block",t.id," and child ",P.id,_)),ye.debug(`abc89 layout blocks (child) id: ${P.id} Pos: ${k} (px, py) ${M},${I} (${(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;P.size.x=E+r+F,ye.debug(`abc91 layout blocks (calc) px, pyid:${P.id} startingPos=X${E} new startingPosX${P.size.x} ${F} padding=${r} width=${R} halfWidth=${F} => x:${P.size.x} y:${P.size.y} ${P.widthInColumns} (width * (child?.w || 1)) / 2 ${R*((P==null?void 0:P.widthInColumns)??1)/2}`),E=P.size.x+F;const B=C.get(I)??0,V=T.get(I)??D;P.size.y=L.size.y-L.size.height/2+B+V/2+r,ye.debug(`abc88 layout blocks (calc) px, pyid:${P.id}startingPosX${E}${r}${F}=>x:${P.size.x}y:${P.size.y}${P.widthInColumns}(width * (child?.w || 1)) / 2${R*((P==null?void 0:P.widthInColumns)??1)/2}`)}P.children&&ZLe(P,e,r);let N=(P==null?void 0:P.widthInColumns)??1;n>0&&(N=Math.min(N,n-k%n)),k+=N,ye.debug("abc88 columnsPos",P,k)}}ye.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}`)}O(ZLe,"layoutBlocks");function JLe(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:o,width:s,height:l}=t.size;a-s/2n&&(n=a+s/2),o+l/2>i&&(i=o+l/2)}if(t.children)for(const a of t.children)({minX:e,minY:r,maxX:n,maxY:i}=JLe(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}O(JLe,"findBounds");function air(t){var u,h;const e=t.getBlock("root");if(!e)return;const r=((h=(u=Ye())==null?void 0:u.block)==null?void 0:h.padding)??8;Hie(e,t,0,0,r),ZLe(e,t,r),ye.debug("getBlocks",JSON.stringify(e,null,2));const{minX:n,minY:i,maxX:a,maxY:o}=JLe(e),s=o-i,l=a-n;return{x:n,y:i,width:l,height:s}}O(air,"layout");var Zsi=O(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const o=Ye(),s=na(o);return await su(t,a,{style:r,isTitle:n,useHtmlLabels:s,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},o)},"createLabel"),am=Zsi,Jsi=O((t,e,r,n,i)=>{e.arrowTypeStart&&oir(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&oir(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),eli={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},oir=O((t,e,r,n,i,a)=>{const o=eli[r];if(!o){ye.warn(`Unknown arrow type: ${r}`);return}const s=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${a}-${o}${s})`)},"addEdgeMarker"),eMe={},gu={},tli=O(async(t,e)=>{const r=Ye(),n=na(r),i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label"),o=e.labelType==="markdown",s=await su(t,e.label,{style:e.labelStyle,useHtmlLabels:n,addSvgBackground:o,isNode:!1,markdown:o,width:o?void 0:Number.POSITIVE_INFINITY},r);a.node().appendChild(s);let l=s.getBBox(),u=l;if(n){const d=s.children[0],f=_t(s);l=d.getBoundingClientRect(),u=l,f.attr("width",l.width),f.attr("height",l.height)}else{const d=_t(s).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}a.attr("transform",A0(u,n)),eMe[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 am(f,e.startLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],v=_t(p);g=m.getBoundingClientRect(),v.attr("width",g.width),v.attr("height",g.height)}f.attr("transform",A0(g,n)),gu[e.id]||(gu[e.id]={}),gu[e.id].startLeft=d,pU(h,e.startLabelLeft)}if(e.startLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await am(f,e.startLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],v=_t(p);g=m.getBoundingClientRect(),v.attr("width",g.width),v.attr("height",g.height)}f.attr("transform",A0(g,n)),gu[e.id]||(gu[e.id]={}),gu[e.id].startRight=d,pU(h,e.startLabelRight)}if(e.endLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await am(d,e.endLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],v=_t(p);g=m.getBoundingClientRect(),v.attr("width",g.width),v.attr("height",g.height)}f.attr("transform",A0(g,n)),gu[e.id]||(gu[e.id]={}),gu[e.id].endLeft=d,pU(h,e.endLabelLeft)}if(e.endLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await am(d,e.endLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],v=_t(p);g=m.getBoundingClientRect(),v.attr("width",g.width),v.attr("height",g.height)}f.attr("transform",A0(g,n)),gu[e.id]||(gu[e.id]={}),gu[e.id].endRight=d,pU(h,e.endLabelRight)}return s},"insertEdgeLabel");function pU(t,e){na(Ye())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}O(pU,"setTerminalWidth");var rli=O((t,e)=>{ye.debug("Moving label abc88 ",t.id,t.label,eMe[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Ye(),{subGraphTitleTotalMargin:i}=TR(n);if(t.label){const a=eMe[t.id];let o=t.x,s=t.y;if(r){const l=un.calcLabelPosition(r);ye.debug("Moving label "+t.label+" from (",o,",",s,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(o=l.x,s=l.y)}a.attr("transform",`translate(${o}, ${s+i/2})`)}if(t.startLabelLeft){const a=gu[t.id].startLeft;let o=t.x,s=t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(t.startLabelRight){const a=gu[t.id].startRight;let o=t.x,s=t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(t.endLabelLeft){const a=gu[t.id].endLeft;let o=t.x,s=t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(t.endLabelRight){const a=gu[t.id].endRight;let o=t.x,s=t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}},"positionEdgeLabel"),nli=O((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),o=t.width/2,s=t.height/2;return i>=o||a>=s},"outsideNode"),ili=O((t,e,r)=>{ye.debug(`intersection calc abc89: +`,"getStyles"),zsi=Fsi,Usi=O((t,e,r,n)=>{e.forEach(i=>{Ksi[i](t,r,n)})},"insertMarkers"),Vsi=O((t,e,r)=>{ye.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"),Qsi=O((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"),Gsi=O((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"),Hsi=O((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"),Wsi=O((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"),Ysi=O((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"),qsi=O((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"),jsi=O((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"),Xsi=O((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"),Ksi={extension:Vsi,composition:Qsi,aggregation:Gsi,dependency:Hsi,lollipop:Wsi,point:Ysi,circle:qsi,cross:jsi,barb:Xsi},Zsi=Usi;function KLe(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}}O(KLe,"calculateBlockPosition");var Jsi=O(t=>{let e=0,r=0;for(const n of t.children){const{width:i,height:a,x:o,y:s}=n.size??{width:0,height:0,x:0,y:0};if(ye.debug("getMaxChildSize abc95 child:",n.id,"width:",i,"height:",a,"x:",o,"y:",s,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 Hie(t,e,r=0,n=0,i=8){var s,l,u,h,d,f,p,g,m,v,y;ye.debug("setBlockSizes abc95 (start)",t.id,(s=t==null?void 0:t.size)==null?void 0:s.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,o=0;if(((u=t.children)==null?void 0:u.length)>0){for(const k of t.children)Hie(k,e,0,0,i);const b=Jsi(t);a=b.width,o=b.height,ye.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",a,o);for(const k of t.children)k.size&&(ye.debug(`abc95 Setting size of children of ${t.id} id=${k.id} ${a} ${o} ${JSON.stringify(k.size)}`),k.size.width=a*(k.widthInColumns??1)+i*((k.widthInColumns??1)-1),k.size.height=o,k.size.x=0,k.size.y=0,ye.debug(`abc95 updating size of ${t.id} children child:${k.id} maxWidth:${a} maxHeight:${o}`));for(const k of t.children)Hie(k,e,a,o,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;ye.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:C,x:0,y:0}}ye.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)}O(Hie,"setBlockSizes");function ZLe(t,e,r=8){var i,a,o,s,l,u,h,d,f,p,g,m,v,y,b,x,w;ye.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: ${(o=t==null?void 0:t.size)==null?void 0:o.width}`);const n=t.columns??-1;if(ye.debug("layoutBlocks columns abc95",t.id,"=>",n,t),t.children&&t.children.length>0){const A=((l=(s=t==null?void 0:t.children[0])==null?void 0:s.size)==null?void 0:l.width)??0,S=t.children.length*A+(t.children.length-1)*r;ye.debug("widthOfChildren 88",S,"posX");const T=new Map;{let P=0;for(const L of t.children){if(!L.size)continue;const{py:R}=KLe(n,P),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-P%n)),P+=M}}const C=new Map;{let P=0;const L=[...T.keys()].sort((R,D)=>R-D);for(const R of L)C.set(R,P),P+=(T.get(R)??0)+r}let k=0;ye.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 P of t.children){const L=t;if(!P.size)continue;const{width:R,height:D}=P.size,{px:M,py:I}=KLe(n,k);if(I!=_&&(_=I,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,ye.debug("New row in layout for block",t.id," and child ",P.id,_)),ye.debug(`abc89 layout blocks (child) id: ${P.id} Pos: ${k} (px, py) ${M},${I} (${(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;P.size.x=E+r+F,ye.debug(`abc91 layout blocks (calc) px, pyid:${P.id} startingPos=X${E} new startingPosX${P.size.x} ${F} padding=${r} width=${R} halfWidth=${F} => x:${P.size.x} y:${P.size.y} ${P.widthInColumns} (width * (child?.w || 1)) / 2 ${R*((P==null?void 0:P.widthInColumns)??1)/2}`),E=P.size.x+F;const B=C.get(I)??0,V=T.get(I)??D;P.size.y=L.size.y-L.size.height/2+B+V/2+r,ye.debug(`abc88 layout blocks (calc) px, pyid:${P.id}startingPosX${E}${r}${F}=>x:${P.size.x}y:${P.size.y}${P.widthInColumns}(width * (child?.w || 1)) / 2${R*((P==null?void 0:P.widthInColumns)??1)/2}`)}P.children&&ZLe(P,e,r);let N=(P==null?void 0:P.widthInColumns)??1;n>0&&(N=Math.min(N,n-k%n)),k+=N,ye.debug("abc88 columnsPos",P,k)}}ye.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}`)}O(ZLe,"layoutBlocks");function JLe(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:o,width:s,height:l}=t.size;a-s/2n&&(n=a+s/2),o+l/2>i&&(i=o+l/2)}if(t.children)for(const a of t.children)({minX:e,minY:r,maxX:n,maxY:i}=JLe(a,{minX:e,minY:r,maxX:n,maxY:i}));return{minX:e,minY:r,maxX:n,maxY:i}}O(JLe,"findBounds");function sir(t){var u,h;const e=t.getBlock("root");if(!e)return;const r=((h=(u=Ye())==null?void 0:u.block)==null?void 0:h.padding)??8;Hie(e,t,0,0,r),ZLe(e,t,r),ye.debug("getBlocks",JSON.stringify(e,null,2));const{minX:n,minY:i,maxX:a,maxY:o}=JLe(e),s=o-i,l=a-n;return{x:n,y:i,width:l,height:s}}O(sir,"layout");var eli=O(async(t,e,r,n=!1,i=!1)=>{let a=e||"";typeof a=="object"&&(a=a[0]);const o=Ye(),s=na(o);return await su(t,a,{style:r,isTitle:n,useHtmlLabels:s,markdown:!1,isNode:i,width:Number.POSITIVE_INFINITY},o)},"createLabel"),am=eli,tli=O((t,e,r,n,i)=>{e.arrowTypeStart&&lir(t,"start",e.arrowTypeStart,r,n,i),e.arrowTypeEnd&&lir(t,"end",e.arrowTypeEnd,r,n,i)},"addEdgeMarkers"),rli={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},lir=O((t,e,r,n,i,a)=>{const o=rli[r];if(!o){ye.warn(`Unknown arrow type: ${r}`);return}const s=e==="start"?"Start":"End";t.attr(`marker-${e}`,`url(${n}#${i}_${a}-${o}${s})`)},"addEdgeMarker"),eMe={},gu={},nli=O(async(t,e)=>{const r=Ye(),n=na(r),i=t.insert("g").attr("class","edgeLabel"),a=i.insert("g").attr("class","label"),o=e.labelType==="markdown",s=await su(t,e.label,{style:e.labelStyle,useHtmlLabels:n,addSvgBackground:o,isNode:!1,markdown:o,width:o?void 0:Number.POSITIVE_INFINITY},r);a.node().appendChild(s);let l=s.getBBox(),u=l;if(n){const d=s.children[0],f=_t(s);l=d.getBoundingClientRect(),u=l,f.attr("width",l.width),f.attr("height",l.height)}else{const d=_t(s).select("text").node();d&&typeof d.getBBox=="function"&&(u=d.getBBox())}a.attr("transform",A0(u,n)),eMe[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 am(f,e.startLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],v=_t(p);g=m.getBoundingClientRect(),v.attr("width",g.width),v.attr("height",g.height)}f.attr("transform",A0(g,n)),gu[e.id]||(gu[e.id]={}),gu[e.id].startLeft=d,pU(h,e.startLabelLeft)}if(e.startLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await am(f,e.startLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],v=_t(p);g=m.getBoundingClientRect(),v.attr("width",g.width),v.attr("height",g.height)}f.attr("transform",A0(g,n)),gu[e.id]||(gu[e.id]={}),gu[e.id].startRight=d,pU(h,e.startLabelRight)}if(e.endLabelLeft){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await am(d,e.endLabelLeft,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],v=_t(p);g=m.getBoundingClientRect(),v.attr("width",g.width),v.attr("height",g.height)}f.attr("transform",A0(g,n)),gu[e.id]||(gu[e.id]={}),gu[e.id].endLeft=d,pU(h,e.endLabelLeft)}if(e.endLabelRight){const d=t.insert("g").attr("class","edgeTerminals"),f=d.insert("g").attr("class","inner"),p=await am(d,e.endLabelRight,e.labelStyle);h=p;let g=p.getBBox();if(n){const m=p.children[0],v=_t(p);g=m.getBoundingClientRect(),v.attr("width",g.width),v.attr("height",g.height)}f.attr("transform",A0(g,n)),gu[e.id]||(gu[e.id]={}),gu[e.id].endRight=d,pU(h,e.endLabelRight)}return s},"insertEdgeLabel");function pU(t,e){na(Ye())&&t&&(t.style.width=e.length*9+"px",t.style.height="12px")}O(pU,"setTerminalWidth");var ili=O((t,e)=>{ye.debug("Moving label abc88 ",t.id,t.label,eMe[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const n=Ye(),{subGraphTitleTotalMargin:i}=TR(n);if(t.label){const a=eMe[t.id];let o=t.x,s=t.y;if(r){const l=un.calcLabelPosition(r);ye.debug("Moving label "+t.label+" from (",o,",",s,") to (",l.x,",",l.y,") abc88"),e.updatedPath&&(o=l.x,s=l.y)}a.attr("transform",`translate(${o}, ${s+i/2})`)}if(t.startLabelLeft){const a=gu[t.id].startLeft;let o=t.x,s=t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(t.startLabelRight){const a=gu[t.id].startRight;let o=t.x,s=t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(t.endLabelLeft){const a=gu[t.id].endLeft;let o=t.x,s=t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}if(t.endLabelRight){const a=gu[t.id].endRight;let o=t.x,s=t.y;if(r){const l=un.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);o=l.x,s=l.y}a.attr("transform",`translate(${o}, ${s})`)}},"positionEdgeLabel"),ali=O((t,e)=>{const r=t.x,n=t.y,i=Math.abs(e.x-r),a=Math.abs(e.y-n),o=t.width/2,s=t.height/2;return i>=o||a>=s},"outsideNode"),oli=O((t,e,r)=>{ye.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),o=t.width/2;let s=r.xMath.abs(n-e.x)*l){let d=r.y{ye.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(!nli(e,a)&&!i){const o=ili(e,n,a);let s=!1;r.forEach(l=>{s=s||l.x===o.x&&l.y===o.y}),r.some(l=>l.x===o.x&&l.y===o.y)||r.push(o),i=!0}else n=a,i||r.push(a)}),r},"cutPathAtIntersect"),ali=O(function(t,e,r,n,i,a,o){let s=r.points;ye.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)&&(s=s.slice(1,r.points.length-1),s.unshift(u.intersect(s[0])),s.push(h.intersect(s[s.length-1]))),r.toCluster&&(ye.debug("to cluster abc88",n[r.toCluster]),s=sir(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(ye.debug("from cluster abc88",n[r.fromCluster]),s=sir(s.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=s.filter(w=>!Number.isNaN(w.y));let f=B7;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=Hkt(r),m=N7().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="";(Ye().flowchart.arrowMarkerAbsolute||Ye().state.arrowMarkerAbsolute)&&(b=Cj(!0)),Jsi(y,r,b,o,i);let x={};return l&&(x.updatedPath=s),x.originalPath=r.points,x},"insertEdge"),oli=O(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"),sli=O((t,e,r,n)=>{const i=oli(t),a=2,o=e.height+2*r.padding,s=o/a,l=n??e.width+2*s+r.padding,u=r.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:s,y:0},{x:l/2,y:2*u},{x:l-s,y:0},{x:l,y:0},{x:l,y:-o/3},{x:l+2*u,y:-o/2},{x:l,y:-2*o/3},{x:l,y:-o},{x:l-s,y:-o},{x:l/2,y:-o-2*u},{x:s,y:-o},{x:0,y:-o},{x:0,y:-2*o/3},{x:-2*u,y:-o/2},{x:0,y:-o/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:s,y:0},{x:l-s,y:0},{x:l,y:-o/2},{x:l-s,y:-o},{x:s,y:-o},{x:0,y:-o/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:s,y:-o},{x:l-s,y:-o},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-s},{x:l,y:-o+s},{x:0,y:-o}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-s},{x:0,y:-o+s},{x:l,y:-o}]:i.has("right")&&i.has("left")?[{x:s,y:0},{x:s,y:-u},{x:l-s,y:-u},{x:l-s,y:0},{x:l,y:-o/2},{x:l-s,y:-o},{x:l-s,y:-o+u},{x:s,y:-o+u},{x:s,y:-o},{x:0,y:-o/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:s,y:-u},{x:s,y:-o+u},{x:0,y:-o+u},{x:l/2,y:-o},{x:l,y:-o+u},{x:l-s,y:-o+u},{x:l-s,y:-u},{x:l,y:-u}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-s},{x:0,y:-o}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-o}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-s},{x:l,y:-o}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-o}]:i.has("right")?[{x:s,y:-u},{x:s,y:-u},{x:l-s,y:-u},{x:l-s,y:0},{x:l,y:-o/2},{x:l-s,y:-o},{x:l-s,y:-o+u},{x:s,y:-o+u},{x:s,y:-o+u}]:i.has("left")?[{x:s,y:0},{x:s,y:-u},{x:l-s,y:-u},{x:l-s,y:-o+u},{x:s,y:-o+u},{x:s,y:-o},{x:0,y:-o/2}]:i.has("up")?[{x:s,y:-u},{x:s,y:-o+u},{x:0,y:-o+u},{x:l/2,y:-o},{x:l,y:-o+u},{x:l-s,y:-o+u},{x:l-s,y:-u}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:s,y:-u},{x:s,y:-o+u},{x:l-s,y:-o+u},{x:l-s,y:-u},{x:l,y:-u}]:[{x:0,y:0}]},"getArrowPoints");function lir(t,e){return t.intersect(e)}O(lir,"intersectNode");var lli=lir;function cir(t,e,r,n){var i=t.x,a=t.y,o=i-n.x,s=a-n.y,l=Math.sqrt(e*e*s*s+r*r*o*o),u=Math.abs(e*r*o/l);n.x0}O(tMe,"sameSign");var uli=dir,hli=fir;function fir(t,e,r){var n=t.x,i=t.y,a=[],o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(g){o=Math.min(o,g.x),s=Math.min(s,g.y)}):(o=Math.min(o,e.x),s=Math.min(s,e.y));for(var l=n-t.width/2-o,u=i-t.height/2-s,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,o=t.width/2,s=t.height/2,l,u;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),l=a===0?0:s*i/a,u=s):(i<0&&(o=-o),l=o,u=i===0?0:o*a/i),{x:r+l,y:n+u}},"intersectRect"),fli=dli,Oo={node:lli,circle:cli,ellipse:uir,polygon:hli,rect:fli},Jl=O(async(t,e,r,n)=>{const i=Ye();let a;const o=e.useHtmlLabels||na(i);r?a=r:a="node default";const s=t.insert("g").attr("class",a).attr("id",e.domId||e.id),l=s.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=su(l,li(o1(u),i),{useHtmlLabels:o,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):h=await am(l,li(o1(u),i),e.labelStyle,!1,n);let d=h.getBBox();const f=e.padding/2;if(na(i)){const p=h.children[0],g=_t(h);await wxe(p,u),d=p.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return o?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:s,bbox:d,halfPadding:f,label:l}},"labelHelper"),as=O((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function om(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+")")}O(om,"insertPolygonShape");var pli=O(async(t,e)=>{e.useHtmlLabels||na(Ye())||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:a}=await Jl(t,e,"node "+e.classes,!0);ye.info("Classes = ",e.classes);const o=n.insert("rect",":first-child");return o.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),as(e,o),e.intersect=function(s){return Oo.rect(e,s)},n},"note"),gli=pli,pir=O(t=>t?" "+t:"","formatClass"),Tf=O((t,e)=>`${e||"node default"}${pir(t.classes)} ${pir(t.class)}`,"getClassesFromNode"),gir=O(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Jl(t,e,Tf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=i+a,s=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}];ye.info("Question main (Circle)");const l=om(r,o,o,s);return l.attr("style",e.style),as(e,l),e.intersect=function(u){return ye.warn("Intersect called"),Oo.polygon(e,s,u)},r},"question"),mli=O((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(o){return o.x+","+o.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(o){return Oo.circle(e,14,o)},r},"choice"),vli=O(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Jl(t,e,Tf(e,void 0),!0),i=4,a=e.positioned?e.height:n.height+e.padding,o=a/i,s=e.positioned?e.width:n.width+2*o+e.padding,l=[{x:o,y:0},{x:s-o,y:0},{x:s,y:-a/2},{x:s-o,y:-a},{x:o,y:-a},{x:0,y:-a/2}],u=om(r,s,a,l);return u.attr("style",e.style),as(e,u),e.intersect=function(h){return Oo.polygon(e,l,h)},r},"hexagon"),yli=O(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Jl(t,e,void 0,!0),i=2,a=n.height+2*e.padding,o=a/i,s=n.width+2*o+e.padding,u=e.positioned&&(e.widthInColumns??1)>1&&e.width>s?e.width:s,h=sli(e.directions,n,e,u),d=om(r,u,a,h);return d.attr("style",e.style),as(e,d),e.intersect=function(f){return Oo.polygon(e,h,f)},r},"block_arrow"),bli=O(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Jl(t,e,Tf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:-a/2,y:0},{x:i,y:0},{x:i,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return om(r,i,a,o).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(l){return Oo.polygon(e,o,l)},r},"rect_left_inv_arrow"),xli=O(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Jl(t,e,Tf(e),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:-2*a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:a/6,y:-a}],s=om(r,i,a,o);return s.attr("style",e.style),as(e,s),e.intersect=function(l){return Oo.polygon(e,o,l)},r},"lean_right"),wli=O(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Jl(t,e,Tf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:2*a/6,y:0},{x:i+a/6,y:0},{x:i-2*a/6,y:-a},{x:-a/6,y:-a}],s=om(r,i,a,o);return s.attr("style",e.style),as(e,s),e.intersect=function(l){return Oo.polygon(e,o,l)},r},"lean_left"),Ali=O(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Jl(t,e,Tf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:-2*a/6,y:0},{x:i+2*a/6,y:0},{x:i-a/6,y:-a},{x:a/6,y:-a}],s=om(r,i,a,o);return s.attr("style",e.style),as(e,s),e.intersect=function(l){return Oo.polygon(e,o,l)},r},"trapezoid"),Sli=O(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Jl(t,e,Tf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:-2*a/6,y:-a}],s=om(r,i,a,o);return s.attr("style",e.style),as(e,s),e.intersect=function(l){return Oo.polygon(e,o,l)},r},"inv_trapezoid"),Tli=O(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Jl(t,e,Tf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{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}],s=om(r,i,a,o);return s.attr("style",e.style),as(e,s),e.intersect=function(l){return Oo.polygon(e,o,l)},r},"rect_right_inv_arrow"),Cli=O(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Jl(t,e,Tf(e,void 0),!0),i=n.width+e.padding,a=i/2,o=a/(2.5+i/50),s=n.height+o+e.padding,l="M 0,"+o+" a "+a+","+o+" 0,0,0 "+i+" 0 a "+a+","+o+" 0,0,0 "+-i+" 0 l 0,"+s+" a "+a+","+o+" 0,0,0 "+i+" 0 l 0,"+-s,u=r.attr("label-offset-y",o).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-i/2+","+-(s/2+o)+")");return as(e,u),e.intersect=function(h){const d=Oo.rect(e,h),f=d.x-e.x;if(a!=0&&(Math.abs(f)e.height/2-o)){let p=o*o*(1-f*f/(a*a));p!=0&&(p=Math.sqrt(p)),p=o-p,h.y-e.y>0&&(p=-p),d.y+=p}return d},r},"cylinder"),Oli=O(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Jl(t,e,"node "+e.classes+" "+e.class,!0),a=r.insert("rect",":first-child"),o=e.positioned?e.width:n.width+e.padding,s=e.positioned?e.height:n.height+e.padding,l=e.positioned?-o/2:-n.width/2-i,u=e.positioned?-s/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",o).attr("height",s),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(Wie(a,e.props.borders,o,s),h.delete("borders")),h.forEach(d=>{ye.warn(`Unknown node property ${d}`)})}return as(e,a),e.intersect=function(h){return Oo.rect(e,h)},r},"rect"),kli=O(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Jl(t,e,"node "+e.classes,!0),a=r.insert("rect",":first-child"),o=e.positioned?e.width:n.width+e.padding,s=e.positioned?e.height:n.height+e.padding,l=e.positioned?-o/2:-n.width/2-i,u=e.positioned?-s/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",o).attr("height",s),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(Wie(a,e.props.borders,o,s),h.delete("borders")),h.forEach(d=>{ye.warn(`Unknown node property ${d}`)})}return as(e,a),e.intersect=function(h){return Oo.rect(e,h)},r},"composite"),Eli=O(async(t,e)=>{const{shapeSvg:r}=await Jl(t,e,"label",!0);ye.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 o=new Set(Object.keys(e.props));e.props.borders&&(Wie(n,e.props.borders,i,a),o.delete("borders")),o.forEach(s=>{ye.warn(`Unknown node property ${s}`)})}return as(e,n),e.intersect=function(o){return Oo.rect(e,o)},r},"labelRect");function Wie(t,e,r,n){const i=[],a=O(s=>{i.push(s,0)},"addBorder"),o=O(s=>{i.push(0,s)},"skipBorder");e.includes("t")?(ye.debug("add top border"),a(r)):o(r),e.includes("r")?(ye.debug("add right border"),a(n)):o(n),e.includes("b")?(ye.debug("add bottom border"),a(r)):o(r),e.includes("l")?(ye.debug("add left border"),a(n)):o(n),t.attr("stroke-dasharray",i.join(" "))}O(Wie,"applyNodePropertyBorders");var _li=O(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"),o=n.insert("g").attr("class","label"),s=e.labelText.flat?e.labelText.flat():e.labelText;let l="";typeof s=="object"?l=s[0]:l=s,ye.info("Label text abc79",l,s,typeof s=="object");const u=await am(o,l,e.labelStyle,!0,!0);let h={width:0,height:0};if(na(Ye())){const m=u.children[0],v=_t(u);h=m.getBoundingClientRect(),v.attr("width",h.width),v.attr("height",h.height)}ye.info("Text 2",s);const d=s.slice(1,s.length);let f=u.getBBox();const p=await am(o,d.join?d.join("
"):d,e.labelStyle,!0,!0);if(na(Ye())){const m=p.children[0],v=_t(p);h=m.getBoundingClientRect(),v.attr("width",h.width),v.attr("height",h.height)}const g=e.padding/2;return _t(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+g+5)+")"),_t(u).attr("transform","translate( "+(h.width{const{shapeSvg:r,bbox:n}=await Jl(t,e,Tf(e,void 0),!0),i=n.height+e.padding,a=n.width+i/4+e.padding,o=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 as(e,o),e.intersect=function(s){return Oo.rect(e,s)},r},"stadium"),Dli=O(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Jl(t,e,Tf(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),ye.info("Circle main"),as(e,a),e.intersect=function(o){return ye.info("Circle intersect",e,n.width/2+i,o),Oo.circle(e,n.width/2+i,o)},r},"circle"),Lli=O(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Jl(t,e,Tf(e,void 0),!0),a=5,o=r.insert("g",":first-child"),s=o.insert("circle"),l=o.insert("circle");return o.attr("class",e.class),s.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),ye.info("DoubleCircle main"),as(e,s),e.intersect=function(u){return ye.info("DoubleCircle intersect",e,n.width/2+i+a,u),Oo.circle(e,n.width/2+i+a,u)},r},"doublecircle"),Mli=O(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Jl(t,e,Tf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{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}],s=om(r,i,a,o);return s.attr("style",e.style),as(e,s),e.intersect=function(l){return Oo.polygon(e,o,l)},r},"subroutine"),Ili=O((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),as(e,n),e.intersect=function(i){return Oo.circle(e,7,i)},r},"start"),mir=O((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 o=n.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return as(e,o),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(s){return Oo.rect(e,s)},n},"forkJoin"),Pli=O((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),as(e,i),e.intersect=function(a){return Oo.circle(e,7,a)},r},"end"),Nli=O(async(t,e)=>{var C;const r=e.padding/2,n=4,i=8;let a;e.classes?a="node "+e.classes:a="node default";const o=t.insert("g").attr("class",a).attr("id",e.domId||e.id),s=o.insert("rect",":first-child"),l=o.insert("line"),u=o.insert("line");let h=0,d=n;const f=o.insert("g").attr("class","label");let p=0;const g=(C=e.classData.annotations)==null?void 0:C[0],m=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",v=await am(f,m,e.labelStyle,!0,!0);let y=v.getBBox();if(na(Ye())){const k=v.children[0],E=_t(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!==""&&(na(Ye())?b+="<"+e.classData.type+">":b+="<"+e.classData.type+">");const x=await am(f,b,e.labelStyle,!0,!0);_t(x).attr("class","classTitle");let w=x.getBBox();if(na(Ye())){const k=x.children[0],E=_t(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;na(Ye())&&(_=_.replace(//g,">"));const P=await am(f,_,E.cssStyle?E.cssStyle:e.labelStyle,!0,!0);let L=P.getBBox();if(na(Ye())){const R=P.children[0],D=_t(P);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(P)}),d+=i;const S=[];if(e.classData.methods.forEach(async k=>{const E=k.getDisplayDetails();let _=E.displayText;na(Ye())&&(_=_.replace(//g,">"));const P=await am(f,_,E.cssStyle?E.cssStyle:e.labelStyle,!0,!0);let L=P.getBBox();if(na(Ye())){const R=P.children[0],D=_t(P);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(P)}),d+=i,g){let k=(h-y.width)/2;_t(v).attr("transform","translate( "+(-1*h/2+k)+", "+-1*d/2+")"),p=y.height+n}let T=(h-w.width)/2;return _t(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=>{_t(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=>{_t(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}),s.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),as(e,s),e.intersect=function(k){return Oo.rect(e,k)},o},"class_box"),vir={rhombus:gir,composite:kli,question:gir,rect:Oli,labelRect:Eli,rectWithTitle:_li,choice:mli,circle:Dli,doublecircle:Lli,stadium:Rli,hexagon:vli,block_arrow:yli,rect_left_inv_arrow:bli,lean_right:xli,lean_left:wli,trapezoid:Ali,inv_trapezoid:Sli,rect_right_inv_arrow:Tli,cylinder:Cli,start:Ili,end:Pli,note:gli,subroutine:Mli,fork:mir,join:mir,class_box:Nli},Yie={},yir=O(async(t,e,r)=>{let n,i;if(e.link){let a;Ye().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 vir[e.shape](n,e,r)}else i=await vir[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),Yie[e.id]=n,e.haveCallback&&Yie[e.id].attr("class",Yie[e.id].attr("class")+" clickable"),n},"insertNode"),Bli=O(t=>{const e=Yie[t.id];ye.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 rMe(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,o="",s;switch(n.type){case"round":a=5,o="rect";break;case"composite":a=0,o="composite",s=0;break;case"square":o="rect";break;case"diamond":o="question";break;case"hexagon":o="hexagon";break;case"block_arrow":o="block_arrow";break;case"odd":o="rect_left_inv_arrow";break;case"lean_right":o="lean_right";break;case"lean_left":o="lean_left";break;case"trapezoid":o="trapezoid";break;case"inv_trapezoid":o="inv_trapezoid";break;case"rect_left_inv_arrow":o="rect_left_inv_arrow";break;case"circle":o="circle";break;case"ellipse":o="ellipse";break;case"stadium":o="stadium";break;case"subroutine":o="subroutine";break;case"cylinder":o="cylinder";break;case"group":o="rect";break;case"doublecircle":o="doublecircle";break;default:o="rect"}const l=bxe((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:o,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:s??((m=(g=Dr())==null?void 0:g.block)==null?void 0:m.padding)??0,widthInColumns:n.widthInColumns??1}}O(rMe,"getNodeFromBlock");async function bir(t,e,r){const n=rMe(e,r,!1);if(n.type==="group")return;const i=Dr(),a=await yir(t,n,{config:i}),o=a.node().getBBox(),s=r.getBlock(n.id);s.size={width:o.width,height:o.height,x:0,y:0,node:a},r.setBlock(s),a.remove()}O(bir,"calculateBlockSize");async function xir(t,e,r){const n=rMe(e,r,!0);if(r.getBlock(n.id).type!=="space"){const a=Dr();await yir(t,n,{config:a}),e.intersect=n==null?void 0:n.intersect,Bli(n)}}O(xir,"insertBlockPositioned");async function qie(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await qie(t,i.children,r,n)}O(qie,"performOperations");async function wir(t,e,r){await qie(t,e,r,bir)}O(wir,"calculateBlockSizes");async function Air(t,e,r){await qie(t,e,r,xir)}O(Air,"insertBlocks");async function Sir(t,e,r,n,i){const a=new hu({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const o of r)o.size&&a.setNode(o.id,{width:o.size.width,height:o.size.height,intersect:o.intersect});for(const o of e)if(o.start&&o.end){const s=n.getBlock(o.start),l=n.getBlock(o.end);if(s!=null&&s.size&&(l!=null&&l.size)){const u=s.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}-${o.id}`:o.id,p=o.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",g=o.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",m=`${p} ${g} flowchart-link LS-a1 LE-b1`;ali(t,{v:o.start,w:o.end,name:f},{...o,id:f,arrowTypeEnd:o.arrowTypeEnd,arrowTypeStart:o.arrowTypeStart,points:d,classes:m},void 0,"block",a,i),o.label&&(await tli(t,{...o,label:o.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:o.arrowTypeEnd,arrowTypeStart:o.arrowTypeStart,points:d,classes:m}),rli({...o,x:d[1].x,y:d[1].y},{originalPath:d}))}}}O(Sir,"insertEdges");var $li=O(function(t,e){return e.db.getClasses()},"getClasses"),Fli=O(async function(t,e,r,n){const{securityLevel:i,block:a}=Dr(),o=n.db;o.setDiagramId(e);let s;i==="sandbox"&&(s=_t("#i"+e));const l=_t(i==="sandbox"?s.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):_t(`[id="${e}"]`);Xsi(u,["point","circle","cross"],n.type,e);const d=o.getBlocks(),f=o.getBlocksFlat(),p=o.getEdges(),g=u.insert("g").attr("class","block");await wir(g,d,o);const m=air(o);if(await Air(g,d,o),await Sir(g,p,f,o,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;jo(u,b,x,!!w),ye.debug("Here Bounds",m,v),u.attr("viewBox",`${v.x-5} ${v.y-5} ${v.width+10} ${v.height+10}`)}},"draw"),zli={draw:Fli,getClasses:$li},Uli={parser:msi,db:Nsi,renderer:zli,styles:$si};const Vli=Object.freeze(Object.defineProperty({__proto__:null,diagram:Uli},Symbol.toStringTag,{value:"Module"}));var Tir=/[─━│┃└┗├┣]/,Cir=/[└┗├┣]/,Qli=/[─━]/,Oir=/^[\s│┃]+$/,kir=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,Eir=/^\s*%%/,Gli=" ";function _ir(t){return t.some(e=>Tir.test(e))}O(_ir,"isBoxDrawingFormat");function Rir(t){for(const e of t){const r=Cir.exec(e);if(r!=null&&r.index&&r.index>0)return r.index}return 4}O(Rir,"inferSegmentWidth");function Dir(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})}O(Dir,"remapErrorLines");function Lir(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:[]}]})),Hli=O(()=>{Cv.reset(),_a()},"clear"),Wli=O(()=>Cv.records.stack[0],"getRoot"),Yli=O(()=>Cv.records.cnt,"getCount"),qli=Jn.treeView,jli=O(()=>uo(qli,Dr().treeView),"getConfig"),Xli=O((t,e,r,n,i,a)=>{for(;t<=Cv.records.stack[Cv.records.stack.length-1].level;)Cv.records.stack.pop();const o={id:Cv.records.cnt++,level:t,name:e,nodeType:r,icon:i,cssClass:n,description:a,children:[]};Cv.records.stack[Cv.records.stack.length-1].children.push(o),Cv.records.stack.push(o)},"addNode"),Kli={clear:Hli,addNode:Xli,getRoot:Wli,getCount:Yli,getConfig:jli,getAccTitle:oo,getAccDescription:lo,getDiagramTitle:$a,setAccDescription:so,setAccTitle:Ba,setDiagramTitle:co},nMe=Kli,Zli=O(t=>{ah(t,nMe);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",o=e.classAnnotation||void 0,s=e.iconAnnotation,l=s!==void 0?s||"none":void 0,u=e.descAnnotation||void 0,h=u?li(u,Dr()):void 0;nMe.addNode(r,n,a,o,l,h)}},"populate"),Jli={parse:O(async t=>{const{text:e,lineMap:r}=Lir(t);try{const n=await Qp("treeView",e);ye.debug(n),Zli(n)}catch(n){throw r.size>0&&n instanceof Error&&(n.message=Dir(n.message,r)),n}},"parse")},gU={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function Mir(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(),o=e==null?void 0:e.extensionIcons;return(o==null?void 0:o[a])??(o==null?void 0:o[a.slice(1)])}}O(Mir,"detectIcon");function iMe(t,e){return t.includes(":")?t:t in gU.icons||!e?`${gU.prefix}:${t}`:`${e}:${t}`}O(iMe,"qualifyIcon");function aMe(t,e){if(t.icon!=="none"){if(t.icon)return iMe(t.icon,e.defaultIconPack);if(e.showIcons){if(t.nodeType==="file"){const r=Mir(t.name,e);if(r==="none")return;if(r)return iMe(r,e.defaultIconPack)}return`${gU.prefix}:${t.nodeType==="directory"?"folder":"file"}`}}}O(aMe,"getNodeIcon"),Txe([{name:gU.prefix,icons:gU}]);var oMe=14,eci=4,tci=16,Iir=O((t,e)=>`tv-icon-${t}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),rci=O(async(t,e,r,n)=>{const i=new Set,a=O(l=>{const u=aMe(l,r);u&&i.add(u),l.children.forEach(a)},"collect");if(a(e),i.size===0)return;const o=await Promise.all([...i].map(async l=>({icon:l,svg:await s1(l,{height:oMe,width:oMe})}))),s=t.append("defs");for(const{icon:l,svg:u}of o)s.append("g").attr("id",Iir(n,l)).html(u)},"injectIconDefs"),nci=O((t,e,r,n,i,a)=>{var b;const o=n.append("g");let s="treeView-node-label";r.nodeType==="directory"&&(s+=" treeView-node-dir"),r.cssClass&&(s+=` ${r.cssClass}`);const l=oMe+eci,u=aMe(r,i),h=u!==void 0;u&&o.append("use").attr("xlink:href",`#${Iir(a,u)}`).attr("x",t+i.paddingX).attr("y",e+i.paddingY).attr("class","treeView-node-icon");const d=o.append("text").text(r.name).attr("dominant-baseline","middle").attr("class",s),{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")&&o.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:o,labelRightEdge:v,centerY:e+g/2}},"positionLabel"),Pir=O((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"),ici=O((t,e,r,n)=>{var h;let i=0,a=0;const o=[],s=O((d,f,p,g)=>{const m=g*(p.rowIndent+p.paddingX),v=nci(m,i,f,d,p,n);o.push(v);const{height:y,width:b}=f.BBox;Pir(d,m-p.rowIndent,i+y/2,m,i+y/2,p.lineThickness),a=Math.max(a,m+b),i+=y},"drawNode"),l=O((d,f=0)=>{s(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;Pir(t,p+r.paddingX,g+m,p+r.paddingX,v+y/2+r.lineThickness/2,r.lineThickness)}},"processNode");l(e);const u=o.filter(d=>d.node.description);if(u.length>0){const f=Math.max(...o.map(p=>p.labelRightEdge))+tci;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 o)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"),aci=O(async(t,e,r,n)=>{ye.debug(`Rendering treeView diagram -`+t);const i=n.db,a=i.getRoot(),o=i.getConfig(),s=nu(e);await rci(s,a,o,e);const l=s.append("g");l.attr("class","tree-view");const{totalHeight:u,totalWidth:h}=ici(l,a,o,e);s.attr("viewBox",`-${o.lineThickness/2} 0 ${h} ${u}`),jo(s,u,h,o.useMaxWidth)},"draw"),oci={draw:aci},sci=oci,lci={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},cci=O(({treeView:t})=>{const{labelFontSize:e,labelColor:r,lineColor:n,iconColor:i,descriptionColor:a,highlightBg:o,highlightStroke:s}=uo(lci,t);return` + 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),o=t.width/2;let s=r.xMath.abs(n-e.x)*l){let d=r.y{ye.debug("abc88 cutPathAtIntersect",t,e);let r=[],n=t[0],i=!1;return t.forEach(a=>{if(!ali(e,a)&&!i){const o=oli(e,n,a);let s=!1;r.forEach(l=>{s=s||l.x===o.x&&l.y===o.y}),r.some(l=>l.x===o.x&&l.y===o.y)||r.push(o),i=!0}else n=a,i||r.push(a)}),r},"cutPathAtIntersect"),sli=O(function(t,e,r,n,i,a,o){let s=r.points;ye.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)&&(s=s.slice(1,r.points.length-1),s.unshift(u.intersect(s[0])),s.push(h.intersect(s[s.length-1]))),r.toCluster&&(ye.debug("to cluster abc88",n[r.toCluster]),s=cir(r.points,n[r.toCluster].node),l=!0),r.fromCluster&&(ye.debug("from cluster abc88",n[r.fromCluster]),s=cir(s.reverse(),n[r.fromCluster].node).reverse(),l=!0);const d=s.filter(w=>!Number.isNaN(w.y));let f=B7;r.curve&&(i==="graph"||i==="flowchart")&&(f=r.curve);const{x:p,y:g}=Ykt(r),m=N7().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="";(Ye().flowchart.arrowMarkerAbsolute||Ye().state.arrowMarkerAbsolute)&&(b=Cj(!0)),tli(y,r,b,o,i);let x={};return l&&(x.updatedPath=s),x.originalPath=r.points,x},"insertEdge"),lli=O(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"),cli=O((t,e,r,n)=>{const i=lli(t),a=2,o=e.height+2*r.padding,s=o/a,l=n??e.width+2*s+r.padding,u=r.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:s,y:0},{x:l/2,y:2*u},{x:l-s,y:0},{x:l,y:0},{x:l,y:-o/3},{x:l+2*u,y:-o/2},{x:l,y:-2*o/3},{x:l,y:-o},{x:l-s,y:-o},{x:l/2,y:-o-2*u},{x:s,y:-o},{x:0,y:-o},{x:0,y:-2*o/3},{x:-2*u,y:-o/2},{x:0,y:-o/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:s,y:0},{x:l-s,y:0},{x:l,y:-o/2},{x:l-s,y:-o},{x:s,y:-o},{x:0,y:-o/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:s,y:-o},{x:l-s,y:-o},{x:l,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:l,y:-s},{x:l,y:-o+s},{x:0,y:-o}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:l,y:0},{x:0,y:-s},{x:0,y:-o+s},{x:l,y:-o}]:i.has("right")&&i.has("left")?[{x:s,y:0},{x:s,y:-u},{x:l-s,y:-u},{x:l-s,y:0},{x:l,y:-o/2},{x:l-s,y:-o},{x:l-s,y:-o+u},{x:s,y:-o+u},{x:s,y:-o},{x:0,y:-o/2}]:i.has("up")&&i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:s,y:-u},{x:s,y:-o+u},{x:0,y:-o+u},{x:l/2,y:-o},{x:l,y:-o+u},{x:l-s,y:-o+u},{x:l-s,y:-u},{x:l,y:-u}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:l,y:-s},{x:0,y:-o}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:l,y:0},{x:0,y:-o}]:i.has("left")&&i.has("up")?[{x:l,y:0},{x:0,y:-s},{x:l,y:-o}]:i.has("left")&&i.has("down")?[{x:l,y:0},{x:0,y:0},{x:l,y:-o}]:i.has("right")?[{x:s,y:-u},{x:s,y:-u},{x:l-s,y:-u},{x:l-s,y:0},{x:l,y:-o/2},{x:l-s,y:-o},{x:l-s,y:-o+u},{x:s,y:-o+u},{x:s,y:-o+u}]:i.has("left")?[{x:s,y:0},{x:s,y:-u},{x:l-s,y:-u},{x:l-s,y:-o+u},{x:s,y:-o+u},{x:s,y:-o},{x:0,y:-o/2}]:i.has("up")?[{x:s,y:-u},{x:s,y:-o+u},{x:0,y:-o+u},{x:l/2,y:-o},{x:l,y:-o+u},{x:l-s,y:-o+u},{x:l-s,y:-u}]:i.has("down")?[{x:l/2,y:0},{x:0,y:-u},{x:s,y:-u},{x:s,y:-o+u},{x:l-s,y:-o+u},{x:l-s,y:-u},{x:l,y:-u}]:[{x:0,y:0}]},"getArrowPoints");function uir(t,e){return t.intersect(e)}O(uir,"intersectNode");var uli=uir;function hir(t,e,r,n){var i=t.x,a=t.y,o=i-n.x,s=a-n.y,l=Math.sqrt(e*e*s*s+r*r*o*o),u=Math.abs(e*r*o/l);n.x0}O(tMe,"sameSign");var dli=pir,fli=gir;function gir(t,e,r){var n=t.x,i=t.y,a=[],o=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;typeof e.forEach=="function"?e.forEach(function(g){o=Math.min(o,g.x),s=Math.min(s,g.y)}):(o=Math.min(o,e.x),s=Math.min(s,e.y));for(var l=n-t.width/2-o,u=i-t.height/2-s,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,o=t.width/2,s=t.height/2,l,u;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),l=a===0?0:s*i/a,u=s):(i<0&&(o=-o),l=o,u=i===0?0:o*a/i),{x:r+l,y:n+u}},"intersectRect"),gli=pli,Oo={node:uli,circle:hli,ellipse:dir,polygon:fli,rect:gli},Jl=O(async(t,e,r,n)=>{const i=Ye();let a;const o=e.useHtmlLabels||na(i);r?a=r:a="node default";const s=t.insert("g").attr("class",a).attr("id",e.domId||e.id),l=s.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=su(l,li(o1(u),i),{useHtmlLabels:o,width:e.width||i.flowchart.wrappingWidth,classes:"markdown-node-label"},i):h=await am(l,li(o1(u),i),e.labelStyle,!1,n);let d=h.getBBox();const f=e.padding/2;if(na(i)){const p=h.children[0],g=_t(h);await wxe(p,u),d=p.getBoundingClientRect(),g.attr("width",d.width),g.attr("height",d.height)}return o?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:s,bbox:d,halfPadding:f,label:l}},"labelHelper"),as=O((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function om(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+")")}O(om,"insertPolygonShape");var mli=O(async(t,e)=>{e.useHtmlLabels||na(Ye())||(e.centerLabel=!0);const{shapeSvg:n,bbox:i,halfPadding:a}=await Jl(t,e,"node "+e.classes,!0);ye.info("Classes = ",e.classes);const o=n.insert("rect",":first-child");return o.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),as(e,o),e.intersect=function(s){return Oo.rect(e,s)},n},"note"),vli=mli,mir=O(t=>t?" "+t:"","formatClass"),Tf=O((t,e)=>`${e||"node default"}${mir(t.classes)} ${mir(t.class)}`,"getClassesFromNode"),vir=O(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Jl(t,e,Tf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=i+a,s=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}];ye.info("Question main (Circle)");const l=om(r,o,o,s);return l.attr("style",e.style),as(e,l),e.intersect=function(u){return ye.warn("Intersect called"),Oo.polygon(e,s,u)},r},"question"),yli=O((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(o){return o.x+","+o.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(o){return Oo.circle(e,14,o)},r},"choice"),bli=O(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Jl(t,e,Tf(e,void 0),!0),i=4,a=e.positioned?e.height:n.height+e.padding,o=a/i,s=e.positioned?e.width:n.width+2*o+e.padding,l=[{x:o,y:0},{x:s-o,y:0},{x:s,y:-a/2},{x:s-o,y:-a},{x:o,y:-a},{x:0,y:-a/2}],u=om(r,s,a,l);return u.attr("style",e.style),as(e,u),e.intersect=function(h){return Oo.polygon(e,l,h)},r},"hexagon"),xli=O(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Jl(t,e,void 0,!0),i=2,a=n.height+2*e.padding,o=a/i,s=n.width+2*o+e.padding,u=e.positioned&&(e.widthInColumns??1)>1&&e.width>s?e.width:s,h=cli(e.directions,n,e,u),d=om(r,u,a,h);return d.attr("style",e.style),as(e,d),e.intersect=function(f){return Oo.polygon(e,h,f)},r},"block_arrow"),wli=O(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Jl(t,e,Tf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:-a/2,y:0},{x:i,y:0},{x:i,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return om(r,i,a,o).attr("style",e.style),e.width=i+a,e.height=a,e.intersect=function(l){return Oo.polygon(e,o,l)},r},"rect_left_inv_arrow"),Ali=O(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Jl(t,e,Tf(e),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:-2*a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:a/6,y:-a}],s=om(r,i,a,o);return s.attr("style",e.style),as(e,s),e.intersect=function(l){return Oo.polygon(e,o,l)},r},"lean_right"),Sli=O(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Jl(t,e,Tf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:2*a/6,y:0},{x:i+a/6,y:0},{x:i-2*a/6,y:-a},{x:-a/6,y:-a}],s=om(r,i,a,o);return s.attr("style",e.style),as(e,s),e.intersect=function(l){return Oo.polygon(e,o,l)},r},"lean_left"),Tli=O(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Jl(t,e,Tf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:-2*a/6,y:0},{x:i+2*a/6,y:0},{x:i-a/6,y:-a},{x:a/6,y:-a}],s=om(r,i,a,o);return s.attr("style",e.style),as(e,s),e.intersect=function(l){return Oo.polygon(e,o,l)},r},"trapezoid"),Cli=O(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Jl(t,e,Tf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{x:a/6,y:0},{x:i-a/6,y:0},{x:i+2*a/6,y:-a},{x:-2*a/6,y:-a}],s=om(r,i,a,o);return s.attr("style",e.style),as(e,s),e.intersect=function(l){return Oo.polygon(e,o,l)},r},"inv_trapezoid"),Oli=O(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Jl(t,e,Tf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{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}],s=om(r,i,a,o);return s.attr("style",e.style),as(e,s),e.intersect=function(l){return Oo.polygon(e,o,l)},r},"rect_right_inv_arrow"),kli=O(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Jl(t,e,Tf(e,void 0),!0),i=n.width+e.padding,a=i/2,o=a/(2.5+i/50),s=n.height+o+e.padding,l="M 0,"+o+" a "+a+","+o+" 0,0,0 "+i+" 0 a "+a+","+o+" 0,0,0 "+-i+" 0 l 0,"+s+" a "+a+","+o+" 0,0,0 "+i+" 0 l 0,"+-s,u=r.attr("label-offset-y",o).insert("path",":first-child").attr("style",e.style).attr("d",l).attr("transform","translate("+-i/2+","+-(s/2+o)+")");return as(e,u),e.intersect=function(h){const d=Oo.rect(e,h),f=d.x-e.x;if(a!=0&&(Math.abs(f)e.height/2-o)){let p=o*o*(1-f*f/(a*a));p!=0&&(p=Math.sqrt(p)),p=o-p,h.y-e.y>0&&(p=-p),d.y+=p}return d},r},"cylinder"),Eli=O(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Jl(t,e,"node "+e.classes+" "+e.class,!0),a=r.insert("rect",":first-child"),o=e.positioned?e.width:n.width+e.padding,s=e.positioned?e.height:n.height+e.padding,l=e.positioned?-o/2:-n.width/2-i,u=e.positioned?-s/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",o).attr("height",s),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(Wie(a,e.props.borders,o,s),h.delete("borders")),h.forEach(d=>{ye.warn(`Unknown node property ${d}`)})}return as(e,a),e.intersect=function(h){return Oo.rect(e,h)},r},"rect"),_li=O(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Jl(t,e,"node "+e.classes,!0),a=r.insert("rect",":first-child"),o=e.positioned?e.width:n.width+e.padding,s=e.positioned?e.height:n.height+e.padding,l=e.positioned?-o/2:-n.width/2-i,u=e.positioned?-s/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",o).attr("height",s),e.props){const h=new Set(Object.keys(e.props));e.props.borders&&(Wie(a,e.props.borders,o,s),h.delete("borders")),h.forEach(d=>{ye.warn(`Unknown node property ${d}`)})}return as(e,a),e.intersect=function(h){return Oo.rect(e,h)},r},"composite"),Rli=O(async(t,e)=>{const{shapeSvg:r}=await Jl(t,e,"label",!0);ye.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 o=new Set(Object.keys(e.props));e.props.borders&&(Wie(n,e.props.borders,i,a),o.delete("borders")),o.forEach(s=>{ye.warn(`Unknown node property ${s}`)})}return as(e,n),e.intersect=function(o){return Oo.rect(e,o)},r},"labelRect");function Wie(t,e,r,n){const i=[],a=O(s=>{i.push(s,0)},"addBorder"),o=O(s=>{i.push(0,s)},"skipBorder");e.includes("t")?(ye.debug("add top border"),a(r)):o(r),e.includes("r")?(ye.debug("add right border"),a(n)):o(n),e.includes("b")?(ye.debug("add bottom border"),a(r)):o(r),e.includes("l")?(ye.debug("add left border"),a(n)):o(n),t.attr("stroke-dasharray",i.join(" "))}O(Wie,"applyNodePropertyBorders");var Dli=O(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"),o=n.insert("g").attr("class","label"),s=e.labelText.flat?e.labelText.flat():e.labelText;let l="";typeof s=="object"?l=s[0]:l=s,ye.info("Label text abc79",l,s,typeof s=="object");const u=await am(o,l,e.labelStyle,!0,!0);let h={width:0,height:0};if(na(Ye())){const m=u.children[0],v=_t(u);h=m.getBoundingClientRect(),v.attr("width",h.width),v.attr("height",h.height)}ye.info("Text 2",s);const d=s.slice(1,s.length);let f=u.getBBox();const p=await am(o,d.join?d.join("
"):d,e.labelStyle,!0,!0);if(na(Ye())){const m=p.children[0],v=_t(p);h=m.getBoundingClientRect(),v.attr("width",h.width),v.attr("height",h.height)}const g=e.padding/2;return _t(p).attr("transform","translate( "+(h.width>f.width?0:(f.width-h.width)/2)+", "+(f.height+g+5)+")"),_t(u).attr("transform","translate( "+(h.width{const{shapeSvg:r,bbox:n}=await Jl(t,e,Tf(e,void 0),!0),i=n.height+e.padding,a=n.width+i/4+e.padding,o=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 as(e,o),e.intersect=function(s){return Oo.rect(e,s)},r},"stadium"),Mli=O(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Jl(t,e,Tf(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),ye.info("Circle main"),as(e,a),e.intersect=function(o){return ye.info("Circle intersect",e,n.width/2+i,o),Oo.circle(e,n.width/2+i,o)},r},"circle"),Ili=O(async(t,e)=>{const{shapeSvg:r,bbox:n,halfPadding:i}=await Jl(t,e,Tf(e,void 0),!0),a=5,o=r.insert("g",":first-child"),s=o.insert("circle"),l=o.insert("circle");return o.attr("class",e.class),s.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),ye.info("DoubleCircle main"),as(e,s),e.intersect=function(u){return ye.info("DoubleCircle intersect",e,n.width/2+i+a,u),Oo.circle(e,n.width/2+i+a,u)},r},"doublecircle"),Pli=O(async(t,e)=>{const{shapeSvg:r,bbox:n}=await Jl(t,e,Tf(e,void 0),!0),i=n.width+e.padding,a=n.height+e.padding,o=[{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}],s=om(r,i,a,o);return s.attr("style",e.style),as(e,s),e.intersect=function(l){return Oo.polygon(e,o,l)},r},"subroutine"),Nli=O((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),as(e,n),e.intersect=function(i){return Oo.circle(e,7,i)},r},"start"),yir=O((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 o=n.append("rect").attr("x",-1*i/2).attr("y",-1*a/2).attr("width",i).attr("height",a).attr("class","fork-join");return as(e,o),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(s){return Oo.rect(e,s)},n},"forkJoin"),Bli=O((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),as(e,i),e.intersect=function(a){return Oo.circle(e,7,a)},r},"end"),$li=O(async(t,e)=>{var C;const r=e.padding/2,n=4,i=8;let a;e.classes?a="node "+e.classes:a="node default";const o=t.insert("g").attr("class",a).attr("id",e.domId||e.id),s=o.insert("rect",":first-child"),l=o.insert("line"),u=o.insert("line");let h=0,d=n;const f=o.insert("g").attr("class","label");let p=0;const g=(C=e.classData.annotations)==null?void 0:C[0],m=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",v=await am(f,m,e.labelStyle,!0,!0);let y=v.getBBox();if(na(Ye())){const k=v.children[0],E=_t(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!==""&&(na(Ye())?b+="<"+e.classData.type+">":b+="<"+e.classData.type+">");const x=await am(f,b,e.labelStyle,!0,!0);_t(x).attr("class","classTitle");let w=x.getBBox();if(na(Ye())){const k=x.children[0],E=_t(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;na(Ye())&&(_=_.replace(//g,">"));const P=await am(f,_,E.cssStyle?E.cssStyle:e.labelStyle,!0,!0);let L=P.getBBox();if(na(Ye())){const R=P.children[0],D=_t(P);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(P)}),d+=i;const S=[];if(e.classData.methods.forEach(async k=>{const E=k.getDisplayDetails();let _=E.displayText;na(Ye())&&(_=_.replace(//g,">"));const P=await am(f,_,E.cssStyle?E.cssStyle:e.labelStyle,!0,!0);let L=P.getBBox();if(na(Ye())){const R=P.children[0],D=_t(P);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(P)}),d+=i,g){let k=(h-y.width)/2;_t(v).attr("transform","translate( "+(-1*h/2+k)+", "+-1*d/2+")"),p=y.height+n}let T=(h-w.width)/2;return _t(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=>{_t(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=>{_t(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}),s.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),as(e,s),e.intersect=function(k){return Oo.rect(e,k)},o},"class_box"),bir={rhombus:vir,composite:_li,question:vir,rect:Eli,labelRect:Rli,rectWithTitle:Dli,choice:yli,circle:Mli,doublecircle:Ili,stadium:Lli,hexagon:bli,block_arrow:xli,rect_left_inv_arrow:wli,lean_right:Ali,lean_left:Sli,trapezoid:Tli,inv_trapezoid:Cli,rect_right_inv_arrow:Oli,cylinder:kli,start:Nli,end:Bli,note:vli,subroutine:Pli,fork:yir,join:yir,class_box:$li},Yie={},xir=O(async(t,e,r)=>{let n,i;if(e.link){let a;Ye().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 bir[e.shape](n,e,r)}else i=await bir[e.shape](t,e,r),n=i;return e.tooltip&&i.attr("title",e.tooltip),e.class&&i.attr("class","node default "+e.class),Yie[e.id]=n,e.haveCallback&&Yie[e.id].attr("class",Yie[e.id].attr("class")+" clickable"),n},"insertNode"),Fli=O(t=>{const e=Yie[t.id];ye.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 rMe(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,o="",s;switch(n.type){case"round":a=5,o="rect";break;case"composite":a=0,o="composite",s=0;break;case"square":o="rect";break;case"diamond":o="question";break;case"hexagon":o="hexagon";break;case"block_arrow":o="block_arrow";break;case"odd":o="rect_left_inv_arrow";break;case"lean_right":o="lean_right";break;case"lean_left":o="lean_left";break;case"trapezoid":o="trapezoid";break;case"inv_trapezoid":o="inv_trapezoid";break;case"rect_left_inv_arrow":o="rect_left_inv_arrow";break;case"circle":o="circle";break;case"ellipse":o="ellipse";break;case"stadium":o="stadium";break;case"subroutine":o="subroutine";break;case"cylinder":o="cylinder";break;case"group":o="rect";break;case"doublecircle":o="doublecircle";break;default:o="rect"}const l=bxe((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:o,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:s??((m=(g=Dr())==null?void 0:g.block)==null?void 0:m.padding)??0,widthInColumns:n.widthInColumns??1}}O(rMe,"getNodeFromBlock");async function wir(t,e,r){const n=rMe(e,r,!1);if(n.type==="group")return;const i=Dr(),a=await xir(t,n,{config:i}),o=a.node().getBBox(),s=r.getBlock(n.id);s.size={width:o.width,height:o.height,x:0,y:0,node:a},r.setBlock(s),a.remove()}O(wir,"calculateBlockSize");async function Air(t,e,r){const n=rMe(e,r,!0);if(r.getBlock(n.id).type!=="space"){const a=Dr();await xir(t,n,{config:a}),e.intersect=n==null?void 0:n.intersect,Fli(n)}}O(Air,"insertBlockPositioned");async function qie(t,e,r,n){for(const i of e)await n(t,i,r),i.children&&await qie(t,i.children,r,n)}O(qie,"performOperations");async function Sir(t,e,r){await qie(t,e,r,wir)}O(Sir,"calculateBlockSizes");async function Tir(t,e,r){await qie(t,e,r,Air)}O(Tir,"insertBlocks");async function Cir(t,e,r,n,i){const a=new hu({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const o of r)o.size&&a.setNode(o.id,{width:o.size.width,height:o.size.height,intersect:o.intersect});for(const o of e)if(o.start&&o.end){const s=n.getBlock(o.start),l=n.getBlock(o.end);if(s!=null&&s.size&&(l!=null&&l.size)){const u=s.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}-${o.id}`:o.id,p=o.thickness==="thick"?"edge-thickness-thick":"edge-thickness-normal",g=o.pattern==="dotted"?"edge-pattern-dotted":"edge-pattern-solid",m=`${p} ${g} flowchart-link LS-a1 LE-b1`;sli(t,{v:o.start,w:o.end,name:f},{...o,id:f,arrowTypeEnd:o.arrowTypeEnd,arrowTypeStart:o.arrowTypeStart,points:d,classes:m},void 0,"block",a,i),o.label&&(await nli(t,{...o,label:o.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:o.arrowTypeEnd,arrowTypeStart:o.arrowTypeStart,points:d,classes:m}),ili({...o,x:d[1].x,y:d[1].y},{originalPath:d}))}}}O(Cir,"insertEdges");var zli=O(function(t,e){return e.db.getClasses()},"getClasses"),Uli=O(async function(t,e,r,n){const{securityLevel:i,block:a}=Dr(),o=n.db;o.setDiagramId(e);let s;i==="sandbox"&&(s=_t("#i"+e));const l=_t(i==="sandbox"?s.nodes()[0].contentDocument.body:"body"),u=i==="sandbox"?l.select(`[id="${e}"]`):_t(`[id="${e}"]`);Zsi(u,["point","circle","cross"],n.type,e);const d=o.getBlocks(),f=o.getBlocksFlat(),p=o.getEdges(),g=u.insert("g").attr("class","block");await Sir(g,d,o);const m=sir(o);if(await Tir(g,d,o),await Cir(g,p,f,o,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;jo(u,b,x,!!w),ye.debug("Here Bounds",m,v),u.attr("viewBox",`${v.x-5} ${v.y-5} ${v.width+10} ${v.height+10}`)}},"draw"),Vli={draw:Uli,getClasses:zli},Qli={parser:ysi,db:$si,renderer:Vli,styles:zsi};const Gli=Object.freeze(Object.defineProperty({__proto__:null,diagram:Qli},Symbol.toStringTag,{value:"Module"}));var Oir=/[─━│┃└┗├┣]/,kir=/[└┗├┣]/,Hli=/[─━]/,Eir=/^[\s│┃]+$/,_ir=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,Rir=/^\s*%%/,Wli=" ";function Dir(t){return t.some(e=>Oir.test(e))}O(Dir,"isBoxDrawingFormat");function Lir(t){for(const e of t){const r=kir.exec(e);if(r!=null&&r.index&&r.index>0)return r.index}return 4}O(Lir,"inferSegmentWidth");function Mir(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})}O(Mir,"remapErrorLines");function Iir(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:[]}]})),Yli=O(()=>{Cv.reset(),_a()},"clear"),qli=O(()=>Cv.records.stack[0],"getRoot"),jli=O(()=>Cv.records.cnt,"getCount"),Xli=Jn.treeView,Kli=O(()=>uo(Xli,Dr().treeView),"getConfig"),Zli=O((t,e,r,n,i,a)=>{for(;t<=Cv.records.stack[Cv.records.stack.length-1].level;)Cv.records.stack.pop();const o={id:Cv.records.cnt++,level:t,name:e,nodeType:r,icon:i,cssClass:n,description:a,children:[]};Cv.records.stack[Cv.records.stack.length-1].children.push(o),Cv.records.stack.push(o)},"addNode"),Jli={clear:Yli,addNode:Zli,getRoot:qli,getCount:jli,getConfig:Kli,getAccTitle:oo,getAccDescription:lo,getDiagramTitle:$a,setAccDescription:so,setAccTitle:Ba,setDiagramTitle:co},nMe=Jli,eci=O(t=>{ah(t,nMe);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",o=e.classAnnotation||void 0,s=e.iconAnnotation,l=s!==void 0?s||"none":void 0,u=e.descAnnotation||void 0,h=u?li(u,Dr()):void 0;nMe.addNode(r,n,a,o,l,h)}},"populate"),tci={parse:O(async t=>{const{text:e,lineMap:r}=Iir(t);try{const n=await Qp("treeView",e);ye.debug(n),eci(n)}catch(n){throw r.size>0&&n instanceof Error&&(n.message=Mir(n.message,r)),n}},"parse")},gU={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function Pir(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(),o=e==null?void 0:e.extensionIcons;return(o==null?void 0:o[a])??(o==null?void 0:o[a.slice(1)])}}O(Pir,"detectIcon");function iMe(t,e){return t.includes(":")?t:t in gU.icons||!e?`${gU.prefix}:${t}`:`${e}:${t}`}O(iMe,"qualifyIcon");function aMe(t,e){if(t.icon!=="none"){if(t.icon)return iMe(t.icon,e.defaultIconPack);if(e.showIcons){if(t.nodeType==="file"){const r=Pir(t.name,e);if(r==="none")return;if(r)return iMe(r,e.defaultIconPack)}return`${gU.prefix}:${t.nodeType==="directory"?"folder":"file"}`}}}O(aMe,"getNodeIcon"),Txe([{name:gU.prefix,icons:gU}]);var oMe=14,rci=4,nci=16,Nir=O((t,e)=>`tv-icon-${t}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),ici=O(async(t,e,r,n)=>{const i=new Set,a=O(l=>{const u=aMe(l,r);u&&i.add(u),l.children.forEach(a)},"collect");if(a(e),i.size===0)return;const o=await Promise.all([...i].map(async l=>({icon:l,svg:await s1(l,{height:oMe,width:oMe})}))),s=t.append("defs");for(const{icon:l,svg:u}of o)s.append("g").attr("id",Nir(n,l)).html(u)},"injectIconDefs"),aci=O((t,e,r,n,i,a)=>{var b;const o=n.append("g");let s="treeView-node-label";r.nodeType==="directory"&&(s+=" treeView-node-dir"),r.cssClass&&(s+=` ${r.cssClass}`);const l=oMe+rci,u=aMe(r,i),h=u!==void 0;u&&o.append("use").attr("xlink:href",`#${Nir(a,u)}`).attr("x",t+i.paddingX).attr("y",e+i.paddingY).attr("class","treeView-node-icon");const d=o.append("text").text(r.name).attr("dominant-baseline","middle").attr("class",s),{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")&&o.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:o,labelRightEdge:v,centerY:e+g/2}},"positionLabel"),Bir=O((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"),oci=O((t,e,r,n)=>{var h;let i=0,a=0;const o=[],s=O((d,f,p,g)=>{const m=g*(p.rowIndent+p.paddingX),v=aci(m,i,f,d,p,n);o.push(v);const{height:y,width:b}=f.BBox;Bir(d,m-p.rowIndent,i+y/2,m,i+y/2,p.lineThickness),a=Math.max(a,m+b),i+=y},"drawNode"),l=O((d,f=0)=>{s(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;Bir(t,p+r.paddingX,g+m,p+r.paddingX,v+y/2+r.lineThickness/2,r.lineThickness)}},"processNode");l(e);const u=o.filter(d=>d.node.description);if(u.length>0){const f=Math.max(...o.map(p=>p.labelRightEdge))+nci;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 o)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"),sci=O(async(t,e,r,n)=>{ye.debug(`Rendering treeView diagram +`+t);const i=n.db,a=i.getRoot(),o=i.getConfig(),s=nu(e);await ici(s,a,o,e);const l=s.append("g");l.attr("class","tree-view");const{totalHeight:u,totalWidth:h}=oci(l,a,o,e);s.attr("viewBox",`-${o.lineThickness/2} 0 ${h} ${u}`),jo(s,u,h,o.useMaxWidth)},"draw"),lci={draw:sci},cci=lci,uci={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},hci=O(({treeView:t})=>{const{labelFontSize:e,labelColor:r,lineColor:n,iconColor:i,descriptionColor:a,highlightBg:o,highlightStroke:s}=uo(uci,t);return` .treeView-node-label { font-size: ${e}; fill: ${r}; @@ -3592,7 +3592,7 @@ Expecting `+te.join(", ")+", got '"+(this.terminals_[Q]||Q)+"'":pe="Parse error stroke: ${s}; stroke-width: 1; } - `},"styles"),uci=cci,hci={db:nMe,renderer:sci,parser:Jli,styles:uci};const dci=Object.freeze(Object.defineProperty({__proto__:null,diagram:hci},Symbol.toStringTag,{value:"Module"}));var Nir={exports:{}},sMe={exports:{}},lMe={exports:{}},Bir;function fci(){return Bir||(Bir=1,function(t,e){(function(n,i){t.exports=i()})(Ti,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=r,i.c=n,i.i=function(a){return a},i.d=function(a,o,s){i.o(a,o)||Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:s})},i.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(o,"a",o),o},i.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},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),o=i(8),s=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=o.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=s.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=s.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=s.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=s.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l},function(r,n,i){function a(o){this.vGraphObject=o}r.exports=a},function(r,n,i){var a=i(2),o=i(10),s=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=o.MIN_VALUE,this.inclusionTreeDepth=o.MAX_VALUE,this.vGraphObject=v,this.edges=[],this.graphManager=p,m!=null&&g!=null?this.rect=new s(g.x,g.y,m.width,m.height):this.rect=new s}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==o.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 o(){}for(var s in a)o[s]=a[s];o.MAX_ITERATIONS=2500,o.DEFAULT_EDGE_LENGTH=50,o.DEFAULT_SPRING_STRENGTH=.45,o.DEFAULT_REPULSION_STRENGTH=4500,o.DEFAULT_GRAVITY_STRENGTH=.4,o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,o.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,o.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,o.COOLING_ADAPTATION_FACTOR=.33,o.ADAPTATION_LOWER_NODE_LIMIT=1e3,o.ADAPTATION_UPPER_NODE_LIMIT=5e3,o.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,o.MAX_NODE_DISPLACEMENT=o.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,o.MIN_REPULSION_DIST=o.DEFAULT_EDGE_LENGTH/10,o.CONVERGENCE_CHECK_PERIOD=100,o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,o.MIN_EDGE_LENGTH=1,o.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=o},function(r,n,i){function a(o,s){o==null&&s==null?(this.x=0,this.y=0):(this.x=o,this.y=s)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(o){this.x=o},a.prototype.setY=function(o){this.y=o},a.prototype.getDifference=function(o){return new DimensionD(this.x-o.x,this.y-o.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(o){return this.x+=o.width,this.y+=o.height,this},r.exports=a},function(r,n,i){var a=i(2),o=i(10),s=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=o.MIN_VALUE,this.margin=s.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&&C>-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(C,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=o.MAX_VALUE,y=o.MAX_VALUE,b,x,w,A=this.getNodes(),S=A.length,T=0;Tb&&(v=b),y>x&&(y=x)}return v==o.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=o.MAX_VALUE,b=-o.MAX_VALUE,x=o.MAX_VALUE,w=-o.MAX_VALUE,A,S,T,C,k,E=this.nodes,_=E.length,P=0;P<_;P++){var L=E[P];v&&L.child!=null&&L.updateBounds(),A=L.getLeft(),S=L.getRight(),T=L.getTop(),C=L.getBottom(),y>A&&(y=A),bT&&(x=T),wA&&(y=A),bT&&(x=T),w=this.nodes.length){var _=0;b.forEach(function(P){P.owner==v&&_++}),_==this.nodes.length&&(this.isConnected=!0)}},r.exports=g},function(r,n,i){var a,o=i(1);function s(l){a=i(6),this.layout=l,this.graphs=[],this.edges=[]}s.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},s.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}},s.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()-s.getX(),s.getRight()-l.getRight()):l.getX()<=s.getX()&&l.getRight()>=s.getRight()&&(u[0]+=Math.min(s.getX()-l.getX(),l.getRight()-s.getRight())),s.getY()<=l.getY()&&s.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-s.getY(),s.getBottom()-l.getBottom()):l.getY()<=s.getY()&&l.getBottom()>=s.getBottom()&&(u[1]+=Math.min(s.getY()-l.getY(),l.getBottom()-s.getBottom()));var f=Math.abs((l.getCenterY()-s.getCenterY())/(l.getCenterX()-s.getCenterX()));l.getCenterY()===s.getCenterY()&&l.getCenterX()===s.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]=C,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)),-I===N?f>h?(u[2]=k,u[3]=E,D=!0):(u[2]=C,u[3]=T,D=!0):I===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(I,N,2)):(F=this.getCardinalDirection(-M,N,3),B=this.getCardinalDirection(-I,N,1)):d>p?(F=this.getCardinalDirection(-M,N,1),B=this.getCardinalDirection(-I,N,3)):(F=this.getCardinalDirection(M,N,2),B=this.getCardinalDirection(I,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+P*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+-P*N,u[2]=U,u[3]=Q;break}}return!1},o.getCardinalDirection=function(s,l,u){return s>l?u:1+u%4},o.getIntersection=function(s,l,u,h){if(h==null)return this.getIntersection2(s,l,u);var d=s.x,f=s.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,C=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,C=m-y,E=y*v-m*b,_=A*C-S*T,_===0?null:(x=(T*E-C*k)/_,w=(S*k-A*E)/_,new a(x,w))},o.angleOfVector=function(s,l,u,h){var d=void 0;return s!==u?(d=Math.atan((h-l)/(u-s)),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},o.HALF_PI=.5*Math.PI,o.ONE_AND_HALF_PI=1.5*Math.PI,o.TWO_PI=2*Math.PI,o.THREE_PI=3*Math.PI,r.exports=o},function(r,n,i){function a(){}a.sign=function(o){return o>0?1:o<0?-1:0},a.floor=function(o){return o<0?Math.ceil(o):Math.floor(o)},a.ceil=function(o){return o<0?Math.floor(o):Math.ceil(o)},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(s);return s==null||l!="object"&&l!="function"},r.exports=o},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 C=A[0];A.splice(0,1),w.add(C);for(var k=C.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&&C.push(R),b.set(R,M)}})}y=y.concat(C),(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 o(s,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}o.prototype.getWorldOrgX=function(){return this.lworldOrgX},o.prototype.setWorldOrgX=function(s){this.lworldOrgX=s},o.prototype.getWorldOrgY=function(){return this.lworldOrgY},o.prototype.setWorldOrgY=function(s){this.lworldOrgY=s},o.prototype.getWorldExtX=function(){return this.lworldExtX},o.prototype.setWorldExtX=function(s){this.lworldExtX=s},o.prototype.getWorldExtY=function(){return this.lworldExtY},o.prototype.setWorldExtY=function(s){this.lworldExtY=s},o.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},o.prototype.setDeviceOrgX=function(s){this.ldeviceOrgX=s},o.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},o.prototype.setDeviceOrgY=function(s){this.ldeviceOrgY=s},o.prototype.getDeviceExtX=function(){return this.ldeviceExtX},o.prototype.setDeviceExtX=function(s){this.ldeviceExtX=s},o.prototype.getDeviceExtY=function(){return this.ldeviceExtY},o.prototype.setDeviceExtY=function(s){this.ldeviceExtY=s},o.prototype.transformX=function(s){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(s-this.lworldOrgX)*this.ldeviceExtX/u),l},o.prototype.transformY=function(s){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(s-this.lworldOrgY)*this.ldeviceExtY/u),l},o.prototype.inverseTransformX=function(s){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(s-this.ldeviceOrgX)*this.lworldExtX/u),l},o.prototype.inverseTransformY=function(s){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(s-this.ldeviceOrgY)*this.lworldExtY/u),l},o.prototype.inverseTransformPoint=function(s){var l=new a(this.inverseTransformX(s.x),this.inverseTransformY(s.y));return l},r.exports=o},function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);gs.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*s.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-s.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>s.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(s.COOLING_ADAPTATION_FACTOR,1-(p-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*(1-s.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*s.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%s.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(o){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=o.length,this.n=o[0].length;var s=Math.min(this.m,this.n);this.s=function(It){for(var gt=[];It-- >0;)gt.push(0);return gt}(Math.min(this.m+1,this.n)),this.U=function(It){var gt=function Te(Bt){if(Bt.length==0)return 0;for(var Et=[],At=0;At0;)gt.push(0);return gt}(this.n),u=function(It){for(var gt=[];It-- >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;I--)if(this.s[I]!==0){for(var N=I+1;N=0;G--){if(function(It,gt){return It&>}(G0;){var ie=void 0,Ce=void 0;for(ie=R-2;ie>=-1&&ie!==-1;ie--)if(Math.abs(l[ie])<=pe+te*(Math.abs(this.s[ie])+Math.abs(this.s[ie+1]))){l[ie]=0;break}if(ie===R-2)Ce=4;else{var ke=void 0;for(ke=R-1;ke>=ie&&ke!==ie;ke--){var Ee=(ke!==R?Math.abs(l[ke]):0)+(ke!==ie+1?Math.abs(l[ke-1]):0);if(Math.abs(this.s[ke])<=pe+te*Ee){this.s[ke]=0;break}}ke===ie?Ce=3:ke===R-1?Ce=1:(Ce=2,ie=ke)}switch(ie++,Ce){case 1:{var ue=l[R-2];l[R-2]=0;for(var de=R-2;de>=ie;de--){var xe=a.hypot(this.s[de],ue),ge=this.s[de]/xe,ze=ue/xe;this.s[de]=xe,de!==ie&&(ue=-ze*l[de-1],l[de-1]=ge*l[de-1]);for(var we=0;we=this.s[ie+1]);){var St=this.s[ie];if(this.s[ie]=this.s[ie+1],this.s[ie+1]=St,ieMath.abs(s)?(l=s/o,l=Math.abs(o)*Math.sqrt(1+l*l)):s!=0?(l=o/s,l=Math.abs(s)*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;o(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===s&&h.callback===l&&this.listeners.splice(u,1)}},o.emit=function(s,l){for(var u=0;u{var n={45:(s,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),s.exports=h},806:(s,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,s.exports=d},767:(s,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];s.exports=d},880:(s,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];s.exports=d},578:(s,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];s.exports=d},765:(s,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,C=u(551).IGeometry,k=u(551).LGraph,E=u(551).Transform,_=u(551).LinkedList;function P(){h.call(this),this.toBeTiled={},this.constraints={}}P.prototype=Object.create(h.prototype);for(var L in h)P[L]=h[L];P.prototype.newGraphManager=function(){var R=new d(this);return this.graphManager=R,R},P.prototype.newGraph=function(R){return new f(null,this.graphManager,R)},P.prototype.newNode=function(R){return new p(this.graphManager,R)},P.prototype.newEdge=function(R){return new g(null,null,R)},P.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)},P.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},P.prototype.layout=function(){var R=b.DEFAULT_CREATE_BENDS_AS_NEEDED;return R&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},P.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(I){return D.has(I)});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},P.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,I=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(M,I),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},P.prototype.getPositionsData=function(){for(var R=this.graphManager.getAllNodes(),D={},M=0;M0&&this.updateDisplacements();for(var M=0;M0&&(I.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(X){R.fixedNodesOnHorizontal.add(X),R.fixedNodesOnVertical.add(X)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var z=this.constraints.alignmentConstraint.vertical,M=0;M=2*X.length/3;te--)J=Math.floor(Math.random()*(te+1)),ee=X[te],X[te]=X[J],X[J]=ee;return X},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(X){if(X.left){var J=B.has(X.left)?B.get(X.left):X.left,ee=B.has(X.right)?B.get(X.right):X.right;R.nodesInRelativeHorizontal.includes(J)||(R.nodesInRelativeHorizontal.push(J),R.nodeToRelativeConstraintMapHorizontal.set(J,[]),R.dummyToNodeForVerticalAlignment.has(J)?R.nodeToTempPositionMapHorizontal.set(J,R.idToNodeMap.get(R.dummyToNodeForVerticalAlignment.get(J)[0]).getCenterX()):R.nodeToTempPositionMapHorizontal.set(J,R.idToNodeMap.get(J).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(J).push({right:ee,gap:X.gap}),R.nodeToRelativeConstraintMapHorizontal.get(ee).push({left:J,gap:X.gap})}else{var te=V.has(X.top)?V.get(X.top):X.top,pe=V.has(X.bottom)?V.get(X.bottom):X.bottom;R.nodesInRelativeVertical.includes(te)||(R.nodesInRelativeVertical.push(te),R.nodeToRelativeConstraintMapVertical.set(te,[]),R.dummyToNodeForHorizontalAlignment.has(te)?R.nodeToTempPositionMapVertical.set(te,R.idToNodeMap.get(R.dummyToNodeForHorizontalAlignment.get(te)[0]).getCenterY()):R.nodeToTempPositionMapVertical.set(te,R.idToNodeMap.get(te).getCenterY())),R.nodesInRelativeVertical.includes(pe)||(R.nodesInRelativeVertical.push(pe),R.nodeToRelativeConstraintMapVertical.set(pe,[]),R.dummyToNodeForHorizontalAlignment.has(pe)?R.nodeToTempPositionMapVertical.set(pe,R.idToNodeMap.get(R.dummyToNodeForHorizontalAlignment.get(pe)[0]).getCenterY()):R.nodeToTempPositionMapVertical.set(pe,R.idToNodeMap.get(pe).getCenterY())),R.nodeToRelativeConstraintMapVertical.get(te).push({bottom:pe,gap:X.gap}),R.nodeToRelativeConstraintMapVertical.get(pe).push({top:te,gap:X.gap})}});else{var Q=new Map,G=new Map;this.constraints.relativePlacementConstraint.forEach(function(X){if(X.left){var J=B.has(X.left)?B.get(X.left):X.left,ee=B.has(X.right)?B.get(X.right):X.right;Q.has(J)?Q.get(J).push(ee):Q.set(J,[ee]),Q.has(ee)?Q.get(ee).push(J):Q.set(ee,[J])}else{var te=V.has(X.top)?V.get(X.top):X.top,pe=V.has(X.bottom)?V.get(X.bottom):X.bottom;G.has(te)?G.get(te).push(pe):G.set(te,[pe]),G.has(pe)?G.get(pe).push(te):G.set(pe,[te])}});var q=function(J,ee){var te=[],pe=[],ie=new _,Ce=new Set,ke=0;return J.forEach(function(Ee,ue){if(!Ce.has(ue)){te[ke]=[],pe[ke]=!1;var de=ue;for(ie.push(de),Ce.add(de),te[ke].push(de);ie.length!=0;){de=ie.shift(),ee.has(de)&&(pe[ke]=!0);var xe=J.get(de);xe.forEach(function(ge){Ce.has(ge)||(ie.push(ge),Ce.add(ge),te[ke].push(ge))})}ke++}}),{components:te,isFixed:pe}},Y=q(Q,R.fixedNodesOnHorizontal);this.componentsOnHorizontal=Y.components,this.fixedComponentsOnHorizontal=Y.isFixed;var ne=q(G,R.fixedNodesOnVertical);this.componentsOnVertical=ne.components,this.fixedComponentsOnVertical=ne.isFixed}}},P.prototype.updateDisplacements=function(){var R=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(ne){var X=R.idToNodeMap.get(ne.nodeId);X.displacementX=0,X.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;VI&&(I=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))},P.radialLayout=function(R,D,M){var I=Math.max(this.maxDiagonalInTree(R),m.DEFAULT_RADIAL_SEPARATION);P.branchRadialLayout(D,null,0,359,0,I);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=J[0];J.splice(0,1);var te=G.indexOf(ee);te>=0&&G.splice(te,1),ne--,q--}D!=null?X=(G.indexOf(J[0])+1)%ne:X=0;for(var pe=Math.abs(I-M)/q,ie=X;Y!=q;ie=++ie%ne){var Ce=G[ie].getOtherEnd(R);if(Ce!=D){var ke=(M+Y*pe)%360,Ee=(ke+pe)%360;P.branchRadialLayout(Ce,R,ke,Ee,N+F,F),Y++}}},P.maxDiagonalInTree=function(R){for(var D=T.MIN_VALUE,M=0;MD&&(D=N)}return D},P.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},P.prototype.groupZeroDegreeMembers=function(){var R=this,D={};this.memberGroups={},this.idToDummyNode={};for(var M=[],I=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 q=R.getGraphManager().add(R.newGraph(),G),Y=Q.getChild();Y.add(G);for(var ne=0;neN?(I.rect.x-=(I.labelWidth-N)/2,I.setWidth(I.labelWidth),I.labelMarginLeft=(I.labelWidth-N)/2):I.labelPosHorizontal=="right"&&I.setWidth(N+I.labelWidth)),I.labelHeight&&(I.labelPosVertical=="top"?(I.rect.y-=I.labelHeight,I.setHeight(F+I.labelHeight),I.labelMarginTop=I.labelHeight):I.labelPosVertical=="center"&&I.labelHeight>F?(I.rect.y-=(I.labelHeight-F)/2,I.setHeight(I.labelHeight),I.labelMarginTop=(I.labelHeight-F)/2):I.labelPosVertical=="bottom"&&I.setHeight(F+I.labelHeight))}})},P.prototype.repopulateCompounds=function(){for(var R=this.compoundOrder.length-1;R>=0;R--){var D=this.compoundOrder[R],M=D.id,I=D.paddingLeft,N=D.paddingTop,F=D.labelMarginLeft,B=D.labelMarginTop;this.adjustLocations(this.tiledMemberPack[M],D.rect.x,D.rect.y,I,N,F,B)}},P.prototype.repopulateZeroDegreeMembers=function(){var R=this,D=this.tiledZeroDegreePack;Object.keys(D).forEach(function(M){var I=R.idToDummyNode[M],N=I.paddingLeft,F=I.paddingTop,B=I.labelMarginLeft,V=I.labelMarginTop;R.adjustLocations(D[M],I.rect.x,I.rect.y,N,F,B,V)})},P.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 I=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},P.prototype.getNodeDegree=function(R){R.id;for(var D=R.getEdges(),M=0,I=0;IQ&&(Q=q.rect.height)}M+=Q+R.verticalPadding}},P.prototype.tileCompoundMembers=function(R,D){var M=this;this.tiledMemberPack=[],Object.keys(R).forEach(function(I){var N=D[I];if(M.tiledMemberPack[I]=M.tileNodes(R[I],N.paddingLeft+N.paddingRight),N.rect.width=M.tiledMemberPack[I].width,N.rect.height=M.tiledMemberPack[I].height,N.setCenter(M.tiledMemberPack[I].centerX,M.tiledMemberPack[I].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))}})},P.prototype.tileNodes=function(R,D){var M=this.tileNodesByFavoringDim(R,D,!0),I=this.tileNodesByFavoringDim(R,D,!1),N=this.getOrgRatio(M),F=this.getOrgRatio(I),B;return FV&&(V=ne.getWidth())});var z=F/N,U=B/N,Q=Math.pow(M-I,2)+4*(z+I)*(U+M)*N,G=(I-M+Math.sqrt(Q))/(2*(z+I)),q;D?(q=Math.ceil(G),q==G&&q++):q=Math.floor(G);var Y=q*(z+I)-I;return V>Y&&(Y=V),Y+=I*2,Y},P.prototype.tileNodesByFavoringDim=function(R,D,M){var I=m.TILING_PADDING_VERTICAL,N=m.TILING_PADDING_HORIZONTAL,F=m.TILING_COMPARE_BY,B={rows:[],rowWidth:[],rowHeight:[],width:0,height:D,verticalPadding:I,horizontalPadding:N,centerX:0,centerY:0};F&&(B.idealRowWidth=this.calcIdealRowWidth(R,M));var V=function(X){return X.rect.width*X.rect.height},z=function(X,J){return V(J)-V(X)};R.sort(function(ne,X){var J=z;return B.idealRowWidth?(J=F,J(ne.id,X.id)):J(ne,X)});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)},P.prototype.getShortestRowIndex=function(R){for(var D=-1,M=Number.MAX_VALUE,I=0;IM&&(D=I,M=R.rowWidth[I]);return D},P.prototype.canAddHorizontal=function(R,D,M){if(R.idealRowWidth){var I=R.rows.length-1,N=R.rowWidth[I];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){I.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=I[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++)q[0]+=this.grid[Y][B-1].length+this.grid[Y][B].length-1;if(F0)for(var Y=B;Y<=V;Y++)q[3]+=this.grid[N-1][Y].length+this.grid[N][Y].length-1;for(var ne=T.MAX_VALUE,X,J,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 St=0;Ie.forEach(function(ut){ve=="horizontal"?(je.set(ut,x.has(ut)?w[x.get(ut)]:De.get(ut)),St+=je.get(ut)):(je.set(ut,x.has(ut)?A[x.get(ut)]:De.get(ut)),St+=je.get(ut))}),St=St/Ie.length,yt.forEach(function(ut){ce.has(ut)||je.set(ut,St)})}else{var kt=0;yt.forEach(function(ut){ve=="horizontal"?kt+=x.has(ut)?w[x.get(ut)]:De.get(ut):kt+=x.has(ut)?A[x.get(ut)]:De.get(ut)}),kt=kt/yt.length,yt.forEach(function(ut){je.set(ut,kt)})}});for(var He=function(){var Ie=Ze.shift(),St=oe.get(Ie);St.forEach(function(kt){if(je.get(kt.id)ut&&(ut=Mt),qrGt&&(Gt=qr)}}catch(Zr){gt=!0,Te=Zr}finally{try{!It&&Bt.return&&Bt.return()}finally{if(gt)throw Te}}var Me=(St+ut)/2-(kt+Gt)/2,at=!0,wt=!1,Tt=void 0;try{for(var dr=yt[Symbol.iterator](),jr;!(at=(jr=dr.next()).done);at=!0){var Ir=jr.value;je.set(Ir,je.get(Ir)+Me)}}catch(Zr){wt=!0,Tt=Zr}finally{try{!at&&dr.return&&dr.return()}finally{if(wt)throw Tt}}})}return je},L=function(oe){var ve=0,ce=0,De=0,Le=0;if(oe.forEach(function($e){$e.left?w[x.get($e.left)]-w[x.get($e.right)]>=0?ve++:ce++:A[x.get($e.top)]-A[x.get($e.bottom)]>=0?De++:Le++}),ve>ce&&De>Le)for(var We=0;Wece)for(var Ne=0;NeLe)for(var je=0;je1)y.fixedNodeConstraint.forEach(function(me,oe){I[oe]=[me.position.x,me.position.y],N[oe]=[w[x.get(me.nodeId)],A[x.get(me.nodeId)]]}),F=!0;else if(y.alignmentConstraint)(function(){var me=0;if(y.alignmentConstraint.vertical){for(var oe=y.alignmentConstraint.vertical,ve=function(je){var $e=new Set;oe[je].forEach(function(et){$e.add(et)});var Ze=new Set([].concat(h($e)).filter(function(et){return V.has(et)})),He=void 0;Ze.size>0?He=w[x.get(Ze.values().next().value)]:He=_($e).x,oe[je].forEach(function(et){I[me]=[He,A[x.get(et)]],N[me]=[w[x.get(et)],A[x.get(et)]],me++})},ce=0;ce0?He=w[x.get(Ze.values().next().value)]:He=_($e).y,De[je].forEach(function(et){I[me]=[w[x.get(et)],He],N[me]=[w[x.get(et)],A[x.get(et)]],me++})},We=0;WeG&&(G=Q[Y].length,q=Y);if(G0){var we={x:0,y:0};y.fixedNodeConstraint.forEach(function(me,oe){var ve={x:w[x.get(me.nodeId)],y:A[x.get(me.nodeId)]},ce=me.position,De=E(ce,ve);we.x+=De.x,we.y+=De.y}),we.x/=y.fixedNodeConstraint.length,we.y/=y.fixedNodeConstraint.length,w.forEach(function(me,oe){w[oe]+=we.x}),A.forEach(function(me,oe){A[oe]+=we.y}),y.fixedNodeConstraint.forEach(function(me){w[x.get(me.nodeId)]=me.position.x,A[x.get(me.nodeId)]=me.position.y})}if(y.alignmentConstraint){if(y.alignmentConstraint.vertical)for(var Oe=y.alignmentConstraint.vertical,Be=function(oe){var ve=new Set;Oe[oe].forEach(function(Le){ve.add(Le)});var ce=new Set([].concat(h(ve)).filter(function(Le){return V.has(Le)})),De=void 0;ce.size>0?De=w[x.get(ce.values().next().value)]:De=_(ve).x,ve.forEach(function(Le){V.has(Le)||(w[x.get(Le)]=De)})},Z=0;Z0?De=A[x.get(ce.values().next().value)]:De=_(ve).y,ve.forEach(function(Le){V.has(Le)||(A[x.get(Le)]=De)})},ae=0;ae{s.exports=r}},i={};function a(s){var l=i[s];if(l!==void 0)return l.exports;var u=i[s]={exports:{}};return n[s](u,u.exports,a),u.exports}var o=a(45);return o})()})}(sMe)),sMe.exports}(function(t,e){(function(n,i){t.exports=i(pci())})(Ti,function(r){return(()=>{var n={658:s=>{s.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](),C;!(w=(C=T.next()).done);w=!0){var k=C.value,E=h(k,2),_=E[0],P=E[1],L=m.cy.getElementById(_);if(L){var R=L.boundingBox(),D=g.xCoords[P]-R.w/2,M=g.xCoords[P]+R.w/2,I=g.yCoords[P]-R.h/2,N=g.yCoords[P]+R.h/2;Dy&&(y=M),Ix&&(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,q=Q.getRect().x+Q.getRect().width,Y=Q.getRect().y,ne=Q.getRect().y+Q.getRect().height;Gy&&(y=q),Yx&&(x=ne)});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,C=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,C=T.nodes(),k=T.edges(),E=void 0,_=void 0,P=void 0,L={};w.randomize&&(E=A.nodeIndexes,_=A.xCoords,P=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),I=function z(U,Q,G,q){for(var Y=Q.length,ne=0;ne0){var ie=void 0;ie=G.getGraphManager().add(G.newGraph(),ee),z(ie,J,G,q)}}},N=function(U,Q,G){for(var q=0,Y=0,ne=0;ne0?y.DEFAULT_EDGE_LENGTH=v.DEFAULT_EDGE_LENGTH=q/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 I(V.addRoot(),h.getTopMostNodes(C),B,w),N(B,V,k),F(B,w),B.runLayout(),L};s.exports={coseLayout:b}},212:(s,l,u)=>{var h=function(){function w(A,S){for(var T=0;T0)if(M){var F=p.getTopMostNodes(T.eles.nodes());if(P=p.connectComponents(C,T.eles,F),P.forEach(function(Ee){var ue=Ee.boundingBox();L.push({x:ue.x1+ue.w/2,y:ue.y1+ue.h/2})}),T.randomize&&P.forEach(function(Ee){T.eles=Ee,E.push(m(T))}),T.quality=="default"||T.quality=="proof"){var B=C.collection();if(T.tile){var V=new Map,z=[],U=[],Q=0,G={nodeIndexes:V,xCoords:z,yCoords:U},q=[];if(P.forEach(function(Ee,ue){Ee.edges().length==0&&(Ee.nodes().forEach(function(de,xe){B.merge(Ee.nodes()[xe]),de.isParent()||(G.nodeIndexes.set(Ee.nodes()[xe].id(),Q++),G.xCoords.push(Ee.nodes()[0].position().x),G.yCoords.push(Ee.nodes()[0].position().y))}),q.push(ue))}),B.length>1){var Y=B.boundingBox();L.push({x:Y.x1+Y.w/2,y:Y.y1+Y.h/2}),P.push(B),E.push(G);for(var ne=q.length-1;ne>=0;ne--)P.splice(q[ne],1),E.splice(q[ne],1),L.splice(q[ne],1)}}P.forEach(function(Ee,ue){T.eles=Ee,_.push(y(T,E[ue])),p.relocateComponent(L[ue],_[ue],T)})}else P.forEach(function(Ee,ue){p.relocateComponent(L[ue],E[ue],T)});var X=new Set;if(P.length>1){var J=[],ee=k.filter(function(Ee){return Ee.css("display")=="none"});P.forEach(function(Ee,ue){var de=void 0;if(T.quality=="draft"&&(de=E[ue].nodeIndexes),Ee.nodes().not(ee).length>0){var xe={};xe.edges=[],xe.nodes=[];var ge=void 0;Ee.nodes().not(ee).forEach(function(ze){if(T.quality=="draft")if(!ze.isParent())ge=de.get(ze.id()),xe.nodes.push({x:E[ue].xCoords[ge]-ze.boundingbox().w/2,y:E[ue].yCoords[ge]-ze.boundingbox().h/2,width:ze.boundingbox().w,height:ze.boundingbox().h});else{var we=p.calcBoundingBox(ze,E[ue].xCoords,E[ue].yCoords,de);xe.nodes.push({x:we.topLeftX,y:we.topLeftY,width:we.width,height:we.height})}else _[ue][ze.id()]&&xe.nodes.push({x:_[ue][ze.id()].getLeft(),y:_[ue][ze.id()].getTop(),width:_[ue][ze.id()].getWidth(),height:_[ue][ze.id()].getHeight()})}),Ee.edges().forEach(function(ze){var we=ze.source(),Oe=ze.target();if(we.css("display")!="none"&&Oe.css("display")!="none")if(T.quality=="draft"){var Be=de.get(we.id()),Z=de.get(Oe.id()),le=[],be=[];if(we.isParent()){var ae=p.calcBoundingBox(we,E[ue].xCoords,E[ue].yCoords,de);le.push(ae.topLeftX+ae.width/2),le.push(ae.topLeftY+ae.height/2)}else le.push(E[ue].xCoords[Be]),le.push(E[ue].yCoords[Be]);if(Oe.isParent()){var K=p.calcBoundingBox(Oe,E[ue].xCoords,E[ue].yCoords,de);be.push(K.topLeftX+K.width/2),be.push(K.topLeftY+K.height/2)}else be.push(E[ue].xCoords[Z]),be.push(E[ue].yCoords[Z]);xe.edges.push({startX:le[0],startY:le[1],endX:be[0],endY:be[1]})}else _[ue][we.id()]&&_[ue][Oe.id()]&&xe.edges.push({startX:_[ue][we.id()].getCenterX(),startY:_[ue][we.id()].getCenterY(),endX:_[ue][Oe.id()].getCenterX(),endY:_[ue][Oe.id()].getCenterY()})}),xe.nodes.length>0&&(J.push(xe),X.add(ue))}});var te=D.packComponents(J,T.randomize).shifts;if(T.quality=="draft")E.forEach(function(Ee,ue){var de=Ee.xCoords.map(function(ge){return ge+te[ue].dx}),xe=Ee.yCoords.map(function(ge){return ge+te[ue].dy});Ee.xCoords=de,Ee.yCoords=xe});else{var pe=0;X.forEach(function(Ee){Object.keys(_[Ee]).forEach(function(ue){var de=_[Ee][ue];de.setCenter(de.getCenterX()+te[pe].dx,de.getCenterY()+te[pe].dy)}),pe++})}}}else{var I=T.eles.boundingBox();if(L.push({x:I.x1+I.w/2,y:I.y1+I.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 ie=function(ue,de){if(T.quality=="default"||T.quality=="proof"){typeof ue=="number"&&(ue=de);var xe=void 0,ge=void 0,ze=ue.data("id");return _.forEach(function(Oe){ze in Oe&&(xe={x:Oe[ze].getRect().getCenterX(),y:Oe[ze].getRect().getCenterY()},ge=Oe[ze])}),T.nodeDimensionsIncludeLabels&&(ge.labelWidth&&(ge.labelPosHorizontal=="left"?xe.x+=ge.labelWidth/2:ge.labelPosHorizontal=="right"&&(xe.x-=ge.labelWidth/2)),ge.labelHeight&&(ge.labelPosVertical=="top"?xe.y+=ge.labelHeight/2:ge.labelPosVertical=="bottom"&&(xe.y-=ge.labelHeight/2))),xe==null&&(xe={x:ue.position("x"),y:ue.position("y")}),{x:xe.x,y:xe.y}}else{var we=void 0;return E.forEach(function(Oe){var Be=Oe.nodeIndexes.get(ue.id());Be!=null&&(we={x:Oe.xCoords[Be],y:Oe.yCoords[Be]})}),we==null&&(we={x:ue.position("x"),y:ue.position("y")}),{x:we.x,y:we.y}}};if(T.quality=="default"||T.quality=="proof"||T.randomize){var Ce=p.calcParentsWithoutChildren(C,k),ke=k.filter(function(Ee){return Ee.css("display")=="none"});T.eles=k.not(ke),k.nodes().not(":parent").not(ke).layoutPositions(S,T,ie),Ce.length>0&&Ce.forEach(function(Ee){Ee.position(ie(Ee))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),w}();s.exports=x},657:(s,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=[],C=[],k=[],E=[],_=[],P=[],L=[],R=[],D=void 0,M=1e8,I=1e-9,N=m.piTol,F=m.samplingType,B=m.nodeSeparation,V=void 0,z=function(){for(var oe=0,ve=0,ce=!1;ve=Le;){Ne=De[Le++];for(var Pe=T[Ne],yt=0;ytZe&&(Ze=_[St],He=St)}return He},Q=function(oe){var ve=void 0;if(oe){ve=Math.floor(Math.random()*D);for(var De=0;De=1)break;$e=je}for(var et=0;et=1)break;$e=je}for(var yt=0;yt0&&(ve.isParent()?T[oe].push(S.get(ve.id())):T[oe].push(ve.id()))})});var ke=function(oe){var ve=A.get(oe),ce=void 0;w.get(oe).forEach(function(De){v.getElementById(De).isParent()?ce=S.get(De):ce=De,T[ve].push(ce),T[A.get(ce)].push(oe)})},Ee=!0,ue=!1,de=void 0;try{for(var xe=w.keys()[Symbol.iterator](),ge;!(Ee=(ge=xe.next()).done);Ee=!0){var ze=ge.value;ke(ze)}}catch(me){ue=!0,de=me}finally{try{!Ee&&xe.return&&xe.return()}finally{if(ue)throw de}}D=A.size;var we=void 0;if(D>2){V=D{var h=u(212),d=function(p){p&&p("layout","fcose",h)};typeof cytoscape<"u"&&d(cytoscape),s.exports=d},140:s=>{s.exports=r}},i={};function a(s){var l=i[s];if(l!==void 0)return l.exports;var u=i[s]={exports:{}};return n[s](u,u.exports,a),u.exports}var o=a(579);return o})()})})(Nir);var gci=Nir.exports;const mci=wh(gci);var Fir={L:"left",R:"right",T:"top",B:"bottom"},zir={L:O(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:O(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:O(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:O(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},jie={L:O((t,e)=>t-e+2,"L"),R:O((t,e)=>t-2,"R"),T:O((t,e)=>t-e+2,"T"),B:O((t,e)=>t-2,"B")},vci=O(function(t){return bh(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),Uir=O(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),bh=O(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),Vw=O(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),cMe=O(function(t,e){const r=bh(t)&&Vw(e),n=Vw(t)&&bh(e);return r||n},"isArchitectureDirectionXY"),yci=O(function(t){const e=t[0],r=t[1],n=bh(e)&&Vw(r),i=Vw(e)&&bh(r);return n||i},"isArchitecturePairXY"),bci=O(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),uMe=O(function(t,e){const r=`${t}${e}`;return bci(r)?r:void 0},"getArchitectureDirectionPair"),xci=O(function([t,e],r){const n=r[0],i=r[1];return bh(n)?Vw(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:bh(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),wci=O(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Aci=O(function(t,e){return cMe(t,e)?"bend":bh(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Sci=O(function(t){return t.type==="service"},"isArchitectureService"),Tci=O(function(t){return t.type==="junction"},"isArchitectureJunction"),Vir=O((t,e)=>{const[r,n]=[t,e].sort();return`${JSON.stringify(r)}-${JSON.stringify(n)}`},"architectureGroupAlignmentKey"),Qir=O(t=>t.data(),"edgeData"),LD=O(t=>t.data(),"nodeData"),Cci=Jn.architecture,Gir=(yP=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=Ba,this.getAccTitle=oo,this.setDiagramTitle=co,this.getDiagramTitle=$a,this.getAccDescription=lo,this.setAccDescription=so,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="",_a()}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(Sci)}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(Tci)}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:o,lhsGroup:s,rhsGroup:l,title:u}){if(!Uir(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(n)}`);if(!Uir(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(s&&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:s,rhsId:r,rhsDir:i,rhsInto:o,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=Aci(f.lhsDir,f.rhsDir);m!=="bend"&&n.set(Vir(p,g),m)}if(f.lhsId===u){const m=uMe(f.lhsDir,f.rhsDir);m&&d.set(m,f.rhsId)}else{const m=uMe(f.rhsDir,f.lhsDir);m&&d.set(m,f.lhsId)}}i.set(u,d)}const a=new Set,o=new Set(i.keys()),s=O(u=>{const h=new Map([[u,[0,0]]]),d=[u];for(;d.length>0;){const f=d.shift();if(f){a.add(f),o.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,xci([m,v],b)),d.push(y))})}}return h},"BFS"),l=[];for(;o.size>0;){const u=o.values().next().value;l.push(s(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 uo({...Cci,...Dr().architecture})}getConfigField(e){return this.getConfig()[e]}},O(yP,"ArchitectureDB"),yP),Oci=O((t,e)=>{var r;ah(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"),Hir={parser:{yy:void 0},parse:O(async t=>{var n;const e=await Qp("architecture",t);ye.debug(e);const r=(n=Hir.parser)==null?void 0:n.yy;if(!(r instanceof Gir))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.");Oci(e,r)},"parse")},kci=O(t=>` + `},"styles"),dci=hci,fci={db:nMe,renderer:cci,parser:tci,styles:dci};const pci=Object.freeze(Object.defineProperty({__proto__:null,diagram:fci},Symbol.toStringTag,{value:"Module"}));var $ir={exports:{}},sMe={exports:{}},lMe={exports:{}},Fir;function gci(){return Fir||(Fir=1,function(t,e){(function(n,i){t.exports=i()})(Ti,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=r,i.c=n,i.i=function(a){return a},i.d=function(a,o,s){i.o(a,o)||Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:s})},i.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(o,"a",o),o},i.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},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),o=i(8),s=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=o.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=s.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=s.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=s.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=s.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},r.exports=l},function(r,n,i){function a(o){this.vGraphObject=o}r.exports=a},function(r,n,i){var a=i(2),o=i(10),s=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=o.MIN_VALUE,this.inclusionTreeDepth=o.MAX_VALUE,this.vGraphObject=v,this.edges=[],this.graphManager=p,m!=null&&g!=null?this.rect=new s(g.x,g.y,m.width,m.height):this.rect=new s}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==o.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 o(){}for(var s in a)o[s]=a[s];o.MAX_ITERATIONS=2500,o.DEFAULT_EDGE_LENGTH=50,o.DEFAULT_SPRING_STRENGTH=.45,o.DEFAULT_REPULSION_STRENGTH=4500,o.DEFAULT_GRAVITY_STRENGTH=.4,o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,o.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,o.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,o.COOLING_ADAPTATION_FACTOR=.33,o.ADAPTATION_LOWER_NODE_LIMIT=1e3,o.ADAPTATION_UPPER_NODE_LIMIT=5e3,o.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,o.MAX_NODE_DISPLACEMENT=o.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,o.MIN_REPULSION_DIST=o.DEFAULT_EDGE_LENGTH/10,o.CONVERGENCE_CHECK_PERIOD=100,o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,o.MIN_EDGE_LENGTH=1,o.GRID_CALCULATION_CHECK_PERIOD=10,r.exports=o},function(r,n,i){function a(o,s){o==null&&s==null?(this.x=0,this.y=0):(this.x=o,this.y=s)}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(o){this.x=o},a.prototype.setY=function(o){this.y=o},a.prototype.getDifference=function(o){return new DimensionD(this.x-o.x,this.y-o.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(o){return this.x+=o.width,this.y+=o.height,this},r.exports=a},function(r,n,i){var a=i(2),o=i(10),s=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=o.MIN_VALUE,this.margin=s.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&&C>-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(C,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=o.MAX_VALUE,y=o.MAX_VALUE,b,x,w,A=this.getNodes(),S=A.length,T=0;Tb&&(v=b),y>x&&(y=x)}return v==o.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=o.MAX_VALUE,b=-o.MAX_VALUE,x=o.MAX_VALUE,w=-o.MAX_VALUE,A,S,T,C,k,E=this.nodes,_=E.length,P=0;P<_;P++){var L=E[P];v&&L.child!=null&&L.updateBounds(),A=L.getLeft(),S=L.getRight(),T=L.getTop(),C=L.getBottom(),y>A&&(y=A),bT&&(x=T),wA&&(y=A),bT&&(x=T),w=this.nodes.length){var _=0;b.forEach(function(P){P.owner==v&&_++}),_==this.nodes.length&&(this.isConnected=!0)}},r.exports=g},function(r,n,i){var a,o=i(1);function s(l){a=i(6),this.layout=l,this.graphs=[],this.edges=[]}s.prototype.addRoot=function(){var l=this.layout.newGraph(),u=this.layout.newNode(null),h=this.add(l,u);return this.setRootGraph(h),this.rootGraph},s.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}},s.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()-s.getX(),s.getRight()-l.getRight()):l.getX()<=s.getX()&&l.getRight()>=s.getRight()&&(u[0]+=Math.min(s.getX()-l.getX(),l.getRight()-s.getRight())),s.getY()<=l.getY()&&s.getBottom()>=l.getBottom()?u[1]+=Math.min(l.getY()-s.getY(),s.getBottom()-l.getBottom()):l.getY()<=s.getY()&&l.getBottom()>=s.getBottom()&&(u[1]+=Math.min(s.getY()-l.getY(),l.getBottom()-s.getBottom()));var f=Math.abs((l.getCenterY()-s.getCenterY())/(l.getCenterX()-s.getCenterX()));l.getCenterY()===s.getCenterY()&&l.getCenterX()===s.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]=C,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)),-I===N?f>h?(u[2]=k,u[3]=E,D=!0):(u[2]=C,u[3]=T,D=!0):I===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(I,N,2)):(F=this.getCardinalDirection(-M,N,3),B=this.getCardinalDirection(-I,N,1)):d>p?(F=this.getCardinalDirection(-M,N,1),B=this.getCardinalDirection(-I,N,3)):(F=this.getCardinalDirection(M,N,2),B=this.getCardinalDirection(I,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+P*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+-P*N,u[2]=U,u[3]=Q;break}}return!1},o.getCardinalDirection=function(s,l,u){return s>l?u:1+u%4},o.getIntersection=function(s,l,u,h){if(h==null)return this.getIntersection2(s,l,u);var d=s.x,f=s.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,C=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,C=m-y,E=y*v-m*b,_=A*C-S*T,_===0?null:(x=(T*E-C*k)/_,w=(S*k-A*E)/_,new a(x,w))},o.angleOfVector=function(s,l,u,h){var d=void 0;return s!==u?(d=Math.atan((h-l)/(u-s)),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},o.HALF_PI=.5*Math.PI,o.ONE_AND_HALF_PI=1.5*Math.PI,o.TWO_PI=2*Math.PI,o.THREE_PI=3*Math.PI,r.exports=o},function(r,n,i){function a(){}a.sign=function(o){return o>0?1:o<0?-1:0},a.floor=function(o){return o<0?Math.ceil(o):Math.floor(o)},a.ceil=function(o){return o<0?Math.floor(o):Math.ceil(o)},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(s);return s==null||l!="object"&&l!="function"},r.exports=o},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 C=A[0];A.splice(0,1),w.add(C);for(var k=C.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&&C.push(R),b.set(R,M)}})}y=y.concat(C),(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 o(s,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}o.prototype.getWorldOrgX=function(){return this.lworldOrgX},o.prototype.setWorldOrgX=function(s){this.lworldOrgX=s},o.prototype.getWorldOrgY=function(){return this.lworldOrgY},o.prototype.setWorldOrgY=function(s){this.lworldOrgY=s},o.prototype.getWorldExtX=function(){return this.lworldExtX},o.prototype.setWorldExtX=function(s){this.lworldExtX=s},o.prototype.getWorldExtY=function(){return this.lworldExtY},o.prototype.setWorldExtY=function(s){this.lworldExtY=s},o.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},o.prototype.setDeviceOrgX=function(s){this.ldeviceOrgX=s},o.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},o.prototype.setDeviceOrgY=function(s){this.ldeviceOrgY=s},o.prototype.getDeviceExtX=function(){return this.ldeviceExtX},o.prototype.setDeviceExtX=function(s){this.ldeviceExtX=s},o.prototype.getDeviceExtY=function(){return this.ldeviceExtY},o.prototype.setDeviceExtY=function(s){this.ldeviceExtY=s},o.prototype.transformX=function(s){var l=0,u=this.lworldExtX;return u!=0&&(l=this.ldeviceOrgX+(s-this.lworldOrgX)*this.ldeviceExtX/u),l},o.prototype.transformY=function(s){var l=0,u=this.lworldExtY;return u!=0&&(l=this.ldeviceOrgY+(s-this.lworldOrgY)*this.ldeviceExtY/u),l},o.prototype.inverseTransformX=function(s){var l=0,u=this.ldeviceExtX;return u!=0&&(l=this.lworldOrgX+(s-this.ldeviceOrgX)*this.lworldExtX/u),l},o.prototype.inverseTransformY=function(s){var l=0,u=this.ldeviceExtY;return u!=0&&(l=this.lworldOrgY+(s-this.ldeviceOrgY)*this.lworldExtY/u),l},o.prototype.inverseTransformPoint=function(s){var l=new a(this.inverseTransformX(s.x),this.inverseTransformY(s.y));return l},r.exports=o},function(r,n,i){function a(p){if(Array.isArray(p)){for(var g=0,m=Array(p.length);gs.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*s.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(p-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-s.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT_INCREMENTAL):(p>s.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(s.COOLING_ADAPTATION_FACTOR,1-(p-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*(1-s.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*s.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%s.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(o){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=o.length,this.n=o[0].length;var s=Math.min(this.m,this.n);this.s=function(It){for(var gt=[];It-- >0;)gt.push(0);return gt}(Math.min(this.m+1,this.n)),this.U=function(It){var gt=function Te(Bt){if(Bt.length==0)return 0;for(var Et=[],At=0;At0;)gt.push(0);return gt}(this.n),u=function(It){for(var gt=[];It-- >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;I--)if(this.s[I]!==0){for(var N=I+1;N=0;G--){if(function(It,gt){return It&>}(G0;){var ie=void 0,Ce=void 0;for(ie=R-2;ie>=-1&&ie!==-1;ie--)if(Math.abs(l[ie])<=pe+te*(Math.abs(this.s[ie])+Math.abs(this.s[ie+1]))){l[ie]=0;break}if(ie===R-2)Ce=4;else{var ke=void 0;for(ke=R-1;ke>=ie&&ke!==ie;ke--){var Ee=(ke!==R?Math.abs(l[ke]):0)+(ke!==ie+1?Math.abs(l[ke-1]):0);if(Math.abs(this.s[ke])<=pe+te*Ee){this.s[ke]=0;break}}ke===ie?Ce=3:ke===R-1?Ce=1:(Ce=2,ie=ke)}switch(ie++,Ce){case 1:{var ue=l[R-2];l[R-2]=0;for(var de=R-2;de>=ie;de--){var xe=a.hypot(this.s[de],ue),ge=this.s[de]/xe,ze=ue/xe;this.s[de]=xe,de!==ie&&(ue=-ze*l[de-1],l[de-1]=ge*l[de-1]);for(var we=0;we=this.s[ie+1]);){var St=this.s[ie];if(this.s[ie]=this.s[ie+1],this.s[ie+1]=St,ieMath.abs(s)?(l=s/o,l=Math.abs(o)*Math.sqrt(1+l*l)):s!=0?(l=o/s,l=Math.abs(s)*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;o(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===s&&h.callback===l&&this.listeners.splice(u,1)}},o.emit=function(s,l){for(var u=0;u{var n={45:(s,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),s.exports=h},806:(s,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,s.exports=d},767:(s,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];s.exports=d},880:(s,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];s.exports=d},578:(s,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];s.exports=d},765:(s,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,C=u(551).IGeometry,k=u(551).LGraph,E=u(551).Transform,_=u(551).LinkedList;function P(){h.call(this),this.toBeTiled={},this.constraints={}}P.prototype=Object.create(h.prototype);for(var L in h)P[L]=h[L];P.prototype.newGraphManager=function(){var R=new d(this);return this.graphManager=R,R},P.prototype.newGraph=function(R){return new f(null,this.graphManager,R)},P.prototype.newNode=function(R){return new p(this.graphManager,R)},P.prototype.newEdge=function(R){return new g(null,null,R)},P.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)},P.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},P.prototype.layout=function(){var R=b.DEFAULT_CREATE_BENDS_AS_NEEDED;return R&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},P.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(I){return D.has(I)});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},P.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,I=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(M,I),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},P.prototype.getPositionsData=function(){for(var R=this.graphManager.getAllNodes(),D={},M=0;M0&&this.updateDisplacements();for(var M=0;M0&&(I.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(X){R.fixedNodesOnHorizontal.add(X),R.fixedNodesOnVertical.add(X)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var z=this.constraints.alignmentConstraint.vertical,M=0;M=2*X.length/3;te--)J=Math.floor(Math.random()*(te+1)),ee=X[te],X[te]=X[J],X[J]=ee;return X},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(X){if(X.left){var J=B.has(X.left)?B.get(X.left):X.left,ee=B.has(X.right)?B.get(X.right):X.right;R.nodesInRelativeHorizontal.includes(J)||(R.nodesInRelativeHorizontal.push(J),R.nodeToRelativeConstraintMapHorizontal.set(J,[]),R.dummyToNodeForVerticalAlignment.has(J)?R.nodeToTempPositionMapHorizontal.set(J,R.idToNodeMap.get(R.dummyToNodeForVerticalAlignment.get(J)[0]).getCenterX()):R.nodeToTempPositionMapHorizontal.set(J,R.idToNodeMap.get(J).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(J).push({right:ee,gap:X.gap}),R.nodeToRelativeConstraintMapHorizontal.get(ee).push({left:J,gap:X.gap})}else{var te=V.has(X.top)?V.get(X.top):X.top,pe=V.has(X.bottom)?V.get(X.bottom):X.bottom;R.nodesInRelativeVertical.includes(te)||(R.nodesInRelativeVertical.push(te),R.nodeToRelativeConstraintMapVertical.set(te,[]),R.dummyToNodeForHorizontalAlignment.has(te)?R.nodeToTempPositionMapVertical.set(te,R.idToNodeMap.get(R.dummyToNodeForHorizontalAlignment.get(te)[0]).getCenterY()):R.nodeToTempPositionMapVertical.set(te,R.idToNodeMap.get(te).getCenterY())),R.nodesInRelativeVertical.includes(pe)||(R.nodesInRelativeVertical.push(pe),R.nodeToRelativeConstraintMapVertical.set(pe,[]),R.dummyToNodeForHorizontalAlignment.has(pe)?R.nodeToTempPositionMapVertical.set(pe,R.idToNodeMap.get(R.dummyToNodeForHorizontalAlignment.get(pe)[0]).getCenterY()):R.nodeToTempPositionMapVertical.set(pe,R.idToNodeMap.get(pe).getCenterY())),R.nodeToRelativeConstraintMapVertical.get(te).push({bottom:pe,gap:X.gap}),R.nodeToRelativeConstraintMapVertical.get(pe).push({top:te,gap:X.gap})}});else{var Q=new Map,G=new Map;this.constraints.relativePlacementConstraint.forEach(function(X){if(X.left){var J=B.has(X.left)?B.get(X.left):X.left,ee=B.has(X.right)?B.get(X.right):X.right;Q.has(J)?Q.get(J).push(ee):Q.set(J,[ee]),Q.has(ee)?Q.get(ee).push(J):Q.set(ee,[J])}else{var te=V.has(X.top)?V.get(X.top):X.top,pe=V.has(X.bottom)?V.get(X.bottom):X.bottom;G.has(te)?G.get(te).push(pe):G.set(te,[pe]),G.has(pe)?G.get(pe).push(te):G.set(pe,[te])}});var q=function(J,ee){var te=[],pe=[],ie=new _,Ce=new Set,ke=0;return J.forEach(function(Ee,ue){if(!Ce.has(ue)){te[ke]=[],pe[ke]=!1;var de=ue;for(ie.push(de),Ce.add(de),te[ke].push(de);ie.length!=0;){de=ie.shift(),ee.has(de)&&(pe[ke]=!0);var xe=J.get(de);xe.forEach(function(ge){Ce.has(ge)||(ie.push(ge),Ce.add(ge),te[ke].push(ge))})}ke++}}),{components:te,isFixed:pe}},Y=q(Q,R.fixedNodesOnHorizontal);this.componentsOnHorizontal=Y.components,this.fixedComponentsOnHorizontal=Y.isFixed;var ne=q(G,R.fixedNodesOnVertical);this.componentsOnVertical=ne.components,this.fixedComponentsOnVertical=ne.isFixed}}},P.prototype.updateDisplacements=function(){var R=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(ne){var X=R.idToNodeMap.get(ne.nodeId);X.displacementX=0,X.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;VI&&(I=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))},P.radialLayout=function(R,D,M){var I=Math.max(this.maxDiagonalInTree(R),m.DEFAULT_RADIAL_SEPARATION);P.branchRadialLayout(D,null,0,359,0,I);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=J[0];J.splice(0,1);var te=G.indexOf(ee);te>=0&&G.splice(te,1),ne--,q--}D!=null?X=(G.indexOf(J[0])+1)%ne:X=0;for(var pe=Math.abs(I-M)/q,ie=X;Y!=q;ie=++ie%ne){var Ce=G[ie].getOtherEnd(R);if(Ce!=D){var ke=(M+Y*pe)%360,Ee=(ke+pe)%360;P.branchRadialLayout(Ce,R,ke,Ee,N+F,F),Y++}}},P.maxDiagonalInTree=function(R){for(var D=T.MIN_VALUE,M=0;MD&&(D=N)}return D},P.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},P.prototype.groupZeroDegreeMembers=function(){var R=this,D={};this.memberGroups={},this.idToDummyNode={};for(var M=[],I=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 q=R.getGraphManager().add(R.newGraph(),G),Y=Q.getChild();Y.add(G);for(var ne=0;neN?(I.rect.x-=(I.labelWidth-N)/2,I.setWidth(I.labelWidth),I.labelMarginLeft=(I.labelWidth-N)/2):I.labelPosHorizontal=="right"&&I.setWidth(N+I.labelWidth)),I.labelHeight&&(I.labelPosVertical=="top"?(I.rect.y-=I.labelHeight,I.setHeight(F+I.labelHeight),I.labelMarginTop=I.labelHeight):I.labelPosVertical=="center"&&I.labelHeight>F?(I.rect.y-=(I.labelHeight-F)/2,I.setHeight(I.labelHeight),I.labelMarginTop=(I.labelHeight-F)/2):I.labelPosVertical=="bottom"&&I.setHeight(F+I.labelHeight))}})},P.prototype.repopulateCompounds=function(){for(var R=this.compoundOrder.length-1;R>=0;R--){var D=this.compoundOrder[R],M=D.id,I=D.paddingLeft,N=D.paddingTop,F=D.labelMarginLeft,B=D.labelMarginTop;this.adjustLocations(this.tiledMemberPack[M],D.rect.x,D.rect.y,I,N,F,B)}},P.prototype.repopulateZeroDegreeMembers=function(){var R=this,D=this.tiledZeroDegreePack;Object.keys(D).forEach(function(M){var I=R.idToDummyNode[M],N=I.paddingLeft,F=I.paddingTop,B=I.labelMarginLeft,V=I.labelMarginTop;R.adjustLocations(D[M],I.rect.x,I.rect.y,N,F,B,V)})},P.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 I=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},P.prototype.getNodeDegree=function(R){R.id;for(var D=R.getEdges(),M=0,I=0;IQ&&(Q=q.rect.height)}M+=Q+R.verticalPadding}},P.prototype.tileCompoundMembers=function(R,D){var M=this;this.tiledMemberPack=[],Object.keys(R).forEach(function(I){var N=D[I];if(M.tiledMemberPack[I]=M.tileNodes(R[I],N.paddingLeft+N.paddingRight),N.rect.width=M.tiledMemberPack[I].width,N.rect.height=M.tiledMemberPack[I].height,N.setCenter(M.tiledMemberPack[I].centerX,M.tiledMemberPack[I].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))}})},P.prototype.tileNodes=function(R,D){var M=this.tileNodesByFavoringDim(R,D,!0),I=this.tileNodesByFavoringDim(R,D,!1),N=this.getOrgRatio(M),F=this.getOrgRatio(I),B;return FV&&(V=ne.getWidth())});var z=F/N,U=B/N,Q=Math.pow(M-I,2)+4*(z+I)*(U+M)*N,G=(I-M+Math.sqrt(Q))/(2*(z+I)),q;D?(q=Math.ceil(G),q==G&&q++):q=Math.floor(G);var Y=q*(z+I)-I;return V>Y&&(Y=V),Y+=I*2,Y},P.prototype.tileNodesByFavoringDim=function(R,D,M){var I=m.TILING_PADDING_VERTICAL,N=m.TILING_PADDING_HORIZONTAL,F=m.TILING_COMPARE_BY,B={rows:[],rowWidth:[],rowHeight:[],width:0,height:D,verticalPadding:I,horizontalPadding:N,centerX:0,centerY:0};F&&(B.idealRowWidth=this.calcIdealRowWidth(R,M));var V=function(X){return X.rect.width*X.rect.height},z=function(X,J){return V(J)-V(X)};R.sort(function(ne,X){var J=z;return B.idealRowWidth?(J=F,J(ne.id,X.id)):J(ne,X)});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)},P.prototype.getShortestRowIndex=function(R){for(var D=-1,M=Number.MAX_VALUE,I=0;IM&&(D=I,M=R.rowWidth[I]);return D},P.prototype.canAddHorizontal=function(R,D,M){if(R.idealRowWidth){var I=R.rows.length-1,N=R.rowWidth[I];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){I.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=I[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++)q[0]+=this.grid[Y][B-1].length+this.grid[Y][B].length-1;if(F0)for(var Y=B;Y<=V;Y++)q[3]+=this.grid[N-1][Y].length+this.grid[N][Y].length-1;for(var ne=T.MAX_VALUE,X,J,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 St=0;Ie.forEach(function(ut){ve=="horizontal"?(je.set(ut,x.has(ut)?w[x.get(ut)]:De.get(ut)),St+=je.get(ut)):(je.set(ut,x.has(ut)?A[x.get(ut)]:De.get(ut)),St+=je.get(ut))}),St=St/Ie.length,yt.forEach(function(ut){ce.has(ut)||je.set(ut,St)})}else{var kt=0;yt.forEach(function(ut){ve=="horizontal"?kt+=x.has(ut)?w[x.get(ut)]:De.get(ut):kt+=x.has(ut)?A[x.get(ut)]:De.get(ut)}),kt=kt/yt.length,yt.forEach(function(ut){je.set(ut,kt)})}});for(var He=function(){var Ie=Ze.shift(),St=oe.get(Ie);St.forEach(function(kt){if(je.get(kt.id)ut&&(ut=Mt),qrGt&&(Gt=qr)}}catch(Zr){gt=!0,Te=Zr}finally{try{!It&&Bt.return&&Bt.return()}finally{if(gt)throw Te}}var Me=(St+ut)/2-(kt+Gt)/2,at=!0,wt=!1,Tt=void 0;try{for(var dr=yt[Symbol.iterator](),jr;!(at=(jr=dr.next()).done);at=!0){var Ir=jr.value;je.set(Ir,je.get(Ir)+Me)}}catch(Zr){wt=!0,Tt=Zr}finally{try{!at&&dr.return&&dr.return()}finally{if(wt)throw Tt}}})}return je},L=function(oe){var ve=0,ce=0,De=0,Le=0;if(oe.forEach(function($e){$e.left?w[x.get($e.left)]-w[x.get($e.right)]>=0?ve++:ce++:A[x.get($e.top)]-A[x.get($e.bottom)]>=0?De++:Le++}),ve>ce&&De>Le)for(var We=0;Wece)for(var Ne=0;NeLe)for(var je=0;je1)y.fixedNodeConstraint.forEach(function(me,oe){I[oe]=[me.position.x,me.position.y],N[oe]=[w[x.get(me.nodeId)],A[x.get(me.nodeId)]]}),F=!0;else if(y.alignmentConstraint)(function(){var me=0;if(y.alignmentConstraint.vertical){for(var oe=y.alignmentConstraint.vertical,ve=function(je){var $e=new Set;oe[je].forEach(function(et){$e.add(et)});var Ze=new Set([].concat(h($e)).filter(function(et){return V.has(et)})),He=void 0;Ze.size>0?He=w[x.get(Ze.values().next().value)]:He=_($e).x,oe[je].forEach(function(et){I[me]=[He,A[x.get(et)]],N[me]=[w[x.get(et)],A[x.get(et)]],me++})},ce=0;ce0?He=w[x.get(Ze.values().next().value)]:He=_($e).y,De[je].forEach(function(et){I[me]=[w[x.get(et)],He],N[me]=[w[x.get(et)],A[x.get(et)]],me++})},We=0;WeG&&(G=Q[Y].length,q=Y);if(G0){var we={x:0,y:0};y.fixedNodeConstraint.forEach(function(me,oe){var ve={x:w[x.get(me.nodeId)],y:A[x.get(me.nodeId)]},ce=me.position,De=E(ce,ve);we.x+=De.x,we.y+=De.y}),we.x/=y.fixedNodeConstraint.length,we.y/=y.fixedNodeConstraint.length,w.forEach(function(me,oe){w[oe]+=we.x}),A.forEach(function(me,oe){A[oe]+=we.y}),y.fixedNodeConstraint.forEach(function(me){w[x.get(me.nodeId)]=me.position.x,A[x.get(me.nodeId)]=me.position.y})}if(y.alignmentConstraint){if(y.alignmentConstraint.vertical)for(var Oe=y.alignmentConstraint.vertical,Be=function(oe){var ve=new Set;Oe[oe].forEach(function(Le){ve.add(Le)});var ce=new Set([].concat(h(ve)).filter(function(Le){return V.has(Le)})),De=void 0;ce.size>0?De=w[x.get(ce.values().next().value)]:De=_(ve).x,ve.forEach(function(Le){V.has(Le)||(w[x.get(Le)]=De)})},Z=0;Z0?De=A[x.get(ce.values().next().value)]:De=_(ve).y,ve.forEach(function(Le){V.has(Le)||(A[x.get(Le)]=De)})},ae=0;ae{s.exports=r}},i={};function a(s){var l=i[s];if(l!==void 0)return l.exports;var u=i[s]={exports:{}};return n[s](u,u.exports,a),u.exports}var o=a(45);return o})()})}(sMe)),sMe.exports}(function(t,e){(function(n,i){t.exports=i(mci())})(Ti,function(r){return(()=>{var n={658:s=>{s.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](),C;!(w=(C=T.next()).done);w=!0){var k=C.value,E=h(k,2),_=E[0],P=E[1],L=m.cy.getElementById(_);if(L){var R=L.boundingBox(),D=g.xCoords[P]-R.w/2,M=g.xCoords[P]+R.w/2,I=g.yCoords[P]-R.h/2,N=g.yCoords[P]+R.h/2;Dy&&(y=M),Ix&&(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,q=Q.getRect().x+Q.getRect().width,Y=Q.getRect().y,ne=Q.getRect().y+Q.getRect().height;Gy&&(y=q),Yx&&(x=ne)});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,C=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,C=T.nodes(),k=T.edges(),E=void 0,_=void 0,P=void 0,L={};w.randomize&&(E=A.nodeIndexes,_=A.xCoords,P=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),I=function z(U,Q,G,q){for(var Y=Q.length,ne=0;ne0){var ie=void 0;ie=G.getGraphManager().add(G.newGraph(),ee),z(ie,J,G,q)}}},N=function(U,Q,G){for(var q=0,Y=0,ne=0;ne0?y.DEFAULT_EDGE_LENGTH=v.DEFAULT_EDGE_LENGTH=q/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 I(V.addRoot(),h.getTopMostNodes(C),B,w),N(B,V,k),F(B,w),B.runLayout(),L};s.exports={coseLayout:b}},212:(s,l,u)=>{var h=function(){function w(A,S){for(var T=0;T0)if(M){var F=p.getTopMostNodes(T.eles.nodes());if(P=p.connectComponents(C,T.eles,F),P.forEach(function(Ee){var ue=Ee.boundingBox();L.push({x:ue.x1+ue.w/2,y:ue.y1+ue.h/2})}),T.randomize&&P.forEach(function(Ee){T.eles=Ee,E.push(m(T))}),T.quality=="default"||T.quality=="proof"){var B=C.collection();if(T.tile){var V=new Map,z=[],U=[],Q=0,G={nodeIndexes:V,xCoords:z,yCoords:U},q=[];if(P.forEach(function(Ee,ue){Ee.edges().length==0&&(Ee.nodes().forEach(function(de,xe){B.merge(Ee.nodes()[xe]),de.isParent()||(G.nodeIndexes.set(Ee.nodes()[xe].id(),Q++),G.xCoords.push(Ee.nodes()[0].position().x),G.yCoords.push(Ee.nodes()[0].position().y))}),q.push(ue))}),B.length>1){var Y=B.boundingBox();L.push({x:Y.x1+Y.w/2,y:Y.y1+Y.h/2}),P.push(B),E.push(G);for(var ne=q.length-1;ne>=0;ne--)P.splice(q[ne],1),E.splice(q[ne],1),L.splice(q[ne],1)}}P.forEach(function(Ee,ue){T.eles=Ee,_.push(y(T,E[ue])),p.relocateComponent(L[ue],_[ue],T)})}else P.forEach(function(Ee,ue){p.relocateComponent(L[ue],E[ue],T)});var X=new Set;if(P.length>1){var J=[],ee=k.filter(function(Ee){return Ee.css("display")=="none"});P.forEach(function(Ee,ue){var de=void 0;if(T.quality=="draft"&&(de=E[ue].nodeIndexes),Ee.nodes().not(ee).length>0){var xe={};xe.edges=[],xe.nodes=[];var ge=void 0;Ee.nodes().not(ee).forEach(function(ze){if(T.quality=="draft")if(!ze.isParent())ge=de.get(ze.id()),xe.nodes.push({x:E[ue].xCoords[ge]-ze.boundingbox().w/2,y:E[ue].yCoords[ge]-ze.boundingbox().h/2,width:ze.boundingbox().w,height:ze.boundingbox().h});else{var we=p.calcBoundingBox(ze,E[ue].xCoords,E[ue].yCoords,de);xe.nodes.push({x:we.topLeftX,y:we.topLeftY,width:we.width,height:we.height})}else _[ue][ze.id()]&&xe.nodes.push({x:_[ue][ze.id()].getLeft(),y:_[ue][ze.id()].getTop(),width:_[ue][ze.id()].getWidth(),height:_[ue][ze.id()].getHeight()})}),Ee.edges().forEach(function(ze){var we=ze.source(),Oe=ze.target();if(we.css("display")!="none"&&Oe.css("display")!="none")if(T.quality=="draft"){var Be=de.get(we.id()),Z=de.get(Oe.id()),le=[],be=[];if(we.isParent()){var ae=p.calcBoundingBox(we,E[ue].xCoords,E[ue].yCoords,de);le.push(ae.topLeftX+ae.width/2),le.push(ae.topLeftY+ae.height/2)}else le.push(E[ue].xCoords[Be]),le.push(E[ue].yCoords[Be]);if(Oe.isParent()){var K=p.calcBoundingBox(Oe,E[ue].xCoords,E[ue].yCoords,de);be.push(K.topLeftX+K.width/2),be.push(K.topLeftY+K.height/2)}else be.push(E[ue].xCoords[Z]),be.push(E[ue].yCoords[Z]);xe.edges.push({startX:le[0],startY:le[1],endX:be[0],endY:be[1]})}else _[ue][we.id()]&&_[ue][Oe.id()]&&xe.edges.push({startX:_[ue][we.id()].getCenterX(),startY:_[ue][we.id()].getCenterY(),endX:_[ue][Oe.id()].getCenterX(),endY:_[ue][Oe.id()].getCenterY()})}),xe.nodes.length>0&&(J.push(xe),X.add(ue))}});var te=D.packComponents(J,T.randomize).shifts;if(T.quality=="draft")E.forEach(function(Ee,ue){var de=Ee.xCoords.map(function(ge){return ge+te[ue].dx}),xe=Ee.yCoords.map(function(ge){return ge+te[ue].dy});Ee.xCoords=de,Ee.yCoords=xe});else{var pe=0;X.forEach(function(Ee){Object.keys(_[Ee]).forEach(function(ue){var de=_[Ee][ue];de.setCenter(de.getCenterX()+te[pe].dx,de.getCenterY()+te[pe].dy)}),pe++})}}}else{var I=T.eles.boundingBox();if(L.push({x:I.x1+I.w/2,y:I.y1+I.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 ie=function(ue,de){if(T.quality=="default"||T.quality=="proof"){typeof ue=="number"&&(ue=de);var xe=void 0,ge=void 0,ze=ue.data("id");return _.forEach(function(Oe){ze in Oe&&(xe={x:Oe[ze].getRect().getCenterX(),y:Oe[ze].getRect().getCenterY()},ge=Oe[ze])}),T.nodeDimensionsIncludeLabels&&(ge.labelWidth&&(ge.labelPosHorizontal=="left"?xe.x+=ge.labelWidth/2:ge.labelPosHorizontal=="right"&&(xe.x-=ge.labelWidth/2)),ge.labelHeight&&(ge.labelPosVertical=="top"?xe.y+=ge.labelHeight/2:ge.labelPosVertical=="bottom"&&(xe.y-=ge.labelHeight/2))),xe==null&&(xe={x:ue.position("x"),y:ue.position("y")}),{x:xe.x,y:xe.y}}else{var we=void 0;return E.forEach(function(Oe){var Be=Oe.nodeIndexes.get(ue.id());Be!=null&&(we={x:Oe.xCoords[Be],y:Oe.yCoords[Be]})}),we==null&&(we={x:ue.position("x"),y:ue.position("y")}),{x:we.x,y:we.y}}};if(T.quality=="default"||T.quality=="proof"||T.randomize){var Ce=p.calcParentsWithoutChildren(C,k),ke=k.filter(function(Ee){return Ee.css("display")=="none"});T.eles=k.not(ke),k.nodes().not(":parent").not(ke).layoutPositions(S,T,ie),Ce.length>0&&Ce.forEach(function(Ee){Ee.position(ie(Ee))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),w}();s.exports=x},657:(s,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=[],C=[],k=[],E=[],_=[],P=[],L=[],R=[],D=void 0,M=1e8,I=1e-9,N=m.piTol,F=m.samplingType,B=m.nodeSeparation,V=void 0,z=function(){for(var oe=0,ve=0,ce=!1;ve=Le;){Ne=De[Le++];for(var Pe=T[Ne],yt=0;ytZe&&(Ze=_[St],He=St)}return He},Q=function(oe){var ve=void 0;if(oe){ve=Math.floor(Math.random()*D);for(var De=0;De=1)break;$e=je}for(var et=0;et=1)break;$e=je}for(var yt=0;yt0&&(ve.isParent()?T[oe].push(S.get(ve.id())):T[oe].push(ve.id()))})});var ke=function(oe){var ve=A.get(oe),ce=void 0;w.get(oe).forEach(function(De){v.getElementById(De).isParent()?ce=S.get(De):ce=De,T[ve].push(ce),T[A.get(ce)].push(oe)})},Ee=!0,ue=!1,de=void 0;try{for(var xe=w.keys()[Symbol.iterator](),ge;!(Ee=(ge=xe.next()).done);Ee=!0){var ze=ge.value;ke(ze)}}catch(me){ue=!0,de=me}finally{try{!Ee&&xe.return&&xe.return()}finally{if(ue)throw de}}D=A.size;var we=void 0;if(D>2){V=D{var h=u(212),d=function(p){p&&p("layout","fcose",h)};typeof cytoscape<"u"&&d(cytoscape),s.exports=d},140:s=>{s.exports=r}},i={};function a(s){var l=i[s];if(l!==void 0)return l.exports;var u=i[s]={exports:{}};return n[s](u,u.exports,a),u.exports}var o=a(579);return o})()})})($ir);var vci=$ir.exports;const yci=wh(vci);var Uir={L:"left",R:"right",T:"top",B:"bottom"},Vir={L:O(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:O(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:O(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:O(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},jie={L:O((t,e)=>t-e+2,"L"),R:O((t,e)=>t-2,"R"),T:O((t,e)=>t-e+2,"T"),B:O((t,e)=>t-2,"B")},bci=O(function(t){return bh(t)?t==="L"?"R":"L":t==="T"?"B":"T"},"getOppositeArchitectureDirection"),Qir=O(function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"},"isArchitectureDirection"),bh=O(function(t){const e=t;return e==="L"||e==="R"},"isArchitectureDirectionX"),Vw=O(function(t){const e=t;return e==="T"||e==="B"},"isArchitectureDirectionY"),cMe=O(function(t,e){const r=bh(t)&&Vw(e),n=Vw(t)&&bh(e);return r||n},"isArchitectureDirectionXY"),xci=O(function(t){const e=t[0],r=t[1],n=bh(e)&&Vw(r),i=Vw(e)&&bh(r);return n||i},"isArchitecturePairXY"),wci=O(function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"},"isValidArchitectureDirectionPair"),uMe=O(function(t,e){const r=`${t}${e}`;return wci(r)?r:void 0},"getArchitectureDirectionPair"),Aci=O(function([t,e],r){const n=r[0],i=r[1];return bh(n)?Vw(i)?[t+(n==="L"?-1:1),e+(i==="T"?1:-1)]:[t+(n==="L"?-1:1),e]:bh(i)?[t+(i==="L"?1:-1),e+(n==="T"?1:-1)]:[t,e+(n==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Sci=O(function(t){return t==="LT"||t==="TL"?[1,1]:t==="BL"||t==="LB"?[1,-1]:t==="BR"||t==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Tci=O(function(t,e){return cMe(t,e)?"bend":bh(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Cci=O(function(t){return t.type==="service"},"isArchitectureService"),Oci=O(function(t){return t.type==="junction"},"isArchitectureJunction"),Gir=O((t,e)=>{const[r,n]=[t,e].sort();return`${JSON.stringify(r)}-${JSON.stringify(n)}`},"architectureGroupAlignmentKey"),Hir=O(t=>t.data(),"edgeData"),LD=O(t=>t.data(),"nodeData"),kci=Jn.architecture,Wir=(yP=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=Ba,this.getAccTitle=oo,this.setDiagramTitle=co,this.getDiagramTitle=$a,this.getAccDescription=lo,this.setAccDescription=so,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="",_a()}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(Cci)}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(Oci)}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:o,lhsGroup:s,rhsGroup:l,title:u}){if(!Qir(n))throw new Error(`Invalid direction given for left hand side of edge ${e}--${r}. Expected (L,R,T,B) got ${String(n)}`);if(!Qir(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(s&&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:s,rhsId:r,rhsDir:i,rhsInto:o,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=Tci(f.lhsDir,f.rhsDir);m!=="bend"&&n.set(Gir(p,g),m)}if(f.lhsId===u){const m=uMe(f.lhsDir,f.rhsDir);m&&d.set(m,f.rhsId)}else{const m=uMe(f.rhsDir,f.lhsDir);m&&d.set(m,f.lhsId)}}i.set(u,d)}const a=new Set,o=new Set(i.keys()),s=O(u=>{const h=new Map([[u,[0,0]]]),d=[u];for(;d.length>0;){const f=d.shift();if(f){a.add(f),o.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,Aci([m,v],b)),d.push(y))})}}return h},"BFS"),l=[];for(;o.size>0;){const u=o.values().next().value;l.push(s(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 uo({...kci,...Dr().architecture})}getConfigField(e){return this.getConfig()[e]}},O(yP,"ArchitectureDB"),yP),Eci=O((t,e)=>{var r;ah(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"),Yir={parser:{yy:void 0},parse:O(async t=>{var n;const e=await Qp("architecture",t);ye.debug(e);const r=(n=Yir.parser)==null?void 0:n.yy;if(!(r instanceof Wir))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.");Eci(e,r)},"parse")},_ci=O(t=>` .edge { stroke-width: ${t.archEdgeWidth}; stroke: ${t.archEdgeColor}; @@ -3623,19 +3623,19 @@ Expecting `+te.join(", ")+", got '"+(this.terminals_[Q]||Q)+"'":pe="Parse error display: -webkit-box; -webkit-box-orient: vertical; } -`,"getStyles"),Eci=kci;function hMe(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}}O(hMe,"withSeededRandom");var MD=O(t=>`${t}`,"wrapIcon"),mU={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:MD('')},server:{body:MD('')},disk:{body:MD('')},internet:{body:MD('')},cloud:{body:MD('')},unknown:pCt,blank:{body:MD("")}}},_ci=O(async function(t,e,r,n){const i=r.getConfigField("padding"),a=r.getConfigField("iconSize"),o=a/2,s=a/6,l=s/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}=Qir(u);let{x,y:w}=u[0].sourceEndpoint();const{x:A,y:S}=u[0].midpoint();let{x:T,y:C}=u[0].targetEndpoint();const k=i+4;if(p&&(bh(d)?x+=d==="L"?-k:k:w+=d==="T"?-k:k+18),y&&(bh(m)?T+=m==="L"?-k:k:C+=m==="T"?-k:k+18),!p&&((E=r.getNode(h))==null?void 0:E.type)==="junction"&&(bh(d)?x+=d==="L"?o:-o:w+=d==="T"?o:-o),!y&&((_=r.getNode(g))==null?void 0:_.type)==="junction"&&(bh(m)?T+=m==="L"?o:-o:C+=m==="T"?o:-o),u[0]._private.rscratch){const P=t.insert("g");if(P.insert("path").attr("d",`M ${x},${w} L ${A},${S} L${T},${C} `).attr("class","edge").attr("id",`${n}-${SR(h,g,{prefix:"L"})}`),f){const L=bh(d)?jie[d](x,s):x-l,R=Vw(d)?jie[d](w,s):w-l;P.insert("polygon").attr("points",zir[d](s)).attr("transform",`translate(${L},${R})`).attr("class","arrow")}if(v){const L=bh(m)?jie[m](T,s):T-l,R=Vw(m)?jie[m](C,s):C-l;P.insert("polygon").attr("points",zir[m](s)).attr("transform",`translate(${L},${R})`).attr("class","arrow")}if(b){const L=cMe(d,m)?"XY":bh(d)?"X":"Y";let R=0;L==="X"?R=Math.abs(x-T):L==="Y"?R=Math.abs(w-C)/1.5:R=Math.abs(x-T)/2;const D=P.append("g");if(await su(D,b,{useHtmlLabels:!1,width:R,classes:"architecture-service-label"},Ye()),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=uMe(d,m);if(M&&yci(M)){const I=D.node().getBoundingClientRect(),[N,F]=wci(M);D.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*N*F*45})`);const B=D.node().getBoundingClientRect();D.attr("transform",` +`,"getStyles"),Rci=_ci;function hMe(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}}O(hMe,"withSeededRandom");var MD=O(t=>`${t}`,"wrapIcon"),mU={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:MD('')},server:{body:MD('')},disk:{body:MD('')},internet:{body:MD('')},cloud:{body:MD('')},unknown:mCt,blank:{body:MD("")}}},Dci=O(async function(t,e,r,n){const i=r.getConfigField("padding"),a=r.getConfigField("iconSize"),o=a/2,s=a/6,l=s/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}=Hir(u);let{x,y:w}=u[0].sourceEndpoint();const{x:A,y:S}=u[0].midpoint();let{x:T,y:C}=u[0].targetEndpoint();const k=i+4;if(p&&(bh(d)?x+=d==="L"?-k:k:w+=d==="T"?-k:k+18),y&&(bh(m)?T+=m==="L"?-k:k:C+=m==="T"?-k:k+18),!p&&((E=r.getNode(h))==null?void 0:E.type)==="junction"&&(bh(d)?x+=d==="L"?o:-o:w+=d==="T"?o:-o),!y&&((_=r.getNode(g))==null?void 0:_.type)==="junction"&&(bh(m)?T+=m==="L"?o:-o:C+=m==="T"?o:-o),u[0]._private.rscratch){const P=t.insert("g");if(P.insert("path").attr("d",`M ${x},${w} L ${A},${S} L${T},${C} `).attr("class","edge").attr("id",`${n}-${SR(h,g,{prefix:"L"})}`),f){const L=bh(d)?jie[d](x,s):x-l,R=Vw(d)?jie[d](w,s):w-l;P.insert("polygon").attr("points",Vir[d](s)).attr("transform",`translate(${L},${R})`).attr("class","arrow")}if(v){const L=bh(m)?jie[m](T,s):T-l,R=Vw(m)?jie[m](C,s):C-l;P.insert("polygon").attr("points",Vir[m](s)).attr("transform",`translate(${L},${R})`).attr("class","arrow")}if(b){const L=cMe(d,m)?"XY":bh(d)?"X":"Y";let R=0;L==="X"?R=Math.abs(x-T):L==="Y"?R=Math.abs(w-C)/1.5:R=Math.abs(x-T)/2;const D=P.append("g");if(await su(D,b,{useHtmlLabels:!1,width:R,classes:"architecture-service-label"},Ye()),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=uMe(d,m);if(M&&xci(M)){const I=D.node().getBoundingClientRect(),[N,F]=Sci(M);D.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*N*F*45})`);const B=D.node().getBoundingClientRect();D.attr("transform",` translate(${A}, ${S-I.height/2}) translate(${N*B.width/2}, ${F*B.height/2}) rotate(${-1*N*F*45}, 0, ${I.height/2}) - `)}}}}}))},"drawEdges"),Rci=O(async function(t,e,r,n){const a=r.getConfigField("padding")*.75,o=r.getConfigField("fontSize"),l=r.getConfigField("iconSize")/2;await Promise.all(e.nodes().map(async u=>{const h=LD(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 s1(h.icon,{height:a,width:a,fallbackPrefix:mU.prefix})}`),x.attr("transform","translate("+(y+l+1)+", "+(b+l+1)+")"),y+=a,b+=o/2-1-2}if(h.label){const x=v.append("g");await su(x,h.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},Ye()),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"),Dci=O(async function(t,e,r,n){const i=Ye();for(const a of r){const o=e.append("g"),s=t.getConfigField("iconSize");if(a.title){const d=o.append("g");await su(d,a.title,{useHtmlLabels:!1,width:s*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("+s/2+", "+s+")")}const l=o.append("g");if(a.icon)l.html(`${await s1(a.icon,{height:s,width:s,fallbackPrefix:mU.prefix})}`);else if(a.iconText){l.html(`${await s1("blank",{height:s,width:s,fallbackPrefix:mU.prefix})}`);const p=l.append("g").append("foreignObject").attr("width",s).attr("height",s).append("div").attr("class","node-icon-text").attr("style",`height: ${s}px;`).append("div").html(li(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((s-2)/g)};`)}else l.append("path").attr("class","node-bkg").attr("id",`${n}-node-${a.id}`).attr("d",`M0,${s} V5 Q0,0 5,0 H${s-5} Q${s},0 ${s},5 V${s} Z`);o.attr("id",`${n}-service-${a.id}`).attr("class","architecture-service");const{width:u,height:h}=o.node().getBBox();a.width=u,a.height=h,t.setElementForId(a.id,o)}return 0},"drawServices"),Lci=O(function(t,e,r,n){r.forEach(i=>{const a=e.append("g"),o=t.getConfigField("iconSize");a.append("g").append("rect").attr("id",`${n}-node-${i.id}`).attr("fill-opacity","0").attr("width",o).attr("height",o),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");Txe([{name:mU.prefix,icons:mU}]),rv.use(mci);function Wir(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"})})}O(Wir,"addServices");function Yir(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"})})}O(Yir,"addJunctions");function qir(t,e){e.nodes().map(r=>{const n=LD(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)+")")})}O(qir,"positionNodes");function jir(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"})})}O(jir,"addGroups");function Xir(t,e){t.forEach(r=>{const{lhsId:n,rhsId:i,lhsInto:a,lhsGroup:o,rhsInto:s,lhsDir:l,rhsDir:u,rhsGroup:h,title:d}=r,f=cMe(r.lhsDir,r.rhsDir)?"segments":"straight",p={id:`${n}-${i}`,label:d,source:n,sourceDir:l,sourceArrow:a,sourceGroup:o,sourceEndpoint:l==="L"?"0 50%":l==="R"?"100% 50%":l==="T"?"50% 0":"50% 100%",target:i,targetDir:u,targetArrow:s,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})})}O(Xir,"addEdges");function Kir(t,e,r,n=[]){const i=O((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)}}),[o,s]=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=O(f=>f.filter(p=>!p.some(g=>l.has(g))),"dropOverlapping"),h=u(o),d=u(s);return n.forEach(f=>{f.members.length<2||(f.direction==="row"?h.push([...f.members]):d.push([...f.members]))}),{horizontal:h,vertical:d}}O(Kir,"getAlignments");function Zir(t,e,r=[]){const n=[],i=e.getConfigField("iconSize"),a=e.getConfigField("idealEdgeLengthMultiplier"),o=a*i,s=new Set;r.forEach(h=>{for(let d=0;d`${h[0]},${h[1]}`,"posToStr"),u=O(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),s.has(`${v}|${A}`))return;n.push({[Fir[b]]:A,[Fir[vci(b)]]:v,gap:a*i})}})}}}}),n}O(Zir,"getRelativeConstraints");function Jir(t,e,r,n,i,{spatialMaps:a,groupAlignments:o}){return new Promise(s=>{const l=_t("body").append("div").attr("id","cy").attr("style","display:none"),u=rv({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(),jir(r,u),Wir(t,u,i),Yir(e,u,i),Xir(n,u);const h=i.getLayoutHints(),d=Kir(i,a,o,h),f=Zir(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}=LD(w),{parent:T}=LD(A);return S===T?g:m},edgeElasticity(x){const[w,A]=x.connectedNodes(),{parent:S}=LD(w),{parent:T}=LD(A);return S===T?v:.001},alignmentConstraint:d,relativePlacementConstraint:f});b.one("layoutstop",()=>{var w;function x(A,S,T,C){let k,E;const{x:_,y:P}=A,{x:L,y:R}=S;E=(C-P+(_-T)*(P-R)/(_-L))/Math.sqrt(1+Math.pow((P-R)/(_-L),2)),k=Math.sqrt(Math.pow(C-P,2)+Math.pow(T-_,2)-Math.pow(E,2));const D=Math.sqrt(Math.pow(L-_,2)+Math.pow(R-P,2));k=k/D;let M=(L-_)*(C-P)-(R-P)*(T-_);switch(!0){case M>=0:M=1;break;case M<0:M=-1;break}let I=(L-_)*(T-_)+(R-P)*(C-P);switch(!0){case I>=0:I=1;break;case I<0:I=-1;break}return E=Math.abs(E)*M,k=k*I,{distances:E,weights:k}}O(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:C,y:k}=A.target().position();if(S!==C&&T!==k){const E=A.sourceEndpoint(),_=A.targetEndpoint(),{sourceDir:P}=Qir(A),[L,R]=Vw(P)?[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(),hMe(y,()=>b.run())});try{hMe(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=>{ye.info("Ready",x),s(u)})})}O(Jir,"layoutArchitecture");var Mci=O(async(t,e,r,n)=>{const i=n.db;i.setDiagramId(e);const a=i.getServices(),o=i.getJunctions(),s=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),h=nu(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 Dci(i,f,a,e),Lci(i,f,o,e);const g=await Jir(a,o,s,l,i,u);await _ci(d,g,i,e),await Rci(p,g,i,e),qir(i,g),iR(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),Ici={draw:Mci},Pci={parser:Hir,get db(){return new Gir},renderer:Ici,styles:Eci};const Nci=Object.freeze(Object.defineProperty({__proto__:null,diagram:Pci},Symbol.toStringTag,{value:"Module"}));var ear="position frame",tar="frame positioned",dMe="position relation",rar="relation positioned",Bci=O(function(t){ye.debug("options str",t)},"setOptions"),$ci=O(function(){return{}},"getOptions"),Fci=O(function(){nar(),_a()},"clear");function nar(){fMe={}}O(nar,"reset");var zci=Jn.eventmodeling,Uci=O(()=>uo({...zci,...Dr().eventmodeling}),"getConfig"),fMe={};function iar(){let t=Vci;const{ast:e}=fMe,r=pMe();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const a=har(n,e.dataEntities,r);t=Kie(t,{$kind:ear,index:i,frame:n,textProps:a});let o;yar(n)?(ye.debug("source frame",n.sourceFrames),o=e.frames.filter(s=>n.sourceFrames.some(l=>l.$refText===s.name)),o.forEach(s=>{t=Kie(t,{$kind:dMe,index:i,frame:n,sourceFrame:s})})):t=Kie(t,{$kind:dMe,index:i,frame:n})}),t={...t,sortedSwimlanesArray:gMe(t.swimlanes)},t}O(iar,"getState");function aar(t){fMe.ast=t}O(aar,"setAst");var Gi={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 pMe(){return Gi}O(pMe,"getDiagramProps");var Vci={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function oar(t){const e=t.split(".");if(e.length===2)return e[0]}O(oar,"extractNamespace");function sar(t){const e=t.split(".");return e.length===2?e[1]:t}O(sar,"extractName");function lar(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}O(lar,"findSwimlaneByNamespace");function Xie(t,e,r){return Math.max(e,...Object.keys(t).filter(n=>{const i=Number.parseInt(n);return i>e&&iNumber.parseInt(n)))+1}O(Xie,"findNextAvailableIndex");function car(t,e){const r=oar(t.entityIdentifier),n=lar(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||Gi.labelUiAutomation}:r?{index:Xie(e,0,100),label:Gi.labelUiAutomationPrefix+r}:{index:0,label:Gi.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||Gi.labelCommandReadModel}:r?{index:Xie(e,100,200),label:Gi.labelCommandReadModelPrefix+r}:{index:100,label:Gi.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||Gi.labelEvents}:r?{index:Xie(e,200,300),label:Gi.labelEventsPrefix+r}:{index:200,label:Gi.labelEvents}}}O(car,"calculateSwimlaneProps");function uar(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"}}}O(uar,"calculateEntityVisualProps");function har(t,e,r){const n=Dr(),i=li(sar(t.entityIdentifier)??"",n);let a;const o={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let l=`${Y7(i,r.textMaxWidth,o)}`;if(t.dataInlineValue&&(a=t.dataInlineValue,a=a.substring(a.indexOf("{")+1),a=a.substring(0,a.lastIndexOf("}")-1),a=li(a,n),a=Y7(a,r.textMaxWidth,o),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=li(a,n),a=Y7(a,r.textMaxWidth,o),a=a.replaceAll(" "," "),a+="
")}const u=a!==void 0;u&&(l+=`

${a}`);const h={fontSize:o.fontSize,fontWeight:o.fontWeight,fontFamily:o.fontFamily},d=RX(l,h),f=u?d.width/3:d.width,p={content:l,width:f,height:d.height};return ye.debug(`[${t.name}] ${t.entityIdentifier} text`,p),p}O(har,"calculateTextProps");function dar(t,e){const r=e,n=uar(r.frame),i={width:r.textProps.width+2*Gi.boxTextPadding,height:r.textProps.height+2*Gi.boxTextPadding};return[{$kind:tar,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}O(dar,"decidePositionFrame");function far(t,e,r){return e===void 0?Gi.contentStartX:e.index===t.index&&t.r?t.r+Gi.boxPadding:r===void 0?Gi.contentStartX:r.r-Gi.boxOverlap+Gi.boxPadding}O(far,"calculateX");function par(t,e){const r=[...t.map(n=>n.r),e];return Math.max(...r)}O(par,"calculateMaxRight");function gMe(t){return Object.values(t).sort((e,r)=>e.index-r.index)}O(gMe,"sortedSwimlanesArray");function gar(t,e){const r=e,n=car(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*Gi.swimlaneMinHeight+Gi.swimlaneGap,height:Gi.swimlaneMinHeight,maxHeight:Gi.swimlaneMinHeight};const a=t.boxes.length>0?t.boxes[t.boxes.length-1]:void 0,o=t.previousSwimlaneNumber!==void 0?t.swimlanes[t.previousSwimlaneNumber]:void 0,s={width:Math.max(Gi.boxMinWidth,Math.min(Gi.boxMaxWidth,r.dimension.width))+2*Gi.boxPadding,height:Math.max(Gi.boxMinHeight,Math.min(Gi.boxMaxHeight,r.dimension.height))+2*Gi.boxPadding},l=far(i,o,a),u=l+s.width+Gi.boxPadding,h=par(Object.values(t.swimlanes),u);i.r=l+s.width,i.maxHeight=Math.max(i.maxHeight,s.height),i.height=Math.max(Gi.swimlaneMinHeight,i.maxHeight)+2*Gi.swimlanePadding;const d={x:l,y:Gi.swimlanePadding+i.y,r:u,dimension:s,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=gMe(f.swimlanes);p.length>0&&(p[0].y=0);for(let g=1;g0}O(yar,"hasSourceFrame");function mMe(t,e){if(e!=null)return t.find(r=>r.frame.name===e.name)}O(mMe,"findBoxByFrame");function bar(t,e,r){if(!(r<0))for(let n=r;n>=0;n--){const i=t[n];if(i.swimlane.index!==e)return i}}O(bar,"findBoxByLineIndex");function xar(t,e){const r=e;if(zJt(r.frame)||mar(r.index,r.frame))return[];const n=mMe(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=mMe(t.boxes,r.sourceFrame):i=bar(t.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:rar,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}O(xar,"decidePositionRelation");function war(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]}}O(war,"evolveRelationPositioned");var Qci={[ear]:dar,[dMe]:xar},Gci={[tar]:gar,[rar]:war};function Aar(t,e){const r=Qci[e.$kind];if(r==null)return[];const n=r(t,e);return ye.debug("decided events",n),n}O(Aar,"decide");function Sar(t,e){const r=e.reduce((n,i)=>{const a=Gci[i.$kind];return a==null?n:a(n,i)},t);return ye.debug("evolve events",{state:t,newState:r,events:e}),r}O(Sar,"evolve");function Kie(t,e){const r=Aar(t,e);return Sar(t,r)}O(Kie,"dispatch");var vMe={getConfig:Uci,setOptions:Bci,getOptions:$ci,clear:Fci,setAccTitle:Ba,getAccTitle:oo,getAccDescription:lo,setAccDescription:so,setDiagramTitle:co,getDiagramTitle:$a,setAst:aar,getDiagramProps:pMe,getState:iar},Hci={parse:O(async t=>{const e=await Qp("eventmodeling",t);ye.debug(e),vMe.setAst(e),ah(e,vMe)},"parse")},yMe=Ye(),Wci=yMe==null?void 0:yMe.eventmodeling;function Tar(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)}}O(Tar,"renderD3Box");function Car(t,e){return t>e}O(Car,"dirUpwards");function Oar(t,e,r,n){return i=>{const a=i.sourceBox.swimlane.y+e.swimlanePadding,o=i.targetBox.swimlane.y+e.swimlanePadding,s=Car(a,o),l=i.sourceBox.x+i.sourceBox.dimension.width*2/3,u=i.targetBox.x+i.targetBox.dimension.width/3;let h,d;ye.debug(`rendering relation up=${s} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),s?(h=a,d=o+i.targetBox.dimension.height):(h=a+i.sourceBox.dimension.height,d=o);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}`)}}O(Oar,"renderD3Relation");function kar(t,e,r,n){return i=>{const a=t.append("g").attr("class","em-swimlane"),o=n.emSwimlaneBackgroundOdd??"rgb(250,250,250)",s=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",o).attr("stroke",s),a.append("text").attr("font-weight",r.swimlaneTextFontWeight).attr("x",30).attr("y",i.y+30).text(i.label)}}O(kar,"renderD3Swimlane");var Yci=O(function(t,e,r,n){if(ye.debug("in eventmodeling renderer",t+` -`,"id:",e,r),!Wci)throw new Error("EventModeling config not found");const i=n.db,{themeVariables:a,eventmodeling:o}=Ye(),s=_t(`[id="${e}"]`),l=i.getDiagramProps(),u=i.getState(),h=`em-arrowhead-${e}`,d=a.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(kar(s,u.maxR,l,a)),u.boxes.forEach(Tar(s,l)),u.relations.forEach(Oar(s,l,h,a)),s.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),Q1e(void 0,s,(o==null?void 0:o.padding)??30,o==null?void 0:o.useMaxWidth)},"draw"),qci={draw:Yci},jci=O(t=>"","getStyles"),Xci=jci,Kci={parser:Hci,db:vMe,renderer:qci,styles:Xci};const Zci=Object.freeze(Object.defineProperty({__proto__:null,diagram:Kci},Symbol.toStringTag,{value:"Module"}));var bMe=function(){var t=O(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],o=[1,20],s=[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:O(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:O(function(b,x,w,A,S,T,C){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:o,7:s,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:o,7:s,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:O(function(b,x){if(x.recoverable)this.trace(b);else{var w=new Error(b);throw w.hash=x,w}},"parseError"),parse:O(function(b){var x=this,w=[0],A=[],S=[null],T=[],C=this.table,k="",E=0,_=0,P=2,L=1,R=T.slice.call(arguments,1),D=Object.create(this.lexer),M={yy:{}};for(var I in this.yy)Object.prototype.hasOwnProperty.call(this.yy,I)&&(M.yy[I]=this.yy[I]);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(te){w.length=w.length-2*te,S.length=S.length-te,T.length=T.length-te}O(B,"popStack");function V(){var te;return te=A.pop()||D.lex()||L,typeof te!="number"&&(te instanceof Array&&(A=te,te=A.pop()),te=x.symbols_[te]||te),te}O(V,"lex");for(var z,U,Q,G,q={},Y,ne,X,J;;){if(U=w[w.length-1],this.defaultActions[U]?Q=this.defaultActions[U]:((z===null||typeof z>"u")&&(z=V()),Q=C[U]&&C[U][z]),typeof Q>"u"||!Q.length||!Q[0]){var ee="";J=[];for(Y in C[U])this.terminals_[Y]&&Y>P&&J.push("'"+this.terminals_[Y]+"'");D.showPosition?ee="Parse error on line "+(E+1)+`: + `)}}}}}))},"drawEdges"),Lci=O(async function(t,e,r,n){const a=r.getConfigField("padding")*.75,o=r.getConfigField("fontSize"),l=r.getConfigField("iconSize")/2;await Promise.all(e.nodes().map(async u=>{const h=LD(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 s1(h.icon,{height:a,width:a,fallbackPrefix:mU.prefix})}`),x.attr("transform","translate("+(y+l+1)+", "+(b+l+1)+")"),y+=a,b+=o/2-1-2}if(h.label){const x=v.append("g");await su(x,h.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},Ye()),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"),Mci=O(async function(t,e,r,n){const i=Ye();for(const a of r){const o=e.append("g"),s=t.getConfigField("iconSize");if(a.title){const d=o.append("g");await su(d,a.title,{useHtmlLabels:!1,width:s*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("+s/2+", "+s+")")}const l=o.append("g");if(a.icon)l.html(`${await s1(a.icon,{height:s,width:s,fallbackPrefix:mU.prefix})}`);else if(a.iconText){l.html(`${await s1("blank",{height:s,width:s,fallbackPrefix:mU.prefix})}`);const p=l.append("g").append("foreignObject").attr("width",s).attr("height",s).append("div").attr("class","node-icon-text").attr("style",`height: ${s}px;`).append("div").html(li(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((s-2)/g)};`)}else l.append("path").attr("class","node-bkg").attr("id",`${n}-node-${a.id}`).attr("d",`M0,${s} V5 Q0,0 5,0 H${s-5} Q${s},0 ${s},5 V${s} Z`);o.attr("id",`${n}-service-${a.id}`).attr("class","architecture-service");const{width:u,height:h}=o.node().getBBox();a.width=u,a.height=h,t.setElementForId(a.id,o)}return 0},"drawServices"),Ici=O(function(t,e,r,n){r.forEach(i=>{const a=e.append("g"),o=t.getConfigField("iconSize");a.append("g").append("rect").attr("id",`${n}-node-${i.id}`).attr("fill-opacity","0").attr("width",o).attr("height",o),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");Txe([{name:mU.prefix,icons:mU}]),rv.use(yci);function qir(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"})})}O(qir,"addServices");function jir(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"})})}O(jir,"addJunctions");function Xir(t,e){e.nodes().map(r=>{const n=LD(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)+")")})}O(Xir,"positionNodes");function Kir(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"})})}O(Kir,"addGroups");function Zir(t,e){t.forEach(r=>{const{lhsId:n,rhsId:i,lhsInto:a,lhsGroup:o,rhsInto:s,lhsDir:l,rhsDir:u,rhsGroup:h,title:d}=r,f=cMe(r.lhsDir,r.rhsDir)?"segments":"straight",p={id:`${n}-${i}`,label:d,source:n,sourceDir:l,sourceArrow:a,sourceGroup:o,sourceEndpoint:l==="L"?"0 50%":l==="R"?"100% 50%":l==="T"?"50% 0":"50% 100%",target:i,targetDir:u,targetArrow:s,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})})}O(Zir,"addEdges");function Jir(t,e,r,n=[]){const i=O((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)}}),[o,s]=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=O(f=>f.filter(p=>!p.some(g=>l.has(g))),"dropOverlapping"),h=u(o),d=u(s);return n.forEach(f=>{f.members.length<2||(f.direction==="row"?h.push([...f.members]):d.push([...f.members]))}),{horizontal:h,vertical:d}}O(Jir,"getAlignments");function ear(t,e,r=[]){const n=[],i=e.getConfigField("iconSize"),a=e.getConfigField("idealEdgeLengthMultiplier"),o=a*i,s=new Set;r.forEach(h=>{for(let d=0;d`${h[0]},${h[1]}`,"posToStr"),u=O(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),s.has(`${v}|${A}`))return;n.push({[Uir[b]]:A,[Uir[bci(b)]]:v,gap:a*i})}})}}}}),n}O(ear,"getRelativeConstraints");function tar(t,e,r,n,i,{spatialMaps:a,groupAlignments:o}){return new Promise(s=>{const l=_t("body").append("div").attr("id","cy").attr("style","display:none"),u=rv({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(),Kir(r,u),qir(t,u,i),jir(e,u,i),Zir(n,u);const h=i.getLayoutHints(),d=Jir(i,a,o,h),f=ear(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}=LD(w),{parent:T}=LD(A);return S===T?g:m},edgeElasticity(x){const[w,A]=x.connectedNodes(),{parent:S}=LD(w),{parent:T}=LD(A);return S===T?v:.001},alignmentConstraint:d,relativePlacementConstraint:f});b.one("layoutstop",()=>{var w;function x(A,S,T,C){let k,E;const{x:_,y:P}=A,{x:L,y:R}=S;E=(C-P+(_-T)*(P-R)/(_-L))/Math.sqrt(1+Math.pow((P-R)/(_-L),2)),k=Math.sqrt(Math.pow(C-P,2)+Math.pow(T-_,2)-Math.pow(E,2));const D=Math.sqrt(Math.pow(L-_,2)+Math.pow(R-P,2));k=k/D;let M=(L-_)*(C-P)-(R-P)*(T-_);switch(!0){case M>=0:M=1;break;case M<0:M=-1;break}let I=(L-_)*(T-_)+(R-P)*(C-P);switch(!0){case I>=0:I=1;break;case I<0:I=-1;break}return E=Math.abs(E)*M,k=k*I,{distances:E,weights:k}}O(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:C,y:k}=A.target().position();if(S!==C&&T!==k){const E=A.sourceEndpoint(),_=A.targetEndpoint(),{sourceDir:P}=Hir(A),[L,R]=Vw(P)?[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(),hMe(y,()=>b.run())});try{hMe(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=>{ye.info("Ready",x),s(u)})})}O(tar,"layoutArchitecture");var Pci=O(async(t,e,r,n)=>{const i=n.db;i.setDiagramId(e);const a=i.getServices(),o=i.getJunctions(),s=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),h=nu(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 Mci(i,f,a,e),Ici(i,f,o,e);const g=await tar(a,o,s,l,i,u);await Dci(d,g,i,e),await Lci(p,g,i,e),Xir(i,g),iR(void 0,h,i.getConfigField("padding"),i.getConfigField("useMaxWidth"))},"draw"),Nci={draw:Pci},Bci={parser:Yir,get db(){return new Wir},renderer:Nci,styles:Rci};const $ci=Object.freeze(Object.defineProperty({__proto__:null,diagram:Bci},Symbol.toStringTag,{value:"Module"}));var rar="position frame",nar="frame positioned",dMe="position relation",iar="relation positioned",Fci=O(function(t){ye.debug("options str",t)},"setOptions"),zci=O(function(){return{}},"getOptions"),Uci=O(function(){aar(),_a()},"clear");function aar(){fMe={}}O(aar,"reset");var Vci=Jn.eventmodeling,Qci=O(()=>uo({...Vci,...Dr().eventmodeling}),"getConfig"),fMe={};function oar(){let t=Gci;const{ast:e}=fMe,r=pMe();if(!e)throw new Error("No data for EventModel");return e.frames.forEach((n,i)=>{const a=far(n,e.dataEntities,r);t=Kie(t,{$kind:rar,index:i,frame:n,textProps:a});let o;xar(n)?(ye.debug("source frame",n.sourceFrames),o=e.frames.filter(s=>n.sourceFrames.some(l=>l.$refText===s.name)),o.forEach(s=>{t=Kie(t,{$kind:dMe,index:i,frame:n,sourceFrame:s})})):t=Kie(t,{$kind:dMe,index:i,frame:n})}),t={...t,sortedSwimlanesArray:gMe(t.swimlanes)},t}O(oar,"getState");function sar(t){fMe.ast=t}O(sar,"setAst");var Gi={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 pMe(){return Gi}O(pMe,"getDiagramProps");var Gci={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function lar(t){const e=t.split(".");if(e.length===2)return e[0]}O(lar,"extractNamespace");function car(t){const e=t.split(".");return e.length===2?e[1]:t}O(car,"extractName");function uar(t,e){if(!(!e||e.length===0))return Object.values(t).find(r=>r.namespace===e)}O(uar,"findSwimlaneByNamespace");function Xie(t,e,r){return Math.max(e,...Object.keys(t).filter(n=>{const i=Number.parseInt(n);return i>e&&iNumber.parseInt(n)))+1}O(Xie,"findNextAvailableIndex");function har(t,e){const r=lar(t.entityIdentifier),n=uar(e,r);switch(t.modelEntityType){case"ui":case"pcr":case"processor":return n?{index:n.index,label:n.namespace||Gi.labelUiAutomation}:r?{index:Xie(e,0,100),label:Gi.labelUiAutomationPrefix+r}:{index:0,label:Gi.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return n?{index:n.index,label:n.namespace||Gi.labelCommandReadModel}:r?{index:Xie(e,100,200),label:Gi.labelCommandReadModelPrefix+r}:{index:100,label:Gi.labelCommandReadModel};case"evt":case"event":default:return n?{index:n.index,label:n.namespace||Gi.labelEvents}:r?{index:Xie(e,200,300),label:Gi.labelEventsPrefix+r}:{index:200,label:Gi.labelEvents}}}O(har,"calculateSwimlaneProps");function dar(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"}}}O(dar,"calculateEntityVisualProps");function far(t,e,r){const n=Dr(),i=li(car(t.entityIdentifier)??"",n);let a;const o={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let l=`${Y7(i,r.textMaxWidth,o)}`;if(t.dataInlineValue&&(a=t.dataInlineValue,a=a.substring(a.indexOf("{")+1),a=a.substring(0,a.lastIndexOf("}")-1),a=li(a,n),a=Y7(a,r.textMaxWidth,o),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=li(a,n),a=Y7(a,r.textMaxWidth,o),a=a.replaceAll(" "," "),a+="
")}const u=a!==void 0;u&&(l+=`

${a}`);const h={fontSize:o.fontSize,fontWeight:o.fontWeight,fontFamily:o.fontFamily},d=RX(l,h),f=u?d.width/3:d.width,p={content:l,width:f,height:d.height};return ye.debug(`[${t.name}] ${t.entityIdentifier} text`,p),p}O(far,"calculateTextProps");function par(t,e){const r=e,n=dar(r.frame),i={width:r.textProps.width+2*Gi.boxTextPadding,height:r.textProps.height+2*Gi.boxTextPadding};return[{$kind:nar,frame:r.frame,index:r.index,visual:n,dimension:i,textProps:r.textProps}]}O(par,"decidePositionFrame");function gar(t,e,r){return e===void 0?Gi.contentStartX:e.index===t.index&&t.r?t.r+Gi.boxPadding:r===void 0?Gi.contentStartX:r.r-Gi.boxOverlap+Gi.boxPadding}O(gar,"calculateX");function mar(t,e){const r=[...t.map(n=>n.r),e];return Math.max(...r)}O(mar,"calculateMaxRight");function gMe(t){return Object.values(t).sort((e,r)=>e.index-r.index)}O(gMe,"sortedSwimlanesArray");function yar(t,e){const r=e,n=har(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*Gi.swimlaneMinHeight+Gi.swimlaneGap,height:Gi.swimlaneMinHeight,maxHeight:Gi.swimlaneMinHeight};const a=t.boxes.length>0?t.boxes[t.boxes.length-1]:void 0,o=t.previousSwimlaneNumber!==void 0?t.swimlanes[t.previousSwimlaneNumber]:void 0,s={width:Math.max(Gi.boxMinWidth,Math.min(Gi.boxMaxWidth,r.dimension.width))+2*Gi.boxPadding,height:Math.max(Gi.boxMinHeight,Math.min(Gi.boxMaxHeight,r.dimension.height))+2*Gi.boxPadding},l=gar(i,o,a),u=l+s.width+Gi.boxPadding,h=mar(Object.values(t.swimlanes),u);i.r=l+s.width,i.maxHeight=Math.max(i.maxHeight,s.height),i.height=Math.max(Gi.swimlaneMinHeight,i.maxHeight)+2*Gi.swimlanePadding;const d={x:l,y:Gi.swimlanePadding+i.y,r:u,dimension:s,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=gMe(f.swimlanes);p.length>0&&(p[0].y=0);for(let g=1;g0}O(xar,"hasSourceFrame");function mMe(t,e){if(e!=null)return t.find(r=>r.frame.name===e.name)}O(mMe,"findBoxByFrame");function war(t,e,r){if(!(r<0))for(let n=r;n>=0;n--){const i=t[n];if(i.swimlane.index!==e)return i}}O(war,"findBoxByLineIndex");function Aar(t,e){const r=e;if(VJt(r.frame)||bar(r.index,r.frame))return[];const n=mMe(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=mMe(t.boxes,r.sourceFrame):i=war(t.boxes,n.swimlane.index,r.index-1),i===void 0?[]:[{$kind:iar,frame:r.frame,index:r.index,sourceBox:i,targetBox:n}]}O(Aar,"decidePositionRelation");function Sar(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]}}O(Sar,"evolveRelationPositioned");var Hci={[rar]:par,[dMe]:Aar},Wci={[nar]:yar,[iar]:Sar};function Tar(t,e){const r=Hci[e.$kind];if(r==null)return[];const n=r(t,e);return ye.debug("decided events",n),n}O(Tar,"decide");function Car(t,e){const r=e.reduce((n,i)=>{const a=Wci[i.$kind];return a==null?n:a(n,i)},t);return ye.debug("evolve events",{state:t,newState:r,events:e}),r}O(Car,"evolve");function Kie(t,e){const r=Tar(t,e);return Car(t,r)}O(Kie,"dispatch");var vMe={getConfig:Qci,setOptions:Fci,getOptions:zci,clear:Uci,setAccTitle:Ba,getAccTitle:oo,getAccDescription:lo,setAccDescription:so,setDiagramTitle:co,getDiagramTitle:$a,setAst:sar,getDiagramProps:pMe,getState:oar},Yci={parse:O(async t=>{const e=await Qp("eventmodeling",t);ye.debug(e),vMe.setAst(e),ah(e,vMe)},"parse")},yMe=Ye(),qci=yMe==null?void 0:yMe.eventmodeling;function Oar(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)}}O(Oar,"renderD3Box");function kar(t,e){return t>e}O(kar,"dirUpwards");function Ear(t,e,r,n){return i=>{const a=i.sourceBox.swimlane.y+e.swimlanePadding,o=i.targetBox.swimlane.y+e.swimlanePadding,s=kar(a,o),l=i.sourceBox.x+i.sourceBox.dimension.width*2/3,u=i.targetBox.x+i.targetBox.dimension.width/3;let h,d;ye.debug(`rendering relation up=${s} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),s?(h=a,d=o+i.targetBox.dimension.height):(h=a+i.sourceBox.dimension.height,d=o);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}`)}}O(Ear,"renderD3Relation");function _ar(t,e,r,n){return i=>{const a=t.append("g").attr("class","em-swimlane"),o=n.emSwimlaneBackgroundOdd??"rgb(250,250,250)",s=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",o).attr("stroke",s),a.append("text").attr("font-weight",r.swimlaneTextFontWeight).attr("x",30).attr("y",i.y+30).text(i.label)}}O(_ar,"renderD3Swimlane");var jci=O(function(t,e,r,n){if(ye.debug("in eventmodeling renderer",t+` +`,"id:",e,r),!qci)throw new Error("EventModeling config not found");const i=n.db,{themeVariables:a,eventmodeling:o}=Ye(),s=_t(`[id="${e}"]`),l=i.getDiagramProps(),u=i.getState(),h=`em-arrowhead-${e}`,d=a.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(_ar(s,u.maxR,l,a)),u.boxes.forEach(Oar(s,l)),u.relations.forEach(Ear(s,l,h,a)),s.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),Q1e(void 0,s,(o==null?void 0:o.padding)??30,o==null?void 0:o.useMaxWidth)},"draw"),Xci={draw:jci},Kci=O(t=>"","getStyles"),Zci=Kci,Jci={parser:Yci,db:vMe,renderer:Xci,styles:Zci};const eui=Object.freeze(Object.defineProperty({__proto__:null,diagram:Jci},Symbol.toStringTag,{value:"Module"}));var bMe=function(){var t=O(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],o=[1,20],s=[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:O(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:O(function(b,x,w,A,S,T,C){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:o,7:s,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:o,7:s,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:O(function(b,x){if(x.recoverable)this.trace(b);else{var w=new Error(b);throw w.hash=x,w}},"parseError"),parse:O(function(b){var x=this,w=[0],A=[],S=[null],T=[],C=this.table,k="",E=0,_=0,P=2,L=1,R=T.slice.call(arguments,1),D=Object.create(this.lexer),M={yy:{}};for(var I in this.yy)Object.prototype.hasOwnProperty.call(this.yy,I)&&(M.yy[I]=this.yy[I]);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(te){w.length=w.length-2*te,S.length=S.length-te,T.length=T.length-te}O(B,"popStack");function V(){var te;return te=A.pop()||D.lex()||L,typeof te!="number"&&(te instanceof Array&&(A=te,te=A.pop()),te=x.symbols_[te]||te),te}O(V,"lex");for(var z,U,Q,G,q={},Y,ne,X,J;;){if(U=w[w.length-1],this.defaultActions[U]?Q=this.defaultActions[U]:((z===null||typeof z>"u")&&(z=V()),Q=C[U]&&C[U][z]),typeof Q>"u"||!Q.length||!Q[0]){var ee="";J=[];for(Y in C[U])this.terminals_[Y]&&Y>P&&J.push("'"+this.terminals_[Y]+"'");D.showPosition?ee="Parse error on line "+(E+1)+`: `+D.showPosition()+` Expecting `+J.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:J})}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(ne=this.productions_[Q[1]][1],q.$=S[S.length-ne],q._$={first_line:T[T.length-(ne||1)].first_line,last_line:T[T.length-1].last_line,first_column:T[T.length-(ne||1)].first_column,last_column:T[T.length-1].last_column},F&&(q._$.range=[T[T.length-(ne||1)].range[0],T[T.length-1].range[1]]),G=this.performAction.apply(q,[k,_,E,M.yy,Q[1],S,T].concat(R)),typeof G<"u")return G;ne&&(w=w.slice(0,-1*ne*2),S=S.slice(0,-1*ne),T=T.slice(0,-1*ne)),w.push(this.productions_[Q[1]][0]),S.push(q.$),T.push(q._$),X=C[w[w.length-2]][w[w.length-1]],w.push(X);break;case 3:return!0}}return!0},"parse")},m=function(){var y={EOF:1,parseError:O(function(x,w){if(this.yy.parser)this.yy.parser.parseError(x,w);else throw new Error(x)},"parseError"),setInput:O(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:O(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:O(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:O(function(){return this._more=!0,this},"more"),reject:O(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:O(function(b){this.unput(this.match.slice(b))},"less"),pastInput:O(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:O(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:O(function(){var b=this.pastInput(),x=new Array(b.length+1).join("-");return b+this.upcomingInput()+` `+x+"^"},"showPosition"),test_match:O(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:O(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:O(function(){var x=this.next();return x||this.lex()},"lex"),begin:O(function(x){this.conditionStack.push(x)},"begin"),popState:O(function(){var x=this.conditionStack.length-1;return x>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(x){return x=this.conditionStack.length-1-Math.abs(x||0),x>=0?this.conditionStack[x]:"INITIAL"},"topState"),pushState:O(function(x){this.begin(x)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(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 O(v,"Parser"),v.prototype=g,g.Parser=v,new v}();bMe.parser=bMe;var Jci=bMe,eui=(bP=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,_a()}getRoot(){return this.root}addNode(e,r){const n=Xt.sanitizeText(r,Ye());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],co(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,o={text:n,children:[]};a.children.push(o),this.stack.push({level:i,node:o})}getAccTitle(){return oo()}setAccTitle(e){Ba(e)}getAccDescription(){return lo()}setAccDescription(e){so(e)}getDiagramTitle(){return $a()}setDiagramTitle(e){co(e)}},O(bP,"IshikawaDB"),bP),tui=14,ID=250,rui=30,nui=60,iui=5,Ear=82*Math.PI/180,_ar=Math.cos(Ear),Rar=Math.sin(Ear),Dar=O((t,e,r)=>{const n=t.node().getBBox(),i=n.width+e*2,a=n.height+e*2;jo(t,a,i,r),t.attr("viewBox",`${n.x-e} ${n.y-e} ${i} ${a}`)},"applyPaddedViewBox"),aui=O((t,e,r,n)=>{var M,I;const a=n.db.getRoot();if(!a)return;const o=Ye(),{look:s,handDrawnSeed:l,themeVariables:u}=o,h=a1(o.fontSize)[0]??tui,d=s==="handDrawn",f=a.children??[],p=((M=o.ishikawa)==null?void 0:M.diagramPadding)??20,g=((I=o.ishikawa)==null?void 0:I.useMaxWidth)??!1,m=nu(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:PD(v,w,A,w,A,"ishikawa-spine");if(oui(v,w,A,a.text,h,b),!f.length){d&&PD(v,w,A,w,A,"ishikawa-spine",b),Dar(m,p,g);return}w-=20;const T=f.filter((N,F)=>F%2===0),C=f.filter((N,F)=>F%2===1),k=Lar(T),E=Lar(C),_=k.total+E.total;let P=ID,L=ID;if(_>0){const N=ID*2,F=ID*.3;P=Math.max(F,N*(k.total/_)),L=Math.max(F,N*(E.total/_))}const R=h*2;P=Math.max(P,k.max*R),L=Math.max(L,E.max*R),A=Math.max(P,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)PD(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)}Dar(m,p,g)},"draw"),Lar=O(t=>{const e=O(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"),oui=O((t,e,r,n,i,a)=>{const o=Math.max(6,Math.floor(110/(i*.6))),s=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${r})`),l=Zie(s,Mar(n,o),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});s.insert(()=>p,":first-child").attr("class","ishikawa-head")}else s.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"),sui=O((t,e)=>{const r=[],n=[],i=O((a,o,s)=>{const l=e===-1?[...a].reverse():a;for(const u of l){const h=r.length,d=u.children??[];r.push({depth:s,text:Mar(u.text,15),parentIndex:o,childCount:d.length}),s%2===0?(n.push(h),d.length&&i(d,h,s+1)):(d.length&&i(d,h,s+1),n.push(h))}},"walk");return i(t,-1,2),{entries:r,yOrder:n}},"flattenTree"),lui=O((t,e,r,n,i,a,o)=>{const s=t.append("g").attr("class","ishikawa-label-group"),u=Zie(s,e,r,n+11*i,"ishikawa-label cause","middle",a).node().getBBox();if(o){const h=o.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:o.seed,fill:o.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:o.lineColor,strokeWidth:2});s.insert(()=>h,":first-child").attr("class","ishikawa-label-box")}else s.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"),xMe=O((t,e,r,n,i,a)=>{const o=Math.sqrt(n*n+i*i);if(o===0)return;const s=n/o,l=i/o,u=6,h=-l*u,d=s*u,f=e,p=r,g=`M ${f} ${p} L ${f-s*u*2+h} ${p-l*u*2+d} L ${f-s*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"),cui=O((t,e,r,n,i,a,o,s)=>{const l=e.children??[],u=a*(l.length?1:.2),h=-_ar*u,d=Rar*u*i,f=r+h,p=n+d;if(PD(t,r,n,f,p,"ishikawa-branch",s),s&&xMe(t,r,n,r-f,n-p,s),lui(t,e.text,f,p,i,o,s),!l.length)return;const{entries:g,yOrder:m}=sui(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=-_ar,w=Rar*i,A=i<0?"ishikawa-label up":"ishikawa-label down";for(const[S,T]of g.entries()){const C=y[S],k=b.get(T.parentIndex),E=t.append("g").attr("class","ishikawa-sub-group");let _=0,P=0,L=0;if(T.depth%2===0){const R=k.y1-k.y0;_=Iar(k.x0,k.x1,R?(C-k.y0)/R:.5),P=C,L=_-(T.childCount>0?nui+T.childCount*iui:rui),PD(E,_,C,L,C,"ishikawa-sub-branch",s),s&&xMe(E,_,C,1,0,s),Zie(E,T.text,L,C,"ishikawa-label align","end",o)}else{const R=k.childrenDrawn++;_=Iar(k.x0,k.x1,(k.childCount-R)/(k.childCount+1)),P=k.y0,L=_+x*((C-P)/w),PD(E,_,P,L,C,"ishikawa-sub-branch",s),s&&xMe(E,_,P,_-L,P-C,s),Zie(E,T.text,L,C,A,"end",o)}T.childCount>0&&b.set(S,{x0:_,y0:P,x1:L,y1:C,childCount:T.childCount,childrenDrawn:0})}},"drawBranch"),uui=O(t=>t.split(/|\n/),"splitLines"),Mar=O((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"),Zie=O((t,e,r,n,i,a,o)=>{const s=uui(e),l=o*1.05,u=t.append("text").attr("class",i).attr("text-anchor",a).attr("x",r).attr("y",n-(s.length-1)*l/2);for(const[h,d]of s.entries())u.append("tspan").attr("x",r).attr("dy",h===0?0:l).text(d);return u},"drawMultilineText"),Iar=O((t,e,r)=>t+(e-t)*r,"lerp"),PD=O((t,e,r,n,i,a,o)=>{if(o){const s=o.roughSvg.line(e,r,n,i,{roughness:1.5,seed:o.seed,stroke:o.lineColor,strokeWidth:2});t.append(()=>s).attr("class",a);return}return t.append("line").attr("class",a).attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i)},"drawLine"),hui={draw:aui},dui=O(t=>` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:O(function(){var x=this.next();return x||this.lex()},"lex"),begin:O(function(x){this.conditionStack.push(x)},"begin"),popState:O(function(){var x=this.conditionStack.length-1;return x>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(x){return x=this.conditionStack.length-1-Math.abs(x||0),x>=0?this.conditionStack[x]:"INITIAL"},"topState"),pushState:O(function(x){this.begin(x)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(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 O(v,"Parser"),v.prototype=g,g.Parser=v,new v}();bMe.parser=bMe;var tui=bMe,rui=(bP=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,_a()}getRoot(){return this.root}addNode(e,r){const n=Xt.sanitizeText(r,Ye());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],co(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,o={text:n,children:[]};a.children.push(o),this.stack.push({level:i,node:o})}getAccTitle(){return oo()}setAccTitle(e){Ba(e)}getAccDescription(){return lo()}setAccDescription(e){so(e)}getDiagramTitle(){return $a()}setDiagramTitle(e){co(e)}},O(bP,"IshikawaDB"),bP),nui=14,ID=250,iui=30,aui=60,oui=5,Rar=82*Math.PI/180,Dar=Math.cos(Rar),Lar=Math.sin(Rar),Mar=O((t,e,r)=>{const n=t.node().getBBox(),i=n.width+e*2,a=n.height+e*2;jo(t,a,i,r),t.attr("viewBox",`${n.x-e} ${n.y-e} ${i} ${a}`)},"applyPaddedViewBox"),sui=O((t,e,r,n)=>{var M,I;const a=n.db.getRoot();if(!a)return;const o=Ye(),{look:s,handDrawnSeed:l,themeVariables:u}=o,h=a1(o.fontSize)[0]??nui,d=s==="handDrawn",f=a.children??[],p=((M=o.ishikawa)==null?void 0:M.diagramPadding)??20,g=((I=o.ishikawa)==null?void 0:I.useMaxWidth)??!1,m=nu(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:PD(v,w,A,w,A,"ishikawa-spine");if(lui(v,w,A,a.text,h,b),!f.length){d&&PD(v,w,A,w,A,"ishikawa-spine",b),Mar(m,p,g);return}w-=20;const T=f.filter((N,F)=>F%2===0),C=f.filter((N,F)=>F%2===1),k=Iar(T),E=Iar(C),_=k.total+E.total;let P=ID,L=ID;if(_>0){const N=ID*2,F=ID*.3;P=Math.max(F,N*(k.total/_)),L=Math.max(F,N*(E.total/_))}const R=h*2;P=Math.max(P,k.max*R),L=Math.max(L,E.max*R),A=Math.max(P,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)PD(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)}Mar(m,p,g)},"draw"),Iar=O(t=>{const e=O(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"),lui=O((t,e,r,n,i,a)=>{const o=Math.max(6,Math.floor(110/(i*.6))),s=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${r})`),l=Zie(s,Par(n,o),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});s.insert(()=>p,":first-child").attr("class","ishikawa-head")}else s.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"),cui=O((t,e)=>{const r=[],n=[],i=O((a,o,s)=>{const l=e===-1?[...a].reverse():a;for(const u of l){const h=r.length,d=u.children??[];r.push({depth:s,text:Par(u.text,15),parentIndex:o,childCount:d.length}),s%2===0?(n.push(h),d.length&&i(d,h,s+1)):(d.length&&i(d,h,s+1),n.push(h))}},"walk");return i(t,-1,2),{entries:r,yOrder:n}},"flattenTree"),uui=O((t,e,r,n,i,a,o)=>{const s=t.append("g").attr("class","ishikawa-label-group"),u=Zie(s,e,r,n+11*i,"ishikawa-label cause","middle",a).node().getBBox();if(o){const h=o.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:o.seed,fill:o.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:o.lineColor,strokeWidth:2});s.insert(()=>h,":first-child").attr("class","ishikawa-label-box")}else s.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"),xMe=O((t,e,r,n,i,a)=>{const o=Math.sqrt(n*n+i*i);if(o===0)return;const s=n/o,l=i/o,u=6,h=-l*u,d=s*u,f=e,p=r,g=`M ${f} ${p} L ${f-s*u*2+h} ${p-l*u*2+d} L ${f-s*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"),hui=O((t,e,r,n,i,a,o,s)=>{const l=e.children??[],u=a*(l.length?1:.2),h=-Dar*u,d=Lar*u*i,f=r+h,p=n+d;if(PD(t,r,n,f,p,"ishikawa-branch",s),s&&xMe(t,r,n,r-f,n-p,s),uui(t,e.text,f,p,i,o,s),!l.length)return;const{entries:g,yOrder:m}=cui(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=-Dar,w=Lar*i,A=i<0?"ishikawa-label up":"ishikawa-label down";for(const[S,T]of g.entries()){const C=y[S],k=b.get(T.parentIndex),E=t.append("g").attr("class","ishikawa-sub-group");let _=0,P=0,L=0;if(T.depth%2===0){const R=k.y1-k.y0;_=Nar(k.x0,k.x1,R?(C-k.y0)/R:.5),P=C,L=_-(T.childCount>0?aui+T.childCount*oui:iui),PD(E,_,C,L,C,"ishikawa-sub-branch",s),s&&xMe(E,_,C,1,0,s),Zie(E,T.text,L,C,"ishikawa-label align","end",o)}else{const R=k.childrenDrawn++;_=Nar(k.x0,k.x1,(k.childCount-R)/(k.childCount+1)),P=k.y0,L=_+x*((C-P)/w),PD(E,_,P,L,C,"ishikawa-sub-branch",s),s&&xMe(E,_,P,_-L,P-C,s),Zie(E,T.text,L,C,A,"end",o)}T.childCount>0&&b.set(S,{x0:_,y0:P,x1:L,y1:C,childCount:T.childCount,childrenDrawn:0})}},"drawBranch"),dui=O(t=>t.split(/|\n/),"splitLines"),Par=O((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"),Zie=O((t,e,r,n,i,a,o)=>{const s=dui(e),l=o*1.05,u=t.append("text").attr("class",i).attr("text-anchor",a).attr("x",r).attr("y",n-(s.length-1)*l/2);for(const[h,d]of s.entries())u.append("tspan").attr("x",r).attr("dy",h===0?0:l).text(d);return u},"drawMultilineText"),Nar=O((t,e,r)=>t+(e-t)*r,"lerp"),PD=O((t,e,r,n,i,a,o)=>{if(o){const s=o.roughSvg.line(e,r,n,i,{roughness:1.5,seed:o.seed,stroke:o.lineColor,strokeWidth:2});t.append(()=>s).attr("class",a);return}return t.append("line").attr("class",a).attr("x1",e).attr("y1",r).attr("x2",n).attr("y2",i)},"drawLine"),fui={draw:sui},pui=O(t=>` .ishikawa .ishikawa-spine, .ishikawa .ishikawa-branch, .ishikawa .ishikawa-sub-branch { @@ -3698,18 +3698,18 @@ Expecting `+J.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ee="Parse error o .ishikawa .ishikawa-label.down { dominant-baseline: hanging; } -`,"getStyles"),fui=dui,pui={parser:Jci,get db(){return new eui},renderer:hui,styles:fui};const gui=Object.freeze(Object.defineProperty({__proto__:null,diagram:pui},Symbol.toStringTag,{value:"Module"})),Par=1e-10;function Jie(t,e){const r=vui(t),n=r.filter(s=>mui(s,t));let i=0,a=0;const o=[];if(n.length>1){const s=Bar(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&&(o.push(f),i+=wMe(f.circle.radius,f.width),l=h)}}else{let s=t[0];for(let u=1;uMath.abs(s.radius-t[u].radius)){l=!0;break}l?i=a=0:(i=s.radius*s.radius*Math.PI,o.push({circle:s,p1:{x:s.x,y:s.y+s.radius},p2:{x:s.x-Par,y:s.y+s.radius},width:s.radius*2,large:!0,sweep:!0}))}return a/=2,e&&(e.area=i+a,e.arcArea=i,e.polygonArea=a,e.arcs=o,e.innerPoints=n,e.intersectionPoints=r),i+a}function mui(t,e){return e.every(r=>fd(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 wMe(t,n)+wMe(e,i)}function Nar(t,e){const r=fd(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),o=Math.sqrt(n*n-a*a),s=t.x+a*(e.x-t.x)/r,l=t.y+a*(e.y-t.y)/r,u=-(e.y-t.y)*(o/r),h=-(e.x-t.x)*(o/r);return[{x:s+u,y:l-h},{x:s-u,y:l+h}]}function Bar(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 yui(t,e,r,n){n=n||{};const i=n.maxIterations||100,a=n.tolerance||1e-10,o=t(e),s=t(r);let l=r-e;if(o*s>0)throw"Initial bisect points must have opposite signs";if(o===0)return e;if(s===0)return r;for(let u=0;u=0&&(e=h),Math.abs(l)SMe(e))}function ND(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=C.slice();return k.fx=C.fx,k.id=C.id,k});T.sort((C,k)=>C.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?(Ob(x,1+h,y,-h,S),x.fx=t(x),x.fx=1)break;for(let C=1;Cs+a*i*l||u>=v)m=i;else{if(Math.abs(d)<=-o*l)return i;d*(m-g)>=0&&(m=g),g=i,v=u}return 0}for(let g=0;g<10;++g){if(Ob(n.x,1,r.x,i,e),u=n.fx=t(n.x,n.fxprime),d=ND(n.fxprime,e),u>s+a*i*l||g&&u>=h)return p(f,i,h);if(Math.abs(d)<=-o*l)return i;if(d>=0)return p(i,f,u);h=u,f=i,i*=2}return i}function xui(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 o,s,l=1,u;r=r||{},u=r.maxIterations||e.length*20,n.fx=t(n.x,n.fxprime),o=n.fxprime.slice(),CMe(o,n.fxprime,-1);for(let h=0;h{const d={};for(let f=0;fAMe(t,e,n)-r,0,t+e)}function wui(t,e={}){const r=e.distinct,n=t.map(s=>Object.assign({},s));function i(s){return s.join(";")}if(r){const s=new Map;for(const l of n)for(let u=0;us===l?0:sa.sets.length===2).forEach(a=>{const o=r[a.sets[0]],s=r[a.sets[1]],l=Math.sqrt(e[o].size/Math.PI),u=Math.sqrt(e[s].size/Math.PI),h=OMe(l,u,a.size);n[o][s]=n[s][o]=h;let d=0;a.size+1e-10>=Math.min(e[o].size,e[s].size)?d=1:a.size<=1e-10&&(d=-1),i[o][s]=i[s][o]=d}),{distances:n,constraints:i}}function Sui(t,e,r,n){for(let a=0;a0&&g<=d||f<0&&g>=d||(i+=2*m*m,e[2*a]+=4*m*(o-u),e[2*a+1]+=4*m*(s-h),e[2*l]+=4*m*(u-o),e[2*l+1]+=4*m*(h-s))}}return i}function Tui(t,e={}){let r=Oui(t,e);const n=e.lossFunction||BD;if(t.length>=8){const i=Cui(t,e),a=n(i,t),o=n(r,t);a+1e-8f.map(p=>p/s));const l=(f,p)=>Sui(f,p,a,o);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+Uar>=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[o]));const a=n.weight!=null?n.weight:1;r+=a*(i-n.size)*(i-n.size)}return r}function Var(t,e){let r=0;for(const n of e){if(n.sets.length===1)continue;let i;if(n.sets.length===2){const s=t[n.sets[0]],l=t[n.sets[1]];i=AMe(s.radius,l.radius,fd(s,l))}else i=Jie(n.sets.map(s=>t[s]));const a=n.weight!=null?n.weight:1,o=Math.log((i+1)/(n.size+1));r+=a*o*o}return r}function kui(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 o of t)o.x-=i,o.y-=a}if(t.length===2&&fd(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-e,a=Math.cos(i),o=Math.sin(i);for(const s of t){const l=s.x,u=s.y;s.x=a*l-o*u,s.y=o*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 o of t){var n=(o.x+a*o.y)/(1+a*a);o.x=2*n-o.x,o.y=2*n*a-o.y}}}}function Eui(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 o=e(i),s=e(a);o.parent=s}for(let i=0;i{delete i.parent}),Array.from(n.values())}function kMe(t){const e=r=>{const n=t.reduce((a,o)=>Math.max(a,o[r]+o.radius),Number.NEGATIVE_INFINITY),i=t.reduce((a,o)=>Math.min(a,o[r]-o.radius),Number.POSITIVE_INFINITY);return{max:n,min:i}};return{xRange:e("x"),yRange:e("y")}}function Qar(t,e,r){e==null&&(e=Math.PI/2);let n=War(t).map(u=>Object.assign({},u));const i=Eui(n);for(const u of i){kui(u,e,r);const h=kMe(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 o=(a.xRange.max-a.xRange.min)/50;function s(u,h,d){if(!u)return;const f=u.bounds;let p,g;if(h)p=a.xRange.max-f.xRange.min+o;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+o;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-o.min)*h,y:n+f+(p.y-s.min)*h,setid:p.setid})))}function Har(t){const e={};for(const r of t)e[r.setid]=r;return e}function War(t){return Object.keys(t).map(r=>Object.assign(t[r],{setid:r}))}function _ui(t={}){let e=!1,r=600,n=350,i=15,a=1e3,o=Math.PI/2,s=!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 C=v[T]=y[b];return b+=1,b>=y.length&&(b=0),C},w=zar,A=BD;function S(T){let C=T.datum();const k=new Set;C.forEach(Y=>{Y.size==0&&Y.sets.length==1&&k.add(Y.sets[0])}),C=C.filter(Y=>!Y.sets.some(ne=>k.has(ne)));let E={},_={};if(C.length>0){let Y=w(C,{lossFunction:A,distinct:p});s&&(Y=Qar(Y,o,f)),E=Gar(Y,r,n,i,l),_=qar(E,C,m)}const P={};C.forEach(Y=>{Y.label&&(P[Y.sets]=Y.label)});function L(Y){if(Y.sets in P)return P[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 ne=this.getAttribute("d");Y.sets.length==1&&ne&&!p&&(M=!0,D[Y.sets[0]]=Lui(ne))});function I(Y){return ne=>{const X=Y.sets.map(J=>{let ee=D[J],te=E[J];return ee||(ee={x:r/2,y:n/2,radius:1}),te||(te={x:r/2,y:n/2,radius:1}),{x:ee.x*(1-ne)+te.x*ne,y:ee.y*(1-ne)+te.y*ne,radius:ee.radius*(1-ne)+te.radius*ne}});return Kar(X,g)}}const N=R.selectAll(".venn-area").data(C,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",I)):U.selectAll("path").attr("d",Y=>Kar(Y.sets.map(ne=>E[ne])),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",EMe(E,L)):Q.each("end",EMe(E,L)):Q.each(EMe(E,L)));const G=z(N.exit()).remove();typeof N.transition=="function"&&G.selectAll("path").attrTween("d",I);const q=G.selectAll("text").attr("x",r/2).attr("y",n/2);return d!==null&&(V.style("font-size","0px"),Q.style("font-size",d),q.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?(s=T,S):s},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?(o=T,S):o},S.orientationOrder=function(T){return arguments.length?(f=T,S):f},S.lossFunction=function(T){return arguments.length?(A=T==="default"?BD:T==="logRatio"?Var:T,S):A},S}function EMe(t,e){return function(r){const n=this,i=t[r.sets[0]].radius||50,a=e(r)||"",o=a.split(/\s+/).reverse(),l=(a.length+o.length)/3;let u=o.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=o.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 _Me(t,e,r){let n=e[0].radius-fd(e[0],t);for(let i=1;i=a&&(i=n[h],a=d)}const o=Far(h=>-1*_Me({x:h[0],y:h[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,s={x:r?0:o[0],y:o[1]};let l=!0;for(const h of t)if(fd(s,h)>h.radius){l=!1;break}for(const h of e)if(fd(s,h)h.p1))}function Rui(t){const e={},r=Object.keys(t);for(const n of r)e[n]=[];for(let n=0;n0&&console.log("WARNING: area "+o+" not represented on screen")}return n}function Dui(t,e,r){const n=[];return n.push(` +`,"getStyles"),gui=pui,mui={parser:tui,get db(){return new rui},renderer:fui,styles:gui};const vui=Object.freeze(Object.defineProperty({__proto__:null,diagram:mui},Symbol.toStringTag,{value:"Module"})),Bar=1e-10;function Jie(t,e){const r=bui(t),n=r.filter(s=>yui(s,t));let i=0,a=0;const o=[];if(n.length>1){const s=Far(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&&(o.push(f),i+=wMe(f.circle.radius,f.width),l=h)}}else{let s=t[0];for(let u=1;uMath.abs(s.radius-t[u].radius)){l=!0;break}l?i=a=0:(i=s.radius*s.radius*Math.PI,o.push({circle:s,p1:{x:s.x,y:s.y+s.radius},p2:{x:s.x-Bar,y:s.y+s.radius},width:s.radius*2,large:!0,sweep:!0}))}return a/=2,e&&(e.area=i+a,e.arcArea=i,e.polygonArea=a,e.arcs=o,e.innerPoints=n,e.intersectionPoints=r),i+a}function yui(t,e){return e.every(r=>fd(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 wMe(t,n)+wMe(e,i)}function $ar(t,e){const r=fd(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),o=Math.sqrt(n*n-a*a),s=t.x+a*(e.x-t.x)/r,l=t.y+a*(e.y-t.y)/r,u=-(e.y-t.y)*(o/r),h=-(e.x-t.x)*(o/r);return[{x:s+u,y:l-h},{x:s-u,y:l+h}]}function Far(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 xui(t,e,r,n){n=n||{};const i=n.maxIterations||100,a=n.tolerance||1e-10,o=t(e),s=t(r);let l=r-e;if(o*s>0)throw"Initial bisect points must have opposite signs";if(o===0)return e;if(s===0)return r;for(let u=0;u=0&&(e=h),Math.abs(l)SMe(e))}function ND(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=C.slice();return k.fx=C.fx,k.id=C.id,k});T.sort((C,k)=>C.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?(Ob(x,1+h,y,-h,S),x.fx=t(x),x.fx=1)break;for(let C=1;Cs+a*i*l||u>=v)m=i;else{if(Math.abs(d)<=-o*l)return i;d*(m-g)>=0&&(m=g),g=i,v=u}return 0}for(let g=0;g<10;++g){if(Ob(n.x,1,r.x,i,e),u=n.fx=t(n.x,n.fxprime),d=ND(n.fxprime,e),u>s+a*i*l||g&&u>=h)return p(f,i,h);if(Math.abs(d)<=-o*l)return i;if(d>=0)return p(i,f,u);h=u,f=i,i*=2}return i}function Aui(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 o,s,l=1,u;r=r||{},u=r.maxIterations||e.length*20,n.fx=t(n.x,n.fxprime),o=n.fxprime.slice(),CMe(o,n.fxprime,-1);for(let h=0;h{const d={};for(let f=0;fAMe(t,e,n)-r,0,t+e)}function Sui(t,e={}){const r=e.distinct,n=t.map(s=>Object.assign({},s));function i(s){return s.join(";")}if(r){const s=new Map;for(const l of n)for(let u=0;us===l?0:sa.sets.length===2).forEach(a=>{const o=r[a.sets[0]],s=r[a.sets[1]],l=Math.sqrt(e[o].size/Math.PI),u=Math.sqrt(e[s].size/Math.PI),h=OMe(l,u,a.size);n[o][s]=n[s][o]=h;let d=0;a.size+1e-10>=Math.min(e[o].size,e[s].size)?d=1:a.size<=1e-10&&(d=-1),i[o][s]=i[s][o]=d}),{distances:n,constraints:i}}function Cui(t,e,r,n){for(let a=0;a0&&g<=d||f<0&&g>=d||(i+=2*m*m,e[2*a]+=4*m*(o-u),e[2*a+1]+=4*m*(s-h),e[2*l]+=4*m*(u-o),e[2*l+1]+=4*m*(h-s))}}return i}function Oui(t,e={}){let r=Eui(t,e);const n=e.lossFunction||BD;if(t.length>=8){const i=kui(t,e),a=n(i,t),o=n(r,t);a+1e-8f.map(p=>p/s));const l=(f,p)=>Cui(f,p,a,o);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+Qar>=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[o]));const a=n.weight!=null?n.weight:1;r+=a*(i-n.size)*(i-n.size)}return r}function Gar(t,e){let r=0;for(const n of e){if(n.sets.length===1)continue;let i;if(n.sets.length===2){const s=t[n.sets[0]],l=t[n.sets[1]];i=AMe(s.radius,l.radius,fd(s,l))}else i=Jie(n.sets.map(s=>t[s]));const a=n.weight!=null?n.weight:1,o=Math.log((i+1)/(n.size+1));r+=a*o*o}return r}function _ui(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 o of t)o.x-=i,o.y-=a}if(t.length===2&&fd(t[0],t[1])1){const i=Math.atan2(t[1].x,t[1].y)-e,a=Math.cos(i),o=Math.sin(i);for(const s of t){const l=s.x,u=s.y;s.x=a*l-o*u,s.y=o*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 o of t){var n=(o.x+a*o.y)/(1+a*a);o.x=2*n-o.x,o.y=2*n*a-o.y}}}}function Rui(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 o=e(i),s=e(a);o.parent=s}for(let i=0;i{delete i.parent}),Array.from(n.values())}function kMe(t){const e=r=>{const n=t.reduce((a,o)=>Math.max(a,o[r]+o.radius),Number.NEGATIVE_INFINITY),i=t.reduce((a,o)=>Math.min(a,o[r]-o.radius),Number.POSITIVE_INFINITY);return{max:n,min:i}};return{xRange:e("x"),yRange:e("y")}}function Har(t,e,r){e==null&&(e=Math.PI/2);let n=qar(t).map(u=>Object.assign({},u));const i=Rui(n);for(const u of i){_ui(u,e,r);const h=kMe(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 o=(a.xRange.max-a.xRange.min)/50;function s(u,h,d){if(!u)return;const f=u.bounds;let p,g;if(h)p=a.xRange.max-f.xRange.min+o;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+o;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-o.min)*h,y:n+f+(p.y-s.min)*h,setid:p.setid})))}function Yar(t){const e={};for(const r of t)e[r.setid]=r;return e}function qar(t){return Object.keys(t).map(r=>Object.assign(t[r],{setid:r}))}function Dui(t={}){let e=!1,r=600,n=350,i=15,a=1e3,o=Math.PI/2,s=!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 C=v[T]=y[b];return b+=1,b>=y.length&&(b=0),C},w=Var,A=BD;function S(T){let C=T.datum();const k=new Set;C.forEach(Y=>{Y.size==0&&Y.sets.length==1&&k.add(Y.sets[0])}),C=C.filter(Y=>!Y.sets.some(ne=>k.has(ne)));let E={},_={};if(C.length>0){let Y=w(C,{lossFunction:A,distinct:p});s&&(Y=Har(Y,o,f)),E=War(Y,r,n,i,l),_=Xar(E,C,m)}const P={};C.forEach(Y=>{Y.label&&(P[Y.sets]=Y.label)});function L(Y){if(Y.sets in P)return P[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 ne=this.getAttribute("d");Y.sets.length==1&&ne&&!p&&(M=!0,D[Y.sets[0]]=Iui(ne))});function I(Y){return ne=>{const X=Y.sets.map(J=>{let ee=D[J],te=E[J];return ee||(ee={x:r/2,y:n/2,radius:1}),te||(te={x:r/2,y:n/2,radius:1}),{x:ee.x*(1-ne)+te.x*ne,y:ee.y*(1-ne)+te.y*ne,radius:ee.radius*(1-ne)+te.radius*ne}});return Jar(X,g)}}const N=R.selectAll(".venn-area").data(C,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",I)):U.selectAll("path").attr("d",Y=>Jar(Y.sets.map(ne=>E[ne])),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",EMe(E,L)):Q.each("end",EMe(E,L)):Q.each(EMe(E,L)));const G=z(N.exit()).remove();typeof N.transition=="function"&&G.selectAll("path").attrTween("d",I);const q=G.selectAll("text").attr("x",r/2).attr("y",n/2);return d!==null&&(V.style("font-size","0px"),Q.style("font-size",d),q.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?(s=T,S):s},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?(o=T,S):o},S.orientationOrder=function(T){return arguments.length?(f=T,S):f},S.lossFunction=function(T){return arguments.length?(A=T==="default"?BD:T==="logRatio"?Gar:T,S):A},S}function EMe(t,e){return function(r){const n=this,i=t[r.sets[0]].radius||50,a=e(r)||"",o=a.split(/\s+/).reverse(),l=(a.length+o.length)/3;let u=o.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=o.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 _Me(t,e,r){let n=e[0].radius-fd(e[0],t);for(let i=1;i=a&&(i=n[h],a=d)}const o=Uar(h=>-1*_Me({x:h[0],y:h[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,s={x:r?0:o[0],y:o[1]};let l=!0;for(const h of t)if(fd(s,h)>h.radius){l=!1;break}for(const h of e)if(fd(s,h)h.p1))}function Lui(t){const e={},r=Object.keys(t);for(const n of r)e[n]=[];for(let n=0;n0&&console.log("WARNING: area "+o+" not represented on screen")}return n}function Mui(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 Lui(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}function jar(t){if(t.length===0)return[];const e={};return Jie(t,e),e.arcs}function Xar(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 Dui(n(a.x),n(a.y),n(a.radius))}const i=[` +a`,r,r,0,1,0,-r*2,0),n.join(" ")}function Iui(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}function Kar(t){if(t.length===0)return[];const e={};return Jie(t,e),e.arcs}function Zar(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 Mui(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 o=n(a.circle.radius);i.push(` -A`,o,o,0,a.large?1:0,a.sweep?1:0,n(a.p1.x),n(a.p1.y))}return i.join(" ")}function Kar(t,e){return Xar(jar(t),e)}function Mui(t,e={}){const{lossFunction:r,layoutFunction:n=zar,normalize:i=!0,orientation:a=Math.PI/2,orientationOrder:o,width:s=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?BD:r==="logRatio"?Var:r,distinct:f});i&&(g=Qar(g,a,o));const m=Gar(g,s,l,u,h),v=qar(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(C=>y.get(C)),S=jar(A),T=Xar(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 RMe=function(){var t=O(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],o=[1,31],s=[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:O(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:O(function(x,w,A,S,T,C,k){var E=C.length-1;switch(T){case 1:return C[E-1];case 2:case 3:case 4:this.$=[];break;case 5:C[E-1].push(C[E]),this.$=C[E-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=C[E];break;case 8:S.setDiagramTitle(C[E].substr(6)),this.$=C[E].substr(6);break;case 9:S.addSubsetData([C[E]],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 10:S.addSubsetData([C[E-1]],C[E],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 11:S.addSubsetData([C[E-2]],void 0,parseFloat(C[E])),S.setIndentMode&&S.setIndentMode(!0);break;case 12:S.addSubsetData([C[E-3]],C[E-2],parseFloat(C[E])),S.setIndentMode&&S.setIndentMode(!0);break;case 13:if(C[E].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(C[E]),S.addSubsetData(C[E],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 14:if(C[E-1].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(C[E-1]),S.addSubsetData(C[E-1],C[E],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 15:if(C[E-2].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(C[E-2]),S.addSubsetData(C[E-2],void 0,parseFloat(C[E])),S.setIndentMode&&S.setIndentMode(!0);break;case 16:if(C[E-3].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(C[E-3]),S.addSubsetData(C[E-3],C[E-2],parseFloat(C[E])),S.setIndentMode&&S.setIndentMode(!0);break;case 17:case 18:case 19:S.addTextData(C[E-1],C[E],void 0);break;case 20:case 21:S.addTextData(C[E-2],C[E-1],C[E]);break;case 23:S.addStyleData(C[E-1],C[E]);break;case 24:case 25:case 26:var _=S.getCurrentSets();if(!_)throw new Error("text requires set");S.addTextData(_,C[E],void 0);break;case 27:case 28:var _=S.getCurrentSets();if(!_)throw new Error("text requires set");S.addTextData(_,C[E-1],C[E]);break;case 29:case 41:this.$=[C[E]];break;case 30:case 42:this.$=[...C[E-2],C[E]];break;case 31:this.$=[C[E-2],C[E]];break;case 33:this.$=C[E].join(" ");break;case 34:this.$=[C[E]];break;case 35:C[E-1].push(C[E]),this.$=C[E-1];break;case 43:case 44:this.$=C[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:o}),t(a,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:o},t(r,[2,22]),t(r,[2,24],{14:[1,35]}),t(r,[2,25],{14:[1,36]}),t(r,[2,26]),{20:s,25:37,26:38,27:o},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:s,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:O(function(x,w){if(w.recoverable)this.trace(x);else{var A=new Error(x);throw A.hash=w,A}},"parseError"),parse:O(function(x){var w=this,A=[0],S=[],T=[null],C=[],k=this.table,E="",_=0,P=0,L=2,R=1,D=C.slice.call(arguments,1),M=Object.create(this.lexer),I={yy:{}};for(var N in this.yy)Object.prototype.hasOwnProperty.call(this.yy,N)&&(I.yy[N]=this.yy[N]);M.setInput(x,I.yy),I.yy.lexer=M,I.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var F=M.yylloc;C.push(F);var B=M.options&&M.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function V(pe){A.length=A.length-2*pe,T.length=T.length-pe,C.length=C.length-pe}O(V,"popStack");function z(){var pe;return pe=S.pop()||M.lex()||R,typeof pe!="number"&&(pe instanceof Array&&(S=pe,pe=S.pop()),pe=w.symbols_[pe]||pe),pe}O(z,"lex");for(var U,Q,G,q,Y={},ne,X,J,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 te="";ee=[];for(ne in k[Q])this.terminals_[ne]&&ne>L&&ee.push("'"+this.terminals_[ne]+"'");M.showPosition?te="Parse error on line "+(_+1)+`: +A`,o,o,0,a.large?1:0,a.sweep?1:0,n(a.p1.x),n(a.p1.y))}return i.join(" ")}function Jar(t,e){return Zar(Kar(t),e)}function Pui(t,e={}){const{lossFunction:r,layoutFunction:n=Var,normalize:i=!0,orientation:a=Math.PI/2,orientationOrder:o,width:s=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?BD:r==="logRatio"?Gar:r,distinct:f});i&&(g=Har(g,a,o));const m=War(g,s,l,u,h),v=Xar(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(C=>y.get(C)),S=Kar(A),T=Zar(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 RMe=function(){var t=O(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],o=[1,31],s=[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:O(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:O(function(x,w,A,S,T,C,k){var E=C.length-1;switch(T){case 1:return C[E-1];case 2:case 3:case 4:this.$=[];break;case 5:C[E-1].push(C[E]),this.$=C[E-1];break;case 6:this.$=[];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:this.$=C[E];break;case 8:S.setDiagramTitle(C[E].substr(6)),this.$=C[E].substr(6);break;case 9:S.addSubsetData([C[E]],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 10:S.addSubsetData([C[E-1]],C[E],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 11:S.addSubsetData([C[E-2]],void 0,parseFloat(C[E])),S.setIndentMode&&S.setIndentMode(!0);break;case 12:S.addSubsetData([C[E-3]],C[E-2],parseFloat(C[E])),S.setIndentMode&&S.setIndentMode(!0);break;case 13:if(C[E].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(C[E]),S.addSubsetData(C[E],void 0,void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 14:if(C[E-1].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(C[E-1]),S.addSubsetData(C[E-1],C[E],void 0),S.setIndentMode&&S.setIndentMode(!0);break;case 15:if(C[E-2].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(C[E-2]),S.addSubsetData(C[E-2],void 0,parseFloat(C[E])),S.setIndentMode&&S.setIndentMode(!0);break;case 16:if(C[E-3].length<2)throw new Error("union requires multiple identifiers");S.validateUnionIdentifiers&&S.validateUnionIdentifiers(C[E-3]),S.addSubsetData(C[E-3],C[E-2],parseFloat(C[E])),S.setIndentMode&&S.setIndentMode(!0);break;case 17:case 18:case 19:S.addTextData(C[E-1],C[E],void 0);break;case 20:case 21:S.addTextData(C[E-2],C[E-1],C[E]);break;case 23:S.addStyleData(C[E-1],C[E]);break;case 24:case 25:case 26:var _=S.getCurrentSets();if(!_)throw new Error("text requires set");S.addTextData(_,C[E],void 0);break;case 27:case 28:var _=S.getCurrentSets();if(!_)throw new Error("text requires set");S.addTextData(_,C[E-1],C[E]);break;case 29:case 41:this.$=[C[E]];break;case 30:case 42:this.$=[...C[E-2],C[E]];break;case 31:this.$=[C[E-2],C[E]];break;case 33:this.$=C[E].join(" ");break;case 34:this.$=[C[E]];break;case 35:C[E-1].push(C[E]),this.$=C[E-1];break;case 43:case 44:this.$=C[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:o}),t(a,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:o},t(r,[2,22]),t(r,[2,24],{14:[1,35]}),t(r,[2,25],{14:[1,36]}),t(r,[2,26]),{20:s,25:37,26:38,27:o},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:s,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:O(function(x,w){if(w.recoverable)this.trace(x);else{var A=new Error(x);throw A.hash=w,A}},"parseError"),parse:O(function(x){var w=this,A=[0],S=[],T=[null],C=[],k=this.table,E="",_=0,P=0,L=2,R=1,D=C.slice.call(arguments,1),M=Object.create(this.lexer),I={yy:{}};for(var N in this.yy)Object.prototype.hasOwnProperty.call(this.yy,N)&&(I.yy[N]=this.yy[N]);M.setInput(x,I.yy),I.yy.lexer=M,I.yy.parser=this,typeof M.yylloc>"u"&&(M.yylloc={});var F=M.yylloc;C.push(F);var B=M.options&&M.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function V(pe){A.length=A.length-2*pe,T.length=T.length-pe,C.length=C.length-pe}O(V,"popStack");function z(){var pe;return pe=S.pop()||M.lex()||R,typeof pe!="number"&&(pe instanceof Array&&(S=pe,pe=S.pop()),pe=w.symbols_[pe]||pe),pe}O(z,"lex");for(var U,Q,G,q,Y={},ne,X,J,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 te="";ee=[];for(ne in k[Q])this.terminals_[ne]&&ne>L&&ee.push("'"+this.terminals_[ne]+"'");M.showPosition?te="Parse error on line "+(_+1)+`: `+M.showPosition()+` Expecting `+ee.join(", ")+", got '"+(this.terminals_[U]||U)+"'":te="Parse error on line "+(_+1)+": Unexpected "+(U==R?"end of input":"'"+(this.terminals_[U]||U)+"'"),this.parseError(te,{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),C.push(M.yylloc),A.push(G[1]),U=null,P=M.yyleng,E=M.yytext,_=M.yylineno,F=M.yylloc;break;case 2:if(X=this.productions_[G[1]][1],Y.$=T[T.length-X],Y._$={first_line:C[C.length-(X||1)].first_line,last_line:C[C.length-1].last_line,first_column:C[C.length-(X||1)].first_column,last_column:C[C.length-1].last_column},B&&(Y._$.range=[C[C.length-(X||1)].range[0],C[C.length-1].range[1]]),q=this.performAction.apply(Y,[E,P,_,I.yy,G[1],T,C].concat(D)),typeof q<"u")return q;X&&(A=A.slice(0,-1*X*2),T=T.slice(0,-1*X),C=C.slice(0,-1*X)),A.push(this.productions_[G[1]][0]),T.push(Y.$),C.push(Y._$),J=k[A[A.length-2]][A[A.length-1]],A.push(J);break;case 3:return!0}}return!0},"parse")},v=function(){var b={EOF:1,parseError:O(function(w,A){if(this.yy.parser)this.yy.parser.parseError(w,A);else throw new Error(w)},"parseError"),setInput:O(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:O(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:O(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:O(function(){return this._more=!0,this},"more"),reject:O(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:O(function(x){this.unput(this.match.slice(x))},"less"),pastInput:O(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:O(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:O(function(){var x=this.pastInput(),w=new Array(x.length+1).join("-");return x+this.upcomingInput()+` `+w+"^"},"showPosition"),test_match:O(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 C in T)this[C]=T[C];return!1}return!1},"test_match"),next:O(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(),C=0;Cw[0].length)){if(w=A,S=C,this.options.backtrack_lexer){if(x=this.test_match(A,T[C]),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:O(function(){var w=this.next();return w||this.lex()},"lex"),begin:O(function(w){this.conditionStack.push(w)},"begin"),popState:O(function(){var w=this.conditionStack.length-1;return w>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(w){return w=this.conditionStack.length-1-Math.abs(w||0),w>=0?this.conditionStack[w]:"INITIAL"},"topState"),pushState:O(function(w){this.begin(w)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(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 O(y,"Parser"),y.prototype=m,m.Parser=y,new y}();RMe.parser=RMe;var Iui=RMe,DMe=[],LMe=[],MMe=[],IMe=new Set,PMe,NMe=!1,Pui=O((t,e,r)=>{const n=eae(t).sort(),i=r??10/Math.pow(t.length,2);PMe=n,n.length===1&&IMe.add(n[0]),DMe.push({sets:n,size:i,label:e?vU(e):void 0})},"addSubsetData"),Nui=O(()=>DMe,"getSubsetData"),vU=O(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),Bui=O(t=>t&&vU(t),"normalizeStyleValue"),$ui=O((t,e,r)=>{const n=vU(e);LMe.push({sets:eae(t).sort(),id:n,label:r?vU(r):void 0})},"addTextData"),Fui=O((t,e)=>{const r=eae(t).sort(),n={};for(const[i,a]of e)n[i]=Bui(a)??a;MMe.push({targets:r,styles:n})},"addStyleData"),zui=O(()=>MMe,"getStyleData"),eae=O(t=>t.map(e=>vU(e)),"normalizeIdentifierList"),Uui=O(t=>{const r=eae(t).filter(n=>!IMe.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),Vui=O(()=>LMe,"getTextData"),Qui=O(()=>PMe,"getCurrentSets"),Gui=O(()=>NMe,"getIndentMode"),Hui=O(t=>{NMe=t},"setIndentMode"),Wui=Jn.venn;function Zar(){return uo(Wui,Dr().venn)}O(Zar,"getConfig");var Yui=O(()=>{_a(),DMe.length=0,LMe.length=0,MMe.length=0,IMe.clear(),PMe=void 0,NMe=!1},"customClear"),qui={getConfig:Zar,clear:Yui,setAccTitle:Ba,getAccTitle:oo,setDiagramTitle:co,getDiagramTitle:$a,getAccDescription:lo,setAccDescription:so,addSubsetData:Pui,getSubsetData:Nui,addTextData:$ui,addStyleData:Fui,validateUnionIdentifiers:Uui,getTextData:Vui,getStyleData:zui,getCurrentSets:Qui,getIndentMode:Gui,setIndentMode:Hui},jui=O(t=>` +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:O(function(){var w=this.next();return w||this.lex()},"lex"),begin:O(function(w){this.conditionStack.push(w)},"begin"),popState:O(function(){var w=this.conditionStack.length-1;return w>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:O(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:O(function(w){return w=this.conditionStack.length-1-Math.abs(w||0),w>=0?this.conditionStack[w]:"INITIAL"},"topState"),pushState:O(function(w){this.begin(w)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(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 O(y,"Parser"),y.prototype=m,m.Parser=y,new y}();RMe.parser=RMe;var Nui=RMe,DMe=[],LMe=[],MMe=[],IMe=new Set,PMe,NMe=!1,Bui=O((t,e,r)=>{const n=eae(t).sort(),i=r??10/Math.pow(t.length,2);PMe=n,n.length===1&&IMe.add(n[0]),DMe.push({sets:n,size:i,label:e?vU(e):void 0})},"addSubsetData"),$ui=O(()=>DMe,"getSubsetData"),vU=O(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),Fui=O(t=>t&&vU(t),"normalizeStyleValue"),zui=O((t,e,r)=>{const n=vU(e);LMe.push({sets:eae(t).sort(),id:n,label:r?vU(r):void 0})},"addTextData"),Uui=O((t,e)=>{const r=eae(t).sort(),n={};for(const[i,a]of e)n[i]=Fui(a)??a;MMe.push({targets:r,styles:n})},"addStyleData"),Vui=O(()=>MMe,"getStyleData"),eae=O(t=>t.map(e=>vU(e)),"normalizeIdentifierList"),Qui=O(t=>{const r=eae(t).filter(n=>!IMe.has(n));if(r.length>0)throw new Error(`unknown set identifier: ${r.join(", ")}`)},"validateUnionIdentifiers"),Gui=O(()=>LMe,"getTextData"),Hui=O(()=>PMe,"getCurrentSets"),Wui=O(()=>NMe,"getIndentMode"),Yui=O(t=>{NMe=t},"setIndentMode"),qui=Jn.venn;function eor(){return uo(qui,Dr().venn)}O(eor,"getConfig");var jui=O(()=>{_a(),DMe.length=0,LMe.length=0,MMe.length=0,IMe.clear(),PMe=void 0,NMe=!1},"customClear"),Xui={getConfig:eor,clear:jui,setAccTitle:Ba,getAccTitle:oo,setDiagramTitle:co,getDiagramTitle:$a,getAccDescription:lo,setAccDescription:so,addSubsetData:Bui,getSubsetData:$ui,addTextData:zui,addStyleData:Uui,validateUnionIdentifiers:Qui,getTextData:Gui,getStyleData:Vui,getCurrentSets:Hui,getIndentMode:Wui,setIndentMode:Yui},Kui=O(t=>` .venn-title { font-size: 32px; fill: ${t.vennTitleTextColor}; @@ -3731,7 +3731,7 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[U]||U)+"'":te="Parse error font-family: ${t.fontFamily}; color: ${t.vennSetTextColor}; } -`,"getStyles"),Xui=jui;function Jar(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}O(Jar,"buildStyleByKey");var Kui=O((t,e,r,n)=>{var D,M,I;const i=n.db,a=(D=i.getConfig)==null?void 0:D.call(i),{themeVariables:o,look:s,handDrawnSeed:l}=Dr(),u=s==="handDrawn",h=[o.venn1,o.venn2,o.venn3,o.venn4,o.venn5,o.venn6,o.venn7,o.venn8].filter(Boolean),d=(M=i.getDiagramTitle)==null?void 0:M.call(i),f=i.getSubsetData(),p=i.getTextData(),g=Jar(i.getStyleData()),m=tor(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=o.primaryTextColor??o.textColor,S=nu(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",o.vennTitleTextColor||o.titleColor);const T=_t(document.createElement("div")),C=_ui().width(v).height(y-w);T.datum(m).call(C);const k=u?Er.svg(T.select("svg").node()):void 0,E=Mui(m,{width:v,height:y-w,padding:(a==null?void 0:a.padding)??15}),_=new Map;for(const N of E){const F=Qw([...N.data.sets].sort());_.set(F,N)}p.length>0&&eor(a,_,T,p,x,g);const P=Fu(o.background||"#f4f4f4");T.selectAll(".venn-circle").each(function(N,F){var X;const B=_t(this),z=Qw([...N.sets].sort()),U=g.get(z),Q=(U==null?void 0:U.fill)||h[F%h.length]||o.primaryColor;B.classed(`venn-set-${F%8}`,!0);const G=(U==null?void 0:U["fill-opacity"])??.1,q=(U==null?void 0:U.stroke)||Q,Y=(U==null?void 0:U["stroke-width"])||`${5*x}`;if(u&&k){const J=_.get(z);if(J&&J.circles.length>0){const ee=J.circles[0],te=k.circle(ee.x,ee.y,ee.radius*2,{roughness:.7,seed:l,fill:Zxt(Q,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+F*60,stroke:q,strokeWidth:parseFloat(String(Y))});B.select("path").remove(),(X=B.node())==null||X.insertBefore(te,B.select("text").node())}}else B.select("path").style("fill",Q).style("fill-opacity",G).style("stroke",q).style("stroke-width",Y).style("stroke-opacity",.95);const ne=(U==null?void 0:U.color)||(P?ht(Q,30):dt(Q,30));B.select("text").style("font-size",`${48*x}px`).style("fill",ne)}),u&&k?T.selectAll(".venn-intersection").each(function(N){var Q;const F=_t(this),V=Qw([...N.sets].sort()),z=g.get(V),U=z==null?void 0:z.fill;if(U){const G=F.select("path"),q=G.attr("d");if(q){const Y=k.path(q,{roughness:.7,seed:l,fill:Zxt(U,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),ne=G.node();(Q=ne==null?void 0:ne.parentNode)==null||Q.insertBefore(Y,ne),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)??o.vennSetTextColor??A)}):(T.selectAll(".venn-intersection text").style("font-size",`${48*x}px`).style("fill",N=>{var V;const B=Qw([...N.sets].sort());return((V=g.get(B))==null?void 0:V.color)??o.vennSetTextColor??A}),T.selectAll(".venn-intersection path").style("fill-opacity",N=>{var V;const B=Qw([...N.sets].sort());return(V=g.get(B))!=null&&V.fill?1:0}).style("fill",N=>{var V;const B=Qw([...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])(I=L.node())==null||I.appendChild(N);jo(S,y,v,(a==null?void 0:a.useMaxWidth)??!0)},"draw");function Qw(t){return t.join("|")}O(Qw,"stableSetsKey");function eor(t,e,r,n,i,a){var h;const o=(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=Qw(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`);o&&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),C=(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+C,_=Math.max(1,Math.ceil(Math.sqrt(f.length))),P=Math.max(1,Math.ceil(f.length/_)),L=w/_,R=A/P;for(const[D,M]of f.entries()){const I=D%_,N=Math.floor(D/_),F=k+L*(I+.5),B=E+R*(N+.5);o&&x.append("rect").attr("class","venn-text-debug-cell").attr("x",k+L*I).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)}}}O(eor,"renderTextNodes");function tor(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 o=0;o0?[...t,...n]:t}O(tor,"ensurePairwiseSubsets");var Zui={draw:Kui},Jui={parser:Iui,db:qui,renderer:Zui,styles:Xui};const ehi=Object.freeze(Object.defineProperty({__proto__:null,diagram:Jui},Symbol.toStringTag,{value:"Module"}));var ror=(xP=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=Ba,this.getAccTitle=oo,this.setDiagramTitle=co,this.getDiagramTitle=$a,this.getAccDescription=lo,this.setAccDescription=so}getNodes(){return this.nodes}getConfig(){const e=Jn,r=Dr();return uo({...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=>{axe(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(){_a(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},O(xP,"TreeMapDB"),xP);function nor(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}O(nor,"buildHierarchy");var thi=O((t,e)=>{ah(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 o=a.item;if(!o)continue;const s=a.indent?parseInt(a.indent):0,l=rhi(o),u=o.classSelector?e.getStylesForClass(o.classSelector):[],h=u.length>0?u:void 0,d={level:s,name:l,type:o.$type,value:o.value,classSelector:o.classSelector,cssCompiledStyles:h};r.push(d)}const n=nor(r),i=O((a,o)=>{for(const s of a)e.addNode(s,o),s.children&&s.children.length>0&&i(s.children,o+1)},"addNodesRecursively");i(n,0)},"populate"),rhi=O(t=>t.name?String(t.name):"","getItemName"),ior={parser:{yy:void 0},parse:O(async t=>{var e;try{const n=await Qp("treemap",t);ye.debug("Treemap AST:",n);const i=(e=ior.parser)==null?void 0:e.yy;if(!(i instanceof ror))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.");thi(n,i)}catch(r){throw ye.error("Error parsing treemap:",r),r}},"parse")},nhi=10,$D=10,yU=25,ihi=O((t,e,r,n)=>{const i=n.db,a=i.getConfig(),o=a.padding??nhi,s=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=Dr();if(!l)return;const h=s?30:0,d=nu(e),f=a.nodeWidth?a.nodeWidth*$D:960,p=a.nodeHeight?a.nodeHeight*$D:500,g=f,m=p+h;d.attr("viewBox",`0 0 ${g} ${m}`),jo(d,m,g,a.useMaxWidth);let v;try{const z=a.valueFormat||",";if(z==="$0,0")v=O(U=>"$"+zT(",")(U),"valueFormat");else if(z.startsWith("$")&&z.includes(",")){const U=/\.\d+/.exec(z),Q=U?U[0]:"";v=O(G=>"$"+zT(","+Q)(G),"valueFormat")}else if(z.startsWith("$")){const U=z.substring(1);v=O(Q=>"$"+zT(U||"")(Q),"valueFormat")}else v=zT(z)}catch(z){ye.error("Error creating format function:",z),v=zT(",")}const y=UT().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=UT().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=UT().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]);s&&d.append("text").attr("x",g/2).attr("y",h/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(s);const w=d.append("g").attr("transform",`translate(0, ${h})`).attr("class","treemapContainer"),A=bbe(l).sum(z=>z.value??0).sort((z,U)=>(U.value??0)-(z.value??0)),T=aln().size([f,p]).paddingTop(z=>z.children&&z.children.length>0?yU+$D:0).paddingInner(o).paddingLeft(z=>z.children&&z.children.length>0?$D:0).paddingRight(z=>z.children&&z.children.length>0?$D:0).paddingBottom(z=>z.children&&z.children.length>0?$D:0).round(!0)(A),C=T.descendants().filter(z=>z.children&&z.children.length>0),k=w.selectAll(".treemapSection").data(C).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",yU).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",yU),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",yU/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=_t(this),Q=z.data.name;U.text(Q);const G=z.x1-z.x0,q=6;let Y;a.showValues!==!1&&z.value?Y=G-10-30-10-q:Y=G-q-6;const X=Math.max(15,Y),J=U.node();if(J.getComputedTextLength()>X){const te="...";let pe=Q;for(;pe.length>0;){if(pe=Q.substring(0,pe.length-1),pe.length===0){U.text(te),J.getComputedTextLength()>X&&U.text("");break}if(U.text(pe+te),J.getComputedTextLength()<=X)break}}}),a.showValues!==!1&&k.append("text").attr("class","treemapSectionValue").attr("x",z=>z.x1-z.x0-10).attr("y",yU/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,P=_?16:38,L=_?14:28,R=_?4:8,D=_?4:6,M=_?2:4,I=_?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: ${P}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=_t(this),Q=z.x1-z.x0,G=z.y1-z.y0,q=U.node(),Y=Q-2*M,ne=G-2*M;if(YY&&X>R;)X--,U.style("font-size",`${X}px`);let ee=Math.max(D,Math.min(L,Math.round(X*J))),te=X+N+ee;for(;te>ne&&X>R&&(X--,ee=Math.max(D,Math.min(L,Math.round(X*J))),!(eeY||X(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=_t(this),G=this.parentNode;if(!G){Q.style("display","none");return}const q=_t(G).select(".treemapLabel");if(q.empty()||q.style("display")==="none"){Q.style("display","none");return}const Y=parseFloat(q.style("font-size")),X=Math.max(D,Math.min(L,Math.round(Y*.6)));Q.style("font-size",`${X}px`);const ee=(U.y1-U.y0)/2+Y/2+N;Q.attr("y",ee);const te=U.x1-U.x0,Ce=U.y1-U.y0-4,ke=te-2*M;Q.node().getComputedTextLength()>ke||ee+X>Ce||X{const e=jy(),r=Dr(),n=uo(e,r.themeVariables),i=uo(shi,t),a=i.titleColor??n.titleColor,o=i.labelColor??n.textColor,s=i.valueColor??n.textColor;return` +`,"getStyles"),Zui=Kui;function tor(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}O(tor,"buildStyleByKey");var Jui=O((t,e,r,n)=>{var D,M,I;const i=n.db,a=(D=i.getConfig)==null?void 0:D.call(i),{themeVariables:o,look:s,handDrawnSeed:l}=Dr(),u=s==="handDrawn",h=[o.venn1,o.venn2,o.venn3,o.venn4,o.venn5,o.venn6,o.venn7,o.venn8].filter(Boolean),d=(M=i.getDiagramTitle)==null?void 0:M.call(i),f=i.getSubsetData(),p=i.getTextData(),g=tor(i.getStyleData()),m=nor(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=o.primaryTextColor??o.textColor,S=nu(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",o.vennTitleTextColor||o.titleColor);const T=_t(document.createElement("div")),C=Dui().width(v).height(y-w);T.datum(m).call(C);const k=u?Er.svg(T.select("svg").node()):void 0,E=Pui(m,{width:v,height:y-w,padding:(a==null?void 0:a.padding)??15}),_=new Map;for(const N of E){const F=Qw([...N.data.sets].sort());_.set(F,N)}p.length>0&&ror(a,_,T,p,x,g);const P=Fu(o.background||"#f4f4f4");T.selectAll(".venn-circle").each(function(N,F){var X;const B=_t(this),z=Qw([...N.sets].sort()),U=g.get(z),Q=(U==null?void 0:U.fill)||h[F%h.length]||o.primaryColor;B.classed(`venn-set-${F%8}`,!0);const G=(U==null?void 0:U["fill-opacity"])??.1,q=(U==null?void 0:U.stroke)||Q,Y=(U==null?void 0:U["stroke-width"])||`${5*x}`;if(u&&k){const J=_.get(z);if(J&&J.circles.length>0){const ee=J.circles[0],te=k.circle(ee.x,ee.y,ee.radius*2,{roughness:.7,seed:l,fill:e2t(Q,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+F*60,stroke:q,strokeWidth:parseFloat(String(Y))});B.select("path").remove(),(X=B.node())==null||X.insertBefore(te,B.select("text").node())}}else B.select("path").style("fill",Q).style("fill-opacity",G).style("stroke",q).style("stroke-width",Y).style("stroke-opacity",.95);const ne=(U==null?void 0:U.color)||(P?ht(Q,30):dt(Q,30));B.select("text").style("font-size",`${48*x}px`).style("fill",ne)}),u&&k?T.selectAll(".venn-intersection").each(function(N){var Q;const F=_t(this),V=Qw([...N.sets].sort()),z=g.get(V),U=z==null?void 0:z.fill;if(U){const G=F.select("path"),q=G.attr("d");if(q){const Y=k.path(q,{roughness:.7,seed:l,fill:e2t(U,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),ne=G.node();(Q=ne==null?void 0:ne.parentNode)==null||Q.insertBefore(Y,ne),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)??o.vennSetTextColor??A)}):(T.selectAll(".venn-intersection text").style("font-size",`${48*x}px`).style("fill",N=>{var V;const B=Qw([...N.sets].sort());return((V=g.get(B))==null?void 0:V.color)??o.vennSetTextColor??A}),T.selectAll(".venn-intersection path").style("fill-opacity",N=>{var V;const B=Qw([...N.sets].sort());return(V=g.get(B))!=null&&V.fill?1:0}).style("fill",N=>{var V;const B=Qw([...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])(I=L.node())==null||I.appendChild(N);jo(S,y,v,(a==null?void 0:a.useMaxWidth)??!0)},"draw");function Qw(t){return t.join("|")}O(Qw,"stableSetsKey");function ror(t,e,r,n,i,a){var h;const o=(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=Qw(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`);o&&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),C=(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+C,_=Math.max(1,Math.ceil(Math.sqrt(f.length))),P=Math.max(1,Math.ceil(f.length/_)),L=w/_,R=A/P;for(const[D,M]of f.entries()){const I=D%_,N=Math.floor(D/_),F=k+L*(I+.5),B=E+R*(N+.5);o&&x.append("rect").attr("class","venn-text-debug-cell").attr("x",k+L*I).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)}}}O(ror,"renderTextNodes");function nor(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 o=0;o0?[...t,...n]:t}O(nor,"ensurePairwiseSubsets");var ehi={draw:Jui},thi={parser:Nui,db:Xui,renderer:ehi,styles:Zui};const rhi=Object.freeze(Object.defineProperty({__proto__:null,diagram:thi},Symbol.toStringTag,{value:"Module"}));var ior=(xP=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=Ba,this.getAccTitle=oo,this.setDiagramTitle=co,this.getDiagramTitle=$a,this.getAccDescription=lo,this.setAccDescription=so}getNodes(){return this.nodes}getConfig(){const e=Jn,r=Dr();return uo({...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=>{axe(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(){_a(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},O(xP,"TreeMapDB"),xP);function aor(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}O(aor,"buildHierarchy");var nhi=O((t,e)=>{ah(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 o=a.item;if(!o)continue;const s=a.indent?parseInt(a.indent):0,l=ihi(o),u=o.classSelector?e.getStylesForClass(o.classSelector):[],h=u.length>0?u:void 0,d={level:s,name:l,type:o.$type,value:o.value,classSelector:o.classSelector,cssCompiledStyles:h};r.push(d)}const n=aor(r),i=O((a,o)=>{for(const s of a)e.addNode(s,o),s.children&&s.children.length>0&&i(s.children,o+1)},"addNodesRecursively");i(n,0)},"populate"),ihi=O(t=>t.name?String(t.name):"","getItemName"),oor={parser:{yy:void 0},parse:O(async t=>{var e;try{const n=await Qp("treemap",t);ye.debug("Treemap AST:",n);const i=(e=oor.parser)==null?void 0:e.yy;if(!(i instanceof ior))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.");nhi(n,i)}catch(r){throw ye.error("Error parsing treemap:",r),r}},"parse")},ahi=10,$D=10,yU=25,ohi=O((t,e,r,n)=>{const i=n.db,a=i.getConfig(),o=a.padding??ahi,s=i.getDiagramTitle(),l=i.getRoot(),{themeVariables:u}=Dr();if(!l)return;const h=s?30:0,d=nu(e),f=a.nodeWidth?a.nodeWidth*$D:960,p=a.nodeHeight?a.nodeHeight*$D:500,g=f,m=p+h;d.attr("viewBox",`0 0 ${g} ${m}`),jo(d,m,g,a.useMaxWidth);let v;try{const z=a.valueFormat||",";if(z==="$0,0")v=O(U=>"$"+zT(",")(U),"valueFormat");else if(z.startsWith("$")&&z.includes(",")){const U=/\.\d+/.exec(z),Q=U?U[0]:"";v=O(G=>"$"+zT(","+Q)(G),"valueFormat")}else if(z.startsWith("$")){const U=z.substring(1);v=O(Q=>"$"+zT(U||"")(Q),"valueFormat")}else v=zT(z)}catch(z){ye.error("Error creating format function:",z),v=zT(",")}const y=UT().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=UT().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=UT().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]);s&&d.append("text").attr("x",g/2).attr("y",h/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(s);const w=d.append("g").attr("transform",`translate(0, ${h})`).attr("class","treemapContainer"),A=bbe(l).sum(z=>z.value??0).sort((z,U)=>(U.value??0)-(z.value??0)),T=sln().size([f,p]).paddingTop(z=>z.children&&z.children.length>0?yU+$D:0).paddingInner(o).paddingLeft(z=>z.children&&z.children.length>0?$D:0).paddingRight(z=>z.children&&z.children.length>0?$D:0).paddingBottom(z=>z.children&&z.children.length>0?$D:0).round(!0)(A),C=T.descendants().filter(z=>z.children&&z.children.length>0),k=w.selectAll(".treemapSection").data(C).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",yU).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",yU),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",yU/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=_t(this),Q=z.data.name;U.text(Q);const G=z.x1-z.x0,q=6;let Y;a.showValues!==!1&&z.value?Y=G-10-30-10-q:Y=G-q-6;const X=Math.max(15,Y),J=U.node();if(J.getComputedTextLength()>X){const te="...";let pe=Q;for(;pe.length>0;){if(pe=Q.substring(0,pe.length-1),pe.length===0){U.text(te),J.getComputedTextLength()>X&&U.text("");break}if(U.text(pe+te),J.getComputedTextLength()<=X)break}}}),a.showValues!==!1&&k.append("text").attr("class","treemapSectionValue").attr("x",z=>z.x1-z.x0-10).attr("y",yU/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,P=_?16:38,L=_?14:28,R=_?4:8,D=_?4:6,M=_?2:4,I=_?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: ${P}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=_t(this),Q=z.x1-z.x0,G=z.y1-z.y0,q=U.node(),Y=Q-2*M,ne=G-2*M;if(YY&&X>R;)X--,U.style("font-size",`${X}px`);let ee=Math.max(D,Math.min(L,Math.round(X*J))),te=X+N+ee;for(;te>ne&&X>R&&(X--,ee=Math.max(D,Math.min(L,Math.round(X*J))),!(eeY||X(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=_t(this),G=this.parentNode;if(!G){Q.style("display","none");return}const q=_t(G).select(".treemapLabel");if(q.empty()||q.style("display")==="none"){Q.style("display","none");return}const Y=parseFloat(q.style("font-size")),X=Math.max(D,Math.min(L,Math.round(Y*.6)));Q.style("font-size",`${X}px`);const ee=(U.y1-U.y0)/2+Y/2+N;Q.attr("y",ee);const te=U.x1-U.x0,Ce=U.y1-U.y0-4,ke=te-2*M;Q.node().getComputedTextLength()>ke||ee+X>Ce||X{const e=jy(),r=Dr(),n=uo(e,r.themeVariables),i=uo(chi,t),a=i.titleColor??n.titleColor,o=i.labelColor??n.textColor,s=i.valueColor??n.textColor;return` .treemapNode.section { stroke: ${i.sectionStrokeColor}; stroke-width: ${i.sectionStrokeWidth}; @@ -3754,8 +3754,8 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[U]||U)+"'":te="Parse error fill: ${a}; font-size: ${i.titleFontSize}; } - `},"getStyles"),chi=lhi,uhi={parser:ior,get db(){return new ror},renderer:ohi,styles:chi};const hhi=Object.freeze(Object.defineProperty({__proto__:null,diagram:uhi},Symbol.toStringTag,{value:"Module"}));var tae=O((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"),vk=O((t,e,r)=>({x:tae(e,`${r} evolution`),y:tae(t,`${r} visibility`)}),"toCoordinates"),aor=O(t=>{if(t){if(t==="+<>")return"bidirectional";if(t==="+<")return"backward";if(t==="+>")return"forward"}},"getFlowFromPort"),dhi=O(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"),fhi=O((t,e)=>{if(ah(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=vk(r.visibility,r.evolution,`Anchor "${r.name}"`);e.addNode(r.name,r.name,n.x,n.y,"anchor")}),t.components.forEach(r=>{var s;const n=vk(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,o=(s=r.decorator)==null?void 0:s.strategy;e.addNode(r.name,r.name,n.x,n.y,"component",i,a,r.inertia,o)}),t.notes.forEach(r=>{const n=vk(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 o=`${r.parent}_${a.name}`,s=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=tae(a.evolution,`Pipeline component "${a.name}" evolution`);e.addNode(o,a.name,u,i,"pipeline-component",s,l),e.addPipelineComponent(r.parent,o)})}),t.links.forEach(r=>{const n=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let i=aor(r.fromPort)??aor(r.toPort);const{flow:a,label:o}=dhi(r.arrow);!i&&a&&(i=a);const s=r.linkLabel,l=o??s;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=tae(r.target,`Evolve target for "${r.component}"`);e.addTrend(r.component,i,n.y)}}),t.annotations.length>0){const r=t.annotations[0],n=vk(r.x,r.y,"Annotations box");e.setAnnotationsBox(n.x,n.y)}t.annotation.forEach(r=>{const n=vk(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=vk(r.x,r.y,`Accelerator "${r.name}"`);e.addAccelerator(r.name,n.x,n.y)}),t.deaccelerators.forEach(r=>{const n=vk(r.x,r.y,`Deaccelerator "${r.name}"`);e.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),oor={parser:{yy:void 0},parse:O(async t=>{var n;const e=await Qp("wardley",t);ye.debug(e);const r=(n=oor.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.");fhi(e,r)},"parse")},phi=(wP=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}},O(wP,"WardleyBuilder"),wP),mu=new phi;function sor(){return Ye()["wardley-beta"]}O(sor,"getConfig");function lor(t,e,r,n,i,a,o,s,l){mu.addNode({id:t,label:e,x:r,y:n,className:i,labelOffsetX:a,labelOffsetY:o,inertia:s,sourceStrategy:l})}O(lor,"addNode");function cor(t,e,r=!1,n,i){mu.addLink({source:t,target:e,dashed:r,label:n,flow:i})}O(cor,"addLink");function uor(t,e,r){mu.addTrend({nodeId:t,targetX:e,targetY:r})}O(uor,"addTrend");function hor(t,e,r){mu.addAnnotation({number:t,coordinates:e,text:r})}O(hor,"addAnnotation");function dor(t,e,r){mu.addNote({text:t,x:e,y:r})}O(dor,"addNote");function por(t,e,r){mu.addAccelerator({name:t,x:e,y:r})}O(por,"addAccelerator");function gor(t,e,r){mu.addDeaccelerator({name:t,x:e,y:r})}O(gor,"addDeaccelerator");function mor(t,e){mu.setAnnotationsBox(t,e)}O(mor,"setAnnotationsBox");function vor(t,e){mu.setSize(t,e)}O(vor,"setSize");function yor(t){mu.startPipeline(t)}O(yor,"startPipeline");function bor(t,e){mu.addPipelineComponent(t,e)}O(bor,"addPipelineComponent");function xor(t){mu.setAxes(t)}O(xor,"updateAxes");function wor(t){return mu.getNode(t)}O(wor,"getNode");function Aor(t){return mu.resolveNodeId(t)}O(Aor,"resolveNodeId");function Sor(){return mu.build()}O(Sor,"getWardleyData");function Tor(){mu.clear(),_a()}O(Tor,"clear");var ghi={getConfig:sor,addNode:lor,addLink:cor,addTrend:uor,addAnnotation:hor,addNote:dor,addAccelerator:por,addDeaccelerator:gor,setAnnotationsBox:mor,setSize:vor,startPipeline:yor,addPipelineComponent:bor,updateAxes:xor,getNode:wor,resolveNodeId:Aor,getWardleyData:Sor,clear:Tor,setAccTitle:Ba,getAccTitle:oo,setDiagramTitle:co,getDiagramTitle:$a,getAccDescription:lo,setAccDescription:so},mhi=["Genesis","Custom Built","Product","Commodity"],vhi=O(()=>{var e,r,n,i,a,o,s,l,u,h,d,f;const{themeVariables:t}=Ye();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:((o=t.wardley)==null?void 0:o.componentStroke)??"#000",componentLabelColor:((s=t.wardley)==null?void 0:s.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"),yhi=O(()=>{const t=Ye()["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"),bhi=O((t,e,r,n)=>{var N,F;ye.debug(`Rendering Wardley map -`+t);const i=yhi(),a=vhi(),o=i.nodeRadius*1.6,s=n.db,l=s.getWardleyData(),u=s.getDiagramTitle(),h=((N=l.size)==null?void 0:N.width)??i.width,d=((F=l.size)==null?void 0:F.height)??i.height,f=nu(e);f.selectAll("*").remove(),jo(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=O(B=>i.padding+B/100*m,"projectX"),b=O(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:mhi;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],q=i.padding+G.start*m,Y=i.padding+G.end*m,ne=(q+Y)/2;Q>0&&B.append("line").attr("x1",q).attr("x2",q).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",ne).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(ne=>ne.id===Y)})).filter(Y=>Y.pos&&Y.node).sort((Y,ne)=>Y.node.x-ne.node.x);for(let Y=0;Y{const ne=T.get(Y);ne&&(Q=Math.min(Q,ne.x),G=Math.max(G,ne.x),q=ne.y)}),Q!==1/0&&G!==-1/0){const ne=i.nodeRadius*4,X=q-ne/2,J=T.get(z.nodeId);if(J){const ee=(Q+G)/2;J.x=ee,J.y=X-o/6}B.append("rect").attr("class","wardley-pipeline-box").attr("x",Q-15).attr("y",X).attr("width",G-Q+15*2).attr("height",ne).attr("fill","none").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const C=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))});C.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(ne=>ne.id===B.source).isPipelineParent?o/Math.sqrt(2):i.nodeRadius,G=z.x-V.x,q=z.y-V.y,Y=Math.sqrt(G*G+q*q);return V.x+G/Y*Q}).attr("y1",B=>{const V=T.get(B.source),z=T.get(B.target),Q=l.nodes.find(ne=>ne.id===B.source).isPipelineParent?o/Math.sqrt(2):i.nodeRadius,G=z.x-V.x,q=z.y-V.y,Y=Math.sqrt(G*G+q*q);return V.y+q/Y*Q}).attr("x2",B=>{const V=T.get(B.source),z=T.get(B.target),Q=l.nodes.find(ne=>ne.id===B.target).isPipelineParent?o/Math.sqrt(2):i.nodeRadius,G=V.x-z.x,q=V.y-z.y,Y=Math.sqrt(G*G+q*q);return z.x+G/Y*Q}).attr("y2",B=>{const V=T.get(B.source),z=T.get(B.target),Q=l.nodes.find(ne=>ne.id===B.target).isPipelineParent?o/Math.sqrt(2):i.nodeRadius,G=V.x-z.x,q=V.y-z.y,Y=Math.sqrt(G*G+q*q);return z.y+q/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),C.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,q=Math.sqrt(G*G+Q*Q),Y=8,ne=Q/q;return U+ne*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,q=Math.sqrt(Q*Q+G*G),Y=8,ne=-Q/q;return U+ne*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,q=z.y-V.y,Y=Math.sqrt(G*G+q*q),ne=8,X=q/Y,J=-G/Y,ee=U+X*ne,te=Q+J*ne;let pe=Math.atan2(q,G)*180/Math.PI;return(pe>90||pe<-90)&&(pe+=180),`rotate(${pe} ${ee} ${te})`}).text(B=>B.label);const _=p.append("g").attr("class","wardley-trends"),P=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,q=Math.sqrt(Q*Q+G*G),Y=i.nodeRadius+2,ne=q>Y?z-Q/q*Y:z,X=q>Y?U-G/q*Y:U;return{origin:V,targetX:z,targetY:U,adjustedX2:ne,adjustedY2:X}}).filter(B=>B!==null);_.selectAll("line").data(P).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,I=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-I).attr("x2",B=>T.get(B.id).x-I*Math.cos(Math.PI/6)).attr("y2",B=>T.get(B.id).y+I*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-I*Math.cos(Math.PI/6)).attr("y1",B=>T.get(B.id).y+I*Math.sin(Math.PI/6)).attr("x2",B=>T.get(B.id).x+I*Math.cos(Math.PI/6)).attr("y2",B=>T.get(B.id).y+I*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+I*Math.cos(Math.PI/6)).attr("y1",B=>T.get(B.id).y+I*Math.sin(Math.PI/6)).attr("x2",B=>T.get(B.id).x).attr("y2",B=>T.get(B.id).y-I).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-I).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-I*Math.cos(Math.PI/6)).attr("cy",B=>T.get(B.id).y+I*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+I*Math.cos(Math.PI/6)).attr("cy",B=>T.get(B.id).y+I*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-o/2).attr("y",B=>T.get(B.id).y-o/2).attr("width",o).attr("height",o).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?o/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?o:i.nodeRadius*2;return V.y-z/2}).attr("x2",B=>{const V=T.get(B.id);let z=B.isPipelineParent?o/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?o: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,q=B.append("g").attr("class","wardley-annotations-box"),Y=[...l.annotations].filter(X=>X.text).sort((X,J)=>X.number-J.number),ne=[];if(Y.forEach((X,J)=>{const ee=q.append("text").attr("x",V+U).attr("y",z+U+(J+1)*Q).attr("font-size",G).attr("fill",a.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${X.number}. ${X.text}`);ne.push(ee)}),ne.length>0){let X=0,J=0;ne.forEach(Ee=>{const ue=Ee.node(),de=ue.getComputedTextLength();X=Math.max(X,de);const xe=ue.getBBox();J=Math.max(J,xe.height)});const ee=X+U*2+105,te=Y.length*Q+U*2+J/2,pe=i.padding,ie=h-i.padding-ee,Ce=i.padding,ke=d-i.padding-te;V=Math.max(pe,Math.min(V,ie)),z=Math.max(Ce,Math.min(z,ke)),ne.forEach((Ee,ue)=>{Ee.attr("x",V+U).attr("y",z+U+(ue+1)*Q)}),q.insert("rect","text").attr("x",V).attr("y",z).attr("width",ee).attr("height",te).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,q=20,Y=` + `},"getStyles"),hhi=uhi,dhi={parser:oor,get db(){return new ior},renderer:lhi,styles:hhi};const fhi=Object.freeze(Object.defineProperty({__proto__:null,diagram:dhi},Symbol.toStringTag,{value:"Module"}));var tae=O((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"),vk=O((t,e,r)=>({x:tae(e,`${r} evolution`),y:tae(t,`${r} visibility`)}),"toCoordinates"),sor=O(t=>{if(t){if(t==="+<>")return"bidirectional";if(t==="+<")return"backward";if(t==="+>")return"forward"}},"getFlowFromPort"),phi=O(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"),ghi=O((t,e)=>{if(ah(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=vk(r.visibility,r.evolution,`Anchor "${r.name}"`);e.addNode(r.name,r.name,n.x,n.y,"anchor")}),t.components.forEach(r=>{var s;const n=vk(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,o=(s=r.decorator)==null?void 0:s.strategy;e.addNode(r.name,r.name,n.x,n.y,"component",i,a,r.inertia,o)}),t.notes.forEach(r=>{const n=vk(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 o=`${r.parent}_${a.name}`,s=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=tae(a.evolution,`Pipeline component "${a.name}" evolution`);e.addNode(o,a.name,u,i,"pipeline-component",s,l),e.addPipelineComponent(r.parent,o)})}),t.links.forEach(r=>{const n=!!r.arrow&&(r.arrow.includes("-.->")||r.arrow.includes(".-."));let i=sor(r.fromPort)??sor(r.toPort);const{flow:a,label:o}=phi(r.arrow);!i&&a&&(i=a);const s=r.linkLabel,l=o??s;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=tae(r.target,`Evolve target for "${r.component}"`);e.addTrend(r.component,i,n.y)}}),t.annotations.length>0){const r=t.annotations[0],n=vk(r.x,r.y,"Annotations box");e.setAnnotationsBox(n.x,n.y)}t.annotation.forEach(r=>{const n=vk(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=vk(r.x,r.y,`Accelerator "${r.name}"`);e.addAccelerator(r.name,n.x,n.y)}),t.deaccelerators.forEach(r=>{const n=vk(r.x,r.y,`Deaccelerator "${r.name}"`);e.addDeaccelerator(r.name,n.x,n.y)})},"populateDb"),lor={parser:{yy:void 0},parse:O(async t=>{var n;const e=await Qp("wardley",t);ye.debug(e);const r=(n=lor.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.");ghi(e,r)},"parse")},mhi=(wP=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}},O(wP,"WardleyBuilder"),wP),mu=new mhi;function cor(){return Ye()["wardley-beta"]}O(cor,"getConfig");function uor(t,e,r,n,i,a,o,s,l){mu.addNode({id:t,label:e,x:r,y:n,className:i,labelOffsetX:a,labelOffsetY:o,inertia:s,sourceStrategy:l})}O(uor,"addNode");function hor(t,e,r=!1,n,i){mu.addLink({source:t,target:e,dashed:r,label:n,flow:i})}O(hor,"addLink");function dor(t,e,r){mu.addTrend({nodeId:t,targetX:e,targetY:r})}O(dor,"addTrend");function por(t,e,r){mu.addAnnotation({number:t,coordinates:e,text:r})}O(por,"addAnnotation");function gor(t,e,r){mu.addNote({text:t,x:e,y:r})}O(gor,"addNote");function mor(t,e,r){mu.addAccelerator({name:t,x:e,y:r})}O(mor,"addAccelerator");function vor(t,e,r){mu.addDeaccelerator({name:t,x:e,y:r})}O(vor,"addDeaccelerator");function yor(t,e){mu.setAnnotationsBox(t,e)}O(yor,"setAnnotationsBox");function bor(t,e){mu.setSize(t,e)}O(bor,"setSize");function xor(t){mu.startPipeline(t)}O(xor,"startPipeline");function wor(t,e){mu.addPipelineComponent(t,e)}O(wor,"addPipelineComponent");function Aor(t){mu.setAxes(t)}O(Aor,"updateAxes");function Sor(t){return mu.getNode(t)}O(Sor,"getNode");function Tor(t){return mu.resolveNodeId(t)}O(Tor,"resolveNodeId");function Cor(){return mu.build()}O(Cor,"getWardleyData");function Oor(){mu.clear(),_a()}O(Oor,"clear");var vhi={getConfig:cor,addNode:uor,addLink:hor,addTrend:dor,addAnnotation:por,addNote:gor,addAccelerator:mor,addDeaccelerator:vor,setAnnotationsBox:yor,setSize:bor,startPipeline:xor,addPipelineComponent:wor,updateAxes:Aor,getNode:Sor,resolveNodeId:Tor,getWardleyData:Cor,clear:Oor,setAccTitle:Ba,getAccTitle:oo,setDiagramTitle:co,getDiagramTitle:$a,getAccDescription:lo,setAccDescription:so},yhi=["Genesis","Custom Built","Product","Commodity"],bhi=O(()=>{var e,r,n,i,a,o,s,l,u,h,d,f;const{themeVariables:t}=Ye();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:((o=t.wardley)==null?void 0:o.componentStroke)??"#000",componentLabelColor:((s=t.wardley)==null?void 0:s.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"),xhi=O(()=>{const t=Ye()["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"),whi=O((t,e,r,n)=>{var N,F;ye.debug(`Rendering Wardley map +`+t);const i=xhi(),a=bhi(),o=i.nodeRadius*1.6,s=n.db,l=s.getWardleyData(),u=s.getDiagramTitle(),h=((N=l.size)==null?void 0:N.width)??i.width,d=((F=l.size)==null?void 0:F.height)??i.height,f=nu(e);f.selectAll("*").remove(),jo(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=O(B=>i.padding+B/100*m,"projectX"),b=O(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:yhi;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],q=i.padding+G.start*m,Y=i.padding+G.end*m,ne=(q+Y)/2;Q>0&&B.append("line").attr("x1",q).attr("x2",q).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",ne).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(ne=>ne.id===Y)})).filter(Y=>Y.pos&&Y.node).sort((Y,ne)=>Y.node.x-ne.node.x);for(let Y=0;Y{const ne=T.get(Y);ne&&(Q=Math.min(Q,ne.x),G=Math.max(G,ne.x),q=ne.y)}),Q!==1/0&&G!==-1/0){const ne=i.nodeRadius*4,X=q-ne/2,J=T.get(z.nodeId);if(J){const ee=(Q+G)/2;J.x=ee,J.y=X-o/6}B.append("rect").attr("class","wardley-pipeline-box").attr("x",Q-15).attr("y",X).attr("width",G-Q+15*2).attr("height",ne).attr("fill","none").attr("stroke",a.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const C=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))});C.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(ne=>ne.id===B.source).isPipelineParent?o/Math.sqrt(2):i.nodeRadius,G=z.x-V.x,q=z.y-V.y,Y=Math.sqrt(G*G+q*q);return V.x+G/Y*Q}).attr("y1",B=>{const V=T.get(B.source),z=T.get(B.target),Q=l.nodes.find(ne=>ne.id===B.source).isPipelineParent?o/Math.sqrt(2):i.nodeRadius,G=z.x-V.x,q=z.y-V.y,Y=Math.sqrt(G*G+q*q);return V.y+q/Y*Q}).attr("x2",B=>{const V=T.get(B.source),z=T.get(B.target),Q=l.nodes.find(ne=>ne.id===B.target).isPipelineParent?o/Math.sqrt(2):i.nodeRadius,G=V.x-z.x,q=V.y-z.y,Y=Math.sqrt(G*G+q*q);return z.x+G/Y*Q}).attr("y2",B=>{const V=T.get(B.source),z=T.get(B.target),Q=l.nodes.find(ne=>ne.id===B.target).isPipelineParent?o/Math.sqrt(2):i.nodeRadius,G=V.x-z.x,q=V.y-z.y,Y=Math.sqrt(G*G+q*q);return z.y+q/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),C.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,q=Math.sqrt(G*G+Q*Q),Y=8,ne=Q/q;return U+ne*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,q=Math.sqrt(Q*Q+G*G),Y=8,ne=-Q/q;return U+ne*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,q=z.y-V.y,Y=Math.sqrt(G*G+q*q),ne=8,X=q/Y,J=-G/Y,ee=U+X*ne,te=Q+J*ne;let pe=Math.atan2(q,G)*180/Math.PI;return(pe>90||pe<-90)&&(pe+=180),`rotate(${pe} ${ee} ${te})`}).text(B=>B.label);const _=p.append("g").attr("class","wardley-trends"),P=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,q=Math.sqrt(Q*Q+G*G),Y=i.nodeRadius+2,ne=q>Y?z-Q/q*Y:z,X=q>Y?U-G/q*Y:U;return{origin:V,targetX:z,targetY:U,adjustedX2:ne,adjustedY2:X}}).filter(B=>B!==null);_.selectAll("line").data(P).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,I=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-I).attr("x2",B=>T.get(B.id).x-I*Math.cos(Math.PI/6)).attr("y2",B=>T.get(B.id).y+I*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-I*Math.cos(Math.PI/6)).attr("y1",B=>T.get(B.id).y+I*Math.sin(Math.PI/6)).attr("x2",B=>T.get(B.id).x+I*Math.cos(Math.PI/6)).attr("y2",B=>T.get(B.id).y+I*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+I*Math.cos(Math.PI/6)).attr("y1",B=>T.get(B.id).y+I*Math.sin(Math.PI/6)).attr("x2",B=>T.get(B.id).x).attr("y2",B=>T.get(B.id).y-I).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-I).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-I*Math.cos(Math.PI/6)).attr("cy",B=>T.get(B.id).y+I*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+I*Math.cos(Math.PI/6)).attr("cy",B=>T.get(B.id).y+I*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-o/2).attr("y",B=>T.get(B.id).y-o/2).attr("width",o).attr("height",o).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?o/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?o:i.nodeRadius*2;return V.y-z/2}).attr("x2",B=>{const V=T.get(B.id);let z=B.isPipelineParent?o/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?o: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,q=B.append("g").attr("class","wardley-annotations-box"),Y=[...l.annotations].filter(X=>X.text).sort((X,J)=>X.number-J.number),ne=[];if(Y.forEach((X,J)=>{const ee=q.append("text").attr("x",V+U).attr("y",z+U+(J+1)*Q).attr("font-size",G).attr("fill",a.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${X.number}. ${X.text}`);ne.push(ee)}),ne.length>0){let X=0,J=0;ne.forEach(Ee=>{const ue=Ee.node(),de=ue.getComputedTextLength();X=Math.max(X,de);const xe=ue.getBBox();J=Math.max(J,xe.height)});const ee=X+U*2+105,te=Y.length*Q+U*2+J/2,pe=i.padding,ie=h-i.padding-ee,Ce=i.padding,ke=d-i.padding-te;V=Math.max(pe,Math.min(V,ie)),z=Math.max(Ce,Math.min(z,ke)),ne.forEach((Ee,ue)=>{Ee.attr("x",V+U).attr("y",z+U+(ue+1)*Q)}),q.insert("rect","text").attr("x",V).attr("y",z).attr("width",ee).attr("height",te).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,q=20,Y=` M ${z} ${U-G/2} L ${z+Q-q} ${U-G/2} L ${z+Q-q} ${U-G/2-8} @@ -3773,7 +3773,7 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[U]||U)+"'":te="Parse error L ${z+q} ${U+G/2} L ${z+Q} ${U+G/2} Z - `;B.append("path").attr("d",Y).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),B.append("text").attr("x",z+Q/2).attr("y",U+G/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(V.name)})}},"draw"),xhi={draw:bhi},whi=O(({wardley:t}={})=>{const e=jy(),r=Dr(),n=uo(e,r.themeVariables),i=uo(n.wardley,t);return` + `;B.append("path").attr("d",Y).attr("fill","white").attr("stroke",a.componentStroke).attr("stroke-width",1),B.append("text").attr("x",z+Q/2).attr("y",U+G/2+15).attr("text-anchor","middle").attr("font-size",10).attr("fill",a.axisTextColor).attr("font-weight","bold").text(V.name)})}},"draw"),Ahi={draw:whi},Shi=O(({wardley:t}={})=>{const e=jy(),r=Dr(),n=uo(e,r.themeVariables),i=uo(n.wardley,t);return` .wardley-background { fill: ${i.backgroundColor}; } @@ -3831,7 +3831,7 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[U]||U)+"'":te="Parse error .wardley-notes text { fill: ${i.axisTextColor}; } - `},"styles"),Ahi={parser:oor,db:ghi,renderer:xhi,styles:whi};const Shi=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ahi},Symbol.toStringTag,{value:"Module"}));var Cor=O(()=>({domains:new Map,transitions:[]}),"createDefaultData"),bU=Cor(),Thi=O(()=>bU.domains,"getDomains"),Chi=O(()=>bU.transitions,"getTransitions"),Ohi=O(t=>{if(t)for(const e of t){const r=e.domain,n=(e.items??[]).map(i=>({label:i.label}));bU.domains.set(r,{name:r,items:n})}},"setDomains"),khi=O(t=>{t&&(bU.transitions=t.filter(e=>e.from===e.to?(ye.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"),Ehi=O(()=>uo({...Jn.cynefin,...Dr().cynefin}),"getConfig"),_hi=O(()=>{_a(),bU=Cor()},"clear"),rae={getDomains:Thi,getTransitions:Chi,setDomains:Ohi,setTransitions:khi,getConfig:Ehi,clear:_hi,setAccTitle:Ba,getAccTitle:oo,setDiagramTitle:co,getDiagramTitle:$a,getAccDescription:lo,setAccDescription:so},Rhi=O(t=>{ah(t,rae),rae.setDomains(t.domains),rae.setTransitions(t.transitions)},"populate"),Dhi={parse:O(async t=>{const e=await Qp("cynefin",t);ye.debug(e),Rhi(e)},"parse")};function xU(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}O(xU,"seededRandom");function Oor(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"),Mhi=O(()=>{const t=jy(),e=Dr();return uo(t,e.themeVariables).cynefin},"getCynefinDomainColors"),BMe=3,Ihi=O((t,e,r,n)=>{const i=n.db,a=i.getDomains(),o=i.getTransitions(),s=i.getDiagramTitle(),l=i.getAccTitle(),u=i.getAccDescription(),h=i.getConfig(),d=Mhi();ye.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=nu(e);jo(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=Lhi(f,p),T=kor(h.seed,e),C=A.append("g").attr("class","cynefin-backgrounds"),k=["complex","complicated","chaotic","clear"];for(const N of k){const F=S[N];C.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",Eor(f,p,T,v)).attr("fill","none"),E.append("path").attr("class","cynefinBoundary").attr("d",_or(f,p,T+100,v)).attr("fill","none"),E.append("path").attr("class","cynefinCliff").attr("d",Ror(f,p)).attr("fill","none");const _=f*.15,P=p*.15;A.append("path").attr("class","cynefinConfusion").attr("d",Dor(f/2,p/2,_,P)).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=Lor[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(Lor.confusion.practice)}const R=A.append("g").attr("class","cynefin-items"),D=26,M=10,I=["complex","complicated","chaotic","clear","confusion"];for(const N of I){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>BMe&&(U=F.items.length-BMe,z=F.items.slice(0,BMe));let Q;if(V){const G=m?22:14;Q=B.cy+G}else Q=B.cy+(m?25:15);if([...z].forEach((G,q)=>{const Y=Q+q*(D+4),ne=R.append("g"),X=ne.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",D/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(G.label);let J=G.label.length*7;const ee=X.node();if(ee&&typeof ee.getBBox=="function"){const ie=ee.getBBox();ie.width>0&&(J=ie.width)}const te=J+M*2,pe=B.cx-te/2;ne.attr("transform",`translate(${pe}, ${Y})`),ne.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",te).attr("height",D).attr("rx",4).attr("ry",4).attr("fill",x[N]).attr("fill-opacity",.95),X.attr("x",te/2).attr("y",D/2)}),U>0){const G=Q+z.length*(D+4),q=`+${U} more`,Y=R.append("g"),ne=Y.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",D/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(q);let X=q.length*7;const J=ne.node();if(J&&typeof J.getBBox=="function"){const pe=J.getBBox();pe.width>0&&(X=pe.width)}const ee=X+M*2,te=B.cx-ee/2;Y.attr("transform",`translate(${te}, ${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),ne.attr("x",ee/2).attr("y",D/2)}}if(o.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");o.forEach(V=>{const z=S[V.from],U=S[V.to];if(!z||!U)return;if(V.from===V.to){ye.warn(`Cynefin renderer: skipping self-loop on domain "${V.from}"`);return}const Q=z.cx,G=z.cy,q=U.cx,Y=U.cy,ne=(Q+q)/2,X=(G+Y)/2,J=q-Q,ee=Y-G,te=Math.sqrt(J*J+ee*ee),pe=te*.15,ie=-ee/te,Ce=J/te,ke=ne+ie*pe,Ee=X+Ce*pe;B.append("path").attr("class","cynefinArrowLine").attr("d",`M${Q},${G} Q${ke},${Ee} ${q},${Y}`).attr("fill","none").attr("marker-end",`url(#${F})`),V.label&&B.append("text").attr("class","cynefinArrowLabel").attr("x",ke).attr("y",Ee-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(V.label)})}s&&A.append("text").attr("class","cynefinTitle").attr("x",f/2).attr("y",-g/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(s)},"draw"),Phi={draw:Ihi},Nhi=O(()=>{const t=jy(),e=Dr();return uo(t,e.themeVariables).cynefin},"getCynefinTheme"),Bhi=O(()=>{const t=Nhi();return` + `},"styles"),Thi={parser:lor,db:vhi,renderer:Ahi,styles:Shi};const Chi=Object.freeze(Object.defineProperty({__proto__:null,diagram:Thi},Symbol.toStringTag,{value:"Module"}));var kor=O(()=>({domains:new Map,transitions:[]}),"createDefaultData"),bU=kor(),Ohi=O(()=>bU.domains,"getDomains"),khi=O(()=>bU.transitions,"getTransitions"),Ehi=O(t=>{if(t)for(const e of t){const r=e.domain,n=(e.items??[]).map(i=>({label:i.label}));bU.domains.set(r,{name:r,items:n})}},"setDomains"),_hi=O(t=>{t&&(bU.transitions=t.filter(e=>e.from===e.to?(ye.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"),Rhi=O(()=>uo({...Jn.cynefin,...Dr().cynefin}),"getConfig"),Dhi=O(()=>{_a(),bU=kor()},"clear"),rae={getDomains:Ohi,getTransitions:khi,setDomains:Ehi,setTransitions:_hi,getConfig:Rhi,clear:Dhi,setAccTitle:Ba,getAccTitle:oo,setDiagramTitle:co,getDiagramTitle:$a,getAccDescription:lo,setAccDescription:so},Lhi=O(t=>{ah(t,rae),rae.setDomains(t.domains),rae.setTransitions(t.transitions)},"populate"),Mhi={parse:O(async t=>{const e=await Qp("cynefin",t);ye.debug(e),Lhi(e)},"parse")};function xU(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}O(xU,"seededRandom");function Eor(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"),Phi=O(()=>{const t=jy(),e=Dr();return uo(t,e.themeVariables).cynefin},"getCynefinDomainColors"),BMe=3,Nhi=O((t,e,r,n)=>{const i=n.db,a=i.getDomains(),o=i.getTransitions(),s=i.getDiagramTitle(),l=i.getAccTitle(),u=i.getAccDescription(),h=i.getConfig(),d=Phi();ye.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=nu(e);jo(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=Ihi(f,p),T=_or(h.seed,e),C=A.append("g").attr("class","cynefin-backgrounds"),k=["complex","complicated","chaotic","clear"];for(const N of k){const F=S[N];C.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",Ror(f,p,T,v)).attr("fill","none"),E.append("path").attr("class","cynefinBoundary").attr("d",Dor(f,p,T+100,v)).attr("fill","none"),E.append("path").attr("class","cynefinCliff").attr("d",Lor(f,p)).attr("fill","none");const _=f*.15,P=p*.15;A.append("path").attr("class","cynefinConfusion").attr("d",Mor(f/2,p/2,_,P)).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=Ior[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(Ior.confusion.practice)}const R=A.append("g").attr("class","cynefin-items"),D=26,M=10,I=["complex","complicated","chaotic","clear","confusion"];for(const N of I){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>BMe&&(U=F.items.length-BMe,z=F.items.slice(0,BMe));let Q;if(V){const G=m?22:14;Q=B.cy+G}else Q=B.cy+(m?25:15);if([...z].forEach((G,q)=>{const Y=Q+q*(D+4),ne=R.append("g"),X=ne.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",D/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(G.label);let J=G.label.length*7;const ee=X.node();if(ee&&typeof ee.getBBox=="function"){const ie=ee.getBBox();ie.width>0&&(J=ie.width)}const te=J+M*2,pe=B.cx-te/2;ne.attr("transform",`translate(${pe}, ${Y})`),ne.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",te).attr("height",D).attr("rx",4).attr("ry",4).attr("fill",x[N]).attr("fill-opacity",.95),X.attr("x",te/2).attr("y",D/2)}),U>0){const G=Q+z.length*(D+4),q=`+${U} more`,Y=R.append("g"),ne=Y.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",D/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(q);let X=q.length*7;const J=ne.node();if(J&&typeof J.getBBox=="function"){const pe=J.getBBox();pe.width>0&&(X=pe.width)}const ee=X+M*2,te=B.cx-ee/2;Y.attr("transform",`translate(${te}, ${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),ne.attr("x",ee/2).attr("y",D/2)}}if(o.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");o.forEach(V=>{const z=S[V.from],U=S[V.to];if(!z||!U)return;if(V.from===V.to){ye.warn(`Cynefin renderer: skipping self-loop on domain "${V.from}"`);return}const Q=z.cx,G=z.cy,q=U.cx,Y=U.cy,ne=(Q+q)/2,X=(G+Y)/2,J=q-Q,ee=Y-G,te=Math.sqrt(J*J+ee*ee),pe=te*.15,ie=-ee/te,Ce=J/te,ke=ne+ie*pe,Ee=X+Ce*pe;B.append("path").attr("class","cynefinArrowLine").attr("d",`M${Q},${G} Q${ke},${Ee} ${q},${Y}`).attr("fill","none").attr("marker-end",`url(#${F})`),V.label&&B.append("text").attr("class","cynefinArrowLabel").attr("x",ke).attr("y",Ee-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(V.label)})}s&&A.append("text").attr("class","cynefinTitle").attr("x",f/2).attr("y",-g/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(s)},"draw"),Bhi={draw:Nhi},$hi=O(()=>{const t=jy(),e=Dr();return uo(t,e.themeVariables).cynefin},"getCynefinTheme"),Fhi=O(()=>{const t=$hi();return` .cynefinDomain { stroke: none; } @@ -3892,8 +3892,8 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[U]||U)+"'":te="Parse error font-weight: bold; fill: ${t.labelColor}; } - `},"styles"),$hi=Bhi,Fhi={parser:Dhi,db:rae,renderer:Phi,styles:$hi};const zhi=Object.freeze(Object.defineProperty({__proto__:null,diagram:Fhi},Symbol.toStringTag,{value:"Module"}));var $Me="",FMe="",zMe="",UMe=[],nae=new Map,Gw=O(t=>li(t,Ye()),"sanitizeText"),FD=O(t=>{switch(t.type){case"terminal":return{...t,value:Gw(t.value)};case"nonterminal":return{...t,name:Gw(t.name)};case"sequence":return{...t,elements:t.elements.map(FD)};case"choice":return{...t,alternatives:t.alternatives.map(FD)};case"optional":return{...t,element:FD(t.element)};case"repetition":return{...t,element:FD(t.element),separator:t.separator?FD(t.separator):void 0};case"special":return{...t,text:Gw(t.text)}}},"sanitizeAstNode"),Uhi=O(()=>{$Me="",FMe="",zMe="",UMe.length=0,nae.clear(),_a(),ye.debug("[Railroad] Database cleared")},"clear"),Mor=O(t=>{$Me=Gw(t),ye.debug("[Railroad] Title set:",t)},"setTitle"),Ior=O(()=>$Me,"getTitle"),Vhi=O(t=>{const e={...t,name:Gw(t.name),definition:FD(t.definition),comment:t.comment?Gw(t.comment):void 0};ye.debug("[Railroad] Adding rule:",e.name),nae.has(e.name)&&ye.warn(`[Railroad] Rule '${e.name}' is already defined. Overwriting.`),UMe.push(e),nae.set(e.name,e)},"addRule"),Qhi=O(()=>UMe,"getRules"),Ghi=O(t=>nae.get(t),"getRule"),Hhi=O(t=>{FMe=Gw(t).replace(/^\s+/g,""),ye.debug("[Railroad] Accessibility title set:",t)},"setAccTitle"),Whi=O(()=>FMe,"getAccTitle"),Yhi=O(t=>{zMe=Gw(t).replace(/\n\s+/g,` -`),ye.debug("[Railroad] Accessibility description set:",t)},"setAccDescription"),qhi=O(()=>zMe,"getAccDescription"),jhi=Mor,Xhi=Ior,vo={clear:Uhi,setTitle:Mor,getTitle:Ior,addRule:Vhi,getRules:Qhi,getRule:Ghi,setAccTitle:Hhi,getAccTitle:Whi,setAccDescription:Yhi,getAccDescription:qhi,setDiagramTitle:jhi,getDiagramTitle:Xhi},Bc={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},Khi=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,Zhi=/^[\w "',.-]+$/,Jhi=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"]),Por=O(t=>t?Object.keys(t).every(e=>e==="railroad"||Jhi.has(e)):!1,"isRailroadStyleOptions"),edi=O(t=>t?"railroad"in t&&t.railroad?t.railroad:Por(t)?t:{}:{},"extractRailroadOverrides"),tdi=O(t=>{if(!t||Por(t))return{};const{railroad:e,svgId:r,theme:n,look:i,...a}=t;return a},"extractThemeOverrides"),Ta=O((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return Khi.test(r)?r:e},"sanitizeColorValue"),Nor=O((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return Zhi.test(r)?r:e},"sanitizeFontFamilyValue"),yk=O((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"),rdi=O(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"),ndi=O(t=>{const e=Nor(t.fontFamily,Bc.fontFamily),r=rdi(t.fontSize)??Bc.fontSize;return{...Bc,fontFamily:e,fontSize:r,terminalFill:Ta(t.secondBkg??t.secondaryColor,Bc.terminalFill),terminalStroke:Ta(t.secondaryBorderColor??t.lineColor,Bc.terminalStroke),terminalTextColor:Ta(t.secondaryTextColor??t.textColor,Bc.terminalTextColor),nonTerminalFill:Ta(t.mainBkg??t.background,Bc.nonTerminalFill),nonTerminalStroke:Ta(t.primaryBorderColor??t.lineColor,Bc.nonTerminalStroke),nonTerminalTextColor:Ta(t.primaryTextColor??t.textColor,Bc.nonTerminalTextColor),lineColor:Ta(t.lineColor,Bc.lineColor),markerFill:Ta(t.lineColor,Bc.markerFill),commentFill:Ta(t.labelBackground??t.tertiaryColor,Bc.commentFill),commentStroke:Ta(t.tertiaryBorderColor??t.lineColor,Bc.commentStroke),commentTextColor:Ta(t.tertiaryTextColor??t.textColor,Bc.commentTextColor),specialFill:Ta(t.tertiaryColor??t.secondaryColor,Bc.specialFill),specialStroke:Ta(t.tertiaryBorderColor??t.secondaryBorderColor,Bc.specialStroke),ruleNameColor:Ta(t.titleColor??t.textColor,Bc.ruleNameColor)}},"buildThemeDefaults"),VMe=O(t=>{const e=Dr(),r={...jy(),...e.themeVariables??{},...tdi(t)},n=ndi(r),i={...e.railroad??{},...edi(t)};return{compactMode:i.compactMode??n.compactMode,padding:yk(i.padding,n.padding),verticalSeparation:yk(i.verticalSeparation,n.verticalSeparation),horizontalSeparation:yk(i.horizontalSeparation,n.horizontalSeparation),arcRadius:yk(i.arcRadius,n.arcRadius),fontSize:yk(i.fontSize,n.fontSize),fontFamily:Nor(i.fontFamily,n.fontFamily),terminalFill:Ta(i.terminalFill,n.terminalFill),terminalStroke:Ta(i.terminalStroke,n.terminalStroke),terminalTextColor:Ta(i.terminalTextColor,n.terminalTextColor),nonTerminalFill:Ta(i.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:Ta(i.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:Ta(i.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:Ta(i.lineColor,n.lineColor),strokeWidth:yk(i.strokeWidth,n.strokeWidth),markerFill:Ta(i.markerFill,n.markerFill),commentFill:Ta(i.commentFill,n.commentFill),commentStroke:Ta(i.commentStroke,n.commentStroke),commentTextColor:Ta(i.commentTextColor,n.commentTextColor),specialFill:Ta(i.specialFill,n.specialFill),specialStroke:Ta(i.specialStroke,n.specialStroke),ruleNameColor:Ta(i.ruleNameColor,n.ruleNameColor),showMarkers:i.showMarkers??n.showMarkers,markerRadius:yk(i.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),iae=O(t=>{const{fontFamily:e,fontSize:r,terminalFill:n,terminalStroke:i,terminalTextColor:a,nonTerminalFill:o,nonTerminalStroke:s,nonTerminalTextColor:l,lineColor:u,strokeWidth:h,markerFill:d,commentFill:f,commentStroke:p,commentTextColor:g,specialFill:m,specialStroke:v,ruleNameColor:y}=VMe(t);return` + `},"styles"),zhi=Fhi,Uhi={parser:Mhi,db:rae,renderer:Bhi,styles:zhi};const Vhi=Object.freeze(Object.defineProperty({__proto__:null,diagram:Uhi},Symbol.toStringTag,{value:"Module"}));var $Me="",FMe="",zMe="",UMe=[],nae=new Map,Gw=O(t=>li(t,Ye()),"sanitizeText"),FD=O(t=>{switch(t.type){case"terminal":return{...t,value:Gw(t.value)};case"nonterminal":return{...t,name:Gw(t.name)};case"sequence":return{...t,elements:t.elements.map(FD)};case"choice":return{...t,alternatives:t.alternatives.map(FD)};case"optional":return{...t,element:FD(t.element)};case"repetition":return{...t,element:FD(t.element),separator:t.separator?FD(t.separator):void 0};case"special":return{...t,text:Gw(t.text)}}},"sanitizeAstNode"),Qhi=O(()=>{$Me="",FMe="",zMe="",UMe.length=0,nae.clear(),_a(),ye.debug("[Railroad] Database cleared")},"clear"),Por=O(t=>{$Me=Gw(t),ye.debug("[Railroad] Title set:",t)},"setTitle"),Nor=O(()=>$Me,"getTitle"),Ghi=O(t=>{const e={...t,name:Gw(t.name),definition:FD(t.definition),comment:t.comment?Gw(t.comment):void 0};ye.debug("[Railroad] Adding rule:",e.name),nae.has(e.name)&&ye.warn(`[Railroad] Rule '${e.name}' is already defined. Overwriting.`),UMe.push(e),nae.set(e.name,e)},"addRule"),Hhi=O(()=>UMe,"getRules"),Whi=O(t=>nae.get(t),"getRule"),Yhi=O(t=>{FMe=Gw(t).replace(/^\s+/g,""),ye.debug("[Railroad] Accessibility title set:",t)},"setAccTitle"),qhi=O(()=>FMe,"getAccTitle"),jhi=O(t=>{zMe=Gw(t).replace(/\n\s+/g,` +`),ye.debug("[Railroad] Accessibility description set:",t)},"setAccDescription"),Xhi=O(()=>zMe,"getAccDescription"),Khi=Por,Zhi=Nor,vo={clear:Qhi,setTitle:Por,getTitle:Nor,addRule:Ghi,getRules:Hhi,getRule:Whi,setAccTitle:Yhi,getAccTitle:qhi,setAccDescription:jhi,getAccDescription:Xhi,setDiagramTitle:Khi,getDiagramTitle:Zhi},Bc={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},Jhi=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,edi=/^[\w "',.-]+$/,tdi=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"]),Bor=O(t=>t?Object.keys(t).every(e=>e==="railroad"||tdi.has(e)):!1,"isRailroadStyleOptions"),rdi=O(t=>t?"railroad"in t&&t.railroad?t.railroad:Bor(t)?t:{}:{},"extractRailroadOverrides"),ndi=O(t=>{if(!t||Bor(t))return{};const{railroad:e,svgId:r,theme:n,look:i,...a}=t;return a},"extractThemeOverrides"),Ta=O((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return Jhi.test(r)?r:e},"sanitizeColorValue"),$or=O((t,e)=>{if(typeof t!="string")return e;const r=t.trim();return edi.test(r)?r:e},"sanitizeFontFamilyValue"),yk=O((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"),idi=O(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"),adi=O(t=>{const e=$or(t.fontFamily,Bc.fontFamily),r=idi(t.fontSize)??Bc.fontSize;return{...Bc,fontFamily:e,fontSize:r,terminalFill:Ta(t.secondBkg??t.secondaryColor,Bc.terminalFill),terminalStroke:Ta(t.secondaryBorderColor??t.lineColor,Bc.terminalStroke),terminalTextColor:Ta(t.secondaryTextColor??t.textColor,Bc.terminalTextColor),nonTerminalFill:Ta(t.mainBkg??t.background,Bc.nonTerminalFill),nonTerminalStroke:Ta(t.primaryBorderColor??t.lineColor,Bc.nonTerminalStroke),nonTerminalTextColor:Ta(t.primaryTextColor??t.textColor,Bc.nonTerminalTextColor),lineColor:Ta(t.lineColor,Bc.lineColor),markerFill:Ta(t.lineColor,Bc.markerFill),commentFill:Ta(t.labelBackground??t.tertiaryColor,Bc.commentFill),commentStroke:Ta(t.tertiaryBorderColor??t.lineColor,Bc.commentStroke),commentTextColor:Ta(t.tertiaryTextColor??t.textColor,Bc.commentTextColor),specialFill:Ta(t.tertiaryColor??t.secondaryColor,Bc.specialFill),specialStroke:Ta(t.tertiaryBorderColor??t.secondaryBorderColor,Bc.specialStroke),ruleNameColor:Ta(t.titleColor??t.textColor,Bc.ruleNameColor)}},"buildThemeDefaults"),VMe=O(t=>{const e=Dr(),r={...jy(),...e.themeVariables??{},...ndi(t)},n=adi(r),i={...e.railroad??{},...rdi(t)};return{compactMode:i.compactMode??n.compactMode,padding:yk(i.padding,n.padding),verticalSeparation:yk(i.verticalSeparation,n.verticalSeparation),horizontalSeparation:yk(i.horizontalSeparation,n.horizontalSeparation),arcRadius:yk(i.arcRadius,n.arcRadius),fontSize:yk(i.fontSize,n.fontSize),fontFamily:$or(i.fontFamily,n.fontFamily),terminalFill:Ta(i.terminalFill,n.terminalFill),terminalStroke:Ta(i.terminalStroke,n.terminalStroke),terminalTextColor:Ta(i.terminalTextColor,n.terminalTextColor),nonTerminalFill:Ta(i.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:Ta(i.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:Ta(i.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:Ta(i.lineColor,n.lineColor),strokeWidth:yk(i.strokeWidth,n.strokeWidth),markerFill:Ta(i.markerFill,n.markerFill),commentFill:Ta(i.commentFill,n.commentFill),commentStroke:Ta(i.commentStroke,n.commentStroke),commentTextColor:Ta(i.commentTextColor,n.commentTextColor),specialFill:Ta(i.specialFill,n.specialFill),specialStroke:Ta(i.specialStroke,n.specialStroke),ruleNameColor:Ta(i.ruleNameColor,n.ruleNameColor),showMarkers:i.showMarkers??n.showMarkers,markerRadius:yk(i.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),iae=O(t=>{const{fontFamily:e,fontSize:r,terminalFill:n,terminalStroke:i,terminalTextColor:a,nonTerminalFill:o,nonTerminalStroke:s,nonTerminalTextColor:l,lineColor:u,strokeWidth:h,markerFill:d,commentFill:f,commentStroke:p,commentTextColor:g,specialFill:m,specialStroke:v,ruleNameColor:y}=VMe(t);return` .railroad-diagram { font-family: ${e}; font-size: ${r}px; @@ -3978,5 +3978,5 @@ Expecting `+ee.join(", ")+", got '"+(this.terminals_[U]||U)+"'":te="Parse error .railroad-group { /* Grouping container, no specific styles */ } -`},"getStyles"),Wp=(AP=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,o,s){return this.d+=`A ${e} ${r} ${n} ${i?1:0} ${a?1:0} ${o} ${s} `,this}build(){return this.d.trim()}},O(AP,"PathBuilder"),AP),idi=(SP=class{constructor(e,r=VMe()){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,o=e.append("g").attr("class","railroad-terminal");return o.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a).attr("rx",10).attr("ry",10),o.append("text").attr("x",i/2).attr("y",a/2).text(r),{element:o.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,o=e.append("g").attr("class","railroad-nonterminal");return o.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a),o.append("text").attr("x",i/2).attr("y",a/2).text(r),{element:o.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,o=0;for(const u of n)i+=u.dimensions.width,a=Math.max(a,u.dimensions.up),o=Math.max(o,u.dimensions.down);i+=(n.length-1)*this.config.horizontalSeparation;const s=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 o=this.config.arcRadius,s=o*4,l=i+s,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=o*2+(i-f.dimensions.width)/2;u.node().appendChild(f.element).setAttribute("transform",`translate(${m}, ${p})`);const y=new Wp,b=g>d;g===d?y.moveTo(0,d).lineTo(m,g):y.moveTo(0,d).arcTo(o,o,0,!1,b,o,d+(b?o:-o)).lineTo(o,g-(b?o:-o)).arcTo(o,o,0,!1,!b,o*2,g).lineTo(m,g),u.append("path").attr("class","railroad-line").attr("d",y.build());const x=new Wp,w=m+f.dimensions.width,A=l-o*2;g===d?x.moveTo(w,g).lineTo(l,d):x.moveTo(w,g).lineTo(A,g).arcTo(o,o,0,!1,!b,l-o,g+(b?-o:o)).lineTo(l-o,d+(b?o:-o)).arcTo(o,o,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,o=n.dimensions.width+i*4,s=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 Wp().moveTo(0,f).lineTo(i*2,f);l.append("path").attr("class","railroad-line").attr("d",p.build());const g=new Wp().moveTo(u+n.dimensions.width,f).lineTo(o,f);l.append("path").attr("class","railroad-line").attr("d",g.build());const m=new Wp().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(o-i*2,0).arcTo(i,i,0,!1,!0,o-i,i).lineTo(o-i,f-i).arcTo(i,i,0,!1,!1,o,f);return l.append("path").attr("class","railroad-line").attr("d",m.build()),{element:l.node(),dimensions:{width:o,height:s,up:f,down:s-f}}}renderRepetition(e,r,n){const i=this.renderExpression(e,r),a=this.config.arcRadius,o=a*2,s=i.dimensions.width+a*4,l=n===0,u=i.dimensions.height+o+(l?o:0),h=e.append("g").attr("class","railroad-repetition"),d=a*2,f=l?o: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 Wp().moveTo(0,g).lineTo(a*2,g).build()),h.append("path").attr("class","railroad-line").attr("d",new Wp().moveTo(d+i.dimensions.width,g).lineTo(s,g).build());const m=f+i.dimensions.height+a,v=new Wp().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 Wp().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(s-a*2,0).arcTo(a,a,0,!1,!0,s-a,a).lineTo(s-a,g-a).arcTo(a,a,0,!1,!1,s,g);h.append("path").attr("class","railroad-line").attr("d",y.build())}return{element:h.node(),dimensions:{width:s,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,o=e.append("g").attr("class","railroad-special");return o.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a),o.append("text").attr("x",i/2).attr("y",a/2).text("? "+r+" ?"),{element:o.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,o=a+20,s=n.append("g"),l=this.renderExpression(s,e.definition),u=Math.max(20,l.dimensions.up),h=u-l.dimensions.up;return s.attr("transform",`translate(${o}, ${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",o+l.dimensions.width+10).attr("cy",u).attr("r",this.config.markerRadius),n.append("path").attr("class","railroad-line").attr("d",new Wp().moveTo(a+this.config.markerRadius,u).lineTo(o,u).build()),n.append("path").attr("class","railroad-line").attr("d",new Wp().moveTo(o+l.dimensions.width,u).lineTo(o+l.dimensions.width+10-this.config.markerRadius,u).build()),{height:Math.max(40,h+l.dimensions.height+this.config.padding*2),width:o+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}}},O(SP,"RailroadRenderer"),SP),Bor=O((t,e,r)=>{jo(t,e.height,e.width,r),t.attr("viewBox",`0 0 ${e.width} ${e.height}`)},"configureRailroadSvgSize"),adi=O((t,e,r)=>{ye.debug(`[Railroad] Rendering diagram -`+t);try{const n=nu(e);n.attr("class","railroad-diagram");const i=Dr().railroad,a=(i==null?void 0:i.useMaxWidth)??!0,o=vo.getRules();if(ye.debug(`[Railroad] Rendering ${o.length} rules`),o.length===0){ye.warn("[Railroad] No rules to render"),Bor(n,{height:100,width:200},a);return}const l=new idi(n,VMe()).renderDiagram(o);Bor(n,l,a),ye.debug("[Railroad] Render complete")}catch(n){throw ye.error("[Railroad] Render error:",n),n}},"draw"),aae={draw:adi},odi=CDe().Railroad.parser.LangiumParser,zD=O(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(zD);return e.length===1?e[0]:{type:"sequence",elements:e}}case"RailroadChoiceExpr":{const e=t.alternatives.map(zD);return e.length===1?e[0]:{type:"choice",alternatives:e}}case"RailroadOptionalExpr":return{type:"optional",element:zD(t.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:zD(t.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:zD(t.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${t.$type}`)}},"transformExpression"),sdi=O(t=>({name:t.name,definition:zD(t.definition)}),"transformRule"),ldi=O(t=>{ah(t,vo),t.title&&vo.setTitle(t.title),t.rules.map(e=>vo.addRule(sdi(e)))},"populateDb"),cdi={parse:O(t=>{vo.clear(),ye.debug("[Railroad Parser] Starting Langium parse");const e=odi.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Xz(e);const r=e.value;ye.debug("[Railroad Parser] Parsed rules:",r.rules.length),ldi(r),ye.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:vo}},udi={parser:cdi,db:vo,renderer:aae,styles:iae};const hdi=Object.freeze(Object.defineProperty({__proto__:null,diagram:udi},Symbol.toStringTag,{value:"Module"}));var ddi=ODe().RailroadEbnf.parser.LangiumParser,oae=O(t=>{const e=t.alternatives.map(fdi);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformChoice"),fdi=O(t=>{const e=t.elements.map(gdi);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),$or=O(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 oae(t.element);case"EbnfOptional":return{type:"optional",element:oae(t.element)};case"EbnfRepetition":return{type:"repetition",element:oae(t.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),pdi=O((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:"-"},$or(e.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${e.$type}`)}},"transformPostfix"),gdi=O(t=>t.postfixes.reduce((e,r)=>pdi(e,r),$or(t.base)),"transformTerm"),mdi=O(t=>({name:t.name,definition:oae(t.definition)}),"transformRule"),vdi=O(t=>{ah(t,vo),t.title&&vo.setTitle(t.title),t.rules.map(e=>vo.addRule(mdi(e)))},"populateDb"),ydi={parse:O(t=>{vo.clear(),ye.debug("[EBNF Parser] Starting Langium parse");const e=ddi.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Xz(e);const r=e.value;ye.debug("[EBNF Parser] Parsed rules:",r.rules.length),vdi(r),ye.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:vo}},bdi={parser:ydi,db:vo,renderer:aae,styles:iae};const xdi=Object.freeze(Object.defineProperty({__proto__:null,diagram:bdi},Symbol.toStringTag,{value:"Module"}));var wdi=kDe().RailroadAbnf.parser.LangiumParser,QMe=O(t=>{const e=t.alternatives.map(Adi);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformAlternation"),Adi=O(t=>{const e=t.elements.map(Tdi);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformConcatenation"),Sdi=O(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"),Tdi=O(t=>{const e=Cdi(t.primary);if(!t.repeat)return e;const{min:r,max:n}=Sdi(t.repeat);return r===0&&n===1?{type:"optional",element:e}:{type:"repetition",element:e,min:r,max:n}},"transformElement"),Cdi=O(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 QMe(t.element);case"AbnfOptionalGroup":return{type:"optional",element:QMe(t.element)};default:throw new Error(`Unsupported ABNF primary node: ${t.$type}`)}},"transformPrimary"),Odi=O(t=>({name:t.name,definition:QMe(t.definition)}),"transformRule"),kdi=O(t=>{ah(t,vo),t.title&&vo.setTitle(t.title),t.rules.map(e=>vo.addRule(Odi(e)))},"populateDb"),Edi={parse:O(t=>{vo.clear(),ye.debug("[ABNF Parser] Starting Langium parse");const e=wdi.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Xz(e);const r=e.value;ye.debug("[ABNF Parser] Parsed rules:",r.rules.length),kdi(r),ye.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:vo}},_di={parser:Edi,db:vo,renderer:aae,styles:iae};const Rdi=Object.freeze(Object.defineProperty({__proto__:null,diagram:_di},Symbol.toStringTag,{value:"Module"}));var Ddi=EDe().RailroadPeg.parser.LangiumParser,For=O(t=>{const e=t.alternatives.map(Ldi);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformOrderedChoice"),Ldi=O(t=>{const e=t.elements.map(Mdi);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),Mdi=O(t=>{const e=Idi(t.suffix);return t.operator?{type:"special",text:t.operator==="&"?`&${zor(e)}`:`!${zor(e)}`}:e},"transformPrefix"),zor=O(t=>{switch(t.type){case"terminal":return`"${t.value}"`;case"nonterminal":return t.name;case"special":return t.text;default:return"(...)"}},"nodeToLabel"),Idi=O(t=>{const e=Pdi(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"),Pdi=O(t=>{switch(t.$type){case"PegLiteral":return{type:"terminal",value:t.value};case"PegIdentifier":return{type:"nonterminal",name:t.name};case"PegGroup":return For(t.element);case"PegAny":return{type:"special",text:t.dot};default:throw new Error(`Unsupported PEG primary node: ${t.$type}`)}},"transformPrimary"),Ndi=O(t=>({name:t.name,definition:For(t.definition)}),"transformRule"),Bdi=O(t=>{ah(t,vo),t.title&&vo.setTitle(t.title),t.rules.map(e=>vo.addRule(Ndi(e)))},"populateDb"),$di={parse:O(t=>{vo.clear(),ye.debug("[PEG Parser] Starting Langium parse");const e=Ddi.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Xz(e);const r=e.value;ye.debug("[PEG Parser] Parsed rules:",r.rules.length),Bdi(r),ye.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:vo}},Fdi={parser:$di,db:vo,renderer:aae,styles:iae};const zdi=Object.freeze(Object.defineProperty({__proto__:null,diagram:Fdi},Symbol.toStringTag,{value:"Module"}));var Udi=1;function GMe(){if(!(typeof globalThis>"u"))return globalThis}O(GMe,"getCaptureGlobal");function Uor(){var t;return!!((t=GMe())!=null&&t.mermaidCaptureSizes)}O(Uor,"shouldCaptureSizes");function Vor(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}O(Vor,"capturedFromLocation");function Qor(t,e){const r=GMe();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 o={svgId:a,sizes:t};r.mermaidCapturedSizes.push(o),r.mermaidLastCapturedSizes=o}O(Qor,"emitCapturedSizes");function Gor(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&&Qor({metadata:{captureVersion:Udi,capturedAt:new Date().toISOString(),capturedFrom:Vor()},nodes:r},t)}O(Gor,"captureNodeSizes");const Vdi=Object.freeze(Object.defineProperty({__proto__:null,captureNodeSizes:Gor,shouldCaptureSizes:Uor},Symbol.toStringTag,{value:"Module"})),Qdi=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:Ner,createInfoServices:Ber},Symbol.toStringTag,{value:"Module"})),Gdi=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:$er,createPacketServices:Fer},Symbol.toStringTag,{value:"Module"})),Hdi=Object.freeze(Object.defineProperty({__proto__:null,PieModule:zer,createPieServices:Uer},Symbol.toStringTag,{value:"Module"})),Wdi=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:Ver,createTreeViewServices:Qer},Symbol.toStringTag,{value:"Module"})),Ydi=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:Ger,createArchitectureServices:Her},Symbol.toStringTag,{value:"Module"})),qdi=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:Ier,createGitGraphServices:Per},Symbol.toStringTag,{value:"Module"})),jdi=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:Ker,createEventModelingServices:Zer},Symbol.toStringTag,{value:"Module"})),Xdi=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:yer,createRadarServices:ber},Symbol.toStringTag,{value:"Module"})),Kdi=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:wer,createRailroadServices:CDe},Symbol.toStringTag,{value:"Module"})),Zdi=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:Ser,createRailroadEbnfServices:ODe},Symbol.toStringTag,{value:"Module"})),Jdi=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:Ter,createRailroadAbnfServices:kDe},Symbol.toStringTag,{value:"Module"})),efi=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:Oer,createRailroadPegServices:EDe},Symbol.toStringTag,{value:"Module"})),tfi=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:Eer,createTreemapServices:_er},Symbol.toStringTag,{value:"Module"})),rfi=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:Rer,createWardleyServices:Der},Symbol.toStringTag,{value:"Module"})),nfi=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:Ler,createCynefinServices:Mer},Symbol.toStringTag,{value:"Module"}))})(); +`},"getStyles"),Wp=(AP=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,o,s){return this.d+=`A ${e} ${r} ${n} ${i?1:0} ${a?1:0} ${o} ${s} `,this}build(){return this.d.trim()}},O(AP,"PathBuilder"),AP),odi=(SP=class{constructor(e,r=VMe()){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,o=e.append("g").attr("class","railroad-terminal");return o.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a).attr("rx",10).attr("ry",10),o.append("text").attr("x",i/2).attr("y",a/2).text(r),{element:o.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,o=e.append("g").attr("class","railroad-nonterminal");return o.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a),o.append("text").attr("x",i/2).attr("y",a/2).text(r),{element:o.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,o=0;for(const u of n)i+=u.dimensions.width,a=Math.max(a,u.dimensions.up),o=Math.max(o,u.dimensions.down);i+=(n.length-1)*this.config.horizontalSeparation;const s=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 o=this.config.arcRadius,s=o*4,l=i+s,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=o*2+(i-f.dimensions.width)/2;u.node().appendChild(f.element).setAttribute("transform",`translate(${m}, ${p})`);const y=new Wp,b=g>d;g===d?y.moveTo(0,d).lineTo(m,g):y.moveTo(0,d).arcTo(o,o,0,!1,b,o,d+(b?o:-o)).lineTo(o,g-(b?o:-o)).arcTo(o,o,0,!1,!b,o*2,g).lineTo(m,g),u.append("path").attr("class","railroad-line").attr("d",y.build());const x=new Wp,w=m+f.dimensions.width,A=l-o*2;g===d?x.moveTo(w,g).lineTo(l,d):x.moveTo(w,g).lineTo(A,g).arcTo(o,o,0,!1,!b,l-o,g+(b?-o:o)).lineTo(l-o,d+(b?o:-o)).arcTo(o,o,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,o=n.dimensions.width+i*4,s=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 Wp().moveTo(0,f).lineTo(i*2,f);l.append("path").attr("class","railroad-line").attr("d",p.build());const g=new Wp().moveTo(u+n.dimensions.width,f).lineTo(o,f);l.append("path").attr("class","railroad-line").attr("d",g.build());const m=new Wp().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(o-i*2,0).arcTo(i,i,0,!1,!0,o-i,i).lineTo(o-i,f-i).arcTo(i,i,0,!1,!1,o,f);return l.append("path").attr("class","railroad-line").attr("d",m.build()),{element:l.node(),dimensions:{width:o,height:s,up:f,down:s-f}}}renderRepetition(e,r,n){const i=this.renderExpression(e,r),a=this.config.arcRadius,o=a*2,s=i.dimensions.width+a*4,l=n===0,u=i.dimensions.height+o+(l?o:0),h=e.append("g").attr("class","railroad-repetition"),d=a*2,f=l?o: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 Wp().moveTo(0,g).lineTo(a*2,g).build()),h.append("path").attr("class","railroad-line").attr("d",new Wp().moveTo(d+i.dimensions.width,g).lineTo(s,g).build());const m=f+i.dimensions.height+a,v=new Wp().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 Wp().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(s-a*2,0).arcTo(a,a,0,!1,!0,s-a,a).lineTo(s-a,g-a).arcTo(a,a,0,!1,!1,s,g);h.append("path").attr("class","railroad-line").attr("d",y.build())}return{element:h.node(),dimensions:{width:s,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,o=e.append("g").attr("class","railroad-special");return o.append("rect").attr("x",0).attr("y",0).attr("width",i).attr("height",a),o.append("text").attr("x",i/2).attr("y",a/2).text("? "+r+" ?"),{element:o.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,o=a+20,s=n.append("g"),l=this.renderExpression(s,e.definition),u=Math.max(20,l.dimensions.up),h=u-l.dimensions.up;return s.attr("transform",`translate(${o}, ${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",o+l.dimensions.width+10).attr("cy",u).attr("r",this.config.markerRadius),n.append("path").attr("class","railroad-line").attr("d",new Wp().moveTo(a+this.config.markerRadius,u).lineTo(o,u).build()),n.append("path").attr("class","railroad-line").attr("d",new Wp().moveTo(o+l.dimensions.width,u).lineTo(o+l.dimensions.width+10-this.config.markerRadius,u).build()),{height:Math.max(40,h+l.dimensions.height+this.config.padding*2),width:o+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}}},O(SP,"RailroadRenderer"),SP),For=O((t,e,r)=>{jo(t,e.height,e.width,r),t.attr("viewBox",`0 0 ${e.width} ${e.height}`)},"configureRailroadSvgSize"),sdi=O((t,e,r)=>{ye.debug(`[Railroad] Rendering diagram +`+t);try{const n=nu(e);n.attr("class","railroad-diagram");const i=Dr().railroad,a=(i==null?void 0:i.useMaxWidth)??!0,o=vo.getRules();if(ye.debug(`[Railroad] Rendering ${o.length} rules`),o.length===0){ye.warn("[Railroad] No rules to render"),For(n,{height:100,width:200},a);return}const l=new odi(n,VMe()).renderDiagram(o);For(n,l,a),ye.debug("[Railroad] Render complete")}catch(n){throw ye.error("[Railroad] Render error:",n),n}},"draw"),aae={draw:sdi},ldi=CDe().Railroad.parser.LangiumParser,zD=O(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(zD);return e.length===1?e[0]:{type:"sequence",elements:e}}case"RailroadChoiceExpr":{const e=t.alternatives.map(zD);return e.length===1?e[0]:{type:"choice",alternatives:e}}case"RailroadOptionalExpr":return{type:"optional",element:zD(t.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:zD(t.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:zD(t.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${t.$type}`)}},"transformExpression"),cdi=O(t=>({name:t.name,definition:zD(t.definition)}),"transformRule"),udi=O(t=>{ah(t,vo),t.title&&vo.setTitle(t.title),t.rules.map(e=>vo.addRule(cdi(e)))},"populateDb"),hdi={parse:O(t=>{vo.clear(),ye.debug("[Railroad Parser] Starting Langium parse");const e=ldi.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Xz(e);const r=e.value;ye.debug("[Railroad Parser] Parsed rules:",r.rules.length),udi(r),ye.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:vo}},ddi={parser:hdi,db:vo,renderer:aae,styles:iae};const fdi=Object.freeze(Object.defineProperty({__proto__:null,diagram:ddi},Symbol.toStringTag,{value:"Module"}));var pdi=ODe().RailroadEbnf.parser.LangiumParser,oae=O(t=>{const e=t.alternatives.map(gdi);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformChoice"),gdi=O(t=>{const e=t.elements.map(vdi);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),zor=O(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 oae(t.element);case"EbnfOptional":return{type:"optional",element:oae(t.element)};case"EbnfRepetition":return{type:"repetition",element:oae(t.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${t.$type}`)}},"transformPrimary"),mdi=O((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:"-"},zor(e.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${e.$type}`)}},"transformPostfix"),vdi=O(t=>t.postfixes.reduce((e,r)=>mdi(e,r),zor(t.base)),"transformTerm"),ydi=O(t=>({name:t.name,definition:oae(t.definition)}),"transformRule"),bdi=O(t=>{ah(t,vo),t.title&&vo.setTitle(t.title),t.rules.map(e=>vo.addRule(ydi(e)))},"populateDb"),xdi={parse:O(t=>{vo.clear(),ye.debug("[EBNF Parser] Starting Langium parse");const e=pdi.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Xz(e);const r=e.value;ye.debug("[EBNF Parser] Parsed rules:",r.rules.length),bdi(r),ye.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:vo}},wdi={parser:xdi,db:vo,renderer:aae,styles:iae};const Adi=Object.freeze(Object.defineProperty({__proto__:null,diagram:wdi},Symbol.toStringTag,{value:"Module"}));var Sdi=kDe().RailroadAbnf.parser.LangiumParser,QMe=O(t=>{const e=t.alternatives.map(Tdi);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformAlternation"),Tdi=O(t=>{const e=t.elements.map(Odi);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformConcatenation"),Cdi=O(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"),Odi=O(t=>{const e=kdi(t.primary);if(!t.repeat)return e;const{min:r,max:n}=Cdi(t.repeat);return r===0&&n===1?{type:"optional",element:e}:{type:"repetition",element:e,min:r,max:n}},"transformElement"),kdi=O(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 QMe(t.element);case"AbnfOptionalGroup":return{type:"optional",element:QMe(t.element)};default:throw new Error(`Unsupported ABNF primary node: ${t.$type}`)}},"transformPrimary"),Edi=O(t=>({name:t.name,definition:QMe(t.definition)}),"transformRule"),_di=O(t=>{ah(t,vo),t.title&&vo.setTitle(t.title),t.rules.map(e=>vo.addRule(Edi(e)))},"populateDb"),Rdi={parse:O(t=>{vo.clear(),ye.debug("[ABNF Parser] Starting Langium parse");const e=Sdi.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Xz(e);const r=e.value;ye.debug("[ABNF Parser] Parsed rules:",r.rules.length),_di(r),ye.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:vo}},Ddi={parser:Rdi,db:vo,renderer:aae,styles:iae};const Ldi=Object.freeze(Object.defineProperty({__proto__:null,diagram:Ddi},Symbol.toStringTag,{value:"Module"}));var Mdi=EDe().RailroadPeg.parser.LangiumParser,Uor=O(t=>{const e=t.alternatives.map(Idi);return e.length===1?e[0]:{type:"choice",alternatives:e}},"transformOrderedChoice"),Idi=O(t=>{const e=t.elements.map(Pdi);return e.length===1?e[0]:{type:"sequence",elements:e}},"transformSequence"),Pdi=O(t=>{const e=Ndi(t.suffix);return t.operator?{type:"special",text:t.operator==="&"?`&${Vor(e)}`:`!${Vor(e)}`}:e},"transformPrefix"),Vor=O(t=>{switch(t.type){case"terminal":return`"${t.value}"`;case"nonterminal":return t.name;case"special":return t.text;default:return"(...)"}},"nodeToLabel"),Ndi=O(t=>{const e=Bdi(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"),Bdi=O(t=>{switch(t.$type){case"PegLiteral":return{type:"terminal",value:t.value};case"PegIdentifier":return{type:"nonterminal",name:t.name};case"PegGroup":return Uor(t.element);case"PegAny":return{type:"special",text:t.dot};default:throw new Error(`Unsupported PEG primary node: ${t.$type}`)}},"transformPrimary"),$di=O(t=>({name:t.name,definition:Uor(t.definition)}),"transformRule"),Fdi=O(t=>{ah(t,vo),t.title&&vo.setTitle(t.title),t.rules.map(e=>vo.addRule($di(e)))},"populateDb"),zdi={parse:O(t=>{vo.clear(),ye.debug("[PEG Parser] Starting Langium parse");const e=Mdi.parse(t);if(e.lexerErrors.length>0||e.parserErrors.length>0)throw new Xz(e);const r=e.value;ye.debug("[PEG Parser] Parsed rules:",r.rules.length),Fdi(r),ye.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:vo}},Udi={parser:zdi,db:vo,renderer:aae,styles:iae};const Vdi=Object.freeze(Object.defineProperty({__proto__:null,diagram:Udi},Symbol.toStringTag,{value:"Module"}));var Qdi=1;function GMe(){if(!(typeof globalThis>"u"))return globalThis}O(GMe,"getCaptureGlobal");function Qor(){var t;return!!((t=GMe())!=null&&t.mermaidCaptureSizes)}O(Qor,"shouldCaptureSizes");function Gor(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}O(Gor,"capturedFromLocation");function Hor(t,e){const r=GMe();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 o={svgId:a,sizes:t};r.mermaidCapturedSizes.push(o),r.mermaidLastCapturedSizes=o}O(Hor,"emitCapturedSizes");function Wor(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&&Hor({metadata:{captureVersion:Qdi,capturedAt:new Date().toISOString(),capturedFrom:Gor()},nodes:r},t)}O(Wor,"captureNodeSizes");const Gdi=Object.freeze(Object.defineProperty({__proto__:null,captureNodeSizes:Wor,shouldCaptureSizes:Qor},Symbol.toStringTag,{value:"Module"})),Hdi=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:$er,createInfoServices:Fer},Symbol.toStringTag,{value:"Module"})),Wdi=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:zer,createPacketServices:Uer},Symbol.toStringTag,{value:"Module"})),Ydi=Object.freeze(Object.defineProperty({__proto__:null,PieModule:Ver,createPieServices:Qer},Symbol.toStringTag,{value:"Module"})),qdi=Object.freeze(Object.defineProperty({__proto__:null,TreeViewModule:Ger,createTreeViewServices:Her},Symbol.toStringTag,{value:"Module"})),jdi=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:Wer,createArchitectureServices:Yer},Symbol.toStringTag,{value:"Module"})),Xdi=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:Ner,createGitGraphServices:Ber},Symbol.toStringTag,{value:"Module"})),Kdi=Object.freeze(Object.defineProperty({__proto__:null,EventModelingModule:Jer,createEventModelingServices:etr},Symbol.toStringTag,{value:"Module"})),Zdi=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:xer,createRadarServices:wer},Symbol.toStringTag,{value:"Module"})),Jdi=Object.freeze(Object.defineProperty({__proto__:null,RailroadModule:Ser,createRailroadServices:CDe},Symbol.toStringTag,{value:"Module"})),efi=Object.freeze(Object.defineProperty({__proto__:null,RailroadEbnfModule:Cer,createRailroadEbnfServices:ODe},Symbol.toStringTag,{value:"Module"})),tfi=Object.freeze(Object.defineProperty({__proto__:null,RailroadAbnfModule:Oer,createRailroadAbnfServices:kDe},Symbol.toStringTag,{value:"Module"})),rfi=Object.freeze(Object.defineProperty({__proto__:null,RailroadPegModule:Eer,createRailroadPegServices:EDe},Symbol.toStringTag,{value:"Module"})),nfi=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:Rer,createTreemapServices:Der},Symbol.toStringTag,{value:"Module"})),ifi=Object.freeze(Object.defineProperty({__proto__:null,WardleyModule:Ler,createWardleyServices:Mer},Symbol.toStringTag,{value:"Module"})),afi=Object.freeze(Object.defineProperty({__proto__:null,CynefinModule:Ier,createCynefinServices:Per},Symbol.toStringTag,{value:"Module"}))})();